1 #ifndef __RTL8712_LED_H
2 #define __RTL8712_LED_H
4 #include "osdep_service.h"
7 /*===========================================================================
9 *===========================================================================
17 LED_CTL_SITE_SURVEY
= 6,
18 LED_CTL_POWER_OFF
= 7,
19 LED_CTL_START_TO_LINK
= 8,
20 LED_CTL_START_WPS
= 9,
21 LED_CTL_STOP_WPS
= 10,
22 LED_CTL_START_WPS_BOTTON
= 11,
23 LED_CTL_STOP_WPS_FAIL
= 12,
24 LED_CTL_STOP_WPS_FAIL_OVERLAP
= 13,
27 #define IS_LED_WPS_BLINKING(_LED_871x) \
28 (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS \
29 || ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP \
30 || ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
32 #define IS_LED_BLINKING(_LED_871x) \
33 (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress \
34 || ((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress)
42 /*===========================================================================
44 *===========================================================================
46 enum LED_STRATEGY_871x
{
47 SW_LED_MODE0
, /* SW control 1 LED via GPIO0. It is default option. */
48 SW_LED_MODE1
, /* 2 LEDs, through LED0 and LED1. For ALPHA. */
49 SW_LED_MODE2
, /* SW control 1 LED via GPIO0,
50 * custom for AzWave 8187 minicard. */
51 SW_LED_MODE3
, /* SW control 1 LED via GPIO0,
52 * customized for Sercomm Printer Server case.*/
53 SW_LED_MODE4
, /*for Edimax / Belkin*/
54 SW_LED_MODE5
, /*for Sercomm / Belkin*/
55 SW_LED_MODE6
, /*for WNC / Corega*/
56 HW_LED
, /* HW control 2 LEDs, LED0 and LED1 (there are 4 different
57 * control modes, see MAC.CONFIG1 for details.)*/
61 struct _adapter
*padapter
;
62 enum LED_PIN_871x LedPin
; /* Implementation for this SW led. */
63 u32 CurrLedState
; /* Current LED state. */
64 u8 bLedOn
; /* true if LED is ON */
66 u8 bLedBlinkInProgress
; /*true if blinking */
67 u8 bLedNoLinkBlinkInProgress
;
68 u8 bLedLinkBlinkInProgress
;
69 u8 bLedStartToLinkBlinkInProgress
;
70 u8 bLedScanBlinkInProgress
;
71 u8 bLedWPSBlinkInProgress
;
72 u32 BlinkTimes
; /* No. times to toggle for blink.*/
73 u32 BlinkingLedState
; /* Next state for blinking,
74 * either LED_ON or OFF.*/
76 struct timer_list BlinkTimer
; /* Timer object for led blinking.*/
77 _workitem BlinkWorkItem
; /* Workitem used by BlinkTimer */
81 /* add for led controll */
82 struct LED_871x SwLed0
;
83 struct LED_871x SwLed1
;
84 enum LED_STRATEGY_871x LedStrategy
;
86 void (*LedControlHandler
)(struct _adapter
*padapter
,
87 enum LED_CTL_MODE LedAction
);
88 /* add for led controll */
91 /*===========================================================================
92 * Interface to manipulate LED objects.
93 *===========================================================================*/
94 void r8712_InitSwLeds(struct _adapter
*padapter
);
95 void r8712_DeInitSwLeds(struct _adapter
*padapter
);
96 void LedControl871x(struct _adapter
*padapter
, enum LED_CTL_MODE LedAction
);