leds.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef B43legacy_LEDS_H_
  2. #define B43legacy_LEDS_H_
  3. #include <linux/types.h>
  4. #include <linux/timer.h>
  5. struct b43legacy_led {
  6. u8 behaviour;
  7. bool activelow;
  8. /* Index in the "leds" array in b43legacy_wldev */
  9. u8 index;
  10. struct b43legacy_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 B43legacy_LEDBLINK_SLOW (HZ / 1)
  16. #define B43legacy_LEDBLINK_MEDIUM (HZ / 4)
  17. #define B43legacy_LEDBLINK_FAST (HZ / 8)
  18. #define B43legacy_LED_XFER_THRES (HZ / 100)
  19. #define B43legacy_LED_BEHAVIOUR 0x7F
  20. #define B43legacy_LED_ACTIVELOW 0x80
  21. enum { /* LED behaviour values */
  22. B43legacy_LED_OFF,
  23. B43legacy_LED_ON,
  24. B43legacy_LED_ACTIVITY,
  25. B43legacy_LED_RADIO_ALL,
  26. B43legacy_LED_RADIO_A,
  27. B43legacy_LED_RADIO_B,
  28. B43legacy_LED_MODE_BG,
  29. B43legacy_LED_TRANSFER,
  30. B43legacy_LED_APTRANSFER,
  31. B43legacy_LED_WEIRD,
  32. B43legacy_LED_ASSOC,
  33. B43legacy_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. B43legacy_LED_TEST_BLINKSLOW,
  40. B43legacy_LED_TEST_BLINKMEDIUM,
  41. B43legacy_LED_TEST_BLINKFAST,
  42. };
  43. int b43legacy_leds_init(struct b43legacy_wldev *dev);
  44. void b43legacy_leds_exit(struct b43legacy_wldev *dev);
  45. void b43legacy_leds_update(struct b43legacy_wldev *dev, int activity);
  46. void b43legacy_leds_switch_all(struct b43legacy_wldev *dev, int on);
  47. #endif /* B43legacy_LEDS_H_ */