diff options
author | Wen Gong <wgong@codeaurora.org> | 2021-09-24 12:00:48 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2021-09-27 13:15:33 +0200 |
commit | cb751b7a57e50d356ec8fc7712c245a05515e787 (patch) | |
tree | aee799d8500880a50a2fc2bd55f8b9e2dc9eff73 /net/mac80211 | |
parent | ieee80211: add power type definition for 6 GHz (diff) | |
download | linux-cb751b7a57e50d356ec8fc7712c245a05515e787.tar.xz linux-cb751b7a57e50d356ec8fc7712c245a05515e787.zip |
mac80211: add parse regulatory info in 6 GHz operation information
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>
Link: https://lore.kernel.org/r/20210924100052.32029-3-wgong@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/util.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index ca8008ba9b1f..39fa2a50385d 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -3385,6 +3385,7 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata, const struct ieee80211_sta_he_cap *he_cap; struct cfg80211_chan_def he_chandef = *chandef; const struct ieee80211_he_6ghz_oper *he_6ghz_oper; + struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf; bool support_80_80, support_160; u8 he_phy_cap; u32 freq; @@ -3429,6 +3430,19 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata, 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: + bss_conf->power_type = IEEE80211_REG_LPI_AP; + break; + case IEEE80211_6GHZ_CTRL_REG_SP_AP: + bss_conf->power_type = IEEE80211_REG_SP_AP; + break; + default: + bss_conf->power_type = IEEE80211_REG_UNSET_AP; + break; + } + + switch (u8_get_bits(he_6ghz_oper->control, IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH)) { case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_20MHZ: he_chandef.width = NL80211_CHAN_WIDTH_20; |