Browse Source

qcacmn: Add hal_rx_mpdu_get_to_ds API

Implement hal_rx_mpdu_get_to_ds API based
on the chipset as the macro to retrieve
to_ds bit value is chipset dependent.

Change-Id: I36d9d14e226bcc604b91d8aecbe52836c5a12272
CRs-Fixed: 2522133
Venkata Sharath Chandra Manchala 5 years ago
parent
commit
e7924fd2da

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

@@ -608,6 +608,7 @@ QDF_STATUS dp_rx_filter_mesh_packets(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 					uint8_t *rx_tlv_hdr)
 {
 	union dp_align_mac_addr mac_addr;
+	struct dp_soc *soc = vdev->pdev->soc;
 
 	if (qdf_unlikely(vdev->mesh_rx_filter)) {
 		if (vdev->mesh_rx_filter & MESH_FILTER_OUT_FROMDS)
@@ -615,12 +616,14 @@ 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_TODS)
-			if (hal_rx_mpdu_get_to_ds(rx_tlv_hdr))
+			if (hal_rx_mpdu_get_to_ds(soc->hal_soc,
+						  rx_tlv_hdr))
 				return  QDF_STATUS_SUCCESS;
 
 		if (vdev->mesh_rx_filter & MESH_FILTER_OUT_NODS)
-			if (!hal_rx_mpdu_get_fr_ds(rx_tlv_hdr)
-				&& !hal_rx_mpdu_get_to_ds(rx_tlv_hdr))
+			if (!hal_rx_mpdu_get_fr_ds(rx_tlv_hdr) &&
+			    !hal_rx_mpdu_get_to_ds(soc->hal_soc,
+						   rx_tlv_hdr))
 				return  QDF_STATUS_SUCCESS;
 
 		if (vdev->mesh_rx_filter & MESH_FILTER_OUT_RA) {

+ 4 - 3
dp/wifi3.0/dp_rx_defrag.c

@@ -515,13 +515,14 @@ static QDF_STATUS dp_rx_defrag_wep_decap(qdf_nbuf_t msdu, uint16_t hdrlen)
 
 /*
  * dp_rx_defrag_hdrsize(): Calculate the header size of the received fragment
+ * @soc: soc handle
  * @nbuf: Pointer to the fragment
  *
  * Calculate the header size of the received fragment
  *
  * Returns: header size (uint16_t)
  */
-static uint16_t dp_rx_defrag_hdrsize(qdf_nbuf_t nbuf)
+static uint16_t dp_rx_defrag_hdrsize(struct dp_soc *soc, qdf_nbuf_t nbuf)
 {
 	uint8_t *rx_tlv_hdr = qdf_nbuf_data(nbuf);
 	uint16_t size = sizeof(struct ieee80211_frame);
@@ -530,7 +531,7 @@ static uint16_t dp_rx_defrag_hdrsize(qdf_nbuf_t nbuf)
 	uint8_t frm_ctrl_valid;
 	uint16_t frm_ctrl_field;
 
-	to_ds = hal_rx_mpdu_get_to_ds(rx_tlv_hdr);
+	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);
 	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);
@@ -1188,7 +1189,7 @@ static QDF_STATUS dp_rx_defrag(struct dp_peer *peer, unsigned tid,
 	struct dp_soc *soc = vdev->pdev->soc;
 	uint8_t status = 0;
 
-	hdr_space = dp_rx_defrag_hdrsize(cur);
+	hdr_space = dp_rx_defrag_hdrsize(soc, cur);
 	index = hal_rx_msdu_is_wlan_mcast(cur) ?
 		dp_sec_mcast : dp_sec_ucast;
 

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

@@ -393,6 +393,7 @@ struct hal_hw_txrx_ops {
 	uint8_t (*hal_rx_msdu_end_last_msdu_get)(uint8_t *buf);
 	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);
 };
 
 /**

+ 3 - 10
hal/wifi3.0/hal_rx.h

@@ -1484,18 +1484,11 @@ hal_rx_msdu_start_get_pkt_type(uint8_t *buf)
  */
 
 static inline uint32_t
-hal_rx_mpdu_get_to_ds(uint8_t *buf)
+hal_rx_mpdu_get_to_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 to_ds;
-
-	to_ds = HAL_RX_MPDU_GET_TODS(mpdu_info);
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
 
-	return to_ds;
+	return hal_soc->ops->hal_rx_mpdu_get_to_ds(buf);
 }
 
 #define HAL_RX_MPDU_GET_FROMDS(_rx_mpdu_info)	\

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

@@ -341,6 +341,25 @@ static uint32_t hal_rx_mpdu_start_sw_peer_id_get_6290(uint8_t *buf)
 	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
 		&mpdu_start->rx_mpdu_info_details);
 }
+
+/*
+ * hal_rx_mpdu_get_to_ds_6290(): API to get the tods info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(to_ds)
+ */
+
+static uint32_t hal_rx_mpdu_get_to_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_TODS(mpdu_info);
+}
 struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -395,6 +414,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_last_msdu_get_6290,
 	hal_rx_get_mpdu_mac_ad4_valid_6290,
 	hal_rx_mpdu_start_sw_peer_id_get_6290,
+	hal_rx_mpdu_get_to_ds_6290,
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

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

@@ -125,6 +125,12 @@
 		RX_MPDU_INFO_1_SW_PEER_ID_MASK,		\
 		RX_MPDU_INFO_1_SW_PEER_ID_LSB))
 
+#define HAL_RX_MPDU_GET_TODS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_2_TO_DS_OFFSET)),	\
+		RX_MPDU_INFO_2_TO_DS_MASK,	\
+		RX_MPDU_INFO_2_TO_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),\

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

@@ -341,6 +341,23 @@ static uint32_t hal_rx_mpdu_start_sw_peer_id_get_6390(uint8_t *buf)
 		&mpdu_start->rx_mpdu_info_details);
 }
 
+/*
+ * hal_rx_mpdu_get_to_ds_6390(): API to get the tods info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(to_ds)
+ */
+static uint32_t hal_rx_mpdu_get_to_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_TODS(mpdu_info);
+}
 struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -395,6 +412,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_last_msdu_get_6390,
 	hal_rx_get_mpdu_mac_ad4_valid_6390,
 	hal_rx_mpdu_start_sw_peer_id_get_6390,
+	hal_rx_mpdu_get_to_ds_6390,
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

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

@@ -125,6 +125,12 @@
 		RX_MPDU_INFO_1_SW_PEER_ID_MASK,		\
 		RX_MPDU_INFO_1_SW_PEER_ID_LSB))
 
+#define HAL_RX_MPDU_GET_TODS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_2_TO_DS_OFFSET)),	\
+		RX_MPDU_INFO_2_TO_DS_MASK,	\
+		RX_MPDU_INFO_2_TO_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

@@ -247,6 +247,24 @@ static uint32_t hal_rx_mpdu_start_sw_peer_id_get_6490(uint8_t *buf)
 		&mpdu_start->rx_mpdu_info_details);
 }
 
+/**
+ * hal_rx_mpdu_get_to_ds_6490(): API to get the tods info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(to_ds)
+ */
+static uint32_t hal_rx_mpdu_get_to_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_TODS(mpdu_info);
+}
+
 struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	/* rx */
 	hal_rx_get_rx_fragment_number_6490,
@@ -261,4 +279,5 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_last_msdu_get_6490,
 	hal_rx_get_mpdu_mac_ad4_valid_6490,
 	hal_rx_mpdu_start_sw_peer_id_get_6490,
+	hal_rx_mpdu_get_to_ds_6490,
 };

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

@@ -105,3 +105,9 @@
 		RX_MPDU_INFO_10_SW_PEER_ID_OFFSET)),	\
 		RX_MPDU_INFO_10_SW_PEER_ID_MASK,		\
 		RX_MPDU_INFO_10_SW_PEER_ID_LSB))
+
+#define HAL_RX_MPDU_GET_TODS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_11_TO_DS_OFFSET)),	\
+		RX_MPDU_INFO_11_TO_DS_MASK,	\
+		RX_MPDU_INFO_11_TO_DS_LSB))

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

@@ -337,6 +337,25 @@ static uint32_t hal_rx_mpdu_start_sw_peer_id_get_8074v1(uint8_t *buf)
 		&mpdu_start->rx_mpdu_info_details);
 }
 
+/*
+ * hal_rx_mpdu_get_to_ds_8074v1(): API to get the tods info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(to_ds)
+ */
+
+static uint32_t hal_rx_mpdu_get_to_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_TODS(mpdu_info);
+}
+
 struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -392,6 +411,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_last_msdu_get_8074v1,
 	hal_rx_get_mpdu_mac_ad4_valid_8074v1,
 	hal_rx_mpdu_start_sw_peer_id_get_8074v1,
+	hal_rx_mpdu_get_to_ds_8074v1,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

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

@@ -113,6 +113,12 @@
 		RX_MPDU_INFO_1_SW_PEER_ID_OFFSET)),	\
 		RX_MPDU_INFO_1_SW_PEER_ID_MASK,		\
 		RX_MPDU_INFO_1_SW_PEER_ID_LSB))
+
+#define HAL_RX_MPDU_GET_TODS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_2_TO_DS_OFFSET)),	\
+		RX_MPDU_INFO_2_TO_DS_MASK,	\
+		RX_MPDU_INFO_2_TO_DS_LSB))
 /*
  * hal_rx_msdu_start_nss_get_8074(): API to get the NSS
  * Interval from rx_msdu_start

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

@@ -336,6 +336,23 @@ static uint32_t hal_rx_mpdu_start_sw_peer_id_get_8074v2(uint8_t *buf)
 		&mpdu_start->rx_mpdu_info_details);
 }
 
+/*
+ * hal_rx_mpdu_get_to_ds_8074v2(): API to get the tods info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(to_ds)
+ */
+static uint32_t hal_rx_mpdu_get_to_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_TODS(mpdu_info);
+}
 struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -391,6 +408,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_last_msdu_get_8074v2,
 	hal_rx_get_mpdu_mac_ad4_valid_8074v2,
 	hal_rx_mpdu_start_sw_peer_id_get_8074v2,
+	hal_rx_mpdu_get_to_ds_8074v2,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

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

@@ -122,6 +122,12 @@
 		RX_MPDU_INFO_1_SW_PEER_ID_OFFSET)),	\
 		RX_MPDU_INFO_1_SW_PEER_ID_MASK,		\
 		RX_MPDU_INFO_1_SW_PEER_ID_LSB))
+
+#define HAL_RX_MPDU_GET_TODS(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+		RX_MPDU_INFO_2_TO_DS_OFFSET)),	\
+		RX_MPDU_INFO_2_TO_DS_MASK,	\
+		RX_MPDU_INFO_2_TO_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

@@ -345,6 +345,24 @@ static uint32_t hal_rx_mpdu_start_sw_peer_id_get_9000(uint8_t *buf)
 		&mpdu_start->rx_mpdu_info_details);
 }
 
+/*
+ * hal_rx_mpdu_get_to_ds_9000(): API to get the tods info
+ * from rx_mpdu_start
+ *
+ * @buf: pointer to the start of RX PKT TLV header
+ * Return: uint32_t(to_ds)
+ */
+static uint32_t hal_rx_mpdu_get_to_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_TODS(mpdu_info);
+}
+
 struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -400,6 +418,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_last_msdu_get_9000,
 	hal_rx_get_mpdu_mac_ad4_valid_9000,
 	hal_rx_mpdu_start_sw_peer_id_get_9000,
+	hal_rx_mpdu_get_to_ds_9000,
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {