Explorar el Código

qcacmn: Add hal_rx_mpdu_get_fr_ds API

Implement hal_rx_mpdu_get_fr_ds API
based on the chipset as the macro to
retrieve for_ds value is chipset
dependent.

Change-Id: I6d41d02ac50cae752567d98645f0447cc122a84f
CRs-Fixed: 2522133
Venkata Sharath Chandra Manchala hace 5 años
padre
commit
1e3a479fdf

+ 4 - 2
dp/wifi3.0/dp_rx.c

@@ -612,7 +612,8 @@ QDF_STATUS dp_rx_filter_mesh_packets(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 
 	if (qdf_unlikely(vdev->mesh_rx_filter)) {
 		if (vdev->mesh_rx_filter & MESH_FILTER_OUT_FROMDS)
-			if (hal_rx_mpdu_get_fr_ds(rx_tlv_hdr))
+			if (hal_rx_mpdu_get_fr_ds(soc->hal_soc,
+						  rx_tlv_hdr))
 				return  QDF_STATUS_SUCCESS;
 
 		if (vdev->mesh_rx_filter & MESH_FILTER_OUT_TODS)
@@ -621,7 +622,8 @@ QDF_STATUS dp_rx_filter_mesh_packets(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 				return  QDF_STATUS_SUCCESS;
 
 		if (vdev->mesh_rx_filter & MESH_FILTER_OUT_NODS)
-			if (!hal_rx_mpdu_get_fr_ds(rx_tlv_hdr) &&
+			if (!hal_rx_mpdu_get_fr_ds(soc->hal_soc,
+						   rx_tlv_hdr) &&
 			    !hal_rx_mpdu_get_to_ds(soc->hal_soc,
 						   rx_tlv_hdr))
 				return  QDF_STATUS_SUCCESS;

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

@@ -532,7 +532,7 @@ static uint16_t dp_rx_defrag_hdrsize(struct dp_soc *soc, qdf_nbuf_t nbuf)
 	uint16_t frm_ctrl_field;
 
 	to_ds = hal_rx_mpdu_get_to_ds(soc->hal_soc, rx_tlv_hdr);
-	fr_ds = hal_rx_mpdu_get_fr_ds(rx_tlv_hdr);
+	fr_ds = hal_rx_mpdu_get_fr_ds(soc->hal_soc, rx_tlv_hdr);
 	frm_ctrl_valid = hal_rx_get_mpdu_frame_control_valid(rx_tlv_hdr);
 	frm_ctrl_field = hal_rx_get_frame_ctrl_field(rx_tlv_hdr);
 

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

@@ -394,6 +394,7 @@ struct hal_hw_txrx_ops {
 	bool (*hal_rx_get_mpdu_mac_ad4_valid)(uint8_t *buf);
 	uint32_t (*hal_rx_mpdu_start_sw_peer_id_get)(uint8_t *buf);
 	uint32_t (*hal_rx_mpdu_get_to_ds)(uint8_t *buf);
+	uint32_t (*hal_rx_mpdu_get_fr_ds)(uint8_t *buf);
 };
 
 /**

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

@@ -1491,33 +1491,21 @@ hal_rx_mpdu_get_to_ds(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 	return hal_soc->ops->hal_rx_mpdu_get_to_ds(buf);
 }
 
-#define HAL_RX_MPDU_GET_FROMDS(_rx_mpdu_info)	\
-	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
-		RX_MPDU_INFO_2_FR_DS_OFFSET)),	\
-		RX_MPDU_INFO_2_FR_DS_MASK,	\
-		RX_MPDU_INFO_2_FR_DS_LSB))
 
 /*
  * hal_rx_mpdu_get_fr_ds(): API to get the from ds info
  * from rx_mpdu_start
- *
+ * @hal_soc_hdl: hal soc handle
  * @buf: pointer to the start of RX PKT TLV header
+ *
  * Return: uint32_t(fr_ds)
  */
-
 static inline uint32_t
-hal_rx_mpdu_get_fr_ds(uint8_t *buf)
+hal_rx_mpdu_get_fr_ds(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 {
-	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
-	struct rx_mpdu_start *mpdu_start =
-				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
-
-	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
-	uint32_t fr_ds;
-
-	fr_ds = HAL_RX_MPDU_GET_FROMDS(mpdu_info);
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
 
-	return fr_ds;
+	return hal_soc->ops->hal_rx_mpdu_get_fr_ds(buf);
 }
 
 #define HAL_RX_MPDU_MAC_ADDR_AD1_VALID_GET(_rx_mpdu_info) \

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

@@ -360,6 +360,24 @@ static uint32_t hal_rx_mpdu_get_to_ds_6290(uint8_t *buf)
 
 	return HAL_RX_MPDU_GET_TODS(mpdu_info);
 }
+
+/*
+ * hal_rx_mpdu_get_fr_ds_6290(): API to get the from ds info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(fr_ds)
+ */
+static uint32_t hal_rx_mpdu_get_fr_ds_6290(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_mpdu_start *mpdu_start =
+				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
+
+	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
+
+	return HAL_RX_MPDU_GET_FROMDS(mpdu_info);
+}
 struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -415,6 +433,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_mac_ad4_valid_6290,
 	hal_rx_mpdu_start_sw_peer_id_get_6290,
 	hal_rx_mpdu_get_to_ds_6290,
+	hal_rx_mpdu_get_fr_ds_6290,
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

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

@@ -131,6 +131,12 @@
 		RX_MPDU_INFO_2_TO_DS_MASK,	\
 		RX_MPDU_INFO_2_TO_DS_LSB))
 
+#define HAL_RX_MPDU_GET_FROMDS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_2_FR_DS_OFFSET)),	\
+		RX_MPDU_INFO_2_FR_DS_MASK,	\
+		RX_MPDU_INFO_2_FR_DS_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),\

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

@@ -358,6 +358,25 @@ static uint32_t hal_rx_mpdu_get_to_ds_6390(uint8_t *buf)
 
 	return HAL_RX_MPDU_GET_TODS(mpdu_info);
 }
+
+/*
+ * hal_rx_mpdu_get_fr_ds_6390(): API to get the from ds info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(fr_ds)
+ */
+static uint32_t hal_rx_mpdu_get_fr_ds_6390(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_mpdu_start *mpdu_start =
+				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
+
+	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
+
+	return HAL_RX_MPDU_GET_FROMDS(mpdu_info);
+}
+
 struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -413,6 +432,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_mac_ad4_valid_6390,
 	hal_rx_mpdu_start_sw_peer_id_get_6390,
 	hal_rx_mpdu_get_to_ds_6390,
+	hal_rx_mpdu_get_fr_ds_6390,
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

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

@@ -131,6 +131,12 @@
 		RX_MPDU_INFO_2_TO_DS_MASK,	\
 		RX_MPDU_INFO_2_TO_DS_LSB))
 
+#define HAL_RX_MPDU_GET_FROMDS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_2_FR_DS_OFFSET)),	\
+		RX_MPDU_INFO_2_FR_DS_MASK,	\
+		RX_MPDU_INFO_2_FR_DS_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

@@ -265,6 +265,24 @@ static uint32_t hal_rx_mpdu_get_to_ds_6490(uint8_t *buf)
 	return HAL_RX_MPDU_GET_TODS(mpdu_info);
 }
 
+/*
+ * hal_rx_mpdu_get_fr_ds_6490(): API to get the from ds info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(fr_ds)
+ */
+static uint32_t hal_rx_mpdu_get_fr_ds_6490(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_mpdu_start *mpdu_start =
+				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
+
+	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
+
+	return HAL_RX_MPDU_GET_FROMDS(mpdu_info);
+}
+
 struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	/* rx */
 	hal_rx_get_rx_fragment_number_6490,
@@ -280,4 +298,5 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_mac_ad4_valid_6490,
 	hal_rx_mpdu_start_sw_peer_id_get_6490,
 	hal_rx_mpdu_get_to_ds_6490,
+	hal_rx_mpdu_get_fr_ds_6490,
 };

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

@@ -111,3 +111,9 @@
 		RX_MPDU_INFO_11_TO_DS_OFFSET)),	\
 		RX_MPDU_INFO_11_TO_DS_MASK,	\
 		RX_MPDU_INFO_11_TO_DS_LSB))
+
+#define HAL_RX_MPDU_GET_FROMDS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_11_FR_DS_OFFSET)),	\
+		RX_MPDU_INFO_11_FR_DS_MASK,	\
+		RX_MPDU_INFO_11_FR_DS_LSB))

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

@@ -356,6 +356,23 @@ static uint32_t hal_rx_mpdu_get_to_ds_8074v1(uint8_t *buf)
 	return HAL_RX_MPDU_GET_TODS(mpdu_info);
 }
 
+/*
+ * hal_rx_mpdu_get_fr_ds_8074v1(): API to get the from ds info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(fr_ds)
+ */
+static uint32_t hal_rx_mpdu_get_fr_ds_8074v1(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_mpdu_start *mpdu_start =
+				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
+
+	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
+
+	return HAL_RX_MPDU_GET_FROMDS(mpdu_info);
+}
 struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -412,6 +429,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_mac_ad4_valid_8074v1,
 	hal_rx_mpdu_start_sw_peer_id_get_8074v1,
 	hal_rx_mpdu_get_to_ds_8074v1,
+	hal_rx_mpdu_get_fr_ds_8074v1,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

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

@@ -119,6 +119,12 @@
 		RX_MPDU_INFO_2_TO_DS_OFFSET)),	\
 		RX_MPDU_INFO_2_TO_DS_MASK,	\
 		RX_MPDU_INFO_2_TO_DS_LSB))
+
+#define HAL_RX_MPDU_GET_FROMDS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_2_FR_DS_OFFSET)),	\
+		RX_MPDU_INFO_2_FR_DS_MASK,	\
+		RX_MPDU_INFO_2_FR_DS_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

@@ -353,6 +353,24 @@ static uint32_t hal_rx_mpdu_get_to_ds_8074v2(uint8_t *buf)
 
 	return HAL_RX_MPDU_GET_TODS(mpdu_info);
 }
+
+/*
+ * hal_rx_mpdu_get_fr_ds_8074v2(): API to get the from ds info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(fr_ds)
+ */
+static uint32_t hal_rx_mpdu_get_fr_ds_8074v2(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_mpdu_start *mpdu_start =
+				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
+
+	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
+
+	return HAL_RX_MPDU_GET_FROMDS(mpdu_info);
+}
 struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -409,6 +427,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_mac_ad4_valid_8074v2,
 	hal_rx_mpdu_start_sw_peer_id_get_8074v2,
 	hal_rx_mpdu_get_to_ds_8074v2,
+	hal_rx_mpdu_get_fr_ds_8074v2,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

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

@@ -128,6 +128,12 @@
 		RX_MPDU_INFO_2_TO_DS_OFFSET)),	\
 		RX_MPDU_INFO_2_TO_DS_MASK,	\
 		RX_MPDU_INFO_2_TO_DS_LSB))
+
+#define HAL_RX_MPDU_GET_FROMDS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_2_FR_DS_OFFSET)),	\
+		RX_MPDU_INFO_2_FR_DS_MASK,	\
+		RX_MPDU_INFO_2_FR_DS_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

@@ -363,6 +363,24 @@ static uint32_t hal_rx_mpdu_get_to_ds_9000(uint8_t *buf)
 	return HAL_RX_MPDU_GET_TODS(mpdu_info);
 }
 
+/*
+ * hal_rx_mpdu_get_fr_ds_9000(): API to get the from ds info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(fr_ds)
+ */
+static uint32_t hal_rx_mpdu_get_fr_ds_9000(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_mpdu_start *mpdu_start =
+				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
+
+	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
+
+	return HAL_RX_MPDU_GET_FROMDS(mpdu_info);
+}
+
 struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -419,6 +437,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_mac_ad4_valid_9000,
 	hal_rx_mpdu_start_sw_peer_id_get_9000,
 	hal_rx_mpdu_get_to_ds_9000,
+	hal_rx_mpdu_get_fr_ds_9000,
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {