1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef __RTW_LED_H_
17#define __RTW_LED_H_
18
19#include <osdep_service.h>
20#include <drv_types.h>
21
22#define LED_BLINK_NO_LINK_INTERVAL_ALPHA 1000
23#define LED_BLINK_LINK_INTERVAL_ALPHA 500
24#define LED_BLINK_SCAN_INTERVAL_ALPHA 180
25#define LED_BLINK_FASTER_INTERVAL_ALPHA 50
26#define LED_BLINK_WPS_SUCCESS_INTERVAL_ALPHA 5000
27
28enum LED_CTL_MODE {
29 LED_CTL_POWER_ON,
30 LED_CTL_LINK,
31 LED_CTL_NO_LINK,
32 LED_CTL_TX,
33 LED_CTL_RX,
34 LED_CTL_SITE_SURVEY,
35 LED_CTL_POWER_OFF,
36 LED_CTL_START_TO_LINK,
37 LED_CTL_START_WPS,
38 LED_CTL_STOP_WPS,
39 LED_CTL_START_WPS_BOTTON,
40 LED_CTL_STOP_WPS_FAIL
41};
42
43enum LED_STATE_871x {
44 LED_UNKNOWN,
45 RTW_LED_ON,
46 RTW_LED_OFF,
47 LED_BLINK_NORMAL,
48 LED_BLINK_SLOWLY,
49 LED_BLINK_POWER_ON,
50 LED_BLINK_SCAN,
51 LED_BLINK_TXRX,
52 LED_BLINK_WPS,
53 LED_BLINK_WPS_STOP
54};
55
56struct LED_871x {
57 struct adapter *padapter;
58
59 enum LED_STATE_871x CurrLedState;
60 enum LED_STATE_871x BlinkingLedState;
61
62
63
64 u8 bLedOn;
65
66 u8 bLedBlinkInProgress;
67
68 u8 bLedWPSBlinkInProgress;
69
70 u32 BlinkTimes;
71
72 struct timer_list BlinkTimer;
73
74
75 u8 bLedNoLinkBlinkInProgress;
76 u8 bLedLinkBlinkInProgress;
77 u8 bLedScanBlinkInProgress;
78 struct work_struct BlinkWorkItem;
79
80
81};
82
83#define IS_LED_WPS_BLINKING(_LED_871x) \
84 (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS || \
85 ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP || \
86 ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
87
88void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction);
89
90struct led_priv {
91
92 struct LED_871x SwLed0;
93
94};
95
96void BlinkWorkItemCallback(struct work_struct *work);
97
98void ResetLedStatus(struct LED_871x *pLed);
99
100void InitLed871x(struct adapter *padapter, struct LED_871x *pLed);
101
102void DeInitLed871x(struct LED_871x *pLed);
103
104
105void BlinkHandler(struct LED_871x *pLed);
106void SwLedOn(struct adapter *padapter, struct LED_871x *pLed);
107void SwLedOff(struct adapter *padapter, struct LED_871x *pLed);
108
109#endif
110