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