Ver código fonte

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
Govind Singh 9 anos atrás
pai
commit
efc5ccd7ca
4 arquivos alterados com 48 adições e 3 exclusões
  1. 9 0
      core/wma/inc/wma.h
  2. 11 1
      core/wma/src/wma_data.c
  3. 14 2
      core/wma/src/wma_dev_if.c
  4. 14 0
      core/wma/src/wma_main.c

+ 9 - 0
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.

+ 11 - 1
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);
 }
 
 /**

+ 14 - 2
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,

+ 14 - 0
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);