diff options
author | Shaul Triebitz <shaul.triebitz@intel.com> | 2018-12-15 04:03:20 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-12-18 08:19:52 -0500 |
commit | dc7eb0f2c23f58bc0e15574bda2dc8498d30a833 (patch) | |
tree | 4817563334a235ed01d23e8159276bc183ded4c6 /net/mac80211/mlme.c | |
parent | 002245ec20b273bc1e31ed8fbee01396955a0f19 (diff) |
mac80211: do not advertise HE cap IE if HE disabled
When disabling HE due to the lack of HT/VHT, do it
at an earlier stage to avoid advertising HE capabilities IE.
Also, at this point, no need to check if AP supports HE, since
it is already checked earlier (in ieee80211_prep_channel).
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 8c6a4dc017a5..54e511dbbc12 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -916,6 +916,15 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) | |||
916 | ieee80211_add_vht_ie(sdata, skb, sband, | 916 | ieee80211_add_vht_ie(sdata, skb, sband, |
917 | &assoc_data->ap_vht_cap); | 917 | &assoc_data->ap_vht_cap); |
918 | 918 | ||
919 | /* | ||
920 | * If AP doesn't support HT, mark HE as disabled. | ||
921 | * If on the 5GHz band, make sure it supports VHT. | ||
922 | */ | ||
923 | if (ifmgd->flags & IEEE80211_STA_DISABLE_HT || | ||
924 | (sband->band == NL80211_BAND_5GHZ && | ||
925 | ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) | ||
926 | ifmgd->flags |= IEEE80211_STA_DISABLE_HE; | ||
927 | |||
919 | if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE)) | 928 | if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE)) |
920 | ieee80211_add_he_ie(sdata, skb, sband); | 929 | ieee80211_add_he_ie(sdata, skb, sband); |
921 | 930 | ||
@@ -3231,16 +3240,6 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, | |||
3231 | goto out; | 3240 | goto out; |
3232 | } | 3241 | } |
3233 | 3242 | ||
3234 | /* | ||
3235 | * If AP doesn't support HT, or it doesn't have HE mandatory IEs, mark | ||
3236 | * HE as disabled. If on the 5GHz band, make sure it supports VHT. | ||
3237 | */ | ||
3238 | if (ifmgd->flags & IEEE80211_STA_DISABLE_HT || | ||
3239 | (sband->band == NL80211_BAND_5GHZ && | ||
3240 | ifmgd->flags & IEEE80211_STA_DISABLE_VHT) || | ||
3241 | (!elems.he_cap && !elems.he_operation)) | ||
3242 | ifmgd->flags |= IEEE80211_STA_DISABLE_HE; | ||
3243 | |||
3244 | if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && | 3243 | if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && |
3245 | (!elems.he_cap || !elems.he_operation)) { | 3244 | (!elems.he_cap || !elems.he_operation)) { |
3246 | mutex_unlock(&sdata->local->sta_mtx); | 3245 | mutex_unlock(&sdata->local->sta_mtx); |