aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/led.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-11-30 02:58:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-22 14:33:37 -0500
commite1e5406854378dfada3f33c7192b012083a5b8e0 (patch)
treee878058f28b8f6db50ef5d73d09aed66dd9ad9f2 /net/mac80211/led.h
parentfe67c913f1ec2a01aaa9176c80ef36eaf87d705d (diff)
mac80211: add throughput based LED blink trigger
iwlwifi and other drivers like to blink their LED based on throughput. Implement this generically in mac80211, based on a throughput table the driver specifies. That way, drivers can set the blink frequencies depending on their desired behaviour and max throughput. All the drivers need to do is provide an LED class device, best with blink hardware offload. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/led.h')
-rw-r--r--net/mac80211/led.h44
1 files changed, 35 insertions, 9 deletions
diff --git a/net/mac80211/led.h b/net/mac80211/led.h
index 8320cbac61c6..6c215dc0fc96 100644
--- a/net/mac80211/led.h
+++ b/net/mac80211/led.h
@@ -12,15 +12,17 @@
12#include "ieee80211_i.h" 12#include "ieee80211_i.h"
13 13
14#ifdef CONFIG_MAC80211_LEDS 14#ifdef CONFIG_MAC80211_LEDS
15extern void ieee80211_led_rx(struct ieee80211_local *local); 15void ieee80211_led_rx(struct ieee80211_local *local);
16extern void ieee80211_led_tx(struct ieee80211_local *local, int q); 16void ieee80211_led_tx(struct ieee80211_local *local, int q);
17extern void ieee80211_led_assoc(struct ieee80211_local *local, 17void ieee80211_led_assoc(struct ieee80211_local *local,
18 bool associated); 18 bool associated);
19extern void ieee80211_led_radio(struct ieee80211_local *local, 19void ieee80211_led_radio(struct ieee80211_local *local,
20 bool enabled); 20 bool enabled);
21extern void ieee80211_led_names(struct ieee80211_local *local); 21void ieee80211_led_names(struct ieee80211_local *local);
22extern void ieee80211_led_init(struct ieee80211_local *local); 22void ieee80211_led_init(struct ieee80211_local *local);
23extern void ieee80211_led_exit(struct ieee80211_local *local); 23void ieee80211_led_exit(struct ieee80211_local *local);
24void ieee80211_start_tpt_led_trig(struct ieee80211_local *local);
25void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local);
24#else 26#else
25static inline void ieee80211_led_rx(struct ieee80211_local *local) 27static inline void ieee80211_led_rx(struct ieee80211_local *local)
26{ 28{
@@ -45,4 +47,28 @@ static inline void ieee80211_led_init(struct ieee80211_local *local)
45static inline void ieee80211_led_exit(struct ieee80211_local *local) 47static inline void ieee80211_led_exit(struct ieee80211_local *local)
46{ 48{
47} 49}
50static inline void ieee80211_start_tpt_led_trig(struct ieee80211_local *local)
51{
52}
53static inline void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local)
54{
55}
56#endif
57
58static inline void
59ieee80211_tpt_led_trig_tx(struct ieee80211_local *local, __le16 fc, int bytes)
60{
61#ifdef CONFIG_MAC80211_LEDS
62 if (local->tpt_led_trigger && ieee80211_is_data(fc))
63 local->tpt_led_trigger->tx_bytes += bytes;
48#endif 64#endif
65}
66
67static inline void
68ieee80211_tpt_led_trig_rx(struct ieee80211_local *local, __le16 fc, int bytes)
69{
70#ifdef CONFIG_MAC80211_LEDS
71 if (local->tpt_led_trigger && ieee80211_is_data(fc))
72 local->tpt_led_trigger->rx_bytes += bytes;
73#endif
74}