1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 /* Copyright(c) 2007 - 2011 Realtek Corporation. */ 3 4 #ifndef __RTW_LED_H_ 5 #define __RTW_LED_H_ 6 7 #include "osdep_service.h" 8 #include "drv_types.h" 9 10 enum LED_CTL_MODE { 11 LED_CTL_LINK = 2, 12 LED_CTL_NO_LINK = 3, 13 LED_CTL_TX = 4, 14 LED_CTL_RX = 5, 15 LED_CTL_SITE_SURVEY = 6, 16 LED_CTL_POWER_OFF = 7, 17 LED_CTL_START_TO_LINK = 8, 18 LED_CTL_START_WPS = 9, 19 LED_CTL_STOP_WPS = 10, 20 LED_CTL_STOP_WPS_FAIL = 12, 21 }; 22 23 enum LED_STATE_871x { 24 RTW_LED_OFF = 2, 25 LED_BLINK_NORMAL = 3, 26 LED_BLINK_SLOWLY = 4, 27 LED_BLINK_SCAN = 6, /* LED is blinking during scanning period, 28 * the # of times to blink is depend on time 29 * for scanning. */ 30 LED_BLINK_TXRX = 9, 31 LED_BLINK_WPS = 10, /* LED is blinkg during WPS communication */ 32 LED_BLINK_WPS_STOP = 11, 33 }; 34 35 struct led_priv { 36 struct adapter *padapter; 37 38 bool bRegUseLed; 39 40 enum LED_STATE_871x CurrLedState; /* Current LED state. */ 41 42 bool bLedOn; /* true if LED is ON, false if LED is OFF. */ 43 44 bool bLedBlinkInProgress; /* true if it is blinking, false o.w.. */ 45 46 bool bLedWPSBlinkInProgress; 47 48 u32 BlinkTimes; /* Number of times to toggle led state for blinking. */ 49 50 bool bLedLinkBlinkInProgress; 51 bool bLedScanBlinkInProgress; 52 struct delayed_work blink_work; 53 }; 54 55 void rtl8188eu_InitSwLeds(struct adapter *padapter); 56 void rtl8188eu_DeInitSwLeds(struct adapter *padapter); 57 58 void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction); 59 60 #endif /* __RTW_LED_H_ */ 61