rx_mpdu_desc_info.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  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_MPDU_DESC_INFO_H_
  19. #define _RX_MPDU_DESC_INFO_H_
  20. #if !defined(__ASSEMBLER__)
  21. #endif
  22. // ################ START SUMMARY #################
  23. //
  24. // Dword Fields
  25. // 0 msdu_count[7:0], mpdu_sequence_number[19:8], fragment_flag[20], mpdu_retry_bit[21], ampdu_flag[22], bar_frame[23], pn_fields_contain_valid_info[24], sa_is_valid[25], sa_idx_timeout[26], da_is_valid[27], da_is_mcbc[28], da_idx_timeout[29], raw_mpdu[30], more_fragment_flag[31]
  26. // 1 peer_meta_data[31:0]
  27. //
  28. // ################ END SUMMARY #################
  29. #define NUM_OF_DWORDS_RX_MPDU_DESC_INFO 2
  30. struct rx_mpdu_desc_info {
  31. uint32_t msdu_count : 8, //[7:0]
  32. mpdu_sequence_number : 12, //[19:8]
  33. fragment_flag : 1, //[20]
  34. mpdu_retry_bit : 1, //[21]
  35. ampdu_flag : 1, //[22]
  36. bar_frame : 1, //[23]
  37. pn_fields_contain_valid_info : 1, //[24]
  38. sa_is_valid : 1, //[25]
  39. sa_idx_timeout : 1, //[26]
  40. da_is_valid : 1, //[27]
  41. da_is_mcbc : 1, //[28]
  42. da_idx_timeout : 1, //[29]
  43. raw_mpdu : 1, //[30]
  44. more_fragment_flag : 1; //[31]
  45. uint32_t peer_meta_data : 32; //[31:0]
  46. };
  47. /*
  48. msdu_count
  49. Consumer: REO/SW/FW
  50. Producer: RXDMA
  51. The number of MSDUs within the MPDU
  52. <legal all>
  53. mpdu_sequence_number
  54. Consumer: REO/SW/FW
  55. Producer: RXDMA
  56. The field can have two different meanings based on the
  57. setting of field 'BAR_frame':
  58. 'BAR_frame' is NOT set:
  59. The MPDU sequence number of the received frame.
  60. 'BAR_frame' is set.
  61. The MPDU Start sequence number from the BAR frame
  62. <legal all>
  63. fragment_flag
  64. Consumer: REO/SW/FW
  65. Producer: RXDMA
  66. When set, this MPDU is a fragment and REO should forward
  67. this fragment MPDU to the REO destination ring without any
  68. reorder checks, pn checks or bitmap update. This implies
  69. that REO is forwarding the pointer to the MSDU link
  70. descriptor. The destination ring is coming from a
  71. programmable register setting in REO
  72. <legal all>
  73. mpdu_retry_bit
  74. Consumer: REO/SW/FW
  75. Producer: RXDMA
  76. The retry bit setting from the MPDU header of the
  77. received frame
  78. <legal all>
  79. ampdu_flag
  80. Consumer: REO/SW/FW
  81. Producer: RXDMA
  82. When set, the MPDU was received as part of an A-MPDU.
  83. <legal all>
  84. bar_frame
  85. Consumer: REO/SW/FW
  86. Producer: RXDMA
  87. When set, the received frame is a BAR frame. After
  88. processing, this frame shall be pushed to SW or deleted.
  89. <legal all>
  90. pn_fields_contain_valid_info
  91. Consumer: REO/SW/FW
  92. Producer: RXDMA
  93. Copied here by RXDMA from RX_MPDU_END
  94. When not set, REO will Not perform a PN sequence number
  95. check
  96. sa_is_valid
  97. When set, OLE found a valid SA entry for all MSDUs in
  98. this MPDU
  99. <legal all>
  100. sa_idx_timeout
  101. When set, at least 1 MSDU within the MPDU has an
  102. unsuccessful MAC source address search due to the expiration
  103. of the search timer.
  104. <legal all>
  105. da_is_valid
  106. When set, OLE found a valid DA entry for all MSDUs in
  107. this MPDU
  108. <legal all>
  109. da_is_mcbc
  110. Field Only valid if da_is_valid is set
  111. When set, at least one of the DA addresses is a
  112. Multicast or Broadcast address.
  113. <legal all>
  114. da_idx_timeout
  115. When set, at least 1 MSDU within the MPDU has an
  116. unsuccessful MAC destination address search due to the
  117. expiration of the search timer.
  118. <legal all>
  119. raw_mpdu
  120. Field only valid when first_msdu_in_mpdu_flag is set.
  121. When set, the contents in the MSDU buffer contains a
  122. 'RAW' MPDU. This 'RAW' MPDU might be spread out over
  123. multiple MSDU buffers.
  124. <legal all>
  125. more_fragment_flag
  126. The More Fragment bit setting from the MPDU header of
  127. the received frame
  128. <legal all>
  129. peer_meta_data
  130. Meta data that SW has programmed in the Peer table entry
  131. of the transmitting STA.
  132. <legal all>
  133. */
  134. /* Description RX_MPDU_DESC_INFO_0_MSDU_COUNT
  135. Consumer: REO/SW/FW
  136. Producer: RXDMA
  137. The number of MSDUs within the MPDU
  138. <legal all>
  139. */
  140. #define RX_MPDU_DESC_INFO_0_MSDU_COUNT_OFFSET 0x00000000
  141. #define RX_MPDU_DESC_INFO_0_MSDU_COUNT_LSB 0
  142. #define RX_MPDU_DESC_INFO_0_MSDU_COUNT_MASK 0x000000ff
  143. /* Description RX_MPDU_DESC_INFO_0_MPDU_SEQUENCE_NUMBER
  144. Consumer: REO/SW/FW
  145. Producer: RXDMA
  146. The field can have two different meanings based on the
  147. setting of field 'BAR_frame':
  148. 'BAR_frame' is NOT set:
  149. The MPDU sequence number of the received frame.
  150. 'BAR_frame' is set.
  151. The MPDU Start sequence number from the BAR frame
  152. <legal all>
  153. */
  154. #define RX_MPDU_DESC_INFO_0_MPDU_SEQUENCE_NUMBER_OFFSET 0x00000000
  155. #define RX_MPDU_DESC_INFO_0_MPDU_SEQUENCE_NUMBER_LSB 8
  156. #define RX_MPDU_DESC_INFO_0_MPDU_SEQUENCE_NUMBER_MASK 0x000fff00
  157. /* Description RX_MPDU_DESC_INFO_0_FRAGMENT_FLAG
  158. Consumer: REO/SW/FW
  159. Producer: RXDMA
  160. When set, this MPDU is a fragment and REO should forward
  161. this fragment MPDU to the REO destination ring without any
  162. reorder checks, pn checks or bitmap update. This implies
  163. that REO is forwarding the pointer to the MSDU link
  164. descriptor. The destination ring is coming from a
  165. programmable register setting in REO
  166. <legal all>
  167. */
  168. #define RX_MPDU_DESC_INFO_0_FRAGMENT_FLAG_OFFSET 0x00000000
  169. #define RX_MPDU_DESC_INFO_0_FRAGMENT_FLAG_LSB 20
  170. #define RX_MPDU_DESC_INFO_0_FRAGMENT_FLAG_MASK 0x00100000
  171. /* Description RX_MPDU_DESC_INFO_0_MPDU_RETRY_BIT
  172. Consumer: REO/SW/FW
  173. Producer: RXDMA
  174. The retry bit setting from the MPDU header of the
  175. received frame
  176. <legal all>
  177. */
  178. #define RX_MPDU_DESC_INFO_0_MPDU_RETRY_BIT_OFFSET 0x00000000
  179. #define RX_MPDU_DESC_INFO_0_MPDU_RETRY_BIT_LSB 21
  180. #define RX_MPDU_DESC_INFO_0_MPDU_RETRY_BIT_MASK 0x00200000
  181. /* Description RX_MPDU_DESC_INFO_0_AMPDU_FLAG
  182. Consumer: REO/SW/FW
  183. Producer: RXDMA
  184. When set, the MPDU was received as part of an A-MPDU.
  185. <legal all>
  186. */
  187. #define RX_MPDU_DESC_INFO_0_AMPDU_FLAG_OFFSET 0x00000000
  188. #define RX_MPDU_DESC_INFO_0_AMPDU_FLAG_LSB 22
  189. #define RX_MPDU_DESC_INFO_0_AMPDU_FLAG_MASK 0x00400000
  190. /* Description RX_MPDU_DESC_INFO_0_BAR_FRAME
  191. Consumer: REO/SW/FW
  192. Producer: RXDMA
  193. When set, the received frame is a BAR frame. After
  194. processing, this frame shall be pushed to SW or deleted.
  195. <legal all>
  196. */
  197. #define RX_MPDU_DESC_INFO_0_BAR_FRAME_OFFSET 0x00000000
  198. #define RX_MPDU_DESC_INFO_0_BAR_FRAME_LSB 23
  199. #define RX_MPDU_DESC_INFO_0_BAR_FRAME_MASK 0x00800000
  200. /* Description RX_MPDU_DESC_INFO_0_PN_FIELDS_CONTAIN_VALID_INFO
  201. Consumer: REO/SW/FW
  202. Producer: RXDMA
  203. Copied here by RXDMA from RX_MPDU_END
  204. When not set, REO will Not perform a PN sequence number
  205. check
  206. */
  207. #define RX_MPDU_DESC_INFO_0_PN_FIELDS_CONTAIN_VALID_INFO_OFFSET 0x00000000
  208. #define RX_MPDU_DESC_INFO_0_PN_FIELDS_CONTAIN_VALID_INFO_LSB 24
  209. #define RX_MPDU_DESC_INFO_0_PN_FIELDS_CONTAIN_VALID_INFO_MASK 0x01000000
  210. /* Description RX_MPDU_DESC_INFO_0_SA_IS_VALID
  211. When set, OLE found a valid SA entry for all MSDUs in
  212. this MPDU
  213. <legal all>
  214. */
  215. #define RX_MPDU_DESC_INFO_0_SA_IS_VALID_OFFSET 0x00000000
  216. #define RX_MPDU_DESC_INFO_0_SA_IS_VALID_LSB 25
  217. #define RX_MPDU_DESC_INFO_0_SA_IS_VALID_MASK 0x02000000
  218. /* Description RX_MPDU_DESC_INFO_0_SA_IDX_TIMEOUT
  219. When set, at least 1 MSDU within the MPDU has an
  220. unsuccessful MAC source address search due to the expiration
  221. of the search timer.
  222. <legal all>
  223. */
  224. #define RX_MPDU_DESC_INFO_0_SA_IDX_TIMEOUT_OFFSET 0x00000000
  225. #define RX_MPDU_DESC_INFO_0_SA_IDX_TIMEOUT_LSB 26
  226. #define RX_MPDU_DESC_INFO_0_SA_IDX_TIMEOUT_MASK 0x04000000
  227. /* Description RX_MPDU_DESC_INFO_0_DA_IS_VALID
  228. When set, OLE found a valid DA entry for all MSDUs in
  229. this MPDU
  230. <legal all>
  231. */
  232. #define RX_MPDU_DESC_INFO_0_DA_IS_VALID_OFFSET 0x00000000
  233. #define RX_MPDU_DESC_INFO_0_DA_IS_VALID_LSB 27
  234. #define RX_MPDU_DESC_INFO_0_DA_IS_VALID_MASK 0x08000000
  235. /* Description RX_MPDU_DESC_INFO_0_DA_IS_MCBC
  236. Field Only valid if da_is_valid is set
  237. When set, at least one of the DA addresses is a
  238. Multicast or Broadcast address.
  239. <legal all>
  240. */
  241. #define RX_MPDU_DESC_INFO_0_DA_IS_MCBC_OFFSET 0x00000000
  242. #define RX_MPDU_DESC_INFO_0_DA_IS_MCBC_LSB 28
  243. #define RX_MPDU_DESC_INFO_0_DA_IS_MCBC_MASK 0x10000000
  244. /* Description RX_MPDU_DESC_INFO_0_DA_IDX_TIMEOUT
  245. When set, at least 1 MSDU within the MPDU has an
  246. unsuccessful MAC destination address search due to the
  247. expiration of the search timer.
  248. <legal all>
  249. */
  250. #define RX_MPDU_DESC_INFO_0_DA_IDX_TIMEOUT_OFFSET 0x00000000
  251. #define RX_MPDU_DESC_INFO_0_DA_IDX_TIMEOUT_LSB 29
  252. #define RX_MPDU_DESC_INFO_0_DA_IDX_TIMEOUT_MASK 0x20000000
  253. /* Description RX_MPDU_DESC_INFO_0_RAW_MPDU
  254. Field only valid when first_msdu_in_mpdu_flag is set.
  255. When set, the contents in the MSDU buffer contains a
  256. 'RAW' MPDU. This 'RAW' MPDU might be spread out over
  257. multiple MSDU buffers.
  258. <legal all>
  259. */
  260. #define RX_MPDU_DESC_INFO_0_RAW_MPDU_OFFSET 0x00000000
  261. #define RX_MPDU_DESC_INFO_0_RAW_MPDU_LSB 30
  262. #define RX_MPDU_DESC_INFO_0_RAW_MPDU_MASK 0x40000000
  263. /* Description RX_MPDU_DESC_INFO_0_MORE_FRAGMENT_FLAG
  264. The More Fragment bit setting from the MPDU header of
  265. the received frame
  266. <legal all>
  267. */
  268. #define RX_MPDU_DESC_INFO_0_MORE_FRAGMENT_FLAG_OFFSET 0x00000000
  269. #define RX_MPDU_DESC_INFO_0_MORE_FRAGMENT_FLAG_LSB 31
  270. #define RX_MPDU_DESC_INFO_0_MORE_FRAGMENT_FLAG_MASK 0x80000000
  271. /* Description RX_MPDU_DESC_INFO_1_PEER_META_DATA
  272. Meta data that SW has programmed in the Peer table entry
  273. of the transmitting STA.
  274. <legal all>
  275. */
  276. #define RX_MPDU_DESC_INFO_1_PEER_META_DATA_OFFSET 0x00000004
  277. #define RX_MPDU_DESC_INFO_1_PEER_META_DATA_LSB 0
  278. #define RX_MPDU_DESC_INFO_1_PEER_META_DATA_MASK 0xffffffff
  279. #endif // _RX_MPDU_DESC_INFO_H_