1
2
3
4
5
6
7
8
9
10
11
12
13
14 #ifndef __RTL8712_LED_H
15 #define __RTL8712_LED_H
16
17 #include "osdep_service.h"
18 #include "drv_types.h"
19
20
21
22
23
24 enum LED_CTL_MODE {
25 LED_CTL_POWER_ON = 1,
26 LED_CTL_LINK = 2,
27 LED_CTL_NO_LINK = 3,
28 LED_CTL_TX = 4,
29 LED_CTL_RX = 5,
30 LED_CTL_SITE_SURVEY = 6,
31 LED_CTL_POWER_OFF = 7,
32 LED_CTL_START_TO_LINK = 8,
33 LED_CTL_START_WPS = 9,
34 LED_CTL_STOP_WPS = 10,
35 LED_CTL_START_WPS_BOTTON = 11,
36 LED_CTL_STOP_WPS_FAIL = 12,
37 LED_CTL_STOP_WPS_FAIL_OVERLAP = 13,
38 };
39
40 #define IS_LED_WPS_BLINKING(_LED_871x) \
41 (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS \
42 || ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP \
43 || ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
44
45 #define IS_LED_BLINKING(_LED_871x) \
46 (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress \
47 || ((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress)
48
49 enum LED_PIN_871x {
50 LED_PIN_GPIO0,
51 LED_PIN_LED0,
52 LED_PIN_LED1
53 };
54
55
56
57
58
59 enum LED_STRATEGY_871x {
60 SW_LED_MODE0,
61 SW_LED_MODE1,
62 SW_LED_MODE2,
63
64
65 SW_LED_MODE3,
66
67
68 SW_LED_MODE4,
69 SW_LED_MODE5,
70 SW_LED_MODE6,
71 HW_LED,
72
73
74 };
75
76 struct LED_871x {
77 struct _adapter *padapter;
78 enum LED_PIN_871x LedPin;
79 u32 CurrLedState;
80 u8 bLedOn;
81 u8 bSWLedCtrl;
82 u8 bLedBlinkInProgress;
83 u8 bLedNoLinkBlinkInProgress;
84 u8 bLedLinkBlinkInProgress;
85 u8 bLedStartToLinkBlinkInProgress;
86 u8 bLedScanBlinkInProgress;
87 u8 bLedWPSBlinkInProgress;
88 u32 BlinkTimes;
89 u32 BlinkingLedState;
90
91
92
93 struct timer_list BlinkTimer;
94 struct work_struct BlinkWorkItem;
95 };
96
97 struct led_priv {
98
99 struct LED_871x SwLed0;
100 struct LED_871x SwLed1;
101 enum LED_STRATEGY_871x LedStrategy;
102 u8 bRegUseLed;
103 void (*LedControlHandler)(struct _adapter *padapter,
104 enum LED_CTL_MODE LedAction);
105
106 };
107
108
109
110
111
112 void r8712_InitSwLeds(struct _adapter *padapter);
113 void r8712_DeInitSwLeds(struct _adapter *padapter);
114 void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction);
115
116 #endif
117