]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update Probe Response template on channel switch
authorRathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
Mon, 8 Apr 2024 06:35:16 +0000 (12:05 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 24 Apr 2024 18:58:49 +0000 (21:58 +0300)
When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new Beacon frame template.

Extend this to update the Probe Response template during channel switch.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
src/ap/hostapd.c
src/drivers/driver.h
src/drivers/driver_nl80211.c

index 130b6ebc6b21d917a517b37c95a75a3bd96dd819..14c225bf69418b999fa7c3d45de074827f7c9a8b 100644 (file)
@@ -4387,6 +4387,11 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
                settings->link_id = hapd->mld_link_id;
 #endif /* CONFIG_IEEE80211BE */
 
+#ifdef CONFIG_IEEE80211AX
+       settings->ubpr.unsol_bcast_probe_resp_tmpl =
+               hostapd_unsol_bcast_probe_resp(hapd, &settings->ubpr);
+#endif /* CONFIG_IEEE80211AX */
+
        return 0;
 }
 
@@ -4448,6 +4453,9 @@ int hostapd_switch_channel(struct hostapd_data *hapd,
        ret = hostapd_drv_switch_channel(hapd, settings);
        free_beacon_data(&settings->beacon_csa);
        free_beacon_data(&settings->beacon_after);
+#ifdef CONFIG_IEEE80211AX
+       os_free(settings->ubpr.unsol_bcast_probe_resp_tmpl);
+#endif /* CONFIG_IEEE80211AX */
 
        if (ret) {
                /* if we failed, clean cs parameters */
index e2fc8548273e2a7f5a27cda8f6f54fa896680bbe..d467e94d50f4da9407a81029a45f19f0d55fe823 100644 (file)
@@ -2732,6 +2732,7 @@ struct beacon_data {
  * @counter_offset_presp: Offset to the count field in probe resp.
  * @punct_bitmap - Preamble puncturing bitmap
  * @link_id: Link ID to determine the link for MLD; -1 for non-MLD
+ * @ubpr: Unsolicited broadcast Probe Response frame data
  */
 struct csa_settings {
        u8 cs_count;
@@ -2746,6 +2747,8 @@ struct csa_settings {
 
        u16 punct_bitmap;
        int link_id;
+
+       struct unsol_bcast_probe_resp ubpr;
 };
 
 /**
index 4ad0f39b5d845c011e13485dc22f251c74c03ced..5ef790f312a31352c74a7cd1a486ecc37428e6ea 100644 (file)
@@ -11308,6 +11308,13 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
                goto fail;
 
        nla_nest_end(msg, beacon_csa);
+
+#ifdef CONFIG_IEEE80211AX
+       if (settings->ubpr.unsol_bcast_probe_resp_interval &&
+           nl80211_unsol_bcast_probe_resp(bss, msg, &settings->ubpr) < 0)
+               goto fail;
+#endif /* CONFIG_IEEE80211AX */
+
        ret = send_and_recv_cmd(drv, msg);
        if (ret) {
                wpa_printf(MSG_DEBUG, "nl80211: switch_channel failed err=%d (%s)",