diff options
author | Michael Buesch <mb@bu3sch.de> | 2007-09-27 09:31:40 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:54:11 -0400 |
commit | 21954c367e4088c491122edd263964345bc1d3bf (patch) | |
tree | 149faa19794ff6834c56f3af4501fe921880092e /drivers/net/wireless/b43/leds.h | |
parent | 20405c08412a4d89357870d7220f9fb1c458b286 (diff) |
[B43]: LED triggers support
Drive the LEDs through the generic LED triggers.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <larry.finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/b43/leds.h')
-rw-r--r-- | drivers/net/wireless/b43/leds.h | 63 |
1 files changed, 36 insertions, 27 deletions
diff --git a/drivers/net/wireless/b43/leds.h b/drivers/net/wireless/b43/leds.h index d94851d291c..b8b1dd52124 100644 --- a/drivers/net/wireless/b43/leds.h +++ b/drivers/net/wireless/b43/leds.h | |||
@@ -1,29 +1,33 @@ | |||
1 | #ifndef B43_LEDS_H_ | 1 | #ifndef B43_LEDS_H_ |
2 | #define B43_LEDS_H_ | 2 | #define B43_LEDS_H_ |
3 | 3 | ||
4 | struct b43_wldev; | ||
5 | |||
6 | #ifdef CONFIG_B43_LEDS | ||
7 | |||
4 | #include <linux/types.h> | 8 | #include <linux/types.h> |
5 | #include <linux/timer.h> | 9 | #include <linux/leds.h> |
10 | |||
11 | |||
12 | #define B43_LED_MAX_NAME_LEN 31 | ||
6 | 13 | ||
7 | struct b43_led { | 14 | struct b43_led { |
8 | u8 behaviour; | ||
9 | bool activelow; | ||
10 | /* Index in the "leds" array in b43_wldev */ | ||
11 | u8 index; | ||
12 | struct b43_wldev *dev; | 15 | struct b43_wldev *dev; |
13 | struct timer_list blink_timer; | 16 | /* The LED class device */ |
14 | unsigned long blink_interval; | 17 | struct led_classdev led_dev; |
18 | /* The index number of the LED. */ | ||
19 | u8 index; | ||
20 | /* If activelow is true, the LED is ON if the | ||
21 | * bit is switched off. */ | ||
22 | bool activelow; | ||
23 | /* The unique name string for this LED device. */ | ||
24 | char name[B43_LED_MAX_NAME_LEN + 1]; | ||
15 | }; | 25 | }; |
16 | 26 | ||
17 | /* Delay between state changes when blinking in jiffies */ | ||
18 | #define B43_LEDBLINK_SLOW (HZ / 1) | ||
19 | #define B43_LEDBLINK_MEDIUM (HZ / 4) | ||
20 | #define B43_LEDBLINK_FAST (HZ / 8) | ||
21 | |||
22 | #define B43_LED_XFER_THRES (HZ / 100) | ||
23 | |||
24 | #define B43_LED_BEHAVIOUR 0x7F | 27 | #define B43_LED_BEHAVIOUR 0x7F |
25 | #define B43_LED_ACTIVELOW 0x80 | 28 | #define B43_LED_ACTIVELOW 0x80 |
26 | enum { /* LED behaviour values */ | 29 | /* LED behaviour values */ |
30 | enum b43_led_behaviour { | ||
27 | B43_LED_OFF, | 31 | B43_LED_OFF, |
28 | B43_LED_ON, | 32 | B43_LED_ON, |
29 | B43_LED_ACTIVITY, | 33 | B43_LED_ACTIVITY, |
@@ -36,20 +40,25 @@ enum { /* LED behaviour values */ | |||
36 | B43_LED_WEIRD, //FIXME | 40 | B43_LED_WEIRD, //FIXME |
37 | B43_LED_ASSOC, | 41 | B43_LED_ASSOC, |
38 | B43_LED_INACTIVE, | 42 | B43_LED_INACTIVE, |
39 | |||
40 | /* Behaviour values for testing. | ||
41 | * With these values it is easier to figure out | ||
42 | * the real behaviour of leds, in case the SPROM | ||
43 | * is missing information. | ||
44 | */ | ||
45 | B43_LED_TEST_BLINKSLOW, | ||
46 | B43_LED_TEST_BLINKMEDIUM, | ||
47 | B43_LED_TEST_BLINKFAST, | ||
48 | }; | 43 | }; |
49 | 44 | ||
50 | int b43_leds_init(struct b43_wldev *dev); | 45 | void b43_leds_init(struct b43_wldev *dev); |
51 | void b43_leds_exit(struct b43_wldev *dev); | 46 | void b43_leds_exit(struct b43_wldev *dev); |
52 | void b43_leds_update(struct b43_wldev *dev, int activity); | 47 | |
53 | void b43_leds_switch_all(struct b43_wldev *dev, int on); | 48 | |
49 | #else /* CONFIG_B43_LEDS */ | ||
50 | /* LED support disabled */ | ||
51 | |||
52 | struct b43_led { | ||
53 | /* empty */ | ||
54 | }; | ||
55 | |||
56 | static inline void b43_leds_init(struct b43_wldev *dev) | ||
57 | { | ||
58 | } | ||
59 | static inline void b43_leds_exit(struct b43_wldev *dev) | ||
60 | { | ||
61 | } | ||
62 | #endif /* CONFIG_B43_LEDS */ | ||
54 | 63 | ||
55 | #endif /* B43_LEDS_H_ */ | 64 | #endif /* B43_LEDS_H_ */ |