xref: /freebsd/sys/dev/cxgb/common/cxgb_sge_defs.h (revision f5463265955b829775bbb32e1fd0bc11dafc36ce)
1 /**************************************************************************
2 SPDX-License-Identifier: BSD-2-Clause
3 
4 Copyright (c) 2007, Chelsio Inc.
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10  1. Redistributions of source code must retain the above copyright notice,
11     this list of conditions and the following disclaimer.
12 
13  2. Neither the name of the Chelsio Corporation nor the names of its
14     contributors may be used to endorse or promote products derived from
15     this software without specific prior written permission.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 POSSIBILITY OF SUCH DAMAGE.
28 
29 ***************************************************************************/
30 /*
31  * This file is automatically generated --- any changes will be lost.
32  */
33 
34 #ifndef _SGE_DEFS_H
35 #define _SGE_DEFS_H
36 
37 #define S_EC_CREDITS    0
38 #define M_EC_CREDITS    0x7FFF
39 #define V_EC_CREDITS(x) ((x) << S_EC_CREDITS)
40 #define G_EC_CREDITS(x) (((x) >> S_EC_CREDITS) & M_EC_CREDITS)
41 
42 #define S_EC_GTS    15
43 #define V_EC_GTS(x) ((x) << S_EC_GTS)
44 #define F_EC_GTS    V_EC_GTS(1U)
45 
46 #define S_EC_INDEX    16
47 #define M_EC_INDEX    0xFFFF
48 #define V_EC_INDEX(x) ((x) << S_EC_INDEX)
49 #define G_EC_INDEX(x) (((x) >> S_EC_INDEX) & M_EC_INDEX)
50 
51 #define S_EC_SIZE    0
52 #define M_EC_SIZE    0xFFFF
53 #define V_EC_SIZE(x) ((x) << S_EC_SIZE)
54 #define G_EC_SIZE(x) (((x) >> S_EC_SIZE) & M_EC_SIZE)
55 
56 #define S_EC_BASE_LO    16
57 #define M_EC_BASE_LO    0xFFFF
58 #define V_EC_BASE_LO(x) ((x) << S_EC_BASE_LO)
59 #define G_EC_BASE_LO(x) (((x) >> S_EC_BASE_LO) & M_EC_BASE_LO)
60 
61 #define S_EC_BASE_HI    0
62 #define M_EC_BASE_HI    0xF
63 #define V_EC_BASE_HI(x) ((x) << S_EC_BASE_HI)
64 #define G_EC_BASE_HI(x) (((x) >> S_EC_BASE_HI) & M_EC_BASE_HI)
65 
66 #define S_EC_RESPQ    4
67 #define M_EC_RESPQ    0x7
68 #define V_EC_RESPQ(x) ((x) << S_EC_RESPQ)
69 #define G_EC_RESPQ(x) (((x) >> S_EC_RESPQ) & M_EC_RESPQ)
70 
71 #define S_EC_TYPE    7
72 #define M_EC_TYPE    0x7
73 #define V_EC_TYPE(x) ((x) << S_EC_TYPE)
74 #define G_EC_TYPE(x) (((x) >> S_EC_TYPE) & M_EC_TYPE)
75 
76 #define S_EC_GEN    10
77 #define V_EC_GEN(x) ((x) << S_EC_GEN)
78 #define F_EC_GEN    V_EC_GEN(1U)
79 
80 #define S_EC_UP_TOKEN    11
81 #define M_EC_UP_TOKEN    0xFFFFF
82 #define V_EC_UP_TOKEN(x) ((x) << S_EC_UP_TOKEN)
83 #define G_EC_UP_TOKEN(x) (((x) >> S_EC_UP_TOKEN) & M_EC_UP_TOKEN)
84 
85 #define S_EC_VALID    31
86 #define V_EC_VALID(x) ((x) << S_EC_VALID)
87 #define F_EC_VALID    V_EC_VALID(1U)
88 
89 #define S_RQ_MSI_VEC    20
90 #define M_RQ_MSI_VEC    0x3F
91 #define V_RQ_MSI_VEC(x) ((x) << S_RQ_MSI_VEC)
92 #define G_RQ_MSI_VEC(x) (((x) >> S_RQ_MSI_VEC) & M_RQ_MSI_VEC)
93 
94 #define S_RQ_INTR_EN    26
95 #define V_RQ_INTR_EN(x) ((x) << S_RQ_INTR_EN)
96 #define F_RQ_INTR_EN    V_RQ_INTR_EN(1U)
97 
98 #define S_RQ_GEN    28
99 #define V_RQ_GEN(x) ((x) << S_RQ_GEN)
100 #define F_RQ_GEN    V_RQ_GEN(1U)
101 
102 #define S_CQ_INDEX    0
103 #define M_CQ_INDEX    0xFFFF
104 #define V_CQ_INDEX(x) ((x) << S_CQ_INDEX)
105 #define G_CQ_INDEX(x) (((x) >> S_CQ_INDEX) & M_CQ_INDEX)
106 
107 #define S_CQ_SIZE    16
108 #define M_CQ_SIZE    0xFFFF
109 #define V_CQ_SIZE(x) ((x) << S_CQ_SIZE)
110 #define G_CQ_SIZE(x) (((x) >> S_CQ_SIZE) & M_CQ_SIZE)
111 
112 #define S_CQ_BASE_HI    0
113 #define M_CQ_BASE_HI    0xFFFFF
114 #define V_CQ_BASE_HI(x) ((x) << S_CQ_BASE_HI)
115 #define G_CQ_BASE_HI(x) (((x) >> S_CQ_BASE_HI) & M_CQ_BASE_HI)
116 
117 #define S_CQ_RSPQ    20
118 #define M_CQ_RSPQ    0x3F
119 #define V_CQ_RSPQ(x) ((x) << S_CQ_RSPQ)
120 #define G_CQ_RSPQ(x) (((x) >> S_CQ_RSPQ) & M_CQ_RSPQ)
121 
122 #define S_CQ_ASYNC_NOTIF    26
123 #define V_CQ_ASYNC_NOTIF(x) ((x) << S_CQ_ASYNC_NOTIF)
124 #define F_CQ_ASYNC_NOTIF    V_CQ_ASYNC_NOTIF(1U)
125 
126 #define S_CQ_ARMED    27
127 #define V_CQ_ARMED(x) ((x) << S_CQ_ARMED)
128 #define F_CQ_ARMED    V_CQ_ARMED(1U)
129 
130 #define S_CQ_ASYNC_NOTIF_SOL    28
131 #define V_CQ_ASYNC_NOTIF_SOL(x) ((x) << S_CQ_ASYNC_NOTIF_SOL)
132 #define F_CQ_ASYNC_NOTIF_SOL    V_CQ_ASYNC_NOTIF_SOL(1U)
133 
134 #define S_CQ_GEN    29
135 #define V_CQ_GEN(x) ((x) << S_CQ_GEN)
136 #define F_CQ_GEN    V_CQ_GEN(1U)
137 
138 #define S_CQ_ERR    30
139 #define V_CQ_ERR(x) ((x) << S_CQ_ERR)
140 #define F_CQ_ERR    V_CQ_ERR(1U)
141 
142 #define S_CQ_OVERFLOW_MODE    31
143 #define V_CQ_OVERFLOW_MODE(x) ((x) << S_CQ_OVERFLOW_MODE)
144 #define F_CQ_OVERFLOW_MODE    V_CQ_OVERFLOW_MODE(1U)
145 
146 #define S_CQ_CREDITS    0
147 #define M_CQ_CREDITS    0xFFFF
148 #define V_CQ_CREDITS(x) ((x) << S_CQ_CREDITS)
149 #define G_CQ_CREDITS(x) (((x) >> S_CQ_CREDITS) & M_CQ_CREDITS)
150 
151 #define S_CQ_CREDIT_THRES    16
152 #define M_CQ_CREDIT_THRES    0x1FFF
153 #define V_CQ_CREDIT_THRES(x) ((x) << S_CQ_CREDIT_THRES)
154 #define G_CQ_CREDIT_THRES(x) (((x) >> S_CQ_CREDIT_THRES) & M_CQ_CREDIT_THRES)
155 
156 #define S_FL_BASE_HI    0
157 #define M_FL_BASE_HI    0xFFFFF
158 #define V_FL_BASE_HI(x) ((x) << S_FL_BASE_HI)
159 #define G_FL_BASE_HI(x) (((x) >> S_FL_BASE_HI) & M_FL_BASE_HI)
160 
161 #define S_FL_INDEX_LO    20
162 #define M_FL_INDEX_LO    0xFFF
163 #define V_FL_INDEX_LO(x) ((x) << S_FL_INDEX_LO)
164 #define G_FL_INDEX_LO(x) (((x) >> S_FL_INDEX_LO) & M_FL_INDEX_LO)
165 
166 #define S_FL_INDEX_HI    0
167 #define M_FL_INDEX_HI    0xF
168 #define V_FL_INDEX_HI(x) ((x) << S_FL_INDEX_HI)
169 #define G_FL_INDEX_HI(x) (((x) >> S_FL_INDEX_HI) & M_FL_INDEX_HI)
170 
171 #define S_FL_SIZE    4
172 #define M_FL_SIZE    0xFFFF
173 #define V_FL_SIZE(x) ((x) << S_FL_SIZE)
174 #define G_FL_SIZE(x) (((x) >> S_FL_SIZE) & M_FL_SIZE)
175 
176 #define S_FL_GEN    20
177 #define V_FL_GEN(x) ((x) << S_FL_GEN)
178 #define F_FL_GEN    V_FL_GEN(1U)
179 
180 #define S_FL_ENTRY_SIZE_LO    21
181 #define M_FL_ENTRY_SIZE_LO    0x7FF
182 #define V_FL_ENTRY_SIZE_LO(x) ((x) << S_FL_ENTRY_SIZE_LO)
183 #define G_FL_ENTRY_SIZE_LO(x) (((x) >> S_FL_ENTRY_SIZE_LO) & M_FL_ENTRY_SIZE_LO)
184 
185 #define S_FL_ENTRY_SIZE_HI    0
186 #define M_FL_ENTRY_SIZE_HI    0x1FFFFF
187 #define V_FL_ENTRY_SIZE_HI(x) ((x) << S_FL_ENTRY_SIZE_HI)
188 #define G_FL_ENTRY_SIZE_HI(x) (((x) >> S_FL_ENTRY_SIZE_HI) & M_FL_ENTRY_SIZE_HI)
189 
190 #define S_FL_CONG_THRES    21
191 #define M_FL_CONG_THRES    0x3FF
192 #define V_FL_CONG_THRES(x) ((x) << S_FL_CONG_THRES)
193 #define G_FL_CONG_THRES(x) (((x) >> S_FL_CONG_THRES) & M_FL_CONG_THRES)
194 
195 #define S_FL_GTS    31
196 #define V_FL_GTS(x) ((x) << S_FL_GTS)
197 #define F_FL_GTS    V_FL_GTS(1U)
198 
199 #define S_FLD_GEN1    31
200 #define V_FLD_GEN1(x) ((x) << S_FLD_GEN1)
201 #define F_FLD_GEN1    V_FLD_GEN1(1U)
202 
203 #define S_FLD_GEN2    0
204 #define V_FLD_GEN2(x) ((x) << S_FLD_GEN2)
205 #define F_FLD_GEN2    V_FLD_GEN2(1U)
206 
207 #define S_RSPD_TXQ1_CR    0
208 #define M_RSPD_TXQ1_CR    0x7F
209 #define V_RSPD_TXQ1_CR(x) ((x) << S_RSPD_TXQ1_CR)
210 #define G_RSPD_TXQ1_CR(x) (((x) >> S_RSPD_TXQ1_CR) & M_RSPD_TXQ1_CR)
211 
212 #define S_RSPD_TXQ1_GTS    7
213 #define V_RSPD_TXQ1_GTS(x) ((x) << S_RSPD_TXQ1_GTS)
214 #define F_RSPD_TXQ1_GTS    V_RSPD_TXQ1_GTS(1U)
215 
216 #define S_RSPD_TXQ2_CR    8
217 #define M_RSPD_TXQ2_CR    0x7F
218 #define V_RSPD_TXQ2_CR(x) ((x) << S_RSPD_TXQ2_CR)
219 #define G_RSPD_TXQ2_CR(x) (((x) >> S_RSPD_TXQ2_CR) & M_RSPD_TXQ2_CR)
220 
221 #define S_RSPD_TXQ2_GTS    15
222 #define V_RSPD_TXQ2_GTS(x) ((x) << S_RSPD_TXQ2_GTS)
223 #define F_RSPD_TXQ2_GTS    V_RSPD_TXQ2_GTS(1U)
224 
225 #define S_RSPD_TXQ0_CR    16
226 #define M_RSPD_TXQ0_CR    0x7F
227 #define V_RSPD_TXQ0_CR(x) ((x) << S_RSPD_TXQ0_CR)
228 #define G_RSPD_TXQ0_CR(x) (((x) >> S_RSPD_TXQ0_CR) & M_RSPD_TXQ0_CR)
229 
230 #define S_RSPD_TXQ0_GTS    23
231 #define V_RSPD_TXQ0_GTS(x) ((x) << S_RSPD_TXQ0_GTS)
232 #define F_RSPD_TXQ0_GTS    V_RSPD_TXQ0_GTS(1U)
233 
234 #define S_RSPD_EOP    24
235 #define V_RSPD_EOP(x) ((x) << S_RSPD_EOP)
236 #define F_RSPD_EOP    V_RSPD_EOP(1U)
237 #define G_RSPD_EOP(x) ((x) & F_RSPD_EOP)
238 
239 #define S_RSPD_SOP    25
240 #define V_RSPD_SOP(x) ((x) << S_RSPD_SOP)
241 #define F_RSPD_SOP    V_RSPD_SOP(1U)
242 #define G_RSPD_SOP(x) ((x) & F_RSPD_SOP)
243 
244 #define G_RSPD_SOP_EOP(x) ((G_RSPD_SOP(x) | G_RSPD_EOP(x)) >> S_RSPD_EOP)
245 
246 #define S_RSPD_ASYNC_NOTIF    26
247 #define V_RSPD_ASYNC_NOTIF(x) ((x) << S_RSPD_ASYNC_NOTIF)
248 #define F_RSPD_ASYNC_NOTIF    V_RSPD_ASYNC_NOTIF(1U)
249 
250 #define S_RSPD_FL0_GTS    27
251 #define V_RSPD_FL0_GTS(x) ((x) << S_RSPD_FL0_GTS)
252 #define F_RSPD_FL0_GTS    V_RSPD_FL0_GTS(1U)
253 
254 #define S_RSPD_FL1_GTS    28
255 #define V_RSPD_FL1_GTS(x) ((x) << S_RSPD_FL1_GTS)
256 #define F_RSPD_FL1_GTS    V_RSPD_FL1_GTS(1U)
257 
258 #define S_RSPD_IMM_DATA_VALID    29
259 #define V_RSPD_IMM_DATA_VALID(x) ((x) << S_RSPD_IMM_DATA_VALID)
260 #define F_RSPD_IMM_DATA_VALID    V_RSPD_IMM_DATA_VALID(1U)
261 
262 #define S_RSPD_OFFLOAD    30
263 #define V_RSPD_OFFLOAD(x) ((x) << S_RSPD_OFFLOAD)
264 #define F_RSPD_OFFLOAD    V_RSPD_OFFLOAD(1U)
265 
266 #define S_RSPD_GEN1    31
267 #define V_RSPD_GEN1(x) ((x) << S_RSPD_GEN1)
268 #define F_RSPD_GEN1    V_RSPD_GEN1(1U)
269 
270 #define S_RSPD_LEN    0
271 #define M_RSPD_LEN    0x7FFFFFFF
272 #define V_RSPD_LEN(x) ((x) << S_RSPD_LEN)
273 #define G_RSPD_LEN(x) (((x) >> S_RSPD_LEN) & M_RSPD_LEN)
274 
275 #define S_RSPD_FLQ    31
276 #define V_RSPD_FLQ(x) ((x) << S_RSPD_FLQ)
277 #define F_RSPD_FLQ    V_RSPD_FLQ(1U)
278 
279 #define S_RSPD_GEN2    0
280 #define V_RSPD_GEN2(x) ((x) << S_RSPD_GEN2)
281 #define F_RSPD_GEN2    V_RSPD_GEN2(1U)
282 
283 #define S_RSPD_INR_VEC    1
284 #define M_RSPD_INR_VEC    0x7F
285 #define V_RSPD_INR_VEC(x) ((x) << S_RSPD_INR_VEC)
286 #define G_RSPD_INR_VEC(x) (((x) >> S_RSPD_INR_VEC) & M_RSPD_INR_VEC)
287 
288 #endif /* _SGE_DEFS_H */
289