diff options
author | 2015-08-04 12:17:53 -0700 | |
---|---|---|
committer | 2015-08-04 15:44:42 -0700 | |
commit | 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (patch) | |
tree | 1c9cafbcd35f783a87880a10f85d1a060db1a563 /kernel/drivers/staging/rtl8712/rtl871x_led.h | |
parent | 98260f3884f4a202f9ca5eabed40b1354c489b29 (diff) |
Add the rt linux 4.1.3-rt3 as base
Import the rt linux 4.1.3-rt3 as OPNFV kvm base.
It's from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt and
the base is:
commit 0917f823c59692d751951bf5ea699a2d1e2f26a2
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Sat Jul 25 12:13:34 2015 +0200
Prepare v4.1.3-rt3
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
We lose all the git history this way and it's not good. We
should apply another opnfv project repo in future.
Change-Id: I87543d81c9df70d99c5001fbdf646b202c19f423
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Diffstat (limited to 'kernel/drivers/staging/rtl8712/rtl871x_led.h')
-rw-r--r-- | kernel/drivers/staging/rtl8712/rtl871x_led.h | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/kernel/drivers/staging/rtl8712/rtl871x_led.h b/kernel/drivers/staging/rtl8712/rtl871x_led.h new file mode 100644 index 000000000..eb612053a --- /dev/null +++ b/kernel/drivers/staging/rtl8712/rtl871x_led.h @@ -0,0 +1,124 @@ +/****************************************************************************** + * + * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA + * + * Modifications for inclusion into the Linux staging tree are + * Copyright(c) 2010 Larry Finger. All rights reserved. + * + * Contact information: + * WLAN FAE <wlanfae@realtek.com> + * Larry Finger <Larry.Finger@lwfinger.net> + * + ******************************************************************************/ +#ifndef __RTL8712_LED_H +#define __RTL8712_LED_H + +#include "osdep_service.h" +#include "drv_types.h" + +/*=========================================================================== + * LED customization. + *=========================================================================== + */ +enum LED_CTL_MODE { + LED_CTL_POWER_ON = 1, + LED_CTL_LINK = 2, + LED_CTL_NO_LINK = 3, + LED_CTL_TX = 4, + LED_CTL_RX = 5, + LED_CTL_SITE_SURVEY = 6, + LED_CTL_POWER_OFF = 7, + LED_CTL_START_TO_LINK = 8, + LED_CTL_START_WPS = 9, + LED_CTL_STOP_WPS = 10, + LED_CTL_START_WPS_BOTTON = 11, + LED_CTL_STOP_WPS_FAIL = 12, + LED_CTL_STOP_WPS_FAIL_OVERLAP = 13, +}; + +#define IS_LED_WPS_BLINKING(_LED_871x) \ + (((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS \ + || ((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP \ + || ((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress) + +#define IS_LED_BLINKING(_LED_871x) \ + (((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress \ + || ((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress) + +enum LED_PIN_871x { + LED_PIN_GPIO0, + LED_PIN_LED0, + LED_PIN_LED1 +}; + +/*=========================================================================== + * LED customization. + *=========================================================================== + */ +enum LED_STRATEGY_871x { + SW_LED_MODE0, /* SW control 1 LED via GPIO0. It is default option. */ + SW_LED_MODE1, /* 2 LEDs, through LED0 and LED1. For ALPHA. */ + SW_LED_MODE2, /* SW control 1 LED via GPIO0, + * custom for AzWave 8187 minicard. */ + SW_LED_MODE3, /* SW control 1 LED via GPIO0, + * customized for Sercomm Printer Server case.*/ + SW_LED_MODE4, /*for Edimax / Belkin*/ + SW_LED_MODE5, /*for Sercomm / Belkin*/ + SW_LED_MODE6, /*for WNC / Corega*/ + HW_LED, /* HW control 2 LEDs, LED0 and LED1 (there are 4 different + * control modes, see MAC.CONFIG1 for details.)*/ +}; + +struct LED_871x { + struct _adapter *padapter; + enum LED_PIN_871x LedPin; /* Implementation for this SW led. */ + u32 CurrLedState; /* Current LED state. */ + u8 bLedOn; /* true if LED is ON */ + u8 bSWLedCtrl; + u8 bLedBlinkInProgress; /*true if blinking */ + u8 bLedNoLinkBlinkInProgress; + u8 bLedLinkBlinkInProgress; + u8 bLedStartToLinkBlinkInProgress; + u8 bLedScanBlinkInProgress; + u8 bLedWPSBlinkInProgress; + u32 BlinkTimes; /* No. times to toggle for blink.*/ + u32 BlinkingLedState; /* Next state for blinking, + * either LED_ON or OFF.*/ + + struct timer_list BlinkTimer; /* Timer object for led blinking.*/ + struct work_struct BlinkWorkItem; /* Workitem used by BlinkTimer */ +}; + +struct led_priv { + /* add for led control */ + struct LED_871x SwLed0; + struct LED_871x SwLed1; + enum LED_STRATEGY_871x LedStrategy; + u8 bRegUseLed; + void (*LedControlHandler)(struct _adapter *padapter, + enum LED_CTL_MODE LedAction); + /* add for led control */ +}; + +/*=========================================================================== + * Interface to manipulate LED objects. + *===========================================================================*/ +void r8712_InitSwLeds(struct _adapter *padapter); +void r8712_DeInitSwLeds(struct _adapter *padapter); +void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction); + +#endif + |