Explorar o código

qcacmn: Fix RBM id assignment for Rx buffers in Rhine

Currently RBM id is not assigned properly for RX buffers
in Rhine architecture. Fix this by assigning RBM id during
soc attach in Rhine.

Change-Id: I8f3a781bfaf81366417107f4bd3da61b142ca1e2
CRs-Fixed: 3573342
Karthik Kantamneni hai 1 ano
pai
achega
c88b38afa1
Modificáronse 3 ficheiros con 56 adicións e 44 borrados
  1. 32 44
      dp/wifi3.0/dp_rx.h
  2. 1 0
      dp/wifi3.0/rh/dp_rh.c
  3. 23 0
      hal/wifi3.0/rh/hal_rh_tx.h

+ 32 - 44
dp/wifi3.0/dp_rx.h

@@ -3088,6 +3088,38 @@ dp_rx_set_wbm_err_info_in_nbuf(struct dp_soc *soc,
 			       qdf_nbuf_t nbuf,
 			       union hal_wbm_err_info_u wbm_err);
 
+#if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
+static inline uint8_t
+dp_rx_get_defrag_bm_id(struct dp_soc *soc)
+{
+	return DP_DEFRAG_RBM(soc->wbm_sw0_bm_id);
+}
+
+static inline uint8_t
+dp_rx_get_rx_bm_id(struct dp_soc *soc)
+{
+	return DP_WBM2SW_RBM(soc->wbm_sw0_bm_id);
+}
+#else
+static inline uint8_t
+dp_rx_get_rx_bm_id(struct dp_soc *soc)
+{
+	struct wlan_cfg_dp_soc_ctxt *cfg_ctx = soc->wlan_cfg_ctx;
+	uint8_t wbm2_sw_rx_rel_ring_id;
+
+	wbm2_sw_rx_rel_ring_id = wlan_cfg_get_rx_rel_ring_id(cfg_ctx);
+
+	return HAL_RX_BUF_RBM_SW_BM(soc->wbm_sw0_bm_id,
+				    wbm2_sw_rx_rel_ring_id);
+}
+
+static inline uint8_t
+dp_rx_get_defrag_bm_id(struct dp_soc *soc)
+{
+	return dp_rx_get_rx_bm_id(soc);
+}
+#endif
+
 #ifndef WLAN_SOFTUMAC_SUPPORT /* WLAN_SOFTUMAC_SUPPORT */
 /**
  * dp_rx_dump_info_and_assert() - dump RX Ring info and Rx Desc info
@@ -3463,38 +3495,6 @@ dp_rx_mark_first_packet_after_wow_wakeup(struct dp_pdev *pdev,
 }
 #endif
 
-#if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
-static inline uint8_t
-dp_rx_get_defrag_bm_id(struct dp_soc *soc)
-{
-	return DP_DEFRAG_RBM(soc->wbm_sw0_bm_id);
-}
-
-static inline uint8_t
-dp_rx_get_rx_bm_id(struct dp_soc *soc)
-{
-	return DP_WBM2SW_RBM(soc->wbm_sw0_bm_id);
-}
-#else
-static inline uint8_t
-dp_rx_get_rx_bm_id(struct dp_soc *soc)
-{
-	struct wlan_cfg_dp_soc_ctxt *cfg_ctx = soc->wlan_cfg_ctx;
-	uint8_t wbm2_sw_rx_rel_ring_id;
-
-	wbm2_sw_rx_rel_ring_id = wlan_cfg_get_rx_rel_ring_id(cfg_ctx);
-
-	return HAL_RX_BUF_RBM_SW_BM(soc->wbm_sw0_bm_id,
-				    wbm2_sw_rx_rel_ring_id);
-}
-
-static inline uint8_t
-dp_rx_get_defrag_bm_id(struct dp_soc *soc)
-{
-	return dp_rx_get_rx_bm_id(soc);
-}
-#endif
-
 #else
 static inline QDF_STATUS
 dp_rx_link_desc_return_by_addr(struct dp_soc *soc,
@@ -3511,18 +3511,6 @@ static inline void dp_rx_wbm_sg_list_reset(struct dp_soc *soc)
 static inline void dp_rx_wbm_sg_list_deinit(struct dp_soc *soc)
 {
 }
-
-static inline uint8_t
-dp_rx_get_defrag_bm_id(struct dp_soc *soc)
-{
-	return 0;
-}
-
-static inline uint8_t
-dp_rx_get_rx_bm_id(struct dp_soc *soc)
-{
-	return 0;
-}
 #endif /* WLAN_SOFTUMAC_SUPPORT */
 
 #ifndef CONFIG_NBUF_AP_PLATFORM

+ 1 - 0
dp/wifi3.0/rh/dp_rh.c

@@ -260,6 +260,7 @@ qdf_size_t dp_mon_get_context_size_rh(enum dp_context_type context_type)
 static QDF_STATUS dp_soc_attach_rh(struct dp_soc *soc,
 				   struct cdp_soc_attach_params *params)
 {
+	soc->wbm_sw0_bm_id = hal_tx_get_wbm_sw0_bm_id();
 	return QDF_STATUS_SUCCESS;
 }
 

+ 23 - 0
hal/wifi3.0/rh/hal_rh_tx.h

@@ -20,6 +20,14 @@
 #ifndef _HAL_RH_TX_H_
 #define _HAL_RH_TX_H_
 
+enum hal_rh_tx_ret_buf_manager {
+	HAL_RH_WBM_SW0_BM_ID = 3,
+	HAL_RH_WBM_SW1_BM_ID = 4,
+	HAL_RH_WBM_SW2_BM_ID = 5,
+	HAL_RH_WBM_SW3_BM_ID = 6,
+	HAL_RH_WBM_SW4_BM_ID = 7,
+};
+
 /*---------------------------------------------------------------------------
  * Function declarations and documentation
  * ---------------------------------------------------------------------------
@@ -332,4 +340,19 @@ static inline void hal_tx_desc_sync(void *hal_tx_desc_cached,
 	qdf_mem_copy((hw_desc + sizeof(struct tlv_32_hdr)),
 		     hal_tx_desc_cached, HAL_TX_DESC_LEN_BYTES);
 }
+
+/*---------------------------------------------------------------------------
+ * WBM Descriptor accessor APIs for Tx completions
+ *---------------------------------------------------------------------------
+ */
+
+/**
+ * hal_tx_get_wbm_sw0_bm_id() - Get the BM ID for first tx completion ring
+ *
+ * Return: BM ID for first tx completion ring
+ */
+static inline uint32_t hal_tx_get_wbm_sw0_bm_id(void)
+{
+	return HAL_RH_WBM_SW0_BM_ID;
+}
 #endif /* _HAL_RH_TX_H_ */