xref: /wlan-driver/fw-api/hw/qca5018/tlv_hdr.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020, 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 _TLV_HDR_H_
18 #define _TLV_HDR_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 struct tlv_usr_16_hdr {
23    volatile uint16_t             tlv_cflg_reserved   :   1,
24                                  tlv_tag             :   5,
25                                  tlv_len             :   4,
26                                  tlv_usrid           :   6;
27 };
28 
29 struct tlv_16_hdr {
30    volatile uint16_t             tlv_cflg_reserved   :   1,
31                                  tlv_tag             :   5,
32                                  tlv_len             :   4,
33                                  tlv_reserved        :   6;
34 };
35 
36 struct tlv_usr_32_hdr {
37    volatile uint32_t             tlv_cflg_reserved   :   1,
38                                  tlv_tag             :   9,
39                                  tlv_len             :  16,
40                                  tlv_usrid           :   6;
41 };
42 
43 struct tlv_32_hdr {
44    volatile uint32_t             tlv_cflg_reserved   :   1,
45                                  tlv_tag             :   9,
46                                  tlv_len             :  16,
47                                  tlv_reserved        :   6;
48 };
49 
50 struct tlv_usr_42_hdr {
51    volatile uint64_t             tlv_compression     :   1,
52                                  tlv_tag             :   9,
53                                  tlv_len             :  16,
54                                  tlv_usrid           :   6,
55                                  tlv_reserved        :  10,
56                                  pad_42to64_bit      :  22;
57 };
58 
59 struct tlv_42_hdr {
60    volatile uint64_t             tlv_compression     :   1,
61                                  tlv_tag             :   9,
62                                  tlv_len             :  16,
63                                  tlv_reserved        :  16,
64                                  pad_42to64_bit      :  22;
65 };
66 
67 struct tlv_usr_c_42_hdr {
68    volatile uint64_t             tlv_compression     :   1,
69                                  tlv_ctag            :   3,
70                                  tlv_usrid           :   6,
71                                  tlv_cdata           :  32,
72                                  pad_42to64_bit      :  22;
73 };
74 
75 #endif
76