Browse Source

qcacmn: DSCP-TID map change for second hardware

Change to added entries for 48 DSCP TID  map
for second version of hardware.

Change-Id: Ie4aa0e27616e2f03b012e19d025444c8c53fe341
CRs-Fixed: 2315305
Ruchi, Agrawal 6 years ago
parent
commit
fea1a84116
5 changed files with 31 additions and 11 deletions
  1. 25 9
      dp/wifi3.0/dp_main.c
  2. 1 1
      dp/wifi3.0/dp_tx.c
  3. 3 0
      dp/wifi3.0/dp_types.h
  4. 1 0
      hal/wifi3.0/hal_tx.h
  5. 1 1
      hal/wifi3.0/qca8074v2/hal_8074v2_tx.h

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

@@ -2623,14 +2623,21 @@ static inline void
 dp_dscp_tid_map_setup(struct dp_pdev *pdev)
 {
 	uint8_t map_id;
+	struct dp_soc *soc = pdev->soc;
+
+	if (!soc)
+		return;
+
 	for (map_id = 0; map_id < DP_MAX_TID_MAPS; map_id++) {
-		qdf_mem_copy(pdev->dscp_tid_map[map_id], default_dscp_tid_map,
-				sizeof(default_dscp_tid_map));
+		qdf_mem_copy(pdev->dscp_tid_map[map_id],
+			     default_dscp_tid_map,
+			     sizeof(default_dscp_tid_map));
 	}
-	for (map_id = 0; map_id < HAL_MAX_HW_DSCP_TID_MAPS; map_id++) {
-		hal_tx_set_dscp_tid_map(pdev->soc->hal_soc,
-				pdev->dscp_tid_map[map_id],
-				map_id);
+
+	for (map_id = 0; map_id < soc->num_hw_dscp_tid_map; map_id++) {
+		hal_tx_set_dscp_tid_map(soc->hal_soc,
+					default_dscp_tid_map,
+					map_id);
 	}
 }
 
@@ -7048,11 +7055,17 @@ static void dp_set_pdev_dscp_tid_map_wifi3(struct cdp_pdev *pdev_handle,
 {
 	uint8_t dscp;
 	struct dp_pdev *pdev = (struct dp_pdev *) pdev_handle;
+	struct dp_soc *soc = pdev->soc;
+
+	if (!soc)
+		return;
+
 	dscp = (tos >> DP_IP_DSCP_SHIFT) & DP_IP_DSCP_MASK;
 	pdev->dscp_tid_map[map_id][dscp] = tid;
-	if (map_id < HAL_MAX_HW_DSCP_TID_MAPS)
-		hal_tx_update_dscp_tid(pdev->soc->hal_soc, tid,
-			map_id, dscp);
+
+	if (map_id < soc->num_hw_dscp_tid_map)
+		hal_tx_update_dscp_tid(soc->hal_soc, tid,
+				       map_id, dscp);
 	return;
 }
 
@@ -8198,6 +8211,8 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
 	soc->hal_soc = hif_get_hal_handle(hif_handle);
 	soc->htt_handle = htt_soc_attach(soc, ctrl_psoc, htc_handle,
 		soc->hal_soc, qdf_osdev);
+	soc->num_hw_dscp_tid_map = HAL_MAX_HW_DSCP_TID_MAPS;
+
 	if (!soc->htt_handle) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
 			FL("HTT attach failed"));
@@ -8237,6 +8252,7 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
 		wlan_cfg_set_raw_mode_war(soc->wlan_cfg_ctx, false);
 		soc->hw_nac_monitor_support = 1;
 		soc->ast_override_support = 1;
+		soc->num_hw_dscp_tid_map = HAL_MAX_HW_DSCP_TID_V2_MAPS;
 		break;
 	default:
 		qdf_print("%s: Unknown tgt type %d\n", __func__, target_type);

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

@@ -1115,7 +1115,7 @@ static void dp_tx_classify_tid(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 
 	DP_TX_TID_OVERRIDE(msdu_info, nbuf);
 
-	if (vdev->dscp_tid_map_id <= 1)
+	if (pdev->soc && vdev->dscp_tid_map_id < pdev->soc->num_hw_dscp_tid_map)
 		return;
 
 	/* for mesh packets don't do any classification */

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

@@ -697,6 +697,9 @@ struct dp_soc {
 	/*ast override support in HW*/
 	bool ast_override_support;
 
+	/*number of hw dscp tid map*/
+	uint8_t num_hw_dscp_tid_map;
+
 	/* Link descriptor memory banks */
 	struct {
 		void *base_vaddr_unaligned;

+ 1 - 0
hal/wifi3.0/hal_tx.h

@@ -80,6 +80,7 @@ do {                                            \
 #define HAL_MAX_HW_DSCP_TID_MAPS 2
 #define HAL_MAX_HW_DSCP_TID_MAPS_11AX 32
 
+#define HAL_MAX_HW_DSCP_TID_V2_MAPS 48
 #define HTT_META_HEADER_LEN_BYTES 64
 #define HAL_TX_EXT_DESC_WITH_META_DATA \
 	(HTT_META_HEADER_LEN_BYTES + HAL_TX_EXTENSION_DESC_LEN_BYTES)

+ 1 - 1
hal/wifi3.0/qca8074v2/hal_8074v2_tx.h

@@ -68,7 +68,7 @@ static void hal_tx_set_dscp_tid_map_8074v2(void *hal_soc, uint8_t *map,
 
 	struct hal_soc *soc = (struct hal_soc *)hal_soc;
 
-	if (id >= HAL_MAX_HW_DSCP_TID_MAPS_11AX)
+	if (id >= HAL_MAX_HW_DSCP_TID_V2_MAPS)
 		return;
 
 	cmn_reg_addr = HWIO_TCL_R0_CONS_RING_CMN_CTRL_REG_ADDR(