tcl_data_cmd.h 34 KB

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