rx_msdu_details.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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 _RX_MSDU_DETAILS_H_
  17. #define _RX_MSDU_DETAILS_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. #include "buffer_addr_info.h"
  21. #include "rx_msdu_desc_info.h"
  22. // ################ START SUMMARY #################
  23. //
  24. // Dword Fields
  25. // 0-1 struct buffer_addr_info buffer_addr_info_details;
  26. // 2-3 struct rx_msdu_desc_info rx_msdu_desc_info_details;
  27. //
  28. // ################ END SUMMARY #################
  29. #define NUM_OF_DWORDS_RX_MSDU_DETAILS 4
  30. struct rx_msdu_details {
  31. struct buffer_addr_info buffer_addr_info_details;
  32. struct rx_msdu_desc_info rx_msdu_desc_info_details;
  33. };
  34. /*
  35. struct buffer_addr_info buffer_addr_info_details
  36. Consumer: REO/SW
  37. Producer: RXDMA
  38. Details of the physical address of the buffer containing
  39. an MSDU (or entire MPDU)
  40. struct rx_msdu_desc_info rx_msdu_desc_info_details
  41. Consumer: REO/SW
  42. Producer: RXDMA
  43. General information related to the MSDU that should be
  44. passed on from RXDMA all the way to to the REO destination
  45. ring.
  46. */
  47. /* EXTERNAL REFERENCE : struct buffer_addr_info buffer_addr_info_details */
  48. /* Description RX_MSDU_DETAILS_0_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0
  49. Address (lower 32 bits) of the MSDU buffer OR
  50. MSDU_EXTENSION descriptor OR Link Descriptor
  51. In case of 'NULL' pointer, this field is set to 0
  52. <legal all>
  53. */
  54. #define RX_MSDU_DETAILS_0_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_OFFSET 0x00000000
  55. #define RX_MSDU_DETAILS_0_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_LSB 0
  56. #define RX_MSDU_DETAILS_0_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_MASK 0xffffffff
  57. /* Description RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_39_32
  58. Address (upper 8 bits) of the MSDU buffer OR
  59. MSDU_EXTENSION descriptor OR Link Descriptor
  60. In case of 'NULL' pointer, this field is set to 0
  61. <legal all>
  62. */
  63. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_39_32_OFFSET 0x00000004
  64. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_39_32_LSB 0
  65. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_39_32_MASK 0x000000ff
  66. /* Description RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_RETURN_BUFFER_MANAGER
  67. Consumer: WBM
  68. Producer: SW/FW
  69. In case of 'NULL' pointer, this field is set to 0
  70. Indicates to which buffer manager the buffer OR
  71. MSDU_EXTENSION descriptor OR link descriptor that is being
  72. pointed to shall be returned after the frame has been
  73. processed. It is used by WBM for routing purposes.
  74. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  75. to the WMB buffer idle list
  76. <enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
  77. returned to the WMB idle link descriptor idle list
  78. <enum 2 FW_BM> This buffer shall be returned to the FW
  79. <enum 3 SW0_BM> This buffer shall be returned to the SW,
  80. ring 0
  81. <enum 4 SW1_BM> This buffer shall be returned to the SW,
  82. ring 1
  83. <enum 5 SW2_BM> This buffer shall be returned to the SW,
  84. ring 2
  85. <enum 6 SW3_BM> This buffer shall be returned to the SW,
  86. ring 3
  87. <enum 7 SW4_BM> This buffer shall be returned to the SW,
  88. ring 4
  89. <legal all>
  90. */
  91. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  92. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_RETURN_BUFFER_MANAGER_LSB 8
  93. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_RETURN_BUFFER_MANAGER_MASK 0x00000700
  94. /* Description RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_SW_BUFFER_COOKIE
  95. Cookie field exclusively used by SW.
  96. In case of 'NULL' pointer, this field is set to 0
  97. HW ignores the contents, accept that it passes the
  98. programmed value on to other descriptors together with the
  99. physical address
  100. Field can be used by SW to for example associate the
  101. buffers physical address with the virtual address
  102. The bit definitions as used by SW are within SW HLD
  103. specification
  104. NOTE:
  105. The three most significant bits can have a special
  106. meaning in case this struct is embedded in a TX_MPDU_DETAILS
  107. STRUCT, and field transmit_bw_restriction is set
  108. In case of NON punctured transmission:
  109. Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
  110. Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
  111. Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
  112. Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
  113. In case of punctured transmission:
  114. Sw_buffer_cookie[20:18] = 3'b000: pattern 0 only
  115. Sw_buffer_cookie[20:18] = 3'b001: pattern 1 only
  116. Sw_buffer_cookie[20:18] = 3'b010: pattern 2 only
  117. Sw_buffer_cookie[20:18] = 3'b011: pattern 3 only
  118. Sw_buffer_cookie[20:18] = 3'b100: pattern 4 only
  119. Sw_buffer_cookie[20:18] = 3'b101: pattern 5 only
  120. Sw_buffer_cookie[20:18] = 3'b110: pattern 6 only
  121. Sw_buffer_cookie[20:18] = 3'b111: pattern 7 only
  122. Note: a punctured transmission is indicated by the
  123. presence of TLV TX_PUNCTURE_SETUP embedded in the scheduler
  124. TLV
  125. <legal all>
  126. */
  127. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_SW_BUFFER_COOKIE_OFFSET 0x00000004
  128. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_SW_BUFFER_COOKIE_LSB 11
  129. #define RX_MSDU_DETAILS_1_BUFFER_ADDR_INFO_DETAILS_SW_BUFFER_COOKIE_MASK 0xfffff800
  130. /* EXTERNAL REFERENCE : struct rx_msdu_desc_info rx_msdu_desc_info_details */
  131. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG
  132. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  133. over multiple buffers, this field will be valid in the Last
  134. buffer used by the MSDU
  135. <enum 0 Not_first_msdu> This is not the first MSDU in
  136. the MPDU.
  137. <enum 1 first_msdu> This MSDU is the first one in the
  138. MPDU.
  139. <legal all>
  140. */
  141. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG_OFFSET 0x00000008
  142. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG_LSB 0
  143. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG_MASK 0x00000001
  144. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_LAST_MSDU_IN_MPDU_FLAG
  145. Consumer: WBM/REO/SW/FW
  146. Producer: RXDMA
  147. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  148. over multiple buffers, this field will be valid in the Last
  149. buffer used by the MSDU
  150. <enum 0 Not_last_msdu> There are more MSDUs linked to
  151. this MSDU that belongs to this MPDU
  152. <enum 1 Last_msdu> this MSDU is the last one in the
  153. MPDU. This setting is only allowed in combination with
  154. 'Msdu_continuation' set to 0. This implies that when an msdu
  155. is spread out over multiple buffers and thus
  156. msdu_continuation is set, only for the very last buffer of
  157. the msdu, can the 'last_msdu_in_mpdu_flag' be set.
  158. When both first_msdu_in_mpdu_flag and
  159. last_msdu_in_mpdu_flag are set, the MPDU that this MSDU
  160. belongs to only contains a single MSDU.
  161. <legal all>
  162. */
  163. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_LAST_MSDU_IN_MPDU_FLAG_OFFSET 0x00000008
  164. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_LAST_MSDU_IN_MPDU_FLAG_LSB 1
  165. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_LAST_MSDU_IN_MPDU_FLAG_MASK 0x00000002
  166. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION
  167. When set, this MSDU buffer was not able to hold the
  168. entire MSDU. The next buffer will therefor contain
  169. additional information related to this MSDU.
  170. <legal all>
  171. */
  172. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_OFFSET 0x00000008
  173. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_LSB 2
  174. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_CONTINUATION_MASK 0x00000004
  175. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_LENGTH
  176. Parsed from RX_MSDU_START TLV . In the case MSDU spans
  177. over multiple buffers, this field will be valid in the First
  178. buffer used by MSDU.
  179. Full MSDU length in bytes after decapsulation.
  180. This field is still valid for MPDU frames without
  181. A-MSDU. It still represents MSDU length after decapsulation
  182. Or in case of RAW MPDUs, it indicates the length of the
  183. entire MPDU (without FCS field)
  184. <legal all>
  185. */
  186. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_LENGTH_OFFSET 0x00000008
  187. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_LENGTH_LSB 3
  188. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_LENGTH_MASK 0x0001fff8
  189. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_REO_DESTINATION_INDICATION
  190. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  191. over multiple buffers, this field will be valid in the Last
  192. buffer used by the MSDU
  193. The ID of the REO exit ring where the MSDU frame shall
  194. push after (MPDU level) reordering has finished.
  195. <enum 0 reo_destination_tcl> Reo will push the frame
  196. into the REO2TCL ring
  197. <enum 1 reo_destination_sw1> Reo will push the frame
  198. into the REO2SW1 ring
  199. <enum 2 reo_destination_sw2> Reo will push the frame
  200. into the REO2SW2 ring
  201. <enum 3 reo_destination_sw3> Reo will push the frame
  202. into the REO2SW3 ring
  203. <enum 4 reo_destination_sw4> Reo will push the frame
  204. into the REO2SW4 ring
  205. <enum 5 reo_destination_release> Reo will push the frame
  206. into the REO_release ring
  207. <enum 6 reo_destination_fw> Reo will push the frame into
  208. the REO2FW ring
  209. <enum 7 reo_destination_sw5> Reo will push the frame
  210. into the REO2SW5 ring (REO remaps this in chips without
  211. REO2SW5 ring, e.g. Pine)
  212. <enum 8 reo_destination_sw6> Reo will push the frame
  213. into the REO2SW6 ring (REO remaps this in chips without
  214. REO2SW6 ring, e.g. Pine)
  215. <enum 9 reo_destination_9> REO remaps this <enum 10
  216. reo_destination_10> REO remaps this
  217. <enum 11 reo_destination_11> REO remaps this
  218. <enum 12 reo_destination_12> REO remaps this <enum 13
  219. reo_destination_13> REO remaps this
  220. <enum 14 reo_destination_14> REO remaps this
  221. <enum 15 reo_destination_15> REO remaps this
  222. <enum 16 reo_destination_16> REO remaps this
  223. <enum 17 reo_destination_17> REO remaps this
  224. <enum 18 reo_destination_18> REO remaps this
  225. <enum 19 reo_destination_19> REO remaps this
  226. <enum 20 reo_destination_20> REO remaps this
  227. <enum 21 reo_destination_21> REO remaps this
  228. <enum 22 reo_destination_22> REO remaps this
  229. <enum 23 reo_destination_23> REO remaps this
  230. <enum 24 reo_destination_24> REO remaps this
  231. <enum 25 reo_destination_25> REO remaps this
  232. <enum 26 reo_destination_26> REO remaps this
  233. <enum 27 reo_destination_27> REO remaps this
  234. <enum 28 reo_destination_28> REO remaps this
  235. <enum 29 reo_destination_29> REO remaps this
  236. <enum 30 reo_destination_30> REO remaps this
  237. <enum 31 reo_destination_31> REO remaps this
  238. <legal all>
  239. */
  240. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_REO_DESTINATION_INDICATION_OFFSET 0x00000008
  241. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_REO_DESTINATION_INDICATION_LSB 17
  242. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_REO_DESTINATION_INDICATION_MASK 0x003e0000
  243. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_DROP
  244. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  245. over multiple buffers, this field will be valid in the Last
  246. buffer used by the MSDU
  247. When set, REO shall drop this MSDU and not forward it to
  248. any other ring...
  249. <legal all>
  250. */
  251. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_DROP_OFFSET 0x00000008
  252. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_DROP_LSB 22
  253. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_MSDU_DROP_MASK 0x00400000
  254. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_SA_IS_VALID
  255. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  256. over multiple buffers, this field will be valid in the Last
  257. buffer used by the MSDU
  258. Indicates that OLE found a valid SA entry for this MSDU
  259. <legal all>
  260. */
  261. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_SA_IS_VALID_OFFSET 0x00000008
  262. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_SA_IS_VALID_LSB 23
  263. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_SA_IS_VALID_MASK 0x00800000
  264. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_SA_IDX_TIMEOUT
  265. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  266. over multiple buffers, this field will be valid in the Last
  267. buffer used by the MSDU
  268. Indicates an unsuccessful MAC source address search due
  269. to the expiring of the search timer for this MSDU
  270. <legal all>
  271. */
  272. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_SA_IDX_TIMEOUT_OFFSET 0x00000008
  273. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_SA_IDX_TIMEOUT_LSB 24
  274. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_SA_IDX_TIMEOUT_MASK 0x01000000
  275. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IS_VALID
  276. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  277. over multiple buffers, this field will be valid in the Last
  278. buffer used by the MSDU
  279. Indicates that OLE found a valid DA entry for this MSDU
  280. <legal all>
  281. */
  282. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IS_VALID_OFFSET 0x00000008
  283. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IS_VALID_LSB 25
  284. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IS_VALID_MASK 0x02000000
  285. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IS_MCBC
  286. Field Only valid if da_is_valid is set
  287. Indicates the DA address was a Multicast of Broadcast
  288. address for this MSDU
  289. <legal all>
  290. */
  291. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IS_MCBC_OFFSET 0x00000008
  292. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IS_MCBC_LSB 26
  293. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IS_MCBC_MASK 0x04000000
  294. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IDX_TIMEOUT
  295. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  296. over multiple buffers, this field will be valid in the Last
  297. buffer used by the MSDU
  298. Indicates an unsuccessful MAC destination address search
  299. due to the expiring of the search timer for this MSDU
  300. <legal all>
  301. */
  302. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IDX_TIMEOUT_OFFSET 0x00000008
  303. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IDX_TIMEOUT_LSB 27
  304. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_DA_IDX_TIMEOUT_MASK 0x08000000
  305. /* Description RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_RESERVED_0A
  306. <legal 0>
  307. */
  308. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_RESERVED_0A_OFFSET 0x00000008
  309. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_RESERVED_0A_LSB 28
  310. #define RX_MSDU_DETAILS_2_RX_MSDU_DESC_INFO_DETAILS_RESERVED_0A_MASK 0xf0000000
  311. /* Description RX_MSDU_DETAILS_3_RX_MSDU_DESC_INFO_DETAILS_RESERVED_1A
  312. <legal 0>
  313. */
  314. #define RX_MSDU_DETAILS_3_RX_MSDU_DESC_INFO_DETAILS_RESERVED_1A_OFFSET 0x0000000c
  315. #define RX_MSDU_DETAILS_3_RX_MSDU_DESC_INFO_DETAILS_RESERVED_1A_LSB 0
  316. #define RX_MSDU_DETAILS_3_RX_MSDU_DESC_INFO_DETAILS_RESERVED_1A_MASK 0xffffffff
  317. #endif // _RX_MSDU_DETAILS_H_