]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TDLS: Set EHT/MLO information for TDLS STA into the driver
authorKiran Kumar Lokere <quic_klokere@quicinc.com>
Thu, 9 Feb 2023 08:25:30 +0000 (00:25 -0800)
committerJouni Malinen <j@w1.fi>
Fri, 8 Sep 2023 10:20:31 +0000 (13:20 +0300)
Add the copied EHT capabilities into the sta_add() call when adding a
TDLS peer.

The mld_link_id value was previously only for AP mode, but it can now be
used for TDLS links as well to indicate the link on which a
single-link-TDLS direct link is negotiated.

Signed-off-by: Jouni Malinen <quic_klokere@quicinc.com>
src/rsn_supp/tdls.c
src/rsn_supp/wpa.h
src/rsn_supp/wpa_i.h
wpa_supplicant/driver_i.h
wpa_supplicant/wpas_glue.c

index 32d596e4a64296eed3bf078e7960132a845dd50c..e6f5877d298b49d67c1d5d459aebf857b9408166 100644 (file)
@@ -1918,7 +1918,10 @@ static int wpa_tdls_addset_peer(struct wpa_sm *sm, struct wpa_tdls_peer *peer,
                                       peer->supp_channels,
                                       peer->supp_channels_len,
                                       peer->supp_oper_classes,
-                                      peer->supp_oper_classes_len);
+                                      peer->supp_oper_classes_len,
+                                      peer->eht_capabilities,
+                                      peer->eht_capab_len,
+                                      peer->mld_link_id);
 }
 
 
@@ -2087,7 +2090,7 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
                peer->initiator = 1;
                wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL,
                                        NULL, NULL, 0, NULL, 0, 0, NULL, 0,
-                                       NULL, 0, NULL, 0);
+                                       NULL, 0, NULL, 0, NULL, 0, link_id);
                if (wpa_tdls_send_tpk_m1(sm, peer) == -2) {
                        peer = NULL;
                        goto error;
@@ -2870,7 +2873,7 @@ int wpa_tdls_start(struct wpa_sm *sm, const u8 *addr)
        /* add the peer to the driver as a "setup in progress" peer */
        if (wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL,
                                    NULL, NULL, 0, NULL, 0, 0, NULL, 0, NULL, 0,
-                                   NULL, 0)) {
+                                   NULL, 0, NULL, 0, peer->mld_link_id)) {
                wpa_tdls_disable_peer_link(sm, peer);
                return -1;
        }
index dfcc3aa02d9c25ccf18fa01a8217b295120bb8b3..bf7badb84567c89f4bbb2b7ee8bf7ecb087229e9 100644 (file)
@@ -79,7 +79,9 @@ struct wpa_sm_ctx {
                                size_t ext_capab_len, const u8 *supp_channels,
                                size_t supp_channels_len,
                                const u8 *supp_oper_classes,
-                               size_t supp_oper_classes_len);
+                               size_t supp_oper_classes_len,
+                               const struct ieee80211_eht_capabilities *eht_capab,
+                               size_t eht_capab_len, int mld_link_id);
        int (*tdls_enable_channel_switch)(
                void *ctx, const u8 *addr, u8 oper_class,
                const struct hostapd_freq_params *params);
index b70c54a5009508d11cb66a86313753a7b2c3c83a..a0c135ec6223700ba96aa90fe1715c6ff155473d 100644 (file)
@@ -410,7 +410,9 @@ wpa_sm_tdls_peer_addset(struct wpa_sm *sm, const u8 *addr, int add,
                        u8 qosinfo, int wmm, const u8 *ext_capab,
                        size_t ext_capab_len, const u8 *supp_channels,
                        size_t supp_channels_len, const u8 *supp_oper_classes,
-                       size_t supp_oper_classes_len)
+                       size_t supp_oper_classes_len,
+                       const struct ieee80211_eht_capabilities *eht_capab,
+                       size_t eht_capab_len, int mld_link_id)
 {
        if (sm->ctx->tdls_peer_addset)
                return sm->ctx->tdls_peer_addset(sm->ctx->ctx, addr, add,
@@ -423,7 +425,9 @@ wpa_sm_tdls_peer_addset(struct wpa_sm *sm, const u8 *addr, int add,
                                                 supp_channels,
                                                 supp_channels_len,
                                                 supp_oper_classes,
-                                                supp_oper_classes_len);
+                                                supp_oper_classes_len,
+                                                eht_capab, eht_capab_len,
+                                                mld_link_id);
        return -1;
 }
 
index f0ce7581b5d82dc43f6da5c8c2dc58e608a022ab..dcf576487a82dc2f8c99956b453c01c98f6474db 100644 (file)
@@ -354,8 +354,9 @@ static inline int wpa_drv_sta_add(struct wpa_supplicant *wpa_s,
                                  struct hostapd_sta_add_params *params)
 {
        if (wpa_s->driver->sta_add) {
-               /* Set link_id to -1 as it's needed for AP only */
-               params->mld_link_id = -1;
+               /* Set link_id to -1 for non-TDLS peers */
+               if (!(params->flags & WPA_STA_TDLS_PEER))
+                       params->mld_link_id = -1;
                return wpa_s->driver->sta_add(wpa_s->drv_priv, params);
        }
        return -1;
index fb5149f200e90eb13e298ac9caca173ffaa33e28..80ac7c8209f4165bfebf5ac239e81e6538c658f7 100644 (file)
@@ -795,7 +795,9 @@ static int wpa_supplicant_tdls_peer_addset(
        const struct ieee80211_he_6ghz_band_cap *he_6ghz_he_capab,
        u8 qosinfo, int wmm, const u8 *ext_capab, size_t ext_capab_len,
        const u8 *supp_channels, size_t supp_channels_len,
-       const u8 *supp_oper_classes, size_t supp_oper_classes_len)
+       const u8 *supp_oper_classes, size_t supp_oper_classes_len,
+       const struct ieee80211_eht_capabilities *eht_capab,
+       size_t eht_capab_len, int mld_link_id)
 {
        struct wpa_supplicant *wpa_s = ctx;
        struct hostapd_sta_add_params params;
@@ -830,6 +832,9 @@ static int wpa_supplicant_tdls_peer_addset(
        params.supp_channels_len = supp_channels_len;
        params.supp_oper_classes = supp_oper_classes;
        params.supp_oper_classes_len = supp_oper_classes_len;
+       params.eht_capab = eht_capab;
+       params.eht_capab_len = eht_capab_len;
+       params.mld_link_id = mld_link_id;
 
        return wpa_drv_sta_add(wpa_s, &params);
 }