staging: rtl8723au: rtw_get_cur_max_rate23a(): We are in N mode if WLAN_EID_HT_CAPABI...
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 9 Jun 2014 13:17:02 +0000 (15:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:05:40 +0000 (14:05 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_ioctl_set.c

index 481f94c..e2c40a6 100644 (file)
@@ -100,41 +100,36 @@ u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter)
        u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0;
        u16 mcs_rate = 0;
 
-       if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) {
-               p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY,
-                                    &pcur_bss->IEs[12],
-                                    pcur_bss->IELength - 12);
-               if (p && p[1] > 0) {
-                       pht_capie = (struct ieee80211_ht_cap *)(p + 2);
-
-                       memcpy(&mcs_rate, &pht_capie->mcs, 2);
-
-                       /* bw_40MHz = (pht_capie->cap_info&
-                          IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */
-                       /* cur_bwmod is updated by beacon, pmlmeinfo is
-                          updated by association response */
-                       bw_40MHz = (pmlmeext->cur_bwmode &&
-                                   (pmlmeinfo->HT_info.ht_param &
-                                    IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0;
-
-                       /* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP
-                          _SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */
-                       short_GI_20 =
-                               (pmlmeinfo->ht_cap.cap_info &
-                                cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ? 1:0;
-                       short_GI_40 =
-                               (pmlmeinfo->ht_cap.cap_info &
-                                cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ? 1:0;
-
-                       rf_type = rtl8723a_get_rf_type(adapter);
-                       max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz &
-                                               pregistrypriv->cbw40_enable,
-                                               short_GI_20, short_GI_40,
-                                               &pmlmeinfo->ht_cap.mcs);
-               }
+       p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, &pcur_bss->IEs[12],
+                            pcur_bss->IELength - 12);
+       if (p && p[1] > 0) {
+               pht_capie = (struct ieee80211_ht_cap *)(p + 2);
+
+               memcpy(&mcs_rate, &pht_capie->mcs, 2);
+
+               /* bw_40MHz = (pht_capie->cap_info&
+                  IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */
+               /* cur_bwmod is updated by beacon, pmlmeinfo is
+                  updated by association response */
+               bw_40MHz = (pmlmeext->cur_bwmode &&
+                           (pmlmeinfo->HT_info.ht_param &
+                            IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0;
+
+               /* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP
+                  _SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */
+               short_GI_20 = (pmlmeinfo->ht_cap.cap_info &
+                              cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ? 1:0;
+               short_GI_40 = (pmlmeinfo->ht_cap.cap_info &
+                              cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ? 1:0;
+
+               rf_type = rtl8723a_get_rf_type(adapter);
+               max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz &
+                                          pregistrypriv->cbw40_enable,
+                                          short_GI_20, short_GI_40,
+                                          &pmlmeinfo->ht_cap.mcs);
        } else {
-               while ((pcur_bss->SupportedRates[i] != 0) &&
-                      (pcur_bss->SupportedRates[i] != 0xFF)) {
+               while (pcur_bss->SupportedRates[i] != 0 &&
+                      pcur_bss->SupportedRates[i] != 0xFF) {
                        rate = pcur_bss->SupportedRates[i] & 0x7F;
                        if (rate>max_rate)
                                max_rate = rate;