4 * Copyright(c) 2014-2017 Chelsio Communications.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Chelsio Communications nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef _T4FW_INTERFACE_H_
35 #define _T4FW_INTERFACE_H_
37 /******************************************************************************
38 * R E T U R N V A L U E S
39 ********************************/
42 FW_SUCCESS = 0, /* completed successfully */
43 FW_EPERM = 1, /* operation not permitted */
44 FW_ENOENT = 2, /* no such file or directory */
45 FW_EIO = 5, /* input/output error; hw bad */
46 FW_ENOEXEC = 8, /* exec format error; inv microcode */
47 FW_EAGAIN = 11, /* try again */
48 FW_ENOMEM = 12, /* out of memory */
49 FW_EFAULT = 14, /* bad address; fw bad */
50 FW_EBUSY = 16, /* resource busy */
51 FW_EEXIST = 17, /* file exists */
52 FW_ENODEV = 19, /* no such device */
53 FW_EINVAL = 22, /* invalid argument */
54 FW_ENOSPC = 28, /* no space left on device */
55 FW_ENOSYS = 38, /* functionality not implemented */
56 FW_ENODATA = 61, /* no data available */
57 FW_EPROTO = 71, /* protocol error */
58 FW_EADDRINUSE = 98, /* address already in use */
59 FW_EADDRNOTAVAIL = 99, /* cannot assigned requested address */
60 FW_ENETDOWN = 100, /* network is down */
61 FW_ENETUNREACH = 101, /* network is unreachable */
62 FW_ENOBUFS = 105, /* no buffer space available */
63 FW_ETIMEDOUT = 110, /* timeout */
64 FW_EINPROGRESS = 115, /* fw internal */
67 /******************************************************************************
68 * M E M O R Y T Y P E s
69 ******************************/
72 FW_MEMTYPE_EDC0 = 0x0,
73 FW_MEMTYPE_EDC1 = 0x1,
74 FW_MEMTYPE_EXTMEM = 0x2,
75 FW_MEMTYPE_FLASH = 0x4,
76 FW_MEMTYPE_INTERNAL = 0x5,
77 FW_MEMTYPE_EXTMEM1 = 0x6,
80 /******************************************************************************
81 * W O R K R E Q U E S T s
82 ********************************/
85 FW_ETH_TX_PKT_WR = 0x08,
86 FW_ETH_TX_PKTS_WR = 0x09,
87 FW_ETH_TX_PKTS2_WR = 0x78,
91 * Generic work request header flit0
98 /* work request opcode (hi)
100 #define S_FW_WR_OP 24
101 #define M_FW_WR_OP 0xff
102 #define V_FW_WR_OP(x) ((x) << S_FW_WR_OP)
103 #define G_FW_WR_OP(x) (((x) >> S_FW_WR_OP) & M_FW_WR_OP)
105 /* work request immediate data length (hi)
107 #define S_FW_WR_IMMDLEN 0
108 #define M_FW_WR_IMMDLEN 0xff
109 #define V_FW_WR_IMMDLEN(x) ((x) << S_FW_WR_IMMDLEN)
110 #define G_FW_WR_IMMDLEN(x) \
111 (((x) >> S_FW_WR_IMMDLEN) & M_FW_WR_IMMDLEN)
113 /* egress queue status update to egress queue status entry (lo)
115 #define S_FW_WR_EQUEQ 30
116 #define M_FW_WR_EQUEQ 0x1
117 #define V_FW_WR_EQUEQ(x) ((x) << S_FW_WR_EQUEQ)
118 #define G_FW_WR_EQUEQ(x) (((x) >> S_FW_WR_EQUEQ) & M_FW_WR_EQUEQ)
119 #define F_FW_WR_EQUEQ V_FW_WR_EQUEQ(1U)
121 /* length in units of 16-bytes (lo)
123 #define S_FW_WR_LEN16 0
124 #define M_FW_WR_LEN16 0xff
125 #define V_FW_WR_LEN16(x) ((x) << S_FW_WR_LEN16)
126 #define G_FW_WR_LEN16(x) (((x) >> S_FW_WR_LEN16) & M_FW_WR_LEN16)
128 struct fw_eth_tx_pkt_wr {
130 __be32 equiq_to_len16;
134 #define S_FW_ETH_TX_PKT_WR_IMMDLEN 0
135 #define M_FW_ETH_TX_PKT_WR_IMMDLEN 0x1ff
136 #define V_FW_ETH_TX_PKT_WR_IMMDLEN(x) ((x) << S_FW_ETH_TX_PKT_WR_IMMDLEN)
137 #define G_FW_ETH_TX_PKT_WR_IMMDLEN(x) \
138 (((x) >> S_FW_ETH_TX_PKT_WR_IMMDLEN) & M_FW_ETH_TX_PKT_WR_IMMDLEN)
140 struct fw_eth_tx_pkts_wr {
142 __be32 equiq_to_len16;
149 /******************************************************************************
151 *********************/
154 * The maximum length of time, in miliseconds, that we expect any firmware
155 * command to take to execute and return a reply to the host. The RESET
156 * and INITIALIZE commands can take a fair amount of time to execute but
157 * most execute in far less time than this maximum. This constant is used
158 * by host software to determine how long to wait for a firmware command
159 * reply before declaring the firmware as dead/unreachable ...
161 #define FW_CMD_MAX_TIMEOUT 10000
164 * If a host driver does a HELLO and discovers that there's already a MASTER
165 * selected, we may have to wait for that MASTER to finish issuing RESET,
166 * configuration and INITIALIZE commands. Also, there's a possibility that
167 * our own HELLO may get lost if it happens right as the MASTER is issuign a
168 * RESET command, so we need to be willing to make a few retries of our HELLO.
170 #define FW_CMD_HELLO_TIMEOUT (3 * FW_CMD_MAX_TIMEOUT)
171 #define FW_CMD_HELLO_RETRIES 3
173 enum fw_cmd_opcodes {
177 FW_INITIALIZE_CMD = 0x06,
178 FW_CAPS_CONFIG_CMD = 0x07,
179 FW_PARAMS_CMD = 0x08,
181 FW_EQ_ETH_CMD = 0x12,
183 FW_VI_MAC_CMD = 0x15,
184 FW_VI_RXMODE_CMD = 0x16,
185 FW_VI_ENABLE_CMD = 0x17,
187 FW_RSS_IND_TBL_CMD = 0x20,
188 FW_RSS_VI_CONFIG_CMD = 0x23,
193 * Generic command header flit0
200 #define S_FW_CMD_OP 24
201 #define M_FW_CMD_OP 0xff
202 #define V_FW_CMD_OP(x) ((x) << S_FW_CMD_OP)
203 #define G_FW_CMD_OP(x) (((x) >> S_FW_CMD_OP) & M_FW_CMD_OP)
205 #define S_FW_CMD_REQUEST 23
206 #define M_FW_CMD_REQUEST 0x1
207 #define V_FW_CMD_REQUEST(x) ((x) << S_FW_CMD_REQUEST)
208 #define G_FW_CMD_REQUEST(x) (((x) >> S_FW_CMD_REQUEST) & M_FW_CMD_REQUEST)
209 #define F_FW_CMD_REQUEST V_FW_CMD_REQUEST(1U)
211 #define S_FW_CMD_READ 22
212 #define M_FW_CMD_READ 0x1
213 #define V_FW_CMD_READ(x) ((x) << S_FW_CMD_READ)
214 #define G_FW_CMD_READ(x) (((x) >> S_FW_CMD_READ) & M_FW_CMD_READ)
215 #define F_FW_CMD_READ V_FW_CMD_READ(1U)
217 #define S_FW_CMD_WRITE 21
218 #define M_FW_CMD_WRITE 0x1
219 #define V_FW_CMD_WRITE(x) ((x) << S_FW_CMD_WRITE)
220 #define G_FW_CMD_WRITE(x) (((x) >> S_FW_CMD_WRITE) & M_FW_CMD_WRITE)
221 #define F_FW_CMD_WRITE V_FW_CMD_WRITE(1U)
223 #define S_FW_CMD_EXEC 20
224 #define M_FW_CMD_EXEC 0x1
225 #define V_FW_CMD_EXEC(x) ((x) << S_FW_CMD_EXEC)
226 #define G_FW_CMD_EXEC(x) (((x) >> S_FW_CMD_EXEC) & M_FW_CMD_EXEC)
227 #define F_FW_CMD_EXEC V_FW_CMD_EXEC(1U)
229 #define S_FW_CMD_RETVAL 8
230 #define M_FW_CMD_RETVAL 0xff
231 #define V_FW_CMD_RETVAL(x) ((x) << S_FW_CMD_RETVAL)
232 #define G_FW_CMD_RETVAL(x) (((x) >> S_FW_CMD_RETVAL) & M_FW_CMD_RETVAL)
234 #define S_FW_CMD_LEN16 0
235 #define M_FW_CMD_LEN16 0xff
236 #define V_FW_CMD_LEN16(x) ((x) << S_FW_CMD_LEN16)
237 #define G_FW_CMD_LEN16(x) (((x) >> S_FW_CMD_LEN16) & M_FW_CMD_LEN16)
239 #define FW_LEN16(fw_struct) V_FW_CMD_LEN16(sizeof(fw_struct) / 16)
241 struct fw_reset_cmd {
248 #define S_FW_RESET_CMD_HALT 31
249 #define M_FW_RESET_CMD_HALT 0x1
250 #define V_FW_RESET_CMD_HALT(x) ((x) << S_FW_RESET_CMD_HALT)
251 #define G_FW_RESET_CMD_HALT(x) \
252 (((x) >> S_FW_RESET_CMD_HALT) & M_FW_RESET_CMD_HALT)
253 #define F_FW_RESET_CMD_HALT V_FW_RESET_CMD_HALT(1U)
256 FW_HELLO_CMD_STAGE_OS = 0,
259 struct fw_hello_cmd {
262 __be32 err_to_clearinit;
266 #define S_FW_HELLO_CMD_ERR 31
267 #define M_FW_HELLO_CMD_ERR 0x1
268 #define V_FW_HELLO_CMD_ERR(x) ((x) << S_FW_HELLO_CMD_ERR)
269 #define G_FW_HELLO_CMD_ERR(x) \
270 (((x) >> S_FW_HELLO_CMD_ERR) & M_FW_HELLO_CMD_ERR)
271 #define F_FW_HELLO_CMD_ERR V_FW_HELLO_CMD_ERR(1U)
273 #define S_FW_HELLO_CMD_INIT 30
274 #define M_FW_HELLO_CMD_INIT 0x1
275 #define V_FW_HELLO_CMD_INIT(x) ((x) << S_FW_HELLO_CMD_INIT)
276 #define G_FW_HELLO_CMD_INIT(x) \
277 (((x) >> S_FW_HELLO_CMD_INIT) & M_FW_HELLO_CMD_INIT)
278 #define F_FW_HELLO_CMD_INIT V_FW_HELLO_CMD_INIT(1U)
280 #define S_FW_HELLO_CMD_MASTERDIS 29
281 #define M_FW_HELLO_CMD_MASTERDIS 0x1
282 #define V_FW_HELLO_CMD_MASTERDIS(x) ((x) << S_FW_HELLO_CMD_MASTERDIS)
283 #define G_FW_HELLO_CMD_MASTERDIS(x) \
284 (((x) >> S_FW_HELLO_CMD_MASTERDIS) & M_FW_HELLO_CMD_MASTERDIS)
285 #define F_FW_HELLO_CMD_MASTERDIS V_FW_HELLO_CMD_MASTERDIS(1U)
287 #define S_FW_HELLO_CMD_MASTERFORCE 28
288 #define M_FW_HELLO_CMD_MASTERFORCE 0x1
289 #define V_FW_HELLO_CMD_MASTERFORCE(x) ((x) << S_FW_HELLO_CMD_MASTERFORCE)
290 #define G_FW_HELLO_CMD_MASTERFORCE(x) \
291 (((x) >> S_FW_HELLO_CMD_MASTERFORCE) & M_FW_HELLO_CMD_MASTERFORCE)
292 #define F_FW_HELLO_CMD_MASTERFORCE V_FW_HELLO_CMD_MASTERFORCE(1U)
294 #define S_FW_HELLO_CMD_MBMASTER 24
295 #define M_FW_HELLO_CMD_MBMASTER 0xf
296 #define V_FW_HELLO_CMD_MBMASTER(x) ((x) << S_FW_HELLO_CMD_MBMASTER)
297 #define G_FW_HELLO_CMD_MBMASTER(x) \
298 (((x) >> S_FW_HELLO_CMD_MBMASTER) & M_FW_HELLO_CMD_MBMASTER)
300 #define S_FW_HELLO_CMD_MBASYNCNOT 20
301 #define M_FW_HELLO_CMD_MBASYNCNOT 0x7
302 #define V_FW_HELLO_CMD_MBASYNCNOT(x) ((x) << S_FW_HELLO_CMD_MBASYNCNOT)
303 #define G_FW_HELLO_CMD_MBASYNCNOT(x) \
304 (((x) >> S_FW_HELLO_CMD_MBASYNCNOT) & M_FW_HELLO_CMD_MBASYNCNOT)
306 #define S_FW_HELLO_CMD_STAGE 17
307 #define M_FW_HELLO_CMD_STAGE 0x7
308 #define V_FW_HELLO_CMD_STAGE(x) ((x) << S_FW_HELLO_CMD_STAGE)
309 #define G_FW_HELLO_CMD_STAGE(x) \
310 (((x) >> S_FW_HELLO_CMD_STAGE) & M_FW_HELLO_CMD_STAGE)
312 #define S_FW_HELLO_CMD_CLEARINIT 16
313 #define M_FW_HELLO_CMD_CLEARINIT 0x1
314 #define V_FW_HELLO_CMD_CLEARINIT(x) ((x) << S_FW_HELLO_CMD_CLEARINIT)
315 #define G_FW_HELLO_CMD_CLEARINIT(x) \
316 (((x) >> S_FW_HELLO_CMD_CLEARINIT) & M_FW_HELLO_CMD_CLEARINIT)
317 #define F_FW_HELLO_CMD_CLEARINIT V_FW_HELLO_CMD_CLEARINIT(1U)
325 struct fw_initialize_cmd {
331 enum fw_caps_config_nic {
332 FW_CAPS_CONFIG_NIC_HASHFILTER = 0x00000020,
333 FW_CAPS_CONFIG_NIC_ETHOFLD = 0x00000040,
337 FW_MEMTYPE_CF_FLASH = FW_MEMTYPE_FLASH,
340 struct fw_caps_config_cmd {
342 __be32 cfvalid_to_len16;
360 #define S_FW_CAPS_CONFIG_CMD_CFVALID 27
361 #define M_FW_CAPS_CONFIG_CMD_CFVALID 0x1
362 #define V_FW_CAPS_CONFIG_CMD_CFVALID(x) ((x) << S_FW_CAPS_CONFIG_CMD_CFVALID)
363 #define G_FW_CAPS_CONFIG_CMD_CFVALID(x) \
364 (((x) >> S_FW_CAPS_CONFIG_CMD_CFVALID) & M_FW_CAPS_CONFIG_CMD_CFVALID)
365 #define F_FW_CAPS_CONFIG_CMD_CFVALID V_FW_CAPS_CONFIG_CMD_CFVALID(1U)
367 #define S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF 24
368 #define M_FW_CAPS_CONFIG_CMD_MEMTYPE_CF 0x7
369 #define V_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(x) \
370 ((x) << S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF)
371 #define G_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(x) \
372 (((x) >> S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF) & \
373 M_FW_CAPS_CONFIG_CMD_MEMTYPE_CF)
375 #define S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF 16
376 #define M_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF 0xff
377 #define V_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(x) \
378 ((x) << S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF)
379 #define G_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(x) \
380 (((x) >> S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF) & \
381 M_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF)
384 * params command mnemonics
386 enum fw_params_mnem {
387 FW_PARAMS_MNEM_DEV = 1, /* device params */
388 FW_PARAMS_MNEM_PFVF = 2, /* function params */
389 FW_PARAMS_MNEM_DMAQ = 4, /* dma queue params */
395 enum fw_params_param_dev {
396 FW_PARAMS_PARAM_DEV_CCLK = 0x00, /* chip core clock in khz */
397 FW_PARAMS_PARAM_DEV_PORTVEC = 0x01, /* the port vector */
398 FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
402 * physical and virtual function parameters
404 enum fw_params_param_pfvf {
405 FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31
409 * dma queue parameters
411 enum fw_params_param_dmaq {
412 FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01,
413 FW_PARAMS_PARAM_DMAQ_CONM_CTXT = 0x20,
416 #define S_FW_PARAMS_MNEM 24
417 #define M_FW_PARAMS_MNEM 0xff
418 #define V_FW_PARAMS_MNEM(x) ((x) << S_FW_PARAMS_MNEM)
419 #define G_FW_PARAMS_MNEM(x) \
420 (((x) >> S_FW_PARAMS_MNEM) & M_FW_PARAMS_MNEM)
422 #define S_FW_PARAMS_PARAM_X 16
423 #define M_FW_PARAMS_PARAM_X 0xff
424 #define V_FW_PARAMS_PARAM_X(x) ((x) << S_FW_PARAMS_PARAM_X)
425 #define G_FW_PARAMS_PARAM_X(x) \
426 (((x) >> S_FW_PARAMS_PARAM_X) & M_FW_PARAMS_PARAM_X)
428 #define S_FW_PARAMS_PARAM_Y 8
429 #define M_FW_PARAMS_PARAM_Y 0xff
430 #define V_FW_PARAMS_PARAM_Y(x) ((x) << S_FW_PARAMS_PARAM_Y)
431 #define G_FW_PARAMS_PARAM_Y(x) \
432 (((x) >> S_FW_PARAMS_PARAM_Y) & M_FW_PARAMS_PARAM_Y)
434 #define S_FW_PARAMS_PARAM_Z 0
435 #define M_FW_PARAMS_PARAM_Z 0xff
436 #define V_FW_PARAMS_PARAM_Z(x) ((x) << S_FW_PARAMS_PARAM_Z)
437 #define G_FW_PARAMS_PARAM_Z(x) \
438 (((x) >> S_FW_PARAMS_PARAM_Z) & M_FW_PARAMS_PARAM_Z)
440 #define S_FW_PARAMS_PARAM_YZ 0
441 #define M_FW_PARAMS_PARAM_YZ 0xffff
442 #define V_FW_PARAMS_PARAM_YZ(x) ((x) << S_FW_PARAMS_PARAM_YZ)
443 #define G_FW_PARAMS_PARAM_YZ(x) \
444 (((x) >> S_FW_PARAMS_PARAM_YZ) & M_FW_PARAMS_PARAM_YZ)
446 struct fw_params_cmd {
449 struct fw_params_param {
455 #define S_FW_PARAMS_CMD_PFN 8
456 #define M_FW_PARAMS_CMD_PFN 0x7
457 #define V_FW_PARAMS_CMD_PFN(x) ((x) << S_FW_PARAMS_CMD_PFN)
458 #define G_FW_PARAMS_CMD_PFN(x) \
459 (((x) >> S_FW_PARAMS_CMD_PFN) & M_FW_PARAMS_CMD_PFN)
461 #define S_FW_PARAMS_CMD_VFN 0
462 #define M_FW_PARAMS_CMD_VFN 0xff
463 #define V_FW_PARAMS_CMD_VFN(x) ((x) << S_FW_PARAMS_CMD_VFN)
464 #define G_FW_PARAMS_CMD_VFN(x) \
465 (((x) >> S_FW_PARAMS_CMD_VFN) & M_FW_PARAMS_CMD_VFN)
468 * ingress queue type; the first 1K ingress queues can have associated 0,
469 * 1 or 2 free lists and an interrupt, all other ingress queues lack these
473 FW_IQ_TYPE_FL_INT_CAP,
478 __be32 alloc_to_len16;
483 __be32 type_to_iqandstindex;
484 __be16 iqdroprss_to_iqesize;
487 __be32 iqns_to_fl0congen;
488 __be16 fl0dcaen_to_fl0cidxfthresh;
491 __be32 fl1cngchmap_to_fl1congen;
492 __be16 fl1dcaen_to_fl1cidxfthresh;
497 #define S_FW_IQ_CMD_PFN 8
498 #define M_FW_IQ_CMD_PFN 0x7
499 #define V_FW_IQ_CMD_PFN(x) ((x) << S_FW_IQ_CMD_PFN)
500 #define G_FW_IQ_CMD_PFN(x) (((x) >> S_FW_IQ_CMD_PFN) & M_FW_IQ_CMD_PFN)
502 #define S_FW_IQ_CMD_VFN 0
503 #define M_FW_IQ_CMD_VFN 0xff
504 #define V_FW_IQ_CMD_VFN(x) ((x) << S_FW_IQ_CMD_VFN)
505 #define G_FW_IQ_CMD_VFN(x) (((x) >> S_FW_IQ_CMD_VFN) & M_FW_IQ_CMD_VFN)
507 #define S_FW_IQ_CMD_ALLOC 31
508 #define M_FW_IQ_CMD_ALLOC 0x1
509 #define V_FW_IQ_CMD_ALLOC(x) ((x) << S_FW_IQ_CMD_ALLOC)
510 #define G_FW_IQ_CMD_ALLOC(x) \
511 (((x) >> S_FW_IQ_CMD_ALLOC) & M_FW_IQ_CMD_ALLOC)
512 #define F_FW_IQ_CMD_ALLOC V_FW_IQ_CMD_ALLOC(1U)
514 #define S_FW_IQ_CMD_FREE 30
515 #define M_FW_IQ_CMD_FREE 0x1
516 #define V_FW_IQ_CMD_FREE(x) ((x) << S_FW_IQ_CMD_FREE)
517 #define G_FW_IQ_CMD_FREE(x) (((x) >> S_FW_IQ_CMD_FREE) & M_FW_IQ_CMD_FREE)
518 #define F_FW_IQ_CMD_FREE V_FW_IQ_CMD_FREE(1U)
520 #define S_FW_IQ_CMD_IQSTART 28
521 #define M_FW_IQ_CMD_IQSTART 0x1
522 #define V_FW_IQ_CMD_IQSTART(x) ((x) << S_FW_IQ_CMD_IQSTART)
523 #define G_FW_IQ_CMD_IQSTART(x) \
524 (((x) >> S_FW_IQ_CMD_IQSTART) & M_FW_IQ_CMD_IQSTART)
525 #define F_FW_IQ_CMD_IQSTART V_FW_IQ_CMD_IQSTART(1U)
527 #define S_FW_IQ_CMD_IQSTOP 27
528 #define M_FW_IQ_CMD_IQSTOP 0x1
529 #define V_FW_IQ_CMD_IQSTOP(x) ((x) << S_FW_IQ_CMD_IQSTOP)
530 #define G_FW_IQ_CMD_IQSTOP(x) \
531 (((x) >> S_FW_IQ_CMD_IQSTOP) & M_FW_IQ_CMD_IQSTOP)
532 #define F_FW_IQ_CMD_IQSTOP V_FW_IQ_CMD_IQSTOP(1U)
534 #define S_FW_IQ_CMD_TYPE 29
535 #define M_FW_IQ_CMD_TYPE 0x7
536 #define V_FW_IQ_CMD_TYPE(x) ((x) << S_FW_IQ_CMD_TYPE)
537 #define G_FW_IQ_CMD_TYPE(x) (((x) >> S_FW_IQ_CMD_TYPE) & M_FW_IQ_CMD_TYPE)
539 #define S_FW_IQ_CMD_IQASYNCH 28
540 #define M_FW_IQ_CMD_IQASYNCH 0x1
541 #define V_FW_IQ_CMD_IQASYNCH(x) ((x) << S_FW_IQ_CMD_IQASYNCH)
542 #define G_FW_IQ_CMD_IQASYNCH(x) \
543 (((x) >> S_FW_IQ_CMD_IQASYNCH) & M_FW_IQ_CMD_IQASYNCH)
544 #define F_FW_IQ_CMD_IQASYNCH V_FW_IQ_CMD_IQASYNCH(1U)
546 #define S_FW_IQ_CMD_VIID 16
547 #define M_FW_IQ_CMD_VIID 0xfff
548 #define V_FW_IQ_CMD_VIID(x) ((x) << S_FW_IQ_CMD_VIID)
549 #define G_FW_IQ_CMD_VIID(x) (((x) >> S_FW_IQ_CMD_VIID) & M_FW_IQ_CMD_VIID)
551 #define S_FW_IQ_CMD_IQANDST 15
552 #define M_FW_IQ_CMD_IQANDST 0x1
553 #define V_FW_IQ_CMD_IQANDST(x) ((x) << S_FW_IQ_CMD_IQANDST)
554 #define G_FW_IQ_CMD_IQANDST(x) \
555 (((x) >> S_FW_IQ_CMD_IQANDST) & M_FW_IQ_CMD_IQANDST)
556 #define F_FW_IQ_CMD_IQANDST V_FW_IQ_CMD_IQANDST(1U)
558 #define S_FW_IQ_CMD_IQANUD 12
559 #define M_FW_IQ_CMD_IQANUD 0x3
560 #define V_FW_IQ_CMD_IQANUD(x) ((x) << S_FW_IQ_CMD_IQANUD)
561 #define G_FW_IQ_CMD_IQANUD(x) \
562 (((x) >> S_FW_IQ_CMD_IQANUD) & M_FW_IQ_CMD_IQANUD)
564 #define S_FW_IQ_CMD_IQANDSTINDEX 0
565 #define M_FW_IQ_CMD_IQANDSTINDEX 0xfff
566 #define V_FW_IQ_CMD_IQANDSTINDEX(x) ((x) << S_FW_IQ_CMD_IQANDSTINDEX)
567 #define G_FW_IQ_CMD_IQANDSTINDEX(x) \
568 (((x) >> S_FW_IQ_CMD_IQANDSTINDEX) & M_FW_IQ_CMD_IQANDSTINDEX)
570 #define S_FW_IQ_CMD_IQGTSMODE 14
571 #define M_FW_IQ_CMD_IQGTSMODE 0x1
572 #define V_FW_IQ_CMD_IQGTSMODE(x) ((x) << S_FW_IQ_CMD_IQGTSMODE)
573 #define G_FW_IQ_CMD_IQGTSMODE(x) \
574 (((x) >> S_FW_IQ_CMD_IQGTSMODE) & M_FW_IQ_CMD_IQGTSMODE)
575 #define F_FW_IQ_CMD_IQGTSMODE V_FW_IQ_CMD_IQGTSMODE(1U)
577 #define S_FW_IQ_CMD_IQPCIECH 12
578 #define M_FW_IQ_CMD_IQPCIECH 0x3
579 #define V_FW_IQ_CMD_IQPCIECH(x) ((x) << S_FW_IQ_CMD_IQPCIECH)
580 #define G_FW_IQ_CMD_IQPCIECH(x) \
581 (((x) >> S_FW_IQ_CMD_IQPCIECH) & M_FW_IQ_CMD_IQPCIECH)
583 #define S_FW_IQ_CMD_IQINTCNTTHRESH 4
584 #define M_FW_IQ_CMD_IQINTCNTTHRESH 0x3
585 #define V_FW_IQ_CMD_IQINTCNTTHRESH(x) ((x) << S_FW_IQ_CMD_IQINTCNTTHRESH)
586 #define G_FW_IQ_CMD_IQINTCNTTHRESH(x) \
587 (((x) >> S_FW_IQ_CMD_IQINTCNTTHRESH) & M_FW_IQ_CMD_IQINTCNTTHRESH)
589 #define S_FW_IQ_CMD_IQESIZE 0
590 #define M_FW_IQ_CMD_IQESIZE 0x3
591 #define V_FW_IQ_CMD_IQESIZE(x) ((x) << S_FW_IQ_CMD_IQESIZE)
592 #define G_FW_IQ_CMD_IQESIZE(x) \
593 (((x) >> S_FW_IQ_CMD_IQESIZE) & M_FW_IQ_CMD_IQESIZE)
595 #define S_FW_IQ_CMD_IQRO 30
596 #define M_FW_IQ_CMD_IQRO 0x1
597 #define V_FW_IQ_CMD_IQRO(x) ((x) << S_FW_IQ_CMD_IQRO)
598 #define G_FW_IQ_CMD_IQRO(x) \
599 (((x) >> S_FW_IQ_CMD_IQRO) & M_FW_IQ_CMD_IQRO)
600 #define F_FW_IQ_CMD_IQRO V_FW_IQ_CMD_IQRO(1U)
602 #define S_FW_IQ_CMD_IQFLINTCONGEN 27
603 #define M_FW_IQ_CMD_IQFLINTCONGEN 0x1
604 #define V_FW_IQ_CMD_IQFLINTCONGEN(x) ((x) << S_FW_IQ_CMD_IQFLINTCONGEN)
605 #define G_FW_IQ_CMD_IQFLINTCONGEN(x) \
606 (((x) >> S_FW_IQ_CMD_IQFLINTCONGEN) & M_FW_IQ_CMD_IQFLINTCONGEN)
607 #define F_FW_IQ_CMD_IQFLINTCONGEN V_FW_IQ_CMD_IQFLINTCONGEN(1U)
609 #define S_FW_IQ_CMD_FL0CNGCHMAP 20
610 #define M_FW_IQ_CMD_FL0CNGCHMAP 0xf
611 #define V_FW_IQ_CMD_FL0CNGCHMAP(x) ((x) << S_FW_IQ_CMD_FL0CNGCHMAP)
612 #define G_FW_IQ_CMD_FL0CNGCHMAP(x) \
613 (((x) >> S_FW_IQ_CMD_FL0CNGCHMAP) & M_FW_IQ_CMD_FL0CNGCHMAP)
615 #define S_FW_IQ_CMD_FL0DATARO 12
616 #define M_FW_IQ_CMD_FL0DATARO 0x1
617 #define V_FW_IQ_CMD_FL0DATARO(x) ((x) << S_FW_IQ_CMD_FL0DATARO)
618 #define G_FW_IQ_CMD_FL0DATARO(x) \
619 (((x) >> S_FW_IQ_CMD_FL0DATARO) & M_FW_IQ_CMD_FL0DATARO)
620 #define F_FW_IQ_CMD_FL0DATARO V_FW_IQ_CMD_FL0DATARO(1U)
622 #define S_FW_IQ_CMD_FL0CONGCIF 11
623 #define M_FW_IQ_CMD_FL0CONGCIF 0x1
624 #define V_FW_IQ_CMD_FL0CONGCIF(x) ((x) << S_FW_IQ_CMD_FL0CONGCIF)
625 #define G_FW_IQ_CMD_FL0CONGCIF(x) \
626 (((x) >> S_FW_IQ_CMD_FL0CONGCIF) & M_FW_IQ_CMD_FL0CONGCIF)
627 #define F_FW_IQ_CMD_FL0CONGCIF V_FW_IQ_CMD_FL0CONGCIF(1U)
629 #define S_FW_IQ_CMD_FL0FETCHRO 6
630 #define M_FW_IQ_CMD_FL0FETCHRO 0x1
631 #define V_FW_IQ_CMD_FL0FETCHRO(x) ((x) << S_FW_IQ_CMD_FL0FETCHRO)
632 #define G_FW_IQ_CMD_FL0FETCHRO(x) \
633 (((x) >> S_FW_IQ_CMD_FL0FETCHRO) & M_FW_IQ_CMD_FL0FETCHRO)
634 #define F_FW_IQ_CMD_FL0FETCHRO V_FW_IQ_CMD_FL0FETCHRO(1U)
636 #define S_FW_IQ_CMD_FL0HOSTFCMODE 4
637 #define M_FW_IQ_CMD_FL0HOSTFCMODE 0x3
638 #define V_FW_IQ_CMD_FL0HOSTFCMODE(x) ((x) << S_FW_IQ_CMD_FL0HOSTFCMODE)
639 #define G_FW_IQ_CMD_FL0HOSTFCMODE(x) \
640 (((x) >> S_FW_IQ_CMD_FL0HOSTFCMODE) & M_FW_IQ_CMD_FL0HOSTFCMODE)
642 #define S_FW_IQ_CMD_FL0PADEN 2
643 #define M_FW_IQ_CMD_FL0PADEN 0x1
644 #define V_FW_IQ_CMD_FL0PADEN(x) ((x) << S_FW_IQ_CMD_FL0PADEN)
645 #define G_FW_IQ_CMD_FL0PADEN(x) \
646 (((x) >> S_FW_IQ_CMD_FL0PADEN) & M_FW_IQ_CMD_FL0PADEN)
647 #define F_FW_IQ_CMD_FL0PADEN V_FW_IQ_CMD_FL0PADEN(1U)
649 #define S_FW_IQ_CMD_FL0PACKEN 1
650 #define M_FW_IQ_CMD_FL0PACKEN 0x1
651 #define V_FW_IQ_CMD_FL0PACKEN(x) ((x) << S_FW_IQ_CMD_FL0PACKEN)
652 #define G_FW_IQ_CMD_FL0PACKEN(x) \
653 (((x) >> S_FW_IQ_CMD_FL0PACKEN) & M_FW_IQ_CMD_FL0PACKEN)
654 #define F_FW_IQ_CMD_FL0PACKEN V_FW_IQ_CMD_FL0PACKEN(1U)
656 #define S_FW_IQ_CMD_FL0CONGEN 0
657 #define M_FW_IQ_CMD_FL0CONGEN 0x1
658 #define V_FW_IQ_CMD_FL0CONGEN(x) ((x) << S_FW_IQ_CMD_FL0CONGEN)
659 #define G_FW_IQ_CMD_FL0CONGEN(x) \
660 (((x) >> S_FW_IQ_CMD_FL0CONGEN) & M_FW_IQ_CMD_FL0CONGEN)
661 #define F_FW_IQ_CMD_FL0CONGEN V_FW_IQ_CMD_FL0CONGEN(1U)
663 #define S_FW_IQ_CMD_FL0FBMIN 7
664 #define M_FW_IQ_CMD_FL0FBMIN 0x7
665 #define V_FW_IQ_CMD_FL0FBMIN(x) ((x) << S_FW_IQ_CMD_FL0FBMIN)
666 #define G_FW_IQ_CMD_FL0FBMIN(x) \
667 (((x) >> S_FW_IQ_CMD_FL0FBMIN) & M_FW_IQ_CMD_FL0FBMIN)
669 #define S_FW_IQ_CMD_FL0FBMAX 4
670 #define M_FW_IQ_CMD_FL0FBMAX 0x7
671 #define V_FW_IQ_CMD_FL0FBMAX(x) ((x) << S_FW_IQ_CMD_FL0FBMAX)
672 #define G_FW_IQ_CMD_FL0FBMAX(x) \
673 (((x) >> S_FW_IQ_CMD_FL0FBMAX) & M_FW_IQ_CMD_FL0FBMAX)
675 struct fw_eq_eth_cmd {
677 __be32 alloc_to_len16;
680 __be32 fetchszm_to_iqid;
681 __be32 dcaen_to_eqsize;
683 __be32 autoequiqe_to_viid;
688 #define S_FW_EQ_ETH_CMD_PFN 8
689 #define M_FW_EQ_ETH_CMD_PFN 0x7
690 #define V_FW_EQ_ETH_CMD_PFN(x) ((x) << S_FW_EQ_ETH_CMD_PFN)
691 #define G_FW_EQ_ETH_CMD_PFN(x) \
692 (((x) >> S_FW_EQ_ETH_CMD_PFN) & M_FW_EQ_ETH_CMD_PFN)
694 #define S_FW_EQ_ETH_CMD_VFN 0
695 #define M_FW_EQ_ETH_CMD_VFN 0xff
696 #define V_FW_EQ_ETH_CMD_VFN(x) ((x) << S_FW_EQ_ETH_CMD_VFN)
697 #define G_FW_EQ_ETH_CMD_VFN(x) \
698 (((x) >> S_FW_EQ_ETH_CMD_VFN) & M_FW_EQ_ETH_CMD_VFN)
700 #define S_FW_EQ_ETH_CMD_ALLOC 31
701 #define M_FW_EQ_ETH_CMD_ALLOC 0x1
702 #define V_FW_EQ_ETH_CMD_ALLOC(x) ((x) << S_FW_EQ_ETH_CMD_ALLOC)
703 #define G_FW_EQ_ETH_CMD_ALLOC(x) \
704 (((x) >> S_FW_EQ_ETH_CMD_ALLOC) & M_FW_EQ_ETH_CMD_ALLOC)
705 #define F_FW_EQ_ETH_CMD_ALLOC V_FW_EQ_ETH_CMD_ALLOC(1U)
707 #define S_FW_EQ_ETH_CMD_FREE 30
708 #define M_FW_EQ_ETH_CMD_FREE 0x1
709 #define V_FW_EQ_ETH_CMD_FREE(x) ((x) << S_FW_EQ_ETH_CMD_FREE)
710 #define G_FW_EQ_ETH_CMD_FREE(x) \
711 (((x) >> S_FW_EQ_ETH_CMD_FREE) & M_FW_EQ_ETH_CMD_FREE)
712 #define F_FW_EQ_ETH_CMD_FREE V_FW_EQ_ETH_CMD_FREE(1U)
714 #define S_FW_EQ_ETH_CMD_EQSTART 28
715 #define M_FW_EQ_ETH_CMD_EQSTART 0x1
716 #define V_FW_EQ_ETH_CMD_EQSTART(x) ((x) << S_FW_EQ_ETH_CMD_EQSTART)
717 #define G_FW_EQ_ETH_CMD_EQSTART(x) \
718 (((x) >> S_FW_EQ_ETH_CMD_EQSTART) & M_FW_EQ_ETH_CMD_EQSTART)
719 #define F_FW_EQ_ETH_CMD_EQSTART V_FW_EQ_ETH_CMD_EQSTART(1U)
721 #define S_FW_EQ_ETH_CMD_EQID 0
722 #define M_FW_EQ_ETH_CMD_EQID 0xfffff
723 #define V_FW_EQ_ETH_CMD_EQID(x) ((x) << S_FW_EQ_ETH_CMD_EQID)
724 #define G_FW_EQ_ETH_CMD_EQID(x) \
725 (((x) >> S_FW_EQ_ETH_CMD_EQID) & M_FW_EQ_ETH_CMD_EQID)
727 #define S_FW_EQ_ETH_CMD_FETCHRO 22
728 #define M_FW_EQ_ETH_CMD_FETCHRO 0x1
729 #define V_FW_EQ_ETH_CMD_FETCHRO(x) ((x) << S_FW_EQ_ETH_CMD_FETCHRO)
730 #define G_FW_EQ_ETH_CMD_FETCHRO(x) \
731 (((x) >> S_FW_EQ_ETH_CMD_FETCHRO) & M_FW_EQ_ETH_CMD_FETCHRO)
732 #define F_FW_EQ_ETH_CMD_FETCHRO V_FW_EQ_ETH_CMD_FETCHRO(1U)
734 #define S_FW_EQ_ETH_CMD_HOSTFCMODE 20
735 #define M_FW_EQ_ETH_CMD_HOSTFCMODE 0x3
736 #define V_FW_EQ_ETH_CMD_HOSTFCMODE(x) ((x) << S_FW_EQ_ETH_CMD_HOSTFCMODE)
737 #define G_FW_EQ_ETH_CMD_HOSTFCMODE(x) \
738 (((x) >> S_FW_EQ_ETH_CMD_HOSTFCMODE) & M_FW_EQ_ETH_CMD_HOSTFCMODE)
740 #define S_FW_EQ_ETH_CMD_PCIECHN 16
741 #define M_FW_EQ_ETH_CMD_PCIECHN 0x3
742 #define V_FW_EQ_ETH_CMD_PCIECHN(x) ((x) << S_FW_EQ_ETH_CMD_PCIECHN)
743 #define G_FW_EQ_ETH_CMD_PCIECHN(x) \
744 (((x) >> S_FW_EQ_ETH_CMD_PCIECHN) & M_FW_EQ_ETH_CMD_PCIECHN)
746 #define S_FW_EQ_ETH_CMD_IQID 0
747 #define M_FW_EQ_ETH_CMD_IQID 0xffff
748 #define V_FW_EQ_ETH_CMD_IQID(x) ((x) << S_FW_EQ_ETH_CMD_IQID)
749 #define G_FW_EQ_ETH_CMD_IQID(x) \
750 (((x) >> S_FW_EQ_ETH_CMD_IQID) & M_FW_EQ_ETH_CMD_IQID)
752 #define S_FW_EQ_ETH_CMD_FBMIN 23
753 #define M_FW_EQ_ETH_CMD_FBMIN 0x7
754 #define V_FW_EQ_ETH_CMD_FBMIN(x) ((x) << S_FW_EQ_ETH_CMD_FBMIN)
755 #define G_FW_EQ_ETH_CMD_FBMIN(x) \
756 (((x) >> S_FW_EQ_ETH_CMD_FBMIN) & M_FW_EQ_ETH_CMD_FBMIN)
758 #define S_FW_EQ_ETH_CMD_FBMAX 20
759 #define M_FW_EQ_ETH_CMD_FBMAX 0x7
760 #define V_FW_EQ_ETH_CMD_FBMAX(x) ((x) << S_FW_EQ_ETH_CMD_FBMAX)
761 #define G_FW_EQ_ETH_CMD_FBMAX(x) \
762 (((x) >> S_FW_EQ_ETH_CMD_FBMAX) & M_FW_EQ_ETH_CMD_FBMAX)
764 #define S_FW_EQ_ETH_CMD_CIDXFTHRESH 16
765 #define M_FW_EQ_ETH_CMD_CIDXFTHRESH 0x7
766 #define V_FW_EQ_ETH_CMD_CIDXFTHRESH(x) ((x) << S_FW_EQ_ETH_CMD_CIDXFTHRESH)
767 #define G_FW_EQ_ETH_CMD_CIDXFTHRESH(x) \
768 (((x) >> S_FW_EQ_ETH_CMD_CIDXFTHRESH) & M_FW_EQ_ETH_CMD_CIDXFTHRESH)
770 #define S_FW_EQ_ETH_CMD_EQSIZE 0
771 #define M_FW_EQ_ETH_CMD_EQSIZE 0xffff
772 #define V_FW_EQ_ETH_CMD_EQSIZE(x) ((x) << S_FW_EQ_ETH_CMD_EQSIZE)
773 #define G_FW_EQ_ETH_CMD_EQSIZE(x) \
774 (((x) >> S_FW_EQ_ETH_CMD_EQSIZE) & M_FW_EQ_ETH_CMD_EQSIZE)
776 #define S_FW_EQ_ETH_CMD_AUTOEQUEQE 30
777 #define M_FW_EQ_ETH_CMD_AUTOEQUEQE 0x1
778 #define V_FW_EQ_ETH_CMD_AUTOEQUEQE(x) ((x) << S_FW_EQ_ETH_CMD_AUTOEQUEQE)
779 #define G_FW_EQ_ETH_CMD_AUTOEQUEQE(x) \
780 (((x) >> S_FW_EQ_ETH_CMD_AUTOEQUEQE) & M_FW_EQ_ETH_CMD_AUTOEQUEQE)
781 #define F_FW_EQ_ETH_CMD_AUTOEQUEQE V_FW_EQ_ETH_CMD_AUTOEQUEQE(1U)
783 #define S_FW_EQ_ETH_CMD_VIID 16
784 #define M_FW_EQ_ETH_CMD_VIID 0xfff
785 #define V_FW_EQ_ETH_CMD_VIID(x) ((x) << S_FW_EQ_ETH_CMD_VIID)
786 #define G_FW_EQ_ETH_CMD_VIID(x) \
787 (((x) >> S_FW_EQ_ETH_CMD_VIID) & M_FW_EQ_ETH_CMD_VIID)
795 __be32 alloc_to_len16;
801 __be16 norss_rsssize;
811 #define S_FW_VI_CMD_PFN 8
812 #define M_FW_VI_CMD_PFN 0x7
813 #define V_FW_VI_CMD_PFN(x) ((x) << S_FW_VI_CMD_PFN)
814 #define G_FW_VI_CMD_PFN(x) (((x) >> S_FW_VI_CMD_PFN) & M_FW_VI_CMD_PFN)
816 #define S_FW_VI_CMD_VFN 0
817 #define M_FW_VI_CMD_VFN 0xff
818 #define V_FW_VI_CMD_VFN(x) ((x) << S_FW_VI_CMD_VFN)
819 #define G_FW_VI_CMD_VFN(x) (((x) >> S_FW_VI_CMD_VFN) & M_FW_VI_CMD_VFN)
821 #define S_FW_VI_CMD_ALLOC 31
822 #define M_FW_VI_CMD_ALLOC 0x1
823 #define V_FW_VI_CMD_ALLOC(x) ((x) << S_FW_VI_CMD_ALLOC)
824 #define G_FW_VI_CMD_ALLOC(x) \
825 (((x) >> S_FW_VI_CMD_ALLOC) & M_FW_VI_CMD_ALLOC)
826 #define F_FW_VI_CMD_ALLOC V_FW_VI_CMD_ALLOC(1U)
828 #define S_FW_VI_CMD_FREE 30
829 #define M_FW_VI_CMD_FREE 0x1
830 #define V_FW_VI_CMD_FREE(x) ((x) << S_FW_VI_CMD_FREE)
831 #define G_FW_VI_CMD_FREE(x) (((x) >> S_FW_VI_CMD_FREE) & M_FW_VI_CMD_FREE)
832 #define F_FW_VI_CMD_FREE V_FW_VI_CMD_FREE(1U)
834 #define S_FW_VI_CMD_TYPE 15
835 #define M_FW_VI_CMD_TYPE 0x1
836 #define V_FW_VI_CMD_TYPE(x) ((x) << S_FW_VI_CMD_TYPE)
837 #define G_FW_VI_CMD_TYPE(x) (((x) >> S_FW_VI_CMD_TYPE) & M_FW_VI_CMD_TYPE)
838 #define F_FW_VI_CMD_TYPE V_FW_VI_CMD_TYPE(1U)
840 #define S_FW_VI_CMD_FUNC 12
841 #define M_FW_VI_CMD_FUNC 0x7
842 #define V_FW_VI_CMD_FUNC(x) ((x) << S_FW_VI_CMD_FUNC)
843 #define G_FW_VI_CMD_FUNC(x) (((x) >> S_FW_VI_CMD_FUNC) & M_FW_VI_CMD_FUNC)
845 #define S_FW_VI_CMD_VIID 0
846 #define M_FW_VI_CMD_VIID 0xfff
847 #define V_FW_VI_CMD_VIID(x) ((x) << S_FW_VI_CMD_VIID)
848 #define G_FW_VI_CMD_VIID(x) (((x) >> S_FW_VI_CMD_VIID) & M_FW_VI_CMD_VIID)
850 #define S_FW_VI_CMD_PORTID 4
851 #define M_FW_VI_CMD_PORTID 0xf
852 #define V_FW_VI_CMD_PORTID(x) ((x) << S_FW_VI_CMD_PORTID)
853 #define G_FW_VI_CMD_PORTID(x) \
854 (((x) >> S_FW_VI_CMD_PORTID) & M_FW_VI_CMD_PORTID)
856 #define S_FW_VI_CMD_RSSSIZE 0
857 #define M_FW_VI_CMD_RSSSIZE 0x7ff
858 #define V_FW_VI_CMD_RSSSIZE(x) ((x) << S_FW_VI_CMD_RSSSIZE)
859 #define G_FW_VI_CMD_RSSSIZE(x) \
860 (((x) >> S_FW_VI_CMD_RSSSIZE) & M_FW_VI_CMD_RSSSIZE)
862 /* Special VI_MAC command index ids */
863 #define FW_VI_MAC_ADD_MAC 0x3FF
864 #define FW_VI_MAC_ADD_PERSIST_MAC 0x3FE
866 enum fw_vi_mac_smac {
867 FW_VI_MAC_MPS_TCAM_ENTRY,
868 FW_VI_MAC_SMT_AND_MPSTCAM
871 struct fw_vi_mac_cmd {
873 __be32 freemacs_to_len16;
875 struct fw_vi_mac_exact {
879 struct fw_vi_mac_hash {
885 #define S_FW_VI_MAC_CMD_VIID 0
886 #define M_FW_VI_MAC_CMD_VIID 0xfff
887 #define V_FW_VI_MAC_CMD_VIID(x) ((x) << S_FW_VI_MAC_CMD_VIID)
888 #define G_FW_VI_MAC_CMD_VIID(x) \
889 (((x) >> S_FW_VI_MAC_CMD_VIID) & M_FW_VI_MAC_CMD_VIID)
891 #define S_FW_VI_MAC_CMD_VALID 15
892 #define M_FW_VI_MAC_CMD_VALID 0x1
893 #define V_FW_VI_MAC_CMD_VALID(x) ((x) << S_FW_VI_MAC_CMD_VALID)
894 #define G_FW_VI_MAC_CMD_VALID(x) \
895 (((x) >> S_FW_VI_MAC_CMD_VALID) & M_FW_VI_MAC_CMD_VALID)
896 #define F_FW_VI_MAC_CMD_VALID V_FW_VI_MAC_CMD_VALID(1U)
898 #define S_FW_VI_MAC_CMD_SMAC_RESULT 10
899 #define M_FW_VI_MAC_CMD_SMAC_RESULT 0x3
900 #define V_FW_VI_MAC_CMD_SMAC_RESULT(x) ((x) << S_FW_VI_MAC_CMD_SMAC_RESULT)
901 #define G_FW_VI_MAC_CMD_SMAC_RESULT(x) \
902 (((x) >> S_FW_VI_MAC_CMD_SMAC_RESULT) & M_FW_VI_MAC_CMD_SMAC_RESULT)
904 #define S_FW_VI_MAC_CMD_IDX 0
905 #define M_FW_VI_MAC_CMD_IDX 0x3ff
906 #define V_FW_VI_MAC_CMD_IDX(x) ((x) << S_FW_VI_MAC_CMD_IDX)
907 #define G_FW_VI_MAC_CMD_IDX(x) \
908 (((x) >> S_FW_VI_MAC_CMD_IDX) & M_FW_VI_MAC_CMD_IDX)
910 struct fw_vi_rxmode_cmd {
913 __be32 mtu_to_vlanexen;
917 #define S_FW_VI_RXMODE_CMD_VIID 0
918 #define M_FW_VI_RXMODE_CMD_VIID 0xfff
919 #define V_FW_VI_RXMODE_CMD_VIID(x) ((x) << S_FW_VI_RXMODE_CMD_VIID)
920 #define G_FW_VI_RXMODE_CMD_VIID(x) \
921 (((x) >> S_FW_VI_RXMODE_CMD_VIID) & M_FW_VI_RXMODE_CMD_VIID)
923 #define S_FW_VI_RXMODE_CMD_MTU 16
924 #define M_FW_VI_RXMODE_CMD_MTU 0xffff
925 #define V_FW_VI_RXMODE_CMD_MTU(x) ((x) << S_FW_VI_RXMODE_CMD_MTU)
926 #define G_FW_VI_RXMODE_CMD_MTU(x) \
927 (((x) >> S_FW_VI_RXMODE_CMD_MTU) & M_FW_VI_RXMODE_CMD_MTU)
929 #define S_FW_VI_RXMODE_CMD_PROMISCEN 14
930 #define M_FW_VI_RXMODE_CMD_PROMISCEN 0x3
931 #define V_FW_VI_RXMODE_CMD_PROMISCEN(x) ((x) << S_FW_VI_RXMODE_CMD_PROMISCEN)
932 #define G_FW_VI_RXMODE_CMD_PROMISCEN(x) \
933 (((x) >> S_FW_VI_RXMODE_CMD_PROMISCEN) & M_FW_VI_RXMODE_CMD_PROMISCEN)
935 #define S_FW_VI_RXMODE_CMD_ALLMULTIEN 12
936 #define M_FW_VI_RXMODE_CMD_ALLMULTIEN 0x3
937 #define V_FW_VI_RXMODE_CMD_ALLMULTIEN(x) \
938 ((x) << S_FW_VI_RXMODE_CMD_ALLMULTIEN)
939 #define G_FW_VI_RXMODE_CMD_ALLMULTIEN(x) \
940 (((x) >> S_FW_VI_RXMODE_CMD_ALLMULTIEN) & M_FW_VI_RXMODE_CMD_ALLMULTIEN)
942 #define S_FW_VI_RXMODE_CMD_BROADCASTEN 10
943 #define M_FW_VI_RXMODE_CMD_BROADCASTEN 0x3
944 #define V_FW_VI_RXMODE_CMD_BROADCASTEN(x) \
945 ((x) << S_FW_VI_RXMODE_CMD_BROADCASTEN)
946 #define G_FW_VI_RXMODE_CMD_BROADCASTEN(x) \
947 (((x) >> S_FW_VI_RXMODE_CMD_BROADCASTEN) & \
948 M_FW_VI_RXMODE_CMD_BROADCASTEN)
950 #define S_FW_VI_RXMODE_CMD_VLANEXEN 8
951 #define M_FW_VI_RXMODE_CMD_VLANEXEN 0x3
952 #define V_FW_VI_RXMODE_CMD_VLANEXEN(x) ((x) << S_FW_VI_RXMODE_CMD_VLANEXEN)
953 #define G_FW_VI_RXMODE_CMD_VLANEXEN(x) \
954 (((x) >> S_FW_VI_RXMODE_CMD_VLANEXEN) & M_FW_VI_RXMODE_CMD_VLANEXEN)
956 struct fw_vi_enable_cmd {
964 #define S_FW_VI_ENABLE_CMD_VIID 0
965 #define M_FW_VI_ENABLE_CMD_VIID 0xfff
966 #define V_FW_VI_ENABLE_CMD_VIID(x) ((x) << S_FW_VI_ENABLE_CMD_VIID)
967 #define G_FW_VI_ENABLE_CMD_VIID(x) \
968 (((x) >> S_FW_VI_ENABLE_CMD_VIID) & M_FW_VI_ENABLE_CMD_VIID)
970 #define S_FW_VI_ENABLE_CMD_IEN 31
971 #define M_FW_VI_ENABLE_CMD_IEN 0x1
972 #define V_FW_VI_ENABLE_CMD_IEN(x) ((x) << S_FW_VI_ENABLE_CMD_IEN)
973 #define G_FW_VI_ENABLE_CMD_IEN(x) \
974 (((x) >> S_FW_VI_ENABLE_CMD_IEN) & M_FW_VI_ENABLE_CMD_IEN)
975 #define F_FW_VI_ENABLE_CMD_IEN V_FW_VI_ENABLE_CMD_IEN(1U)
977 #define S_FW_VI_ENABLE_CMD_EEN 30
978 #define M_FW_VI_ENABLE_CMD_EEN 0x1
979 #define V_FW_VI_ENABLE_CMD_EEN(x) ((x) << S_FW_VI_ENABLE_CMD_EEN)
980 #define G_FW_VI_ENABLE_CMD_EEN(x) \
981 (((x) >> S_FW_VI_ENABLE_CMD_EEN) & M_FW_VI_ENABLE_CMD_EEN)
982 #define F_FW_VI_ENABLE_CMD_EEN V_FW_VI_ENABLE_CMD_EEN(1U)
984 #define S_FW_VI_ENABLE_CMD_DCB_INFO 28
985 #define M_FW_VI_ENABLE_CMD_DCB_INFO 0x1
986 #define V_FW_VI_ENABLE_CMD_DCB_INFO(x) ((x) << S_FW_VI_ENABLE_CMD_DCB_INFO)
987 #define G_FW_VI_ENABLE_CMD_DCB_INFO(x) \
988 (((x) >> S_FW_VI_ENABLE_CMD_DCB_INFO) & M_FW_VI_ENABLE_CMD_DCB_INFO)
989 #define F_FW_VI_ENABLE_CMD_DCB_INFO V_FW_VI_ENABLE_CMD_DCB_INFO(1U)
991 /* VI PF stats offset definitions */
992 #define VI_PF_NUM_STATS 17
993 enum fw_vi_stats_pf_index {
994 FW_VI_PF_STAT_TX_BCAST_BYTES_IX,
995 FW_VI_PF_STAT_TX_BCAST_FRAMES_IX,
996 FW_VI_PF_STAT_TX_MCAST_BYTES_IX,
997 FW_VI_PF_STAT_TX_MCAST_FRAMES_IX,
998 FW_VI_PF_STAT_TX_UCAST_BYTES_IX,
999 FW_VI_PF_STAT_TX_UCAST_FRAMES_IX,
1000 FW_VI_PF_STAT_TX_OFLD_BYTES_IX,
1001 FW_VI_PF_STAT_TX_OFLD_FRAMES_IX,
1002 FW_VI_PF_STAT_RX_BYTES_IX,
1003 FW_VI_PF_STAT_RX_FRAMES_IX,
1004 FW_VI_PF_STAT_RX_BCAST_BYTES_IX,
1005 FW_VI_PF_STAT_RX_BCAST_FRAMES_IX,
1006 FW_VI_PF_STAT_RX_MCAST_BYTES_IX,
1007 FW_VI_PF_STAT_RX_MCAST_FRAMES_IX,
1008 FW_VI_PF_STAT_RX_UCAST_BYTES_IX,
1009 FW_VI_PF_STAT_RX_UCAST_FRAMES_IX,
1010 FW_VI_PF_STAT_RX_ERR_FRAMES_IX
1013 struct fw_vi_stats_cmd {
1015 __be32 retval_len16;
1017 struct fw_vi_stats_ctl {
1028 struct fw_vi_stats_pf {
1029 __be64 tx_bcast_bytes;
1030 __be64 tx_bcast_frames;
1031 __be64 tx_mcast_bytes;
1032 __be64 tx_mcast_frames;
1033 __be64 tx_ucast_bytes;
1034 __be64 tx_ucast_frames;
1035 __be64 tx_offload_bytes;
1036 __be64 tx_offload_frames;
1038 __be64 rx_pf_frames;
1039 __be64 rx_bcast_bytes;
1040 __be64 rx_bcast_frames;
1041 __be64 rx_mcast_bytes;
1042 __be64 rx_mcast_frames;
1043 __be64 rx_ucast_bytes;
1044 __be64 rx_ucast_frames;
1045 __be64 rx_err_frames;
1047 struct fw_vi_stats_vf {
1048 __be64 tx_bcast_bytes;
1049 __be64 tx_bcast_frames;
1050 __be64 tx_mcast_bytes;
1051 __be64 tx_mcast_frames;
1052 __be64 tx_ucast_bytes;
1053 __be64 tx_ucast_frames;
1054 __be64 tx_drop_frames;
1055 __be64 tx_offload_bytes;
1056 __be64 tx_offload_frames;
1057 __be64 rx_bcast_bytes;
1058 __be64 rx_bcast_frames;
1059 __be64 rx_mcast_bytes;
1060 __be64 rx_mcast_frames;
1061 __be64 rx_ucast_bytes;
1062 __be64 rx_ucast_frames;
1063 __be64 rx_err_frames;
1068 /* port capabilities bitmap */
1070 FW_PORT_CAP_SPEED_100M = 0x0001,
1071 FW_PORT_CAP_SPEED_1G = 0x0002,
1072 FW_PORT_CAP_SPEED_25G = 0x0004,
1073 FW_PORT_CAP_SPEED_10G = 0x0008,
1074 FW_PORT_CAP_SPEED_40G = 0x0010,
1075 FW_PORT_CAP_SPEED_100G = 0x0020,
1076 FW_PORT_CAP_FC_RX = 0x0040,
1077 FW_PORT_CAP_FC_TX = 0x0080,
1078 FW_PORT_CAP_ANEG = 0x0100,
1079 FW_PORT_CAP_MDIX = 0x0200,
1080 FW_PORT_CAP_MDIAUTO = 0x0400,
1081 FW_PORT_CAP_FEC_RS = 0x0800,
1082 FW_PORT_CAP_FEC_BASER_RS = 0x1000,
1083 FW_PORT_CAP_FEC_RESERVED = 0x2000,
1084 FW_PORT_CAP_802_3_PAUSE = 0x4000,
1085 FW_PORT_CAP_802_3_ASM_DIR = 0x8000,
1088 #define S_FW_PORT_CAP_SPEED 0
1089 #define M_FW_PORT_CAP_SPEED 0x3f
1090 #define V_FW_PORT_CAP_SPEED(x) ((x) << S_FW_PORT_CAP_SPEED)
1091 #define G_FW_PORT_CAP_SPEED(x) \
1092 (((x) >> S_FW_PORT_CAP_SPEED) & M_FW_PORT_CAP_SPEED)
1095 FW_PORT_CAP_MDI_AUTO,
1098 #define S_FW_PORT_CAP_MDI 9
1099 #define M_FW_PORT_CAP_MDI 3
1100 #define V_FW_PORT_CAP_MDI(x) ((x) << S_FW_PORT_CAP_MDI)
1101 #define G_FW_PORT_CAP_MDI(x) (((x) >> S_FW_PORT_CAP_MDI) & M_FW_PORT_CAP_MDI)
1103 enum fw_port_action {
1104 FW_PORT_ACTION_L1_CFG = 0x0001,
1105 FW_PORT_ACTION_GET_PORT_INFO = 0x0003,
1108 struct fw_port_cmd {
1109 __be32 op_to_portid;
1110 __be32 action_to_len16;
1112 struct fw_port_l1cfg {
1116 struct fw_port_l2cfg {
1118 __u8 ovlan3_to_ivlan0;
1120 __be16 txipg_force_pinfo;
1131 struct fw_port_info {
1132 __be32 lstatus_to_modtype;
1143 struct fw_port_diags {
1149 struct fw_port_dcb_pgid {
1156 struct fw_port_dcb_pgrate {
1160 __u8 num_tcs_supported;
1164 struct fw_port_dcb_priorate {
1168 __u8 strict_priorate[8];
1170 struct fw_port_dcb_pfc {
1177 struct fw_port_app_priority {
1186 struct fw_port_dcb_control {
1189 __be16 dcb_version_to_app_state;
1197 #define S_FW_PORT_CMD_PORTID 0
1198 #define M_FW_PORT_CMD_PORTID 0xf
1199 #define V_FW_PORT_CMD_PORTID(x) ((x) << S_FW_PORT_CMD_PORTID)
1200 #define G_FW_PORT_CMD_PORTID(x) \
1201 (((x) >> S_FW_PORT_CMD_PORTID) & M_FW_PORT_CMD_PORTID)
1203 #define S_FW_PORT_CMD_ACTION 16
1204 #define M_FW_PORT_CMD_ACTION 0xffff
1205 #define V_FW_PORT_CMD_ACTION(x) ((x) << S_FW_PORT_CMD_ACTION)
1206 #define G_FW_PORT_CMD_ACTION(x) \
1207 (((x) >> S_FW_PORT_CMD_ACTION) & M_FW_PORT_CMD_ACTION)
1209 #define S_FW_PORT_CMD_LSTATUS 31
1210 #define M_FW_PORT_CMD_LSTATUS 0x1
1211 #define V_FW_PORT_CMD_LSTATUS(x) ((x) << S_FW_PORT_CMD_LSTATUS)
1212 #define G_FW_PORT_CMD_LSTATUS(x) \
1213 (((x) >> S_FW_PORT_CMD_LSTATUS) & M_FW_PORT_CMD_LSTATUS)
1214 #define F_FW_PORT_CMD_LSTATUS V_FW_PORT_CMD_LSTATUS(1U)
1216 #define S_FW_PORT_CMD_LSPEED 24
1217 #define M_FW_PORT_CMD_LSPEED 0x3f
1218 #define V_FW_PORT_CMD_LSPEED(x) ((x) << S_FW_PORT_CMD_LSPEED)
1219 #define G_FW_PORT_CMD_LSPEED(x) \
1220 (((x) >> S_FW_PORT_CMD_LSPEED) & M_FW_PORT_CMD_LSPEED)
1222 #define S_FW_PORT_CMD_TXPAUSE 23
1223 #define M_FW_PORT_CMD_TXPAUSE 0x1
1224 #define V_FW_PORT_CMD_TXPAUSE(x) ((x) << S_FW_PORT_CMD_TXPAUSE)
1225 #define G_FW_PORT_CMD_TXPAUSE(x) \
1226 (((x) >> S_FW_PORT_CMD_TXPAUSE) & M_FW_PORT_CMD_TXPAUSE)
1227 #define F_FW_PORT_CMD_TXPAUSE V_FW_PORT_CMD_TXPAUSE(1U)
1229 #define S_FW_PORT_CMD_RXPAUSE 22
1230 #define M_FW_PORT_CMD_RXPAUSE 0x1
1231 #define V_FW_PORT_CMD_RXPAUSE(x) ((x) << S_FW_PORT_CMD_RXPAUSE)
1232 #define G_FW_PORT_CMD_RXPAUSE(x) \
1233 (((x) >> S_FW_PORT_CMD_RXPAUSE) & M_FW_PORT_CMD_RXPAUSE)
1234 #define F_FW_PORT_CMD_RXPAUSE V_FW_PORT_CMD_RXPAUSE(1U)
1236 #define S_FW_PORT_CMD_MDIOCAP 21
1237 #define M_FW_PORT_CMD_MDIOCAP 0x1
1238 #define V_FW_PORT_CMD_MDIOCAP(x) ((x) << S_FW_PORT_CMD_MDIOCAP)
1239 #define G_FW_PORT_CMD_MDIOCAP(x) \
1240 (((x) >> S_FW_PORT_CMD_MDIOCAP) & M_FW_PORT_CMD_MDIOCAP)
1241 #define F_FW_PORT_CMD_MDIOCAP V_FW_PORT_CMD_MDIOCAP(1U)
1243 #define S_FW_PORT_CMD_MDIOADDR 16
1244 #define M_FW_PORT_CMD_MDIOADDR 0x1f
1245 #define V_FW_PORT_CMD_MDIOADDR(x) ((x) << S_FW_PORT_CMD_MDIOADDR)
1246 #define G_FW_PORT_CMD_MDIOADDR(x) \
1247 (((x) >> S_FW_PORT_CMD_MDIOADDR) & M_FW_PORT_CMD_MDIOADDR)
1249 #define S_FW_PORT_CMD_PTYPE 8
1250 #define M_FW_PORT_CMD_PTYPE 0x1f
1251 #define V_FW_PORT_CMD_PTYPE(x) ((x) << S_FW_PORT_CMD_PTYPE)
1252 #define G_FW_PORT_CMD_PTYPE(x) \
1253 (((x) >> S_FW_PORT_CMD_PTYPE) & M_FW_PORT_CMD_PTYPE)
1255 #define S_FW_PORT_CMD_LINKDNRC 5
1256 #define M_FW_PORT_CMD_LINKDNRC 0x7
1257 #define V_FW_PORT_CMD_LINKDNRC(x) ((x) << S_FW_PORT_CMD_LINKDNRC)
1258 #define G_FW_PORT_CMD_LINKDNRC(x) \
1259 (((x) >> S_FW_PORT_CMD_LINKDNRC) & M_FW_PORT_CMD_LINKDNRC)
1261 #define S_FW_PORT_CMD_MODTYPE 0
1262 #define M_FW_PORT_CMD_MODTYPE 0x1f
1263 #define V_FW_PORT_CMD_MODTYPE(x) ((x) << S_FW_PORT_CMD_MODTYPE)
1264 #define G_FW_PORT_CMD_MODTYPE(x) \
1265 (((x) >> S_FW_PORT_CMD_MODTYPE) & M_FW_PORT_CMD_MODTYPE)
1268 * These are configured into the VPD and hence tools that generate
1269 * VPD may use this enumeration.
1270 * extPHY #lanes T4_I2C extI2C BP_Eq BP_ANEG Speed
1273 * Update the Common Code t4_hw.c:t4_get_port_type_description()
1274 * with any new Firmware Port Technology Types!
1277 FW_PORT_TYPE_FIBER_XFI = 0, /* Y, 1, N, Y, N, N, 10G */
1278 FW_PORT_TYPE_FIBER_XAUI = 1, /* Y, 4, N, Y, N, N, 10G */
1279 FW_PORT_TYPE_BT_SGMII = 2, /* Y, 1, No, No, No, No, 1G/100M */
1280 FW_PORT_TYPE_BT_XFI = 3, /* Y, 1, No, No, No, No, 10G */
1281 FW_PORT_TYPE_BT_XAUI = 4, /* Y, 4, No, No, No, No, 10G/1G/100M? */
1282 FW_PORT_TYPE_KX4 = 5, /* No, 4, No, No, Yes, Yes, 10G */
1283 FW_PORT_TYPE_CX4 = 6, /* No, 4, No, No, No, No, 10G */
1284 FW_PORT_TYPE_KX = 7, /* No, 1, No, No, Yes, No, 1G */
1285 FW_PORT_TYPE_KR = 8, /* No, 1, No, No, Yes, Yes, 10G */
1286 FW_PORT_TYPE_SFP = 9, /* No, 1, Yes, No, No, No, 10G */
1287 FW_PORT_TYPE_BP_AP = 10,
1288 /* No, 1, No, No, Yes, Yes, 10G, BP ANGE */
1289 FW_PORT_TYPE_BP4_AP = 11,
1290 /* No, 4, No, No, Yes, Yes, 10G, BP ANGE */
1291 FW_PORT_TYPE_QSFP_10G = 12, /* No, 1, Yes, No, No, No, 10G */
1292 FW_PORT_TYPE_QSA = 13, /* No, 1, Yes, No, No, No, 10G */
1293 FW_PORT_TYPE_QSFP = 14, /* No, 4, Yes, No, No, No, 40G */
1294 FW_PORT_TYPE_BP40_BA = 15,
1295 /* No, 4, No, No, Yes, Yes, 40G/10G/1G, BP ANGE */
1296 FW_PORT_TYPE_KR4_100G = 16, /* No, 4, 100G*/
1297 FW_PORT_TYPE_CR4_QSFP = 17, /* No, 4, 100G*/
1298 FW_PORT_TYPE_CR4_CFP4 = 18, /* No, 4, 100G*/
1299 FW_PORT_TYPE_CR_QSFP = 19, /* No, 1, 25G*/
1300 FW_PORT_TYPE_CR_CFP4 = 20, /* No, 1, 25G*/
1301 FW_PORT_TYPE_CR2_QSFP = 21, /* No, 2, 50G*/
1302 FW_PORT_TYPE_CR2_CFP4 = 22, /* No, 2, 50G*/
1303 FW_PORT_TYPE_SFP28 = 23, /* No, 1, 25G*/
1305 FW_PORT_TYPE_NONE = M_FW_PORT_CMD_PTYPE
1308 /* These are read from module's EEPROM and determined once the
1309 * module is inserted.
1311 enum fw_port_module_type {
1312 FW_PORT_MOD_TYPE_NA = 0x0,
1313 FW_PORT_MOD_TYPE_LR = 0x1,
1314 FW_PORT_MOD_TYPE_SR = 0x2,
1315 FW_PORT_MOD_TYPE_ER = 0x3,
1316 FW_PORT_MOD_TYPE_TWINAX_PASSIVE = 0x4,
1317 FW_PORT_MOD_TYPE_TWINAX_ACTIVE = 0x5,
1318 FW_PORT_MOD_TYPE_LRM = 0x6,
1319 FW_PORT_MOD_TYPE_ERROR = M_FW_PORT_CMD_MODTYPE - 3,
1320 FW_PORT_MOD_TYPE_UNKNOWN = M_FW_PORT_CMD_MODTYPE - 2,
1321 FW_PORT_MOD_TYPE_NOTSUPPORTED = M_FW_PORT_CMD_MODTYPE - 1,
1322 FW_PORT_MOD_TYPE_NONE = M_FW_PORT_CMD_MODTYPE
1325 /* used by FW and tools may use this to generate VPD */
1326 enum fw_port_mod_sub_type {
1327 FW_PORT_MOD_SUB_TYPE_NA,
1328 FW_PORT_MOD_SUB_TYPE_MV88E114X = 0x1,
1329 FW_PORT_MOD_SUB_TYPE_TN8022 = 0x2,
1330 FW_PORT_MOD_SUB_TYPE_AQ1202 = 0x3,
1331 FW_PORT_MOD_SUB_TYPE_88x3120 = 0x4,
1332 FW_PORT_MOD_SUB_TYPE_BCM84834 = 0x5,
1333 FW_PORT_MOD_SUB_TYPE_BCM5482 = 0x6,
1334 FW_PORT_MOD_SUB_TYPE_BCM84856 = 0x7,
1335 FW_PORT_MOD_SUB_TYPE_BT_VSC8634 = 0x8,
1338 * The following will never been in the VPD. They are TWINAX cable
1339 * lengths decoded from SFP+ module i2c PROMs. These should almost
1340 * certainly go somewhere else ...
1342 FW_PORT_MOD_SUB_TYPE_TWINAX_1 = 0x9,
1343 FW_PORT_MOD_SUB_TYPE_TWINAX_3 = 0xA,
1344 FW_PORT_MOD_SUB_TYPE_TWINAX_5 = 0xB,
1345 FW_PORT_MOD_SUB_TYPE_TWINAX_7 = 0xC,
1348 /* link down reason codes (3b) */
1349 enum fw_port_link_dn_rc {
1350 FW_PORT_LINK_DN_RC_NONE,
1351 FW_PORT_LINK_DN_RC_REMFLT, /* Remote fault detected */
1352 FW_PORT_LINK_DN_ANEG_F, /* Auto-negotiation fault */
1353 FW_PORT_LINK_DN_RESERVED3,
1354 FW_PORT_LINK_DN_OVERHEAT, /* Port overheated */
1355 FW_PORT_LINK_DN_UNKNOWN, /* Unable to determine reason */
1356 FW_PORT_LINK_DN_RX_LOS, /* No RX signal detected */
1357 FW_PORT_LINK_DN_RESERVED7
1361 #define FW_NUM_PORT_STATS 50
1362 #define FW_NUM_PORT_TX_STATS 23
1363 #define FW_NUM_PORT_RX_STATS 27
1365 enum fw_port_stats_tx_index {
1366 FW_STAT_TX_PORT_BYTES_IX,
1367 FW_STAT_TX_PORT_FRAMES_IX,
1368 FW_STAT_TX_PORT_BCAST_IX,
1369 FW_STAT_TX_PORT_MCAST_IX,
1370 FW_STAT_TX_PORT_UCAST_IX,
1371 FW_STAT_TX_PORT_ERROR_IX,
1372 FW_STAT_TX_PORT_64B_IX,
1373 FW_STAT_TX_PORT_65B_127B_IX,
1374 FW_STAT_TX_PORT_128B_255B_IX,
1375 FW_STAT_TX_PORT_256B_511B_IX,
1376 FW_STAT_TX_PORT_512B_1023B_IX,
1377 FW_STAT_TX_PORT_1024B_1518B_IX,
1378 FW_STAT_TX_PORT_1519B_MAX_IX,
1379 FW_STAT_TX_PORT_DROP_IX,
1380 FW_STAT_TX_PORT_PAUSE_IX,
1381 FW_STAT_TX_PORT_PPP0_IX,
1382 FW_STAT_TX_PORT_PPP1_IX,
1383 FW_STAT_TX_PORT_PPP2_IX,
1384 FW_STAT_TX_PORT_PPP3_IX,
1385 FW_STAT_TX_PORT_PPP4_IX,
1386 FW_STAT_TX_PORT_PPP5_IX,
1387 FW_STAT_TX_PORT_PPP6_IX,
1388 FW_STAT_TX_PORT_PPP7_IX
1391 enum fw_port_stat_rx_index {
1392 FW_STAT_RX_PORT_BYTES_IX,
1393 FW_STAT_RX_PORT_FRAMES_IX,
1394 FW_STAT_RX_PORT_BCAST_IX,
1395 FW_STAT_RX_PORT_MCAST_IX,
1396 FW_STAT_RX_PORT_UCAST_IX,
1397 FW_STAT_RX_PORT_MTU_ERROR_IX,
1398 FW_STAT_RX_PORT_MTU_CRC_ERROR_IX,
1399 FW_STAT_RX_PORT_CRC_ERROR_IX,
1400 FW_STAT_RX_PORT_LEN_ERROR_IX,
1401 FW_STAT_RX_PORT_SYM_ERROR_IX,
1402 FW_STAT_RX_PORT_64B_IX,
1403 FW_STAT_RX_PORT_65B_127B_IX,
1404 FW_STAT_RX_PORT_128B_255B_IX,
1405 FW_STAT_RX_PORT_256B_511B_IX,
1406 FW_STAT_RX_PORT_512B_1023B_IX,
1407 FW_STAT_RX_PORT_1024B_1518B_IX,
1408 FW_STAT_RX_PORT_1519B_MAX_IX,
1409 FW_STAT_RX_PORT_PAUSE_IX,
1410 FW_STAT_RX_PORT_PPP0_IX,
1411 FW_STAT_RX_PORT_PPP1_IX,
1412 FW_STAT_RX_PORT_PPP2_IX,
1413 FW_STAT_RX_PORT_PPP3_IX,
1414 FW_STAT_RX_PORT_PPP4_IX,
1415 FW_STAT_RX_PORT_PPP5_IX,
1416 FW_STAT_RX_PORT_PPP6_IX,
1417 FW_STAT_RX_PORT_PPP7_IX,
1418 FW_STAT_RX_PORT_LESS_64B_IX
1421 struct fw_port_stats_cmd {
1422 __be32 op_to_portid;
1423 __be32 retval_len16;
1424 union fw_port_stats {
1425 struct fw_port_stats_ctl {
1437 struct fw_port_stats_all {
1446 __be64 tx_128b_255b;
1447 __be64 tx_256b_511b;
1448 __be64 tx_512b_1023b;
1449 __be64 tx_1024b_1518b;
1450 __be64 tx_1519b_max;
1466 __be64 rx_mtu_error;
1467 __be64 rx_mtu_crc_error;
1468 __be64 rx_crc_error;
1469 __be64 rx_len_error;
1470 __be64 rx_sym_error;
1473 __be64 rx_128b_255b;
1474 __be64 rx_256b_511b;
1475 __be64 rx_512b_1023b;
1476 __be64 rx_1024b_1518b;
1477 __be64 rx_1519b_max;
1494 struct fw_rss_ind_tbl_cmd {
1496 __be32 retval_len16;
1504 __be32 iq12_to_iq14;
1505 __be32 iq15_to_iq17;
1506 __be32 iq18_to_iq20;
1507 __be32 iq21_to_iq23;
1508 __be32 iq24_to_iq26;
1509 __be32 iq27_to_iq29;
1514 #define S_FW_RSS_IND_TBL_CMD_VIID 0
1515 #define M_FW_RSS_IND_TBL_CMD_VIID 0xfff
1516 #define V_FW_RSS_IND_TBL_CMD_VIID(x) ((x) << S_FW_RSS_IND_TBL_CMD_VIID)
1517 #define G_FW_RSS_IND_TBL_CMD_VIID(x) \
1518 (((x) >> S_FW_RSS_IND_TBL_CMD_VIID) & M_FW_RSS_IND_TBL_CMD_VIID)
1520 #define S_FW_RSS_IND_TBL_CMD_IQ0 20
1521 #define M_FW_RSS_IND_TBL_CMD_IQ0 0x3ff
1522 #define V_FW_RSS_IND_TBL_CMD_IQ0(x) ((x) << S_FW_RSS_IND_TBL_CMD_IQ0)
1523 #define G_FW_RSS_IND_TBL_CMD_IQ0(x) \
1524 (((x) >> S_FW_RSS_IND_TBL_CMD_IQ0) & M_FW_RSS_IND_TBL_CMD_IQ0)
1526 #define S_FW_RSS_IND_TBL_CMD_IQ1 10
1527 #define M_FW_RSS_IND_TBL_CMD_IQ1 0x3ff
1528 #define V_FW_RSS_IND_TBL_CMD_IQ1(x) ((x) << S_FW_RSS_IND_TBL_CMD_IQ1)
1529 #define G_FW_RSS_IND_TBL_CMD_IQ1(x) \
1530 (((x) >> S_FW_RSS_IND_TBL_CMD_IQ1) & M_FW_RSS_IND_TBL_CMD_IQ1)
1532 #define S_FW_RSS_IND_TBL_CMD_IQ2 0
1533 #define M_FW_RSS_IND_TBL_CMD_IQ2 0x3ff
1534 #define V_FW_RSS_IND_TBL_CMD_IQ2(x) ((x) << S_FW_RSS_IND_TBL_CMD_IQ2)
1535 #define G_FW_RSS_IND_TBL_CMD_IQ2(x) \
1536 (((x) >> S_FW_RSS_IND_TBL_CMD_IQ2) & M_FW_RSS_IND_TBL_CMD_IQ2)
1538 struct fw_rss_vi_config_cmd {
1540 __be32 retval_len16;
1541 union fw_rss_vi_config {
1542 struct fw_rss_vi_config_manual {
1547 struct fw_rss_vi_config_basicvirtual {
1549 __be32 defaultq_to_udpen;
1556 #define S_FW_RSS_VI_CONFIG_CMD_VIID 0
1557 #define M_FW_RSS_VI_CONFIG_CMD_VIID 0xfff
1558 #define V_FW_RSS_VI_CONFIG_CMD_VIID(x) ((x) << S_FW_RSS_VI_CONFIG_CMD_VIID)
1559 #define G_FW_RSS_VI_CONFIG_CMD_VIID(x) \
1560 (((x) >> S_FW_RSS_VI_CONFIG_CMD_VIID) & M_FW_RSS_VI_CONFIG_CMD_VIID)
1562 #define S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ 16
1563 #define M_FW_RSS_VI_CONFIG_CMD_DEFAULTQ 0x3ff
1564 #define V_FW_RSS_VI_CONFIG_CMD_DEFAULTQ(x) \
1565 ((x) << S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ)
1566 #define G_FW_RSS_VI_CONFIG_CMD_DEFAULTQ(x) \
1567 (((x) >> S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ) & \
1568 M_FW_RSS_VI_CONFIG_CMD_DEFAULTQ)
1570 #define S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN 4
1571 #define M_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN 0x1
1572 #define V_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(x) \
1573 ((x) << S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN)
1574 #define G_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(x) \
1575 (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN) & \
1576 M_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN)
1577 #define F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN \
1578 V_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(1U)
1580 #define S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN 3
1581 #define M_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN 0x1
1582 #define V_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(x) \
1583 ((x) << S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN)
1584 #define G_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(x) \
1585 (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN) & \
1586 M_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN)
1587 #define F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN \
1588 V_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(1U)
1590 #define S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN 2
1591 #define M_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN 0x1
1592 #define V_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(x) \
1593 ((x) << S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN)
1594 #define G_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(x) \
1595 (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN) & \
1596 M_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN)
1597 #define F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN \
1598 V_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(1U)
1600 #define S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN 1
1601 #define M_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN 0x1
1602 #define V_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(x) \
1603 ((x) << S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN)
1604 #define G_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(x) \
1605 (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN) & \
1606 M_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN)
1607 #define F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN \
1608 V_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(1U)
1610 #define S_FW_RSS_VI_CONFIG_CMD_UDPEN 0
1611 #define M_FW_RSS_VI_CONFIG_CMD_UDPEN 0x1
1612 #define V_FW_RSS_VI_CONFIG_CMD_UDPEN(x) ((x) << S_FW_RSS_VI_CONFIG_CMD_UDPEN)
1613 #define G_FW_RSS_VI_CONFIG_CMD_UDPEN(x) \
1614 (((x) >> S_FW_RSS_VI_CONFIG_CMD_UDPEN) & M_FW_RSS_VI_CONFIG_CMD_UDPEN)
1615 #define F_FW_RSS_VI_CONFIG_CMD_UDPEN V_FW_RSS_VI_CONFIG_CMD_UDPEN(1U)
1617 /******************************************************************************
1618 * D E B U G C O M M A N D s
1619 ******************************************************/
1621 struct fw_debug_cmd {
1625 struct fw_debug_assert {
1630 __u8 filename_0_7[8];
1631 __u8 filename_8_15[8];
1634 struct fw_debug_prt {
1637 __be32 dprtstrparam0;
1638 __be32 dprtstrparam1;
1639 __be32 dprtstrparam2;
1640 __be32 dprtstrparam3;
1645 #define S_FW_DEBUG_CMD_TYPE 0
1646 #define M_FW_DEBUG_CMD_TYPE 0xff
1647 #define V_FW_DEBUG_CMD_TYPE(x) ((x) << S_FW_DEBUG_CMD_TYPE)
1648 #define G_FW_DEBUG_CMD_TYPE(x) \
1649 (((x) >> S_FW_DEBUG_CMD_TYPE) & M_FW_DEBUG_CMD_TYPE)
1651 /******************************************************************************
1652 * P C I E F W R E G I S T E R
1653 **************************************/
1656 * Register definitions for the PCIE_FW register which the firmware uses
1657 * to retain status across RESETs. This register should be considered
1658 * as a READ-ONLY register for Host Software and only to be used to
1659 * track firmware initialization/error state, etc.
1661 #define S_PCIE_FW_ERR 31
1662 #define M_PCIE_FW_ERR 0x1
1663 #define V_PCIE_FW_ERR(x) ((x) << S_PCIE_FW_ERR)
1664 #define G_PCIE_FW_ERR(x) (((x) >> S_PCIE_FW_ERR) & M_PCIE_FW_ERR)
1665 #define F_PCIE_FW_ERR V_PCIE_FW_ERR(1U)
1667 #define S_PCIE_FW_INIT 30
1668 #define M_PCIE_FW_INIT 0x1
1669 #define V_PCIE_FW_INIT(x) ((x) << S_PCIE_FW_INIT)
1670 #define G_PCIE_FW_INIT(x) (((x) >> S_PCIE_FW_INIT) & M_PCIE_FW_INIT)
1671 #define F_PCIE_FW_INIT V_PCIE_FW_INIT(1U)
1673 #define S_PCIE_FW_HALT 29
1674 #define M_PCIE_FW_HALT 0x1
1675 #define V_PCIE_FW_HALT(x) ((x) << S_PCIE_FW_HALT)
1676 #define G_PCIE_FW_HALT(x) (((x) >> S_PCIE_FW_HALT) & M_PCIE_FW_HALT)
1677 #define F_PCIE_FW_HALT V_PCIE_FW_HALT(1U)
1679 #define S_PCIE_FW_EVAL 24
1680 #define M_PCIE_FW_EVAL 0x7
1681 #define V_PCIE_FW_EVAL(x) ((x) << S_PCIE_FW_EVAL)
1682 #define G_PCIE_FW_EVAL(x) (((x) >> S_PCIE_FW_EVAL) & M_PCIE_FW_EVAL)
1684 #define S_PCIE_FW_MASTER_VLD 15
1685 #define M_PCIE_FW_MASTER_VLD 0x1
1686 #define V_PCIE_FW_MASTER_VLD(x) ((x) << S_PCIE_FW_MASTER_VLD)
1687 #define G_PCIE_FW_MASTER_VLD(x) \
1688 (((x) >> S_PCIE_FW_MASTER_VLD) & M_PCIE_FW_MASTER_VLD)
1689 #define F_PCIE_FW_MASTER_VLD V_PCIE_FW_MASTER_VLD(1U)
1691 #define S_PCIE_FW_MASTER 12
1692 #define M_PCIE_FW_MASTER 0x7
1693 #define V_PCIE_FW_MASTER(x) ((x) << S_PCIE_FW_MASTER)
1694 #define G_PCIE_FW_MASTER(x) (((x) >> S_PCIE_FW_MASTER) & M_PCIE_FW_MASTER)
1696 /******************************************************************************
1697 * B I N A R Y H E A D E R F O R M A T
1698 **********************************************/
1701 * firmware binary header format
1705 __u8 chip; /* terminator chip family */
1706 __be16 len512; /* bin length in units of 512-bytes */
1707 __be32 fw_ver; /* firmware version */
1708 __be32 tp_microcode_ver; /* tcp processor microcode version */
1713 __u8 intfver_iscsipdu;
1715 __u8 intfver_fcoepdu;
1719 __u32 magic; /* runtime or bootstrap fw */
1721 __be32 reserved6[23];
1724 #define S_FW_HDR_FW_VER_MAJOR 24
1725 #define M_FW_HDR_FW_VER_MAJOR 0xff
1726 #define V_FW_HDR_FW_VER_MAJOR(x) \
1727 ((x) << S_FW_HDR_FW_VER_MAJOR)
1728 #define G_FW_HDR_FW_VER_MAJOR(x) \
1729 (((x) >> S_FW_HDR_FW_VER_MAJOR) & M_FW_HDR_FW_VER_MAJOR)
1731 #define S_FW_HDR_FW_VER_MINOR 16
1732 #define M_FW_HDR_FW_VER_MINOR 0xff
1733 #define V_FW_HDR_FW_VER_MINOR(x) \
1734 ((x) << S_FW_HDR_FW_VER_MINOR)
1735 #define G_FW_HDR_FW_VER_MINOR(x) \
1736 (((x) >> S_FW_HDR_FW_VER_MINOR) & M_FW_HDR_FW_VER_MINOR)
1738 #define S_FW_HDR_FW_VER_MICRO 8
1739 #define M_FW_HDR_FW_VER_MICRO 0xff
1740 #define V_FW_HDR_FW_VER_MICRO(x) \
1741 ((x) << S_FW_HDR_FW_VER_MICRO)
1742 #define G_FW_HDR_FW_VER_MICRO(x) \
1743 (((x) >> S_FW_HDR_FW_VER_MICRO) & M_FW_HDR_FW_VER_MICRO)
1745 #define S_FW_HDR_FW_VER_BUILD 0
1746 #define M_FW_HDR_FW_VER_BUILD 0xff
1747 #define V_FW_HDR_FW_VER_BUILD(x) \
1748 ((x) << S_FW_HDR_FW_VER_BUILD)
1749 #define G_FW_HDR_FW_VER_BUILD(x) \
1750 (((x) >> S_FW_HDR_FW_VER_BUILD) & M_FW_HDR_FW_VER_BUILD)
1752 #endif /* _T4FW_INTERFACE_H_ */