diff mbox series

[3/9] mac80211: add parse regulatory info in 6G Hz operation information

Message ID 20210517201932.8860-4-wgong@codeaurora.org
State Superseded
Headers show
Series None | expand

Commit Message

Wen Gong May 17, 2021, 8:19 p.m. UTC
This patch is to convert the regulatory info subfield in HE operation
element to power type and save in struct cfg80211_chan_def.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 net/mac80211/util.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Johannes Berg July 23, 2021, 9:23 a.m. UTC | #1
> 6G Hz

(subject)

You have a few different ways of spelling "6 GHz" in this patchset,
sometimes only 6G, sometimes like this - I'd prefer it be consistently
spelled as "6 GHz" :)

johannes
diff mbox series

Patch

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index f080fcf60e45..f58136e844a7 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3405,6 +3405,16 @@  bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,
 					      NL80211_BAND_6GHZ);
 	he_chandef.chan = ieee80211_get_channel(sdata->local->hw.wiphy, freq);
 
+	switch (u8_get_bits(he_6ghz_oper->control,
+			    IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO)) {
+	case IEEE80211_6GHZ_CTRL_REG_LPI_AP:
+		he_chandef.power_type = NL80211_REG_LPI_AP;
+		break;
+	case IEEE80211_6GHZ_CTRL_REG_SP_AP:
+		he_chandef.power_type = NL80211_REG_SP_AP;
+		break;
+	}
+
 	switch (u8_get_bits(he_6ghz_oper->control,
 			    IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH)) {
 	case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_20MHZ: