Browse Source

qcacmn: Add hal_rx_mpdu_start_sw_peer_id_get API

Implement hal_rx_mpdu_start_sw_peer_id API
based on the chipset as the macro to retrieve
sw_peer_id value is chipset dependent.

Change-Id: Ifebaf2430731f5e0593dde4789d721e9fe7ce7c1
CRs-Fixed: 2522133
Venkata Sharath Chandra Manchala 5 years ago
parent
commit
96ed623043

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

@@ -1456,7 +1456,8 @@ done:
 		uint8_t *tlv_hdr;
 		rx_tlv_hdr = qdf_nbuf_data(nbuf);
 
-		peer_id = hal_rx_mpdu_start_sw_peer_id_get(rx_tlv_hdr);
+		peer_id = hal_rx_mpdu_start_sw_peer_id_get(soc->hal_soc,
+							   rx_tlv_hdr);
 		peer = dp_peer_find_by_id(soc, peer_id);
 
 		/*
@@ -1507,7 +1508,8 @@ done:
 					if (hal_rx_msdu_end_first_msdu_get(soc->hal_soc,
 									   rx_tlv_hdr)) {
 						peer_id =
-						hal_rx_mpdu_start_sw_peer_id_get(rx_tlv_hdr);
+						hal_rx_mpdu_start_sw_peer_id_get(soc->hal_soc,
+										 rx_tlv_hdr);
 						tid =
 						hal_rx_mpdu_start_tid_get(hal_soc, rx_tlv_hdr);
 					}

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

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

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

@@ -1265,28 +1265,20 @@ hal_rx_tid_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 	return HAL_RX_NON_QOS_TID;
 }
 
-
-/*
- * Get SW peer id from RX_MPDU_START
+/**
+ * hal_rx_mpdu_start_sw_peer_id_get() - Retrieve sw peer id
+ * @hal_soc_hdl: hal soc handle
+ * @buf: pointer to rx pkt TLV.
+ *
+ * Return: sw peer_id
  */
-#define HAL_RX_MPDU_INFO_SW_PEER_ID_GET(_rx_mpdu_info) \
-	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_mpdu_info),	\
-		RX_MPDU_INFO_1_SW_PEER_ID_OFFSET)),	\
-		RX_MPDU_INFO_1_SW_PEER_ID_MASK,		\
-		RX_MPDU_INFO_1_SW_PEER_ID_LSB))
-
 static inline uint32_t
-hal_rx_mpdu_start_sw_peer_id_get(uint8_t *buf)
+hal_rx_mpdu_start_sw_peer_id_get(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;
-	uint32_t sw_peer_id;
-
-	sw_peer_id = HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
-		&(mpdu_start->rx_mpdu_info_details));
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
 
-	return sw_peer_id;
+	return hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get(buf);
 }
 
 #define HAL_RX_MSDU_START_SGI_GET(_rx_msdu_start)	\

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

@@ -326,6 +326,21 @@ static bool hal_rx_get_mpdu_mac_ad4_valid_6290(uint8_t *buf)
 	return ad4_valid;
 }
 
+/**
+ * hal_rx_mpdu_start_sw_peer_id_get_6290: Retrieve sw peer_id
+ * @buf: network buffer
+ *
+ * Return: sw peer_id:
+ */
+static uint32_t hal_rx_mpdu_start_sw_peer_id_get_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;
+
+	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
+		&mpdu_start->rx_mpdu_info_details);
+}
 struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -379,6 +394,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_da_is_valid_get_6290,
 	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,
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

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

@@ -119,6 +119,12 @@
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_MASK,		\
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_LSB))
 
+#define HAL_RX_MPDU_INFO_SW_PEER_ID_GET(_rx_mpdu_info) \
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_mpdu_info),	\
+		RX_MPDU_INFO_1_SW_PEER_ID_OFFSET)),	\
+		RX_MPDU_INFO_1_SW_PEER_ID_MASK,		\
+		RX_MPDU_INFO_1_SW_PEER_ID_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

@@ -324,6 +324,23 @@ static bool hal_rx_get_mpdu_mac_ad4_valid_6390(uint8_t *buf)
 
 	return ad4_valid;
 }
+
+/**
+ * hal_rx_mpdu_start_sw_peer_id_get_6390: Retrieve sw peer_id
+ * @buf: network buffer
+ *
+ * Return: sw peer_id
+ */
+static uint32_t hal_rx_mpdu_start_sw_peer_id_get_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;
+
+	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
+		&mpdu_start->rx_mpdu_info_details);
+}
+
 struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -377,6 +394,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_da_is_valid_get_6390,
 	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,
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

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

@@ -119,6 +119,12 @@
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_MASK,		\
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_LSB))
 
+#define HAL_RX_MPDU_INFO_SW_PEER_ID_GET(_rx_mpdu_info) \
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_mpdu_info),	\
+		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_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)),	\

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

@@ -231,6 +231,22 @@ static bool hal_rx_get_mpdu_mac_ad4_valid_6490(uint8_t *buf)
 	return ad4_valid;
 }
 
+/**
+ * hal_rx_mpdu_start_sw_peer_id_get_6490: Retrieve sw peer_id
+ * @buf: network buffer
+ *
+ * Return: sw peer_id
+ */
+static uint32_t hal_rx_mpdu_start_sw_peer_id_get_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;
+
+	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
+		&mpdu_start->rx_mpdu_info_details);
+}
+
 struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	/* rx */
 	hal_rx_get_rx_fragment_number_6490,
@@ -244,4 +260,5 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_da_is_valid_get_6490,
 	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,
 };

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

@@ -99,3 +99,9 @@
 		RX_MPDU_INFO_11_MAC_ADDR_AD4_VALID_OFFSET)),	\
 		RX_MPDU_INFO_11_MAC_ADDR_AD4_VALID_MASK,	\
 		RX_MPDU_INFO_11_MAC_ADDR_AD4_VALID_LSB))
+
+#define HAL_RX_MPDU_INFO_SW_PEER_ID_GET(_rx_mpdu_info) \
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_mpdu_info),	\
+		RX_MPDU_INFO_10_SW_PEER_ID_OFFSET)),	\
+		RX_MPDU_INFO_10_SW_PEER_ID_MASK,		\
+		RX_MPDU_INFO_10_SW_PEER_ID_LSB))

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

@@ -321,6 +321,22 @@ static bool hal_rx_get_mpdu_mac_ad4_valid_8074v1(uint8_t *buf)
 	return ad4_valid;
 }
 
+/**
+ * hal_rx_mpdu_start_sw_peer_id_get_8074v1: Retrieve sw peer_id
+ * @buf: network buffer
+ *
+ * Return: sw peer_id
+ */
+static uint32_t hal_rx_mpdu_start_sw_peer_id_get_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;
+
+	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
+		&mpdu_start->rx_mpdu_info_details);
+}
+
 struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -375,6 +391,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_da_is_valid_get_8074v1,
 	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,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

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

@@ -107,6 +107,12 @@
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_OFFSET)),	\
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_MASK,		\
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_LSB))
+
+#define HAL_RX_MPDU_INFO_SW_PEER_ID_GET(_rx_mpdu_info) \
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_mpdu_info),	\
+		RX_MPDU_INFO_1_SW_PEER_ID_OFFSET)),	\
+		RX_MPDU_INFO_1_SW_PEER_ID_MASK,		\
+		RX_MPDU_INFO_1_SW_PEER_ID_LSB))
 /*
  * hal_rx_msdu_start_nss_get_8074(): API to get the NSS
  * Interval from rx_msdu_start

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

@@ -320,6 +320,22 @@ static bool hal_rx_get_mpdu_mac_ad4_valid_8074v2(uint8_t *buf)
 	return ad4_valid;
 }
 
+/**
+ * hal_rx_mpdu_start_sw_peer_id_get_8074v2: Retrieve sw peer_id
+ * @buf: network buffer
+ *
+ * Return: sw peer_id
+ */
+static uint32_t hal_rx_mpdu_start_sw_peer_id_get_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;
+
+	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
+		&mpdu_start->rx_mpdu_info_details);
+}
+
 struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -374,6 +390,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_da_is_valid_get_8074v2,
 	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,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

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

@@ -116,6 +116,12 @@
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_OFFSET)),	\
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_MASK,		\
 		RX_MPDU_INFO_2_MAC_ADDR_AD4_VALID_LSB))
+
+#define HAL_RX_MPDU_INFO_SW_PEER_ID_GET(_rx_mpdu_info) \
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_mpdu_info),	\
+		RX_MPDU_INFO_1_SW_PEER_ID_OFFSET)),	\
+		RX_MPDU_INFO_1_SW_PEER_ID_MASK,		\
+		RX_MPDU_INFO_1_SW_PEER_ID_LSB))
 /*
  * hal_rx_msdu_start_nss_get_8074v2(): API to get the NSS
  * Interval from rx_msdu_start

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

@@ -329,6 +329,22 @@ inline bool hal_rx_get_mpdu_mac_ad4_valid_9000(uint8_t *buf)
 	return ad4_valid;
 }
 
+/**
+ * hal_rx_mpdu_start_sw_peer_id_get_9000: Retrieve sw peer_id
+ * @buf: network buffer
+ *
+ * Return: sw peer_id
+ */
+static uint32_t hal_rx_mpdu_start_sw_peer_id_get_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;
+
+	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
+		&mpdu_start->rx_mpdu_info_details);
+}
+
 struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -383,6 +399,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_rx_msdu_end_da_is_valid_get_9000,
 	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,
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {