mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-23 04:12:31 +00:00
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
Signed-off-by: John Crispin <john@phrozen.org>
306 lines
10 KiB
Diff
306 lines
10 KiB
Diff
From 5add4d904f73d1ac43ab746171c59184d8544111 Mon Sep 17 00:00:00 2001
|
|
From: Yuvarani V <quic_yuvarani@quicinc.com>
|
|
Date: Wed, 22 Nov 2023 12:01:15 +0530
|
|
Subject: [PATCH] hostapd: unsolicited bcast Probe response during CSA.
|
|
|
|
During channel switch announcement, if the unsol_bcast_presp interval is
|
|
set, then generate and send unsolicited broadcast Probe Response Frame to
|
|
driver_nl80211 to update the probe response template.
|
|
|
|
Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
|
|
Signed-off-by: Yuvarani V <quic_yuvarani@quicinc.com>
|
|
---
|
|
src/ap/beacon.c | 16 ++++++++--------
|
|
src/ap/hostapd.c | 8 ++++++++
|
|
src/ap/beacon.h | 3 +++
|
|
src/drivers/driver.h | 34 +++++++++++++++++++---------------
|
|
src/drivers/driver_nl80211.c | 21 +++++++++++++--------
|
|
5 files changed, 51 insertions(+), 31 deletions(-)
|
|
|
|
--- a/src/ap/beacon.c
|
|
+++ b/src/ap/beacon.c
|
|
@@ -1761,8 +1761,8 @@ static u8 * hostapd_probe_resp_offloads(
|
|
|
|
#ifdef CONFIG_IEEE80211AX
|
|
/* Unsolicited broadcast Probe Response(UBPR) transmission, 6 GHz only */
|
|
-static u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
|
|
- struct wpa_driver_ap_params *params)
|
|
+u8 *hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
|
|
+ struct unsol_bcast_probe_resp *ubpr)
|
|
{
|
|
/* Do not enable UBPR in 6GHz AP if colocated with lower band APs */
|
|
hapd->conf->ubpr_state = FILS_UBPR_USER_DISABLED;
|
|
@@ -1776,14 +1776,14 @@ static u8 * hostapd_unsol_bcast_probe_re
|
|
return NULL;
|
|
}
|
|
|
|
- params->unsol_bcast_probe_resp_interval =
|
|
+ ubpr->unsol_bcast_probe_resp_interval =
|
|
hapd->conf->unsol_bcast_probe_resp_interval;
|
|
|
|
- if (params->unsol_bcast_probe_resp_interval)
|
|
+ if (ubpr->unsol_bcast_probe_resp_interval)
|
|
hapd->conf->ubpr_state = FILS_UBPR_ENABLED;
|
|
|
|
return hostapd_gen_probe_resp(hapd, NULL, 0,
|
|
- ¶ms->unsol_bcast_probe_resp_tmpl_len,
|
|
+ &ubpr->unsol_bcast_probe_resp_tmpl_len,
|
|
NULL, 0, false);
|
|
}
|
|
#endif /* CONFIG_IEEE80211AX */
|
|
@@ -2559,8 +2559,8 @@ void ieee802_11_free_ap_params(struct wp
|
|
params->fd_frame_tmpl = NULL;
|
|
#endif /* CONFIG_FILS */
|
|
#ifdef CONFIG_IEEE80211AX
|
|
- os_free(params->unsol_bcast_probe_resp_tmpl);
|
|
- params->unsol_bcast_probe_resp_tmpl = NULL;
|
|
+ os_free(params->ubpr.unsol_bcast_probe_resp_tmpl);
|
|
+ params->ubpr.unsol_bcast_probe_resp_tmpl = NULL;
|
|
#endif /* CONFIG_IEEE80211AX */
|
|
os_free(params->allowed_freqs);
|
|
params->allowed_freqs = NULL;
|
|
@@ -2617,8 +2617,8 @@ static int __ieee802_11_set_beacon(struc
|
|
hapd->iface->conf->he_op.he_bss_color_collision_detection;
|
|
params.twt_responder = hostapd_get_he_twt_responder(hapd,
|
|
IEEE80211_MODE_AP);
|
|
- params.unsol_bcast_probe_resp_tmpl =
|
|
- hostapd_unsol_bcast_probe_resp(hapd, ¶ms);
|
|
+ params.ubpr.unsol_bcast_probe_resp_tmpl =
|
|
+ hostapd_unsol_bcast_probe_resp(hapd, ¶ms.ubpr);
|
|
#endif /* CONFIG_IEEE80211AX */
|
|
hapd->reenable_beacon = 0;
|
|
#ifdef CONFIG_SAE
|
|
--- a/src/ap/hostapd.c
|
|
+++ b/src/ap/hostapd.c
|
|
@@ -4438,6 +4438,11 @@ static int hostapd_fill_csa_settings(str
|
|
settings->freq_params.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;
|
|
}
|
|
|
|
@@ -4511,6 +4516,9 @@ int hostapd_switch_channel(struct hostap
|
|
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 */
|
|
@@ -4707,7 +4715,7 @@ static void hostapd_switch_color_timeout
|
|
|
|
for (b = 0; b < hapd->iface->num_bss; b++) {
|
|
struct hostapd_data *bss = hapd->iface->bss[b];
|
|
- struct cca_settings settings;
|
|
+ struct cca_settings settings = {0};
|
|
int ret;
|
|
|
|
hostapd_cleanup_cca_params(bss);
|
|
--- a/src/drivers/driver.h
|
|
+++ b/src/drivers/driver.h
|
|
@@ -1443,6 +1443,21 @@ struct wowlan_triggers {
|
|
u8 rfkill_release;
|
|
};
|
|
|
|
+struct unsol_bcast_probe_resp {
|
|
+ /**
|
|
+ * Unsolicited broadcast Probe Response interval in TUs
|
|
+ */
|
|
+ unsigned int unsol_bcast_probe_resp_interval;
|
|
+ /**
|
|
+ * Unsolicited broadcast Probe Response template data
|
|
+ */
|
|
+ u8 *unsol_bcast_probe_resp_tmpl;
|
|
+ /**
|
|
+ * Unsolicited broadcast Probe Response template length
|
|
+ */
|
|
+ size_t unsol_bcast_probe_resp_tmpl_len;
|
|
+};
|
|
+
|
|
struct wpa_driver_ap_params {
|
|
/**
|
|
* head - Beacon head from IEEE 802.11 header to IEs before TIM IE
|
|
@@ -1793,21 +1808,6 @@ struct wpa_driver_ap_params {
|
|
size_t fd_frame_tmpl_len;
|
|
|
|
/**
|
|
- * Unsolicited broadcast Probe Response interval in TUs
|
|
- */
|
|
- unsigned int unsol_bcast_probe_resp_interval;
|
|
-
|
|
- /**
|
|
- * Unsolicited broadcast Probe Response template data
|
|
- */
|
|
- u8 *unsol_bcast_probe_resp_tmpl;
|
|
-
|
|
- /**
|
|
- * Unsolicited broadcast Probe Response template length
|
|
- */
|
|
- size_t unsol_bcast_probe_resp_tmpl_len;
|
|
-
|
|
- /**
|
|
* mbssid_tx_iface - Transmitting interface of the MBSSID set
|
|
*/
|
|
const char *mbssid_tx_iface;
|
|
@@ -1887,6 +1887,9 @@ struct wpa_driver_ap_params {
|
|
*/
|
|
u8 **rnr_elem_offset;
|
|
|
|
+ /* Unsolicited broadcast Probe Response data*/
|
|
+ struct unsol_bcast_probe_resp ubpr;
|
|
+
|
|
/**
|
|
* allowed_freqs - List of allowed 20 MHz channel center frequencies in
|
|
* MHz for AP operation. Drivers which support this parameter will
|
|
@@ -2800,6 +2803,7 @@ struct csa_settings {
|
|
|
|
u16 punct_bitmap;
|
|
bool handle_dfs;
|
|
+ struct unsol_bcast_probe_resp ubpr;
|
|
};
|
|
|
|
/**
|
|
--- a/src/drivers/driver_nl80211.c
|
|
+++ b/src/drivers/driver_nl80211.c
|
|
@@ -4768,12 +4768,12 @@ static int nl80211_fils_discovery(struct
|
|
|
|
static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss,
|
|
struct nl_msg *msg,
|
|
- struct wpa_driver_ap_params *params)
|
|
+ struct unsol_bcast_probe_resp *ubpr)
|
|
{
|
|
struct nlattr *attr;
|
|
|
|
if (!bss->drv->unsol_bcast_probe_resp) {
|
|
- if (params->unsol_bcast_probe_resp_interval) {
|
|
+ if (ubpr->unsol_bcast_probe_resp_interval) {
|
|
wpa_printf(MSG_ERROR,
|
|
"nl80211: Driver does not support unsolicited broadcast Probe Response frame transmission for %s",
|
|
bss->ifname);
|
|
@@ -4784,15 +4784,15 @@ static int nl80211_unsol_bcast_probe_res
|
|
|
|
wpa_printf(MSG_DEBUG,
|
|
"nl80211: Unsolicited broadcast Probe Response frame interval: %u",
|
|
- params->unsol_bcast_probe_resp_interval);
|
|
+ ubpr->unsol_bcast_probe_resp_interval);
|
|
attr = nla_nest_start(msg, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP);
|
|
if (!attr ||
|
|
nla_put_u32(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT,
|
|
- params->unsol_bcast_probe_resp_interval) ||
|
|
- (params->unsol_bcast_probe_resp_tmpl &&
|
|
+ ubpr->unsol_bcast_probe_resp_interval) ||
|
|
+ (ubpr->unsol_bcast_probe_resp_tmpl &&
|
|
nla_put(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL,
|
|
- params->unsol_bcast_probe_resp_tmpl_len,
|
|
- params->unsol_bcast_probe_resp_tmpl)))
|
|
+ ubpr->unsol_bcast_probe_resp_tmpl_len,
|
|
+ ubpr->unsol_bcast_probe_resp_tmpl)))
|
|
return -1;
|
|
|
|
nla_nest_end(msg, attr);
|
|
@@ -5375,8 +5375,8 @@ static int wpa_driver_nl80211_set_ap(voi
|
|
goto fail;
|
|
}
|
|
|
|
- if (params->unsol_bcast_probe_resp_interval &&
|
|
- nl80211_unsol_bcast_probe_resp(bss, msg, params) < 0)
|
|
+ if (params->ubpr.unsol_bcast_probe_resp_interval &&
|
|
+ nl80211_unsol_bcast_probe_resp(bss, msg, ¶ms->ubpr) < 0)
|
|
goto fail;
|
|
|
|
if (nl80211_mbssid(msg, params) < 0)
|
|
@@ -11332,6 +11332,11 @@ static int nl80211_switch_channel(void *
|
|
return -1;
|
|
}
|
|
}
|
|
+#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_msgs(drv, msg, NULL, NULL, NULL, NULL);
|
|
if (ret) {
|
|
--- a/src/ap/beacon.h
|
|
+++ b/src/ap/beacon.h
|
|
@@ -32,4 +32,8 @@ void sta_track_claim_taxonomy_info(struc
|
|
|
|
const u8 * hostapd_wpa_ie(struct hostapd_data *hapd, u8 eid);
|
|
|
|
+#ifdef CONFIG_IEEE80211AX
|
|
+u8 *hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
|
|
+ struct unsol_bcast_probe_resp *ubpr);
|
|
+#endif /* CONFIG_IEEE80211AX */
|
|
#endif /* BEACON_H */
|
|
--- a/hostapd/ctrl_iface.c
|
|
+++ b/hostapd/ctrl_iface.c
|
|
@@ -2756,7 +2756,7 @@ static int hostapd_ctrl_iface_color_chan
|
|
char *pos)
|
|
{
|
|
#ifdef NEED_AP_MLME
|
|
- struct cca_settings settings;
|
|
+ struct cca_settings settings = {0};
|
|
struct hostapd_data *hapd = iface->bss[0];
|
|
int ret, color;
|
|
unsigned int i;
|
|
@@ -2838,7 +2838,7 @@ static int hostapd_ctrl_iface_chan_switc
|
|
char *pos)
|
|
{
|
|
#ifdef NEED_AP_MLME
|
|
- struct csa_settings settings;
|
|
+ struct csa_settings settings = {0};
|
|
int ret;
|
|
int dfs_range = 0;
|
|
unsigned int i;
|
|
--- a/src/ap/dfs.c
|
|
+++ b/src/ap/dfs.c
|
|
@@ -1109,7 +1109,7 @@ static int hostapd_dfs_request_channel_s
|
|
{
|
|
struct hostapd_hw_modes *cmode = iface->current_mode;
|
|
int ieee80211_mode = IEEE80211_MODE_AP, err;
|
|
- struct csa_settings csa_settings;
|
|
+ struct csa_settings csa_settings = {0};
|
|
u8 new_vht_oper_chwidth;
|
|
unsigned int i;
|
|
|
|
--- a/src/ap/interference.c
|
|
+++ b/src/ap/interference.c
|
|
@@ -356,7 +356,7 @@ int get_next_max_width(int chan_width)
|
|
int hostapd_intf_awgn_detected(struct hostapd_iface *iface, int freq, int chan_width,
|
|
int cf1, int cf2, u32 chan_bw_interference_bitmap)
|
|
{
|
|
- struct csa_settings settings;
|
|
+ struct csa_settings settings = {0};
|
|
struct hostapd_channel_data *chan_data = NULL;
|
|
struct hostapd_channel_data *chan_temp = NULL;
|
|
struct hostapd_channel_data **available_chandef_list = NULL;
|
|
--- a/wpa_supplicant/ap.c
|
|
+++ b/wpa_supplicant/ap.c
|
|
@@ -1873,7 +1873,7 @@ static int __ap_ctrl_iface_chanswitch(st
|
|
|
|
int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos)
|
|
{
|
|
- struct csa_settings settings;
|
|
+ struct csa_settings settings = {0};
|
|
int ret;
|
|
|
|
if (wpa_s->ifmsh && wpa_s->ifmsh->conf->disable_csa_dfs == 1) {
|
|
--- a/wpa_supplicant/p2p_supplicant.c
|
|
+++ b/wpa_supplicant/p2p_supplicant.c
|
|
@@ -9728,7 +9728,7 @@ static int wpas_p2p_move_go_csa(struct w
|
|
{
|
|
struct hostapd_config *conf;
|
|
struct p2p_go_neg_results params;
|
|
- struct csa_settings csa_settings;
|
|
+ struct csa_settings csa_settings = {0};
|
|
struct wpa_ssid *current_ssid = wpa_s->current_ssid;
|
|
int old_freq = current_ssid->frequency;
|
|
int ret;
|