From: Jes Sorensen <jes.soren...@redhat.com>

Signed-off-by: Jes Sorensen <jes.soren...@redhat.com>
---
 drivers/staging/rtl8723au/core/rtw_ioctl_set.c | 63 ++++++++++++--------------
 1 file changed, 29 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c
index 481f94c..e2c40a6 100644
--- a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c
@@ -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;
-- 
1.9.3

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to