leds.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. void b43_leds_stop(struct b43_wldev *dev);
  56. #else /* CONFIG_B43_LEDS */
  57. /* LED support disabled */
  58. struct b43_leds {
  59. /* empty */
  60. };
  61. static inline void b43_leds_register(struct b43_wldev *dev)
  62. {
  63. }
  64. static inline void b43_leds_unregister(struct b43_wldev *dev)
  65. {
  66. }
  67. static inline void b43_leds_init(struct b43_wldev *dev)
  68. {
  69. }
  70. static inline void b43_leds_exit(struct b43_wldev *dev)
  71. {
  72. }
  73. static inline void b43_leds_stop(struct b43_wldev *dev)
  74. {
  75. }
  76. #endif /* CONFIG_B43_LEDS */
  77. #endif /* B43_LEDS_H_ */