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