コード例 #1
0
ファイル: r8192S_led.c プロジェクト: ArthySundaram/firstrepo
void SwLedBlink7(	PLED_8190 pLed)
{
	struct net_device *dev = (struct net_device *)pLed->dev;

	SwLedOn(dev, pLed);
	RT_TRACE(COMP_LED, "Blinktimes (%d): turn on\n", pLed->BlinkTimes);	
}
コード例 #2
0
ファイル: r8192S_led.c プロジェクト: ArthySundaram/firstrepo
void SwLedControlMode4(struct net_device *dev, LED_CTL_MODE LedAction)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	PLED_8190 pLed0 = &(priv->SwLed0);
	PLED_8190 pLed1 = &(priv->SwLed1);
	
	switch(LedAction)
	{
	case LED_CTL_POWER_ON:
		pLed1->CurrLedState = LED_ON;
		SwLedOn(dev, pLed1);
		pLed0->CurrLedState = LED_OFF;
		SwLedOff(dev, pLed0);
		break;
		
	case LED_CTL_TX:
	case LED_CTL_RX:
		if( pLed0->bLedBlinkInProgress == false )
		{
			pLed0->bLedBlinkInProgress = true;

			pLed0->CurrLedState = LED_BLINK_RUNTOP;
			pLed0->BlinkTimes = 2;
		
			if( pLed0->bLedOn )
				pLed0->BlinkingLedState = LED_OFF; 
			else
				pLed0->BlinkingLedState = LED_ON; 
			
			mod_timer(&(pLed0->BlinkTimer), jiffies + MSECS(LED_RunTop_BLINK_INTERVAL));
		}
		break;

	case LED_CTL_POWER_OFF:
		pLed0->CurrLedState = LED_OFF;
		pLed1->CurrLedState = LED_OFF;
		if(pLed0->bLedBlinkInProgress)
		{
			del_timer_sync(&(pLed0->BlinkTimer));
			pLed0->bLedBlinkInProgress = false;
		}
		if(pLed1->bLedBlinkInProgress)
		{
			del_timer_sync(&(pLed1->BlinkTimer));
			pLed1->bLedBlinkInProgress = false;
		}
		SwLedOff(dev, pLed0);
		SwLedOff(dev, pLed1);
		break;

	default:
		break;
	}
	
	RT_TRACE(COMP_LED, "Led0 %d, Led1 %d \n", pLed0->CurrLedState, pLed1->CurrLedState);
}
コード例 #3
0
static void SwLedBlink5(struct LED_871x *pLed)
{
	struct _adapter *padapter = pLed->padapter;
	u8 bStopBlinking = false;

	
	if (pLed->BlinkingLedState == LED_ON)
		SwLedOn(padapter, pLed);
	else
		SwLedOff(padapter, pLed);
	switch (pLed->CurrLedState) {
	case LED_SCAN_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			pLed->CurrLedState = LED_ON;
			pLed->BlinkingLedState = LED_ON;
			if (!pLed->bLedOn)
				_set_timer(&(pLed->BlinkTimer),
					   LED_BLINK_FASTER_INTERVAL_ALPHA);
			pLed->bLedScanBlinkInProgress = false;
		} else {
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_SCAN_INTERVAL_ALPHA);
		}
		break;
	case LED_TXRX_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			pLed->CurrLedState = LED_ON;
			pLed->BlinkingLedState = LED_ON;
			if (!pLed->bLedOn)
				_set_timer(&(pLed->BlinkTimer),
					   LED_BLINK_FASTER_INTERVAL_ALPHA);
			pLed->bLedBlinkInProgress = false;
		} else {
			 if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_FASTER_INTERVAL_ALPHA);
		}
		break;
	default:
		break;
	}
}
コード例 #4
0
ファイル: r8192S_led.c プロジェクト: ArthySundaram/firstrepo
void SwLedControlMode0(struct net_device *dev,LED_CTL_MODE LedAction)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	PLED_8190 pLed0 = &(priv->SwLed0);
	PLED_8190 pLed1 = &(priv->SwLed1);

	switch(LedAction)
	{
	case LED_CTL_TX:
	case LED_CTL_RX:	
		break;

	case LED_CTL_LINK:
		pLed0->CurrLedState = LED_ON;
		SwLedOn(dev, pLed0);

		pLed1->CurrLedState = LED_BLINK_NORMAL;
		HwLedBlink(dev, pLed1);
		break;

	case LED_CTL_POWER_ON:
		pLed0->CurrLedState = LED_OFF;
		SwLedOff(dev, pLed0);

		pLed1->CurrLedState = LED_BLINK_NORMAL;
		HwLedBlink(dev, pLed1);

		break;

	case LED_CTL_POWER_OFF:
		pLed0->CurrLedState = LED_OFF;
		SwLedOff(dev, pLed0);

		pLed1->CurrLedState = LED_OFF;
		SwLedOff(dev, pLed1);
		break;

	case LED_CTL_SITE_SURVEY:
		break;

	case LED_CTL_NO_LINK:
		pLed0->CurrLedState = LED_OFF;
		SwLedOff(dev, pLed0);

		pLed1->CurrLedState = LED_BLINK_NORMAL;
		HwLedBlink(dev, pLed1);
		break;	

	default:
		break;
	}

	RT_TRACE(COMP_LED, "Led0 %d Led1 %d\n", pLed0->CurrLedState, pLed1->CurrLedState);
}
コード例 #5
0
ファイル: r8192S_led.c プロジェクト: ArthySundaram/firstrepo
void SwLedControlMode7(struct net_device *dev, LED_CTL_MODE LedAction)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	PLED_8190 pLed0 = &(priv->SwLed0);	

	switch(LedAction)
	{
		case LED_CTL_POWER_ON:
		case LED_CTL_LINK:
		case LED_CTL_NO_LINK:			
			SwLedOn(dev, pLed0);
			break;

		case LED_CTL_POWER_OFF:
				SwLedOff(dev, pLed0);
			break;

		default:
			break;
			
		}
}
コード例 #6
0
ファイル: r8192S_led.c プロジェクト: ArthySundaram/firstrepo
void SwLedControlMode5(struct net_device *dev, LED_CTL_MODE LedAction)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	PLED_8190 pLed0 = &(priv->SwLed0);
	PLED_8190 pLed1 = &(priv->SwLed1);
	switch(LedAction)
	{
	case LED_CTL_POWER_ON:
	case LED_CTL_START_TO_LINK:
	case LED_CTL_NO_LINK:
		pLed1->CurrLedState = LED_OFF;
		SwLedOff(dev, pLed1);


		if( pLed0->bLedSlowBlinkInProgress == false )
		{
			pLed0->bLedSlowBlinkInProgress = true;
			pLed0->CurrLedState = LED_BLINK_SLOWLY;
			if( pLed0->bLedOn )
				pLed0->BlinkingLedState = LED_OFF; 
			else
				pLed0->BlinkingLedState = LED_ON; 
			mod_timer(&(pLed0->BlinkTimer), jiffies + MSECS(LED_BLINK_SLOWLY_INTERVAL_NETTRONIX));
		}
		
		break;
	
	case LED_CTL_TX:
	case LED_CTL_RX:	
		pLed1->CurrLedState = LED_ON;
		SwLedOn(dev, pLed1);

		if( pLed0->bLedBlinkInProgress == false )
		{
			del_timer_sync(&(pLed0->BlinkTimer));
			pLed0->bLedSlowBlinkInProgress = false;
			pLed0->bLedBlinkInProgress = true;
			pLed0->CurrLedState = LED_BLINK_NORMAL;
			pLed0->BlinkTimes = 2;

			if( pLed0->bLedOn )
				pLed0->BlinkingLedState = LED_OFF; 
			else
				pLed0->BlinkingLedState = LED_ON; 
				mod_timer(&(pLed0->BlinkTimer), jiffies + MSECS(LED_BLINK_NORMAL_INTERVAL_NETTRONIX));
		}		
		break;

	case LED_CTL_LINK:
		pLed1->CurrLedState = LED_ON;
		SwLedOn(dev, pLed1);

		if( pLed0->bLedSlowBlinkInProgress == false )
		{
			pLed0->bLedSlowBlinkInProgress = true;
			pLed0->CurrLedState = LED_BLINK_SLOWLY;
			if( pLed0->bLedOn )
				pLed0->BlinkingLedState = LED_OFF; 
			else
				pLed0->BlinkingLedState = LED_ON; 
			mod_timer(&(pLed0->BlinkTimer), jiffies + MSECS(LED_BLINK_SLOWLY_INTERVAL_NETTRONIX));
		}
		break;


	case LED_CTL_POWER_OFF:
		pLed0->CurrLedState = LED_OFF;
		pLed1->CurrLedState = LED_OFF;
		if( pLed0->bLedSlowBlinkInProgress == true )
		{
			del_timer_sync(&(pLed0->BlinkTimer));
			pLed0->bLedSlowBlinkInProgress = false;
		}
		if(pLed0->bLedBlinkInProgress == true)
		{
			del_timer_sync(&(pLed0->BlinkTimer));
			pLed0->bLedBlinkInProgress = false;
		}
		SwLedOff(dev, pLed0);
		SwLedOff(dev, pLed1);
		break;

	default:
		break;
		}

	
}
コード例 #7
0
ファイル: r8192S_led.c プロジェクト: ArthySundaram/firstrepo
void SwLedControlMode1(struct net_device *dev, LED_CTL_MODE LedAction)
{
	struct r8192_priv *priv = rtllib_priv(dev);
	PLED_8190	pLed = &(priv->SwLed1);
	
	switch(LedAction)
	{
	case LED_CTL_TX:
	case LED_CTL_RX:
		if( pLed->bLedBlinkInProgress == false )
		{
			pLed->bLedBlinkInProgress = true;

			pLed->CurrLedState = LED_BLINK_NORMAL;
			pLed->BlinkTimes = 2;

			if( pLed->bLedOn )
				pLed->BlinkingLedState = LED_OFF; 
			else
				pLed->BlinkingLedState = LED_ON; 
			mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_BLINK_NORMAL_INTERVAL));
		}
		break;

	case LED_CTL_SITE_SURVEY:
		if( pLed->bLedBlinkInProgress == false )
		{
			pLed->bLedBlinkInProgress = true;

			if(priv->rtllib->state == RTLLIB_LINKED)
			{
				pLed->CurrLedState = LED_SCAN_BLINK;
				pLed->BlinkTimes = 4;
			}
			else
			{
				pLed->CurrLedState = LED_NO_LINK_BLINK;
				pLed->BlinkTimes = 24;
			}

			if( pLed->bLedOn )
			{
				pLed->BlinkingLedState = LED_OFF; 
				mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_CM2_BLINK_ON_INTERVAL));
			}
			else
			{
				pLed->BlinkingLedState = LED_ON; 
				mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_CM2_BLINK_OFF_INTERVAL));
			}
		}
		else
		{
			if(pLed->CurrLedState != LED_NO_LINK_BLINK)
			{
				if(priv->rtllib->state == RTLLIB_LINKED)
				{
					pLed->CurrLedState = LED_SCAN_BLINK;
				}
				else
				{
					pLed->CurrLedState = LED_NO_LINK_BLINK;
				}
			}
		}
		break;

	case LED_CTL_NO_LINK:
		if( pLed->bLedBlinkInProgress == false )
		{
			pLed->bLedBlinkInProgress = true;

			pLed->CurrLedState = LED_NO_LINK_BLINK;
			pLed->BlinkTimes = 24;

			if( pLed->bLedOn )
			{
				pLed->BlinkingLedState = LED_OFF; 
				mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_CM2_BLINK_ON_INTERVAL));
			}
			else
			{
				pLed->BlinkingLedState = LED_ON; 
				mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_CM2_BLINK_OFF_INTERVAL));
			}
		}
		else
		{
			pLed->CurrLedState = LED_NO_LINK_BLINK;
		}
		break;

	case LED_CTL_LINK:
		pLed->CurrLedState = LED_ON;
		if( pLed->bLedBlinkInProgress == false )
		{
			SwLedOn(dev, pLed);
		}
		break;

	case LED_CTL_POWER_OFF:
		pLed->CurrLedState = LED_OFF;
		if(pLed->bLedBlinkInProgress)
		{
			del_timer_sync(&(pLed->BlinkTimer));
			pLed->bLedBlinkInProgress = false;
		}
		SwLedOff(dev, pLed);
		break;

	default:
		break;
	}
	
	RT_TRACE(COMP_LED, "Led %d \n", pLed->CurrLedState);
}
コード例 #8
0
ファイル: r8192S_led.c プロジェクト: ArthySundaram/firstrepo
void SwLedBlink6(PLED_8190 pLed)
{
	struct net_device *dev = (struct net_device *)pLed->dev;
	struct r8192_priv *priv = rtllib_priv(dev);
	bool bStopBlinking = false;

	if( pLed->BlinkingLedState == LED_ON ) 
	{
		SwLedOn(dev, pLed);
		RT_TRACE(COMP_LED, "Blinktimes (%d): turn on\n", pLed->BlinkTimes);
	}	
	else 
	{
		SwLedOff(dev, pLed);
		RT_TRACE(COMP_LED, "Blinktimes (%d): turn off\n", pLed->BlinkTimes);
	}
	
	switch(pLed->CurrLedState)
	{
		case LED_OFF:
			SwLedOff(dev, pLed);
			break;

		case LED_BLINK_SLOWLY:
			if( pLed->bLedOn )
				pLed->BlinkingLedState = LED_OFF; 
			else
				pLed->BlinkingLedState = LED_ON; 
			mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_BLINK_SLOWLY_INTERVAL_PORNET));
			break;

		case LED_BLINK_NORMAL:
			pLed->BlinkTimes--;
			if( pLed->BlinkTimes == 0 )
			{
				bStopBlinking = true;
			}
			if(bStopBlinking)
			{
				if( priv->rtllib->eRFPowerState != eRfOn )
				{
					SwLedOff(dev, pLed);
				}
				else 
				{
					pLed->bLedSlowBlinkInProgress = true;
					pLed->CurrLedState = LED_BLINK_SLOWLY;
					if( pLed->bLedOn )
						pLed->BlinkingLedState = LED_OFF; 
					else
						pLed->BlinkingLedState = LED_ON; 
					mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_BLINK_SLOWLY_INTERVAL_PORNET));
				}
				pLed->BlinkTimes = 0;
				pLed->bLedBlinkInProgress = false;	
			}
			else
			{
				if( priv->rtllib->eRFPowerState != eRfOn )
				{
					SwLedOff(dev, pLed);
				}
				else
				{
					if( pLed->bLedOn )
						pLed->BlinkingLedState = LED_OFF; 
					else
						pLed->BlinkingLedState = LED_ON; 

					mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_BLINK_NORMAL_INTERVAL_PORNET));
				}
			}
			break;
			
		default:
			break;	
		}
	
}
コード例 #9
0
ファイル: r8192S_led.c プロジェクト: ArthySundaram/firstrepo
void SwLedBlink(PLED_8190 pLed)
{
	struct net_device *dev = (struct net_device *)pLed->dev;
	struct r8192_priv *priv = rtllib_priv(dev);
	bool bStopBlinking = false;
	
	if( pLed->BlinkingLedState == LED_ON ) 
	{
		SwLedOn(dev, pLed);
		RT_TRACE(COMP_LED, "Blinktimes (%d): turn on\n", pLed->BlinkTimes);
	}	
	else 
	{
		SwLedOff(dev, pLed);
		RT_TRACE(COMP_LED, "Blinktimes (%d): turn off\n", pLed->BlinkTimes);
	}

	pLed->BlinkTimes--;
	switch(pLed->CurrLedState)
	{
	case LED_BLINK_NORMAL: 
	case LED_BLINK_TXRX:
	case LED_BLINK_RUNTOP:
		if(pLed->BlinkTimes == 0)
		{
			bStopBlinking = true;
		}
		break;

	case LED_SCAN_BLINK:
		if( (priv->rtllib->state == RTLLIB_LINKED) &&  
			(!rtllib_act_scanning(priv->rtllib,true))&& 
			(pLed->BlinkTimes % 2 == 0)) 
		{
			bStopBlinking = true;
		}
		break;

	case LED_NO_LINK_BLINK:
	case LED_BLINK_StartToBlink:	
		if( (priv->rtllib->state == RTLLIB_LINKED) && (priv->rtllib->iw_mode == IW_MODE_INFRA)) 
		{
			bStopBlinking = true;
		}
		else if((priv->rtllib->state == RTLLIB_LINKED) && (priv->rtllib->iw_mode == IW_MODE_ADHOC))
		{
			bStopBlinking = true;
		}
		else if(pLed->BlinkTimes == 0)
		{
			bStopBlinking = true;
		}
		break;
		
	case LED_BLINK_CAMEO:
		if((priv->rtllib->state == RTLLIB_LINKED) && (priv->rtllib->iw_mode == IW_MODE_INFRA)) 
		{
			bStopBlinking = true;
		}
		else if((priv->rtllib->state == RTLLIB_LINKED) && (priv->rtllib->iw_mode == IW_MODE_ADHOC) )
		{
			bStopBlinking = true;
		}
		break;
		
	default:
		bStopBlinking = true;
		break;
	}

	if(bStopBlinking)
	{
		if( priv->rtllib->eRFPowerState != eRfOn )
		{
			SwLedOff(dev, pLed);
		}
		else if(pLed->CurrLedState == LED_BLINK_TXRX)
		{
			SwLedOff(dev, pLed);
		}
		else if(pLed->CurrLedState == LED_BLINK_RUNTOP)
		{
			SwLedOff(dev, pLed);
		}
		else if( (priv->rtllib->state == RTLLIB_LINKED) && (pLed->bLedOn == false))
		{
			SwLedOn(dev, pLed);
		}
		else if( (priv->rtllib->state != RTLLIB_LINKED) &&  pLed->bLedOn == true)
		{
			SwLedOff(dev, pLed);
		}

		pLed->BlinkTimes = 0;
		pLed->bLedBlinkInProgress = false;	
	}
	else
	{
		if( pLed->BlinkingLedState == LED_ON ) 
			pLed->BlinkingLedState = LED_OFF;
		else 
			pLed->BlinkingLedState = LED_ON;

		switch( pLed->CurrLedState )
		{
		case LED_BLINK_NORMAL:
		case LED_BLINK_TXRX:
		case LED_BLINK_StartToBlink:
			mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_BLINK_NORMAL_INTERVAL));
			break;

		case LED_BLINK_SLOWLY:
			mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_BLINK_SLOWLY_INTERVAL));
			break;

		case LED_SCAN_BLINK:
		case LED_NO_LINK_BLINK:
			if( pLed->bLedOn )
				mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_CM2_BLINK_ON_INTERVAL));
			else
				mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_CM2_BLINK_OFF_INTERVAL));
			break;
			
		case LED_BLINK_RUNTOP:
			mod_timer(&(pLed->BlinkTimer),jiffies + MSECS(LED_RunTop_BLINK_INTERVAL));
			break;
			
		case LED_BLINK_CAMEO:
			mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_BLINK_SLOWLY_INTERVAL_PORNET));
			break;
			
		default:
			RT_TRACE(COMP_ERR, "SwLedCm2Blink(): unexpected state!\n");
			mod_timer(&(pLed->BlinkTimer), jiffies + MSECS(LED_BLINK_SLOWLY_INTERVAL));
			break;
		}		
	}
}
コード例 #10
0
ファイル: rtw_led.c プロジェクト: 383530895/linux
static void SwLedBlink1(struct LED_871x *pLed)
{
	struct adapter *padapter = pLed->padapter;
	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
	u8 bStopBlinking = false;

	/*  Change LED according to BlinkingLedState specified. */
	if (pLed->BlinkingLedState == RTW_LED_ON) {
		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));
	}

	if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) {
		SwLedOff(padapter, pLed);
		ResetLedStatus(pLed);
		return;
	}

	switch (pLed->CurrLedState) {
	case LED_BLINK_SLOWLY:
		if (pLed->bLedOn)
			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:
		if (pLed->bLedOn)
			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--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_NORMAL;
				if (pLed->bLedOn)
					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));
			} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedNoLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_SLOWLY;
				if (pLed->bLedOn)
					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 {
			if (pLed->bLedOn)
				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--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_NORMAL;
				if (pLed->bLedOn)
					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));
			} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedNoLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_SLOWLY;
				if (pLed->bLedOn)
					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 {
			if (pLed->bLedOn)
				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:
		if (pLed->bLedOn)
			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 */
		if (pLed->BlinkingLedState == RTW_LED_ON)
			bStopBlinking = false;
		else
			bStopBlinking = true;

		if (bStopBlinking) {
			pLed->bLedLinkBlinkInProgress = true;
			pLed->CurrLedState = LED_BLINK_NORMAL;
			if (pLed->bLedOn)
				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_SUCCESS_INTERVAL_ALPHA);
		}
		break;
	default:
		break;
	}
}
コード例 #11
0
static void SwLedBlink4(struct LED_871x *pLed)
{
	struct _adapter *padapter = pLed->padapter;
	struct led_priv	*ledpriv = &(padapter->ledpriv);
	struct LED_871x *pLed1 = &(ledpriv->SwLed1);
	u8 bStopBlinking = false;

	
	if (pLed->BlinkingLedState == LED_ON)
		SwLedOn(padapter, pLed);
	else
		SwLedOff(padapter, pLed);
	if (!pLed1->bLedWPSBlinkInProgress &&
	    pLed1->BlinkingLedState == LED_UNKNOWN) {
		pLed1->BlinkingLedState = LED_OFF;
		pLed1->CurrLedState = LED_OFF;
		SwLedOff(padapter, pLed1);
	}
	switch (pLed->CurrLedState) {
	case LED_BLINK_SLOWLY:
		if (pLed->bLedOn)
			pLed->BlinkingLedState = LED_OFF;
		else
			pLed->BlinkingLedState = LED_ON;
		_set_timer(&(pLed->BlinkTimer),
			   LED_BLINK_NO_LINK_INTERVAL_ALPHA);
		break;
	case LED_BLINK_StartToBlink:
		if (pLed->bLedOn) {
			pLed->BlinkingLedState = LED_OFF;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_SLOWLY_INTERVAL);
		} else {
			pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_NORMAL_INTERVAL);
		}
		break;
	case LED_SCAN_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			pLed->bLedNoLinkBlinkInProgress = true;
			pLed->CurrLedState = LED_BLINK_SLOWLY;
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_NO_LINK_INTERVAL_ALPHA);
			pLed->bLedScanBlinkInProgress = false;
		} else {
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_SCAN_INTERVAL_ALPHA);
		}
		break;
	case LED_TXRX_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			pLed->bLedNoLinkBlinkInProgress = true;
			pLed->CurrLedState = LED_BLINK_SLOWLY;
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_NO_LINK_INTERVAL_ALPHA);
			pLed->bLedBlinkInProgress = false;
		} else {
			 if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_FASTER_INTERVAL_ALPHA);
		}
		break;
	case LED_BLINK_WPS:
		if (pLed->bLedOn) {
			pLed->BlinkingLedState = LED_OFF;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_SLOWLY_INTERVAL);
		} else {
			pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_NORMAL_INTERVAL);
		}
		break;
	case LED_BLINK_WPS_STOP:	
		if (pLed->bLedOn)
			pLed->BlinkingLedState = LED_OFF;
		else
			pLed->BlinkingLedState = LED_ON;
		_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
		break;
	case LED_BLINK_WPS_STOP_OVERLAP:	
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0) {
			if (pLed->bLedOn)
				pLed->BlinkTimes = 1;
			else
				bStopBlinking = true;
		}
		if (bStopBlinking) {
			pLed->BlinkTimes = 10;
			pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_LINK_INTERVAL_ALPHA);
		} else {
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_NORMAL_INTERVAL);
		}
		break;
	default:
		break;
	}
}
コード例 #12
0
static void SwLedBlink3(struct LED_871x *pLed)
{
	struct _adapter *padapter = pLed->padapter;
	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
	u8 bStopBlinking = false;

	
	if (pLed->BlinkingLedState == LED_ON)
		SwLedOn(padapter, pLed);
	else
		if (pLed->CurrLedState != LED_BLINK_WPS_STOP)
			SwLedOff(padapter, pLed);
	switch (pLed->CurrLedState) {
	case LED_SCAN_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
				pLed->CurrLedState = LED_ON;
				pLed->BlinkingLedState = LED_ON;
				if (!pLed->bLedOn)
					SwLedOn(padapter, pLed);
			} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->CurrLedState = LED_OFF;
				pLed->BlinkingLedState = LED_OFF;
				if (pLed->bLedOn)
					SwLedOff(padapter, pLed);
			}
			pLed->bLedScanBlinkInProgress = false;
		} else {
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_SCAN_INTERVAL_ALPHA);
		}
		break;
	case LED_TXRX_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
				pLed->CurrLedState = LED_ON;
				pLed->BlinkingLedState = LED_ON;
				if (!pLed->bLedOn)
					SwLedOn(padapter, pLed);
			} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->CurrLedState = LED_OFF;
				pLed->BlinkingLedState = LED_OFF;
				if (pLed->bLedOn)
					SwLedOff(padapter, pLed);
			}
			pLed->bLedBlinkInProgress = false;
		} else {
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_FASTER_INTERVAL_ALPHA);
		}
		break;
	case LED_BLINK_WPS:
		if (pLed->bLedOn)
			pLed->BlinkingLedState = LED_OFF;
		else
			pLed->BlinkingLedState = LED_ON;
		_set_timer(&(pLed->BlinkTimer),
			   LED_BLINK_SCAN_INTERVAL_ALPHA);
		break;
	case LED_BLINK_WPS_STOP:	
		if (pLed->BlinkingLedState == LED_ON) {
			pLed->BlinkingLedState = LED_OFF;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
			bStopBlinking = false;
		} else
			bStopBlinking = true;
		if (bStopBlinking) {
			pLed->CurrLedState = LED_ON;
			pLed->BlinkingLedState = LED_ON;
			SwLedOn(padapter, pLed);
			pLed->bLedWPSBlinkInProgress = false;
		}
		break;
	default:
		break;
	}
}
コード例 #13
0
static void SwLedBlink1(struct LED_871x *pLed)
{
	struct _adapter *padapter = pLed->padapter;
	struct led_priv *ledpriv = &(padapter->ledpriv);
	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
	struct eeprom_priv *peeprompriv = &(padapter->eeprompriv);
	struct LED_871x *pLed1 = &(ledpriv->SwLed1);
	u8 bStopBlinking = false;

	if (peeprompriv->CustomerID == RT_CID_819x_CAMEO)
		pLed = &(ledpriv->SwLed1);
	
	if (pLed->BlinkingLedState == LED_ON)
		SwLedOn(padapter, pLed);
	else
		SwLedOff(padapter, pLed);
	if (peeprompriv->CustomerID == RT_CID_DEFAULT) {
		if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (!pLed1->bSWLedCtrl) {
				SwLedOn(padapter, pLed1);
				pLed1->bSWLedCtrl = true;
			} else if (!pLed1->bLedOn)
				SwLedOn(padapter, pLed1);
		} else {
			if (!pLed1->bSWLedCtrl) {
				SwLedOff(padapter, pLed1);
				pLed1->bSWLedCtrl = true;
			} else if (pLed1->bLedOn)
				SwLedOff(padapter, pLed1);
		}
	}
	switch (pLed->CurrLedState) {
	case LED_BLINK_SLOWLY:
		if (pLed->bLedOn)
			pLed->BlinkingLedState = LED_OFF;
		else
			pLed->BlinkingLedState = LED_ON;
		_set_timer(&(pLed->BlinkTimer),
			   LED_BLINK_NO_LINK_INTERVAL_ALPHA);
		break;
	case LED_BLINK_NORMAL:
		if (pLed->bLedOn)
			pLed->BlinkingLedState = LED_OFF;
		else
			pLed->BlinkingLedState = LED_ON;
		_set_timer(&(pLed->BlinkTimer),
			   LED_BLINK_LINK_INTERVAL_ALPHA);
		break;
	case LED_SCAN_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
				pLed->bLedLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_NORMAL;
				if (pLed->bLedOn)
					pLed->BlinkingLedState = LED_OFF;
				else
					pLed->BlinkingLedState = LED_ON;
				_set_timer(&(pLed->BlinkTimer),
					   LED_BLINK_LINK_INTERVAL_ALPHA);
			} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedNoLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_SLOWLY;
				if (pLed->bLedOn)
					pLed->BlinkingLedState = LED_OFF;
				else
					pLed->BlinkingLedState = LED_ON;
				_set_timer(&(pLed->BlinkTimer),
					   LED_BLINK_NO_LINK_INTERVAL_ALPHA);
			}
			pLed->bLedScanBlinkInProgress = false;
		} else {
			 if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_SCAN_INTERVAL_ALPHA);
		}
		break;
	case LED_TXRX_BLINK:
		pLed->BlinkTimes--;
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
				pLed->bLedLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_NORMAL;
				if (pLed->bLedOn)
					pLed->BlinkingLedState = LED_OFF;
				else
					pLed->BlinkingLedState = LED_ON;
				_set_timer(&(pLed->BlinkTimer),
					   LED_BLINK_LINK_INTERVAL_ALPHA);
			} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedNoLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_SLOWLY;
				if (pLed->bLedOn)
					pLed->BlinkingLedState = LED_OFF;
				else
					pLed->BlinkingLedState = LED_ON;
				_set_timer(&(pLed->BlinkTimer),
					   LED_BLINK_NO_LINK_INTERVAL_ALPHA);
			}
			pLed->BlinkTimes = 0;
			pLed->bLedBlinkInProgress = false;
		} else {
			 if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_FASTER_INTERVAL_ALPHA);
		}
		break;
	case LED_BLINK_WPS:
		if (pLed->bLedOn)
			pLed->BlinkingLedState = LED_OFF;
		else
			pLed->BlinkingLedState = LED_ON;
		_set_timer(&(pLed->BlinkTimer),
			   LED_BLINK_SCAN_INTERVAL_ALPHA);
		break;
	case LED_BLINK_WPS_STOP:	
		if (pLed->BlinkingLedState == LED_ON) {
			pLed->BlinkingLedState = LED_OFF;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
			bStopBlinking = false;
		} else
			bStopBlinking = true;
		if (bStopBlinking) {
			pLed->bLedLinkBlinkInProgress = true;
			pLed->CurrLedState = LED_BLINK_NORMAL;
			if (pLed->bLedOn)
				pLed->BlinkingLedState = LED_OFF;
			else
				pLed->BlinkingLedState = LED_ON;
			_set_timer(&(pLed->BlinkTimer),
				   LED_BLINK_LINK_INTERVAL_ALPHA);
		}
		pLed->bLedWPSBlinkInProgress = false;
		break;
	default:
		break;
	}
}
コード例 #14
0
static void SwLedBlink(struct LED_871x *pLed)
{
	struct _adapter *padapter = pLed->padapter;
	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
	u8 bStopBlinking = false;

	
	if (pLed->BlinkingLedState == LED_ON)
		SwLedOn(padapter, pLed);
	else
		SwLedOff(padapter, pLed);
	
	pLed->BlinkTimes--;
	switch (pLed->CurrLedState) {
	case LED_BLINK_NORMAL:
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		break;
	case LED_BLINK_StartToBlink:
		if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
		    (pmlmepriv->fw_state & WIFI_STATION_STATE))
			bStopBlinking = true;
		if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
		   ((pmlmepriv->fw_state & WIFI_ADHOC_STATE) ||
		    (pmlmepriv->fw_state & WIFI_ADHOC_MASTER_STATE)))
			bStopBlinking = true;
		else if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		break;
	case LED_BLINK_WPS:
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		break;
	default:
		bStopBlinking = true;
		break;
	}
	if (bStopBlinking) {
		if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
		    (pLed->bLedOn == false))
			SwLedOn(padapter, pLed);
		else if ((check_fwstate(pmlmepriv, _FW_LINKED) ==
			 true) &&  pLed->bLedOn == true)
			SwLedOff(padapter, pLed);
		pLed->BlinkTimes = 0;
		pLed->bLedBlinkInProgress = false;
	} else {
		
		if (pLed->BlinkingLedState == LED_ON)
			pLed->BlinkingLedState = LED_OFF;
		else
			pLed->BlinkingLedState = LED_ON;

		
		switch (pLed->CurrLedState) {
		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:
			if (pLed->BlinkingLedState == LED_ON)
				_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;
		}
	}
}