diff mbox series

[wireless-next,1/3] wifi: cfg80211: add mesh peer with puncturing bitmap

Message ID 20250609001048.2263586-2-ramasamy.kaliappan@oss.qualcomm.com
State New
Headers show
Series wifi: Preamble puncturing support for mesh | expand

Commit Message

Ramasamy Kaliappan June 9, 2025, 12:10 a.m. UTC
From: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>

When a mesh peer has a different disable subchannel bitmap advertised
in mesh beacon's EHT operation element compared to the mesh
peer STA, there is currently no option to send the disable subchannel
bitmap to the driver when adding a new mesh peer station from the
user-space application.

Add the ability to receive the disable subchannel bitmap using the
attribute NL80211_ATTR_PUNCT_BITMAP which userspace can include in
the NL80211_CMD_NEW_STATION command when adding a mesh STA.

Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Signed-off-by: Ramasamy Kaliappan <ramasamy.kaliappan@oss.qualcomm.com>
---
 include/net/cfg80211.h |  4 ++++
 net/wireless/nl80211.c | 11 +++++++++++
 2 files changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d1848dc8ec99..47cd87541917 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1653,6 +1653,9 @@  struct sta_txpwr {
  * @he_6ghz_capa: HE 6 GHz Band capabilities of station
  * @eht_capa: EHT capabilities of station
  * @eht_capa_len: the length of the EHT capabilities
+ * @punctured: Preamble puncturing bitmap. Each bit represents
+ *	a 20 MHz channel, lowest bit corresponding to the lowest channel.
+ *	Bit set to 1 indicates that the channel is punctured.
  */
 struct link_station_parameters {
 	const u8 *mld_mac;
@@ -1671,6 +1674,7 @@  struct link_station_parameters {
 	const struct ieee80211_he_6ghz_capa *he_6ghz_capa;
 	const struct ieee80211_eht_cap_elem *eht_capa;
 	u8 eht_capa_len;
+	u16 punctured;
 };
 
 /**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index fd5f79266471..3a7bd549363f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7681,6 +7681,17 @@  static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 			nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]);
 	}
 
+	if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) {
+		if (wdev->iftype != NL80211_IFTYPE_MESH_POINT)
+			return -EINVAL;
+		params.link_sta_params.punctured =
+			nla_get_u32(info->attrs[NL80211_ATTR_PUNCT_BITMAP]);
+		if (params.link_sta_params.punctured &&
+		    !wiphy_ext_feature_isset(&rdev->wiphy,
+					     NL80211_EXT_FEATURE_PUNCT))
+			return -EINVAL;
+	}
+
 	if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION])
 		params.plink_action =
 			nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]);