Преглед изворни кода

qcacmn: Add hal_rx_msdu_fse_metadata_get API

Implement hal_rx_msdu_fse_metadata API per
chipset as the macro to retrieve the fse_metadata
value is chipset dependent.

Change-Id: Iae7f532460b5203af2f95c504a6941c0b18b665e
CRs-Fixed: 2522133
Venkata Sharath Chandra Manchala пре 5 година
родитељ
комит
905312efaa

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

@@ -440,6 +440,7 @@ struct hal_hw_txrx_ops {
 	uint32_t (*hal_rx_msdu_flow_idx_get)(uint8_t *buf);
 	bool (*hal_rx_msdu_flow_idx_invalid)(uint8_t *buf);
 	bool (*hal_rx_msdu_flow_idx_timeout)(uint8_t *buf);
+	uint32_t (*hal_rx_msdu_fse_metadata_get)(uint8_t *buf);
 };
 
 /**

+ 5 - 12
hal/wifi3.0/hal_rx.h

@@ -3180,12 +3180,6 @@ bool HAL_IS_DECAP_FORMAT_RAW(hal_soc_handle_t hal_soc_hdl,
 }
 #endif
 
-#define HAL_RX_MSDU_END_FSE_METADATA_GET(_rx_msdu_end)  \
-		(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,  \
-		RX_MSDU_END_15_FSE_METADATA_OFFSET)),  \
-		RX_MSDU_END_15_FSE_METADATA_MASK,    \
-		RX_MSDU_END_15_FSE_METADATA_LSB))
-
 /**
  * hal_rx_msdu_fse_metadata_get: API to get FSE metadata
  * from rx_msdu_end TLV
@@ -3193,14 +3187,13 @@ bool HAL_IS_DECAP_FORMAT_RAW(hal_soc_handle_t hal_soc_hdl,
  *
  * Return: fse metadata value from MSDU END TLV
  */
-static inline uint32_t hal_rx_msdu_fse_metadata_get(uint8_t *buf)
+static inline uint32_t
+hal_rx_msdu_fse_metadata_get(hal_soc_handle_t hal_soc_hdl,
+			     uint8_t *buf)
 {
-	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
-	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
-	uint32_t fse_metadata;
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
 
-	fse_metadata = HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
-	return fse_metadata;
+	return hal_soc->ops->hal_rx_msdu_fse_metadata_get(buf);
 }
 
 /**

+ 16 - 0
hal/wifi3.0/qca6290/hal_6290.c

@@ -895,6 +895,21 @@ static bool hal_rx_msdu_flow_idx_timeout_6290(uint8_t *buf)
 	return HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
 }
 
+/**
+ * hal_rx_msdu_fse_metadata_get_6290: API to get FSE metadata
+ * from rx_msdu_end TLV
+ * @buf: pointer to the start of RX PKT TLV headers
+ *
+ * Return: fse metadata value from MSDU END TLV
+ */
+static uint32_t hal_rx_msdu_fse_metadata_get_6290(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+
+	return HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
+}
+
 struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -975,6 +990,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_rx_msdu_flow_idx_get_6290,
 	hal_rx_msdu_flow_idx_invalid_6290,
 	hal_rx_msdu_flow_idx_timeout_6290,
+	hal_rx_msdu_fse_metadata_get_6290,
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

+ 6 - 0
hal/wifi3.0/qca6290/hal_6290_rx.h

@@ -312,6 +312,12 @@ UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET))
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_MASK,    \
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_LSB))
 
+#define HAL_RX_MSDU_END_FSE_METADATA_GET(_rx_msdu_end)  \
+		(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,  \
+		RX_MSDU_END_15_FSE_METADATA_OFFSET)),  \
+		RX_MSDU_END_15_FSE_METADATA_MASK,    \
+		RX_MSDU_END_15_FSE_METADATA_LSB))
+
 #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),\

+ 16 - 0
hal/wifi3.0/qca6390/hal_6390.c

@@ -891,6 +891,21 @@ static bool hal_rx_msdu_flow_idx_timeout_6390(uint8_t *buf)
 	return HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
 }
 
+/**
+ * hal_rx_msdu_fse_metadata_get_6390: API to get FSE metadata
+ * from rx_msdu_end TLV
+ * @buf: pointer to the start of RX PKT TLV headers
+ *
+ * Return: fse metadata value from MSDU END TLV
+ */
+static uint32_t hal_rx_msdu_fse_metadata_get_6390(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+
+	return HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
+}
+
 struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -971,6 +986,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	hal_rx_msdu_flow_idx_get_6390,
 	hal_rx_msdu_flow_idx_invalid_6390,
 	hal_rx_msdu_flow_idx_timeout_6390,
+	hal_rx_msdu_fse_metadata_get_6390,
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

+ 6 - 0
hal/wifi3.0/qca6390/hal_6390_rx.h

@@ -317,6 +317,12 @@ UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET))
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_OFFSET)),  \
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_MASK,    \
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_LSB))
+
+#define HAL_RX_MSDU_END_FSE_METADATA_GET(_rx_msdu_end)  \
+		(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,  \
+		RX_MSDU_END_15_FSE_METADATA_OFFSET)),  \
+		RX_MSDU_END_15_FSE_METADATA_MASK,    \
+		RX_MSDU_END_15_FSE_METADATA_LSB))
 /*
  * hal_rx_msdu_start_nss_get_6390(): API to get the NSS
  * Interval from rx_msdu_start

+ 16 - 0
hal/wifi3.0/qca6490/hal_6490.c

@@ -765,6 +765,21 @@ static bool hal_rx_msdu_flow_idx_timeout_6490(uint8_t *buf)
 	return HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
 }
 
+/**
+ * hal_rx_msdu_fse_metadata_get_6490: API to get FSE metadata
+ * from rx_msdu_end TLV
+ * @buf: pointer to the start of RX PKT TLV headers
+ *
+ * Return: fse metadata value from MSDU END TLV
+ */
+static uint32_t hal_rx_msdu_fse_metadata_get_6490(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+
+	return HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
+}
+
 struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	/* tx */
 	hal_tx_desc_set_mesh_en_6490,
@@ -807,4 +822,5 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	hal_rx_msdu_flow_idx_get_6490,
 	hal_rx_msdu_flow_idx_invalid_6490,
 	hal_rx_msdu_flow_idx_timeout_6490,
+	hal_rx_msdu_fse_metadata_get_6490,
 };

+ 6 - 0
hal/wifi3.0/qca6490/hal_6490_rx.h

@@ -302,3 +302,9 @@ RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_RESERVED_0A_OFFSET))
 		RX_MSDU_END_10_FLOW_IDX_TIMEOUT_OFFSET)),  \
 		RX_MSDU_END_10_FLOW_IDX_TIMEOUT_MASK,    \
 		RX_MSDU_END_10_FLOW_IDX_TIMEOUT_LSB))
+
+#define HAL_RX_MSDU_END_FSE_METADATA_GET(_rx_msdu_end)  \
+		(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,  \
+		RX_MSDU_END_13_FSE_METADATA_OFFSET)),  \
+		RX_MSDU_END_13_FSE_METADATA_MASK,    \
+		RX_MSDU_END_13_FSE_METADATA_LSB))

+ 16 - 0
hal/wifi3.0/qca8074v1/hal_8074v1.c

@@ -891,6 +891,21 @@ static bool hal_rx_msdu_flow_idx_timeout_8074v1(uint8_t *buf)
 	return HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
 }
 
+/**
+ * hal_rx_msdu_fse_metadata_get_8074v1: API to get FSE metadata
+ * from rx_msdu_end TLV
+ * @buf: pointer to the start of RX PKT TLV headers
+ *
+ * Return: fse metadata value from MSDU END TLV
+ */
+static uint32_t hal_rx_msdu_fse_metadata_get_8074v1(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+
+	return HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
+}
+
 struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -972,6 +987,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_rx_msdu_flow_idx_get_8074v1,
 	hal_rx_msdu_flow_idx_invalid_8074v1,
 	hal_rx_msdu_flow_idx_timeout_8074v1,
+	hal_rx_msdu_fse_metadata_get_8074v1,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

+ 6 - 0
hal/wifi3.0/qca8074v1/hal_8074v1_rx.h

@@ -301,6 +301,12 @@ UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET))
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_MASK,    \
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_LSB))
 
+#define HAL_RX_MSDU_END_FSE_METADATA_GET(_rx_msdu_end)  \
+		(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,  \
+		RX_MSDU_END_15_FSE_METADATA_OFFSET)),  \
+		RX_MSDU_END_15_FSE_METADATA_MASK,    \
+		RX_MSDU_END_15_FSE_METADATA_LSB))
+
 /*
  * hal_rx_msdu_start_nss_get_8074(): API to get the NSS
  * Interval from rx_msdu_start

+ 16 - 0
hal/wifi3.0/qca8074v2/hal_8074v2.c

@@ -888,6 +888,21 @@ static bool hal_rx_msdu_flow_idx_timeout_8074v2(uint8_t *buf)
 	return HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
 }
 
+/**
+ * hal_rx_msdu_fse_metadata_get_8074v2: API to get FSE metadata
+ * from rx_msdu_end TLV
+ * @buf: pointer to the start of RX PKT TLV headers
+ *
+ * Return: fse metadata value from MSDU END TLV
+ */
+static uint32_t hal_rx_msdu_fse_metadata_get_8074v2(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+
+	return HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
+}
+
 struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -970,6 +985,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	hal_rx_msdu_flow_idx_get_8074v2,
 	hal_rx_msdu_flow_idx_invalid_8074v2,
 	hal_rx_msdu_flow_idx_timeout_8074v2,
+	hal_rx_msdu_fse_metadata_get_8074v2,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

+ 6 - 0
hal/wifi3.0/qca8074v2/hal_8074v2_rx.h

@@ -310,6 +310,12 @@ UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET))
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_MASK,    \
 		RX_MSDU_END_5_FLOW_IDX_TIMEOUT_LSB))
 
+#define HAL_RX_MSDU_END_FSE_METADATA_GET(_rx_msdu_end)  \
+		(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,  \
+		RX_MSDU_END_15_FSE_METADATA_OFFSET)),  \
+		RX_MSDU_END_15_FSE_METADATA_MASK,    \
+		RX_MSDU_END_15_FSE_METADATA_LSB))
+
 /*
  * hal_rx_msdu_start_nss_get_8074v2(): API to get the NSS
  * Interval from rx_msdu_start

+ 16 - 0
hal/wifi3.0/qcn9000/hal_9000.c

@@ -897,6 +897,21 @@ static bool hal_rx_msdu_flow_idx_timeout_9000(uint8_t *buf)
 	return HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
 }
 
+/**
+ * hal_rx_msdu_fse_metadata_get_9000: API to get FSE metadata
+ * from rx_msdu_end TLV
+ * @buf: pointer to the start of RX PKT TLV headers
+ *
+ * Return: fse metadata value from MSDU END TLV
+ */
+static uint32_t hal_rx_msdu_fse_metadata_get_9000(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+
+	return HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
+}
+
 struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -979,6 +994,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_rx_msdu_flow_idx_get_9000,
 	hal_rx_msdu_flow_idx_invalid_9000,
 	hal_rx_msdu_flow_idx_timeout_9000,
+	hal_rx_msdu_fse_metadata_get_9000,
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {