2013-05-08 21:45:39 +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>
|
|
|
|
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
// Callback function of LED BlinkTimer,
|
|
|
|
// it just schedules to corresponding BlinkWorkItem/led_blink_hdl
|
|
|
|
//
|
|
|
|
void BlinkTimerCallback(void *data)
|
|
|
|
{
|
|
|
|
PLED_871x pLed = (PLED_871x)data;
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
|
2013-05-09 16:23:32 +00:00
|
|
|
//DBG_871X("%s\n", __func__);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 16:23:32 +00:00
|
|
|
//DBG_871X("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __func__, padapter->bSurpriseRemoved, padapter->bDriverStopped);
|
2013-05-08 21:45:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
|
|
|
|
#ifdef CONFIG_LED_HANDLED_BY_CMD_THREAD
|
|
|
|
rtw_led_blink_cmd(padapter, pLed);
|
|
|
|
#else
|
|
|
|
_set_workitem(&(pLed->BlinkWorkItem));
|
|
|
|
#endif
|
|
|
|
#elif defined(CONFIG_PCI_HCI)
|
|
|
|
BlinkHandler(pLed);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
// Callback function of LED BlinkWorkItem.
|
|
|
|
// We dispatch acture LED blink action according to LedStrategy.
|
|
|
|
//
|
|
|
|
void BlinkWorkItemCallback(struct work_struct *work)
|
|
|
|
{
|
|
|
|
PLED_871x pLed = container_of(work, LED_871x, BlinkWorkItem);
|
|
|
|
BlinkHandler(pLed);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
// Reset status of LED_871x object.
|
|
|
|
//
|
|
|
|
void ResetLedStatus(PLED_871x pLed) {
|
|
|
|
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF; // Current LED state.
|
|
|
|
pLed->bLedOn = _FALSE; // true if LED is ON, false if LED is OFF.
|
|
|
|
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE; // true if it is blinking, false o.w..
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
pLed->bLedLinkBlinkInProgress = _FALSE;
|
|
|
|
pLed->bLedStartToLinkBlinkInProgress = _FALSE;
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
// Initialize an LED_871x object.
|
|
|
|
//
|
|
|
|
void
|
|
|
|
InitLed871x(
|
|
|
|
_adapter *padapter,
|
|
|
|
PLED_871x pLed,
|
|
|
|
LED_PIN_871x LedPin
|
|
|
|
)
|
|
|
|
{
|
|
|
|
pLed->padapter = padapter;
|
|
|
|
pLed->LedPin = LedPin;
|
|
|
|
|
|
|
|
ResetLedStatus(pLed);
|
|
|
|
|
|
|
|
_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
|
|
|
|
|
|
|
|
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
|
|
|
|
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
// DeInitialize an LED_871x object.
|
|
|
|
//
|
|
|
|
void
|
|
|
|
DeInitLed871x(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
|
|
|
_cancel_workitem_sync(&(pLed->BlinkWorkItem));
|
|
|
|
#endif
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
ResetLedStatus(pLed);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
// Implementation of LED blinking behavior.
|
|
|
|
// It toggle off LED and schedule corresponding timer if necessary.
|
|
|
|
//
|
|
|
|
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
|
|
|
|
|
|
|
void SwLedOn(_adapter *padapter, PLED_871x pLed);
|
|
|
|
void SwLedOff(_adapter *padapter, PLED_871x pLed);
|
|
|
|
|
|
|
|
#define CONFIG_LED_REMOVE_HAL
|
|
|
|
|
|
|
|
void
|
|
|
|
SwLedBlink(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
u8 bStopBlinking = _FALSE;
|
|
|
|
|
|
|
|
// Change LED according to BlinkingLedState specified.
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,( "Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Determine if we shall change LED state again.
|
|
|
|
pLed->BlinkTimes--;
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
case LED_BLINK_NORMAL:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->BlinkTimes == 0)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_StartToBlink:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( check_fwstate(pmlmepriv, _FW_LINKED) && check_fwstate(pmlmepriv, WIFI_STATION_STATE) )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( check_fwstate(pmlmepriv, _FW_LINKED) &&
|
2013-05-08 21:45:39 +00:00
|
|
|
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) )
|
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (pLed->BlinkTimes == 0)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_WPS:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
//if ( padapter->pwrctrlpriv.cpwm >= PS_STATE_S2)
|
|
|
|
if (0)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if ( (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) && (pLed->bLedOn == _FALSE))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if ( (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) && pLed->bLedOn == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->BlinkTimes = 0;
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Assign LED state to toggle.
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
|
|
|
// Schedule a timer to toggle LED state.
|
2013-05-09 04:04:25 +00:00
|
|
|
switch ( pLed->CurrLedState )
|
2013-05-08 21:45:39 +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:
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2013-05-08 21:45:39 +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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SwLedBlink1(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
#ifndef CONFIG_LED_REMOVE_HAL
|
|
|
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
|
|
|
#endif
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
PLED_871x pLed1 = &(ledpriv->SwLed1);
|
|
|
|
u8 bStopBlinking = _FALSE;
|
|
|
|
|
|
|
|
#ifndef CONFIG_LED_REMOVE_HAL
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pHalData->EEPROMCustomerID == RT_CID_819x_CAMEO)
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed = &(ledpriv->SwLed1);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Change LED according to BlinkingLedState specified.
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,( "Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef CONFIG_LED_REMOVE_HAL
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pHalData->EEPROMCustomerID == RT_CID_DEFAULT)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (!pLed1->bSWLedCtrl)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed1);
|
|
|
|
pLed1->bSWLedCtrl = _TRUE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (!pLed1->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOn(padapter, pLed1);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (): turn on pLed1\n"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (!pLed1->bSWLedCtrl)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed1);
|
|
|
|
pLed1->bSWLedCtrl = _TRUE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (pLed1->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOff(padapter, pLed1);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (): turn off pLed1\n"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
ResetLedStatus(pLed);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SLOWLY:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->bLedLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->bLedLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
pLed->BlinkTimes = 0;
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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_WPS_STOP: //WPS success
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->BlinkingLedState == RTW_LED_ON)
|
2013-05-08 21:45:39 +00:00
|
|
|
bStopBlinking = _FALSE;
|
|
|
|
else
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->bLedLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SwLedBlink2(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
u8 bStopBlinking = _FALSE;
|
|
|
|
|
|
|
|
// Change LED according to BlinkingLedState specified.
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SCAN:
|
|
|
|
pLed->BlinkTimes--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("stop scan blink CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("stop scan blink CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("stop CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("stop CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SwLedBlink3(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
u8 bStopBlinking = _FALSE;
|
|
|
|
|
|
|
|
// Change LED according to BlinkingLedState specified.
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState != LED_BLINK_WPS_STOP)
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SCAN:
|
|
|
|
pLed->BlinkTimes--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( !pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( !pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (check_fwstate(pmlmepriv, _FW_LINKED)== _FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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_WPS_STOP: //WPS success
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->BlinkingLedState == RTW_LED_ON)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
|
|
|
|
bStopBlinking = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
SwLedBlink4(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
PLED_871x pLed1 = &(ledpriv->SwLed1);
|
|
|
|
u8 bStopBlinking = _FALSE;
|
|
|
|
|
|
|
|
// Change LED according to BlinkingLedState specified.
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (!pLed1->bLedWPSBlinkInProgress && pLed1->BlinkingLedState == LED_UNKNOWN)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
pLed1->CurrLedState = RTW_LED_OFF;
|
|
|
|
SwLedOff(padapter, pLed1);
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SLOWLY:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _FALSE;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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_WPS_STOP: //WPS authentication fail
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_BLINK_WPS_STOP_OVERLAP: //WPS session overlap
|
|
|
|
pLed->BlinkTimes--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->BlinkTimes == 0)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkTimes = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->BlinkTimes = 10;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LINK_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedBlink4 CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SwLedBlink5(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
u8 bStopBlinking = _FALSE;
|
|
|
|
|
|
|
|
// Change LED according to BlinkingLedState specified.
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (pLed->CurrLedState)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_BLINK_SCAN:
|
|
|
|
pLed->BlinkTimes--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (!pLed->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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--;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkTimes == 0 )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
bStopBlinking = _TRUE;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (bStopBlinking)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (!pLed->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_FASTER_INTERVAL_ALPHA);
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedBlink5 CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SwLedBlink6(
|
|
|
|
PLED_871x pLed
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
u8 bStopBlinking = _FALSE;
|
|
|
|
|
|
|
|
// Change LED according to BlinkingLedState specified.
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->BlinkingLedState == RTW_LED_ON )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn on\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Blinktimes (%d): turn off\n", pLed->BlinkTimes));
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("<==== blink6\n"));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
SwLedControlMode0(
|
|
|
|
_adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed1);
|
|
|
|
|
|
|
|
// Decide led state
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (LedAction)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_TX:
|
|
|
|
case LED_CTL_RX:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == _FALSE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->bLedBlinkInProgress = _TRUE;
|
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
|
|
|
pLed->BlinkTimes = 2;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == _FALSE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->bLedBlinkInProgress = _TRUE;
|
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_StartToBlink;
|
|
|
|
pLed->BlinkTimes = 24;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == _FALSE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOn(padapter, pLed);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_NO_LINK:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == _FALSE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_POWER_OFF:
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_START_WPS:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress == _FALSE || pLed->CurrLedState == RTW_LED_ON)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->bLedBlinkInProgress = _TRUE;
|
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS;
|
|
|
|
pLed->BlinkTimes = 20;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//ALPHA, added by chiyoko, 20090106
|
|
|
|
static void
|
|
|
|
SwLedControlMode1(
|
|
|
|
_adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_LED_REMOVE_HAL
|
|
|
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
|
|
|
#endif
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
|
|
|
|
|
|
|
#ifndef CONFIG_LED_REMOVE_HAL
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pHalData->EEPROMCustomerID == RT_CID_819x_CAMEO)
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed = &(ledpriv->SwLed1);
|
|
|
|
#endif
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (LedAction)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_POWER_ON:
|
|
|
|
case LED_CTL_START_TO_LINK:
|
|
|
|
case LED_CTL_NO_LINK:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedNoLinkBlinkInProgress == _FALSE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == _TRUE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == _FALSE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_NORMAL;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE))
|
2013-05-08 21:45:39 +00:00
|
|
|
;
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
return;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == _TRUE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == _TRUE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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_START_WPS: //wait until xinpin finish
|
|
|
|
case LED_CTL_START_WPS_BOTTON:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == _TRUE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedWPSBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress == _TRUE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->bLedWPSBlinkInProgress = _TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS_STOP;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedOn)
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedNoLinkBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedWPSBlinkInProgress )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
|
|
|
|
//Arcadyan/Sitecom , added by chiyoko, 20090216
|
|
|
|
static void
|
|
|
|
SwLedControlMode2(
|
|
|
|
_adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (LedAction)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_SITE_SURVEY:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
|
2013-05-08 21:45:39 +00:00
|
|
|
;
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
return;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ((pLed->bLedBlinkInProgress ==_FALSE) && (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_START_WPS: //wait until xinpin finish
|
|
|
|
case LED_CTL_START_WPS_BOTTON:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedWPSBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS:
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_STOP_WPS_FAIL:
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->CurrLedState = RTW_LED_OFF;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_START_TO_LINK:
|
|
|
|
case LED_CTL_NO_LINK:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (!IS_LED_BLINKING(pLed))
|
2013-05-08 21:45:39 +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;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedWPSBlinkInProgress )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
|
|
|
|
//COREGA, added by chiyoko, 20090316
|
|
|
|
static void
|
|
|
|
SwLedControlMode3(
|
|
|
|
_adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (LedAction)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_SITE_SURVEY:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
|
2013-05-08 21:45:39 +00:00
|
|
|
;
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
return;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ((pLed->bLedBlinkInProgress ==_FALSE) && (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_START_WPS: //wait until xinpin finish
|
|
|
|
case LED_CTL_START_WPS_BOTTON:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedWPSBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLed->bLedWPSBlinkInProgress = _TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS_STOP;
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedOn)
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (!IS_LED_BLINKING(pLed))
|
2013-05-08 21:45:39 +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;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedWPSBlinkInProgress )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("CurrLedState %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Edimax-Belkin, added by chiyoko, 20090413
|
|
|
|
static void
|
|
|
|
SwLedControlMode4(
|
|
|
|
_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);
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (LedAction)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_START_TO_LINK:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed1->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
pLed1->CurrLedState = RTW_LED_OFF;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed1->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedStartToLinkBlinkInProgress == _FALSE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedStartToLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_StartToBlink;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
|
|
|
//LED1 settings
|
2013-05-09 04:04:25 +00:00
|
|
|
if (LedAction == LED_CTL_LINK)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed1->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
pLed1->CurrLedState = RTW_LED_OFF;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed1->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedNoLinkBlinkInProgress == _FALSE )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE))
|
2013-05-08 21:45:39 +00:00
|
|
|
;
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
return;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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_START_WPS: //wait until xinpin finish
|
|
|
|
case LED_CTL_START_WPS_BOTTON:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
pLed1->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
|
|
|
|
pLed1->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
pLed1->CurrLedState = RTW_LED_OFF;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed1->bLedOn)
|
2013-05-08 21:45:39 +00:00
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedNoLinkBlinkInProgress == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedScanBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedWPSBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_WPS;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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_STOP_WPS: //WPS connect success
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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_STOP_WPS_FAIL: //WPS authentication fail
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
|
|
|
|
//LED1 settings
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
else
|
|
|
|
pLed1->bLedWPSBlinkInProgress = _TRUE;
|
|
|
|
|
|
|
|
pLed1->CurrLedState = LED_BLINK_WPS_STOP;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed1->bLedOn )
|
2013-05-08 21:45:39 +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_STOP_WPS_FAIL_OVERLAP: //WPS session overlap
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed->BlinkingLedState = RTW_LED_OFF;
|
|
|
|
else
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
|
|
|
|
|
|
|
//LED1 settings
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed1->bLedWPSBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
else
|
|
|
|
pLed1->bLedWPSBlinkInProgress = _TRUE;
|
|
|
|
|
|
|
|
pLed1->CurrLedState = LED_BLINK_WPS_STOP_OVERLAP;
|
|
|
|
pLed1->BlinkTimes = 10;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed1->bLedOn )
|
2013-05-08 21:45:39 +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;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedNoLinkBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedNoLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedLinkBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedWPSBlinkInProgress )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedScanBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedScanBlinkInProgress = _FALSE;
|
|
|
|
}
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedStartToLinkBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedStartToLinkBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed1->bLedWPSBlinkInProgress )
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed1->BlinkTimer));
|
|
|
|
pLed1->bLedWPSBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pLed1->BlinkingLedState = LED_UNKNOWN;
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
SwLedOff(padapter, pLed1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Sercomm-Belkin, added by chiyoko, 20090415
|
|
|
|
static void
|
|
|
|
SwLedControlMode5(
|
|
|
|
_adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_LED_REMOVE_HAL
|
|
|
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
|
|
|
#endif
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed = &(ledpriv->SwLed0);
|
|
|
|
|
|
|
|
#ifndef CONFIG_LED_REMOVE_HAL
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pHalData->EEPROMCustomerID == RT_CID_819x_CAMEO)
|
2013-05-08 21:45:39 +00:00
|
|
|
pLed = &(ledpriv->SwLed1);
|
|
|
|
#endif
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (LedAction)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case LED_CTL_POWER_ON:
|
|
|
|
case LED_CTL_NO_LINK:
|
|
|
|
case LED_CTL_LINK: //solid blue
|
|
|
|
pLed->CurrLedState = RTW_LED_ON;
|
|
|
|
pLed->BlinkingLedState = RTW_LED_ON;
|
|
|
|
|
|
|
|
_set_timer(&(pLed->BlinkTimer), 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LED_CTL_SITE_SURVEY:
|
2013-05-09 04:04:25 +00:00
|
|
|
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE))
|
2013-05-08 21:45:39 +00:00
|
|
|
;
|
2013-05-09 04:04:25 +00:00
|
|
|
else if (pLed->bLedScanBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
pLed->bLedScanBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_SCAN;
|
|
|
|
pLed->BlinkTimes = 24;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->bLedBlinkInProgress ==_FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 04:04:25 +00:00
|
|
|
if (pLed->CurrLedState == LED_BLINK_SCAN)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
pLed->bLedBlinkInProgress = _TRUE;
|
|
|
|
pLed->CurrLedState = LED_BLINK_TXRX;
|
|
|
|
pLed->BlinkTimes = 2;
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedOn )
|
2013-05-08 21:45:39 +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;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( pLed->bLedBlinkInProgress)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
_cancel_timer_ex(&(pLed->BlinkTimer));
|
|
|
|
pLed->bLedBlinkInProgress = _FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
SwLedOff(padapter, pLed);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("Led %d\n", pLed->CurrLedState));
|
|
|
|
}
|
|
|
|
|
|
|
|
//WNC-Corega, added by chiyoko, 20090902
|
|
|
|
static void
|
|
|
|
SwLedControlMode6(
|
|
|
|
_adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
PLED_871x pLed0 = &(ledpriv->SwLed0);
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (LedAction)
|
2013-05-08 21:45:39 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("ledcontrol 6 Led %d\n", pLed0->CurrLedState));
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
// Handler function of LED Blinking.
|
|
|
|
// We dispatch acture LED blink action according to LedStrategy.
|
|
|
|
//
|
|
|
|
void BlinkHandler(PLED_871x pLed)
|
|
|
|
{
|
|
|
|
_adapter *padapter = pLed->padapter;
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
|
2013-05-09 16:23:32 +00:00
|
|
|
//DBG_871X("%s (%s:%d)\n",__func__, current->comm, current->pid);
|
2013-05-08 21:45:39 +00:00
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
2013-05-09 16:23:32 +00:00
|
|
|
//DBG_871X("%s bSurpriseRemoved:%d, bDriverStopped:%d\n", __func__, padapter->bSurpriseRemoved, padapter->bDriverStopped);
|
2013-05-08 21:45:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (ledpriv->LedStrategy)
|
2013-05-08 21:45:39 +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:
|
2013-05-09 04:09:18 +00:00
|
|
|
//RT_TRACE(COMP_LED, DBG_LOUD, ("BlinkWorkItemCallback 0x%x\n", pHalData->LedStrategy));
|
2013-05-08 21:45:39 +00:00
|
|
|
//SwLedBlink(pLed);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
LedControl871x(
|
|
|
|
_adapter *padapter,
|
|
|
|
LED_CTL_MODE LedAction
|
|
|
|
)
|
|
|
|
{
|
|
|
|
struct led_priv *ledpriv = &(padapter->ledpriv);
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE)
|
2013-05-08 21:45:39 +00:00
|
|
|
||(padapter->hw_init_completed == _FALSE) )
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( ledpriv->bRegUseLed == _FALSE)
|
2013-05-08 21:45:39 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
//if (!priv->up)
|
|
|
|
// return;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
//if (priv->bInHctTest)
|
2013-05-08 21:45:39 +00:00
|
|
|
// return;
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
if ( (padapter->pwrctrlpriv.rf_pwrstate != rf_on &&
|
2013-05-08 21:45:39 +00:00
|
|
|
padapter->pwrctrlpriv.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;
|
|
|
|
}
|
|
|
|
|
2013-05-09 04:04:25 +00:00
|
|
|
switch (ledpriv->LedStrategy)
|
2013-05-08 21:45:39 +00:00
|
|
|
{
|
|
|
|
case SW_LED_MODE0:
|
|
|
|
//SwLedControlMode0(padapter, LedAction);
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("LedStrategy:%d, LedAction %d\n", ledpriv->LedStrategy,LedAction));
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|