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