mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 04:23:39 +00:00
rtl8188eu: Fix checkpatch ERRORs in core/rtw_cmd.c
Some WARNINGs and CHECKs remain. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
29ada234b0
commit
a839bebbbd
1 changed files with 586 additions and 709 deletions
295
core/rtw_cmd.c
295
core/rtw_cmd.c
|
@ -71,14 +71,12 @@ _func_enter_;
|
|||
|
||||
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3);
|
||||
|
||||
pcmdpriv->cmd_issued_cnt = pcmdpriv->cmd_done_cnt = pcmdpriv->rsp_cnt = 0;
|
||||
|
||||
pcmdpriv->cmd_issued_cnt = 0;
|
||||
pcmdpriv->cmd_done_cnt = 0;
|
||||
pcmdpriv->rsp_cnt = 0;
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
static void c2h_wk_callback(struct work_struct *work);
|
||||
|
@ -113,16 +111,13 @@ _func_enter_;
|
|||
rtw_msleep_os(10);
|
||||
|
||||
while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
|
||||
void *c2h;
|
||||
if ((c2h = rtw_cbuf_pop(pevtpriv->c2h_queue)) != NULL
|
||||
&& c2h != (void *)pevtpriv) {
|
||||
void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
|
||||
if (c2h != NULL && c2h != (void *)pevtpriv)
|
||||
rtw_mfree(c2h, 16);
|
||||
}
|
||||
}
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-_rtw_free_evt_priv\n"));
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv)
|
||||
|
@ -187,10 +182,9 @@ _func_enter_;
|
|||
|
||||
/* _enter_critical_bh(&(queue->lock), &irqL); */
|
||||
_enter_critical(&queue->lock, &irqL);
|
||||
if (rtw_is_list_empty(&(queue->queue)))
|
||||
if (rtw_is_list_empty(&(queue->queue))) {
|
||||
obj = NULL;
|
||||
else
|
||||
{
|
||||
} else {
|
||||
obj = LIST_CONTAINOR(get_next(&(queue->queue)), struct cmd_obj, list);
|
||||
rtw_list_delete(&obj->list);
|
||||
}
|
||||
|
@ -255,8 +249,8 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|||
if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
|
||||
bAllow = true;
|
||||
|
||||
if ((pcmdpriv->padapter->hw_init_completed ==false && bAllow == false) ||
|
||||
pcmdpriv->cmdthd_running== false) /* com_thread not running */
|
||||
if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
|
||||
!pcmdpriv->cmdthd_running) /* com_thread not running */
|
||||
return _FAIL;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
@ -268,13 +262,13 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if (cmd_obj == NULL) {
|
||||
if (cmd_obj == NULL)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
cmd_obj->padapter = padapter;
|
||||
|
||||
if ( _FAIL == (res=rtw_cmd_filter(pcmdpriv, cmd_obj)) ) {
|
||||
res = rtw_cmd_filter(pcmdpriv, cmd_obj);
|
||||
if (_FAIL == res) {
|
||||
rtw_free_cmd_obj(cmd_obj);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -315,16 +309,13 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
|
|||
{
|
||||
_func_enter_;
|
||||
|
||||
if ((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_))
|
||||
{
|
||||
if ((pcmd->cmdcode != _JoinBss_CMD_) && (pcmd->cmdcode != _CreateBss_CMD_)) {
|
||||
/* free parmbuf in cmd_obj */
|
||||
rtw_mfree((unsigned char *)pcmd->parmbuf, pcmd->cmdsz);
|
||||
}
|
||||
|
||||
if (pcmd->rsp!=NULL)
|
||||
{
|
||||
if (pcmd->rspsz!= 0)
|
||||
{
|
||||
if (pcmd->rsp != NULL) {
|
||||
if (pcmd->rspsz != 0) {
|
||||
/* free rsp in cmd_obj */
|
||||
rtw_mfree((unsigned char *)pcmd->rsp, pcmd->rspsz);
|
||||
}
|
||||
|
@ -357,27 +348,26 @@ _func_enter_;
|
|||
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (1) {
|
||||
if (_rtw_down_sema(&pcmdpriv->cmd_queue_sema) == _FAIL)
|
||||
break;
|
||||
|
||||
if ((padapter->bDriverStopped == true)||(padapter->bSurpriseRemoved == true))
|
||||
{
|
||||
if (padapter->bDriverStopped ||
|
||||
padapter->bSurpriseRemoved) {
|
||||
DBG_88E("%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
|
||||
__func__, padapter->bDriverStopped, padapter->bSurpriseRemoved, __LINE__);
|
||||
break;
|
||||
}
|
||||
|
||||
_next:
|
||||
if ((padapter->bDriverStopped == true)||(padapter->bSurpriseRemoved== true))
|
||||
{
|
||||
if (padapter->bDriverStopped ||
|
||||
padapter->bSurpriseRemoved) {
|
||||
DBG_88E("%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
|
||||
__func__, padapter->bDriverStopped, padapter->bSurpriseRemoved, __LINE__);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(pcmd = rtw_dequeue_cmd(pcmdpriv)))
|
||||
pcmd = rtw_dequeue_cmd(pcmdpriv);
|
||||
if (!pcmd)
|
||||
continue;
|
||||
|
||||
if (_FAIL == rtw_cmd_filter(pcmdpriv, pcmd)) {
|
||||
|
@ -391,20 +381,16 @@ _next:
|
|||
|
||||
_rtw_memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
|
||||
|
||||
if (pcmd->cmdcode <= (sizeof(wlancmds) /sizeof(struct cmd_hdl)))
|
||||
{
|
||||
if (pcmd->cmdcode <= (sizeof(wlancmds) / sizeof(struct cmd_hdl))) {
|
||||
cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
|
||||
|
||||
if (cmd_hdl)
|
||||
{
|
||||
if (cmd_hdl) {
|
||||
ret = cmd_hdl(pcmd->padapter, pcmdbuf);
|
||||
pcmd->res = ret;
|
||||
}
|
||||
|
||||
pcmdpriv->cmd_seq++;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
pcmd->res = H2C_PARAMETERS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -413,22 +399,16 @@ _next:
|
|||
post_process:
|
||||
|
||||
/* call callback function for post-processed */
|
||||
if (pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback)))
|
||||
{
|
||||
if (pcmd->cmdcode <= (sizeof(rtw_cmd_callback) / sizeof(struct _cmd_callback))) {
|
||||
pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
|
||||
if (pcmd_callback == NULL)
|
||||
{
|
||||
if (pcmd_callback == NULL) {
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("mlme_cmd_hdl(): pcmd_callback = 0x%p, cmdcode = 0x%x\n", pcmd_callback, pcmd->cmdcode));
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* todo: !!! fill rsp_buf to pcmd->rsp if (pcmd->rsp!= NULL) */
|
||||
pcmd_callback(pcmd->padapter, pcmd);/* need conider that free cmd_obj in rtw_cmd_callback */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("%s: cmdcode = 0x%x callback not defined!\n", __func__, pcmd->cmdcode));
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
}
|
||||
|
@ -436,11 +416,9 @@ post_process:
|
|||
flush_signals_thread();
|
||||
|
||||
goto _next;
|
||||
|
||||
}
|
||||
pcmdpriv->cmdthd_running = false;
|
||||
|
||||
|
||||
/* free all cmd_obj resources */
|
||||
do {
|
||||
pcmd = rtw_dequeue_cmd(pcmdpriv);
|
||||
|
@ -457,7 +435,6 @@ post_process:
|
|||
_func_exit_;
|
||||
|
||||
thread_exit();
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_setstandby_cmd(struct adapter *padapter, uint action)
|
||||
|
@ -575,7 +552,6 @@ _func_enter_;
|
|||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
if (res == _SUCCESS) {
|
||||
|
||||
pmlmepriv->scan_start_time = rtw_get_current_time();
|
||||
|
||||
_set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT);
|
||||
|
@ -672,8 +648,6 @@ u8 rtw_setphy_cmd(struct adapter *padapter, u8 modem, u8 ch)
|
|||
struct cmd_obj *ph2c;
|
||||
struct setphy_parm *psetphypara;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
/* struct mlme_priv *pmlmepriv = &padapter->mlmepriv; */
|
||||
/* struct registry_priv* pregistry_priv = &padapter->registrypriv; */
|
||||
u8 res = _SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -710,6 +684,7 @@ u8 rtw_setbbreg_cmd(struct adapter*padapter, u8 offset, u8 val)
|
|||
struct writeBB_parm *pwritebbparm;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
u8 res = _SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (ph2c == NULL) {
|
||||
|
@ -877,11 +852,10 @@ _func_enter_;
|
|||
|
||||
rtw_led_control(padapter, LED_CTL_START_TO_LINK);
|
||||
|
||||
if (pmlmepriv->assoc_ssid.SsidLength == 0){
|
||||
if (pmlmepriv->assoc_ssid.SsidLength == 0)
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for Any SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
|
||||
} else {
|
||||
else
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
|
||||
}
|
||||
|
||||
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (pcmd == NULL) {
|
||||
|
@ -971,29 +945,23 @@ _func_enter_;
|
|||
|
||||
|
||||
/* for hidden ap to set fw_state here */
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) != true)
|
||||
{
|
||||
switch (ndis_network_mode)
|
||||
{
|
||||
if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE)) {
|
||||
switch (ndis_network_mode) {
|
||||
case Ndis802_11IBSS:
|
||||
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
|
||||
break;
|
||||
|
||||
case Ndis802_11Infrastructure:
|
||||
set_fwstate(pmlmepriv, WIFI_STATION_STATE);
|
||||
break;
|
||||
|
||||
case Ndis802_11APMode:
|
||||
case Ndis802_11AutoUnknown:
|
||||
case Ndis802_11InfrastructureMax:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss;
|
||||
if (psecnetwork==NULL)
|
||||
{
|
||||
if (psecnetwork == NULL) {
|
||||
if (pcmd != NULL)
|
||||
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
|
||||
|
||||
|
@ -1022,43 +990,35 @@ _func_enter_;
|
|||
/* If not, we have to copy the connecting AP's MAC address to it so that */
|
||||
/* the driver just has the bssid information for PMKIDList searching. */
|
||||
|
||||
if ( pmlmepriv->assoc_by_bssid == false )
|
||||
{
|
||||
if (!pmlmepriv->assoc_by_bssid)
|
||||
_rtw_memcpy(&pmlmepriv->assoc_bssid[0], &pnetwork->network.MacAddress[0], ETH_ALEN);
|
||||
}
|
||||
|
||||
psecnetwork->IELength = rtw_restruct_sec_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength);
|
||||
|
||||
|
||||
pqospriv->qos_option = 0;
|
||||
|
||||
if (pregistrypriv->wmm_enable)
|
||||
{
|
||||
if (pregistrypriv->wmm_enable) {
|
||||
u32 tmp_len;
|
||||
|
||||
tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength, psecnetwork->IELength);
|
||||
|
||||
if (psecnetwork->IELength != tmp_len)
|
||||
{
|
||||
if (psecnetwork->IELength != tmp_len) {
|
||||
psecnetwork->IELength = tmp_len;
|
||||
pqospriv->qos_option = 1; /* There is WMM IE in this corresp. beacon */
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
pqospriv->qos_option = 0;/* There is no WMM IE in this corresp. beacon */
|
||||
}
|
||||
}
|
||||
|
||||
phtpriv->ht_option = false;
|
||||
if (pregistrypriv->ht_enable)
|
||||
{
|
||||
if (pregistrypriv->ht_enable) {
|
||||
/* Added by Albert 2010/06/23 */
|
||||
/* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
|
||||
/* Especially for Realtek 8192u SoftAP. */
|
||||
if ((padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_) &&
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_ ))
|
||||
{
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
|
||||
/* rtw_restructure_ht_ie */
|
||||
rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0],
|
||||
pnetwork->network.IELength, &psecnetwork->IELength);
|
||||
|
@ -1210,17 +1170,15 @@ _func_enter_;
|
|||
|
||||
_rtw_memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN);
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
||||
psetstakey_para->algorithm = (unsigned char) psecuritypriv->dot11PrivacyAlgrthm;
|
||||
}else{
|
||||
else
|
||||
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
|
||||
}
|
||||
|
||||
if (unicast_key == true) {
|
||||
if (unicast_key)
|
||||
_rtw_memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
|
||||
} else {
|
||||
else
|
||||
_rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
|
||||
}
|
||||
|
||||
/* jeff: set this becasue at least sw key is ready */
|
||||
padapter->securitypriv.busetkipkey = true;
|
||||
|
@ -1247,12 +1205,9 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if (!enqueue)
|
||||
{
|
||||
if (!enqueue) {
|
||||
clear_cam_entry(padapter, entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (ph2c == NULL) {
|
||||
res = _FAIL;
|
||||
|
@ -1285,9 +1240,7 @@ _func_enter_;
|
|||
psetstakey_para->id = entry;
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
@ -1324,7 +1277,6 @@ _func_enter_;
|
|||
exit:
|
||||
_func_exit_;
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval)
|
||||
|
@ -1363,7 +1315,6 @@ _func_enter_;
|
|||
exit:
|
||||
_func_exit_;
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr)
|
||||
|
@ -1417,7 +1368,6 @@ u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr)
|
|||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
struct cmd_obj *ph2c;
|
||||
struct addBaReq_parm *paddbareq_parm;
|
||||
|
||||
u8 res = _SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
@ -1483,13 +1433,9 @@ _func_enter_;
|
|||
|
||||
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_set_ch_cmd(struct adapter *padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueue)
|
||||
|
@ -1573,8 +1519,7 @@ _func_enter_;
|
|||
}
|
||||
setChannelPlan_param->channel_plan = chplan;
|
||||
|
||||
if (enqueue)
|
||||
{
|
||||
if (enqueue) {
|
||||
/* need enqueue, prepare cmd_obj and enqueue */
|
||||
pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (pcmdobj == NULL) {
|
||||
|
@ -1585,9 +1530,7 @@ _func_enter_;
|
|||
|
||||
init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_SetChannelPlan));
|
||||
res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
|
||||
if (H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param))
|
||||
res = _FAIL;
|
||||
|
@ -1696,10 +1639,7 @@ static void traffic_status_watchdog(struct adapter *padapter)
|
|||
/* */
|
||||
/* Determine if our traffic is busy now */
|
||||
/* */
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED)== true)
|
||||
/*&& !MgntInitAdapterInProgress(pMgntInfo)*/)
|
||||
{
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 ||
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 50)
|
||||
|
@ -1718,8 +1658,7 @@ static void traffic_status_watchdog(struct adapter *padapter)
|
|||
|
||||
/* Higher Tx/Rx data. */
|
||||
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000 )
|
||||
{
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
|
||||
bHigherBusyTraffic = true;
|
||||
|
||||
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
|
||||
|
@ -1735,28 +1674,17 @@ static void traffic_status_watchdog(struct adapter *padapter)
|
|||
/* check traffic for powersaving. */
|
||||
if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
|
||||
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2))
|
||||
{
|
||||
/* DBG_88E("Tx = %d, Rx = %d\n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); */
|
||||
bEnterPS = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
bEnterPS = true;
|
||||
}
|
||||
|
||||
/* LeisurePS only work in infra mode. */
|
||||
if (bEnterPS)
|
||||
{
|
||||
LPS_Enter(padapter);
|
||||
}
|
||||
else
|
||||
{
|
||||
LPS_Leave(padapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
LPS_Leave(padapter);
|
||||
}
|
||||
|
||||
|
@ -1805,33 +1733,27 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)
|
||||
|| (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
|
||||
{
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
|
||||
return;
|
||||
}
|
||||
|
||||
switch (lps_ctrl_type)
|
||||
{
|
||||
switch (lps_ctrl_type) {
|
||||
case LPS_CTRL_SCAN:
|
||||
/* DBG_88E("LPS_CTRL_SCAN\n"); */
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BT_WifiScanNotify(padapter, true);
|
||||
if (BT_1Ant(padapter) == false)
|
||||
#endif
|
||||
{
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
|
||||
{ /* connect */
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
|
||||
/* connect */
|
||||
LPS_Leave(padapter);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LPS_CTRL_JOINBSS:
|
||||
/* DBG_88E("LPS_CTRL_JOINBSS\n"); */
|
||||
LPS_Leave(padapter);
|
||||
break;
|
||||
case LPS_CTRL_CONNECT:
|
||||
/* DBG_88E("LPS_CTRL_CONNECT\n"); */
|
||||
mstatus = 1;/* connect */
|
||||
/* Reset LPS Setting */
|
||||
padapter->pwrctrlpriv.LpsIdleCount = 0;
|
||||
|
@ -1841,7 +1763,6 @@ _func_enter_;
|
|||
#endif
|
||||
break;
|
||||
case LPS_CTRL_DISCONNECT:
|
||||
/* DBG_88E("LPS_CTRL_DISCONNECT\n"); */
|
||||
mstatus = 0;/* disconnect */
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BT_WifiMediaStatusNotify(padapter, mstatus);
|
||||
|
@ -1864,7 +1785,6 @@ _func_enter_;
|
|||
}
|
||||
break;
|
||||
case LPS_CTRL_LEAVE:
|
||||
/* DBG_88E("LPS_CTRL_LEAVE\n"); */
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
BT_LpsLeave(padapter);
|
||||
if (BT_1Ant(padapter) == false)
|
||||
|
@ -1873,7 +1793,6 @@ _func_enter_;
|
|||
LPS_Leave(padapter);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1894,8 +1813,7 @@ _func_enter_;
|
|||
/* if (!pwrctrlpriv->bLeisurePs) */
|
||||
/* return res; */
|
||||
|
||||
if (enqueue)
|
||||
{
|
||||
if (enqueue) {
|
||||
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (ph2c == NULL) {
|
||||
res = _FAIL;
|
||||
|
@ -1916,9 +1834,7 @@ _func_enter_;
|
|||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
lps_ctrl_wk_hdl(padapter, lps_ctrl_type);
|
||||
}
|
||||
|
||||
|
@ -1927,15 +1843,14 @@ exit:
|
|||
_func_exit_;
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
static void rpt_timer_setting_wk_hdl(struct adapter *padapter, u16 minRptTime)
|
||||
static void rpt_timer_setting_wk_hdl(struct adapter *padapter, u16 min_time)
|
||||
{
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RPT_TIMER_SETTING, (u8 *)(&minRptTime));
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RPT_TIMER_SETTING, (u8 *)(&min_time));
|
||||
}
|
||||
|
||||
u8 rtw_rpt_timer_cfg_cmd(struct adapter*padapter, u16 minRptTime)
|
||||
u8 rtw_rpt_timer_cfg_cmd(struct adapter *padapter, u16 min_time)
|
||||
{
|
||||
struct cmd_obj *ph2c;
|
||||
struct drvextra_cmd_parm *pdrvextra_cmd_parm;
|
||||
|
@ -1958,7 +1873,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
pdrvextra_cmd_parm->ec_id = RTP_TIMER_CFG_WK_CID;
|
||||
pdrvextra_cmd_parm->type_size = minRptTime;
|
||||
pdrvextra_cmd_parm->type_size = min_time;
|
||||
pdrvextra_cmd_parm->pbuf = NULL;
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
@ -1967,7 +1882,6 @@ exit:
|
|||
_func_exit_;
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
static void antenna_select_wk_hdl(struct adapter *padapter, u8 antenna)
|
||||
|
@ -1980,15 +1894,15 @@ u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue)
|
|||
struct cmd_obj *ph2c;
|
||||
struct drvextra_cmd_parm *pdrvextra_cmd_parm;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
u8 bSupportAntDiv = false;
|
||||
u8 support_ant_div;
|
||||
u8 res = _SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv));
|
||||
if (false == bSupportAntDiv ) return res;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &support_ant_div);
|
||||
if (!support_ant_div)
|
||||
return res;
|
||||
|
||||
if (true == enqueue)
|
||||
{
|
||||
if (enqueue) {
|
||||
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (ph2c == NULL) {
|
||||
res = _FAIL;
|
||||
|
@ -2008,8 +1922,7 @@ _func_enter_;
|
|||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
antenna_select_wk_hdl(padapter, antenna);
|
||||
}
|
||||
exit:
|
||||
|
@ -2017,7 +1930,6 @@ exit:
|
|||
_func_exit_;
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
void power_saving_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
|
||||
|
@ -2037,9 +1949,7 @@ u8 p2p_protocol_wk_cmd(struct adapter*padapter, int intCmdType )
|
|||
_func_enter_;
|
||||
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (ph2c == NULL) {
|
||||
|
@ -2067,7 +1977,6 @@ exit:
|
|||
_func_exit_;
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
|
@ -2104,7 +2013,6 @@ exit:
|
|||
_func_exit_;
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
@ -2119,8 +2027,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
|
|||
if (!psta_bmc)
|
||||
return;
|
||||
|
||||
if (psta_bmc->sleepq_len==0)
|
||||
{
|
||||
if (psta_bmc->sleepq_len == 0) {
|
||||
u8 val = 0;
|
||||
|
||||
/* while ((rtw_read32(padapter, 0x414)&0x00ffff00)!= 0) */
|
||||
|
@ -2128,8 +2035,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
|
|||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
|
||||
|
||||
while (false == val)
|
||||
{
|
||||
while (!val) {
|
||||
rtw_msleep_os(100);
|
||||
|
||||
cnt++;
|
||||
|
@ -2140,20 +2046,15 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
|
|||
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
|
||||
}
|
||||
|
||||
if (cnt<=10)
|
||||
{
|
||||
if (cnt <= 10) {
|
||||
pstapriv->tim_bitmap &= ~BIT(0);
|
||||
pstapriv->sta_dz_bitmap &= ~BIT(0);
|
||||
|
||||
update_beacon(padapter, _TIM_IE_, NULL, false);
|
||||
}
|
||||
else /* re check again */
|
||||
{
|
||||
} else { /* re check again */
|
||||
rtw_chk_hi_queue_cmd(padapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_chk_hi_queue_cmd(struct adapter *padapter)
|
||||
|
@ -2183,11 +2084,8 @@ u8 rtw_chk_hi_queue_cmd(struct adapter*padapter)
|
|||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
exit:
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2240,7 +2138,6 @@ static s32 c2h_evt_hdl(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h
|
|||
ret = rtw_hal_c2h_handler(adapter, c2h_evt);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (filter && filter(c2h_evt->id) == false)
|
||||
goto exit;
|
||||
|
||||
|
@ -2300,8 +2197,7 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
|
|||
|
||||
pdrvextra_cmd = (struct drvextra_cmd_parm *)pbuf;
|
||||
|
||||
switch (pdrvextra_cmd->ec_id)
|
||||
{
|
||||
switch (pdrvextra_cmd->ec_id) {
|
||||
case DYNAMIC_CHK_WK_CID:
|
||||
dynamic_chk_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
|
||||
break;
|
||||
|
@ -2333,15 +2229,12 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
|
|||
case C2H_WK_CID:
|
||||
c2h_evt_hdl(padapter, (struct c2h_evt_hdr *)pdrvextra_cmd->pbuf, NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (pdrvextra_cmd->pbuf && pdrvextra_cmd->type_size > 0)
|
||||
{
|
||||
rtw_mfree(pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
|
||||
}
|
||||
|
||||
return H2C_SUCCESS;
|
||||
}
|
||||
|
@ -2352,13 +2245,11 @@ void rtw_survey_cmd_callback(struct adapter* padapter , struct cmd_obj *pcmd)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if (pcmd->res == H2C_DROPPED)
|
||||
{
|
||||
if (pcmd->res == H2C_DROPPED) {
|
||||
/* TODO: cancel timer and do timeout handler directly... */
|
||||
/* need to make timeout handlerOS independent */
|
||||
_set_timer(&pmlmepriv->scan_to_timer, 1);
|
||||
}
|
||||
else if (pcmd->res != H2C_SUCCESS) {
|
||||
} else if (pcmd->res != H2C_SUCCESS) {
|
||||
_set_timer(&pmlmepriv->scan_to_timer, 1);
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n."));
|
||||
}
|
||||
|
@ -2401,14 +2292,11 @@ void rtw_joinbss_cmd_callback(struct adapter* padapter, struct cmd_obj *pcmd)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if (pcmd->res == H2C_DROPPED)
|
||||
{
|
||||
if (pcmd->res == H2C_DROPPED) {
|
||||
/* TODO: cancel timer and do timeout handler directly... */
|
||||
/* need to make timeout handlerOS independent */
|
||||
_set_timer(&pmlmepriv->assoc_timer, 1);
|
||||
}
|
||||
else if (pcmd->res != H2C_SUCCESS)
|
||||
{
|
||||
} else if (pcmd->res != H2C_SUCCESS) {
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("********Error:rtw_select_and_join_from_scanned_queue Wait Sema Fail ************\n"));
|
||||
_set_timer(&pmlmepriv->assoc_timer, 1);
|
||||
}
|
||||
|
@ -2430,8 +2318,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if ((pcmd->res != H2C_SUCCESS))
|
||||
{
|
||||
if ((pcmd->res != H2C_SUCCESS)) {
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: rtw_createbss_cmd_callback Fail ************\n\n."));
|
||||
_set_timer(&pmlmepriv->assoc_timer, 1);
|
||||
}
|
||||
|
@ -2456,19 +2343,15 @@ _func_enter_;
|
|||
|
||||
pwlan = _rtw_alloc_network(pmlmepriv);
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
if ( pwlan == NULL)
|
||||
{
|
||||
if (pwlan == NULL) {
|
||||
pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue);
|
||||
if ( pwlan == NULL)
|
||||
{
|
||||
if (pwlan == NULL) {
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n Error: can't get pwlan in rtw_joinbss_event_callback\n"));
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
goto createbss_cmd_fail;
|
||||
}
|
||||
pwlan->last_scanned = rtw_get_current_time();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue);
|
||||
}
|
||||
|
||||
|
@ -2490,22 +2373,17 @@ createbss_cmd_fail:
|
|||
rtw_free_cmd_obj(pcmd);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void rtw_setstaKey_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
|
||||
{
|
||||
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct set_stakey_rsp *psetstakey_rsp = (struct set_stakey_rsp *)(pcmd->rsp);
|
||||
struct sta_info *psta = rtw_get_stainfo(pstapriv, psetstakey_rsp->addr);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (psta==NULL)
|
||||
{
|
||||
if (psta == NULL) {
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n"));
|
||||
goto exit;
|
||||
}
|
||||
|
@ -2525,13 +2403,13 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter* padapter, struct cmd_obj *
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if (psta==NULL)
|
||||
{
|
||||
if (psta == NULL) {
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info\n\n"));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psta->aid = psta->mac_id = passocsta_rsp->cam_id;
|
||||
psta->aid = passocsta_rsp->cam_id;
|
||||
psta->mac_id = passocsta_rsp->cam_id;
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
|
@ -2547,7 +2425,6 @@ exit:
|
|||
_func_exit_;
|
||||
}
|
||||
|
||||
void rtw_getrttbl_cmd_cmdrsp_callback(struct adapter* padapter, struct cmd_obj *pcmd);
|
||||
void rtw_getrttbl_cmd_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
|
||||
{
|
||||
_func_enter_;
|
||||
|
|
Loading…
Reference in a new issue