leds.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef B43legacy_LEDS_H_
  3. #define B43legacy_LEDS_H_
  4. struct b43legacy_wldev;
  5. #ifdef CONFIG_B43LEGACY_LEDS
  6. #include <linux/types.h>
  7. #include <linux/leds.h>
  8. #define B43legacy_LED_MAX_NAME_LEN 31
  9. struct b43legacy_led {
  10. struct b43legacy_wldev *dev;
  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[B43legacy_LED_MAX_NAME_LEN + 1];
  20. };
  21. #define B43legacy_LED_BEHAVIOUR 0x7F
  22. #define B43legacy_LED_ACTIVELOW 0x80
  23. /* LED behaviour values */
  24. enum b43legacy_led_behaviour {
  25. B43legacy_LED_OFF,
  26. B43legacy_LED_ON,
  27. B43legacy_LED_ACTIVITY,
  28. B43legacy_LED_RADIO_ALL,
  29. B43legacy_LED_RADIO_A,
  30. B43legacy_LED_RADIO_B,
  31. B43legacy_LED_MODE_BG,
  32. B43legacy_LED_TRANSFER,
  33. B43legacy_LED_APTRANSFER,
  34. B43legacy_LED_WEIRD,
  35. B43legacy_LED_ASSOC,
  36. B43legacy_LED_INACTIVE,
  37. };
  38. void b43legacy_leds_init(struct b43legacy_wldev *dev);
  39. void b43legacy_leds_exit(struct b43legacy_wldev *dev);
  40. #else /* CONFIG_B43LEGACY_LEDS */
  41. /* LED support disabled */
  42. struct b43legacy_led {
  43. /* empty */
  44. };
  45. static inline void b43legacy_leds_init(struct b43legacy_wldev *dev)
  46. {
  47. }
  48. static inline void b43legacy_leds_exit(struct b43legacy_wldev *dev)
  49. {
  50. }
  51. #endif /* CONFIG_B43LEGACY_LEDS */
  52. #endif /* B43legacy_LEDS_H_ */