Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef B43_LEDS_H_
0003 #define B43_LEDS_H_
0004 
0005 struct b43_wl;
0006 struct b43_wldev;
0007 
0008 #ifdef CONFIG_B43_LEDS
0009 
0010 #include <linux/types.h>
0011 #include <linux/leds.h>
0012 #include <linux/workqueue.h>
0013 
0014 
0015 #define B43_LED_MAX_NAME_LEN    31
0016 
0017 struct b43_led {
0018     struct b43_wl *wl;
0019     /* The LED class device */
0020     struct led_classdev led_dev;
0021     /* The index number of the LED. */
0022     u8 index;
0023     /* If activelow is true, the LED is ON if the
0024      * bit is switched off. */
0025     bool activelow;
0026     /* The unique name string for this LED device. */
0027     char name[B43_LED_MAX_NAME_LEN + 1];
0028     /* The current status of the LED. This is updated locklessly. */
0029     atomic_t state;
0030     /* The active state in hardware. */
0031     bool hw_state;
0032 };
0033 
0034 struct b43_leds {
0035     struct b43_led led_tx;
0036     struct b43_led led_rx;
0037     struct b43_led led_radio;
0038     struct b43_led led_assoc;
0039 
0040     bool stop;
0041     struct work_struct work;
0042 };
0043 
0044 #define B43_MAX_NR_LEDS         4
0045 
0046 #define B43_LED_BEHAVIOUR       0x7F
0047 #define B43_LED_ACTIVELOW       0x80
0048 /* LED behaviour values */
0049 enum b43_led_behaviour {
0050     B43_LED_OFF,
0051     B43_LED_ON,
0052     B43_LED_ACTIVITY,
0053     B43_LED_RADIO_ALL,
0054     B43_LED_RADIO_A,
0055     B43_LED_RADIO_B,
0056     B43_LED_MODE_BG,
0057     B43_LED_TRANSFER,
0058     B43_LED_APTRANSFER,
0059     B43_LED_WEIRD,      //FIXME
0060     B43_LED_ASSOC,
0061     B43_LED_INACTIVE,
0062 };
0063 
0064 void b43_leds_register(struct b43_wldev *dev);
0065 void b43_leds_unregister(struct b43_wl *wl);
0066 void b43_leds_init(struct b43_wldev *dev);
0067 void b43_leds_exit(struct b43_wldev *dev);
0068 void b43_leds_stop(struct b43_wldev *dev);
0069 
0070 
0071 #else /* CONFIG_B43_LEDS */
0072 /* LED support disabled */
0073 
0074 struct b43_leds {
0075     /* empty */
0076 };
0077 
0078 static inline void b43_leds_register(struct b43_wldev *dev)
0079 {
0080 }
0081 static inline void b43_leds_unregister(struct b43_wl *wl)
0082 {
0083 }
0084 static inline void b43_leds_init(struct b43_wldev *dev)
0085 {
0086 }
0087 static inline void b43_leds_exit(struct b43_wldev *dev)
0088 {
0089 }
0090 static inline void b43_leds_stop(struct b43_wldev *dev)
0091 {
0092 }
0093 #endif /* CONFIG_B43_LEDS */
0094 
0095 #endif /* B43_LEDS_H_ */