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