]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Send link id to the driver during color change
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Mon, 22 Apr 2024 12:40:03 +0000 (18:10 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 12 Jun 2024 09:31:45 +0000 (12:31 +0300)
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>
src/ap/hostapd.c
src/drivers/driver.h
src/drivers/driver_nl80211.c

index db0903376f88f04160e2bfd9975c49275841f5fd..a0c57b081a95dd41004df0532535367e22729b6a 100644 (file)
@@ -4586,6 +4586,12 @@ int hostapd_fill_cca_settings(struct hostapd_data *hapd,
        if (!iface || iface->conf->he_op.he_bss_color_disabled)
                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;
        iface->conf->he_op.he_bss_color = hapd->cca_color;
        ret = hostapd_build_beacon_data(hapd, &settings->beacon_after);
index 568f338b073a2ec94cd797335cadcf5218f312eb..204694dd4dd55ef0eb16b5fc50aa17d7a747c8b2 100644 (file)
@@ -2761,6 +2761,7 @@ struct csa_settings {
  * @counter_offset_beacon: Offset to the count field in Beacon frame tail
  * @counter_offset_presp: Offset to the count field in Probe Response frame
  * @ubpr: Unsolicited broadcast Probe Response frame data
+ * @link_id: If >= 0 indicates the link of the AP MLD to configure
  */
 struct cca_settings {
        u8 cca_count;
@@ -2773,6 +2774,8 @@ struct cca_settings {
        u16 counter_offset_presp;
 
        struct unsol_bcast_probe_resp ubpr;
+
+       int link_id;
 };
 
 /* TDLS peer capabilities for send_tdls_mgmt() */
index 149f51a74c90d0a8904b7778690b013f58c56346..9cd416ce8b731a17a35e58b88ee546ccbd4cf0a0 100644 (file)
@@ -11403,6 +11403,20 @@ static int nl80211_switch_color(void *priv, struct cca_settings *settings)
                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);
        if (ret) {
                wpa_printf(MSG_DEBUG,