leds.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef B43_LEDS_H_
  2. #define B43_LEDS_H_
  3. struct b43_wldev;
  4. #ifdef CONFIG_B43_LEDS
  5. #include <linux/types.h>
  6. #include <linux/leds.h>
  7. #include <linux/workqueue.h>
  8. #define B43_LED_MAX_NAME_LEN 31
  9. struct b43_led {
  10. struct b43_wl *wl;
  11. /* The LED class device */
  12. struct led_classdev led_dev;
  13. /* The index number of the LED. */
  14. u8 index;
  15. /* If activelow is true, the LED is ON if the
  16. * bit is switched off. */
  17. bool activelow;
  18. /* The unique name string for this LED device. */
  19. char name[B43_LED_MAX_NAME_LEN + 1];
  20. /* The current status of the LED. This is updated locklessly. */
  21. atomic_t state;
  22. /* The active state in hardware. */
  23. bool hw_state;
  24. };
  25. struct b43_leds {
  26. struct b43_led led_tx;
  27. struct b43_led led_rx;
  28. struct b43_led led_radio;
  29. struct b43_led led_assoc;
  30. bool stop;
  31. struct work_struct work;
  32. };
  33. #define B43_MAX_NR_LEDS 4
  34. #define B43_LED_BEHAVIOUR 0x7F
  35. #define B43_LED_ACTIVELOW 0x80
  36. /* LED behaviour values */
  37. enum b43_led_behaviour {
  38. B43_LED_OFF,
  39. B43_LED_ON,
  40. B43_LED_ACTIVITY,
  41. B43_LED_RADIO_ALL,
  42. B43_LED_RADIO_A,
  43. B43_LED_RADIO_B,
  44. B43_LED_MODE_BG,
  45. B43_LED_TRANSFER,
  46. B43_LED_APTRANSFER,
  47. B43_LED_WEIRD, //FIXME
  48. B43_LED_ASSOC,
  49. B43_LED_INACTIVE,
  50. };
  51. void b43_leds_register(struct b43_wldev *dev);
  52. void b43_leds_unregister(struct b43_wldev *dev);
  53. void b43_leds_init(struct b43_wldev *dev);
  54. void b43_leds_exit(struct b43_wldev *dev);
  55. #else /* CONFIG_B43_LEDS */
  56. /* LED support disabled */
  57. struct b43_leds {
  58. /* empty */
  59. };
  60. static inline void b43_leds_register(struct b43_wldev *dev)
  61. {
  62. }
  63. static inline void b43_leds_unregister(struct b43_wldev *dev)
  64. {
  65. }
  66. static inline void b43_leds_init(struct b43_wldev *dev)
  67. {
  68. }
  69. static inline void b43_leds_exit(struct b43_wldev *dev)
  70. {
  71. }
  72. #endif /* CONFIG_B43_LEDS */
  73. #endif /* B43_LEDS_H_ */