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