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

staging: rtl8723au: Eliminate struct HT_info_element

Yet another duplicate version of struct ieee80211_ht_operation

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jes Sorensen and committed by
Greg Kroah-Hartman
4dc5f8ba 6594c965

+47 -63
+8 -6
drivers/staging/rtl8723au/core/rtw_ap.c
··· 652 652 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 653 653 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 654 654 struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network; 655 - struct HT_info_element *pht_info = NULL; 655 + struct ieee80211_ht_operation *pht_info = NULL; 656 656 int bcn_fixed_size; 657 657 658 658 bcn_interval = (u16)pnetwork->BeaconPeriod; ··· 736 736 pnetwork->IEs + bcn_fixed_size, 737 737 pnetwork->IELength - bcn_fixed_size); 738 738 if (p && p[1]) { 739 - pht_info = (struct HT_info_element *)(p + 2); 739 + pht_info = (struct ieee80211_ht_operation *)(p + 2); 740 740 741 - if (pregpriv->cbw40_enable && pht_info->infos[0] & BIT(2)) { 741 + if (pregpriv->cbw40_enable && pht_info->ht_param & 742 + IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) { 742 743 /* switch to the 40M Hz mode */ 743 744 cur_bwmode = HT_CHANNEL_WIDTH_40; 744 - switch (pht_info->infos[0] & 0x3) { 745 - case 1: 745 + switch (pht_info->ht_param & 746 + IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { 747 + case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 746 748 /* pmlmeext->cur_ch_offset = 747 749 HAL_PRIME_CHNL_OFFSET_LOWER; */ 748 750 cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; 749 751 break; 750 - case 3: 752 + case IEEE80211_HT_PARAM_CHA_SEC_BELOW: 751 753 cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; 752 754 break; 753 755 default:
+3 -3
drivers/staging/rtl8723au/core/rtw_ieee80211.c
··· 859 859 u8 bencrypt = 0; 860 860 /* u8 wpa_ie[255], rsn_ie[255]; */ 861 861 u16 wpa_len = 0, rsn_len = 0; 862 - struct HT_info_element *pht_info; 862 + struct ieee80211_ht_operation *pht_info; 863 863 struct ieee80211_ht_cap *pht_cap; 864 864 const u8 *p; 865 865 ··· 916 916 pnetwork->network.IEs + _FIXED_IE_LENGTH_, 917 917 pnetwork->network.IELength - _FIXED_IE_LENGTH_); 918 918 if (p && p[1] > 0) { 919 - pht_info = (struct HT_info_element *)(p + 2); 920 - pnetwork->BcnInfo.ht_info_infos_0 = pht_info->infos[0]; 919 + pht_info = (struct ieee80211_ht_operation *)(p + 2); 920 + pnetwork->BcnInfo.ht_info_infos_0 = pht_info->ht_param; 921 921 } else 922 922 pnetwork->BcnInfo.ht_info_infos_0 = 0; 923 923 }
+2 -2
drivers/staging/rtl8723au/core/rtw_ioctl_set.c
··· 394 394 /* cur_bwmod is updated by beacon, pmlmeinfo is 395 395 updated by association response */ 396 396 bw_40MHz = (pmlmeext->cur_bwmode && 397 - (IEEE80211_HT_PARAM_CHAN_WIDTH_ANY & 398 - pmlmeinfo->HT_info.infos[0])) ? 1:0; 397 + (pmlmeinfo->HT_info.ht_param & 398 + IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0; 399 399 400 400 /* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP 401 401 _SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */
+8 -6
drivers/staging/rtl8723au/core/rtw_mlme.c
··· 2322 2322 if (pregistrypriv->cbw40_enable && 2323 2323 pmlmeinfo->ht_cap.cap_info & 2324 2324 cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40) && 2325 - pmlmeinfo->HT_info.infos[0] & BIT(2)) { 2325 + pmlmeinfo->HT_info.ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) { 2326 2326 int i; 2327 2327 u8 rf_type; 2328 2328 ··· 2339 2339 } 2340 2340 /* switch to the 40M Hz mode accoring to the AP */ 2341 2341 pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; 2342 - switch ((pmlmeinfo->HT_info.infos[0] & 0x3)) 2343 - { 2344 - case HT_EXTCHNL_OFFSET_UPPER: 2342 + switch (pmlmeinfo->HT_info.ht_param & 2343 + IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) { 2344 + case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 2345 2345 pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; 2346 2346 break; 2347 2347 2348 - case HT_EXTCHNL_OFFSET_LOWER: 2348 + case IEEE80211_HT_PARAM_CHA_SEC_BELOW: 2349 2349 pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; 2350 2350 break; 2351 2351 ··· 2368 2368 /* */ 2369 2369 /* Config current HT Protection mode. */ 2370 2370 /* */ 2371 - pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; 2371 + pmlmeinfo->HT_protection = 2372 + le16_to_cpu(pmlmeinfo->HT_info.operation_mode) & 2373 + IEEE80211_HT_OP_MODE_PROTECTION; 2372 2374 } 2373 2375 2374 2376 void rtw_issue_addbareq_cmd23a(struct rtw_adapter *padapter,
+12 -11
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
··· 4640 4640 bssid->IEs + ie_offset, 4641 4641 bssid->IELength - ie_offset); 4642 4642 if (p) { 4643 - struct HT_info_element *HT_info = 4644 - (struct HT_info_element *)(p + 2); 4645 - bssid->DSConfig = HT_info->primary_channel; 4643 + struct ieee80211_ht_operation *HT_info = 4644 + (struct ieee80211_ht_operation *)(p + 2); 4645 + bssid->DSConfig = HT_info->primary_chan; 4646 4646 } else /* use current channel */ 4647 4647 bssid->DSConfig = rtw_get_oper_ch23a(padapter); 4648 4648 } ··· 5959 5959 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 5960 5960 struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network; 5961 5961 const struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf; 5962 - struct HT_info_element *pht_info; 5962 + struct ieee80211_ht_operation *pht_info; 5963 5963 u32 i; 5964 5964 int bcn_fixed_size; 5965 5965 u8 *p; ··· 6028 6028 6029 6029 /* spec case only for cisco's ap because cisco's ap 6030 6030 * issue assoc rsp using mcs rate @40MHz or @20MHz */ 6031 - pht_info = (struct HT_info_element *)(p + 2); 6031 + pht_info = (struct ieee80211_ht_operation *)(p + 2); 6032 6032 6033 - if ((pregpriv->cbw40_enable) && 6034 - (pht_info->infos[0] & BIT(2))) { 6033 + if (pregpriv->cbw40_enable && 6034 + (pht_info->ht_param & 6035 + IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) { 6035 6036 /* switch to the 40M Hz mode according to AP */ 6036 6037 pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; 6037 - switch (pht_info->infos[0] & 0x3) 6038 - { 6039 - case 1: 6038 + switch (pht_info->ht_param & 6039 + IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { 6040 + case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 6040 6041 pmlmeext->cur_ch_offset = 6041 6042 HAL_PRIME_CHNL_OFFSET_LOWER; 6042 6043 break; 6043 6044 6044 - case 3: 6045 + case IEEE80211_HT_PARAM_CHA_SEC_BELOW: 6045 6046 pmlmeext->cur_ch_offset = 6046 6047 HAL_PRIME_CHNL_OFFSET_UPPER; 6047 6048 break;
+13 -12
drivers/staging/rtl8723au/core/rtw_wlan_util.c
··· 635 635 636 636 static void bwmode_update_check(struct rtw_adapter *padapter, u8 *p) 637 637 { 638 - struct HT_info_element *pHT_info; 638 + struct ieee80211_ht_operation *pHT_info; 639 639 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 640 640 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 641 641 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; ··· 648 648 return; 649 649 if (!phtpriv->ht_option) 650 650 return; 651 - if (p[1] > sizeof(struct HT_info_element)) 651 + if (p[1] != sizeof(struct ieee80211_ht_operation)) 652 652 return; 653 653 654 - pHT_info = (struct HT_info_element *)(p + 2); 654 + pHT_info = (struct ieee80211_ht_operation *)(p + 2); 655 655 656 - if ((pHT_info->infos[0] & BIT(2)) && pregistrypriv->cbw40_enable) { 656 + if ((pHT_info->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) && 657 + pregistrypriv->cbw40_enable) { 657 658 new_bwmode = HT_CHANNEL_WIDTH_40; 658 659 659 - switch (pHT_info->infos[0] & 0x3) { 660 - case 1: 660 + switch (pHT_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET){ 661 + case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 661 662 new_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; 662 663 break; 663 - case 3: 664 + case IEEE80211_HT_PARAM_CHA_SEC_BELOW: 664 665 new_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; 665 666 break; 666 667 default: ··· 787 786 if (phtpriv->ht_option == false) 788 787 return; 789 788 790 - if (p[1] > sizeof(struct HT_info_element)) 789 + if (p[1] != sizeof(struct ieee80211_ht_operation)) 791 790 return; 792 791 793 792 pmlmeinfo->HT_info_enable = 1; ··· 884 883 struct ieee80211_mgmt *mgmt, u32 pkt_len) 885 884 { 886 885 struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network; 887 - struct HT_info_element *pht_info; 886 + struct ieee80211_ht_operation *pht_info; 888 887 struct ieee80211_ht_cap *pht_cap; 889 888 struct wlan_bssid_ex *bssid; 890 889 unsigned short val16; ··· 953 952 /* parsing HT_INFO_IE */ 954 953 p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pie, pie_len); 955 954 if (p && p[1] > 0) { 956 - pht_info = (struct HT_info_element *)(p + 2); 957 - ht_info_infos_0 = pht_info->infos[0]; 955 + pht_info = (struct ieee80211_ht_operation *)(p + 2); 956 + ht_info_infos_0 = pht_info->ht_param; 958 957 } else { 959 958 pht_info = NULL; 960 959 ht_info_infos_0 = 0; ··· 986 985 p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pie, pie_len); 987 986 988 987 if (pht_info) 989 - bcn_channel = pht_info->primary_channel; 988 + bcn_channel = pht_info->primary_chan; 990 989 else { /* we don't find channel IE, so don't check it */ 991 990 DBG_8723A("Oops: %s we don't find channel IE, so don't " 992 991 "check it\n", __func__);
+1 -1
drivers/staging/rtl8723au/include/rtw_mlme_ext.h
··· 367 367 struct ADDBA_request ADDBA_req; 368 368 struct WMM_para_element WMM_param; 369 369 struct ieee80211_ht_cap ht_cap; 370 - struct HT_info_element HT_info; 370 + struct ieee80211_ht_operation HT_info; 371 371 struct wlan_bssid_ex network;/* join network or bss_network, if in ap mode, it is the same to cur_network.network */ 372 372 struct FW_Sta_Info FW_sta_info[NUM_STA]; 373 373 };
-11
drivers/staging/rtl8723au/include/rtw_rf.h
··· 89 89 HT_CHANNEL_WIDTH_10 = 4, 90 90 }; 91 91 92 - /* */ 93 - /* Represent Extention Channel Offset in HT Capabilities */ 94 - /* This is available only in 40Mhz mode. */ 95 - /* */ 96 - enum { 97 - HT_EXTCHNL_OFFSET_NO_EXT = 0, 98 - HT_EXTCHNL_OFFSET_UPPER = 1, 99 - HT_EXTCHNL_OFFSET_NO_DEF = 2, 100 - HT_EXTCHNL_OFFSET_LOWER = 3, 101 - }; 102 - 103 92 /* 2007/11/15 MH Define different RF type. */ 104 93 enum { 105 94 RF_1T2R = 0,
-11
drivers/staging/rtl8723au/include/wifi.h
··· 63 63 Below is the definition for 802.11n 64 64 ------------------------------------------------------------------------------*/ 65 65 66 - /* struct rtw_ieee80211_ht_cap - HT additional information 67 - * 68 - * This structure refers to "HT information element" as 69 - * described in 802.11n draft section 7.3.2.53 70 - */ 71 - struct HT_info_element { 72 - unsigned char primary_channel; 73 - unsigned char infos[5]; 74 - unsigned char MCS_rate[16]; 75 - } __packed; 76 - 77 66 struct AC_param { 78 67 unsigned char ACI_AIFSN; 79 68 unsigned char CW;