From 8a45fbb1a913f618c01896c75d33f618bc326b8e Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 3 Apr 2017 16:48:31 -0700 Subject: qcacld-3.0: Prune PCL to active channels only for P2P GO Prune the PCL to have only active channels for P2P GO mode. Change-Id: Ifade00b3ccfcecff16a49e9e9aa5e077d5f9629b CRs-Fixed: 2029007 --- core/cds/src/cds_concurrency.c | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index e3409d5f1ffd..96cf9bc7e61e 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -5205,6 +5205,38 @@ bool cds_map_concurrency_mode(enum tQDF_ADAPTER_MODE *old_mode, return status; } +static QDF_STATUS cds_modify_pcl_based_on_enabled_channels( + uint8_t *pcl_list_org, + uint8_t *weight_list_org, + uint32_t *pcl_len_org) +{ + cds_context_type *cds_ctx; + uint32_t i, pcl_len = 0; + uint8_t pcl_list[QDF_MAX_NUM_CHAN]; + uint8_t weight_list[QDF_MAX_NUM_CHAN]; + + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { + cds_err("Invalid CDS Context"); + return QDF_STATUS_E_FAILURE; + } + + for (i = 0; i < *pcl_len_org; i++) { + if (!CDS_IS_PASSIVE_OR_DISABLE_CH(pcl_list_org[i])) { + pcl_list[pcl_len] = pcl_list_org[i]; + weight_list[pcl_len++] = weight_list_org[i]; + } + } + + qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org)); + qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org)); + qdf_mem_copy(pcl_list_org, pcl_list, pcl_len); + qdf_mem_copy(weight_list_org, weight_list, pcl_len); + *pcl_len_org = pcl_len; + + return QDF_STATUS_SUCCESS; +} + /** * cds_get_channel() - provide channel number of given mode and vdevid * @mode: given CDS mode @@ -5381,6 +5413,19 @@ QDF_STATUS cds_get_pcl(enum cds_con_mode mode, } + if (mode == CDS_P2P_GO_MODE) { + status = cds_modify_pcl_based_on_enabled_channels( + pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + cds_err("failed to get modified pcl for GO"); + return status; + } + cds_debug("modified pcl len:%d", *len); + for (i = 0; i < *len; i++) + cds_debug("chan:%d weight:%d", + pcl_channels[i], pcl_weight[i]); + } + return QDF_STATUS_SUCCESS; } -- cgit v1.2.3