rtw_btcoex_IpsNotify(padapter, pwrpriv->ips_mode_req);
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
_ips_enter(padapter);
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
}
int _ips_leave(struct adapter *padapter)
if (!is_primary_adapter(padapter))
return _SUCCESS;
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
ret = _ips_leave(padapter);
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
if (_SUCCESS == ret)
rtw_btcoex_IpsNotify(padapter, IPS_NONE);
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
u32 ps_deny = 0;
- down(&adapter_to_pwrctl(padapter)->lock);
+ mutex_lock(&adapter_to_pwrctl(padapter)->lock);
ps_deny = rtw_ps_deny_get(padapter);
- up(&adapter_to_pwrctl(padapter)->lock);
+ mutex_unlock(&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);
return;
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
/* if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) */
if (ps_mode == PS_MODE_ACTIVE) {
}
}
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
}
/*
return;
}
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
rtw_set_rpwm(Adapter, PS_STATE_S4);
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
rtw_lps_ctrl_wk_cmd(pri_padapter, LPS_CTRL_LEAVE, 0);
} else{
cond_resched();
while (1) {
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
if ((padapter->bSurpriseRemoved == true)
|| (padapter->hw_init_completed == false)
)
bReady = true;
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
if (true == bReady)
break;
pwrpriv = adapter_to_pwrctl(padapter);
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
if (pwrpriv->rpwm < PS_STATE_S2) {
DBG_871X("%s: Redundant CPWM Int. RPWM = 0x%02X CPWM = 0x%02x\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
- up(&pwrpriv->lock);
goto exit;
}
complete(&padapter->xmitpriv.xmit_comp);
}
- up(&pwrpriv->lock);
-
exit:
+ mutex_unlock(&pwrpriv->lock);
+
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
("cpwm_int_hdl: cpwm = 0x%02x\n", pwrpriv->cpwm));
}
padapter = dvobj->if1;
/* DBG_871X("+%s: rpwm = 0x%02X cpwm = 0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm); */
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) {
DBG_871X("%s: rpwm = 0x%02X cpwm = 0x%02X CPWM done!\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
goto exit;
}
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
if (rtw_read8(padapter, 0x100) != 0xEA) {
struct reportpwrstate_parm report;
return;
}
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) {
DBG_871X("%s: cpwm =%d, nothing to do!\n", __func__, pwrpriv->cpwm);
pwrpriv->brpwmtimeout = false;
exit:
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
}
/*
pwrctrl = adapter_to_pwrctl(padapter);
pslv = PS_STATE_S2;
- down(&pwrctrl->lock);
+ mutex_lock(&pwrctrl->lock);
register_task_alive(pwrctrl, task);
}
}
- up(&pwrctrl->lock);
+ mutex_unlock(&pwrctrl->lock);
if (_FAIL == res)
if (pwrctrl->cpwm >= PS_STATE_S2)
pslv = PS_STATE_S2;
}
- down(&pwrctrl->lock);
+ mutex_lock(&pwrctrl->lock);
unregister_task_alive(pwrctrl, task);
}
- up(&pwrctrl->lock);
+ mutex_unlock(&pwrctrl->lock);
}
/*
pwrctrl = adapter_to_pwrctl(padapter);
pslv = PS_STATE_S2;
- down(&pwrctrl->lock);
+ mutex_lock(&pwrctrl->lock);
register_task_alive(pwrctrl, XMIT_ALIVE);
}
}
- up(&pwrctrl->lock);
+ mutex_unlock(&pwrctrl->lock);
if (_FAIL == res)
if (pwrctrl->cpwm >= PS_STATE_S2)
pwrctrl = adapter_to_pwrctl(padapter);
pslv = PS_STATE_S2;
- down(&pwrctrl->lock);
+ mutex_lock(&pwrctrl->lock);
register_task_alive(pwrctrl, CMD_ALIVE);
}
}
- up(&pwrctrl->lock);
+ mutex_unlock(&pwrctrl->lock);
if (_FAIL == res)
if (pwrctrl->cpwm >= PS_STATE_S2)
pslv = PS_STATE_S2;
}
- down(&pwrctrl->lock);
+ mutex_lock(&pwrctrl->lock);
unregister_task_alive(pwrctrl, XMIT_ALIVE);
rtw_set_rpwm(padapter, pslv);
}
- up(&pwrctrl->lock);
+ mutex_unlock(&pwrctrl->lock);
}
/*
pslv = PS_STATE_S2;
}
- down(&pwrctrl->lock);
+ mutex_lock(&pwrctrl->lock);
unregister_task_alive(pwrctrl, CMD_ALIVE);
}
}
- up(&pwrctrl->lock);
+ mutex_unlock(&pwrctrl->lock);
}
void rtw_init_pwrctrl_priv(struct adapter *padapter)
{
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
- sema_init(&pwrctrlpriv->lock, 1);
+ mutex_init(&pwrctrlpriv->lock);
sema_init(&pwrctrlpriv->check_32k_lock, 1);
pwrctrlpriv->rf_pwrstate = rf_on;
pwrctrlpriv->ips_enter_cnts = 0;
pwrpriv = adapter_to_pwrctl(padapter);
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
if (pwrpriv->ps_deny & BIT(reason)) {
DBG_871X(FUNC_ADPT_FMT ": [WARNING] Reason %d had been set before!!\n",
FUNC_ADPT_ARG(padapter), reason);
}
pwrpriv->ps_deny |= BIT(reason);
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
/* DBG_871X("-" FUNC_ADPT_FMT ": Now PS deny for 0x%08X\n", */
/* FUNC_ADPT_ARG(padapter), pwrpriv->ps_deny); */
pwrpriv = adapter_to_pwrctl(padapter);
- down(&pwrpriv->lock);
+ mutex_lock(&pwrpriv->lock);
if ((pwrpriv->ps_deny & BIT(reason)) == 0) {
DBG_871X(FUNC_ADPT_FMT ": [ERROR] Reason %d had been canceled before!!\n",
FUNC_ADPT_ARG(padapter), reason);
}
pwrpriv->ps_deny &= ~BIT(reason);
- up(&pwrpriv->lock);
+ mutex_unlock(&pwrpriv->lock);
/* DBG_871X("-" FUNC_ADPT_FMT ": Now PS deny for 0x%08X\n", */
/* FUNC_ADPT_ARG(padapter), pwrpriv->ps_deny); */