blob: 811e14a81198f13f521af60872566e734ffef9d4 [file] [log] [blame]
John W. Linvillef2223132006-01-23 16:59:58 -05001#ifndef BCM43xx_LEDS_H_
2#define BCM43xx_LEDS_H_
3
4#include <linux/types.h>
5#include <linux/timer.h>
6
7
8struct bcm43xx_led {
9 u8 behaviour:7;
10 u8 activelow:1;
11
12 struct bcm43xx_private *bcm;
13 struct timer_list blink_timer;
14 unsigned long blink_interval;
15};
16#define bcm43xx_led_index(led) ((int)((led) - (led)->bcm->leds))
17
18/* Delay between state changes when blinking in jiffies */
Michael Bueschdcfd7202006-02-12 20:25:55 +010019#define BCM43xx_LEDBLINK_SLOW (HZ / 1)
John W. Linvillef2223132006-01-23 16:59:58 -050020#define BCM43xx_LEDBLINK_MEDIUM (HZ / 4)
21#define BCM43xx_LEDBLINK_FAST (HZ / 8)
22
23#define BCM43xx_LED_XFER_THRES (HZ / 100)
24
25#define BCM43xx_LED_BEHAVIOUR 0x7F
26#define BCM43xx_LED_ACTIVELOW 0x80
27enum { /* LED behaviour values */
28 BCM43xx_LED_OFF,
29 BCM43xx_LED_ON,
30 BCM43xx_LED_ACTIVITY,
31 BCM43xx_LED_RADIO_ALL,
32 BCM43xx_LED_RADIO_A,
33 BCM43xx_LED_RADIO_B,
34 BCM43xx_LED_MODE_BG,
35 BCM43xx_LED_TRANSFER,
36 BCM43xx_LED_APTRANSFER,
37 BCM43xx_LED_WEIRD,//FIXME
38 BCM43xx_LED_ASSOC,
39 BCM43xx_LED_INACTIVE,
Michael Bueschdcfd7202006-02-12 20:25:55 +010040
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 BCM43xx_LED_TEST_BLINKSLOW,
47 BCM43xx_LED_TEST_BLINKMEDIUM,
48 BCM43xx_LED_TEST_BLINKFAST,
Larry Fingerdf6d7c92006-10-17 23:38:26 -050049
50 /* Misc values for BCM4303 */
51 BCM43xx_LED_BCM4303_0 = 0x2B,
52 BCM43xx_LED_BCM4303_1 = 0x78,
53 BCM43xx_LED_BCM4303_2 = 0x2E,
54 BCM43xx_LED_BCM4303_3 = 0x19,
John W. Linvillef2223132006-01-23 16:59:58 -050055};
56
57int bcm43xx_leds_init(struct bcm43xx_private *bcm);
58void bcm43xx_leds_exit(struct bcm43xx_private *bcm);
59void bcm43xx_leds_update(struct bcm43xx_private *bcm, int activity);
Michael Buesch714eece2006-03-18 21:28:46 +010060void bcm43xx_leds_switch_all(struct bcm43xx_private *bcm, int on);
John W. Linvillef2223132006-01-23 16:59:58 -050061
62#endif /* BCM43xx_LEDS_H_ */