diff options
Diffstat (limited to 'drivers/staging/rtl8188eu/core/rtw_mlme_ext.c')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 99 |
1 files changed, 43 insertions, 56 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 7ab5ff0..6f7e415 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -221,7 +221,7 @@ static void init_mlme_ext_priv_value(struct adapter *padapter) _12M_RATE_, _24M_RATE_, 0xff, }; - ATOMIC_SET(&pmlmeext->event_seq, 0); + atomic_set(&pmlmeext->event_seq, 0); pmlmeext->mgnt_seq = 0;/* reset to zero when disconnect at client mode */ pmlmeext->cur_channel = padapter->registrypriv.channel; @@ -756,7 +756,6 @@ _END_ONBEACON_: unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) { #ifdef CONFIG_88EU_AP_MODE - unsigned long irqL; unsigned int auth_mode, ie_len; u16 seq; unsigned char *sa, *p; @@ -817,24 +816,24 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) pstat->state = WIFI_FW_AUTH_NULL; pstat->auth_seq = 0; } else { - _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); + spin_lock_bh(&pstapriv->asoc_list_lock); if (!rtw_is_list_empty(&pstat->asoc_list)) { rtw_list_delete(&pstat->asoc_list); pstapriv->asoc_list_cnt--; } - _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); + spin_unlock_bh(&pstapriv->asoc_list_lock); if (seq == 1) { /* TODO: STA re_auth and auth timeout */ } } - _enter_critical_bh(&pstapriv->auth_list_lock, &irqL); + spin_lock_bh(&pstapriv->auth_list_lock); if (rtw_is_list_empty(&pstat->auth_list)) { rtw_list_insert_tail(&pstat->auth_list, &pstapriv->auth_list); pstapriv->auth_list_cnt++; } - _exit_critical_bh(&pstapriv->auth_list_lock, &irqL); + spin_unlock_bh(&pstapriv->auth_list_lock); if (pstat->auth_seq == 0) pstat->expire_to = pstapriv->auth_to; @@ -1005,7 +1004,6 @@ authclnt_fail: unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) { #ifdef CONFIG_88EU_AP_MODE - unsigned long irqL; u16 capab_info; struct rtw_ieee802_11_elems elems; struct sta_info *pstat; @@ -1408,20 +1406,20 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) pstat->state &= (~WIFI_FW_ASSOC_STATE); pstat->state |= WIFI_FW_ASSOC_SUCCESS; - _enter_critical_bh(&pstapriv->auth_list_lock, &irqL); + spin_lock_bh(&pstapriv->auth_list_lock); if (!rtw_is_list_empty(&pstat->auth_list)) { rtw_list_delete(&pstat->auth_list); pstapriv->auth_list_cnt--; } - _exit_critical_bh(&pstapriv->auth_list_lock, &irqL); + spin_unlock_bh(&pstapriv->auth_list_lock); - _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); + spin_lock_bh(&pstapriv->asoc_list_lock); if (rtw_is_list_empty(&pstat->asoc_list)) { pstat->expire_to = pstapriv->expire_to; rtw_list_insert_tail(&pstat->asoc_list, &pstapriv->asoc_list); pstapriv->asoc_list_cnt++; } - _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); + spin_unlock_bh(&pstapriv->asoc_list_lock); /* now the station is qualified to join our BSS... */ if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_ == status)) { @@ -1590,7 +1588,6 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_88EU_AP_MODE if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { - unsigned long irqL; struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; @@ -1601,13 +1598,13 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) if (psta) { u8 updated = 0; - _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); + spin_lock_bh(&pstapriv->asoc_list_lock); if (!rtw_is_list_empty(&psta->asoc_list)) { rtw_list_delete(&psta->asoc_list); pstapriv->asoc_list_cnt--; updated = ap_free_sta(padapter, psta, false, reason); } - _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); + spin_unlock_bh(&pstapriv->asoc_list_lock); associated_clients_update(padapter, updated); } @@ -1654,14 +1651,9 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_88EU_AP_MODE if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { - unsigned long irqL; struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; - /* _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */ - /* rtw_free_stainfo(padapter, psta); */ - /* _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */ - DBG_88E_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n", reason, GetAddr2Ptr(pframe)); @@ -1669,13 +1661,13 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame) if (psta) { u8 updated = 0; - _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); + spin_lock_bh(&pstapriv->asoc_list_lock); if (!rtw_is_list_empty(&psta->asoc_list)) { rtw_list_delete(&psta->asoc_list); pstapriv->asoc_list_cnt--; updated = ap_free_sta(padapter, psta, false, reason); } - _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); + spin_unlock_bh(&pstapriv->asoc_list_lock); associated_clients_update(padapter, updated); } @@ -3826,7 +3818,7 @@ int issue_probereq_p2p_ex(struct adapter *adapter, u8 *da, int try_cnt, int wait { int ret; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; do { ret = _issue_probereq_p2p(adapter, da, wait_ms > 0 ? true : false); @@ -3837,7 +3829,7 @@ int issue_probereq_p2p_ex(struct adapter *adapter, u8 *da, int try_cnt, int wait break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); if (ret != _FAIL) { @@ -4419,7 +4411,7 @@ s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntfr if (ret == _SUCCESS) ret = rtw_sctx_wait(&sctx); - return ret; + return ret; } s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe) @@ -4487,9 +4479,6 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) __le16 *fctrl; unsigned int rate_len; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -#if defined(CONFIG_88EU_AP_MODE) - unsigned long irqL; -#endif /* if defined (CONFIG_88EU_AP_MODE) */ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -4505,7 +4494,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) return; } #if defined (CONFIG_88EU_AP_MODE) - _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); + spin_lock_bh(&pmlmepriv->bcn_update_lock); #endif /* if defined (CONFIG_88EU_AP_MODE) */ /* update attribute */ @@ -4690,7 +4679,7 @@ _issue_bcn: #if defined (CONFIG_88EU_AP_MODE) pmlmepriv->update_bcn = false; - _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); + spin_unlock_bh(&pmlmepriv->bcn_update_lock); #endif /* if defined (CONFIG_88EU_AP_MODE) */ if ((pattrib->pktlen + TXDESC_SIZE) > 512) { @@ -4972,7 +4961,7 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, { int ret; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; do { ret = _issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : false); @@ -4983,7 +4972,7 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -5693,7 +5682,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow { int ret; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -5710,7 +5699,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); if (ret != _FAIL) { @@ -5816,7 +5805,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int { int ret; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -5833,7 +5822,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); if (ret != _FAIL) { @@ -5934,7 +5923,7 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int { int ret; int i = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; do { ret = _issue_deauth(padapter, da, reason, wait_ms > 0 ? true : false); @@ -5945,7 +5934,7 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); if (ret != _FAIL) { @@ -6156,7 +6145,6 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch static void issue_action_BSSCoexistPacket(struct adapter *padapter) { - unsigned long irqL; struct list_head *plist, *phead; unsigned char category, action; struct xmit_frame *pmgntframe; @@ -6231,7 +6219,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) if (pmlmepriv->num_sta_no_ht > 0) { int i; - _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); + spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); phead = get_list_head(queue); plist = get_next(phead); @@ -6261,7 +6249,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) ICS[0][0] = 1; } } - _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); + spin_unlock_bh(&pmlmepriv->scanned_queue.lock); for (i = 0; i < 8; i++) { if (ICS[i][0] == 1) { @@ -6338,14 +6326,14 @@ unsigned int send_beacon(struct adapter *padapter) int issue = 0; int poll = 0; - u32 start = rtw_get_current_time(); + u32 start = jiffies; rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL); do { issue_beacon(padapter, 100); issue++; do { - rtw_yield_os(); + yield(); rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8 *)(&bxmitok)); poll++; } while ((poll%10) != 0 && !bxmitok && !padapter->bSurpriseRemoved && !padapter->bDriverStopped); @@ -6435,7 +6423,7 @@ void site_survey(struct adapter *padapter) if (pmlmeext->sitesurvey_res.ssid[i].SsidLength) { /* todo: to issue two probe req??? */ issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); - /* rtw_msleep_os(SURVEY_TO>>1); */ + /* msleep(SURVEY_TO>>1); */ issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); } } @@ -6443,7 +6431,7 @@ void site_survey(struct adapter *padapter) if (pmlmeext->sitesurvey_res.scan_mode == SCAN_ACTIVE) { /* todo: to issue two probe req??? */ issue_probereq(padapter, NULL, NULL); - /* rtw_msleep_os(SURVEY_TO>>1); */ + /* msleep(SURVEY_TO>>1); */ issue_probereq(padapter, NULL, NULL); } } @@ -7082,7 +7070,7 @@ void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); pc2h_evt_hdr->len = sizeof(struct survey_event); pc2h_evt_hdr->ID = GEN_EVT_CODE(_Survey); - pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); + pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq); psurvey_evt = (struct survey_event *)(pevtcmd + sizeof(struct C2HEvent_Header)); @@ -7134,7 +7122,7 @@ void report_surveydone_event(struct adapter *padapter) pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); pc2h_evt_hdr->len = sizeof(struct surveydone_event); pc2h_evt_hdr->ID = GEN_EVT_CODE(_SurveyDone); - pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); + pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq); psurveydone_evt = (struct surveydone_event *)(pevtcmd + sizeof(struct C2HEvent_Header)); psurveydone_evt->bss_cnt = pmlmeext->sitesurvey_res.bss_cnt; @@ -7180,7 +7168,7 @@ void report_join_res(struct adapter *padapter, int res) pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); pc2h_evt_hdr->len = sizeof(struct joinbss_event); pc2h_evt_hdr->ID = GEN_EVT_CODE(_JoinBss); - pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); + pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq); pjoinbss_evt = (struct joinbss_event *)(pevtcmd + sizeof(struct C2HEvent_Header)); memcpy((unsigned char *)(&(pjoinbss_evt->network.network)), &(pmlmeinfo->network), sizeof(struct wlan_bssid_ex)); @@ -7233,7 +7221,7 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); pc2h_evt_hdr->len = sizeof(struct stadel_event); pc2h_evt_hdr->ID = GEN_EVT_CODE(_DelSTA); - pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); + pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq); pdel_sta_evt = (struct stadel_event *)(pevtcmd + sizeof(struct C2HEvent_Header)); memcpy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr, ETH_ALEN); @@ -7288,7 +7276,7 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); pc2h_evt_hdr->len = sizeof(struct stassoc_event); pc2h_evt_hdr->ID = GEN_EVT_CODE(_AddSTA); - pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); + pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq); padd_sta_evt = (struct stassoc_event *)(pevtcmd + sizeof(struct C2HEvent_Header)); memcpy((unsigned char *)(&(padd_sta_evt->macaddr)), MacAddr, ETH_ALEN); @@ -8334,7 +8322,7 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf) goto _abort_event_; } - ATOMIC_INC(&pevt_priv->event_seq); + atomic_inc(&pevt_priv->event_seq); peventbuf += 2; @@ -8365,7 +8353,6 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) } #ifdef CONFIG_88EU_AP_MODE else { /* tx bc/mc frames after update TIM */ - unsigned long irqL; struct sta_info *psta_bmc; struct list_head *xmitframe_plist, *xmitframe_phead; struct xmit_frame *pxmitframe = NULL; @@ -8377,8 +8364,8 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) return H2C_SUCCESS; if ((pstapriv->tim_bitmap&BIT(0)) && (psta_bmc->sleepq_len > 0)) { - rtw_msleep_os(10);/* 10ms, ATIM(HIQ) Windows */ - _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + msleep(10);/* 10ms, ATIM(HIQ) Windows */ + spin_lock_bh(&psta_bmc->sleep_q.lock); xmitframe_phead = get_list_head(&psta_bmc->sleep_q); xmitframe_plist = get_next(xmitframe_phead); @@ -8400,12 +8387,12 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) pxmitframe->attrib.qsel = 0x11;/* HIQ */ - _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + spin_unlock_bh(&psta_bmc->sleep_q.lock); if (rtw_hal_xmit(padapter, pxmitframe)) rtw_os_xmit_complete(padapter, pxmitframe); - _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + spin_lock_bh(&psta_bmc->sleep_q.lock); } - _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); + spin_unlock_bh(&psta_bmc->sleep_q.lock); } } #endif |