tcl_data_cmd.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  1. /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef _TCL_DATA_CMD_H_
  16. #define _TCL_DATA_CMD_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #include "buffer_addr_info.h"
  20. #define NUM_OF_DWORDS_TCL_DATA_CMD 8
  21. struct tcl_data_cmd {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. struct buffer_addr_info buf_addr_info;
  24. uint32_t tcl_cmd_type : 1, // [0:0]
  25. buf_or_ext_desc_type : 1, // [1:1]
  26. bank_id : 6, // [7:2]
  27. tx_notify_frame : 3, // [10:8]
  28. header_length_read_sel : 1, // [11:11]
  29. buffer_timestamp : 19, // [30:12]
  30. buffer_timestamp_valid : 1; // [31:31]
  31. uint32_t reserved_3a : 16, // [15:0]
  32. tcl_cmd_number : 16; // [31:16]
  33. uint32_t data_length : 16, // [15:0]
  34. ipv4_checksum_en : 1, // [16:16]
  35. udp_over_ipv4_checksum_en : 1, // [17:17]
  36. udp_over_ipv6_checksum_en : 1, // [18:18]
  37. tcp_over_ipv4_checksum_en : 1, // [19:19]
  38. tcp_over_ipv6_checksum_en : 1, // [20:20]
  39. to_fw : 1, // [21:21]
  40. reserved_4a : 1, // [22:22]
  41. packet_offset : 9; // [31:23]
  42. uint32_t hlos_tid_overwrite : 1, // [0:0]
  43. flow_override_enable : 1, // [1:1]
  44. who_classify_info_sel : 2, // [3:2]
  45. hlos_tid : 4, // [7:4]
  46. flow_override : 1, // [8:8]
  47. pmac_id : 2, // [10:9]
  48. msdu_color : 2, // [12:11]
  49. reserved_5a : 11, // [23:13]
  50. vdev_id : 8; // [31:24]
  51. uint32_t search_index : 20, // [19:0]
  52. cache_set_num : 4, // [23:20]
  53. index_lookup_override : 1, // [24:24]
  54. reserved_6a : 7; // [31:25]
  55. uint32_t reserved_7a : 20, // [19:0]
  56. ring_id : 8, // [27:20]
  57. looping_count : 4; // [31:28]
  58. #else
  59. struct buffer_addr_info buf_addr_info;
  60. uint32_t buffer_timestamp_valid : 1, // [31:31]
  61. buffer_timestamp : 19, // [30:12]
  62. header_length_read_sel : 1, // [11:11]
  63. tx_notify_frame : 3, // [10:8]
  64. bank_id : 6, // [7:2]
  65. buf_or_ext_desc_type : 1, // [1:1]
  66. tcl_cmd_type : 1; // [0:0]
  67. uint32_t tcl_cmd_number : 16, // [31:16]
  68. reserved_3a : 16; // [15:0]
  69. uint32_t packet_offset : 9, // [31:23]
  70. reserved_4a : 1, // [22:22]
  71. to_fw : 1, // [21:21]
  72. tcp_over_ipv6_checksum_en : 1, // [20:20]
  73. tcp_over_ipv4_checksum_en : 1, // [19:19]
  74. udp_over_ipv6_checksum_en : 1, // [18:18]
  75. udp_over_ipv4_checksum_en : 1, // [17:17]
  76. ipv4_checksum_en : 1, // [16:16]
  77. data_length : 16; // [15:0]
  78. uint32_t vdev_id : 8, // [31:24]
  79. reserved_5a : 11, // [23:13]
  80. msdu_color : 2, // [12:11]
  81. pmac_id : 2, // [10:9]
  82. flow_override : 1, // [8:8]
  83. hlos_tid : 4, // [7:4]
  84. who_classify_info_sel : 2, // [3:2]
  85. flow_override_enable : 1, // [1:1]
  86. hlos_tid_overwrite : 1; // [0:0]
  87. uint32_t reserved_6a : 7, // [31:25]
  88. index_lookup_override : 1, // [24:24]
  89. cache_set_num : 4, // [23:20]
  90. search_index : 20; // [19:0]
  91. uint32_t looping_count : 4, // [31:28]
  92. ring_id : 8, // [27:20]
  93. reserved_7a : 20; // [19:0]
  94. #endif
  95. };
  96. /* Description BUF_ADDR_INFO
  97. Details of the physical address for a single buffer containing
  98. the entire MSDU or an MSDU extension descriptor.
  99. It also contains return ownership info as well as some meta
  100. data for SW related to this buffer.
  101. In case of Buf_or_ext_desc_type indicating 'MSDU_buffer',
  102. this address indicates the start of the meta data that is
  103. preceding the actual packet data.
  104. The start of the actual packet data is provided by field:
  105. Packet_offset
  106. */
  107. /* Description BUFFER_ADDR_31_0
  108. Address (lower 32 bits) of the MSDU buffer OR MSDU_EXTENSION
  109. descriptor OR Link Descriptor
  110. In case of 'NULL' pointer, this field is set to 0
  111. <legal all>
  112. */
  113. #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000000
  114. #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  115. #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MSB 31
  116. #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  117. /* Description BUFFER_ADDR_39_32
  118. Address (upper 8 bits) of the MSDU buffer OR MSDU_EXTENSION
  119. descriptor OR Link Descriptor
  120. In case of 'NULL' pointer, this field is set to 0
  121. <legal all>
  122. */
  123. #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000004
  124. #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  125. #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MSB 7
  126. #define TCL_DATA_CMD_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  127. /* Description RETURN_BUFFER_MANAGER
  128. Consumer: WBM
  129. Producer: SW/FW
  130. In case of 'NULL' pointer, this field is set to 0
  131. Indicates to which buffer manager the buffer OR MSDU_EXTENSION
  132. descriptor OR link descriptor that is being pointed to
  133. shall be returned after the frame has been processed. It
  134. is used by WBM for routing purposes.
  135. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  136. to the WMB buffer idle list
  137. <enum 1 WBM_CHIP0_IDLE_DESC_LIST> This buffer shall be returned
  138. to the WBM idle link descriptor idle list, where the chip
  139. 0 WBM is chosen in case of a multi-chip config
  140. <enum 2 WBM_CHIP1_IDLE_DESC_LIST> This buffer shall be returned
  141. to the chip 1 WBM idle link descriptor idle list
  142. <enum 3 WBM_CHIP2_IDLE_DESC_LIST> This buffer shall be returned
  143. to the chip 2 WBM idle link descriptor idle list
  144. <enum 12 WBM_CHIP3_IDLE_DESC_LIST> This buffer shall be
  145. returned to chip 3 WBM idle link descriptor idle list
  146. <enum 4 FW_BM> This buffer shall be returned to the FW
  147. <enum 5 SW0_BM> This buffer shall be returned to the SW,
  148. ring 0
  149. <enum 6 SW1_BM> This buffer shall be returned to the SW,
  150. ring 1
  151. <enum 7 SW2_BM> This buffer shall be returned to the SW,
  152. ring 2
  153. <enum 8 SW3_BM> This buffer shall be returned to the SW,
  154. ring 3
  155. <enum 9 SW4_BM> This buffer shall be returned to the SW,
  156. ring 4
  157. <enum 10 SW5_BM> This buffer shall be returned to the SW,
  158. ring 5
  159. <enum 11 SW6_BM> This buffer shall be returned to the SW,
  160. ring 6
  161. <legal 0-12>
  162. */
  163. #define TCL_DATA_CMD_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  164. #define TCL_DATA_CMD_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8
  165. #define TCL_DATA_CMD_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MSB 11
  166. #define TCL_DATA_CMD_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000f00
  167. /* Description SW_BUFFER_COOKIE
  168. Cookie field exclusively used by SW.
  169. In case of 'NULL' pointer, this field is set to 0
  170. HW ignores the contents, accept that it passes the programmed
  171. value on to other descriptors together with the physical
  172. address
  173. Field can be used by SW to for example associate the buffers
  174. physical address with the virtual address
  175. The bit definitions as used by SW are within SW HLD specification
  176. NOTE1:
  177. The three most significant bits can have a special meaning
  178. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  179. and field transmit_bw_restriction is set
  180. In case of NON punctured transmission:
  181. Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
  182. Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
  183. Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
  184. Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
  185. Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
  186. Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
  187. Sw_buffer_cookie[19:18] = 2'b11: reserved
  188. In case of punctured transmission:
  189. Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
  190. Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
  191. Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
  192. Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
  193. Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
  194. Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
  195. Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
  196. Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
  197. Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
  198. Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
  199. Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
  200. Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
  201. Sw_buffer_cookie[19:18] = 2'b11: reserved
  202. Note: a punctured transmission is indicated by the presence
  203. of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
  204. <legal all>
  205. */
  206. #define TCL_DATA_CMD_BUF_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000004
  207. #define TCL_DATA_CMD_BUF_ADDR_INFO_SW_BUFFER_COOKIE_LSB 12
  208. #define TCL_DATA_CMD_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MSB 31
  209. #define TCL_DATA_CMD_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff000
  210. /* Description TCL_CMD_TYPE
  211. This field is used to select the type of TCL Command decriptor
  212. that is queued by SW/FW. For 'TCL_DATA_CMD' this has to
  213. be 0.
  214. <legal 0>
  215. */
  216. #define TCL_DATA_CMD_TCL_CMD_TYPE_OFFSET 0x00000008
  217. #define TCL_DATA_CMD_TCL_CMD_TYPE_LSB 0
  218. #define TCL_DATA_CMD_TCL_CMD_TYPE_MSB 0
  219. #define TCL_DATA_CMD_TCL_CMD_TYPE_MASK 0x00000001
  220. /* Description BUF_OR_EXT_DESC_TYPE
  221. <enum 0 MSDU_buffer> The address points to an MSDU buffer.
  222. <enum 1 extension_descriptor> The address points to an MSDU
  223. link extension descriptor
  224. < legal all>
  225. */
  226. #define TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_OFFSET 0x00000008
  227. #define TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_LSB 1
  228. #define TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_MSB 1
  229. #define TCL_DATA_CMD_BUF_OR_EXT_DESC_TYPE_MASK 0x00000002
  230. /* Description BANK_ID
  231. This is used to select one of the TCL register banks for
  232. fields removed from 'TCL_DATA_CMD' that do not change often
  233. within one virtual device or a set of virtual devices:
  234. EPD
  235. encap_type
  236. Encrypt_type
  237. src_buffer_swap
  238. Link_meta_swap
  239. Search_type
  240. AddrX_en
  241. AddrY_en
  242. DSCP_TID_TABLE_NUM
  243. mesh_enable
  244. */
  245. #define TCL_DATA_CMD_BANK_ID_OFFSET 0x00000008
  246. #define TCL_DATA_CMD_BANK_ID_LSB 2
  247. #define TCL_DATA_CMD_BANK_ID_MSB 7
  248. #define TCL_DATA_CMD_BANK_ID_MASK 0x000000fc
  249. /* Description TX_NOTIFY_FRAME
  250. TCL copies this value to 'TQM_ENTRANCE_RING' field FW_tx_notify_frame.
  251. Note: TCL can also have CCE/LCE rules to set 'Tx_notify_frame.'
  252. TCL shall have a register to choose the notify type in case
  253. of a conflict between the two settings.
  254. */
  255. #define TCL_DATA_CMD_TX_NOTIFY_FRAME_OFFSET 0x00000008
  256. #define TCL_DATA_CMD_TX_NOTIFY_FRAME_LSB 8
  257. #define TCL_DATA_CMD_TX_NOTIFY_FRAME_MSB 10
  258. #define TCL_DATA_CMD_TX_NOTIFY_FRAME_MASK 0x00000700
  259. /* Description HEADER_LENGTH_READ_SEL
  260. This field is used to select the per 'encap_type' register
  261. set for MSDU header read length.
  262. 0: set 0 header read length register
  263. 1: set 1 header read length register
  264. <legal all>
  265. */
  266. #define TCL_DATA_CMD_HEADER_LENGTH_READ_SEL_OFFSET 0x00000008
  267. #define TCL_DATA_CMD_HEADER_LENGTH_READ_SEL_LSB 11
  268. #define TCL_DATA_CMD_HEADER_LENGTH_READ_SEL_MSB 11
  269. #define TCL_DATA_CMD_HEADER_LENGTH_READ_SEL_MASK 0x00000800
  270. /* Description BUFFER_TIMESTAMP
  271. Field only valid when 'Buffer_timestamp_valid ' is set.
  272. Frame system entrance timestamp. The timestamp is related
  273. to the global system timer
  274. Generally the first module (SW, TCL or TQM). that sees this
  275. frame and this timestamp field is not valid, shall fill
  276. in this field.
  277. Timestamp in units determined by the UMCMN 'TX_TIMESTAMP_RESOLUTION_SELECT'
  278. register
  279. Waikiki v1 and Hamilton used units of 1024 us.
  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