receive_user_info.h 12 KB

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