Browse Source

qcacmn: Add hal_rx_msdu_end_da_is_valid_get API

Implement hal_rx_msdu_end_dat API based on
the chipset as the macro to retrieve da_is_valid
value is chipset dependent.

Change-Id: I79f06eaa2576e7516c21f963b2c149aac7f62c64
CRs-Fixed: 2522133
Venkata Sharath Chandra Manchala 5 years ago
parent
commit
79055387d9

+ 3 - 1
dp/wifi3.0/dp_rx.c

@@ -2028,7 +2028,9 @@ done:
 			is_sa_vld =
 				hal_rx_msdu_end_sa_is_valid_get(soc->hal_soc,
 								rx_tlv_hdr);
-			is_da_vld = hal_rx_msdu_end_da_is_valid_get(rx_tlv_hdr);
+			is_da_vld =
+				hal_rx_msdu_end_da_is_valid_get(soc->hal_soc,
+								rx_tlv_hdr);
 
 			qdf_nbuf_set_da_mcbc(nbuf, is_mcbc);
 			qdf_nbuf_set_da_valid(nbuf, is_da_vld);

+ 2 - 1
dp/wifi3.0/dp_rx_err.c

@@ -704,7 +704,8 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, qdf_nbuf_t nbuf,
 	qdf_nbuf_set_da_mcbc(nbuf, hal_rx_msdu_end_da_is_mcbc_get(soc->hal_soc,
 								  rx_tlv_hdr));
 	qdf_nbuf_set_da_valid(nbuf,
-			      hal_rx_msdu_end_da_is_valid_get(rx_tlv_hdr));
+			      hal_rx_msdu_end_da_is_valid_get(soc->hal_soc,
+							      rx_tlv_hdr));
 	qdf_nbuf_set_sa_valid(nbuf,
 			      hal_rx_msdu_end_sa_is_valid_get(soc->hal_soc,
 							      rx_tlv_hdr));

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

@@ -389,6 +389,7 @@ struct hal_hw_txrx_ops {
 	uint32_t (*hal_rx_encryption_info_valid)(uint8_t *buf);
 	void (*hal_rx_print_pn)(uint8_t *buf);
 	uint8_t (*hal_rx_msdu_end_first_msdu_get)(uint8_t *buf);
+	uint8_t (*hal_rx_msdu_end_da_is_valid_get)(uint8_t *buf);
 };
 
 /**

+ 7 - 15
hal/wifi3.0/hal_rx.h

@@ -1761,29 +1761,21 @@ hal_rx_msdu_end_da_idx_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 	return hal_soc->ops->hal_rx_msdu_end_da_idx_get(buf);
 }
 
-#define HAL_RX_MSDU_END_DA_IS_VALID_GET(_rx_msdu_end)	\
-	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
-		RX_MSDU_END_5_DA_IS_VALID_OFFSET)),	\
-		RX_MSDU_END_5_DA_IS_VALID_MASK,		\
-		RX_MSDU_END_5_DA_IS_VALID_LSB))
-
- /**
+/**
  * hal_rx_msdu_end_da_is_valid_get: API to check if da is valid
  * from rx_msdu_end TLV
- *
+ * @hal_soc_hdl: hal soc handle
  * @ buf: pointer to the start of RX PKT TLV headers
+ *
  * Return: da_is_valid
  */
 static inline uint8_t
-hal_rx_msdu_end_da_is_valid_get(uint8_t *buf)
+hal_rx_msdu_end_da_is_valid_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;
-	uint8_t da_is_valid;
-
-	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
 
-	return da_is_valid;
+	return hal_soc->ops->hal_rx_msdu_end_da_is_valid_get(buf);
 }
 
 /**

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

@@ -273,6 +273,24 @@ hal_rx_msdu_end_first_msdu_get_6290(uint8_t *buf)
 	return first_msdu;
 }
 
+/**
+ * hal_rx_msdu_end_da_is_valid_get_6290: API to check if da is valid
+ * from rx_msdu_end TLV
+ *
+ * @ buf: pointer to the start of RX PKT TLV headers
+ * Return: da_is_valid
+ */
+static uint8_t hal_rx_msdu_end_da_is_valid_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;
+	uint8_t da_is_valid;
+
+	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
+
+	return da_is_valid;
+}
+
 struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -323,6 +341,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_rx_encryption_info_valid_6290,
 	hal_rx_print_pn_6290,
 	hal_rx_msdu_end_first_msdu_get_6290,
+	hal_rx_msdu_end_da_is_valid_get_6290,
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

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

@@ -101,6 +101,12 @@
 		RX_MSDU_END_5_FIRST_MSDU_MASK,		\
 		RX_MSDU_END_5_FIRST_MSDU_LSB))
 
+#define HAL_RX_MSDU_END_DA_IS_VALID_GET(_rx_msdu_end)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
+		RX_MSDU_END_5_DA_IS_VALID_OFFSET)),	\
+		RX_MSDU_END_5_DA_IS_VALID_MASK,		\
+		RX_MSDU_END_5_DA_IS_VALID_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),\

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

@@ -272,6 +272,24 @@ static uint8_t hal_rx_msdu_end_first_msdu_get_6390(uint8_t *buf)
 	return first_msdu;
 }
 
+/**
+ * hal_rx_msdu_end_da_is_valid_get_6390: API to check if da is valid
+ * from rx_msdu_end TLV
+ *
+ * @ buf: pointer to the start of RX PKT TLV headers
+ * Return: da_is_valid
+ */
+static uint8_t hal_rx_msdu_end_da_is_valid_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;
+	uint8_t da_is_valid;
+
+	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
+
+	return da_is_valid;
+}
+
 struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -322,6 +340,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	hal_rx_encryption_info_valid_6390,
 	hal_rx_print_pn_6390,
 	hal_rx_msdu_end_first_msdu_get_6390,
+	hal_rx_msdu_end_da_is_valid_get_6390,
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

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

@@ -101,6 +101,12 @@
 		RX_MSDU_END_5_FIRST_MSDU_MASK,		\
 		RX_MSDU_END_5_FIRST_MSDU_LSB))
 
+#define HAL_RX_MSDU_END_DA_IS_VALID_GET(_rx_msdu_end)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
+		RX_MSDU_END_5_DA_IS_VALID_OFFSET)),	\
+		RX_MSDU_END_5_DA_IS_VALID_MASK,		\
+		RX_MSDU_END_5_DA_IS_VALID_LSB))
+
 #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)),	\

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

@@ -178,6 +178,24 @@ static uint8_t hal_rx_msdu_end_first_msdu_get_6490(uint8_t *buf)
 	return first_msdu;
 }
 
+/**
+ * hal_rx_msdu_end_da_is_valid_get_6490: API to check if da is valid
+ * from rx_msdu_end TLV
+ *
+ * @ buf: pointer to the start of RX PKT TLV headers
+ * Return: da_is_valid
+ */
+static uint8_t hal_rx_msdu_end_da_is_valid_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;
+	uint8_t da_is_valid;
+
+	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
+
+	return da_is_valid;
+}
+
 struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	/* rx */
 	hal_rx_get_rx_fragment_number_6490,
@@ -188,4 +206,5 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	hal_rx_encryption_info_valid_6490,
 	hal_rx_print_pn_6490,
 	hal_rx_msdu_end_first_msdu_get_6490,
+	hal_rx_msdu_end_da_is_valid_get_6490,
 };

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

@@ -81,3 +81,9 @@
 		RX_MSDU_END_10_FIRST_MSDU_OFFSET)),	\
 		RX_MSDU_END_10_FIRST_MSDU_MASK,		\
 		RX_MSDU_END_10_FIRST_MSDU_LSB))
+
+#define HAL_RX_MSDU_END_DA_IS_VALID_GET(_rx_msdu_end)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
+		RX_MSDU_END_10_DA_IS_VALID_OFFSET)),	\
+		RX_MSDU_END_10_DA_IS_VALID_MASK,		\
+		RX_MSDU_END_10_DA_IS_VALID_LSB))

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

@@ -267,6 +267,25 @@ hal_rx_msdu_end_first_msdu_get_8074v1(uint8_t *buf)
 
 	return first_msdu;
 }
+
+/**
+ * hal_rx_msdu_end_da_is_valid_get_8074v1: API to check if da is valid
+ * from rx_msdu_end TLV
+ *
+ * @ buf: pointer to the start of RX PKT TLV headers
+ * Return: da_is_valid
+ */
+static uint8_t hal_rx_msdu_end_da_is_valid_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;
+	uint8_t da_is_valid;
+
+	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
+
+	return da_is_valid;
+}
+
 struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -318,6 +337,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_rx_encryption_info_valid_8074v1,
 	hal_rx_print_pn_8074v1,
 	hal_rx_msdu_end_first_msdu_get_8074v1,
+	hal_rx_msdu_end_da_is_valid_get_8074v1,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

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

@@ -90,6 +90,12 @@
 		RX_MSDU_END_5_FIRST_MSDU_MASK,		\
 		RX_MSDU_END_5_FIRST_MSDU_LSB))
 
+#define HAL_RX_MSDU_END_DA_IS_VALID_GET(_rx_msdu_end)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
+		RX_MSDU_END_5_DA_IS_VALID_OFFSET)),	\
+		RX_MSDU_END_5_DA_IS_VALID_MASK,		\
+		RX_MSDU_END_5_DA_IS_VALID_LSB))
+
 /*
  * hal_rx_msdu_start_nss_get_8074(): API to get the NSS
  * Interval from rx_msdu_start

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

@@ -267,6 +267,24 @@ static uint8_t hal_rx_msdu_end_first_msdu_get_8074v2(uint8_t *buf)
 	return first_msdu;
 }
 
+/**
+ * hal_rx_msdu_end_da_is_valid_get_8074v2: API to check if da is valid
+ * from rx_msdu_end TLV
+ *
+ * @ buf: pointer to the start of RX PKT TLV headers
+ * Return: da_is_valid
+ */
+static uint8_t hal_rx_msdu_end_da_is_valid_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;
+	uint8_t da_is_valid;
+
+	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
+
+	return da_is_valid;
+}
+
 struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -318,6 +336,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	hal_rx_encryption_info_valid_8074v2,
 	hal_rx_print_pn_8074v2,
 	hal_rx_msdu_end_first_msdu_get_8074v2,
+	hal_rx_msdu_end_da_is_valid_get_8074v2,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

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

@@ -98,6 +98,12 @@
 	RX_MSDU_START_5_MIMO_SS_BITMAP_OFFSET)),	\
 	RX_MSDU_START_5_MIMO_SS_BITMAP_MASK,		\
 	RX_MSDU_START_5_MIMO_SS_BITMAP_LSB))
+
+#define HAL_RX_MSDU_END_DA_IS_VALID_GET(_rx_msdu_end)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
+		RX_MSDU_END_5_DA_IS_VALID_OFFSET)),	\
+		RX_MSDU_END_5_DA_IS_VALID_MASK,		\
+		RX_MSDU_END_5_DA_IS_VALID_LSB))
 /*
  * hal_rx_msdu_start_nss_get_8074v2(): API to get the NSS
  * Interval from rx_msdu_start

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

@@ -276,6 +276,24 @@ static uint8_t hal_rx_msdu_end_first_msdu_get_9000(uint8_t *buf)
 	return first_msdu;
 }
 
+/**
+ * hal_rx_msdu_end_da_is_valid_get_9000: API to check if da is valid
+ * from rx_msdu_end TLV
+ *
+ * @ buf: pointer to the start of RX PKT TLV headers
+ * Return: da_is_valid
+ */
+static uint8_t hal_rx_msdu_end_da_is_valid_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;
+	uint8_t da_is_valid;
+
+	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
+
+	return da_is_valid;
+}
+
 struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -327,6 +345,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_rx_encryption_info_valid_9000,
 	hal_rx_print_pn_9000,
 	hal_rx_msdu_end_first_msdu_get_9000,
+	hal_rx_msdu_end_da_is_valid_get_9000,
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {