Commit 023b40d8 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: rtw_get_cur_max_rate23a(): We are in N mode if...

staging: rtl8723au: rtw_get_cur_max_rate23a(): We are in N mode if WLAN_EID_HT_CAPABILITY is present
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f9558b9
...@@ -100,41 +100,36 @@ u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter) ...@@ -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; u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0;
u16 mcs_rate = 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],
p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, pcur_bss->IELength - 12);
&pcur_bss->IEs[12], if (p && p[1] > 0) {
pcur_bss->IELength - 12); pht_capie = (struct ieee80211_ht_cap *)(p + 2);
if (p && p[1] > 0) {
pht_capie = (struct ieee80211_ht_cap *)(p + 2); memcpy(&mcs_rate, &pht_capie->mcs, 2);
memcpy(&mcs_rate, &pht_capie->mcs, 2); /* bw_40MHz = (pht_capie->cap_info&
IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */
/* bw_40MHz = (pht_capie->cap_info& /* cur_bwmod is updated by beacon, pmlmeinfo is
IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */ updated by association response */
/* cur_bwmod is updated by beacon, pmlmeinfo is bw_40MHz = (pmlmeext->cur_bwmode &&
updated by association response */ (pmlmeinfo->HT_info.ht_param &
bw_40MHz = (pmlmeext->cur_bwmode && IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0;
(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 = (pht_capie->cap_info & (IEEE80211_HT_CAP short_GI_20 = (pmlmeinfo->ht_cap.cap_info &
_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */ cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ? 1:0;
short_GI_20 = short_GI_40 = (pmlmeinfo->ht_cap.cap_info &
(pmlmeinfo->ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ? 1:0;
cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ? 1:0;
short_GI_40 = rf_type = rtl8723a_get_rf_type(adapter);
(pmlmeinfo->ht_cap.cap_info & max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz &
cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ? 1:0; pregistrypriv->cbw40_enable,
short_GI_20, short_GI_40,
rf_type = rtl8723a_get_rf_type(adapter); &pmlmeinfo->ht_cap.mcs);
max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz &
pregistrypriv->cbw40_enable,
short_GI_20, short_GI_40,
&pmlmeinfo->ht_cap.mcs);
}
} else { } else {
while ((pcur_bss->SupportedRates[i] != 0) && while (pcur_bss->SupportedRates[i] != 0 &&
(pcur_bss->SupportedRates[i] != 0xFF)) { pcur_bss->SupportedRates[i] != 0xFF) {
rate = pcur_bss->SupportedRates[i] & 0x7F; rate = pcur_bss->SupportedRates[i] & 0x7F;
if (rate>max_rate) if (rate>max_rate)
max_rate = rate; max_rate = rate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment