bcm43xx_leds.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef BCM43xx_LEDS_H_
  2. #define BCM43xx_LEDS_H_
  3. #include <linux/types.h>
  4. #include <linux/timer.h>
  5. struct bcm43xx_led {
  6. u8 behaviour:7;
  7. u8 activelow:1;
  8. struct bcm43xx_private *bcm;
  9. struct timer_list blink_timer;
  10. unsigned long blink_interval;
  11. };
  12. #define bcm43xx_led_index(led) ((int)((led) - (led)->bcm->leds))
  13. /* Delay between state changes when blinking in jiffies */
  14. #define BCM43xx_LEDBLINK_SLOW (HZ / 1)
  15. #define BCM43xx_LEDBLINK_MEDIUM (HZ / 4)
  16. #define BCM43xx_LEDBLINK_FAST (HZ / 8)
  17. #define BCM43xx_LED_XFER_THRES (HZ / 100)
  18. #define BCM43xx_LED_BEHAVIOUR 0x7F
  19. #define BCM43xx_LED_ACTIVELOW 0x80
  20. enum { /* LED behaviour values */
  21. BCM43xx_LED_OFF,
  22. BCM43xx_LED_ON,
  23. BCM43xx_LED_ACTIVITY,
  24. BCM43xx_LED_RADIO_ALL,
  25. BCM43xx_LED_RADIO_A,
  26. BCM43xx_LED_RADIO_B,
  27. BCM43xx_LED_MODE_BG,
  28. BCM43xx_LED_TRANSFER,
  29. BCM43xx_LED_APTRANSFER,
  30. BCM43xx_LED_WEIRD,//FIXME
  31. BCM43xx_LED_ASSOC,
  32. BCM43xx_LED_INACTIVE,
  33. /* Behaviour values for testing.
  34. * With these values it is easier to figure out
  35. * the real behaviour of leds, in case the SPROM
  36. * is missing information.
  37. */
  38. BCM43xx_LED_TEST_BLINKSLOW,
  39. BCM43xx_LED_TEST_BLINKMEDIUM,
  40. BCM43xx_LED_TEST_BLINKFAST,
  41. };
  42. int bcm43xx_leds_init(struct bcm43xx_private *bcm);
  43. void bcm43xx_leds_exit(struct bcm43xx_private *bcm);
  44. void bcm43xx_leds_update(struct bcm43xx_private *bcm, int activity);
  45. void bcm43xx_leds_switch_all(struct bcm43xx_private *bcm, int on);
  46. #endif /* BCM43xx_LEDS_H_ */