AP MLD: Send link id to the driver during color change

Send the link ID in the nl80211 command to switch color if the AP is
affiliated with an AP MLD.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
This commit is contained in:
Aditya Kumar Singh 2024-04-22 18:10:03 +05:30 committed by Jouni Malinen
parent ecfe2aa61b
commit 320c4c8f8d
3 changed files with 23 additions and 0 deletions

View file

@ -4586,6 +4586,12 @@ int hostapd_fill_cca_settings(struct hostapd_data *hapd,
if (!iface || iface->conf->he_op.he_bss_color_disabled) if (!iface || iface->conf->he_op.he_bss_color_disabled)
return -1; return -1;
settings->link_id = -1;
#ifdef CONFIG_IEEE80211BE
if (hapd->conf->mld_ap)
settings->link_id = hapd->mld_link_id;
#endif /* CONFIG_IEEE80211BE */
old_color = iface->conf->he_op.he_bss_color; old_color = iface->conf->he_op.he_bss_color;
iface->conf->he_op.he_bss_color = hapd->cca_color; iface->conf->he_op.he_bss_color = hapd->cca_color;
ret = hostapd_build_beacon_data(hapd, &settings->beacon_after); ret = hostapd_build_beacon_data(hapd, &settings->beacon_after);

View file

@ -2761,6 +2761,7 @@ struct csa_settings {
* @counter_offset_beacon: Offset to the count field in Beacon frame tail * @counter_offset_beacon: Offset to the count field in Beacon frame tail
* @counter_offset_presp: Offset to the count field in Probe Response frame * @counter_offset_presp: Offset to the count field in Probe Response frame
* @ubpr: Unsolicited broadcast Probe Response frame data * @ubpr: Unsolicited broadcast Probe Response frame data
* @link_id: If >= 0 indicates the link of the AP MLD to configure
*/ */
struct cca_settings { struct cca_settings {
u8 cca_count; u8 cca_count;
@ -2773,6 +2774,8 @@ struct cca_settings {
u16 counter_offset_presp; u16 counter_offset_presp;
struct unsol_bcast_probe_resp ubpr; struct unsol_bcast_probe_resp ubpr;
int link_id;
}; };
/* TDLS peer capabilities for send_tdls_mgmt() */ /* TDLS peer capabilities for send_tdls_mgmt() */

View file

@ -11403,6 +11403,20 @@ static int nl80211_switch_color(void *priv, struct cca_settings *settings)
goto error; goto error;
} }
#ifdef CONFIG_IEEE80211BE
if (nl80211_link_valid(bss->valid_links, settings->link_id)) {
wpa_printf(MSG_DEBUG,
"nl80211: Color change request on link_id=%d",
settings->link_id);
if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID,
settings->link_id)) {
nlmsg_free(msg);
return -1;
}
}
#endif /* CONFIG_IEEE80211BE */
ret = send_and_recv_cmd(drv, msg); ret = send_and_recv_cmd(drv, msg);
if (ret) { if (ret) {
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,