rx_msdu_desc_info.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  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_DESC_INFO_H_
  17. #define _RX_MSDU_DESC_INFO_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. // ################ START SUMMARY #################
  21. //
  22. // Dword Fields
  23. // 0 first_msdu_in_mpdu_flag[0], last_msdu_in_mpdu_flag[1], msdu_continuation[2], msdu_length[16:3], reo_destination_indication[21:17], msdu_drop[22], sa_is_valid[23], sa_idx_timeout[24], da_is_valid[25], da_is_mcbc[26], da_idx_timeout[27], reserved_0a[31:28]
  24. // 1 reserved_1a[31:0]
  25. //
  26. // ################ END SUMMARY #################
  27. #define NUM_OF_DWORDS_RX_MSDU_DESC_INFO 2
  28. struct rx_msdu_desc_info {
  29. uint32_t first_msdu_in_mpdu_flag : 1, //[0]
  30. last_msdu_in_mpdu_flag : 1, //[1]
  31. msdu_continuation : 1, //[2]
  32. msdu_length : 14, //[16:3]
  33. reo_destination_indication : 5, //[21:17]
  34. msdu_drop : 1, //[22]
  35. sa_is_valid : 1, //[23]
  36. sa_idx_timeout : 1, //[24]
  37. da_is_valid : 1, //[25]
  38. da_is_mcbc : 1, //[26]
  39. da_idx_timeout : 1, //[27]
  40. reserved_0a : 4; //[31:28]
  41. uint32_t reserved_1a : 32; //[31:0]
  42. };
  43. /*
  44. first_msdu_in_mpdu_flag
  45. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  46. over multiple buffers, this field will be valid in the Last
  47. buffer used by the MSDU
  48. <enum 0 Not_first_msdu> This is not the first MSDU in
  49. the MPDU.
  50. <enum 1 first_msdu> This MSDU is the first one in the
  51. MPDU.
  52. <legal all>
  53. last_msdu_in_mpdu_flag
  54. Consumer: WBM/REO/SW/FW
  55. Producer: RXDMA
  56. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  57. over multiple buffers, this field will be valid in the Last
  58. buffer used by the MSDU
  59. <enum 0 Not_last_msdu> There are more MSDUs linked to
  60. this MSDU that belongs to this MPDU
  61. <enum 1 Last_msdu> this MSDU is the last one in the
  62. MPDU. This setting is only allowed in combination with
  63. 'Msdu_continuation' set to 0. This implies that when an msdu
  64. is spread out over multiple buffers and thus
  65. msdu_continuation is set, only for the very last buffer of
  66. the msdu, can the 'last_msdu_in_mpdu_flag' be set.
  67. When both first_msdu_in_mpdu_flag and
  68. last_msdu_in_mpdu_flag are set, the MPDU that this MSDU
  69. belongs to only contains a single MSDU.
  70. <legal all>
  71. msdu_continuation
  72. When set, this MSDU buffer was not able to hold the
  73. entire MSDU. The next buffer will therefor contain
  74. additional information related to this MSDU.
  75. <legal all>
  76. msdu_length
  77. Parsed from RX_MSDU_START TLV . In the case MSDU spans
  78. over multiple buffers, this field will be valid in the First
  79. buffer used by MSDU.
  80. Full MSDU length in bytes after decapsulation.
  81. This field is still valid for MPDU frames without
  82. A-MSDU. It still represents MSDU length after decapsulation
  83. Or in case of RAW MPDUs, it indicates the length of the
  84. entire MPDU (without FCS field)
  85. <legal all>
  86. reo_destination_indication
  87. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  88. over multiple buffers, this field will be valid in the Last
  89. buffer used by the MSDU
  90. The ID of the REO exit ring where the MSDU frame shall
  91. push after (MPDU level) reordering has finished.
  92. <enum 0 reo_destination_tcl> Reo will push the frame
  93. into the REO2TCL ring
  94. <enum 1 reo_destination_sw1> Reo will push the frame
  95. into the REO2SW1 ring
  96. <enum 2 reo_destination_sw2> Reo will push the frame
  97. into the REO2SW2 ring
  98. <enum 3 reo_destination_sw3> Reo will push the frame
  99. into the REO2SW3 ring
  100. <enum 4 reo_destination_sw4> Reo will push the frame
  101. into the REO2SW4 ring
  102. <enum 5 reo_destination_release> Reo will push the frame
  103. into the REO_release ring
  104. <enum 6 reo_destination_fw> Reo will push the frame into
  105. the REO2FW ring
  106. <enum 7 reo_destination_sw5> Reo will push the frame
  107. into the REO2SW5 ring
  108. <enum 8 reo_destination_sw6> Reo will push the frame
  109. into the REO2SW6 ring
  110. <enum 9 reo_destination_9> REO remaps this <enum 10
  111. reo_destination_10> REO remaps this
  112. <enum 11 reo_destination_11> REO remaps this
  113. <enum 12 reo_destination_12> REO remaps this <enum 13
  114. reo_destination_13> REO remaps this
  115. <enum 14 reo_destination_14> REO remaps this
  116. <enum 15 reo_destination_15> REO remaps this
  117. <enum 16 reo_destination_16> REO remaps this
  118. <enum 17 reo_destination_17> REO remaps this
  119. <enum 18 reo_destination_18> REO remaps this
  120. <enum 19 reo_destination_19> REO remaps this
  121. <enum 20 reo_destination_20> REO remaps this
  122. <enum 21 reo_destination_21> REO remaps this
  123. <enum 22 reo_destination_22> REO remaps this
  124. <enum 23 reo_destination_23> REO remaps this
  125. <enum 24 reo_destination_24> REO remaps this
  126. <enum 25 reo_destination_25> REO remaps this
  127. <enum 26 reo_destination_26> REO remaps this
  128. <enum 27 reo_destination_27> REO remaps this
  129. <enum 28 reo_destination_28> REO remaps this
  130. <enum 29 reo_destination_29> REO remaps this
  131. <enum 30 reo_destination_30> REO remaps this
  132. <enum 31 reo_destination_31> REO remaps this
  133. <legal all>
  134. msdu_drop
  135. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  136. over multiple buffers, this field will be valid in the Last
  137. buffer used by the MSDU
  138. When set, REO shall drop this MSDU and not forward it to
  139. any other ring...
  140. <legal all>
  141. sa_is_valid
  142. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  143. over multiple buffers, this field will be valid in the Last
  144. buffer used by the MSDU
  145. Indicates that OLE found a valid SA entry for this MSDU
  146. <legal all>
  147. sa_idx_timeout
  148. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  149. over multiple buffers, this field will be valid in the Last
  150. buffer used by the MSDU
  151. Indicates an unsuccessful MAC source address search due
  152. to the expiring of the search timer for this MSDU
  153. <legal all>
  154. da_is_valid
  155. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  156. over multiple buffers, this field will be valid in the Last
  157. buffer used by the MSDU
  158. Indicates that OLE found a valid DA entry for this MSDU
  159. <legal all>
  160. da_is_mcbc
  161. Field Only valid if da_is_valid is set
  162. Indicates the DA address was a Multicast of Broadcast
  163. address for this MSDU
  164. <legal all>
  165. da_idx_timeout
  166. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  167. over multiple buffers, this field will be valid in the Last
  168. buffer used by the MSDU
  169. Indicates an unsuccessful MAC destination address search
  170. due to the expiring of the search timer for this MSDU
  171. <legal all>
  172. reserved_0a
  173. <legal 0>
  174. reserved_1a
  175. <legal 0>
  176. */
  177. /* Description RX_MSDU_DESC_INFO_0_FIRST_MSDU_IN_MPDU_FLAG
  178. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  179. over multiple buffers, this field will be valid in the Last
  180. buffer used by the MSDU
  181. <enum 0 Not_first_msdu> This is not the first MSDU in
  182. the MPDU.
  183. <enum 1 first_msdu> This MSDU is the first one in the
  184. MPDU.
  185. <legal all>
  186. */
  187. #define RX_MSDU_DESC_INFO_0_FIRST_MSDU_IN_MPDU_FLAG_OFFSET 0x00000000
  188. #define RX_MSDU_DESC_INFO_0_FIRST_MSDU_IN_MPDU_FLAG_LSB 0
  189. #define RX_MSDU_DESC_INFO_0_FIRST_MSDU_IN_MPDU_FLAG_MASK 0x00000001
  190. /* Description RX_MSDU_DESC_INFO_0_LAST_MSDU_IN_MPDU_FLAG
  191. Consumer: WBM/REO/SW/FW
  192. Producer: RXDMA
  193. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  194. over multiple buffers, this field will be valid in the Last
  195. buffer used by the MSDU
  196. <enum 0 Not_last_msdu> There are more MSDUs linked to
  197. this MSDU that belongs to this MPDU
  198. <enum 1 Last_msdu> this MSDU is the last one in the
  199. MPDU. This setting is only allowed in combination with
  200. 'Msdu_continuation' set to 0. This implies that when an msdu
  201. is spread out over multiple buffers and thus
  202. msdu_continuation is set, only for the very last buffer of
  203. the msdu, can the 'last_msdu_in_mpdu_flag' be set.
  204. When both first_msdu_in_mpdu_flag and
  205. last_msdu_in_mpdu_flag are set, the MPDU that this MSDU
  206. belongs to only contains a single MSDU.
  207. <legal all>
  208. */
  209. #define RX_MSDU_DESC_INFO_0_LAST_MSDU_IN_MPDU_FLAG_OFFSET 0x00000000
  210. #define RX_MSDU_DESC_INFO_0_LAST_MSDU_IN_MPDU_FLAG_LSB 1
  211. #define RX_MSDU_DESC_INFO_0_LAST_MSDU_IN_MPDU_FLAG_MASK 0x00000002
  212. /* Description RX_MSDU_DESC_INFO_0_MSDU_CONTINUATION
  213. When set, this MSDU buffer was not able to hold the
  214. entire MSDU. The next buffer will therefor contain
  215. additional information related to this MSDU.
  216. <legal all>
  217. */
  218. #define RX_MSDU_DESC_INFO_0_MSDU_CONTINUATION_OFFSET 0x00000000
  219. #define RX_MSDU_DESC_INFO_0_MSDU_CONTINUATION_LSB 2
  220. #define RX_MSDU_DESC_INFO_0_MSDU_CONTINUATION_MASK 0x00000004
  221. /* Description RX_MSDU_DESC_INFO_0_MSDU_LENGTH
  222. Parsed from RX_MSDU_START TLV . In the case MSDU spans
  223. over multiple buffers, this field will be valid in the First
  224. buffer used by MSDU.
  225. Full MSDU length in bytes after decapsulation.
  226. This field is still valid for MPDU frames without
  227. A-MSDU. It still represents MSDU length after decapsulation
  228. Or in case of RAW MPDUs, it indicates the length of the
  229. entire MPDU (without FCS field)
  230. <legal all>
  231. */
  232. #define RX_MSDU_DESC_INFO_0_MSDU_LENGTH_OFFSET 0x00000000
  233. #define RX_MSDU_DESC_INFO_0_MSDU_LENGTH_LSB 3
  234. #define RX_MSDU_DESC_INFO_0_MSDU_LENGTH_MASK 0x0001fff8
  235. /* Description RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION
  236. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  237. over multiple buffers, this field will be valid in the Last
  238. buffer used by the MSDU
  239. The ID of the REO exit ring where the MSDU frame shall
  240. push after (MPDU level) reordering has finished.
  241. <enum 0 reo_destination_tcl> Reo will push the frame
  242. into the REO2TCL ring
  243. <enum 1 reo_destination_sw1> Reo will push the frame
  244. into the REO2SW1 ring
  245. <enum 2 reo_destination_sw2> Reo will push the frame
  246. into the REO2SW2 ring
  247. <enum 3 reo_destination_sw3> Reo will push the frame
  248. into the REO2SW3 ring
  249. <enum 4 reo_destination_sw4> Reo will push the frame
  250. into the REO2SW4 ring
  251. <enum 5 reo_destination_release> Reo will push the frame
  252. into the REO_release ring
  253. <enum 6 reo_destination_fw> Reo will push the frame into
  254. the REO2FW ring
  255. <enum 7 reo_destination_sw5> Reo will push the frame
  256. into the REO2SW5 ring
  257. <enum 8 reo_destination_sw6> Reo will push the frame
  258. into the REO2SW6 ring
  259. <enum 9 reo_destination_9> REO remaps this <enum 10
  260. reo_destination_10> REO remaps this
  261. <enum 11 reo_destination_11> REO remaps this
  262. <enum 12 reo_destination_12> REO remaps this <enum 13
  263. reo_destination_13> REO remaps this
  264. <enum 14 reo_destination_14> REO remaps this
  265. <enum 15 reo_destination_15> REO remaps this
  266. <enum 16 reo_destination_16> REO remaps this
  267. <enum 17 reo_destination_17> REO remaps this
  268. <enum 18 reo_destination_18> REO remaps this
  269. <enum 19 reo_destination_19> REO remaps this
  270. <enum 20 reo_destination_20> REO remaps this
  271. <enum 21 reo_destination_21> REO remaps this
  272. <enum 22 reo_destination_22> REO remaps this
  273. <enum 23 reo_destination_23> REO remaps this
  274. <enum 24 reo_destination_24> REO remaps this
  275. <enum 25 reo_destination_25> REO remaps this
  276. <enum 26 reo_destination_26> REO remaps this
  277. <enum 27 reo_destination_27> REO remaps this
  278. <enum 28 reo_destination_28> REO remaps this
  279. <enum 29 reo_destination_29> REO remaps this
  280. <enum 30 reo_destination_30> REO remaps this
  281. <enum 31 reo_destination_31> REO remaps this
  282. <legal all>
  283. */
  284. #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_OFFSET 0x00000000
  285. #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_LSB 17
  286. #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_MASK 0x003e0000
  287. /* Description RX_MSDU_DESC_INFO_0_MSDU_DROP
  288. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  289. over multiple buffers, this field will be valid in the Last
  290. buffer used by the MSDU
  291. When set, REO shall drop this MSDU and not forward it to
  292. any other ring...
  293. <legal all>
  294. */
  295. #define RX_MSDU_DESC_INFO_0_MSDU_DROP_OFFSET 0x00000000
  296. #define RX_MSDU_DESC_INFO_0_MSDU_DROP_LSB 22
  297. #define RX_MSDU_DESC_INFO_0_MSDU_DROP_MASK 0x00400000
  298. /* Description RX_MSDU_DESC_INFO_0_SA_IS_VALID
  299. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  300. over multiple buffers, this field will be valid in the Last
  301. buffer used by the MSDU
  302. Indicates that OLE found a valid SA entry for this MSDU
  303. <legal all>
  304. */
  305. #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_OFFSET 0x00000000
  306. #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_LSB 23
  307. #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_MASK 0x00800000
  308. /* Description RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT
  309. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  310. over multiple buffers, this field will be valid in the Last
  311. buffer used by the MSDU
  312. Indicates an unsuccessful MAC source address search due
  313. to the expiring of the search timer for this MSDU
  314. <legal all>
  315. */
  316. #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_OFFSET 0x00000000
  317. #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_LSB 24
  318. #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_MASK 0x01000000
  319. /* Description RX_MSDU_DESC_INFO_0_DA_IS_VALID
  320. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  321. over multiple buffers, this field will be valid in the Last
  322. buffer used by the MSDU
  323. Indicates that OLE found a valid DA entry for this MSDU
  324. <legal all>
  325. */
  326. #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_OFFSET 0x00000000
  327. #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_LSB 25
  328. #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_MASK 0x02000000
  329. /* Description RX_MSDU_DESC_INFO_0_DA_IS_MCBC
  330. Field Only valid if da_is_valid is set
  331. Indicates the DA address was a Multicast of Broadcast
  332. address for this MSDU
  333. <legal all>
  334. */
  335. #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_OFFSET 0x00000000
  336. #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_LSB 26
  337. #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_MASK 0x04000000
  338. /* Description RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT
  339. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  340. over multiple buffers, this field will be valid in the Last
  341. buffer used by the MSDU
  342. Indicates an unsuccessful MAC destination address search
  343. due to the expiring of the search timer for this MSDU
  344. <legal all>
  345. */
  346. #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_OFFSET 0x00000000
  347. #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_LSB 27
  348. #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_MASK 0x08000000
  349. /* Description RX_MSDU_DESC_INFO_0_RESERVED_0A
  350. <legal 0>
  351. */
  352. #define RX_MSDU_DESC_INFO_0_RESERVED_0A_OFFSET 0x00000000
  353. #define RX_MSDU_DESC_INFO_0_RESERVED_0A_LSB 28
  354. #define RX_MSDU_DESC_INFO_0_RESERVED_0A_MASK 0xf0000000
  355. /* Description RX_MSDU_DESC_INFO_1_RESERVED_1A
  356. <legal 0>
  357. */
  358. #define RX_MSDU_DESC_INFO_1_RESERVED_1A_OFFSET 0x00000004
  359. #define RX_MSDU_DESC_INFO_1_RESERVED_1A_LSB 0
  360. #define RX_MSDU_DESC_INFO_1_RESERVED_1A_MASK 0xffffffff
  361. #endif // _RX_MSDU_DESC_INFO_H_