linux/debian/patches/features/all/r8723au/0083-staging-rtl8723au-rtw_...

88 lines
3.4 KiB
Diff

From: Jes Sorensen <Jes.Sorensen@redhat.com>
Date: Mon, 9 Jun 2014 15:17:02 +0200
Subject: [083/249] staging: rtl8723au: rtw_get_cur_max_rate23a(): We are in N
mode if WLAN_EID_HT_CAPABILITY is present
Origin: https://git.kernel.org/linus/023b40d882d7bfee65612115fd736bafd285e8dc
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 | 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;