1 /*
2  * Copyright (c) 2021 The Linux Foundation. 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 // $ATH_LICENSE_HW_HDR_C$
18 //
19 // DO NOT EDIT!  This file is automatically generated
20 //               These definitions are tied to a particular hardware layout
21 
22 
23 #ifndef _TCL_DATA_CMD_H_
24 #define _TCL_DATA_CMD_H_
25 #if !defined(__ASSEMBLER__)
26 #endif
27 
28 #include "buffer_addr_info.h"
29 
30 // ################ START SUMMARY #################
31 //
32 //	Dword	Fields
33 //	0-1	struct buffer_addr_info buf_addr_info;
34 //	2	buf_or_ext_desc_type[0], epd[1], encap_type[3:2], encrypt_type[7:4], src_buffer_swap[8], link_meta_swap[9], reserved_2a[11:10], search_type[13:12], addrx_en[14], addry_en[15], tcl_cmd_number[31:16]
35 //	3	data_length[15:0], ipv4_checksum_en[16], udp_over_ipv4_checksum_en[17], udp_over_ipv6_checksum_en[18], tcp_over_ipv4_checksum_en[19], tcp_over_ipv6_checksum_en[20], to_fw[21], reserved_3a[22], packet_offset[31:23]
36 //	4	buffer_timestamp[18:0], buffer_timestamp_valid[19], mesh_enable[20], hlos_tid_overwrite[21], hlos_tid[25:22], lmac_id[27:26], reserved_4[31:28]
37 //	5	dscp_tid_table_num[5:0], search_index[25:6], cache_set_num[29:26], reserved_5[31:30]
38 //	6	reserved_6a[19:0], ring_id[27:20], looping_count[31:28]
39 //
40 // ################ END SUMMARY #################
41 
42 #define NUM_OF_DWORDS_TCL_DATA_CMD 7
43 
44 struct tcl_data_cmd {
45     struct            buffer_addr_info                       buf_addr_info;
46              uint32_t buf_or_ext_desc_type            :  1, //[0]
47                       epd                             :  1, //[1]
48                       encap_type                      :  2, //[3:2]
49                       encrypt_type                    :  4, //[7:4]
50                       src_buffer_swap                 :  1, //[8]
51                       link_meta_swap                  :  1, //[9]
52                       reserved_2a                     :  2, //[11:10]
53                       search_type                     :  2, //[13:12]
54                       addrx_en                        :  1, //[14]
55                       addry_en                        :  1, //[15]
56                       tcl_cmd_number                  : 16; //[31:16]
57              uint32_t data_length                     : 16, //[15:0]
58                       ipv4_checksum_en                :  1, //[16]
59                       udp_over_ipv4_checksum_en       :  1, //[17]
60                       udp_over_ipv6_checksum_en       :  1, //[18]
61                       tcp_over_ipv4_checksum_en       :  1, //[19]
62                       tcp_over_ipv6_checksum_en       :  1, //[20]
63                       to_fw                           :  1, //[21]
64                       reserved_3a                     :  1, //[22]
65                       packet_offset                   :  9; //[31:23]
66              uint32_t buffer_timestamp                : 19, //[18:0]
67                       buffer_timestamp_valid          :  1, //[19]
68                       mesh_enable                     :  1, //[20]
69                       hlos_tid_overwrite              :  1, //[21]
70                       hlos_tid                        :  4, //[25:22]
71                       lmac_id                         :  2, //[27:26]
72                       reserved_4                      :  4; //[31:28]
73              uint32_t dscp_tid_table_num              :  6, //[5:0]
74                       search_index                    : 20, //[25:6]
75                       cache_set_num                   :  4, //[29:26]
76                       reserved_5                      :  2; //[31:30]
77              uint32_t reserved_6a                     : 20, //[19:0]
78                       ring_id                         :  8, //[27:20]
79                       looping_count                   :  4; //[31:28]
80 };
81 
82 /*
83 
84 struct buffer_addr_info buf_addr_info
85 
86 			Details of the physical address for a single buffer
87 
88 			It also contains return ownership info as well as some
89 			meta data for SW related to this buffer.
90 
91 
92 
93 			In case of Buf_or_ext_desc_type indicating
94 			'MSDU_buffer', this address indicates the start of the meta
95 			data that is preceding the actual packet data.
96 
97 			The start of the actual packet data is provided by
98 			field: Packet_offset
99 
100 buf_or_ext_desc_type
101 
102 			<enum 0 MSDU_buffer> The address points to an MSDU
103 			buffer.
104 
105 			<enum 1 extension_descriptor> The address points to an
106 			MSDU link extension descriptor
107 
108 			< legal all>
109 
110 epd
111 
112 			When this bit is set then input packet is an EPD type
113 
114 			<legal all>
115 
116 encap_type
117 
118 			Indicates the encapsulation that HW will perform:
119 
120 			<enum 0 RAW> No encapsulation
121 
122 			<enum 1 Native_WiFi>
123 
124 			<enum 2 Ethernet> Ethernet 2 (DIX)  or 802.3 (uses
125 			SNAP/LLC)
126 
127 			<enum 3 802_3> DO NOT USE. Indicate Ethernet
128 
129 
130 
131 			Used by the OLE during encapsulation.
132 
133 			<legal all>
134 
135 encrypt_type
136 
137 			Field only valid for encap_type: RAW
138 
139 
140 
141 			Indicates type of decrypt cipher used (as defined in the
142 			peer entry)
143 
144 			<enum 0 wep_40> WEP 40-bit
145 
146 			<enum 1 wep_104> WEP 104-bit
147 
148 			<enum 2 tkip_no_mic> TKIP without MIC
149 
150 			<enum 3 wep_128> WEP 128-bit
151 
152 			<enum 4 tkip_with_mic> TKIP with MIC
153 
154 			<enum 5 wapi> WAPI
155 
156 			<enum 6 aes_ccmp_128> AES CCMP 128
157 
158 			<enum 7 no_cipher> No crypto
159 
160 			<enum 8 aes_ccmp_256> AES CCMP 256
161 
162 			<enum 9 aes_gcmp_128> AES CCMP 128
163 
164 			<enum 10 aes_gcmp_256> AES CCMP 256
165 
166 			<enum 11 wapi_gcm_sm4> WAPI GCM SM4
167 
168 
169 
170 			<enum 12 wep_varied_width> DO not use... Only for higher
171 			layer modules..
172 
173 			<legal 0-12>
174 
175 src_buffer_swap
176 
177 			Treats source memory (packet buffer) organization as
178 			big-endian. The packets are read and byte swapped.
179 
180 			1'b0: Source memory is little endian
181 
182 			1'b1: Source memory is big endian
183 
184 			<legal all>
185 
186 link_meta_swap
187 
188 			Treats link descriptor and Metadata as big-endian. The
189 			link descriptor/Metadata is read and byte swapped.
190 
191 			1'b0: Memory is little endian
192 
193 			1'b1: Memory is big endian
194 
195 			<legal all>
196 
197 reserved_2a
198 
199 			<legal 0>
200 
201 search_type
202 
203 			Search type select
204 
205 
206 
207 			<enum 0 Normal_search> Address and flow search will use
208 			packet contents
209 
210 			<enum 1 Index_based_address_search> Address search will
211 
212 			<enum 2 Index_based_flow_search> Flow search will use
213 			'search_index', and address search will use packet contents
214 
215 			<legal 0-2>
216 
217 addrx_en
218 
219 			Address X search enable in ASE
220 
221 			1'b0: Search disable
222 
223 			1'b1: Search Enable
224 
225 			<legal all>
226 
227 addry_en
228 
229 			Address Y search enable in ASE
230 
231 			1'b0: Search disable
232 
233 			1'b1: Search Enable
234 
235 			<legal all>
236 
237 tcl_cmd_number
238 
239 			This number can be used by SW to track, identify and
240 			link the created commands with the command statuses
241 
242 
243 
244 			Is set to the value 'TCL_CMD_Number' of the related
245 			TCL_DATA command
246 
247 			<legal all>
248 
249 data_length
250 
251 			Valid Data length in bytes.
252 
253 
254 
255 			MSDU length in case of direct descriptor.
256 
257 			Length of link extension descriptor in case of Link
258 			extension descriptor. This is used to know the size of
259 			Metadata.
260 
261 			<legal all>
262 
263 ipv4_checksum_en
264 
265 			OLE related control
266 
267 			Enable IPv4 checksum replacement
268 
269 udp_over_ipv4_checksum_en
270 
271 			OLE related control
272 
273 			Enable UDP over IPv4 checksum replacement.  UDP checksum
274 			over IPv4 is optional for TCP/IP stacks.
275 
276 udp_over_ipv6_checksum_en
277 
278 			OLE related control
279 
280 			Enable UDP over IPv6 checksum replacement.  UDP checksum
281 			over IPv6 is mandatory for TCP/IP stacks.
282 
283 tcp_over_ipv4_checksum_en
284 
285 			OLE related control
286 
287 			Enable TCP checksum over IPv4 replacement
288 
289 tcp_over_ipv6_checksum_en
290 
291 			OLE related control
292 
293 			Enable TCP checksum over IPv6 replacement
294 
295 to_fw
296 
297 			Forward packet to FW along with classification result.
298 			The packet will not be forward to TQM when this bit is set
299 
300 
301 
302 			1'b0: Use classification result to forward the packet.
303 
304 			1'b1: Override classification result and forward packet
305 			only to FW.
306 
307 			<legal all>
308 
309 reserved_3a
310 
311 			<legal 0>
312 
313 packet_offset
314 
315 			Packet offset from Metadata in case of direct buffer
316 			descriptor. This field is valid when Buf_or_ext_desc_type is
317 			reset(= 0).
318 
319 			<legal all>
320 
321 buffer_timestamp
322 
323 			Field only valid when 'Buffer_timestamp_valid ' is set.
324 
325 
326 
327 			Frame system entrance timestamp. The timestamp is
328 			related to the global system timer
329 
330 
331 
332 			Generally the first module (SW, TCL or TQM). that sees
333 			this frame and this timestamp field is not valid, shall fill
334 			in this field.
335 
336 
337 
338 			Timestamp in units of 1024 us
339 
340 buffer_timestamp_valid
341 
342 			When set, the Buffer_timestamp field contains valid
343 			info.
344 
345 mesh_enable
346 
347 			If set to 1:
348 
349 			* For raw WiFi frames, this indicates transmission to a
350 			mesh STA, enabling the interpretation of the 'Mesh Control
351 			Present' bit (bit 8) of QoS Control (otherwise this bit is
352 			ignored),
353 
354 			* For native WiFi frames, this indicates that a 'Mesh
355 			Control' field is present between the header and the LLC.
356 
357 hlos_tid_overwrite
358 
359 			When set, TCL shall ignore the IP DSCP and VLAN PCP
360 			fields and use HLOS_TID as the final TID. Otherwise TCL
361 			shall consider the DSCP and PCP fields as well as HLOS_TID
362 			and choose a final TID based on the configured priority
363 
364 			<legal all>
365 
366 hlos_tid
367 
368 			HLOS MSDU priority
369 
370 
371 
372 			Field is used when HLOS_TID_overwrite is set.
373 
374 
375 
376 			Field is also used when HLOS_TID_overwrite is not set
377 			and DSCP/PCP is not available in the packet
378 
379 			<legal all>
380 
381 lmac_id
382 
383 			TCL uses this LMAC_ID in address search, i.e, while
384 			finding matching entry for the packet in AST corresponding
385 			to given LMAC_ID
386 
387 			If LMAC ID is all 1s (=> value 3), it indicates wildcard
388 			match for any MAC
389 
390 			<legal 0-3>
391 
392 reserved_4
393 
394 			<legal 0>
395 
396 dscp_tid_table_num
397 
398 			DSCP to TID mapping table number that need to be used
399 			for the MSDU, should be specified using this field
400 
401 			<legal all>
402 
403 search_index
404 
405 			The index that will be used for index based address or
406 			flow search. The field is valid when 'search_type' is  1 or
407 			2.
408 
409 			<legal all>
410 
411 cache_set_num
412 
413 			Cache set number that should be used to cache the index
414 			based search results, for address and flow search. This
415 			value should be equal to LSB four bits of the hash value of
416 			match data, in case of search index points to an entry which
417 			may be used in content based search also. The value can be
418 			anything when the entry pointed by search index will not be
419 			used for content based search.
420 
421 			<legal all>
422 
423 reserved_5
424 
425 			<legal 0>
426 
427 reserved_6a
428 
429 			<legal 0>
430 
431 ring_id
432 
433 			The buffer pointer ring ID.
434 
435 			0 refers to the IDLE ring
436 
437 			1 - N refers to other rings
438 
439 
440 
441 			Helps with debugging when dumping ring contents.
442 
443 			<legal all>
444 
445 looping_count
446 
447 			A count value that indicates the number of times the
448 			producer of entries into the Ring has looped around the
449 			ring.
450 
451 			At initialization time, this value is set to 0. On the
452 			first loop, this value is set to 1. After the max value is
453 			reached allowed by the number of bits for this field, the
454 			count value continues with 0 again.
455 
456 
457 
458 			In case SW is the consumer of the ring entries, it can
459 			use this field to figure out up to where the producer of
460 			entries has created new entries. This eliminates the need to
461 			check where the head pointer' of the ring is located once
462 			the SW starts processing an interrupt indicating that new
463 			entries have been put into this ring...
464 
465 
466 
467 			Also note that SW if it wants only needs to look at the
468 			LSB bit of this count value.
469 
470 			<legal all>
471 */
472 
473 
474  /* EXTERNAL REFERENCE : struct buffer_addr_info buf_addr_info */
475 
476 
477 /* Description		TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0
478 
479 			Address (lower 32 bits) of the MSDU buffer OR
480 			MSDU_EXTENSION descriptor OR Link Descriptor
481 
482 
483 
484 			In case of 'NULL' pointer, this field is set to 0
485 
486 			<legal all>
487 */
488 #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET         0x00000000
489 #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_LSB            0
490 #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MASK           0xffffffff
491 
492 /* Description		TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32
493 
494 			Address (upper 8 bits) of the MSDU buffer OR
495 			MSDU_EXTENSION descriptor OR Link Descriptor
496 
497 
498 
499 			In case of 'NULL' pointer, this field is set to 0
500 
501 			<legal all>
502 */
503 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET        0x00000004
504 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_LSB           0
505 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MASK          0x000000ff
506 
507 /* Description		TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER
508 
509 			Consumer: WBM
510 
511 			Producer: SW/FW
512 
513 
514 
515 			In case of 'NULL' pointer, this field is set to 0
516 
517 
518 
519 			Indicates to which buffer manager the buffer OR
520 			MSDU_EXTENSION descriptor OR link descriptor that is being
521 			pointed to shall be returned after the frame has been
522 			processed. It is used by WBM for routing purposes.
523 
524 
525 
526 			<enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
527 			to the WMB buffer idle list
528 
529 			<enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
530 			returned to the WMB idle link descriptor idle list
531 
532 			<enum 2 FW_BM> This buffer shall be returned to the FW
533 
534 			<enum 3 SW0_BM> This buffer shall be returned to the SW,
535 			ring 0
536 
537 			<enum 4 SW1_BM> This buffer shall be returned to the SW,
538 			ring 1
539 
540 			<enum 5 SW2_BM> This buffer shall be returned to the SW,
541 			ring 2
542 
543 			<enum 6 SW3_BM> This buffer shall be returned to the SW,
544 			ring 3
545 
546 			<enum 7 SW4_BM> This buffer shall be returned to the SW,
547 			ring 3
548 
549 
550 
551 			<legal all>
552 */
553 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET    0x00000004
554 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB       8
555 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK      0x00000700
556 
557 /* Description		TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE
558 
559 			Cookie field exclusively used by SW.
560 
561 
562 
563 			In case of 'NULL' pointer, this field is set to 0
564 
565 
566 
567 			HW ignores the contents, accept that it passes the
568 			programmed value on to other descriptors together with the
569 			physical address
570 
571 
572 
573 			Field can be used by SW to for example associate the
574 			buffers physical address with the virtual address
575 
576 			The bit definitions as used by SW are within SW HLD
577 			specification
578 
579 
580 
581 			NOTE:
582 
583 			The three most significant bits can have a special
584 			meaning in case this struct is embedded in a TX_MPDU_DETAILS
585 			STRUCT, and field transmit_bw_restriction is set
586 
587 
588 
589 			In case of NON punctured transmission:
590 
591 			Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
592 
593 			Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
594 
595 			Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
596 
597 			Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
598 
599 
600 
601 			In case of punctured transmission:
602 
603 			Sw_buffer_cookie[20:18] = 3'b000: pattern 0 only
604 
605 			Sw_buffer_cookie[20:18] = 3'b001: pattern 1 only
606 
607 			Sw_buffer_cookie[20:18] = 3'b010: pattern 2 only
608 
609 			Sw_buffer_cookie[20:18] = 3'b011: pattern 3 only
610 
611 			Sw_buffer_cookie[20:18] = 3'b100: pattern 4 only
612 
613 			Sw_buffer_cookie[20:18] = 3'b101: pattern 5 only
614 
615 			Sw_buffer_cookie[20:18] = 3'b110: pattern 6 only
616 
617 			Sw_buffer_cookie[20:18] = 3'b111: pattern 7 only
618 
619 
620 
621 			Note: a punctured transmission is indicated by the
622 			presence of TLV TX_PUNCTURE_SETUP embedded in the scheduler
623 			TLV
624 
625 
626 
627 			<legal all>
628 */
629 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET         0x00000004
630 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_LSB            11
631 #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MASK           0xfffff800
632 
633 /* Description		TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE
634 
635 			<enum 0 MSDU_buffer> The address points to an MSDU
636 			buffer.
637 
638 			<enum 1 extension_descriptor> The address points to an
639 			MSDU link extension descriptor
640 
641 			< legal all>
642 */
643 #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET                   0x00000008
644 #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB                      0
645 #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK                     0x00000001
646 
647 /* Description		TCL_DATA_CMD_2_EPD
648 
649 			When this bit is set then input packet is an EPD type
650 
651 			<legal all>
652 */
653 #define TCL_DATA_CMD_2_EPD_OFFSET                                    0x00000008
654 #define TCL_DATA_CMD_2_EPD_LSB                                       1
655 #define TCL_DATA_CMD_2_EPD_MASK                                      0x00000002
656 
657 /* Description		TCL_DATA_CMD_2_ENCAP_TYPE
658 
659 			Indicates the encapsulation that HW will perform:
660 
661 			<enum 0 RAW> No encapsulation
662 
663 			<enum 1 Native_WiFi>
664 
665 			<enum 2 Ethernet> Ethernet 2 (DIX)  or 802.3 (uses
666 			SNAP/LLC)
667 
668 			<enum 3 802_3> DO NOT USE. Indicate Ethernet
669 
670 
671 
672 			Used by the OLE during encapsulation.
673 
674 			<legal all>
675 */
676 #define TCL_DATA_CMD_2_ENCAP_TYPE_OFFSET                             0x00000008
677 #define TCL_DATA_CMD_2_ENCAP_TYPE_LSB                                2
678 #define TCL_DATA_CMD_2_ENCAP_TYPE_MASK                               0x0000000c
679 
680 /* Description		TCL_DATA_CMD_2_ENCRYPT_TYPE
681 
682 			Field only valid for encap_type: RAW
683 
684 
685 
686 			Indicates type of decrypt cipher used (as defined in the
687 			peer entry)
688 
689 			<enum 0 wep_40> WEP 40-bit
690 
691 			<enum 1 wep_104> WEP 104-bit
692 
693 			<enum 2 tkip_no_mic> TKIP without MIC
694 
695 			<enum 3 wep_128> WEP 128-bit
696 
697 			<enum 4 tkip_with_mic> TKIP with MIC
698 
699 			<enum 5 wapi> WAPI
700 
701 			<enum 6 aes_ccmp_128> AES CCMP 128
702 
703 			<enum 7 no_cipher> No crypto
704 
705 			<enum 8 aes_ccmp_256> AES CCMP 256
706 
707 			<enum 9 aes_gcmp_128> AES CCMP 128
708 
709 			<enum 10 aes_gcmp_256> AES CCMP 256
710 
711 			<enum 11 wapi_gcm_sm4> WAPI GCM SM4
712 
713 
714 
715 			<enum 12 wep_varied_width> DO not use... Only for higher
716 			layer modules..
717 
718 			<legal 0-12>
719 */
720 #define TCL_DATA_CMD_2_ENCRYPT_TYPE_OFFSET                           0x00000008
721 #define TCL_DATA_CMD_2_ENCRYPT_TYPE_LSB                              4
722 #define TCL_DATA_CMD_2_ENCRYPT_TYPE_MASK                             0x000000f0
723 
724 /* Description		TCL_DATA_CMD_2_SRC_BUFFER_SWAP
725 
726 			Treats source memory (packet buffer) organization as
727 			big-endian. The packets are read and byte swapped.
728 
729 			1'b0: Source memory is little endian
730 
731 			1'b1: Source memory is big endian
732 
733 			<legal all>
734 */
735 #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_OFFSET                        0x00000008
736 #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_LSB                           8
737 #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_MASK                          0x00000100
738 
739 /* Description		TCL_DATA_CMD_2_LINK_META_SWAP
740 
741 			Treats link descriptor and Metadata as big-endian. The
742 			link descriptor/Metadata is read and byte swapped.
743 
744 			1'b0: Memory is little endian
745 
746 			1'b1: Memory is big endian
747 
748 			<legal all>
749 */
750 #define TCL_DATA_CMD_2_LINK_META_SWAP_OFFSET                         0x00000008
751 #define TCL_DATA_CMD_2_LINK_META_SWAP_LSB                            9
752 #define TCL_DATA_CMD_2_LINK_META_SWAP_MASK                           0x00000200
753 
754 /* Description		TCL_DATA_CMD_2_RESERVED_2A
755 
756 			<legal 0>
757 */
758 #define TCL_DATA_CMD_2_RESERVED_2A_OFFSET                            0x00000008
759 #define TCL_DATA_CMD_2_RESERVED_2A_LSB                               10
760 #define TCL_DATA_CMD_2_RESERVED_2A_MASK                              0x00000c00
761 
762 /* Description		TCL_DATA_CMD_2_SEARCH_TYPE
763 
764 			Search type select
765 
766 
767 
768 			<enum 0 Normal_search> Address and flow search will use
769 			packet contents
770 
771 			<enum 1 Index_based_address_search> Address search will
772 
773 			<enum 2 Index_based_flow_search> Flow search will use
774 			'search_index', and address search will use packet contents
775 
776 			<legal 0-2>
777 */
778 #define TCL_DATA_CMD_2_SEARCH_TYPE_OFFSET                            0x00000008
779 #define TCL_DATA_CMD_2_SEARCH_TYPE_LSB                               12
780 #define TCL_DATA_CMD_2_SEARCH_TYPE_MASK                              0x00003000
781 
782 /* Description		TCL_DATA_CMD_2_ADDRX_EN
783 
784 			Address X search enable in ASE
785 
786 			1'b0: Search disable
787 
788 			1'b1: Search Enable
789 
790 			<legal all>
791 */
792 #define TCL_DATA_CMD_2_ADDRX_EN_OFFSET                               0x00000008
793 #define TCL_DATA_CMD_2_ADDRX_EN_LSB                                  14
794 #define TCL_DATA_CMD_2_ADDRX_EN_MASK                                 0x00004000
795 
796 /* Description		TCL_DATA_CMD_2_ADDRY_EN
797 
798 			Address Y search enable in ASE
799 
800 			1'b0: Search disable
801 
802 			1'b1: Search Enable
803 
804 			<legal all>
805 */
806 #define TCL_DATA_CMD_2_ADDRY_EN_OFFSET                               0x00000008
807 #define TCL_DATA_CMD_2_ADDRY_EN_LSB                                  15
808 #define TCL_DATA_CMD_2_ADDRY_EN_MASK                                 0x00008000
809 
810 /* Description		TCL_DATA_CMD_2_TCL_CMD_NUMBER
811 
812 			This number can be used by SW to track, identify and
813 			link the created commands with the command statuses
814 
815 
816 
817 			Is set to the value 'TCL_CMD_Number' of the related
818 			TCL_DATA command
819 
820 			<legal all>
821 */
822 #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_OFFSET                         0x00000008
823 #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_LSB                            16
824 #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_MASK                           0xffff0000
825 
826 /* Description		TCL_DATA_CMD_3_DATA_LENGTH
827 
828 			Valid Data length in bytes.
829 
830 
831 
832 			MSDU length in case of direct descriptor.
833 
834 			Length of link extension descriptor in case of Link
835 			extension descriptor. This is used to know the size of
836 			Metadata.
837 
838 			<legal all>
839 */
840 #define TCL_DATA_CMD_3_DATA_LENGTH_OFFSET                            0x0000000c
841 #define TCL_DATA_CMD_3_DATA_LENGTH_LSB                               0
842 #define TCL_DATA_CMD_3_DATA_LENGTH_MASK                              0x0000ffff
843 
844 /* Description		TCL_DATA_CMD_3_IPV4_CHECKSUM_EN
845 
846 			OLE related control
847 
848 			Enable IPv4 checksum replacement
849 */
850 #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_OFFSET                       0x0000000c
851 #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_LSB                          16
852 #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_MASK                         0x00010000
853 
854 /* Description		TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN
855 
856 			OLE related control
857 
858 			Enable UDP over IPv4 checksum replacement.  UDP checksum
859 			over IPv4 is optional for TCP/IP stacks.
860 */
861 #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_OFFSET              0x0000000c
862 #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_LSB                 17
863 #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_MASK                0x00020000
864 
865 /* Description		TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN
866 
867 			OLE related control
868 
869 			Enable UDP over IPv6 checksum replacement.  UDP checksum
870 			over IPv6 is mandatory for TCP/IP stacks.
871 */
872 #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_OFFSET              0x0000000c
873 #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_LSB                 18
874 #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_MASK                0x00040000
875 
876 /* Description		TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN
877 
878 			OLE related control
879 
880 			Enable TCP checksum over IPv4 replacement
881 */
882 #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_OFFSET              0x0000000c
883 #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_LSB                 19
884 #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_MASK                0x00080000
885 
886 /* Description		TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN
887 
888 			OLE related control
889 
890 			Enable TCP checksum over IPv6 replacement
891 */
892 #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_OFFSET              0x0000000c
893 #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_LSB                 20
894 #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_MASK                0x00100000
895 
896 /* Description		TCL_DATA_CMD_3_TO_FW
897 
898 			Forward packet to FW along with classification result.
899 			The packet will not be forward to TQM when this bit is set
900 
901 
902 
903 			1'b0: Use classification result to forward the packet.
904 
905 			1'b1: Override classification result and forward packet
906 			only to FW.
907 
908 			<legal all>
909 */
910 #define TCL_DATA_CMD_3_TO_FW_OFFSET                                  0x0000000c
911 #define TCL_DATA_CMD_3_TO_FW_LSB                                     21
912 #define TCL_DATA_CMD_3_TO_FW_MASK                                    0x00200000
913 
914 /* Description		TCL_DATA_CMD_3_RESERVED_3A
915 
916 			<legal 0>
917 */
918 #define TCL_DATA_CMD_3_RESERVED_3A_OFFSET                            0x0000000c
919 #define TCL_DATA_CMD_3_RESERVED_3A_LSB                               22
920 #define TCL_DATA_CMD_3_RESERVED_3A_MASK                              0x00400000
921 
922 /* Description		TCL_DATA_CMD_3_PACKET_OFFSET
923 
924 			Packet offset from Metadata in case of direct buffer
925 			descriptor. This field is valid when Buf_or_ext_desc_type is
926 			reset(= 0).
927 
928 			<legal all>
929 */
930 #define TCL_DATA_CMD_3_PACKET_OFFSET_OFFSET                          0x0000000c
931 #define TCL_DATA_CMD_3_PACKET_OFFSET_LSB                             23
932 #define TCL_DATA_CMD_3_PACKET_OFFSET_MASK                            0xff800000
933 
934 /* Description		TCL_DATA_CMD_4_BUFFER_TIMESTAMP
935 
936 			Field only valid when 'Buffer_timestamp_valid ' is set.
937 
938 
939 
940 			Frame system entrance timestamp. The timestamp is
941 			related to the global system timer
942 
943 
944 
945 			Generally the first module (SW, TCL or TQM). that sees
946 			this frame and this timestamp field is not valid, shall fill
947 			in this field.
948 
949 
950 
951 			Timestamp in units of 1024 us
952 */
953 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_OFFSET                       0x00000010
954 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_LSB                          0
955 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_MASK                         0x0007ffff
956 
957 /* Description		TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID
958 
959 			When set, the Buffer_timestamp field contains valid
960 			info.
961 */
962 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_OFFSET                 0x00000010
963 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_LSB                    19
964 #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_MASK                   0x00080000
965 
966 /* Description		TCL_DATA_CMD_4_MESH_ENABLE
967 
968 			If set to 1:
969 
970 			* For raw WiFi frames, this indicates transmission to a
971 			mesh STA, enabling the interpretation of the 'Mesh Control
972 			Present' bit (bit 8) of QoS Control (otherwise this bit is
973 			ignored),
974 
975 			* For native WiFi frames, this indicates that a 'Mesh
976 			Control' field is present between the header and the LLC.
977 */
978 #define TCL_DATA_CMD_4_MESH_ENABLE_OFFSET                            0x00000010
979 #define TCL_DATA_CMD_4_MESH_ENABLE_LSB                               20
980 #define TCL_DATA_CMD_4_MESH_ENABLE_MASK                              0x00100000
981 
982 /* Description		TCL_DATA_CMD_4_HLOS_TID_OVERWRITE
983 
984 			When set, TCL shall ignore the IP DSCP and VLAN PCP
985 			fields and use HLOS_TID as the final TID. Otherwise TCL
986 			shall consider the DSCP and PCP fields as well as HLOS_TID
987 			and choose a final TID based on the configured priority
988 
989 			<legal all>
990 */
991 #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_OFFSET                     0x00000010
992 #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_LSB                        21
993 #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_MASK                       0x00200000
994 
995 /* Description		TCL_DATA_CMD_4_HLOS_TID
996 
997 			HLOS MSDU priority
998 
999 
1000 
1001 			Field is used when HLOS_TID_overwrite is set.
1002 
1003 
1004 
1005 			Field is also used when HLOS_TID_overwrite is not set
1006 			and DSCP/PCP is not available in the packet
1007 
1008 			<legal all>
1009 */
1010 #define TCL_DATA_CMD_4_HLOS_TID_OFFSET                               0x00000010
1011 #define TCL_DATA_CMD_4_HLOS_TID_LSB                                  22
1012 #define TCL_DATA_CMD_4_HLOS_TID_MASK                                 0x03c00000
1013 
1014 /* Description		TCL_DATA_CMD_4_LMAC_ID
1015 
1016 			TCL uses this LMAC_ID in address search, i.e, while
1017 			finding matching entry for the packet in AST corresponding
1018 			to given LMAC_ID
1019 
1020 			If LMAC ID is all 1s (=> value 3), it indicates wildcard
1021 			match for any MAC
1022 
1023 			<legal 0-3>
1024 */
1025 #define TCL_DATA_CMD_4_LMAC_ID_OFFSET                                0x00000010
1026 #define TCL_DATA_CMD_4_LMAC_ID_LSB                                   26
1027 #define TCL_DATA_CMD_4_LMAC_ID_MASK                                  0x0c000000
1028 
1029 /* Description		TCL_DATA_CMD_4_RESERVED_4
1030 
1031 			<legal 0>
1032 */
1033 #define TCL_DATA_CMD_4_RESERVED_4_OFFSET                             0x00000010
1034 #define TCL_DATA_CMD_4_RESERVED_4_LSB                                28
1035 #define TCL_DATA_CMD_4_RESERVED_4_MASK                               0xf0000000
1036 
1037 /* Description		TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM
1038 
1039 			DSCP to TID mapping table number that need to be used
1040 			for the MSDU, should be specified using this field
1041 
1042 			<legal all>
1043 */
1044 #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_OFFSET                     0x00000014
1045 #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_LSB                        0
1046 #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_MASK                       0x0000003f
1047 
1048 /* Description		TCL_DATA_CMD_5_SEARCH_INDEX
1049 
1050 			The index that will be used for index based address or
1051 			flow search. The field is valid when 'search_type' is  1 or
1052 			2.
1053 
1054 			<legal all>
1055 */
1056 #define TCL_DATA_CMD_5_SEARCH_INDEX_OFFSET                           0x00000014
1057 #define TCL_DATA_CMD_5_SEARCH_INDEX_LSB                              6
1058 #define TCL_DATA_CMD_5_SEARCH_INDEX_MASK                             0x03ffffc0
1059 
1060 /* Description		TCL_DATA_CMD_5_CACHE_SET_NUM
1061 
1062 			Cache set number that should be used to cache the index
1063 			based search results, for address and flow search. This
1064 			value should be equal to LSB four bits of the hash value of
1065 			match data, in case of search index points to an entry which
1066 			may be used in content based search also. The value can be
1067 			anything when the entry pointed by search index will not be
1068 			used for content based search.
1069 
1070 			<legal all>
1071 */
1072 #define TCL_DATA_CMD_5_CACHE_SET_NUM_OFFSET                          0x00000014
1073 #define TCL_DATA_CMD_5_CACHE_SET_NUM_LSB                             26
1074 #define TCL_DATA_CMD_5_CACHE_SET_NUM_MASK                            0x3c000000
1075 
1076 /* Description		TCL_DATA_CMD_5_RESERVED_5
1077 
1078 			<legal 0>
1079 */
1080 #define TCL_DATA_CMD_5_RESERVED_5_OFFSET                             0x00000014
1081 #define TCL_DATA_CMD_5_RESERVED_5_LSB                                30
1082 #define TCL_DATA_CMD_5_RESERVED_5_MASK                               0xc0000000
1083 
1084 /* Description		TCL_DATA_CMD_6_RESERVED_6A
1085 
1086 			<legal 0>
1087 */
1088 #define TCL_DATA_CMD_6_RESERVED_6A_OFFSET                            0x00000018
1089 #define TCL_DATA_CMD_6_RESERVED_6A_LSB                               0
1090 #define TCL_DATA_CMD_6_RESERVED_6A_MASK                              0x000fffff
1091 
1092 /* Description		TCL_DATA_CMD_6_RING_ID
1093 
1094 			The buffer pointer ring ID.
1095 
1096 			0 refers to the IDLE ring
1097 
1098 			1 - N refers to other rings
1099 
1100 
1101 
1102 			Helps with debugging when dumping ring contents.
1103 
1104 			<legal all>
1105 */
1106 #define TCL_DATA_CMD_6_RING_ID_OFFSET                                0x00000018
1107 #define TCL_DATA_CMD_6_RING_ID_LSB                                   20
1108 #define TCL_DATA_CMD_6_RING_ID_MASK                                  0x0ff00000
1109 
1110 /* Description		TCL_DATA_CMD_6_LOOPING_COUNT
1111 
1112 			A count value that indicates the number of times the
1113 			producer of entries into the Ring has looped around the
1114 			ring.
1115 
1116 			At initialization time, this value is set to 0. On the
1117 			first loop, this value is set to 1. After the max value is
1118 			reached allowed by the number of bits for this field, the
1119 			count value continues with 0 again.
1120 
1121 
1122 
1123 			In case SW is the consumer of the ring entries, it can
1124 			use this field to figure out up to where the producer of
1125 			entries has created new entries. This eliminates the need to
1126 			check where the head pointer' of the ring is located once
1127 			the SW starts processing an interrupt indicating that new
1128 			entries have been put into this ring...
1129 
1130 
1131 
1132 			Also note that SW if it wants only needs to look at the
1133 			LSB bit of this count value.
1134 
1135 			<legal all>
1136 */
1137 #define TCL_DATA_CMD_6_LOOPING_COUNT_OFFSET                          0x00000018
1138 #define TCL_DATA_CMD_6_LOOPING_COUNT_LSB                             28
1139 #define TCL_DATA_CMD_6_LOOPING_COUNT_MASK                            0xf0000000
1140 
1141 
1142 #endif // _TCL_DATA_CMD_H_
1143