Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8723bs: remove unnecessary bracks on DBG_871X removal sites

remove unnecessary bracks on DBG_871X removal sites

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/35f5edf0f39b717b3de3ad7861cbaa5f4ba60576.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Fabio Aiuto and committed by
Greg Kroah-Hartman
709c8e49 b4f27a06

+254 -431
+3 -6
drivers/staging/rtl8723bs/core/rtw_ap.c
··· 274 274 && padapter->xmitpriv.free_xmitframe_cnt < (( 275 275 NR_XMITFRAME / pstapriv->asoc_list_cnt 276 276 ) / 2) 277 - ) { 277 + ) 278 278 wakeup_sta_to_xmit(padapter, psta); 279 - } 280 279 } 281 280 } 282 281 ··· 535 536 536 537 /* B0 Config LDPC Coding Capability */ 537 538 if (TEST_FLAG(phtpriv_ap->ldpc_cap, LDPC_HT_ENABLE_TX) && 538 - GET_HT_CAPABILITY_ELE_LDPC_CAP((u8 *)(&phtpriv_sta->ht_cap))) { 539 + GET_HT_CAPABILITY_ELE_LDPC_CAP((u8 *)(&phtpriv_sta->ht_cap))) 539 540 SET_FLAG(cur_ldpc_cap, (LDPC_HT_ENABLE_TX | LDPC_HT_CAP_TX)); 540 - } 541 541 542 542 /* B7 B8 B9 Config STBC setting */ 543 543 if (TEST_FLAG(phtpriv_ap->stbc_cap, STBC_HT_ENABLE_TX) && 544 - GET_HT_CAPABILITY_ELE_RX_STBC((u8 *)(&phtpriv_sta->ht_cap))) { 544 + GET_HT_CAPABILITY_ELE_RX_STBC((u8 *)(&phtpriv_sta->ht_cap))) 545 545 SET_FLAG(cur_stbc_cap, (STBC_HT_ENABLE_TX | STBC_HT_CAP_TX)); 546 - } 547 546 } else { 548 547 phtpriv_sta->ampdu_enable = false; 549 548
+2 -4
drivers/staging/rtl8723bs/core/rtw_btcoex.c
··· 21 21 22 22 void rtw_btcoex_HaltNotify(struct adapter *padapter) 23 23 { 24 - if (!padapter->bup) { 24 + if (!padapter->bup) 25 25 return; 26 - } 27 26 28 - if (padapter->bSurpriseRemoved) { 27 + if (padapter->bSurpriseRemoved) 29 28 return; 30 - } 31 29 32 30 hal_btcoex_HaltNotify(padapter); 33 31 }
+4 -6
drivers/staging/rtl8723bs/core/rtw_cmd.c
··· 313 313 314 314 if ((pcmdpriv->padapter->hw_init_completed == false && bAllow == false) 315 315 || atomic_read(&(pcmdpriv->cmdthd_running)) == false /* com_thread not running */ 316 - ) { 316 + ) 317 317 return _FAIL; 318 - } 318 + 319 319 return _SUCCESS; 320 320 } 321 321 ··· 419 419 break; 420 420 } 421 421 422 - if (list_empty(&(pcmdpriv->cmd_queue.queue))) { 422 + if (list_empty(&(pcmdpriv->cmd_queue.queue))) 423 423 continue; 424 - } 425 424 426 425 if (rtw_register_cmd_alive(padapter) != _SUCCESS) 427 426 continue; ··· 1507 1508 1508 1509 mutex_lock(&pwrpriv->lock); 1509 1510 1510 - if (pwrpriv->dtim != dtim) { 1511 + if (pwrpriv->dtim != dtim) 1511 1512 pwrpriv->dtim = dtim; 1512 - } 1513 1513 1514 1514 if ((pwrpriv->bFwCurrentInPSMode == true) && (pwrpriv->pwr_mode > PS_MODE_ACTIVE)) { 1515 1515 u8 ps_mode = pwrpriv->pwr_mode;
+4 -6
drivers/staging/rtl8723bs/core/rtw_ieee80211.c
··· 818 818 /* first 3 bytes in vendor specific information element are the IEEE 819 819 * OUI of the vendor. The following byte is used a vendor specific 820 820 * sub-type. */ 821 - if (elen < 4) { 821 + if (elen < 4) 822 822 return -1; 823 - } 824 823 825 824 oui = get_unaligned_be24(pos); 826 825 switch (oui) { ··· 834 835 elems->wpa_ie_len = elen; 835 836 break; 836 837 case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */ 837 - if (elen < 5) { 838 + if (elen < 5) 838 839 return -1; 839 - } 840 + 840 841 switch (pos[4]) { 841 842 case WME_OUI_SUBTYPE_INFORMATION_ELEMENT: 842 843 case WME_OUI_SUBTYPE_PARAMETER_ELEMENT: ··· 904 905 elen = *pos++; 905 906 left -= 2; 906 907 907 - if (elen > left) { 908 + if (elen > left) 908 909 return ParseFailed; 909 - } 910 910 911 911 switch (id) { 912 912 case WLAN_EID_SSID:
+1 -2
drivers/staging/rtl8723bs/core/rtw_io.c
··· 172 172 { 173 173 int ret = false; 174 174 int value = atomic_inc_return(&dvobj->continual_io_error); 175 - if (value > MAX_CONTINUAL_IO_ERR) { 175 + if (value > MAX_CONTINUAL_IO_ERR) 176 176 ret = true; 177 - } 178 177 179 178 return ret; 180 179 }
+12 -20
drivers/staging/rtl8723bs/core/rtw_mlme.c
··· 707 707 } 708 708 } 709 709 710 - if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0)) { 710 + if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0)) 711 711 bselected = false; 712 - } 713 712 714 713 if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { 715 714 if (pnetwork->network.InfrastructureMode != pmlmepriv->cur_network.network.InfrastructureMode) ··· 1039 1040 msleep(20); 1040 1041 } 1041 1042 1042 - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) { 1043 + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) 1043 1044 rtw_indicate_scan_done(adapter, true); 1044 - } 1045 + 1045 1046 pmlmeext->scan_abort = false; 1046 1047 } 1047 1048 ··· 1656 1657 && jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) { 1657 1658 1658 1659 if (!padapter->registrypriv.wifi_spec) { 1659 - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) { 1660 + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) 1660 1661 goto exit; 1661 - } 1662 1662 1663 - if (pmlmepriv->LinkDetectInfo.bBusyTraffic) { 1663 + if (pmlmepriv->LinkDetectInfo.bBusyTraffic) 1664 1664 goto exit; 1665 - } 1666 1665 } 1667 1666 1668 1667 rtw_set_802_11_bssid_list_scan(padapter, NULL, 0); ··· 2341 2344 rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMER, (u8 *)&bHwSupportBeamformer); 2342 2345 rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMEE, (u8 *)&bHwSupportBeamformee); 2343 2346 CLEAR_FLAGS(phtpriv->beamform_cap); 2344 - if (TEST_FLAG(pregistrypriv->beamform_cap, BIT4) && bHwSupportBeamformer) { 2347 + if (TEST_FLAG(pregistrypriv->beamform_cap, BIT4) && bHwSupportBeamformer) 2345 2348 SET_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE); 2346 - } 2347 - if (TEST_FLAG(pregistrypriv->beamform_cap, BIT5) && bHwSupportBeamformee) { 2349 + 2350 + if (TEST_FLAG(pregistrypriv->beamform_cap, BIT5) && bHwSupportBeamformee) 2348 2351 SET_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE); 2349 - } 2350 2352 } 2351 2353 2352 2354 void rtw_build_wmm_ie_ht(struct adapter *padapter, u8 *out_ie, uint *pout_len) ··· 2441 2445 2442 2446 if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_RX)) { 2443 2447 if ((channel <= 14 && pregistrypriv->rx_stbc == 0x1) || /* enable for 2.4GHz */ 2444 - (pregistrypriv->wifi_spec == 1)) { 2448 + (pregistrypriv->wifi_spec == 1)) 2445 2449 stbc_rx_enable = 1; 2446 - } 2447 2450 } 2448 2451 2449 2452 /* fill default supported_mcs_set */ ··· 2634 2639 priority = pattrib->priority; 2635 2640 2636 2641 psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); 2637 - if (pattrib->psta != psta) { 2642 + if (pattrib->psta != psta) 2638 2643 return; 2639 - } 2640 2644 2641 - if (!psta) { 2645 + if (!psta) 2642 2646 return; 2643 - } 2644 2647 2645 - if (!(psta->state & _FW_LINKED)) { 2648 + if (!(psta->state & _FW_LINKED)) 2646 2649 return; 2647 - } 2648 2650 2649 2651 phtpriv = &psta->htpriv; 2650 2652
+27 -50
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
··· 400 400 401 401 memset(channel_set, 0, sizeof(struct rt_channel_info)*MAX_CHANNEL_NUM); 402 402 403 - if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) { 403 + if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) 404 404 return chanset_size; 405 - } 406 405 407 406 if (IsSupported24G(padapter->registrypriv.wireless_mode)) { 408 407 b2_4GBand = true; ··· 620 621 621 622 _issue_probersp: 622 623 if ((check_fwstate(pmlmepriv, _FW_LINKED) && 623 - pmlmepriv->cur_network.join_res) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { 624 + pmlmepriv->cur_network.join_res) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) 624 625 issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); 625 - } 626 - 627 626 } 628 627 629 628 return _SUCCESS; ··· 658 661 659 662 p = rtw_get_ie(pframe + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, WLAN_EID_EXT_SUPP_RATES, &ielen, precv_frame->u.hdr.len - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_); 660 663 if (p && ielen > 0) { 661 - if ((*(p + 1 + ielen) == 0x2D) && (*(p + 2 + ielen) != 0x2D)) { 664 + if ((*(p + 1 + ielen) == 0x2D) && (*(p + 2 + ielen) != 0x2D)) 662 665 /* Invalid value 0x2D is detected in Extended Supported Rates (ESR) IE. Try to fix the IE length to avoid failed Beacon parsing. */ 663 666 *(p + 1) = ielen - 1; 664 - } 665 667 } 666 668 667 669 if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { ··· 975 979 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, WLAN_EID_CHALLENGE, (int *)&len, 976 980 pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_); 977 981 978 - if (p == NULL) { 982 + if (p == NULL) 979 983 goto authclnt_fail; 980 - } 981 984 982 985 memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len); 983 986 pmlmeinfo->auth_seq = 3; ··· 1047 1052 } 1048 1053 1049 1054 1050 - if (pkt_len < sizeof(struct ieee80211_hdr_3addr) + ie_offset) { 1055 + if (pkt_len < sizeof(struct ieee80211_hdr_3addr) + ie_offset) 1051 1056 return _FAIL; 1052 - } 1053 1057 1054 1058 pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); 1055 1059 if (!pstat) { ··· 1818 1824 if (GetRetry(frame)) { 1819 1825 if (token >= 0) { 1820 1826 if ((seq_ctrl == mlmeext->action_public_rxseq) 1821 - && (token == mlmeext->action_public_dialog_token)) { 1827 + && (token == mlmeext->action_public_dialog_token)) 1822 1828 return _FAIL; 1823 - } 1824 1829 } else { 1825 - if (seq_ctrl == mlmeext->action_public_rxseq) { 1830 + if (seq_ctrl == mlmeext->action_public_rxseq) 1826 1831 return _FAIL; 1827 - } 1828 1832 } 1829 1833 } 1830 1834 ··· 2013 2021 else 2014 2022 pmgntframe = rtw_alloc_xmitframe_ext(pxmitpriv); 2015 2023 2016 - if (pmgntframe == NULL) { 2024 + if (pmgntframe == NULL) 2017 2025 goto exit; 2018 - } 2019 2026 2020 2027 pxmitbuf = rtw_alloc_xmitbuf_ext(pxmitpriv); 2021 2028 if (pxmitbuf == NULL) { ··· 2221 2230 u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 2222 2231 2223 2232 pmgntframe = alloc_mgtxmitframe(pxmitpriv); 2224 - if (!pmgntframe) { 2233 + if (!pmgntframe) 2225 2234 return; 2226 - } 2227 2235 2228 2236 spin_lock_bh(&pmlmepriv->bcn_update_lock); 2229 2237 ··· 2341 2351 2342 2352 spin_unlock_bh(&pmlmepriv->bcn_update_lock); 2343 2353 2344 - if ((pattrib->pktlen + TXDESC_SIZE) > 512) { 2354 + if ((pattrib->pktlen + TXDESC_SIZE) > 512) 2345 2355 return; 2346 - } 2347 2356 2348 2357 pattrib->last_txcmdsz = pattrib->pktlen; 2349 2358 ··· 2375 2386 return; 2376 2387 2377 2388 pmgntframe = alloc_mgtxmitframe(pxmitpriv); 2378 - if (pmgntframe == NULL) { 2389 + if (pmgntframe == NULL) 2379 2390 return; 2380 - } 2381 - 2382 2391 2383 2392 /* update attribute */ 2384 2393 pattrib = &pmgntframe->attrib; ··· 3020 3033 for (j = 0; j < sta_bssrate_len; j++) { 3021 3034 /* Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP */ 3022 3035 if ((pmlmeinfo->network.SupportedRates[i]|IEEE80211_BASIC_RATE_MASK) 3023 - == (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)) { 3036 + == (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)) 3024 3037 break; 3025 - } 3026 3038 } 3027 3039 3028 - if (j != sta_bssrate_len) { 3040 + if (j != sta_bssrate_len) 3029 3041 /* the rate is supported by STA */ 3030 3042 bssrate[index++] = pmlmeinfo->network.SupportedRates[i]; 3031 - } 3032 3043 } 3033 3044 3034 3045 bssrate_len = index; ··· 3475 3490 __le16 le_tmp; 3476 3491 3477 3492 pmgntframe = alloc_mgtxmitframe(pxmitpriv); 3478 - if (pmgntframe == NULL) { 3493 + if (pmgntframe == NULL) 3479 3494 return; 3480 - } 3481 3495 3482 3496 /* update attribute */ 3483 3497 pattrib = &pmgntframe->attrib; ··· 3887 3903 } 3888 3904 3889 3905 3890 - if (false == bxmitok) { 3906 + if (false == bxmitok) 3891 3907 return _FAIL; 3892 - } else { 3908 + else 3893 3909 return _SUCCESS; 3894 - } 3895 3910 } 3896 3911 3897 3912 /**************************************************************************** ··· 4031 4048 4032 4049 len = packet_len - sizeof(struct ieee80211_hdr_3addr); 4033 4050 4034 - if (len > MAX_IE_SZ) { 4051 + if (len > MAX_IE_SZ) 4035 4052 return _FAIL; 4036 - } 4037 4053 4038 4054 memset(bssid, 0, sizeof(struct wlan_bssid_ex)); 4039 4055 ··· 4068 4086 4069 4087 /* checking SSID */ 4070 4088 p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SSID, &len, bssid->IELength - ie_offset); 4071 - if (p == NULL) { 4089 + if (p == NULL) 4072 4090 return _FAIL; 4073 - } 4074 4091 4075 4092 if (*(p + 1)) { 4076 - if (len > NDIS_802_11_LENGTH_SSID) { 4093 + if (len > NDIS_802_11_LENGTH_SSID) 4077 4094 return _FAIL; 4078 - } 4095 + 4079 4096 memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1)); 4080 4097 bssid->Ssid.SsidLength = *(p + 1); 4081 4098 } else ··· 4086 4105 i = 0; 4087 4106 p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SUPP_RATES, &len, bssid->IELength - ie_offset); 4088 4107 if (p) { 4089 - if (len > NDIS_802_11_LENGTH_RATES_EX) { 4108 + if (len > NDIS_802_11_LENGTH_RATES_EX) 4090 4109 return _FAIL; 4091 - } 4110 + 4092 4111 memcpy(bssid->SupportedRates, (p + 2), len); 4093 4112 i = len; 4094 4113 } 4095 4114 4096 4115 p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_EXT_SUPP_RATES, &len, bssid->IELength - ie_offset); 4097 4116 if (p) { 4098 - if (len > (NDIS_802_11_LENGTH_RATES_EX-i)) { 4117 + if (len > (NDIS_802_11_LENGTH_RATES_EX-i)) 4099 4118 return _FAIL; 4100 - } 4119 + 4101 4120 memcpy(bssid->SupportedRates + i, (p + 2), len); 4102 4121 } 4103 4122 ··· 5231 5250 } 5232 5251 } 5233 5252 5234 - if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == link_count_limit) { 5253 + if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == link_count_limit) 5235 5254 tx_chk = issue_nulldata_in_interrupt(padapter, NULL); 5236 - } 5237 5255 } 5238 5256 5239 5257 if (rx_chk == _FAIL) { ··· 5306 5326 } 5307 5327 5308 5328 if (pmlmeext->scan_abort) { 5309 - { 5310 - pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num; 5311 - } 5329 + pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num; 5312 5330 5313 5331 pmlmeext->scan_abort = false;/* reset */ 5314 5332 } ··· 6114 6136 6115 6137 u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) 6116 6138 { 6117 - if (send_beacon(padapter) == _FAIL) { 6139 + if (send_beacon(padapter) == _FAIL) 6118 6140 return H2C_PARAMETERS_ERROR; 6119 - } 6120 6141 6121 6142 /* tx bc/mc frames after update TIM */ 6122 6143 chk_bmc_sleepq_hdl(padapter, NULL);
+20 -34
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
··· 97 97 98 98 bool ret = false; 99 99 100 - if (adapter_to_pwrctl(adapter)->bpower_saving) { 100 + if (adapter_to_pwrctl(adapter)->bpower_saving) 101 101 goto exit; 102 - } 103 102 104 - if (time_before(jiffies, adapter_to_pwrctl(adapter)->ips_deny_time)) { 103 + if (time_before(jiffies, adapter_to_pwrctl(adapter)->ips_deny_time)) 105 104 goto exit; 106 - } 107 105 108 106 if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR) 109 107 || check_fwstate(pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS) ··· 151 153 mutex_lock(&adapter_to_pwrctl(padapter)->lock); 152 154 ps_deny = rtw_ps_deny_get(padapter); 153 155 mutex_unlock(&adapter_to_pwrctl(padapter)->lock); 154 - if (ps_deny != 0) { 156 + if (ps_deny != 0) 155 157 goto exit; 156 - } 157 158 158 159 if (pwrpriv->bInSuspend) {/* system suspend or autosuspend */ 159 160 pdbgpriv->dbg_ps_insuspend_cnt++; ··· 218 221 if (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 4/*2*/) { 219 222 if (adapter_to_pwrctl(padapter)->bLeisurePs 220 223 && (adapter_to_pwrctl(padapter)->pwr_mode != PS_MODE_ACTIVE) 221 - && !(hal_btcoex_IsBtControlLps(padapter))) { 224 + && !(hal_btcoex_IsBtControlLps(padapter))) 222 225 bLeaveLPS = true; 223 - } 224 226 } 225 227 } 226 228 ··· 332 336 ) 333 337 return false; 334 338 335 - if ((padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && !(padapter->securitypriv.binstallGrpkey)) { 339 + if ((padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && !(padapter->securitypriv.binstallGrpkey)) 336 340 return false; 337 - } 338 341 339 342 if (!rtw_cfg80211_pwr_mgmt(padapter)) 340 343 return false; ··· 510 515 struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); 511 516 struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(Adapter); 512 517 513 - if (Adapter->bSurpriseRemoved) { 518 + if (Adapter->bSurpriseRemoved) 514 519 return; 515 - } 516 520 517 521 if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */ 518 522 519 - if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) { 523 + if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) 520 524 return; 521 - } 522 525 523 526 mutex_lock(&pwrpriv->lock); 524 527 ··· 541 548 u8 enqueue = 0; 542 549 int n_assoc_iface = 0; 543 550 544 - if (!Adapter->bup) { 551 + if (!Adapter->bup) 545 552 return; 546 - } 547 553 548 - if (Adapter->bSurpriseRemoved) { 554 + if (Adapter->bSurpriseRemoved) 549 555 return; 550 - } 551 556 552 557 if (check_fwstate(&(dvobj->padapters->mlmepriv), WIFI_ASOC_STATE)) 553 558 n_assoc_iface++; ··· 589 598 if (bReady) 590 599 break; 591 600 592 - if (jiffies_to_msecs(jiffies - start_time) > 100) { 601 + if (jiffies_to_msecs(jiffies - start_time) > 100) 593 602 break; 594 - } 603 + 595 604 msleep(1); 596 605 } 597 606 } ··· 611 620 612 621 mutex_lock(&pwrpriv->lock); 613 622 614 - if (pwrpriv->rpwm < PS_STATE_S2) { 623 + if (pwrpriv->rpwm < PS_STATE_S2) 615 624 goto exit; 616 - } 617 625 618 626 pwrpriv->cpwm = PS_STATE(preportpwrstate->state); 619 627 pwrpriv->cpwm_tog = preportpwrstate->state & PS_TOGGLE; ··· 653 663 padapter = dvobj->if1; 654 664 655 665 mutex_lock(&pwrpriv->lock); 656 - if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) { 666 + if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) 657 667 goto exit; 658 - } 668 + 659 669 mutex_unlock(&pwrpriv->lock); 660 670 661 671 if (rtw_read8(padapter, 0x100) != 0xEA) { ··· 669 679 670 680 mutex_lock(&pwrpriv->lock); 671 681 672 - if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) { 682 + if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) 673 683 goto exit; 674 - } 684 + 675 685 pwrpriv->brpwmtimeout = true; 676 686 rtw_set_rpwm(padapter, pwrpriv->rpwm); 677 687 pwrpriv->brpwmtimeout = false; ··· 687 697 { 688 698 struct pwrctrl_priv *pwrpriv = from_timer(pwrpriv, t, pwr_rpwm_timer); 689 699 690 - if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) { 700 + if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) 691 701 return; 692 - } 693 702 694 703 _set_workitem(&pwrpriv->rpwmtimeoutwi); 695 704 } ··· 1042 1053 pwrpriv->ips_deny_time = deny_time; 1043 1054 1044 1055 1045 - if (pwrpriv->ps_processing) { 1056 + if (pwrpriv->ps_processing) 1046 1057 while (pwrpriv->ps_processing && jiffies_to_msecs(jiffies - start) <= 3000) 1047 1058 mdelay(10); 1048 - } 1049 1059 1050 - if (!(pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend) { 1060 + if (!(pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend) 1051 1061 while (pwrpriv->bInSuspend && jiffies_to_msecs(jiffies - start) <= 3000 1052 - ) { 1062 + ) 1053 1063 mdelay(10); 1054 - } 1055 - } 1056 1064 1057 1065 /* System suspend is not allowed to wakeup */ 1058 1066 if (!(pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend) {
+10 -18
drivers/staging/rtl8723bs/core/rtw_recv.c
··· 362 362 if ((IS_MCAST(prxattrib->ra) == true) && (prxattrib->key_index != pmlmeinfo->key_index)) 363 363 brpt_micerror = false; 364 364 365 - if ((prxattrib->bdecrypted == true) && (brpt_micerror == true)) { 365 + if ((prxattrib->bdecrypted == true) && (brpt_micerror == true)) 366 366 rtw_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra)); 367 - } 368 367 369 368 res = _FAIL; 370 369 ··· 772 773 !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || 773 774 (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { 774 775 775 - if (!bmcast) { 776 + if (!bmcast) 776 777 issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); 777 - } 778 778 779 779 ret = _FAIL; 780 780 goto exit; ··· 1590 1592 /* Offset 12 denote 2 mac address */ 1591 1593 nSubframe_Length = get_unaligned_be16(pdata + 12); 1592 1594 1593 - if (a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) { 1595 + if (a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) 1594 1596 break; 1595 - } 1596 1597 1597 1598 sub_pkt = rtw_os_alloc_msdu_pkt(prframe, nSubframe_Length, pdata); 1598 - if (!sub_pkt) { 1599 + if (!sub_pkt) 1599 1600 break; 1600 - } 1601 1601 1602 1602 /* move the data point to data content */ 1603 1603 pdata += ETH_HLEN; ··· 1603 1607 1604 1608 subframes[nr_subframes++] = sub_pkt; 1605 1609 1606 - if (nr_subframes >= MAX_SUBFRAME_COUNT) { 1610 + if (nr_subframes >= MAX_SUBFRAME_COUNT) 1607 1611 break; 1608 - } 1609 1612 1610 1613 pdata += nSubframe_Length; 1611 1614 a_len -= nSubframe_Length; ··· 1613 1618 if (padding_len == 4) 1614 1619 padding_len = 0; 1615 1620 1616 - if (a_len < padding_len) { 1621 + if (a_len < padding_len) 1617 1622 break; 1618 - } 1623 + 1619 1624 pdata += padding_len; 1620 1625 a_len -= padding_len; 1621 1626 } ··· 1789 1794 plist = get_next(plist); 1790 1795 list_del_init(&(prframe->u.hdr.list)); 1791 1796 1792 - if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num)) { 1797 + if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num)) 1793 1798 preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF; 1794 - } 1795 1799 1796 1800 /* Set this as a lock to make sure that only one thread is indicating packet. */ 1797 1801 /* pTS->RxIndicateState = RXTS_INDICATE_PROCESSING; */ ··· 1970 1976 } 1971 1977 } else { /* B/G mode */ 1972 1978 retval = wlanhdr_to_ethhdr(prframe); 1973 - if (retval != _SUCCESS) { 1979 + if (retval != _SUCCESS) 1974 1980 return retval; 1975 - } 1976 1981 1977 1982 if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) { 1978 1983 /* indicate this recv_frame */ ··· 2017 2024 } 2018 2025 2019 2026 prframe = recvframe_chk_defrag(padapter, prframe); 2020 - if (!prframe) { 2027 + if (!prframe) 2021 2028 goto _recv_data_drop; 2022 - } 2023 2029 2024 2030 prframe = portctrl(padapter, prframe); 2025 2031 if (!prframe) {
+7 -8
drivers/staging/rtl8723bs/core/rtw_security.c
··· 1587 1587 1588 1588 /* compare the mic */ 1589 1589 for (i = 0; i < 8; i++) { 1590 - if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) { 1590 + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) 1591 1591 res = _FAIL; 1592 - } 1593 1592 } 1594 1593 return res; 1595 1594 } ··· 1687 1688 ori_len = pattrib->pkt_len-WLAN_HDR_A3_LEN+BIP_AAD_SIZE; 1688 1689 BIP_AAD = rtw_zmalloc(ori_len); 1689 1690 1690 - if (BIP_AAD == NULL) { 1691 + if (BIP_AAD == NULL) 1691 1692 return _FAIL; 1692 - } 1693 + 1693 1694 /* PKT start */ 1694 1695 pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data; 1695 1696 /* mapping to wlan header */ ··· 1706 1707 memcpy(&le_tmp64, p+4, 6); 1707 1708 temp_ipn = le64_to_cpu(le_tmp64); 1708 1709 /* BIP packet number should bigger than previous BIP packet */ 1709 - if (temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx) { 1710 + if (temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx) 1710 1711 goto BIP_exit; 1711 - } 1712 + 1712 1713 /* copy key index */ 1713 1714 memcpy(&le_tmp, p+2, 2); 1714 1715 keyid = le16_to_cpu(le_tmp); 1715 - if (keyid != padapter->securitypriv.dot11wBIPKeyid) { 1716 + if (keyid != padapter->securitypriv.dot11wBIPKeyid) 1716 1717 goto BIP_exit; 1717 - } 1718 + 1718 1719 /* clear the MIC field of MME to zero */ 1719 1720 memset(p+2+len-8, 0, 8); 1720 1721
+34 -51
drivers/staging/rtl8723bs/core/rtw_wlan_util.c
··· 901 901 } 902 902 } 903 903 904 - for (i = 0; i < 4; i++) { 904 + for (i = 0; i < 4; i++) 905 905 pxmitpriv->wmm_para_seq[i] = inx[i]; 906 - } 907 906 } 908 907 } 909 908 ··· 1058 1059 1059 1060 if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { 1060 1061 /* Config STBC setting */ 1061 - if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_TX_STBC(pIE->data)) { 1062 + if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_TX_STBC(pIE->data)) 1062 1063 SET_FLAG(cur_stbc_cap, STBC_HT_ENABLE_TX); 1063 - } 1064 + 1064 1065 phtpriv->stbc_cap = cur_stbc_cap; 1065 1066 } else { 1066 1067 /* Config LDPC Coding Capability */ 1067 - if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_LDPC_CAP(pIE->data)) { 1068 + if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_LDPC_CAP(pIE->data)) 1068 1069 SET_FLAG(cur_ldpc_cap, (LDPC_HT_ENABLE_TX | LDPC_HT_CAP_TX)); 1069 - } 1070 + 1070 1071 phtpriv->ldpc_cap = cur_ldpc_cap; 1071 1072 1072 1073 /* Config STBC setting */ 1073 - if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_RX_STBC(pIE->data)) { 1074 + if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_RX_STBC(pIE->data)) 1074 1075 SET_FLAG(cur_stbc_cap, (STBC_HT_ENABLE_TX | STBC_HT_CAP_TX)); 1075 - } 1076 + 1076 1077 phtpriv->stbc_cap = cur_stbc_cap; 1077 1078 } 1078 1079 } ··· 1220 1221 1221 1222 len = packet_len - sizeof(struct ieee80211_hdr_3addr); 1222 1223 1223 - if (len > MAX_IE_SZ) { 1224 + if (len > MAX_IE_SZ) 1224 1225 return _FAIL; 1225 - } 1226 1226 1227 - if (memcmp(cur_network->network.MacAddress, pbssid, 6)) { 1227 + if (memcmp(cur_network->network.MacAddress, pbssid, 6)) 1228 1228 return true; 1229 - } 1230 1229 1231 1230 bssid = rtw_zmalloc(sizeof(struct wlan_bssid_ex)); 1232 - if (!bssid) { 1231 + if (!bssid) 1233 1232 return true; 1234 - } 1235 1233 1236 1234 if ((pmlmepriv->timeBcnInfoChkStart != 0) && (jiffies_to_msecs(jiffies - pmlmepriv->timeBcnInfoChkStart) > DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS)) { 1237 1235 pmlmepriv->timeBcnInfoChkStart = 0; ··· 1279 1283 if (p) { 1280 1284 bcn_channel = *(p + 2); 1281 1285 } else {/* In 5G, some ap do not have DSSET IE checking HT info for channel */ 1282 - rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, bssid->IELength - _FIXED_IE_LENGTH_); 1283 - if (pht_info) { 1284 - bcn_channel = pht_info->primary_channel; 1285 - } else { /* we don't find channel IE, so don't check it */ 1286 - bcn_channel = Adapter->mlmeextpriv.cur_channel; 1287 - } 1286 + rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, bssid->IELength - _FIXED_IE_LENGTH_); 1287 + if (pht_info) 1288 + bcn_channel = pht_info->primary_channel; 1289 + else /* we don't find channel IE, so don't check it */ 1290 + bcn_channel = Adapter->mlmeextpriv.cur_channel; 1288 1291 } 1289 - if (bcn_channel != Adapter->mlmeextpriv.cur_channel) { 1292 + 1293 + if (bcn_channel != Adapter->mlmeextpriv.cur_channel) 1290 1294 goto _mismatch; 1291 - } 1292 1295 1293 1296 /* checking SSID */ 1294 1297 ssid_len = 0; ··· 1301 1306 bssid->Ssid.SsidLength = ssid_len; 1302 1307 1303 1308 if (memcmp(bssid->Ssid.Ssid, cur_network->network.Ssid.Ssid, 32) || 1304 - bssid->Ssid.SsidLength != cur_network->network.Ssid.SsidLength) { 1305 - if (bssid->Ssid.Ssid[0] != '\0' && bssid->Ssid.SsidLength != 0) { /* not hidden ssid */ 1309 + bssid->Ssid.SsidLength != cur_network->network.Ssid.SsidLength) 1310 + if (bssid->Ssid.Ssid[0] != '\0' && bssid->Ssid.SsidLength != 0) /* not hidden ssid */ 1306 1311 goto _mismatch; 1307 - } 1308 - } 1309 1312 1310 1313 /* check encryption info */ 1311 1314 val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid); ··· 1313 1320 else 1314 1321 bssid->Privacy = 0; 1315 1322 1316 - if (cur_network->network.Privacy != bssid->Privacy) { 1323 + if (cur_network->network.Privacy != bssid->Privacy) 1317 1324 goto _mismatch; 1318 - } 1319 1325 1320 1326 rtw_get_sec_ie(bssid->IEs, bssid->IELength, NULL, &rsn_len, NULL, &wpa_len); 1321 1327 1322 - if (rsn_len > 0) { 1328 + if (rsn_len > 0) 1323 1329 encryp_protocol = ENCRYP_PROTOCOL_WPA2; 1324 - } else if (wpa_len > 0) { 1330 + else if (wpa_len > 0) 1325 1331 encryp_protocol = ENCRYP_PROTOCOL_WPA; 1326 - } else { 1332 + else 1327 1333 if (bssid->Privacy) 1328 1334 encryp_protocol = ENCRYP_PROTOCOL_WEP; 1329 - } 1330 1335 1331 - if (cur_network->BcnInfo.encryp_protocol != encryp_protocol) { 1336 + if (cur_network->BcnInfo.encryp_protocol != encryp_protocol) 1332 1337 goto _mismatch; 1333 - } 1334 1338 1335 1339 if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) { 1336 1340 pbuf = rtw_get_wpa_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12); ··· 1337 1347 } else { 1338 1348 pbuf = rtw_get_wpa2_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12); 1339 1349 1340 - if (pbuf && (wpa_ielen > 0)) { 1350 + if (pbuf && (wpa_ielen > 0)) 1341 1351 rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, &group_cipher, 1342 1352 &pairwise_cipher, &is_8021x); 1343 - } 1344 1353 } 1345 1354 1346 - if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher) { 1355 + if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher) 1347 1356 goto _mismatch; 1348 - } 1349 1357 1350 - if (is_8021x != cur_network->BcnInfo.is_8021x) { 1358 + if (is_8021x != cur_network->BcnInfo.is_8021x) 1351 1359 goto _mismatch; 1352 - } 1353 1360 } 1354 1361 1355 1362 kfree(bssid); ··· 1525 1538 Vender = HT_IOT_PEER_REALTEK_SOFTAP; 1526 1539 1527 1540 if (pIE->data[4] == 2) { 1528 - if (pIE->data[6] & RT_HT_CAP_USE_JAGUAR_BCUT) { 1541 + if (pIE->data[6] & RT_HT_CAP_USE_JAGUAR_BCUT) 1529 1542 Vender = HT_IOT_PEER_REALTEK_JAGUAR_BCUTAP; 1530 - } 1531 - if (pIE->data[6] & RT_HT_CAP_USE_JAGUAR_CCUT) { 1543 + 1544 + if (pIE->data[6] & RT_HT_CAP_USE_JAGUAR_CCUT) 1532 1545 Vender = HT_IOT_PEER_REALTEK_JAGUAR_CCUTAP; 1533 - } 1534 1546 } 1535 1547 } 1536 1548 ··· 1805 1819 ratio_20_delay += pmlmeext->bcn_delay_ratio[i]; 1806 1820 ratio_80_delay += pmlmeext->bcn_delay_ratio[i]; 1807 1821 1808 - if (ratio_20_delay > 20 && DrvBcnEarly == 0xff) { 1822 + if (ratio_20_delay > 20 && DrvBcnEarly == 0xff) 1809 1823 DrvBcnEarly = i; 1810 - } 1811 1824 1812 - if (ratio_80_delay > 80 && DrvBcnTimeOut == 0xff) { 1825 + if (ratio_80_delay > 80 && DrvBcnTimeOut == 0xff) 1813 1826 DrvBcnTimeOut = i; 1814 - } 1815 1827 1816 1828 /* reset adaptive_early_32k cnt */ 1817 1829 pmlmeext->bcn_delay_cnt[i] = 0; ··· 1846 1862 } 1847 1863 spin_unlock_bh(&pdvobj->lock); 1848 1864 1849 - if (i > (NUM_STA-1)) { 1865 + if (i > (NUM_STA-1)) 1850 1866 psta->mac_id = NUM_STA; 1851 - } else { 1867 + else 1852 1868 psta->mac_id = i; 1853 - } 1854 1869 } 1855 1870 1856 1871 void rtw_release_macid(struct adapter *padapter, struct sta_info *psta)
+22 -39
drivers/staging/rtl8723bs/core/rtw_xmit.c
··· 710 710 goto exit; 711 711 } 712 712 713 - if (!(psta->state & _FW_LINKED)) { 713 + if (!(psta->state & _FW_LINKED)) 714 714 return _FAIL; 715 - } 716 715 717 716 /* TODO:_lock */ 718 717 if (update_attrib_sec_info(padapter, pattrib, psta) == _FAIL) { ··· 930 931 struct sta_info *psta; 931 932 932 933 psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); 933 - if (pattrib->psta != psta) { 934 + if (pattrib->psta != psta) 934 935 return _FAIL; 935 - } 936 936 937 - if (!psta) { 937 + if (!psta) 938 938 return _FAIL; 939 - } 940 939 941 - if (!(psta->state & _FW_LINKED)) { 940 + if (!(psta->state & _FW_LINKED)) 942 941 return _FAIL; 943 - } 944 942 945 943 if (psta) { 946 944 psta->sta_xmitpriv.txseq_tid[pattrib->priority]++; ··· 1171 1175 goto xmitframe_coalesce_success; 1172 1176 1173 1177 /* IGTK key is not install, it may not support 802.11w */ 1174 - if (padapter->securitypriv.binstallBIPkey != true) { 1178 + if (padapter->securitypriv.binstallBIPkey != true) 1175 1179 goto xmitframe_coalesce_success; 1176 - } 1180 + 1177 1181 /* station mode doesn't need TX BIP, just ready the code */ 1178 1182 if (bmcst) { 1179 1183 int frame_body_len; ··· 1227 1231 else 1228 1232 psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); 1229 1233 1230 - if (!psta) { 1234 + if (!psta) 1231 1235 goto xmitframe_coalesce_fail; 1232 - } 1233 1236 1234 - if (!(psta->state & _FW_LINKED) || !pxmitframe->buf_addr) { 1237 + if (!(psta->state & _FW_LINKED) || !pxmitframe->buf_addr) 1235 1238 goto xmitframe_coalesce_fail; 1236 - } 1237 1239 1238 1240 /* according 802.11-2012 standard, these five types are not robust types */ 1239 1241 if (subtype == WIFI_ACTION && ··· 1408 1414 pxmitbuf->agg_num = 0; 1409 1415 pxmitbuf->pg_num = 0; 1410 1416 1411 - if (pxmitbuf->sctx) { 1417 + if (pxmitbuf->sctx) 1412 1418 rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); 1413 - } 1414 1419 } 1415 1420 1416 1421 return pxmitbuf; ··· 1422 1429 struct xmit_buf *pxmitbuf; 1423 1430 1424 1431 pcmdframe = rtw_alloc_xmitframe(pxmitpriv); 1425 - if (!pcmdframe) { 1432 + if (!pcmdframe) 1426 1433 return NULL; 1427 - } 1428 1434 1429 1435 pxmitbuf = __rtw_alloc_cmd_xmitbuf(pxmitpriv, buf_type); 1430 1436 if (!pxmitbuf) { ··· 1472 1480 pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; 1473 1481 pxmitbuf->agg_num = 1; 1474 1482 1475 - if (pxmitbuf->sctx) { 1483 + if (pxmitbuf->sctx) 1476 1484 rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); 1477 - } 1478 1485 } 1479 1486 1480 1487 spin_unlock_irqrestore(&pfree_queue->lock, irqL); ··· 1532 1541 pxmitbuf->agg_num = 0; 1533 1542 pxmitbuf->pg_num = 0; 1534 1543 1535 - if (pxmitbuf->sctx) { 1544 + if (pxmitbuf->sctx) 1536 1545 rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); 1537 - } 1538 1546 } 1539 1547 1540 1548 spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, irqL); ··· 1549 1559 if (!pxmitbuf) 1550 1560 return _FAIL; 1551 1561 1552 - if (pxmitbuf->sctx) { 1562 + if (pxmitbuf->sctx) 1553 1563 rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_FREE); 1554 - } 1555 1564 1556 1565 if (pxmitbuf->buf_tag == XMITBUF_CMD) { 1557 1566 } else if (pxmitbuf->buf_tag == XMITBUF_MGNT) { ··· 1803 1814 signed int res = _SUCCESS; 1804 1815 1805 1816 psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); 1806 - if (pattrib->psta != psta) { 1817 + if (pattrib->psta != psta) 1807 1818 return _FAIL; 1808 - } 1809 1819 1810 1820 if (!psta) { 1811 1821 res = _FAIL; ··· 1812 1824 goto exit; 1813 1825 } 1814 1826 1815 - if (!(psta->state & _FW_LINKED)) { 1827 + if (!(psta->state & _FW_LINKED)) 1816 1828 return _FAIL; 1817 - } 1818 1829 1819 1830 ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index)); 1820 1831 ··· 2003 2016 if (attrib->ether_type == 0x0806 || 2004 2017 attrib->ether_type == 0x888e || 2005 2018 attrib->dhcp_pkt 2006 - ) { 2019 + ) 2007 2020 allow = true; 2008 - } 2021 + 2009 2022 } else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL) 2010 2023 allow = true; 2011 2024 else if (registry->hiq_filter == RTW_HIQ_FILTER_DENY_ALL) { ··· 2028 2041 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == false) 2029 2042 return ret; 2030 2043 psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); 2031 - if (pattrib->psta != psta) { 2044 + if (pattrib->psta != psta) 2032 2045 return false; 2033 - } 2034 2046 2035 - if (!psta) { 2047 + if (!psta) 2036 2048 return false; 2037 - } 2038 2049 2039 - if (!(psta->state & _FW_LINKED)) { 2050 + if (!(psta->state & _FW_LINKED)) 2040 2051 return false; 2041 - } 2042 2052 2043 2053 if (pattrib->triggered == 1) { 2044 2054 if (bmcst && xmitframe_hiq_filter(pxmitframe)) ··· 2536 2552 int status = 0; 2537 2553 2538 2554 expire = sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT; 2539 - if (!wait_for_completion_timeout(&sctx->done, expire)) { 2555 + if (!wait_for_completion_timeout(&sctx->done, expire)) 2540 2556 /* timeout, do something?? */ 2541 2557 status = RTW_SCTX_DONE_TIMEOUT; 2542 - } else { 2558 + else 2543 2559 status = sctx->status; 2544 - } 2545 2560 2546 2561 if (status == RTW_SCTX_DONE_SUCCESS) 2547 2562 ret = _SUCCESS;
+2 -2
drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
··· 116 116 else 117 117 udelay(10); 118 118 119 - if (pollingCount++ > maxPollingCnt) { 119 + if (pollingCount++ > maxPollingCnt) 120 120 return false; 121 - } 121 + 122 122 } while (!bPollingBit); 123 123 124 124 break;
+2 -4
drivers/staging/rtl8723bs/hal/hal_com.c
··· 151 151 bool bLegalChannel = true; 152 152 153 153 if ((Channel <= 14) && (Channel >= 1)) { 154 - if (IsSupported24G(Adapter->registrypriv.wireless_mode) == false) { 154 + if (IsSupported24G(Adapter->registrypriv.wireless_mode) == false) 155 155 bLegalChannel = false; 156 - } 157 156 } else { 158 157 bLegalChannel = false; 159 158 } ··· 1334 1335 char *szScan = szStr; 1335 1336 1336 1337 /* Check input parameter. */ 1337 - if (!szStr || !pu4bVal || !pu4bMove) { 1338 + if (!szStr || !pu4bVal || !pu4bMove) 1338 1339 return false; 1339 - } 1340 1340 1341 1341 /* Initialize output. */ 1342 1342 *pu4bMove = 0;
+27 -42
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
··· 17 17 struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); 18 18 u8 value = 0; 19 19 20 - if (RfPath > ODM_RF_PATH_D) { 20 + if (RfPath > ODM_RF_PATH_D) 21 21 return 0; 22 - } 23 22 24 23 if (Band == BAND_ON_2_4G) { 25 24 switch (RateSection) { ··· 104 105 { 105 106 struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); 106 107 107 - if (RfPath > ODM_RF_PATH_D) { 108 + if (RfPath > ODM_RF_PATH_D) 108 109 return; 109 - } 110 110 111 111 if (Band == BAND_ON_2_4G) { 112 112 switch (RateSection) { ··· 701 703 702 704 PHY_GetRateValuesOfTxPowerByRate(padapter, RegAddr, BitMask, Data, rateIndex, PwrByRateVal, &rateNum); 703 705 704 - if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) { 706 + if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) 705 707 return; 706 - } 707 708 708 - if (RfPath > ODM_RF_PATH_D) { 709 + if (RfPath > ODM_RF_PATH_D) 709 710 return; 710 - } 711 711 712 - if (TxNum > ODM_RF_PATH_D) { 712 + if (TxNum > ODM_RF_PATH_D) 713 713 return; 714 - } 715 714 716 715 for (i = 0; i < rateNum; ++i) { 717 716 if (rateIndex[i] == PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS0) || ··· 999 1004 u8 txPower = 0; 1000 1005 u8 chnlIdx = (Channel-1); 1001 1006 1002 - if (HAL_IsLegalChannel(padapter, Channel) == false) { 1007 + if (HAL_IsLegalChannel(padapter, Channel) == false) 1003 1008 chnlIdx = 0; 1004 - } 1005 1009 1006 1010 *bIn24G = phy_GetChnlIndex(Channel, &chnlIdx); 1007 1011 ··· 1011 1017 txPower = pHalData->Index24G_BW40_Base[RFPath][chnlIdx]; 1012 1018 1013 1019 /* OFDM-1T */ 1014 - if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) { 1020 + if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) 1015 1021 txPower += pHalData->OFDM_24G_Diff[RFPath][TX_1S]; 1016 - } 1022 + 1017 1023 if (BandWidth == CHANNEL_WIDTH_20) { /* BW20-1S, BW20-2S */ 1018 1024 if ((MGN_MCS0 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT1SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9)) 1019 1025 txPower += pHalData->BW20_24G_Diff[RFPath][TX_1S]; ··· 1052 1058 txPower = pHalData->Index5G_BW40_Base[RFPath][chnlIdx]; 1053 1059 1054 1060 /* OFDM-1T */ 1055 - if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) { 1061 + if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) 1056 1062 txPower += pHalData->OFDM_5G_Diff[RFPath][TX_1S]; 1057 - } 1058 1063 1059 1064 /* BW20-1S, BW20-2S */ 1060 1065 if (BandWidth == CHANNEL_WIDTH_20) { ··· 1108 1115 if (pDM_Odm->RFCalibrateInfo.TxPowerTrackControl == false) 1109 1116 return offset; 1110 1117 1111 - if ((Rate == MGN_1M) || (Rate == MGN_2M) || (Rate == MGN_5_5M) || (Rate == MGN_11M)) { 1118 + if ((Rate == MGN_1M) || (Rate == MGN_2M) || (Rate == MGN_5_5M) || (Rate == MGN_11M)) 1112 1119 offset = pDM_Odm->Remnant_CCKSwingIdx; 1113 - } else { 1120 + else 1114 1121 offset = pDM_Odm->Remnant_OFDMSwingIdx[RFPath]; 1115 - 1116 - } 1117 1122 1118 1123 return offset; 1119 1124 } ··· 1390 1399 padapter->registrypriv.RegEnableTxPowerByRate == 0) 1391 1400 return 0; 1392 1401 1393 - if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) { 1402 + if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) 1394 1403 return value; 1395 - } 1396 - if (RFPath > ODM_RF_PATH_D) { 1404 + 1405 + if (RFPath > ODM_RF_PATH_D) 1397 1406 return value; 1398 - } 1399 - if (TxNum >= RF_MAX_TX_NUM) { 1407 + 1408 + if (TxNum >= RF_MAX_TX_NUM) 1400 1409 return value; 1401 - } 1402 - if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE) { 1410 + 1411 + if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE) 1403 1412 return value; 1404 - } 1405 1413 1406 1414 return pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex]; 1407 1415 ··· 1418 1428 struct hal_com_data *pHalData = GET_HAL_DATA(padapter); 1419 1429 u8 rateIndex = PHY_GetRateIndexOfTxPowerByRate(Rate); 1420 1430 1421 - if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) { 1431 + if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) 1422 1432 return; 1423 - } 1424 - if (RFPath > ODM_RF_PATH_D) { 1433 + 1434 + if (RFPath > ODM_RF_PATH_D) 1425 1435 return; 1426 - } 1427 - if (TxNum >= RF_MAX_TX_NUM) { 1436 + 1437 + if (TxNum >= RF_MAX_TX_NUM) 1428 1438 return; 1429 - } 1430 - if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE) { 1439 + 1440 + if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE) 1431 1441 return; 1432 - } 1433 1442 1434 1443 pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex] = Value; 1435 1444 } ··· 1625 1636 channel = phy_GetChannelIndexOfTxPowerLimit(band_type, channel); 1626 1637 1627 1638 if (idx_band == -1 || idx_regulation == -1 || idx_bandwidth == -1 || 1628 - idx_rate_sctn == -1 || idx_channel == -1) { 1629 - 1639 + idx_rate_sctn == -1 || idx_channel == -1) 1630 1640 return MAX_POWER_INDEX; 1631 - } 1632 1641 1633 1642 if (band_type == BAND_ON_2_4G) { 1634 1643 s8 limits[10] = {0}; u8 i = 0; ··· 1835 1848 rateSection = 8; 1836 1849 else if (eqNByte(RateSection, (u8 *)("VHT"), 3) && eqNByte(RfPath, (u8 *)("4T"), 2)) 1837 1850 rateSection = 9; 1838 - else { 1851 + else 1839 1852 return; 1840 - } 1841 - 1842 1853 1843 1854 if (eqNByte(Bandwidth, (u8 *)("20M"), 3)) 1844 1855 bandwidth = 0;
+4 -8
drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
··· 197 197 198 198 _ConstructBeacon: 199 199 200 - if ((pktlen + TXDESC_SIZE) > 512) { 200 + if ((pktlen + TXDESC_SIZE) > 512) 201 201 return; 202 - } 203 202 204 203 *pLength = pktlen; 205 204 ··· 445 446 ratio_20_delay += pmlmeext->bcn_delay_ratio[i]; 446 447 ratio_80_delay += pmlmeext->bcn_delay_ratio[i]; 447 448 448 - if (ratio_20_delay > 20 && pmlmeext->DrvBcnEarly == 0xff) { 449 + if (ratio_20_delay > 20 && pmlmeext->DrvBcnEarly == 0xff) 449 450 pmlmeext->DrvBcnEarly = i; 450 - } 451 451 452 - if (ratio_80_delay > 80 && pmlmeext->DrvBcnTimeOut == 0xff) { 452 + if (ratio_80_delay > 80 && pmlmeext->DrvBcnTimeOut == 0xff) 453 453 pmlmeext->DrvBcnTimeOut = i; 454 - } 455 454 456 455 /* reset adaptive_early_32k cnt */ 457 456 pmlmeext->bcn_delay_cnt[i] = 0; ··· 550 553 MaxRsvdPageBufSize = RsvdPageNum*PageSize; 551 554 552 555 pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv); 553 - if (!pcmdframe) { 556 + if (!pcmdframe) 554 557 return; 555 - } 556 558 557 559 ReservedPagePacket = pcmdframe->buf_addr; 558 560 memset(&RsvdPageLoc, 0, sizeof(struct rsvdpage_loc));
+3 -5
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
··· 327 327 /* 2. read power_state = 0xA0[1:0] */ 328 328 tmp_ps = rtw_read8(padapter, 0xa0); 329 329 tmp_ps &= 0x03; 330 - if (tmp_ps != 0x01) { 330 + if (tmp_ps != 0x01) 331 331 pdbgpriv->dbg_downloadfw_pwr_state_cnt++; 332 - } 333 332 334 333 fwfilepath = "rtlwifi/rtl8723bs_nic.bin"; 335 334 ··· 1969 1970 1970 1971 static void hal_notch_filter_8723b(struct adapter *adapter, bool enable) 1971 1972 { 1972 - if (enable) { 1973 + if (enable) 1973 1974 rtw_write8(adapter, rOFDM0_RxDSP+1, rtw_read8(adapter, rOFDM0_RxDSP+1) | BIT1); 1974 - } else { 1975 + else 1975 1976 rtw_write8(adapter, rOFDM0_RxDSP+1, rtw_read8(adapter, rOFDM0_RxDSP+1) & ~BIT1); 1976 - } 1977 1977 } 1978 1978 1979 1979 static void UpdateHalRAMask8723B(struct adapter *padapter, u32 mac_id, u8 rssi_level)
+1 -2
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
··· 777 777 u8 tmpCenterFrequencyIndex1 = pHalData->CurrentCenterFrequencyIndex1; 778 778 779 779 /* check is swchnl or setbw */ 780 - if (!bSwitchChannel && !bSetBandWidth) { 780 + if (!bSwitchChannel && !bSetBandWidth) 781 781 return; 782 - } 783 782 784 783 /* skip change for channel or bandwidth is the same */ 785 784 if (bSwitchChannel) {
+3 -6
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
··· 19 19 if ( 20 20 (padapter->bSurpriseRemoved) || 21 21 (padapter->bDriverStopped) 22 - ) { 22 + ) 23 23 return false; 24 - } 25 24 26 25 HalQueryTxOQTBufferStatus8723BSdio(padapter); 27 26 ··· 274 275 } 275 276 276 277 /* ok to send, remove frame from queue */ 277 - if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) { 278 + if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) 278 279 if ( 279 280 (pxmitframe->attrib.psta->state & WIFI_SLEEP_STATE) && 280 281 (pxmitframe->attrib.triggered == 0) 281 - ) { 282 + ) 282 283 break; 283 - } 284 - } 285 284 286 285 list_del_init(&pxmitframe->list); 287 286 ptxservq->qcnt--;
+2 -2
drivers/staging/rtl8723bs/hal/sdio_halinit.c
··· 651 651 if ((cpwm_orig ^ cpwm_now) & 0x80) 652 652 break; 653 653 654 - if (jiffies_to_msecs(jiffies - start_time) > 100) { 654 + if (jiffies_to_msecs(jiffies - start_time) > 100) 655 655 break; 656 - } 656 + 657 657 } while (1); 658 658 659 659 rtl8723b_set_FwPwrModeInIPS_cmd(padapter, 0);
+2 -4
drivers/staging/rtl8723bs/hal/sdio_ops.c
··· 469 469 adapter = intfhdl->padapter; 470 470 psdio = &adapter_to_dvobj(adapter)->intf_data; 471 471 472 - if (!adapter->hw_init_completed) { 472 + if (!adapter->hw_init_completed) 473 473 return _FAIL; 474 - } 475 474 476 475 cnt = round_up(cnt, 4); 477 476 HalSdioGetCmdAddr8723BSdio(adapter, addr, cnt >> 2, &addr); ··· 855 856 skb_reserve(recvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment)); 856 857 } 857 858 858 - if (!recvbuf->pskb) { 859 + if (!recvbuf->pskb) 859 860 return NULL; 860 - } 861 861 } 862 862 863 863 /* 3 3. read data from rxfifo */
+6 -12
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
··· 236 236 struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 237 237 238 238 bssinf_len = pnetwork->network.IELength + sizeof(struct ieee80211_hdr_3addr); 239 - if (bssinf_len > MAX_BSSINFO_LEN) { 239 + if (bssinf_len > MAX_BSSINFO_LEN) 240 240 goto exit; 241 - } 242 241 243 242 { 244 243 u16 wapi_len = 0; ··· 245 246 if (rtw_get_wapi_ie(pnetwork->network.IEs, pnetwork->network.IELength, NULL, &wapi_len) > 0) 246 247 { 247 248 if (wapi_len > 0) 248 - { 249 249 goto exit; 250 - } 251 250 } 252 251 } 253 252 ··· 408 411 } 409 412 if (!memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(struct ndis_802_11_ssid)) 410 413 && !memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) 411 - ) { 414 + ) 412 415 rtw_cfg80211_inform_bss(padapter, scanned); 413 - } else { 416 + else 414 417 rtw_warn_on(1); 415 - } 416 418 } 417 419 418 420 if (!rtw_cfg80211_check_bss(padapter)) ··· 448 452 449 453 if (!memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) 450 454 && !memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(struct ndis_802_11_ssid)) 451 - ) { 455 + ) 452 456 rtw_cfg80211_inform_bss(padapter, scanned); 453 - } else { 457 + else 454 458 rtw_warn_on(1); 455 - } 456 459 } 457 460 458 461 check_bss: ··· 2191 2196 } 2192 2197 } 2193 2198 2194 - if (false == bMatched) { 2199 + if (false == bMatched) 2195 2200 return -EINVAL; 2196 - } 2197 2201 2198 2202 return 0; 2199 2203 }
+21 -36
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
··· 208 208 if (vht_cap) { 209 209 max_rate = vht_data_rate; 210 210 } else if (ht_cap) { 211 - if (mcs_rate&0x8000) { /* MCS15 */ 211 + if (mcs_rate&0x8000) /* MCS15 */ 212 212 max_rate = (bw_40MHz) ? ((short_GI)?300:270):((short_GI)?144:130); 213 - } else { /* default MCS7 */ 213 + else /* default MCS7 */ 214 214 max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65); 215 - } 216 215 217 216 max_rate = max_rate*2;/* Mbps/2; */ 218 217 } ··· 2324 2325 } 2325 2326 2326 2327 selector = *pdata; 2327 - if (selector < 3 && selector >= 0) { 2328 + if (selector < 3 && selector >= 0) 2328 2329 padapter->pid[selector] = *(pdata+1); 2329 - } 2330 2330 2331 2331 exit: 2332 2332 ··· 2547 2549 int i; 2548 2550 struct recv_reorder_ctrl *preorder_ctrl; 2549 2551 2550 - for (i = 0; i < 16; i++) { 2552 + for (i = 0; i < 16; i++) 2551 2553 preorder_ctrl = &psta->recvreorder_ctrl[i]; 2552 - } 2553 2554 2554 2555 } 2555 2556 break; ··· 2583 2586 2584 2587 plist = get_next(plist); 2585 2588 2586 - if (extra_arg == psta->aid) { 2587 - for (j = 0; j < 16; j++) { 2589 + if (extra_arg == psta->aid) 2590 + for (j = 0; j < 16; j++) 2588 2591 preorder_ctrl = &psta->recvreorder_ctrl[j]; 2589 - } 2590 - } 2591 2592 } 2592 2593 } 2593 2594 ··· 2614 2619 break; 2615 2620 case 0x0c:/* dump rx/tx packet */ 2616 2621 { 2617 - if (arg == 0) { 2622 + if (arg == 0) 2618 2623 /* pHalData->bDumpRxPkt =extra_arg; */ 2619 2624 rtw_hal_set_def_var(padapter, HAL_DEF_DBG_DUMP_RXPKT, &(extra_arg)); 2620 - } else if (arg == 1) { 2625 + else if (arg == 1) 2621 2626 rtw_hal_set_def_var(padapter, HAL_DEF_DBG_DUMP_TXPKT, &(extra_arg)); 2622 - } 2623 2627 } 2624 2628 break; 2625 2629 case 0x0e: ··· 2648 2654 struct registry_priv *pregpriv = &padapter->registrypriv; 2649 2655 /* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, 0x3: enable both 2.4g and 5g */ 2650 2656 /* default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */ 2651 - if (extra_arg == 0 || extra_arg == 1 || extra_arg == 2 || extra_arg == 3) { 2657 + if (extra_arg == 0 || extra_arg == 1 || extra_arg == 2 || extra_arg == 3) 2652 2658 pregpriv->rx_stbc = extra_arg; 2653 - } 2654 2659 } 2655 2660 break; 2656 2661 case 0x13: /* set ampdu_enable */ 2657 2662 { 2658 2663 struct registry_priv *pregpriv = &padapter->registrypriv; 2659 2664 /* 0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec) */ 2660 - if (extra_arg < 3) { 2665 + if (extra_arg < 3) 2661 2666 pregpriv->ampdu_enable = extra_arg; 2662 - } 2663 2667 } 2664 2668 break; 2665 2669 case 0x14: ··· 2696 2704 /* extra_arg : */ 2697 2705 /* BIT0: Enable VHT LDPC Rx, BIT1: Enable VHT LDPC Tx, */ 2698 2706 /* BIT4: Enable HT LDPC Rx, BIT5: Enable HT LDPC Tx */ 2699 - if (arg == 0) { 2707 + if (arg == 0) 2700 2708 pregistrypriv->ldpc_cap = 0x00; 2701 - } else if (arg == 1) { 2709 + else if (arg == 1) 2702 2710 pregistrypriv->ldpc_cap = (u8)(extra_arg&0x33); 2703 - } 2704 2711 } 2705 2712 break; 2706 2713 case 0x1a: ··· 2708 2717 /* extra_arg : */ 2709 2718 /* BIT0: Enable VHT STBC Rx, BIT1: Enable VHT STBC Tx, */ 2710 2719 /* BIT4: Enable HT STBC Rx, BIT5: Enable HT STBC Tx */ 2711 - if (arg == 0) { 2720 + if (arg == 0) 2712 2721 pregistrypriv->stbc_cap = 0x00; 2713 - } else if (arg == 1) { 2722 + else if (arg == 1) 2714 2723 pregistrypriv->stbc_cap = (u8)(extra_arg&0x33); 2715 - } 2716 2724 } 2717 2725 break; 2718 2726 case 0x1b: ··· 3028 3038 } 3029 3039 } else { 3030 3040 psta = rtw_get_stainfo(pstapriv, param->sta_addr); 3031 - if (!psta) { 3041 + if (!psta) 3032 3042 /* ret = -EINVAL; */ 3033 3043 goto exit; 3034 - } 3035 3044 } 3036 3045 3037 3046 if (strcmp(param->u.crypt.alg, "none") == 0 && (psta == NULL)) { ··· 3059 3070 wep_key_len = wep_key_len <= 5 ? 5 : 13; 3060 3071 wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial); 3061 3072 pwep = kzalloc(wep_total_len, GFP_KERNEL); 3062 - if (pwep == NULL) { 3073 + if (pwep == NULL) 3063 3074 goto exit; 3064 - } 3065 3075 3066 3076 pwep->KeyLength = wep_key_len; 3067 3077 pwep->Length = wep_total_len; ··· 3507 3519 if (ie_len > 0) { 3508 3520 pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len); 3509 3521 pmlmepriv->wps_beacon_ie_len = ie_len; 3510 - if (pmlmepriv->wps_beacon_ie == NULL) { 3522 + if (pmlmepriv->wps_beacon_ie == NULL) 3511 3523 return -EINVAL; 3512 - } 3513 3524 3514 3525 memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len); 3515 3526 ··· 3541 3554 if (ie_len > 0) { 3542 3555 pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len); 3543 3556 pmlmepriv->wps_probe_resp_ie_len = ie_len; 3544 - if (pmlmepriv->wps_probe_resp_ie == NULL) { 3557 + if (pmlmepriv->wps_probe_resp_ie == NULL) 3545 3558 return -EINVAL; 3546 - } 3559 + 3547 3560 memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len); 3548 3561 } 3549 3562 ··· 3571 3584 if (ie_len > 0) { 3572 3585 pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len); 3573 3586 pmlmepriv->wps_assoc_resp_ie_len = ie_len; 3574 - if (pmlmepriv->wps_assoc_resp_ie == NULL) { 3587 + if (pmlmepriv->wps_assoc_resp_ie == NULL) 3575 3588 return -EINVAL; 3576 - } 3577 3589 3578 3590 memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len); 3579 3591 } ··· 3925 3939 len = wrqu->data.length; 3926 3940 3927 3941 pbuf = rtw_zmalloc(len); 3928 - if (pbuf == NULL) { 3942 + if (pbuf == NULL) 3929 3943 return -ENOMEM; 3930 - } 3931 3944 3932 3945 if (copy_from_user(pbuf, wrqu->data.pointer, len)) { 3933 3946 kfree(pbuf);
+2 -2
drivers/staging/rtl8723bs/os_dep/mlme_linux.c
··· 148 148 buff = NULL; 149 149 if (authmode == WLAN_EID_VENDOR_SPECIFIC) { 150 150 buff = rtw_zmalloc(IW_CUSTOM_MAX); 151 - if (NULL == buff) { 151 + if (NULL == buff) 152 152 return; 153 - } 153 + 154 154 p = buff; 155 155 156 156 p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs =");
+8 -14
drivers/staging/rtl8723bs/os_dep/os_intfs.c
··· 863 863 goto netdev_open_error; 864 864 865 865 status = rtw_start_drv_threads(padapter); 866 - if (status == _FAIL) { 866 + if (status == _FAIL) 867 867 goto netdev_open_error; 868 - } 869 868 870 869 if (padapter->intf_start) 871 870 padapter->intf_start(padapter); ··· 903 904 struct adapter *padapter = rtw_netdev_priv(pnetdev); 904 905 struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); 905 906 906 - if (pwrctrlpriv->bInSuspend) { 907 + if (pwrctrlpriv->bInSuspend) 907 908 return 0; 908 - } 909 909 910 910 if (mutex_lock_interruptible(&(adapter_to_dvobj(padapter)->hw_init_mutex))) 911 911 return -1; ··· 1177 1179 rtw_stop_cmd_thread(padapter); 1178 1180 1179 1181 /* wait for the latest FW to remove this condition. */ 1180 - if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { 1182 + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) 1181 1183 hal_btcoex_SuspendNotify(padapter, 0); 1182 - } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { 1184 + else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) 1183 1185 hal_btcoex_SuspendNotify(padapter, 1); 1184 - } 1185 1186 1186 1187 rtw_ps_deny_cancel(padapter, PS_DENY_SUSPEND); 1187 1188 1188 - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { 1189 + if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) 1189 1190 rtw_suspend_normal(padapter); 1190 - } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { 1191 + else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) 1191 1192 rtw_suspend_normal(padapter); 1192 - } else { 1193 + else 1193 1194 rtw_suspend_normal(padapter); 1194 - } 1195 1195 1196 1196 DBG_871X_LEVEL(_drv_always_, "rtw suspend success in %d ms\n", 1197 1197 jiffies_to_msecs(jiffies - start_time)); ··· 1244 1248 netif_device_attach(pnetdev); 1245 1249 netif_carrier_on(pnetdev); 1246 1250 1247 - if (padapter->pid[1] != 0) { 1251 + if (padapter->pid[1] != 0) 1248 1252 rtw_signal_process(padapter->pid[1], SIGUSR2); 1249 - } 1250 1253 1251 1254 if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { 1252 1255 if (rtw_chk_roam_flags(padapter, RTW_ROAM_ON_RESUME)) 1253 1256 rtw_roaming(padapter, NULL); 1254 - 1255 1257 } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { 1256 1258 rtw_ap_restore_network(padapter); 1257 1259 }
+1 -2
drivers/staging/rtl8723bs/os_dep/recv_linux.c
··· 62 62 pattrib = &prframe->u.hdr.attrib; 63 63 64 64 sub_skb = rtw_skb_alloc(nSubframe_Length + 12); 65 - if (!sub_skb) { 65 + if (!sub_skb) 66 66 return NULL; 67 - } 68 67 69 68 skb_reserve(sub_skb, 12); 70 69 skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
+3 -6
drivers/staging/rtl8723bs/os_dep/sdio_intf.c
··· 58 58 59 59 psdpriv = sdio_get_drvdata(func); 60 60 61 - if (!psdpriv->if1) { 61 + if (!psdpriv->if1) 62 62 return; 63 - } 64 63 65 64 rtw_sdio_set_irq_thd(psdpriv, current); 66 65 sd_int_hdl(psdpriv->if1); ··· 389 390 goto exit; 390 391 391 392 if1 = rtw_sdio_if1_init(dvobj, id); 392 - if (if1 == NULL) { 393 + if (if1 == NULL) 393 394 goto free_dvobj; 394 - } 395 395 396 396 /* dev_alloc_name && register_netdev */ 397 397 status = rtw_drv_register_netdev(if1); ··· 459 461 struct adapter *padapter = psdpriv->if1; 460 462 struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; 461 463 462 - if (padapter->bDriverStopped) { 464 + if (padapter->bDriverStopped) 463 465 return 0; 464 - } 465 466 466 467 if (pwrpriv->bInSuspend) { 467 468 pdbgpriv->dbg_suspend_error_cnt++;
+18 -34
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
··· 40 40 psdiodev = pintfhdl->pintf_dev; 41 41 psdio = &psdiodev->intf_data; 42 42 43 - if (padapter->bSurpriseRemoved) { 43 + if (padapter->bSurpriseRemoved) 44 44 return v; 45 - } 46 45 47 46 func = psdio->func; 48 47 claim_needed = rtw_sdio_claim_host_needed(func); ··· 72 73 psdiodev = pintfhdl->pintf_dev; 73 74 psdio = &psdiodev->intf_data; 74 75 75 - if (padapter->bSurpriseRemoved) { 76 + if (padapter->bSurpriseRemoved) 76 77 return err; 77 - } 78 78 79 79 func = psdio->func; 80 80 81 81 for (i = 0; i < cnt; i++) { 82 82 pdata[i] = sdio_readb(func, addr + i, &err); 83 - if (err) { 83 + if (err) 84 84 break; 85 - } 86 85 } 87 86 return err; 88 87 } ··· 104 107 psdiodev = pintfhdl->pintf_dev; 105 108 psdio = &psdiodev->intf_data; 106 109 107 - if (padapter->bSurpriseRemoved) { 110 + if (padapter->bSurpriseRemoved) 108 111 return err; 109 - } 110 112 111 113 func = psdio->func; 112 114 claim_needed = rtw_sdio_claim_host_needed(func); ··· 136 140 psdiodev = pintfhdl->pintf_dev; 137 141 psdio = &psdiodev->intf_data; 138 142 139 - if (padapter->bSurpriseRemoved) { 143 + if (padapter->bSurpriseRemoved) 140 144 return err; 141 - } 142 145 143 146 func = psdio->func; 144 147 145 148 for (i = 0; i < cnt; i++) { 146 149 sdio_writeb(func, pdata[i], addr + i, &err); 147 - if (err) { 150 + if (err) 148 151 break; 149 - } 150 152 } 151 153 return err; 152 154 } ··· 168 174 psdiodev = pintfhdl->pintf_dev; 169 175 psdio = &psdiodev->intf_data; 170 176 171 - if (padapter->bSurpriseRemoved) { 177 + if (padapter->bSurpriseRemoved) 172 178 return err; 173 - } 174 179 175 180 func = psdio->func; 176 181 claim_needed = rtw_sdio_claim_host_needed(func); ··· 196 203 psdiodev = pintfhdl->pintf_dev; 197 204 psdio = &psdiodev->intf_data; 198 205 199 - if (padapter->bSurpriseRemoved) { 206 + if (padapter->bSurpriseRemoved) 200 207 return v; 201 - } 202 208 203 209 func = psdio->func; 204 210 claim_needed = rtw_sdio_claim_host_needed(func); ··· 223 231 psdiodev = pintfhdl->pintf_dev; 224 232 psdio = &psdiodev->intf_data; 225 233 226 - if (padapter->bSurpriseRemoved) { 234 + if (padapter->bSurpriseRemoved) 227 235 return v; 228 - } 229 236 230 237 func = psdio->func; 231 238 claim_needed = rtw_sdio_claim_host_needed(func); ··· 275 284 psdiodev = pintfhdl->pintf_dev; 276 285 psdio = &psdiodev->intf_data; 277 286 278 - if (padapter->bSurpriseRemoved) { 287 + if (padapter->bSurpriseRemoved) 279 288 return; 280 - } 281 289 282 290 func = psdio->func; 283 291 claim_needed = rtw_sdio_claim_host_needed(func); ··· 300 310 psdiodev = pintfhdl->pintf_dev; 301 311 psdio = &psdiodev->intf_data; 302 312 303 - if (padapter->bSurpriseRemoved) { 313 + if (padapter->bSurpriseRemoved) 304 314 return; 305 - } 306 315 307 316 func = psdio->func; 308 317 claim_needed = rtw_sdio_claim_host_needed(func); ··· 367 378 psdiodev = pintfhdl->pintf_dev; 368 379 psdio = &psdiodev->intf_data; 369 380 370 - if (padapter->bSurpriseRemoved) { 381 + if (padapter->bSurpriseRemoved) 371 382 return err; 372 - } 373 383 374 384 func = psdio->func; 375 385 ··· 379 391 for (i = 0; i < cnt; i++) { 380 392 *(pbuf + i) = sdio_readb(func, addr + i, &err); 381 393 382 - if (err) { 394 + if (err) 383 395 break; 384 - } 385 396 } 386 397 return err; 387 398 } ··· 417 430 psdiodev = pintfhdl->pintf_dev; 418 431 psdio = &psdiodev->intf_data; 419 432 420 - if (padapter->bSurpriseRemoved) { 433 + if (padapter->bSurpriseRemoved) 421 434 return err; 422 - } 435 + 423 436 func = psdio->func; 424 437 claim_needed = rtw_sdio_claim_host_needed(func); 425 438 ··· 460 473 psdiodev = pintfhdl->pintf_dev; 461 474 psdio = &psdiodev->intf_data; 462 475 463 - if (padapter->bSurpriseRemoved) { 476 + if (padapter->bSurpriseRemoved) 464 477 return err; 465 - } 466 478 467 479 func = psdio->func; 468 480 /* size = sdio_align_size(func, cnt); */ ··· 472 486 473 487 for (i = 0; i < cnt; i++) { 474 488 sdio_writeb(func, *(pbuf + i), addr + i, &err); 475 - if (err) { 489 + if (err) 476 490 break; 477 - } 478 491 } 479 492 480 493 return err; ··· 511 526 psdiodev = pintfhdl->pintf_dev; 512 527 psdio = &psdiodev->intf_data; 513 528 514 - if (padapter->bSurpriseRemoved) { 529 + if (padapter->bSurpriseRemoved) 515 530 return err; 516 - } 517 531 518 532 func = psdio->func; 519 533 claim_needed = rtw_sdio_claim_host_needed(func);
+3 -6
drivers/staging/rtl8723bs/os_dep/xmit_linux.c
··· 112 112 queue = skb_get_queue_mapping(pkt); 113 113 if (padapter->registrypriv.wifi_spec) { 114 114 /* No free space for Tx, tx_worker is too slow */ 115 - if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD) { 115 + if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD) 116 116 netif_stop_subqueue(padapter->pnetdev, queue); 117 - } 118 117 } else { 119 118 if (pxmitpriv->free_xmitframe_cnt <= 4) { 120 119 if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue))) ··· 192 193 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 193 194 s32 res = 0; 194 195 195 - if (rtw_if_up(padapter) == false) { 196 + if (rtw_if_up(padapter) == false) 196 197 goto drop_packet; 197 - } 198 198 199 199 rtw_check_xmit_resource(padapter, pkt); 200 200 ··· 211 213 } 212 214 213 215 res = rtw_xmit(padapter, &pkt); 214 - if (res < 0) { 216 + if (res < 0) 215 217 goto drop_packet; 216 - } 217 218 218 219 goto exit; 219 220