rx_preamble.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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 _RX_PREAMBLE_H_
  17. #define _RX_PREAMBLE_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. #define NUM_OF_DWORDS_RX_PREAMBLE 2
  21. #define NUM_OF_QWORDS_RX_PREAMBLE 1
  22. struct rx_preamble {
  23. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  24. uint32_t num_users : 6, // [5:0]
  25. pkt_type : 4, // [9:6]
  26. direction : 1, // [10:10]
  27. reserved_0a : 21; // [31:11]
  28. uint32_t tlv64_padding : 32; // [31:0]
  29. #else
  30. uint32_t reserved_0a : 21, // [31:11]
  31. direction : 1, // [10:10]
  32. pkt_type : 4, // [9:6]
  33. num_users : 6; // [5:0]
  34. uint32_t tlv64_padding : 32; // [31:0]
  35. #endif
  36. };
  37. /* Description NUM_USERS
  38. The number of users in the receiving OFDMA frame.
  39. */
  40. #define RX_PREAMBLE_NUM_USERS_OFFSET 0x0000000000000000
  41. #define RX_PREAMBLE_NUM_USERS_LSB 0
  42. #define RX_PREAMBLE_NUM_USERS_MSB 5
  43. #define RX_PREAMBLE_NUM_USERS_MASK 0x000000000000003f
  44. /* Description PKT_TYPE
  45. Packet type:
  46. <enum 0 dot11a>802.11a PPDU type
  47. <enum 1 dot11b>802.11b PPDU type
  48. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  49. <enum 3 dot11ac>802.11ac PPDU type
  50. <enum 4 dot11ax>802.11ax PPDU type
  51. <enum 5 dot11ba>802.11ba (WUR) PPDU type
  52. <enum 6 dot11be>802.11be PPDU type
  53. <enum 7 dot11az>802.11az (ranging) PPDU type
  54. <enum 8 dot11n_gf>802.11n Green Field PPDU type (unsupported
  55. & aborted)
  56. */
  57. #define RX_PREAMBLE_PKT_TYPE_OFFSET 0x0000000000000000
  58. #define RX_PREAMBLE_PKT_TYPE_LSB 6
  59. #define RX_PREAMBLE_PKT_TYPE_MSB 9
  60. #define RX_PREAMBLE_PKT_TYPE_MASK 0x00000000000003c0
  61. /* Description DIRECTION
  62. Field only valid in case of pkt_type = dot11ax
  63. <enum 0 direction_uplink_reception>
  64. <enum 1 direction_downlink_reception>
  65. <legal all>
  66. */
  67. #define RX_PREAMBLE_DIRECTION_OFFSET 0x0000000000000000
  68. #define RX_PREAMBLE_DIRECTION_LSB 10
  69. #define RX_PREAMBLE_DIRECTION_MSB 10
  70. #define RX_PREAMBLE_DIRECTION_MASK 0x0000000000000400
  71. /* Description RESERVED_0A
  72. <legal 0>
  73. */
  74. #define RX_PREAMBLE_RESERVED_0A_OFFSET 0x0000000000000000
  75. #define RX_PREAMBLE_RESERVED_0A_LSB 11
  76. #define RX_PREAMBLE_RESERVED_0A_MSB 31
  77. #define RX_PREAMBLE_RESERVED_0A_MASK 0x00000000fffff800
  78. /* Description TLV64_PADDING
  79. Automatic DWORD padding inserted while converting TLV32
  80. to TLV64 for 64 bit ARCH
  81. <legal 0>
  82. */
  83. #define RX_PREAMBLE_TLV64_PADDING_OFFSET 0x0000000000000000
  84. #define RX_PREAMBLE_TLV64_PADDING_LSB 32
  85. #define RX_PREAMBLE_TLV64_PADDING_MSB 63
  86. #define RX_PREAMBLE_TLV64_PADDING_MASK 0xffffffff00000000
  87. #endif // RX_PREAMBLE