xref: /wlan-driver/qca-wifi-host-cmn/hal/wifi3.0/wcn6450/hal_wcn6450.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name #include "qdf_types.h"
21*5113495bSYour Name #include "qdf_util.h"
22*5113495bSYour Name #include "qdf_types.h"
23*5113495bSYour Name #include "qdf_lock.h"
24*5113495bSYour Name #include "qdf_mem.h"
25*5113495bSYour Name #include "qdf_nbuf.h"
26*5113495bSYour Name #include "hal_internal.h"
27*5113495bSYour Name #include "hal_api.h"
28*5113495bSYour Name #include "target_type.h"
29*5113495bSYour Name #include "wcss_version.h"
30*5113495bSYour Name #include "qdf_module.h"
31*5113495bSYour Name #include "hal_flow.h"
32*5113495bSYour Name #include "rx_flow_search_entry.h"
33*5113495bSYour Name #include "hal_rx_flow_info.h"
34*5113495bSYour Name 
35*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_OFFSET \
36*5113495bSYour Name 	RXPCU_PPDU_END_INFO_9_RX_PPDU_DURATION_OFFSET
37*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_MASK \
38*5113495bSYour Name 	RXPCU_PPDU_END_INFO_9_RX_PPDU_DURATION_MASK
39*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_LSB \
40*5113495bSYour Name 	RXPCU_PPDU_END_INFO_9_RX_PPDU_DURATION_LSB
41*5113495bSYour Name #define UNIFIED_PHYRX_HT_SIG_0_HT_SIG_INFO_PHYRX_HT_SIG_INFO_DETAILS_OFFSET \
42*5113495bSYour Name 	PHYRX_L_SIG_B_0_PHYRX_L_SIG_B_INFO_DETAILS_RATE_OFFSET
43*5113495bSYour Name #define UNIFIED_PHYRX_L_SIG_B_0_L_SIG_B_INFO_PHYRX_L_SIG_B_INFO_DETAILS_OFFSET \
44*5113495bSYour Name 	PHYRX_L_SIG_B_0_PHYRX_L_SIG_B_INFO_DETAILS_RATE_OFFSET
45*5113495bSYour Name #define UNIFIED_PHYRX_L_SIG_A_0_L_SIG_A_INFO_PHYRX_L_SIG_A_INFO_DETAILS_OFFSET \
46*5113495bSYour Name 	PHYRX_L_SIG_A_0_PHYRX_L_SIG_A_INFO_DETAILS_RATE_OFFSET
47*5113495bSYour Name #define UNIFIED_PHYRX_VHT_SIG_A_0_VHT_SIG_A_INFO_PHYRX_VHT_SIG_A_INFO_DETAILS_OFFSET \
48*5113495bSYour Name 	PHYRX_VHT_SIG_A_0_PHYRX_VHT_SIG_A_INFO_DETAILS_BANDWIDTH_OFFSET
49*5113495bSYour Name #define UNIFIED_PHYRX_HE_SIG_A_SU_0_HE_SIG_A_SU_INFO_PHYRX_HE_SIG_A_SU_INFO_DETAILS_OFFSET \
50*5113495bSYour Name 	PHYRX_HE_SIG_A_SU_0_PHYRX_HE_SIG_A_SU_INFO_DETAILS_FORMAT_INDICATION_OFFSET
51*5113495bSYour Name #define UNIFIED_PHYRX_HE_SIG_A_MU_DL_0_HE_SIG_A_MU_DL_INFO_PHYRX_HE_SIG_A_MU_DL_INFO_DETAILS_OFFSET \
52*5113495bSYour Name 	PHYRX_HE_SIG_A_MU_DL_0_PHYRX_HE_SIG_A_MU_DL_INFO_DETAILS_DL_UL_FLAG_OFFSET
53*5113495bSYour Name #define UNIFIED_PHYRX_HE_SIG_B1_MU_0_HE_SIG_B1_MU_INFO_PHYRX_HE_SIG_B1_MU_INFO_DETAILS_OFFSET \
54*5113495bSYour Name 	PHYRX_HE_SIG_B1_MU_0_PHYRX_HE_SIG_B1_MU_INFO_DETAILS_RU_ALLOCATION_OFFSET
55*5113495bSYour Name #define UNIFIED_PHYRX_HE_SIG_B2_MU_0_HE_SIG_B2_MU_INFO_PHYRX_HE_SIG_B2_MU_INFO_DETAILS_OFFSET \
56*5113495bSYour Name 	PHYRX_HE_SIG_B2_MU_0_PHYRX_HE_SIG_B2_MU_INFO_DETAILS_STA_ID_OFFSET
57*5113495bSYour Name #define UNIFIED_PHYRX_HE_SIG_B2_OFDMA_0_HE_SIG_B2_OFDMA_INFO_PHYRX_HE_SIG_B2_OFDMA_INFO_DETAILS_OFFSET \
58*5113495bSYour Name 	PHYRX_HE_SIG_B2_OFDMA_0_PHYRX_HE_SIG_B2_OFDMA_INFO_DETAILS_STA_ID_OFFSET
59*5113495bSYour Name 
60*5113495bSYour Name #define UNIFIED_PHYRX_RSSI_LEGACY_3_RECEIVE_RSSI_INFO_PRE_RSSI_INFO_DETAILS_OFFSET \
61*5113495bSYour Name 	PHYRX_RSSI_LEGACY_3_RECEIVE_RSSI_INFO_PRE_RSSI_INFO_DETAILS_OFFSET
62*5113495bSYour Name #define UNIFIED_PHYRX_RSSI_LEGACY_19_RECEIVE_RSSI_INFO_PREAMBLE_RSSI_INFO_DETAILS_OFFSET \
63*5113495bSYour Name 	PHYRX_RSSI_LEGACY_19_PREAMBLE_RSSI_INFO_DETAILS_RSSI_PRI20_CHAIN0_OFFSET
64*5113495bSYour Name #define UNIFIED_RX_MPDU_START_0_RX_MPDU_INFO_RX_MPDU_INFO_DETAILS_OFFSET \
65*5113495bSYour Name 	RX_MPDU_START_0_RX_MPDU_INFO_DETAILS_RXPT_CLASSIFY_INFO_DETAILS_REO_DESTINATION_INDICATION_OFFSET
66*5113495bSYour Name #define UNIFIED_RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET \
67*5113495bSYour Name 	RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET
68*5113495bSYour Name #define UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET \
69*5113495bSYour Name 	RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET
70*5113495bSYour Name #define UNIFIED_RX_MPDU_DETAILS_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET \
71*5113495bSYour Name 	RX_MPDU_DETAILS_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET
72*5113495bSYour Name #define UNIFIED_REO_DESTINATION_RING_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET \
73*5113495bSYour Name 	REO_DESTINATION_RING_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET
74*5113495bSYour Name #define UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC \
75*5113495bSYour Name 	UNIFORM_REO_STATUS_HEADER_STATUS_HEADER
76*5113495bSYour Name #define UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET \
77*5113495bSYour Name 	RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET
78*5113495bSYour Name #define UNIFIED_RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET \
79*5113495bSYour Name 	RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET
80*5113495bSYour Name 
81*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_0_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET \
82*5113495bSYour Name 	TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET
83*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_LSB \
84*5113495bSYour Name 	BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_LSB
85*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_MASK \
86*5113495bSYour Name 	BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_MASK
87*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_1_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET \
88*5113495bSYour Name 	TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET
89*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_LSB \
90*5113495bSYour Name 	BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_LSB
91*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_MASK \
92*5113495bSYour Name 	BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_MASK
93*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_LSB \
94*5113495bSYour Name 	BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_LSB
95*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_MASK \
96*5113495bSYour Name 	BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_MASK
97*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_LSB \
98*5113495bSYour Name 	BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_LSB
99*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_MASK \
100*5113495bSYour Name 	BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_MASK
101*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET \
102*5113495bSYour Name 	TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET
103*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB \
104*5113495bSYour Name 	TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB
105*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK \
106*5113495bSYour Name 	TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK
107*5113495bSYour Name 
108*5113495bSYour Name #include "hal_wcn6450_tx.h"
109*5113495bSYour Name #include "hal_wcn6450_rx.h"
110*5113495bSYour Name #include <hal_generic_api.h>
111*5113495bSYour Name #include "hal_rh_rx.h"
112*5113495bSYour Name #include "hal_rh_api.h"
113*5113495bSYour Name #include "hal_api_mon.h"
114*5113495bSYour Name #include "hal_rh_generic_api.h"
115*5113495bSYour Name 
116*5113495bSYour Name struct hal_hw_srng_config hw_srng_table_wcn6450[] = {
117*5113495bSYour Name 	/* TODO: max_rings can populated by querying HW capabilities */
118*5113495bSYour Name 	{/* REO_DST */ 0},
119*5113495bSYour Name 	{/* REO_EXCEPTION */ 0},
120*5113495bSYour Name 	{/* REO_REINJECT */ 0},
121*5113495bSYour Name 	{/* REO_CMD */ 0},
122*5113495bSYour Name 	{/* REO_STATUS */ 0},
123*5113495bSYour Name 	{/* TCL_DATA */ 0},
124*5113495bSYour Name 	{/* TCL_CMD */ 0},
125*5113495bSYour Name 	{/* TCL_STATUS */ 0},
126*5113495bSYour Name 	{/* CE_SRC */ 0},
127*5113495bSYour Name 	{/* CE_DST */ 0},
128*5113495bSYour Name 	{/* CE_DST_STATUS */ 0},
129*5113495bSYour Name 	{/* WBM_IDLE_LINK */ 0},
130*5113495bSYour Name 	{/* SW2WBM_RELEASE */ 0},
131*5113495bSYour Name 	{/* WBM2SW_RELEASE */ 0},
132*5113495bSYour Name 	{ /* RXDMA_BUF */
133*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA0_BUF0,
134*5113495bSYour Name #ifdef IPA_OFFLOAD
135*5113495bSYour Name 		.max_rings = 3,
136*5113495bSYour Name #else
137*5113495bSYour Name 		.max_rings = 2,
138*5113495bSYour Name #endif
139*5113495bSYour Name 		.entry_size = sizeof(struct wbm_buffer_ring) >> 2,
140*5113495bSYour Name 		.lmac_ring = TRUE,
141*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
142*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
143*5113495bSYour Name 		 * from host
144*5113495bSYour Name 		 */
145*5113495bSYour Name 		.reg_start = {},
146*5113495bSYour Name 		.reg_size = {},
147*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
148*5113495bSYour Name 	},
149*5113495bSYour Name 	{ /* RXDMA_DST */
150*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_RXDMA2SW0,
151*5113495bSYour Name 		.max_rings = 1,
152*5113495bSYour Name 		.entry_size = sizeof(struct reo_entrance_ring) >> 2,
153*5113495bSYour Name 		.lmac_ring =  TRUE,
154*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
155*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
156*5113495bSYour Name 		 * from host
157*5113495bSYour Name 		 */
158*5113495bSYour Name 		.reg_start = {},
159*5113495bSYour Name 		.reg_size = {},
160*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
161*5113495bSYour Name 	},
162*5113495bSYour Name 	{/* RXDMA_MONITOR_BUF */ 0},
163*5113495bSYour Name 	{ /* RXDMA_MONITOR_STATUS */
164*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA1_STATBUF,
165*5113495bSYour Name 		.max_rings = 1,
166*5113495bSYour Name 		.entry_size = sizeof(struct wbm_buffer_ring) >> 2,
167*5113495bSYour Name 		.lmac_ring = TRUE,
168*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
169*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
170*5113495bSYour Name 		 * from host
171*5113495bSYour Name 		 */
172*5113495bSYour Name 		.reg_start = {},
173*5113495bSYour Name 		.reg_size = {},
174*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
175*5113495bSYour Name 	},
176*5113495bSYour Name 	{/* RXDMA_MONITOR_DST */ 0},
177*5113495bSYour Name 	{/* RXDMA_MONITOR_DESC */ 0},
178*5113495bSYour Name 	{/* DIR_BUF_RX_DMA_SRC */
179*5113495bSYour Name 		.start_ring_id = HAL_SRNG_DIR_BUF_RX_SRC_DMA_RING,
180*5113495bSYour Name 		/*
181*5113495bSYour Name 		 * one ring is for spectral scan
182*5113495bSYour Name 		 * the other is for cfr
183*5113495bSYour Name 		 */
184*5113495bSYour Name 		.max_rings = 2,
185*5113495bSYour Name 		.entry_size = 2,
186*5113495bSYour Name 		.lmac_ring = TRUE,
187*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
188*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
189*5113495bSYour Name 		 * from host
190*5113495bSYour Name 		 */
191*5113495bSYour Name 		.reg_start = {},
192*5113495bSYour Name 		.reg_size = {},
193*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
194*5113495bSYour Name 	},
195*5113495bSYour Name #ifdef WLAN_FEATURE_CIF_CFR
196*5113495bSYour Name 	{/* WIFI_POS_SRC */
197*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WIFI_POS_SRC_DMA_RING,
198*5113495bSYour Name 		.max_rings = 1,
199*5113495bSYour Name 		.entry_size = sizeof(wmi_oem_dma_buf_release_entry)  >> 2,
200*5113495bSYour Name 		.lmac_ring = TRUE,
201*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
202*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
203*5113495bSYour Name 		 * from host
204*5113495bSYour Name 		 */
205*5113495bSYour Name 		.reg_start = {},
206*5113495bSYour Name 		.reg_size = {},
207*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
208*5113495bSYour Name 	},
209*5113495bSYour Name #endif
210*5113495bSYour Name 	{ /* REO2PPE */ 0},
211*5113495bSYour Name 	{ /* PPE2TCL */ 0},
212*5113495bSYour Name 	{ /* PPE_RELEASE */ 0},
213*5113495bSYour Name 	{ /* TX_MONITOR_BUF */ 0},
214*5113495bSYour Name 	{ /* TX_MONITOR_DST */ 0},
215*5113495bSYour Name 	{ /* SW2RXDMA_NEW */ 0},
216*5113495bSYour Name 	{ /* SW2RXDMA_LINK_RELEASE */
217*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA_LINK_RING,
218*5113495bSYour Name 		.max_rings = 1,
219*5113495bSYour Name 		.entry_size = sizeof(struct wbm_buffer_ring) >> 2,
220*5113495bSYour Name 		.lmac_ring = TRUE,
221*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
222*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
223*5113495bSYour Name 		 * from host
224*5113495bSYour Name 		 */
225*5113495bSYour Name 		.reg_start = {},
226*5113495bSYour Name 		.reg_size = {},
227*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
228*5113495bSYour Name 	},
229*5113495bSYour Name 
230*5113495bSYour Name };
231*5113495bSYour Name 
hal_get_hw_hptp_6450(struct hal_soc * hal_soc,hal_ring_handle_t hal_ring_hdl,uint32_t * headp,uint32_t * tailp,uint8_t ring)232*5113495bSYour Name static void hal_get_hw_hptp_6450(struct hal_soc *hal_soc,
233*5113495bSYour Name 				 hal_ring_handle_t hal_ring_hdl,
234*5113495bSYour Name 				 uint32_t *headp, uint32_t *tailp,
235*5113495bSYour Name 				 uint8_t ring)
236*5113495bSYour Name {
237*5113495bSYour Name }
238*5113495bSYour Name 
hal_reo_setup_6450(struct hal_soc * soc,void * reoparams,int qref_reset)239*5113495bSYour Name static void hal_reo_setup_6450(struct hal_soc *soc, void *reoparams,
240*5113495bSYour Name 			       int qref_reset)
241*5113495bSYour Name {
242*5113495bSYour Name }
243*5113495bSYour Name 
hal_reo_set_err_dst_remap_6450(void * hal_soc)244*5113495bSYour Name static void hal_reo_set_err_dst_remap_6450(void *hal_soc)
245*5113495bSYour Name {
246*5113495bSYour Name }
247*5113495bSYour Name 
hal_tx_desc_set_dscp_tid_table_id_6450(void * desc,uint8_t id)248*5113495bSYour Name static void hal_tx_desc_set_dscp_tid_table_id_6450(void *desc, uint8_t id)
249*5113495bSYour Name {
250*5113495bSYour Name }
251*5113495bSYour Name 
hal_tx_set_dscp_tid_map_6450(struct hal_soc * hal_soc,uint8_t * map,uint8_t id)252*5113495bSYour Name static void hal_tx_set_dscp_tid_map_6450(struct hal_soc *hal_soc,
253*5113495bSYour Name 					 uint8_t *map, uint8_t id)
254*5113495bSYour Name {
255*5113495bSYour Name }
256*5113495bSYour Name 
hal_tx_update_dscp_tid_6450(struct hal_soc * hal_soc,uint8_t tid,uint8_t id,uint8_t dscp)257*5113495bSYour Name static void hal_tx_update_dscp_tid_6450(struct hal_soc *hal_soc, uint8_t tid,
258*5113495bSYour Name 					uint8_t id, uint8_t dscp)
259*5113495bSYour Name {
260*5113495bSYour Name }
261*5113495bSYour Name 
hal_tx_comp_get_release_reason_6450(void * hal_desc)262*5113495bSYour Name static uint8_t hal_tx_comp_get_release_reason_6450(void *hal_desc)
263*5113495bSYour Name {
264*5113495bSYour Name 	return 0;
265*5113495bSYour Name }
266*5113495bSYour Name 
hal_get_wbm_internal_error_6450(void * hal_desc)267*5113495bSYour Name static uint8_t hal_get_wbm_internal_error_6450(void *hal_desc)
268*5113495bSYour Name {
269*5113495bSYour Name 	return 0;
270*5113495bSYour Name }
271*5113495bSYour Name 
hal_tx_init_cmd_credit_ring_6450(hal_soc_handle_t hal_soc_hdl,hal_ring_handle_t hal_ring_hdl)272*5113495bSYour Name static void hal_tx_init_cmd_credit_ring_6450(hal_soc_handle_t hal_soc_hdl,
273*5113495bSYour Name 					     hal_ring_handle_t hal_ring_hdl)
274*5113495bSYour Name {
275*5113495bSYour Name }
276*5113495bSYour Name 
277*5113495bSYour Name #define LINK_DESC_SIZE (NUM_OF_DWORDS_RX_MSDU_LINK << 2)
hal_get_link_desc_size_6450(void)278*5113495bSYour Name static uint32_t hal_get_link_desc_size_6450(void)
279*5113495bSYour Name {
280*5113495bSYour Name 	return LINK_DESC_SIZE;
281*5113495bSYour Name }
282*5113495bSYour Name 
hal_reo_status_get_header_6450(hal_ring_desc_t ring_desc,int b,void * h1)283*5113495bSYour Name static void hal_reo_status_get_header_6450(hal_ring_desc_t ring_desc,
284*5113495bSYour Name 					   int b, void *h1)
285*5113495bSYour Name {
286*5113495bSYour Name }
287*5113495bSYour Name 
hal_rx_wbm_err_info_get_6450(void * wbm_desc,void * wbm_er_info1)288*5113495bSYour Name static void hal_rx_wbm_err_info_get_6450(void *wbm_desc,
289*5113495bSYour Name 					 void *wbm_er_info1)
290*5113495bSYour Name {
291*5113495bSYour Name }
292*5113495bSYour Name 
hal_rx_is_unicast_6450(uint8_t * buf)293*5113495bSYour Name static bool hal_rx_is_unicast_6450(uint8_t *buf)
294*5113495bSYour Name {
295*5113495bSYour Name 	return true;
296*5113495bSYour Name }
297*5113495bSYour Name 
hal_rx_tid_get_6450(hal_soc_handle_t hal_soc_hdl,uint8_t * buf)298*5113495bSYour Name static uint32_t hal_rx_tid_get_6450(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
299*5113495bSYour Name {
300*5113495bSYour Name 	return 0;
301*5113495bSYour Name }
302*5113495bSYour Name 
hal_rx_msdu0_buffer_addr_lsb_6450(void * link_desc_va)303*5113495bSYour Name static void *hal_rx_msdu0_buffer_addr_lsb_6450(void *link_desc_va)
304*5113495bSYour Name {
305*5113495bSYour Name 	return NULL;
306*5113495bSYour Name }
307*5113495bSYour Name 
hal_rx_msdu_desc_info_ptr_get_6450(void * msdu0)308*5113495bSYour Name static void *hal_rx_msdu_desc_info_ptr_get_6450(void *msdu0)
309*5113495bSYour Name {
310*5113495bSYour Name 	return NULL;
311*5113495bSYour Name }
312*5113495bSYour Name 
hal_ent_mpdu_desc_info_6450(void * ent_ring_desc)313*5113495bSYour Name static void *hal_ent_mpdu_desc_info_6450(void *ent_ring_desc)
314*5113495bSYour Name {
315*5113495bSYour Name 	return NULL;
316*5113495bSYour Name }
317*5113495bSYour Name 
hal_dst_mpdu_desc_info_6450(void * dst_ring_desc)318*5113495bSYour Name static void *hal_dst_mpdu_desc_info_6450(void *dst_ring_desc)
319*5113495bSYour Name {
320*5113495bSYour Name 	return NULL;
321*5113495bSYour Name }
322*5113495bSYour Name 
hal_rx_get_fc_valid_6450(uint8_t * buf)323*5113495bSYour Name static uint8_t hal_rx_get_fc_valid_6450(uint8_t *buf)
324*5113495bSYour Name {
325*5113495bSYour Name 	return HAL_RX_GET_FC_VALID(buf);
326*5113495bSYour Name }
327*5113495bSYour Name 
hal_rx_get_to_ds_flag_6450(uint8_t * buf)328*5113495bSYour Name static uint8_t hal_rx_get_to_ds_flag_6450(uint8_t *buf)
329*5113495bSYour Name {
330*5113495bSYour Name 	return HAL_RX_GET_TO_DS_FLAG(buf);
331*5113495bSYour Name }
332*5113495bSYour Name 
hal_rx_get_mac_addr2_valid_6450(uint8_t * buf)333*5113495bSYour Name static uint8_t hal_rx_get_mac_addr2_valid_6450(uint8_t *buf)
334*5113495bSYour Name {
335*5113495bSYour Name 	return HAL_RX_GET_MAC_ADDR2_VALID(buf);
336*5113495bSYour Name }
337*5113495bSYour Name 
hal_rx_get_filter_category_6450(uint8_t * buf)338*5113495bSYour Name static uint8_t hal_rx_get_filter_category_6450(uint8_t *buf)
339*5113495bSYour Name {
340*5113495bSYour Name 	return HAL_RX_GET_FILTER_CATEGORY(buf);
341*5113495bSYour Name }
342*5113495bSYour Name 
hal_reo_config_6450(struct hal_soc * soc,uint32_t reg_val,struct hal_reo_params * reo_params)343*5113495bSYour Name static void hal_reo_config_6450(struct hal_soc *soc,
344*5113495bSYour Name 				uint32_t reg_val,
345*5113495bSYour Name 				struct hal_reo_params *reo_params)
346*5113495bSYour Name {
347*5113495bSYour Name }
348*5113495bSYour Name 
349*5113495bSYour Name /**
350*5113495bSYour Name  * hal_rx_msdu_flow_idx_get_6450: API to get flow index
351*5113495bSYour Name  * from rx_msdu_end TLV
352*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
353*5113495bSYour Name  *
354*5113495bSYour Name  * Return: flow index value from MSDU END TLV
355*5113495bSYour Name  */
hal_rx_msdu_flow_idx_get_6450(uint8_t * buf)356*5113495bSYour Name static inline uint32_t hal_rx_msdu_flow_idx_get_6450(uint8_t *buf)
357*5113495bSYour Name {
358*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
359*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
360*5113495bSYour Name 
361*5113495bSYour Name 	return HAL_RX_MSDU_END_FLOW_IDX_GET(msdu_end);
362*5113495bSYour Name }
363*5113495bSYour Name 
hal_compute_reo_remap_ix2_ix3_6450(uint32_t * ring,uint32_t num_rings,uint32_t * remap1,uint32_t * remap2)364*5113495bSYour Name static void hal_compute_reo_remap_ix2_ix3_6450(uint32_t *ring,
365*5113495bSYour Name 					       uint32_t num_rings,
366*5113495bSYour Name 					       uint32_t *remap1,
367*5113495bSYour Name 					       uint32_t *remap2)
368*5113495bSYour Name {
369*5113495bSYour Name }
370*5113495bSYour Name 
371*5113495bSYour Name static void
hal_setup_link_idle_list_6450(struct hal_soc * soc,qdf_dma_addr_t scatter_bufs_base_paddr[],void * scatter_bufs_base_vaddr[],uint32_t num_scatter_bufs,uint32_t scatter_buf_size,uint32_t last_buf_end_offset,uint32_t num_entries)372*5113495bSYour Name hal_setup_link_idle_list_6450(struct hal_soc *soc,
373*5113495bSYour Name 			      qdf_dma_addr_t scatter_bufs_base_paddr[],
374*5113495bSYour Name 			      void *scatter_bufs_base_vaddr[],
375*5113495bSYour Name 			      uint32_t num_scatter_bufs,
376*5113495bSYour Name 			      uint32_t scatter_buf_size,
377*5113495bSYour Name 			      uint32_t last_buf_end_offset,
378*5113495bSYour Name 			      uint32_t num_entries)
379*5113495bSYour Name {
380*5113495bSYour Name }
381*5113495bSYour Name 
hal_compute_reo_remap_ix0_6450(uint32_t * remap0)382*5113495bSYour Name static void hal_compute_reo_remap_ix0_6450(uint32_t *remap0)
383*5113495bSYour Name {
384*5113495bSYour Name }
385*5113495bSYour Name 
386*5113495bSYour Name #define UMAC_WINDOW_REMAP_RANGE 0x14
387*5113495bSYour Name #define CE_WINDOW_REMAP_RANGE 0X37
388*5113495bSYour Name #define CMEM_WINDOW_REMAP_RANGE 0x2
389*5113495bSYour Name 
390*5113495bSYour Name /**
391*5113495bSYour Name  * hal_get_window_address_6450(): Function to get the ioremap address
392*5113495bSYour Name  * @hal_soc: Pointer to hal_soc
393*5113495bSYour Name  * @addr: address offset of register
394*5113495bSYour Name  *
395*5113495bSYour Name  * Return: modified address offset of register
396*5113495bSYour Name  */
hal_get_window_address_6450(struct hal_soc * hal_soc,qdf_iomem_t addr)397*5113495bSYour Name static inline qdf_iomem_t hal_get_window_address_6450(struct hal_soc *hal_soc,
398*5113495bSYour Name 						      qdf_iomem_t addr)
399*5113495bSYour Name {
400*5113495bSYour Name 	uint32_t offset;
401*5113495bSYour Name 	uint32_t window;
402*5113495bSYour Name 	uint8_t scale;
403*5113495bSYour Name 
404*5113495bSYour Name 	offset = addr - hal_soc->dev_base_addr;
405*5113495bSYour Name 	window = (offset >> WINDOW_SHIFT) & WINDOW_VALUE_MASK;
406*5113495bSYour Name 
407*5113495bSYour Name 	/* UMAC: 2nd window(unused) CE: 3rd window, CMEM: 4th window */
408*5113495bSYour Name 	switch (window) {
409*5113495bSYour Name 	case UMAC_WINDOW_REMAP_RANGE:
410*5113495bSYour Name 		scale = 1;
411*5113495bSYour Name 		break;
412*5113495bSYour Name 	case CE_WINDOW_REMAP_RANGE:
413*5113495bSYour Name 		scale = 2;
414*5113495bSYour Name 		break;
415*5113495bSYour Name 	case CMEM_WINDOW_REMAP_RANGE:
416*5113495bSYour Name 		scale = 3;
417*5113495bSYour Name 		break;
418*5113495bSYour Name 	default:
419*5113495bSYour Name 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
420*5113495bSYour Name 			  "%s: ERROR: Accessing Wrong register\n", __func__);
421*5113495bSYour Name 		qdf_assert_always(0);
422*5113495bSYour Name 		return 0;
423*5113495bSYour Name 	}
424*5113495bSYour Name 
425*5113495bSYour Name 	return hal_soc->dev_base_addr + (scale * WINDOW_START) +
426*5113495bSYour Name 		(offset & WINDOW_RANGE_MASK);
427*5113495bSYour Name }
428*5113495bSYour Name 
429*5113495bSYour Name /*
430*5113495bSYour Name  * hal_rx_msdu_start_nss_get_6450(): API to get the NSS
431*5113495bSYour Name  * Interval from rx_msdu_start
432*5113495bSYour Name  *
433*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
434*5113495bSYour Name  * Return: uint32_t(nss)
435*5113495bSYour Name  */
hal_rx_msdu_start_nss_get_6450(uint8_t * buf)436*5113495bSYour Name static uint32_t hal_rx_msdu_start_nss_get_6450(uint8_t *buf)
437*5113495bSYour Name {
438*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
439*5113495bSYour Name 	struct rx_msdu_start *msdu_start =
440*5113495bSYour Name 		&pkt_tlvs->msdu_start_tlv.rx_msdu_start;
441*5113495bSYour Name 	uint8_t mimo_ss_bitmap;
442*5113495bSYour Name 
443*5113495bSYour Name 	mimo_ss_bitmap = HAL_RX_MSDU_START_MIMO_SS_BITMAP(msdu_start);
444*5113495bSYour Name 
445*5113495bSYour Name 	return qdf_get_hweight8(mimo_ss_bitmap);
446*5113495bSYour Name }
447*5113495bSYour Name 
448*5113495bSYour Name /**
449*5113495bSYour Name  * hal_rx_mon_hw_desc_get_mpdu_status_6450(): Retrieve MPDU status
450*5113495bSYour Name  *
451*5113495bSYour Name  * @hw_desc_addr: Start address of Rx HW TLVs
452*5113495bSYour Name  * @rs: Status for monitor mode
453*5113495bSYour Name  *
454*5113495bSYour Name  * Return: void
455*5113495bSYour Name  */
hal_rx_mon_hw_desc_get_mpdu_status_6450(void * hw_desc_addr,struct mon_rx_status * rs)456*5113495bSYour Name static void hal_rx_mon_hw_desc_get_mpdu_status_6450(void *hw_desc_addr,
457*5113495bSYour Name 						    struct mon_rx_status *rs)
458*5113495bSYour Name {
459*5113495bSYour Name 	struct rx_msdu_start *rx_msdu_start;
460*5113495bSYour Name 	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
461*5113495bSYour Name 	uint32_t reg_value;
462*5113495bSYour Name 	const uint32_t sgi_hw_to_cdp[] = {
463*5113495bSYour Name 		CDP_SGI_0_8_US,
464*5113495bSYour Name 		CDP_SGI_0_4_US,
465*5113495bSYour Name 		CDP_SGI_1_6_US,
466*5113495bSYour Name 		CDP_SGI_3_2_US,
467*5113495bSYour Name 	};
468*5113495bSYour Name 
469*5113495bSYour Name 	rx_msdu_start = &rx_desc->msdu_start_tlv.rx_msdu_start;
470*5113495bSYour Name 
471*5113495bSYour Name 	HAL_RX_GET_MSDU_AGGREGATION(rx_desc, rs);
472*5113495bSYour Name 
473*5113495bSYour Name 	rs->ant_signal_db = HAL_RX_GET(rx_msdu_start,
474*5113495bSYour Name 				       RX_MSDU_START_5, USER_RSSI);
475*5113495bSYour Name 	rs->is_stbc = HAL_RX_GET(rx_msdu_start, RX_MSDU_START_5, STBC);
476*5113495bSYour Name 
477*5113495bSYour Name 	reg_value = HAL_RX_GET(rx_msdu_start, RX_MSDU_START_5, SGI);
478*5113495bSYour Name 	rs->sgi = sgi_hw_to_cdp[reg_value];
479*5113495bSYour Name 
480*5113495bSYour Name 	reg_value = HAL_RX_GET(rx_msdu_start, RX_MSDU_START_5, RECEPTION_TYPE);
481*5113495bSYour Name 	rs->beamformed = (reg_value == HAL_RX_RECEPTION_TYPE_MU_MIMO) ? 1 : 0;
482*5113495bSYour Name 	/* TODO: rs->beamformed should be set for SU beamforming also */
483*5113495bSYour Name }
484*5113495bSYour Name 
485*5113495bSYour Name /*
486*5113495bSYour Name  * hal_rx_get_tlv_6450(): API to get the tlv
487*5113495bSYour Name  *
488*5113495bSYour Name  * @rx_tlv: TLV data extracted from the rx packet
489*5113495bSYour Name  * Return: uint8_t
490*5113495bSYour Name  */
hal_rx_get_tlv_6450(void * rx_tlv)491*5113495bSYour Name static uint8_t hal_rx_get_tlv_6450(void *rx_tlv)
492*5113495bSYour Name {
493*5113495bSYour Name 	return HAL_RX_GET(rx_tlv, PHYRX_RSSI_LEGACY_0, RECEIVE_BANDWIDTH);
494*5113495bSYour Name }
495*5113495bSYour Name 
496*5113495bSYour Name /**
497*5113495bSYour Name  * hal_rx_proc_phyrx_other_receive_info_tlv_6450()
498*5113495bSYour Name  *                                  - process other receive info TLV
499*5113495bSYour Name  * @rx_tlv_hdr: pointer to TLV header
500*5113495bSYour Name  * @ppdu_info_handle: pointer to ppdu_info
501*5113495bSYour Name  *
502*5113495bSYour Name  * Return: None
503*5113495bSYour Name  */
504*5113495bSYour Name static
hal_rx_proc_phyrx_other_receive_info_tlv_6450(void * rx_tlv_hdr,void * ppdu_info_handle)505*5113495bSYour Name void hal_rx_proc_phyrx_other_receive_info_tlv_6450(void *rx_tlv_hdr,
506*5113495bSYour Name 						   void *ppdu_info_handle)
507*5113495bSYour Name {
508*5113495bSYour Name 	uint32_t tlv_tag, tlv_len;
509*5113495bSYour Name 	uint32_t temp_len, other_tlv_len, other_tlv_tag;
510*5113495bSYour Name 	void *rx_tlv = (uint8_t *)rx_tlv_hdr + HAL_RX_TLV32_HDR_SIZE;
511*5113495bSYour Name 	void *other_tlv_hdr = NULL;
512*5113495bSYour Name 	void *other_tlv = NULL;
513*5113495bSYour Name 
514*5113495bSYour Name 	tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(rx_tlv_hdr);
515*5113495bSYour Name 	tlv_len = HAL_RX_GET_USER_TLV32_LEN(rx_tlv_hdr);
516*5113495bSYour Name 	temp_len = 0;
517*5113495bSYour Name 
518*5113495bSYour Name 	other_tlv_hdr = rx_tlv + HAL_RX_TLV32_HDR_SIZE;
519*5113495bSYour Name 
520*5113495bSYour Name 	other_tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(other_tlv_hdr);
521*5113495bSYour Name 	other_tlv_len = HAL_RX_GET_USER_TLV32_LEN(other_tlv_hdr);
522*5113495bSYour Name 	temp_len += other_tlv_len;
523*5113495bSYour Name 	other_tlv = other_tlv_hdr + HAL_RX_TLV32_HDR_SIZE;
524*5113495bSYour Name 
525*5113495bSYour Name 	switch (other_tlv_tag) {
526*5113495bSYour Name 	default:
527*5113495bSYour Name 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
528*5113495bSYour Name 			  "%s unhandled TLV type: %d, TLV len:%d",
529*5113495bSYour Name 			  __func__, other_tlv_tag, other_tlv_len);
530*5113495bSYour Name 		break;
531*5113495bSYour Name 	}
532*5113495bSYour Name }
533*5113495bSYour Name 
534*5113495bSYour Name /**
535*5113495bSYour Name  * hal_rx_dump_msdu_start_tlv_6450() : dump RX msdu_start TLV in structured
536*5113495bSYour Name  *				       human readable format.
537*5113495bSYour Name  * @pkttlvs: pointer to pkttlvs.
538*5113495bSYour Name  * @dbg_level: log level.
539*5113495bSYour Name  *
540*5113495bSYour Name  * Return: void
541*5113495bSYour Name  */
hal_rx_dump_msdu_start_tlv_6450(void * pkttlvs,uint8_t dbg_level)542*5113495bSYour Name static void hal_rx_dump_msdu_start_tlv_6450(void *pkttlvs, uint8_t dbg_level)
543*5113495bSYour Name {
544*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)pkttlvs;
545*5113495bSYour Name 	struct rx_msdu_start *msdu_start =
546*5113495bSYour Name 					&pkt_tlvs->msdu_start_tlv.rx_msdu_start;
547*5113495bSYour Name 
548*5113495bSYour Name 	hal_verbose_debug(
549*5113495bSYour Name 			  "rx_msdu_start tlv (1/2) - "
550*5113495bSYour Name 			  "rxpcu_mpdu_filter_in_category: %x "
551*5113495bSYour Name 			  "sw_frame_group_id: %x "
552*5113495bSYour Name 			  "phy_ppdu_id: %x "
553*5113495bSYour Name 			  "msdu_length: %x "
554*5113495bSYour Name 			  "ipsec_esp: %x "
555*5113495bSYour Name 			  "l3_offset: %x "
556*5113495bSYour Name 			  "ipsec_ah: %x "
557*5113495bSYour Name 			  "l4_offset: %x "
558*5113495bSYour Name 			  "msdu_number: %x "
559*5113495bSYour Name 			  "decap_format: %x "
560*5113495bSYour Name 			  "ipv4_proto: %x "
561*5113495bSYour Name 			  "ipv6_proto: %x "
562*5113495bSYour Name 			  "tcp_proto: %x "
563*5113495bSYour Name 			  "udp_proto: %x "
564*5113495bSYour Name 			  "ip_frag: %x "
565*5113495bSYour Name 			  "tcp_only_ack: %x "
566*5113495bSYour Name 			  "da_is_bcast_mcast: %x "
567*5113495bSYour Name 			  "ip4_protocol_ip6_next_header: %x "
568*5113495bSYour Name 			  "toeplitz_hash_2_or_4: %x "
569*5113495bSYour Name 			  "flow_id_toeplitz: %x "
570*5113495bSYour Name 			  "user_rssi: %x "
571*5113495bSYour Name 			  "pkt_type: %x "
572*5113495bSYour Name 			  "stbc: %x "
573*5113495bSYour Name 			  "sgi: %x "
574*5113495bSYour Name 			  "rate_mcs: %x "
575*5113495bSYour Name 			  "receive_bandwidth: %x "
576*5113495bSYour Name 			  "reception_type: %x "
577*5113495bSYour Name 			  "ppdu_start_timestamp: %u ",
578*5113495bSYour Name 			  msdu_start->rxpcu_mpdu_filter_in_category,
579*5113495bSYour Name 			  msdu_start->sw_frame_group_id,
580*5113495bSYour Name 			  msdu_start->phy_ppdu_id,
581*5113495bSYour Name 			  msdu_start->msdu_length,
582*5113495bSYour Name 			  msdu_start->ipsec_esp,
583*5113495bSYour Name 			  msdu_start->l3_offset,
584*5113495bSYour Name 			  msdu_start->ipsec_ah,
585*5113495bSYour Name 			  msdu_start->l4_offset,
586*5113495bSYour Name 			  msdu_start->msdu_number,
587*5113495bSYour Name 			  msdu_start->decap_format,
588*5113495bSYour Name 			  msdu_start->ipv4_proto,
589*5113495bSYour Name 			  msdu_start->ipv6_proto,
590*5113495bSYour Name 			  msdu_start->tcp_proto,
591*5113495bSYour Name 			  msdu_start->udp_proto,
592*5113495bSYour Name 			  msdu_start->ip_frag,
593*5113495bSYour Name 			  msdu_start->tcp_only_ack,
594*5113495bSYour Name 			  msdu_start->da_is_bcast_mcast,
595*5113495bSYour Name 			  msdu_start->ip4_protocol_ip6_next_header,
596*5113495bSYour Name 			  msdu_start->toeplitz_hash_2_or_4,
597*5113495bSYour Name 			  msdu_start->flow_id_toeplitz,
598*5113495bSYour Name 			  msdu_start->user_rssi,
599*5113495bSYour Name 			  msdu_start->pkt_type,
600*5113495bSYour Name 			  msdu_start->stbc,
601*5113495bSYour Name 			  msdu_start->sgi,
602*5113495bSYour Name 			  msdu_start->rate_mcs,
603*5113495bSYour Name 			  msdu_start->receive_bandwidth,
604*5113495bSYour Name 			  msdu_start->reception_type,
605*5113495bSYour Name 			  msdu_start->ppdu_start_timestamp);
606*5113495bSYour Name 
607*5113495bSYour Name 	hal_verbose_debug(
608*5113495bSYour Name 			  "rx_msdu_start tlv (2/2) - "
609*5113495bSYour Name 			  "sw_phy_meta_data: %x ",
610*5113495bSYour Name 			  msdu_start->sw_phy_meta_data);
611*5113495bSYour Name }
612*5113495bSYour Name 
613*5113495bSYour Name /**
614*5113495bSYour Name  * hal_rx_dump_msdu_end_tlv_6450: dump RX msdu_end TLV in structured
615*5113495bSYour Name  *				  human readable format.
616*5113495bSYour Name  * @pkttlvs: pointer to pkttlvs.
617*5113495bSYour Name  * @dbg_level: log level.
618*5113495bSYour Name  *
619*5113495bSYour Name  * Return: void
620*5113495bSYour Name  */
hal_rx_dump_msdu_end_tlv_6450(void * pkttlvs,uint8_t dbg_level)621*5113495bSYour Name static void hal_rx_dump_msdu_end_tlv_6450(void *pkttlvs,
622*5113495bSYour Name 					  uint8_t dbg_level)
623*5113495bSYour Name {
624*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)pkttlvs;
625*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
626*5113495bSYour Name 
627*5113495bSYour Name 	__QDF_TRACE_RL(dbg_level, QDF_MODULE_ID_DP,
628*5113495bSYour Name 		       "rx_msdu_end tlv (1/3) - "
629*5113495bSYour Name 		       "rxpcu_mpdu_filter_in_category: %x "
630*5113495bSYour Name 		       "sw_frame_group_id: %x "
631*5113495bSYour Name 		       "phy_ppdu_id: %x "
632*5113495bSYour Name 		       "ip_hdr_chksum: %x "
633*5113495bSYour Name 		       "tcp_udp_chksum: %x "
634*5113495bSYour Name 		       "key_id_octet: %x "
635*5113495bSYour Name 		       "cce_super_rule: %x "
636*5113495bSYour Name 		       "cce_classify_not_done_truncat: %x "
637*5113495bSYour Name 		       "cce_classify_not_done_cce_dis: %x "
638*5113495bSYour Name 		       "reported_mpdu_length: %x "
639*5113495bSYour Name 		       "first_msdu: %x "
640*5113495bSYour Name 		       "last_msdu: %x "
641*5113495bSYour Name 		       "sa_idx_timeout: %x "
642*5113495bSYour Name 		       "da_idx_timeout: %x "
643*5113495bSYour Name 		       "msdu_limit_error: %x "
644*5113495bSYour Name 		       "flow_idx_timeout: %x "
645*5113495bSYour Name 		       "flow_idx_invalid: %x "
646*5113495bSYour Name 		       "wifi_parser_error: %x "
647*5113495bSYour Name 		       "amsdu_parser_error: %x",
648*5113495bSYour Name 		       msdu_end->rxpcu_mpdu_filter_in_category,
649*5113495bSYour Name 		       msdu_end->sw_frame_group_id,
650*5113495bSYour Name 		       msdu_end->phy_ppdu_id,
651*5113495bSYour Name 		       msdu_end->ip_hdr_chksum,
652*5113495bSYour Name 		       msdu_end->tcp_udp_chksum,
653*5113495bSYour Name 		       msdu_end->key_id_octet,
654*5113495bSYour Name 		       msdu_end->cce_super_rule,
655*5113495bSYour Name 		       msdu_end->cce_classify_not_done_truncate,
656*5113495bSYour Name 		       msdu_end->cce_classify_not_done_cce_dis,
657*5113495bSYour Name 		       msdu_end->reported_mpdu_length,
658*5113495bSYour Name 		       msdu_end->first_msdu,
659*5113495bSYour Name 		       msdu_end->last_msdu,
660*5113495bSYour Name 		       msdu_end->sa_idx_timeout,
661*5113495bSYour Name 		       msdu_end->da_idx_timeout,
662*5113495bSYour Name 		       msdu_end->msdu_limit_error,
663*5113495bSYour Name 		       msdu_end->flow_idx_timeout,
664*5113495bSYour Name 		       msdu_end->flow_idx_invalid,
665*5113495bSYour Name 		       msdu_end->wifi_parser_error,
666*5113495bSYour Name 		       msdu_end->amsdu_parser_error);
667*5113495bSYour Name 
668*5113495bSYour Name 	__QDF_TRACE_RL(dbg_level, QDF_MODULE_ID_DP,
669*5113495bSYour Name 		       "rx_msdu_end tlv (2/3)- "
670*5113495bSYour Name 		       "sa_is_valid: %x "
671*5113495bSYour Name 		       "da_is_valid: %x "
672*5113495bSYour Name 		       "da_is_mcbc: %x "
673*5113495bSYour Name 		       "l3_header_padding: %x "
674*5113495bSYour Name 		       "ipv6_options_crc: %x "
675*5113495bSYour Name 		       "tcp_seq_number: %x "
676*5113495bSYour Name 		       "tcp_ack_number: %x "
677*5113495bSYour Name 		       "tcp_flag: %x "
678*5113495bSYour Name 		       "lro_eligible: %x "
679*5113495bSYour Name 		       "window_size: %x "
680*5113495bSYour Name 		       "da_offset: %x "
681*5113495bSYour Name 		       "sa_offset: %x "
682*5113495bSYour Name 		       "da_offset_valid: %x "
683*5113495bSYour Name 		       "sa_offset_valid: %x "
684*5113495bSYour Name 		       "rule_indication_31_0: %x "
685*5113495bSYour Name 		       "rule_indication_63_32: %x "
686*5113495bSYour Name 		       "sa_idx: %x "
687*5113495bSYour Name 		       "da_idx: %x "
688*5113495bSYour Name 		       "msdu_drop: %x "
689*5113495bSYour Name 		       "reo_destination_indication: %x "
690*5113495bSYour Name 		       "flow_idx: %x "
691*5113495bSYour Name 		       "fse_metadata: %x "
692*5113495bSYour Name 		       "cce_metadata: %x "
693*5113495bSYour Name 		       "sa_sw_peer_id: %x ",
694*5113495bSYour Name 		       msdu_end->sa_is_valid,
695*5113495bSYour Name 		       msdu_end->da_is_valid,
696*5113495bSYour Name 		       msdu_end->da_is_mcbc,
697*5113495bSYour Name 		       msdu_end->l3_header_padding,
698*5113495bSYour Name 		       msdu_end->ipv6_options_crc,
699*5113495bSYour Name 		       msdu_end->tcp_seq_number,
700*5113495bSYour Name 		       msdu_end->tcp_ack_number,
701*5113495bSYour Name 		       msdu_end->tcp_flag,
702*5113495bSYour Name 		       msdu_end->lro_eligible,
703*5113495bSYour Name 		       msdu_end->window_size,
704*5113495bSYour Name 		       msdu_end->da_offset,
705*5113495bSYour Name 		       msdu_end->sa_offset,
706*5113495bSYour Name 		       msdu_end->da_offset_valid,
707*5113495bSYour Name 		       msdu_end->sa_offset_valid,
708*5113495bSYour Name 		       msdu_end->rule_indication_31_0,
709*5113495bSYour Name 		       msdu_end->rule_indication_63_32,
710*5113495bSYour Name 		       msdu_end->sa_idx,
711*5113495bSYour Name 		       msdu_end->da_idx_or_sw_peer_id,
712*5113495bSYour Name 		       msdu_end->msdu_drop,
713*5113495bSYour Name 		       msdu_end->reo_destination_indication,
714*5113495bSYour Name 		       msdu_end->flow_idx,
715*5113495bSYour Name 		       msdu_end->fse_metadata,
716*5113495bSYour Name 		       msdu_end->cce_metadata,
717*5113495bSYour Name 		       msdu_end->sa_sw_peer_id);
718*5113495bSYour Name 	__QDF_TRACE_RL(dbg_level, QDF_MODULE_ID_DP,
719*5113495bSYour Name 		       "rx_msdu_end tlv (3/3)"
720*5113495bSYour Name 		       "aggregation_count %x "
721*5113495bSYour Name 		       "flow_aggregation_continuation %x "
722*5113495bSYour Name 		       "fisa_timeout %x "
723*5113495bSYour Name 		       "cumulative_l4_checksum %x "
724*5113495bSYour Name 		       "cumulative_ip_length %x",
725*5113495bSYour Name 		       msdu_end->aggregation_count,
726*5113495bSYour Name 		       msdu_end->flow_aggregation_continuation,
727*5113495bSYour Name 		       msdu_end->fisa_timeout,
728*5113495bSYour Name 		       msdu_end->cumulative_l4_checksum,
729*5113495bSYour Name 		       msdu_end->cumulative_ip_length);
730*5113495bSYour Name }
731*5113495bSYour Name 
732*5113495bSYour Name /*
733*5113495bSYour Name  * Get tid from RX_MPDU_START
734*5113495bSYour Name  */
735*5113495bSYour Name #define HAL_RX_MPDU_INFO_TID_GET(_rx_mpdu_info) \
736*5113495bSYour Name 	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_mpdu_info),	\
737*5113495bSYour Name 		RX_MPDU_INFO_7_TID_OFFSET)),		\
738*5113495bSYour Name 		RX_MPDU_INFO_7_TID_MASK,		\
739*5113495bSYour Name 		RX_MPDU_INFO_7_TID_LSB))
740*5113495bSYour Name 
hal_rx_mpdu_start_tid_get_6450(uint8_t * buf)741*5113495bSYour Name static uint32_t hal_rx_mpdu_start_tid_get_6450(uint8_t *buf)
742*5113495bSYour Name {
743*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
744*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
745*5113495bSYour Name 			&pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
746*5113495bSYour Name 	uint32_t tid;
747*5113495bSYour Name 
748*5113495bSYour Name 	tid = HAL_RX_MPDU_INFO_TID_GET(&mpdu_start->rx_mpdu_info_details);
749*5113495bSYour Name 
750*5113495bSYour Name 	return tid;
751*5113495bSYour Name }
752*5113495bSYour Name 
753*5113495bSYour Name #define HAL_RX_MSDU_START_RECEPTION_TYPE_GET(_rx_msdu_start) \
754*5113495bSYour Name 	(_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_msdu_start),	\
755*5113495bSYour Name 	RX_MSDU_START_5_RECEPTION_TYPE_OFFSET)),	\
756*5113495bSYour Name 	RX_MSDU_START_5_RECEPTION_TYPE_MASK,		\
757*5113495bSYour Name 	RX_MSDU_START_5_RECEPTION_TYPE_LSB))
758*5113495bSYour Name 
759*5113495bSYour Name /*
760*5113495bSYour Name  * hal_rx_msdu_start_reception_type_get(): API to get the reception type
761*5113495bSYour Name  * Interval from rx_msdu_start
762*5113495bSYour Name  *
763*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
764*5113495bSYour Name  * Return: uint32_t(reception_type)
765*5113495bSYour Name  */
766*5113495bSYour Name static
hal_rx_msdu_start_reception_type_get_6450(uint8_t * buf)767*5113495bSYour Name uint32_t hal_rx_msdu_start_reception_type_get_6450(uint8_t *buf)
768*5113495bSYour Name {
769*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
770*5113495bSYour Name 	struct rx_msdu_start *msdu_start =
771*5113495bSYour Name 		&pkt_tlvs->msdu_start_tlv.rx_msdu_start;
772*5113495bSYour Name 	uint32_t reception_type;
773*5113495bSYour Name 
774*5113495bSYour Name 	reception_type = HAL_RX_MSDU_START_RECEPTION_TYPE_GET(msdu_start);
775*5113495bSYour Name 
776*5113495bSYour Name 	return reception_type;
777*5113495bSYour Name }
778*5113495bSYour Name 
779*5113495bSYour Name /**
780*5113495bSYour Name  * hal_rx_msdu_end_da_idx_get_6450: API to get da_idx
781*5113495bSYour Name  * from rx_msdu_end TLV
782*5113495bSYour Name  *
783*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
784*5113495bSYour Name  * Return: da index
785*5113495bSYour Name  */
hal_rx_msdu_end_da_idx_get_6450(uint8_t * buf)786*5113495bSYour Name static uint16_t hal_rx_msdu_end_da_idx_get_6450(uint8_t *buf)
787*5113495bSYour Name {
788*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
789*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
790*5113495bSYour Name 	uint16_t da_idx;
791*5113495bSYour Name 
792*5113495bSYour Name 	da_idx = HAL_RX_MSDU_END_DA_IDX_GET(msdu_end);
793*5113495bSYour Name 
794*5113495bSYour Name 	return da_idx;
795*5113495bSYour Name }
796*5113495bSYour Name 
797*5113495bSYour Name /**
798*5113495bSYour Name  * hal_rx_msdu_desc_info_get_ptr_6450() - Get msdu desc info ptr
799*5113495bSYour Name  * @msdu_details_ptr: Pointer to msdu_details_ptr
800*5113495bSYour Name  *
801*5113495bSYour Name  * Return - Pointer to rx_msdu_desc_info structure.
802*5113495bSYour Name  *
803*5113495bSYour Name  */
hal_rx_msdu_desc_info_get_ptr_6450(void * msdu_details_ptr)804*5113495bSYour Name static void *hal_rx_msdu_desc_info_get_ptr_6450(void *msdu_details_ptr)
805*5113495bSYour Name {
806*5113495bSYour Name 	return HAL_RX_MSDU_DESC_INFO_GET(msdu_details_ptr);
807*5113495bSYour Name }
808*5113495bSYour Name 
809*5113495bSYour Name /**
810*5113495bSYour Name  * hal_rx_link_desc_msdu0_ptr_6450 - Get pointer to rx_msdu details
811*5113495bSYour Name  * @link_desc: Pointer to link desc
812*5113495bSYour Name  *
813*5113495bSYour Name  * Return - Pointer to rx_msdu_details structure
814*5113495bSYour Name  *
815*5113495bSYour Name  */
hal_rx_link_desc_msdu0_ptr_6450(void * link_desc)816*5113495bSYour Name static void *hal_rx_link_desc_msdu0_ptr_6450(void *link_desc)
817*5113495bSYour Name {
818*5113495bSYour Name 	return HAL_RX_LINK_DESC_MSDU0_PTR(link_desc);
819*5113495bSYour Name }
820*5113495bSYour Name 
821*5113495bSYour Name /**
822*5113495bSYour Name  * hal_rx_get_rx_fragment_number_6450(): Function to retrieve rx fragment number
823*5113495bSYour Name  *
824*5113495bSYour Name  * @buf: Network buffer
825*5113495bSYour Name  * Returns: rx fragment number
826*5113495bSYour Name  */
827*5113495bSYour Name static
hal_rx_get_rx_fragment_number_6450(uint8_t * buf)828*5113495bSYour Name uint8_t hal_rx_get_rx_fragment_number_6450(uint8_t *buf)
829*5113495bSYour Name {
830*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
831*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
832*5113495bSYour Name 
833*5113495bSYour Name 	/* Return first 4 bits as fragment number */
834*5113495bSYour Name 	return (HAL_RX_MPDU_GET_SEQUENCE_NUMBER(rx_mpdu_info) &
835*5113495bSYour Name 		DOT11_SEQ_FRAG_MASK);
836*5113495bSYour Name }
837*5113495bSYour Name 
838*5113495bSYour Name /**
839*5113495bSYour Name  * hal_rx_msdu_end_da_is_mcbc_get_6450(): API to check if pkt is MCBC
840*5113495bSYour Name  * from rx_msdu_end TLV
841*5113495bSYour Name  *
842*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
843*5113495bSYour Name  * Return: da_is_mcbc
844*5113495bSYour Name  */
845*5113495bSYour Name static uint8_t
hal_rx_msdu_end_da_is_mcbc_get_6450(uint8_t * buf)846*5113495bSYour Name hal_rx_msdu_end_da_is_mcbc_get_6450(uint8_t *buf)
847*5113495bSYour Name {
848*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
849*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
850*5113495bSYour Name 
851*5113495bSYour Name 	return HAL_RX_MSDU_END_DA_IS_MCBC_GET(msdu_end);
852*5113495bSYour Name }
853*5113495bSYour Name 
854*5113495bSYour Name /**
855*5113495bSYour Name  * hal_rx_msdu_end_sa_is_valid_get_6450(): API to get_6450 the
856*5113495bSYour Name  * sa_is_valid bit from rx_msdu_end TLV
857*5113495bSYour Name  *
858*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
859*5113495bSYour Name  * Return: sa_is_valid bit
860*5113495bSYour Name  */
861*5113495bSYour Name static uint8_t
hal_rx_msdu_end_sa_is_valid_get_6450(uint8_t * buf)862*5113495bSYour Name hal_rx_msdu_end_sa_is_valid_get_6450(uint8_t *buf)
863*5113495bSYour Name {
864*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
865*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
866*5113495bSYour Name 	uint8_t sa_is_valid;
867*5113495bSYour Name 
868*5113495bSYour Name 	sa_is_valid = HAL_RX_MSDU_END_SA_IS_VALID_GET(msdu_end);
869*5113495bSYour Name 
870*5113495bSYour Name 	return sa_is_valid;
871*5113495bSYour Name }
872*5113495bSYour Name 
873*5113495bSYour Name /**
874*5113495bSYour Name  * hal_rx_msdu_end_sa_idx_get_6450(): API to get_6450 the
875*5113495bSYour Name  * sa_idx from rx_msdu_end TLV
876*5113495bSYour Name  *
877*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
878*5113495bSYour Name  * Return: sa_idx (SA AST index)
879*5113495bSYour Name  */
880*5113495bSYour Name static
hal_rx_msdu_end_sa_idx_get_6450(uint8_t * buf)881*5113495bSYour Name uint16_t hal_rx_msdu_end_sa_idx_get_6450(uint8_t *buf)
882*5113495bSYour Name {
883*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
884*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
885*5113495bSYour Name 	uint16_t sa_idx;
886*5113495bSYour Name 
887*5113495bSYour Name 	sa_idx = HAL_RX_MSDU_END_SA_IDX_GET(msdu_end);
888*5113495bSYour Name 
889*5113495bSYour Name 	return sa_idx;
890*5113495bSYour Name }
891*5113495bSYour Name 
892*5113495bSYour Name /**
893*5113495bSYour Name  * hal_rx_desc_is_first_msdu_6450() - Check if first msdu
894*5113495bSYour Name  *
895*5113495bSYour Name  * @hw_desc_addr: hardware descriptor address
896*5113495bSYour Name  *
897*5113495bSYour Name  * Return: 0 - success/ non-zero failure
898*5113495bSYour Name  */
hal_rx_desc_is_first_msdu_6450(void * hw_desc_addr)899*5113495bSYour Name static uint32_t hal_rx_desc_is_first_msdu_6450(void *hw_desc_addr)
900*5113495bSYour Name {
901*5113495bSYour Name 	struct rx_pkt_tlvs *rx_tlvs = (struct rx_pkt_tlvs *)hw_desc_addr;
902*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &rx_tlvs->msdu_end_tlv.rx_msdu_end;
903*5113495bSYour Name 
904*5113495bSYour Name 	return HAL_RX_GET(msdu_end, RX_MSDU_END_10, FIRST_MSDU);
905*5113495bSYour Name }
906*5113495bSYour Name 
907*5113495bSYour Name /**
908*5113495bSYour Name  * hal_rx_msdu_end_l3_hdr_padding_get_6450(): API to get_6450 the
909*5113495bSYour Name  * l3_header padding from rx_msdu_end TLV
910*5113495bSYour Name  *
911*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
912*5113495bSYour Name  * Return: number of l3 header padding bytes
913*5113495bSYour Name  */
hal_rx_msdu_end_l3_hdr_padding_get_6450(uint8_t * buf)914*5113495bSYour Name static uint32_t hal_rx_msdu_end_l3_hdr_padding_get_6450(uint8_t *buf)
915*5113495bSYour Name {
916*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
917*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
918*5113495bSYour Name 	uint32_t l3_header_padding;
919*5113495bSYour Name 
920*5113495bSYour Name 	l3_header_padding = HAL_RX_MSDU_END_L3_HEADER_PADDING_GET(msdu_end);
921*5113495bSYour Name 
922*5113495bSYour Name 	return l3_header_padding;
923*5113495bSYour Name }
924*5113495bSYour Name 
925*5113495bSYour Name /*
926*5113495bSYour Name  * @ hal_rx_encryption_info_valid_6450: Returns encryption type.
927*5113495bSYour Name  *
928*5113495bSYour Name  * @ buf: rx_tlv_hdr of the received packet
929*5113495bSYour Name  * @ Return: encryption type
930*5113495bSYour Name  */
hal_rx_encryption_info_valid_6450(uint8_t * buf)931*5113495bSYour Name static uint32_t hal_rx_encryption_info_valid_6450(uint8_t *buf)
932*5113495bSYour Name {
933*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
934*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
935*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
936*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
937*5113495bSYour Name 	uint32_t encryption_info = HAL_RX_MPDU_ENCRYPTION_INFO_VALID(mpdu_info);
938*5113495bSYour Name 
939*5113495bSYour Name 	return encryption_info;
940*5113495bSYour Name }
941*5113495bSYour Name 
942*5113495bSYour Name /*
943*5113495bSYour Name  * @ hal_rx_print_pn_6450: Prints the PN of rx packet.
944*5113495bSYour Name  *
945*5113495bSYour Name  * @ buf: rx_tlv_hdr of the received packet
946*5113495bSYour Name  * @ Return: void
947*5113495bSYour Name  */
hal_rx_print_pn_6450(uint8_t * buf)948*5113495bSYour Name static void hal_rx_print_pn_6450(uint8_t *buf)
949*5113495bSYour Name {
950*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
951*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
952*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
953*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
954*5113495bSYour Name 
955*5113495bSYour Name 	uint32_t pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
956*5113495bSYour Name 	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
957*5113495bSYour Name 	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
958*5113495bSYour Name 	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
959*5113495bSYour Name 
960*5113495bSYour Name 	hal_debug("PN number pn_127_96 0x%x pn_95_64 0x%x pn_63_32 0x%x pn_31_0 0x%x",
961*5113495bSYour Name 		  pn_127_96, pn_95_64, pn_63_32, pn_31_0);
962*5113495bSYour Name }
963*5113495bSYour Name 
964*5113495bSYour Name /**
965*5113495bSYour Name  * hal_rx_msdu_end_first_msdu_get_6450: API to get first msdu status
966*5113495bSYour Name  * from rx_msdu_end TLV
967*5113495bSYour Name  *
968*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
969*5113495bSYour Name  * Return: first_msdu
970*5113495bSYour Name  */
hal_rx_msdu_end_first_msdu_get_6450(uint8_t * buf)971*5113495bSYour Name static uint8_t hal_rx_msdu_end_first_msdu_get_6450(uint8_t *buf)
972*5113495bSYour Name {
973*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
974*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
975*5113495bSYour Name 	uint8_t first_msdu;
976*5113495bSYour Name 
977*5113495bSYour Name 	first_msdu = HAL_RX_MSDU_END_FIRST_MSDU_GET(msdu_end);
978*5113495bSYour Name 
979*5113495bSYour Name 	return first_msdu;
980*5113495bSYour Name }
981*5113495bSYour Name 
982*5113495bSYour Name /**
983*5113495bSYour Name  * hal_rx_msdu_end_da_is_valid_get_6450: API to check if da is valid
984*5113495bSYour Name  * from rx_msdu_end TLV
985*5113495bSYour Name  *
986*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
987*5113495bSYour Name  * Return: da_is_valid
988*5113495bSYour Name  */
hal_rx_msdu_end_da_is_valid_get_6450(uint8_t * buf)989*5113495bSYour Name static uint8_t hal_rx_msdu_end_da_is_valid_get_6450(uint8_t *buf)
990*5113495bSYour Name {
991*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
992*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
993*5113495bSYour Name 	uint8_t da_is_valid;
994*5113495bSYour Name 
995*5113495bSYour Name 	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
996*5113495bSYour Name 
997*5113495bSYour Name 	return da_is_valid;
998*5113495bSYour Name }
999*5113495bSYour Name 
1000*5113495bSYour Name /**
1001*5113495bSYour Name  * hal_rx_msdu_end_last_msdu_get_6450: API to get last msdu status
1002*5113495bSYour Name  * from rx_msdu_end TLV
1003*5113495bSYour Name  *
1004*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
1005*5113495bSYour Name  * Return: last_msdu
1006*5113495bSYour Name  */
hal_rx_msdu_end_last_msdu_get_6450(uint8_t * buf)1007*5113495bSYour Name static uint8_t hal_rx_msdu_end_last_msdu_get_6450(uint8_t *buf)
1008*5113495bSYour Name {
1009*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1010*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1011*5113495bSYour Name 	uint8_t last_msdu;
1012*5113495bSYour Name 
1013*5113495bSYour Name 	last_msdu = HAL_RX_MSDU_END_LAST_MSDU_GET(msdu_end);
1014*5113495bSYour Name 
1015*5113495bSYour Name 	return last_msdu;
1016*5113495bSYour Name }
1017*5113495bSYour Name 
1018*5113495bSYour Name /*
1019*5113495bSYour Name  * hal_rx_get_mpdu_mac_ad4_valid_6450(): Retrieves if mpdu 4th addr is valid
1020*5113495bSYour Name  *
1021*5113495bSYour Name  * @nbuf: Network buffer
1022*5113495bSYour Name  * Returns: value of mpdu 4th address valid field
1023*5113495bSYour Name  */
hal_rx_get_mpdu_mac_ad4_valid_6450(uint8_t * buf)1024*5113495bSYour Name static bool hal_rx_get_mpdu_mac_ad4_valid_6450(uint8_t *buf)
1025*5113495bSYour Name {
1026*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
1027*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
1028*5113495bSYour Name 	bool ad4_valid = 0;
1029*5113495bSYour Name 
1030*5113495bSYour Name 	ad4_valid = HAL_RX_MPDU_GET_MAC_AD4_VALID(rx_mpdu_info);
1031*5113495bSYour Name 
1032*5113495bSYour Name 	return ad4_valid;
1033*5113495bSYour Name }
1034*5113495bSYour Name 
1035*5113495bSYour Name /**
1036*5113495bSYour Name  * hal_rx_mpdu_start_sw_peer_id_get_6450: Retrieve sw peer_id
1037*5113495bSYour Name  * @buf: network buffer
1038*5113495bSYour Name  *
1039*5113495bSYour Name  * Return: sw peer_id
1040*5113495bSYour Name  */
hal_rx_mpdu_start_sw_peer_id_get_6450(uint8_t * buf)1041*5113495bSYour Name static uint32_t hal_rx_mpdu_start_sw_peer_id_get_6450(uint8_t *buf)
1042*5113495bSYour Name {
1043*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1044*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
1045*5113495bSYour Name 			&pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
1046*5113495bSYour Name 
1047*5113495bSYour Name 	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
1048*5113495bSYour Name 			&mpdu_start->rx_mpdu_info_details);
1049*5113495bSYour Name }
1050*5113495bSYour Name 
1051*5113495bSYour Name /**
1052*5113495bSYour Name  * hal_rx_mpdu_get_to_ds_6450(): API to get the tods info
1053*5113495bSYour Name  * from rx_mpdu_start
1054*5113495bSYour Name  *
1055*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
1056*5113495bSYour Name  * Return: uint32_t(to_ds)
1057*5113495bSYour Name  */
hal_rx_mpdu_get_to_ds_6450(uint8_t * buf)1058*5113495bSYour Name static uint32_t hal_rx_mpdu_get_to_ds_6450(uint8_t *buf)
1059*5113495bSYour Name {
1060*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1061*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
1062*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
1063*5113495bSYour Name 
1064*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
1065*5113495bSYour Name 
1066*5113495bSYour Name 	return HAL_RX_MPDU_GET_TODS(mpdu_info);
1067*5113495bSYour Name }
1068*5113495bSYour Name 
1069*5113495bSYour Name /*
1070*5113495bSYour Name  * hal_rx_mpdu_get_fr_ds_6450(): API to get the from ds info
1071*5113495bSYour Name  * from rx_mpdu_start
1072*5113495bSYour Name  *
1073*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
1074*5113495bSYour Name  * Return: uint32_t(fr_ds)
1075*5113495bSYour Name  */
hal_rx_mpdu_get_fr_ds_6450(uint8_t * buf)1076*5113495bSYour Name static uint32_t hal_rx_mpdu_get_fr_ds_6450(uint8_t *buf)
1077*5113495bSYour Name {
1078*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1079*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
1080*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
1081*5113495bSYour Name 
1082*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
1083*5113495bSYour Name 
1084*5113495bSYour Name 	return HAL_RX_MPDU_GET_FROMDS(mpdu_info);
1085*5113495bSYour Name }
1086*5113495bSYour Name 
1087*5113495bSYour Name /*
1088*5113495bSYour Name  * hal_rx_get_mpdu_frame_control_valid_6450(): Retrieves mpdu
1089*5113495bSYour Name  * frame control valid
1090*5113495bSYour Name  *
1091*5113495bSYour Name  * @nbuf: Network buffer
1092*5113495bSYour Name  * Returns: value of frame control valid field
1093*5113495bSYour Name  */
hal_rx_get_mpdu_frame_control_valid_6450(uint8_t * buf)1094*5113495bSYour Name static uint8_t hal_rx_get_mpdu_frame_control_valid_6450(uint8_t *buf)
1095*5113495bSYour Name {
1096*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
1097*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
1098*5113495bSYour Name 
1099*5113495bSYour Name 	return HAL_RX_MPDU_GET_FRAME_CONTROL_VALID(rx_mpdu_info);
1100*5113495bSYour Name }
1101*5113495bSYour Name 
1102*5113495bSYour Name /*
1103*5113495bSYour Name  * hal_rx_mpdu_get_addr1_6450(): API to check get address1 of the mpdu
1104*5113495bSYour Name  *
1105*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headera
1106*5113495bSYour Name  * @mac_addr: pointer to mac address
1107*5113495bSYour Name  * Return: success/failure
1108*5113495bSYour Name  */
hal_rx_mpdu_get_addr1_6450(uint8_t * buf,uint8_t * mac_addr)1109*5113495bSYour Name static QDF_STATUS hal_rx_mpdu_get_addr1_6450(uint8_t *buf, uint8_t *mac_addr)
1110*5113495bSYour Name {
1111*5113495bSYour Name 	struct __attribute__((__packed__)) hal_addr1 {
1112*5113495bSYour Name 		uint32_t ad1_31_0;
1113*5113495bSYour Name 		uint16_t ad1_47_32;
1114*5113495bSYour Name 	};
1115*5113495bSYour Name 
1116*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1117*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
1118*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
1119*5113495bSYour Name 
1120*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
1121*5113495bSYour Name 	struct hal_addr1 *addr = (struct hal_addr1 *)mac_addr;
1122*5113495bSYour Name 	uint32_t mac_addr_ad1_valid;
1123*5113495bSYour Name 
1124*5113495bSYour Name 	mac_addr_ad1_valid = HAL_RX_MPDU_MAC_ADDR_AD1_VALID_GET(mpdu_info);
1125*5113495bSYour Name 
1126*5113495bSYour Name 	if (mac_addr_ad1_valid) {
1127*5113495bSYour Name 		addr->ad1_31_0 = HAL_RX_MPDU_AD1_31_0_GET(mpdu_info);
1128*5113495bSYour Name 		addr->ad1_47_32 = HAL_RX_MPDU_AD1_47_32_GET(mpdu_info);
1129*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
1130*5113495bSYour Name 	}
1131*5113495bSYour Name 
1132*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
1133*5113495bSYour Name }
1134*5113495bSYour Name 
1135*5113495bSYour Name /*
1136*5113495bSYour Name  * hal_rx_mpdu_get_addr2_6450(): API to check get address2 of the mpdu
1137*5113495bSYour Name  * in the packet
1138*5113495bSYour Name  *
1139*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
1140*5113495bSYour Name  * @mac_addr: pointer to mac address
1141*5113495bSYour Name  * Return: success/failure
1142*5113495bSYour Name  */
hal_rx_mpdu_get_addr2_6450(uint8_t * buf,uint8_t * mac_addr)1143*5113495bSYour Name static QDF_STATUS hal_rx_mpdu_get_addr2_6450(uint8_t *buf,
1144*5113495bSYour Name 					     uint8_t *mac_addr)
1145*5113495bSYour Name {
1146*5113495bSYour Name 	struct __attribute__((__packed__)) hal_addr2 {
1147*5113495bSYour Name 		uint16_t ad2_15_0;
1148*5113495bSYour Name 		uint32_t ad2_47_16;
1149*5113495bSYour Name 	};
1150*5113495bSYour Name 
1151*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1152*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
1153*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
1154*5113495bSYour Name 
1155*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
1156*5113495bSYour Name 	struct hal_addr2 *addr = (struct hal_addr2 *)mac_addr;
1157*5113495bSYour Name 	uint32_t mac_addr_ad2_valid;
1158*5113495bSYour Name 
1159*5113495bSYour Name 	mac_addr_ad2_valid = HAL_RX_MPDU_MAC_ADDR_AD2_VALID_GET(mpdu_info);
1160*5113495bSYour Name 
1161*5113495bSYour Name 	if (mac_addr_ad2_valid) {
1162*5113495bSYour Name 		addr->ad2_15_0 = HAL_RX_MPDU_AD2_15_0_GET(mpdu_info);
1163*5113495bSYour Name 		addr->ad2_47_16 = HAL_RX_MPDU_AD2_47_16_GET(mpdu_info);
1164*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
1165*5113495bSYour Name 	}
1166*5113495bSYour Name 
1167*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
1168*5113495bSYour Name }
1169*5113495bSYour Name 
1170*5113495bSYour Name /*
1171*5113495bSYour Name  * hal_rx_mpdu_get_addr3_6450(): API to get address3 of the mpdu
1172*5113495bSYour Name  * in the packet
1173*5113495bSYour Name  *
1174*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
1175*5113495bSYour Name  * @mac_addr: pointer to mac address
1176*5113495bSYour Name  * Return: success/failure
1177*5113495bSYour Name  */
hal_rx_mpdu_get_addr3_6450(uint8_t * buf,uint8_t * mac_addr)1178*5113495bSYour Name static QDF_STATUS hal_rx_mpdu_get_addr3_6450(uint8_t *buf, uint8_t *mac_addr)
1179*5113495bSYour Name {
1180*5113495bSYour Name 	struct __attribute__((__packed__)) hal_addr3 {
1181*5113495bSYour Name 		uint32_t ad3_31_0;
1182*5113495bSYour Name 		uint16_t ad3_47_32;
1183*5113495bSYour Name 	};
1184*5113495bSYour Name 
1185*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1186*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
1187*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
1188*5113495bSYour Name 
1189*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
1190*5113495bSYour Name 	struct hal_addr3 *addr = (struct hal_addr3 *)mac_addr;
1191*5113495bSYour Name 	uint32_t mac_addr_ad3_valid;
1192*5113495bSYour Name 
1193*5113495bSYour Name 	mac_addr_ad3_valid = HAL_RX_MPDU_MAC_ADDR_AD3_VALID_GET(mpdu_info);
1194*5113495bSYour Name 
1195*5113495bSYour Name 	if (mac_addr_ad3_valid) {
1196*5113495bSYour Name 		addr->ad3_31_0 = HAL_RX_MPDU_AD3_31_0_GET(mpdu_info);
1197*5113495bSYour Name 		addr->ad3_47_32 = HAL_RX_MPDU_AD3_47_32_GET(mpdu_info);
1198*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
1199*5113495bSYour Name 	}
1200*5113495bSYour Name 
1201*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
1202*5113495bSYour Name }
1203*5113495bSYour Name 
1204*5113495bSYour Name /*
1205*5113495bSYour Name  * hal_rx_mpdu_get_addr4_6450(): API to get address4 of the mpdu
1206*5113495bSYour Name  * in the packet
1207*5113495bSYour Name  *
1208*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
1209*5113495bSYour Name  * @mac_addr: pointer to mac address
1210*5113495bSYour Name  * Return: success/failure
1211*5113495bSYour Name  */
hal_rx_mpdu_get_addr4_6450(uint8_t * buf,uint8_t * mac_addr)1212*5113495bSYour Name static QDF_STATUS hal_rx_mpdu_get_addr4_6450(uint8_t *buf, uint8_t *mac_addr)
1213*5113495bSYour Name {
1214*5113495bSYour Name 	struct __attribute__((__packed__)) hal_addr4 {
1215*5113495bSYour Name 		uint32_t ad4_31_0;
1216*5113495bSYour Name 		uint16_t ad4_47_32;
1217*5113495bSYour Name 	};
1218*5113495bSYour Name 
1219*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1220*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
1221*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
1222*5113495bSYour Name 
1223*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
1224*5113495bSYour Name 	struct hal_addr4 *addr = (struct hal_addr4 *)mac_addr;
1225*5113495bSYour Name 	uint32_t mac_addr_ad4_valid;
1226*5113495bSYour Name 
1227*5113495bSYour Name 	mac_addr_ad4_valid = HAL_RX_MPDU_MAC_ADDR_AD4_VALID_GET(mpdu_info);
1228*5113495bSYour Name 
1229*5113495bSYour Name 	if (mac_addr_ad4_valid) {
1230*5113495bSYour Name 		addr->ad4_31_0 = HAL_RX_MPDU_AD4_31_0_GET(mpdu_info);
1231*5113495bSYour Name 		addr->ad4_47_32 = HAL_RX_MPDU_AD4_47_32_GET(mpdu_info);
1232*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
1233*5113495bSYour Name 	}
1234*5113495bSYour Name 
1235*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
1236*5113495bSYour Name }
1237*5113495bSYour Name 
1238*5113495bSYour Name /*
1239*5113495bSYour Name  * hal_rx_get_mpdu_sequence_control_valid_6450(): Get mpdu
1240*5113495bSYour Name  * sequence control valid
1241*5113495bSYour Name  *
1242*5113495bSYour Name  * @nbuf: Network buffer
1243*5113495bSYour Name  * Returns: value of sequence control valid field
1244*5113495bSYour Name  */
hal_rx_get_mpdu_sequence_control_valid_6450(uint8_t * buf)1245*5113495bSYour Name static uint8_t hal_rx_get_mpdu_sequence_control_valid_6450(uint8_t *buf)
1246*5113495bSYour Name {
1247*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
1248*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
1249*5113495bSYour Name 
1250*5113495bSYour Name 	return HAL_RX_MPDU_GET_SEQUENCE_CONTROL_VALID(rx_mpdu_info);
1251*5113495bSYour Name }
1252*5113495bSYour Name 
1253*5113495bSYour Name /**
1254*5113495bSYour Name  * hal_rx_hw_desc_get_ppduid_get_6450(): retrieve ppdu id
1255*5113495bSYour Name  * @rx_tlv_hdr: rx tlv header
1256*5113495bSYour Name  * @rxdma_dst_ring_desc: rxdma HW descriptor
1257*5113495bSYour Name  *
1258*5113495bSYour Name  * Return: ppdu id
1259*5113495bSYour Name  */
hal_rx_hw_desc_get_ppduid_get_6450(void * rx_tlv_hdr,void * rxdma_dst_ring_desc)1260*5113495bSYour Name static uint32_t hal_rx_hw_desc_get_ppduid_get_6450(void *rx_tlv_hdr,
1261*5113495bSYour Name 						   void *rxdma_dst_ring_desc)
1262*5113495bSYour Name {
1263*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info;
1264*5113495bSYour Name 	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)rx_tlv_hdr;
1265*5113495bSYour Name 
1266*5113495bSYour Name 	rx_mpdu_info =
1267*5113495bSYour Name 		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
1268*5113495bSYour Name 
1269*5113495bSYour Name 	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_9, PHY_PPDU_ID);
1270*5113495bSYour Name }
1271*5113495bSYour Name 
1272*5113495bSYour Name static uint32_t
hal_rx_get_ppdu_id_6450(uint8_t * buf)1273*5113495bSYour Name hal_rx_get_ppdu_id_6450(uint8_t *buf)
1274*5113495bSYour Name {
1275*5113495bSYour Name 	return HAL_RX_GET_PPDU_ID(buf);
1276*5113495bSYour Name }
1277*5113495bSYour Name 
1278*5113495bSYour Name /**
1279*5113495bSYour Name  * hal_rx_msdu_flow_idx_invalid_6450: API to get flow index invalid
1280*5113495bSYour Name  * from rx_msdu_end TLV
1281*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
1282*5113495bSYour Name  *
1283*5113495bSYour Name  * Return: flow index invalid value from MSDU END TLV
1284*5113495bSYour Name  */
hal_rx_msdu_flow_idx_invalid_6450(uint8_t * buf)1285*5113495bSYour Name static bool hal_rx_msdu_flow_idx_invalid_6450(uint8_t *buf)
1286*5113495bSYour Name {
1287*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1288*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1289*5113495bSYour Name 
1290*5113495bSYour Name 	return HAL_RX_MSDU_END_FLOW_IDX_INVALID_GET(msdu_end);
1291*5113495bSYour Name }
1292*5113495bSYour Name 
1293*5113495bSYour Name /**
1294*5113495bSYour Name  * hal_rx_msdu_flow_idx_timeout_6450: API to get flow index timeout
1295*5113495bSYour Name  * from rx_msdu_end TLV
1296*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
1297*5113495bSYour Name  *
1298*5113495bSYour Name  * Return: flow index timeout value from MSDU END TLV
1299*5113495bSYour Name  */
hal_rx_msdu_flow_idx_timeout_6450(uint8_t * buf)1300*5113495bSYour Name static bool hal_rx_msdu_flow_idx_timeout_6450(uint8_t *buf)
1301*5113495bSYour Name {
1302*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1303*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1304*5113495bSYour Name 
1305*5113495bSYour Name 	return HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
1306*5113495bSYour Name }
1307*5113495bSYour Name 
1308*5113495bSYour Name /**
1309*5113495bSYour Name  * hal_rx_msdu_fse_metadata_get_6450: API to get FSE metadata
1310*5113495bSYour Name  * from rx_msdu_end TLV
1311*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
1312*5113495bSYour Name  *
1313*5113495bSYour Name  * Return: fse metadata value from MSDU END TLV
1314*5113495bSYour Name  */
hal_rx_msdu_fse_metadata_get_6450(uint8_t * buf)1315*5113495bSYour Name static uint32_t hal_rx_msdu_fse_metadata_get_6450(uint8_t *buf)
1316*5113495bSYour Name {
1317*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1318*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1319*5113495bSYour Name 
1320*5113495bSYour Name 	return HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
1321*5113495bSYour Name }
1322*5113495bSYour Name 
1323*5113495bSYour Name /**
1324*5113495bSYour Name  * hal_rx_msdu_cce_metadata_get_6450: API to get CCE metadata
1325*5113495bSYour Name  * from rx_msdu_end TLV
1326*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
1327*5113495bSYour Name  *
1328*5113495bSYour Name  * Return: cce_metadata
1329*5113495bSYour Name  */
1330*5113495bSYour Name static uint16_t
hal_rx_msdu_cce_metadata_get_6450(uint8_t * buf)1331*5113495bSYour Name hal_rx_msdu_cce_metadata_get_6450(uint8_t *buf)
1332*5113495bSYour Name {
1333*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1334*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1335*5113495bSYour Name 
1336*5113495bSYour Name 	return HAL_RX_MSDU_END_CCE_METADATA_GET(msdu_end);
1337*5113495bSYour Name }
1338*5113495bSYour Name 
1339*5113495bSYour Name /**
1340*5113495bSYour Name  * hal_rx_msdu_get_flow_params_6450: API to get flow index, flow index invalid
1341*5113495bSYour Name  * and flow index timeout from rx_msdu_end TLV
1342*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
1343*5113495bSYour Name  * @flow_invalid: pointer to return value of flow_idx_valid
1344*5113495bSYour Name  * @flow_timeout: pointer to return value of flow_idx_timeout
1345*5113495bSYour Name  * @flow_index: pointer to return value of flow_idx
1346*5113495bSYour Name  *
1347*5113495bSYour Name  * Return: none
1348*5113495bSYour Name  */
1349*5113495bSYour Name static inline void
hal_rx_msdu_get_flow_params_6450(uint8_t * buf,bool * flow_invalid,bool * flow_timeout,uint32_t * flow_index)1350*5113495bSYour Name hal_rx_msdu_get_flow_params_6450(uint8_t *buf,
1351*5113495bSYour Name 				 bool *flow_invalid,
1352*5113495bSYour Name 				 bool *flow_timeout,
1353*5113495bSYour Name 				 uint32_t *flow_index)
1354*5113495bSYour Name {
1355*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1356*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1357*5113495bSYour Name 
1358*5113495bSYour Name 	*flow_invalid = HAL_RX_MSDU_END_FLOW_IDX_INVALID_GET(msdu_end);
1359*5113495bSYour Name 	*flow_timeout = HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
1360*5113495bSYour Name 	*flow_index = HAL_RX_MSDU_END_FLOW_IDX_GET(msdu_end);
1361*5113495bSYour Name }
1362*5113495bSYour Name 
1363*5113495bSYour Name /**
1364*5113495bSYour Name  * hal_rx_tlv_get_tcp_chksum_6450() - API to get tcp checksum
1365*5113495bSYour Name  * @buf: rx_tlv_hdr
1366*5113495bSYour Name  *
1367*5113495bSYour Name  * Return: tcp checksum
1368*5113495bSYour Name  */
1369*5113495bSYour Name static uint16_t
hal_rx_tlv_get_tcp_chksum_6450(uint8_t * buf)1370*5113495bSYour Name hal_rx_tlv_get_tcp_chksum_6450(uint8_t *buf)
1371*5113495bSYour Name {
1372*5113495bSYour Name 	return HAL_RX_TLV_GET_TCP_CHKSUM(buf);
1373*5113495bSYour Name }
1374*5113495bSYour Name 
1375*5113495bSYour Name /**
1376*5113495bSYour Name  * hal_rx_get_rx_sequence_6450(): Function to retrieve rx sequence number
1377*5113495bSYour Name  *
1378*5113495bSYour Name  * @buf: Network buffer
1379*5113495bSYour Name  * Returns: rx sequence number
1380*5113495bSYour Name  */
1381*5113495bSYour Name static
hal_rx_get_rx_sequence_6450(uint8_t * buf)1382*5113495bSYour Name uint16_t hal_rx_get_rx_sequence_6450(uint8_t *buf)
1383*5113495bSYour Name {
1384*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
1385*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
1386*5113495bSYour Name 
1387*5113495bSYour Name 	return HAL_RX_MPDU_GET_SEQUENCE_NUMBER(rx_mpdu_info);
1388*5113495bSYour Name }
1389*5113495bSYour Name 
1390*5113495bSYour Name /**
1391*5113495bSYour Name  * hal_rx_get_fisa_cumulative_l4_checksum_6450() - Retrieve cumulative
1392*5113495bSYour Name  *                                                 checksum
1393*5113495bSYour Name  * @buf: buffer pointer
1394*5113495bSYour Name  *
1395*5113495bSYour Name  * Return: cumulative checksum
1396*5113495bSYour Name  */
1397*5113495bSYour Name static inline
hal_rx_get_fisa_cumulative_l4_checksum_6450(uint8_t * buf)1398*5113495bSYour Name uint16_t hal_rx_get_fisa_cumulative_l4_checksum_6450(uint8_t *buf)
1399*5113495bSYour Name {
1400*5113495bSYour Name 	return HAL_RX_TLV_GET_FISA_CUMULATIVE_L4_CHECKSUM(buf);
1401*5113495bSYour Name }
1402*5113495bSYour Name 
1403*5113495bSYour Name /**
1404*5113495bSYour Name  * hal_rx_get_fisa_cumulative_ip_length_6450() - Retrieve cumulative
1405*5113495bSYour Name  *                                               ip length
1406*5113495bSYour Name  * @buf: buffer pointer
1407*5113495bSYour Name  *
1408*5113495bSYour Name  * Return: cumulative length
1409*5113495bSYour Name  */
1410*5113495bSYour Name static inline
hal_rx_get_fisa_cumulative_ip_length_6450(uint8_t * buf)1411*5113495bSYour Name uint16_t hal_rx_get_fisa_cumulative_ip_length_6450(uint8_t *buf)
1412*5113495bSYour Name {
1413*5113495bSYour Name 	return HAL_RX_TLV_GET_FISA_CUMULATIVE_IP_LENGTH(buf);
1414*5113495bSYour Name }
1415*5113495bSYour Name 
1416*5113495bSYour Name /**
1417*5113495bSYour Name  * hal_rx_get_udp_proto_6450() - Retrieve udp proto value
1418*5113495bSYour Name  * @buf: buffer
1419*5113495bSYour Name  *
1420*5113495bSYour Name  * Return: udp proto bit
1421*5113495bSYour Name  */
1422*5113495bSYour Name static inline
hal_rx_get_udp_proto_6450(uint8_t * buf)1423*5113495bSYour Name bool hal_rx_get_udp_proto_6450(uint8_t *buf)
1424*5113495bSYour Name {
1425*5113495bSYour Name 	return HAL_RX_TLV_GET_UDP_PROTO(buf);
1426*5113495bSYour Name }
1427*5113495bSYour Name 
1428*5113495bSYour Name /**
1429*5113495bSYour Name  * hal_rx_get_flow_agg_continuation_6450() - retrieve flow agg
1430*5113495bSYour Name  *                                           continuation
1431*5113495bSYour Name  * @buf: buffer
1432*5113495bSYour Name  *
1433*5113495bSYour Name  * Return: flow agg
1434*5113495bSYour Name  */
1435*5113495bSYour Name static inline
hal_rx_get_flow_agg_continuation_6450(uint8_t * buf)1436*5113495bSYour Name bool hal_rx_get_flow_agg_continuation_6450(uint8_t *buf)
1437*5113495bSYour Name {
1438*5113495bSYour Name 	return HAL_RX_TLV_GET_FLOW_AGGR_CONT(buf);
1439*5113495bSYour Name }
1440*5113495bSYour Name 
1441*5113495bSYour Name /**
1442*5113495bSYour Name  * hal_rx_get_flow_agg_count_6450()- Retrieve flow agg count
1443*5113495bSYour Name  * @buf: buffer
1444*5113495bSYour Name  *
1445*5113495bSYour Name  * Return: flow agg count
1446*5113495bSYour Name  */
1447*5113495bSYour Name static inline
hal_rx_get_flow_agg_count_6450(uint8_t * buf)1448*5113495bSYour Name uint8_t hal_rx_get_flow_agg_count_6450(uint8_t *buf)
1449*5113495bSYour Name {
1450*5113495bSYour Name 	return HAL_RX_TLV_GET_FLOW_AGGR_COUNT(buf);
1451*5113495bSYour Name }
1452*5113495bSYour Name 
1453*5113495bSYour Name /**
1454*5113495bSYour Name  * hal_rx_get_fisa_timeout_6450() - Retrieve fisa timeout
1455*5113495bSYour Name  * @buf: buffer
1456*5113495bSYour Name  *
1457*5113495bSYour Name  * Return: fisa timeout
1458*5113495bSYour Name  */
1459*5113495bSYour Name static inline
hal_rx_get_fisa_timeout_6450(uint8_t * buf)1460*5113495bSYour Name bool hal_rx_get_fisa_timeout_6450(uint8_t *buf)
1461*5113495bSYour Name {
1462*5113495bSYour Name 	return HAL_RX_TLV_GET_FISA_TIMEOUT(buf);
1463*5113495bSYour Name }
1464*5113495bSYour Name 
1465*5113495bSYour Name /**
1466*5113495bSYour Name  * hal_rx_mpdu_start_tlv_tag_valid_6450 () - API to check if RX_MPDU_START
1467*5113495bSYour Name  * tlv tag is valid
1468*5113495bSYour Name  *
1469*5113495bSYour Name  *@rx_tlv_hdr: start address of rx_pkt_tlvs
1470*5113495bSYour Name  *
1471*5113495bSYour Name  * Return: true if RX_MPDU_START is valid, else false.
1472*5113495bSYour Name  */
hal_rx_mpdu_start_tlv_tag_valid_6450(void * rx_tlv_hdr)1473*5113495bSYour Name static uint8_t hal_rx_mpdu_start_tlv_tag_valid_6450(void *rx_tlv_hdr)
1474*5113495bSYour Name {
1475*5113495bSYour Name 	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)rx_tlv_hdr;
1476*5113495bSYour Name 	uint32_t tlv_tag;
1477*5113495bSYour Name 
1478*5113495bSYour Name 	tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(&rx_desc->mpdu_start_tlv);
1479*5113495bSYour Name 
1480*5113495bSYour Name 	return tlv_tag == WIFIRX_MPDU_START_E ? true : false;
1481*5113495bSYour Name }
1482*5113495bSYour Name 
1483*5113495bSYour Name /*
1484*5113495bSYour Name  * hal_rx_flow_setup_fse_6450() - Setup a flow search entry in HW FST
1485*5113495bSYour Name  * @fst: Pointer to the Rx Flow Search Table
1486*5113495bSYour Name  * @table_offset: offset into the table where the flow is to be setup
1487*5113495bSYour Name  * @flow: Flow Parameters
1488*5113495bSYour Name  *
1489*5113495bSYour Name  * Flow table entry fields are updated in host byte order, little endian order.
1490*5113495bSYour Name  *
1491*5113495bSYour Name  * Return: Success/Failure
1492*5113495bSYour Name  */
1493*5113495bSYour Name static void *
hal_rx_flow_setup_fse_6450(uint8_t * rx_fst,uint32_t table_offset,uint8_t * rx_flow)1494*5113495bSYour Name hal_rx_flow_setup_fse_6450(uint8_t *rx_fst, uint32_t table_offset,
1495*5113495bSYour Name 			   uint8_t *rx_flow)
1496*5113495bSYour Name {
1497*5113495bSYour Name 	struct hal_rx_fst *fst = (struct hal_rx_fst *)rx_fst;
1498*5113495bSYour Name 	struct hal_rx_flow *flow = (struct hal_rx_flow *)rx_flow;
1499*5113495bSYour Name 	uint8_t *fse;
1500*5113495bSYour Name 	bool fse_valid;
1501*5113495bSYour Name 
1502*5113495bSYour Name 	if (table_offset >= fst->max_entries) {
1503*5113495bSYour Name 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
1504*5113495bSYour Name 			  "HAL FSE table offset %u exceeds max entries %u",
1505*5113495bSYour Name 			  table_offset, fst->max_entries);
1506*5113495bSYour Name 		return NULL;
1507*5113495bSYour Name 	}
1508*5113495bSYour Name 
1509*5113495bSYour Name 	fse = (uint8_t *)fst->base_vaddr +
1510*5113495bSYour Name 		(table_offset * HAL_RX_FST_ENTRY_SIZE);
1511*5113495bSYour Name 
1512*5113495bSYour Name 	fse_valid = HAL_GET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID);
1513*5113495bSYour Name 
1514*5113495bSYour Name 	if (fse_valid) {
1515*5113495bSYour Name 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
1516*5113495bSYour Name 			  "HAL FSE %pK already valid", fse);
1517*5113495bSYour Name 		return NULL;
1518*5113495bSYour Name 	}
1519*5113495bSYour Name 
1520*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_0, SRC_IP_127_96) =
1521*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_0, SRC_IP_127_96,
1522*5113495bSYour Name 			       (flow->tuple_info.src_ip_127_96));
1523*5113495bSYour Name 
1524*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_1, SRC_IP_95_64) =
1525*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_1, SRC_IP_95_64,
1526*5113495bSYour Name 			       (flow->tuple_info.src_ip_95_64));
1527*5113495bSYour Name 
1528*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_2, SRC_IP_63_32) =
1529*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_2, SRC_IP_63_32,
1530*5113495bSYour Name 			       (flow->tuple_info.src_ip_63_32));
1531*5113495bSYour Name 
1532*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_3, SRC_IP_31_0) =
1533*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_3, SRC_IP_31_0,
1534*5113495bSYour Name 			       (flow->tuple_info.src_ip_31_0));
1535*5113495bSYour Name 
1536*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_4, DEST_IP_127_96) =
1537*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_4, DEST_IP_127_96,
1538*5113495bSYour Name 			       (flow->tuple_info.dest_ip_127_96));
1539*5113495bSYour Name 
1540*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_5, DEST_IP_95_64) =
1541*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_5, DEST_IP_95_64,
1542*5113495bSYour Name 			       (flow->tuple_info.dest_ip_95_64));
1543*5113495bSYour Name 
1544*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_6, DEST_IP_63_32) =
1545*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_6, DEST_IP_63_32,
1546*5113495bSYour Name 			       (flow->tuple_info.dest_ip_63_32));
1547*5113495bSYour Name 
1548*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_7, DEST_IP_31_0) =
1549*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_7, DEST_IP_31_0,
1550*5113495bSYour Name 			       (flow->tuple_info.dest_ip_31_0));
1551*5113495bSYour Name 
1552*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_8, DEST_PORT);
1553*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_8, DEST_PORT) |=
1554*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_8, DEST_PORT,
1555*5113495bSYour Name 			       (flow->tuple_info.dest_port));
1556*5113495bSYour Name 
1557*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_8, SRC_PORT);
1558*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_8, SRC_PORT) |=
1559*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_8, SRC_PORT,
1560*5113495bSYour Name 			       (flow->tuple_info.src_port));
1561*5113495bSYour Name 
1562*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, L4_PROTOCOL);
1563*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, L4_PROTOCOL) |=
1564*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, L4_PROTOCOL,
1565*5113495bSYour Name 			       flow->tuple_info.l4_protocol);
1566*5113495bSYour Name 
1567*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_HANDLER);
1568*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_HANDLER) |=
1569*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_HANDLER,
1570*5113495bSYour Name 			       flow->reo_destination_handler);
1571*5113495bSYour Name 
1572*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID);
1573*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID) |=
1574*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, VALID, 1);
1575*5113495bSYour Name 
1576*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_10, METADATA);
1577*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_10, METADATA) =
1578*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_10, METADATA,
1579*5113495bSYour Name 			       (flow->fse_metadata));
1580*5113495bSYour Name 
1581*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_INDICATION);
1582*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_INDICATION) |=
1583*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9,
1584*5113495bSYour Name 			       REO_DESTINATION_INDICATION,
1585*5113495bSYour Name 			       flow->reo_destination_indication);
1586*5113495bSYour Name 
1587*5113495bSYour Name 	/* Reset all the other fields in FSE */
1588*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, RESERVED_9);
1589*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, MSDU_DROP);
1590*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_11, MSDU_COUNT);
1591*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_12, MSDU_BYTE_COUNT);
1592*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_13, TIMESTAMP);
1593*5113495bSYour Name 
1594*5113495bSYour Name 	return fse;
1595*5113495bSYour Name }
1596*5113495bSYour Name 
1597*5113495bSYour Name /*
1598*5113495bSYour Name  * hal_rx_flow_setup_cmem_fse_6450() - Setup a flow search entry in HW CMEM FST
1599*5113495bSYour Name  * @hal_soc: hal_soc reference
1600*5113495bSYour Name  * @cmem_ba: CMEM base address
1601*5113495bSYour Name  * @table_offset: offset into the table where the flow is to be setup
1602*5113495bSYour Name  * @flow: Flow Parameters
1603*5113495bSYour Name  *
1604*5113495bSYour Name  * Return: Success/Failure
1605*5113495bSYour Name  */
1606*5113495bSYour Name static uint32_t
hal_rx_flow_setup_cmem_fse_6450(struct hal_soc * hal_soc,uint32_t cmem_ba,uint32_t table_offset,uint8_t * rx_flow)1607*5113495bSYour Name hal_rx_flow_setup_cmem_fse_6450(struct hal_soc *hal_soc, uint32_t cmem_ba,
1608*5113495bSYour Name 				uint32_t table_offset, uint8_t *rx_flow)
1609*5113495bSYour Name {
1610*5113495bSYour Name 	struct hal_rx_flow *flow = (struct hal_rx_flow *)rx_flow;
1611*5113495bSYour Name 	uint32_t fse_offset;
1612*5113495bSYour Name 	uint32_t value;
1613*5113495bSYour Name 
1614*5113495bSYour Name 	fse_offset = cmem_ba + (table_offset * HAL_RX_FST_ENTRY_SIZE);
1615*5113495bSYour Name 
1616*5113495bSYour Name 	/* Reset the Valid bit */
1617*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_9,
1618*5113495bSYour Name 							VALID), 0);
1619*5113495bSYour Name 
1620*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_0, SRC_IP_127_96,
1621*5113495bSYour Name 				(flow->tuple_info.src_ip_127_96));
1622*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_0,
1623*5113495bSYour Name 							SRC_IP_127_96), value);
1624*5113495bSYour Name 
1625*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_1, SRC_IP_95_64,
1626*5113495bSYour Name 				(flow->tuple_info.src_ip_95_64));
1627*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_1,
1628*5113495bSYour Name 							SRC_IP_95_64), value);
1629*5113495bSYour Name 
1630*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_2, SRC_IP_63_32,
1631*5113495bSYour Name 				(flow->tuple_info.src_ip_63_32));
1632*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_2,
1633*5113495bSYour Name 							SRC_IP_63_32), value);
1634*5113495bSYour Name 
1635*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_3, SRC_IP_31_0,
1636*5113495bSYour Name 				(flow->tuple_info.src_ip_31_0));
1637*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_3,
1638*5113495bSYour Name 							SRC_IP_31_0), value);
1639*5113495bSYour Name 
1640*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_4, DEST_IP_127_96,
1641*5113495bSYour Name 				(flow->tuple_info.dest_ip_127_96));
1642*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_4,
1643*5113495bSYour Name 							DEST_IP_127_96), value);
1644*5113495bSYour Name 
1645*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_5, DEST_IP_95_64,
1646*5113495bSYour Name 				(flow->tuple_info.dest_ip_95_64));
1647*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_5,
1648*5113495bSYour Name 							DEST_IP_95_64), value);
1649*5113495bSYour Name 
1650*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_6, DEST_IP_63_32,
1651*5113495bSYour Name 				(flow->tuple_info.dest_ip_63_32));
1652*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_6,
1653*5113495bSYour Name 							DEST_IP_63_32), value);
1654*5113495bSYour Name 
1655*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_7, DEST_IP_31_0,
1656*5113495bSYour Name 				(flow->tuple_info.dest_ip_31_0));
1657*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_7,
1658*5113495bSYour Name 							DEST_IP_31_0), value);
1659*5113495bSYour Name 
1660*5113495bSYour Name 	value = 0 | HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_8, DEST_PORT,
1661*5113495bSYour Name 				(flow->tuple_info.dest_port));
1662*5113495bSYour Name 	value |= HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_8, SRC_PORT,
1663*5113495bSYour Name 				(flow->tuple_info.src_port));
1664*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_8,
1665*5113495bSYour Name 							SRC_PORT), value);
1666*5113495bSYour Name 
1667*5113495bSYour Name 	value  = HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_10, METADATA,
1668*5113495bSYour Name 				(flow->fse_metadata));
1669*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_10,
1670*5113495bSYour Name 							METADATA), value);
1671*5113495bSYour Name 
1672*5113495bSYour Name 	/* Reset all the other fields in FSE */
1673*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_11,
1674*5113495bSYour Name 							MSDU_COUNT), 0);
1675*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_12,
1676*5113495bSYour Name 							MSDU_BYTE_COUNT), 0);
1677*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_13,
1678*5113495bSYour Name 							TIMESTAMP), 0);
1679*5113495bSYour Name 
1680*5113495bSYour Name 	value = 0 | HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, L4_PROTOCOL,
1681*5113495bSYour Name 				   flow->tuple_info.l4_protocol);
1682*5113495bSYour Name 	value |= HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_HANDLER,
1683*5113495bSYour Name 				flow->reo_destination_handler);
1684*5113495bSYour Name 	value |= HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9,
1685*5113495bSYour Name 				REO_DESTINATION_INDICATION,
1686*5113495bSYour Name 				flow->reo_destination_indication);
1687*5113495bSYour Name 	value |= HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, VALID, 1);
1688*5113495bSYour Name 	HAL_CMEM_WRITE(hal_soc, fse_offset + HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_9,
1689*5113495bSYour Name 							L4_PROTOCOL), value);
1690*5113495bSYour Name 
1691*5113495bSYour Name 	return fse_offset;
1692*5113495bSYour Name }
1693*5113495bSYour Name 
1694*5113495bSYour Name /**
1695*5113495bSYour Name  * hal_rx_flow_get_cmem_fse_ts_6450() - Get timestamp field from CMEM FSE
1696*5113495bSYour Name  * @hal_soc: hal_soc reference
1697*5113495bSYour Name  * @fse_offset: CMEM FSE offset
1698*5113495bSYour Name  *
1699*5113495bSYour Name  * Return: Timestamp
1700*5113495bSYour Name  */
hal_rx_flow_get_cmem_fse_ts_6450(struct hal_soc * hal_soc,uint32_t fse_offset)1701*5113495bSYour Name static uint32_t hal_rx_flow_get_cmem_fse_ts_6450(struct hal_soc *hal_soc,
1702*5113495bSYour Name 						 uint32_t fse_offset)
1703*5113495bSYour Name {
1704*5113495bSYour Name 	return HAL_CMEM_READ(hal_soc, fse_offset +
1705*5113495bSYour Name 			     HAL_OFFSET(RX_FLOW_SEARCH_ENTRY_13, TIMESTAMP));
1706*5113495bSYour Name }
1707*5113495bSYour Name 
1708*5113495bSYour Name /**
1709*5113495bSYour Name  * hal_rx_flow_get_cmem_fse_6450() - Get FSE from CMEM
1710*5113495bSYour Name  * @hal_soc: hal_soc reference
1711*5113495bSYour Name  * @fse_offset: CMEM FSE offset
1712*5113495bSYour Name  * @fse: reference where FSE will be copied
1713*5113495bSYour Name  * @len: length of FSE
1714*5113495bSYour Name  *
1715*5113495bSYour Name  * Return: If read is successful or not
1716*5113495bSYour Name  */
1717*5113495bSYour Name static void
hal_rx_flow_get_cmem_fse_6450(struct hal_soc * hal_soc,uint32_t fse_offset,uint32_t * fse,qdf_size_t len)1718*5113495bSYour Name hal_rx_flow_get_cmem_fse_6450(struct hal_soc *hal_soc, uint32_t fse_offset,
1719*5113495bSYour Name 			      uint32_t *fse, qdf_size_t len)
1720*5113495bSYour Name {
1721*5113495bSYour Name 	int i;
1722*5113495bSYour Name 
1723*5113495bSYour Name 	if (len != HAL_RX_FST_ENTRY_SIZE)
1724*5113495bSYour Name 		return;
1725*5113495bSYour Name 
1726*5113495bSYour Name 	for (i = 0; i < NUM_OF_DWORDS_RX_FLOW_SEARCH_ENTRY; i++)
1727*5113495bSYour Name 		fse[i] = HAL_CMEM_READ(hal_soc, fse_offset + i * 4);
1728*5113495bSYour Name }
1729*5113495bSYour Name 
1730*5113495bSYour Name /**
1731*5113495bSYour Name  * hal_rx_msdu_get_reo_destination_indication_6450: API to get
1732*5113495bSYour Name  * reo_destination_indication from rx_msdu_end TLV
1733*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
1734*5113495bSYour Name  * @reo_destination_ind: pointer to return value
1735*5113495bSYour Name  * of reo_destination_indication
1736*5113495bSYour Name  *
1737*5113495bSYour Name  * Return: none
1738*5113495bSYour Name  */
1739*5113495bSYour Name static void
hal_rx_msdu_get_reo_destination_indication_6450(uint8_t * buf,uint32_t * reo_destination_ind)1740*5113495bSYour Name hal_rx_msdu_get_reo_destination_indication_6450(uint8_t *buf,
1741*5113495bSYour Name 						uint32_t *reo_destination_ind)
1742*5113495bSYour Name {
1743*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1744*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1745*5113495bSYour Name 
1746*5113495bSYour Name 	*reo_destination_ind =
1747*5113495bSYour Name 			HAL_RX_MSDU_END_REO_DEST_IND_GET(msdu_end);
1748*5113495bSYour Name }
1749*5113495bSYour Name 
1750*5113495bSYour Name #ifdef WLAN_FEATURE_MARK_FIRST_WAKEUP_PACKET
hal_get_first_wow_wakeup_packet_6450(uint8_t * buf)1751*5113495bSYour Name static inline uint8_t hal_get_first_wow_wakeup_packet_6450(uint8_t *buf)
1752*5113495bSYour Name {
1753*5113495bSYour Name 	return 0;
1754*5113495bSYour Name }
1755*5113495bSYour Name #endif
1756*5113495bSYour Name 
1757*5113495bSYour Name /**
1758*5113495bSYour Name  * hal_rx_tlv_l3_type_get_6450() - Function to retrieve l3_type
1759*5113495bSYour Name  * @buf: Network buffer
1760*5113495bSYour Name  *
1761*5113495bSYour Name  * Return: l3_type
1762*5113495bSYour Name  */
hal_rx_tlv_l3_type_get_6450(uint8_t * buf)1763*5113495bSYour Name static uint32_t hal_rx_tlv_l3_type_get_6450(uint8_t *buf)
1764*5113495bSYour Name {
1765*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
1766*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1767*5113495bSYour Name 
1768*5113495bSYour Name 	return HAL_RX_MSDU_END_L3_TYPE_GET(msdu_end);
1769*5113495bSYour Name }
1770*5113495bSYour Name 
1771*5113495bSYour Name /**
1772*5113495bSYour Name  * hal_rx_msdu_start_get_len_6450(): API to get the MSDU length
1773*5113495bSYour Name  * from rx_msdu_start TLV
1774*5113495bSYour Name  *
1775*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
1776*5113495bSYour Name  * Return: (uint32_t)msdu length
1777*5113495bSYour Name  */
hal_rx_msdu_start_get_len_6450(uint8_t * buf)1778*5113495bSYour Name static uint32_t hal_rx_msdu_start_get_len_6450(uint8_t *buf)
1779*5113495bSYour Name {
1780*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1781*5113495bSYour Name 	struct rx_msdu_start *msdu_start =
1782*5113495bSYour Name 				&pkt_tlvs->msdu_start_tlv.rx_msdu_start;
1783*5113495bSYour Name 	uint32_t msdu_len;
1784*5113495bSYour Name 
1785*5113495bSYour Name 	msdu_len = HAL_RX_MSDU_START_MSDU_LEN_GET(msdu_start);
1786*5113495bSYour Name 
1787*5113495bSYour Name 	return msdu_len;
1788*5113495bSYour Name }
1789*5113495bSYour Name 
hal_hw_txrx_ops_attach_wcn6450(struct hal_soc * hal_soc)1790*5113495bSYour Name static void hal_hw_txrx_ops_attach_wcn6450(struct hal_soc *hal_soc)
1791*5113495bSYour Name {
1792*5113495bSYour Name 	/* Initialize setup tx/rx ops here */
1793*5113495bSYour Name 	hal_soc->ops->hal_srng_dst_hw_init = hal_srng_dst_hw_init_generic;
1794*5113495bSYour Name 	hal_soc->ops->hal_srng_src_hw_init = hal_srng_src_hw_init_generic;
1795*5113495bSYour Name 	hal_soc->ops->hal_get_hw_hptp = hal_get_hw_hptp_6450;
1796*5113495bSYour Name 	hal_soc->ops->hal_reo_setup = hal_reo_setup_6450;
1797*5113495bSYour Name 	hal_soc->ops->hal_get_window_address = hal_get_window_address_6450;
1798*5113495bSYour Name 	hal_soc->ops->hal_reo_set_err_dst_remap =
1799*5113495bSYour Name 				hal_reo_set_err_dst_remap_6450;
1800*5113495bSYour Name 
1801*5113495bSYour Name 	/* tx */
1802*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_dscp_tid_table_id =
1803*5113495bSYour Name 				hal_tx_desc_set_dscp_tid_table_id_6450;
1804*5113495bSYour Name 	hal_soc->ops->hal_tx_set_dscp_tid_map = hal_tx_set_dscp_tid_map_6450;
1805*5113495bSYour Name 	hal_soc->ops->hal_tx_update_dscp_tid = hal_tx_update_dscp_tid_6450;
1806*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_lmac_id = hal_tx_desc_set_lmac_id_6450;
1807*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_buf_addr =
1808*5113495bSYour Name 				hal_tx_desc_set_buf_addr_generic_rh;
1809*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_search_type =
1810*5113495bSYour Name 				hal_tx_desc_set_search_type_generic_rh;
1811*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_search_index =
1812*5113495bSYour Name 				hal_tx_desc_set_search_index_generic_rh;
1813*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_cache_set_num =
1814*5113495bSYour Name 				hal_tx_desc_set_cache_set_num_generic_rh;
1815*5113495bSYour Name 	hal_soc->ops->hal_tx_comp_get_status =
1816*5113495bSYour Name 				hal_tx_comp_get_status_generic_rh;
1817*5113495bSYour Name 	hal_soc->ops->hal_tx_comp_get_release_reason =
1818*5113495bSYour Name 				hal_tx_comp_get_release_reason_6450;
1819*5113495bSYour Name 	hal_soc->ops->hal_get_wbm_internal_error =
1820*5113495bSYour Name 				hal_get_wbm_internal_error_6450;
1821*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_mesh_en = hal_tx_desc_set_mesh_en_6450;
1822*5113495bSYour Name 	hal_soc->ops->hal_tx_init_cmd_credit_ring =
1823*5113495bSYour Name 				hal_tx_init_cmd_credit_ring_6450;
1824*5113495bSYour Name 
1825*5113495bSYour Name 	/* rx */
1826*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_start_nss_get =
1827*5113495bSYour Name 				hal_rx_msdu_start_nss_get_6450;
1828*5113495bSYour Name 	hal_soc->ops->hal_rx_mon_hw_desc_get_mpdu_status =
1829*5113495bSYour Name 				hal_rx_mon_hw_desc_get_mpdu_status_6450;
1830*5113495bSYour Name 	hal_soc->ops->hal_rx_get_tlv = hal_rx_get_tlv_6450;
1831*5113495bSYour Name 	hal_soc->ops->hal_rx_proc_phyrx_other_receive_info_tlv =
1832*5113495bSYour Name 				hal_rx_proc_phyrx_other_receive_info_tlv_6450;
1833*5113495bSYour Name 
1834*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_msdu_end_tlv =
1835*5113495bSYour Name 					hal_rx_dump_msdu_end_tlv_6450;
1836*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_rx_attention_tlv =
1837*5113495bSYour Name 					hal_rx_dump_rx_attention_tlv_generic_rh;
1838*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_msdu_start_tlv =
1839*5113495bSYour Name 					hal_rx_dump_msdu_start_tlv_6450;
1840*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_mpdu_start_tlv =
1841*5113495bSYour Name 					hal_rx_dump_mpdu_start_tlv_generic_rh;
1842*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_mpdu_end_tlv =
1843*5113495bSYour Name 					hal_rx_dump_mpdu_end_tlv_generic_rh;
1844*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_pkt_hdr_tlv =
1845*5113495bSYour Name 					hal_rx_dump_pkt_hdr_tlv_generic_rh;
1846*5113495bSYour Name 
1847*5113495bSYour Name 	hal_soc->ops->hal_get_link_desc_size = hal_get_link_desc_size_6450;
1848*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_tid_get =
1849*5113495bSYour Name 				hal_rx_mpdu_start_tid_get_6450;
1850*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_start_reception_type_get =
1851*5113495bSYour Name 				hal_rx_msdu_start_reception_type_get_6450;
1852*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_da_idx_get =
1853*5113495bSYour Name 				hal_rx_msdu_end_da_idx_get_6450;
1854*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_desc_info_get_ptr =
1855*5113495bSYour Name 				hal_rx_msdu_desc_info_get_ptr_6450;
1856*5113495bSYour Name 	hal_soc->ops->hal_rx_link_desc_msdu0_ptr =
1857*5113495bSYour Name 				hal_rx_link_desc_msdu0_ptr_6450;
1858*5113495bSYour Name 	hal_soc->ops->hal_reo_status_get_header =
1859*5113495bSYour Name 				hal_reo_status_get_header_6450;
1860*5113495bSYour Name 	hal_soc->ops->hal_rx_status_get_tlv_info =
1861*5113495bSYour Name 				hal_rx_status_get_tlv_info_generic_rh;
1862*5113495bSYour Name 	hal_soc->ops->hal_rx_wbm_err_info_get =
1863*5113495bSYour Name 				hal_rx_wbm_err_info_get_6450;
1864*5113495bSYour Name 	hal_soc->ops->hal_tx_set_pcp_tid_map =
1865*5113495bSYour Name 				hal_tx_set_pcp_tid_map_generic_rh;
1866*5113495bSYour Name 	hal_soc->ops->hal_tx_update_pcp_tid_map =
1867*5113495bSYour Name 				hal_tx_update_pcp_tid_generic_rh;
1868*5113495bSYour Name 	hal_soc->ops->hal_tx_set_tidmap_prty =
1869*5113495bSYour Name 				hal_tx_update_tidmap_prty_generic_rh;
1870*5113495bSYour Name 	hal_soc->ops->hal_rx_get_rx_fragment_number =
1871*5113495bSYour Name 				hal_rx_get_rx_fragment_number_6450;
1872*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_da_is_mcbc_get =
1873*5113495bSYour Name 				hal_rx_msdu_end_da_is_mcbc_get_6450;
1874*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_sa_is_valid_get =
1875*5113495bSYour Name 				hal_rx_msdu_end_sa_is_valid_get_6450;
1876*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_sa_idx_get =
1877*5113495bSYour Name 				hal_rx_msdu_end_sa_idx_get_6450;
1878*5113495bSYour Name 	hal_soc->ops->hal_rx_desc_is_first_msdu =
1879*5113495bSYour Name 				hal_rx_desc_is_first_msdu_6450;
1880*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_l3_hdr_padding_get =
1881*5113495bSYour Name 				hal_rx_msdu_end_l3_hdr_padding_get_6450;
1882*5113495bSYour Name 	hal_soc->ops->hal_rx_encryption_info_valid =
1883*5113495bSYour Name 				hal_rx_encryption_info_valid_6450;
1884*5113495bSYour Name 	hal_soc->ops->hal_rx_print_pn = hal_rx_print_pn_6450;
1885*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_first_msdu_get =
1886*5113495bSYour Name 				hal_rx_msdu_end_first_msdu_get_6450;
1887*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_da_is_valid_get =
1888*5113495bSYour Name 				hal_rx_msdu_end_da_is_valid_get_6450;
1889*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_last_msdu_get =
1890*5113495bSYour Name 				hal_rx_msdu_end_last_msdu_get_6450;
1891*5113495bSYour Name 	hal_soc->ops->hal_rx_get_mpdu_mac_ad4_valid =
1892*5113495bSYour Name 				hal_rx_get_mpdu_mac_ad4_valid_6450;
1893*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get =
1894*5113495bSYour Name 				hal_rx_mpdu_start_sw_peer_id_get_6450;
1895*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_peer_meta_data_get =
1896*5113495bSYour Name 				hal_rx_mpdu_peer_meta_data_get_rh;
1897*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_6450;
1898*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_6450;
1899*5113495bSYour Name 	hal_soc->ops->hal_rx_get_mpdu_frame_control_valid =
1900*5113495bSYour Name 				hal_rx_get_mpdu_frame_control_valid_6450;
1901*5113495bSYour Name 	hal_soc->ops->hal_rx_get_frame_ctrl_field =
1902*5113495bSYour Name 				hal_rx_get_frame_ctrl_field_rh;
1903*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_addr1 = hal_rx_mpdu_get_addr1_6450;
1904*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_addr2 = hal_rx_mpdu_get_addr2_6450;
1905*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_addr3 = hal_rx_mpdu_get_addr3_6450;
1906*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_addr4 = hal_rx_mpdu_get_addr4_6450;
1907*5113495bSYour Name 	hal_soc->ops->hal_rx_get_mpdu_sequence_control_valid =
1908*5113495bSYour Name 			hal_rx_get_mpdu_sequence_control_valid_6450;
1909*5113495bSYour Name 	hal_soc->ops->hal_rx_is_unicast = hal_rx_is_unicast_6450;
1910*5113495bSYour Name 	hal_soc->ops->hal_rx_tid_get = hal_rx_tid_get_6450;
1911*5113495bSYour Name 	hal_soc->ops->hal_rx_hw_desc_get_ppduid_get =
1912*5113495bSYour Name 				hal_rx_hw_desc_get_ppduid_get_6450;
1913*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu0_buffer_addr_lsb =
1914*5113495bSYour Name 				hal_rx_msdu0_buffer_addr_lsb_6450;
1915*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_desc_info_ptr_get =
1916*5113495bSYour Name 				hal_rx_msdu_desc_info_ptr_get_6450;
1917*5113495bSYour Name 	hal_soc->ops->hal_ent_mpdu_desc_info = hal_ent_mpdu_desc_info_6450;
1918*5113495bSYour Name 	hal_soc->ops->hal_dst_mpdu_desc_info = hal_dst_mpdu_desc_info_6450;
1919*5113495bSYour Name 	hal_soc->ops->hal_rx_get_fc_valid = hal_rx_get_fc_valid_6450;
1920*5113495bSYour Name 	hal_soc->ops->hal_rx_get_to_ds_flag = hal_rx_get_to_ds_flag_6450;
1921*5113495bSYour Name 	hal_soc->ops->hal_rx_get_mac_addr2_valid =
1922*5113495bSYour Name 				hal_rx_get_mac_addr2_valid_6450;
1923*5113495bSYour Name 	hal_soc->ops->hal_rx_get_filter_category =
1924*5113495bSYour Name 				hal_rx_get_filter_category_6450;
1925*5113495bSYour Name 	hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_6450;
1926*5113495bSYour Name 	hal_soc->ops->hal_reo_config = hal_reo_config_6450;
1927*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_flow_idx_get = hal_rx_msdu_flow_idx_get_6450;
1928*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_flow_idx_invalid =
1929*5113495bSYour Name 				hal_rx_msdu_flow_idx_invalid_6450;
1930*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_flow_idx_timeout =
1931*5113495bSYour Name 				hal_rx_msdu_flow_idx_timeout_6450;
1932*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_fse_metadata_get =
1933*5113495bSYour Name 				hal_rx_msdu_fse_metadata_get_6450;
1934*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_cce_match_get =
1935*5113495bSYour Name 				hal_rx_msdu_cce_match_get_rh;
1936*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_cce_metadata_get =
1937*5113495bSYour Name 				hal_rx_msdu_cce_metadata_get_6450;
1938*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_get_flow_params =
1939*5113495bSYour Name 				hal_rx_msdu_get_flow_params_6450;
1940*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_get_tcp_chksum =
1941*5113495bSYour Name 				hal_rx_tlv_get_tcp_chksum_6450;
1942*5113495bSYour Name 	hal_soc->ops->hal_rx_get_rx_sequence = hal_rx_get_rx_sequence_6450;
1943*5113495bSYour Name #if defined(QCA_WIFI_WCN6450) && defined(WLAN_CFR_ENABLE) && \
1944*5113495bSYour Name     defined(WLAN_ENH_CFR_ENABLE)
1945*5113495bSYour Name 	hal_soc->ops->hal_rx_get_bb_info = hal_rx_get_bb_info_6450;
1946*5113495bSYour Name 	hal_soc->ops->hal_rx_get_rtt_info = hal_rx_get_rtt_info_6450;
1947*5113495bSYour Name #endif
1948*5113495bSYour Name 
1949*5113495bSYour Name 	/* rx - msdu end fast path info fields */
1950*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_packet_metadata_get =
1951*5113495bSYour Name 				hal_rx_msdu_packet_metadata_get_generic_rh;
1952*5113495bSYour Name 	hal_soc->ops->hal_rx_get_fisa_cumulative_l4_checksum =
1953*5113495bSYour Name 				hal_rx_get_fisa_cumulative_l4_checksum_6450;
1954*5113495bSYour Name 	hal_soc->ops->hal_rx_get_fisa_cumulative_ip_length =
1955*5113495bSYour Name 				hal_rx_get_fisa_cumulative_ip_length_6450;
1956*5113495bSYour Name 	hal_soc->ops->hal_rx_get_udp_proto = hal_rx_get_udp_proto_6450;
1957*5113495bSYour Name 	hal_soc->ops->hal_rx_get_fisa_flow_agg_continuation =
1958*5113495bSYour Name 				hal_rx_get_flow_agg_continuation_6450;
1959*5113495bSYour Name 	hal_soc->ops->hal_rx_get_fisa_flow_agg_count =
1960*5113495bSYour Name 				hal_rx_get_flow_agg_count_6450;
1961*5113495bSYour Name 	hal_soc->ops->hal_rx_get_fisa_timeout = hal_rx_get_fisa_timeout_6450;
1962*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_tlv_tag_valid =
1963*5113495bSYour Name 				hal_rx_mpdu_start_tlv_tag_valid_6450;
1964*5113495bSYour Name 
1965*5113495bSYour Name 	/* rx - TLV struct offsets */
1966*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_offset_get =
1967*5113495bSYour Name 				hal_rx_msdu_end_offset_get_generic;
1968*5113495bSYour Name 	hal_soc->ops->hal_rx_attn_offset_get = hal_rx_attn_offset_get_generic;
1969*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_start_offset_get =
1970*5113495bSYour Name 				hal_rx_msdu_start_offset_get_generic;
1971*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_offset_get =
1972*5113495bSYour Name 				hal_rx_mpdu_start_offset_get_generic;
1973*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_end_offset_get =
1974*5113495bSYour Name 				hal_rx_mpdu_end_offset_get_generic;
1975*5113495bSYour Name #ifndef NO_RX_PKT_HDR_TLV
1976*5113495bSYour Name 	hal_soc->ops->hal_rx_pkt_tlv_offset_get =
1977*5113495bSYour Name 				hal_rx_pkt_tlv_offset_get_generic;
1978*5113495bSYour Name #endif
1979*5113495bSYour Name 	hal_soc->ops->hal_rx_flow_setup_fse = hal_rx_flow_setup_fse_6450;
1980*5113495bSYour Name 	hal_soc->ops->hal_rx_flow_get_tuple_info =
1981*5113495bSYour Name 				hal_rx_flow_get_tuple_info_rh;
1982*5113495bSYour Name 	hal_soc->ops->hal_rx_flow_delete_entry =
1983*5113495bSYour Name 				hal_rx_flow_delete_entry_rh;
1984*5113495bSYour Name 	hal_soc->ops->hal_rx_fst_get_fse_size = hal_rx_fst_get_fse_size_rh;
1985*5113495bSYour Name 	hal_soc->ops->hal_compute_reo_remap_ix2_ix3 =
1986*5113495bSYour Name 				hal_compute_reo_remap_ix2_ix3_6450;
1987*5113495bSYour Name 
1988*5113495bSYour Name 	/* CMEM FSE */
1989*5113495bSYour Name 	hal_soc->ops->hal_rx_flow_setup_cmem_fse =
1990*5113495bSYour Name 				hal_rx_flow_setup_cmem_fse_6450;
1991*5113495bSYour Name 	hal_soc->ops->hal_rx_flow_get_cmem_fse_ts =
1992*5113495bSYour Name 				hal_rx_flow_get_cmem_fse_ts_6450;
1993*5113495bSYour Name 	hal_soc->ops->hal_rx_flow_get_cmem_fse = hal_rx_flow_get_cmem_fse_6450;
1994*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_get_reo_destination_indication =
1995*5113495bSYour Name 			hal_rx_msdu_get_reo_destination_indication_6450;
1996*5113495bSYour Name 	hal_soc->ops->hal_setup_link_idle_list =
1997*5113495bSYour Name 				hal_setup_link_idle_list_6450;
1998*5113495bSYour Name #ifdef WLAN_FEATURE_MARK_FIRST_WAKEUP_PACKET
1999*5113495bSYour Name 	hal_soc->ops->hal_get_first_wow_wakeup_packet =
2000*5113495bSYour Name 				hal_get_first_wow_wakeup_packet_6450;
2001*5113495bSYour Name #endif
2002*5113495bSYour Name 	hal_soc->ops->hal_compute_reo_remap_ix0 =
2003*5113495bSYour Name 				hal_compute_reo_remap_ix0_6450;
2004*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_l3_type_get =
2005*5113495bSYour Name 		hal_rx_tlv_l3_type_get_6450;
2006*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_msdu_len_get =
2007*5113495bSYour Name 				hal_rx_msdu_start_get_len_6450;
2008*5113495bSYour Name }
2009*5113495bSYour Name 
2010*5113495bSYour Name /**
2011*5113495bSYour Name  * hal_wcn6450_attach() - Attach 6450 target specific hal_soc ops,
2012*5113495bSYour Name  *				offset and srng table
2013*5113495bSYour Name  * @hal_soc: HAL Soc handle
2014*5113495bSYour Name  *
2015*5113495bSYour Name  * Return: None
2016*5113495bSYour Name  */
hal_wcn6450_attach(struct hal_soc * hal_soc)2017*5113495bSYour Name void hal_wcn6450_attach(struct hal_soc *hal_soc)
2018*5113495bSYour Name {
2019*5113495bSYour Name 	hal_soc->hw_srng_table = hw_srng_table_wcn6450;
2020*5113495bSYour Name 	hal_hw_txrx_default_ops_attach_rh(hal_soc);
2021*5113495bSYour Name 	hal_hw_txrx_ops_attach_wcn6450(hal_soc);
2022*5113495bSYour Name }
2023