tcl_data_cmd.h 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. /*
  2. * Copyright (c) 2020, 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. #ifndef _TCL_DATA_CMD_H_
  17. #define _TCL_DATA_CMD_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. #include "buffer_addr_info.h"
  21. // ################ START SUMMARY #################
  22. //
  23. // Dword Fields
  24. // 0-1 struct buffer_addr_info buf_addr_info;
  25. // 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]
  26. // 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]
  27. // 4 buffer_timestamp[18:0], buffer_timestamp_valid[19], reserved_4a[20], hlos_tid_overwrite[21], hlos_tid[25:22], lmac_id[27:26], udp_flow_override[29:28], reserved_4b[31:30]
  28. // 5 dscp_tid_table_num[5:0], search_index[25:6], cache_set_num[29:26], mesh_enable[31:30]
  29. // 6 reserved_6a[19:0], ring_id[27:20], looping_count[31:28]
  30. //
  31. // ################ END SUMMARY #################
  32. #define NUM_OF_DWORDS_TCL_DATA_CMD 7
  33. struct tcl_data_cmd {
  34. struct buffer_addr_info buf_addr_info;
  35. uint32_t buf_or_ext_desc_type : 1, //[0]
  36. epd : 1, //[1]
  37. encap_type : 2, //[3:2]
  38. encrypt_type : 4, //[7:4]
  39. src_buffer_swap : 1, //[8]
  40. link_meta_swap : 1, //[9]
  41. tqm_no_drop : 1, //[10]
  42. reserved_2a : 1, //[11]
  43. search_type : 2, //[13:12]
  44. addrx_en : 1, //[14]
  45. addry_en : 1, //[15]
  46. tcl_cmd_number : 16; //[31:16]
  47. uint32_t data_length : 16, //[15:0]
  48. ipv4_checksum_en : 1, //[16]
  49. udp_over_ipv4_checksum_en : 1, //[17]
  50. udp_over_ipv6_checksum_en : 1, //[18]
  51. tcp_over_ipv4_checksum_en : 1, //[19]
  52. tcp_over_ipv6_checksum_en : 1, //[20]
  53. to_fw : 1, //[21]
  54. reserved_3a : 1, //[22]
  55. packet_offset : 9; //[31:23]
  56. uint32_t buffer_timestamp : 19, //[18:0]
  57. buffer_timestamp_valid : 1, //[19]
  58. reserved_4a : 1, //[20]
  59. hlos_tid_overwrite : 1, //[21]
  60. hlos_tid : 4, //[25:22]
  61. lmac_id : 2, //[27:26]
  62. udp_flow_override : 2, //[29:28]
  63. reserved_4b : 2; //[31:30]
  64. uint32_t dscp_tid_table_num : 6, //[5:0]
  65. search_index : 20, //[25:6]
  66. cache_set_num : 4, //[29:26]
  67. mesh_enable : 2; //[31:30]
  68. uint32_t reserved_6a : 20, //[19:0]
  69. ring_id : 8, //[27:20]
  70. looping_count : 4; //[31:28]
  71. };
  72. /*
  73. struct buffer_addr_info buf_addr_info
  74. Details of the physical address for a single buffer
  75. It also contains return ownership info as well as some
  76. meta data for SW related to this buffer.
  77. In case of Buf_or_ext_desc_type indicating
  78. 'MSDU_buffer', this address indicates the start of the meta
  79. data that is preceding the actual packet data.
  80. The start of the actual packet data is provided by
  81. field: Packet_offset
  82. buf_or_ext_desc_type
  83. <enum 0 MSDU_buffer> The address points to an MSDU
  84. buffer.
  85. <enum 1 extension_descriptor> The address points to an
  86. MSDU link extension descriptor
  87. < legal all>
  88. epd
  89. When this bit is set then input packet is an EPD type
  90. <legal all>
  91. encap_type
  92. Indicates the encapsulation that HW will perform:
  93. <enum 0 RAW> No encapsulation
  94. <enum 1 Native_WiFi>
  95. <enum 2 Ethernet> Ethernet 2 (DIX) or 802.3 (uses
  96. SNAP/LLC)
  97. <enum 3 802_3> DO NOT USE. Indicate Ethernet
  98. Used by the OLE during encapsulation.
  99. <legal all>
  100. encrypt_type
  101. Field only valid for encap_type: RAW
  102. Indicates type of decrypt cipher used (as defined in the
  103. peer entry)
  104. <enum 0 wep_40> WEP 40-bit
  105. <enum 1 wep_104> WEP 104-bit
  106. <enum 2 tkip_no_mic> TKIP without MIC
  107. <enum 3 wep_128> WEP 128-bit
  108. <enum 4 tkip_with_mic> TKIP with MIC
  109. <enum 5 wapi> WAPI
  110. <enum 6 aes_ccmp_128> AES CCMP 128
  111. <enum 7 no_cipher> No crypto
  112. <enum 8 aes_ccmp_256> AES CCMP 256
  113. <enum 9 aes_gcmp_128> AES CCMP 128
  114. <enum 10 aes_gcmp_256> AES CCMP 256
  115. <enum 11 wapi_gcm_sm4> WAPI GCM SM4
  116. <enum 12 wep_varied_width> DO not use... Only for higher
  117. layer modules..
  118. <legal 0-12>
  119. src_buffer_swap
  120. Treats source memory (packet buffer) organization as
  121. big-endian. The packets are read and byte swapped.
  122. 1'b0: Source memory is little endian
  123. 1'b1: Source memory is big endian
  124. <legal all>
  125. link_meta_swap
  126. Treats link descriptor and Metadata as big-endian. The
  127. link descriptor/Metadata is read and byte swapped.
  128. 1'b0: Memory is little endian
  129. 1'b1: Memory is big endian
  130. <legal all>
  131. tqm_no_drop
  132. This bit is used to stop TQM from dropping MSDUs while
  133. adding them to MSDU flows1'b1: Do not drop MSDU when any of
  134. the threshold value is met while adding MSDU in a flow1'b1:
  135. Drop MSDU when any of the threshold value is met while
  136. adding MSDU in a flow
  137. <legal all>
  138. reserved_2a
  139. <legal 0>
  140. search_type
  141. Search type select
  142. <enum 0 Normal_search> Address and flow search will use
  143. packet contents
  144. <enum 1 Index_based_address_search> Address search will
  145. <enum 2 Index_based_flow_search> Flow search will use
  146. 'search_index', and address search will use packet contents
  147. <legal 0-2>
  148. addrx_en
  149. Address X search enable in ASE
  150. 1'b0: Search disable
  151. 1'b1: Search Enable
  152. <legal all>
  153. addry_en
  154. Address Y search enable in ASE
  155. 1'b0: Search disable
  156. 1'b1: Search Enable
  157. <legal all>
  158. tcl_cmd_number
  159. This number can be used by SW to track, identify and
  160. link the created commands with the command statuses
  161. Is set to the value 'TCL_CMD_Number' of the related
  162. TCL_DATA command
  163. <legal all>
  164. data_length
  165. Valid Data length in bytes.
  166. MSDU length in case of direct descriptor.
  167. Length of link extension descriptor in case of Link
  168. extension descriptor. This is used to know the size of
  169. Metadata.
  170. <legal all>
  171. ipv4_checksum_en
  172. OLE related control
  173. Enable IPv4 checksum replacement
  174. udp_over_ipv4_checksum_en
  175. OLE related control
  176. Enable UDP over IPv4 checksum replacement. UDP checksum
  177. over IPv4 is optional for TCP/IP stacks.
  178. udp_over_ipv6_checksum_en
  179. OLE related control
  180. Enable UDP over IPv6 checksum replacement. UDP checksum
  181. over IPv6 is mandatory for TCP/IP stacks.
  182. tcp_over_ipv4_checksum_en
  183. OLE related control
  184. Enable TCP checksum over IPv4 replacement
  185. tcp_over_ipv6_checksum_en
  186. OLE related control
  187. Enable TCP checksum over IPv6 replacement
  188. to_fw
  189. Forward packet to FW along with classification result.
  190. The packet will not be forward to TQM when this bit is set
  191. 1'b0: Use classification result to forward the packet.
  192. 1'b1: Override classification result and forward packet
  193. only to FW.
  194. <legal all>
  195. reserved_3a
  196. <legal 0>
  197. packet_offset
  198. Packet offset from Metadata in case of direct buffer
  199. descriptor. This field is valid when Buf_or_ext_desc_type is
  200. reset(= 0).
  201. <legal all>
  202. buffer_timestamp
  203. Field only valid when 'Buffer_timestamp_valid ' is set.
  204. Frame system entrance timestamp. The timestamp is
  205. related to the global system timer
  206. Generally the first module (SW, TCL or TQM). that sees
  207. this frame and this timestamp field is not valid, shall fill
  208. in this field.
  209. Timestamp in units of 1024 us
  210. buffer_timestamp_valid
  211. When set, the Buffer_timestamp field contains valid
  212. info.
  213. reserved_4a
  214. <legal 0>
  215. hlos_tid_overwrite
  216. When set, TCL shall ignore the IP DSCP and VLAN PCP
  217. fields and use HLOS_TID as the final TID. Otherwise TCL
  218. shall consider the DSCP and PCP fields as well as HLOS_TID
  219. and choose a final TID based on the configured priority
  220. <legal all>
  221. hlos_tid
  222. HLOS MSDU priority
  223. Field is used when HLOS_TID_overwrite is set.
  224. Field is also used when HLOS_TID_overwrite is not set
  225. and DSCP/PCP is not available in the packet
  226. <legal all>
  227. lmac_id
  228. TCL uses this LMAC_ID in address search, i.e, while
  229. finding matching entry for the packet in AST corresponding
  230. to given LMAC_ID
  231. If LMAC ID is all 1s (=> value 3), it indicates wildcard
  232. match for any MAC
  233. <legal 0-3>
  234. udp_flow_override
  235. TCL uses this to select the flow pointer from the peer
  236. table, which can be overridden by SW for pre-encrypted raw
  237. WiFi packets that cannot be parsed for UDP or for other
  238. enterprise use cases:
  239. <enum 0 FP_PARSE_IP> Use the flow-pointer based on
  240. parsing the IPv4 or IPv6 header
  241. <enum 1 FP_USE_NON_UDP> Use the non-UDP flow pointer
  242. <enum 2 FP_USE_UDP> Use the UDP flow pointer
  243. This is not supported in Moselle.
  244. <legal 0-2>
  245. reserved_4b
  246. <legal 0>
  247. dscp_tid_table_num
  248. DSCP to TID mapping table number that need to be used
  249. for the MSDU, should be specified using this field
  250. <legal all>
  251. search_index
  252. The index that will be used for index based address or
  253. flow search. The field is valid when 'search_type' is 1 or
  254. 2.
  255. <legal all>
  256. cache_set_num
  257. Cache set number that should be used to cache the index
  258. based search results, for address and flow search. This
  259. value should be equal to LSB four bits of the hash value of
  260. match data, in case of search index points to an entry which
  261. may be used in content based search also. The value can be
  262. anything when the entry pointed by search index will not be
  263. used for content based search.
  264. <legal all>
  265. mesh_enable
  266. If set to a non-zero value:
  267. * For raw WiFi frames, this indicates transmission to a
  268. mesh STA, enabling the interpretation of the 'Mesh Control
  269. Present' bit (bit 8) of QoS Control (otherwise this bit is
  270. ignored). The interpretation of the A-MSDU 'Length' field is
  271. decided by the e-numerations below.
  272. * For native WiFi frames, this indicates that a 'Mesh
  273. Control' field is present between the header and the LLC.
  274. The three non-zero values are interchangeable.
  275. <enum 0 MESH_DISABLE>
  276. <enum 1 MESH_Q2Q> A-MSDU 'Length' is big endian and
  277. includes the length of Mesh Control.
  278. <enum 2 MESH_11S_BE> A-MSDU 'Length' is big endian and
  279. excludes the length of Mesh Control.
  280. <enum 3 MESH_11S_LE> A-MSDU 'Length' is little endian
  281. and excludes the length of Mesh Control. This is
  282. 802.11s-compliant.
  283. <legal 0-3>
  284. reserved_6a
  285. <legal 0>
  286. ring_id
  287. The buffer pointer ring ID.
  288. 0 refers to the IDLE ring
  289. 1 - N refers to other rings
  290. Helps with debugging when dumping ring contents.
  291. <legal all>
  292. looping_count
  293. A count value that indicates the number of times the
  294. producer of entries into the Ring has looped around the
  295. ring.
  296. At initialization time, this value is set to 0. On the
  297. first loop, this value is set to 1. After the max value is
  298. reached allowed by the number of bits for this field, the
  299. count value continues with 0 again.
  300. In case SW is the consumer of the ring entries, it can
  301. use this field to figure out up to where the producer of
  302. entries has created new entries. This eliminates the need to
  303. check where the head pointer' of the ring is located once
  304. the SW starts processing an interrupt indicating that new
  305. entries have been put into this ring...
  306. Also note that SW if it wants only needs to look at the
  307. LSB bit of this count value.
  308. <legal all>
  309. */
  310. /* EXTERNAL REFERENCE : struct buffer_addr_info buf_addr_info */
  311. /* Description TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0
  312. Address (lower 32 bits) of the MSDU buffer OR
  313. MSDU_EXTENSION descriptor OR Link Descriptor
  314. In case of 'NULL' pointer, this field is set to 0
  315. <legal all>
  316. */
  317. #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000000
  318. #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  319. #define TCL_DATA_CMD_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  320. /* Description TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32
  321. Address (upper 8 bits) of the MSDU buffer OR
  322. MSDU_EXTENSION descriptor OR Link Descriptor
  323. In case of 'NULL' pointer, this field is set to 0
  324. <legal all>
  325. */
  326. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000004
  327. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  328. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  329. /* Description TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER
  330. Consumer: WBM
  331. Producer: SW/FW
  332. In case of 'NULL' pointer, this field is set to 0
  333. Indicates to which buffer manager the buffer OR
  334. MSDU_EXTENSION descriptor OR link descriptor that is being
  335. pointed to shall be returned after the frame has been
  336. processed. It is used by WBM for routing purposes.
  337. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  338. to the WMB buffer idle list
  339. <enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
  340. returned to the WMB idle link descriptor idle list
  341. <enum 2 FW_BM> This buffer shall be returned to the FW
  342. <enum 3 SW0_BM> This buffer shall be returned to the SW,
  343. ring 0
  344. <enum 4 SW1_BM> This buffer shall be returned to the SW,
  345. ring 1
  346. <enum 5 SW2_BM> This buffer shall be returned to the SW,
  347. ring 2
  348. <enum 6 SW3_BM> This buffer shall be returned to the SW,
  349. ring 3
  350. <enum 7 SW4_BM> This buffer shall be returned to the SW,
  351. ring 4
  352. <legal all>
  353. */
  354. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  355. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8
  356. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000700
  357. /* Description TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE
  358. Cookie field exclusively used by SW.
  359. In case of 'NULL' pointer, this field is set to 0
  360. HW ignores the contents, accept that it passes the
  361. programmed value on to other descriptors together with the
  362. physical address
  363. Field can be used by SW to for example associate the
  364. buffers physical address with the virtual address
  365. The bit definitions as used by SW are within SW HLD
  366. specification
  367. NOTE1:
  368. The three most significant bits can have a special
  369. meaning in case this struct is embedded in a TX_MPDU_DETAILS
  370. STRUCT, and field transmit_bw_restriction is set
  371. In case of NON punctured transmission:
  372. Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
  373. Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
  374. Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
  375. Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
  376. In case of punctured transmission:
  377. Sw_buffer_cookie[20:18] = 3'b000: pattern 0 only
  378. Sw_buffer_cookie[20:18] = 3'b001: pattern 1 only
  379. Sw_buffer_cookie[20:18] = 3'b010: pattern 2 only
  380. Sw_buffer_cookie[20:18] = 3'b011: pattern 3 only
  381. Sw_buffer_cookie[20:18] = 3'b100: pattern 4 only
  382. Sw_buffer_cookie[20:18] = 3'b101: pattern 5 only
  383. Sw_buffer_cookie[20:18] = 3'b110: pattern 6 only
  384. Sw_buffer_cookie[20:18] = 3'b111: pattern 7 only
  385. Note: a punctured transmission is indicated by the
  386. presence of TLV TX_PUNCTURE_SETUP embedded in the scheduler
  387. TLV
  388. NOTE 2:The five most significant bits can have a special
  389. meaning in case this struct is embedded in an
  390. RX_MSDU_DETAILS STRUCT, and Maple/Spruce Rx DMA is
  391. configured for passing on the additional info
  392. from 'RX_MPDU_INFO' structure in 'RX_MPDU_START' TLV
  393. (FR56821). This is not supported in HastingsPrime, Pine or
  394. Moselle.
  395. Sw_buffer_cookie[20:17]: Tid: The TID field in the QoS
  396. control field
  397. Sw_buffer_cookie[16]: Mpdu_qos_control_valid: This field
  398. indicates MPDUs with a QoS control field.
  399. <legal all>
  400. */
  401. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000004
  402. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_LSB 11
  403. #define TCL_DATA_CMD_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff800
  404. /* Description TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE
  405. <enum 0 MSDU_buffer> The address points to an MSDU
  406. buffer.
  407. <enum 1 extension_descriptor> The address points to an
  408. MSDU link extension descriptor
  409. < legal all>
  410. */
  411. #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_OFFSET 0x00000008
  412. #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_LSB 0
  413. #define TCL_DATA_CMD_2_BUF_OR_EXT_DESC_TYPE_MASK 0x00000001
  414. /* Description TCL_DATA_CMD_2_EPD
  415. When this bit is set then input packet is an EPD type
  416. <legal all>
  417. */
  418. #define TCL_DATA_CMD_2_EPD_OFFSET 0x00000008
  419. #define TCL_DATA_CMD_2_EPD_LSB 1
  420. #define TCL_DATA_CMD_2_EPD_MASK 0x00000002
  421. /* Description TCL_DATA_CMD_2_ENCAP_TYPE
  422. Indicates the encapsulation that HW will perform:
  423. <enum 0 RAW> No encapsulation
  424. <enum 1 Native_WiFi>
  425. <enum 2 Ethernet> Ethernet 2 (DIX) or 802.3 (uses
  426. SNAP/LLC)
  427. <enum 3 802_3> DO NOT USE. Indicate Ethernet
  428. Used by the OLE during encapsulation.
  429. <legal all>
  430. */
  431. #define TCL_DATA_CMD_2_ENCAP_TYPE_OFFSET 0x00000008
  432. #define TCL_DATA_CMD_2_ENCAP_TYPE_LSB 2
  433. #define TCL_DATA_CMD_2_ENCAP_TYPE_MASK 0x0000000c
  434. /* Description TCL_DATA_CMD_2_ENCRYPT_TYPE
  435. Field only valid for encap_type: RAW
  436. Indicates type of decrypt cipher used (as defined in the
  437. peer entry)
  438. <enum 0 wep_40> WEP 40-bit
  439. <enum 1 wep_104> WEP 104-bit
  440. <enum 2 tkip_no_mic> TKIP without MIC
  441. <enum 3 wep_128> WEP 128-bit
  442. <enum 4 tkip_with_mic> TKIP with MIC
  443. <enum 5 wapi> WAPI
  444. <enum 6 aes_ccmp_128> AES CCMP 128
  445. <enum 7 no_cipher> No crypto
  446. <enum 8 aes_ccmp_256> AES CCMP 256
  447. <enum 9 aes_gcmp_128> AES CCMP 128
  448. <enum 10 aes_gcmp_256> AES CCMP 256
  449. <enum 11 wapi_gcm_sm4> WAPI GCM SM4
  450. <enum 12 wep_varied_width> DO not use... Only for higher
  451. layer modules..
  452. <legal 0-12>
  453. */
  454. #define TCL_DATA_CMD_2_ENCRYPT_TYPE_OFFSET 0x00000008
  455. #define TCL_DATA_CMD_2_ENCRYPT_TYPE_LSB 4
  456. #define TCL_DATA_CMD_2_ENCRYPT_TYPE_MASK 0x000000f0
  457. /* Description TCL_DATA_CMD_2_SRC_BUFFER_SWAP
  458. Treats source memory (packet buffer) organization as
  459. big-endian. The packets are read and byte swapped.
  460. 1'b0: Source memory is little endian
  461. 1'b1: Source memory is big endian
  462. <legal all>
  463. */
  464. #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_OFFSET 0x00000008
  465. #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_LSB 8
  466. #define TCL_DATA_CMD_2_SRC_BUFFER_SWAP_MASK 0x00000100
  467. /* Description TCL_DATA_CMD_2_LINK_META_SWAP
  468. Treats link descriptor and Metadata as big-endian. The
  469. link descriptor/Metadata is read and byte swapped.
  470. 1'b0: Memory is little endian
  471. 1'b1: Memory is big endian
  472. <legal all>
  473. */
  474. #define TCL_DATA_CMD_2_LINK_META_SWAP_OFFSET 0x00000008
  475. #define TCL_DATA_CMD_2_LINK_META_SWAP_LSB 9
  476. #define TCL_DATA_CMD_2_LINK_META_SWAP_MASK 0x00000200
  477. /* Description TCL_DATA_CMD_2_TQM_NO_DROP
  478. This bit is used to stop TQM from dropping MSDUs while
  479. adding them to MSDU flows1'b1: Do not drop MSDU when any of
  480. the threshold value is met while adding MSDU in a flow1'b1:
  481. Drop MSDU when any of the threshold value is met while
  482. adding MSDU in a flow
  483. <legal all>
  484. */
  485. #define TCL_DATA_CMD_2_TQM_NO_DROP_OFFSET 0x00000008
  486. #define TCL_DATA_CMD_2_TQM_NO_DROP_LSB 10
  487. #define TCL_DATA_CMD_2_TQM_NO_DROP_MASK 0x00000400
  488. /* Description TCL_DATA_CMD_2_RESERVED_2A
  489. <legal 0>
  490. */
  491. #define TCL_DATA_CMD_2_RESERVED_2A_OFFSET 0x00000008
  492. #define TCL_DATA_CMD_2_RESERVED_2A_LSB 11
  493. #define TCL_DATA_CMD_2_RESERVED_2A_MASK 0x00000800
  494. /* Description TCL_DATA_CMD_2_SEARCH_TYPE
  495. Search type select
  496. <enum 0 Normal_search> Address and flow search will use
  497. packet contents
  498. <enum 1 Index_based_address_search> Address search will
  499. <enum 2 Index_based_flow_search> Flow search will use
  500. 'search_index', and address search will use packet contents
  501. <legal 0-2>
  502. */
  503. #define TCL_DATA_CMD_2_SEARCH_TYPE_OFFSET 0x00000008
  504. #define TCL_DATA_CMD_2_SEARCH_TYPE_LSB 12
  505. #define TCL_DATA_CMD_2_SEARCH_TYPE_MASK 0x00003000
  506. /* Description TCL_DATA_CMD_2_ADDRX_EN
  507. Address X search enable in ASE
  508. 1'b0: Search disable
  509. 1'b1: Search Enable
  510. <legal all>
  511. */
  512. #define TCL_DATA_CMD_2_ADDRX_EN_OFFSET 0x00000008
  513. #define TCL_DATA_CMD_2_ADDRX_EN_LSB 14
  514. #define TCL_DATA_CMD_2_ADDRX_EN_MASK 0x00004000
  515. /* Description TCL_DATA_CMD_2_ADDRY_EN
  516. Address Y search enable in ASE
  517. 1'b0: Search disable
  518. 1'b1: Search Enable
  519. <legal all>
  520. */
  521. #define TCL_DATA_CMD_2_ADDRY_EN_OFFSET 0x00000008
  522. #define TCL_DATA_CMD_2_ADDRY_EN_LSB 15
  523. #define TCL_DATA_CMD_2_ADDRY_EN_MASK 0x00008000
  524. /* Description TCL_DATA_CMD_2_TCL_CMD_NUMBER
  525. This number can be used by SW to track, identify and
  526. link the created commands with the command statuses
  527. Is set to the value 'TCL_CMD_Number' of the related
  528. TCL_DATA command
  529. <legal all>
  530. */
  531. #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_OFFSET 0x00000008
  532. #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_LSB 16
  533. #define TCL_DATA_CMD_2_TCL_CMD_NUMBER_MASK 0xffff0000
  534. /* Description TCL_DATA_CMD_3_DATA_LENGTH
  535. Valid Data length in bytes.
  536. MSDU length in case of direct descriptor.
  537. Length of link extension descriptor in case of Link
  538. extension descriptor. This is used to know the size of
  539. Metadata.
  540. <legal all>
  541. */
  542. #define TCL_DATA_CMD_3_DATA_LENGTH_OFFSET 0x0000000c
  543. #define TCL_DATA_CMD_3_DATA_LENGTH_LSB 0
  544. #define TCL_DATA_CMD_3_DATA_LENGTH_MASK 0x0000ffff
  545. /* Description TCL_DATA_CMD_3_IPV4_CHECKSUM_EN
  546. OLE related control
  547. Enable IPv4 checksum replacement
  548. */
  549. #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_OFFSET 0x0000000c
  550. #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_LSB 16
  551. #define TCL_DATA_CMD_3_IPV4_CHECKSUM_EN_MASK 0x00010000
  552. /* Description TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN
  553. OLE related control
  554. Enable UDP over IPv4 checksum replacement. UDP checksum
  555. over IPv4 is optional for TCP/IP stacks.
  556. */
  557. #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_OFFSET 0x0000000c
  558. #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_LSB 17
  559. #define TCL_DATA_CMD_3_UDP_OVER_IPV4_CHECKSUM_EN_MASK 0x00020000
  560. /* Description TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN
  561. OLE related control
  562. Enable UDP over IPv6 checksum replacement. UDP checksum
  563. over IPv6 is mandatory for TCP/IP stacks.
  564. */
  565. #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_OFFSET 0x0000000c
  566. #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_LSB 18
  567. #define TCL_DATA_CMD_3_UDP_OVER_IPV6_CHECKSUM_EN_MASK 0x00040000
  568. /* Description TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN
  569. OLE related control
  570. Enable TCP checksum over IPv4 replacement
  571. */
  572. #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_OFFSET 0x0000000c
  573. #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_LSB 19
  574. #define TCL_DATA_CMD_3_TCP_OVER_IPV4_CHECKSUM_EN_MASK 0x00080000
  575. /* Description TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN
  576. OLE related control
  577. Enable TCP checksum over IPv6 replacement
  578. */
  579. #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_OFFSET 0x0000000c
  580. #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_LSB 20
  581. #define TCL_DATA_CMD_3_TCP_OVER_IPV6_CHECKSUM_EN_MASK 0x00100000
  582. /* Description TCL_DATA_CMD_3_TO_FW
  583. Forward packet to FW along with classification result.
  584. The packet will not be forward to TQM when this bit is set
  585. 1'b0: Use classification result to forward the packet.
  586. 1'b1: Override classification result and forward packet
  587. only to FW.
  588. <legal all>
  589. */
  590. #define TCL_DATA_CMD_3_TO_FW_OFFSET 0x0000000c
  591. #define TCL_DATA_CMD_3_TO_FW_LSB 21
  592. #define TCL_DATA_CMD_3_TO_FW_MASK 0x00200000
  593. /* Description TCL_DATA_CMD_3_RESERVED_3A
  594. <legal 0>
  595. */
  596. #define TCL_DATA_CMD_3_RESERVED_3A_OFFSET 0x0000000c
  597. #define TCL_DATA_CMD_3_RESERVED_3A_LSB 22
  598. #define TCL_DATA_CMD_3_RESERVED_3A_MASK 0x00400000
  599. /* Description TCL_DATA_CMD_3_PACKET_OFFSET
  600. Packet offset from Metadata in case of direct buffer
  601. descriptor. This field is valid when Buf_or_ext_desc_type is
  602. reset(= 0).
  603. <legal all>
  604. */
  605. #define TCL_DATA_CMD_3_PACKET_OFFSET_OFFSET 0x0000000c
  606. #define TCL_DATA_CMD_3_PACKET_OFFSET_LSB 23
  607. #define TCL_DATA_CMD_3_PACKET_OFFSET_MASK 0xff800000
  608. /* Description TCL_DATA_CMD_4_BUFFER_TIMESTAMP
  609. Field only valid when 'Buffer_timestamp_valid ' is set.
  610. Frame system entrance timestamp. The timestamp is
  611. related to the global system timer
  612. Generally the first module (SW, TCL or TQM). that sees
  613. this frame and this timestamp field is not valid, shall fill
  614. in this field.
  615. Timestamp in units of 1024 us
  616. */
  617. #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_OFFSET 0x00000010
  618. #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_LSB 0
  619. #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_MASK 0x0007ffff
  620. /* Description TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID
  621. When set, the Buffer_timestamp field contains valid
  622. info.
  623. */
  624. #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_OFFSET 0x00000010
  625. #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_LSB 19
  626. #define TCL_DATA_CMD_4_BUFFER_TIMESTAMP_VALID_MASK 0x00080000
  627. /* Description TCL_DATA_CMD_4_RESERVED_4A
  628. <legal 0>
  629. */
  630. #define TCL_DATA_CMD_4_RESERVED_4A_OFFSET 0x00000010
  631. #define TCL_DATA_CMD_4_RESERVED_4A_LSB 20
  632. #define TCL_DATA_CMD_4_RESERVED_4A_MASK 0x00100000
  633. /* Description TCL_DATA_CMD_4_HLOS_TID_OVERWRITE
  634. When set, TCL shall ignore the IP DSCP and VLAN PCP
  635. fields and use HLOS_TID as the final TID. Otherwise TCL
  636. shall consider the DSCP and PCP fields as well as HLOS_TID
  637. and choose a final TID based on the configured priority
  638. <legal all>
  639. */
  640. #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_OFFSET 0x00000010
  641. #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_LSB 21
  642. #define TCL_DATA_CMD_4_HLOS_TID_OVERWRITE_MASK 0x00200000
  643. /* Description TCL_DATA_CMD_4_HLOS_TID
  644. HLOS MSDU priority
  645. Field is used when HLOS_TID_overwrite is set.
  646. Field is also used when HLOS_TID_overwrite is not set
  647. and DSCP/PCP is not available in the packet
  648. <legal all>
  649. */
  650. #define TCL_DATA_CMD_4_HLOS_TID_OFFSET 0x00000010
  651. #define TCL_DATA_CMD_4_HLOS_TID_LSB 22
  652. #define TCL_DATA_CMD_4_HLOS_TID_MASK 0x03c00000
  653. /* Description TCL_DATA_CMD_4_LMAC_ID
  654. TCL uses this LMAC_ID in address search, i.e, while
  655. finding matching entry for the packet in AST corresponding
  656. to given LMAC_ID
  657. If LMAC ID is all 1s (=> value 3), it indicates wildcard
  658. match for any MAC
  659. <legal 0-3>
  660. */
  661. #define TCL_DATA_CMD_4_LMAC_ID_OFFSET 0x00000010
  662. #define TCL_DATA_CMD_4_LMAC_ID_LSB 26
  663. #define TCL_DATA_CMD_4_LMAC_ID_MASK 0x0c000000
  664. /* Description TCL_DATA_CMD_4_UDP_FLOW_OVERRIDE
  665. TCL uses this to select the flow pointer from the peer
  666. table, which can be overridden by SW for pre-encrypted raw
  667. WiFi packets that cannot be parsed for UDP or for other
  668. enterprise use cases:
  669. <enum 0 FP_PARSE_IP> Use the flow-pointer based on
  670. parsing the IPv4 or IPv6 header
  671. <enum 1 FP_USE_NON_UDP> Use the non-UDP flow pointer
  672. <enum 2 FP_USE_UDP> Use the UDP flow pointer
  673. This is not supported in Moselle.
  674. <legal 0-2>
  675. */
  676. #define TCL_DATA_CMD_4_UDP_FLOW_OVERRIDE_OFFSET 0x00000010
  677. #define TCL_DATA_CMD_4_UDP_FLOW_OVERRIDE_LSB 28
  678. #define TCL_DATA_CMD_4_UDP_FLOW_OVERRIDE_MASK 0x30000000
  679. /* Description TCL_DATA_CMD_4_RESERVED_4B
  680. <legal 0>
  681. */
  682. #define TCL_DATA_CMD_4_RESERVED_4B_OFFSET 0x00000010
  683. #define TCL_DATA_CMD_4_RESERVED_4B_LSB 30
  684. #define TCL_DATA_CMD_4_RESERVED_4B_MASK 0xc0000000
  685. /* Description TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM
  686. DSCP to TID mapping table number that need to be used
  687. for the MSDU, should be specified using this field
  688. <legal all>
  689. */
  690. #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_OFFSET 0x00000014
  691. #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_LSB 0
  692. #define TCL_DATA_CMD_5_DSCP_TID_TABLE_NUM_MASK 0x0000003f
  693. /* Description TCL_DATA_CMD_5_SEARCH_INDEX
  694. The index that will be used for index based address or
  695. flow search. The field is valid when 'search_type' is 1 or
  696. 2.
  697. <legal all>
  698. */
  699. #define TCL_DATA_CMD_5_SEARCH_INDEX_OFFSET 0x00000014
  700. #define TCL_DATA_CMD_5_SEARCH_INDEX_LSB 6
  701. #define TCL_DATA_CMD_5_SEARCH_INDEX_MASK 0x03ffffc0
  702. /* Description TCL_DATA_CMD_5_CACHE_SET_NUM
  703. Cache set number that should be used to cache the index
  704. based search results, for address and flow search. This
  705. value should be equal to LSB four bits of the hash value of
  706. match data, in case of search index points to an entry which
  707. may be used in content based search also. The value can be
  708. anything when the entry pointed by search index will not be
  709. used for content based search.
  710. <legal all>
  711. */
  712. #define TCL_DATA_CMD_5_CACHE_SET_NUM_OFFSET 0x00000014
  713. #define TCL_DATA_CMD_5_CACHE_SET_NUM_LSB 26
  714. #define TCL_DATA_CMD_5_CACHE_SET_NUM_MASK 0x3c000000
  715. /* Description TCL_DATA_CMD_5_MESH_ENABLE
  716. If set to a non-zero value:
  717. * For raw WiFi frames, this indicates transmission to a
  718. mesh STA, enabling the interpretation of the 'Mesh Control
  719. Present' bit (bit 8) of QoS Control (otherwise this bit is
  720. ignored). The interpretation of the A-MSDU 'Length' field is
  721. decided by the e-numerations below.
  722. * For native WiFi frames, this indicates that a 'Mesh
  723. Control' field is present between the header and the LLC.
  724. The three non-zero values are interchangeable.
  725. <enum 0 MESH_DISABLE>
  726. <enum 1 MESH_Q2Q> A-MSDU 'Length' is big endian and
  727. includes the length of Mesh Control.
  728. <enum 2 MESH_11S_BE> A-MSDU 'Length' is big endian and
  729. excludes the length of Mesh Control.
  730. <enum 3 MESH_11S_LE> A-MSDU 'Length' is little endian
  731. and excludes the length of Mesh Control. This is
  732. 802.11s-compliant.
  733. <legal 0-3>
  734. */
  735. #define TCL_DATA_CMD_5_MESH_ENABLE_OFFSET 0x00000014
  736. #define TCL_DATA_CMD_5_MESH_ENABLE_LSB 30
  737. #define TCL_DATA_CMD_5_MESH_ENABLE_MASK 0xc0000000
  738. /* Description TCL_DATA_CMD_6_RESERVED_6A
  739. <legal 0>
  740. */
  741. #define TCL_DATA_CMD_6_RESERVED_6A_OFFSET 0x00000018
  742. #define TCL_DATA_CMD_6_RESERVED_6A_LSB 0
  743. #define TCL_DATA_CMD_6_RESERVED_6A_MASK 0x000fffff
  744. /* Description TCL_DATA_CMD_6_RING_ID
  745. The buffer pointer ring ID.
  746. 0 refers to the IDLE ring
  747. 1 - N refers to other rings
  748. Helps with debugging when dumping ring contents.
  749. <legal all>
  750. */
  751. #define TCL_DATA_CMD_6_RING_ID_OFFSET 0x00000018
  752. #define TCL_DATA_CMD_6_RING_ID_LSB 20
  753. #define TCL_DATA_CMD_6_RING_ID_MASK 0x0ff00000
  754. /* Description TCL_DATA_CMD_6_LOOPING_COUNT
  755. A count value that indicates the number of times the
  756. producer of entries into the Ring has looped around the
  757. ring.
  758. At initialization time, this value is set to 0. On the
  759. first loop, this value is set to 1. After the max value is
  760. reached allowed by the number of bits for this field, the
  761. count value continues with 0 again.
  762. In case SW is the consumer of the ring entries, it can
  763. use this field to figure out up to where the producer of
  764. entries has created new entries. This eliminates the need to
  765. check where the head pointer' of the ring is located once
  766. the SW starts processing an interrupt indicating that new
  767. entries have been put into this ring...
  768. Also note that SW if it wants only needs to look at the
  769. LSB bit of this count value.
  770. <legal all>
  771. */
  772. #define TCL_DATA_CMD_6_LOOPING_COUNT_OFFSET 0x00000018
  773. #define TCL_DATA_CMD_6_LOOPING_COUNT_LSB 28
  774. #define TCL_DATA_CMD_6_LOOPING_COUNT_MASK 0xf0000000
  775. #endif // _TCL_DATA_CMD_H_