From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [RFC PATCH v2 06/13] wifi: mac80211: disallow drivers with HT wider than HE
Date: Thu, 23 Nov 2023 23:14:43 +0100 [thread overview]
Message-ID: <20231123231436.1617dc22842f.I4df51ad2f4c844615c168bf9bdb498925b3c77d4@changeid> (raw)
In-Reply-To: <20231123221436.143254-14-johannes@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
To simplify the code in the next patch, disallow drivers
supporting 40 MHz in HT but not HE, since we'd otherwise
have to track local maximum bandwidth per mode there.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/main.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 033a5261ac3a..48e012ee1ae4 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1115,8 +1115,26 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
supp_vht = supp_vht || sband->vht_cap.vht_supported;
for_each_sband_iftype_data(sband, i, iftd) {
+ u8 he_40_mhz_cap;
+
supp_he = supp_he || iftd->he_cap.has_he;
supp_eht = supp_eht || iftd->eht_cap.has_eht;
+
+ if (sband->band == NL80211_BAND_2GHZ)
+ he_40_mhz_cap =
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G;
+ else
+ he_40_mhz_cap =
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G;
+
+ /* currently no support for HE client where HT has 40 MHz but not HT */
+ if (iftd->he_cap.has_he &&
+ iftd->types_mask & (BIT(NL80211_IFTYPE_STATION) |
+ BIT(NL80211_IFTYPE_P2P_CLIENT)) &&
+ sband->ht_cap.ht_supported &&
+ sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 &&
+ !(iftd->he_cap.he_cap_elem.phy_cap_info[0] & he_40_mhz_cap))
+ return -EINVAL;
}
/* HT, VHT, HE require QoS, thus >= 4 queues */
--
2.42.0
next prev parent reply other threads:[~2023-11-23 22:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-23 22:14 [RFC PATCH v2 00/13] refactor and wider-BW OFDMA support Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 01/13] wifi: mac80211: simplify ieee80211_config_bw() prototype Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 02/13] wifi: mac80211: take EML capa/delay from assoc response Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 03/13] wifi: mac80211: remove extra element parsing Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 04/13] wifi: mac80211: simplify HE capability access Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 05/13] wifi: mac80211_hwsim: support HE 40 MHz Johannes Berg
2023-11-23 22:14 ` Johannes Berg [this message]
2023-11-23 22:14 ` [RFC PATCH v2 07/13] wifi: mac80211: clean up connection process Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 08/13] wifi: mac80211: workaround for tests that drop capabilities during CSA Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 09/13] wifi: mac80211: simplify non-chanctx drivers Johannes Berg
2023-11-23 22:32 ` Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 10/13] wifi: mac80211: chan: chandef is non-NULL for reserved Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 11/13] wifi: mac80211: introduce 'channel request' Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 12/13] wifi: mac80211: add and use a link iteration macro Johannes Berg
2023-11-23 22:14 ` [RFC PATCH v2 13/13] wifi: mac80211: support wider bandwidth OFDMA config Johannes Berg
2023-11-23 22:38 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231123231436.1617dc22842f.I4df51ad2f4c844615c168bf9bdb498925b3c77d4@changeid \
--to=johannes@sipsolutions.net \
--cc=johannes.berg@intel.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).