|
@@ -14459,6 +14459,92 @@ fail1:
|
|
return QDF_STATUS_E_NOMEM;
|
|
return QDF_STATUS_E_NOMEM;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#ifndef WLAN_DP_DISABLE_TCL_CMD_CRED_SRNG
|
|
|
|
+static inline QDF_STATUS dp_soc_tcl_cmd_cred_srng_init(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+ QDF_STATUS status;
|
|
|
|
+
|
|
|
|
+ if (soc->init_tcl_cmd_cred_ring) {
|
|
|
|
+ status = dp_srng_init(soc, &soc->tcl_cmd_credit_ring,
|
|
|
|
+ TCL_CMD_CREDIT, 0, 0);
|
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
|
+ return status;
|
|
|
|
+
|
|
|
|
+ wlan_minidump_log(soc->tcl_cmd_credit_ring.base_vaddr_unaligned,
|
|
|
|
+ soc->tcl_cmd_credit_ring.alloc_size,
|
|
|
|
+ soc->ctrl_psoc,
|
|
|
|
+ WLAN_MD_DP_SRNG_TCL_CMD,
|
|
|
|
+ "wbm_desc_rel_ring");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void dp_soc_tcl_cmd_cred_srng_deinit(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+ if (soc->init_tcl_cmd_cred_ring) {
|
|
|
|
+ wlan_minidump_remove(soc->tcl_cmd_credit_ring.base_vaddr_unaligned,
|
|
|
|
+ soc->tcl_cmd_credit_ring.alloc_size,
|
|
|
|
+ soc->ctrl_psoc, WLAN_MD_DP_SRNG_TCL_CMD,
|
|
|
|
+ "wbm_desc_rel_ring");
|
|
|
|
+ dp_srng_deinit(soc, &soc->tcl_cmd_credit_ring,
|
|
|
|
+ TCL_CMD_CREDIT, 0);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline QDF_STATUS dp_soc_tcl_cmd_cred_srng_alloc(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+ struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx = soc->wlan_cfg_ctx;
|
|
|
|
+ uint32_t entries;
|
|
|
|
+ QDF_STATUS status;
|
|
|
|
+
|
|
|
|
+ entries = wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(soc_cfg_ctx);
|
|
|
|
+ if (soc->init_tcl_cmd_cred_ring) {
|
|
|
|
+ status = dp_srng_alloc(soc, &soc->tcl_cmd_credit_ring,
|
|
|
|
+ TCL_CMD_CREDIT, entries, 0);
|
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void dp_soc_tcl_cmd_cred_srng_free(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+ if (soc->init_tcl_cmd_cred_ring)
|
|
|
|
+ dp_srng_free(soc, &soc->tcl_cmd_credit_ring);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void dp_tx_init_cmd_credit_ring(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+ if (soc->init_tcl_cmd_cred_ring)
|
|
|
|
+ hal_tx_init_cmd_credit_ring(soc->hal_soc,
|
|
|
|
+ soc->tcl_cmd_credit_ring.hal_srng);
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+static inline QDF_STATUS dp_soc_tcl_cmd_cred_srng_init(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void dp_soc_tcl_cmd_cred_srng_deinit(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline QDF_STATUS dp_soc_tcl_cmd_cred_srng_alloc(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void dp_soc_tcl_cmd_cred_srng_free(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void dp_tx_init_cmd_credit_ring(struct dp_soc *soc)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* dp_soc_srng_deinit() - de-initialize soc srng rings
|
|
* dp_soc_srng_deinit() - de-initialize soc srng rings
|
|
* @soc: Datapath soc handle
|
|
* @soc: Datapath soc handle
|
|
@@ -14489,14 +14575,7 @@ static void dp_soc_srng_deinit(struct dp_soc *soc)
|
|
}
|
|
}
|
|
|
|
|
|
/* TCL command and status rings */
|
|
/* TCL command and status rings */
|
|
- if (soc->init_tcl_cmd_cred_ring) {
|
|
|
|
- wlan_minidump_remove(soc->tcl_cmd_credit_ring.base_vaddr_unaligned,
|
|
|
|
- soc->tcl_cmd_credit_ring.alloc_size,
|
|
|
|
- soc->ctrl_psoc, WLAN_MD_DP_SRNG_TCL_CMD,
|
|
|
|
- "wbm_desc_rel_ring");
|
|
|
|
- dp_srng_deinit(soc, &soc->tcl_cmd_credit_ring,
|
|
|
|
- TCL_CMD_CREDIT, 0);
|
|
|
|
- }
|
|
|
|
|
|
+ dp_soc_tcl_cmd_cred_srng_deinit(soc);
|
|
|
|
|
|
wlan_minidump_remove(soc->tcl_status_ring.base_vaddr_unaligned,
|
|
wlan_minidump_remove(soc->tcl_status_ring.base_vaddr_unaligned,
|
|
soc->tcl_status_ring.alloc_size,
|
|
soc->tcl_status_ring.alloc_size,
|
|
@@ -14581,19 +14660,10 @@ static QDF_STATUS dp_soc_srng_init(struct dp_soc *soc)
|
|
WLAN_MD_DP_SRNG_WBM_DESC_REL,
|
|
WLAN_MD_DP_SRNG_WBM_DESC_REL,
|
|
"wbm_desc_rel_ring");
|
|
"wbm_desc_rel_ring");
|
|
|
|
|
|
- if (soc->init_tcl_cmd_cred_ring) {
|
|
|
|
- /* TCL command and status rings */
|
|
|
|
- if (dp_srng_init(soc, &soc->tcl_cmd_credit_ring,
|
|
|
|
- TCL_CMD_CREDIT, 0, 0)) {
|
|
|
|
- dp_init_err("%pK: dp_srng_init failed for tcl_cmd_ring", soc);
|
|
|
|
- goto fail1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- wlan_minidump_log(soc->tcl_cmd_credit_ring.base_vaddr_unaligned,
|
|
|
|
- soc->tcl_cmd_credit_ring.alloc_size,
|
|
|
|
- soc->ctrl_psoc,
|
|
|
|
- WLAN_MD_DP_SRNG_TCL_CMD,
|
|
|
|
- "wbm_desc_rel_ring");
|
|
|
|
|
|
+ /* TCL command and status rings */
|
|
|
|
+ if (dp_soc_tcl_cmd_cred_srng_init(soc)) {
|
|
|
|
+ dp_init_err("%pK: dp_srng_init failed for tcl_cmd_ring", soc);
|
|
|
|
+ goto fail1;
|
|
}
|
|
}
|
|
|
|
|
|
if (dp_srng_init(soc, &soc->tcl_status_ring, TCL_STATUS, 0, 0)) {
|
|
if (dp_srng_init(soc, &soc->tcl_status_ring, TCL_STATUS, 0, 0)) {
|
|
@@ -14743,8 +14813,7 @@ static void dp_soc_srng_free(struct dp_soc *soc)
|
|
dp_ipa_free_alt_tx_ring(soc);
|
|
dp_ipa_free_alt_tx_ring(soc);
|
|
}
|
|
}
|
|
|
|
|
|
- if (soc->init_tcl_cmd_cred_ring)
|
|
|
|
- dp_srng_free(soc, &soc->tcl_cmd_credit_ring);
|
|
|
|
|
|
+ dp_soc_tcl_cmd_cred_srng_free(soc);
|
|
|
|
|
|
dp_srng_free(soc, &soc->tcl_status_ring);
|
|
dp_srng_free(soc, &soc->tcl_status_ring);
|
|
|
|
|
|
@@ -14785,14 +14854,10 @@ static QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc)
|
|
goto fail1;
|
|
goto fail1;
|
|
}
|
|
}
|
|
|
|
|
|
- entries = wlan_cfg_get_dp_soc_tcl_cmd_credit_ring_size(soc_cfg_ctx);
|
|
|
|
/* TCL command and status rings */
|
|
/* TCL command and status rings */
|
|
- if (soc->init_tcl_cmd_cred_ring) {
|
|
|
|
- if (dp_srng_alloc(soc, &soc->tcl_cmd_credit_ring,
|
|
|
|
- TCL_CMD_CREDIT, entries, 0)) {
|
|
|
|
- dp_init_err("%pK: dp_srng_alloc failed for tcl_cmd_ring", soc);
|
|
|
|
- goto fail1;
|
|
|
|
- }
|
|
|
|
|
|
+ if (dp_soc_tcl_cmd_cred_srng_alloc(soc)) {
|
|
|
|
+ dp_init_err("%pK: dp_srng_alloc failed for tcl_cmd_ring", soc);
|
|
|
|
+ goto fail1;
|
|
}
|
|
}
|
|
|
|
|
|
entries = wlan_cfg_get_dp_soc_tcl_status_ring_size(soc_cfg_ctx);
|
|
entries = wlan_cfg_get_dp_soc_tcl_status_ring_size(soc_cfg_ctx);
|
|
@@ -15165,9 +15230,7 @@ static QDF_STATUS dp_pdev_init(struct cdp_soc_t *txrx_soc,
|
|
* Initialize command/credit ring descriptor
|
|
* Initialize command/credit ring descriptor
|
|
* Command/CREDIT ring also used for sending DATA cmds
|
|
* Command/CREDIT ring also used for sending DATA cmds
|
|
*/
|
|
*/
|
|
- if (soc->init_tcl_cmd_cred_ring)
|
|
|
|
- hal_tx_init_cmd_credit_ring(soc->hal_soc,
|
|
|
|
- soc->tcl_cmd_credit_ring.hal_srng);
|
|
|
|
|
|
+ dp_tx_init_cmd_credit_ring(soc);
|
|
|
|
|
|
dp_tx_pdev_init(pdev);
|
|
dp_tx_pdev_init(pdev);
|
|
|
|
|