diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2007-10-13 00:04:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:26 -0500 |
commit | ba48f7bb8062982ec916868cc8c90360aad82e53 (patch) | |
tree | 9f19ae7146c895d09b01ef7d1bbec0d44666c0bf /drivers/net/wireless/b43legacy/leds.h | |
parent | c8b0e6e19c0bcd30689cb6c6f64eb140f5d61894 (diff) |
b43legacy: LED triggers support
Drive the LEDs through the generic LED triggers.
The patch to b43 by Michael Buesch <mb@bu3sch.de> has been ported to b43legacy.
Signed-off-by: Larry Finger <larry.finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43legacy/leds.h')
-rw-r--r-- | drivers/net/wireless/b43legacy/leds.h | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/drivers/net/wireless/b43legacy/leds.h b/drivers/net/wireless/b43legacy/leds.h index b989f503e684..82167a90088f 100644 --- a/drivers/net/wireless/b43legacy/leds.h +++ b/drivers/net/wireless/b43legacy/leds.h | |||
@@ -1,30 +1,33 @@ | |||
1 | #ifndef B43legacy_LEDS_H_ | 1 | #ifndef B43legacy_LEDS_H_ |
2 | #define B43legacy_LEDS_H_ | 2 | #define B43legacy_LEDS_H_ |
3 | 3 | ||
4 | struct b43legacy_wldev; | ||
5 | |||
6 | #ifdef CONFIG_B43LEGACY_LEDS | ||
7 | |||
4 | #include <linux/types.h> | 8 | #include <linux/types.h> |
5 | #include <linux/timer.h> | 9 | #include <linux/leds.h> |
6 | 10 | ||
7 | 11 | ||
12 | #define B43legacy_LED_MAX_NAME_LEN 31 | ||
13 | |||
8 | struct b43legacy_led { | 14 | struct b43legacy_led { |
9 | u8 behaviour; | ||
10 | bool activelow; | ||
11 | /* Index in the "leds" array in b43legacy_wldev */ | ||
12 | u8 index; | ||
13 | struct b43legacy_wldev *dev; | 15 | struct b43legacy_wldev *dev; |
14 | struct timer_list blink_timer; | 16 | /* The LED class device */ |
15 | 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[B43legacy_LED_MAX_NAME_LEN + 1]; | ||
16 | }; | 25 | }; |
17 | 26 | ||
18 | /* Delay between state changes when blinking in jiffies */ | ||
19 | #define B43legacy_LEDBLINK_SLOW (HZ / 1) | ||
20 | #define B43legacy_LEDBLINK_MEDIUM (HZ / 4) | ||
21 | #define B43legacy_LEDBLINK_FAST (HZ / 8) | ||
22 | |||
23 | #define B43legacy_LED_XFER_THRES (HZ / 100) | ||
24 | |||
25 | #define B43legacy_LED_BEHAVIOUR 0x7F | 27 | #define B43legacy_LED_BEHAVIOUR 0x7F |
26 | #define B43legacy_LED_ACTIVELOW 0x80 | 28 | #define B43legacy_LED_ACTIVELOW 0x80 |
27 | enum { /* LED behaviour values */ | 29 | /* LED behaviour values */ |
30 | enum b43legacy_led_behaviour { | ||
28 | B43legacy_LED_OFF, | 31 | B43legacy_LED_OFF, |
29 | B43legacy_LED_ON, | 32 | B43legacy_LED_ON, |
30 | B43legacy_LED_ACTIVITY, | 33 | B43legacy_LED_ACTIVITY, |
@@ -37,20 +40,24 @@ enum { /* LED behaviour values */ | |||
37 | B43legacy_LED_WEIRD, | 40 | B43legacy_LED_WEIRD, |
38 | B43legacy_LED_ASSOC, | 41 | B43legacy_LED_ASSOC, |
39 | B43legacy_LED_INACTIVE, | 42 | B43legacy_LED_INACTIVE, |
40 | |||
41 | /* Behaviour values for testing. | ||
42 | * With these values it is easier to figure out | ||
43 | * the real behaviour of leds, in case the SPROM | ||
44 | * is missing information. | ||
45 | */ | ||
46 | B43legacy_LED_TEST_BLINKSLOW, | ||
47 | B43legacy_LED_TEST_BLINKMEDIUM, | ||
48 | B43legacy_LED_TEST_BLINKFAST, | ||
49 | }; | 43 | }; |
50 | 44 | ||
51 | int b43legacy_leds_init(struct b43legacy_wldev *dev); | 45 | void b43legacy_leds_init(struct b43legacy_wldev *dev); |
52 | void b43legacy_leds_exit(struct b43legacy_wldev *dev); | 46 | void b43legacy_leds_exit(struct b43legacy_wldev *dev); |
53 | void b43legacy_leds_update(struct b43legacy_wldev *dev, int activity); | 47 | |
54 | void b43legacy_leds_switch_all(struct b43legacy_wldev *dev, int on); | 48 | #else /* CONFIG_B43EGACY_LEDS */ |
49 | /* LED support disabled */ | ||
50 | |||
51 | struct b43legacy_led { | ||
52 | /* empty */ | ||
53 | }; | ||
54 | |||
55 | static inline void b43legacy_leds_init(struct b43legacy_wldev *dev) | ||
56 | { | ||
57 | } | ||
58 | static inline void b43legacy_leds_exit(struct b43legacy_wldev *dev) | ||
59 | { | ||
60 | } | ||
61 | #endif /* CONFIG_B43LEGACY_LEDS */ | ||
55 | 62 | ||
56 | #endif /* B43legacy_LEDS_H_ */ | 63 | #endif /* B43legacy_LEDS_H_ */ |