xref: /freebsd/sys/dev/cxgbe/firmware/t4fw_interface.h (revision 9a14aa017b21c292740c00ee098195cd46642730)
1 /*-
2  * Copyright (c) 2011 Chelsio Communications, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  *
28  */
29 
30 #ifndef _T4FW_INTERFACE_H_
31 #define _T4FW_INTERFACE_H_
32 
33 /******************************************************************************
34  *   R E T U R N   V A L U E S
35  ********************************/
36 
37 enum fw_retval {
38 	FW_SUCCESS		= 0,	/* completed sucessfully */
39 	FW_EPERM		= 1,	/* operation not permitted */
40 	FW_ENOENT		= 2,	/* no such file or directory */
41 	FW_EIO			= 5,	/* input/output error; hw bad */
42 	FW_ENOEXEC		= 8,	/* exec format error; inv microcode */
43 	FW_EAGAIN		= 11,	/* try again */
44 	FW_ENOMEM		= 12,	/* out of memory */
45 	FW_EFAULT		= 14,	/* bad address; fw bad */
46 	FW_EBUSY		= 16,	/* resource busy */
47 	FW_EEXIST		= 17,	/* file exists */
48 	FW_EINVAL		= 22,	/* invalid argument */
49 	FW_ENOSPC		= 28,	/* no space left on device */
50 	FW_ENOSYS		= 38,	/* functionality not implemented */
51 	FW_EPROTO		= 71,	/* protocol error */
52 	FW_EADDRINUSE		= 98,	/* address already in use */
53 	FW_EADDRNOTAVAIL	= 99,	/* cannot assigned requested address */
54 	FW_ENETDOWN		= 100,	/* network is down */
55 	FW_ENETUNREACH		= 101,	/* network is unreachable */
56 	FW_ENOBUFS		= 105,	/* no buffer space available */
57 	FW_ETIMEDOUT		= 110,	/* timeout */
58 	FW_EINPROGRESS		= 115,	/* fw internal */
59 	FW_SCSI_ABORT_REQUESTED	= 128,	/* */
60 	FW_SCSI_ABORT_TIMEDOUT	= 129,	/* */
61 	FW_SCSI_ABORTED		= 130,	/* */
62 	FW_SCSI_CLOSE_REQUESTED	= 131,	/* */
63 	FW_ERR_LINK_DOWN	= 132,	/* */
64 	FW_RDEV_NOT_READY	= 133,	/* */
65 	FW_ERR_RDEV_LOST	= 134,	/* */
66 	FW_ERR_RDEV_LOGO	= 135,	/* */
67 	FW_FCOE_NO_XCHG		= 136,	/* */
68 	FW_SCSI_RSP_ERR		= 137,	/* */
69 	FW_ERR_RDEV_IMPL_LOGO	= 138,	/* */
70 	FW_SCSI_UNDER_FLOW_ERR  = 139,	/* */
71 	FW_SCSI_OVER_FLOW_ERR   = 140,	/* */
72 	FW_SCSI_DDP_ERR		= 141,	/* DDP error*/
73 	FW_SCSI_TASK_ERR	= 142,	/* No SCSI tasks available */
74 };
75 
76 /******************************************************************************
77  *   W O R K   R E Q U E S T s
78  ********************************/
79 
80 enum fw_wr_opcodes {
81 	FW_FILTER_WR		= 0x02,
82 	FW_ULPTX_WR		= 0x04,
83 	FW_TP_WR		= 0x05,
84 	FW_ETH_TX_PKT_WR	= 0x08,
85 	FW_ETH_TX_PKTS_WR	= 0x09,
86 	FW_EQ_FLUSH_WR		= 0x1b,
87 	FW_FLOWC_WR		= 0x0a,
88 	FW_OFLD_TX_DATA_WR	= 0x0b,
89 	FW_CMD_WR		= 0x10,
90 	FW_ETH_TX_PKT_VM_WR	= 0x11,
91 	FW_RI_RES_WR		= 0x0c,
92 	FW_RI_RDMA_WRITE_WR	= 0x14,
93 	FW_RI_SEND_WR		= 0x15,
94 	FW_RI_RDMA_READ_WR	= 0x16,
95 	FW_RI_RECV_WR		= 0x17,
96 	FW_RI_BIND_MW_WR	= 0x18,
97 	FW_RI_FR_NSMR_WR	= 0x19,
98 	FW_RI_INV_LSTAG_WR	= 0x1a,
99 	FW_RI_WR		= 0x0d,
100 	FW_ISCSI_NODE_WR	= 0x4a,
101 	FW_LASTC2E_WR		= 0x50
102 };
103 
104 /*
105  * Generic work request header flit0
106  */
107 struct fw_wr_hdr {
108 	__be32 hi;
109 	__be32 lo;
110 };
111 
112 /*	work request opcode (hi)
113  */
114 #define S_FW_WR_OP		24
115 #define M_FW_WR_OP		0xff
116 #define V_FW_WR_OP(x)		((x) << S_FW_WR_OP)
117 #define G_FW_WR_OP(x)		(((x) >> S_FW_WR_OP) & M_FW_WR_OP)
118 
119 /*	atomic flag (hi) - firmware encapsulates CPLs in CPL_BARRIER
120  */
121 #define S_FW_WR_ATOMIC		23
122 #define M_FW_WR_ATOMIC		0x1
123 #define V_FW_WR_ATOMIC(x)	((x) << S_FW_WR_ATOMIC)
124 #define G_FW_WR_ATOMIC(x)	\
125     (((x) >> S_FW_WR_ATOMIC) & M_FW_WR_ATOMIC)
126 #define F_FW_WR_ATOMIC		V_FW_WR_ATOMIC(1U)
127 
128 /*	flush flag (hi) - firmware flushes flushable work request buffered
129  *			      in the flow context.
130  */
131 #define S_FW_WR_FLUSH     22
132 #define M_FW_WR_FLUSH     0x1
133 #define V_FW_WR_FLUSH(x)  ((x) << S_FW_WR_FLUSH)
134 #define G_FW_WR_FLUSH(x)  \
135     (((x) >> S_FW_WR_FLUSH) & M_FW_WR_FLUSH)
136 #define F_FW_WR_FLUSH     V_FW_WR_FLUSH(1U)
137 
138 /*	completion flag (hi) - firmware generates a cpl_fw6_ack
139  */
140 #define S_FW_WR_COMPL     21
141 #define M_FW_WR_COMPL     0x1
142 #define V_FW_WR_COMPL(x)  ((x) << S_FW_WR_COMPL)
143 #define G_FW_WR_COMPL(x)  \
144     (((x) >> S_FW_WR_COMPL) & M_FW_WR_COMPL)
145 #define F_FW_WR_COMPL     V_FW_WR_COMPL(1U)
146 
147 
148 /*	work request immediate data lengh (hi)
149  */
150 #define S_FW_WR_IMMDLEN	0
151 #define M_FW_WR_IMMDLEN	0xff
152 #define V_FW_WR_IMMDLEN(x)	((x) << S_FW_WR_IMMDLEN)
153 #define G_FW_WR_IMMDLEN(x)	\
154     (((x) >> S_FW_WR_IMMDLEN) & M_FW_WR_IMMDLEN)
155 
156 /*	egress queue status update to associated ingress queue entry (lo)
157  */
158 #define S_FW_WR_EQUIQ		31
159 #define M_FW_WR_EQUIQ		0x1
160 #define V_FW_WR_EQUIQ(x)	((x) << S_FW_WR_EQUIQ)
161 #define G_FW_WR_EQUIQ(x)	(((x) >> S_FW_WR_EQUIQ) & M_FW_WR_EQUIQ)
162 #define F_FW_WR_EQUIQ		V_FW_WR_EQUIQ(1U)
163 
164 /*	egress queue status update to egress queue status entry (lo)
165  */
166 #define S_FW_WR_EQUEQ		30
167 #define M_FW_WR_EQUEQ		0x1
168 #define V_FW_WR_EQUEQ(x)	((x) << S_FW_WR_EQUEQ)
169 #define G_FW_WR_EQUEQ(x)	(((x) >> S_FW_WR_EQUEQ) & M_FW_WR_EQUEQ)
170 #define F_FW_WR_EQUEQ		V_FW_WR_EQUEQ(1U)
171 
172 /*	flow context identifier (lo)
173  */
174 #define S_FW_WR_FLOWID		8
175 #define M_FW_WR_FLOWID		0xfffff
176 #define V_FW_WR_FLOWID(x)	((x) << S_FW_WR_FLOWID)
177 #define G_FW_WR_FLOWID(x)	(((x) >> S_FW_WR_FLOWID) & M_FW_WR_FLOWID)
178 
179 /*	length in units of 16-bytes (lo)
180  */
181 #define S_FW_WR_LEN16		0
182 #define M_FW_WR_LEN16		0xff
183 #define V_FW_WR_LEN16(x)	((x) << S_FW_WR_LEN16)
184 #define G_FW_WR_LEN16(x)	(((x) >> S_FW_WR_LEN16) & M_FW_WR_LEN16)
185 
186 /* valid filter configurations for compressed tuple
187  * Encodings: TPL - Compressed TUPLE for filter in addition to 4-tuple
188  * FR - FRAGMENT, FC - FCoE, MT - MPS MATCH TYPE, M - MPS MATCH,
189  * E - Ethertype, P - Port, PR - Protocol, T - TOS, IV - Inner VLAN,
190  * OV - Outer VLAN/VNIC_ID,
191 */
192 #define HW_TPL_FR_MT_M_E_P_FC		0x3C3
193 #define HW_TPL_FR_MT_M_PR_T_FC		0x3B3
194 #define HW_TPL_FR_MT_M_IV_P_FC		0x38B
195 #define HW_TPL_FR_MT_M_OV_P_FC		0x387
196 #define HW_TPL_FR_MT_E_PR_T		0x370
197 #define HW_TPL_FR_MT_E_PR_P_FC		0X363
198 #define HW_TPL_FR_MT_E_T_P_FC		0X353
199 #define HW_TPL_FR_MT_PR_IV_P_FC		0X32B
200 #define HW_TPL_FR_MT_PR_OV_P_FC		0X327
201 #define HW_TPL_FR_MT_T_IV_P_FC		0X31B
202 #define HW_TPL_FR_MT_T_OV_P_FC		0X317
203 #define HW_TPL_FR_M_E_PR_FC		0X2E1
204 #define HW_TPL_FR_M_E_T_FC		0X2D1
205 #define HW_TPL_FR_M_PR_IV_FC		0X2A9
206 #define HW_TPL_FR_M_PR_OV_FC		0X2A5
207 #define HW_TPL_FR_M_T_IV_FC		0X299
208 #define HW_TPL_FR_M_T_OV_FC		0X295
209 #define HW_TPL_FR_E_PR_T_P		0X272
210 #define HW_TPL_FR_E_PR_T_FC		0X271
211 #define HW_TPL_FR_E_IV_FC		0X249
212 #define HW_TPL_FR_E_OV_FC		0X245
213 #define HW_TPL_FR_PR_T_IV_FC		0X239
214 #define HW_TPL_FR_PR_T_OV_FC		0X235
215 #define HW_TPL_FR_IV_OV_FC		0X20D
216 #define HW_TPL_MT_M_E_PR		0X1E0
217 #define HW_TPL_MT_M_E_T			0X1D0
218 #define HW_TPL_MT_E_PR_T_FC		0X171
219 #define HW_TPL_MT_E_IV			0X148
220 #define HW_TPL_MT_E_OV			0X144
221 #define HW_TPL_MT_PR_T_IV		0X138
222 #define HW_TPL_MT_PR_T_OV		0X134
223 #define HW_TPL_M_E_PR_P			0X0E2
224 #define HW_TPL_M_E_T_P			0X0D2
225 #define HW_TPL_E_PR_T_P_FC		0X073
226 #define HW_TPL_E_IV_P			0X04A
227 #define HW_TPL_E_OV_P			0X046
228 #define HW_TPL_PR_T_IV_P		0X03A
229 #define HW_TPL_PR_T_OV_P		0X036
230 
231 /* filter wr reply code in cookie in CPL_SET_TCB_RPL */
232 enum fw_filter_wr_cookie {
233 	FW_FILTER_WR_SUCCESS,
234 	FW_FILTER_WR_FLT_ADDED,
235 	FW_FILTER_WR_FLT_DELETED,
236 	FW_FILTER_WR_SMT_TBL_FULL,
237 	FW_FILTER_WR_EINVAL,
238 };
239 
240 struct fw_filter_wr {
241 	__be32 op_pkd;
242 	__be32 len16_pkd;
243 	__be64 r3;
244 	__be32 tid_to_iq;
245 	__be32 del_filter_to_l2tix;
246 	__be16 ethtype;
247 	__be16 ethtypem;
248 	__u8   frag_to_ovlan_vldm;
249 	__u8   smac_sel;
250 	__be16 rx_chan_rx_rpl_iq;
251 	__be32 maci_to_matchtypem;
252 	__u8   ptcl;
253 	__u8   ptclm;
254 	__u8   ttyp;
255 	__u8   ttypm;
256 	__be16 ivlan;
257 	__be16 ivlanm;
258 	__be16 ovlan;
259 	__be16 ovlanm;
260 	__u8   lip[16];
261 	__u8   lipm[16];
262 	__u8   fip[16];
263 	__u8   fipm[16];
264 	__be16 lp;
265 	__be16 lpm;
266 	__be16 fp;
267 	__be16 fpm;
268 	__be16 r7;
269 	__u8   sma[6];
270 };
271 
272 #define S_FW_FILTER_WR_TID	12
273 #define M_FW_FILTER_WR_TID	0xfffff
274 #define V_FW_FILTER_WR_TID(x)	((x) << S_FW_FILTER_WR_TID)
275 #define G_FW_FILTER_WR_TID(x)	\
276     (((x) >> S_FW_FILTER_WR_TID) & M_FW_FILTER_WR_TID)
277 
278 #define S_FW_FILTER_WR_RQTYPE		11
279 #define M_FW_FILTER_WR_RQTYPE		0x1
280 #define V_FW_FILTER_WR_RQTYPE(x)	((x) << S_FW_FILTER_WR_RQTYPE)
281 #define G_FW_FILTER_WR_RQTYPE(x)	\
282     (((x) >> S_FW_FILTER_WR_RQTYPE) & M_FW_FILTER_WR_RQTYPE)
283 #define F_FW_FILTER_WR_RQTYPE	V_FW_FILTER_WR_RQTYPE(1U)
284 
285 #define S_FW_FILTER_WR_NOREPLY		10
286 #define M_FW_FILTER_WR_NOREPLY		0x1
287 #define V_FW_FILTER_WR_NOREPLY(x)	((x) << S_FW_FILTER_WR_NOREPLY)
288 #define G_FW_FILTER_WR_NOREPLY(x)	\
289     (((x) >> S_FW_FILTER_WR_NOREPLY) & M_FW_FILTER_WR_NOREPLY)
290 #define F_FW_FILTER_WR_NOREPLY	V_FW_FILTER_WR_NOREPLY(1U)
291 
292 #define S_FW_FILTER_WR_IQ	0
293 #define M_FW_FILTER_WR_IQ	0x3ff
294 #define V_FW_FILTER_WR_IQ(x)	((x) << S_FW_FILTER_WR_IQ)
295 #define G_FW_FILTER_WR_IQ(x)	\
296     (((x) >> S_FW_FILTER_WR_IQ) & M_FW_FILTER_WR_IQ)
297 
298 #define S_FW_FILTER_WR_DEL_FILTER	31
299 #define M_FW_FILTER_WR_DEL_FILTER	0x1
300 #define V_FW_FILTER_WR_DEL_FILTER(x)	((x) << S_FW_FILTER_WR_DEL_FILTER)
301 #define G_FW_FILTER_WR_DEL_FILTER(x)	\
302     (((x) >> S_FW_FILTER_WR_DEL_FILTER) & M_FW_FILTER_WR_DEL_FILTER)
303 #define F_FW_FILTER_WR_DEL_FILTER	V_FW_FILTER_WR_DEL_FILTER(1U)
304 
305 #define S_FW_FILTER_WR_RPTTID		25
306 #define M_FW_FILTER_WR_RPTTID		0x1
307 #define V_FW_FILTER_WR_RPTTID(x)	((x) << S_FW_FILTER_WR_RPTTID)
308 #define G_FW_FILTER_WR_RPTTID(x)	\
309     (((x) >> S_FW_FILTER_WR_RPTTID) & M_FW_FILTER_WR_RPTTID)
310 #define F_FW_FILTER_WR_RPTTID	V_FW_FILTER_WR_RPTTID(1U)
311 
312 #define S_FW_FILTER_WR_DROP	24
313 #define M_FW_FILTER_WR_DROP	0x1
314 #define V_FW_FILTER_WR_DROP(x)	((x) << S_FW_FILTER_WR_DROP)
315 #define G_FW_FILTER_WR_DROP(x)	\
316     (((x) >> S_FW_FILTER_WR_DROP) & M_FW_FILTER_WR_DROP)
317 #define F_FW_FILTER_WR_DROP	V_FW_FILTER_WR_DROP(1U)
318 
319 #define S_FW_FILTER_WR_DIRSTEER		23
320 #define M_FW_FILTER_WR_DIRSTEER		0x1
321 #define V_FW_FILTER_WR_DIRSTEER(x)	((x) << S_FW_FILTER_WR_DIRSTEER)
322 #define G_FW_FILTER_WR_DIRSTEER(x)	\
323     (((x) >> S_FW_FILTER_WR_DIRSTEER) & M_FW_FILTER_WR_DIRSTEER)
324 #define F_FW_FILTER_WR_DIRSTEER	V_FW_FILTER_WR_DIRSTEER(1U)
325 
326 #define S_FW_FILTER_WR_MASKHASH		22
327 #define M_FW_FILTER_WR_MASKHASH		0x1
328 #define V_FW_FILTER_WR_MASKHASH(x)	((x) << S_FW_FILTER_WR_MASKHASH)
329 #define G_FW_FILTER_WR_MASKHASH(x)	\
330     (((x) >> S_FW_FILTER_WR_MASKHASH) & M_FW_FILTER_WR_MASKHASH)
331 #define F_FW_FILTER_WR_MASKHASH	V_FW_FILTER_WR_MASKHASH(1U)
332 
333 #define S_FW_FILTER_WR_DIRSTEERHASH	21
334 #define M_FW_FILTER_WR_DIRSTEERHASH	0x1
335 #define V_FW_FILTER_WR_DIRSTEERHASH(x)	((x) << S_FW_FILTER_WR_DIRSTEERHASH)
336 #define G_FW_FILTER_WR_DIRSTEERHASH(x)	\
337     (((x) >> S_FW_FILTER_WR_DIRSTEERHASH) & M_FW_FILTER_WR_DIRSTEERHASH)
338 #define F_FW_FILTER_WR_DIRSTEERHASH	V_FW_FILTER_WR_DIRSTEERHASH(1U)
339 
340 #define S_FW_FILTER_WR_LPBK	20
341 #define M_FW_FILTER_WR_LPBK	0x1
342 #define V_FW_FILTER_WR_LPBK(x)	((x) << S_FW_FILTER_WR_LPBK)
343 #define G_FW_FILTER_WR_LPBK(x)	\
344     (((x) >> S_FW_FILTER_WR_LPBK) & M_FW_FILTER_WR_LPBK)
345 #define F_FW_FILTER_WR_LPBK	V_FW_FILTER_WR_LPBK(1U)
346 
347 #define S_FW_FILTER_WR_DMAC	19
348 #define M_FW_FILTER_WR_DMAC	0x1
349 #define V_FW_FILTER_WR_DMAC(x)	((x) << S_FW_FILTER_WR_DMAC)
350 #define G_FW_FILTER_WR_DMAC(x)	\
351     (((x) >> S_FW_FILTER_WR_DMAC) & M_FW_FILTER_WR_DMAC)
352 #define F_FW_FILTER_WR_DMAC	V_FW_FILTER_WR_DMAC(1U)
353 
354 #define S_FW_FILTER_WR_SMAC	18
355 #define M_FW_FILTER_WR_SMAC	0x1
356 #define V_FW_FILTER_WR_SMAC(x)	((x) << S_FW_FILTER_WR_SMAC)
357 #define G_FW_FILTER_WR_SMAC(x)	\
358     (((x) >> S_FW_FILTER_WR_SMAC) & M_FW_FILTER_WR_SMAC)
359 #define F_FW_FILTER_WR_SMAC	V_FW_FILTER_WR_SMAC(1U)
360 
361 #define S_FW_FILTER_WR_INSVLAN		17
362 #define M_FW_FILTER_WR_INSVLAN		0x1
363 #define V_FW_FILTER_WR_INSVLAN(x)	((x) << S_FW_FILTER_WR_INSVLAN)
364 #define G_FW_FILTER_WR_INSVLAN(x)	\
365     (((x) >> S_FW_FILTER_WR_INSVLAN) & M_FW_FILTER_WR_INSVLAN)
366 #define F_FW_FILTER_WR_INSVLAN	V_FW_FILTER_WR_INSVLAN(1U)
367 
368 #define S_FW_FILTER_WR_RMVLAN		16
369 #define M_FW_FILTER_WR_RMVLAN		0x1
370 #define V_FW_FILTER_WR_RMVLAN(x)	((x) << S_FW_FILTER_WR_RMVLAN)
371 #define G_FW_FILTER_WR_RMVLAN(x)	\
372     (((x) >> S_FW_FILTER_WR_RMVLAN) & M_FW_FILTER_WR_RMVLAN)
373 #define F_FW_FILTER_WR_RMVLAN	V_FW_FILTER_WR_RMVLAN(1U)
374 
375 #define S_FW_FILTER_WR_HITCNTS		15
376 #define M_FW_FILTER_WR_HITCNTS		0x1
377 #define V_FW_FILTER_WR_HITCNTS(x)	((x) << S_FW_FILTER_WR_HITCNTS)
378 #define G_FW_FILTER_WR_HITCNTS(x)	\
379     (((x) >> S_FW_FILTER_WR_HITCNTS) & M_FW_FILTER_WR_HITCNTS)
380 #define F_FW_FILTER_WR_HITCNTS	V_FW_FILTER_WR_HITCNTS(1U)
381 
382 #define S_FW_FILTER_WR_TXCHAN		13
383 #define M_FW_FILTER_WR_TXCHAN		0x3
384 #define V_FW_FILTER_WR_TXCHAN(x)	((x) << S_FW_FILTER_WR_TXCHAN)
385 #define G_FW_FILTER_WR_TXCHAN(x)	\
386     (((x) >> S_FW_FILTER_WR_TXCHAN) & M_FW_FILTER_WR_TXCHAN)
387 
388 #define S_FW_FILTER_WR_PRIO	12
389 #define M_FW_FILTER_WR_PRIO	0x1
390 #define V_FW_FILTER_WR_PRIO(x)	((x) << S_FW_FILTER_WR_PRIO)
391 #define G_FW_FILTER_WR_PRIO(x)	\
392     (((x) >> S_FW_FILTER_WR_PRIO) & M_FW_FILTER_WR_PRIO)
393 #define F_FW_FILTER_WR_PRIO	V_FW_FILTER_WR_PRIO(1U)
394 
395 #define S_FW_FILTER_WR_L2TIX	0
396 #define M_FW_FILTER_WR_L2TIX	0xfff
397 #define V_FW_FILTER_WR_L2TIX(x)	((x) << S_FW_FILTER_WR_L2TIX)
398 #define G_FW_FILTER_WR_L2TIX(x)	\
399     (((x) >> S_FW_FILTER_WR_L2TIX) & M_FW_FILTER_WR_L2TIX)
400 
401 #define S_FW_FILTER_WR_FRAG	7
402 #define M_FW_FILTER_WR_FRAG	0x1
403 #define V_FW_FILTER_WR_FRAG(x)	((x) << S_FW_FILTER_WR_FRAG)
404 #define G_FW_FILTER_WR_FRAG(x)	\
405     (((x) >> S_FW_FILTER_WR_FRAG) & M_FW_FILTER_WR_FRAG)
406 #define F_FW_FILTER_WR_FRAG	V_FW_FILTER_WR_FRAG(1U)
407 
408 #define S_FW_FILTER_WR_FRAGM	6
409 #define M_FW_FILTER_WR_FRAGM	0x1
410 #define V_FW_FILTER_WR_FRAGM(x)	((x) << S_FW_FILTER_WR_FRAGM)
411 #define G_FW_FILTER_WR_FRAGM(x)	\
412     (((x) >> S_FW_FILTER_WR_FRAGM) & M_FW_FILTER_WR_FRAGM)
413 #define F_FW_FILTER_WR_FRAGM	V_FW_FILTER_WR_FRAGM(1U)
414 
415 #define S_FW_FILTER_WR_IVLAN_VLD	5
416 #define M_FW_FILTER_WR_IVLAN_VLD	0x1
417 #define V_FW_FILTER_WR_IVLAN_VLD(x)	((x) << S_FW_FILTER_WR_IVLAN_VLD)
418 #define G_FW_FILTER_WR_IVLAN_VLD(x)	\
419     (((x) >> S_FW_FILTER_WR_IVLAN_VLD) & M_FW_FILTER_WR_IVLAN_VLD)
420 #define F_FW_FILTER_WR_IVLAN_VLD	V_FW_FILTER_WR_IVLAN_VLD(1U)
421 
422 #define S_FW_FILTER_WR_OVLAN_VLD	4
423 #define M_FW_FILTER_WR_OVLAN_VLD	0x1
424 #define V_FW_FILTER_WR_OVLAN_VLD(x)	((x) << S_FW_FILTER_WR_OVLAN_VLD)
425 #define G_FW_FILTER_WR_OVLAN_VLD(x)	\
426     (((x) >> S_FW_FILTER_WR_OVLAN_VLD) & M_FW_FILTER_WR_OVLAN_VLD)
427 #define F_FW_FILTER_WR_OVLAN_VLD	V_FW_FILTER_WR_OVLAN_VLD(1U)
428 
429 #define S_FW_FILTER_WR_IVLAN_VLDM	3
430 #define M_FW_FILTER_WR_IVLAN_VLDM	0x1
431 #define V_FW_FILTER_WR_IVLAN_VLDM(x)	((x) << S_FW_FILTER_WR_IVLAN_VLDM)
432 #define G_FW_FILTER_WR_IVLAN_VLDM(x)	\
433     (((x) >> S_FW_FILTER_WR_IVLAN_VLDM) & M_FW_FILTER_WR_IVLAN_VLDM)
434 #define F_FW_FILTER_WR_IVLAN_VLDM	V_FW_FILTER_WR_IVLAN_VLDM(1U)
435 
436 #define S_FW_FILTER_WR_OVLAN_VLDM	2
437 #define M_FW_FILTER_WR_OVLAN_VLDM	0x1
438 #define V_FW_FILTER_WR_OVLAN_VLDM(x)	((x) << S_FW_FILTER_WR_OVLAN_VLDM)
439 #define G_FW_FILTER_WR_OVLAN_VLDM(x)	\
440     (((x) >> S_FW_FILTER_WR_OVLAN_VLDM) & M_FW_FILTER_WR_OVLAN_VLDM)
441 #define F_FW_FILTER_WR_OVLAN_VLDM	V_FW_FILTER_WR_OVLAN_VLDM(1U)
442 
443 #define S_FW_FILTER_WR_RX_CHAN		15
444 #define M_FW_FILTER_WR_RX_CHAN		0x1
445 #define V_FW_FILTER_WR_RX_CHAN(x)	((x) << S_FW_FILTER_WR_RX_CHAN)
446 #define G_FW_FILTER_WR_RX_CHAN(x)	\
447     (((x) >> S_FW_FILTER_WR_RX_CHAN) & M_FW_FILTER_WR_RX_CHAN)
448 #define F_FW_FILTER_WR_RX_CHAN	V_FW_FILTER_WR_RX_CHAN(1U)
449 
450 #define S_FW_FILTER_WR_RX_RPL_IQ	0
451 #define M_FW_FILTER_WR_RX_RPL_IQ	0x3ff
452 #define V_FW_FILTER_WR_RX_RPL_IQ(x)	((x) << S_FW_FILTER_WR_RX_RPL_IQ)
453 #define G_FW_FILTER_WR_RX_RPL_IQ(x)	\
454     (((x) >> S_FW_FILTER_WR_RX_RPL_IQ) & M_FW_FILTER_WR_RX_RPL_IQ)
455 
456 #define S_FW_FILTER_WR_MACI	23
457 #define M_FW_FILTER_WR_MACI	0x1ff
458 #define V_FW_FILTER_WR_MACI(x)	((x) << S_FW_FILTER_WR_MACI)
459 #define G_FW_FILTER_WR_MACI(x)	\
460     (((x) >> S_FW_FILTER_WR_MACI) & M_FW_FILTER_WR_MACI)
461 
462 #define S_FW_FILTER_WR_MACIM	14
463 #define M_FW_FILTER_WR_MACIM	0x1ff
464 #define V_FW_FILTER_WR_MACIM(x)	((x) << S_FW_FILTER_WR_MACIM)
465 #define G_FW_FILTER_WR_MACIM(x)	\
466     (((x) >> S_FW_FILTER_WR_MACIM) & M_FW_FILTER_WR_MACIM)
467 
468 #define S_FW_FILTER_WR_FCOE	13
469 #define M_FW_FILTER_WR_FCOE	0x1
470 #define V_FW_FILTER_WR_FCOE(x)	((x) << S_FW_FILTER_WR_FCOE)
471 #define G_FW_FILTER_WR_FCOE(x)	\
472     (((x) >> S_FW_FILTER_WR_FCOE) & M_FW_FILTER_WR_FCOE)
473 #define F_FW_FILTER_WR_FCOE	V_FW_FILTER_WR_FCOE(1U)
474 
475 #define S_FW_FILTER_WR_FCOEM	12
476 #define M_FW_FILTER_WR_FCOEM	0x1
477 #define V_FW_FILTER_WR_FCOEM(x)	((x) << S_FW_FILTER_WR_FCOEM)
478 #define G_FW_FILTER_WR_FCOEM(x)	\
479     (((x) >> S_FW_FILTER_WR_FCOEM) & M_FW_FILTER_WR_FCOEM)
480 #define F_FW_FILTER_WR_FCOEM	V_FW_FILTER_WR_FCOEM(1U)
481 
482 #define S_FW_FILTER_WR_PORT	9
483 #define M_FW_FILTER_WR_PORT	0x7
484 #define V_FW_FILTER_WR_PORT(x)	((x) << S_FW_FILTER_WR_PORT)
485 #define G_FW_FILTER_WR_PORT(x)	\
486     (((x) >> S_FW_FILTER_WR_PORT) & M_FW_FILTER_WR_PORT)
487 
488 #define S_FW_FILTER_WR_PORTM	6
489 #define M_FW_FILTER_WR_PORTM	0x7
490 #define V_FW_FILTER_WR_PORTM(x)	((x) << S_FW_FILTER_WR_PORTM)
491 #define G_FW_FILTER_WR_PORTM(x)	\
492     (((x) >> S_FW_FILTER_WR_PORTM) & M_FW_FILTER_WR_PORTM)
493 
494 #define S_FW_FILTER_WR_MATCHTYPE	3
495 #define M_FW_FILTER_WR_MATCHTYPE	0x7
496 #define V_FW_FILTER_WR_MATCHTYPE(x)	((x) << S_FW_FILTER_WR_MATCHTYPE)
497 #define G_FW_FILTER_WR_MATCHTYPE(x)	\
498     (((x) >> S_FW_FILTER_WR_MATCHTYPE) & M_FW_FILTER_WR_MATCHTYPE)
499 
500 #define S_FW_FILTER_WR_MATCHTYPEM	0
501 #define M_FW_FILTER_WR_MATCHTYPEM	0x7
502 #define V_FW_FILTER_WR_MATCHTYPEM(x)	((x) << S_FW_FILTER_WR_MATCHTYPEM)
503 #define G_FW_FILTER_WR_MATCHTYPEM(x)	\
504     (((x) >> S_FW_FILTER_WR_MATCHTYPEM) & M_FW_FILTER_WR_MATCHTYPEM)
505 
506 struct fw_ulptx_wr {
507 	__be32 op_to_compl;
508 	__be32 flowid_len16;
509 	__u64  cookie;
510 };
511 
512 struct fw_tp_wr {
513 	__be32 op_to_immdlen;
514 	__be32 flowid_len16;
515 	__u64  cookie;
516 };
517 
518 struct fw_eth_tx_pkt_wr {
519 	__be32 op_immdlen;
520 	__be32 equiq_to_len16;
521 	__be64 r3;
522 };
523 
524 #define S_FW_ETH_TX_PKT_WR_IMMDLEN	0
525 #define M_FW_ETH_TX_PKT_WR_IMMDLEN	0x1ff
526 #define V_FW_ETH_TX_PKT_WR_IMMDLEN(x)	((x) << S_FW_ETH_TX_PKT_WR_IMMDLEN)
527 #define G_FW_ETH_TX_PKT_WR_IMMDLEN(x)	\
528     (((x) >> S_FW_ETH_TX_PKT_WR_IMMDLEN) & M_FW_ETH_TX_PKT_WR_IMMDLEN)
529 
530 struct fw_eth_tx_pkts_wr {
531 	__be32 op_pkd;
532 	__be32 equiq_to_len16;
533 	__be32 r3;
534 	__be16 plen;
535 	__u8   npkt;
536 	__u8   type;
537 };
538 
539 struct fw_eq_flush_wr {
540 	__u8   opcode;
541 	__u8   r1[3];
542 	__be32 equiq_to_len16;
543 	__be64 r3;
544 };
545 
546 enum fw_flowc_mnem {
547 	FW_FLOWC_MNEM_PFNVFN,		/* PFN [15:8] VFN [7:0] */
548 	FW_FLOWC_MNEM_CH,
549 	FW_FLOWC_MNEM_PORT,
550 	FW_FLOWC_MNEM_IQID,
551 	FW_FLOWC_MNEM_SNDNXT,
552 	FW_FLOWC_MNEM_RCVNXT,
553 	FW_FLOWC_MNEM_SNDBUF,
554 	FW_FLOWC_MNEM_MSS,
555 	FW_FLOWC_MNEM_TXDATAPLEN_MAX,
556 };
557 
558 struct fw_flowc_mnemval {
559 	__u8   mnemonic;
560 	__u8   r4[3];
561 	__be32 val;
562 };
563 
564 struct fw_flowc_wr {
565 	__be32 op_to_nparams;
566 	__be32 flowid_len16;
567 #ifndef C99_NOT_SUPPORTED
568 	struct fw_flowc_mnemval mnemval[0];
569 #endif
570 };
571 
572 #define S_FW_FLOWC_WR_NPARAMS		0
573 #define M_FW_FLOWC_WR_NPARAMS		0xff
574 #define V_FW_FLOWC_WR_NPARAMS(x)	((x) << S_FW_FLOWC_WR_NPARAMS)
575 #define G_FW_FLOWC_WR_NPARAMS(x)	\
576     (((x) >> S_FW_FLOWC_WR_NPARAMS) & M_FW_FLOWC_WR_NPARAMS)
577 
578 struct fw_ofld_tx_data_wr {
579 	__be32 op_to_immdlen;
580 	__be32 flowid_len16;
581 	__be32 plen;
582 	__be32 tunnel_to_proxy;
583 };
584 
585 #define S_FW_OFLD_TX_DATA_WR_TUNNEL	19
586 #define M_FW_OFLD_TX_DATA_WR_TUNNEL	0x1
587 #define V_FW_OFLD_TX_DATA_WR_TUNNEL(x)	((x) << S_FW_OFLD_TX_DATA_WR_TUNNEL)
588 #define G_FW_OFLD_TX_DATA_WR_TUNNEL(x)	\
589     (((x) >> S_FW_OFLD_TX_DATA_WR_TUNNEL) & M_FW_OFLD_TX_DATA_WR_TUNNEL)
590 #define F_FW_OFLD_TX_DATA_WR_TUNNEL	V_FW_OFLD_TX_DATA_WR_TUNNEL(1U)
591 
592 #define S_FW_OFLD_TX_DATA_WR_SAVE	18
593 #define M_FW_OFLD_TX_DATA_WR_SAVE	0x1
594 #define V_FW_OFLD_TX_DATA_WR_SAVE(x)	((x) << S_FW_OFLD_TX_DATA_WR_SAVE)
595 #define G_FW_OFLD_TX_DATA_WR_SAVE(x)	\
596     (((x) >> S_FW_OFLD_TX_DATA_WR_SAVE) & M_FW_OFLD_TX_DATA_WR_SAVE)
597 #define F_FW_OFLD_TX_DATA_WR_SAVE	V_FW_OFLD_TX_DATA_WR_SAVE(1U)
598 
599 #define S_FW_OFLD_TX_DATA_WR_FLUSH	17
600 #define M_FW_OFLD_TX_DATA_WR_FLUSH	0x1
601 #define V_FW_OFLD_TX_DATA_WR_FLUSH(x)	((x) << S_FW_OFLD_TX_DATA_WR_FLUSH)
602 #define G_FW_OFLD_TX_DATA_WR_FLUSH(x)	\
603     (((x) >> S_FW_OFLD_TX_DATA_WR_FLUSH) & M_FW_OFLD_TX_DATA_WR_FLUSH)
604 #define F_FW_OFLD_TX_DATA_WR_FLUSH	V_FW_OFLD_TX_DATA_WR_FLUSH(1U)
605 
606 #define S_FW_OFLD_TX_DATA_WR_URGENT	16
607 #define M_FW_OFLD_TX_DATA_WR_URGENT	0x1
608 #define V_FW_OFLD_TX_DATA_WR_URGENT(x)	((x) << S_FW_OFLD_TX_DATA_WR_URGENT)
609 #define G_FW_OFLD_TX_DATA_WR_URGENT(x)	\
610     (((x) >> S_FW_OFLD_TX_DATA_WR_URGENT) & M_FW_OFLD_TX_DATA_WR_URGENT)
611 #define F_FW_OFLD_TX_DATA_WR_URGENT	V_FW_OFLD_TX_DATA_WR_URGENT(1U)
612 
613 #define S_FW_OFLD_TX_DATA_WR_MORE	15
614 #define M_FW_OFLD_TX_DATA_WR_MORE	0x1
615 #define V_FW_OFLD_TX_DATA_WR_MORE(x)	((x) << S_FW_OFLD_TX_DATA_WR_MORE)
616 #define G_FW_OFLD_TX_DATA_WR_MORE(x)	\
617     (((x) >> S_FW_OFLD_TX_DATA_WR_MORE) & M_FW_OFLD_TX_DATA_WR_MORE)
618 #define F_FW_OFLD_TX_DATA_WR_MORE	V_FW_OFLD_TX_DATA_WR_MORE(1U)
619 
620 #define S_FW_OFLD_TX_DATA_WR_SHOVE	14
621 #define M_FW_OFLD_TX_DATA_WR_SHOVE	0x1
622 #define V_FW_OFLD_TX_DATA_WR_SHOVE(x)	((x) << S_FW_OFLD_TX_DATA_WR_SHOVE)
623 #define G_FW_OFLD_TX_DATA_WR_SHOVE(x)	\
624     (((x) >> S_FW_OFLD_TX_DATA_WR_SHOVE) & M_FW_OFLD_TX_DATA_WR_SHOVE)
625 #define F_FW_OFLD_TX_DATA_WR_SHOVE	V_FW_OFLD_TX_DATA_WR_SHOVE(1U)
626 
627 #define S_FW_OFLD_TX_DATA_WR_ULPMODE	10
628 #define M_FW_OFLD_TX_DATA_WR_ULPMODE	0xf
629 #define V_FW_OFLD_TX_DATA_WR_ULPMODE(x)	((x) << S_FW_OFLD_TX_DATA_WR_ULPMODE)
630 #define G_FW_OFLD_TX_DATA_WR_ULPMODE(x)	\
631     (((x) >> S_FW_OFLD_TX_DATA_WR_ULPMODE) & M_FW_OFLD_TX_DATA_WR_ULPMODE)
632 
633 #define S_FW_OFLD_TX_DATA_WR_ULPSUBMODE		6
634 #define M_FW_OFLD_TX_DATA_WR_ULPSUBMODE		0xf
635 #define V_FW_OFLD_TX_DATA_WR_ULPSUBMODE(x)	\
636     ((x) << S_FW_OFLD_TX_DATA_WR_ULPSUBMODE)
637 #define G_FW_OFLD_TX_DATA_WR_ULPSUBMODE(x)	\
638     (((x) >> S_FW_OFLD_TX_DATA_WR_ULPSUBMODE) & \
639      M_FW_OFLD_TX_DATA_WR_ULPSUBMODE)
640 
641 #define S_FW_OFLD_TX_DATA_WR_PROXY	5
642 #define M_FW_OFLD_TX_DATA_WR_PROXY	0x1
643 #define V_FW_OFLD_TX_DATA_WR_PROXY(x)	((x) << S_FW_OFLD_TX_DATA_WR_PROXY)
644 #define G_FW_OFLD_TX_DATA_WR_PROXY(x)	\
645     (((x) >> S_FW_OFLD_TX_DATA_WR_PROXY) & M_FW_OFLD_TX_DATA_WR_PROXY)
646 #define F_FW_OFLD_TX_DATA_WR_PROXY	V_FW_OFLD_TX_DATA_WR_PROXY(1U)
647 
648 struct fw_cmd_wr {
649 	__be32 op_dma;
650 	__be32 len16_pkd;
651 	__be64 cookie_daddr;
652 };
653 
654 #define S_FW_CMD_WR_DMA		17
655 #define M_FW_CMD_WR_DMA		0x1
656 #define V_FW_CMD_WR_DMA(x)	((x) << S_FW_CMD_WR_DMA)
657 #define G_FW_CMD_WR_DMA(x)	(((x) >> S_FW_CMD_WR_DMA) & M_FW_CMD_WR_DMA)
658 #define F_FW_CMD_WR_DMA	V_FW_CMD_WR_DMA(1U)
659 
660 struct fw_eth_tx_pkt_vm_wr {
661 	__be32 op_immdlen;
662 	__be32 equiq_to_len16;
663 	__be32 r3[2];
664 	__u8   ethmacdst[6];
665 	__u8   ethmacsrc[6];
666 	__be16 ethtype;
667 	__be16 vlantci;
668 };
669 
670 /******************************************************************************
671  *   R I   W O R K   R E Q U E S T s
672  **************************************/
673 
674 enum fw_ri_wr_opcode {
675 	FW_RI_RDMA_WRITE		= 0x0,               /* IETF RDMAP v1.0 ... */
676 	FW_RI_READ_REQ			= 0x1,
677 	FW_RI_READ_RESP			= 0x2,
678 	FW_RI_SEND			= 0x3,
679 	FW_RI_SEND_WITH_INV		= 0x4,
680 	FW_RI_SEND_WITH_SE		= 0x5,
681 	FW_RI_SEND_WITH_SE_INV		= 0x6,
682 	FW_RI_TERMINATE			= 0x7,
683 	FW_RI_RDMA_INIT			= 0x8,                /* CHELSIO RI specific ... */
684 	FW_RI_BIND_MW			= 0x9,
685 	FW_RI_FAST_REGISTER		= 0xa,
686 	FW_RI_LOCAL_INV			= 0xb,
687 	FW_RI_QP_MODIFY			= 0xc,
688 	FW_RI_BYPASS			= 0xd,
689 	FW_RI_RECEIVE			= 0xe,
690 
691 	FW_RI_SGE_EC_CR_RETURN		= 0xf
692 };
693 
694 enum fw_ri_wr_flags {
695 	FW_RI_COMPLETION_FLAG		= 0x01,
696 	FW_RI_NOTIFICATION_FLAG		= 0x02,
697 	FW_RI_SOLICITED_EVENT_FLAG	= 0x04,
698 	FW_RI_READ_FENCE_FLAG		= 0x08,
699 	FW_RI_LOCAL_FENCE_FLAG		= 0x10,
700 	FW_RI_RDMA_READ_INVALIDATE	= 0x20
701 };
702 
703 enum fw_ri_mpa_attrs {
704 	FW_RI_MPA_RX_MARKER_ENABLE	= 0x01,
705 	FW_RI_MPA_TX_MARKER_ENABLE	= 0x02,
706 	FW_RI_MPA_CRC_ENABLE		= 0x04,
707 	FW_RI_MPA_IETF_ENABLE		= 0x08
708 };
709 
710 enum fw_ri_qp_caps {
711 	FW_RI_QP_RDMA_READ_ENABLE	= 0x01,
712 	FW_RI_QP_RDMA_WRITE_ENABLE	= 0x02,
713 	FW_RI_QP_BIND_ENABLE		= 0x04,
714 	FW_RI_QP_FAST_REGISTER_ENABLE	= 0x08,
715 	FW_RI_QP_STAG0_ENABLE		= 0x10,
716 	FW_RI_QP_RDMA_READ_REQ_0B_ENABLE= 0x80,
717 };
718 
719 enum fw_ri_addr_type {
720 	FW_RI_ZERO_BASED_TO		= 0x00,
721 	FW_RI_VA_BASED_TO		= 0x01
722 };
723 
724 enum fw_ri_mem_perms {
725 	FW_RI_MEM_ACCESS_REM_WRITE	= 0x01,
726 	FW_RI_MEM_ACCESS_REM_READ	= 0x02,
727 	FW_RI_MEM_ACCESS_REM		= 0x03,
728 	FW_RI_MEM_ACCESS_LOCAL_WRITE	= 0x04,
729 	FW_RI_MEM_ACCESS_LOCAL_READ	= 0x08,
730 	FW_RI_MEM_ACCESS_LOCAL		= 0x0C
731 };
732 
733 enum fw_ri_stag_type {
734 	FW_RI_STAG_NSMR			= 0x00,
735 	FW_RI_STAG_SMR			= 0x01,
736 	FW_RI_STAG_MW			= 0x02,
737 	FW_RI_STAG_MW_RELAXED		= 0x03
738 };
739 
740 enum fw_ri_data_op {
741 	FW_RI_DATA_IMMD			= 0x81,
742 	FW_RI_DATA_DSGL			= 0x82,
743 	FW_RI_DATA_ISGL			= 0x83
744 };
745 
746 enum fw_ri_sgl_depth {
747 	FW_RI_SGL_DEPTH_MAX_SQ		= 16,
748 	FW_RI_SGL_DEPTH_MAX_RQ		= 4
749 };
750 
751 enum fw_ri_cqe_err {
752 	FW_RI_CQE_ERR_SUCCESS		= 0x00,	/* success, no error detected */
753 	FW_RI_CQE_ERR_STAG		= 0x01, /* STAG invalid */
754 	FW_RI_CQE_ERR_PDID		= 0x02, /* PDID mismatch */
755 	FW_RI_CQE_ERR_QPID		= 0x03, /* QPID mismatch */
756 	FW_RI_CQE_ERR_ACCESS		= 0x04, /* Invalid access right */
757 	FW_RI_CQE_ERR_WRAP		= 0x05, /* Wrap error */
758 	FW_RI_CQE_ERR_BOUND		= 0x06, /* base and bounds violation */
759 	FW_RI_CQE_ERR_INVALIDATE_SHARED_MR = 0x07, /* attempt to invalidate a SMR */
760 	FW_RI_CQE_ERR_INVALIDATE_MR_WITH_MW_BOUND = 0x08, /* attempt to invalidate a MR w MW */
761 	FW_RI_CQE_ERR_ECC		= 0x09,	/* ECC error detected */
762 	FW_RI_CQE_ERR_ECC_PSTAG		= 0x0A, /* ECC error detected when reading the PSTAG for a MW Invalidate */
763 	FW_RI_CQE_ERR_PBL_ADDR_BOUND	= 0x0B, /* pbl address out of bound : software error */
764 	FW_RI_CQE_ERR_CRC		= 0x10,	/* CRC error */
765 	FW_RI_CQE_ERR_MARKER		= 0x11,	/* Marker error */
766 	FW_RI_CQE_ERR_PDU_LEN_ERR	= 0x12,	/* invalid PDU length */
767 	FW_RI_CQE_ERR_OUT_OF_RQE	= 0x13,	/* out of RQE */
768 	FW_RI_CQE_ERR_DDP_VERSION	= 0x14,	/* wrong DDP version */
769 	FW_RI_CQE_ERR_RDMA_VERSION	= 0x15,	/* wrong RDMA version */
770 	FW_RI_CQE_ERR_OPCODE		= 0x16,	/* invalid rdma opcode */
771 	FW_RI_CQE_ERR_DDP_QUEUE_NUM	= 0x17,	/* invalid ddp queue number */
772 	FW_RI_CQE_ERR_MSN		= 0x18, /* MSN error */
773 	FW_RI_CQE_ERR_TBIT		= 0x19, /* tag bit not set correctly */
774 	FW_RI_CQE_ERR_MO		= 0x1A, /* MO not zero for TERMINATE or READ_REQ */
775 	FW_RI_CQE_ERR_MSN_GAP		= 0x1B, /* */
776 	FW_RI_CQE_ERR_MSN_RANGE		= 0x1C, /* */
777 	FW_RI_CQE_ERR_IRD_OVERFLOW	= 0x1D, /* */
778 	FW_RI_CQE_ERR_RQE_ADDR_BOUND	= 0x1E, /*  RQE address out of bound : software error */
779 	FW_RI_CQE_ERR_INTERNAL_ERR	= 0x1F  /* internel error (opcode mismatch) */
780 
781 };
782 
783 struct fw_ri_dsge_pair {
784 	__be32	len[2];
785 	__be64	addr[2];
786 };
787 
788 struct fw_ri_dsgl {
789 	__u8	op;
790 	__u8	r1;
791 	__be16	nsge;
792 	__be32	len0;
793 	__be64	addr0;
794 #ifndef C99_NOT_SUPPORTED
795 	struct fw_ri_dsge_pair sge[0];
796 #endif
797 };
798 
799 struct fw_ri_sge {
800 	__be32 stag;
801 	__be32 len;
802 	__be64 to;
803 };
804 
805 struct fw_ri_isgl {
806 	__u8	op;
807 	__u8	r1;
808 	__be16	nsge;
809 	__be32	r2;
810 #ifndef C99_NOT_SUPPORTED
811 	struct fw_ri_sge sge[0];
812 #endif
813 };
814 
815 struct fw_ri_immd {
816 	__u8	op;
817 	__u8	r1;
818 	__be16	r2;
819 	__be32	immdlen;
820 #ifndef C99_NOT_SUPPORTED
821 	__u8	data[0];
822 #endif
823 };
824 
825 struct fw_ri_tpte {
826 	__be32 valid_to_pdid;
827 	__be32 locread_to_qpid;
828 	__be32 nosnoop_pbladdr;
829 	__be32 len_lo;
830 	__be32 va_hi;
831 	__be32 va_lo_fbo;
832 	__be32 dca_mwbcnt_pstag;
833 	__be32 len_hi;
834 };
835 
836 #define S_FW_RI_TPTE_VALID		31
837 #define M_FW_RI_TPTE_VALID		0x1
838 #define V_FW_RI_TPTE_VALID(x)		((x) << S_FW_RI_TPTE_VALID)
839 #define G_FW_RI_TPTE_VALID(x)		\
840     (((x) >> S_FW_RI_TPTE_VALID) & M_FW_RI_TPTE_VALID)
841 #define F_FW_RI_TPTE_VALID		V_FW_RI_TPTE_VALID(1U)
842 
843 #define S_FW_RI_TPTE_STAGKEY		23
844 #define M_FW_RI_TPTE_STAGKEY		0xff
845 #define V_FW_RI_TPTE_STAGKEY(x)		((x) << S_FW_RI_TPTE_STAGKEY)
846 #define G_FW_RI_TPTE_STAGKEY(x)		\
847     (((x) >> S_FW_RI_TPTE_STAGKEY) & M_FW_RI_TPTE_STAGKEY)
848 
849 #define S_FW_RI_TPTE_STAGSTATE		22
850 #define M_FW_RI_TPTE_STAGSTATE		0x1
851 #define V_FW_RI_TPTE_STAGSTATE(x)	((x) << S_FW_RI_TPTE_STAGSTATE)
852 #define G_FW_RI_TPTE_STAGSTATE(x)	\
853     (((x) >> S_FW_RI_TPTE_STAGSTATE) & M_FW_RI_TPTE_STAGSTATE)
854 #define F_FW_RI_TPTE_STAGSTATE		V_FW_RI_TPTE_STAGSTATE(1U)
855 
856 #define S_FW_RI_TPTE_STAGTYPE		20
857 #define M_FW_RI_TPTE_STAGTYPE		0x3
858 #define V_FW_RI_TPTE_STAGTYPE(x)	((x) << S_FW_RI_TPTE_STAGTYPE)
859 #define G_FW_RI_TPTE_STAGTYPE(x)	\
860     (((x) >> S_FW_RI_TPTE_STAGTYPE) & M_FW_RI_TPTE_STAGTYPE)
861 
862 #define S_FW_RI_TPTE_PDID		0
863 #define M_FW_RI_TPTE_PDID		0xfffff
864 #define V_FW_RI_TPTE_PDID(x)		((x) << S_FW_RI_TPTE_PDID)
865 #define G_FW_RI_TPTE_PDID(x)		\
866     (((x) >> S_FW_RI_TPTE_PDID) & M_FW_RI_TPTE_PDID)
867 
868 #define S_FW_RI_TPTE_PERM		28
869 #define M_FW_RI_TPTE_PERM		0xf
870 #define V_FW_RI_TPTE_PERM(x)		((x) << S_FW_RI_TPTE_PERM)
871 #define G_FW_RI_TPTE_PERM(x)		\
872     (((x) >> S_FW_RI_TPTE_PERM) & M_FW_RI_TPTE_PERM)
873 
874 #define S_FW_RI_TPTE_REMINVDIS		27
875 #define M_FW_RI_TPTE_REMINVDIS		0x1
876 #define V_FW_RI_TPTE_REMINVDIS(x)	((x) << S_FW_RI_TPTE_REMINVDIS)
877 #define G_FW_RI_TPTE_REMINVDIS(x)	\
878     (((x) >> S_FW_RI_TPTE_REMINVDIS) & M_FW_RI_TPTE_REMINVDIS)
879 #define F_FW_RI_TPTE_REMINVDIS		V_FW_RI_TPTE_REMINVDIS(1U)
880 
881 #define S_FW_RI_TPTE_ADDRTYPE		26
882 #define M_FW_RI_TPTE_ADDRTYPE		1
883 #define V_FW_RI_TPTE_ADDRTYPE(x)	((x) << S_FW_RI_TPTE_ADDRTYPE)
884 #define G_FW_RI_TPTE_ADDRTYPE(x)	\
885     (((x) >> S_FW_RI_TPTE_ADDRTYPE) & M_FW_RI_TPTE_ADDRTYPE)
886 #define F_FW_RI_TPTE_ADDRTYPE		V_FW_RI_TPTE_ADDRTYPE(1U)
887 
888 #define S_FW_RI_TPTE_MWBINDEN		25
889 #define M_FW_RI_TPTE_MWBINDEN		0x1
890 #define V_FW_RI_TPTE_MWBINDEN(x)	((x) << S_FW_RI_TPTE_MWBINDEN)
891 #define G_FW_RI_TPTE_MWBINDEN(x)	\
892     (((x) >> S_FW_RI_TPTE_MWBINDEN) & M_FW_RI_TPTE_MWBINDEN)
893 #define F_FW_RI_TPTE_MWBINDEN		V_FW_RI_TPTE_MWBINDEN(1U)
894 
895 #define S_FW_RI_TPTE_PS			20
896 #define M_FW_RI_TPTE_PS			0x1f
897 #define V_FW_RI_TPTE_PS(x)		((x) << S_FW_RI_TPTE_PS)
898 #define G_FW_RI_TPTE_PS(x)		\
899     (((x) >> S_FW_RI_TPTE_PS) & M_FW_RI_TPTE_PS)
900 
901 #define S_FW_RI_TPTE_QPID		0
902 #define M_FW_RI_TPTE_QPID		0xfffff
903 #define V_FW_RI_TPTE_QPID(x)		((x) << S_FW_RI_TPTE_QPID)
904 #define G_FW_RI_TPTE_QPID(x)		\
905     (((x) >> S_FW_RI_TPTE_QPID) & M_FW_RI_TPTE_QPID)
906 
907 #define S_FW_RI_TPTE_NOSNOOP		31
908 #define M_FW_RI_TPTE_NOSNOOP		0x1
909 #define V_FW_RI_TPTE_NOSNOOP(x)		((x) << S_FW_RI_TPTE_NOSNOOP)
910 #define G_FW_RI_TPTE_NOSNOOP(x)		\
911     (((x) >> S_FW_RI_TPTE_NOSNOOP) & M_FW_RI_TPTE_NOSNOOP)
912 #define F_FW_RI_TPTE_NOSNOOP		V_FW_RI_TPTE_NOSNOOP(1U)
913 
914 #define S_FW_RI_TPTE_PBLADDR		0
915 #define M_FW_RI_TPTE_PBLADDR		0x1fffffff
916 #define V_FW_RI_TPTE_PBLADDR(x)		((x) << S_FW_RI_TPTE_PBLADDR)
917 #define G_FW_RI_TPTE_PBLADDR(x)		\
918     (((x) >> S_FW_RI_TPTE_PBLADDR) & M_FW_RI_TPTE_PBLADDR)
919 
920 #define S_FW_RI_TPTE_DCA		24
921 #define M_FW_RI_TPTE_DCA		0x1f
922 #define V_FW_RI_TPTE_DCA(x)		((x) << S_FW_RI_TPTE_DCA)
923 #define G_FW_RI_TPTE_DCA(x)		\
924     (((x) >> S_FW_RI_TPTE_DCA) & M_FW_RI_TPTE_DCA)
925 
926 #define S_FW_RI_TPTE_MWBCNT_PSTAG	0
927 #define M_FW_RI_TPTE_MWBCNT_PSTAG	0xffffff
928 #define V_FW_RI_TPTE_MWBCNT_PSTAT(x)	\
929     ((x) << S_FW_RI_TPTE_MWBCNT_PSTAG)
930 #define G_FW_RI_TPTE_MWBCNT_PSTAG(x)	\
931     (((x) >> S_FW_RI_TPTE_MWBCNT_PSTAG) & M_FW_RI_TPTE_MWBCNT_PSTAG)
932 
933 enum fw_ri_cqe_rxtx {
934 	FW_RI_CQE_RXTX_RX = 0x0,
935 	FW_RI_CQE_RXTX_TX = 0x1,
936 };
937 
938 struct fw_ri_cqe {
939 	union fw_ri_rxtx {
940 		struct fw_ri_scqe {
941 		__be32	qpid_n_stat_rxtx_type;
942 		__be32	plen;
943 		__be32	reserved;
944 		__be32	wrid;
945 		} scqe;
946 		struct fw_ri_rcqe {
947 		__be32	qpid_n_stat_rxtx_type;
948 		__be32	plen;
949 		__be32	stag;
950 		__be32	msn;
951 		} rcqe;
952 	} u;
953 };
954 
955 #define S_FW_RI_CQE_QPID      12
956 #define M_FW_RI_CQE_QPID      0xfffff
957 #define V_FW_RI_CQE_QPID(x)   ((x) << S_FW_RI_CQE_QPID)
958 #define G_FW_RI_CQE_QPID(x)   \
959     (((x) >> S_FW_RI_CQE_QPID) &  M_FW_RI_CQE_QPID)
960 
961 #define S_FW_RI_CQE_NOTIFY    10
962 #define M_FW_RI_CQE_NOTIFY    0x1
963 #define V_FW_RI_CQE_NOTIFY(x) ((x) << S_FW_RI_CQE_NOTIFY)
964 #define G_FW_RI_CQE_NOTIFY(x) \
965     (((x) >> S_FW_RI_CQE_NOTIFY) &  M_FW_RI_CQE_NOTIFY)
966 
967 #define S_FW_RI_CQE_STATUS    5
968 #define M_FW_RI_CQE_STATUS    0x1f
969 #define V_FW_RI_CQE_STATUS(x) ((x) << S_FW_RI_CQE_STATUS)
970 #define G_FW_RI_CQE_STATUS(x) \
971     (((x) >> S_FW_RI_CQE_STATUS) &  M_FW_RI_CQE_STATUS)
972 
973 
974 #define S_FW_RI_CQE_RXTX      4
975 #define M_FW_RI_CQE_RXTX      0x1
976 #define V_FW_RI_CQE_RXTX(x)   ((x) << S_FW_RI_CQE_RXTX)
977 #define G_FW_RI_CQE_RXTX(x)   \
978     (((x) >> S_FW_RI_CQE_RXTX) &  M_FW_RI_CQE_RXTX)
979 
980 #define S_FW_RI_CQE_TYPE      0
981 #define M_FW_RI_CQE_TYPE      0xf
982 #define V_FW_RI_CQE_TYPE(x)   ((x) << S_FW_RI_CQE_TYPE)
983 #define G_FW_RI_CQE_TYPE(x)   \
984     (((x) >> S_FW_RI_CQE_TYPE) &  M_FW_RI_CQE_TYPE)
985 
986 enum fw_ri_res_type {
987 	FW_RI_RES_TYPE_SQ,
988 	FW_RI_RES_TYPE_RQ,
989 	FW_RI_RES_TYPE_CQ,
990 };
991 
992 enum fw_ri_res_op {
993 	FW_RI_RES_OP_WRITE,
994 	FW_RI_RES_OP_RESET,
995 };
996 
997 struct fw_ri_res {
998 	union fw_ri_restype {
999 		struct fw_ri_res_sqrq {
1000 			__u8   restype;
1001 			__u8   op;
1002 			__be16 r3;
1003 			__be32 eqid;
1004 			__be32 r4[2];
1005 			__be32 fetchszm_to_iqid;
1006 			__be32 dcaen_to_eqsize;
1007 			__be64 eqaddr;
1008 		} sqrq;
1009 		struct fw_ri_res_cq {
1010 			__u8   restype;
1011 			__u8   op;
1012 			__be16 r3;
1013 			__be32 iqid;
1014 			__be32 r4[2];
1015 			__be32 iqandst_to_iqandstindex;
1016 			__be16 iqdroprss_to_iqesize;
1017 			__be16 iqsize;
1018 			__be64 iqaddr;
1019 			__be32 iqns_iqro;
1020 			__be32 r6_lo;
1021 			__be64 r7;
1022 		} cq;
1023 	} u;
1024 };
1025 
1026 struct fw_ri_res_wr {
1027 	__be32 op_nres;
1028 	__be32 len16_pkd;
1029 	__u64  cookie;
1030 #ifndef C99_NOT_SUPPORTED
1031 	struct fw_ri_res res[0];
1032 #endif
1033 };
1034 
1035 #define S_FW_RI_RES_WR_NRES	0
1036 #define M_FW_RI_RES_WR_NRES	0xff
1037 #define V_FW_RI_RES_WR_NRES(x)	((x) << S_FW_RI_RES_WR_NRES)
1038 #define G_FW_RI_RES_WR_NRES(x)	\
1039     (((x) >> S_FW_RI_RES_WR_NRES) & M_FW_RI_RES_WR_NRES)
1040 
1041 #define S_FW_RI_RES_WR_FETCHSZM		26
1042 #define M_FW_RI_RES_WR_FETCHSZM		0x1
1043 #define V_FW_RI_RES_WR_FETCHSZM(x)	((x) << S_FW_RI_RES_WR_FETCHSZM)
1044 #define G_FW_RI_RES_WR_FETCHSZM(x)	\
1045     (((x) >> S_FW_RI_RES_WR_FETCHSZM) & M_FW_RI_RES_WR_FETCHSZM)
1046 #define F_FW_RI_RES_WR_FETCHSZM	V_FW_RI_RES_WR_FETCHSZM(1U)
1047 
1048 #define S_FW_RI_RES_WR_STATUSPGNS	25
1049 #define M_FW_RI_RES_WR_STATUSPGNS	0x1
1050 #define V_FW_RI_RES_WR_STATUSPGNS(x)	((x) << S_FW_RI_RES_WR_STATUSPGNS)
1051 #define G_FW_RI_RES_WR_STATUSPGNS(x)	\
1052     (((x) >> S_FW_RI_RES_WR_STATUSPGNS) & M_FW_RI_RES_WR_STATUSPGNS)
1053 #define F_FW_RI_RES_WR_STATUSPGNS	V_FW_RI_RES_WR_STATUSPGNS(1U)
1054 
1055 #define S_FW_RI_RES_WR_STATUSPGRO	24
1056 #define M_FW_RI_RES_WR_STATUSPGRO	0x1
1057 #define V_FW_RI_RES_WR_STATUSPGRO(x)	((x) << S_FW_RI_RES_WR_STATUSPGRO)
1058 #define G_FW_RI_RES_WR_STATUSPGRO(x)	\
1059     (((x) >> S_FW_RI_RES_WR_STATUSPGRO) & M_FW_RI_RES_WR_STATUSPGRO)
1060 #define F_FW_RI_RES_WR_STATUSPGRO	V_FW_RI_RES_WR_STATUSPGRO(1U)
1061 
1062 #define S_FW_RI_RES_WR_FETCHNS		23
1063 #define M_FW_RI_RES_WR_FETCHNS		0x1
1064 #define V_FW_RI_RES_WR_FETCHNS(x)	((x) << S_FW_RI_RES_WR_FETCHNS)
1065 #define G_FW_RI_RES_WR_FETCHNS(x)	\
1066     (((x) >> S_FW_RI_RES_WR_FETCHNS) & M_FW_RI_RES_WR_FETCHNS)
1067 #define F_FW_RI_RES_WR_FETCHNS	V_FW_RI_RES_WR_FETCHNS(1U)
1068 
1069 #define S_FW_RI_RES_WR_FETCHRO		22
1070 #define M_FW_RI_RES_WR_FETCHRO		0x1
1071 #define V_FW_RI_RES_WR_FETCHRO(x)	((x) << S_FW_RI_RES_WR_FETCHRO)
1072 #define G_FW_RI_RES_WR_FETCHRO(x)	\
1073     (((x) >> S_FW_RI_RES_WR_FETCHRO) & M_FW_RI_RES_WR_FETCHRO)
1074 #define F_FW_RI_RES_WR_FETCHRO	V_FW_RI_RES_WR_FETCHRO(1U)
1075 
1076 #define S_FW_RI_RES_WR_HOSTFCMODE	20
1077 #define M_FW_RI_RES_WR_HOSTFCMODE	0x3
1078 #define V_FW_RI_RES_WR_HOSTFCMODE(x)	((x) << S_FW_RI_RES_WR_HOSTFCMODE)
1079 #define G_FW_RI_RES_WR_HOSTFCMODE(x)	\
1080     (((x) >> S_FW_RI_RES_WR_HOSTFCMODE) & M_FW_RI_RES_WR_HOSTFCMODE)
1081 
1082 #define S_FW_RI_RES_WR_CPRIO	19
1083 #define M_FW_RI_RES_WR_CPRIO	0x1
1084 #define V_FW_RI_RES_WR_CPRIO(x)	((x) << S_FW_RI_RES_WR_CPRIO)
1085 #define G_FW_RI_RES_WR_CPRIO(x)	\
1086     (((x) >> S_FW_RI_RES_WR_CPRIO) & M_FW_RI_RES_WR_CPRIO)
1087 #define F_FW_RI_RES_WR_CPRIO	V_FW_RI_RES_WR_CPRIO(1U)
1088 
1089 #define S_FW_RI_RES_WR_ONCHIP		18
1090 #define M_FW_RI_RES_WR_ONCHIP		0x1
1091 #define V_FW_RI_RES_WR_ONCHIP(x)	((x) << S_FW_RI_RES_WR_ONCHIP)
1092 #define G_FW_RI_RES_WR_ONCHIP(x)	\
1093     (((x) >> S_FW_RI_RES_WR_ONCHIP) & M_FW_RI_RES_WR_ONCHIP)
1094 #define F_FW_RI_RES_WR_ONCHIP	V_FW_RI_RES_WR_ONCHIP(1U)
1095 
1096 #define S_FW_RI_RES_WR_PCIECHN		16
1097 #define M_FW_RI_RES_WR_PCIECHN		0x3
1098 #define V_FW_RI_RES_WR_PCIECHN(x)	((x) << S_FW_RI_RES_WR_PCIECHN)
1099 #define G_FW_RI_RES_WR_PCIECHN(x)	\
1100     (((x) >> S_FW_RI_RES_WR_PCIECHN) & M_FW_RI_RES_WR_PCIECHN)
1101 
1102 #define S_FW_RI_RES_WR_IQID	0
1103 #define M_FW_RI_RES_WR_IQID	0xffff
1104 #define V_FW_RI_RES_WR_IQID(x)	((x) << S_FW_RI_RES_WR_IQID)
1105 #define G_FW_RI_RES_WR_IQID(x)	\
1106     (((x) >> S_FW_RI_RES_WR_IQID) & M_FW_RI_RES_WR_IQID)
1107 
1108 #define S_FW_RI_RES_WR_DCAEN	31
1109 #define M_FW_RI_RES_WR_DCAEN	0x1
1110 #define V_FW_RI_RES_WR_DCAEN(x)	((x) << S_FW_RI_RES_WR_DCAEN)
1111 #define G_FW_RI_RES_WR_DCAEN(x)	\
1112     (((x) >> S_FW_RI_RES_WR_DCAEN) & M_FW_RI_RES_WR_DCAEN)
1113 #define F_FW_RI_RES_WR_DCAEN	V_FW_RI_RES_WR_DCAEN(1U)
1114 
1115 #define S_FW_RI_RES_WR_DCACPU		26
1116 #define M_FW_RI_RES_WR_DCACPU		0x1f
1117 #define V_FW_RI_RES_WR_DCACPU(x)	((x) << S_FW_RI_RES_WR_DCACPU)
1118 #define G_FW_RI_RES_WR_DCACPU(x)	\
1119     (((x) >> S_FW_RI_RES_WR_DCACPU) & M_FW_RI_RES_WR_DCACPU)
1120 
1121 #define S_FW_RI_RES_WR_FBMIN	23
1122 #define M_FW_RI_RES_WR_FBMIN	0x7
1123 #define V_FW_RI_RES_WR_FBMIN(x)	((x) << S_FW_RI_RES_WR_FBMIN)
1124 #define G_FW_RI_RES_WR_FBMIN(x)	\
1125     (((x) >> S_FW_RI_RES_WR_FBMIN) & M_FW_RI_RES_WR_FBMIN)
1126 
1127 #define S_FW_RI_RES_WR_FBMAX	20
1128 #define M_FW_RI_RES_WR_FBMAX	0x7
1129 #define V_FW_RI_RES_WR_FBMAX(x)	((x) << S_FW_RI_RES_WR_FBMAX)
1130 #define G_FW_RI_RES_WR_FBMAX(x)	\
1131     (((x) >> S_FW_RI_RES_WR_FBMAX) & M_FW_RI_RES_WR_FBMAX)
1132 
1133 #define S_FW_RI_RES_WR_CIDXFTHRESHO	19
1134 #define M_FW_RI_RES_WR_CIDXFTHRESHO	0x1
1135 #define V_FW_RI_RES_WR_CIDXFTHRESHO(x)	((x) << S_FW_RI_RES_WR_CIDXFTHRESHO)
1136 #define G_FW_RI_RES_WR_CIDXFTHRESHO(x)	\
1137     (((x) >> S_FW_RI_RES_WR_CIDXFTHRESHO) & M_FW_RI_RES_WR_CIDXFTHRESHO)
1138 #define F_FW_RI_RES_WR_CIDXFTHRESHO	V_FW_RI_RES_WR_CIDXFTHRESHO(1U)
1139 
1140 #define S_FW_RI_RES_WR_CIDXFTHRESH	16
1141 #define M_FW_RI_RES_WR_CIDXFTHRESH	0x7
1142 #define V_FW_RI_RES_WR_CIDXFTHRESH(x)	((x) << S_FW_RI_RES_WR_CIDXFTHRESH)
1143 #define G_FW_RI_RES_WR_CIDXFTHRESH(x)	\
1144     (((x) >> S_FW_RI_RES_WR_CIDXFTHRESH) & M_FW_RI_RES_WR_CIDXFTHRESH)
1145 
1146 #define S_FW_RI_RES_WR_EQSIZE		0
1147 #define M_FW_RI_RES_WR_EQSIZE		0xffff
1148 #define V_FW_RI_RES_WR_EQSIZE(x)	((x) << S_FW_RI_RES_WR_EQSIZE)
1149 #define G_FW_RI_RES_WR_EQSIZE(x)	\
1150     (((x) >> S_FW_RI_RES_WR_EQSIZE) & M_FW_RI_RES_WR_EQSIZE)
1151 
1152 #define S_FW_RI_RES_WR_IQANDST		15
1153 #define M_FW_RI_RES_WR_IQANDST		0x1
1154 #define V_FW_RI_RES_WR_IQANDST(x)	((x) << S_FW_RI_RES_WR_IQANDST)
1155 #define G_FW_RI_RES_WR_IQANDST(x)	\
1156     (((x) >> S_FW_RI_RES_WR_IQANDST) & M_FW_RI_RES_WR_IQANDST)
1157 #define F_FW_RI_RES_WR_IQANDST	V_FW_RI_RES_WR_IQANDST(1U)
1158 
1159 #define S_FW_RI_RES_WR_IQANUS		14
1160 #define M_FW_RI_RES_WR_IQANUS		0x1
1161 #define V_FW_RI_RES_WR_IQANUS(x)	((x) << S_FW_RI_RES_WR_IQANUS)
1162 #define G_FW_RI_RES_WR_IQANUS(x)	\
1163     (((x) >> S_FW_RI_RES_WR_IQANUS) & M_FW_RI_RES_WR_IQANUS)
1164 #define F_FW_RI_RES_WR_IQANUS	V_FW_RI_RES_WR_IQANUS(1U)
1165 
1166 #define S_FW_RI_RES_WR_IQANUD		12
1167 #define M_FW_RI_RES_WR_IQANUD		0x3
1168 #define V_FW_RI_RES_WR_IQANUD(x)	((x) << S_FW_RI_RES_WR_IQANUD)
1169 #define G_FW_RI_RES_WR_IQANUD(x)	\
1170     (((x) >> S_FW_RI_RES_WR_IQANUD) & M_FW_RI_RES_WR_IQANUD)
1171 
1172 #define S_FW_RI_RES_WR_IQANDSTINDEX	0
1173 #define M_FW_RI_RES_WR_IQANDSTINDEX	0xfff
1174 #define V_FW_RI_RES_WR_IQANDSTINDEX(x)	((x) << S_FW_RI_RES_WR_IQANDSTINDEX)
1175 #define G_FW_RI_RES_WR_IQANDSTINDEX(x)	\
1176     (((x) >> S_FW_RI_RES_WR_IQANDSTINDEX) & M_FW_RI_RES_WR_IQANDSTINDEX)
1177 
1178 #define S_FW_RI_RES_WR_IQDROPRSS	15
1179 #define M_FW_RI_RES_WR_IQDROPRSS	0x1
1180 #define V_FW_RI_RES_WR_IQDROPRSS(x)	((x) << S_FW_RI_RES_WR_IQDROPRSS)
1181 #define G_FW_RI_RES_WR_IQDROPRSS(x)	\
1182     (((x) >> S_FW_RI_RES_WR_IQDROPRSS) & M_FW_RI_RES_WR_IQDROPRSS)
1183 #define F_FW_RI_RES_WR_IQDROPRSS	V_FW_RI_RES_WR_IQDROPRSS(1U)
1184 
1185 #define S_FW_RI_RES_WR_IQGTSMODE	14
1186 #define M_FW_RI_RES_WR_IQGTSMODE	0x1
1187 #define V_FW_RI_RES_WR_IQGTSMODE(x)	((x) << S_FW_RI_RES_WR_IQGTSMODE)
1188 #define G_FW_RI_RES_WR_IQGTSMODE(x)	\
1189     (((x) >> S_FW_RI_RES_WR_IQGTSMODE) & M_FW_RI_RES_WR_IQGTSMODE)
1190 #define F_FW_RI_RES_WR_IQGTSMODE	V_FW_RI_RES_WR_IQGTSMODE(1U)
1191 
1192 #define S_FW_RI_RES_WR_IQPCIECH		12
1193 #define M_FW_RI_RES_WR_IQPCIECH		0x3
1194 #define V_FW_RI_RES_WR_IQPCIECH(x)	((x) << S_FW_RI_RES_WR_IQPCIECH)
1195 #define G_FW_RI_RES_WR_IQPCIECH(x)	\
1196     (((x) >> S_FW_RI_RES_WR_IQPCIECH) & M_FW_RI_RES_WR_IQPCIECH)
1197 
1198 #define S_FW_RI_RES_WR_IQDCAEN		11
1199 #define M_FW_RI_RES_WR_IQDCAEN		0x1
1200 #define V_FW_RI_RES_WR_IQDCAEN(x)	((x) << S_FW_RI_RES_WR_IQDCAEN)
1201 #define G_FW_RI_RES_WR_IQDCAEN(x)	\
1202     (((x) >> S_FW_RI_RES_WR_IQDCAEN) & M_FW_RI_RES_WR_IQDCAEN)
1203 #define F_FW_RI_RES_WR_IQDCAEN	V_FW_RI_RES_WR_IQDCAEN(1U)
1204 
1205 #define S_FW_RI_RES_WR_IQDCACPU		6
1206 #define M_FW_RI_RES_WR_IQDCACPU		0x1f
1207 #define V_FW_RI_RES_WR_IQDCACPU(x)	((x) << S_FW_RI_RES_WR_IQDCACPU)
1208 #define G_FW_RI_RES_WR_IQDCACPU(x)	\
1209     (((x) >> S_FW_RI_RES_WR_IQDCACPU) & M_FW_RI_RES_WR_IQDCACPU)
1210 
1211 #define S_FW_RI_RES_WR_IQINTCNTTHRESH		4
1212 #define M_FW_RI_RES_WR_IQINTCNTTHRESH		0x3
1213 #define V_FW_RI_RES_WR_IQINTCNTTHRESH(x)	\
1214     ((x) << S_FW_RI_RES_WR_IQINTCNTTHRESH)
1215 #define G_FW_RI_RES_WR_IQINTCNTTHRESH(x)	\
1216     (((x) >> S_FW_RI_RES_WR_IQINTCNTTHRESH) & M_FW_RI_RES_WR_IQINTCNTTHRESH)
1217 
1218 #define S_FW_RI_RES_WR_IQO	3
1219 #define M_FW_RI_RES_WR_IQO	0x1
1220 #define V_FW_RI_RES_WR_IQO(x)	((x) << S_FW_RI_RES_WR_IQO)
1221 #define G_FW_RI_RES_WR_IQO(x)	\
1222     (((x) >> S_FW_RI_RES_WR_IQO) & M_FW_RI_RES_WR_IQO)
1223 #define F_FW_RI_RES_WR_IQO	V_FW_RI_RES_WR_IQO(1U)
1224 
1225 #define S_FW_RI_RES_WR_IQCPRIO		2
1226 #define M_FW_RI_RES_WR_IQCPRIO		0x1
1227 #define V_FW_RI_RES_WR_IQCPRIO(x)	((x) << S_FW_RI_RES_WR_IQCPRIO)
1228 #define G_FW_RI_RES_WR_IQCPRIO(x)	\
1229     (((x) >> S_FW_RI_RES_WR_IQCPRIO) & M_FW_RI_RES_WR_IQCPRIO)
1230 #define F_FW_RI_RES_WR_IQCPRIO	V_FW_RI_RES_WR_IQCPRIO(1U)
1231 
1232 #define S_FW_RI_RES_WR_IQESIZE		0
1233 #define M_FW_RI_RES_WR_IQESIZE		0x3
1234 #define V_FW_RI_RES_WR_IQESIZE(x)	((x) << S_FW_RI_RES_WR_IQESIZE)
1235 #define G_FW_RI_RES_WR_IQESIZE(x)	\
1236     (((x) >> S_FW_RI_RES_WR_IQESIZE) & M_FW_RI_RES_WR_IQESIZE)
1237 
1238 #define S_FW_RI_RES_WR_IQNS	31
1239 #define M_FW_RI_RES_WR_IQNS	0x1
1240 #define V_FW_RI_RES_WR_IQNS(x)	((x) << S_FW_RI_RES_WR_IQNS)
1241 #define G_FW_RI_RES_WR_IQNS(x)	\
1242     (((x) >> S_FW_RI_RES_WR_IQNS) & M_FW_RI_RES_WR_IQNS)
1243 #define F_FW_RI_RES_WR_IQNS	V_FW_RI_RES_WR_IQNS(1U)
1244 
1245 #define S_FW_RI_RES_WR_IQRO	30
1246 #define M_FW_RI_RES_WR_IQRO	0x1
1247 #define V_FW_RI_RES_WR_IQRO(x)	((x) << S_FW_RI_RES_WR_IQRO)
1248 #define G_FW_RI_RES_WR_IQRO(x)	\
1249     (((x) >> S_FW_RI_RES_WR_IQRO) & M_FW_RI_RES_WR_IQRO)
1250 #define F_FW_RI_RES_WR_IQRO	V_FW_RI_RES_WR_IQRO(1U)
1251 
1252 struct fw_ri_rdma_write_wr {
1253 	__u8   opcode;
1254 	__u8   flags;
1255 	__u16  wrid;
1256 	__u8   r1[3];
1257 	__u8   len16;
1258 	__be64 r2;
1259 	__be32 plen;
1260 	__be32 stag_sink;
1261 	__be64 to_sink;
1262 #ifndef C99_NOT_SUPPORTED
1263 	union {
1264 		struct fw_ri_immd immd_src[0];
1265 		struct fw_ri_isgl isgl_src[0];
1266 	} u;
1267 #endif
1268 };
1269 
1270 struct fw_ri_send_wr {
1271 	__u8   opcode;
1272 	__u8   flags;
1273 	__u16  wrid;
1274 	__u8   r1[3];
1275 	__u8   len16;
1276 	__be32 sendop_pkd;
1277 	__be32 stag_inv;
1278 	__be32 plen;
1279 	__be32 r3;
1280 	__be64 r4;
1281 #ifndef C99_NOT_SUPPORTED
1282 	union {
1283 		struct fw_ri_immd immd_src[0];
1284 		struct fw_ri_isgl isgl_src[0];
1285 	} u;
1286 #endif
1287 };
1288 
1289 #define S_FW_RI_SEND_WR_SENDOP		0
1290 #define M_FW_RI_SEND_WR_SENDOP		0xf
1291 #define V_FW_RI_SEND_WR_SENDOP(x)	((x) << S_FW_RI_SEND_WR_SENDOP)
1292 #define G_FW_RI_SEND_WR_SENDOP(x)	\
1293     (((x) >> S_FW_RI_SEND_WR_SENDOP) & M_FW_RI_SEND_WR_SENDOP)
1294 
1295 struct fw_ri_rdma_read_wr {
1296 	__u8   opcode;
1297 	__u8   flags;
1298 	__u16  wrid;
1299 	__u8   r1[3];
1300 	__u8   len16;
1301 	__be64 r2;
1302 	__be32 stag_sink;
1303 	__be32 to_sink_hi;
1304 	__be32 to_sink_lo;
1305 	__be32 plen;
1306 	__be32 stag_src;
1307 	__be32 to_src_hi;
1308 	__be32 to_src_lo;
1309 	__be32 r5;
1310 };
1311 
1312 struct fw_ri_recv_wr {
1313 	__u8   opcode;
1314 	__u8   r1;
1315 	__u16  wrid;
1316 	__u8   r2[3];
1317 	__u8   len16;
1318 	struct fw_ri_isgl isgl;
1319 };
1320 
1321 struct fw_ri_bind_mw_wr {
1322 	__u8   opcode;
1323 	__u8   flags;
1324 	__u16  wrid;
1325 	__u8   r1[3];
1326 	__u8   len16;
1327 	__u8   qpbinde_to_dcacpu;
1328 	__u8   pgsz_shift;
1329 	__u8   addr_type;
1330 	__u8   mem_perms;
1331 	__be32 stag_mr;
1332 	__be32 stag_mw;
1333 	__be32 r3;
1334 	__be64 len_mw;
1335 	__be64 va_fbo;
1336 	__be64 r4;
1337 };
1338 
1339 #define S_FW_RI_BIND_MW_WR_QPBINDE	6
1340 #define M_FW_RI_BIND_MW_WR_QPBINDE	0x1
1341 #define V_FW_RI_BIND_MW_WR_QPBINDE(x)	((x) << S_FW_RI_BIND_MW_WR_QPBINDE)
1342 #define G_FW_RI_BIND_MW_WR_QPBINDE(x)	\
1343     (((x) >> S_FW_RI_BIND_MW_WR_QPBINDE) & M_FW_RI_BIND_MW_WR_QPBINDE)
1344 #define F_FW_RI_BIND_MW_WR_QPBINDE	V_FW_RI_BIND_MW_WR_QPBINDE(1U)
1345 
1346 #define S_FW_RI_BIND_MW_WR_NS		5
1347 #define M_FW_RI_BIND_MW_WR_NS		0x1
1348 #define V_FW_RI_BIND_MW_WR_NS(x)	((x) << S_FW_RI_BIND_MW_WR_NS)
1349 #define G_FW_RI_BIND_MW_WR_NS(x)	\
1350     (((x) >> S_FW_RI_BIND_MW_WR_NS) & M_FW_RI_BIND_MW_WR_NS)
1351 #define F_FW_RI_BIND_MW_WR_NS	V_FW_RI_BIND_MW_WR_NS(1U)
1352 
1353 #define S_FW_RI_BIND_MW_WR_DCACPU	0
1354 #define M_FW_RI_BIND_MW_WR_DCACPU	0x1f
1355 #define V_FW_RI_BIND_MW_WR_DCACPU(x)	((x) << S_FW_RI_BIND_MW_WR_DCACPU)
1356 #define G_FW_RI_BIND_MW_WR_DCACPU(x)	\
1357     (((x) >> S_FW_RI_BIND_MW_WR_DCACPU) & M_FW_RI_BIND_MW_WR_DCACPU)
1358 
1359 struct fw_ri_fr_nsmr_wr {
1360 	__u8   opcode;
1361 	__u8   flags;
1362 	__u16  wrid;
1363 	__u8   r1[3];
1364 	__u8   len16;
1365 	__u8   qpbinde_to_dcacpu;
1366 	__u8   pgsz_shift;
1367 	__u8   addr_type;
1368 	__u8   mem_perms;
1369 	__be32 stag;
1370 	__be32 len_hi;
1371 	__be32 len_lo;
1372 	__be32 va_hi;
1373 	__be32 va_lo_fbo;
1374 };
1375 
1376 #define S_FW_RI_FR_NSMR_WR_QPBINDE	6
1377 #define M_FW_RI_FR_NSMR_WR_QPBINDE	0x1
1378 #define V_FW_RI_FR_NSMR_WR_QPBINDE(x)	((x) << S_FW_RI_FR_NSMR_WR_QPBINDE)
1379 #define G_FW_RI_FR_NSMR_WR_QPBINDE(x)	\
1380     (((x) >> S_FW_RI_FR_NSMR_WR_QPBINDE) & M_FW_RI_FR_NSMR_WR_QPBINDE)
1381 #define F_FW_RI_FR_NSMR_WR_QPBINDE	V_FW_RI_FR_NSMR_WR_QPBINDE(1U)
1382 
1383 #define S_FW_RI_FR_NSMR_WR_NS		5
1384 #define M_FW_RI_FR_NSMR_WR_NS		0x1
1385 #define V_FW_RI_FR_NSMR_WR_NS(x)	((x) << S_FW_RI_FR_NSMR_WR_NS)
1386 #define G_FW_RI_FR_NSMR_WR_NS(x)	\
1387     (((x) >> S_FW_RI_FR_NSMR_WR_NS) & M_FW_RI_FR_NSMR_WR_NS)
1388 #define F_FW_RI_FR_NSMR_WR_NS	V_FW_RI_FR_NSMR_WR_NS(1U)
1389 
1390 #define S_FW_RI_FR_NSMR_WR_DCACPU	0
1391 #define M_FW_RI_FR_NSMR_WR_DCACPU	0x1f
1392 #define V_FW_RI_FR_NSMR_WR_DCACPU(x)	((x) << S_FW_RI_FR_NSMR_WR_DCACPU)
1393 #define G_FW_RI_FR_NSMR_WR_DCACPU(x)	\
1394     (((x) >> S_FW_RI_FR_NSMR_WR_DCACPU) & M_FW_RI_FR_NSMR_WR_DCACPU)
1395 
1396 struct fw_ri_inv_lstag_wr {
1397 	__u8   opcode;
1398 	__u8   flags;
1399 	__u16  wrid;
1400 	__u8   r1[3];
1401 	__u8   len16;
1402 	__be32 r2;
1403 	__be32 stag_inv;
1404 };
1405 
1406 enum fw_ri_type {
1407 	FW_RI_TYPE_INIT,
1408 	FW_RI_TYPE_FINI,
1409 	FW_RI_TYPE_TERMINATE
1410 };
1411 
1412 enum fw_ri_init_p2ptype {
1413 	FW_RI_INIT_P2PTYPE_RDMA_WRITE		= FW_RI_RDMA_WRITE,
1414 	FW_RI_INIT_P2PTYPE_READ_REQ		= FW_RI_READ_REQ,
1415 	FW_RI_INIT_P2PTYPE_SEND			= FW_RI_SEND,
1416 	FW_RI_INIT_P2PTYPE_SEND_WITH_INV	= FW_RI_SEND_WITH_INV,
1417 	FW_RI_INIT_P2PTYPE_SEND_WITH_SE		= FW_RI_SEND_WITH_SE,
1418 	FW_RI_INIT_P2PTYPE_SEND_WITH_SE_INV	= FW_RI_SEND_WITH_SE_INV,
1419 	FW_RI_INIT_P2PTYPE_DISABLED		= 0xf,
1420 };
1421 
1422 struct fw_ri_wr {
1423 	__be32 op_compl;
1424 	__be32 flowid_len16;
1425 	__u64  cookie;
1426 	union fw_ri {
1427 		struct fw_ri_init {
1428 			__u8   type;
1429 			__u8   mpareqbit_p2ptype;
1430 			__u8   r4[2];
1431 			__u8   mpa_attrs;
1432 			__u8   qp_caps;
1433 			__be16 nrqe;
1434 			__be32 pdid;
1435 			__be32 qpid;
1436 			__be32 sq_eqid;
1437 			__be32 rq_eqid;
1438 			__be32 scqid;
1439 			__be32 rcqid;
1440 			__be32 ord_max;
1441 			__be32 ird_max;
1442 			__be32 iss;
1443 			__be32 irs;
1444 			__be32 hwrqsize;
1445 			__be32 hwrqaddr;
1446 			__be64 r5;
1447 			union fw_ri_init_p2p {
1448 				struct fw_ri_rdma_write_wr write;
1449 				struct fw_ri_rdma_read_wr read;
1450 				struct fw_ri_send_wr send;
1451 			} u;
1452 		} init;
1453 		struct fw_ri_fini {
1454 			__u8   type;
1455 			__u8   r3[7];
1456 			__be64 r4;
1457 		} fini;
1458 		struct fw_ri_terminate {
1459 			__u8   type;
1460 			__u8   r3[3];
1461 			__be32 immdlen;
1462 			__u8   termmsg[40];
1463 		} terminate;
1464 	} u;
1465 };
1466 
1467 #define S_FW_RI_WR_MPAREQBIT	7
1468 #define M_FW_RI_WR_MPAREQBIT	0x1
1469 #define V_FW_RI_WR_MPAREQBIT(x)	((x) << S_FW_RI_WR_MPAREQBIT)
1470 #define G_FW_RI_WR_MPAREQBIT(x)	\
1471     (((x) >> S_FW_RI_WR_MPAREQBIT) & M_FW_RI_WR_MPAREQBIT)
1472 #define F_FW_RI_WR_MPAREQBIT	V_FW_RI_WR_MPAREQBIT(1U)
1473 
1474 #define S_FW_RI_WR_0BRRBIT	6
1475 #define M_FW_RI_WR_0BRRBIT	0x1
1476 #define V_FW_RI_WR_0BRRBIT(x)	((x) << S_FW_RI_WR_0BRRBIT)
1477 #define G_FW_RI_WR_0BRRBIT(x)	\
1478     (((x) >> S_FW_RI_WR_0BRRBIT) & M_FW_RI_WR_0BRRBIT)
1479 #define F_FW_RI_WR_0BRRBIT	V_FW_RI_WR_0BRRBIT(1U)
1480 
1481 #define S_FW_RI_WR_P2PTYPE	0
1482 #define M_FW_RI_WR_P2PTYPE	0xf
1483 #define V_FW_RI_WR_P2PTYPE(x)	((x) << S_FW_RI_WR_P2PTYPE)
1484 #define G_FW_RI_WR_P2PTYPE(x)	\
1485     (((x) >> S_FW_RI_WR_P2PTYPE) & M_FW_RI_WR_P2PTYPE)
1486 
1487 /******************************************************************************
1488  *   S C S I   W O R K   R E Q U E S T s
1489  **********************************************/
1490 
1491 
1492 /******************************************************************************
1493  *   F O i S C S I   W O R K   R E Q U E S T s
1494  **********************************************/
1495 
1496 #define	ISCSI_NAME_MAX_LEN	224
1497 #define	ISCSI_ALIAS_MAX_LEN	224
1498 
1499 enum session_type {
1500 	ISCSI_SESSION_DISCOVERY = 0,
1501 	ISCSI_SESSION_NORMAL,
1502 };
1503 
1504 enum digest_val {
1505 	DIGEST_NONE = 0,
1506 	DIGEST_CRC32,
1507 	DIGEST_BOTH,
1508 };
1509 
1510 enum fw_iscsi_subops {
1511 	NODE_ONLINE = 1,
1512 	SESS_ONLINE,
1513 	CONN_ONLINE,
1514 	NODE_OFFLINE,
1515 	SESS_OFFLINE,
1516 	CONN_OFFLINE,
1517 	NODE_STATS,
1518 	SESS_STATS,
1519 	CONN_STATS,
1520 	UPDATE_IOHANDLE,
1521 };
1522 
1523 struct fw_iscsi_node_attr {
1524 	__u8		name_len;
1525 	__u8		node_name[ISCSI_NAME_MAX_LEN];
1526 	__u8		alias_len;
1527 	__u8		node_alias[ISCSI_ALIAS_MAX_LEN];
1528 };
1529 
1530 struct fw_iscsi_sess_attr {
1531 	__u8		sess_type;
1532 	__u8		seq_inorder;
1533 	__u8		pdu_inorder;
1534 	__u8		immd_data_en;
1535 	__u8		init_r2t_en;
1536 	__u8		erl;
1537 	__be16		max_conn;
1538 	__be16		max_r2t;
1539 	__be16		time2wait;
1540 	__be16		time2retain;
1541 	__be32		max_burst;
1542 	__be32		first_burst;
1543 };
1544 
1545 struct fw_iscsi_conn_attr {
1546 	__u8		hdr_digest;
1547 	__u8		data_digest;
1548 	__be32		max_rcv_dsl;
1549 	__be16		dst_port;
1550 	__be32		dst_addr;
1551 	__be16		src_port;
1552 	__be32		src_addr;
1553 	__be32		ping_tmo;
1554 };
1555 
1556 struct fw_iscsi_node_stats {
1557 	__be16		sess_count;
1558 	__be16		chap_fail_count;
1559 	__be16		login_count;
1560 	__be16		r1;
1561 };
1562 
1563 struct fw_iscsi_sess_stats {
1564 	__be32		rxbytes;
1565 	__be32		txbytes;
1566 	__be32		scmd_count;
1567 	__be32		read_cmds;
1568 	__be32		write_cmds;
1569 	__be32		read_bytes;
1570 	__be32		write_bytes;
1571 	__be32		scsi_err_count;
1572 	__be32		scsi_rst_count;
1573 	__be32		iscsi_tmf_count;
1574 	__be32		conn_count;
1575 };
1576 
1577 struct fw_iscsi_conn_stats {
1578 	__be32		txbytes;
1579 	__be32		rxbytes;
1580 	__be32		dataout;
1581 	__be32		datain;
1582 };
1583 
1584 struct fw_iscsi_node_wr {
1585 	__u8   opcode;
1586 	__u8   subop;
1587 	__be16 immd_len;
1588 	__be32 flowid_len16;
1589 	__be64 cookie;
1590 	__u8   node_attr_to_compl;
1591 	__u8   status;
1592 	__be16 r1;
1593 	__be32 node_id;
1594 	__be32 ctrl_handle;
1595 	__be32 io_handle;
1596 };
1597 
1598 #define S_FW_ISCSI_NODE_WR_FLOWID	8
1599 #define M_FW_ISCSI_NODE_WR_FLOWID	0xfffff
1600 #define V_FW_ISCSI_NODE_WR_FLOWID(x)	((x) << S_FW_ISCSI_NODE_WR_FLOWID)
1601 #define G_FW_ISCSI_NODE_WR_FLOWID(x)	\
1602     (((x) >> S_FW_ISCSI_NODE_WR_FLOWID) & M_FW_ISCSI_NODE_WR_FLOWID)
1603 
1604 #define S_FW_ISCSI_NODE_WR_LEN16	0
1605 #define M_FW_ISCSI_NODE_WR_LEN16	0xff
1606 #define V_FW_ISCSI_NODE_WR_LEN16(x)	((x) << S_FW_ISCSI_NODE_WR_LEN16)
1607 #define G_FW_ISCSI_NODE_WR_LEN16(x)	\
1608     (((x) >> S_FW_ISCSI_NODE_WR_LEN16) & M_FW_ISCSI_NODE_WR_LEN16)
1609 
1610 #define S_FW_ISCSI_NODE_WR_NODE_ATTR	7
1611 #define M_FW_ISCSI_NODE_WR_NODE_ATTR	0x1
1612 #define V_FW_ISCSI_NODE_WR_NODE_ATTR(x)	((x) << S_FW_ISCSI_NODE_WR_NODE_ATTR)
1613 #define G_FW_ISCSI_NODE_WR_NODE_ATTR(x)	\
1614     (((x) >> S_FW_ISCSI_NODE_WR_NODE_ATTR) & M_FW_ISCSI_NODE_WR_NODE_ATTR)
1615 #define F_FW_ISCSI_NODE_WR_NODE_ATTR	V_FW_ISCSI_NODE_WR_NODE_ATTR(1U)
1616 
1617 #define S_FW_ISCSI_NODE_WR_SESS_ATTR	6
1618 #define M_FW_ISCSI_NODE_WR_SESS_ATTR	0x1
1619 #define V_FW_ISCSI_NODE_WR_SESS_ATTR(x)	((x) << S_FW_ISCSI_NODE_WR_SESS_ATTR)
1620 #define G_FW_ISCSI_NODE_WR_SESS_ATTR(x)	\
1621     (((x) >> S_FW_ISCSI_NODE_WR_SESS_ATTR) & M_FW_ISCSI_NODE_WR_SESS_ATTR)
1622 #define F_FW_ISCSI_NODE_WR_SESS_ATTR	V_FW_ISCSI_NODE_WR_SESS_ATTR(1U)
1623 
1624 #define S_FW_ISCSI_NODE_WR_CONN_ATTR	5
1625 #define M_FW_ISCSI_NODE_WR_CONN_ATTR	0x1
1626 #define V_FW_ISCSI_NODE_WR_CONN_ATTR(x)	((x) << S_FW_ISCSI_NODE_WR_CONN_ATTR)
1627 #define G_FW_ISCSI_NODE_WR_CONN_ATTR(x)	\
1628     (((x) >> S_FW_ISCSI_NODE_WR_CONN_ATTR) & M_FW_ISCSI_NODE_WR_CONN_ATTR)
1629 #define F_FW_ISCSI_NODE_WR_CONN_ATTR	V_FW_ISCSI_NODE_WR_CONN_ATTR(1U)
1630 
1631 #define S_FW_ISCSI_NODE_WR_TGT_ATTR	4
1632 #define M_FW_ISCSI_NODE_WR_TGT_ATTR	0x1
1633 #define V_FW_ISCSI_NODE_WR_TGT_ATTR(x)	((x) << S_FW_ISCSI_NODE_WR_TGT_ATTR)
1634 #define G_FW_ISCSI_NODE_WR_TGT_ATTR(x)	\
1635     (((x) >> S_FW_ISCSI_NODE_WR_TGT_ATTR) & M_FW_ISCSI_NODE_WR_TGT_ATTR)
1636 #define F_FW_ISCSI_NODE_WR_TGT_ATTR	V_FW_ISCSI_NODE_WR_TGT_ATTR(1U)
1637 
1638 #define S_FW_ISCSI_NODE_WR_NODE_TYPE	3
1639 #define M_FW_ISCSI_NODE_WR_NODE_TYPE	0x1
1640 #define V_FW_ISCSI_NODE_WR_NODE_TYPE(x)	((x) << S_FW_ISCSI_NODE_WR_NODE_TYPE)
1641 #define G_FW_ISCSI_NODE_WR_NODE_TYPE(x)	\
1642     (((x) >> S_FW_ISCSI_NODE_WR_NODE_TYPE) & M_FW_ISCSI_NODE_WR_NODE_TYPE)
1643 #define F_FW_ISCSI_NODE_WR_NODE_TYPE	V_FW_ISCSI_NODE_WR_NODE_TYPE(1U)
1644 
1645 #define S_FW_ISCSI_NODE_WR_COMPL	0
1646 #define M_FW_ISCSI_NODE_WR_COMPL	0x1
1647 #define V_FW_ISCSI_NODE_WR_COMPL(x)	((x) << S_FW_ISCSI_NODE_WR_COMPL)
1648 #define G_FW_ISCSI_NODE_WR_COMPL(x)	\
1649     (((x) >> S_FW_ISCSI_NODE_WR_COMPL) & M_FW_ISCSI_NODE_WR_COMPL)
1650 #define F_FW_ISCSI_NODE_WR_COMPL	V_FW_ISCSI_NODE_WR_COMPL(1U)
1651 
1652 #define FW_ISCSI_NODE_INVALID_ID	0xffffffff
1653 
1654 struct fw_scsi_iscsi_data {
1655 	__u8   r0;
1656 	__u8   fbit_to_tattr;
1657 	__be16 r2;
1658 	__be32 r3;
1659 	__u8   lun[8];
1660 	__be32 r4;
1661 	__be32 dlen;
1662 	__be32 r5;
1663 	__be32 r6;
1664 	__u8   cdb[16];
1665 };
1666 
1667 #define S_FW_SCSI_ISCSI_DATA_FBIT	7
1668 #define M_FW_SCSI_ISCSI_DATA_FBIT	0x1
1669 #define V_FW_SCSI_ISCSI_DATA_FBIT(x)	((x) << S_FW_SCSI_ISCSI_DATA_FBIT)
1670 #define G_FW_SCSI_ISCSI_DATA_FBIT(x)	\
1671     (((x) >> S_FW_SCSI_ISCSI_DATA_FBIT) & M_FW_SCSI_ISCSI_DATA_FBIT)
1672 #define F_FW_SCSI_ISCSI_DATA_FBIT	V_FW_SCSI_ISCSI_DATA_FBIT(1U)
1673 
1674 #define S_FW_SCSI_ISCSI_DATA_RBIT	6
1675 #define M_FW_SCSI_ISCSI_DATA_RBIT	0x1
1676 #define V_FW_SCSI_ISCSI_DATA_RBIT(x)	((x) << S_FW_SCSI_ISCSI_DATA_RBIT)
1677 #define G_FW_SCSI_ISCSI_DATA_RBIT(x)	\
1678     (((x) >> S_FW_SCSI_ISCSI_DATA_RBIT) & M_FW_SCSI_ISCSI_DATA_RBIT)
1679 #define F_FW_SCSI_ISCSI_DATA_RBIT	V_FW_SCSI_ISCSI_DATA_RBIT(1U)
1680 
1681 #define S_FW_SCSI_ISCSI_DATA_WBIT	5
1682 #define M_FW_SCSI_ISCSI_DATA_WBIT	0x1
1683 #define V_FW_SCSI_ISCSI_DATA_WBIT(x)	((x) << S_FW_SCSI_ISCSI_DATA_WBIT)
1684 #define G_FW_SCSI_ISCSI_DATA_WBIT(x)	\
1685     (((x) >> S_FW_SCSI_ISCSI_DATA_WBIT) & M_FW_SCSI_ISCSI_DATA_WBIT)
1686 #define F_FW_SCSI_ISCSI_DATA_WBIT	V_FW_SCSI_ISCSI_DATA_WBIT(1U)
1687 
1688 #define S_FW_SCSI_ISCSI_DATA_TATTR	0
1689 #define M_FW_SCSI_ISCSI_DATA_TATTR	0x7
1690 #define V_FW_SCSI_ISCSI_DATA_TATTR(x)	((x) << S_FW_SCSI_ISCSI_DATA_TATTR)
1691 #define G_FW_SCSI_ISCSI_DATA_TATTR(x)	\
1692     (((x) >> S_FW_SCSI_ISCSI_DATA_TATTR) & M_FW_SCSI_ISCSI_DATA_TATTR)
1693 
1694 #define FW_SCSI_ISCSI_DATA_TATTR_UNTAGGED	0
1695 #define FW_SCSI_ISCSI_DATA_TATTR_SIMPLE		1
1696 #define	FW_SCSI_ISCSI_DATA_TATTR_ORDERED	2
1697 #define FW_SCSI_ISCSI_DATA_TATTR_HEADOQ		3
1698 #define FW_SCSI_ISCSI_DATA_TATTR_ACA		4
1699 
1700 #define FW_SCSI_ISCSI_TMF_OP			0x02
1701 #define FW_SCSI_ISCSI_ABORT_FUNC		0x01
1702 #define FW_SCSI_ISCSI_LUN_RESET_FUNC		0x05
1703 #define FW_SCSI_ISCSI_RESERVED_TAG		0xffffffff
1704 
1705 struct fw_scsi_iscsi_rsp {
1706 	__u8   r0;
1707 	__u8   sbit_to_uflow;
1708 	__u8   response;
1709 	__u8   status;
1710 	__be32 r4;
1711 	__u8   r5[32];
1712 	__be32 bidir_res_cnt;
1713 	__be32 res_cnt;
1714 	__u8   sense_data[128];
1715 };
1716 
1717 #define S_FW_SCSI_ISCSI_RSP_SBIT	7
1718 #define M_FW_SCSI_ISCSI_RSP_SBIT	0x1
1719 #define V_FW_SCSI_ISCSI_RSP_SBIT(x)	((x) << S_FW_SCSI_ISCSI_RSP_SBIT)
1720 #define G_FW_SCSI_ISCSI_RSP_SBIT(x)	\
1721     (((x) >> S_FW_SCSI_ISCSI_RSP_SBIT) & M_FW_SCSI_ISCSI_RSP_SBIT)
1722 #define F_FW_SCSI_ISCSI_RSP_SBIT	V_FW_SCSI_ISCSI_RSP_SBIT(1U)
1723 
1724 #define S_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW		4
1725 #define M_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW		0x1
1726 #define V_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW(x)	\
1727     ((x) << S_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW)
1728 #define G_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW(x)	\
1729     (((x) >> S_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW) & \
1730      M_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW)
1731 #define F_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW	V_FW_SCSI_ISCSI_RSP_BIDIR_OFLOW(1U)
1732 
1733 #define S_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW		3
1734 #define M_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW		0x1
1735 #define V_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW(x)	\
1736     ((x) << S_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW)
1737 #define G_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW(x)	\
1738     (((x) >> S_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW) & \
1739      M_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW)
1740 #define F_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW	V_FW_SCSI_ISCSI_RSP_BIDIR_UFLOW(1U)
1741 
1742 #define S_FW_SCSI_ISCSI_RSP_OFLOW	2
1743 #define M_FW_SCSI_ISCSI_RSP_OFLOW	0x1
1744 #define V_FW_SCSI_ISCSI_RSP_OFLOW(x)	((x) << S_FW_SCSI_ISCSI_RSP_OFLOW)
1745 #define G_FW_SCSI_ISCSI_RSP_OFLOW(x)	\
1746     (((x) >> S_FW_SCSI_ISCSI_RSP_OFLOW) & M_FW_SCSI_ISCSI_RSP_OFLOW)
1747 #define F_FW_SCSI_ISCSI_RSP_OFLOW	V_FW_SCSI_ISCSI_RSP_OFLOW(1U)
1748 
1749 #define S_FW_SCSI_ISCSI_RSP_UFLOW	1
1750 #define M_FW_SCSI_ISCSI_RSP_UFLOW	0x1
1751 #define V_FW_SCSI_ISCSI_RSP_UFLOW(x)	((x) << S_FW_SCSI_ISCSI_RSP_UFLOW)
1752 #define G_FW_SCSI_ISCSI_RSP_UFLOW(x)	\
1753     (((x) >> S_FW_SCSI_ISCSI_RSP_UFLOW) & M_FW_SCSI_ISCSI_RSP_UFLOW)
1754 #define F_FW_SCSI_ISCSI_RSP_UFLOW	V_FW_SCSI_ISCSI_RSP_UFLOW(1U)
1755 
1756 /******************************************************************************
1757  *  C O M M A N D s
1758  *********************/
1759 
1760 /*
1761  * The maximum length of time, in miliseconds, that we expect any firmware
1762  * command to take to execute and return a reply to the host.  The RESET
1763  * and INITIALIZE commands can take a fair amount of time to execute but
1764  * most execute in far less time than this maximum.  This constant is used
1765  * by host software to determine how long to wait for a firmware command
1766  * reply before declaring the firmware as dead/unreachable ...
1767  */
1768 #define FW_CMD_MAX_TIMEOUT	10000
1769 
1770 /*
1771  * If a host driver does a HELLO and discovers that there's already a MASTER
1772  * selected, we may have to wait for that MASTER to finish issuing RESET,
1773  * configuration and INITIALIZE commands.  Also, there's a possibility that
1774  * our own HELLO may get lost if it happens right as the MASTER is issuign a
1775  * RESET command, so we need to be willing to make a few retries of our HELLO.
1776  */
1777 #define FW_CMD_HELLO_TIMEOUT	(3 * FW_CMD_MAX_TIMEOUT)
1778 #define FW_CMD_HELLO_RETRIES	3
1779 
1780 enum fw_cmd_opcodes {
1781 	FW_LDST_CMD                    = 0x01,
1782 	FW_RESET_CMD                   = 0x03,
1783 	FW_HELLO_CMD                   = 0x04,
1784 	FW_BYE_CMD                     = 0x05,
1785 	FW_INITIALIZE_CMD              = 0x06,
1786 	FW_CAPS_CONFIG_CMD             = 0x07,
1787 	FW_PARAMS_CMD                  = 0x08,
1788 	FW_PFVF_CMD                    = 0x09,
1789 	FW_IQ_CMD                      = 0x10,
1790 	FW_EQ_MNGT_CMD                 = 0x11,
1791 	FW_EQ_ETH_CMD                  = 0x12,
1792 	FW_EQ_CTRL_CMD                 = 0x13,
1793 	FW_EQ_OFLD_CMD                 = 0x21,
1794 	FW_VI_CMD                      = 0x14,
1795 	FW_VI_MAC_CMD                  = 0x15,
1796 	FW_VI_RXMODE_CMD               = 0x16,
1797 	FW_VI_ENABLE_CMD               = 0x17,
1798 	FW_VI_STATS_CMD                = 0x1a,
1799 	FW_ACL_MAC_CMD                 = 0x18,
1800 	FW_ACL_VLAN_CMD                = 0x19,
1801 	FW_PORT_CMD                    = 0x1b,
1802 	FW_PORT_STATS_CMD              = 0x1c,
1803 	FW_PORT_LB_STATS_CMD           = 0x1d,
1804 	FW_PORT_TRACE_CMD              = 0x1e,
1805 	FW_PORT_TRACE_MMAP_CMD         = 0x1f,
1806 	FW_RSS_IND_TBL_CMD             = 0x20,
1807 	FW_RSS_GLB_CONFIG_CMD          = 0x22,
1808 	FW_RSS_VI_CONFIG_CMD           = 0x23,
1809 	FW_SCHED_CMD                   = 0x24,
1810 	FW_DEVLOG_CMD                  = 0x25,
1811 	FW_NETIF_CMD                   = 0x26,
1812 	FW_WATCHDOG_CMD                = 0x27,
1813 	FW_CLIP_CMD                    = 0x28,
1814 	FW_LASTC2E_CMD                 = 0x40,
1815 	FW_ERROR_CMD                   = 0x80,
1816 	FW_DEBUG_CMD                   = 0x81,
1817 };
1818 
1819 enum fw_cmd_cap {
1820 	FW_CMD_CAP_PF                  = 0x01,
1821 	FW_CMD_CAP_DMAQ                = 0x02,
1822 	FW_CMD_CAP_PORT                = 0x04,
1823 	FW_CMD_CAP_PORTPROMISC         = 0x08,
1824 	FW_CMD_CAP_PORTSTATS           = 0x10,
1825 	FW_CMD_CAP_VF                  = 0x80,
1826 };
1827 
1828 /*
1829  * Generic command header flit0
1830  */
1831 struct fw_cmd_hdr {
1832 	__be32 hi;
1833 	__be32 lo;
1834 };
1835 
1836 #define S_FW_CMD_OP		24
1837 #define M_FW_CMD_OP		0xff
1838 #define V_FW_CMD_OP(x)		((x) << S_FW_CMD_OP)
1839 #define G_FW_CMD_OP(x)		(((x) >> S_FW_CMD_OP) & M_FW_CMD_OP)
1840 
1841 #define S_FW_CMD_REQUEST	23
1842 #define M_FW_CMD_REQUEST	0x1
1843 #define V_FW_CMD_REQUEST(x)	((x) << S_FW_CMD_REQUEST)
1844 #define G_FW_CMD_REQUEST(x)	(((x) >> S_FW_CMD_REQUEST) & M_FW_CMD_REQUEST)
1845 #define F_FW_CMD_REQUEST	V_FW_CMD_REQUEST(1U)
1846 
1847 #define S_FW_CMD_READ		22
1848 #define M_FW_CMD_READ		0x1
1849 #define V_FW_CMD_READ(x)	((x) << S_FW_CMD_READ)
1850 #define G_FW_CMD_READ(x)	(((x) >> S_FW_CMD_READ) & M_FW_CMD_READ)
1851 #define F_FW_CMD_READ		V_FW_CMD_READ(1U)
1852 
1853 #define S_FW_CMD_WRITE		21
1854 #define M_FW_CMD_WRITE		0x1
1855 #define V_FW_CMD_WRITE(x)	((x) << S_FW_CMD_WRITE)
1856 #define G_FW_CMD_WRITE(x)	(((x) >> S_FW_CMD_WRITE) & M_FW_CMD_WRITE)
1857 #define F_FW_CMD_WRITE		V_FW_CMD_WRITE(1U)
1858 
1859 #define S_FW_CMD_EXEC		20
1860 #define M_FW_CMD_EXEC		0x1
1861 #define V_FW_CMD_EXEC(x)	((x) << S_FW_CMD_EXEC)
1862 #define G_FW_CMD_EXEC(x)	(((x) >> S_FW_CMD_EXEC) & M_FW_CMD_EXEC)
1863 #define F_FW_CMD_EXEC		V_FW_CMD_EXEC(1U)
1864 
1865 #define S_FW_CMD_RAMASK		20
1866 #define M_FW_CMD_RAMASK		0xf
1867 #define V_FW_CMD_RAMASK(x)	((x) << S_FW_CMD_RAMASK)
1868 #define G_FW_CMD_RAMASK(x)	(((x) >> S_FW_CMD_RAMASK) & M_FW_CMD_RAMASK)
1869 
1870 #define S_FW_CMD_RETVAL		8
1871 #define M_FW_CMD_RETVAL		0xff
1872 #define V_FW_CMD_RETVAL(x)	((x) << S_FW_CMD_RETVAL)
1873 #define G_FW_CMD_RETVAL(x)	(((x) >> S_FW_CMD_RETVAL) & M_FW_CMD_RETVAL)
1874 
1875 #define S_FW_CMD_LEN16		0
1876 #define M_FW_CMD_LEN16		0xff
1877 #define V_FW_CMD_LEN16(x)	((x) << S_FW_CMD_LEN16)
1878 #define G_FW_CMD_LEN16(x)	(((x) >> S_FW_CMD_LEN16) & M_FW_CMD_LEN16)
1879 
1880 #define FW_LEN16(fw_struct) V_FW_CMD_LEN16(sizeof(fw_struct) / 16)
1881 
1882 /*
1883  *	address spaces
1884  */
1885 enum fw_ldst_addrspc {
1886 	FW_LDST_ADDRSPC_FIRMWARE  = 0x0001,
1887 	FW_LDST_ADDRSPC_SGE_EGRC  = 0x0008,
1888 	FW_LDST_ADDRSPC_SGE_INGC  = 0x0009,
1889 	FW_LDST_ADDRSPC_SGE_FLMC  = 0x000a,
1890 	FW_LDST_ADDRSPC_SGE_CONMC = 0x000b,
1891 	FW_LDST_ADDRSPC_TP_PIO    = 0x0010,
1892 	FW_LDST_ADDRSPC_TP_TM_PIO = 0x0011,
1893 	FW_LDST_ADDRSPC_TP_MIB    = 0x0012,
1894 	FW_LDST_ADDRSPC_MDIO      = 0x0018,
1895 	FW_LDST_ADDRSPC_MPS       = 0x0020,
1896 	FW_LDST_ADDRSPC_FUNC      = 0x0028,
1897 	FW_LDST_ADDRSPC_FUNC_PCIE = 0x0029,
1898 	FW_LDST_ADDRSPC_FUNC_I2C  = 0x002A,
1899 };
1900 
1901 /*
1902  *	MDIO VSC8634 register access control field
1903  */
1904 enum fw_ldst_mdio_vsc8634_aid {
1905 	FW_LDST_MDIO_VS_STANDARD,
1906 	FW_LDST_MDIO_VS_EXTENDED,
1907 	FW_LDST_MDIO_VS_GPIO
1908 };
1909 
1910 enum fw_ldst_mps_fid {
1911 	FW_LDST_MPS_ATRB,
1912 	FW_LDST_MPS_RPLC
1913 };
1914 
1915 enum fw_ldst_func_access_ctl {
1916 	FW_LDST_FUNC_ACC_CTL_VIID,
1917 	FW_LDST_FUNC_ACC_CTL_FID
1918 };
1919 
1920 enum fw_ldst_func_mod_index {
1921 	FW_LDST_FUNC_MPS
1922 };
1923 
1924 struct fw_ldst_cmd {
1925 	__be32 op_to_addrspace;
1926 	__be32 cycles_to_len16;
1927 	union fw_ldst {
1928 		struct fw_ldst_addrval {
1929 			__be32 addr;
1930 			__be32 val;
1931 		} addrval;
1932 		struct fw_ldst_idctxt {
1933 			__be32 physid;
1934 			__be32 msg_ctxtflush;
1935 			__be32 ctxt_data7;
1936 			__be32 ctxt_data6;
1937 			__be32 ctxt_data5;
1938 			__be32 ctxt_data4;
1939 			__be32 ctxt_data3;
1940 			__be32 ctxt_data2;
1941 			__be32 ctxt_data1;
1942 			__be32 ctxt_data0;
1943 		} idctxt;
1944 		struct fw_ldst_mdio {
1945 			__be16 paddr_mmd;
1946 			__be16 raddr;
1947 			__be16 vctl;
1948 			__be16 rval;
1949 		} mdio;
1950 		struct fw_ldst_mps {
1951 			__be16 fid_ctl;
1952 			__be16 rplcpf_pkd;
1953 			__be32 rplc127_96;
1954 			__be32 rplc95_64;
1955 			__be32 rplc63_32;
1956 			__be32 rplc31_0;
1957 			__be32 atrb;
1958 			__be16 vlan[16];
1959 		} mps;
1960 		struct fw_ldst_func {
1961 			__u8   access_ctl;
1962 			__u8   mod_index;
1963 			__be16 ctl_id;
1964 			__be32 offset;
1965 			__be64 data0;
1966 			__be64 data1;
1967 		} func;
1968 		struct fw_ldst_pcie {
1969 			__u8   ctrl_to_fn;
1970 			__u8   bnum;
1971 			__u8   r;
1972 			__u8   ext_r;
1973 			__u8   select_naccess;
1974 			__u8   pcie_fn;
1975 			__be16 nset_pkd;
1976 			__be32 data[12];
1977 		} pcie;
1978 		struct fw_ldst_i2c {
1979 			__u8   pid_pkd;
1980 			__u8   base;
1981 			__u8   boffset;
1982 			__u8   data;
1983 			__be32 r9;
1984 		} i2c;
1985 	} u;
1986 };
1987 
1988 #define S_FW_LDST_CMD_ADDRSPACE		0
1989 #define M_FW_LDST_CMD_ADDRSPACE		0xff
1990 #define V_FW_LDST_CMD_ADDRSPACE(x)	((x) << S_FW_LDST_CMD_ADDRSPACE)
1991 #define G_FW_LDST_CMD_ADDRSPACE(x)	\
1992     (((x) >> S_FW_LDST_CMD_ADDRSPACE) & M_FW_LDST_CMD_ADDRSPACE)
1993 
1994 #define S_FW_LDST_CMD_CYCLES	16
1995 #define M_FW_LDST_CMD_CYCLES	0xffff
1996 #define V_FW_LDST_CMD_CYCLES(x)	((x) << S_FW_LDST_CMD_CYCLES)
1997 #define G_FW_LDST_CMD_CYCLES(x)	\
1998     (((x) >> S_FW_LDST_CMD_CYCLES) & M_FW_LDST_CMD_CYCLES)
1999 
2000 #define S_FW_LDST_CMD_MSG	31
2001 #define M_FW_LDST_CMD_MSG	0x1
2002 #define V_FW_LDST_CMD_MSG(x)	((x) << S_FW_LDST_CMD_MSG)
2003 #define G_FW_LDST_CMD_MSG(x)	\
2004     (((x) >> S_FW_LDST_CMD_MSG) & M_FW_LDST_CMD_MSG)
2005 #define F_FW_LDST_CMD_MSG	V_FW_LDST_CMD_MSG(1U)
2006 
2007 #define S_FW_LDST_CMD_CTXTFLUSH		30
2008 #define M_FW_LDST_CMD_CTXTFLUSH		0x1
2009 #define V_FW_LDST_CMD_CTXTFLUSH(x)	((x) << S_FW_LDST_CMD_CTXTFLUSH)
2010 #define G_FW_LDST_CMD_CTXTFLUSH(x)	\
2011     (((x) >> S_FW_LDST_CMD_CTXTFLUSH) & M_FW_LDST_CMD_CTXTFLUSH)
2012 #define F_FW_LDST_CMD_CTXTFLUSH	V_FW_LDST_CMD_CTXTFLUSH(1U)
2013 
2014 #define S_FW_LDST_CMD_PADDR	8
2015 #define M_FW_LDST_CMD_PADDR	0x1f
2016 #define V_FW_LDST_CMD_PADDR(x)	((x) << S_FW_LDST_CMD_PADDR)
2017 #define G_FW_LDST_CMD_PADDR(x)	\
2018     (((x) >> S_FW_LDST_CMD_PADDR) & M_FW_LDST_CMD_PADDR)
2019 
2020 #define S_FW_LDST_CMD_MMD	0
2021 #define M_FW_LDST_CMD_MMD	0x1f
2022 #define V_FW_LDST_CMD_MMD(x)	((x) << S_FW_LDST_CMD_MMD)
2023 #define G_FW_LDST_CMD_MMD(x)	\
2024     (((x) >> S_FW_LDST_CMD_MMD) & M_FW_LDST_CMD_MMD)
2025 
2026 #define S_FW_LDST_CMD_FID	15
2027 #define M_FW_LDST_CMD_FID	0x1
2028 #define V_FW_LDST_CMD_FID(x)	((x) << S_FW_LDST_CMD_FID)
2029 #define G_FW_LDST_CMD_FID(x)	\
2030     (((x) >> S_FW_LDST_CMD_FID) & M_FW_LDST_CMD_FID)
2031 #define F_FW_LDST_CMD_FID	V_FW_LDST_CMD_FID(1U)
2032 
2033 #define S_FW_LDST_CMD_CTL	0
2034 #define M_FW_LDST_CMD_CTL	0x7fff
2035 #define V_FW_LDST_CMD_CTL(x)	((x) << S_FW_LDST_CMD_CTL)
2036 #define G_FW_LDST_CMD_CTL(x)	\
2037     (((x) >> S_FW_LDST_CMD_CTL) & M_FW_LDST_CMD_CTL)
2038 
2039 #define S_FW_LDST_CMD_RPLCPF	0
2040 #define M_FW_LDST_CMD_RPLCPF	0xff
2041 #define V_FW_LDST_CMD_RPLCPF(x)	((x) << S_FW_LDST_CMD_RPLCPF)
2042 #define G_FW_LDST_CMD_RPLCPF(x)	\
2043     (((x) >> S_FW_LDST_CMD_RPLCPF) & M_FW_LDST_CMD_RPLCPF)
2044 
2045 #define S_FW_LDST_CMD_CTRL	7
2046 #define M_FW_LDST_CMD_CTRL	0x1
2047 #define V_FW_LDST_CMD_CTRL(x)	((x) << S_FW_LDST_CMD_CTRL)
2048 #define G_FW_LDST_CMD_CTRL(x)	\
2049     (((x) >> S_FW_LDST_CMD_CTRL) & M_FW_LDST_CMD_CTRL)
2050 #define F_FW_LDST_CMD_CTRL	V_FW_LDST_CMD_CTRL(1U)
2051 
2052 #define S_FW_LDST_CMD_LC	4
2053 #define M_FW_LDST_CMD_LC	0x1
2054 #define V_FW_LDST_CMD_LC(x)	((x) << S_FW_LDST_CMD_LC)
2055 #define G_FW_LDST_CMD_LC(x)	(((x) >> S_FW_LDST_CMD_LC) & M_FW_LDST_CMD_LC)
2056 #define F_FW_LDST_CMD_LC	V_FW_LDST_CMD_LC(1U)
2057 
2058 #define S_FW_LDST_CMD_AI	3
2059 #define M_FW_LDST_CMD_AI	0x1
2060 #define V_FW_LDST_CMD_AI(x)	((x) << S_FW_LDST_CMD_AI)
2061 #define G_FW_LDST_CMD_AI(x)	(((x) >> S_FW_LDST_CMD_AI) & M_FW_LDST_CMD_AI)
2062 #define F_FW_LDST_CMD_AI	V_FW_LDST_CMD_AI(1U)
2063 
2064 #define S_FW_LDST_CMD_FN	0
2065 #define M_FW_LDST_CMD_FN	0x7
2066 #define V_FW_LDST_CMD_FN(x)	((x) << S_FW_LDST_CMD_FN)
2067 #define G_FW_LDST_CMD_FN(x)	(((x) >> S_FW_LDST_CMD_FN) & M_FW_LDST_CMD_FN)
2068 
2069 #define S_FW_LDST_CMD_SELECT	4
2070 #define M_FW_LDST_CMD_SELECT	0xf
2071 #define V_FW_LDST_CMD_SELECT(x)	((x) << S_FW_LDST_CMD_SELECT)
2072 #define G_FW_LDST_CMD_SELECT(x)	\
2073     (((x) >> S_FW_LDST_CMD_SELECT) & M_FW_LDST_CMD_SELECT)
2074 
2075 #define S_FW_LDST_CMD_NACCESS		0
2076 #define M_FW_LDST_CMD_NACCESS		0xf
2077 #define V_FW_LDST_CMD_NACCESS(x)	((x) << S_FW_LDST_CMD_NACCESS)
2078 #define G_FW_LDST_CMD_NACCESS(x)	\
2079     (((x) >> S_FW_LDST_CMD_NACCESS) & M_FW_LDST_CMD_NACCESS)
2080 
2081 #define S_FW_LDST_CMD_NSET	14
2082 #define M_FW_LDST_CMD_NSET	0x3
2083 #define V_FW_LDST_CMD_NSET(x)	((x) << S_FW_LDST_CMD_NSET)
2084 #define G_FW_LDST_CMD_NSET(x)	\
2085     (((x) >> S_FW_LDST_CMD_NSET) & M_FW_LDST_CMD_NSET)
2086 
2087 #define S_FW_LDST_CMD_PID	6
2088 #define M_FW_LDST_CMD_PID	0x3
2089 #define V_FW_LDST_CMD_PID(x)	((x) << S_FW_LDST_CMD_PID)
2090 #define G_FW_LDST_CMD_PID(x)	\
2091     (((x) >> S_FW_LDST_CMD_PID) & M_FW_LDST_CMD_PID)
2092 
2093 struct fw_reset_cmd {
2094 	__be32 op_to_write;
2095 	__be32 retval_len16;
2096 	__be32 val;
2097 	__be32 halt_pkd;
2098 };
2099 
2100 #define S_FW_RESET_CMD_HALT	31
2101 #define M_FW_RESET_CMD_HALT	0x1
2102 #define V_FW_RESET_CMD_HALT(x)	((x) << S_FW_RESET_CMD_HALT)
2103 #define G_FW_RESET_CMD_HALT(x)	\
2104     (((x) >> S_FW_RESET_CMD_HALT) & M_FW_RESET_CMD_HALT)
2105 #define F_FW_RESET_CMD_HALT	V_FW_RESET_CMD_HALT(1U)
2106 
2107 enum {
2108 	FW_HELLO_CMD_STAGE_OS		= 0,
2109 	FW_HELLO_CMD_STAGE_PREOS0	= 1,
2110 	FW_HELLO_CMD_STAGE_PREOS1	= 2,
2111 	FW_HELLO_CMD_STAGE_POSTOS	= 3,
2112 };
2113 
2114 struct fw_hello_cmd {
2115 	__be32 op_to_write;
2116 	__be32 retval_len16;
2117 	__be32 err_to_clearinit;
2118 	__be32 fwrev;
2119 };
2120 
2121 #define S_FW_HELLO_CMD_ERR	31
2122 #define M_FW_HELLO_CMD_ERR	0x1
2123 #define V_FW_HELLO_CMD_ERR(x)	((x) << S_FW_HELLO_CMD_ERR)
2124 #define G_FW_HELLO_CMD_ERR(x)	\
2125     (((x) >> S_FW_HELLO_CMD_ERR) & M_FW_HELLO_CMD_ERR)
2126 #define F_FW_HELLO_CMD_ERR	V_FW_HELLO_CMD_ERR(1U)
2127 
2128 #define S_FW_HELLO_CMD_INIT	30
2129 #define M_FW_HELLO_CMD_INIT	0x1
2130 #define V_FW_HELLO_CMD_INIT(x)	((x) << S_FW_HELLO_CMD_INIT)
2131 #define G_FW_HELLO_CMD_INIT(x)	\
2132     (((x) >> S_FW_HELLO_CMD_INIT) & M_FW_HELLO_CMD_INIT)
2133 #define F_FW_HELLO_CMD_INIT	V_FW_HELLO_CMD_INIT(1U)
2134 
2135 #define S_FW_HELLO_CMD_MASTERDIS	29
2136 #define M_FW_HELLO_CMD_MASTERDIS	0x1
2137 #define V_FW_HELLO_CMD_MASTERDIS(x)	((x) << S_FW_HELLO_CMD_MASTERDIS)
2138 #define G_FW_HELLO_CMD_MASTERDIS(x)	\
2139     (((x) >> S_FW_HELLO_CMD_MASTERDIS) & M_FW_HELLO_CMD_MASTERDIS)
2140 #define F_FW_HELLO_CMD_MASTERDIS	V_FW_HELLO_CMD_MASTERDIS(1U)
2141 
2142 #define S_FW_HELLO_CMD_MASTERFORCE	28
2143 #define M_FW_HELLO_CMD_MASTERFORCE	0x1
2144 #define V_FW_HELLO_CMD_MASTERFORCE(x)	((x) << S_FW_HELLO_CMD_MASTERFORCE)
2145 #define G_FW_HELLO_CMD_MASTERFORCE(x)	\
2146     (((x) >> S_FW_HELLO_CMD_MASTERFORCE) & M_FW_HELLO_CMD_MASTERFORCE)
2147 #define F_FW_HELLO_CMD_MASTERFORCE	V_FW_HELLO_CMD_MASTERFORCE(1U)
2148 
2149 #define S_FW_HELLO_CMD_MBMASTER		24
2150 #define M_FW_HELLO_CMD_MBMASTER		0xf
2151 #define V_FW_HELLO_CMD_MBMASTER(x)	((x) << S_FW_HELLO_CMD_MBMASTER)
2152 #define G_FW_HELLO_CMD_MBMASTER(x)	\
2153     (((x) >> S_FW_HELLO_CMD_MBMASTER) & M_FW_HELLO_CMD_MBMASTER)
2154 
2155 #define S_FW_HELLO_CMD_MBASYNCNOTINT	23
2156 #define M_FW_HELLO_CMD_MBASYNCNOTINT	0x1
2157 #define V_FW_HELLO_CMD_MBASYNCNOTINT(x)	((x) << S_FW_HELLO_CMD_MBASYNCNOTINT)
2158 #define G_FW_HELLO_CMD_MBASYNCNOTINT(x)	\
2159     (((x) >> S_FW_HELLO_CMD_MBASYNCNOTINT) & M_FW_HELLO_CMD_MBASYNCNOTINT)
2160 #define F_FW_HELLO_CMD_MBASYNCNOTINT	V_FW_HELLO_CMD_MBASYNCNOTINT(1U)
2161 
2162 #define S_FW_HELLO_CMD_MBASYNCNOT	20
2163 #define M_FW_HELLO_CMD_MBASYNCNOT	0x7
2164 #define V_FW_HELLO_CMD_MBASYNCNOT(x)	((x) << S_FW_HELLO_CMD_MBASYNCNOT)
2165 #define G_FW_HELLO_CMD_MBASYNCNOT(x)	\
2166     (((x) >> S_FW_HELLO_CMD_MBASYNCNOT) & M_FW_HELLO_CMD_MBASYNCNOT)
2167 
2168 #define S_FW_HELLO_CMD_STAGE	17
2169 #define M_FW_HELLO_CMD_STAGE	0x7
2170 #define V_FW_HELLO_CMD_STAGE(x)	((x) << S_FW_HELLO_CMD_STAGE)
2171 #define G_FW_HELLO_CMD_STAGE(x)	\
2172     (((x) >> S_FW_HELLO_CMD_STAGE) & M_FW_HELLO_CMD_STAGE)
2173 
2174 #define S_FW_HELLO_CMD_CLEARINIT	16
2175 #define M_FW_HELLO_CMD_CLEARINIT	0x1
2176 #define V_FW_HELLO_CMD_CLEARINIT(x)	((x) << S_FW_HELLO_CMD_CLEARINIT)
2177 #define G_FW_HELLO_CMD_CLEARINIT(x)	\
2178     (((x) >> S_FW_HELLO_CMD_CLEARINIT) & M_FW_HELLO_CMD_CLEARINIT)
2179 #define F_FW_HELLO_CMD_CLEARINIT	V_FW_HELLO_CMD_CLEARINIT(1U)
2180 
2181 struct fw_bye_cmd {
2182 	__be32 op_to_write;
2183 	__be32 retval_len16;
2184 	__be64 r3;
2185 };
2186 
2187 struct fw_initialize_cmd {
2188 	__be32 op_to_write;
2189 	__be32 retval_len16;
2190 	__be64 r3;
2191 };
2192 
2193 enum fw_caps_config_hm {
2194 	FW_CAPS_CONFIG_HM_PCIE		= 0x00000001,
2195 	FW_CAPS_CONFIG_HM_PL		= 0x00000002,
2196 	FW_CAPS_CONFIG_HM_SGE		= 0x00000004,
2197 	FW_CAPS_CONFIG_HM_CIM		= 0x00000008,
2198 	FW_CAPS_CONFIG_HM_ULPTX		= 0x00000010,
2199 	FW_CAPS_CONFIG_HM_TP		= 0x00000020,
2200 	FW_CAPS_CONFIG_HM_ULPRX		= 0x00000040,
2201 	FW_CAPS_CONFIG_HM_PMRX		= 0x00000080,
2202 	FW_CAPS_CONFIG_HM_PMTX		= 0x00000100,
2203 	FW_CAPS_CONFIG_HM_MC		= 0x00000200,
2204 	FW_CAPS_CONFIG_HM_LE		= 0x00000400,
2205 	FW_CAPS_CONFIG_HM_MPS		= 0x00000800,
2206 	FW_CAPS_CONFIG_HM_XGMAC		= 0x00001000,
2207 	FW_CAPS_CONFIG_HM_CPLSWITCH	= 0x00002000,
2208 	FW_CAPS_CONFIG_HM_T4DBG		= 0x00004000,
2209 	FW_CAPS_CONFIG_HM_MI		= 0x00008000,
2210 	FW_CAPS_CONFIG_HM_I2CM		= 0x00010000,
2211 	FW_CAPS_CONFIG_HM_NCSI		= 0x00020000,
2212 	FW_CAPS_CONFIG_HM_SMB		= 0x00040000,
2213 	FW_CAPS_CONFIG_HM_MA		= 0x00080000,
2214 	FW_CAPS_CONFIG_HM_EDRAM		= 0x00100000,
2215 	FW_CAPS_CONFIG_HM_PMU		= 0x00200000,
2216 	FW_CAPS_CONFIG_HM_UART		= 0x00400000,
2217 	FW_CAPS_CONFIG_HM_SF		= 0x00800000,
2218 };
2219 
2220 /*
2221  * The VF Register Map.
2222  *
2223  * The Scatter Gather Engine (SGE), Multiport Support module (MPS), PIO Local
2224  * bus module (PL) and CPU Interface Module (CIM) components are mapped via
2225  * the Slice to Module Map Table (see below) in the Physical Function Register
2226  * Map.  The Mail Box Data (MBDATA) range is mapped via the PCI-E Mailbox Base
2227  * and Offset registers in the PF Register Map.  The MBDATA base address is
2228  * quite constrained as it determines the Mailbox Data addresses for both PFs
2229  * and VFs, and therefore must fit in both the VF and PF Register Maps without
2230  * overlapping other registers.
2231  */
2232 #define FW_T4VF_SGE_BASE_ADDR      0x0000
2233 #define FW_T4VF_MPS_BASE_ADDR      0x0100
2234 #define FW_T4VF_PL_BASE_ADDR       0x0200
2235 #define FW_T4VF_MBDATA_BASE_ADDR   0x0240
2236 #define FW_T4VF_CIM_BASE_ADDR      0x0300
2237 
2238 #define FW_T4VF_REGMAP_START       0x0000
2239 #define FW_T4VF_REGMAP_SIZE        0x0400
2240 
2241 enum fw_caps_config_nbm {
2242 	FW_CAPS_CONFIG_NBM_IPMI		= 0x00000001,
2243 	FW_CAPS_CONFIG_NBM_NCSI		= 0x00000002,
2244 };
2245 
2246 enum fw_caps_config_link {
2247 	FW_CAPS_CONFIG_LINK_PPP		= 0x00000001,
2248 	FW_CAPS_CONFIG_LINK_QFC		= 0x00000002,
2249 	FW_CAPS_CONFIG_LINK_DCBX	= 0x00000004,
2250 };
2251 
2252 enum fw_caps_config_switch {
2253 	FW_CAPS_CONFIG_SWITCH_INGRESS	= 0x00000001,
2254 	FW_CAPS_CONFIG_SWITCH_EGRESS	= 0x00000002,
2255 };
2256 
2257 enum fw_caps_config_nic {
2258 	FW_CAPS_CONFIG_NIC		= 0x00000001,
2259 	FW_CAPS_CONFIG_NIC_VM		= 0x00000002,
2260 	FW_CAPS_CONFIG_NIC_IDS		= 0x00000004,
2261 	FW_CAPS_CONFIG_NIC_UM		= 0x00000008,
2262 	FW_CAPS_CONFIG_NIC_UM_ISGL	= 0x00000010,
2263 };
2264 
2265 enum fw_caps_config_toe {
2266 	FW_CAPS_CONFIG_TOE		= 0x00000001,
2267 };
2268 
2269 enum fw_caps_config_rdma {
2270 	FW_CAPS_CONFIG_RDMA_RDDP	= 0x00000001,
2271 	FW_CAPS_CONFIG_RDMA_RDMAC	= 0x00000002,
2272 };
2273 
2274 enum fw_caps_config_iscsi {
2275 	FW_CAPS_CONFIG_ISCSI_INITIATOR_PDU = 0x00000001,
2276 	FW_CAPS_CONFIG_ISCSI_TARGET_PDU = 0x00000002,
2277 	FW_CAPS_CONFIG_ISCSI_INITIATOR_CNXOFLD = 0x00000004,
2278 	FW_CAPS_CONFIG_ISCSI_TARGET_CNXOFLD = 0x00000008,
2279 	FW_CAPS_CONFIG_ISCSI_INITIATOR_SSNOFLD = 0x00000010,
2280 	FW_CAPS_CONFIG_ISCSI_TARGET_SSNOFLD = 0x00000020,
2281 };
2282 
2283 enum fw_caps_config_fcoe {
2284 	FW_CAPS_CONFIG_FCOE_INITIATOR	= 0x00000001,
2285 	FW_CAPS_CONFIG_FCOE_TARGET	= 0x00000002,
2286 	FW_CAPS_CONFIG_FCOE_CTRL_OFLD   = 0x00000004,
2287 };
2288 
2289 enum fw_memtype_cf {
2290 	FW_MEMTYPE_CF_EDC0		= 0x0,
2291 	FW_MEMTYPE_CF_EDC1		= 0x1,
2292 	FW_MEMTYPE_CF_EXTMEM		= 0x2,
2293 	FW_MEMTYPE_CF_FLASH		= 0x4,
2294 };
2295 
2296 struct fw_caps_config_cmd {
2297 	__be32 op_to_write;
2298 	__be32 cfvalid_to_len16;
2299 	__be32 r2;
2300 	__be32 hwmbitmap;
2301 	__be16 nbmcaps;
2302 	__be16 linkcaps;
2303 	__be16 switchcaps;
2304 	__be16 r3;
2305 	__be16 niccaps;
2306 	__be16 toecaps;
2307 	__be16 rdmacaps;
2308 	__be16 r4;
2309 	__be16 iscsicaps;
2310 	__be16 fcoecaps;
2311 	__be32 cfcsum;
2312 	__be32 finiver;
2313 	__be32 finicsum;
2314 };
2315 
2316 #define S_FW_CAPS_CONFIG_CMD_CFVALID	27
2317 #define M_FW_CAPS_CONFIG_CMD_CFVALID	0x1
2318 #define V_FW_CAPS_CONFIG_CMD_CFVALID(x)	((x) << S_FW_CAPS_CONFIG_CMD_CFVALID)
2319 #define G_FW_CAPS_CONFIG_CMD_CFVALID(x)	\
2320     (((x) >> S_FW_CAPS_CONFIG_CMD_CFVALID) & M_FW_CAPS_CONFIG_CMD_CFVALID)
2321 #define F_FW_CAPS_CONFIG_CMD_CFVALID	V_FW_CAPS_CONFIG_CMD_CFVALID(1U)
2322 
2323 #define S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF		24
2324 #define M_FW_CAPS_CONFIG_CMD_MEMTYPE_CF		0x7
2325 #define V_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(x)	\
2326     ((x) << S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF)
2327 #define G_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(x)	\
2328     (((x) >> S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF) & \
2329      M_FW_CAPS_CONFIG_CMD_MEMTYPE_CF)
2330 
2331 #define S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF	16
2332 #define M_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF	0xff
2333 #define V_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(x)	\
2334     ((x) << S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF)
2335 #define G_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(x)	\
2336     (((x) >> S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF) & \
2337      M_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF)
2338 
2339 /*
2340  * params command mnemonics
2341  */
2342 enum fw_params_mnem {
2343 	FW_PARAMS_MNEM_DEV		= 1,	/* device params */
2344 	FW_PARAMS_MNEM_PFVF		= 2,	/* function params */
2345 	FW_PARAMS_MNEM_REG		= 3,	/* limited register access */
2346 	FW_PARAMS_MNEM_DMAQ		= 4,	/* dma queue params */
2347 	FW_PARAMS_MNEM_LAST
2348 };
2349 
2350 /*
2351  * device parameters
2352  */
2353 enum fw_params_param_dev {
2354 	FW_PARAMS_PARAM_DEV_CCLK	= 0x00, /* chip core clock in khz */
2355 	FW_PARAMS_PARAM_DEV_PORTVEC	= 0x01, /* the port vector */
2356 	FW_PARAMS_PARAM_DEV_NTID	= 0x02, /* reads the number of TIDs
2357 						 * allocated by the device's
2358 						 * Lookup Engine
2359 						 */
2360 	FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ = 0x03,
2361 	FW_PARAMS_PARAM_DEV_INTFVER_NIC	= 0x04,
2362 	FW_PARAMS_PARAM_DEV_INTFVER_VNIC = 0x05,
2363 	FW_PARAMS_PARAM_DEV_INTFVER_OFLD = 0x06,
2364 	FW_PARAMS_PARAM_DEV_INTFVER_RI	= 0x07,
2365 	FW_PARAMS_PARAM_DEV_INTFVER_ISCSIPDU = 0x08,
2366 	FW_PARAMS_PARAM_DEV_INTFVER_ISCSI = 0x09,
2367 	FW_PARAMS_PARAM_DEV_INTFVER_FCOE = 0x0A,
2368 	FW_PARAMS_PARAM_DEV_FWREV = 0x0B,
2369 	FW_PARAMS_PARAM_DEV_TPREV = 0x0C,
2370 	FW_PARAMS_PARAM_DEV_CF = 0x0D,
2371 	FW_PARAMS_PARAM_DEV_BYPASS = 0x0E,
2372 };
2373 
2374 /*
2375  * physical and virtual function parameters
2376  */
2377 enum fw_params_param_pfvf {
2378 	FW_PARAMS_PARAM_PFVF_RWXCAPS	= 0x00,
2379 	FW_PARAMS_PARAM_PFVF_ROUTE_START = 0x01,
2380 	FW_PARAMS_PARAM_PFVF_ROUTE_END = 0x02,
2381 	FW_PARAMS_PARAM_PFVF_CLIP_START = 0x03,
2382 	FW_PARAMS_PARAM_PFVF_CLIP_END = 0x04,
2383 	FW_PARAMS_PARAM_PFVF_FILTER_START = 0x05,
2384 	FW_PARAMS_PARAM_PFVF_FILTER_END = 0x06,
2385 	FW_PARAMS_PARAM_PFVF_SERVER_START = 0x07,
2386 	FW_PARAMS_PARAM_PFVF_SERVER_END = 0x08,
2387 	FW_PARAMS_PARAM_PFVF_TDDP_START = 0x09,
2388 	FW_PARAMS_PARAM_PFVF_TDDP_END = 0x0A,
2389 	FW_PARAMS_PARAM_PFVF_ISCSI_START = 0x0B,
2390 	FW_PARAMS_PARAM_PFVF_ISCSI_END = 0x0C,
2391 	FW_PARAMS_PARAM_PFVF_STAG_START = 0x0D,
2392 	FW_PARAMS_PARAM_PFVF_STAG_END = 0x0E,
2393 	FW_PARAMS_PARAM_PFVF_RQ_START = 0x1F,
2394 	FW_PARAMS_PARAM_PFVF_RQ_END	= 0x10,
2395 	FW_PARAMS_PARAM_PFVF_PBL_START = 0x11,
2396 	FW_PARAMS_PARAM_PFVF_PBL_END	= 0x12,
2397 	FW_PARAMS_PARAM_PFVF_L2T_START = 0x13,
2398 	FW_PARAMS_PARAM_PFVF_L2T_END = 0x14,
2399 	FW_PARAMS_PARAM_PFVF_SQRQ_START = 0x15,
2400 	FW_PARAMS_PARAM_PFVF_SQRQ_END	= 0x16,
2401 	FW_PARAMS_PARAM_PFVF_CQ_START	= 0x17,
2402 	FW_PARAMS_PARAM_PFVF_CQ_END	= 0x18,
2403 	FW_PARAMS_PARAM_PFVF_SCHEDCLASS_ETH = 0x20,
2404 	FW_PARAMS_PARAM_PFVF_VIID	= 0x24,
2405 	FW_PARAMS_PARAM_PFVF_CPMASK	= 0x25,
2406 	FW_PARAMS_PARAM_PFVF_OCQ_START	= 0x26,
2407 	FW_PARAMS_PARAM_PFVF_OCQ_END	= 0x27,
2408 	FW_PARAMS_PARAM_PFVF_CONM_MAP   = 0x28,
2409 	FW_PARAMS_PARAM_PFVF_IQFLINT_START = 0x29,
2410 	FW_PARAMS_PARAM_PFVF_IQFLINT_END = 0x2A,
2411 	FW_PARAMS_PARAM_PFVF_EQ_START	= 0x2B,
2412 	FW_PARAMS_PARAM_PFVF_EQ_END	= 0x2C
2413 };
2414 
2415 /*
2416  * dma queue parameters
2417  */
2418 enum fw_params_param_dmaq {
2419 	FW_PARAMS_PARAM_DMAQ_IQ_DCAEN_DCACPU = 0x00,
2420 	FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01,
2421 	FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_MNGT = 0x10,
2422 	FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_CTRL = 0x11,
2423 	FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH = 0x12,
2424 };
2425 
2426 /*
2427  * dev bypass parameters; actions and modes
2428  */
2429 enum fw_params_param_dev_bypass {
2430 
2431 	/* actions
2432 	 */
2433 	FW_PARAMS_PARAM_DEV_BYPASS_PFAIL = 0x00,
2434 	FW_PARAMS_PARAM_DEV_BYPASS_CURRENT = 0x01,
2435 
2436 	/* modes
2437 	 */
2438 	FW_PARAMS_PARAM_DEV_BYPASS_NORMAL = 0x00,
2439 	FW_PARAMS_PARAM_DEV_BYPASS_DROP	= 0x1,
2440 	FW_PARAMS_PARAM_DEV_BYPASS_BYPASS = 0x2,
2441 };
2442 
2443 #define S_FW_PARAMS_MNEM	24
2444 #define M_FW_PARAMS_MNEM	0xff
2445 #define V_FW_PARAMS_MNEM(x)	((x) << S_FW_PARAMS_MNEM)
2446 #define G_FW_PARAMS_MNEM(x)	\
2447     (((x) >> S_FW_PARAMS_MNEM) & M_FW_PARAMS_MNEM)
2448 
2449 #define S_FW_PARAMS_PARAM_X	16
2450 #define M_FW_PARAMS_PARAM_X	0xff
2451 #define V_FW_PARAMS_PARAM_X(x) ((x) << S_FW_PARAMS_PARAM_X)
2452 #define G_FW_PARAMS_PARAM_X(x) \
2453     (((x) >> S_FW_PARAMS_PARAM_X) & M_FW_PARAMS_PARAM_X)
2454 
2455 #define S_FW_PARAMS_PARAM_Y	8
2456 #define M_FW_PARAMS_PARAM_Y	0xff
2457 #define V_FW_PARAMS_PARAM_Y(x) ((x) << S_FW_PARAMS_PARAM_Y)
2458 #define G_FW_PARAMS_PARAM_Y(x) \
2459     (((x) >> S_FW_PARAMS_PARAM_Y) & M_FW_PARAMS_PARAM_Y)
2460 
2461 #define S_FW_PARAMS_PARAM_Z	0
2462 #define M_FW_PARAMS_PARAM_Z	0xff
2463 #define V_FW_PARAMS_PARAM_Z(x) ((x) << S_FW_PARAMS_PARAM_Z)
2464 #define G_FW_PARAMS_PARAM_Z(x) \
2465     (((x) >> S_FW_PARAMS_PARAM_Z) & M_FW_PARAMS_PARAM_Z)
2466 
2467 #define S_FW_PARAMS_PARAM_XYZ	0
2468 #define M_FW_PARAMS_PARAM_XYZ	0xffffff
2469 #define V_FW_PARAMS_PARAM_XYZ(x) ((x) << S_FW_PARAMS_PARAM_XYZ)
2470 #define G_FW_PARAMS_PARAM_XYZ(x) \
2471     (((x) >> S_FW_PARAMS_PARAM_XYZ) & M_FW_PARAMS_PARAM_XYZ)
2472 
2473 #define S_FW_PARAMS_PARAM_YZ	0
2474 #define M_FW_PARAMS_PARAM_YZ	0xffff
2475 #define V_FW_PARAMS_PARAM_YZ(x) ((x) << S_FW_PARAMS_PARAM_YZ)
2476 #define G_FW_PARAMS_PARAM_YZ(x) \
2477     (((x) >> S_FW_PARAMS_PARAM_YZ) & M_FW_PARAMS_PARAM_YZ)
2478 
2479 struct fw_params_cmd {
2480 	__be32 op_to_vfn;
2481 	__be32 retval_len16;
2482 	struct fw_params_param {
2483 		__be32 mnem;
2484 		__be32 val;
2485 	} param[7];
2486 };
2487 
2488 #define S_FW_PARAMS_CMD_PFN	8
2489 #define M_FW_PARAMS_CMD_PFN	0x7
2490 #define V_FW_PARAMS_CMD_PFN(x)	((x) << S_FW_PARAMS_CMD_PFN)
2491 #define G_FW_PARAMS_CMD_PFN(x)	\
2492     (((x) >> S_FW_PARAMS_CMD_PFN) & M_FW_PARAMS_CMD_PFN)
2493 
2494 #define S_FW_PARAMS_CMD_VFN	0
2495 #define M_FW_PARAMS_CMD_VFN	0xff
2496 #define V_FW_PARAMS_CMD_VFN(x)	((x) << S_FW_PARAMS_CMD_VFN)
2497 #define G_FW_PARAMS_CMD_VFN(x)	\
2498     (((x) >> S_FW_PARAMS_CMD_VFN) & M_FW_PARAMS_CMD_VFN)
2499 
2500 struct fw_pfvf_cmd {
2501 	__be32 op_to_vfn;
2502 	__be32 retval_len16;
2503 	__be32 niqflint_niq;
2504 	__be32 type_to_neq;
2505 	__be32 tc_to_nexactf;
2506 	__be32 r_caps_to_nethctrl;
2507 	__be16 nricq;
2508 	__be16 nriqp;
2509 	__be32 r4;
2510 };
2511 
2512 #define S_FW_PFVF_CMD_PFN	8
2513 #define M_FW_PFVF_CMD_PFN	0x7
2514 #define V_FW_PFVF_CMD_PFN(x)	((x) << S_FW_PFVF_CMD_PFN)
2515 #define G_FW_PFVF_CMD_PFN(x)	\
2516     (((x) >> S_FW_PFVF_CMD_PFN) & M_FW_PFVF_CMD_PFN)
2517 
2518 #define S_FW_PFVF_CMD_VFN	0
2519 #define M_FW_PFVF_CMD_VFN	0xff
2520 #define V_FW_PFVF_CMD_VFN(x)	((x) << S_FW_PFVF_CMD_VFN)
2521 #define G_FW_PFVF_CMD_VFN(x)	\
2522     (((x) >> S_FW_PFVF_CMD_VFN) & M_FW_PFVF_CMD_VFN)
2523 
2524 #define S_FW_PFVF_CMD_NIQFLINT		20
2525 #define M_FW_PFVF_CMD_NIQFLINT		0xfff
2526 #define V_FW_PFVF_CMD_NIQFLINT(x)	((x) << S_FW_PFVF_CMD_NIQFLINT)
2527 #define G_FW_PFVF_CMD_NIQFLINT(x)	\
2528     (((x) >> S_FW_PFVF_CMD_NIQFLINT) & M_FW_PFVF_CMD_NIQFLINT)
2529 
2530 #define S_FW_PFVF_CMD_NIQ	0
2531 #define M_FW_PFVF_CMD_NIQ	0xfffff
2532 #define V_FW_PFVF_CMD_NIQ(x)	((x) << S_FW_PFVF_CMD_NIQ)
2533 #define G_FW_PFVF_CMD_NIQ(x)	\
2534     (((x) >> S_FW_PFVF_CMD_NIQ) & M_FW_PFVF_CMD_NIQ)
2535 
2536 #define S_FW_PFVF_CMD_TYPE	31
2537 #define M_FW_PFVF_CMD_TYPE	0x1
2538 #define V_FW_PFVF_CMD_TYPE(x)	((x) << S_FW_PFVF_CMD_TYPE)
2539 #define G_FW_PFVF_CMD_TYPE(x)	\
2540     (((x) >> S_FW_PFVF_CMD_TYPE) & M_FW_PFVF_CMD_TYPE)
2541 #define F_FW_PFVF_CMD_TYPE	V_FW_PFVF_CMD_TYPE(1U)
2542 
2543 #define S_FW_PFVF_CMD_CMASK	24
2544 #define M_FW_PFVF_CMD_CMASK	0xf
2545 #define V_FW_PFVF_CMD_CMASK(x)	((x) << S_FW_PFVF_CMD_CMASK)
2546 #define G_FW_PFVF_CMD_CMASK(x)	\
2547     (((x) >> S_FW_PFVF_CMD_CMASK) & M_FW_PFVF_CMD_CMASK)
2548 
2549 #define S_FW_PFVF_CMD_PMASK	20
2550 #define M_FW_PFVF_CMD_PMASK	0xf
2551 #define V_FW_PFVF_CMD_PMASK(x)	((x) << S_FW_PFVF_CMD_PMASK)
2552 #define G_FW_PFVF_CMD_PMASK(x)	\
2553     (((x) >> S_FW_PFVF_CMD_PMASK) & M_FW_PFVF_CMD_PMASK)
2554 
2555 #define S_FW_PFVF_CMD_NEQ	0
2556 #define M_FW_PFVF_CMD_NEQ	0xfffff
2557 #define V_FW_PFVF_CMD_NEQ(x)	((x) << S_FW_PFVF_CMD_NEQ)
2558 #define G_FW_PFVF_CMD_NEQ(x)	\
2559     (((x) >> S_FW_PFVF_CMD_NEQ) & M_FW_PFVF_CMD_NEQ)
2560 
2561 #define S_FW_PFVF_CMD_TC	24
2562 #define M_FW_PFVF_CMD_TC	0xff
2563 #define V_FW_PFVF_CMD_TC(x)	((x) << S_FW_PFVF_CMD_TC)
2564 #define G_FW_PFVF_CMD_TC(x)	(((x) >> S_FW_PFVF_CMD_TC) & M_FW_PFVF_CMD_TC)
2565 
2566 #define S_FW_PFVF_CMD_NVI	16
2567 #define M_FW_PFVF_CMD_NVI	0xff
2568 #define V_FW_PFVF_CMD_NVI(x)	((x) << S_FW_PFVF_CMD_NVI)
2569 #define G_FW_PFVF_CMD_NVI(x)	\
2570     (((x) >> S_FW_PFVF_CMD_NVI) & M_FW_PFVF_CMD_NVI)
2571 
2572 #define S_FW_PFVF_CMD_NEXACTF		0
2573 #define M_FW_PFVF_CMD_NEXACTF		0xffff
2574 #define V_FW_PFVF_CMD_NEXACTF(x)	((x) << S_FW_PFVF_CMD_NEXACTF)
2575 #define G_FW_PFVF_CMD_NEXACTF(x)	\
2576     (((x) >> S_FW_PFVF_CMD_NEXACTF) & M_FW_PFVF_CMD_NEXACTF)
2577 
2578 #define S_FW_PFVF_CMD_R_CAPS	24
2579 #define M_FW_PFVF_CMD_R_CAPS	0xff
2580 #define V_FW_PFVF_CMD_R_CAPS(x)	((x) << S_FW_PFVF_CMD_R_CAPS)
2581 #define G_FW_PFVF_CMD_R_CAPS(x)	\
2582     (((x) >> S_FW_PFVF_CMD_R_CAPS) & M_FW_PFVF_CMD_R_CAPS)
2583 
2584 #define S_FW_PFVF_CMD_WX_CAPS		16
2585 #define M_FW_PFVF_CMD_WX_CAPS		0xff
2586 #define V_FW_PFVF_CMD_WX_CAPS(x)	((x) << S_FW_PFVF_CMD_WX_CAPS)
2587 #define G_FW_PFVF_CMD_WX_CAPS(x)	\
2588     (((x) >> S_FW_PFVF_CMD_WX_CAPS) & M_FW_PFVF_CMD_WX_CAPS)
2589 
2590 #define S_FW_PFVF_CMD_NETHCTRL		0
2591 #define M_FW_PFVF_CMD_NETHCTRL		0xffff
2592 #define V_FW_PFVF_CMD_NETHCTRL(x)	((x) << S_FW_PFVF_CMD_NETHCTRL)
2593 #define G_FW_PFVF_CMD_NETHCTRL(x)	\
2594     (((x) >> S_FW_PFVF_CMD_NETHCTRL) & M_FW_PFVF_CMD_NETHCTRL)
2595 
2596 /*
2597  *	ingress queue type; the first 1K ingress queues can have associated 0,
2598  *	1 or 2 free lists and an interrupt, all other ingress queues lack these
2599  *	capabilities
2600  */
2601 enum fw_iq_type {
2602 	FW_IQ_TYPE_FL_INT_CAP,
2603 	FW_IQ_TYPE_NO_FL_INT_CAP
2604 };
2605 
2606 struct fw_iq_cmd {
2607 	__be32 op_to_vfn;
2608 	__be32 alloc_to_len16;
2609 	__be16 physiqid;
2610 	__be16 iqid;
2611 	__be16 fl0id;
2612 	__be16 fl1id;
2613 	__be32 type_to_iqandstindex;
2614 	__be16 iqdroprss_to_iqesize;
2615 	__be16 iqsize;
2616 	__be64 iqaddr;
2617 	__be32 iqns_to_fl0congen;
2618 	__be16 fl0dcaen_to_fl0cidxfthresh;
2619 	__be16 fl0size;
2620 	__be64 fl0addr;
2621 	__be32 fl1cngchmap_to_fl1congen;
2622 	__be16 fl1dcaen_to_fl1cidxfthresh;
2623 	__be16 fl1size;
2624 	__be64 fl1addr;
2625 };
2626 
2627 #define S_FW_IQ_CMD_PFN		8
2628 #define M_FW_IQ_CMD_PFN		0x7
2629 #define V_FW_IQ_CMD_PFN(x)	((x) << S_FW_IQ_CMD_PFN)
2630 #define G_FW_IQ_CMD_PFN(x)	(((x) >> S_FW_IQ_CMD_PFN) & M_FW_IQ_CMD_PFN)
2631 
2632 #define S_FW_IQ_CMD_VFN		0
2633 #define M_FW_IQ_CMD_VFN		0xff
2634 #define V_FW_IQ_CMD_VFN(x)	((x) << S_FW_IQ_CMD_VFN)
2635 #define G_FW_IQ_CMD_VFN(x)	(((x) >> S_FW_IQ_CMD_VFN) & M_FW_IQ_CMD_VFN)
2636 
2637 #define S_FW_IQ_CMD_ALLOC	31
2638 #define M_FW_IQ_CMD_ALLOC	0x1
2639 #define V_FW_IQ_CMD_ALLOC(x)	((x) << S_FW_IQ_CMD_ALLOC)
2640 #define G_FW_IQ_CMD_ALLOC(x)	\
2641     (((x) >> S_FW_IQ_CMD_ALLOC) & M_FW_IQ_CMD_ALLOC)
2642 #define F_FW_IQ_CMD_ALLOC	V_FW_IQ_CMD_ALLOC(1U)
2643 
2644 #define S_FW_IQ_CMD_FREE	30
2645 #define M_FW_IQ_CMD_FREE	0x1
2646 #define V_FW_IQ_CMD_FREE(x)	((x) << S_FW_IQ_CMD_FREE)
2647 #define G_FW_IQ_CMD_FREE(x)	(((x) >> S_FW_IQ_CMD_FREE) & M_FW_IQ_CMD_FREE)
2648 #define F_FW_IQ_CMD_FREE	V_FW_IQ_CMD_FREE(1U)
2649 
2650 #define S_FW_IQ_CMD_MODIFY	29
2651 #define M_FW_IQ_CMD_MODIFY	0x1
2652 #define V_FW_IQ_CMD_MODIFY(x)	((x) << S_FW_IQ_CMD_MODIFY)
2653 #define G_FW_IQ_CMD_MODIFY(x)	\
2654     (((x) >> S_FW_IQ_CMD_MODIFY) & M_FW_IQ_CMD_MODIFY)
2655 #define F_FW_IQ_CMD_MODIFY	V_FW_IQ_CMD_MODIFY(1U)
2656 
2657 #define S_FW_IQ_CMD_IQSTART	28
2658 #define M_FW_IQ_CMD_IQSTART	0x1
2659 #define V_FW_IQ_CMD_IQSTART(x)	((x) << S_FW_IQ_CMD_IQSTART)
2660 #define G_FW_IQ_CMD_IQSTART(x)	\
2661     (((x) >> S_FW_IQ_CMD_IQSTART) & M_FW_IQ_CMD_IQSTART)
2662 #define F_FW_IQ_CMD_IQSTART	V_FW_IQ_CMD_IQSTART(1U)
2663 
2664 #define S_FW_IQ_CMD_IQSTOP	27
2665 #define M_FW_IQ_CMD_IQSTOP	0x1
2666 #define V_FW_IQ_CMD_IQSTOP(x)	((x) << S_FW_IQ_CMD_IQSTOP)
2667 #define G_FW_IQ_CMD_IQSTOP(x)	\
2668     (((x) >> S_FW_IQ_CMD_IQSTOP) & M_FW_IQ_CMD_IQSTOP)
2669 #define F_FW_IQ_CMD_IQSTOP	V_FW_IQ_CMD_IQSTOP(1U)
2670 
2671 #define S_FW_IQ_CMD_TYPE	29
2672 #define M_FW_IQ_CMD_TYPE	0x7
2673 #define V_FW_IQ_CMD_TYPE(x)	((x) << S_FW_IQ_CMD_TYPE)
2674 #define G_FW_IQ_CMD_TYPE(x)	(((x) >> S_FW_IQ_CMD_TYPE) & M_FW_IQ_CMD_TYPE)
2675 
2676 #define S_FW_IQ_CMD_IQASYNCH	28
2677 #define M_FW_IQ_CMD_IQASYNCH	0x1
2678 #define V_FW_IQ_CMD_IQASYNCH(x)	((x) << S_FW_IQ_CMD_IQASYNCH)
2679 #define G_FW_IQ_CMD_IQASYNCH(x)	\
2680     (((x) >> S_FW_IQ_CMD_IQASYNCH) & M_FW_IQ_CMD_IQASYNCH)
2681 #define F_FW_IQ_CMD_IQASYNCH	V_FW_IQ_CMD_IQASYNCH(1U)
2682 
2683 #define S_FW_IQ_CMD_VIID	16
2684 #define M_FW_IQ_CMD_VIID	0xfff
2685 #define V_FW_IQ_CMD_VIID(x)	((x) << S_FW_IQ_CMD_VIID)
2686 #define G_FW_IQ_CMD_VIID(x)	(((x) >> S_FW_IQ_CMD_VIID) & M_FW_IQ_CMD_VIID)
2687 
2688 #define S_FW_IQ_CMD_IQANDST	15
2689 #define M_FW_IQ_CMD_IQANDST	0x1
2690 #define V_FW_IQ_CMD_IQANDST(x)	((x) << S_FW_IQ_CMD_IQANDST)
2691 #define G_FW_IQ_CMD_IQANDST(x)	\
2692     (((x) >> S_FW_IQ_CMD_IQANDST) & M_FW_IQ_CMD_IQANDST)
2693 #define F_FW_IQ_CMD_IQANDST	V_FW_IQ_CMD_IQANDST(1U)
2694 
2695 #define S_FW_IQ_CMD_IQANUS	14
2696 #define M_FW_IQ_CMD_IQANUS	0x1
2697 #define V_FW_IQ_CMD_IQANUS(x)	((x) << S_FW_IQ_CMD_IQANUS)
2698 #define G_FW_IQ_CMD_IQANUS(x)	\
2699     (((x) >> S_FW_IQ_CMD_IQANUS) & M_FW_IQ_CMD_IQANUS)
2700 #define F_FW_IQ_CMD_IQANUS	V_FW_IQ_CMD_IQANUS(1U)
2701 
2702 #define S_FW_IQ_CMD_IQANUD	12
2703 #define M_FW_IQ_CMD_IQANUD	0x3
2704 #define V_FW_IQ_CMD_IQANUD(x)	((x) << S_FW_IQ_CMD_IQANUD)
2705 #define G_FW_IQ_CMD_IQANUD(x)	\
2706     (((x) >> S_FW_IQ_CMD_IQANUD) & M_FW_IQ_CMD_IQANUD)
2707 
2708 #define S_FW_IQ_CMD_IQANDSTINDEX	0
2709 #define M_FW_IQ_CMD_IQANDSTINDEX	0xfff
2710 #define V_FW_IQ_CMD_IQANDSTINDEX(x)	((x) << S_FW_IQ_CMD_IQANDSTINDEX)
2711 #define G_FW_IQ_CMD_IQANDSTINDEX(x)	\
2712     (((x) >> S_FW_IQ_CMD_IQANDSTINDEX) & M_FW_IQ_CMD_IQANDSTINDEX)
2713 
2714 #define S_FW_IQ_CMD_IQDROPRSS		15
2715 #define M_FW_IQ_CMD_IQDROPRSS		0x1
2716 #define V_FW_IQ_CMD_IQDROPRSS(x)	((x) << S_FW_IQ_CMD_IQDROPRSS)
2717 #define G_FW_IQ_CMD_IQDROPRSS(x)	\
2718     (((x) >> S_FW_IQ_CMD_IQDROPRSS) & M_FW_IQ_CMD_IQDROPRSS)
2719 #define F_FW_IQ_CMD_IQDROPRSS	V_FW_IQ_CMD_IQDROPRSS(1U)
2720 
2721 #define S_FW_IQ_CMD_IQGTSMODE		14
2722 #define M_FW_IQ_CMD_IQGTSMODE		0x1
2723 #define V_FW_IQ_CMD_IQGTSMODE(x)	((x) << S_FW_IQ_CMD_IQGTSMODE)
2724 #define G_FW_IQ_CMD_IQGTSMODE(x)	\
2725     (((x) >> S_FW_IQ_CMD_IQGTSMODE) & M_FW_IQ_CMD_IQGTSMODE)
2726 #define F_FW_IQ_CMD_IQGTSMODE	V_FW_IQ_CMD_IQGTSMODE(1U)
2727 
2728 #define S_FW_IQ_CMD_IQPCIECH	12
2729 #define M_FW_IQ_CMD_IQPCIECH	0x3
2730 #define V_FW_IQ_CMD_IQPCIECH(x)	((x) << S_FW_IQ_CMD_IQPCIECH)
2731 #define G_FW_IQ_CMD_IQPCIECH(x)	\
2732     (((x) >> S_FW_IQ_CMD_IQPCIECH) & M_FW_IQ_CMD_IQPCIECH)
2733 
2734 #define S_FW_IQ_CMD_IQDCAEN	11
2735 #define M_FW_IQ_CMD_IQDCAEN	0x1
2736 #define V_FW_IQ_CMD_IQDCAEN(x)	((x) << S_FW_IQ_CMD_IQDCAEN)
2737 #define G_FW_IQ_CMD_IQDCAEN(x)	\
2738     (((x) >> S_FW_IQ_CMD_IQDCAEN) & M_FW_IQ_CMD_IQDCAEN)
2739 #define F_FW_IQ_CMD_IQDCAEN	V_FW_IQ_CMD_IQDCAEN(1U)
2740 
2741 #define S_FW_IQ_CMD_IQDCACPU	6
2742 #define M_FW_IQ_CMD_IQDCACPU	0x1f
2743 #define V_FW_IQ_CMD_IQDCACPU(x)	((x) << S_FW_IQ_CMD_IQDCACPU)
2744 #define G_FW_IQ_CMD_IQDCACPU(x)	\
2745     (((x) >> S_FW_IQ_CMD_IQDCACPU) & M_FW_IQ_CMD_IQDCACPU)
2746 
2747 #define S_FW_IQ_CMD_IQINTCNTTHRESH	4
2748 #define M_FW_IQ_CMD_IQINTCNTTHRESH	0x3
2749 #define V_FW_IQ_CMD_IQINTCNTTHRESH(x)	((x) << S_FW_IQ_CMD_IQINTCNTTHRESH)
2750 #define G_FW_IQ_CMD_IQINTCNTTHRESH(x)	\
2751     (((x) >> S_FW_IQ_CMD_IQINTCNTTHRESH) & M_FW_IQ_CMD_IQINTCNTTHRESH)
2752 
2753 #define S_FW_IQ_CMD_IQO		3
2754 #define M_FW_IQ_CMD_IQO		0x1
2755 #define V_FW_IQ_CMD_IQO(x)	((x) << S_FW_IQ_CMD_IQO)
2756 #define G_FW_IQ_CMD_IQO(x)	(((x) >> S_FW_IQ_CMD_IQO) & M_FW_IQ_CMD_IQO)
2757 #define F_FW_IQ_CMD_IQO	V_FW_IQ_CMD_IQO(1U)
2758 
2759 #define S_FW_IQ_CMD_IQCPRIO	2
2760 #define M_FW_IQ_CMD_IQCPRIO	0x1
2761 #define V_FW_IQ_CMD_IQCPRIO(x)	((x) << S_FW_IQ_CMD_IQCPRIO)
2762 #define G_FW_IQ_CMD_IQCPRIO(x)	\
2763     (((x) >> S_FW_IQ_CMD_IQCPRIO) & M_FW_IQ_CMD_IQCPRIO)
2764 #define F_FW_IQ_CMD_IQCPRIO	V_FW_IQ_CMD_IQCPRIO(1U)
2765 
2766 #define S_FW_IQ_CMD_IQESIZE	0
2767 #define M_FW_IQ_CMD_IQESIZE	0x3
2768 #define V_FW_IQ_CMD_IQESIZE(x)	((x) << S_FW_IQ_CMD_IQESIZE)
2769 #define G_FW_IQ_CMD_IQESIZE(x)	\
2770     (((x) >> S_FW_IQ_CMD_IQESIZE) & M_FW_IQ_CMD_IQESIZE)
2771 
2772 #define S_FW_IQ_CMD_IQNS	31
2773 #define M_FW_IQ_CMD_IQNS	0x1
2774 #define V_FW_IQ_CMD_IQNS(x)	((x) << S_FW_IQ_CMD_IQNS)
2775 #define G_FW_IQ_CMD_IQNS(x)	(((x) >> S_FW_IQ_CMD_IQNS) & M_FW_IQ_CMD_IQNS)
2776 #define F_FW_IQ_CMD_IQNS	V_FW_IQ_CMD_IQNS(1U)
2777 
2778 #define S_FW_IQ_CMD_IQRO	30
2779 #define M_FW_IQ_CMD_IQRO	0x1
2780 #define V_FW_IQ_CMD_IQRO(x)	((x) << S_FW_IQ_CMD_IQRO)
2781 #define G_FW_IQ_CMD_IQRO(x)	(((x) >> S_FW_IQ_CMD_IQRO) & M_FW_IQ_CMD_IQRO)
2782 #define F_FW_IQ_CMD_IQRO	V_FW_IQ_CMD_IQRO(1U)
2783 
2784 #define S_FW_IQ_CMD_IQFLINTIQHSEN	28
2785 #define M_FW_IQ_CMD_IQFLINTIQHSEN	0x3
2786 #define V_FW_IQ_CMD_IQFLINTIQHSEN(x)	((x) << S_FW_IQ_CMD_IQFLINTIQHSEN)
2787 #define G_FW_IQ_CMD_IQFLINTIQHSEN(x)	\
2788     (((x) >> S_FW_IQ_CMD_IQFLINTIQHSEN) & M_FW_IQ_CMD_IQFLINTIQHSEN)
2789 
2790 #define S_FW_IQ_CMD_IQFLINTCONGEN	27
2791 #define M_FW_IQ_CMD_IQFLINTCONGEN	0x1
2792 #define V_FW_IQ_CMD_IQFLINTCONGEN(x)	((x) << S_FW_IQ_CMD_IQFLINTCONGEN)
2793 #define G_FW_IQ_CMD_IQFLINTCONGEN(x)	\
2794     (((x) >> S_FW_IQ_CMD_IQFLINTCONGEN) & M_FW_IQ_CMD_IQFLINTCONGEN)
2795 #define F_FW_IQ_CMD_IQFLINTCONGEN	V_FW_IQ_CMD_IQFLINTCONGEN(1U)
2796 
2797 #define S_FW_IQ_CMD_IQFLINTISCSIC	26
2798 #define M_FW_IQ_CMD_IQFLINTISCSIC	0x1
2799 #define V_FW_IQ_CMD_IQFLINTISCSIC(x)	((x) << S_FW_IQ_CMD_IQFLINTISCSIC)
2800 #define G_FW_IQ_CMD_IQFLINTISCSIC(x)	\
2801     (((x) >> S_FW_IQ_CMD_IQFLINTISCSIC) & M_FW_IQ_CMD_IQFLINTISCSIC)
2802 #define F_FW_IQ_CMD_IQFLINTISCSIC	V_FW_IQ_CMD_IQFLINTISCSIC(1U)
2803 
2804 #define S_FW_IQ_CMD_FL0CNGCHMAP		20
2805 #define M_FW_IQ_CMD_FL0CNGCHMAP		0xf
2806 #define V_FW_IQ_CMD_FL0CNGCHMAP(x)	((x) << S_FW_IQ_CMD_FL0CNGCHMAP)
2807 #define G_FW_IQ_CMD_FL0CNGCHMAP(x)	\
2808     (((x) >> S_FW_IQ_CMD_FL0CNGCHMAP) & M_FW_IQ_CMD_FL0CNGCHMAP)
2809 
2810 #define S_FW_IQ_CMD_FL0CACHELOCK	15
2811 #define M_FW_IQ_CMD_FL0CACHELOCK	0x1
2812 #define V_FW_IQ_CMD_FL0CACHELOCK(x)	((x) << S_FW_IQ_CMD_FL0CACHELOCK)
2813 #define G_FW_IQ_CMD_FL0CACHELOCK(x)	\
2814     (((x) >> S_FW_IQ_CMD_FL0CACHELOCK) & M_FW_IQ_CMD_FL0CACHELOCK)
2815 #define F_FW_IQ_CMD_FL0CACHELOCK	V_FW_IQ_CMD_FL0CACHELOCK(1U)
2816 
2817 #define S_FW_IQ_CMD_FL0DBP	14
2818 #define M_FW_IQ_CMD_FL0DBP	0x1
2819 #define V_FW_IQ_CMD_FL0DBP(x)	((x) << S_FW_IQ_CMD_FL0DBP)
2820 #define G_FW_IQ_CMD_FL0DBP(x)	\
2821     (((x) >> S_FW_IQ_CMD_FL0DBP) & M_FW_IQ_CMD_FL0DBP)
2822 #define F_FW_IQ_CMD_FL0DBP	V_FW_IQ_CMD_FL0DBP(1U)
2823 
2824 #define S_FW_IQ_CMD_FL0DATANS		13
2825 #define M_FW_IQ_CMD_FL0DATANS		0x1
2826 #define V_FW_IQ_CMD_FL0DATANS(x)	((x) << S_FW_IQ_CMD_FL0DATANS)
2827 #define G_FW_IQ_CMD_FL0DATANS(x)	\
2828     (((x) >> S_FW_IQ_CMD_FL0DATANS) & M_FW_IQ_CMD_FL0DATANS)
2829 #define F_FW_IQ_CMD_FL0DATANS	V_FW_IQ_CMD_FL0DATANS(1U)
2830 
2831 #define S_FW_IQ_CMD_FL0DATARO		12
2832 #define M_FW_IQ_CMD_FL0DATARO		0x1
2833 #define V_FW_IQ_CMD_FL0DATARO(x)	((x) << S_FW_IQ_CMD_FL0DATARO)
2834 #define G_FW_IQ_CMD_FL0DATARO(x)	\
2835     (((x) >> S_FW_IQ_CMD_FL0DATARO) & M_FW_IQ_CMD_FL0DATARO)
2836 #define F_FW_IQ_CMD_FL0DATARO	V_FW_IQ_CMD_FL0DATARO(1U)
2837 
2838 #define S_FW_IQ_CMD_FL0CONGCIF		11
2839 #define M_FW_IQ_CMD_FL0CONGCIF		0x1
2840 #define V_FW_IQ_CMD_FL0CONGCIF(x)	((x) << S_FW_IQ_CMD_FL0CONGCIF)
2841 #define G_FW_IQ_CMD_FL0CONGCIF(x)	\
2842     (((x) >> S_FW_IQ_CMD_FL0CONGCIF) & M_FW_IQ_CMD_FL0CONGCIF)
2843 #define F_FW_IQ_CMD_FL0CONGCIF	V_FW_IQ_CMD_FL0CONGCIF(1U)
2844 
2845 #define S_FW_IQ_CMD_FL0ONCHIP		10
2846 #define M_FW_IQ_CMD_FL0ONCHIP		0x1
2847 #define V_FW_IQ_CMD_FL0ONCHIP(x)	((x) << S_FW_IQ_CMD_FL0ONCHIP)
2848 #define G_FW_IQ_CMD_FL0ONCHIP(x)	\
2849     (((x) >> S_FW_IQ_CMD_FL0ONCHIP) & M_FW_IQ_CMD_FL0ONCHIP)
2850 #define F_FW_IQ_CMD_FL0ONCHIP	V_FW_IQ_CMD_FL0ONCHIP(1U)
2851 
2852 #define S_FW_IQ_CMD_FL0STATUSPGNS	9
2853 #define M_FW_IQ_CMD_FL0STATUSPGNS	0x1
2854 #define V_FW_IQ_CMD_FL0STATUSPGNS(x)	((x) << S_FW_IQ_CMD_FL0STATUSPGNS)
2855 #define G_FW_IQ_CMD_FL0STATUSPGNS(x)	\
2856     (((x) >> S_FW_IQ_CMD_FL0STATUSPGNS) & M_FW_IQ_CMD_FL0STATUSPGNS)
2857 #define F_FW_IQ_CMD_FL0STATUSPGNS	V_FW_IQ_CMD_FL0STATUSPGNS(1U)
2858 
2859 #define S_FW_IQ_CMD_FL0STATUSPGRO	8
2860 #define M_FW_IQ_CMD_FL0STATUSPGRO	0x1
2861 #define V_FW_IQ_CMD_FL0STATUSPGRO(x)	((x) << S_FW_IQ_CMD_FL0STATUSPGRO)
2862 #define G_FW_IQ_CMD_FL0STATUSPGRO(x)	\
2863     (((x) >> S_FW_IQ_CMD_FL0STATUSPGRO) & M_FW_IQ_CMD_FL0STATUSPGRO)
2864 #define F_FW_IQ_CMD_FL0STATUSPGRO	V_FW_IQ_CMD_FL0STATUSPGRO(1U)
2865 
2866 #define S_FW_IQ_CMD_FL0FETCHNS		7
2867 #define M_FW_IQ_CMD_FL0FETCHNS		0x1
2868 #define V_FW_IQ_CMD_FL0FETCHNS(x)	((x) << S_FW_IQ_CMD_FL0FETCHNS)
2869 #define G_FW_IQ_CMD_FL0FETCHNS(x)	\
2870     (((x) >> S_FW_IQ_CMD_FL0FETCHNS) & M_FW_IQ_CMD_FL0FETCHNS)
2871 #define F_FW_IQ_CMD_FL0FETCHNS	V_FW_IQ_CMD_FL0FETCHNS(1U)
2872 
2873 #define S_FW_IQ_CMD_FL0FETCHRO		6
2874 #define M_FW_IQ_CMD_FL0FETCHRO		0x1
2875 #define V_FW_IQ_CMD_FL0FETCHRO(x)	((x) << S_FW_IQ_CMD_FL0FETCHRO)
2876 #define G_FW_IQ_CMD_FL0FETCHRO(x)	\
2877     (((x) >> S_FW_IQ_CMD_FL0FETCHRO) & M_FW_IQ_CMD_FL0FETCHRO)
2878 #define F_FW_IQ_CMD_FL0FETCHRO	V_FW_IQ_CMD_FL0FETCHRO(1U)
2879 
2880 #define S_FW_IQ_CMD_FL0HOSTFCMODE	4
2881 #define M_FW_IQ_CMD_FL0HOSTFCMODE	0x3
2882 #define V_FW_IQ_CMD_FL0HOSTFCMODE(x)	((x) << S_FW_IQ_CMD_FL0HOSTFCMODE)
2883 #define G_FW_IQ_CMD_FL0HOSTFCMODE(x)	\
2884     (((x) >> S_FW_IQ_CMD_FL0HOSTFCMODE) & M_FW_IQ_CMD_FL0HOSTFCMODE)
2885 
2886 #define S_FW_IQ_CMD_FL0CPRIO	3
2887 #define M_FW_IQ_CMD_FL0CPRIO	0x1
2888 #define V_FW_IQ_CMD_FL0CPRIO(x)	((x) << S_FW_IQ_CMD_FL0CPRIO)
2889 #define G_FW_IQ_CMD_FL0CPRIO(x)	\
2890     (((x) >> S_FW_IQ_CMD_FL0CPRIO) & M_FW_IQ_CMD_FL0CPRIO)
2891 #define F_FW_IQ_CMD_FL0CPRIO	V_FW_IQ_CMD_FL0CPRIO(1U)
2892 
2893 #define S_FW_IQ_CMD_FL0PADEN	2
2894 #define M_FW_IQ_CMD_FL0PADEN	0x1
2895 #define V_FW_IQ_CMD_FL0PADEN(x)	((x) << S_FW_IQ_CMD_FL0PADEN)
2896 #define G_FW_IQ_CMD_FL0PADEN(x)	\
2897     (((x) >> S_FW_IQ_CMD_FL0PADEN) & M_FW_IQ_CMD_FL0PADEN)
2898 #define F_FW_IQ_CMD_FL0PADEN	V_FW_IQ_CMD_FL0PADEN(1U)
2899 
2900 #define S_FW_IQ_CMD_FL0PACKEN		1
2901 #define M_FW_IQ_CMD_FL0PACKEN		0x1
2902 #define V_FW_IQ_CMD_FL0PACKEN(x)	((x) << S_FW_IQ_CMD_FL0PACKEN)
2903 #define G_FW_IQ_CMD_FL0PACKEN(x)	\
2904     (((x) >> S_FW_IQ_CMD_FL0PACKEN) & M_FW_IQ_CMD_FL0PACKEN)
2905 #define F_FW_IQ_CMD_FL0PACKEN	V_FW_IQ_CMD_FL0PACKEN(1U)
2906 
2907 #define S_FW_IQ_CMD_FL0CONGEN		0
2908 #define M_FW_IQ_CMD_FL0CONGEN		0x1
2909 #define V_FW_IQ_CMD_FL0CONGEN(x)	((x) << S_FW_IQ_CMD_FL0CONGEN)
2910 #define G_FW_IQ_CMD_FL0CONGEN(x)	\
2911     (((x) >> S_FW_IQ_CMD_FL0CONGEN) & M_FW_IQ_CMD_FL0CONGEN)
2912 #define F_FW_IQ_CMD_FL0CONGEN	V_FW_IQ_CMD_FL0CONGEN(1U)
2913 
2914 #define S_FW_IQ_CMD_FL0DCAEN	15
2915 #define M_FW_IQ_CMD_FL0DCAEN	0x1
2916 #define V_FW_IQ_CMD_FL0DCAEN(x)	((x) << S_FW_IQ_CMD_FL0DCAEN)
2917 #define G_FW_IQ_CMD_FL0DCAEN(x)	\
2918     (((x) >> S_FW_IQ_CMD_FL0DCAEN) & M_FW_IQ_CMD_FL0DCAEN)
2919 #define F_FW_IQ_CMD_FL0DCAEN	V_FW_IQ_CMD_FL0DCAEN(1U)
2920 
2921 #define S_FW_IQ_CMD_FL0DCACPU		10
2922 #define M_FW_IQ_CMD_FL0DCACPU		0x1f
2923 #define V_FW_IQ_CMD_FL0DCACPU(x)	((x) << S_FW_IQ_CMD_FL0DCACPU)
2924 #define G_FW_IQ_CMD_FL0DCACPU(x)	\
2925     (((x) >> S_FW_IQ_CMD_FL0DCACPU) & M_FW_IQ_CMD_FL0DCACPU)
2926 
2927 #define S_FW_IQ_CMD_FL0FBMIN	7
2928 #define M_FW_IQ_CMD_FL0FBMIN	0x7
2929 #define V_FW_IQ_CMD_FL0FBMIN(x)	((x) << S_FW_IQ_CMD_FL0FBMIN)
2930 #define G_FW_IQ_CMD_FL0FBMIN(x)	\
2931     (((x) >> S_FW_IQ_CMD_FL0FBMIN) & M_FW_IQ_CMD_FL0FBMIN)
2932 
2933 #define S_FW_IQ_CMD_FL0FBMAX	4
2934 #define M_FW_IQ_CMD_FL0FBMAX	0x7
2935 #define V_FW_IQ_CMD_FL0FBMAX(x)	((x) << S_FW_IQ_CMD_FL0FBMAX)
2936 #define G_FW_IQ_CMD_FL0FBMAX(x)	\
2937     (((x) >> S_FW_IQ_CMD_FL0FBMAX) & M_FW_IQ_CMD_FL0FBMAX)
2938 
2939 #define S_FW_IQ_CMD_FL0CIDXFTHRESHO	3
2940 #define M_FW_IQ_CMD_FL0CIDXFTHRESHO	0x1
2941 #define V_FW_IQ_CMD_FL0CIDXFTHRESHO(x)	((x) << S_FW_IQ_CMD_FL0CIDXFTHRESHO)
2942 #define G_FW_IQ_CMD_FL0CIDXFTHRESHO(x)	\
2943     (((x) >> S_FW_IQ_CMD_FL0CIDXFTHRESHO) & M_FW_IQ_CMD_FL0CIDXFTHRESHO)
2944 #define F_FW_IQ_CMD_FL0CIDXFTHRESHO	V_FW_IQ_CMD_FL0CIDXFTHRESHO(1U)
2945 
2946 #define S_FW_IQ_CMD_FL0CIDXFTHRESH	0
2947 #define M_FW_IQ_CMD_FL0CIDXFTHRESH	0x7
2948 #define V_FW_IQ_CMD_FL0CIDXFTHRESH(x)	((x) << S_FW_IQ_CMD_FL0CIDXFTHRESH)
2949 #define G_FW_IQ_CMD_FL0CIDXFTHRESH(x)	\
2950     (((x) >> S_FW_IQ_CMD_FL0CIDXFTHRESH) & M_FW_IQ_CMD_FL0CIDXFTHRESH)
2951 
2952 #define S_FW_IQ_CMD_FL1CNGCHMAP		20
2953 #define M_FW_IQ_CMD_FL1CNGCHMAP		0xf
2954 #define V_FW_IQ_CMD_FL1CNGCHMAP(x)	((x) << S_FW_IQ_CMD_FL1CNGCHMAP)
2955 #define G_FW_IQ_CMD_FL1CNGCHMAP(x)	\
2956     (((x) >> S_FW_IQ_CMD_FL1CNGCHMAP) & M_FW_IQ_CMD_FL1CNGCHMAP)
2957 
2958 #define S_FW_IQ_CMD_FL1CACHELOCK	15
2959 #define M_FW_IQ_CMD_FL1CACHELOCK	0x1
2960 #define V_FW_IQ_CMD_FL1CACHELOCK(x)	((x) << S_FW_IQ_CMD_FL1CACHELOCK)
2961 #define G_FW_IQ_CMD_FL1CACHELOCK(x)	\
2962     (((x) >> S_FW_IQ_CMD_FL1CACHELOCK) & M_FW_IQ_CMD_FL1CACHELOCK)
2963 #define F_FW_IQ_CMD_FL1CACHELOCK	V_FW_IQ_CMD_FL1CACHELOCK(1U)
2964 
2965 #define S_FW_IQ_CMD_FL1DBP	14
2966 #define M_FW_IQ_CMD_FL1DBP	0x1
2967 #define V_FW_IQ_CMD_FL1DBP(x)	((x) << S_FW_IQ_CMD_FL1DBP)
2968 #define G_FW_IQ_CMD_FL1DBP(x)	\
2969     (((x) >> S_FW_IQ_CMD_FL1DBP) & M_FW_IQ_CMD_FL1DBP)
2970 #define F_FW_IQ_CMD_FL1DBP	V_FW_IQ_CMD_FL1DBP(1U)
2971 
2972 #define S_FW_IQ_CMD_FL1DATANS		13
2973 #define M_FW_IQ_CMD_FL1DATANS		0x1
2974 #define V_FW_IQ_CMD_FL1DATANS(x)	((x) << S_FW_IQ_CMD_FL1DATANS)
2975 #define G_FW_IQ_CMD_FL1DATANS(x)	\
2976     (((x) >> S_FW_IQ_CMD_FL1DATANS) & M_FW_IQ_CMD_FL1DATANS)
2977 #define F_FW_IQ_CMD_FL1DATANS	V_FW_IQ_CMD_FL1DATANS(1U)
2978 
2979 #define S_FW_IQ_CMD_FL1DATARO		12
2980 #define M_FW_IQ_CMD_FL1DATARO		0x1
2981 #define V_FW_IQ_CMD_FL1DATARO(x)	((x) << S_FW_IQ_CMD_FL1DATARO)
2982 #define G_FW_IQ_CMD_FL1DATARO(x)	\
2983     (((x) >> S_FW_IQ_CMD_FL1DATARO) & M_FW_IQ_CMD_FL1DATARO)
2984 #define F_FW_IQ_CMD_FL1DATARO	V_FW_IQ_CMD_FL1DATARO(1U)
2985 
2986 #define S_FW_IQ_CMD_FL1CONGCIF		11
2987 #define M_FW_IQ_CMD_FL1CONGCIF		0x1
2988 #define V_FW_IQ_CMD_FL1CONGCIF(x)	((x) << S_FW_IQ_CMD_FL1CONGCIF)
2989 #define G_FW_IQ_CMD_FL1CONGCIF(x)	\
2990     (((x) >> S_FW_IQ_CMD_FL1CONGCIF) & M_FW_IQ_CMD_FL1CONGCIF)
2991 #define F_FW_IQ_CMD_FL1CONGCIF	V_FW_IQ_CMD_FL1CONGCIF(1U)
2992 
2993 #define S_FW_IQ_CMD_FL1ONCHIP		10
2994 #define M_FW_IQ_CMD_FL1ONCHIP		0x1
2995 #define V_FW_IQ_CMD_FL1ONCHIP(x)	((x) << S_FW_IQ_CMD_FL1ONCHIP)
2996 #define G_FW_IQ_CMD_FL1ONCHIP(x)	\
2997     (((x) >> S_FW_IQ_CMD_FL1ONCHIP) & M_FW_IQ_CMD_FL1ONCHIP)
2998 #define F_FW_IQ_CMD_FL1ONCHIP	V_FW_IQ_CMD_FL1ONCHIP(1U)
2999 
3000 #define S_FW_IQ_CMD_FL1STATUSPGNS	9
3001 #define M_FW_IQ_CMD_FL1STATUSPGNS	0x1
3002 #define V_FW_IQ_CMD_FL1STATUSPGNS(x)	((x) << S_FW_IQ_CMD_FL1STATUSPGNS)
3003 #define G_FW_IQ_CMD_FL1STATUSPGNS(x)	\
3004     (((x) >> S_FW_IQ_CMD_FL1STATUSPGNS) & M_FW_IQ_CMD_FL1STATUSPGNS)
3005 #define F_FW_IQ_CMD_FL1STATUSPGNS	V_FW_IQ_CMD_FL1STATUSPGNS(1U)
3006 
3007 #define S_FW_IQ_CMD_FL1STATUSPGRO	8
3008 #define M_FW_IQ_CMD_FL1STATUSPGRO	0x1
3009 #define V_FW_IQ_CMD_FL1STATUSPGRO(x)	((x) << S_FW_IQ_CMD_FL1STATUSPGRO)
3010 #define G_FW_IQ_CMD_FL1STATUSPGRO(x)	\
3011     (((x) >> S_FW_IQ_CMD_FL1STATUSPGRO) & M_FW_IQ_CMD_FL1STATUSPGRO)
3012 #define F_FW_IQ_CMD_FL1STATUSPGRO	V_FW_IQ_CMD_FL1STATUSPGRO(1U)
3013 
3014 #define S_FW_IQ_CMD_FL1FETCHNS		7
3015 #define M_FW_IQ_CMD_FL1FETCHNS		0x1
3016 #define V_FW_IQ_CMD_FL1FETCHNS(x)	((x) << S_FW_IQ_CMD_FL1FETCHNS)
3017 #define G_FW_IQ_CMD_FL1FETCHNS(x)	\
3018     (((x) >> S_FW_IQ_CMD_FL1FETCHNS) & M_FW_IQ_CMD_FL1FETCHNS)
3019 #define F_FW_IQ_CMD_FL1FETCHNS	V_FW_IQ_CMD_FL1FETCHNS(1U)
3020 
3021 #define S_FW_IQ_CMD_FL1FETCHRO		6
3022 #define M_FW_IQ_CMD_FL1FETCHRO		0x1
3023 #define V_FW_IQ_CMD_FL1FETCHRO(x)	((x) << S_FW_IQ_CMD_FL1FETCHRO)
3024 #define G_FW_IQ_CMD_FL1FETCHRO(x)	\
3025     (((x) >> S_FW_IQ_CMD_FL1FETCHRO) & M_FW_IQ_CMD_FL1FETCHRO)
3026 #define F_FW_IQ_CMD_FL1FETCHRO	V_FW_IQ_CMD_FL1FETCHRO(1U)
3027 
3028 #define S_FW_IQ_CMD_FL1HOSTFCMODE	4
3029 #define M_FW_IQ_CMD_FL1HOSTFCMODE	0x3
3030 #define V_FW_IQ_CMD_FL1HOSTFCMODE(x)	((x) << S_FW_IQ_CMD_FL1HOSTFCMODE)
3031 #define G_FW_IQ_CMD_FL1HOSTFCMODE(x)	\
3032     (((x) >> S_FW_IQ_CMD_FL1HOSTFCMODE) & M_FW_IQ_CMD_FL1HOSTFCMODE)
3033 
3034 #define S_FW_IQ_CMD_FL1CPRIO	3
3035 #define M_FW_IQ_CMD_FL1CPRIO	0x1
3036 #define V_FW_IQ_CMD_FL1CPRIO(x)	((x) << S_FW_IQ_CMD_FL1CPRIO)
3037 #define G_FW_IQ_CMD_FL1CPRIO(x)	\
3038     (((x) >> S_FW_IQ_CMD_FL1CPRIO) & M_FW_IQ_CMD_FL1CPRIO)
3039 #define F_FW_IQ_CMD_FL1CPRIO	V_FW_IQ_CMD_FL1CPRIO(1U)
3040 
3041 #define S_FW_IQ_CMD_FL1PADEN	2
3042 #define M_FW_IQ_CMD_FL1PADEN	0x1
3043 #define V_FW_IQ_CMD_FL1PADEN(x)	((x) << S_FW_IQ_CMD_FL1PADEN)
3044 #define G_FW_IQ_CMD_FL1PADEN(x)	\
3045     (((x) >> S_FW_IQ_CMD_FL1PADEN) & M_FW_IQ_CMD_FL1PADEN)
3046 #define F_FW_IQ_CMD_FL1PADEN	V_FW_IQ_CMD_FL1PADEN(1U)
3047 
3048 #define S_FW_IQ_CMD_FL1PACKEN		1
3049 #define M_FW_IQ_CMD_FL1PACKEN		0x1
3050 #define V_FW_IQ_CMD_FL1PACKEN(x)	((x) << S_FW_IQ_CMD_FL1PACKEN)
3051 #define G_FW_IQ_CMD_FL1PACKEN(x)	\
3052     (((x) >> S_FW_IQ_CMD_FL1PACKEN) & M_FW_IQ_CMD_FL1PACKEN)
3053 #define F_FW_IQ_CMD_FL1PACKEN	V_FW_IQ_CMD_FL1PACKEN(1U)
3054 
3055 #define S_FW_IQ_CMD_FL1CONGEN		0
3056 #define M_FW_IQ_CMD_FL1CONGEN		0x1
3057 #define V_FW_IQ_CMD_FL1CONGEN(x)	((x) << S_FW_IQ_CMD_FL1CONGEN)
3058 #define G_FW_IQ_CMD_FL1CONGEN(x)	\
3059     (((x) >> S_FW_IQ_CMD_FL1CONGEN) & M_FW_IQ_CMD_FL1CONGEN)
3060 #define F_FW_IQ_CMD_FL1CONGEN	V_FW_IQ_CMD_FL1CONGEN(1U)
3061 
3062 #define S_FW_IQ_CMD_FL1DCAEN	15
3063 #define M_FW_IQ_CMD_FL1DCAEN	0x1
3064 #define V_FW_IQ_CMD_FL1DCAEN(x)	((x) << S_FW_IQ_CMD_FL1DCAEN)
3065 #define G_FW_IQ_CMD_FL1DCAEN(x)	\
3066     (((x) >> S_FW_IQ_CMD_FL1DCAEN) & M_FW_IQ_CMD_FL1DCAEN)
3067 #define F_FW_IQ_CMD_FL1DCAEN	V_FW_IQ_CMD_FL1DCAEN(1U)
3068 
3069 #define S_FW_IQ_CMD_FL1DCACPU		10
3070 #define M_FW_IQ_CMD_FL1DCACPU		0x1f
3071 #define V_FW_IQ_CMD_FL1DCACPU(x)	((x) << S_FW_IQ_CMD_FL1DCACPU)
3072 #define G_FW_IQ_CMD_FL1DCACPU(x)	\
3073     (((x) >> S_FW_IQ_CMD_FL1DCACPU) & M_FW_IQ_CMD_FL1DCACPU)
3074 
3075 #define S_FW_IQ_CMD_FL1FBMIN	7
3076 #define M_FW_IQ_CMD_FL1FBMIN	0x7
3077 #define V_FW_IQ_CMD_FL1FBMIN(x)	((x) << S_FW_IQ_CMD_FL1FBMIN)
3078 #define G_FW_IQ_CMD_FL1FBMIN(x)	\
3079     (((x) >> S_FW_IQ_CMD_FL1FBMIN) & M_FW_IQ_CMD_FL1FBMIN)
3080 
3081 #define S_FW_IQ_CMD_FL1FBMAX	4
3082 #define M_FW_IQ_CMD_FL1FBMAX	0x7
3083 #define V_FW_IQ_CMD_FL1FBMAX(x)	((x) << S_FW_IQ_CMD_FL1FBMAX)
3084 #define G_FW_IQ_CMD_FL1FBMAX(x)	\
3085     (((x) >> S_FW_IQ_CMD_FL1FBMAX) & M_FW_IQ_CMD_FL1FBMAX)
3086 
3087 #define S_FW_IQ_CMD_FL1CIDXFTHRESHO	3
3088 #define M_FW_IQ_CMD_FL1CIDXFTHRESHO	0x1
3089 #define V_FW_IQ_CMD_FL1CIDXFTHRESHO(x)	((x) << S_FW_IQ_CMD_FL1CIDXFTHRESHO)
3090 #define G_FW_IQ_CMD_FL1CIDXFTHRESHO(x)	\
3091     (((x) >> S_FW_IQ_CMD_FL1CIDXFTHRESHO) & M_FW_IQ_CMD_FL1CIDXFTHRESHO)
3092 #define F_FW_IQ_CMD_FL1CIDXFTHRESHO	V_FW_IQ_CMD_FL1CIDXFTHRESHO(1U)
3093 
3094 #define S_FW_IQ_CMD_FL1CIDXFTHRESH	0
3095 #define M_FW_IQ_CMD_FL1CIDXFTHRESH	0x7
3096 #define V_FW_IQ_CMD_FL1CIDXFTHRESH(x)	((x) << S_FW_IQ_CMD_FL1CIDXFTHRESH)
3097 #define G_FW_IQ_CMD_FL1CIDXFTHRESH(x)	\
3098     (((x) >> S_FW_IQ_CMD_FL1CIDXFTHRESH) & M_FW_IQ_CMD_FL1CIDXFTHRESH)
3099 
3100 struct fw_eq_mngt_cmd {
3101 	__be32 op_to_vfn;
3102 	__be32 alloc_to_len16;
3103 	__be32 cmpliqid_eqid;
3104 	__be32 physeqid_pkd;
3105 	__be32 fetchszm_to_iqid;
3106 	__be32 dcaen_to_eqsize;
3107 	__be64 eqaddr;
3108 };
3109 
3110 #define S_FW_EQ_MNGT_CMD_PFN	8
3111 #define M_FW_EQ_MNGT_CMD_PFN	0x7
3112 #define V_FW_EQ_MNGT_CMD_PFN(x)	((x) << S_FW_EQ_MNGT_CMD_PFN)
3113 #define G_FW_EQ_MNGT_CMD_PFN(x)	\
3114     (((x) >> S_FW_EQ_MNGT_CMD_PFN) & M_FW_EQ_MNGT_CMD_PFN)
3115 
3116 #define S_FW_EQ_MNGT_CMD_VFN	0
3117 #define M_FW_EQ_MNGT_CMD_VFN	0xff
3118 #define V_FW_EQ_MNGT_CMD_VFN(x)	((x) << S_FW_EQ_MNGT_CMD_VFN)
3119 #define G_FW_EQ_MNGT_CMD_VFN(x)	\
3120     (((x) >> S_FW_EQ_MNGT_CMD_VFN) & M_FW_EQ_MNGT_CMD_VFN)
3121 
3122 #define S_FW_EQ_MNGT_CMD_ALLOC		31
3123 #define M_FW_EQ_MNGT_CMD_ALLOC		0x1
3124 #define V_FW_EQ_MNGT_CMD_ALLOC(x)	((x) << S_FW_EQ_MNGT_CMD_ALLOC)
3125 #define G_FW_EQ_MNGT_CMD_ALLOC(x)	\
3126     (((x) >> S_FW_EQ_MNGT_CMD_ALLOC) & M_FW_EQ_MNGT_CMD_ALLOC)
3127 #define F_FW_EQ_MNGT_CMD_ALLOC	V_FW_EQ_MNGT_CMD_ALLOC(1U)
3128 
3129 #define S_FW_EQ_MNGT_CMD_FREE		30
3130 #define M_FW_EQ_MNGT_CMD_FREE		0x1
3131 #define V_FW_EQ_MNGT_CMD_FREE(x)	((x) << S_FW_EQ_MNGT_CMD_FREE)
3132 #define G_FW_EQ_MNGT_CMD_FREE(x)	\
3133     (((x) >> S_FW_EQ_MNGT_CMD_FREE) & M_FW_EQ_MNGT_CMD_FREE)
3134 #define F_FW_EQ_MNGT_CMD_FREE	V_FW_EQ_MNGT_CMD_FREE(1U)
3135 
3136 #define S_FW_EQ_MNGT_CMD_MODIFY		29
3137 #define M_FW_EQ_MNGT_CMD_MODIFY		0x1
3138 #define V_FW_EQ_MNGT_CMD_MODIFY(x)	((x) << S_FW_EQ_MNGT_CMD_MODIFY)
3139 #define G_FW_EQ_MNGT_CMD_MODIFY(x)	\
3140     (((x) >> S_FW_EQ_MNGT_CMD_MODIFY) & M_FW_EQ_MNGT_CMD_MODIFY)
3141 #define F_FW_EQ_MNGT_CMD_MODIFY	V_FW_EQ_MNGT_CMD_MODIFY(1U)
3142 
3143 #define S_FW_EQ_MNGT_CMD_EQSTART	28
3144 #define M_FW_EQ_MNGT_CMD_EQSTART	0x1
3145 #define V_FW_EQ_MNGT_CMD_EQSTART(x)	((x) << S_FW_EQ_MNGT_CMD_EQSTART)
3146 #define G_FW_EQ_MNGT_CMD_EQSTART(x)	\
3147     (((x) >> S_FW_EQ_MNGT_CMD_EQSTART) & M_FW_EQ_MNGT_CMD_EQSTART)
3148 #define F_FW_EQ_MNGT_CMD_EQSTART	V_FW_EQ_MNGT_CMD_EQSTART(1U)
3149 
3150 #define S_FW_EQ_MNGT_CMD_EQSTOP		27
3151 #define M_FW_EQ_MNGT_CMD_EQSTOP		0x1
3152 #define V_FW_EQ_MNGT_CMD_EQSTOP(x)	((x) << S_FW_EQ_MNGT_CMD_EQSTOP)
3153 #define G_FW_EQ_MNGT_CMD_EQSTOP(x)	\
3154     (((x) >> S_FW_EQ_MNGT_CMD_EQSTOP) & M_FW_EQ_MNGT_CMD_EQSTOP)
3155 #define F_FW_EQ_MNGT_CMD_EQSTOP	V_FW_EQ_MNGT_CMD_EQSTOP(1U)
3156 
3157 #define S_FW_EQ_MNGT_CMD_CMPLIQID	20
3158 #define M_FW_EQ_MNGT_CMD_CMPLIQID	0xfff
3159 #define V_FW_EQ_MNGT_CMD_CMPLIQID(x)	((x) << S_FW_EQ_MNGT_CMD_CMPLIQID)
3160 #define G_FW_EQ_MNGT_CMD_CMPLIQID(x)	\
3161     (((x) >> S_FW_EQ_MNGT_CMD_CMPLIQID) & M_FW_EQ_MNGT_CMD_CMPLIQID)
3162 
3163 #define S_FW_EQ_MNGT_CMD_EQID		0
3164 #define M_FW_EQ_MNGT_CMD_EQID		0xfffff
3165 #define V_FW_EQ_MNGT_CMD_EQID(x)	((x) << S_FW_EQ_MNGT_CMD_EQID)
3166 #define G_FW_EQ_MNGT_CMD_EQID(x)	\
3167     (((x) >> S_FW_EQ_MNGT_CMD_EQID) & M_FW_EQ_MNGT_CMD_EQID)
3168 
3169 #define S_FW_EQ_MNGT_CMD_PHYSEQID	0
3170 #define M_FW_EQ_MNGT_CMD_PHYSEQID	0xfffff
3171 #define V_FW_EQ_MNGT_CMD_PHYSEQID(x)	((x) << S_FW_EQ_MNGT_CMD_PHYSEQID)
3172 #define G_FW_EQ_MNGT_CMD_PHYSEQID(x)	\
3173     (((x) >> S_FW_EQ_MNGT_CMD_PHYSEQID) & M_FW_EQ_MNGT_CMD_PHYSEQID)
3174 
3175 #define S_FW_EQ_MNGT_CMD_FETCHSZM	26
3176 #define M_FW_EQ_MNGT_CMD_FETCHSZM	0x1
3177 #define V_FW_EQ_MNGT_CMD_FETCHSZM(x)	((x) << S_FW_EQ_MNGT_CMD_FETCHSZM)
3178 #define G_FW_EQ_MNGT_CMD_FETCHSZM(x)	\
3179     (((x) >> S_FW_EQ_MNGT_CMD_FETCHSZM) & M_FW_EQ_MNGT_CMD_FETCHSZM)
3180 #define F_FW_EQ_MNGT_CMD_FETCHSZM	V_FW_EQ_MNGT_CMD_FETCHSZM(1U)
3181 
3182 #define S_FW_EQ_MNGT_CMD_STATUSPGNS	25
3183 #define M_FW_EQ_MNGT_CMD_STATUSPGNS	0x1
3184 #define V_FW_EQ_MNGT_CMD_STATUSPGNS(x)	((x) << S_FW_EQ_MNGT_CMD_STATUSPGNS)
3185 #define G_FW_EQ_MNGT_CMD_STATUSPGNS(x)	\
3186     (((x) >> S_FW_EQ_MNGT_CMD_STATUSPGNS) & M_FW_EQ_MNGT_CMD_STATUSPGNS)
3187 #define F_FW_EQ_MNGT_CMD_STATUSPGNS	V_FW_EQ_MNGT_CMD_STATUSPGNS(1U)
3188 
3189 #define S_FW_EQ_MNGT_CMD_STATUSPGRO	24
3190 #define M_FW_EQ_MNGT_CMD_STATUSPGRO	0x1
3191 #define V_FW_EQ_MNGT_CMD_STATUSPGRO(x)	((x) << S_FW_EQ_MNGT_CMD_STATUSPGRO)
3192 #define G_FW_EQ_MNGT_CMD_STATUSPGRO(x)	\
3193     (((x) >> S_FW_EQ_MNGT_CMD_STATUSPGRO) & M_FW_EQ_MNGT_CMD_STATUSPGRO)
3194 #define F_FW_EQ_MNGT_CMD_STATUSPGRO	V_FW_EQ_MNGT_CMD_STATUSPGRO(1U)
3195 
3196 #define S_FW_EQ_MNGT_CMD_FETCHNS	23
3197 #define M_FW_EQ_MNGT_CMD_FETCHNS	0x1
3198 #define V_FW_EQ_MNGT_CMD_FETCHNS(x)	((x) << S_FW_EQ_MNGT_CMD_FETCHNS)
3199 #define G_FW_EQ_MNGT_CMD_FETCHNS(x)	\
3200     (((x) >> S_FW_EQ_MNGT_CMD_FETCHNS) & M_FW_EQ_MNGT_CMD_FETCHNS)
3201 #define F_FW_EQ_MNGT_CMD_FETCHNS	V_FW_EQ_MNGT_CMD_FETCHNS(1U)
3202 
3203 #define S_FW_EQ_MNGT_CMD_FETCHRO	22
3204 #define M_FW_EQ_MNGT_CMD_FETCHRO	0x1
3205 #define V_FW_EQ_MNGT_CMD_FETCHRO(x)	((x) << S_FW_EQ_MNGT_CMD_FETCHRO)
3206 #define G_FW_EQ_MNGT_CMD_FETCHRO(x)	\
3207     (((x) >> S_FW_EQ_MNGT_CMD_FETCHRO) & M_FW_EQ_MNGT_CMD_FETCHRO)
3208 #define F_FW_EQ_MNGT_CMD_FETCHRO	V_FW_EQ_MNGT_CMD_FETCHRO(1U)
3209 
3210 #define S_FW_EQ_MNGT_CMD_HOSTFCMODE	20
3211 #define M_FW_EQ_MNGT_CMD_HOSTFCMODE	0x3
3212 #define V_FW_EQ_MNGT_CMD_HOSTFCMODE(x)	((x) << S_FW_EQ_MNGT_CMD_HOSTFCMODE)
3213 #define G_FW_EQ_MNGT_CMD_HOSTFCMODE(x)	\
3214     (((x) >> S_FW_EQ_MNGT_CMD_HOSTFCMODE) & M_FW_EQ_MNGT_CMD_HOSTFCMODE)
3215 
3216 #define S_FW_EQ_MNGT_CMD_CPRIO		19
3217 #define M_FW_EQ_MNGT_CMD_CPRIO		0x1
3218 #define V_FW_EQ_MNGT_CMD_CPRIO(x)	((x) << S_FW_EQ_MNGT_CMD_CPRIO)
3219 #define G_FW_EQ_MNGT_CMD_CPRIO(x)	\
3220     (((x) >> S_FW_EQ_MNGT_CMD_CPRIO) & M_FW_EQ_MNGT_CMD_CPRIO)
3221 #define F_FW_EQ_MNGT_CMD_CPRIO	V_FW_EQ_MNGT_CMD_CPRIO(1U)
3222 
3223 #define S_FW_EQ_MNGT_CMD_ONCHIP		18
3224 #define M_FW_EQ_MNGT_CMD_ONCHIP		0x1
3225 #define V_FW_EQ_MNGT_CMD_ONCHIP(x)	((x) << S_FW_EQ_MNGT_CMD_ONCHIP)
3226 #define G_FW_EQ_MNGT_CMD_ONCHIP(x)	\
3227     (((x) >> S_FW_EQ_MNGT_CMD_ONCHIP) & M_FW_EQ_MNGT_CMD_ONCHIP)
3228 #define F_FW_EQ_MNGT_CMD_ONCHIP	V_FW_EQ_MNGT_CMD_ONCHIP(1U)
3229 
3230 #define S_FW_EQ_MNGT_CMD_PCIECHN	16
3231 #define M_FW_EQ_MNGT_CMD_PCIECHN	0x3
3232 #define V_FW_EQ_MNGT_CMD_PCIECHN(x)	((x) << S_FW_EQ_MNGT_CMD_PCIECHN)
3233 #define G_FW_EQ_MNGT_CMD_PCIECHN(x)	\
3234     (((x) >> S_FW_EQ_MNGT_CMD_PCIECHN) & M_FW_EQ_MNGT_CMD_PCIECHN)
3235 
3236 #define S_FW_EQ_MNGT_CMD_IQID		0
3237 #define M_FW_EQ_MNGT_CMD_IQID		0xffff
3238 #define V_FW_EQ_MNGT_CMD_IQID(x)	((x) << S_FW_EQ_MNGT_CMD_IQID)
3239 #define G_FW_EQ_MNGT_CMD_IQID(x)	\
3240     (((x) >> S_FW_EQ_MNGT_CMD_IQID) & M_FW_EQ_MNGT_CMD_IQID)
3241 
3242 #define S_FW_EQ_MNGT_CMD_DCAEN		31
3243 #define M_FW_EQ_MNGT_CMD_DCAEN		0x1
3244 #define V_FW_EQ_MNGT_CMD_DCAEN(x)	((x) << S_FW_EQ_MNGT_CMD_DCAEN)
3245 #define G_FW_EQ_MNGT_CMD_DCAEN(x)	\
3246     (((x) >> S_FW_EQ_MNGT_CMD_DCAEN) & M_FW_EQ_MNGT_CMD_DCAEN)
3247 #define F_FW_EQ_MNGT_CMD_DCAEN	V_FW_EQ_MNGT_CMD_DCAEN(1U)
3248 
3249 #define S_FW_EQ_MNGT_CMD_DCACPU		26
3250 #define M_FW_EQ_MNGT_CMD_DCACPU		0x1f
3251 #define V_FW_EQ_MNGT_CMD_DCACPU(x)	((x) << S_FW_EQ_MNGT_CMD_DCACPU)
3252 #define G_FW_EQ_MNGT_CMD_DCACPU(x)	\
3253     (((x) >> S_FW_EQ_MNGT_CMD_DCACPU) & M_FW_EQ_MNGT_CMD_DCACPU)
3254 
3255 #define S_FW_EQ_MNGT_CMD_FBMIN		23
3256 #define M_FW_EQ_MNGT_CMD_FBMIN		0x7
3257 #define V_FW_EQ_MNGT_CMD_FBMIN(x)	((x) << S_FW_EQ_MNGT_CMD_FBMIN)
3258 #define G_FW_EQ_MNGT_CMD_FBMIN(x)	\
3259     (((x) >> S_FW_EQ_MNGT_CMD_FBMIN) & M_FW_EQ_MNGT_CMD_FBMIN)
3260 
3261 #define S_FW_EQ_MNGT_CMD_FBMAX		20
3262 #define M_FW_EQ_MNGT_CMD_FBMAX		0x7
3263 #define V_FW_EQ_MNGT_CMD_FBMAX(x)	((x) << S_FW_EQ_MNGT_CMD_FBMAX)
3264 #define G_FW_EQ_MNGT_CMD_FBMAX(x)	\
3265     (((x) >> S_FW_EQ_MNGT_CMD_FBMAX) & M_FW_EQ_MNGT_CMD_FBMAX)
3266 
3267 #define S_FW_EQ_MNGT_CMD_CIDXFTHRESHO		19
3268 #define M_FW_EQ_MNGT_CMD_CIDXFTHRESHO		0x1
3269 #define V_FW_EQ_MNGT_CMD_CIDXFTHRESHO(x)	\
3270     ((x) << S_FW_EQ_MNGT_CMD_CIDXFTHRESHO)
3271 #define G_FW_EQ_MNGT_CMD_CIDXFTHRESHO(x)	\
3272     (((x) >> S_FW_EQ_MNGT_CMD_CIDXFTHRESHO) & M_FW_EQ_MNGT_CMD_CIDXFTHRESHO)
3273 #define F_FW_EQ_MNGT_CMD_CIDXFTHRESHO	V_FW_EQ_MNGT_CMD_CIDXFTHRESHO(1U)
3274 
3275 #define S_FW_EQ_MNGT_CMD_CIDXFTHRESH	16
3276 #define M_FW_EQ_MNGT_CMD_CIDXFTHRESH	0x7
3277 #define V_FW_EQ_MNGT_CMD_CIDXFTHRESH(x)	((x) << S_FW_EQ_MNGT_CMD_CIDXFTHRESH)
3278 #define G_FW_EQ_MNGT_CMD_CIDXFTHRESH(x)	\
3279     (((x) >> S_FW_EQ_MNGT_CMD_CIDXFTHRESH) & M_FW_EQ_MNGT_CMD_CIDXFTHRESH)
3280 
3281 #define S_FW_EQ_MNGT_CMD_EQSIZE		0
3282 #define M_FW_EQ_MNGT_CMD_EQSIZE		0xffff
3283 #define V_FW_EQ_MNGT_CMD_EQSIZE(x)	((x) << S_FW_EQ_MNGT_CMD_EQSIZE)
3284 #define G_FW_EQ_MNGT_CMD_EQSIZE(x)	\
3285     (((x) >> S_FW_EQ_MNGT_CMD_EQSIZE) & M_FW_EQ_MNGT_CMD_EQSIZE)
3286 
3287 struct fw_eq_eth_cmd {
3288 	__be32 op_to_vfn;
3289 	__be32 alloc_to_len16;
3290 	__be32 eqid_pkd;
3291 	__be32 physeqid_pkd;
3292 	__be32 fetchszm_to_iqid;
3293 	__be32 dcaen_to_eqsize;
3294 	__be64 eqaddr;
3295 	__be32 viid_pkd;
3296 	__be32 r8_lo;
3297 	__be64 r9;
3298 };
3299 
3300 #define S_FW_EQ_ETH_CMD_PFN	8
3301 #define M_FW_EQ_ETH_CMD_PFN	0x7
3302 #define V_FW_EQ_ETH_CMD_PFN(x)	((x) << S_FW_EQ_ETH_CMD_PFN)
3303 #define G_FW_EQ_ETH_CMD_PFN(x)	\
3304     (((x) >> S_FW_EQ_ETH_CMD_PFN) & M_FW_EQ_ETH_CMD_PFN)
3305 
3306 #define S_FW_EQ_ETH_CMD_VFN	0
3307 #define M_FW_EQ_ETH_CMD_VFN	0xff
3308 #define V_FW_EQ_ETH_CMD_VFN(x)	((x) << S_FW_EQ_ETH_CMD_VFN)
3309 #define G_FW_EQ_ETH_CMD_VFN(x)	\
3310     (((x) >> S_FW_EQ_ETH_CMD_VFN) & M_FW_EQ_ETH_CMD_VFN)
3311 
3312 #define S_FW_EQ_ETH_CMD_ALLOC		31
3313 #define M_FW_EQ_ETH_CMD_ALLOC		0x1
3314 #define V_FW_EQ_ETH_CMD_ALLOC(x)	((x) << S_FW_EQ_ETH_CMD_ALLOC)
3315 #define G_FW_EQ_ETH_CMD_ALLOC(x)	\
3316     (((x) >> S_FW_EQ_ETH_CMD_ALLOC) & M_FW_EQ_ETH_CMD_ALLOC)
3317 #define F_FW_EQ_ETH_CMD_ALLOC	V_FW_EQ_ETH_CMD_ALLOC(1U)
3318 
3319 #define S_FW_EQ_ETH_CMD_FREE	30
3320 #define M_FW_EQ_ETH_CMD_FREE	0x1
3321 #define V_FW_EQ_ETH_CMD_FREE(x)	((x) << S_FW_EQ_ETH_CMD_FREE)
3322 #define G_FW_EQ_ETH_CMD_FREE(x)	\
3323     (((x) >> S_FW_EQ_ETH_CMD_FREE) & M_FW_EQ_ETH_CMD_FREE)
3324 #define F_FW_EQ_ETH_CMD_FREE	V_FW_EQ_ETH_CMD_FREE(1U)
3325 
3326 #define S_FW_EQ_ETH_CMD_MODIFY		29
3327 #define M_FW_EQ_ETH_CMD_MODIFY		0x1
3328 #define V_FW_EQ_ETH_CMD_MODIFY(x)	((x) << S_FW_EQ_ETH_CMD_MODIFY)
3329 #define G_FW_EQ_ETH_CMD_MODIFY(x)	\
3330     (((x) >> S_FW_EQ_ETH_CMD_MODIFY) & M_FW_EQ_ETH_CMD_MODIFY)
3331 #define F_FW_EQ_ETH_CMD_MODIFY	V_FW_EQ_ETH_CMD_MODIFY(1U)
3332 
3333 #define S_FW_EQ_ETH_CMD_EQSTART		28
3334 #define M_FW_EQ_ETH_CMD_EQSTART		0x1
3335 #define V_FW_EQ_ETH_CMD_EQSTART(x)	((x) << S_FW_EQ_ETH_CMD_EQSTART)
3336 #define G_FW_EQ_ETH_CMD_EQSTART(x)	\
3337     (((x) >> S_FW_EQ_ETH_CMD_EQSTART) & M_FW_EQ_ETH_CMD_EQSTART)
3338 #define F_FW_EQ_ETH_CMD_EQSTART	V_FW_EQ_ETH_CMD_EQSTART(1U)
3339 
3340 #define S_FW_EQ_ETH_CMD_EQSTOP		27
3341 #define M_FW_EQ_ETH_CMD_EQSTOP		0x1
3342 #define V_FW_EQ_ETH_CMD_EQSTOP(x)	((x) << S_FW_EQ_ETH_CMD_EQSTOP)
3343 #define G_FW_EQ_ETH_CMD_EQSTOP(x)	\
3344     (((x) >> S_FW_EQ_ETH_CMD_EQSTOP) & M_FW_EQ_ETH_CMD_EQSTOP)
3345 #define F_FW_EQ_ETH_CMD_EQSTOP	V_FW_EQ_ETH_CMD_EQSTOP(1U)
3346 
3347 #define S_FW_EQ_ETH_CMD_EQID	0
3348 #define M_FW_EQ_ETH_CMD_EQID	0xfffff
3349 #define V_FW_EQ_ETH_CMD_EQID(x)	((x) << S_FW_EQ_ETH_CMD_EQID)
3350 #define G_FW_EQ_ETH_CMD_EQID(x)	\
3351     (((x) >> S_FW_EQ_ETH_CMD_EQID) & M_FW_EQ_ETH_CMD_EQID)
3352 
3353 #define S_FW_EQ_ETH_CMD_PHYSEQID	0
3354 #define M_FW_EQ_ETH_CMD_PHYSEQID	0xfffff
3355 #define V_FW_EQ_ETH_CMD_PHYSEQID(x)	((x) << S_FW_EQ_ETH_CMD_PHYSEQID)
3356 #define G_FW_EQ_ETH_CMD_PHYSEQID(x)	\
3357     (((x) >> S_FW_EQ_ETH_CMD_PHYSEQID) & M_FW_EQ_ETH_CMD_PHYSEQID)
3358 
3359 #define S_FW_EQ_ETH_CMD_FETCHSZM	26
3360 #define M_FW_EQ_ETH_CMD_FETCHSZM	0x1
3361 #define V_FW_EQ_ETH_CMD_FETCHSZM(x)	((x) << S_FW_EQ_ETH_CMD_FETCHSZM)
3362 #define G_FW_EQ_ETH_CMD_FETCHSZM(x)	\
3363     (((x) >> S_FW_EQ_ETH_CMD_FETCHSZM) & M_FW_EQ_ETH_CMD_FETCHSZM)
3364 #define F_FW_EQ_ETH_CMD_FETCHSZM	V_FW_EQ_ETH_CMD_FETCHSZM(1U)
3365 
3366 #define S_FW_EQ_ETH_CMD_STATUSPGNS	25
3367 #define M_FW_EQ_ETH_CMD_STATUSPGNS	0x1
3368 #define V_FW_EQ_ETH_CMD_STATUSPGNS(x)	((x) << S_FW_EQ_ETH_CMD_STATUSPGNS)
3369 #define G_FW_EQ_ETH_CMD_STATUSPGNS(x)	\
3370     (((x) >> S_FW_EQ_ETH_CMD_STATUSPGNS) & M_FW_EQ_ETH_CMD_STATUSPGNS)
3371 #define F_FW_EQ_ETH_CMD_STATUSPGNS	V_FW_EQ_ETH_CMD_STATUSPGNS(1U)
3372 
3373 #define S_FW_EQ_ETH_CMD_STATUSPGRO	24
3374 #define M_FW_EQ_ETH_CMD_STATUSPGRO	0x1
3375 #define V_FW_EQ_ETH_CMD_STATUSPGRO(x)	((x) << S_FW_EQ_ETH_CMD_STATUSPGRO)
3376 #define G_FW_EQ_ETH_CMD_STATUSPGRO(x)	\
3377     (((x) >> S_FW_EQ_ETH_CMD_STATUSPGRO) & M_FW_EQ_ETH_CMD_STATUSPGRO)
3378 #define F_FW_EQ_ETH_CMD_STATUSPGRO	V_FW_EQ_ETH_CMD_STATUSPGRO(1U)
3379 
3380 #define S_FW_EQ_ETH_CMD_FETCHNS		23
3381 #define M_FW_EQ_ETH_CMD_FETCHNS		0x1
3382 #define V_FW_EQ_ETH_CMD_FETCHNS(x)	((x) << S_FW_EQ_ETH_CMD_FETCHNS)
3383 #define G_FW_EQ_ETH_CMD_FETCHNS(x)	\
3384     (((x) >> S_FW_EQ_ETH_CMD_FETCHNS) & M_FW_EQ_ETH_CMD_FETCHNS)
3385 #define F_FW_EQ_ETH_CMD_FETCHNS	V_FW_EQ_ETH_CMD_FETCHNS(1U)
3386 
3387 #define S_FW_EQ_ETH_CMD_FETCHRO		22
3388 #define M_FW_EQ_ETH_CMD_FETCHRO		0x1
3389 #define V_FW_EQ_ETH_CMD_FETCHRO(x)	((x) << S_FW_EQ_ETH_CMD_FETCHRO)
3390 #define G_FW_EQ_ETH_CMD_FETCHRO(x)	\
3391     (((x) >> S_FW_EQ_ETH_CMD_FETCHRO) & M_FW_EQ_ETH_CMD_FETCHRO)
3392 #define F_FW_EQ_ETH_CMD_FETCHRO	V_FW_EQ_ETH_CMD_FETCHRO(1U)
3393 
3394 #define S_FW_EQ_ETH_CMD_HOSTFCMODE	20
3395 #define M_FW_EQ_ETH_CMD_HOSTFCMODE	0x3
3396 #define V_FW_EQ_ETH_CMD_HOSTFCMODE(x)	((x) << S_FW_EQ_ETH_CMD_HOSTFCMODE)
3397 #define G_FW_EQ_ETH_CMD_HOSTFCMODE(x)	\
3398     (((x) >> S_FW_EQ_ETH_CMD_HOSTFCMODE) & M_FW_EQ_ETH_CMD_HOSTFCMODE)
3399 
3400 #define S_FW_EQ_ETH_CMD_CPRIO		19
3401 #define M_FW_EQ_ETH_CMD_CPRIO		0x1
3402 #define V_FW_EQ_ETH_CMD_CPRIO(x)	((x) << S_FW_EQ_ETH_CMD_CPRIO)
3403 #define G_FW_EQ_ETH_CMD_CPRIO(x)	\
3404     (((x) >> S_FW_EQ_ETH_CMD_CPRIO) & M_FW_EQ_ETH_CMD_CPRIO)
3405 #define F_FW_EQ_ETH_CMD_CPRIO	V_FW_EQ_ETH_CMD_CPRIO(1U)
3406 
3407 #define S_FW_EQ_ETH_CMD_ONCHIP		18
3408 #define M_FW_EQ_ETH_CMD_ONCHIP		0x1
3409 #define V_FW_EQ_ETH_CMD_ONCHIP(x)	((x) << S_FW_EQ_ETH_CMD_ONCHIP)
3410 #define G_FW_EQ_ETH_CMD_ONCHIP(x)	\
3411     (((x) >> S_FW_EQ_ETH_CMD_ONCHIP) & M_FW_EQ_ETH_CMD_ONCHIP)
3412 #define F_FW_EQ_ETH_CMD_ONCHIP	V_FW_EQ_ETH_CMD_ONCHIP(1U)
3413 
3414 #define S_FW_EQ_ETH_CMD_PCIECHN		16
3415 #define M_FW_EQ_ETH_CMD_PCIECHN		0x3
3416 #define V_FW_EQ_ETH_CMD_PCIECHN(x)	((x) << S_FW_EQ_ETH_CMD_PCIECHN)
3417 #define G_FW_EQ_ETH_CMD_PCIECHN(x)	\
3418     (((x) >> S_FW_EQ_ETH_CMD_PCIECHN) & M_FW_EQ_ETH_CMD_PCIECHN)
3419 
3420 #define S_FW_EQ_ETH_CMD_IQID	0
3421 #define M_FW_EQ_ETH_CMD_IQID	0xffff
3422 #define V_FW_EQ_ETH_CMD_IQID(x)	((x) << S_FW_EQ_ETH_CMD_IQID)
3423 #define G_FW_EQ_ETH_CMD_IQID(x)	\
3424     (((x) >> S_FW_EQ_ETH_CMD_IQID) & M_FW_EQ_ETH_CMD_IQID)
3425 
3426 #define S_FW_EQ_ETH_CMD_DCAEN		31
3427 #define M_FW_EQ_ETH_CMD_DCAEN		0x1
3428 #define V_FW_EQ_ETH_CMD_DCAEN(x)	((x) << S_FW_EQ_ETH_CMD_DCAEN)
3429 #define G_FW_EQ_ETH_CMD_DCAEN(x)	\
3430     (((x) >> S_FW_EQ_ETH_CMD_DCAEN) & M_FW_EQ_ETH_CMD_DCAEN)
3431 #define F_FW_EQ_ETH_CMD_DCAEN	V_FW_EQ_ETH_CMD_DCAEN(1U)
3432 
3433 #define S_FW_EQ_ETH_CMD_DCACPU		26
3434 #define M_FW_EQ_ETH_CMD_DCACPU		0x1f
3435 #define V_FW_EQ_ETH_CMD_DCACPU(x)	((x) << S_FW_EQ_ETH_CMD_DCACPU)
3436 #define G_FW_EQ_ETH_CMD_DCACPU(x)	\
3437     (((x) >> S_FW_EQ_ETH_CMD_DCACPU) & M_FW_EQ_ETH_CMD_DCACPU)
3438 
3439 #define S_FW_EQ_ETH_CMD_FBMIN		23
3440 #define M_FW_EQ_ETH_CMD_FBMIN		0x7
3441 #define V_FW_EQ_ETH_CMD_FBMIN(x)	((x) << S_FW_EQ_ETH_CMD_FBMIN)
3442 #define G_FW_EQ_ETH_CMD_FBMIN(x)	\
3443     (((x) >> S_FW_EQ_ETH_CMD_FBMIN) & M_FW_EQ_ETH_CMD_FBMIN)
3444 
3445 #define S_FW_EQ_ETH_CMD_FBMAX		20
3446 #define M_FW_EQ_ETH_CMD_FBMAX		0x7
3447 #define V_FW_EQ_ETH_CMD_FBMAX(x)	((x) << S_FW_EQ_ETH_CMD_FBMAX)
3448 #define G_FW_EQ_ETH_CMD_FBMAX(x)	\
3449     (((x) >> S_FW_EQ_ETH_CMD_FBMAX) & M_FW_EQ_ETH_CMD_FBMAX)
3450 
3451 #define S_FW_EQ_ETH_CMD_CIDXFTHRESHO	19
3452 #define M_FW_EQ_ETH_CMD_CIDXFTHRESHO	0x1
3453 #define V_FW_EQ_ETH_CMD_CIDXFTHRESHO(x)	((x) << S_FW_EQ_ETH_CMD_CIDXFTHRESHO)
3454 #define G_FW_EQ_ETH_CMD_CIDXFTHRESHO(x)	\
3455     (((x) >> S_FW_EQ_ETH_CMD_CIDXFTHRESHO) & M_FW_EQ_ETH_CMD_CIDXFTHRESHO)
3456 #define F_FW_EQ_ETH_CMD_CIDXFTHRESHO	V_FW_EQ_ETH_CMD_CIDXFTHRESHO(1U)
3457 
3458 #define S_FW_EQ_ETH_CMD_CIDXFTHRESH	16
3459 #define M_FW_EQ_ETH_CMD_CIDXFTHRESH	0x7
3460 #define V_FW_EQ_ETH_CMD_CIDXFTHRESH(x)	((x) << S_FW_EQ_ETH_CMD_CIDXFTHRESH)
3461 #define G_FW_EQ_ETH_CMD_CIDXFTHRESH(x)	\
3462     (((x) >> S_FW_EQ_ETH_CMD_CIDXFTHRESH) & M_FW_EQ_ETH_CMD_CIDXFTHRESH)
3463 
3464 #define S_FW_EQ_ETH_CMD_EQSIZE		0
3465 #define M_FW_EQ_ETH_CMD_EQSIZE		0xffff
3466 #define V_FW_EQ_ETH_CMD_EQSIZE(x)	((x) << S_FW_EQ_ETH_CMD_EQSIZE)
3467 #define G_FW_EQ_ETH_CMD_EQSIZE(x)	\
3468     (((x) >> S_FW_EQ_ETH_CMD_EQSIZE) & M_FW_EQ_ETH_CMD_EQSIZE)
3469 
3470 #define S_FW_EQ_ETH_CMD_VIID	16
3471 #define M_FW_EQ_ETH_CMD_VIID	0xfff
3472 #define V_FW_EQ_ETH_CMD_VIID(x)	((x) << S_FW_EQ_ETH_CMD_VIID)
3473 #define G_FW_EQ_ETH_CMD_VIID(x)	\
3474     (((x) >> S_FW_EQ_ETH_CMD_VIID) & M_FW_EQ_ETH_CMD_VIID)
3475 
3476 struct fw_eq_ctrl_cmd {
3477 	__be32 op_to_vfn;
3478 	__be32 alloc_to_len16;
3479 	__be32 cmpliqid_eqid;
3480 	__be32 physeqid_pkd;
3481 	__be32 fetchszm_to_iqid;
3482 	__be32 dcaen_to_eqsize;
3483 	__be64 eqaddr;
3484 };
3485 
3486 #define S_FW_EQ_CTRL_CMD_PFN	8
3487 #define M_FW_EQ_CTRL_CMD_PFN	0x7
3488 #define V_FW_EQ_CTRL_CMD_PFN(x)	((x) << S_FW_EQ_CTRL_CMD_PFN)
3489 #define G_FW_EQ_CTRL_CMD_PFN(x)	\
3490     (((x) >> S_FW_EQ_CTRL_CMD_PFN) & M_FW_EQ_CTRL_CMD_PFN)
3491 
3492 #define S_FW_EQ_CTRL_CMD_VFN	0
3493 #define M_FW_EQ_CTRL_CMD_VFN	0xff
3494 #define V_FW_EQ_CTRL_CMD_VFN(x)	((x) << S_FW_EQ_CTRL_CMD_VFN)
3495 #define G_FW_EQ_CTRL_CMD_VFN(x)	\
3496     (((x) >> S_FW_EQ_CTRL_CMD_VFN) & M_FW_EQ_CTRL_CMD_VFN)
3497 
3498 #define S_FW_EQ_CTRL_CMD_ALLOC		31
3499 #define M_FW_EQ_CTRL_CMD_ALLOC		0x1
3500 #define V_FW_EQ_CTRL_CMD_ALLOC(x)	((x) << S_FW_EQ_CTRL_CMD_ALLOC)
3501 #define G_FW_EQ_CTRL_CMD_ALLOC(x)	\
3502     (((x) >> S_FW_EQ_CTRL_CMD_ALLOC) & M_FW_EQ_CTRL_CMD_ALLOC)
3503 #define F_FW_EQ_CTRL_CMD_ALLOC	V_FW_EQ_CTRL_CMD_ALLOC(1U)
3504 
3505 #define S_FW_EQ_CTRL_CMD_FREE		30
3506 #define M_FW_EQ_CTRL_CMD_FREE		0x1
3507 #define V_FW_EQ_CTRL_CMD_FREE(x)	((x) << S_FW_EQ_CTRL_CMD_FREE)
3508 #define G_FW_EQ_CTRL_CMD_FREE(x)	\
3509     (((x) >> S_FW_EQ_CTRL_CMD_FREE) & M_FW_EQ_CTRL_CMD_FREE)
3510 #define F_FW_EQ_CTRL_CMD_FREE	V_FW_EQ_CTRL_CMD_FREE(1U)
3511 
3512 #define S_FW_EQ_CTRL_CMD_MODIFY		29
3513 #define M_FW_EQ_CTRL_CMD_MODIFY		0x1
3514 #define V_FW_EQ_CTRL_CMD_MODIFY(x)	((x) << S_FW_EQ_CTRL_CMD_MODIFY)
3515 #define G_FW_EQ_CTRL_CMD_MODIFY(x)	\
3516     (((x) >> S_FW_EQ_CTRL_CMD_MODIFY) & M_FW_EQ_CTRL_CMD_MODIFY)
3517 #define F_FW_EQ_CTRL_CMD_MODIFY	V_FW_EQ_CTRL_CMD_MODIFY(1U)
3518 
3519 #define S_FW_EQ_CTRL_CMD_EQSTART	28
3520 #define M_FW_EQ_CTRL_CMD_EQSTART	0x1
3521 #define V_FW_EQ_CTRL_CMD_EQSTART(x)	((x) << S_FW_EQ_CTRL_CMD_EQSTART)
3522 #define G_FW_EQ_CTRL_CMD_EQSTART(x)	\
3523     (((x) >> S_FW_EQ_CTRL_CMD_EQSTART) & M_FW_EQ_CTRL_CMD_EQSTART)
3524 #define F_FW_EQ_CTRL_CMD_EQSTART	V_FW_EQ_CTRL_CMD_EQSTART(1U)
3525 
3526 #define S_FW_EQ_CTRL_CMD_EQSTOP		27
3527 #define M_FW_EQ_CTRL_CMD_EQSTOP		0x1
3528 #define V_FW_EQ_CTRL_CMD_EQSTOP(x)	((x) << S_FW_EQ_CTRL_CMD_EQSTOP)
3529 #define G_FW_EQ_CTRL_CMD_EQSTOP(x)	\
3530     (((x) >> S_FW_EQ_CTRL_CMD_EQSTOP) & M_FW_EQ_CTRL_CMD_EQSTOP)
3531 #define F_FW_EQ_CTRL_CMD_EQSTOP	V_FW_EQ_CTRL_CMD_EQSTOP(1U)
3532 
3533 #define S_FW_EQ_CTRL_CMD_CMPLIQID	20
3534 #define M_FW_EQ_CTRL_CMD_CMPLIQID	0xfff
3535 #define V_FW_EQ_CTRL_CMD_CMPLIQID(x)	((x) << S_FW_EQ_CTRL_CMD_CMPLIQID)
3536 #define G_FW_EQ_CTRL_CMD_CMPLIQID(x)	\
3537     (((x) >> S_FW_EQ_CTRL_CMD_CMPLIQID) & M_FW_EQ_CTRL_CMD_CMPLIQID)
3538 
3539 #define S_FW_EQ_CTRL_CMD_EQID		0
3540 #define M_FW_EQ_CTRL_CMD_EQID		0xfffff
3541 #define V_FW_EQ_CTRL_CMD_EQID(x)	((x) << S_FW_EQ_CTRL_CMD_EQID)
3542 #define G_FW_EQ_CTRL_CMD_EQID(x)	\
3543     (((x) >> S_FW_EQ_CTRL_CMD_EQID) & M_FW_EQ_CTRL_CMD_EQID)
3544 
3545 #define S_FW_EQ_CTRL_CMD_PHYSEQID	0
3546 #define M_FW_EQ_CTRL_CMD_PHYSEQID	0xfffff
3547 #define V_FW_EQ_CTRL_CMD_PHYSEQID(x)	((x) << S_FW_EQ_CTRL_CMD_PHYSEQID)
3548 #define G_FW_EQ_CTRL_CMD_PHYSEQID(x)	\
3549     (((x) >> S_FW_EQ_CTRL_CMD_PHYSEQID) & M_FW_EQ_CTRL_CMD_PHYSEQID)
3550 
3551 #define S_FW_EQ_CTRL_CMD_FETCHSZM	26
3552 #define M_FW_EQ_CTRL_CMD_FETCHSZM	0x1
3553 #define V_FW_EQ_CTRL_CMD_FETCHSZM(x)	((x) << S_FW_EQ_CTRL_CMD_FETCHSZM)
3554 #define G_FW_EQ_CTRL_CMD_FETCHSZM(x)	\
3555     (((x) >> S_FW_EQ_CTRL_CMD_FETCHSZM) & M_FW_EQ_CTRL_CMD_FETCHSZM)
3556 #define F_FW_EQ_CTRL_CMD_FETCHSZM	V_FW_EQ_CTRL_CMD_FETCHSZM(1U)
3557 
3558 #define S_FW_EQ_CTRL_CMD_STATUSPGNS	25
3559 #define M_FW_EQ_CTRL_CMD_STATUSPGNS	0x1
3560 #define V_FW_EQ_CTRL_CMD_STATUSPGNS(x)	((x) << S_FW_EQ_CTRL_CMD_STATUSPGNS)
3561 #define G_FW_EQ_CTRL_CMD_STATUSPGNS(x)	\
3562     (((x) >> S_FW_EQ_CTRL_CMD_STATUSPGNS) & M_FW_EQ_CTRL_CMD_STATUSPGNS)
3563 #define F_FW_EQ_CTRL_CMD_STATUSPGNS	V_FW_EQ_CTRL_CMD_STATUSPGNS(1U)
3564 
3565 #define S_FW_EQ_CTRL_CMD_STATUSPGRO	24
3566 #define M_FW_EQ_CTRL_CMD_STATUSPGRO	0x1
3567 #define V_FW_EQ_CTRL_CMD_STATUSPGRO(x)	((x) << S_FW_EQ_CTRL_CMD_STATUSPGRO)
3568 #define G_FW_EQ_CTRL_CMD_STATUSPGRO(x)	\
3569     (((x) >> S_FW_EQ_CTRL_CMD_STATUSPGRO) & M_FW_EQ_CTRL_CMD_STATUSPGRO)
3570 #define F_FW_EQ_CTRL_CMD_STATUSPGRO	V_FW_EQ_CTRL_CMD_STATUSPGRO(1U)
3571 
3572 #define S_FW_EQ_CTRL_CMD_FETCHNS	23
3573 #define M_FW_EQ_CTRL_CMD_FETCHNS	0x1
3574 #define V_FW_EQ_CTRL_CMD_FETCHNS(x)	((x) << S_FW_EQ_CTRL_CMD_FETCHNS)
3575 #define G_FW_EQ_CTRL_CMD_FETCHNS(x)	\
3576     (((x) >> S_FW_EQ_CTRL_CMD_FETCHNS) & M_FW_EQ_CTRL_CMD_FETCHNS)
3577 #define F_FW_EQ_CTRL_CMD_FETCHNS	V_FW_EQ_CTRL_CMD_FETCHNS(1U)
3578 
3579 #define S_FW_EQ_CTRL_CMD_FETCHRO	22
3580 #define M_FW_EQ_CTRL_CMD_FETCHRO	0x1
3581 #define V_FW_EQ_CTRL_CMD_FETCHRO(x)	((x) << S_FW_EQ_CTRL_CMD_FETCHRO)
3582 #define G_FW_EQ_CTRL_CMD_FETCHRO(x)	\
3583     (((x) >> S_FW_EQ_CTRL_CMD_FETCHRO) & M_FW_EQ_CTRL_CMD_FETCHRO)
3584 #define F_FW_EQ_CTRL_CMD_FETCHRO	V_FW_EQ_CTRL_CMD_FETCHRO(1U)
3585 
3586 #define S_FW_EQ_CTRL_CMD_HOSTFCMODE	20
3587 #define M_FW_EQ_CTRL_CMD_HOSTFCMODE	0x3
3588 #define V_FW_EQ_CTRL_CMD_HOSTFCMODE(x)	((x) << S_FW_EQ_CTRL_CMD_HOSTFCMODE)
3589 #define G_FW_EQ_CTRL_CMD_HOSTFCMODE(x)	\
3590     (((x) >> S_FW_EQ_CTRL_CMD_HOSTFCMODE) & M_FW_EQ_CTRL_CMD_HOSTFCMODE)
3591 
3592 #define S_FW_EQ_CTRL_CMD_CPRIO		19
3593 #define M_FW_EQ_CTRL_CMD_CPRIO		0x1
3594 #define V_FW_EQ_CTRL_CMD_CPRIO(x)	((x) << S_FW_EQ_CTRL_CMD_CPRIO)
3595 #define G_FW_EQ_CTRL_CMD_CPRIO(x)	\
3596     (((x) >> S_FW_EQ_CTRL_CMD_CPRIO) & M_FW_EQ_CTRL_CMD_CPRIO)
3597 #define F_FW_EQ_CTRL_CMD_CPRIO	V_FW_EQ_CTRL_CMD_CPRIO(1U)
3598 
3599 #define S_FW_EQ_CTRL_CMD_ONCHIP		18
3600 #define M_FW_EQ_CTRL_CMD_ONCHIP		0x1
3601 #define V_FW_EQ_CTRL_CMD_ONCHIP(x)	((x) << S_FW_EQ_CTRL_CMD_ONCHIP)
3602 #define G_FW_EQ_CTRL_CMD_ONCHIP(x)	\
3603     (((x) >> S_FW_EQ_CTRL_CMD_ONCHIP) & M_FW_EQ_CTRL_CMD_ONCHIP)
3604 #define F_FW_EQ_CTRL_CMD_ONCHIP	V_FW_EQ_CTRL_CMD_ONCHIP(1U)
3605 
3606 #define S_FW_EQ_CTRL_CMD_PCIECHN	16
3607 #define M_FW_EQ_CTRL_CMD_PCIECHN	0x3
3608 #define V_FW_EQ_CTRL_CMD_PCIECHN(x)	((x) << S_FW_EQ_CTRL_CMD_PCIECHN)
3609 #define G_FW_EQ_CTRL_CMD_PCIECHN(x)	\
3610     (((x) >> S_FW_EQ_CTRL_CMD_PCIECHN) & M_FW_EQ_CTRL_CMD_PCIECHN)
3611 
3612 #define S_FW_EQ_CTRL_CMD_IQID		0
3613 #define M_FW_EQ_CTRL_CMD_IQID		0xffff
3614 #define V_FW_EQ_CTRL_CMD_IQID(x)	((x) << S_FW_EQ_CTRL_CMD_IQID)
3615 #define G_FW_EQ_CTRL_CMD_IQID(x)	\
3616     (((x) >> S_FW_EQ_CTRL_CMD_IQID) & M_FW_EQ_CTRL_CMD_IQID)
3617 
3618 #define S_FW_EQ_CTRL_CMD_DCAEN		31
3619 #define M_FW_EQ_CTRL_CMD_DCAEN		0x1
3620 #define V_FW_EQ_CTRL_CMD_DCAEN(x)	((x) << S_FW_EQ_CTRL_CMD_DCAEN)
3621 #define G_FW_EQ_CTRL_CMD_DCAEN(x)	\
3622     (((x) >> S_FW_EQ_CTRL_CMD_DCAEN) & M_FW_EQ_CTRL_CMD_DCAEN)
3623 #define F_FW_EQ_CTRL_CMD_DCAEN	V_FW_EQ_CTRL_CMD_DCAEN(1U)
3624 
3625 #define S_FW_EQ_CTRL_CMD_DCACPU		26
3626 #define M_FW_EQ_CTRL_CMD_DCACPU		0x1f
3627 #define V_FW_EQ_CTRL_CMD_DCACPU(x)	((x) << S_FW_EQ_CTRL_CMD_DCACPU)
3628 #define G_FW_EQ_CTRL_CMD_DCACPU(x)	\
3629     (((x) >> S_FW_EQ_CTRL_CMD_DCACPU) & M_FW_EQ_CTRL_CMD_DCACPU)
3630 
3631 #define S_FW_EQ_CTRL_CMD_FBMIN		23
3632 #define M_FW_EQ_CTRL_CMD_FBMIN		0x7
3633 #define V_FW_EQ_CTRL_CMD_FBMIN(x)	((x) << S_FW_EQ_CTRL_CMD_FBMIN)
3634 #define G_FW_EQ_CTRL_CMD_FBMIN(x)	\
3635     (((x) >> S_FW_EQ_CTRL_CMD_FBMIN) & M_FW_EQ_CTRL_CMD_FBMIN)
3636 
3637 #define S_FW_EQ_CTRL_CMD_FBMAX		20
3638 #define M_FW_EQ_CTRL_CMD_FBMAX		0x7
3639 #define V_FW_EQ_CTRL_CMD_FBMAX(x)	((x) << S_FW_EQ_CTRL_CMD_FBMAX)
3640 #define G_FW_EQ_CTRL_CMD_FBMAX(x)	\
3641     (((x) >> S_FW_EQ_CTRL_CMD_FBMAX) & M_FW_EQ_CTRL_CMD_FBMAX)
3642 
3643 #define S_FW_EQ_CTRL_CMD_CIDXFTHRESHO		19
3644 #define M_FW_EQ_CTRL_CMD_CIDXFTHRESHO		0x1
3645 #define V_FW_EQ_CTRL_CMD_CIDXFTHRESHO(x)	\
3646     ((x) << S_FW_EQ_CTRL_CMD_CIDXFTHRESHO)
3647 #define G_FW_EQ_CTRL_CMD_CIDXFTHRESHO(x)	\
3648     (((x) >> S_FW_EQ_CTRL_CMD_CIDXFTHRESHO) & M_FW_EQ_CTRL_CMD_CIDXFTHRESHO)
3649 #define F_FW_EQ_CTRL_CMD_CIDXFTHRESHO	V_FW_EQ_CTRL_CMD_CIDXFTHRESHO(1U)
3650 
3651 #define S_FW_EQ_CTRL_CMD_CIDXFTHRESH	16
3652 #define M_FW_EQ_CTRL_CMD_CIDXFTHRESH	0x7
3653 #define V_FW_EQ_CTRL_CMD_CIDXFTHRESH(x)	((x) << S_FW_EQ_CTRL_CMD_CIDXFTHRESH)
3654 #define G_FW_EQ_CTRL_CMD_CIDXFTHRESH(x)	\
3655     (((x) >> S_FW_EQ_CTRL_CMD_CIDXFTHRESH) & M_FW_EQ_CTRL_CMD_CIDXFTHRESH)
3656 
3657 #define S_FW_EQ_CTRL_CMD_EQSIZE		0
3658 #define M_FW_EQ_CTRL_CMD_EQSIZE		0xffff
3659 #define V_FW_EQ_CTRL_CMD_EQSIZE(x)	((x) << S_FW_EQ_CTRL_CMD_EQSIZE)
3660 #define G_FW_EQ_CTRL_CMD_EQSIZE(x)	\
3661     (((x) >> S_FW_EQ_CTRL_CMD_EQSIZE) & M_FW_EQ_CTRL_CMD_EQSIZE)
3662 
3663 struct fw_eq_ofld_cmd {
3664 	__be32 op_to_vfn;
3665 	__be32 alloc_to_len16;
3666 	__be32 eqid_pkd;
3667 	__be32 physeqid_pkd;
3668 	__be32 fetchszm_to_iqid;
3669 	__be32 dcaen_to_eqsize;
3670 	__be64 eqaddr;
3671 };
3672 
3673 #define S_FW_EQ_OFLD_CMD_PFN	8
3674 #define M_FW_EQ_OFLD_CMD_PFN	0x7
3675 #define V_FW_EQ_OFLD_CMD_PFN(x)	((x) << S_FW_EQ_OFLD_CMD_PFN)
3676 #define G_FW_EQ_OFLD_CMD_PFN(x)	\
3677     (((x) >> S_FW_EQ_OFLD_CMD_PFN) & M_FW_EQ_OFLD_CMD_PFN)
3678 
3679 #define S_FW_EQ_OFLD_CMD_VFN	0
3680 #define M_FW_EQ_OFLD_CMD_VFN	0xff
3681 #define V_FW_EQ_OFLD_CMD_VFN(x)	((x) << S_FW_EQ_OFLD_CMD_VFN)
3682 #define G_FW_EQ_OFLD_CMD_VFN(x)	\
3683     (((x) >> S_FW_EQ_OFLD_CMD_VFN) & M_FW_EQ_OFLD_CMD_VFN)
3684 
3685 #define S_FW_EQ_OFLD_CMD_ALLOC		31
3686 #define M_FW_EQ_OFLD_CMD_ALLOC		0x1
3687 #define V_FW_EQ_OFLD_CMD_ALLOC(x)	((x) << S_FW_EQ_OFLD_CMD_ALLOC)
3688 #define G_FW_EQ_OFLD_CMD_ALLOC(x)	\
3689     (((x) >> S_FW_EQ_OFLD_CMD_ALLOC) & M_FW_EQ_OFLD_CMD_ALLOC)
3690 #define F_FW_EQ_OFLD_CMD_ALLOC	V_FW_EQ_OFLD_CMD_ALLOC(1U)
3691 
3692 #define S_FW_EQ_OFLD_CMD_FREE		30
3693 #define M_FW_EQ_OFLD_CMD_FREE		0x1
3694 #define V_FW_EQ_OFLD_CMD_FREE(x)	((x) << S_FW_EQ_OFLD_CMD_FREE)
3695 #define G_FW_EQ_OFLD_CMD_FREE(x)	\
3696     (((x) >> S_FW_EQ_OFLD_CMD_FREE) & M_FW_EQ_OFLD_CMD_FREE)
3697 #define F_FW_EQ_OFLD_CMD_FREE	V_FW_EQ_OFLD_CMD_FREE(1U)
3698 
3699 #define S_FW_EQ_OFLD_CMD_MODIFY		29
3700 #define M_FW_EQ_OFLD_CMD_MODIFY		0x1
3701 #define V_FW_EQ_OFLD_CMD_MODIFY(x)	((x) << S_FW_EQ_OFLD_CMD_MODIFY)
3702 #define G_FW_EQ_OFLD_CMD_MODIFY(x)	\
3703     (((x) >> S_FW_EQ_OFLD_CMD_MODIFY) & M_FW_EQ_OFLD_CMD_MODIFY)
3704 #define F_FW_EQ_OFLD_CMD_MODIFY	V_FW_EQ_OFLD_CMD_MODIFY(1U)
3705 
3706 #define S_FW_EQ_OFLD_CMD_EQSTART	28
3707 #define M_FW_EQ_OFLD_CMD_EQSTART	0x1
3708 #define V_FW_EQ_OFLD_CMD_EQSTART(x)	((x) << S_FW_EQ_OFLD_CMD_EQSTART)
3709 #define G_FW_EQ_OFLD_CMD_EQSTART(x)	\
3710     (((x) >> S_FW_EQ_OFLD_CMD_EQSTART) & M_FW_EQ_OFLD_CMD_EQSTART)
3711 #define F_FW_EQ_OFLD_CMD_EQSTART	V_FW_EQ_OFLD_CMD_EQSTART(1U)
3712 
3713 #define S_FW_EQ_OFLD_CMD_EQSTOP		27
3714 #define M_FW_EQ_OFLD_CMD_EQSTOP		0x1
3715 #define V_FW_EQ_OFLD_CMD_EQSTOP(x)	((x) << S_FW_EQ_OFLD_CMD_EQSTOP)
3716 #define G_FW_EQ_OFLD_CMD_EQSTOP(x)	\
3717     (((x) >> S_FW_EQ_OFLD_CMD_EQSTOP) & M_FW_EQ_OFLD_CMD_EQSTOP)
3718 #define F_FW_EQ_OFLD_CMD_EQSTOP	V_FW_EQ_OFLD_CMD_EQSTOP(1U)
3719 
3720 #define S_FW_EQ_OFLD_CMD_EQID		0
3721 #define M_FW_EQ_OFLD_CMD_EQID		0xfffff
3722 #define V_FW_EQ_OFLD_CMD_EQID(x)	((x) << S_FW_EQ_OFLD_CMD_EQID)
3723 #define G_FW_EQ_OFLD_CMD_EQID(x)	\
3724     (((x) >> S_FW_EQ_OFLD_CMD_EQID) & M_FW_EQ_OFLD_CMD_EQID)
3725 
3726 #define S_FW_EQ_OFLD_CMD_PHYSEQID	0
3727 #define M_FW_EQ_OFLD_CMD_PHYSEQID	0xfffff
3728 #define V_FW_EQ_OFLD_CMD_PHYSEQID(x)	((x) << S_FW_EQ_OFLD_CMD_PHYSEQID)
3729 #define G_FW_EQ_OFLD_CMD_PHYSEQID(x)	\
3730     (((x) >> S_FW_EQ_OFLD_CMD_PHYSEQID) & M_FW_EQ_OFLD_CMD_PHYSEQID)
3731 
3732 #define S_FW_EQ_OFLD_CMD_FETCHSZM	26
3733 #define M_FW_EQ_OFLD_CMD_FETCHSZM	0x1
3734 #define V_FW_EQ_OFLD_CMD_FETCHSZM(x)	((x) << S_FW_EQ_OFLD_CMD_FETCHSZM)
3735 #define G_FW_EQ_OFLD_CMD_FETCHSZM(x)	\
3736     (((x) >> S_FW_EQ_OFLD_CMD_FETCHSZM) & M_FW_EQ_OFLD_CMD_FETCHSZM)
3737 #define F_FW_EQ_OFLD_CMD_FETCHSZM	V_FW_EQ_OFLD_CMD_FETCHSZM(1U)
3738 
3739 #define S_FW_EQ_OFLD_CMD_STATUSPGNS	25
3740 #define M_FW_EQ_OFLD_CMD_STATUSPGNS	0x1
3741 #define V_FW_EQ_OFLD_CMD_STATUSPGNS(x)	((x) << S_FW_EQ_OFLD_CMD_STATUSPGNS)
3742 #define G_FW_EQ_OFLD_CMD_STATUSPGNS(x)	\
3743     (((x) >> S_FW_EQ_OFLD_CMD_STATUSPGNS) & M_FW_EQ_OFLD_CMD_STATUSPGNS)
3744 #define F_FW_EQ_OFLD_CMD_STATUSPGNS	V_FW_EQ_OFLD_CMD_STATUSPGNS(1U)
3745 
3746 #define S_FW_EQ_OFLD_CMD_STATUSPGRO	24
3747 #define M_FW_EQ_OFLD_CMD_STATUSPGRO	0x1
3748 #define V_FW_EQ_OFLD_CMD_STATUSPGRO(x)	((x) << S_FW_EQ_OFLD_CMD_STATUSPGRO)
3749 #define G_FW_EQ_OFLD_CMD_STATUSPGRO(x)	\
3750     (((x) >> S_FW_EQ_OFLD_CMD_STATUSPGRO) & M_FW_EQ_OFLD_CMD_STATUSPGRO)
3751 #define F_FW_EQ_OFLD_CMD_STATUSPGRO	V_FW_EQ_OFLD_CMD_STATUSPGRO(1U)
3752 
3753 #define S_FW_EQ_OFLD_CMD_FETCHNS	23
3754 #define M_FW_EQ_OFLD_CMD_FETCHNS	0x1
3755 #define V_FW_EQ_OFLD_CMD_FETCHNS(x)	((x) << S_FW_EQ_OFLD_CMD_FETCHNS)
3756 #define G_FW_EQ_OFLD_CMD_FETCHNS(x)	\
3757     (((x) >> S_FW_EQ_OFLD_CMD_FETCHNS) & M_FW_EQ_OFLD_CMD_FETCHNS)
3758 #define F_FW_EQ_OFLD_CMD_FETCHNS	V_FW_EQ_OFLD_CMD_FETCHNS(1U)
3759 
3760 #define S_FW_EQ_OFLD_CMD_FETCHRO	22
3761 #define M_FW_EQ_OFLD_CMD_FETCHRO	0x1
3762 #define V_FW_EQ_OFLD_CMD_FETCHRO(x)	((x) << S_FW_EQ_OFLD_CMD_FETCHRO)
3763 #define G_FW_EQ_OFLD_CMD_FETCHRO(x)	\
3764     (((x) >> S_FW_EQ_OFLD_CMD_FETCHRO) & M_FW_EQ_OFLD_CMD_FETCHRO)
3765 #define F_FW_EQ_OFLD_CMD_FETCHRO	V_FW_EQ_OFLD_CMD_FETCHRO(1U)
3766 
3767 #define S_FW_EQ_OFLD_CMD_HOSTFCMODE	20
3768 #define M_FW_EQ_OFLD_CMD_HOSTFCMODE	0x3
3769 #define V_FW_EQ_OFLD_CMD_HOSTFCMODE(x)	((x) << S_FW_EQ_OFLD_CMD_HOSTFCMODE)
3770 #define G_FW_EQ_OFLD_CMD_HOSTFCMODE(x)	\
3771     (((x) >> S_FW_EQ_OFLD_CMD_HOSTFCMODE) & M_FW_EQ_OFLD_CMD_HOSTFCMODE)
3772 
3773 #define S_FW_EQ_OFLD_CMD_CPRIO		19
3774 #define M_FW_EQ_OFLD_CMD_CPRIO		0x1
3775 #define V_FW_EQ_OFLD_CMD_CPRIO(x)	((x) << S_FW_EQ_OFLD_CMD_CPRIO)
3776 #define G_FW_EQ_OFLD_CMD_CPRIO(x)	\
3777     (((x) >> S_FW_EQ_OFLD_CMD_CPRIO) & M_FW_EQ_OFLD_CMD_CPRIO)
3778 #define F_FW_EQ_OFLD_CMD_CPRIO	V_FW_EQ_OFLD_CMD_CPRIO(1U)
3779 
3780 #define S_FW_EQ_OFLD_CMD_ONCHIP		18
3781 #define M_FW_EQ_OFLD_CMD_ONCHIP		0x1
3782 #define V_FW_EQ_OFLD_CMD_ONCHIP(x)	((x) << S_FW_EQ_OFLD_CMD_ONCHIP)
3783 #define G_FW_EQ_OFLD_CMD_ONCHIP(x)	\
3784     (((x) >> S_FW_EQ_OFLD_CMD_ONCHIP) & M_FW_EQ_OFLD_CMD_ONCHIP)
3785 #define F_FW_EQ_OFLD_CMD_ONCHIP	V_FW_EQ_OFLD_CMD_ONCHIP(1U)
3786 
3787 #define S_FW_EQ_OFLD_CMD_PCIECHN	16
3788 #define M_FW_EQ_OFLD_CMD_PCIECHN	0x3
3789 #define V_FW_EQ_OFLD_CMD_PCIECHN(x)	((x) << S_FW_EQ_OFLD_CMD_PCIECHN)
3790 #define G_FW_EQ_OFLD_CMD_PCIECHN(x)	\
3791     (((x) >> S_FW_EQ_OFLD_CMD_PCIECHN) & M_FW_EQ_OFLD_CMD_PCIECHN)
3792 
3793 #define S_FW_EQ_OFLD_CMD_IQID		0
3794 #define M_FW_EQ_OFLD_CMD_IQID		0xffff
3795 #define V_FW_EQ_OFLD_CMD_IQID(x)	((x) << S_FW_EQ_OFLD_CMD_IQID)
3796 #define G_FW_EQ_OFLD_CMD_IQID(x)	\
3797     (((x) >> S_FW_EQ_OFLD_CMD_IQID) & M_FW_EQ_OFLD_CMD_IQID)
3798 
3799 #define S_FW_EQ_OFLD_CMD_DCAEN		31
3800 #define M_FW_EQ_OFLD_CMD_DCAEN		0x1
3801 #define V_FW_EQ_OFLD_CMD_DCAEN(x)	((x) << S_FW_EQ_OFLD_CMD_DCAEN)
3802 #define G_FW_EQ_OFLD_CMD_DCAEN(x)	\
3803     (((x) >> S_FW_EQ_OFLD_CMD_DCAEN) & M_FW_EQ_OFLD_CMD_DCAEN)
3804 #define F_FW_EQ_OFLD_CMD_DCAEN	V_FW_EQ_OFLD_CMD_DCAEN(1U)
3805 
3806 #define S_FW_EQ_OFLD_CMD_DCACPU		26
3807 #define M_FW_EQ_OFLD_CMD_DCACPU		0x1f
3808 #define V_FW_EQ_OFLD_CMD_DCACPU(x)	((x) << S_FW_EQ_OFLD_CMD_DCACPU)
3809 #define G_FW_EQ_OFLD_CMD_DCACPU(x)	\
3810     (((x) >> S_FW_EQ_OFLD_CMD_DCACPU) & M_FW_EQ_OFLD_CMD_DCACPU)
3811 
3812 #define S_FW_EQ_OFLD_CMD_FBMIN		23
3813 #define M_FW_EQ_OFLD_CMD_FBMIN		0x7
3814 #define V_FW_EQ_OFLD_CMD_FBMIN(x)	((x) << S_FW_EQ_OFLD_CMD_FBMIN)
3815 #define G_FW_EQ_OFLD_CMD_FBMIN(x)	\
3816     (((x) >> S_FW_EQ_OFLD_CMD_FBMIN) & M_FW_EQ_OFLD_CMD_FBMIN)
3817 
3818 #define S_FW_EQ_OFLD_CMD_FBMAX		20
3819 #define M_FW_EQ_OFLD_CMD_FBMAX		0x7
3820 #define V_FW_EQ_OFLD_CMD_FBMAX(x)	((x) << S_FW_EQ_OFLD_CMD_FBMAX)
3821 #define G_FW_EQ_OFLD_CMD_FBMAX(x)	\
3822     (((x) >> S_FW_EQ_OFLD_CMD_FBMAX) & M_FW_EQ_OFLD_CMD_FBMAX)
3823 
3824 #define S_FW_EQ_OFLD_CMD_CIDXFTHRESHO		19
3825 #define M_FW_EQ_OFLD_CMD_CIDXFTHRESHO		0x1
3826 #define V_FW_EQ_OFLD_CMD_CIDXFTHRESHO(x)	\
3827     ((x) << S_FW_EQ_OFLD_CMD_CIDXFTHRESHO)
3828 #define G_FW_EQ_OFLD_CMD_CIDXFTHRESHO(x)	\
3829     (((x) >> S_FW_EQ_OFLD_CMD_CIDXFTHRESHO) & M_FW_EQ_OFLD_CMD_CIDXFTHRESHO)
3830 #define F_FW_EQ_OFLD_CMD_CIDXFTHRESHO	V_FW_EQ_OFLD_CMD_CIDXFTHRESHO(1U)
3831 
3832 #define S_FW_EQ_OFLD_CMD_CIDXFTHRESH	16
3833 #define M_FW_EQ_OFLD_CMD_CIDXFTHRESH	0x7
3834 #define V_FW_EQ_OFLD_CMD_CIDXFTHRESH(x)	((x) << S_FW_EQ_OFLD_CMD_CIDXFTHRESH)
3835 #define G_FW_EQ_OFLD_CMD_CIDXFTHRESH(x)	\
3836     (((x) >> S_FW_EQ_OFLD_CMD_CIDXFTHRESH) & M_FW_EQ_OFLD_CMD_CIDXFTHRESH)
3837 
3838 #define S_FW_EQ_OFLD_CMD_EQSIZE		0
3839 #define M_FW_EQ_OFLD_CMD_EQSIZE		0xffff
3840 #define V_FW_EQ_OFLD_CMD_EQSIZE(x)	((x) << S_FW_EQ_OFLD_CMD_EQSIZE)
3841 #define G_FW_EQ_OFLD_CMD_EQSIZE(x)	\
3842     (((x) >> S_FW_EQ_OFLD_CMD_EQSIZE) & M_FW_EQ_OFLD_CMD_EQSIZE)
3843 
3844 /* Macros for VIID parsing:
3845    VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number */
3846 #define S_FW_VIID_PFN		8
3847 #define M_FW_VIID_PFN		0x7
3848 #define V_FW_VIID_PFN(x)	((x) << S_FW_VIID_PFN)
3849 #define G_FW_VIID_PFN(x)	(((x) >> S_FW_VIID_PFN) & M_FW_VIID_PFN)
3850 
3851 #define S_FW_VIID_VIVLD		7
3852 #define M_FW_VIID_VIVLD		0x1
3853 #define V_FW_VIID_VIVLD(x)	((x) << S_FW_VIID_VIVLD)
3854 #define G_FW_VIID_VIVLD(x)	(((x) >> S_FW_VIID_VIVLD) & M_FW_VIID_VIVLD)
3855 
3856 #define S_FW_VIID_VIN		0
3857 #define M_FW_VIID_VIN		0x7F
3858 #define V_FW_VIID_VIN(x)	((x) << S_FW_VIID_VIN)
3859 #define G_FW_VIID_VIN(x)	(((x) >> S_FW_VIID_VIN) & M_FW_VIID_VIN)
3860 
3861 enum fw_vi_func {
3862 	FW_VI_FUNC_ETH,
3863 	FW_VI_FUNC_OFLD,
3864 	FW_VI_FUNC_IWARP,
3865 	FW_VI_FUNC_OPENISCSI,
3866 	FW_VI_FUNC_OPENFCOE,
3867 	FW_VI_FUNC_FOISCSI,
3868 	FW_VI_FUNC_FOFCOE,
3869 	FW_VI_FUNC_FW,
3870 };
3871 
3872 struct fw_vi_cmd {
3873 	__be32 op_to_vfn;
3874 	__be32 alloc_to_len16;
3875 	__be16 type_to_viid;
3876 	__u8   mac[6];
3877 	__u8   portid_pkd;
3878 	__u8   nmac;
3879 	__u8   nmac0[6];
3880 	__be16 rsssize_pkd;
3881 	__u8   nmac1[6];
3882 	__be16 idsiiq_pkd;
3883 	__u8   nmac2[6];
3884 	__be16 idseiq_pkd;
3885 	__u8   nmac3[6];
3886 	__be64 r9;
3887 	__be64 r10;
3888 };
3889 
3890 #define S_FW_VI_CMD_PFN		8
3891 #define M_FW_VI_CMD_PFN		0x7
3892 #define V_FW_VI_CMD_PFN(x)	((x) << S_FW_VI_CMD_PFN)
3893 #define G_FW_VI_CMD_PFN(x)	(((x) >> S_FW_VI_CMD_PFN) & M_FW_VI_CMD_PFN)
3894 
3895 #define S_FW_VI_CMD_VFN		0
3896 #define M_FW_VI_CMD_VFN		0xff
3897 #define V_FW_VI_CMD_VFN(x)	((x) << S_FW_VI_CMD_VFN)
3898 #define G_FW_VI_CMD_VFN(x)	(((x) >> S_FW_VI_CMD_VFN) & M_FW_VI_CMD_VFN)
3899 
3900 #define S_FW_VI_CMD_ALLOC	31
3901 #define M_FW_VI_CMD_ALLOC	0x1
3902 #define V_FW_VI_CMD_ALLOC(x)	((x) << S_FW_VI_CMD_ALLOC)
3903 #define G_FW_VI_CMD_ALLOC(x)	\
3904     (((x) >> S_FW_VI_CMD_ALLOC) & M_FW_VI_CMD_ALLOC)
3905 #define F_FW_VI_CMD_ALLOC	V_FW_VI_CMD_ALLOC(1U)
3906 
3907 #define S_FW_VI_CMD_FREE	30
3908 #define M_FW_VI_CMD_FREE	0x1
3909 #define V_FW_VI_CMD_FREE(x)	((x) << S_FW_VI_CMD_FREE)
3910 #define G_FW_VI_CMD_FREE(x)	(((x) >> S_FW_VI_CMD_FREE) & M_FW_VI_CMD_FREE)
3911 #define F_FW_VI_CMD_FREE	V_FW_VI_CMD_FREE(1U)
3912 
3913 #define S_FW_VI_CMD_TYPE	15
3914 #define M_FW_VI_CMD_TYPE	0x1
3915 #define V_FW_VI_CMD_TYPE(x)	((x) << S_FW_VI_CMD_TYPE)
3916 #define G_FW_VI_CMD_TYPE(x)	(((x) >> S_FW_VI_CMD_TYPE) & M_FW_VI_CMD_TYPE)
3917 #define F_FW_VI_CMD_TYPE	V_FW_VI_CMD_TYPE(1U)
3918 
3919 #define S_FW_VI_CMD_FUNC	12
3920 #define M_FW_VI_CMD_FUNC	0x7
3921 #define V_FW_VI_CMD_FUNC(x)	((x) << S_FW_VI_CMD_FUNC)
3922 #define G_FW_VI_CMD_FUNC(x)	(((x) >> S_FW_VI_CMD_FUNC) & M_FW_VI_CMD_FUNC)
3923 
3924 #define S_FW_VI_CMD_VIID	0
3925 #define M_FW_VI_CMD_VIID	0xfff
3926 #define V_FW_VI_CMD_VIID(x)	((x) << S_FW_VI_CMD_VIID)
3927 #define G_FW_VI_CMD_VIID(x)	(((x) >> S_FW_VI_CMD_VIID) & M_FW_VI_CMD_VIID)
3928 
3929 #define S_FW_VI_CMD_PORTID	4
3930 #define M_FW_VI_CMD_PORTID	0xf
3931 #define V_FW_VI_CMD_PORTID(x)	((x) << S_FW_VI_CMD_PORTID)
3932 #define G_FW_VI_CMD_PORTID(x)	\
3933     (((x) >> S_FW_VI_CMD_PORTID) & M_FW_VI_CMD_PORTID)
3934 
3935 #define S_FW_VI_CMD_RSSSIZE	0
3936 #define M_FW_VI_CMD_RSSSIZE	0x7ff
3937 #define V_FW_VI_CMD_RSSSIZE(x)	((x) << S_FW_VI_CMD_RSSSIZE)
3938 #define G_FW_VI_CMD_RSSSIZE(x)	\
3939     (((x) >> S_FW_VI_CMD_RSSSIZE) & M_FW_VI_CMD_RSSSIZE)
3940 
3941 #define S_FW_VI_CMD_IDSIIQ	0
3942 #define M_FW_VI_CMD_IDSIIQ	0x3ff
3943 #define V_FW_VI_CMD_IDSIIQ(x)	((x) << S_FW_VI_CMD_IDSIIQ)
3944 #define G_FW_VI_CMD_IDSIIQ(x)	\
3945     (((x) >> S_FW_VI_CMD_IDSIIQ) & M_FW_VI_CMD_IDSIIQ)
3946 
3947 #define S_FW_VI_CMD_IDSEIQ	0
3948 #define M_FW_VI_CMD_IDSEIQ	0x3ff
3949 #define V_FW_VI_CMD_IDSEIQ(x)	((x) << S_FW_VI_CMD_IDSEIQ)
3950 #define G_FW_VI_CMD_IDSEIQ(x)	\
3951     (((x) >> S_FW_VI_CMD_IDSEIQ) & M_FW_VI_CMD_IDSEIQ)
3952 
3953 /* Special VI_MAC command index ids */
3954 #define FW_VI_MAC_ADD_MAC		0x3FF
3955 #define FW_VI_MAC_ADD_PERSIST_MAC	0x3FE
3956 #define FW_VI_MAC_MAC_BASED_FREE	0x3FD
3957 #define FW_CLS_TCAM_NUM_ENTRIES		336
3958 
3959 enum fw_vi_mac_smac {
3960 	FW_VI_MAC_MPS_TCAM_ENTRY,
3961 	FW_VI_MAC_MPS_TCAM_ONLY,
3962 	FW_VI_MAC_SMT_ONLY,
3963 	FW_VI_MAC_SMT_AND_MPSTCAM
3964 };
3965 
3966 enum fw_vi_mac_result {
3967 	FW_VI_MAC_R_SUCCESS,
3968 	FW_VI_MAC_R_F_NONEXISTENT_NOMEM,
3969 	FW_VI_MAC_R_SMAC_FAIL,
3970 	FW_VI_MAC_R_F_ACL_CHECK
3971 };
3972 
3973 struct fw_vi_mac_cmd {
3974 	__be32 op_to_viid;
3975 	__be32 freemacs_to_len16;
3976 	union fw_vi_mac {
3977 		struct fw_vi_mac_exact {
3978 			__be16 valid_to_idx;
3979 			__u8   macaddr[6];
3980 		} exact[7];
3981 		struct fw_vi_mac_hash {
3982 			__be64 hashvec;
3983 		} hash;
3984 	} u;
3985 };
3986 
3987 #define S_FW_VI_MAC_CMD_VIID	0
3988 #define M_FW_VI_MAC_CMD_VIID	0xfff
3989 #define V_FW_VI_MAC_CMD_VIID(x)	((x) << S_FW_VI_MAC_CMD_VIID)
3990 #define G_FW_VI_MAC_CMD_VIID(x)	\
3991     (((x) >> S_FW_VI_MAC_CMD_VIID) & M_FW_VI_MAC_CMD_VIID)
3992 
3993 #define S_FW_VI_MAC_CMD_FREEMACS	31
3994 #define M_FW_VI_MAC_CMD_FREEMACS	0x1
3995 #define V_FW_VI_MAC_CMD_FREEMACS(x)	((x) << S_FW_VI_MAC_CMD_FREEMACS)
3996 #define G_FW_VI_MAC_CMD_FREEMACS(x)	\
3997     (((x) >> S_FW_VI_MAC_CMD_FREEMACS) & M_FW_VI_MAC_CMD_FREEMACS)
3998 #define F_FW_VI_MAC_CMD_FREEMACS	V_FW_VI_MAC_CMD_FREEMACS(1U)
3999 
4000 #define S_FW_VI_MAC_CMD_HASHVECEN	23
4001 #define M_FW_VI_MAC_CMD_HASHVECEN	0x1
4002 #define V_FW_VI_MAC_CMD_HASHVECEN(x)	((x) << S_FW_VI_MAC_CMD_HASHVECEN)
4003 #define G_FW_VI_MAC_CMD_HASHVECEN(x)	\
4004     (((x) >> S_FW_VI_MAC_CMD_HASHVECEN) & M_FW_VI_MAC_CMD_HASHVECEN)
4005 #define F_FW_VI_MAC_CMD_HASHVECEN	V_FW_VI_MAC_CMD_HASHVECEN(1U)
4006 
4007 #define S_FW_VI_MAC_CMD_HASHUNIEN	22
4008 #define M_FW_VI_MAC_CMD_HASHUNIEN	0x1
4009 #define V_FW_VI_MAC_CMD_HASHUNIEN(x)	((x) << S_FW_VI_MAC_CMD_HASHUNIEN)
4010 #define G_FW_VI_MAC_CMD_HASHUNIEN(x)	\
4011     (((x) >> S_FW_VI_MAC_CMD_HASHUNIEN) & M_FW_VI_MAC_CMD_HASHUNIEN)
4012 #define F_FW_VI_MAC_CMD_HASHUNIEN	V_FW_VI_MAC_CMD_HASHUNIEN(1U)
4013 
4014 #define S_FW_VI_MAC_CMD_VALID		15
4015 #define M_FW_VI_MAC_CMD_VALID		0x1
4016 #define V_FW_VI_MAC_CMD_VALID(x)	((x) << S_FW_VI_MAC_CMD_VALID)
4017 #define G_FW_VI_MAC_CMD_VALID(x)	\
4018     (((x) >> S_FW_VI_MAC_CMD_VALID) & M_FW_VI_MAC_CMD_VALID)
4019 #define F_FW_VI_MAC_CMD_VALID	V_FW_VI_MAC_CMD_VALID(1U)
4020 
4021 #define S_FW_VI_MAC_CMD_PRIO	12
4022 #define M_FW_VI_MAC_CMD_PRIO	0x7
4023 #define V_FW_VI_MAC_CMD_PRIO(x)	((x) << S_FW_VI_MAC_CMD_PRIO)
4024 #define G_FW_VI_MAC_CMD_PRIO(x)	\
4025     (((x) >> S_FW_VI_MAC_CMD_PRIO) & M_FW_VI_MAC_CMD_PRIO)
4026 
4027 #define S_FW_VI_MAC_CMD_SMAC_RESULT	10
4028 #define M_FW_VI_MAC_CMD_SMAC_RESULT	0x3
4029 #define V_FW_VI_MAC_CMD_SMAC_RESULT(x)	((x) << S_FW_VI_MAC_CMD_SMAC_RESULT)
4030 #define G_FW_VI_MAC_CMD_SMAC_RESULT(x)	\
4031     (((x) >> S_FW_VI_MAC_CMD_SMAC_RESULT) & M_FW_VI_MAC_CMD_SMAC_RESULT)
4032 
4033 #define S_FW_VI_MAC_CMD_IDX	0
4034 #define M_FW_VI_MAC_CMD_IDX	0x3ff
4035 #define V_FW_VI_MAC_CMD_IDX(x)	((x) << S_FW_VI_MAC_CMD_IDX)
4036 #define G_FW_VI_MAC_CMD_IDX(x)	\
4037     (((x) >> S_FW_VI_MAC_CMD_IDX) & M_FW_VI_MAC_CMD_IDX)
4038 
4039 /* T4 max MTU supported */
4040 #define T4_MAX_MTU_SUPPORTED	9600
4041 #define FW_RXMODE_MTU_NO_CHG	65535
4042 
4043 struct fw_vi_rxmode_cmd {
4044 	__be32 op_to_viid;
4045 	__be32 retval_len16;
4046 	__be32 mtu_to_vlanexen;
4047 	__be32 r4_lo;
4048 };
4049 
4050 #define S_FW_VI_RXMODE_CMD_VIID		0
4051 #define M_FW_VI_RXMODE_CMD_VIID		0xfff
4052 #define V_FW_VI_RXMODE_CMD_VIID(x)	((x) << S_FW_VI_RXMODE_CMD_VIID)
4053 #define G_FW_VI_RXMODE_CMD_VIID(x)	\
4054     (((x) >> S_FW_VI_RXMODE_CMD_VIID) & M_FW_VI_RXMODE_CMD_VIID)
4055 
4056 #define S_FW_VI_RXMODE_CMD_MTU		16
4057 #define M_FW_VI_RXMODE_CMD_MTU		0xffff
4058 #define V_FW_VI_RXMODE_CMD_MTU(x)	((x) << S_FW_VI_RXMODE_CMD_MTU)
4059 #define G_FW_VI_RXMODE_CMD_MTU(x)	\
4060     (((x) >> S_FW_VI_RXMODE_CMD_MTU) & M_FW_VI_RXMODE_CMD_MTU)
4061 
4062 #define S_FW_VI_RXMODE_CMD_PROMISCEN	14
4063 #define M_FW_VI_RXMODE_CMD_PROMISCEN	0x3
4064 #define V_FW_VI_RXMODE_CMD_PROMISCEN(x)	((x) << S_FW_VI_RXMODE_CMD_PROMISCEN)
4065 #define G_FW_VI_RXMODE_CMD_PROMISCEN(x)	\
4066     (((x) >> S_FW_VI_RXMODE_CMD_PROMISCEN) & M_FW_VI_RXMODE_CMD_PROMISCEN)
4067 
4068 #define S_FW_VI_RXMODE_CMD_ALLMULTIEN		12
4069 #define M_FW_VI_RXMODE_CMD_ALLMULTIEN		0x3
4070 #define V_FW_VI_RXMODE_CMD_ALLMULTIEN(x)	\
4071     ((x) << S_FW_VI_RXMODE_CMD_ALLMULTIEN)
4072 #define G_FW_VI_RXMODE_CMD_ALLMULTIEN(x)	\
4073     (((x) >> S_FW_VI_RXMODE_CMD_ALLMULTIEN) & M_FW_VI_RXMODE_CMD_ALLMULTIEN)
4074 
4075 #define S_FW_VI_RXMODE_CMD_BROADCASTEN		10
4076 #define M_FW_VI_RXMODE_CMD_BROADCASTEN		0x3
4077 #define V_FW_VI_RXMODE_CMD_BROADCASTEN(x)	\
4078     ((x) << S_FW_VI_RXMODE_CMD_BROADCASTEN)
4079 #define G_FW_VI_RXMODE_CMD_BROADCASTEN(x)	\
4080     (((x) >> S_FW_VI_RXMODE_CMD_BROADCASTEN) & M_FW_VI_RXMODE_CMD_BROADCASTEN)
4081 
4082 #define S_FW_VI_RXMODE_CMD_VLANEXEN	8
4083 #define M_FW_VI_RXMODE_CMD_VLANEXEN	0x3
4084 #define V_FW_VI_RXMODE_CMD_VLANEXEN(x)	((x) << S_FW_VI_RXMODE_CMD_VLANEXEN)
4085 #define G_FW_VI_RXMODE_CMD_VLANEXEN(x)	\
4086     (((x) >> S_FW_VI_RXMODE_CMD_VLANEXEN) & M_FW_VI_RXMODE_CMD_VLANEXEN)
4087 
4088 struct fw_vi_enable_cmd {
4089 	__be32 op_to_viid;
4090 	__be32 ien_to_len16;
4091 	__be16 blinkdur;
4092 	__be16 r3;
4093 	__be32 r4;
4094 };
4095 
4096 #define S_FW_VI_ENABLE_CMD_VIID		0
4097 #define M_FW_VI_ENABLE_CMD_VIID		0xfff
4098 #define V_FW_VI_ENABLE_CMD_VIID(x)	((x) << S_FW_VI_ENABLE_CMD_VIID)
4099 #define G_FW_VI_ENABLE_CMD_VIID(x)	\
4100     (((x) >> S_FW_VI_ENABLE_CMD_VIID) & M_FW_VI_ENABLE_CMD_VIID)
4101 
4102 #define S_FW_VI_ENABLE_CMD_IEN		31
4103 #define M_FW_VI_ENABLE_CMD_IEN		0x1
4104 #define V_FW_VI_ENABLE_CMD_IEN(x)	((x) << S_FW_VI_ENABLE_CMD_IEN)
4105 #define G_FW_VI_ENABLE_CMD_IEN(x)	\
4106     (((x) >> S_FW_VI_ENABLE_CMD_IEN) & M_FW_VI_ENABLE_CMD_IEN)
4107 #define F_FW_VI_ENABLE_CMD_IEN	V_FW_VI_ENABLE_CMD_IEN(1U)
4108 
4109 #define S_FW_VI_ENABLE_CMD_EEN		30
4110 #define M_FW_VI_ENABLE_CMD_EEN		0x1
4111 #define V_FW_VI_ENABLE_CMD_EEN(x)	((x) << S_FW_VI_ENABLE_CMD_EEN)
4112 #define G_FW_VI_ENABLE_CMD_EEN(x)	\
4113     (((x) >> S_FW_VI_ENABLE_CMD_EEN) & M_FW_VI_ENABLE_CMD_EEN)
4114 #define F_FW_VI_ENABLE_CMD_EEN	V_FW_VI_ENABLE_CMD_EEN(1U)
4115 
4116 #define S_FW_VI_ENABLE_CMD_LED		29
4117 #define M_FW_VI_ENABLE_CMD_LED		0x1
4118 #define V_FW_VI_ENABLE_CMD_LED(x)	((x) << S_FW_VI_ENABLE_CMD_LED)
4119 #define G_FW_VI_ENABLE_CMD_LED(x)	\
4120     (((x) >> S_FW_VI_ENABLE_CMD_LED) & M_FW_VI_ENABLE_CMD_LED)
4121 #define F_FW_VI_ENABLE_CMD_LED	V_FW_VI_ENABLE_CMD_LED(1U)
4122 
4123 /* VI VF stats offset definitions */
4124 #define VI_VF_NUM_STATS	16
4125 enum fw_vi_stats_vf_index {
4126 	FW_VI_VF_STAT_TX_BCAST_BYTES_IX,
4127 	FW_VI_VF_STAT_TX_BCAST_FRAMES_IX,
4128 	FW_VI_VF_STAT_TX_MCAST_BYTES_IX,
4129 	FW_VI_VF_STAT_TX_MCAST_FRAMES_IX,
4130 	FW_VI_VF_STAT_TX_UCAST_BYTES_IX,
4131 	FW_VI_VF_STAT_TX_UCAST_FRAMES_IX,
4132 	FW_VI_VF_STAT_TX_DROP_FRAMES_IX,
4133 	FW_VI_VF_STAT_TX_OFLD_BYTES_IX,
4134 	FW_VI_VF_STAT_TX_OFLD_FRAMES_IX,
4135 	FW_VI_VF_STAT_RX_BCAST_BYTES_IX,
4136 	FW_VI_VF_STAT_RX_BCAST_FRAMES_IX,
4137 	FW_VI_VF_STAT_RX_MCAST_BYTES_IX,
4138 	FW_VI_VF_STAT_RX_MCAST_FRAMES_IX,
4139 	FW_VI_VF_STAT_RX_UCAST_BYTES_IX,
4140 	FW_VI_VF_STAT_RX_UCAST_FRAMES_IX,
4141 	FW_VI_VF_STAT_RX_ERR_FRAMES_IX
4142 };
4143 
4144 /* VI PF stats offset definitions */
4145 #define VI_PF_NUM_STATS	17
4146 enum fw_vi_stats_pf_index {
4147 	FW_VI_PF_STAT_TX_BCAST_BYTES_IX,
4148 	FW_VI_PF_STAT_TX_BCAST_FRAMES_IX,
4149 	FW_VI_PF_STAT_TX_MCAST_BYTES_IX,
4150 	FW_VI_PF_STAT_TX_MCAST_FRAMES_IX,
4151 	FW_VI_PF_STAT_TX_UCAST_BYTES_IX,
4152 	FW_VI_PF_STAT_TX_UCAST_FRAMES_IX,
4153 	FW_VI_PF_STAT_TX_OFLD_BYTES_IX,
4154 	FW_VI_PF_STAT_TX_OFLD_FRAMES_IX,
4155 	FW_VI_PF_STAT_RX_BYTES_IX,
4156 	FW_VI_PF_STAT_RX_FRAMES_IX,
4157 	FW_VI_PF_STAT_RX_BCAST_BYTES_IX,
4158 	FW_VI_PF_STAT_RX_BCAST_FRAMES_IX,
4159 	FW_VI_PF_STAT_RX_MCAST_BYTES_IX,
4160 	FW_VI_PF_STAT_RX_MCAST_FRAMES_IX,
4161 	FW_VI_PF_STAT_RX_UCAST_BYTES_IX,
4162 	FW_VI_PF_STAT_RX_UCAST_FRAMES_IX,
4163 	FW_VI_PF_STAT_RX_ERR_FRAMES_IX
4164 };
4165 
4166 struct fw_vi_stats_cmd {
4167 	__be32 op_to_viid;
4168 	__be32 retval_len16;
4169 	union fw_vi_stats {
4170 		struct fw_vi_stats_ctl {
4171 			__be16 nstats_ix;
4172 			__be16 r6;
4173 			__be32 r7;
4174 			__be64 stat0;
4175 			__be64 stat1;
4176 			__be64 stat2;
4177 			__be64 stat3;
4178 			__be64 stat4;
4179 			__be64 stat5;
4180 		} ctl;
4181 		struct fw_vi_stats_pf {
4182 			__be64 tx_bcast_bytes;
4183 			__be64 tx_bcast_frames;
4184 			__be64 tx_mcast_bytes;
4185 			__be64 tx_mcast_frames;
4186 			__be64 tx_ucast_bytes;
4187 			__be64 tx_ucast_frames;
4188 			__be64 tx_offload_bytes;
4189 			__be64 tx_offload_frames;
4190 			__be64 rx_pf_bytes;
4191 			__be64 rx_pf_frames;
4192 			__be64 rx_bcast_bytes;
4193 			__be64 rx_bcast_frames;
4194 			__be64 rx_mcast_bytes;
4195 			__be64 rx_mcast_frames;
4196 			__be64 rx_ucast_bytes;
4197 			__be64 rx_ucast_frames;
4198 			__be64 rx_err_frames;
4199 		} pf;
4200 		struct fw_vi_stats_vf {
4201 			__be64 tx_bcast_bytes;
4202 			__be64 tx_bcast_frames;
4203 			__be64 tx_mcast_bytes;
4204 			__be64 tx_mcast_frames;
4205 			__be64 tx_ucast_bytes;
4206 			__be64 tx_ucast_frames;
4207 			__be64 tx_drop_frames;
4208 			__be64 tx_offload_bytes;
4209 			__be64 tx_offload_frames;
4210 			__be64 rx_bcast_bytes;
4211 			__be64 rx_bcast_frames;
4212 			__be64 rx_mcast_bytes;
4213 			__be64 rx_mcast_frames;
4214 			__be64 rx_ucast_bytes;
4215 			__be64 rx_ucast_frames;
4216 			__be64 rx_err_frames;
4217 		} vf;
4218 	} u;
4219 };
4220 
4221 #define S_FW_VI_STATS_CMD_VIID		0
4222 #define M_FW_VI_STATS_CMD_VIID		0xfff
4223 #define V_FW_VI_STATS_CMD_VIID(x)	((x) << S_FW_VI_STATS_CMD_VIID)
4224 #define G_FW_VI_STATS_CMD_VIID(x)	\
4225     (((x) >> S_FW_VI_STATS_CMD_VIID) & M_FW_VI_STATS_CMD_VIID)
4226 
4227 #define S_FW_VI_STATS_CMD_NSTATS	12
4228 #define M_FW_VI_STATS_CMD_NSTATS	0x7
4229 #define V_FW_VI_STATS_CMD_NSTATS(x)	((x) << S_FW_VI_STATS_CMD_NSTATS)
4230 #define G_FW_VI_STATS_CMD_NSTATS(x)	\
4231     (((x) >> S_FW_VI_STATS_CMD_NSTATS) & M_FW_VI_STATS_CMD_NSTATS)
4232 
4233 #define S_FW_VI_STATS_CMD_IX	0
4234 #define M_FW_VI_STATS_CMD_IX	0x1f
4235 #define V_FW_VI_STATS_CMD_IX(x)	((x) << S_FW_VI_STATS_CMD_IX)
4236 #define G_FW_VI_STATS_CMD_IX(x)	\
4237     (((x) >> S_FW_VI_STATS_CMD_IX) & M_FW_VI_STATS_CMD_IX)
4238 
4239 struct fw_acl_mac_cmd {
4240 	__be32 op_to_vfn;
4241 	__be32 en_to_len16;
4242 	__u8   nmac;
4243 	__u8   r3[7];
4244 	__be16 r4;
4245 	__u8   macaddr0[6];
4246 	__be16 r5;
4247 	__u8   macaddr1[6];
4248 	__be16 r6;
4249 	__u8   macaddr2[6];
4250 	__be16 r7;
4251 	__u8   macaddr3[6];
4252 };
4253 
4254 #define S_FW_ACL_MAC_CMD_PFN	8
4255 #define M_FW_ACL_MAC_CMD_PFN	0x7
4256 #define V_FW_ACL_MAC_CMD_PFN(x)	((x) << S_FW_ACL_MAC_CMD_PFN)
4257 #define G_FW_ACL_MAC_CMD_PFN(x)	\
4258     (((x) >> S_FW_ACL_MAC_CMD_PFN) & M_FW_ACL_MAC_CMD_PFN)
4259 
4260 #define S_FW_ACL_MAC_CMD_VFN	0
4261 #define M_FW_ACL_MAC_CMD_VFN	0xff
4262 #define V_FW_ACL_MAC_CMD_VFN(x)	((x) << S_FW_ACL_MAC_CMD_VFN)
4263 #define G_FW_ACL_MAC_CMD_VFN(x)	\
4264     (((x) >> S_FW_ACL_MAC_CMD_VFN) & M_FW_ACL_MAC_CMD_VFN)
4265 
4266 #define S_FW_ACL_MAC_CMD_EN	31
4267 #define M_FW_ACL_MAC_CMD_EN	0x1
4268 #define V_FW_ACL_MAC_CMD_EN(x)	((x) << S_FW_ACL_MAC_CMD_EN)
4269 #define G_FW_ACL_MAC_CMD_EN(x)	\
4270     (((x) >> S_FW_ACL_MAC_CMD_EN) & M_FW_ACL_MAC_CMD_EN)
4271 #define F_FW_ACL_MAC_CMD_EN	V_FW_ACL_MAC_CMD_EN(1U)
4272 
4273 struct fw_acl_vlan_cmd {
4274 	__be32 op_to_vfn;
4275 	__be32 en_to_len16;
4276 	__u8   nvlan;
4277 	__u8   dropnovlan_fm;
4278 	__u8   r3_lo[6];
4279 	__be16 vlanid[16];
4280 };
4281 
4282 #define S_FW_ACL_VLAN_CMD_PFN		8
4283 #define M_FW_ACL_VLAN_CMD_PFN		0x7
4284 #define V_FW_ACL_VLAN_CMD_PFN(x)	((x) << S_FW_ACL_VLAN_CMD_PFN)
4285 #define G_FW_ACL_VLAN_CMD_PFN(x)	\
4286     (((x) >> S_FW_ACL_VLAN_CMD_PFN) & M_FW_ACL_VLAN_CMD_PFN)
4287 
4288 #define S_FW_ACL_VLAN_CMD_VFN		0
4289 #define M_FW_ACL_VLAN_CMD_VFN		0xff
4290 #define V_FW_ACL_VLAN_CMD_VFN(x)	((x) << S_FW_ACL_VLAN_CMD_VFN)
4291 #define G_FW_ACL_VLAN_CMD_VFN(x)	\
4292     (((x) >> S_FW_ACL_VLAN_CMD_VFN) & M_FW_ACL_VLAN_CMD_VFN)
4293 
4294 #define S_FW_ACL_VLAN_CMD_EN	31
4295 #define M_FW_ACL_VLAN_CMD_EN	0x1
4296 #define V_FW_ACL_VLAN_CMD_EN(x)	((x) << S_FW_ACL_VLAN_CMD_EN)
4297 #define G_FW_ACL_VLAN_CMD_EN(x)	\
4298     (((x) >> S_FW_ACL_VLAN_CMD_EN) & M_FW_ACL_VLAN_CMD_EN)
4299 #define F_FW_ACL_VLAN_CMD_EN	V_FW_ACL_VLAN_CMD_EN(1U)
4300 
4301 #define S_FW_ACL_VLAN_CMD_DROPNOVLAN	7
4302 #define M_FW_ACL_VLAN_CMD_DROPNOVLAN	0x1
4303 #define V_FW_ACL_VLAN_CMD_DROPNOVLAN(x)	((x) << S_FW_ACL_VLAN_CMD_DROPNOVLAN)
4304 #define G_FW_ACL_VLAN_CMD_DROPNOVLAN(x)	\
4305     (((x) >> S_FW_ACL_VLAN_CMD_DROPNOVLAN) & M_FW_ACL_VLAN_CMD_DROPNOVLAN)
4306 #define F_FW_ACL_VLAN_CMD_DROPNOVLAN	V_FW_ACL_VLAN_CMD_DROPNOVLAN(1U)
4307 
4308 #define S_FW_ACL_VLAN_CMD_FM	6
4309 #define M_FW_ACL_VLAN_CMD_FM	0x1
4310 #define V_FW_ACL_VLAN_CMD_FM(x)	((x) << S_FW_ACL_VLAN_CMD_FM)
4311 #define G_FW_ACL_VLAN_CMD_FM(x)	\
4312     (((x) >> S_FW_ACL_VLAN_CMD_FM) & M_FW_ACL_VLAN_CMD_FM)
4313 #define F_FW_ACL_VLAN_CMD_FM	V_FW_ACL_VLAN_CMD_FM(1U)
4314 
4315 /* port capabilities bitmap */
4316 enum fw_port_cap {
4317 	FW_PORT_CAP_SPEED_100M		= 0x0001,
4318 	FW_PORT_CAP_SPEED_1G		= 0x0002,
4319 	FW_PORT_CAP_SPEED_2_5G		= 0x0004,
4320 	FW_PORT_CAP_SPEED_10G		= 0x0008,
4321 	FW_PORT_CAP_SPEED_40G		= 0x0010,
4322 	FW_PORT_CAP_SPEED_100G		= 0x0020,
4323 	FW_PORT_CAP_FC_RX		= 0x0040,
4324 	FW_PORT_CAP_FC_TX		= 0x0080,
4325 	FW_PORT_CAP_ANEG		= 0x0100,
4326 	FW_PORT_CAP_MDIX		= 0x0200,
4327 	FW_PORT_CAP_MDIAUTO		= 0x0400,
4328 	FW_PORT_CAP_FEC			= 0x0800,
4329 	FW_PORT_CAP_TECHKR		= 0x1000,
4330 	FW_PORT_CAP_TECHKX4		= 0x2000,
4331 };
4332 
4333 #define S_FW_PORT_AUXLINFO_MDI		3
4334 #define M_FW_PORT_AUXLINFO_MDI		0x3
4335 #define V_FW_PORT_AUXLINFO_MDI(x)	((x) << S_FW_PORT_AUXLINFO_MDI)
4336 #define G_FW_PORT_AUXLINFO_MDI(x) \
4337     (((x) >> S_FW_PORT_AUXLINFO_MDI) & M_FW_PORT_AUXLINFO_MDI)
4338 
4339 #define S_FW_PORT_AUXLINFO_KX4		2
4340 #define M_FW_PORT_AUXLINFO_KX4		0x1
4341 #define V_FW_PORT_AUXLINFO_KX4(x)	((x) << S_FW_PORT_AUXLINFO_KX4)
4342 #define G_FW_PORT_AUXLINFO_KX4(x) \
4343     (((x) >> S_FW_PORT_AUXLINFO_KX4) & M_FW_PORT_AUXLINFO_KX4)
4344 #define F_FW_PORT_AUXLINFO_KX4		V_FW_PORT_AUXLINFO_KX4(1U)
4345 
4346 #define S_FW_PORT_AUXLINFO_KR		1
4347 #define M_FW_PORT_AUXLINFO_KR		0x1
4348 #define V_FW_PORT_AUXLINFO_KR(x)	((x) << S_FW_PORT_AUXLINFO_KR)
4349 #define G_FW_PORT_AUXLINFO_KR(x) \
4350     (((x) >> S_FW_PORT_AUXLINFO_KR) & M_FW_PORT_AUXLINFO_KR)
4351 #define F_FW_PORT_AUXLINFO_KR		V_FW_PORT_AUXLINFO_KR(1U)
4352 
4353 #define S_FW_PORT_AUXLINFO_FEC		0
4354 #define M_FW_PORT_AUXLINFO_FEC		0x1
4355 #define V_FW_PORT_AUXLINFO_FEC(x)	((x) << S_FW_PORT_AUXLINFO_FEC)
4356 #define G_FW_PORT_AUXLINFO_FEC(x) \
4357     (((x) >> S_FW_PORT_AUXLINFO_FEC) & M_FW_PORT_AUXLINFO_FEC)
4358 #define F_FW_PORT_AUXLINFO_FEC		V_FW_PORT_AUXLINFO_FEC(1U)
4359 
4360 #define S_FW_PORT_RCAP_AUX	11
4361 #define M_FW_PORT_RCAP_AUX	0x7
4362 #define V_FW_PORT_RCAP_AUX(x)	((x) << S_FW_PORT_RCAP_AUX)
4363 #define G_FW_PORT_RCAP_AUX(x) \
4364     (((x) >> S_FW_PORT_RCAP_AUX) & M_FW_PORT_RCAP_AUX)
4365 
4366 #define S_FW_PORT_CAP_SPEED	0
4367 #define M_FW_PORT_CAP_SPEED	0x3f
4368 #define V_FW_PORT_CAP_SPEED(x)	((x) << S_FW_PORT_CAP_SPEED)
4369 #define G_FW_PORT_CAP_SPEED(x) \
4370     (((x) >> S_FW_PORT_CAP_SPEED) & M_FW_PORT_CAP_SPEED)
4371 
4372 #define S_FW_PORT_CAP_FC	6
4373 #define M_FW_PORT_CAP_FC	0x3
4374 #define V_FW_PORT_CAP_FC(x)	((x) << S_FW_PORT_CAP_FC)
4375 #define G_FW_PORT_CAP_FC(x) \
4376     (((x) >> S_FW_PORT_CAP_FC) & M_FW_PORT_CAP_FC)
4377 
4378 #define S_FW_PORT_CAP_ANEG	8
4379 #define M_FW_PORT_CAP_ANEG	0x1
4380 #define V_FW_PORT_CAP_ANEG(x)	((x) << S_FW_PORT_CAP_ANEG)
4381 #define G_FW_PORT_CAP_ANEG(x) \
4382     (((x) >> S_FW_PORT_CAP_ANEG) & M_FW_PORT_CAP_ANEG)
4383 
4384 enum fw_port_mdi {
4385 	FW_PORT_CAP_MDI_UNCHANGED,
4386 	FW_PORT_CAP_MDI_AUTO,
4387 	FW_PORT_CAP_MDI_F_STRAIGHT,
4388 	FW_PORT_CAP_MDI_F_CROSSOVER
4389 };
4390 
4391 #define S_FW_PORT_CAP_MDI 9
4392 #define M_FW_PORT_CAP_MDI 3
4393 #define V_FW_PORT_CAP_MDI(x) ((x) << S_FW_PORT_CAP_MDI)
4394 #define G_FW_PORT_CAP_MDI(x) (((x) >> S_FW_PORT_CAP_MDI) & M_FW_PORT_CAP_MDI)
4395 
4396 enum fw_port_action {
4397 	FW_PORT_ACTION_L1_CFG		= 0x0001,
4398 	FW_PORT_ACTION_L2_CFG		= 0x0002,
4399 	FW_PORT_ACTION_GET_PORT_INFO	= 0x0003,
4400 	FW_PORT_ACTION_L2_PPP_CFG	= 0x0004,
4401 	FW_PORT_ACTION_L2_DCB_CFG	= 0x0005,
4402 	FW_PORT_ACTION_LOW_PWR_TO_NORMAL = 0x0010,
4403 	FW_PORT_ACTION_L1_LOW_PWR_EN	= 0x0011,
4404 	FW_PORT_ACTION_L2_WOL_MODE_EN	= 0x0012,
4405 	FW_PORT_ACTION_LPBK_TO_NORMAL	= 0x0020,
4406 	FW_PORT_ACTION_L1_SS_LPBK_ASIC	= 0x0021,
4407 	FW_PORT_ACTION_MAC_LPBK		= 0x0022,
4408 	FW_PORT_ACTION_L1_WS_LPBK_ASIC	= 0x0023,
4409 	FW_PORT_ACTION_L1_EXT_LPBK      = 0x0026,
4410 	FW_PORT_ACTION_PCS_LPBK		= 0x0028,
4411 	FW_PORT_ACTION_PHY_RESET	= 0x0040,
4412 	FW_PORT_ACTION_PMA_RESET	= 0x0041,
4413 	FW_PORT_ACTION_PCS_RESET	= 0x0042,
4414 	FW_PORT_ACTION_PHYXS_RESET	= 0x0043,
4415 	FW_PORT_ACTION_DTEXS_REEST	= 0x0044,
4416 	FW_PORT_ACTION_AN_RESET		= 0x0045
4417 };
4418 
4419 enum fw_port_l2cfg_ctlbf {
4420 	FW_PORT_L2_CTLBF_OVLAN0	= 0x01,
4421 	FW_PORT_L2_CTLBF_OVLAN1	= 0x02,
4422 	FW_PORT_L2_CTLBF_OVLAN2	= 0x04,
4423 	FW_PORT_L2_CTLBF_OVLAN3	= 0x08,
4424 	FW_PORT_L2_CTLBF_IVLAN	= 0x10,
4425 	FW_PORT_L2_CTLBF_TXIPG	= 0x20,
4426 	FW_PORT_L2_CTLBF_MTU	= 0x40
4427 };
4428 
4429 enum fw_port_dcb_cfg {
4430 	FW_PORT_DCB_CFG_PG	= 0x01,
4431 	FW_PORT_DCB_CFG_PFC	= 0x02,
4432 	FW_PORT_DCB_CFG_APPL	= 0x04
4433 };
4434 
4435 enum fw_port_dcb_cfg_rc {
4436 	FW_PORT_DCB_CFG_SUCCESS	= 0x0,
4437 	FW_PORT_DCB_CFG_ERROR	= 0x1
4438 };
4439 
4440 enum fw_port_dcb_type {
4441 	FW_PORT_DCB_TYPE_PGID		= 0x00,
4442 	FW_PORT_DCB_TYPE_PGRATE		= 0x01,
4443 	FW_PORT_DCB_TYPE_PRIORATE	= 0x02,
4444 	FW_PORT_DCB_TYPE_PFC		= 0x03,
4445 	FW_PORT_DCB_TYPE_APP_ID		= 0x04,
4446 };
4447 
4448 struct fw_port_cmd {
4449 	__be32 op_to_portid;
4450 	__be32 action_to_len16;
4451 	union fw_port {
4452 		struct fw_port_l1cfg {
4453 			__be32 rcap;
4454 			__be32 r;
4455 		} l1cfg;
4456 		struct fw_port_l2cfg {
4457 			__u8   ctlbf;
4458 			__u8   ovlan3_to_ivlan0;
4459 			__be16 ivlantype;
4460 			__be16 txipg_force_pinfo;
4461 			__be16 mtu;
4462 			__be16 ovlan0mask;
4463 			__be16 ovlan0type;
4464 			__be16 ovlan1mask;
4465 			__be16 ovlan1type;
4466 			__be16 ovlan2mask;
4467 			__be16 ovlan2type;
4468 			__be16 ovlan3mask;
4469 			__be16 ovlan3type;
4470 		} l2cfg;
4471 		struct fw_port_info {
4472 			__be32 lstatus_to_modtype;
4473 			__be16 pcap;
4474 			__be16 acap;
4475 			__be16 mtu;
4476 			__u8   cbllen;
4477 			__u8   auxlinfo;
4478 			__be32 r8;
4479 			__be64 r9;
4480 		} info;
4481 		union fw_port_dcb {
4482 			struct fw_port_dcb_pgid {
4483 				__u8   type;
4484 				__u8   apply_pkd;
4485 				__u8   r10_lo[2];
4486 				__be32 pgid;
4487 				__be64 r11;
4488 			} pgid;
4489 			struct fw_port_dcb_pgrate {
4490 				__u8   type;
4491 				__u8   apply_pkd;
4492 				__u8   r10_lo[5];
4493 				__u8   num_tcs_supported;
4494 				__u8   pgrate[8];
4495 			} pgrate;
4496 			struct fw_port_dcb_priorate {
4497 				__u8   type;
4498 				__u8   apply_pkd;
4499 				__u8   r10_lo[6];
4500 				__u8   strict_priorate[8];
4501 			} priorate;
4502 			struct fw_port_dcb_pfc {
4503 				__u8   type;
4504 				__u8   pfcen;
4505 				__be16 r10[3];
4506 				__be64 r11;
4507 			} pfc;
4508 			struct fw_port_app_priority {
4509 				__u8   type;
4510 				__u8   r10[2];
4511 				__u8   idx;
4512 				__u8   user_prio_map;
4513 				__u8   sel_field;
4514 				__be16 protocolid;
4515 				__be64 r12;
4516 			} app_priority;
4517 		} dcb;
4518 	} u;
4519 };
4520 
4521 #define S_FW_PORT_CMD_READ	22
4522 #define M_FW_PORT_CMD_READ	0x1
4523 #define V_FW_PORT_CMD_READ(x)	((x) << S_FW_PORT_CMD_READ)
4524 #define G_FW_PORT_CMD_READ(x)	\
4525     (((x) >> S_FW_PORT_CMD_READ) & M_FW_PORT_CMD_READ)
4526 #define F_FW_PORT_CMD_READ	V_FW_PORT_CMD_READ(1U)
4527 
4528 #define S_FW_PORT_CMD_PORTID	0
4529 #define M_FW_PORT_CMD_PORTID	0xf
4530 #define V_FW_PORT_CMD_PORTID(x)	((x) << S_FW_PORT_CMD_PORTID)
4531 #define G_FW_PORT_CMD_PORTID(x)	\
4532     (((x) >> S_FW_PORT_CMD_PORTID) & M_FW_PORT_CMD_PORTID)
4533 
4534 #define S_FW_PORT_CMD_ACTION	16
4535 #define M_FW_PORT_CMD_ACTION	0xffff
4536 #define V_FW_PORT_CMD_ACTION(x)	((x) << S_FW_PORT_CMD_ACTION)
4537 #define G_FW_PORT_CMD_ACTION(x)	\
4538     (((x) >> S_FW_PORT_CMD_ACTION) & M_FW_PORT_CMD_ACTION)
4539 
4540 #define S_FW_PORT_CMD_OVLAN3	7
4541 #define M_FW_PORT_CMD_OVLAN3	0x1
4542 #define V_FW_PORT_CMD_OVLAN3(x)	((x) << S_FW_PORT_CMD_OVLAN3)
4543 #define G_FW_PORT_CMD_OVLAN3(x)	\
4544     (((x) >> S_FW_PORT_CMD_OVLAN3) & M_FW_PORT_CMD_OVLAN3)
4545 #define F_FW_PORT_CMD_OVLAN3	V_FW_PORT_CMD_OVLAN3(1U)
4546 
4547 #define S_FW_PORT_CMD_OVLAN2	6
4548 #define M_FW_PORT_CMD_OVLAN2	0x1
4549 #define V_FW_PORT_CMD_OVLAN2(x)	((x) << S_FW_PORT_CMD_OVLAN2)
4550 #define G_FW_PORT_CMD_OVLAN2(x)	\
4551     (((x) >> S_FW_PORT_CMD_OVLAN2) & M_FW_PORT_CMD_OVLAN2)
4552 #define F_FW_PORT_CMD_OVLAN2	V_FW_PORT_CMD_OVLAN2(1U)
4553 
4554 #define S_FW_PORT_CMD_OVLAN1	5
4555 #define M_FW_PORT_CMD_OVLAN1	0x1
4556 #define V_FW_PORT_CMD_OVLAN1(x)	((x) << S_FW_PORT_CMD_OVLAN1)
4557 #define G_FW_PORT_CMD_OVLAN1(x)	\
4558     (((x) >> S_FW_PORT_CMD_OVLAN1) & M_FW_PORT_CMD_OVLAN1)
4559 #define F_FW_PORT_CMD_OVLAN1	V_FW_PORT_CMD_OVLAN1(1U)
4560 
4561 #define S_FW_PORT_CMD_OVLAN0	4
4562 #define M_FW_PORT_CMD_OVLAN0	0x1
4563 #define V_FW_PORT_CMD_OVLAN0(x)	((x) << S_FW_PORT_CMD_OVLAN0)
4564 #define G_FW_PORT_CMD_OVLAN0(x)	\
4565     (((x) >> S_FW_PORT_CMD_OVLAN0) & M_FW_PORT_CMD_OVLAN0)
4566 #define F_FW_PORT_CMD_OVLAN0	V_FW_PORT_CMD_OVLAN0(1U)
4567 
4568 #define S_FW_PORT_CMD_IVLAN0	3
4569 #define M_FW_PORT_CMD_IVLAN0	0x1
4570 #define V_FW_PORT_CMD_IVLAN0(x)	((x) << S_FW_PORT_CMD_IVLAN0)
4571 #define G_FW_PORT_CMD_IVLAN0(x)	\
4572     (((x) >> S_FW_PORT_CMD_IVLAN0) & M_FW_PORT_CMD_IVLAN0)
4573 #define F_FW_PORT_CMD_IVLAN0	V_FW_PORT_CMD_IVLAN0(1U)
4574 
4575 #define S_FW_PORT_CMD_TXIPG	3
4576 #define M_FW_PORT_CMD_TXIPG	0x1fff
4577 #define V_FW_PORT_CMD_TXIPG(x)	((x) << S_FW_PORT_CMD_TXIPG)
4578 #define G_FW_PORT_CMD_TXIPG(x)	\
4579     (((x) >> S_FW_PORT_CMD_TXIPG) & M_FW_PORT_CMD_TXIPG)
4580 
4581 #define S_FW_PORT_CMD_FORCE_PINFO	0
4582 #define M_FW_PORT_CMD_FORCE_PINFO	0x1
4583 #define V_FW_PORT_CMD_FORCE_PINFO(x)	((x) << S_FW_PORT_CMD_FORCE_PINFO)
4584 #define G_FW_PORT_CMD_FORCE_PINFO(x)	\
4585     (((x) >> S_FW_PORT_CMD_FORCE_PINFO) & M_FW_PORT_CMD_FORCE_PINFO)
4586 #define F_FW_PORT_CMD_FORCE_PINFO	V_FW_PORT_CMD_FORCE_PINFO(1U)
4587 
4588 #define S_FW_PORT_CMD_LSTATUS		31
4589 #define M_FW_PORT_CMD_LSTATUS		0x1
4590 #define V_FW_PORT_CMD_LSTATUS(x)	((x) << S_FW_PORT_CMD_LSTATUS)
4591 #define G_FW_PORT_CMD_LSTATUS(x)	\
4592     (((x) >> S_FW_PORT_CMD_LSTATUS) & M_FW_PORT_CMD_LSTATUS)
4593 #define F_FW_PORT_CMD_LSTATUS	V_FW_PORT_CMD_LSTATUS(1U)
4594 
4595 #define S_FW_PORT_CMD_LSPEED	24
4596 #define M_FW_PORT_CMD_LSPEED	0x3f
4597 #define V_FW_PORT_CMD_LSPEED(x)	((x) << S_FW_PORT_CMD_LSPEED)
4598 #define G_FW_PORT_CMD_LSPEED(x)	\
4599     (((x) >> S_FW_PORT_CMD_LSPEED) & M_FW_PORT_CMD_LSPEED)
4600 
4601 #define S_FW_PORT_CMD_TXPAUSE		23
4602 #define M_FW_PORT_CMD_TXPAUSE		0x1
4603 #define V_FW_PORT_CMD_TXPAUSE(x)	((x) << S_FW_PORT_CMD_TXPAUSE)
4604 #define G_FW_PORT_CMD_TXPAUSE(x)	\
4605     (((x) >> S_FW_PORT_CMD_TXPAUSE) & M_FW_PORT_CMD_TXPAUSE)
4606 #define F_FW_PORT_CMD_TXPAUSE	V_FW_PORT_CMD_TXPAUSE(1U)
4607 
4608 #define S_FW_PORT_CMD_RXPAUSE		22
4609 #define M_FW_PORT_CMD_RXPAUSE		0x1
4610 #define V_FW_PORT_CMD_RXPAUSE(x)	((x) << S_FW_PORT_CMD_RXPAUSE)
4611 #define G_FW_PORT_CMD_RXPAUSE(x)	\
4612     (((x) >> S_FW_PORT_CMD_RXPAUSE) & M_FW_PORT_CMD_RXPAUSE)
4613 #define F_FW_PORT_CMD_RXPAUSE	V_FW_PORT_CMD_RXPAUSE(1U)
4614 
4615 #define S_FW_PORT_CMD_MDIOCAP		21
4616 #define M_FW_PORT_CMD_MDIOCAP		0x1
4617 #define V_FW_PORT_CMD_MDIOCAP(x)	((x) << S_FW_PORT_CMD_MDIOCAP)
4618 #define G_FW_PORT_CMD_MDIOCAP(x)	\
4619     (((x) >> S_FW_PORT_CMD_MDIOCAP) & M_FW_PORT_CMD_MDIOCAP)
4620 #define F_FW_PORT_CMD_MDIOCAP	V_FW_PORT_CMD_MDIOCAP(1U)
4621 
4622 #define S_FW_PORT_CMD_MDIOADDR		16
4623 #define M_FW_PORT_CMD_MDIOADDR		0x1f
4624 #define V_FW_PORT_CMD_MDIOADDR(x)	((x) << S_FW_PORT_CMD_MDIOADDR)
4625 #define G_FW_PORT_CMD_MDIOADDR(x)	\
4626     (((x) >> S_FW_PORT_CMD_MDIOADDR) & M_FW_PORT_CMD_MDIOADDR)
4627 
4628 #define S_FW_PORT_CMD_LPTXPAUSE		15
4629 #define M_FW_PORT_CMD_LPTXPAUSE		0x1
4630 #define V_FW_PORT_CMD_LPTXPAUSE(x)	((x) << S_FW_PORT_CMD_LPTXPAUSE)
4631 #define G_FW_PORT_CMD_LPTXPAUSE(x)	\
4632     (((x) >> S_FW_PORT_CMD_LPTXPAUSE) & M_FW_PORT_CMD_LPTXPAUSE)
4633 #define F_FW_PORT_CMD_LPTXPAUSE	V_FW_PORT_CMD_LPTXPAUSE(1U)
4634 
4635 #define S_FW_PORT_CMD_LPRXPAUSE		14
4636 #define M_FW_PORT_CMD_LPRXPAUSE		0x1
4637 #define V_FW_PORT_CMD_LPRXPAUSE(x)	((x) << S_FW_PORT_CMD_LPRXPAUSE)
4638 #define G_FW_PORT_CMD_LPRXPAUSE(x)	\
4639     (((x) >> S_FW_PORT_CMD_LPRXPAUSE) & M_FW_PORT_CMD_LPRXPAUSE)
4640 #define F_FW_PORT_CMD_LPRXPAUSE	V_FW_PORT_CMD_LPRXPAUSE(1U)
4641 
4642 #define S_FW_PORT_CMD_PTYPE	8
4643 #define M_FW_PORT_CMD_PTYPE	0x1f
4644 #define V_FW_PORT_CMD_PTYPE(x)	((x) << S_FW_PORT_CMD_PTYPE)
4645 #define G_FW_PORT_CMD_PTYPE(x)	\
4646     (((x) >> S_FW_PORT_CMD_PTYPE) & M_FW_PORT_CMD_PTYPE)
4647 
4648 #define S_FW_PORT_CMD_LINKDNRC		5
4649 #define M_FW_PORT_CMD_LINKDNRC		0x7
4650 #define V_FW_PORT_CMD_LINKDNRC(x)	((x) << S_FW_PORT_CMD_LINKDNRC)
4651 #define G_FW_PORT_CMD_LINKDNRC(x)	\
4652     (((x) >> S_FW_PORT_CMD_LINKDNRC) & M_FW_PORT_CMD_LINKDNRC)
4653 
4654 #define S_FW_PORT_CMD_MODTYPE		0
4655 #define M_FW_PORT_CMD_MODTYPE		0x1f
4656 #define V_FW_PORT_CMD_MODTYPE(x)	((x) << S_FW_PORT_CMD_MODTYPE)
4657 #define G_FW_PORT_CMD_MODTYPE(x)	\
4658     (((x) >> S_FW_PORT_CMD_MODTYPE) & M_FW_PORT_CMD_MODTYPE)
4659 
4660 #define S_FW_PORT_CMD_APPLY	7
4661 #define M_FW_PORT_CMD_APPLY	0x1
4662 #define V_FW_PORT_CMD_APPLY(x)	((x) << S_FW_PORT_CMD_APPLY)
4663 #define G_FW_PORT_CMD_APPLY(x)	\
4664     (((x) >> S_FW_PORT_CMD_APPLY) & M_FW_PORT_CMD_APPLY)
4665 #define F_FW_PORT_CMD_APPLY	V_FW_PORT_CMD_APPLY(1U)
4666 
4667 /*
4668  *	These are configured into the VPD and hence tools that generate
4669  *	VPD may use this enumeration.
4670  *	extPHY	#lanes	T4_I2C	extI2C	BP_Eq	BP_ANEG	Speed
4671  */
4672 enum fw_port_type {
4673 	FW_PORT_TYPE_FIBER_XFI	=  0,	/* Y, 1, N, Y, N, N, 10G */
4674 	FW_PORT_TYPE_FIBER_XAUI	=  1,	/* Y, 4, N, Y, N, N, 10G */
4675 	FW_PORT_TYPE_BT_SGMII	=  2,	/* Y, 1, No, No, No, No, 1G/100M */
4676 	FW_PORT_TYPE_BT_XFI	=  3,	/* Y, 1, No, No, No, No, 10G */
4677 	FW_PORT_TYPE_BT_XAUI	=  4,	/* Y, 4, No, No, No, No, 10G/1G/100M? */
4678 	FW_PORT_TYPE_KX4	=  5,	/* No, 4, No, No, Yes, Yes, 10G */
4679 	FW_PORT_TYPE_CX4	=  6,	/* No, 4, No, No, No, No, 10G */
4680 	FW_PORT_TYPE_KX		=  7,	/* No, 1, No, No, Yes, No, 1G */
4681 	FW_PORT_TYPE_KR		=  8,	/* No, 1, No, No, Yes, Yes, 10G */
4682 	FW_PORT_TYPE_SFP	=  9,	/* No, 1, Yes, No, No, No, 10G */
4683 	FW_PORT_TYPE_BP_AP	= 10,	/* No, 1, No, No, Yes, Yes, 10G, BP ANGE */
4684 	FW_PORT_TYPE_BP4_AP	= 11,	/* No, 4, No, No, Yes, Yes, 10G, BP ANGE */
4685 
4686 	FW_PORT_TYPE_NONE = M_FW_PORT_CMD_PTYPE
4687 };
4688 
4689 /* These are read from module's EEPROM and determined once the
4690    module is inserted. */
4691 enum fw_port_module_type {
4692 	FW_PORT_MOD_TYPE_NA		= 0x0,
4693 	FW_PORT_MOD_TYPE_LR		= 0x1,
4694 	FW_PORT_MOD_TYPE_SR		= 0x2,
4695 	FW_PORT_MOD_TYPE_ER		= 0x3,
4696 	FW_PORT_MOD_TYPE_TWINAX_PASSIVE	= 0x4,
4697 	FW_PORT_MOD_TYPE_TWINAX_ACTIVE	= 0x5,
4698 	FW_PORT_MOD_TYPE_LRM		= 0x6,
4699 	FW_PORT_MOD_TYPE_ERROR		= M_FW_PORT_CMD_MODTYPE - 3,
4700 	FW_PORT_MOD_TYPE_UNKNOWN	= M_FW_PORT_CMD_MODTYPE - 2,
4701 	FW_PORT_MOD_TYPE_NOTSUPPORTED	= M_FW_PORT_CMD_MODTYPE - 1,
4702 	FW_PORT_MOD_TYPE_NONE		= M_FW_PORT_CMD_MODTYPE
4703 };
4704 
4705 /* used by FW and tools may use this to generate VPD */
4706 enum fw_port_mod_sub_type {
4707 	FW_PORT_MOD_SUB_TYPE_NA,
4708 	FW_PORT_MOD_SUB_TYPE_MV88E114X=0x1,
4709 	FW_PORT_MOD_SUB_TYPE_BT_VSC8634=0x8,
4710 
4711 	/*
4712 	 * The following will never been in the VPD.  They are TWINAX cable
4713 	 * lengths decoded from SFP+ module i2c PROMs.  These should almost
4714 	 * certainly go somewhere else ...
4715 	 */
4716 	FW_PORT_MOD_SUB_TYPE_TWINAX_1=0x9,
4717 	FW_PORT_MOD_SUB_TYPE_TWINAX_3=0xA,
4718 	FW_PORT_MOD_SUB_TYPE_TWINAX_5=0xB,
4719 	FW_PORT_MOD_SUB_TYPE_TWINAX_7=0xC,
4720 };
4721 
4722 /* link down reason codes (3b) */
4723 enum fw_port_link_dn_rc {
4724 	FW_PORT_LINK_DN_RC_NONE,
4725 	FW_PORT_LINK_DN_RC_REMFLT,
4726 	FW_PORT_LINK_DN_ANEG_F,
4727 	FW_PORT_LINK_DN_MS_RES_F,
4728 	FW_PORT_LINK_DN_UNKNOWN
4729 };
4730 
4731 /* port stats */
4732 #define FW_NUM_PORT_STATS 50
4733 #define FW_NUM_PORT_TX_STATS 23
4734 #define FW_NUM_PORT_RX_STATS 27
4735 
4736 enum fw_port_stats_tx_index {
4737 	FW_STAT_TX_PORT_BYTES_IX,
4738 	FW_STAT_TX_PORT_FRAMES_IX,
4739 	FW_STAT_TX_PORT_BCAST_IX,
4740 	FW_STAT_TX_PORT_MCAST_IX,
4741 	FW_STAT_TX_PORT_UCAST_IX,
4742 	FW_STAT_TX_PORT_ERROR_IX,
4743 	FW_STAT_TX_PORT_64B_IX,
4744 	FW_STAT_TX_PORT_65B_127B_IX,
4745 	FW_STAT_TX_PORT_128B_255B_IX,
4746 	FW_STAT_TX_PORT_256B_511B_IX,
4747 	FW_STAT_TX_PORT_512B_1023B_IX,
4748 	FW_STAT_TX_PORT_1024B_1518B_IX,
4749 	FW_STAT_TX_PORT_1519B_MAX_IX,
4750 	FW_STAT_TX_PORT_DROP_IX,
4751 	FW_STAT_TX_PORT_PAUSE_IX,
4752 	FW_STAT_TX_PORT_PPP0_IX,
4753 	FW_STAT_TX_PORT_PPP1_IX,
4754 	FW_STAT_TX_PORT_PPP2_IX,
4755 	FW_STAT_TX_PORT_PPP3_IX,
4756 	FW_STAT_TX_PORT_PPP4_IX,
4757 	FW_STAT_TX_PORT_PPP5_IX,
4758 	FW_STAT_TX_PORT_PPP6_IX,
4759 	FW_STAT_TX_PORT_PPP7_IX
4760 };
4761 
4762 enum fw_port_stat_rx_index {
4763 	FW_STAT_RX_PORT_BYTES_IX,
4764 	FW_STAT_RX_PORT_FRAMES_IX,
4765 	FW_STAT_RX_PORT_BCAST_IX,
4766 	FW_STAT_RX_PORT_MCAST_IX,
4767 	FW_STAT_RX_PORT_UCAST_IX,
4768 	FW_STAT_RX_PORT_MTU_ERROR_IX,
4769 	FW_STAT_RX_PORT_MTU_CRC_ERROR_IX,
4770 	FW_STAT_RX_PORT_CRC_ERROR_IX,
4771 	FW_STAT_RX_PORT_LEN_ERROR_IX,
4772 	FW_STAT_RX_PORT_SYM_ERROR_IX,
4773 	FW_STAT_RX_PORT_64B_IX,
4774 	FW_STAT_RX_PORT_65B_127B_IX,
4775 	FW_STAT_RX_PORT_128B_255B_IX,
4776 	FW_STAT_RX_PORT_256B_511B_IX,
4777 	FW_STAT_RX_PORT_512B_1023B_IX,
4778 	FW_STAT_RX_PORT_1024B_1518B_IX,
4779 	FW_STAT_RX_PORT_1519B_MAX_IX,
4780 	FW_STAT_RX_PORT_PAUSE_IX,
4781 	FW_STAT_RX_PORT_PPP0_IX,
4782 	FW_STAT_RX_PORT_PPP1_IX,
4783 	FW_STAT_RX_PORT_PPP2_IX,
4784 	FW_STAT_RX_PORT_PPP3_IX,
4785 	FW_STAT_RX_PORT_PPP4_IX,
4786 	FW_STAT_RX_PORT_PPP5_IX,
4787 	FW_STAT_RX_PORT_PPP6_IX,
4788 	FW_STAT_RX_PORT_PPP7_IX,
4789 	FW_STAT_RX_PORT_LESS_64B_IX
4790 };
4791 
4792 struct fw_port_stats_cmd {
4793 	__be32 op_to_portid;
4794 	__be32 retval_len16;
4795 	union fw_port_stats {
4796 		struct fw_port_stats_ctl {
4797 			__u8   nstats_bg_bm;
4798 			__u8   tx_ix;
4799 			__be16 r6;
4800 			__be32 r7;
4801 			__be64 stat0;
4802 			__be64 stat1;
4803 			__be64 stat2;
4804 			__be64 stat3;
4805 			__be64 stat4;
4806 			__be64 stat5;
4807 		} ctl;
4808 		struct fw_port_stats_all {
4809 			__be64 tx_bytes;
4810 			__be64 tx_frames;
4811 			__be64 tx_bcast;
4812 			__be64 tx_mcast;
4813 			__be64 tx_ucast;
4814 			__be64 tx_error;
4815 			__be64 tx_64b;
4816 			__be64 tx_65b_127b;
4817 			__be64 tx_128b_255b;
4818 			__be64 tx_256b_511b;
4819 			__be64 tx_512b_1023b;
4820 			__be64 tx_1024b_1518b;
4821 			__be64 tx_1519b_max;
4822 			__be64 tx_drop;
4823 			__be64 tx_pause;
4824 			__be64 tx_ppp0;
4825 			__be64 tx_ppp1;
4826 			__be64 tx_ppp2;
4827 			__be64 tx_ppp3;
4828 			__be64 tx_ppp4;
4829 			__be64 tx_ppp5;
4830 			__be64 tx_ppp6;
4831 			__be64 tx_ppp7;
4832 			__be64 rx_bytes;
4833 			__be64 rx_frames;
4834 			__be64 rx_bcast;
4835 			__be64 rx_mcast;
4836 			__be64 rx_ucast;
4837 			__be64 rx_mtu_error;
4838 			__be64 rx_mtu_crc_error;
4839 			__be64 rx_crc_error;
4840 			__be64 rx_len_error;
4841 			__be64 rx_sym_error;
4842 			__be64 rx_64b;
4843 			__be64 rx_65b_127b;
4844 			__be64 rx_128b_255b;
4845 			__be64 rx_256b_511b;
4846 			__be64 rx_512b_1023b;
4847 			__be64 rx_1024b_1518b;
4848 			__be64 rx_1519b_max;
4849 			__be64 rx_pause;
4850 			__be64 rx_ppp0;
4851 			__be64 rx_ppp1;
4852 			__be64 rx_ppp2;
4853 			__be64 rx_ppp3;
4854 			__be64 rx_ppp4;
4855 			__be64 rx_ppp5;
4856 			__be64 rx_ppp6;
4857 			__be64 rx_ppp7;
4858 			__be64 rx_less_64b;
4859 			__be64 rx_bg_drop;
4860 			__be64 rx_bg_trunc;
4861 		} all;
4862 	} u;
4863 };
4864 
4865 #define S_FW_PORT_STATS_CMD_NSTATS	4
4866 #define M_FW_PORT_STATS_CMD_NSTATS	0x7
4867 #define V_FW_PORT_STATS_CMD_NSTATS(x)	((x) << S_FW_PORT_STATS_CMD_NSTATS)
4868 #define G_FW_PORT_STATS_CMD_NSTATS(x)	\
4869     (((x) >> S_FW_PORT_STATS_CMD_NSTATS) & M_FW_PORT_STATS_CMD_NSTATS)
4870 
4871 #define S_FW_PORT_STATS_CMD_BG_BM	0
4872 #define M_FW_PORT_STATS_CMD_BG_BM	0x3
4873 #define V_FW_PORT_STATS_CMD_BG_BM(x)	((x) << S_FW_PORT_STATS_CMD_BG_BM)
4874 #define G_FW_PORT_STATS_CMD_BG_BM(x)	\
4875     (((x) >> S_FW_PORT_STATS_CMD_BG_BM) & M_FW_PORT_STATS_CMD_BG_BM)
4876 
4877 #define S_FW_PORT_STATS_CMD_TX		7
4878 #define M_FW_PORT_STATS_CMD_TX		0x1
4879 #define V_FW_PORT_STATS_CMD_TX(x)	((x) << S_FW_PORT_STATS_CMD_TX)
4880 #define G_FW_PORT_STATS_CMD_TX(x)	\
4881     (((x) >> S_FW_PORT_STATS_CMD_TX) & M_FW_PORT_STATS_CMD_TX)
4882 #define F_FW_PORT_STATS_CMD_TX	V_FW_PORT_STATS_CMD_TX(1U)
4883 
4884 #define S_FW_PORT_STATS_CMD_IX		0
4885 #define M_FW_PORT_STATS_CMD_IX		0x3f
4886 #define V_FW_PORT_STATS_CMD_IX(x)	((x) << S_FW_PORT_STATS_CMD_IX)
4887 #define G_FW_PORT_STATS_CMD_IX(x)	\
4888     (((x) >> S_FW_PORT_STATS_CMD_IX) & M_FW_PORT_STATS_CMD_IX)
4889 
4890 /* port loopback stats */
4891 #define FW_NUM_LB_STATS 14
4892 enum fw_port_lb_stats_index {
4893 	FW_STAT_LB_PORT_BYTES_IX,
4894 	FW_STAT_LB_PORT_FRAMES_IX,
4895 	FW_STAT_LB_PORT_BCAST_IX,
4896 	FW_STAT_LB_PORT_MCAST_IX,
4897 	FW_STAT_LB_PORT_UCAST_IX,
4898 	FW_STAT_LB_PORT_ERROR_IX,
4899 	FW_STAT_LB_PORT_64B_IX,
4900 	FW_STAT_LB_PORT_65B_127B_IX,
4901 	FW_STAT_LB_PORT_128B_255B_IX,
4902 	FW_STAT_LB_PORT_256B_511B_IX,
4903 	FW_STAT_LB_PORT_512B_1023B_IX,
4904 	FW_STAT_LB_PORT_1024B_1518B_IX,
4905 	FW_STAT_LB_PORT_1519B_MAX_IX,
4906 	FW_STAT_LB_PORT_DROP_FRAMES_IX
4907 };
4908 
4909 struct fw_port_lb_stats_cmd {
4910 	__be32 op_to_lbport;
4911 	__be32 retval_len16;
4912 	union fw_port_lb_stats {
4913 		struct fw_port_lb_stats_ctl {
4914 			__u8   nstats_bg_bm;
4915 			__u8   ix_pkd;
4916 			__be16 r6;
4917 			__be32 r7;
4918 			__be64 stat0;
4919 			__be64 stat1;
4920 			__be64 stat2;
4921 			__be64 stat3;
4922 			__be64 stat4;
4923 			__be64 stat5;
4924 		} ctl;
4925 		struct fw_port_lb_stats_all {
4926 			__be64 tx_bytes;
4927 			__be64 tx_frames;
4928 			__be64 tx_bcast;
4929 			__be64 tx_mcast;
4930 			__be64 tx_ucast;
4931 			__be64 tx_error;
4932 			__be64 tx_64b;
4933 			__be64 tx_65b_127b;
4934 			__be64 tx_128b_255b;
4935 			__be64 tx_256b_511b;
4936 			__be64 tx_512b_1023b;
4937 			__be64 tx_1024b_1518b;
4938 			__be64 tx_1519b_max;
4939 			__be64 rx_lb_drop;
4940 			__be64 rx_lb_trunc;
4941 		} all;
4942 	} u;
4943 };
4944 
4945 #define S_FW_PORT_LB_STATS_CMD_LBPORT		0
4946 #define M_FW_PORT_LB_STATS_CMD_LBPORT		0xf
4947 #define V_FW_PORT_LB_STATS_CMD_LBPORT(x)	\
4948     ((x) << S_FW_PORT_LB_STATS_CMD_LBPORT)
4949 #define G_FW_PORT_LB_STATS_CMD_LBPORT(x)	\
4950     (((x) >> S_FW_PORT_LB_STATS_CMD_LBPORT) & M_FW_PORT_LB_STATS_CMD_LBPORT)
4951 
4952 #define S_FW_PORT_LB_STATS_CMD_NSTATS		4
4953 #define M_FW_PORT_LB_STATS_CMD_NSTATS		0x7
4954 #define V_FW_PORT_LB_STATS_CMD_NSTATS(x)	\
4955     ((x) << S_FW_PORT_LB_STATS_CMD_NSTATS)
4956 #define G_FW_PORT_LB_STATS_CMD_NSTATS(x)	\
4957     (((x) >> S_FW_PORT_LB_STATS_CMD_NSTATS) & M_FW_PORT_LB_STATS_CMD_NSTATS)
4958 
4959 #define S_FW_PORT_LB_STATS_CMD_BG_BM	0
4960 #define M_FW_PORT_LB_STATS_CMD_BG_BM	0x3
4961 #define V_FW_PORT_LB_STATS_CMD_BG_BM(x)	((x) << S_FW_PORT_LB_STATS_CMD_BG_BM)
4962 #define G_FW_PORT_LB_STATS_CMD_BG_BM(x)	\
4963     (((x) >> S_FW_PORT_LB_STATS_CMD_BG_BM) & M_FW_PORT_LB_STATS_CMD_BG_BM)
4964 
4965 #define S_FW_PORT_LB_STATS_CMD_IX	0
4966 #define M_FW_PORT_LB_STATS_CMD_IX	0xf
4967 #define V_FW_PORT_LB_STATS_CMD_IX(x)	((x) << S_FW_PORT_LB_STATS_CMD_IX)
4968 #define G_FW_PORT_LB_STATS_CMD_IX(x)	\
4969     (((x) >> S_FW_PORT_LB_STATS_CMD_IX) & M_FW_PORT_LB_STATS_CMD_IX)
4970 
4971 /* Trace related defines */
4972 #define FW_TRACE_CAPTURE_MAX_SINGLE_FLT_MODE 10240
4973 #define FW_TRACE_CAPTURE_MAX_MULTI_FLT_MODE  2560
4974 
4975 struct fw_port_trace_cmd {
4976 	__be32 op_to_portid;
4977 	__be32 retval_len16;
4978 	__be16 traceen_to_pciech;
4979 	__be16 qnum;
4980 	__be32 r5;
4981 };
4982 
4983 #define S_FW_PORT_TRACE_CMD_PORTID	0
4984 #define M_FW_PORT_TRACE_CMD_PORTID	0xf
4985 #define V_FW_PORT_TRACE_CMD_PORTID(x)	((x) << S_FW_PORT_TRACE_CMD_PORTID)
4986 #define G_FW_PORT_TRACE_CMD_PORTID(x)	\
4987     (((x) >> S_FW_PORT_TRACE_CMD_PORTID) & M_FW_PORT_TRACE_CMD_PORTID)
4988 
4989 #define S_FW_PORT_TRACE_CMD_TRACEEN	15
4990 #define M_FW_PORT_TRACE_CMD_TRACEEN	0x1
4991 #define V_FW_PORT_TRACE_CMD_TRACEEN(x)	((x) << S_FW_PORT_TRACE_CMD_TRACEEN)
4992 #define G_FW_PORT_TRACE_CMD_TRACEEN(x)	\
4993     (((x) >> S_FW_PORT_TRACE_CMD_TRACEEN) & M_FW_PORT_TRACE_CMD_TRACEEN)
4994 #define F_FW_PORT_TRACE_CMD_TRACEEN	V_FW_PORT_TRACE_CMD_TRACEEN(1U)
4995 
4996 #define S_FW_PORT_TRACE_CMD_FLTMODE	14
4997 #define M_FW_PORT_TRACE_CMD_FLTMODE	0x1
4998 #define V_FW_PORT_TRACE_CMD_FLTMODE(x)	((x) << S_FW_PORT_TRACE_CMD_FLTMODE)
4999 #define G_FW_PORT_TRACE_CMD_FLTMODE(x)	\
5000     (((x) >> S_FW_PORT_TRACE_CMD_FLTMODE) & M_FW_PORT_TRACE_CMD_FLTMODE)
5001 #define F_FW_PORT_TRACE_CMD_FLTMODE	V_FW_PORT_TRACE_CMD_FLTMODE(1U)
5002 
5003 #define S_FW_PORT_TRACE_CMD_DUPLEN	13
5004 #define M_FW_PORT_TRACE_CMD_DUPLEN	0x1
5005 #define V_FW_PORT_TRACE_CMD_DUPLEN(x)	((x) << S_FW_PORT_TRACE_CMD_DUPLEN)
5006 #define G_FW_PORT_TRACE_CMD_DUPLEN(x)	\
5007     (((x) >> S_FW_PORT_TRACE_CMD_DUPLEN) & M_FW_PORT_TRACE_CMD_DUPLEN)
5008 #define F_FW_PORT_TRACE_CMD_DUPLEN	V_FW_PORT_TRACE_CMD_DUPLEN(1U)
5009 
5010 #define S_FW_PORT_TRACE_CMD_RUNTFLTSIZE		8
5011 #define M_FW_PORT_TRACE_CMD_RUNTFLTSIZE		0x1f
5012 #define V_FW_PORT_TRACE_CMD_RUNTFLTSIZE(x)	\
5013     ((x) << S_FW_PORT_TRACE_CMD_RUNTFLTSIZE)
5014 #define G_FW_PORT_TRACE_CMD_RUNTFLTSIZE(x)	\
5015     (((x) >> S_FW_PORT_TRACE_CMD_RUNTFLTSIZE) & \
5016      M_FW_PORT_TRACE_CMD_RUNTFLTSIZE)
5017 
5018 #define S_FW_PORT_TRACE_CMD_PCIECH	6
5019 #define M_FW_PORT_TRACE_CMD_PCIECH	0x3
5020 #define V_FW_PORT_TRACE_CMD_PCIECH(x)	((x) << S_FW_PORT_TRACE_CMD_PCIECH)
5021 #define G_FW_PORT_TRACE_CMD_PCIECH(x)	\
5022     (((x) >> S_FW_PORT_TRACE_CMD_PCIECH) & M_FW_PORT_TRACE_CMD_PCIECH)
5023 
5024 struct fw_port_trace_mmap_cmd {
5025 	__be32 op_to_portid;
5026 	__be32 retval_len16;
5027 	__be32 fid_to_skipoffset;
5028 	__be32 minpktsize_capturemax;
5029 	__u8   map[224];
5030 };
5031 
5032 #define S_FW_PORT_TRACE_MMAP_CMD_PORTID		0
5033 #define M_FW_PORT_TRACE_MMAP_CMD_PORTID		0xf
5034 #define V_FW_PORT_TRACE_MMAP_CMD_PORTID(x)	\
5035     ((x) << S_FW_PORT_TRACE_MMAP_CMD_PORTID)
5036 #define G_FW_PORT_TRACE_MMAP_CMD_PORTID(x)	\
5037     (((x) >> S_FW_PORT_TRACE_MMAP_CMD_PORTID) & \
5038      M_FW_PORT_TRACE_MMAP_CMD_PORTID)
5039 
5040 #define S_FW_PORT_TRACE_MMAP_CMD_FID	30
5041 #define M_FW_PORT_TRACE_MMAP_CMD_FID	0x3
5042 #define V_FW_PORT_TRACE_MMAP_CMD_FID(x)	((x) << S_FW_PORT_TRACE_MMAP_CMD_FID)
5043 #define G_FW_PORT_TRACE_MMAP_CMD_FID(x)	\
5044     (((x) >> S_FW_PORT_TRACE_MMAP_CMD_FID) & M_FW_PORT_TRACE_MMAP_CMD_FID)
5045 
5046 #define S_FW_PORT_TRACE_MMAP_CMD_MMAPEN		29
5047 #define M_FW_PORT_TRACE_MMAP_CMD_MMAPEN		0x1
5048 #define V_FW_PORT_TRACE_MMAP_CMD_MMAPEN(x)	\
5049     ((x) << S_FW_PORT_TRACE_MMAP_CMD_MMAPEN)
5050 #define G_FW_PORT_TRACE_MMAP_CMD_MMAPEN(x)	\
5051     (((x) >> S_FW_PORT_TRACE_MMAP_CMD_MMAPEN) & \
5052      M_FW_PORT_TRACE_MMAP_CMD_MMAPEN)
5053 #define F_FW_PORT_TRACE_MMAP_CMD_MMAPEN	V_FW_PORT_TRACE_MMAP_CMD_MMAPEN(1U)
5054 
5055 #define S_FW_PORT_TRACE_MMAP_CMD_DCMAPEN	28
5056 #define M_FW_PORT_TRACE_MMAP_CMD_DCMAPEN	0x1
5057 #define V_FW_PORT_TRACE_MMAP_CMD_DCMAPEN(x)	\
5058     ((x) << S_FW_PORT_TRACE_MMAP_CMD_DCMAPEN)
5059 #define G_FW_PORT_TRACE_MMAP_CMD_DCMAPEN(x)	\
5060     (((x) >> S_FW_PORT_TRACE_MMAP_CMD_DCMAPEN) & \
5061      M_FW_PORT_TRACE_MMAP_CMD_DCMAPEN)
5062 #define F_FW_PORT_TRACE_MMAP_CMD_DCMAPEN	\
5063     V_FW_PORT_TRACE_MMAP_CMD_DCMAPEN(1U)
5064 
5065 #define S_FW_PORT_TRACE_MMAP_CMD_SKIPLENGTH	8
5066 #define M_FW_PORT_TRACE_MMAP_CMD_SKIPLENGTH	0x1f
5067 #define V_FW_PORT_TRACE_MMAP_CMD_SKIPLENGTH(x)	\
5068     ((x) << S_FW_PORT_TRACE_MMAP_CMD_SKIPLENGTH)
5069 #define G_FW_PORT_TRACE_MMAP_CMD_SKIPLENGTH(x)	\
5070     (((x) >> S_FW_PORT_TRACE_MMAP_CMD_SKIPLENGTH) & \
5071      M_FW_PORT_TRACE_MMAP_CMD_SKIPLENGTH)
5072 
5073 #define S_FW_PORT_TRACE_MMAP_CMD_SKIPOFFSET	0
5074 #define M_FW_PORT_TRACE_MMAP_CMD_SKIPOFFSET	0x1f
5075 #define V_FW_PORT_TRACE_MMAP_CMD_SKIPOFFSET(x)	\
5076     ((x) << S_FW_PORT_TRACE_MMAP_CMD_SKIPOFFSET)
5077 #define G_FW_PORT_TRACE_MMAP_CMD_SKIPOFFSET(x)	\
5078     (((x) >> S_FW_PORT_TRACE_MMAP_CMD_SKIPOFFSET) & \
5079      M_FW_PORT_TRACE_MMAP_CMD_SKIPOFFSET)
5080 
5081 #define S_FW_PORT_TRACE_MMAP_CMD_MINPKTSIZE	18
5082 #define M_FW_PORT_TRACE_MMAP_CMD_MINPKTSIZE	0x3fff
5083 #define V_FW_PORT_TRACE_MMAP_CMD_MINPKTSIZE(x)	\
5084     ((x) << S_FW_PORT_TRACE_MMAP_CMD_MINPKTSIZE)
5085 #define G_FW_PORT_TRACE_MMAP_CMD_MINPKTSIZE(x)	\
5086     (((x) >> S_FW_PORT_TRACE_MMAP_CMD_MINPKTSIZE) & \
5087      M_FW_PORT_TRACE_MMAP_CMD_MINPKTSIZE)
5088 
5089 #define S_FW_PORT_TRACE_MMAP_CMD_CAPTUREMAX	0
5090 #define M_FW_PORT_TRACE_MMAP_CMD_CAPTUREMAX	0x3fff
5091 #define V_FW_PORT_TRACE_MMAP_CMD_CAPTUREMAX(x)	\
5092     ((x) << S_FW_PORT_TRACE_MMAP_CMD_CAPTUREMAX)
5093 #define G_FW_PORT_TRACE_MMAP_CMD_CAPTUREMAX(x)	\
5094     (((x) >> S_FW_PORT_TRACE_MMAP_CMD_CAPTUREMAX) & \
5095      M_FW_PORT_TRACE_MMAP_CMD_CAPTUREMAX)
5096 
5097 struct fw_rss_ind_tbl_cmd {
5098 	__be32 op_to_viid;
5099 	__be32 retval_len16;
5100 	__be16 niqid;
5101 	__be16 startidx;
5102 	__be32 r3;
5103 	__be32 iq0_to_iq2;
5104 	__be32 iq3_to_iq5;
5105 	__be32 iq6_to_iq8;
5106 	__be32 iq9_to_iq11;
5107 	__be32 iq12_to_iq14;
5108 	__be32 iq15_to_iq17;
5109 	__be32 iq18_to_iq20;
5110 	__be32 iq21_to_iq23;
5111 	__be32 iq24_to_iq26;
5112 	__be32 iq27_to_iq29;
5113 	__be32 iq30_iq31;
5114 	__be32 r15_lo;
5115 };
5116 
5117 #define S_FW_RSS_IND_TBL_CMD_VIID	0
5118 #define M_FW_RSS_IND_TBL_CMD_VIID	0xfff
5119 #define V_FW_RSS_IND_TBL_CMD_VIID(x)	((x) << S_FW_RSS_IND_TBL_CMD_VIID)
5120 #define G_FW_RSS_IND_TBL_CMD_VIID(x)	\
5121     (((x) >> S_FW_RSS_IND_TBL_CMD_VIID) & M_FW_RSS_IND_TBL_CMD_VIID)
5122 
5123 #define S_FW_RSS_IND_TBL_CMD_IQ0	20
5124 #define M_FW_RSS_IND_TBL_CMD_IQ0	0x3ff
5125 #define V_FW_RSS_IND_TBL_CMD_IQ0(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ0)
5126 #define G_FW_RSS_IND_TBL_CMD_IQ0(x)	\
5127     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ0) & M_FW_RSS_IND_TBL_CMD_IQ0)
5128 
5129 #define S_FW_RSS_IND_TBL_CMD_IQ1	10
5130 #define M_FW_RSS_IND_TBL_CMD_IQ1	0x3ff
5131 #define V_FW_RSS_IND_TBL_CMD_IQ1(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ1)
5132 #define G_FW_RSS_IND_TBL_CMD_IQ1(x)	\
5133     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ1) & M_FW_RSS_IND_TBL_CMD_IQ1)
5134 
5135 #define S_FW_RSS_IND_TBL_CMD_IQ2	0
5136 #define M_FW_RSS_IND_TBL_CMD_IQ2	0x3ff
5137 #define V_FW_RSS_IND_TBL_CMD_IQ2(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ2)
5138 #define G_FW_RSS_IND_TBL_CMD_IQ2(x)	\
5139     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ2) & M_FW_RSS_IND_TBL_CMD_IQ2)
5140 
5141 #define S_FW_RSS_IND_TBL_CMD_IQ3	20
5142 #define M_FW_RSS_IND_TBL_CMD_IQ3	0x3ff
5143 #define V_FW_RSS_IND_TBL_CMD_IQ3(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ3)
5144 #define G_FW_RSS_IND_TBL_CMD_IQ3(x)	\
5145     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ3) & M_FW_RSS_IND_TBL_CMD_IQ3)
5146 
5147 #define S_FW_RSS_IND_TBL_CMD_IQ4	10
5148 #define M_FW_RSS_IND_TBL_CMD_IQ4	0x3ff
5149 #define V_FW_RSS_IND_TBL_CMD_IQ4(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ4)
5150 #define G_FW_RSS_IND_TBL_CMD_IQ4(x)	\
5151     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ4) & M_FW_RSS_IND_TBL_CMD_IQ4)
5152 
5153 #define S_FW_RSS_IND_TBL_CMD_IQ5	0
5154 #define M_FW_RSS_IND_TBL_CMD_IQ5	0x3ff
5155 #define V_FW_RSS_IND_TBL_CMD_IQ5(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ5)
5156 #define G_FW_RSS_IND_TBL_CMD_IQ5(x)	\
5157     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ5) & M_FW_RSS_IND_TBL_CMD_IQ5)
5158 
5159 #define S_FW_RSS_IND_TBL_CMD_IQ6	20
5160 #define M_FW_RSS_IND_TBL_CMD_IQ6	0x3ff
5161 #define V_FW_RSS_IND_TBL_CMD_IQ6(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ6)
5162 #define G_FW_RSS_IND_TBL_CMD_IQ6(x)	\
5163     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ6) & M_FW_RSS_IND_TBL_CMD_IQ6)
5164 
5165 #define S_FW_RSS_IND_TBL_CMD_IQ7	10
5166 #define M_FW_RSS_IND_TBL_CMD_IQ7	0x3ff
5167 #define V_FW_RSS_IND_TBL_CMD_IQ7(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ7)
5168 #define G_FW_RSS_IND_TBL_CMD_IQ7(x)	\
5169     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ7) & M_FW_RSS_IND_TBL_CMD_IQ7)
5170 
5171 #define S_FW_RSS_IND_TBL_CMD_IQ8	0
5172 #define M_FW_RSS_IND_TBL_CMD_IQ8	0x3ff
5173 #define V_FW_RSS_IND_TBL_CMD_IQ8(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ8)
5174 #define G_FW_RSS_IND_TBL_CMD_IQ8(x)	\
5175     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ8) & M_FW_RSS_IND_TBL_CMD_IQ8)
5176 
5177 #define S_FW_RSS_IND_TBL_CMD_IQ9	20
5178 #define M_FW_RSS_IND_TBL_CMD_IQ9	0x3ff
5179 #define V_FW_RSS_IND_TBL_CMD_IQ9(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ9)
5180 #define G_FW_RSS_IND_TBL_CMD_IQ9(x)	\
5181     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ9) & M_FW_RSS_IND_TBL_CMD_IQ9)
5182 
5183 #define S_FW_RSS_IND_TBL_CMD_IQ10	10
5184 #define M_FW_RSS_IND_TBL_CMD_IQ10	0x3ff
5185 #define V_FW_RSS_IND_TBL_CMD_IQ10(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ10)
5186 #define G_FW_RSS_IND_TBL_CMD_IQ10(x)	\
5187     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ10) & M_FW_RSS_IND_TBL_CMD_IQ10)
5188 
5189 #define S_FW_RSS_IND_TBL_CMD_IQ11	0
5190 #define M_FW_RSS_IND_TBL_CMD_IQ11	0x3ff
5191 #define V_FW_RSS_IND_TBL_CMD_IQ11(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ11)
5192 #define G_FW_RSS_IND_TBL_CMD_IQ11(x)	\
5193     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ11) & M_FW_RSS_IND_TBL_CMD_IQ11)
5194 
5195 #define S_FW_RSS_IND_TBL_CMD_IQ12	20
5196 #define M_FW_RSS_IND_TBL_CMD_IQ12	0x3ff
5197 #define V_FW_RSS_IND_TBL_CMD_IQ12(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ12)
5198 #define G_FW_RSS_IND_TBL_CMD_IQ12(x)	\
5199     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ12) & M_FW_RSS_IND_TBL_CMD_IQ12)
5200 
5201 #define S_FW_RSS_IND_TBL_CMD_IQ13	10
5202 #define M_FW_RSS_IND_TBL_CMD_IQ13	0x3ff
5203 #define V_FW_RSS_IND_TBL_CMD_IQ13(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ13)
5204 #define G_FW_RSS_IND_TBL_CMD_IQ13(x)	\
5205     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ13) & M_FW_RSS_IND_TBL_CMD_IQ13)
5206 
5207 #define S_FW_RSS_IND_TBL_CMD_IQ14	0
5208 #define M_FW_RSS_IND_TBL_CMD_IQ14	0x3ff
5209 #define V_FW_RSS_IND_TBL_CMD_IQ14(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ14)
5210 #define G_FW_RSS_IND_TBL_CMD_IQ14(x)	\
5211     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ14) & M_FW_RSS_IND_TBL_CMD_IQ14)
5212 
5213 #define S_FW_RSS_IND_TBL_CMD_IQ15	20
5214 #define M_FW_RSS_IND_TBL_CMD_IQ15	0x3ff
5215 #define V_FW_RSS_IND_TBL_CMD_IQ15(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ15)
5216 #define G_FW_RSS_IND_TBL_CMD_IQ15(x)	\
5217     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ15) & M_FW_RSS_IND_TBL_CMD_IQ15)
5218 
5219 #define S_FW_RSS_IND_TBL_CMD_IQ16	10
5220 #define M_FW_RSS_IND_TBL_CMD_IQ16	0x3ff
5221 #define V_FW_RSS_IND_TBL_CMD_IQ16(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ16)
5222 #define G_FW_RSS_IND_TBL_CMD_IQ16(x)	\
5223     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ16) & M_FW_RSS_IND_TBL_CMD_IQ16)
5224 
5225 #define S_FW_RSS_IND_TBL_CMD_IQ17	0
5226 #define M_FW_RSS_IND_TBL_CMD_IQ17	0x3ff
5227 #define V_FW_RSS_IND_TBL_CMD_IQ17(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ17)
5228 #define G_FW_RSS_IND_TBL_CMD_IQ17(x)	\
5229     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ17) & M_FW_RSS_IND_TBL_CMD_IQ17)
5230 
5231 #define S_FW_RSS_IND_TBL_CMD_IQ18	20
5232 #define M_FW_RSS_IND_TBL_CMD_IQ18	0x3ff
5233 #define V_FW_RSS_IND_TBL_CMD_IQ18(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ18)
5234 #define G_FW_RSS_IND_TBL_CMD_IQ18(x)	\
5235     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ18) & M_FW_RSS_IND_TBL_CMD_IQ18)
5236 
5237 #define S_FW_RSS_IND_TBL_CMD_IQ19	10
5238 #define M_FW_RSS_IND_TBL_CMD_IQ19	0x3ff
5239 #define V_FW_RSS_IND_TBL_CMD_IQ19(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ19)
5240 #define G_FW_RSS_IND_TBL_CMD_IQ19(x)	\
5241     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ19) & M_FW_RSS_IND_TBL_CMD_IQ19)
5242 
5243 #define S_FW_RSS_IND_TBL_CMD_IQ20	0
5244 #define M_FW_RSS_IND_TBL_CMD_IQ20	0x3ff
5245 #define V_FW_RSS_IND_TBL_CMD_IQ20(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ20)
5246 #define G_FW_RSS_IND_TBL_CMD_IQ20(x)	\
5247     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ20) & M_FW_RSS_IND_TBL_CMD_IQ20)
5248 
5249 #define S_FW_RSS_IND_TBL_CMD_IQ21	20
5250 #define M_FW_RSS_IND_TBL_CMD_IQ21	0x3ff
5251 #define V_FW_RSS_IND_TBL_CMD_IQ21(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ21)
5252 #define G_FW_RSS_IND_TBL_CMD_IQ21(x)	\
5253     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ21) & M_FW_RSS_IND_TBL_CMD_IQ21)
5254 
5255 #define S_FW_RSS_IND_TBL_CMD_IQ22	10
5256 #define M_FW_RSS_IND_TBL_CMD_IQ22	0x3ff
5257 #define V_FW_RSS_IND_TBL_CMD_IQ22(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ22)
5258 #define G_FW_RSS_IND_TBL_CMD_IQ22(x)	\
5259     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ22) & M_FW_RSS_IND_TBL_CMD_IQ22)
5260 
5261 #define S_FW_RSS_IND_TBL_CMD_IQ23	0
5262 #define M_FW_RSS_IND_TBL_CMD_IQ23	0x3ff
5263 #define V_FW_RSS_IND_TBL_CMD_IQ23(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ23)
5264 #define G_FW_RSS_IND_TBL_CMD_IQ23(x)	\
5265     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ23) & M_FW_RSS_IND_TBL_CMD_IQ23)
5266 
5267 #define S_FW_RSS_IND_TBL_CMD_IQ24	20
5268 #define M_FW_RSS_IND_TBL_CMD_IQ24	0x3ff
5269 #define V_FW_RSS_IND_TBL_CMD_IQ24(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ24)
5270 #define G_FW_RSS_IND_TBL_CMD_IQ24(x)	\
5271     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ24) & M_FW_RSS_IND_TBL_CMD_IQ24)
5272 
5273 #define S_FW_RSS_IND_TBL_CMD_IQ25	10
5274 #define M_FW_RSS_IND_TBL_CMD_IQ25	0x3ff
5275 #define V_FW_RSS_IND_TBL_CMD_IQ25(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ25)
5276 #define G_FW_RSS_IND_TBL_CMD_IQ25(x)	\
5277     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ25) & M_FW_RSS_IND_TBL_CMD_IQ25)
5278 
5279 #define S_FW_RSS_IND_TBL_CMD_IQ26	0
5280 #define M_FW_RSS_IND_TBL_CMD_IQ26	0x3ff
5281 #define V_FW_RSS_IND_TBL_CMD_IQ26(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ26)
5282 #define G_FW_RSS_IND_TBL_CMD_IQ26(x)	\
5283     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ26) & M_FW_RSS_IND_TBL_CMD_IQ26)
5284 
5285 #define S_FW_RSS_IND_TBL_CMD_IQ27	20
5286 #define M_FW_RSS_IND_TBL_CMD_IQ27	0x3ff
5287 #define V_FW_RSS_IND_TBL_CMD_IQ27(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ27)
5288 #define G_FW_RSS_IND_TBL_CMD_IQ27(x)	\
5289     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ27) & M_FW_RSS_IND_TBL_CMD_IQ27)
5290 
5291 #define S_FW_RSS_IND_TBL_CMD_IQ28	10
5292 #define M_FW_RSS_IND_TBL_CMD_IQ28	0x3ff
5293 #define V_FW_RSS_IND_TBL_CMD_IQ28(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ28)
5294 #define G_FW_RSS_IND_TBL_CMD_IQ28(x)	\
5295     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ28) & M_FW_RSS_IND_TBL_CMD_IQ28)
5296 
5297 #define S_FW_RSS_IND_TBL_CMD_IQ29	0
5298 #define M_FW_RSS_IND_TBL_CMD_IQ29	0x3ff
5299 #define V_FW_RSS_IND_TBL_CMD_IQ29(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ29)
5300 #define G_FW_RSS_IND_TBL_CMD_IQ29(x)	\
5301     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ29) & M_FW_RSS_IND_TBL_CMD_IQ29)
5302 
5303 #define S_FW_RSS_IND_TBL_CMD_IQ30	20
5304 #define M_FW_RSS_IND_TBL_CMD_IQ30	0x3ff
5305 #define V_FW_RSS_IND_TBL_CMD_IQ30(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ30)
5306 #define G_FW_RSS_IND_TBL_CMD_IQ30(x)	\
5307     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ30) & M_FW_RSS_IND_TBL_CMD_IQ30)
5308 
5309 #define S_FW_RSS_IND_TBL_CMD_IQ31	10
5310 #define M_FW_RSS_IND_TBL_CMD_IQ31	0x3ff
5311 #define V_FW_RSS_IND_TBL_CMD_IQ31(x)	((x) << S_FW_RSS_IND_TBL_CMD_IQ31)
5312 #define G_FW_RSS_IND_TBL_CMD_IQ31(x)	\
5313     (((x) >> S_FW_RSS_IND_TBL_CMD_IQ31) & M_FW_RSS_IND_TBL_CMD_IQ31)
5314 
5315 struct fw_rss_glb_config_cmd {
5316 	__be32 op_to_write;
5317 	__be32 retval_len16;
5318 	union fw_rss_glb_config {
5319 		struct fw_rss_glb_config_manual {
5320 			__be32 mode_pkd;
5321 			__be32 r3;
5322 			__be64 r4;
5323 			__be64 r5;
5324 		} manual;
5325 		struct fw_rss_glb_config_basicvirtual {
5326 			__be32 mode_pkd;
5327 			__be32 synmapen_to_hashtoeplitz;
5328 			__be64 r8;
5329 			__be64 r9;
5330 		} basicvirtual;
5331 	} u;
5332 };
5333 
5334 #define S_FW_RSS_GLB_CONFIG_CMD_MODE	28
5335 #define M_FW_RSS_GLB_CONFIG_CMD_MODE	0xf
5336 #define V_FW_RSS_GLB_CONFIG_CMD_MODE(x)	((x) << S_FW_RSS_GLB_CONFIG_CMD_MODE)
5337 #define G_FW_RSS_GLB_CONFIG_CMD_MODE(x)	\
5338     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_MODE) & M_FW_RSS_GLB_CONFIG_CMD_MODE)
5339 
5340 #define FW_RSS_GLB_CONFIG_CMD_MODE_MANUAL	0
5341 #define FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL	1
5342 #define FW_RSS_GLB_CONFIG_CMD_MODE_MAX		1
5343 
5344 #define S_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN	8
5345 #define M_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN	0x1
5346 #define V_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN(x)	\
5347     ((x) << S_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN)
5348 #define G_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN(x)	\
5349     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN) & \
5350      M_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN)
5351 #define F_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN	\
5352     V_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN(1U)
5353 
5354 #define S_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6		7
5355 #define M_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6		0x1
5356 #define V_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6(x)	\
5357     ((x) << S_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6)
5358 #define G_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6(x)	\
5359     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6) & \
5360      M_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6)
5361 #define F_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6	\
5362     V_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6(1U)
5363 
5364 #define S_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6		6
5365 #define M_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6		0x1
5366 #define V_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6(x)	\
5367     ((x) << S_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6)
5368 #define G_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6(x)	\
5369     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6) & \
5370      M_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6)
5371 #define F_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6	\
5372     V_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6(1U)
5373 
5374 #define S_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4		5
5375 #define M_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4		0x1
5376 #define V_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4(x)	\
5377     ((x) << S_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4)
5378 #define G_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4(x)	\
5379     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4) & \
5380      M_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4)
5381 #define F_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4	\
5382     V_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4(1U)
5383 
5384 #define S_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4		4
5385 #define M_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4		0x1
5386 #define V_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4(x)	\
5387     ((x) << S_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4)
5388 #define G_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4(x)	\
5389     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4) & \
5390      M_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4)
5391 #define F_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4	\
5392     V_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4(1U)
5393 
5394 #define S_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN	3
5395 #define M_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN	0x1
5396 #define V_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN(x)	\
5397     ((x) << S_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN)
5398 #define G_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN(x)	\
5399     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN) & \
5400      M_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN)
5401 #define F_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN	\
5402     V_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN(1U)
5403 
5404 #define S_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN	2
5405 #define M_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN	0x1
5406 #define V_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN(x)	\
5407     ((x) << S_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN)
5408 #define G_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN(x)	\
5409     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN) & \
5410      M_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN)
5411 #define F_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN	\
5412     V_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN(1U)
5413 
5414 #define S_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP	1
5415 #define M_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP	0x1
5416 #define V_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP(x)	\
5417     ((x) << S_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP)
5418 #define G_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP(x)	\
5419     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP) & \
5420      M_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP)
5421 #define F_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP	\
5422     V_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP(1U)
5423 
5424 #define S_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ	0
5425 #define M_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ	0x1
5426 #define V_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ(x)	\
5427     ((x) << S_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ)
5428 #define G_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ(x)	\
5429     (((x) >> S_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ) & \
5430      M_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ)
5431 #define F_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ	\
5432     V_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ(1U)
5433 
5434 struct fw_rss_vi_config_cmd {
5435 	__be32 op_to_viid;
5436 	__be32 retval_len16;
5437 	union fw_rss_vi_config {
5438 		struct fw_rss_vi_config_manual {
5439 			__be64 r3;
5440 			__be64 r4;
5441 			__be64 r5;
5442 		} manual;
5443 		struct fw_rss_vi_config_basicvirtual {
5444 			__be32 r6;
5445 			__be32 defaultq_to_udpen;
5446 			__be64 r9;
5447 			__be64 r10;
5448 		} basicvirtual;
5449 	} u;
5450 };
5451 
5452 #define S_FW_RSS_VI_CONFIG_CMD_VIID	0
5453 #define M_FW_RSS_VI_CONFIG_CMD_VIID	0xfff
5454 #define V_FW_RSS_VI_CONFIG_CMD_VIID(x)	((x) << S_FW_RSS_VI_CONFIG_CMD_VIID)
5455 #define G_FW_RSS_VI_CONFIG_CMD_VIID(x)	\
5456     (((x) >> S_FW_RSS_VI_CONFIG_CMD_VIID) & M_FW_RSS_VI_CONFIG_CMD_VIID)
5457 
5458 #define S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ		16
5459 #define M_FW_RSS_VI_CONFIG_CMD_DEFAULTQ		0x3ff
5460 #define V_FW_RSS_VI_CONFIG_CMD_DEFAULTQ(x)	\
5461     ((x) << S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ)
5462 #define G_FW_RSS_VI_CONFIG_CMD_DEFAULTQ(x)	\
5463     (((x) >> S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ) & \
5464      M_FW_RSS_VI_CONFIG_CMD_DEFAULTQ)
5465 
5466 #define S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN	4
5467 #define M_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN	0x1
5468 #define V_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(x)	\
5469     ((x) << S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN)
5470 #define G_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(x)	\
5471     (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN) & \
5472      M_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN)
5473 #define F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN	\
5474     V_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(1U)
5475 
5476 #define S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN	3
5477 #define M_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN	0x1
5478 #define V_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(x)	\
5479     ((x) << S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN)
5480 #define G_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(x)	\
5481     (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN) & \
5482      M_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN)
5483 #define F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN	\
5484     V_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(1U)
5485 
5486 #define S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN	2
5487 #define M_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN	0x1
5488 #define V_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(x)	\
5489     ((x) << S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN)
5490 #define G_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(x)	\
5491     (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN) & \
5492      M_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN)
5493 #define F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN	\
5494     V_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(1U)
5495 
5496 #define S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN	1
5497 #define M_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN	0x1
5498 #define V_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(x)	\
5499     ((x) << S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN)
5500 #define G_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(x)	\
5501     (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN) & \
5502      M_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN)
5503 #define F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN	\
5504     V_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(1U)
5505 
5506 #define S_FW_RSS_VI_CONFIG_CMD_UDPEN	0
5507 #define M_FW_RSS_VI_CONFIG_CMD_UDPEN	0x1
5508 #define V_FW_RSS_VI_CONFIG_CMD_UDPEN(x)	((x) << S_FW_RSS_VI_CONFIG_CMD_UDPEN)
5509 #define G_FW_RSS_VI_CONFIG_CMD_UDPEN(x)	\
5510     (((x) >> S_FW_RSS_VI_CONFIG_CMD_UDPEN) & M_FW_RSS_VI_CONFIG_CMD_UDPEN)
5511 #define F_FW_RSS_VI_CONFIG_CMD_UDPEN	V_FW_RSS_VI_CONFIG_CMD_UDPEN(1U)
5512 
5513 enum fw_sched_sc {
5514 	FW_SCHED_SC_CONFIG		= 0,
5515 	FW_SCHED_SC_PARAMS		= 1,
5516 };
5517 
5518 enum fw_sched_type {
5519 	FW_SCHED_TYPE_PKTSCHED	        = 0,
5520 	FW_SCHED_TYPE_STREAMSCHED       = 1,
5521 };
5522 
5523 enum fw_sched_params_level {
5524 	FW_SCHED_PARAMS_LEVEL_CL_RL	= 0,
5525 	FW_SCHED_PARAMS_LEVEL_CL_WRR	= 1,
5526 	FW_SCHED_PARAMS_LEVEL_CH_RL	= 2,
5527 	FW_SCHED_PARAMS_LEVEL_CH_WRR	= 3,
5528 };
5529 
5530 enum fw_sched_params_mode {
5531 	FW_SCHED_PARAMS_MODE_CLASS	= 0,
5532 	FW_SCHED_PARAMS_MODE_FLOW	= 1,
5533 };
5534 
5535 enum fw_sched_params_unit {
5536 	FW_SCHED_PARAMS_UNIT_BITRATE	= 0,
5537 	FW_SCHED_PARAMS_UNIT_PKTRATE	= 1,
5538 };
5539 
5540 enum fw_sched_params_rate {
5541 	FW_SCHED_PARAMS_RATE_REL	= 0,
5542 	FW_SCHED_PARAMS_RATE_ABS	= 1,
5543 };
5544 
5545 struct fw_sched_cmd {
5546 	__be32 op_to_write;
5547 	__be32 retval_len16;
5548 	union fw_sched {
5549 		struct fw_sched_config {
5550 			__u8   sc;
5551 			__u8   type;
5552 			__u8   minmaxen;
5553 			__u8   r3[5];
5554 		} config;
5555 		struct fw_sched_params {
5556 			__u8   sc;
5557 			__u8   type;
5558 			__u8   level;
5559 			__u8   mode;
5560 			__u8   unit;
5561 			__u8   rate;
5562 			__u8   ch;
5563 			__u8   cl;
5564 			__be32 min;
5565 			__be32 max;
5566 			__be16 weight;
5567 			__be16 pktsize;
5568 			__be32 r4;
5569 		} params;
5570 	} u;
5571 };
5572 
5573 /*
5574  *	length of the formatting string
5575  */
5576 #define FW_DEVLOG_FMT_LEN	192
5577 
5578 /*
5579  *	maximum number of the formatting string parameters
5580  */
5581 #define FW_DEVLOG_FMT_PARAMS_NUM 8
5582 
5583 /*
5584  *	priority levels
5585  */
5586 enum fw_devlog_level {
5587 	FW_DEVLOG_LEVEL_EMERG	= 0x0,
5588 	FW_DEVLOG_LEVEL_CRIT	= 0x1,
5589 	FW_DEVLOG_LEVEL_ERR	= 0x2,
5590 	FW_DEVLOG_LEVEL_NOTICE	= 0x3,
5591 	FW_DEVLOG_LEVEL_INFO	= 0x4,
5592 	FW_DEVLOG_LEVEL_DEBUG	= 0x5,
5593 	FW_DEVLOG_LEVEL_MAX	= 0x5,
5594 };
5595 
5596 /*
5597  *	facilities that may send a log message
5598  */
5599 enum fw_devlog_facility {
5600 	FW_DEVLOG_FACILITY_CORE		= 0x00,
5601 	FW_DEVLOG_FACILITY_SCHED	= 0x02,
5602 	FW_DEVLOG_FACILITY_TIMER	= 0x04,
5603 	FW_DEVLOG_FACILITY_RES		= 0x06,
5604 	FW_DEVLOG_FACILITY_HW		= 0x08,
5605 	FW_DEVLOG_FACILITY_FLR		= 0x10,
5606 	FW_DEVLOG_FACILITY_DMAQ		= 0x12,
5607 	FW_DEVLOG_FACILITY_PHY		= 0x14,
5608 	FW_DEVLOG_FACILITY_MAC		= 0x16,
5609 	FW_DEVLOG_FACILITY_PORT		= 0x18,
5610 	FW_DEVLOG_FACILITY_VI		= 0x1A,
5611 	FW_DEVLOG_FACILITY_FILTER	= 0x1C,
5612 	FW_DEVLOG_FACILITY_ACL		= 0x1E,
5613 	FW_DEVLOG_FACILITY_TM		= 0x20,
5614 	FW_DEVLOG_FACILITY_QFC		= 0x22,
5615 	FW_DEVLOG_FACILITY_DCB		= 0x24,
5616 	FW_DEVLOG_FACILITY_ETH		= 0x26,
5617 	FW_DEVLOG_FACILITY_OFLD		= 0x28,
5618 	FW_DEVLOG_FACILITY_RI		= 0x2A,
5619 	FW_DEVLOG_FACILITY_ISCSI	= 0x2C,
5620 	FW_DEVLOG_FACILITY_FCOE		= 0x2E,
5621 	FW_DEVLOG_FACILITY_FOISCSI	= 0x30,
5622 	FW_DEVLOG_FACILITY_FOFCOE	= 0x32,
5623 	FW_DEVLOG_FACILITY_MAX		= 0x32,
5624 };
5625 
5626 /*
5627  *	log message format
5628  */
5629 struct fw_devlog_e {
5630 	__be64	timestamp;
5631 	__be32	seqno;
5632 	__be16	reserved1;
5633 	__u8	level;
5634 	__u8	facility;
5635 	__u8	fmt[FW_DEVLOG_FMT_LEN];
5636 	__be32	params[FW_DEVLOG_FMT_PARAMS_NUM];
5637 	__be32	reserved3[4];
5638 };
5639 
5640 struct fw_devlog_cmd {
5641 	__be32 op_to_write;
5642 	__be32 retval_len16;
5643 	__u8   level;
5644 	__u8   r2[7];
5645 	__be32 memtype_devlog_memaddr16_devlog;
5646 	__be32 memsize_devlog;
5647 	__be32 r3[2];
5648 };
5649 
5650 #define S_FW_DEVLOG_CMD_MEMTYPE_DEVLOG		28
5651 #define M_FW_DEVLOG_CMD_MEMTYPE_DEVLOG		0xf
5652 #define V_FW_DEVLOG_CMD_MEMTYPE_DEVLOG(x)	\
5653     ((x) << S_FW_DEVLOG_CMD_MEMTYPE_DEVLOG)
5654 #define G_FW_DEVLOG_CMD_MEMTYPE_DEVLOG(x)	\
5655     (((x) >> S_FW_DEVLOG_CMD_MEMTYPE_DEVLOG) & M_FW_DEVLOG_CMD_MEMTYPE_DEVLOG)
5656 
5657 #define S_FW_DEVLOG_CMD_MEMADDR16_DEVLOG	0
5658 #define M_FW_DEVLOG_CMD_MEMADDR16_DEVLOG	0xfffffff
5659 #define V_FW_DEVLOG_CMD_MEMADDR16_DEVLOG(x)	\
5660     ((x) << S_FW_DEVLOG_CMD_MEMADDR16_DEVLOG)
5661 #define G_FW_DEVLOG_CMD_MEMADDR16_DEVLOG(x)	\
5662     (((x) >> S_FW_DEVLOG_CMD_MEMADDR16_DEVLOG) & \
5663      M_FW_DEVLOG_CMD_MEMADDR16_DEVLOG)
5664 
5665 struct fw_netif_cmd {
5666 	__be32 op_to_ipv4gw;
5667 	__be32 retval_len16;
5668 	__be32 netifi_ifadridx;
5669 	__be32 portid_to_mtuval;
5670 	__be32 gwaddr;
5671 	__be32 addr;
5672 	__be32 nmask;
5673 	__be32 bcaddr;
5674 };
5675 
5676 #define S_FW_NETIF_CMD_ADD	20
5677 #define M_FW_NETIF_CMD_ADD	0x1
5678 #define V_FW_NETIF_CMD_ADD(x)	((x) << S_FW_NETIF_CMD_ADD)
5679 #define G_FW_NETIF_CMD_ADD(x)	\
5680     (((x) >> S_FW_NETIF_CMD_ADD) & M_FW_NETIF_CMD_ADD)
5681 #define F_FW_NETIF_CMD_ADD	V_FW_NETIF_CMD_ADD(1U)
5682 
5683 #define S_FW_NETIF_CMD_LINK	19
5684 #define M_FW_NETIF_CMD_LINK	0x1
5685 #define V_FW_NETIF_CMD_LINK(x)	((x) << S_FW_NETIF_CMD_LINK)
5686 #define G_FW_NETIF_CMD_LINK(x)	\
5687     (((x) >> S_FW_NETIF_CMD_LINK) & M_FW_NETIF_CMD_LINK)
5688 #define F_FW_NETIF_CMD_LINK	V_FW_NETIF_CMD_LINK(1U)
5689 
5690 #define S_FW_NETIF_CMD_VLAN	18
5691 #define M_FW_NETIF_CMD_VLAN	0x1
5692 #define V_FW_NETIF_CMD_VLAN(x)	((x) << S_FW_NETIF_CMD_VLAN)
5693 #define G_FW_NETIF_CMD_VLAN(x)	\
5694     (((x) >> S_FW_NETIF_CMD_VLAN) & M_FW_NETIF_CMD_VLAN)
5695 #define F_FW_NETIF_CMD_VLAN	V_FW_NETIF_CMD_VLAN(1U)
5696 
5697 #define S_FW_NETIF_CMD_MTU	17
5698 #define M_FW_NETIF_CMD_MTU	0x1
5699 #define V_FW_NETIF_CMD_MTU(x)	((x) << S_FW_NETIF_CMD_MTU)
5700 #define G_FW_NETIF_CMD_MTU(x)	\
5701     (((x) >> S_FW_NETIF_CMD_MTU) & M_FW_NETIF_CMD_MTU)
5702 #define F_FW_NETIF_CMD_MTU	V_FW_NETIF_CMD_MTU(1U)
5703 
5704 #define S_FW_NETIF_CMD_DHCP	16
5705 #define M_FW_NETIF_CMD_DHCP	0x1
5706 #define V_FW_NETIF_CMD_DHCP(x)	((x) << S_FW_NETIF_CMD_DHCP)
5707 #define G_FW_NETIF_CMD_DHCP(x)	\
5708     (((x) >> S_FW_NETIF_CMD_DHCP) & M_FW_NETIF_CMD_DHCP)
5709 #define F_FW_NETIF_CMD_DHCP	V_FW_NETIF_CMD_DHCP(1U)
5710 
5711 #define S_FW_NETIF_CMD_IPV4BCADDR	15
5712 #define M_FW_NETIF_CMD_IPV4BCADDR	0x1
5713 #define V_FW_NETIF_CMD_IPV4BCADDR(x)	((x) << S_FW_NETIF_CMD_IPV4BCADDR)
5714 #define G_FW_NETIF_CMD_IPV4BCADDR(x)	\
5715     (((x) >> S_FW_NETIF_CMD_IPV4BCADDR) & M_FW_NETIF_CMD_IPV4BCADDR)
5716 #define F_FW_NETIF_CMD_IPV4BCADDR	V_FW_NETIF_CMD_IPV4BCADDR(1U)
5717 
5718 #define S_FW_NETIF_CMD_IPV4NMASK	14
5719 #define M_FW_NETIF_CMD_IPV4NMASK	0x1
5720 #define V_FW_NETIF_CMD_IPV4NMASK(x)	((x) << S_FW_NETIF_CMD_IPV4NMASK)
5721 #define G_FW_NETIF_CMD_IPV4NMASK(x)	\
5722     (((x) >> S_FW_NETIF_CMD_IPV4NMASK) & M_FW_NETIF_CMD_IPV4NMASK)
5723 #define F_FW_NETIF_CMD_IPV4NMASK	V_FW_NETIF_CMD_IPV4NMASK(1U)
5724 
5725 #define S_FW_NETIF_CMD_IPV4ADDR		13
5726 #define M_FW_NETIF_CMD_IPV4ADDR		0x1
5727 #define V_FW_NETIF_CMD_IPV4ADDR(x)	((x) << S_FW_NETIF_CMD_IPV4ADDR)
5728 #define G_FW_NETIF_CMD_IPV4ADDR(x)	\
5729     (((x) >> S_FW_NETIF_CMD_IPV4ADDR) & M_FW_NETIF_CMD_IPV4ADDR)
5730 #define F_FW_NETIF_CMD_IPV4ADDR	V_FW_NETIF_CMD_IPV4ADDR(1U)
5731 
5732 #define S_FW_NETIF_CMD_IPV4GW		12
5733 #define M_FW_NETIF_CMD_IPV4GW		0x1
5734 #define V_FW_NETIF_CMD_IPV4GW(x)	((x) << S_FW_NETIF_CMD_IPV4GW)
5735 #define G_FW_NETIF_CMD_IPV4GW(x)	\
5736     (((x) >> S_FW_NETIF_CMD_IPV4GW) & M_FW_NETIF_CMD_IPV4GW)
5737 #define F_FW_NETIF_CMD_IPV4GW	V_FW_NETIF_CMD_IPV4GW(1U)
5738 
5739 #define S_FW_NETIF_CMD_NETIFI		8
5740 #define M_FW_NETIF_CMD_NETIFI		0xffffff
5741 #define V_FW_NETIF_CMD_NETIFI(x)	((x) << S_FW_NETIF_CMD_NETIFI)
5742 #define G_FW_NETIF_CMD_NETIFI(x)	\
5743     (((x) >> S_FW_NETIF_CMD_NETIFI) & M_FW_NETIF_CMD_NETIFI)
5744 
5745 #define S_FW_NETIF_CMD_IFADRIDX		0
5746 #define M_FW_NETIF_CMD_IFADRIDX		0xff
5747 #define V_FW_NETIF_CMD_IFADRIDX(x)	((x) << S_FW_NETIF_CMD_IFADRIDX)
5748 #define G_FW_NETIF_CMD_IFADRIDX(x)	\
5749     (((x) >> S_FW_NETIF_CMD_IFADRIDX) & M_FW_NETIF_CMD_IFADRIDX)
5750 
5751 #define S_FW_NETIF_CMD_PORTID		28
5752 #define M_FW_NETIF_CMD_PORTID		0xf
5753 #define V_FW_NETIF_CMD_PORTID(x)	((x) << S_FW_NETIF_CMD_PORTID)
5754 #define G_FW_NETIF_CMD_PORTID(x)	\
5755     (((x) >> S_FW_NETIF_CMD_PORTID) & M_FW_NETIF_CMD_PORTID)
5756 
5757 #define S_FW_NETIF_CMD_VLANID		16
5758 #define M_FW_NETIF_CMD_VLANID		0xfff
5759 #define V_FW_NETIF_CMD_VLANID(x)	((x) << S_FW_NETIF_CMD_VLANID)
5760 #define G_FW_NETIF_CMD_VLANID(x)	\
5761     (((x) >> S_FW_NETIF_CMD_VLANID) & M_FW_NETIF_CMD_VLANID)
5762 
5763 #define S_FW_NETIF_CMD_MTUVAL		0
5764 #define M_FW_NETIF_CMD_MTUVAL		0xffff
5765 #define V_FW_NETIF_CMD_MTUVAL(x)	((x) << S_FW_NETIF_CMD_MTUVAL)
5766 #define G_FW_NETIF_CMD_MTUVAL(x)	\
5767     (((x) >> S_FW_NETIF_CMD_MTUVAL) & M_FW_NETIF_CMD_MTUVAL)
5768 
5769 enum fw_watchdog_actions {
5770 	FW_WATCHDOG_ACTION_FLR = 0x1,
5771 	FW_WATCHDOG_ACTION_BYPASS = 0x2,
5772 };
5773 
5774 #define FW_WATCHDOG_MAX_TIMEOUT_SECS	60
5775 
5776 struct fw_watchdog_cmd {
5777 	__be32 op_to_write;
5778 	__be32 retval_len16;
5779 	__be32 timeout;
5780 	__be32 actions;
5781 };
5782 
5783 struct fw_clip_cmd {
5784 	__be32 op_to_write;
5785 	__be32 alloc_to_len16;
5786 	__be64 ip_hi;
5787 	__be64 ip_lo;
5788 	__be32 r4[2];
5789 };
5790 
5791 #define S_FW_CLIP_CMD_ALLOC	31
5792 #define M_FW_CLIP_CMD_ALLOC	0x1
5793 #define V_FW_CLIP_CMD_ALLOC(x)	((x) << S_FW_CLIP_CMD_ALLOC)
5794 #define G_FW_CLIP_CMD_ALLOC(x)	\
5795     (((x) >> S_FW_CLIP_CMD_ALLOC) & M_FW_CLIP_CMD_ALLOC)
5796 #define F_FW_CLIP_CMD_ALLOC	V_FW_CLIP_CMD_ALLOC(1U)
5797 
5798 #define S_FW_CLIP_CMD_FREE	30
5799 #define M_FW_CLIP_CMD_FREE	0x1
5800 #define V_FW_CLIP_CMD_FREE(x)	((x) << S_FW_CLIP_CMD_FREE)
5801 #define G_FW_CLIP_CMD_FREE(x)	\
5802     (((x) >> S_FW_CLIP_CMD_FREE) & M_FW_CLIP_CMD_FREE)
5803 #define F_FW_CLIP_CMD_FREE	V_FW_CLIP_CMD_FREE(1U)
5804 
5805 enum fw_error_type {
5806 	FW_ERROR_TYPE_EXCEPTION		= 0x0,
5807 	FW_ERROR_TYPE_HWMODULE		= 0x1,
5808 	FW_ERROR_TYPE_WR		= 0x2,
5809 	FW_ERROR_TYPE_ACL		= 0x3,
5810 };
5811 
5812 struct fw_error_cmd {
5813 	__be32 op_to_type;
5814 	__be32 len16_pkd;
5815 	union fw_error {
5816 		struct fw_error_exception {
5817 			__be32 info[6];
5818 		} exception;
5819 		struct fw_error_hwmodule {
5820 			__be32 regaddr;
5821 			__be32 regval;
5822 		} hwmodule;
5823 		struct fw_error_wr {
5824 			__be16 cidx;
5825 			__be16 pfn_vfn;
5826 			__be32 eqid;
5827 			__u8   wrhdr[16];
5828 		} wr;
5829 		struct fw_error_acl {
5830 			__be16 cidx;
5831 			__be16 pfn_vfn;
5832 			__be32 eqid;
5833 			__be16 mv_pkd;
5834 			__u8   val[6];
5835 			__be64 r4;
5836 		} acl;
5837 	} u;
5838 };
5839 
5840 #define S_FW_ERROR_CMD_FATAL	4
5841 #define M_FW_ERROR_CMD_FATAL	0x1
5842 #define V_FW_ERROR_CMD_FATAL(x)	((x) << S_FW_ERROR_CMD_FATAL)
5843 #define G_FW_ERROR_CMD_FATAL(x)	\
5844     (((x) >> S_FW_ERROR_CMD_FATAL) & M_FW_ERROR_CMD_FATAL)
5845 #define F_FW_ERROR_CMD_FATAL	V_FW_ERROR_CMD_FATAL(1U)
5846 
5847 #define S_FW_ERROR_CMD_TYPE	0
5848 #define M_FW_ERROR_CMD_TYPE	0xf
5849 #define V_FW_ERROR_CMD_TYPE(x)	((x) << S_FW_ERROR_CMD_TYPE)
5850 #define G_FW_ERROR_CMD_TYPE(x)	\
5851     (((x) >> S_FW_ERROR_CMD_TYPE) & M_FW_ERROR_CMD_TYPE)
5852 
5853 #define S_FW_ERROR_CMD_PFN	8
5854 #define M_FW_ERROR_CMD_PFN	0x7
5855 #define V_FW_ERROR_CMD_PFN(x)	((x) << S_FW_ERROR_CMD_PFN)
5856 #define G_FW_ERROR_CMD_PFN(x)	\
5857     (((x) >> S_FW_ERROR_CMD_PFN) & M_FW_ERROR_CMD_PFN)
5858 
5859 #define S_FW_ERROR_CMD_VFN	0
5860 #define M_FW_ERROR_CMD_VFN	0xff
5861 #define V_FW_ERROR_CMD_VFN(x)	((x) << S_FW_ERROR_CMD_VFN)
5862 #define G_FW_ERROR_CMD_VFN(x)	\
5863     (((x) >> S_FW_ERROR_CMD_VFN) & M_FW_ERROR_CMD_VFN)
5864 
5865 #define S_FW_ERROR_CMD_PFN	8
5866 #define M_FW_ERROR_CMD_PFN	0x7
5867 #define V_FW_ERROR_CMD_PFN(x)	((x) << S_FW_ERROR_CMD_PFN)
5868 #define G_FW_ERROR_CMD_PFN(x)	\
5869     (((x) >> S_FW_ERROR_CMD_PFN) & M_FW_ERROR_CMD_PFN)
5870 
5871 #define S_FW_ERROR_CMD_VFN	0
5872 #define M_FW_ERROR_CMD_VFN	0xff
5873 #define V_FW_ERROR_CMD_VFN(x)	((x) << S_FW_ERROR_CMD_VFN)
5874 #define G_FW_ERROR_CMD_VFN(x)	\
5875     (((x) >> S_FW_ERROR_CMD_VFN) & M_FW_ERROR_CMD_VFN)
5876 
5877 #define S_FW_ERROR_CMD_MV	15
5878 #define M_FW_ERROR_CMD_MV	0x1
5879 #define V_FW_ERROR_CMD_MV(x)	((x) << S_FW_ERROR_CMD_MV)
5880 #define G_FW_ERROR_CMD_MV(x)	\
5881     (((x) >> S_FW_ERROR_CMD_MV) & M_FW_ERROR_CMD_MV)
5882 #define F_FW_ERROR_CMD_MV	V_FW_ERROR_CMD_MV(1U)
5883 
5884 struct fw_debug_cmd {
5885 	__be32 op_type;
5886 	__be32 len16_pkd;
5887 	union fw_debug {
5888 		struct fw_debug_assert {
5889 			__be32 fcid;
5890 			__be32 line;
5891 			__be32 x;
5892 			__be32 y;
5893 			__u8   filename_0_7[8];
5894 			__u8   filename_8_15[8];
5895 			__be64 r3;
5896 		} assert;
5897 		struct fw_debug_prt {
5898 			__be16 dprtstridx;
5899 			__be16 r3[3];
5900 			__be32 dprtstrparam0;
5901 			__be32 dprtstrparam1;
5902 			__be32 dprtstrparam2;
5903 			__be32 dprtstrparam3;
5904 		} prt;
5905 	} u;
5906 };
5907 
5908 #define S_FW_DEBUG_CMD_TYPE	0
5909 #define M_FW_DEBUG_CMD_TYPE	0xff
5910 #define V_FW_DEBUG_CMD_TYPE(x)	((x) << S_FW_DEBUG_CMD_TYPE)
5911 #define G_FW_DEBUG_CMD_TYPE(x)	\
5912     (((x) >> S_FW_DEBUG_CMD_TYPE) & M_FW_DEBUG_CMD_TYPE)
5913 
5914 
5915 /******************************************************************************
5916  *   P C I E   F W   R E G I S T E R
5917  **************************************/
5918 
5919 /**
5920  *	Register definitions for the PCIE_FW register which the firmware uses
5921  *	to retain status across RESETs.  This register should be considered
5922  *	as a READ-ONLY register for Host Software and only to be used to
5923  *	track firmware initialization/error state, etc.
5924  */
5925 #define S_PCIE_FW_ERR		31
5926 #define M_PCIE_FW_ERR		0x1
5927 #define V_PCIE_FW_ERR(x)	((x) << S_PCIE_FW_ERR)
5928 #define G_PCIE_FW_ERR(x)	(((x) >> S_PCIE_FW_ERR) & M_PCIE_FW_ERR)
5929 #define F_PCIE_FW_ERR		V_PCIE_FW_ERR(1U)
5930 
5931 #define S_PCIE_FW_INIT		30
5932 #define M_PCIE_FW_INIT		0x1
5933 #define V_PCIE_FW_INIT(x)	((x) << S_PCIE_FW_INIT)
5934 #define G_PCIE_FW_INIT(x)	(((x) >> S_PCIE_FW_INIT) & M_PCIE_FW_INIT)
5935 #define F_PCIE_FW_INIT		V_PCIE_FW_INIT(1U)
5936 
5937 #define S_PCIE_FW_HALT          29
5938 #define M_PCIE_FW_HALT          0x1
5939 #define V_PCIE_FW_HALT(x)       ((x) << S_PCIE_FW_HALT)
5940 #define G_PCIE_FW_HALT(x)       (((x) >> S_PCIE_FW_HALT) & M_PCIE_FW_HALT)
5941 #define F_PCIE_FW_HALT          V_PCIE_FW_HALT(1U)
5942 
5943 #define S_PCIE_FW_STAGE		21
5944 #define M_PCIE_FW_STAGE		0x7
5945 #define V_PCIE_FW_STAGE(x)	((x) << S_PCIE_FW_STAGE)
5946 #define G_PCIE_FW_STAGE(x)	(((x) >> S_PCIE_FW_STAGE) & M_PCIE_FW_STAGE)
5947 
5948 #define S_PCIE_FW_ASYNCNOT_VLD	20
5949 #define M_PCIE_FW_ASYNCNOT_VLD	0x1
5950 #define V_PCIE_FW_ASYNCNOT_VLD(x) \
5951     ((x) << S_PCIE_FW_ASYNCNOT_VLD)
5952 #define G_PCIE_FW_ASYNCNOT_VLD(x) \
5953     (((x) >> S_PCIE_FW_ASYNCNOT_VLD) & M_PCIE_FW_ASYNCNOT_VLD)
5954 #define F_PCIE_FW_ASYNCNOT_VLD	V_PCIE_FW_ASYNCNOT_VLD(1U)
5955 
5956 #define S_PCIE_FW_ASYNCNOTINT	19
5957 #define M_PCIE_FW_ASYNCNOTINT	0x1
5958 #define V_PCIE_FW_ASYNCNOTINT(x) \
5959     ((x) << S_PCIE_FW_ASYNCNOTINT)
5960 #define G_PCIE_FW_ASYNCNOTINT(x) \
5961     (((x) >> S_PCIE_FW_ASYNCNOTINT) & M_PCIE_FW_ASYNCNOTINT)
5962 #define F_PCIE_FW_ASYNCNOTINT	V_PCIE_FW_ASYNCNOTINT(1U)
5963 
5964 #define S_PCIE_FW_ASYNCNOT	16
5965 #define M_PCIE_FW_ASYNCNOT	0x7
5966 #define V_PCIE_FW_ASYNCNOT(x)	((x) << S_PCIE_FW_ASYNCNOT)
5967 #define G_PCIE_FW_ASYNCNOT(x)	\
5968     (((x) >> S_PCIE_FW_ASYNCNOT) & M_PCIE_FW_ASYNCNOT)
5969 
5970 #define S_PCIE_FW_MASTER_VLD	15
5971 #define M_PCIE_FW_MASTER_VLD	0x1
5972 #define V_PCIE_FW_MASTER_VLD(x)	((x) << S_PCIE_FW_MASTER_VLD)
5973 #define G_PCIE_FW_MASTER_VLD(x)	\
5974     (((x) >> S_PCIE_FW_MASTER_VLD) & M_PCIE_FW_MASTER_VLD)
5975 #define F_PCIE_FW_MASTER_VLD	V_PCIE_FW_MASTER_VLD(1U)
5976 
5977 #define S_PCIE_FW_MASTER	12
5978 #define M_PCIE_FW_MASTER	0x7
5979 #define V_PCIE_FW_MASTER(x)	((x) << S_PCIE_FW_MASTER)
5980 #define G_PCIE_FW_MASTER(x)	(((x) >> S_PCIE_FW_MASTER) & M_PCIE_FW_MASTER)
5981 
5982 #define S_PCIE_FW_RESET_VLD		11
5983 #define M_PCIE_FW_RESET_VLD		0x1
5984 #define V_PCIE_FW_RESET_VLD(x)	((x) << S_PCIE_FW_RESET_VLD)
5985 #define G_PCIE_FW_RESET_VLD(x)	\
5986     (((x) >> S_PCIE_FW_RESET_VLD) & M_PCIE_FW_RESET_VLD)
5987 #define F_PCIE_FW_RESET_VLD	V_PCIE_FW_RESET_VLD(1U)
5988 
5989 #define S_PCIE_FW_RESET		8
5990 #define M_PCIE_FW_RESET		0x7
5991 #define V_PCIE_FW_RESET(x)	((x) << S_PCIE_FW_RESET)
5992 #define G_PCIE_FW_RESET(x)	\
5993     (((x) >> S_PCIE_FW_RESET) & M_PCIE_FW_RESET)
5994 
5995 #define S_PCIE_FW_REGISTERED	0
5996 #define M_PCIE_FW_REGISTERED	0xff
5997 #define V_PCIE_FW_REGISTERED(x)	((x) << S_PCIE_FW_REGISTERED)
5998 #define G_PCIE_FW_REGISTERED(x)	\
5999     (((x) >> S_PCIE_FW_REGISTERED) & M_PCIE_FW_REGISTERED)
6000 
6001 
6002 /******************************************************************************
6003  *   B I N A R Y   H E A D E R   F O R M A T
6004  **********************************************/
6005 
6006 /*
6007  *	firmware binary header format
6008  */
6009 struct fw_hdr {
6010 	__u8	ver;
6011 	__u8	chip;			/* terminator chip family */
6012 	__be16	len512;			/* bin length in units of 512-bytes */
6013 	__be32	fw_ver;			/* firmware version */
6014 	__be32	tp_microcode_ver;	/* tcp processor microcode version */
6015 	__u8	intfver_nic;
6016 	__u8	intfver_vnic;
6017 	__u8	intfver_ofld;
6018 	__u8	intfver_ri;
6019 	__u8	intfver_iscsipdu;
6020 	__u8	intfver_iscsi;
6021 	__u8	intfver_fcoe;
6022 	__u8	reserved2;
6023 	__u32	reserved3;
6024 	__u32	reserved4;
6025 	__u32	reserved5;
6026 	__be32	flags;
6027 	__be32	reserved6[23];
6028 };
6029 
6030 enum fw_hdr_chip {
6031 	FW_HDR_CHIP_T4,
6032 	FW_HDR_CHIP_T5
6033 };
6034 
6035 #define S_FW_HDR_FW_VER_MAJOR	24
6036 #define M_FW_HDR_FW_VER_MAJOR	0xff
6037 #define V_FW_HDR_FW_VER_MAJOR(x) \
6038     ((x) << S_FW_HDR_FW_VER_MAJOR)
6039 #define G_FW_HDR_FW_VER_MAJOR(x) \
6040     (((x) >> S_FW_HDR_FW_VER_MAJOR) & M_FW_HDR_FW_VER_MAJOR)
6041 
6042 #define S_FW_HDR_FW_VER_MINOR	16
6043 #define M_FW_HDR_FW_VER_MINOR	0xff
6044 #define V_FW_HDR_FW_VER_MINOR(x) \
6045     ((x) << S_FW_HDR_FW_VER_MINOR)
6046 #define G_FW_HDR_FW_VER_MINOR(x) \
6047     (((x) >> S_FW_HDR_FW_VER_MINOR) & M_FW_HDR_FW_VER_MINOR)
6048 
6049 #define S_FW_HDR_FW_VER_MICRO	8
6050 #define M_FW_HDR_FW_VER_MICRO	0xff
6051 #define V_FW_HDR_FW_VER_MICRO(x) \
6052     ((x) << S_FW_HDR_FW_VER_MICRO)
6053 #define G_FW_HDR_FW_VER_MICRO(x) \
6054     (((x) >> S_FW_HDR_FW_VER_MICRO) & M_FW_HDR_FW_VER_MICRO)
6055 
6056 #define S_FW_HDR_FW_VER_BUILD	0
6057 #define M_FW_HDR_FW_VER_BUILD	0xff
6058 #define V_FW_HDR_FW_VER_BUILD(x) \
6059     ((x) << S_FW_HDR_FW_VER_BUILD)
6060 #define G_FW_HDR_FW_VER_BUILD(x) \
6061     (((x) >> S_FW_HDR_FW_VER_BUILD) & M_FW_HDR_FW_VER_BUILD)
6062 
6063 enum fw_hdr_intfver {
6064 	FW_HDR_INTFVER_NIC	= 0x00,
6065 	FW_HDR_INTFVER_VNIC	= 0x00,
6066 	FW_HDR_INTFVER_OFLD	= 0x00,
6067 	FW_HDR_INTFVER_RI	= 0x00,
6068 	FW_HDR_INTFVER_ISCSIPDU	= 0x00,
6069 	FW_HDR_INTFVER_ISCSI	= 0x00,
6070 	FW_HDR_INTFVER_FCOE	= 0x00,
6071 };
6072 
6073 enum fw_hdr_flags {
6074 	FW_HDR_FLAGS_RESET_HALT	= 0x00000001,
6075 };
6076 
6077 #endif /* _T4FW_INTERFACE_H_ */
6078