Lines Matching refs:tpt_trig
247 struct tpt_led_trigger *tpt_trig) in tpt_trig_traffic() argument
251 traffic = tpt_trig->tx_bytes + tpt_trig->rx_bytes; in tpt_trig_traffic()
253 delta = traffic - tpt_trig->prev_traffic; in tpt_trig_traffic()
254 tpt_trig->prev_traffic = traffic; in tpt_trig_traffic()
260 struct tpt_led_trigger *tpt_trig = from_timer(tpt_trig, t, timer); in tpt_trig_timer() local
261 struct ieee80211_local *local = tpt_trig->local; in tpt_trig_timer()
265 if (!tpt_trig->running) in tpt_trig_timer()
268 mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ)); in tpt_trig_timer()
270 tpt = tpt_trig_traffic(local, tpt_trig); in tpt_trig_timer()
276 for (i = tpt_trig->blink_table_len - 1; i >= 0; i--) { in tpt_trig_timer()
277 if (tpt_trig->blink_table[i].throughput < 0 || in tpt_trig_timer()
278 tpt > tpt_trig->blink_table[i].throughput) { in tpt_trig_timer()
279 off = tpt_trig->blink_table[i].blink_time / 2; in tpt_trig_timer()
280 on = tpt_trig->blink_table[i].blink_time - off; in tpt_trig_timer()
295 struct tpt_led_trigger *tpt_trig; in __ieee80211_create_tpt_led_trigger() local
300 tpt_trig = kzalloc(sizeof(struct tpt_led_trigger), GFP_KERNEL); in __ieee80211_create_tpt_led_trigger()
301 if (!tpt_trig) in __ieee80211_create_tpt_led_trigger()
304 snprintf(tpt_trig->name, sizeof(tpt_trig->name), in __ieee80211_create_tpt_led_trigger()
307 local->tpt_led.name = tpt_trig->name; in __ieee80211_create_tpt_led_trigger()
309 tpt_trig->blink_table = blink_table; in __ieee80211_create_tpt_led_trigger()
310 tpt_trig->blink_table_len = blink_table_len; in __ieee80211_create_tpt_led_trigger()
311 tpt_trig->want = flags; in __ieee80211_create_tpt_led_trigger()
312 tpt_trig->local = local; in __ieee80211_create_tpt_led_trigger()
314 timer_setup(&tpt_trig->timer, tpt_trig_timer, 0); in __ieee80211_create_tpt_led_trigger()
316 local->tpt_led_trigger = tpt_trig; in __ieee80211_create_tpt_led_trigger()
318 return tpt_trig->name; in __ieee80211_create_tpt_led_trigger()
324 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; in ieee80211_start_tpt_led_trig() local
326 if (tpt_trig->running) in ieee80211_start_tpt_led_trig()
330 tpt_trig_traffic(local, tpt_trig); in ieee80211_start_tpt_led_trig()
331 tpt_trig->running = true; in ieee80211_start_tpt_led_trig()
333 tpt_trig_timer(&tpt_trig->timer); in ieee80211_start_tpt_led_trig()
334 mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ)); in ieee80211_start_tpt_led_trig()
339 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; in ieee80211_stop_tpt_led_trig() local
341 if (!tpt_trig->running) in ieee80211_stop_tpt_led_trig()
344 tpt_trig->running = false; in ieee80211_stop_tpt_led_trig()
345 del_timer_sync(&tpt_trig->timer); in ieee80211_stop_tpt_led_trig()
353 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; in ieee80211_mod_tpt_led_trig() local
358 if (!tpt_trig) in ieee80211_mod_tpt_led_trig()
361 tpt_trig->active &= ~types_off; in ieee80211_mod_tpt_led_trig()
362 tpt_trig->active |= types_on; in ieee80211_mod_tpt_led_trig()
370 allowed = tpt_trig->active & IEEE80211_TPT_LEDTRIG_FL_RADIO; in ieee80211_mod_tpt_led_trig()
372 if (!allowed || !(tpt_trig->active & tpt_trig->want)) in ieee80211_mod_tpt_led_trig()