Răsfoiți Sursa

qcacmn: define hal tx and rx routines for qca6290 non 11ax

define the hal rx and tx functions
for non 11ax headers as it causes compilation failure

Change-Id: I0fda769fddcf8b54faa22ce55438e84c427a7a2e
Balamurugan Mahalingam 6 ani în urmă
părinte
comite
21b0086b02

+ 12 - 0
hal/wifi3.0/hal_api_mon.h

@@ -727,7 +727,19 @@ hal_rx_status_get_tlv_info(void *rx_tlv_hdr, struct hal_rx_ppdu_info *ppdu_info,
 
 			break;
 		case TARGET_TYPE_QCA6290:
+#if !defined(QCA_WIFI_QCA6290_11AX)
+			ppdu_info->rx_status.is_stbc =
+				HAL_RX_GET(vht_sig_a_info,
+					   VHT_SIG_A_INFO_0, STBC);
+			value =  HAL_RX_GET(vht_sig_a_info,
+					    VHT_SIG_A_INFO_0, N_STS);
+			if (ppdu_info->rx_status.is_stbc && (value > 0))
+				value = ((value + 1) >> 1) - 1;
+			ppdu_info->rx_status.nss =
+				((value & VHT_SIG_SU_NSS_MASK) + 1);
+#else
 			ppdu_info->rx_status.nss = 0;
+#endif
 			break;
 #ifdef QCA_WIFI_QCA6390
 		case TARGET_TYPE_QCA6390:

+ 40 - 1
hal/wifi3.0/qca6290/hal_6290_rx.h

@@ -46,6 +46,7 @@
 #include "hal_api_mon.h"
 #include "phyrx_other_receive_info_ru_details.h"
 
+#if defined(QCA_WIFI_QCA6290_11AX)
 #define HAL_RX_MSDU_START_MIMO_SS_BITMAP(_rx_msdu_start)\
 	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_msdu_start),\
 	RX_MSDU_START_5_MIMO_SS_BITMAP_OFFSET)),	\
@@ -71,6 +72,19 @@ hal_rx_msdu_start_nss_get_6290(uint8_t *buf)
 
 	return qdf_get_hweight8(mimo_ss_bitmap);
 }
+#else
+static uint32_t
+hal_rx_msdu_start_nss_get_6290(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_start *msdu_start =
+				&pkt_tlvs->msdu_start_tlv.rx_msdu_start;
+	uint32_t nss;
+
+	nss = HAL_RX_MSDU_START_NSS_GET(msdu_start);
+	return nss;
+}
+#endif
 
 /**
  * hal_rx_mon_hw_desc_get_mpdu_status_6290(): Retrieve MPDU status
@@ -103,7 +117,9 @@ static void hal_rx_mon_hw_desc_get_mpdu_status_6290(void *hw_desc_addr,
 
 	reg_value = HAL_RX_GET(rx_msdu_start, RX_MSDU_START_5, SGI);
 	rs->sgi = sgi_hw_to_cdp[reg_value];
-
+#if !defined(QCA_WIFI_QCA6290_11AX)
+	rs->nr_ant = HAL_RX_GET(rx_msdu_start, RX_MSDU_START_5, NSS);
+#endif
 	reg_value = HAL_RX_GET(rx_msdu_start, RX_MSDU_START_5, PKT_TYPE);
 	switch (reg_value) {
 	case HAL_RX_PKT_TYPE_11N:
@@ -134,6 +150,7 @@ static uint32_t hal_get_link_desc_size_6290(void)
 }
 
 
+#ifdef QCA_WIFI_QCA6290_11AX
 /*
  * hal_rx_get_tlv_6290(): API to get the tlv
  *
@@ -144,7 +161,14 @@ static uint8_t hal_rx_get_tlv_6290(void *rx_tlv)
 {
 	return HAL_RX_GET(rx_tlv, PHYRX_RSSI_LEGACY_0, RECEIVE_BANDWIDTH);
 }
+#else
+static uint8_t hal_rx_get_tlv_6290(void *rx_tlv)
+{
+	return HAL_RX_GET(rx_tlv, PHYRX_RSSI_LEGACY_35, RECEIVE_BANDWIDTH);
+}
+#endif
 
+#ifdef QCA_WIFI_QCA6290_11AX
 /**
  * hal_rx_proc_phyrx_other_receive_info_tlv_6290()
  *				    - process other receive info TLV
@@ -211,6 +235,13 @@ void hal_rx_proc_phyrx_other_receive_info_tlv_6290(void *rx_tlv_hdr,
 		break;
 	}
 }
+#else
+static
+void hal_rx_proc_phyrx_other_receive_info_tlv_6290(void *rx_tlv_hdr,
+						   void *ppdu_info_handle)
+{
+}
+#endif /* QCA_WIFI_QCA6290_11AX */
 
 /**
  * hal_rx_dump_msdu_start_tlv_6290() : dump RX msdu_start TLV in structured
@@ -254,6 +285,10 @@ static void hal_rx_dump_msdu_start_tlv_6290(void *msdustart,
 			"rate_mcs: %d "
 			"receive_bandwidth: %d "
 			"reception_type: %d "
+#if !defined(QCA_WIFI_QCA6290_11AX)
+			"toeplitz_hash: %d "
+			"nss: %d "
+#endif
 			"ppdu_start_timestamp: %d "
 			"sw_phy_meta_data: %d ",
 			msdu_start->rxpcu_mpdu_filter_in_category,
@@ -283,6 +318,10 @@ static void hal_rx_dump_msdu_start_tlv_6290(void *msdustart,
 			msdu_start->rate_mcs,
 			msdu_start->receive_bandwidth,
 			msdu_start->reception_type,
+#if !defined(QCA_WIFI_QCA6290_11AX)
+			msdu_start->toeplitz_hash,
+			msdu_start->nss,
+#endif
 			msdu_start->ppdu_start_timestamp,
 			msdu_start->sw_phy_meta_data);
 }

+ 96 - 0
hal/wifi3.0/qca6290/hal_6290_tx.h

@@ -47,6 +47,7 @@
  *
  * Return: void
  */
+#if defined(QCA_WIFI_QCA6290_11AX)
 static void hal_tx_desc_set_dscp_tid_table_id_6290(void *desc,
 						   uint8_t id)
 {
@@ -55,10 +56,24 @@ static void hal_tx_desc_set_dscp_tid_table_id_6290(void *desc,
 	HAL_TX_SM(TCL_DATA_CMD_5,
 		  DSCP_TID_TABLE_NUM, id);
 }
+#else
+#ifdef CONFIG_MCL
+static void hal_tx_desc_set_dscp_tid_table_id_6290(void *desc,
+						   uint8_t id)
+{
+	HAL_SET_FLD(desc, TCL_DATA_CMD_3,
+		    DSCP_TO_TID_PRIORITY_TABLE_ID) |=
+			HAL_TX_SM(TCL_DATA_CMD_3,
+				  DSCP_TO_TID_PRIORITY_TABLE_ID, id);
+}
+#endif
+#endif
+
 
 #define DSCP_TID_TABLE_SIZE 24
 #define NUM_WORDS_PER_DSCP_TID_TABLE (DSCP_TID_TABLE_SIZE / 4)
 
+#if defined(QCA_WIFI_QCA6290_11AX)
 /**
  * hal_tx_set_dscp_tid_map_6290() - Configure default DSCP to TID map table
  * @soc: HAL SoC context
@@ -126,7 +141,47 @@ static void hal_tx_set_dscp_tid_map_6290(void *hal_soc, uint8_t *map,
 
 	HAL_REG_WRITE(soc, cmn_reg_addr, regval);
 }
+#else
+static void hal_tx_set_dscp_tid_map_6290(void *hal_soc, uint8_t *map,
+					 uint8_t id)
+{
+	int i;
+	uint32_t addr;
+	uint32_t value;
+
+	struct hal_soc *soc = (struct hal_soc *)hal_soc;
+
+	if (id == HAL_TX_DSCP_TID_MAP_TABLE_DEFAULT) {
+		addr =
+			HWIO_TCL_R0_DSCP_TID1_MAP_0_ADDR(
+					SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET);
+	} else {
+		addr =
+			HWIO_TCL_R0_DSCP_TID2_MAP_0_ADDR(
+					SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET);
+	}
+
+	for (i = 0; i < 64; i += 10) {
+		value = (map[i] |
+			(map[i+1] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_1_SHFT) |
+			(map[i+2] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_2_SHFT) |
+			(map[i+3] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_3_SHFT) |
+			(map[i+4] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_4_SHFT) |
+			(map[i+5] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_5_SHFT) |
+			(map[i+6] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_6_SHFT) |
+			(map[i+7] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_7_SHFT) |
+			(map[i+8] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_8_SHFT) |
+			(map[i+9] << HWIO_TCL_R0_DSCP_TID1_MAP_0_DSCP_9_SHFT));
+
+		HAL_REG_WRITE(soc, addr,
+				(value & HWIO_TCL_R0_DSCP_TID1_MAP_1_RMSK));
+
+		addr += 4;
+	}
+}
+#endif
 
+#ifdef QCA_WIFI_QCA6290_11AX
 /**
  * hal_tx_update_dscp_tid_6290() - Update the dscp tid map table as updated
  *					by the user
@@ -159,7 +214,43 @@ static void hal_tx_update_dscp_tid_6290(void *hal_soc, uint8_t tid,
 
 	HAL_REG_WRITE(soc, addr, (regval & HWIO_TCL_R0_DSCP_TID_MAP_n_RMSK));
 }
+#else
+static void hal_tx_update_dscp_tid_6290(void *hal_soc, uint8_t tid,
+					uint8_t id, uint8_t dscp)
+{
+	int index;
+	uint32_t addr;
+	uint32_t value;
+	uint32_t regval;
+
+	struct hal_soc *soc = (struct hal_soc *)hal_soc;
+
+	if (id == HAL_TX_DSCP_TID_MAP_TABLE_DEFAULT)
+		addr =
+			HWIO_TCL_R0_DSCP_TID1_MAP_0_ADDR(
+					SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET);
+	else
+		addr =
+			HWIO_TCL_R0_DSCP_TID2_MAP_0_ADDR(
+					SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET);
 
+	index = dscp % HAL_TX_NUM_DSCP_PER_REGISTER;
+	addr += 4 * (dscp/HAL_TX_NUM_DSCP_PER_REGISTER);
+	value = tid << (HAL_TX_BITS_PER_TID * index);
+
+	/* Read back previous DSCP TID config and update
+	 * with new config.
+	 */
+	regval = HAL_REG_READ(soc, addr);
+	regval &= ~(HAL_TX_TID_BITS_MASK << (HAL_TX_BITS_PER_TID * index));
+	regval |= value;
+
+	HAL_REG_WRITE(soc, addr,
+			(regval & HWIO_TCL_R0_DSCP_TID1_MAP_1_RMSK));
+}
+#endif
+
+#ifdef QCA_WIFI_QCA6290_11AX
 /**
  * hal_tx_desc_set_lmac_id - Set the lmac_id value
  * @desc: Handle to Tx Descriptor
@@ -176,3 +267,8 @@ static void hal_tx_desc_set_lmac_id_6290(void *desc, uint8_t lmac_id)
 	HAL_SET_FLD(desc, TCL_DATA_CMD_4, LMAC_ID) |=
 		HAL_TX_SM(TCL_DATA_CMD_4, LMAC_ID, lmac_id);
 }
+#else
+static void hal_tx_desc_set_lmac_id_6290(void *desc, uint8_t lmac_id)
+{
+}
+#endif