浏览代码

qcacmn: Correct the WMI command id for CFR

Fix the wmi command id is not right issue for
enable/disable periodic peer CFR capture if
ENABLE_HOST_TO_TARGET_CONVERSION not enabled.

Change-Id: I82ba6c781f67aa73f373a0a914838f482d86f165
CRs-Fixed: 2865389
Chaoli Zhou 4 年之前
父节点
当前提交
bbccf20880
共有 2 个文件被更改,包括 35 次插入12 次删除
  1. 2 3
      target_if/cfr/inc/target_if_cfr.h
  2. 33 9
      target_if/cfr/src/target_if_cfr.c

+ 2 - 3
target_if/cfr/inc/target_if_cfr.h

@@ -93,13 +93,12 @@ int target_if_cfr_enable_cfr_timer(struct wlan_objmgr_pdev *pdev,
 /**
  * target_if_cfr_pdev_set_param() - Function to set params for cfr config
  * @pdev: pointer to pdev object
- * @param_id: param id which has to be set
  * @param_value: value of param being set
  *
  * Return: success/failure of setting param
  */
-int target_if_cfr_pdev_set_param(struct wlan_objmgr_pdev *pdev,
-				 uint32_t param_id, uint32_t param_value);
+int target_if_cfr_periodic_peer_cfr_enable(struct wlan_objmgr_pdev *pdev,
+					   uint32_t param_value);
 /**
  * target_if_cfr_start_capture() - Function to start cfr capture for a peer
  * @pdev: pointer to pdev object

+ 33 - 9
target_if/cfr/src/target_if_cfr.c

@@ -125,8 +125,9 @@ int target_if_cfr_start_capture(struct wlan_objmgr_pdev *pdev,
 	return retv;
 }
 
-int target_if_cfr_pdev_set_param(struct wlan_objmgr_pdev *pdev,
-				 uint32_t param_id, uint32_t param_value)
+#ifdef ENABLE_HOST_TO_TARGET_CONVERSION
+int target_if_cfr_periodic_peer_cfr_enable(struct wlan_objmgr_pdev *pdev,
+					   uint32_t param_value)
 {
 	struct pdev_params pparam;
 	uint32_t pdev_id;
@@ -142,12 +143,37 @@ int target_if_cfr_pdev_set_param(struct wlan_objmgr_pdev *pdev,
 		return -EINVAL;
 	}
 	qdf_mem_set(&pparam, sizeof(pparam), 0);
-	pparam.param_id = param_id;
+	pparam.param_id = wmi_pdev_param_per_peer_prd_cfr_enable;
 	pparam.param_value = param_value;
 
 	return wmi_unified_pdev_param_send(pdev_wmi_handle,
 					   &pparam, pdev_id);
 }
+#else
+int target_if_cfr_periodic_peer_cfr_enable(struct wlan_objmgr_pdev *pdev,
+					   uint32_t param_value)
+{
+	struct pdev_params pparam;
+	uint32_t pdev_id;
+	struct wmi_unified *pdev_wmi_handle = NULL;
+
+	pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
+	if (pdev_id < 0)
+		return -EINVAL;
+
+	pdev_wmi_handle = lmac_get_pdev_wmi_handle(pdev);
+	if (!pdev_wmi_handle) {
+		cfr_err("pdev wmi handle NULL");
+		return -EINVAL;
+	}
+	qdf_mem_set(&pparam, sizeof(pparam), 0);
+	pparam.param_id = WMI_PDEV_PARAM_PER_PEER_PERIODIC_CFR_ENABLE;
+	pparam.param_value = param_value;
+
+	return wmi_unified_pdev_param_send(pdev_wmi_handle,
+					   &pparam, pdev_id);
+}
+#endif
 
 int target_if_cfr_enable_cfr_timer(struct wlan_objmgr_pdev *pdev,
 				   uint32_t cfr_timer)
@@ -162,18 +188,16 @@ int target_if_cfr_enable_cfr_timer(struct wlan_objmgr_pdev *pdev,
 	if (!cfr_timer) {
 	     /* disable periodic cfr capture */
 		retval =
-	target_if_cfr_pdev_set_param(pdev,
-				     wmi_pdev_param_per_peer_prd_cfr_enable,
-				     WMI_HOST_PEER_CFR_TIMER_DISABLE);
+	target_if_cfr_periodic_peer_cfr_enable(pdev,
+					       WMI_HOST_PEER_CFR_TIMER_DISABLE);
 
 		if (retval == QDF_STATUS_SUCCESS)
 			pa->cfr_timer_enable = 0;
 	} else {
 	    /* enable periodic cfr capture (default base timer is 10ms ) */
 		retval =
-	target_if_cfr_pdev_set_param(pdev,
-				     wmi_pdev_param_per_peer_prd_cfr_enable,
-				     WMI_HOST_PEER_CFR_TIMER_ENABLE);
+	target_if_cfr_periodic_peer_cfr_enable(pdev,
+					       WMI_HOST_PEER_CFR_TIMER_ENABLE);
 
 		if (retval == QDF_STATUS_SUCCESS)
 			pa->cfr_timer_enable = 1;