blob: aceb1e8cacc894475ed8ff6cbeb8a9783c3f4f3c [file] [log] [blame]
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001/*
2 * This file is part of the Chelsio T4 Ethernet driver for Linux.
3 *
Anish Bhattce100b8b2014-06-19 21:37:15 -07004 * Copyright (c) 2009-2014 Chelsio Communications, Inc. All rights reserved.
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00005 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#ifndef _T4FW_INTERFACE_H_
36#define _T4FW_INTERFACE_H_
37
Vipul Pandya5be78ee2012-12-10 09:30:54 +000038enum fw_retval {
Joe Perchesdbedd442015-03-06 20:49:12 -080039 FW_SUCCESS = 0, /* completed successfully */
Vipul Pandya5be78ee2012-12-10 09:30:54 +000040 FW_EPERM = 1, /* operation not permitted */
41 FW_ENOENT = 2, /* no such file or directory */
42 FW_EIO = 5, /* input/output error; hw bad */
43 FW_ENOEXEC = 8, /* exec format error; inv microcode */
44 FW_EAGAIN = 11, /* try again */
45 FW_ENOMEM = 12, /* out of memory */
46 FW_EFAULT = 14, /* bad address; fw bad */
47 FW_EBUSY = 16, /* resource busy */
48 FW_EEXIST = 17, /* file exists */
Anish Bhatt989594e2014-06-19 21:37:11 -070049 FW_ENODEV = 19, /* no such device */
Vipul Pandya5be78ee2012-12-10 09:30:54 +000050 FW_EINVAL = 22, /* invalid argument */
51 FW_ENOSPC = 28, /* no space left on device */
52 FW_ENOSYS = 38, /* functionality not implemented */
Anish Bhatt989594e2014-06-19 21:37:11 -070053 FW_ENODATA = 61, /* no data available */
Vipul Pandya5be78ee2012-12-10 09:30:54 +000054 FW_EPROTO = 71, /* protocol error */
55 FW_EADDRINUSE = 98, /* address already in use */
56 FW_EADDRNOTAVAIL = 99, /* cannot assigned requested address */
57 FW_ENETDOWN = 100, /* network is down */
58 FW_ENETUNREACH = 101, /* network is unreachable */
59 FW_ENOBUFS = 105, /* no buffer space available */
60 FW_ETIMEDOUT = 110, /* timeout */
61 FW_EINPROGRESS = 115, /* fw internal */
62 FW_SCSI_ABORT_REQUESTED = 128, /* */
63 FW_SCSI_ABORT_TIMEDOUT = 129, /* */
64 FW_SCSI_ABORTED = 130, /* */
65 FW_SCSI_CLOSE_REQUESTED = 131, /* */
66 FW_ERR_LINK_DOWN = 132, /* */
67 FW_RDEV_NOT_READY = 133, /* */
68 FW_ERR_RDEV_LOST = 134, /* */
69 FW_ERR_RDEV_LOGO = 135, /* */
70 FW_FCOE_NO_XCHG = 136, /* */
71 FW_SCSI_RSP_ERR = 137, /* */
72 FW_ERR_RDEV_IMPL_LOGO = 138, /* */
73 FW_SCSI_UNDER_FLOW_ERR = 139, /* */
74 FW_SCSI_OVER_FLOW_ERR = 140, /* */
75 FW_SCSI_DDP_ERR = 141, /* DDP error*/
76 FW_SCSI_TASK_ERR = 142, /* No SCSI tasks available */
Vipul Pandyaf2b7e782012-12-10 09:30:52 +000077};
78
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +000079#define FW_T4VF_SGE_BASE_ADDR 0x0000
80#define FW_T4VF_MPS_BASE_ADDR 0x0100
81#define FW_T4VF_PL_BASE_ADDR 0x0200
82#define FW_T4VF_MBDATA_BASE_ADDR 0x0240
83#define FW_T4VF_CIM_BASE_ADDR 0x0300
84
85enum fw_wr_opcodes {
86 FW_FILTER_WR = 0x02,
87 FW_ULPTX_WR = 0x04,
88 FW_TP_WR = 0x05,
89 FW_ETH_TX_PKT_WR = 0x08,
Vipul Pandya5be78ee2012-12-10 09:30:54 +000090 FW_OFLD_CONNECTION_WR = 0x2f,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +000091 FW_FLOWC_WR = 0x0a,
92 FW_OFLD_TX_DATA_WR = 0x0b,
93 FW_CMD_WR = 0x10,
94 FW_ETH_TX_PKT_VM_WR = 0x11,
95 FW_RI_RES_WR = 0x0c,
96 FW_RI_INIT_WR = 0x0d,
97 FW_RI_RDMA_WRITE_WR = 0x14,
98 FW_RI_SEND_WR = 0x15,
99 FW_RI_RDMA_READ_WR = 0x16,
100 FW_RI_RECV_WR = 0x17,
101 FW_RI_BIND_MW_WR = 0x18,
102 FW_RI_FR_NSMR_WR = 0x19,
103 FW_RI_INV_LSTAG_WR = 0x1a,
Hariprasad Shenai7ef65a42015-04-01 21:41:15 +0530104 FW_LASTC2E_WR = 0x70
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000105};
106
107struct fw_wr_hdr {
108 __be32 hi;
109 __be32 lo;
110};
111
Hariprasad Shenaie2ac9622014-11-07 09:35:25 +0530112/* work request opcode (hi) */
113#define FW_WR_OP_S 24
114#define FW_WR_OP_M 0xff
115#define FW_WR_OP_V(x) ((x) << FW_WR_OP_S)
116#define FW_WR_OP_G(x) (((x) >> FW_WR_OP_S) & FW_WR_OP_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000117
Hariprasad Shenaie2ac9622014-11-07 09:35:25 +0530118/* atomic flag (hi) - firmware encapsulates CPLs in CPL_BARRIER */
119#define FW_WR_ATOMIC_S 23
120#define FW_WR_ATOMIC_V(x) ((x) << FW_WR_ATOMIC_S)
121
122/* flush flag (hi) - firmware flushes flushable work request buffered
123 * in the flow context.
124 */
125#define FW_WR_FLUSH_S 22
126#define FW_WR_FLUSH_V(x) ((x) << FW_WR_FLUSH_S)
127
128/* completion flag (hi) - firmware generates a cpl_fw6_ack */
129#define FW_WR_COMPL_S 21
130#define FW_WR_COMPL_V(x) ((x) << FW_WR_COMPL_S)
131#define FW_WR_COMPL_F FW_WR_COMPL_V(1U)
132
133/* work request immediate data length (hi) */
134#define FW_WR_IMMDLEN_S 0
135#define FW_WR_IMMDLEN_M 0xff
136#define FW_WR_IMMDLEN_V(x) ((x) << FW_WR_IMMDLEN_S)
137
138/* egress queue status update to associated ingress queue entry (lo) */
139#define FW_WR_EQUIQ_S 31
140#define FW_WR_EQUIQ_V(x) ((x) << FW_WR_EQUIQ_S)
141#define FW_WR_EQUIQ_F FW_WR_EQUIQ_V(1U)
142
143/* egress queue status update to egress queue status entry (lo) */
144#define FW_WR_EQUEQ_S 30
145#define FW_WR_EQUEQ_V(x) ((x) << FW_WR_EQUEQ_S)
146#define FW_WR_EQUEQ_F FW_WR_EQUEQ_V(1U)
147
148/* flow context identifier (lo) */
149#define FW_WR_FLOWID_S 8
150#define FW_WR_FLOWID_V(x) ((x) << FW_WR_FLOWID_S)
151
152/* length in units of 16-bytes (lo) */
153#define FW_WR_LEN16_S 0
154#define FW_WR_LEN16_V(x) ((x) << FW_WR_LEN16_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000155
Vipul Pandya13ee15d2012-09-26 02:39:40 +0000156#define HW_TPL_FR_MT_PR_IV_P_FC 0X32B
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000157#define HW_TPL_FR_MT_PR_OV_P_FC 0X327
Vipul Pandya13ee15d2012-09-26 02:39:40 +0000158
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000159/* filter wr reply code in cookie in CPL_SET_TCB_RPL */
160enum fw_filter_wr_cookie {
161 FW_FILTER_WR_SUCCESS,
162 FW_FILTER_WR_FLT_ADDED,
163 FW_FILTER_WR_FLT_DELETED,
164 FW_FILTER_WR_SMT_TBL_FULL,
165 FW_FILTER_WR_EINVAL,
166};
167
168struct fw_filter_wr {
169 __be32 op_pkd;
170 __be32 len16_pkd;
171 __be64 r3;
172 __be32 tid_to_iq;
173 __be32 del_filter_to_l2tix;
174 __be16 ethtype;
175 __be16 ethtypem;
176 __u8 frag_to_ovlan_vldm;
177 __u8 smac_sel;
178 __be16 rx_chan_rx_rpl_iq;
179 __be32 maci_to_matchtypem;
180 __u8 ptcl;
181 __u8 ptclm;
182 __u8 ttyp;
183 __u8 ttypm;
184 __be16 ivlan;
185 __be16 ivlanm;
186 __be16 ovlan;
187 __be16 ovlanm;
188 __u8 lip[16];
189 __u8 lipm[16];
190 __u8 fip[16];
191 __u8 fipm[16];
192 __be16 lp;
193 __be16 lpm;
194 __be16 fp;
195 __be16 fpm;
196 __be16 r7;
197 __u8 sma[6];
198};
199
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530200#define FW_FILTER_WR_TID_S 12
201#define FW_FILTER_WR_TID_M 0xfffff
202#define FW_FILTER_WR_TID_V(x) ((x) << FW_FILTER_WR_TID_S)
203#define FW_FILTER_WR_TID_G(x) \
204 (((x) >> FW_FILTER_WR_TID_S) & FW_FILTER_WR_TID_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000205
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530206#define FW_FILTER_WR_RQTYPE_S 11
207#define FW_FILTER_WR_RQTYPE_M 0x1
208#define FW_FILTER_WR_RQTYPE_V(x) ((x) << FW_FILTER_WR_RQTYPE_S)
209#define FW_FILTER_WR_RQTYPE_G(x) \
210 (((x) >> FW_FILTER_WR_RQTYPE_S) & FW_FILTER_WR_RQTYPE_M)
211#define FW_FILTER_WR_RQTYPE_F FW_FILTER_WR_RQTYPE_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000212
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530213#define FW_FILTER_WR_NOREPLY_S 10
214#define FW_FILTER_WR_NOREPLY_M 0x1
215#define FW_FILTER_WR_NOREPLY_V(x) ((x) << FW_FILTER_WR_NOREPLY_S)
216#define FW_FILTER_WR_NOREPLY_G(x) \
217 (((x) >> FW_FILTER_WR_NOREPLY_S) & FW_FILTER_WR_NOREPLY_M)
218#define FW_FILTER_WR_NOREPLY_F FW_FILTER_WR_NOREPLY_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000219
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530220#define FW_FILTER_WR_IQ_S 0
221#define FW_FILTER_WR_IQ_M 0x3ff
222#define FW_FILTER_WR_IQ_V(x) ((x) << FW_FILTER_WR_IQ_S)
223#define FW_FILTER_WR_IQ_G(x) \
224 (((x) >> FW_FILTER_WR_IQ_S) & FW_FILTER_WR_IQ_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000225
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530226#define FW_FILTER_WR_DEL_FILTER_S 31
227#define FW_FILTER_WR_DEL_FILTER_M 0x1
228#define FW_FILTER_WR_DEL_FILTER_V(x) ((x) << FW_FILTER_WR_DEL_FILTER_S)
229#define FW_FILTER_WR_DEL_FILTER_G(x) \
230 (((x) >> FW_FILTER_WR_DEL_FILTER_S) & FW_FILTER_WR_DEL_FILTER_M)
231#define FW_FILTER_WR_DEL_FILTER_F FW_FILTER_WR_DEL_FILTER_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000232
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530233#define FW_FILTER_WR_RPTTID_S 25
234#define FW_FILTER_WR_RPTTID_M 0x1
235#define FW_FILTER_WR_RPTTID_V(x) ((x) << FW_FILTER_WR_RPTTID_S)
236#define FW_FILTER_WR_RPTTID_G(x) \
237 (((x) >> FW_FILTER_WR_RPTTID_S) & FW_FILTER_WR_RPTTID_M)
238#define FW_FILTER_WR_RPTTID_F FW_FILTER_WR_RPTTID_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000239
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530240#define FW_FILTER_WR_DROP_S 24
241#define FW_FILTER_WR_DROP_M 0x1
242#define FW_FILTER_WR_DROP_V(x) ((x) << FW_FILTER_WR_DROP_S)
243#define FW_FILTER_WR_DROP_G(x) \
244 (((x) >> FW_FILTER_WR_DROP_S) & FW_FILTER_WR_DROP_M)
245#define FW_FILTER_WR_DROP_F FW_FILTER_WR_DROP_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000246
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530247#define FW_FILTER_WR_DIRSTEER_S 23
248#define FW_FILTER_WR_DIRSTEER_M 0x1
249#define FW_FILTER_WR_DIRSTEER_V(x) ((x) << FW_FILTER_WR_DIRSTEER_S)
250#define FW_FILTER_WR_DIRSTEER_G(x) \
251 (((x) >> FW_FILTER_WR_DIRSTEER_S) & FW_FILTER_WR_DIRSTEER_M)
252#define FW_FILTER_WR_DIRSTEER_F FW_FILTER_WR_DIRSTEER_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000253
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530254#define FW_FILTER_WR_MASKHASH_S 22
255#define FW_FILTER_WR_MASKHASH_M 0x1
256#define FW_FILTER_WR_MASKHASH_V(x) ((x) << FW_FILTER_WR_MASKHASH_S)
257#define FW_FILTER_WR_MASKHASH_G(x) \
258 (((x) >> FW_FILTER_WR_MASKHASH_S) & FW_FILTER_WR_MASKHASH_M)
259#define FW_FILTER_WR_MASKHASH_F FW_FILTER_WR_MASKHASH_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000260
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530261#define FW_FILTER_WR_DIRSTEERHASH_S 21
262#define FW_FILTER_WR_DIRSTEERHASH_M 0x1
263#define FW_FILTER_WR_DIRSTEERHASH_V(x) ((x) << FW_FILTER_WR_DIRSTEERHASH_S)
264#define FW_FILTER_WR_DIRSTEERHASH_G(x) \
265 (((x) >> FW_FILTER_WR_DIRSTEERHASH_S) & FW_FILTER_WR_DIRSTEERHASH_M)
266#define FW_FILTER_WR_DIRSTEERHASH_F FW_FILTER_WR_DIRSTEERHASH_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000267
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530268#define FW_FILTER_WR_LPBK_S 20
269#define FW_FILTER_WR_LPBK_M 0x1
270#define FW_FILTER_WR_LPBK_V(x) ((x) << FW_FILTER_WR_LPBK_S)
271#define FW_FILTER_WR_LPBK_G(x) \
272 (((x) >> FW_FILTER_WR_LPBK_S) & FW_FILTER_WR_LPBK_M)
273#define FW_FILTER_WR_LPBK_F FW_FILTER_WR_LPBK_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000274
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530275#define FW_FILTER_WR_DMAC_S 19
276#define FW_FILTER_WR_DMAC_M 0x1
277#define FW_FILTER_WR_DMAC_V(x) ((x) << FW_FILTER_WR_DMAC_S)
278#define FW_FILTER_WR_DMAC_G(x) \
279 (((x) >> FW_FILTER_WR_DMAC_S) & FW_FILTER_WR_DMAC_M)
280#define FW_FILTER_WR_DMAC_F FW_FILTER_WR_DMAC_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000281
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530282#define FW_FILTER_WR_SMAC_S 18
283#define FW_FILTER_WR_SMAC_M 0x1
284#define FW_FILTER_WR_SMAC_V(x) ((x) << FW_FILTER_WR_SMAC_S)
285#define FW_FILTER_WR_SMAC_G(x) \
286 (((x) >> FW_FILTER_WR_SMAC_S) & FW_FILTER_WR_SMAC_M)
287#define FW_FILTER_WR_SMAC_F FW_FILTER_WR_SMAC_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000288
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530289#define FW_FILTER_WR_INSVLAN_S 17
290#define FW_FILTER_WR_INSVLAN_M 0x1
291#define FW_FILTER_WR_INSVLAN_V(x) ((x) << FW_FILTER_WR_INSVLAN_S)
292#define FW_FILTER_WR_INSVLAN_G(x) \
293 (((x) >> FW_FILTER_WR_INSVLAN_S) & FW_FILTER_WR_INSVLAN_M)
294#define FW_FILTER_WR_INSVLAN_F FW_FILTER_WR_INSVLAN_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000295
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530296#define FW_FILTER_WR_RMVLAN_S 16
297#define FW_FILTER_WR_RMVLAN_M 0x1
298#define FW_FILTER_WR_RMVLAN_V(x) ((x) << FW_FILTER_WR_RMVLAN_S)
299#define FW_FILTER_WR_RMVLAN_G(x) \
300 (((x) >> FW_FILTER_WR_RMVLAN_S) & FW_FILTER_WR_RMVLAN_M)
301#define FW_FILTER_WR_RMVLAN_F FW_FILTER_WR_RMVLAN_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000302
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530303#define FW_FILTER_WR_HITCNTS_S 15
304#define FW_FILTER_WR_HITCNTS_M 0x1
305#define FW_FILTER_WR_HITCNTS_V(x) ((x) << FW_FILTER_WR_HITCNTS_S)
306#define FW_FILTER_WR_HITCNTS_G(x) \
307 (((x) >> FW_FILTER_WR_HITCNTS_S) & FW_FILTER_WR_HITCNTS_M)
308#define FW_FILTER_WR_HITCNTS_F FW_FILTER_WR_HITCNTS_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000309
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530310#define FW_FILTER_WR_TXCHAN_S 13
311#define FW_FILTER_WR_TXCHAN_M 0x3
312#define FW_FILTER_WR_TXCHAN_V(x) ((x) << FW_FILTER_WR_TXCHAN_S)
313#define FW_FILTER_WR_TXCHAN_G(x) \
314 (((x) >> FW_FILTER_WR_TXCHAN_S) & FW_FILTER_WR_TXCHAN_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000315
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530316#define FW_FILTER_WR_PRIO_S 12
317#define FW_FILTER_WR_PRIO_M 0x1
318#define FW_FILTER_WR_PRIO_V(x) ((x) << FW_FILTER_WR_PRIO_S)
319#define FW_FILTER_WR_PRIO_G(x) \
320 (((x) >> FW_FILTER_WR_PRIO_S) & FW_FILTER_WR_PRIO_M)
321#define FW_FILTER_WR_PRIO_F FW_FILTER_WR_PRIO_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000322
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530323#define FW_FILTER_WR_L2TIX_S 0
324#define FW_FILTER_WR_L2TIX_M 0xfff
325#define FW_FILTER_WR_L2TIX_V(x) ((x) << FW_FILTER_WR_L2TIX_S)
326#define FW_FILTER_WR_L2TIX_G(x) \
327 (((x) >> FW_FILTER_WR_L2TIX_S) & FW_FILTER_WR_L2TIX_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000328
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530329#define FW_FILTER_WR_FRAG_S 7
330#define FW_FILTER_WR_FRAG_M 0x1
331#define FW_FILTER_WR_FRAG_V(x) ((x) << FW_FILTER_WR_FRAG_S)
332#define FW_FILTER_WR_FRAG_G(x) \
333 (((x) >> FW_FILTER_WR_FRAG_S) & FW_FILTER_WR_FRAG_M)
334#define FW_FILTER_WR_FRAG_F FW_FILTER_WR_FRAG_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000335
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530336#define FW_FILTER_WR_FRAGM_S 6
337#define FW_FILTER_WR_FRAGM_M 0x1
338#define FW_FILTER_WR_FRAGM_V(x) ((x) << FW_FILTER_WR_FRAGM_S)
339#define FW_FILTER_WR_FRAGM_G(x) \
340 (((x) >> FW_FILTER_WR_FRAGM_S) & FW_FILTER_WR_FRAGM_M)
341#define FW_FILTER_WR_FRAGM_F FW_FILTER_WR_FRAGM_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000342
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530343#define FW_FILTER_WR_IVLAN_VLD_S 5
344#define FW_FILTER_WR_IVLAN_VLD_M 0x1
345#define FW_FILTER_WR_IVLAN_VLD_V(x) ((x) << FW_FILTER_WR_IVLAN_VLD_S)
346#define FW_FILTER_WR_IVLAN_VLD_G(x) \
347 (((x) >> FW_FILTER_WR_IVLAN_VLD_S) & FW_FILTER_WR_IVLAN_VLD_M)
348#define FW_FILTER_WR_IVLAN_VLD_F FW_FILTER_WR_IVLAN_VLD_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000349
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530350#define FW_FILTER_WR_OVLAN_VLD_S 4
351#define FW_FILTER_WR_OVLAN_VLD_M 0x1
352#define FW_FILTER_WR_OVLAN_VLD_V(x) ((x) << FW_FILTER_WR_OVLAN_VLD_S)
353#define FW_FILTER_WR_OVLAN_VLD_G(x) \
354 (((x) >> FW_FILTER_WR_OVLAN_VLD_S) & FW_FILTER_WR_OVLAN_VLD_M)
355#define FW_FILTER_WR_OVLAN_VLD_F FW_FILTER_WR_OVLAN_VLD_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000356
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530357#define FW_FILTER_WR_IVLAN_VLDM_S 3
358#define FW_FILTER_WR_IVLAN_VLDM_M 0x1
359#define FW_FILTER_WR_IVLAN_VLDM_V(x) ((x) << FW_FILTER_WR_IVLAN_VLDM_S)
360#define FW_FILTER_WR_IVLAN_VLDM_G(x) \
361 (((x) >> FW_FILTER_WR_IVLAN_VLDM_S) & FW_FILTER_WR_IVLAN_VLDM_M)
362#define FW_FILTER_WR_IVLAN_VLDM_F FW_FILTER_WR_IVLAN_VLDM_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000363
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530364#define FW_FILTER_WR_OVLAN_VLDM_S 2
365#define FW_FILTER_WR_OVLAN_VLDM_M 0x1
366#define FW_FILTER_WR_OVLAN_VLDM_V(x) ((x) << FW_FILTER_WR_OVLAN_VLDM_S)
367#define FW_FILTER_WR_OVLAN_VLDM_G(x) \
368 (((x) >> FW_FILTER_WR_OVLAN_VLDM_S) & FW_FILTER_WR_OVLAN_VLDM_M)
369#define FW_FILTER_WR_OVLAN_VLDM_F FW_FILTER_WR_OVLAN_VLDM_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000370
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530371#define FW_FILTER_WR_RX_CHAN_S 15
372#define FW_FILTER_WR_RX_CHAN_M 0x1
373#define FW_FILTER_WR_RX_CHAN_V(x) ((x) << FW_FILTER_WR_RX_CHAN_S)
374#define FW_FILTER_WR_RX_CHAN_G(x) \
375 (((x) >> FW_FILTER_WR_RX_CHAN_S) & FW_FILTER_WR_RX_CHAN_M)
376#define FW_FILTER_WR_RX_CHAN_F FW_FILTER_WR_RX_CHAN_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000377
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530378#define FW_FILTER_WR_RX_RPL_IQ_S 0
379#define FW_FILTER_WR_RX_RPL_IQ_M 0x3ff
380#define FW_FILTER_WR_RX_RPL_IQ_V(x) ((x) << FW_FILTER_WR_RX_RPL_IQ_S)
381#define FW_FILTER_WR_RX_RPL_IQ_G(x) \
382 (((x) >> FW_FILTER_WR_RX_RPL_IQ_S) & FW_FILTER_WR_RX_RPL_IQ_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000383
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530384#define FW_FILTER_WR_MACI_S 23
385#define FW_FILTER_WR_MACI_M 0x1ff
386#define FW_FILTER_WR_MACI_V(x) ((x) << FW_FILTER_WR_MACI_S)
387#define FW_FILTER_WR_MACI_G(x) \
388 (((x) >> FW_FILTER_WR_MACI_S) & FW_FILTER_WR_MACI_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000389
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530390#define FW_FILTER_WR_MACIM_S 14
391#define FW_FILTER_WR_MACIM_M 0x1ff
392#define FW_FILTER_WR_MACIM_V(x) ((x) << FW_FILTER_WR_MACIM_S)
393#define FW_FILTER_WR_MACIM_G(x) \
394 (((x) >> FW_FILTER_WR_MACIM_S) & FW_FILTER_WR_MACIM_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000395
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530396#define FW_FILTER_WR_FCOE_S 13
397#define FW_FILTER_WR_FCOE_M 0x1
398#define FW_FILTER_WR_FCOE_V(x) ((x) << FW_FILTER_WR_FCOE_S)
399#define FW_FILTER_WR_FCOE_G(x) \
400 (((x) >> FW_FILTER_WR_FCOE_S) & FW_FILTER_WR_FCOE_M)
401#define FW_FILTER_WR_FCOE_F FW_FILTER_WR_FCOE_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000402
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530403#define FW_FILTER_WR_FCOEM_S 12
404#define FW_FILTER_WR_FCOEM_M 0x1
405#define FW_FILTER_WR_FCOEM_V(x) ((x) << FW_FILTER_WR_FCOEM_S)
406#define FW_FILTER_WR_FCOEM_G(x) \
407 (((x) >> FW_FILTER_WR_FCOEM_S) & FW_FILTER_WR_FCOEM_M)
408#define FW_FILTER_WR_FCOEM_F FW_FILTER_WR_FCOEM_V(1U)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000409
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530410#define FW_FILTER_WR_PORT_S 9
411#define FW_FILTER_WR_PORT_M 0x7
412#define FW_FILTER_WR_PORT_V(x) ((x) << FW_FILTER_WR_PORT_S)
413#define FW_FILTER_WR_PORT_G(x) \
414 (((x) >> FW_FILTER_WR_PORT_S) & FW_FILTER_WR_PORT_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000415
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530416#define FW_FILTER_WR_PORTM_S 6
417#define FW_FILTER_WR_PORTM_M 0x7
418#define FW_FILTER_WR_PORTM_V(x) ((x) << FW_FILTER_WR_PORTM_S)
419#define FW_FILTER_WR_PORTM_G(x) \
420 (((x) >> FW_FILTER_WR_PORTM_S) & FW_FILTER_WR_PORTM_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000421
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530422#define FW_FILTER_WR_MATCHTYPE_S 3
423#define FW_FILTER_WR_MATCHTYPE_M 0x7
424#define FW_FILTER_WR_MATCHTYPE_V(x) ((x) << FW_FILTER_WR_MATCHTYPE_S)
425#define FW_FILTER_WR_MATCHTYPE_G(x) \
426 (((x) >> FW_FILTER_WR_MATCHTYPE_S) & FW_FILTER_WR_MATCHTYPE_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000427
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530428#define FW_FILTER_WR_MATCHTYPEM_S 0
429#define FW_FILTER_WR_MATCHTYPEM_M 0x7
430#define FW_FILTER_WR_MATCHTYPEM_V(x) ((x) << FW_FILTER_WR_MATCHTYPEM_S)
431#define FW_FILTER_WR_MATCHTYPEM_G(x) \
432 (((x) >> FW_FILTER_WR_MATCHTYPEM_S) & FW_FILTER_WR_MATCHTYPEM_M)
Vipul Pandyaf2b7e782012-12-10 09:30:52 +0000433
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000434struct fw_ulptx_wr {
435 __be32 op_to_compl;
436 __be32 flowid_len16;
437 u64 cookie;
438};
439
440struct fw_tp_wr {
441 __be32 op_to_immdlen;
442 __be32 flowid_len16;
443 u64 cookie;
444};
445
446struct fw_eth_tx_pkt_wr {
447 __be32 op_immdlen;
448 __be32 equiq_to_len16;
449 __be64 r3;
450};
451
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000452struct fw_ofld_connection_wr {
453 __be32 op_compl;
454 __be32 len16_pkd;
455 __u64 cookie;
456 __be64 r2;
457 __be64 r3;
458 struct fw_ofld_connection_le {
459 __be32 version_cpl;
460 __be32 filter;
461 __be32 r1;
462 __be16 lport;
463 __be16 pport;
464 union fw_ofld_connection_leip {
465 struct fw_ofld_connection_le_ipv4 {
466 __be32 pip;
467 __be32 lip;
468 __be64 r0;
469 __be64 r1;
470 __be64 r2;
471 } ipv4;
472 struct fw_ofld_connection_le_ipv6 {
473 __be64 pip_hi;
474 __be64 pip_lo;
475 __be64 lip_hi;
476 __be64 lip_lo;
477 } ipv6;
478 } u;
479 } le;
480 struct fw_ofld_connection_tcb {
481 __be32 t_state_to_astid;
482 __be16 cplrxdataack_cplpassacceptrpl;
483 __be16 rcv_adv;
484 __be32 rcv_nxt;
485 __be32 tx_max;
486 __be64 opt0;
487 __be32 opt2;
488 __be32 r1;
489 __be64 r2;
490 __be64 r3;
491 } tcb;
492};
493
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530494#define FW_OFLD_CONNECTION_WR_VERSION_S 31
495#define FW_OFLD_CONNECTION_WR_VERSION_M 0x1
496#define FW_OFLD_CONNECTION_WR_VERSION_V(x) \
497 ((x) << FW_OFLD_CONNECTION_WR_VERSION_S)
498#define FW_OFLD_CONNECTION_WR_VERSION_G(x) \
499 (((x) >> FW_OFLD_CONNECTION_WR_VERSION_S) & \
500 FW_OFLD_CONNECTION_WR_VERSION_M)
501#define FW_OFLD_CONNECTION_WR_VERSION_F \
502 FW_OFLD_CONNECTION_WR_VERSION_V(1U)
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000503
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530504#define FW_OFLD_CONNECTION_WR_CPL_S 30
505#define FW_OFLD_CONNECTION_WR_CPL_M 0x1
506#define FW_OFLD_CONNECTION_WR_CPL_V(x) ((x) << FW_OFLD_CONNECTION_WR_CPL_S)
507#define FW_OFLD_CONNECTION_WR_CPL_G(x) \
508 (((x) >> FW_OFLD_CONNECTION_WR_CPL_S) & FW_OFLD_CONNECTION_WR_CPL_M)
509#define FW_OFLD_CONNECTION_WR_CPL_F FW_OFLD_CONNECTION_WR_CPL_V(1U)
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000510
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530511#define FW_OFLD_CONNECTION_WR_T_STATE_S 28
512#define FW_OFLD_CONNECTION_WR_T_STATE_M 0xf
513#define FW_OFLD_CONNECTION_WR_T_STATE_V(x) \
514 ((x) << FW_OFLD_CONNECTION_WR_T_STATE_S)
515#define FW_OFLD_CONNECTION_WR_T_STATE_G(x) \
516 (((x) >> FW_OFLD_CONNECTION_WR_T_STATE_S) & \
517 FW_OFLD_CONNECTION_WR_T_STATE_M)
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000518
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530519#define FW_OFLD_CONNECTION_WR_RCV_SCALE_S 24
520#define FW_OFLD_CONNECTION_WR_RCV_SCALE_M 0xf
521#define FW_OFLD_CONNECTION_WR_RCV_SCALE_V(x) \
522 ((x) << FW_OFLD_CONNECTION_WR_RCV_SCALE_S)
523#define FW_OFLD_CONNECTION_WR_RCV_SCALE_G(x) \
524 (((x) >> FW_OFLD_CONNECTION_WR_RCV_SCALE_S) & \
525 FW_OFLD_CONNECTION_WR_RCV_SCALE_M)
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000526
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530527#define FW_OFLD_CONNECTION_WR_ASTID_S 0
528#define FW_OFLD_CONNECTION_WR_ASTID_M 0xffffff
529#define FW_OFLD_CONNECTION_WR_ASTID_V(x) \
530 ((x) << FW_OFLD_CONNECTION_WR_ASTID_S)
531#define FW_OFLD_CONNECTION_WR_ASTID_G(x) \
532 (((x) >> FW_OFLD_CONNECTION_WR_ASTID_S) & FW_OFLD_CONNECTION_WR_ASTID_M)
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000533
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530534#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S 15
535#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M 0x1
536#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(x) \
537 ((x) << FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S)
538#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_G(x) \
539 (((x) >> FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S) & \
540 FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M)
541#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_F \
542 FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(1U)
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000543
Hariprasad Shenai77a80e22014-11-21 12:52:01 +0530544#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S 14
545#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M 0x1
546#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(x) \
547 ((x) << FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S)
548#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_G(x) \
549 (((x) >> FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S) & \
550 FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M)
551#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_F \
552 FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(1U)
Vipul Pandya5be78ee2012-12-10 09:30:54 +0000553
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000554enum fw_flowc_mnem {
555 FW_FLOWC_MNEM_PFNVFN, /* PFN [15:8] VFN [7:0] */
556 FW_FLOWC_MNEM_CH,
557 FW_FLOWC_MNEM_PORT,
558 FW_FLOWC_MNEM_IQID,
559 FW_FLOWC_MNEM_SNDNXT,
560 FW_FLOWC_MNEM_RCVNXT,
561 FW_FLOWC_MNEM_SNDBUF,
562 FW_FLOWC_MNEM_MSS,
Karen Xie64bfead2014-12-11 19:13:35 -0800563 FW_FLOWC_MNEM_TXDATAPLEN_MAX,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000564};
565
566struct fw_flowc_mnemval {
567 u8 mnemonic;
568 u8 r4[3];
569 __be32 val;
570};
571
572struct fw_flowc_wr {
573 __be32 op_to_nparams;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000574 __be32 flowid_len16;
575 struct fw_flowc_mnemval mnemval[0];
576};
577
Hariprasad Shenaie2ac9622014-11-07 09:35:25 +0530578#define FW_FLOWC_WR_NPARAMS_S 0
579#define FW_FLOWC_WR_NPARAMS_V(x) ((x) << FW_FLOWC_WR_NPARAMS_S)
580
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000581struct fw_ofld_tx_data_wr {
582 __be32 op_to_immdlen;
583 __be32 flowid_len16;
584 __be32 plen;
585 __be32 tunnel_to_proxy;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000586};
587
Hariprasad Shenaie2ac9622014-11-07 09:35:25 +0530588#define FW_OFLD_TX_DATA_WR_TUNNEL_S 19
589#define FW_OFLD_TX_DATA_WR_TUNNEL_V(x) ((x) << FW_OFLD_TX_DATA_WR_TUNNEL_S)
590
591#define FW_OFLD_TX_DATA_WR_SAVE_S 18
592#define FW_OFLD_TX_DATA_WR_SAVE_V(x) ((x) << FW_OFLD_TX_DATA_WR_SAVE_S)
593
594#define FW_OFLD_TX_DATA_WR_FLUSH_S 17
595#define FW_OFLD_TX_DATA_WR_FLUSH_V(x) ((x) << FW_OFLD_TX_DATA_WR_FLUSH_S)
596#define FW_OFLD_TX_DATA_WR_FLUSH_F FW_OFLD_TX_DATA_WR_FLUSH_V(1U)
597
598#define FW_OFLD_TX_DATA_WR_URGENT_S 16
599#define FW_OFLD_TX_DATA_WR_URGENT_V(x) ((x) << FW_OFLD_TX_DATA_WR_URGENT_S)
600
601#define FW_OFLD_TX_DATA_WR_MORE_S 15
602#define FW_OFLD_TX_DATA_WR_MORE_V(x) ((x) << FW_OFLD_TX_DATA_WR_MORE_S)
603
604#define FW_OFLD_TX_DATA_WR_SHOVE_S 14
605#define FW_OFLD_TX_DATA_WR_SHOVE_V(x) ((x) << FW_OFLD_TX_DATA_WR_SHOVE_S)
606#define FW_OFLD_TX_DATA_WR_SHOVE_F FW_OFLD_TX_DATA_WR_SHOVE_V(1U)
607
608#define FW_OFLD_TX_DATA_WR_ULPMODE_S 10
609#define FW_OFLD_TX_DATA_WR_ULPMODE_V(x) ((x) << FW_OFLD_TX_DATA_WR_ULPMODE_S)
610
611#define FW_OFLD_TX_DATA_WR_ULPSUBMODE_S 6
612#define FW_OFLD_TX_DATA_WR_ULPSUBMODE_V(x) \
613 ((x) << FW_OFLD_TX_DATA_WR_ULPSUBMODE_S)
614
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000615struct fw_cmd_wr {
616 __be32 op_dma;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000617 __be32 len16_pkd;
618 __be64 cookie_daddr;
619};
620
Hariprasad Shenaie2ac9622014-11-07 09:35:25 +0530621#define FW_CMD_WR_DMA_S 17
622#define FW_CMD_WR_DMA_V(x) ((x) << FW_CMD_WR_DMA_S)
623
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000624struct fw_eth_tx_pkt_vm_wr {
625 __be32 op_immdlen;
626 __be32 equiq_to_len16;
627 __be32 r3[2];
628 u8 ethmacdst[6];
629 u8 ethmacsrc[6];
630 __be16 ethtype;
631 __be16 vlantci;
632};
633
Santosh Rastapur2422d9a2013-03-14 05:08:48 +0000634#define FW_CMD_MAX_TIMEOUT 10000
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000635
Vipul Pandya636f9d32012-09-26 02:39:39 +0000636/*
637 * If a host driver does a HELLO and discovers that there's already a MASTER
638 * selected, we may have to wait for that MASTER to finish issuing RESET,
639 * configuration and INITIALIZE commands. Also, there's a possibility that
640 * our own HELLO may get lost if it happens right as the MASTER is issuign a
641 * RESET command, so we need to be willing to make a few retries of our HELLO.
642 */
643#define FW_CMD_HELLO_TIMEOUT (3 * FW_CMD_MAX_TIMEOUT)
644#define FW_CMD_HELLO_RETRIES 3
645
646
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000647enum fw_cmd_opcodes {
648 FW_LDST_CMD = 0x01,
649 FW_RESET_CMD = 0x03,
650 FW_HELLO_CMD = 0x04,
651 FW_BYE_CMD = 0x05,
652 FW_INITIALIZE_CMD = 0x06,
653 FW_CAPS_CONFIG_CMD = 0x07,
654 FW_PARAMS_CMD = 0x08,
655 FW_PFVF_CMD = 0x09,
656 FW_IQ_CMD = 0x10,
657 FW_EQ_MNGT_CMD = 0x11,
658 FW_EQ_ETH_CMD = 0x12,
659 FW_EQ_CTRL_CMD = 0x13,
660 FW_EQ_OFLD_CMD = 0x21,
661 FW_VI_CMD = 0x14,
662 FW_VI_MAC_CMD = 0x15,
663 FW_VI_RXMODE_CMD = 0x16,
664 FW_VI_ENABLE_CMD = 0x17,
665 FW_ACL_MAC_CMD = 0x18,
666 FW_ACL_VLAN_CMD = 0x19,
667 FW_VI_STATS_CMD = 0x1a,
668 FW_PORT_CMD = 0x1b,
669 FW_PORT_STATS_CMD = 0x1c,
670 FW_PORT_LB_STATS_CMD = 0x1d,
671 FW_PORT_TRACE_CMD = 0x1e,
672 FW_PORT_TRACE_MMAP_CMD = 0x1f,
673 FW_RSS_IND_TBL_CMD = 0x20,
674 FW_RSS_GLB_CONFIG_CMD = 0x22,
675 FW_RSS_VI_CONFIG_CMD = 0x23,
Hariprasad Shenai49aa2842015-01-07 08:48:00 +0530676 FW_DEVLOG_CMD = 0x25,
Vipul Pandya01bcca62013-07-04 16:10:46 +0530677 FW_CLIP_CMD = 0x28,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000678 FW_LASTC2E_CMD = 0x40,
679 FW_ERROR_CMD = 0x80,
680 FW_DEBUG_CMD = 0x81,
681};
682
683enum fw_cmd_cap {
684 FW_CMD_CAP_PF = 0x01,
685 FW_CMD_CAP_DMAQ = 0x02,
686 FW_CMD_CAP_PORT = 0x04,
687 FW_CMD_CAP_PORTPROMISC = 0x08,
688 FW_CMD_CAP_PORTSTATS = 0x10,
689 FW_CMD_CAP_VF = 0x80,
690};
691
692/*
693 * Generic command header flit0
694 */
695struct fw_cmd_hdr {
696 __be32 hi;
697 __be32 lo;
698};
699
Hariprasad Shenaie2ac9622014-11-07 09:35:25 +0530700#define FW_CMD_OP_S 24
701#define FW_CMD_OP_M 0xff
702#define FW_CMD_OP_V(x) ((x) << FW_CMD_OP_S)
703#define FW_CMD_OP_G(x) (((x) >> FW_CMD_OP_S) & FW_CMD_OP_M)
704
705#define FW_CMD_REQUEST_S 23
706#define FW_CMD_REQUEST_V(x) ((x) << FW_CMD_REQUEST_S)
707#define FW_CMD_REQUEST_F FW_CMD_REQUEST_V(1U)
708
709#define FW_CMD_READ_S 22
710#define FW_CMD_READ_V(x) ((x) << FW_CMD_READ_S)
711#define FW_CMD_READ_F FW_CMD_READ_V(1U)
712
713#define FW_CMD_WRITE_S 21
714#define FW_CMD_WRITE_V(x) ((x) << FW_CMD_WRITE_S)
715#define FW_CMD_WRITE_F FW_CMD_WRITE_V(1U)
716
717#define FW_CMD_EXEC_S 20
718#define FW_CMD_EXEC_V(x) ((x) << FW_CMD_EXEC_S)
719#define FW_CMD_EXEC_F FW_CMD_EXEC_V(1U)
720
721#define FW_CMD_RAMASK_S 20
722#define FW_CMD_RAMASK_V(x) ((x) << FW_CMD_RAMASK_S)
723
724#define FW_CMD_RETVAL_S 8
725#define FW_CMD_RETVAL_M 0xff
726#define FW_CMD_RETVAL_V(x) ((x) << FW_CMD_RETVAL_S)
727#define FW_CMD_RETVAL_G(x) (((x) >> FW_CMD_RETVAL_S) & FW_CMD_RETVAL_M)
728
729#define FW_CMD_LEN16_S 0
730#define FW_CMD_LEN16_V(x) ((x) << FW_CMD_LEN16_S)
731
732#define FW_LEN16(fw_struct) FW_CMD_LEN16_V(sizeof(fw_struct) / 16)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000733
734enum fw_ldst_addrspc {
735 FW_LDST_ADDRSPC_FIRMWARE = 0x0001,
736 FW_LDST_ADDRSPC_SGE_EGRC = 0x0008,
737 FW_LDST_ADDRSPC_SGE_INGC = 0x0009,
738 FW_LDST_ADDRSPC_SGE_FLMC = 0x000a,
739 FW_LDST_ADDRSPC_SGE_CONMC = 0x000b,
740 FW_LDST_ADDRSPC_TP_PIO = 0x0010,
741 FW_LDST_ADDRSPC_TP_TM_PIO = 0x0011,
742 FW_LDST_ADDRSPC_TP_MIB = 0x0012,
743 FW_LDST_ADDRSPC_MDIO = 0x0018,
744 FW_LDST_ADDRSPC_MPS = 0x0020,
Naresh Kumar Innace91a922012-11-15 22:41:17 +0530745 FW_LDST_ADDRSPC_FUNC = 0x0028,
746 FW_LDST_ADDRSPC_FUNC_PCIE = 0x0029,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000747};
748
749enum fw_ldst_mps_fid {
750 FW_LDST_MPS_ATRB,
751 FW_LDST_MPS_RPLC
752};
753
754enum fw_ldst_func_access_ctl {
755 FW_LDST_FUNC_ACC_CTL_VIID,
756 FW_LDST_FUNC_ACC_CTL_FID
757};
758
759enum fw_ldst_func_mod_index {
760 FW_LDST_FUNC_MPS
761};
762
763struct fw_ldst_cmd {
764 __be32 op_to_addrspace;
Hariprasad Shenai51678652014-11-21 12:52:02 +0530765#define FW_LDST_CMD_ADDRSPACE_S 0
766#define FW_LDST_CMD_ADDRSPACE_V(x) ((x) << FW_LDST_CMD_ADDRSPACE_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000767 __be32 cycles_to_len16;
768 union fw_ldst {
769 struct fw_ldst_addrval {
770 __be32 addr;
771 __be32 val;
772 } addrval;
773 struct fw_ldst_idctxt {
774 __be32 physid;
775 __be32 msg_pkd;
776 __be32 ctxt_data7;
777 __be32 ctxt_data6;
778 __be32 ctxt_data5;
779 __be32 ctxt_data4;
780 __be32 ctxt_data3;
781 __be32 ctxt_data2;
782 __be32 ctxt_data1;
783 __be32 ctxt_data0;
784 } idctxt;
785 struct fw_ldst_mdio {
786 __be16 paddr_mmd;
787 __be16 raddr;
788 __be16 vctl;
789 __be16 rval;
790 } mdio;
Hariprasad Shenai3ccc6cf2015-06-02 13:59:39 +0530791 union fw_ldst_mps {
792 struct fw_ldst_mps_rplc {
793 __be16 fid_idx;
794 __be16 rplcpf_pkd;
795 __be32 rplc255_224;
796 __be32 rplc223_192;
797 __be32 rplc191_160;
798 __be32 rplc159_128;
799 __be32 rplc127_96;
800 __be32 rplc95_64;
801 __be32 rplc63_32;
802 __be32 rplc31_0;
803 } rplc;
804 struct fw_ldst_mps_atrb {
805 __be16 fid_mpsid;
806 __be16 r2[3];
807 __be32 r3[2];
808 __be32 r4;
809 __be32 atrb;
810 __be16 vlan[16];
811 } atrb;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000812 } mps;
813 struct fw_ldst_func {
814 u8 access_ctl;
815 u8 mod_index;
816 __be16 ctl_id;
817 __be32 offset;
818 __be64 data0;
819 __be64 data1;
820 } func;
Naresh Kumar Innace91a922012-11-15 22:41:17 +0530821 struct fw_ldst_pcie {
822 u8 ctrl_to_fn;
823 u8 bnum;
824 u8 r;
825 u8 ext_r;
826 u8 select_naccess;
827 u8 pcie_fn;
828 __be16 nset_pkd;
829 __be32 data[12];
830 } pcie;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000831 } u;
832};
833
Hariprasad Shenai51678652014-11-21 12:52:02 +0530834#define FW_LDST_CMD_MSG_S 31
835#define FW_LDST_CMD_MSG_V(x) ((x) << FW_LDST_CMD_MSG_S)
836
837#define FW_LDST_CMD_PADDR_S 8
838#define FW_LDST_CMD_PADDR_V(x) ((x) << FW_LDST_CMD_PADDR_S)
839
840#define FW_LDST_CMD_MMD_S 0
841#define FW_LDST_CMD_MMD_V(x) ((x) << FW_LDST_CMD_MMD_S)
842
843#define FW_LDST_CMD_FID_S 15
844#define FW_LDST_CMD_FID_V(x) ((x) << FW_LDST_CMD_FID_S)
845
Hariprasad Shenai3ccc6cf2015-06-02 13:59:39 +0530846#define FW_LDST_CMD_IDX_S 0
847#define FW_LDST_CMD_IDX_V(x) ((x) << FW_LDST_CMD_IDX_S)
Hariprasad Shenai51678652014-11-21 12:52:02 +0530848
849#define FW_LDST_CMD_RPLCPF_S 0
850#define FW_LDST_CMD_RPLCPF_V(x) ((x) << FW_LDST_CMD_RPLCPF_S)
851
852#define FW_LDST_CMD_LC_S 4
853#define FW_LDST_CMD_LC_V(x) ((x) << FW_LDST_CMD_LC_S)
854#define FW_LDST_CMD_LC_F FW_LDST_CMD_LC_V(1U)
855
856#define FW_LDST_CMD_FN_S 0
857#define FW_LDST_CMD_FN_V(x) ((x) << FW_LDST_CMD_FN_S)
858
859#define FW_LDST_CMD_NACCESS_S 0
860#define FW_LDST_CMD_NACCESS_V(x) ((x) << FW_LDST_CMD_NACCESS_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000861
862struct fw_reset_cmd {
863 __be32 op_to_write;
864 __be32 retval_len16;
865 __be32 val;
Vipul Pandya26f7cbc2012-09-26 02:39:42 +0000866 __be32 halt_pkd;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000867};
868
Hariprasad Shenai51678652014-11-21 12:52:02 +0530869#define FW_RESET_CMD_HALT_S 31
870#define FW_RESET_CMD_HALT_M 0x1
871#define FW_RESET_CMD_HALT_V(x) ((x) << FW_RESET_CMD_HALT_S)
872#define FW_RESET_CMD_HALT_G(x) \
873 (((x) >> FW_RESET_CMD_HALT_S) & FW_RESET_CMD_HALT_M)
874#define FW_RESET_CMD_HALT_F FW_RESET_CMD_HALT_V(1U)
Vipul Pandya26f7cbc2012-09-26 02:39:42 +0000875
Vipul Pandya636f9d32012-09-26 02:39:39 +0000876enum fw_hellow_cmd {
877 fw_hello_cmd_stage_os = 0x0
878};
879
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000880struct fw_hello_cmd {
881 __be32 op_to_write;
882 __be32 retval_len16;
Naresh Kumar Innace91a922012-11-15 22:41:17 +0530883 __be32 err_to_clearinit;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000884 __be32 fwrev;
885};
886
Hariprasad Shenai51678652014-11-21 12:52:02 +0530887#define FW_HELLO_CMD_ERR_S 31
888#define FW_HELLO_CMD_ERR_V(x) ((x) << FW_HELLO_CMD_ERR_S)
889#define FW_HELLO_CMD_ERR_F FW_HELLO_CMD_ERR_V(1U)
890
891#define FW_HELLO_CMD_INIT_S 30
892#define FW_HELLO_CMD_INIT_V(x) ((x) << FW_HELLO_CMD_INIT_S)
893#define FW_HELLO_CMD_INIT_F FW_HELLO_CMD_INIT_V(1U)
894
895#define FW_HELLO_CMD_MASTERDIS_S 29
896#define FW_HELLO_CMD_MASTERDIS_V(x) ((x) << FW_HELLO_CMD_MASTERDIS_S)
897
898#define FW_HELLO_CMD_MASTERFORCE_S 28
899#define FW_HELLO_CMD_MASTERFORCE_V(x) ((x) << FW_HELLO_CMD_MASTERFORCE_S)
900
901#define FW_HELLO_CMD_MBMASTER_S 24
902#define FW_HELLO_CMD_MBMASTER_M 0xfU
903#define FW_HELLO_CMD_MBMASTER_V(x) ((x) << FW_HELLO_CMD_MBMASTER_S)
904#define FW_HELLO_CMD_MBMASTER_G(x) \
905 (((x) >> FW_HELLO_CMD_MBMASTER_S) & FW_HELLO_CMD_MBMASTER_M)
906
907#define FW_HELLO_CMD_MBASYNCNOTINT_S 23
908#define FW_HELLO_CMD_MBASYNCNOTINT_V(x) ((x) << FW_HELLO_CMD_MBASYNCNOTINT_S)
909
910#define FW_HELLO_CMD_MBASYNCNOT_S 20
911#define FW_HELLO_CMD_MBASYNCNOT_V(x) ((x) << FW_HELLO_CMD_MBASYNCNOT_S)
912
913#define FW_HELLO_CMD_STAGE_S 17
914#define FW_HELLO_CMD_STAGE_V(x) ((x) << FW_HELLO_CMD_STAGE_S)
915
916#define FW_HELLO_CMD_CLEARINIT_S 16
917#define FW_HELLO_CMD_CLEARINIT_V(x) ((x) << FW_HELLO_CMD_CLEARINIT_S)
918#define FW_HELLO_CMD_CLEARINIT_F FW_HELLO_CMD_CLEARINIT_V(1U)
919
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +0000920struct fw_bye_cmd {
921 __be32 op_to_write;
922 __be32 retval_len16;
923 __be64 r3;
924};
925
926struct fw_initialize_cmd {
927 __be32 op_to_write;
928 __be32 retval_len16;
929 __be64 r3;
930};
931
932enum fw_caps_config_hm {
933 FW_CAPS_CONFIG_HM_PCIE = 0x00000001,
934 FW_CAPS_CONFIG_HM_PL = 0x00000002,
935 FW_CAPS_CONFIG_HM_SGE = 0x00000004,
936 FW_CAPS_CONFIG_HM_CIM = 0x00000008,
937 FW_CAPS_CONFIG_HM_ULPTX = 0x00000010,
938 FW_CAPS_CONFIG_HM_TP = 0x00000020,
939 FW_CAPS_CONFIG_HM_ULPRX = 0x00000040,
940 FW_CAPS_CONFIG_HM_PMRX = 0x00000080,
941 FW_CAPS_CONFIG_HM_PMTX = 0x00000100,
942 FW_CAPS_CONFIG_HM_MC = 0x00000200,
943 FW_CAPS_CONFIG_HM_LE = 0x00000400,
944 FW_CAPS_CONFIG_HM_MPS = 0x00000800,
945 FW_CAPS_CONFIG_HM_XGMAC = 0x00001000,
946 FW_CAPS_CONFIG_HM_CPLSWITCH = 0x00002000,
947 FW_CAPS_CONFIG_HM_T4DBG = 0x00004000,
948 FW_CAPS_CONFIG_HM_MI = 0x00008000,
949 FW_CAPS_CONFIG_HM_I2CM = 0x00010000,
950 FW_CAPS_CONFIG_HM_NCSI = 0x00020000,
951 FW_CAPS_CONFIG_HM_SMB = 0x00040000,
952 FW_CAPS_CONFIG_HM_MA = 0x00080000,
953 FW_CAPS_CONFIG_HM_EDRAM = 0x00100000,
954 FW_CAPS_CONFIG_HM_PMU = 0x00200000,
955 FW_CAPS_CONFIG_HM_UART = 0x00400000,
956 FW_CAPS_CONFIG_HM_SF = 0x00800000,
957};
958
959enum fw_caps_config_nbm {
960 FW_CAPS_CONFIG_NBM_IPMI = 0x00000001,
961 FW_CAPS_CONFIG_NBM_NCSI = 0x00000002,
962};
963
964enum fw_caps_config_link {
965 FW_CAPS_CONFIG_LINK_PPP = 0x00000001,
966 FW_CAPS_CONFIG_LINK_QFC = 0x00000002,
967 FW_CAPS_CONFIG_LINK_DCBX = 0x00000004,
968};
969
970enum fw_caps_config_switch {
971 FW_CAPS_CONFIG_SWITCH_INGRESS = 0x00000001,
972 FW_CAPS_CONFIG_SWITCH_EGRESS = 0x00000002,
973};
974
975enum fw_caps_config_nic {
976 FW_CAPS_CONFIG_NIC = 0x00000001,
977 FW_CAPS_CONFIG_NIC_VM = 0x00000002,
978};
979
980enum fw_caps_config_ofld {
981 FW_CAPS_CONFIG_OFLD = 0x00000001,
982};
983
984enum fw_caps_config_rdma {
985 FW_CAPS_CONFIG_RDMA_RDDP = 0x00000001,
986 FW_CAPS_CONFIG_RDMA_RDMAC = 0x00000002,
987};
988
989enum fw_caps_config_iscsi {
990 FW_CAPS_CONFIG_ISCSI_INITIATOR_PDU = 0x00000001,
991 FW_CAPS_CONFIG_ISCSI_TARGET_PDU = 0x00000002,
992 FW_CAPS_CONFIG_ISCSI_INITIATOR_CNXOFLD = 0x00000004,
993 FW_CAPS_CONFIG_ISCSI_TARGET_CNXOFLD = 0x00000008,
994};
995
996enum fw_caps_config_fcoe {
997 FW_CAPS_CONFIG_FCOE_INITIATOR = 0x00000001,
998 FW_CAPS_CONFIG_FCOE_TARGET = 0x00000002,
Naresh Kumar Innace91a922012-11-15 22:41:17 +0530999 FW_CAPS_CONFIG_FCOE_CTRL_OFLD = 0x00000004,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001000};
1001
Vipul Pandya52367a72012-09-26 02:39:38 +00001002enum fw_memtype_cf {
1003 FW_MEMTYPE_CF_EDC0 = 0x0,
1004 FW_MEMTYPE_CF_EDC1 = 0x1,
1005 FW_MEMTYPE_CF_EXTMEM = 0x2,
1006 FW_MEMTYPE_CF_FLASH = 0x4,
1007 FW_MEMTYPE_CF_INTERNAL = 0x5,
Hariprasad Shenai7ef65a42015-04-01 21:41:15 +05301008 FW_MEMTYPE_CF_EXTMEM1 = 0x6,
Vipul Pandya52367a72012-09-26 02:39:38 +00001009};
1010
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001011struct fw_caps_config_cmd {
1012 __be32 op_to_write;
Naresh Kumar Innace91a922012-11-15 22:41:17 +05301013 __be32 cfvalid_to_len16;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001014 __be32 r2;
1015 __be32 hwmbitmap;
1016 __be16 nbmcaps;
1017 __be16 linkcaps;
1018 __be16 switchcaps;
1019 __be16 r3;
1020 __be16 niccaps;
1021 __be16 ofldcaps;
1022 __be16 rdmacaps;
1023 __be16 r4;
1024 __be16 iscsicaps;
1025 __be16 fcoecaps;
Vipul Pandya52367a72012-09-26 02:39:38 +00001026 __be32 cfcsum;
1027 __be32 finiver;
1028 __be32 finicsum;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001029};
1030
Hariprasad Shenai51678652014-11-21 12:52:02 +05301031#define FW_CAPS_CONFIG_CMD_CFVALID_S 27
1032#define FW_CAPS_CONFIG_CMD_CFVALID_V(x) ((x) << FW_CAPS_CONFIG_CMD_CFVALID_S)
1033#define FW_CAPS_CONFIG_CMD_CFVALID_F FW_CAPS_CONFIG_CMD_CFVALID_V(1U)
1034
1035#define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S 24
1036#define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_V(x) \
1037 ((x) << FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S)
1038
1039#define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S 16
1040#define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_V(x) \
1041 ((x) << FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S)
Vipul Pandya52367a72012-09-26 02:39:38 +00001042
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001043/*
1044 * params command mnemonics
1045 */
1046enum fw_params_mnem {
1047 FW_PARAMS_MNEM_DEV = 1, /* device params */
1048 FW_PARAMS_MNEM_PFVF = 2, /* function params */
1049 FW_PARAMS_MNEM_REG = 3, /* limited register access */
1050 FW_PARAMS_MNEM_DMAQ = 4, /* dma queue params */
Hariprasad Shenai7ef65a42015-04-01 21:41:15 +05301051 FW_PARAMS_MNEM_CHNET = 5, /* chnet params */
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001052 FW_PARAMS_MNEM_LAST
1053};
1054
1055/*
1056 * device parameters
1057 */
1058enum fw_params_param_dev {
1059 FW_PARAMS_PARAM_DEV_CCLK = 0x00, /* chip core clock in khz */
1060 FW_PARAMS_PARAM_DEV_PORTVEC = 0x01, /* the port vector */
1061 FW_PARAMS_PARAM_DEV_NTID = 0x02, /* reads the number of TIDs
1062 * allocated by the device's
1063 * Lookup Engine
1064 */
1065 FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ = 0x03,
1066 FW_PARAMS_PARAM_DEV_INTVER_NIC = 0x04,
1067 FW_PARAMS_PARAM_DEV_INTVER_VNIC = 0x05,
1068 FW_PARAMS_PARAM_DEV_INTVER_OFLD = 0x06,
1069 FW_PARAMS_PARAM_DEV_INTVER_RI = 0x07,
1070 FW_PARAMS_PARAM_DEV_INTVER_ISCSIPDU = 0x08,
1071 FW_PARAMS_PARAM_DEV_INTVER_ISCSI = 0x09,
Casey Leedom81323b72010-06-25 12:10:32 +00001072 FW_PARAMS_PARAM_DEV_INTVER_FCOE = 0x0A,
1073 FW_PARAMS_PARAM_DEV_FWREV = 0x0B,
1074 FW_PARAMS_PARAM_DEV_TPREV = 0x0C,
Vipul Pandya52367a72012-09-26 02:39:38 +00001075 FW_PARAMS_PARAM_DEV_CF = 0x0D,
Hariprasad Shenai01b69612015-05-22 21:58:21 +05301076 FW_PARAMS_PARAM_DEV_PHYFW = 0x0F,
Hariprasad Shenai70a5f3b2015-02-06 19:32:51 +05301077 FW_PARAMS_PARAM_DEV_DIAG = 0x11,
Hariprasad Shenai4c2c5762014-07-14 21:34:52 +05301078 FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD */
1079 FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER = 0x14, /* max supported adap IRD */
Kumar Sanghvi1ac0f092014-02-18 17:56:12 +05301080 FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
Hariprasad Shenai49216c12015-01-20 12:02:20 +05301081 FW_PARAMS_PARAM_DEV_FWCACHE = 0x18,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001082};
1083
1084/*
1085 * physical and virtual function parameters
1086 */
1087enum fw_params_param_pfvf {
1088 FW_PARAMS_PARAM_PFVF_RWXCAPS = 0x00,
1089 FW_PARAMS_PARAM_PFVF_ROUTE_START = 0x01,
1090 FW_PARAMS_PARAM_PFVF_ROUTE_END = 0x02,
1091 FW_PARAMS_PARAM_PFVF_CLIP_START = 0x03,
1092 FW_PARAMS_PARAM_PFVF_CLIP_END = 0x04,
1093 FW_PARAMS_PARAM_PFVF_FILTER_START = 0x05,
1094 FW_PARAMS_PARAM_PFVF_FILTER_END = 0x06,
1095 FW_PARAMS_PARAM_PFVF_SERVER_START = 0x07,
1096 FW_PARAMS_PARAM_PFVF_SERVER_END = 0x08,
1097 FW_PARAMS_PARAM_PFVF_TDDP_START = 0x09,
1098 FW_PARAMS_PARAM_PFVF_TDDP_END = 0x0A,
1099 FW_PARAMS_PARAM_PFVF_ISCSI_START = 0x0B,
1100 FW_PARAMS_PARAM_PFVF_ISCSI_END = 0x0C,
1101 FW_PARAMS_PARAM_PFVF_STAG_START = 0x0D,
1102 FW_PARAMS_PARAM_PFVF_STAG_END = 0x0E,
1103 FW_PARAMS_PARAM_PFVF_RQ_START = 0x1F,
1104 FW_PARAMS_PARAM_PFVF_RQ_END = 0x10,
1105 FW_PARAMS_PARAM_PFVF_PBL_START = 0x11,
1106 FW_PARAMS_PARAM_PFVF_PBL_END = 0x12,
1107 FW_PARAMS_PARAM_PFVF_L2T_START = 0x13,
1108 FW_PARAMS_PARAM_PFVF_L2T_END = 0x14,
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00001109 FW_PARAMS_PARAM_PFVF_SQRQ_START = 0x15,
1110 FW_PARAMS_PARAM_PFVF_SQRQ_END = 0x16,
1111 FW_PARAMS_PARAM_PFVF_CQ_START = 0x17,
1112 FW_PARAMS_PARAM_PFVF_CQ_END = 0x18,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001113 FW_PARAMS_PARAM_PFVF_SCHEDCLASS_ETH = 0x20,
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00001114 FW_PARAMS_PARAM_PFVF_VIID = 0x24,
1115 FW_PARAMS_PARAM_PFVF_CPMASK = 0x25,
Dimitris Michailidis1ae970e2010-08-02 13:19:19 +00001116 FW_PARAMS_PARAM_PFVF_OCQ_START = 0x26,
1117 FW_PARAMS_PARAM_PFVF_OCQ_END = 0x27,
Dimitris Michailidise46dab42010-08-23 17:20:58 +00001118 FW_PARAMS_PARAM_PFVF_CONM_MAP = 0x28,
1119 FW_PARAMS_PARAM_PFVF_IQFLINT_START = 0x29,
1120 FW_PARAMS_PARAM_PFVF_IQFLINT_END = 0x2A,
1121 FW_PARAMS_PARAM_PFVF_EQ_START = 0x2B,
1122 FW_PARAMS_PARAM_PFVF_EQ_END = 0x2C,
Vipul Pandya52367a72012-09-26 02:39:38 +00001123 FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_START = 0x2D,
Vipul Pandyab407a4a2013-04-29 04:04:40 +00001124 FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_END = 0x2E,
1125 FW_PARAMS_PARAM_PFVF_ETHOFLD_END = 0x30,
1126 FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001127};
1128
1129/*
1130 * dma queue parameters
1131 */
1132enum fw_params_param_dmaq {
1133 FW_PARAMS_PARAM_DMAQ_IQ_DCAEN_DCACPU = 0x00,
1134 FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01,
1135 FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_MNGT = 0x10,
1136 FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_CTRL = 0x11,
1137 FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH = 0x12,
Anish Bhatt989594e2014-06-19 21:37:11 -07001138 FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH = 0x13,
Hariprasad Shenaib8b1ae92015-05-05 14:59:53 +05301139 FW_PARAMS_PARAM_DMAQ_CONM_CTXT = 0x20,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001140};
1141
Hariprasad Shenai01b69612015-05-22 21:58:21 +05301142enum fw_params_param_dev_phyfw {
1143 FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD = 0x00,
1144 FW_PARAMS_PARAM_DEV_PHYFW_VERSION = 0x01,
1145};
1146
Hariprasad Shenai70a5f3b2015-02-06 19:32:51 +05301147enum fw_params_param_dev_diag {
1148 FW_PARAM_DEV_DIAG_TMP = 0x00,
1149 FW_PARAM_DEV_DIAG_VDD = 0x01,
1150};
1151
Hariprasad Shenai49216c12015-01-20 12:02:20 +05301152enum fw_params_param_dev_fwcache {
1153 FW_PARAM_DEV_FWCACHE_FLUSH = 0x00,
1154 FW_PARAM_DEV_FWCACHE_FLUSHINV = 0x01,
1155};
1156
Hariprasad Shenai51678652014-11-21 12:52:02 +05301157#define FW_PARAMS_MNEM_S 24
1158#define FW_PARAMS_MNEM_V(x) ((x) << FW_PARAMS_MNEM_S)
1159
1160#define FW_PARAMS_PARAM_X_S 16
1161#define FW_PARAMS_PARAM_X_V(x) ((x) << FW_PARAMS_PARAM_X_S)
1162
1163#define FW_PARAMS_PARAM_Y_S 8
1164#define FW_PARAMS_PARAM_Y_M 0xffU
1165#define FW_PARAMS_PARAM_Y_V(x) ((x) << FW_PARAMS_PARAM_Y_S)
1166#define FW_PARAMS_PARAM_Y_G(x) (((x) >> FW_PARAMS_PARAM_Y_S) &\
1167 FW_PARAMS_PARAM_Y_M)
1168
1169#define FW_PARAMS_PARAM_Z_S 0
1170#define FW_PARAMS_PARAM_Z_M 0xffu
1171#define FW_PARAMS_PARAM_Z_V(x) ((x) << FW_PARAMS_PARAM_Z_S)
1172#define FW_PARAMS_PARAM_Z_G(x) (((x) >> FW_PARAMS_PARAM_Z_S) &\
1173 FW_PARAMS_PARAM_Z_M)
1174
1175#define FW_PARAMS_PARAM_XYZ_S 0
1176#define FW_PARAMS_PARAM_XYZ_V(x) ((x) << FW_PARAMS_PARAM_XYZ_S)
1177
1178#define FW_PARAMS_PARAM_YZ_S 0
1179#define FW_PARAMS_PARAM_YZ_V(x) ((x) << FW_PARAMS_PARAM_YZ_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001180
1181struct fw_params_cmd {
1182 __be32 op_to_vfn;
1183 __be32 retval_len16;
1184 struct fw_params_param {
1185 __be32 mnem;
1186 __be32 val;
1187 } param[7];
1188};
1189
Hariprasad Shenai51678652014-11-21 12:52:02 +05301190#define FW_PARAMS_CMD_PFN_S 8
1191#define FW_PARAMS_CMD_PFN_V(x) ((x) << FW_PARAMS_CMD_PFN_S)
1192
1193#define FW_PARAMS_CMD_VFN_S 0
1194#define FW_PARAMS_CMD_VFN_V(x) ((x) << FW_PARAMS_CMD_VFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001195
1196struct fw_pfvf_cmd {
1197 __be32 op_to_vfn;
1198 __be32 retval_len16;
1199 __be32 niqflint_niq;
Casey Leedom81323b72010-06-25 12:10:32 +00001200 __be32 type_to_neq;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001201 __be32 tc_to_nexactf;
1202 __be32 r_caps_to_nethctrl;
1203 __be16 nricq;
1204 __be16 nriqp;
1205 __be32 r4;
1206};
1207
Hariprasad Shenai51678652014-11-21 12:52:02 +05301208#define FW_PFVF_CMD_PFN_S 8
1209#define FW_PFVF_CMD_PFN_V(x) ((x) << FW_PFVF_CMD_PFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001210
Hariprasad Shenai51678652014-11-21 12:52:02 +05301211#define FW_PFVF_CMD_VFN_S 0
1212#define FW_PFVF_CMD_VFN_V(x) ((x) << FW_PFVF_CMD_VFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001213
Hariprasad Shenai51678652014-11-21 12:52:02 +05301214#define FW_PFVF_CMD_NIQFLINT_S 20
1215#define FW_PFVF_CMD_NIQFLINT_M 0xfff
1216#define FW_PFVF_CMD_NIQFLINT_V(x) ((x) << FW_PFVF_CMD_NIQFLINT_S)
1217#define FW_PFVF_CMD_NIQFLINT_G(x) \
1218 (((x) >> FW_PFVF_CMD_NIQFLINT_S) & FW_PFVF_CMD_NIQFLINT_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001219
Hariprasad Shenai51678652014-11-21 12:52:02 +05301220#define FW_PFVF_CMD_NIQ_S 0
1221#define FW_PFVF_CMD_NIQ_M 0xfffff
1222#define FW_PFVF_CMD_NIQ_V(x) ((x) << FW_PFVF_CMD_NIQ_S)
1223#define FW_PFVF_CMD_NIQ_G(x) \
1224 (((x) >> FW_PFVF_CMD_NIQ_S) & FW_PFVF_CMD_NIQ_M)
Casey Leedom81323b72010-06-25 12:10:32 +00001225
Hariprasad Shenai51678652014-11-21 12:52:02 +05301226#define FW_PFVF_CMD_TYPE_S 31
1227#define FW_PFVF_CMD_TYPE_M 0x1
1228#define FW_PFVF_CMD_TYPE_V(x) ((x) << FW_PFVF_CMD_TYPE_S)
1229#define FW_PFVF_CMD_TYPE_G(x) \
1230 (((x) >> FW_PFVF_CMD_TYPE_S) & FW_PFVF_CMD_TYPE_M)
1231#define FW_PFVF_CMD_TYPE_F FW_PFVF_CMD_TYPE_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001232
Hariprasad Shenai51678652014-11-21 12:52:02 +05301233#define FW_PFVF_CMD_CMASK_S 24
1234#define FW_PFVF_CMD_CMASK_M 0xf
1235#define FW_PFVF_CMD_CMASK_V(x) ((x) << FW_PFVF_CMD_CMASK_S)
1236#define FW_PFVF_CMD_CMASK_G(x) \
1237 (((x) >> FW_PFVF_CMD_CMASK_S) & FW_PFVF_CMD_CMASK_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001238
Hariprasad Shenai51678652014-11-21 12:52:02 +05301239#define FW_PFVF_CMD_PMASK_S 20
1240#define FW_PFVF_CMD_PMASK_M 0xf
1241#define FW_PFVF_CMD_PMASK_V(x) ((x) << FW_PFVF_CMD_PMASK_S)
1242#define FW_PFVF_CMD_PMASK_G(x) \
1243 (((x) >> FW_PFVF_CMD_PMASK_S) & FW_PFVF_CMD_PMASK_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001244
Hariprasad Shenai51678652014-11-21 12:52:02 +05301245#define FW_PFVF_CMD_NEQ_S 0
1246#define FW_PFVF_CMD_NEQ_M 0xfffff
1247#define FW_PFVF_CMD_NEQ_V(x) ((x) << FW_PFVF_CMD_NEQ_S)
1248#define FW_PFVF_CMD_NEQ_G(x) \
1249 (((x) >> FW_PFVF_CMD_NEQ_S) & FW_PFVF_CMD_NEQ_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001250
Hariprasad Shenai51678652014-11-21 12:52:02 +05301251#define FW_PFVF_CMD_TC_S 24
1252#define FW_PFVF_CMD_TC_M 0xff
1253#define FW_PFVF_CMD_TC_V(x) ((x) << FW_PFVF_CMD_TC_S)
1254#define FW_PFVF_CMD_TC_G(x) (((x) >> FW_PFVF_CMD_TC_S) & FW_PFVF_CMD_TC_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001255
Hariprasad Shenai51678652014-11-21 12:52:02 +05301256#define FW_PFVF_CMD_NVI_S 16
1257#define FW_PFVF_CMD_NVI_M 0xff
1258#define FW_PFVF_CMD_NVI_V(x) ((x) << FW_PFVF_CMD_NVI_S)
1259#define FW_PFVF_CMD_NVI_G(x) (((x) >> FW_PFVF_CMD_NVI_S) & FW_PFVF_CMD_NVI_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001260
Hariprasad Shenai51678652014-11-21 12:52:02 +05301261#define FW_PFVF_CMD_NEXACTF_S 0
1262#define FW_PFVF_CMD_NEXACTF_M 0xffff
1263#define FW_PFVF_CMD_NEXACTF_V(x) ((x) << FW_PFVF_CMD_NEXACTF_S)
1264#define FW_PFVF_CMD_NEXACTF_G(x) \
1265 (((x) >> FW_PFVF_CMD_NEXACTF_S) & FW_PFVF_CMD_NEXACTF_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001266
Hariprasad Shenai51678652014-11-21 12:52:02 +05301267#define FW_PFVF_CMD_R_CAPS_S 24
1268#define FW_PFVF_CMD_R_CAPS_M 0xff
1269#define FW_PFVF_CMD_R_CAPS_V(x) ((x) << FW_PFVF_CMD_R_CAPS_S)
1270#define FW_PFVF_CMD_R_CAPS_G(x) \
1271 (((x) >> FW_PFVF_CMD_R_CAPS_S) & FW_PFVF_CMD_R_CAPS_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001272
Hariprasad Shenai51678652014-11-21 12:52:02 +05301273#define FW_PFVF_CMD_WX_CAPS_S 16
1274#define FW_PFVF_CMD_WX_CAPS_M 0xff
1275#define FW_PFVF_CMD_WX_CAPS_V(x) ((x) << FW_PFVF_CMD_WX_CAPS_S)
1276#define FW_PFVF_CMD_WX_CAPS_G(x) \
1277 (((x) >> FW_PFVF_CMD_WX_CAPS_S) & FW_PFVF_CMD_WX_CAPS_M)
1278
1279#define FW_PFVF_CMD_NETHCTRL_S 0
1280#define FW_PFVF_CMD_NETHCTRL_M 0xffff
1281#define FW_PFVF_CMD_NETHCTRL_V(x) ((x) << FW_PFVF_CMD_NETHCTRL_S)
1282#define FW_PFVF_CMD_NETHCTRL_G(x) \
1283 (((x) >> FW_PFVF_CMD_NETHCTRL_S) & FW_PFVF_CMD_NETHCTRL_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001284
1285enum fw_iq_type {
1286 FW_IQ_TYPE_FL_INT_CAP,
1287 FW_IQ_TYPE_NO_FL_INT_CAP
1288};
1289
1290struct fw_iq_cmd {
1291 __be32 op_to_vfn;
1292 __be32 alloc_to_len16;
1293 __be16 physiqid;
1294 __be16 iqid;
1295 __be16 fl0id;
1296 __be16 fl1id;
1297 __be32 type_to_iqandstindex;
1298 __be16 iqdroprss_to_iqesize;
1299 __be16 iqsize;
1300 __be64 iqaddr;
1301 __be32 iqns_to_fl0congen;
1302 __be16 fl0dcaen_to_fl0cidxfthresh;
1303 __be16 fl0size;
1304 __be64 fl0addr;
1305 __be32 fl1cngchmap_to_fl1congen;
1306 __be16 fl1dcaen_to_fl1cidxfthresh;
1307 __be16 fl1size;
1308 __be64 fl1addr;
1309};
1310
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301311#define FW_IQ_CMD_PFN_S 8
1312#define FW_IQ_CMD_PFN_V(x) ((x) << FW_IQ_CMD_PFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001313
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301314#define FW_IQ_CMD_VFN_S 0
1315#define FW_IQ_CMD_VFN_V(x) ((x) << FW_IQ_CMD_VFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001316
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301317#define FW_IQ_CMD_ALLOC_S 31
1318#define FW_IQ_CMD_ALLOC_V(x) ((x) << FW_IQ_CMD_ALLOC_S)
1319#define FW_IQ_CMD_ALLOC_F FW_IQ_CMD_ALLOC_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001320
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301321#define FW_IQ_CMD_FREE_S 30
1322#define FW_IQ_CMD_FREE_V(x) ((x) << FW_IQ_CMD_FREE_S)
1323#define FW_IQ_CMD_FREE_F FW_IQ_CMD_FREE_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001324
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301325#define FW_IQ_CMD_MODIFY_S 29
1326#define FW_IQ_CMD_MODIFY_V(x) ((x) << FW_IQ_CMD_MODIFY_S)
1327#define FW_IQ_CMD_MODIFY_F FW_IQ_CMD_MODIFY_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001328
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301329#define FW_IQ_CMD_IQSTART_S 28
1330#define FW_IQ_CMD_IQSTART_V(x) ((x) << FW_IQ_CMD_IQSTART_S)
1331#define FW_IQ_CMD_IQSTART_F FW_IQ_CMD_IQSTART_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001332
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301333#define FW_IQ_CMD_IQSTOP_S 27
1334#define FW_IQ_CMD_IQSTOP_V(x) ((x) << FW_IQ_CMD_IQSTOP_S)
1335#define FW_IQ_CMD_IQSTOP_F FW_IQ_CMD_IQSTOP_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001336
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301337#define FW_IQ_CMD_TYPE_S 29
1338#define FW_IQ_CMD_TYPE_V(x) ((x) << FW_IQ_CMD_TYPE_S)
1339
1340#define FW_IQ_CMD_IQASYNCH_S 28
1341#define FW_IQ_CMD_IQASYNCH_V(x) ((x) << FW_IQ_CMD_IQASYNCH_S)
1342
1343#define FW_IQ_CMD_VIID_S 16
1344#define FW_IQ_CMD_VIID_V(x) ((x) << FW_IQ_CMD_VIID_S)
1345
1346#define FW_IQ_CMD_IQANDST_S 15
1347#define FW_IQ_CMD_IQANDST_V(x) ((x) << FW_IQ_CMD_IQANDST_S)
1348
1349#define FW_IQ_CMD_IQANUS_S 14
1350#define FW_IQ_CMD_IQANUS_V(x) ((x) << FW_IQ_CMD_IQANUS_S)
1351
1352#define FW_IQ_CMD_IQANUD_S 12
1353#define FW_IQ_CMD_IQANUD_V(x) ((x) << FW_IQ_CMD_IQANUD_S)
1354
1355#define FW_IQ_CMD_IQANDSTINDEX_S 0
1356#define FW_IQ_CMD_IQANDSTINDEX_V(x) ((x) << FW_IQ_CMD_IQANDSTINDEX_S)
1357
1358#define FW_IQ_CMD_IQDROPRSS_S 15
1359#define FW_IQ_CMD_IQDROPRSS_V(x) ((x) << FW_IQ_CMD_IQDROPRSS_S)
1360#define FW_IQ_CMD_IQDROPRSS_F FW_IQ_CMD_IQDROPRSS_V(1U)
1361
1362#define FW_IQ_CMD_IQGTSMODE_S 14
1363#define FW_IQ_CMD_IQGTSMODE_V(x) ((x) << FW_IQ_CMD_IQGTSMODE_S)
1364#define FW_IQ_CMD_IQGTSMODE_F FW_IQ_CMD_IQGTSMODE_V(1U)
1365
1366#define FW_IQ_CMD_IQPCIECH_S 12
1367#define FW_IQ_CMD_IQPCIECH_V(x) ((x) << FW_IQ_CMD_IQPCIECH_S)
1368
1369#define FW_IQ_CMD_IQDCAEN_S 11
1370#define FW_IQ_CMD_IQDCAEN_V(x) ((x) << FW_IQ_CMD_IQDCAEN_S)
1371
1372#define FW_IQ_CMD_IQDCACPU_S 6
1373#define FW_IQ_CMD_IQDCACPU_V(x) ((x) << FW_IQ_CMD_IQDCACPU_S)
1374
1375#define FW_IQ_CMD_IQINTCNTTHRESH_S 4
1376#define FW_IQ_CMD_IQINTCNTTHRESH_V(x) ((x) << FW_IQ_CMD_IQINTCNTTHRESH_S)
1377
1378#define FW_IQ_CMD_IQO_S 3
1379#define FW_IQ_CMD_IQO_V(x) ((x) << FW_IQ_CMD_IQO_S)
1380#define FW_IQ_CMD_IQO_F FW_IQ_CMD_IQO_V(1U)
1381
1382#define FW_IQ_CMD_IQCPRIO_S 2
1383#define FW_IQ_CMD_IQCPRIO_V(x) ((x) << FW_IQ_CMD_IQCPRIO_S)
1384
1385#define FW_IQ_CMD_IQESIZE_S 0
1386#define FW_IQ_CMD_IQESIZE_V(x) ((x) << FW_IQ_CMD_IQESIZE_S)
1387
1388#define FW_IQ_CMD_IQNS_S 31
1389#define FW_IQ_CMD_IQNS_V(x) ((x) << FW_IQ_CMD_IQNS_S)
1390
1391#define FW_IQ_CMD_IQRO_S 30
1392#define FW_IQ_CMD_IQRO_V(x) ((x) << FW_IQ_CMD_IQRO_S)
1393
1394#define FW_IQ_CMD_IQFLINTIQHSEN_S 28
1395#define FW_IQ_CMD_IQFLINTIQHSEN_V(x) ((x) << FW_IQ_CMD_IQFLINTIQHSEN_S)
1396
1397#define FW_IQ_CMD_IQFLINTCONGEN_S 27
1398#define FW_IQ_CMD_IQFLINTCONGEN_V(x) ((x) << FW_IQ_CMD_IQFLINTCONGEN_S)
Hariprasad Shenai145ef8a2015-05-05 14:59:52 +05301399#define FW_IQ_CMD_IQFLINTCONGEN_F FW_IQ_CMD_IQFLINTCONGEN_V(1U)
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301400
1401#define FW_IQ_CMD_IQFLINTISCSIC_S 26
1402#define FW_IQ_CMD_IQFLINTISCSIC_V(x) ((x) << FW_IQ_CMD_IQFLINTISCSIC_S)
1403
1404#define FW_IQ_CMD_FL0CNGCHMAP_S 20
1405#define FW_IQ_CMD_FL0CNGCHMAP_V(x) ((x) << FW_IQ_CMD_FL0CNGCHMAP_S)
1406
1407#define FW_IQ_CMD_FL0CACHELOCK_S 15
1408#define FW_IQ_CMD_FL0CACHELOCK_V(x) ((x) << FW_IQ_CMD_FL0CACHELOCK_S)
1409
1410#define FW_IQ_CMD_FL0DBP_S 14
1411#define FW_IQ_CMD_FL0DBP_V(x) ((x) << FW_IQ_CMD_FL0DBP_S)
1412
1413#define FW_IQ_CMD_FL0DATANS_S 13
1414#define FW_IQ_CMD_FL0DATANS_V(x) ((x) << FW_IQ_CMD_FL0DATANS_S)
1415
1416#define FW_IQ_CMD_FL0DATARO_S 12
1417#define FW_IQ_CMD_FL0DATARO_V(x) ((x) << FW_IQ_CMD_FL0DATARO_S)
1418#define FW_IQ_CMD_FL0DATARO_F FW_IQ_CMD_FL0DATARO_V(1U)
1419
1420#define FW_IQ_CMD_FL0CONGCIF_S 11
1421#define FW_IQ_CMD_FL0CONGCIF_V(x) ((x) << FW_IQ_CMD_FL0CONGCIF_S)
Hariprasad Shenai145ef8a2015-05-05 14:59:52 +05301422#define FW_IQ_CMD_FL0CONGCIF_F FW_IQ_CMD_FL0CONGCIF_V(1U)
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301423
1424#define FW_IQ_CMD_FL0ONCHIP_S 10
1425#define FW_IQ_CMD_FL0ONCHIP_V(x) ((x) << FW_IQ_CMD_FL0ONCHIP_S)
1426
1427#define FW_IQ_CMD_FL0STATUSPGNS_S 9
1428#define FW_IQ_CMD_FL0STATUSPGNS_V(x) ((x) << FW_IQ_CMD_FL0STATUSPGNS_S)
1429
1430#define FW_IQ_CMD_FL0STATUSPGRO_S 8
1431#define FW_IQ_CMD_FL0STATUSPGRO_V(x) ((x) << FW_IQ_CMD_FL0STATUSPGRO_S)
1432
1433#define FW_IQ_CMD_FL0FETCHNS_S 7
1434#define FW_IQ_CMD_FL0FETCHNS_V(x) ((x) << FW_IQ_CMD_FL0FETCHNS_S)
1435
1436#define FW_IQ_CMD_FL0FETCHRO_S 6
1437#define FW_IQ_CMD_FL0FETCHRO_V(x) ((x) << FW_IQ_CMD_FL0FETCHRO_S)
1438#define FW_IQ_CMD_FL0FETCHRO_F FW_IQ_CMD_FL0FETCHRO_V(1U)
1439
1440#define FW_IQ_CMD_FL0HOSTFCMODE_S 4
1441#define FW_IQ_CMD_FL0HOSTFCMODE_V(x) ((x) << FW_IQ_CMD_FL0HOSTFCMODE_S)
1442
1443#define FW_IQ_CMD_FL0CPRIO_S 3
1444#define FW_IQ_CMD_FL0CPRIO_V(x) ((x) << FW_IQ_CMD_FL0CPRIO_S)
1445
1446#define FW_IQ_CMD_FL0PADEN_S 2
1447#define FW_IQ_CMD_FL0PADEN_V(x) ((x) << FW_IQ_CMD_FL0PADEN_S)
1448#define FW_IQ_CMD_FL0PADEN_F FW_IQ_CMD_FL0PADEN_V(1U)
1449
1450#define FW_IQ_CMD_FL0PACKEN_S 1
1451#define FW_IQ_CMD_FL0PACKEN_V(x) ((x) << FW_IQ_CMD_FL0PACKEN_S)
1452#define FW_IQ_CMD_FL0PACKEN_F FW_IQ_CMD_FL0PACKEN_V(1U)
1453
1454#define FW_IQ_CMD_FL0CONGEN_S 0
1455#define FW_IQ_CMD_FL0CONGEN_V(x) ((x) << FW_IQ_CMD_FL0CONGEN_S)
1456#define FW_IQ_CMD_FL0CONGEN_F FW_IQ_CMD_FL0CONGEN_V(1U)
1457
1458#define FW_IQ_CMD_FL0DCAEN_S 15
1459#define FW_IQ_CMD_FL0DCAEN_V(x) ((x) << FW_IQ_CMD_FL0DCAEN_S)
1460
1461#define FW_IQ_CMD_FL0DCACPU_S 10
1462#define FW_IQ_CMD_FL0DCACPU_V(x) ((x) << FW_IQ_CMD_FL0DCACPU_S)
1463
1464#define FW_IQ_CMD_FL0FBMIN_S 7
1465#define FW_IQ_CMD_FL0FBMIN_V(x) ((x) << FW_IQ_CMD_FL0FBMIN_S)
1466
1467#define FW_IQ_CMD_FL0FBMAX_S 4
1468#define FW_IQ_CMD_FL0FBMAX_V(x) ((x) << FW_IQ_CMD_FL0FBMAX_S)
1469
1470#define FW_IQ_CMD_FL0CIDXFTHRESHO_S 3
1471#define FW_IQ_CMD_FL0CIDXFTHRESHO_V(x) ((x) << FW_IQ_CMD_FL0CIDXFTHRESHO_S)
1472#define FW_IQ_CMD_FL0CIDXFTHRESHO_F FW_IQ_CMD_FL0CIDXFTHRESHO_V(1U)
1473
1474#define FW_IQ_CMD_FL0CIDXFTHRESH_S 0
1475#define FW_IQ_CMD_FL0CIDXFTHRESH_V(x) ((x) << FW_IQ_CMD_FL0CIDXFTHRESH_S)
1476
1477#define FW_IQ_CMD_FL1CNGCHMAP_S 20
1478#define FW_IQ_CMD_FL1CNGCHMAP_V(x) ((x) << FW_IQ_CMD_FL1CNGCHMAP_S)
1479
1480#define FW_IQ_CMD_FL1CACHELOCK_S 15
1481#define FW_IQ_CMD_FL1CACHELOCK_V(x) ((x) << FW_IQ_CMD_FL1CACHELOCK_S)
1482
1483#define FW_IQ_CMD_FL1DBP_S 14
1484#define FW_IQ_CMD_FL1DBP_V(x) ((x) << FW_IQ_CMD_FL1DBP_S)
1485
1486#define FW_IQ_CMD_FL1DATANS_S 13
1487#define FW_IQ_CMD_FL1DATANS_V(x) ((x) << FW_IQ_CMD_FL1DATANS_S)
1488
1489#define FW_IQ_CMD_FL1DATARO_S 12
1490#define FW_IQ_CMD_FL1DATARO_V(x) ((x) << FW_IQ_CMD_FL1DATARO_S)
1491
1492#define FW_IQ_CMD_FL1CONGCIF_S 11
1493#define FW_IQ_CMD_FL1CONGCIF_V(x) ((x) << FW_IQ_CMD_FL1CONGCIF_S)
1494
1495#define FW_IQ_CMD_FL1ONCHIP_S 10
1496#define FW_IQ_CMD_FL1ONCHIP_V(x) ((x) << FW_IQ_CMD_FL1ONCHIP_S)
1497
1498#define FW_IQ_CMD_FL1STATUSPGNS_S 9
1499#define FW_IQ_CMD_FL1STATUSPGNS_V(x) ((x) << FW_IQ_CMD_FL1STATUSPGNS_S)
1500
1501#define FW_IQ_CMD_FL1STATUSPGRO_S 8
1502#define FW_IQ_CMD_FL1STATUSPGRO_V(x) ((x) << FW_IQ_CMD_FL1STATUSPGRO_S)
1503
1504#define FW_IQ_CMD_FL1FETCHNS_S 7
1505#define FW_IQ_CMD_FL1FETCHNS_V(x) ((x) << FW_IQ_CMD_FL1FETCHNS_S)
1506
1507#define FW_IQ_CMD_FL1FETCHRO_S 6
1508#define FW_IQ_CMD_FL1FETCHRO_V(x) ((x) << FW_IQ_CMD_FL1FETCHRO_S)
1509
1510#define FW_IQ_CMD_FL1HOSTFCMODE_S 4
1511#define FW_IQ_CMD_FL1HOSTFCMODE_V(x) ((x) << FW_IQ_CMD_FL1HOSTFCMODE_S)
1512
1513#define FW_IQ_CMD_FL1CPRIO_S 3
1514#define FW_IQ_CMD_FL1CPRIO_V(x) ((x) << FW_IQ_CMD_FL1CPRIO_S)
1515
1516#define FW_IQ_CMD_FL1PADEN_S 2
1517#define FW_IQ_CMD_FL1PADEN_V(x) ((x) << FW_IQ_CMD_FL1PADEN_S)
1518#define FW_IQ_CMD_FL1PADEN_F FW_IQ_CMD_FL1PADEN_V(1U)
1519
1520#define FW_IQ_CMD_FL1PACKEN_S 1
1521#define FW_IQ_CMD_FL1PACKEN_V(x) ((x) << FW_IQ_CMD_FL1PACKEN_S)
1522#define FW_IQ_CMD_FL1PACKEN_F FW_IQ_CMD_FL1PACKEN_V(1U)
1523
1524#define FW_IQ_CMD_FL1CONGEN_S 0
1525#define FW_IQ_CMD_FL1CONGEN_V(x) ((x) << FW_IQ_CMD_FL1CONGEN_S)
1526#define FW_IQ_CMD_FL1CONGEN_F FW_IQ_CMD_FL1CONGEN_V(1U)
1527
1528#define FW_IQ_CMD_FL1DCAEN_S 15
1529#define FW_IQ_CMD_FL1DCAEN_V(x) ((x) << FW_IQ_CMD_FL1DCAEN_S)
1530
1531#define FW_IQ_CMD_FL1DCACPU_S 10
1532#define FW_IQ_CMD_FL1DCACPU_V(x) ((x) << FW_IQ_CMD_FL1DCACPU_S)
1533
1534#define FW_IQ_CMD_FL1FBMIN_S 7
1535#define FW_IQ_CMD_FL1FBMIN_V(x) ((x) << FW_IQ_CMD_FL1FBMIN_S)
1536
1537#define FW_IQ_CMD_FL1FBMAX_S 4
1538#define FW_IQ_CMD_FL1FBMAX_V(x) ((x) << FW_IQ_CMD_FL1FBMAX_S)
1539
1540#define FW_IQ_CMD_FL1CIDXFTHRESHO_S 3
1541#define FW_IQ_CMD_FL1CIDXFTHRESHO_V(x) ((x) << FW_IQ_CMD_FL1CIDXFTHRESHO_S)
1542#define FW_IQ_CMD_FL1CIDXFTHRESHO_F FW_IQ_CMD_FL1CIDXFTHRESHO_V(1U)
1543
1544#define FW_IQ_CMD_FL1CIDXFTHRESH_S 0
1545#define FW_IQ_CMD_FL1CIDXFTHRESH_V(x) ((x) << FW_IQ_CMD_FL1CIDXFTHRESH_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001546
1547struct fw_eq_eth_cmd {
1548 __be32 op_to_vfn;
1549 __be32 alloc_to_len16;
1550 __be32 eqid_pkd;
1551 __be32 physeqid_pkd;
1552 __be32 fetchszm_to_iqid;
1553 __be32 dcaen_to_eqsize;
1554 __be64 eqaddr;
1555 __be32 viid_pkd;
1556 __be32 r8_lo;
1557 __be64 r9;
1558};
1559
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301560#define FW_EQ_ETH_CMD_PFN_S 8
1561#define FW_EQ_ETH_CMD_PFN_V(x) ((x) << FW_EQ_ETH_CMD_PFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001562
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301563#define FW_EQ_ETH_CMD_VFN_S 0
1564#define FW_EQ_ETH_CMD_VFN_V(x) ((x) << FW_EQ_ETH_CMD_VFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001565
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301566#define FW_EQ_ETH_CMD_ALLOC_S 31
1567#define FW_EQ_ETH_CMD_ALLOC_V(x) ((x) << FW_EQ_ETH_CMD_ALLOC_S)
1568#define FW_EQ_ETH_CMD_ALLOC_F FW_EQ_ETH_CMD_ALLOC_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001569
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301570#define FW_EQ_ETH_CMD_FREE_S 30
1571#define FW_EQ_ETH_CMD_FREE_V(x) ((x) << FW_EQ_ETH_CMD_FREE_S)
1572#define FW_EQ_ETH_CMD_FREE_F FW_EQ_ETH_CMD_FREE_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001573
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301574#define FW_EQ_ETH_CMD_MODIFY_S 29
1575#define FW_EQ_ETH_CMD_MODIFY_V(x) ((x) << FW_EQ_ETH_CMD_MODIFY_S)
1576#define FW_EQ_ETH_CMD_MODIFY_F FW_EQ_ETH_CMD_MODIFY_V(1U)
1577
1578#define FW_EQ_ETH_CMD_EQSTART_S 28
1579#define FW_EQ_ETH_CMD_EQSTART_V(x) ((x) << FW_EQ_ETH_CMD_EQSTART_S)
1580#define FW_EQ_ETH_CMD_EQSTART_F FW_EQ_ETH_CMD_EQSTART_V(1U)
1581
1582#define FW_EQ_ETH_CMD_EQSTOP_S 27
1583#define FW_EQ_ETH_CMD_EQSTOP_V(x) ((x) << FW_EQ_ETH_CMD_EQSTOP_S)
1584#define FW_EQ_ETH_CMD_EQSTOP_F FW_EQ_ETH_CMD_EQSTOP_V(1U)
1585
1586#define FW_EQ_ETH_CMD_EQID_S 0
1587#define FW_EQ_ETH_CMD_EQID_M 0xfffff
1588#define FW_EQ_ETH_CMD_EQID_V(x) ((x) << FW_EQ_ETH_CMD_EQID_S)
1589#define FW_EQ_ETH_CMD_EQID_G(x) \
1590 (((x) >> FW_EQ_ETH_CMD_EQID_S) & FW_EQ_ETH_CMD_EQID_M)
1591
1592#define FW_EQ_ETH_CMD_PHYSEQID_S 0
1593#define FW_EQ_ETH_CMD_PHYSEQID_M 0xfffff
1594#define FW_EQ_ETH_CMD_PHYSEQID_V(x) ((x) << FW_EQ_ETH_CMD_PHYSEQID_S)
1595#define FW_EQ_ETH_CMD_PHYSEQID_G(x) \
1596 (((x) >> FW_EQ_ETH_CMD_PHYSEQID_S) & FW_EQ_ETH_CMD_PHYSEQID_M)
1597
1598#define FW_EQ_ETH_CMD_FETCHSZM_S 26
1599#define FW_EQ_ETH_CMD_FETCHSZM_V(x) ((x) << FW_EQ_ETH_CMD_FETCHSZM_S)
1600#define FW_EQ_ETH_CMD_FETCHSZM_F FW_EQ_ETH_CMD_FETCHSZM_V(1U)
1601
1602#define FW_EQ_ETH_CMD_STATUSPGNS_S 25
1603#define FW_EQ_ETH_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_ETH_CMD_STATUSPGNS_S)
1604
1605#define FW_EQ_ETH_CMD_STATUSPGRO_S 24
1606#define FW_EQ_ETH_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_ETH_CMD_STATUSPGRO_S)
1607
1608#define FW_EQ_ETH_CMD_FETCHNS_S 23
1609#define FW_EQ_ETH_CMD_FETCHNS_V(x) ((x) << FW_EQ_ETH_CMD_FETCHNS_S)
1610
1611#define FW_EQ_ETH_CMD_FETCHRO_S 22
1612#define FW_EQ_ETH_CMD_FETCHRO_V(x) ((x) << FW_EQ_ETH_CMD_FETCHRO_S)
Hariprasad Shenai1ecc7b72015-05-12 04:43:43 +05301613#define FW_EQ_ETH_CMD_FETCHRO_F FW_EQ_ETH_CMD_FETCHRO_V(1U)
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301614
1615#define FW_EQ_ETH_CMD_HOSTFCMODE_S 20
1616#define FW_EQ_ETH_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_ETH_CMD_HOSTFCMODE_S)
1617
1618#define FW_EQ_ETH_CMD_CPRIO_S 19
1619#define FW_EQ_ETH_CMD_CPRIO_V(x) ((x) << FW_EQ_ETH_CMD_CPRIO_S)
1620
1621#define FW_EQ_ETH_CMD_ONCHIP_S 18
1622#define FW_EQ_ETH_CMD_ONCHIP_V(x) ((x) << FW_EQ_ETH_CMD_ONCHIP_S)
1623
1624#define FW_EQ_ETH_CMD_PCIECHN_S 16
1625#define FW_EQ_ETH_CMD_PCIECHN_V(x) ((x) << FW_EQ_ETH_CMD_PCIECHN_S)
1626
1627#define FW_EQ_ETH_CMD_IQID_S 0
1628#define FW_EQ_ETH_CMD_IQID_V(x) ((x) << FW_EQ_ETH_CMD_IQID_S)
1629
1630#define FW_EQ_ETH_CMD_DCAEN_S 31
1631#define FW_EQ_ETH_CMD_DCAEN_V(x) ((x) << FW_EQ_ETH_CMD_DCAEN_S)
1632
1633#define FW_EQ_ETH_CMD_DCACPU_S 26
1634#define FW_EQ_ETH_CMD_DCACPU_V(x) ((x) << FW_EQ_ETH_CMD_DCACPU_S)
1635
1636#define FW_EQ_ETH_CMD_FBMIN_S 23
1637#define FW_EQ_ETH_CMD_FBMIN_V(x) ((x) << FW_EQ_ETH_CMD_FBMIN_S)
1638
1639#define FW_EQ_ETH_CMD_FBMAX_S 20
1640#define FW_EQ_ETH_CMD_FBMAX_V(x) ((x) << FW_EQ_ETH_CMD_FBMAX_S)
1641
1642#define FW_EQ_ETH_CMD_CIDXFTHRESHO_S 19
1643#define FW_EQ_ETH_CMD_CIDXFTHRESHO_V(x) ((x) << FW_EQ_ETH_CMD_CIDXFTHRESHO_S)
1644
1645#define FW_EQ_ETH_CMD_CIDXFTHRESH_S 16
1646#define FW_EQ_ETH_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_ETH_CMD_CIDXFTHRESH_S)
1647
1648#define FW_EQ_ETH_CMD_EQSIZE_S 0
1649#define FW_EQ_ETH_CMD_EQSIZE_V(x) ((x) << FW_EQ_ETH_CMD_EQSIZE_S)
1650
1651#define FW_EQ_ETH_CMD_AUTOEQUEQE_S 30
1652#define FW_EQ_ETH_CMD_AUTOEQUEQE_V(x) ((x) << FW_EQ_ETH_CMD_AUTOEQUEQE_S)
1653#define FW_EQ_ETH_CMD_AUTOEQUEQE_F FW_EQ_ETH_CMD_AUTOEQUEQE_V(1U)
1654
1655#define FW_EQ_ETH_CMD_VIID_S 16
1656#define FW_EQ_ETH_CMD_VIID_V(x) ((x) << FW_EQ_ETH_CMD_VIID_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001657
1658struct fw_eq_ctrl_cmd {
1659 __be32 op_to_vfn;
1660 __be32 alloc_to_len16;
1661 __be32 cmpliqid_eqid;
1662 __be32 physeqid_pkd;
1663 __be32 fetchszm_to_iqid;
1664 __be32 dcaen_to_eqsize;
1665 __be64 eqaddr;
1666};
1667
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301668#define FW_EQ_CTRL_CMD_PFN_S 8
1669#define FW_EQ_CTRL_CMD_PFN_V(x) ((x) << FW_EQ_CTRL_CMD_PFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001670
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301671#define FW_EQ_CTRL_CMD_VFN_S 0
1672#define FW_EQ_CTRL_CMD_VFN_V(x) ((x) << FW_EQ_CTRL_CMD_VFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001673
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301674#define FW_EQ_CTRL_CMD_ALLOC_S 31
1675#define FW_EQ_CTRL_CMD_ALLOC_V(x) ((x) << FW_EQ_CTRL_CMD_ALLOC_S)
1676#define FW_EQ_CTRL_CMD_ALLOC_F FW_EQ_CTRL_CMD_ALLOC_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001677
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301678#define FW_EQ_CTRL_CMD_FREE_S 30
1679#define FW_EQ_CTRL_CMD_FREE_V(x) ((x) << FW_EQ_CTRL_CMD_FREE_S)
1680#define FW_EQ_CTRL_CMD_FREE_F FW_EQ_CTRL_CMD_FREE_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001681
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301682#define FW_EQ_CTRL_CMD_MODIFY_S 29
1683#define FW_EQ_CTRL_CMD_MODIFY_V(x) ((x) << FW_EQ_CTRL_CMD_MODIFY_S)
1684#define FW_EQ_CTRL_CMD_MODIFY_F FW_EQ_CTRL_CMD_MODIFY_V(1U)
1685
1686#define FW_EQ_CTRL_CMD_EQSTART_S 28
1687#define FW_EQ_CTRL_CMD_EQSTART_V(x) ((x) << FW_EQ_CTRL_CMD_EQSTART_S)
1688#define FW_EQ_CTRL_CMD_EQSTART_F FW_EQ_CTRL_CMD_EQSTART_V(1U)
1689
1690#define FW_EQ_CTRL_CMD_EQSTOP_S 27
1691#define FW_EQ_CTRL_CMD_EQSTOP_V(x) ((x) << FW_EQ_CTRL_CMD_EQSTOP_S)
1692#define FW_EQ_CTRL_CMD_EQSTOP_F FW_EQ_CTRL_CMD_EQSTOP_V(1U)
1693
1694#define FW_EQ_CTRL_CMD_CMPLIQID_S 20
1695#define FW_EQ_CTRL_CMD_CMPLIQID_V(x) ((x) << FW_EQ_CTRL_CMD_CMPLIQID_S)
1696
1697#define FW_EQ_CTRL_CMD_EQID_S 0
1698#define FW_EQ_CTRL_CMD_EQID_M 0xfffff
1699#define FW_EQ_CTRL_CMD_EQID_V(x) ((x) << FW_EQ_CTRL_CMD_EQID_S)
1700#define FW_EQ_CTRL_CMD_EQID_G(x) \
1701 (((x) >> FW_EQ_CTRL_CMD_EQID_S) & FW_EQ_CTRL_CMD_EQID_M)
1702
1703#define FW_EQ_CTRL_CMD_PHYSEQID_S 0
1704#define FW_EQ_CTRL_CMD_PHYSEQID_M 0xfffff
1705#define FW_EQ_CTRL_CMD_PHYSEQID_G(x) \
1706 (((x) >> FW_EQ_CTRL_CMD_PHYSEQID_S) & FW_EQ_CTRL_CMD_PHYSEQID_M)
1707
1708#define FW_EQ_CTRL_CMD_FETCHSZM_S 26
1709#define FW_EQ_CTRL_CMD_FETCHSZM_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHSZM_S)
1710#define FW_EQ_CTRL_CMD_FETCHSZM_F FW_EQ_CTRL_CMD_FETCHSZM_V(1U)
1711
1712#define FW_EQ_CTRL_CMD_STATUSPGNS_S 25
1713#define FW_EQ_CTRL_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_CTRL_CMD_STATUSPGNS_S)
1714#define FW_EQ_CTRL_CMD_STATUSPGNS_F FW_EQ_CTRL_CMD_STATUSPGNS_V(1U)
1715
1716#define FW_EQ_CTRL_CMD_STATUSPGRO_S 24
1717#define FW_EQ_CTRL_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_CTRL_CMD_STATUSPGRO_S)
1718#define FW_EQ_CTRL_CMD_STATUSPGRO_F FW_EQ_CTRL_CMD_STATUSPGRO_V(1U)
1719
1720#define FW_EQ_CTRL_CMD_FETCHNS_S 23
1721#define FW_EQ_CTRL_CMD_FETCHNS_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHNS_S)
1722#define FW_EQ_CTRL_CMD_FETCHNS_F FW_EQ_CTRL_CMD_FETCHNS_V(1U)
1723
1724#define FW_EQ_CTRL_CMD_FETCHRO_S 22
1725#define FW_EQ_CTRL_CMD_FETCHRO_V(x) ((x) << FW_EQ_CTRL_CMD_FETCHRO_S)
1726#define FW_EQ_CTRL_CMD_FETCHRO_F FW_EQ_CTRL_CMD_FETCHRO_V(1U)
1727
1728#define FW_EQ_CTRL_CMD_HOSTFCMODE_S 20
1729#define FW_EQ_CTRL_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_CTRL_CMD_HOSTFCMODE_S)
1730
1731#define FW_EQ_CTRL_CMD_CPRIO_S 19
1732#define FW_EQ_CTRL_CMD_CPRIO_V(x) ((x) << FW_EQ_CTRL_CMD_CPRIO_S)
1733
1734#define FW_EQ_CTRL_CMD_ONCHIP_S 18
1735#define FW_EQ_CTRL_CMD_ONCHIP_V(x) ((x) << FW_EQ_CTRL_CMD_ONCHIP_S)
1736
1737#define FW_EQ_CTRL_CMD_PCIECHN_S 16
1738#define FW_EQ_CTRL_CMD_PCIECHN_V(x) ((x) << FW_EQ_CTRL_CMD_PCIECHN_S)
1739
1740#define FW_EQ_CTRL_CMD_IQID_S 0
1741#define FW_EQ_CTRL_CMD_IQID_V(x) ((x) << FW_EQ_CTRL_CMD_IQID_S)
1742
1743#define FW_EQ_CTRL_CMD_DCAEN_S 31
1744#define FW_EQ_CTRL_CMD_DCAEN_V(x) ((x) << FW_EQ_CTRL_CMD_DCAEN_S)
1745
1746#define FW_EQ_CTRL_CMD_DCACPU_S 26
1747#define FW_EQ_CTRL_CMD_DCACPU_V(x) ((x) << FW_EQ_CTRL_CMD_DCACPU_S)
1748
1749#define FW_EQ_CTRL_CMD_FBMIN_S 23
1750#define FW_EQ_CTRL_CMD_FBMIN_V(x) ((x) << FW_EQ_CTRL_CMD_FBMIN_S)
1751
1752#define FW_EQ_CTRL_CMD_FBMAX_S 20
1753#define FW_EQ_CTRL_CMD_FBMAX_V(x) ((x) << FW_EQ_CTRL_CMD_FBMAX_S)
1754
1755#define FW_EQ_CTRL_CMD_CIDXFTHRESHO_S 19
1756#define FW_EQ_CTRL_CMD_CIDXFTHRESHO_V(x) \
1757 ((x) << FW_EQ_CTRL_CMD_CIDXFTHRESHO_S)
1758
1759#define FW_EQ_CTRL_CMD_CIDXFTHRESH_S 16
1760#define FW_EQ_CTRL_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_CTRL_CMD_CIDXFTHRESH_S)
1761
1762#define FW_EQ_CTRL_CMD_EQSIZE_S 0
1763#define FW_EQ_CTRL_CMD_EQSIZE_V(x) ((x) << FW_EQ_CTRL_CMD_EQSIZE_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001764
1765struct fw_eq_ofld_cmd {
1766 __be32 op_to_vfn;
1767 __be32 alloc_to_len16;
1768 __be32 eqid_pkd;
1769 __be32 physeqid_pkd;
1770 __be32 fetchszm_to_iqid;
1771 __be32 dcaen_to_eqsize;
1772 __be64 eqaddr;
1773};
1774
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301775#define FW_EQ_OFLD_CMD_PFN_S 8
1776#define FW_EQ_OFLD_CMD_PFN_V(x) ((x) << FW_EQ_OFLD_CMD_PFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001777
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301778#define FW_EQ_OFLD_CMD_VFN_S 0
1779#define FW_EQ_OFLD_CMD_VFN_V(x) ((x) << FW_EQ_OFLD_CMD_VFN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001780
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301781#define FW_EQ_OFLD_CMD_ALLOC_S 31
1782#define FW_EQ_OFLD_CMD_ALLOC_V(x) ((x) << FW_EQ_OFLD_CMD_ALLOC_S)
1783#define FW_EQ_OFLD_CMD_ALLOC_F FW_EQ_OFLD_CMD_ALLOC_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001784
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301785#define FW_EQ_OFLD_CMD_FREE_S 30
1786#define FW_EQ_OFLD_CMD_FREE_V(x) ((x) << FW_EQ_OFLD_CMD_FREE_S)
1787#define FW_EQ_OFLD_CMD_FREE_F FW_EQ_OFLD_CMD_FREE_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001788
Hariprasad Shenai6e4b51a2014-11-21 12:52:03 +05301789#define FW_EQ_OFLD_CMD_MODIFY_S 29
1790#define FW_EQ_OFLD_CMD_MODIFY_V(x) ((x) << FW_EQ_OFLD_CMD_MODIFY_S)
1791#define FW_EQ_OFLD_CMD_MODIFY_F FW_EQ_OFLD_CMD_MODIFY_V(1U)
1792
1793#define FW_EQ_OFLD_CMD_EQSTART_S 28
1794#define FW_EQ_OFLD_CMD_EQSTART_V(x) ((x) << FW_EQ_OFLD_CMD_EQSTART_S)
1795#define FW_EQ_OFLD_CMD_EQSTART_F FW_EQ_OFLD_CMD_EQSTART_V(1U)
1796
1797#define FW_EQ_OFLD_CMD_EQSTOP_S 27
1798#define FW_EQ_OFLD_CMD_EQSTOP_V(x) ((x) << FW_EQ_OFLD_CMD_EQSTOP_S)
1799#define FW_EQ_OFLD_CMD_EQSTOP_F FW_EQ_OFLD_CMD_EQSTOP_V(1U)
1800
1801#define FW_EQ_OFLD_CMD_EQID_S 0
1802#define FW_EQ_OFLD_CMD_EQID_M 0xfffff
1803#define FW_EQ_OFLD_CMD_EQID_V(x) ((x) << FW_EQ_OFLD_CMD_EQID_S)
1804#define FW_EQ_OFLD_CMD_EQID_G(x) \
1805 (((x) >> FW_EQ_OFLD_CMD_EQID_S) & FW_EQ_OFLD_CMD_EQID_M)
1806
1807#define FW_EQ_OFLD_CMD_PHYSEQID_S 0
1808#define FW_EQ_OFLD_CMD_PHYSEQID_M 0xfffff
1809#define FW_EQ_OFLD_CMD_PHYSEQID_G(x) \
1810 (((x) >> FW_EQ_OFLD_CMD_PHYSEQID_S) & FW_EQ_OFLD_CMD_PHYSEQID_M)
1811
1812#define FW_EQ_OFLD_CMD_FETCHSZM_S 26
1813#define FW_EQ_OFLD_CMD_FETCHSZM_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHSZM_S)
1814
1815#define FW_EQ_OFLD_CMD_STATUSPGNS_S 25
1816#define FW_EQ_OFLD_CMD_STATUSPGNS_V(x) ((x) << FW_EQ_OFLD_CMD_STATUSPGNS_S)
1817
1818#define FW_EQ_OFLD_CMD_STATUSPGRO_S 24
1819#define FW_EQ_OFLD_CMD_STATUSPGRO_V(x) ((x) << FW_EQ_OFLD_CMD_STATUSPGRO_S)
1820
1821#define FW_EQ_OFLD_CMD_FETCHNS_S 23
1822#define FW_EQ_OFLD_CMD_FETCHNS_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHNS_S)
1823
1824#define FW_EQ_OFLD_CMD_FETCHRO_S 22
1825#define FW_EQ_OFLD_CMD_FETCHRO_V(x) ((x) << FW_EQ_OFLD_CMD_FETCHRO_S)
1826#define FW_EQ_OFLD_CMD_FETCHRO_F FW_EQ_OFLD_CMD_FETCHRO_V(1U)
1827
1828#define FW_EQ_OFLD_CMD_HOSTFCMODE_S 20
1829#define FW_EQ_OFLD_CMD_HOSTFCMODE_V(x) ((x) << FW_EQ_OFLD_CMD_HOSTFCMODE_S)
1830
1831#define FW_EQ_OFLD_CMD_CPRIO_S 19
1832#define FW_EQ_OFLD_CMD_CPRIO_V(x) ((x) << FW_EQ_OFLD_CMD_CPRIO_S)
1833
1834#define FW_EQ_OFLD_CMD_ONCHIP_S 18
1835#define FW_EQ_OFLD_CMD_ONCHIP_V(x) ((x) << FW_EQ_OFLD_CMD_ONCHIP_S)
1836
1837#define FW_EQ_OFLD_CMD_PCIECHN_S 16
1838#define FW_EQ_OFLD_CMD_PCIECHN_V(x) ((x) << FW_EQ_OFLD_CMD_PCIECHN_S)
1839
1840#define FW_EQ_OFLD_CMD_IQID_S 0
1841#define FW_EQ_OFLD_CMD_IQID_V(x) ((x) << FW_EQ_OFLD_CMD_IQID_S)
1842
1843#define FW_EQ_OFLD_CMD_DCAEN_S 31
1844#define FW_EQ_OFLD_CMD_DCAEN_V(x) ((x) << FW_EQ_OFLD_CMD_DCAEN_S)
1845
1846#define FW_EQ_OFLD_CMD_DCACPU_S 26
1847#define FW_EQ_OFLD_CMD_DCACPU_V(x) ((x) << FW_EQ_OFLD_CMD_DCACPU_S)
1848
1849#define FW_EQ_OFLD_CMD_FBMIN_S 23
1850#define FW_EQ_OFLD_CMD_FBMIN_V(x) ((x) << FW_EQ_OFLD_CMD_FBMIN_S)
1851
1852#define FW_EQ_OFLD_CMD_FBMAX_S 20
1853#define FW_EQ_OFLD_CMD_FBMAX_V(x) ((x) << FW_EQ_OFLD_CMD_FBMAX_S)
1854
1855#define FW_EQ_OFLD_CMD_CIDXFTHRESHO_S 19
1856#define FW_EQ_OFLD_CMD_CIDXFTHRESHO_V(x) \
1857 ((x) << FW_EQ_OFLD_CMD_CIDXFTHRESHO_S)
1858
1859#define FW_EQ_OFLD_CMD_CIDXFTHRESH_S 16
1860#define FW_EQ_OFLD_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_OFLD_CMD_CIDXFTHRESH_S)
1861
1862#define FW_EQ_OFLD_CMD_EQSIZE_S 0
1863#define FW_EQ_OFLD_CMD_EQSIZE_V(x) ((x) << FW_EQ_OFLD_CMD_EQSIZE_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001864
1865/*
1866 * Macros for VIID parsing:
1867 * VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number
1868 */
Anish Bhattd7990b02014-11-12 17:15:57 -08001869
1870#define FW_VIID_PFN_S 8
1871#define FW_VIID_PFN_M 0x7
1872#define FW_VIID_PFN_G(x) (((x) >> FW_VIID_PFN_S) & FW_VIID_PFN_M)
1873
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05301874#define FW_VIID_VIVLD_S 7
1875#define FW_VIID_VIVLD_M 0x1
1876#define FW_VIID_VIVLD_G(x) (((x) >> FW_VIID_VIVLD_S) & FW_VIID_VIVLD_M)
1877
1878#define FW_VIID_VIN_S 0
1879#define FW_VIID_VIN_M 0x7F
1880#define FW_VIID_VIN_G(x) (((x) >> FW_VIID_VIN_S) & FW_VIID_VIN_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001881
1882struct fw_vi_cmd {
1883 __be32 op_to_vfn;
1884 __be32 alloc_to_len16;
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00001885 __be16 type_viid;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001886 u8 mac[6];
1887 u8 portid_pkd;
1888 u8 nmac;
1889 u8 nmac0[6];
1890 __be16 rsssize_pkd;
1891 u8 nmac1[6];
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00001892 __be16 idsiiq_pkd;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001893 u8 nmac2[6];
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00001894 __be16 idseiq_pkd;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001895 u8 nmac3[6];
1896 __be64 r9;
1897 __be64 r10;
1898};
1899
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05301900#define FW_VI_CMD_PFN_S 8
1901#define FW_VI_CMD_PFN_V(x) ((x) << FW_VI_CMD_PFN_S)
1902
1903#define FW_VI_CMD_VFN_S 0
1904#define FW_VI_CMD_VFN_V(x) ((x) << FW_VI_CMD_VFN_S)
1905
1906#define FW_VI_CMD_ALLOC_S 31
1907#define FW_VI_CMD_ALLOC_V(x) ((x) << FW_VI_CMD_ALLOC_S)
1908#define FW_VI_CMD_ALLOC_F FW_VI_CMD_ALLOC_V(1U)
1909
1910#define FW_VI_CMD_FREE_S 30
1911#define FW_VI_CMD_FREE_V(x) ((x) << FW_VI_CMD_FREE_S)
1912#define FW_VI_CMD_FREE_F FW_VI_CMD_FREE_V(1U)
1913
1914#define FW_VI_CMD_VIID_S 0
1915#define FW_VI_CMD_VIID_M 0xfff
1916#define FW_VI_CMD_VIID_V(x) ((x) << FW_VI_CMD_VIID_S)
1917#define FW_VI_CMD_VIID_G(x) (((x) >> FW_VI_CMD_VIID_S) & FW_VI_CMD_VIID_M)
1918
1919#define FW_VI_CMD_PORTID_S 4
1920#define FW_VI_CMD_PORTID_M 0xf
1921#define FW_VI_CMD_PORTID_V(x) ((x) << FW_VI_CMD_PORTID_S)
1922#define FW_VI_CMD_PORTID_G(x) \
1923 (((x) >> FW_VI_CMD_PORTID_S) & FW_VI_CMD_PORTID_M)
1924
1925#define FW_VI_CMD_RSSSIZE_S 0
1926#define FW_VI_CMD_RSSSIZE_M 0x7ff
1927#define FW_VI_CMD_RSSSIZE_G(x) \
1928 (((x) >> FW_VI_CMD_RSSSIZE_S) & FW_VI_CMD_RSSSIZE_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001929
1930/* Special VI_MAC command index ids */
1931#define FW_VI_MAC_ADD_MAC 0x3FF
1932#define FW_VI_MAC_ADD_PERSIST_MAC 0x3FE
1933#define FW_VI_MAC_MAC_BASED_FREE 0x3FD
Casey Leedom81323b72010-06-25 12:10:32 +00001934#define FW_CLS_TCAM_NUM_ENTRIES 336
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001935
1936enum fw_vi_mac_smac {
1937 FW_VI_MAC_MPS_TCAM_ENTRY,
1938 FW_VI_MAC_MPS_TCAM_ONLY,
1939 FW_VI_MAC_SMT_ONLY,
1940 FW_VI_MAC_SMT_AND_MPSTCAM
1941};
1942
1943enum fw_vi_mac_result {
1944 FW_VI_MAC_R_SUCCESS,
1945 FW_VI_MAC_R_F_NONEXISTENT_NOMEM,
1946 FW_VI_MAC_R_SMAC_FAIL,
1947 FW_VI_MAC_R_F_ACL_CHECK
1948};
1949
1950struct fw_vi_mac_cmd {
1951 __be32 op_to_viid;
1952 __be32 freemacs_to_len16;
1953 union fw_vi_mac {
1954 struct fw_vi_mac_exact {
1955 __be16 valid_to_idx;
1956 u8 macaddr[6];
1957 } exact[7];
1958 struct fw_vi_mac_hash {
1959 __be64 hashvec;
1960 } hash;
1961 } u;
1962};
1963
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05301964#define FW_VI_MAC_CMD_VIID_S 0
1965#define FW_VI_MAC_CMD_VIID_V(x) ((x) << FW_VI_MAC_CMD_VIID_S)
1966
1967#define FW_VI_MAC_CMD_FREEMACS_S 31
1968#define FW_VI_MAC_CMD_FREEMACS_V(x) ((x) << FW_VI_MAC_CMD_FREEMACS_S)
1969
1970#define FW_VI_MAC_CMD_HASHVECEN_S 23
1971#define FW_VI_MAC_CMD_HASHVECEN_V(x) ((x) << FW_VI_MAC_CMD_HASHVECEN_S)
1972#define FW_VI_MAC_CMD_HASHVECEN_F FW_VI_MAC_CMD_HASHVECEN_V(1U)
1973
1974#define FW_VI_MAC_CMD_HASHUNIEN_S 22
1975#define FW_VI_MAC_CMD_HASHUNIEN_V(x) ((x) << FW_VI_MAC_CMD_HASHUNIEN_S)
1976
1977#define FW_VI_MAC_CMD_VALID_S 15
1978#define FW_VI_MAC_CMD_VALID_V(x) ((x) << FW_VI_MAC_CMD_VALID_S)
1979#define FW_VI_MAC_CMD_VALID_F FW_VI_MAC_CMD_VALID_V(1U)
1980
1981#define FW_VI_MAC_CMD_PRIO_S 12
1982#define FW_VI_MAC_CMD_PRIO_V(x) ((x) << FW_VI_MAC_CMD_PRIO_S)
1983
1984#define FW_VI_MAC_CMD_SMAC_RESULT_S 10
1985#define FW_VI_MAC_CMD_SMAC_RESULT_M 0x3
1986#define FW_VI_MAC_CMD_SMAC_RESULT_V(x) ((x) << FW_VI_MAC_CMD_SMAC_RESULT_S)
1987#define FW_VI_MAC_CMD_SMAC_RESULT_G(x) \
1988 (((x) >> FW_VI_MAC_CMD_SMAC_RESULT_S) & FW_VI_MAC_CMD_SMAC_RESULT_M)
1989
1990#define FW_VI_MAC_CMD_IDX_S 0
1991#define FW_VI_MAC_CMD_IDX_M 0x3ff
1992#define FW_VI_MAC_CMD_IDX_V(x) ((x) << FW_VI_MAC_CMD_IDX_S)
1993#define FW_VI_MAC_CMD_IDX_G(x) \
1994 (((x) >> FW_VI_MAC_CMD_IDX_S) & FW_VI_MAC_CMD_IDX_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00001995
1996#define FW_RXMODE_MTU_NO_CHG 65535
1997
1998struct fw_vi_rxmode_cmd {
1999 __be32 op_to_viid;
2000 __be32 retval_len16;
Dimitris Michailidisf8f5aaf2010-05-10 15:58:07 +00002001 __be32 mtu_to_vlanexen;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002002 __be32 r4_lo;
2003};
2004
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302005#define FW_VI_RXMODE_CMD_VIID_S 0
2006#define FW_VI_RXMODE_CMD_VIID_V(x) ((x) << FW_VI_RXMODE_CMD_VIID_S)
2007
2008#define FW_VI_RXMODE_CMD_MTU_S 16
2009#define FW_VI_RXMODE_CMD_MTU_M 0xffff
2010#define FW_VI_RXMODE_CMD_MTU_V(x) ((x) << FW_VI_RXMODE_CMD_MTU_S)
2011
2012#define FW_VI_RXMODE_CMD_PROMISCEN_S 14
2013#define FW_VI_RXMODE_CMD_PROMISCEN_M 0x3
2014#define FW_VI_RXMODE_CMD_PROMISCEN_V(x) ((x) << FW_VI_RXMODE_CMD_PROMISCEN_S)
2015
2016#define FW_VI_RXMODE_CMD_ALLMULTIEN_S 12
2017#define FW_VI_RXMODE_CMD_ALLMULTIEN_M 0x3
2018#define FW_VI_RXMODE_CMD_ALLMULTIEN_V(x) \
2019 ((x) << FW_VI_RXMODE_CMD_ALLMULTIEN_S)
2020
2021#define FW_VI_RXMODE_CMD_BROADCASTEN_S 10
2022#define FW_VI_RXMODE_CMD_BROADCASTEN_M 0x3
2023#define FW_VI_RXMODE_CMD_BROADCASTEN_V(x) \
2024 ((x) << FW_VI_RXMODE_CMD_BROADCASTEN_S)
2025
2026#define FW_VI_RXMODE_CMD_VLANEXEN_S 8
2027#define FW_VI_RXMODE_CMD_VLANEXEN_M 0x3
2028#define FW_VI_RXMODE_CMD_VLANEXEN_V(x) ((x) << FW_VI_RXMODE_CMD_VLANEXEN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002029
2030struct fw_vi_enable_cmd {
2031 __be32 op_to_viid;
2032 __be32 ien_to_len16;
2033 __be16 blinkdur;
2034 __be16 r3;
2035 __be32 r4;
2036};
2037
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302038#define FW_VI_ENABLE_CMD_VIID_S 0
2039#define FW_VI_ENABLE_CMD_VIID_V(x) ((x) << FW_VI_ENABLE_CMD_VIID_S)
2040
2041#define FW_VI_ENABLE_CMD_IEN_S 31
2042#define FW_VI_ENABLE_CMD_IEN_V(x) ((x) << FW_VI_ENABLE_CMD_IEN_S)
2043
2044#define FW_VI_ENABLE_CMD_EEN_S 30
2045#define FW_VI_ENABLE_CMD_EEN_V(x) ((x) << FW_VI_ENABLE_CMD_EEN_S)
2046
2047#define FW_VI_ENABLE_CMD_LED_S 29
2048#define FW_VI_ENABLE_CMD_LED_V(x) ((x) << FW_VI_ENABLE_CMD_LED_S)
2049#define FW_VI_ENABLE_CMD_LED_F FW_VI_ENABLE_CMD_LED_V(1U)
2050
2051#define FW_VI_ENABLE_CMD_DCB_INFO_S 28
2052#define FW_VI_ENABLE_CMD_DCB_INFO_V(x) ((x) << FW_VI_ENABLE_CMD_DCB_INFO_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002053
2054/* VI VF stats offset definitions */
2055#define VI_VF_NUM_STATS 16
2056enum fw_vi_stats_vf_index {
2057 FW_VI_VF_STAT_TX_BCAST_BYTES_IX,
2058 FW_VI_VF_STAT_TX_BCAST_FRAMES_IX,
2059 FW_VI_VF_STAT_TX_MCAST_BYTES_IX,
2060 FW_VI_VF_STAT_TX_MCAST_FRAMES_IX,
2061 FW_VI_VF_STAT_TX_UCAST_BYTES_IX,
2062 FW_VI_VF_STAT_TX_UCAST_FRAMES_IX,
2063 FW_VI_VF_STAT_TX_DROP_FRAMES_IX,
2064 FW_VI_VF_STAT_TX_OFLD_BYTES_IX,
2065 FW_VI_VF_STAT_TX_OFLD_FRAMES_IX,
2066 FW_VI_VF_STAT_RX_BCAST_BYTES_IX,
2067 FW_VI_VF_STAT_RX_BCAST_FRAMES_IX,
2068 FW_VI_VF_STAT_RX_MCAST_BYTES_IX,
2069 FW_VI_VF_STAT_RX_MCAST_FRAMES_IX,
2070 FW_VI_VF_STAT_RX_UCAST_BYTES_IX,
2071 FW_VI_VF_STAT_RX_UCAST_FRAMES_IX,
2072 FW_VI_VF_STAT_RX_ERR_FRAMES_IX
2073};
2074
2075/* VI PF stats offset definitions */
2076#define VI_PF_NUM_STATS 17
2077enum fw_vi_stats_pf_index {
2078 FW_VI_PF_STAT_TX_BCAST_BYTES_IX,
2079 FW_VI_PF_STAT_TX_BCAST_FRAMES_IX,
2080 FW_VI_PF_STAT_TX_MCAST_BYTES_IX,
2081 FW_VI_PF_STAT_TX_MCAST_FRAMES_IX,
2082 FW_VI_PF_STAT_TX_UCAST_BYTES_IX,
2083 FW_VI_PF_STAT_TX_UCAST_FRAMES_IX,
2084 FW_VI_PF_STAT_TX_OFLD_BYTES_IX,
2085 FW_VI_PF_STAT_TX_OFLD_FRAMES_IX,
2086 FW_VI_PF_STAT_RX_BYTES_IX,
2087 FW_VI_PF_STAT_RX_FRAMES_IX,
2088 FW_VI_PF_STAT_RX_BCAST_BYTES_IX,
2089 FW_VI_PF_STAT_RX_BCAST_FRAMES_IX,
2090 FW_VI_PF_STAT_RX_MCAST_BYTES_IX,
2091 FW_VI_PF_STAT_RX_MCAST_FRAMES_IX,
2092 FW_VI_PF_STAT_RX_UCAST_BYTES_IX,
2093 FW_VI_PF_STAT_RX_UCAST_FRAMES_IX,
2094 FW_VI_PF_STAT_RX_ERR_FRAMES_IX
2095};
2096
2097struct fw_vi_stats_cmd {
2098 __be32 op_to_viid;
2099 __be32 retval_len16;
2100 union fw_vi_stats {
2101 struct fw_vi_stats_ctl {
2102 __be16 nstats_ix;
2103 __be16 r6;
2104 __be32 r7;
2105 __be64 stat0;
2106 __be64 stat1;
2107 __be64 stat2;
2108 __be64 stat3;
2109 __be64 stat4;
2110 __be64 stat5;
2111 } ctl;
2112 struct fw_vi_stats_pf {
2113 __be64 tx_bcast_bytes;
2114 __be64 tx_bcast_frames;
2115 __be64 tx_mcast_bytes;
2116 __be64 tx_mcast_frames;
2117 __be64 tx_ucast_bytes;
2118 __be64 tx_ucast_frames;
2119 __be64 tx_offload_bytes;
2120 __be64 tx_offload_frames;
2121 __be64 rx_pf_bytes;
2122 __be64 rx_pf_frames;
2123 __be64 rx_bcast_bytes;
2124 __be64 rx_bcast_frames;
2125 __be64 rx_mcast_bytes;
2126 __be64 rx_mcast_frames;
2127 __be64 rx_ucast_bytes;
2128 __be64 rx_ucast_frames;
2129 __be64 rx_err_frames;
2130 } pf;
2131 struct fw_vi_stats_vf {
2132 __be64 tx_bcast_bytes;
2133 __be64 tx_bcast_frames;
2134 __be64 tx_mcast_bytes;
2135 __be64 tx_mcast_frames;
2136 __be64 tx_ucast_bytes;
2137 __be64 tx_ucast_frames;
2138 __be64 tx_drop_frames;
2139 __be64 tx_offload_bytes;
2140 __be64 tx_offload_frames;
2141 __be64 rx_bcast_bytes;
2142 __be64 rx_bcast_frames;
2143 __be64 rx_mcast_bytes;
2144 __be64 rx_mcast_frames;
2145 __be64 rx_ucast_bytes;
2146 __be64 rx_ucast_frames;
2147 __be64 rx_err_frames;
2148 } vf;
2149 } u;
2150};
2151
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302152#define FW_VI_STATS_CMD_VIID_S 0
2153#define FW_VI_STATS_CMD_VIID_V(x) ((x) << FW_VI_STATS_CMD_VIID_S)
2154
2155#define FW_VI_STATS_CMD_NSTATS_S 12
2156#define FW_VI_STATS_CMD_NSTATS_V(x) ((x) << FW_VI_STATS_CMD_NSTATS_S)
2157
2158#define FW_VI_STATS_CMD_IX_S 0
2159#define FW_VI_STATS_CMD_IX_V(x) ((x) << FW_VI_STATS_CMD_IX_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002160
2161struct fw_acl_mac_cmd {
2162 __be32 op_to_vfn;
2163 __be32 en_to_len16;
2164 u8 nmac;
2165 u8 r3[7];
2166 __be16 r4;
2167 u8 macaddr0[6];
2168 __be16 r5;
2169 u8 macaddr1[6];
2170 __be16 r6;
2171 u8 macaddr2[6];
2172 __be16 r7;
2173 u8 macaddr3[6];
2174};
2175
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302176#define FW_ACL_MAC_CMD_PFN_S 8
2177#define FW_ACL_MAC_CMD_PFN_V(x) ((x) << FW_ACL_MAC_CMD_PFN_S)
2178
2179#define FW_ACL_MAC_CMD_VFN_S 0
2180#define FW_ACL_MAC_CMD_VFN_V(x) ((x) << FW_ACL_MAC_CMD_VFN_S)
2181
2182#define FW_ACL_MAC_CMD_EN_S 31
2183#define FW_ACL_MAC_CMD_EN_V(x) ((x) << FW_ACL_MAC_CMD_EN_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002184
2185struct fw_acl_vlan_cmd {
2186 __be32 op_to_vfn;
2187 __be32 en_to_len16;
2188 u8 nvlan;
2189 u8 dropnovlan_fm;
2190 u8 r3_lo[6];
2191 __be16 vlanid[16];
2192};
2193
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302194#define FW_ACL_VLAN_CMD_PFN_S 8
2195#define FW_ACL_VLAN_CMD_PFN_V(x) ((x) << FW_ACL_VLAN_CMD_PFN_S)
2196
2197#define FW_ACL_VLAN_CMD_VFN_S 0
2198#define FW_ACL_VLAN_CMD_VFN_V(x) ((x) << FW_ACL_VLAN_CMD_VFN_S)
2199
2200#define FW_ACL_VLAN_CMD_EN_S 31
2201#define FW_ACL_VLAN_CMD_EN_V(x) ((x) << FW_ACL_VLAN_CMD_EN_S)
2202
2203#define FW_ACL_VLAN_CMD_DROPNOVLAN_S 7
2204#define FW_ACL_VLAN_CMD_DROPNOVLAN_V(x) ((x) << FW_ACL_VLAN_CMD_DROPNOVLAN_S)
2205
2206#define FW_ACL_VLAN_CMD_FM_S 6
2207#define FW_ACL_VLAN_CMD_FM_V(x) ((x) << FW_ACL_VLAN_CMD_FM_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002208
2209enum fw_port_cap {
2210 FW_PORT_CAP_SPEED_100M = 0x0001,
2211 FW_PORT_CAP_SPEED_1G = 0x0002,
2212 FW_PORT_CAP_SPEED_2_5G = 0x0004,
2213 FW_PORT_CAP_SPEED_10G = 0x0008,
2214 FW_PORT_CAP_SPEED_40G = 0x0010,
2215 FW_PORT_CAP_SPEED_100G = 0x0020,
2216 FW_PORT_CAP_FC_RX = 0x0040,
2217 FW_PORT_CAP_FC_TX = 0x0080,
2218 FW_PORT_CAP_ANEG = 0x0100,
2219 FW_PORT_CAP_MDI_0 = 0x0200,
2220 FW_PORT_CAP_MDI_1 = 0x0400,
2221 FW_PORT_CAP_BEAN = 0x0800,
2222 FW_PORT_CAP_PMA_LPBK = 0x1000,
2223 FW_PORT_CAP_PCS_LPBK = 0x2000,
2224 FW_PORT_CAP_PHYXS_LPBK = 0x4000,
2225 FW_PORT_CAP_FAR_END_LPBK = 0x8000,
2226};
2227
2228enum fw_port_mdi {
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302229 FW_PORT_CAP_MDI_UNCHANGED,
2230 FW_PORT_CAP_MDI_AUTO,
2231 FW_PORT_CAP_MDI_F_STRAIGHT,
2232 FW_PORT_CAP_MDI_F_CROSSOVER
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002233};
2234
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302235#define FW_PORT_CAP_MDI_S 9
2236#define FW_PORT_CAP_MDI_V(x) ((x) << FW_PORT_CAP_MDI_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002237
2238enum fw_port_action {
2239 FW_PORT_ACTION_L1_CFG = 0x0001,
2240 FW_PORT_ACTION_L2_CFG = 0x0002,
2241 FW_PORT_ACTION_GET_PORT_INFO = 0x0003,
2242 FW_PORT_ACTION_L2_PPP_CFG = 0x0004,
2243 FW_PORT_ACTION_L2_DCB_CFG = 0x0005,
Anish Bhatt989594e2014-06-19 21:37:11 -07002244 FW_PORT_ACTION_DCB_READ_TRANS = 0x0006,
2245 FW_PORT_ACTION_DCB_READ_RECV = 0x0007,
2246 FW_PORT_ACTION_DCB_READ_DET = 0x0008,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002247 FW_PORT_ACTION_LOW_PWR_TO_NORMAL = 0x0010,
2248 FW_PORT_ACTION_L1_LOW_PWR_EN = 0x0011,
2249 FW_PORT_ACTION_L2_WOL_MODE_EN = 0x0012,
2250 FW_PORT_ACTION_LPBK_TO_NORMAL = 0x0020,
2251 FW_PORT_ACTION_L1_LPBK = 0x0021,
2252 FW_PORT_ACTION_L1_PMA_LPBK = 0x0022,
2253 FW_PORT_ACTION_L1_PCS_LPBK = 0x0023,
2254 FW_PORT_ACTION_L1_PHYXS_CSIDE_LPBK = 0x0024,
2255 FW_PORT_ACTION_L1_PHYXS_ESIDE_LPBK = 0x0025,
2256 FW_PORT_ACTION_PHY_RESET = 0x0040,
2257 FW_PORT_ACTION_PMA_RESET = 0x0041,
2258 FW_PORT_ACTION_PCS_RESET = 0x0042,
2259 FW_PORT_ACTION_PHYXS_RESET = 0x0043,
2260 FW_PORT_ACTION_DTEXS_REEST = 0x0044,
2261 FW_PORT_ACTION_AN_RESET = 0x0045
2262};
2263
2264enum fw_port_l2cfg_ctlbf {
2265 FW_PORT_L2_CTLBF_OVLAN0 = 0x01,
2266 FW_PORT_L2_CTLBF_OVLAN1 = 0x02,
2267 FW_PORT_L2_CTLBF_OVLAN2 = 0x04,
2268 FW_PORT_L2_CTLBF_OVLAN3 = 0x08,
2269 FW_PORT_L2_CTLBF_IVLAN = 0x10,
2270 FW_PORT_L2_CTLBF_TXIPG = 0x20
2271};
2272
Anish Bhatt10b00462014-08-07 16:14:03 -07002273enum fw_port_dcb_versions {
2274 FW_PORT_DCB_VER_UNKNOWN,
2275 FW_PORT_DCB_VER_CEE1D0,
2276 FW_PORT_DCB_VER_CEE1D01,
2277 FW_PORT_DCB_VER_IEEE,
2278 FW_PORT_DCB_VER_AUTO = 7
2279};
2280
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002281enum fw_port_dcb_cfg {
2282 FW_PORT_DCB_CFG_PG = 0x01,
2283 FW_PORT_DCB_CFG_PFC = 0x02,
2284 FW_PORT_DCB_CFG_APPL = 0x04
2285};
2286
2287enum fw_port_dcb_cfg_rc {
2288 FW_PORT_DCB_CFG_SUCCESS = 0x0,
2289 FW_PORT_DCB_CFG_ERROR = 0x1
2290};
2291
Naresh Kumar Innace91a922012-11-15 22:41:17 +05302292enum fw_port_dcb_type {
2293 FW_PORT_DCB_TYPE_PGID = 0x00,
2294 FW_PORT_DCB_TYPE_PGRATE = 0x01,
2295 FW_PORT_DCB_TYPE_PRIORATE = 0x02,
2296 FW_PORT_DCB_TYPE_PFC = 0x03,
2297 FW_PORT_DCB_TYPE_APP_ID = 0x04,
Anish Bhatt989594e2014-06-19 21:37:11 -07002298 FW_PORT_DCB_TYPE_CONTROL = 0x05,
2299};
2300
2301enum fw_port_dcb_feature_state {
2302 FW_PORT_DCB_FEATURE_STATE_PENDING = 0x0,
2303 FW_PORT_DCB_FEATURE_STATE_SUCCESS = 0x1,
2304 FW_PORT_DCB_FEATURE_STATE_ERROR = 0x2,
2305 FW_PORT_DCB_FEATURE_STATE_TIMEOUT = 0x3,
Naresh Kumar Innace91a922012-11-15 22:41:17 +05302306};
2307
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002308struct fw_port_cmd {
2309 __be32 op_to_portid;
2310 __be32 action_to_len16;
2311 union fw_port {
2312 struct fw_port_l1cfg {
2313 __be32 rcap;
2314 __be32 r;
2315 } l1cfg;
2316 struct fw_port_l2cfg {
Anish Bhatt989594e2014-06-19 21:37:11 -07002317 __u8 ctlbf;
2318 __u8 ovlan3_to_ivlan0;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002319 __be16 ivlantype;
Anish Bhatt989594e2014-06-19 21:37:11 -07002320 __be16 txipg_force_pinfo;
2321 __be16 mtu;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002322 __be16 ovlan0mask;
2323 __be16 ovlan0type;
2324 __be16 ovlan1mask;
2325 __be16 ovlan1type;
2326 __be16 ovlan2mask;
2327 __be16 ovlan2type;
2328 __be16 ovlan3mask;
2329 __be16 ovlan3type;
2330 } l2cfg;
2331 struct fw_port_info {
2332 __be32 lstatus_to_modtype;
2333 __be16 pcap;
2334 __be16 acap;
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00002335 __be16 mtu;
2336 __u8 cbllen;
Anish Bhatt989594e2014-06-19 21:37:11 -07002337 __u8 auxlinfo;
2338 __u8 dcbxdis_pkd;
2339 __u8 r8_lo[3];
2340 __be64 r9;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002341 } info;
Anish Bhatt989594e2014-06-19 21:37:11 -07002342 struct fw_port_diags {
2343 __u8 diagop;
2344 __u8 r[3];
2345 __be32 diagval;
2346 } diags;
2347 union fw_port_dcb {
2348 struct fw_port_dcb_pgid {
2349 __u8 type;
2350 __u8 apply_pkd;
2351 __u8 r10_lo[2];
2352 __be32 pgid;
2353 __be64 r11;
2354 } pgid;
2355 struct fw_port_dcb_pgrate {
2356 __u8 type;
2357 __u8 apply_pkd;
2358 __u8 r10_lo[5];
2359 __u8 num_tcs_supported;
2360 __u8 pgrate[8];
Anish Bhatt10b00462014-08-07 16:14:03 -07002361 __u8 tsa[8];
Anish Bhatt989594e2014-06-19 21:37:11 -07002362 } pgrate;
2363 struct fw_port_dcb_priorate {
2364 __u8 type;
2365 __u8 apply_pkd;
2366 __u8 r10_lo[6];
2367 __u8 strict_priorate[8];
2368 } priorate;
2369 struct fw_port_dcb_pfc {
2370 __u8 type;
2371 __u8 pfcen;
2372 __u8 r10[5];
2373 __u8 max_pfc_tcs;
2374 __be64 r11;
2375 } pfc;
2376 struct fw_port_app_priority {
2377 __u8 type;
2378 __u8 r10[2];
2379 __u8 idx;
2380 __u8 user_prio_map;
2381 __u8 sel_field;
2382 __be16 protocolid;
2383 __be64 r12;
2384 } app_priority;
2385 struct fw_port_dcb_control {
2386 __u8 type;
2387 __u8 all_syncd_pkd;
Anish Bhatt10b00462014-08-07 16:14:03 -07002388 __be16 dcb_version_to_app_state;
Anish Bhatt989594e2014-06-19 21:37:11 -07002389 __be32 r11;
2390 __be64 r12;
2391 } control;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002392 } dcb;
2393 } u;
2394};
2395
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302396#define FW_PORT_CMD_READ_S 22
2397#define FW_PORT_CMD_READ_V(x) ((x) << FW_PORT_CMD_READ_S)
2398#define FW_PORT_CMD_READ_F FW_PORT_CMD_READ_V(1U)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002399
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302400#define FW_PORT_CMD_PORTID_S 0
2401#define FW_PORT_CMD_PORTID_M 0xf
2402#define FW_PORT_CMD_PORTID_V(x) ((x) << FW_PORT_CMD_PORTID_S)
2403#define FW_PORT_CMD_PORTID_G(x) \
2404 (((x) >> FW_PORT_CMD_PORTID_S) & FW_PORT_CMD_PORTID_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002405
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302406#define FW_PORT_CMD_ACTION_S 16
2407#define FW_PORT_CMD_ACTION_M 0xffff
2408#define FW_PORT_CMD_ACTION_V(x) ((x) << FW_PORT_CMD_ACTION_S)
2409#define FW_PORT_CMD_ACTION_G(x) \
2410 (((x) >> FW_PORT_CMD_ACTION_S) & FW_PORT_CMD_ACTION_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002411
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302412#define FW_PORT_CMD_OVLAN3_S 7
2413#define FW_PORT_CMD_OVLAN3_V(x) ((x) << FW_PORT_CMD_OVLAN3_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002414
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302415#define FW_PORT_CMD_OVLAN2_S 6
2416#define FW_PORT_CMD_OVLAN2_V(x) ((x) << FW_PORT_CMD_OVLAN2_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002417
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302418#define FW_PORT_CMD_OVLAN1_S 5
2419#define FW_PORT_CMD_OVLAN1_V(x) ((x) << FW_PORT_CMD_OVLAN1_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002420
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302421#define FW_PORT_CMD_OVLAN0_S 4
2422#define FW_PORT_CMD_OVLAN0_V(x) ((x) << FW_PORT_CMD_OVLAN0_S)
Anish Bhatt989594e2014-06-19 21:37:11 -07002423
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302424#define FW_PORT_CMD_IVLAN0_S 3
2425#define FW_PORT_CMD_IVLAN0_V(x) ((x) << FW_PORT_CMD_IVLAN0_S)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002426
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302427#define FW_PORT_CMD_TXIPG_S 3
2428#define FW_PORT_CMD_TXIPG_V(x) ((x) << FW_PORT_CMD_TXIPG_S)
2429
2430#define FW_PORT_CMD_LSTATUS_S 31
2431#define FW_PORT_CMD_LSTATUS_M 0x1
2432#define FW_PORT_CMD_LSTATUS_V(x) ((x) << FW_PORT_CMD_LSTATUS_S)
2433#define FW_PORT_CMD_LSTATUS_G(x) \
2434 (((x) >> FW_PORT_CMD_LSTATUS_S) & FW_PORT_CMD_LSTATUS_M)
2435#define FW_PORT_CMD_LSTATUS_F FW_PORT_CMD_LSTATUS_V(1U)
2436
2437#define FW_PORT_CMD_LSPEED_S 24
2438#define FW_PORT_CMD_LSPEED_M 0x3f
2439#define FW_PORT_CMD_LSPEED_V(x) ((x) << FW_PORT_CMD_LSPEED_S)
2440#define FW_PORT_CMD_LSPEED_G(x) \
2441 (((x) >> FW_PORT_CMD_LSPEED_S) & FW_PORT_CMD_LSPEED_M)
2442
2443#define FW_PORT_CMD_TXPAUSE_S 23
2444#define FW_PORT_CMD_TXPAUSE_V(x) ((x) << FW_PORT_CMD_TXPAUSE_S)
2445#define FW_PORT_CMD_TXPAUSE_F FW_PORT_CMD_TXPAUSE_V(1U)
2446
2447#define FW_PORT_CMD_RXPAUSE_S 22
2448#define FW_PORT_CMD_RXPAUSE_V(x) ((x) << FW_PORT_CMD_RXPAUSE_S)
2449#define FW_PORT_CMD_RXPAUSE_F FW_PORT_CMD_RXPAUSE_V(1U)
2450
2451#define FW_PORT_CMD_MDIOCAP_S 21
2452#define FW_PORT_CMD_MDIOCAP_V(x) ((x) << FW_PORT_CMD_MDIOCAP_S)
2453#define FW_PORT_CMD_MDIOCAP_F FW_PORT_CMD_MDIOCAP_V(1U)
2454
2455#define FW_PORT_CMD_MDIOADDR_S 16
2456#define FW_PORT_CMD_MDIOADDR_M 0x1f
2457#define FW_PORT_CMD_MDIOADDR_G(x) \
2458 (((x) >> FW_PORT_CMD_MDIOADDR_S) & FW_PORT_CMD_MDIOADDR_M)
2459
2460#define FW_PORT_CMD_LPTXPAUSE_S 15
2461#define FW_PORT_CMD_LPTXPAUSE_V(x) ((x) << FW_PORT_CMD_LPTXPAUSE_S)
2462#define FW_PORT_CMD_LPTXPAUSE_F FW_PORT_CMD_LPTXPAUSE_V(1U)
2463
2464#define FW_PORT_CMD_LPRXPAUSE_S 14
2465#define FW_PORT_CMD_LPRXPAUSE_V(x) ((x) << FW_PORT_CMD_LPRXPAUSE_S)
2466#define FW_PORT_CMD_LPRXPAUSE_F FW_PORT_CMD_LPRXPAUSE_V(1U)
2467
2468#define FW_PORT_CMD_PTYPE_S 8
2469#define FW_PORT_CMD_PTYPE_M 0x1f
2470#define FW_PORT_CMD_PTYPE_G(x) \
2471 (((x) >> FW_PORT_CMD_PTYPE_S) & FW_PORT_CMD_PTYPE_M)
2472
2473#define FW_PORT_CMD_MODTYPE_S 0
2474#define FW_PORT_CMD_MODTYPE_M 0x1f
2475#define FW_PORT_CMD_MODTYPE_V(x) ((x) << FW_PORT_CMD_MODTYPE_S)
2476#define FW_PORT_CMD_MODTYPE_G(x) \
2477 (((x) >> FW_PORT_CMD_MODTYPE_S) & FW_PORT_CMD_MODTYPE_M)
2478
2479#define FW_PORT_CMD_DCBXDIS_S 7
2480#define FW_PORT_CMD_DCBXDIS_V(x) ((x) << FW_PORT_CMD_DCBXDIS_S)
2481#define FW_PORT_CMD_DCBXDIS_F FW_PORT_CMD_DCBXDIS_V(1U)
2482
2483#define FW_PORT_CMD_APPLY_S 7
2484#define FW_PORT_CMD_APPLY_V(x) ((x) << FW_PORT_CMD_APPLY_S)
2485#define FW_PORT_CMD_APPLY_F FW_PORT_CMD_APPLY_V(1U)
2486
2487#define FW_PORT_CMD_ALL_SYNCD_S 7
2488#define FW_PORT_CMD_ALL_SYNCD_V(x) ((x) << FW_PORT_CMD_ALL_SYNCD_S)
2489#define FW_PORT_CMD_ALL_SYNCD_F FW_PORT_CMD_ALL_SYNCD_V(1U)
2490
2491#define FW_PORT_CMD_DCB_VERSION_S 12
2492#define FW_PORT_CMD_DCB_VERSION_M 0x7
2493#define FW_PORT_CMD_DCB_VERSION_G(x) \
2494 (((x) >> FW_PORT_CMD_DCB_VERSION_S) & FW_PORT_CMD_DCB_VERSION_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002495
2496enum fw_port_type {
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00002497 FW_PORT_TYPE_FIBER_XFI,
2498 FW_PORT_TYPE_FIBER_XAUI,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002499 FW_PORT_TYPE_BT_SGMII,
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00002500 FW_PORT_TYPE_BT_XFI,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002501 FW_PORT_TYPE_BT_XAUI,
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00002502 FW_PORT_TYPE_KX4,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002503 FW_PORT_TYPE_CX4,
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00002504 FW_PORT_TYPE_KX,
2505 FW_PORT_TYPE_KR,
2506 FW_PORT_TYPE_SFP,
2507 FW_PORT_TYPE_BP_AP,
Dimitris Michailidis7d5e77a2010-12-14 21:36:47 +00002508 FW_PORT_TYPE_BP4_AP,
Kumar Sanghvi72aca4b2014-02-18 17:56:08 +05302509 FW_PORT_TYPE_QSFP_10G,
Hariprasad Shenai40e9de42014-12-12 12:07:57 +05302510 FW_PORT_TYPE_QSA,
Hariprasad Shenai5aa80e52014-12-17 17:36:00 +05302511 FW_PORT_TYPE_QSFP,
Kumar Sanghvi72aca4b2014-02-18 17:56:08 +05302512 FW_PORT_TYPE_BP40_BA,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002513
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302514 FW_PORT_TYPE_NONE = FW_PORT_CMD_PTYPE_M
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002515};
2516
2517enum fw_port_module_type {
2518 FW_PORT_MOD_TYPE_NA,
2519 FW_PORT_MOD_TYPE_LR,
2520 FW_PORT_MOD_TYPE_SR,
2521 FW_PORT_MOD_TYPE_ER,
Dimitris Michailidisa0881ca2010-06-18 10:05:34 +00002522 FW_PORT_MOD_TYPE_TWINAX_PASSIVE,
2523 FW_PORT_MOD_TYPE_TWINAX_ACTIVE,
2524 FW_PORT_MOD_TYPE_LRM,
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302525 FW_PORT_MOD_TYPE_ERROR = FW_PORT_CMD_MODTYPE_M - 3,
2526 FW_PORT_MOD_TYPE_UNKNOWN = FW_PORT_CMD_MODTYPE_M - 2,
2527 FW_PORT_MOD_TYPE_NOTSUPPORTED = FW_PORT_CMD_MODTYPE_M - 1,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002528
Hariprasad Shenai2b5fb1f2014-11-21 12:52:04 +05302529 FW_PORT_MOD_TYPE_NONE = FW_PORT_CMD_MODTYPE_M
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002530};
2531
Vipul Pandyab407a4a2013-04-29 04:04:40 +00002532enum fw_port_mod_sub_type {
2533 FW_PORT_MOD_SUB_TYPE_NA,
2534 FW_PORT_MOD_SUB_TYPE_MV88E114X = 0x1,
2535 FW_PORT_MOD_SUB_TYPE_TN8022 = 0x2,
2536 FW_PORT_MOD_SUB_TYPE_AQ1202 = 0x3,
2537 FW_PORT_MOD_SUB_TYPE_88x3120 = 0x4,
2538 FW_PORT_MOD_SUB_TYPE_BCM84834 = 0x5,
2539 FW_PORT_MOD_SUB_TYPE_BT_VSC8634 = 0x8,
2540
2541 /* The following will never been in the VPD. They are TWINAX cable
2542 * lengths decoded from SFP+ module i2c PROMs. These should
2543 * almost certainly go somewhere else ...
2544 */
2545 FW_PORT_MOD_SUB_TYPE_TWINAX_1 = 0x9,
2546 FW_PORT_MOD_SUB_TYPE_TWINAX_3 = 0xA,
2547 FW_PORT_MOD_SUB_TYPE_TWINAX_5 = 0xB,
2548 FW_PORT_MOD_SUB_TYPE_TWINAX_7 = 0xC,
2549};
2550
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002551enum fw_port_stats_tx_index {
Hariprasad Shenai3ccc6cf2015-06-02 13:59:39 +05302552 FW_STAT_TX_PORT_BYTES_IX = 0,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002553 FW_STAT_TX_PORT_FRAMES_IX,
2554 FW_STAT_TX_PORT_BCAST_IX,
2555 FW_STAT_TX_PORT_MCAST_IX,
2556 FW_STAT_TX_PORT_UCAST_IX,
2557 FW_STAT_TX_PORT_ERROR_IX,
2558 FW_STAT_TX_PORT_64B_IX,
2559 FW_STAT_TX_PORT_65B_127B_IX,
2560 FW_STAT_TX_PORT_128B_255B_IX,
2561 FW_STAT_TX_PORT_256B_511B_IX,
2562 FW_STAT_TX_PORT_512B_1023B_IX,
2563 FW_STAT_TX_PORT_1024B_1518B_IX,
2564 FW_STAT_TX_PORT_1519B_MAX_IX,
2565 FW_STAT_TX_PORT_DROP_IX,
2566 FW_STAT_TX_PORT_PAUSE_IX,
2567 FW_STAT_TX_PORT_PPP0_IX,
2568 FW_STAT_TX_PORT_PPP1_IX,
2569 FW_STAT_TX_PORT_PPP2_IX,
2570 FW_STAT_TX_PORT_PPP3_IX,
2571 FW_STAT_TX_PORT_PPP4_IX,
2572 FW_STAT_TX_PORT_PPP5_IX,
2573 FW_STAT_TX_PORT_PPP6_IX,
Hariprasad Shenai3ccc6cf2015-06-02 13:59:39 +05302574 FW_STAT_TX_PORT_PPP7_IX,
2575 FW_NUM_PORT_TX_STATS
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002576};
2577
2578enum fw_port_stat_rx_index {
Hariprasad Shenai3ccc6cf2015-06-02 13:59:39 +05302579 FW_STAT_RX_PORT_BYTES_IX = 0,
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002580 FW_STAT_RX_PORT_FRAMES_IX,
2581 FW_STAT_RX_PORT_BCAST_IX,
2582 FW_STAT_RX_PORT_MCAST_IX,
2583 FW_STAT_RX_PORT_UCAST_IX,
2584 FW_STAT_RX_PORT_MTU_ERROR_IX,
2585 FW_STAT_RX_PORT_MTU_CRC_ERROR_IX,
2586 FW_STAT_RX_PORT_CRC_ERROR_IX,
2587 FW_STAT_RX_PORT_LEN_ERROR_IX,
2588 FW_STAT_RX_PORT_SYM_ERROR_IX,
2589 FW_STAT_RX_PORT_64B_IX,
2590 FW_STAT_RX_PORT_65B_127B_IX,
2591 FW_STAT_RX_PORT_128B_255B_IX,
2592 FW_STAT_RX_PORT_256B_511B_IX,
2593 FW_STAT_RX_PORT_512B_1023B_IX,
2594 FW_STAT_RX_PORT_1024B_1518B_IX,
2595 FW_STAT_RX_PORT_1519B_MAX_IX,
2596 FW_STAT_RX_PORT_PAUSE_IX,
2597 FW_STAT_RX_PORT_PPP0_IX,
2598 FW_STAT_RX_PORT_PPP1_IX,
2599 FW_STAT_RX_PORT_PPP2_IX,
2600 FW_STAT_RX_PORT_PPP3_IX,
2601 FW_STAT_RX_PORT_PPP4_IX,
2602 FW_STAT_RX_PORT_PPP5_IX,
2603 FW_STAT_RX_PORT_PPP6_IX,
2604 FW_STAT_RX_PORT_PPP7_IX,
Hariprasad Shenai3ccc6cf2015-06-02 13:59:39 +05302605 FW_STAT_RX_PORT_LESS_64B_IX,
2606 FW_STAT_RX_PORT_MAC_ERROR_IX,
2607 FW_NUM_PORT_RX_STATS
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002608};
2609
Hariprasad Shenai3ccc6cf2015-06-02 13:59:39 +05302610/* port stats */
2611#define FW_NUM_PORT_STATS (FW_NUM_PORT_TX_STATS + FW_NUM_PORT_RX_STATS)
2612
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002613struct fw_port_stats_cmd {
2614 __be32 op_to_portid;
2615 __be32 retval_len16;
2616 union fw_port_stats {
2617 struct fw_port_stats_ctl {
2618 u8 nstats_bg_bm;
2619 u8 tx_ix;
2620 __be16 r6;
2621 __be32 r7;
2622 __be64 stat0;
2623 __be64 stat1;
2624 __be64 stat2;
2625 __be64 stat3;
2626 __be64 stat4;
2627 __be64 stat5;
2628 } ctl;
2629 struct fw_port_stats_all {
2630 __be64 tx_bytes;
2631 __be64 tx_frames;
2632 __be64 tx_bcast;
2633 __be64 tx_mcast;
2634 __be64 tx_ucast;
2635 __be64 tx_error;
2636 __be64 tx_64b;
2637 __be64 tx_65b_127b;
2638 __be64 tx_128b_255b;
2639 __be64 tx_256b_511b;
2640 __be64 tx_512b_1023b;
2641 __be64 tx_1024b_1518b;
2642 __be64 tx_1519b_max;
2643 __be64 tx_drop;
2644 __be64 tx_pause;
2645 __be64 tx_ppp0;
2646 __be64 tx_ppp1;
2647 __be64 tx_ppp2;
2648 __be64 tx_ppp3;
2649 __be64 tx_ppp4;
2650 __be64 tx_ppp5;
2651 __be64 tx_ppp6;
2652 __be64 tx_ppp7;
2653 __be64 rx_bytes;
2654 __be64 rx_frames;
2655 __be64 rx_bcast;
2656 __be64 rx_mcast;
2657 __be64 rx_ucast;
2658 __be64 rx_mtu_error;
2659 __be64 rx_mtu_crc_error;
2660 __be64 rx_crc_error;
2661 __be64 rx_len_error;
2662 __be64 rx_sym_error;
2663 __be64 rx_64b;
2664 __be64 rx_65b_127b;
2665 __be64 rx_128b_255b;
2666 __be64 rx_256b_511b;
2667 __be64 rx_512b_1023b;
2668 __be64 rx_1024b_1518b;
2669 __be64 rx_1519b_max;
2670 __be64 rx_pause;
2671 __be64 rx_ppp0;
2672 __be64 rx_ppp1;
2673 __be64 rx_ppp2;
2674 __be64 rx_ppp3;
2675 __be64 rx_ppp4;
2676 __be64 rx_ppp5;
2677 __be64 rx_ppp6;
2678 __be64 rx_ppp7;
2679 __be64 rx_less_64b;
2680 __be64 rx_bg_drop;
2681 __be64 rx_bg_trunc;
2682 } all;
2683 } u;
2684};
2685
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002686/* port loopback stats */
2687#define FW_NUM_LB_STATS 16
2688enum fw_port_lb_stats_index {
2689 FW_STAT_LB_PORT_BYTES_IX,
2690 FW_STAT_LB_PORT_FRAMES_IX,
2691 FW_STAT_LB_PORT_BCAST_IX,
2692 FW_STAT_LB_PORT_MCAST_IX,
2693 FW_STAT_LB_PORT_UCAST_IX,
2694 FW_STAT_LB_PORT_ERROR_IX,
2695 FW_STAT_LB_PORT_64B_IX,
2696 FW_STAT_LB_PORT_65B_127B_IX,
2697 FW_STAT_LB_PORT_128B_255B_IX,
2698 FW_STAT_LB_PORT_256B_511B_IX,
2699 FW_STAT_LB_PORT_512B_1023B_IX,
2700 FW_STAT_LB_PORT_1024B_1518B_IX,
2701 FW_STAT_LB_PORT_1519B_MAX_IX,
2702 FW_STAT_LB_PORT_DROP_FRAMES_IX
2703};
2704
2705struct fw_port_lb_stats_cmd {
2706 __be32 op_to_lbport;
2707 __be32 retval_len16;
2708 union fw_port_lb_stats {
2709 struct fw_port_lb_stats_ctl {
2710 u8 nstats_bg_bm;
2711 u8 ix_pkd;
2712 __be16 r6;
2713 __be32 r7;
2714 __be64 stat0;
2715 __be64 stat1;
2716 __be64 stat2;
2717 __be64 stat3;
2718 __be64 stat4;
2719 __be64 stat5;
2720 } ctl;
2721 struct fw_port_lb_stats_all {
2722 __be64 tx_bytes;
2723 __be64 tx_frames;
2724 __be64 tx_bcast;
2725 __be64 tx_mcast;
2726 __be64 tx_ucast;
2727 __be64 tx_error;
2728 __be64 tx_64b;
2729 __be64 tx_65b_127b;
2730 __be64 tx_128b_255b;
2731 __be64 tx_256b_511b;
2732 __be64 tx_512b_1023b;
2733 __be64 tx_1024b_1518b;
2734 __be64 tx_1519b_max;
2735 __be64 rx_lb_drop;
2736 __be64 rx_lb_trunc;
2737 } all;
2738 } u;
2739};
2740
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002741struct fw_rss_ind_tbl_cmd {
2742 __be32 op_to_viid;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002743 __be32 retval_len16;
2744 __be16 niqid;
2745 __be16 startidx;
2746 __be32 r3;
2747 __be32 iq0_to_iq2;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002748 __be32 iq3_to_iq5;
2749 __be32 iq6_to_iq8;
2750 __be32 iq9_to_iq11;
2751 __be32 iq12_to_iq14;
2752 __be32 iq15_to_iq17;
2753 __be32 iq18_to_iq20;
2754 __be32 iq21_to_iq23;
2755 __be32 iq24_to_iq26;
2756 __be32 iq27_to_iq29;
2757 __be32 iq30_iq31;
2758 __be32 r15_lo;
2759};
2760
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05302761#define FW_RSS_IND_TBL_CMD_VIID_S 0
2762#define FW_RSS_IND_TBL_CMD_VIID_V(x) ((x) << FW_RSS_IND_TBL_CMD_VIID_S)
2763
2764#define FW_RSS_IND_TBL_CMD_IQ0_S 20
2765#define FW_RSS_IND_TBL_CMD_IQ0_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ0_S)
2766
2767#define FW_RSS_IND_TBL_CMD_IQ1_S 10
2768#define FW_RSS_IND_TBL_CMD_IQ1_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ1_S)
2769
2770#define FW_RSS_IND_TBL_CMD_IQ2_S 0
2771#define FW_RSS_IND_TBL_CMD_IQ2_V(x) ((x) << FW_RSS_IND_TBL_CMD_IQ2_S)
2772
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002773struct fw_rss_glb_config_cmd {
2774 __be32 op_to_write;
2775 __be32 retval_len16;
2776 union fw_rss_glb_config {
2777 struct fw_rss_glb_config_manual {
2778 __be32 mode_pkd;
2779 __be32 r3;
2780 __be64 r4;
2781 __be64 r5;
2782 } manual;
2783 struct fw_rss_glb_config_basicvirtual {
2784 __be32 mode_pkd;
2785 __be32 synmapen_to_hashtoeplitz;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002786 __be64 r8;
2787 __be64 r9;
2788 } basicvirtual;
2789 } u;
2790};
2791
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05302792#define FW_RSS_GLB_CONFIG_CMD_MODE_S 28
2793#define FW_RSS_GLB_CONFIG_CMD_MODE_M 0xf
2794#define FW_RSS_GLB_CONFIG_CMD_MODE_V(x) ((x) << FW_RSS_GLB_CONFIG_CMD_MODE_S)
2795#define FW_RSS_GLB_CONFIG_CMD_MODE_G(x) \
2796 (((x) >> FW_RSS_GLB_CONFIG_CMD_MODE_S) & FW_RSS_GLB_CONFIG_CMD_MODE_M)
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002797
2798#define FW_RSS_GLB_CONFIG_CMD_MODE_MANUAL 0
2799#define FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL 1
2800
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05302801#define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S 8
2802#define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(x) \
2803 ((x) << FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S)
2804#define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_F \
2805 FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(1U)
2806
2807#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S 7
2808#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(x) \
2809 ((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S)
2810#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_F \
2811 FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(1U)
2812
2813#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S 6
2814#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(x) \
2815 ((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S)
2816#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_F \
2817 FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(1U)
2818
2819#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S 5
2820#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(x) \
2821 ((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S)
2822#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_F \
2823 FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(1U)
2824
2825#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S 4
2826#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(x) \
2827 ((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S)
2828#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_F \
2829 FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(1U)
2830
2831#define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S 3
2832#define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(x) \
2833 ((x) << FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S)
2834#define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_F \
2835 FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(1U)
2836
2837#define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S 2
2838#define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(x) \
2839 ((x) << FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S)
2840#define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_F \
2841 FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(1U)
2842
2843#define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S 1
2844#define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(x) \
2845 ((x) << FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S)
2846#define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_F \
2847 FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(1U)
2848
2849#define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S 0
2850#define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(x) \
2851 ((x) << FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S)
2852#define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_F \
2853 FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(1U)
2854
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002855struct fw_rss_vi_config_cmd {
2856 __be32 op_to_viid;
2857#define FW_RSS_VI_CONFIG_CMD_VIID(x) ((x) << 0)
2858 __be32 retval_len16;
2859 union fw_rss_vi_config {
2860 struct fw_rss_vi_config_manual {
2861 __be64 r3;
2862 __be64 r4;
2863 __be64 r5;
2864 } manual;
2865 struct fw_rss_vi_config_basicvirtual {
2866 __be32 r6;
Casey Leedom81323b72010-06-25 12:10:32 +00002867 __be32 defaultq_to_udpen;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002868 __be64 r9;
2869 __be64 r10;
2870 } basicvirtual;
2871 } u;
2872};
2873
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05302874#define FW_RSS_VI_CONFIG_CMD_VIID_S 0
2875#define FW_RSS_VI_CONFIG_CMD_VIID_V(x) ((x) << FW_RSS_VI_CONFIG_CMD_VIID_S)
2876
2877#define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S 16
2878#define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M 0x3ff
2879#define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_V(x) \
2880 ((x) << FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S)
2881#define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_G(x) \
2882 (((x) >> FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S) & \
2883 FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M)
2884
2885#define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S 4
2886#define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(x) \
2887 ((x) << FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S)
2888#define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F \
2889 FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(1U)
2890
2891#define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S 3
2892#define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(x) \
2893 ((x) << FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S)
2894#define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F \
2895 FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(1U)
2896
2897#define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S 2
2898#define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(x) \
2899 ((x) << FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S)
2900#define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F \
2901 FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(1U)
2902
2903#define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S 1
2904#define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(x) \
2905 ((x) << FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S)
2906#define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F \
2907 FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(1U)
2908
2909#define FW_RSS_VI_CONFIG_CMD_UDPEN_S 0
2910#define FW_RSS_VI_CONFIG_CMD_UDPEN_V(x) ((x) << FW_RSS_VI_CONFIG_CMD_UDPEN_S)
2911#define FW_RSS_VI_CONFIG_CMD_UDPEN_F FW_RSS_VI_CONFIG_CMD_UDPEN_V(1U)
2912
Vipul Pandya01bcca62013-07-04 16:10:46 +05302913struct fw_clip_cmd {
2914 __be32 op_to_write;
2915 __be32 alloc_to_len16;
2916 __be64 ip_hi;
2917 __be64 ip_lo;
2918 __be32 r4[2];
2919};
2920
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05302921#define FW_CLIP_CMD_ALLOC_S 31
2922#define FW_CLIP_CMD_ALLOC_V(x) ((x) << FW_CLIP_CMD_ALLOC_S)
2923#define FW_CLIP_CMD_ALLOC_F FW_CLIP_CMD_ALLOC_V(1U)
Vipul Pandya01bcca62013-07-04 16:10:46 +05302924
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05302925#define FW_CLIP_CMD_FREE_S 30
2926#define FW_CLIP_CMD_FREE_V(x) ((x) << FW_CLIP_CMD_FREE_S)
2927#define FW_CLIP_CMD_FREE_F FW_CLIP_CMD_FREE_V(1U)
Vipul Pandya01bcca62013-07-04 16:10:46 +05302928
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002929enum fw_error_type {
2930 FW_ERROR_TYPE_EXCEPTION = 0x0,
2931 FW_ERROR_TYPE_HWMODULE = 0x1,
2932 FW_ERROR_TYPE_WR = 0x2,
2933 FW_ERROR_TYPE_ACL = 0x3,
2934};
2935
2936struct fw_error_cmd {
2937 __be32 op_to_type;
2938 __be32 len16_pkd;
2939 union fw_error {
2940 struct fw_error_exception {
2941 __be32 info[6];
2942 } exception;
2943 struct fw_error_hwmodule {
2944 __be32 regaddr;
2945 __be32 regval;
2946 } hwmodule;
2947 struct fw_error_wr {
2948 __be16 cidx;
2949 __be16 pfn_vfn;
2950 __be32 eqid;
2951 u8 wrhdr[16];
2952 } wr;
2953 struct fw_error_acl {
2954 __be16 cidx;
2955 __be16 pfn_vfn;
2956 __be32 eqid;
2957 __be16 mv_pkd;
2958 u8 val[6];
2959 __be64 r4;
2960 } acl;
2961 } u;
2962};
2963
2964struct fw_debug_cmd {
2965 __be32 op_type;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00002966 __be32 len16_pkd;
2967 union fw_debug {
2968 struct fw_debug_assert {
2969 __be32 fcid;
2970 __be32 line;
2971 __be32 x;
2972 __be32 y;
2973 u8 filename_0_7[8];
2974 u8 filename_8_15[8];
2975 __be64 r3;
2976 } assert;
2977 struct fw_debug_prt {
2978 __be16 dprtstridx;
2979 __be16 r3[3];
2980 __be32 dprtstrparam0;
2981 __be32 dprtstrparam1;
2982 __be32 dprtstrparam2;
2983 __be32 dprtstrparam3;
2984 } prt;
2985 } u;
2986};
2987
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05302988#define FW_DEBUG_CMD_TYPE_S 0
2989#define FW_DEBUG_CMD_TYPE_M 0xff
2990#define FW_DEBUG_CMD_TYPE_G(x) \
2991 (((x) >> FW_DEBUG_CMD_TYPE_S) & FW_DEBUG_CMD_TYPE_M)
2992
2993#define PCIE_FW_ERR_S 31
2994#define PCIE_FW_ERR_V(x) ((x) << PCIE_FW_ERR_S)
2995#define PCIE_FW_ERR_F PCIE_FW_ERR_V(1U)
2996
2997#define PCIE_FW_INIT_S 30
2998#define PCIE_FW_INIT_V(x) ((x) << PCIE_FW_INIT_S)
2999#define PCIE_FW_INIT_F PCIE_FW_INIT_V(1U)
3000
3001#define PCIE_FW_HALT_S 29
3002#define PCIE_FW_HALT_V(x) ((x) << PCIE_FW_HALT_S)
3003#define PCIE_FW_HALT_F PCIE_FW_HALT_V(1U)
3004
3005#define PCIE_FW_EVAL_S 24
3006#define PCIE_FW_EVAL_M 0x7
3007#define PCIE_FW_EVAL_G(x) (((x) >> PCIE_FW_EVAL_S) & PCIE_FW_EVAL_M)
3008
3009#define PCIE_FW_MASTER_VLD_S 15
3010#define PCIE_FW_MASTER_VLD_V(x) ((x) << PCIE_FW_MASTER_VLD_S)
3011#define PCIE_FW_MASTER_VLD_F PCIE_FW_MASTER_VLD_V(1U)
3012
3013#define PCIE_FW_MASTER_S 12
3014#define PCIE_FW_MASTER_M 0x7
3015#define PCIE_FW_MASTER_V(x) ((x) << PCIE_FW_MASTER_S)
3016#define PCIE_FW_MASTER_G(x) (((x) >> PCIE_FW_MASTER_S) & PCIE_FW_MASTER_M)
Vipul Pandya52367a72012-09-26 02:39:38 +00003017
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00003018struct fw_hdr {
3019 u8 ver;
Hariprasad Shenai16e47622013-12-03 17:05:58 +05303020 u8 chip; /* terminator chip type */
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00003021 __be16 len512; /* bin length in units of 512-bytes */
3022 __be32 fw_ver; /* firmware version */
3023 __be32 tp_microcode_ver;
3024 u8 intfver_nic;
3025 u8 intfver_vnic;
3026 u8 intfver_ofld;
3027 u8 intfver_ri;
3028 u8 intfver_iscsipdu;
3029 u8 intfver_iscsi;
Vipul Pandyab407a4a2013-04-29 04:04:40 +00003030 u8 intfver_fcoepdu;
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00003031 u8 intfver_fcoe;
Vipul Pandyab407a4a2013-04-29 04:04:40 +00003032 __u32 reserved2;
Vipul Pandya26f7cbc2012-09-26 02:39:42 +00003033 __u32 reserved3;
3034 __u32 reserved4;
Vipul Pandya26f7cbc2012-09-26 02:39:42 +00003035 __be32 flags;
3036 __be32 reserved6[23];
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00003037};
3038
Hariprasad Shenai16e47622013-12-03 17:05:58 +05303039enum fw_hdr_chip {
3040 FW_HDR_CHIP_T4,
Hariprasad Shenai3ccc6cf2015-06-02 13:59:39 +05303041 FW_HDR_CHIP_T5,
3042 FW_HDR_CHIP_T6
Hariprasad Shenai16e47622013-12-03 17:05:58 +05303043};
3044
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05303045#define FW_HDR_FW_VER_MAJOR_S 24
3046#define FW_HDR_FW_VER_MAJOR_M 0xff
Hariprasad Shenaiba3f8cd2015-02-09 12:07:30 +05303047#define FW_HDR_FW_VER_MAJOR_V(x) \
3048 ((x) << FW_HDR_FW_VER_MAJOR_S)
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05303049#define FW_HDR_FW_VER_MAJOR_G(x) \
3050 (((x) >> FW_HDR_FW_VER_MAJOR_S) & FW_HDR_FW_VER_MAJOR_M)
3051
3052#define FW_HDR_FW_VER_MINOR_S 16
3053#define FW_HDR_FW_VER_MINOR_M 0xff
Hariprasad Shenaiba3f8cd2015-02-09 12:07:30 +05303054#define FW_HDR_FW_VER_MINOR_V(x) \
3055 ((x) << FW_HDR_FW_VER_MINOR_S)
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05303056#define FW_HDR_FW_VER_MINOR_G(x) \
3057 (((x) >> FW_HDR_FW_VER_MINOR_S) & FW_HDR_FW_VER_MINOR_M)
3058
3059#define FW_HDR_FW_VER_MICRO_S 8
3060#define FW_HDR_FW_VER_MICRO_M 0xff
Hariprasad Shenaiba3f8cd2015-02-09 12:07:30 +05303061#define FW_HDR_FW_VER_MICRO_V(x) \
3062 ((x) << FW_HDR_FW_VER_MICRO_S)
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05303063#define FW_HDR_FW_VER_MICRO_G(x) \
3064 (((x) >> FW_HDR_FW_VER_MICRO_S) & FW_HDR_FW_VER_MICRO_M)
3065
3066#define FW_HDR_FW_VER_BUILD_S 0
3067#define FW_HDR_FW_VER_BUILD_M 0xff
Hariprasad Shenaiba3f8cd2015-02-09 12:07:30 +05303068#define FW_HDR_FW_VER_BUILD_V(x) \
3069 ((x) << FW_HDR_FW_VER_BUILD_S)
Hariprasad Shenaib2e1a3f2014-11-21 12:52:05 +05303070#define FW_HDR_FW_VER_BUILD_G(x) \
3071 (((x) >> FW_HDR_FW_VER_BUILD_S) & FW_HDR_FW_VER_BUILD_M)
Vipul Pandya3069ee9b2012-05-18 15:29:26 +05303072
Vipul Pandyab407a4a2013-04-29 04:04:40 +00003073enum fw_hdr_intfver {
3074 FW_HDR_INTFVER_NIC = 0x00,
3075 FW_HDR_INTFVER_VNIC = 0x00,
3076 FW_HDR_INTFVER_OFLD = 0x00,
3077 FW_HDR_INTFVER_RI = 0x00,
3078 FW_HDR_INTFVER_ISCSIPDU = 0x00,
3079 FW_HDR_INTFVER_ISCSI = 0x00,
3080 FW_HDR_INTFVER_FCOEPDU = 0x00,
3081 FW_HDR_INTFVER_FCOE = 0x00,
3082};
3083
Vipul Pandya26f7cbc2012-09-26 02:39:42 +00003084enum fw_hdr_flags {
3085 FW_HDR_FLAGS_RESET_HALT = 0x00000001,
3086};
3087
Hariprasad Shenai49aa2842015-01-07 08:48:00 +05303088/* length of the formatting string */
3089#define FW_DEVLOG_FMT_LEN 192
3090
3091/* maximum number of the formatting string parameters */
3092#define FW_DEVLOG_FMT_PARAMS_NUM 8
3093
3094/* priority levels */
3095enum fw_devlog_level {
3096 FW_DEVLOG_LEVEL_EMERG = 0x0,
3097 FW_DEVLOG_LEVEL_CRIT = 0x1,
3098 FW_DEVLOG_LEVEL_ERR = 0x2,
3099 FW_DEVLOG_LEVEL_NOTICE = 0x3,
3100 FW_DEVLOG_LEVEL_INFO = 0x4,
3101 FW_DEVLOG_LEVEL_DEBUG = 0x5,
3102 FW_DEVLOG_LEVEL_MAX = 0x5,
3103};
3104
3105/* facilities that may send a log message */
3106enum fw_devlog_facility {
3107 FW_DEVLOG_FACILITY_CORE = 0x00,
3108 FW_DEVLOG_FACILITY_CF = 0x01,
3109 FW_DEVLOG_FACILITY_SCHED = 0x02,
3110 FW_DEVLOG_FACILITY_TIMER = 0x04,
3111 FW_DEVLOG_FACILITY_RES = 0x06,
3112 FW_DEVLOG_FACILITY_HW = 0x08,
3113 FW_DEVLOG_FACILITY_FLR = 0x10,
3114 FW_DEVLOG_FACILITY_DMAQ = 0x12,
3115 FW_DEVLOG_FACILITY_PHY = 0x14,
3116 FW_DEVLOG_FACILITY_MAC = 0x16,
3117 FW_DEVLOG_FACILITY_PORT = 0x18,
3118 FW_DEVLOG_FACILITY_VI = 0x1A,
3119 FW_DEVLOG_FACILITY_FILTER = 0x1C,
3120 FW_DEVLOG_FACILITY_ACL = 0x1E,
3121 FW_DEVLOG_FACILITY_TM = 0x20,
3122 FW_DEVLOG_FACILITY_QFC = 0x22,
3123 FW_DEVLOG_FACILITY_DCB = 0x24,
3124 FW_DEVLOG_FACILITY_ETH = 0x26,
3125 FW_DEVLOG_FACILITY_OFLD = 0x28,
3126 FW_DEVLOG_FACILITY_RI = 0x2A,
3127 FW_DEVLOG_FACILITY_ISCSI = 0x2C,
3128 FW_DEVLOG_FACILITY_FCOE = 0x2E,
3129 FW_DEVLOG_FACILITY_FOISCSI = 0x30,
3130 FW_DEVLOG_FACILITY_FOFCOE = 0x32,
Hariprasad Shenai7ef65a42015-04-01 21:41:15 +05303131 FW_DEVLOG_FACILITY_CHNET = 0x34,
3132 FW_DEVLOG_FACILITY_MAX = 0x34,
Hariprasad Shenai49aa2842015-01-07 08:48:00 +05303133};
3134
3135/* log message format */
3136struct fw_devlog_e {
3137 __be64 timestamp;
3138 __be32 seqno;
3139 __be16 reserved1;
3140 __u8 level;
3141 __u8 facility;
3142 __u8 fmt[FW_DEVLOG_FMT_LEN];
3143 __be32 params[FW_DEVLOG_FMT_PARAMS_NUM];
3144 __be32 reserved3[4];
3145};
3146
3147struct fw_devlog_cmd {
3148 __be32 op_to_write;
3149 __be32 retval_len16;
3150 __u8 level;
3151 __u8 r2[7];
3152 __be32 memtype_devlog_memaddr16_devlog;
3153 __be32 memsize_devlog;
3154 __be32 r3[2];
3155};
3156
3157#define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S 28
3158#define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M 0xf
3159#define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_G(x) \
3160 (((x) >> FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S) & \
3161 FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M)
3162
3163#define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S 0
3164#define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M 0xfffffff
3165#define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_G(x) \
3166 (((x) >> FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S) & \
3167 FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M)
3168
Hariprasad Shenai7ef65a42015-04-01 21:41:15 +05303169/* P C I E F W P F 7 R E G I S T E R */
3170
3171/* PF7 stores the Firmware Device Log parameters which allows Host Drivers to
3172 * access the "devlog" which needing to contact firmware. The encoding is
3173 * mostly the same as that returned by the DEVLOG command except for the size
3174 * which is encoded as the number of entries in multiples-1 of 128 here rather
3175 * than the memory size as is done in the DEVLOG command. Thus, 0 means 128
3176 * and 15 means 2048. This of course in turn constrains the allowed values
3177 * for the devlog size ...
3178 */
3179#define PCIE_FW_PF_DEVLOG 7
3180
3181#define PCIE_FW_PF_DEVLOG_NENTRIES128_S 28
3182#define PCIE_FW_PF_DEVLOG_NENTRIES128_M 0xf
3183#define PCIE_FW_PF_DEVLOG_NENTRIES128_V(x) \
3184 ((x) << PCIE_FW_PF_DEVLOG_NENTRIES128_S)
3185#define PCIE_FW_PF_DEVLOG_NENTRIES128_G(x) \
3186 (((x) >> PCIE_FW_PF_DEVLOG_NENTRIES128_S) & \
3187 PCIE_FW_PF_DEVLOG_NENTRIES128_M)
3188
3189#define PCIE_FW_PF_DEVLOG_ADDR16_S 4
3190#define PCIE_FW_PF_DEVLOG_ADDR16_M 0xffffff
3191#define PCIE_FW_PF_DEVLOG_ADDR16_V(x) ((x) << PCIE_FW_PF_DEVLOG_ADDR16_S)
3192#define PCIE_FW_PF_DEVLOG_ADDR16_G(x) \
3193 (((x) >> PCIE_FW_PF_DEVLOG_ADDR16_S) & PCIE_FW_PF_DEVLOG_ADDR16_M)
3194
3195#define PCIE_FW_PF_DEVLOG_MEMTYPE_S 0
3196#define PCIE_FW_PF_DEVLOG_MEMTYPE_M 0xf
3197#define PCIE_FW_PF_DEVLOG_MEMTYPE_V(x) ((x) << PCIE_FW_PF_DEVLOG_MEMTYPE_S)
3198#define PCIE_FW_PF_DEVLOG_MEMTYPE_G(x) \
3199 (((x) >> PCIE_FW_PF_DEVLOG_MEMTYPE_S) & PCIE_FW_PF_DEVLOG_MEMTYPE_M)
3200
Dimitris Michailidisbbc02c72010-04-01 15:28:22 +00003201#endif /* _T4FW_INTERFACE_H_ */