linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH wireless-next 0/2] wifi: cfg80211/mac80211: parse and update unsolicited probe response template
@ 2025-07-09  2:35 Aditya Kumar Singh
  2025-07-09  2:35 ` [PATCH wireless-next 1/2] wifi: cfg80211: parse attribute to " Aditya Kumar Singh
  2025-07-09  2:35 ` [PATCH wireless-next 2/2] wifi: mac80211: parse unsolicited broadcast probe response data Aditya Kumar Singh
  0 siblings, 2 replies; 5+ messages in thread
From: Aditya Kumar Singh @ 2025-07-09  2:35 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-wireless, linux-kernel, Yuvarani V, Aditya Kumar Singh

Currently, during channel switch and color change events, the unsolicited
probe response templates are not updated accordingly.

This patch series introduces support for parsing the updated templates from
these events and setting the appropriate BSS changed flag, enabling drivers
to respond with the necessary actions.

---
Yuvarani V (2):
      wifi: cfg80211: parse attribute to update unsolicited probe response template
      wifi: mac80211: parse unsolicited broadcast probe response data

 include/net/cfg80211.h |  4 ++++
 net/mac80211/cfg.c     | 12 ++++++++++++
 net/wireless/nl80211.c | 17 +++++++++++++++++
 3 files changed, 33 insertions(+)
---
base-commit: cc2b722132893164bcb3cee4f08ed056e126eb6c
change-id: 20250612-update_unsol_bcast_probe_resp-c88786eb5640


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH wireless-next 1/2] wifi: cfg80211: parse attribute to update unsolicited probe response template
  2025-07-09  2:35 [PATCH wireless-next 0/2] wifi: cfg80211/mac80211: parse and update unsolicited probe response template Aditya Kumar Singh
@ 2025-07-09  2:35 ` Aditya Kumar Singh
  2025-07-09  9:38   ` Johannes Berg
  2025-07-09  2:35 ` [PATCH wireless-next 2/2] wifi: mac80211: parse unsolicited broadcast probe response data Aditya Kumar Singh
  1 sibling, 1 reply; 5+ messages in thread
From: Aditya Kumar Singh @ 2025-07-09  2:35 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-wireless, linux-kernel, Yuvarani V, Aditya Kumar Singh

From: Yuvarani V <quic_yuvarani@quicinc.com>

At present, the updated unsolicited broadcast probe response template is
not processed during userspace commands such as channel switch or color
change. This leads to an issue where older incorrect unsolicited probe
response is still used during these events.

Add support to parse the netlink attribute and store it so that
mac80211/drivers can use it to set the BSS_CHANGED_UNSOL_BCAST_PROBE_RESP
flag in order to send the updated unsolicited broadcast probe response
templates during these events.

Signed-off-by: Yuvarani V <quic_yuvarani@quicinc.com>
Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
---
 include/net/cfg80211.h |  4 ++++
 net/wireless/nl80211.c | 17 +++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 4a092da3a9de80df62e9c0e8792377a7bf65c739..0b903b4aaf877465c163fbf7ce9552ec9a430129 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1526,6 +1526,7 @@ struct cfg80211_ap_update {
  * @n_counter_offsets_beacon: number of csa counters the beacon (tail)
  * @n_counter_offsets_presp: number of csa counters in the probe response
  * @beacon_after: beacon data to be used on the new channel
+ * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
  * @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
@@ -1540,6 +1541,7 @@ struct cfg80211_csa_settings {
 	unsigned int n_counter_offsets_beacon;
 	unsigned int n_counter_offsets_presp;
 	struct cfg80211_beacon_data beacon_after;
+	struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
 	bool radar_required;
 	bool block_tx;
 	u8 count;
@@ -1555,6 +1557,7 @@ struct cfg80211_csa_settings {
  * @counter_offset_beacon: offsets of the counters within the beacon (tail)
  * @counter_offset_presp: offsets of the counters within the probe response
  * @beacon_next: beacon data to be used after the color change
+ * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
  * @count: number of beacons until the color change
  * @color: the color used after the change
  * @link_id: defines the link on which color change is expected during MLO.
@@ -1565,6 +1568,7 @@ struct cfg80211_color_change_settings {
 	u16 counter_offset_beacon;
 	u16 counter_offset_presp;
 	struct cfg80211_beacon_data beacon_next;
+	struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
 	u8 count;
 	u8 color;
 	u8 link_id;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 70ca74a75f228d27057d0fdf4b13bd2fba3f2536..6cb3c173343301835176206976ec2ff798ff1105 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10988,6 +10988,15 @@ 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 (wdev->iftype == NL80211_IFTYPE_AP &&
+	    info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) {
+		err = nl80211_parse_unsol_bcast_probe_resp(
+			rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
+			&params.unsol_bcast_probe_resp);
+		if (err)
+			goto free;
+	}
+
 	params.link_id = link_id;
 	err = rdev_channel_switch(rdev, dev, &params);
 
@@ -16790,6 +16799,14 @@ static int nl80211_color_change(struct sk_buff *skb, struct genl_info *info)
 		params.counter_offset_presp = offset;
 	}
 
+	if (info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) {
+		err = nl80211_parse_unsol_bcast_probe_resp(
+			rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
+			&params.unsol_bcast_probe_resp);
+		if (err)
+			goto out;
+	}
+
 	params.link_id = nl80211_link_id(info->attrs);
 	err = rdev_color_change(rdev, dev, &params);
 

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH wireless-next 2/2] wifi: mac80211: parse unsolicited broadcast probe response data
  2025-07-09  2:35 [PATCH wireless-next 0/2] wifi: cfg80211/mac80211: parse and update unsolicited probe response template Aditya Kumar Singh
  2025-07-09  2:35 ` [PATCH wireless-next 1/2] wifi: cfg80211: parse attribute to " Aditya Kumar Singh
@ 2025-07-09  2:35 ` Aditya Kumar Singh
  1 sibling, 0 replies; 5+ messages in thread
From: Aditya Kumar Singh @ 2025-07-09  2:35 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-wireless, linux-kernel, Yuvarani V, Aditya Kumar Singh

From: Yuvarani V <quic_yuvarani@quicinc.com>

During commands like channel switch and color change, the updated
unsolicited broadcast probe response template may be provided. However,
this data is not parsed or acted upon in mac80211.

Add support to parse it and set the BSS changed flag
BSS_CHANGED_UNSOL_BCAST_PROBE_RESP so that drivers could take further
action.

Signed-off-by: Yuvarani V <quic_yuvarani@quicinc.com>
Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
---
 net/mac80211/cfg.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 56540c3701ed786c37f946f9c4af820c15b5922d..cdecda1bd07b31cb7d8bd76eed074ecc2a828eb1 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -4173,6 +4173,12 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
 		goto out;
 	}
 
+	err = ieee80211_set_unsol_bcast_probe_resp(sdata,
+						   &params->unsol_bcast_probe_resp,
+						   link_data, link_conf, &changed);
+	if (err)
+		goto out;
+
 	chanctx = container_of(conf, struct ieee80211_chanctx, conf);
 
 	ch_switch.timestamp = 0;
@@ -5114,6 +5120,12 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev,
 		goto out;
 	}
 
+	err = ieee80211_set_unsol_bcast_probe_resp(sdata,
+						   &params->unsol_bcast_probe_resp,
+						   link, link_conf, &changed);
+	if (err)
+		goto out;
+
 	err = ieee80211_set_color_change_beacon(link, params, &changed);
 	if (err)
 		goto out;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH wireless-next 1/2] wifi: cfg80211: parse attribute to update unsolicited probe response template
  2025-07-09  2:35 ` [PATCH wireless-next 1/2] wifi: cfg80211: parse attribute to " Aditya Kumar Singh
@ 2025-07-09  9:38   ` Johannes Berg
  2025-07-10  4:03     ` Aditya Kumar Singh
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2025-07-09  9:38 UTC (permalink / raw)
  To: Aditya Kumar Singh; +Cc: linux-wireless, linux-kernel, Yuvarani V

On Wed, 2025-07-09 at 08:05 +0530, Aditya Kumar Singh wrote:
> 
> +	if (wdev->iftype == NL80211_IFTYPE_AP &&
> +	    info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) {
> +		err = nl80211_parse_unsol_bcast_probe_resp(
> +			rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
> +			&params.unsol_bcast_probe_resp);

I don't see why this should be only for AP, not e.g. P2P GO?

johannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH wireless-next 1/2] wifi: cfg80211: parse attribute to update unsolicited probe response template
  2025-07-09  9:38   ` Johannes Berg
@ 2025-07-10  4:03     ` Aditya Kumar Singh
  0 siblings, 0 replies; 5+ messages in thread
From: Aditya Kumar Singh @ 2025-07-10  4:03 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, linux-kernel, Yuvarani V

On 7/9/2025 3:08 PM, Johannes Berg wrote:
> On Wed, 2025-07-09 at 08:05 +0530, Aditya Kumar Singh wrote:
>>
>> +	if (wdev->iftype == NL80211_IFTYPE_AP &&
>> +	    info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) {
>> +		err = nl80211_parse_unsol_bcast_probe_resp(
>> +			rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
>> +			&params.unsol_bcast_probe_resp);
> 
> I don't see why this should be only for AP, not e.g. P2P GO?

Yes, my bad. It should be for both here. Got confused with color_change 
handler. Let me fix this and send next version. Thanks for pointing it out.

-- 
Aditya

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-10  4:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09  2:35 [PATCH wireless-next 0/2] wifi: cfg80211/mac80211: parse and update unsolicited probe response template Aditya Kumar Singh
2025-07-09  2:35 ` [PATCH wireless-next 1/2] wifi: cfg80211: parse attribute to " Aditya Kumar Singh
2025-07-09  9:38   ` Johannes Berg
2025-07-10  4:03     ` Aditya Kumar Singh
2025-07-09  2:35 ` [PATCH wireless-next 2/2] wifi: mac80211: parse unsolicited broadcast probe response data Aditya Kumar Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).