WiFi: add rtl8189es/etv support, Optimization wifi configuration.
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8189es / hal / rtl8188e / sdio / rtl8189es_led.c
1 /******************************************************************************\r
2  *\r
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.\r
4  *\r
5  * This program is free software; you can redistribute it and/or modify it\r
6  * under the terms of version 2 of the GNU General Public License as\r
7  * published by the Free Software Foundation.\r
8  *\r
9  * This program is distributed in the hope that it will be useful, but WITHOUT\r
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
12  * more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License along with\r
15  * this program; if not, write to the Free Software Foundation, Inc.,\r
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA\r
17  *\r
18  *\r
19  ******************************************************************************/\r
20 #define _RTL8189ES_LED_C_\r
21 \r
22 #include "drv_types.h"\r
23 #include "rtl8188e_hal.h"\r
24 \r
25 //================================================================================\r
26 // LED object.\r
27 //================================================================================\r
28 \r
29 \r
30 //================================================================================\r
31 //      Prototype of protected function.\r
32 //================================================================================\r
33 \r
34 //================================================================================\r
35 // LED_819xUsb routines.\r
36 //================================================================================\r
37 \r
38 //\r
39 //      Description:\r
40 //              Turn on LED according to LedPin specified.\r
41 //\r
42 static void\r
43 SwLedOn_8188ES(\r
44         _adapter                        *padapter,\r
45         PLED_SDIO               pLed\r
46 )\r
47 {\r
48         u8      LedCfg;\r
49         HAL_DATA_TYPE   *pHalData = GET_HAL_DATA(padapter);\r
50 \r
51         if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))\r
52         {\r
53                 return;\r
54         }\r
55 \r
56         pLed->bLedOn = _TRUE;\r
57 }\r
58 \r
59 \r
60 //\r
61 //      Description:\r
62 //              Turn off LED according to LedPin specified.\r
63 //\r
64 static void\r
65 SwLedOff_8188ES(\r
66         _adapter                        *padapter,\r
67         PLED_SDIO               pLed\r
68 )\r
69 {\r
70         u8      LedCfg;\r
71         HAL_DATA_TYPE   *pHalData = GET_HAL_DATA(padapter);\r
72 \r
73         if(padapter->bSurpriseRemoved == _TRUE)\r
74         {\r
75                 goto exit;\r
76         }\r
77 \r
78 exit:\r
79         pLed->bLedOn = _FALSE;\r
80 \r
81 }\r
82 \r
83 //================================================================================\r
84 // Default LED behavior.\r
85 //================================================================================\r
86 \r
87 //\r
88 //      Description:\r
89 //              Initialize all LED_871x objects.\r
90 //\r
91 void\r
92 rtl8188es_InitSwLeds(\r
93         _adapter        *padapter\r
94         )\r
95 {\r
96 #if 0\r
97         struct led_priv *pledpriv = &(padapter->ledpriv);\r
98 \r
99         pledpriv->LedControlHandler = LedControlSDIO;\r
100 \r
101         pledpriv->SwLedOn = SwLedOn_8188ES;\r
102         pledpriv->SwLedOff = SwLedOff_8188ES;\r
103 \r
104         InitLed(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);\r
105 \r
106         InitLed(padapter, &(pledpriv->SwLed1), LED_PIN_LED1);\r
107 #endif\r
108 }\r
109 \r
110 \r
111 //\r
112 //      Description:\r
113 //              DeInitialize all LED_819xUsb objects.\r
114 //\r
115 void\r
116 rtl8188es_DeInitSwLeds(\r
117         _adapter        *padapter\r
118         )\r
119 {\r
120 #if 0\r
121         struct led_priv *ledpriv = &(padapter->ledpriv);\r
122 \r
123         DeInitLed( &(ledpriv->SwLed0) );\r
124         DeInitLed( &(ledpriv->SwLed1) );\r
125 #endif\r
126 }\r
127 \r