xref: /wlan-driver/fw-api/hw/qcn9000/l_sig_a_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019, The Linux Foundation. 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 _L_SIG_A_INFO_H_
18 #define _L_SIG_A_INFO_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 
23 // ################ START SUMMARY #################
24 //
25 //	Dword	Fields
26 //	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]
27 //
28 // ################ END SUMMARY #################
29 
30 #define NUM_OF_DWORDS_L_SIG_A_INFO 1
31 
32 struct l_sig_a_info {
33              uint32_t rate                            :  4, //[3:0]
34                       lsig_reserved                   :  1, //[4]
35                       length                          : 12, //[16:5]
36                       parity                          :  1, //[17]
37                       tail                            :  6, //[23:18]
38                       pkt_type                        :  4, //[27:24]
39                       captured_implicit_sounding      :  1, //[28]
40                       reserved                        :  3; //[31:29]
41 };
42 
43 /*
44 
45 rate
46 
47 			This format is originally defined for OFDM as a 4 bit
48 			field but the 5th bit was added to indicate 11b formatted
49 			frames.  In the standard bit [4] is specified as reserved.
50 			For 11b frames this L-SIG is transformed in the PHY into the
51 			11b preamble format.  The following are the rates:
52 
53 			<enum 8     ofdm_48_mbps> 64-QAM 2/3 (48 Mbps)
54 
55 			<enum 9     ofdm_24_mbps> 16-QAM 1/2 (24 Mbps)
56 
57 			<enum 10     ofdm_12_mbps> QPSK 1/2 (12 Mbps)
58 
59 			<enum 11     ofdm_6_mbps> BPSK 1/2 (6 Mbps)
60 
61 			<enum 12     ofdm_54_mbps> 64-QAM 3/4 (54 Mbps)
62 
63 			<enum 13     ofdm_36_mbps> 16-QAM 3/4 (36 Mbps)
64 
65 			<enum 14     ofdm_18_mbps> QPSK 1/2 (18 Mbps)
66 
67 			<enum 15     ofdm_9_mbps> BPSK 3/4 (9 Mbps)
68 
69 			<legal 8-15>
70 
71 lsig_reserved
72 
73 			Reserved: Should be set to 0 by the MAC and ignored by
74 			the PHY
75 
76 			<legal 0>
77 
78 length
79 
80 			The length indicates the number of octets in this MPDU.
81 			Note that when using mixed mode 11n preamble this length
82 			provides the spoofed length for the PPDU.  This length
83 			provides part of the information to derive the actually PPDU
84 			length.  For legacy OFDM and 11B frames the maximum length
85 			is
86 
87 			<legal all>
88 
89 parity
90 
91 			11a/n/ac TX: This field provides even parity over the
92 			first 18 bits of the signal field which means that the sum
93 			of 1s in the signal field will always be even on
94 
95 			11a/n/ac RX: this field contains the received parity
96 			field from the L-SIG symbol for the current packet.
97 
98 			<legal 0-1>
99 
100 tail
101 
102 			The 6 bits of tail is always set to 0 is used to flush
103 			the BCC encoder and decoder.  <legal 0>
104 
105 pkt_type
106 
107 			Only used on the RX side.
108 
109 			Note: This is not really part of L-SIG
110 
111 
112 
113 			Packet type:
114 
115 			<enum 0 dot11a>802.11a PPDU type
116 
117 			<enum 1 dot11b>802.11b PPDU type
118 
119 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
120 
121 			<enum 3 dot11ac>802.11ac PPDU type
122 
123 			<enum 4 dot11ax>802.11ax PPDU type
124 
125 			<enum 5 dot11ba>802.11ba (WUR) 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 			<enum 5 dot11ba>802.11ba (WUR) 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