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