Skip to content

Commit c932be7

Browse files
Yuvarani Vjmberg-intel
authored andcommitted
wifi: cfg80211: parse attribute to update unsolicited probe response template
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 <[email protected]> Signed-off-by: Aditya Kumar Singh <[email protected]> Link: https://patch.msgid.link/20250710-update_unsol_bcast_probe_resp-v2-1-31aca39d3b30@oss.qualcomm.com Signed-off-by: Johannes Berg <[email protected]>
1 parent a597432 commit c932be7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

include/net/cfg80211.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,7 @@ struct cfg80211_ap_update {
15261526
* @n_counter_offsets_beacon: number of csa counters the beacon (tail)
15271527
* @n_counter_offsets_presp: number of csa counters in the probe response
15281528
* @beacon_after: beacon data to be used on the new channel
1529+
* @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
15291530
* @radar_required: whether radar detection is required on the new channel
15301531
* @block_tx: whether transmissions should be blocked while changing
15311532
* @count: number of beacons until switch
@@ -1540,6 +1541,7 @@ struct cfg80211_csa_settings {
15401541
unsigned int n_counter_offsets_beacon;
15411542
unsigned int n_counter_offsets_presp;
15421543
struct cfg80211_beacon_data beacon_after;
1544+
struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
15431545
bool radar_required;
15441546
bool block_tx;
15451547
u8 count;
@@ -1555,6 +1557,7 @@ struct cfg80211_csa_settings {
15551557
* @counter_offset_beacon: offsets of the counters within the beacon (tail)
15561558
* @counter_offset_presp: offsets of the counters within the probe response
15571559
* @beacon_next: beacon data to be used after the color change
1560+
* @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
15581561
* @count: number of beacons until the color change
15591562
* @color: the color used after the change
15601563
* @link_id: defines the link on which color change is expected during MLO.
@@ -1565,6 +1568,7 @@ struct cfg80211_color_change_settings {
15651568
u16 counter_offset_beacon;
15661569
u16 counter_offset_presp;
15671570
struct cfg80211_beacon_data beacon_next;
1571+
struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
15681572
u8 count;
15691573
u8 color;
15701574
u8 link_id;

net/wireless/nl80211.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10995,6 +10995,16 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
1099510995
if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX])
1099610996
params.block_tx = true;
1099710997

10998+
if ((wdev->iftype == NL80211_IFTYPE_AP ||
10999+
wdev->iftype == NL80211_IFTYPE_P2P_GO) &&
11000+
info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) {
11001+
err = nl80211_parse_unsol_bcast_probe_resp(
11002+
rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
11003+
&params.unsol_bcast_probe_resp);
11004+
if (err)
11005+
goto free;
11006+
}
11007+
1099811008
params.link_id = link_id;
1099911009
err = rdev_channel_switch(rdev, dev, &params);
1100011010

@@ -16797,6 +16807,14 @@ static int nl80211_color_change(struct sk_buff *skb, struct genl_info *info)
1679716807
params.counter_offset_presp = offset;
1679816808
}
1679916809

16810+
if (info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) {
16811+
err = nl80211_parse_unsol_bcast_probe_resp(
16812+
rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
16813+
&params.unsol_bcast_probe_resp);
16814+
if (err)
16815+
goto out;
16816+
}
16817+
1680016818
params.link_id = nl80211_link_id(info->attrs);
1680116819
err = rdev_color_change(rdev, dev, &params);
1680216820

0 commit comments

Comments
 (0)