mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-25 14:03:40 +00:00
rtl8188eu: Remove CONFIG_LPS_LCLK
This one is not defined. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
2f86fc26dd
commit
cf8cd84af0
6 changed files with 6 additions and 606 deletions
|
@ -429,15 +429,6 @@ _func_enter_;
|
|||
break;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
if (rtw_register_cmd_alive(padapter) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_notice_,
|
||||
("%s: wait to leave LPS_LCLK\n", __func__));
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
_next:
|
||||
if ((padapter->bDriverStopped == true)||(padapter->bSurpriseRemoved== true))
|
||||
{
|
||||
|
@ -446,15 +437,10 @@ _next:
|
|||
break;
|
||||
}
|
||||
|
||||
if (!(pcmd = rtw_dequeue_cmd(pcmdpriv))) {
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
rtw_unregister_cmd_alive(padapter);
|
||||
#endif
|
||||
if (!(pcmd = rtw_dequeue_cmd(pcmdpriv)))
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) )
|
||||
{
|
||||
if (_FAIL == rtw_cmd_filter(pcmdpriv, pcmd)) {
|
||||
pcmd->res = H2C_DROPPED;
|
||||
goto post_process;
|
||||
}
|
||||
|
|
|
@ -1999,21 +1999,9 @@ _func_exit_;
|
|||
|
||||
void rtw_cpwm_event_callback(PADAPTER padapter, u8 *pbuf)
|
||||
{
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
struct reportpwrstate_parm *preportpwrstate;
|
||||
#endif
|
||||
|
||||
_func_enter_;
|
||||
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("+rtw_cpwm_event_callback !!!\n"));
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
preportpwrstate = (struct reportpwrstate_parm*)pbuf;
|
||||
preportpwrstate->state |= (u8)(padapter->pwrctrlpriv.cpwm_tog + 0x80);
|
||||
cpwm_int_hdl(padapter, preportpwrstate);
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -364,12 +364,7 @@ _func_enter_;
|
|||
else
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
{
|
||||
if ( (pwrpriv->rpwm == pslv)
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
|| ((pwrpriv->rpwm >= PS_STATE_S2)&&(pslv >= PS_STATE_S2))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if ( (pwrpriv->rpwm == pslv)) {
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_,_drv_err_,
|
||||
("%s: Already set rpwm[0x%02X], new=0x%02X!\n", __func__, pwrpriv->rpwm, pslv));
|
||||
return;
|
||||
|
@ -401,11 +396,6 @@ _func_enter_;
|
|||
}
|
||||
|
||||
rpwm = pslv | pwrpriv->tog;
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
/* only when from PS_STATE S0/S1 to S2 and higher needs ACK */
|
||||
if ((pwrpriv->cpwm < PS_STATE_S2) && (pslv >= PS_STATE_S2))
|
||||
rpwm |= PS_ACK;
|
||||
#endif
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("rtw_set_rpwm: rpwm=0x%02x cpwm=0x%02x\n", rpwm, pwrpriv->cpwm));
|
||||
|
||||
|
@ -418,14 +408,7 @@ _func_enter_;
|
|||
rtw_hal_set_hwreg(padapter, HW_VAR_SET_RPWM, (u8 *)(&rpwm));
|
||||
|
||||
pwrpriv->tog += 0x80;
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
/* No LPS 32K, No Ack */
|
||||
if (!(rpwm & PS_ACK))
|
||||
#endif
|
||||
{
|
||||
pwrpriv->cpwm = pslv;
|
||||
}
|
||||
pwrpriv->cpwm = pslv;
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
@ -503,13 +486,8 @@ _func_enter_;
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
#endif
|
||||
|
||||
/* if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) */
|
||||
if (ps_mode == PS_MODE_ACTIVE)
|
||||
{
|
||||
if (ps_mode == PS_MODE_ACTIVE) {
|
||||
#ifdef CONFIG_P2P_PS
|
||||
if (pwdinfo->opp_ps == 0)
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
|
@ -542,19 +520,10 @@ _func_enter_;
|
|||
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 0);
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
if (pwrpriv->alives == 0)
|
||||
rtw_set_rpwm(padapter, PS_STATE_S0);
|
||||
#else
|
||||
rtw_set_rpwm(padapter, PS_STATE_S2);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
@ -680,10 +649,6 @@ _func_enter_;
|
|||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
||||
{ /* connect */
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
enqueue = 1;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
p2p_ps_wk_cmd(Adapter, P2P_PS_DISABLE, enqueue);
|
||||
#endif /* CONFIG_P2P_PS */
|
||||
|
@ -692,12 +657,7 @@ _func_enter_;
|
|||
rtw_lps_ctrl_wk_cmd(Adapter, LPS_CTRL_LEAVE, enqueue);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
LPS_Leave_check(Adapter);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if (Adapter->pwrctrlpriv.rf_pwrstate== rf_off)
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
|
@ -719,492 +679,6 @@ _func_enter_;
|
|||
_func_exit_;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
void LPS_Leave_check(
|
||||
PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
u32 start_time;
|
||||
u8 bReady;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pwrpriv = &padapter->pwrctrlpriv;
|
||||
|
||||
bReady = false;
|
||||
start_time = rtw_get_current_time();
|
||||
|
||||
rtw_yield_os();
|
||||
|
||||
while (1)
|
||||
{
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if ((padapter->bSurpriseRemoved == true)
|
||||
|| (padapter->hw_init_completed == false)
|
||||
|| (padapter->bDriverStopped== true)
|
||||
|| (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
)
|
||||
{
|
||||
bReady = true;
|
||||
}
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if (true == bReady)
|
||||
break;
|
||||
|
||||
if (rtw_get_passing_time_ms(start_time)>100)
|
||||
{
|
||||
DBG_88E("Wait for cpwm event than 100 ms!!!\n");
|
||||
break;
|
||||
}
|
||||
rtw_msleep_os(1);
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller:ISR handler...
|
||||
*
|
||||
* This will be called when CPWM interrupt is up.
|
||||
*
|
||||
* using to update cpwn of drv; and drv willl make a decision to up or down pwr level
|
||||
*/
|
||||
void cpwm_int_hdl(
|
||||
PADAPTER padapter,
|
||||
struct reportpwrstate_parm *preportpwrstate)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pwrpriv = &padapter->pwrctrlpriv;
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
#ifdef CONFIG_LPS_RPWM_TIMER
|
||||
if (pwrpriv->rpwm < PS_STATE_S2)
|
||||
{
|
||||
DBG_88E("%s: Redundant CPWM Int. RPWM=0x%02X CPWM=0x%02x\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
goto exit;
|
||||
}
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
|
||||
pwrpriv->cpwm = PS_STATE(preportpwrstate->state);
|
||||
pwrpriv->cpwm_tog = preportpwrstate->state & PS_TOGGLE;
|
||||
|
||||
if (pwrpriv->cpwm >= PS_STATE_S2)
|
||||
{
|
||||
if (pwrpriv->alives & CMD_ALIVE)
|
||||
_rtw_up_sema(&padapter->cmdpriv.cmd_queue_sema);
|
||||
|
||||
if (pwrpriv->alives & XMIT_ALIVE)
|
||||
_rtw_up_sema(&padapter->xmitpriv.xmit_sema);
|
||||
}
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
exit:
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("cpwm_int_hdl: cpwm=0x%02x\n", pwrpriv->cpwm));
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
static void cpwm_event_callback(struct work_struct *work)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(work, struct pwrctrl_priv, cpwm_event);
|
||||
_adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv);
|
||||
struct reportpwrstate_parm report;
|
||||
|
||||
/* DBG_88E("%s\n",__func__); */
|
||||
|
||||
report.state = PS_STATE_S2;
|
||||
cpwm_int_hdl(adapter, &report);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS_RPWM_TIMER
|
||||
static void rpwmtimeout_workitem_callback(struct work_struct *work)
|
||||
{
|
||||
PADAPTER padapter;
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
|
||||
|
||||
pwrpriv = container_of(work, struct pwrctrl_priv, rpwmtimeoutwi);
|
||||
padapter = container_of(pwrpriv, _adapter, pwrctrlpriv);
|
||||
/* DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
|
||||
{
|
||||
DBG_88E("%s: rpwm=0x%02X cpwm=0x%02X CPWM done!\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
|
||||
goto exit;
|
||||
}
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if (rtw_read8(padapter, 0x100) != 0xEA)
|
||||
{
|
||||
#if 1
|
||||
struct reportpwrstate_parm report;
|
||||
|
||||
report.state = PS_STATE_S2;
|
||||
DBG_88E("\n%s: FW already leave 32K!\n\n", __func__);
|
||||
cpwm_int_hdl(padapter, &report);
|
||||
#else
|
||||
DBG_88E("\n%s: FW already leave 32K!\n\n", __func__);
|
||||
cpwm_event_callback(&pwrpriv->cpwm_event);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
|
||||
{
|
||||
DBG_88E("%s: cpwm=%d, nothing to do!\n", __func__, pwrpriv->cpwm);
|
||||
goto exit;
|
||||
}
|
||||
pwrpriv->brpwmtimeout = true;
|
||||
rtw_set_rpwm(padapter, pwrpriv->rpwm);
|
||||
pwrpriv->brpwmtimeout = false;
|
||||
|
||||
exit:
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is a timer handler, can't do any IO in it.
|
||||
*/
|
||||
static void pwr_rpwm_timeout_handler(void *FunctionContext)
|
||||
{
|
||||
PADAPTER padapter;
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
|
||||
|
||||
padapter = (PADAPTER)FunctionContext;
|
||||
pwrpriv = &padapter->pwrctrlpriv;
|
||||
/* DBG_88E("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */
|
||||
|
||||
if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
|
||||
{
|
||||
DBG_88E("+%s: cpwm=%d, nothing to do!\n", __func__, pwrpriv->cpwm);
|
||||
return;
|
||||
}
|
||||
|
||||
_set_workitem(&pwrpriv->rpwmtimeoutwi);
|
||||
}
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
|
||||
__inline static void register_task_alive(struct pwrctrl_priv *pwrctrl, u32 tag)
|
||||
{
|
||||
pwrctrl->alives |= tag;
|
||||
}
|
||||
|
||||
__inline static void unregister_task_alive(struct pwrctrl_priv *pwrctrl, u32 tag)
|
||||
{
|
||||
pwrctrl->alives &= ~tag;
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller: rtw_xmit_thread
|
||||
*
|
||||
* Check if the fw_pwrstate is okay for xmit.
|
||||
* If not (cpwm is less than S3), then the sub-routine
|
||||
* will raise the cpwm to be greater than or equal to S3.
|
||||
*
|
||||
* Calling Context: Passive
|
||||
*
|
||||
* Return Value:
|
||||
* _SUCCESS rtw_xmit_thread can write fifo/txcmd afterwards.
|
||||
* _FAIL rtw_xmit_thread can not do anything.
|
||||
*/
|
||||
s32 rtw_register_tx_alive(PADAPTER padapter)
|
||||
{
|
||||
s32 res;
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
u8 pslv;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
res = _SUCCESS;
|
||||
pwrctrl = &padapter->pwrctrlpriv;
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if (true == padapter->pwrctrlpriv.btcoex_rfon)
|
||||
pslv = PS_STATE_S3;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pslv = PS_STATE_S2;
|
||||
}
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
register_task_alive(pwrctrl, XMIT_ALIVE);
|
||||
|
||||
if (pwrctrl->bFwCurrentInPSMode == true)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("rtw_register_tx_alive: cpwm=0x%02x alives=0x%08x\n",
|
||||
pwrctrl->cpwm, pwrctrl->alives));
|
||||
|
||||
if (pwrctrl->cpwm < pslv)
|
||||
{
|
||||
if (pwrctrl->cpwm < PS_STATE_S2)
|
||||
res = _FAIL;
|
||||
if (pwrctrl->rpwm < pslv)
|
||||
rtw_set_rpwm(padapter, pslv);
|
||||
}
|
||||
}
|
||||
|
||||
_exit_pwrlock(&pwrctrl->lock);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller: rtw_cmd_thread
|
||||
*
|
||||
* Check if the fw_pwrstate is okay for issuing cmd.
|
||||
* If not (cpwm should be is less than S2), then the sub-routine
|
||||
* will raise the cpwm to be greater than or equal to S2.
|
||||
*
|
||||
* Calling Context: Passive
|
||||
*
|
||||
* Return Value:
|
||||
* _SUCCESS rtw_cmd_thread can issue cmds to firmware afterwards.
|
||||
* _FAIL rtw_cmd_thread can not do anything.
|
||||
*/
|
||||
s32 rtw_register_cmd_alive(PADAPTER padapter)
|
||||
{
|
||||
s32 res;
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
u8 pslv;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
res = _SUCCESS;
|
||||
pwrctrl = &padapter->pwrctrlpriv;
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if (true == padapter->pwrctrlpriv.btcoex_rfon)
|
||||
pslv = PS_STATE_S3;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pslv = PS_STATE_S2;
|
||||
}
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
register_task_alive(pwrctrl, CMD_ALIVE);
|
||||
|
||||
if (pwrctrl->bFwCurrentInPSMode == true)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_info_,
|
||||
("rtw_register_cmd_alive: cpwm=0x%02x alives=0x%08x\n",
|
||||
pwrctrl->cpwm, pwrctrl->alives));
|
||||
|
||||
if (pwrctrl->cpwm < pslv)
|
||||
{
|
||||
if (pwrctrl->cpwm < PS_STATE_S2)
|
||||
res = _FAIL;
|
||||
if (pwrctrl->rpwm < pslv)
|
||||
rtw_set_rpwm(padapter, pslv);
|
||||
}
|
||||
}
|
||||
|
||||
_exit_pwrlock(&pwrctrl->lock);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller: rx_isr
|
||||
*
|
||||
* Calling Context: Dispatch/ISR
|
||||
*
|
||||
* Return Value:
|
||||
* _SUCCESS
|
||||
* _FAIL
|
||||
*/
|
||||
s32 rtw_register_rx_alive(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pwrctrl = &padapter->pwrctrlpriv;
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
register_task_alive(pwrctrl, RECV_ALIVE);
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("rtw_register_rx_alive: cpwm=0x%02x alives=0x%08x\n",
|
||||
pwrctrl->cpwm, pwrctrl->alives));
|
||||
|
||||
_exit_pwrlock(&pwrctrl->lock);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller: evt_isr or evt_thread
|
||||
*
|
||||
* Calling Context: Dispatch/ISR or Passive
|
||||
*
|
||||
* Return Value:
|
||||
* _SUCCESS
|
||||
* _FAIL
|
||||
*/
|
||||
s32 rtw_register_evt_alive(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pwrctrl = &padapter->pwrctrlpriv;
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
register_task_alive(pwrctrl, EVT_ALIVE);
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("rtw_register_evt_alive: cpwm=0x%02x alives=0x%08x\n",
|
||||
pwrctrl->cpwm, pwrctrl->alives));
|
||||
|
||||
_exit_pwrlock(&pwrctrl->lock);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller: ISR
|
||||
*
|
||||
* If ISR's txdone,
|
||||
* No more pkts for TX,
|
||||
* Then driver shall call this fun. to power down firmware again.
|
||||
*/
|
||||
void rtw_unregister_tx_alive(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pwrctrl = &padapter->pwrctrlpriv;
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
unregister_task_alive(pwrctrl, XMIT_ALIVE);
|
||||
|
||||
if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE) &&
|
||||
(pwrctrl->bFwCurrentInPSMode == true))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("%s: cpwm=0x%02x alives=0x%08x\n",
|
||||
__func__, pwrctrl->cpwm, pwrctrl->alives));
|
||||
|
||||
if ((pwrctrl->alives == 0) &&
|
||||
(pwrctrl->cpwm > PS_STATE_S0))
|
||||
{
|
||||
rtw_set_rpwm(padapter, PS_STATE_S0);
|
||||
}
|
||||
}
|
||||
|
||||
_exit_pwrlock(&pwrctrl->lock);
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller: ISR
|
||||
*
|
||||
* If all commands have been done,
|
||||
* and no more command to do,
|
||||
* then driver shall call this fun. to power down firmware again.
|
||||
*/
|
||||
void rtw_unregister_cmd_alive(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pwrctrl = &padapter->pwrctrlpriv;
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
unregister_task_alive(pwrctrl, CMD_ALIVE);
|
||||
|
||||
if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE) &&
|
||||
(pwrctrl->bFwCurrentInPSMode == true))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_info_,
|
||||
("%s: cpwm=0x%02x alives=0x%08x\n",
|
||||
__func__, pwrctrl->cpwm, pwrctrl->alives));
|
||||
|
||||
if ((pwrctrl->alives == 0) &&
|
||||
(pwrctrl->cpwm > PS_STATE_S0))
|
||||
{
|
||||
rtw_set_rpwm(padapter, PS_STATE_S0);
|
||||
}
|
||||
}
|
||||
|
||||
_exit_pwrlock(&pwrctrl->lock);
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
/*
|
||||
* Caller: ISR
|
||||
*/
|
||||
void rtw_unregister_rx_alive(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pwrctrl = &padapter->pwrctrlpriv;
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
unregister_task_alive(pwrctrl, RECV_ALIVE);
|
||||
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("rtw_unregister_rx_alive: cpwm=0x%02x alives=0x%08x\n",
|
||||
pwrctrl->cpwm, pwrctrl->alives));
|
||||
|
||||
_exit_pwrlock(&pwrctrl->lock);
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void rtw_unregister_evt_alive(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pwrctrl = &padapter->pwrctrlpriv;
|
||||
|
||||
unregister_task_alive(pwrctrl, EVT_ALIVE);
|
||||
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("rtw_unregister_evt_alive: cpwm=0x%02x alives=0x%08x\n",
|
||||
pwrctrl->cpwm, pwrctrl->alives));
|
||||
|
||||
_exit_pwrlock(&pwrctrl->lock);
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
static void resume_workitem_callback(struct work_struct *work);
|
||||
#endif /* CONFIG_RESUME_IN_WORKQUEUE */
|
||||
|
@ -1256,18 +730,6 @@ _func_enter_;
|
|||
|
||||
pwrctrlpriv->btcoex_rfon = false;
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SET_RPWM, (u8 *)(&pwrctrlpriv->rpwm));
|
||||
|
||||
_init_workitem(&pwrctrlpriv->cpwm_event, cpwm_event_callback, NULL);
|
||||
|
||||
#ifdef CONFIG_LPS_RPWM_TIMER
|
||||
pwrctrlpriv->brpwmtimeout = false;
|
||||
_init_workitem(&pwrctrlpriv->rpwmtimeoutwi, rpwmtimeout_workitem_callback, NULL);
|
||||
_init_timer(&pwrctrlpriv->pwr_rpwm_timer, padapter->pnetdev, pwr_rpwm_timeout_handler, padapter);
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
|
||||
_init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter);
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
|
|
|
@ -2867,18 +2867,6 @@ _func_enter_;
|
|||
}
|
||||
break;
|
||||
case HW_VAR_SET_RPWM:
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
{
|
||||
u8 ps_state = *((u8 *)val);
|
||||
/* rpwm value only use BIT0(clock bit) ,BIT6(Ack bit), and BIT7(Toggle bit) for 88e. */
|
||||
/* BIT0 value - 1: 32k, 0:40MHz. */
|
||||
/* BIT6 value - 1: report cpwm value after success set, 0:do not report. */
|
||||
/* BIT7 value - Toggle bit change. */
|
||||
/* modify by Thomas. 2012/4/2. */
|
||||
ps_state = ps_state & 0xC1;
|
||||
rtw_write8(Adapter, REG_USB_HRPWM, ps_state);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case HW_VAR_H2C_FW_PWRMODE:
|
||||
{
|
||||
|
|
|
@ -365,17 +365,6 @@ static void interrupt_handler_8188eu(_adapter *padapter,u16 pkt_len,u8 *pbuf)
|
|||
_rtw_memcpy(&(pHalData->IntArray[0]), &(pbuf[USB_INTR_CONTENT_HISR_OFFSET]), 4);
|
||||
_rtw_memcpy(&(pHalData->IntArray[1]), &(pbuf[USB_INTR_CONTENT_HISRE_OFFSET]), 4);
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
if ( pHalData->IntArray[0] & IMR_CPWM_88E )
|
||||
{
|
||||
_rtw_memcpy(&pwr_rpt.state, &(pbuf[USB_INTR_CONTENT_CPWM1_OFFSET]), 1);
|
||||
|
||||
/* 88e's cpwm value only change BIT0, so driver need to add PS_STATE_S2 for LPS flow. */
|
||||
pwr_rpt.state |= PS_STATE_S2;
|
||||
_set_workitem(&padapter->pwrctrlpriv.cpwm_event);
|
||||
}
|
||||
#endif/* CONFIG_LPS_LCLK */
|
||||
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
|
|
|
@ -284,19 +284,6 @@ struct pwrctrl_priv
|
|||
extern void rtw_init_pwrctrl_priv(_adapter *adapter);
|
||||
extern void rtw_free_pwrctrl_priv(_adapter * adapter);
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
extern s32 rtw_register_tx_alive(PADAPTER padapter);
|
||||
extern void rtw_unregister_tx_alive(PADAPTER padapter);
|
||||
extern s32 rtw_register_rx_alive(PADAPTER padapter);
|
||||
extern void rtw_unregister_rx_alive(PADAPTER padapter);
|
||||
extern s32 rtw_register_cmd_alive(PADAPTER padapter);
|
||||
extern void rtw_unregister_cmd_alive(PADAPTER padapter);
|
||||
extern s32 rtw_register_evt_alive(PADAPTER padapter);
|
||||
extern void rtw_unregister_evt_alive(PADAPTER padapter);
|
||||
extern void cpwm_int_hdl(PADAPTER padapter, struct reportpwrstate_parm *preportpwrstate);
|
||||
extern void LPS_Leave_check(PADAPTER padapter);
|
||||
#endif
|
||||
|
||||
extern void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode);
|
||||
extern void rtw_set_rpwm(_adapter * padapter, u8 val8);
|
||||
extern void LeaveAllPowerSaveMode(PADAPTER Adapter);
|
||||
|
|
Loading…
Reference in a new issue