Forráskód Böngészése

qcacmn: introduce few target specific hal functions

make hal_rx_msdu_end_sa_idx_get and hal_rx_dump_msdu_end_tlv
routines target specific as qca6390 implementation differs
a bit. add target specific functions for qca6290 and qca8074

Change-Id: Ie05b91d965bae3642e3264620c6d8427ad368044
Balamurugan Mahalingam 6 éve
szülő
commit
97ad1061a3

+ 1 - 1
dp/wifi3.0/dp_rx.h

@@ -420,7 +420,7 @@ dp_rx_wds_srcport_learn(struct dp_soc *soc,
 	/*
 	 * Get the AST entry from HW SA index and mark it as active
 	 */
-	sa_idx = hal_rx_msdu_end_sa_idx_get(rx_tlv_hdr);
+	sa_idx = hal_rx_msdu_end_sa_idx_get(soc->hal_soc, rx_tlv_hdr);
 
 	qdf_spin_lock_bh(&soc->ast_lock);
 	ast = soc->ast_table[sa_idx];

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

@@ -107,7 +107,7 @@ static inline bool dp_rx_mcast_echo_check(struct dp_soc *soc,
 	 */
 	qdf_spin_lock_bh(&soc->ast_lock);
 	if (hal_rx_msdu_end_sa_is_valid_get(rx_tlv_hdr)) {
-		sa_idx = hal_rx_msdu_end_sa_idx_get(rx_tlv_hdr);
+		sa_idx = hal_rx_msdu_end_sa_idx_get(soc->hal_soc, rx_tlv_hdr);
 
 		if ((sa_idx < 0) ||
 				(sa_idx >= (WLAN_UMAC_PSOC_MAX_PEERS * 2))) {

+ 8 - 112
dp/wifi3.0/hal_rx.h

@@ -1030,13 +1030,7 @@ hal_rx_msdu_end_l3_hdr_padding_get(uint8_t *buf)
 	return l3_header_padding;
 }
 
-#define HAL_RX_MSDU_END_SA_IDX_GET(_rx_msdu_end)	\
-	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
-		RX_MSDU_END_13_SA_IDX_OFFSET)),	\
-		RX_MSDU_END_13_SA_IDX_MASK,		\
-		RX_MSDU_END_13_SA_IDX_LSB))
-
- /**
+/**
  * hal_rx_msdu_end_sa_idx_get(): API to get the
  * sa_idx from rx_msdu_end TLV
  *
@@ -1044,15 +1038,9 @@ hal_rx_msdu_end_l3_hdr_padding_get(uint8_t *buf)
  * Return: sa_idx (SA AST index)
  */
 static inline uint16_t
-hal_rx_msdu_end_sa_idx_get(uint8_t *buf)
+hal_rx_msdu_end_sa_idx_get(struct hal_soc *hal_soc, uint8_t *buf)
 {
-	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
-	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
-	uint16_t sa_idx;
-
-	sa_idx = HAL_RX_MSDU_END_SA_IDX_GET(msdu_end);
-
-	return sa_idx;
+	return hal_soc->ops->hal_rx_msdu_end_sa_idx_get(buf);
 }
 
 #define HAL_RX_MSDU_END_SA_IS_VALID_GET(_rx_msdu_end)	\
@@ -2711,103 +2699,11 @@ uint8_t dbg_level)
  *
  * Return: void
  */
-static inline void hal_rx_dump_msdu_end_tlv(struct rx_msdu_end *msdu_end,
-							uint8_t dbg_level)
+static inline void hal_rx_dump_msdu_end_tlv(struct hal_soc *hal_soc,
+					    struct rx_msdu_end *msdu_end,
+					    uint8_t dbg_level)
 {
-	QDF_TRACE(QDF_MODULE_ID_DP, dbg_level,
-			"rx_msdu_end tlv - "
-			"rxpcu_mpdu_filter_in_category: %d "
-			"sw_frame_group_id: %d "
-			"phy_ppdu_id: %d "
-			"ip_hdr_chksum: %d "
-			"tcp_udp_chksum: %d "
-			"key_id_octet: %d "
-			"cce_super_rule: %d "
-			"cce_classify_not_done_truncat: %d "
-			"cce_classify_not_done_cce_dis: %d "
-			"ext_wapi_pn_63_48: %d "
-			"ext_wapi_pn_95_64: %d "
-			"ext_wapi_pn_127_96: %d "
-			"reported_mpdu_length: %d "
-			"first_msdu: %d "
-			"last_msdu: %d "
-			"sa_idx_timeout: %d "
-			"da_idx_timeout: %d "
-			"msdu_limit_error: %d "
-			"flow_idx_timeout: %d "
-			"flow_idx_invalid: %d "
-			"wifi_parser_error: %d "
-			"amsdu_parser_error: %d "
-			"sa_is_valid: %d "
-			"da_is_valid: %d "
-			"da_is_mcbc: %d "
-			"l3_header_padding: %d "
-			"ipv6_options_crc: %d "
-			"tcp_seq_number: %d "
-			"tcp_ack_number: %d "
-			"tcp_flag: %d "
-			"lro_eligible: %d "
-			"window_size: %d "
-			"da_offset: %d "
-			"sa_offset: %d "
-			"da_offset_valid: %d "
-			"sa_offset_valid: %d "
-			"rule_indication_31_0: %d "
-			"rule_indication_63_32: %d "
-			"sa_idx: %d "
-			"da_idx: %d "
-			"msdu_drop: %d "
-			"reo_destination_indication: %d "
-			"flow_idx: %d "
-			"fse_metadata: %d "
-			"cce_metadata: %d "
-			"sa_sw_peer_id: %d ",
-			msdu_end->rxpcu_mpdu_filter_in_category,
-			msdu_end->sw_frame_group_id,
-			msdu_end->phy_ppdu_id,
-			msdu_end->ip_hdr_chksum,
-			msdu_end->tcp_udp_chksum,
-			msdu_end->key_id_octet,
-			msdu_end->cce_super_rule,
-			msdu_end->cce_classify_not_done_truncate,
-			msdu_end->cce_classify_not_done_cce_dis,
-			msdu_end->ext_wapi_pn_63_48,
-			msdu_end->ext_wapi_pn_95_64,
-			msdu_end->ext_wapi_pn_127_96,
-			msdu_end->reported_mpdu_length,
-			msdu_end->first_msdu,
-			msdu_end->last_msdu,
-			msdu_end->sa_idx_timeout,
-			msdu_end->da_idx_timeout,
-			msdu_end->msdu_limit_error,
-			msdu_end->flow_idx_timeout,
-			msdu_end->flow_idx_invalid,
-			msdu_end->wifi_parser_error,
-			msdu_end->amsdu_parser_error,
-			msdu_end->sa_is_valid,
-			msdu_end->da_is_valid,
-			msdu_end->da_is_mcbc,
-			msdu_end->l3_header_padding,
-			msdu_end->ipv6_options_crc,
-			msdu_end->tcp_seq_number,
-			msdu_end->tcp_ack_number,
-			msdu_end->tcp_flag,
-			msdu_end->lro_eligible,
-			msdu_end->window_size,
-			msdu_end->da_offset,
-			msdu_end->sa_offset,
-			msdu_end->da_offset_valid,
-			msdu_end->sa_offset_valid,
-			msdu_end->rule_indication_31_0,
-			msdu_end->rule_indication_63_32,
-			msdu_end->sa_idx,
-			msdu_end->da_idx,
-			msdu_end->msdu_drop,
-			msdu_end->reo_destination_indication,
-			msdu_end->flow_idx,
-			msdu_end->fse_metadata,
-			msdu_end->cce_metadata,
-			msdu_end->sa_sw_peer_id);
+	hal_soc->ops->hal_rx_dump_msdu_end_tlv(msdu_end, dbg_level);
 }
 
 /**
@@ -3496,7 +3392,7 @@ static inline void hal_rx_dump_pkt_tlvs(struct hal_soc *hal_soc,
 	hal_rx_dump_mpdu_start_tlv(mpdu_start, dbg_level);
 	hal_rx_dump_msdu_start_tlv(hal_soc, msdu_start, dbg_level);
 	hal_rx_dump_mpdu_end_tlv(mpdu_end, dbg_level);
-	hal_rx_dump_msdu_end_tlv(msdu_end, dbg_level);
+	hal_rx_dump_msdu_end_tlv(hal_soc, msdu_end, dbg_level);
 	hal_rx_dump_pkt_hdr_tlv(pkt_hdr_tlv, dbg_level);
 }
 

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

@@ -290,9 +290,12 @@ struct hal_hw_txrx_ops {
 	void (*hal_rx_proc_phyrx_other_receive_info_tlv)(void *rx_tlv_hdr,
 							void *ppdu_info_handle);
 	void (*hal_rx_dump_msdu_start_tlv)(void *msdu_start, uint8_t dbg_level);
+	void (*hal_rx_dump_msdu_end_tlv)(void *msdu_end,
+					 uint8_t dbg_level);
 	uint32_t (*hal_get_link_desc_size)(void);
 	uint32_t (*hal_rx_mpdu_start_tid_get)(uint8_t *buf);
 	uint32_t (*hal_rx_msdu_start_reception_type_get)(uint8_t *buf);
+	uint16_t (*hal_rx_msdu_end_sa_idx_get)(uint8_t *buf);
 };
 
 /**

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

@@ -296,6 +296,117 @@ void hal_rx_dump_msdu_start_tlv_6290(void *msdustart,   uint8_t dbg_level)
 
 qdf_export_symbol(hal_rx_dump_msdu_start_tlv_6290);
 
+/**
+ * hal_rx_dump_msdu_end_tlv_6290: dump RX msdu_end TLV in structured
+ *			     human readable format.
+ * @ msdu_end: pointer the msdu_end TLV in pkt.
+ * @ dbg_level: log level.
+ *
+ * Return: void
+ */
+void hal_rx_dump_msdu_end_tlv_6290(void *msduend,
+				   uint8_t dbg_level)
+{
+	struct rx_msdu_end *msdu_end = (struct rx_msdu_end *)msduend;
+
+	QDF_TRACE(QDF_MODULE_ID_DP, dbg_level,
+			"rx_msdu_end tlv - "
+			"rxpcu_mpdu_filter_in_category: %d "
+			"sw_frame_group_id: %d "
+			"phy_ppdu_id: %d "
+			"ip_hdr_chksum: %d "
+			"tcp_udp_chksum: %d "
+			"key_id_octet: %d "
+			"cce_super_rule: %d "
+			"cce_classify_not_done_truncat: %d "
+			"cce_classify_not_done_cce_dis: %d "
+			"ext_wapi_pn_63_48: %d "
+			"ext_wapi_pn_95_64: %d "
+			"ext_wapi_pn_127_96: %d "
+			"reported_mpdu_length: %d "
+			"first_msdu: %d "
+			"last_msdu: %d "
+			"sa_idx_timeout: %d "
+			"da_idx_timeout: %d "
+			"msdu_limit_error: %d "
+			"flow_idx_timeout: %d "
+			"flow_idx_invalid: %d "
+			"wifi_parser_error: %d "
+			"amsdu_parser_error: %d "
+			"sa_is_valid: %d "
+			"da_is_valid: %d "
+			"da_is_mcbc: %d "
+			"l3_header_padding: %d "
+			"ipv6_options_crc: %d "
+			"tcp_seq_number: %d "
+			"tcp_ack_number: %d "
+			"tcp_flag: %d "
+			"lro_eligible: %d "
+			"window_size: %d "
+			"da_offset: %d "
+			"sa_offset: %d "
+			"da_offset_valid: %d "
+			"sa_offset_valid: %d "
+			"rule_indication_31_0: %d "
+			"rule_indication_63_32: %d "
+			"sa_idx: %d "
+			"da_idx: %d "
+			"msdu_drop: %d "
+			"reo_destination_indication: %d "
+			"flow_idx: %d "
+			"fse_metadata: %d "
+			"cce_metadata: %d "
+			"sa_sw_peer_id: %d ",
+			msdu_end->rxpcu_mpdu_filter_in_category,
+			msdu_end->sw_frame_group_id,
+			msdu_end->phy_ppdu_id,
+			msdu_end->ip_hdr_chksum,
+			msdu_end->tcp_udp_chksum,
+			msdu_end->key_id_octet,
+			msdu_end->cce_super_rule,
+			msdu_end->cce_classify_not_done_truncate,
+			msdu_end->cce_classify_not_done_cce_dis,
+			msdu_end->ext_wapi_pn_63_48,
+			msdu_end->ext_wapi_pn_95_64,
+			msdu_end->ext_wapi_pn_127_96,
+			msdu_end->reported_mpdu_length,
+			msdu_end->first_msdu,
+			msdu_end->last_msdu,
+			msdu_end->sa_idx_timeout,
+			msdu_end->da_idx_timeout,
+			msdu_end->msdu_limit_error,
+			msdu_end->flow_idx_timeout,
+			msdu_end->flow_idx_invalid,
+			msdu_end->wifi_parser_error,
+			msdu_end->amsdu_parser_error,
+			msdu_end->sa_is_valid,
+			msdu_end->da_is_valid,
+			msdu_end->da_is_mcbc,
+			msdu_end->l3_header_padding,
+			msdu_end->ipv6_options_crc,
+			msdu_end->tcp_seq_number,
+			msdu_end->tcp_ack_number,
+			msdu_end->tcp_flag,
+			msdu_end->lro_eligible,
+			msdu_end->window_size,
+			msdu_end->da_offset,
+			msdu_end->sa_offset,
+			msdu_end->da_offset_valid,
+			msdu_end->sa_offset_valid,
+			msdu_end->rule_indication_31_0,
+			msdu_end->rule_indication_63_32,
+			msdu_end->sa_idx,
+			msdu_end->da_idx,
+			msdu_end->msdu_drop,
+			msdu_end->reo_destination_indication,
+			msdu_end->flow_idx,
+			msdu_end->fse_metadata,
+			msdu_end->cce_metadata,
+			msdu_end->sa_sw_peer_id);
+}
+
+qdf_export_symbol(hal_rx_dump_msdu_end_tlv_6290);
+
 /*
  * Get tid from RX_MPDU_START
  */
@@ -346,3 +457,27 @@ uint32_t hal_rx_msdu_start_reception_type_get_6290(uint8_t *buf)
 
 qdf_export_symbol(hal_rx_msdu_start_reception_type_get_6290);
 
+#define HAL_RX_MSDU_END_DA_IDX_GET(_rx_msdu_end)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
+		RX_MSDU_END_13_DA_IDX_OFFSET)),		\
+		RX_MSDU_END_13_DA_IDX_MASK,		\
+		RX_MSDU_END_13_DA_IDX_LSB))
+
+/**
+ * hal_rx_msdu_end_da_idx_get_6290: API to get da_idx
+ * from rx_msdu_end TLV
+ *
+ * @ buf: pointer to the start of RX PKT TLV headers
+ * Return: da index
+ */
+uint16_t hal_rx_msdu_end_da_idx_get_6290(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+	uint16_t da_idx;
+
+	da_idx = HAL_RX_MSDU_END_DA_IDX_GET(msdu_end);
+
+	return da_idx;
+}
+

+ 2 - 0
hal/wifi3.0/qca6290/hal_6290_srng.c

@@ -55,9 +55,11 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_rx_get_tlv_6290,
 	hal_rx_proc_phyrx_other_receive_info_tlv_6290,
 	hal_rx_dump_msdu_start_tlv_6290,
+	hal_rx_dump_msdu_end_tlv_6290,
 	hal_get_link_desc_size_6290,
 	hal_rx_mpdu_start_tid_get_6290,
 	hal_rx_msdu_start_reception_type_get_6290,
+	hal_rx_msdu_end_da_idx_get_6290,
 };
 
 struct hal_hw_srng_config hw_srng_table_6290[] = {

+ 135 - 1
hal/wifi3.0/qca8074/hal_8074_rx.h

@@ -158,7 +158,7 @@ qdf_export_symbol(hal_rx_proc_phyrx_other_receive_info_tlv_8074);
  * Return: void
  */
 void hal_rx_dump_msdu_start_tlv_8074(void *msdustart,
-							uint8_t dbg_level)
+				     uint8_t dbg_level)
 {
 	struct rx_msdu_start *msdu_start = (struct rx_msdu_start *)msdustart;
 
@@ -230,6 +230,117 @@ void hal_rx_dump_msdu_start_tlv_8074(void *msdustart,
 
 qdf_export_symbol(hal_rx_dump_msdu_start_tlv_8074);
 
+/**
+ * hal_rx_dump_msdu_end_tlv_8074: dump RX msdu_end TLV in structured
+ *			     human readable format.
+ * @ msdu_end: pointer the msdu_end TLV in pkt.
+ * @ dbg_level: log level.
+ *
+ * Return: void
+ */
+void hal_rx_dump_msdu_end_tlv_8074(void *msduend,
+				   uint8_t dbg_level)
+{
+	struct rx_msdu_end *msdu_end = (struct rx_msdu_end *)msduend;
+
+	QDF_TRACE(QDF_MODULE_ID_DP, dbg_level,
+			"rx_msdu_end tlv - "
+			"rxpcu_mpdu_filter_in_category: %d "
+			"sw_frame_group_id: %d "
+			"phy_ppdu_id: %d "
+			"ip_hdr_chksum: %d "
+			"tcp_udp_chksum: %d "
+			"key_id_octet: %d "
+			"cce_super_rule: %d "
+			"cce_classify_not_done_truncat: %d "
+			"cce_classify_not_done_cce_dis: %d "
+			"ext_wapi_pn_63_48: %d "
+			"ext_wapi_pn_95_64: %d "
+			"ext_wapi_pn_127_96: %d "
+			"reported_mpdu_length: %d "
+			"first_msdu: %d "
+			"last_msdu: %d "
+			"sa_idx_timeout: %d "
+			"da_idx_timeout: %d "
+			"msdu_limit_error: %d "
+			"flow_idx_timeout: %d "
+			"flow_idx_invalid: %d "
+			"wifi_parser_error: %d "
+			"amsdu_parser_error: %d "
+			"sa_is_valid: %d "
+			"da_is_valid: %d "
+			"da_is_mcbc: %d "
+			"l3_header_padding: %d "
+			"ipv6_options_crc: %d "
+			"tcp_seq_number: %d "
+			"tcp_ack_number: %d "
+			"tcp_flag: %d "
+			"lro_eligible: %d "
+			"window_size: %d "
+			"da_offset: %d "
+			"sa_offset: %d "
+			"da_offset_valid: %d "
+			"sa_offset_valid: %d "
+			"rule_indication_31_0: %d "
+			"rule_indication_63_32: %d "
+			"sa_idx: %d "
+			"da_idx: %d "
+			"msdu_drop: %d "
+			"reo_destination_indication: %d "
+			"flow_idx: %d "
+			"fse_metadata: %d "
+			"cce_metadata: %d "
+			"sa_sw_peer_id: %d ",
+			msdu_end->rxpcu_mpdu_filter_in_category,
+			msdu_end->sw_frame_group_id,
+			msdu_end->phy_ppdu_id,
+			msdu_end->ip_hdr_chksum,
+			msdu_end->tcp_udp_chksum,
+			msdu_end->key_id_octet,
+			msdu_end->cce_super_rule,
+			msdu_end->cce_classify_not_done_truncate,
+			msdu_end->cce_classify_not_done_cce_dis,
+			msdu_end->ext_wapi_pn_63_48,
+			msdu_end->ext_wapi_pn_95_64,
+			msdu_end->ext_wapi_pn_127_96,
+			msdu_end->reported_mpdu_length,
+			msdu_end->first_msdu,
+			msdu_end->last_msdu,
+			msdu_end->sa_idx_timeout,
+			msdu_end->da_idx_timeout,
+			msdu_end->msdu_limit_error,
+			msdu_end->flow_idx_timeout,
+			msdu_end->flow_idx_invalid,
+			msdu_end->wifi_parser_error,
+			msdu_end->amsdu_parser_error,
+			msdu_end->sa_is_valid,
+			msdu_end->da_is_valid,
+			msdu_end->da_is_mcbc,
+			msdu_end->l3_header_padding,
+			msdu_end->ipv6_options_crc,
+			msdu_end->tcp_seq_number,
+			msdu_end->tcp_ack_number,
+			msdu_end->tcp_flag,
+			msdu_end->lro_eligible,
+			msdu_end->window_size,
+			msdu_end->da_offset,
+			msdu_end->sa_offset,
+			msdu_end->da_offset_valid,
+			msdu_end->sa_offset_valid,
+			msdu_end->rule_indication_31_0,
+			msdu_end->rule_indication_63_32,
+			msdu_end->sa_idx,
+			msdu_end->da_idx,
+			msdu_end->msdu_drop,
+			msdu_end->reo_destination_indication,
+			msdu_end->flow_idx,
+			msdu_end->fse_metadata,
+			msdu_end->cce_metadata,
+			msdu_end->sa_sw_peer_id);
+}
+
+qdf_export_symbol(hal_rx_dump_msdu_end_tlv_8074);
+
 /*
  * Get tid from RX_MPDU_START
  */
@@ -280,3 +391,26 @@ uint32_t hal_rx_msdu_start_reception_type_get_8074(uint8_t *buf)
 
 qdf_export_symbol(hal_rx_msdu_start_reception_type_get_8074);
 
+#define HAL_RX_MSDU_END_DA_IDX_GET(_rx_msdu_end)	\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_msdu_end,	\
+		RX_MSDU_END_13_DA_IDX_OFFSET)),		\
+		RX_MSDU_END_13_DA_IDX_MASK,		\
+		RX_MSDU_END_13_DA_IDX_LSB))
+
+ /**
+ * hal_rx_msdu_end_da_idx_get_8074: API to get da_idx
+ * from rx_msdu_end TLV
+ *
+ * @ buf: pointer to the start of RX PKT TLV headers
+ * Return: da index
+ */
+uint16_t hal_rx_msdu_end_da_idx_get_8074(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
+	uint16_t da_idx;
+
+	da_idx = HAL_RX_MSDU_END_DA_IDX_GET(msdu_end);
+
+	return da_idx;
+}

+ 2 - 0
hal/wifi3.0/qca8074/hal_8074_srng.c

@@ -49,9 +49,11 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_rx_get_tlv_8074,
 	hal_rx_proc_phyrx_other_receive_info_tlv_8074,
 	hal_rx_dump_msdu_start_tlv_8074,
+	hal_rx_dump_msdu_end_tlv_8074,
 	hal_get_link_desc_size_8074,
 	hal_rx_mpdu_start_tid_get_8074,
 	hal_rx_msdu_start_reception_type_get_8074,
+	hal_rx_msdu_end_da_idx_get_8074,
 };
 
 struct hal_hw_srng_config hw_srng_table_8074[] = {