Example #1
0
void rtw_ps_processor23a(struct rtw_adapter *padapter)
{
	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

	pwrpriv->ps_processing = true;

	if (pwrpriv->bips_processing == true)
		goto exit;

	if (pwrpriv->ips_mode_req == IPS_NONE)
		goto exit;

	if (rtw_pwr_unassociated_idle(padapter) == false)
		goto exit;

	if (pwrpriv->rf_pwrstate == rf_on &&
	    (pwrpriv->pwr_state_check_cnts % 4) == 0) {
		DBG_8723A("==>%s .fw_state(%x)\n", __func__,
			  get_fwstate(pmlmepriv));
		pwrpriv->change_rfpwrstate = rf_off;
		ips_enter23a(padapter);
	}
exit:
	rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
	pwrpriv->ps_processing = false;
	return;
}
Example #2
0
void rtw_ps_processor(struct rtw_adapter *padapter)
{
	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);

	pwrpriv->ps_processing = true;

	if (pwrpriv->ips_mode_req == IPS_NONE
#ifdef CONFIG_CONCURRENT_MODE
	    || padapter->pbuddy_adapter->pwrctrlpriv.ips_mode_req == IPS_NONE
#endif
	    )
		goto exit;

	if (rtw_pwr_unassociated_idle(padapter) == false)
		goto exit;

	if ((pwrpriv->rf_pwrstate == rf_on) &&
	    ((pwrpriv->pwr_state_check_cnts % 4) == 0)) {
		DBG_8192D("==>%s .fw_state(%x)\n", __func__,
			  get_fwstate(pmlmepriv));
		pwrpriv->change_rfpwrstate = rf_off;

#ifdef CONFIG_AUTOSUSPEND
		if (padapter->registrypriv.usbss_enable) {
			if (pwrpriv->bHWPwrPindetect)
				pwrpriv->bkeepfwalive = true;

			if (padapter->net_closed == true)
				pwrpriv->ps_flag = true;

			padapter->bCardDisableWOHSM = true;
			autosuspend_enter(padapter);
		} else
#endif /* CONFIG_AUTOSUSPEND */
		{
#ifdef CONFIG_IPS
			ips_enter(padapter);
#endif
		}
	}
exit:
	rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
	pwrpriv->ps_processing = false;
	return;
}
Example #3
0
void rtw_ps_processor(struct adapter *padapter)
{
	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
	enum rt_rf_power_state rfpwrstate;

	pwrpriv->ps_processing = true;

	if (pwrpriv->bips_processing)
		goto exit;

	if (padapter->pwrctrlpriv.bHWPwrPindetect) {
		rfpwrstate = RfOnOffDetect(padapter);
		DBG_88E("@@@@- #2  %s==> rfstate:%s\n", __func__, (rfpwrstate == rf_on) ? "rf_on" : "rf_off");

		if (rfpwrstate != pwrpriv->rf_pwrstate) {
			if (rfpwrstate == rf_off) {
				pwrpriv->change_rfpwrstate = rf_off;
				pwrpriv->brfoffbyhw = true;
				rtw_hw_suspend(padapter);
			} else {
				pwrpriv->change_rfpwrstate = rf_on;
				rtw_hw_resume(padapter);
			}
			DBG_88E("current rf_pwrstate(%s)\n", (pwrpriv->rf_pwrstate == rf_off) ? "rf_off" : "rf_on");
		}
		pwrpriv->pwr_state_check_cnts++;
	}

	if (pwrpriv->ips_mode_req == IPS_NONE)
		goto exit;

	if (!rtw_pwr_unassociated_idle(padapter))
		goto exit;

	if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4) == 0)) {
		DBG_88E("==>%s .fw_state(%x)\n", __func__, get_fwstate(pmlmepriv));
		pwrpriv->change_rfpwrstate = rf_off;

		ips_enter(padapter);
	}
exit:
	rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
	pwrpriv->ps_processing = false;
}
Example #4
0
/*
 * ATTENTION:
 *	rtw_ps_processor() doesn't handle LPS.
 */
void rtw_ps_processor(_adapter*padapter)
{
	struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
	struct dvobj_priv *psdpriv = padapter->dvobj;
	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
	u32 ps_deny = 0;

	down(&adapter_to_pwrctl(padapter)->lock);
	ps_deny = rtw_ps_deny_get(padapter);
	up(&adapter_to_pwrctl(padapter)->lock);
	if (ps_deny != 0)
	{
		DBG_871X(FUNC_ADPT_FMT ": ps_deny =0x%08X, skip power save!\n",
			FUNC_ADPT_ARG(padapter), ps_deny);
		goto exit;
	}

	if (pwrpriv->bInSuspend == true){/* system suspend or autosuspend */
		pdbgpriv->dbg_ps_insuspend_cnt++;
		DBG_871X("%s, pwrpriv->bInSuspend == true ignore this process\n", __FUNCTION__);
		return;
	}

	pwrpriv->ps_processing = true;

	if (pwrpriv->ips_mode_req == IPS_NONE)
		goto exit;

	if (rtw_pwr_unassociated_idle(padapter) == false)
		goto exit;

	if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4) ==0))
	{
		DBG_871X("==>%s\n", __FUNCTION__);
		pwrpriv->change_rfpwrstate = rf_off;
		{
			ips_enter(padapter);
		}
	}
exit:
	pwrpriv->ps_processing = false;
	return;
}
Example #5
0
void rtw_ps_processor(struct rtl_priv *rtlpriv)
{
	struct pwrctrl_priv *pwrpriv = &rtlpriv->pwrctrlpriv;
	struct mlme_priv *pmlmepriv = &(rtlpriv->mlmepriv);

	pwrpriv->ps_processing = _TRUE;

	if (pwrpriv->ips_mode_req == IPS_NONE
	)
		goto exit;

	if (rtw_pwr_unassociated_idle(rtlpriv) == _FALSE)
		goto exit;

	if ((pwrpriv->rf_pwrstate == rf_on)
	   && ((pwrpriv->pwr_state_check_cnts%4)==0)) {
		DBG_871X("==>%s .fw_state(%x)\n",__FUNCTION__,get_fwstate(pmlmepriv));
		pwrpriv->change_rfpwrstate = rf_off;
#ifdef CONFIG_AUTOSUSPEND
		if (rtlpriv->registrypriv.usbss_enable) {
			if(pwrpriv->bHWPwrPindetect)
				pwrpriv->bkeepfwalive = _TRUE;

			if(rtlpriv->net_closed == _TRUE)
				pwrpriv->ps_flag = _TRUE;

			rtlpriv->bCardDisableWOHSM = _TRUE;
			autosuspend_enter(rtlpriv);
		} else if(pwrpriv->bHWPwrPindetect) {
		}
		else
#endif
		{

			rtw_ips_enter(rtlpriv);
		}
	}
exit:
	rtw_set_pwr_state_check_timer(&rtlpriv->pwrctrlpriv);
	pwrpriv->ps_processing = _FALSE;
	return;
}
Example #6
0
void rtw_ps_processor(struct rtl_priv *rtlpriv)
{
	struct pwrctrl_priv *pwrpriv = &rtlpriv->pwrctrlpriv;
	struct mlme_priv *pmlmepriv = &(rtlpriv->mlmepriv);

	pwrpriv->ps_processing = true;

	if (pwrpriv->ips_mode_req == IPS_NONE
	)
		goto exit;

	if (rtw_pwr_unassociated_idle(rtlpriv) == false)
		goto exit;

	if ((pwrpriv->rf_pwrstate == ERFON)
	   && ((pwrpriv->pwr_state_check_cnts%4)==0)) {
		RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, "==>%s .fw_state(%x)\n",__FUNCTION__,get_fwstate(pmlmepriv));
		pwrpriv->change_rfpwrstate = ERFOFF;
#ifdef CONFIG_AUTOSUSPEND
		if (rtlpriv->registrypriv.usbss_enable) {
			if(pwrpriv->bHWPwrPindetect)
				pwrpriv->bkeepfwalive = true;

			if(rtlpriv->net_closed == true)
				pwrpriv->ps_flag = true;

			rtlpriv->bCardDisableWOHSM = true;
			autosuspend_enter(rtlpriv);
		} else if(pwrpriv->bHWPwrPindetect) {
		}
		else
#endif
		{

			rtw_ips_enter(rtlpriv);
		}
	}
exit:
	rtw_set_pwr_state_check_timer(&rtlpriv->pwrctrlpriv);
	pwrpriv->ps_processing = false;
	return;
}
void rtw_ps_processor(_adapter*padapter)
{
#ifdef CONFIG_P2P
	struct wifidirect_info	*pwdinfo = &( padapter->wdinfo );
#endif //CONFIG_P2P
	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
#ifdef SUPPORT_HW_RFOFF_DETECTED
	rt_rf_power_state rfpwrstate;
#endif //SUPPORT_HW_RFOFF_DETECTED

	pwrpriv->ps_processing = _TRUE;

#ifdef SUPPORT_HW_RFOFF_DETECTED
	if(pwrpriv->bips_processing == _TRUE)
		goto exit;
	
	//DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));	
	if(padapter->pwrctrlpriv.bHWPwrPindetect) 
	{
	#ifdef CONFIG_AUTOSUSPEND
		if(padapter->registrypriv.usbss_enable)
		{
			if(pwrpriv->rf_pwrstate == rf_on)
			{
				if(padapter->net_closed == _TRUE)
					pwrpriv->ps_flag = _TRUE;

				rfpwrstate = RfOnOffDetect(padapter);
				DBG_871X("@@@@- #1  %s==> rfstate:%s \n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
				if(rfpwrstate!= pwrpriv->rf_pwrstate)
				{
					if(rfpwrstate == rf_off)
					{
						pwrpriv->change_rfpwrstate = rf_off;
						
						pwrpriv->bkeepfwalive = _TRUE;	
						pwrpriv->brfoffbyhw = _TRUE;						
						
						autosuspend_enter(padapter);							
					}
				}
			}			
		}
		else
	#endif //CONFIG_AUTOSUSPEND
		{
			rfpwrstate = RfOnOffDetect(padapter);
			DBG_871X("@@@@- #2  %s==> rfstate:%s \n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off");

			if(rfpwrstate!= pwrpriv->rf_pwrstate)
			{
				if(rfpwrstate == rf_off)
				{	
					pwrpriv->change_rfpwrstate = rf_off;														
					pwrpriv->brfoffbyhw = _TRUE;
					padapter->bCardDisableWOHSM = _TRUE;
					rtw_hw_suspend(padapter );	
				}
				else
				{
					pwrpriv->change_rfpwrstate = rf_on;
					rtw_hw_resume(padapter );			
				}
				DBG_871X("current rf_pwrstate(%s)\n",(pwrpriv->rf_pwrstate == rf_off)?"rf_off":"rf_on");
			}
		}
		pwrpriv->pwr_state_check_cnts ++;	
	}
#endif //SUPPORT_HW_RFOFF_DETECTED

	if (pwrpriv->ips_mode_req == IPS_NONE
		#ifdef CONFIG_CONCURRENT_MODE
		|| padapter->pbuddy_adapter->pwrctrlpriv.ips_mode_req == IPS_NONE
		#endif
	)
		goto exit;

	if (rtw_pwr_unassociated_idle(padapter) == _FALSE)
		goto exit;

	if((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4)==0))
	{
		DBG_871X("==>%s .fw_state(%x)\n",__FUNCTION__,get_fwstate(pmlmepriv));
		#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
		#else
		pwrpriv->change_rfpwrstate = rf_off;
		#endif
		#ifdef CONFIG_AUTOSUSPEND
		if(padapter->registrypriv.usbss_enable)
		{
			if(pwrpriv->bHWPwrPindetect) 
				pwrpriv->bkeepfwalive = _TRUE;
			
			if(padapter->net_closed == _TRUE)
				pwrpriv->ps_flag = _TRUE;

			#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
			if (_TRUE==pwrpriv->bInternalAutoSuspend) {
				DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x)\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend);
			} else {
				pwrpriv->change_rfpwrstate = rf_off;
				padapter->bCardDisableWOHSM = _TRUE;
				DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend);
				autosuspend_enter(padapter);
			}		
			#else
			padapter->bCardDisableWOHSM = _TRUE;
			autosuspend_enter(padapter);
			#endif	//if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
		}		
		else if(pwrpriv->bHWPwrPindetect)
		{
		}
		else
		#endif //CONFIG_AUTOSUSPEND
		{
			#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
			pwrpriv->change_rfpwrstate = rf_off;
			#endif	//defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)

			#ifdef CONFIG_IPS
			ips_enter(padapter);			
			#endif
		}
	}
exit:
	rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
	pwrpriv->ps_processing = _FALSE;
	return;
}