xref: /wlan-driver/fw-api/hw/qca5332/l_sig_a_info.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 _L_SIG_A_INFO_H_
27 #define _L_SIG_A_INFO_H_
28 #if !defined(__ASSEMBLER__)
29 #endif
30 
31 #define NUM_OF_DWORDS_L_SIG_A_INFO 1
32 
33 
34 struct l_sig_a_info {
35 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
36              uint32_t rate                                                    :  4, // [3:0]
37                       lsig_reserved                                           :  1, // [4:4]
38                       length                                                  : 12, // [16:5]
39                       parity                                                  :  1, // [17:17]
40                       tail                                                    :  6, // [23:18]
41                       pkt_type                                                :  4, // [27:24]
42                       captured_implicit_sounding                              :  1, // [28:28]
43                       reserved                                                :  2, // [30:29]
44                       rx_integrity_check_passed                               :  1; // [31:31]
45 #else
46              uint32_t rx_integrity_check_passed                               :  1, // [31:31]
47                       reserved                                                :  2, // [30:29]
48                       captured_implicit_sounding                              :  1, // [28:28]
49                       pkt_type                                                :  4, // [27:24]
50                       tail                                                    :  6, // [23:18]
51                       parity                                                  :  1, // [17:17]
52                       length                                                  : 12, // [16:5]
53                       lsig_reserved                                           :  1, // [4:4]
54                       rate                                                    :  4; // [3:0]
55 #endif
56 };
57 
58 
59 /* Description		RATE
60 
61 			This format is originally defined for OFDM as a 4 bit field
62 			 but the 5th bit was added to indicate 11b formatted frames.
63 			 In the standard bit [4] is specified as reserved.  For
64 			11b frames this L-SIG is transformed in the PHY into the
65 			 11b preamble format.  The following are the rates:
66 			<enum 8     ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
67 			<enum 9     ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
68 			<enum 10     ofdm_12_mbps> QPSK 1/2 (12 Mbps)
69 			<enum 11     ofdm_6_mbps> BPSK 1/2 (6 Mbps)
70 			<enum 12     ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
71 			<enum 13     ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
72 			<enum 14     ofdm_18_mbps> QPSK 1/2 (18 Mbps)
73 			<enum 15     ofdm_9_mbps> BPSK 3/4 (9 Mbps)
74 			<legal 8-15>
75 */
76 
77 #define L_SIG_A_INFO_RATE_OFFSET                                                    0x00000000
78 #define L_SIG_A_INFO_RATE_LSB                                                       0
79 #define L_SIG_A_INFO_RATE_MSB                                                       3
80 #define L_SIG_A_INFO_RATE_MASK                                                      0x0000000f
81 
82 
83 /* Description		LSIG_RESERVED
84 
85 			Reserved: Should be set to 0 by the MAC and ignored by the
86 			 PHY
87 			<legal 0>
88 */
89 
90 #define L_SIG_A_INFO_LSIG_RESERVED_OFFSET                                           0x00000000
91 #define L_SIG_A_INFO_LSIG_RESERVED_LSB                                              4
92 #define L_SIG_A_INFO_LSIG_RESERVED_MSB                                              4
93 #define L_SIG_A_INFO_LSIG_RESERVED_MASK                                             0x00000010
94 
95 
96 /* Description		LENGTH
97 
98 			The length indicates the number of octets in this MPDU.
99 			 Note that when using mixed mode .11n preamble or .11ac/.11ax/.11ba/.11be
100 			 this length provides the spoofed length for the PPDU.
101 			This length provides part of the information (viz. PPDU
102 			duration) to derive the actually PSDU length.  For legacy
103 			 OFDM and 11B frames the maximum length is 4095.
104 			<legal all>
105 */
106 
107 #define L_SIG_A_INFO_LENGTH_OFFSET                                                  0x00000000
108 #define L_SIG_A_INFO_LENGTH_LSB                                                     5
109 #define L_SIG_A_INFO_LENGTH_MSB                                                     16
110 #define L_SIG_A_INFO_LENGTH_MASK                                                    0x0001ffe0
111 
112 
113 /* Description		PARITY
114 
115 			11a/n/ac TX: This field provides even parity over the first
116 			 18 bits of the signal field which means that the sum of
117 			 1s in the signal field will always be even on transmission.
118 			The value of the field is computed by the MAC.
119 			11a/n/ac RX: this field contains the received parity field
120 			 from the L-SIG symbol for the current packet.
121 			<legal 0-1>
122 */
123 
124 #define L_SIG_A_INFO_PARITY_OFFSET                                                  0x00000000
125 #define L_SIG_A_INFO_PARITY_LSB                                                     17
126 #define L_SIG_A_INFO_PARITY_MSB                                                     17
127 #define L_SIG_A_INFO_PARITY_MASK                                                    0x00020000
128 
129 
130 /* Description		TAIL
131 
132 			The 6 bits of tail is always set to 0 is used to flush the
133 			 BCC encoder and decoder.  <legal 0>
134 */
135 
136 #define L_SIG_A_INFO_TAIL_OFFSET                                                    0x00000000
137 #define L_SIG_A_INFO_TAIL_LSB                                                       18
138 #define L_SIG_A_INFO_TAIL_MSB                                                       23
139 #define L_SIG_A_INFO_TAIL_MASK                                                      0x00fc0000
140 
141 
142 /* Description		PKT_TYPE
143 
144 			Only used on the RX side.
145 			Note: This is not really part of L-SIG
146 
147 			Packet type:
148 			<enum 0 dot11a>802.11a PPDU type
149 			<enum 1 dot11b>802.11b PPDU type
150 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
151 			<enum 3 dot11ac>802.11ac PPDU type
152 			<enum 4 dot11ax>802.11ax PPDU type
153 			<enum 5 dot11ba>802.11ba (WUR) PPDU type
154 			<enum 6 dot11be>802.11be PPDU type
155 			<enum 7 dot11az>802.11az (ranging) PPDU type
156 			<enum 8 dot11n_gf>802.11n Green Field PPDU type (unsupported
157 			 & aborted)
158 */
159 
160 #define L_SIG_A_INFO_PKT_TYPE_OFFSET                                                0x00000000
161 #define L_SIG_A_INFO_PKT_TYPE_LSB                                                   24
162 #define L_SIG_A_INFO_PKT_TYPE_MSB                                                   27
163 #define L_SIG_A_INFO_PKT_TYPE_MASK                                                  0x0f000000
164 
165 
166 /* Description		CAPTURED_IMPLICIT_SOUNDING
167 
168 			Only used on the RX side.
169 			Note: This is not really part of L-SIG
170 
171 			This indicates that the PHY has captured implicit sounding.
172 
173 */
174 
175 #define L_SIG_A_INFO_CAPTURED_IMPLICIT_SOUNDING_OFFSET                              0x00000000
176 #define L_SIG_A_INFO_CAPTURED_IMPLICIT_SOUNDING_LSB                                 28
177 #define L_SIG_A_INFO_CAPTURED_IMPLICIT_SOUNDING_MSB                                 28
178 #define L_SIG_A_INFO_CAPTURED_IMPLICIT_SOUNDING_MASK                                0x10000000
179 
180 
181 /* Description		RESERVED
182 
183 			Reserved: Should be set to 0 by the transmitting MAC and
184 			 ignored by the PHY <legal 0>
185 */
186 
187 #define L_SIG_A_INFO_RESERVED_OFFSET                                                0x00000000
188 #define L_SIG_A_INFO_RESERVED_LSB                                                   29
189 #define L_SIG_A_INFO_RESERVED_MSB                                                   30
190 #define L_SIG_A_INFO_RESERVED_MASK                                                  0x60000000
191 
192 
193 /* Description		RX_INTEGRITY_CHECK_PASSED
194 
195 			TX side: Set to 0
196 			RX side: Set to 1 if PHY determines the L-SIG integrity
197 			check has passed, else set to 0
198 
199 			<legal all>
200 */
201 
202 #define L_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_OFFSET                               0x00000000
203 #define L_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_LSB                                  31
204 #define L_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_MSB                                  31
205 #define L_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_MASK                                 0x80000000
206 
207 
208 
209 #endif   // L_SIG_A_INFO
210