1f7917c00SJeff Kirsher /*
2f7917c00SJeff Kirsher  * This file is part of the Chelsio T4 Ethernet driver for Linux.
3f7917c00SJeff Kirsher  *
4ce100b8bSAnish Bhatt  * Copyright (c) 2009-2014 Chelsio Communications, Inc. All rights reserved.
5f7917c00SJeff Kirsher  *
6f7917c00SJeff Kirsher  * This software is available to you under a choice of one of two
7f7917c00SJeff Kirsher  * licenses.  You may choose to be licensed under the terms of the GNU
8f7917c00SJeff Kirsher  * General Public License (GPL) Version 2, available from the file
9f7917c00SJeff Kirsher  * COPYING in the main directory of this source tree, or the
10f7917c00SJeff Kirsher  * OpenIB.org BSD license below:
11f7917c00SJeff Kirsher  *
12f7917c00SJeff Kirsher  *     Redistribution and use in source and binary forms, with or
13f7917c00SJeff Kirsher  *     without modification, are permitted provided that the following
14f7917c00SJeff Kirsher  *     conditions are met:
15f7917c00SJeff Kirsher  *
16f7917c00SJeff Kirsher  *      - Redistributions of source code must retain the above
17f7917c00SJeff Kirsher  *        copyright notice, this list of conditions and the following
18f7917c00SJeff Kirsher  *        disclaimer.
19f7917c00SJeff Kirsher  *
20f7917c00SJeff Kirsher  *      - Redistributions in binary form must reproduce the above
21f7917c00SJeff Kirsher  *        copyright notice, this list of conditions and the following
22f7917c00SJeff Kirsher  *        disclaimer in the documentation and/or other materials
23f7917c00SJeff Kirsher  *        provided with the distribution.
24f7917c00SJeff Kirsher  *
25f7917c00SJeff Kirsher  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26f7917c00SJeff Kirsher  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27f7917c00SJeff Kirsher  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28f7917c00SJeff Kirsher  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29f7917c00SJeff Kirsher  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30f7917c00SJeff Kirsher  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31f7917c00SJeff Kirsher  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32f7917c00SJeff Kirsher  * SOFTWARE.
33f7917c00SJeff Kirsher  */
34f7917c00SJeff Kirsher 
35f7917c00SJeff Kirsher #ifndef _T4FW_INTERFACE_H_
36f7917c00SJeff Kirsher #define _T4FW_INTERFACE_H_
37f7917c00SJeff Kirsher 
385be78ee9SVipul Pandya enum fw_retval {
39dbedd44eSJoe Perches 	FW_SUCCESS		= 0,	/* completed successfully */
405be78ee9SVipul Pandya 	FW_EPERM		= 1,	/* operation not permitted */
415be78ee9SVipul Pandya 	FW_ENOENT		= 2,	/* no such file or directory */
425be78ee9SVipul Pandya 	FW_EIO			= 5,	/* input/output error; hw bad */
435be78ee9SVipul Pandya 	FW_ENOEXEC		= 8,	/* exec format error; inv microcode */
445be78ee9SVipul Pandya 	FW_EAGAIN		= 11,	/* try again */
455be78ee9SVipul Pandya 	FW_ENOMEM		= 12,	/* out of memory */
465be78ee9SVipul Pandya 	FW_EFAULT		= 14,	/* bad address; fw bad */
475be78ee9SVipul Pandya 	FW_EBUSY		= 16,	/* resource busy */
485be78ee9SVipul Pandya 	FW_EEXIST		= 17,	/* file exists */
49989594e2SAnish Bhatt 	FW_ENODEV		= 19,	/* no such device */
505be78ee9SVipul Pandya 	FW_EINVAL		= 22,	/* invalid argument */
515be78ee9SVipul Pandya 	FW_ENOSPC		= 28,	/* no space left on device */
525be78ee9SVipul Pandya 	FW_ENOSYS		= 38,	/* functionality not implemented */
53989594e2SAnish Bhatt 	FW_ENODATA		= 61,	/* no data available */
545be78ee9SVipul Pandya 	FW_EPROTO		= 71,	/* protocol error */
555be78ee9SVipul Pandya 	FW_EADDRINUSE		= 98,	/* address already in use */
565be78ee9SVipul Pandya 	FW_EADDRNOTAVAIL	= 99,	/* cannot assigned requested address */
575be78ee9SVipul Pandya 	FW_ENETDOWN		= 100,	/* network is down */
585be78ee9SVipul Pandya 	FW_ENETUNREACH		= 101,	/* network is unreachable */
595be78ee9SVipul Pandya 	FW_ENOBUFS		= 105,	/* no buffer space available */
605be78ee9SVipul Pandya 	FW_ETIMEDOUT		= 110,	/* timeout */
615be78ee9SVipul Pandya 	FW_EINPROGRESS		= 115,	/* fw internal */
625be78ee9SVipul Pandya 	FW_SCSI_ABORT_REQUESTED	= 128,	/* */
635be78ee9SVipul Pandya 	FW_SCSI_ABORT_TIMEDOUT	= 129,	/* */
645be78ee9SVipul Pandya 	FW_SCSI_ABORTED		= 130,	/* */
655be78ee9SVipul Pandya 	FW_SCSI_CLOSE_REQUESTED	= 131,	/* */
665be78ee9SVipul Pandya 	FW_ERR_LINK_DOWN	= 132,	/* */
675be78ee9SVipul Pandya 	FW_RDEV_NOT_READY	= 133,	/* */
685be78ee9SVipul Pandya 	FW_ERR_RDEV_LOST	= 134,	/* */
695be78ee9SVipul Pandya 	FW_ERR_RDEV_LOGO	= 135,	/* */
705be78ee9SVipul Pandya 	FW_FCOE_NO_XCHG		= 136,	/* */
715be78ee9SVipul Pandya 	FW_SCSI_RSP_ERR		= 137,	/* */
725be78ee9SVipul Pandya 	FW_ERR_RDEV_IMPL_LOGO	= 138,	/* */
735be78ee9SVipul Pandya 	FW_SCSI_UNDER_FLOW_ERR  = 139,	/* */
745be78ee9SVipul Pandya 	FW_SCSI_OVER_FLOW_ERR   = 140,	/* */
755be78ee9SVipul Pandya 	FW_SCSI_DDP_ERR		= 141,	/* DDP error*/
765be78ee9SVipul Pandya 	FW_SCSI_TASK_ERR	= 142,	/* No SCSI tasks available */
77f2b7e78dSVipul Pandya };
78f2b7e78dSVipul Pandya 
79f7917c00SJeff Kirsher #define FW_T4VF_SGE_BASE_ADDR      0x0000
80f7917c00SJeff Kirsher #define FW_T4VF_MPS_BASE_ADDR      0x0100
81f7917c00SJeff Kirsher #define FW_T4VF_PL_BASE_ADDR       0x0200
82f7917c00SJeff Kirsher #define FW_T4VF_MBDATA_BASE_ADDR   0x0240
83f7917c00SJeff Kirsher #define FW_T4VF_CIM_BASE_ADDR      0x0300
84f7917c00SJeff Kirsher 
85f7917c00SJeff Kirsher enum fw_wr_opcodes {
86f7917c00SJeff Kirsher 	FW_FILTER_WR                   = 0x02,
87f7917c00SJeff Kirsher 	FW_ULPTX_WR                    = 0x04,
88f7917c00SJeff Kirsher 	FW_TP_WR                       = 0x05,
89f7917c00SJeff Kirsher 	FW_ETH_TX_PKT_WR               = 0x08,
905be78ee9SVipul Pandya 	FW_OFLD_CONNECTION_WR          = 0x2f,
91f7917c00SJeff Kirsher 	FW_FLOWC_WR                    = 0x0a,
92f7917c00SJeff Kirsher 	FW_OFLD_TX_DATA_WR             = 0x0b,
93f7917c00SJeff Kirsher 	FW_CMD_WR                      = 0x10,
94f7917c00SJeff Kirsher 	FW_ETH_TX_PKT_VM_WR            = 0x11,
95f7917c00SJeff Kirsher 	FW_RI_RES_WR                   = 0x0c,
96f7917c00SJeff Kirsher 	FW_RI_INIT_WR                  = 0x0d,
97f7917c00SJeff Kirsher 	FW_RI_RDMA_WRITE_WR            = 0x14,
98f7917c00SJeff Kirsher 	FW_RI_SEND_WR                  = 0x15,
99f7917c00SJeff Kirsher 	FW_RI_RDMA_READ_WR             = 0x16,
100f7917c00SJeff Kirsher 	FW_RI_RECV_WR                  = 0x17,
101f7917c00SJeff Kirsher 	FW_RI_BIND_MW_WR               = 0x18,
102f7917c00SJeff Kirsher 	FW_RI_FR_NSMR_WR               = 0x19,
103f7917c00SJeff Kirsher 	FW_RI_INV_LSTAG_WR             = 0x1a,
1047ef65a42SHariprasad Shenai 	FW_LASTC2E_WR                  = 0x70
105f7917c00SJeff Kirsher };
106f7917c00SJeff Kirsher 
107f7917c00SJeff Kirsher struct fw_wr_hdr {
108f7917c00SJeff Kirsher 	__be32 hi;
109f7917c00SJeff Kirsher 	__be32 lo;
110f7917c00SJeff Kirsher };
111f7917c00SJeff Kirsher 
112e2ac9628SHariprasad Shenai /* work request opcode (hi) */
113e2ac9628SHariprasad Shenai #define FW_WR_OP_S	24
114e2ac9628SHariprasad Shenai #define FW_WR_OP_M      0xff
115e2ac9628SHariprasad Shenai #define FW_WR_OP_V(x)   ((x) << FW_WR_OP_S)
116e2ac9628SHariprasad Shenai #define FW_WR_OP_G(x)   (((x) >> FW_WR_OP_S) & FW_WR_OP_M)
117f7917c00SJeff Kirsher 
118e2ac9628SHariprasad Shenai /* atomic flag (hi) - firmware encapsulates CPLs in CPL_BARRIER */
119e2ac9628SHariprasad Shenai #define FW_WR_ATOMIC_S		23
120e2ac9628SHariprasad Shenai #define FW_WR_ATOMIC_V(x)	((x) << FW_WR_ATOMIC_S)
121e2ac9628SHariprasad Shenai 
122e2ac9628SHariprasad Shenai /* flush flag (hi) - firmware flushes flushable work request buffered
123e2ac9628SHariprasad Shenai  * in the flow context.
124e2ac9628SHariprasad Shenai  */
125e2ac9628SHariprasad Shenai #define FW_WR_FLUSH_S     22
126e2ac9628SHariprasad Shenai #define FW_WR_FLUSH_V(x)  ((x) << FW_WR_FLUSH_S)
127e2ac9628SHariprasad Shenai 
128e2ac9628SHariprasad Shenai /* completion flag (hi) - firmware generates a cpl_fw6_ack */
129e2ac9628SHariprasad Shenai #define FW_WR_COMPL_S     21
130e2ac9628SHariprasad Shenai #define FW_WR_COMPL_V(x)  ((x) << FW_WR_COMPL_S)
131e2ac9628SHariprasad Shenai #define FW_WR_COMPL_F     FW_WR_COMPL_V(1U)
132e2ac9628SHariprasad Shenai 
133e2ac9628SHariprasad Shenai /* work request immediate data length (hi) */
134e2ac9628SHariprasad Shenai #define FW_WR_IMMDLEN_S 0
135e2ac9628SHariprasad Shenai #define FW_WR_IMMDLEN_M 0xff
136e2ac9628SHariprasad Shenai #define FW_WR_IMMDLEN_V(x)      ((x) << FW_WR_IMMDLEN_S)
137e2ac9628SHariprasad Shenai 
138e2ac9628SHariprasad Shenai /* egress queue status update to associated ingress queue entry (lo) */
139e2ac9628SHariprasad Shenai #define FW_WR_EQUIQ_S           31
140e2ac9628SHariprasad Shenai #define FW_WR_EQUIQ_V(x)        ((x) << FW_WR_EQUIQ_S)
141e2ac9628SHariprasad Shenai #define FW_WR_EQUIQ_F           FW_WR_EQUIQ_V(1U)
142e2ac9628SHariprasad Shenai 
143e2ac9628SHariprasad Shenai /* egress queue status update to egress queue status entry (lo) */
144e2ac9628SHariprasad Shenai #define FW_WR_EQUEQ_S           30
145e2ac9628SHariprasad Shenai #define FW_WR_EQUEQ_V(x)        ((x) << FW_WR_EQUEQ_S)
146e2ac9628SHariprasad Shenai #define FW_WR_EQUEQ_F           FW_WR_EQUEQ_V(1U)
147e2ac9628SHariprasad Shenai 
148e2ac9628SHariprasad Shenai /* flow context identifier (lo) */
149e2ac9628SHariprasad Shenai #define FW_WR_FLOWID_S          8
150e2ac9628SHariprasad Shenai #define FW_WR_FLOWID_V(x)       ((x) << FW_WR_FLOWID_S)
151e2ac9628SHariprasad Shenai 
152e2ac9628SHariprasad Shenai /* length in units of 16-bytes (lo) */
153e2ac9628SHariprasad Shenai #define FW_WR_LEN16_S           0
154e2ac9628SHariprasad Shenai #define FW_WR_LEN16_V(x)        ((x) << FW_WR_LEN16_S)
155f7917c00SJeff Kirsher 
15613ee15d3SVipul Pandya #define HW_TPL_FR_MT_PR_IV_P_FC         0X32B
1575be78ee9SVipul Pandya #define HW_TPL_FR_MT_PR_OV_P_FC         0X327
15813ee15d3SVipul Pandya 
159f2b7e78dSVipul Pandya /* filter wr reply code in cookie in CPL_SET_TCB_RPL */
160f2b7e78dSVipul Pandya enum fw_filter_wr_cookie {
161f2b7e78dSVipul Pandya 	FW_FILTER_WR_SUCCESS,
162f2b7e78dSVipul Pandya 	FW_FILTER_WR_FLT_ADDED,
163f2b7e78dSVipul Pandya 	FW_FILTER_WR_FLT_DELETED,
164f2b7e78dSVipul Pandya 	FW_FILTER_WR_SMT_TBL_FULL,
165f2b7e78dSVipul Pandya 	FW_FILTER_WR_EINVAL,
166f2b7e78dSVipul Pandya };
167f2b7e78dSVipul Pandya 
168f2b7e78dSVipul Pandya struct fw_filter_wr {
169f2b7e78dSVipul Pandya 	__be32 op_pkd;
170f2b7e78dSVipul Pandya 	__be32 len16_pkd;
171f2b7e78dSVipul Pandya 	__be64 r3;
172f2b7e78dSVipul Pandya 	__be32 tid_to_iq;
173f2b7e78dSVipul Pandya 	__be32 del_filter_to_l2tix;
174f2b7e78dSVipul Pandya 	__be16 ethtype;
175f2b7e78dSVipul Pandya 	__be16 ethtypem;
176f2b7e78dSVipul Pandya 	__u8   frag_to_ovlan_vldm;
177f2b7e78dSVipul Pandya 	__u8   smac_sel;
178f2b7e78dSVipul Pandya 	__be16 rx_chan_rx_rpl_iq;
179f2b7e78dSVipul Pandya 	__be32 maci_to_matchtypem;
180f2b7e78dSVipul Pandya 	__u8   ptcl;
181f2b7e78dSVipul Pandya 	__u8   ptclm;
182f2b7e78dSVipul Pandya 	__u8   ttyp;
183f2b7e78dSVipul Pandya 	__u8   ttypm;
184f2b7e78dSVipul Pandya 	__be16 ivlan;
185f2b7e78dSVipul Pandya 	__be16 ivlanm;
186f2b7e78dSVipul Pandya 	__be16 ovlan;
187f2b7e78dSVipul Pandya 	__be16 ovlanm;
188f2b7e78dSVipul Pandya 	__u8   lip[16];
189f2b7e78dSVipul Pandya 	__u8   lipm[16];
190f2b7e78dSVipul Pandya 	__u8   fip[16];
191f2b7e78dSVipul Pandya 	__u8   fipm[16];
192f2b7e78dSVipul Pandya 	__be16 lp;
193f2b7e78dSVipul Pandya 	__be16 lpm;
194f2b7e78dSVipul Pandya 	__be16 fp;
195f2b7e78dSVipul Pandya 	__be16 fpm;
196f2b7e78dSVipul Pandya 	__be16 r7;
197f2b7e78dSVipul Pandya 	__u8   sma[6];
198f2b7e78dSVipul Pandya };
199f2b7e78dSVipul Pandya 
20077a80e23SHariprasad Shenai #define FW_FILTER_WR_TID_S      12
20177a80e23SHariprasad Shenai #define FW_FILTER_WR_TID_M      0xfffff
20277a80e23SHariprasad Shenai #define FW_FILTER_WR_TID_V(x)   ((x) << FW_FILTER_WR_TID_S)
20377a80e23SHariprasad Shenai #define FW_FILTER_WR_TID_G(x)   \
20477a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_TID_S) & FW_FILTER_WR_TID_M)
205f2b7e78dSVipul Pandya 
20677a80e23SHariprasad Shenai #define FW_FILTER_WR_RQTYPE_S           11
20777a80e23SHariprasad Shenai #define FW_FILTER_WR_RQTYPE_M           0x1
20877a80e23SHariprasad Shenai #define FW_FILTER_WR_RQTYPE_V(x)        ((x) << FW_FILTER_WR_RQTYPE_S)
20977a80e23SHariprasad Shenai #define FW_FILTER_WR_RQTYPE_G(x)        \
21077a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_RQTYPE_S) & FW_FILTER_WR_RQTYPE_M)
21177a80e23SHariprasad Shenai #define FW_FILTER_WR_RQTYPE_F   FW_FILTER_WR_RQTYPE_V(1U)
212f2b7e78dSVipul Pandya 
21377a80e23SHariprasad Shenai #define FW_FILTER_WR_NOREPLY_S          10
21477a80e23SHariprasad Shenai #define FW_FILTER_WR_NOREPLY_M          0x1
21577a80e23SHariprasad Shenai #define FW_FILTER_WR_NOREPLY_V(x)       ((x) << FW_FILTER_WR_NOREPLY_S)
21677a80e23SHariprasad Shenai #define FW_FILTER_WR_NOREPLY_G(x)       \
21777a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_NOREPLY_S) & FW_FILTER_WR_NOREPLY_M)
21877a80e23SHariprasad Shenai #define FW_FILTER_WR_NOREPLY_F  FW_FILTER_WR_NOREPLY_V(1U)
219f2b7e78dSVipul Pandya 
22077a80e23SHariprasad Shenai #define FW_FILTER_WR_IQ_S       0
22177a80e23SHariprasad Shenai #define FW_FILTER_WR_IQ_M       0x3ff
22277a80e23SHariprasad Shenai #define FW_FILTER_WR_IQ_V(x)    ((x) << FW_FILTER_WR_IQ_S)
22377a80e23SHariprasad Shenai #define FW_FILTER_WR_IQ_G(x)    \
22477a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_IQ_S) & FW_FILTER_WR_IQ_M)
225f2b7e78dSVipul Pandya 
22677a80e23SHariprasad Shenai #define FW_FILTER_WR_DEL_FILTER_S       31
22777a80e23SHariprasad Shenai #define FW_FILTER_WR_DEL_FILTER_M       0x1
22877a80e23SHariprasad Shenai #define FW_FILTER_WR_DEL_FILTER_V(x)    ((x) << FW_FILTER_WR_DEL_FILTER_S)
22977a80e23SHariprasad Shenai #define FW_FILTER_WR_DEL_FILTER_G(x)    \
23077a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_DEL_FILTER_S) & FW_FILTER_WR_DEL_FILTER_M)
23177a80e23SHariprasad Shenai #define FW_FILTER_WR_DEL_FILTER_F       FW_FILTER_WR_DEL_FILTER_V(1U)
232f2b7e78dSVipul Pandya 
23377a80e23SHariprasad Shenai #define FW_FILTER_WR_RPTTID_S           25
23477a80e23SHariprasad Shenai #define FW_FILTER_WR_RPTTID_M           0x1
23577a80e23SHariprasad Shenai #define FW_FILTER_WR_RPTTID_V(x)        ((x) << FW_FILTER_WR_RPTTID_S)
23677a80e23SHariprasad Shenai #define FW_FILTER_WR_RPTTID_G(x)        \
23777a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_RPTTID_S) & FW_FILTER_WR_RPTTID_M)
23877a80e23SHariprasad Shenai #define FW_FILTER_WR_RPTTID_F   FW_FILTER_WR_RPTTID_V(1U)
239f2b7e78dSVipul Pandya 
24077a80e23SHariprasad Shenai #define FW_FILTER_WR_DROP_S     24
24177a80e23SHariprasad Shenai #define FW_FILTER_WR_DROP_M     0x1
24277a80e23SHariprasad Shenai #define FW_FILTER_WR_DROP_V(x)  ((x) << FW_FILTER_WR_DROP_S)
24377a80e23SHariprasad Shenai #define FW_FILTER_WR_DROP_G(x)  \
24477a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_DROP_S) & FW_FILTER_WR_DROP_M)
24577a80e23SHariprasad Shenai #define FW_FILTER_WR_DROP_F     FW_FILTER_WR_DROP_V(1U)
246f2b7e78dSVipul Pandya 
24777a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEER_S         23
24877a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEER_M         0x1
24977a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEER_V(x)      ((x) << FW_FILTER_WR_DIRSTEER_S)
25077a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEER_G(x)      \
25177a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_DIRSTEER_S) & FW_FILTER_WR_DIRSTEER_M)
25277a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEER_F FW_FILTER_WR_DIRSTEER_V(1U)
253f2b7e78dSVipul Pandya 
25477a80e23SHariprasad Shenai #define FW_FILTER_WR_MASKHASH_S         22
25577a80e23SHariprasad Shenai #define FW_FILTER_WR_MASKHASH_M         0x1
25677a80e23SHariprasad Shenai #define FW_FILTER_WR_MASKHASH_V(x)      ((x) << FW_FILTER_WR_MASKHASH_S)
25777a80e23SHariprasad Shenai #define FW_FILTER_WR_MASKHASH_G(x)      \
25877a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_MASKHASH_S) & FW_FILTER_WR_MASKHASH_M)
25977a80e23SHariprasad Shenai #define FW_FILTER_WR_MASKHASH_F FW_FILTER_WR_MASKHASH_V(1U)
260f2b7e78dSVipul Pandya 
26177a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEERHASH_S     21
26277a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEERHASH_M     0x1
26377a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEERHASH_V(x)  ((x) << FW_FILTER_WR_DIRSTEERHASH_S)
26477a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEERHASH_G(x)  \
26577a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_DIRSTEERHASH_S) & FW_FILTER_WR_DIRSTEERHASH_M)
26677a80e23SHariprasad Shenai #define FW_FILTER_WR_DIRSTEERHASH_F     FW_FILTER_WR_DIRSTEERHASH_V(1U)
267f2b7e78dSVipul Pandya 
26877a80e23SHariprasad Shenai #define FW_FILTER_WR_LPBK_S     20
26977a80e23SHariprasad Shenai #define FW_FILTER_WR_LPBK_M     0x1
27077a80e23SHariprasad Shenai #define FW_FILTER_WR_LPBK_V(x)  ((x) << FW_FILTER_WR_LPBK_S)
27177a80e23SHariprasad Shenai #define FW_FILTER_WR_LPBK_G(x)  \
27277a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_LPBK_S) & FW_FILTER_WR_LPBK_M)
27377a80e23SHariprasad Shenai #define FW_FILTER_WR_LPBK_F     FW_FILTER_WR_LPBK_V(1U)
274f2b7e78dSVipul Pandya 
27577a80e23SHariprasad Shenai #define FW_FILTER_WR_DMAC_S     19
27677a80e23SHariprasad Shenai #define FW_FILTER_WR_DMAC_M     0x1
27777a80e23SHariprasad Shenai #define FW_FILTER_WR_DMAC_V(x)  ((x) << FW_FILTER_WR_DMAC_S)
27877a80e23SHariprasad Shenai #define FW_FILTER_WR_DMAC_G(x)  \
27977a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_DMAC_S) & FW_FILTER_WR_DMAC_M)
28077a80e23SHariprasad Shenai #define FW_FILTER_WR_DMAC_F     FW_FILTER_WR_DMAC_V(1U)
281f2b7e78dSVipul Pandya 
28277a80e23SHariprasad Shenai #define FW_FILTER_WR_SMAC_S     18
28377a80e23SHariprasad Shenai #define FW_FILTER_WR_SMAC_M     0x1
28477a80e23SHariprasad Shenai #define FW_FILTER_WR_SMAC_V(x)  ((x) << FW_FILTER_WR_SMAC_S)
28577a80e23SHariprasad Shenai #define FW_FILTER_WR_SMAC_G(x)  \
28677a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_SMAC_S) & FW_FILTER_WR_SMAC_M)
28777a80e23SHariprasad Shenai #define FW_FILTER_WR_SMAC_F     FW_FILTER_WR_SMAC_V(1U)
288f2b7e78dSVipul Pandya 
28977a80e23SHariprasad Shenai #define FW_FILTER_WR_INSVLAN_S          17
29077a80e23SHariprasad Shenai #define FW_FILTER_WR_INSVLAN_M          0x1
29177a80e23SHariprasad Shenai #define FW_FILTER_WR_INSVLAN_V(x)       ((x) << FW_FILTER_WR_INSVLAN_S)
29277a80e23SHariprasad Shenai #define FW_FILTER_WR_INSVLAN_G(x)       \
29377a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_INSVLAN_S) & FW_FILTER_WR_INSVLAN_M)
29477a80e23SHariprasad Shenai #define FW_FILTER_WR_INSVLAN_F  FW_FILTER_WR_INSVLAN_V(1U)
295f2b7e78dSVipul Pandya 
29677a80e23SHariprasad Shenai #define FW_FILTER_WR_RMVLAN_S           16
29777a80e23SHariprasad Shenai #define FW_FILTER_WR_RMVLAN_M           0x1
29877a80e23SHariprasad Shenai #define FW_FILTER_WR_RMVLAN_V(x)        ((x) << FW_FILTER_WR_RMVLAN_S)
29977a80e23SHariprasad Shenai #define FW_FILTER_WR_RMVLAN_G(x)        \
30077a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_RMVLAN_S) & FW_FILTER_WR_RMVLAN_M)
30177a80e23SHariprasad Shenai #define FW_FILTER_WR_RMVLAN_F   FW_FILTER_WR_RMVLAN_V(1U)
302f2b7e78dSVipul Pandya 
30377a80e23SHariprasad Shenai #define FW_FILTER_WR_HITCNTS_S          15
30477a80e23SHariprasad Shenai #define FW_FILTER_WR_HITCNTS_M          0x1
30577a80e23SHariprasad Shenai #define FW_FILTER_WR_HITCNTS_V(x)       ((x) << FW_FILTER_WR_HITCNTS_S)
30677a80e23SHariprasad Shenai #define FW_FILTER_WR_HITCNTS_G(x)       \
30777a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_HITCNTS_S) & FW_FILTER_WR_HITCNTS_M)
30877a80e23SHariprasad Shenai #define FW_FILTER_WR_HITCNTS_F  FW_FILTER_WR_HITCNTS_V(1U)
309f2b7e78dSVipul Pandya 
31077a80e23SHariprasad Shenai #define FW_FILTER_WR_TXCHAN_S           13
31177a80e23SHariprasad Shenai #define FW_FILTER_WR_TXCHAN_M           0x3
31277a80e23SHariprasad Shenai #define FW_FILTER_WR_TXCHAN_V(x)        ((x) << FW_FILTER_WR_TXCHAN_S)
31377a80e23SHariprasad Shenai #define FW_FILTER_WR_TXCHAN_G(x)        \
31477a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_TXCHAN_S) & FW_FILTER_WR_TXCHAN_M)
315f2b7e78dSVipul Pandya 
31677a80e23SHariprasad Shenai #define FW_FILTER_WR_PRIO_S     12
31777a80e23SHariprasad Shenai #define FW_FILTER_WR_PRIO_M     0x1
31877a80e23SHariprasad Shenai #define FW_FILTER_WR_PRIO_V(x)  ((x) << FW_FILTER_WR_PRIO_S)
31977a80e23SHariprasad Shenai #define FW_FILTER_WR_PRIO_G(x)  \
32077a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_PRIO_S) & FW_FILTER_WR_PRIO_M)
32177a80e23SHariprasad Shenai #define FW_FILTER_WR_PRIO_F     FW_FILTER_WR_PRIO_V(1U)
322f2b7e78dSVipul Pandya 
32377a80e23SHariprasad Shenai #define FW_FILTER_WR_L2TIX_S    0
32477a80e23SHariprasad Shenai #define FW_FILTER_WR_L2TIX_M    0xfff
32577a80e23SHariprasad Shenai #define FW_FILTER_WR_L2TIX_V(x) ((x) << FW_FILTER_WR_L2TIX_S)
32677a80e23SHariprasad Shenai #define FW_FILTER_WR_L2TIX_G(x) \
32777a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_L2TIX_S) & FW_FILTER_WR_L2TIX_M)
328f2b7e78dSVipul Pandya 
32977a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAG_S     7
33077a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAG_M     0x1
33177a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAG_V(x)  ((x) << FW_FILTER_WR_FRAG_S)
33277a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAG_G(x)  \
33377a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_FRAG_S) & FW_FILTER_WR_FRAG_M)
33477a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAG_F     FW_FILTER_WR_FRAG_V(1U)
335f2b7e78dSVipul Pandya 
33677a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAGM_S    6
33777a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAGM_M    0x1
33877a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAGM_V(x) ((x) << FW_FILTER_WR_FRAGM_S)
33977a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAGM_G(x) \
34077a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_FRAGM_S) & FW_FILTER_WR_FRAGM_M)
34177a80e23SHariprasad Shenai #define FW_FILTER_WR_FRAGM_F    FW_FILTER_WR_FRAGM_V(1U)
342f2b7e78dSVipul Pandya 
34377a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLD_S        5
34477a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLD_M        0x1
34577a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLD_V(x)     ((x) << FW_FILTER_WR_IVLAN_VLD_S)
34677a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLD_G(x)     \
34777a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_IVLAN_VLD_S) & FW_FILTER_WR_IVLAN_VLD_M)
34877a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLD_F        FW_FILTER_WR_IVLAN_VLD_V(1U)
349f2b7e78dSVipul Pandya 
35077a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLD_S        4
35177a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLD_M        0x1
35277a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLD_V(x)     ((x) << FW_FILTER_WR_OVLAN_VLD_S)
35377a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLD_G(x)     \
35477a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_OVLAN_VLD_S) & FW_FILTER_WR_OVLAN_VLD_M)
35577a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLD_F        FW_FILTER_WR_OVLAN_VLD_V(1U)
356f2b7e78dSVipul Pandya 
35777a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLDM_S       3
35877a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLDM_M       0x1
35977a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLDM_V(x)    ((x) << FW_FILTER_WR_IVLAN_VLDM_S)
36077a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLDM_G(x)    \
36177a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_IVLAN_VLDM_S) & FW_FILTER_WR_IVLAN_VLDM_M)
36277a80e23SHariprasad Shenai #define FW_FILTER_WR_IVLAN_VLDM_F       FW_FILTER_WR_IVLAN_VLDM_V(1U)
363f2b7e78dSVipul Pandya 
36477a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLDM_S       2
36577a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLDM_M       0x1
36677a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLDM_V(x)    ((x) << FW_FILTER_WR_OVLAN_VLDM_S)
36777a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLDM_G(x)    \
36877a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_OVLAN_VLDM_S) & FW_FILTER_WR_OVLAN_VLDM_M)
36977a80e23SHariprasad Shenai #define FW_FILTER_WR_OVLAN_VLDM_F       FW_FILTER_WR_OVLAN_VLDM_V(1U)
370f2b7e78dSVipul Pandya 
37177a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_CHAN_S          15
37277a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_CHAN_M          0x1
37377a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_CHAN_V(x)       ((x) << FW_FILTER_WR_RX_CHAN_S)
37477a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_CHAN_G(x)       \
37577a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_RX_CHAN_S) & FW_FILTER_WR_RX_CHAN_M)
37677a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_CHAN_F  FW_FILTER_WR_RX_CHAN_V(1U)
377f2b7e78dSVipul Pandya 
37877a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_RPL_IQ_S        0
37977a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_RPL_IQ_M        0x3ff
38077a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_RPL_IQ_V(x)     ((x) << FW_FILTER_WR_RX_RPL_IQ_S)
38177a80e23SHariprasad Shenai #define FW_FILTER_WR_RX_RPL_IQ_G(x)     \
38277a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_RX_RPL_IQ_S) & FW_FILTER_WR_RX_RPL_IQ_M)
383f2b7e78dSVipul Pandya 
38477a80e23SHariprasad Shenai #define FW_FILTER_WR_MACI_S     23
38577a80e23SHariprasad Shenai #define FW_FILTER_WR_MACI_M     0x1ff
38677a80e23SHariprasad Shenai #define FW_FILTER_WR_MACI_V(x)  ((x) << FW_FILTER_WR_MACI_S)
38777a80e23SHariprasad Shenai #define FW_FILTER_WR_MACI_G(x)  \
38877a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_MACI_S) & FW_FILTER_WR_MACI_M)
389f2b7e78dSVipul Pandya 
39077a80e23SHariprasad Shenai #define FW_FILTER_WR_MACIM_S    14
39177a80e23SHariprasad Shenai #define FW_FILTER_WR_MACIM_M    0x1ff
39277a80e23SHariprasad Shenai #define FW_FILTER_WR_MACIM_V(x) ((x) << FW_FILTER_WR_MACIM_S)
39377a80e23SHariprasad Shenai #define FW_FILTER_WR_MACIM_G(x) \
39477a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_MACIM_S) & FW_FILTER_WR_MACIM_M)
395f2b7e78dSVipul Pandya 
39677a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOE_S     13
39777a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOE_M     0x1
39877a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOE_V(x)  ((x) << FW_FILTER_WR_FCOE_S)
39977a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOE_G(x)  \
40077a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_FCOE_S) & FW_FILTER_WR_FCOE_M)
40177a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOE_F     FW_FILTER_WR_FCOE_V(1U)
402f2b7e78dSVipul Pandya 
40377a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOEM_S    12
40477a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOEM_M    0x1
40577a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOEM_V(x) ((x) << FW_FILTER_WR_FCOEM_S)
40677a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOEM_G(x) \
40777a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_FCOEM_S) & FW_FILTER_WR_FCOEM_M)
40877a80e23SHariprasad Shenai #define FW_FILTER_WR_FCOEM_F    FW_FILTER_WR_FCOEM_V(1U)
409f2b7e78dSVipul Pandya 
41077a80e23SHariprasad Shenai #define FW_FILTER_WR_PORT_S     9
41177a80e23SHariprasad Shenai #define FW_FILTER_WR_PORT_M     0x7
41277a80e23SHariprasad Shenai #define FW_FILTER_WR_PORT_V(x)  ((x) << FW_FILTER_WR_PORT_S)
41377a80e23SHariprasad Shenai #define FW_FILTER_WR_PORT_G(x)  \
41477a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_PORT_S) & FW_FILTER_WR_PORT_M)
415f2b7e78dSVipul Pandya 
41677a80e23SHariprasad Shenai #define FW_FILTER_WR_PORTM_S    6
41777a80e23SHariprasad Shenai #define FW_FILTER_WR_PORTM_M    0x7
41877a80e23SHariprasad Shenai #define FW_FILTER_WR_PORTM_V(x) ((x) << FW_FILTER_WR_PORTM_S)
41977a80e23SHariprasad Shenai #define FW_FILTER_WR_PORTM_G(x) \
42077a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_PORTM_S) & FW_FILTER_WR_PORTM_M)
421f2b7e78dSVipul Pandya 
42277a80e23SHariprasad Shenai #define FW_FILTER_WR_MATCHTYPE_S        3
42377a80e23SHariprasad Shenai #define FW_FILTER_WR_MATCHTYPE_M        0x7
42477a80e23SHariprasad Shenai #define FW_FILTER_WR_MATCHTYPE_V(x)     ((x) << FW_FILTER_WR_MATCHTYPE_S)
42577a80e23SHariprasad Shenai #define FW_FILTER_WR_MATCHTYPE_G(x)     \
42677a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_MATCHTYPE_S) & FW_FILTER_WR_MATCHTYPE_M)
427f2b7e78dSVipul Pandya 
42877a80e23SHariprasad Shenai #define FW_FILTER_WR_MATCHTYPEM_S       0
42977a80e23SHariprasad Shenai #define FW_FILTER_WR_MATCHTYPEM_M       0x7
43077a80e23SHariprasad Shenai #define FW_FILTER_WR_MATCHTYPEM_V(x)    ((x) << FW_FILTER_WR_MATCHTYPEM_S)
43177a80e23SHariprasad Shenai #define FW_FILTER_WR_MATCHTYPEM_G(x)    \
43277a80e23SHariprasad Shenai 	(((x) >> FW_FILTER_WR_MATCHTYPEM_S) & FW_FILTER_WR_MATCHTYPEM_M)
433f2b7e78dSVipul Pandya 
434f7917c00SJeff Kirsher struct fw_ulptx_wr {
435f7917c00SJeff Kirsher 	__be32 op_to_compl;
436f7917c00SJeff Kirsher 	__be32 flowid_len16;
437f7917c00SJeff Kirsher 	u64 cookie;
438f7917c00SJeff Kirsher };
439f7917c00SJeff Kirsher 
440f7917c00SJeff Kirsher struct fw_tp_wr {
441f7917c00SJeff Kirsher 	__be32 op_to_immdlen;
442f7917c00SJeff Kirsher 	__be32 flowid_len16;
443f7917c00SJeff Kirsher 	u64 cookie;
444f7917c00SJeff Kirsher };
445f7917c00SJeff Kirsher 
446f7917c00SJeff Kirsher struct fw_eth_tx_pkt_wr {
447f7917c00SJeff Kirsher 	__be32 op_immdlen;
448f7917c00SJeff Kirsher 	__be32 equiq_to_len16;
449f7917c00SJeff Kirsher 	__be64 r3;
450f7917c00SJeff Kirsher };
451f7917c00SJeff Kirsher 
4525be78ee9SVipul Pandya struct fw_ofld_connection_wr {
4535be78ee9SVipul Pandya 	__be32 op_compl;
4545be78ee9SVipul Pandya 	__be32 len16_pkd;
4555be78ee9SVipul Pandya 	__u64  cookie;
4565be78ee9SVipul Pandya 	__be64 r2;
4575be78ee9SVipul Pandya 	__be64 r3;
4585be78ee9SVipul Pandya 	struct fw_ofld_connection_le {
4595be78ee9SVipul Pandya 		__be32 version_cpl;
4605be78ee9SVipul Pandya 		__be32 filter;
4615be78ee9SVipul Pandya 		__be32 r1;
4625be78ee9SVipul Pandya 		__be16 lport;
4635be78ee9SVipul Pandya 		__be16 pport;
4645be78ee9SVipul Pandya 		union fw_ofld_connection_leip {
4655be78ee9SVipul Pandya 			struct fw_ofld_connection_le_ipv4 {
4665be78ee9SVipul Pandya 				__be32 pip;
4675be78ee9SVipul Pandya 				__be32 lip;
4685be78ee9SVipul Pandya 				__be64 r0;
4695be78ee9SVipul Pandya 				__be64 r1;
4705be78ee9SVipul Pandya 				__be64 r2;
4715be78ee9SVipul Pandya 			} ipv4;
4725be78ee9SVipul Pandya 			struct fw_ofld_connection_le_ipv6 {
4735be78ee9SVipul Pandya 				__be64 pip_hi;
4745be78ee9SVipul Pandya 				__be64 pip_lo;
4755be78ee9SVipul Pandya 				__be64 lip_hi;
4765be78ee9SVipul Pandya 				__be64 lip_lo;
4775be78ee9SVipul Pandya 			} ipv6;
4785be78ee9SVipul Pandya 		} u;
4795be78ee9SVipul Pandya 	} le;
4805be78ee9SVipul Pandya 	struct fw_ofld_connection_tcb {
4815be78ee9SVipul Pandya 		__be32 t_state_to_astid;
4825be78ee9SVipul Pandya 		__be16 cplrxdataack_cplpassacceptrpl;
4835be78ee9SVipul Pandya 		__be16 rcv_adv;
4845be78ee9SVipul Pandya 		__be32 rcv_nxt;
4855be78ee9SVipul Pandya 		__be32 tx_max;
4865be78ee9SVipul Pandya 		__be64 opt0;
4875be78ee9SVipul Pandya 		__be32 opt2;
4885be78ee9SVipul Pandya 		__be32 r1;
4895be78ee9SVipul Pandya 		__be64 r2;
4905be78ee9SVipul Pandya 		__be64 r3;
4915be78ee9SVipul Pandya 	} tcb;
4925be78ee9SVipul Pandya };
4935be78ee9SVipul Pandya 
49477a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_VERSION_S                31
49577a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_VERSION_M                0x1
49677a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_VERSION_V(x)     \
49777a80e23SHariprasad Shenai 	((x) << FW_OFLD_CONNECTION_WR_VERSION_S)
49877a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_VERSION_G(x)     \
49977a80e23SHariprasad Shenai 	(((x) >> FW_OFLD_CONNECTION_WR_VERSION_S) & \
50077a80e23SHariprasad Shenai 	FW_OFLD_CONNECTION_WR_VERSION_M)
50177a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_VERSION_F        \
50277a80e23SHariprasad Shenai 	FW_OFLD_CONNECTION_WR_VERSION_V(1U)
5035be78ee9SVipul Pandya 
50477a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPL_S    30
50577a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPL_M    0x1
50677a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPL_V(x) ((x) << FW_OFLD_CONNECTION_WR_CPL_S)
50777a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPL_G(x) \
50877a80e23SHariprasad Shenai 	(((x) >> FW_OFLD_CONNECTION_WR_CPL_S) & FW_OFLD_CONNECTION_WR_CPL_M)
50977a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPL_F    FW_OFLD_CONNECTION_WR_CPL_V(1U)
5105be78ee9SVipul Pandya 
51177a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_T_STATE_S                28
51277a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_T_STATE_M                0xf
51377a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_T_STATE_V(x)     \
51477a80e23SHariprasad Shenai 	((x) << FW_OFLD_CONNECTION_WR_T_STATE_S)
51577a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_T_STATE_G(x)     \
51677a80e23SHariprasad Shenai 	(((x) >> FW_OFLD_CONNECTION_WR_T_STATE_S) & \
51777a80e23SHariprasad Shenai 	FW_OFLD_CONNECTION_WR_T_STATE_M)
5185be78ee9SVipul Pandya 
51977a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_RCV_SCALE_S      24
52077a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_RCV_SCALE_M      0xf
52177a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_RCV_SCALE_V(x)   \
52277a80e23SHariprasad Shenai 	((x) << FW_OFLD_CONNECTION_WR_RCV_SCALE_S)
52377a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_RCV_SCALE_G(x)   \
52477a80e23SHariprasad Shenai 	(((x) >> FW_OFLD_CONNECTION_WR_RCV_SCALE_S) & \
52577a80e23SHariprasad Shenai 	FW_OFLD_CONNECTION_WR_RCV_SCALE_M)
5265be78ee9SVipul Pandya 
52777a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_ASTID_S          0
52877a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_ASTID_M          0xffffff
52977a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_ASTID_V(x)       \
53077a80e23SHariprasad Shenai 	((x) << FW_OFLD_CONNECTION_WR_ASTID_S)
53177a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_ASTID_G(x)       \
53277a80e23SHariprasad Shenai 	(((x) >> FW_OFLD_CONNECTION_WR_ASTID_S) & FW_OFLD_CONNECTION_WR_ASTID_M)
5335be78ee9SVipul Pandya 
53477a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S   15
53577a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M   0x1
53677a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(x)        \
53777a80e23SHariprasad Shenai 	((x) << FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S)
53877a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_G(x)        \
53977a80e23SHariprasad Shenai 	(((x) >> FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S) & \
54077a80e23SHariprasad Shenai 	FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M)
54177a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_F   \
54277a80e23SHariprasad Shenai 	FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(1U)
5435be78ee9SVipul Pandya 
54477a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S       14
54577a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M       0x1
54677a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(x)    \
54777a80e23SHariprasad Shenai 	((x) << FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S)
54877a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_G(x)    \
54977a80e23SHariprasad Shenai 	(((x) >> FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S) & \
55077a80e23SHariprasad Shenai 	FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M)
55177a80e23SHariprasad Shenai #define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_F       \
55277a80e23SHariprasad Shenai 	FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(1U)
5535be78ee9SVipul Pandya 
554f7917c00SJeff Kirsher enum fw_flowc_mnem {
555f7917c00SJeff Kirsher 	FW_FLOWC_MNEM_PFNVFN,		/* PFN [15:8] VFN [7:0] */
556f7917c00SJeff Kirsher 	FW_FLOWC_MNEM_CH,
557f7917c00SJeff Kirsher 	FW_FLOWC_MNEM_PORT,
558f7917c00SJeff Kirsher 	FW_FLOWC_MNEM_IQID,
559f7917c00SJeff Kirsher 	FW_FLOWC_MNEM_SNDNXT,
560f7917c00SJeff Kirsher 	FW_FLOWC_MNEM_RCVNXT,
561f7917c00SJeff Kirsher 	FW_FLOWC_MNEM_SNDBUF,
562f7917c00SJeff Kirsher 	FW_FLOWC_MNEM_MSS,
56364bfead8SKaren Xie 	FW_FLOWC_MNEM_TXDATAPLEN_MAX,
564f7917c00SJeff Kirsher };
565f7917c00SJeff Kirsher 
566f7917c00SJeff Kirsher struct fw_flowc_mnemval {
567f7917c00SJeff Kirsher 	u8 mnemonic;
568f7917c00SJeff Kirsher 	u8 r4[3];
569f7917c00SJeff Kirsher 	__be32 val;
570f7917c00SJeff Kirsher };
571f7917c00SJeff Kirsher 
572f7917c00SJeff Kirsher struct fw_flowc_wr {
573f7917c00SJeff Kirsher 	__be32 op_to_nparams;
574f7917c00SJeff Kirsher 	__be32 flowid_len16;
575f7917c00SJeff Kirsher 	struct fw_flowc_mnemval mnemval[0];
576f7917c00SJeff Kirsher };
577f7917c00SJeff Kirsher 
578e2ac9628SHariprasad Shenai #define FW_FLOWC_WR_NPARAMS_S           0
579e2ac9628SHariprasad Shenai #define FW_FLOWC_WR_NPARAMS_V(x)        ((x) << FW_FLOWC_WR_NPARAMS_S)
580e2ac9628SHariprasad Shenai 
581f7917c00SJeff Kirsher struct fw_ofld_tx_data_wr {
582f7917c00SJeff Kirsher 	__be32 op_to_immdlen;
583f7917c00SJeff Kirsher 	__be32 flowid_len16;
584f7917c00SJeff Kirsher 	__be32 plen;
585f7917c00SJeff Kirsher 	__be32 tunnel_to_proxy;
586f7917c00SJeff Kirsher };
587f7917c00SJeff Kirsher 
588e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_TUNNEL_S     19
589e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_TUNNEL_V(x)  ((x) << FW_OFLD_TX_DATA_WR_TUNNEL_S)
590e2ac9628SHariprasad Shenai 
591e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_SAVE_S       18
592e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_SAVE_V(x)    ((x) << FW_OFLD_TX_DATA_WR_SAVE_S)
593e2ac9628SHariprasad Shenai 
594e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_FLUSH_S      17
595e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_FLUSH_V(x)   ((x) << FW_OFLD_TX_DATA_WR_FLUSH_S)
596e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_FLUSH_F      FW_OFLD_TX_DATA_WR_FLUSH_V(1U)
597e2ac9628SHariprasad Shenai 
598e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_URGENT_S     16
599e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_URGENT_V(x)  ((x) << FW_OFLD_TX_DATA_WR_URGENT_S)
600e2ac9628SHariprasad Shenai 
601e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_MORE_S       15
602e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_MORE_V(x)    ((x) << FW_OFLD_TX_DATA_WR_MORE_S)
603e2ac9628SHariprasad Shenai 
604e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_SHOVE_S      14
605e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_SHOVE_V(x)   ((x) << FW_OFLD_TX_DATA_WR_SHOVE_S)
606e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_SHOVE_F      FW_OFLD_TX_DATA_WR_SHOVE_V(1U)
607e2ac9628SHariprasad Shenai 
608e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_ULPMODE_S    10
609e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_ULPMODE_V(x) ((x) << FW_OFLD_TX_DATA_WR_ULPMODE_S)
610e2ac9628SHariprasad Shenai 
611e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_ULPSUBMODE_S         6
612e2ac9628SHariprasad Shenai #define FW_OFLD_TX_DATA_WR_ULPSUBMODE_V(x)      \
613e2ac9628SHariprasad Shenai 	((x) << FW_OFLD_TX_DATA_WR_ULPSUBMODE_S)
614e2ac9628SHariprasad Shenai 
615f7917c00SJeff Kirsher struct fw_cmd_wr {
616f7917c00SJeff Kirsher 	__be32 op_dma;
617f7917c00SJeff Kirsher 	__be32 len16_pkd;
618f7917c00SJeff Kirsher 	__be64 cookie_daddr;
619f7917c00SJeff Kirsher };
620f7917c00SJeff Kirsher 
621e2ac9628SHariprasad Shenai #define FW_CMD_WR_DMA_S         17
622e2ac9628SHariprasad Shenai #define FW_CMD_WR_DMA_V(x)      ((x) << FW_CMD_WR_DMA_S)
623e2ac9628SHariprasad Shenai 
624f7917c00SJeff Kirsher struct fw_eth_tx_pkt_vm_wr {
625f7917c00SJeff Kirsher 	__be32 op_immdlen;
626f7917c00SJeff Kirsher 	__be32 equiq_to_len16;
627f7917c00SJeff Kirsher 	__be32 r3[2];
628f7917c00SJeff Kirsher 	u8 ethmacdst[6];
629f7917c00SJeff Kirsher 	u8 ethmacsrc[6];
630f7917c00SJeff Kirsher 	__be16 ethtype;
631f7917c00SJeff Kirsher 	__be16 vlantci;
632f7917c00SJeff Kirsher };
633f7917c00SJeff Kirsher 
6342422d9a3SSantosh Rastapur #define FW_CMD_MAX_TIMEOUT 10000
635f7917c00SJeff Kirsher 
636636f9d37SVipul Pandya /*
637636f9d37SVipul Pandya  * If a host driver does a HELLO and discovers that there's already a MASTER
638636f9d37SVipul Pandya  * selected, we may have to wait for that MASTER to finish issuing RESET,
639636f9d37SVipul Pandya  * configuration and INITIALIZE commands.  Also, there's a possibility that
640636f9d37SVipul Pandya  * our own HELLO may get lost if it happens right as the MASTER is issuign a
641636f9d37SVipul Pandya  * RESET command, so we need to be willing to make a few retries of our HELLO.
642636f9d37SVipul Pandya  */
643636f9d37SVipul Pandya #define FW_CMD_HELLO_TIMEOUT	(3 * FW_CMD_MAX_TIMEOUT)
644636f9d37SVipul Pandya #define FW_CMD_HELLO_RETRIES	3
645636f9d37SVipul Pandya 
646636f9d37SVipul Pandya 
647f7917c00SJeff Kirsher enum fw_cmd_opcodes {
648f7917c00SJeff Kirsher 	FW_LDST_CMD                    = 0x01,
649f7917c00SJeff Kirsher 	FW_RESET_CMD                   = 0x03,
650f7917c00SJeff Kirsher 	FW_HELLO_CMD                   = 0x04,
651f7917c00SJeff Kirsher 	FW_BYE_CMD                     = 0x05,
652f7917c00SJeff Kirsher 	FW_INITIALIZE_CMD              = 0x06,
653f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_CMD             = 0x07,
654f7917c00SJeff Kirsher 	FW_PARAMS_CMD                  = 0x08,
655f7917c00SJeff Kirsher 	FW_PFVF_CMD                    = 0x09,
656f7917c00SJeff Kirsher 	FW_IQ_CMD                      = 0x10,
657f7917c00SJeff Kirsher 	FW_EQ_MNGT_CMD                 = 0x11,
658f7917c00SJeff Kirsher 	FW_EQ_ETH_CMD                  = 0x12,
659f7917c00SJeff Kirsher 	FW_EQ_CTRL_CMD                 = 0x13,
660f7917c00SJeff Kirsher 	FW_EQ_OFLD_CMD                 = 0x21,
661f7917c00SJeff Kirsher 	FW_VI_CMD                      = 0x14,
662f7917c00SJeff Kirsher 	FW_VI_MAC_CMD                  = 0x15,
663f7917c00SJeff Kirsher 	FW_VI_RXMODE_CMD               = 0x16,
664f7917c00SJeff Kirsher 	FW_VI_ENABLE_CMD               = 0x17,
665f7917c00SJeff Kirsher 	FW_ACL_MAC_CMD                 = 0x18,
666f7917c00SJeff Kirsher 	FW_ACL_VLAN_CMD                = 0x19,
667f7917c00SJeff Kirsher 	FW_VI_STATS_CMD                = 0x1a,
668f7917c00SJeff Kirsher 	FW_PORT_CMD                    = 0x1b,
669f7917c00SJeff Kirsher 	FW_PORT_STATS_CMD              = 0x1c,
670f7917c00SJeff Kirsher 	FW_PORT_LB_STATS_CMD           = 0x1d,
671f7917c00SJeff Kirsher 	FW_PORT_TRACE_CMD              = 0x1e,
672f7917c00SJeff Kirsher 	FW_PORT_TRACE_MMAP_CMD         = 0x1f,
673f7917c00SJeff Kirsher 	FW_RSS_IND_TBL_CMD             = 0x20,
674f7917c00SJeff Kirsher 	FW_RSS_GLB_CONFIG_CMD          = 0x22,
675f7917c00SJeff Kirsher 	FW_RSS_VI_CONFIG_CMD           = 0x23,
67649aa284fSHariprasad Shenai 	FW_DEVLOG_CMD                  = 0x25,
67701bcca68SVipul Pandya 	FW_CLIP_CMD                    = 0x28,
678f7917c00SJeff Kirsher 	FW_LASTC2E_CMD                 = 0x40,
679f7917c00SJeff Kirsher 	FW_ERROR_CMD                   = 0x80,
680f7917c00SJeff Kirsher 	FW_DEBUG_CMD                   = 0x81,
681f7917c00SJeff Kirsher };
682f7917c00SJeff Kirsher 
683f7917c00SJeff Kirsher enum fw_cmd_cap {
684f7917c00SJeff Kirsher 	FW_CMD_CAP_PF                  = 0x01,
685f7917c00SJeff Kirsher 	FW_CMD_CAP_DMAQ                = 0x02,
686f7917c00SJeff Kirsher 	FW_CMD_CAP_PORT                = 0x04,
687f7917c00SJeff Kirsher 	FW_CMD_CAP_PORTPROMISC         = 0x08,
688f7917c00SJeff Kirsher 	FW_CMD_CAP_PORTSTATS           = 0x10,
689f7917c00SJeff Kirsher 	FW_CMD_CAP_VF                  = 0x80,
690f7917c00SJeff Kirsher };
691f7917c00SJeff Kirsher 
692f7917c00SJeff Kirsher /*
693f7917c00SJeff Kirsher  * Generic command header flit0
694f7917c00SJeff Kirsher  */
695f7917c00SJeff Kirsher struct fw_cmd_hdr {
696f7917c00SJeff Kirsher 	__be32 hi;
697f7917c00SJeff Kirsher 	__be32 lo;
698f7917c00SJeff Kirsher };
699f7917c00SJeff Kirsher 
700e2ac9628SHariprasad Shenai #define FW_CMD_OP_S             24
701e2ac9628SHariprasad Shenai #define FW_CMD_OP_M             0xff
702e2ac9628SHariprasad Shenai #define FW_CMD_OP_V(x)          ((x) << FW_CMD_OP_S)
703e2ac9628SHariprasad Shenai #define FW_CMD_OP_G(x)          (((x) >> FW_CMD_OP_S) & FW_CMD_OP_M)
704e2ac9628SHariprasad Shenai 
705e2ac9628SHariprasad Shenai #define FW_CMD_REQUEST_S        23
706e2ac9628SHariprasad Shenai #define FW_CMD_REQUEST_V(x)     ((x) << FW_CMD_REQUEST_S)
707e2ac9628SHariprasad Shenai #define FW_CMD_REQUEST_F        FW_CMD_REQUEST_V(1U)
708e2ac9628SHariprasad Shenai 
709e2ac9628SHariprasad Shenai #define FW_CMD_READ_S           22
710e2ac9628SHariprasad Shenai #define FW_CMD_READ_V(x)        ((x) << FW_CMD_READ_S)
711e2ac9628SHariprasad Shenai #define FW_CMD_READ_F           FW_CMD_READ_V(1U)
712e2ac9628SHariprasad Shenai 
713e2ac9628SHariprasad Shenai #define FW_CMD_WRITE_S          21
714e2ac9628SHariprasad Shenai #define FW_CMD_WRITE_V(x)       ((x) << FW_CMD_WRITE_S)
715e2ac9628SHariprasad Shenai #define FW_CMD_WRITE_F          FW_CMD_WRITE_V(1U)
716e2ac9628SHariprasad Shenai 
717e2ac9628SHariprasad Shenai #define FW_CMD_EXEC_S           20
718e2ac9628SHariprasad Shenai #define FW_CMD_EXEC_V(x)        ((x) << FW_CMD_EXEC_S)
719e2ac9628SHariprasad Shenai #define FW_CMD_EXEC_F           FW_CMD_EXEC_V(1U)
720e2ac9628SHariprasad Shenai 
721e2ac9628SHariprasad Shenai #define FW_CMD_RAMASK_S         20
722e2ac9628SHariprasad Shenai #define FW_CMD_RAMASK_V(x)      ((x) << FW_CMD_RAMASK_S)
723e2ac9628SHariprasad Shenai 
724e2ac9628SHariprasad Shenai #define FW_CMD_RETVAL_S         8
725e2ac9628SHariprasad Shenai #define FW_CMD_RETVAL_M         0xff
726e2ac9628SHariprasad Shenai #define FW_CMD_RETVAL_V(x)      ((x) << FW_CMD_RETVAL_S)
727e2ac9628SHariprasad Shenai #define FW_CMD_RETVAL_G(x)      (((x) >> FW_CMD_RETVAL_S) & FW_CMD_RETVAL_M)
728e2ac9628SHariprasad Shenai 
729e2ac9628SHariprasad Shenai #define FW_CMD_LEN16_S          0
730e2ac9628SHariprasad Shenai #define FW_CMD_LEN16_V(x)       ((x) << FW_CMD_LEN16_S)
731e2ac9628SHariprasad Shenai 
732e2ac9628SHariprasad Shenai #define FW_LEN16(fw_struct)	FW_CMD_LEN16_V(sizeof(fw_struct) / 16)
733f7917c00SJeff Kirsher 
734f7917c00SJeff Kirsher enum fw_ldst_addrspc {
735f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_FIRMWARE  = 0x0001,
736f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_SGE_EGRC  = 0x0008,
737f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_SGE_INGC  = 0x0009,
738f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_SGE_FLMC  = 0x000a,
739f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_SGE_CONMC = 0x000b,
740f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_TP_PIO    = 0x0010,
741f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_TP_TM_PIO = 0x0011,
742f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_TP_MIB    = 0x0012,
743f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_MDIO      = 0x0018,
744f7917c00SJeff Kirsher 	FW_LDST_ADDRSPC_MPS       = 0x0020,
745ce91a923SNaresh Kumar Inna 	FW_LDST_ADDRSPC_FUNC      = 0x0028,
746ce91a923SNaresh Kumar Inna 	FW_LDST_ADDRSPC_FUNC_PCIE = 0x0029,
747f7917c00SJeff Kirsher };
748f7917c00SJeff Kirsher 
749f7917c00SJeff Kirsher enum fw_ldst_mps_fid {
750f7917c00SJeff Kirsher 	FW_LDST_MPS_ATRB,
751f7917c00SJeff Kirsher 	FW_LDST_MPS_RPLC
752f7917c00SJeff Kirsher };
753f7917c00SJeff Kirsher 
754f7917c00SJeff Kirsher enum fw_ldst_func_access_ctl {
755f7917c00SJeff Kirsher 	FW_LDST_FUNC_ACC_CTL_VIID,
756f7917c00SJeff Kirsher 	FW_LDST_FUNC_ACC_CTL_FID
757f7917c00SJeff Kirsher };
758f7917c00SJeff Kirsher 
759f7917c00SJeff Kirsher enum fw_ldst_func_mod_index {
760f7917c00SJeff Kirsher 	FW_LDST_FUNC_MPS
761f7917c00SJeff Kirsher };
762f7917c00SJeff Kirsher 
763f7917c00SJeff Kirsher struct fw_ldst_cmd {
764f7917c00SJeff Kirsher 	__be32 op_to_addrspace;
7655167865aSHariprasad Shenai #define FW_LDST_CMD_ADDRSPACE_S		0
7665167865aSHariprasad Shenai #define FW_LDST_CMD_ADDRSPACE_V(x)	((x) << FW_LDST_CMD_ADDRSPACE_S)
767f7917c00SJeff Kirsher 	__be32 cycles_to_len16;
768f7917c00SJeff Kirsher 	union fw_ldst {
769f7917c00SJeff Kirsher 		struct fw_ldst_addrval {
770f7917c00SJeff Kirsher 			__be32 addr;
771f7917c00SJeff Kirsher 			__be32 val;
772f7917c00SJeff Kirsher 		} addrval;
773f7917c00SJeff Kirsher 		struct fw_ldst_idctxt {
774f7917c00SJeff Kirsher 			__be32 physid;
775f7917c00SJeff Kirsher 			__be32 msg_pkd;
776f7917c00SJeff Kirsher 			__be32 ctxt_data7;
777f7917c00SJeff Kirsher 			__be32 ctxt_data6;
778f7917c00SJeff Kirsher 			__be32 ctxt_data5;
779f7917c00SJeff Kirsher 			__be32 ctxt_data4;
780f7917c00SJeff Kirsher 			__be32 ctxt_data3;
781f7917c00SJeff Kirsher 			__be32 ctxt_data2;
782f7917c00SJeff Kirsher 			__be32 ctxt_data1;
783f7917c00SJeff Kirsher 			__be32 ctxt_data0;
784f7917c00SJeff Kirsher 		} idctxt;
785f7917c00SJeff Kirsher 		struct fw_ldst_mdio {
786f7917c00SJeff Kirsher 			__be16 paddr_mmd;
787f7917c00SJeff Kirsher 			__be16 raddr;
788f7917c00SJeff Kirsher 			__be16 vctl;
789f7917c00SJeff Kirsher 			__be16 rval;
790f7917c00SJeff Kirsher 		} mdio;
791f7917c00SJeff Kirsher 		struct fw_ldst_mps {
792f7917c00SJeff Kirsher 			__be16 fid_ctl;
793f7917c00SJeff Kirsher 			__be16 rplcpf_pkd;
794f7917c00SJeff Kirsher 			__be32 rplc127_96;
795f7917c00SJeff Kirsher 			__be32 rplc95_64;
796f7917c00SJeff Kirsher 			__be32 rplc63_32;
797f7917c00SJeff Kirsher 			__be32 rplc31_0;
798f7917c00SJeff Kirsher 			__be32 atrb;
799f7917c00SJeff Kirsher 			__be16 vlan[16];
800f7917c00SJeff Kirsher 		} mps;
801f7917c00SJeff Kirsher 		struct fw_ldst_func {
802f7917c00SJeff Kirsher 			u8 access_ctl;
803f7917c00SJeff Kirsher 			u8 mod_index;
804f7917c00SJeff Kirsher 			__be16 ctl_id;
805f7917c00SJeff Kirsher 			__be32 offset;
806f7917c00SJeff Kirsher 			__be64 data0;
807f7917c00SJeff Kirsher 			__be64 data1;
808f7917c00SJeff Kirsher 		} func;
809ce91a923SNaresh Kumar Inna 		struct fw_ldst_pcie {
810ce91a923SNaresh Kumar Inna 			u8 ctrl_to_fn;
811ce91a923SNaresh Kumar Inna 			u8 bnum;
812ce91a923SNaresh Kumar Inna 			u8 r;
813ce91a923SNaresh Kumar Inna 			u8 ext_r;
814ce91a923SNaresh Kumar Inna 			u8 select_naccess;
815ce91a923SNaresh Kumar Inna 			u8 pcie_fn;
816ce91a923SNaresh Kumar Inna 			__be16 nset_pkd;
817ce91a923SNaresh Kumar Inna 			__be32 data[12];
818ce91a923SNaresh Kumar Inna 		} pcie;
819f7917c00SJeff Kirsher 	} u;
820f7917c00SJeff Kirsher };
821f7917c00SJeff Kirsher 
8225167865aSHariprasad Shenai #define FW_LDST_CMD_MSG_S       31
8235167865aSHariprasad Shenai #define FW_LDST_CMD_MSG_V(x)	((x) << FW_LDST_CMD_MSG_S)
8245167865aSHariprasad Shenai 
8255167865aSHariprasad Shenai #define FW_LDST_CMD_PADDR_S     8
8265167865aSHariprasad Shenai #define FW_LDST_CMD_PADDR_V(x)	((x) << FW_LDST_CMD_PADDR_S)
8275167865aSHariprasad Shenai 
8285167865aSHariprasad Shenai #define FW_LDST_CMD_MMD_S       0
8295167865aSHariprasad Shenai #define FW_LDST_CMD_MMD_V(x)	((x) << FW_LDST_CMD_MMD_S)
8305167865aSHariprasad Shenai 
8315167865aSHariprasad Shenai #define FW_LDST_CMD_FID_S       15
8325167865aSHariprasad Shenai #define FW_LDST_CMD_FID_V(x)	((x) << FW_LDST_CMD_FID_S)
8335167865aSHariprasad Shenai 
8345167865aSHariprasad Shenai #define FW_LDST_CMD_CTL_S       0
8355167865aSHariprasad Shenai #define FW_LDST_CMD_CTL_V(x)	((x) << FW_LDST_CMD_CTL_S)
8365167865aSHariprasad Shenai 
8375167865aSHariprasad Shenai #define FW_LDST_CMD_RPLCPF_S    0
8385167865aSHariprasad Shenai #define FW_LDST_CMD_RPLCPF_V(x)	((x) << FW_LDST_CMD_RPLCPF_S)
8395167865aSHariprasad Shenai 
8405167865aSHariprasad Shenai #define FW_LDST_CMD_LC_S        4
8415167865aSHariprasad Shenai #define FW_LDST_CMD_LC_V(x)     ((x) << FW_LDST_CMD_LC_S)
8425167865aSHariprasad Shenai #define FW_LDST_CMD_LC_F	FW_LDST_CMD_LC_V(1U)
8435167865aSHariprasad Shenai 
8445167865aSHariprasad Shenai #define FW_LDST_CMD_FN_S        0
8455167865aSHariprasad Shenai #define FW_LDST_CMD_FN_V(x)	((x) << FW_LDST_CMD_FN_S)
8465167865aSHariprasad Shenai 
8475167865aSHariprasad Shenai #define FW_LDST_CMD_NACCESS_S           0
8485167865aSHariprasad Shenai #define FW_LDST_CMD_NACCESS_V(x)	((x) << FW_LDST_CMD_NACCESS_S)
849f7917c00SJeff Kirsher 
850f7917c00SJeff Kirsher struct fw_reset_cmd {
851f7917c00SJeff Kirsher 	__be32 op_to_write;
852f7917c00SJeff Kirsher 	__be32 retval_len16;
853f7917c00SJeff Kirsher 	__be32 val;
85426f7cbc0SVipul Pandya 	__be32 halt_pkd;
855f7917c00SJeff Kirsher };
856f7917c00SJeff Kirsher 
8575167865aSHariprasad Shenai #define FW_RESET_CMD_HALT_S	31
8585167865aSHariprasad Shenai #define FW_RESET_CMD_HALT_M     0x1
8595167865aSHariprasad Shenai #define FW_RESET_CMD_HALT_V(x)	((x) << FW_RESET_CMD_HALT_S)
8605167865aSHariprasad Shenai #define FW_RESET_CMD_HALT_G(x)  \
8615167865aSHariprasad Shenai 	(((x) >> FW_RESET_CMD_HALT_S) & FW_RESET_CMD_HALT_M)
8625167865aSHariprasad Shenai #define FW_RESET_CMD_HALT_F	FW_RESET_CMD_HALT_V(1U)
86326f7cbc0SVipul Pandya 
864636f9d37SVipul Pandya enum fw_hellow_cmd {
865636f9d37SVipul Pandya 	fw_hello_cmd_stage_os		= 0x0
866636f9d37SVipul Pandya };
867636f9d37SVipul Pandya 
868f7917c00SJeff Kirsher struct fw_hello_cmd {
869f7917c00SJeff Kirsher 	__be32 op_to_write;
870f7917c00SJeff Kirsher 	__be32 retval_len16;
871ce91a923SNaresh Kumar Inna 	__be32 err_to_clearinit;
872f7917c00SJeff Kirsher 	__be32 fwrev;
873f7917c00SJeff Kirsher };
874f7917c00SJeff Kirsher 
8755167865aSHariprasad Shenai #define FW_HELLO_CMD_ERR_S      31
8765167865aSHariprasad Shenai #define FW_HELLO_CMD_ERR_V(x)   ((x) << FW_HELLO_CMD_ERR_S)
8775167865aSHariprasad Shenai #define FW_HELLO_CMD_ERR_F	FW_HELLO_CMD_ERR_V(1U)
8785167865aSHariprasad Shenai 
8795167865aSHariprasad Shenai #define FW_HELLO_CMD_INIT_S     30
8805167865aSHariprasad Shenai #define FW_HELLO_CMD_INIT_V(x)  ((x) << FW_HELLO_CMD_INIT_S)
8815167865aSHariprasad Shenai #define FW_HELLO_CMD_INIT_F	FW_HELLO_CMD_INIT_V(1U)
8825167865aSHariprasad Shenai 
8835167865aSHariprasad Shenai #define FW_HELLO_CMD_MASTERDIS_S	29
8845167865aSHariprasad Shenai #define FW_HELLO_CMD_MASTERDIS_V(x)	((x) << FW_HELLO_CMD_MASTERDIS_S)
8855167865aSHariprasad Shenai 
8865167865aSHariprasad Shenai #define FW_HELLO_CMD_MASTERFORCE_S      28
8875167865aSHariprasad Shenai #define FW_HELLO_CMD_MASTERFORCE_V(x)	((x) << FW_HELLO_CMD_MASTERFORCE_S)
8885167865aSHariprasad Shenai 
8895167865aSHariprasad Shenai #define FW_HELLO_CMD_MBMASTER_S		24
8905167865aSHariprasad Shenai #define FW_HELLO_CMD_MBMASTER_M		0xfU
8915167865aSHariprasad Shenai #define FW_HELLO_CMD_MBMASTER_V(x)	((x) << FW_HELLO_CMD_MBMASTER_S)
8925167865aSHariprasad Shenai #define FW_HELLO_CMD_MBMASTER_G(x)	\
8935167865aSHariprasad Shenai 	(((x) >> FW_HELLO_CMD_MBMASTER_S) & FW_HELLO_CMD_MBMASTER_M)
8945167865aSHariprasad Shenai 
8955167865aSHariprasad Shenai #define FW_HELLO_CMD_MBASYNCNOTINT_S    23
8965167865aSHariprasad Shenai #define FW_HELLO_CMD_MBASYNCNOTINT_V(x)	((x) << FW_HELLO_CMD_MBASYNCNOTINT_S)
8975167865aSHariprasad Shenai 
8985167865aSHariprasad Shenai #define FW_HELLO_CMD_MBASYNCNOT_S       20
8995167865aSHariprasad Shenai #define FW_HELLO_CMD_MBASYNCNOT_V(x)	((x) << FW_HELLO_CMD_MBASYNCNOT_S)
9005167865aSHariprasad Shenai 
9015167865aSHariprasad Shenai #define FW_HELLO_CMD_STAGE_S		17
9025167865aSHariprasad Shenai #define FW_HELLO_CMD_STAGE_V(x)		((x) << FW_HELLO_CMD_STAGE_S)
9035167865aSHariprasad Shenai 
9045167865aSHariprasad Shenai #define FW_HELLO_CMD_CLEARINIT_S        16
9055167865aSHariprasad Shenai #define FW_HELLO_CMD_CLEARINIT_V(x)     ((x) << FW_HELLO_CMD_CLEARINIT_S)
9065167865aSHariprasad Shenai #define FW_HELLO_CMD_CLEARINIT_F	FW_HELLO_CMD_CLEARINIT_V(1U)
9075167865aSHariprasad Shenai 
908f7917c00SJeff Kirsher struct fw_bye_cmd {
909f7917c00SJeff Kirsher 	__be32 op_to_write;
910f7917c00SJeff Kirsher 	__be32 retval_len16;
911f7917c00SJeff Kirsher 	__be64 r3;
912f7917c00SJeff Kirsher };
913f7917c00SJeff Kirsher 
914f7917c00SJeff Kirsher struct fw_initialize_cmd {
915f7917c00SJeff Kirsher 	__be32 op_to_write;
916f7917c00SJeff Kirsher 	__be32 retval_len16;
917f7917c00SJeff Kirsher 	__be64 r3;
918f7917c00SJeff Kirsher };
919f7917c00SJeff Kirsher 
920f7917c00SJeff Kirsher enum fw_caps_config_hm {
921f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_PCIE		= 0x00000001,
922f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_PL		= 0x00000002,
923f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_SGE		= 0x00000004,
924f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_CIM		= 0x00000008,
925f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_ULPTX		= 0x00000010,
926f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_TP		= 0x00000020,
927f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_ULPRX		= 0x00000040,
928f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_PMRX		= 0x00000080,
929f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_PMTX		= 0x00000100,
930f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_MC		= 0x00000200,
931f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_LE		= 0x00000400,
932f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_MPS		= 0x00000800,
933f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_XGMAC		= 0x00001000,
934f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_CPLSWITCH	= 0x00002000,
935f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_T4DBG		= 0x00004000,
936f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_MI		= 0x00008000,
937f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_I2CM		= 0x00010000,
938f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_NCSI		= 0x00020000,
939f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_SMB		= 0x00040000,
940f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_MA		= 0x00080000,
941f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_EDRAM		= 0x00100000,
942f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_PMU		= 0x00200000,
943f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_UART		= 0x00400000,
944f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_HM_SF		= 0x00800000,
945f7917c00SJeff Kirsher };
946f7917c00SJeff Kirsher 
947f7917c00SJeff Kirsher enum fw_caps_config_nbm {
948f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_NBM_IPMI		= 0x00000001,
949f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_NBM_NCSI		= 0x00000002,
950f7917c00SJeff Kirsher };
951f7917c00SJeff Kirsher 
952f7917c00SJeff Kirsher enum fw_caps_config_link {
953f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_LINK_PPP		= 0x00000001,
954f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_LINK_QFC		= 0x00000002,
955f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_LINK_DCBX	= 0x00000004,
956f7917c00SJeff Kirsher };
957f7917c00SJeff Kirsher 
958f7917c00SJeff Kirsher enum fw_caps_config_switch {
959f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_SWITCH_INGRESS	= 0x00000001,
960f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_SWITCH_EGRESS	= 0x00000002,
961f7917c00SJeff Kirsher };
962f7917c00SJeff Kirsher 
963f7917c00SJeff Kirsher enum fw_caps_config_nic {
964f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_NIC		= 0x00000001,
965f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_NIC_VM		= 0x00000002,
966f7917c00SJeff Kirsher };
967f7917c00SJeff Kirsher 
968f7917c00SJeff Kirsher enum fw_caps_config_ofld {
969f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_OFLD		= 0x00000001,
970f7917c00SJeff Kirsher };
971f7917c00SJeff Kirsher 
972f7917c00SJeff Kirsher enum fw_caps_config_rdma {
973f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_RDMA_RDDP	= 0x00000001,
974f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_RDMA_RDMAC	= 0x00000002,
975f7917c00SJeff Kirsher };
976f7917c00SJeff Kirsher 
977f7917c00SJeff Kirsher enum fw_caps_config_iscsi {
978f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_ISCSI_INITIATOR_PDU = 0x00000001,
979f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_ISCSI_TARGET_PDU = 0x00000002,
980f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_ISCSI_INITIATOR_CNXOFLD = 0x00000004,
981f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_ISCSI_TARGET_CNXOFLD = 0x00000008,
982f7917c00SJeff Kirsher };
983f7917c00SJeff Kirsher 
984f7917c00SJeff Kirsher enum fw_caps_config_fcoe {
985f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_FCOE_INITIATOR	= 0x00000001,
986f7917c00SJeff Kirsher 	FW_CAPS_CONFIG_FCOE_TARGET	= 0x00000002,
987ce91a923SNaresh Kumar Inna 	FW_CAPS_CONFIG_FCOE_CTRL_OFLD	= 0x00000004,
988f7917c00SJeff Kirsher };
989f7917c00SJeff Kirsher 
99052367a76SVipul Pandya enum fw_memtype_cf {
99152367a76SVipul Pandya 	FW_MEMTYPE_CF_EDC0		= 0x0,
99252367a76SVipul Pandya 	FW_MEMTYPE_CF_EDC1		= 0x1,
99352367a76SVipul Pandya 	FW_MEMTYPE_CF_EXTMEM		= 0x2,
99452367a76SVipul Pandya 	FW_MEMTYPE_CF_FLASH		= 0x4,
99552367a76SVipul Pandya 	FW_MEMTYPE_CF_INTERNAL		= 0x5,
9967ef65a42SHariprasad Shenai 	FW_MEMTYPE_CF_EXTMEM1           = 0x6,
99752367a76SVipul Pandya };
99852367a76SVipul Pandya 
999f7917c00SJeff Kirsher struct fw_caps_config_cmd {
1000f7917c00SJeff Kirsher 	__be32 op_to_write;
1001ce91a923SNaresh Kumar Inna 	__be32 cfvalid_to_len16;
1002f7917c00SJeff Kirsher 	__be32 r2;
1003f7917c00SJeff Kirsher 	__be32 hwmbitmap;
1004f7917c00SJeff Kirsher 	__be16 nbmcaps;
1005f7917c00SJeff Kirsher 	__be16 linkcaps;
1006f7917c00SJeff Kirsher 	__be16 switchcaps;
1007f7917c00SJeff Kirsher 	__be16 r3;
1008f7917c00SJeff Kirsher 	__be16 niccaps;
1009f7917c00SJeff Kirsher 	__be16 ofldcaps;
1010f7917c00SJeff Kirsher 	__be16 rdmacaps;
1011f7917c00SJeff Kirsher 	__be16 r4;
1012f7917c00SJeff Kirsher 	__be16 iscsicaps;
1013f7917c00SJeff Kirsher 	__be16 fcoecaps;
101452367a76SVipul Pandya 	__be32 cfcsum;
101552367a76SVipul Pandya 	__be32 finiver;
101652367a76SVipul Pandya 	__be32 finicsum;
1017f7917c00SJeff Kirsher };
1018f7917c00SJeff Kirsher 
10195167865aSHariprasad Shenai #define FW_CAPS_CONFIG_CMD_CFVALID_S    27
10205167865aSHariprasad Shenai #define FW_CAPS_CONFIG_CMD_CFVALID_V(x) ((x) << FW_CAPS_CONFIG_CMD_CFVALID_S)
10215167865aSHariprasad Shenai #define FW_CAPS_CONFIG_CMD_CFVALID_F    FW_CAPS_CONFIG_CMD_CFVALID_V(1U)
10225167865aSHariprasad Shenai 
10235167865aSHariprasad Shenai #define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S		24
10245167865aSHariprasad Shenai #define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_V(x)	\
10255167865aSHariprasad Shenai 	((x) << FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S)
10265167865aSHariprasad Shenai 
10275167865aSHariprasad Shenai #define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S      16
10285167865aSHariprasad Shenai #define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_V(x)	\
10295167865aSHariprasad Shenai 	((x) << FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S)
103052367a76SVipul Pandya 
1031f7917c00SJeff Kirsher /*
1032f7917c00SJeff Kirsher  * params command mnemonics
1033f7917c00SJeff Kirsher  */
1034f7917c00SJeff Kirsher enum fw_params_mnem {
1035f7917c00SJeff Kirsher 	FW_PARAMS_MNEM_DEV		= 1,	/* device params */
1036f7917c00SJeff Kirsher 	FW_PARAMS_MNEM_PFVF		= 2,	/* function params */
1037f7917c00SJeff Kirsher 	FW_PARAMS_MNEM_REG		= 3,	/* limited register access */
1038f7917c00SJeff Kirsher 	FW_PARAMS_MNEM_DMAQ		= 4,	/* dma queue params */
10397ef65a42SHariprasad Shenai 	FW_PARAMS_MNEM_CHNET            = 5,    /* chnet params */
1040f7917c00SJeff Kirsher 	FW_PARAMS_MNEM_LAST
1041f7917c00SJeff Kirsher };
1042f7917c00SJeff Kirsher 
1043f7917c00SJeff Kirsher /*
1044f7917c00SJeff Kirsher  * device parameters
1045f7917c00SJeff Kirsher  */
1046f7917c00SJeff Kirsher enum fw_params_param_dev {
1047f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_CCLK	= 0x00, /* chip core clock in khz */
1048f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_PORTVEC	= 0x01, /* the port vector */
1049f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_NTID	= 0x02, /* reads the number of TIDs
1050f7917c00SJeff Kirsher 						 * allocated by the device's
1051f7917c00SJeff Kirsher 						 * Lookup Engine
1052f7917c00SJeff Kirsher 						 */
1053f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ = 0x03,
1054f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_INTVER_NIC	= 0x04,
1055f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_INTVER_VNIC = 0x05,
1056f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_INTVER_OFLD = 0x06,
1057f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_INTVER_RI	= 0x07,
1058f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_INTVER_ISCSIPDU = 0x08,
1059f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_INTVER_ISCSI = 0x09,
1060f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_INTVER_FCOE = 0x0A,
1061f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_FWREV = 0x0B,
1062f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DEV_TPREV = 0x0C,
106352367a76SVipul Pandya 	FW_PARAMS_PARAM_DEV_CF = 0x0D,
1064*01b69614SHariprasad Shenai 	FW_PARAMS_PARAM_DEV_PHYFW = 0x0F,
106570a5f3bbSHariprasad Shenai 	FW_PARAMS_PARAM_DEV_DIAG = 0x11,
10664c2c5763SHariprasad Shenai 	FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD */
10674c2c5763SHariprasad Shenai 	FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER = 0x14, /* max supported adap IRD */
10681ac0f095SKumar Sanghvi 	FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
106949216c1cSHariprasad Shenai 	FW_PARAMS_PARAM_DEV_FWCACHE = 0x18,
1070f7917c00SJeff Kirsher };
1071f7917c00SJeff Kirsher 
1072f7917c00SJeff Kirsher /*
1073f7917c00SJeff Kirsher  * physical and virtual function parameters
1074f7917c00SJeff Kirsher  */
1075f7917c00SJeff Kirsher enum fw_params_param_pfvf {
1076f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_RWXCAPS	= 0x00,
1077f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_ROUTE_START = 0x01,
1078f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_ROUTE_END = 0x02,
1079f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_CLIP_START = 0x03,
1080f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_CLIP_END = 0x04,
1081f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_FILTER_START = 0x05,
1082f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_FILTER_END = 0x06,
1083f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_SERVER_START = 0x07,
1084f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_SERVER_END = 0x08,
1085f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_TDDP_START = 0x09,
1086f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_TDDP_END = 0x0A,
1087f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_ISCSI_START = 0x0B,
1088f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_ISCSI_END = 0x0C,
1089f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_STAG_START = 0x0D,
1090f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_STAG_END = 0x0E,
1091f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_RQ_START = 0x1F,
1092f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_RQ_END	= 0x10,
1093f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_PBL_START = 0x11,
1094f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_PBL_END	= 0x12,
1095f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_L2T_START = 0x13,
1096f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_L2T_END = 0x14,
1097f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_SQRQ_START = 0x15,
1098f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_SQRQ_END	= 0x16,
1099f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_CQ_START	= 0x17,
1100f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_CQ_END	= 0x18,
1101f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_SCHEDCLASS_ETH = 0x20,
1102f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_VIID       = 0x24,
1103f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_CPMASK     = 0x25,
1104f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_OCQ_START  = 0x26,
1105f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_OCQ_END    = 0x27,
1106f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_CONM_MAP   = 0x28,
1107f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_IQFLINT_START = 0x29,
1108f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_IQFLINT_END = 0x2A,
1109f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_EQ_START	= 0x2B,
1110f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_PFVF_EQ_END	= 0x2C,
111152367a76SVipul Pandya 	FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_START = 0x2D,
1112b407a4a9SVipul Pandya 	FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_END = 0x2E,
1113b407a4a9SVipul Pandya 	FW_PARAMS_PARAM_PFVF_ETHOFLD_END = 0x30,
1114b407a4a9SVipul Pandya 	FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31
1115f7917c00SJeff Kirsher };
1116f7917c00SJeff Kirsher 
1117f7917c00SJeff Kirsher /*
1118f7917c00SJeff Kirsher  * dma queue parameters
1119f7917c00SJeff Kirsher  */
1120f7917c00SJeff Kirsher enum fw_params_param_dmaq {
1121f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DMAQ_IQ_DCAEN_DCACPU = 0x00,
1122f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01,
1123f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_MNGT = 0x10,
1124f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_CTRL = 0x11,
1125f7917c00SJeff Kirsher 	FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH = 0x12,
1126989594e2SAnish Bhatt 	FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH = 0x13,
1127b8b1ae99SHariprasad Shenai 	FW_PARAMS_PARAM_DMAQ_CONM_CTXT = 0x20,
1128f7917c00SJeff Kirsher };
1129f7917c00SJeff Kirsher 
1130*01b69614SHariprasad Shenai enum fw_params_param_dev_phyfw {
1131*01b69614SHariprasad Shenai 	FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD = 0x00,
1132*01b69614SHariprasad Shenai 	FW_PARAMS_PARAM_DEV_PHYFW_VERSION = 0x01,
1133*01b69614SHariprasad Shenai };
1134*01b69614SHariprasad Shenai 
113570a5f3bbSHariprasad Shenai enum fw_params_param_dev_diag {
113670a5f3bbSHariprasad Shenai 	FW_PARAM_DEV_DIAG_TMP		= 0x00,
113770a5f3bbSHariprasad Shenai 	FW_PARAM_DEV_DIAG_VDD		= 0x01,
113870a5f3bbSHariprasad Shenai };
113970a5f3bbSHariprasad Shenai 
114049216c1cSHariprasad Shenai enum fw_params_param_dev_fwcache {
114149216c1cSHariprasad Shenai 	FW_PARAM_DEV_FWCACHE_FLUSH      = 0x00,
114249216c1cSHariprasad Shenai 	FW_PARAM_DEV_FWCACHE_FLUSHINV   = 0x01,
114349216c1cSHariprasad Shenai };
114449216c1cSHariprasad Shenai 
11455167865aSHariprasad Shenai #define FW_PARAMS_MNEM_S	24
11465167865aSHariprasad Shenai #define FW_PARAMS_MNEM_V(x)	((x) << FW_PARAMS_MNEM_S)
11475167865aSHariprasad Shenai 
11485167865aSHariprasad Shenai #define FW_PARAMS_PARAM_X_S     16
11495167865aSHariprasad Shenai #define FW_PARAMS_PARAM_X_V(x)	((x) << FW_PARAMS_PARAM_X_S)
11505167865aSHariprasad Shenai 
11515167865aSHariprasad Shenai #define FW_PARAMS_PARAM_Y_S	8
11525167865aSHariprasad Shenai #define FW_PARAMS_PARAM_Y_M	0xffU
11535167865aSHariprasad Shenai #define FW_PARAMS_PARAM_Y_V(x)	((x) << FW_PARAMS_PARAM_Y_S)
11545167865aSHariprasad Shenai #define FW_PARAMS_PARAM_Y_G(x)	(((x) >> FW_PARAMS_PARAM_Y_S) &\
11555167865aSHariprasad Shenai 		FW_PARAMS_PARAM_Y_M)
11565167865aSHariprasad Shenai 
11575167865aSHariprasad Shenai #define FW_PARAMS_PARAM_Z_S	0
11585167865aSHariprasad Shenai #define FW_PARAMS_PARAM_Z_M	0xffu
11595167865aSHariprasad Shenai #define FW_PARAMS_PARAM_Z_V(x)	((x) << FW_PARAMS_PARAM_Z_S)
11605167865aSHariprasad Shenai #define FW_PARAMS_PARAM_Z_G(x)	(((x) >> FW_PARAMS_PARAM_Z_S) &\
11615167865aSHariprasad Shenai 		FW_PARAMS_PARAM_Z_M)
11625167865aSHariprasad Shenai 
11635167865aSHariprasad Shenai #define FW_PARAMS_PARAM_XYZ_S		0
11645167865aSHariprasad Shenai #define FW_PARAMS_PARAM_XYZ_V(x)	((x) << FW_PARAMS_PARAM_XYZ_S)
11655167865aSHariprasad Shenai 
11665167865aSHariprasad Shenai #define FW_PARAMS_PARAM_YZ_S		0
11675167865aSHariprasad Shenai #define FW_PARAMS_PARAM_YZ_V(x)		((x) << FW_PARAMS_PARAM_YZ_S)
1168f7917c00SJeff Kirsher 
1169f7917c00SJeff Kirsher struct fw_params_cmd {
1170f7917c00SJeff Kirsher 	__be32 op_to_vfn;
1171f7917c00SJeff Kirsher 	__be32 retval_len16;
1172f7917c00SJeff Kirsher 	struct fw_params_param {
1173f7917c00SJeff Kirsher 		__be32 mnem;
1174f7917c00SJeff Kirsher 		__be32 val;
1175f7917c00SJeff Kirsher 	} param[7];
1176f7917c00SJeff Kirsher };
1177f7917c00SJeff Kirsher 
11785167865aSHariprasad Shenai #define FW_PARAMS_CMD_PFN_S     8
11795167865aSHariprasad Shenai #define FW_PARAMS_CMD_PFN_V(x)	((x) << FW_PARAMS_CMD_PFN_S)
11805167865aSHariprasad Shenai 
11815167865aSHariprasad Shenai #define FW_PARAMS_CMD_VFN_S     0
11825167865aSHariprasad Shenai #define FW_PARAMS_CMD_VFN_V(x)	((x) << FW_PARAMS_CMD_VFN_S)
1183f7917c00SJeff Kirsher 
1184f7917c00SJeff Kirsher struct fw_pfvf_cmd {
1185f7917c00SJeff Kirsher 	__be32 op_to_vfn;
1186f7917c00SJeff Kirsher 	__be32 retval_len16;
1187f7917c00SJeff Kirsher 	__be32 niqflint_niq;
1188f7917c00SJeff Kirsher 	__be32 type_to_neq;
1189f7917c00SJeff Kirsher 	__be32 tc_to_nexactf;
1190f7917c00SJeff Kirsher 	__be32 r_caps_to_nethctrl;
1191f7917c00SJeff Kirsher 	__be16 nricq;
1192f7917c00SJeff Kirsher 	__be16 nriqp;
1193f7917c00SJeff Kirsher 	__be32 r4;
1194f7917c00SJeff Kirsher };
1195f7917c00SJeff Kirsher 
11965167865aSHariprasad Shenai #define FW_PFVF_CMD_PFN_S	8
11975167865aSHariprasad Shenai #define FW_PFVF_CMD_PFN_V(x)	((x) << FW_PFVF_CMD_PFN_S)
1198f7917c00SJeff Kirsher 
11995167865aSHariprasad Shenai #define FW_PFVF_CMD_VFN_S       0
12005167865aSHariprasad Shenai #define FW_PFVF_CMD_VFN_V(x)	((x) << FW_PFVF_CMD_VFN_S)
1201f7917c00SJeff Kirsher 
12025167865aSHariprasad Shenai #define FW_PFVF_CMD_NIQFLINT_S          20
12035167865aSHariprasad Shenai #define FW_PFVF_CMD_NIQFLINT_M          0xfff
12045167865aSHariprasad Shenai #define FW_PFVF_CMD_NIQFLINT_V(x)	((x) << FW_PFVF_CMD_NIQFLINT_S)
12055167865aSHariprasad Shenai #define FW_PFVF_CMD_NIQFLINT_G(x)	\
12065167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_NIQFLINT_S) & FW_PFVF_CMD_NIQFLINT_M)
1207f7917c00SJeff Kirsher 
12085167865aSHariprasad Shenai #define FW_PFVF_CMD_NIQ_S       0
12095167865aSHariprasad Shenai #define FW_PFVF_CMD_NIQ_M       0xfffff
12105167865aSHariprasad Shenai #define FW_PFVF_CMD_NIQ_V(x)	((x) << FW_PFVF_CMD_NIQ_S)
12115167865aSHariprasad Shenai #define FW_PFVF_CMD_NIQ_G(x)	\
12125167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_NIQ_S) & FW_PFVF_CMD_NIQ_M)
1213f7917c00SJeff Kirsher 
12145167865aSHariprasad Shenai #define FW_PFVF_CMD_TYPE_S      31
12155167865aSHariprasad Shenai #define FW_PFVF_CMD_TYPE_M      0x1
12165167865aSHariprasad Shenai #define FW_PFVF_CMD_TYPE_V(x)   ((x) << FW_PFVF_CMD_TYPE_S)
12175167865aSHariprasad Shenai #define FW_PFVF_CMD_TYPE_G(x)	\
12185167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_TYPE_S) & FW_PFVF_CMD_TYPE_M)
12195167865aSHariprasad Shenai #define FW_PFVF_CMD_TYPE_F      FW_PFVF_CMD_TYPE_V(1U)
1220f7917c00SJeff Kirsher 
12215167865aSHariprasad Shenai #define FW_PFVF_CMD_CMASK_S     24
12225167865aSHariprasad Shenai #define FW_PFVF_CMD_CMASK_M	0xf
12235167865aSHariprasad Shenai #define FW_PFVF_CMD_CMASK_V(x)	((x) << FW_PFVF_CMD_CMASK_S)
12245167865aSHariprasad Shenai #define FW_PFVF_CMD_CMASK_G(x)	\
12255167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_CMASK_S) & FW_PFVF_CMD_CMASK_M)
1226f7917c00SJeff Kirsher 
12275167865aSHariprasad Shenai #define FW_PFVF_CMD_PMASK_S     20
12285167865aSHariprasad Shenai #define FW_PFVF_CMD_PMASK_M	0xf
12295167865aSHariprasad Shenai #define FW_PFVF_CMD_PMASK_V(x)	((x) << FW_PFVF_CMD_PMASK_S)
12305167865aSHariprasad Shenai #define FW_PFVF_CMD_PMASK_G(x) \
12315167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_PMASK_S) & FW_PFVF_CMD_PMASK_M)
1232f7917c00SJeff Kirsher 
12335167865aSHariprasad Shenai #define FW_PFVF_CMD_NEQ_S       0
12345167865aSHariprasad Shenai #define FW_PFVF_CMD_NEQ_M       0xfffff
12355167865aSHariprasad Shenai #define FW_PFVF_CMD_NEQ_V(x)	((x) << FW_PFVF_CMD_NEQ_S)
12365167865aSHariprasad Shenai #define FW_PFVF_CMD_NEQ_G(x)	\
12375167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_NEQ_S) & FW_PFVF_CMD_NEQ_M)
1238f7917c00SJeff Kirsher 
12395167865aSHariprasad Shenai #define FW_PFVF_CMD_TC_S        24
12405167865aSHariprasad Shenai #define FW_PFVF_CMD_TC_M        0xff
12415167865aSHariprasad Shenai #define FW_PFVF_CMD_TC_V(x)	((x) << FW_PFVF_CMD_TC_S)
12425167865aSHariprasad Shenai #define FW_PFVF_CMD_TC_G(x)	(((x) >> FW_PFVF_CMD_TC_S) & FW_PFVF_CMD_TC_M)
1243f7917c00SJeff Kirsher 
12445167865aSHariprasad Shenai #define FW_PFVF_CMD_NVI_S       16
12455167865aSHariprasad Shenai #define FW_PFVF_CMD_NVI_M       0xff
12465167865aSHariprasad Shenai #define FW_PFVF_CMD_NVI_V(x)	((x) << FW_PFVF_CMD_NVI_S)
12475167865aSHariprasad Shenai #define FW_PFVF_CMD_NVI_G(x)	(((x) >> FW_PFVF_CMD_NVI_S) & FW_PFVF_CMD_NVI_M)
1248f7917c00SJeff Kirsher 
12495167865aSHariprasad Shenai #define FW_PFVF_CMD_NEXACTF_S           0
12505167865aSHariprasad Shenai #define FW_PFVF_CMD_NEXACTF_M           0xffff
12515167865aSHariprasad Shenai #define FW_PFVF_CMD_NEXACTF_V(x)	((x) << FW_PFVF_CMD_NEXACTF_S)
12525167865aSHariprasad Shenai #define FW_PFVF_CMD_NEXACTF_G(x)	\
12535167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_NEXACTF_S) & FW_PFVF_CMD_NEXACTF_M)
1254f7917c00SJeff Kirsher 
12555167865aSHariprasad Shenai #define FW_PFVF_CMD_R_CAPS_S    24
12565167865aSHariprasad Shenai #define FW_PFVF_CMD_R_CAPS_M    0xff
12575167865aSHariprasad Shenai #define FW_PFVF_CMD_R_CAPS_V(x) ((x) << FW_PFVF_CMD_R_CAPS_S)
12585167865aSHariprasad Shenai #define FW_PFVF_CMD_R_CAPS_G(x) \
12595167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_R_CAPS_S) & FW_PFVF_CMD_R_CAPS_M)
1260f7917c00SJeff Kirsher 
12615167865aSHariprasad Shenai #define FW_PFVF_CMD_WX_CAPS_S           16
12625167865aSHariprasad Shenai #define FW_PFVF_CMD_WX_CAPS_M           0xff
12635167865aSHariprasad Shenai #define FW_PFVF_CMD_WX_CAPS_V(x)	((x) << FW_PFVF_CMD_WX_CAPS_S)
12645167865aSHariprasad Shenai #define FW_PFVF_CMD_WX_CAPS_G(x)	\
12655167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_WX_CAPS_S) & FW_PFVF_CMD_WX_CAPS_M)
12665167865aSHariprasad Shenai 
12675167865aSHariprasad Shenai #define FW_PFVF_CMD_NETHCTRL_S          0
12685167865aSHariprasad Shenai #define FW_PFVF_CMD_NETHCTRL_M          0xffff
12695167865aSHariprasad Shenai #define FW_PFVF_CMD_NETHCTRL_V(x)	((x) << FW_PFVF_CMD_NETHCTRL_S)
12705167865aSHariprasad Shenai #define FW_PFVF_CMD_NETHCTRL_G(x)	\
12715167865aSHariprasad Shenai 	(((x) >> FW_PFVF_CMD_NETHCTRL_S) & FW_PFVF_CMD_NETHCTRL_M)
1272f7917c00SJeff Kirsher 
1273f7917c00SJeff Kirsher enum fw_iq_type {
1274f7917c00SJeff Kirsher 	FW_IQ_TYPE_FL_INT_CAP,
1275f7917c00SJeff Kirsher 	FW_IQ_TYPE_NO_FL_INT_CAP
1276f7917c00SJeff Kirsher };
1277f7917c00SJeff Kirsher 
1278f7917c00SJeff Kirsher struct fw_iq_cmd {
1279f7917c00SJeff Kirsher 	__be32 op_to_vfn;
1280f7917c00SJeff Kirsher 	__be32 alloc_to_len16;
1281f7917c00SJeff Kirsher 	__be16 physiqid;
1282f7917c00SJeff Kirsher 	__be16 iqid;
1283f7917c00SJeff Kirsher 	__be16 fl0id;
1284f7917c00SJeff Kirsher 	__be16 fl1id;
1285f7917c00SJeff Kirsher 	__be32 type_to_iqandstindex;
1286f7917c00SJeff Kirsher 	__be16 iqdroprss_to_iqesize;
1287f7917c00SJeff Kirsher 	__be16 iqsize;
1288f7917c00SJeff Kirsher 	__be64 iqaddr;
1289f7917c00SJeff Kirsher 	__be32 iqns_to_fl0congen;
1290f7917c00SJeff Kirsher 	__be16 fl0dcaen_to_fl0cidxfthresh;
1291f7917c00SJeff Kirsher 	__be16 fl0size;
1292f7917c00SJeff Kirsher 	__be64 fl0addr;
1293f7917c00SJeff Kirsher 	__be32 fl1cngchmap_to_fl1congen;
1294f7917c00SJeff Kirsher 	__be16 fl1dcaen_to_fl1cidxfthresh;
1295f7917c00SJeff Kirsher 	__be16 fl1size;
1296f7917c00SJeff Kirsher 	__be64 fl1addr;
1297f7917c00SJeff Kirsher };
1298f7917c00SJeff Kirsher 
12996e4b51a6SHariprasad Shenai #define FW_IQ_CMD_PFN_S		8
13006e4b51a6SHariprasad Shenai #define FW_IQ_CMD_PFN_V(x)	((x) << FW_IQ_CMD_PFN_S)
1301f7917c00SJeff Kirsher 
13026e4b51a6SHariprasad Shenai #define FW_IQ_CMD_VFN_S		0
13036e4b51a6SHariprasad Shenai #define FW_IQ_CMD_VFN_V(x)	((x) << FW_IQ_CMD_VFN_S)
1304f7917c00SJeff Kirsher 
13056e4b51a6SHariprasad Shenai #define FW_IQ_CMD_ALLOC_S	31
13066e4b51a6SHariprasad Shenai #define FW_IQ_CMD_ALLOC_V(x)	((x) << FW_IQ_CMD_ALLOC_S)
13076e4b51a6SHariprasad Shenai #define FW_IQ_CMD_ALLOC_F	FW_IQ_CMD_ALLOC_V(1U)
1308f7917c00SJeff Kirsher 
13096e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FREE_S	30
13106e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FREE_V(x)	((x) << FW_IQ_CMD_FREE_S)
13116e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FREE_F	FW_IQ_CMD_FREE_V(1U)
1312f7917c00SJeff Kirsher 
13136e4b51a6SHariprasad Shenai #define FW_IQ_CMD_MODIFY_S	29
13146e4b51a6SHariprasad Shenai #define FW_IQ_CMD_MODIFY_V(x)	((x) << FW_IQ_CMD_MODIFY_S)
13156e4b51a6SHariprasad Shenai #define FW_IQ_CMD_MODIFY_F	FW_IQ_CMD_MODIFY_V(1U)
1316f7917c00SJeff Kirsher 
13176e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQSTART_S	28
13186e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQSTART_V(x)	((x) << FW_IQ_CMD_IQSTART_S)
13196e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQSTART_F	FW_IQ_CMD_IQSTART_V(1U)
1320f7917c00SJeff Kirsher 
13216e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQSTOP_S	27
13226e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQSTOP_V(x)	((x) << FW_IQ_CMD_IQSTOP_S)
13236e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQSTOP_F	FW_IQ_CMD_IQSTOP_V(1U)
1324f7917c00SJeff Kirsher 
13256e4b51a6SHariprasad Shenai #define FW_IQ_CMD_TYPE_S	29
13266e4b51a6SHariprasad Shenai #define FW_IQ_CMD_TYPE_V(x)	((x) << FW_IQ_CMD_TYPE_S)
13276e4b51a6SHariprasad Shenai 
13286e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQASYNCH_S	28
13296e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQASYNCH_V(x)	((x) << FW_IQ_CMD_IQASYNCH_S)
13306e4b51a6SHariprasad Shenai 
13316e4b51a6SHariprasad Shenai #define FW_IQ_CMD_VIID_S	16
13326e4b51a6SHariprasad Shenai #define FW_IQ_CMD_VIID_V(x)	((x) << FW_IQ_CMD_VIID_S)
13336e4b51a6SHariprasad Shenai 
13346e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQANDST_S	15
13356e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQANDST_V(x)	((x) << FW_IQ_CMD_IQANDST_S)
13366e4b51a6SHariprasad Shenai 
13376e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQANUS_S	14
13386e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQANUS_V(x)	((x) << FW_IQ_CMD_IQANUS_S)
13396e4b51a6SHariprasad Shenai 
13406e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQANUD_S	12
13416e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQANUD_V(x)	((x) << FW_IQ_CMD_IQANUD_S)
13426e4b51a6SHariprasad Shenai 
13436e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQANDSTINDEX_S	0
13446e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQANDSTINDEX_V(x)	((x) << FW_IQ_CMD_IQANDSTINDEX_S)
13456e4b51a6SHariprasad Shenai 
13466e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQDROPRSS_S		15
13476e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQDROPRSS_V(x)	((x) << FW_IQ_CMD_IQDROPRSS_S)
13486e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQDROPRSS_F	FW_IQ_CMD_IQDROPRSS_V(1U)
13496e4b51a6SHariprasad Shenai 
13506e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQGTSMODE_S		14
13516e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQGTSMODE_V(x)	((x) << FW_IQ_CMD_IQGTSMODE_S)
13526e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQGTSMODE_F		FW_IQ_CMD_IQGTSMODE_V(1U)
13536e4b51a6SHariprasad Shenai 
13546e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQPCIECH_S	12
13556e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQPCIECH_V(x)	((x) << FW_IQ_CMD_IQPCIECH_S)
13566e4b51a6SHariprasad Shenai 
13576e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQDCAEN_S	11
13586e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQDCAEN_V(x)	((x) << FW_IQ_CMD_IQDCAEN_S)
13596e4b51a6SHariprasad Shenai 
13606e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQDCACPU_S	6
13616e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQDCACPU_V(x)	((x) << FW_IQ_CMD_IQDCACPU_S)
13626e4b51a6SHariprasad Shenai 
13636e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQINTCNTTHRESH_S	4
13646e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQINTCNTTHRESH_V(x)	((x) << FW_IQ_CMD_IQINTCNTTHRESH_S)
13656e4b51a6SHariprasad Shenai 
13666e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQO_S		3
13676e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQO_V(x)	((x) << FW_IQ_CMD_IQO_S)
13686e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQO_F		FW_IQ_CMD_IQO_V(1U)
13696e4b51a6SHariprasad Shenai 
13706e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQCPRIO_S	2
13716e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQCPRIO_V(x)	((x) << FW_IQ_CMD_IQCPRIO_S)
13726e4b51a6SHariprasad Shenai 
13736e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQESIZE_S	0
13746e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQESIZE_V(x)	((x) << FW_IQ_CMD_IQESIZE_S)
13756e4b51a6SHariprasad Shenai 
13766e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQNS_S	31
13776e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQNS_V(x)	((x) << FW_IQ_CMD_IQNS_S)
13786e4b51a6SHariprasad Shenai 
13796e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQRO_S	30
13806e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQRO_V(x)	((x) << FW_IQ_CMD_IQRO_S)
13816e4b51a6SHariprasad Shenai 
13826e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQFLINTIQHSEN_S	28
13836e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQFLINTIQHSEN_V(x)	((x) << FW_IQ_CMD_IQFLINTIQHSEN_S)
13846e4b51a6SHariprasad Shenai 
13856e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQFLINTCONGEN_S	27
13866e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQFLINTCONGEN_V(x)	((x) << FW_IQ_CMD_IQFLINTCONGEN_S)
1387145ef8a5SHariprasad Shenai #define FW_IQ_CMD_IQFLINTCONGEN_F	FW_IQ_CMD_IQFLINTCONGEN_V(1U)
13886e4b51a6SHariprasad Shenai 
13896e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQFLINTISCSIC_S	26
13906e4b51a6SHariprasad Shenai #define FW_IQ_CMD_IQFLINTISCSIC_V(x)	((x) << FW_IQ_CMD_IQFLINTISCSIC_S)
13916e4b51a6SHariprasad Shenai 
13926e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CNGCHMAP_S		20
13936e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CNGCHMAP_V(x)	((x) << FW_IQ_CMD_FL0CNGCHMAP_S)
13946e4b51a6SHariprasad Shenai 
13956e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CACHELOCK_S	15
13966e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CACHELOCK_V(x)	((x) << FW_IQ_CMD_FL0CACHELOCK_S)
13976e4b51a6SHariprasad Shenai 
13986e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DBP_S	14
13996e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DBP_V(x)	((x) << FW_IQ_CMD_FL0DBP_S)
14006e4b51a6SHariprasad Shenai 
14016e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DATANS_S		13
14026e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DATANS_V(x)	((x) << FW_IQ_CMD_FL0DATANS_S)
14036e4b51a6SHariprasad Shenai 
14046e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DATARO_S		12
14056e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DATARO_V(x)	((x) << FW_IQ_CMD_FL0DATARO_S)
14066e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DATARO_F		FW_IQ_CMD_FL0DATARO_V(1U)
14076e4b51a6SHariprasad Shenai 
14086e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CONGCIF_S		11
14096e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CONGCIF_V(x)	((x) << FW_IQ_CMD_FL0CONGCIF_S)
1410145ef8a5SHariprasad Shenai #define FW_IQ_CMD_FL0CONGCIF_F		FW_IQ_CMD_FL0CONGCIF_V(1U)
14116e4b51a6SHariprasad Shenai 
14126e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0ONCHIP_S		10
14136e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0ONCHIP_V(x)	((x) << FW_IQ_CMD_FL0ONCHIP_S)
14146e4b51a6SHariprasad Shenai 
14156e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0STATUSPGNS_S	9
14166e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0STATUSPGNS_V(x)	((x) << FW_IQ_CMD_FL0STATUSPGNS_S)
14176e4b51a6SHariprasad Shenai 
14186e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0STATUSPGRO_S	8
14196e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0STATUSPGRO_V(x)	((x) << FW_IQ_CMD_FL0STATUSPGRO_S)
14206e4b51a6SHariprasad Shenai 
14216e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FETCHNS_S		7
14226e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FETCHNS_V(x)	((x) << FW_IQ_CMD_FL0FETCHNS_S)
14236e4b51a6SHariprasad Shenai 
14246e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FETCHRO_S		6
14256e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FETCHRO_V(x)	((x) << FW_IQ_CMD_FL0FETCHRO_S)
14266e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FETCHRO_F		FW_IQ_CMD_FL0FETCHRO_V(1U)
14276e4b51a6SHariprasad Shenai 
14286e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0HOSTFCMODE_S	4
14296e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0HOSTFCMODE_V(x)	((x) << FW_IQ_CMD_FL0HOSTFCMODE_S)
14306e4b51a6SHariprasad Shenai 
14316e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CPRIO_S	3
14326e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CPRIO_V(x)	((x) << FW_IQ_CMD_FL0CPRIO_S)
14336e4b51a6SHariprasad Shenai 
14346e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0PADEN_S	2
14356e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0PADEN_V(x)	((x) << FW_IQ_CMD_FL0PADEN_S)
14366e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0PADEN_F	FW_IQ_CMD_FL0PADEN_V(1U)
14376e4b51a6SHariprasad Shenai 
14386e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0PACKEN_S		1
14396e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0PACKEN_V(x)	((x) << FW_IQ_CMD_FL0PACKEN_S)
14406e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0PACKEN_F		FW_IQ_CMD_FL0PACKEN_V(1U)
14416e4b51a6SHariprasad Shenai 
14426e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CONGEN_S		0
14436e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CONGEN_V(x)	((x) << FW_IQ_CMD_FL0CONGEN_S)
14446e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CONGEN_F		FW_IQ_CMD_FL0CONGEN_V(1U)
14456e4b51a6SHariprasad Shenai 
14466e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DCAEN_S	15
14476e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DCAEN_V(x)	((x) << FW_IQ_CMD_FL0DCAEN_S)
14486e4b51a6SHariprasad Shenai 
14496e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DCACPU_S		10
14506e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0DCACPU_V(x)	((x) << FW_IQ_CMD_FL0DCACPU_S)
14516e4b51a6SHariprasad Shenai 
14526e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FBMIN_S	7
14536e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FBMIN_V(x)	((x) << FW_IQ_CMD_FL0FBMIN_S)
14546e4b51a6SHariprasad Shenai 
14556e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FBMAX_S	4
14566e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0FBMAX_V(x)	((x) << FW_IQ_CMD_FL0FBMAX_S)
14576e4b51a6SHariprasad Shenai 
14586e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CIDXFTHRESHO_S	3
14596e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CIDXFTHRESHO_V(x)	((x) << FW_IQ_CMD_FL0CIDXFTHRESHO_S)
14606e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CIDXFTHRESHO_F	FW_IQ_CMD_FL0CIDXFTHRESHO_V(1U)
14616e4b51a6SHariprasad Shenai 
14626e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CIDXFTHRESH_S	0
14636e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL0CIDXFTHRESH_V(x)	((x) << FW_IQ_CMD_FL0CIDXFTHRESH_S)
14646e4b51a6SHariprasad Shenai 
14656e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CNGCHMAP_S		20
14666e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CNGCHMAP_V(x)	((x) << FW_IQ_CMD_FL1CNGCHMAP_S)
14676e4b51a6SHariprasad Shenai 
14686e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CACHELOCK_S	15
14696e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CACHELOCK_V(x)	((x) << FW_IQ_CMD_FL1CACHELOCK_S)
14706e4b51a6SHariprasad Shenai 
14716e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DBP_S	14
14726e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DBP_V(x)	((x) << FW_IQ_CMD_FL1DBP_S)
14736e4b51a6SHariprasad Shenai 
14746e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DATANS_S		13
14756e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DATANS_V(x)	((x) << FW_IQ_CMD_FL1DATANS_S)
14766e4b51a6SHariprasad Shenai 
14776e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DATARO_S		12
14786e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DATARO_V(x)	((x) << FW_IQ_CMD_FL1DATARO_S)
14796e4b51a6SHariprasad Shenai 
14806e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CONGCIF_S		11
14816e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CONGCIF_V(x)	((x) << FW_IQ_CMD_FL1CONGCIF_S)
14826e4b51a6SHariprasad Shenai 
14836e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1ONCHIP_S		10
14846e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1ONCHIP_V(x)	((x) << FW_IQ_CMD_FL1ONCHIP_S)
14856e4b51a6SHariprasad Shenai 
14866e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1STATUSPGNS_S	9
14876e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1STATUSPGNS_V(x)	((x) << FW_IQ_CMD_FL1STATUSPGNS_S)
14886e4b51a6SHariprasad Shenai 
14896e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1STATUSPGRO_S	8
14906e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1STATUSPGRO_V(x)	((x) << FW_IQ_CMD_FL1STATUSPGRO_S)
14916e4b51a6SHariprasad Shenai 
14926e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1FETCHNS_S		7
14936e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1FETCHNS_V(x)	((x) << FW_IQ_CMD_FL1FETCHNS_S)
14946e4b51a6SHariprasad Shenai 
14956e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1FETCHRO_S		6
14966e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1FETCHRO_V(x)	((x) << FW_IQ_CMD_FL1FETCHRO_S)
14976e4b51a6SHariprasad Shenai 
14986e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1HOSTFCMODE_S	4
14996e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1HOSTFCMODE_V(x)	((x) << FW_IQ_CMD_FL1HOSTFCMODE_S)
15006e4b51a6SHariprasad Shenai 
15016e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CPRIO_S	3
15026e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CPRIO_V(x)	((x) << FW_IQ_CMD_FL1CPRIO_S)
15036e4b51a6SHariprasad Shenai 
15046e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1PADEN_S	2
15056e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1PADEN_V(x)	((x) << FW_IQ_CMD_FL1PADEN_S)
15066e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1PADEN_F	FW_IQ_CMD_FL1PADEN_V(1U)
15076e4b51a6SHariprasad Shenai 
15086e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1PACKEN_S		1
15096e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1PACKEN_V(x)	((x) << FW_IQ_CMD_FL1PACKEN_S)
15106e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1PACKEN_F	FW_IQ_CMD_FL1PACKEN_V(1U)
15116e4b51a6SHariprasad Shenai 
15126e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CONGEN_S		0
15136e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CONGEN_V(x)	((x) << FW_IQ_CMD_FL1CONGEN_S)
15146e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CONGEN_F	FW_IQ_CMD_FL1CONGEN_V(1U)
15156e4b51a6SHariprasad Shenai 
15166e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DCAEN_S	15
15176e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DCAEN_V(x)	((x) << FW_IQ_CMD_FL1DCAEN_S)
15186e4b51a6SHariprasad Shenai 
15196e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DCACPU_S		10
15206e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1DCACPU_V(x)	((x) << FW_IQ_CMD_FL1DCACPU_S)
15216e4b51a6SHariprasad Shenai 
15226e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1FBMIN_S	7
15236e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1FBMIN_V(x)	((x) << FW_IQ_CMD_FL1FBMIN_S)
15246e4b51a6SHariprasad Shenai 
15256e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1FBMAX_S	4
15266e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1FBMAX_V(x)	((x) << FW_IQ_CMD_FL1FBMAX_S)
15276e4b51a6SHariprasad Shenai 
15286e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CIDXFTHRESHO_S	3
15296e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CIDXFTHRESHO_V(x)	((x) << FW_IQ_CMD_FL1CIDXFTHRESHO_S)
15306e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CIDXFTHRESHO_F	FW_IQ_CMD_FL1CIDXFTHRESHO_V(1U)
15316e4b51a6SHariprasad Shenai 
15326e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CIDXFTHRESH_S	0
15336e4b51a6SHariprasad Shenai #define FW_IQ_CMD_FL1CIDXFTHRESH_V(x)	((x) << FW_IQ_CMD_FL1CIDXFTHRESH_S)
1534f7917c00SJeff Kirsher 
1535f7917c00SJeff Kirsher struct fw_eq_eth_cmd {
1536f7917c00SJeff Kirsher 	__be32 op_to_vfn;
1537f7917c00SJeff Kirsher 	__be32 alloc_to_len16;
1538f7917c00SJeff Kirsher 	__be32 eqid_pkd;
1539f7917c00SJeff Kirsher 	__be32 physeqid_pkd;
1540f7917c00SJeff Kirsher 	__be32 fetchszm_to_iqid;
1541f7917c00SJeff Kirsher 	__be32 dcaen_to_eqsize;
1542f7917c00SJeff Kirsher 	__be64 eqaddr;
1543f7917c00SJeff Kirsher 	__be32 viid_pkd;
1544f7917c00SJeff Kirsher 	__be32 r8_lo;
1545f7917c00SJeff Kirsher 	__be64 r9;
1546f7917c00SJeff Kirsher };
1547f7917c00SJeff Kirsher 
15486e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_PFN_S	8
15496e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_PFN_V(x)	((x) << FW_EQ_ETH_CMD_PFN_S)
1550f7917c00SJeff Kirsher 
15516e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_VFN_S	0
15526e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_VFN_V(x)	((x) << FW_EQ_ETH_CMD_VFN_S)
1553f7917c00SJeff Kirsher 
15546e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_ALLOC_S		31
15556e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_ALLOC_V(x)	((x) << FW_EQ_ETH_CMD_ALLOC_S)
15566e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_ALLOC_F	FW_EQ_ETH_CMD_ALLOC_V(1U)
1557f7917c00SJeff Kirsher 
15586e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FREE_S	30
15596e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FREE_V(x)	((x) << FW_EQ_ETH_CMD_FREE_S)
15606e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FREE_F	FW_EQ_ETH_CMD_FREE_V(1U)
1561f7917c00SJeff Kirsher 
15626e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_MODIFY_S		29
15636e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_MODIFY_V(x)	((x) << FW_EQ_ETH_CMD_MODIFY_S)
15646e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_MODIFY_F	FW_EQ_ETH_CMD_MODIFY_V(1U)
15656e4b51a6SHariprasad Shenai 
15666e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQSTART_S		28
15676e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQSTART_V(x)	((x) << FW_EQ_ETH_CMD_EQSTART_S)
15686e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQSTART_F	FW_EQ_ETH_CMD_EQSTART_V(1U)
15696e4b51a6SHariprasad Shenai 
15706e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQSTOP_S		27
15716e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQSTOP_V(x)	((x) << FW_EQ_ETH_CMD_EQSTOP_S)
15726e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQSTOP_F	FW_EQ_ETH_CMD_EQSTOP_V(1U)
15736e4b51a6SHariprasad Shenai 
15746e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQID_S	0
15756e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQID_M	0xfffff
15766e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQID_V(x)	((x) << FW_EQ_ETH_CMD_EQID_S)
15776e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQID_G(x)	\
15786e4b51a6SHariprasad Shenai 	(((x) >> FW_EQ_ETH_CMD_EQID_S) & FW_EQ_ETH_CMD_EQID_M)
15796e4b51a6SHariprasad Shenai 
15806e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_PHYSEQID_S	0
15816e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_PHYSEQID_M	0xfffff
15826e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_PHYSEQID_V(x)	((x) << FW_EQ_ETH_CMD_PHYSEQID_S)
15836e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_PHYSEQID_G(x)	\
15846e4b51a6SHariprasad Shenai 	(((x) >> FW_EQ_ETH_CMD_PHYSEQID_S) & FW_EQ_ETH_CMD_PHYSEQID_M)
15856e4b51a6SHariprasad Shenai 
15866e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FETCHSZM_S	26
15876e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FETCHSZM_V(x)	((x) << FW_EQ_ETH_CMD_FETCHSZM_S)
15886e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FETCHSZM_F	FW_EQ_ETH_CMD_FETCHSZM_V(1U)
15896e4b51a6SHariprasad Shenai 
15906e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_STATUSPGNS_S	25
15916e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_STATUSPGNS_V(x)	((x) << FW_EQ_ETH_CMD_STATUSPGNS_S)
15926e4b51a6SHariprasad Shenai 
15936e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_STATUSPGRO_S	24
15946e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_STATUSPGRO_V(x)	((x) << FW_EQ_ETH_CMD_STATUSPGRO_S)
15956e4b51a6SHariprasad Shenai 
15966e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FETCHNS_S		23
15976e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FETCHNS_V(x)	((x) << FW_EQ_ETH_CMD_FETCHNS_S)
15986e4b51a6SHariprasad Shenai 
15996e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FETCHRO_S		22
16006e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FETCHRO_V(x)	((x) << FW_EQ_ETH_CMD_FETCHRO_S)
16011ecc7b7aSHariprasad Shenai #define FW_EQ_ETH_CMD_FETCHRO_F		FW_EQ_ETH_CMD_FETCHRO_V(1U)
16026e4b51a6SHariprasad Shenai 
16036e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_HOSTFCMODE_S	20
16046e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_HOSTFCMODE_V(x)	((x) << FW_EQ_ETH_CMD_HOSTFCMODE_S)
16056e4b51a6SHariprasad Shenai 
16066e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_CPRIO_S		19
16076e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_CPRIO_V(x)	((x) << FW_EQ_ETH_CMD_CPRIO_S)
16086e4b51a6SHariprasad Shenai 
16096e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_ONCHIP_S		18
16106e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_ONCHIP_V(x)	((x) << FW_EQ_ETH_CMD_ONCHIP_S)
16116e4b51a6SHariprasad Shenai 
16126e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_PCIECHN_S		16
16136e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_PCIECHN_V(x)	((x) << FW_EQ_ETH_CMD_PCIECHN_S)
16146e4b51a6SHariprasad Shenai 
16156e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_IQID_S	0
16166e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_IQID_V(x)	((x) << FW_EQ_ETH_CMD_IQID_S)
16176e4b51a6SHariprasad Shenai 
16186e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_DCAEN_S		31
16196e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_DCAEN_V(x)	((x) << FW_EQ_ETH_CMD_DCAEN_S)
16206e4b51a6SHariprasad Shenai 
16216e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_DCACPU_S		26
16226e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_DCACPU_V(x)	((x) << FW_EQ_ETH_CMD_DCACPU_S)
16236e4b51a6SHariprasad Shenai 
16246e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FBMIN_S		23
16256e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FBMIN_V(x)	((x) << FW_EQ_ETH_CMD_FBMIN_S)
16266e4b51a6SHariprasad Shenai 
16276e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FBMAX_S		20
16286e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_FBMAX_V(x)	((x) << FW_EQ_ETH_CMD_FBMAX_S)
16296e4b51a6SHariprasad Shenai 
16306e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_CIDXFTHRESHO_S	19
16316e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_CIDXFTHRESHO_V(x)	((x) << FW_EQ_ETH_CMD_CIDXFTHRESHO_S)
16326e4b51a6SHariprasad Shenai 
16336e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_CIDXFTHRESH_S	16
16346e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_CIDXFTHRESH_V(x)	((x) << FW_EQ_ETH_CMD_CIDXFTHRESH_S)
16356e4b51a6SHariprasad Shenai 
16366e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQSIZE_S		0
16376e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_EQSIZE_V(x)	((x) << FW_EQ_ETH_CMD_EQSIZE_S)
16386e4b51a6SHariprasad Shenai 
16396e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_AUTOEQUEQE_S	30
16406e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_AUTOEQUEQE_V(x)	((x) << FW_EQ_ETH_CMD_AUTOEQUEQE_S)
16416e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_AUTOEQUEQE_F	FW_EQ_ETH_CMD_AUTOEQUEQE_V(1U)
16426e4b51a6SHariprasad Shenai 
16436e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_VIID_S	16
16446e4b51a6SHariprasad Shenai #define FW_EQ_ETH_CMD_VIID_V(x)	((x) << FW_EQ_ETH_CMD_VIID_S)
1645f7917c00SJeff Kirsher 
1646f7917c00SJeff Kirsher struct fw_eq_ctrl_cmd {
1647f7917c00SJeff Kirsher 	__be32 op_to_vfn;
1648f7917c00SJeff Kirsher 	__be32 alloc_to_len16;
1649f7917c00SJeff Kirsher 	__be32 cmpliqid_eqid;
1650f7917c00SJeff Kirsher 	__be32 physeqid_pkd;
1651f7917c00SJeff Kirsher 	__be32 fetchszm_to_iqid;
1652f7917c00SJeff Kirsher 	__be32 dcaen_to_eqsize;
1653f7917c00SJeff Kirsher 	__be64 eqaddr;
1654f7917c00SJeff Kirsher };
1655f7917c00SJeff Kirsher 
16566e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_PFN_S	8
16576e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_PFN_V(x)	((x) << FW_EQ_CTRL_CMD_PFN_S)
1658f7917c00SJeff Kirsher 
16596e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_VFN_S	0
16606e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_VFN_V(x)	((x) << FW_EQ_CTRL_CMD_VFN_S)
1661f7917c00SJeff Kirsher 
16626e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_ALLOC_S		31
16636e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_ALLOC_V(x)	((x) << FW_EQ_CTRL_CMD_ALLOC_S)
16646e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_ALLOC_F		FW_EQ_CTRL_CMD_ALLOC_V(1U)
1665f7917c00SJeff Kirsher 
16666e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FREE_S		30
16676e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FREE_V(x)	((x) << FW_EQ_CTRL_CMD_FREE_S)
16686e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FREE_F		FW_EQ_CTRL_CMD_FREE_V(1U)
1669f7917c00SJeff Kirsher 
16706e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_MODIFY_S		29
16716e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_MODIFY_V(x)	((x) << FW_EQ_CTRL_CMD_MODIFY_S)
16726e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_MODIFY_F		FW_EQ_CTRL_CMD_MODIFY_V(1U)
16736e4b51a6SHariprasad Shenai 
16746e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQSTART_S	28
16756e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQSTART_V(x)	((x) << FW_EQ_CTRL_CMD_EQSTART_S)
16766e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQSTART_F	FW_EQ_CTRL_CMD_EQSTART_V(1U)
16776e4b51a6SHariprasad Shenai 
16786e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQSTOP_S		27
16796e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQSTOP_V(x)	((x) << FW_EQ_CTRL_CMD_EQSTOP_S)
16806e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQSTOP_F		FW_EQ_CTRL_CMD_EQSTOP_V(1U)
16816e4b51a6SHariprasad Shenai 
16826e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_CMPLIQID_S	20
16836e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_CMPLIQID_V(x)	((x) << FW_EQ_CTRL_CMD_CMPLIQID_S)
16846e4b51a6SHariprasad Shenai 
16856e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQID_S		0
16866e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQID_M		0xfffff
16876e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQID_V(x)	((x) << FW_EQ_CTRL_CMD_EQID_S)
16886e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQID_G(x)	\
16896e4b51a6SHariprasad Shenai 	(((x) >> FW_EQ_CTRL_CMD_EQID_S) & FW_EQ_CTRL_CMD_EQID_M)
16906e4b51a6SHariprasad Shenai 
16916e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_PHYSEQID_S	0
16926e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_PHYSEQID_M	0xfffff
16936e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_PHYSEQID_G(x)	\
16946e4b51a6SHariprasad Shenai 	(((x) >> FW_EQ_CTRL_CMD_PHYSEQID_S) & FW_EQ_CTRL_CMD_PHYSEQID_M)
16956e4b51a6SHariprasad Shenai 
16966e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHSZM_S	26
16976e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHSZM_V(x)	((x) << FW_EQ_CTRL_CMD_FETCHSZM_S)
16986e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHSZM_F	FW_EQ_CTRL_CMD_FETCHSZM_V(1U)
16996e4b51a6SHariprasad Shenai 
17006e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_STATUSPGNS_S	25
17016e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_STATUSPGNS_V(x)	((x) << FW_EQ_CTRL_CMD_STATUSPGNS_S)
17026e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_STATUSPGNS_F	FW_EQ_CTRL_CMD_STATUSPGNS_V(1U)
17036e4b51a6SHariprasad Shenai 
17046e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_STATUSPGRO_S	24
17056e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_STATUSPGRO_V(x)	((x) << FW_EQ_CTRL_CMD_STATUSPGRO_S)
17066e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_STATUSPGRO_F	FW_EQ_CTRL_CMD_STATUSPGRO_V(1U)
17076e4b51a6SHariprasad Shenai 
17086e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHNS_S	23
17096e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHNS_V(x)	((x) << FW_EQ_CTRL_CMD_FETCHNS_S)
17106e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHNS_F	FW_EQ_CTRL_CMD_FETCHNS_V(1U)
17116e4b51a6SHariprasad Shenai 
17126e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHRO_S	22
17136e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHRO_V(x)	((x) << FW_EQ_CTRL_CMD_FETCHRO_S)
17146e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FETCHRO_F	FW_EQ_CTRL_CMD_FETCHRO_V(1U)
17156e4b51a6SHariprasad Shenai 
17166e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_HOSTFCMODE_S	20
17176e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_HOSTFCMODE_V(x)	((x) << FW_EQ_CTRL_CMD_HOSTFCMODE_S)
17186e4b51a6SHariprasad Shenai 
17196e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_CPRIO_S		19
17206e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_CPRIO_V(x)	((x) << FW_EQ_CTRL_CMD_CPRIO_S)
17216e4b51a6SHariprasad Shenai 
17226e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_ONCHIP_S		18
17236e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_ONCHIP_V(x)	((x) << FW_EQ_CTRL_CMD_ONCHIP_S)
17246e4b51a6SHariprasad Shenai 
17256e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_PCIECHN_S	16
17266e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_PCIECHN_V(x)	((x) << FW_EQ_CTRL_CMD_PCIECHN_S)
17276e4b51a6SHariprasad Shenai 
17286e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_IQID_S		0
17296e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_IQID_V(x)	((x) << FW_EQ_CTRL_CMD_IQID_S)
17306e4b51a6SHariprasad Shenai 
17316e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_DCAEN_S		31
17326e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_DCAEN_V(x)	((x) << FW_EQ_CTRL_CMD_DCAEN_S)
17336e4b51a6SHariprasad Shenai 
17346e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_DCACPU_S		26
17356e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_DCACPU_V(x)	((x) << FW_EQ_CTRL_CMD_DCACPU_S)
17366e4b51a6SHariprasad Shenai 
17376e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FBMIN_S		23
17386e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FBMIN_V(x)	((x) << FW_EQ_CTRL_CMD_FBMIN_S)
17396e4b51a6SHariprasad Shenai 
17406e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FBMAX_S		20
17416e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_FBMAX_V(x)	((x) << FW_EQ_CTRL_CMD_FBMAX_S)
17426e4b51a6SHariprasad Shenai 
17436e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_CIDXFTHRESHO_S		19
17446e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_CIDXFTHRESHO_V(x)	\
17456e4b51a6SHariprasad Shenai 	((x) << FW_EQ_CTRL_CMD_CIDXFTHRESHO_S)
17466e4b51a6SHariprasad Shenai 
17476e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_CIDXFTHRESH_S	16
17486e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_CIDXFTHRESH_V(x)	((x) << FW_EQ_CTRL_CMD_CIDXFTHRESH_S)
17496e4b51a6SHariprasad Shenai 
17506e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQSIZE_S		0
17516e4b51a6SHariprasad Shenai #define FW_EQ_CTRL_CMD_EQSIZE_V(x)	((x) << FW_EQ_CTRL_CMD_EQSIZE_S)
1752f7917c00SJeff Kirsher 
1753f7917c00SJeff Kirsher struct fw_eq_ofld_cmd {
1754f7917c00SJeff Kirsher 	__be32 op_to_vfn;
1755f7917c00SJeff Kirsher 	__be32 alloc_to_len16;
1756f7917c00SJeff Kirsher 	__be32 eqid_pkd;
1757f7917c00SJeff Kirsher 	__be32 physeqid_pkd;
1758f7917c00SJeff Kirsher 	__be32 fetchszm_to_iqid;
1759f7917c00SJeff Kirsher 	__be32 dcaen_to_eqsize;
1760f7917c00SJeff Kirsher 	__be64 eqaddr;
1761f7917c00SJeff Kirsher };
1762f7917c00SJeff Kirsher 
17636e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_PFN_S	8
17646e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_PFN_V(x)	((x) << FW_EQ_OFLD_CMD_PFN_S)
1765f7917c00SJeff Kirsher 
17666e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_VFN_S	0
17676e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_VFN_V(x)	((x) << FW_EQ_OFLD_CMD_VFN_S)
1768f7917c00SJeff Kirsher 
17696e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_ALLOC_S		31
17706e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_ALLOC_V(x)	((x) << FW_EQ_OFLD_CMD_ALLOC_S)
17716e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_ALLOC_F		FW_EQ_OFLD_CMD_ALLOC_V(1U)
1772f7917c00SJeff Kirsher 
17736e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FREE_S		30
17746e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FREE_V(x)	((x) << FW_EQ_OFLD_CMD_FREE_S)
17756e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FREE_F		FW_EQ_OFLD_CMD_FREE_V(1U)
1776f7917c00SJeff Kirsher 
17776e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_MODIFY_S		29
17786e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_MODIFY_V(x)	((x) << FW_EQ_OFLD_CMD_MODIFY_S)
17796e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_MODIFY_F		FW_EQ_OFLD_CMD_MODIFY_V(1U)
17806e4b51a6SHariprasad Shenai 
17816e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQSTART_S	28
17826e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQSTART_V(x)	((x) << FW_EQ_OFLD_CMD_EQSTART_S)
17836e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQSTART_F	FW_EQ_OFLD_CMD_EQSTART_V(1U)
17846e4b51a6SHariprasad Shenai 
17856e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQSTOP_S		27
17866e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQSTOP_V(x)	((x) << FW_EQ_OFLD_CMD_EQSTOP_S)
17876e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQSTOP_F		FW_EQ_OFLD_CMD_EQSTOP_V(1U)
17886e4b51a6SHariprasad Shenai 
17896e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQID_S		0
17906e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQID_M		0xfffff
17916e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQID_V(x)	((x) << FW_EQ_OFLD_CMD_EQID_S)
17926e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQID_G(x)	\
17936e4b51a6SHariprasad Shenai 	(((x) >> FW_EQ_OFLD_CMD_EQID_S) & FW_EQ_OFLD_CMD_EQID_M)
17946e4b51a6SHariprasad Shenai 
17956e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_PHYSEQID_S	0
17966e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_PHYSEQID_M	0xfffff
17976e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_PHYSEQID_G(x)	\
17986e4b51a6SHariprasad Shenai 	(((x) >> FW_EQ_OFLD_CMD_PHYSEQID_S) & FW_EQ_OFLD_CMD_PHYSEQID_M)
17996e4b51a6SHariprasad Shenai 
18006e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FETCHSZM_S	26
18016e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FETCHSZM_V(x)	((x) << FW_EQ_OFLD_CMD_FETCHSZM_S)
18026e4b51a6SHariprasad Shenai 
18036e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_STATUSPGNS_S	25
18046e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_STATUSPGNS_V(x)	((x) << FW_EQ_OFLD_CMD_STATUSPGNS_S)
18056e4b51a6SHariprasad Shenai 
18066e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_STATUSPGRO_S	24
18076e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_STATUSPGRO_V(x)	((x) << FW_EQ_OFLD_CMD_STATUSPGRO_S)
18086e4b51a6SHariprasad Shenai 
18096e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FETCHNS_S	23
18106e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FETCHNS_V(x)	((x) << FW_EQ_OFLD_CMD_FETCHNS_S)
18116e4b51a6SHariprasad Shenai 
18126e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FETCHRO_S	22
18136e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FETCHRO_V(x)	((x) << FW_EQ_OFLD_CMD_FETCHRO_S)
18146e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FETCHRO_F	FW_EQ_OFLD_CMD_FETCHRO_V(1U)
18156e4b51a6SHariprasad Shenai 
18166e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_HOSTFCMODE_S	20
18176e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_HOSTFCMODE_V(x)	((x) << FW_EQ_OFLD_CMD_HOSTFCMODE_S)
18186e4b51a6SHariprasad Shenai 
18196e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_CPRIO_S		19
18206e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_CPRIO_V(x)	((x) << FW_EQ_OFLD_CMD_CPRIO_S)
18216e4b51a6SHariprasad Shenai 
18226e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_ONCHIP_S		18
18236e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_ONCHIP_V(x)	((x) << FW_EQ_OFLD_CMD_ONCHIP_S)
18246e4b51a6SHariprasad Shenai 
18256e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_PCIECHN_S	16
18266e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_PCIECHN_V(x)	((x) << FW_EQ_OFLD_CMD_PCIECHN_S)
18276e4b51a6SHariprasad Shenai 
18286e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_IQID_S		0
18296e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_IQID_V(x)	((x) << FW_EQ_OFLD_CMD_IQID_S)
18306e4b51a6SHariprasad Shenai 
18316e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_DCAEN_S		31
18326e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_DCAEN_V(x)	((x) << FW_EQ_OFLD_CMD_DCAEN_S)
18336e4b51a6SHariprasad Shenai 
18346e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_DCACPU_S		26
18356e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_DCACPU_V(x)	((x) << FW_EQ_OFLD_CMD_DCACPU_S)
18366e4b51a6SHariprasad Shenai 
18376e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FBMIN_S		23
18386e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FBMIN_V(x)	((x) << FW_EQ_OFLD_CMD_FBMIN_S)
18396e4b51a6SHariprasad Shenai 
18406e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FBMAX_S		20
18416e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_FBMAX_V(x)	((x) << FW_EQ_OFLD_CMD_FBMAX_S)
18426e4b51a6SHariprasad Shenai 
18436e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_CIDXFTHRESHO_S		19
18446e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_CIDXFTHRESHO_V(x)	\
18456e4b51a6SHariprasad Shenai 	((x) << FW_EQ_OFLD_CMD_CIDXFTHRESHO_S)
18466e4b51a6SHariprasad Shenai 
18476e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_CIDXFTHRESH_S	16
18486e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_CIDXFTHRESH_V(x)	((x) << FW_EQ_OFLD_CMD_CIDXFTHRESH_S)
18496e4b51a6SHariprasad Shenai 
18506e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQSIZE_S		0
18516e4b51a6SHariprasad Shenai #define FW_EQ_OFLD_CMD_EQSIZE_V(x)	((x) << FW_EQ_OFLD_CMD_EQSIZE_S)
1852f7917c00SJeff Kirsher 
1853f7917c00SJeff Kirsher /*
1854f7917c00SJeff Kirsher  * Macros for VIID parsing:
1855f7917c00SJeff Kirsher  * VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number
1856f7917c00SJeff Kirsher  */
1857d7990b0cSAnish Bhatt 
1858d7990b0cSAnish Bhatt #define FW_VIID_PFN_S           8
1859d7990b0cSAnish Bhatt #define FW_VIID_PFN_M           0x7
1860d7990b0cSAnish Bhatt #define FW_VIID_PFN_G(x)        (((x) >> FW_VIID_PFN_S) & FW_VIID_PFN_M)
1861d7990b0cSAnish Bhatt 
18622b5fb1f2SHariprasad Shenai #define FW_VIID_VIVLD_S		7
18632b5fb1f2SHariprasad Shenai #define FW_VIID_VIVLD_M		0x1
18642b5fb1f2SHariprasad Shenai #define FW_VIID_VIVLD_G(x)	(((x) >> FW_VIID_VIVLD_S) & FW_VIID_VIVLD_M)
18652b5fb1f2SHariprasad Shenai 
18662b5fb1f2SHariprasad Shenai #define FW_VIID_VIN_S		0
18672b5fb1f2SHariprasad Shenai #define FW_VIID_VIN_M		0x7F
18682b5fb1f2SHariprasad Shenai #define FW_VIID_VIN_G(x)	(((x) >> FW_VIID_VIN_S) & FW_VIID_VIN_M)
1869f7917c00SJeff Kirsher 
1870f7917c00SJeff Kirsher struct fw_vi_cmd {
1871f7917c00SJeff Kirsher 	__be32 op_to_vfn;
1872f7917c00SJeff Kirsher 	__be32 alloc_to_len16;
1873f7917c00SJeff Kirsher 	__be16 type_viid;
1874f7917c00SJeff Kirsher 	u8 mac[6];
1875f7917c00SJeff Kirsher 	u8 portid_pkd;
1876f7917c00SJeff Kirsher 	u8 nmac;
1877f7917c00SJeff Kirsher 	u8 nmac0[6];
1878f7917c00SJeff Kirsher 	__be16 rsssize_pkd;
1879f7917c00SJeff Kirsher 	u8 nmac1[6];
1880f7917c00SJeff Kirsher 	__be16 idsiiq_pkd;
1881f7917c00SJeff Kirsher 	u8 nmac2[6];
1882f7917c00SJeff Kirsher 	__be16 idseiq_pkd;
1883f7917c00SJeff Kirsher 	u8 nmac3[6];
1884f7917c00SJeff Kirsher 	__be64 r9;
1885f7917c00SJeff Kirsher 	__be64 r10;
1886f7917c00SJeff Kirsher };
1887f7917c00SJeff Kirsher 
18882b5fb1f2SHariprasad Shenai #define FW_VI_CMD_PFN_S		8
18892b5fb1f2SHariprasad Shenai #define FW_VI_CMD_PFN_V(x)	((x) << FW_VI_CMD_PFN_S)
18902b5fb1f2SHariprasad Shenai 
18912b5fb1f2SHariprasad Shenai #define FW_VI_CMD_VFN_S		0
18922b5fb1f2SHariprasad Shenai #define FW_VI_CMD_VFN_V(x)	((x) << FW_VI_CMD_VFN_S)
18932b5fb1f2SHariprasad Shenai 
18942b5fb1f2SHariprasad Shenai #define FW_VI_CMD_ALLOC_S	31
18952b5fb1f2SHariprasad Shenai #define FW_VI_CMD_ALLOC_V(x)	((x) << FW_VI_CMD_ALLOC_S)
18962b5fb1f2SHariprasad Shenai #define FW_VI_CMD_ALLOC_F	FW_VI_CMD_ALLOC_V(1U)
18972b5fb1f2SHariprasad Shenai 
18982b5fb1f2SHariprasad Shenai #define FW_VI_CMD_FREE_S	30
18992b5fb1f2SHariprasad Shenai #define FW_VI_CMD_FREE_V(x)	((x) << FW_VI_CMD_FREE_S)
19002b5fb1f2SHariprasad Shenai #define FW_VI_CMD_FREE_F	FW_VI_CMD_FREE_V(1U)
19012b5fb1f2SHariprasad Shenai 
19022b5fb1f2SHariprasad Shenai #define FW_VI_CMD_VIID_S	0
19032b5fb1f2SHariprasad Shenai #define FW_VI_CMD_VIID_M	0xfff
19042b5fb1f2SHariprasad Shenai #define FW_VI_CMD_VIID_V(x)	((x) << FW_VI_CMD_VIID_S)
19052b5fb1f2SHariprasad Shenai #define FW_VI_CMD_VIID_G(x)	(((x) >> FW_VI_CMD_VIID_S) & FW_VI_CMD_VIID_M)
19062b5fb1f2SHariprasad Shenai 
19072b5fb1f2SHariprasad Shenai #define FW_VI_CMD_PORTID_S	4
19082b5fb1f2SHariprasad Shenai #define FW_VI_CMD_PORTID_M	0xf
19092b5fb1f2SHariprasad Shenai #define FW_VI_CMD_PORTID_V(x)	((x) << FW_VI_CMD_PORTID_S)
19102b5fb1f2SHariprasad Shenai #define FW_VI_CMD_PORTID_G(x)	\
19112b5fb1f2SHariprasad Shenai 	(((x) >> FW_VI_CMD_PORTID_S) & FW_VI_CMD_PORTID_M)
19122b5fb1f2SHariprasad Shenai 
19132b5fb1f2SHariprasad Shenai #define FW_VI_CMD_RSSSIZE_S	0
19142b5fb1f2SHariprasad Shenai #define FW_VI_CMD_RSSSIZE_M	0x7ff
19152b5fb1f2SHariprasad Shenai #define FW_VI_CMD_RSSSIZE_G(x)	\
19162b5fb1f2SHariprasad Shenai 	(((x) >> FW_VI_CMD_RSSSIZE_S) & FW_VI_CMD_RSSSIZE_M)
1917f7917c00SJeff Kirsher 
1918f7917c00SJeff Kirsher /* Special VI_MAC command index ids */
1919f7917c00SJeff Kirsher #define FW_VI_MAC_ADD_MAC		0x3FF
1920f7917c00SJeff Kirsher #define FW_VI_MAC_ADD_PERSIST_MAC	0x3FE
1921f7917c00SJeff Kirsher #define FW_VI_MAC_MAC_BASED_FREE	0x3FD
1922f7917c00SJeff Kirsher #define FW_CLS_TCAM_NUM_ENTRIES		336
1923f7917c00SJeff Kirsher 
1924f7917c00SJeff Kirsher enum fw_vi_mac_smac {
1925f7917c00SJeff Kirsher 	FW_VI_MAC_MPS_TCAM_ENTRY,
1926f7917c00SJeff Kirsher 	FW_VI_MAC_MPS_TCAM_ONLY,
1927f7917c00SJeff Kirsher 	FW_VI_MAC_SMT_ONLY,
1928f7917c00SJeff Kirsher 	FW_VI_MAC_SMT_AND_MPSTCAM
1929f7917c00SJeff Kirsher };
1930f7917c00SJeff Kirsher 
1931f7917c00SJeff Kirsher enum fw_vi_mac_result {
1932f7917c00SJeff Kirsher 	FW_VI_MAC_R_SUCCESS,
1933f7917c00SJeff Kirsher 	FW_VI_MAC_R_F_NONEXISTENT_NOMEM,
1934f7917c00SJeff Kirsher 	FW_VI_MAC_R_SMAC_FAIL,
1935f7917c00SJeff Kirsher 	FW_VI_MAC_R_F_ACL_CHECK
1936f7917c00SJeff Kirsher };
1937f7917c00SJeff Kirsher 
1938f7917c00SJeff Kirsher struct fw_vi_mac_cmd {
1939f7917c00SJeff Kirsher 	__be32 op_to_viid;
1940f7917c00SJeff Kirsher 	__be32 freemacs_to_len16;
1941f7917c00SJeff Kirsher 	union fw_vi_mac {
1942f7917c00SJeff Kirsher 		struct fw_vi_mac_exact {
1943f7917c00SJeff Kirsher 			__be16 valid_to_idx;
1944f7917c00SJeff Kirsher 			u8 macaddr[6];
1945f7917c00SJeff Kirsher 		} exact[7];
1946f7917c00SJeff Kirsher 		struct fw_vi_mac_hash {
1947f7917c00SJeff Kirsher 			__be64 hashvec;
1948f7917c00SJeff Kirsher 		} hash;
1949f7917c00SJeff Kirsher 	} u;
1950f7917c00SJeff Kirsher };
1951f7917c00SJeff Kirsher 
19522b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_VIID_S	0
19532b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_VIID_V(x)	((x) << FW_VI_MAC_CMD_VIID_S)
19542b5fb1f2SHariprasad Shenai 
19552b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_FREEMACS_S	31
19562b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_FREEMACS_V(x)	((x) << FW_VI_MAC_CMD_FREEMACS_S)
19572b5fb1f2SHariprasad Shenai 
19582b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_HASHVECEN_S	23
19592b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_HASHVECEN_V(x)	((x) << FW_VI_MAC_CMD_HASHVECEN_S)
19602b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_HASHVECEN_F	FW_VI_MAC_CMD_HASHVECEN_V(1U)
19612b5fb1f2SHariprasad Shenai 
19622b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_HASHUNIEN_S	22
19632b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_HASHUNIEN_V(x)	((x) << FW_VI_MAC_CMD_HASHUNIEN_S)
19642b5fb1f2SHariprasad Shenai 
19652b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_VALID_S		15
19662b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_VALID_V(x)	((x) << FW_VI_MAC_CMD_VALID_S)
19672b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_VALID_F	FW_VI_MAC_CMD_VALID_V(1U)
19682b5fb1f2SHariprasad Shenai 
19692b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_PRIO_S	12
19702b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_PRIO_V(x)	((x) << FW_VI_MAC_CMD_PRIO_S)
19712b5fb1f2SHariprasad Shenai 
19722b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_SMAC_RESULT_S	10
19732b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_SMAC_RESULT_M	0x3
19742b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_SMAC_RESULT_V(x)	((x) << FW_VI_MAC_CMD_SMAC_RESULT_S)
19752b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_SMAC_RESULT_G(x)	\
19762b5fb1f2SHariprasad Shenai 	(((x) >> FW_VI_MAC_CMD_SMAC_RESULT_S) & FW_VI_MAC_CMD_SMAC_RESULT_M)
19772b5fb1f2SHariprasad Shenai 
19782b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_IDX_S	0
19792b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_IDX_M	0x3ff
19802b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_IDX_V(x)	((x) << FW_VI_MAC_CMD_IDX_S)
19812b5fb1f2SHariprasad Shenai #define FW_VI_MAC_CMD_IDX_G(x)	\
19822b5fb1f2SHariprasad Shenai 	(((x) >> FW_VI_MAC_CMD_IDX_S) & FW_VI_MAC_CMD_IDX_M)
1983f7917c00SJeff Kirsher 
1984f7917c00SJeff Kirsher #define FW_RXMODE_MTU_NO_CHG	65535
1985f7917c00SJeff Kirsher 
1986f7917c00SJeff Kirsher struct fw_vi_rxmode_cmd {
1987f7917c00SJeff Kirsher 	__be32 op_to_viid;
1988f7917c00SJeff Kirsher 	__be32 retval_len16;
1989f7917c00SJeff Kirsher 	__be32 mtu_to_vlanexen;
1990f7917c00SJeff Kirsher 	__be32 r4_lo;
1991f7917c00SJeff Kirsher };
1992f7917c00SJeff Kirsher 
19932b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_VIID_S		0
19942b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_VIID_V(x)	((x) << FW_VI_RXMODE_CMD_VIID_S)
19952b5fb1f2SHariprasad Shenai 
19962b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_MTU_S		16
19972b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_MTU_M		0xffff
19982b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_MTU_V(x)	((x) << FW_VI_RXMODE_CMD_MTU_S)
19992b5fb1f2SHariprasad Shenai 
20002b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_PROMISCEN_S	14
20012b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_PROMISCEN_M	0x3
20022b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_PROMISCEN_V(x)	((x) << FW_VI_RXMODE_CMD_PROMISCEN_S)
20032b5fb1f2SHariprasad Shenai 
20042b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_ALLMULTIEN_S		12
20052b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_ALLMULTIEN_M		0x3
20062b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_ALLMULTIEN_V(x)	\
20072b5fb1f2SHariprasad Shenai 	((x) << FW_VI_RXMODE_CMD_ALLMULTIEN_S)
20082b5fb1f2SHariprasad Shenai 
20092b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_BROADCASTEN_S		10
20102b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_BROADCASTEN_M		0x3
20112b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_BROADCASTEN_V(x)	\
20122b5fb1f2SHariprasad Shenai 	((x) << FW_VI_RXMODE_CMD_BROADCASTEN_S)
20132b5fb1f2SHariprasad Shenai 
20142b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_VLANEXEN_S	8
20152b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_VLANEXEN_M	0x3
20162b5fb1f2SHariprasad Shenai #define FW_VI_RXMODE_CMD_VLANEXEN_V(x)	((x) << FW_VI_RXMODE_CMD_VLANEXEN_S)
2017f7917c00SJeff Kirsher 
2018f7917c00SJeff Kirsher struct fw_vi_enable_cmd {
2019f7917c00SJeff Kirsher 	__be32 op_to_viid;
2020f7917c00SJeff Kirsher 	__be32 ien_to_len16;
2021f7917c00SJeff Kirsher 	__be16 blinkdur;
2022f7917c00SJeff Kirsher 	__be16 r3;
2023f7917c00SJeff Kirsher 	__be32 r4;
2024f7917c00SJeff Kirsher };
2025f7917c00SJeff Kirsher 
20262b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_VIID_S         0
20272b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_VIID_V(x)      ((x) << FW_VI_ENABLE_CMD_VIID_S)
20282b5fb1f2SHariprasad Shenai 
20292b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_IEN_S		31
20302b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_IEN_V(x)	((x) << FW_VI_ENABLE_CMD_IEN_S)
20312b5fb1f2SHariprasad Shenai 
20322b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_EEN_S		30
20332b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_EEN_V(x)	((x) << FW_VI_ENABLE_CMD_EEN_S)
20342b5fb1f2SHariprasad Shenai 
20352b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_LED_S		29
20362b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_LED_V(x)	((x) << FW_VI_ENABLE_CMD_LED_S)
20372b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_LED_F	FW_VI_ENABLE_CMD_LED_V(1U)
20382b5fb1f2SHariprasad Shenai 
20392b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_DCB_INFO_S	28
20402b5fb1f2SHariprasad Shenai #define FW_VI_ENABLE_CMD_DCB_INFO_V(x)	((x) << FW_VI_ENABLE_CMD_DCB_INFO_S)
2041f7917c00SJeff Kirsher 
2042f7917c00SJeff Kirsher /* VI VF stats offset definitions */
2043f7917c00SJeff Kirsher #define VI_VF_NUM_STATS	16
2044f7917c00SJeff Kirsher enum fw_vi_stats_vf_index {
2045f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_BCAST_BYTES_IX,
2046f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_BCAST_FRAMES_IX,
2047f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_MCAST_BYTES_IX,
2048f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_MCAST_FRAMES_IX,
2049f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_UCAST_BYTES_IX,
2050f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_UCAST_FRAMES_IX,
2051f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_DROP_FRAMES_IX,
2052f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_OFLD_BYTES_IX,
2053f7917c00SJeff Kirsher 	FW_VI_VF_STAT_TX_OFLD_FRAMES_IX,
2054f7917c00SJeff Kirsher 	FW_VI_VF_STAT_RX_BCAST_BYTES_IX,
2055f7917c00SJeff Kirsher 	FW_VI_VF_STAT_RX_BCAST_FRAMES_IX,
2056f7917c00SJeff Kirsher 	FW_VI_VF_STAT_RX_MCAST_BYTES_IX,
2057f7917c00SJeff Kirsher 	FW_VI_VF_STAT_RX_MCAST_FRAMES_IX,
2058f7917c00SJeff Kirsher 	FW_VI_VF_STAT_RX_UCAST_BYTES_IX,
2059f7917c00SJeff Kirsher 	FW_VI_VF_STAT_RX_UCAST_FRAMES_IX,
2060f7917c00SJeff Kirsher 	FW_VI_VF_STAT_RX_ERR_FRAMES_IX
2061f7917c00SJeff Kirsher };
2062f7917c00SJeff Kirsher 
2063f7917c00SJeff Kirsher /* VI PF stats offset definitions */
2064f7917c00SJeff Kirsher #define VI_PF_NUM_STATS	17
2065f7917c00SJeff Kirsher enum fw_vi_stats_pf_index {
2066f7917c00SJeff Kirsher 	FW_VI_PF_STAT_TX_BCAST_BYTES_IX,
2067f7917c00SJeff Kirsher 	FW_VI_PF_STAT_TX_BCAST_FRAMES_IX,
2068f7917c00SJeff Kirsher 	FW_VI_PF_STAT_TX_MCAST_BYTES_IX,
2069f7917c00SJeff Kirsher 	FW_VI_PF_STAT_TX_MCAST_FRAMES_IX,
2070f7917c00SJeff Kirsher 	FW_VI_PF_STAT_TX_UCAST_BYTES_IX,
2071f7917c00SJeff Kirsher 	FW_VI_PF_STAT_TX_UCAST_FRAMES_IX,
2072f7917c00SJeff Kirsher 	FW_VI_PF_STAT_TX_OFLD_BYTES_IX,
2073f7917c00SJeff Kirsher 	FW_VI_PF_STAT_TX_OFLD_FRAMES_IX,
2074f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_BYTES_IX,
2075f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_FRAMES_IX,
2076f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_BCAST_BYTES_IX,
2077f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_BCAST_FRAMES_IX,
2078f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_MCAST_BYTES_IX,
2079f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_MCAST_FRAMES_IX,
2080f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_UCAST_BYTES_IX,
2081f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_UCAST_FRAMES_IX,
2082f7917c00SJeff Kirsher 	FW_VI_PF_STAT_RX_ERR_FRAMES_IX
2083f7917c00SJeff Kirsher };
2084f7917c00SJeff Kirsher 
2085f7917c00SJeff Kirsher struct fw_vi_stats_cmd {
2086f7917c00SJeff Kirsher 	__be32 op_to_viid;
2087f7917c00SJeff Kirsher 	__be32 retval_len16;
2088f7917c00SJeff Kirsher 	union fw_vi_stats {
2089f7917c00SJeff Kirsher 		struct fw_vi_stats_ctl {
2090f7917c00SJeff Kirsher 			__be16 nstats_ix;
2091f7917c00SJeff Kirsher 			__be16 r6;
2092f7917c00SJeff Kirsher 			__be32 r7;
2093f7917c00SJeff Kirsher 			__be64 stat0;
2094f7917c00SJeff Kirsher 			__be64 stat1;
2095f7917c00SJeff Kirsher 			__be64 stat2;
2096f7917c00SJeff Kirsher 			__be64 stat3;
2097f7917c00SJeff Kirsher 			__be64 stat4;
2098f7917c00SJeff Kirsher 			__be64 stat5;
2099f7917c00SJeff Kirsher 		} ctl;
2100f7917c00SJeff Kirsher 		struct fw_vi_stats_pf {
2101f7917c00SJeff Kirsher 			__be64 tx_bcast_bytes;
2102f7917c00SJeff Kirsher 			__be64 tx_bcast_frames;
2103f7917c00SJeff Kirsher 			__be64 tx_mcast_bytes;
2104f7917c00SJeff Kirsher 			__be64 tx_mcast_frames;
2105f7917c00SJeff Kirsher 			__be64 tx_ucast_bytes;
2106f7917c00SJeff Kirsher 			__be64 tx_ucast_frames;
2107f7917c00SJeff Kirsher 			__be64 tx_offload_bytes;
2108f7917c00SJeff Kirsher 			__be64 tx_offload_frames;
2109f7917c00SJeff Kirsher 			__be64 rx_pf_bytes;
2110f7917c00SJeff Kirsher 			__be64 rx_pf_frames;
2111f7917c00SJeff Kirsher 			__be64 rx_bcast_bytes;
2112f7917c00SJeff Kirsher 			__be64 rx_bcast_frames;
2113f7917c00SJeff Kirsher 			__be64 rx_mcast_bytes;
2114f7917c00SJeff Kirsher 			__be64 rx_mcast_frames;
2115f7917c00SJeff Kirsher 			__be64 rx_ucast_bytes;
2116f7917c00SJeff Kirsher 			__be64 rx_ucast_frames;
2117f7917c00SJeff Kirsher 			__be64 rx_err_frames;
2118f7917c00SJeff Kirsher 		} pf;
2119f7917c00SJeff Kirsher 		struct fw_vi_stats_vf {
2120f7917c00SJeff Kirsher 			__be64 tx_bcast_bytes;
2121f7917c00SJeff Kirsher 			__be64 tx_bcast_frames;
2122f7917c00SJeff Kirsher 			__be64 tx_mcast_bytes;
2123f7917c00SJeff Kirsher 			__be64 tx_mcast_frames;
2124f7917c00SJeff Kirsher 			__be64 tx_ucast_bytes;
2125f7917c00SJeff Kirsher 			__be64 tx_ucast_frames;
2126f7917c00SJeff Kirsher 			__be64 tx_drop_frames;
2127f7917c00SJeff Kirsher 			__be64 tx_offload_bytes;
2128f7917c00SJeff Kirsher 			__be64 tx_offload_frames;
2129f7917c00SJeff Kirsher 			__be64 rx_bcast_bytes;
2130f7917c00SJeff Kirsher 			__be64 rx_bcast_frames;
2131f7917c00SJeff Kirsher 			__be64 rx_mcast_bytes;
2132f7917c00SJeff Kirsher 			__be64 rx_mcast_frames;
2133f7917c00SJeff Kirsher 			__be64 rx_ucast_bytes;
2134f7917c00SJeff Kirsher 			__be64 rx_ucast_frames;
2135f7917c00SJeff Kirsher 			__be64 rx_err_frames;
2136f7917c00SJeff Kirsher 		} vf;
2137f7917c00SJeff Kirsher 	} u;
2138f7917c00SJeff Kirsher };
2139f7917c00SJeff Kirsher 
21402b5fb1f2SHariprasad Shenai #define FW_VI_STATS_CMD_VIID_S		0
21412b5fb1f2SHariprasad Shenai #define FW_VI_STATS_CMD_VIID_V(x)	((x) << FW_VI_STATS_CMD_VIID_S)
21422b5fb1f2SHariprasad Shenai 
21432b5fb1f2SHariprasad Shenai #define FW_VI_STATS_CMD_NSTATS_S	12
21442b5fb1f2SHariprasad Shenai #define FW_VI_STATS_CMD_NSTATS_V(x)	((x) << FW_VI_STATS_CMD_NSTATS_S)
21452b5fb1f2SHariprasad Shenai 
21462b5fb1f2SHariprasad Shenai #define FW_VI_STATS_CMD_IX_S	0
21472b5fb1f2SHariprasad Shenai #define FW_VI_STATS_CMD_IX_V(x)	((x) << FW_VI_STATS_CMD_IX_S)
2148f7917c00SJeff Kirsher 
2149f7917c00SJeff Kirsher struct fw_acl_mac_cmd {
2150f7917c00SJeff Kirsher 	__be32 op_to_vfn;
2151f7917c00SJeff Kirsher 	__be32 en_to_len16;
2152f7917c00SJeff Kirsher 	u8 nmac;
2153f7917c00SJeff Kirsher 	u8 r3[7];
2154f7917c00SJeff Kirsher 	__be16 r4;
2155f7917c00SJeff Kirsher 	u8 macaddr0[6];
2156f7917c00SJeff Kirsher 	__be16 r5;
2157f7917c00SJeff Kirsher 	u8 macaddr1[6];
2158f7917c00SJeff Kirsher 	__be16 r6;
2159f7917c00SJeff Kirsher 	u8 macaddr2[6];
2160f7917c00SJeff Kirsher 	__be16 r7;
2161f7917c00SJeff Kirsher 	u8 macaddr3[6];
2162f7917c00SJeff Kirsher };
2163f7917c00SJeff Kirsher 
21642b5fb1f2SHariprasad Shenai #define FW_ACL_MAC_CMD_PFN_S	8
21652b5fb1f2SHariprasad Shenai #define FW_ACL_MAC_CMD_PFN_V(x)	((x) << FW_ACL_MAC_CMD_PFN_S)
21662b5fb1f2SHariprasad Shenai 
21672b5fb1f2SHariprasad Shenai #define FW_ACL_MAC_CMD_VFN_S	0
21682b5fb1f2SHariprasad Shenai #define FW_ACL_MAC_CMD_VFN_V(x)	((x) << FW_ACL_MAC_CMD_VFN_S)
21692b5fb1f2SHariprasad Shenai 
21702b5fb1f2SHariprasad Shenai #define FW_ACL_MAC_CMD_EN_S	31
21712b5fb1f2SHariprasad Shenai #define FW_ACL_MAC_CMD_EN_V(x)	((x) << FW_ACL_MAC_CMD_EN_S)
2172f7917c00SJeff Kirsher 
2173f7917c00SJeff Kirsher struct fw_acl_vlan_cmd {
2174f7917c00SJeff Kirsher 	__be32 op_to_vfn;
2175f7917c00SJeff Kirsher 	__be32 en_to_len16;
2176f7917c00SJeff Kirsher 	u8 nvlan;
2177f7917c00SJeff Kirsher 	u8 dropnovlan_fm;
2178f7917c00SJeff Kirsher 	u8 r3_lo[6];
2179f7917c00SJeff Kirsher 	__be16 vlanid[16];
2180f7917c00SJeff Kirsher };
2181f7917c00SJeff Kirsher 
21822b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_PFN_S		8
21832b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_PFN_V(x)	((x) << FW_ACL_VLAN_CMD_PFN_S)
21842b5fb1f2SHariprasad Shenai 
21852b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_VFN_S		0
21862b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_VFN_V(x)	((x) << FW_ACL_VLAN_CMD_VFN_S)
21872b5fb1f2SHariprasad Shenai 
21882b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_EN_S	31
21892b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_EN_V(x)	((x) << FW_ACL_VLAN_CMD_EN_S)
21902b5fb1f2SHariprasad Shenai 
21912b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_DROPNOVLAN_S	7
21922b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_DROPNOVLAN_V(x)	((x) << FW_ACL_VLAN_CMD_DROPNOVLAN_S)
21932b5fb1f2SHariprasad Shenai 
21942b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_FM_S	6
21952b5fb1f2SHariprasad Shenai #define FW_ACL_VLAN_CMD_FM_V(x)	((x) << FW_ACL_VLAN_CMD_FM_S)
2196f7917c00SJeff Kirsher 
2197f7917c00SJeff Kirsher enum fw_port_cap {
2198f7917c00SJeff Kirsher 	FW_PORT_CAP_SPEED_100M		= 0x0001,
2199f7917c00SJeff Kirsher 	FW_PORT_CAP_SPEED_1G		= 0x0002,
2200f7917c00SJeff Kirsher 	FW_PORT_CAP_SPEED_2_5G		= 0x0004,
2201f7917c00SJeff Kirsher 	FW_PORT_CAP_SPEED_10G		= 0x0008,
2202f7917c00SJeff Kirsher 	FW_PORT_CAP_SPEED_40G		= 0x0010,
2203f7917c00SJeff Kirsher 	FW_PORT_CAP_SPEED_100G		= 0x0020,
2204f7917c00SJeff Kirsher 	FW_PORT_CAP_FC_RX		= 0x0040,
2205f7917c00SJeff Kirsher 	FW_PORT_CAP_FC_TX		= 0x0080,
2206f7917c00SJeff Kirsher 	FW_PORT_CAP_ANEG		= 0x0100,
2207f7917c00SJeff Kirsher 	FW_PORT_CAP_MDI_0		= 0x0200,
2208f7917c00SJeff Kirsher 	FW_PORT_CAP_MDI_1		= 0x0400,
2209f7917c00SJeff Kirsher 	FW_PORT_CAP_BEAN		= 0x0800,
2210f7917c00SJeff Kirsher 	FW_PORT_CAP_PMA_LPBK		= 0x1000,
2211f7917c00SJeff Kirsher 	FW_PORT_CAP_PCS_LPBK		= 0x2000,
2212f7917c00SJeff Kirsher 	FW_PORT_CAP_PHYXS_LPBK		= 0x4000,
2213f7917c00SJeff Kirsher 	FW_PORT_CAP_FAR_END_LPBK	= 0x8000,
2214f7917c00SJeff Kirsher };
2215f7917c00SJeff Kirsher 
2216f7917c00SJeff Kirsher enum fw_port_mdi {
22172b5fb1f2SHariprasad Shenai 	FW_PORT_CAP_MDI_UNCHANGED,
22182b5fb1f2SHariprasad Shenai 	FW_PORT_CAP_MDI_AUTO,
22192b5fb1f2SHariprasad Shenai 	FW_PORT_CAP_MDI_F_STRAIGHT,
22202b5fb1f2SHariprasad Shenai 	FW_PORT_CAP_MDI_F_CROSSOVER
2221f7917c00SJeff Kirsher };
2222f7917c00SJeff Kirsher 
22232b5fb1f2SHariprasad Shenai #define FW_PORT_CAP_MDI_S 9
22242b5fb1f2SHariprasad Shenai #define FW_PORT_CAP_MDI_V(x) ((x) << FW_PORT_CAP_MDI_S)
2225f7917c00SJeff Kirsher 
2226f7917c00SJeff Kirsher enum fw_port_action {
2227f7917c00SJeff Kirsher 	FW_PORT_ACTION_L1_CFG		= 0x0001,
2228f7917c00SJeff Kirsher 	FW_PORT_ACTION_L2_CFG		= 0x0002,
2229f7917c00SJeff Kirsher 	FW_PORT_ACTION_GET_PORT_INFO	= 0x0003,
2230f7917c00SJeff Kirsher 	FW_PORT_ACTION_L2_PPP_CFG	= 0x0004,
2231f7917c00SJeff Kirsher 	FW_PORT_ACTION_L2_DCB_CFG	= 0x0005,
2232989594e2SAnish Bhatt 	FW_PORT_ACTION_DCB_READ_TRANS	= 0x0006,
2233989594e2SAnish Bhatt 	FW_PORT_ACTION_DCB_READ_RECV	= 0x0007,
2234989594e2SAnish Bhatt 	FW_PORT_ACTION_DCB_READ_DET	= 0x0008,
2235f7917c00SJeff Kirsher 	FW_PORT_ACTION_LOW_PWR_TO_NORMAL = 0x0010,
2236f7917c00SJeff Kirsher 	FW_PORT_ACTION_L1_LOW_PWR_EN	= 0x0011,
2237f7917c00SJeff Kirsher 	FW_PORT_ACTION_L2_WOL_MODE_EN	= 0x0012,
2238f7917c00SJeff Kirsher 	FW_PORT_ACTION_LPBK_TO_NORMAL	= 0x0020,
2239f7917c00SJeff Kirsher 	FW_PORT_ACTION_L1_LPBK		= 0x0021,
2240f7917c00SJeff Kirsher 	FW_PORT_ACTION_L1_PMA_LPBK	= 0x0022,
2241f7917c00SJeff Kirsher 	FW_PORT_ACTION_L1_PCS_LPBK	= 0x0023,
2242f7917c00SJeff Kirsher 	FW_PORT_ACTION_L1_PHYXS_CSIDE_LPBK = 0x0024,
2243f7917c00SJeff Kirsher 	FW_PORT_ACTION_L1_PHYXS_ESIDE_LPBK = 0x0025,
2244f7917c00SJeff Kirsher 	FW_PORT_ACTION_PHY_RESET	= 0x0040,
2245f7917c00SJeff Kirsher 	FW_PORT_ACTION_PMA_RESET	= 0x0041,
2246f7917c00SJeff Kirsher 	FW_PORT_ACTION_PCS_RESET	= 0x0042,
2247f7917c00SJeff Kirsher 	FW_PORT_ACTION_PHYXS_RESET	= 0x0043,
2248f7917c00SJeff Kirsher 	FW_PORT_ACTION_DTEXS_REEST	= 0x0044,
2249f7917c00SJeff Kirsher 	FW_PORT_ACTION_AN_RESET		= 0x0045
2250f7917c00SJeff Kirsher };
2251f7917c00SJeff Kirsher 
2252f7917c00SJeff Kirsher enum fw_port_l2cfg_ctlbf {
2253f7917c00SJeff Kirsher 	FW_PORT_L2_CTLBF_OVLAN0	= 0x01,
2254f7917c00SJeff Kirsher 	FW_PORT_L2_CTLBF_OVLAN1	= 0x02,
2255f7917c00SJeff Kirsher 	FW_PORT_L2_CTLBF_OVLAN2	= 0x04,
2256f7917c00SJeff Kirsher 	FW_PORT_L2_CTLBF_OVLAN3	= 0x08,
2257f7917c00SJeff Kirsher 	FW_PORT_L2_CTLBF_IVLAN	= 0x10,
2258f7917c00SJeff Kirsher 	FW_PORT_L2_CTLBF_TXIPG	= 0x20
2259f7917c00SJeff Kirsher };
2260f7917c00SJeff Kirsher 
226110b00466SAnish Bhatt enum fw_port_dcb_versions {
226210b00466SAnish Bhatt 	FW_PORT_DCB_VER_UNKNOWN,
226310b00466SAnish Bhatt 	FW_PORT_DCB_VER_CEE1D0,
226410b00466SAnish Bhatt 	FW_PORT_DCB_VER_CEE1D01,
226510b00466SAnish Bhatt 	FW_PORT_DCB_VER_IEEE,
226610b00466SAnish Bhatt 	FW_PORT_DCB_VER_AUTO = 7
226710b00466SAnish Bhatt };
226810b00466SAnish Bhatt 
2269f7917c00SJeff Kirsher enum fw_port_dcb_cfg {
2270f7917c00SJeff Kirsher 	FW_PORT_DCB_CFG_PG	= 0x01,
2271f7917c00SJeff Kirsher 	FW_PORT_DCB_CFG_PFC	= 0x02,
2272f7917c00SJeff Kirsher 	FW_PORT_DCB_CFG_APPL	= 0x04
2273f7917c00SJeff Kirsher };
2274f7917c00SJeff Kirsher 
2275f7917c00SJeff Kirsher enum fw_port_dcb_cfg_rc {
2276f7917c00SJeff Kirsher 	FW_PORT_DCB_CFG_SUCCESS	= 0x0,
2277f7917c00SJeff Kirsher 	FW_PORT_DCB_CFG_ERROR	= 0x1
2278f7917c00SJeff Kirsher };
2279f7917c00SJeff Kirsher 
2280ce91a923SNaresh Kumar Inna enum fw_port_dcb_type {
2281ce91a923SNaresh Kumar Inna 	FW_PORT_DCB_TYPE_PGID		= 0x00,
2282ce91a923SNaresh Kumar Inna 	FW_PORT_DCB_TYPE_PGRATE		= 0x01,
2283ce91a923SNaresh Kumar Inna 	FW_PORT_DCB_TYPE_PRIORATE	= 0x02,
2284ce91a923SNaresh Kumar Inna 	FW_PORT_DCB_TYPE_PFC		= 0x03,
2285ce91a923SNaresh Kumar Inna 	FW_PORT_DCB_TYPE_APP_ID		= 0x04,
2286989594e2SAnish Bhatt 	FW_PORT_DCB_TYPE_CONTROL	= 0x05,
2287989594e2SAnish Bhatt };
2288989594e2SAnish Bhatt 
2289989594e2SAnish Bhatt enum fw_port_dcb_feature_state {
2290989594e2SAnish Bhatt 	FW_PORT_DCB_FEATURE_STATE_PENDING = 0x0,
2291989594e2SAnish Bhatt 	FW_PORT_DCB_FEATURE_STATE_SUCCESS = 0x1,
2292989594e2SAnish Bhatt 	FW_PORT_DCB_FEATURE_STATE_ERROR	= 0x2,
2293989594e2SAnish Bhatt 	FW_PORT_DCB_FEATURE_STATE_TIMEOUT = 0x3,
2294ce91a923SNaresh Kumar Inna };
2295ce91a923SNaresh Kumar Inna 
2296f7917c00SJeff Kirsher struct fw_port_cmd {
2297f7917c00SJeff Kirsher 	__be32 op_to_portid;
2298f7917c00SJeff Kirsher 	__be32 action_to_len16;
2299f7917c00SJeff Kirsher 	union fw_port {
2300f7917c00SJeff Kirsher 		struct fw_port_l1cfg {
2301f7917c00SJeff Kirsher 			__be32 rcap;
2302f7917c00SJeff Kirsher 			__be32 r;
2303f7917c00SJeff Kirsher 		} l1cfg;
2304f7917c00SJeff Kirsher 		struct fw_port_l2cfg {
2305989594e2SAnish Bhatt 			__u8   ctlbf;
2306989594e2SAnish Bhatt 			__u8   ovlan3_to_ivlan0;
2307f7917c00SJeff Kirsher 			__be16 ivlantype;
2308989594e2SAnish Bhatt 			__be16 txipg_force_pinfo;
2309989594e2SAnish Bhatt 			__be16 mtu;
2310f7917c00SJeff Kirsher 			__be16 ovlan0mask;
2311f7917c00SJeff Kirsher 			__be16 ovlan0type;
2312f7917c00SJeff Kirsher 			__be16 ovlan1mask;
2313f7917c00SJeff Kirsher 			__be16 ovlan1type;
2314f7917c00SJeff Kirsher 			__be16 ovlan2mask;
2315f7917c00SJeff Kirsher 			__be16 ovlan2type;
2316f7917c00SJeff Kirsher 			__be16 ovlan3mask;
2317f7917c00SJeff Kirsher 			__be16 ovlan3type;
2318f7917c00SJeff Kirsher 		} l2cfg;
2319f7917c00SJeff Kirsher 		struct fw_port_info {
2320f7917c00SJeff Kirsher 			__be32 lstatus_to_modtype;
2321f7917c00SJeff Kirsher 			__be16 pcap;
2322f7917c00SJeff Kirsher 			__be16 acap;
2323f7917c00SJeff Kirsher 			__be16 mtu;
2324f7917c00SJeff Kirsher 			__u8   cbllen;
2325989594e2SAnish Bhatt 			__u8   auxlinfo;
2326989594e2SAnish Bhatt 			__u8   dcbxdis_pkd;
2327989594e2SAnish Bhatt 			__u8   r8_lo[3];
2328989594e2SAnish Bhatt 			__be64 r9;
2329f7917c00SJeff Kirsher 		} info;
2330989594e2SAnish Bhatt 		struct fw_port_diags {
2331989594e2SAnish Bhatt 			__u8   diagop;
2332989594e2SAnish Bhatt 			__u8   r[3];
2333989594e2SAnish Bhatt 			__be32 diagval;
2334989594e2SAnish Bhatt 		} diags;
2335989594e2SAnish Bhatt 		union fw_port_dcb {
2336989594e2SAnish Bhatt 			struct fw_port_dcb_pgid {
2337989594e2SAnish Bhatt 				__u8   type;
2338989594e2SAnish Bhatt 				__u8   apply_pkd;
2339989594e2SAnish Bhatt 				__u8   r10_lo[2];
2340989594e2SAnish Bhatt 				__be32 pgid;
2341989594e2SAnish Bhatt 				__be64 r11;
2342989594e2SAnish Bhatt 			} pgid;
2343989594e2SAnish Bhatt 			struct fw_port_dcb_pgrate {
2344989594e2SAnish Bhatt 				__u8   type;
2345989594e2SAnish Bhatt 				__u8   apply_pkd;
2346989594e2SAnish Bhatt 				__u8   r10_lo[5];
2347989594e2SAnish Bhatt 				__u8   num_tcs_supported;
2348989594e2SAnish Bhatt 				__u8   pgrate[8];
234910b00466SAnish Bhatt 				__u8   tsa[8];
2350989594e2SAnish Bhatt 			} pgrate;
2351989594e2SAnish Bhatt 			struct fw_port_dcb_priorate {
2352989594e2SAnish Bhatt 				__u8   type;
2353989594e2SAnish Bhatt 				__u8   apply_pkd;
2354989594e2SAnish Bhatt 				__u8   r10_lo[6];
2355989594e2SAnish Bhatt 				__u8   strict_priorate[8];
2356989594e2SAnish Bhatt 			} priorate;
2357989594e2SAnish Bhatt 			struct fw_port_dcb_pfc {
2358989594e2SAnish Bhatt 				__u8   type;
2359989594e2SAnish Bhatt 				__u8   pfcen;
2360989594e2SAnish Bhatt 				__u8   r10[5];
2361989594e2SAnish Bhatt 				__u8   max_pfc_tcs;
2362989594e2SAnish Bhatt 				__be64 r11;
2363989594e2SAnish Bhatt 			} pfc;
2364989594e2SAnish Bhatt 			struct fw_port_app_priority {
2365989594e2SAnish Bhatt 				__u8   type;
2366989594e2SAnish Bhatt 				__u8   r10[2];
2367989594e2SAnish Bhatt 				__u8   idx;
2368989594e2SAnish Bhatt 				__u8   user_prio_map;
2369989594e2SAnish Bhatt 				__u8   sel_field;
2370989594e2SAnish Bhatt 				__be16 protocolid;
2371989594e2SAnish Bhatt 				__be64 r12;
2372989594e2SAnish Bhatt 			} app_priority;
2373989594e2SAnish Bhatt 			struct fw_port_dcb_control {
2374989594e2SAnish Bhatt 				__u8   type;
2375989594e2SAnish Bhatt 				__u8   all_syncd_pkd;
237610b00466SAnish Bhatt 				__be16 dcb_version_to_app_state;
2377f7917c00SJeff Kirsher 				__be32 r11;
2378989594e2SAnish Bhatt 				__be64 r12;
2379989594e2SAnish Bhatt 			} control;
2380f7917c00SJeff Kirsher 		} dcb;
2381f7917c00SJeff Kirsher 	} u;
2382f7917c00SJeff Kirsher };
2383f7917c00SJeff Kirsher 
23842b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_READ_S	22
23852b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_READ_V(x)	((x) << FW_PORT_CMD_READ_S)
23862b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_READ_F	FW_PORT_CMD_READ_V(1U)
2387f7917c00SJeff Kirsher 
23882b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_PORTID_S	0
23892b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_PORTID_M	0xf
23902b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_PORTID_V(x)	((x) << FW_PORT_CMD_PORTID_S)
23912b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_PORTID_G(x)	\
23922b5fb1f2SHariprasad Shenai 	(((x) >> FW_PORT_CMD_PORTID_S) & FW_PORT_CMD_PORTID_M)
2393f7917c00SJeff Kirsher 
23942b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_ACTION_S	16
23952b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_ACTION_M	0xffff
23962b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_ACTION_V(x)	((x) << FW_PORT_CMD_ACTION_S)
23972b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_ACTION_G(x)	\
23982b5fb1f2SHariprasad Shenai 	(((x) >> FW_PORT_CMD_ACTION_S) & FW_PORT_CMD_ACTION_M)
2399f7917c00SJeff Kirsher 
24002b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_OVLAN3_S	7
24012b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_OVLAN3_V(x)	((x) << FW_PORT_CMD_OVLAN3_S)
2402f7917c00SJeff Kirsher 
24032b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_OVLAN2_S	6
24042b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_OVLAN2_V(x)	((x) << FW_PORT_CMD_OVLAN2_S)
2405f7917c00SJeff Kirsher 
24062b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_OVLAN1_S	5
24072b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_OVLAN1_V(x)	((x) << FW_PORT_CMD_OVLAN1_S)
2408f7917c00SJeff Kirsher 
24092b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_OVLAN0_S	4
24102b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_OVLAN0_V(x)	((x) << FW_PORT_CMD_OVLAN0_S)
2411989594e2SAnish Bhatt 
24122b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_IVLAN0_S	3
24132b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_IVLAN0_V(x)	((x) << FW_PORT_CMD_IVLAN0_S)
2414f7917c00SJeff Kirsher 
24152b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_TXIPG_S	3
24162b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_TXIPG_V(x)	((x) << FW_PORT_CMD_TXIPG_S)
24172b5fb1f2SHariprasad Shenai 
24182b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSTATUS_S           31
24192b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSTATUS_M           0x1
24202b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSTATUS_V(x)        ((x) << FW_PORT_CMD_LSTATUS_S)
24212b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSTATUS_G(x)        \
24222b5fb1f2SHariprasad Shenai 	(((x) >> FW_PORT_CMD_LSTATUS_S) & FW_PORT_CMD_LSTATUS_M)
24232b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSTATUS_F   FW_PORT_CMD_LSTATUS_V(1U)
24242b5fb1f2SHariprasad Shenai 
24252b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSPEED_S	24
24262b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSPEED_M	0x3f
24272b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSPEED_V(x)	((x) << FW_PORT_CMD_LSPEED_S)
24282b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LSPEED_G(x)	\
24292b5fb1f2SHariprasad Shenai 	(((x) >> FW_PORT_CMD_LSPEED_S) & FW_PORT_CMD_LSPEED_M)
24302b5fb1f2SHariprasad Shenai 
24312b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_TXPAUSE_S		23
24322b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_TXPAUSE_V(x)	((x) << FW_PORT_CMD_TXPAUSE_S)
24332b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_TXPAUSE_F	FW_PORT_CMD_TXPAUSE_V(1U)
24342b5fb1f2SHariprasad Shenai 
24352b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_RXPAUSE_S		22
24362b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_RXPAUSE_V(x)	((x) << FW_PORT_CMD_RXPAUSE_S)
24372b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_RXPAUSE_F	FW_PORT_CMD_RXPAUSE_V(1U)
24382b5fb1f2SHariprasad Shenai 
24392b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MDIOCAP_S		21
24402b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MDIOCAP_V(x)	((x) << FW_PORT_CMD_MDIOCAP_S)
24412b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MDIOCAP_F	FW_PORT_CMD_MDIOCAP_V(1U)
24422b5fb1f2SHariprasad Shenai 
24432b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MDIOADDR_S		16
24442b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MDIOADDR_M		0x1f
24452b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MDIOADDR_G(x)	\
24462b5fb1f2SHariprasad Shenai 	(((x) >> FW_PORT_CMD_MDIOADDR_S) & FW_PORT_CMD_MDIOADDR_M)
24472b5fb1f2SHariprasad Shenai 
24482b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LPTXPAUSE_S		15
24492b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LPTXPAUSE_V(x)	((x) << FW_PORT_CMD_LPTXPAUSE_S)
24502b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LPTXPAUSE_F	FW_PORT_CMD_LPTXPAUSE_V(1U)
24512b5fb1f2SHariprasad Shenai 
24522b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LPRXPAUSE_S		14
24532b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LPRXPAUSE_V(x)	((x) << FW_PORT_CMD_LPRXPAUSE_S)
24542b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_LPRXPAUSE_F	FW_PORT_CMD_LPRXPAUSE_V(1U)
24552b5fb1f2SHariprasad Shenai 
24562b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_PTYPE_S	8
24572b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_PTYPE_M	0x1f
24582b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_PTYPE_G(x)	\
24592b5fb1f2SHariprasad Shenai 	(((x) >> FW_PORT_CMD_PTYPE_S) & FW_PORT_CMD_PTYPE_M)
24602b5fb1f2SHariprasad Shenai 
24612b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MODTYPE_S		0
24622b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MODTYPE_M		0x1f
24632b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MODTYPE_V(x)	((x) << FW_PORT_CMD_MODTYPE_S)
24642b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_MODTYPE_G(x)	\
24652b5fb1f2SHariprasad Shenai 	(((x) >> FW_PORT_CMD_MODTYPE_S) & FW_PORT_CMD_MODTYPE_M)
24662b5fb1f2SHariprasad Shenai 
24672b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_DCBXDIS_S		7
24682b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_DCBXDIS_V(x)	((x) << FW_PORT_CMD_DCBXDIS_S)
24692b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_DCBXDIS_F	FW_PORT_CMD_DCBXDIS_V(1U)
24702b5fb1f2SHariprasad Shenai 
24712b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_APPLY_S	7
24722b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_APPLY_V(x)	((x) << FW_PORT_CMD_APPLY_S)
24732b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_APPLY_F	FW_PORT_CMD_APPLY_V(1U)
24742b5fb1f2SHariprasad Shenai 
24752b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_ALL_SYNCD_S		7
24762b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_ALL_SYNCD_V(x)	((x) << FW_PORT_CMD_ALL_SYNCD_S)
24772b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_ALL_SYNCD_F	FW_PORT_CMD_ALL_SYNCD_V(1U)
24782b5fb1f2SHariprasad Shenai 
24792b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_DCB_VERSION_S	12
24802b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_DCB_VERSION_M	0x7
24812b5fb1f2SHariprasad Shenai #define FW_PORT_CMD_DCB_VERSION_G(x)	\
24822b5fb1f2SHariprasad Shenai 	(((x) >> FW_PORT_CMD_DCB_VERSION_S) & FW_PORT_CMD_DCB_VERSION_M)
2483f7917c00SJeff Kirsher 
2484f7917c00SJeff Kirsher enum fw_port_type {
2485f7917c00SJeff Kirsher 	FW_PORT_TYPE_FIBER_XFI,
2486f7917c00SJeff Kirsher 	FW_PORT_TYPE_FIBER_XAUI,
2487f7917c00SJeff Kirsher 	FW_PORT_TYPE_BT_SGMII,
2488f7917c00SJeff Kirsher 	FW_PORT_TYPE_BT_XFI,
2489f7917c00SJeff Kirsher 	FW_PORT_TYPE_BT_XAUI,
2490f7917c00SJeff Kirsher 	FW_PORT_TYPE_KX4,
2491f7917c00SJeff Kirsher 	FW_PORT_TYPE_CX4,
2492f7917c00SJeff Kirsher 	FW_PORT_TYPE_KX,
2493f7917c00SJeff Kirsher 	FW_PORT_TYPE_KR,
2494f7917c00SJeff Kirsher 	FW_PORT_TYPE_SFP,
2495f7917c00SJeff Kirsher 	FW_PORT_TYPE_BP_AP,
2496f7917c00SJeff Kirsher 	FW_PORT_TYPE_BP4_AP,
249772aca4bfSKumar Sanghvi 	FW_PORT_TYPE_QSFP_10G,
249840e9de4bSHariprasad Shenai 	FW_PORT_TYPE_QSA,
24995aa80e51SHariprasad Shenai 	FW_PORT_TYPE_QSFP,
250072aca4bfSKumar Sanghvi 	FW_PORT_TYPE_BP40_BA,
2501f7917c00SJeff Kirsher 
25022b5fb1f2SHariprasad Shenai 	FW_PORT_TYPE_NONE = FW_PORT_CMD_PTYPE_M
2503f7917c00SJeff Kirsher };
2504f7917c00SJeff Kirsher 
2505f7917c00SJeff Kirsher enum fw_port_module_type {
2506f7917c00SJeff Kirsher 	FW_PORT_MOD_TYPE_NA,
2507f7917c00SJeff Kirsher 	FW_PORT_MOD_TYPE_LR,
2508f7917c00SJeff Kirsher 	FW_PORT_MOD_TYPE_SR,
2509f7917c00SJeff Kirsher 	FW_PORT_MOD_TYPE_ER,
2510f7917c00SJeff Kirsher 	FW_PORT_MOD_TYPE_TWINAX_PASSIVE,
2511f7917c00SJeff Kirsher 	FW_PORT_MOD_TYPE_TWINAX_ACTIVE,
2512f7917c00SJeff Kirsher 	FW_PORT_MOD_TYPE_LRM,
25132b5fb1f2SHariprasad Shenai 	FW_PORT_MOD_TYPE_ERROR		= FW_PORT_CMD_MODTYPE_M - 3,
25142b5fb1f2SHariprasad Shenai 	FW_PORT_MOD_TYPE_UNKNOWN	= FW_PORT_CMD_MODTYPE_M - 2,
25152b5fb1f2SHariprasad Shenai 	FW_PORT_MOD_TYPE_NOTSUPPORTED	= FW_PORT_CMD_MODTYPE_M - 1,
2516f7917c00SJeff Kirsher 
25172b5fb1f2SHariprasad Shenai 	FW_PORT_MOD_TYPE_NONE = FW_PORT_CMD_MODTYPE_M
2518f7917c00SJeff Kirsher };
2519f7917c00SJeff Kirsher 
2520b407a4a9SVipul Pandya enum fw_port_mod_sub_type {
2521b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_NA,
2522b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_MV88E114X = 0x1,
2523b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_TN8022 = 0x2,
2524b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_AQ1202 = 0x3,
2525b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_88x3120 = 0x4,
2526b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_BCM84834 = 0x5,
2527b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_BT_VSC8634 = 0x8,
2528b407a4a9SVipul Pandya 
2529b407a4a9SVipul Pandya 	/* The following will never been in the VPD.  They are TWINAX cable
2530b407a4a9SVipul Pandya 	 * lengths decoded from SFP+ module i2c PROMs.  These should
2531b407a4a9SVipul Pandya 	 * almost certainly go somewhere else ...
2532b407a4a9SVipul Pandya 	 */
2533b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_TWINAX_1 = 0x9,
2534b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_TWINAX_3 = 0xA,
2535b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_TWINAX_5 = 0xB,
2536b407a4a9SVipul Pandya 	FW_PORT_MOD_SUB_TYPE_TWINAX_7 = 0xC,
2537b407a4a9SVipul Pandya };
2538b407a4a9SVipul Pandya 
2539f7917c00SJeff Kirsher /* port stats */
2540f7917c00SJeff Kirsher #define FW_NUM_PORT_STATS 50
2541f7917c00SJeff Kirsher #define FW_NUM_PORT_TX_STATS 23
2542f7917c00SJeff Kirsher #define FW_NUM_PORT_RX_STATS 27
2543f7917c00SJeff Kirsher 
2544f7917c00SJeff Kirsher enum fw_port_stats_tx_index {
2545f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_BYTES_IX,
2546f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_FRAMES_IX,
2547f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_BCAST_IX,
2548f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_MCAST_IX,
2549f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_UCAST_IX,
2550f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_ERROR_IX,
2551f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_64B_IX,
2552f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_65B_127B_IX,
2553f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_128B_255B_IX,
2554f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_256B_511B_IX,
2555f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_512B_1023B_IX,
2556f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_1024B_1518B_IX,
2557f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_1519B_MAX_IX,
2558f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_DROP_IX,
2559f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PAUSE_IX,
2560f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PPP0_IX,
2561f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PPP1_IX,
2562f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PPP2_IX,
2563f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PPP3_IX,
2564f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PPP4_IX,
2565f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PPP5_IX,
2566f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PPP6_IX,
2567f7917c00SJeff Kirsher 	FW_STAT_TX_PORT_PPP7_IX
2568f7917c00SJeff Kirsher };
2569f7917c00SJeff Kirsher 
2570f7917c00SJeff Kirsher enum fw_port_stat_rx_index {
2571f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_BYTES_IX,
2572f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_FRAMES_IX,
2573f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_BCAST_IX,
2574f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_MCAST_IX,
2575f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_UCAST_IX,
2576f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_MTU_ERROR_IX,
2577f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_MTU_CRC_ERROR_IX,
2578f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_CRC_ERROR_IX,
2579f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_LEN_ERROR_IX,
2580f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_SYM_ERROR_IX,
2581f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_64B_IX,
2582f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_65B_127B_IX,
2583f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_128B_255B_IX,
2584f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_256B_511B_IX,
2585f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_512B_1023B_IX,
2586f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_1024B_1518B_IX,
2587f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_1519B_MAX_IX,
2588f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PAUSE_IX,
2589f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PPP0_IX,
2590f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PPP1_IX,
2591f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PPP2_IX,
2592f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PPP3_IX,
2593f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PPP4_IX,
2594f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PPP5_IX,
2595f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PPP6_IX,
2596f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_PPP7_IX,
2597f7917c00SJeff Kirsher 	FW_STAT_RX_PORT_LESS_64B_IX
2598f7917c00SJeff Kirsher };
2599f7917c00SJeff Kirsher 
2600f7917c00SJeff Kirsher struct fw_port_stats_cmd {
2601f7917c00SJeff Kirsher 	__be32 op_to_portid;
2602f7917c00SJeff Kirsher 	__be32 retval_len16;
2603f7917c00SJeff Kirsher 	union fw_port_stats {
2604f7917c00SJeff Kirsher 		struct fw_port_stats_ctl {
2605f7917c00SJeff Kirsher 			u8 nstats_bg_bm;
2606f7917c00SJeff Kirsher 			u8 tx_ix;
2607f7917c00SJeff Kirsher 			__be16 r6;
2608f7917c00SJeff Kirsher 			__be32 r7;
2609f7917c00SJeff Kirsher 			__be64 stat0;
2610f7917c00SJeff Kirsher 			__be64 stat1;
2611f7917c00SJeff Kirsher 			__be64 stat2;
2612f7917c00SJeff Kirsher 			__be64 stat3;
2613f7917c00SJeff Kirsher 			__be64 stat4;
2614f7917c00SJeff Kirsher 			__be64 stat5;
2615f7917c00SJeff Kirsher 		} ctl;
2616f7917c00SJeff Kirsher 		struct fw_port_stats_all {
2617f7917c00SJeff Kirsher 			__be64 tx_bytes;
2618f7917c00SJeff Kirsher 			__be64 tx_frames;
2619f7917c00SJeff Kirsher 			__be64 tx_bcast;
2620f7917c00SJeff Kirsher 			__be64 tx_mcast;
2621f7917c00SJeff Kirsher 			__be64 tx_ucast;
2622f7917c00SJeff Kirsher 			__be64 tx_error;
2623f7917c00SJeff Kirsher 			__be64 tx_64b;
2624f7917c00SJeff Kirsher 			__be64 tx_65b_127b;
2625f7917c00SJeff Kirsher 			__be64 tx_128b_255b;
2626f7917c00SJeff Kirsher 			__be64 tx_256b_511b;
2627f7917c00SJeff Kirsher 			__be64 tx_512b_1023b;
2628f7917c00SJeff Kirsher 			__be64 tx_1024b_1518b;
2629f7917c00SJeff Kirsher 			__be64 tx_1519b_max;
2630f7917c00SJeff Kirsher 			__be64 tx_drop;
2631f7917c00SJeff Kirsher 			__be64 tx_pause;
2632f7917c00SJeff Kirsher 			__be64 tx_ppp0;
2633f7917c00SJeff Kirsher 			__be64 tx_ppp1;
2634f7917c00SJeff Kirsher 			__be64 tx_ppp2;
2635f7917c00SJeff Kirsher 			__be64 tx_ppp3;
2636f7917c00SJeff Kirsher 			__be64 tx_ppp4;
2637f7917c00SJeff Kirsher 			__be64 tx_ppp5;
2638f7917c00SJeff Kirsher 			__be64 tx_ppp6;
2639f7917c00SJeff Kirsher 			__be64 tx_ppp7;
2640f7917c00SJeff Kirsher 			__be64 rx_bytes;
2641f7917c00SJeff Kirsher 			__be64 rx_frames;
2642f7917c00SJeff Kirsher 			__be64 rx_bcast;
2643f7917c00SJeff Kirsher 			__be64 rx_mcast;
2644f7917c00SJeff Kirsher 			__be64 rx_ucast;
2645f7917c00SJeff Kirsher 			__be64 rx_mtu_error;
2646f7917c00SJeff Kirsher 			__be64 rx_mtu_crc_error;
2647f7917c00SJeff Kirsher 			__be64 rx_crc_error;
2648f7917c00SJeff Kirsher 			__be64 rx_len_error;
2649f7917c00SJeff Kirsher 			__be64 rx_sym_error;
2650f7917c00SJeff Kirsher 			__be64 rx_64b;
2651f7917c00SJeff Kirsher 			__be64 rx_65b_127b;
2652f7917c00SJeff Kirsher 			__be64 rx_128b_255b;
2653f7917c00SJeff Kirsher 			__be64 rx_256b_511b;
2654f7917c00SJeff Kirsher 			__be64 rx_512b_1023b;
2655f7917c00SJeff Kirsher 			__be64 rx_1024b_1518b;
2656f7917c00SJeff Kirsher 			__be64 rx_1519b_max;
2657f7917c00SJeff Kirsher 			__be64 rx_pause;
2658f7917c00SJeff Kirsher 			__be64 rx_ppp0;
2659f7917c00SJeff Kirsher 			__be64 rx_ppp1;
2660f7917c00SJeff Kirsher 			__be64 rx_ppp2;
2661f7917c00SJeff Kirsher 			__be64 rx_ppp3;
2662f7917c00SJeff Kirsher 			__be64 rx_ppp4;
2663f7917c00SJeff Kirsher 			__be64 rx_ppp5;
2664f7917c00SJeff Kirsher 			__be64 rx_ppp6;
2665f7917c00SJeff Kirsher 			__be64 rx_ppp7;
2666f7917c00SJeff Kirsher 			__be64 rx_less_64b;
2667f7917c00SJeff Kirsher 			__be64 rx_bg_drop;
2668f7917c00SJeff Kirsher 			__be64 rx_bg_trunc;
2669f7917c00SJeff Kirsher 		} all;
2670f7917c00SJeff Kirsher 	} u;
2671f7917c00SJeff Kirsher };
2672f7917c00SJeff Kirsher 
2673f7917c00SJeff Kirsher /* port loopback stats */
2674f7917c00SJeff Kirsher #define FW_NUM_LB_STATS 16
2675f7917c00SJeff Kirsher enum fw_port_lb_stats_index {
2676f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_BYTES_IX,
2677f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_FRAMES_IX,
2678f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_BCAST_IX,
2679f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_MCAST_IX,
2680f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_UCAST_IX,
2681f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_ERROR_IX,
2682f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_64B_IX,
2683f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_65B_127B_IX,
2684f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_128B_255B_IX,
2685f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_256B_511B_IX,
2686f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_512B_1023B_IX,
2687f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_1024B_1518B_IX,
2688f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_1519B_MAX_IX,
2689f7917c00SJeff Kirsher 	FW_STAT_LB_PORT_DROP_FRAMES_IX
2690f7917c00SJeff Kirsher };
2691f7917c00SJeff Kirsher 
2692f7917c00SJeff Kirsher struct fw_port_lb_stats_cmd {
2693f7917c00SJeff Kirsher 	__be32 op_to_lbport;
2694f7917c00SJeff Kirsher 	__be32 retval_len16;
2695f7917c00SJeff Kirsher 	union fw_port_lb_stats {
2696f7917c00SJeff Kirsher 		struct fw_port_lb_stats_ctl {
2697f7917c00SJeff Kirsher 			u8 nstats_bg_bm;
2698f7917c00SJeff Kirsher 			u8 ix_pkd;
2699f7917c00SJeff Kirsher 			__be16 r6;
2700f7917c00SJeff Kirsher 			__be32 r7;
2701f7917c00SJeff Kirsher 			__be64 stat0;
2702f7917c00SJeff Kirsher 			__be64 stat1;
2703f7917c00SJeff Kirsher 			__be64 stat2;
2704f7917c00SJeff Kirsher 			__be64 stat3;
2705f7917c00SJeff Kirsher 			__be64 stat4;
2706f7917c00SJeff Kirsher 			__be64 stat5;
2707f7917c00SJeff Kirsher 		} ctl;
2708f7917c00SJeff Kirsher 		struct fw_port_lb_stats_all {
2709f7917c00SJeff Kirsher 			__be64 tx_bytes;
2710f7917c00SJeff Kirsher 			__be64 tx_frames;
2711f7917c00SJeff Kirsher 			__be64 tx_bcast;
2712f7917c00SJeff Kirsher 			__be64 tx_mcast;
2713f7917c00SJeff Kirsher 			__be64 tx_ucast;
2714f7917c00SJeff Kirsher 			__be64 tx_error;
2715f7917c00SJeff Kirsher 			__be64 tx_64b;
2716f7917c00SJeff Kirsher 			__be64 tx_65b_127b;
2717f7917c00SJeff Kirsher 			__be64 tx_128b_255b;
2718f7917c00SJeff Kirsher 			__be64 tx_256b_511b;
2719f7917c00SJeff Kirsher 			__be64 tx_512b_1023b;
2720f7917c00SJeff Kirsher 			__be64 tx_1024b_1518b;
2721f7917c00SJeff Kirsher 			__be64 tx_1519b_max;
2722f7917c00SJeff Kirsher 			__be64 rx_lb_drop;
2723f7917c00SJeff Kirsher 			__be64 rx_lb_trunc;
2724f7917c00SJeff Kirsher 		} all;
2725f7917c00SJeff Kirsher 	} u;
2726f7917c00SJeff Kirsher };
2727f7917c00SJeff Kirsher 
2728f7917c00SJeff Kirsher struct fw_rss_ind_tbl_cmd {
2729f7917c00SJeff Kirsher 	__be32 op_to_viid;
2730f7917c00SJeff Kirsher 	__be32 retval_len16;
2731f7917c00SJeff Kirsher 	__be16 niqid;
2732f7917c00SJeff Kirsher 	__be16 startidx;
2733f7917c00SJeff Kirsher 	__be32 r3;
2734f7917c00SJeff Kirsher 	__be32 iq0_to_iq2;
2735f7917c00SJeff Kirsher 	__be32 iq3_to_iq5;
2736f7917c00SJeff Kirsher 	__be32 iq6_to_iq8;
2737f7917c00SJeff Kirsher 	__be32 iq9_to_iq11;
2738f7917c00SJeff Kirsher 	__be32 iq12_to_iq14;
2739f7917c00SJeff Kirsher 	__be32 iq15_to_iq17;
2740f7917c00SJeff Kirsher 	__be32 iq18_to_iq20;
2741f7917c00SJeff Kirsher 	__be32 iq21_to_iq23;
2742f7917c00SJeff Kirsher 	__be32 iq24_to_iq26;
2743f7917c00SJeff Kirsher 	__be32 iq27_to_iq29;
2744f7917c00SJeff Kirsher 	__be32 iq30_iq31;
2745f7917c00SJeff Kirsher 	__be32 r15_lo;
2746f7917c00SJeff Kirsher };
2747f7917c00SJeff Kirsher 
2748b2e1a3f0SHariprasad Shenai #define FW_RSS_IND_TBL_CMD_VIID_S	0
2749b2e1a3f0SHariprasad Shenai #define FW_RSS_IND_TBL_CMD_VIID_V(x)	((x) << FW_RSS_IND_TBL_CMD_VIID_S)
2750b2e1a3f0SHariprasad Shenai 
2751b2e1a3f0SHariprasad Shenai #define FW_RSS_IND_TBL_CMD_IQ0_S	20
2752b2e1a3f0SHariprasad Shenai #define FW_RSS_IND_TBL_CMD_IQ0_V(x)	((x) << FW_RSS_IND_TBL_CMD_IQ0_S)
2753b2e1a3f0SHariprasad Shenai 
2754b2e1a3f0SHariprasad Shenai #define FW_RSS_IND_TBL_CMD_IQ1_S	10
2755b2e1a3f0SHariprasad Shenai #define FW_RSS_IND_TBL_CMD_IQ1_V(x)	((x) << FW_RSS_IND_TBL_CMD_IQ1_S)
2756b2e1a3f0SHariprasad Shenai 
2757b2e1a3f0SHariprasad Shenai #define FW_RSS_IND_TBL_CMD_IQ2_S	0
2758b2e1a3f0SHariprasad Shenai #define FW_RSS_IND_TBL_CMD_IQ2_V(x)	((x) << FW_RSS_IND_TBL_CMD_IQ2_S)
2759b2e1a3f0SHariprasad Shenai 
2760f7917c00SJeff Kirsher struct fw_rss_glb_config_cmd {
2761f7917c00SJeff Kirsher 	__be32 op_to_write;
2762f7917c00SJeff Kirsher 	__be32 retval_len16;
2763f7917c00SJeff Kirsher 	union fw_rss_glb_config {
2764f7917c00SJeff Kirsher 		struct fw_rss_glb_config_manual {
2765f7917c00SJeff Kirsher 			__be32 mode_pkd;
2766f7917c00SJeff Kirsher 			__be32 r3;
2767f7917c00SJeff Kirsher 			__be64 r4;
2768f7917c00SJeff Kirsher 			__be64 r5;
2769f7917c00SJeff Kirsher 		} manual;
2770f7917c00SJeff Kirsher 		struct fw_rss_glb_config_basicvirtual {
2771f7917c00SJeff Kirsher 			__be32 mode_pkd;
2772f7917c00SJeff Kirsher 			__be32 synmapen_to_hashtoeplitz;
2773f7917c00SJeff Kirsher 			__be64 r8;
2774f7917c00SJeff Kirsher 			__be64 r9;
2775f7917c00SJeff Kirsher 		} basicvirtual;
2776f7917c00SJeff Kirsher 	} u;
2777f7917c00SJeff Kirsher };
2778f7917c00SJeff Kirsher 
2779b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_MODE_S	28
2780b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_MODE_M	0xf
2781b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_MODE_V(x)	((x) << FW_RSS_GLB_CONFIG_CMD_MODE_S)
2782b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_MODE_G(x)	\
2783b2e1a3f0SHariprasad Shenai 	(((x) >> FW_RSS_GLB_CONFIG_CMD_MODE_S) & FW_RSS_GLB_CONFIG_CMD_MODE_M)
2784f7917c00SJeff Kirsher 
2785f7917c00SJeff Kirsher #define FW_RSS_GLB_CONFIG_CMD_MODE_MANUAL	0
2786f7917c00SJeff Kirsher #define FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL	1
2787f7917c00SJeff Kirsher 
2788b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S	8
2789b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(x)	\
2790b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S)
2791b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_F	\
2792b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(1U)
2793b2e1a3f0SHariprasad Shenai 
2794b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S		7
2795b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(x)	\
2796b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S)
2797b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_F	\
2798b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(1U)
2799b2e1a3f0SHariprasad Shenai 
2800b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S		6
2801b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(x)	\
2802b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S)
2803b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_F	\
2804b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(1U)
2805b2e1a3f0SHariprasad Shenai 
2806b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S		5
2807b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(x)	\
2808b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S)
2809b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_F	\
2810b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(1U)
2811b2e1a3f0SHariprasad Shenai 
2812b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S		4
2813b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(x)	\
2814b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S)
2815b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_F	\
2816b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(1U)
2817b2e1a3f0SHariprasad Shenai 
2818b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S	3
2819b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(x)	\
2820b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S)
2821b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_F	\
2822b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(1U)
2823b2e1a3f0SHariprasad Shenai 
2824b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S	2
2825b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(x)	\
2826b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S)
2827b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_F	\
2828b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(1U)
2829b2e1a3f0SHariprasad Shenai 
2830b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S	1
2831b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(x)	\
2832b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S)
2833b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_F	\
2834b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(1U)
2835b2e1a3f0SHariprasad Shenai 
2836b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S	0
2837b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(x)	\
2838b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S)
2839b2e1a3f0SHariprasad Shenai #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_F	\
2840b2e1a3f0SHariprasad Shenai 	FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(1U)
2841b2e1a3f0SHariprasad Shenai 
2842f7917c00SJeff Kirsher struct fw_rss_vi_config_cmd {
2843f7917c00SJeff Kirsher 	__be32 op_to_viid;
2844f7917c00SJeff Kirsher #define FW_RSS_VI_CONFIG_CMD_VIID(x) ((x) << 0)
2845f7917c00SJeff Kirsher 	__be32 retval_len16;
2846f7917c00SJeff Kirsher 	union fw_rss_vi_config {
2847f7917c00SJeff Kirsher 		struct fw_rss_vi_config_manual {
2848f7917c00SJeff Kirsher 			__be64 r3;
2849f7917c00SJeff Kirsher 			__be64 r4;
2850f7917c00SJeff Kirsher 			__be64 r5;
2851f7917c00SJeff Kirsher 		} manual;
2852f7917c00SJeff Kirsher 		struct fw_rss_vi_config_basicvirtual {
2853f7917c00SJeff Kirsher 			__be32 r6;
2854f7917c00SJeff Kirsher 			__be32 defaultq_to_udpen;
2855f7917c00SJeff Kirsher 			__be64 r9;
2856f7917c00SJeff Kirsher 			__be64 r10;
2857f7917c00SJeff Kirsher 		} basicvirtual;
2858f7917c00SJeff Kirsher 	} u;
2859f7917c00SJeff Kirsher };
2860f7917c00SJeff Kirsher 
2861b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_VIID_S	0
2862b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_VIID_V(x)	((x) << FW_RSS_VI_CONFIG_CMD_VIID_S)
2863b2e1a3f0SHariprasad Shenai 
2864b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S		16
2865b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M		0x3ff
2866b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_V(x)	\
2867b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S)
2868b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_G(x)	\
2869b2e1a3f0SHariprasad Shenai 	(((x) >> FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S) & \
2870b2e1a3f0SHariprasad Shenai 	 FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M)
2871b2e1a3f0SHariprasad Shenai 
2872b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S	4
2873b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(x)	\
2874b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S)
2875b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F	\
2876b2e1a3f0SHariprasad Shenai 	FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(1U)
2877b2e1a3f0SHariprasad Shenai 
2878b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S	3
2879b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(x)	\
2880b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S)
2881b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F	\
2882b2e1a3f0SHariprasad Shenai 	FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(1U)
2883b2e1a3f0SHariprasad Shenai 
2884b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S	2
2885b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(x)	\
2886b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S)
2887b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F	\
2888b2e1a3f0SHariprasad Shenai 	FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(1U)
2889b2e1a3f0SHariprasad Shenai 
2890b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S	1
2891b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(x)	\
2892b2e1a3f0SHariprasad Shenai 	((x) << FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S)
2893b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F	\
2894b2e1a3f0SHariprasad Shenai 	FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(1U)
2895b2e1a3f0SHariprasad Shenai 
2896b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_UDPEN_S	0
2897b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_UDPEN_V(x)	((x) << FW_RSS_VI_CONFIG_CMD_UDPEN_S)
2898b2e1a3f0SHariprasad Shenai #define FW_RSS_VI_CONFIG_CMD_UDPEN_F	FW_RSS_VI_CONFIG_CMD_UDPEN_V(1U)
2899b2e1a3f0SHariprasad Shenai 
290001bcca68SVipul Pandya struct fw_clip_cmd {
290101bcca68SVipul Pandya 	__be32 op_to_write;
290201bcca68SVipul Pandya 	__be32 alloc_to_len16;
290301bcca68SVipul Pandya 	__be64 ip_hi;
290401bcca68SVipul Pandya 	__be64 ip_lo;
290501bcca68SVipul Pandya 	__be32 r4[2];
290601bcca68SVipul Pandya };
290701bcca68SVipul Pandya 
2908b2e1a3f0SHariprasad Shenai #define FW_CLIP_CMD_ALLOC_S     31
2909b2e1a3f0SHariprasad Shenai #define FW_CLIP_CMD_ALLOC_V(x)  ((x) << FW_CLIP_CMD_ALLOC_S)
2910b2e1a3f0SHariprasad Shenai #define FW_CLIP_CMD_ALLOC_F     FW_CLIP_CMD_ALLOC_V(1U)
291101bcca68SVipul Pandya 
2912b2e1a3f0SHariprasad Shenai #define FW_CLIP_CMD_FREE_S      30
2913b2e1a3f0SHariprasad Shenai #define FW_CLIP_CMD_FREE_V(x)   ((x) << FW_CLIP_CMD_FREE_S)
2914b2e1a3f0SHariprasad Shenai #define FW_CLIP_CMD_FREE_F      FW_CLIP_CMD_FREE_V(1U)
291501bcca68SVipul Pandya 
2916f7917c00SJeff Kirsher enum fw_error_type {
2917f7917c00SJeff Kirsher 	FW_ERROR_TYPE_EXCEPTION		= 0x0,
2918f7917c00SJeff Kirsher 	FW_ERROR_TYPE_HWMODULE		= 0x1,
2919f7917c00SJeff Kirsher 	FW_ERROR_TYPE_WR		= 0x2,
2920f7917c00SJeff Kirsher 	FW_ERROR_TYPE_ACL		= 0x3,
2921f7917c00SJeff Kirsher };
2922f7917c00SJeff Kirsher 
2923f7917c00SJeff Kirsher struct fw_error_cmd {
2924f7917c00SJeff Kirsher 	__be32 op_to_type;
2925f7917c00SJeff Kirsher 	__be32 len16_pkd;
2926f7917c00SJeff Kirsher 	union fw_error {
2927f7917c00SJeff Kirsher 		struct fw_error_exception {
2928f7917c00SJeff Kirsher 			__be32 info[6];
2929f7917c00SJeff Kirsher 		} exception;
2930f7917c00SJeff Kirsher 		struct fw_error_hwmodule {
2931f7917c00SJeff Kirsher 			__be32 regaddr;
2932f7917c00SJeff Kirsher 			__be32 regval;
2933f7917c00SJeff Kirsher 		} hwmodule;
2934f7917c00SJeff Kirsher 		struct fw_error_wr {
2935f7917c00SJeff Kirsher 			__be16 cidx;
2936f7917c00SJeff Kirsher 			__be16 pfn_vfn;
2937f7917c00SJeff Kirsher 			__be32 eqid;
2938f7917c00SJeff Kirsher 			u8 wrhdr[16];
2939f7917c00SJeff Kirsher 		} wr;
2940f7917c00SJeff Kirsher 		struct fw_error_acl {
2941f7917c00SJeff Kirsher 			__be16 cidx;
2942f7917c00SJeff Kirsher 			__be16 pfn_vfn;
2943f7917c00SJeff Kirsher 			__be32 eqid;
2944f7917c00SJeff Kirsher 			__be16 mv_pkd;
2945f7917c00SJeff Kirsher 			u8 val[6];
2946f7917c00SJeff Kirsher 			__be64 r4;
2947f7917c00SJeff Kirsher 		} acl;
2948f7917c00SJeff Kirsher 	} u;
2949f7917c00SJeff Kirsher };
2950f7917c00SJeff Kirsher 
2951f7917c00SJeff Kirsher struct fw_debug_cmd {
2952f7917c00SJeff Kirsher 	__be32 op_type;
2953f7917c00SJeff Kirsher 	__be32 len16_pkd;
2954f7917c00SJeff Kirsher 	union fw_debug {
2955f7917c00SJeff Kirsher 		struct fw_debug_assert {
2956f7917c00SJeff Kirsher 			__be32 fcid;
2957f7917c00SJeff Kirsher 			__be32 line;
2958f7917c00SJeff Kirsher 			__be32 x;
2959f7917c00SJeff Kirsher 			__be32 y;
2960f7917c00SJeff Kirsher 			u8 filename_0_7[8];
2961f7917c00SJeff Kirsher 			u8 filename_8_15[8];
2962f7917c00SJeff Kirsher 			__be64 r3;
2963f7917c00SJeff Kirsher 		} assert;
2964f7917c00SJeff Kirsher 		struct fw_debug_prt {
2965f7917c00SJeff Kirsher 			__be16 dprtstridx;
2966f7917c00SJeff Kirsher 			__be16 r3[3];
2967f7917c00SJeff Kirsher 			__be32 dprtstrparam0;
2968f7917c00SJeff Kirsher 			__be32 dprtstrparam1;
2969f7917c00SJeff Kirsher 			__be32 dprtstrparam2;
2970f7917c00SJeff Kirsher 			__be32 dprtstrparam3;
2971f7917c00SJeff Kirsher 		} prt;
2972f7917c00SJeff Kirsher 	} u;
2973f7917c00SJeff Kirsher };
2974f7917c00SJeff Kirsher 
2975b2e1a3f0SHariprasad Shenai #define FW_DEBUG_CMD_TYPE_S	0
2976b2e1a3f0SHariprasad Shenai #define FW_DEBUG_CMD_TYPE_M	0xff
2977b2e1a3f0SHariprasad Shenai #define FW_DEBUG_CMD_TYPE_G(x)	\
2978b2e1a3f0SHariprasad Shenai 	(((x) >> FW_DEBUG_CMD_TYPE_S) & FW_DEBUG_CMD_TYPE_M)
2979b2e1a3f0SHariprasad Shenai 
2980b2e1a3f0SHariprasad Shenai #define PCIE_FW_ERR_S		31
2981b2e1a3f0SHariprasad Shenai #define PCIE_FW_ERR_V(x)	((x) << PCIE_FW_ERR_S)
2982b2e1a3f0SHariprasad Shenai #define PCIE_FW_ERR_F		PCIE_FW_ERR_V(1U)
2983b2e1a3f0SHariprasad Shenai 
2984b2e1a3f0SHariprasad Shenai #define PCIE_FW_INIT_S		30
2985b2e1a3f0SHariprasad Shenai #define PCIE_FW_INIT_V(x)	((x) << PCIE_FW_INIT_S)
2986b2e1a3f0SHariprasad Shenai #define PCIE_FW_INIT_F		PCIE_FW_INIT_V(1U)
2987b2e1a3f0SHariprasad Shenai 
2988b2e1a3f0SHariprasad Shenai #define PCIE_FW_HALT_S          29
2989b2e1a3f0SHariprasad Shenai #define PCIE_FW_HALT_V(x)       ((x) << PCIE_FW_HALT_S)
2990b2e1a3f0SHariprasad Shenai #define PCIE_FW_HALT_F          PCIE_FW_HALT_V(1U)
2991b2e1a3f0SHariprasad Shenai 
2992b2e1a3f0SHariprasad Shenai #define PCIE_FW_EVAL_S		24
2993b2e1a3f0SHariprasad Shenai #define PCIE_FW_EVAL_M		0x7
2994b2e1a3f0SHariprasad Shenai #define PCIE_FW_EVAL_G(x)	(((x) >> PCIE_FW_EVAL_S) & PCIE_FW_EVAL_M)
2995b2e1a3f0SHariprasad Shenai 
2996b2e1a3f0SHariprasad Shenai #define PCIE_FW_MASTER_VLD_S	15
2997b2e1a3f0SHariprasad Shenai #define PCIE_FW_MASTER_VLD_V(x)	((x) << PCIE_FW_MASTER_VLD_S)
2998b2e1a3f0SHariprasad Shenai #define PCIE_FW_MASTER_VLD_F	PCIE_FW_MASTER_VLD_V(1U)
2999b2e1a3f0SHariprasad Shenai 
3000b2e1a3f0SHariprasad Shenai #define PCIE_FW_MASTER_S	12
3001b2e1a3f0SHariprasad Shenai #define PCIE_FW_MASTER_M	0x7
3002b2e1a3f0SHariprasad Shenai #define PCIE_FW_MASTER_V(x)	((x) << PCIE_FW_MASTER_S)
3003b2e1a3f0SHariprasad Shenai #define PCIE_FW_MASTER_G(x)	(((x) >> PCIE_FW_MASTER_S) & PCIE_FW_MASTER_M)
300452367a76SVipul Pandya 
3005f7917c00SJeff Kirsher struct fw_hdr {
3006f7917c00SJeff Kirsher 	u8 ver;
300716e47624SHariprasad Shenai 	u8 chip;			/* terminator chip type */
3008f7917c00SJeff Kirsher 	__be16	len512;			/* bin length in units of 512-bytes */
3009f7917c00SJeff Kirsher 	__be32	fw_ver;			/* firmware version */
3010f7917c00SJeff Kirsher 	__be32	tp_microcode_ver;
3011f7917c00SJeff Kirsher 	u8 intfver_nic;
3012f7917c00SJeff Kirsher 	u8 intfver_vnic;
3013f7917c00SJeff Kirsher 	u8 intfver_ofld;
3014f7917c00SJeff Kirsher 	u8 intfver_ri;
3015f7917c00SJeff Kirsher 	u8 intfver_iscsipdu;
3016f7917c00SJeff Kirsher 	u8 intfver_iscsi;
3017b407a4a9SVipul Pandya 	u8 intfver_fcoepdu;
3018f7917c00SJeff Kirsher 	u8 intfver_fcoe;
3019b407a4a9SVipul Pandya 	__u32   reserved2;
302026f7cbc0SVipul Pandya 	__u32   reserved3;
302126f7cbc0SVipul Pandya 	__u32   reserved4;
302226f7cbc0SVipul Pandya 	__be32  flags;
302326f7cbc0SVipul Pandya 	__be32  reserved6[23];
3024f7917c00SJeff Kirsher };
3025f7917c00SJeff Kirsher 
302616e47624SHariprasad Shenai enum fw_hdr_chip {
302716e47624SHariprasad Shenai 	FW_HDR_CHIP_T4,
302816e47624SHariprasad Shenai 	FW_HDR_CHIP_T5
302916e47624SHariprasad Shenai };
303016e47624SHariprasad Shenai 
3031b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MAJOR_S	24
3032b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MAJOR_M	0xff
3033ba3f8cd5SHariprasad Shenai #define FW_HDR_FW_VER_MAJOR_V(x) \
3034ba3f8cd5SHariprasad Shenai 	((x) << FW_HDR_FW_VER_MAJOR_S)
3035b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MAJOR_G(x) \
3036b2e1a3f0SHariprasad Shenai 	(((x) >> FW_HDR_FW_VER_MAJOR_S) & FW_HDR_FW_VER_MAJOR_M)
3037b2e1a3f0SHariprasad Shenai 
3038b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MINOR_S	16
3039b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MINOR_M	0xff
3040ba3f8cd5SHariprasad Shenai #define FW_HDR_FW_VER_MINOR_V(x) \
3041ba3f8cd5SHariprasad Shenai 	((x) << FW_HDR_FW_VER_MINOR_S)
3042b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MINOR_G(x) \
3043b2e1a3f0SHariprasad Shenai 	(((x) >> FW_HDR_FW_VER_MINOR_S) & FW_HDR_FW_VER_MINOR_M)
3044b2e1a3f0SHariprasad Shenai 
3045b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MICRO_S	8
3046b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MICRO_M	0xff
3047ba3f8cd5SHariprasad Shenai #define FW_HDR_FW_VER_MICRO_V(x) \
3048ba3f8cd5SHariprasad Shenai 	((x) << FW_HDR_FW_VER_MICRO_S)
3049b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_MICRO_G(x) \
3050b2e1a3f0SHariprasad Shenai 	(((x) >> FW_HDR_FW_VER_MICRO_S) & FW_HDR_FW_VER_MICRO_M)
3051b2e1a3f0SHariprasad Shenai 
3052b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_BUILD_S	0
3053b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_BUILD_M	0xff
3054ba3f8cd5SHariprasad Shenai #define FW_HDR_FW_VER_BUILD_V(x) \
3055ba3f8cd5SHariprasad Shenai 	((x) << FW_HDR_FW_VER_BUILD_S)
3056b2e1a3f0SHariprasad Shenai #define FW_HDR_FW_VER_BUILD_G(x) \
3057b2e1a3f0SHariprasad Shenai 	(((x) >> FW_HDR_FW_VER_BUILD_S) & FW_HDR_FW_VER_BUILD_M)
30583069ee9bSVipul Pandya 
3059b407a4a9SVipul Pandya enum fw_hdr_intfver {
3060b407a4a9SVipul Pandya 	FW_HDR_INTFVER_NIC      = 0x00,
3061b407a4a9SVipul Pandya 	FW_HDR_INTFVER_VNIC     = 0x00,
3062b407a4a9SVipul Pandya 	FW_HDR_INTFVER_OFLD     = 0x00,
3063b407a4a9SVipul Pandya 	FW_HDR_INTFVER_RI       = 0x00,
3064b407a4a9SVipul Pandya 	FW_HDR_INTFVER_ISCSIPDU = 0x00,
3065b407a4a9SVipul Pandya 	FW_HDR_INTFVER_ISCSI    = 0x00,
3066b407a4a9SVipul Pandya 	FW_HDR_INTFVER_FCOEPDU  = 0x00,
3067b407a4a9SVipul Pandya 	FW_HDR_INTFVER_FCOE     = 0x00,
3068b407a4a9SVipul Pandya };
3069b407a4a9SVipul Pandya 
307026f7cbc0SVipul Pandya enum fw_hdr_flags {
307126f7cbc0SVipul Pandya 	FW_HDR_FLAGS_RESET_HALT = 0x00000001,
307226f7cbc0SVipul Pandya };
307326f7cbc0SVipul Pandya 
307449aa284fSHariprasad Shenai /* length of the formatting string  */
307549aa284fSHariprasad Shenai #define FW_DEVLOG_FMT_LEN	192
307649aa284fSHariprasad Shenai 
307749aa284fSHariprasad Shenai /* maximum number of the formatting string parameters */
307849aa284fSHariprasad Shenai #define FW_DEVLOG_FMT_PARAMS_NUM 8
307949aa284fSHariprasad Shenai 
308049aa284fSHariprasad Shenai /* priority levels */
308149aa284fSHariprasad Shenai enum fw_devlog_level {
308249aa284fSHariprasad Shenai 	FW_DEVLOG_LEVEL_EMERG	= 0x0,
308349aa284fSHariprasad Shenai 	FW_DEVLOG_LEVEL_CRIT	= 0x1,
308449aa284fSHariprasad Shenai 	FW_DEVLOG_LEVEL_ERR	= 0x2,
308549aa284fSHariprasad Shenai 	FW_DEVLOG_LEVEL_NOTICE	= 0x3,
308649aa284fSHariprasad Shenai 	FW_DEVLOG_LEVEL_INFO	= 0x4,
308749aa284fSHariprasad Shenai 	FW_DEVLOG_LEVEL_DEBUG	= 0x5,
308849aa284fSHariprasad Shenai 	FW_DEVLOG_LEVEL_MAX	= 0x5,
308949aa284fSHariprasad Shenai };
309049aa284fSHariprasad Shenai 
309149aa284fSHariprasad Shenai /* facilities that may send a log message */
309249aa284fSHariprasad Shenai enum fw_devlog_facility {
309349aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_CORE		= 0x00,
309449aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_CF		= 0x01,
309549aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_SCHED	= 0x02,
309649aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_TIMER	= 0x04,
309749aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_RES		= 0x06,
309849aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_HW		= 0x08,
309949aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_FLR		= 0x10,
310049aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_DMAQ		= 0x12,
310149aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_PHY		= 0x14,
310249aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_MAC		= 0x16,
310349aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_PORT		= 0x18,
310449aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_VI		= 0x1A,
310549aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_FILTER	= 0x1C,
310649aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_ACL		= 0x1E,
310749aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_TM		= 0x20,
310849aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_QFC		= 0x22,
310949aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_DCB		= 0x24,
311049aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_ETH		= 0x26,
311149aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_OFLD		= 0x28,
311249aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_RI		= 0x2A,
311349aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_ISCSI	= 0x2C,
311449aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_FCOE		= 0x2E,
311549aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_FOISCSI	= 0x30,
311649aa284fSHariprasad Shenai 	FW_DEVLOG_FACILITY_FOFCOE	= 0x32,
31177ef65a42SHariprasad Shenai 	FW_DEVLOG_FACILITY_CHNET        = 0x34,
31187ef65a42SHariprasad Shenai 	FW_DEVLOG_FACILITY_MAX          = 0x34,
311949aa284fSHariprasad Shenai };
312049aa284fSHariprasad Shenai 
312149aa284fSHariprasad Shenai /* log message format */
312249aa284fSHariprasad Shenai struct fw_devlog_e {
312349aa284fSHariprasad Shenai 	__be64	timestamp;
312449aa284fSHariprasad Shenai 	__be32	seqno;
312549aa284fSHariprasad Shenai 	__be16	reserved1;
312649aa284fSHariprasad Shenai 	__u8	level;
312749aa284fSHariprasad Shenai 	__u8	facility;
312849aa284fSHariprasad Shenai 	__u8	fmt[FW_DEVLOG_FMT_LEN];
312949aa284fSHariprasad Shenai 	__be32	params[FW_DEVLOG_FMT_PARAMS_NUM];
313049aa284fSHariprasad Shenai 	__be32	reserved3[4];
313149aa284fSHariprasad Shenai };
313249aa284fSHariprasad Shenai 
313349aa284fSHariprasad Shenai struct fw_devlog_cmd {
313449aa284fSHariprasad Shenai 	__be32 op_to_write;
313549aa284fSHariprasad Shenai 	__be32 retval_len16;
313649aa284fSHariprasad Shenai 	__u8   level;
313749aa284fSHariprasad Shenai 	__u8   r2[7];
313849aa284fSHariprasad Shenai 	__be32 memtype_devlog_memaddr16_devlog;
313949aa284fSHariprasad Shenai 	__be32 memsize_devlog;
314049aa284fSHariprasad Shenai 	__be32 r3[2];
314149aa284fSHariprasad Shenai };
314249aa284fSHariprasad Shenai 
314349aa284fSHariprasad Shenai #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S		28
314449aa284fSHariprasad Shenai #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M		0xf
314549aa284fSHariprasad Shenai #define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_G(x)	\
314649aa284fSHariprasad Shenai 	(((x) >> FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S) & \
314749aa284fSHariprasad Shenai 	 FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M)
314849aa284fSHariprasad Shenai 
314949aa284fSHariprasad Shenai #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S	0
315049aa284fSHariprasad Shenai #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M	0xfffffff
315149aa284fSHariprasad Shenai #define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_G(x)	\
315249aa284fSHariprasad Shenai 	(((x) >> FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S) & \
315349aa284fSHariprasad Shenai 	 FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M)
315449aa284fSHariprasad Shenai 
31557ef65a42SHariprasad Shenai /* P C I E   F W   P F 7   R E G I S T E R */
31567ef65a42SHariprasad Shenai 
31577ef65a42SHariprasad Shenai /* PF7 stores the Firmware Device Log parameters which allows Host Drivers to
31587ef65a42SHariprasad Shenai  * access the "devlog" which needing to contact firmware.  The encoding is
31597ef65a42SHariprasad Shenai  * mostly the same as that returned by the DEVLOG command except for the size
31607ef65a42SHariprasad Shenai  * which is encoded as the number of entries in multiples-1 of 128 here rather
31617ef65a42SHariprasad Shenai  * than the memory size as is done in the DEVLOG command.  Thus, 0 means 128
31627ef65a42SHariprasad Shenai  * and 15 means 2048.  This of course in turn constrains the allowed values
31637ef65a42SHariprasad Shenai  * for the devlog size ...
31647ef65a42SHariprasad Shenai  */
31657ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG		7
31667ef65a42SHariprasad Shenai 
31677ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_NENTRIES128_S	28
31687ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_NENTRIES128_M	0xf
31697ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_NENTRIES128_V(x) \
31707ef65a42SHariprasad Shenai 	((x) << PCIE_FW_PF_DEVLOG_NENTRIES128_S)
31717ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_NENTRIES128_G(x) \
31727ef65a42SHariprasad Shenai 	(((x) >> PCIE_FW_PF_DEVLOG_NENTRIES128_S) & \
31737ef65a42SHariprasad Shenai 	 PCIE_FW_PF_DEVLOG_NENTRIES128_M)
31747ef65a42SHariprasad Shenai 
31757ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_ADDR16_S	4
31767ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_ADDR16_M	0xffffff
31777ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_ADDR16_V(x)	((x) << PCIE_FW_PF_DEVLOG_ADDR16_S)
31787ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_ADDR16_G(x) \
31797ef65a42SHariprasad Shenai 	(((x) >> PCIE_FW_PF_DEVLOG_ADDR16_S) & PCIE_FW_PF_DEVLOG_ADDR16_M)
31807ef65a42SHariprasad Shenai 
31817ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_MEMTYPE_S	0
31827ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_MEMTYPE_M	0xf
31837ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_MEMTYPE_V(x)	((x) << PCIE_FW_PF_DEVLOG_MEMTYPE_S)
31847ef65a42SHariprasad Shenai #define PCIE_FW_PF_DEVLOG_MEMTYPE_G(x) \
31857ef65a42SHariprasad Shenai 	(((x) >> PCIE_FW_PF_DEVLOG_MEMTYPE_S) & PCIE_FW_PF_DEVLOG_MEMTYPE_M)
31867ef65a42SHariprasad Shenai 
3187f7917c00SJeff Kirsher #endif /* _T4FW_INTERFACE_H_ */
3188