]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: cfg80211: parse attribute to update unsolicited probe response template
authorYuvarani V <quic_yuvarani@quicinc.com>
Thu, 10 Jul 2025 05:34:27 +0000 (11:04 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 15 Jul 2025 09:01:21 +0000 (11:01 +0200)
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>
Link: https://patch.msgid.link/20250710-update_unsol_bcast_probe_resp-v2-1-31aca39d3b30@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
net/wireless/nl80211.c

index f67424ec108540d1d3777d3d1b3727a893029b98..77bc17d6e96d35336a76376095c72f36f85d1a18 100644 (file)
@@ -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;
index 4e6c0a4e2a827695a2e56682a9285024ae2d1018..1ee14592828db428e4d4f3e0697efed11d6fe6d9 100644 (file)
@@ -10995,6 +10995,16 @@ skip_beacons:
        if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX])
                params.block_tx = true;
 
+       if ((wdev->iftype == NL80211_IFTYPE_AP ||
+            wdev->iftype == NL80211_IFTYPE_P2P_GO) &&
+           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);
 
@@ -16797,6 +16807,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);