xref: /wlan-driver/qca-wifi-host-cmn/hal/wifi3.0/qca8074v1/hal_8074v1.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021-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 #include "hal_li_hw_headers.h"
20*5113495bSYour Name #include "hal_internal.h"
21*5113495bSYour Name #include "hal_api.h"
22*5113495bSYour Name #include "target_type.h"
23*5113495bSYour Name #include "wcss_version.h"
24*5113495bSYour Name #include "qdf_module.h"
25*5113495bSYour Name #include "hal_flow.h"
26*5113495bSYour Name #include "rx_flow_search_entry.h"
27*5113495bSYour Name #include "hal_rx_flow_info.h"
28*5113495bSYour Name 
29*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_OFFSET \
30*5113495bSYour Name 	RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_OFFSET
31*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_MASK \
32*5113495bSYour Name 	RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_MASK
33*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_LSB \
34*5113495bSYour Name 	RXPCU_PPDU_END_INFO_8_RX_PPDU_DURATION_LSB
35*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_11_PHYRX_ABORT_REQUEST_INFO_DETAILS_PHYRX_ABORT_REASON_OFFSET \
36*5113495bSYour Name 	RXPCU_PPDU_END_INFO_10_PHYRX_ABORT_REQUEST_INFO_PHYRX_ABORT_REQUEST_INFO_DETAILS_OFFSET
37*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_11_PHYRX_ABORT_REQUEST_INFO_DETAILS_PHYRX_ABORT_REASON_MASK \
38*5113495bSYour Name 	RXPCU_PPDU_END_INFO_10_PHYRX_ABORT_REQUEST_INFO_PHYRX_ABORT_REQUEST_INFO_DETAILS_MASK
39*5113495bSYour Name #define UNIFIED_RXPCU_PPDU_END_INFO_11_PHYRX_ABORT_REQUEST_INFO_DETAILS_PHYRX_ABORT_REASON_LSB \
40*5113495bSYour Name 	RXPCU_PPDU_END_INFO_10_PHYRX_ABORT_REQUEST_INFO_PHYRX_ABORT_REQUEST_INFO_DETAILS_LSB
41*5113495bSYour Name #define UNIFIED_PHYRX_HT_SIG_0_HT_SIG_INFO_PHYRX_HT_SIG_INFO_DETAILS_OFFSET \
42*5113495bSYour Name 	PHYRX_HT_SIG_0_HT_SIG_INFO_PHYRX_HT_SIG_INFO_DETAILS_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_L_SIG_B_INFO_PHYRX_L_SIG_B_INFO_DETAILS_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_L_SIG_A_INFO_PHYRX_L_SIG_A_INFO_DETAILS_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_VHT_SIG_A_INFO_PHYRX_VHT_SIG_A_INFO_DETAILS_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_HE_SIG_A_SU_INFO_PHYRX_HE_SIG_A_SU_INFO_DETAILS_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_HE_SIG_A_MU_DL_INFO_PHYRX_HE_SIG_A_MU_DL_INFO_DETAILS_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_HE_SIG_B1_MU_INFO_PHYRX_HE_SIG_B1_MU_INFO_DETAILS_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_HE_SIG_B2_MU_INFO_PHYRX_HE_SIG_B2_MU_INFO_DETAILS_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_HE_SIG_B2_OFDMA_INFO_PHYRX_HE_SIG_B2_OFDMA_INFO_DETAILS_OFFSET
59*5113495bSYour Name #define UNIFIED_PHYRX_RSSI_LEGACY_3_RECEIVE_RSSI_INFO_PRE_RSSI_INFO_DETAILS_OFFSET \
60*5113495bSYour Name 	PHYRX_RSSI_LEGACY_3_RECEIVE_RSSI_INFO_PRE_RSSI_INFO_DETAILS_OFFSET
61*5113495bSYour Name #define UNIFIED_PHYRX_RSSI_LEGACY_19_RECEIVE_RSSI_INFO_PREAMBLE_RSSI_INFO_DETAILS_OFFSET \
62*5113495bSYour Name 	PHYRX_RSSI_LEGACY_19_RECEIVE_RSSI_INFO_PREAMBLE_RSSI_INFO_DETAILS_OFFSET
63*5113495bSYour Name #define UNIFIED_RX_MPDU_START_0_RX_MPDU_INFO_RX_MPDU_INFO_DETAILS_OFFSET \
64*5113495bSYour Name 	RX_MPDU_START_0_RX_MPDU_INFO_RX_MPDU_INFO_DETAILS_OFFSET
65*5113495bSYour Name #define UNIFIED_RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET \
66*5113495bSYour Name 	RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET
67*5113495bSYour Name #define UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET \
68*5113495bSYour Name 	RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET
69*5113495bSYour Name #define UNIFIED_RX_MPDU_DETAILS_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET \
70*5113495bSYour Name 	RX_MPDU_DETAILS_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET
71*5113495bSYour Name #define UNIFIED_REO_DESTINATION_RING_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET \
72*5113495bSYour Name 	REO_DESTINATION_RING_2_RX_MPDU_DESC_INFO_RX_MPDU_DESC_INFO_DETAILS_OFFSET
73*5113495bSYour Name #define UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC \
74*5113495bSYour Name 	UNIFORM_REO_STATUS_HEADER_STATUS_HEADER
75*5113495bSYour Name #define UNIFIED_RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSE \
76*5113495bSYour Name 	RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_RX_MSDU_DESC_INFO_DETAILS_OFFSET
77*5113495bSYour Name #define UNIFIED_RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET \
78*5113495bSYour Name 	RX_MSDU_LINK_8_RX_MSDU_DETAILS_MSDU_0_OFFSET
79*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_0_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET \
80*5113495bSYour Name 	TCL_DATA_CMD_0_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET
81*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_1_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET \
82*5113495bSYour Name 	TCL_DATA_CMD_1_BUFFER_ADDR_INFO_BUF_ADDR_INFO_OFFSET
83*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET \
84*5113495bSYour Name 	TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET
85*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_LSB \
86*5113495bSYour Name 	BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_LSB
87*5113495bSYour Name #define UNIFIED_BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_MASK \
88*5113495bSYour Name 	BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_MASK
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_LSB \
102*5113495bSYour Name 	TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB
103*5113495bSYour Name #define UNIFIED_TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK \
104*5113495bSYour Name 	TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK
105*5113495bSYour Name #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_MASK \
106*5113495bSYour Name 	WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_MASK
107*5113495bSYour Name #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_OFFSET \
108*5113495bSYour Name 	WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_OFFSET
109*5113495bSYour Name #define UNIFIED_WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_LSB \
110*5113495bSYour Name 	WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_LSB
111*5113495bSYour Name 
112*5113495bSYour Name #include "hal_8074v1_tx.h"
113*5113495bSYour Name #include "hal_8074v1_rx.h"
114*5113495bSYour Name #include <hal_generic_api.h>
115*5113495bSYour Name #include "hal_li_rx.h"
116*5113495bSYour Name #include "hal_li_tx.h"
117*5113495bSYour Name #include "hal_li_api.h"
118*5113495bSYour Name #include "hal_li_generic_api.h"
119*5113495bSYour Name 
120*5113495bSYour Name /**
121*5113495bSYour Name  * hal_get_window_address_8074() - Function to get hp/tp address
122*5113495bSYour Name  * @hal_soc: Pointer to hal_soc
123*5113495bSYour Name  * @addr: address offset of register
124*5113495bSYour Name  *
125*5113495bSYour Name  * Return: modified address offset of register
126*5113495bSYour Name  */
hal_get_window_address_8074(struct hal_soc * hal_soc,qdf_iomem_t addr)127*5113495bSYour Name static inline qdf_iomem_t hal_get_window_address_8074(struct hal_soc *hal_soc,
128*5113495bSYour Name 						      qdf_iomem_t addr)
129*5113495bSYour Name {
130*5113495bSYour Name 	return addr;
131*5113495bSYour Name }
132*5113495bSYour Name 
133*5113495bSYour Name /**
134*5113495bSYour Name  * hal_rx_get_rx_fragment_number_8074v1() - Function to retrieve
135*5113495bSYour Name  *                                         rx fragment number
136*5113495bSYour Name  * @buf: Network buffer
137*5113495bSYour Name  *
138*5113495bSYour Name  * Return: rx fragment number
139*5113495bSYour Name  */
140*5113495bSYour Name static
hal_rx_get_rx_fragment_number_8074v1(uint8_t * buf)141*5113495bSYour Name uint8_t hal_rx_get_rx_fragment_number_8074v1(uint8_t *buf)
142*5113495bSYour Name {
143*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
144*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
145*5113495bSYour Name 
146*5113495bSYour Name 	/* Return first 4 bits as fragment number */
147*5113495bSYour Name 	return (HAL_RX_MPDU_GET_SEQUENCE_NUMBER(rx_mpdu_info) &
148*5113495bSYour Name 		DOT11_SEQ_FRAG_MASK);
149*5113495bSYour Name }
150*5113495bSYour Name 
151*5113495bSYour Name /**
152*5113495bSYour Name  * hal_rx_msdu_end_da_is_mcbc_get_8074v1() - API to check if pkt is MCBC
153*5113495bSYour Name  *                                           from rx_msdu_end TLV
154*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
155*5113495bSYour Name  *
156*5113495bSYour Name  * Return: da_is_mcbc
157*5113495bSYour Name  */
158*5113495bSYour Name static uint8_t
hal_rx_msdu_end_da_is_mcbc_get_8074v1(uint8_t * buf)159*5113495bSYour Name hal_rx_msdu_end_da_is_mcbc_get_8074v1(uint8_t *buf)
160*5113495bSYour Name {
161*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
162*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
163*5113495bSYour Name 
164*5113495bSYour Name 	return HAL_RX_MSDU_END_DA_IS_MCBC_GET(msdu_end);
165*5113495bSYour Name }
166*5113495bSYour Name 
167*5113495bSYour Name /**
168*5113495bSYour Name  * hal_rx_msdu_end_sa_is_valid_get_8074v1() - API to get_8074v1 the
169*5113495bSYour Name  *                                            sa_is_valid bit from
170*5113495bSYour Name  *                                            rx_msdu_end TLV
171*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
172*5113495bSYour Name  *
173*5113495bSYour Name  * Return: sa_is_valid bit
174*5113495bSYour Name  */
175*5113495bSYour Name static uint8_t
hal_rx_msdu_end_sa_is_valid_get_8074v1(uint8_t * buf)176*5113495bSYour Name hal_rx_msdu_end_sa_is_valid_get_8074v1(uint8_t *buf)
177*5113495bSYour Name {
178*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
179*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
180*5113495bSYour Name 	uint8_t sa_is_valid;
181*5113495bSYour Name 
182*5113495bSYour Name 	sa_is_valid = HAL_RX_MSDU_END_SA_IS_VALID_GET(msdu_end);
183*5113495bSYour Name 
184*5113495bSYour Name 	return sa_is_valid;
185*5113495bSYour Name }
186*5113495bSYour Name 
187*5113495bSYour Name /**
188*5113495bSYour Name  * hal_rx_msdu_end_sa_idx_get_8074v1() - API to get_8074v1 the sa_idx from
189*5113495bSYour Name  *                                       rx_msdu_end TLV
190*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
191*5113495bSYour Name  *
192*5113495bSYour Name  * Return: sa_idx (SA AST index)
193*5113495bSYour Name  */
hal_rx_msdu_end_sa_idx_get_8074v1(uint8_t * buf)194*5113495bSYour Name static uint16_t hal_rx_msdu_end_sa_idx_get_8074v1(uint8_t *buf)
195*5113495bSYour Name {
196*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
197*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
198*5113495bSYour Name 	uint16_t sa_idx;
199*5113495bSYour Name 
200*5113495bSYour Name 	sa_idx = HAL_RX_MSDU_END_SA_IDX_GET(msdu_end);
201*5113495bSYour Name 
202*5113495bSYour Name 	return sa_idx;
203*5113495bSYour Name }
204*5113495bSYour Name 
205*5113495bSYour Name /**
206*5113495bSYour Name  * hal_rx_desc_is_first_msdu_8074v1() - Check if first msdu
207*5113495bSYour Name  * @hw_desc_addr: hardware descriptor address
208*5113495bSYour Name  *
209*5113495bSYour Name  * Return: 0 - success/ non-zero failure
210*5113495bSYour Name  */
hal_rx_desc_is_first_msdu_8074v1(void * hw_desc_addr)211*5113495bSYour Name static uint32_t hal_rx_desc_is_first_msdu_8074v1(void *hw_desc_addr)
212*5113495bSYour Name {
213*5113495bSYour Name 	struct rx_pkt_tlvs *rx_tlvs = (struct rx_pkt_tlvs *)hw_desc_addr;
214*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &rx_tlvs->msdu_end_tlv.rx_msdu_end;
215*5113495bSYour Name 
216*5113495bSYour Name 	return HAL_RX_GET(msdu_end, RX_MSDU_END_5, FIRST_MSDU);
217*5113495bSYour Name }
218*5113495bSYour Name 
219*5113495bSYour Name /**
220*5113495bSYour Name  * hal_rx_msdu_end_l3_hdr_padding_get_8074v1() - API to get_8074v1 the
221*5113495bSYour Name  *                                               l3_header padding from
222*5113495bSYour Name  *                                               rx_msdu_end TLV
223*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
224*5113495bSYour Name  *
225*5113495bSYour Name  * Return: number of l3 header padding bytes
226*5113495bSYour Name  */
hal_rx_msdu_end_l3_hdr_padding_get_8074v1(uint8_t * buf)227*5113495bSYour Name static uint32_t hal_rx_msdu_end_l3_hdr_padding_get_8074v1(uint8_t *buf)
228*5113495bSYour Name {
229*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
230*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
231*5113495bSYour Name 	uint32_t l3_header_padding;
232*5113495bSYour Name 
233*5113495bSYour Name 	l3_header_padding = HAL_RX_MSDU_END_L3_HEADER_PADDING_GET(msdu_end);
234*5113495bSYour Name 
235*5113495bSYour Name 	return l3_header_padding;
236*5113495bSYour Name }
237*5113495bSYour Name 
238*5113495bSYour Name /**
239*5113495bSYour Name  * hal_rx_encryption_info_valid_8074v1() - Returns encryption type.
240*5113495bSYour Name  * @buf: rx_tlv_hdr of the received packet
241*5113495bSYour Name  *
242*5113495bSYour Name  * Return: encryption type
243*5113495bSYour Name  */
hal_rx_encryption_info_valid_8074v1(uint8_t * buf)244*5113495bSYour Name static uint32_t hal_rx_encryption_info_valid_8074v1(uint8_t *buf)
245*5113495bSYour Name {
246*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
247*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
248*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
249*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
250*5113495bSYour Name 	uint32_t encryption_info = HAL_RX_MPDU_ENCRYPTION_INFO_VALID(mpdu_info);
251*5113495bSYour Name 
252*5113495bSYour Name 	return encryption_info;
253*5113495bSYour Name }
254*5113495bSYour Name 
255*5113495bSYour Name /**
256*5113495bSYour Name  * hal_rx_print_pn_8074v1() - Prints the PN of rx packet.
257*5113495bSYour Name  * @buf: rx_tlv_hdr of the received packet
258*5113495bSYour Name  *
259*5113495bSYour Name  * Return: void
260*5113495bSYour Name  */
hal_rx_print_pn_8074v1(uint8_t * buf)261*5113495bSYour Name static void hal_rx_print_pn_8074v1(uint8_t *buf)
262*5113495bSYour Name {
263*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
264*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
265*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
266*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
267*5113495bSYour Name 
268*5113495bSYour Name 	uint32_t pn_31_0 = HAL_RX_MPDU_PN_31_0_GET(mpdu_info);
269*5113495bSYour Name 	uint32_t pn_63_32 = HAL_RX_MPDU_PN_63_32_GET(mpdu_info);
270*5113495bSYour Name 	uint32_t pn_95_64 = HAL_RX_MPDU_PN_95_64_GET(mpdu_info);
271*5113495bSYour Name 	uint32_t pn_127_96 = HAL_RX_MPDU_PN_127_96_GET(mpdu_info);
272*5113495bSYour Name 
273*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",
274*5113495bSYour Name 		  pn_127_96, pn_95_64, pn_63_32, pn_31_0);
275*5113495bSYour Name }
276*5113495bSYour Name 
277*5113495bSYour Name /**
278*5113495bSYour Name  * hal_rx_msdu_end_first_msdu_get_8074v1() - API to get first msdu status
279*5113495bSYour Name  *                                           from rx_msdu_end TLV
280*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
281*5113495bSYour Name  *
282*5113495bSYour Name  * Return: first_msdu
283*5113495bSYour Name  */
284*5113495bSYour Name static uint8_t
hal_rx_msdu_end_first_msdu_get_8074v1(uint8_t * buf)285*5113495bSYour Name hal_rx_msdu_end_first_msdu_get_8074v1(uint8_t *buf)
286*5113495bSYour Name {
287*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
288*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
289*5113495bSYour Name 	uint8_t first_msdu;
290*5113495bSYour Name 
291*5113495bSYour Name 	first_msdu = HAL_RX_MSDU_END_FIRST_MSDU_GET(msdu_end);
292*5113495bSYour Name 
293*5113495bSYour Name 	return first_msdu;
294*5113495bSYour Name }
295*5113495bSYour Name 
296*5113495bSYour Name /**
297*5113495bSYour Name  * hal_rx_msdu_end_da_is_valid_get_8074v1() - API to check if da is valid from
298*5113495bSYour Name  *                                            rx_msdu_end TLV
299*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
300*5113495bSYour Name  *
301*5113495bSYour Name  * Return: da_is_valid
302*5113495bSYour Name  */
hal_rx_msdu_end_da_is_valid_get_8074v1(uint8_t * buf)303*5113495bSYour Name static uint8_t hal_rx_msdu_end_da_is_valid_get_8074v1(uint8_t *buf)
304*5113495bSYour Name {
305*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
306*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
307*5113495bSYour Name 	uint8_t da_is_valid;
308*5113495bSYour Name 
309*5113495bSYour Name 	da_is_valid = HAL_RX_MSDU_END_DA_IS_VALID_GET(msdu_end);
310*5113495bSYour Name 
311*5113495bSYour Name 	return da_is_valid;
312*5113495bSYour Name }
313*5113495bSYour Name 
314*5113495bSYour Name /**
315*5113495bSYour Name  * hal_rx_msdu_end_last_msdu_get_8074v1() - API to get last msdu status from
316*5113495bSYour Name  *                                          rx_msdu_end TLV
317*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
318*5113495bSYour Name  *
319*5113495bSYour Name  * Return: last_msdu
320*5113495bSYour Name  */
hal_rx_msdu_end_last_msdu_get_8074v1(uint8_t * buf)321*5113495bSYour Name static uint8_t hal_rx_msdu_end_last_msdu_get_8074v1(uint8_t *buf)
322*5113495bSYour Name {
323*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
324*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
325*5113495bSYour Name 	uint8_t last_msdu;
326*5113495bSYour Name 
327*5113495bSYour Name 	last_msdu = HAL_RX_MSDU_END_LAST_MSDU_GET(msdu_end);
328*5113495bSYour Name 
329*5113495bSYour Name 	return last_msdu;
330*5113495bSYour Name }
331*5113495bSYour Name 
332*5113495bSYour Name /**
333*5113495bSYour Name  * hal_rx_get_mpdu_mac_ad4_valid_8074v1() - Retrieves if mpdu 4th addr is valid
334*5113495bSYour Name  * @buf: Network buffer
335*5113495bSYour Name  *
336*5113495bSYour Name  * Return: value of mpdu 4th address valid field
337*5113495bSYour Name  */
hal_rx_get_mpdu_mac_ad4_valid_8074v1(uint8_t * buf)338*5113495bSYour Name static bool hal_rx_get_mpdu_mac_ad4_valid_8074v1(uint8_t *buf)
339*5113495bSYour Name {
340*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
341*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
342*5113495bSYour Name 	bool ad4_valid = 0;
343*5113495bSYour Name 
344*5113495bSYour Name 	ad4_valid = HAL_RX_MPDU_GET_MAC_AD4_VALID(rx_mpdu_info);
345*5113495bSYour Name 
346*5113495bSYour Name 	return ad4_valid;
347*5113495bSYour Name }
348*5113495bSYour Name 
349*5113495bSYour Name /**
350*5113495bSYour Name  * hal_rx_mpdu_start_sw_peer_id_get_8074v1() - Retrieve sw peer_id
351*5113495bSYour Name  * @buf: network buffer
352*5113495bSYour Name  *
353*5113495bSYour Name  * Return: sw peer_id
354*5113495bSYour Name  */
hal_rx_mpdu_start_sw_peer_id_get_8074v1(uint8_t * buf)355*5113495bSYour Name static uint32_t hal_rx_mpdu_start_sw_peer_id_get_8074v1(uint8_t *buf)
356*5113495bSYour Name {
357*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
358*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
359*5113495bSYour Name 			&pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
360*5113495bSYour Name 
361*5113495bSYour Name 	return HAL_RX_MPDU_INFO_SW_PEER_ID_GET(
362*5113495bSYour Name 		&mpdu_start->rx_mpdu_info_details);
363*5113495bSYour Name }
364*5113495bSYour Name 
365*5113495bSYour Name /**
366*5113495bSYour Name  * hal_rx_mpdu_get_to_ds_8074v1() - API to get the tods info from rx_mpdu_start
367*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
368*5113495bSYour Name  *
369*5113495bSYour Name  * Return: uint32_t(to_ds)
370*5113495bSYour Name  */
371*5113495bSYour Name 
hal_rx_mpdu_get_to_ds_8074v1(uint8_t * buf)372*5113495bSYour Name static uint32_t hal_rx_mpdu_get_to_ds_8074v1(uint8_t *buf)
373*5113495bSYour Name {
374*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
375*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
376*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
377*5113495bSYour Name 
378*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
379*5113495bSYour Name 
380*5113495bSYour Name 	return HAL_RX_MPDU_GET_TODS(mpdu_info);
381*5113495bSYour Name }
382*5113495bSYour Name 
383*5113495bSYour Name /**
384*5113495bSYour Name  * hal_rx_mpdu_get_fr_ds_8074v1() - API to get the from ds info from
385*5113495bSYour Name  *                                  rx_mpdu_start
386*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
387*5113495bSYour Name  *
388*5113495bSYour Name  * Return: uint32_t(fr_ds)
389*5113495bSYour Name  */
hal_rx_mpdu_get_fr_ds_8074v1(uint8_t * buf)390*5113495bSYour Name static uint32_t hal_rx_mpdu_get_fr_ds_8074v1(uint8_t *buf)
391*5113495bSYour Name {
392*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
393*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
394*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
395*5113495bSYour Name 
396*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
397*5113495bSYour Name 
398*5113495bSYour Name 	return HAL_RX_MPDU_GET_FROMDS(mpdu_info);
399*5113495bSYour Name }
400*5113495bSYour Name 
401*5113495bSYour Name /**
402*5113495bSYour Name  * hal_rx_get_mpdu_frame_control_valid_8074v1() - Retrieves mpdu frame control
403*5113495bSYour Name  *                                                valid
404*5113495bSYour Name  * @buf: Network buffer
405*5113495bSYour Name  *
406*5113495bSYour Name  * Return: value of frame control valid field
407*5113495bSYour Name  */
hal_rx_get_mpdu_frame_control_valid_8074v1(uint8_t * buf)408*5113495bSYour Name static uint8_t hal_rx_get_mpdu_frame_control_valid_8074v1(uint8_t *buf)
409*5113495bSYour Name {
410*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
411*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
412*5113495bSYour Name 
413*5113495bSYour Name 	return HAL_RX_MPDU_GET_FRAME_CONTROL_VALID(rx_mpdu_info);
414*5113495bSYour Name }
415*5113495bSYour Name 
416*5113495bSYour Name /**
417*5113495bSYour Name  * hal_rx_get_mpdu_frame_control_field_8074v1() - Function to retrieve frame
418*5113495bSYour Name  *                                                control field
419*5113495bSYour Name  * @buf: Network buffer
420*5113495bSYour Name  *
421*5113495bSYour Name  * Return: value of frame control field
422*5113495bSYour Name  *
423*5113495bSYour Name  */
hal_rx_get_mpdu_frame_control_field_8074v1(uint8_t * buf)424*5113495bSYour Name static uint16_t hal_rx_get_mpdu_frame_control_field_8074v1(uint8_t *buf)
425*5113495bSYour Name {
426*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
427*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
428*5113495bSYour Name 	uint16_t frame_ctrl = 0;
429*5113495bSYour Name 
430*5113495bSYour Name 	frame_ctrl = HAL_RX_MPDU_GET_FRAME_CONTROL_FIELD(rx_mpdu_info);
431*5113495bSYour Name 
432*5113495bSYour Name 	return frame_ctrl;
433*5113495bSYour Name }
434*5113495bSYour Name 
435*5113495bSYour Name /**
436*5113495bSYour Name  * hal_rx_mpdu_get_addr1_8074v1() - API to check get address1 of the mpdu
437*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headera
438*5113495bSYour Name  * @mac_addr: pointer to mac address
439*5113495bSYour Name  *
440*5113495bSYour Name  * Return: success/failure
441*5113495bSYour Name  */
hal_rx_mpdu_get_addr1_8074v1(uint8_t * buf,uint8_t * mac_addr)442*5113495bSYour Name static QDF_STATUS hal_rx_mpdu_get_addr1_8074v1(uint8_t *buf,
443*5113495bSYour Name 					       uint8_t *mac_addr)
444*5113495bSYour Name {
445*5113495bSYour Name 	struct __attribute__((__packed__)) hal_addr1 {
446*5113495bSYour Name 		uint32_t ad1_31_0;
447*5113495bSYour Name 		uint16_t ad1_47_32;
448*5113495bSYour Name 	};
449*5113495bSYour Name 
450*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
451*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
452*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
453*5113495bSYour Name 
454*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
455*5113495bSYour Name 	struct hal_addr1 *addr = (struct hal_addr1 *)mac_addr;
456*5113495bSYour Name 	uint32_t mac_addr_ad1_valid;
457*5113495bSYour Name 
458*5113495bSYour Name 	mac_addr_ad1_valid = HAL_RX_MPDU_MAC_ADDR_AD1_VALID_GET(mpdu_info);
459*5113495bSYour Name 
460*5113495bSYour Name 	if (mac_addr_ad1_valid) {
461*5113495bSYour Name 		addr->ad1_31_0 = HAL_RX_MPDU_AD1_31_0_GET(mpdu_info);
462*5113495bSYour Name 		addr->ad1_47_32 = HAL_RX_MPDU_AD1_47_32_GET(mpdu_info);
463*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
464*5113495bSYour Name 	}
465*5113495bSYour Name 
466*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
467*5113495bSYour Name }
468*5113495bSYour Name 
469*5113495bSYour Name /**
470*5113495bSYour Name  * hal_rx_mpdu_get_addr2_8074v1() - API to check get address2 of the mpdu
471*5113495bSYour Name  *                                  in the packet
472*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
473*5113495bSYour Name  * @mac_addr: pointer to mac address
474*5113495bSYour Name  *
475*5113495bSYour Name  * Return: success/failure
476*5113495bSYour Name  */
hal_rx_mpdu_get_addr2_8074v1(uint8_t * buf,uint8_t * mac_addr)477*5113495bSYour Name static QDF_STATUS hal_rx_mpdu_get_addr2_8074v1(uint8_t *buf, uint8_t *mac_addr)
478*5113495bSYour Name {
479*5113495bSYour Name 	struct __attribute__((__packed__)) hal_addr2 {
480*5113495bSYour Name 		uint16_t ad2_15_0;
481*5113495bSYour Name 		uint32_t ad2_47_16;
482*5113495bSYour Name 	};
483*5113495bSYour Name 
484*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
485*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
486*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
487*5113495bSYour Name 
488*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
489*5113495bSYour Name 	struct hal_addr2 *addr = (struct hal_addr2 *)mac_addr;
490*5113495bSYour Name 	uint32_t mac_addr_ad2_valid;
491*5113495bSYour Name 
492*5113495bSYour Name 	mac_addr_ad2_valid = HAL_RX_MPDU_MAC_ADDR_AD2_VALID_GET(mpdu_info);
493*5113495bSYour Name 
494*5113495bSYour Name 	if (mac_addr_ad2_valid) {
495*5113495bSYour Name 		addr->ad2_15_0 = HAL_RX_MPDU_AD2_15_0_GET(mpdu_info);
496*5113495bSYour Name 		addr->ad2_47_16 = HAL_RX_MPDU_AD2_47_16_GET(mpdu_info);
497*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
498*5113495bSYour Name 	}
499*5113495bSYour Name 
500*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
501*5113495bSYour Name }
502*5113495bSYour Name 
503*5113495bSYour Name /**
504*5113495bSYour Name  * hal_rx_mpdu_get_addr3_8074v1() - API to get address3 of the mpdu
505*5113495bSYour Name  *                                  in the packet
506*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
507*5113495bSYour Name  * @mac_addr: pointer to mac address
508*5113495bSYour Name  *
509*5113495bSYour Name  * Return: success/failure
510*5113495bSYour Name  */
hal_rx_mpdu_get_addr3_8074v1(uint8_t * buf,uint8_t * mac_addr)511*5113495bSYour Name static QDF_STATUS hal_rx_mpdu_get_addr3_8074v1(uint8_t *buf, uint8_t *mac_addr)
512*5113495bSYour Name {
513*5113495bSYour Name 	struct __attribute__((__packed__)) hal_addr3 {
514*5113495bSYour Name 		uint32_t ad3_31_0;
515*5113495bSYour Name 		uint16_t ad3_47_32;
516*5113495bSYour Name 	};
517*5113495bSYour Name 
518*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
519*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
520*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
521*5113495bSYour Name 
522*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
523*5113495bSYour Name 	struct hal_addr3 *addr = (struct hal_addr3 *)mac_addr;
524*5113495bSYour Name 	uint32_t mac_addr_ad3_valid;
525*5113495bSYour Name 
526*5113495bSYour Name 	mac_addr_ad3_valid = HAL_RX_MPDU_MAC_ADDR_AD3_VALID_GET(mpdu_info);
527*5113495bSYour Name 
528*5113495bSYour Name 	if (mac_addr_ad3_valid) {
529*5113495bSYour Name 		addr->ad3_31_0 = HAL_RX_MPDU_AD3_31_0_GET(mpdu_info);
530*5113495bSYour Name 		addr->ad3_47_32 = HAL_RX_MPDU_AD3_47_32_GET(mpdu_info);
531*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
532*5113495bSYour Name 	}
533*5113495bSYour Name 
534*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
535*5113495bSYour Name }
536*5113495bSYour Name 
537*5113495bSYour Name /**
538*5113495bSYour Name  * hal_rx_mpdu_get_addr4_8074v1() - API to get address4 of the mpdu
539*5113495bSYour Name  *                                  in the packet
540*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV header
541*5113495bSYour Name  * @mac_addr: pointer to mac address
542*5113495bSYour Name  *
543*5113495bSYour Name  * Return: success/failure
544*5113495bSYour Name  */
hal_rx_mpdu_get_addr4_8074v1(uint8_t * buf,uint8_t * mac_addr)545*5113495bSYour Name static QDF_STATUS hal_rx_mpdu_get_addr4_8074v1(uint8_t *buf, uint8_t *mac_addr)
546*5113495bSYour Name {
547*5113495bSYour Name 	struct __attribute__((__packed__)) hal_addr4 {
548*5113495bSYour Name 		uint32_t ad4_31_0;
549*5113495bSYour Name 		uint16_t ad4_47_32;
550*5113495bSYour Name 	};
551*5113495bSYour Name 
552*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
553*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
554*5113495bSYour Name 				 &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
555*5113495bSYour Name 
556*5113495bSYour Name 	struct rx_mpdu_info *mpdu_info = &mpdu_start->rx_mpdu_info_details;
557*5113495bSYour Name 	struct hal_addr4 *addr = (struct hal_addr4 *)mac_addr;
558*5113495bSYour Name 	uint32_t mac_addr_ad4_valid;
559*5113495bSYour Name 
560*5113495bSYour Name 	mac_addr_ad4_valid = HAL_RX_MPDU_MAC_ADDR_AD4_VALID_GET(mpdu_info);
561*5113495bSYour Name 
562*5113495bSYour Name 	if (mac_addr_ad4_valid) {
563*5113495bSYour Name 		addr->ad4_31_0 = HAL_RX_MPDU_AD4_31_0_GET(mpdu_info);
564*5113495bSYour Name 		addr->ad4_47_32 = HAL_RX_MPDU_AD4_47_32_GET(mpdu_info);
565*5113495bSYour Name 		return QDF_STATUS_SUCCESS;
566*5113495bSYour Name 	}
567*5113495bSYour Name 
568*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
569*5113495bSYour Name }
570*5113495bSYour Name 
571*5113495bSYour Name /**
572*5113495bSYour Name  * hal_rx_get_mpdu_sequence_control_valid_8074v1() - Get mpdu sequence control
573*5113495bSYour Name  *                                                   valid
574*5113495bSYour Name  * @buf: Network buffer
575*5113495bSYour Name  *
576*5113495bSYour Name  * Return: value of sequence control valid field
577*5113495bSYour Name  */
hal_rx_get_mpdu_sequence_control_valid_8074v1(uint8_t * buf)578*5113495bSYour Name static uint8_t hal_rx_get_mpdu_sequence_control_valid_8074v1(uint8_t *buf)
579*5113495bSYour Name {
580*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
581*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
582*5113495bSYour Name 
583*5113495bSYour Name 	return HAL_RX_MPDU_GET_SEQUENCE_CONTROL_VALID(rx_mpdu_info);
584*5113495bSYour Name }
585*5113495bSYour Name 
586*5113495bSYour Name /**
587*5113495bSYour Name  * hal_rx_is_unicast_8074v1() - check packet is unicast frame or not.
588*5113495bSYour Name  * @buf: pointer to rx pkt TLV.
589*5113495bSYour Name  *
590*5113495bSYour Name  * Return: true on unicast.
591*5113495bSYour Name  */
hal_rx_is_unicast_8074v1(uint8_t * buf)592*5113495bSYour Name static bool hal_rx_is_unicast_8074v1(uint8_t *buf)
593*5113495bSYour Name {
594*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
595*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
596*5113495bSYour Name 		&pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
597*5113495bSYour Name 	uint32_t grp_id;
598*5113495bSYour Name 	uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details;
599*5113495bSYour Name 
600*5113495bSYour Name 	grp_id = (_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info),
601*5113495bSYour Name 			   RX_MPDU_INFO_0_SW_FRAME_GROUP_ID_OFFSET)),
602*5113495bSYour Name 			  RX_MPDU_INFO_0_SW_FRAME_GROUP_ID_MASK,
603*5113495bSYour Name 			  RX_MPDU_INFO_0_SW_FRAME_GROUP_ID_LSB));
604*5113495bSYour Name 
605*5113495bSYour Name 	return (HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA == grp_id) ? true : false;
606*5113495bSYour Name }
607*5113495bSYour Name 
608*5113495bSYour Name /**
609*5113495bSYour Name  * hal_rx_tid_get_8074v1() - get tid based on qos control valid.
610*5113495bSYour Name  * @hal_soc_hdl: HAL SoC handle
611*5113495bSYour Name  * @buf: pointer to rx pkt TLV.
612*5113495bSYour Name  *
613*5113495bSYour Name  * Return: tid
614*5113495bSYour Name  */
hal_rx_tid_get_8074v1(hal_soc_handle_t hal_soc_hdl,uint8_t * buf)615*5113495bSYour Name static uint32_t hal_rx_tid_get_8074v1(hal_soc_handle_t hal_soc_hdl,
616*5113495bSYour Name 				      uint8_t *buf)
617*5113495bSYour Name {
618*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
619*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
620*5113495bSYour Name 	&pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
621*5113495bSYour Name 	uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details;
622*5113495bSYour Name 	uint8_t qos_control_valid =
623*5113495bSYour Name 		(_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info),
624*5113495bSYour Name 			  RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_OFFSET)),
625*5113495bSYour Name 			 RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_MASK,
626*5113495bSYour Name 			 RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_LSB));
627*5113495bSYour Name 
628*5113495bSYour Name 	if (qos_control_valid)
629*5113495bSYour Name 		return hal_rx_mpdu_start_tid_get_8074(buf);
630*5113495bSYour Name 
631*5113495bSYour Name 	return HAL_RX_NON_QOS_TID;
632*5113495bSYour Name }
633*5113495bSYour Name 
634*5113495bSYour Name /**
635*5113495bSYour Name  * hal_rx_hw_desc_get_ppduid_get_8074v1() - retrieve ppdu id
636*5113495bSYour Name  * @rx_tlv_hdr: Rx tlv header
637*5113495bSYour Name  * @rxdma_dst_ring_desc: Rx HW descriptor
638*5113495bSYour Name  *
639*5113495bSYour Name  * Return: ppdu id
640*5113495bSYour Name  */
hal_rx_hw_desc_get_ppduid_get_8074v1(void * rx_tlv_hdr,void * rxdma_dst_ring_desc)641*5113495bSYour Name static uint32_t hal_rx_hw_desc_get_ppduid_get_8074v1(void *rx_tlv_hdr,
642*5113495bSYour Name 						     void *rxdma_dst_ring_desc)
643*5113495bSYour Name {
644*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info;
645*5113495bSYour Name 	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)rx_tlv_hdr;
646*5113495bSYour Name 
647*5113495bSYour Name 	rx_mpdu_info =
648*5113495bSYour Name 		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
649*5113495bSYour Name 
650*5113495bSYour Name 	return HAL_RX_GET(rx_mpdu_info, RX_MPDU_INFO_0, PHY_PPDU_ID);
651*5113495bSYour Name }
652*5113495bSYour Name 
653*5113495bSYour Name /**
654*5113495bSYour Name  * hal_reo_status_get_header_8074v1() - Process reo desc info
655*5113495bSYour Name  * @ring_desc: REO status ring descriptor
656*5113495bSYour Name  * @b: tlv type info
657*5113495bSYour Name  * @h1: Pointer to hal_reo_status_header where info to be stored
658*5113495bSYour Name  *
659*5113495bSYour Name  * Return - none.
660*5113495bSYour Name  *
661*5113495bSYour Name  */
hal_reo_status_get_header_8074v1(hal_ring_desc_t ring_desc,int b,void * h1)662*5113495bSYour Name static void hal_reo_status_get_header_8074v1(hal_ring_desc_t ring_desc, int b,
663*5113495bSYour Name 					     void *h1)
664*5113495bSYour Name {
665*5113495bSYour Name 	uint32_t *d = (uint32_t *)ring_desc;
666*5113495bSYour Name 	uint32_t val1 = 0;
667*5113495bSYour Name 	struct hal_reo_status_header *h =
668*5113495bSYour Name 			(struct hal_reo_status_header *)h1;
669*5113495bSYour Name 
670*5113495bSYour Name 	/* Offsets of descriptor fields defined in HW headers start
671*5113495bSYour Name 	 * from the field after TLV header
672*5113495bSYour Name 	 */
673*5113495bSYour Name 	d += HAL_GET_NUM_DWORDS(sizeof(struct tlv_32_hdr));
674*5113495bSYour Name 
675*5113495bSYour Name 	switch (b) {
676*5113495bSYour Name 	case HAL_REO_QUEUE_STATS_STATUS_TLV:
677*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_GET_QUEUE_STATS_STATUS_0,
678*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)];
679*5113495bSYour Name 		break;
680*5113495bSYour Name 	case HAL_REO_FLUSH_QUEUE_STATUS_TLV:
681*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_FLUSH_QUEUE_STATUS_0,
682*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)];
683*5113495bSYour Name 		break;
684*5113495bSYour Name 	case HAL_REO_FLUSH_CACHE_STATUS_TLV:
685*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_FLUSH_CACHE_STATUS_0,
686*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)];
687*5113495bSYour Name 		break;
688*5113495bSYour Name 	case HAL_REO_UNBLK_CACHE_STATUS_TLV:
689*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_UNBLOCK_CACHE_STATUS_0,
690*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)];
691*5113495bSYour Name 		break;
692*5113495bSYour Name 	case HAL_REO_TIMOUT_LIST_STATUS_TLV:
693*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_FLUSH_TIMEOUT_LIST_STATUS_0,
694*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)];
695*5113495bSYour Name 		break;
696*5113495bSYour Name 	case HAL_REO_DESC_THRES_STATUS_TLV:
697*5113495bSYour Name 		val1 =
698*5113495bSYour Name 		d[HAL_OFFSET_DW(REO_DESCRIPTOR_THRESHOLD_REACHED_STATUS_0,
699*5113495bSYour Name 		UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)];
700*5113495bSYour Name 		break;
701*5113495bSYour Name 	case HAL_REO_UPDATE_RX_QUEUE_STATUS_TLV:
702*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_UPDATE_RX_REO_QUEUE_STATUS_0,
703*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER)];
704*5113495bSYour Name 		break;
705*5113495bSYour Name 	default:
706*5113495bSYour Name 		qdf_nofl_err("ERROR: Unknown tlv\n");
707*5113495bSYour Name 		break;
708*5113495bSYour Name 	}
709*5113495bSYour Name 	h->cmd_num =
710*5113495bSYour Name 		HAL_GET_FIELD(
711*5113495bSYour Name 			      UNIFORM_REO_STATUS_HEADER_0, REO_STATUS_NUMBER,
712*5113495bSYour Name 			      val1);
713*5113495bSYour Name 	h->exec_time =
714*5113495bSYour Name 		HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER_0,
715*5113495bSYour Name 			      CMD_EXECUTION_TIME, val1);
716*5113495bSYour Name 	h->status =
717*5113495bSYour Name 		HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER_0,
718*5113495bSYour Name 			      REO_CMD_EXECUTION_STATUS, val1);
719*5113495bSYour Name 	switch (b) {
720*5113495bSYour Name 	case HAL_REO_QUEUE_STATS_STATUS_TLV:
721*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_GET_QUEUE_STATS_STATUS_1,
722*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)];
723*5113495bSYour Name 		break;
724*5113495bSYour Name 	case HAL_REO_FLUSH_QUEUE_STATUS_TLV:
725*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_FLUSH_QUEUE_STATUS_1,
726*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)];
727*5113495bSYour Name 		break;
728*5113495bSYour Name 	case HAL_REO_FLUSH_CACHE_STATUS_TLV:
729*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_FLUSH_CACHE_STATUS_1,
730*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)];
731*5113495bSYour Name 		break;
732*5113495bSYour Name 	case HAL_REO_UNBLK_CACHE_STATUS_TLV:
733*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_UNBLOCK_CACHE_STATUS_1,
734*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)];
735*5113495bSYour Name 		break;
736*5113495bSYour Name 	case HAL_REO_TIMOUT_LIST_STATUS_TLV:
737*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_FLUSH_TIMEOUT_LIST_STATUS_1,
738*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)];
739*5113495bSYour Name 		break;
740*5113495bSYour Name 	case HAL_REO_DESC_THRES_STATUS_TLV:
741*5113495bSYour Name 		val1 =
742*5113495bSYour Name 		  d[HAL_OFFSET_DW(REO_DESCRIPTOR_THRESHOLD_REACHED_STATUS_1,
743*5113495bSYour Name 		  UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)];
744*5113495bSYour Name 		break;
745*5113495bSYour Name 	case HAL_REO_UPDATE_RX_QUEUE_STATUS_TLV:
746*5113495bSYour Name 		val1 = d[HAL_OFFSET_DW(REO_UPDATE_RX_REO_QUEUE_STATUS_1,
747*5113495bSYour Name 			UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_GENERIC)];
748*5113495bSYour Name 		break;
749*5113495bSYour Name 	default:
750*5113495bSYour Name 		qdf_nofl_err("ERROR: Unknown tlv\n");
751*5113495bSYour Name 		break;
752*5113495bSYour Name 	}
753*5113495bSYour Name 	h->tstamp =
754*5113495bSYour Name 		HAL_GET_FIELD(UNIFORM_REO_STATUS_HEADER_1, TIMESTAMP, val1);
755*5113495bSYour Name }
756*5113495bSYour Name 
757*5113495bSYour Name /**
758*5113495bSYour Name  * hal_rx_mpdu_start_mpdu_qos_control_valid_get_8074v1() -
759*5113495bSYour Name  *                                 Retrieve qos control valid bit from the tlv.
760*5113495bSYour Name  * @buf: pointer to rx pkt TLV.
761*5113495bSYour Name  *
762*5113495bSYour Name  * Return: qos control value.
763*5113495bSYour Name  */
764*5113495bSYour Name static inline uint32_t
hal_rx_mpdu_start_mpdu_qos_control_valid_get_8074v1(uint8_t * buf)765*5113495bSYour Name hal_rx_mpdu_start_mpdu_qos_control_valid_get_8074v1(uint8_t *buf)
766*5113495bSYour Name {
767*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
768*5113495bSYour Name 	struct rx_mpdu_start *mpdu_start =
769*5113495bSYour Name 			&pkt_tlvs->mpdu_start_tlv.rx_mpdu_start;
770*5113495bSYour Name 
771*5113495bSYour Name 	return HAL_RX_MPDU_INFO_QOS_CONTROL_VALID_GET(
772*5113495bSYour Name 		&mpdu_start->rx_mpdu_info_details);
773*5113495bSYour Name }
774*5113495bSYour Name 
775*5113495bSYour Name /**
776*5113495bSYour Name  * hal_rx_msdu_end_sa_sw_peer_id_get_8074v1() - API to get the sa_sw_peer_id
777*5113495bSYour Name  *                                              from rx_msdu_end TLV
778*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
779*5113495bSYour Name  *
780*5113495bSYour Name  * Return: sa_sw_peer_id index
781*5113495bSYour Name  */
782*5113495bSYour Name static inline uint32_t
hal_rx_msdu_end_sa_sw_peer_id_get_8074v1(uint8_t * buf)783*5113495bSYour Name hal_rx_msdu_end_sa_sw_peer_id_get_8074v1(uint8_t *buf)
784*5113495bSYour Name {
785*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
786*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
787*5113495bSYour Name 
788*5113495bSYour Name 	return HAL_RX_MSDU_END_SA_SW_PEER_ID_GET(msdu_end);
789*5113495bSYour Name }
790*5113495bSYour Name 
791*5113495bSYour Name /**
792*5113495bSYour Name  * hal_tx_desc_set_mesh_en_8074v1() - Set mesh_enable flag in Tx descriptor
793*5113495bSYour Name  * @desc: Handle to Tx Descriptor
794*5113495bSYour Name  * @en:   For raw WiFi frames, this indicates transmission to a mesh STA,
795*5113495bSYour Name  *        enabling the interpretation of the 'Mesh Control Present' bit
796*5113495bSYour Name  *        (bit 8) of QoS Control (otherwise this bit is ignored),
797*5113495bSYour Name  *        For native WiFi frames, this indicates that a 'Mesh Control' field
798*5113495bSYour Name  *        is present between the header and the LLC.
799*5113495bSYour Name  *
800*5113495bSYour Name  * Return: void
801*5113495bSYour Name  */
802*5113495bSYour Name static inline
hal_tx_desc_set_mesh_en_8074v1(void * desc,uint8_t en)803*5113495bSYour Name void hal_tx_desc_set_mesh_en_8074v1(void *desc, uint8_t en)
804*5113495bSYour Name {
805*5113495bSYour Name 	HAL_SET_FLD(desc, TCL_DATA_CMD_4, MESH_ENABLE) |=
806*5113495bSYour Name 		HAL_TX_SM(TCL_DATA_CMD_4, MESH_ENABLE, en);
807*5113495bSYour Name }
808*5113495bSYour Name 
809*5113495bSYour Name static
hal_rx_msdu0_buffer_addr_lsb_8074v1(void * link_desc_va)810*5113495bSYour Name void *hal_rx_msdu0_buffer_addr_lsb_8074v1(void *link_desc_va)
811*5113495bSYour Name {
812*5113495bSYour Name 	return (void *)HAL_RX_MSDU0_BUFFER_ADDR_LSB(link_desc_va);
813*5113495bSYour Name }
814*5113495bSYour Name 
815*5113495bSYour Name static
hal_rx_msdu_desc_info_ptr_get_8074v1(void * msdu0)816*5113495bSYour Name void *hal_rx_msdu_desc_info_ptr_get_8074v1(void *msdu0)
817*5113495bSYour Name {
818*5113495bSYour Name 	return (void *)HAL_RX_MSDU_DESC_INFO_PTR_GET(msdu0);
819*5113495bSYour Name }
820*5113495bSYour Name 
821*5113495bSYour Name static
hal_ent_mpdu_desc_info_8074v1(void * ent_ring_desc)822*5113495bSYour Name void *hal_ent_mpdu_desc_info_8074v1(void *ent_ring_desc)
823*5113495bSYour Name {
824*5113495bSYour Name 	return (void *)HAL_ENT_MPDU_DESC_INFO(ent_ring_desc);
825*5113495bSYour Name }
826*5113495bSYour Name 
827*5113495bSYour Name static
hal_dst_mpdu_desc_info_8074v1(void * dst_ring_desc)828*5113495bSYour Name void *hal_dst_mpdu_desc_info_8074v1(void *dst_ring_desc)
829*5113495bSYour Name {
830*5113495bSYour Name 	return (void *)HAL_DST_MPDU_DESC_INFO(dst_ring_desc);
831*5113495bSYour Name }
832*5113495bSYour Name 
833*5113495bSYour Name static
hal_rx_get_fc_valid_8074v1(uint8_t * buf)834*5113495bSYour Name uint8_t hal_rx_get_fc_valid_8074v1(uint8_t *buf)
835*5113495bSYour Name {
836*5113495bSYour Name 	return HAL_RX_GET_FC_VALID(buf);
837*5113495bSYour Name }
838*5113495bSYour Name 
hal_rx_get_to_ds_flag_8074v1(uint8_t * buf)839*5113495bSYour Name static uint8_t hal_rx_get_to_ds_flag_8074v1(uint8_t *buf)
840*5113495bSYour Name {
841*5113495bSYour Name 	return HAL_RX_GET_TO_DS_FLAG(buf);
842*5113495bSYour Name }
843*5113495bSYour Name 
hal_rx_get_mac_addr2_valid_8074v1(uint8_t * buf)844*5113495bSYour Name static uint8_t hal_rx_get_mac_addr2_valid_8074v1(uint8_t *buf)
845*5113495bSYour Name {
846*5113495bSYour Name 	return HAL_RX_GET_MAC_ADDR2_VALID(buf);
847*5113495bSYour Name }
848*5113495bSYour Name 
hal_rx_get_filter_category_8074v1(uint8_t * buf)849*5113495bSYour Name static uint8_t hal_rx_get_filter_category_8074v1(uint8_t *buf)
850*5113495bSYour Name {
851*5113495bSYour Name 	return HAL_RX_GET_FILTER_CATEGORY(buf);
852*5113495bSYour Name }
853*5113495bSYour Name 
854*5113495bSYour Name static uint32_t
hal_rx_get_ppdu_id_8074v1(uint8_t * buf)855*5113495bSYour Name hal_rx_get_ppdu_id_8074v1(uint8_t *buf)
856*5113495bSYour Name {
857*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info;
858*5113495bSYour Name 	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)buf;
859*5113495bSYour Name 
860*5113495bSYour Name 	rx_mpdu_info =
861*5113495bSYour Name 		&rx_desc->mpdu_start_tlv.rx_mpdu_start.rx_mpdu_info_details;
862*5113495bSYour Name 
863*5113495bSYour Name 	return HAL_RX_GET_PPDU_ID(rx_mpdu_info);
864*5113495bSYour Name }
865*5113495bSYour Name 
866*5113495bSYour Name /**
867*5113495bSYour Name  * hal_reo_config_8074v1() - Set reo config parameters
868*5113495bSYour Name  * @soc: hal soc handle
869*5113495bSYour Name  * @reg_val: value to be set
870*5113495bSYour Name  * @reo_params: reo parameters
871*5113495bSYour Name  *
872*5113495bSYour Name  * Return: void
873*5113495bSYour Name  */
874*5113495bSYour Name static void
hal_reo_config_8074v1(struct hal_soc * soc,uint32_t reg_val,struct hal_reo_params * reo_params)875*5113495bSYour Name hal_reo_config_8074v1(struct hal_soc *soc,
876*5113495bSYour Name 		      uint32_t reg_val,
877*5113495bSYour Name 		      struct hal_reo_params *reo_params)
878*5113495bSYour Name {
879*5113495bSYour Name 	HAL_REO_R0_CONFIG(soc, reg_val, reo_params);
880*5113495bSYour Name }
881*5113495bSYour Name 
882*5113495bSYour Name /**
883*5113495bSYour Name  * hal_rx_msdu_desc_info_get_ptr_8074v1() - Get msdu desc info ptr
884*5113495bSYour Name  * @msdu_details_ptr: Pointer to msdu_details_ptr
885*5113495bSYour Name  *
886*5113495bSYour Name  * Return - Pointer to rx_msdu_desc_info structure.
887*5113495bSYour Name  *
888*5113495bSYour Name  */
hal_rx_msdu_desc_info_get_ptr_8074v1(void * msdu_details_ptr)889*5113495bSYour Name static void *hal_rx_msdu_desc_info_get_ptr_8074v1(void *msdu_details_ptr)
890*5113495bSYour Name {
891*5113495bSYour Name 	return HAL_RX_MSDU_DESC_INFO_GET(msdu_details_ptr);
892*5113495bSYour Name }
893*5113495bSYour Name 
894*5113495bSYour Name /**
895*5113495bSYour Name  * hal_rx_link_desc_msdu0_ptr_8074v1() - Get pointer to rx_msdu details
896*5113495bSYour Name  * @link_desc: Pointer to link desc
897*5113495bSYour Name  *
898*5113495bSYour Name  * Return - Pointer to rx_msdu_details structure
899*5113495bSYour Name  *
900*5113495bSYour Name  */
hal_rx_link_desc_msdu0_ptr_8074v1(void * link_desc)901*5113495bSYour Name static void *hal_rx_link_desc_msdu0_ptr_8074v1(void *link_desc)
902*5113495bSYour Name {
903*5113495bSYour Name 	return HAL_RX_LINK_DESC_MSDU0_PTR(link_desc);
904*5113495bSYour Name }
905*5113495bSYour Name 
906*5113495bSYour Name /**
907*5113495bSYour Name  * hal_rx_msdu_flow_idx_get_8074v1() - API to get flow index from
908*5113495bSYour Name  *                                     rx_msdu_end TLV
909*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
910*5113495bSYour Name  *
911*5113495bSYour Name  * Return: flow index value from MSDU END TLV
912*5113495bSYour Name  */
hal_rx_msdu_flow_idx_get_8074v1(uint8_t * buf)913*5113495bSYour Name static inline uint32_t hal_rx_msdu_flow_idx_get_8074v1(uint8_t *buf)
914*5113495bSYour Name {
915*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
916*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
917*5113495bSYour Name 
918*5113495bSYour Name 	return HAL_RX_MSDU_END_FLOW_IDX_GET(msdu_end);
919*5113495bSYour Name }
920*5113495bSYour Name 
921*5113495bSYour Name /**
922*5113495bSYour Name  * hal_rx_msdu_flow_idx_invalid_8074v1() - API to get flow index invalid
923*5113495bSYour Name  *                                         from rx_msdu_end TLV
924*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
925*5113495bSYour Name  *
926*5113495bSYour Name  * Return: flow index invalid value from MSDU END TLV
927*5113495bSYour Name  */
hal_rx_msdu_flow_idx_invalid_8074v1(uint8_t * buf)928*5113495bSYour Name static bool hal_rx_msdu_flow_idx_invalid_8074v1(uint8_t *buf)
929*5113495bSYour Name {
930*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
931*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
932*5113495bSYour Name 
933*5113495bSYour Name 	return HAL_RX_MSDU_END_FLOW_IDX_INVALID_GET(msdu_end);
934*5113495bSYour Name }
935*5113495bSYour Name 
936*5113495bSYour Name /**
937*5113495bSYour Name  * hal_rx_msdu_flow_idx_timeout_8074v1() - API to get flow index timeout
938*5113495bSYour Name  *                                         from rx_msdu_end TLV
939*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
940*5113495bSYour Name  *
941*5113495bSYour Name  * Return: flow index timeout value from MSDU END TLV
942*5113495bSYour Name  */
hal_rx_msdu_flow_idx_timeout_8074v1(uint8_t * buf)943*5113495bSYour Name static bool hal_rx_msdu_flow_idx_timeout_8074v1(uint8_t *buf)
944*5113495bSYour Name {
945*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
946*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
947*5113495bSYour Name 
948*5113495bSYour Name 	return HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
949*5113495bSYour Name }
950*5113495bSYour Name 
951*5113495bSYour Name /**
952*5113495bSYour Name  * hal_rx_msdu_fse_metadata_get_8074v1() - API to get FSE metadata
953*5113495bSYour Name  *                                         from rx_msdu_end TLV
954*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
955*5113495bSYour Name  *
956*5113495bSYour Name  * Return: fse metadata value from MSDU END TLV
957*5113495bSYour Name  */
hal_rx_msdu_fse_metadata_get_8074v1(uint8_t * buf)958*5113495bSYour Name static uint32_t hal_rx_msdu_fse_metadata_get_8074v1(uint8_t *buf)
959*5113495bSYour Name {
960*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
961*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
962*5113495bSYour Name 
963*5113495bSYour Name 	return HAL_RX_MSDU_END_FSE_METADATA_GET(msdu_end);
964*5113495bSYour Name }
965*5113495bSYour Name 
966*5113495bSYour Name /**
967*5113495bSYour Name  * hal_rx_msdu_cce_metadata_get_8074v1() - API to get CCE metadata
968*5113495bSYour Name  *                                         from rx_msdu_end TLV
969*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
970*5113495bSYour Name  *
971*5113495bSYour Name  * Return: cce_metadata
972*5113495bSYour Name  */
973*5113495bSYour Name static uint16_t
hal_rx_msdu_cce_metadata_get_8074v1(uint8_t * buf)974*5113495bSYour Name hal_rx_msdu_cce_metadata_get_8074v1(uint8_t *buf)
975*5113495bSYour Name {
976*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
977*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
978*5113495bSYour Name 
979*5113495bSYour Name 	return HAL_RX_MSDU_END_CCE_METADATA_GET(msdu_end);
980*5113495bSYour Name }
981*5113495bSYour Name 
982*5113495bSYour Name /**
983*5113495bSYour Name  * hal_rx_msdu_get_flow_params_8074v1() - API to get flow index, flow index
984*5113495bSYour Name  *                                        invalid and flow index timeout from
985*5113495bSYour Name  *                                        rx_msdu_end TLV
986*5113495bSYour Name  * @buf: pointer to the start of RX PKT TLV headers
987*5113495bSYour Name  * @flow_invalid: pointer to return value of flow_idx_valid
988*5113495bSYour Name  * @flow_timeout: pointer to return value of flow_idx_timeout
989*5113495bSYour Name  * @flow_index: pointer to return value of flow_idx
990*5113495bSYour Name  *
991*5113495bSYour Name  * Return: none
992*5113495bSYour Name  */
993*5113495bSYour Name static inline void
hal_rx_msdu_get_flow_params_8074v1(uint8_t * buf,bool * flow_invalid,bool * flow_timeout,uint32_t * flow_index)994*5113495bSYour Name hal_rx_msdu_get_flow_params_8074v1(uint8_t *buf,
995*5113495bSYour Name 				   bool *flow_invalid,
996*5113495bSYour Name 				   bool *flow_timeout,
997*5113495bSYour Name 				   uint32_t *flow_index)
998*5113495bSYour Name {
999*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
1000*5113495bSYour Name 	struct rx_msdu_end *msdu_end = &pkt_tlvs->msdu_end_tlv.rx_msdu_end;
1001*5113495bSYour Name 
1002*5113495bSYour Name 	*flow_invalid = HAL_RX_MSDU_END_FLOW_IDX_INVALID_GET(msdu_end);
1003*5113495bSYour Name 	*flow_timeout = HAL_RX_MSDU_END_FLOW_IDX_TIMEOUT_GET(msdu_end);
1004*5113495bSYour Name 	*flow_index = HAL_RX_MSDU_END_FLOW_IDX_GET(msdu_end);
1005*5113495bSYour Name }
1006*5113495bSYour Name 
1007*5113495bSYour Name /**
1008*5113495bSYour Name  * hal_rx_tlv_get_tcp_chksum_8074v1() - API to get tcp checksum
1009*5113495bSYour Name  * @buf: rx_tlv_hdr
1010*5113495bSYour Name  *
1011*5113495bSYour Name  * Return: tcp checksum
1012*5113495bSYour Name  */
1013*5113495bSYour Name static uint16_t
hal_rx_tlv_get_tcp_chksum_8074v1(uint8_t * buf)1014*5113495bSYour Name hal_rx_tlv_get_tcp_chksum_8074v1(uint8_t *buf)
1015*5113495bSYour Name {
1016*5113495bSYour Name 	return HAL_RX_TLV_GET_TCP_CHKSUM(buf);
1017*5113495bSYour Name }
1018*5113495bSYour Name 
1019*5113495bSYour Name /**
1020*5113495bSYour Name  * hal_rx_get_rx_sequence_8074v1() - Function to retrieve rx sequence number
1021*5113495bSYour Name  * @buf: Network buffer
1022*5113495bSYour Name  *
1023*5113495bSYour Name  * Return: rx sequence number
1024*5113495bSYour Name  */
1025*5113495bSYour Name static
hal_rx_get_rx_sequence_8074v1(uint8_t * buf)1026*5113495bSYour Name uint16_t hal_rx_get_rx_sequence_8074v1(uint8_t *buf)
1027*5113495bSYour Name {
1028*5113495bSYour Name 	struct rx_pkt_tlvs *pkt_tlvs = hal_rx_get_pkt_tlvs(buf);
1029*5113495bSYour Name 	struct rx_mpdu_info *rx_mpdu_info = hal_rx_get_mpdu_info(pkt_tlvs);
1030*5113495bSYour Name 
1031*5113495bSYour Name 	return HAL_RX_MPDU_GET_SEQUENCE_NUMBER(rx_mpdu_info);
1032*5113495bSYour Name }
1033*5113495bSYour Name 
1034*5113495bSYour Name /**
1035*5113495bSYour Name  * hal_rx_mpdu_start_tlv_tag_valid_8074v1() - API to check if RX_MPDU_START
1036*5113495bSYour Name  *                                            tlv tag is valid
1037*5113495bSYour Name  * @rx_tlv_hdr: start address of rx_pkt_tlvs
1038*5113495bSYour Name  *
1039*5113495bSYour Name  * Return: true if RX_MPDU_START is valid, else false.
1040*5113495bSYour Name  */
hal_rx_mpdu_start_tlv_tag_valid_8074v1(void * rx_tlv_hdr)1041*5113495bSYour Name uint8_t hal_rx_mpdu_start_tlv_tag_valid_8074v1(void *rx_tlv_hdr)
1042*5113495bSYour Name {
1043*5113495bSYour Name 	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)rx_tlv_hdr;
1044*5113495bSYour Name 	uint32_t tlv_tag;
1045*5113495bSYour Name 
1046*5113495bSYour Name 	tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(
1047*5113495bSYour Name 			&rx_desc->mpdu_start_tlv);
1048*5113495bSYour Name 
1049*5113495bSYour Name 	return tlv_tag == WIFIRX_MPDU_START_E ? true : false;
1050*5113495bSYour Name }
1051*5113495bSYour Name 
1052*5113495bSYour Name /**
1053*5113495bSYour Name  * hal_rx_flow_setup_fse_8074v1() - Setup a flow search entry in HW FST
1054*5113495bSYour Name  * @rx_fst: Pointer to the Rx Flow Search Table
1055*5113495bSYour Name  * @table_offset: offset into the table where the flow is to be setup
1056*5113495bSYour Name  * @rx_flow: Flow Parameters
1057*5113495bSYour Name  *
1058*5113495bSYour Name  * Return: Success/Failure
1059*5113495bSYour Name  */
1060*5113495bSYour Name static void *
hal_rx_flow_setup_fse_8074v1(uint8_t * rx_fst,uint32_t table_offset,uint8_t * rx_flow)1061*5113495bSYour Name hal_rx_flow_setup_fse_8074v1(uint8_t *rx_fst, uint32_t table_offset,
1062*5113495bSYour Name 			     uint8_t *rx_flow)
1063*5113495bSYour Name {
1064*5113495bSYour Name 	struct hal_rx_fst *fst = (struct hal_rx_fst *)rx_fst;
1065*5113495bSYour Name 	struct hal_rx_flow *flow = (struct hal_rx_flow *)rx_flow;
1066*5113495bSYour Name 	uint8_t *fse;
1067*5113495bSYour Name 	bool fse_valid;
1068*5113495bSYour Name 
1069*5113495bSYour Name 	if (table_offset >= fst->max_entries) {
1070*5113495bSYour Name 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
1071*5113495bSYour Name 			  "HAL FSE table offset %u exceeds max entries %u",
1072*5113495bSYour Name 			  table_offset, fst->max_entries);
1073*5113495bSYour Name 		return NULL;
1074*5113495bSYour Name 	}
1075*5113495bSYour Name 
1076*5113495bSYour Name 	fse = (uint8_t *)fst->base_vaddr +
1077*5113495bSYour Name 			(table_offset * HAL_RX_FST_ENTRY_SIZE);
1078*5113495bSYour Name 
1079*5113495bSYour Name 	fse_valid = HAL_GET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID);
1080*5113495bSYour Name 
1081*5113495bSYour Name 	if (fse_valid) {
1082*5113495bSYour Name 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
1083*5113495bSYour Name 			  "HAL FSE %pK already valid", fse);
1084*5113495bSYour Name 		return NULL;
1085*5113495bSYour Name 	}
1086*5113495bSYour Name 
1087*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_0, SRC_IP_127_96) =
1088*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_0, SRC_IP_127_96,
1089*5113495bSYour Name 			       qdf_htonl(flow->tuple_info.src_ip_127_96));
1090*5113495bSYour Name 
1091*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_1, SRC_IP_95_64) =
1092*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_1, SRC_IP_95_64,
1093*5113495bSYour Name 			       qdf_htonl(flow->tuple_info.src_ip_95_64));
1094*5113495bSYour Name 
1095*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_2, SRC_IP_63_32) =
1096*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_2, SRC_IP_63_32,
1097*5113495bSYour Name 			       qdf_htonl(flow->tuple_info.src_ip_63_32));
1098*5113495bSYour Name 
1099*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_3, SRC_IP_31_0) =
1100*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_3, SRC_IP_31_0,
1101*5113495bSYour Name 			       qdf_htonl(flow->tuple_info.src_ip_31_0));
1102*5113495bSYour Name 
1103*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_4, DEST_IP_127_96) =
1104*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_4, DEST_IP_127_96,
1105*5113495bSYour Name 			       qdf_htonl(flow->tuple_info.dest_ip_127_96));
1106*5113495bSYour Name 
1107*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_5, DEST_IP_95_64) =
1108*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_5, DEST_IP_95_64,
1109*5113495bSYour Name 			       qdf_htonl(flow->tuple_info.dest_ip_95_64));
1110*5113495bSYour Name 
1111*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_6, DEST_IP_63_32) =
1112*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_6, DEST_IP_63_32,
1113*5113495bSYour Name 			       qdf_htonl(flow->tuple_info.dest_ip_63_32));
1114*5113495bSYour Name 
1115*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_7, DEST_IP_31_0) =
1116*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_7, DEST_IP_31_0,
1117*5113495bSYour Name 			       qdf_htonl(flow->tuple_info.dest_ip_31_0));
1118*5113495bSYour Name 
1119*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_8, DEST_PORT);
1120*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_8, DEST_PORT) |=
1121*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_8, DEST_PORT,
1122*5113495bSYour Name 			       (flow->tuple_info.dest_port));
1123*5113495bSYour Name 
1124*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_8, SRC_PORT);
1125*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_8, SRC_PORT) |=
1126*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_8, SRC_PORT,
1127*5113495bSYour Name 			       (flow->tuple_info.src_port));
1128*5113495bSYour Name 
1129*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, L4_PROTOCOL);
1130*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, L4_PROTOCOL) |=
1131*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, L4_PROTOCOL,
1132*5113495bSYour Name 			       flow->tuple_info.l4_protocol);
1133*5113495bSYour Name 
1134*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_HANDLER);
1135*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_HANDLER) |=
1136*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, REO_DESTINATION_HANDLER,
1137*5113495bSYour Name 			       flow->reo_destination_handler);
1138*5113495bSYour Name 
1139*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID);
1140*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID) |=
1141*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_9, VALID, 1);
1142*5113495bSYour Name 
1143*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_10, METADATA);
1144*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_10, METADATA) =
1145*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_10, METADATA,
1146*5113495bSYour Name 			       flow->fse_metadata);
1147*5113495bSYour Name 
1148*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_11, REO_DESTINATION_INDICATION);
1149*5113495bSYour Name 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_11, REO_DESTINATION_INDICATION) |=
1150*5113495bSYour Name 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_11,
1151*5113495bSYour Name 			       REO_DESTINATION_INDICATION,
1152*5113495bSYour Name 			       flow->reo_destination_indication);
1153*5113495bSYour Name 
1154*5113495bSYour Name 	/* Reset all the other fields in FSE */
1155*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, RESERVED_9);
1156*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_11, MSDU_DROP);
1157*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_11, RESERVED_11);
1158*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_11, MSDU_COUNT);
1159*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_12, MSDU_BYTE_COUNT);
1160*5113495bSYour Name 	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_13, TIMESTAMP);
1161*5113495bSYour Name 
1162*5113495bSYour Name 	return fse;
1163*5113495bSYour Name }
1164*5113495bSYour Name 
1165*5113495bSYour Name static
hal_compute_reo_remap_ix2_ix3_8074v1(uint32_t * ring,uint32_t num_rings,uint32_t * remap1,uint32_t * remap2)1166*5113495bSYour Name void hal_compute_reo_remap_ix2_ix3_8074v1(uint32_t *ring, uint32_t num_rings,
1167*5113495bSYour Name 					  uint32_t *remap1, uint32_t *remap2)
1168*5113495bSYour Name {
1169*5113495bSYour Name 	switch (num_rings) {
1170*5113495bSYour Name 	case 1:
1171*5113495bSYour Name 		*remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
1172*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 17) |
1173*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 18) |
1174*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 19) |
1175*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 20) |
1176*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 21) |
1177*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 22) |
1178*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 23);
1179*5113495bSYour Name 
1180*5113495bSYour Name 		*remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
1181*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 25) |
1182*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 26) |
1183*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 27) |
1184*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 28) |
1185*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 29) |
1186*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 30) |
1187*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 31);
1188*5113495bSYour Name 		break;
1189*5113495bSYour Name 	case 2:
1190*5113495bSYour Name 		*remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
1191*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 17) |
1192*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 18) |
1193*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 19) |
1194*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 20) |
1195*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 21) |
1196*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 22) |
1197*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 23);
1198*5113495bSYour Name 
1199*5113495bSYour Name 		*remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
1200*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 25) |
1201*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[1], 26) |
1202*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[1], 27) |
1203*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 28) |
1204*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 29) |
1205*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[1], 30) |
1206*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[1], 31);
1207*5113495bSYour Name 		break;
1208*5113495bSYour Name 	case 3:
1209*5113495bSYour Name 		*remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
1210*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 17) |
1211*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[2], 18) |
1212*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 19) |
1213*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 20) |
1214*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[2], 21) |
1215*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 22) |
1216*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 23);
1217*5113495bSYour Name 
1218*5113495bSYour Name 		*remap2 = HAL_REO_REMAP_IX3(ring[2], 24) |
1219*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 25) |
1220*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[1], 26) |
1221*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[2], 27) |
1222*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 28) |
1223*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[1], 29) |
1224*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[2], 30) |
1225*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 31);
1226*5113495bSYour Name 		break;
1227*5113495bSYour Name 	case 4:
1228*5113495bSYour Name 		*remap1 = HAL_REO_REMAP_IX2(ring[0], 16) |
1229*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 17) |
1230*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[2], 18) |
1231*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[3], 19) |
1232*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[0], 20) |
1233*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[1], 21) |
1234*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[2], 22) |
1235*5113495bSYour Name 				HAL_REO_REMAP_IX2(ring[3], 23);
1236*5113495bSYour Name 
1237*5113495bSYour Name 		*remap2 = HAL_REO_REMAP_IX3(ring[0], 24) |
1238*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[1], 25) |
1239*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[2], 26) |
1240*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[3], 27) |
1241*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[0], 28) |
1242*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[1], 29) |
1243*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[2], 30) |
1244*5113495bSYour Name 				HAL_REO_REMAP_IX3(ring[3], 31);
1245*5113495bSYour Name 		break;
1246*5113495bSYour Name 	}
1247*5113495bSYour Name }
1248*5113495bSYour Name 
hal_hw_txrx_ops_attach_qca8074(struct hal_soc * hal_soc)1249*5113495bSYour Name static void hal_hw_txrx_ops_attach_qca8074(struct hal_soc *hal_soc)
1250*5113495bSYour Name {
1251*5113495bSYour Name 
1252*5113495bSYour Name 	/* init and setup */
1253*5113495bSYour Name 	hal_soc->ops->hal_srng_dst_hw_init = hal_srng_dst_hw_init_generic;
1254*5113495bSYour Name 	hal_soc->ops->hal_srng_src_hw_init = hal_srng_src_hw_init_generic;
1255*5113495bSYour Name 	hal_soc->ops->hal_get_hw_hptp = hal_get_hw_hptp_generic;
1256*5113495bSYour Name 	hal_soc->ops->hal_reo_setup = hal_reo_setup_generic_li;
1257*5113495bSYour Name 	hal_soc->ops->hal_get_window_address = hal_get_window_address_8074;
1258*5113495bSYour Name 
1259*5113495bSYour Name 	/* tx */
1260*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_dscp_tid_table_id =
1261*5113495bSYour Name 		hal_tx_desc_set_dscp_tid_table_id_8074;
1262*5113495bSYour Name 	hal_soc->ops->hal_tx_set_dscp_tid_map = hal_tx_set_dscp_tid_map_8074;
1263*5113495bSYour Name 	hal_soc->ops->hal_tx_update_dscp_tid = hal_tx_update_dscp_tid_8074;
1264*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_lmac_id = hal_tx_desc_set_lmac_id_8074;
1265*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_buf_addr =
1266*5113495bSYour Name 					hal_tx_desc_set_buf_addr_generic_li;
1267*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_search_type =
1268*5113495bSYour Name 					hal_tx_desc_set_search_type_generic_li;
1269*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_search_index =
1270*5113495bSYour Name 					hal_tx_desc_set_search_index_generic_li;
1271*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_cache_set_num =
1272*5113495bSYour Name 				hal_tx_desc_set_cache_set_num_generic_li;
1273*5113495bSYour Name 	hal_soc->ops->hal_tx_comp_get_status =
1274*5113495bSYour Name 					hal_tx_comp_get_status_generic_li;
1275*5113495bSYour Name 	hal_soc->ops->hal_tx_comp_get_release_reason =
1276*5113495bSYour Name 		hal_tx_comp_get_release_reason_generic_li;
1277*5113495bSYour Name 	hal_soc->ops->hal_get_wbm_internal_error =
1278*5113495bSYour Name 					hal_get_wbm_internal_error_generic_li;
1279*5113495bSYour Name 	hal_soc->ops->hal_tx_desc_set_mesh_en = hal_tx_desc_set_mesh_en_8074v1;
1280*5113495bSYour Name 	hal_soc->ops->hal_tx_init_cmd_credit_ring =
1281*5113495bSYour Name 					hal_tx_init_cmd_credit_ring_8074v1;
1282*5113495bSYour Name 
1283*5113495bSYour Name 	/* rx */
1284*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_start_nss_get =
1285*5113495bSYour Name 					hal_rx_msdu_start_nss_get_8074;
1286*5113495bSYour Name 	hal_soc->ops->hal_rx_mon_hw_desc_get_mpdu_status =
1287*5113495bSYour Name 		hal_rx_mon_hw_desc_get_mpdu_status_8074;
1288*5113495bSYour Name 	hal_soc->ops->hal_rx_get_tlv = hal_rx_get_tlv_8074;
1289*5113495bSYour Name 	hal_soc->ops->hal_rx_proc_phyrx_other_receive_info_tlv =
1290*5113495bSYour Name 		hal_rx_proc_phyrx_other_receive_info_tlv_8074;
1291*5113495bSYour Name 
1292*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_msdu_end_tlv = hal_rx_dump_msdu_end_tlv_8074;
1293*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_rx_attention_tlv =
1294*5113495bSYour Name 					hal_rx_dump_rx_attention_tlv_generic_li;
1295*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_msdu_start_tlv =
1296*5113495bSYour Name 					hal_rx_dump_msdu_start_tlv_8074;
1297*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_mpdu_start_tlv =
1298*5113495bSYour Name 					hal_rx_dump_mpdu_start_tlv_generic_li;
1299*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_mpdu_end_tlv =
1300*5113495bSYour Name 					hal_rx_dump_mpdu_end_tlv_generic_li;
1301*5113495bSYour Name 	hal_soc->ops->hal_rx_dump_pkt_hdr_tlv =
1302*5113495bSYour Name 					hal_rx_dump_pkt_hdr_tlv_generic_li;
1303*5113495bSYour Name 
1304*5113495bSYour Name 	hal_soc->ops->hal_get_link_desc_size = hal_get_link_desc_size_8074;
1305*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_tid_get =
1306*5113495bSYour Name 					hal_rx_mpdu_start_tid_get_8074;
1307*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_start_reception_type_get =
1308*5113495bSYour Name 		hal_rx_msdu_start_reception_type_get_8074;
1309*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_da_idx_get =
1310*5113495bSYour Name 					hal_rx_msdu_end_da_idx_get_8074;
1311*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_desc_info_get_ptr =
1312*5113495bSYour Name 					hal_rx_msdu_desc_info_get_ptr_8074v1;
1313*5113495bSYour Name 	hal_soc->ops->hal_rx_link_desc_msdu0_ptr =
1314*5113495bSYour Name 					hal_rx_link_desc_msdu0_ptr_8074v1;
1315*5113495bSYour Name 	hal_soc->ops->hal_reo_status_get_header =
1316*5113495bSYour Name 					hal_reo_status_get_header_8074v1;
1317*5113495bSYour Name 	hal_soc->ops->hal_rx_status_get_tlv_info =
1318*5113495bSYour Name 					hal_rx_status_get_tlv_info_generic_li;
1319*5113495bSYour Name 	hal_soc->ops->hal_rx_wbm_err_info_get =
1320*5113495bSYour Name 					hal_rx_wbm_err_info_get_generic_li;
1321*5113495bSYour Name 
1322*5113495bSYour Name 	hal_soc->ops->hal_tx_set_pcp_tid_map =
1323*5113495bSYour Name 					hal_tx_set_pcp_tid_map_generic_li;
1324*5113495bSYour Name 	hal_soc->ops->hal_tx_update_pcp_tid_map =
1325*5113495bSYour Name 					hal_tx_update_pcp_tid_generic_li;
1326*5113495bSYour Name 	hal_soc->ops->hal_tx_set_tidmap_prty =
1327*5113495bSYour Name 					hal_tx_update_tidmap_prty_generic_li;
1328*5113495bSYour Name 	hal_soc->ops->hal_rx_get_rx_fragment_number =
1329*5113495bSYour Name 					hal_rx_get_rx_fragment_number_8074v1;
1330*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_da_is_mcbc_get =
1331*5113495bSYour Name 					hal_rx_msdu_end_da_is_mcbc_get_8074v1;
1332*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_sa_is_valid_get =
1333*5113495bSYour Name 					hal_rx_msdu_end_sa_is_valid_get_8074v1;
1334*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_sa_idx_get =
1335*5113495bSYour Name 					hal_rx_msdu_end_sa_idx_get_8074v1;
1336*5113495bSYour Name 	hal_soc->ops->hal_rx_desc_is_first_msdu =
1337*5113495bSYour Name 					hal_rx_desc_is_first_msdu_8074v1;
1338*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_l3_hdr_padding_get =
1339*5113495bSYour Name 		hal_rx_msdu_end_l3_hdr_padding_get_8074v1;
1340*5113495bSYour Name 	hal_soc->ops->hal_rx_encryption_info_valid =
1341*5113495bSYour Name 					hal_rx_encryption_info_valid_8074v1;
1342*5113495bSYour Name 	hal_soc->ops->hal_rx_print_pn = hal_rx_print_pn_8074v1;
1343*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_first_msdu_get =
1344*5113495bSYour Name 					hal_rx_msdu_end_first_msdu_get_8074v1;
1345*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_da_is_valid_get =
1346*5113495bSYour Name 					hal_rx_msdu_end_da_is_valid_get_8074v1;
1347*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_last_msdu_get =
1348*5113495bSYour Name 					hal_rx_msdu_end_last_msdu_get_8074v1;
1349*5113495bSYour Name 	hal_soc->ops->hal_rx_get_mpdu_mac_ad4_valid =
1350*5113495bSYour Name 					hal_rx_get_mpdu_mac_ad4_valid_8074v1;
1351*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get =
1352*5113495bSYour Name 		hal_rx_mpdu_start_sw_peer_id_get_8074v1;
1353*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_peer_meta_data_get =
1354*5113495bSYour Name 		hal_rx_mpdu_peer_meta_data_get_li;
1355*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_8074v1;
1356*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_8074v1;
1357*5113495bSYour Name 	hal_soc->ops->hal_rx_get_mpdu_frame_control_valid =
1358*5113495bSYour Name 		hal_rx_get_mpdu_frame_control_valid_8074v1;
1359*5113495bSYour Name 	hal_soc->ops->hal_rx_get_frame_ctrl_field =
1360*5113495bSYour Name 		hal_rx_get_mpdu_frame_control_field_8074v1;
1361*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_addr1 = hal_rx_mpdu_get_addr1_8074v1;
1362*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_addr2 = hal_rx_mpdu_get_addr2_8074v1;
1363*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_addr3 = hal_rx_mpdu_get_addr3_8074v1;
1364*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_get_addr4 = hal_rx_mpdu_get_addr4_8074v1;
1365*5113495bSYour Name 	hal_soc->ops->hal_rx_get_mpdu_sequence_control_valid =
1366*5113495bSYour Name 		hal_rx_get_mpdu_sequence_control_valid_8074v1;
1367*5113495bSYour Name 	hal_soc->ops->hal_rx_is_unicast = hal_rx_is_unicast_8074v1;
1368*5113495bSYour Name 	hal_soc->ops->hal_rx_tid_get = hal_rx_tid_get_8074v1;
1369*5113495bSYour Name 	hal_soc->ops->hal_rx_hw_desc_get_ppduid_get =
1370*5113495bSYour Name 					hal_rx_hw_desc_get_ppduid_get_8074v1;
1371*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_mpdu_qos_control_valid_get =
1372*5113495bSYour Name 		hal_rx_mpdu_start_mpdu_qos_control_valid_get_8074v1;
1373*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_sa_sw_peer_id_get =
1374*5113495bSYour Name 		hal_rx_msdu_end_sa_sw_peer_id_get_8074v1;
1375*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu0_buffer_addr_lsb =
1376*5113495bSYour Name 					hal_rx_msdu0_buffer_addr_lsb_8074v1;
1377*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_desc_info_ptr_get =
1378*5113495bSYour Name 					hal_rx_msdu_desc_info_ptr_get_8074v1;
1379*5113495bSYour Name 	hal_soc->ops->hal_ent_mpdu_desc_info = hal_ent_mpdu_desc_info_8074v1;
1380*5113495bSYour Name 	hal_soc->ops->hal_dst_mpdu_desc_info = hal_dst_mpdu_desc_info_8074v1;
1381*5113495bSYour Name 	hal_soc->ops->hal_rx_get_fc_valid = hal_rx_get_fc_valid_8074v1;
1382*5113495bSYour Name 	hal_soc->ops->hal_rx_get_to_ds_flag = hal_rx_get_to_ds_flag_8074v1;
1383*5113495bSYour Name 	hal_soc->ops->hal_rx_get_mac_addr2_valid =
1384*5113495bSYour Name 					hal_rx_get_mac_addr2_valid_8074v1;
1385*5113495bSYour Name 	hal_soc->ops->hal_rx_get_filter_category =
1386*5113495bSYour Name 					hal_rx_get_filter_category_8074v1;
1387*5113495bSYour Name 	hal_soc->ops->hal_rx_get_ppdu_id = hal_rx_get_ppdu_id_8074v1;
1388*5113495bSYour Name 	hal_soc->ops->hal_reo_config = hal_reo_config_8074v1;
1389*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_flow_idx_get =
1390*5113495bSYour Name 					hal_rx_msdu_flow_idx_get_8074v1;
1391*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_flow_idx_invalid =
1392*5113495bSYour Name 					hal_rx_msdu_flow_idx_invalid_8074v1;
1393*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_flow_idx_timeout =
1394*5113495bSYour Name 					hal_rx_msdu_flow_idx_timeout_8074v1;
1395*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_fse_metadata_get =
1396*5113495bSYour Name 					hal_rx_msdu_fse_metadata_get_8074v1;
1397*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_cce_match_get =
1398*5113495bSYour Name 					hal_rx_msdu_cce_match_get_li;
1399*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_cce_metadata_get =
1400*5113495bSYour Name 					hal_rx_msdu_cce_metadata_get_8074v1;
1401*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_get_flow_params =
1402*5113495bSYour Name 					hal_rx_msdu_get_flow_params_8074v1;
1403*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_get_tcp_chksum =
1404*5113495bSYour Name 					hal_rx_tlv_get_tcp_chksum_8074v1;
1405*5113495bSYour Name 	hal_soc->ops->hal_rx_get_rx_sequence = hal_rx_get_rx_sequence_8074v1;
1406*5113495bSYour Name 	/* rx - msdu fast path info fields */
1407*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_packet_metadata_get =
1408*5113495bSYour Name 		hal_rx_msdu_packet_metadata_get_generic_li;
1409*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_tlv_tag_valid =
1410*5113495bSYour Name 		hal_rx_mpdu_start_tlv_tag_valid_8074v1;
1411*5113495bSYour Name 
1412*5113495bSYour Name 	/* rx - TLV struct offsets */
1413*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_end_offset_get =
1414*5113495bSYour Name 					hal_rx_msdu_end_offset_get_generic;
1415*5113495bSYour Name 	hal_soc->ops->hal_rx_attn_offset_get = hal_rx_attn_offset_get_generic;
1416*5113495bSYour Name 	hal_soc->ops->hal_rx_msdu_start_offset_get =
1417*5113495bSYour Name 					hal_rx_msdu_start_offset_get_generic;
1418*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_start_offset_get =
1419*5113495bSYour Name 					hal_rx_mpdu_start_offset_get_generic;
1420*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_end_offset_get =
1421*5113495bSYour Name 					hal_rx_mpdu_end_offset_get_generic;
1422*5113495bSYour Name #ifndef NO_RX_PKT_HDR_TLV
1423*5113495bSYour Name 	hal_soc->ops->hal_rx_pkt_tlv_offset_get =
1424*5113495bSYour Name 					hal_rx_pkt_tlv_offset_get_generic;
1425*5113495bSYour Name #endif
1426*5113495bSYour Name 	hal_soc->ops->hal_rx_flow_setup_fse = hal_rx_flow_setup_fse_8074v1;
1427*5113495bSYour Name 	hal_soc->ops->hal_rx_flow_get_tuple_info =
1428*5113495bSYour Name 					hal_rx_flow_get_tuple_info_li;
1429*5113495bSYour Name 	 hal_soc->ops->hal_rx_flow_delete_entry =
1430*5113495bSYour Name 					hal_rx_flow_delete_entry_li;
1431*5113495bSYour Name 	hal_soc->ops->hal_rx_fst_get_fse_size = hal_rx_fst_get_fse_size_li;
1432*5113495bSYour Name 	hal_soc->ops->hal_compute_reo_remap_ix2_ix3 =
1433*5113495bSYour Name 					hal_compute_reo_remap_ix2_ix3_8074v1;
1434*5113495bSYour Name 	hal_soc->ops->hal_setup_link_idle_list =
1435*5113495bSYour Name 				hal_setup_link_idle_list_generic_li;
1436*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_get_pn_num = hal_rx_tlv_get_pn_num_li;
1437*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_mic_err_get = hal_rx_tlv_mic_err_get_li;
1438*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_decrypt_err_get =
1439*5113495bSYour Name 			hal_rx_tlv_decrypt_err_get_li;
1440*5113495bSYour Name 	hal_soc->ops->hal_rx_tlv_get_pkt_capture_flags =
1441*5113495bSYour Name 					hal_rx_tlv_get_pkt_capture_flags_li;
1442*5113495bSYour Name 	hal_soc->ops->hal_rx_mpdu_info_ampdu_flag_get =
1443*5113495bSYour Name 					hal_rx_mpdu_info_ampdu_flag_get_li;
1444*5113495bSYour Name 	hal_soc->ops->hal_compute_reo_remap_ix0 = NULL;
1445*5113495bSYour Name };
1446*5113495bSYour Name 
1447*5113495bSYour Name struct hal_hw_srng_config hw_srng_table_8074[] = {
1448*5113495bSYour Name 	/* TODO: max_rings can populated by querying HW capabilities */
1449*5113495bSYour Name 	{ /* REO_DST */
1450*5113495bSYour Name 		.start_ring_id = HAL_SRNG_REO2SW1,
1451*5113495bSYour Name 		.max_rings = 4,
1452*5113495bSYour Name 		.entry_size = sizeof(struct reo_destination_ring) >> 2,
1453*5113495bSYour Name 		.lmac_ring = FALSE,
1454*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
1455*5113495bSYour Name 		.reg_start = {
1456*5113495bSYour Name 			HWIO_REO_R0_REO2SW1_RING_BASE_LSB_ADDR(
1457*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET),
1458*5113495bSYour Name 			HWIO_REO_R2_REO2SW1_RING_HP_ADDR(
1459*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET)
1460*5113495bSYour Name 		},
1461*5113495bSYour Name 		.reg_size = {
1462*5113495bSYour Name 			HWIO_REO_R0_REO2SW2_RING_BASE_LSB_ADDR(0) -
1463*5113495bSYour Name 				HWIO_REO_R0_REO2SW1_RING_BASE_LSB_ADDR(0),
1464*5113495bSYour Name 			HWIO_REO_R2_REO2SW2_RING_HP_ADDR(0) -
1465*5113495bSYour Name 				HWIO_REO_R2_REO2SW1_RING_HP_ADDR(0),
1466*5113495bSYour Name 		},
1467*5113495bSYour Name 		.max_size =
1468*5113495bSYour Name 			HWIO_REO_R0_REO2SW1_RING_BASE_MSB_RING_SIZE_BMSK >>
1469*5113495bSYour Name 			HWIO_REO_R0_REO2SW1_RING_BASE_MSB_RING_SIZE_SHFT,
1470*5113495bSYour Name 	},
1471*5113495bSYour Name 	{ /* REO_EXCEPTION */
1472*5113495bSYour Name 		/* Designating REO2TCL ring as exception ring. This ring is
1473*5113495bSYour Name 		 * similar to other REO2SW rings though it is named as REO2TCL.
1474*5113495bSYour Name 		 * Any of theREO2SW rings can be used as exception ring.
1475*5113495bSYour Name 		 */
1476*5113495bSYour Name 		.start_ring_id = HAL_SRNG_REO2TCL,
1477*5113495bSYour Name 		.max_rings = 1,
1478*5113495bSYour Name 		.entry_size = sizeof(struct reo_destination_ring) >> 2,
1479*5113495bSYour Name 		.lmac_ring = FALSE,
1480*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
1481*5113495bSYour Name 		.reg_start = {
1482*5113495bSYour Name 			HWIO_REO_R0_REO2TCL_RING_BASE_LSB_ADDR(
1483*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET),
1484*5113495bSYour Name 			HWIO_REO_R2_REO2TCL_RING_HP_ADDR(
1485*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET)
1486*5113495bSYour Name 		},
1487*5113495bSYour Name 		/* Single ring - provide ring size if multiple rings of this
1488*5113495bSYour Name 		 * type are supported
1489*5113495bSYour Name 		 */
1490*5113495bSYour Name 		.reg_size = {},
1491*5113495bSYour Name 		.max_size =
1492*5113495bSYour Name 			HWIO_REO_R0_REO2TCL_RING_BASE_MSB_RING_SIZE_BMSK >>
1493*5113495bSYour Name 			HWIO_REO_R0_REO2TCL_RING_BASE_MSB_RING_SIZE_SHFT,
1494*5113495bSYour Name 	},
1495*5113495bSYour Name 	{ /* REO_REINJECT */
1496*5113495bSYour Name 		.start_ring_id = HAL_SRNG_SW2REO,
1497*5113495bSYour Name 		.max_rings = 1,
1498*5113495bSYour Name 		.entry_size = sizeof(struct reo_entrance_ring) >> 2,
1499*5113495bSYour Name 		.lmac_ring = FALSE,
1500*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1501*5113495bSYour Name 		.reg_start = {
1502*5113495bSYour Name 			HWIO_REO_R0_SW2REO_RING_BASE_LSB_ADDR(
1503*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET),
1504*5113495bSYour Name 			HWIO_REO_R2_SW2REO_RING_HP_ADDR(
1505*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET)
1506*5113495bSYour Name 		},
1507*5113495bSYour Name 		/* Single ring - provide ring size if multiple rings of this
1508*5113495bSYour Name 		 * type are supported
1509*5113495bSYour Name 		 */
1510*5113495bSYour Name 		.reg_size = {},
1511*5113495bSYour Name 		.max_size = HWIO_REO_R0_SW2REO_RING_BASE_MSB_RING_SIZE_BMSK >>
1512*5113495bSYour Name 				HWIO_REO_R0_SW2REO_RING_BASE_MSB_RING_SIZE_SHFT,
1513*5113495bSYour Name 	},
1514*5113495bSYour Name 	{ /* REO_CMD */
1515*5113495bSYour Name 		.start_ring_id = HAL_SRNG_REO_CMD,
1516*5113495bSYour Name 		.max_rings = 1,
1517*5113495bSYour Name 		.entry_size = (sizeof(struct tlv_32_hdr) +
1518*5113495bSYour Name 			sizeof(struct reo_get_queue_stats)) >> 2,
1519*5113495bSYour Name 		.lmac_ring = FALSE,
1520*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1521*5113495bSYour Name 		.reg_start = {
1522*5113495bSYour Name 			HWIO_REO_R0_REO_CMD_RING_BASE_LSB_ADDR(
1523*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET),
1524*5113495bSYour Name 			HWIO_REO_R2_REO_CMD_RING_HP_ADDR(
1525*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET),
1526*5113495bSYour Name 		},
1527*5113495bSYour Name 		/* Single ring - provide ring size if multiple rings of this
1528*5113495bSYour Name 		 * type are supported
1529*5113495bSYour Name 		 */
1530*5113495bSYour Name 		.reg_size = {},
1531*5113495bSYour Name 		.max_size = HWIO_REO_R0_REO_CMD_RING_BASE_MSB_RING_SIZE_BMSK >>
1532*5113495bSYour Name 			HWIO_REO_R0_REO_CMD_RING_BASE_MSB_RING_SIZE_SHFT,
1533*5113495bSYour Name 	},
1534*5113495bSYour Name 	{ /* REO_STATUS */
1535*5113495bSYour Name 		.start_ring_id = HAL_SRNG_REO_STATUS,
1536*5113495bSYour Name 		.max_rings = 1,
1537*5113495bSYour Name 		.entry_size = (sizeof(struct tlv_32_hdr) +
1538*5113495bSYour Name 			sizeof(struct reo_get_queue_stats_status)) >> 2,
1539*5113495bSYour Name 		.lmac_ring = FALSE,
1540*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
1541*5113495bSYour Name 		.reg_start = {
1542*5113495bSYour Name 			HWIO_REO_R0_REO_STATUS_RING_BASE_LSB_ADDR(
1543*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET),
1544*5113495bSYour Name 			HWIO_REO_R2_REO_STATUS_RING_HP_ADDR(
1545*5113495bSYour Name 				SEQ_WCSS_UMAC_REO_REG_OFFSET),
1546*5113495bSYour Name 		},
1547*5113495bSYour Name 		/* Single ring - provide ring size if multiple rings of this
1548*5113495bSYour Name 		 * type are supported
1549*5113495bSYour Name 		 */
1550*5113495bSYour Name 		.reg_size = {},
1551*5113495bSYour Name 		.max_size =
1552*5113495bSYour Name 		HWIO_REO_R0_REO_STATUS_RING_BASE_MSB_RING_SIZE_BMSK >>
1553*5113495bSYour Name 			HWIO_REO_R0_REO_STATUS_RING_BASE_MSB_RING_SIZE_SHFT,
1554*5113495bSYour Name 	},
1555*5113495bSYour Name 	{ /* TCL_DATA */
1556*5113495bSYour Name 		.start_ring_id = HAL_SRNG_SW2TCL1,
1557*5113495bSYour Name 		.max_rings = 3,
1558*5113495bSYour Name 		.entry_size = (sizeof(struct tlv_32_hdr) +
1559*5113495bSYour Name 			sizeof(struct tcl_data_cmd)) >> 2,
1560*5113495bSYour Name 		.lmac_ring = FALSE,
1561*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1562*5113495bSYour Name 		.reg_start = {
1563*5113495bSYour Name 			HWIO_TCL_R0_SW2TCL1_RING_BASE_LSB_ADDR(
1564*5113495bSYour Name 				SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET),
1565*5113495bSYour Name 			HWIO_TCL_R2_SW2TCL1_RING_HP_ADDR(
1566*5113495bSYour Name 				SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET),
1567*5113495bSYour Name 		},
1568*5113495bSYour Name 		.reg_size = {
1569*5113495bSYour Name 			HWIO_TCL_R0_SW2TCL2_RING_BASE_LSB_ADDR(0) -
1570*5113495bSYour Name 				HWIO_TCL_R0_SW2TCL1_RING_BASE_LSB_ADDR(0),
1571*5113495bSYour Name 			HWIO_TCL_R2_SW2TCL2_RING_HP_ADDR(0) -
1572*5113495bSYour Name 				HWIO_TCL_R2_SW2TCL1_RING_HP_ADDR(0),
1573*5113495bSYour Name 		},
1574*5113495bSYour Name 		.max_size =
1575*5113495bSYour Name 			HWIO_TCL_R0_SW2TCL1_RING_BASE_MSB_RING_SIZE_BMSK >>
1576*5113495bSYour Name 			HWIO_TCL_R0_SW2TCL1_RING_BASE_MSB_RING_SIZE_SHFT,
1577*5113495bSYour Name 	},
1578*5113495bSYour Name 	{ /* TCL_CMD */
1579*5113495bSYour Name 		.start_ring_id = HAL_SRNG_SW2TCL_CMD,
1580*5113495bSYour Name 		.max_rings = 1,
1581*5113495bSYour Name 		.entry_size = (sizeof(struct tlv_32_hdr) +
1582*5113495bSYour Name 			sizeof(struct tcl_data_cmd)) >> 2,
1583*5113495bSYour Name 		.lmac_ring =  FALSE,
1584*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1585*5113495bSYour Name 		.reg_start = {
1586*5113495bSYour Name 			HWIO_TCL_R0_SW2TCL_CMD_RING_BASE_LSB_ADDR(
1587*5113495bSYour Name 				SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET),
1588*5113495bSYour Name 			HWIO_TCL_R2_SW2TCL_CMD_RING_HP_ADDR(
1589*5113495bSYour Name 				SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET),
1590*5113495bSYour Name 		},
1591*5113495bSYour Name 		/* Single ring - provide ring size if multiple rings of this
1592*5113495bSYour Name 		 * type are supported
1593*5113495bSYour Name 		 */
1594*5113495bSYour Name 		.reg_size = {},
1595*5113495bSYour Name 		.max_size =
1596*5113495bSYour Name 			HWIO_TCL_R0_SW2TCL_CMD_RING_BASE_MSB_RING_SIZE_BMSK >>
1597*5113495bSYour Name 			HWIO_TCL_R0_SW2TCL_CMD_RING_BASE_MSB_RING_SIZE_SHFT,
1598*5113495bSYour Name 	},
1599*5113495bSYour Name 	{ /* TCL_STATUS */
1600*5113495bSYour Name 		.start_ring_id = HAL_SRNG_TCL_STATUS,
1601*5113495bSYour Name 		.max_rings = 1,
1602*5113495bSYour Name 		.entry_size = (sizeof(struct tlv_32_hdr) +
1603*5113495bSYour Name 			sizeof(struct tcl_status_ring)) >> 2,
1604*5113495bSYour Name 		.lmac_ring = FALSE,
1605*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
1606*5113495bSYour Name 		.reg_start = {
1607*5113495bSYour Name 			HWIO_TCL_R0_TCL_STATUS1_RING_BASE_LSB_ADDR(
1608*5113495bSYour Name 				SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET),
1609*5113495bSYour Name 			HWIO_TCL_R2_TCL_STATUS1_RING_HP_ADDR(
1610*5113495bSYour Name 				SEQ_WCSS_UMAC_MAC_TCL_REG_OFFSET),
1611*5113495bSYour Name 		},
1612*5113495bSYour Name 		/* Single ring - provide ring size if multiple rings of this
1613*5113495bSYour Name 		 * type are supported
1614*5113495bSYour Name 		 */
1615*5113495bSYour Name 		.reg_size = {},
1616*5113495bSYour Name 		.max_size =
1617*5113495bSYour Name 			HWIO_TCL_R0_TCL_STATUS1_RING_BASE_MSB_RING_SIZE_BMSK >>
1618*5113495bSYour Name 			HWIO_TCL_R0_TCL_STATUS1_RING_BASE_MSB_RING_SIZE_SHFT,
1619*5113495bSYour Name 	},
1620*5113495bSYour Name 	{ /* CE_SRC */
1621*5113495bSYour Name 		.start_ring_id = HAL_SRNG_CE_0_SRC,
1622*5113495bSYour Name 		.max_rings = 12,
1623*5113495bSYour Name 		.entry_size = sizeof(struct ce_src_desc) >> 2,
1624*5113495bSYour Name 		.lmac_ring = FALSE,
1625*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1626*5113495bSYour Name 		.reg_start = {
1627*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_LSB_ADDR(
1628*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_SRC_REG_OFFSET),
1629*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R2_DEST_RING_HP_ADDR(
1630*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_SRC_REG_OFFSET),
1631*5113495bSYour Name 		},
1632*5113495bSYour Name 		.reg_size = {
1633*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_1_CHANNEL_SRC_REG_OFFSET -
1634*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_SRC_REG_OFFSET,
1635*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_1_CHANNEL_SRC_REG_OFFSET -
1636*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_SRC_REG_OFFSET,
1637*5113495bSYour Name 		},
1638*5113495bSYour Name 		.max_size =
1639*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_MSB_RING_SIZE_BMSK >>
1640*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_MSB_RING_SIZE_SHFT,
1641*5113495bSYour Name 	},
1642*5113495bSYour Name 	{ /* CE_DST */
1643*5113495bSYour Name 		.start_ring_id = HAL_SRNG_CE_0_DST,
1644*5113495bSYour Name 		.max_rings = 12,
1645*5113495bSYour Name 		.entry_size = 8 >> 2,
1646*5113495bSYour Name 		/*TODO: entry_size above should actually be
1647*5113495bSYour Name 		 * sizeof(struct ce_dst_desc) >> 2, but couldn't find definition
1648*5113495bSYour Name 		 * of struct ce_dst_desc in HW header files
1649*5113495bSYour Name 		 */
1650*5113495bSYour Name 		.lmac_ring = FALSE,
1651*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1652*5113495bSYour Name 		.reg_start = {
1653*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_LSB_ADDR(
1654*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_DST_REG_OFFSET),
1655*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R2_DEST_RING_HP_ADDR(
1656*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_DST_REG_OFFSET),
1657*5113495bSYour Name 		},
1658*5113495bSYour Name 		.reg_size = {
1659*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_1_CHANNEL_DST_REG_OFFSET -
1660*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_DST_REG_OFFSET,
1661*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_1_CHANNEL_DST_REG_OFFSET -
1662*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_DST_REG_OFFSET,
1663*5113495bSYour Name 		},
1664*5113495bSYour Name 		.max_size =
1665*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_MSB_RING_SIZE_BMSK >>
1666*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_RING_BASE_MSB_RING_SIZE_SHFT,
1667*5113495bSYour Name 	},
1668*5113495bSYour Name 	{ /* CE_DST_STATUS */
1669*5113495bSYour Name 		.start_ring_id = HAL_SRNG_CE_0_DST_STATUS,
1670*5113495bSYour Name 		.max_rings = 12,
1671*5113495bSYour Name 		.entry_size = sizeof(struct ce_stat_desc) >> 2,
1672*5113495bSYour Name 		.lmac_ring = FALSE,
1673*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
1674*5113495bSYour Name 		.reg_start = {
1675*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_STATUS_RING_BASE_LSB_ADDR(
1676*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_DST_REG_OFFSET),
1677*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R2_STATUS_RING_HP_ADDR(
1678*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_DST_REG_OFFSET),
1679*5113495bSYour Name 		},
1680*5113495bSYour Name 			/* TODO: check destination status ring registers */
1681*5113495bSYour Name 		.reg_size = {
1682*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_1_CHANNEL_DST_REG_OFFSET -
1683*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_DST_REG_OFFSET,
1684*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_1_CHANNEL_DST_REG_OFFSET -
1685*5113495bSYour Name 		SEQ_WCSS_UMAC_WFSS_CE_0_REG_WFSS_CE_0_CHANNEL_DST_REG_OFFSET,
1686*5113495bSYour Name 		},
1687*5113495bSYour Name 		.max_size =
1688*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_STATUS_RING_BASE_MSB_RING_SIZE_BMSK >>
1689*5113495bSYour Name 		HWIO_WFSS_CE_CHANNEL_DST_R0_STATUS_RING_BASE_MSB_RING_SIZE_SHFT,
1690*5113495bSYour Name 	},
1691*5113495bSYour Name 	{ /* WBM_IDLE_LINK */
1692*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WBM_IDLE_LINK,
1693*5113495bSYour Name 		.max_rings = 1,
1694*5113495bSYour Name 		.entry_size = sizeof(struct wbm_link_descriptor_ring) >> 2,
1695*5113495bSYour Name 		.lmac_ring = FALSE,
1696*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1697*5113495bSYour Name 		.reg_start = {
1698*5113495bSYour Name 		HWIO_WBM_R0_WBM_IDLE_LINK_RING_BASE_LSB_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET),
1699*5113495bSYour Name 		HWIO_WBM_R2_WBM_IDLE_LINK_RING_HP_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET),
1700*5113495bSYour Name 		},
1701*5113495bSYour Name 		/* Single ring - provide ring size if multiple rings of this
1702*5113495bSYour Name 		 * type are supported
1703*5113495bSYour Name 		 */
1704*5113495bSYour Name 		.reg_size = {},
1705*5113495bSYour Name 		.max_size =
1706*5113495bSYour Name 			HWIO_WBM_R0_WBM_IDLE_LINK_RING_BASE_MSB_RING_SIZE_BMSK >>
1707*5113495bSYour Name 				HWIO_WBM_R0_WBM_IDLE_LINK_RING_BASE_MSB_RING_SIZE_SHFT,
1708*5113495bSYour Name 	},
1709*5113495bSYour Name 	{ /* SW2WBM_RELEASE */
1710*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WBM_SW_RELEASE,
1711*5113495bSYour Name 		.max_rings = 1,
1712*5113495bSYour Name 		.entry_size = sizeof(struct wbm_release_ring) >> 2,
1713*5113495bSYour Name 		.lmac_ring = FALSE,
1714*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1715*5113495bSYour Name 		.reg_start = {
1716*5113495bSYour Name 		HWIO_WBM_R0_SW_RELEASE_RING_BASE_LSB_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET),
1717*5113495bSYour Name 		HWIO_WBM_R2_SW_RELEASE_RING_HP_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET),
1718*5113495bSYour Name 		},
1719*5113495bSYour Name 		/* Single ring - provide ring size if multiple rings of this
1720*5113495bSYour Name 		 * type are supported
1721*5113495bSYour Name 		 */
1722*5113495bSYour Name 		.reg_size = {},
1723*5113495bSYour Name 		.max_size =
1724*5113495bSYour Name 		HWIO_WBM_R0_SW_RELEASE_RING_BASE_MSB_RING_SIZE_BMSK >>
1725*5113495bSYour Name 		HWIO_WBM_R0_SW_RELEASE_RING_BASE_MSB_RING_SIZE_SHFT,
1726*5113495bSYour Name 	},
1727*5113495bSYour Name 	{ /* WBM2SW_RELEASE */
1728*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WBM2SW0_RELEASE,
1729*5113495bSYour Name 		.max_rings = 4,
1730*5113495bSYour Name 		.entry_size = sizeof(struct wbm_release_ring) >> 2,
1731*5113495bSYour Name 		.lmac_ring = FALSE,
1732*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
1733*5113495bSYour Name 		.reg_start = {
1734*5113495bSYour Name 			HWIO_WBM_R0_WBM2SW0_RELEASE_RING_BASE_LSB_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET),
1735*5113495bSYour Name 			HWIO_WBM_R2_WBM2SW0_RELEASE_RING_HP_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET),
1736*5113495bSYour Name 		},
1737*5113495bSYour Name 		.reg_size = {
1738*5113495bSYour Name 			HWIO_WBM_R0_WBM2SW1_RELEASE_RING_BASE_LSB_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET) -
1739*5113495bSYour Name 				HWIO_WBM_R0_WBM2SW0_RELEASE_RING_BASE_LSB_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET),
1740*5113495bSYour Name 			HWIO_WBM_R2_WBM2SW1_RELEASE_RING_HP_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET) -
1741*5113495bSYour Name 				HWIO_WBM_R2_WBM2SW0_RELEASE_RING_HP_ADDR(SEQ_WCSS_UMAC_WBM_REG_OFFSET),
1742*5113495bSYour Name 		},
1743*5113495bSYour Name 		.max_size =
1744*5113495bSYour Name 			HWIO_WBM_R0_WBM2SW0_RELEASE_RING_BASE_MSB_RING_SIZE_BMSK >>
1745*5113495bSYour Name 				HWIO_WBM_R0_WBM2SW0_RELEASE_RING_BASE_MSB_RING_SIZE_SHFT,
1746*5113495bSYour Name 	},
1747*5113495bSYour Name 	{ /* RXDMA_BUF */
1748*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA0_BUF0,
1749*5113495bSYour Name #ifdef IPA_OFFLOAD
1750*5113495bSYour Name 		.max_rings = 3,
1751*5113495bSYour Name #else
1752*5113495bSYour Name 		.max_rings = 2,
1753*5113495bSYour Name #endif
1754*5113495bSYour Name 		.entry_size = sizeof(struct wbm_buffer_ring) >> 2,
1755*5113495bSYour Name 		.lmac_ring = TRUE,
1756*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1757*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
1758*5113495bSYour Name 		 * from host
1759*5113495bSYour Name 		 */
1760*5113495bSYour Name 		.reg_start = {},
1761*5113495bSYour Name 		.reg_size = {},
1762*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
1763*5113495bSYour Name 	},
1764*5113495bSYour Name 	{ /* RXDMA_DST */
1765*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_RXDMA2SW0,
1766*5113495bSYour Name 		.max_rings = 1,
1767*5113495bSYour Name 		.entry_size = sizeof(struct reo_entrance_ring) >> 2,
1768*5113495bSYour Name 		.lmac_ring =  TRUE,
1769*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
1770*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
1771*5113495bSYour Name 		 * from host
1772*5113495bSYour Name 		 */
1773*5113495bSYour Name 		.reg_start = {},
1774*5113495bSYour Name 		.reg_size = {},
1775*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
1776*5113495bSYour Name 	},
1777*5113495bSYour Name 	{ /* RXDMA_MONITOR_BUF */
1778*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA2_BUF,
1779*5113495bSYour Name 		.max_rings = 1,
1780*5113495bSYour Name 		.entry_size = sizeof(struct wbm_buffer_ring) >> 2,
1781*5113495bSYour Name 		.lmac_ring = TRUE,
1782*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1783*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
1784*5113495bSYour Name 		 * from host
1785*5113495bSYour Name 		 */
1786*5113495bSYour Name 		.reg_start = {},
1787*5113495bSYour Name 		.reg_size = {},
1788*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
1789*5113495bSYour Name 	},
1790*5113495bSYour Name 	{ /* RXDMA_MONITOR_STATUS */
1791*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA1_STATBUF,
1792*5113495bSYour Name 		.max_rings = 1,
1793*5113495bSYour Name 		.entry_size = sizeof(struct wbm_buffer_ring) >> 2,
1794*5113495bSYour Name 		.lmac_ring = TRUE,
1795*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1796*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
1797*5113495bSYour Name 		 * from host
1798*5113495bSYour Name 		 */
1799*5113495bSYour Name 		.reg_start = {},
1800*5113495bSYour Name 		.reg_size = {},
1801*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
1802*5113495bSYour Name 	},
1803*5113495bSYour Name 	{ /* RXDMA_MONITOR_DST */
1804*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_RXDMA2SW1,
1805*5113495bSYour Name 		.max_rings = 1,
1806*5113495bSYour Name 		.entry_size = sizeof(struct reo_entrance_ring) >> 2,
1807*5113495bSYour Name 		.lmac_ring = TRUE,
1808*5113495bSYour Name 		.ring_dir = HAL_SRNG_DST_RING,
1809*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
1810*5113495bSYour Name 		 * from host
1811*5113495bSYour Name 		 */
1812*5113495bSYour Name 		.reg_start = {},
1813*5113495bSYour Name 		.reg_size = {},
1814*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
1815*5113495bSYour Name 	},
1816*5113495bSYour Name 	{ /* RXDMA_MONITOR_DESC */
1817*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WMAC1_SW2RXDMA1_DESC,
1818*5113495bSYour Name 		.max_rings = 1,
1819*5113495bSYour Name 		.entry_size = sizeof(struct wbm_buffer_ring) >> 2,
1820*5113495bSYour Name 		.lmac_ring = TRUE,
1821*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1822*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
1823*5113495bSYour Name 		 * from host
1824*5113495bSYour Name 		 */
1825*5113495bSYour Name 		.reg_start = {},
1826*5113495bSYour Name 		.reg_size = {},
1827*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
1828*5113495bSYour Name 	},
1829*5113495bSYour Name 	{ /* DIR_BUF_RX_DMA_SRC */
1830*5113495bSYour Name 		.start_ring_id = HAL_SRNG_DIR_BUF_RX_SRC_DMA_RING,
1831*5113495bSYour Name 		.max_rings = 1,
1832*5113495bSYour Name 		.entry_size = 2,
1833*5113495bSYour Name 		.lmac_ring = TRUE,
1834*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1835*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
1836*5113495bSYour Name 		 * from host
1837*5113495bSYour Name 		 */
1838*5113495bSYour Name 		.reg_start = {},
1839*5113495bSYour Name 		.reg_size = {},
1840*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
1841*5113495bSYour Name 	},
1842*5113495bSYour Name #ifdef WLAN_FEATURE_CIF_CFR
1843*5113495bSYour Name 	{ /* WIFI_POS_SRC */
1844*5113495bSYour Name 		.start_ring_id = HAL_SRNG_WIFI_POS_SRC_DMA_RING,
1845*5113495bSYour Name 		.max_rings = 1,
1846*5113495bSYour Name 		.entry_size = sizeof(wmi_oem_dma_buf_release_entry)  >> 2,
1847*5113495bSYour Name 		.lmac_ring = TRUE,
1848*5113495bSYour Name 		.ring_dir = HAL_SRNG_SRC_RING,
1849*5113495bSYour Name 		/* reg_start is not set because LMAC rings are not accessed
1850*5113495bSYour Name 		 * from host
1851*5113495bSYour Name 		 */
1852*5113495bSYour Name 		.reg_start = {},
1853*5113495bSYour Name 		.reg_size = {},
1854*5113495bSYour Name 		.max_size = HAL_RXDMA_MAX_RING_SIZE,
1855*5113495bSYour Name 	},
1856*5113495bSYour Name #endif
1857*5113495bSYour Name 	{ /* REO2PPE */ 0},
1858*5113495bSYour Name 	{ /* PPE2TCL */ 0},
1859*5113495bSYour Name 	{ /* PPE_RELEASE */ 0},
1860*5113495bSYour Name 	{ /* TX_MONITOR_BUF */ 0},
1861*5113495bSYour Name 	{ /* TX_MONITOR_DST */ 0},
1862*5113495bSYour Name 	{ /* SW2RXDMA_NEW */ 0},
1863*5113495bSYour Name 	{ /* SW2RXDMA_LINK_RELEASE */ 0},
1864*5113495bSYour Name };
1865*5113495bSYour Name 
1866*5113495bSYour Name /**
1867*5113495bSYour Name  * hal_qca8074_attach() - Attach 8074 target specific hal_soc ops,
1868*5113495bSYour Name  *                        offset and srng table
1869*5113495bSYour Name  * @hal_soc: HAL SoC context
1870*5113495bSYour Name  */
hal_qca8074_attach(struct hal_soc * hal_soc)1871*5113495bSYour Name void hal_qca8074_attach(struct hal_soc *hal_soc)
1872*5113495bSYour Name {
1873*5113495bSYour Name 	hal_soc->hw_srng_table = hw_srng_table_8074;
1874*5113495bSYour Name 	hal_srng_hw_reg_offset_init_generic(hal_soc);
1875*5113495bSYour Name 	hal_hw_txrx_default_ops_attach_li(hal_soc);
1876*5113495bSYour Name 	hal_hw_txrx_ops_attach_qca8074(hal_soc);
1877*5113495bSYour Name }
1878