receive_user_info.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. /*
  2. * Copyright (c) 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], sgi[30:29], reserved_0[31]
  26. // 1 rate_mcs[3:0], reception_type[5:4], receive_bandwidth[7:6], mimo_ss_bitmap[15:8], user_ru_allocation[23:16], nss[26:24], reserved_1b[31:27]
  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. sgi : 2, //[30:29]
  36. reserved_0 : 1; //[31]
  37. uint32_t rate_mcs : 4, //[3:0]
  38. reception_type : 2, //[5:4]
  39. receive_bandwidth : 2, //[7:6]
  40. mimo_ss_bitmap : 8, //[15:8]
  41. user_ru_allocation : 8, //[23:16]
  42. nss : 3, //[26:24]
  43. reserved_1b : 5; //[31:27]
  44. };
  45. /*
  46. phy_ppdu_id
  47. A ppdu counter value that PHY increments for every PPDU
  48. received. The counter value wraps around
  49. <legal all>
  50. user_rssi
  51. RSSI for this user
  52. Frequency domain RSSI measurement for this user. Based
  53. on the channel estimate.
  54. If PHY implementation runs into difficulties, the backup
  55. is to reuse the previously notified RSSI values.
  56. TODO PHY: request to update the text here based on the
  57. latest design insights
  58. <legal all>
  59. pkt_type
  60. Packet type:
  61. <enum 0 dot11a>802.11a PPDU type
  62. <enum 1 dot11b>802.11b PPDU type
  63. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  64. <enum 3 dot11ac>802.11ac PPDU type
  65. <enum 4 dot11ax>802.11ax PPDU type
  66. stbc
  67. When set, use STBC transmission rates
  68. sgi
  69. Field only valid when pkt type is HT, VHT or HE.
  70. <enum 0 gi_0_8_us > Legacy normal GI
  71. <enum 1 gi_0_4_us > Legacy short GI
  72. <enum 2 gi_1_6_us > HE related GI
  73. <enum 3 gi_3_2_us > HE related GI
  74. <legal 0 - 3>
  75. reserved_0
  76. <legal 0>
  77. rate_mcs
  78. For details, refer to MCS_TYPE description
  79. <legal all>
  80. reception_type
  81. Indicates what type of reception this is.
  82. <enum 0 reception_type_SU >
  83. <enum 1 reception_type_MU_MIMO >
  84. <enum 2 reception_type_MU_OFDMA >
  85. <enum 3 reception_type_MU_OFDMA_MIMO >
  86. <legal all>
  87. receive_bandwidth
  88. Full receive Bandwidth
  89. <enum 0 full_rx_bw_20_mhz>
  90. <enum 1 full_rx_bw_40_mhz>
  91. <enum 2 full_rx_bw_80_mhz>
  92. <enum 3 full_rx_bw_160_mhz>
  93. <legal 0-3>
  94. mimo_ss_bitmap
  95. Field only valid in case of MIMO type reception
  96. Bitmap, with each bit indicating if the related spatial
  97. stream is used for this STA
  98. LSB related to SS 0
  99. 0: spatial stream not used for this reception
  100. 1: spatial stream used for this reception
  101. <legal all>
  102. user_ru_allocation
  103. Field only valid in case of OFDMA uplink type reception
  104. Indicates the RU number for this user
  105. <legal 0-73>
  106. nss
  107. Number of Spatial Streams occupied by the User
  108. <enum 0 1_spatial_stream>Single spatial stream
  109. <enum 1 2_spatial_streams>2 spatial streams
  110. <enum 2 3_spatial_streams>3 spatial streams
  111. <enum 3 4_spatial_streams>4 spatial streams
  112. <enum 4 5_spatial_streams>5 spatial streams
  113. <enum 5 6_spatial_streams>6 spatial streams
  114. <enum 6 7_spatial_streams>7 spatial streams
  115. <enum 7 8_spatial_streams>8 spatial streams
  116. reserved_1b
  117. <legal 0>
  118. */
  119. /* Description RECEIVE_USER_INFO_0_PHY_PPDU_ID
  120. A ppdu counter value that PHY increments for every PPDU
  121. received. The counter value wraps around
  122. <legal all>
  123. */
  124. #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_OFFSET 0x00000000
  125. #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_LSB 0
  126. #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_MASK 0x0000ffff
  127. /* Description RECEIVE_USER_INFO_0_USER_RSSI
  128. RSSI for this user
  129. Frequency domain RSSI measurement for this user. Based
  130. on the channel estimate.
  131. If PHY implementation runs into difficulties, the backup
  132. is to reuse the previously notified RSSI values.
  133. TODO PHY: request to update the text here based on the
  134. latest design insights
  135. <legal all>
  136. */
  137. #define RECEIVE_USER_INFO_0_USER_RSSI_OFFSET 0x00000000
  138. #define RECEIVE_USER_INFO_0_USER_RSSI_LSB 16
  139. #define RECEIVE_USER_INFO_0_USER_RSSI_MASK 0x00ff0000
  140. /* Description RECEIVE_USER_INFO_0_PKT_TYPE
  141. Packet type:
  142. <enum 0 dot11a>802.11a PPDU type
  143. <enum 1 dot11b>802.11b PPDU type
  144. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  145. <enum 3 dot11ac>802.11ac PPDU type
  146. <enum 4 dot11ax>802.11ax PPDU type
  147. */
  148. #define RECEIVE_USER_INFO_0_PKT_TYPE_OFFSET 0x00000000
  149. #define RECEIVE_USER_INFO_0_PKT_TYPE_LSB 24
  150. #define RECEIVE_USER_INFO_0_PKT_TYPE_MASK 0x0f000000
  151. /* Description RECEIVE_USER_INFO_0_STBC
  152. When set, use STBC transmission rates
  153. */
  154. #define RECEIVE_USER_INFO_0_STBC_OFFSET 0x00000000
  155. #define RECEIVE_USER_INFO_0_STBC_LSB 28
  156. #define RECEIVE_USER_INFO_0_STBC_MASK 0x10000000
  157. /* Description RECEIVE_USER_INFO_0_SGI
  158. Field only valid when pkt type is HT, VHT or HE.
  159. <enum 0 gi_0_8_us > Legacy normal GI
  160. <enum 1 gi_0_4_us > Legacy short GI
  161. <enum 2 gi_1_6_us > HE related GI
  162. <enum 3 gi_3_2_us > HE related GI
  163. <legal 0 - 3>
  164. */
  165. #define RECEIVE_USER_INFO_0_SGI_OFFSET 0x00000000
  166. #define RECEIVE_USER_INFO_0_SGI_LSB 29
  167. #define RECEIVE_USER_INFO_0_SGI_MASK 0x60000000
  168. /* Description RECEIVE_USER_INFO_0_RESERVED_0
  169. <legal 0>
  170. */
  171. #define RECEIVE_USER_INFO_0_RESERVED_0_OFFSET 0x00000000
  172. #define RECEIVE_USER_INFO_0_RESERVED_0_LSB 31
  173. #define RECEIVE_USER_INFO_0_RESERVED_0_MASK 0x80000000
  174. /* Description RECEIVE_USER_INFO_1_RATE_MCS
  175. For details, refer to MCS_TYPE description
  176. <legal all>
  177. */
  178. #define RECEIVE_USER_INFO_1_RATE_MCS_OFFSET 0x00000004
  179. #define RECEIVE_USER_INFO_1_RATE_MCS_LSB 0
  180. #define RECEIVE_USER_INFO_1_RATE_MCS_MASK 0x0000000f
  181. /* Description RECEIVE_USER_INFO_1_RECEPTION_TYPE
  182. Indicates what type of reception this is.
  183. <enum 0 reception_type_SU >
  184. <enum 1 reception_type_MU_MIMO >
  185. <enum 2 reception_type_MU_OFDMA >
  186. <enum 3 reception_type_MU_OFDMA_MIMO >
  187. <legal all>
  188. */
  189. #define RECEIVE_USER_INFO_1_RECEPTION_TYPE_OFFSET 0x00000004
  190. #define RECEIVE_USER_INFO_1_RECEPTION_TYPE_LSB 4
  191. #define RECEIVE_USER_INFO_1_RECEPTION_TYPE_MASK 0x00000030
  192. /* Description RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH
  193. Full receive Bandwidth
  194. <enum 0 full_rx_bw_20_mhz>
  195. <enum 1 full_rx_bw_40_mhz>
  196. <enum 2 full_rx_bw_80_mhz>
  197. <enum 3 full_rx_bw_160_mhz>
  198. <legal 0-3>
  199. */
  200. #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_OFFSET 0x00000004
  201. #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_LSB 6
  202. #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_MASK 0x000000c0
  203. /* Description RECEIVE_USER_INFO_1_MIMO_SS_BITMAP
  204. Field only valid in case of MIMO type reception
  205. Bitmap, with each bit indicating if the related spatial
  206. stream is used for this STA
  207. LSB related to SS 0
  208. 0: spatial stream not used for this reception
  209. 1: spatial stream used for this reception
  210. <legal all>
  211. */
  212. #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_OFFSET 0x00000004
  213. #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_LSB 8
  214. #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_MASK 0x0000ff00
  215. /* Description RECEIVE_USER_INFO_1_USER_RU_ALLOCATION
  216. Field only valid in case of OFDMA uplink type reception
  217. Indicates the RU number for this user
  218. <legal 0-73>
  219. */
  220. #define RECEIVE_USER_INFO_1_USER_RU_ALLOCATION_OFFSET 0x00000004
  221. #define RECEIVE_USER_INFO_1_USER_RU_ALLOCATION_LSB 16
  222. #define RECEIVE_USER_INFO_1_USER_RU_ALLOCATION_MASK 0x00ff0000
  223. /* Description RECEIVE_USER_INFO_1_NSS
  224. Number of Spatial Streams occupied by the User
  225. <enum 0 1_spatial_stream>Single spatial stream
  226. <enum 1 2_spatial_streams>2 spatial streams
  227. <enum 2 3_spatial_streams>3 spatial streams
  228. <enum 3 4_spatial_streams>4 spatial streams
  229. <enum 4 5_spatial_streams>5 spatial streams
  230. <enum 5 6_spatial_streams>6 spatial streams
  231. <enum 6 7_spatial_streams>7 spatial streams
  232. <enum 7 8_spatial_streams>8 spatial streams
  233. */
  234. #define RECEIVE_USER_INFO_1_NSS_OFFSET 0x00000004
  235. #define RECEIVE_USER_INFO_1_NSS_LSB 24
  236. #define RECEIVE_USER_INFO_1_NSS_MASK 0x07000000
  237. /* Description RECEIVE_USER_INFO_1_RESERVED_1B
  238. <legal 0>
  239. */
  240. #define RECEIVE_USER_INFO_1_RESERVED_1B_OFFSET 0x00000004
  241. #define RECEIVE_USER_INFO_1_RESERVED_1B_LSB 27
  242. #define RECEIVE_USER_INFO_1_RESERVED_1B_MASK 0xf8000000
  243. #endif // _RECEIVE_USER_INFO_H_