@ -138,6 +138,7 @@ struct wpa_tdls_peer {
struct ieee80211_vht_capabilities * vht_capabilities ;
struct ieee80211_he_capabilities * he_capabilities ;
size_t he_capab_len ;
struct ieee80211_he_6ghz_band_cap * he_6ghz_band_capabilities ;
u8 qos_info ;
@ -707,6 +708,8 @@ static void wpa_tdls_peer_clear(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
peer - > vht_capabilities = NULL ;
os_free ( peer - > he_capabilities ) ;
peer - > he_capabilities = NULL ;
os_free ( peer - > he_6ghz_band_capabilities ) ;
peer - > he_6ghz_band_capabilities = NULL ;
os_free ( peer - > ext_capab ) ;
peer - > ext_capab = NULL ;
os_free ( peer - > supp_channels ) ;
@ -1681,6 +1684,33 @@ static int copy_peer_he_capab(const struct wpa_eapol_ie_parse *kde,
}
static int copy_peer_he_6ghz_band_capab ( const struct wpa_eapol_ie_parse * kde ,
struct wpa_tdls_peer * peer )
{
if ( ! kde - > he_6ghz_capabilities ) {
wpa_printf ( MSG_DEBUG ,
" TDLS: No HE 6 GHz band capabilities received " ) ;
return 0 ;
}
if ( ! peer - > he_6ghz_band_capabilities ) {
peer - > he_6ghz_band_capabilities =
os_zalloc ( sizeof ( struct ieee80211_he_6ghz_band_cap ) ) ;
if ( peer - > he_6ghz_band_capabilities = = NULL )
return - 1 ;
}
os_memcpy ( peer - > he_6ghz_band_capabilities , kde - > he_6ghz_capabilities ,
sizeof ( struct ieee80211_he_6ghz_band_cap ) ) ;
wpa_hexdump ( MSG_DEBUG , " TDLS: Peer 6 GHz band HE capabilities " ,
peer - > he_6ghz_band_capabilities ,
sizeof ( struct ieee80211_he_6ghz_band_cap ) ) ;
return 0 ;
}
static int copy_peer_ext_capab ( const struct wpa_eapol_ie_parse * kde ,
struct wpa_tdls_peer * peer )
{
@ -1792,6 +1822,7 @@ static int wpa_tdls_addset_peer(struct wpa_sm *sm, struct wpa_tdls_peer *peer,
peer - > vht_capabilities ,
peer - > he_capabilities ,
peer - > he_capab_len ,
peer - > he_6ghz_band_capabilities ,
peer - > qos_info , peer - > wmm_capable ,
peer - > ext_capab , peer - > ext_capab_len ,
peer - > supp_channels ,
@ -1928,7 +1959,8 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
goto error ;
if ( copy_peer_vht_capab ( & kde , peer ) < 0 | |
copy_peer_he_capab ( & kde , peer ) < 0 )
copy_peer_he_capab ( & kde , peer ) < 0 | |
copy_peer_he_6ghz_band_capab ( & kde , peer ) < 0 )
goto error ;
if ( copy_peer_ext_capab ( & kde , peer ) < 0 )
@ -1957,8 +1989,8 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
" TDLS setup - send own request " ) ;
peer - > initiator = 1 ;
wpa_sm_tdls_peer_addset ( sm , peer - > addr , 1 , 0 , 0 , NULL , 0 , NULL ,
NULL , NULL , 0 , 0 , 0 , NULL , 0 , NULL , 0 ,
NULL , 0 );
NULL , NULL , 0 , NULL , 0 , 0 , NULL , 0 ,
NULL , 0 , NULL , 0 );
if ( wpa_tdls_send_tpk_m1 ( sm , peer ) = = - 2 ) {
peer = NULL ;
goto error ;
@ -2337,7 +2369,8 @@ static int wpa_tdls_process_tpk_m2(struct wpa_sm *sm, const u8 *src_addr,
goto error ;
if ( copy_peer_vht_capab ( & kde , peer ) < 0 | |
copy_peer_he_capab ( & kde , peer ) < 0 )
copy_peer_he_capab ( & kde , peer ) < 0 | |
copy_peer_he_6ghz_band_capab ( & kde , peer ) < 0 )
goto error ;
if ( copy_peer_ext_capab ( & kde , peer ) < 0 )
@ -2724,7 +2757,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 , 0 , 0 , NULL , 0 , NULL , 0 ,
NULL , NULL , 0 , NULL , 0 , 0 , NULL , 0 , NULL , 0 ,
NULL , 0 ) ) {
wpa_tdls_disable_peer_link ( sm , peer ) ;
return - 1 ;