RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / staging / rtl8192su / r8192SU_led.h
blob440f4f7a69b578588199e7c356876dee52d7b8c5
1 /******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
4 * This program is distributed in the hope that it will be useful, but WITHOUT
5 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
7 * more details.
9 * You should have received a copy of the GNU General Public License along with
10 * this program; if not, write to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
13 * The full GNU General Public License is included in this distribution in the
14 * file called LICENSE.
16 * Contact Information:
17 * wlanfae <wlanfae@realtek.com>
18 ******************************************************************************/
19 #ifndef __INC_HAL8192USBLED_H
20 #define __INC_HAL8192USBLED_H
22 #include <linux/types.h>
23 #include <linux/timer.h>
25 typedef enum _LED_STATE_819xUsb{
26 LED_UNKNOWN = 0,
27 LED_ON = 1,
28 LED_OFF = 2,
29 LED_BLINK_NORMAL = 3,
30 LED_BLINK_SLOWLY = 4,
31 LED_POWER_ON_BLINK = 5,
32 LED_SCAN_BLINK = 6,
33 LED_NO_LINK_BLINK = 7,
34 LED_BLINK_StartToBlink = 8,
35 LED_BLINK_WPS = 9,
36 LED_TXRX_BLINK = 10,
37 LED_BLINK_WPS_STOP = 11,
38 LED_BLINK_WPS_STOP_OVERLAP = 12,
40 }LED_STATE_819xUsb;
42 #define IS_LED_WPS_BLINKING(_LED_819xUsb) (((PLED_819xUsb)_LED_819xUsb)->CurrLedState==LED_BLINK_WPS \
43 || ((PLED_819xUsb)_LED_819xUsb)->CurrLedState==LED_BLINK_WPS_STOP \
44 || ((PLED_819xUsb)_LED_819xUsb)->bLedWPSBlinkInProgress)
46 #define IS_LED_BLINKING(_LED_819xUsb) (((PLED_819xUsb)_LED_819xUsb)->bLedWPSBlinkInProgress \
47 ||((PLED_819xUsb)_LED_819xUsb)->bLedScanBlinkInProgress)
49 typedef enum _LED_PIN_819xUsb{
50 LED_PIN_GPIO0,
51 LED_PIN_LED0,
52 LED_PIN_LED1
53 }LED_PIN_819xUsb;
55 typedef enum _LED_STRATEGY_819xUsb{
56 SW_LED_MODE0, /* SW control 1 LED via GPIO0. It is default option. */
57 SW_LED_MODE1, /* SW control for PCI Express */
58 SW_LED_MODE2, /* SW control for Cameo. */
59 SW_LED_MODE3, /* SW contorl for RunTop. */
60 SW_LED_MODE4, /* SW control for Netcore */
61 SW_LED_MODE5,
62 HW_LED, /* HW control 2 LEDs, LED0 and LED1 (there are 4 different control modes) */
63 }LED_STRATEGY_819xUsb, *PLED_STRATEGY_819xUsb;
65 typedef struct _LED_819xUsb{
66 struct net_device *dev;
68 LED_PIN_819xUsb LedPin;
70 LED_STATE_819xUsb CurrLedState;
71 bool bLedOn;
73 bool bSWLedCtrl;
75 bool bLedBlinkInProgress;
76 bool bLedNoLinkBlinkInProgress;
77 bool bLedLinkBlinkInProgress;
78 bool bLedStartToLinkBlinkInProgress;
79 bool bLedScanBlinkInProgress;
80 bool bLedWPSBlinkInProgress;
82 u32 BlinkTimes;
83 LED_STATE_819xUsb BlinkingLedState;
85 struct timer_list BlinkTimer;
86 } LED_819xUsb, *PLED_819xUsb;
88 void InitSwLeds(struct net_device *dev);
89 void DeInitSwLeds(struct net_device *dev);
90 void LedControl8192SUsb(struct net_device *dev,LED_CTL_MODE LedAction);
92 #endif