Browse Source

qcacmn: Initialize only 1 RXDMA DST ring for WCN7850

WCN7850 has only one RXDMA DST ring, as opposed to other
lithium family chipsets, which had 2 RXDMA DST ring.

Refactor the code to pick the number of rxdma destination
rings from CFG context.

Change-Id: I20d475c02690043e969bc7a78605809b8c6814ae
CRs-Fixed: 3084440
Rakesh Pillai 3 năm trước cách đây
mục cha
commit
63233c05dd
5 tập tin đã thay đổi với 27 bổ sung11 xóa
  1. 2 1
      dp/wifi3.0/dp_htt.c
  2. 21 9
      dp/wifi3.0/dp_main.c
  3. 2 1
      dp/wifi3.0/dp_stats.c
  4. 1 0
      wlan_cfg/wlan_cfg.c
  5. 1 0
      wlan_cfg/wlan_cfg.h

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

@@ -2380,6 +2380,7 @@ static void dp_queue_ring_stats(struct dp_pdev *pdev)
 	int mac_id;
 	int lmac_id;
 	uint32_t j = 0;
+	struct dp_soc *soc = pdev->soc;
 	struct dp_soc_srngs_state * soc_srngs_state = NULL;
 	struct dp_soc_srngs_state *drop_srngs_state = NULL;
 	QDF_STATUS status;
@@ -2544,7 +2545,7 @@ static void dp_queue_ring_stats(struct dp_pdev *pdev)
 			qdf_assert_always(++j < DP_MAX_SRNGS);
 	}
 
-	for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++)	{
+	for (i = 0; i < soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev; i++) {
 		lmac_id = dp_get_lmac_id_for_pdev_id(pdev->soc,
 						     i, pdev->pdev_id);
 

+ 21 - 9
dp/wifi3.0/dp_main.c

@@ -5643,6 +5643,16 @@ static void dp_soc_detach_wifi3(struct cdp_soc_t *txrx_soc)
  * Return: zero on success, non-zero on failure
  */
 #ifdef QCA_HOST2FW_RXBUF_RING
+static inline void
+dp_htt_setup_rxdma_err_dst_ring(struct dp_soc *soc, int mac_id,
+				int lmac_id)
+{
+	if (soc->rxdma_err_dst_ring[lmac_id].hal_srng)
+		htt_srng_setup(soc->htt_handle, mac_id,
+			       soc->rxdma_err_dst_ring[lmac_id].hal_srng,
+			       RXDMA_DST);
+}
+
 static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
 {
 	int i;
@@ -5716,11 +5726,8 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
 					 RXDMA_BUF);
 
 				if (!soc->rxdma2sw_rings_not_supported)
-					htt_srng_setup(soc->htt_handle,
-						       mac_for_pdev,
-						       soc->rxdma_err_dst_ring[lmac_id]
-						       .hal_srng,
-						       RXDMA_DST);
+					dp_htt_setup_rxdma_err_dst_ring(soc,
+						mac_for_pdev, lmac_id);
 
 				/* Configure monitor mode rings */
 				status = dp_monitor_htt_srng_setup(soc, pdev,
@@ -13491,7 +13498,8 @@ static void dp_pdev_srng_deinit(struct dp_pdev *pdev)
 			       pdev->lmac_id);
 
 	if (!soc->rxdma2sw_rings_not_supported) {
-		for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++) {
+		for (i = 0;
+		     i < soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev; i++) {
 			int lmac_id = dp_get_lmac_id_for_pdev_id(soc, i,
 								 pdev->pdev_id);
 
@@ -13541,7 +13549,8 @@ static QDF_STATUS dp_pdev_srng_init(struct dp_pdev *pdev)
 		pdev = soc->pdev_list[0];
 
 	if (!soc->rxdma2sw_rings_not_supported) {
-		for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++) {
+		for (i = 0;
+		     i < soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev; i++) {
 			int lmac_id = dp_get_lmac_id_for_pdev_id(soc, i,
 								 pdev->pdev_id);
 			struct dp_srng *srng =
@@ -13585,7 +13594,8 @@ static void dp_pdev_srng_free(struct dp_pdev *pdev)
 		dp_srng_free(soc, &soc->rx_refill_buf_ring[pdev->lmac_id]);
 
 	if (!soc->rxdma2sw_rings_not_supported) {
-		for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++) {
+		for (i = 0;
+		     i < soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev; i++) {
 			int lmac_id = dp_get_lmac_id_for_pdev_id(soc, i,
 								 pdev->pdev_id);
 
@@ -13628,7 +13638,8 @@ static QDF_STATUS dp_pdev_srng_alloc(struct dp_pdev *pdev)
 		pdev = soc->pdev_list[0];
 
 	if (!soc->rxdma2sw_rings_not_supported) {
-		for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++) {
+		for (i = 0;
+		     i < soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev; i++) {
 			int lmac_id = dp_get_lmac_id_for_pdev_id(soc, i,
 								 pdev->pdev_id);
 			struct dp_srng *srng =
@@ -14141,6 +14152,7 @@ static void dp_soc_cfg_init(struct dp_soc *soc)
 		}
 
 		soc->wlan_cfg_ctx->rxdma1_enable = 0;
+		soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev = 1;
 		break;
 	case TARGET_TYPE_QCA8074:
 		wlan_cfg_set_raw_mode_war(soc->wlan_cfg_ctx, true);

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

@@ -5293,6 +5293,7 @@ void dp_print_mon_ring_stat_from_hal(struct dp_pdev *pdev, uint8_t mac_id)
 void
 dp_print_ring_stats(struct dp_pdev *pdev)
 {
+	struct dp_soc *soc = pdev->soc;
 	uint32_t i;
 	int mac_id;
 	int lmac_id;
@@ -5372,7 +5373,7 @@ dp_print_ring_stats(struct dp_pdev *pdev)
 		dp_print_mon_ring_stat_from_hal(pdev, lmac_id);
 	}
 
-	for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++)	{
+	for (i = 0; i < soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev; i++) {
 		lmac_id = dp_get_lmac_id_for_pdev_id(pdev->soc,
 						     i, pdev->pdev_id);
 

+ 1 - 0
wlan_cfg/wlan_cfg.c

@@ -2002,6 +2002,7 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
 	wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) &
 						 PKT_CAPTURE_MODE_DATA_ONLY;
 #endif
+	wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev = NUM_RXDMA_RINGS_PER_PDEV;
 
 	return wlan_cfg_ctx;
 }

+ 1 - 0
wlan_cfg/wlan_cfg.h

@@ -404,6 +404,7 @@ struct wlan_cfg_dp_soc_ctxt {
 	bool vdev_stats_hw_offload_config;
 	int vdev_stats_hw_offload_timer;
 #endif
+	uint8_t num_rxdma_dst_rings_per_pdev;
 };
 
 /**