• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/rtl8192su/
1/******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
3 *
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.
8 *
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
12 *
13 * The full GNU General Public License is included in this distribution in the
14 * file called LICENSE.
15 *
16 * Contact Information:
17 * wlanfae <wlanfae@realtek.com>
18******************************************************************************/
19#ifndef __INC_HAL8192USBLED_H
20#define __INC_HAL8192USBLED_H
21
22#include <linux/types.h>
23#include <linux/timer.h>
24
25typedef	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,
39
40}LED_STATE_819xUsb;
41
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)
45
46#define IS_LED_BLINKING(_LED_819xUsb) 	(((PLED_819xUsb)_LED_819xUsb)->bLedWPSBlinkInProgress \
47											||((PLED_819xUsb)_LED_819xUsb)->bLedScanBlinkInProgress)
48
49typedef enum _LED_PIN_819xUsb{
50	LED_PIN_GPIO0,
51	LED_PIN_LED0,
52	LED_PIN_LED1
53}LED_PIN_819xUsb;
54
55typedef	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;
64
65typedef struct _LED_819xUsb{
66	struct net_device 		*dev;
67
68	LED_PIN_819xUsb		LedPin;
69
70	LED_STATE_819xUsb	CurrLedState;
71	bool					bLedOn;
72
73	bool					bSWLedCtrl;
74
75	bool					bLedBlinkInProgress;
76	bool					bLedNoLinkBlinkInProgress;
77	bool					bLedLinkBlinkInProgress;
78	bool					bLedStartToLinkBlinkInProgress;
79	bool					bLedScanBlinkInProgress;
80	bool					bLedWPSBlinkInProgress;
81
82	u32					BlinkTimes;
83	LED_STATE_819xUsb	BlinkingLedState;
84
85	struct timer_list		BlinkTimer;
86} LED_819xUsb, *PLED_819xUsb;
87
88void InitSwLeds(struct net_device *dev);
89void DeInitSwLeds(struct net_device *dev);
90void LedControl8192SUsb(struct net_device *dev,LED_CTL_MODE LedAction);
91
92#endif
93