瀏覽代碼

qcacmn: Add support to deregister CP callback

Currently, get_infra_cp_stats callback of
infra_cp_stats_req_context is not updated to
NULL after processing the command.

Deregister get_infra_cp_stats callback
function after processing CP stats command.

Change-Id: I916a9432acd7f97aabe0db8ea1cae4228362a8f1
CRs-Fixed: 3577645
Sheenam Monga 1 年之前
父節點
當前提交
024eb9d419

+ 19 - 0
umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c

@@ -425,6 +425,25 @@ wlan_cp_stats_infra_cp_register_resp_cb(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS
+wlan_cp_stats_infra_cp_deregister_resp_cb(struct wlan_objmgr_psoc *psoc)
+{
+	struct psoc_cp_stats *psoc_cp_stats_priv;
+
+	psoc_cp_stats_priv = wlan_cp_stats_get_psoc_stats_obj(psoc);
+	if (!psoc_cp_stats_priv) {
+		cp_stats_err("psoc cp stats object is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	wlan_cp_stats_psoc_obj_lock(psoc_cp_stats_priv);
+	if (psoc_cp_stats_priv->get_infra_cp_stats)
+		psoc_cp_stats_priv->get_infra_cp_stats = NULL;
+	wlan_cp_stats_psoc_obj_unlock(psoc_cp_stats_priv);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS
 wlan_cp_stats_infra_cp_get_context(struct wlan_objmgr_psoc *psoc,
 				   get_infra_cp_stats_cb *resp_cb,

+ 11 - 0
umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.h

@@ -139,6 +139,17 @@ QDF_STATUS
 wlan_cp_stats_infra_cp_register_resp_cb(struct wlan_objmgr_psoc *psoc,
 					struct infra_cp_stats_cmd_info *req);
 
+/**
+ * wlan_cp_stats_infra_cp_deregister_resp_cb() - Deregister the response callback
+ * and cookie in the psoc mc_stats object
+ * @psoc: pointer to psoc object
+ *
+ * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes on
+ * failure
+ */
+QDF_STATUS
+wlan_cp_stats_infra_cp_deregister_resp_cb(struct wlan_objmgr_psoc *psoc);
+
 /**
  * wlan_cp_stats_infra_cp_get_context() - get the context and callback
  * for sending response

+ 11 - 0
umac/cp_stats/dispatcher/inc/wlan_cp_stats_ucfg_api.h

@@ -44,6 +44,17 @@ QDF_STATUS
 ucfg_infra_cp_stats_register_resp_cb(struct wlan_objmgr_psoc *psoc,
 				     struct infra_cp_stats_cmd_info *req);
 
+/**
+ * ucfg_infra_cp_stats_deregister_resp_cb() - Deregister the response callback
+ * and cookie in the psoc mc_stats object
+ * @psoc: pointer to psoc object
+ *
+ * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes on
+ * failure
+ */
+QDF_STATUS
+ucfg_infra_cp_stats_deregister_resp_cb(struct wlan_objmgr_psoc *psoc);
+
 /**
  * ucfg_send_infra_cp_stats_request() - send a infra cp stats command
  * @vdev: pointer to vdev object

+ 6 - 0
umac/cp_stats/dispatcher/src/wlan_cp_stats_ucfg_api.c

@@ -35,6 +35,12 @@ ucfg_infra_cp_stats_register_resp_cb(struct wlan_objmgr_psoc *psoc,
 	return wlan_cp_stats_infra_cp_register_resp_cb(psoc, req);
 }
 
+QDF_STATUS
+ucfg_infra_cp_stats_deregister_resp_cb(struct wlan_objmgr_psoc *psoc)
+{
+	return wlan_cp_stats_infra_cp_deregister_resp_cb(psoc);
+}
+
 QDF_STATUS
 ucfg_send_infra_cp_stats_request(struct wlan_objmgr_vdev *vdev,
 				 struct infra_cp_stats_cmd_info *req)