@@ -1129,6 +1129,40 @@ webconfig_error_t translate_mesh_sta_info_to_em_bss_config(wifi_vap_info_t *vap,
11291129 return webconfig_error_none ;
11301130}
11311131
1132+ void fill_ap_mld_info_from_vap (em_ap_mld_info_t * ap_info , wifi_vap_info_t * vap ,
1133+ radio_interface_mapping_t * radio_iface_map )
1134+ {
1135+
1136+ if (ap_info == NULL || vap == NULL ) {
1137+ wifi_util_error_print (WIFI_WEBCONFIG ,"%s:%d: input argument is NULL\n" , __func__ , __LINE__ );
1138+ return false;
1139+ }
1140+
1141+ memset (ap_info , 0 , sizeof (em_ap_mld_info_t ));
1142+
1143+ ap_info -> mac_addr_valid = true;
1144+ memcpy (& ap_info -> mac_addr , vap -> u .bss_info .mld_info .common_info .mld_addr ,
1145+ sizeof (mac_address_t ));
1146+ strncpy (ap_info -> ssid , vap -> u .bss_info .ssid , sizeof (ssid_t ));
1147+
1148+ // Todo: VAP structure currently does not have below details, so set it to default for testing.
1149+ ap_info -> str = true;
1150+ ap_info -> nstr = false;
1151+ ap_info -> emlsr = true;
1152+ ap_info -> emlmr = false;
1153+
1154+ ap_info -> num_affiliated_ap ++ ;
1155+ em_affiliated_ap_info_t * aff = & ap_info -> affiliated_ap [0 ];
1156+ memset (aff , 0 , sizeof (* aff ));
1157+
1158+ aff -> mac_addr_valid = true;
1159+ aff -> link_id_valid = true;
1160+ strncpy ((char * )aff -> ruid .name , radio_iface_map -> radio_name , sizeof (aff -> ruid .name ));
1161+ mac_address_from_name (radio_iface_map -> interface_name , aff -> ruid .mac );
1162+ memcpy (& aff -> mac_addr , & vap -> u .bss_info .bssid , sizeof (mac_address_t ));
1163+ aff -> link_id = vap -> u .bss_info .mld_info .common_info .mld_link_id ;
1164+ }
1165+
11321166// translate_vap_object_to_easymesh_for_dml() converts DML data elements of wifi_vap_info_t to em_bss_info_t of easymesh
11331167webconfig_error_t translate_vap_object_to_easymesh_for_dml (webconfig_subdoc_data_t * data )
11341168{
@@ -1252,6 +1286,23 @@ webconfig_error_t translate_vap_object_to_easymesh_for_dml(webconfig_subdoc_data
12521286 wifi_util_error_print (WIFI_WEBCONFIG ,"%s:%d: Unknown vap type %d\n" , __func__ , __LINE__ , vap -> vap_index );
12531287 return webconfig_error_translate_to_easymesh ;
12541288 }
1289+
1290+ if (is_vap_mesh_sta (wifi_prop , vap -> vap_index ) == TRUE) {
1291+ // To Do - Implementation similar to AP MLD once vap structure is updated with wifi7
1292+ // details for STA
1293+ // em_bsta_info_t *bsta_info;
1294+ // fill_bsta_info_from_vap(&bsta_info, vap, radio_iface_map);
1295+ // proto->update_bsta_info(proto->data_model, bsta_info);
1296+ } else {
1297+ if (vap -> u .bss_info .mld_info .common_info .mld_enable == true) {
1298+ em_ap_mld_info_t ap_info ;
1299+ fill_ap_mld_info_from_vap (& ap_info , vap , radio_iface_map );
1300+ proto -> update_ap_mld_info (proto -> data_model , & ap_info );
1301+ } else {
1302+ wifi_util_dbg_print (WIFI_WEBCONFIG , "%s:%d: AP MLD is not enabled on vap %s\n" ,
1303+ __func__ , __LINE__ , vap -> vap_name );
1304+ }
1305+ }
12551306 }
12561307 }
12571308 return webconfig_error_none ;
@@ -1827,6 +1878,7 @@ webconfig_error_t translate_from_easymesh_bssinfo_to_vap_per_radio(webconfig_sub
18271878 m2ctrl_radioconfig * radio_config ;
18281879 mac_address_t mac ;
18291880 em_haul_type_t haultype ;
1881+ char bssid_mac_str [32 ] = {};
18301882
18311883 if (decoded_params == NULL ) {
18321884 wifi_util_error_print (WIFI_WEBCONFIG ,"%s:%d: decoded_params is NULL\n" , __func__ , __LINE__ );
@@ -1957,6 +2009,44 @@ webconfig_error_t translate_from_easymesh_bssinfo_to_vap_per_radio(webconfig_sub
19572009 }
19582010 }
19592011 }
2012+
2013+ if (vap -> vap_mode == wifi_vap_mode_ap ) {
2014+ uint8_mac_to_string_mac (vap -> u .bss_info .bssid , bssid_mac_str );
2015+
2016+ em_ap_mld_info_t * ap_mld_info = proto -> get_ap_mld_frm_bssid (proto -> data_model ,
2017+ vap -> u .bss_info .bssid );
2018+ if (!ap_mld_info ) {
2019+ wifi_util_dbg_print (WIFI_WEBCONFIG ,
2020+ "%s:%d: No AP MLD information available for bssid %s\n" , __func__ , __LINE__ ,
2021+ bssid_mac_str );
2022+ continue ;
2023+ }
2024+
2025+ wifi_util_dbg_print (WIFI_WEBCONFIG , "%s:%d: Found AP MLD information for bssid=%s\n" ,
2026+ __func__ , __LINE__ , bssid_mac_str );
2027+
2028+ // ToDo : Update vap structure based on ap_mld_info
2029+ /* Commented below code as we dont proper value for MLD AP sub doc.
2030+ Currently not needed as mld details are updated from vap structure itself and we are
2031+ not changing. memcpy(vap->u.bss_info.mld_info.common_info.mld_addr,
2032+ &ap_mld_info->mac_addr, sizeof(mac_address_t)); strncpy(vap->u.bss_info.ssid,
2033+ ap_mld_info->ssid, sizeof(ssid_t));
2034+
2035+ for (i = 0; i < ap_mld_info->num_affiliated_ap; i++) {
2036+ //em_affiliated_ap_info_t *affiliated_ap = &ap_mld_info->affiliated_ap[i];
2037+ if (memcmp(ap_mld_info->affiliated_ap[i].mac_addr, vap->u.bss_info.bssid,
2038+ sizeof(mac_address_t)) == 0) { vap->u.bss_info.mld_info.common_info.mld_link_id =
2039+ ap_mld_info->affiliated_ap[i].link_id; break;
2040+ }
2041+ } */
2042+
2043+ } else if (vap -> vap_mode == wifi_vap_mode_sta ) {
2044+ wifi_util_dbg_print (WIFI_WEBCONFIG , "%s:%d: vap_mode:%d\n" , __func__ , __LINE__ ,
2045+ vap -> vap_mode );
2046+ // ToDo : Update vap structure based on sta_mld_info
2047+ // em_sta_mld_info_t *sta_mld_info = proto->get_sta_mld_info(proto->data_model,
2048+ // vap->u.sta_info.bssid);
2049+ }
19602050 }
19612051
19622052 return webconfig_error_none ;
@@ -2781,7 +2871,9 @@ void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *d
27812871 ext_proto_em_get_bss_info_t get_bss , ext_proto_em_get_op_class_info_t get_op_class ,
27822872 ext_proto_get_first_sta_info_t get_first_sta , ext_proto_get_next_sta_info_t get_next_sta ,
27832873 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 ,
2784- ext_proto_put_scan_results_t put_scan_res )
2874+ ext_proto_put_scan_results_t put_scan_res , ext_proto_update_ap_mld_info_t update_ap_mld ,
2875+ ext_proto_update_bsta_mld_info_t update_bsta_mld , ext_proto_update_assoc_sta_mld_info_t update_assoc_sta_mld ,
2876+ ext_proto_get_ap_mld_frm_bssid_t get_ap_mld_frm_bssid )
27852877{
27862878 proto -> data_model = data_model ;
27872879 proto -> m2ctrl_radioconfig = m2ctrl_radioconfig ;
@@ -2804,4 +2896,8 @@ void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *d
28042896 proto -> put_sta_info = put_sta ;
28052897 proto -> get_bss_info_with_mac = get_bss_with_mac ;
28062898 proto -> put_scan_results = put_scan_res ;
2899+ proto -> update_ap_mld_info = update_ap_mld ;
2900+ proto -> update_bsta_mld_info = update_bsta_mld ;
2901+ proto -> update_assoc_sta_mld_info = update_assoc_sta_mld ;
2902+ proto -> get_ap_mld_frm_bssid = get_ap_mld_frm_bssid ;
28072903}
0 commit comments