summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGovind Singh <govinds@codeaurora.org>2016-04-25 11:11:55 +0530
committerVishwajith Upendra <vishwaji@codeaurora.org>2016-05-02 23:28:03 -0700
commitefc5ccd7ca5791056501ebfd9d63833e7f9d3d71 (patch)
tree73d2795829e20d33ebe0238665b0e79bb4be5306
parent89c66ff56cf94853cc11bb4e25ddf21413e96860 (diff)
qcacld-3.0: Replace mac_id with pdev_id in WMI PDEV commands
Replace mac_id with pdev_id for WMI pdev commands and vdev start response handler to support multi-radio in converged firmware. In order to maintain backward compatibility with old fw, host needs to check WMI_SERVICE_DEPRECATED_REPLACE service id in service bitmap and needs to fill pdev id or mac id accordingly. Change-Id: I7e6b40b4c0bd20e967dc0a383b480068e256486f CRs-Fixed: 994415
-rw-r--r--core/wma/inc/wma.h9
-rw-r--r--core/wma/src/wma_data.c12
-rw-r--r--core/wma/src/wma_dev_if.c16
-rw-r--r--core/wma/src/wma_main.c14
4 files changed, 48 insertions, 3 deletions
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index ff9dca2f5a70..b525dd771d9f 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -63,6 +63,15 @@
#define WMA_CRASH_INJECT_TIMEOUT 5000
+/* MAC ID to PDEV ID mapping is as given below
+ * MAC_ID PDEV_ID
+ * 0 1
+ * 1 2
+ * SOC Level WMI_PDEV_ID_SOC
+ */
+#define WMA_MAC_TO_PDEV_MAP(x) ((x) + (1))
+#define WMA_PDEV_TO_MAC_MAP(x) ((x) - (1))
+
/* In prima 12 HW stations are supported including BCAST STA(staId 0)
* and SELF STA(staId 1) so total ASSOC stations which can connect to Prima
* SoftAP = 12 - 1(Self STa) - 1(Bcast Sta) = 10 Stations.
diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c
index 572b7d91a1d8..ec3c88102331 100644
--- a/core/wma/src/wma_data.c
+++ b/core/wma/src/wma_data.c
@@ -999,6 +999,7 @@ QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
mcc_adaptive_scheduler)
{
tp_wma_handle wma = NULL;
+ uint32_t pdev_id;
wma = cds_get_context(QDF_MODULE_ID_WMA);
if (NULL == wma) {
@@ -1006,8 +1007,17 @@ QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
return QDF_STATUS_E_FAULT;
}
+ /* In WMI_RESMGR_ADAPTIVE_OCS_ENABLE_DISABLE_CMDID fw cannot
+ * determine the PDEV on its own, Host needs to specify the PDEV
+ * ID in the command.
+ */
+ if (wma->wlan_resource_config.use_pdev_id)
+ pdev_id = WMA_MAC_TO_PDEV_MAP(0);
+ else
+ pdev_id = WMI_PDEV_ID_SOC;
+
return wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
- wma->wmi_handle, mcc_adaptive_scheduler);
+ wma->wmi_handle, mcc_adaptive_scheduler, pdev_id);
}
/**
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index 7526499d390c..efdde8dd5b5c 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -820,8 +820,20 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
resp_event->cfgd_rx_streams;
wma->interfaces[resp_event->vdev_id].chain_mask =
resp_event->chain_mask;
- wma->interfaces[resp_event->vdev_id].mac_id =
- resp_event->mac_id;
+ if (wma->wlan_resource_config.use_pdev_id) {
+ if (resp_event->pdev_id == WMI_PDEV_ID_SOC) {
+ WMA_LOGE("%s: soc level id received for mac id",
+ __func__);
+ QDF_BUG(0);
+ return -EINVAL;
+ }
+ wma->interfaces[resp_event->vdev_id].mac_id =
+ WMA_PDEV_TO_MAC_MAP(resp_event->pdev_id);
+ } else {
+ wma->interfaces[resp_event->vdev_id].mac_id =
+ resp_event->mac_id;
+ }
+
WMA_LOGI("%s: vdev:%d tx ss=%d rx ss=%d chain mask=%d mac=%d",
__func__,
resp_event->vdev_id,
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index f0720411203d..defe3cc90cb9 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -3917,6 +3917,20 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
return -EINVAL;
}
+ /* mac_id is replaced with pdev_id in converged firmware to have
+ * multi-radio support. In order to maintain backward compatibility
+ * with old fw, host needs to check WMI_SERVICE_DEPRECATED_REPLACE
+ * in service bitmap from FW and host needs to set use_pdev_id in
+ * wmi_resource_config to true. If WMI_SERVICE_DEPRECATED_REPLACE
+ * service is not set, then host shall not expect MAC ID from FW in
+ * VDEV START RESPONSE event and host shall use PDEV ID.
+ */
+ if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
+ WMI_SERVICE_DEPRECATED_REPLACE))
+ wma_handle->wlan_resource_config.use_pdev_id = true;
+ else
+ wma_handle->wlan_resource_config.use_pdev_id = false;
+
/* register the Enhanced Green AP event handler */
wma_register_egap_event_handle(wma_handle);