Lines Matching +full:trigger +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0-only
14 if (!atomic_read(&local->assoc_led_active)) in ieee80211_led_assoc()
17 led_trigger_event(&local->assoc_led, LED_FULL); in ieee80211_led_assoc()
19 led_trigger_event(&local->assoc_led, LED_OFF); in ieee80211_led_assoc()
24 if (!atomic_read(&local->radio_led_active)) in ieee80211_led_radio()
27 led_trigger_event(&local->radio_led, LED_FULL); in ieee80211_led_radio()
29 led_trigger_event(&local->radio_led, LED_OFF); in ieee80211_led_radio()
34 local->rx_led.name = kasprintf(GFP_KERNEL, "%srx", in ieee80211_alloc_led_names()
35 wiphy_name(local->hw.wiphy)); in ieee80211_alloc_led_names()
36 local->tx_led.name = kasprintf(GFP_KERNEL, "%stx", in ieee80211_alloc_led_names()
37 wiphy_name(local->hw.wiphy)); in ieee80211_alloc_led_names()
38 local->assoc_led.name = kasprintf(GFP_KERNEL, "%sassoc", in ieee80211_alloc_led_names()
39 wiphy_name(local->hw.wiphy)); in ieee80211_alloc_led_names()
40 local->radio_led.name = kasprintf(GFP_KERNEL, "%sradio", in ieee80211_alloc_led_names()
41 wiphy_name(local->hw.wiphy)); in ieee80211_alloc_led_names()
46 kfree(local->rx_led.name); in ieee80211_free_led_names()
47 kfree(local->tx_led.name); in ieee80211_free_led_names()
48 kfree(local->assoc_led.name); in ieee80211_free_led_names()
49 kfree(local->radio_led.name); in ieee80211_free_led_names()
54 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_tx_led_activate()
58 atomic_inc(&local->tx_led_active); in ieee80211_tx_led_activate()
65 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_tx_led_deactivate()
69 atomic_dec(&local->tx_led_active); in ieee80211_tx_led_deactivate()
74 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_rx_led_activate()
78 atomic_inc(&local->rx_led_active); in ieee80211_rx_led_activate()
85 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_rx_led_deactivate()
89 atomic_dec(&local->rx_led_active); in ieee80211_rx_led_deactivate()
94 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_assoc_led_activate()
98 atomic_inc(&local->assoc_led_active); in ieee80211_assoc_led_activate()
105 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_assoc_led_deactivate()
109 atomic_dec(&local->assoc_led_active); in ieee80211_assoc_led_deactivate()
114 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_radio_led_activate()
118 atomic_inc(&local->radio_led_active); in ieee80211_radio_led_activate()
125 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_radio_led_deactivate()
129 atomic_dec(&local->radio_led_active); in ieee80211_radio_led_deactivate()
134 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_tpt_led_activate()
138 atomic_inc(&local->tpt_led_active); in ieee80211_tpt_led_activate()
145 struct ieee80211_local *local = container_of(led_cdev->trigger, in ieee80211_tpt_led_deactivate()
149 atomic_dec(&local->tpt_led_active); in ieee80211_tpt_led_deactivate()
154 atomic_set(&local->rx_led_active, 0); in ieee80211_led_init()
155 local->rx_led.activate = ieee80211_rx_led_activate; in ieee80211_led_init()
156 local->rx_led.deactivate = ieee80211_rx_led_deactivate; in ieee80211_led_init()
157 if (local->rx_led.name && led_trigger_register(&local->rx_led)) { in ieee80211_led_init()
158 kfree(local->rx_led.name); in ieee80211_led_init()
159 local->rx_led.name = NULL; in ieee80211_led_init()
162 atomic_set(&local->tx_led_active, 0); in ieee80211_led_init()
163 local->tx_led.activate = ieee80211_tx_led_activate; in ieee80211_led_init()
164 local->tx_led.deactivate = ieee80211_tx_led_deactivate; in ieee80211_led_init()
165 if (local->tx_led.name && led_trigger_register(&local->tx_led)) { in ieee80211_led_init()
166 kfree(local->tx_led.name); in ieee80211_led_init()
167 local->tx_led.name = NULL; in ieee80211_led_init()
170 atomic_set(&local->assoc_led_active, 0); in ieee80211_led_init()
171 local->assoc_led.activate = ieee80211_assoc_led_activate; in ieee80211_led_init()
172 local->assoc_led.deactivate = ieee80211_assoc_led_deactivate; in ieee80211_led_init()
173 if (local->assoc_led.name && led_trigger_register(&local->assoc_led)) { in ieee80211_led_init()
174 kfree(local->assoc_led.name); in ieee80211_led_init()
175 local->assoc_led.name = NULL; in ieee80211_led_init()
178 atomic_set(&local->radio_led_active, 0); in ieee80211_led_init()
179 local->radio_led.activate = ieee80211_radio_led_activate; in ieee80211_led_init()
180 local->radio_led.deactivate = ieee80211_radio_led_deactivate; in ieee80211_led_init()
181 if (local->radio_led.name && led_trigger_register(&local->radio_led)) { in ieee80211_led_init()
182 kfree(local->radio_led.name); in ieee80211_led_init()
183 local->radio_led.name = NULL; in ieee80211_led_init()
186 atomic_set(&local->tpt_led_active, 0); in ieee80211_led_init()
187 if (local->tpt_led_trigger) { in ieee80211_led_init()
188 local->tpt_led.activate = ieee80211_tpt_led_activate; in ieee80211_led_init()
189 local->tpt_led.deactivate = ieee80211_tpt_led_deactivate; in ieee80211_led_init()
190 if (led_trigger_register(&local->tpt_led)) { in ieee80211_led_init()
191 kfree(local->tpt_led_trigger); in ieee80211_led_init()
192 local->tpt_led_trigger = NULL; in ieee80211_led_init()
199 if (local->radio_led.name) in ieee80211_led_exit()
200 led_trigger_unregister(&local->radio_led); in ieee80211_led_exit()
201 if (local->assoc_led.name) in ieee80211_led_exit()
202 led_trigger_unregister(&local->assoc_led); in ieee80211_led_exit()
203 if (local->tx_led.name) in ieee80211_led_exit()
204 led_trigger_unregister(&local->tx_led); in ieee80211_led_exit()
205 if (local->rx_led.name) in ieee80211_led_exit()
206 led_trigger_unregister(&local->rx_led); in ieee80211_led_exit()
208 if (local->tpt_led_trigger) { in ieee80211_led_exit()
209 led_trigger_unregister(&local->tpt_led); in ieee80211_led_exit()
210 kfree(local->tpt_led_trigger); in ieee80211_led_exit()
218 return local->radio_led.name; in __ieee80211_get_radio_led_name()
226 return local->assoc_led.name; in __ieee80211_get_assoc_led_name()
234 return local->tx_led.name; in __ieee80211_get_tx_led_name()
242 return local->rx_led.name; in __ieee80211_get_rx_led_name()
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()
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()
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()
285 led_trigger_blink(&local->tpt_led, on, off); in tpt_trig_timer()
297 if (WARN_ON(local->tpt_led_trigger)) in __ieee80211_create_tpt_led_trigger()
304 snprintf(tpt_trig->name, sizeof(tpt_trig->name), in __ieee80211_create_tpt_led_trigger()
305 "%stpt", wiphy_name(local->hw.wiphy)); 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()
326 if (tpt_trig->running) 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()
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()
347 led_trigger_event(&local->tpt_led, LED_OFF); in ieee80211_stop_tpt_led_trig()
353 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; 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()
366 * the radio is disabled -- this can happen due to some 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()