xref: /wlan-driver/fw-api/hw/qcn6432/tlv_hdr.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 _TLV_HDR_H_
18 #define _TLV_HDR_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 #define _TLV_USERID_WIDTH_      6
23 #define _TLV_DATA_WIDTH_        32
24 #define _TLV_TAG_WIDTH_         9
25 
26 #define _TLV_MRV_EN_LEN_WIDTH_  9
27 #define _TLV_MRV_DIS_LEN_WIDTH_ 12
28 
29 #define _TLV_16_DATA_WIDTH_     16
30 #define _TLV_16_TAG_WIDTH_      5
31 #define _TLV_16_LEN_WIDTH_      4
32 #define _TLV_CTAG_WIDTH_        5
33 #define _TLV_44_DATA_WIDTH_     44
34 #define _TLV_64_DATA_WIDTH_     64
35 #define _TLV_76_DATA_WIDTH_     64
36 #define _TLV_CDATA_WIDTH_       32
37 #define _TLV_CDATA_76_WIDTH_    64
38 
39 struct tlv_usr_16_tlword_t {
40 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
41            uint16_t             tlv_cflg_reserved   :   1,
42                                 tlv_tag             :   _TLV_16_TAG_WIDTH_,
43                                 tlv_len             :   _TLV_16_LEN_WIDTH_,
44                                 tlv_usrid           :   _TLV_USERID_WIDTH_;
45 #else
46            uint16_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
47                                 tlv_len             :   _TLV_16_LEN_WIDTH_,
48                                 tlv_tag             :   _TLV_16_TAG_WIDTH_,
49                                 tlv_cflg_reserved   :   1;
50 #endif
51 };
52 
53 struct tlv_16_tlword_t {
54 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
55            uint16_t             tlv_cflg_reserved   :   1,
56                                 tlv_len             :   _TLV_16_LEN_WIDTH_,
57                                 tlv_tag             :   _TLV_16_TAG_WIDTH_,
58                                 tlv_reserved        :   6;
59 #else
60            uint16_t             tlv_reserved        :   6,
61                                 tlv_tag             :   _TLV_16_TAG_WIDTH_,
62                                 tlv_len             :   _TLV_16_LEN_WIDTH_,
63                                 tlv_cflg_reserved   :   1;
64 #endif
65 };
66 
67 // -----------------------------------------------------------------
68 // TLV 32 onwards support two formats,
69 // link id based where some bits of length have been re-purposed
70 // non link id based where legacy length width is available
71 // -----------------------------------------------------------------
72 
73 struct tlv_mlo_usr_32_tlword_t {
74 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
75            uint32_t             tlv_cflg_reserved   :   1,
76                                 tlv_tag             :   _TLV_TAG_WIDTH_,
77                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
78                                 tlv_dst_linkid      :   3,
79                                 tlv_src_linkid      :   3,
80                                 tlv_mrv             :   1,
81                                 tlv_usrid           :   _TLV_USERID_WIDTH_;
82 #else
83            uint32_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
84                                 tlv_mrv             :   1,
85                                 tlv_src_linkid      :   3,
86                                 tlv_dst_linkid      :   3,
87                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
88                                 tlv_tag             :   _TLV_TAG_WIDTH_,
89                                 tlv_cflg_reserved   :   1;
90 #endif
91 };
92 
93 struct tlv_mlo_32_tlword_t {
94 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
95            uint32_t             tlv_cflg_reserved   :   1,
96                                 tlv_tag             :   _TLV_TAG_WIDTH_,
97                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
98                                 tlv_dst_linkid      :   3,
99                                 tlv_src_linkid      :   3,
100                                 tlv_mrv             :   1,
101                                 tlv_reserved        :   6;
102 #else
103            uint32_t             tlv_reserved        :   6,
104                                 tlv_mrv             :   1,
105                                 tlv_src_linkid      :   3,
106                                 tlv_dst_linkid      :   3,
107                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
108                                 tlv_tag             :   _TLV_TAG_WIDTH_,
109                                 tlv_cflg_reserved   :   1;
110 #endif
111 };
112 
113 struct tlv_mlo_usr_64_tlword_t {
114 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
115            uint64_t             tlv_cflg_reserved   :   1,
116                                 tlv_tag             :   _TLV_TAG_WIDTH_,
117                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
118                                 tlv_dst_linkid      :   3,
119                                 tlv_src_linkid      :   3,
120                                 tlv_mrv             :   1,
121                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
122 #else
123            uint64_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
124                                 tlv_mrv             :   1,
125                                 tlv_src_linkid      :   3,
126                                 tlv_dst_linkid      :   3,
127                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
128                                 tlv_tag             :   _TLV_TAG_WIDTH_,
129                                 tlv_cflg_reserved   :   1,
130 #endif
131                                 tlv_reserved        :   32;
132 };
133 
134 struct tlv_mlo_64_tlword_t {
135 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
136            uint64_t             tlv_cflg_reserved   :   1,
137                                 tlv_tag             :   _TLV_TAG_WIDTH_,
138                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
139                                 tlv_dst_linkid      :   3,
140                                 tlv_src_linkid      :   3,
141                                 tlv_mrv             :   1,
142                                 tlv_reserved        :   38;
143 #else
144            uint64_t             tlv_usrid_reserved  :   _TLV_USERID_WIDTH_,
145                                 tlv_mrv             :   1,
146                                 tlv_src_linkid      :   3,
147                                 tlv_dst_linkid      :   3,
148                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
149                                 tlv_tag             :   _TLV_TAG_WIDTH_,
150                                 tlv_cflg_reserved   :   1,
151                                 tlv_reserved        :   32;
152 #endif
153 };
154 
155 struct tlv_mlo_usr_44_tlword_t {
156 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
157            uint64_t             tlv_compression     :   1,
158                                 tlv_tag             :   _TLV_TAG_WIDTH_,
159                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
160                                 tlv_dst_linkid      :   3,
161                                 tlv_src_linkid      :   3,
162                                 tlv_mrv             :   1,
163                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
164                                 tlv_reserved        :   10,
165                                 pad_44to64_bit      :   22;
166 #else
167            uint64_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
168                                 tlv_mrv             :   1,
169                                 tlv_src_linkid      :   3,
170                                 tlv_dst_linkid      :   3,
171                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
172                                 tlv_tag             :   _TLV_TAG_WIDTH_,
173                                 tlv_compression     :   1,
174                                 pad_44to64_bit      :   22,
175                                 tlv_reserved        :   10;
176 #endif
177 };
178 
179 struct tlv_mlo_44_tlword_t {
180 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
181            uint64_t             tlv_compression     :   1,
182                                 tlv_tag             :   _TLV_TAG_WIDTH_,
183                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
184                                 tlv_dst_linkid      :   3,
185                                 tlv_src_linkid      :   3,
186                                 tlv_mrv             :   1,
187                                 tlv_reserved        :   16,
188                                 pad_44to64_bit      :   22;
189 #else
190            uint64_t             tlv_usrid_reserved  :   _TLV_USERID_WIDTH_,
191                                 tlv_mrv             :   1,
192                                 tlv_src_linkid      :   3,
193                                 tlv_dst_linkid      :   3,
194                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
195                                 tlv_tag             :   _TLV_TAG_WIDTH_,
196                                 tlv_compression     :   1,
197                                 pad_44to64_bit      :   22,
198                                 tlv_reserved        :   10;
199 #endif
200 };
201 
202 struct tlv_mlo_usr_76_tlword_t {
203 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
204            uint64_t             tlv_compression     :   1,
205                                 tlv_tag             :   _TLV_TAG_WIDTH_,
206                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
207                                 tlv_dst_linkid      :   3,
208                                 tlv_src_linkid      :   3,
209                                 tlv_mrv             :   1,
210                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
211 #else
212            uint64_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
213                                 tlv_mrv             :   1,
214                                 tlv_src_linkid      :   3,
215                                 tlv_dst_linkid      :   3,
216                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
217                                 tlv_tag             :   _TLV_TAG_WIDTH_,
218                                 tlv_compression     :   1,
219 #endif
220                                 tlv_reserved        :   32;
221            uint64_t             pad_64to128_bit     :   64;
222 };
223 
224 struct tlv_mlo_76_tlword_t {
225 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
226            uint64_t             tlv_compression     :   1,
227                                 tlv_tag             :   _TLV_TAG_WIDTH_,
228                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
229                                 tlv_dst_linkid      :   3,
230                                 tlv_src_linkid      :   3,
231                                 tlv_mrv             :   1,
232                                 tlv_reserved        :   38;
233 #else
234            uint64_t             tlv_usrid_reserved  :   _TLV_USERID_WIDTH_,
235                                 tlv_mrv             :   1,
236                                 tlv_src_linkid      :   3,
237                                 tlv_dst_linkid      :   3,
238                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
239                                 tlv_tag             :   _TLV_TAG_WIDTH_,
240                                 tlv_compression     :   1,
241                                 tlv_reserved        :   32;
242 #endif
243            uint64_t             pad_64to128_bit     :   64;
244 };
245 
246 
247 
248 
249 
250 
251 struct tlv_mac_usr_32_tlword_t {
252 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
253            uint32_t             tlv_cflg_reserved   :   1,
254                                 tlv_tag             :   _TLV_TAG_WIDTH_,
255                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
256                                 tlv_src_linkid      :   3,
257                                 tlv_mrv             :   1,
258                                 tlv_usrid           :   _TLV_USERID_WIDTH_;
259 #else
260            uint32_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
261                                 tlv_mrv             :   1,
262                                 tlv_src_linkid      :   3,
263                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
264                                 tlv_tag             :   _TLV_TAG_WIDTH_,
265                                 tlv_cflg_reserved   :   1;
266 #endif
267 };
268 
269 struct tlv_mac_32_tlword_t {
270 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
271            uint32_t             tlv_cflg_reserved   :   1,
272                                 tlv_tag             :   _TLV_TAG_WIDTH_,
273                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
274                                 tlv_src_linkid      :   3,
275                                 tlv_mrv             :   1,
276                                 tlv_reserved        :   6;
277 #else
278            uint32_t             tlv_reserved        :   6,
279                                 tlv_mrv             :   1,
280                                 tlv_src_linkid      :   3,
281                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
282                                 tlv_tag             :   _TLV_TAG_WIDTH_,
283                                 tlv_cflg_reserved   :   1;
284 #endif
285 };
286 
287 struct tlv_mac_usr_64_tlword_t {
288 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
289            uint64_t             tlv_cflg_reserved   :   1,
290                                 tlv_tag             :   _TLV_TAG_WIDTH_,
291                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
292                                 tlv_src_linkid      :   3,
293                                 tlv_mrv             :   1,
294                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
295 #else
296            uint64_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
297                                 tlv_mrv             :   1,
298                                 tlv_src_linkid      :   3,
299                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
300                                 tlv_tag             :   _TLV_TAG_WIDTH_,
301                                 tlv_cflg_reserved   :   1,
302 #endif
303                                 tlv_reserved        :   32;
304 };
305 
306 struct tlv_mac_64_tlword_t {
307 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
308            uint64_t             tlv_cflg_reserved   :   1,
309                                 tlv_tag             :   _TLV_TAG_WIDTH_,
310                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
311                                 tlv_src_linkid      :   3,
312                                 tlv_mrv             :   1,
313                                 tlv_reserved        :   38;
314 #else
315            uint64_t             tlv_usrid_reserved  :   _TLV_USERID_WIDTH_,
316                                 tlv_mrv             :   1,
317                                 tlv_src_linkid      :   3,
318                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
319                                 tlv_tag             :   _TLV_TAG_WIDTH_,
320                                 tlv_cflg_reserved   :   1,
321                                 tlv_reserved        :   32;
322 #endif
323 };
324 
325 struct tlv_mac_usr_44_tlword_t {
326 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
327            uint64_t             tlv_compression     :   1,
328                                 tlv_tag             :   _TLV_TAG_WIDTH_,
329                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
330                                 tlv_src_linkid      :   3,
331                                 tlv_mrv             :   1,
332                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
333                                 tlv_reserved        :   10,
334                                 pad_44to64_bit      :   22;
335 #else
336            uint64_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
337                                 tlv_mrv             :   1,
338                                 tlv_src_linkid      :   3,
339                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
340                                 tlv_tag             :   _TLV_TAG_WIDTH_,
341                                 tlv_compression     :   1,
342                                 pad_44to64_bit      :   22,
343                                 tlv_reserved        :   10;
344 #endif
345 };
346 
347 struct tlv_mac_44_tlword_t {
348 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
349            uint64_t             tlv_compression     :   1,
350                                 tlv_tag             :   _TLV_TAG_WIDTH_,
351                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
352                                 tlv_src_linkid      :   3,
353                                 tlv_mrv             :   1,
354                                 tlv_reserved        :   16,
355                                 pad_44to64_bit      :   22;
356 #else
357            uint64_t             tlv_usrid_reserved  :   _TLV_USERID_WIDTH_,
358                                 tlv_mrv             :   1,
359                                 tlv_src_linkid      :   3,
360                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
361                                 tlv_tag             :   _TLV_TAG_WIDTH_,
362                                 tlv_compression     :   1,
363                                 pad_44to64_bit      :   22,
364                                 tlv_reserved        :   10;
365 #endif
366 };
367 
368 struct tlv_mac_usr_76_tlword_t {
369 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
370            uint64_t             tlv_compression     :   1,
371                                 tlv_tag             :   _TLV_TAG_WIDTH_,
372                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
373                                 tlv_src_linkid      :   3,
374                                 tlv_mrv             :   1,
375                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
376 #else
377            uint64_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
378                                 tlv_mrv             :   1,
379                                 tlv_src_linkid      :   3,
380                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
381                                 tlv_tag             :   _TLV_TAG_WIDTH_,
382                                 tlv_compression     :   1,
383 #endif
384                                 tlv_reserved        :   32;
385            uint64_t             pad_64to128_bit     :   64;
386 };
387 
388 struct tlv_mac_76_tlword_t {
389 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
390            uint64_t             tlv_compression     :   1,
391                                 tlv_tag             :   _TLV_TAG_WIDTH_,
392                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
393                                 tlv_src_linkid      :   3,
394                                 tlv_mrv             :   1,
395                                 tlv_reserved        :   38;
396 #else
397            uint64_t             tlv_usrid_reserved  :   _TLV_USERID_WIDTH_,
398                                 tlv_mrv             :   1,
399                                 tlv_src_linkid      :   3,
400                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
401                                 tlv_tag             :   _TLV_TAG_WIDTH_,
402                                 tlv_compression     :   1,
403                                 tlv_reserved        :   32;
404 #endif
405            uint64_t             pad_64to128_bit     :   64;
406 };
407 
408 // -----------------------------------------------------------------
409 // Compressed TLVs do not support the MLO variant
410 // -----------------------------------------------------------------
411 
412 struct tlv_usr_c_44_tlword_t {
413 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
414            uint64_t             tlv_compression     :   1,
415                                 tlv_ctag            :   _TLV_CTAG_WIDTH_,
416                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
417                                 tlv_cdata           :   _TLV_CDATA_WIDTH_,
418                                 pad_44to64_bit      :   20;
419 #else
420            uint64_t             tlv_cdata_lower_20  :   20,
421                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
422                                 tlv_ctag            :   _TLV_CTAG_WIDTH_,
423                                 tlv_compression     :   1,
424                                 pad_44to64_bit      :   20,
425                                 tlv_cdata_upper_12  :   12;
426 #endif
427 };
428 
429 struct tlv_usr_c_76_tlword_t {
430 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
431            uint64_t             tlv_compression     :   1,
432                                 tlv_ctag            :   _TLV_CTAG_WIDTH_,
433                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
434                                 tlv_cdata_lower_52  :   52;
435            uint64_t             tlv_cdata_upper_12  :   12,
436                                 pad_76to128_bit     :   52;
437 #else
438            uint64_t             tlv_cdata_lower_20  :   20,
439                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
440                                 tlv_ctag            :   _TLV_CTAG_WIDTH_,
441                                 tlv_compression     :   1,
442                                 tlv_cdata_middle_32 :   32;
443            uint64_t             pad_76to96_bit      :   20,
444                                 tlv_cdata_upper_12  :   12,
445                                 pad_96to128_bit     :   32;
446 #endif
447 };
448 
449 
450 // -----------------------------------------------------------------
451 // !!!   For backward compatibility ONLY.                        !!!
452 // !!!   As per SW request, legacy tlv_32_hdr and tlv_usr_32_hdr !!!
453 // !!!   types are mapped to new 64 bit headers.                 !!!
454 // -----------------------------------------------------------------
455 struct tlv_usr_32_hdr {
456 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
457            uint64_t             tlv_cflg_reserved   :   1,
458                                 tlv_tag             :   _TLV_TAG_WIDTH_,
459                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
460                                 tlv_src_linkid      :   3,
461                                 tlv_mrv             :   1,
462                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
463 #else
464            uint32_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
465                                 tlv_mrv             :   1,
466                                 tlv_src_linkid      :   3,
467                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
468                                 tlv_tag             :   _TLV_TAG_WIDTH_,
469                                 tlv_cflg_reserved   :   1,
470 #endif
471                                 tlv_reserved        :   32;
472 };
473 
474 struct tlv_32_hdr {
475 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
476            uint64_t             tlv_cflg_reserved   :   1,
477                                 tlv_tag             :   _TLV_TAG_WIDTH_,
478                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
479                                 tlv_src_linkid      :   3,
480                                 tlv_mrv             :   1,
481                                 tlv_reserved        :   38;
482 #else
483            uint64_t             tlv_usrid_reserved  :   _TLV_USERID_WIDTH_,
484                                 tlv_mrv             :   1,
485                                 tlv_src_linkid      :   3,
486                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
487                                 tlv_tag             :   _TLV_TAG_WIDTH_,
488                                 tlv_cflg_reserved   :   1,
489                                 tlv_reserved        :   32;
490 #endif
491 };
492 // -----------------------------------------------------------------
493 
494 // -----------------------------------------------------------------
495 // !!!   Tag-length word structures using uint32_t               !!!
496 // !!!   For endianness considerations                           !!!
497 // !!!   'tlword' is replaced with 'tlw32'                       !!!
498 // -----------------------------------------------------------------
499 
500 struct tlv_mlo_usr_64_tlw32_t {
501 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
502            uint32_t             tlv_cflg_reserved   :   1,
503                                 tlv_tag             :   _TLV_TAG_WIDTH_,
504                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
505                                 tlv_dst_linkid      :   3,
506                                 tlv_src_linkid      :   3,
507                                 tlv_mrv             :   1,
508                                 tlv_usrid           :   _TLV_USERID_WIDTH_;
509 #else
510            uint32_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
511                                 tlv_mrv             :   1,
512                                 tlv_src_linkid      :   3,
513                                 tlv_dst_linkid      :   3,
514                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
515                                 tlv_tag             :   _TLV_TAG_WIDTH_,
516                                 tlv_cflg_reserved   :   1;
517 #endif
518            uint32_t             pad_32to64_bit      :   32;
519 };
520 
521 struct tlv_mlo_64_tlw32_t {
522 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
523            uint32_t             tlv_cflg_reserved   :   1,
524                                 tlv_tag             :   _TLV_TAG_WIDTH_,
525                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
526                                 tlv_dst_linkid      :   3,
527                                 tlv_src_linkid      :   3,
528                                 tlv_mrv             :   1,
529                                 tlv_reserved        :   _TLV_USERID_WIDTH_;
530 #else
531            uint32_t             tlv_reserved        :   _TLV_USERID_WIDTH_,
532                                 tlv_mrv             :   1,
533                                 tlv_src_linkid      :   3,
534                                 tlv_dst_linkid      :   3,
535                                 tlv_len             :   _TLV_MRV_EN_LEN_WIDTH_,
536                                 tlv_tag             :   _TLV_TAG_WIDTH_,
537                                 tlv_cflg_reserved   :   1;
538 #endif
539            uint32_t             pad_32to64_bit      :   32;
540 };
541 
542 struct tlv_mac_usr_64_tlw32_t {
543 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
544            uint32_t             tlv_cflg_reserved   :   1,
545                                 tlv_tag             :   _TLV_TAG_WIDTH_,
546                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
547                                 tlv_src_linkid      :   3,
548                                 tlv_mrv             :   1,
549                                 tlv_usrid           :   _TLV_USERID_WIDTH_;
550 #else
551            uint32_t             tlv_usrid           :   _TLV_USERID_WIDTH_,
552                                 tlv_mrv             :   1,
553                                 tlv_src_linkid      :   3,
554                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
555                                 tlv_tag             :   _TLV_TAG_WIDTH_,
556                                 tlv_cflg_reserved   :   1;
557 #endif
558            uint32_t             pad_32to64_bit      :   32;
559 };
560 
561 struct tlv_mac_64_tlw32_t {
562 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
563            uint32_t             tlv_cflg_reserved   :   1,
564                                 tlv_tag             :   _TLV_TAG_WIDTH_,
565                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
566                                 tlv_src_linkid      :   3,
567                                 tlv_mrv             :   1,
568                                 tlv_reserved        :   _TLV_USERID_WIDTH_;
569 #else
570            uint32_t             tlv_reserved        :   _TLV_USERID_WIDTH_,
571                                 tlv_mrv             :   1,
572                                 tlv_src_linkid      :   3,
573                                 tlv_len             :   _TLV_MRV_DIS_LEN_WIDTH_,
574                                 tlv_tag             :   _TLV_TAG_WIDTH_,
575                                 tlv_cflg_reserved   :   1;
576 #endif
577            uint32_t             pad_32to64_bit      :   32;
578 };
579 
580 // -----------------------------------------------------------------
581 // Compressed TLVs do not support the MLO variant
582 // -----------------------------------------------------------------
583 
584 struct tlv_usr_c_44_tlw32_t {
585 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
586            uint32_t             tlv_compression     :   1,
587                                 tlv_ctag            :   _TLV_CTAG_WIDTH_,
588                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
589                                 tlv_cdata_lower_20  :   20;
590            uint32_t             tlv_cdata_upper_12  :   12,
591                                 pad_44to64_bit      :   20;
592 #else
593            uint32_t             tlv_cdata_lower_20  :   20,
594                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
595                                 tlv_ctag            :   _TLV_CTAG_WIDTH_,
596                                 tlv_compression     :   1;
597            uint32_t             pad_44to64_bit      :   20,
598                                 tlv_cdata_upper_12  :   12;
599 #endif
600 };
601 
602 struct tlv_usr_c_76_tlw32_t {
603 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
604            uint32_t             tlv_compression     :   1,
605                                 tlv_ctag            :   _TLV_CTAG_WIDTH_,
606                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
607                                 tlv_cdata_lower_20  :   20;
608            uint32_t             tlv_cdata_middle_32 :   32;
609            uint32_t             tlv_cdata_upper_12  :   12,
610                                 pad_76to96_bit      :   20;
611            uint32_t             pad_96to128_bit     :   32;
612 #else
613            uint32_t             tlv_cdata_lower_20  :   20,
614                                 tlv_usrid           :   _TLV_USERID_WIDTH_,
615                                 tlv_ctag            :   _TLV_CTAG_WIDTH_,
616                                 tlv_compression     :   1;
617            uint32_t             tlv_cdata_middle_32 :   32;
618            uint32_t             pad_76to96_bit      :   20,
619                                 tlv_cdata_upper_12  :   12;
620            uint32_t             pad_96to128_bit     :   32;
621 #endif
622 };
623 // -----------------------------------------------------------------
624 
625 
626 #endif // _TLV_HDR_H_
627