leds.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef B43_LEDS_H_
  2. #define B43_LEDS_H_
  3. #include <linux/types.h>
  4. #include <linux/timer.h>
  5. struct b43_led {
  6. u8 behaviour:7;
  7. u8 activelow:1;
  8. struct b43_wldev *dev;
  9. struct timer_list blink_timer;
  10. unsigned long blink_interval;
  11. };
  12. #define b43_led_index(led) ((int)((led) - (led)->dev->leds))
  13. /* Delay between state changes when blinking in jiffies */
  14. #define B43_LEDBLINK_SLOW (HZ / 1)
  15. #define B43_LEDBLINK_MEDIUM (HZ / 4)
  16. #define B43_LEDBLINK_FAST (HZ / 8)
  17. #define B43_LED_XFER_THRES (HZ / 100)
  18. #define B43_LED_BEHAVIOUR 0x7F
  19. #define B43_LED_ACTIVELOW 0x80
  20. enum { /* LED behaviour values */
  21. B43_LED_OFF,
  22. B43_LED_ON,
  23. B43_LED_ACTIVITY,
  24. B43_LED_RADIO_ALL,
  25. B43_LED_RADIO_A,
  26. B43_LED_RADIO_B,
  27. B43_LED_MODE_BG,
  28. B43_LED_TRANSFER,
  29. B43_LED_APTRANSFER,
  30. B43_LED_WEIRD, //FIXME
  31. B43_LED_ASSOC,
  32. B43_LED_INACTIVE,
  33. /* Behaviour values for testing.
  34. * With these values it is easier to figure out
  35. * the real behaviour of leds, in case the SPROM
  36. * is missing information.
  37. */
  38. B43_LED_TEST_BLINKSLOW,
  39. B43_LED_TEST_BLINKMEDIUM,
  40. B43_LED_TEST_BLINKFAST,
  41. };
  42. int b43_leds_init(struct b43_wldev *dev);
  43. void b43_leds_exit(struct b43_wldev *dev);
  44. void b43_leds_update(struct b43_wldev *dev, int activity);
  45. void b43_leds_switch_all(struct b43_wldev *dev, int on);
  46. #endif /* B43_LEDS_H_ */