@@ -3,7 +3,7 @@
* HE handling
*
* Copyright(c) 2017 Intel Deutschland GmbH
- * Copyright(c) 2019 - 2020 Intel Corporation
+ * Copyright(c) 2019 - 2021 Intel Corporation
*/
#include "ieee80211_i.h"
@@ -117,10 +117,11 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
u8 mcs_nss_size;
u8 he_total_size;
bool own_160, peer_160, own_80p80, peer_80p80;
+ enum nl80211_iftype iftype = ieee80211_vif_type_p2p(&sdata->vif);
memset(he_cap, 0, sizeof(*he_cap));
- if (!he_cap_ie || !ieee80211_get_he_sta_cap(sband))
+ if (!he_cap_ie || !ieee80211_get_he_iftype_cap(sband, iftype))
return;
/* Make sure size is OK */
@@ -4954,7 +4954,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
}
- if (!ieee80211_get_he_sta_cap(sband))
+ if (!ieee80211_get_he_iftype_cap(sband,
+ ieee80211_vif_type_p2p(&sdata->vif)))
ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
rcu_read_lock();
@@ -1776,6 +1776,7 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_sub_if_data *sdata,
int shift;
u32 rate_flags;
bool have_80mhz = false;
+ enum nl80211_iftype iftype;
*offset = 0;
@@ -1937,17 +1938,25 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_sub_if_data *sdata,
*offset = noffset;
}
- he_cap = ieee80211_get_he_sta_cap(sband);
+ iftype = ieee80211_vif_type_p2p(&sdata->vif);
+ he_cap = ieee80211_get_he_iftype_cap(sband, iftype);
if (he_cap &&
cfg80211_any_usable_channels(local->hw.wiphy, BIT(sband->band),
IEEE80211_CHAN_NO_HE)) {
pos = ieee80211_ie_build_he_cap(pos, he_cap, end);
if (!pos)
goto out_err;
+ }
+
+ if (cfg80211_any_usable_channels(local->hw.wiphy,
+ BIT(NL80211_BAND_6GHZ),
+ IEEE80211_CHAN_NO_HE)) {
+ struct ieee80211_supported_band *sband6;
+
+ sband6 = local->hw.wiphy->bands[NL80211_BAND_6GHZ];
+ he_cap = ieee80211_get_he_iftype_cap(sband6, iftype);
- if (sband->band == NL80211_BAND_6GHZ) {
- enum nl80211_iftype iftype =
- ieee80211_vif_type_p2p(&sdata->vif);
+ if (he_cap) {
__le16 cap = ieee80211_get_he_6ghz_capa(sband, iftype);
pos = ieee80211_write_he_6ghz_cap(pos, cap, end);