tcl_data_cmd.h 34 KB

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