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 17 #ifndef _RX_PREAMBLE_H_ 18 #define _RX_PREAMBLE_H_ 19 #if !defined(__ASSEMBLER__) 20 #endif 21 22 #define NUM_OF_DWORDS_RX_PREAMBLE 2 23 24 #define NUM_OF_QWORDS_RX_PREAMBLE 1 25 26 27 struct rx_preamble { 28 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN 29 uint32_t num_users : 6, // [5:0] 30 pkt_type : 4, // [9:6] 31 direction : 1, // [10:10] 32 reserved_0a : 21; // [31:11] 33 uint32_t tlv64_padding : 32; // [31:0] 34 #else 35 uint32_t reserved_0a : 21, // [31:11] 36 direction : 1, // [10:10] 37 pkt_type : 4, // [9:6] 38 num_users : 6; // [5:0] 39 uint32_t tlv64_padding : 32; // [31:0] 40 #endif 41 }; 42 43 44 /* Description NUM_USERS 45 46 The number of users in the receiving OFDMA frame. 47 */ 48 49 #define RX_PREAMBLE_NUM_USERS_OFFSET 0x0000000000000000 50 #define RX_PREAMBLE_NUM_USERS_LSB 0 51 #define RX_PREAMBLE_NUM_USERS_MSB 5 52 #define RX_PREAMBLE_NUM_USERS_MASK 0x000000000000003f 53 54 55 /* Description PKT_TYPE 56 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 <enum 6 dot11be>802.11be PPDU type 65 <enum 7 dot11az>802.11az (ranging) PPDU type 66 <enum 8 dot11n_gf>802.11n Green Field PPDU type (unsupported 67 & aborted) 68 */ 69 70 #define RX_PREAMBLE_PKT_TYPE_OFFSET 0x0000000000000000 71 #define RX_PREAMBLE_PKT_TYPE_LSB 6 72 #define RX_PREAMBLE_PKT_TYPE_MSB 9 73 #define RX_PREAMBLE_PKT_TYPE_MASK 0x00000000000003c0 74 75 76 /* Description DIRECTION 77 78 Field only valid in case of pkt_type = dot11ax 79 80 <enum 0 direction_uplink_reception> 81 <enum 1 direction_downlink_reception> 82 <legal all> 83 */ 84 85 #define RX_PREAMBLE_DIRECTION_OFFSET 0x0000000000000000 86 #define RX_PREAMBLE_DIRECTION_LSB 10 87 #define RX_PREAMBLE_DIRECTION_MSB 10 88 #define RX_PREAMBLE_DIRECTION_MASK 0x0000000000000400 89 90 91 /* Description RESERVED_0A 92 93 <legal 0> 94 */ 95 96 #define RX_PREAMBLE_RESERVED_0A_OFFSET 0x0000000000000000 97 #define RX_PREAMBLE_RESERVED_0A_LSB 11 98 #define RX_PREAMBLE_RESERVED_0A_MSB 31 99 #define RX_PREAMBLE_RESERVED_0A_MASK 0x00000000fffff800 100 101 102 /* Description TLV64_PADDING 103 104 Automatic DWORD padding inserted while converting TLV32 105 to TLV64 for 64 bit ARCH 106 <legal 0> 107 */ 108 109 #define RX_PREAMBLE_TLV64_PADDING_OFFSET 0x0000000000000000 110 #define RX_PREAMBLE_TLV64_PADDING_LSB 32 111 #define RX_PREAMBLE_TLV64_PADDING_MSB 63 112 #define RX_PREAMBLE_TLV64_PADDING_MASK 0xffffffff00000000 113 114 115 116 #endif // RX_PREAMBLE 117