rtl8188eu: Remove CONFIG_LPS_LCLK

This symbol is not defined.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-02-24 20:22:38 -06:00
parent 4bfca25407
commit e932bd9250
8 changed files with 5 additions and 563 deletions

View file

@ -450,15 +450,6 @@ thread_return rtw_cmd_thread(thread_context context)
continue;
}
#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", __FUNCTION__));
continue;
}
#endif
_next:
if ((padapter->bDriverStopped == true)||(padapter->bSurpriseRemoved== true))
{
@ -468,9 +459,6 @@ _next:
}
if(!(pcmd = rtw_dequeue_cmd(pcmdpriv))) {
#ifdef CONFIG_LPS_LCLK
rtw_unregister_cmd_alive(padapter);
#endif
continue;
}
@ -540,9 +528,6 @@ post_process:
do{
pcmd = rtw_dequeue_cmd(pcmdpriv);
if(pcmd==NULL) {
#ifdef CONFIG_LPS_LCLK
rtw_unregister_cmd_alive(padapter);
#endif
break;
}

View file

@ -2179,21 +2179,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
void rtw_cpwm_event_callback(struct adapter *padapter, u8 *pbuf)
{
#ifdef CONFIG_LPS_LCLK
struct reportpwrstate_parm *preportpwrstate;
#endif
;
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)(adapter_to_pwrctl(padapter)->cpwm_tog + 0x80);
cpwm_int_hdl(padapter, preportpwrstate);
#endif
;
}
/*

View file

@ -383,11 +383,6 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
}
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));
@ -405,13 +400,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
pwrpriv->tog += 0x80;
#ifdef CONFIG_LPS_LCLK
/* No LPS 32K, No Ack */
if (!(rpwm & PS_ACK))
#endif
{
pwrpriv->cpwm = pslv;
}
pwrpriv->cpwm = pslv;
#ifdef CONFIG_DETECT_CPWM_BY_POLLING
if (rpwm & PS_ACK)
@ -424,12 +413,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
/* cpwm_now = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HCPWM1); */
rtw_hal_get_hwreg(padapter, HW_VAR_GET_CPWM, (u8 *)(&cpwm_now));
if ((cpwm_orig ^ cpwm_now) & 0x80)
{
#ifdef CONFIG_LPS_LCLK
pwrpriv->cpwm = PS_STATE_S4;
pwrpriv->cpwm_tog = cpwm_now & PS_TOGGLE;
#endif
if ((cpwm_orig ^ cpwm_now) & 0x80) {
pollingRes = _SUCCESS;
break;
}
@ -523,10 +507,6 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
}
}
#ifdef CONFIG_LPS_LCLK
_enter_pwrlock(&pwrpriv->lock);
#endif
/* if(pwrpriv->pwr_mode == PS_MODE_ACTIVE) */
if(ps_mode == PS_MODE_ACTIVE)
{
@ -628,21 +608,9 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 0);
#endif /* CONFIG_P2P_PS */
#ifdef CONFIG_LPS_LCLK
DBG_871X("%s: alives: %d\n", __FUNCTION__, pwrpriv->alives);
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
;
}
/*
@ -757,10 +725,6 @@ void LeaveAllPowerSaveMode(IN struct adapter *Adapter)
/* DBG_871X("%s.....\n",__FUNCTION__); */
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 */
@ -768,13 +732,7 @@ void LeaveAllPowerSaveMode(IN struct adapter *Adapter)
#ifdef CONFIG_LPS
rtw_lps_ctrl_wk_cmd(Adapter, LPS_CTRL_LEAVE, enqueue);
#endif
#ifdef CONFIG_LPS_LCLK
LPS_Leave_check(Adapter);
#endif
}
else
{
} else {
if(adapter_to_pwrctl(Adapter)->rf_pwrstate== rf_off)
{
#ifdef CONFIG_AUTOSUSPEND
@ -800,428 +758,6 @@ void LeaveAllPowerSaveMode(IN struct adapter *Adapter)
;
}
#ifdef CONFIG_LPS_LCLK
void LPS_Leave_check(
struct adapter *padapter)
{
struct pwrctrl_priv *pwrpriv;
u32 start_time;
u8 bReady;
;
pwrpriv = adapter_to_pwrctl(padapter);
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_871X("Wait for cpwm event than 100 ms!!!\n");
break;
}
rtw_msleep_os(1);
}
;
}
/*
* 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(
struct adapter *padapter,
struct reportpwrstate_parm *preportpwrstate)
{
struct pwrctrl_priv *pwrpriv;
;
pwrpriv = adapter_to_pwrctl(padapter);
_enter_pwrlock(&pwrpriv->lock);
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));
;
}
static void cpwm_event_callback(struct work_struct *work)
{
struct pwrctrl_priv *pwrpriv = container_of(work, struct pwrctrl_priv, cpwm_event);
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
struct adapter *adapter = dvobj->if1;
struct reportpwrstate_parm report;
/* DBG_871X("%s\n",__FUNCTION__); */
report.state = PS_STATE_S2;
cpwm_int_hdl(adapter, &report);
}
__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(struct adapter *padapter)
{
s32 res;
struct pwrctrl_priv *pwrctrl;
u8 pslv;
;
res = _SUCCESS;
pwrctrl = adapter_to_pwrctl(padapter);
#ifdef CONFIG_BT_COEXIST
if (true == adapter_to_pwrctl(padapter)->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);
#ifdef CONFIG_DETECT_CPWM_BY_POLLING
if (_FAIL == res)
{
if (pwrctrl->cpwm >= PS_STATE_S2)
res = _SUCCESS;
}
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
;
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(struct adapter *padapter)
{
s32 res;
struct pwrctrl_priv *pwrctrl;
u8 pslv;
;
res = _SUCCESS;
pwrctrl = adapter_to_pwrctl(padapter);
#ifdef CONFIG_BT_COEXIST
if (true == adapter_to_pwrctl(padapter)->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);
#ifdef CONFIG_DETECT_CPWM_BY_POLLING
if (_FAIL == res)
{
if (pwrctrl->cpwm >= PS_STATE_S2)
res = _SUCCESS;
}
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
;
return res;
}
/*
* Caller: rx_isr
*
* Calling Context: Dispatch/ISR
*
* Return Value:
* _SUCCESS
* _FAIL
*/
s32 rtw_register_rx_alive(struct adapter *padapter)
{
struct pwrctrl_priv *pwrctrl;
;
pwrctrl = adapter_to_pwrctl(padapter);
_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);
;
return _SUCCESS;
}
/*
* Caller: evt_isr or evt_thread
*
* Calling Context: Dispatch/ISR or Passive
*
* Return Value:
* _SUCCESS
* _FAIL
*/
s32 rtw_register_evt_alive(struct adapter *padapter)
{
struct pwrctrl_priv *pwrctrl;
;
pwrctrl = adapter_to_pwrctl(padapter);
_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);
;
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(struct adapter *padapter)
{
struct pwrctrl_priv *pwrctrl;
;
pwrctrl = adapter_to_pwrctl(padapter);
_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",
__FUNCTION__, pwrctrl->cpwm, pwrctrl->alives));
if ((pwrctrl->alives == 0) &&
(pwrctrl->cpwm > PS_STATE_S0))
{
rtw_set_rpwm(padapter, PS_STATE_S0);
}
}
_exit_pwrlock(&pwrctrl->lock);
;
}
/*
* 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(struct adapter *padapter)
{
struct pwrctrl_priv *pwrctrl;
;
pwrctrl = adapter_to_pwrctl(padapter);
_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",
__FUNCTION__, pwrctrl->cpwm, pwrctrl->alives));
if ((pwrctrl->alives == 0) &&
(pwrctrl->cpwm > PS_STATE_S0))
{
rtw_set_rpwm(padapter, PS_STATE_S0);
}
}
_exit_pwrlock(&pwrctrl->lock);
;
}
/*
* Caller: ISR
*/
void rtw_unregister_rx_alive(struct adapter *padapter)
{
struct pwrctrl_priv *pwrctrl;
;
pwrctrl = adapter_to_pwrctl(padapter);
_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);
;
}
void rtw_unregister_evt_alive(struct adapter *padapter)
{
struct pwrctrl_priv *pwrctrl;
;
pwrctrl = adapter_to_pwrctl(padapter);
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);
;
}
#endif /* CONFIG_LPS_LCLK */
#ifdef CONFIG_RESUME_IN_WORKQUEUE
static void resume_workitem_callback(struct work_struct *work);
#endif /* CONFIG_RESUME_IN_WORKQUEUE */
@ -1269,12 +805,6 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
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);
#endif /* CONFIG_LPS_LCLK */
_init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter);
#ifdef CONFIG_RESUME_IN_WORKQUEUE

View file

@ -531,15 +531,6 @@ s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter)
if(check_pending_xmitbuf(pxmitpriv) == false)
return _SUCCESS;
#ifdef CONFIG_LPS_LCLK
ret = rtw_register_tx_alive(padapter);
if (ret != _SUCCESS) {
RT_TRACE(_module_hal_xmit_c_, _drv_notice_,
("%s: wait to leave LPS_LCLK\n", __FUNCTION__));
return _SUCCESS;
}
#endif
do {
pxmitbuf = dequeue_pending_xmitbuf(pxmitpriv);
if (pxmitbuf == NULL) break;
@ -547,11 +538,6 @@ s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter)
rtw_write_port(padapter, pxmitbuf->ff_hwaddr, pxmitbuf->len, (unsigned char*)pxmitbuf);
} while (1);
#ifdef CONFIG_LPS_LCLK
rtw_unregister_tx_alive(padapter);
#endif
return _SUCCESS;
}
#endif

View file

@ -3010,19 +3010,6 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
#endif
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;
/* DBG_871X("##### Change RPWM value to = %x for switch clk #####\n",ps_state); */
rtw_write8(Adapter, REG_USB_HRPWM, ps_state);
}
#endif
break;
case HW_VAR_H2C_FW_PWRMODE:
{
@ -3364,11 +3351,6 @@ static void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
}
break;
case HW_VAR_GET_CPWM:
#ifdef CONFIG_LPS_LCLK
{
*val = rtw_read8(Adapter, REG_USB_HCPWM);
}
#endif
break;
case HW_VAR_C2HEVT_CLEAR:
*val = rtw_read8(Adapter, REG_C2HEVT_CLEAR);

View file

@ -334,16 +334,6 @@ static void interrupt_handler_8188eu(struct adapter *padapter,u16 pkt_len,u8 *pb
memcpy(&(pHalData->IntArray[0]), &(pbuf[USB_INTR_CONTENT_HISR_OFFSET]), 4);
memcpy(&(pHalData->IntArray[1]), &(pbuf[USB_INTR_CONTENT_HISRE_OFFSET]), 4);
#ifdef CONFIG_LPS_LCLK
if ( pHalData->IntArray[0] & IMR_CPWM_88E ) {
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(&(adapter_to_pwrctl(padapter)->cpwm_event));
}
#endif/* CONFIG_LPS_LCLK */
#ifdef DBG_CONFIG_ERROR_DETECT_INT
if ( pHalData->IntArray[1] & IMR_TXERR_88E )
DBG_871X("===> %s Tx Error Flag Interrupt Status \n",__FUNCTION__);

View file

@ -34,10 +34,6 @@
#define CONFIG_LPS
#ifdef CONFIG_LPS_LCLK
#define CONFIG_XMIT_THREAD_MODE
#endif
//befor link
#define CONFIG_ANTENNA_DIVERSITY

View file

@ -296,21 +296,8 @@ struct pwrctrl_priv
#define rtw_set_pwr_state_check_timer(pwrctl) \
_rtw_set_pwr_state_check_timer((pwrctl), (pwrctl)->pwr_state_check_interval)
extern void rtw_init_pwrctrl_priv(struct adapter *adapter);
extern void rtw_free_pwrctrl_priv(struct adapter * adapter);
#ifdef CONFIG_LPS_LCLK
extern s32 rtw_register_tx_alive(struct adapter *padapter);
extern void rtw_unregister_tx_alive(struct adapter *padapter);
extern s32 rtw_register_rx_alive(struct adapter *padapter);
extern void rtw_unregister_rx_alive(struct adapter *padapter);
extern s32 rtw_register_cmd_alive(struct adapter *padapter);
extern void rtw_unregister_cmd_alive(struct adapter *padapter);
extern s32 rtw_register_evt_alive(struct adapter *padapter);
extern void rtw_unregister_evt_alive(struct adapter *padapter);
extern void cpwm_int_hdl(struct adapter *padapter, struct reportpwrstate_parm *preportpwrstate);
extern void LPS_Leave_check(struct adapter *padapter);
#endif
void rtw_init_pwrctrl_priv(struct adapter *adapter);
void rtw_free_pwrctrl_priv(struct adapter * adapter);
void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode);
void rtw_set_rpwm(struct adapter * padapter, u8 val8);