More generic unsolicited broadcast Probe Response template setup
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. As a preparation for extending this functionality to other cases, move the generation of the unsolicited broadcast Probe Response template into a more generic function and data structure. Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
This commit is contained in:
parent
b38f14e13d
commit
7d0c08910b
4 changed files with 39 additions and 31 deletions
|
@ -1712,15 +1712,15 @@ static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd,
|
||||||
|
|
||||||
#ifdef CONFIG_IEEE80211AX
|
#ifdef CONFIG_IEEE80211AX
|
||||||
/* Unsolicited broadcast Probe Response transmission, 6 GHz only */
|
/* Unsolicited broadcast Probe Response transmission, 6 GHz only */
|
||||||
static u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
|
u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
|
||||||
struct wpa_driver_ap_params *params)
|
struct unsol_bcast_probe_resp *ubpr)
|
||||||
{
|
{
|
||||||
struct probe_resp_params probe_params;
|
struct probe_resp_params probe_params;
|
||||||
|
|
||||||
if (!is_6ghz_op_class(hapd->iconf->op_class))
|
if (!is_6ghz_op_class(hapd->iconf->op_class))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
params->unsol_bcast_probe_resp_interval =
|
ubpr->unsol_bcast_probe_resp_interval =
|
||||||
hapd->conf->unsol_bcast_probe_resp_interval;
|
hapd->conf->unsol_bcast_probe_resp_interval;
|
||||||
|
|
||||||
os_memset(&probe_params, 0, sizeof(probe_params));
|
os_memset(&probe_params, 0, sizeof(probe_params));
|
||||||
|
@ -1733,7 +1733,7 @@ static u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
|
||||||
probe_params.mld_info = NULL;
|
probe_params.mld_info = NULL;
|
||||||
|
|
||||||
hostapd_gen_probe_resp(hapd, &probe_params);
|
hostapd_gen_probe_resp(hapd, &probe_params);
|
||||||
params->unsol_bcast_probe_resp_tmpl_len = probe_params.resp_len;
|
ubpr->unsol_bcast_probe_resp_tmpl_len = probe_params.resp_len;
|
||||||
return (u8 *) probe_params.resp;
|
return (u8 *) probe_params.resp;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_IEEE80211AX */
|
#endif /* CONFIG_IEEE80211AX */
|
||||||
|
@ -2546,8 +2546,8 @@ void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params)
|
||||||
params->fd_frame_tmpl = NULL;
|
params->fd_frame_tmpl = NULL;
|
||||||
#endif /* CONFIG_FILS */
|
#endif /* CONFIG_FILS */
|
||||||
#ifdef CONFIG_IEEE80211AX
|
#ifdef CONFIG_IEEE80211AX
|
||||||
os_free(params->unsol_bcast_probe_resp_tmpl);
|
os_free(params->ubpr.unsol_bcast_probe_resp_tmpl);
|
||||||
params->unsol_bcast_probe_resp_tmpl = NULL;
|
params->ubpr.unsol_bcast_probe_resp_tmpl = NULL;
|
||||||
#endif /* CONFIG_IEEE80211AX */
|
#endif /* CONFIG_IEEE80211AX */
|
||||||
os_free(params->allowed_freqs);
|
os_free(params->allowed_freqs);
|
||||||
params->allowed_freqs = NULL;
|
params->allowed_freqs = NULL;
|
||||||
|
@ -2608,8 +2608,8 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)
|
||||||
params.he_bss_color = hapd->iface->conf->he_op.he_bss_color;
|
params.he_bss_color = hapd->iface->conf->he_op.he_bss_color;
|
||||||
twt_he_responder = hostapd_get_he_twt_responder(hapd,
|
twt_he_responder = hostapd_get_he_twt_responder(hapd,
|
||||||
IEEE80211_MODE_AP);
|
IEEE80211_MODE_AP);
|
||||||
params.unsol_bcast_probe_resp_tmpl =
|
params.ubpr.unsol_bcast_probe_resp_tmpl =
|
||||||
hostapd_unsol_bcast_probe_resp(hapd, ¶ms);
|
hostapd_unsol_bcast_probe_resp(hapd, ¶ms.ubpr);
|
||||||
#endif /* CONFIG_IEEE80211AX */
|
#endif /* CONFIG_IEEE80211AX */
|
||||||
params.twt_responder =
|
params.twt_responder =
|
||||||
twt_he_responder || hostapd_get_ht_vht_twt_responder(hapd);
|
twt_he_responder || hostapd_get_ht_vht_twt_responder(hapd);
|
||||||
|
|
|
@ -33,4 +33,7 @@ void sta_track_claim_taxonomy_info(struct hostapd_iface *iface, const u8 *addr,
|
||||||
|
|
||||||
const u8 * hostapd_wpa_ie(struct hostapd_data *hapd, u8 eid);
|
const u8 * hostapd_wpa_ie(struct hostapd_data *hapd, u8 eid);
|
||||||
|
|
||||||
|
u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
|
||||||
|
struct unsol_bcast_probe_resp *ubpr);
|
||||||
|
|
||||||
#endif /* BEACON_H */
|
#endif /* BEACON_H */
|
||||||
|
|
|
@ -1386,6 +1386,23 @@ struct wowlan_triggers {
|
||||||
u8 rfkill_release;
|
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 {
|
struct wpa_driver_ap_params {
|
||||||
/**
|
/**
|
||||||
* head - Beacon head from IEEE 802.11 header to IEs before TIM IE
|
* head - Beacon head from IEEE 802.11 header to IEs before TIM IE
|
||||||
|
@ -1728,21 +1745,6 @@ struct wpa_driver_ap_params {
|
||||||
*/
|
*/
|
||||||
size_t fd_frame_tmpl_len;
|
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
|
* mbssid_tx_iface - Transmitting interface of the MBSSID set
|
||||||
*/
|
*/
|
||||||
|
@ -1809,6 +1811,9 @@ struct wpa_driver_ap_params {
|
||||||
*/
|
*/
|
||||||
u8 **rnr_elem_offset;
|
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
|
* allowed_freqs - List of allowed 20 MHz channel center frequencies in
|
||||||
* MHz for AP operation. Drivers which support this parameter will
|
* MHz for AP operation. Drivers which support this parameter will
|
||||||
|
|
|
@ -4768,7 +4768,7 @@ static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg,
|
||||||
|
|
||||||
static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss,
|
static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss,
|
||||||
struct nl_msg *msg,
|
struct nl_msg *msg,
|
||||||
struct wpa_driver_ap_params *params)
|
struct unsol_bcast_probe_resp *ubpr)
|
||||||
{
|
{
|
||||||
struct nlattr *attr;
|
struct nlattr *attr;
|
||||||
|
|
||||||
|
@ -4781,15 +4781,15 @@ static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss,
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG,
|
wpa_printf(MSG_DEBUG,
|
||||||
"nl80211: Unsolicited broadcast Probe Response frame interval: %u",
|
"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);
|
attr = nla_nest_start(msg, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP);
|
||||||
if (!attr ||
|
if (!attr ||
|
||||||
nla_put_u32(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT,
|
nla_put_u32(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT,
|
||||||
params->unsol_bcast_probe_resp_interval) ||
|
ubpr->unsol_bcast_probe_resp_interval) ||
|
||||||
(params->unsol_bcast_probe_resp_tmpl &&
|
(ubpr->unsol_bcast_probe_resp_tmpl &&
|
||||||
nla_put(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL,
|
nla_put(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL,
|
||||||
params->unsol_bcast_probe_resp_tmpl_len,
|
ubpr->unsol_bcast_probe_resp_tmpl_len,
|
||||||
params->unsol_bcast_probe_resp_tmpl)))
|
ubpr->unsol_bcast_probe_resp_tmpl)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
nla_nest_end(msg, attr);
|
nla_nest_end(msg, attr);
|
||||||
|
@ -5374,8 +5374,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params->unsol_bcast_probe_resp_interval &&
|
if (params->ubpr.unsol_bcast_probe_resp_interval &&
|
||||||
nl80211_unsol_bcast_probe_resp(bss, msg, params) < 0)
|
nl80211_unsol_bcast_probe_resp(bss, msg, ¶ms->ubpr) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (nl80211_mbssid(msg, params) < 0)
|
if (nl80211_mbssid(msg, params) < 0)
|
||||||
|
|
Loading…
Reference in a new issue