Michael Buesch | e4d6b79 | 2007-09-18 15:39:42 -0400 | [diff] [blame^] | 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 { |
| 8 | u8 behaviour:7; |
| 9 | u8 activelow:1; |
| 10 | |
| 11 | struct b43_wldev *dev; |
| 12 | struct timer_list blink_timer; |
| 13 | unsigned long blink_interval; |
| 14 | }; |
| 15 | #define b43_led_index(led) ((int)((led) - (led)->dev->leds)) |
| 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_ */ |