xref: /linux/drivers/net/wireless/ath/ath12k/hal_desc.h (revision 1a9239bb4253f9076b5b4b2a1a4e8d7defd77a95)
1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2 /*
3  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4  * Copyright (c) 2021-2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
5  */
6 #include "core.h"
7 
8 #ifndef ATH12K_HAL_DESC_H
9 #define ATH12K_HAL_DESC_H
10 
11 #define BUFFER_ADDR_INFO0_ADDR         GENMASK(31, 0)
12 
13 #define BUFFER_ADDR_INFO1_ADDR         GENMASK(7, 0)
14 #define BUFFER_ADDR_INFO1_RET_BUF_MGR  GENMASK(11, 8)
15 #define BUFFER_ADDR_INFO1_SW_COOKIE    GENMASK(31, 12)
16 
17 struct ath12k_buffer_addr {
18 	__le32 info0;
19 	__le32 info1;
20 } __packed;
21 
22 /* ath12k_buffer_addr
23  *
24  * buffer_addr_31_0
25  *		Address (lower 32 bits) of the MSDU buffer or MSDU_EXTENSION
26  *		descriptor or Link descriptor
27  *
28  * buffer_addr_39_32
29  *		Address (upper 8 bits) of the MSDU buffer or MSDU_EXTENSION
30  *		descriptor or Link descriptor
31  *
32  * return_buffer_manager (RBM)
33  *		Consumer: WBM
34  *		Producer: SW/FW
35  *		Indicates to which buffer manager the buffer or MSDU_EXTENSION
36  *		descriptor or link descriptor that is being pointed to shall be
37  *		returned after the frame has been processed. It is used by WBM
38  *		for routing purposes.
39  *
40  *		Values are defined in enum %HAL_RX_BUF_RBM_
41  *
42  * sw_buffer_cookie
43  *		Cookie field exclusively used by SW. HW ignores the contents,
44  *		accept that it passes the programmed value on to other
45  *		descriptors together with the physical address.
46  *
47  *		Field can be used by SW to for example associate the buffers
48  *		physical address with the virtual address.
49  *
50  *		NOTE1:
51  *		The three most significant bits can have a special meaning
52  *		 in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
53  *		and field transmit_bw_restriction is set
54  *
55  *		In case of NON punctured transmission:
56  *		Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
57  *		Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
58  *		Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
59  *		Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
60  *		Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
61  *		Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
62  *		Sw_buffer_cookie[19:18] = 2'b11: reserved
63  *
64  *		In case of punctured transmission:
65  *		Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
66  *		Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
67  *		Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
68  *		Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
69  *		Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
70  *		Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
71  *		Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
72  *		Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
73  *		Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
74  *		Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
75  *		Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
76  *		Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
77  *		Sw_buffer_cookie[19:18] = 2'b11: reserved
78  *
79  *		Note: a punctured transmission is indicated by the presence
80  *		 of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
81  *
82  *		Sw_buffer_cookie[20:17]: Tid: The TID field in the QoS control
83  *		 field
84  *
85  *		Sw_buffer_cookie[16]: Mpdu_qos_control_valid: This field
86  *		 indicates MPDUs with a QoS control field.
87  *
88  */
89 
90 enum hal_tlv_tag {
91 	HAL_MACTX_CBF_START					= 0 /* 0x0 */,
92 	HAL_PHYRX_DATA						= 1 /* 0x1 */,
93 	HAL_PHYRX_CBF_DATA_RESP					= 2 /* 0x2 */,
94 	HAL_PHYRX_ABORT_REQUEST					= 3 /* 0x3 */,
95 	HAL_PHYRX_USER_ABORT_NOTIFICATION			= 4 /* 0x4 */,
96 	HAL_MACTX_DATA_RESP					= 5 /* 0x5 */,
97 	HAL_MACTX_CBF_DATA					= 6 /* 0x6 */,
98 	HAL_MACTX_CBF_DONE					= 7 /* 0x7 */,
99 	HAL_PHYRX_LMR_DATA_RESP					= 8 /* 0x8 */,
100 	HAL_RXPCU_TO_UCODE_START				= 9 /* 0x9 */,
101 	HAL_RXPCU_TO_UCODE_DELIMITER_FOR_FULL_MPDU		= 10 /* 0xa */,
102 	HAL_RXPCU_TO_UCODE_FULL_MPDU_DATA			= 11 /* 0xb */,
103 	HAL_RXPCU_TO_UCODE_FCS_STATUS				= 12 /* 0xc */,
104 	HAL_RXPCU_TO_UCODE_MPDU_DELIMITER			= 13 /* 0xd */,
105 	HAL_RXPCU_TO_UCODE_DELIMITER_FOR_MPDU_HEADER		= 14 /* 0xe */,
106 	HAL_RXPCU_TO_UCODE_MPDU_HEADER_DATA			= 15 /* 0xf */,
107 	HAL_RXPCU_TO_UCODE_END					= 16 /* 0x10 */,
108 	HAL_MACRX_CBF_READ_REQUEST				= 32 /* 0x20 */,
109 	HAL_MACRX_CBF_DATA_REQUEST				= 33 /* 0x21 */,
110 	HAL_MACRXXPECT_NDP_RECEPTION				= 34 /* 0x22 */,
111 	HAL_MACRX_FREEZE_CAPTURE_CHANNEL			= 35 /* 0x23 */,
112 	HAL_MACRX_NDP_TIMEOUT					= 36 /* 0x24 */,
113 	HAL_MACRX_ABORT_ACK					= 37 /* 0x25 */,
114 	HAL_MACRX_REQ_IMPLICIT_FB				= 38 /* 0x26 */,
115 	HAL_MACRX_CHAIN_MASK					= 39 /* 0x27 */,
116 	HAL_MACRX_NAP_USER					= 40 /* 0x28 */,
117 	HAL_MACRX_ABORT_REQUEST					= 41 /* 0x29 */,
118 	HAL_PHYTX_OTHER_TRANSMIT_INFO16				= 42 /* 0x2a */,
119 	HAL_PHYTX_ABORT_ACK					= 43 /* 0x2b */,
120 	HAL_PHYTX_ABORT_REQUEST					= 44 /* 0x2c */,
121 	HAL_PHYTX_PKT_END					= 45 /* 0x2d */,
122 	HAL_PHYTX_PPDU_HEADER_INFO_REQUEST			= 46 /* 0x2e */,
123 	HAL_PHYTX_REQUEST_CTRL_INFO				= 47 /* 0x2f */,
124 	HAL_PHYTX_DATA_REQUEST					= 48 /* 0x30 */,
125 	HAL_PHYTX_BF_CV_LOADING_DONE				= 49 /* 0x31 */,
126 	HAL_PHYTX_NAP_ACK					= 50 /* 0x32 */,
127 	HAL_PHYTX_NAP_DONE					= 51 /* 0x33 */,
128 	HAL_PHYTX_OFF_ACK					= 52 /* 0x34 */,
129 	HAL_PHYTX_ON_ACK					= 53 /* 0x35 */,
130 	HAL_PHYTX_SYNTH_OFF_ACK					= 54 /* 0x36 */,
131 	HAL_PHYTX_DEBUG16					= 55 /* 0x37 */,
132 	HAL_MACTX_ABORT_REQUEST					= 56 /* 0x38 */,
133 	HAL_MACTX_ABORT_ACK					= 57 /* 0x39 */,
134 	HAL_MACTX_PKT_END					= 58 /* 0x3a */,
135 	HAL_MACTX_PRE_PHY_DESC					= 59 /* 0x3b */,
136 	HAL_MACTX_BF_PARAMS_COMMON				= 60 /* 0x3c */,
137 	HAL_MACTX_BF_PARAMS_PER_USER				= 61 /* 0x3d */,
138 	HAL_MACTX_PREFETCH_CV					= 62 /* 0x3e */,
139 	HAL_MACTX_USER_DESC_COMMON				= 63 /* 0x3f */,
140 	HAL_MACTX_USER_DESC_PER_USER				= 64 /* 0x40 */,
141 	HAL_XAMPLE_USER_TLV_16					= 65 /* 0x41 */,
142 	HAL_XAMPLE_TLV_16					= 66 /* 0x42 */,
143 	HAL_MACTX_PHY_OFF					= 67 /* 0x43 */,
144 	HAL_MACTX_PHY_ON					= 68 /* 0x44 */,
145 	HAL_MACTX_SYNTH_OFF					= 69 /* 0x45 */,
146 	HAL_MACTXXPECT_CBF_COMMON				= 70 /* 0x46 */,
147 	HAL_MACTXXPECT_CBF_PER_USER				= 71 /* 0x47 */,
148 	HAL_MACTX_PHY_DESC					= 72 /* 0x48 */,
149 	HAL_MACTX_L_SIG_A					= 73 /* 0x49 */,
150 	HAL_MACTX_L_SIG_B					= 74 /* 0x4a */,
151 	HAL_MACTX_HT_SIG					= 75 /* 0x4b */,
152 	HAL_MACTX_VHT_SIG_A					= 76 /* 0x4c */,
153 	HAL_MACTX_VHT_SIG_B_SU20				= 77 /* 0x4d */,
154 	HAL_MACTX_VHT_SIG_B_SU40				= 78 /* 0x4e */,
155 	HAL_MACTX_VHT_SIG_B_SU80				= 79 /* 0x4f */,
156 	HAL_MACTX_VHT_SIG_B_SU160				= 80 /* 0x50 */,
157 	HAL_MACTX_VHT_SIG_B_MU20				= 81 /* 0x51 */,
158 	HAL_MACTX_VHT_SIG_B_MU40				= 82 /* 0x52 */,
159 	HAL_MACTX_VHT_SIG_B_MU80				= 83 /* 0x53 */,
160 	HAL_MACTX_VHT_SIG_B_MU160				= 84 /* 0x54 */,
161 	HAL_MACTX_SERVICE					= 85 /* 0x55 */,
162 	HAL_MACTX_HE_SIG_A_SU					= 86 /* 0x56 */,
163 	HAL_MACTX_HE_SIG_A_MU_DL				= 87 /* 0x57 */,
164 	HAL_MACTX_HE_SIG_A_MU_UL				= 88 /* 0x58 */,
165 	HAL_MACTX_HE_SIG_B1_MU					= 89 /* 0x59 */,
166 	HAL_MACTX_HE_SIG_B2_MU					= 90 /* 0x5a */,
167 	HAL_MACTX_HE_SIG_B2_OFDMA				= 91 /* 0x5b */,
168 	HAL_MACTX_DELETE_CV					= 92 /* 0x5c */,
169 	HAL_MACTX_MU_UPLINK_COMMON				= 93 /* 0x5d */,
170 	HAL_MACTX_MU_UPLINK_USER_SETUP				= 94 /* 0x5e */,
171 	HAL_MACTX_OTHER_TRANSMIT_INFO				= 95 /* 0x5f */,
172 	HAL_MACTX_PHY_NAP					= 96 /* 0x60 */,
173 	HAL_MACTX_DEBUG						= 97 /* 0x61 */,
174 	HAL_PHYRX_ABORT_ACK					= 98 /* 0x62 */,
175 	HAL_PHYRX_GENERATED_CBF_DETAILS				= 99 /* 0x63 */,
176 	HAL_PHYRX_RSSI_LEGACY					= 100 /* 0x64 */,
177 	HAL_PHYRX_RSSI_HT					= 101 /* 0x65 */,
178 	HAL_PHYRX_USER_INFO					= 102 /* 0x66 */,
179 	HAL_PHYRX_PKT_END					= 103 /* 0x67 */,
180 	HAL_PHYRX_DEBUG						= 104 /* 0x68 */,
181 	HAL_PHYRX_CBF_TRANSFER_DONE				= 105 /* 0x69 */,
182 	HAL_PHYRX_CBF_TRANSFER_ABORT				= 106 /* 0x6a */,
183 	HAL_PHYRX_L_SIG_A					= 107 /* 0x6b */,
184 	HAL_PHYRX_L_SIG_B					= 108 /* 0x6c */,
185 	HAL_PHYRX_HT_SIG					= 109 /* 0x6d */,
186 	HAL_PHYRX_VHT_SIG_A					= 110 /* 0x6e */,
187 	HAL_PHYRX_VHT_SIG_B_SU20				= 111 /* 0x6f */,
188 	HAL_PHYRX_VHT_SIG_B_SU40				= 112 /* 0x70 */,
189 	HAL_PHYRX_VHT_SIG_B_SU80				= 113 /* 0x71 */,
190 	HAL_PHYRX_VHT_SIG_B_SU160				= 114 /* 0x72 */,
191 	HAL_PHYRX_VHT_SIG_B_MU20				= 115 /* 0x73 */,
192 	HAL_PHYRX_VHT_SIG_B_MU40				= 116 /* 0x74 */,
193 	HAL_PHYRX_VHT_SIG_B_MU80				= 117 /* 0x75 */,
194 	HAL_PHYRX_VHT_SIG_B_MU160				= 118 /* 0x76 */,
195 	HAL_PHYRX_HE_SIG_A_SU					= 119 /* 0x77 */,
196 	HAL_PHYRX_HE_SIG_A_MU_DL				= 120 /* 0x78 */,
197 	HAL_PHYRX_HE_SIG_A_MU_UL				= 121 /* 0x79 */,
198 	HAL_PHYRX_HE_SIG_B1_MU					= 122 /* 0x7a */,
199 	HAL_PHYRX_HE_SIG_B2_MU					= 123 /* 0x7b */,
200 	HAL_PHYRX_HE_SIG_B2_OFDMA				= 124 /* 0x7c */,
201 	HAL_PHYRX_OTHER_RECEIVE_INFO				= 125 /* 0x7d */,
202 	HAL_PHYRX_COMMON_USER_INFO				= 126 /* 0x7e */,
203 	HAL_PHYRX_DATA_DONE					= 127 /* 0x7f */,
204 	HAL_COEX_TX_REQ						= 128 /* 0x80 */,
205 	HAL_DUMMY						= 129 /* 0x81 */,
206 	HALXAMPLE_TLV_32_NAME					= 130 /* 0x82 */,
207 	HAL_MPDU_LIMIT						= 131 /* 0x83 */,
208 	HAL_NA_LENGTH_END					= 132 /* 0x84 */,
209 	HAL_OLE_BUF_STATUS					= 133 /* 0x85 */,
210 	HAL_PCU_PPDU_SETUP_DONE					= 134 /* 0x86 */,
211 	HAL_PCU_PPDU_SETUP_END					= 135 /* 0x87 */,
212 	HAL_PCU_PPDU_SETUP_INIT					= 136 /* 0x88 */,
213 	HAL_PCU_PPDU_SETUP_START				= 137 /* 0x89 */,
214 	HAL_PDG_FES_SETUP					= 138 /* 0x8a */,
215 	HAL_PDG_RESPONSE					= 139 /* 0x8b */,
216 	HAL_PDG_TX_REQ						= 140 /* 0x8c */,
217 	HAL_SCH_WAIT_INSTR					= 141 /* 0x8d */,
218 	HAL_TQM_FLOWMPTY_STATUS					= 143 /* 0x8f */,
219 	HAL_TQM_FLOW_NOTMPTY_STATUS				= 144 /* 0x90 */,
220 	HAL_TQM_GEN_MPDU_LENGTH_LIST				= 145 /* 0x91 */,
221 	HAL_TQM_GEN_MPDU_LENGTH_LIST_STATUS			= 146 /* 0x92 */,
222 	HAL_TQM_GEN_MPDUS					= 147 /* 0x93 */,
223 	HAL_TQM_GEN_MPDUS_STATUS				= 148 /* 0x94 */,
224 	HAL_TQM_REMOVE_MPDU					= 149 /* 0x95 */,
225 	HAL_TQM_REMOVE_MPDU_STATUS				= 150 /* 0x96 */,
226 	HAL_TQM_REMOVE_MSDU					= 151 /* 0x97 */,
227 	HAL_TQM_REMOVE_MSDU_STATUS				= 152 /* 0x98 */,
228 	HAL_TQM_UPDATE_TX_MPDU_COUNT				= 153 /* 0x99 */,
229 	HAL_TQM_WRITE_CMD					= 154 /* 0x9a */,
230 	HAL_OFDMA_TRIGGER_DETAILS				= 155 /* 0x9b */,
231 	HAL_TX_DATA						= 156 /* 0x9c */,
232 	HAL_TX_FES_SETUP					= 157 /* 0x9d */,
233 	HAL_RX_PACKET						= 158 /* 0x9e */,
234 	HALXPECTED_RESPONSE					= 159 /* 0x9f */,
235 	HAL_TX_MPDU_END						= 160 /* 0xa0 */,
236 	HAL_TX_MPDU_START					= 161 /* 0xa1 */,
237 	HAL_TX_MSDU_END						= 162 /* 0xa2 */,
238 	HAL_TX_MSDU_START					= 163 /* 0xa3 */,
239 	HAL_TX_SW_MODE_SETUP					= 164 /* 0xa4 */,
240 	HAL_TXPCU_BUFFER_STATUS					= 165 /* 0xa5 */,
241 	HAL_TXPCU_USER_BUFFER_STATUS				= 166 /* 0xa6 */,
242 	HAL_DATA_TO_TIME_CONFIG					= 167 /* 0xa7 */,
243 	HALXAMPLE_USER_TLV_32					= 168 /* 0xa8 */,
244 	HAL_MPDU_INFO						= 169 /* 0xa9 */,
245 	HAL_PDG_USER_SETUP					= 170 /* 0xaa */,
246 	HAL_TX_11AH_SETUP					= 171 /* 0xab */,
247 	HAL_REO_UPDATE_RX_REO_QUEUE_STATUS			= 172 /* 0xac */,
248 	HAL_TX_PEER_ENTRY					= 173 /* 0xad */,
249 	HAL_TX_RAW_OR_NATIVE_FRAME_SETUP			= 174 /* 0xae */,
250 	HALXAMPLE_USER_TLV_44					= 175 /* 0xaf */,
251 	HAL_TX_FLUSH						= 176 /* 0xb0 */,
252 	HAL_TX_FLUSH_REQ					= 177 /* 0xb1 */,
253 	HAL_TQM_WRITE_CMD_STATUS				= 178 /* 0xb2 */,
254 	HAL_TQM_GET_MPDU_QUEUE_STATS				= 179 /* 0xb3 */,
255 	HAL_TQM_GET_MSDU_FLOW_STATS				= 180 /* 0xb4 */,
256 	HALXAMPLE_USER_CTLV_44					= 181 /* 0xb5 */,
257 	HAL_TX_FES_STATUS_START					= 182 /* 0xb6 */,
258 	HAL_TX_FES_STATUS_USER_PPDU				= 183 /* 0xb7 */,
259 	HAL_TX_FES_STATUS_USER_RESPONSE				= 184 /* 0xb8 */,
260 	HAL_TX_FES_STATUS_END					= 185 /* 0xb9 */,
261 	HAL_RX_TRIG_INFO					= 186 /* 0xba */,
262 	HAL_RXPCU_TX_SETUP_CLEAR				= 187 /* 0xbb */,
263 	HAL_RX_FRAME_BITMAP_REQ					= 188 /* 0xbc */,
264 	HAL_RX_FRAME_BITMAP_ACK					= 189 /* 0xbd */,
265 	HAL_COEX_RX_STATUS					= 190 /* 0xbe */,
266 	HAL_RX_START_PARAM					= 191 /* 0xbf */,
267 	HAL_RX_PPDU_START					= 192 /* 0xc0 */,
268 	HAL_RX_PPDU_END						= 193 /* 0xc1 */,
269 	HAL_RX_MPDU_START					= 194 /* 0xc2 */,
270 	HAL_RX_MPDU_END						= 195 /* 0xc3 */,
271 	HAL_RX_MSDU_START					= 196 /* 0xc4 */,
272 	HAL_RX_MSDU_END						= 197 /* 0xc5 */,
273 	HAL_RX_ATTENTION					= 198 /* 0xc6 */,
274 	HAL_RECEIVED_RESPONSE_INFO				= 199 /* 0xc7 */,
275 	HAL_RX_PHY_SLEEP					= 200 /* 0xc8 */,
276 	HAL_RX_HEADER						= 201 /* 0xc9 */,
277 	HAL_RX_PEER_ENTRY					= 202 /* 0xca */,
278 	HAL_RX_FLUSH						= 203 /* 0xcb */,
279 	HAL_RX_RESPONSE_REQUIRED_INFO				= 204 /* 0xcc */,
280 	HAL_RX_FRAMELESS_BAR_DETAILS				= 205 /* 0xcd */,
281 	HAL_TQM_GET_MPDU_QUEUE_STATS_STATUS			= 206 /* 0xce */,
282 	HAL_TQM_GET_MSDU_FLOW_STATS_STATUS			= 207 /* 0xcf */,
283 	HAL_TX_CBF_INFO						= 208 /* 0xd0 */,
284 	HAL_PCU_PPDU_SETUP_USER					= 209 /* 0xd1 */,
285 	HAL_RX_MPDU_PCU_START					= 210 /* 0xd2 */,
286 	HAL_RX_PM_INFO						= 211 /* 0xd3 */,
287 	HAL_RX_USER_PPDU_END					= 212 /* 0xd4 */,
288 	HAL_RX_PRE_PPDU_START					= 213 /* 0xd5 */,
289 	HAL_RX_PREAMBLE						= 214 /* 0xd6 */,
290 	HAL_TX_FES_SETUP_COMPLETE				= 215 /* 0xd7 */,
291 	HAL_TX_LAST_MPDU_FETCHED				= 216 /* 0xd8 */,
292 	HAL_TXDMA_STOP_REQUEST					= 217 /* 0xd9 */,
293 	HAL_RXPCU_SETUP						= 218 /* 0xda */,
294 	HAL_RXPCU_USER_SETUP					= 219 /* 0xdb */,
295 	HAL_TX_FES_STATUS_ACK_OR_BA				= 220 /* 0xdc */,
296 	HAL_TQM_ACKED_MPDU					= 221 /* 0xdd */,
297 	HAL_COEX_TX_RESP					= 222 /* 0xde */,
298 	HAL_COEX_TX_STATUS					= 223 /* 0xdf */,
299 	HAL_MACTX_COEX_PHY_CTRL					= 224 /* 0xe0 */,
300 	HAL_COEX_STATUS_BROADCAST				= 225 /* 0xe1 */,
301 	HAL_RESPONSE_START_STATUS				= 226 /* 0xe2 */,
302 	HAL_RESPONSEND_STATUS					= 227 /* 0xe3 */,
303 	HAL_CRYPTO_STATUS					= 228 /* 0xe4 */,
304 	HAL_RECEIVED_TRIGGER_INFO				= 229 /* 0xe5 */,
305 	HAL_COEX_TX_STOP_CTRL					= 230 /* 0xe6 */,
306 	HAL_RX_PPDU_ACK_REPORT					= 231 /* 0xe7 */,
307 	HAL_RX_PPDU_NO_ACK_REPORT				= 232 /* 0xe8 */,
308 	HAL_SCH_COEX_STATUS					= 233 /* 0xe9 */,
309 	HAL_SCHEDULER_COMMAND_STATUS				= 234 /* 0xea */,
310 	HAL_SCHEDULER_RX_PPDU_NO_RESPONSE_STATUS		= 235 /* 0xeb */,
311 	HAL_TX_FES_STATUS_PROT					= 236 /* 0xec */,
312 	HAL_TX_FES_STATUS_START_PPDU				= 237 /* 0xed */,
313 	HAL_TX_FES_STATUS_START_PROT				= 238 /* 0xee */,
314 	HAL_TXPCU_PHYTX_DEBUG32					= 239 /* 0xef */,
315 	HAL_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32			= 240 /* 0xf0 */,
316 	HAL_TX_MPDU_COUNT_TRANSFERND				= 241 /* 0xf1 */,
317 	HAL_WHO_ANCHOR_OFFSET					= 242 /* 0xf2 */,
318 	HAL_WHO_ANCHOR_VALUE					= 243 /* 0xf3 */,
319 	HAL_WHO_CCE_INFO					= 244 /* 0xf4 */,
320 	HAL_WHO_COMMIT						= 245 /* 0xf5 */,
321 	HAL_WHO_COMMIT_DONE					= 246 /* 0xf6 */,
322 	HAL_WHO_FLUSH						= 247 /* 0xf7 */,
323 	HAL_WHO_L2_LLC						= 248 /* 0xf8 */,
324 	HAL_WHO_L2_PAYLOAD					= 249 /* 0xf9 */,
325 	HAL_WHO_L3_CHECKSUM					= 250 /* 0xfa */,
326 	HAL_WHO_L3_INFO						= 251 /* 0xfb */,
327 	HAL_WHO_L4_CHECKSUM					= 252 /* 0xfc */,
328 	HAL_WHO_L4_INFO						= 253 /* 0xfd */,
329 	HAL_WHO_MSDU						= 254 /* 0xfe */,
330 	HAL_WHO_MSDU_MISC					= 255 /* 0xff */,
331 	HAL_WHO_PACKET_DATA					= 256 /* 0x100 */,
332 	HAL_WHO_PACKET_HDR					= 257 /* 0x101 */,
333 	HAL_WHO_PPDU_END					= 258 /* 0x102 */,
334 	HAL_WHO_PPDU_START					= 259 /* 0x103 */,
335 	HAL_WHO_TSO						= 260 /* 0x104 */,
336 	HAL_WHO_WMAC_HEADER_PV0					= 261 /* 0x105 */,
337 	HAL_WHO_WMAC_HEADER_PV1					= 262 /* 0x106 */,
338 	HAL_WHO_WMAC_IV						= 263 /* 0x107 */,
339 	HAL_MPDU_INFO_END					= 264 /* 0x108 */,
340 	HAL_MPDU_INFO_BITMAP					= 265 /* 0x109 */,
341 	HAL_TX_QUEUE_EXTENSION					= 266 /* 0x10a */,
342 	HAL_SCHEDULER_SELFGEN_RESPONSE_STATUS			= 267 /* 0x10b */,
343 	HAL_TQM_UPDATE_TX_MPDU_COUNT_STATUS			= 268 /* 0x10c */,
344 	HAL_TQM_ACKED_MPDU_STATUS				= 269 /* 0x10d */,
345 	HAL_TQM_ADD_MSDU_STATUS					= 270 /* 0x10e */,
346 	HAL_TQM_LIST_GEN_DONE					= 271 /* 0x10f */,
347 	HAL_WHO_TERMINATE					= 272 /* 0x110 */,
348 	HAL_TX_LAST_MPDU_END					= 273 /* 0x111 */,
349 	HAL_TX_CV_DATA						= 274 /* 0x112 */,
350 	HAL_PPDU_TX_END						= 275 /* 0x113 */,
351 	HAL_PROT_TX_END						= 276 /* 0x114 */,
352 	HAL_MPDU_INFO_GLOBAL_END				= 277 /* 0x115 */,
353 	HAL_TQM_SCH_INSTR_GLOBAL_END				= 278 /* 0x116 */,
354 	HAL_RX_PPDU_END_USER_STATS				= 279 /* 0x117 */,
355 	HAL_RX_PPDU_END_USER_STATS_EXT				= 280 /* 0x118 */,
356 	HAL_REO_GET_QUEUE_STATS					= 281 /* 0x119 */,
357 	HAL_REO_FLUSH_QUEUE					= 282 /* 0x11a */,
358 	HAL_REO_FLUSH_CACHE					= 283 /* 0x11b */,
359 	HAL_REO_UNBLOCK_CACHE					= 284 /* 0x11c */,
360 	HAL_REO_GET_QUEUE_STATS_STATUS				= 285 /* 0x11d */,
361 	HAL_REO_FLUSH_QUEUE_STATUS				= 286 /* 0x11e */,
362 	HAL_REO_FLUSH_CACHE_STATUS				= 287 /* 0x11f */,
363 	HAL_REO_UNBLOCK_CACHE_STATUS				= 288 /* 0x120 */,
364 	HAL_TQM_FLUSH_CACHE					= 289 /* 0x121 */,
365 	HAL_TQM_UNBLOCK_CACHE					= 290 /* 0x122 */,
366 	HAL_TQM_FLUSH_CACHE_STATUS				= 291 /* 0x123 */,
367 	HAL_TQM_UNBLOCK_CACHE_STATUS				= 292 /* 0x124 */,
368 	HAL_RX_PPDU_END_STATUS_DONE				= 293 /* 0x125 */,
369 	HAL_RX_STATUS_BUFFER_DONE				= 294 /* 0x126 */,
370 	HAL_TX_DATA_SYNC					= 297 /* 0x129 */,
371 	HAL_PHYRX_CBF_READ_REQUEST_ACK				= 298 /* 0x12a */,
372 	HAL_TQM_GET_MPDU_HEAD_INFO				= 299 /* 0x12b */,
373 	HAL_TQM_SYNC_CMD					= 300 /* 0x12c */,
374 	HAL_TQM_GET_MPDU_HEAD_INFO_STATUS			= 301 /* 0x12d */,
375 	HAL_TQM_SYNC_CMD_STATUS					= 302 /* 0x12e */,
376 	HAL_TQM_THRESHOLD_DROP_NOTIFICATION_STATUS		= 303 /* 0x12f */,
377 	HAL_TQM_DESCRIPTOR_THRESHOLD_REACHED_STATUS		= 304 /* 0x130 */,
378 	HAL_REO_FLUSH_TIMEOUT_LIST				= 305 /* 0x131 */,
379 	HAL_REO_FLUSH_TIMEOUT_LIST_STATUS			= 306 /* 0x132 */,
380 	HAL_REO_DESCRIPTOR_THRESHOLD_REACHED_STATUS		= 307 /* 0x133 */,
381 	HAL_SCHEDULER_RX_SIFS_RESPONSE_TRIGGER_STATUS		= 308 /* 0x134 */,
382 	HALXAMPLE_USER_TLV_32_NAME				= 309 /* 0x135 */,
383 	HAL_RX_PPDU_START_USER_INFO				= 310 /* 0x136 */,
384 	HAL_RX_RING_MASK					= 311 /* 0x137 */,
385 	HAL_COEX_MAC_NAP					= 312 /* 0x138 */,
386 	HAL_RXPCU_PPDU_END_INFO					= 313 /* 0x139 */,
387 	HAL_WHO_MESH_CONTROL					= 314 /* 0x13a */,
388 	HAL_PDG_SW_MODE_BW_START				= 315 /* 0x13b */,
389 	HAL_PDG_SW_MODE_BW_END					= 316 /* 0x13c */,
390 	HAL_PDG_WAIT_FOR_MAC_REQUEST				= 317 /* 0x13d */,
391 	HAL_PDG_WAIT_FOR_PHY_REQUEST				= 318 /* 0x13e */,
392 	HAL_SCHEDULER_END					= 319 /* 0x13f */,
393 	HAL_RX_PPDU_START_DROPPED				= 320 /* 0x140 */,
394 	HAL_RX_PPDU_END_DROPPED					= 321 /* 0x141 */,
395 	HAL_RX_PPDU_END_STATUS_DONE_DROPPED			= 322 /* 0x142 */,
396 	HAL_RX_MPDU_START_DROPPED				= 323 /* 0x143 */,
397 	HAL_RX_MSDU_START_DROPPED				= 324 /* 0x144 */,
398 	HAL_RX_MSDU_END_DROPPED					= 325 /* 0x145 */,
399 	HAL_RX_MPDU_END_DROPPED					= 326 /* 0x146 */,
400 	HAL_RX_ATTENTION_DROPPED				= 327 /* 0x147 */,
401 	HAL_TXPCU_USER_SETUP					= 328 /* 0x148 */,
402 	HAL_RXPCU_USER_SETUP_EXT				= 329 /* 0x149 */,
403 	HAL_CMD_PART_0_END					= 330 /* 0x14a */,
404 	HAL_MACTX_SYNTH_ON					= 331 /* 0x14b */,
405 	HAL_SCH_CRITICAL_TLV_REFERENCE				= 332 /* 0x14c */,
406 	HAL_TQM_MPDU_GLOBAL_START				= 333 /* 0x14d */,
407 	HALXAMPLE_TLV_32					= 334 /* 0x14e */,
408 	HAL_TQM_UPDATE_TX_MSDU_FLOW				= 335 /* 0x14f */,
409 	HAL_TQM_UPDATE_TX_MPDU_QUEUE_HEAD			= 336 /* 0x150 */,
410 	HAL_TQM_UPDATE_TX_MSDU_FLOW_STATUS			= 337 /* 0x151 */,
411 	HAL_TQM_UPDATE_TX_MPDU_QUEUE_HEAD_STATUS		= 338 /* 0x152 */,
412 	HAL_REO_UPDATE_RX_REO_QUEUE				= 339 /* 0x153 */,
413 	HAL_TQM_MPDU_QUEUEMPTY_STATUS				= 340 /* 0x154 */,
414 	HAL_TQM_2_SCH_MPDU_AVAILABLE				= 341 /* 0x155 */,
415 	HAL_PDG_TRIG_RESPONSE					= 342 /* 0x156 */,
416 	HAL_TRIGGER_RESPONSE_TX_DONE				= 343 /* 0x157 */,
417 	HAL_ABORT_FROM_PHYRX_DETAILS				= 344 /* 0x158 */,
418 	HAL_SCH_TQM_CMD_WRAPPER					= 345 /* 0x159 */,
419 	HAL_MPDUS_AVAILABLE					= 346 /* 0x15a */,
420 	HAL_RECEIVED_RESPONSE_INFO_PART2			= 347 /* 0x15b */,
421 	HAL_PHYRX_TX_START_TIMING				= 348 /* 0x15c */,
422 	HAL_TXPCU_PREAMBLE_DONE					= 349 /* 0x15d */,
423 	HAL_NDP_PREAMBLE_DONE					= 350 /* 0x15e */,
424 	HAL_SCH_TQM_CMD_WRAPPER_RBO_DROP			= 351 /* 0x15f */,
425 	HAL_SCH_TQM_CMD_WRAPPER_CONT_DROP			= 352 /* 0x160 */,
426 	HAL_MACTX_CLEAR_PREV_TX_INFO				= 353 /* 0x161 */,
427 	HAL_TX_PUNCTURE_SETUP					= 354 /* 0x162 */,
428 	HAL_R2R_STATUS_END					= 355 /* 0x163 */,
429 	HAL_MACTX_PREFETCH_CV_COMMON				= 356 /* 0x164 */,
430 	HAL_END_OF_FLUSH_MARKER					= 357 /* 0x165 */,
431 	HAL_MACTX_MU_UPLINK_COMMON_PUNC				= 358 /* 0x166 */,
432 	HAL_MACTX_MU_UPLINK_USER_SETUP_PUNC			= 359 /* 0x167 */,
433 	HAL_RECEIVED_RESPONSE_USER_7_0				= 360 /* 0x168 */,
434 	HAL_RECEIVED_RESPONSE_USER_15_8				= 361 /* 0x169 */,
435 	HAL_RECEIVED_RESPONSE_USER_23_16			= 362 /* 0x16a */,
436 	HAL_RECEIVED_RESPONSE_USER_31_24			= 363 /* 0x16b */,
437 	HAL_RECEIVED_RESPONSE_USER_36_32			= 364 /* 0x16c */,
438 	HAL_TX_LOOPBACK_SETUP					= 365 /* 0x16d */,
439 	HAL_PHYRX_OTHER_RECEIVE_INFO_RU_DETAILS			= 366 /* 0x16e */,
440 	HAL_SCH_WAIT_INSTR_TX_PATH				= 367 /* 0x16f */,
441 	HAL_MACTX_OTHER_TRANSMIT_INFO_TX2TX			= 368 /* 0x170 */,
442 	HAL_MACTX_OTHER_TRANSMIT_INFOMUPHY_SETUP		= 369 /* 0x171 */,
443 	HAL_PHYRX_OTHER_RECEIVE_INFOVM_DETAILS			= 370 /* 0x172 */,
444 	HAL_TX_WUR_DATA						= 371 /* 0x173 */,
445 	HAL_RX_PPDU_END_START					= 372 /* 0x174 */,
446 	HAL_RX_PPDU_END_MIDDLE					= 373 /* 0x175 */,
447 	HAL_RX_PPDU_END_LAST					= 374 /* 0x176 */,
448 	HAL_MACTX_BACKOFF_BASED_TRANSMISSION			= 375 /* 0x177 */,
449 	HAL_MACTX_OTHER_TRANSMIT_INFO_DL_OFDMA_TX		= 376 /* 0x178 */,
450 	HAL_SRP_INFO						= 377 /* 0x179 */,
451 	HAL_OBSS_SR_INFO					= 378 /* 0x17a */,
452 	HAL_SCHEDULER_SW_MSG_STATUS				= 379 /* 0x17b */,
453 	HAL_HWSCH_RXPCU_MAC_INFO_ANNOUNCEMENT			= 380 /* 0x17c */,
454 	HAL_RXPCU_SETUP_COMPLETE				= 381 /* 0x17d */,
455 	HAL_SNOOP_PPDU_START					= 382 /* 0x17e */,
456 	HAL_SNOOP_MPDU_USR_DBG_INFO				= 383 /* 0x17f */,
457 	HAL_SNOOP_MSDU_USR_DBG_INFO				= 384 /* 0x180 */,
458 	HAL_SNOOP_MSDU_USR_DATA					= 385 /* 0x181 */,
459 	HAL_SNOOP_MPDU_USR_STAT_INFO				= 386 /* 0x182 */,
460 	HAL_SNOOP_PPDU_END					= 387 /* 0x183 */,
461 	HAL_SNOOP_SPARE						= 388 /* 0x184 */,
462 	HAL_PHYRX_OTHER_RECEIVE_INFO_MU_RSSI_COMMON		= 390 /* 0x186 */,
463 	HAL_PHYRX_OTHER_RECEIVE_INFO_MU_RSSI_USER		= 391 /* 0x187 */,
464 	HAL_MACTX_OTHER_TRANSMIT_INFO_SCH_DETAILS		= 392 /* 0x188 */,
465 	HAL_PHYRX_OTHER_RECEIVE_INFO_108PVM_DETAILS		= 393 /* 0x189 */,
466 	HAL_SCH_TLV_WRAPPER					= 394 /* 0x18a */,
467 	HAL_SCHEDULER_STATUS_WRAPPER				= 395 /* 0x18b */,
468 	HAL_MPDU_INFO_6X					= 396 /* 0x18c */,
469 	HAL_MACTX_11AZ_USER_DESC_PER_USER			= 397 /* 0x18d */,
470 	HAL_MACTX_U_SIGHT_SU_MU					= 398 /* 0x18e */,
471 	HAL_MACTX_U_SIGHT_TB					= 399 /* 0x18f */,
472 	HAL_PHYRX_U_SIGHT_SU_MU					= 403 /* 0x193 */,
473 	HAL_PHYRX_U_SIGHT_TB					= 404 /* 0x194 */,
474 	HAL_MACRX_LMR_READ_REQUEST				= 408 /* 0x198 */,
475 	HAL_MACRX_LMR_DATA_REQUEST				= 409 /* 0x199 */,
476 	HAL_PHYRX_LMR_TRANSFER_DONE				= 410 /* 0x19a */,
477 	HAL_PHYRX_LMR_TRANSFER_ABORT				= 411 /* 0x19b */,
478 	HAL_PHYRX_LMR_READ_REQUEST_ACK				= 412 /* 0x19c */,
479 	HAL_MACRX_SECURE_LTF_SEQ_PTR				= 413 /* 0x19d */,
480 	HAL_PHYRX_USER_INFO_MU_UL				= 414 /* 0x19e */,
481 	HAL_MPDU_QUEUE_OVERVIEW					= 415 /* 0x19f */,
482 	HAL_SCHEDULER_NAV_INFO					= 416 /* 0x1a0 */,
483 	HAL_LMR_PEER_ENTRY					= 418 /* 0x1a2 */,
484 	HAL_LMR_MPDU_START					= 419 /* 0x1a3 */,
485 	HAL_LMR_DATA						= 420 /* 0x1a4 */,
486 	HAL_LMR_MPDU_END					= 421 /* 0x1a5 */,
487 	HAL_REO_GET_QUEUE_1K_STATS_STATUS			= 422 /* 0x1a6 */,
488 	HAL_RX_FRAME_1K_BITMAP_ACK				= 423 /* 0x1a7 */,
489 	HAL_TX_FES_STATUS_1K_BA					= 424 /* 0x1a8 */,
490 	HAL_TQM_ACKED_1K_MPDU					= 425 /* 0x1a9 */,
491 	HAL_MACRX_INBSS_OBSS_IND				= 426 /* 0x1aa */,
492 	HAL_PHYRX_LOCATION					= 427 /* 0x1ab */,
493 	HAL_MLO_TX_NOTIFICATION_SU				= 428 /* 0x1ac */,
494 	HAL_MLO_TX_NOTIFICATION_MU				= 429 /* 0x1ad */,
495 	HAL_MLO_TX_REQ_SU					= 430 /* 0x1ae */,
496 	HAL_MLO_TX_REQ_MU					= 431 /* 0x1af */,
497 	HAL_MLO_TX_RESP						= 432 /* 0x1b0 */,
498 	HAL_MLO_RX_NOTIFICATION					= 433 /* 0x1b1 */,
499 	HAL_MLO_BKOFF_TRUNC_REQ					= 434 /* 0x1b2 */,
500 	HAL_MLO_TBTT_NOTIFICATION				= 435 /* 0x1b3 */,
501 	HAL_MLO_MESSAGE						= 436 /* 0x1b4 */,
502 	HAL_MLO_TS_SYNC_MSG					= 437 /* 0x1b5 */,
503 	HAL_MLO_FES_SETUP					= 438 /* 0x1b6 */,
504 	HAL_MLO_PDG_FES_SETUP_SU				= 439 /* 0x1b7 */,
505 	HAL_MLO_PDG_FES_SETUP_MU				= 440 /* 0x1b8 */,
506 	HAL_MPDU_INFO_1K_BITMAP					= 441 /* 0x1b9 */,
507 	HAL_MON_BUF_ADDR					= 442 /* 0x1ba */,
508 	HAL_TX_FRAG_STATE					= 443 /* 0x1bb */,
509 	HAL_MACTXHT_SIG_USR_OFDMA				= 446 /* 0x1be */,
510 	HAL_PHYRXHT_SIG_CMN_PUNC				= 448 /* 0x1c0 */,
511 	HAL_PHYRXHT_SIG_CMN_OFDMA				= 450 /* 0x1c2 */,
512 	HAL_PHYRXHT_SIG_USR_OFDMA				= 454 /* 0x1c6 */,
513 	HAL_PHYRX_PKT_END_PART1					= 456 /* 0x1c8 */,
514 	HAL_MACTXXPECT_NDP_RECEPTION				= 457 /* 0x1c9 */,
515 	HAL_MACTX_SECURE_LTF_SEQ_PTR				= 458 /* 0x1ca */,
516 	HAL_MLO_PDG_BKOFF_TRUNC_NOTIFY				= 460 /* 0x1cc */,
517 	HAL_PHYRX_11AZ_INTEGRITY_DATA				= 461 /* 0x1cd */,
518 	HAL_PHYTX_LOCATION					= 462 /* 0x1ce */,
519 	HAL_PHYTX_11AZ_INTEGRITY_DATA				= 463 /* 0x1cf */,
520 	HAL_MACTXHT_SIG_USR_SU					= 466 /* 0x1d2 */,
521 	HAL_MACTXHT_SIG_USR_MU_MIMO				= 467 /* 0x1d3 */,
522 	HAL_PHYRXHT_SIG_USR_SU					= 468 /* 0x1d4 */,
523 	HAL_PHYRXHT_SIG_USR_MU_MIMO				= 469 /* 0x1d5 */,
524 	HAL_PHYRX_GENERIC_U_SIG					= 470 /* 0x1d6 */,
525 	HAL_PHYRX_GENERIC_EHT_SIG				= 471 /* 0x1d7 */,
526 	HAL_OVERWRITE_RESP_START				= 472 /* 0x1d8 */,
527 	HAL_OVERWRITE_RESP_PREAMBLE_INFO			= 473 /* 0x1d9 */,
528 	HAL_OVERWRITE_RESP_FRAME_INFO				= 474 /* 0x1da */,
529 	HAL_OVERWRITE_RESP_END					= 475 /* 0x1db */,
530 	HAL_RXPCUARLY_RX_INDICATION				= 476 /* 0x1dc */,
531 	HAL_MON_DROP						= 477 /* 0x1dd */,
532 	HAL_MACRX_MU_UPLINK_COMMON_SNIFF			= 478 /* 0x1de */,
533 	HAL_MACRX_MU_UPLINK_USER_SETUP_SNIFF			= 479 /* 0x1df */,
534 	HAL_MACRX_MU_UPLINK_USER_SEL_SNIFF			= 480 /* 0x1e0 */,
535 	HAL_MACRX_MU_UPLINK_FCS_STATUS_SNIFF			= 481 /* 0x1e1 */,
536 	HAL_MACTX_PREFETCH_CV_DMA				= 482 /* 0x1e2 */,
537 	HAL_MACTX_PREFETCH_CV_PER_USER				= 483 /* 0x1e3 */,
538 	HAL_PHYRX_OTHER_RECEIVE_INFO_ALL_SIGB_DETAILS		= 484 /* 0x1e4 */,
539 	HAL_MACTX_BF_PARAMS_UPDATE_COMMON			= 485 /* 0x1e5 */,
540 	HAL_MACTX_BF_PARAMS_UPDATE_PER_USER			= 486 /* 0x1e6 */,
541 	HAL_RANGING_USER_DETAILS				= 487 /* 0x1e7 */,
542 	HAL_PHYTX_CV_CORR_STATUS				= 488 /* 0x1e8 */,
543 	HAL_PHYTX_CV_CORR_COMMON				= 489 /* 0x1e9 */,
544 	HAL_PHYTX_CV_CORR_USER					= 490 /* 0x1ea */,
545 	HAL_MACTX_CV_CORR_COMMON				= 491 /* 0x1eb */,
546 	HAL_MACTX_CV_CORR_MAC_INFO_GROUP			= 492 /* 0x1ec */,
547 	HAL_BW_PUNCTUREVAL_WRAPPER				= 493 /* 0x1ed */,
548 	HAL_MACTX_RX_NOTIFICATION_FOR_PHY			= 494 /* 0x1ee */,
549 	HAL_MACTX_TX_NOTIFICATION_FOR_PHY			= 495 /* 0x1ef */,
550 	HAL_MACTX_MU_UPLINK_COMMON_PER_BW			= 496 /* 0x1f0 */,
551 	HAL_MACTX_MU_UPLINK_USER_SETUP_PER_BW			= 497 /* 0x1f1 */,
552 	HAL_RX_PPDU_END_USER_STATS_EXT2				= 498 /* 0x1f2 */,
553 	HAL_FW2SW_MON						= 499 /* 0x1f3 */,
554 	HAL_WSI_DIRECT_MESSAGE					= 500 /* 0x1f4 */,
555 	HAL_MACTXMLSR_PRE_SWITCH				= 501 /* 0x1f5 */,
556 	HAL_MACTXMLSR_SWITCH					= 502 /* 0x1f6 */,
557 	HAL_MACTXMLSR_SWITCH_BACK				= 503 /* 0x1f7 */,
558 	HAL_PHYTXMLSR_SWITCH_ACK				= 504 /* 0x1f8 */,
559 	HAL_PHYTXMLSR_SWITCH_BACK_ACK				= 505 /* 0x1f9 */,
560 	HAL_SPARE_REUSE_TAG_0					= 506 /* 0x1fa */,
561 	HAL_SPARE_REUSE_TAG_1					= 507 /* 0x1fb */,
562 	HAL_SPARE_REUSE_TAG_2					= 508 /* 0x1fc */,
563 	HAL_SPARE_REUSE_TAG_3					= 509 /* 0x1fd */,
564 	/* FIXME: Assign correct value for HAL_TCL_DATA_CMD */
565 	HAL_TCL_DATA_CMD					= 510,
566 	HAL_TLV_BASE						= 511 /* 0x1ff */,
567 };
568 
569 #define HAL_TLV_HDR_TAG		GENMASK(9, 1)
570 #define HAL_TLV_HDR_LEN		GENMASK(25, 10)
571 #define HAL_TLV_USR_ID          GENMASK(31, 26)
572 
573 #define HAL_TLV_ALIGN	4
574 
575 struct hal_tlv_hdr {
576 	__le32 tl;
577 	u8 value[];
578 } __packed;
579 
580 #define HAL_TLV_64_HDR_TAG		GENMASK(9, 1)
581 #define HAL_TLV_64_HDR_LEN		GENMASK(21, 10)
582 #define HAL_TLV_64_USR_ID		GENMASK(31, 26)
583 #define HAL_TLV_64_ALIGN		8
584 
585 struct hal_tlv_64_hdr {
586 	__le64 tl;
587 	u8 value[];
588 } __packed;
589 
590 #define RX_MPDU_DESC_INFO0_MSDU_COUNT		GENMASK(7, 0)
591 #define RX_MPDU_DESC_INFO0_FRAG_FLAG		BIT(8)
592 #define RX_MPDU_DESC_INFO0_MPDU_RETRY		BIT(9)
593 #define RX_MPDU_DESC_INFO0_AMPDU_FLAG		BIT(10)
594 #define RX_MPDU_DESC_INFO0_BAR_FRAME		BIT(11)
595 #define RX_MPDU_DESC_INFO0_VALID_PN		BIT(12)
596 #define RX_MPDU_DESC_INFO0_RAW_MPDU		BIT(13)
597 #define RX_MPDU_DESC_INFO0_MORE_FRAG_FLAG	BIT(14)
598 #define RX_MPDU_DESC_INFO0_SRC_INFO		GENMASK(26, 15)
599 #define RX_MPDU_DESC_INFO0_MPDU_QOS_CTRL_VALID	BIT(27)
600 #define RX_MPDU_DESC_INFO0_TID			GENMASK(31, 28)
601 
602 /* Peer Metadata classification */
603 
604 /* Version 0 */
605 #define RX_MPDU_DESC_META_DATA_V0_PEER_ID	GENMASK(15, 0)
606 #define RX_MPDU_DESC_META_DATA_V0_VDEV_ID	GENMASK(23, 16)
607 
608 /* Version 1 */
609 #define RX_MPDU_DESC_META_DATA_V1_PEER_ID		GENMASK(13, 0)
610 #define RX_MPDU_DESC_META_DATA_V1_LOGICAL_LINK_ID	GENMASK(15, 14)
611 #define RX_MPDU_DESC_META_DATA_V1_VDEV_ID		GENMASK(23, 16)
612 #define RX_MPDU_DESC_META_DATA_V1_LMAC_ID		GENMASK(25, 24)
613 #define RX_MPDU_DESC_META_DATA_V1_DEVICE_ID		GENMASK(28, 26)
614 
615 /* Version 1A */
616 #define RX_MPDU_DESC_META_DATA_V1A_PEER_ID		GENMASK(13, 0)
617 #define RX_MPDU_DESC_META_DATA_V1A_VDEV_ID		GENMASK(21, 14)
618 #define RX_MPDU_DESC_META_DATA_V1A_LOGICAL_LINK_ID	GENMASK(25, 22)
619 #define RX_MPDU_DESC_META_DATA_V1A_DEVICE_ID		GENMASK(28, 26)
620 
621 /* Version 1B */
622 #define RX_MPDU_DESC_META_DATA_V1B_PEER_ID	GENMASK(13, 0)
623 #define RX_MPDU_DESC_META_DATA_V1B_VDEV_ID	GENMASK(21, 14)
624 #define RX_MPDU_DESC_META_DATA_V1B_HW_LINK_ID	GENMASK(25, 22)
625 #define RX_MPDU_DESC_META_DATA_V1B_DEVICE_ID	GENMASK(28, 26)
626 
627 struct rx_mpdu_desc {
628 	__le32 info0; /* %RX_MPDU_DESC_INFO */
629 	__le32 peer_meta_data;
630 } __packed;
631 
632 /* rx_mpdu_desc
633  *		Producer: RXDMA
634  *		Consumer: REO/SW/FW
635  *
636  * msdu_count
637  *		The number of MSDUs within the MPDU
638  *
639  * fragment_flag
640  *		When set, this MPDU is a fragment and REO should forward this
641  *		fragment MPDU to the REO destination ring without any reorder
642  *		checks, pn checks or bitmap update. This implies that REO is
643  *		forwarding the pointer to the MSDU link descriptor.
644  *
645  * mpdu_retry_bit
646  *		The retry bit setting from the MPDU header of the received frame
647  *
648  * ampdu_flag
649  *		Indicates the MPDU was received as part of an A-MPDU.
650  *
651  * bar_frame
652  *		Indicates the received frame is a BAR frame. After processing,
653  *		this frame shall be pushed to SW or deleted.
654  *
655  * valid_pn
656  *		When not set, REO will not perform a PN sequence number check.
657  *
658  * raw_mpdu
659  *		Field only valid when first_msdu_in_mpdu_flag is set. Indicates
660  *		the contents in the MSDU buffer contains a 'RAW' MPDU. This
661  *		'RAW' MPDU might be spread out over multiple MSDU buffers.
662  *
663  * more_fragment_flag
664  *		The More Fragment bit setting from the MPDU header of the
665  *		received frame
666  *
667  * src_info
668  *		Source (Virtual) device/interface info associated with this peer.
669  *		This field gets passed on by REO to PPE in the EDMA descriptor.
670  *
671  * mpdu_qos_control_valid
672  *		When set, the MPDU has a QoS control field
673  *
674  * tid
675  *		Field only valid when mpdu_qos_control_valid is set
676  */
677 
678 enum hal_rx_msdu_desc_reo_dest_ind {
679 	HAL_RX_MSDU_DESC_REO_DEST_IND_TCL,
680 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW1,
681 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW2,
682 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW3,
683 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW4,
684 	HAL_RX_MSDU_DESC_REO_DEST_IND_RELEASE,
685 	HAL_RX_MSDU_DESC_REO_DEST_IND_FW,
686 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW5,
687 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW6,
688 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW7,
689 	HAL_RX_MSDU_DESC_REO_DEST_IND_SW8,
690 };
691 
692 #define RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU	BIT(0)
693 #define RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU	BIT(1)
694 #define RX_MSDU_DESC_INFO0_MSDU_CONTINUATION	BIT(2)
695 #define RX_MSDU_DESC_INFO0_MSDU_LENGTH		GENMASK(16, 3)
696 #define RX_MSDU_DESC_INFO0_MSDU_DROP		BIT(17)
697 #define RX_MSDU_DESC_INFO0_VALID_SA		BIT(18)
698 #define RX_MSDU_DESC_INFO0_VALID_DA		BIT(19)
699 #define RX_MSDU_DESC_INFO0_DA_MCBC		BIT(20)
700 #define RX_MSDU_DESC_INFO0_L3_HDR_PAD_MSB	BIT(21)
701 #define RX_MSDU_DESC_INFO0_TCP_UDP_CHKSUM_FAIL	BIT(22)
702 #define RX_MSDU_DESC_INFO0_IP_CHKSUM_FAIL	BIT(23)
703 #define RX_MSDU_DESC_INFO0_FROM_DS		BIT(24)
704 #define RX_MSDU_DESC_INFO0_TO_DS		BIT(25)
705 #define RX_MSDU_DESC_INFO0_INTRA_BSS		BIT(26)
706 #define RX_MSDU_DESC_INFO0_DST_CHIP_ID		GENMASK(28, 27)
707 #define RX_MSDU_DESC_INFO0_DECAP_FORMAT		GENMASK(30, 29)
708 
709 #define HAL_RX_MSDU_PKT_LENGTH_GET(val)		\
710 	(u32_get_bits((val), RX_MSDU_DESC_INFO0_MSDU_LENGTH))
711 
712 struct rx_msdu_desc {
713 	__le32 info0;
714 } __packed;
715 
716 /* rx_msdu_desc
717  *
718  * first_msdu_in_mpdu
719  *		Indicates first msdu in mpdu.
720  *
721  * last_msdu_in_mpdu
722  *		Indicates last msdu in mpdu. This flag can be true only when
723  *		'Msdu_continuation' set to 0. This implies that when an msdu
724  *		is spread out over multiple buffers and thus msdu_continuation
725  *		is set, only for the very last buffer of the msdu, can the
726  *		'last_msdu_in_mpdu' be set.
727  *
728  *		When both first_msdu_in_mpdu and last_msdu_in_mpdu are set,
729  *		the MPDU that this MSDU belongs to only contains a single MSDU.
730  *
731  * msdu_continuation
732  *		When set, this MSDU buffer was not able to hold the entire MSDU.
733  *		The next buffer will therefore contain additional information
734  *		related to this MSDU.
735  *
736  * msdu_length
737  *		Field is only valid in combination with the 'first_msdu_in_mpdu'
738  *		being set. Full MSDU length in bytes after decapsulation. This
739  *		field is still valid for MPDU frames without A-MSDU. It still
740  *		represents MSDU length after decapsulation Or in case of RAW
741  *		MPDUs, it indicates the length of the entire MPDU (without FCS
742  *		field).
743  *
744  * msdu_drop
745  *		Indicates that REO shall drop this MSDU and not forward it to
746  *		any other ring.
747  *
748  * valid_sa
749  *		Indicates OLE found a valid SA entry for this MSDU.
750  *
751  * valid_da
752  *		When set, OLE found a valid DA entry for this MSDU.
753  *
754  * da_mcbc
755  *		Field Only valid if valid_da is set. Indicates the DA address
756  *		is a Multicast or Broadcast address for this MSDU.
757  *
758  * l3_header_padding_msb
759  *		Passed on from 'RX_MSDU_END' TLV (only the MSB is reported as
760  *		the LSB is always zero). Number of bytes padded to make sure
761  *		that the L3 header will always start of a Dword boundary
762  *
763  * tcp_udp_checksum_fail
764  *		Passed on from 'RX_ATTENTION' TLV
765  *		Indicates that the computed checksum did not match the checksum
766  *		in the TCP/UDP header.
767  *
768  * ip_checksum_fail
769  *		Passed on from 'RX_ATTENTION' TLV
770  *		Indicates that the computed checksum did not match the checksum
771  *		in the IP header.
772  *
773  * from_DS
774  *		Set if the 'from DS' bit is set in the frame control.
775  *
776  * to_DS
777  *		Set if the 'to DS' bit is set in the frame control.
778  *
779  * intra_bss
780  *		This packet needs intra-BSS routing by SW as the 'vdev_id'
781  *		for the destination is the same as the 'vdev_id' that this
782  *		MSDU was got in.
783  *
784  * dest_chip_id
785  *		If intra_bss is set, copied by RXOLE/RXDMA from 'ADDR_SEARCH_ENTRY'
786  *		to support intra-BSS routing with multi-chip multi-link operation.
787  *		This indicates into which chip's TCL the packet should be queued.
788  *
789  * decap_format
790  *		Indicates the format after decapsulation:
791  */
792 
793 #define RX_MSDU_EXT_DESC_INFO0_REO_DEST_IND	GENMASK(4, 0)
794 #define RX_MSDU_EXT_DESC_INFO0_SERVICE_CODE	GENMASK(13, 5)
795 #define RX_MSDU_EXT_DESC_INFO0_PRIORITY_VALID	BIT(14)
796 #define RX_MSDU_EXT_DESC_INFO0_DATA_OFFSET	GENMASK(26, 15)
797 #define RX_MSDU_EXT_DESC_INFO0_SRC_LINK_ID	GENMASK(29, 27)
798 
799 struct rx_msdu_ext_desc {
800 	__le32 info0;
801 } __packed;
802 
803 /* rx_msdu_ext_desc
804  *
805  * reo_destination_indication
806  *		The ID of the REO exit ring where the MSDU frame shall push
807  *		after (MPDU level) reordering has finished.
808  *
809  * service_code
810  *		Opaque service code between PPE and Wi-Fi
811  *
812  * priority_valid
813  *
814  * data_offset
815  *		The offset to Rx packet data within the buffer (including
816  *		Rx DMA offset programming and L3 header padding inserted
817  *		by Rx OLE).
818  *
819  * src_link_id
820  *		Set to the link ID of the PMAC that received the frame
821  */
822 
823 enum hal_reo_dest_ring_buffer_type {
824 	HAL_REO_DEST_RING_BUFFER_TYPE_MSDU,
825 	HAL_REO_DEST_RING_BUFFER_TYPE_LINK_DESC,
826 };
827 
828 enum hal_reo_dest_ring_push_reason {
829 	HAL_REO_DEST_RING_PUSH_REASON_ERR_DETECTED,
830 	HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION,
831 };
832 
833 enum hal_reo_dest_ring_error_code {
834 	HAL_REO_DEST_RING_ERROR_CODE_DESC_ADDR_ZERO,
835 	HAL_REO_DEST_RING_ERROR_CODE_DESC_INVALID,
836 	HAL_REO_DEST_RING_ERROR_CODE_AMPDU_IN_NON_BA,
837 	HAL_REO_DEST_RING_ERROR_CODE_NON_BA_DUPLICATE,
838 	HAL_REO_DEST_RING_ERROR_CODE_BA_DUPLICATE,
839 	HAL_REO_DEST_RING_ERROR_CODE_FRAME_2K_JUMP,
840 	HAL_REO_DEST_RING_ERROR_CODE_BAR_2K_JUMP,
841 	HAL_REO_DEST_RING_ERROR_CODE_FRAME_OOR,
842 	HAL_REO_DEST_RING_ERROR_CODE_BAR_OOR,
843 	HAL_REO_DEST_RING_ERROR_CODE_NO_BA_SESSION,
844 	HAL_REO_DEST_RING_ERROR_CODE_FRAME_SN_EQUALS_SSN,
845 	HAL_REO_DEST_RING_ERROR_CODE_PN_CHECK_FAILED,
846 	HAL_REO_DEST_RING_ERROR_CODE_2K_ERR_FLAG_SET,
847 	HAL_REO_DEST_RING_ERROR_CODE_PN_ERR_FLAG_SET,
848 	HAL_REO_DEST_RING_ERROR_CODE_DESC_BLOCKED,
849 	HAL_REO_DEST_RING_ERROR_CODE_MAX,
850 };
851 
852 #define HAL_REO_DEST_RING_INFO0_BUFFER_TYPE		BIT(0)
853 #define HAL_REO_DEST_RING_INFO0_PUSH_REASON		GENMASK(2, 1)
854 #define HAL_REO_DEST_RING_INFO0_ERROR_CODE		GENMASK(7, 3)
855 #define HAL_REO_DEST_RING_INFO0_MSDU_DATA_SIZE		GENMASK(11, 8)
856 #define HAL_REO_DEST_RING_INFO0_SW_EXCEPTION		BIT(12)
857 #define HAL_REO_DEST_RING_INFO0_SRC_LINK_ID		GENMASK(15, 13)
858 #define HAL_REO_DEST_RING_INFO0_SIGNATURE		GENMASK(19, 16)
859 #define HAL_REO_DEST_RING_INFO0_RING_ID			GENMASK(27, 20)
860 #define HAL_REO_DEST_RING_INFO0_LOOPING_COUNT		GENMASK(31, 28)
861 
862 struct hal_reo_dest_ring {
863 	struct ath12k_buffer_addr buf_addr_info;
864 	struct rx_mpdu_desc rx_mpdu_info;
865 	struct rx_msdu_desc rx_msdu_info;
866 	__le32 buf_va_lo;
867 	__le32 buf_va_hi;
868 	__le32 info0; /* %HAL_REO_DEST_RING_INFO0_ */
869 } __packed;
870 
871 /* hal_reo_dest_ring
872  *
873  *		Producer: RXDMA
874  *		Consumer: REO/SW/FW
875  *
876  * buf_addr_info
877  *		Details of the physical address of a buffer or MSDU
878  *		link descriptor.
879  *
880  * rx_mpdu_info
881  *		General information related to the MPDU that is passed
882  *		on from REO entrance ring to the REO destination ring.
883  *
884  * rx_msdu_info
885  *		General information related to the MSDU that is passed
886  *		on from RXDMA all the way to the REO destination ring.
887  *
888  * buf_va_lo
889  *		Field only valid if Reo_dest_buffer_type is set to MSDU_buf_address
890  *		Lower 32 bits of the 64-bit virtual address corresponding
891  *		to Buf_or_link_desc_addr_info
892  *
893  * buf_va_hi
894  *		Address (upper 32 bits) of the REO queue descriptor.
895  *		Upper 32 bits of the 64-bit virtual address corresponding
896  *		to Buf_or_link_desc_addr_info
897  *
898  * buffer_type
899  *		Indicates the type of address provided in the buf_addr_info.
900  *		Values are defined in enum %HAL_REO_DEST_RING_BUFFER_TYPE_.
901  *
902  * push_reason
903  *		Reason for pushing this frame to this exit ring. Values are
904  *		defined in enum %HAL_REO_DEST_RING_PUSH_REASON_.
905  *
906  * error_code
907  *		Valid only when 'push_reason' is set. All error codes are
908  *		defined in enum %HAL_REO_DEST_RING_ERROR_CODE_.
909  *
910  * captured_msdu_data_size
911  *		The number of following REO_DESTINATION STRUCTs that have
912  *		been replaced with msdu_data extracted from the msdu_buffer
913  *		and copied into the ring for easy FW/SW access.
914  *
915  * sw_exception
916  *		This field has the same setting as the SW_exception field
917  *		in the corresponding REO_entrance_ring descriptor.
918  *		When set, the REO entrance descriptor is generated by FW,
919  *		and the MPDU was processed in the following way:
920  *		- NO re-order function is needed.
921  *		- MPDU delinking is determined by the setting of Entrance
922  *		  ring field: SW_excection_mpdu_delink
923  *		- Destination ring selection is based on the setting of
924  *		  the Entrance ring field SW_exception_destination _ring_valid
925  *
926  * src_link_id
927  *		Set to the link ID of the PMAC that received the frame
928  *
929  * signature
930  *		Set to value 0x8 when msdu capture mode is enabled for this ring
931  *
932  * ring_id
933  *		The buffer pointer ring id.
934  *		0 - Idle ring
935  *		1 - N refers to other rings.
936  *
937  * looping_count
938  *		Indicates the number of times the producer of entries into
939  *		this ring has looped around the ring.
940  */
941 
942 #define HAL_REO_TO_PPE_RING_INFO0_DATA_LENGTH	GENMASK(15, 0)
943 #define HAL_REO_TO_PPE_RING_INFO0_DATA_OFFSET	GENMASK(23, 16)
944 #define HAL_REO_TO_PPE_RING_INFO0_POOL_ID	GENMASK(28, 24)
945 #define HAL_REO_TO_PPE_RING_INFO0_PREHEADER	BIT(29)
946 #define HAL_REO_TO_PPE_RING_INFO0_TSO_EN	BIT(30)
947 #define HAL_REO_TO_PPE_RING_INFO0_MORE	BIT(31)
948 
949 struct hal_reo_to_ppe_ring {
950 	__le32 buffer_addr;
951 	__le32 info0; /* %HAL_REO_TO_PPE_RING_INFO0_ */
952 } __packed;
953 
954 /* hal_reo_to_ppe_ring
955  *
956  *		Producer: REO
957  *		Consumer: PPE
958  *
959  * buf_addr_info
960  *		Details of the physical address of a buffer or MSDU
961  *		link descriptor.
962  *
963  * data_length
964  *		Length of valid data in bytes
965  *
966  * data_offset
967  *		Offset to the data from buffer pointer. Can be used to
968  *		strip header in the data for tunnel termination etc.
969  *
970  * pool_id
971  *		REO has global configuration register for this field.
972  *		It may have several free buffer pools, each
973  *		RX-Descriptor ring can fetch free buffer from specific
974  *		buffer pool; pool id will indicate which pool the buffer
975  *		will be released to; POOL_ID Zero returned to SW
976  *
977  * preheader
978  *		Disabled: 0 (Default)
979  *		Enabled: 1
980  *
981  * tso_en
982  *		Disabled: 0 (Default)
983  *		Enabled: 1
984  *
985  * more
986  *		More Segments followed
987  */
988 
989 enum hal_reo_entr_rxdma_push_reason {
990 	HAL_REO_ENTR_RING_RXDMA_PUSH_REASON_ERR_DETECTED,
991 	HAL_REO_ENTR_RING_RXDMA_PUSH_REASON_ROUTING_INSTRUCTION,
992 	HAL_REO_ENTR_RING_RXDMA_PUSH_REASON_RX_FLUSH,
993 };
994 
995 enum hal_reo_entr_rxdma_ecode {
996 	HAL_REO_ENTR_RING_RXDMA_ECODE_OVERFLOW_ERR,
997 	HAL_REO_ENTR_RING_RXDMA_ECODE_MPDU_LEN_ERR,
998 	HAL_REO_ENTR_RING_RXDMA_ECODE_FCS_ERR,
999 	HAL_REO_ENTR_RING_RXDMA_ECODE_DECRYPT_ERR,
1000 	HAL_REO_ENTR_RING_RXDMA_ECODE_TKIP_MIC_ERR,
1001 	HAL_REO_ENTR_RING_RXDMA_ECODE_UNECRYPTED_ERR,
1002 	HAL_REO_ENTR_RING_RXDMA_ECODE_MSDU_LEN_ERR,
1003 	HAL_REO_ENTR_RING_RXDMA_ECODE_MSDU_LIMIT_ERR,
1004 	HAL_REO_ENTR_RING_RXDMA_ECODE_WIFI_PARSE_ERR,
1005 	HAL_REO_ENTR_RING_RXDMA_ECODE_AMSDU_PARSE_ERR,
1006 	HAL_REO_ENTR_RING_RXDMA_ECODE_SA_TIMEOUT_ERR,
1007 	HAL_REO_ENTR_RING_RXDMA_ECODE_DA_TIMEOUT_ERR,
1008 	HAL_REO_ENTR_RING_RXDMA_ECODE_FLOW_TIMEOUT_ERR,
1009 	HAL_REO_ENTR_RING_RXDMA_ECODE_FLUSH_REQUEST_ERR,
1010 	HAL_REO_ENTR_RING_RXDMA_ECODE_AMSDU_FRAG_ERR,
1011 	HAL_REO_ENTR_RING_RXDMA_ECODE_MAX,
1012 };
1013 
1014 enum hal_rx_reo_dest_ring {
1015 	HAL_RX_REO_DEST_RING_TCL,
1016 	HAL_RX_REO_DEST_RING_SW1,
1017 	HAL_RX_REO_DEST_RING_SW2,
1018 	HAL_RX_REO_DEST_RING_SW3,
1019 	HAL_RX_REO_DEST_RING_SW4,
1020 	HAL_RX_REO_DEST_RING_RELEASE,
1021 	HAL_RX_REO_DEST_RING_FW,
1022 	HAL_RX_REO_DEST_RING_SW5,
1023 	HAL_RX_REO_DEST_RING_SW6,
1024 	HAL_RX_REO_DEST_RING_SW7,
1025 	HAL_RX_REO_DEST_RING_SW8,
1026 };
1027 
1028 #define HAL_REO_ENTR_RING_INFO0_QUEUE_ADDR_HI		GENMASK(7, 0)
1029 #define HAL_REO_ENTR_RING_INFO0_MPDU_BYTE_COUNT		GENMASK(21, 8)
1030 #define HAL_REO_ENTR_RING_INFO0_DEST_IND		GENMASK(26, 22)
1031 #define HAL_REO_ENTR_RING_INFO0_FRAMELESS_BAR		BIT(27)
1032 
1033 #define HAL_REO_ENTR_RING_INFO1_RXDMA_PUSH_REASON	GENMASK(1, 0)
1034 #define HAL_REO_ENTR_RING_INFO1_RXDMA_ERROR_CODE	GENMASK(6, 2)
1035 #define HAL_REO_ENTR_RING_INFO1_MPDU_FRAG_NUM		GENMASK(10, 7)
1036 #define HAL_REO_ENTR_RING_INFO1_SW_EXCEPTION		BIT(11)
1037 #define HAL_REO_ENTR_RING_INFO1_SW_EXCEPT_MPDU_DELINK	BIT(12)
1038 #define HAL_REO_ENTR_RING_INFO1_SW_EXCEPTION_RING_VLD	BIT(13)
1039 #define HAL_REO_ENTR_RING_INFO1_SW_EXCEPTION_RING	GENMASK(18, 14)
1040 #define HAL_REO_ENTR_RING_INFO1_MPDU_SEQ_NUM		GENMASK(30, 19)
1041 
1042 #define HAL_REO_ENTR_RING_INFO2_PHY_PPDU_ID		GENMASK(15, 0)
1043 #define HAL_REO_ENTR_RING_INFO2_SRC_LINK_ID		GENMASK(18, 16)
1044 #define HAL_REO_ENTR_RING_INFO2_RING_ID			GENMASK(27, 20)
1045 #define HAL_REO_ENTR_RING_INFO2_LOOPING_COUNT		GENMASK(31, 28)
1046 
1047 struct hal_reo_entrance_ring {
1048 	struct ath12k_buffer_addr buf_addr_info;
1049 	struct rx_mpdu_desc rx_mpdu_info;
1050 	__le32 queue_addr_lo;
1051 	__le32 info0; /* %HAL_REO_ENTR_RING_INFO0_ */
1052 	__le32 info1; /* %HAL_REO_ENTR_RING_INFO1_ */
1053 	__le32 info2; /* %HAL_REO_DEST_RING_INFO2_ */
1054 
1055 } __packed;
1056 
1057 /* hal_reo_entrance_ring
1058  *
1059  *		Producer: RXDMA
1060  *		Consumer: REO
1061  *
1062  * buf_addr_info
1063  *		Details of the physical address of a buffer or MSDU
1064  *		link descriptor.
1065  *
1066  * rx_mpdu_info
1067  *		General information related to the MPDU that is passed
1068  *		on from REO entrance ring to the REO destination ring.
1069  *
1070  * queue_addr_lo
1071  *		Address (lower 32 bits) of the REO queue descriptor.
1072  *
1073  * queue_addr_hi
1074  *		Address (upper 8 bits) of the REO queue descriptor.
1075  *
1076  * mpdu_byte_count
1077  *		An approximation of the number of bytes received in this MPDU.
1078  *		Used to keeps stats on the amount of data flowing
1079  *		through a queue.
1080  *
1081  * reo_destination_indication
1082  *		The id of the reo exit ring where the msdu frame shall push
1083  *		after (MPDU level) reordering has finished. Values are defined
1084  *		in enum %HAL_RX_MSDU_DESC_REO_DEST_IND_.
1085  *
1086  * frameless_bar
1087  *		Indicates that this REO entrance ring struct contains BAR info
1088  *		from a multi TID BAR frame. The original multi TID BAR frame
1089  *		itself contained all the REO info for the first TID, but all
1090  *		the subsequent TID info and their linkage to the REO descriptors
1091  *		is passed down as 'frameless' BAR info.
1092  *
1093  *		The only fields valid in this descriptor when this bit is set
1094  *		are queue_addr_lo, queue_addr_hi, mpdu_sequence_number,
1095  *		bar_frame and peer_meta_data.
1096  *
1097  * rxdma_push_reason
1098  *		Reason for pushing this frame to this exit ring. Values are
1099  *		defined in enum %HAL_REO_ENTR_RING_RXDMA_PUSH_REASON_.
1100  *
1101  * rxdma_error_code
1102  *		Valid only when 'push_reason' is set. All error codes are
1103  *		defined in enum %HAL_REO_ENTR_RING_RXDMA_ECODE_.
1104  *
1105  * mpdu_fragment_number
1106  *		Field only valid when Reo_level_mpdu_frame_info.
1107  *		Rx_mpdu_desc_info_details.Fragment_flag is set.
1108  *
1109  * sw_exception
1110  *		When not set, REO is performing all its default MPDU processing
1111  *		operations,
1112  *		When set, this REO entrance descriptor is generated by FW, and
1113  *		should be processed as an exception. This implies:
1114  *		NO re-order function is needed.
1115  *		MPDU delinking is determined by the setting of field
1116  *		SW_excection_mpdu_delink
1117  *
1118  * sw_exception_mpdu_delink
1119  *		Field only valid when SW_exception is set.
1120  *		1'b0: REO should NOT delink the MPDU, and thus pass this
1121  *			MPDU on to the destination ring as is. This implies that
1122  *			in the REO_DESTINATION_RING struct field
1123  *			Buf_or_link_desc_addr_info should point to an MSDU link
1124  *			descriptor
1125  *		1'b1: REO should perform the normal MPDU delink into MSDU operations.
1126  *
1127  * sw_exception_dest_ring
1128  *		Field only valid when fields SW_exception and SW
1129  *		exception_destination_ring_valid are set. values are defined
1130  *		in %HAL_RX_REO_DEST_RING_.
1131  *
1132  * mpdu_seq_number
1133  *		The field can have two different meanings based on the setting
1134  *		of sub-field Reo level mpdu frame info.
1135  *		Rx_mpdu_desc_info_details. BAR_frame
1136  *		'BAR_frame' is NOT set:
1137  *		The MPDU sequence number of the received frame.
1138  *		'BAR_frame' is set.
1139  *		The MPDU Start sequence number from the BAR frame
1140  *
1141  * phy_ppdu_id
1142  *		A PPDU counter value that PHY increments for every PPDU received
1143  *
1144  * src_link_id
1145  *		Set to the link ID of the PMAC that received the frame
1146  *
1147  * ring_id
1148  *		The buffer pointer ring id.
1149  *		0 - Idle ring
1150  *		1 - N refers to other rings.
1151  *
1152  * looping_count
1153  *		Indicates the number of times the producer of entries into
1154  *		this ring has looped around the ring.
1155  */
1156 
1157 #define HAL_REO_CMD_HDR_INFO0_CMD_NUMBER	GENMASK(15, 0)
1158 #define HAL_REO_CMD_HDR_INFO0_STATUS_REQUIRED	BIT(16)
1159 
1160 struct hal_reo_cmd_hdr {
1161 	__le32 info0;
1162 } __packed;
1163 
1164 #define HAL_REO_GET_QUEUE_STATS_INFO0_QUEUE_ADDR_HI	GENMASK(7, 0)
1165 #define HAL_REO_GET_QUEUE_STATS_INFO0_CLEAR_STATS	BIT(8)
1166 
1167 struct hal_reo_get_queue_stats {
1168 	struct hal_reo_cmd_hdr cmd;
1169 	__le32 queue_addr_lo;
1170 	__le32 info0;
1171 	__le32 rsvd0[6];
1172 	__le32 tlv64_pad;
1173 } __packed;
1174 
1175 /* hal_reo_get_queue_stats
1176  *		Producer: SW
1177  *		Consumer: REO
1178  *
1179  * cmd
1180  *		Details for command execution tracking purposes.
1181  *
1182  * queue_addr_lo
1183  *		Address (lower 32 bits) of the REO queue descriptor.
1184  *
1185  * queue_addr_hi
1186  *		Address (upper 8 bits) of the REO queue descriptor.
1187  *
1188  * clear_stats
1189  *		Clear stats settings. When set, Clear the stats after
1190  *		generating the status.
1191  *
1192  *		Following stats will be cleared.
1193  *		Timeout_count
1194  *		Forward_due_to_bar_count
1195  *		Duplicate_count
1196  *		Frames_in_order_count
1197  *		BAR_received_count
1198  *		MPDU_Frames_processed_count
1199  *		MSDU_Frames_processed_count
1200  *		Total_processed_byte_count
1201  *		Late_receive_MPDU_count
1202  *		window_jump_2k
1203  *		Hole_count
1204  */
1205 
1206 #define HAL_REO_FLUSH_QUEUE_INFO0_DESC_ADDR_HI		GENMASK(7, 0)
1207 #define HAL_REO_FLUSH_QUEUE_INFO0_BLOCK_DESC_ADDR	BIT(8)
1208 #define HAL_REO_FLUSH_QUEUE_INFO0_BLOCK_RESRC_IDX	GENMASK(10, 9)
1209 
1210 struct hal_reo_flush_queue {
1211 	struct hal_reo_cmd_hdr cmd;
1212 	__le32 desc_addr_lo;
1213 	__le32 info0;
1214 	__le32 rsvd0[6];
1215 } __packed;
1216 
1217 #define HAL_REO_FLUSH_CACHE_INFO0_CACHE_ADDR_HI		GENMASK(7, 0)
1218 #define HAL_REO_FLUSH_CACHE_INFO0_FWD_ALL_MPDUS		BIT(8)
1219 #define HAL_REO_FLUSH_CACHE_INFO0_RELEASE_BLOCK_IDX	BIT(9)
1220 #define HAL_REO_FLUSH_CACHE_INFO0_BLOCK_RESRC_IDX	GENMASK(11, 10)
1221 #define HAL_REO_FLUSH_CACHE_INFO0_FLUSH_WO_INVALIDATE	BIT(12)
1222 #define HAL_REO_FLUSH_CACHE_INFO0_BLOCK_CACHE_USAGE	BIT(13)
1223 #define HAL_REO_FLUSH_CACHE_INFO0_FLUSH_ALL		BIT(14)
1224 
1225 struct hal_reo_flush_cache {
1226 	struct hal_reo_cmd_hdr cmd;
1227 	__le32 cache_addr_lo;
1228 	__le32 info0;
1229 	__le32 rsvd0[6];
1230 } __packed;
1231 
1232 #define HAL_TCL_DATA_CMD_INFO0_CMD_TYPE			BIT(0)
1233 #define HAL_TCL_DATA_CMD_INFO0_DESC_TYPE		BIT(1)
1234 #define HAL_TCL_DATA_CMD_INFO0_BANK_ID			GENMASK(7, 2)
1235 #define HAL_TCL_DATA_CMD_INFO0_TX_NOTIFY_FRAME		GENMASK(10, 8)
1236 #define HAL_TCL_DATA_CMD_INFO0_HDR_LEN_READ_SEL		BIT(11)
1237 #define HAL_TCL_DATA_CMD_INFO0_BUF_TIMESTAMP		GENMASK(30, 12)
1238 #define HAL_TCL_DATA_CMD_INFO0_BUF_TIMESTAMP_VLD	BIT(31)
1239 
1240 #define HAL_TCL_DATA_CMD_INFO1_CMD_NUM		GENMASK(31, 16)
1241 
1242 #define HAL_TCL_DATA_CMD_INFO2_DATA_LEN		GENMASK(15, 0)
1243 #define HAL_TCL_DATA_CMD_INFO2_IP4_CKSUM_EN	BIT(16)
1244 #define HAL_TCL_DATA_CMD_INFO2_UDP4_CKSUM_EN	BIT(17)
1245 #define HAL_TCL_DATA_CMD_INFO2_UDP6_CKSUM_EN	BIT(18)
1246 #define HAL_TCL_DATA_CMD_INFO2_TCP4_CKSUM_EN	BIT(19)
1247 #define HAL_TCL_DATA_CMD_INFO2_TCP6_CKSUM_EN	BIT(20)
1248 #define HAL_TCL_DATA_CMD_INFO2_TO_FW		BIT(21)
1249 #define HAL_TCL_DATA_CMD_INFO2_PKT_OFFSET	GENMASK(31, 23)
1250 
1251 #define HAL_TCL_DATA_CMD_INFO3_TID_OVERWRITE		BIT(0)
1252 #define HAL_TCL_DATA_CMD_INFO3_FLOW_OVERRIDE_EN		BIT(1)
1253 #define HAL_TCL_DATA_CMD_INFO3_CLASSIFY_INFO_SEL	GENMASK(3, 2)
1254 #define HAL_TCL_DATA_CMD_INFO3_TID			GENMASK(7, 4)
1255 #define HAL_TCL_DATA_CMD_INFO3_FLOW_OVERRIDE		BIT(8)
1256 #define HAL_TCL_DATA_CMD_INFO3_PMAC_ID			GENMASK(10, 9)
1257 #define HAL_TCL_DATA_CMD_INFO3_MSDU_COLOR		GENMASK(12, 11)
1258 #define HAL_TCL_DATA_CMD_INFO3_VDEV_ID			GENMASK(31, 24)
1259 
1260 #define HAL_TCL_DATA_CMD_INFO4_SEARCH_INDEX		GENMASK(19, 0)
1261 #define HAL_TCL_DATA_CMD_INFO4_CACHE_SET_NUM		GENMASK(23, 20)
1262 #define HAL_TCL_DATA_CMD_INFO4_IDX_LOOKUP_OVERRIDE	BIT(24)
1263 
1264 #define HAL_TCL_DATA_CMD_INFO5_RING_ID			GENMASK(27, 20)
1265 #define HAL_TCL_DATA_CMD_INFO5_LOOPING_COUNT		GENMASK(31, 28)
1266 
1267 enum hal_encrypt_type {
1268 	HAL_ENCRYPT_TYPE_WEP_40,
1269 	HAL_ENCRYPT_TYPE_WEP_104,
1270 	HAL_ENCRYPT_TYPE_TKIP_NO_MIC,
1271 	HAL_ENCRYPT_TYPE_WEP_128,
1272 	HAL_ENCRYPT_TYPE_TKIP_MIC,
1273 	HAL_ENCRYPT_TYPE_WAPI,
1274 	HAL_ENCRYPT_TYPE_CCMP_128,
1275 	HAL_ENCRYPT_TYPE_OPEN,
1276 	HAL_ENCRYPT_TYPE_CCMP_256,
1277 	HAL_ENCRYPT_TYPE_GCMP_128,
1278 	HAL_ENCRYPT_TYPE_AES_GCMP_256,
1279 	HAL_ENCRYPT_TYPE_WAPI_GCM_SM4,
1280 };
1281 
1282 enum hal_tcl_encap_type {
1283 	HAL_TCL_ENCAP_TYPE_RAW,
1284 	HAL_TCL_ENCAP_TYPE_NATIVE_WIFI,
1285 	HAL_TCL_ENCAP_TYPE_ETHERNET,
1286 	HAL_TCL_ENCAP_TYPE_802_3 = 3,
1287 };
1288 
1289 enum hal_tcl_desc_type {
1290 	HAL_TCL_DESC_TYPE_BUFFER,
1291 	HAL_TCL_DESC_TYPE_EXT_DESC,
1292 };
1293 
1294 enum hal_wbm_htt_tx_comp_status {
1295 	HAL_WBM_REL_HTT_TX_COMP_STATUS_OK,
1296 	HAL_WBM_REL_HTT_TX_COMP_STATUS_DROP,
1297 	HAL_WBM_REL_HTT_TX_COMP_STATUS_TTL,
1298 	HAL_WBM_REL_HTT_TX_COMP_STATUS_REINJ,
1299 	HAL_WBM_REL_HTT_TX_COMP_STATUS_INSPECT,
1300 	HAL_WBM_REL_HTT_TX_COMP_STATUS_MEC_NOTIFY,
1301 	HAL_WBM_REL_HTT_TX_COMP_STATUS_MAX,
1302 };
1303 
1304 struct hal_tcl_data_cmd {
1305 	struct ath12k_buffer_addr buf_addr_info;
1306 	__le32 info0;
1307 	__le32 info1;
1308 	__le32 info2;
1309 	__le32 info3;
1310 	__le32 info4;
1311 	__le32 info5;
1312 } __packed;
1313 
1314 /* hal_tcl_data_cmd
1315  *
1316  * buf_addr_info
1317  *		Details of the physical address of a buffer or MSDU
1318  *		link descriptor.
1319  *
1320  * tcl_cmd_type
1321  *		used to select the type of TCL Command descriptor
1322  *
1323  * desc_type
1324  *		Indicates the type of address provided in the buf_addr_info.
1325  *		Values are defined in enum %HAL_REO_DEST_RING_BUFFER_TYPE_.
1326  *
1327  * bank_id
1328  *		used to select one of the TCL register banks for fields removed
1329  *		from 'TCL_DATA_CMD' that do not change often within one virtual
1330  *		device or a set of virtual devices:
1331  *
1332  * tx_notify_frame
1333  *		TCL copies this value to 'TQM_ENTRANCE_RING' field FW_tx_notify_frame.
1334  *
1335  * hdr_length_read_sel
1336  *		used to select the per 'encap_type' register set for MSDU header
1337  *		read length
1338  *
1339  * buffer_timestamp
1340  * buffer_timestamp_valid
1341  *		Frame system entrance timestamp. It shall be filled by first
1342  *		module (SW, TCL or TQM) that sees the frames first.
1343  *
1344  * cmd_num
1345  *		This number can be used to match against status.
1346  *
1347  * data_length
1348  *		MSDU length in case of direct descriptor. Length of link
1349  *		extension descriptor in case of Link extension descriptor.
1350  *
1351  * *_checksum_en
1352  *		Enable checksum replacement for ipv4, udp_over_ipv4, ipv6,
1353  *		udp_over_ipv6, tcp_over_ipv4 and tcp_over_ipv6.
1354  *
1355  * to_fw
1356  *		Forward packet to FW along with classification result. The
1357  *		packet will not be forward to TQM when this bit is set.
1358  *		1'b0: Use classification result to forward the packet.
1359  *		1'b1: Override classification result & forward packet only to fw
1360  *
1361  * packet_offset
1362  *		Packet offset from Metadata in case of direct buffer descriptor.
1363  *
1364  * hlos_tid_overwrite
1365  *
1366  *		When set, TCL shall ignore the IP DSCP and VLAN PCP
1367  *		fields and use HLOS_TID as the final TID. Otherwise TCL
1368  *		shall consider the DSCP and PCP fields as well as HLOS_TID
1369  *		and choose a final TID based on the configured priority
1370  *
1371  * flow_override_enable
1372  *		TCL uses this to select the flow pointer from the peer table,
1373  *		which can be overridden by SW for pre-encrypted raw WiFi packets
1374  *		that cannot be parsed for UDP or for other MLO
1375  *		0 - FP_PARSE_IP: Use the flow-pointer based on parsing the IPv4
1376  *				 or IPv6 header.
1377  *		1 - FP_USE_OVERRIDE: Use the who_classify_info_sel and
1378  *				     flow_override fields to select the flow-pointer
1379  *
1380  * who_classify_info_sel
1381  *		Field only valid when flow_override_enable is set to FP_USE_OVERRIDE.
1382  *		This field is used to select  one of the 'WHO_CLASSIFY_INFO's in the
1383  *		peer table in case more than 2 flows are mapped to a single TID.
1384  *		0: To choose Flow 0 and 1 of any TID use this value.
1385  *		1: To choose Flow 2 and 3 of any TID use this value.
1386  *		2: To choose Flow 4 and 5 of any TID use this value.
1387  *		3: To choose Flow 6 and 7 of any TID use this value.
1388  *
1389  *		If who_classify_info sel is not in sync with the num_tx_classify_info
1390  *		field from address search, then TCL will set 'who_classify_info_sel'
1391  *		to 0 use flows 0 and 1.
1392  *
1393  * hlos_tid
1394  *		HLOS MSDU priority
1395  *		Field is used when HLOS_TID_overwrite is set.
1396  *
1397  * flow_override
1398  *		Field only valid when flow_override_enable is set to FP_USE_OVERRIDE
1399  *		TCL uses this to select the flow pointer from the peer table,
1400  *		which can be overridden by SW for pre-encrypted raw WiFi packets
1401  *		that cannot be parsed for UDP or for other MLO
1402  *		0 - FP_USE_NON_UDP: Use the non-UDP flow pointer (flow 0)
1403  *		1 - FP_USE_UDP: Use the UDP flow pointer (flow 1)
1404  *
1405  * pmac_id
1406  *		TCL uses this PMAC_ID in address search, i.e, while
1407  *		finding matching entry for the packet in AST corresponding
1408  *		to given PMAC_ID
1409  *
1410  *		If PMAC ID is all 1s (=> value 3), it indicates wildcard
1411  *		match for any PMAC
1412  *
1413  * vdev_id
1414  *		Virtual device ID to check against the address search entry to
1415  *		avoid security issues from transmitting packets from an incorrect
1416  *		virtual device
1417  *
1418  * search_index
1419  *		The index that will be used for index based address or
1420  *		flow search. The field is valid when 'search_type' is  1 or 2.
1421  *
1422  * cache_set_num
1423  *
1424  *		Cache set number that should be used to cache the index
1425  *		based search results, for address and flow search. This
1426  *		value should be equal to LSB four bits of the hash value of
1427  *		match data, in case of search index points to an entry which
1428  *		may be used in content based search also. The value can be
1429  *		anything when the entry pointed by search index will not be
1430  *		used for content based search.
1431  *
1432  * index_loop_override
1433  *		When set, address search and packet routing is forced to use
1434  *		'search_index' instead of following the register configuration
1435  *		selected by Bank_id.
1436  *
1437  * ring_id
1438  *		The buffer pointer ring ID.
1439  *		0 refers to the IDLE ring
1440  *		1 - N refers to other rings
1441  *
1442  * looping_count
1443  *
1444  *		A count value that indicates the number of times the
1445  *		producer of entries into the Ring has looped around the
1446  *		ring.
1447  *
1448  *		At initialization time, this value is set to 0. On the
1449  *		first loop, this value is set to 1. After the max value is
1450  *		reached allowed by the number of bits for this field, the
1451  *		count value continues with 0 again.
1452  *
1453  *		In case SW is the consumer of the ring entries, it can
1454  *		use this field to figure out up to where the producer of
1455  *		entries has created new entries. This eliminates the need to
1456  *		check where the head pointer' of the ring is located once
1457  *		the SW starts processing an interrupt indicating that new
1458  *		entries have been put into this ring...
1459  *
1460  *		Also note that SW if it wants only needs to look at the
1461  *		LSB bit of this count value.
1462  */
1463 
1464 #define HAL_TCL_DESC_LEN sizeof(struct hal_tcl_data_cmd)
1465 
1466 #define HAL_TX_MSDU_EXT_INFO0_BUF_PTR_LO	GENMASK(31, 0)
1467 
1468 #define HAL_TX_MSDU_EXT_INFO1_BUF_PTR_HI	GENMASK(7, 0)
1469 #define HAL_TX_MSDU_EXT_INFO1_EXTN_OVERRIDE	BIT(8)
1470 #define HAL_TX_MSDU_EXT_INFO1_ENCAP_TYPE	GENMASK(10, 9)
1471 #define HAL_TX_MSDU_EXT_INFO1_ENCRYPT_TYPE	GENMASK(14, 11)
1472 #define HAL_TX_MSDU_EXT_INFO1_BUF_LEN		GENMASK(31, 16)
1473 
1474 struct hal_tx_msdu_ext_desc {
1475 	__le32 rsvd0[6];
1476 	__le32 info0;
1477 	__le32 info1;
1478 	__le32 rsvd1[10];
1479 };
1480 
1481 struct hal_tcl_gse_cmd {
1482 	__le32 ctrl_buf_addr_lo;
1483 	__le32 info0;
1484 	__le32 meta_data[2];
1485 	__le32 rsvd0[2];
1486 	__le32 info1;
1487 } __packed;
1488 
1489 /* hal_tcl_gse_cmd
1490  *
1491  * ctrl_buf_addr_lo, ctrl_buf_addr_hi
1492  *		Address of a control buffer containing additional info needed
1493  *		for this command execution.
1494  *
1495  * meta_data
1496  *		Meta data to be returned in the status descriptor
1497  */
1498 
1499 enum hal_tcl_cache_op_res {
1500 	HAL_TCL_CACHE_OP_RES_DONE,
1501 	HAL_TCL_CACHE_OP_RES_NOT_FOUND,
1502 	HAL_TCL_CACHE_OP_RES_TIMEOUT,
1503 };
1504 
1505 struct hal_tcl_status_ring {
1506 	__le32 info0;
1507 	__le32 msdu_byte_count;
1508 	__le32 msdu_timestamp;
1509 	__le32 meta_data[2];
1510 	__le32 info1;
1511 	__le32 rsvd0;
1512 	__le32 info2;
1513 } __packed;
1514 
1515 /* hal_tcl_status_ring
1516  *
1517  * msdu_cnt
1518  * msdu_byte_count
1519  *		MSDU count of Entry and MSDU byte count for entry 1.
1520  *
1521  */
1522 
1523 #define HAL_CE_SRC_DESC_ADDR_INFO_ADDR_HI	GENMASK(7, 0)
1524 #define HAL_CE_SRC_DESC_ADDR_INFO_HASH_EN	BIT(8)
1525 #define HAL_CE_SRC_DESC_ADDR_INFO_BYTE_SWAP	BIT(9)
1526 #define HAL_CE_SRC_DESC_ADDR_INFO_DEST_SWAP	BIT(10)
1527 #define HAL_CE_SRC_DESC_ADDR_INFO_GATHER	BIT(11)
1528 #define HAL_CE_SRC_DESC_ADDR_INFO_LEN		GENMASK(31, 16)
1529 
1530 #define HAL_CE_SRC_DESC_META_INFO_DATA		GENMASK(15, 0)
1531 
1532 #define HAL_CE_SRC_DESC_FLAGS_RING_ID		GENMASK(27, 20)
1533 #define HAL_CE_SRC_DESC_FLAGS_LOOP_CNT		HAL_SRNG_DESC_LOOP_CNT
1534 
1535 struct hal_ce_srng_src_desc {
1536 	__le32 buffer_addr_low;
1537 	__le32 buffer_addr_info; /* %HAL_CE_SRC_DESC_ADDR_INFO_ */
1538 	__le32 meta_info; /* %HAL_CE_SRC_DESC_META_INFO_ */
1539 	__le32 flags; /* %HAL_CE_SRC_DESC_FLAGS_ */
1540 } __packed;
1541 
1542 /* hal_ce_srng_src_desc
1543  *
1544  * buffer_addr_lo
1545  *		LSB 32 bits of the 40 Bit Pointer to the source buffer
1546  *
1547  * buffer_addr_hi
1548  *		MSB 8 bits of the 40 Bit Pointer to the source buffer
1549  *
1550  * toeplitz_en
1551  *		Enable generation of 32-bit Toeplitz-LFSR hash for
1552  *		data transfer. In case of gather field in first source
1553  *		ring entry of the gather copy cycle in taken into account.
1554  *
1555  * src_swap
1556  *		Treats source memory organization as big-endian. For
1557  *		each dword read (4 bytes), the byte 0 is swapped with byte 3
1558  *		and byte 1 is swapped with byte 2.
1559  *		In case of gather field in first source ring entry of
1560  *		the gather copy cycle in taken into account.
1561  *
1562  * dest_swap
1563  *		Treats destination memory organization as big-endian.
1564  *		For each dword write (4 bytes), the byte 0 is swapped with
1565  *		byte 3 and byte 1 is swapped with byte 2.
1566  *		In case of gather field in first source ring entry of
1567  *		the gather copy cycle in taken into account.
1568  *
1569  * gather
1570  *		Enables gather of multiple copy engine source
1571  *		descriptors to one destination.
1572  *
1573  * ce_res_0
1574  *		Reserved
1575  *
1576  *
1577  * length
1578  *		Length of the buffer in units of octets of the current
1579  *		descriptor
1580  *
1581  * fw_metadata
1582  *		Meta data used by FW.
1583  *		In case of gather field in first source ring entry of
1584  *		the gather copy cycle in taken into account.
1585  *
1586  * ce_res_1
1587  *		Reserved
1588  *
1589  * ce_res_2
1590  *		Reserved
1591  *
1592  * ring_id
1593  *		The buffer pointer ring ID.
1594  *		0 refers to the IDLE ring
1595  *		1 - N refers to other rings
1596  *		Helps with debugging when dumping ring contents.
1597  *
1598  * looping_count
1599  *		A count value that indicates the number of times the
1600  *		producer of entries into the Ring has looped around the
1601  *		ring.
1602  *
1603  *		At initialization time, this value is set to 0. On the
1604  *		first loop, this value is set to 1. After the max value is
1605  *		reached allowed by the number of bits for this field, the
1606  *		count value continues with 0 again.
1607  *
1608  *		In case SW is the consumer of the ring entries, it can
1609  *		use this field to figure out up to where the producer of
1610  *		entries has created new entries. This eliminates the need to
1611  *		check where the head pointer' of the ring is located once
1612  *		the SW starts processing an interrupt indicating that new
1613  *		entries have been put into this ring...
1614  *
1615  *		Also note that SW if it wants only needs to look at the
1616  *		LSB bit of this count value.
1617  */
1618 
1619 #define HAL_CE_DEST_DESC_ADDR_INFO_ADDR_HI		GENMASK(7, 0)
1620 #define HAL_CE_DEST_DESC_ADDR_INFO_RING_ID		GENMASK(27, 20)
1621 #define HAL_CE_DEST_DESC_ADDR_INFO_LOOP_CNT		HAL_SRNG_DESC_LOOP_CNT
1622 
1623 struct hal_ce_srng_dest_desc {
1624 	__le32 buffer_addr_low;
1625 	__le32 buffer_addr_info; /* %HAL_CE_DEST_DESC_ADDR_INFO_ */
1626 } __packed;
1627 
1628 /* hal_ce_srng_dest_desc
1629  *
1630  * dst_buffer_low
1631  *		LSB 32 bits of the 40 Bit Pointer to the Destination
1632  *		buffer
1633  *
1634  * dst_buffer_high
1635  *		MSB 8 bits of the 40 Bit Pointer to the Destination
1636  *		buffer
1637  *
1638  * ce_res_4
1639  *		Reserved
1640  *
1641  * ring_id
1642  *		The buffer pointer ring ID.
1643  *		0 refers to the IDLE ring
1644  *		1 - N refers to other rings
1645  *		Helps with debugging when dumping ring contents.
1646  *
1647  * looping_count
1648  *		A count value that indicates the number of times the
1649  *		producer of entries into the Ring has looped around the
1650  *		ring.
1651  *
1652  *		At initialization time, this value is set to 0. On the
1653  *		first loop, this value is set to 1. After the max value is
1654  *		reached allowed by the number of bits for this field, the
1655  *		count value continues with 0 again.
1656  *
1657  *		In case SW is the consumer of the ring entries, it can
1658  *		use this field to figure out up to where the producer of
1659  *		entries has created new entries. This eliminates the need to
1660  *		check where the head pointer' of the ring is located once
1661  *		the SW starts processing an interrupt indicating that new
1662  *		entries have been put into this ring...
1663  *
1664  *		Also note that SW if it wants only needs to look at the
1665  *		LSB bit of this count value.
1666  */
1667 
1668 #define HAL_CE_DST_STATUS_DESC_FLAGS_HASH_EN		BIT(8)
1669 #define HAL_CE_DST_STATUS_DESC_FLAGS_BYTE_SWAP		BIT(9)
1670 #define HAL_CE_DST_STATUS_DESC_FLAGS_DEST_SWAP		BIT(10)
1671 #define HAL_CE_DST_STATUS_DESC_FLAGS_GATHER		BIT(11)
1672 #define HAL_CE_DST_STATUS_DESC_FLAGS_LEN		GENMASK(31, 16)
1673 
1674 #define HAL_CE_DST_STATUS_DESC_META_INFO_DATA		GENMASK(15, 0)
1675 #define HAL_CE_DST_STATUS_DESC_META_INFO_RING_ID	GENMASK(27, 20)
1676 #define HAL_CE_DST_STATUS_DESC_META_INFO_LOOP_CNT	HAL_SRNG_DESC_LOOP_CNT
1677 
1678 struct hal_ce_srng_dst_status_desc {
1679 	__le32 flags; /* %HAL_CE_DST_STATUS_DESC_FLAGS_ */
1680 	__le32 toeplitz_hash0;
1681 	__le32 toeplitz_hash1;
1682 	__le32 meta_info; /* HAL_CE_DST_STATUS_DESC_META_INFO_ */
1683 } __packed;
1684 
1685 /* hal_ce_srng_dst_status_desc
1686  *
1687  * ce_res_5
1688  *		Reserved
1689  *
1690  * toeplitz_en
1691  *
1692  * src_swap
1693  *		Source memory buffer swapped
1694  *
1695  * dest_swap
1696  *		Destination  memory buffer swapped
1697  *
1698  * gather
1699  *		Gather of multiple copy engine source descriptors to one
1700  *		destination enabled
1701  *
1702  * ce_res_6
1703  *		Reserved
1704  *
1705  * length
1706  *		Sum of all the Lengths of the source descriptor in the
1707  *		gather chain
1708  *
1709  * toeplitz_hash_0
1710  *		32 LS bits of 64 bit Toeplitz LFSR hash result
1711  *
1712  * toeplitz_hash_1
1713  *		32 MS bits of 64 bit Toeplitz LFSR hash result
1714  *
1715  * fw_metadata
1716  *		Meta data used by FW
1717  *		In case of gather field in first source ring entry of
1718  *		the gather copy cycle in taken into account.
1719  *
1720  * ce_res_7
1721  *		Reserved
1722  *
1723  * ring_id
1724  *		The buffer pointer ring ID.
1725  *		0 refers to the IDLE ring
1726  *		1 - N refers to other rings
1727  *		Helps with debugging when dumping ring contents.
1728  *
1729  * looping_count
1730  *		A count value that indicates the number of times the
1731  *		producer of entries into the Ring has looped around the
1732  *		ring.
1733  *
1734  *		At initialization time, this value is set to 0. On the
1735  *		first loop, this value is set to 1. After the max value is
1736  *		reached allowed by the number of bits for this field, the
1737  *		count value continues with 0 again.
1738  *
1739  *		In case SW is the consumer of the ring entries, it can
1740  *		use this field to figure out up to where the producer of
1741  *		entries has created new entries. This eliminates the need to
1742  *		check where the head pointer' of the ring is located once
1743  *		the SW starts processing an interrupt indicating that new
1744  *		entries have been put into this ring...
1745  *
1746  *		Also note that SW if it wants only needs to look at the
1747  *			LSB bit of this count value.
1748  */
1749 
1750 #define HAL_TX_RATE_STATS_INFO0_VALID		BIT(0)
1751 #define HAL_TX_RATE_STATS_INFO0_BW		GENMASK(3, 1)
1752 #define HAL_TX_RATE_STATS_INFO0_PKT_TYPE	GENMASK(7, 4)
1753 #define HAL_TX_RATE_STATS_INFO0_STBC		BIT(8)
1754 #define HAL_TX_RATE_STATS_INFO0_LDPC		BIT(9)
1755 #define HAL_TX_RATE_STATS_INFO0_SGI		GENMASK(11, 10)
1756 #define HAL_TX_RATE_STATS_INFO0_MCS		GENMASK(15, 12)
1757 #define HAL_TX_RATE_STATS_INFO0_OFDMA_TX	BIT(16)
1758 #define HAL_TX_RATE_STATS_INFO0_TONES_IN_RU	GENMASK(28, 17)
1759 
1760 enum hal_tx_rate_stats_bw {
1761 	HAL_TX_RATE_STATS_BW_20,
1762 	HAL_TX_RATE_STATS_BW_40,
1763 	HAL_TX_RATE_STATS_BW_80,
1764 	HAL_TX_RATE_STATS_BW_160,
1765 };
1766 
1767 enum hal_tx_rate_stats_pkt_type {
1768 	HAL_TX_RATE_STATS_PKT_TYPE_11A,
1769 	HAL_TX_RATE_STATS_PKT_TYPE_11B,
1770 	HAL_TX_RATE_STATS_PKT_TYPE_11N,
1771 	HAL_TX_RATE_STATS_PKT_TYPE_11AC,
1772 	HAL_TX_RATE_STATS_PKT_TYPE_11AX,
1773 	HAL_TX_RATE_STATS_PKT_TYPE_11BA,
1774 	HAL_TX_RATE_STATS_PKT_TYPE_11BE,
1775 };
1776 
1777 enum hal_tx_rate_stats_sgi {
1778 	HAL_TX_RATE_STATS_SGI_08US,
1779 	HAL_TX_RATE_STATS_SGI_04US,
1780 	HAL_TX_RATE_STATS_SGI_16US,
1781 	HAL_TX_RATE_STATS_SGI_32US,
1782 };
1783 
1784 struct hal_tx_rate_stats {
1785 	__le32 info0;
1786 	__le32 tsf;
1787 } __packed;
1788 
1789 struct hal_wbm_link_desc {
1790 	struct ath12k_buffer_addr buf_addr_info;
1791 } __packed;
1792 
1793 /* hal_wbm_link_desc
1794  *
1795  *	Producer: WBM
1796  *	Consumer: WBM
1797  *
1798  * buf_addr_info
1799  *		Details of the physical address of a buffer or MSDU
1800  *		link descriptor.
1801  */
1802 
1803 enum hal_wbm_rel_src_module {
1804 	HAL_WBM_REL_SRC_MODULE_TQM,
1805 	HAL_WBM_REL_SRC_MODULE_RXDMA,
1806 	HAL_WBM_REL_SRC_MODULE_REO,
1807 	HAL_WBM_REL_SRC_MODULE_FW,
1808 	HAL_WBM_REL_SRC_MODULE_SW,
1809 };
1810 
1811 enum hal_wbm_rel_desc_type {
1812 	HAL_WBM_REL_DESC_TYPE_REL_MSDU,
1813 	HAL_WBM_REL_DESC_TYPE_MSDU_LINK,
1814 	HAL_WBM_REL_DESC_TYPE_MPDU_LINK,
1815 	HAL_WBM_REL_DESC_TYPE_MSDU_EXT,
1816 	HAL_WBM_REL_DESC_TYPE_QUEUE_EXT,
1817 };
1818 
1819 /* hal_wbm_rel_desc_type
1820  *
1821  * msdu_buffer
1822  *	The address points to an MSDU buffer
1823  *
1824  * msdu_link_descriptor
1825  *	The address points to an Tx MSDU link descriptor
1826  *
1827  * mpdu_link_descriptor
1828  *	The address points to an MPDU link descriptor
1829  *
1830  * msdu_ext_descriptor
1831  *	The address points to an MSDU extension descriptor
1832  *
1833  * queue_ext_descriptor
1834  *	The address points to an TQM queue extension descriptor. WBM should
1835  *	treat this is the same way as a link descriptor.
1836  */
1837 
1838 enum hal_wbm_rel_bm_act {
1839 	HAL_WBM_REL_BM_ACT_PUT_IN_IDLE,
1840 	HAL_WBM_REL_BM_ACT_REL_MSDU,
1841 };
1842 
1843 /* hal_wbm_rel_bm_act
1844  *
1845  * put_in_idle_list
1846  *	Put the buffer or descriptor back in the idle list. In case of MSDU or
1847  *	MDPU link descriptor, BM does not need to check to release any
1848  *	individual MSDU buffers.
1849  *
1850  * release_msdu_list
1851  *	This BM action can only be used in combination with desc_type being
1852  *	msdu_link_descriptor. Field first_msdu_index points out which MSDU
1853  *	pointer in the MSDU link descriptor is the first of an MPDU that is
1854  *	released. BM shall release all the MSDU buffers linked to this first
1855  *	MSDU buffer pointer. All related MSDU buffer pointer entries shall be
1856  *	set to value 0, which represents the 'NULL' pointer. When all MSDU
1857  *	buffer pointers in the MSDU link descriptor are 'NULL', the MSDU link
1858  *	descriptor itself shall also be released.
1859  */
1860 #define HAL_WBM_COMPL_RX_INFO0_REL_SRC_MODULE		GENMASK(2, 0)
1861 #define HAL_WBM_COMPL_RX_INFO0_BM_ACTION		GENMASK(5, 3)
1862 #define HAL_WBM_COMPL_RX_INFO0_DESC_TYPE		GENMASK(8, 6)
1863 #define HAL_WBM_COMPL_RX_INFO0_RBM			GENMASK(12, 9)
1864 #define HAL_WBM_COMPL_RX_INFO0_RXDMA_PUSH_REASON	GENMASK(18, 17)
1865 #define HAL_WBM_COMPL_RX_INFO0_RXDMA_ERROR_CODE		GENMASK(23, 19)
1866 #define HAL_WBM_COMPL_RX_INFO0_REO_PUSH_REASON		GENMASK(25, 24)
1867 #define HAL_WBM_COMPL_RX_INFO0_REO_ERROR_CODE		GENMASK(30, 26)
1868 #define HAL_WBM_COMPL_RX_INFO0_WBM_INTERNAL_ERROR	BIT(31)
1869 
1870 #define HAL_WBM_COMPL_RX_INFO1_PHY_ADDR_HI		GENMASK(7, 0)
1871 #define HAL_WBM_COMPL_RX_INFO1_SW_COOKIE		GENMASK(27, 8)
1872 #define HAL_WBM_COMPL_RX_INFO1_LOOPING_COUNT		GENMASK(31, 28)
1873 
1874 struct hal_wbm_completion_ring_rx {
1875 	__le32 addr_lo;
1876 	__le32 addr_hi;
1877 	__le32 info0;
1878 	struct rx_mpdu_desc rx_mpdu_info;
1879 	struct rx_msdu_desc rx_msdu_info;
1880 	__le32 phy_addr_lo;
1881 	__le32 info1;
1882 } __packed;
1883 
1884 #define HAL_WBM_COMPL_TX_INFO0_REL_SRC_MODULE		GENMASK(2, 0)
1885 #define HAL_WBM_COMPL_TX_INFO0_DESC_TYPE		GENMASK(8, 6)
1886 #define HAL_WBM_COMPL_TX_INFO0_RBM			GENMASK(12, 9)
1887 #define HAL_WBM_COMPL_TX_INFO0_TQM_RELEASE_REASON	GENMASK(16, 13)
1888 #define HAL_WBM_COMPL_TX_INFO0_RBM_OVERRIDE_VLD		BIT(17)
1889 #define HAL_WBM_COMPL_TX_INFO0_SW_COOKIE_LO		GENMASK(29, 18)
1890 #define HAL_WBM_COMPL_TX_INFO0_CC_DONE			BIT(30)
1891 #define HAL_WBM_COMPL_TX_INFO0_WBM_INTERNAL_ERROR	BIT(31)
1892 
1893 #define HAL_WBM_COMPL_TX_INFO1_TQM_STATUS_NUMBER	GENMASK(23, 0)
1894 #define HAL_WBM_COMPL_TX_INFO1_TRANSMIT_COUNT		GENMASK(30, 24)
1895 #define HAL_WBM_COMPL_TX_INFO1_SW_REL_DETAILS_VALID	BIT(31)
1896 
1897 #define HAL_WBM_COMPL_TX_INFO2_ACK_FRAME_RSSI		GENMASK(7, 0)
1898 #define HAL_WBM_COMPL_TX_INFO2_FIRST_MSDU		BIT(8)
1899 #define HAL_WBM_COMPL_TX_INFO2_LAST_MSDU		BIT(9)
1900 #define HAL_WBM_COMPL_TX_INFO2_FW_TX_NOTIF_FRAME	GENMASK(12, 10)
1901 #define HAL_WBM_COMPL_TX_INFO2_BUFFER_TIMESTAMP		GENMASK(31, 13)
1902 
1903 #define HAL_WBM_COMPL_TX_INFO3_PEER_ID			GENMASK(15, 0)
1904 #define HAL_WBM_COMPL_TX_INFO3_TID			GENMASK(19, 16)
1905 #define HAL_WBM_COMPL_TX_INFO3_SW_COOKIE_HI		GENMASK(27, 20)
1906 #define HAL_WBM_COMPL_TX_INFO3_LOOPING_COUNT		GENMASK(31, 28)
1907 
1908 struct hal_wbm_completion_ring_tx {
1909 	__le32 buf_va_lo;
1910 	__le32 buf_va_hi;
1911 	__le32 info0;
1912 	__le32 info1;
1913 	__le32 info2;
1914 	struct hal_tx_rate_stats rate_stats;
1915 	__le32 info3;
1916 } __packed;
1917 
1918 #define HAL_WBM_RELEASE_TX_INFO0_REL_SRC_MODULE		GENMASK(2, 0)
1919 #define HAL_WBM_RELEASE_TX_INFO0_BM_ACTION		GENMASK(5, 3)
1920 #define HAL_WBM_RELEASE_TX_INFO0_DESC_TYPE		GENMASK(8, 6)
1921 #define HAL_WBM_RELEASE_TX_INFO0_FIRST_MSDU_IDX		GENMASK(12, 9)
1922 #define HAL_WBM_RELEASE_TX_INFO0_TQM_RELEASE_REASON	GENMASK(18, 13)
1923 #define HAL_WBM_RELEASE_TX_INFO0_RBM_OVERRIDE_VLD	BIT(17)
1924 #define HAL_WBM_RELEASE_TX_INFO0_SW_BUFFER_COOKIE_11_0	GENMASK(29, 18)
1925 #define HAL_WBM_RELEASE_TX_INFO0_WBM_INTERNAL_ERROR	BIT(31)
1926 
1927 #define HAL_WBM_RELEASE_TX_INFO1_TQM_STATUS_NUMBER	GENMASK(23, 0)
1928 #define HAL_WBM_RELEASE_TX_INFO1_TRANSMIT_COUNT		GENMASK(30, 24)
1929 #define HAL_WBM_RELEASE_TX_INFO1_SW_REL_DETAILS_VALID	BIT(31)
1930 
1931 #define HAL_WBM_RELEASE_TX_INFO2_ACK_FRAME_RSSI		GENMASK(7, 0)
1932 #define HAL_WBM_RELEASE_TX_INFO2_FIRST_MSDU		BIT(8)
1933 #define HAL_WBM_RELEASE_TX_INFO2_LAST_MSDU		BIT(9)
1934 #define HAL_WBM_RELEASE_TX_INFO2_FW_TX_NOTIF_FRAME	GENMASK(12, 10)
1935 #define HAL_WBM_RELEASE_TX_INFO2_BUFFER_TIMESTAMP	GENMASK(31, 13)
1936 
1937 #define HAL_WBM_RELEASE_TX_INFO3_PEER_ID		GENMASK(15, 0)
1938 #define HAL_WBM_RELEASE_TX_INFO3_TID			GENMASK(19, 16)
1939 #define HAL_WBM_RELEASE_TX_INFO3_SW_BUFFER_COOKIE_19_12	GENMASK(27, 20)
1940 #define HAL_WBM_RELEASE_TX_INFO3_LOOPING_COUNT		GENMASK(31, 28)
1941 
1942 struct hal_wbm_release_ring_tx {
1943 	struct ath12k_buffer_addr buf_addr_info;
1944 	__le32 info0;
1945 	__le32 info1;
1946 	__le32 info2;
1947 	struct hal_tx_rate_stats rate_stats;
1948 	__le32 info3;
1949 } __packed;
1950 
1951 #define HAL_WBM_RELEASE_RX_INFO0_REL_SRC_MODULE		GENMASK(2, 0)
1952 #define HAL_WBM_RELEASE_RX_INFO0_BM_ACTION		GENMASK(5, 3)
1953 #define HAL_WBM_RELEASE_RX_INFO0_DESC_TYPE		GENMASK(8, 6)
1954 #define HAL_WBM_RELEASE_RX_INFO0_FIRST_MSDU_IDX		GENMASK(12, 9)
1955 #define HAL_WBM_RELEASE_RX_INFO0_CC_STATUS		BIT(16)
1956 #define HAL_WBM_RELEASE_RX_INFO0_RXDMA_PUSH_REASON	GENMASK(18, 17)
1957 #define HAL_WBM_RELEASE_RX_INFO0_RXDMA_ERROR_CODE	GENMASK(23, 19)
1958 #define HAL_WBM_RELEASE_RX_INFO0_REO_PUSH_REASON	GENMASK(25, 24)
1959 #define HAL_WBM_RELEASE_RX_INFO0_REO_ERROR_CODE		GENMASK(30, 26)
1960 #define HAL_WBM_RELEASE_RX_INFO0_WBM_INTERNAL_ERROR	BIT(31)
1961 
1962 #define HAL_WBM_RELEASE_RX_INFO2_RING_ID		GENMASK(27, 20)
1963 #define HAL_WBM_RELEASE_RX_INFO2_LOOPING_COUNT		GENMASK(31, 28)
1964 
1965 struct hal_wbm_release_ring_rx {
1966 	struct ath12k_buffer_addr buf_addr_info;
1967 	__le32 info0;
1968 	struct rx_mpdu_desc rx_mpdu_info;
1969 	struct rx_msdu_desc rx_msdu_info;
1970 	__le32 info1;
1971 	__le32 info2;
1972 } __packed;
1973 
1974 #define HAL_WBM_RELEASE_RX_CC_INFO0_RBM			GENMASK(12, 9)
1975 #define HAL_WBM_RELEASE_RX_CC_INFO1_COOKIE		GENMASK(27, 8)
1976 /* Used when hw cc is success */
1977 struct hal_wbm_release_ring_cc_rx {
1978 	__le32 buf_va_lo;
1979 	__le32 buf_va_hi;
1980 	__le32 info0;
1981 	struct rx_mpdu_desc rx_mpdu_info;
1982 	struct rx_msdu_desc rx_msdu_info;
1983 	__le32 buf_pa_lo;
1984 	__le32 info1;
1985 } __packed;
1986 
1987 #define HAL_WBM_RELEASE_INFO0_REL_SRC_MODULE		GENMASK(2, 0)
1988 #define HAL_WBM_RELEASE_INFO0_BM_ACTION			GENMASK(5, 3)
1989 #define HAL_WBM_RELEASE_INFO0_DESC_TYPE			GENMASK(8, 6)
1990 #define HAL_WBM_RELEASE_INFO0_RXDMA_PUSH_REASON		GENMASK(18, 17)
1991 #define HAL_WBM_RELEASE_INFO0_RXDMA_ERROR_CODE		GENMASK(23, 19)
1992 #define HAL_WBM_RELEASE_INFO0_REO_PUSH_REASON		GENMASK(25, 24)
1993 #define HAL_WBM_RELEASE_INFO0_REO_ERROR_CODE		GENMASK(30, 26)
1994 #define HAL_WBM_RELEASE_INFO0_WBM_INTERNAL_ERROR	BIT(31)
1995 
1996 #define HAL_WBM_RELEASE_INFO3_FIRST_MSDU		BIT(0)
1997 #define HAL_WBM_RELEASE_INFO3_LAST_MSDU			BIT(1)
1998 #define HAL_WBM_RELEASE_INFO3_CONTINUATION		BIT(2)
1999 
2000 #define HAL_WBM_RELEASE_INFO5_LOOPING_COUNT		GENMASK(31, 28)
2001 
2002 struct hal_wbm_release_ring {
2003 	struct ath12k_buffer_addr buf_addr_info;
2004 	__le32 info0;
2005 	__le32 info1;
2006 	__le32 info2;
2007 	__le32 info3;
2008 	__le32 info4;
2009 	__le32 info5;
2010 } __packed;
2011 
2012 /* hal_wbm_release_ring
2013  *
2014  *	Producer: SW/TQM/RXDMA/REO/SWITCH
2015  *	Consumer: WBM/SW/FW
2016  *
2017  * HTT tx status is overlaid on wbm_release ring on 4-byte words 2, 3, 4 and 5
2018  * for software based completions.
2019  *
2020  * buf_addr_info
2021  *	Details of the physical address of the buffer or link descriptor.
2022  *
2023  * release_source_module
2024  *	Indicates which module initiated the release of this buffer/descriptor.
2025  *	Values are defined in enum %HAL_WBM_REL_SRC_MODULE_.
2026  *
2027  * buffer_or_desc_type
2028  *	Field only valid when WBM is marked as the return_buffer_manager in
2029  *	the Released_Buffer_address_info. Indicates that type of buffer or
2030  *	descriptor is being released. Values are in enum %HAL_WBM_REL_DESC_TYPE.
2031  *
2032  * wbm_internal_error
2033  *	Is set when WBM got a buffer pointer but the action was to push it to
2034  *	the idle link descriptor ring or do link related activity OR
2035  *	Is set when WBM got a link buffer pointer but the action was to push it
2036  *	to the buffer descriptor ring.
2037  *
2038  * looping_count
2039  *	A count value that indicates the number of times the
2040  *	producer of entries into the Buffer Manager Ring has looped
2041  *	around the ring.
2042  *
2043  *	At initialization time, this value is set to 0. On the
2044  *	first loop, this value is set to 1. After the max value is
2045  *	reached allowed by the number of bits for this field, the
2046  *	count value continues with 0 again.
2047  *
2048  *	In case SW is the consumer of the ring entries, it can
2049  *	use this field to figure out up to where the producer of
2050  *	entries has created new entries. This eliminates the need to
2051  *	check where the head pointer' of the ring is located once
2052  *	the SW starts processing an interrupt indicating that new
2053  *	entries have been put into this ring...
2054  *
2055  *	Also note that SW if it wants only needs to look at the
2056  *	LSB bit of this count value.
2057  */
2058 
2059 /**
2060  * enum hal_wbm_tqm_rel_reason - TQM release reason code
2061  * @HAL_WBM_TQM_REL_REASON_FRAME_ACKED: ACK or BACK received for the frame
2062  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_MPDU: Command remove_mpdus initiated by SW
2063  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_TX: Command remove transmitted_mpdus
2064  *	initiated by sw.
2065  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_NOTX: Command remove untransmitted_mpdus
2066  *	initiated by sw.
2067  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_AGED_FRAMES: Command remove aged msdus or
2068  *	mpdus.
2069  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON1: Remove command initiated by
2070  *	fw with fw_reason1.
2071  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON2: Remove command initiated by
2072  *	fw with fw_reason2.
2073  * @HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON3: Remove command initiated by
2074  *	fw with fw_reason3.
2075  * @HAL_WBM_TQM_REL_REASON_CMD_DISABLE_QUEUE: Remove command initiated by
2076  *	fw with disable queue.
2077  * @HAL_WBM_TQM_REL_REASON_CMD_TILL_NONMATCHING: Remove command initiated by
2078  *	fw to remove all mpdu until 1st non-match.
2079  * @HAL_WBM_TQM_REL_REASON_DROP_THRESHOLD: Dropped due to drop threshold
2080  *	criteria
2081  * @HAL_WBM_TQM_REL_REASON_DROP_LINK_DESC_UNAVAIL: Dropped due to link desc
2082  *	not available
2083  * @HAL_WBM_TQM_REL_REASON_DROP_OR_INVALID_MSDU: Dropped due drop bit set or
2084  *	null flow
2085  * @HAL_WBM_TQM_REL_REASON_MULTICAST_DROP: Dropped due mcast drop set for VDEV
2086  * @HAL_WBM_TQM_REL_REASON_VDEV_MISMATCH_DROP: Dropped due to being set with
2087  *	'TCL_drop_reason'
2088  */
2089 enum hal_wbm_tqm_rel_reason {
2090 	HAL_WBM_TQM_REL_REASON_FRAME_ACKED,
2091 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_MPDU,
2092 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_TX,
2093 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_NOTX,
2094 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_AGED_FRAMES,
2095 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON1,
2096 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON2,
2097 	HAL_WBM_TQM_REL_REASON_CMD_REMOVE_RESEAON3,
2098 	HAL_WBM_TQM_REL_REASON_CMD_DISABLE_QUEUE,
2099 	HAL_WBM_TQM_REL_REASON_CMD_TILL_NONMATCHING,
2100 	HAL_WBM_TQM_REL_REASON_DROP_THRESHOLD,
2101 	HAL_WBM_TQM_REL_REASON_DROP_LINK_DESC_UNAVAIL,
2102 	HAL_WBM_TQM_REL_REASON_DROP_OR_INVALID_MSDU,
2103 	HAL_WBM_TQM_REL_REASON_MULTICAST_DROP,
2104 	HAL_WBM_TQM_REL_REASON_VDEV_MISMATCH_DROP,
2105 };
2106 
2107 struct hal_wbm_buffer_ring {
2108 	struct ath12k_buffer_addr buf_addr_info;
2109 };
2110 
2111 enum hal_mon_end_reason {
2112 	HAL_MON_STATUS_BUFFER_FULL,
2113 	HAL_MON_FLUSH_DETECTED,
2114 	HAL_MON_END_OF_PPDU,
2115 	HAL_MON_PPDU_TRUNCATED,
2116 };
2117 
2118 #define HAL_SW_MONITOR_RING_INFO0_RXDMA_PUSH_REASON	GENMASK(1, 0)
2119 #define HAL_SW_MONITOR_RING_INFO0_RXDMA_ERROR_CODE	GENMASK(6, 2)
2120 #define HAL_SW_MONITOR_RING_INFO0_MPDU_FRAGMENT_NUMBER	GENMASK(10, 7)
2121 #define HAL_SW_MONITOR_RING_INFO0_FRAMELESS_BAR		BIT(11)
2122 #define HAL_SW_MONITOR_RING_INFO0_STATUS_BUF_COUNT	GENMASK(15, 12)
2123 #define HAL_SW_MONITOR_RING_INFO0_END_OF_PPDU		BIT(16)
2124 
2125 #define HAL_SW_MONITOR_RING_INFO1_PHY_PPDU_ID	GENMASK(15, 0)
2126 #define HAL_SW_MONITOR_RING_INFO1_RING_ID	GENMASK(27, 20)
2127 #define HAL_SW_MONITOR_RING_INFO1_LOOPING_COUNT	GENMASK(31, 28)
2128 
2129 struct hal_sw_monitor_ring {
2130 	struct ath12k_buffer_addr buf_addr_info;
2131 	struct rx_mpdu_desc rx_mpdu_info;
2132 	struct ath12k_buffer_addr status_buff_addr_info;
2133 	__le32 info0; /* %HAL_SW_MONITOR_RING_INFO0 */
2134 	__le32 info1; /* %HAL_SW_MONITOR_RING_INFO1 */
2135 } __packed;
2136 
2137 /* hal_sw_monitor_ring
2138  *
2139  *		Producer: RXDMA
2140  *		Consumer: REO/SW/FW
2141  * buf_addr_info
2142  *              Details of the physical address of a buffer or MSDU
2143  *              link descriptor.
2144  *
2145  * rx_mpdu_info
2146  *              Details related to the MPDU being pushed to SW, valid
2147  *              only if end_of_ppdu is set to 0.
2148  *
2149  * status_buff_addr_info
2150  *		Details of the physical address of the first status
2151  *		buffer used for the PPDU (either the PPDU that included the
2152  *		MPDU being pushed to SW if end_of_ppdu = 0, or the PPDU
2153  *		whose end is indicated through end_of_ppdu = 1)
2154  *
2155  * rxdma_push_reason
2156  *		Indicates why RXDMA pushed the frame to this ring
2157  *
2158  *		<enum 0 rxdma_error_detected> RXDMA detected an error an
2159  *		pushed this frame to this queue
2160  *
2161  *		<enum 1 rxdma_routing_instruction> RXDMA pushed the
2162  *		frame to this queue per received routing instructions. No
2163  *		error within RXDMA was detected
2164  *
2165  *		<enum 2 rxdma_rx_flush> RXDMA received an RX_FLUSH. As a
2166  *		result the MSDU link descriptor might not have the
2167  *		last_msdu_in_mpdu_flag set, but instead WBM might just see a
2168  *		NULL pointer in the MSDU link descriptor. This is to be
2169  *		considered a normal condition for this scenario.
2170  *
2171  * rxdma_error_code
2172  *		Field only valid when rxdma_push_reason is set to
2173  *		'rxdma_error_detected.'
2174  *
2175  *		<enum 0 rxdma_overflow_err>MPDU frame is not complete
2176  *		due to a FIFO overflow error in RXPCU.
2177  *
2178  *		<enum 1 rxdma_mpdu_length_err>MPDU frame is not complete
2179  *		due to receiving incomplete MPDU from the PHY
2180  *
2181  *		<enum 3 rxdma_decrypt_err>CRYPTO reported a decryption
2182  *		error or CRYPTO received an encrypted frame, but did not get
2183  *		a valid corresponding key id in the peer entry.
2184  *
2185  *		<enum 4 rxdma_tkip_mic_err>CRYPTO reported a TKIP MIC
2186  *		error
2187  *
2188  *		<enum 5 rxdma_unecrypted_err>CRYPTO reported an
2189  *		unencrypted frame error when encrypted was expected
2190  *
2191  *		<enum 6 rxdma_msdu_len_err>RX OLE reported an MSDU
2192  *		length error
2193  *
2194  *		<enum 7 rxdma_msdu_limit_err>RX OLE reported that max
2195  *		number of MSDUs allowed in an MPDU got exceeded
2196  *
2197  *		<enum 8 rxdma_wifi_parse_err>RX OLE reported a parsing
2198  *		error
2199  *
2200  *		<enum 9 rxdma_amsdu_parse_err>RX OLE reported an A-MSDU
2201  *		parsing error
2202  *
2203  *		<enum 10 rxdma_sa_timeout_err>RX OLE reported a timeout
2204  *		during SA search
2205  *
2206  *		<enum 11 rxdma_da_timeout_err>RX OLE reported a timeout
2207  *		during DA search
2208  *
2209  *		<enum 12 rxdma_flow_timeout_err>RX OLE reported a
2210  *		timeout during flow search
2211  *
2212  *		<enum 13 rxdma_flush_request>RXDMA received a flush
2213  *		request
2214  *
2215  *		<enum 14 rxdma_amsdu_fragment_err>Rx PCU reported A-MSDU
2216  *		present as well as a fragmented MPDU.
2217  *
2218  * mpdu_fragment_number
2219  *		Field only valid when Reo_level_mpdu_frame_info.
2220  *		Rx_mpdu_desc_info_details.Fragment_flag is set and
2221  *		end_of_ppdu is set to 0.
2222  *
2223  *		The fragment number from the 802.11 header.
2224  *
2225  *		Note that the sequence number is embedded in the field:
2226  *		Reo_level_mpdu_frame_info. Rx_mpdu_desc_info_details.
2227  *		Mpdu_sequence_number
2228  *
2229  * frameless_bar
2230  *		When set, this SW monitor ring struct contains BAR info
2231  *		from a multi TID BAR frame. The original multi TID BAR frame
2232  *		itself contained all the REO info for the first TID, but all
2233  *		the subsequent TID info and their linkage to the REO
2234  *		descriptors is passed down as 'frameless' BAR info.
2235  *
2236  *		The only fields valid in this descriptor when this bit
2237  *		is within the
2238  *
2239  *		Reo_level_mpdu_frame_info:
2240  *		   Within Rx_mpdu_desc_info_details:
2241  *			Mpdu_Sequence_number
2242  *			BAR_frame
2243  *			Peer_meta_data
2244  *			All other fields shall be set to 0.
2245  *
2246  * status_buf_count
2247  *		A count of status buffers used so far for the PPDU
2248  *		(either the PPDU that included the MPDU being pushed to SW
2249  *		if end_of_ppdu = 0, or the PPDU whose end is indicated
2250  *		through end_of_ppdu = 1)
2251  *
2252  * end_of_ppdu
2253  *		Some hw RXDMA can be configured to generate a separate
2254  *		'SW_MONITOR_RING' descriptor at the end of a PPDU (either
2255  *		through an 'RX_PPDU_END' TLV or through an 'RX_FLUSH') to
2256  *		demarcate PPDUs.
2257  *
2258  *		For such a descriptor, this bit is set to 1 and fields
2259  *		Reo_level_mpdu_frame_info, mpdu_fragment_number and
2260  *		Frameless_bar are all set to 0.
2261  *
2262  *		Otherwise this bit is set to 0.
2263  *
2264  * phy_ppdu_id
2265  *		A PPDU counter value that PHY increments for every PPDU
2266  *		received
2267  *
2268  *		The counter value wraps around. Some hw RXDMA can be
2269  *		configured to copy this from the RX_PPDU_START TLV for every
2270  *		output descriptor.
2271  *
2272  * ring_id
2273  *		For debugging.
2274  *		This field is filled in by the SRNG module.
2275  *		It help to identify the ring that is being looked
2276  *
2277  * looping_count
2278  *		For debugging.
2279  *		This field is filled in by the SRNG module.
2280  *
2281  *		A count value that indicates the number of times the
2282  *		producer of entries into this Ring has looped around the
2283  *		ring.
2284  *		At initialization time, this value is set to 0. On the
2285  *		first loop, this value is set to 1. After the max value is
2286  *		reached allowed by the number of bits for this field, the
2287  *		count value continues with 0 again.
2288  *
2289  *		In case SW is the consumer of the ring entries, it can
2290  *		use this field to figure out up to where the producer of
2291  *		entries has created new entries. This eliminates the need to
2292  *		check where the head pointer' of the ring is located once
2293  *		the SW starts processing an interrupt indicating that new
2294  *		entries have been put into this ring...
2295  */
2296 
2297 enum hal_desc_owner {
2298 	HAL_DESC_OWNER_WBM,
2299 	HAL_DESC_OWNER_SW,
2300 	HAL_DESC_OWNER_TQM,
2301 	HAL_DESC_OWNER_RXDMA,
2302 	HAL_DESC_OWNER_REO,
2303 	HAL_DESC_OWNER_SWITCH,
2304 };
2305 
2306 enum hal_desc_buf_type {
2307 	HAL_DESC_BUF_TYPE_TX_MSDU_LINK,
2308 	HAL_DESC_BUF_TYPE_TX_MPDU_LINK,
2309 	HAL_DESC_BUF_TYPE_TX_MPDU_QUEUE_HEAD,
2310 	HAL_DESC_BUF_TYPE_TX_MPDU_QUEUE_EXT,
2311 	HAL_DESC_BUF_TYPE_TX_FLOW,
2312 	HAL_DESC_BUF_TYPE_TX_BUFFER,
2313 	HAL_DESC_BUF_TYPE_RX_MSDU_LINK,
2314 	HAL_DESC_BUF_TYPE_RX_MPDU_LINK,
2315 	HAL_DESC_BUF_TYPE_RX_REO_QUEUE,
2316 	HAL_DESC_BUF_TYPE_RX_REO_QUEUE_EXT,
2317 	HAL_DESC_BUF_TYPE_RX_BUFFER,
2318 	HAL_DESC_BUF_TYPE_IDLE_LINK,
2319 };
2320 
2321 #define HAL_DESC_REO_OWNED		4
2322 #define HAL_DESC_REO_QUEUE_DESC		8
2323 #define HAL_DESC_REO_QUEUE_EXT_DESC	9
2324 #define HAL_DESC_REO_NON_QOS_TID	16
2325 
2326 #define HAL_DESC_HDR_INFO0_OWNER	GENMASK(3, 0)
2327 #define HAL_DESC_HDR_INFO0_BUF_TYPE	GENMASK(7, 4)
2328 #define HAL_DESC_HDR_INFO0_DBG_RESERVED	GENMASK(31, 8)
2329 
2330 struct hal_desc_header {
2331 	__le32 info0;
2332 } __packed;
2333 
2334 struct hal_rx_mpdu_link_ptr {
2335 	struct ath12k_buffer_addr addr_info;
2336 } __packed;
2337 
2338 struct hal_rx_msdu_details {
2339 	struct ath12k_buffer_addr buf_addr_info;
2340 	struct rx_msdu_desc rx_msdu_info;
2341 	struct rx_msdu_ext_desc rx_msdu_ext_info;
2342 } __packed;
2343 
2344 #define HAL_RX_MSDU_LNK_INFO0_RX_QUEUE_NUMBER		GENMASK(15, 0)
2345 #define HAL_RX_MSDU_LNK_INFO0_FIRST_MSDU_LNK		BIT(16)
2346 
2347 struct hal_rx_msdu_link {
2348 	struct hal_desc_header desc_hdr;
2349 	struct ath12k_buffer_addr buf_addr_info;
2350 	__le32 info0;
2351 	__le32 pn[4];
2352 	struct hal_rx_msdu_details msdu_link[6];
2353 } __packed;
2354 
2355 struct hal_rx_reo_queue_ext {
2356 	struct hal_desc_header desc_hdr;
2357 	__le32 rsvd;
2358 	struct hal_rx_mpdu_link_ptr mpdu_link[15];
2359 } __packed;
2360 
2361 /* hal_rx_reo_queue_ext
2362  *	Consumer: REO
2363  *	Producer: REO
2364  *
2365  * descriptor_header
2366  *	Details about which module owns this struct.
2367  *
2368  * mpdu_link
2369  *	Pointer to the next MPDU_link descriptor in the MPDU queue.
2370  */
2371 
2372 enum hal_rx_reo_queue_pn_size {
2373 	HAL_RX_REO_QUEUE_PN_SIZE_24,
2374 	HAL_RX_REO_QUEUE_PN_SIZE_48,
2375 	HAL_RX_REO_QUEUE_PN_SIZE_128,
2376 };
2377 
2378 #define HAL_RX_REO_QUEUE_RX_QUEUE_NUMBER		GENMASK(15, 0)
2379 
2380 #define HAL_RX_REO_QUEUE_INFO0_VLD			BIT(0)
2381 #define HAL_RX_REO_QUEUE_INFO0_ASSOC_LNK_DESC_COUNTER	GENMASK(2, 1)
2382 #define HAL_RX_REO_QUEUE_INFO0_DIS_DUP_DETECTION	BIT(3)
2383 #define HAL_RX_REO_QUEUE_INFO0_SOFT_REORDER_EN		BIT(4)
2384 #define HAL_RX_REO_QUEUE_INFO0_AC			GENMASK(6, 5)
2385 #define HAL_RX_REO_QUEUE_INFO0_BAR			BIT(7)
2386 #define HAL_RX_REO_QUEUE_INFO0_RETRY			BIT(8)
2387 #define HAL_RX_REO_QUEUE_INFO0_CHECK_2K_MODE		BIT(9)
2388 #define HAL_RX_REO_QUEUE_INFO0_OOR_MODE			BIT(10)
2389 #define HAL_RX_REO_QUEUE_INFO0_BA_WINDOW_SIZE		GENMASK(20, 11)
2390 #define HAL_RX_REO_QUEUE_INFO0_PN_CHECK			BIT(21)
2391 #define HAL_RX_REO_QUEUE_INFO0_EVEN_PN			BIT(22)
2392 #define HAL_RX_REO_QUEUE_INFO0_UNEVEN_PN		BIT(23)
2393 #define HAL_RX_REO_QUEUE_INFO0_PN_HANDLE_ENABLE		BIT(24)
2394 #define HAL_RX_REO_QUEUE_INFO0_PN_SIZE			GENMASK(26, 25)
2395 #define HAL_RX_REO_QUEUE_INFO0_IGNORE_AMPDU_FLG		BIT(27)
2396 
2397 #define HAL_RX_REO_QUEUE_INFO1_SVLD			BIT(0)
2398 #define HAL_RX_REO_QUEUE_INFO1_SSN			GENMASK(12, 1)
2399 #define HAL_RX_REO_QUEUE_INFO1_CURRENT_IDX		GENMASK(22, 13)
2400 #define HAL_RX_REO_QUEUE_INFO1_SEQ_2K_ERR		BIT(23)
2401 #define HAL_RX_REO_QUEUE_INFO1_PN_ERR			BIT(24)
2402 #define HAL_RX_REO_QUEUE_INFO1_PN_VALID			BIT(31)
2403 
2404 #define HAL_RX_REO_QUEUE_INFO2_MPDU_COUNT		GENMASK(6, 0)
2405 #define HAL_RX_REO_QUEUE_INFO2_MSDU_COUNT		(31, 7)
2406 
2407 #define HAL_RX_REO_QUEUE_INFO3_TIMEOUT_COUNT		GENMASK(9, 4)
2408 #define HAL_RX_REO_QUEUE_INFO3_FWD_DUE_TO_BAR_CNT	GENMASK(15, 10)
2409 #define HAL_RX_REO_QUEUE_INFO3_DUPLICATE_COUNT		GENMASK(31, 16)
2410 
2411 #define HAL_RX_REO_QUEUE_INFO4_FRAME_IN_ORD_COUNT	GENMASK(23, 0)
2412 #define HAL_RX_REO_QUEUE_INFO4_BAR_RECVD_COUNT		GENMASK(31, 24)
2413 
2414 #define HAL_RX_REO_QUEUE_INFO5_LATE_RX_MPDU_COUNT	GENMASK(11, 0)
2415 #define HAL_RX_REO_QUEUE_INFO5_WINDOW_JUMP_2K		GENMASK(15, 12)
2416 #define HAL_RX_REO_QUEUE_INFO5_HOLE_COUNT		GENMASK(31, 16)
2417 
2418 struct hal_rx_reo_queue {
2419 	struct hal_desc_header desc_hdr;
2420 	__le32 rx_queue_num;
2421 	__le32 info0;
2422 	__le32 info1;
2423 	__le32 pn[4];
2424 	__le32 last_rx_enqueue_timestamp;
2425 	__le32 last_rx_dequeue_timestamp;
2426 	__le32 next_aging_queue[2];
2427 	__le32 prev_aging_queue[2];
2428 	__le32 rx_bitmap[9];
2429 	__le32 info2;
2430 	__le32 info3;
2431 	__le32 info4;
2432 	__le32 processed_mpdus;
2433 	__le32 processed_msdus;
2434 	__le32 processed_total_bytes;
2435 	__le32 info5;
2436 	__le32 rsvd[2];
2437 	struct hal_rx_reo_queue_ext ext_desc[];
2438 } __packed;
2439 
2440 /* hal_rx_reo_queue
2441  *
2442  * descriptor_header
2443  *	Details about which module owns this struct. Note that sub field
2444  *	Buffer_type shall be set to receive_reo_queue_descriptor.
2445  *
2446  * receive_queue_number
2447  *	Indicates the MPDU queue ID to which this MPDU link descriptor belongs.
2448  *
2449  * vld
2450  *	Valid bit indicating a session is established and the queue descriptor
2451  *	is valid.
2452  * associated_link_descriptor_counter
2453  *	Indicates which of the 3 link descriptor counters shall be incremented
2454  *	or decremented when link descriptors are added or removed from this
2455  *	flow queue.
2456  * disable_duplicate_detection
2457  *	When set, do not perform any duplicate detection.
2458  * soft_reorder_enable
2459  *	When set, REO has been instructed to not perform the actual re-ordering
2460  *	of frames for this queue, but just to insert the reorder opcodes.
2461  * ac
2462  *	Indicates the access category of the queue descriptor.
2463  * bar
2464  *	Indicates if BAR has been received.
2465  * retry
2466  *	Retry bit is checked if this bit is set.
2467  * chk_2k_mode
2468  *	Indicates what type of operation is expected from Reo when the received
2469  *	frame SN falls within the 2K window.
2470  * oor_mode
2471  *	Indicates what type of operation is expected when the received frame
2472  *	falls within the OOR window.
2473  * ba_window_size
2474  *	Indicates the negotiated (window size + 1). Max of 256 bits.
2475  *
2476  *	A value 255 means 256 bitmap, 63 means 64 bitmap, 0 (means non-BA
2477  *	session, with window size of 0). The 3 values here are the main values
2478  *	validated, but other values should work as well.
2479  *
2480  *	A BA window size of 0 (=> one frame entry bitmat), means that there is
2481  *	no additional rx_reo_queue_ext desc. following rx_reo_queue in memory.
2482  *	A BA window size of 1 - 105, means that there is 1 rx_reo_queue_ext.
2483  *	A BA window size of 106 - 210, means that there are 2 rx_reo_queue_ext.
2484  *	A BA window size of 211 - 256, means that there are 3 rx_reo_queue_ext.
2485  * pn_check_needed, pn_shall_be_even, pn_shall_be_uneven, pn_handling_enable,
2486  * pn_size
2487  *	REO shall perform the PN increment check, even number check, uneven
2488  *	number check, PN error check and size of the PN field check.
2489  * ignore_ampdu_flag
2490  *	REO shall ignore the ampdu_flag on entrance descriptor for this queue.
2491  *
2492  * svld
2493  *	Sequence number in next field is valid one.
2494  * ssn
2495  *	 Starting Sequence number of the session.
2496  * current_index
2497  *	Points to last forwarded packet
2498  * seq_2k_error_detected_flag
2499  *	REO has detected a 2k error jump in the sequence number and from that
2500  *	moment forward, all new frames are forwarded directly to FW, without
2501  *	duplicate detect, reordering, etc.
2502  * pn_error_detected_flag
2503  *	REO has detected a PN error.
2504  */
2505 
2506 #define HAL_REO_UPD_RX_QUEUE_INFO0_QUEUE_ADDR_HI		GENMASK(7, 0)
2507 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_RX_QUEUE_NUM		BIT(8)
2508 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_VLD			BIT(9)
2509 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_ASSOC_LNK_DESC_CNT	BIT(10)
2510 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_DIS_DUP_DETECTION	BIT(11)
2511 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_SOFT_REORDER_EN		BIT(12)
2512 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_AC			BIT(13)
2513 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_BAR			BIT(14)
2514 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_RETRY			BIT(15)
2515 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_CHECK_2K_MODE		BIT(16)
2516 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_OOR_MODE			BIT(17)
2517 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_BA_WINDOW_SIZE		BIT(18)
2518 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_CHECK			BIT(19)
2519 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_EVEN_PN			BIT(20)
2520 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_UNEVEN_PN		BIT(21)
2521 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_HANDLE_ENABLE		BIT(22)
2522 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_SIZE			BIT(23)
2523 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_IGNORE_AMPDU_FLG		BIT(24)
2524 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_SVLD			BIT(25)
2525 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_SSN			BIT(26)
2526 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_SEQ_2K_ERR		BIT(27)
2527 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_ERR			BIT(28)
2528 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN_VALID			BIT(29)
2529 #define HAL_REO_UPD_RX_QUEUE_INFO0_UPD_PN			BIT(30)
2530 
2531 #define HAL_REO_UPD_RX_QUEUE_INFO1_RX_QUEUE_NUMBER		GENMASK(15, 0)
2532 #define HAL_REO_UPD_RX_QUEUE_INFO1_VLD				BIT(16)
2533 #define HAL_REO_UPD_RX_QUEUE_INFO1_ASSOC_LNK_DESC_COUNTER	GENMASK(18, 17)
2534 #define HAL_REO_UPD_RX_QUEUE_INFO1_DIS_DUP_DETECTION		BIT(19)
2535 #define HAL_REO_UPD_RX_QUEUE_INFO1_SOFT_REORDER_EN		BIT(20)
2536 #define HAL_REO_UPD_RX_QUEUE_INFO1_AC				GENMASK(22, 21)
2537 #define HAL_REO_UPD_RX_QUEUE_INFO1_BAR				BIT(23)
2538 #define HAL_REO_UPD_RX_QUEUE_INFO1_RETRY			BIT(24)
2539 #define HAL_REO_UPD_RX_QUEUE_INFO1_CHECK_2K_MODE		BIT(25)
2540 #define HAL_REO_UPD_RX_QUEUE_INFO1_OOR_MODE			BIT(26)
2541 #define HAL_REO_UPD_RX_QUEUE_INFO1_PN_CHECK			BIT(27)
2542 #define HAL_REO_UPD_RX_QUEUE_INFO1_EVEN_PN			BIT(28)
2543 #define HAL_REO_UPD_RX_QUEUE_INFO1_UNEVEN_PN			BIT(29)
2544 #define HAL_REO_UPD_RX_QUEUE_INFO1_PN_HANDLE_ENABLE		BIT(30)
2545 #define HAL_REO_UPD_RX_QUEUE_INFO1_IGNORE_AMPDU_FLG		BIT(31)
2546 
2547 #define HAL_REO_UPD_RX_QUEUE_INFO2_BA_WINDOW_SIZE		GENMASK(9, 0)
2548 #define HAL_REO_UPD_RX_QUEUE_INFO2_PN_SIZE			GENMASK(11, 10)
2549 #define HAL_REO_UPD_RX_QUEUE_INFO2_SVLD				BIT(12)
2550 #define HAL_REO_UPD_RX_QUEUE_INFO2_SSN				GENMASK(24, 13)
2551 #define HAL_REO_UPD_RX_QUEUE_INFO2_SEQ_2K_ERR			BIT(25)
2552 #define HAL_REO_UPD_RX_QUEUE_INFO2_PN_ERR			BIT(26)
2553 #define HAL_REO_UPD_RX_QUEUE_INFO2_PN_VALID			BIT(27)
2554 
2555 struct hal_reo_update_rx_queue {
2556 	struct hal_reo_cmd_hdr cmd;
2557 	__le32 queue_addr_lo;
2558 	__le32 info0;
2559 	__le32 info1;
2560 	__le32 info2;
2561 	__le32 pn[4];
2562 } __packed;
2563 
2564 struct hal_rx_reo_queue_1k {
2565 	struct hal_desc_header desc_hdr;
2566 	__le32 rx_bitmap_1023_288[23];
2567 	__le32 reserved[8];
2568 } __packed;
2569 
2570 #define HAL_REO_UNBLOCK_CACHE_INFO0_UNBLK_CACHE		BIT(0)
2571 #define HAL_REO_UNBLOCK_CACHE_INFO0_RESOURCE_IDX	GENMASK(2, 1)
2572 
2573 struct hal_reo_unblock_cache {
2574 	struct hal_reo_cmd_hdr cmd;
2575 	__le32 info0;
2576 	__le32 rsvd[7];
2577 } __packed;
2578 
2579 enum hal_reo_exec_status {
2580 	HAL_REO_EXEC_STATUS_SUCCESS,
2581 	HAL_REO_EXEC_STATUS_BLOCKED,
2582 	HAL_REO_EXEC_STATUS_FAILED,
2583 	HAL_REO_EXEC_STATUS_RESOURCE_BLOCKED,
2584 };
2585 
2586 #define HAL_REO_STATUS_HDR_INFO0_STATUS_NUM	GENMASK(15, 0)
2587 #define HAL_REO_STATUS_HDR_INFO0_EXEC_TIME	GENMASK(25, 16)
2588 #define HAL_REO_STATUS_HDR_INFO0_EXEC_STATUS	GENMASK(27, 26)
2589 
2590 struct hal_reo_status_hdr {
2591 	__le32 info0;
2592 	__le32 timestamp;
2593 } __packed;
2594 
2595 /* hal_reo_status_hdr
2596  *		Producer: REO
2597  *		Consumer: SW
2598  *
2599  * status_num
2600  *		The value in this field is equal to value of the reo command
2601  *		number. This field helps to correlate the statuses with the REO
2602  *		commands.
2603  *
2604  * execution_time (in us)
2605  *		The amount of time REO took to execute the command. Note that
2606  *		this time does not include the duration of the command waiting
2607  *		in the command ring, before the execution started.
2608  *
2609  * execution_status
2610  *		Execution status of the command. Values are defined in
2611  *		enum %HAL_REO_EXEC_STATUS_.
2612  */
2613 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO0_SSN		GENMASK(11, 0)
2614 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO0_CUR_IDX		GENMASK(21, 12)
2615 
2616 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO1_MPDU_COUNT		GENMASK(6, 0)
2617 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO1_MSDU_COUNT		GENMASK(31, 7)
2618 
2619 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO2_WINDOW_JMP2K	GENMASK(3, 0)
2620 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO2_TIMEOUT_COUNT	GENMASK(9, 4)
2621 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO2_FDTB_COUNT		GENMASK(15, 10)
2622 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO2_DUPLICATE_COUNT	GENMASK(31, 16)
2623 
2624 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO3_FIO_COUNT		GENMASK(23, 0)
2625 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO3_BAR_RCVD_CNT	GENMASK(31, 24)
2626 
2627 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO4_LATE_RX_MPDU	GENMASK(11, 0)
2628 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO4_HOLE_COUNT		GENMASK(27, 12)
2629 
2630 #define HAL_REO_GET_QUEUE_STATS_STATUS_INFO5_LOOPING_CNT	GENMASK(31, 28)
2631 
2632 struct hal_reo_get_queue_stats_status {
2633 	struct hal_reo_status_hdr hdr;
2634 	__le32 info0;
2635 	__le32 pn[4];
2636 	__le32 last_rx_enqueue_timestamp;
2637 	__le32 last_rx_dequeue_timestamp;
2638 	__le32 rx_bitmap[9];
2639 	__le32 info1;
2640 	__le32 info2;
2641 	__le32 info3;
2642 	__le32 num_mpdu_frames;
2643 	__le32 num_msdu_frames;
2644 	__le32 total_bytes;
2645 	__le32 info4;
2646 	__le32 info5;
2647 } __packed;
2648 
2649 /* hal_reo_get_queue_stats_status
2650  *		Producer: REO
2651  *		Consumer: SW
2652  *
2653  * status_hdr
2654  *		Details that can link this status with the original command. It
2655  *		also contains info on how long REO took to execute this command.
2656  *
2657  * ssn
2658  *		Starting Sequence number of the session, this changes whenever
2659  *		window moves (can be filled by SW then maintained by REO).
2660  *
2661  * current_index
2662  *		Points to last forwarded packet.
2663  *
2664  * pn
2665  *		Bits of the PN number.
2666  *
2667  * last_rx_enqueue_timestamp
2668  * last_rx_dequeue_timestamp
2669  *		Timestamp of arrival of the last MPDU for this queue and
2670  *		Timestamp of forwarding an MPDU accordingly.
2671  *
2672  * rx_bitmap
2673  *		When a bit is set, the corresponding frame is currently held
2674  *		in the re-order queue. The bitmap  is Fully managed by HW.
2675  *
2676  * current_mpdu_count
2677  * current_msdu_count
2678  *		The number of MPDUs and MSDUs in the queue.
2679  *
2680  * timeout_count
2681  *		The number of times REO started forwarding frames even though
2682  *		there is a hole in the bitmap. Forwarding reason is timeout.
2683  *
2684  * forward_due_to_bar_count
2685  *		The number of times REO started forwarding frames even though
2686  *		there is a hole in the bitmap. Fwd reason is reception of BAR.
2687  *
2688  * duplicate_count
2689  *		The number of duplicate frames that have been detected.
2690  *
2691  * frames_in_order_count
2692  *		The number of frames that have been received in order (without
2693  *		a hole that prevented them from being forwarded immediately).
2694  *
2695  * bar_received_count
2696  *		The number of times a BAR frame is received.
2697  *
2698  * mpdu_frames_processed_count
2699  * msdu_frames_processed_count
2700  *		The total number of MPDU/MSDU frames that have been processed.
2701  *
2702  * total_bytes
2703  *		An approximation of the number of bytes received for this queue.
2704  *
2705  * late_receive_mpdu_count
2706  *		The number of MPDUs received after the window had already moved
2707  *		on. The 'late' sequence window is defined as
2708  *		(Window SSN - 256) - (Window SSN - 1).
2709  *
2710  * window_jump_2k
2711  *		The number of times the window moved more than 2K
2712  *
2713  * hole_count
2714  *		The number of times a hole was created in the receive bitmap.
2715  *
2716  * looping_count
2717  *		A count value that indicates the number of times the producer of
2718  *		entries into this Ring has looped around the ring.
2719  */
2720 
2721 #define HAL_REO_STATUS_LOOP_CNT			GENMASK(31, 28)
2722 
2723 #define HAL_REO_FLUSH_QUEUE_INFO0_ERR_DETECTED	BIT(0)
2724 #define HAL_REO_FLUSH_QUEUE_INFO0_RSVD		GENMASK(31, 1)
2725 #define HAL_REO_FLUSH_QUEUE_INFO1_RSVD		GENMASK(27, 0)
2726 
2727 struct hal_reo_flush_queue_status {
2728 	struct hal_reo_status_hdr hdr;
2729 	__le32 info0;
2730 	__le32 rsvd0[21];
2731 	__le32 info1;
2732 } __packed;
2733 
2734 /* hal_reo_flush_queue_status
2735  *		Producer: REO
2736  *		Consumer: SW
2737  *
2738  * status_hdr
2739  *		Details that can link this status with the original command. It
2740  *		also contains info on how long REO took to execute this command.
2741  *
2742  * error_detected
2743  *		Status of blocking resource
2744  *
2745  *		0 - No error has been detected while executing this command
2746  *		1 - Error detected. The resource to be used for blocking was
2747  *		    already in use.
2748  *
2749  * looping_count
2750  *		A count value that indicates the number of times the producer of
2751  *		entries into this Ring has looped around the ring.
2752  */
2753 
2754 #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_IS_ERR			BIT(0)
2755 #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_BLOCK_ERR_CODE		GENMASK(2, 1)
2756 #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_STATUS_HIT	BIT(8)
2757 #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_DESC_TYPE	GENMASK(11, 9)
2758 #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_CLIENT_ID	GENMASK(15, 12)
2759 #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_ERR		GENMASK(17, 16)
2760 #define HAL_REO_FLUSH_CACHE_STATUS_INFO0_FLUSH_COUNT		GENMASK(25, 18)
2761 
2762 struct hal_reo_flush_cache_status {
2763 	struct hal_reo_status_hdr hdr;
2764 	__le32 info0;
2765 	__le32 rsvd0[21];
2766 	__le32 info1;
2767 } __packed;
2768 
2769 /* hal_reo_flush_cache_status
2770  *		Producer: REO
2771  *		Consumer: SW
2772  *
2773  * status_hdr
2774  *		Details that can link this status with the original command. It
2775  *		also contains info on how long REO took to execute this command.
2776  *
2777  * error_detected
2778  *		Status for blocking resource handling
2779  *
2780  *		0 - No error has been detected while executing this command
2781  *		1 - An error in the blocking resource management was detected
2782  *
2783  * block_error_details
2784  *		only valid when error_detected is set
2785  *
2786  *		0 - No blocking related errors found
2787  *		1 - Blocking resource is already in use
2788  *		2 - Resource requested to be unblocked, was not blocked
2789  *
2790  * cache_controller_flush_status_hit
2791  *		The status that the cache controller returned on executing the
2792  *		flush command.
2793  *
2794  *		0 - miss; 1 - hit
2795  *
2796  * cache_controller_flush_status_desc_type
2797  *		Flush descriptor type
2798  *
2799  * cache_controller_flush_status_client_id
2800  *		Module who made the flush request
2801  *
2802  *		In REO, this is always 0
2803  *
2804  * cache_controller_flush_status_error
2805  *		Error condition
2806  *
2807  *		0 - No error found
2808  *		1 - HW interface is still busy
2809  *		2 - Line currently locked. Used for one line flush command
2810  *		3 - At least one line is still locked.
2811  *		    Used for cache flush command.
2812  *
2813  * cache_controller_flush_count
2814  *		The number of lines that were actually flushed out
2815  *
2816  * looping_count
2817  *		A count value that indicates the number of times the producer of
2818  *		entries into this Ring has looped around the ring.
2819  */
2820 
2821 #define HAL_REO_UNBLOCK_CACHE_STATUS_INFO0_IS_ERR	BIT(0)
2822 #define HAL_REO_UNBLOCK_CACHE_STATUS_INFO0_TYPE		BIT(1)
2823 
2824 struct hal_reo_unblock_cache_status {
2825 	struct hal_reo_status_hdr hdr;
2826 	__le32 info0;
2827 	__le32 rsvd0[21];
2828 	__le32 info1;
2829 } __packed;
2830 
2831 /* hal_reo_unblock_cache_status
2832  *		Producer: REO
2833  *		Consumer: SW
2834  *
2835  * status_hdr
2836  *		Details that can link this status with the original command. It
2837  *		also contains info on how long REO took to execute this command.
2838  *
2839  * error_detected
2840  *		0 - No error has been detected while executing this command
2841  *		1 - The blocking resource was not in use, and therefore it could
2842  *		    not be unblocked.
2843  *
2844  * unblock_type
2845  *		Reference to the type of unblock command
2846  *		0 - Unblock a blocking resource
2847  *		1 - The entire cache usage is unblock
2848  *
2849  * looping_count
2850  *		A count value that indicates the number of times the producer of
2851  *		entries into this Ring has looped around the ring.
2852  */
2853 
2854 #define HAL_REO_FLUSH_TIMEOUT_STATUS_INFO0_IS_ERR		BIT(0)
2855 #define HAL_REO_FLUSH_TIMEOUT_STATUS_INFO0_LIST_EMPTY		BIT(1)
2856 
2857 #define HAL_REO_FLUSH_TIMEOUT_STATUS_INFO1_REL_DESC_COUNT	GENMASK(15, 0)
2858 #define HAL_REO_FLUSH_TIMEOUT_STATUS_INFO1_FWD_BUF_COUNT	GENMASK(31, 16)
2859 
2860 struct hal_reo_flush_timeout_list_status {
2861 	struct hal_reo_status_hdr hdr;
2862 	__le32 info0;
2863 	__le32 info1;
2864 	__le32 rsvd0[20];
2865 	__le32 info2;
2866 } __packed;
2867 
2868 /* hal_reo_flush_timeout_list_status
2869  *		Producer: REO
2870  *		Consumer: SW
2871  *
2872  * status_hdr
2873  *		Details that can link this status with the original command. It
2874  *		also contains info on how long REO took to execute this command.
2875  *
2876  * error_detected
2877  *		0 - No error has been detected while executing this command
2878  *		1 - Command not properly executed and returned with error
2879  *
2880  * timeout_list_empty
2881  *		When set, REO has depleted the timeout list and all entries are
2882  *		gone.
2883  *
2884  * release_desc_count
2885  *		Producer: SW; Consumer: REO
2886  *		The number of link descriptor released
2887  *
2888  * forward_buf_count
2889  *		Producer: SW; Consumer: REO
2890  *		The number of buffers forwarded to the REO destination rings
2891  *
2892  * looping_count
2893  *		A count value that indicates the number of times the producer of
2894  *		entries into this Ring has looped around the ring.
2895  */
2896 
2897 #define HAL_REO_DESC_THRESH_STATUS_INFO0_THRESH_INDEX		GENMASK(1, 0)
2898 #define HAL_REO_DESC_THRESH_STATUS_INFO1_LINK_DESC_COUNTER0	GENMASK(23, 0)
2899 #define HAL_REO_DESC_THRESH_STATUS_INFO2_LINK_DESC_COUNTER1	GENMASK(23, 0)
2900 #define HAL_REO_DESC_THRESH_STATUS_INFO3_LINK_DESC_COUNTER2	GENMASK(23, 0)
2901 #define HAL_REO_DESC_THRESH_STATUS_INFO4_LINK_DESC_COUNTER_SUM	GENMASK(25, 0)
2902 
2903 struct hal_reo_desc_thresh_reached_status {
2904 	struct hal_reo_status_hdr hdr;
2905 	__le32 info0;
2906 	__le32 info1;
2907 	__le32 info2;
2908 	__le32 info3;
2909 	__le32 info4;
2910 	__le32 rsvd0[17];
2911 	__le32 info5;
2912 } __packed;
2913 
2914 /* hal_reo_desc_thresh_reached_status
2915  *		Producer: REO
2916  *		Consumer: SW
2917  *
2918  * status_hdr
2919  *		Details that can link this status with the original command. It
2920  *		also contains info on how long REO took to execute this command.
2921  *
2922  * threshold_index
2923  *		The index of the threshold register whose value got reached
2924  *
2925  * link_descriptor_counter0
2926  * link_descriptor_counter1
2927  * link_descriptor_counter2
2928  * link_descriptor_counter_sum
2929  *		Value of the respective counters at generation of this message
2930  *
2931  * looping_count
2932  *		A count value that indicates the number of times the producer of
2933  *		entries into this Ring has looped around the ring.
2934  */
2935 
2936 #define HAL_TCL_ENTRANCE_FROM_PPE_RING_INFO0_DATA_LENGTH	GENMASK(13, 0)
2937 #define HAL_TCL_ENTRANCE_FROM_PPE_RING_INFO0_L4_CSUM_STATUS	BIT(14)
2938 #define HAL_TCL_ENTRANCE_FROM_PPE_RING_INFO0_L3_CSUM_STATUS	BIT(15)
2939 #define HAL_TCL_ENTRANCE_FROM_PPE_RING_INFO0_PID		GENMASK(27, 24)
2940 #define HAL_TCL_ENTRANCE_FROM_PPE_RING_INFO0_QDISC		BIT(28)
2941 #define HAL_TCL_ENTRANCE_FROM_PPE_RING_INFO0_MULTICAST	BIT(29)
2942 #define HAL_TCL_ENTRANCE_FROM_PPE_RING_INFO0_MORE		BIT(30)
2943 #define HAL_TCL_ENTRANCE_FROM_PPE_RING_INFO0_VALID_TOGGLE	BIT(31)
2944 
2945 struct hal_tcl_entrance_from_ppe_ring {
2946 	__le32 buffer_addr;
2947 	__le32 info0;
2948 } __packed;
2949 
2950 struct hal_mon_buf_ring {
2951 	__le32 paddr_lo;
2952 	__le32 paddr_hi;
2953 	__le64 cookie;
2954 };
2955 
2956 /* hal_mon_buf_ring
2957  *	Producer : SW
2958  *	Consumer : Monitor
2959  *
2960  * paddr_lo
2961  *	Lower 32-bit physical address of the buffer pointer from the source ring.
2962  * paddr_hi
2963  *	bit range 7-0 : upper 8 bit of the physical address.
2964  *	bit range 31-8 : reserved.
2965  * cookie
2966  *	Consumer: RxMon/TxMon 64 bit cookie of the buffers.
2967  */
2968 
2969 #define HAL_MON_DEST_COOKIE_BUF_ID      GENMASK(17, 0)
2970 
2971 #define HAL_MON_DEST_INFO0_END_OFFSET		GENMASK(11, 0)
2972 #define HAL_MON_DEST_INFO0_END_REASON		GENMASK(17, 16)
2973 #define HAL_MON_DEST_INFO0_INITIATOR		BIT(18)
2974 #define HAL_MON_DEST_INFO0_EMPTY_DESC		BIT(19)
2975 #define HAL_MON_DEST_INFO0_RING_ID		GENMASK(27, 20)
2976 #define HAL_MON_DEST_INFO0_LOOPING_COUNT	GENMASK(31, 28)
2977 
2978 struct hal_mon_dest_desc {
2979 	__le32 cookie;
2980 	__le32 reserved;
2981 	__le32 ppdu_id;
2982 	__le32 info0;
2983 };
2984 
2985 /* hal_mon_dest_ring
2986  *	Producer : TxMon/RxMon
2987  *	Consumer : SW
2988  * cookie
2989  *	bit 0 -17 buf_id to track the skb's vaddr.
2990  * ppdu_id
2991  *	Phy ppdu_id
2992  * end_offset
2993  *	The offset into status buffer where DMA ended, ie., offset to the last
2994  *	TLV + last TLV size.
2995  * flush_detected
2996  *	Indicates whether 'tx_flush' or 'rx_flush' occurred.
2997  * end_of_ppdu
2998  *	Indicates end of ppdu.
2999  * pmac_id
3000  *	Indicates PMAC that received from frame.
3001  * empty_descriptor
3002  *	This descriptor is written on flush or end of ppdu or end of status
3003  *	buffer.
3004  * ring_id
3005  *	updated by SRNG.
3006  * looping_count
3007  *	updated by SRNG.
3008  */
3009 
3010 #define HAL_TX_MSDU_METADATA_INFO0_ENCRYPT_FLAG		BIT(8)
3011 #define HAL_TX_MSDU_METADATA_INFO0_ENCRYPT_TYPE		GENMASK(16, 15)
3012 #define HAL_TX_MSDU_METADATA_INFO0_HOST_TX_DESC_POOL	BIT(31)
3013 
3014 struct hal_tx_msdu_metadata {
3015 	__le32 info0;
3016 	__le32 rsvd0[6];
3017 } __packed;
3018 
3019 /* hal_tx_msdu_metadata
3020  * valid_encrypt_type
3021  *		if set, encrypt type is valid
3022  * encrypt_type
3023  *		0 = NO_ENCRYPT,
3024  *		1 = ENCRYPT,
3025  *		2 ~ 3 - Reserved
3026  * host_tx_desc_pool
3027  *		If set, Firmware allocates tx_descriptors
3028  *		in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
3029  *		of WAL_BUFFERID_TX_TCL_DATA_EXP.
3030  *		Use cases:
3031  *		Any time firmware uses TQM-BYPASS for Data
3032  *		TID, firmware expect host to set this bit.
3033  */
3034 
3035 #endif /* ATH12K_HAL_DESC_H */
3036