Commit | Line | Data |
---|---|---|
e4d6b795 MB |
1 | #ifndef B43_LEDS_H_ |
2 | #define B43_LEDS_H_ | |
3 | ||
4 | #include <linux/types.h> | |
5 | #include <linux/timer.h> | |
6 | ||
7 | struct b43_led { | |
1a09404a MB |
8 | u8 behaviour; |
9 | bool activelow; | |
10 | /* Index in the "leds" array in b43_wldev */ | |
11 | u8 index; | |
e4d6b795 MB |
12 | struct b43_wldev *dev; |
13 | struct timer_list blink_timer; | |
14 | unsigned long blink_interval; | |
15 | }; | |
e4d6b795 MB |
16 | |
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 | |
25 | #define B43_LED_ACTIVELOW 0x80 | |
26 | enum { /* LED behaviour values */ | |
27 | B43_LED_OFF, | |
28 | B43_LED_ON, | |
29 | B43_LED_ACTIVITY, | |
30 | B43_LED_RADIO_ALL, | |
31 | B43_LED_RADIO_A, | |
32 | B43_LED_RADIO_B, | |
33 | B43_LED_MODE_BG, | |
34 | B43_LED_TRANSFER, | |
35 | B43_LED_APTRANSFER, | |
36 | B43_LED_WEIRD, //FIXME | |
37 | B43_LED_ASSOC, | |
38 | 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 | }; | |
49 | ||
50 | int b43_leds_init(struct b43_wldev *dev); | |
51 | void b43_leds_exit(struct b43_wldev *dev); | |
52 | void b43_leds_update(struct b43_wldev *dev, int activity); | |
53 | void b43_leds_switch_all(struct b43_wldev *dev, int on); | |
54 | ||
55 | #endif /* B43_LEDS_H_ */ |