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:
Larry Finger 2013-07-27 14:49:25 -05:00
parent 29ada234b0
commit a839bebbbd

View file

@ -71,14 +71,12 @@ _func_enter_;
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3); 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: exit:
_func_exit_; _func_exit_;
return res; return res;
} }
static void c2h_wk_callback(struct work_struct *work); static void c2h_wk_callback(struct work_struct *work);
@ -113,16 +111,13 @@ _func_enter_;
rtw_msleep_os(10); rtw_msleep_os(10);
while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) { while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
void *c2h; void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
if ((c2h = rtw_cbuf_pop(pevtpriv->c2h_queue)) != NULL if (c2h != NULL && c2h != (void *)pevtpriv)
&& c2h != (void *)pevtpriv) {
rtw_mfree(c2h, 16); rtw_mfree(c2h, 16);
} }
}
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-_rtw_free_evt_priv\n")); RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-_rtw_free_evt_priv\n"));
_func_exit_; _func_exit_;
} }
void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv)
@ -187,10 +182,9 @@ _func_enter_;
/* _enter_critical_bh(&(queue->lock), &irqL); */ /* _enter_critical_bh(&(queue->lock), &irqL); */
_enter_critical(&queue->lock, &irqL); _enter_critical(&queue->lock, &irqL);
if (rtw_is_list_empty(&(queue->queue))) if (rtw_is_list_empty(&(queue->queue))) {
obj = NULL; obj = NULL;
else } else {
{
obj = LIST_CONTAINOR(get_next(&(queue->queue)), struct cmd_obj, list); obj = LIST_CONTAINOR(get_next(&(queue->queue)), struct cmd_obj, list);
rtw_list_delete(&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)) if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
bAllow = true; bAllow = true;
if ((pcmdpriv->padapter->hw_init_completed ==false && bAllow == false) || if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
pcmdpriv->cmdthd_running== false) /* com_thread not running */ !pcmdpriv->cmdthd_running) /* com_thread not running */
return _FAIL; return _FAIL;
return _SUCCESS; return _SUCCESS;
} }
@ -268,13 +262,13 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
_func_enter_; _func_enter_;
if (cmd_obj == NULL) { if (cmd_obj == NULL)
goto exit; goto exit;
}
cmd_obj->padapter = padapter; 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); rtw_free_cmd_obj(cmd_obj);
goto exit; goto exit;
} }
@ -315,16 +309,13 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
{ {
_func_enter_; _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 */ /* free parmbuf in cmd_obj */
rtw_mfree((unsigned char *)pcmd->parmbuf, pcmd->cmdsz); rtw_mfree((unsigned char *)pcmd->parmbuf, pcmd->cmdsz);
} }
if (pcmd->rsp!=NULL) if (pcmd->rsp != NULL) {
{ if (pcmd->rspsz != 0) {
if (pcmd->rspsz!= 0)
{
/* free rsp in cmd_obj */ /* free rsp in cmd_obj */
rtw_mfree((unsigned char *)pcmd->rsp, pcmd->rspsz); 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")); 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) if (_rtw_down_sema(&pcmdpriv->cmd_queue_sema) == _FAIL)
break; 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", DBG_88E("%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
__func__, padapter->bDriverStopped, padapter->bSurpriseRemoved, __LINE__); __func__, padapter->bDriverStopped, padapter->bSurpriseRemoved, __LINE__);
break; break;
} }
_next: _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", DBG_88E("%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
__func__, padapter->bDriverStopped, padapter->bSurpriseRemoved, __LINE__); __func__, padapter->bDriverStopped, padapter->bSurpriseRemoved, __LINE__);
break; break;
} }
if (!(pcmd = rtw_dequeue_cmd(pcmdpriv))) pcmd = rtw_dequeue_cmd(pcmdpriv);
if (!pcmd)
continue; continue;
if (_FAIL == rtw_cmd_filter(pcmdpriv, pcmd)) { if (_FAIL == rtw_cmd_filter(pcmdpriv, pcmd)) {
@ -391,20 +381,16 @@ _next:
_rtw_memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz); _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; cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
if (cmd_hdl) if (cmd_hdl) {
{
ret = cmd_hdl(pcmd->padapter, pcmdbuf); ret = cmd_hdl(pcmd->padapter, pcmdbuf);
pcmd->res = ret; pcmd->res = ret;
} }
pcmdpriv->cmd_seq++; pcmdpriv->cmd_seq++;
} } else {
else
{
pcmd->res = H2C_PARAMETERS_ERROR; pcmd->res = H2C_PARAMETERS_ERROR;
} }
@ -413,22 +399,16 @@ _next:
post_process: post_process:
/* call callback function for post-processed */ /* 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; 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)); 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); rtw_free_cmd_obj(pcmd);
} } else {
else
{
/* todo: !!! fill rsp_buf to pcmd->rsp if (pcmd->rsp!= NULL) */ /* 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 */ 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)); RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("%s: cmdcode = 0x%x callback not defined!\n", __func__, pcmd->cmdcode));
rtw_free_cmd_obj(pcmd); rtw_free_cmd_obj(pcmd);
} }
@ -436,11 +416,9 @@ post_process:
flush_signals_thread(); flush_signals_thread();
goto _next; goto _next;
} }
pcmdpriv->cmdthd_running = false; pcmdpriv->cmdthd_running = false;
/* free all cmd_obj resources */ /* free all cmd_obj resources */
do { do {
pcmd = rtw_dequeue_cmd(pcmdpriv); pcmd = rtw_dequeue_cmd(pcmdpriv);
@ -457,7 +435,6 @@ post_process:
_func_exit_; _func_exit_;
thread_exit(); thread_exit();
} }
u8 rtw_setstandby_cmd(struct adapter *padapter, uint action) u8 rtw_setstandby_cmd(struct adapter *padapter, uint action)
@ -575,7 +552,6 @@ _func_enter_;
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
if (res == _SUCCESS) { if (res == _SUCCESS) {
pmlmepriv->scan_start_time = rtw_get_current_time(); pmlmepriv->scan_start_time = rtw_get_current_time();
_set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT); _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 cmd_obj *ph2c;
struct setphy_parm *psetphypara; struct setphy_parm *psetphypara;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
/* struct mlme_priv *pmlmepriv = &padapter->mlmepriv; */
/* struct registry_priv* pregistry_priv = &padapter->registrypriv; */
u8 res = _SUCCESS; u8 res = _SUCCESS;
_func_enter_; _func_enter_;
@ -710,6 +684,7 @@ u8 rtw_setbbreg_cmd(struct adapter*padapter, u8 offset, u8 val)
struct writeBB_parm *pwritebbparm; struct writeBB_parm *pwritebbparm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS; u8 res = _SUCCESS;
_func_enter_; _func_enter_;
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (ph2c == NULL) { if (ph2c == NULL) {
@ -877,11 +852,10 @@ _func_enter_;
rtw_led_control(padapter, LED_CTL_START_TO_LINK); 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)); 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)); 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)); pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd == NULL) { if (pcmd == NULL) {
@ -971,29 +945,23 @@ _func_enter_;
/* for hidden ap to set fw_state here */ /* for hidden ap to set fw_state here */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE)) {
{ switch (ndis_network_mode) {
switch (ndis_network_mode)
{
case Ndis802_11IBSS: case Ndis802_11IBSS:
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
break; break;
case Ndis802_11Infrastructure: case Ndis802_11Infrastructure:
set_fwstate(pmlmepriv, WIFI_STATION_STATE); set_fwstate(pmlmepriv, WIFI_STATION_STATE);
break; break;
case Ndis802_11APMode: case Ndis802_11APMode:
case Ndis802_11AutoUnknown: case Ndis802_11AutoUnknown:
case Ndis802_11InfrastructureMax: case Ndis802_11InfrastructureMax:
break; break;
} }
} }
psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss; psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss;
if (psecnetwork==NULL) if (psecnetwork == NULL) {
{
if (pcmd != NULL) if (pcmd != NULL)
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj)); 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 */ /* 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. */ /* 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); _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); psecnetwork->IELength = rtw_restruct_sec_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength);
pqospriv->qos_option = 0; pqospriv->qos_option = 0;
if (pregistrypriv->wmm_enable) if (pregistrypriv->wmm_enable) {
{
u32 tmp_len; u32 tmp_len;
tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength, psecnetwork->IELength); 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; psecnetwork->IELength = tmp_len;
pqospriv->qos_option = 1; /* There is WMM IE in this corresp. beacon */ 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 */ pqospriv->qos_option = 0;/* There is no WMM IE in this corresp. beacon */
} }
} }
phtpriv->ht_option = false; phtpriv->ht_option = false;
if (pregistrypriv->ht_enable) if (pregistrypriv->ht_enable) {
{
/* Added by Albert 2010/06/23 */ /* 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. */ /* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
/* Especially for Realtek 8192u SoftAP. */ /* Especially for Realtek 8192u SoftAP. */
if ((padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_) && if ((padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_) &&
(padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) && (padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
( padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_ )) (padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
{
/* rtw_restructure_ht_ie */ /* rtw_restructure_ht_ie */
rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], rtw_restructure_ht_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0],
pnetwork->network.IELength, &psecnetwork->IELength); pnetwork->network.IELength, &psecnetwork->IELength);
@ -1210,17 +1170,15 @@ _func_enter_;
_rtw_memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN); _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; psetstakey_para->algorithm = (unsigned char) psecuritypriv->dot11PrivacyAlgrthm;
}else{ else
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false); 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); _rtw_memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
} else { else
_rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16); _rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
}
/* jeff: set this becasue at least sw key is ready */ /* jeff: set this becasue at least sw key is ready */
padapter->securitypriv.busetkipkey = true; padapter->securitypriv.busetkipkey = true;
@ -1247,12 +1205,9 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue)
_func_enter_; _func_enter_;
if (!enqueue) if (!enqueue) {
{
clear_cam_entry(padapter, entry); clear_cam_entry(padapter, entry);
} } else {
else
{
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (ph2c == NULL) { if (ph2c == NULL) {
res = _FAIL; res = _FAIL;
@ -1285,9 +1240,7 @@ _func_enter_;
psetstakey_para->id = entry; psetstakey_para->id = entry;
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
} }
exit: exit:
_func_exit_; _func_exit_;
@ -1324,7 +1277,6 @@ _func_enter_;
exit: exit:
_func_exit_; _func_exit_;
return res; return res;
} }
u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval) u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval)
@ -1363,7 +1315,6 @@ _func_enter_;
exit: exit:
_func_exit_; _func_exit_;
return res; return res;
} }
u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr) 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_priv *pcmdpriv = &padapter->cmdpriv;
struct cmd_obj *ph2c; struct cmd_obj *ph2c;
struct addBaReq_parm *paddbareq_parm; struct addBaReq_parm *paddbareq_parm;
u8 res = _SUCCESS; u8 res = _SUCCESS;
_func_enter_; _func_enter_;
@ -1483,13 +1433,9 @@ _func_enter_;
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */ /* rtw_enqueue_cmd(pcmdpriv, ph2c); */
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit: exit:
_func_exit_; _func_exit_;
return res; return res;
} }
u8 rtw_set_ch_cmd(struct adapter *padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueue) 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; setChannelPlan_param->channel_plan = chplan;
if (enqueue) if (enqueue) {
{
/* need enqueue, prepare cmd_obj and enqueue */ /* need enqueue, prepare cmd_obj and enqueue */
pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmdobj == NULL) { if (pcmdobj == NULL) {
@ -1585,9 +1530,7 @@ _func_enter_;
init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_SetChannelPlan)); init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelPlan_param, GEN_CMD_CODE(_SetChannelPlan));
res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
} } else {
else
{
/* no need to enqueue, do the cmd hdl directly and free cmd parameter */ /* no need to enqueue, do the cmd hdl directly and free cmd parameter */
if (H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param)) if (H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param))
res = _FAIL; res = _FAIL;
@ -1696,10 +1639,7 @@ static void traffic_status_watchdog(struct adapter *padapter)
/* */ /* */
/* Determine if our traffic is busy now */ /* Determine if our traffic is busy now */
/* */ /* */
if ((check_fwstate(pmlmepriv, _FW_LINKED)== true) if (check_fwstate(pmlmepriv, _FW_LINKED)) {
/*&& !MgntInitAdapterInProgress(pMgntInfo)*/)
{
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 || if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 50) pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 50)
@ -1718,8 +1658,7 @@ static void traffic_status_watchdog(struct adapter *padapter)
/* Higher Tx/Rx data. */ /* Higher Tx/Rx data. */
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 || if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000 ) pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
{
bHigherBusyTraffic = true; bHigherBusyTraffic = true;
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
@ -1735,28 +1674,17 @@ static void traffic_status_watchdog(struct adapter *padapter)
/* check traffic for powersaving. */ /* check traffic for powersaving. */
if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) || if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2))
{
/* DBG_88E("Tx = %d, Rx = %d\n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); */
bEnterPS = false; bEnterPS = false;
}
else else
{
bEnterPS = true; bEnterPS = true;
}
/* LeisurePS only work in infra mode. */ /* LeisurePS only work in infra mode. */
if (bEnterPS) if (bEnterPS)
{
LPS_Enter(padapter); LPS_Enter(padapter);
}
else else
{
LPS_Leave(padapter); LPS_Leave(padapter);
} }
} } else {
}
else
{
LPS_Leave(padapter); LPS_Leave(padapter);
} }
@ -1805,33 +1733,27 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
_func_enter_; _func_enter_;
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
|| (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
{
return; return;
}
switch (lps_ctrl_type) switch (lps_ctrl_type) {
{
case LPS_CTRL_SCAN: case LPS_CTRL_SCAN:
/* DBG_88E("LPS_CTRL_SCAN\n"); */
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
BT_WifiScanNotify(padapter, true); BT_WifiScanNotify(padapter, true);
if (BT_1Ant(padapter) == false) if (BT_1Ant(padapter) == false)
#endif #endif
{ {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
{ /* connect */ /* connect */
LPS_Leave(padapter); LPS_Leave(padapter);
} }
} }
break; break;
case LPS_CTRL_JOINBSS: case LPS_CTRL_JOINBSS:
/* DBG_88E("LPS_CTRL_JOINBSS\n"); */
LPS_Leave(padapter); LPS_Leave(padapter);
break; break;
case LPS_CTRL_CONNECT: case LPS_CTRL_CONNECT:
/* DBG_88E("LPS_CTRL_CONNECT\n"); */
mstatus = 1;/* connect */ mstatus = 1;/* connect */
/* Reset LPS Setting */ /* Reset LPS Setting */
padapter->pwrctrlpriv.LpsIdleCount = 0; padapter->pwrctrlpriv.LpsIdleCount = 0;
@ -1841,7 +1763,6 @@ _func_enter_;
#endif #endif
break; break;
case LPS_CTRL_DISCONNECT: case LPS_CTRL_DISCONNECT:
/* DBG_88E("LPS_CTRL_DISCONNECT\n"); */
mstatus = 0;/* disconnect */ mstatus = 0;/* disconnect */
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
BT_WifiMediaStatusNotify(padapter, mstatus); BT_WifiMediaStatusNotify(padapter, mstatus);
@ -1864,7 +1785,6 @@ _func_enter_;
} }
break; break;
case LPS_CTRL_LEAVE: case LPS_CTRL_LEAVE:
/* DBG_88E("LPS_CTRL_LEAVE\n"); */
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
BT_LpsLeave(padapter); BT_LpsLeave(padapter);
if (BT_1Ant(padapter) == false) if (BT_1Ant(padapter) == false)
@ -1873,7 +1793,6 @@ _func_enter_;
LPS_Leave(padapter); LPS_Leave(padapter);
} }
break; break;
default: default:
break; break;
} }
@ -1894,8 +1813,7 @@ _func_enter_;
/* if (!pwrctrlpriv->bLeisurePs) */ /* if (!pwrctrlpriv->bLeisurePs) */
/* return res; */ /* return res; */
if (enqueue) if (enqueue) {
{
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (ph2c == NULL) { if (ph2c == NULL) {
res = _FAIL; res = _FAIL;
@ -1916,9 +1834,7 @@ _func_enter_;
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
} } else {
else
{
lps_ctrl_wk_hdl(padapter, lps_ctrl_type); lps_ctrl_wk_hdl(padapter, lps_ctrl_type);
} }
@ -1927,15 +1843,14 @@ exit:
_func_exit_; _func_exit_;
return res; 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 cmd_obj *ph2c;
struct drvextra_cmd_parm *pdrvextra_cmd_parm; 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->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; pdrvextra_cmd_parm->pbuf = NULL;
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
@ -1967,7 +1882,6 @@ exit:
_func_exit_; _func_exit_;
return res; return res;
} }
static void antenna_select_wk_hdl(struct adapter *padapter, u8 antenna) 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 cmd_obj *ph2c;
struct drvextra_cmd_parm *pdrvextra_cmd_parm; struct drvextra_cmd_parm *pdrvextra_cmd_parm;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 bSupportAntDiv = false; u8 support_ant_div;
u8 res = _SUCCESS; u8 res = _SUCCESS;
_func_enter_; _func_enter_;
rtw_hal_get_def_var(padapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv)); rtw_hal_get_def_var(padapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &support_ant_div);
if (false == bSupportAntDiv ) return res; if (!support_ant_div)
return res;
if (true == enqueue) if (enqueue) {
{
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (ph2c == NULL) { if (ph2c == NULL) {
res = _FAIL; res = _FAIL;
@ -2008,8 +1922,7 @@ _func_enter_;
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
} } else {
else{
antenna_select_wk_hdl(padapter, antenna); antenna_select_wk_hdl(padapter, antenna);
} }
exit: exit:
@ -2017,7 +1930,6 @@ exit:
_func_exit_; _func_exit_;
return res; return res;
} }
void power_saving_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) 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_; _func_enter_;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
return res; return res;
}
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (ph2c == NULL) { if (ph2c == NULL) {
@ -2067,7 +1977,6 @@ exit:
_func_exit_; _func_exit_;
return res; return res;
} }
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
@ -2104,7 +2013,6 @@ exit:
_func_exit_; _func_exit_;
return res; return res;
} }
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
@ -2119,8 +2027,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
if (!psta_bmc) if (!psta_bmc)
return; return;
if (psta_bmc->sleepq_len==0) if (psta_bmc->sleepq_len == 0) {
{
u8 val = 0; u8 val = 0;
/* while ((rtw_read32(padapter, 0x414)&0x00ffff00)!= 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); rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
while (false == val) while (!val) {
{
rtw_msleep_os(100); rtw_msleep_os(100);
cnt++; 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); rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
} }
if (cnt<=10) if (cnt <= 10) {
{
pstapriv->tim_bitmap &= ~BIT(0); pstapriv->tim_bitmap &= ~BIT(0);
pstapriv->sta_dz_bitmap &= ~BIT(0); pstapriv->sta_dz_bitmap &= ~BIT(0);
update_beacon(padapter, _TIM_IE_, NULL, false); update_beacon(padapter, _TIM_IE_, NULL, false);
} } else { /* re check again */
else /* re check again */
{
rtw_chk_hi_queue_cmd(padapter); rtw_chk_hi_queue_cmd(padapter);
} }
} }
} }
u8 rtw_chk_hi_queue_cmd(struct adapter *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)); init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit: exit:
return res; return res;
} }
#endif #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); ret = rtw_hal_c2h_handler(adapter, c2h_evt);
} }
} else { } else {
if (filter && filter(c2h_evt->id) == false) if (filter && filter(c2h_evt->id) == false)
goto exit; goto exit;
@ -2300,8 +2197,7 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
pdrvextra_cmd = (struct drvextra_cmd_parm *)pbuf; pdrvextra_cmd = (struct drvextra_cmd_parm *)pbuf;
switch (pdrvextra_cmd->ec_id) switch (pdrvextra_cmd->ec_id) {
{
case DYNAMIC_CHK_WK_CID: case DYNAMIC_CHK_WK_CID:
dynamic_chk_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size); dynamic_chk_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
break; break;
@ -2333,15 +2229,12 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
case C2H_WK_CID: case C2H_WK_CID:
c2h_evt_hdl(padapter, (struct c2h_evt_hdr *)pdrvextra_cmd->pbuf, NULL); c2h_evt_hdl(padapter, (struct c2h_evt_hdr *)pdrvextra_cmd->pbuf, NULL);
break; break;
default: default:
break; break;
} }
if (pdrvextra_cmd->pbuf && pdrvextra_cmd->type_size > 0) if (pdrvextra_cmd->pbuf && pdrvextra_cmd->type_size > 0)
{
rtw_mfree(pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size); rtw_mfree(pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
}
return H2C_SUCCESS; return H2C_SUCCESS;
} }
@ -2352,13 +2245,11 @@ void rtw_survey_cmd_callback(struct adapter* padapter , struct cmd_obj *pcmd)
_func_enter_; _func_enter_;
if (pcmd->res == H2C_DROPPED) if (pcmd->res == H2C_DROPPED) {
{
/* TODO: cancel timer and do timeout handler directly... */ /* TODO: cancel timer and do timeout handler directly... */
/* need to make timeout handlerOS independent */ /* need to make timeout handlerOS independent */
_set_timer(&pmlmepriv->scan_to_timer, 1); _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); _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.")); 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_; _func_enter_;
if (pcmd->res == H2C_DROPPED) if (pcmd->res == H2C_DROPPED) {
{
/* TODO: cancel timer and do timeout handler directly... */ /* TODO: cancel timer and do timeout handler directly... */
/* need to make timeout handlerOS independent */ /* need to make timeout handlerOS independent */
_set_timer(&pmlmepriv->assoc_timer, 1); _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")); 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); _set_timer(&pmlmepriv->assoc_timer, 1);
} }
@ -2430,8 +2318,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
_func_enter_; _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.")); RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: rtw_createbss_cmd_callback Fail ************\n\n."));
_set_timer(&pmlmepriv->assoc_timer, 1); _set_timer(&pmlmepriv->assoc_timer, 1);
} }
@ -2456,19 +2343,15 @@ _func_enter_;
pwlan = _rtw_alloc_network(pmlmepriv); pwlan = _rtw_alloc_network(pmlmepriv);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
if ( pwlan == NULL) if (pwlan == NULL) {
{
pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue); 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")); 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); _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
goto createbss_cmd_fail; goto createbss_cmd_fail;
} }
pwlan->last_scanned = rtw_get_current_time(); pwlan->last_scanned = rtw_get_current_time();
} } else {
else
{
rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue); rtw_list_insert_tail(&(pwlan->list), &pmlmepriv->scanned_queue.queue);
} }
@ -2490,22 +2373,17 @@ createbss_cmd_fail:
rtw_free_cmd_obj(pcmd); rtw_free_cmd_obj(pcmd);
_func_exit_; _func_exit_;
} }
void rtw_setstaKey_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd) void rtw_setstaKey_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
{ {
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
struct set_stakey_rsp *psetstakey_rsp = (struct set_stakey_rsp *)(pcmd->rsp); struct set_stakey_rsp *psetstakey_rsp = (struct set_stakey_rsp *)(pcmd->rsp);
struct sta_info *psta = rtw_get_stainfo(pstapriv, psetstakey_rsp->addr); struct sta_info *psta = rtw_get_stainfo(pstapriv, psetstakey_rsp->addr);
_func_enter_; _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")); RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n"));
goto exit; goto exit;
} }
@ -2525,13 +2403,13 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter* padapter, struct cmd_obj *
_func_enter_; _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")); RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info\n\n"));
goto exit; 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); _enter_critical_bh(&pmlmepriv->lock, &irqL);
@ -2547,7 +2425,6 @@ exit:
_func_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) void rtw_getrttbl_cmd_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
{ {
_func_enter_; _func_enter_;