Lines Matching refs:tpt_trig

169 				      struct tpt_led_trigger *tpt_trig)  in tpt_trig_traffic()  argument
173 traffic = tpt_trig->tx_bytes + tpt_trig->rx_bytes; in tpt_trig_traffic()
175 delta = traffic - tpt_trig->prev_traffic; in tpt_trig_traffic()
176 tpt_trig->prev_traffic = traffic; in tpt_trig_traffic()
183 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; in tpt_trig_timer() local
188 if (!tpt_trig->running) in tpt_trig_timer()
191 mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ)); in tpt_trig_timer()
193 tpt = tpt_trig_traffic(local, tpt_trig); in tpt_trig_timer()
199 for (i = tpt_trig->blink_table_len - 1; i >= 0; i--) { in tpt_trig_timer()
200 if (tpt_trig->blink_table[i].throughput < 0 || in tpt_trig_timer()
201 tpt > tpt_trig->blink_table[i].throughput) { in tpt_trig_timer()
202 off = tpt_trig->blink_table[i].blink_time / 2; in tpt_trig_timer()
203 on = tpt_trig->blink_table[i].blink_time - off; in tpt_trig_timer()
208 read_lock(&tpt_trig->trig.leddev_list_lock); in tpt_trig_timer()
209 list_for_each_entry(led_cdev, &tpt_trig->trig.led_cdevs, trig_list) in tpt_trig_timer()
211 read_unlock(&tpt_trig->trig.leddev_list_lock); in tpt_trig_timer()
220 struct tpt_led_trigger *tpt_trig; in __ieee80211_create_tpt_led_trigger() local
225 tpt_trig = kzalloc(sizeof(struct tpt_led_trigger), GFP_KERNEL); in __ieee80211_create_tpt_led_trigger()
226 if (!tpt_trig) in __ieee80211_create_tpt_led_trigger()
229 snprintf(tpt_trig->name, sizeof(tpt_trig->name), in __ieee80211_create_tpt_led_trigger()
232 tpt_trig->trig.name = tpt_trig->name; in __ieee80211_create_tpt_led_trigger()
234 tpt_trig->blink_table = blink_table; in __ieee80211_create_tpt_led_trigger()
235 tpt_trig->blink_table_len = blink_table_len; in __ieee80211_create_tpt_led_trigger()
236 tpt_trig->want = flags; in __ieee80211_create_tpt_led_trigger()
238 setup_timer(&tpt_trig->timer, tpt_trig_timer, (unsigned long)local); in __ieee80211_create_tpt_led_trigger()
240 local->tpt_led_trigger = tpt_trig; in __ieee80211_create_tpt_led_trigger()
242 return tpt_trig->name; in __ieee80211_create_tpt_led_trigger()
248 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; in ieee80211_start_tpt_led_trig() local
250 if (tpt_trig->running) in ieee80211_start_tpt_led_trig()
254 tpt_trig_traffic(local, tpt_trig); in ieee80211_start_tpt_led_trig()
255 tpt_trig->running = true; in ieee80211_start_tpt_led_trig()
258 mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ)); in ieee80211_start_tpt_led_trig()
263 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; in ieee80211_stop_tpt_led_trig() local
266 if (!tpt_trig->running) in ieee80211_stop_tpt_led_trig()
269 tpt_trig->running = false; in ieee80211_stop_tpt_led_trig()
270 del_timer_sync(&tpt_trig->timer); in ieee80211_stop_tpt_led_trig()
272 read_lock(&tpt_trig->trig.leddev_list_lock); in ieee80211_stop_tpt_led_trig()
273 list_for_each_entry(led_cdev, &tpt_trig->trig.led_cdevs, trig_list) in ieee80211_stop_tpt_led_trig()
275 read_unlock(&tpt_trig->trig.leddev_list_lock); in ieee80211_stop_tpt_led_trig()
281 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; in ieee80211_mod_tpt_led_trig() local
286 if (!tpt_trig) in ieee80211_mod_tpt_led_trig()
289 tpt_trig->active &= ~types_off; in ieee80211_mod_tpt_led_trig()
290 tpt_trig->active |= types_on; in ieee80211_mod_tpt_led_trig()
298 allowed = tpt_trig->active & IEEE80211_TPT_LEDTRIG_FL_RADIO; in ieee80211_mod_tpt_led_trig()
300 if (!allowed || !(tpt_trig->active & tpt_trig->want)) in ieee80211_mod_tpt_led_trig()