Skip to content

Commit 60aeb8a

Browse files
committed
Wifi 7 integration changes - draft commit only
Signed-off-by: Rakhil P E <[email protected]>
1 parent db7b158 commit 60aeb8a

File tree

3 files changed

+99
-3
lines changed

3 files changed

+99
-3
lines changed

include/webconfig_external_proto_easymesh.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ typedef em_sta_info_t * (*ext_proto_get_sta_info_t)(void *data_model, mac_addres
4343
typedef void (*ext_proto_put_sta_info_t)(void *data_model, em_sta_info_t *sta_info, em_target_sta_map_t target);
4444
typedef em_bss_info_t * (*ext_proto_em_get_bss_info_with_mac_t)(void *data_model, mac_address_t mac);
4545
typedef void (*ext_proto_put_scan_results_t)(void *data_model, em_scan_result_t *scan_result);
46+
typedef void (*ext_proto_update_ap_mld_info_t)(void *data_model, em_ap_mld_info_t *ap_mld_info);
47+
typedef void (*ext_proto_update_bsta_mld_info_t)(void *data_model, em_bsta_mld_info_t *bsta_mld_info);
48+
typedef void (*ext_proto_update_assoc_sta_mld_info_t)(void *data_model, em_assoc_sta_mld_info_t *assoc_sta_mld_info);
49+
typedef em_ap_mld_info_t * (*ext_proto_get_ap_mld_frm_bssid_t)(void *data_model, mac_address_t bss_id);
4650

4751
typedef struct {
4852
void *data_model; /* agent data model dm_easy_mesh_t */
@@ -68,6 +72,10 @@ typedef struct {
6872
ext_proto_put_sta_info_t put_sta_info;
6973
ext_proto_em_get_bss_info_with_mac_t get_bss_info_with_mac;
7074
ext_proto_put_scan_results_t put_scan_results;
75+
ext_proto_update_ap_mld_info_t update_ap_mld_info;
76+
ext_proto_update_bsta_mld_info_t update_bsta_mld_info;
77+
ext_proto_update_assoc_sta_mld_info_t update_assoc_sta_mld_info;
78+
ext_proto_get_ap_mld_frm_bssid_t get_ap_mld_frm_bssid;
7179
} webconfig_external_easymesh_t;
7280

7381
void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *data_model, void *m2ctrl_vapconfig, void *policy_config,
@@ -79,7 +87,9 @@ void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *d
7987
ext_proto_em_get_bss_info_t get_bss, ext_proto_em_get_op_class_info_t get_op_class,
8088
ext_proto_get_first_sta_info_t get_first_sta, ext_proto_get_next_sta_info_t get_next_sta,
8189
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_info_with_mac,
82-
ext_proto_put_scan_results_t put_scan_results);
90+
ext_proto_put_scan_results_t put_scan_results, ext_proto_update_ap_mld_info_t update_ap_mld_info,
91+
ext_proto_update_bsta_mld_info_t update_bsta_mld_info, ext_proto_update_assoc_sta_mld_info_t update_assoc_sta_mld_info,
92+
ext_proto_get_ap_mld_frm_bssid_t get_ap_mld_frm_bssid);
8393

8494
#ifdef __cplusplus
8595
}

source/db/wifi_db.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ static int init_vap_config_default(int vap_index, wifi_vap_info_t *config,
566566
return RETURN_OK;
567567
}
568568

569-
570569
void init_wifidb_data(void)
571570
{
572571
int index, vap_index;

source/webconfig/wifi_easymesh_translator.c

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,36 @@ 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, radio_interface_mapping_t *radio_iface_map) {
1133+
1134+
if (ap_info == NULL || vap == NULL) {
1135+
return false;
1136+
}
1137+
1138+
memset(ap_info, 0, sizeof(em_ap_mld_info_t));
1139+
1140+
ap_info->mac_addr_valid = true;
1141+
memcpy(&ap_info->mac_addr, vap->u.bss_info.mld_info.common_info.mld_addr, sizeof(mac_address_t));
1142+
strncpy(ap_info->ssid, vap->u.bss_info.ssid, sizeof(ssid_t));
1143+
1144+
// Todo: VAP structure currently does not have below details, so set it to default for testing.
1145+
ap_info->str = 1;
1146+
ap_info->nstr = 0;
1147+
ap_info->emlsr = 1;
1148+
ap_info->emlmr = 0;
1149+
1150+
ap_info->num_affiliated_ap = 1;
1151+
em_affiliated_ap_info_t *aff = &ap_info->affiliated_ap[0];
1152+
memset(aff, 0, sizeof(*aff));
1153+
1154+
aff->mac_addr_valid = true;
1155+
aff->link_id_valid = true;
1156+
strncpy((char *)aff->ruid.name, radio_iface_map->radio_name, sizeof(aff->ruid.name));
1157+
mac_address_from_name(radio_iface_map->interface_name, aff->ruid.mac);
1158+
memcpy(&aff->mac_addr, &vap->u.bss_info.bssid, sizeof(mac_address_t));
1159+
aff->link_id = vap->u.bss_info.mld_info.common_info.mld_link_id;
1160+
}
1161+
11321162
// translate_vap_object_to_easymesh_for_dml() converts DML data elements of wifi_vap_info_t to em_bss_info_t of easymesh
11331163
webconfig_error_t translate_vap_object_to_easymesh_for_dml(webconfig_subdoc_data_t *data)
11341164
{
@@ -1252,6 +1282,21 @@ webconfig_error_t translate_vap_object_to_easymesh_for_dml(webconfig_subdoc_data
12521282
wifi_util_error_print(WIFI_WEBCONFIG,"%s:%d: Unknown vap type %d\n", __func__, __LINE__, vap->vap_index);
12531283
return webconfig_error_translate_to_easymesh;
12541284
}
1285+
1286+
if (is_vap_mesh_sta(wifi_prop, vap->vap_index) == TRUE) {
1287+
// To Do - Implementation similar to AP MLD once vap structure is updated with wifi7 details for STA
1288+
//em_bsta_info_t *bsta_info;
1289+
//fill_bsta_info_from_vap(&bsta_info, vap, radio_iface_map);
1290+
//proto->update_bsta_info(proto->data_model, bsta_info);
1291+
} else {
1292+
if(vap->u.bss_info.mld_info.common_info.mld_enable == true) {
1293+
em_ap_mld_info_t ap_info;
1294+
fill_ap_mld_info_from_vap(&ap_info, vap, radio_iface_map);
1295+
proto->update_ap_mld_info(proto->data_model, &ap_info);
1296+
} else {
1297+
wifi_util_dbg_print(WIFI_WEBCONFIG,"%s:%d: AP MLD is not enabled on vap %s\n", __func__, __LINE__, vap->vap_name);
1298+
}
1299+
}
12551300
}
12561301
}
12571302
return webconfig_error_none;
@@ -1957,6 +2002,42 @@ webconfig_error_t translate_from_easymesh_bssinfo_to_vap_per_radio(webconfig_sub
19572002
}
19582003
}
19592004
}
2005+
2006+
char bssid_mac_str[32] = {};
2007+
if (vap->vap_mode == wifi_vap_mode_ap) {
2008+
uint8_mac_to_string_mac(vap->u.bss_info.bssid, bssid_mac_str);
2009+
wifi_util_error_print(WIFI_WEBCONFIG, "%s:%d: vap_mode:%d bssid=%s\n", __func__, __LINE__,
2010+
vap->vap_mode, bssid_mac_str);
2011+
2012+
em_ap_mld_info_t *ap_mld_info = proto->get_ap_mld_frm_bssid(proto->data_model, vap->u.bss_info.bssid);
2013+
if (!ap_mld_info) {
2014+
wifi_util_error_print(WIFI_WEBCONFIG, "%s:%d: No AP MLD information available for bssid %s\n", __func__, __LINE__,
2015+
bssid_mac_str);
2016+
continue;
2017+
}
2018+
2019+
wifi_util_error_print(WIFI_WEBCONFIG, "%s:%d: Found AP MLD information for bssid=%s\n", __func__, __LINE__,
2020+
bssid_mac_str);
2021+
wifi_util_dbg_print(WIFI_WEBCONFIG, "%s:%d ap_mld_info->num_affiliated_ap: %d\n", __func__, __LINE__, ap_mld_info->num_affiliated_ap);
2022+
wifi_util_dbg_print(WIFI_WEBCONFIG, "%s:%d ap_mld_info->ssid: %s\n", __func__, __LINE__, ap_mld_info->ssid);
2023+
2024+
/* Commented below code till we have proper value for MLD AP sub doc.
2025+
memcpy(vap->u.bss_info.mld_info.common_info.mld_addr, &ap_mld_info->mac_addr, sizeof(mac_address_t));
2026+
strncpy(vap->u.bss_info.ssid, ap_mld_info->ssid, sizeof(ssid_t));
2027+
2028+
for (i = 0; i < ap_mld_info->num_affiliated_ap; i++) {
2029+
//em_affiliated_ap_info_t *affiliated_ap = &ap_mld_info->affiliated_ap[i];
2030+
if (memcmp(ap_mld_info->affiliated_ap[i].mac_addr, vap->u.bss_info.bssid, sizeof(mac_address_t)) == 0) {
2031+
vap->u.bss_info.mld_info.common_info.mld_link_id = ap_mld_info->affiliated_ap[i].link_id;
2032+
break;
2033+
}
2034+
} */
2035+
2036+
} else if (vap->vap_mode == wifi_vap_mode_sta) {
2037+
wifi_util_dbg_print(WIFI_WEBCONFIG, "%s:%d: vap_mode:%d\n", __func__, __LINE__, vap->vap_mode);
2038+
//ToDo : Update vap structure based on sta_mld_info
2039+
//em_sta_mld_info_t *sta_mld_info = proto->get_sta_mld_info(proto->data_model, vap->u.sta_info.bssid);
2040+
}
19602041
}
19612042

19622043
return webconfig_error_none;
@@ -2781,7 +2862,9 @@ void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *d
27812862
ext_proto_em_get_bss_info_t get_bss, ext_proto_em_get_op_class_info_t get_op_class,
27822863
ext_proto_get_first_sta_info_t get_first_sta, ext_proto_get_next_sta_info_t get_next_sta,
27832864
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)
2865+
ext_proto_put_scan_results_t put_scan_res, ext_proto_update_ap_mld_info_t update_ap_mld,
2866+
ext_proto_update_bsta_mld_info_t update_bsta_mld, ext_proto_update_assoc_sta_mld_info_t update_assoc_sta_mld,
2867+
ext_proto_get_ap_mld_frm_bssid_t get_ap_mld_frm_bssid)
27852868
{
27862869
proto->data_model = data_model;
27872870
proto->m2ctrl_radioconfig = m2ctrl_radioconfig;
@@ -2804,4 +2887,8 @@ void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *d
28042887
proto->put_sta_info = put_sta;
28052888
proto->get_bss_info_with_mac = get_bss_with_mac;
28062889
proto->put_scan_results = put_scan_res;
2890+
proto->update_ap_mld_info = update_ap_mld;
2891+
proto->update_bsta_mld_info = update_bsta_mld;
2892+
proto->update_assoc_sta_mld_info = update_assoc_sta_mld;
2893+
proto->get_ap_mld_frm_bssid = get_ap_mld_frm_bssid;
28072894
}

0 commit comments

Comments
 (0)