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