]> Pileus Git - ~andy/linux/blob - drivers/net/wireless/b43/leds.h
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
[~andy/linux] / drivers / net / wireless / b43 / leds.h
1 #ifndef B43_LEDS_H_
2 #define B43_LEDS_H_
3
4 struct b43_wldev;
5
6 #ifdef CONFIG_B43_LEDS
7
8 #include <linux/types.h>
9 #include <linux/leds.h>
10 #include <linux/workqueue.h>
11
12
13 #define B43_LED_MAX_NAME_LEN    31
14
15 struct b43_led {
16         struct b43_wl *wl;
17         /* The LED class device */
18         struct led_classdev led_dev;
19         /* The index number of the LED. */
20         u8 index;
21         /* If activelow is true, the LED is ON if the
22          * bit is switched off. */
23         bool activelow;
24         /* The unique name string for this LED device. */
25         char name[B43_LED_MAX_NAME_LEN + 1];
26         /* The current status of the LED. This is updated locklessly. */
27         atomic_t state;
28         /* The active state in hardware. */
29         bool hw_state;
30 };
31
32 struct b43_leds {
33         struct b43_led led_tx;
34         struct b43_led led_rx;
35         struct b43_led led_radio;
36         struct b43_led led_assoc;
37
38         bool stop;
39         struct work_struct work;
40 };
41
42 #define B43_MAX_NR_LEDS                 4
43
44 #define B43_LED_BEHAVIOUR               0x7F
45 #define B43_LED_ACTIVELOW               0x80
46 /* LED behaviour values */
47 enum b43_led_behaviour {
48         B43_LED_OFF,
49         B43_LED_ON,
50         B43_LED_ACTIVITY,
51         B43_LED_RADIO_ALL,
52         B43_LED_RADIO_A,
53         B43_LED_RADIO_B,
54         B43_LED_MODE_BG,
55         B43_LED_TRANSFER,
56         B43_LED_APTRANSFER,
57         B43_LED_WEIRD,          //FIXME
58         B43_LED_ASSOC,
59         B43_LED_INACTIVE,
60 };
61
62 void b43_leds_register(struct b43_wldev *dev);
63 void b43_leds_unregister(struct b43_wldev *dev);
64 void b43_leds_init(struct b43_wldev *dev);
65 void b43_leds_exit(struct b43_wldev *dev);
66 void b43_leds_stop(struct b43_wldev *dev);
67
68
69 #else /* CONFIG_B43_LEDS */
70 /* LED support disabled */
71
72 struct b43_leds {
73         /* empty */
74 };
75
76 static inline void b43_leds_register(struct b43_wldev *dev)
77 {
78 }
79 static inline void b43_leds_unregister(struct b43_wldev *dev)
80 {
81 }
82 static inline void b43_leds_init(struct b43_wldev *dev)
83 {
84 }
85 static inline void b43_leds_exit(struct b43_wldev *dev)
86 {
87 }
88 static inline void b43_leds_stop(struct b43_wldev *dev)
89 {
90 }
91 #endif /* CONFIG_B43_LEDS */
92
93 #endif /* B43_LEDS_H_ */