Ver código fonte

qcacmn: Dual radio mode with 5g NSS offloaded and 2g Non-Offloaded

Disable interrupt mask for rings used by NSS offloaded radios

Change-Id: I1491177c9faf242635a486b8cfffa2e849fe123e
CRs-Fixed: 2077274
Aniruddha Paul 7 anos atrás
pai
commit
0b1c4d22bb
5 arquivos alterados com 107 adições e 14 exclusões
  1. 103 9
      dp/wifi3.0/dp_main.c
  2. 1 1
      dp/wifi3.0/dp_tx.c
  3. 2 2
      dp/wifi3.0/dp_types.h
  4. 0 2
      wlan_cfg/wlan_cfg.c
  5. 1 0
      wlan_cfg/wlan_cfg.h

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

@@ -82,13 +82,34 @@ static uint8_t default_dscp_tid_map[DSCP_TID_MAP_MAX] = {
 	6, 6, 6, 6, 6, 6, 6, 6,
 };
 
+/**
+ * @brief Cpu ring map types
+ */
+enum dp_cpu_ring_map_types {
+	DP_DEFAULT_MAP,
+	DP_NSS_FIRST_RADIO_OFFLOADED_MAP,
+	DP_NSS_SECOND_RADIO_OFFLOADED_MAP,
+	DP_NSS_ALL_RADIO_OFFLOADED_MAP,
+	DP_CPU_RING_MAP_MAX
+};
+
+/**
+ * @brief Cpu to tx ring map
+ */
+static uint8_t dp_cpu_ring_map[DP_CPU_RING_MAP_MAX][WLAN_CFG_INT_NUM_CONTEXTS] = {
+	{0x0, 0x1, 0x2, 0x0},
+	{0x1, 0x2, 0x1, 0x2},
+	{0x0, 0x2, 0x0, 0x2},
+	{0x2, 0x2, 0x2, 0x2}
+};
+
 /**
  * @brief Select the type of statistics
  */
 enum dp_stats_type {
-	STATS_FW   = 0,
+	STATS_FW = 0,
 	STATS_HOST = 1,
-	STATS_TYPE_MAX  = 2,
+	STATS_TYPE_MAX = 2,
 };
 
 /**
@@ -979,6 +1000,38 @@ static void dp_soc_wds_detach(struct dp_soc *soc)
 }
 #endif
 
+/*
+ * dp_soc_reset_ring_map() - Reset cpu ring map
+ * @soc: Datapath soc handler
+ *
+ * This api resets the default cpu ring map
+ */
+
+static void dp_soc_reset_cpu_ring_map(struct dp_soc *soc)
+{
+	uint8_t i;
+	int nss_config = wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx);
+
+	for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
+		if (nss_config == 1) {
+			/*
+			 * Setting Tx ring map for one nss offloaded radio
+			 */
+			soc->tx_ring_map[i] = dp_cpu_ring_map[DP_NSS_FIRST_RADIO_OFFLOADED_MAP][i];
+		} else if (nss_config == 2) {
+			/*
+			 * Setting Tx ring for two nss offloaded radios
+			 */
+			soc->tx_ring_map[i] = dp_cpu_ring_map[DP_NSS_SECOND_RADIO_OFFLOADED_MAP][i];
+		} else {
+			/*
+			 * Setting Tx ring map for all nss offloaded radios
+			 */
+			soc->tx_ring_map[i] = dp_cpu_ring_map[DP_NSS_ALL_RADIO_OFFLOADED_MAP][i];
+		}
+	}
+}
+
 /*
  * dp_soc_cmn_setup() - Common SoC level initializion
  * @soc:		Datapath SOC handle
@@ -1139,6 +1192,11 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
 
 	dp_soc_wds_attach(soc);
 
+	/* Reset the cpu ring map if radio is NSS offloaded */
+	if (wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx)) {
+		dp_soc_reset_cpu_ring_map(soc);
+	}
+
 	/* Setup HW REO */
 	qdf_mem_zero(&reo_params, sizeof(reo_params));
 
@@ -1279,6 +1337,24 @@ dp_dscp_tid_map_setup(struct dp_pdev *pdev)
 	}
 }
 
+/*
+ * dp_reset_intr_mask() - reset interrupt mask
+ * @dp_soc - DP Soc handle
+ * @dp_pdev - DP pdev handle
+ *
+ * Return: Return void
+ */
+static inline
+void dp_soc_reset_intr_mask(struct dp_soc *soc, struct dp_pdev *pdev)
+{
+	/*
+	 * We will set the interrupt mask to zero for NSS offloaded radio
+	 */
+	wlan_cfg_set_tx_ring_mask(soc->wlan_cfg_ctx, pdev->pdev_id, 0x0);
+	wlan_cfg_set_rx_ring_mask(soc->wlan_cfg_ctx, pdev->pdev_id, 0x0);
+	wlan_cfg_set_rxdma2host_ring_mask(soc->wlan_cfg_ctx, pdev->pdev_id, 0x0);
+}
+
 /*
 * dp_pdev_attach_wifi3() - attach txrx pdev
 * @osif_pdev: Opaque PDEV handle from OSIF/HDD
@@ -1319,7 +1395,7 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
 	 * set nss pdev config based on soc config
 	 */
 	wlan_cfg_set_dp_pdev_nss_enabled(pdev->wlan_cfg_ctx,
-			(wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx) & (1 << pdev->pdev_id)));
+			(wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx) & (1 << pdev_id)));
 
 	pdev->soc = soc;
 	pdev->osif_pdev = ctrl_pdev;
@@ -1460,6 +1536,14 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
 
 	/* set the reo destination during initialization */
 	pdev->reo_dest = pdev->pdev_id + 1;
+
+	/*
+	 * reset the interrupt mask for offloaded radio
+	 */
+	if (wlan_cfg_get_dp_pdev_nss_enabled(pdev->wlan_cfg_ctx)) {
+		dp_soc_reset_intr_mask(soc, pdev);
+	}
+
 	return (struct cdp_pdev *)pdev;
 
 fail1:
@@ -1849,12 +1933,6 @@ static void dp_soc_set_nss_cfg_wifi3(struct cdp_soc_t *cdp_soc, int config)
 {
 	struct dp_soc *dsoc = (struct dp_soc *)cdp_soc;
 	wlan_cfg_set_dp_soc_nss_cfg(dsoc->wlan_cfg_ctx, config);
-	if (config) {
-		/*
-		 * disable dp interrupt if nss enabled
-		 */
-		wlan_cfg_set_num_contexts(dsoc->wlan_cfg_ctx, 0);
-	}
 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
 				FL("nss-wifi<0> nss config is enabled"));
 }
@@ -4284,6 +4362,20 @@ static struct cdp_ops dp_txrx_ops = {
 #endif
 };
 
+/*
+ * dp_soc_set_txrx_ring_map()
+ * @dp_soc: DP handler for soc
+ *
+ * Return: Void
+ */
+static void dp_soc_set_txrx_ring_map(struct dp_soc *soc)
+{
+	uint32_t i;
+	for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
+		soc->tx_ring_map[i] = dp_cpu_ring_map[DP_DEFAULT_MAP][i];
+	}
+}
+
 /*
  * dp_soc_attach_wifi3() - Attach txrx SOC
  * @osif_soc:		Opaque SOC handle from OSIF/HDD
@@ -4350,6 +4442,8 @@ void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle,
 	qdf_spinlock_create(&soc->reo_desc_freelist_lock);
 	qdf_list_create(&soc->reo_desc_freelist, REO_DESC_FREELIST_SIZE);
 
+	/* fill the tx/rx cpu ring map*/
+	dp_soc_set_txrx_ring_map(soc);
 	return (void *)soc;
 
 fail2:

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

@@ -42,7 +42,7 @@
 		#define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
 	#else
 		#define DP_TX_GET_DESC_POOL_ID(vdev) qdf_get_cpu()
-		#define DP_TX_GET_RING_ID(vdev) qdf_get_cpu()
+		#define DP_TX_GET_RING_ID(vdev) vdev->pdev->soc->tx_ring_map[qdf_get_cpu()]
 	#endif /* TX_PER_VDEV_DESC_POOL */
 #endif /* TX_PER_PDEV_DESC_POOL */
 

+ 2 - 2
dp/wifi3.0/dp_types.h

@@ -610,10 +610,10 @@ struct dp_soc {
 	struct dp_srng wbm_desc_rel_ring;
 
 	/* Tx ring map for interrupt processing */
-	struct dp_srng *tx_ring_map[DP_MAX_TX_RINGS];
+	uint8_t tx_ring_map[WLAN_CFG_INT_NUM_CONTEXTS];
 
 	/* Rx ring map for interrupt processing */
-	struct dp_srng *rx_ring_map[DP_MAX_RX_RINGS];
+	uint8_t rx_ring_map[WLAN_CFG_INT_NUM_CONTEXTS];
 
 	/* peer ID to peer object map (array of pointers to peer objects) */
 	struct dp_peer **peer_id_to_obj_map;

+ 0 - 2
wlan_cfg/wlan_cfg.c

@@ -95,8 +95,6 @@
  */
 #define NSS_TX_COMP_RING_SIZE (4 << 10)
 
-#define WLAN_CFG_INT_NUM_CONTEXTS 4
-
 #define RXDMA_BUF_RING_SIZE 2048
 #define RXDMA_MONITOR_BUF_RING_SIZE 2048
 #define RXDMA_MONITOR_DEST_RING_SIZE 2048

+ 1 - 0
wlan_cfg/wlan_cfg.h

@@ -52,6 +52,7 @@
 #define DP_MAX_TIDS 17
 #define DP_NON_QOS_TID 16
 
+#define WLAN_CFG_INT_NUM_CONTEXTS 4
 struct wlan_cfg_dp_pdev_ctxt;
 struct wlan_cfg_dp_soc_ctxt;