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
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
{
31 LED_POWER_ON_BLINK
= 5,
33 LED_NO_LINK_BLINK
= 7,
34 LED_BLINK_StartToBlink
= 8,
37 LED_BLINK_WPS_STOP
= 11,
38 LED_BLINK_WPS_STOP_OVERLAP
= 12,
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
{
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 */
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
;
75 bool bLedBlinkInProgress
;
76 bool bLedNoLinkBlinkInProgress
;
77 bool bLedLinkBlinkInProgress
;
78 bool bLedStartToLinkBlinkInProgress
;
79 bool bLedScanBlinkInProgress
;
80 bool bLedWPSBlinkInProgress
;
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
);