Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
357 changes: 357 additions & 0 deletions config/TR181-WiFi-USGv2.XML

Large diffs are not rendered by default.

454 changes: 454 additions & 0 deletions include/tr_181/ml/cosa_wifi_dml.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions source/core/wifi_ctrl_queue_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ void process_disassoc_device_event(void *data)
if (rdk_vap_info == NULL) {
return;
}

{FILE *out = fopen("/tmp/log12.txt", "a"); fprintf(out, "process_disassoc_device_event \n"); fflush(out);fclose(out);}
memset(mac_str, 0, sizeof(mac_str));
to_mac_str(assoc_data->dev_stats.cli_MACAddress, mac_str);

Expand Down Expand Up @@ -1884,7 +1884,7 @@ void process_assoc_device_event(void *data)
wifi_util_error_print(WIFI_CTRL,"%s:%d NULL rdk_vap_info pointer\n", __func__, __LINE__);
return;
}

{FILE *out = fopen("/tmp/log12.txt", "a"); fprintf(out, "process_assoc_device_event \n"); fflush(out);fclose(out);}
pthread_mutex_lock(rdk_vap_info->associated_devices_lock);
if (rdk_vap_info->associated_devices_map == NULL) {
pthread_mutex_unlock(rdk_vap_info->associated_devices_lock);
Expand Down
136 changes: 135 additions & 1 deletion source/dml/dml_webconfig/dml_onewifi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ UINT get_num_radio_dml()
}
}

UINT get_total_num_affiliated_ap_dml()
{
return 3;
}

UINT get_total_num_apmld_dml()
{
return 8;
}

UINT get_total_num_vap_dml()
{
webconfig_dml_t* pwebconfig = get_webconfig_dml();
Expand Down Expand Up @@ -551,7 +561,7 @@ webconfig_error_t webconfig_dml_apply(webconfig_dml_t *consumer, webconfig_subdo
return webconfig_error_none;
}

void get_associated_devices_data(unsigned int radio_index)
void get_associated_devices_data(unsigned int radio_index) //Stano why we have here radio index which is not used???
{
int itr=0, itrj=0;
webconfig_subdoc_data_t data;
Expand All @@ -575,6 +585,7 @@ void get_associated_devices_data(unsigned int radio_index)
free(str);
return;
}
//{FILE *out = fopen("/tmp/log12.txt", "a"); fprintf(out, "assoc data **** %s\n", str); fflush(out);fclose(out);}
pthread_mutex_lock(&webconfig_dml.assoc_dev_lock);
for (itr=0; itr < (int)get_num_radio_dml(); itr++) {
for (itrj=0; itrj<MAX_NUM_VAP_PER_RADIO; itrj++) {
Expand Down Expand Up @@ -602,6 +613,129 @@ void get_associated_devices_data(unsigned int radio_index)
webconfig_data_free(&data);
}

//Stano: Todo: we will not need this function - will arrive from APMLD via get entry
void create_mld_map_for_mld_unit(wifi_vap_info_t *mlo_vaps[4], UINT mld_id)
{
wifi_vap_info_map_t *mgr_vap_info_map = NULL;
unsigned int idx = 0;

for (unsigned int r_idx = 0; r_idx < getNumberRadios(); r_idx++) {

mgr_vap_info_map = get_wifidb_vap_map(r_idx);
if (mgr_vap_info_map == NULL) {
wifi_util_error_print(WIFI_DMCLI, "%s:%d get_wifidb_vap_map failed for radio: %d\n", __FUNCTION__, __LINE__, r_idx);
return;
}

for (unsigned int k = 0; k < mgr_vap_info_map->num_vaps; k++) {
wifi_vap_info_t *vap_config = &mgr_vap_info_map->vap_array[k];
wifi_mld_common_info_t *mld_info = &vap_config->u.bss_info.mld_info.common_info;
if (mld_info->mld_enable && mld_info->mld_id == mld_id) {
if (idx < 4)
mlo_vaps[idx++] = vap_config;
}
}
}
}

/*int get_mld_associated_devices_count_vap(wifi_vap_info_t *vap_info)
{
int count = 0;
assoc_dev_data_t *assoc_dev_data_temp = NULL;

pthread_mutex_lock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock);

hash_map_t *assoc_vap_info_map = (hash_map_t *)get_associated_devices_hash_map(vap_info->vap_index);
if (assoc_vap_info_map == NULL) {
wifi_util_error_print(WIFI_DMCLI,"%s:%d NULL pointer\n", __func__, __LINE__);
pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock);
return -1;
}

assoc_dev_data_temp = hash_map_get_first(assoc_vap_info_map);
while (assoc_dev_data_temp != NULL) {
if (assoc_dev_data_temp->dev_stats.cli_MLDEnable)
count++;
assoc_dev_data_temp = hash_map_get_next(assoc_vap_info_map, assoc_dev_data_temp);
}
pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock);
wifi_util_dbg_print(WIFI_DMCLI,"%s %d vap_index %d mlo associated devices count %d\n",
__func__, __LINE__, vap_info->vap_index, count);
return count;
}*/

unsigned long get_mld_associated_devices_count(UINT mlo_id)
{
int i;
unsigned long count = 0;
wifi_vap_info_t *mlo_vaps[4] = {0};
assoc_dev_data_t *assoc_dev_data_temp = NULL;
create_mld_map_for_mld_unit(mlo_vaps, mlo_id); //Stano: Todo: this will be input parameter of the func

pthread_mutex_lock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock);
for (i = 0; i < MAX_NUM_RADIOS; i++) {
wifi_vap_info_t *vap_info = mlo_vaps[i];
if (vap_info == NULL)
continue;;
hash_map_t *assoc_vap_info_map = (hash_map_t *)get_associated_devices_hash_map(vap_info->vap_index);
if (assoc_vap_info_map == NULL) {
wifi_util_error_print(WIFI_DMCLI,"%s:%d assoc_vap_info_map NULL pointer for vap_index %d\n",
__func__, __LINE__, vap_info->vap_index);
continue;
}

assoc_dev_data_temp = hash_map_get_first(assoc_vap_info_map);
while (assoc_dev_data_temp != NULL) {
if (assoc_dev_data_temp->dev_stats.cli_MLDEnable)
count++;
assoc_dev_data_temp = hash_map_get_next(assoc_vap_info_map, assoc_dev_data_temp);
}
}
pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock);
return count;
}

assoc_dev_data_t *get_mld_associated_device(UINT mlo_id, unsigned int dev_index)
{
int i;
unsigned long idx = 0; /*indexed from value 1 - idx=0 is invalid value*/
wifi_vap_info_t *mlo_vaps[4] = {0};
assoc_dev_data_t *assoc_dev_data_temp = NULL, *assoc_dev_data = NULL;
create_mld_map_for_mld_unit(mlo_vaps, mlo_id); //Stano: Todo: this will be input parameter of the func

pthread_mutex_lock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock);
for (i = 0; i < MAX_NUM_RADIOS; i++) {
wifi_vap_info_t *vap_info = mlo_vaps[i];
if (vap_info == NULL)
continue;
hash_map_t *assoc_vap_info_map = (hash_map_t *)get_associated_devices_hash_map(vap_info->vap_index);
if (assoc_vap_info_map == NULL) {
wifi_util_error_print(WIFI_DMCLI,"%s:%d assoc_vap_info_map NULL pointer for vap_index %d\n",
__func__, __LINE__, vap_info->vap_index);
continue;
}

assoc_dev_data_temp = hash_map_get_first(assoc_vap_info_map);
while (assoc_dev_data_temp != NULL) {
if (assoc_dev_data_temp->dev_stats.cli_MLDEnable)
idx++;
if (idx == dev_index)
break;
assoc_dev_data_temp = hash_map_get_next(assoc_vap_info_map, assoc_dev_data_temp);
}
assoc_dev_data = (assoc_dev_data_t*) malloc(sizeof(assoc_dev_data_t));
if (NULL == assoc_dev_data) {
wifi_util_error_print(WIFI_DMCLI,"%s:%d assoc_dev_data - allocation failed!\n", __func__, __LINE__);
pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock);
return NULL;
}
memcpy(assoc_dev_data, assoc_dev_data_temp, sizeof(assoc_dev_data_t));
}
pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock);
return assoc_dev_data;
}


unsigned long get_associated_devices_count(wifi_vap_info_t *vap_info)
{
unsigned long count = 0;
Expand Down
4 changes: 4 additions & 0 deletions source/dml/dml_webconfig/dml_onewifi_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ hash_map_t** get_dml_acl_hash_map(unsigned int radio_index, unsigned int vap_ind
queue_t** get_dml_acl_new_entry_queue(unsigned int radio_index, unsigned int vap_index);
void** get_acl_vap_context();
UINT get_num_radio_dml();
UINT get_total_num_affiliated_ap_dml();
UINT get_total_num_apmld_dml();
unsigned long get_mld_associated_devices_count(UINT mlo_id);
assoc_dev_data_t *get_mld_associated_device(UINT mlo_id, unsigned int dev_index);
UINT get_total_num_vap_dml();
void get_associated_devices_data(unsigned int radio_index);
unsigned long get_associated_devices_count(wifi_vap_info_t *vap_info);
Expand Down
Loading
Loading