All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Gong <wgong@codeaurora.org>
To: johannes@sipsolutions.net, ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, wgong@codeaurora.org
Subject: [PATCH v4 2/6] mac80211: add parse regulatory info in 6 GHz operation information
Date: Fri, 24 Sep 2021 06:00:48 -0400	[thread overview]
Message-ID: <20210924100052.32029-3-wgong@codeaurora.org> (raw)
In-Reply-To: <20210924100052.32029-1-wgong@codeaurora.org>

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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index ca8008ba9b1f..66e48f29495a 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;
 	bool support_80_80, support_160;
 	u8 he_phy_cap;
 	u32 freq;
@@ -3428,6 +3429,18 @@ 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);
 
+	bss_conf = &sdata->vif.bss_conf;
+
+	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;
+	}
+
 	switch (u8_get_bits(he_6ghz_oper->control,
 			    IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH)) {
 	case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_20MHZ:
-- 
2.31.1


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

WARNING: multiple messages have this Message-ID
From: Wen Gong <wgong@codeaurora.org>
To: johannes@sipsolutions.net, ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, wgong@codeaurora.org
Subject: [PATCH v4 2/6] mac80211: add parse regulatory info in 6 GHz operation information
Date: Fri, 24 Sep 2021 06:00:48 -0400	[thread overview]
Message-ID: <20210924100052.32029-3-wgong@codeaurora.org> (raw)
In-Reply-To: <20210924100052.32029-1-wgong@codeaurora.org>

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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index ca8008ba9b1f..66e48f29495a 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;
 	bool support_80_80, support_160;
 	u8 he_phy_cap;
 	u32 freq;
@@ -3428,6 +3429,18 @@ 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);
 
+	bss_conf = &sdata->vif.bss_conf;
+
+	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;
+	}
+
 	switch (u8_get_bits(he_6ghz_oper->control,
 			    IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH)) {
 	case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_20MHZ:
-- 
2.31.1


  parent reply	other threads:[~2021-09-24 10:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 10:00 [PATCH v4 0/6] cfg80211/mac80211: Add support for 6GHZ STA for various modes : LPI, SP and VLP Wen Gong
2021-09-24 10:00 ` Wen Gong
2021-09-24 10:00 ` [PATCH v4 1/6] mac80211: add power type definition for 6 GHz Wen Gong
2021-09-24 10:00   ` Wen Gong
2021-09-24 10:00 ` Wen Gong [this message]
2021-09-24 10:00   ` [PATCH v4 2/6] mac80211: add parse regulatory info in 6 GHz operation information Wen Gong
2021-09-27 11:22   ` Johannes Berg
2021-09-27 11:22     ` Johannes Berg
2021-09-24 10:00 ` [PATCH v4 3/6] cfg80211: add definition for 6 GHz power spectral density(psd) Wen Gong
2021-09-24 10:00   ` Wen Gong
2021-09-27 11:28   ` Johannes Berg
2021-09-27 11:28     ` Johannes Berg
2021-09-24 10:00 ` [PATCH v4 4/6] cfg80211: save power spectral density(psd) of regulatory rule Wen Gong
2021-09-24 10:00   ` Wen Gong
2021-09-27 11:27   ` Johannes Berg
2021-09-27 11:27     ` Johannes Berg
2021-09-28  9:05     ` Wen Gong
2021-09-28  9:05       ` Wen Gong
2021-09-24 10:00 ` [PATCH v4 5/6] mac80211: use ieee802_11_parse_elems() to find ies instead of ieee80211_bss_get_ie() Wen Gong
2021-09-24 10:00   ` Wen Gong
2021-09-24 10:13   ` Johannes Berg
2021-09-24 10:13     ` Johannes Berg
2021-09-24 10:47     ` Johannes Berg
2021-09-24 10:47       ` Johannes Berg
2021-09-24 10:00 ` [PATCH v4 6/6] mac80211: save transmit power envelope element and power constraint Wen Gong
2021-09-24 10:00   ` Wen Gong

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=20210924100052.32029-3-wgong@codeaurora.org \
    --to=wgong@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=johannes@sipsolutions.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.