0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef __RTL8712_LED_H
0015 #define __RTL8712_LED_H
0016
0017 #include "osdep_service.h"
0018 #include "drv_types.h"
0019
0020
0021
0022
0023
0024 enum LED_CTL_MODE {
0025 LED_CTL_POWER_ON = 1,
0026 LED_CTL_LINK = 2,
0027 LED_CTL_NO_LINK = 3,
0028 LED_CTL_TX = 4,
0029 LED_CTL_RX = 5,
0030 LED_CTL_SITE_SURVEY = 6,
0031 LED_CTL_POWER_OFF = 7,
0032 LED_CTL_START_TO_LINK = 8,
0033 LED_CTL_START_WPS = 9,
0034 LED_CTL_STOP_WPS = 10,
0035 LED_CTL_START_WPS_BOTTON = 11,
0036 LED_CTL_STOP_WPS_FAIL = 12,
0037 LED_CTL_STOP_WPS_FAIL_OVERLAP = 13,
0038 };
0039
0040 #define IS_LED_WPS_BLINKING(_LED_871x) \
0041 (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS \
0042 || ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP \
0043 || ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
0044
0045 #define IS_LED_BLINKING(_LED_871x) \
0046 (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress \
0047 || ((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress)
0048
0049 enum LED_PIN_871x {
0050 LED_PIN_GPIO0,
0051 LED_PIN_LED0,
0052 LED_PIN_LED1
0053 };
0054
0055
0056
0057
0058
0059 enum LED_STRATEGY_871x {
0060 SW_LED_MODE0,
0061 SW_LED_MODE1,
0062 SW_LED_MODE2,
0063
0064
0065 SW_LED_MODE3,
0066
0067
0068 SW_LED_MODE4,
0069 SW_LED_MODE5,
0070 SW_LED_MODE6,
0071 HW_LED,
0072
0073
0074 };
0075
0076 struct LED_871x {
0077 struct _adapter *padapter;
0078 enum LED_PIN_871x LedPin;
0079 u32 CurrLedState;
0080 u8 bLedOn;
0081 u8 bSWLedCtrl;
0082 u8 bLedBlinkInProgress;
0083 u8 bLedNoLinkBlinkInProgress;
0084 u8 bLedLinkBlinkInProgress;
0085 u8 bLedStartToLinkBlinkInProgress;
0086 u8 bLedScanBlinkInProgress;
0087 u8 bLedWPSBlinkInProgress;
0088 u32 BlinkTimes;
0089 u32 BlinkingLedState;
0090
0091
0092
0093 struct timer_list BlinkTimer;
0094 struct work_struct BlinkWorkItem;
0095 };
0096
0097 struct led_priv {
0098
0099 struct LED_871x SwLed0;
0100 struct LED_871x SwLed1;
0101 enum LED_STRATEGY_871x LedStrategy;
0102 u8 bRegUseLed;
0103 void (*LedControlHandler)(struct _adapter *padapter,
0104 enum LED_CTL_MODE LedAction);
0105
0106 };
0107
0108
0109
0110
0111
0112 void r8712_InitSwLeds(struct _adapter *padapter);
0113 void r8712_DeInitSwLeds(struct _adapter *padapter);
0114 void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction);
0115 void r8712_flush_led_works(struct _adapter *padapter);
0116
0117 #endif
0118