receive_user_info.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. /*
  2. * Copyright (c) 2020 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. //
  19. // DO NOT EDIT! This file is automatically generated
  20. // These definitions are tied to a particular hardware layout
  21. #ifndef _RECEIVE_USER_INFO_H_
  22. #define _RECEIVE_USER_INFO_H_
  23. #if !defined(__ASSEMBLER__)
  24. #endif
  25. // ################ START SUMMARY #################
  26. //
  27. // Dword Fields
  28. // 0 phy_ppdu_id[15:0], user_rssi[23:16], pkt_type[27:24], stbc[28], reception_type[31:29]
  29. // 1 rate_mcs[3:0], sgi[5:4], receive_bandwidth[7:6], mimo_ss_bitmap[15:8], ofdma_ru_allocation[23:16], ofdma_user_index[30:24], ofdma_content_channel[31]
  30. // 2 ldpc[0], ru_width[7:1], reserved_2a[31:8]
  31. //
  32. // ################ END SUMMARY #################
  33. #define NUM_OF_DWORDS_RECEIVE_USER_INFO 3
  34. struct receive_user_info {
  35. uint32_t phy_ppdu_id : 16, //[15:0]
  36. user_rssi : 8, //[23:16]
  37. pkt_type : 4, //[27:24]
  38. stbc : 1, //[28]
  39. reception_type : 3; //[31:29]
  40. uint32_t rate_mcs : 4, //[3:0]
  41. sgi : 2, //[5:4]
  42. receive_bandwidth : 2, //[7:6]
  43. mimo_ss_bitmap : 8, //[15:8]
  44. ofdma_ru_allocation : 8, //[23:16]
  45. ofdma_user_index : 7, //[30:24]
  46. ofdma_content_channel : 1; //[31]
  47. uint32_t ldpc : 1, //[0]
  48. ru_width : 7, //[7:1]
  49. reserved_2a : 24; //[31:8]
  50. };
  51. /*
  52. phy_ppdu_id
  53. A ppdu counter value that PHY increments for every PPDU
  54. received. The counter value wraps around
  55. <legal all>
  56. user_rssi
  57. RSSI for this user
  58. Frequency domain RSSI measurement for this user. Based
  59. on the channel estimate.
  60. <legal all>
  61. pkt_type
  62. Packet type:
  63. <enum 0 dot11a>802.11a PPDU type
  64. <enum 1 dot11b>802.11b PPDU type
  65. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  66. <enum 3 dot11ac>802.11ac PPDU type
  67. <enum 4 dot11ax>802.11ax PPDU type
  68. <enum 5 dot11ba>802.11ba (WUR) PPDU type
  69. stbc
  70. When set, use STBC transmission rates
  71. reception_type
  72. Indicates what type of reception this is.
  73. <enum 0 reception_type_SU > Basic SU reception (not
  74. part of OFDMA or MU-MIMO)
  75. <enum 1 reception_type_MU_MIMO > This is related to
  76. DL type of reception
  77. <enum 2 reception_type_MU_OFDMA > This is related
  78. to DL type of reception
  79. <enum 3 reception_type_MU_OFDMA_MIMO > This is
  80. related to DL type of reception
  81. <enum 4 reception_type_UL_MU_MIMO > This is related
  82. to UL type of reception
  83. <enum 5 reception_type_UL_MU_OFDMA > This is
  84. related to UL type of reception
  85. <enum 6 reception_type_UL_MU_OFDMA_MIMO > This is
  86. related to UL type of reception
  87. <legal 0-6>
  88. rate_mcs
  89. For details, refer to MCS_TYPE description
  90. <legal all>
  91. sgi
  92. Field only valid when pkt type is HT, VHT or HE.
  93. <enum 0 gi_0_8_us > Legacy normal GI. Can also be
  94. used for HE
  95. <enum 1 gi_0_4_us > Legacy short GI. Can also be
  96. used for HE
  97. <enum 2 gi_1_6_us > HE related GI
  98. <enum 3 gi_3_2_us > HE related GI
  99. <legal 0 - 3>
  100. receive_bandwidth
  101. Full receive Bandwidth
  102. <enum 0 full_rx_bw_20_mhz>
  103. <enum 1 full_rx_bw_40_mhz>
  104. <enum 2 full_rx_bw_80_mhz>
  105. <enum 3 full_rx_bw_160_mhz>
  106. <legal 0-3>
  107. mimo_ss_bitmap
  108. Bitmap, with each bit indicating if the related spatial
  109. stream is used for this STA
  110. LSB related to SS 0
  111. 0: spatial stream not used for this reception
  112. 1: spatial stream used for this reception
  113. <legal all>
  114. ofdma_ru_allocation
  115. Field only valid in case of OFDMA type receptions (DL
  116. and UL)
  117. Indicates the RU number associated with this user.
  118. In case of reception where the transmission was DL MU
  119. OFDMA, this field provides the RU pattern. Note that fields
  120. ofdma_user_index and ofdma_content_channel are needed to
  121. determine which RU (within a 40 MHz channel) was actually
  122. assigned to this user, but this does not give info on which
  123. 40 MHz channel was assigned to this user. Please refer
  124. DL_ofdma_ru_* in PHYRX_PKT_END_INFO for complete RU info for
  125. this user.
  126. In case of reception where the transmission was UL MU
  127. OFDMA, PHY is recommended to insert the RU start index in
  128. this field. Note that PHY may insert the RU width in
  129. Reserved_2a[6:0].
  130. <legal all>
  131. ofdma_user_index
  132. Field only valid in the of DL MU OFDMA reception
  133. The user number within the RU_allocation.
  134. This is needed for SW to determine the exact RU position
  135. within the reception.
  136. <legal all>
  137. ofdma_content_channel
  138. Field only valid in the of DL MU OFDMA/MIMO reception
  139. In case of DL MU reception, this field indicates the
  140. content channel number where PHY found the RU information
  141. for this user
  142. This is needed for SW to determine the exact RU position
  143. within the reception.
  144. <enum 0 content_channel_1>
  145. <enum 1 content_channel_2>
  146. <legal all>
  147. ldpc
  148. When set, use LDPC transmission rates were used.
  149. <legal all>
  150. ru_width
  151. In case of UL OFDMA reception, PHY is recommended to
  152. insert the RU width
  153. In Hastings80: was using Reserved_2a[6:0].
  154. <legal 1 - 74>
  155. reserved_2a
  156. <legal 0>
  157. */
  158. /* Description RECEIVE_USER_INFO_0_PHY_PPDU_ID
  159. A ppdu counter value that PHY increments for every PPDU
  160. received. The counter value wraps around
  161. <legal all>
  162. */
  163. #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_OFFSET 0x00000000
  164. #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_LSB 0
  165. #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_MASK 0x0000ffff
  166. /* Description RECEIVE_USER_INFO_0_USER_RSSI
  167. RSSI for this user
  168. Frequency domain RSSI measurement for this user. Based
  169. on the channel estimate.
  170. <legal all>
  171. */
  172. #define RECEIVE_USER_INFO_0_USER_RSSI_OFFSET 0x00000000
  173. #define RECEIVE_USER_INFO_0_USER_RSSI_LSB 16
  174. #define RECEIVE_USER_INFO_0_USER_RSSI_MASK 0x00ff0000
  175. /* Description RECEIVE_USER_INFO_0_PKT_TYPE
  176. Packet type:
  177. <enum 0 dot11a>802.11a PPDU type
  178. <enum 1 dot11b>802.11b PPDU type
  179. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  180. <enum 3 dot11ac>802.11ac PPDU type
  181. <enum 4 dot11ax>802.11ax PPDU type
  182. <enum 5 dot11ba>802.11ba (WUR) PPDU type
  183. */
  184. #define RECEIVE_USER_INFO_0_PKT_TYPE_OFFSET 0x00000000
  185. #define RECEIVE_USER_INFO_0_PKT_TYPE_LSB 24
  186. #define RECEIVE_USER_INFO_0_PKT_TYPE_MASK 0x0f000000
  187. /* Description RECEIVE_USER_INFO_0_STBC
  188. When set, use STBC transmission rates
  189. */
  190. #define RECEIVE_USER_INFO_0_STBC_OFFSET 0x00000000
  191. #define RECEIVE_USER_INFO_0_STBC_LSB 28
  192. #define RECEIVE_USER_INFO_0_STBC_MASK 0x10000000
  193. /* Description RECEIVE_USER_INFO_0_RECEPTION_TYPE
  194. Indicates what type of reception this is.
  195. <enum 0 reception_type_SU > Basic SU reception (not
  196. part of OFDMA or MU-MIMO)
  197. <enum 1 reception_type_MU_MIMO > This is related to
  198. DL type of reception
  199. <enum 2 reception_type_MU_OFDMA > This is related
  200. to DL type of reception
  201. <enum 3 reception_type_MU_OFDMA_MIMO > This is
  202. related to DL type of reception
  203. <enum 4 reception_type_UL_MU_MIMO > This is related
  204. to UL type of reception
  205. <enum 5 reception_type_UL_MU_OFDMA > This is
  206. related to UL type of reception
  207. <enum 6 reception_type_UL_MU_OFDMA_MIMO > This is
  208. related to UL type of reception
  209. <legal 0-6>
  210. */
  211. #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_OFFSET 0x00000000
  212. #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_LSB 29
  213. #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_MASK 0xe0000000
  214. /* Description RECEIVE_USER_INFO_1_RATE_MCS
  215. For details, refer to MCS_TYPE description
  216. <legal all>
  217. */
  218. #define RECEIVE_USER_INFO_1_RATE_MCS_OFFSET 0x00000004
  219. #define RECEIVE_USER_INFO_1_RATE_MCS_LSB 0
  220. #define RECEIVE_USER_INFO_1_RATE_MCS_MASK 0x0000000f
  221. /* Description RECEIVE_USER_INFO_1_SGI
  222. Field only valid when pkt type is HT, VHT or HE.
  223. <enum 0 gi_0_8_us > Legacy normal GI. Can also be
  224. used for HE
  225. <enum 1 gi_0_4_us > Legacy short GI. Can also be
  226. used for HE
  227. <enum 2 gi_1_6_us > HE related GI
  228. <enum 3 gi_3_2_us > HE related GI
  229. <legal 0 - 3>
  230. */
  231. #define RECEIVE_USER_INFO_1_SGI_OFFSET 0x00000004
  232. #define RECEIVE_USER_INFO_1_SGI_LSB 4
  233. #define RECEIVE_USER_INFO_1_SGI_MASK 0x00000030
  234. /* Description RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH
  235. Full receive Bandwidth
  236. <enum 0 full_rx_bw_20_mhz>
  237. <enum 1 full_rx_bw_40_mhz>
  238. <enum 2 full_rx_bw_80_mhz>
  239. <enum 3 full_rx_bw_160_mhz>
  240. <legal 0-3>
  241. */
  242. #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_OFFSET 0x00000004
  243. #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_LSB 6
  244. #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_MASK 0x000000c0
  245. /* Description RECEIVE_USER_INFO_1_MIMO_SS_BITMAP
  246. Bitmap, with each bit indicating if the related spatial
  247. stream is used for this STA
  248. LSB related to SS 0
  249. 0: spatial stream not used for this reception
  250. 1: spatial stream used for this reception
  251. <legal all>
  252. */
  253. #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_OFFSET 0x00000004
  254. #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_LSB 8
  255. #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_MASK 0x0000ff00
  256. /* Description RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION
  257. Field only valid in case of OFDMA type receptions (DL
  258. and UL)
  259. Indicates the RU number associated with this user.
  260. In case of reception where the transmission was DL MU
  261. OFDMA, this field provides the RU pattern. Note that fields
  262. ofdma_user_index and ofdma_content_channel are needed to
  263. determine which RU (within a 40 MHz channel) was actually
  264. assigned to this user, but this does not give info on which
  265. 40 MHz channel was assigned to this user. Please refer
  266. DL_ofdma_ru_* in PHYRX_PKT_END_INFO for complete RU info for
  267. this user.
  268. In case of reception where the transmission was UL MU
  269. OFDMA, PHY is recommended to insert the RU start index in
  270. this field. Note that PHY may insert the RU width in
  271. Reserved_2a[6:0].
  272. <legal all>
  273. */
  274. #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_OFFSET 0x00000004
  275. #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_LSB 16
  276. #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_MASK 0x00ff0000
  277. /* Description RECEIVE_USER_INFO_1_OFDMA_USER_INDEX
  278. Field only valid in the of DL MU OFDMA reception
  279. The user number within the RU_allocation.
  280. This is needed for SW to determine the exact RU position
  281. within the reception.
  282. <legal all>
  283. */
  284. #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_OFFSET 0x00000004
  285. #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_LSB 24
  286. #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_MASK 0x7f000000
  287. /* Description RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL
  288. Field only valid in the of DL MU OFDMA/MIMO reception
  289. In case of DL MU reception, this field indicates the
  290. content channel number where PHY found the RU information
  291. for this user
  292. This is needed for SW to determine the exact RU position
  293. within the reception.
  294. <enum 0 content_channel_1>
  295. <enum 1 content_channel_2>
  296. <legal all>
  297. */
  298. #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_OFFSET 0x00000004
  299. #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_LSB 31
  300. #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_MASK 0x80000000
  301. /* Description RECEIVE_USER_INFO_2_LDPC
  302. When set, use LDPC transmission rates were used.
  303. <legal all>
  304. */
  305. #define RECEIVE_USER_INFO_2_LDPC_OFFSET 0x00000008
  306. #define RECEIVE_USER_INFO_2_LDPC_LSB 0
  307. #define RECEIVE_USER_INFO_2_LDPC_MASK 0x00000001
  308. /* Description RECEIVE_USER_INFO_2_RU_WIDTH
  309. In case of UL OFDMA reception, PHY is recommended to
  310. insert the RU width
  311. In Hastings80: was using Reserved_2a[6:0].
  312. <legal 1 - 74>
  313. */
  314. #define RECEIVE_USER_INFO_2_RU_WIDTH_OFFSET 0x00000008
  315. #define RECEIVE_USER_INFO_2_RU_WIDTH_LSB 1
  316. #define RECEIVE_USER_INFO_2_RU_WIDTH_MASK 0x000000fe
  317. /* Description RECEIVE_USER_INFO_2_RESERVED_2A
  318. <legal 0>
  319. */
  320. #define RECEIVE_USER_INFO_2_RESERVED_2A_OFFSET 0x00000008
  321. #define RECEIVE_USER_INFO_2_RESERVED_2A_LSB 8
  322. #define RECEIVE_USER_INFO_2_RESERVED_2A_MASK 0xffffff00
  323. #endif // _RECEIVE_USER_INFO_H_