receive_user_info.h 14 KB

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