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 {
178 FW_INITIALIZE_CMD = 0x06,
179 FW_CAPS_CONFIG_CMD = 0x07,
180 FW_PARAMS_CMD = 0x08,
183 FW_EQ_ETH_CMD = 0x12,
185 FW_VI_MAC_CMD = 0x15,
186 FW_VI_RXMODE_CMD = 0x16,
187 FW_VI_ENABLE_CMD = 0x17,
189 FW_RSS_IND_TBL_CMD = 0x20,
190 FW_RSS_VI_CONFIG_CMD = 0x23,
195 FW_CMD_CAP_PORT = 0x04,
199 * Generic command header flit0
206 #define S_FW_CMD_OP 24
207 #define M_FW_CMD_OP 0xff
208 #define V_FW_CMD_OP(x) ((x) << S_FW_CMD_OP)
209 #define G_FW_CMD_OP(x) (((x) >> S_FW_CMD_OP) & M_FW_CMD_OP)
211 #define S_FW_CMD_REQUEST 23
212 #define M_FW_CMD_REQUEST 0x1
213 #define V_FW_CMD_REQUEST(x) ((x) << S_FW_CMD_REQUEST)
214 #define G_FW_CMD_REQUEST(x) (((x) >> S_FW_CMD_REQUEST) & M_FW_CMD_REQUEST)
215 #define F_FW_CMD_REQUEST V_FW_CMD_REQUEST(1U)
217 #define S_FW_CMD_READ 22
218 #define M_FW_CMD_READ 0x1
219 #define V_FW_CMD_READ(x) ((x) << S_FW_CMD_READ)
220 #define G_FW_CMD_READ(x) (((x) >> S_FW_CMD_READ) & M_FW_CMD_READ)
221 #define F_FW_CMD_READ V_FW_CMD_READ(1U)
223 #define S_FW_CMD_WRITE 21
224 #define M_FW_CMD_WRITE 0x1
225 #define V_FW_CMD_WRITE(x) ((x) << S_FW_CMD_WRITE)
226 #define G_FW_CMD_WRITE(x) (((x) >> S_FW_CMD_WRITE) & M_FW_CMD_WRITE)
227 #define F_FW_CMD_WRITE V_FW_CMD_WRITE(1U)
229 #define S_FW_CMD_EXEC 20
230 #define M_FW_CMD_EXEC 0x1
231 #define V_FW_CMD_EXEC(x) ((x) << S_FW_CMD_EXEC)
232 #define G_FW_CMD_EXEC(x) (((x) >> S_FW_CMD_EXEC) & M_FW_CMD_EXEC)
233 #define F_FW_CMD_EXEC V_FW_CMD_EXEC(1U)
235 #define S_FW_CMD_RETVAL 8
236 #define M_FW_CMD_RETVAL 0xff
237 #define V_FW_CMD_RETVAL(x) ((x) << S_FW_CMD_RETVAL)
238 #define G_FW_CMD_RETVAL(x) (((x) >> S_FW_CMD_RETVAL) & M_FW_CMD_RETVAL)
240 #define S_FW_CMD_LEN16 0
241 #define M_FW_CMD_LEN16 0xff
242 #define V_FW_CMD_LEN16(x) ((x) << S_FW_CMD_LEN16)
243 #define G_FW_CMD_LEN16(x) (((x) >> S_FW_CMD_LEN16) & M_FW_CMD_LEN16)
245 #define FW_LEN16(fw_struct) V_FW_CMD_LEN16(sizeof(fw_struct) / 16)
249 enum fw_ldst_addrspc {
250 FW_LDST_ADDRSPC_TP_PIO = 0x0010,
254 __be32 op_to_addrspace;
255 __be32 cycles_to_len16;
257 struct fw_ldst_addrval {
261 struct fw_ldst_idctxt {
263 __be32 msg_ctxtflush;
273 struct fw_ldst_mdio {
289 struct fw_ldst_func {
297 struct fw_ldst_pcie {
307 struct fw_ldst_i2c_deprecated {
331 #define S_FW_LDST_CMD_ADDRSPACE 0
332 #define M_FW_LDST_CMD_ADDRSPACE 0xff
333 #define V_FW_LDST_CMD_ADDRSPACE(x) ((x) << S_FW_LDST_CMD_ADDRSPACE)
335 struct fw_reset_cmd {
342 #define S_FW_RESET_CMD_HALT 31
343 #define M_FW_RESET_CMD_HALT 0x1
344 #define V_FW_RESET_CMD_HALT(x) ((x) << S_FW_RESET_CMD_HALT)
345 #define G_FW_RESET_CMD_HALT(x) \
346 (((x) >> S_FW_RESET_CMD_HALT) & M_FW_RESET_CMD_HALT)
347 #define F_FW_RESET_CMD_HALT V_FW_RESET_CMD_HALT(1U)
350 FW_HELLO_CMD_STAGE_OS = 0,
353 struct fw_hello_cmd {
356 __be32 err_to_clearinit;
360 #define S_FW_HELLO_CMD_ERR 31
361 #define M_FW_HELLO_CMD_ERR 0x1
362 #define V_FW_HELLO_CMD_ERR(x) ((x) << S_FW_HELLO_CMD_ERR)
363 #define G_FW_HELLO_CMD_ERR(x) \
364 (((x) >> S_FW_HELLO_CMD_ERR) & M_FW_HELLO_CMD_ERR)
365 #define F_FW_HELLO_CMD_ERR V_FW_HELLO_CMD_ERR(1U)
367 #define S_FW_HELLO_CMD_INIT 30
368 #define M_FW_HELLO_CMD_INIT 0x1
369 #define V_FW_HELLO_CMD_INIT(x) ((x) << S_FW_HELLO_CMD_INIT)
370 #define G_FW_HELLO_CMD_INIT(x) \
371 (((x) >> S_FW_HELLO_CMD_INIT) & M_FW_HELLO_CMD_INIT)
372 #define F_FW_HELLO_CMD_INIT V_FW_HELLO_CMD_INIT(1U)
374 #define S_FW_HELLO_CMD_MASTERDIS 29
375 #define M_FW_HELLO_CMD_MASTERDIS 0x1
376 #define V_FW_HELLO_CMD_MASTERDIS(x) ((x) << S_FW_HELLO_CMD_MASTERDIS)
377 #define G_FW_HELLO_CMD_MASTERDIS(x) \
378 (((x) >> S_FW_HELLO_CMD_MASTERDIS) & M_FW_HELLO_CMD_MASTERDIS)
379 #define F_FW_HELLO_CMD_MASTERDIS V_FW_HELLO_CMD_MASTERDIS(1U)
381 #define S_FW_HELLO_CMD_MASTERFORCE 28
382 #define M_FW_HELLO_CMD_MASTERFORCE 0x1
383 #define V_FW_HELLO_CMD_MASTERFORCE(x) ((x) << S_FW_HELLO_CMD_MASTERFORCE)
384 #define G_FW_HELLO_CMD_MASTERFORCE(x) \
385 (((x) >> S_FW_HELLO_CMD_MASTERFORCE) & M_FW_HELLO_CMD_MASTERFORCE)
386 #define F_FW_HELLO_CMD_MASTERFORCE V_FW_HELLO_CMD_MASTERFORCE(1U)
388 #define S_FW_HELLO_CMD_MBMASTER 24
389 #define M_FW_HELLO_CMD_MBMASTER 0xf
390 #define V_FW_HELLO_CMD_MBMASTER(x) ((x) << S_FW_HELLO_CMD_MBMASTER)
391 #define G_FW_HELLO_CMD_MBMASTER(x) \
392 (((x) >> S_FW_HELLO_CMD_MBMASTER) & M_FW_HELLO_CMD_MBMASTER)
394 #define S_FW_HELLO_CMD_MBASYNCNOT 20
395 #define M_FW_HELLO_CMD_MBASYNCNOT 0x7
396 #define V_FW_HELLO_CMD_MBASYNCNOT(x) ((x) << S_FW_HELLO_CMD_MBASYNCNOT)
397 #define G_FW_HELLO_CMD_MBASYNCNOT(x) \
398 (((x) >> S_FW_HELLO_CMD_MBASYNCNOT) & M_FW_HELLO_CMD_MBASYNCNOT)
400 #define S_FW_HELLO_CMD_STAGE 17
401 #define M_FW_HELLO_CMD_STAGE 0x7
402 #define V_FW_HELLO_CMD_STAGE(x) ((x) << S_FW_HELLO_CMD_STAGE)
403 #define G_FW_HELLO_CMD_STAGE(x) \
404 (((x) >> S_FW_HELLO_CMD_STAGE) & M_FW_HELLO_CMD_STAGE)
406 #define S_FW_HELLO_CMD_CLEARINIT 16
407 #define M_FW_HELLO_CMD_CLEARINIT 0x1
408 #define V_FW_HELLO_CMD_CLEARINIT(x) ((x) << S_FW_HELLO_CMD_CLEARINIT)
409 #define G_FW_HELLO_CMD_CLEARINIT(x) \
410 (((x) >> S_FW_HELLO_CMD_CLEARINIT) & M_FW_HELLO_CMD_CLEARINIT)
411 #define F_FW_HELLO_CMD_CLEARINIT V_FW_HELLO_CMD_CLEARINIT(1U)
419 struct fw_initialize_cmd {
425 enum fw_caps_config_nic {
426 FW_CAPS_CONFIG_NIC_HASHFILTER = 0x00000020,
427 FW_CAPS_CONFIG_NIC_ETHOFLD = 0x00000040,
431 FW_MEMTYPE_CF_FLASH = FW_MEMTYPE_FLASH,
434 struct fw_caps_config_cmd {
436 __be32 cfvalid_to_len16;
454 #define S_FW_CAPS_CONFIG_CMD_CFVALID 27
455 #define M_FW_CAPS_CONFIG_CMD_CFVALID 0x1
456 #define V_FW_CAPS_CONFIG_CMD_CFVALID(x) ((x) << S_FW_CAPS_CONFIG_CMD_CFVALID)
457 #define G_FW_CAPS_CONFIG_CMD_CFVALID(x) \
458 (((x) >> S_FW_CAPS_CONFIG_CMD_CFVALID) & M_FW_CAPS_CONFIG_CMD_CFVALID)
459 #define F_FW_CAPS_CONFIG_CMD_CFVALID V_FW_CAPS_CONFIG_CMD_CFVALID(1U)
461 #define S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF 24
462 #define M_FW_CAPS_CONFIG_CMD_MEMTYPE_CF 0x7
463 #define V_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(x) \
464 ((x) << S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF)
465 #define G_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(x) \
466 (((x) >> S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF) & \
467 M_FW_CAPS_CONFIG_CMD_MEMTYPE_CF)
469 #define S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF 16
470 #define M_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF 0xff
471 #define V_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(x) \
472 ((x) << S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF)
473 #define G_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(x) \
474 (((x) >> S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF) & \
475 M_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF)
478 * params command mnemonics
480 enum fw_params_mnem {
481 FW_PARAMS_MNEM_DEV = 1, /* device params */
482 FW_PARAMS_MNEM_PFVF = 2, /* function params */
483 FW_PARAMS_MNEM_REG = 3, /* limited register access */
484 FW_PARAMS_MNEM_DMAQ = 4, /* dma queue params */
490 enum fw_params_param_dev {
491 FW_PARAMS_PARAM_DEV_CCLK = 0x00, /* chip core clock in khz */
492 FW_PARAMS_PARAM_DEV_PORTVEC = 0x01, /* the port vector */
493 FW_PARAMS_PARAM_DEV_FWREV = 0x0B, /* fw version */
494 FW_PARAMS_PARAM_DEV_TPREV = 0x0C, /* tp version */
495 FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
499 * physical and virtual function parameters
501 enum fw_params_param_pfvf {
502 FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31,
503 FW_PARAMS_PARAM_PFVF_PORT_CAPS32 = 0x3A
507 * dma queue parameters
509 enum fw_params_param_dmaq {
510 FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01,
511 FW_PARAMS_PARAM_DMAQ_CONM_CTXT = 0x20,
514 #define S_FW_PARAMS_MNEM 24
515 #define M_FW_PARAMS_MNEM 0xff
516 #define V_FW_PARAMS_MNEM(x) ((x) << S_FW_PARAMS_MNEM)
517 #define G_FW_PARAMS_MNEM(x) \
518 (((x) >> S_FW_PARAMS_MNEM) & M_FW_PARAMS_MNEM)
520 #define S_FW_PARAMS_PARAM_X 16
521 #define M_FW_PARAMS_PARAM_X 0xff
522 #define V_FW_PARAMS_PARAM_X(x) ((x) << S_FW_PARAMS_PARAM_X)
523 #define G_FW_PARAMS_PARAM_X(x) \
524 (((x) >> S_FW_PARAMS_PARAM_X) & M_FW_PARAMS_PARAM_X)
526 #define S_FW_PARAMS_PARAM_Y 8
527 #define M_FW_PARAMS_PARAM_Y 0xff
528 #define V_FW_PARAMS_PARAM_Y(x) ((x) << S_FW_PARAMS_PARAM_Y)
529 #define G_FW_PARAMS_PARAM_Y(x) \
530 (((x) >> S_FW_PARAMS_PARAM_Y) & M_FW_PARAMS_PARAM_Y)
532 #define S_FW_PARAMS_PARAM_Z 0
533 #define M_FW_PARAMS_PARAM_Z 0xff
534 #define V_FW_PARAMS_PARAM_Z(x) ((x) << S_FW_PARAMS_PARAM_Z)
535 #define G_FW_PARAMS_PARAM_Z(x) \
536 (((x) >> S_FW_PARAMS_PARAM_Z) & M_FW_PARAMS_PARAM_Z)
538 #define S_FW_PARAMS_PARAM_YZ 0
539 #define M_FW_PARAMS_PARAM_YZ 0xffff
540 #define V_FW_PARAMS_PARAM_YZ(x) ((x) << S_FW_PARAMS_PARAM_YZ)
541 #define G_FW_PARAMS_PARAM_YZ(x) \
542 (((x) >> S_FW_PARAMS_PARAM_YZ) & M_FW_PARAMS_PARAM_YZ)
544 #define S_FW_PARAMS_PARAM_XYZ 0
545 #define M_FW_PARAMS_PARAM_XYZ 0xffffff
546 #define V_FW_PARAMS_PARAM_XYZ(x) ((x) << S_FW_PARAMS_PARAM_XYZ)
548 struct fw_params_cmd {
551 struct fw_params_param {
557 #define S_FW_PARAMS_CMD_PFN 8
558 #define M_FW_PARAMS_CMD_PFN 0x7
559 #define V_FW_PARAMS_CMD_PFN(x) ((x) << S_FW_PARAMS_CMD_PFN)
560 #define G_FW_PARAMS_CMD_PFN(x) \
561 (((x) >> S_FW_PARAMS_CMD_PFN) & M_FW_PARAMS_CMD_PFN)
563 #define S_FW_PARAMS_CMD_VFN 0
564 #define M_FW_PARAMS_CMD_VFN 0xff
565 #define V_FW_PARAMS_CMD_VFN(x) ((x) << S_FW_PARAMS_CMD_VFN)
566 #define G_FW_PARAMS_CMD_VFN(x) \
567 (((x) >> S_FW_PARAMS_CMD_VFN) & M_FW_PARAMS_CMD_VFN)
574 __be32 tc_to_nexactf;
575 __be32 r_caps_to_nethctrl;
581 #define S_FW_PFVF_CMD_NIQFLINT 20
582 #define M_FW_PFVF_CMD_NIQFLINT 0xfff
583 #define G_FW_PFVF_CMD_NIQFLINT(x) \
584 (((x) >> S_FW_PFVF_CMD_NIQFLINT) & M_FW_PFVF_CMD_NIQFLINT)
586 #define S_FW_PFVF_CMD_NIQ 0
587 #define M_FW_PFVF_CMD_NIQ 0xfffff
588 #define G_FW_PFVF_CMD_NIQ(x) \
589 (((x) >> S_FW_PFVF_CMD_NIQ) & M_FW_PFVF_CMD_NIQ)
591 #define S_FW_PFVF_CMD_PMASK 20
592 #define M_FW_PFVF_CMD_PMASK 0xf
593 #define G_FW_PFVF_CMD_PMASK(x) \
594 (((x) >> S_FW_PFVF_CMD_PMASK) & M_FW_PFVF_CMD_PMASK)
596 #define S_FW_PFVF_CMD_NEQ 0
597 #define M_FW_PFVF_CMD_NEQ 0xfffff
598 #define G_FW_PFVF_CMD_NEQ(x) \
599 (((x) >> S_FW_PFVF_CMD_NEQ) & M_FW_PFVF_CMD_NEQ)
601 #define S_FW_PFVF_CMD_TC 24
602 #define M_FW_PFVF_CMD_TC 0xff
603 #define G_FW_PFVF_CMD_TC(x) \
604 (((x) >> S_FW_PFVF_CMD_TC) & M_FW_PFVF_CMD_TC)
606 #define S_FW_PFVF_CMD_NVI 16
607 #define M_FW_PFVF_CMD_NVI 0xff
608 #define G_FW_PFVF_CMD_NVI(x) \
609 (((x) >> S_FW_PFVF_CMD_NVI) & M_FW_PFVF_CMD_NVI)
611 #define S_FW_PFVF_CMD_NEXACTF 0
612 #define M_FW_PFVF_CMD_NEXACTF 0xffff
613 #define G_FW_PFVF_CMD_NEXACTF(x) \
614 (((x) >> S_FW_PFVF_CMD_NEXACTF) & M_FW_PFVF_CMD_NEXACTF)
616 #define S_FW_PFVF_CMD_R_CAPS 24
617 #define M_FW_PFVF_CMD_R_CAPS 0xff
618 #define G_FW_PFVF_CMD_R_CAPS(x) \
619 (((x) >> S_FW_PFVF_CMD_R_CAPS) & M_FW_PFVF_CMD_R_CAPS)
621 #define S_FW_PFVF_CMD_WX_CAPS 16
622 #define M_FW_PFVF_CMD_WX_CAPS 0xff
623 #define G_FW_PFVF_CMD_WX_CAPS(x) \
624 (((x) >> S_FW_PFVF_CMD_WX_CAPS) & M_FW_PFVF_CMD_WX_CAPS)
626 #define S_FW_PFVF_CMD_NETHCTRL 0
627 #define M_FW_PFVF_CMD_NETHCTRL 0xffff
628 #define G_FW_PFVF_CMD_NETHCTRL(x) \
629 (((x) >> S_FW_PFVF_CMD_NETHCTRL) & M_FW_PFVF_CMD_NETHCTRL)
632 * ingress queue type; the first 1K ingress queues can have associated 0,
633 * 1 or 2 free lists and an interrupt, all other ingress queues lack these
637 FW_IQ_TYPE_FL_INT_CAP,
642 __be32 alloc_to_len16;
647 __be32 type_to_iqandstindex;
648 __be16 iqdroprss_to_iqesize;
651 __be32 iqns_to_fl0congen;
652 __be16 fl0dcaen_to_fl0cidxfthresh;
655 __be32 fl1cngchmap_to_fl1congen;
656 __be16 fl1dcaen_to_fl1cidxfthresh;
661 #define S_FW_IQ_CMD_PFN 8
662 #define M_FW_IQ_CMD_PFN 0x7
663 #define V_FW_IQ_CMD_PFN(x) ((x) << S_FW_IQ_CMD_PFN)
664 #define G_FW_IQ_CMD_PFN(x) (((x) >> S_FW_IQ_CMD_PFN) & M_FW_IQ_CMD_PFN)
666 #define S_FW_IQ_CMD_VFN 0
667 #define M_FW_IQ_CMD_VFN 0xff
668 #define V_FW_IQ_CMD_VFN(x) ((x) << S_FW_IQ_CMD_VFN)
669 #define G_FW_IQ_CMD_VFN(x) (((x) >> S_FW_IQ_CMD_VFN) & M_FW_IQ_CMD_VFN)
671 #define S_FW_IQ_CMD_ALLOC 31
672 #define M_FW_IQ_CMD_ALLOC 0x1
673 #define V_FW_IQ_CMD_ALLOC(x) ((x) << S_FW_IQ_CMD_ALLOC)
674 #define G_FW_IQ_CMD_ALLOC(x) \
675 (((x) >> S_FW_IQ_CMD_ALLOC) & M_FW_IQ_CMD_ALLOC)
676 #define F_FW_IQ_CMD_ALLOC V_FW_IQ_CMD_ALLOC(1U)
678 #define S_FW_IQ_CMD_FREE 30
679 #define M_FW_IQ_CMD_FREE 0x1
680 #define V_FW_IQ_CMD_FREE(x) ((x) << S_FW_IQ_CMD_FREE)
681 #define G_FW_IQ_CMD_FREE(x) (((x) >> S_FW_IQ_CMD_FREE) & M_FW_IQ_CMD_FREE)
682 #define F_FW_IQ_CMD_FREE V_FW_IQ_CMD_FREE(1U)
684 #define S_FW_IQ_CMD_IQSTART 28
685 #define M_FW_IQ_CMD_IQSTART 0x1
686 #define V_FW_IQ_CMD_IQSTART(x) ((x) << S_FW_IQ_CMD_IQSTART)
687 #define G_FW_IQ_CMD_IQSTART(x) \
688 (((x) >> S_FW_IQ_CMD_IQSTART) & M_FW_IQ_CMD_IQSTART)
689 #define F_FW_IQ_CMD_IQSTART V_FW_IQ_CMD_IQSTART(1U)
691 #define S_FW_IQ_CMD_IQSTOP 27
692 #define M_FW_IQ_CMD_IQSTOP 0x1
693 #define V_FW_IQ_CMD_IQSTOP(x) ((x) << S_FW_IQ_CMD_IQSTOP)
694 #define G_FW_IQ_CMD_IQSTOP(x) \
695 (((x) >> S_FW_IQ_CMD_IQSTOP) & M_FW_IQ_CMD_IQSTOP)
696 #define F_FW_IQ_CMD_IQSTOP V_FW_IQ_CMD_IQSTOP(1U)
698 #define S_FW_IQ_CMD_TYPE 29
699 #define M_FW_IQ_CMD_TYPE 0x7
700 #define V_FW_IQ_CMD_TYPE(x) ((x) << S_FW_IQ_CMD_TYPE)
701 #define G_FW_IQ_CMD_TYPE(x) (((x) >> S_FW_IQ_CMD_TYPE) & M_FW_IQ_CMD_TYPE)
703 #define S_FW_IQ_CMD_IQASYNCH 28
704 #define M_FW_IQ_CMD_IQASYNCH 0x1
705 #define V_FW_IQ_CMD_IQASYNCH(x) ((x) << S_FW_IQ_CMD_IQASYNCH)
706 #define G_FW_IQ_CMD_IQASYNCH(x) \
707 (((x) >> S_FW_IQ_CMD_IQASYNCH) & M_FW_IQ_CMD_IQASYNCH)
708 #define F_FW_IQ_CMD_IQASYNCH V_FW_IQ_CMD_IQASYNCH(1U)
710 #define S_FW_IQ_CMD_VIID 16
711 #define M_FW_IQ_CMD_VIID 0xfff
712 #define V_FW_IQ_CMD_VIID(x) ((x) << S_FW_IQ_CMD_VIID)
713 #define G_FW_IQ_CMD_VIID(x) (((x) >> S_FW_IQ_CMD_VIID) & M_FW_IQ_CMD_VIID)
715 #define S_FW_IQ_CMD_IQANDST 15
716 #define M_FW_IQ_CMD_IQANDST 0x1
717 #define V_FW_IQ_CMD_IQANDST(x) ((x) << S_FW_IQ_CMD_IQANDST)
718 #define G_FW_IQ_CMD_IQANDST(x) \
719 (((x) >> S_FW_IQ_CMD_IQANDST) & M_FW_IQ_CMD_IQANDST)
720 #define F_FW_IQ_CMD_IQANDST V_FW_IQ_CMD_IQANDST(1U)
722 #define S_FW_IQ_CMD_IQANUD 12
723 #define M_FW_IQ_CMD_IQANUD 0x3
724 #define V_FW_IQ_CMD_IQANUD(x) ((x) << S_FW_IQ_CMD_IQANUD)
725 #define G_FW_IQ_CMD_IQANUD(x) \
726 (((x) >> S_FW_IQ_CMD_IQANUD) & M_FW_IQ_CMD_IQANUD)
728 #define S_FW_IQ_CMD_IQANDSTINDEX 0
729 #define M_FW_IQ_CMD_IQANDSTINDEX 0xfff
730 #define V_FW_IQ_CMD_IQANDSTINDEX(x) ((x) << S_FW_IQ_CMD_IQANDSTINDEX)
731 #define G_FW_IQ_CMD_IQANDSTINDEX(x) \
732 (((x) >> S_FW_IQ_CMD_IQANDSTINDEX) & M_FW_IQ_CMD_IQANDSTINDEX)
734 #define S_FW_IQ_CMD_IQGTSMODE 14
735 #define M_FW_IQ_CMD_IQGTSMODE 0x1
736 #define V_FW_IQ_CMD_IQGTSMODE(x) ((x) << S_FW_IQ_CMD_IQGTSMODE)
737 #define G_FW_IQ_CMD_IQGTSMODE(x) \
738 (((x) >> S_FW_IQ_CMD_IQGTSMODE) & M_FW_IQ_CMD_IQGTSMODE)
739 #define F_FW_IQ_CMD_IQGTSMODE V_FW_IQ_CMD_IQGTSMODE(1U)
741 #define S_FW_IQ_CMD_IQPCIECH 12
742 #define M_FW_IQ_CMD_IQPCIECH 0x3
743 #define V_FW_IQ_CMD_IQPCIECH(x) ((x) << S_FW_IQ_CMD_IQPCIECH)
744 #define G_FW_IQ_CMD_IQPCIECH(x) \
745 (((x) >> S_FW_IQ_CMD_IQPCIECH) & M_FW_IQ_CMD_IQPCIECH)
747 #define S_FW_IQ_CMD_IQINTCNTTHRESH 4
748 #define M_FW_IQ_CMD_IQINTCNTTHRESH 0x3
749 #define V_FW_IQ_CMD_IQINTCNTTHRESH(x) ((x) << S_FW_IQ_CMD_IQINTCNTTHRESH)
750 #define G_FW_IQ_CMD_IQINTCNTTHRESH(x) \
751 (((x) >> S_FW_IQ_CMD_IQINTCNTTHRESH) & M_FW_IQ_CMD_IQINTCNTTHRESH)
753 #define S_FW_IQ_CMD_IQESIZE 0
754 #define M_FW_IQ_CMD_IQESIZE 0x3
755 #define V_FW_IQ_CMD_IQESIZE(x) ((x) << S_FW_IQ_CMD_IQESIZE)
756 #define G_FW_IQ_CMD_IQESIZE(x) \
757 (((x) >> S_FW_IQ_CMD_IQESIZE) & M_FW_IQ_CMD_IQESIZE)
759 #define S_FW_IQ_CMD_IQRO 30
760 #define M_FW_IQ_CMD_IQRO 0x1
761 #define V_FW_IQ_CMD_IQRO(x) ((x) << S_FW_IQ_CMD_IQRO)
762 #define G_FW_IQ_CMD_IQRO(x) \
763 (((x) >> S_FW_IQ_CMD_IQRO) & M_FW_IQ_CMD_IQRO)
764 #define F_FW_IQ_CMD_IQRO V_FW_IQ_CMD_IQRO(1U)
766 #define S_FW_IQ_CMD_IQFLINTCONGEN 27
767 #define M_FW_IQ_CMD_IQFLINTCONGEN 0x1
768 #define V_FW_IQ_CMD_IQFLINTCONGEN(x) ((x) << S_FW_IQ_CMD_IQFLINTCONGEN)
769 #define G_FW_IQ_CMD_IQFLINTCONGEN(x) \
770 (((x) >> S_FW_IQ_CMD_IQFLINTCONGEN) & M_FW_IQ_CMD_IQFLINTCONGEN)
771 #define F_FW_IQ_CMD_IQFLINTCONGEN V_FW_IQ_CMD_IQFLINTCONGEN(1U)
773 #define S_FW_IQ_CMD_FL0CNGCHMAP 20
774 #define M_FW_IQ_CMD_FL0CNGCHMAP 0xf
775 #define V_FW_IQ_CMD_FL0CNGCHMAP(x) ((x) << S_FW_IQ_CMD_FL0CNGCHMAP)
776 #define G_FW_IQ_CMD_FL0CNGCHMAP(x) \
777 (((x) >> S_FW_IQ_CMD_FL0CNGCHMAP) & M_FW_IQ_CMD_FL0CNGCHMAP)
779 #define S_FW_IQ_CMD_FL0DATARO 12
780 #define M_FW_IQ_CMD_FL0DATARO 0x1
781 #define V_FW_IQ_CMD_FL0DATARO(x) ((x) << S_FW_IQ_CMD_FL0DATARO)
782 #define G_FW_IQ_CMD_FL0DATARO(x) \
783 (((x) >> S_FW_IQ_CMD_FL0DATARO) & M_FW_IQ_CMD_FL0DATARO)
784 #define F_FW_IQ_CMD_FL0DATARO V_FW_IQ_CMD_FL0DATARO(1U)
786 #define S_FW_IQ_CMD_FL0CONGCIF 11
787 #define M_FW_IQ_CMD_FL0CONGCIF 0x1
788 #define V_FW_IQ_CMD_FL0CONGCIF(x) ((x) << S_FW_IQ_CMD_FL0CONGCIF)
789 #define G_FW_IQ_CMD_FL0CONGCIF(x) \
790 (((x) >> S_FW_IQ_CMD_FL0CONGCIF) & M_FW_IQ_CMD_FL0CONGCIF)
791 #define F_FW_IQ_CMD_FL0CONGCIF V_FW_IQ_CMD_FL0CONGCIF(1U)
793 #define S_FW_IQ_CMD_FL0FETCHRO 6
794 #define M_FW_IQ_CMD_FL0FETCHRO 0x1
795 #define V_FW_IQ_CMD_FL0FETCHRO(x) ((x) << S_FW_IQ_CMD_FL0FETCHRO)
796 #define G_FW_IQ_CMD_FL0FETCHRO(x) \
797 (((x) >> S_FW_IQ_CMD_FL0FETCHRO) & M_FW_IQ_CMD_FL0FETCHRO)
798 #define F_FW_IQ_CMD_FL0FETCHRO V_FW_IQ_CMD_FL0FETCHRO(1U)
800 #define S_FW_IQ_CMD_FL0HOSTFCMODE 4
801 #define M_FW_IQ_CMD_FL0HOSTFCMODE 0x3
802 #define V_FW_IQ_CMD_FL0HOSTFCMODE(x) ((x) << S_FW_IQ_CMD_FL0HOSTFCMODE)
803 #define G_FW_IQ_CMD_FL0HOSTFCMODE(x) \
804 (((x) >> S_FW_IQ_CMD_FL0HOSTFCMODE) & M_FW_IQ_CMD_FL0HOSTFCMODE)
806 #define S_FW_IQ_CMD_FL0PADEN 2
807 #define M_FW_IQ_CMD_FL0PADEN 0x1
808 #define V_FW_IQ_CMD_FL0PADEN(x) ((x) << S_FW_IQ_CMD_FL0PADEN)
809 #define G_FW_IQ_CMD_FL0PADEN(x) \
810 (((x) >> S_FW_IQ_CMD_FL0PADEN) & M_FW_IQ_CMD_FL0PADEN)
811 #define F_FW_IQ_CMD_FL0PADEN V_FW_IQ_CMD_FL0PADEN(1U)
813 #define S_FW_IQ_CMD_FL0PACKEN 1
814 #define M_FW_IQ_CMD_FL0PACKEN 0x1
815 #define V_FW_IQ_CMD_FL0PACKEN(x) ((x) << S_FW_IQ_CMD_FL0PACKEN)
816 #define G_FW_IQ_CMD_FL0PACKEN(x) \
817 (((x) >> S_FW_IQ_CMD_FL0PACKEN) & M_FW_IQ_CMD_FL0PACKEN)
818 #define F_FW_IQ_CMD_FL0PACKEN V_FW_IQ_CMD_FL0PACKEN(1U)
820 #define S_FW_IQ_CMD_FL0CONGEN 0
821 #define M_FW_IQ_CMD_FL0CONGEN 0x1
822 #define V_FW_IQ_CMD_FL0CONGEN(x) ((x) << S_FW_IQ_CMD_FL0CONGEN)
823 #define G_FW_IQ_CMD_FL0CONGEN(x) \
824 (((x) >> S_FW_IQ_CMD_FL0CONGEN) & M_FW_IQ_CMD_FL0CONGEN)
825 #define F_FW_IQ_CMD_FL0CONGEN V_FW_IQ_CMD_FL0CONGEN(1U)
827 #define S_FW_IQ_CMD_FL0FBMIN 7
828 #define M_FW_IQ_CMD_FL0FBMIN 0x7
829 #define V_FW_IQ_CMD_FL0FBMIN(x) ((x) << S_FW_IQ_CMD_FL0FBMIN)
830 #define G_FW_IQ_CMD_FL0FBMIN(x) \
831 (((x) >> S_FW_IQ_CMD_FL0FBMIN) & M_FW_IQ_CMD_FL0FBMIN)
833 #define S_FW_IQ_CMD_FL0FBMAX 4
834 #define M_FW_IQ_CMD_FL0FBMAX 0x7
835 #define V_FW_IQ_CMD_FL0FBMAX(x) ((x) << S_FW_IQ_CMD_FL0FBMAX)
836 #define G_FW_IQ_CMD_FL0FBMAX(x) \
837 (((x) >> S_FW_IQ_CMD_FL0FBMAX) & M_FW_IQ_CMD_FL0FBMAX)
839 struct fw_eq_eth_cmd {
841 __be32 alloc_to_len16;
844 __be32 fetchszm_to_iqid;
845 __be32 dcaen_to_eqsize;
847 __be32 autoequiqe_to_viid;
852 #define S_FW_EQ_ETH_CMD_PFN 8
853 #define M_FW_EQ_ETH_CMD_PFN 0x7
854 #define V_FW_EQ_ETH_CMD_PFN(x) ((x) << S_FW_EQ_ETH_CMD_PFN)
855 #define G_FW_EQ_ETH_CMD_PFN(x) \
856 (((x) >> S_FW_EQ_ETH_CMD_PFN) & M_FW_EQ_ETH_CMD_PFN)
858 #define S_FW_EQ_ETH_CMD_VFN 0
859 #define M_FW_EQ_ETH_CMD_VFN 0xff
860 #define V_FW_EQ_ETH_CMD_VFN(x) ((x) << S_FW_EQ_ETH_CMD_VFN)
861 #define G_FW_EQ_ETH_CMD_VFN(x) \
862 (((x) >> S_FW_EQ_ETH_CMD_VFN) & M_FW_EQ_ETH_CMD_VFN)
864 #define S_FW_EQ_ETH_CMD_ALLOC 31
865 #define M_FW_EQ_ETH_CMD_ALLOC 0x1
866 #define V_FW_EQ_ETH_CMD_ALLOC(x) ((x) << S_FW_EQ_ETH_CMD_ALLOC)
867 #define G_FW_EQ_ETH_CMD_ALLOC(x) \
868 (((x) >> S_FW_EQ_ETH_CMD_ALLOC) & M_FW_EQ_ETH_CMD_ALLOC)
869 #define F_FW_EQ_ETH_CMD_ALLOC V_FW_EQ_ETH_CMD_ALLOC(1U)
871 #define S_FW_EQ_ETH_CMD_FREE 30
872 #define M_FW_EQ_ETH_CMD_FREE 0x1
873 #define V_FW_EQ_ETH_CMD_FREE(x) ((x) << S_FW_EQ_ETH_CMD_FREE)
874 #define G_FW_EQ_ETH_CMD_FREE(x) \
875 (((x) >> S_FW_EQ_ETH_CMD_FREE) & M_FW_EQ_ETH_CMD_FREE)
876 #define F_FW_EQ_ETH_CMD_FREE V_FW_EQ_ETH_CMD_FREE(1U)
878 #define S_FW_EQ_ETH_CMD_EQSTART 28
879 #define M_FW_EQ_ETH_CMD_EQSTART 0x1
880 #define V_FW_EQ_ETH_CMD_EQSTART(x) ((x) << S_FW_EQ_ETH_CMD_EQSTART)
881 #define G_FW_EQ_ETH_CMD_EQSTART(x) \
882 (((x) >> S_FW_EQ_ETH_CMD_EQSTART) & M_FW_EQ_ETH_CMD_EQSTART)
883 #define F_FW_EQ_ETH_CMD_EQSTART V_FW_EQ_ETH_CMD_EQSTART(1U)
885 #define S_FW_EQ_ETH_CMD_EQID 0
886 #define M_FW_EQ_ETH_CMD_EQID 0xfffff
887 #define V_FW_EQ_ETH_CMD_EQID(x) ((x) << S_FW_EQ_ETH_CMD_EQID)
888 #define G_FW_EQ_ETH_CMD_EQID(x) \
889 (((x) >> S_FW_EQ_ETH_CMD_EQID) & M_FW_EQ_ETH_CMD_EQID)
891 #define S_FW_EQ_ETH_CMD_PHYSEQID 0
892 #define M_FW_EQ_ETH_CMD_PHYSEQID 0xfffff
893 #define G_FW_EQ_ETH_CMD_PHYSEQID(x) \
894 (((x) >> S_FW_EQ_ETH_CMD_PHYSEQID) & M_FW_EQ_ETH_CMD_PHYSEQID)
896 #define S_FW_EQ_ETH_CMD_FETCHRO 22
897 #define M_FW_EQ_ETH_CMD_FETCHRO 0x1
898 #define V_FW_EQ_ETH_CMD_FETCHRO(x) ((x) << S_FW_EQ_ETH_CMD_FETCHRO)
899 #define G_FW_EQ_ETH_CMD_FETCHRO(x) \
900 (((x) >> S_FW_EQ_ETH_CMD_FETCHRO) & M_FW_EQ_ETH_CMD_FETCHRO)
901 #define F_FW_EQ_ETH_CMD_FETCHRO V_FW_EQ_ETH_CMD_FETCHRO(1U)
903 #define S_FW_EQ_ETH_CMD_HOSTFCMODE 20
904 #define M_FW_EQ_ETH_CMD_HOSTFCMODE 0x3
905 #define V_FW_EQ_ETH_CMD_HOSTFCMODE(x) ((x) << S_FW_EQ_ETH_CMD_HOSTFCMODE)
906 #define G_FW_EQ_ETH_CMD_HOSTFCMODE(x) \
907 (((x) >> S_FW_EQ_ETH_CMD_HOSTFCMODE) & M_FW_EQ_ETH_CMD_HOSTFCMODE)
909 #define S_FW_EQ_ETH_CMD_PCIECHN 16
910 #define M_FW_EQ_ETH_CMD_PCIECHN 0x3
911 #define V_FW_EQ_ETH_CMD_PCIECHN(x) ((x) << S_FW_EQ_ETH_CMD_PCIECHN)
912 #define G_FW_EQ_ETH_CMD_PCIECHN(x) \
913 (((x) >> S_FW_EQ_ETH_CMD_PCIECHN) & M_FW_EQ_ETH_CMD_PCIECHN)
915 #define S_FW_EQ_ETH_CMD_IQID 0
916 #define M_FW_EQ_ETH_CMD_IQID 0xffff
917 #define V_FW_EQ_ETH_CMD_IQID(x) ((x) << S_FW_EQ_ETH_CMD_IQID)
918 #define G_FW_EQ_ETH_CMD_IQID(x) \
919 (((x) >> S_FW_EQ_ETH_CMD_IQID) & M_FW_EQ_ETH_CMD_IQID)
921 #define S_FW_EQ_ETH_CMD_FBMIN 23
922 #define M_FW_EQ_ETH_CMD_FBMIN 0x7
923 #define V_FW_EQ_ETH_CMD_FBMIN(x) ((x) << S_FW_EQ_ETH_CMD_FBMIN)
924 #define G_FW_EQ_ETH_CMD_FBMIN(x) \
925 (((x) >> S_FW_EQ_ETH_CMD_FBMIN) & M_FW_EQ_ETH_CMD_FBMIN)
927 #define S_FW_EQ_ETH_CMD_FBMAX 20
928 #define M_FW_EQ_ETH_CMD_FBMAX 0x7
929 #define V_FW_EQ_ETH_CMD_FBMAX(x) ((x) << S_FW_EQ_ETH_CMD_FBMAX)
930 #define G_FW_EQ_ETH_CMD_FBMAX(x) \
931 (((x) >> S_FW_EQ_ETH_CMD_FBMAX) & M_FW_EQ_ETH_CMD_FBMAX)
933 #define S_FW_EQ_ETH_CMD_CIDXFTHRESH 16
934 #define M_FW_EQ_ETH_CMD_CIDXFTHRESH 0x7
935 #define V_FW_EQ_ETH_CMD_CIDXFTHRESH(x) ((x) << S_FW_EQ_ETH_CMD_CIDXFTHRESH)
936 #define G_FW_EQ_ETH_CMD_CIDXFTHRESH(x) \
937 (((x) >> S_FW_EQ_ETH_CMD_CIDXFTHRESH) & M_FW_EQ_ETH_CMD_CIDXFTHRESH)
939 #define S_FW_EQ_ETH_CMD_EQSIZE 0
940 #define M_FW_EQ_ETH_CMD_EQSIZE 0xffff
941 #define V_FW_EQ_ETH_CMD_EQSIZE(x) ((x) << S_FW_EQ_ETH_CMD_EQSIZE)
942 #define G_FW_EQ_ETH_CMD_EQSIZE(x) \
943 (((x) >> S_FW_EQ_ETH_CMD_EQSIZE) & M_FW_EQ_ETH_CMD_EQSIZE)
945 #define S_FW_EQ_ETH_CMD_AUTOEQUEQE 30
946 #define M_FW_EQ_ETH_CMD_AUTOEQUEQE 0x1
947 #define V_FW_EQ_ETH_CMD_AUTOEQUEQE(x) ((x) << S_FW_EQ_ETH_CMD_AUTOEQUEQE)
948 #define G_FW_EQ_ETH_CMD_AUTOEQUEQE(x) \
949 (((x) >> S_FW_EQ_ETH_CMD_AUTOEQUEQE) & M_FW_EQ_ETH_CMD_AUTOEQUEQE)
950 #define F_FW_EQ_ETH_CMD_AUTOEQUEQE V_FW_EQ_ETH_CMD_AUTOEQUEQE(1U)
952 #define S_FW_EQ_ETH_CMD_VIID 16
953 #define M_FW_EQ_ETH_CMD_VIID 0xfff
954 #define V_FW_EQ_ETH_CMD_VIID(x) ((x) << S_FW_EQ_ETH_CMD_VIID)
955 #define G_FW_EQ_ETH_CMD_VIID(x) \
956 (((x) >> S_FW_EQ_ETH_CMD_VIID) & M_FW_EQ_ETH_CMD_VIID)
964 __be32 alloc_to_len16;
970 __be16 norss_rsssize;
980 #define S_FW_VI_CMD_PFN 8
981 #define M_FW_VI_CMD_PFN 0x7
982 #define V_FW_VI_CMD_PFN(x) ((x) << S_FW_VI_CMD_PFN)
983 #define G_FW_VI_CMD_PFN(x) (((x) >> S_FW_VI_CMD_PFN) & M_FW_VI_CMD_PFN)
985 #define S_FW_VI_CMD_VFN 0
986 #define M_FW_VI_CMD_VFN 0xff
987 #define V_FW_VI_CMD_VFN(x) ((x) << S_FW_VI_CMD_VFN)
988 #define G_FW_VI_CMD_VFN(x) (((x) >> S_FW_VI_CMD_VFN) & M_FW_VI_CMD_VFN)
990 #define S_FW_VI_CMD_ALLOC 31
991 #define M_FW_VI_CMD_ALLOC 0x1
992 #define V_FW_VI_CMD_ALLOC(x) ((x) << S_FW_VI_CMD_ALLOC)
993 #define G_FW_VI_CMD_ALLOC(x) \
994 (((x) >> S_FW_VI_CMD_ALLOC) & M_FW_VI_CMD_ALLOC)
995 #define F_FW_VI_CMD_ALLOC V_FW_VI_CMD_ALLOC(1U)
997 #define S_FW_VI_CMD_FREE 30
998 #define M_FW_VI_CMD_FREE 0x1
999 #define V_FW_VI_CMD_FREE(x) ((x) << S_FW_VI_CMD_FREE)
1000 #define G_FW_VI_CMD_FREE(x) (((x) >> S_FW_VI_CMD_FREE) & M_FW_VI_CMD_FREE)
1001 #define F_FW_VI_CMD_FREE V_FW_VI_CMD_FREE(1U)
1003 #define S_FW_VI_CMD_TYPE 15
1004 #define M_FW_VI_CMD_TYPE 0x1
1005 #define V_FW_VI_CMD_TYPE(x) ((x) << S_FW_VI_CMD_TYPE)
1006 #define G_FW_VI_CMD_TYPE(x) (((x) >> S_FW_VI_CMD_TYPE) & M_FW_VI_CMD_TYPE)
1007 #define F_FW_VI_CMD_TYPE V_FW_VI_CMD_TYPE(1U)
1009 #define S_FW_VI_CMD_FUNC 12
1010 #define M_FW_VI_CMD_FUNC 0x7
1011 #define V_FW_VI_CMD_FUNC(x) ((x) << S_FW_VI_CMD_FUNC)
1012 #define G_FW_VI_CMD_FUNC(x) (((x) >> S_FW_VI_CMD_FUNC) & M_FW_VI_CMD_FUNC)
1014 #define S_FW_VI_CMD_VIID 0
1015 #define M_FW_VI_CMD_VIID 0xfff
1016 #define V_FW_VI_CMD_VIID(x) ((x) << S_FW_VI_CMD_VIID)
1017 #define G_FW_VI_CMD_VIID(x) (((x) >> S_FW_VI_CMD_VIID) & M_FW_VI_CMD_VIID)
1019 #define S_FW_VI_CMD_PORTID 4
1020 #define M_FW_VI_CMD_PORTID 0xf
1021 #define V_FW_VI_CMD_PORTID(x) ((x) << S_FW_VI_CMD_PORTID)
1022 #define G_FW_VI_CMD_PORTID(x) \
1023 (((x) >> S_FW_VI_CMD_PORTID) & M_FW_VI_CMD_PORTID)
1025 #define S_FW_VI_CMD_RSSSIZE 0
1026 #define M_FW_VI_CMD_RSSSIZE 0x7ff
1027 #define V_FW_VI_CMD_RSSSIZE(x) ((x) << S_FW_VI_CMD_RSSSIZE)
1028 #define G_FW_VI_CMD_RSSSIZE(x) \
1029 (((x) >> S_FW_VI_CMD_RSSSIZE) & M_FW_VI_CMD_RSSSIZE)
1031 /* Special VI_MAC command index ids */
1032 #define FW_VI_MAC_ADD_MAC 0x3FF
1033 #define FW_VI_MAC_ADD_PERSIST_MAC 0x3FE
1035 enum fw_vi_mac_smac {
1036 FW_VI_MAC_MPS_TCAM_ENTRY,
1037 FW_VI_MAC_SMT_AND_MPSTCAM
1040 struct fw_vi_mac_cmd {
1042 __be32 freemacs_to_len16;
1044 struct fw_vi_mac_exact {
1045 __be16 valid_to_idx;
1048 struct fw_vi_mac_hash {
1054 #define S_FW_VI_MAC_CMD_VIID 0
1055 #define M_FW_VI_MAC_CMD_VIID 0xfff
1056 #define V_FW_VI_MAC_CMD_VIID(x) ((x) << S_FW_VI_MAC_CMD_VIID)
1057 #define G_FW_VI_MAC_CMD_VIID(x) \
1058 (((x) >> S_FW_VI_MAC_CMD_VIID) & M_FW_VI_MAC_CMD_VIID)
1060 #define S_FW_VI_MAC_CMD_VALID 15
1061 #define M_FW_VI_MAC_CMD_VALID 0x1
1062 #define V_FW_VI_MAC_CMD_VALID(x) ((x) << S_FW_VI_MAC_CMD_VALID)
1063 #define G_FW_VI_MAC_CMD_VALID(x) \
1064 (((x) >> S_FW_VI_MAC_CMD_VALID) & M_FW_VI_MAC_CMD_VALID)
1065 #define F_FW_VI_MAC_CMD_VALID V_FW_VI_MAC_CMD_VALID(1U)
1067 #define S_FW_VI_MAC_CMD_SMAC_RESULT 10
1068 #define M_FW_VI_MAC_CMD_SMAC_RESULT 0x3
1069 #define V_FW_VI_MAC_CMD_SMAC_RESULT(x) ((x) << S_FW_VI_MAC_CMD_SMAC_RESULT)
1070 #define G_FW_VI_MAC_CMD_SMAC_RESULT(x) \
1071 (((x) >> S_FW_VI_MAC_CMD_SMAC_RESULT) & M_FW_VI_MAC_CMD_SMAC_RESULT)
1073 #define S_FW_VI_MAC_CMD_IDX 0
1074 #define M_FW_VI_MAC_CMD_IDX 0x3ff
1075 #define V_FW_VI_MAC_CMD_IDX(x) ((x) << S_FW_VI_MAC_CMD_IDX)
1076 #define G_FW_VI_MAC_CMD_IDX(x) \
1077 (((x) >> S_FW_VI_MAC_CMD_IDX) & M_FW_VI_MAC_CMD_IDX)
1079 struct fw_vi_rxmode_cmd {
1081 __be32 retval_len16;
1082 __be32 mtu_to_vlanexen;
1086 #define S_FW_VI_RXMODE_CMD_VIID 0
1087 #define M_FW_VI_RXMODE_CMD_VIID 0xfff
1088 #define V_FW_VI_RXMODE_CMD_VIID(x) ((x) << S_FW_VI_RXMODE_CMD_VIID)
1089 #define G_FW_VI_RXMODE_CMD_VIID(x) \
1090 (((x) >> S_FW_VI_RXMODE_CMD_VIID) & M_FW_VI_RXMODE_CMD_VIID)
1092 #define S_FW_VI_RXMODE_CMD_MTU 16
1093 #define M_FW_VI_RXMODE_CMD_MTU 0xffff
1094 #define V_FW_VI_RXMODE_CMD_MTU(x) ((x) << S_FW_VI_RXMODE_CMD_MTU)
1095 #define G_FW_VI_RXMODE_CMD_MTU(x) \
1096 (((x) >> S_FW_VI_RXMODE_CMD_MTU) & M_FW_VI_RXMODE_CMD_MTU)
1098 #define S_FW_VI_RXMODE_CMD_PROMISCEN 14
1099 #define M_FW_VI_RXMODE_CMD_PROMISCEN 0x3
1100 #define V_FW_VI_RXMODE_CMD_PROMISCEN(x) ((x) << S_FW_VI_RXMODE_CMD_PROMISCEN)
1101 #define G_FW_VI_RXMODE_CMD_PROMISCEN(x) \
1102 (((x) >> S_FW_VI_RXMODE_CMD_PROMISCEN) & M_FW_VI_RXMODE_CMD_PROMISCEN)
1104 #define S_FW_VI_RXMODE_CMD_ALLMULTIEN 12
1105 #define M_FW_VI_RXMODE_CMD_ALLMULTIEN 0x3
1106 #define V_FW_VI_RXMODE_CMD_ALLMULTIEN(x) \
1107 ((x) << S_FW_VI_RXMODE_CMD_ALLMULTIEN)
1108 #define G_FW_VI_RXMODE_CMD_ALLMULTIEN(x) \
1109 (((x) >> S_FW_VI_RXMODE_CMD_ALLMULTIEN) & M_FW_VI_RXMODE_CMD_ALLMULTIEN)
1111 #define S_FW_VI_RXMODE_CMD_BROADCASTEN 10
1112 #define M_FW_VI_RXMODE_CMD_BROADCASTEN 0x3
1113 #define V_FW_VI_RXMODE_CMD_BROADCASTEN(x) \
1114 ((x) << S_FW_VI_RXMODE_CMD_BROADCASTEN)
1115 #define G_FW_VI_RXMODE_CMD_BROADCASTEN(x) \
1116 (((x) >> S_FW_VI_RXMODE_CMD_BROADCASTEN) & \
1117 M_FW_VI_RXMODE_CMD_BROADCASTEN)
1119 #define S_FW_VI_RXMODE_CMD_VLANEXEN 8
1120 #define M_FW_VI_RXMODE_CMD_VLANEXEN 0x3
1121 #define V_FW_VI_RXMODE_CMD_VLANEXEN(x) ((x) << S_FW_VI_RXMODE_CMD_VLANEXEN)
1122 #define G_FW_VI_RXMODE_CMD_VLANEXEN(x) \
1123 (((x) >> S_FW_VI_RXMODE_CMD_VLANEXEN) & M_FW_VI_RXMODE_CMD_VLANEXEN)
1125 struct fw_vi_enable_cmd {
1127 __be32 ien_to_len16;
1133 #define S_FW_VI_ENABLE_CMD_VIID 0
1134 #define M_FW_VI_ENABLE_CMD_VIID 0xfff
1135 #define V_FW_VI_ENABLE_CMD_VIID(x) ((x) << S_FW_VI_ENABLE_CMD_VIID)
1136 #define G_FW_VI_ENABLE_CMD_VIID(x) \
1137 (((x) >> S_FW_VI_ENABLE_CMD_VIID) & M_FW_VI_ENABLE_CMD_VIID)
1139 #define S_FW_VI_ENABLE_CMD_IEN 31
1140 #define M_FW_VI_ENABLE_CMD_IEN 0x1
1141 #define V_FW_VI_ENABLE_CMD_IEN(x) ((x) << S_FW_VI_ENABLE_CMD_IEN)
1142 #define G_FW_VI_ENABLE_CMD_IEN(x) \
1143 (((x) >> S_FW_VI_ENABLE_CMD_IEN) & M_FW_VI_ENABLE_CMD_IEN)
1144 #define F_FW_VI_ENABLE_CMD_IEN V_FW_VI_ENABLE_CMD_IEN(1U)
1146 #define S_FW_VI_ENABLE_CMD_EEN 30
1147 #define M_FW_VI_ENABLE_CMD_EEN 0x1
1148 #define V_FW_VI_ENABLE_CMD_EEN(x) ((x) << S_FW_VI_ENABLE_CMD_EEN)
1149 #define G_FW_VI_ENABLE_CMD_EEN(x) \
1150 (((x) >> S_FW_VI_ENABLE_CMD_EEN) & M_FW_VI_ENABLE_CMD_EEN)
1151 #define F_FW_VI_ENABLE_CMD_EEN V_FW_VI_ENABLE_CMD_EEN(1U)
1153 #define S_FW_VI_ENABLE_CMD_DCB_INFO 28
1154 #define M_FW_VI_ENABLE_CMD_DCB_INFO 0x1
1155 #define V_FW_VI_ENABLE_CMD_DCB_INFO(x) ((x) << S_FW_VI_ENABLE_CMD_DCB_INFO)
1156 #define G_FW_VI_ENABLE_CMD_DCB_INFO(x) \
1157 (((x) >> S_FW_VI_ENABLE_CMD_DCB_INFO) & M_FW_VI_ENABLE_CMD_DCB_INFO)
1158 #define F_FW_VI_ENABLE_CMD_DCB_INFO V_FW_VI_ENABLE_CMD_DCB_INFO(1U)
1160 /* VI PF stats offset definitions */
1161 #define VI_PF_NUM_STATS 17
1162 enum fw_vi_stats_pf_index {
1163 FW_VI_PF_STAT_TX_BCAST_BYTES_IX,
1164 FW_VI_PF_STAT_TX_BCAST_FRAMES_IX,
1165 FW_VI_PF_STAT_TX_MCAST_BYTES_IX,
1166 FW_VI_PF_STAT_TX_MCAST_FRAMES_IX,
1167 FW_VI_PF_STAT_TX_UCAST_BYTES_IX,
1168 FW_VI_PF_STAT_TX_UCAST_FRAMES_IX,
1169 FW_VI_PF_STAT_TX_OFLD_BYTES_IX,
1170 FW_VI_PF_STAT_TX_OFLD_FRAMES_IX,
1171 FW_VI_PF_STAT_RX_BYTES_IX,
1172 FW_VI_PF_STAT_RX_FRAMES_IX,
1173 FW_VI_PF_STAT_RX_BCAST_BYTES_IX,
1174 FW_VI_PF_STAT_RX_BCAST_FRAMES_IX,
1175 FW_VI_PF_STAT_RX_MCAST_BYTES_IX,
1176 FW_VI_PF_STAT_RX_MCAST_FRAMES_IX,
1177 FW_VI_PF_STAT_RX_UCAST_BYTES_IX,
1178 FW_VI_PF_STAT_RX_UCAST_FRAMES_IX,
1179 FW_VI_PF_STAT_RX_ERR_FRAMES_IX
1182 struct fw_vi_stats_cmd {
1184 __be32 retval_len16;
1186 struct fw_vi_stats_ctl {
1197 struct fw_vi_stats_pf {
1198 __be64 tx_bcast_bytes;
1199 __be64 tx_bcast_frames;
1200 __be64 tx_mcast_bytes;
1201 __be64 tx_mcast_frames;
1202 __be64 tx_ucast_bytes;
1203 __be64 tx_ucast_frames;
1204 __be64 tx_offload_bytes;
1205 __be64 tx_offload_frames;
1207 __be64 rx_pf_frames;
1208 __be64 rx_bcast_bytes;
1209 __be64 rx_bcast_frames;
1210 __be64 rx_mcast_bytes;
1211 __be64 rx_mcast_frames;
1212 __be64 rx_ucast_bytes;
1213 __be64 rx_ucast_frames;
1214 __be64 rx_err_frames;
1216 struct fw_vi_stats_vf {
1217 __be64 tx_bcast_bytes;
1218 __be64 tx_bcast_frames;
1219 __be64 tx_mcast_bytes;
1220 __be64 tx_mcast_frames;
1221 __be64 tx_ucast_bytes;
1222 __be64 tx_ucast_frames;
1223 __be64 tx_drop_frames;
1224 __be64 tx_offload_bytes;
1225 __be64 tx_offload_frames;
1226 __be64 rx_bcast_bytes;
1227 __be64 rx_bcast_frames;
1228 __be64 rx_mcast_bytes;
1229 __be64 rx_mcast_frames;
1230 __be64 rx_ucast_bytes;
1231 __be64 rx_ucast_frames;
1232 __be64 rx_err_frames;
1237 /* old 16-bit port capabilities bitmap */
1239 FW_PORT_CAP_SPEED_100M = 0x0001,
1240 FW_PORT_CAP_SPEED_1G = 0x0002,
1241 FW_PORT_CAP_SPEED_25G = 0x0004,
1242 FW_PORT_CAP_SPEED_10G = 0x0008,
1243 FW_PORT_CAP_SPEED_40G = 0x0010,
1244 FW_PORT_CAP_SPEED_100G = 0x0020,
1245 FW_PORT_CAP_FC_RX = 0x0040,
1246 FW_PORT_CAP_FC_TX = 0x0080,
1247 FW_PORT_CAP_ANEG = 0x0100,
1248 FW_PORT_CAP_MDIX = 0x0200,
1249 FW_PORT_CAP_MDIAUTO = 0x0400,
1250 FW_PORT_CAP_FEC_RS = 0x0800,
1251 FW_PORT_CAP_FEC_BASER_RS = 0x1000,
1252 FW_PORT_CAP_FEC_RESERVED = 0x2000,
1253 FW_PORT_CAP_802_3_PAUSE = 0x4000,
1254 FW_PORT_CAP_802_3_ASM_DIR = 0x8000,
1257 #define S_FW_PORT_CAP_SPEED 0
1258 #define M_FW_PORT_CAP_SPEED 0x3f
1259 #define V_FW_PORT_CAP_SPEED(x) ((x) << S_FW_PORT_CAP_SPEED)
1260 #define G_FW_PORT_CAP_SPEED(x) \
1261 (((x) >> S_FW_PORT_CAP_SPEED) & M_FW_PORT_CAP_SPEED)
1264 FW_PORT_CAP_MDI_AUTO,
1267 #define S_FW_PORT_CAP_MDI 9
1268 #define M_FW_PORT_CAP_MDI 3
1269 #define V_FW_PORT_CAP_MDI(x) ((x) << S_FW_PORT_CAP_MDI)
1270 #define G_FW_PORT_CAP_MDI(x) (((x) >> S_FW_PORT_CAP_MDI) & M_FW_PORT_CAP_MDI)
1272 /* new 32-bit port capabilities bitmap (fw_port_cap32_t) */
1273 #define FW_PORT_CAP32_SPEED_100M 0x00000001UL
1274 #define FW_PORT_CAP32_SPEED_1G 0x00000002UL
1275 #define FW_PORT_CAP32_SPEED_10G 0x00000004UL
1276 #define FW_PORT_CAP32_SPEED_25G 0x00000008UL
1277 #define FW_PORT_CAP32_SPEED_40G 0x00000010UL
1278 #define FW_PORT_CAP32_SPEED_50G 0x00000020UL
1279 #define FW_PORT_CAP32_SPEED_100G 0x00000040UL
1280 #define FW_PORT_CAP32_FC_RX 0x00010000UL
1281 #define FW_PORT_CAP32_FC_TX 0x00020000UL
1282 #define FW_PORT_CAP32_802_3_PAUSE 0x00040000UL
1283 #define FW_PORT_CAP32_802_3_ASM_DIR 0x00080000UL
1284 #define FW_PORT_CAP32_ANEG 0x00100000UL
1285 #define FW_PORT_CAP32_MDIX 0x00200000UL
1286 #define FW_PORT_CAP32_MDIAUTO 0x00400000UL
1287 #define FW_PORT_CAP32_FEC_RS 0x00800000UL
1288 #define FW_PORT_CAP32_FEC_BASER_RS 0x01000000UL
1290 #define S_FW_PORT_CAP32_SPEED 0
1291 #define M_FW_PORT_CAP32_SPEED 0xfff
1292 #define V_FW_PORT_CAP32_SPEED(x) ((x) << S_FW_PORT_CAP32_SPEED)
1293 #define G_FW_PORT_CAP32_SPEED(x) \
1294 (((x) >> S_FW_PORT_CAP32_SPEED) & M_FW_PORT_CAP32_SPEED)
1296 enum fw_port_mdi32 {
1297 FW_PORT_CAP32_MDI_AUTO,
1300 #define S_FW_PORT_CAP32_MDI 21
1301 #define M_FW_PORT_CAP32_MDI 3
1302 #define V_FW_PORT_CAP32_MDI(x) ((x) << S_FW_PORT_CAP32_MDI)
1303 #define G_FW_PORT_CAP32_MDI(x) \
1304 (((x) >> S_FW_PORT_CAP32_MDI) & M_FW_PORT_CAP32_MDI)
1306 enum fw_port_action {
1307 FW_PORT_ACTION_L1_CFG = 0x0001,
1308 FW_PORT_ACTION_GET_PORT_INFO = 0x0003,
1309 FW_PORT_ACTION_L1_CFG32 = 0x0009,
1310 FW_PORT_ACTION_GET_PORT_INFO32 = 0x000a,
1313 struct fw_port_cmd {
1314 __be32 op_to_portid;
1315 __be32 action_to_len16;
1317 struct fw_port_l1cfg {
1321 struct fw_port_l2cfg {
1323 __u8 ovlan3_to_ivlan0;
1325 __be16 txipg_force_pinfo;
1336 struct fw_port_info {
1337 __be32 lstatus_to_modtype;
1348 struct fw_port_diags {
1354 struct fw_port_dcb_pgid {
1361 struct fw_port_dcb_pgrate {
1365 __u8 num_tcs_supported;
1369 struct fw_port_dcb_priorate {
1373 __u8 strict_priorate[8];
1375 struct fw_port_dcb_pfc {
1382 struct fw_port_app_priority {
1391 struct fw_port_dcb_control {
1394 __be16 dcb_version_to_app_state;
1399 struct fw_port_l1cfg32 {
1403 struct fw_port_info32 {
1404 __be32 lstatus32_to_cbllen32;
1405 __be32 auxlinfo32_mtu32;
1414 #define S_FW_PORT_CMD_PORTID 0
1415 #define M_FW_PORT_CMD_PORTID 0xf
1416 #define V_FW_PORT_CMD_PORTID(x) ((x) << S_FW_PORT_CMD_PORTID)
1417 #define G_FW_PORT_CMD_PORTID(x) \
1418 (((x) >> S_FW_PORT_CMD_PORTID) & M_FW_PORT_CMD_PORTID)
1420 #define S_FW_PORT_CMD_ACTION 16
1421 #define M_FW_PORT_CMD_ACTION 0xffff
1422 #define V_FW_PORT_CMD_ACTION(x) ((x) << S_FW_PORT_CMD_ACTION)
1423 #define G_FW_PORT_CMD_ACTION(x) \
1424 (((x) >> S_FW_PORT_CMD_ACTION) & M_FW_PORT_CMD_ACTION)
1426 #define S_FW_PORT_CMD_LSTATUS 31
1427 #define M_FW_PORT_CMD_LSTATUS 0x1
1428 #define V_FW_PORT_CMD_LSTATUS(x) ((x) << S_FW_PORT_CMD_LSTATUS)
1429 #define G_FW_PORT_CMD_LSTATUS(x) \
1430 (((x) >> S_FW_PORT_CMD_LSTATUS) & M_FW_PORT_CMD_LSTATUS)
1431 #define F_FW_PORT_CMD_LSTATUS V_FW_PORT_CMD_LSTATUS(1U)
1433 #define S_FW_PORT_CMD_LSPEED 24
1434 #define M_FW_PORT_CMD_LSPEED 0x3f
1435 #define V_FW_PORT_CMD_LSPEED(x) ((x) << S_FW_PORT_CMD_LSPEED)
1436 #define G_FW_PORT_CMD_LSPEED(x) \
1437 (((x) >> S_FW_PORT_CMD_LSPEED) & M_FW_PORT_CMD_LSPEED)
1439 #define S_FW_PORT_CMD_TXPAUSE 23
1440 #define M_FW_PORT_CMD_TXPAUSE 0x1
1441 #define V_FW_PORT_CMD_TXPAUSE(x) ((x) << S_FW_PORT_CMD_TXPAUSE)
1442 #define G_FW_PORT_CMD_TXPAUSE(x) \
1443 (((x) >> S_FW_PORT_CMD_TXPAUSE) & M_FW_PORT_CMD_TXPAUSE)
1444 #define F_FW_PORT_CMD_TXPAUSE V_FW_PORT_CMD_TXPAUSE(1U)
1446 #define S_FW_PORT_CMD_RXPAUSE 22
1447 #define M_FW_PORT_CMD_RXPAUSE 0x1
1448 #define V_FW_PORT_CMD_RXPAUSE(x) ((x) << S_FW_PORT_CMD_RXPAUSE)
1449 #define G_FW_PORT_CMD_RXPAUSE(x) \
1450 (((x) >> S_FW_PORT_CMD_RXPAUSE) & M_FW_PORT_CMD_RXPAUSE)
1451 #define F_FW_PORT_CMD_RXPAUSE V_FW_PORT_CMD_RXPAUSE(1U)
1453 #define S_FW_PORT_CMD_MDIOCAP 21
1454 #define M_FW_PORT_CMD_MDIOCAP 0x1
1455 #define V_FW_PORT_CMD_MDIOCAP(x) ((x) << S_FW_PORT_CMD_MDIOCAP)
1456 #define G_FW_PORT_CMD_MDIOCAP(x) \
1457 (((x) >> S_FW_PORT_CMD_MDIOCAP) & M_FW_PORT_CMD_MDIOCAP)
1458 #define F_FW_PORT_CMD_MDIOCAP V_FW_PORT_CMD_MDIOCAP(1U)
1460 #define S_FW_PORT_CMD_MDIOADDR 16
1461 #define M_FW_PORT_CMD_MDIOADDR 0x1f
1462 #define V_FW_PORT_CMD_MDIOADDR(x) ((x) << S_FW_PORT_CMD_MDIOADDR)
1463 #define G_FW_PORT_CMD_MDIOADDR(x) \
1464 (((x) >> S_FW_PORT_CMD_MDIOADDR) & M_FW_PORT_CMD_MDIOADDR)
1466 #define S_FW_PORT_CMD_PTYPE 8
1467 #define M_FW_PORT_CMD_PTYPE 0x1f
1468 #define V_FW_PORT_CMD_PTYPE(x) ((x) << S_FW_PORT_CMD_PTYPE)
1469 #define G_FW_PORT_CMD_PTYPE(x) \
1470 (((x) >> S_FW_PORT_CMD_PTYPE) & M_FW_PORT_CMD_PTYPE)
1472 #define S_FW_PORT_CMD_LINKDNRC 5
1473 #define M_FW_PORT_CMD_LINKDNRC 0x7
1474 #define V_FW_PORT_CMD_LINKDNRC(x) ((x) << S_FW_PORT_CMD_LINKDNRC)
1475 #define G_FW_PORT_CMD_LINKDNRC(x) \
1476 (((x) >> S_FW_PORT_CMD_LINKDNRC) & M_FW_PORT_CMD_LINKDNRC)
1478 #define S_FW_PORT_CMD_MODTYPE 0
1479 #define M_FW_PORT_CMD_MODTYPE 0x1f
1480 #define V_FW_PORT_CMD_MODTYPE(x) ((x) << S_FW_PORT_CMD_MODTYPE)
1481 #define G_FW_PORT_CMD_MODTYPE(x) \
1482 (((x) >> S_FW_PORT_CMD_MODTYPE) & M_FW_PORT_CMD_MODTYPE)
1484 #define S_FW_PORT_CMD_LSTATUS32 31
1485 #define M_FW_PORT_CMD_LSTATUS32 0x1
1486 #define V_FW_PORT_CMD_LSTATUS32(x) ((x) << S_FW_PORT_CMD_LSTATUS32)
1487 #define F_FW_PORT_CMD_LSTATUS32 V_FW_PORT_CMD_LSTATUS32(1U)
1489 #define S_FW_PORT_CMD_LINKDNRC32 28
1490 #define M_FW_PORT_CMD_LINKDNRC32 0x7
1491 #define G_FW_PORT_CMD_LINKDNRC32(x) \
1492 (((x) >> S_FW_PORT_CMD_LINKDNRC32) & M_FW_PORT_CMD_LINKDNRC32)
1494 #define S_FW_PORT_CMD_MDIOCAP32 26
1495 #define M_FW_PORT_CMD_MDIOCAP32 0x1
1496 #define V_FW_PORT_CMD_MDIOCAP32(x) ((x) << S_FW_PORT_CMD_MDIOCAP32)
1497 #define F_FW_PORT_CMD_MDIOCAP32 V_FW_PORT_CMD_MDIOCAP32(1U)
1499 #define S_FW_PORT_CMD_MDIOADDR32 21
1500 #define M_FW_PORT_CMD_MDIOADDR32 0x1f
1501 #define G_FW_PORT_CMD_MDIOADDR32(x) \
1502 (((x) >> S_FW_PORT_CMD_MDIOADDR32) & M_FW_PORT_CMD_MDIOADDR32)
1504 #define S_FW_PORT_CMD_PORTTYPE32 13
1505 #define M_FW_PORT_CMD_PORTTYPE32 0xff
1506 #define G_FW_PORT_CMD_PORTTYPE32(x) \
1507 (((x) >> S_FW_PORT_CMD_PORTTYPE32) & M_FW_PORT_CMD_PORTTYPE32)
1509 #define S_FW_PORT_CMD_MODTYPE32 8
1510 #define M_FW_PORT_CMD_MODTYPE32 0x1f
1511 #define G_FW_PORT_CMD_MODTYPE32(x) \
1512 (((x) >> S_FW_PORT_CMD_MODTYPE32) & M_FW_PORT_CMD_MODTYPE32)
1515 * These are configured into the VPD and hence tools that generate
1516 * VPD may use this enumeration.
1517 * extPHY #lanes T4_I2C extI2C BP_Eq BP_ANEG Speed
1520 * Update the Common Code t4_hw.c:t4_get_port_type_description()
1521 * with any new Firmware Port Technology Types!
1524 FW_PORT_TYPE_FIBER_XFI = 0, /* Y, 1, N, Y, N, N, 10G */
1525 FW_PORT_TYPE_FIBER_XAUI = 1, /* Y, 4, N, Y, N, N, 10G */
1526 FW_PORT_TYPE_BT_SGMII = 2, /* Y, 1, No, No, No, No, 1G/100M */
1527 FW_PORT_TYPE_BT_XFI = 3, /* Y, 1, No, No, No, No, 10G */
1528 FW_PORT_TYPE_BT_XAUI = 4, /* Y, 4, No, No, No, No, 10G/1G/100M? */
1529 FW_PORT_TYPE_KX4 = 5, /* No, 4, No, No, Yes, Yes, 10G */
1530 FW_PORT_TYPE_CX4 = 6, /* No, 4, No, No, No, No, 10G */
1531 FW_PORT_TYPE_KX = 7, /* No, 1, No, No, Yes, No, 1G */
1532 FW_PORT_TYPE_KR = 8, /* No, 1, No, No, Yes, Yes, 10G */
1533 FW_PORT_TYPE_SFP = 9, /* No, 1, Yes, No, No, No, 10G */
1534 FW_PORT_TYPE_BP_AP = 10,
1535 /* No, 1, No, No, Yes, Yes, 10G, BP ANGE */
1536 FW_PORT_TYPE_BP4_AP = 11,
1537 /* No, 4, No, No, Yes, Yes, 10G, BP ANGE */
1538 FW_PORT_TYPE_QSFP_10G = 12, /* No, 1, Yes, No, No, No, 10G */
1539 FW_PORT_TYPE_QSA = 13, /* No, 1, Yes, No, No, No, 10G */
1540 FW_PORT_TYPE_QSFP = 14, /* No, 4, Yes, No, No, No, 40G */
1541 FW_PORT_TYPE_BP40_BA = 15,
1542 /* No, 4, No, No, Yes, Yes, 40G/10G/1G, BP ANGE */
1543 FW_PORT_TYPE_KR4_100G = 16, /* No, 4, 100G/40G/25G, Backplane */
1544 FW_PORT_TYPE_CR4_QSFP = 17, /* No, 4, 100G/40G/25G */
1545 FW_PORT_TYPE_CR_QSFP = 18, /* No, 1, 25G Spider cable */
1546 FW_PORT_TYPE_CR2_QSFP = 19, /* No, 2, 50G */
1547 FW_PORT_TYPE_SFP28 = 20, /* No, 1, 25G/10G/1G */
1548 FW_PORT_TYPE_KR_SFP28 = 21, /* No, 1, 25G/10G/1G using Backplane */
1549 FW_PORT_TYPE_NONE = M_FW_PORT_CMD_PTYPE
1552 /* These are read from module's EEPROM and determined once the
1553 * module is inserted.
1555 enum fw_port_module_type {
1556 FW_PORT_MOD_TYPE_NA = 0x0,
1557 FW_PORT_MOD_TYPE_LR = 0x1,
1558 FW_PORT_MOD_TYPE_SR = 0x2,
1559 FW_PORT_MOD_TYPE_ER = 0x3,
1560 FW_PORT_MOD_TYPE_TWINAX_PASSIVE = 0x4,
1561 FW_PORT_MOD_TYPE_TWINAX_ACTIVE = 0x5,
1562 FW_PORT_MOD_TYPE_LRM = 0x6,
1563 FW_PORT_MOD_TYPE_ERROR = M_FW_PORT_CMD_MODTYPE - 3,
1564 FW_PORT_MOD_TYPE_UNKNOWN = M_FW_PORT_CMD_MODTYPE - 2,
1565 FW_PORT_MOD_TYPE_NOTSUPPORTED = M_FW_PORT_CMD_MODTYPE - 1,
1566 FW_PORT_MOD_TYPE_NONE = M_FW_PORT_CMD_MODTYPE
1569 /* used by FW and tools may use this to generate VPD */
1570 enum fw_port_mod_sub_type {
1571 FW_PORT_MOD_SUB_TYPE_NA,
1572 FW_PORT_MOD_SUB_TYPE_MV88E114X = 0x1,
1573 FW_PORT_MOD_SUB_TYPE_TN8022 = 0x2,
1574 FW_PORT_MOD_SUB_TYPE_AQ1202 = 0x3,
1575 FW_PORT_MOD_SUB_TYPE_88x3120 = 0x4,
1576 FW_PORT_MOD_SUB_TYPE_BCM84834 = 0x5,
1577 FW_PORT_MOD_SUB_TYPE_BCM5482 = 0x6,
1578 FW_PORT_MOD_SUB_TYPE_BCM84856 = 0x7,
1579 FW_PORT_MOD_SUB_TYPE_BT_VSC8634 = 0x8,
1582 * The following will never been in the VPD. They are TWINAX cable
1583 * lengths decoded from SFP+ module i2c PROMs. These should almost
1584 * certainly go somewhere else ...
1586 FW_PORT_MOD_SUB_TYPE_TWINAX_1 = 0x9,
1587 FW_PORT_MOD_SUB_TYPE_TWINAX_3 = 0xA,
1588 FW_PORT_MOD_SUB_TYPE_TWINAX_5 = 0xB,
1589 FW_PORT_MOD_SUB_TYPE_TWINAX_7 = 0xC,
1592 /* link down reason codes (3b) */
1593 enum fw_port_link_dn_rc {
1594 FW_PORT_LINK_DN_RC_NONE,
1595 FW_PORT_LINK_DN_RC_REMFLT, /* Remote fault detected */
1596 FW_PORT_LINK_DN_ANEG_F, /* Auto-negotiation fault */
1597 FW_PORT_LINK_DN_RESERVED3,
1598 FW_PORT_LINK_DN_OVERHEAT, /* Port overheated */
1599 FW_PORT_LINK_DN_UNKNOWN, /* Unable to determine reason */
1600 FW_PORT_LINK_DN_RX_LOS, /* No RX signal detected */
1601 FW_PORT_LINK_DN_RESERVED7
1605 #define FW_NUM_PORT_STATS 50
1606 #define FW_NUM_PORT_TX_STATS 23
1607 #define FW_NUM_PORT_RX_STATS 27
1609 enum fw_port_stats_tx_index {
1610 FW_STAT_TX_PORT_BYTES_IX,
1611 FW_STAT_TX_PORT_FRAMES_IX,
1612 FW_STAT_TX_PORT_BCAST_IX,
1613 FW_STAT_TX_PORT_MCAST_IX,
1614 FW_STAT_TX_PORT_UCAST_IX,
1615 FW_STAT_TX_PORT_ERROR_IX,
1616 FW_STAT_TX_PORT_64B_IX,
1617 FW_STAT_TX_PORT_65B_127B_IX,
1618 FW_STAT_TX_PORT_128B_255B_IX,
1619 FW_STAT_TX_PORT_256B_511B_IX,
1620 FW_STAT_TX_PORT_512B_1023B_IX,
1621 FW_STAT_TX_PORT_1024B_1518B_IX,
1622 FW_STAT_TX_PORT_1519B_MAX_IX,
1623 FW_STAT_TX_PORT_DROP_IX,
1624 FW_STAT_TX_PORT_PAUSE_IX,
1625 FW_STAT_TX_PORT_PPP0_IX,
1626 FW_STAT_TX_PORT_PPP1_IX,
1627 FW_STAT_TX_PORT_PPP2_IX,
1628 FW_STAT_TX_PORT_PPP3_IX,
1629 FW_STAT_TX_PORT_PPP4_IX,
1630 FW_STAT_TX_PORT_PPP5_IX,
1631 FW_STAT_TX_PORT_PPP6_IX,
1632 FW_STAT_TX_PORT_PPP7_IX
1635 enum fw_port_stat_rx_index {
1636 FW_STAT_RX_PORT_BYTES_IX,
1637 FW_STAT_RX_PORT_FRAMES_IX,
1638 FW_STAT_RX_PORT_BCAST_IX,
1639 FW_STAT_RX_PORT_MCAST_IX,
1640 FW_STAT_RX_PORT_UCAST_IX,
1641 FW_STAT_RX_PORT_MTU_ERROR_IX,
1642 FW_STAT_RX_PORT_MTU_CRC_ERROR_IX,
1643 FW_STAT_RX_PORT_CRC_ERROR_IX,
1644 FW_STAT_RX_PORT_LEN_ERROR_IX,
1645 FW_STAT_RX_PORT_SYM_ERROR_IX,
1646 FW_STAT_RX_PORT_64B_IX,
1647 FW_STAT_RX_PORT_65B_127B_IX,
1648 FW_STAT_RX_PORT_128B_255B_IX,
1649 FW_STAT_RX_PORT_256B_511B_IX,
1650 FW_STAT_RX_PORT_512B_1023B_IX,
1651 FW_STAT_RX_PORT_1024B_1518B_IX,
1652 FW_STAT_RX_PORT_1519B_MAX_IX,
1653 FW_STAT_RX_PORT_PAUSE_IX,
1654 FW_STAT_RX_PORT_PPP0_IX,
1655 FW_STAT_RX_PORT_PPP1_IX,
1656 FW_STAT_RX_PORT_PPP2_IX,
1657 FW_STAT_RX_PORT_PPP3_IX,
1658 FW_STAT_RX_PORT_PPP4_IX,
1659 FW_STAT_RX_PORT_PPP5_IX,
1660 FW_STAT_RX_PORT_PPP6_IX,
1661 FW_STAT_RX_PORT_PPP7_IX,
1662 FW_STAT_RX_PORT_LESS_64B_IX
1665 struct fw_port_stats_cmd {
1666 __be32 op_to_portid;
1667 __be32 retval_len16;
1668 union fw_port_stats {
1669 struct fw_port_stats_ctl {
1681 struct fw_port_stats_all {
1690 __be64 tx_128b_255b;
1691 __be64 tx_256b_511b;
1692 __be64 tx_512b_1023b;
1693 __be64 tx_1024b_1518b;
1694 __be64 tx_1519b_max;
1710 __be64 rx_mtu_error;
1711 __be64 rx_mtu_crc_error;
1712 __be64 rx_crc_error;
1713 __be64 rx_len_error;
1714 __be64 rx_sym_error;
1717 __be64 rx_128b_255b;
1718 __be64 rx_256b_511b;
1719 __be64 rx_512b_1023b;
1720 __be64 rx_1024b_1518b;
1721 __be64 rx_1519b_max;
1738 struct fw_rss_ind_tbl_cmd {
1740 __be32 retval_len16;
1748 __be32 iq12_to_iq14;
1749 __be32 iq15_to_iq17;
1750 __be32 iq18_to_iq20;
1751 __be32 iq21_to_iq23;
1752 __be32 iq24_to_iq26;
1753 __be32 iq27_to_iq29;
1758 #define S_FW_RSS_IND_TBL_CMD_VIID 0
1759 #define M_FW_RSS_IND_TBL_CMD_VIID 0xfff
1760 #define V_FW_RSS_IND_TBL_CMD_VIID(x) ((x) << S_FW_RSS_IND_TBL_CMD_VIID)
1761 #define G_FW_RSS_IND_TBL_CMD_VIID(x) \
1762 (((x) >> S_FW_RSS_IND_TBL_CMD_VIID) & M_FW_RSS_IND_TBL_CMD_VIID)
1764 #define S_FW_RSS_IND_TBL_CMD_IQ0 20
1765 #define M_FW_RSS_IND_TBL_CMD_IQ0 0x3ff
1766 #define V_FW_RSS_IND_TBL_CMD_IQ0(x) ((x) << S_FW_RSS_IND_TBL_CMD_IQ0)
1767 #define G_FW_RSS_IND_TBL_CMD_IQ0(x) \
1768 (((x) >> S_FW_RSS_IND_TBL_CMD_IQ0) & M_FW_RSS_IND_TBL_CMD_IQ0)
1770 #define S_FW_RSS_IND_TBL_CMD_IQ1 10
1771 #define M_FW_RSS_IND_TBL_CMD_IQ1 0x3ff
1772 #define V_FW_RSS_IND_TBL_CMD_IQ1(x) ((x) << S_FW_RSS_IND_TBL_CMD_IQ1)
1773 #define G_FW_RSS_IND_TBL_CMD_IQ1(x) \
1774 (((x) >> S_FW_RSS_IND_TBL_CMD_IQ1) & M_FW_RSS_IND_TBL_CMD_IQ1)
1776 #define S_FW_RSS_IND_TBL_CMD_IQ2 0
1777 #define M_FW_RSS_IND_TBL_CMD_IQ2 0x3ff
1778 #define V_FW_RSS_IND_TBL_CMD_IQ2(x) ((x) << S_FW_RSS_IND_TBL_CMD_IQ2)
1779 #define G_FW_RSS_IND_TBL_CMD_IQ2(x) \
1780 (((x) >> S_FW_RSS_IND_TBL_CMD_IQ2) & M_FW_RSS_IND_TBL_CMD_IQ2)
1782 struct fw_rss_vi_config_cmd {
1784 __be32 retval_len16;
1785 union fw_rss_vi_config {
1786 struct fw_rss_vi_config_manual {
1791 struct fw_rss_vi_config_basicvirtual {
1793 __be32 defaultq_to_udpen;
1800 #define S_FW_RSS_VI_CONFIG_CMD_VIID 0
1801 #define M_FW_RSS_VI_CONFIG_CMD_VIID 0xfff
1802 #define V_FW_RSS_VI_CONFIG_CMD_VIID(x) ((x) << S_FW_RSS_VI_CONFIG_CMD_VIID)
1803 #define G_FW_RSS_VI_CONFIG_CMD_VIID(x) \
1804 (((x) >> S_FW_RSS_VI_CONFIG_CMD_VIID) & M_FW_RSS_VI_CONFIG_CMD_VIID)
1806 #define S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ 16
1807 #define M_FW_RSS_VI_CONFIG_CMD_DEFAULTQ 0x3ff
1808 #define V_FW_RSS_VI_CONFIG_CMD_DEFAULTQ(x) \
1809 ((x) << S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ)
1810 #define G_FW_RSS_VI_CONFIG_CMD_DEFAULTQ(x) \
1811 (((x) >> S_FW_RSS_VI_CONFIG_CMD_DEFAULTQ) & \
1812 M_FW_RSS_VI_CONFIG_CMD_DEFAULTQ)
1814 #define S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN 4
1815 #define M_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN 0x1
1816 #define V_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(x) \
1817 ((x) << S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN)
1818 #define G_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(x) \
1819 (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN) & \
1820 M_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN)
1821 #define F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN \
1822 V_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN(1U)
1824 #define S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN 3
1825 #define M_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN 0x1
1826 #define V_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(x) \
1827 ((x) << S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN)
1828 #define G_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(x) \
1829 (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN) & \
1830 M_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN)
1831 #define F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN \
1832 V_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN(1U)
1834 #define S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN 2
1835 #define M_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN 0x1
1836 #define V_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(x) \
1837 ((x) << S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN)
1838 #define G_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(x) \
1839 (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN) & \
1840 M_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN)
1841 #define F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN \
1842 V_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN(1U)
1844 #define S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN 1
1845 #define M_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN 0x1
1846 #define V_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(x) \
1847 ((x) << S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN)
1848 #define G_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(x) \
1849 (((x) >> S_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN) & \
1850 M_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN)
1851 #define F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN \
1852 V_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN(1U)
1854 #define S_FW_RSS_VI_CONFIG_CMD_UDPEN 0
1855 #define M_FW_RSS_VI_CONFIG_CMD_UDPEN 0x1
1856 #define V_FW_RSS_VI_CONFIG_CMD_UDPEN(x) ((x) << S_FW_RSS_VI_CONFIG_CMD_UDPEN)
1857 #define G_FW_RSS_VI_CONFIG_CMD_UDPEN(x) \
1858 (((x) >> S_FW_RSS_VI_CONFIG_CMD_UDPEN) & M_FW_RSS_VI_CONFIG_CMD_UDPEN)
1859 #define F_FW_RSS_VI_CONFIG_CMD_UDPEN V_FW_RSS_VI_CONFIG_CMD_UDPEN(1U)
1861 /******************************************************************************
1862 * D E B U G C O M M A N D s
1863 ******************************************************/
1865 struct fw_debug_cmd {
1869 struct fw_debug_assert {
1874 __u8 filename_0_7[8];
1875 __u8 filename_8_15[8];
1878 struct fw_debug_prt {
1881 __be32 dprtstrparam0;
1882 __be32 dprtstrparam1;
1883 __be32 dprtstrparam2;
1884 __be32 dprtstrparam3;
1889 #define S_FW_DEBUG_CMD_TYPE 0
1890 #define M_FW_DEBUG_CMD_TYPE 0xff
1891 #define V_FW_DEBUG_CMD_TYPE(x) ((x) << S_FW_DEBUG_CMD_TYPE)
1892 #define G_FW_DEBUG_CMD_TYPE(x) \
1893 (((x) >> S_FW_DEBUG_CMD_TYPE) & M_FW_DEBUG_CMD_TYPE)
1895 /******************************************************************************
1896 * P C I E F W R E G I S T E R
1897 **************************************/
1900 * Register definitions for the PCIE_FW register which the firmware uses
1901 * to retain status across RESETs. This register should be considered
1902 * as a READ-ONLY register for Host Software and only to be used to
1903 * track firmware initialization/error state, etc.
1905 #define S_PCIE_FW_ERR 31
1906 #define M_PCIE_FW_ERR 0x1
1907 #define V_PCIE_FW_ERR(x) ((x) << S_PCIE_FW_ERR)
1908 #define G_PCIE_FW_ERR(x) (((x) >> S_PCIE_FW_ERR) & M_PCIE_FW_ERR)
1909 #define F_PCIE_FW_ERR V_PCIE_FW_ERR(1U)
1911 #define S_PCIE_FW_INIT 30
1912 #define M_PCIE_FW_INIT 0x1
1913 #define V_PCIE_FW_INIT(x) ((x) << S_PCIE_FW_INIT)
1914 #define G_PCIE_FW_INIT(x) (((x) >> S_PCIE_FW_INIT) & M_PCIE_FW_INIT)
1915 #define F_PCIE_FW_INIT V_PCIE_FW_INIT(1U)
1917 #define S_PCIE_FW_HALT 29
1918 #define M_PCIE_FW_HALT 0x1
1919 #define V_PCIE_FW_HALT(x) ((x) << S_PCIE_FW_HALT)
1920 #define G_PCIE_FW_HALT(x) (((x) >> S_PCIE_FW_HALT) & M_PCIE_FW_HALT)
1921 #define F_PCIE_FW_HALT V_PCIE_FW_HALT(1U)
1923 #define S_PCIE_FW_EVAL 24
1924 #define M_PCIE_FW_EVAL 0x7
1925 #define V_PCIE_FW_EVAL(x) ((x) << S_PCIE_FW_EVAL)
1926 #define G_PCIE_FW_EVAL(x) (((x) >> S_PCIE_FW_EVAL) & M_PCIE_FW_EVAL)
1928 #define S_PCIE_FW_MASTER_VLD 15
1929 #define M_PCIE_FW_MASTER_VLD 0x1
1930 #define V_PCIE_FW_MASTER_VLD(x) ((x) << S_PCIE_FW_MASTER_VLD)
1931 #define G_PCIE_FW_MASTER_VLD(x) \
1932 (((x) >> S_PCIE_FW_MASTER_VLD) & M_PCIE_FW_MASTER_VLD)
1933 #define F_PCIE_FW_MASTER_VLD V_PCIE_FW_MASTER_VLD(1U)
1935 #define S_PCIE_FW_MASTER 12
1936 #define M_PCIE_FW_MASTER 0x7
1937 #define V_PCIE_FW_MASTER(x) ((x) << S_PCIE_FW_MASTER)
1938 #define G_PCIE_FW_MASTER(x) (((x) >> S_PCIE_FW_MASTER) & M_PCIE_FW_MASTER)
1940 /******************************************************************************
1941 * B I N A R Y H E A D E R F O R M A T
1942 **********************************************/
1945 * firmware binary header format
1949 __u8 chip; /* terminator chip family */
1950 __be16 len512; /* bin length in units of 512-bytes */
1951 __be32 fw_ver; /* firmware version */
1952 __be32 tp_microcode_ver; /* tcp processor microcode version */
1957 __u8 intfver_iscsipdu;
1959 __u8 intfver_fcoepdu;
1963 __u32 magic; /* runtime or bootstrap fw */
1965 __be32 reserved6[23];
1968 #define S_FW_HDR_FW_VER_MAJOR 24
1969 #define M_FW_HDR_FW_VER_MAJOR 0xff
1970 #define V_FW_HDR_FW_VER_MAJOR(x) \
1971 ((x) << S_FW_HDR_FW_VER_MAJOR)
1972 #define G_FW_HDR_FW_VER_MAJOR(x) \
1973 (((x) >> S_FW_HDR_FW_VER_MAJOR) & M_FW_HDR_FW_VER_MAJOR)
1975 #define S_FW_HDR_FW_VER_MINOR 16
1976 #define M_FW_HDR_FW_VER_MINOR 0xff
1977 #define V_FW_HDR_FW_VER_MINOR(x) \
1978 ((x) << S_FW_HDR_FW_VER_MINOR)
1979 #define G_FW_HDR_FW_VER_MINOR(x) \
1980 (((x) >> S_FW_HDR_FW_VER_MINOR) & M_FW_HDR_FW_VER_MINOR)
1982 #define S_FW_HDR_FW_VER_MICRO 8
1983 #define M_FW_HDR_FW_VER_MICRO 0xff
1984 #define V_FW_HDR_FW_VER_MICRO(x) \
1985 ((x) << S_FW_HDR_FW_VER_MICRO)
1986 #define G_FW_HDR_FW_VER_MICRO(x) \
1987 (((x) >> S_FW_HDR_FW_VER_MICRO) & M_FW_HDR_FW_VER_MICRO)
1989 #define S_FW_HDR_FW_VER_BUILD 0
1990 #define M_FW_HDR_FW_VER_BUILD 0xff
1991 #define V_FW_HDR_FW_VER_BUILD(x) \
1992 ((x) << S_FW_HDR_FW_VER_BUILD)
1993 #define G_FW_HDR_FW_VER_BUILD(x) \
1994 (((x) >> S_FW_HDR_FW_VER_BUILD) & M_FW_HDR_FW_VER_BUILD)
1996 #endif /* _T4FW_INTERFACE_H_ */