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

qcacmn: Enable CFR support for target QCA6750

Host enables CFR support for QCA6750 target.

Change-Id: I3e68d3984eef7faa94739a71124315336922e417
CRs-Fixed: 2754922
Abhishek Ambure 4 жил өмнө
parent
commit
fb27821b98

+ 0 - 23
target_if/cfr/inc/target_if_cfr_6490.h

@@ -44,27 +44,4 @@ QDF_STATUS
 target_if_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev,
 				  bool is_subscribe);
 
-/**
- * cfr_6490_init_pdev() - Init pdev cfr for QCA6490
- * @psoc: pointer to psoc object
- * @pdev: pointer to pdev object
- *
- * Registers to DBR component and init pdev cfr parameters
- *
- * Return: QDF status
- */
-QDF_STATUS cfr_6490_init_pdev(struct wlan_objmgr_psoc *psoc,
-			      struct wlan_objmgr_pdev *pdev);
-
-/**
- * cfr_6490_deinit_pdev() - De-inits pdev cfr for QCA6490
- * @pdev: pointer to pdev object
- *
- * Unregister to DBR and deinit pdev cfr parameters
- *
- * Return: QDF status
- */
-QDF_STATUS cfr_6490_deinit_pdev(struct wlan_objmgr_psoc *psoc,
-				struct wlan_objmgr_pdev *pdev);
-
 #endif /* _TARGET_IF_CFR_6490_H */

+ 93 - 4
target_if/cfr/src/target_if_cfr.c

@@ -196,6 +196,92 @@ int target_if_cfr_get_target_type(struct wlan_objmgr_psoc *psoc)
 }
 
 #ifdef CFR_USE_FIXED_FOLDER
+static QDF_STATUS target_if_cfr_init_target(struct wlan_objmgr_psoc *psoc,
+					    struct wlan_objmgr_pdev *pdev,
+					    uint32_t target)
+{
+	struct pdev_cfr *cfr_pdev;
+	struct psoc_cfr *cfr_psoc;
+	struct wmi_unified *wmi_handle = NULL;
+	bool cfr_capable;
+	QDF_STATUS status;
+
+	if (!psoc || !pdev) {
+		cfr_err("null pdev or psoc");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	cfr_pdev = wlan_objmgr_pdev_get_comp_private_obj(pdev,
+							 WLAN_UMAC_COMP_CFR);
+	if (!cfr_pdev) {
+		cfr_err("null pdev cfr");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	cfr_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
+							 WLAN_UMAC_COMP_CFR);
+
+	if (!cfr_psoc) {
+		cfr_err("null psoc cfr");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	wmi_handle = lmac_get_pdev_wmi_handle(pdev);
+	if (!wmi_handle) {
+		cfr_err("null wmi handle");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (wlan_cfr_is_feature_disabled(pdev)) {
+		cfr_pdev->is_cfr_capable = 0;
+		cfr_psoc->is_cfr_capable = 0;
+		cfr_info("cfr disabled");
+		return QDF_STATUS_SUCCESS;
+	}
+
+	cfr_capable = wmi_service_enabled(wmi_handle,
+					  wmi_service_cfr_capture_support);
+	cfr_pdev->is_cfr_capable = cfr_capable;
+	cfr_psoc->is_cfr_capable = cfr_capable;
+	if (!cfr_capable) {
+		cfr_err("FW doesn't support CFR");
+		return QDF_STATUS_SUCCESS;
+	}
+
+	status = cfr_enh_init_pdev(psoc, pdev);
+	if (target == TARGET_TYPE_QCA6490)
+		cfr_pdev->chip_type = CFR_CAPTURE_RADIO_HSP;
+	else if (target == TARGET_TYPE_QCA6750)
+		cfr_pdev->chip_type = CFR_CAPTURE_RADIO_MOSELLE;
+
+	return status;
+}
+
+static QDF_STATUS target_if_cfr_deinit_target(struct wlan_objmgr_psoc *psoc,
+					      struct wlan_objmgr_pdev *pdev)
+{
+	struct pdev_cfr *pcfr;
+
+	if (!psoc || !pdev) {
+		cfr_err("null pdev or psoc");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	pcfr = wlan_objmgr_pdev_get_comp_private_obj(pdev,
+						     WLAN_UMAC_COMP_CFR);
+	if (!pcfr) {
+		cfr_err("null pdev cfr");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!pcfr->is_cfr_capable) {
+		cfr_info("cfr disabled or FW not support");
+		return QDF_STATUS_SUCCESS;
+	}
+
+	return cfr_enh_deinit_pdev(psoc, pdev);
+}
+
 int target_if_cfr_init_pdev(struct wlan_objmgr_psoc *psoc,
 			    struct wlan_objmgr_pdev *pdev)
 {
@@ -204,8 +290,10 @@ int target_if_cfr_init_pdev(struct wlan_objmgr_psoc *psoc,
 
 	target_type = target_if_cfr_get_target_type(psoc);
 
-	if (target_type == TARGET_TYPE_QCA6490) {
-		status = cfr_6490_init_pdev(psoc, pdev);
+	if (target_type == TARGET_TYPE_QCA6490 ||
+	    target_type == TARGET_TYPE_QCA6750) {
+		status = target_if_cfr_init_target(psoc,
+						   pdev, target_type);
 	} else if (target_type == TARGET_TYPE_ADRASTEA) {
 		status = cfr_adrastea_init_pdev(psoc, pdev);
 	} else {
@@ -224,8 +312,9 @@ int target_if_cfr_deinit_pdev(struct wlan_objmgr_psoc *psoc,
 
 	target_type = target_if_cfr_get_target_type(psoc);
 
-	if (target_type == TARGET_TYPE_QCA6490) {
-		status = cfr_6490_deinit_pdev(psoc, pdev);
+	if (target_type == TARGET_TYPE_QCA6490 ||
+	    target_type == TARGET_TYPE_QCA6750) {
+		status = target_if_cfr_deinit_target(psoc, pdev);
 	} else if (target_type == TARGET_TYPE_ADRASTEA) {
 		status = cfr_adrastea_deinit_pdev(psoc, pdev);
 	} else {

+ 0 - 80
target_if/cfr/src/target_if_cfr_6490.c

@@ -121,84 +121,4 @@ target_if_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev,
 #endif
 #endif
 
-QDF_STATUS cfr_6490_init_pdev(struct wlan_objmgr_psoc *psoc,
-			      struct wlan_objmgr_pdev *pdev)
-{
-	struct pdev_cfr *cfr_pdev;
-	struct psoc_cfr *cfr_psoc;
-	struct wmi_unified *wmi_handle = NULL;
-	bool cfr_capable;
-	QDF_STATUS status;
-
-	if (!psoc || !pdev) {
-		cfr_err("null pdev or psoc");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	cfr_pdev = wlan_objmgr_pdev_get_comp_private_obj(
-					pdev, WLAN_UMAC_COMP_CFR);
-	if (!cfr_pdev) {
-		cfr_err("null pdev cfr");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	cfr_psoc = wlan_objmgr_psoc_get_comp_private_obj(
-					psoc, WLAN_UMAC_COMP_CFR);
-
-	if (!cfr_psoc) {
-		cfr_err("null psoc cfr");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	wmi_handle = lmac_get_pdev_wmi_handle(pdev);
-	if (!wmi_handle) {
-		cfr_err("null wmi handle");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	if (wlan_cfr_is_feature_disabled(pdev)) {
-		cfr_pdev->is_cfr_capable = 0;
-		cfr_psoc->is_cfr_capable = 0;
-		cfr_info("cfr disabled");
-		return QDF_STATUS_SUCCESS;
-	}
-
-	cfr_capable = wmi_service_enabled(wmi_handle,
-					  wmi_service_cfr_capture_support);
-	cfr_pdev->is_cfr_capable = cfr_capable;
-	cfr_psoc->is_cfr_capable = cfr_capable;
-	if (!cfr_capable) {
-		cfr_err("FW doesn't support CFR");
-		return QDF_STATUS_SUCCESS;
-	}
-
-	status = cfr_enh_init_pdev(psoc, pdev);
-	cfr_pdev->chip_type = CFR_CAPTURE_RADIO_HSP;
 
-	return status;
-}
-
-QDF_STATUS cfr_6490_deinit_pdev(struct wlan_objmgr_psoc *psoc,
-				struct wlan_objmgr_pdev *pdev)
-{
-	struct pdev_cfr *pcfr;
-
-	if (!psoc || !pdev) {
-		cfr_err("null pdev or psoc");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	pcfr = wlan_objmgr_pdev_get_comp_private_obj(
-					pdev, WLAN_UMAC_COMP_CFR);
-	if (!pcfr) {
-		cfr_err("null pdev cfr");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	if (!pcfr->is_cfr_capable) {
-		cfr_info("cfr disabled or FW not support");
-		return QDF_STATUS_SUCCESS;
-	}
-
-	return cfr_enh_deinit_pdev(psoc, pdev);
-}

+ 1 - 0
umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h

@@ -98,6 +98,7 @@ enum cfrradiotype {
 	CFR_CAPTURE_RADIO_PINE,
 	CFR_CAPTURE_RADIO_ADRASTEA,
 	CFR_CAPTURE_RADIO_MAPLE,
+	CFR_CAPTURE_RADIO_MOSELLE,
 	CFR_CAPTURE_RADIO_MAX = 0xFF,
 };