Browse Source

qcacmn: Add API to get phy_ppdu_id in RX pkt tlv enabled

In case of WORD MASK subscribtion enabled, get phy_ppdu_id
from RX pkt hdr tlv in case PKT_TLV_HDR is subscribed.

Change-Id: I40e1b01c2f52404872c39df6d9faa57a95dad5c2
CRs-Fixed: 3582126
Chaithanya Garrepalli 1 năm trước cách đây
mục cha
commit
d1d1770bd9

+ 43 - 2
hal/wifi3.0/be/hal_be_rx_tlv.h

@@ -35,11 +35,24 @@
 
 #define HAL_RX_BE_PKT_HDR_TLV_LEN		112
 
+#ifndef BIG_ENDIAN_HOST
 struct rx_pkt_hdr_tlv {
 	TLV_TAG_T tag;					/* TLV_TAG_T B */
-	uint64_t phy_ppdu_id;				/* 8 B */
-	char rx_pkt_hdr[HAL_RX_BE_PKT_HDR_TLV_LEN];		/* 112 B */
+	uint32_t reserved_0				: 16, /* 4 B */
+		 phy_ppdu_id				: 16;
+	uint32_t reserved_1a;				/* 4 B */
+	char rx_pkt_hdr[HAL_RX_BE_PKT_HDR_TLV_LEN];	/* 112 B */
 };
+#else
+struct rx_pkt_hdr_tlv {
+	TLV_TAG_T tag;					/* TLV_TAG_T B */
+	uint32_t phy_ppdu_id				: 16, /* 4 B */
+		 reserved_0				: 16;
+	uint32_t reserved_1a;				/* 4 B */
+	char rx_pkt_hdr[HAL_RX_BE_PKT_HDR_TLV_LEN];	/* 112 B */
+};
+#endif
+
 
 #ifdef CONFIG_WORD_BASED_TLV
 #ifndef BIG_ENDIAN_HOST
@@ -494,6 +507,14 @@ struct rx_pkt_tlvs {
 
 #endif /* CONFIG_WORD_BASED_TLV */
 
+#ifndef NO_RX_PKT_HDR_TLV
+#define HAL_RX_PKT_HDR_TLV(_rx_pkt_tlv)  \
+	(((struct rx_pkt_tlvs *)_rx_pkt_tlv)->pkt_hdr_tlv)
+
+#define HAL_RX_PKT_HDR_TLV_PHY_PPDU_ID_GET(_rx_pkt_tlv)   \
+	HAL_RX_PKT_HDR_TLV(_rx_pkt_tlv).phy_ppdu_id
+#endif
+
 /**
  * struct rx_mon_pkt_tlvs - RX packet data structure for DEST ring in the
  *			    monitor mode.
@@ -1217,6 +1238,26 @@ static inline void hal_rx_tlv_get_pn_num_be(uint8_t *buf, uint64_t *pn_num)
 
 	pn_num[1] = HAL_RX_TLV_MPDU_PN_95_64_GET(pkt_tlvs);
 }
+
+#ifdef NO_RX_PKT_HDR_TLV
+static inline uint32_t
+hal_rx_get_ppdu_id_be(uint8_t *buf)
+{
+	/* If CONFIG_WORD_BASED_TLV and NO_RX_PKT_HDR_TLV are enabled
+	 * phy_ppdu_id is not available
+	 */
+	hal_alert_rl("PPDU_ID is not subscribed check build flags");
+	return 0;
+}
+#else
+static inline uint32_t
+hal_rx_get_ppdu_id_be(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *rx_pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+
+	return HAL_RX_PKT_HDR_TLV_PHY_PPDU_ID_GET(rx_pkt_tlvs);
+}
+#endif
 #endif
 
 /**

+ 1 - 1
hal/wifi3.0/kiwi/hal_kiwi.c

@@ -823,7 +823,7 @@ static inline void hal_rx_dump_pkt_hdr_tlv_kiwi(struct rx_pkt_tlvs *pkt_tlvs,
 	hal_verbose_debug("\n---------------\n"
 			  "rx_pkt_hdr_tlv\n"
 			  "---------------\n"
-			  "phy_ppdu_id %lld ",
+			  "phy_ppdu_id 0x%x ",
 			  pkt_hdr_tlv->phy_ppdu_id);
 
 	hal_verbose_hex_dump(pkt_hdr_tlv->rx_pkt_hdr,

+ 2 - 2
hal/wifi3.0/qca5332/hal_5332.c

@@ -1105,7 +1105,7 @@ static inline void hal_rx_dump_pkt_hdr_tlv_5332(struct rx_pkt_tlvs *pkt_tlvs,
 	hal_verbose_debug("\n---------------\n"
 			  "rx_pkt_hdr_tlv\n"
 			  "---------------\n"
-			  "phy_ppdu_id %llu ",
+			  "phy_ppdu_id 0x%x ",
 			  pkt_hdr_tlv->phy_ppdu_id);
 
 	hal_verbose_hex_dump(pkt_hdr_tlv->rx_pkt_hdr,
@@ -1438,12 +1438,12 @@ static void hal_hw_txrx_ops_attach_qca5332(struct hal_soc *hal_soc)
 					hal_rx_mpdu_info_ampdu_flag_get_be;
 	hal_soc->ops->hal_rx_hw_desc_get_ppduid_get =
 		hal_rx_hw_desc_get_ppduid_get_be;
-	hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_be;
 	hal_soc->ops->hal_rx_tlv_phy_ppdu_id_get =
 					hal_rx_attn_phy_ppdu_id_get_be;
 	hal_soc->ops->hal_rx_get_filter_category =
 						hal_rx_get_filter_category_be;
 #endif
+	hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_be;
 	hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_be;
 	hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_be;
 	hal_soc->ops->hal_rx_get_mpdu_frame_control_valid =

+ 2 - 2
hal/wifi3.0/qcn6432/hal_6432.c

@@ -1144,7 +1144,7 @@ static inline void hal_rx_dump_pkt_hdr_tlv_6432(struct rx_pkt_tlvs *pkt_tlvs,
 	hal_verbose_debug("\n---------------\n"
 			"rx_pkt_hdr_tlv\n"
 			"---------------\n"
-			"phy_ppdu_id %llu ",
+			"phy_ppdu_id 0x%x ",
 			pkt_hdr_tlv->phy_ppdu_id);
 
 	hal_verbose_hex_dump(pkt_hdr_tlv->rx_pkt_hdr,
@@ -1580,12 +1580,12 @@ static void hal_hw_txrx_ops_attach_qcn6432(struct hal_soc *hal_soc)
 		hal_rx_mpdu_info_ampdu_flag_get_be;
 	hal_soc->ops->hal_rx_hw_desc_get_ppduid_get =
 		hal_rx_hw_desc_get_ppduid_get_be;
-	hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_be;
 	hal_soc->ops->hal_rx_tlv_phy_ppdu_id_get =
 		hal_rx_attn_phy_ppdu_id_get_be;
 	hal_soc->ops->hal_rx_get_filter_category =
 		hal_rx_get_filter_category_be;
 #endif
+	hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_be;
 	hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_be;
 	hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_be;
 	hal_soc->ops->hal_rx_get_mpdu_frame_control_valid =

+ 2 - 2
hal/wifi3.0/qcn9224/hal_9224.h

@@ -1269,7 +1269,7 @@ static inline void hal_rx_dump_pkt_hdr_tlv_9224(struct rx_pkt_tlvs *pkt_tlvs,
 	hal_verbose_debug("\n---------------\n"
 			  "rx_pkt_hdr_tlv\n"
 			  "---------------\n"
-			  "phy_ppdu_id %llu ",
+			  "phy_ppdu_id 0x%x ",
 			  pkt_hdr_tlv->phy_ppdu_id);
 
 	hal_verbose_hex_dump(pkt_hdr_tlv->rx_pkt_hdr,
@@ -1753,12 +1753,12 @@ static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc)
 	hal_soc->ops->hal_rx_mpdu_get_addr4 = hal_rx_mpdu_get_addr4_be;
 	hal_soc->ops->hal_rx_hw_desc_get_ppduid_get =
 		hal_rx_hw_desc_get_ppduid_get_be;
-	hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_be;
 	hal_soc->ops->hal_rx_tlv_phy_ppdu_id_get =
 					hal_rx_attn_phy_ppdu_id_get_be;
 	hal_soc->ops->hal_rx_get_filter_category =
 						hal_rx_get_filter_category_be;
 #endif
+	hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_be;
 	hal_soc->ops->hal_rx_tlv_msdu_len_set =
 					hal_rx_msdu_start_msdu_len_set_be;
 	hal_soc->ops->hal_rx_tlv_sgi_get = hal_rx_tlv_sgi_get_be;