Explorar el Código

qcacmn: Add hal_rx_print_pn API

Implement hal_rx_print_pn API based on the
chipset as the macro to retrieve
pn value is chipset dependent.

Change-Id: Id9d0d3b34a5f6a09fe5903e1d24bb0a59205174b
CRs-Fixed: 2522133
Venkata Sharath Chandra Manchala hace 5 años
padre
commit
a2d7497e1c

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

@@ -300,7 +300,7 @@ dp_rx_msdus_drop(struct dp_soc *soc, hal_ring_desc_t ring_desc,
 
 		rx_tlv_hdr = qdf_nbuf_data(rx_desc->nbuf);
 		if (hal_rx_encryption_info_valid(soc->hal_soc, rx_tlv_hdr))
-			hal_rx_print_pn(rx_tlv_hdr);
+			hal_rx_print_pn(soc->hal_soc, rx_tlv_hdr);
 
 		/* Just free the buffers */
 		qdf_nbuf_free(rx_desc->nbuf);

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

@@ -387,6 +387,7 @@ struct hal_hw_txrx_ops {
 	uint32_t (*hal_rx_desc_is_first_msdu)(void *hw_desc_addr);
 	uint32_t (*hal_rx_msdu_end_l3_hdr_padding_get)(uint8_t *buf);
 	uint32_t (*hal_rx_encryption_info_valid)(uint8_t *buf);
+	void (*hal_rx_print_pn)(uint8_t *buf);
 };
 
 /**

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

@@ -410,31 +410,6 @@ enum hal_rx_ret_buf_manager {
 	HAL_RX_MSDU_DA_IS_MCBC_FLAG_GET(msdu_info_ptr) | \
 	HAL_RX_MSDU_DA_IDX_TIMEOUT_FLAG_GET(msdu_info_ptr))
 
-
-#define HAL_RX_MPDU_PN_31_0_GET(_rx_mpdu_info)		\
-	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
-	RX_MPDU_INFO_4_PN_31_0_OFFSET)),		\
-	RX_MPDU_INFO_4_PN_31_0_MASK,			\
-	RX_MPDU_INFO_4_PN_31_0_LSB))
-
-#define HAL_RX_MPDU_PN_63_32_GET(_rx_mpdu_info)		\
-	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
-	RX_MPDU_INFO_5_PN_63_32_OFFSET)),		\
-	RX_MPDU_INFO_5_PN_63_32_MASK,			\
-	RX_MPDU_INFO_5_PN_63_32_LSB))
-
-#define HAL_RX_MPDU_PN_95_64_GET(_rx_mpdu_info)		\
-	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
-	RX_MPDU_INFO_6_PN_95_64_OFFSET)),		\
-	RX_MPDU_INFO_6_PN_95_64_MASK,			\
-	RX_MPDU_INFO_6_PN_95_64_LSB))
-
-#define HAL_RX_MPDU_PN_127_96_GET(_rx_mpdu_info)	\
-	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
-	RX_MPDU_INFO_7_PN_127_96_OFFSET)),		\
-	RX_MPDU_INFO_7_PN_127_96_MASK,			\
-	RX_MPDU_INFO_7_PN_127_96_LSB))
-
 #define HAL_RX_MPDU_ENCRYPT_TYPE_GET(_rx_mpdu_info)	\
 	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
 	RX_MPDU_INFO_3_ENCRYPT_TYPE_OFFSET)),		\
@@ -692,27 +667,18 @@ hal_rx_encryption_info_valid(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 }
 
 /*
- * @ hal_rx_print_pn: Prints the PN of rx packet.
+ * hal_rx_print_pn: Prints the PN of rx packet.
+ * @hal_soc_hdl: hal soc handle
+ * @buf: rx_tlv_hdr of the received packet
  *
- * @ buf: rx_tlv_hdr of the received packet
- * @ Return: void
+ * Return: void
  */
 static inline void
-hal_rx_print_pn(uint8_t *buf)
+hal_rx_print_pn(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 pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
-	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
-	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
-	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
 
-	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
-		"PN number pn_127_96 0x%x pn_95_64 0x%x pn_63_32 0x%x pn_31_0 0x%x ",
-			pn_127_96, pn_95_64, pn_63_32, pn_31_0);
+	hal_soc->ops->hal_rx_print_pn(buf);
 }
 
 /*

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

@@ -232,6 +232,28 @@ static uint32_t hal_rx_encryption_info_valid_6290(uint8_t *buf)
 	return encryption_info;
 }
 
+/*
+ * hal_rx_print_pn_6290: Prints the PN of rx packet.
+ * @buf: rx_tlv_hdr of the received packet
+ *
+ * Return: void
+ */
+static void hal_rx_print_pn_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;
+
+	uint32_t pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
+	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
+	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
+	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
+
+	hal_debug("PN number pn_127_96 0x%x pn_95_64 0x%x pn_63_32 0x%x pn_31_0 0x%x ",
+		  pn_127_96, pn_95_64, pn_63_32, pn_31_0);
+}
+
 struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -280,6 +302,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_rx_desc_is_first_msdu_6290,
 	hal_rx_msdu_end_l3_hdr_padding_get_6290,
 	hal_rx_encryption_info_valid_6290,
+	hal_rx_print_pn_6290,
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

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

@@ -71,6 +71,30 @@
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_MASK,	\
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_LSB))
 
+#define HAL_RX_MPDU_PN_31_0_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_4_PN_31_0_OFFSET)),		\
+	RX_MPDU_INFO_4_PN_31_0_MASK,			\
+	RX_MPDU_INFO_4_PN_31_0_LSB))
+
+#define HAL_RX_MPDU_PN_63_32_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_5_PN_63_32_OFFSET)),		\
+	RX_MPDU_INFO_5_PN_63_32_MASK,			\
+	RX_MPDU_INFO_5_PN_63_32_LSB))
+
+#define HAL_RX_MPDU_PN_95_64_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_6_PN_95_64_OFFSET)),		\
+	RX_MPDU_INFO_6_PN_95_64_MASK,			\
+	RX_MPDU_INFO_6_PN_95_64_LSB))
+
+#define HAL_RX_MPDU_PN_127_96_GET(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_7_PN_127_96_OFFSET)),		\
+	RX_MPDU_INFO_7_PN_127_96_MASK,			\
+	RX_MPDU_INFO_7_PN_127_96_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),\

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

@@ -232,6 +232,28 @@ static uint32_t hal_rx_encryption_info_valid_6390(uint8_t *buf)
 	return encryption_info;
 }
 
+/*
+ * @ hal_rx_print_pn_6390: Prints the PN of rx packet.
+ *
+ * @ buf: rx_tlv_hdr of the received packet
+ * @ Return: void
+ */
+static void hal_rx_print_pn_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;
+
+	uint32_t pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
+	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
+	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
+	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
+
+	hal_debug("PN number pn_127_96 0x%x pn_95_64 0x%x pn_63_32 0x%x pn_31_0 0x%x ",
+		  pn_127_96, pn_95_64, pn_63_32, pn_31_0);
+}
+
 struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -280,6 +302,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	hal_rx_desc_is_first_msdu_6390,
 	hal_rx_msdu_end_l3_hdr_padding_get_6390,
 	hal_rx_encryption_info_valid_6390,
+	hal_rx_print_pn_6390,
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

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

@@ -71,6 +71,30 @@
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_MASK,	\
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_LSB))
 
+#define HAL_RX_MPDU_PN_31_0_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_4_PN_31_0_OFFSET)),		\
+	RX_MPDU_INFO_4_PN_31_0_MASK,			\
+	RX_MPDU_INFO_4_PN_31_0_LSB))
+
+#define HAL_RX_MPDU_PN_63_32_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_5_PN_63_32_OFFSET)),		\
+	RX_MPDU_INFO_5_PN_63_32_MASK,			\
+	RX_MPDU_INFO_5_PN_63_32_LSB))
+
+#define HAL_RX_MPDU_PN_95_64_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_6_PN_95_64_OFFSET)),		\
+	RX_MPDU_INFO_6_PN_95_64_MASK,			\
+	RX_MPDU_INFO_6_PN_95_64_LSB))
+
+#define HAL_RX_MPDU_PN_127_96_GET(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_7_PN_127_96_OFFSET)),		\
+	RX_MPDU_INFO_7_PN_127_96_MASK,			\
+	RX_MPDU_INFO_7_PN_127_96_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)),	\

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

@@ -138,6 +138,28 @@ static uint32_t hal_rx_encryption_info_valid_6490(uint8_t *buf)
 	return encryption_info;
 }
 
+/*
+ * @ hal_rx_print_pn_6490: Prints the PN of rx packet.
+ *
+ * @ buf: rx_tlv_hdr of the received packet
+ * @ Return: void
+ */
+static void hal_rx_print_pn_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;
+
+	uint32_t pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
+	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
+	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
+	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
+
+	hal_debug("PN number pn_127_96 0x%x pn_95_64 0x%x pn_63_32 0x%x pn_31_0 0x%x ",
+		  pn_127_96, pn_95_64, pn_63_32, pn_31_0);
+}
+
 struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	/* rx */
 	hal_rx_get_rx_fragment_number_6490,
@@ -146,4 +168,5 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	hal_rx_desc_is_first_msdu_6490,
 	hal_rx_msdu_end_l3_hdr_padding_get_6490,
 	hal_rx_encryption_info_valid_6490,
+	hal_rx_print_pn_6490,
 };

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

@@ -51,3 +51,27 @@
 	RX_MPDU_INFO_11_FRAME_ENCRYPTION_INFO_VALID_OFFSET)),	\
 	RX_MPDU_INFO_11_FRAME_ENCRYPTION_INFO_VALID_MASK,	\
 	RX_MPDU_INFO_11_FRAME_ENCRYPTION_INFO_VALID_LSB))
+
+#define HAL_RX_MPDU_PN_31_0_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_3_PN_31_0_OFFSET)),		\
+	RX_MPDU_INFO_3_PN_31_0_MASK,			\
+	RX_MPDU_INFO_3_PN_31_0_LSB))
+
+#define HAL_RX_MPDU_PN_63_32_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_4_PN_63_32_OFFSET)),		\
+	RX_MPDU_INFO_4_PN_63_32_MASK,			\
+	RX_MPDU_INFO_4_PN_63_32_LSB))
+
+#define HAL_RX_MPDU_PN_95_64_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_5_PN_95_64_OFFSET)),		\
+	RX_MPDU_INFO_5_PN_95_64_MASK,			\
+	RX_MPDU_INFO_5_PN_95_64_LSB))
+
+#define HAL_RX_MPDU_PN_127_96_GET(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_6_PN_127_96_OFFSET)),		\
+	RX_MPDU_INFO_6_PN_127_96_MASK,			\
+	RX_MPDU_INFO_6_PN_127_96_LSB))

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

@@ -227,6 +227,28 @@ static uint32_t hal_rx_encryption_info_valid_8074v1(uint8_t *buf)
 	return encryption_info;
 }
 
+/*
+ * @ hal_rx_print_pn_8074v1: Prints the PN of rx packet.
+ *
+ * @ buf: rx_tlv_hdr of the received packet
+ * @ Return: void
+ */
+static void hal_rx_print_pn_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;
+
+	uint32_t pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
+	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
+	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
+	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
+
+	hal_debug("PN number pn_127_96 0x%x pn_95_64 0x%x pn_63_32 0x%x pn_31_0 0x%x ",
+		  pn_127_96, pn_95_64, pn_63_32, pn_31_0);
+}
+
 struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -276,6 +298,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_rx_desc_is_first_msdu_8074v1,
 	hal_rx_msdu_end_l3_hdr_padding_get_8074v1,
 	hal_rx_encryption_info_valid_8074v1,
+	hal_rx_print_pn_8074v1,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

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

@@ -59,6 +59,31 @@
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_OFFSET)),	\
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_MASK,	\
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_LSB))
+
+#define HAL_RX_MPDU_PN_31_0_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_4_PN_31_0_OFFSET)),		\
+	RX_MPDU_INFO_4_PN_31_0_MASK,			\
+	RX_MPDU_INFO_4_PN_31_0_LSB))
+
+#define HAL_RX_MPDU_PN_63_32_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_5_PN_63_32_OFFSET)),		\
+	RX_MPDU_INFO_5_PN_63_32_MASK,			\
+	RX_MPDU_INFO_5_PN_63_32_LSB))
+
+#define HAL_RX_MPDU_PN_95_64_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_6_PN_95_64_OFFSET)),		\
+	RX_MPDU_INFO_6_PN_95_64_MASK,			\
+	RX_MPDU_INFO_6_PN_95_64_LSB))
+
+#define HAL_RX_MPDU_PN_127_96_GET(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_7_PN_127_96_OFFSET)),		\
+	RX_MPDU_INFO_7_PN_127_96_MASK,			\
+	RX_MPDU_INFO_7_PN_127_96_LSB))
+
 /*
  * hal_rx_msdu_start_nss_get_8074(): API to get the NSS
  * Interval from rx_msdu_start

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

@@ -227,6 +227,28 @@ static uint32_t hal_rx_encryption_info_valid_8074v2(uint8_t *buf)
 	return encryption_info;
 }
 
+/*
+ * @ hal_rx_print_pn_8074v2: Prints the PN of rx packet.
+ *
+ * @ buf: rx_tlv_hdr of the received packet
+ * @ Return: void
+ */
+static void hal_rx_print_pn_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;
+
+	uint32_t pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
+	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
+	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
+	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
+
+	hal_debug("PN number pn_127_96 0x%x pn_95_64 0x%x pn_63_32 0x%x pn_31_0 0x%x ",
+		  pn_127_96, pn_95_64, pn_63_32, pn_31_0);
+}
+
 struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -276,6 +298,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	hal_rx_desc_is_first_msdu_8074v2,
 	hal_rx_msdu_end_l3_hdr_padding_get_8074v2,
 	hal_rx_encryption_info_valid_8074v2,
+	hal_rx_print_pn_8074v2,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

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

@@ -63,6 +63,30 @@
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_MASK,	\
 	RX_MPDU_INFO_2_FRAME_ENCRYPTION_INFO_VALID_LSB))
 
+#define HAL_RX_MPDU_PN_31_0_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_4_PN_31_0_OFFSET)),		\
+	RX_MPDU_INFO_4_PN_31_0_MASK,			\
+	RX_MPDU_INFO_4_PN_31_0_LSB))
+
+#define HAL_RX_MPDU_PN_63_32_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_5_PN_63_32_OFFSET)),		\
+	RX_MPDU_INFO_5_PN_63_32_MASK,			\
+	RX_MPDU_INFO_5_PN_63_32_LSB))
+
+#define HAL_RX_MPDU_PN_95_64_GET(_rx_mpdu_info)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_6_PN_95_64_OFFSET)),		\
+	RX_MPDU_INFO_6_PN_95_64_MASK,			\
+	RX_MPDU_INFO_6_PN_95_64_LSB))
+
+#define HAL_RX_MPDU_PN_127_96_GET(_rx_mpdu_info)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_mpdu_info,	\
+	RX_MPDU_INFO_7_PN_127_96_OFFSET)),		\
+	RX_MPDU_INFO_7_PN_127_96_MASK,			\
+	RX_MPDU_INFO_7_PN_127_96_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)),	\

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

@@ -236,6 +236,28 @@ inline uint32_t hal_rx_encryption_info_valid_9000(uint8_t *buf)
 	return encryption_info;
 }
 
+/*
+ * @ hal_rx_print_pn_9000: Prints the PN of rx packet.
+ *
+ * @ buf: rx_tlv_hdr of the received packet
+ * @ Return: void
+ */
+static void hal_rx_print_pn_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;
+
+	uint32_t pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
+	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
+	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
+	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
+
+	hal_debug("PN number pn_127_96 0x%x pn_95_64 0x%x pn_63_32 0x%x pn_31_0 0x%x ",
+		  pn_127_96, pn_95_64, pn_63_32, pn_31_0);
+}
+
 struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -285,6 +307,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_rx_desc_is_first_msdu_9000,
 	hal_rx_msdu_end_l3_hdr_padding_get_9000,
 	hal_rx_encryption_info_valid_9000,
+	hal_rx_print_pn_9000,
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {