Ver Fonte

qcacmn: Monitor mode ring process changes for WCN7850

In WCN7850, there is only one common RXDMA dst ring for
both the mac.

Add changes to process the common RXDMA dst ring for
status TLVs corresponding to either MAC monitor status
ring. Also use arch ops to get rx_desc from sw_cookie.

Change-Id: Ia2c004755bc4389b587d995286093a519b995cab
CRs-Fixed: 3084442
Rakesh Pillai há 3 anos atrás
pai
commit
0115477838

+ 2 - 3
dp/wifi3.0/dp_internal.h

@@ -998,9 +998,8 @@ struct dp_srng *dp_get_rxdma_ring(struct dp_pdev *pdev, int lmac_id)
  */
 #define DP_INVALID_LMAC_ID	(-1)
 #define DP_MON_INVALID_LMAC_ID	(-1)
-#define DP_MON_2G_LMAC_ID	1
-#define DP_MON_5G_LMAC_ID	0
-#define DP_MON_6G_LMAC_ID	0
+#define DP_MAC0_LMAC_ID	0
+#define DP_MAC1_LMAC_ID	1
 
 #ifdef FEATURE_TSO_STATS
 /**

+ 11 - 6
dp/wifi3.0/dp_main.c

@@ -9131,14 +9131,19 @@ static QDF_STATUS dp_set_pdev_param(struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
 	target_type = hal_get_target_type(soc->hal_soc);
 	switch (target_type) {
 	case TARGET_TYPE_QCA6750:
-		pdev->ch_band_lmac_id_mapping[REG_BAND_2G] = DP_MON_5G_LMAC_ID;
-		pdev->ch_band_lmac_id_mapping[REG_BAND_5G] = DP_MON_5G_LMAC_ID;
-		pdev->ch_band_lmac_id_mapping[REG_BAND_6G] = DP_MON_6G_LMAC_ID;
+		pdev->ch_band_lmac_id_mapping[REG_BAND_2G] = DP_MAC0_LMAC_ID;
+		pdev->ch_band_lmac_id_mapping[REG_BAND_5G] = DP_MAC0_LMAC_ID;
+		pdev->ch_band_lmac_id_mapping[REG_BAND_6G] = DP_MAC0_LMAC_ID;
+		break;
+	case TARGET_TYPE_WCN7850:
+		pdev->ch_band_lmac_id_mapping[REG_BAND_2G] = DP_MAC0_LMAC_ID;
+		pdev->ch_band_lmac_id_mapping[REG_BAND_5G] = DP_MAC0_LMAC_ID;
+		pdev->ch_band_lmac_id_mapping[REG_BAND_6G] = DP_MAC0_LMAC_ID;
 		break;
 	default:
-		pdev->ch_band_lmac_id_mapping[REG_BAND_2G] = DP_MON_2G_LMAC_ID;
-		pdev->ch_band_lmac_id_mapping[REG_BAND_5G] = DP_MON_5G_LMAC_ID;
-		pdev->ch_band_lmac_id_mapping[REG_BAND_6G] = DP_MON_6G_LMAC_ID;
+		pdev->ch_band_lmac_id_mapping[REG_BAND_2G] = DP_MAC1_LMAC_ID;
+		pdev->ch_band_lmac_id_mapping[REG_BAND_5G] = DP_MAC0_LMAC_ID;
+		pdev->ch_band_lmac_id_mapping[REG_BAND_6G] = DP_MAC0_LMAC_ID;
 		break;
 	}
 

+ 13 - 1
dp/wifi3.0/monitor/1.0/dp_rx_mon_1.0.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -850,6 +851,13 @@ QDF_STATUS dp_rx_monitor_link_desc_return(struct dp_pdev *pdev,
 				      bm_action);
 }
 
+static inline bool dp_is_rxdma_dst_ring_common(struct dp_pdev *pdev)
+{
+	struct dp_soc *soc = pdev->soc;
+
+	return (soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev == 1);
+}
+
 /**
  * dp_rxdma_get_mon_dst_ring() - Return the pointer to rxdma_err_dst_ring
  *					or mon_dst_ring based on the target
@@ -865,6 +873,10 @@ void *dp_rxdma_get_mon_dst_ring(struct dp_pdev *pdev,
 	if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
 		return pdev->soc->rxdma_mon_dst_ring[mac_for_pdev].hal_srng;
 
+	/* For targets with 1 RXDMA DST ring for both mac */
+	if (dp_is_rxdma_dst_ring_common(pdev))
+		return pdev->soc->rxdma_err_dst_ring[0].hal_srng;
+
 	return pdev->soc->rxdma_err_dst_ring[mac_for_pdev].hal_srng;
 }
 
@@ -901,7 +913,7 @@ struct dp_rx_desc *dp_rx_get_mon_desc(struct dp_soc *soc,
 	if (soc->wlan_cfg_ctx->rxdma1_enable)
 		return dp_rx_cookie_2_va_mon_buf(soc, cookie);
 
-	return dp_rx_cookie_2_va_rxdma_buf(soc, cookie);
+	return soc->arch_ops.dp_rx_desc_cookie_2_va(soc, cookie);
 }
 
 #ifdef QCA_MONITOR_PKT_SUPPORT

+ 3 - 1
dp/wifi3.0/monitor/1.0/dp_rx_mon_status_1.0.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -1155,7 +1156,8 @@ uint32_t dp_mon_drop_packets_for_mac(struct dp_pdev *pdev, uint32_t mac_id,
 	uint32_t work_done;
 
 	work_done = dp_mon_status_srng_drop_for_mac(pdev, mac_id, quota);
-	dp_mon_dest_srng_drop_for_mac(pdev, mac_id);
+	if (!dp_is_rxdma_dst_ring_common(pdev))
+		dp_mon_dest_srng_drop_for_mac(pdev, mac_id);
 
 	return work_done;
 }