Explorar el Código

qcacmn: Add CDP API to check if UMAC reset is in progress

Add CDP API to check if UMAC reset is in progress.

Change-Id: I9b5891f61278aa6be52ee2e8d5f9de3185d92eef
CRs-Fixed: 3475148
Shashikala Prabhu hace 2 años
padre
commit
65e8b2f3d8
Se han modificado 5 ficheros con 67 adiciones y 0 borrados
  1. 21 0
      dp/inc/cdp_txrx_ctrl.h
  2. 1 0
      dp/inc/cdp_txrx_ops.h
  3. 28 0
      dp/wifi3.0/be/mlo/dp_mlo.c
  4. 16 0
      dp/wifi3.0/dp_internal.h
  5. 1 0
      dp/wifi3.0/dp_main.c

+ 21 - 0
dp/inc/cdp_txrx_ctrl.h

@@ -1408,4 +1408,25 @@ QDF_STATUS cdp_txrx_get_pdev_phyrx_error_mask(ol_txrx_soc_handle soc,
 }
 #endif
 
+/**
+ * cdp_umac_reset_is_inprogress() - API to check if umac reset is in progress
+ * @soc: opaque soc handle
+ *
+ * Return: true if umac reset is in progress, else false.
+ */
+static inline bool
+cdp_umac_reset_is_inprogress(ol_txrx_soc_handle soc)
+{
+	if (!soc || !soc->ops) {
+		dp_cdp_debug("Invalid Instance:");
+		QDF_BUG(0);
+		return false;
+	}
+
+	if (!soc->ops->ctrl_ops ||
+	    !soc->ops->ctrl_ops->umac_reset_is_inprogress)
+		return false;
+
+	return soc->ops->ctrl_ops->umac_reset_is_inprogress(soc);
+}
 #endif /* _CDP_TXRX_CTRL_H_ */

+ 1 - 0
dp/inc/cdp_txrx_ops.h

@@ -953,6 +953,7 @@ struct cdp_ctrl_ops {
 						     uint32_t *mask,
 						     uint32_t *mask_cont);
 #endif
+	bool (*umac_reset_is_inprogress)(struct cdp_soc_t *psoc);
 };
 
 struct cdp_me_ops {

+ 28 - 0
dp/wifi3.0/be/mlo/dp_mlo.c

@@ -1589,4 +1589,32 @@ QDF_STATUS dp_mlo_umac_reset_stats_print(struct dp_soc *soc)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+bool dp_umac_reset_is_inprogress(struct cdp_soc_t *psoc)
+{
+	struct dp_soc_umac_reset_ctx *umac_reset_ctx;
+	struct dp_soc *soc = (struct dp_soc *)psoc;
+	struct dp_soc_mlo_umac_reset_ctx *grp_umac_reset_ctx;
+	struct dp_soc_be *be_soc = NULL;
+	struct dp_mlo_ctxt *mlo_ctx = NULL;
+
+	if (!soc) {
+		dp_umac_reset_err("DP SOC is null");
+		return false;
+	}
+
+	umac_reset_ctx = &soc->umac_reset_ctx;
+
+	be_soc = dp_get_be_soc_from_dp_soc(soc);
+	if (be_soc)
+		mlo_ctx = be_soc->ml_ctxt;
+
+	if (mlo_ctx) {
+		grp_umac_reset_ctx = &mlo_ctx->grp_umac_reset_ctx;
+		return grp_umac_reset_ctx->umac_reset_in_progress;
+	} else {
+		return (umac_reset_ctx->current_state !=
+				UMAC_RESET_STATE_WAIT_FOR_TRIGGER);
+	}
+}
 #endif

+ 16 - 0
dp/wifi3.0/dp_internal.h

@@ -2814,6 +2814,22 @@ QDF_STATUS dp_umac_reset_notify_asserted_soc(struct dp_soc *soc)
 }
 #endif
 
+#ifdef DP_UMAC_HW_RESET_SUPPORT
+/**
+ * dp_umac_reset_is_inprogress() - Check if umac reset is in progress
+ * @psoc: dp soc handle
+ *
+ * Return: true if umac reset is in progress, else false.
+ */
+bool dp_umac_reset_is_inprogress(struct cdp_soc_t *psoc);
+#else
+static inline
+bool dp_umac_reset_is_inprogress(struct cdp_soc_t *psoc)
+{
+	return false;
+}
+#endif
+
 #ifndef WLAN_SOFTUMAC_SUPPORT
 QDF_STATUS dp_reo_send_cmd(struct dp_soc *soc, enum hal_reo_cmd_type type,
 			   struct hal_reo_cmd_params *params,

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

@@ -10866,6 +10866,7 @@ static struct cdp_ctrl_ops dp_ops_ctrl = {
 	.txrx_get_pdev_phyrx_error_mask = dp_get_pdev_phyrx_error_mask,
 #endif
 	.txrx_peer_flush_frags = dp_peer_flush_frags,
+	.umac_reset_is_inprogress = dp_umac_reset_is_inprogress,
 };
 
 static struct cdp_me_ops dp_ops_me = {