xref: /wlan-driver/fw-api/hw/qca5332/tcl_data_cmd.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 
2 /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 #ifndef _TCL_DATA_CMD_H_
27 #define _TCL_DATA_CMD_H_
28 #if !defined(__ASSEMBLER__)
29 #endif
30 
31 #include "buffer_addr_info.h"
32 #define NUM_OF_DWORDS_TCL_DATA_CMD 8
33 
34 
35 struct tcl_data_cmd {
36 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
37              struct   buffer_addr_info                                          buf_addr_info;
38              uint32_t tcl_cmd_type                                            :  1, // [0:0]
39                       buf_or_ext_desc_type                                    :  1, // [1:1]
40                       bank_id                                                 :  6, // [7:2]
41                       tx_notify_frame                                         :  3, // [10:8]
42                       header_length_read_sel                                  :  1, // [11:11]
43                       buffer_timestamp                                        : 19, // [30:12]
44                       buffer_timestamp_valid                                  :  1; // [31:31]
45              uint32_t reserved_3a                                             : 16, // [15:0]
46                       tcl_cmd_number                                          : 16; // [31:16]
47              uint32_t data_length                                             : 16, // [15:0]
48                       ipv4_checksum_en                                        :  1, // [16:16]
49                       udp_over_ipv4_checksum_en                               :  1, // [17:17]
50                       udp_over_ipv6_checksum_en                               :  1, // [18:18]
51                       tcp_over_ipv4_checksum_en                               :  1, // [19:19]
52                       tcp_over_ipv6_checksum_en                               :  1, // [20:20]
53                       to_fw                                                   :  1, // [21:21]
54                       reserved_4a                                             :  1, // [22:22]
55                       packet_offset                                           :  9; // [31:23]
56              uint32_t hlos_tid_overwrite                                      :  1, // [0:0]
57                       flow_override_enable                                    :  1, // [1:1]
58                       who_classify_info_sel                                   :  2, // [3:2]
59                       hlos_tid                                                :  4, // [7:4]
60                       flow_override                                           :  1, // [8:8]
61                       pmac_id                                                 :  2, // [10:9]
62                       msdu_color                                              :  2, // [12:11]
63                       reserved_5a                                             : 11, // [23:13]
64                       vdev_id                                                 :  8; // [31:24]
65              uint32_t search_index                                            : 20, // [19:0]
66                       cache_set_num                                           :  4, // [23:20]
67                       index_lookup_override                                   :  1, // [24:24]
68                       reserved_6a                                             :  7; // [31:25]
69              uint32_t reserved_7a                                             : 20, // [19:0]
70                       ring_id                                                 :  8, // [27:20]
71                       looping_count                                           :  4; // [31:28]
72 #else
73              struct   buffer_addr_info                                          buf_addr_info;
74              uint32_t buffer_timestamp_valid                                  :  1, // [31:31]
75                       buffer_timestamp                                        : 19, // [30:12]
76                       header_length_read_sel                                  :  1, // [11:11]
77                       tx_notify_frame                                         :  3, // [10:8]
78                       bank_id                                                 :  6, // [7:2]
79                       buf_or_ext_desc_type                                    :  1, // [1:1]
80                       tcl_cmd_type                                            :  1; // [0:0]
81              uint32_t tcl_cmd_number                                          : 16, // [31:16]
82                       reserved_3a                                             : 16; // [15:0]
83              uint32_t packet_offset                                           :  9, // [31:23]
84                       reserved_4a                                             :  1, // [22:22]
85                       to_fw                                                   :  1, // [21:21]
86                       tcp_over_ipv6_checksum_en                               :  1, // [20:20]
87                       tcp_over_ipv4_checksum_en                               :  1, // [19:19]
88                       udp_over_ipv6_checksum_en                               :  1, // [18:18]
89                       udp_over_ipv4_checksum_en                               :  1, // [17:17]
90                       ipv4_checksum_en                                        :  1, // [16:16]
91                       data_length                                             : 16; // [15:0]
92              uint32_t vdev_id                                                 :  8, // [31:24]
93                       reserved_5a                                             : 11, // [23:13]
94                       msdu_color                                              :  2, // [12:11]
95                       pmac_id                                                 :  2, // [10:9]
96                       flow_override                                           :  1, // [8:8]
97                       hlos_tid                                                :  4, // [7:4]
98                       who_classify_info_sel                                   :  2, // [3:2]
99                       flow_override_enable                                    :  1, // [1:1]
100                       hlos_tid_overwrite                                      :  1; // [0:0]
101              uint32_t reserved_6a                                             :  7, // [31:25]
102                       index_lookup_override                                   :  1, // [24:24]
103                       cache_set_num                                           :  4, // [23:20]
104                       search_index                                            : 20; // [19:0]
105              uint32_t looping_count                                           :  4, // [31:28]
106                       ring_id                                                 :  8, // [27:20]
107                       reserved_7a                                             : 20; // [19:0]
108 #endif
109 };
110 
111 
112 /* Description		BUF_ADDR_INFO
113 
114 			Details of the physical address for a single buffer containing
115 			 the entire MSDU or an MSDU extension descriptor.
116 			It also contains return ownership info as well as some meta
117 			 data for SW related to this buffer.
118 
119 			In case of Buf_or_ext_desc_type indicating 'MSDU_buffer',
120 			this address indicates the start of the meta data that is
121 			 preceding the actual packet data.
122 			The start of the actual packet data is provided by field:
123 			Packet_offset
124 */
125 
126 
127 /* Description		BUFFER_ADDR_31_0
128 
129 			Address (lower 32 bits) of the MSDU buffer OR MSDU_EXTENSION
130 			 descriptor OR Link Descriptor
131 
132 			In case of 'NULL' pointer, this field is set to 0
133 			<legal all>
134 */
135 
136 #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET                          0x00000000
137 #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_LSB                             0
138 #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MSB                             31
139 #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MASK                            0xffffffff
140 
141 
142 /* Description		BUFFER_ADDR_39_32
143 
144 			Address (upper 8 bits) of the MSDU buffer OR MSDU_EXTENSION
145 			 descriptor OR Link Descriptor
146 
147 			In case of 'NULL' pointer, this field is set to 0
148 			<legal all>
149 */
150 
151 #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET                         0x00000004
152 #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_LSB                            0
153 #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MSB                            7
154 #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MASK                           0x000000ff
155 
156 
157 /* Description		RETURN_BUFFER_MANAGER
158 
159 			Consumer: WBM
160 			Producer: SW/FW
161 
162 			In case of 'NULL' pointer, this field is set to 0
163 
164 			Indicates to which buffer manager the buffer OR MSDU_EXTENSION
165 			 descriptor OR link descriptor that is being pointed to
166 			shall be returned after the frame has been processed. It
167 			 is used by WBM for routing purposes.
168 
169 			<enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
170 			 to the WMB buffer idle list
171 			<enum 1 WBM_CHIP0_IDLE_DESC_LIST> This buffer shall be returned
172 			 to the WBM idle link descriptor idle list, where the chip
173 			 0 WBM is chosen in case of a multi-chip config
174 			<enum 2 WBM_CHIP1_IDLE_DESC_LIST> This buffer shall be returned
175 			 to the chip 1 WBM idle link descriptor idle list
176 			<enum 3 WBM_CHIP2_IDLE_DESC_LIST> This buffer shall be returned
177 			 to the chip 2 WBM idle link descriptor idle list
178 			<enum 12 WBM_CHIP3_IDLE_DESC_LIST> This buffer shall be
179 			returned to chip 3 WBM idle link descriptor idle list
180 			<enum 4 FW_BM> This buffer shall be returned to the FW
181 			<enum 5 SW0_BM> This buffer shall be returned to the SW,
182 			ring 0
183 			<enum 6 SW1_BM> This buffer shall be returned to the SW,
184 			ring 1
185 			<enum 7 SW2_BM> This buffer shall be returned to the SW,
186 			ring 2
187 			<enum 8 SW3_BM> This buffer shall be returned to the SW,
188 			ring 3
189 			<enum 9 SW4_BM> This buffer shall be returned to the SW,
190 			ring 4
191 			<enum 10 SW5_BM> This buffer shall be returned to the SW,
192 			ring 5
193 			<enum 11 SW6_BM> This buffer shall be returned to the SW,
194 			ring 6
195 
196 			<legal 0-12>
197 */
198 
199 #define TCL_DATA_CMD_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET                     0x00000004
200 #define TCL_DATA_CMD_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB                        8
201 #define TCL_DATA_CMD_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MSB                        11
202 #define TCL_DATA_CMD_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK                       0x00000f00
203 
204 
205 /* Description		SW_BUFFER_COOKIE
206 
207 			Cookie field exclusively used by SW.
208 
209 			In case of 'NULL' pointer, this field is set to 0
210 
211 			HW ignores the contents, accept that it passes the programmed
212 			 value on to other descriptors together with the physical
213 			 address
214 
215 			Field can be used by SW to for example associate the buffers
216 			 physical address with the virtual address
217 			The bit definitions as used by SW are within SW HLD specification
218 
219 
220 			NOTE1:
221 			The three most significant bits can have a special meaning
222 			 in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
223 			and field transmit_bw_restriction is set
224 
225 			In case of NON punctured transmission:
226 			Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
227 			Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
228 			Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
229 			Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
230 			Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
231 			Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
232 			Sw_buffer_cookie[19:18] = 2'b11: reserved
233 
234 			In case of punctured transmission:
235 			Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
236 			Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
237 			Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
238 			Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
239 			Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
240 			Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
241 			Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
242 			Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
243 			Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
244 			Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
245 			Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
246 			Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
247 			Sw_buffer_cookie[19:18] = 2'b11: reserved
248 
249 			Note: a punctured transmission is indicated by the presence
250 			 of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
251 
252 			<legal all>
253 */
254 
255 #define TCL_DATA_CMD_BUF_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET                          0x00000004
256 #define TCL_DATA_CMD_BUF_ADDR_INFO_SW_BUFFER_COOKIE_LSB                             12
257 #define TCL_DATA_CMD_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MSB                             31
258 #define TCL_DATA_CMD_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MASK                            0xfffff000
259 
260 
261 /* Description		TCL_CMD_TYPE
262 
263 			This field is used to select the type of TCL Command decriptor
264 			 that is queued by SW/FW. For 'TCL_DATA_CMD' this has to
265 			 be 0.
266 			<legal 0>
267 */
268 
269 #define TCL_DATA_CMD_TCL_CMD_TYPE_OFFSET                                            0x00000008
270 #define TCL_DATA_CMD_TCL_CMD_TYPE_LSB                                               0
271 #define TCL_DATA_CMD_TCL_CMD_TYPE_MSB                                               0
272 #define TCL_DATA_CMD_TCL_CMD_TYPE_MASK                                              0x00000001
273 
274 
275 /* Description		BUF_OR_EXT_DESC_TYPE
276 
277 			<enum 0 MSDU_buffer> The address points to an MSDU buffer.
278 
279 			<enum 1 extension_descriptor> The address points to an MSDU
280 			 link extension descriptor
281 			< legal all>
282 */
283 
284 #define TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_OFFSET                                    0x00000008
285 #define TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_LSB                                       1
286 #define TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_MSB                                       1
287 #define TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_MASK                                      0x00000002
288 
289 
290 /* Description		BANK_ID
291 
292 			This is used to select one of the TCL register banks for
293 			 fields removed from 'TCL_DATA_CMD' that do not change often
294 			 within one virtual device or a set of virtual devices:
295 			EPD
296 			encap_type
297 			Encrypt_type
298 			src_buffer_swap
299 			Link_meta_swap
300 			Search_type
301 			AddrX_en
302 			AddrY_en
303 			DSCP_TID_TABLE_NUM
304 			mesh_enable
305 */
306 
307 #define TCL_DATA_CMD_BANK_ID_OFFSET                                                 0x00000008
308 #define TCL_DATA_CMD_BANK_ID_LSB                                                    2
309 #define TCL_DATA_CMD_BANK_ID_MSB                                                    7
310 #define TCL_DATA_CMD_BANK_ID_MASK                                                   0x000000fc
311 
312 
313 /* Description		TX_NOTIFY_FRAME
314 
315 			TCL copies this value to 'TQM_ENTRANCE_RING' field FW_tx_notify_frame.
316 
317 			Note: TCL can also have CCE/LCE rules to set 'Tx_notify_frame.'
318 			TCL shall have a register to choose the notify type in case
319 			 of a conflict between the two settings.
320 */
321 
322 #define TCL_DATA_CMD_TX_NOTIFY_FRAME_OFFSET                                         0x00000008
323 #define TCL_DATA_CMD_TX_NOTIFY_FRAME_LSB                                            8
324 #define TCL_DATA_CMD_TX_NOTIFY_FRAME_MSB                                            10
325 #define TCL_DATA_CMD_TX_NOTIFY_FRAME_MASK                                           0x00000700
326 
327 
328 /* Description		HEADER_LENGTH_READ_SEL
329 
330 			This field is used to select the per 'encap_type' register
331 			 set for MSDU header read length.
332 			0: set 0 header read length register
333 			1: set 1 header read length register
334 			<legal all>
335 */
336 
337 #define TCL_DATA_CMD_HEADER_LENGTH_READ_SEL_OFFSET                                  0x00000008
338 #define TCL_DATA_CMD_HEADER_LENGTH_READ_SEL_LSB                                     11
339 #define TCL_DATA_CMD_HEADER_LENGTH_READ_SEL_MSB                                     11
340 #define TCL_DATA_CMD_HEADER_LENGTH_READ_SEL_MASK                                    0x00000800
341 
342 
343 /* Description		BUFFER_TIMESTAMP
344 
345 			Field only valid when 'Buffer_timestamp_valid ' is set.
346 
347 			Frame system entrance timestamp. The timestamp is related
348 			 to the global system timer
349 
350 			Generally the first module (SW, TCL or TQM). that sees this
351 			 frame and this timestamp field is not valid, shall fill
352 			 in this field.
353 
354 			Timestamp in units determined by the UMCMN 'TX_TIMESTAMP_RESOLUTION_SELECT'
355 			register
356 
357 			Waikiki v1 and Hamilton used units of 1024 us.
358 */
359 
360 #define TCL_DATA_CMD_BUFFER_TIMESTAMP_OFFSET                                        0x00000008
361 #define TCL_DATA_CMD_BUFFER_TIMESTAMP_LSB                                           12
362 #define TCL_DATA_CMD_BUFFER_TIMESTAMP_MSB                                           30
363 #define TCL_DATA_CMD_BUFFER_TIMESTAMP_MASK                                          0x7ffff000
364 
365 
366 /* Description		BUFFER_TIMESTAMP_VALID
367 
368 			When set, the Buffer_timestamp field contains valid info.
369 
370 */
371 
372 #define TCL_DATA_CMD_BUFFER_TIMESTAMP_VALID_OFFSET                                  0x00000008
373 #define TCL_DATA_CMD_BUFFER_TIMESTAMP_VALID_LSB                                     31
374 #define TCL_DATA_CMD_BUFFER_TIMESTAMP_VALID_MSB                                     31
375 #define TCL_DATA_CMD_BUFFER_TIMESTAMP_VALID_MASK                                    0x80000000
376 
377 
378 /* Description		RESERVED_3A
379 
380 			<legal 0>
381 */
382 
383 #define TCL_DATA_CMD_RESERVED_3A_OFFSET                                             0x0000000c
384 #define TCL_DATA_CMD_RESERVED_3A_LSB                                                0
385 #define TCL_DATA_CMD_RESERVED_3A_MSB                                                15
386 #define TCL_DATA_CMD_RESERVED_3A_MASK                                               0x0000ffff
387 
388 
389 /* Description		TCL_CMD_NUMBER
390 
391 			This number can be used by SW to track, identify and link
392 			 the created commands with the command statuses
393 
394 			Is set to the value 'TCL_CMD_Number' of the related TCL_DATA
395 			 command
396 			<legal all>
397 */
398 
399 #define TCL_DATA_CMD_TCL_CMD_NUMBER_OFFSET                                          0x0000000c
400 #define TCL_DATA_CMD_TCL_CMD_NUMBER_LSB                                             16
401 #define TCL_DATA_CMD_TCL_CMD_NUMBER_MSB                                             31
402 #define TCL_DATA_CMD_TCL_CMD_NUMBER_MASK                                            0xffff0000
403 
404 
405 /* Description		DATA_LENGTH
406 
407 			Valid Data length in bytes.
408 
409 			MSDU length in case of direct descriptor.
410 			Length of link extension descriptor in case of Link extension
411 			 descriptor. This is used to know the size of Metadata.
412 			<legal all>
413 */
414 
415 #define TCL_DATA_CMD_DATA_LENGTH_OFFSET                                             0x00000010
416 #define TCL_DATA_CMD_DATA_LENGTH_LSB                                                0
417 #define TCL_DATA_CMD_DATA_LENGTH_MSB                                                15
418 #define TCL_DATA_CMD_DATA_LENGTH_MASK                                               0x0000ffff
419 
420 
421 /* Description		IPV4_CHECKSUM_EN
422 
423 			OLE related control
424 			Enable IPv4 checksum replacement
425 */
426 
427 #define TCL_DATA_CMD_IPV4_CHECKSUM_EN_OFFSET                                        0x00000010
428 #define TCL_DATA_CMD_IPV4_CHECKSUM_EN_LSB                                           16
429 #define TCL_DATA_CMD_IPV4_CHECKSUM_EN_MSB                                           16
430 #define TCL_DATA_CMD_IPV4_CHECKSUM_EN_MASK                                          0x00010000
431 
432 
433 /* Description		UDP_OVER_IPV4_CHECKSUM_EN
434 
435 			OLE related control
436 			Enable UDP over IPv4 checksum replacement.  UDP checksum
437 			 over IPv4 is optional for TCP/IP stacks.
438 */
439 
440 #define TCL_DATA_CMD_UDP_OVER_IPV4_CHECKSUM_EN_OFFSET                               0x00000010
441 #define TCL_DATA_CMD_UDP_OVER_IPV4_CHECKSUM_EN_LSB                                  17
442 #define TCL_DATA_CMD_UDP_OVER_IPV4_CHECKSUM_EN_MSB                                  17
443 #define TCL_DATA_CMD_UDP_OVER_IPV4_CHECKSUM_EN_MASK                                 0x00020000
444 
445 
446 /* Description		UDP_OVER_IPV6_CHECKSUM_EN
447 
448 			OLE related control
449 			Enable UDP over IPv6 checksum replacement.  UDP checksum
450 			 over IPv6 is mandatory for TCP/IP stacks.
451 */
452 
453 #define TCL_DATA_CMD_UDP_OVER_IPV6_CHECKSUM_EN_OFFSET                               0x00000010
454 #define TCL_DATA_CMD_UDP_OVER_IPV6_CHECKSUM_EN_LSB                                  18
455 #define TCL_DATA_CMD_UDP_OVER_IPV6_CHECKSUM_EN_MSB                                  18
456 #define TCL_DATA_CMD_UDP_OVER_IPV6_CHECKSUM_EN_MASK                                 0x00040000
457 
458 
459 /* Description		TCP_OVER_IPV4_CHECKSUM_EN
460 
461 			OLE related control
462 			Enable TCP checksum over IPv4 replacement
463 */
464 
465 #define TCL_DATA_CMD_TCP_OVER_IPV4_CHECKSUM_EN_OFFSET                               0x00000010
466 #define TCL_DATA_CMD_TCP_OVER_IPV4_CHECKSUM_EN_LSB                                  19
467 #define TCL_DATA_CMD_TCP_OVER_IPV4_CHECKSUM_EN_MSB                                  19
468 #define TCL_DATA_CMD_TCP_OVER_IPV4_CHECKSUM_EN_MASK                                 0x00080000
469 
470 
471 /* Description		TCP_OVER_IPV6_CHECKSUM_EN
472 
473 			OLE related control
474 			Enable TCP checksum over IPv6 replacement
475 */
476 
477 #define TCL_DATA_CMD_TCP_OVER_IPV6_CHECKSUM_EN_OFFSET                               0x00000010
478 #define TCL_DATA_CMD_TCP_OVER_IPV6_CHECKSUM_EN_LSB                                  20
479 #define TCL_DATA_CMD_TCP_OVER_IPV6_CHECKSUM_EN_MSB                                  20
480 #define TCL_DATA_CMD_TCP_OVER_IPV6_CHECKSUM_EN_MASK                                 0x00100000
481 
482 
483 /* Description		TO_FW
484 
485 			Forward packet to FW along with classification result. The
486 			 packet will not be forward to TQM when this bit is set
487 
488 			1'b0: Use classification result to forward the packet.
489 			1'b1: Override classification result and forward packet
490 			only to FW.
491 			<legal all>
492 */
493 
494 #define TCL_DATA_CMD_TO_FW_OFFSET                                                   0x00000010
495 #define TCL_DATA_CMD_TO_FW_LSB                                                      21
496 #define TCL_DATA_CMD_TO_FW_MSB                                                      21
497 #define TCL_DATA_CMD_TO_FW_MASK                                                     0x00200000
498 
499 
500 /* Description		RESERVED_4A
501 
502 			<legal 0>
503 */
504 
505 #define TCL_DATA_CMD_RESERVED_4A_OFFSET                                             0x00000010
506 #define TCL_DATA_CMD_RESERVED_4A_LSB                                                22
507 #define TCL_DATA_CMD_RESERVED_4A_MSB                                                22
508 #define TCL_DATA_CMD_RESERVED_4A_MASK                                               0x00400000
509 
510 
511 /* Description		PACKET_OFFSET
512 
513 			Packet offset from Metadata in case of direct buffer descriptor.
514 			This field is valid when Buf_or_ext_desc_type is reset(=
515 			0).
516 			<legal all>
517 */
518 
519 #define TCL_DATA_CMD_PACKET_OFFSET_OFFSET                                           0x00000010
520 #define TCL_DATA_CMD_PACKET_OFFSET_LSB                                              23
521 #define TCL_DATA_CMD_PACKET_OFFSET_MSB                                              31
522 #define TCL_DATA_CMD_PACKET_OFFSET_MASK                                             0xff800000
523 
524 
525 /* Description		HLOS_TID_OVERWRITE
526 
527 			When set, TCL shall ignore the IP DSCP and VLAN PCP fields
528 			 and use HLOS_TID as the final TID. Otherwise TCL shall
529 			consider the DSCP and PCP fields as well as HLOS_TID and
530 			 choose a final TID based on the configured priority
531 			<legal all>
532 */
533 
534 #define TCL_DATA_CMD_HLOS_TID_OVERWRITE_OFFSET                                      0x00000014
535 #define TCL_DATA_CMD_HLOS_TID_OVERWRITE_LSB                                         0
536 #define TCL_DATA_CMD_HLOS_TID_OVERWRITE_MSB                                         0
537 #define TCL_DATA_CMD_HLOS_TID_OVERWRITE_MASK                                        0x00000001
538 
539 
540 /* Description		FLOW_OVERRIDE_ENABLE
541 
542 			TCL uses this to select the flow pointer from the peer table,
543 			which can be overridden by SW for pre-encrypted raw WiFi
544 			 packets that cannot be parsed for UDP or for other MLO
545 			or enterprise use cases:
546 			<enum 0 FP_PARSE_IP> Use the flow-pointer based on parsing
547 			 the IPv4 or IPv6 header.
548 			<enum 1 FP_USE_OVERRIDE> Use the who_classify_info_sel and
549 			 flow_override fields to select the flow-pointer.
550 			<legal all>
551 */
552 
553 #define TCL_DATA_CMD_FLOW_OVERRIDE_ENABLE_OFFSET                                    0x00000014
554 #define TCL_DATA_CMD_FLOW_OVERRIDE_ENABLE_LSB                                       1
555 #define TCL_DATA_CMD_FLOW_OVERRIDE_ENABLE_MSB                                       1
556 #define TCL_DATA_CMD_FLOW_OVERRIDE_ENABLE_MASK                                      0x00000002
557 
558 
559 /* Description		WHO_CLASSIFY_INFO_SEL
560 
561 			Field only valid when flow_override_enable is set to FP_USE_OVERRIDE.
562 
563 
564 			This field is used to select  one of the 'WHO_CLASSIFY_INFO's
565 			 in the peer table in case more than 2 flows are mapped
566 			to a single TID.
567 			0: To choose Flow 0 and 1 of any TID use this value.
568 			1: To choose Flow 2 and 3 of any TID use this value.
569 			2: To choose Flow 4 and 5 of any TID use this value.
570 			3: To choose Flow 6 and 7 of any TID use this value.
571 
572 			If who_classify_info sel is not in sync with the num_tx_classify_info
573 			 field from address search, then TCL will set 'who_classify_info_sel'
574 			to 0 use flows 0 and 1.
575 			<legal all>
576 */
577 
578 #define TCL_DATA_CMD_WHO_CLASSIFY_INFO_SEL_OFFSET                                   0x00000014
579 #define TCL_DATA_CMD_WHO_CLASSIFY_INFO_SEL_LSB                                      2
580 #define TCL_DATA_CMD_WHO_CLASSIFY_INFO_SEL_MSB                                      3
581 #define TCL_DATA_CMD_WHO_CLASSIFY_INFO_SEL_MASK                                     0x0000000c
582 
583 
584 /* Description		HLOS_TID
585 
586 			HLOS MSDU priority
587 
588 			Field is used when HLOS_TID_overwrite is set or flow_override_enable
589 			 is set to FP_USE_OVERRIDE.
590 
591 			Field is also used when HLOS_TID_overwrite is not set and
592 			 DSCP/PCP is not available in the packet.
593 			<legal all>
594 */
595 
596 #define TCL_DATA_CMD_HLOS_TID_OFFSET                                                0x00000014
597 #define TCL_DATA_CMD_HLOS_TID_LSB                                                   4
598 #define TCL_DATA_CMD_HLOS_TID_MSB                                                   7
599 #define TCL_DATA_CMD_HLOS_TID_MASK                                                  0x000000f0
600 
601 
602 /* Description		FLOW_OVERRIDE
603 
604 			Field only valid when flow_override_enable is set to FP_USE_OVERRIDE.
605 
606 
607 			TCL uses this to select the flow pointer from the peer table,
608 			which can be overridden by SW for pre-encrypted raw WiFi
609 			 packets that cannot be parsed for UDP or for other MLO
610 			or enterprise use cases:
611 			<enum 0 FP_USE_NON_UDP> Use the non-UDP flow pointer (flow
612 			 0)
613 			<enum 1 FP_USE_UDP> Use the UDP flow pointer (flow 1)
614 
615 			<legal all>
616 */
617 
618 #define TCL_DATA_CMD_FLOW_OVERRIDE_OFFSET                                           0x00000014
619 #define TCL_DATA_CMD_FLOW_OVERRIDE_LSB                                              8
620 #define TCL_DATA_CMD_FLOW_OVERRIDE_MSB                                              8
621 #define TCL_DATA_CMD_FLOW_OVERRIDE_MASK                                             0x00000100
622 
623 
624 /* Description		PMAC_ID
625 
626 			TCL uses this PMAC_ID in address search, i.e, while finding
627 			 matching entry for the packet in AST corresponding to given
628 			 PMAC_ID
629 			If PMAC ID is all 1s (=> value 3), it indicates wildcard
630 			 match for any PMAC
631 			<legal 0-3>
632 */
633 
634 #define TCL_DATA_CMD_PMAC_ID_OFFSET                                                 0x00000014
635 #define TCL_DATA_CMD_PMAC_ID_LSB                                                    9
636 #define TCL_DATA_CMD_PMAC_ID_MSB                                                    10
637 #define TCL_DATA_CMD_PMAC_ID_MASK                                                   0x00000600
638 
639 
640 /* Description		MSDU_COLOR
641 
642 			Consumer: TQM
643 			Producer: SW
644 
645 			TCL copies this value to 'TQM_ENTRANCE_RING' in the structure
646 			 'TX_MSDU_DETAILS' field msdu_color.
647 
648 			When set, TQM will check the color and choose the color
649 			based threshold with which it will decide if the MSDU has
650 			 to be dropped.
651 
652 			<enum 0 MSDU_COLORLESS> MSDUs which have no color and TQM
653 			 uses legacy drop thresholds for these MSDUs.
654 			<enum 1 MSDU_COLOR_GREEN>
655 			<enum 2 MSDU_COLOR_YELLOW>
656 			<enum 3 MSDU_COLOR_RED>
657 			<legal 0-3>
658 */
659 
660 #define TCL_DATA_CMD_MSDU_COLOR_OFFSET                                              0x00000014
661 #define TCL_DATA_CMD_MSDU_COLOR_LSB                                                 11
662 #define TCL_DATA_CMD_MSDU_COLOR_MSB                                                 12
663 #define TCL_DATA_CMD_MSDU_COLOR_MASK                                                0x00001800
664 
665 
666 /* Description		RESERVED_5A
667 
668 			<legal 0>
669 */
670 
671 #define TCL_DATA_CMD_RESERVED_5A_OFFSET                                             0x00000014
672 #define TCL_DATA_CMD_RESERVED_5A_LSB                                                13
673 #define TCL_DATA_CMD_RESERVED_5A_MSB                                                23
674 #define TCL_DATA_CMD_RESERVED_5A_MASK                                               0x00ffe000
675 
676 
677 /* Description		VDEV_ID
678 
679 			Virtual device ID to check against the address search entry
680 			 to avoid security issues from transmitting packets from
681 			 an incorrect virtual device
682 			<legal all>
683 */
684 
685 #define TCL_DATA_CMD_VDEV_ID_OFFSET                                                 0x00000014
686 #define TCL_DATA_CMD_VDEV_ID_LSB                                                    24
687 #define TCL_DATA_CMD_VDEV_ID_MSB                                                    31
688 #define TCL_DATA_CMD_VDEV_ID_MASK                                                   0xff000000
689 
690 
691 /* Description		SEARCH_INDEX
692 
693 			The index that will be used for index based address or flow
694 			 search. The field is valid when 'search_type' is  1 or
695 			2.
696 			<legal all>
697 */
698 
699 #define TCL_DATA_CMD_SEARCH_INDEX_OFFSET                                            0x00000018
700 #define TCL_DATA_CMD_SEARCH_INDEX_LSB                                               0
701 #define TCL_DATA_CMD_SEARCH_INDEX_MSB                                               19
702 #define TCL_DATA_CMD_SEARCH_INDEX_MASK                                              0x000fffff
703 
704 
705 /* Description		CACHE_SET_NUM
706 
707 			Cache set number that should be used to cache the index
708 			based search results, for address and flow search. This
709 			value should be equal to LSB four bits of the hash value
710 			 of match data, in case of search index points to an entry
711 			 which may be used in content based search also. The value
712 			 can be anything when the entry pointed by search index
713 			will not be used for content based search.
714 			<legal all>
715 */
716 
717 #define TCL_DATA_CMD_CACHE_SET_NUM_OFFSET                                           0x00000018
718 #define TCL_DATA_CMD_CACHE_SET_NUM_LSB                                              20
719 #define TCL_DATA_CMD_CACHE_SET_NUM_MSB                                              23
720 #define TCL_DATA_CMD_CACHE_SET_NUM_MASK                                             0x00f00000
721 
722 
723 /* Description		INDEX_LOOKUP_OVERRIDE
724 
725 			When set, address search and packet routing is forced to
726 			 use 'search_index' instead of following the register configuration
727 			 seleced by Bank_id.
728 			<legal all>
729 */
730 
731 #define TCL_DATA_CMD_INDEX_LOOKUP_OVERRIDE_OFFSET                                   0x00000018
732 #define TCL_DATA_CMD_INDEX_LOOKUP_OVERRIDE_LSB                                      24
733 #define TCL_DATA_CMD_INDEX_LOOKUP_OVERRIDE_MSB                                      24
734 #define TCL_DATA_CMD_INDEX_LOOKUP_OVERRIDE_MASK                                     0x01000000
735 
736 
737 /* Description		RESERVED_6A
738 
739 			<legal 0>
740 */
741 
742 #define TCL_DATA_CMD_RESERVED_6A_OFFSET                                             0x00000018
743 #define TCL_DATA_CMD_RESERVED_6A_LSB                                                25
744 #define TCL_DATA_CMD_RESERVED_6A_MSB                                                31
745 #define TCL_DATA_CMD_RESERVED_6A_MASK                                               0xfe000000
746 
747 
748 /* Description		RESERVED_7A
749 
750 			<legal 0>
751 */
752 
753 #define TCL_DATA_CMD_RESERVED_7A_OFFSET                                             0x0000001c
754 #define TCL_DATA_CMD_RESERVED_7A_LSB                                                0
755 #define TCL_DATA_CMD_RESERVED_7A_MSB                                                19
756 #define TCL_DATA_CMD_RESERVED_7A_MASK                                               0x000fffff
757 
758 
759 /* Description		RING_ID
760 
761 			The buffer pointer ring ID.
762 			0 refers to the IDLE ring
763 			1 - N refers to other rings
764 
765 			Helps with debugging when dumping ring contents.
766 			<legal all>
767 */
768 
769 #define TCL_DATA_CMD_RING_ID_OFFSET                                                 0x0000001c
770 #define TCL_DATA_CMD_RING_ID_LSB                                                    20
771 #define TCL_DATA_CMD_RING_ID_MSB                                                    27
772 #define TCL_DATA_CMD_RING_ID_MASK                                                   0x0ff00000
773 
774 
775 /* Description		LOOPING_COUNT
776 
777 			A count value that indicates the number of times the producer
778 			 of entries into the Ring has looped around the ring.
779 			At initialization time, this value is set to 0. On the first
780 			 loop, this value is set to 1. After the max value is reached
781 			 allowed by the number of bits for this field, the count
782 			 value continues with 0 again.
783 
784 			In case SW is the consumer of the ring entries, it can use
785 			 this field to figure out up to where the producer of entries
786 			 has created new entries. This eliminates the need to check
787 			 where the "head pointer' of the ring is located once the
788 			 SW starts processing an interrupt indicating that new entries
789 			 have been put into this ring...
790 
791 			Also note that SW if it wants only needs to look at the
792 			LSB bit of this count value.
793 			<legal all>
794 */
795 
796 #define TCL_DATA_CMD_LOOPING_COUNT_OFFSET                                           0x0000001c
797 #define TCL_DATA_CMD_LOOPING_COUNT_LSB                                              28
798 #define TCL_DATA_CMD_LOOPING_COUNT_MSB                                              31
799 #define TCL_DATA_CMD_LOOPING_COUNT_MASK                                             0xf0000000
800 
801 
802 
803 #endif   // TCL_DATA_CMD
804