@@ -1126,6 +1126,36 @@ webconfig_error_t translate_mesh_sta_info_to_em_bss_config(wifi_vap_info_t *vap,
11261126 return webconfig_error_none ;
11271127}
11281128
1129+ void fill_ap_mld_info_from_vap (em_ap_mld_info_t * ap_info , wifi_vap_info_t * vap , radio_interface_mapping_t * radio_iface_map ) {
1130+
1131+ if (ap_info == NULL || vap == NULL ) {
1132+ return false;
1133+ }
1134+
1135+ memset (ap_info , 0 , sizeof (em_ap_mld_info_t ));
1136+
1137+ ap_info -> mac_addr_valid = true;
1138+ memcpy (& ap_info -> mac_addr , vap -> u .bss_info .mld_info .common_info .mld_addr , sizeof (mac_address_t ));
1139+ strncpy (ap_info -> ssid , vap -> u .bss_info .ssid , sizeof (ssid_t ));
1140+
1141+ // Todo: VAP structure currently does not have below details, so set it to default for testing.
1142+ ap_info -> str = 1 ;
1143+ ap_info -> nstr = 0 ;
1144+ ap_info -> emlsr = 1 ;
1145+ ap_info -> emlmr = 0 ;
1146+
1147+ ap_info -> num_affiliated_ap = 1 ;
1148+ em_affiliated_ap_info_t * aff = & ap_info -> affiliated_ap [0 ];
1149+ memset (aff , 0 , sizeof (* aff ));
1150+
1151+ aff -> mac_addr_valid = true;
1152+ aff -> link_id_valid = true;
1153+ strncpy ((char * )aff -> ruid .name , radio_iface_map -> radio_name , sizeof (aff -> ruid .name ));
1154+ mac_address_from_name (radio_iface_map -> interface_name , aff -> ruid .mac );
1155+ memcpy (& aff -> mac_addr , & vap -> u .bss_info .bssid , sizeof (mac_address_t ));
1156+ aff -> link_id = vap -> u .bss_info .mld_info .common_info .mld_link_id ;
1157+ }
1158+
11291159// translate_vap_object_to_easymesh_for_dml() converts DML data elements of wifi_vap_info_t to em_bss_info_t of easymesh
11301160webconfig_error_t translate_vap_object_to_easymesh_for_dml (webconfig_subdoc_data_t * data )
11311161{
@@ -1249,6 +1279,17 @@ webconfig_error_t translate_vap_object_to_easymesh_for_dml(webconfig_subdoc_data
12491279 wifi_util_error_print (WIFI_WEBCONFIG ,"%s:%d: Unknown vap type %d\n" , __func__ , __LINE__ , vap -> vap_index );
12501280 return webconfig_error_translate_to_easymesh ;
12511281 }
1282+
1283+ if (is_vap_mesh_sta (wifi_prop , vap -> vap_index ) == TRUE) {
1284+ // To Do - Implementation similar to AP MLD once vap structure is updated with wifi7 details for STA
1285+ //em_bsta_info_t *bsta_info;
1286+ //fill_bsta_info_from_vap(&bsta_info, vap, radio_iface_map);
1287+ //proto->update_bsta_info(proto->data_model, bsta_info);
1288+ } else {
1289+ em_ap_mld_info_t ap_info ;
1290+ fill_ap_mld_info_from_vap (& ap_info , vap , radio_iface_map );
1291+ proto -> update_ap_mld_info (proto -> data_model , & ap_info );
1292+ }
12521293 }
12531294 }
12541295 return webconfig_error_none ;
@@ -1954,6 +1995,34 @@ webconfig_error_t translate_from_easymesh_bssinfo_to_vap_per_radio(webconfig_sub
19541995 }
19551996 }
19561997 }
1998+
1999+ if (vap -> vap_mode == wifi_vap_mode_ap ) {
2000+ printf (" ==== debug :%s:%d =====\n" , __func__ , __LINE__ , vap -> u .bss_info .bssid );
2001+
2002+ em_ap_mld_info_t * ap_mld_info = proto -> get_ap_mld_frm_bssid (proto -> data_model , vap -> u .bss_info .bssid );
2003+ if (!ap_mld_info ){
2004+ printf ("%s:%d No AP MLD information available.\n" , __func__ , __LINE__ );
2005+ return -1 ;
2006+ }
2007+
2008+ memcpy (vap -> u .bss_info .mld_info .common_info .mld_addr , & ap_mld_info -> mac_addr , sizeof (mac_address_t ));
2009+ strncpy (vap -> u .bss_info .ssid , ap_mld_info -> ssid , sizeof (ssid_t ));
2010+
2011+ for (i = 0 ; i < ap_mld_info -> num_affiliated_ap ; i ++ ) {
2012+ //em_affiliated_ap_info_t *affiliated_ap = &ap_mld_info->affiliated_ap[i];
2013+ if (memcmp (ap_mld_info -> affiliated_ap [i ].mac_addr , vap -> u .bss_info .bssid , sizeof (mac_address_t )) == 0 ) {
2014+ vap -> u .bss_info .mld_info .common_info .mld_link_id = ap_mld_info -> affiliated_ap [i ].link_id ;
2015+ break ;
2016+ }
2017+ }
2018+
2019+ printf ("%s:%d Updated Vap details based on AP MLD\n" , __func__ , __LINE__ );
2020+
2021+ } else if (vap -> vap_mode == wifi_vap_mode_sta ) {
2022+ printf (" ==== debug :%s:%d ====\n" , __func__ , __LINE__ , vap -> u .sta_info .bssid );
2023+ //em_sta_mld_info_t *sta_mld_info = proto->get_sta_mld_info(proto->data_model, vap->u.sta_info.bssid);
2024+ //ToDo : Update vap structure based on sta_mld_info
2025+ }
19572026 }
19582027
19592028 return webconfig_error_none ;
@@ -2778,7 +2847,9 @@ void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *d
27782847 ext_proto_em_get_bss_info_t get_bss , ext_proto_em_get_op_class_info_t get_op_class ,
27792848 ext_proto_get_first_sta_info_t get_first_sta , ext_proto_get_next_sta_info_t get_next_sta ,
27802849 ext_proto_get_sta_info_t get_sta , ext_proto_put_sta_info_t put_sta , ext_proto_em_get_bss_info_with_mac_t get_bss_with_mac ,
2781- ext_proto_put_scan_results_t put_scan_res )
2850+ ext_proto_put_scan_results_t put_scan_res , ext_proto_update_ap_mld_info_t update_ap_mld ,
2851+ ext_proto_update_bsta_mld_info_t update_bsta_mld , ext_proto_update_assoc_sta_mld_info_t update_assoc_sta_mld ,
2852+ ext_proto_get_ap_mld_frm_bssid_t get_ap_mld_frm_bssid )
27822853{
27832854 proto -> data_model = data_model ;
27842855 proto -> m2ctrl_radioconfig = m2ctrl_radioconfig ;
@@ -2801,4 +2872,8 @@ void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *d
28012872 proto -> put_sta_info = put_sta ;
28022873 proto -> get_bss_info_with_mac = get_bss_with_mac ;
28032874 proto -> put_scan_results = put_scan_res ;
2875+ proto -> update_ap_mld_info = update_ap_mld ;
2876+ proto -> update_bsta_mld_info = update_bsta_mld ;
2877+ proto -> update_assoc_sta_mld_info = update_assoc_sta_mld ;
2878+ proto -> get_ap_mld_frm_bssid = get_ap_mld_frm_bssid ;
28042879}
0 commit comments