leds.h 1.8 KB

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