summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushnim Bhattacharyya <tushnimb@codeaurora.org>2017-04-03 16:48:31 -0700
committerSandeep Puligilla <spuligil@codeaurora.org>2017-04-04 22:54:32 -0700
commit8a45fbb1a913f618c01896c75d33f618bc326b8e (patch)
treebdc81852ef52627390388285401e7df87889db8e
parent9f28572ef080f09472d67778450fd5da4f38a7b4 (diff)
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
-rw-r--r--core/cds/src/cds_concurrency.c45
1 files changed, 45 insertions, 0 deletions
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;
}