receive_user_info.h 14 KB

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