]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: r8188eu: replace HT_caps_element with ieee80211_ht_cap structure
authorIvan Safonov <insafonov@gmail.com>
Wed, 24 Aug 2016 08:21:55 +0000 (15:21 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Sep 2016 16:01:41 +0000 (18:01 +0200)
HT_caps_element is reimplementation of ieee80211_ht_cap.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ap.c
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
drivers/staging/rtl8188eu/core/rtw_mlme.c
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
drivers/staging/rtl8188eu/core/rtw_wlan_util.c
drivers/staging/rtl8188eu/include/rtw_mlme_ext.h

index be4d624ce61514cce43fb072eedb740bc68a6f0c..3562f118347dfd9bacb30fa00c3e2e9abaaa5ee2 100644 (file)
@@ -706,12 +706,12 @@ static void update_hw_ht_param(struct adapter *padapter)
 
        /* handle A-MPDU parameter field */
        /*
-               AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
-               AMPDU_para [4:2]:Min MPDU Start Spacing
+               ampdu_params_info [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
+               ampdu_params_info [4:2]:Min MPDU Start Spacing
        */
-       max_AMPDU_len = pmlmeinfo->HT_caps.AMPDU_para & 0x03;
+       max_AMPDU_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x03;
 
-       min_MPDU_spacing = (pmlmeinfo->HT_caps.AMPDU_para & 0x1c) >> 2;
+       min_MPDU_spacing = (pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) >> 2;
 
        rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MIN_SPACE, (u8 *)(&min_MPDU_spacing));
 
@@ -720,7 +720,7 @@ static void update_hw_ht_param(struct adapter *padapter)
        /*  */
        /*  Config SM Power Save setting */
        /*  */
-       pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.HT_caps_info) & 0x0C) >> 2;
+       pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.cap_info) & 0x0C) >> 2;
        if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
                DBG_88E("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __func__);
 }
index a83075215710e062f8980a63394d07a01801ea63..6ed23f4db38ca98209c1b73ba23e758894be8e1f 100644 (file)
@@ -588,8 +588,8 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
                        /* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */
                        bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1 : 0;
 
-                       short_GI_20 = (le16_to_cpu(pmlmeinfo->HT_caps.HT_caps_info) & IEEE80211_HT_CAP_SGI_20) ? 1 : 0;
-                       short_GI_40 = (le16_to_cpu(pmlmeinfo->HT_caps.HT_caps_info) & IEEE80211_HT_CAP_SGI_40) ? 1 : 0;
+                       short_GI_20 = (le16_to_cpu(pmlmeinfo->HT_caps.cap_info) & IEEE80211_HT_CAP_SGI_20) ? 1 : 0;
+                       short_GI_40 = (le16_to_cpu(pmlmeinfo->HT_caps.cap_info) & IEEE80211_HT_CAP_SGI_40) ? 1 : 0;
 
                        rtw_hal_get_hwreg(adapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
                        max_rate = rtw_mcs_rate(
@@ -597,7 +597,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
                                bw_40MHz & (pregistrypriv->cbw40_enable),
                                short_GI_20,
                                short_GI_40,
-                               pmlmeinfo->HT_caps.MCS_rate
+                               pmlmeinfo->HT_caps.mcs.rx_mask
                        );
                }
        } else {
index 03baaa108f7f5568a489d00632fd49f5b770d356..a16d9512d4455a22c645917f90d2d48cf8e40a26 100644 (file)
@@ -1971,8 +1971,8 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
                rtw_hal_get_def_var(padapter, HAL_DEF_MAX_RECVBUF_SZ, &max_recvbuf_sz);
 
                /*
-               AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
-               AMPDU_para [4:2]:Min MPDU Start Spacing
+               ampdu_params_info [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
+               ampdu_params_info [4:2]:Min MPDU Start Spacing
                */
 
                rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor);
@@ -2044,7 +2044,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
 
        /* update cur_bwmode & cur_ch_offset */
        if ((pregistrypriv->cbw40_enable) &&
-           (le16_to_cpu(pmlmeinfo->HT_caps.HT_caps_info) & BIT(1)) &&
+           (le16_to_cpu(pmlmeinfo->HT_caps.cap_info) & BIT(1)) &&
            (pmlmeinfo->HT_info.infos[0] & BIT(2))) {
                int i;
                u8      rf_type;
@@ -2054,9 +2054,9 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
                /* update the MCS rates */
                for (i = 0; i < 16; i++) {
                        if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
-                               pmlmeinfo->HT_caps.MCS_rate[i] &= MCS_rate_1R[i];
+                               ((u8 *)&pmlmeinfo->HT_caps.mcs)[i] &= MCS_rate_1R[i];
                        else
-                               pmlmeinfo->HT_caps.MCS_rate[i] &= MCS_rate_2R[i];
+                               ((u8 *)&pmlmeinfo->HT_caps.mcs)[i] &= MCS_rate_2R[i];
                }
                /* switch to the 40M Hz mode according to the AP */
                pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40;
@@ -2074,7 +2074,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
        }
 
        /*  Config SM Power Save setting */
-       pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.HT_caps_info) & 0x0C) >> 2;
+       pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.cap_info) & 0x0C) >> 2;
        if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
                DBG_88E("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __func__);
 
index 5b7cb480d6ab97de898fdae345b89dc63b90a732..ed026f72b733cda43962cd3c2f03254752ccb006 100644 (file)
@@ -1132,23 +1132,23 @@ static void issue_assocreq(struct adapter *padapter)
        if (padapter->mlmepriv.htpriv.ht_option) {
                p = rtw_get_ie((pmlmeinfo->network.IEs + sizeof(struct ndis_802_11_fixed_ie)), _HT_CAPABILITY_IE_, &ie_len, (pmlmeinfo->network.IELength - sizeof(struct ndis_802_11_fixed_ie)));
                if ((p != NULL) && (!(is_ap_in_tkip(padapter)))) {
-                       memcpy(&(pmlmeinfo->HT_caps), (p + 2), sizeof(struct HT_caps_element));
+                       memcpy(&pmlmeinfo->HT_caps, p + 2, sizeof(struct ieee80211_ht_cap));
 
                        /* to disable 40M Hz support while gd_bw_40MHz_en = 0 */
                        if (pregpriv->cbw40_enable == 0)
-                               pmlmeinfo->HT_caps.HT_caps_info &= cpu_to_le16(~(BIT(6) | BIT(1)));
+                               pmlmeinfo->HT_caps.cap_info &= cpu_to_le16(~(BIT(6) | BIT(1)));
                        else
-                               pmlmeinfo->HT_caps.HT_caps_info |= cpu_to_le16(BIT(1));
+                               pmlmeinfo->HT_caps.cap_info |= cpu_to_le16(BIT(1));
 
                        /* todo: disable SM power save mode */
-                       pmlmeinfo->HT_caps.HT_caps_info |= cpu_to_le16(0x000c);
+                       pmlmeinfo->HT_caps.cap_info |= cpu_to_le16(0x000c);
 
                        rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
                        switch (rf_type) {
                        case RF_1T1R:
                                if (pregpriv->rx_stbc)
-                                       pmlmeinfo->HT_caps.HT_caps_info |= cpu_to_le16(0x0100);/* RX STBC One spatial stream */
-                               memcpy(pmlmeinfo->HT_caps.MCS_rate, MCS_rate_1R, 16);
+                                       pmlmeinfo->HT_caps.cap_info |= cpu_to_le16(0x0100);/* RX STBC One spatial stream */
+                               memcpy((u8 *)&pmlmeinfo->HT_caps.mcs, MCS_rate_1R, 16);
                                break;
                        case RF_2T2R:
                        case RF_1T2R:
@@ -1157,9 +1157,9 @@ static void issue_assocreq(struct adapter *padapter)
                                    ((pmlmeext->cur_wireless_mode & WIRELESS_11_24N) && (pregpriv->rx_stbc == 0x1)) || /* enable for 2.4GHz */
                                    (pregpriv->wifi_spec == 1)) {
                                        DBG_88E("declare supporting RX STBC\n");
-                                       pmlmeinfo->HT_caps.HT_caps_info |= cpu_to_le16(0x0200);/* RX STBC two spatial stream */
+                                       pmlmeinfo->HT_caps.cap_info |= cpu_to_le16(0x0200);/* RX STBC two spatial stream */
                                }
-                               memcpy(pmlmeinfo->HT_caps.MCS_rate, MCS_rate_2R, 16);
+                               memcpy(&pmlmeinfo->HT_caps.mcs, MCS_rate_2R, 16);
                                break;
                        }
                        pframe = rtw_set_ie(pframe, _HT_CAPABILITY_IE_, ie_len , (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen));
@@ -2189,10 +2189,10 @@ static u8 collect_bss_info(struct adapter *padapter,
                struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
                p = rtw_get_ie(bssid->IEs + ie_offset, _HT_CAPABILITY_IE_, &len, bssid->IELength - ie_offset);
                if (p && len > 0) {
-                       struct HT_caps_element  *pHT_caps;
-                       pHT_caps = (struct HT_caps_element *)(p + 2);
+                       struct ieee80211_ht_cap *pHT_caps =
+                               (struct ieee80211_ht_cap *)(p + 2);
 
-                       if (le16_to_cpu(pHT_caps->HT_caps_info) & BIT(14))
+                       if (le16_to_cpu(pHT_caps->cap_info) & BIT(14))
                                pmlmepriv->num_FortyMHzIntolerant++;
                } else {
                        pmlmepriv->num_sta_no_ht++;
index 8994e458d72eaeca0ead012849f4a248a36b3b1c..2d115d718be26b8911a4a573f96ed06a33e18518 100644 (file)
@@ -732,17 +732,17 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
                        HT_cap[i] &= (pIE->data[i]);
                } else {
                        /* modify from  fw by Thomas 2010/11/17 */
-                       if ((pmlmeinfo->HT_caps.AMPDU_para & 0x3) > (pIE->data[i] & 0x3))
+                       if ((pmlmeinfo->HT_caps.ampdu_params_info & 0x3) > (pIE->data[i] & 0x3))
                                max_AMPDU_len = pIE->data[i] & 0x3;
                        else
-                               max_AMPDU_len = pmlmeinfo->HT_caps.AMPDU_para & 0x3;
+                               max_AMPDU_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x3;
 
-                       if ((pmlmeinfo->HT_caps.AMPDU_para & 0x1c) > (pIE->data[i] & 0x1c))
-                               min_MPDU_spacing = pmlmeinfo->HT_caps.AMPDU_para & 0x1c;
+                       if ((pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) > (pIE->data[i] & 0x1c))
+                               min_MPDU_spacing = pmlmeinfo->HT_caps.ampdu_params_info & 0x1c;
                        else
                                min_MPDU_spacing = pIE->data[i] & 0x1c;
 
-                       pmlmeinfo->HT_caps.AMPDU_para = max_AMPDU_len | min_MPDU_spacing;
+                       pmlmeinfo->HT_caps.ampdu_params_info = max_AMPDU_len | min_MPDU_spacing;
                }
        }
 
@@ -751,9 +751,9 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
        /* update the MCS rates */
        for (i = 0; i < 16; i++) {
                if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
-                       pmlmeinfo->HT_caps.MCS_rate[i] &= MCS_rate_1R[i];
+                       ((u8 *)&pmlmeinfo->HT_caps.mcs)[i] &= MCS_rate_1R[i];
                else
-                       pmlmeinfo->HT_caps.MCS_rate[i] &= MCS_rate_2R[i];
+                       ((u8 *)&pmlmeinfo->HT_caps.mcs)[i] &= MCS_rate_2R[i];
        }
 }
 
@@ -799,9 +799,9 @@ void HTOnAssocRsp(struct adapter *padapter)
                AMPDU_para [1:0]:Max AMPDU Len => 0:8k , 1:16k, 2:32k, 3:64k
                AMPDU_para [4:2]:Min MPDU Start Spacing
        */
-       max_AMPDU_len = pmlmeinfo->HT_caps.AMPDU_para & 0x03;
+       max_AMPDU_len = pmlmeinfo->HT_caps.ampdu_params_info & 0x03;
 
-       min_MPDU_spacing = (pmlmeinfo->HT_caps.AMPDU_para & 0x1c) >> 2;
+       min_MPDU_spacing = (pmlmeinfo->HT_caps.ampdu_params_info & 0x1c) >> 2;
 
        rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MIN_SPACE, (u8 *)(&min_MPDU_spacing));
 
@@ -1245,16 +1245,17 @@ unsigned int update_supported_rate(unsigned char *ptn, unsigned int ptn_sz)
        return mask;
 }
 
-unsigned int update_MSC_rate(struct HT_caps_element *pHT_caps)
+unsigned int update_MSC_rate(struct ieee80211_ht_cap *pHT_caps)
 {
        unsigned int mask = 0;
 
-       mask = (pHT_caps->MCS_rate[0] << 12) | (pHT_caps->MCS_rate[1] << 20);
+       mask = (pHT_caps->mcs.rx_mask[0] << 12) |
+              (pHT_caps->mcs.rx_mask[1] << 20);
 
        return mask;
 }
 
-int support_short_GI(struct adapter *padapter, struct HT_caps_element *pHT_caps)
+int support_short_GI(struct adapter *padapter, struct ieee80211_ht_cap *pHT_caps)
 {
        unsigned char                                   bit_offset;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
@@ -1268,7 +1269,7 @@ int support_short_GI(struct adapter *padapter, struct HT_caps_element *pHT_caps)
 
        bit_offset = (pmlmeext->cur_bwmode & HT_CHANNEL_WIDTH_40) ? 6 : 5;
 
-       if (__le16_to_cpu(pHT_caps->HT_caps_info) & (0x1 << bit_offset))
+       if (__le16_to_cpu(pHT_caps->cap_info) & (0x1 << bit_offset))
                return _SUCCESS;
        else
                return _FAIL;
index 9c2447e6d161220cd5851468ae0fe3e59df422be..5ee63661b26faa91c79dd35ec3293fab578e760b 100644 (file)
@@ -349,7 +349,7 @@ struct mlme_ext_info {
 
        struct ADDBA_request    ADDBA_req;
        struct WMM_para_element WMM_param;
-       struct HT_caps_element  HT_caps;
+       struct ieee80211_ht_cap HT_caps;
        struct HT_info_element  HT_info;
        struct wlan_bssid_ex    network;/* join network or bss_network,
                                         * if in ap mode, it is the same
@@ -529,12 +529,12 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie,
 void update_sta_info(struct adapter *padapter, struct sta_info *psta);
 unsigned int update_basic_rate(unsigned char *ptn, unsigned int ptn_sz);
 unsigned int update_supported_rate(unsigned char *ptn, unsigned int ptn_sz);
-unsigned int update_MSC_rate(struct HT_caps_element *pHT_caps);
+unsigned int update_MSC_rate(struct ieee80211_ht_cap *pHT_caps);
 void Update_RA_Entry(struct adapter *padapter, u32 mac_id);
 void set_sta_rate(struct adapter *padapter, struct sta_info *psta);
 
 unsigned char get_highest_rate_idx(u32 mask);
-int support_short_GI(struct adapter *padapter, struct HT_caps_element *caps);
+int support_short_GI(struct adapter *padapter, struct ieee80211_ht_cap *caps);
 unsigned int is_ap_in_tkip(struct adapter *padapter);
 unsigned int is_ap_in_wep(struct adapter *padapter);
 unsigned int should_forbid_n_rate(struct adapter *padapter);