Răsfoiți Sursa

qcacmn: Add hal_rx_hw_desc_get_ppduid_get API

Implement hal_rx_hw_desc_get_ppduid API based
on the chipset as the macro to retrieve
ppduid value is chipset dependent.

Change-Id: I7d3457d731ea486f04367f98f9f18d3f1c0fcfd7
CRs-Fixed: 2522133
Venkata Sharath Chandra Manchala 5 ani în urmă
părinte
comite
84d5092701

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

@@ -450,7 +450,8 @@ dp_rx_chain_msdus(struct dp_soc *soc, qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr,
 	    QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST
 		(dp_pdev->invalid_peer_head_msdu) >= DP_MAX_INVALID_BUFFERS) {
 		qdf_nbuf_set_rx_chfrag_start(nbuf, 1);
-		dp_pdev->ppdu_id = HAL_RX_HW_DESC_GET_PPDUID_GET(rx_tlv_hdr);
+		dp_pdev->ppdu_id = hal_rx_hw_desc_get_ppduid_get(soc->hal_soc,
+								 rx_tlv_hdr);
 		dp_pdev->first_nbuf = true;
 
 		/* If the new nbuf received is the first msdu of the

+ 2 - 1
dp/wifi3.0/dp_rx_mon_dest.c

@@ -383,7 +383,8 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
 					goto next_msdu;
 				}
 
-				msdu_ppdu_id = HAL_RX_HW_DESC_GET_PPDUID_GET(
+				msdu_ppdu_id = hal_rx_hw_desc_get_ppduid_get(
+						soc->hal_soc,
 						rx_desc_tlv);
 				is_first_msdu = false;
 

+ 0 - 11
hal/wifi3.0/hal_api_mon.h

@@ -228,17 +228,6 @@ bool HAL_RX_HW_DESC_MPDU_VALID(void *hw_desc_addr)
 	return tlv_tag == WIFIRX_MPDU_START_E ? true : false;
 }
 
-static inline
-uint32_t HAL_RX_HW_DESC_GET_PPDUID_GET(void *hw_desc_addr)
-{
-	struct rx_mpdu_info *rx_mpdu_info;
-	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
-
-	rx_mpdu_info =
-		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
-
-	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_0, PHY_PPDU_ID);
-}
 
 /* TODO: Move all Rx descriptor functions to hal_rx.h to avoid duplication */
 

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

@@ -407,6 +407,7 @@ struct hal_hw_txrx_ops {
 	uint8_t (*hal_rx_get_mpdu_sequence_control_valid)(uint8_t *buf);
 	bool (*hal_rx_is_unicast)(uint8_t *buf);
 	uint32_t (*hal_rx_tid_get)(hal_soc_handle_t hal_soc_hdl, uint8_t *buf);
+	uint32_t (*hal_rx_hw_desc_get_ppduid_get)(void *hw_desc_addr);
 };
 
 /**

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

@@ -3313,4 +3313,20 @@ static inline void hal_rx_msdu_get_flow_params(uint8_t *buf,
 	*flow_timeout = HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
 	*flow_index = HAL_RX_MSDU_END_FLOW_IDX_GET(msdu_end);
 }
+
+/**
+ * hal_rx_hw_desc_get_ppduid_get() - Retrieve ppdu id
+ * @hal_soc_hdl: hal_soc handle
+ * @hw_desc_addr: hardware descriptor address
+ *
+ * Return: 0 - success/ non-zero failure
+ */
+static inline
+uint32_t hal_rx_hw_desc_get_ppduid_get(hal_soc_handle_t hal_soc_hdl,
+				       void *hw_desc_addr)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	return hal_soc->ops->hal_rx_hw_desc_get_ppduid_get(hw_desc_addr);
+}
 #endif /* _HAL_RX_H */

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

@@ -592,6 +592,24 @@ static uint32_t hal_rx_tid_get_6290(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 
 	return HAL_RX_NON_QOS_TID;
 }
+
+/**
+ * hal_rx_hw_desc_get_ppduid_get_6290(): retrieve ppdu id
+ * @hw_desc_addr: hw addr
+ *
+ * Return: ppdu id
+ */
+static uint32_t hal_rx_hw_desc_get_ppduid_get_6290(void *hw_desc_addr)
+{
+	struct rx_mpdu_info *rx_mpdu_info;
+	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
+
+	rx_mpdu_info =
+		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
+
+	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_0, PHY_PPDU_ID);
+}
+
 struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -656,6 +674,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_sequence_control_valid_6290,
 	hal_rx_is_unicast_6290,
 	hal_rx_tid_get_6290,
+	hal_rx_hw_desc_get_ppduid_get_6290,
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

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

@@ -590,6 +590,23 @@ static uint32_t hal_rx_tid_get_6390(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 
 	return HAL_RX_NON_QOS_TID;
 }
+
+/**
+ * hal_rx_hw_desc_get_ppduid_get_6390(): retrieve ppdu id
+ * @hw_desc_addr: hw addr
+ *
+ * Return: ppdu id
+ */
+static uint32_t hal_rx_hw_desc_get_ppduid_get_6390(void *hw_desc_addr)
+{
+	struct rx_mpdu_info *rx_mpdu_info;
+	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
+
+	rx_mpdu_info =
+		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
+
+	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_0, PHY_PPDU_ID);
+}
 struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	/* init and setup */
 	hal_srng_dst_hw_init_generic,
@@ -654,6 +671,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_sequence_control_valid_6390,
 	hal_rx_is_unicast_6390,
 	hal_rx_tid_get_6390,
+	hal_rx_hw_desc_get_ppduid_get_6390,
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

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

@@ -496,6 +496,23 @@ static uint32_t hal_rx_tid_get_6490(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 
 	return HAL_RX_NON_QOS_TID;
 }
+
+/**
+ * hal_rx_hw_desc_get_ppduid_get_6490(): retrieve ppdu id
+ * @hw_desc_addr: hw addr
+ *
+ * Return: ppdu id
+ */
+static uint32_t hal_rx_hw_desc_get_ppduid_get_6490(void *hw_desc_addr)
+{
+	struct rx_mpdu_info *rx_mpdu_info;
+	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
+
+	rx_mpdu_info =
+		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
+
+	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_9, PHY_PPDU_ID);
+}
 struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	/* rx */
 	hal_rx_get_rx_fragment_number_6490,
@@ -520,4 +537,5 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_sequence_control_valid_6490,
 	hal_rx_is_unicast_6490,
 	hal_rx_tid_get_6490,
+	hal_rx_hw_desc_get_ppduid_get_6490,
 };

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

@@ -588,6 +588,23 @@ static uint32_t hal_rx_tid_get_8074v1(hal_soc_handle_t hal_soc_hdl,
 
 	return HAL_RX_NON_QOS_TID;
 }
+
+/**
+ * hal_rx_hw_desc_get_ppduid_get_8074v1(): retrieve ppdu id
+ * @hw_desc_addr: hw addr
+ *
+ * Return: ppdu id
+ */
+static uint32_t hal_rx_hw_desc_get_ppduid_get_8074v1(void *hw_desc_addr)
+{
+	struct rx_mpdu_info *rx_mpdu_info;
+	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
+
+	rx_mpdu_info =
+		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
+
+	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_0, PHY_PPDU_ID);
+}
 struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -653,6 +670,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_sequence_control_valid_8074v1,
 	hal_rx_is_unicast_8074v1,
 	hal_rx_tid_get_8074v1,
+	hal_rx_hw_desc_get_ppduid_get_8074v1,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

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

@@ -585,6 +585,23 @@ static uint32_t hal_rx_tid_get_8074v2(hal_soc_handle_t hal_soc_hdl,
 
 	return HAL_RX_NON_QOS_TID;
 }
+
+/**
+ * hal_rx_hw_desc_get_ppduid_get_8074v2(): retrieve ppdu id
+ * @hw_desc_addr: hw addr
+ *
+ * Return: ppdu id
+ */
+static uint32_t hal_rx_hw_desc_get_ppduid_get_8074v2(void *hw_desc_addr)
+{
+	struct rx_mpdu_info *rx_mpdu_info;
+	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
+
+	rx_mpdu_info =
+		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
+
+	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_0, PHY_PPDU_ID);
+}
 struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -650,6 +667,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_sequence_control_valid_8074v2,
 	hal_rx_is_unicast_8074v2,
 	hal_rx_tid_get_8074v2,
+	hal_rx_hw_desc_get_ppduid_get_8074v2,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

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

@@ -594,6 +594,23 @@ static uint32_t hal_rx_tid_get_9000(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 
 	return HAL_RX_NON_QOS_TID;
 }
+
+/**
+ * hal_rx_hw_desc_get_ppduid_get_9000(): retrieve ppdu id
+ * @hw_desc_addr: hw addr
+ *
+ * Return: ppdu id
+ */
+static uint32_t hal_rx_hw_desc_get_ppduid_get_9000(void *hw_desc_addr)
+{
+	struct rx_mpdu_info *rx_mpdu_info;
+	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
+
+	rx_mpdu_info =
+		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
+
+	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_0, PHY_PPDU_ID);
+}
 struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 
 	/* init and setup */
@@ -659,6 +676,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_rx_get_mpdu_sequence_control_valid_9000,
 	hal_rx_is_unicast_9000,
 	hal_rx_tid_get_9000,
+	hal_rx_hw_desc_get_ppduid_get_9000,
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {