Jelajahi Sumber

qcacmn: Add CDP api support for umac reset init

Add CDP api support for umac reset init API, these apis are expected
to be called whenever shmem is deinitialized.

Change-Id: I307c586454580ab8f83b0d515defa93d4e8ff656
CRs-Fixed: 3458268
Surya Prakash Raajen 2 tahun lalu
induk
melakukan
74c7a8d542

+ 19 - 0
dp/inc/cdp_txrx_cmn.h

@@ -1844,6 +1844,25 @@ static inline void cdp_txrx_ppeds_stop(ol_txrx_soc_handle soc)
 	soc->ops->cmn_drv_ops->txrx_ppeds_stop(soc);
 }
 
+/**
+ * cdp_txrx_umac_reset_init(): De-initialize UMAC HW reset module
+ * @soc: soc handle
+ */
+static inline void cdp_txrx_umac_reset_init(ol_txrx_soc_handle soc)
+{
+	if (!soc || !soc->ops) {
+		dp_cdp_debug("Invalid Instance:");
+		QDF_BUG(0);
+		return;
+	}
+
+	if (!soc->ops->cmn_drv_ops ||
+	    !soc->ops->cmn_drv_ops->txrx_umac_reset_init)
+		return;
+
+	soc->ops->cmn_drv_ops->txrx_umac_reset_init(soc);
+}
+
 /**
  * cdp_txrx_umac_reset_deinit(): De-initialize UMAC HW reset module
  * @soc: soc handle

+ 1 - 0
dp/inc/cdp_txrx_ops.h

@@ -718,6 +718,7 @@ struct cdp_cmn_ops {
 					       bool mlo_peers_only);
 #endif
 	QDF_STATUS (*txrx_umac_reset_deinit)(ol_txrx_soc_handle soc);
+	QDF_STATUS (*txrx_umac_reset_init)(ol_txrx_soc_handle soc);
 	void (*txrx_get_tsf_time)(struct cdp_soc_t *soc_hdl, uint32_t tsf_id,
 				  uint32_t mac_id, uint64_t *tsf,
 				  uint64_t *tsf_sync_soc_time);

+ 2 - 1
dp/wifi3.0/dp_main.c

@@ -3363,7 +3363,7 @@ dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc)
 		return status;
 	}
 
-	status = dp_soc_umac_reset_init(soc);
+	status = dp_soc_umac_reset_init(cdp_soc);
 	if (status != QDF_STATUS_SUCCESS &&
 	    status != QDF_STATUS_E_NOSUPPORT) {
 		dp_err("Failed to initialize UMAC reset");
@@ -10385,6 +10385,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
 	.txrx_recovery_vdev_flush_peers = dp_recovery_vdev_flush_peers,
 #endif
 	.txrx_umac_reset_deinit = dp_soc_umac_reset_deinit,
+	.txrx_umac_reset_init = dp_soc_umac_reset_init,
 	.txrx_get_tsf_time = dp_get_tsf_time,
 	.txrx_get_tsf2_offset = dp_get_tsf2_scratch_reg,
 	.txrx_get_tqm_offset = dp_get_tqm_scratch_reg,

+ 2 - 1
dp/wifi3.0/dp_umac_reset.c

@@ -82,8 +82,9 @@ dp_umac_reset_send_setup_cmd(struct dp_soc *soc)
 	return dp_htt_umac_reset_send_setup_cmd(soc, &params);
 }
 
-QDF_STATUS dp_soc_umac_reset_init(struct dp_soc *soc)
+QDF_STATUS dp_soc_umac_reset_init(struct cdp_soc_t *txrx_soc)
 {
+	struct dp_soc *soc = (struct dp_soc *)txrx_soc;
 	struct dp_soc_umac_reset_ctx *umac_reset_ctx;
 	size_t alloc_size;
 	QDF_STATUS status;

+ 3 - 3
dp/wifi3.0/dp_umac_reset.h

@@ -228,11 +228,11 @@ struct dp_soc_umac_reset_ctx {
 
 /**
  * dp_soc_umac_reset_init() - Initialize UMAC reset context
- * @soc: DP soc object
+ * @txrx_soc: DP soc object
  *
  * Return: QDF status of operation
  */
-QDF_STATUS dp_soc_umac_reset_init(struct dp_soc *soc);
+QDF_STATUS dp_soc_umac_reset_init(struct cdp_soc_t *txrx_soc);
 
 /**
  * dp_soc_umac_reset_deinit() - De-initialize UMAC reset context
@@ -317,7 +317,7 @@ static inline bool dp_check_umac_reset_in_progress(struct dp_soc *soc)
 }
 
 static inline
-QDF_STATUS dp_soc_umac_reset_init(struct dp_soc *soc)
+QDF_STATUS dp_soc_umac_reset_init(struct cdp_soc_t *txrx_soc)
 {
 	return QDF_STATUS_SUCCESS;
 }