Explorar el Código

qcacmn: Get Rx TLV offsets from structure

Size of the TLVs have changed across generation of chipsets
Offset values need to be configured into DMA register for preheader DMA
Added APIs to get offsets of each TLV based on chip type

Change-Id: Ic011332cbf3a1017f324f246e47c9e2c91441c70
Radha Krishna Simha Jiguru hace 5 años
padre
commit
8ca2521ac8

+ 5 - 5
dp/wifi3.0/dp_main.c

@@ -5055,15 +5055,15 @@ dp_rxdma_ring_sel_cfg(struct dp_soc *soc)
 	/*Not subscribing rx_pkt_header*/
 	htt_tlv_filter.rx_header_offset = 0;
 	htt_tlv_filter.rx_mpdu_start_offset =
-				HAL_RX_PKT_TLV_MPDU_START_OFFSET(soc->hal_soc);
+				hal_rx_mpdu_start_offset_get(soc->hal_soc);
 	htt_tlv_filter.rx_mpdu_end_offset =
-				HAL_RX_PKT_TLV_MPDU_END_OFFSET(soc->hal_soc);
+				hal_rx_mpdu_end_offset_get(soc->hal_soc);
 	htt_tlv_filter.rx_msdu_start_offset =
-				HAL_RX_PKT_TLV_MSDU_START_OFFSET(soc->hal_soc);
+				hal_rx_msdu_start_offset_get(soc->hal_soc);
 	htt_tlv_filter.rx_msdu_end_offset =
-				HAL_RX_PKT_TLV_MSDU_END_OFFSET(soc->hal_soc);
+				hal_rx_msdu_end_offset_get(soc->hal_soc);
 	htt_tlv_filter.rx_attn_offset =
-				HAL_RX_PKT_TLV_ATTN_OFFSET(soc->hal_soc);
+				hal_rx_attn_offset_get(soc->hal_soc);
 
 	for (i = 0; i < MAX_PDEV_CNT; i++) {
 		struct dp_pdev *pdev = soc->pdev_list[i];

+ 61 - 1
hal/wifi3.0/hal_generic_api.h

@@ -2465,4 +2465,64 @@ hal_rx_msdu_packet_metadata_get_generic(uint8_t *buf,
 	msdu_metadata->sa_sw_peer_id =
 		HAL_RX_MSDU_END_SA_SW_PEER_ID_GET(msdu_end);
 }
-#endif /* _HAL_GENERIC_API_H_ */
+
+/**
+ * hal_rx_msdu_end_offset_get_generic(): API to get the
+ * msdu_end structure offset rx_pkt_tlv structure
+ *
+ * NOTE: API returns offset of msdu_end TLV from structure
+ * rx_pkt_tlvs
+ */
+static uint32_t hal_rx_msdu_end_offset_get_generic(void)
+{
+	return RX_PKT_TLV_OFFSET(msdu_end_tlv);
+}
+
+/**
+ * hal_rx_attn_offset_get_generic(): API to get the
+ * msdu_end structure offset rx_pkt_tlv structure
+ *
+ * NOTE: API returns offset of attn TLV from structure
+ * rx_pkt_tlvs
+ */
+static uint32_t hal_rx_attn_offset_get_generic(void)
+{
+	return RX_PKT_TLV_OFFSET(attn_tlv);
+}
+
+/**
+ * hal_rx_msdu_start_offset_get_generic(): API to get the
+ * msdu_start structure offset rx_pkt_tlv structure
+ *
+ * NOTE: API returns offset of attn TLV from structure
+ * rx_pkt_tlvs
+ */
+static uint32_t hal_rx_msdu_start_offset_get_generic(void)
+{
+	return RX_PKT_TLV_OFFSET(msdu_start_tlv);
+}
+
+/**
+ * hal_rx_mpdu_start_offset_get_generic(): API to get the
+ * mpdu_start structure offset rx_pkt_tlv structure
+ *
+ * NOTE: API returns offset of attn TLV from structure
+ * rx_pkt_tlvs
+ */
+static uint32_t	hal_rx_mpdu_start_offset_get_generic(void)
+{
+	return RX_PKT_TLV_OFFSET(mpdu_start_tlv);
+}
+
+/**
+ * hal_rx_mpdu_end_offset_get_generic(): API to get the
+ * mpdu_end structure offset rx_pkt_tlv structure
+ *
+ * NOTE: API returns offset of attn TLV from structure
+ * rx_pkt_tlvs
+ */
+static uint32_t	hal_rx_mpdu_end_offset_get_generic(void)
+{
+	return RX_PKT_TLV_OFFSET(mpdu_end_tlv);
+}
+#endif /* HAL_GENERIC_API_H_ */

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

@@ -594,6 +594,11 @@ struct hal_hw_txrx_ops {
 	void (*hal_rx_sw_mon_desc_info_get)(hal_ring_desc_t rxdma_dst_ring_desc,
 					    hal_rx_mon_desc_info_t mon_desc_info);
 	uint8_t (*hal_rx_wbm_err_msdu_continuation_get)(void *ring_desc);
+	uint32_t (*hal_rx_msdu_end_offset_get)(void);
+	uint32_t (*hal_rx_attn_offset_get)(void);
+	uint32_t (*hal_rx_msdu_start_offset_get)(void);
+	uint32_t (*hal_rx_mpdu_start_offset_get)(void);
+	uint32_t (*hal_rx_mpdu_end_offset_get)(void);
 };
 
 /**

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

@@ -3731,4 +3731,109 @@ bool hal_rx_is_buf_addr_info_valid(
 	return (HAL_RX_BUFFER_ADDR_31_0_GET(buf_addr_info) == 0) ?
 						false : true;
 }
+
+/**
+ * hal_rx_msdu_end_offset_get(): Get the MSDU end offset from
+ * rx_pkt_tlvs structure
+ *
+ * @hal_soc_hdl: HAL SOC handle
+ * return: msdu_end_tlv offset value
+ */
+static inline
+uint32_t hal_rx_msdu_end_offset_get(hal_soc_handle_t hal_soc_hdl)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	if (!hal_soc || !hal_soc->ops) {
+		hal_err("hal handle is NULL");
+		QDF_BUG(0);
+		return 0;
+	}
+
+	return hal_soc->ops->hal_rx_msdu_end_offset_get();
+}
+
+/**
+ * hal_rx_msdu_start_offset_get(): Get the MSDU start offset from
+ * rx_pkt_tlvs structure
+ *
+ * @hal_soc_hdl: HAL SOC handle
+ * return: msdu_start_tlv offset value
+ */
+static inline
+uint32_t hal_rx_msdu_start_offset_get(hal_soc_handle_t hal_soc_hdl)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	if (!hal_soc || !hal_soc->ops) {
+		hal_err("hal handle is NULL");
+		QDF_BUG(0);
+		return 0;
+	}
+
+	return hal_soc->ops->hal_rx_msdu_start_offset_get();
+}
+
+/**
+ * hal_rx_mpdu_start_offset_get(): Get the MPDU start offset from
+ * rx_pkt_tlvs structure
+ *
+ * @hal_soc_hdl: HAL SOC handle
+ * return: mpdu_start_tlv offset value
+ */
+static inline
+uint32_t hal_rx_mpdu_start_offset_get(hal_soc_handle_t hal_soc_hdl)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	if (!hal_soc || !hal_soc->ops) {
+		hal_err("hal handle is NULL");
+		QDF_BUG(0);
+		return 0;
+	}
+
+	return hal_soc->ops->hal_rx_mpdu_start_offset_get();
+}
+
+/**
+ * hal_rx_mpdu_end_offset_get(): Get the MPDU end offset from
+ * rx_pkt_tlvs structure
+ *
+ * @hal_soc_hdl: HAL SOC handle
+ * return: mpdu_end_tlv offset value
+ */
+static inline
+uint32_t hal_rx_mpdu_end_offset_get(hal_soc_handle_t hal_soc_hdl)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	if (!hal_soc || !hal_soc->ops) {
+		hal_err("hal handle is NULL");
+		QDF_BUG(0);
+		return 0;
+	}
+
+	return hal_soc->ops->hal_rx_mpdu_end_offset_get();
+}
+
+/**
+ * hal_rx_attn_offset_get(): Get the ATTENTION offset from
+ * rx_pkt_tlvs structure
+ *
+ * @hal_soc_hdl: HAL SOC handle
+ * return: attn_tlv offset value
+ */
+static inline
+uint32_t hal_rx_attn_offset_get(hal_soc_handle_t hal_soc_hdl)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	if (!hal_soc || !hal_soc->ops) {
+		hal_err("hal handle is NULL");
+		QDF_BUG(0);
+		return 0;
+	}
+
+	return hal_soc->ops->hal_rx_attn_offset_get();
+}
 #endif /* _HAL_RX_H */

+ 16 - 0
hal/wifi3.0/qca5018/hal_5018.c

@@ -1436,6 +1436,22 @@ struct hal_hw_txrx_ops qca5018_hal_hw_txrx_ops = {
 	hal_rx_get_rx_sequence_5018,
 	NULL,
 	NULL,
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	NULL,
+	/* rx - TLV struct offsets */
+	hal_rx_msdu_end_offset_get_generic,
+	hal_rx_attn_offset_get_generic,
+	hal_rx_msdu_start_offset_get_generic,
+	hal_rx_mpdu_start_offset_get_generic,
+	hal_rx_mpdu_end_offset_get_generic
 };
 
 struct hal_hw_srng_config hw_srng_table_5018[] = {

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

@@ -1092,6 +1092,15 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	NULL,
 	NULL,
 	NULL,
+	NULL,
+	NULL,
+	NULL,
+	/* rx - TLV struct offsets */
+	hal_rx_msdu_end_offset_get_generic,
+	hal_rx_attn_offset_get_generic,
+	hal_rx_msdu_start_offset_get_generic,
+	hal_rx_mpdu_start_offset_get_generic,
+	hal_rx_mpdu_end_offset_get_generic
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

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

@@ -1128,6 +1128,14 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	NULL,
 	NULL,
 	NULL,
+	NULL,
+
+	/* rx - TLV struct offsets */
+	hal_rx_msdu_end_offset_get_generic,
+	hal_rx_attn_offset_get_generic,
+	hal_rx_msdu_start_offset_get_generic,
+	hal_rx_mpdu_start_offset_get_generic,
+	hal_rx_mpdu_end_offset_get_generic
 };
 
 struct hal_hw_srng_config hw_srng_table_6390[] = {

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

@@ -1555,6 +1555,14 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = {
 	hal_rx_get_fisa_timeout_6490,
 	NULL,
 	NULL,
+	NULL,
+
+	/* rx - TLV struct offsets */
+	hal_rx_msdu_end_offset_get_generic,
+	hal_rx_attn_offset_get_generic,
+	hal_rx_msdu_start_offset_get_generic,
+	hal_rx_mpdu_start_offset_get_generic,
+	hal_rx_mpdu_end_offset_get_generic
 };
 
 struct hal_hw_srng_config hw_srng_table_6490[] = {

+ 8 - 0
hal/wifi3.0/qca6750/hal_6750.c

@@ -1424,6 +1424,14 @@ struct hal_hw_txrx_ops qca6750_hal_hw_txrx_ops = {
 	NULL,
 	NULL,
 	NULL,
+	NULL,
+
+	/* rx - TLV struct offsets */
+	hal_rx_msdu_end_offset_get_generic,
+	hal_rx_attn_offset_get_generic,
+	hal_rx_msdu_start_offset_get_generic,
+	hal_rx_mpdu_start_offset_get_generic,
+	hal_rx_mpdu_end_offset_get_generic
 };
 
 struct hal_hw_srng_config hw_srng_table_6750[] = {

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

@@ -1115,6 +1115,14 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	NULL,
 	hal_rx_mpdu_start_tlv_tag_valid_8074v1,
 	NULL,
+	NULL,
+
+	/* rx - TLV struct offsets */
+	hal_rx_msdu_end_offset_get_generic,
+	hal_rx_attn_offset_get_generic,
+	hal_rx_msdu_start_offset_get_generic,
+	hal_rx_mpdu_start_offset_get_generic,
+	hal_rx_mpdu_end_offset_get_generic
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {

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

@@ -1118,6 +1118,14 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	NULL,
 	hal_rx_mpdu_start_tlv_tag_valid_8074v2,
 	NULL,
+	NULL,
+
+	/* rx - TLV struct offsets */
+	hal_rx_msdu_end_offset_get_generic,
+	hal_rx_attn_offset_get_generic,
+	hal_rx_msdu_start_offset_get_generic,
+	hal_rx_mpdu_start_offset_get_generic,
+	hal_rx_mpdu_end_offset_get_generic
 };
 
 struct hal_hw_srng_config hw_srng_table_8074v2[] = {

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

@@ -1568,6 +1568,13 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_rx_mpdu_start_tlv_tag_valid_9000,
 	hal_rx_sw_mon_desc_info_get_9000,
 	hal_rx_wbm_err_msdu_continuation_get_9000,
+
+	/* rx - TLV struct offsets */
+	hal_rx_msdu_end_offset_get_generic,
+	hal_rx_attn_offset_get_generic,
+	hal_rx_msdu_start_offset_get_generic,
+	hal_rx_mpdu_start_offset_get_generic,
+	hal_rx_mpdu_end_offset_get_generic
 };
 
 struct hal_hw_srng_config hw_srng_table_9000[] = {