diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 5e85077b5f..955ca8ebd4 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3175,12 +3175,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, sap_config->acs_cfg.is_ht_enabled = ht_enabled; sap_config->acs_cfg.is_vht_enabled = vht_enabled; - if (sap_config->acs_cfg.ch_list_count) { - hdd_nofl_debug("ACS freq list: len: %d", - sap_config->acs_cfg.ch_list_count); - for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++) - hdd_nofl_debug("%d ", sap_config->acs_cfg.freq_list[i]); - } + sap_dump_acs_channel(&sap_config->acs_cfg); qdf_status = ucfg_mlme_get_vendor_acs_support(hdd_ctx->psoc, &is_vendor_acs_support); diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 14d7fcb5fc..dab93afa3e 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -1485,6 +1485,16 @@ QDF_STATUS sap_acquire_vdev_ref(struct wlan_objmgr_psoc *psoc, struct sap_context *sap_ctx, uint8_t session_id); +/** + * sap_dump_acs_channel() - dump acs channel list + * @acs_cfg: acs config + * + * This function dump acs channel list + * + * Return: void. + */ +void sap_dump_acs_channel(struct sap_acs_cfg *acs_cfg); + /** * sap_release_vdev_ref() - Decrement reference count for vdev object * @sap_ctx: for which vdev reference is to be decremented diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 7481a7754a..f6c009c377 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -3211,6 +3211,30 @@ QDF_STATUS sap_is_peer_mac_allowed(struct sap_context *sap_ctx, return QDF_STATUS_SUCCESS; } +void sap_dump_acs_channel(struct sap_acs_cfg *acs_cfg) +{ + uint32_t buf_len = 0, len = 0, i; + uint8_t *chan_buff = NULL; + + /* + * Buffer of (num channl * 5) + 1 to consider the 4 char freq + * and 1 space after it for each channel and 1 to end the string + * with NULL. + */ + buf_len = (acs_cfg->ch_list_count * 5) + 1; + chan_buff = qdf_mem_malloc(buf_len); + if (!chan_buff) + return; + + for (i = 0; i < acs_cfg->ch_list_count; i++) + len += qdf_scnprintf(chan_buff + len, buf_len - len, + " %d", acs_cfg->freq_list[i]); + + sap_nofl_debug("ACS freq list[%d]:%s", + acs_cfg->ch_list_count, chan_buff); + qdf_mem_free(chan_buff); +} + #ifdef SOFTAP_CHANNEL_RANGE /** * sap_get_freq_list() - get the list of channel frequency @@ -3448,11 +3472,10 @@ static QDF_STATUS sap_get_freq_list(struct sap_context *sap_ctx, } for (loop_count = 0; loop_count < ch_count; loop_count++) { - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, - FL("channel frequency: %d"), list[loop_count]); sap_ctx->acs_cfg->freq_list[loop_count] = list[loop_count]; } sap_ctx->acs_cfg->ch_list_count = ch_count; + sap_dump_acs_channel(sap_ctx->acs_cfg); return QDF_STATUS_SUCCESS; } diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index badef8d00c..3804957a68 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -728,7 +728,8 @@ QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle, { QDF_STATUS status; int i; - uint32_t *chan_list_mhz = NULL; + uint32_t *chan_list_mhz = NULL, buf_len = 0, len = 0; + uint8_t *chan_buff = NULL; if (!wma_is_vdev_valid(vdev_id)) { WMA_LOGE("%s: Invalid vdev id:%d", __func__, vdev_id); @@ -739,12 +740,27 @@ QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle, chan_list_mhz = qdf_mem_malloc(chan_count * sizeof(*chan_list_mhz)); if (!chan_list_mhz) return QDF_STATUS_E_NOMEM; + + /* + * Buffer of (num channl * 5) + 1 to consider the 4 char freq + * and 1 space after it for each channel and 1 to end the string + * with NULL. + */ + buf_len = (chan_count * 5) + 1; + chan_buff = qdf_mem_malloc(buf_len); } for (i = 0; ((i < chan_count) && (i < SIR_ROAM_MAX_CHANNELS)); i++) { chan_list_mhz[i] = chan_freq_list[i]; - WMA_LOGD("%d,", chan_list_mhz[i]); + if (chan_buff) + len += qdf_scnprintf(chan_buff + len, buf_len - len, + " %d", chan_list_mhz[i]); + } + + if (chan_buff) { + wma_debug("Freq list[%d]:%s", chan_count, chan_buff); + qdf_mem_free(chan_buff); } status = wmi_unified_roam_scan_offload_chan_list_cmd(