From ebcab886505c506e2ab04c8d91ea9c2a3d0454d2 Mon Sep 17 00:00:00 2001 From: Manishekar Chandrasekaran Date: Wed, 4 May 2016 12:55:14 +0530 Subject: [PATCH] qcacld-3.0: Initialize max peers before default target configuration Make sure that the maximum number of peers is initialized before this value is configured to the target. Currently, the default target configuration is happening even before the max number of peers is initialized. Fix the same by initializing the max peers before the default target configuration. Change-Id: I189e9c92727703655b238b3edd1e3b480a09c17e CRs-Fixed: 1011487 --- core/wma/src/wma_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index d068183616bf..89889ddca52e 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1678,6 +1678,13 @@ QDF_STATUS wma_open(void *cds_context, wma_handle->wma_runtime_resume_lock = qdf_runtime_lock_init("wma_runtime_resume"); + /* Initialize max_no_of_peers for wma_get_number_of_peers_supported() */ + wma_init_max_no_of_peers(wma_handle, mac_params->maxStation); + /* Cap maxStation based on the target version */ + mac_params->maxStation = wma_get_number_of_peers_supported(wma_handle); + /* Reinitialize max_no_of_peers based on the capped maxStation value */ + wma_init_max_no_of_peers(wma_handle, mac_params->maxStation); + /* initialize default target config */ wma_set_default_tgt_config(wma_handle); @@ -1739,8 +1746,6 @@ QDF_STATUS wma_open(void *cds_context, if (cds_get_conparam() == QDF_GLOBAL_FTM_MODE) wma_utf_attach(wma_handle); #endif /* QCA_WIFI_FTM */ - wma_init_max_no_of_peers(wma_handle, mac_params->maxStation); - mac_params->maxStation = wma_get_number_of_peers_supported(wma_handle); mac_params->maxBssId = WMA_MAX_SUPPORTED_BSS; mac_params->frameTransRequired = 0;