xref: /wlan-driver/fw-api/hw/qca6290/11ax/v2/l_sig_a_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016-2018 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 
19 #ifndef _L_SIG_A_INFO_H_
20 #define _L_SIG_A_INFO_H_
21 #if !defined(__ASSEMBLER__)
22 #endif
23 
24 
25 // ################ START SUMMARY #################
26 //
27 //	Dword	Fields
28 //	0	rate[3:0], lsig_reserved[4], length[16:5], parity[17], tail[23:18], pkt_type[27:24], captured_implicit_sounding[28], reserved[31:29]
29 //
30 // ################ END SUMMARY #################
31 
32 #define NUM_OF_DWORDS_L_SIG_A_INFO 1
33 
34 struct l_sig_a_info {
35              uint32_t rate                            :  4, //[3:0]
36                       lsig_reserved                   :  1, //[4]
37                       length                          : 12, //[16:5]
38                       parity                          :  1, //[17]
39                       tail                            :  6, //[23:18]
40                       pkt_type                        :  4, //[27:24]
41                       captured_implicit_sounding      :  1, //[28]
42                       reserved                        :  3; //[31:29]
43 };
44 
45 /*
46 
47 rate
48 
49 			This format is originally defined for OFDM as a 4 bit
50 			field but the 5th bit was added to indicate 11b formatted
51 			frames.  In the standard bit [4] is specified as reserved.
52 			For 11b frames this L-SIG is transformed in the PHY into the
53 			11b preamble format.  The following are the rates:
54 
55 			<enum 8     ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
56 
57 			<enum 9     ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
58 
59 			<enum 10     ofdm_12_mbps> QPSK 1/2 (12 Mbps)
60 
61 			<enum 11     ofdm_6_mbps> BPSK 1/2 (6 Mbps)
62 
63 			<enum 12     ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
64 
65 			<enum 13     ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
66 
67 			<enum 14     ofdm_18_mbps> QPSK 1/2 (18 Mbps)
68 
69 			<enum 15     ofdm_9_mbps> BPSK 3/4 (9 Mbps)
70 
71 			<legal 8-15>
72 
73 lsig_reserved
74 
75 			Reserved: Should be set to 0 by the MAC and ignored by
76 			the PHY
77 
78 			<legal 0>
79 
80 length
81 
82 			The length indicates the number of octets in this MPDU.
83 			Note that when using mixed mode 11n preamble this length
84 			provides the spoofed length for the PPDU.  This length
85 			provides part of the information to derive the actually PPDU
86 			length.  For legacy OFDM and 11B frames the maximum length
87 			is
88 
89 			<legal all>
90 
91 parity
92 
93 			11a/n/ac TX: This field provides even parity over the
94 			first 18 bits of the signal field which means that the sum
95 			of 1s in the signal field will always be even on
96 
97 			11a/n/ac RX: this field contains the received parity
98 			field from the L-SIG symbol for the current packet.
99 
100 			<legal 0-1>
101 
102 tail
103 
104 			The 6 bits of tail is always set to 0 is used to flush
105 			the BCC encoder and decoder.  <legal 0>
106 
107 pkt_type
108 
109 			Only used on the RX side.
110 
111 			Note: This is not really part of L-SIG
112 
113 
114 
115 			Packet type:
116 
117 			<enum 0 dot11a>802.11a PPDU type
118 
119 			<enum 1 dot11b>802.11b PPDU type
120 
121 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
122 
123 			<enum 3 dot11ac>802.11ac PPDU type
124 
125 			<enum 4 dot11ax>802.11ax PPDU type
126 
127 captured_implicit_sounding
128 
129 			Only used on the RX side.
130 
131 			Note: This is not really part of L-SIG
132 
133 
134 
135 			This indicates that the PHY has captured implicit
136 			sounding.
137 
138 reserved
139 
140 			Reserved: Should be set to 0 by the transmitting MAC and
141 			ignored by the PHY <legal 0>
142 */
143 
144 
145 /* Description		L_SIG_A_INFO_0_RATE
146 
147 			This format is originally defined for OFDM as a 4 bit
148 			field but the 5th bit was added to indicate 11b formatted
149 			frames.  In the standard bit [4] is specified as reserved.
150 			For 11b frames this L-SIG is transformed in the PHY into the
151 			11b preamble format.  The following are the rates:
152 
153 			<enum 8     ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
154 
155 			<enum 9     ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
156 
157 			<enum 10     ofdm_12_mbps> QPSK 1/2 (12 Mbps)
158 
159 			<enum 11     ofdm_6_mbps> BPSK 1/2 (6 Mbps)
160 
161 			<enum 12     ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
162 
163 			<enum 13     ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
164 
165 			<enum 14     ofdm_18_mbps> QPSK 1/2 (18 Mbps)
166 
167 			<enum 15     ofdm_9_mbps> BPSK 3/4 (9 Mbps)
168 
169 			<legal 8-15>
170 */
171 #define L_SIG_A_INFO_0_RATE_OFFSET                                   0x00000000
172 #define L_SIG_A_INFO_0_RATE_LSB                                      0
173 #define L_SIG_A_INFO_0_RATE_MASK                                     0x0000000f
174 
175 /* Description		L_SIG_A_INFO_0_LSIG_RESERVED
176 
177 			Reserved: Should be set to 0 by the MAC and ignored by
178 			the PHY
179 
180 			<legal 0>
181 */
182 #define L_SIG_A_INFO_0_LSIG_RESERVED_OFFSET                          0x00000000
183 #define L_SIG_A_INFO_0_LSIG_RESERVED_LSB                             4
184 #define L_SIG_A_INFO_0_LSIG_RESERVED_MASK                            0x00000010
185 
186 /* Description		L_SIG_A_INFO_0_LENGTH
187 
188 			The length indicates the number of octets in this MPDU.
189 			Note that when using mixed mode 11n preamble this length
190 			provides the spoofed length for the PPDU.  This length
191 			provides part of the information to derive the actually PPDU
192 			length.  For legacy OFDM and 11B frames the maximum length
193 			is
194 
195 			<legal all>
196 */
197 #define L_SIG_A_INFO_0_LENGTH_OFFSET                                 0x00000000
198 #define L_SIG_A_INFO_0_LENGTH_LSB                                    5
199 #define L_SIG_A_INFO_0_LENGTH_MASK                                   0x0001ffe0
200 
201 /* Description		L_SIG_A_INFO_0_PARITY
202 
203 			11a/n/ac TX: This field provides even parity over the
204 			first 18 bits of the signal field which means that the sum
205 			of 1s in the signal field will always be even on
206 
207 			11a/n/ac RX: this field contains the received parity
208 			field from the L-SIG symbol for the current packet.
209 
210 			<legal 0-1>
211 */
212 #define L_SIG_A_INFO_0_PARITY_OFFSET                                 0x00000000
213 #define L_SIG_A_INFO_0_PARITY_LSB                                    17
214 #define L_SIG_A_INFO_0_PARITY_MASK                                   0x00020000
215 
216 /* Description		L_SIG_A_INFO_0_TAIL
217 
218 			The 6 bits of tail is always set to 0 is used to flush
219 			the BCC encoder and decoder.  <legal 0>
220 */
221 #define L_SIG_A_INFO_0_TAIL_OFFSET                                   0x00000000
222 #define L_SIG_A_INFO_0_TAIL_LSB                                      18
223 #define L_SIG_A_INFO_0_TAIL_MASK                                     0x00fc0000
224 
225 /* Description		L_SIG_A_INFO_0_PKT_TYPE
226 
227 			Only used on the RX side.
228 
229 			Note: This is not really part of L-SIG
230 
231 
232 
233 			Packet type:
234 
235 			<enum 0 dot11a>802.11a PPDU type
236 
237 			<enum 1 dot11b>802.11b PPDU type
238 
239 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
240 
241 			<enum 3 dot11ac>802.11ac PPDU type
242 
243 			<enum 4 dot11ax>802.11ax PPDU type
244 */
245 #define L_SIG_A_INFO_0_PKT_TYPE_OFFSET                               0x00000000
246 #define L_SIG_A_INFO_0_PKT_TYPE_LSB                                  24
247 #define L_SIG_A_INFO_0_PKT_TYPE_MASK                                 0x0f000000
248 
249 /* Description		L_SIG_A_INFO_0_CAPTURED_IMPLICIT_SOUNDING
250 
251 			Only used on the RX side.
252 
253 			Note: This is not really part of L-SIG
254 
255 
256 
257 			This indicates that the PHY has captured implicit
258 			sounding.
259 */
260 #define L_SIG_A_INFO_0_CAPTURED_IMPLICIT_SOUNDING_OFFSET             0x00000000
261 #define L_SIG_A_INFO_0_CAPTURED_IMPLICIT_SOUNDING_LSB                28
262 #define L_SIG_A_INFO_0_CAPTURED_IMPLICIT_SOUNDING_MASK               0x10000000
263 
264 /* Description		L_SIG_A_INFO_0_RESERVED
265 
266 			Reserved: Should be set to 0 by the transmitting MAC and
267 			ignored by the PHY <legal 0>
268 */
269 #define L_SIG_A_INFO_0_RESERVED_OFFSET                               0x00000000
270 #define L_SIG_A_INFO_0_RESERVED_LSB                                  29
271 #define L_SIG_A_INFO_0_RESERVED_MASK                                 0xe0000000
272 
273 
274 #endif // _L_SIG_A_INFO_H_
275