All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aloka Dixit <quic_alokad@quicinc.com>
To: <johannes@sipsolutions.net>, <linux-wireless@vger.kernel.org>
Cc: Aloka Dixit <quic_alokad@quicinc.com>
Subject: [PATCH v3 4/6] wifi: mac80211: configure puncturing bitmap in channel_switch()
Date: Sun, 29 Jan 2023 23:22:37 -0800	[thread overview]
Message-ID: <20230130072239.26345-5-quic_alokad@quicinc.com> (raw)
In-Reply-To: <20230130072239.26345-1-quic_alokad@quicinc.com>

Validate and set the puncturing bitmap in bss_conf for new channel.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
 include/net/mac80211.h |  3 +++
 net/mac80211/cfg.c     | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b1c17c7ac044..87db6055d331 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -645,6 +645,7 @@ struct ieee80211_fils_discovery {
  * @csa_active: marks whether a channel switch is going on. Internally it is
  *	write-protected by sdata_lock and local->mtx so holding either is fine
  *	for read access.
+ * @csa_punct_bitmap: new pucturing bitmap for channel switch
  * @mu_mimo_owner: indicates interface owns MU-MIMO capability
  * @chanctx_conf: The channel context this interface is assigned to, or %NULL
  *	when it is not assigned. This pointer is RCU-protected due to the TX
@@ -741,6 +742,8 @@ struct ieee80211_bss_conf {
 	u32 eht_puncturing;
 
 	bool csa_active;
+	u32 csa_punct_bitmap;
+
 	bool mu_mimo_owner;
 	struct ieee80211_chanctx_conf __rcu *chanctx_conf;
 
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 87aab0ba9353..8a1cb2f083f5 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3553,6 +3553,12 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
 	lockdep_assert_held(&local->mtx);
 	lockdep_assert_held(&local->chanctx_mtx);
 
+	if (sdata->vif.bss_conf.eht_puncturing != sdata->vif.bss_conf.csa_punct_bitmap) {
+		sdata->vif.bss_conf.eht_puncturing =
+					sdata->vif.bss_conf.csa_punct_bitmap;
+		changed |= BSS_CHANGED_EHT_PUNCTURING;
+	}
+
 	/*
 	 * using reservation isn't immediate as it may be deferred until later
 	 * with multi-vif. once reservation is complete it will re-schedule the
@@ -3856,9 +3862,16 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
 		goto out;
 	}
 
+	if (params->punct_bitmap &&
+	    (!sdata->vif.bss_conf.eht_support ||
+	     !ieee80211_valid_disable_subchannel_bitmap(&params->punct_bitmap,
+							params->chandef.width)))
+		goto out;
+
 	sdata->deflink.csa_chandef = params->chandef;
 	sdata->deflink.csa_block_tx = params->block_tx;
 	sdata->vif.bss_conf.csa_active = true;
+	sdata->vif.bss_conf.csa_punct_bitmap = params->punct_bitmap;
 
 	if (sdata->deflink.csa_block_tx)
 		ieee80211_stop_vif_queues(local, sdata,
-- 
2.39.0


  parent reply	other threads:[~2023-01-30  7:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  7:22 [PATCH v3 0/6] Puncturing support in AP mode Aloka Dixit
2023-01-30  7:22 ` [PATCH v3 1/6] wifi: nl80211: configure puncturing bitmap in NL80211_CMD_START_AP Aloka Dixit
2023-01-30  8:40   ` Johannes Berg
2023-01-30 19:35     ` Aloka Dixit
2023-01-30 19:40       ` Aloka Dixit
2023-01-30  7:22 ` [PATCH v3 2/6] wifi: mac80211: validate and configure puncturing bitmap in start_ap() Aloka Dixit
2023-01-30  8:42   ` Johannes Berg
2023-01-30  7:22 ` [PATCH v3 3/6] wifi: nl80211: configure puncturing in NL80211_CMD_CHANNEL_SWITCH Aloka Dixit
2023-01-30  8:43   ` Johannes Berg
2023-01-30  7:22 ` Aloka Dixit [this message]
2023-01-30  8:44   ` [PATCH v3 4/6] wifi: mac80211: configure puncturing bitmap in channel_switch() Johannes Berg
2023-01-30  7:22 ` [PATCH v3 5/6] wifi: cfg80211: add puncturing bitmap in channel switch notifications Aloka Dixit
2023-01-30  8:45   ` Johannes Berg
2023-01-30  7:22 ` [PATCH v3 6/6] wifi: nl80211: add puncturing bitmap in channel switch events Aloka Dixit
2023-01-30  8:48 ` [PATCH v3 0/6] Puncturing support in AP mode Johannes Berg
2023-01-30 19:44   ` Aloka Dixit

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=20230130072239.26345-5-quic_alokad@quicinc.com \
    --to=quic_alokad@quicinc.com \
    --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.