Эх сурвалжийг харах

qcacld-3.0: Set wmi handle to pdev when saving pdev to wma handler

Spectral scan and CFR components failed in pdev open since no valid
wmi handle in pdev. This change sets wmi handle to pdev before calling
dispatcher pdev open in hdd layer.

Change-Id: I9461220b309f78e33770e423e24c97841b064a0f
CRs-Fixed: 2637140
Wu Gao 8 жил өмнө
parent
commit
58262e7922

+ 25 - 0
core/wma/src/wma_dev_if.c

@@ -5031,6 +5031,27 @@ void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
 					 pdis_intra_fwd->disableintrabssfwd);
 }
 
+/**
+ * wma_get_pdev_from_scn_handle() - API to get pdev from scn handle
+ * @scn_handle: opaque wma handle
+ *
+ * API to get pdev from scn handle
+ *
+ * Return: None
+ */
+static struct wlan_objmgr_pdev *wma_get_pdev_from_scn_handle(void *scn_handle)
+{
+	tp_wma_handle wma_handle;
+
+	if (!scn_handle) {
+		WMA_LOGE("invalid scn handle");
+		return NULL;
+	}
+	wma_handle = (tp_wma_handle)scn_handle;
+
+	return wma_handle->pdev;
+}
+
 void wma_store_pdev(void *wma_ctx, struct wlan_objmgr_pdev *pdev)
 {
 	tp_wma_handle wma = (tp_wma_handle)wma_ctx;
@@ -5043,6 +5064,10 @@ void wma_store_pdev(void *wma_ctx, struct wlan_objmgr_pdev *pdev)
 	}
 
 	wma->pdev = pdev;
+
+	target_if_store_pdev_target_if_ctx(wma_get_pdev_from_scn_handle);
+	target_pdev_set_wmi_handle(wma->pdev->tgt_if_handle,
+				   wma->wmi_handle);
 }
 
 /**

+ 0 - 24
core/wma/src/wma_main.c

@@ -1955,27 +1955,6 @@ static void wma_target_if_close(tp_wma_handle wma_handle)
 	wlan_global_lmac_if_close(psoc);
 }
 
-/**
- * wma_get_pdev_from_scn_handle() - API to get pdev from scn handle
- * @scn_handle: opaque wma handle
- *
- * API to get pdev from scn handle
- *
- * Return: None
- */
-static struct wlan_objmgr_pdev *wma_get_pdev_from_scn_handle(void *scn_handle)
-{
-	tp_wma_handle wma_handle;
-
-	if (!scn_handle) {
-		WMA_LOGE("invalid scn handle");
-		return NULL;
-	}
-	wma_handle = (tp_wma_handle)scn_handle;
-
-	return wma_handle->pdev;
-}
-
 /**
  * wma_legacy_service_ready_event_handler() - legacy (ext)service ready handler
  * @event_id: event_id
@@ -5529,9 +5508,6 @@ static int wma_update_hdd_cfg(tp_wma_handle wma_handle)
 	if (ret)
 		return -EINVAL;
 
-	target_if_store_pdev_target_if_ctx(wma_get_pdev_from_scn_handle);
-	target_pdev_set_wmi_handle(wma_handle->pdev->tgt_if_handle,
-				   wma_handle->wmi_handle);
 	wma_green_ap_register_handlers(wma_handle);
 
 	return ret;