Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rtl871x_led.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  * Modifications for inclusion into the Linux staging tree are
19  * Copyright(c) 2010 Larry Finger. All rights reserved.
20  *
21  * Contact information:
22  * WLAN FAE <[email protected]>
23  * Larry Finger <[email protected]>
24  *
25  ******************************************************************************/
26 #ifndef __RTL8712_LED_H
27 #define __RTL8712_LED_H
28 
29 #include "osdep_service.h"
30 #include "drv_types.h"
31 
32 /*===========================================================================
33  * LED customization.
34  *===========================================================================
35  */
50 };
51 
52 #define IS_LED_WPS_BLINKING(_LED_871x) \
53  (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS \
54  || ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP \
55  || ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
56 
57 #define IS_LED_BLINKING(_LED_871x) \
58  (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress \
59  || ((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress)
60 
65 };
66 
67 /*===========================================================================
68  * LED customization.
69  *===========================================================================
70  */
72  SW_LED_MODE0, /* SW control 1 LED via GPIO0. It is default option. */
73  SW_LED_MODE1, /* 2 LEDs, through LED0 and LED1. For ALPHA. */
74  SW_LED_MODE2, /* SW control 1 LED via GPIO0,
75  * custom for AzWave 8187 minicard. */
76  SW_LED_MODE3, /* SW control 1 LED via GPIO0,
77  * customized for Sercomm Printer Server case.*/
78  SW_LED_MODE4, /*for Edimax / Belkin*/
79  SW_LED_MODE5, /*for Sercomm / Belkin*/
80  SW_LED_MODE6, /*for WNC / Corega*/
81  HW_LED, /* HW control 2 LEDs, LED0 and LED1 (there are 4 different
82  * control modes, see MAC.CONFIG1 for details.)*/
83 };
84 
85 struct LED_871x {
86  struct _adapter *padapter;
87  enum LED_PIN_871x LedPin; /* Implementation for this SW led. */
88  u32 CurrLedState; /* Current LED state. */
89  u8 bLedOn; /* true if LED is ON */
91  u8 bLedBlinkInProgress; /*true if blinking */
97  u32 BlinkTimes; /* No. times to toggle for blink.*/
98  u32 BlinkingLedState; /* Next state for blinking,
99  * either LED_ON or OFF.*/
100 
101  struct timer_list BlinkTimer; /* Timer object for led blinking.*/
102  _workitem BlinkWorkItem; /* Workitem used by BlinkTimer */
103 };
104 
105 struct led_priv {
106  /* add for led control */
107  struct LED_871x SwLed0;
108  struct LED_871x SwLed1;
111  void (*LedControlHandler)(struct _adapter *padapter,
112  enum LED_CTL_MODE LedAction);
113  /* add for led control */
114 };
115 
116 /*===========================================================================
117  * Interface to manipulate LED objects.
118  *===========================================================================*/
119 void r8712_InitSwLeds(struct _adapter *padapter);
120 void r8712_DeInitSwLeds(struct _adapter *padapter);
121 void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction);
122 
123 #endif
124