xref: /wlan-driver/fw-api/hw/kiwi/v2/ht_sig_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 
2 /*
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 
21 
22 #ifndef _HT_SIG_INFO_H_
23 #define _HT_SIG_INFO_H_
24 #if !defined(__ASSEMBLER__)
25 #endif
26 
27 #define NUM_OF_DWORDS_HT_SIG_INFO 2
28 
29 struct ht_sig_info {
30 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
31              uint32_t mcs                                                     :  7,
32                       cbw                                                     :  1,
33                       length                                                  : 16,
34                       reserved_0                                              :  8;
35              uint32_t smoothing                                               :  1,
36                       not_sounding                                            :  1,
37                       ht_reserved                                             :  1,
38                       aggregation                                             :  1,
39                       stbc                                                    :  2,
40                       fec_coding                                              :  1,
41                       short_gi                                                :  1,
42                       num_ext_sp_str                                          :  2,
43                       crc                                                     :  8,
44                       signal_tail                                             :  6,
45                       reserved_1                                              :  7,
46                       rx_integrity_check_passed                               :  1;
47 #else
48              uint32_t reserved_0                                              :  8,
49                       length                                                  : 16,
50                       cbw                                                     :  1,
51                       mcs                                                     :  7;
52              uint32_t rx_integrity_check_passed                               :  1,
53                       reserved_1                                              :  7,
54                       signal_tail                                             :  6,
55                       crc                                                     :  8,
56                       num_ext_sp_str                                          :  2,
57                       short_gi                                                :  1,
58                       fec_coding                                              :  1,
59                       stbc                                                    :  2,
60                       aggregation                                             :  1,
61                       ht_reserved                                             :  1,
62                       not_sounding                                            :  1,
63                       smoothing                                               :  1;
64 #endif
65 };
66 
67 #define HT_SIG_INFO_MCS_OFFSET                                                      0x00000000
68 #define HT_SIG_INFO_MCS_LSB                                                         0
69 #define HT_SIG_INFO_MCS_MSB                                                         6
70 #define HT_SIG_INFO_MCS_MASK                                                        0x0000007f
71 
72 #define HT_SIG_INFO_CBW_OFFSET                                                      0x00000000
73 #define HT_SIG_INFO_CBW_LSB                                                         7
74 #define HT_SIG_INFO_CBW_MSB                                                         7
75 #define HT_SIG_INFO_CBW_MASK                                                        0x00000080
76 
77 #define HT_SIG_INFO_LENGTH_OFFSET                                                   0x00000000
78 #define HT_SIG_INFO_LENGTH_LSB                                                      8
79 #define HT_SIG_INFO_LENGTH_MSB                                                      23
80 #define HT_SIG_INFO_LENGTH_MASK                                                     0x00ffff00
81 
82 #define HT_SIG_INFO_RESERVED_0_OFFSET                                               0x00000000
83 #define HT_SIG_INFO_RESERVED_0_LSB                                                  24
84 #define HT_SIG_INFO_RESERVED_0_MSB                                                  31
85 #define HT_SIG_INFO_RESERVED_0_MASK                                                 0xff000000
86 
87 #define HT_SIG_INFO_SMOOTHING_OFFSET                                                0x00000004
88 #define HT_SIG_INFO_SMOOTHING_LSB                                                   0
89 #define HT_SIG_INFO_SMOOTHING_MSB                                                   0
90 #define HT_SIG_INFO_SMOOTHING_MASK                                                  0x00000001
91 
92 #define HT_SIG_INFO_NOT_SOUNDING_OFFSET                                             0x00000004
93 #define HT_SIG_INFO_NOT_SOUNDING_LSB                                                1
94 #define HT_SIG_INFO_NOT_SOUNDING_MSB                                                1
95 #define HT_SIG_INFO_NOT_SOUNDING_MASK                                               0x00000002
96 
97 #define HT_SIG_INFO_HT_RESERVED_OFFSET                                              0x00000004
98 #define HT_SIG_INFO_HT_RESERVED_LSB                                                 2
99 #define HT_SIG_INFO_HT_RESERVED_MSB                                                 2
100 #define HT_SIG_INFO_HT_RESERVED_MASK                                                0x00000004
101 
102 #define HT_SIG_INFO_AGGREGATION_OFFSET                                              0x00000004
103 #define HT_SIG_INFO_AGGREGATION_LSB                                                 3
104 #define HT_SIG_INFO_AGGREGATION_MSB                                                 3
105 #define HT_SIG_INFO_AGGREGATION_MASK                                                0x00000008
106 
107 #define HT_SIG_INFO_STBC_OFFSET                                                     0x00000004
108 #define HT_SIG_INFO_STBC_LSB                                                        4
109 #define HT_SIG_INFO_STBC_MSB                                                        5
110 #define HT_SIG_INFO_STBC_MASK                                                       0x00000030
111 
112 #define HT_SIG_INFO_FEC_CODING_OFFSET                                               0x00000004
113 #define HT_SIG_INFO_FEC_CODING_LSB                                                  6
114 #define HT_SIG_INFO_FEC_CODING_MSB                                                  6
115 #define HT_SIG_INFO_FEC_CODING_MASK                                                 0x00000040
116 
117 #define HT_SIG_INFO_SHORT_GI_OFFSET                                                 0x00000004
118 #define HT_SIG_INFO_SHORT_GI_LSB                                                    7
119 #define HT_SIG_INFO_SHORT_GI_MSB                                                    7
120 #define HT_SIG_INFO_SHORT_GI_MASK                                                   0x00000080
121 
122 #define HT_SIG_INFO_NUM_EXT_SP_STR_OFFSET                                           0x00000004
123 #define HT_SIG_INFO_NUM_EXT_SP_STR_LSB                                              8
124 #define HT_SIG_INFO_NUM_EXT_SP_STR_MSB                                              9
125 #define HT_SIG_INFO_NUM_EXT_SP_STR_MASK                                             0x00000300
126 
127 #define HT_SIG_INFO_CRC_OFFSET                                                      0x00000004
128 #define HT_SIG_INFO_CRC_LSB                                                         10
129 #define HT_SIG_INFO_CRC_MSB                                                         17
130 #define HT_SIG_INFO_CRC_MASK                                                        0x0003fc00
131 
132 #define HT_SIG_INFO_SIGNAL_TAIL_OFFSET                                              0x00000004
133 #define HT_SIG_INFO_SIGNAL_TAIL_LSB                                                 18
134 #define HT_SIG_INFO_SIGNAL_TAIL_MSB                                                 23
135 #define HT_SIG_INFO_SIGNAL_TAIL_MASK                                                0x00fc0000
136 
137 #define HT_SIG_INFO_RESERVED_1_OFFSET                                               0x00000004
138 #define HT_SIG_INFO_RESERVED_1_LSB                                                  24
139 #define HT_SIG_INFO_RESERVED_1_MSB                                                  30
140 #define HT_SIG_INFO_RESERVED_1_MASK                                                 0x7f000000
141 
142 #define HT_SIG_INFO_RX_INTEGRITY_CHECK_PASSED_OFFSET                                0x00000004
143 #define HT_SIG_INFO_RX_INTEGRITY_CHECK_PASSED_LSB                                   31
144 #define HT_SIG_INFO_RX_INTEGRITY_CHECK_PASSED_MSB                                   31
145 #define HT_SIG_INFO_RX_INTEGRITY_CHECK_PASSED_MASK                                  0x80000000
146 
147 #endif
148