rx_msdu_desc_info.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. /*
  2. * Copyright (c) 2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef _RX_MSDU_DESC_INFO_H_
  19. #define _RX_MSDU_DESC_INFO_H_
  20. #if !defined(__ASSEMBLER__)
  21. #endif
  22. // ################ START SUMMARY #################
  23. //
  24. // Dword Fields
  25. // 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]
  26. // 1 reserved_1a[31:0]
  27. //
  28. // ################ END SUMMARY #################
  29. #define NUM_OF_DWORDS_RX_MSDU_DESC_INFO 2
  30. struct rx_msdu_desc_info {
  31. uint32_t first_msdu_in_mpdu_flag : 1, //[0]
  32. last_msdu_in_mpdu_flag : 1, //[1]
  33. msdu_continuation : 1, //[2]
  34. msdu_length : 14, //[16:3]
  35. reo_destination_indication : 5, //[21:17]
  36. msdu_drop : 1, //[22]
  37. sa_is_valid : 1, //[23]
  38. sa_idx_timeout : 1, //[24]
  39. da_is_valid : 1, //[25]
  40. da_is_mcbc : 1, //[26]
  41. da_idx_timeout : 1, //[27]
  42. reserved_0a : 4; //[31:28]
  43. uint32_t reserved_1a : 32; //[31:0]
  44. };
  45. /*
  46. first_msdu_in_mpdu_flag
  47. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  48. over multiple buffers, this field will be valid in the Last
  49. buffer used by the MSDU
  50. <enum 0 Not_first_msdu> This is not the first MSDU in
  51. the MPDU.
  52. <enum 1 first_msdu> This MSDU is the first one in the
  53. MPDU.
  54. <legal all>
  55. last_msdu_in_mpdu_flag
  56. Consumer: WBM/REO/SW/FW
  57. Producer: RXDMA
  58. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  59. over multiple buffers, this field will be valid in the Last
  60. buffer used by the MSDU
  61. <enum 0 Not_last_msdu> There are more MSDUs linked to
  62. this MSDU that belongs to this MPDU
  63. <enum 1 Last_msdu> this MSDU is the last one in the
  64. MPDU. This setting is only allowed in combination with
  65. 'Msdu_continuation' set to 0. This implies that when an msdu
  66. is spread out over multiple buffers and thus
  67. msdu_continuation is set, only for the very last buffer of
  68. the msdu, can the 'last_msdu_in_mpdu_flag' be set.
  69. When both first_msdu_in_mpdu_flag and
  70. last_msdu_in_mpdu_flag are set, the MPDU that this MSDU
  71. belongs to only contains a single MSDU.
  72. <legal all>
  73. msdu_continuation
  74. When set, this MSDU buffer was not able to hold the
  75. entire MSDU. The next buffer will therefor contain
  76. additional information related to this MSDU.
  77. <legal all>
  78. msdu_length
  79. Parsed from RX_MSDU_START TLV . In the case MSDU spans
  80. over multiple buffers, this field will be valid in the First
  81. buffer used by MSDU.
  82. Full MSDU length in bytes after decapsulation.
  83. This field is still valid for MPDU frames without
  84. A-MSDU. It still represents MSDU length after decapsulation
  85. Or in case of RAW MPDUs, it indicates the length of the
  86. entire MPDU (without FCS field)
  87. <legal all>
  88. reo_destination_indication
  89. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  90. over multiple buffers, this field will be valid in the Last
  91. buffer used by the MSDU
  92. The ID of the REO exit ring where the MSDU frame shall
  93. push after (MPDU level) reordering has finished.
  94. <enum 0 reo_destination_tcl> Reo will push the frame
  95. into the REO2TCL ring
  96. <enum 1 reo_destination_sw1> Reo will push the frame
  97. into the REO2SW1 ring
  98. <enum 2 reo_destination_sw2> Reo will push the frame
  99. into the REO2SW1 ring
  100. <enum 3 reo_destination_sw3> Reo will push the frame
  101. into the REO2SW1 ring
  102. <enum 4 reo_destination_sw4> Reo will push the frame
  103. into the REO2SW1 ring
  104. <enum 5 reo_destination_release> Reo will push the frame
  105. into the REO_release ring
  106. <enum 6 reo_destination_fw> Reo will push the frame into
  107. the REO2FW ring
  108. <enum 7 reo_destination_7> REO remaps this
  109. <enum 8 reo_destination_8> REO remaps this <enum 9
  110. 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 REO2SW1 ring
  247. <enum 3 reo_destination_sw3> Reo will push the frame
  248. into the REO2SW1 ring
  249. <enum 4 reo_destination_sw4> Reo will push the frame
  250. into the REO2SW1 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_7> REO remaps this
  256. <enum 8 reo_destination_8> REO remaps this <enum 9
  257. reo_destination_9> REO remaps this <enum 10
  258. reo_destination_10> REO remaps this
  259. <enum 11 reo_destination_11> REO remaps this
  260. <enum 12 reo_destination_12> REO remaps this <enum 13
  261. reo_destination_13> REO remaps this
  262. <enum 14 reo_destination_14> REO remaps this
  263. <enum 15 reo_destination_15> REO remaps this
  264. <enum 16 reo_destination_16> REO remaps this
  265. <enum 17 reo_destination_17> REO remaps this
  266. <enum 18 reo_destination_18> REO remaps this
  267. <enum 19 reo_destination_19> REO remaps this
  268. <enum 20 reo_destination_20> REO remaps this
  269. <enum 21 reo_destination_21> REO remaps this
  270. <enum 22 reo_destination_22> REO remaps this
  271. <enum 23 reo_destination_23> REO remaps this
  272. <enum 24 reo_destination_24> REO remaps this
  273. <enum 25 reo_destination_25> REO remaps this
  274. <enum 26 reo_destination_26> REO remaps this
  275. <enum 27 reo_destination_27> REO remaps this
  276. <enum 28 reo_destination_28> REO remaps this
  277. <enum 29 reo_destination_29> REO remaps this
  278. <enum 30 reo_destination_30> REO remaps this
  279. <enum 31 reo_destination_31> REO remaps this
  280. <legal all>
  281. */
  282. #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_OFFSET 0x00000000
  283. #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_LSB 17
  284. #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_MASK 0x003e0000
  285. /* Description RX_MSDU_DESC_INFO_0_MSDU_DROP
  286. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  287. over multiple buffers, this field will be valid in the Last
  288. buffer used by the MSDU
  289. When set, REO shall drop this MSDU and not forward it to
  290. any other ring...
  291. <legal all>
  292. */
  293. #define RX_MSDU_DESC_INFO_0_MSDU_DROP_OFFSET 0x00000000
  294. #define RX_MSDU_DESC_INFO_0_MSDU_DROP_LSB 22
  295. #define RX_MSDU_DESC_INFO_0_MSDU_DROP_MASK 0x00400000
  296. /* Description RX_MSDU_DESC_INFO_0_SA_IS_VALID
  297. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  298. over multiple buffers, this field will be valid in the Last
  299. buffer used by the MSDU
  300. Indicates that OLE found a valid SA entry for this MSDU
  301. <legal all>
  302. */
  303. #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_OFFSET 0x00000000
  304. #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_LSB 23
  305. #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_MASK 0x00800000
  306. /* Description RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT
  307. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  308. over multiple buffers, this field will be valid in the Last
  309. buffer used by the MSDU
  310. Indicates an unsuccessful MAC source address search due
  311. to the expiring of the search timer for this MSDU
  312. <legal all>
  313. */
  314. #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_OFFSET 0x00000000
  315. #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_LSB 24
  316. #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_MASK 0x01000000
  317. /* Description RX_MSDU_DESC_INFO_0_DA_IS_VALID
  318. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  319. over multiple buffers, this field will be valid in the Last
  320. buffer used by the MSDU
  321. Indicates that OLE found a valid DA entry for this MSDU
  322. <legal all>
  323. */
  324. #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_OFFSET 0x00000000
  325. #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_LSB 25
  326. #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_MASK 0x02000000
  327. /* Description RX_MSDU_DESC_INFO_0_DA_IS_MCBC
  328. Field Only valid if da_is_valid is set
  329. Indicates the DA address was a Multicast of Broadcast
  330. address for this MSDU
  331. <legal all>
  332. */
  333. #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_OFFSET 0x00000000
  334. #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_LSB 26
  335. #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_MASK 0x04000000
  336. /* Description RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT
  337. Parsed from RX_MSDU_END TLV . In the case MSDU spans
  338. over multiple buffers, this field will be valid in the Last
  339. buffer used by the MSDU
  340. Indicates an unsuccessful MAC destination address search
  341. due to the expiring of the search timer for this MSDU
  342. <legal all>
  343. */
  344. #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_OFFSET 0x00000000
  345. #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_LSB 27
  346. #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_MASK 0x08000000
  347. /* Description RX_MSDU_DESC_INFO_0_RESERVED_0A
  348. <legal 0>
  349. */
  350. #define RX_MSDU_DESC_INFO_0_RESERVED_0A_OFFSET 0x00000000
  351. #define RX_MSDU_DESC_INFO_0_RESERVED_0A_LSB 28
  352. #define RX_MSDU_DESC_INFO_0_RESERVED_0A_MASK 0xf0000000
  353. /* Description RX_MSDU_DESC_INFO_1_RESERVED_1A
  354. <legal 0>
  355. */
  356. #define RX_MSDU_DESC_INFO_1_RESERVED_1A_OFFSET 0x00000004
  357. #define RX_MSDU_DESC_INFO_1_RESERVED_1A_LSB 0
  358. #define RX_MSDU_DESC_INFO_1_RESERVED_1A_MASK 0xffffffff
  359. #endif // _RX_MSDU_DESC_INFO_H_