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 3/6] wifi: nl80211: configure puncturing in NL80211_CMD_CHANNEL_SWITCH
Date: Sun, 29 Jan 2023 23:22:36 -0800	[thread overview]
Message-ID: <20230130072239.26345-4-quic_alokad@quicinc.com> (raw)
In-Reply-To: <20230130072239.26345-1-quic_alokad@quicinc.com>

Retrieve the puncturing bitmap during channel switch operation and
store it in struct cfg80211_csa_settings.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
 include/net/cfg80211.h | 5 +++++
 net/mac80211/cfg.c     | 5 ++---
 net/wireless/nl80211.c | 7 +++++++
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index c25a558d50ea..7714a44d312e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1372,6 +1372,10 @@ struct cfg80211_ap_settings {
  * @radar_required: whether radar detection is required on the new channel
  * @block_tx: whether transmissions should be blocked while changing
  * @count: number of beacons until switch
+ * @punct_bitmap: Preamble puncturing bitmap. Each bit represents a 20 MHz
+ *	channel with lowest bit corresponding to the lowest frequency. Bit set
+ *	to 1 indicates that the channel is punctured. Higher 16 bits are
+ *	currently unused.
  */
 struct cfg80211_csa_settings {
 	struct cfg80211_chan_def chandef;
@@ -1384,6 +1388,7 @@ struct cfg80211_csa_settings {
 	bool radar_required;
 	bool block_tx;
 	u8 count;
+	u32 punct_bitmap;
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 185e218e8668..87aab0ba9353 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1297,9 +1297,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	}
 
 	if (params->eht_cap) {
-		if (!ieee80211_valid_disable_subchannel_bitmap(
-							&params->punct_bitmap,
-							params->chandef.width))
+		if (!ieee80211_valid_disable_subchannel_bitmap(&params->punct_bitmap,
+							       params->chandef.width))
 			return -EINVAL;
 		link_conf->eht_puncturing = params->punct_bitmap;
 		changed |= BSS_CHANGED_EHT_PUNCTURING;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 351c4cc5ec92..efe841ba8865 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10078,6 +10078,13 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
 	if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX])
 		params.block_tx = true;
 
+	if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) {
+		err = nl80211_parse_punct_bitmap(rdev, info,
+						 &params.punct_bitmap);
+		if (err)
+			goto free;
+	}
+
 	wdev_lock(wdev);
 	err = rdev_channel_switch(rdev, dev, &params);
 	wdev_unlock(wdev);
-- 
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 ` Aloka Dixit [this message]
2023-01-30  8:43   ` [PATCH v3 3/6] wifi: nl80211: configure puncturing in NL80211_CMD_CHANNEL_SWITCH Johannes Berg
2023-01-30  7:22 ` [PATCH v3 4/6] wifi: mac80211: configure puncturing bitmap in channel_switch() Aloka Dixit
2023-01-30  8:44   ` 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-4-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.