diff options
Diffstat (limited to 'drivers/staging/r8188eu/core/rtw_mlme_ext.c')
-rw-r--r-- | drivers/staging/r8188eu/core/rtw_mlme_ext.c | 123 |
1 files changed, 24 insertions, 99 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 6c07a03dfa84..785eda58a5e5 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -314,9 +314,8 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c memset(channel_set, 0, sizeof(struct rt_channel_info) * MAX_CHANNEL_NUM); - if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) { + if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) return chanset_size; - } if (padapter->registrypriv.wireless_mode & WIRELESS_11G) { b2_4GBand = true; @@ -433,10 +432,9 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) if (psta) { if (GetRetry(pframe)) { - if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum) { + if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum) /* drop the duplicate management frame */ return; - } } psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num; } @@ -931,15 +929,13 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame return _FAIL; frame_type = GetFrameSubType(pframe); - if (frame_type == WIFI_ASSOCREQ) { + if (frame_type == WIFI_ASSOCREQ) ie_offset = _ASOCREQ_IE_OFFSET_; - } else { /* WIFI_REASSOCREQ */ + else /* WIFI_REASSOCREQ */ ie_offset = _REASOCREQ_IE_OFFSET_; - } - if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) { + if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) return _FAIL; - } pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); if (pstat == (struct sta_info *)NULL) { @@ -1085,14 +1081,13 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS); if (!wpa_ie) { - if (elems.wps_ie) { + if (elems.wps_ie) pstat->flags |= WLAN_STA_WPS; /* wpabuf_free(sta->wps_ie); */ /* sta->wps_ie = wpabuf_alloc_copy(elems.wps_ie + 4, */ /* elems.wps_ie_len - 4); */ - } else { + else pstat->flags |= WLAN_STA_MAYBE_WPS; - } /* AP support WPA/RSN, and sta is going to do WPS, but AP is not ready */ /* that the selected registrar of AP is _FLASE */ @@ -1202,14 +1197,6 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame goto OnAssocReqFail; } - if ((pstat->flags & WLAN_STA_HT) && - ((pstat->wpa2_pairwise_cipher & WPA_CIPHER_TKIP) || - (pstat->wpa_pairwise_cipher & WPA_CIPHER_TKIP))) { - - /* status = WLAN_STATUS_CIPHER_REJECTED_PER_POLICY; */ - /* goto OnAssocReqFail; */ - } - pstat->flags |= WLAN_STA_NONERP; for (i = 0; i < pstat->bssratelen; i++) { if ((pstat->bssrateset[i] & 0x7f) > 22) { @@ -1248,8 +1235,7 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame /* Customer proprietary IE */ /* get a unique AID */ - if (pstat->aid > 0) { - } else { + if (pstat->aid == 0) { for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++) if (!pstapriv->sta_aid[pstat->aid - 1]) break; @@ -3597,13 +3583,11 @@ static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) if (GetRetry(frame)) { if (token >= 0) { - if ((seq_ctrl == mlmeext->action_public_rxseq) && (token == mlmeext->action_public_dialog_token)) { + if ((seq_ctrl == mlmeext->action_public_rxseq) && (token == mlmeext->action_public_dialog_token)) return _FAIL; - } } else { - if (seq_ctrl == mlmeext->action_public_rxseq) { + if (seq_ctrl == mlmeext->action_public_rxseq) return _FAIL; - } } } @@ -3693,7 +3677,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) pwdinfo->negotiation_dialog_token = 1; if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL)) _set_timer(&pwdinfo->restore_p2p_state_timer, 5000); - } else { } break; case P2P_GO_NEGO_CONF: @@ -3728,9 +3711,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) /* #> iwpriv wlan0 p2p_get peer_ifa */ /* After having the peer interface address, the sigma can find the correct conf file for wpa_supplicant. */ - if (attr_contentlen) { - } - if (invitation_flag & P2P_INVITATION_FLAGS_PERSISTENT) { /* Re-invoke the persistent group. */ @@ -4022,9 +4002,8 @@ struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv) struct xmit_buf *pxmitbuf; pmgntframe = rtw_alloc_xmitframe(pxmitpriv); - if (!pmgntframe) { + if (!pmgntframe) return NULL; - } pxmitbuf = rtw_alloc_xmitbuf_ext(pxmitpriv); if (!pxmitbuf) { @@ -4184,9 +4163,8 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) struct wifidirect_info *pwdinfo = &padapter->wdinfo; pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (!pmgntframe) { + if (!pmgntframe) return; - } spin_lock_bh(&pmlmepriv->bcn_update_lock); /* update attribute */ @@ -4366,9 +4344,8 @@ _issue_bcn: spin_unlock_bh(&pmlmepriv->bcn_update_lock); - if ((pattrib->pktlen + TXDESC_SIZE) > 512) { + if ((pattrib->pktlen + TXDESC_SIZE) > 512) return; - } pattrib->last_txcmdsz = pattrib->pktlen; @@ -4397,9 +4374,8 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p struct wifidirect_info *pwdinfo = &padapter->wdinfo; pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (!pmgntframe) { + if (!pmgntframe) return; - } /* update attribute */ pattrib = &pmgntframe->attrib; @@ -4641,13 +4617,6 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, ret = _SUCCESS; goto exit; } - - if (try_cnt && wait_ms) { - if (da) - ; - else - ; - } exit: return ret; } @@ -4982,11 +4951,6 @@ void issue_assocreq(struct adapter *padapter) for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) { if (pmlmeinfo->network.SupportedRates[i] == 0) break; - } - - for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) { - if (pmlmeinfo->network.SupportedRates[i] == 0) - break; /* Check if the AP's supported rates are also supported by STA. */ for (j = 0; j < sta_bssrate_len; j++) { @@ -4996,12 +4960,9 @@ void issue_assocreq(struct adapter *padapter) break; } - if (j == sta_bssrate_len) { - /* the rate is not supported by STA */ - } else { + if (j != sta_bssrate_len) /* the rate is supported by STA */ bssrate[index++] = pmlmeinfo->network.SupportedRates[i]; - } } bssrate_len = index; @@ -5312,13 +5273,6 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow ret = _SUCCESS; goto exit; } - - if (try_cnt && wait_ms) { - if (da) - ; - else - ; - } exit: return ret; } @@ -5425,13 +5379,6 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int ret = _SUCCESS; goto exit; } - - if (try_cnt && wait_ms) { - if (da) - ; - else - ; - } exit: return ret; } @@ -5526,13 +5473,6 @@ int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int ret = _SUCCESS; goto exit; } - - if (try_cnt && wait_ms) { - if (da) - ; - else - ; - } exit: return ret; } @@ -5839,10 +5779,7 @@ unsigned int send_beacon(struct adapter *padapter) if (!bxmitok) { return _FAIL; } else { - u32 passing_time = rtw_get_passing_time_ms(start); - - if (passing_time > 100 || issue > 3) - ; + rtw_get_passing_time_ms(start); return _SUCCESS; } @@ -6051,14 +5988,12 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st /* checking SSID */ p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset); - if (!p) { + if (!p) return _FAIL; - } if (*(p + 1)) { - if (len > NDIS_802_11_LENGTH_SSID) { + if (len > NDIS_802_11_LENGTH_SSID) return _FAIL; - } memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1)); bssid->Ssid.SsidLength = *(p + 1); } else { @@ -6071,18 +6006,16 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st i = 0; p = rtw_get_ie(bssid->IEs + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset); if (p) { - if (len > NDIS_802_11_LENGTH_RATES_EX) { + if (len > NDIS_802_11_LENGTH_RATES_EX) return _FAIL; - } memcpy(bssid->SupportedRates, (p + 2), len); i = len; } p = rtw_get_ie(bssid->IEs + ie_offset, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset); if (p) { - if (len > (NDIS_802_11_LENGTH_RATES_EX - i)) { + if (len > (NDIS_802_11_LENGTH_RATES_EX - i)) return _FAIL; - } memcpy(bssid->SupportedRates + i, (p + 2), len); } @@ -6936,17 +6869,11 @@ static u8 chk_ap_is_alive(struct sta_info *psta) static void rtl8188e_sreset_linked_status_check(struct adapter *padapter) { u32 rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS); - u8 fw_status; - if (rx_dma_status != 0x00) { + if (rx_dma_status != 0x00) rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status); - } - fw_status = rtw_read8(padapter, REG_FMETHR); - if (fw_status == 1) - ; - else if (fw_status == 2) - ; + rtw_read8(padapter, REG_FMETHR); } void linked_status_chk(struct adapter *padapter) @@ -7320,8 +7247,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) default: pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; break; - } - + } } } break; @@ -7574,9 +7500,8 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf) if (psta) { ctrl = (BIT(15) | ((pparm->algorithm) << 2)); - if ((psta->mac_id < 1) || (psta->mac_id > (NUM_STA - 4))) { + if ((psta->mac_id < 1) || (psta->mac_id > (NUM_STA - 4))) return H2C_REJECTED; - } cam_id = (psta->mac_id + 3);/* 0~3 for default key, cmd_id = macid + 3, macid = aid+1; */ |