2014-12-19 06:59:46 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2012 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
|
|
|
|
*
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#include <drv_types.h>
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* */
|
|
|
|
/* Description: */
|
|
|
|
/* Callback function of LED BlinkTimer, */
|
|
|
|
/* it just schedules to corresponding BlinkWorkItem/led_blink_hdl */
|
|
|
|
/* */
|
2018-04-11 15:19:48 +00:00
|
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
2014-12-19 06:59:46 +00:00
|
|
|
void BlinkTimerCallback(void *data)
|
2018-04-11 15:19:48 +00:00
|
|
|
#else
|
|
|
|
void BlinkTimerCallback(struct timer_list *t)
|
|
|
|
#endif
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2018-04-11 15:19:48 +00:00
|
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
2014-12-19 06:59:46 +00:00
|
|
|
PLED_871x pLed = (PLED_871x)data;
|
2018-04-11 15:19:48 +00:00
|
|
|
#else
|
|
|
|
PLED_871x pLed = from_timer(pLed, t, BlinkTimer);
|
|
|
|
#endif
|
2014-12-19 06:59:46 +00:00
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
|
2015-08-15 21:38:30 +00:00
|
|
|
/* DBG_88E("%s\n", __FUNCTION__); */
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
/* DBG_88E("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __FUNCTION__, padapter->bSurpriseRemoved, padapter->bDriverStopped); */
|
2014-12-19 06:59:46 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
_set_workitem(&(pLed->BlinkWorkItem));
|
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* */
|
|
|
|
/* Description: */
|
|
|
|
/* Callback function of LED BlinkWorkItem. */
|
|
|
|
/* We dispatch acture LED blink action according to LedStrategy. */
|
|
|
|
/* */
|
2014-12-19 06:59:46 +00:00
|
|
|
void BlinkWorkItemCallback(struct work_struct *work)
|
|
|
|
{
|
|
|
|
PLED_871x pLed = container_of(work, LED_871x, BlinkWorkItem);
|
|
|
|
BlinkHandler(pLed);
|
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* */
|
|
|
|
/* Description: */
|
|
|
|
/* Reset status of LED_871x object. */
|
|
|
|
/* */
|
2014-12-19 06:59:46 +00:00
|
|
|
void ResetLedStatus(PLED_871x pLed) {
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
pLed->CurrLedState = RTW_LED_OFF; /* Current LED state. */
|
|
|
|
pLed->bLedOn = false; /* true if LED is ON, false if LED is OFF. */
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
pLed->bLedBlinkInProgress = false; /* true if it is blinking, false o.w.. */
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */
|
|
|
|
pLed->BlinkingLedState = LED_UNKNOWN; /* Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are. */
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
|
|
|
pLed->bLedLinkBlinkInProgress = false;
|
|
|
|
pLed->bLedStartToLinkBlinkInProgress = false;
|
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* */
|
|
|
|
/* Description: */
|
|
|
|
/* Initialize an LED_871x object. */
|
|
|
|
/* */
|
2014-12-19 06:59:46 +00:00
|
|
|
void
|
|
|
|
InitLed871x(
|
|
|
|
struct adapter *padapter,
|
|
|
|
PLED_871x pLed,
|
|
|
|
LED_PIN_871x LedPin
|
|
|
|
)
|
|
|
|
{
|
|
|
|
pLed->padapter = padapter;
|
|
|
|
pLed->LedPin = LedPin;
|
|
|
|
|
|
|
|
ResetLedStatus(pLed);
|
|
|
|
|
2018-04-11 15:19:48 +00:00
|
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
2014-12-19 06:59:46 +00:00
|
|
|
_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
|
2018-04-11 15:19:48 +00:00
|
|
|
#else
|
|
|
|
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
|
|
|
|
#endif
|
2014-12-19 06:59:46 +00:00
|
|
|
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
|
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* */
|
|
|
|
/* Description: */
|
|
|
|
/* DeInitialize an LED_871x object. */
|
|
|
|
/* */
|
2014-12-19 06:59:46 +00:00
|
|
|
void
|
|
|
|
DeInitLed871x(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_cancel_workitem_sync(&(pLed->BlinkWorkItem));
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
ResetLedStatus(pLed);
|
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* */
|
|
|
|
/* Description: */
|
|
|
|
/* Implementation of LED blinking behavior. */
|
|
|
|
/* It toggle off LED and schedule corresponding timer if necessary. */
|
|
|
|
/* */
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
static void SwLedBlink(PLED_871x pLed)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-29 02:13:24 +00:00
|
|
|
u8 bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Change LED according to BlinkingLedState specified. */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ( "Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Determine if we shall change LED state again. */
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
case LED_BLINK_NORMAL:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->BlinkTimes == 0)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_StartToBlink:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( check_fwstate(pmlmepriv, _FW_LINKED) && check_fwstate(pmlmepriv, WIFI_STATION_STATE) )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( check_fwstate(pmlmepriv, _FW_LINKED) &&
|
2014-12-19 06:59:46 +00:00
|
|
|
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) )
|
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
else if (pLed->BlinkTimes == 0)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_WPS:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
/* if (adapter_to_pwrctl(padapter)->cpwm >= PS_STATE_S2) */
|
|
|
|
if (0)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if ( (check_fwstate(pmlmepriv, _FW_LINKED) == true) && (pLed->bLedOn == false))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if ( (check_fwstate(pmlmepriv, _FW_LINKED) == true) && pLed->bLedOn == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->BlinkTimes = 0;
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Assign LED state to toggle. */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Schedule a timer to toggle LED state. */
|
2015-08-15 18:05:44 +00:00
|
|
|
switch ( pLed->CurrLedState )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_NORMAL:
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_SLOWLY:
|
|
|
|
case LED_BLINK_StartToBlink:
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_WPS:
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2014-12-19 06:59:46 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LONG_INTERVAL);
|
|
|
|
else
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LONG_INTERVAL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
static void SwLedBlink1(PLED_871x pLed)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
PLED_871x pLed1 = &(ledpriv->SwLed1);
|
2014-12-29 02:13:24 +00:00
|
|
|
u8 bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Change LED according to BlinkingLedState specified. */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ( "Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
ResetLedStatus(pLed);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SLOWLY:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_NORMAL:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_SCAN:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_TXRX:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:19:16 +00:00
|
|
|
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
pLed->BlinkTimes = 0;
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_WPS:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_BLINK_WPS_STOP: /* WPS success */
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->BlinkingLedState == RTW_LED_ON)
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
else
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
static void SwLedBlink2(PLED_871x pLed)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-29 02:13:24 +00:00
|
|
|
u8 bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Change LED according to BlinkingLedState specified. */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SCAN:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop scan blink CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop scan blink CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_TXRX:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("stop CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
static void SwLedBlink3(PLED_871x pLed)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-29 02:13:24 +00:00
|
|
|
u8 bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Change LED according to BlinkingLedState specified. */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState != LED_BLINK_WPS_STOP)
|
2014-12-19 06:59:46 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SCAN:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( !pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_TXRX:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( !pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:19:16 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED) == false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_WPS:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_BLINK_WPS_STOP: /* WPS success */
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->BlinkingLedState == RTW_LED_ON)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
static void SwLedBlink4(PLED_871x pLed)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
PLED_871x pLed1 = &(ledpriv->SwLed1);
|
2014-12-29 02:13:24 +00:00
|
|
|
u8 bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Change LED according to BlinkingLedState specified. */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (!pLed1->bLedWPSBlinkInProgress && pLed1->BlinkingLedState == LED_UNKNOWN)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
pLed1->CurrLedState = RTW_LED_OFF;
|
|
|
|
SwLedOff(padapter, pLed1);
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SLOWLY:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_StartToBlink:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_SCAN:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_TXRX:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_WPS:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_BLINK_WPS_STOP: /* WPS authentication fail */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_BLINK_WPS_STOP_OVERLAP: /* WPS session overlap */
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->BlinkTimes == 0)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkTimes = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkTimes = 10;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("SwLedBlink4 CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
static void SwLedBlink5(PLED_871x pLed)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-29 02:13:24 +00:00
|
|
|
u8 bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Change LED according to BlinkingLedState specified. */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SCAN:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (!pLed->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_TXRX:
|
|
|
|
pLed->BlinkTimes--;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
bStopBlinking = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (bStopBlinking)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (!pLed->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on && adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("SwLedBlink5 CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-01-30 03:41:53 +00:00
|
|
|
static void SwLedBlink6(PLED_871x pLed)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
2014-12-29 02:13:24 +00:00
|
|
|
u8 bStopBlinking = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Change LED according to BlinkingLedState specified. */
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("<==== blink6\n"));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
SwLedControlMode0(
|
|
|
|
struct adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed1);
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Decide led state */
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (LedAction)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_TX:
|
|
|
|
case LED_CTL_RX:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == false )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
|
|
|
pLed->BlinkTimes = 2;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_START_TO_LINK:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == false )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_StartToBlink;
|
|
|
|
pLed->BlinkTimes = 24;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = LED_BLINK_StartToBlink;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_LINK:
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == false )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_NO_LINK:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == false )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_POWER_OFF:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_START_WPS:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == false || pLed->CurrLedState == RTW_LED_ON)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS;
|
|
|
|
pLed->BlinkTimes = 20;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LONG_INTERVAL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LONG_INTERVAL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* ALPHA, added by chiyoko, 20090106 */
|
2014-12-19 06:59:46 +00:00
|
|
|
static void
|
|
|
|
SwLedControlMode1(
|
|
|
|
struct adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (LedAction)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_POWER_ON:
|
|
|
|
case LED_CTL_START_TO_LINK:
|
|
|
|
case LED_CTL_NO_LINK:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedNoLinkBlinkInProgress == false )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == true )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_LINK:
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == false )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_SITE_SURVEY:
|
2015-08-15 18:19:16 +00:00
|
|
|
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED) == true))
|
2014-12-19 06:59:46 +00:00
|
|
|
;
|
2015-08-15 18:02:34 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
return;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == true )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2015-03-10 16:18:03 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_TX:
|
|
|
|
case LED_CTL_RX:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == true )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
2014-12-19 06:59:46 +00:00
|
|
|
case LED_CTL_START_WPS_BOTTON:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == true )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2015-03-10 16:18:03 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_WPS;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == true )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2015-03-10 16:18:03 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS_STOP;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS_FAIL:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_POWER_OFF:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedNoLinkBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedWPSBlinkInProgress )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Arcadyan/Sitecom , added by chiyoko, 20090216 */
|
2014-12-19 06:59:46 +00:00
|
|
|
static void
|
|
|
|
SwLedControlMode2(
|
|
|
|
struct adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (LedAction)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_SITE_SURVEY:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
|
2014-12-19 06:59:46 +00:00
|
|
|
;
|
2015-08-15 18:02:34 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
return;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_TX:
|
|
|
|
case LED_CTL_RX:
|
2015-08-15 18:19:16 +00:00
|
|
|
if ((pLed->bLedBlinkInProgress ==false) && (check_fwstate(pmlmepriv, _FW_LINKED) == true))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_LINK:
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
2014-12-19 06:59:46 +00:00
|
|
|
case LED_CTL_START_WPS_BOTTON:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS:
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS_FAIL:
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_START_TO_LINK:
|
|
|
|
case LED_CTL_NO_LINK:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (!IS_LED_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_POWER_OFF:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedWPSBlinkInProgress )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* COREGA, added by chiyoko, 20090316 */
|
2014-12-19 06:59:46 +00:00
|
|
|
static void
|
|
|
|
SwLedControlMode3(
|
|
|
|
struct adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (LedAction)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_SITE_SURVEY:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
|
2014-12-19 06:59:46 +00:00
|
|
|
;
|
2015-08-15 18:02:34 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
return;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_TX:
|
|
|
|
case LED_CTL_RX:
|
2015-08-15 18:19:16 +00:00
|
|
|
if ((pLed->bLedBlinkInProgress ==false) && (check_fwstate(pmlmepriv, _FW_LINKED) == true))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_LINK:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
2014-12-19 06:59:46 +00:00
|
|
|
case LED_CTL_START_WPS_BOTTON:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_WPS;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS_STOP;
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS_FAIL:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_START_TO_LINK:
|
|
|
|
case LED_CTL_NO_LINK:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (!IS_LED_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_POWER_OFF:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedWPSBlinkInProgress )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("CurrLedState %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Edimax-Belkin, added by chiyoko, 20090413 */
|
2014-12-19 06:59:46 +00:00
|
|
|
static void
|
|
|
|
SwLedControlMode4(
|
|
|
|
struct adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
PLED_871x pLed1 = &(ledpriv->SwLed1);
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (LedAction)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_START_TO_LINK:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed1->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
pLed1->CurrLedState = RTW_LED_OFF;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed1->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedStartToLinkBlinkInProgress == false )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedStartToLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_StartToBlink;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_LINK:
|
|
|
|
case LED_CTL_NO_LINK:
|
2015-02-19 21:34:32 +00:00
|
|
|
/* LED1 settings */
|
2015-08-15 18:02:34 +00:00
|
|
|
if (LedAction == LED_CTL_LINK)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed1->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
pLed1->CurrLedState = RTW_LED_OFF;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed1->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedNoLinkBlinkInProgress == false )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_SITE_SURVEY:
|
2015-08-15 18:19:16 +00:00
|
|
|
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED) == true))
|
2014-12-19 06:59:46 +00:00
|
|
|
;
|
2015-08-15 18:02:34 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
return;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_TX:
|
|
|
|
case LED_CTL_RX:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
2014-12-19 06:59:46 +00:00
|
|
|
case LED_CTL_START_WPS_BOTTON:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed1->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
pLed1->CurrLedState = RTW_LED_OFF;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed1->bLedOn)
|
2014-12-19 06:59:46 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_WPS;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_CTL_STOP_WPS: /* WPS connect success */
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_CTL_STOP_WPS_FAIL: /* WPS authentication fail */
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* LED1 settings */
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
else
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed1->bLedWPSBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
pLed1->CurrLedState = LED_BLINK_WPS_STOP;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed1->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_CTL_STOP_WPS_FAIL_OVERLAP: /* WPS session overlap */
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* LED1 settings */
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
else
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed1->bLedWPSBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
pLed1->CurrLedState = LED_BLINK_WPS_STOP_OVERLAP;
|
|
|
|
pLed1->BlinkTimes = 10;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed1->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_POWER_OFF:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedNoLinkBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedNoLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedWPSBlinkInProgress )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedStartToLinkBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedStartToLinkBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed1->bLedWPSBlinkInProgress )
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed1->bLedWPSBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pLed1->BlinkingLedState = LED_UNKNOWN;
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
SwLedOff(padapter, pLed1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* Sercomm-Belkin, added by chiyoko, 20090415 */
|
2014-12-19 06:59:46 +00:00
|
|
|
static void
|
|
|
|
SwLedControlMode5(
|
|
|
|
struct adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (LedAction)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_POWER_ON:
|
|
|
|
case LED_CTL_NO_LINK:
|
2015-02-19 21:34:32 +00:00
|
|
|
case LED_CTL_LINK: /* solid blue */
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_SITE_SURVEY:
|
2015-08-15 18:19:16 +00:00
|
|
|
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED) == true))
|
2014-12-19 06:59:46 +00:00
|
|
|
;
|
2015-08-15 18:02:34 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==true)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedScanBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SCAN_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_TX:
|
|
|
|
case LED_CTL_RX:
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==false)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 18:02:34 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = true;
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedOn )
|
2014-12-19 06:59:46 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_POWER_OFF:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
2014-12-29 02:13:24 +00:00
|
|
|
pLed->bLedBlinkInProgress = false;
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* WNC-Corega, added by chiyoko, 20090902 */
|
2014-12-19 06:59:46 +00:00
|
|
|
static void
|
|
|
|
SwLedControlMode6(
|
|
|
|
struct adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed0 = &(ledpriv->SwLed0);
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (LedAction)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_POWER_ON:
|
|
|
|
case LED_CTL_LINK:
|
|
|
|
case LED_CTL_NO_LINK:
|
|
|
|
_cancel_timer_ex(&(pLed0->BlinkTimer));
|
|
|
|
pLed0->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed0->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed0->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_POWER_OFF:
|
|
|
|
SwLedOff(padapter, pLed0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("ledcontrol 6 Led %d\n", pLed0->CurrLedState));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:34:32 +00:00
|
|
|
/* */
|
|
|
|
/* Description: */
|
|
|
|
/* Handler function of LED Blinking. */
|
|
|
|
/* We dispatch acture LED blink action according to LedStrategy. */
|
|
|
|
/* */
|
2014-12-19 06:59:46 +00:00
|
|
|
void BlinkHandler(PLED_871x pLed)
|
|
|
|
{
|
|
|
|
struct adapter *padapter = pLed->padapter;
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
|
2015-08-15 21:38:30 +00:00
|
|
|
/* DBG_88E("%s (%s:%d)\n", __FUNCTION__, current->comm, current->pid); */
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( (padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true))
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
2015-08-15 21:38:30 +00:00
|
|
|
/* DBG_88E("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __FUNCTION__, padapter->bSurpriseRemoved, padapter->bDriverStopped); */
|
2014-12-19 06:59:46 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (ledpriv->LedStrategy)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case SW_LED_MODE0:
|
|
|
|
SwLedBlink(pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE1:
|
|
|
|
SwLedBlink1(pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE2:
|
|
|
|
SwLedBlink2(pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE3:
|
|
|
|
SwLedBlink3(pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE4:
|
|
|
|
SwLedBlink4(pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE5:
|
|
|
|
SwLedBlink5(pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE6:
|
|
|
|
SwLedBlink6(pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2015-08-15 18:00:19 +00:00
|
|
|
/* RT_TRACE(COMP_LED, DBG_LOUD, ("BlinkWorkItemCallback 0x%x\n", pHalData->LedStrategy)); */
|
2015-02-19 21:34:32 +00:00
|
|
|
/* SwLedBlink(pLed); */
|
2014-12-19 06:59:46 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
LedControl871x(
|
|
|
|
struct adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
|
2015-03-10 16:18:03 +00:00
|
|
|
if ((padapter->bSurpriseRemoved) || ( padapter->bDriverStopped) ||
|
|
|
|
(padapter->hw_init_completed == false) )
|
|
|
|
return;
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( ledpriv->bRegUseLed == false)
|
2014-12-19 06:59:46 +00:00
|
|
|
return;
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
if ( (adapter_to_pwrctl(padapter)->rf_pwrstate != rf_on &&
|
2014-12-19 06:59:46 +00:00
|
|
|
adapter_to_pwrctl(padapter)->rfoff_reason > RF_CHANGE_BY_PS) &&
|
|
|
|
(LedAction == LED_CTL_TX || LedAction == LED_CTL_RX ||
|
|
|
|
LedAction == LED_CTL_SITE_SURVEY ||
|
|
|
|
LedAction == LED_CTL_LINK ||
|
|
|
|
LedAction == LED_CTL_NO_LINK ||
|
|
|
|
LedAction == LED_CTL_POWER_ON) )
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:05:44 +00:00
|
|
|
switch (ledpriv->LedStrategy)
|
2014-12-19 06:59:46 +00:00
|
|
|
{
|
|
|
|
case SW_LED_MODE0:
|
2015-02-19 21:34:32 +00:00
|
|
|
/* SwLedControlMode0(padapter, LedAction); */
|
2014-12-19 06:59:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE1:
|
|
|
|
SwLedControlMode1(padapter, LedAction);
|
|
|
|
break;
|
|
|
|
case SW_LED_MODE2:
|
|
|
|
SwLedControlMode2(padapter, LedAction);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE3:
|
|
|
|
SwLedControlMode3(padapter, LedAction);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE4:
|
|
|
|
SwLedControlMode4(padapter, LedAction);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE5:
|
|
|
|
SwLedControlMode5(padapter, LedAction);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SW_LED_MODE6:
|
|
|
|
SwLedControlMode6(padapter, LedAction);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-08-15 18:19:16 +00:00
|
|
|
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("LedStrategy:%d, LedAction %d\n", ledpriv->LedStrategy, LedAction));
|
2014-12-19 06:59:46 +00:00
|
|
|
}
|