1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
6 ******************************************************************************/
10 #include <osdep_service.h>
11 #include <drv_types.h>
13 #define LED_BLINK_NO_LINK_INTERVAL_ALPHA 1000
14 #define LED_BLINK_LINK_INTERVAL_ALPHA 500 /* 500 */
15 #define LED_BLINK_SCAN_INTERVAL_ALPHA 180 /* 150 */
16 #define LED_BLINK_FASTER_INTERVAL_ALPHA 50
17 #define LED_BLINK_WPS_SUCCESS_INTERVAL_ALPHA 5000
27 LED_CTL_START_TO_LINK,
30 LED_CTL_START_WPS_BOTTON,
48 struct adapter *padapter;
50 enum LED_STATE_871x CurrLedState; /* Current LED state. */
51 enum LED_STATE_871x BlinkingLedState; /* Next state for blinking,
52 * either RTW_LED_ON or RTW_LED_OFF are.
55 u8 bLedOn; /* true if LED is ON, false if LED is OFF. */
57 u8 bLedBlinkInProgress; /* true if it is blinking, false o.w.. */
59 u8 bLedWPSBlinkInProgress;
61 u32 BlinkTimes; /* Number of times to toggle led state for blinking. */
63 struct timer_list BlinkTimer; /* Timer object for led blinking. */
65 /* ALPHA, added by chiyoko, 20090106 */
66 u8 bLedNoLinkBlinkInProgress;
67 u8 bLedLinkBlinkInProgress;
68 u8 bLedScanBlinkInProgress;
69 struct work_struct BlinkWorkItem; /* Workitem used by BlinkTimer to
70 * manipulate H/W to blink LED.
74 #define IS_LED_WPS_BLINKING(_LED_871x) \
75 (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS || \
76 ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP || \
77 ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
79 void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction);
82 /* add for led control */
83 struct LED_871x SwLed0;
84 /* add for led control */
87 void BlinkWorkItemCallback(struct work_struct *work);
89 void ResetLedStatus(struct LED_871x *pLed);
91 void InitLed871x(struct adapter *padapter, struct LED_871x *pLed);
93 void DeInitLed871x(struct LED_871x *pLed);
96 void BlinkHandler(struct LED_871x *pLed);
97 void SwLedOn(struct adapter *padapter, struct LED_871x *pLed);
98 void SwLedOff(struct adapter *padapter, struct LED_871x *pLed);
100 #endif /* __RTW_LED_H_ */