Эх сурвалжийг харах

qcacmn: Add hal API to get L3 type field

In some cases we need to classify frames accordinging
to l3 type. This change mainly focus on this issue.

Change-Id: I4bc49a808a02b4bc8c65f920690922045d65e739
CRs-Fixed: 3198481
jinbliu 3 жил өмнө
parent
commit
bb29a06aad

+ 16 - 0
hal/wifi3.0/be/hal_be_rx_tlv.h

@@ -226,6 +226,9 @@ struct rx_pkt_tlvs {
 	HAL_RX_MSDU_END(_rx_pkt_tlv).window_size
 #endif
 
+#define HAL_RX_TLV_L3_TYPE_GET(_rx_pkt_tlv)	\
+	HAL_RX_MSDU_END(_rx_pkt_tlv).l3_type
+
 #define HAL_RX_GET_FILTER_CATEGORY(_rx_pkt_tlv) \
 	HAL_RX_MPDU_START(_rx_pkt_tlv).rxpcu_mpdu_filter_in_category
 
@@ -1994,4 +1997,17 @@ hal_rx_msdu_end_sa_sw_peer_id_get_be(uint8_t *buf)
 	return HAL_RX_MSDU_END_SA_SW_PEER_ID_GET(msdu_end);
 }
 
+/**
+ * hal_rx_tlv_l3_type_get_be(): API to get the l3 type
+ * from rx_msdu_start TLV
+ *
+ * @buf: pointer to the start of RX PKT TLV headers
+ * Return: uint32_t(l3 type)
+ */
+static inline uint32_t hal_rx_tlv_l3_type_get_be(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *rx_pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+
+	return HAL_RX_TLV_L3_TYPE_GET(rx_pkt_tlvs);
+}
 #endif /* _HAL_BE_RX_TLV_H_ */

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

@@ -1079,6 +1079,7 @@ struct hal_hw_txrx_ops {
 	uint8_t (*hal_get_first_wow_wakeup_packet)(uint8_t *buf);
 #endif
 	void (*hal_reo_shared_qaddr_cache_clear)(hal_soc_handle_t hal_soc_hdl);
+	uint32_t (*hal_rx_tlv_l3_type_get)(uint8_t *buf);
 };
 
 /**

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

@@ -3006,4 +3006,11 @@ hal_get_first_wow_wakeup_packet(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 }
 #endif
 
+static inline uint32_t
+hal_rx_tlv_l3_type_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	return hal_soc->ops->hal_rx_tlv_l3_type_get(buf);
+}
 #endif /* _HAL_RX_H */

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

@@ -2057,6 +2057,8 @@ static void hal_hw_txrx_ops_attach_kiwi(struct hal_soc *hal_soc)
 		hal_get_first_wow_wakeup_packet_kiwi;
 #endif
 	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
+
+	hal_soc->ops->hal_rx_tlv_l3_type_get = hal_rx_tlv_l3_type_get_be;
 };
 
 struct hal_hw_srng_config hw_srng_table_kiwi[] = {

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

@@ -1716,6 +1716,21 @@ static uint8_t hal_get_first_wow_wakeup_packet_6490(uint8_t *buf)
 }
 #endif
 
+/**
+ * hal_rx_tlv_l3_type_get_6490(): Function to retrieve l3_type
+ *
+ * @buf: Network buffer
+ *
+ * Returns: l3_type
+ */
+static uint32_t hal_rx_tlv_l3_type_get_6490(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+
+	return HAL_RX_MSDU_END_L3_TYPE_GET(msdu_end);
+}
+
 static void hal_hw_txrx_ops_attach_qca6490(struct hal_soc *hal_soc)
 {
 	/* init and setup */
@@ -1912,6 +1927,8 @@ static void hal_hw_txrx_ops_attach_qca6490(struct hal_soc *hal_soc)
 #endif
 	hal_soc->ops->hal_compute_reo_remap_ix0 =
 					hal_compute_reo_remap_ix0_6490;
+	hal_soc->ops->hal_rx_tlv_l3_type_get =
+		hal_rx_tlv_l3_type_get_6490;
 };
 
 struct hal_hw_srng_config hw_srng_table_6490[] = {

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

@@ -430,6 +430,12 @@ RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_RESERVED_0A_OFFSET))
 		RX_MSDU_END_1_RESERVED_1A_MASK,	\
 		RX_MSDU_END_1_RESERVED_1A_LSB))
 
+#define HAL_RX_MSDU_END_L3_TYPE_GET(_rx_msdu_end)     \
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
+		RX_MSDU_END_5_L3_TYPE_OFFSET)),	\
+		RX_MSDU_END_5_L3_TYPE_MASK,	\
+		RX_MSDU_END_5_L3_TYPE_LSB))
+
 #if defined(QCA_WIFI_QCA6490) && defined(WLAN_CFR_ENABLE) && \
 	defined(WLAN_ENH_CFR_ENABLE)
 static inline