1#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 */ 19#define BCM43xx_LEDBLINK_SLOW (HZ / 1) 20#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, 38 BCM43xx_LED_ASSOC, 39 BCM43xx_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 BCM43xx_LED_TEST_BLINKSLOW, 47 BCM43xx_LED_TEST_BLINKMEDIUM, 48 BCM43xx_LED_TEST_BLINKFAST, 49 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, 55}; 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); 60void bcm43xx_leds_switch_all(struct bcm43xx_private *bcm, int on); 61 62#endif /* BCM43xx_LEDS_H_ */ 63