]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/net/wireless/broadcom/b43/leds.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / drivers / net / wireless / broadcom / b43 / leds.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
e4d6b795
MB
2#ifndef B43_LEDS_H_
3#define B43_LEDS_H_
4
e6693eab 5struct b43_wl;
21954c36
MB
6struct b43_wldev;
7
8#ifdef CONFIG_B43_LEDS
9
e4d6b795 10#include <linux/types.h>
21954c36 11#include <linux/leds.h>
a78b3bb2 12#include <linux/workqueue.h>
21954c36
MB
13
14
15#define B43_LED_MAX_NAME_LEN 31
e4d6b795
MB
16
17struct b43_led {
a78b3bb2 18 struct b43_wl *wl;
21954c36
MB
19 /* The LED class device */
20 struct led_classdev led_dev;
21 /* The index number of the LED. */
22 u8 index;
23 /* If activelow is true, the LED is ON if the
24 * bit is switched off. */
25 bool activelow;
26 /* The unique name string for this LED device. */
27 char name[B43_LED_MAX_NAME_LEN + 1];
a78b3bb2
MB
28 /* The current status of the LED. This is updated locklessly. */
29 atomic_t state;
30 /* The active state in hardware. */
31 bool hw_state;
e4d6b795 32};
e4d6b795 33
a78b3bb2
MB
34struct b43_leds {
35 struct b43_led led_tx;
36 struct b43_led led_rx;
37 struct b43_led led_radio;
38 struct b43_led led_assoc;
39
e899a3f2 40 bool stop;
a78b3bb2
MB
41 struct work_struct work;
42};
43
44#define B43_MAX_NR_LEDS 4
45
e4d6b795
MB
46#define B43_LED_BEHAVIOUR 0x7F
47#define B43_LED_ACTIVELOW 0x80
21954c36
MB
48/* LED behaviour values */
49enum b43_led_behaviour {
e4d6b795
MB
50 B43_LED_OFF,
51 B43_LED_ON,
52 B43_LED_ACTIVITY,
53 B43_LED_RADIO_ALL,
54 B43_LED_RADIO_A,
55 B43_LED_RADIO_B,
56 B43_LED_MODE_BG,
57 B43_LED_TRANSFER,
58 B43_LED_APTRANSFER,
59 B43_LED_WEIRD, //FIXME
60 B43_LED_ASSOC,
61 B43_LED_INACTIVE,
e4d6b795
MB
62};
63
a78b3bb2 64void b43_leds_register(struct b43_wldev *dev);
727c9885 65void b43_leds_unregister(struct b43_wl *wl);
21954c36 66void b43_leds_init(struct b43_wldev *dev);
e4d6b795 67void b43_leds_exit(struct b43_wldev *dev);
82905ace 68void b43_leds_stop(struct b43_wldev *dev);
21954c36
MB
69
70
71#else /* CONFIG_B43_LEDS */
72/* LED support disabled */
73
a78b3bb2 74struct b43_leds {
21954c36
MB
75 /* empty */
76};
77
a78b3bb2
MB
78static inline void b43_leds_register(struct b43_wldev *dev)
79{
80}
727c9885 81static inline void b43_leds_unregister(struct b43_wl *wl)
a78b3bb2
MB
82{
83}
21954c36
MB
84static inline void b43_leds_init(struct b43_wldev *dev)
85{
86}
87static inline void b43_leds_exit(struct b43_wldev *dev)
88{
89}
82905ace
AH
90static inline void b43_leds_stop(struct b43_wldev *dev)
91{
92}
21954c36 93#endif /* CONFIG_B43_LEDS */
e4d6b795
MB
94
95#endif /* B43_LEDS_H_ */