diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2014-06-09 09:17:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-18 17:05:40 -0400 |
commit | 023b40d882d7bfee65612115fd736bafd285e8dc (patch) | |
tree | 7b9e99efdec96d1fc541743ec079664805728239 | |
parent | 8f9558b906bed222231fcfaed89cca36d0b56f01 (diff) |
staging: rtl8723au: rtw_get_cur_max_rate23a(): We are in N mode if WLAN_EID_HT_CAPABILITY is present
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8723au/core/rtw_ioctl_set.c | 63 |
1 files 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 481f94cdb3fa..e2c40a6faf0b 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) | |||
100 | u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0; | 100 | u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0; |
101 | u16 mcs_rate = 0; | 101 | u16 mcs_rate = 0; |
102 | 102 | ||
103 | if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) { | 103 | p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, &pcur_bss->IEs[12], |
104 | p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, | 104 | pcur_bss->IELength - 12); |
105 | &pcur_bss->IEs[12], | 105 | if (p && p[1] > 0) { |
106 | pcur_bss->IELength - 12); | 106 | pht_capie = (struct ieee80211_ht_cap *)(p + 2); |
107 | if (p && p[1] > 0) { | 107 | |
108 | pht_capie = (struct ieee80211_ht_cap *)(p + 2); | 108 | memcpy(&mcs_rate, &pht_capie->mcs, 2); |
109 | 109 | ||
110 | memcpy(&mcs_rate, &pht_capie->mcs, 2); | 110 | /* bw_40MHz = (pht_capie->cap_info& |
111 | 111 | IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */ | |
112 | /* bw_40MHz = (pht_capie->cap_info& | 112 | /* cur_bwmod is updated by beacon, pmlmeinfo is |
113 | IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */ | 113 | updated by association response */ |
114 | /* cur_bwmod is updated by beacon, pmlmeinfo is | 114 | bw_40MHz = (pmlmeext->cur_bwmode && |
115 | updated by association response */ | 115 | (pmlmeinfo->HT_info.ht_param & |
116 | bw_40MHz = (pmlmeext->cur_bwmode && | 116 | IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0; |
117 | (pmlmeinfo->HT_info.ht_param & | 117 | |
118 | IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0; | 118 | /* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP |
119 | 119 | _SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */ | |
120 | /* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP | 120 | short_GI_20 = (pmlmeinfo->ht_cap.cap_info & |
121 | _SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */ | 121 | cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ? 1:0; |
122 | short_GI_20 = | 122 | short_GI_40 = (pmlmeinfo->ht_cap.cap_info & |
123 | (pmlmeinfo->ht_cap.cap_info & | 123 | cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ? 1:0; |
124 | cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ? 1:0; | 124 | |
125 | short_GI_40 = | 125 | rf_type = rtl8723a_get_rf_type(adapter); |
126 | (pmlmeinfo->ht_cap.cap_info & | 126 | max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz & |
127 | cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ? 1:0; | 127 | pregistrypriv->cbw40_enable, |
128 | 128 | short_GI_20, short_GI_40, | |
129 | rf_type = rtl8723a_get_rf_type(adapter); | 129 | &pmlmeinfo->ht_cap.mcs); |
130 | max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz & | ||
131 | pregistrypriv->cbw40_enable, | ||
132 | short_GI_20, short_GI_40, | ||
133 | &pmlmeinfo->ht_cap.mcs); | ||
134 | } | ||
135 | } else { | 130 | } else { |
136 | while ((pcur_bss->SupportedRates[i] != 0) && | 131 | while (pcur_bss->SupportedRates[i] != 0 && |
137 | (pcur_bss->SupportedRates[i] != 0xFF)) { | 132 | pcur_bss->SupportedRates[i] != 0xFF) { |
138 | rate = pcur_bss->SupportedRates[i] & 0x7F; | 133 | rate = pcur_bss->SupportedRates[i] & 0x7F; |
139 | if (rate>max_rate) | 134 | if (rate>max_rate) |
140 | max_rate = rate; | 135 | max_rate = rate; |