diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index ea325a09e1..dd8446d07b 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -120,6 +120,58 @@ enum PM_AP_DFS_MASTER_MODE { PM_STA_SAP_ON_DFS_MASTER_MODE_FLEX, }; +static inline const char *pcl_type_to_string(uint32_t idx) +{ + switch (idx) { + CASE_RETURN_STRING(PM_NONE); + CASE_RETURN_STRING(PM_24G); + CASE_RETURN_STRING(PM_5G); + CASE_RETURN_STRING(PM_SCC_CH); + CASE_RETURN_STRING(PM_MCC_CH); + CASE_RETURN_STRING(PM_SCC_CH_24G); + CASE_RETURN_STRING(PM_SCC_CH_5G); + CASE_RETURN_STRING(PM_24G_SCC_CH); + CASE_RETURN_STRING(PM_5G_SCC_CH); + CASE_RETURN_STRING(PM_SCC_ON_5_SCC_ON_24_24G); + CASE_RETURN_STRING(PM_SCC_ON_5_SCC_ON_24_5G); + CASE_RETURN_STRING(PM_SCC_ON_24_SCC_ON_5_24G); + CASE_RETURN_STRING(PM_SCC_ON_24_SCC_ON_5_5G); + CASE_RETURN_STRING(PM_SCC_ON_5_SCC_ON_24); + CASE_RETURN_STRING(PM_SCC_ON_24_SCC_ON_5); + CASE_RETURN_STRING(PM_MCC_CH_24G); + CASE_RETURN_STRING(PM_MCC_CH_5G); + CASE_RETURN_STRING(PM_24G_MCC_CH); + CASE_RETURN_STRING(PM_5G_MCC_CH); + CASE_RETURN_STRING(PM_SBS_CH); + CASE_RETURN_STRING(PM_SBS_CH_5G); + CASE_RETURN_STRING(PM_24G_SCC_CH_SBS_CH); + CASE_RETURN_STRING(PM_24G_SCC_CH_SBS_CH_5G); + CASE_RETURN_STRING(PM_24G_SBS_CH_MCC_CH); + /* New PCL type for DBS-SBS HW */ + CASE_RETURN_STRING(PM_SBS_CH_24G_SCC_CH); + CASE_RETURN_STRING(PM_SBS_CH_SCC_CH_24G); + CASE_RETURN_STRING(PM_SCC_CH_SBS_CH_24G); + CASE_RETURN_STRING(PM_SBS_CH_SCC_CH_5G_24G); + CASE_RETURN_STRING(PM_SCC_CH_MCC_CH_SBS_CH_24G); + default: + return "Unknown"; + } +} + +static inline const char *device_mode_to_string(uint32_t idx) +{ + switch (idx) { + CASE_RETURN_STRING(PM_STA_MODE); + CASE_RETURN_STRING(PM_SAP_MODE); + CASE_RETURN_STRING(PM_P2P_CLIENT_MODE); + CASE_RETURN_STRING(PM_P2P_GO_MODE); + CASE_RETURN_STRING(PM_NDI_MODE); + CASE_RETURN_STRING(PM_NAN_DISC_MODE); + default: + return "Unknown"; + } +}; + /** * policy_mgr_get_allow_mcc_go_diff_bi() - to get information on whether GO * can have diff BI than STA in MCC diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index f1f48ccfb9..3adb461345 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -2259,9 +2259,6 @@ void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( weight_list[i] = 0; } - policy_mgr_dump_channel_list(orig_channel_count, - pcl_channels, weight_list); - return; } @@ -2937,9 +2934,10 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, break; } - if ((*len != 0) && (*len != i)) - policy_mgr_debug("pcl len (%d) and weight list len mismatch (%d)", - *len, i); + policy_mgr_debug("pcl %s: mode %s", pcl_type_to_string(pcl), + device_mode_to_string(mode)); + policy_mgr_debug("pcl len %d and weight list sz %d", + *len, pcl_sz); /* check the channel avoidance list for beaconing entities */ if ((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 1aff013968..686f503b48 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -835,8 +835,6 @@ static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go( } } - policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight); - return QDF_STATUS_SUCCESS; } @@ -1026,8 +1024,6 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, return status; } - policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight); - policy_mgr_mode_specific_modification_on_pcl( psoc, pcl_channels, pcl_weight, len, mode); @@ -1038,6 +1034,8 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, policy_mgr_err("failed to get modified pcl based on DNBS"); return status; } + policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight); + return QDF_STATUS_SUCCESS; } @@ -2320,6 +2318,7 @@ QDF_STATUS policy_mgr_get_valid_chans_from_range( policy_mgr_err("failed to get modified pcl based on DNBS"); return status; } + policy_mgr_dump_channel_list(*ch_cnt, ch_freq_list, ch_weight_list); return status; } @@ -2688,7 +2687,7 @@ uint32_t policy_mgr_get_alternate_channel_for_sap( bool policy_mgr_dump_channel_list(uint32_t len, uint32_t *pcl_channels, uint8_t *pcl_weight) { - uint32_t idx, buff_len, num = 0, count = 0, count_6G = 0; + uint32_t idx, buff_len, num = 0, count = 0; char *chan_buff = NULL; buff_len = (QDF_MIN(len, MAX_CHAN_TO_PRINT) * CHAN_WEIGHT_CHAR_LEN) + 1; @@ -2698,51 +2697,22 @@ bool policy_mgr_dump_channel_list(uint32_t len, uint32_t *pcl_channels, policymgr_nofl_debug("Total PCL Chan Freq %d", len); for (idx = 0; (idx < len) && (idx < NUM_CHANNELS); idx++) { - if (!WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_channels[idx])) { - num += qdf_scnprintf(chan_buff + num, buff_len - num, - " %d[%d]", pcl_channels[idx], - pcl_weight[idx]); - count++; - if (count >= MAX_CHAN_TO_PRINT) { - /* Print the MAX_CHAN_TO_PRINT channels */ - policymgr_nofl_debug("2G+5G Freq[weight]:%s", - chan_buff); - count = 0; - num = 0; - } - } else { - count_6G++; + num += qdf_scnprintf(chan_buff + num, buff_len - num, + " %d[%d]", pcl_channels[idx], + pcl_weight[idx]); + count++; + if (count >= MAX_CHAN_TO_PRINT) { + /* Print the MAX_CHAN_TO_PRINT channels */ + policymgr_nofl_debug("Freq[weight]:%s", + chan_buff); + count = 0; + num = 0; } } /* Print any pending channels */ if (num) - policymgr_nofl_debug("2G+5G Freq[weight]:%s", chan_buff); + policymgr_nofl_debug("Freq[weight]:%s", chan_buff); - if (!count_6G) - goto free; - - count = 0; - num = 0; - for (idx = 0; (idx < len) && (idx < NUM_CHANNELS); idx++) { - if (WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_channels[idx])) { - num += qdf_scnprintf(chan_buff + num, buff_len - num, - " %d[%d]", pcl_channels[idx], - pcl_weight[idx]); - count++; - if (count >= MAX_CHAN_TO_PRINT) { - /* Print the MAX_CHAN_TO_PRINT channels */ - policymgr_nofl_debug("6G Freq[weight]:%s", - chan_buff); - count = 0; - num = 0; - } - } - } - /* Print any pending channels */ - if (num) - policymgr_nofl_debug("6G Freq[weight]:%s", chan_buff); - -free: qdf_mem_free(chan_buff); return true; diff --git a/core/hdd/src/wlan_hdd_conc_ut.c b/core/hdd/src/wlan_hdd_conc_ut.c index 5e80c8c0a3..41847bf0cb 100644 --- a/core/hdd/src/wlan_hdd_conc_ut.c +++ b/core/hdd/src/wlan_hdd_conc_ut.c @@ -97,45 +97,6 @@ static const char *system_config_to_string(uint8_t idx) } -static const char *device_mode_to_string(uint8_t idx) -{ - switch (idx) { - CASE_RETURN_STRING(PM_STA_MODE); - CASE_RETURN_STRING(PM_SAP_MODE); - CASE_RETURN_STRING(PM_P2P_CLIENT_MODE); - CASE_RETURN_STRING(PM_P2P_GO_MODE); - default: - return "none"; - } -} - -static const char *pcl_type_to_string(uint8_t idx) -{ - switch (idx) { - CASE_RETURN_STRING(PM_NONE); - CASE_RETURN_STRING(PM_24G); - CASE_RETURN_STRING(PM_5G); - CASE_RETURN_STRING(PM_SCC_CH); - CASE_RETURN_STRING(PM_MCC_CH); - CASE_RETURN_STRING(PM_SCC_CH_24G); - CASE_RETURN_STRING(PM_SCC_CH_5G); - CASE_RETURN_STRING(PM_24G_SCC_CH); - CASE_RETURN_STRING(PM_5G_SCC_CH); - CASE_RETURN_STRING(PM_SCC_ON_5_SCC_ON_24_24G); - CASE_RETURN_STRING(PM_SCC_ON_5_SCC_ON_24_5G); - CASE_RETURN_STRING(PM_SCC_ON_24_SCC_ON_5_24G); - CASE_RETURN_STRING(PM_SCC_ON_24_SCC_ON_5_5G); - CASE_RETURN_STRING(PM_SCC_ON_5_SCC_ON_24); - CASE_RETURN_STRING(PM_SCC_ON_24_SCC_ON_5); - CASE_RETURN_STRING(PM_MCC_CH_24G); - CASE_RETURN_STRING(PM_MCC_CH_5G); - CASE_RETURN_STRING(PM_24G_MCC_CH); - CASE_RETURN_STRING(PM_5G_MCC_CH); - default: - return "Unknown"; - } -} - void clean_report(struct hdd_context *hdd_ctx) { uint32_t idx = 0;