blob: a24909a3ed72404499a337648b5ef6b9dc8d4454 [file] [log] [blame]
Yuval Mintz4ad79e12015-07-22 09:16:23 +03001/* bnx2x_hsi.h: Qlogic Everest network driver.
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002 *
Yuval Mintz247fa822013-01-14 05:11:50 +00003 * Copyright (c) 2007-2013 Broadcom Corporation
Yuval Mintz4ad79e12015-07-22 09:16:23 +03004 * Copyright (c) 2014 QLogic Corporation
5 * All rights reserved
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation.
10 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +000011#ifndef BNX2X_HSI_H
12#define BNX2X_HSI_H
13
14#include "bnx2x_fw_defs.h"
Barak Witkowski2e499d32012-06-26 01:31:19 +000015#include "bnx2x_mfw_req.h"
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020016
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +030017#define FW_ENCODE_32BIT_PATTERN 0x1e1e1e1e
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000018
Michael Chane2513062009-10-10 13:46:58 +000019struct license_key {
20 u32 reserved[6];
21
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000022 u32 max_iscsi_conn;
23#define BNX2X_MAX_ISCSI_TRGT_CONN_MASK 0xFFFF
24#define BNX2X_MAX_ISCSI_TRGT_CONN_SHIFT 0
25#define BNX2X_MAX_ISCSI_INIT_CONN_MASK 0xFFFF0000
26#define BNX2X_MAX_ISCSI_INIT_CONN_SHIFT 16
Michael Chane2513062009-10-10 13:46:58 +000027
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000028 u32 reserved_a;
29
30 u32 max_fcoe_conn;
31#define BNX2X_MAX_FCOE_TRGT_CONN_MASK 0xFFFF
32#define BNX2X_MAX_FCOE_TRGT_CONN_SHIFT 0
33#define BNX2X_MAX_FCOE_INIT_CONN_MASK 0xFFFF0000
34#define BNX2X_MAX_FCOE_INIT_CONN_SHIFT 16
35
36 u32 reserved_b[4];
Michael Chane2513062009-10-10 13:46:58 +000037};
38
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020039/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +030040 * Shared HW configuration *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020041 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +030042#define PIN_CFG_NA 0x00000000
43#define PIN_CFG_GPIO0_P0 0x00000001
44#define PIN_CFG_GPIO1_P0 0x00000002
45#define PIN_CFG_GPIO2_P0 0x00000003
46#define PIN_CFG_GPIO3_P0 0x00000004
47#define PIN_CFG_GPIO0_P1 0x00000005
48#define PIN_CFG_GPIO1_P1 0x00000006
49#define PIN_CFG_GPIO2_P1 0x00000007
50#define PIN_CFG_GPIO3_P1 0x00000008
51#define PIN_CFG_EPIO0 0x00000009
52#define PIN_CFG_EPIO1 0x0000000a
53#define PIN_CFG_EPIO2 0x0000000b
54#define PIN_CFG_EPIO3 0x0000000c
55#define PIN_CFG_EPIO4 0x0000000d
56#define PIN_CFG_EPIO5 0x0000000e
57#define PIN_CFG_EPIO6 0x0000000f
58#define PIN_CFG_EPIO7 0x00000010
59#define PIN_CFG_EPIO8 0x00000011
60#define PIN_CFG_EPIO9 0x00000012
61#define PIN_CFG_EPIO10 0x00000013
62#define PIN_CFG_EPIO11 0x00000014
63#define PIN_CFG_EPIO12 0x00000015
64#define PIN_CFG_EPIO13 0x00000016
65#define PIN_CFG_EPIO14 0x00000017
66#define PIN_CFG_EPIO15 0x00000018
67#define PIN_CFG_EPIO16 0x00000019
68#define PIN_CFG_EPIO17 0x0000001a
69#define PIN_CFG_EPIO18 0x0000001b
70#define PIN_CFG_EPIO19 0x0000001c
71#define PIN_CFG_EPIO20 0x0000001d
72#define PIN_CFG_EPIO21 0x0000001e
73#define PIN_CFG_EPIO22 0x0000001f
74#define PIN_CFG_EPIO23 0x00000020
75#define PIN_CFG_EPIO24 0x00000021
76#define PIN_CFG_EPIO25 0x00000022
77#define PIN_CFG_EPIO26 0x00000023
78#define PIN_CFG_EPIO27 0x00000024
79#define PIN_CFG_EPIO28 0x00000025
80#define PIN_CFG_EPIO29 0x00000026
81#define PIN_CFG_EPIO30 0x00000027
82#define PIN_CFG_EPIO31 0x00000028
83
84/* EPIO definition */
85#define EPIO_CFG_NA 0x00000000
86#define EPIO_CFG_EPIO0 0x00000001
87#define EPIO_CFG_EPIO1 0x00000002
88#define EPIO_CFG_EPIO2 0x00000003
89#define EPIO_CFG_EPIO3 0x00000004
90#define EPIO_CFG_EPIO4 0x00000005
91#define EPIO_CFG_EPIO5 0x00000006
92#define EPIO_CFG_EPIO6 0x00000007
93#define EPIO_CFG_EPIO7 0x00000008
94#define EPIO_CFG_EPIO8 0x00000009
95#define EPIO_CFG_EPIO9 0x0000000a
96#define EPIO_CFG_EPIO10 0x0000000b
97#define EPIO_CFG_EPIO11 0x0000000c
98#define EPIO_CFG_EPIO12 0x0000000d
99#define EPIO_CFG_EPIO13 0x0000000e
100#define EPIO_CFG_EPIO14 0x0000000f
101#define EPIO_CFG_EPIO15 0x00000010
102#define EPIO_CFG_EPIO16 0x00000011
103#define EPIO_CFG_EPIO17 0x00000012
104#define EPIO_CFG_EPIO18 0x00000013
105#define EPIO_CFG_EPIO19 0x00000014
106#define EPIO_CFG_EPIO20 0x00000015
107#define EPIO_CFG_EPIO21 0x00000016
108#define EPIO_CFG_EPIO22 0x00000017
109#define EPIO_CFG_EPIO23 0x00000018
110#define EPIO_CFG_EPIO24 0x00000019
111#define EPIO_CFG_EPIO25 0x0000001a
112#define EPIO_CFG_EPIO26 0x0000001b
113#define EPIO_CFG_EPIO27 0x0000001c
114#define EPIO_CFG_EPIO28 0x0000001d
115#define EPIO_CFG_EPIO29 0x0000001e
116#define EPIO_CFG_EPIO30 0x0000001f
117#define EPIO_CFG_EPIO31 0x00000020
118
Dmitry Kravkov91226792013-03-11 05:17:52 +0000119struct mac_addr {
120 u32 upper;
121 u32 lower;
122};
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300123
124struct shared_hw_cfg { /* NVRAM Offset */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200125 /* Up to 16 bytes of NULL-terminated string */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300126 u8 part_num[16]; /* 0x104 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200127
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300128 u32 config; /* 0x114 */
129 #define SHARED_HW_CFG_MDIO_VOLTAGE_MASK 0x00000001
130 #define SHARED_HW_CFG_MDIO_VOLTAGE_SHIFT 0
131 #define SHARED_HW_CFG_MDIO_VOLTAGE_1_2V 0x00000000
132 #define SHARED_HW_CFG_MDIO_VOLTAGE_2_5V 0x00000001
133 #define SHARED_HW_CFG_MCP_RST_ON_CORE_RST_EN 0x00000002
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200134
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300135 #define SHARED_HW_CFG_PORT_SWAP 0x00000004
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200136
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300137 #define SHARED_HW_CFG_BEACON_WOL_EN 0x00000008
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200138
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300139 #define SHARED_HW_CFG_PCIE_GEN3_DISABLED 0x00000000
140 #define SHARED_HW_CFG_PCIE_GEN3_ENABLED 0x00000010
141
142 #define SHARED_HW_CFG_MFW_SELECT_MASK 0x00000700
143 #define SHARED_HW_CFG_MFW_SELECT_SHIFT 8
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200144 /* Whatever MFW found in NVM
145 (if multiple found, priority order is: NC-SI, UMP, IPMI) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300146 #define SHARED_HW_CFG_MFW_SELECT_DEFAULT 0x00000000
147 #define SHARED_HW_CFG_MFW_SELECT_NC_SI 0x00000100
148 #define SHARED_HW_CFG_MFW_SELECT_UMP 0x00000200
149 #define SHARED_HW_CFG_MFW_SELECT_IPMI 0x00000300
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200150 /* Use SPIO4 as an arbiter between: 0-NC_SI, 1-IPMI
151 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300152 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_IPMI 0x00000400
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200153 /* Use SPIO4 as an arbiter between: 0-UMP, 1-IPMI
154 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300155 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_UMP_IPMI 0x00000500
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200156 /* Use SPIO4 as an arbiter between: 0-NC-SI, 1-UMP
157 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300158 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_UMP 0x00000600
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200159
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300160 #define SHARED_HW_CFG_LED_MODE_MASK 0x000f0000
161 #define SHARED_HW_CFG_LED_MODE_SHIFT 16
162 #define SHARED_HW_CFG_LED_MAC1 0x00000000
163 #define SHARED_HW_CFG_LED_PHY1 0x00010000
164 #define SHARED_HW_CFG_LED_PHY2 0x00020000
165 #define SHARED_HW_CFG_LED_PHY3 0x00030000
166 #define SHARED_HW_CFG_LED_MAC2 0x00040000
167 #define SHARED_HW_CFG_LED_PHY4 0x00050000
168 #define SHARED_HW_CFG_LED_PHY5 0x00060000
169 #define SHARED_HW_CFG_LED_PHY6 0x00070000
170 #define SHARED_HW_CFG_LED_MAC3 0x00080000
171 #define SHARED_HW_CFG_LED_PHY7 0x00090000
172 #define SHARED_HW_CFG_LED_PHY9 0x000a0000
173 #define SHARED_HW_CFG_LED_PHY11 0x000b0000
174 #define SHARED_HW_CFG_LED_MAC4 0x000c0000
175 #define SHARED_HW_CFG_LED_PHY8 0x000d0000
176 #define SHARED_HW_CFG_LED_EXTPHY1 0x000e0000
Yaniv Rosner7dc950c2013-09-28 08:46:11 +0300177 #define SHARED_HW_CFG_LED_EXTPHY2 0x000f0000
Yaniv Rosner7f02c4a2010-09-07 11:41:23 +0000178
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200179
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300180 #define SHARED_HW_CFG_AN_ENABLE_MASK 0x3f000000
181 #define SHARED_HW_CFG_AN_ENABLE_SHIFT 24
182 #define SHARED_HW_CFG_AN_ENABLE_CL37 0x01000000
183 #define SHARED_HW_CFG_AN_ENABLE_CL73 0x02000000
184 #define SHARED_HW_CFG_AN_ENABLE_BAM 0x04000000
185 #define SHARED_HW_CFG_AN_ENABLE_PARALLEL_DETECTION 0x08000000
186 #define SHARED_HW_CFG_AN_EN_SGMII_FIBER_AUTO_DETECT 0x10000000
187 #define SHARED_HW_CFG_AN_ENABLE_REMOTE_PHY 0x20000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200188
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300189 #define SHARED_HW_CFG_SRIOV_MASK 0x40000000
190 #define SHARED_HW_CFG_SRIOV_DISABLED 0x00000000
191 #define SHARED_HW_CFG_SRIOV_ENABLED 0x40000000
192
193 #define SHARED_HW_CFG_ATC_MASK 0x80000000
194 #define SHARED_HW_CFG_ATC_DISABLED 0x00000000
195 #define SHARED_HW_CFG_ATC_ENABLED 0x80000000
196
197 u32 config2; /* 0x118 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200198 /* one time auto detect grace period (in sec) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300199 #define SHARED_HW_CFG_GRACE_PERIOD_MASK 0x000000ff
200 #define SHARED_HW_CFG_GRACE_PERIOD_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200201
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300202 #define SHARED_HW_CFG_PCIE_GEN2_ENABLED 0x00000100
203 #define SHARED_HW_CFG_PCIE_GEN2_DISABLED 0x00000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200204
205 /* The default value for the core clock is 250MHz and it is
206 achieved by setting the clock change to 4 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300207 #define SHARED_HW_CFG_CLOCK_CHANGE_MASK 0x00000e00
208 #define SHARED_HW_CFG_CLOCK_CHANGE_SHIFT 9
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200209
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300210 #define SHARED_HW_CFG_SMBUS_TIMING_MASK 0x00001000
211 #define SHARED_HW_CFG_SMBUS_TIMING_100KHZ 0x00000000
212 #define SHARED_HW_CFG_SMBUS_TIMING_400KHZ 0x00001000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200213
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300214 #define SHARED_HW_CFG_HIDE_PORT1 0x00002000
215
216 #define SHARED_HW_CFG_WOL_CAPABLE_MASK 0x00004000
217 #define SHARED_HW_CFG_WOL_CAPABLE_DISABLED 0x00000000
218 #define SHARED_HW_CFG_WOL_CAPABLE_ENABLED 0x00004000
219
220 /* Output low when PERST is asserted */
221 #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_MASK 0x00008000
222 #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_DISABLED 0x00000000
223 #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_ENABLED 0x00008000
224
225 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_MASK 0x00070000
226 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_SHIFT 16
227 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_HW 0x00000000
228 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_0DB 0x00010000
229 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_3_5DB 0x00020000
230 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_6_0DB 0x00030000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200231
Eilon Greensteinfd4ef402009-07-21 05:47:27 +0000232 /* The fan failure mechanism is usually related to the PHY type
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300233 since the power consumption of the board is determined by the PHY.
234 Currently, fan is required for most designs with SFX7101, BCM8727
235 and BCM8481. If a fan is not required for a board which uses one
236 of those PHYs, this field should be set to "Disabled". If a fan is
237 required for a different PHY type, this option should be set to
238 "Enabled". The fan failure indication is expected on SPIO5 */
239 #define SHARED_HW_CFG_FAN_FAILURE_MASK 0x00180000
240 #define SHARED_HW_CFG_FAN_FAILURE_SHIFT 19
241 #define SHARED_HW_CFG_FAN_FAILURE_PHY_TYPE 0x00000000
242 #define SHARED_HW_CFG_FAN_FAILURE_DISABLED 0x00080000
243 #define SHARED_HW_CFG_FAN_FAILURE_ENABLED 0x00100000
Eilon Greensteinfd4ef402009-07-21 05:47:27 +0000244
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300245 /* ASPM Power Management support */
246 #define SHARED_HW_CFG_ASPM_SUPPORT_MASK 0x00600000
247 #define SHARED_HW_CFG_ASPM_SUPPORT_SHIFT 21
248 #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_L1_ENABLED 0x00000000
249 #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_DISABLED 0x00200000
250 #define SHARED_HW_CFG_ASPM_SUPPORT_L1_DISABLED 0x00400000
251 #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_L1_DISABLED 0x00600000
Yaniv Rosnere10bc842010-09-07 11:40:50 +0000252
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300253 /* The value of PM_TL_IGNORE_REQS (bit0) in PCI register
254 tl_control_0 (register 0x2800) */
255 #define SHARED_HW_CFG_PREVENT_L1_ENTRY_MASK 0x00800000
256 #define SHARED_HW_CFG_PREVENT_L1_ENTRY_DISABLED 0x00000000
257 #define SHARED_HW_CFG_PREVENT_L1_ENTRY_ENABLED 0x00800000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200258
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300259 #define SHARED_HW_CFG_PORT_MODE_MASK 0x01000000
260 #define SHARED_HW_CFG_PORT_MODE_2 0x00000000
261 #define SHARED_HW_CFG_PORT_MODE_4 0x01000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200262
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300263 #define SHARED_HW_CFG_PATH_SWAP_MASK 0x02000000
264 #define SHARED_HW_CFG_PATH_SWAP_DISABLED 0x00000000
265 #define SHARED_HW_CFG_PATH_SWAP_ENABLED 0x02000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200266
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300267 /* Set the MDC/MDIO access for the first external phy */
268 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_MASK 0x1C000000
269 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SHIFT 26
270 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_PHY_TYPE 0x00000000
271 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC0 0x04000000
272 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC1 0x08000000
273 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_BOTH 0x0c000000
274 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SWAPPED 0x10000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200275
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300276 /* Set the MDC/MDIO access for the second external phy */
277 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_MASK 0xE0000000
278 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SHIFT 29
279 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_PHY_TYPE 0x00000000
280 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC0 0x20000000
281 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC1 0x40000000
282 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_BOTH 0x60000000
283 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SWAPPED 0x80000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200284
Yuval Mintz83bad202014-09-17 16:24:38 +0300285 u32 config_3; /* 0x11C */
286 #define SHARED_HW_CFG_EXTENDED_MF_MODE_MASK 0x00000F00
287 #define SHARED_HW_CFG_EXTENDED_MF_MODE_SHIFT 8
288 #define SHARED_HW_CFG_EXTENDED_MF_MODE_NPAR1_DOT_5 0x00000000
289 #define SHARED_HW_CFG_EXTENDED_MF_MODE_NPAR2_DOT_0 0x00000100
Eilon Greenstein35b19ba2009-02-12 08:36:47 +0000290
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300291 u32 ump_nc_si_config; /* 0x120 */
292 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MASK 0x00000003
293 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_SHIFT 0
294 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MAC 0x00000000
295 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_PHY 0x00000001
296 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MII 0x00000000
297 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_RMII 0x00000002
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200298
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300299 #define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_MASK 0x00000f00
300 #define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_SHIFT 8
301
302 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_MASK 0x00ff0000
303 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_SHIFT 16
304 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_NONE 0x00000000
305 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_BCM5221 0x00010000
306
307 u32 board; /* 0x124 */
308 #define SHARED_HW_CFG_E3_I2C_MUX0_MASK 0x0000003F
309 #define SHARED_HW_CFG_E3_I2C_MUX0_SHIFT 0
310 #define SHARED_HW_CFG_E3_I2C_MUX1_MASK 0x00000FC0
311 #define SHARED_HW_CFG_E3_I2C_MUX1_SHIFT 6
312 /* Use the PIN_CFG_XXX defines on top */
313 #define SHARED_HW_CFG_BOARD_REV_MASK 0x00ff0000
314 #define SHARED_HW_CFG_BOARD_REV_SHIFT 16
315
316 #define SHARED_HW_CFG_BOARD_MAJOR_VER_MASK 0x0f000000
317 #define SHARED_HW_CFG_BOARD_MAJOR_VER_SHIFT 24
318
319 #define SHARED_HW_CFG_BOARD_MINOR_VER_MASK 0xf0000000
320 #define SHARED_HW_CFG_BOARD_MINOR_VER_SHIFT 28
321
322 u32 wc_lane_config; /* 0x128 */
323 #define SHARED_HW_CFG_LANE_SWAP_CFG_MASK 0x0000FFFF
324 #define SHARED_HW_CFG_LANE_SWAP_CFG_SHIFT 0
325 #define SHARED_HW_CFG_LANE_SWAP_CFG_32103210 0x00001b1b
326 #define SHARED_HW_CFG_LANE_SWAP_CFG_32100123 0x00001be4
327 #define SHARED_HW_CFG_LANE_SWAP_CFG_01233210 0x0000e41b
328 #define SHARED_HW_CFG_LANE_SWAP_CFG_01230123 0x0000e4e4
329 #define SHARED_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000FF
330 #define SHARED_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0
331 #define SHARED_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000FF00
332 #define SHARED_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8
333
334 /* TX lane Polarity swap */
335 #define SHARED_HW_CFG_TX_LANE0_POL_FLIP_ENABLED 0x00010000
336 #define SHARED_HW_CFG_TX_LANE1_POL_FLIP_ENABLED 0x00020000
337 #define SHARED_HW_CFG_TX_LANE2_POL_FLIP_ENABLED 0x00040000
338 #define SHARED_HW_CFG_TX_LANE3_POL_FLIP_ENABLED 0x00080000
339 /* TX lane Polarity swap */
340 #define SHARED_HW_CFG_RX_LANE0_POL_FLIP_ENABLED 0x00100000
341 #define SHARED_HW_CFG_RX_LANE1_POL_FLIP_ENABLED 0x00200000
342 #define SHARED_HW_CFG_RX_LANE2_POL_FLIP_ENABLED 0x00400000
343 #define SHARED_HW_CFG_RX_LANE3_POL_FLIP_ENABLED 0x00800000
344
345 /* Selects the port layout of the board */
346 #define SHARED_HW_CFG_E3_PORT_LAYOUT_MASK 0x0F000000
347 #define SHARED_HW_CFG_E3_PORT_LAYOUT_SHIFT 24
348 #define SHARED_HW_CFG_E3_PORT_LAYOUT_2P_01 0x00000000
349 #define SHARED_HW_CFG_E3_PORT_LAYOUT_2P_10 0x01000000
350 #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_0123 0x02000000
351 #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_1032 0x03000000
352 #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_2301 0x04000000
353 #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_3210 0x05000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200354};
355
Eliezer Tamirf1410642008-02-28 11:51:50 -0800356
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200357/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300358 * Port HW configuration *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200359 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300360struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200361
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200362 u32 pci_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300363 #define PORT_HW_CFG_PCI_VENDOR_ID_MASK 0xffff0000
364 #define PORT_HW_CFG_PCI_DEVICE_ID_MASK 0x0000ffff
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200365
366 u32 pci_sub_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300367 #define PORT_HW_CFG_PCI_SUBSYS_DEVICE_ID_MASK 0xffff0000
368 #define PORT_HW_CFG_PCI_SUBSYS_VENDOR_ID_MASK 0x0000ffff
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200369
370 u32 power_dissipated;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300371 #define PORT_HW_CFG_POWER_DIS_D0_MASK 0x000000ff
372 #define PORT_HW_CFG_POWER_DIS_D0_SHIFT 0
373 #define PORT_HW_CFG_POWER_DIS_D1_MASK 0x0000ff00
374 #define PORT_HW_CFG_POWER_DIS_D1_SHIFT 8
375 #define PORT_HW_CFG_POWER_DIS_D2_MASK 0x00ff0000
376 #define PORT_HW_CFG_POWER_DIS_D2_SHIFT 16
377 #define PORT_HW_CFG_POWER_DIS_D3_MASK 0xff000000
378 #define PORT_HW_CFG_POWER_DIS_D3_SHIFT 24
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200379
380 u32 power_consumed;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300381 #define PORT_HW_CFG_POWER_CONS_D0_MASK 0x000000ff
382 #define PORT_HW_CFG_POWER_CONS_D0_SHIFT 0
383 #define PORT_HW_CFG_POWER_CONS_D1_MASK 0x0000ff00
384 #define PORT_HW_CFG_POWER_CONS_D1_SHIFT 8
385 #define PORT_HW_CFG_POWER_CONS_D2_MASK 0x00ff0000
386 #define PORT_HW_CFG_POWER_CONS_D2_SHIFT 16
387 #define PORT_HW_CFG_POWER_CONS_D3_MASK 0xff000000
388 #define PORT_HW_CFG_POWER_CONS_D3_SHIFT 24
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200389
390 u32 mac_upper;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300391 #define PORT_HW_CFG_UPPERMAC_MASK 0x0000ffff
392 #define PORT_HW_CFG_UPPERMAC_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200393 u32 mac_lower;
394
395 u32 iscsi_mac_upper; /* Upper 16 bits are always zeroes */
396 u32 iscsi_mac_lower;
397
398 u32 rdma_mac_upper; /* Upper 16 bits are always zeroes */
399 u32 rdma_mac_lower;
400
401 u32 serdes_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300402 #define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_MASK 0x0000ffff
403 #define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200404
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300405 #define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_MASK 0xffff0000
406 #define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_SHIFT 16
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200407
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200408
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300409 /* Default values: 2P-64, 4P-32 */
410 u32 pf_config; /* 0x158 */
411 #define PORT_HW_CFG_PF_NUM_VF_MASK 0x0000007F
412 #define PORT_HW_CFG_PF_NUM_VF_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200413
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300414 /* Default values: 17 */
415 #define PORT_HW_CFG_PF_NUM_MSIX_VECTORS_MASK 0x00007F00
416 #define PORT_HW_CFG_PF_NUM_MSIX_VECTORS_SHIFT 8
Yaniv Rosner020c7e32011-05-31 21:28:43 +0000417
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300418 #define PORT_HW_CFG_ENABLE_FLR_MASK 0x00010000
419 #define PORT_HW_CFG_FLR_ENABLED 0x00010000
Yaniv Rosner020c7e32011-05-31 21:28:43 +0000420
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300421 u32 vf_config; /* 0x15C */
422 #define PORT_HW_CFG_VF_NUM_MSIX_VECTORS_MASK 0x0000007F
423 #define PORT_HW_CFG_VF_NUM_MSIX_VECTORS_SHIFT 0
Yaniv Rosner1ac9e422011-05-31 21:26:11 +0000424
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300425 #define PORT_HW_CFG_VF_PCI_DEVICE_ID_MASK 0xFFFF0000
426 #define PORT_HW_CFG_VF_PCI_DEVICE_ID_SHIFT 16
Yaniv Rosner1ac9e422011-05-31 21:26:11 +0000427
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300428 u32 mf_pci_id; /* 0x160 */
429 #define PORT_HW_CFG_MF_PCI_DEVICE_ID_MASK 0x0000FFFF
430 #define PORT_HW_CFG_MF_PCI_DEVICE_ID_SHIFT 0
Yaniv Rosner1ac9e422011-05-31 21:26:11 +0000431
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300432 /* Controls the TX laser of the SFP+ module */
433 u32 sfp_ctrl; /* 0x164 */
434 #define PORT_HW_CFG_TX_LASER_MASK 0x000000FF
435 #define PORT_HW_CFG_TX_LASER_SHIFT 0
436 #define PORT_HW_CFG_TX_LASER_MDIO 0x00000000
437 #define PORT_HW_CFG_TX_LASER_GPIO0 0x00000001
438 #define PORT_HW_CFG_TX_LASER_GPIO1 0x00000002
439 #define PORT_HW_CFG_TX_LASER_GPIO2 0x00000003
440 #define PORT_HW_CFG_TX_LASER_GPIO3 0x00000004
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200441
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300442 /* Controls the fault module LED of the SFP+ */
443 #define PORT_HW_CFG_FAULT_MODULE_LED_MASK 0x0000FF00
444 #define PORT_HW_CFG_FAULT_MODULE_LED_SHIFT 8
445 #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO0 0x00000000
446 #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO1 0x00000100
447 #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO2 0x00000200
448 #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO3 0x00000300
449 #define PORT_HW_CFG_FAULT_MODULE_LED_DISABLED 0x00000400
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200450
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300451 /* The output pin TX_DIS that controls the TX laser of the SFP+
452 module. Use the PIN_CFG_XXX defines on top */
453 u32 e3_sfp_ctrl; /* 0x168 */
454 #define PORT_HW_CFG_E3_TX_LASER_MASK 0x000000FF
455 #define PORT_HW_CFG_E3_TX_LASER_SHIFT 0
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000456
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300457 /* The output pin for SFPP_TYPE which turns on the Fault module LED */
458 #define PORT_HW_CFG_E3_FAULT_MDL_LED_MASK 0x0000FF00
459 #define PORT_HW_CFG_E3_FAULT_MDL_LED_SHIFT 8
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000460
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300461 /* The input pin MOD_ABS that indicates whether SFP+ module is
462 present or not. Use the PIN_CFG_XXX defines on top */
463 #define PORT_HW_CFG_E3_MOD_ABS_MASK 0x00FF0000
464 #define PORT_HW_CFG_E3_MOD_ABS_SHIFT 16
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000465
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300466 /* The output pin PWRDIS_SFP_X which disable the power of the SFP+
467 module. Use the PIN_CFG_XXX defines on top */
468 #define PORT_HW_CFG_E3_PWR_DIS_MASK 0xFF000000
469 #define PORT_HW_CFG_E3_PWR_DIS_SHIFT 24
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000470
471 /*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300472 * The input pin which signals module transmit fault. Use the
473 * PIN_CFG_XXX defines on top
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000474 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300475 u32 e3_cmn_pin_cfg; /* 0x16C */
476 #define PORT_HW_CFG_E3_TX_FAULT_MASK 0x000000FF
477 #define PORT_HW_CFG_E3_TX_FAULT_SHIFT 0
478
479 /* The output pin which reset the PHY. Use the PIN_CFG_XXX defines on
480 top */
481 #define PORT_HW_CFG_E3_PHY_RESET_MASK 0x0000FF00
482 #define PORT_HW_CFG_E3_PHY_RESET_SHIFT 8
483
484 /*
485 * The output pin which powers down the PHY. Use the PIN_CFG_XXX
486 * defines on top
487 */
488 #define PORT_HW_CFG_E3_PWR_DOWN_MASK 0x00FF0000
489 #define PORT_HW_CFG_E3_PWR_DOWN_SHIFT 16
490
491 /* The output pin values BSC_SEL which selects the I2C for this port
492 in the I2C Mux */
493 #define PORT_HW_CFG_E3_I2C_MUX0_MASK 0x01000000
494 #define PORT_HW_CFG_E3_I2C_MUX1_MASK 0x02000000
495
496
497 /*
498 * The input pin I_FAULT which indicate over-current has occurred.
499 * Use the PIN_CFG_XXX defines on top
500 */
501 u32 e3_cmn_pin_cfg1; /* 0x170 */
502 #define PORT_HW_CFG_E3_OVER_CURRENT_MASK 0x000000FF
503 #define PORT_HW_CFG_E3_OVER_CURRENT_SHIFT 0
Yuval Mintz79642112012-12-02 04:05:50 +0000504
505 /* pause on host ring */
506 u32 generic_features; /* 0x174 */
507 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_MASK 0x00000001
508 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_SHIFT 0
509 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_DISABLED 0x00000000
510 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_ENABLED 0x00000001
511
Yaniv Rosnere438c5d2013-03-11 05:17:50 +0000512 /* SFP+ Tx Equalization: NIC recommended and tested value is 0xBEB2
513 * LOM recommended and tested value is 0xBEB2. Using a different
514 * value means using a value not tested by BRCM
515 */
516 u32 sfi_tap_values; /* 0x178 */
517 #define PORT_HW_CFG_TX_EQUALIZATION_MASK 0x0000FFFF
518 #define PORT_HW_CFG_TX_EQUALIZATION_SHIFT 0
519
520 /* SFP+ Tx driver broadcast IDRIVER: NIC recommended and tested
521 * value is 0x2. LOM recommended and tested value is 0x2. Using a
522 * different value means using a value not tested by BRCM
523 */
524 #define PORT_HW_CFG_TX_DRV_BROADCAST_MASK 0x000F0000
525 #define PORT_HW_CFG_TX_DRV_BROADCAST_SHIFT 16
Yaniv Rosner30fd9ff2015-03-29 10:04:59 +0300526 /* Set non-default values for TXFIR in SFP mode. */
527 #define PORT_HW_CFG_TX_DRV_IFIR_MASK 0x00F00000
528 #define PORT_HW_CFG_TX_DRV_IFIR_SHIFT 20
529
530 /* Set non-default values for IPREDRIVER in SFP mode. */
531 #define PORT_HW_CFG_TX_DRV_IPREDRIVER_MASK 0x0F000000
532 #define PORT_HW_CFG_TX_DRV_IPREDRIVER_SHIFT 24
533
534 /* Set non-default values for POST2 in SFP mode. */
535 #define PORT_HW_CFG_TX_DRV_POST2_MASK 0xF0000000
536 #define PORT_HW_CFG_TX_DRV_POST2_SHIFT 28
Yaniv Rosnere438c5d2013-03-11 05:17:50 +0000537
538 u32 reserved0[5]; /* 0x17c */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300539
540 u32 aeu_int_mask; /* 0x190 */
541
542 u32 media_type; /* 0x194 */
543 #define PORT_HW_CFG_MEDIA_TYPE_PHY0_MASK 0x000000FF
544 #define PORT_HW_CFG_MEDIA_TYPE_PHY0_SHIFT 0
545
546 #define PORT_HW_CFG_MEDIA_TYPE_PHY1_MASK 0x0000FF00
547 #define PORT_HW_CFG_MEDIA_TYPE_PHY1_SHIFT 8
548
549 #define PORT_HW_CFG_MEDIA_TYPE_PHY2_MASK 0x00FF0000
550 #define PORT_HW_CFG_MEDIA_TYPE_PHY2_SHIFT 16
551
552 /* 4 times 16 bits for all 4 lanes. In case external PHY is present
553 (not direct mode), those values will not take effect on the 4 XGXS
554 lanes. For some external PHYs (such as 8706 and 8726) the values
555 will be used to configure the external PHY in those cases, not
556 all 4 values are needed. */
557 u16 xgxs_config_rx[4]; /* 0x198 */
558 u16 xgxs_config_tx[4]; /* 0x1A0 */
559
560 /* For storing FCOE mac on shared memory */
561 u32 fcoe_fip_mac_upper;
562 #define PORT_HW_CFG_FCOE_UPPERMAC_MASK 0x0000ffff
563 #define PORT_HW_CFG_FCOE_UPPERMAC_SHIFT 0
564 u32 fcoe_fip_mac_lower;
565
566 u32 fcoe_wwn_port_name_upper;
567 u32 fcoe_wwn_port_name_lower;
568
569 u32 fcoe_wwn_node_name_upper;
570 u32 fcoe_wwn_node_name_lower;
571
Yaniv Rosner0520e632011-07-05 01:06:59 +0000572 u32 Reserved1[49]; /* 0x1C0 */
573
574 /* Enable RJ45 magjack pair swapping on 10GBase-T PHY (0=default),
575 84833 only */
576 u32 xgbt_phy_cfg; /* 0x284 */
577 #define PORT_HW_CFG_RJ45_PAIR_SWAP_MASK 0x000000FF
578 #define PORT_HW_CFG_RJ45_PAIR_SWAP_SHIFT 0
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300579
580 u32 default_cfg; /* 0x288 */
581 #define PORT_HW_CFG_GPIO0_CONFIG_MASK 0x00000003
582 #define PORT_HW_CFG_GPIO0_CONFIG_SHIFT 0
583 #define PORT_HW_CFG_GPIO0_CONFIG_NA 0x00000000
584 #define PORT_HW_CFG_GPIO0_CONFIG_LOW 0x00000001
585 #define PORT_HW_CFG_GPIO0_CONFIG_HIGH 0x00000002
586 #define PORT_HW_CFG_GPIO0_CONFIG_INPUT 0x00000003
587
588 #define PORT_HW_CFG_GPIO1_CONFIG_MASK 0x0000000C
589 #define PORT_HW_CFG_GPIO1_CONFIG_SHIFT 2
590 #define PORT_HW_CFG_GPIO1_CONFIG_NA 0x00000000
591 #define PORT_HW_CFG_GPIO1_CONFIG_LOW 0x00000004
592 #define PORT_HW_CFG_GPIO1_CONFIG_HIGH 0x00000008
593 #define PORT_HW_CFG_GPIO1_CONFIG_INPUT 0x0000000c
594
595 #define PORT_HW_CFG_GPIO2_CONFIG_MASK 0x00000030
596 #define PORT_HW_CFG_GPIO2_CONFIG_SHIFT 4
597 #define PORT_HW_CFG_GPIO2_CONFIG_NA 0x00000000
598 #define PORT_HW_CFG_GPIO2_CONFIG_LOW 0x00000010
599 #define PORT_HW_CFG_GPIO2_CONFIG_HIGH 0x00000020
600 #define PORT_HW_CFG_GPIO2_CONFIG_INPUT 0x00000030
601
602 #define PORT_HW_CFG_GPIO3_CONFIG_MASK 0x000000C0
603 #define PORT_HW_CFG_GPIO3_CONFIG_SHIFT 6
604 #define PORT_HW_CFG_GPIO3_CONFIG_NA 0x00000000
605 #define PORT_HW_CFG_GPIO3_CONFIG_LOW 0x00000040
606 #define PORT_HW_CFG_GPIO3_CONFIG_HIGH 0x00000080
607 #define PORT_HW_CFG_GPIO3_CONFIG_INPUT 0x000000c0
608
609 /* When KR link is required to be set to force which is not
610 KR-compliant, this parameter determine what is the trigger for it.
611 When GPIO is selected, low input will force the speed. Currently
612 default speed is 1G. In the future, it may be widen to select the
613 forced speed in with another parameter. Note when force-1G is
614 enabled, it override option 56: Link Speed option. */
615 #define PORT_HW_CFG_FORCE_KR_ENABLER_MASK 0x00000F00
616 #define PORT_HW_CFG_FORCE_KR_ENABLER_SHIFT 8
617 #define PORT_HW_CFG_FORCE_KR_ENABLER_NOT_FORCED 0x00000000
618 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P0 0x00000100
619 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P0 0x00000200
620 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P0 0x00000300
621 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P0 0x00000400
622 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P1 0x00000500
623 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P1 0x00000600
624 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P1 0x00000700
625 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P1 0x00000800
626 #define PORT_HW_CFG_FORCE_KR_ENABLER_FORCED 0x00000900
627 /* Enable to determine with which GPIO to reset the external phy */
628 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_MASK 0x000F0000
629 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_SHIFT 16
630 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_PHY_TYPE 0x00000000
631 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P0 0x00010000
632 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P0 0x00020000
633 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P0 0x00030000
634 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P0 0x00040000
635 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P1 0x00050000
636 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P1 0x00060000
637 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P1 0x00070000
638 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P1 0x00080000
639
Yaniv Rosner121839b2010-11-01 05:32:38 +0000640 /* Enable BAM on KR */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300641 #define PORT_HW_CFG_ENABLE_BAM_ON_KR_MASK 0x00100000
642 #define PORT_HW_CFG_ENABLE_BAM_ON_KR_SHIFT 20
643 #define PORT_HW_CFG_ENABLE_BAM_ON_KR_DISABLED 0x00000000
644 #define PORT_HW_CFG_ENABLE_BAM_ON_KR_ENABLED 0x00100000
Yaniv Rosner121839b2010-11-01 05:32:38 +0000645
Yaniv Rosner1bef68e2011-01-31 04:22:46 +0000646 /* Enable Common Mode Sense */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300647 #define PORT_HW_CFG_ENABLE_CMS_MASK 0x00200000
648 #define PORT_HW_CFG_ENABLE_CMS_SHIFT 21
649 #define PORT_HW_CFG_ENABLE_CMS_DISABLED 0x00000000
650 #define PORT_HW_CFG_ENABLE_CMS_ENABLED 0x00200000
651
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300652 /* Determine the Serdes electrical interface */
653 #define PORT_HW_CFG_NET_SERDES_IF_MASK 0x0F000000
654 #define PORT_HW_CFG_NET_SERDES_IF_SHIFT 24
655 #define PORT_HW_CFG_NET_SERDES_IF_SGMII 0x00000000
656 #define PORT_HW_CFG_NET_SERDES_IF_XFI 0x01000000
657 #define PORT_HW_CFG_NET_SERDES_IF_SFI 0x02000000
658 #define PORT_HW_CFG_NET_SERDES_IF_KR 0x03000000
659 #define PORT_HW_CFG_NET_SERDES_IF_DXGXS 0x04000000
660 #define PORT_HW_CFG_NET_SERDES_IF_KR2 0x05000000
661
Yaniv Rosner1bef68e2011-01-31 04:22:46 +0000662
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000663 u32 speed_capability_mask2; /* 0x28C */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300664 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_MASK 0x0000FFFF
665 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_SHIFT 0
666 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10M_FULL 0x00000001
667 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3__ 0x00000002
668 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3___ 0x00000004
669 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_100M_FULL 0x00000008
670 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_1G 0x00000010
671 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_2_DOT_5G 0x00000020
672 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10G 0x00000040
673 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_20G 0x00000080
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000674
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300675 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_MASK 0xFFFF0000
676 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_SHIFT 16
677 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10M_FULL 0x00010000
678 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0__ 0x00020000
679 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0___ 0x00040000
680 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_100M_FULL 0x00080000
681 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_1G 0x00100000
682 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_2_DOT_5G 0x00200000
683 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10G 0x00400000
684 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_20G 0x00800000
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000685
686
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300687 /* In the case where two media types (e.g. copper and fiber) are
688 present and electrically active at the same time, PHY Selection
689 will determine which of the two PHYs will be designated as the
690 Active PHY and used for a connection to the network. */
691 u32 multi_phy_config; /* 0x290 */
692 #define PORT_HW_CFG_PHY_SELECTION_MASK 0x00000007
693 #define PORT_HW_CFG_PHY_SELECTION_SHIFT 0
694 #define PORT_HW_CFG_PHY_SELECTION_HARDWARE_DEFAULT 0x00000000
695 #define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY 0x00000001
696 #define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY 0x00000002
697 #define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY 0x00000003
698 #define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY_PRIORITY 0x00000004
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000699
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300700 /* When enabled, all second phy nvram parameters will be swapped
701 with the first phy parameters */
702 #define PORT_HW_CFG_PHY_SWAPPED_MASK 0x00000008
703 #define PORT_HW_CFG_PHY_SWAPPED_SHIFT 3
704 #define PORT_HW_CFG_PHY_SWAPPED_DISABLED 0x00000000
705 #define PORT_HW_CFG_PHY_SWAPPED_ENABLED 0x00000008
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000706
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300707
708 /* Address of the second external phy */
709 u32 external_phy_config2; /* 0x294 */
710 #define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_MASK 0x000000FF
711 #define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_SHIFT 0
712
713 /* The second XGXS external PHY type */
714 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_MASK 0x0000FF00
715 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SHIFT 8
716 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_DIRECT 0x00000000
717 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8071 0x00000100
718 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8072 0x00000200
719 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8073 0x00000300
720 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8705 0x00000400
721 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8706 0x00000500
722 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8726 0x00000600
723 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8481 0x00000700
724 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SFX7101 0x00000800
725 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727 0x00000900
726 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727_NOC 0x00000a00
727 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84823 0x00000b00
728 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54640 0x00000c00
729 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84833 0x00000d00
Yaniv Rosner52c4d6c2011-07-05 01:06:34 +0000730 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54618SE 0x00000e00
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300731 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8722 0x00000f00
Yaniv Rosner3756a892011-08-23 06:33:24 +0000732 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54616 0x00001000
Yaniv Rosner0f6bb032012-11-27 03:46:32 +0000733 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84834 0x00001100
Yaniv Rosner924c6212015-07-22 09:16:24 +0300734 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84858 0x00001200
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300735 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_FAILURE 0x0000fd00
736 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_NOT_CONN 0x0000ff00
737
738
739 /* 4 times 16 bits for all 4 lanes. For some external PHYs (such as
740 8706, 8726 and 8727) not all 4 values are needed. */
741 u16 xgxs_config2_rx[4]; /* 0x296 */
742 u16 xgxs_config2_tx[4]; /* 0x2A0 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200743
744 u32 lane_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300745 #define PORT_HW_CFG_LANE_SWAP_CFG_MASK 0x0000ffff
746 #define PORT_HW_CFG_LANE_SWAP_CFG_SHIFT 0
747 /* AN and forced */
748 #define PORT_HW_CFG_LANE_SWAP_CFG_01230123 0x00001b1b
749 /* forced only */
750 #define PORT_HW_CFG_LANE_SWAP_CFG_01233210 0x00001be4
751 /* forced only */
752 #define PORT_HW_CFG_LANE_SWAP_CFG_31203120 0x0000d8d8
753 /* forced only */
754 #define PORT_HW_CFG_LANE_SWAP_CFG_32103210 0x0000e4e4
755 #define PORT_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000ff
756 #define PORT_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0
757 #define PORT_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000ff00
758 #define PORT_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8
759 #define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_MASK 0x0000c000
760 #define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_SHIFT 14
Dmitry Kravkov523224a2010-10-06 03:23:26 +0000761
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300762 /* Indicate whether to swap the external phy polarity */
763 #define PORT_HW_CFG_SWAP_PHY_POLARITY_MASK 0x00010000
764 #define PORT_HW_CFG_SWAP_PHY_POLARITY_DISABLED 0x00000000
765 #define PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED 0x00010000
766
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200767
768 u32 external_phy_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300769 #define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK 0x000000ff
770 #define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200771
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300772 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK 0x0000ff00
773 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SHIFT 8
774 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT 0x00000000
775 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8071 0x00000100
776 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072 0x00000200
777 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073 0x00000300
778 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705 0x00000400
779 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706 0x00000500
780 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726 0x00000600
781 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481 0x00000700
782 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101 0x00000800
783 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727 0x00000900
784 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727_NOC 0x00000a00
785 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823 0x00000b00
786 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54640 0x00000c00
787 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833 0x00000d00
Yaniv Rosner52c4d6c2011-07-05 01:06:34 +0000788 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE 0x00000e00
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300789 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722 0x00000f00
Yaniv Rosner3756a892011-08-23 06:33:24 +0000790 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616 0x00001000
Yaniv Rosner0f6bb032012-11-27 03:46:32 +0000791 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834 0x00001100
Yaniv Rosner924c6212015-07-22 09:16:24 +0300792 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84858 0x00001200
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300793 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT_WC 0x0000fc00
794 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00
795 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200796
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300797 #define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_MASK 0x00ff0000
798 #define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_SHIFT 16
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200799
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300800 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK 0xff000000
801 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_SHIFT 24
802 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT 0x00000000
803 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_BCM5482 0x01000000
804 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT_SD 0x02000000
805 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_NOT_CONN 0xff000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200806
807 u32 speed_capability_mask;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300808 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_MASK 0x0000ffff
809 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_SHIFT 0
810 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_FULL 0x00000001
811 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_HALF 0x00000002
812 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_HALF 0x00000004
813 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_FULL 0x00000008
814 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_1G 0x00000010
815 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_2_5G 0x00000020
816 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10G 0x00000040
817 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_20G 0x00000080
818 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_RESERVED 0x0000f000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200819
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300820 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK 0xffff0000
821 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_SHIFT 16
822 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL 0x00010000
823 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF 0x00020000
824 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF 0x00040000
825 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL 0x00080000
826 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_1G 0x00100000
827 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G 0x00200000
828 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10G 0x00400000
829 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_20G 0x00800000
830 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_RESERVED 0xf0000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200831
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300832 /* A place to hold the original MAC address as a backup */
833 u32 backup_mac_upper; /* 0x2B4 */
834 u32 backup_mac_lower; /* 0x2B8 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200835
836};
837
Eliezer Tamirf1410642008-02-28 11:51:50 -0800838
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200839/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300840 * Shared Feature configuration *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200841 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300842struct shared_feat_cfg { /* NVRAM Offset */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800843
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300844 u32 config; /* 0x450 */
845 #define SHARED_FEATURE_BMC_ECHO_MODE_EN 0x00000001
Eilon Greenstein589abe32009-02-12 08:36:55 +0000846
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300847 /* Use NVRAM values instead of HW default values */
848 #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_MASK \
849 0x00000002
850 #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_DISABLED \
851 0x00000000
852 #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_ENABLED \
853 0x00000002
Eilon Greenstein589abe32009-02-12 08:36:55 +0000854
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300855 #define SHARED_FEAT_CFG_NCSI_ID_METHOD_MASK 0x00000008
856 #define SHARED_FEAT_CFG_NCSI_ID_METHOD_SPIO 0x00000000
857 #define SHARED_FEAT_CFG_NCSI_ID_METHOD_NVRAM 0x00000008
858
859 #define SHARED_FEAT_CFG_NCSI_ID_MASK 0x00000030
860 #define SHARED_FEAT_CFG_NCSI_ID_SHIFT 4
861
862 /* Override the OTP back to single function mode. When using GPIO,
863 high means only SF, 0 is according to CLP configuration */
864 #define SHARED_FEAT_CFG_FORCE_SF_MODE_MASK 0x00000700
865 #define SHARED_FEAT_CFG_FORCE_SF_MODE_SHIFT 8
866 #define SHARED_FEAT_CFG_FORCE_SF_MODE_MF_ALLOWED 0x00000000
867 #define SHARED_FEAT_CFG_FORCE_SF_MODE_FORCED_SF 0x00000100
868 #define SHARED_FEAT_CFG_FORCE_SF_MODE_SPIO4 0x00000200
869 #define SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT 0x00000300
Barak Witkowskia3348722012-04-23 03:04:46 +0000870 #define SHARED_FEAT_CFG_FORCE_SF_MODE_AFEX_MODE 0x00000400
Yuval Mintz230d00e2015-07-22 09:16:25 +0300871 #define SHARED_FEAT_CFG_FORCE_SF_MODE_BD_MODE 0x00000500
Yuval Mintz76096472014-09-17 16:24:37 +0300872 #define SHARED_FEAT_CFG_FORCE_SF_MODE_UFP_MODE 0x00000600
Yuval Mintz83bad202014-09-17 16:24:38 +0300873 #define SHARED_FEAT_CFG_FORCE_SF_MODE_EXTENDED_MODE 0x00000700
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300874
875 /* The interval in seconds between sending LLDP packets. Set to zero
876 to disable the feature */
877 #define SHARED_FEAT_CFG_LLDP_XMIT_INTERVAL_MASK 0x00ff0000
878 #define SHARED_FEAT_CFG_LLDP_XMIT_INTERVAL_SHIFT 16
879
880 /* The assigned device type ID for LLDP usage */
881 #define SHARED_FEAT_CFG_LLDP_DEVICE_TYPE_ID_MASK 0xff000000
882 #define SHARED_FEAT_CFG_LLDP_DEVICE_TYPE_ID_SHIFT 24
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200883
884};
885
886
887/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300888 * Port Feature configuration *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200889 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300890struct port_feat_cfg { /* port 0: 0x454 port 1: 0x4c8 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800891
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200892 u32 config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300893 #define PORT_FEATURE_BAR1_SIZE_MASK 0x0000000f
894 #define PORT_FEATURE_BAR1_SIZE_SHIFT 0
895 #define PORT_FEATURE_BAR1_SIZE_DISABLED 0x00000000
896 #define PORT_FEATURE_BAR1_SIZE_64K 0x00000001
897 #define PORT_FEATURE_BAR1_SIZE_128K 0x00000002
898 #define PORT_FEATURE_BAR1_SIZE_256K 0x00000003
899 #define PORT_FEATURE_BAR1_SIZE_512K 0x00000004
900 #define PORT_FEATURE_BAR1_SIZE_1M 0x00000005
901 #define PORT_FEATURE_BAR1_SIZE_2M 0x00000006
902 #define PORT_FEATURE_BAR1_SIZE_4M 0x00000007
903 #define PORT_FEATURE_BAR1_SIZE_8M 0x00000008
904 #define PORT_FEATURE_BAR1_SIZE_16M 0x00000009
905 #define PORT_FEATURE_BAR1_SIZE_32M 0x0000000a
906 #define PORT_FEATURE_BAR1_SIZE_64M 0x0000000b
907 #define PORT_FEATURE_BAR1_SIZE_128M 0x0000000c
908 #define PORT_FEATURE_BAR1_SIZE_256M 0x0000000d
909 #define PORT_FEATURE_BAR1_SIZE_512M 0x0000000e
910 #define PORT_FEATURE_BAR1_SIZE_1G 0x0000000f
911 #define PORT_FEATURE_BAR2_SIZE_MASK 0x000000f0
912 #define PORT_FEATURE_BAR2_SIZE_SHIFT 4
913 #define PORT_FEATURE_BAR2_SIZE_DISABLED 0x00000000
914 #define PORT_FEATURE_BAR2_SIZE_64K 0x00000010
915 #define PORT_FEATURE_BAR2_SIZE_128K 0x00000020
916 #define PORT_FEATURE_BAR2_SIZE_256K 0x00000030
917 #define PORT_FEATURE_BAR2_SIZE_512K 0x00000040
918 #define PORT_FEATURE_BAR2_SIZE_1M 0x00000050
919 #define PORT_FEATURE_BAR2_SIZE_2M 0x00000060
920 #define PORT_FEATURE_BAR2_SIZE_4M 0x00000070
921 #define PORT_FEATURE_BAR2_SIZE_8M 0x00000080
922 #define PORT_FEATURE_BAR2_SIZE_16M 0x00000090
923 #define PORT_FEATURE_BAR2_SIZE_32M 0x000000a0
924 #define PORT_FEATURE_BAR2_SIZE_64M 0x000000b0
925 #define PORT_FEATURE_BAR2_SIZE_128M 0x000000c0
926 #define PORT_FEATURE_BAR2_SIZE_256M 0x000000d0
927 #define PORT_FEATURE_BAR2_SIZE_512M 0x000000e0
928 #define PORT_FEATURE_BAR2_SIZE_1G 0x000000f0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200929
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300930 #define PORT_FEAT_CFG_DCBX_MASK 0x00000100
931 #define PORT_FEAT_CFG_DCBX_DISABLED 0x00000000
932 #define PORT_FEAT_CFG_DCBX_ENABLED 0x00000100
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000933
Yuval Mintz4ba76992013-01-14 05:11:45 +0000934 #define PORT_FEAT_CFG_STORAGE_PERSONALITY_MASK 0x00000C00
935 #define PORT_FEAT_CFG_STORAGE_PERSONALITY_FCOE 0x00000400
936 #define PORT_FEAT_CFG_STORAGE_PERSONALITY_ISCSI 0x00000800
937
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300938 #define PORT_FEATURE_EN_SIZE_MASK 0x0f000000
939 #define PORT_FEATURE_EN_SIZE_SHIFT 24
940 #define PORT_FEATURE_WOL_ENABLED 0x01000000
941 #define PORT_FEATURE_MBA_ENABLED 0x02000000
942 #define PORT_FEATURE_MFW_ENABLED 0x04000000
943
944 /* Advertise expansion ROM even if MBA is disabled */
945 #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_MASK 0x08000000
946 #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_DISABLED 0x00000000
947 #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_ENABLED 0x08000000
948
949 /* Check the optic vendor via i2c against a list of approved modules
950 in a separate nvram image */
951 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK 0xe0000000
952 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_SHIFT 29
953 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_NO_ENFORCEMENT \
954 0x00000000
955 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER \
956 0x20000000
957 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_WARNING_MSG 0x40000000
958 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_POWER_DOWN 0x60000000
Eilon Greenstein589abe32009-02-12 08:36:55 +0000959
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200960 u32 wol_config;
961 /* Default is used when driver sets to "auto" mode */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300962 #define PORT_FEATURE_WOL_DEFAULT_MASK 0x00000003
963 #define PORT_FEATURE_WOL_DEFAULT_SHIFT 0
964 #define PORT_FEATURE_WOL_DEFAULT_DISABLE 0x00000000
965 #define PORT_FEATURE_WOL_DEFAULT_MAGIC 0x00000001
966 #define PORT_FEATURE_WOL_DEFAULT_ACPI 0x00000002
967 #define PORT_FEATURE_WOL_DEFAULT_MAGIC_AND_ACPI 0x00000003
968 #define PORT_FEATURE_WOL_RES_PAUSE_CAP 0x00000004
969 #define PORT_FEATURE_WOL_RES_ASYM_PAUSE_CAP 0x00000008
970 #define PORT_FEATURE_WOL_ACPI_UPON_MGMT 0x00000010
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200971
972 u32 mba_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300973 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_MASK 0x00000007
974 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_SHIFT 0
975 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_PXE 0x00000000
976 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_RPL 0x00000001
977 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_BOOTP 0x00000002
978 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_ISCSIB 0x00000003
979 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_FCOE_BOOT 0x00000004
980 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_NONE 0x00000007
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200981
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300982 #define PORT_FEATURE_MBA_BOOT_RETRY_MASK 0x00000038
983 #define PORT_FEATURE_MBA_BOOT_RETRY_SHIFT 3
984
985 #define PORT_FEATURE_MBA_RES_PAUSE_CAP 0x00000100
986 #define PORT_FEATURE_MBA_RES_ASYM_PAUSE_CAP 0x00000200
987 #define PORT_FEATURE_MBA_SETUP_PROMPT_ENABLE 0x00000400
988 #define PORT_FEATURE_MBA_HOTKEY_MASK 0x00000800
989 #define PORT_FEATURE_MBA_HOTKEY_CTRL_S 0x00000000
990 #define PORT_FEATURE_MBA_HOTKEY_CTRL_B 0x00000800
991 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_MASK 0x000ff000
992 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_SHIFT 12
993 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_DISABLED 0x00000000
994 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_2K 0x00001000
995 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_4K 0x00002000
996 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_8K 0x00003000
997 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_16K 0x00004000
998 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_32K 0x00005000
999 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_64K 0x00006000
1000 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_128K 0x00007000
1001 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_256K 0x00008000
1002 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_512K 0x00009000
1003 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_1M 0x0000a000
1004 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_2M 0x0000b000
1005 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_4M 0x0000c000
1006 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_8M 0x0000d000
1007 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_16M 0x0000e000
1008 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_32M 0x0000f000
1009 #define PORT_FEATURE_MBA_MSG_TIMEOUT_MASK 0x00f00000
1010 #define PORT_FEATURE_MBA_MSG_TIMEOUT_SHIFT 20
1011 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_MASK 0x03000000
1012 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_SHIFT 24
1013 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_AUTO 0x00000000
1014 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_BBS 0x01000000
1015 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT18H 0x02000000
1016 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT19H 0x03000000
1017 #define PORT_FEATURE_MBA_LINK_SPEED_MASK 0x3c000000
1018 #define PORT_FEATURE_MBA_LINK_SPEED_SHIFT 26
1019 #define PORT_FEATURE_MBA_LINK_SPEED_AUTO 0x00000000
1020 #define PORT_FEATURE_MBA_LINK_SPEED_10HD 0x04000000
1021 #define PORT_FEATURE_MBA_LINK_SPEED_10FD 0x08000000
1022 #define PORT_FEATURE_MBA_LINK_SPEED_100HD 0x0c000000
1023 #define PORT_FEATURE_MBA_LINK_SPEED_100FD 0x10000000
1024 #define PORT_FEATURE_MBA_LINK_SPEED_1GBPS 0x14000000
1025 #define PORT_FEATURE_MBA_LINK_SPEED_2_5GBPS 0x18000000
1026 #define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_CX4 0x1c000000
1027 #define PORT_FEATURE_MBA_LINK_SPEED_20GBPS 0x20000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001028 u32 bmc_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001029 #define PORT_FEATURE_BMC_LINK_OVERRIDE_MASK 0x00000001
1030 #define PORT_FEATURE_BMC_LINK_OVERRIDE_DEFAULT 0x00000000
1031 #define PORT_FEATURE_BMC_LINK_OVERRIDE_EN 0x00000001
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001032
1033 u32 mba_vlan_cfg;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001034 #define PORT_FEATURE_MBA_VLAN_TAG_MASK 0x0000ffff
1035 #define PORT_FEATURE_MBA_VLAN_TAG_SHIFT 0
1036 #define PORT_FEATURE_MBA_VLAN_EN 0x00010000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001037
1038 u32 resource_cfg;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001039 #define PORT_FEATURE_RESOURCE_CFG_VALID 0x00000001
1040 #define PORT_FEATURE_RESOURCE_CFG_DIAG 0x00000002
1041 #define PORT_FEATURE_RESOURCE_CFG_L2 0x00000004
1042 #define PORT_FEATURE_RESOURCE_CFG_ISCSI 0x00000008
1043 #define PORT_FEATURE_RESOURCE_CFG_RDMA 0x00000010
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001044
1045 u32 smbus_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001046 #define PORT_FEATURE_SMBUS_ADDR_MASK 0x000000fe
1047 #define PORT_FEATURE_SMBUS_ADDR_SHIFT 1
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001048
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001049 u32 vf_config;
1050 #define PORT_FEAT_CFG_VF_BAR2_SIZE_MASK 0x0000000f
1051 #define PORT_FEAT_CFG_VF_BAR2_SIZE_SHIFT 0
1052 #define PORT_FEAT_CFG_VF_BAR2_SIZE_DISABLED 0x00000000
1053 #define PORT_FEAT_CFG_VF_BAR2_SIZE_4K 0x00000001
1054 #define PORT_FEAT_CFG_VF_BAR2_SIZE_8K 0x00000002
1055 #define PORT_FEAT_CFG_VF_BAR2_SIZE_16K 0x00000003
1056 #define PORT_FEAT_CFG_VF_BAR2_SIZE_32K 0x00000004
1057 #define PORT_FEAT_CFG_VF_BAR2_SIZE_64K 0x00000005
1058 #define PORT_FEAT_CFG_VF_BAR2_SIZE_128K 0x00000006
1059 #define PORT_FEAT_CFG_VF_BAR2_SIZE_256K 0x00000007
1060 #define PORT_FEAT_CFG_VF_BAR2_SIZE_512K 0x00000008
1061 #define PORT_FEAT_CFG_VF_BAR2_SIZE_1M 0x00000009
1062 #define PORT_FEAT_CFG_VF_BAR2_SIZE_2M 0x0000000a
1063 #define PORT_FEAT_CFG_VF_BAR2_SIZE_4M 0x0000000b
1064 #define PORT_FEAT_CFG_VF_BAR2_SIZE_8M 0x0000000c
1065 #define PORT_FEAT_CFG_VF_BAR2_SIZE_16M 0x0000000d
1066 #define PORT_FEAT_CFG_VF_BAR2_SIZE_32M 0x0000000e
1067 #define PORT_FEAT_CFG_VF_BAR2_SIZE_64M 0x0000000f
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001068
1069 u32 link_config; /* Used as HW defaults for the driver */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001070 #define PORT_FEATURE_CONNECTED_SWITCH_MASK 0x03000000
1071 #define PORT_FEATURE_CONNECTED_SWITCH_SHIFT 24
1072 /* (forced) low speed switch (< 10G) */
1073 #define PORT_FEATURE_CON_SWITCH_1G_SWITCH 0x00000000
1074 /* (forced) high speed switch (>= 10G) */
1075 #define PORT_FEATURE_CON_SWITCH_10G_SWITCH 0x01000000
1076 #define PORT_FEATURE_CON_SWITCH_AUTO_DETECT 0x02000000
1077 #define PORT_FEATURE_CON_SWITCH_ONE_TIME_DETECT 0x03000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001078
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001079 #define PORT_FEATURE_LINK_SPEED_MASK 0x000f0000
1080 #define PORT_FEATURE_LINK_SPEED_SHIFT 16
1081 #define PORT_FEATURE_LINK_SPEED_AUTO 0x00000000
1082 #define PORT_FEATURE_LINK_SPEED_10M_FULL 0x00010000
1083 #define PORT_FEATURE_LINK_SPEED_10M_HALF 0x00020000
1084 #define PORT_FEATURE_LINK_SPEED_100M_HALF 0x00030000
1085 #define PORT_FEATURE_LINK_SPEED_100M_FULL 0x00040000
1086 #define PORT_FEATURE_LINK_SPEED_1G 0x00050000
1087 #define PORT_FEATURE_LINK_SPEED_2_5G 0x00060000
1088 #define PORT_FEATURE_LINK_SPEED_10G_CX4 0x00070000
1089 #define PORT_FEATURE_LINK_SPEED_20G 0x00080000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001090
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001091 #define PORT_FEATURE_FLOW_CONTROL_MASK 0x00000700
1092 #define PORT_FEATURE_FLOW_CONTROL_SHIFT 8
1093 #define PORT_FEATURE_FLOW_CONTROL_AUTO 0x00000000
1094 #define PORT_FEATURE_FLOW_CONTROL_TX 0x00000100
1095 #define PORT_FEATURE_FLOW_CONTROL_RX 0x00000200
1096 #define PORT_FEATURE_FLOW_CONTROL_BOTH 0x00000300
1097 #define PORT_FEATURE_FLOW_CONTROL_NONE 0x00000400
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001098
1099 /* The default for MCP link configuration,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001100 uses the same defines as link_config */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001101 u32 mfw_wol_link_cfg;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001102
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001103 /* The default for the driver of the second external phy,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001104 uses the same defines as link_config */
1105 u32 link_config2; /* 0x47C */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001106
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001107 /* The default for MCP of the second external phy,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001108 uses the same defines as link_config */
1109 u32 mfw_wol_link_cfg2; /* 0x480 */
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001110
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001111
Yuval Mintzc8c60d82012-06-06 17:13:07 +00001112 /* EEE power saving mode */
1113 u32 eee_power_mode; /* 0x484 */
1114 #define PORT_FEAT_CFG_EEE_POWER_MODE_MASK 0x000000FF
1115 #define PORT_FEAT_CFG_EEE_POWER_MODE_SHIFT 0
1116 #define PORT_FEAT_CFG_EEE_POWER_MODE_DISABLED 0x00000000
1117 #define PORT_FEAT_CFG_EEE_POWER_MODE_BALANCED 0x00000001
1118 #define PORT_FEAT_CFG_EEE_POWER_MODE_AGGRESSIVE 0x00000002
1119 #define PORT_FEAT_CFG_EEE_POWER_MODE_LOW_LATENCY 0x00000003
1120
1121
1122 u32 Reserved2[16]; /* 0x488 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001123};
1124
1125
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001126/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001127 * Device Information *
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001128 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001129struct shm_dev_info { /* size */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001130
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001131 u32 bc_rev; /* 8 bits each: major, minor, build */ /* 4 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001132
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001133 struct shared_hw_cfg shared_hw_config; /* 40 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001134
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001135 struct port_hw_cfg port_hw_config[PORT_MAX]; /* 400*2=800 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001136
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001137 struct shared_feat_cfg shared_feature_config; /* 4 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001138
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001139 struct port_feat_cfg port_feature_config[PORT_MAX];/* 116*2=232 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001140
1141};
1142
1143
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001144#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
1145 #error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition."
1146#endif
Eilon Greensteinad8d3942008-06-23 20:29:02 -07001147
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001148#define FUNC_0 0
1149#define FUNC_1 1
1150#define FUNC_2 2
1151#define FUNC_3 3
1152#define FUNC_4 4
1153#define FUNC_5 5
1154#define FUNC_6 6
1155#define FUNC_7 7
1156#define E1_FUNC_MAX 2
1157#define E1H_FUNC_MAX 8
1158#define E2_FUNC_MAX 4 /* per path */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001159
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001160#define VN_0 0
1161#define VN_1 1
1162#define VN_2 2
1163#define VN_3 3
1164#define E1VN_MAX 1
1165#define E1HVN_MAX 4
1166
1167#define E2_VF_MAX 64 /* HC_REG_VF_CONFIGURATION_SIZE */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001168/* This value (in milliseconds) determines the frequency of the driver
1169 * issuing the PULSE message code. The firmware monitors this periodic
1170 * pulse to determine when to switch to an OS-absent mode. */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001171#define DRV_PULSE_PERIOD_MS 250
Eliezer Tamirf1410642008-02-28 11:51:50 -08001172
1173/* This value (in milliseconds) determines how long the driver should
1174 * wait for an acknowledgement from the firmware before timing out. Once
1175 * the firmware has timed out, the driver will assume there is no firmware
1176 * running and there won't be any firmware-driver synchronization during a
1177 * driver reset. */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001178#define FW_ACK_TIME_OUT_MS 5000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001179
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001180#define FW_ACK_POLL_TIME_MS 1
Eliezer Tamirf1410642008-02-28 11:51:50 -08001181
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001182#define FW_ACK_NUM_OF_POLL (FW_ACK_TIME_OUT_MS/FW_ACK_POLL_TIME_MS)
Eliezer Tamirf1410642008-02-28 11:51:50 -08001183
Dmitry Kravkovde128802012-03-18 10:33:45 +00001184#define MFW_TRACE_SIGNATURE 0x54524342
1185
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001186/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001187 * Driver <-> FW Mailbox *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001188 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -08001189struct drv_port_mb {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001190
Eliezer Tamirf1410642008-02-28 11:51:50 -08001191 u32 link_status;
1192 /* Driver should update this field on any link change event */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001193
Yuval Mintzd0b8a6f2012-06-20 19:05:18 +00001194 #define LINK_STATUS_NONE (0<<0)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001195 #define LINK_STATUS_LINK_FLAG_MASK 0x00000001
1196 #define LINK_STATUS_LINK_UP 0x00000001
1197 #define LINK_STATUS_SPEED_AND_DUPLEX_MASK 0x0000001E
1198 #define LINK_STATUS_SPEED_AND_DUPLEX_AN_NOT_COMPLETE (0<<1)
1199 #define LINK_STATUS_SPEED_AND_DUPLEX_10THD (1<<1)
1200 #define LINK_STATUS_SPEED_AND_DUPLEX_10TFD (2<<1)
1201 #define LINK_STATUS_SPEED_AND_DUPLEX_100TXHD (3<<1)
1202 #define LINK_STATUS_SPEED_AND_DUPLEX_100T4 (4<<1)
1203 #define LINK_STATUS_SPEED_AND_DUPLEX_100TXFD (5<<1)
1204 #define LINK_STATUS_SPEED_AND_DUPLEX_1000THD (6<<1)
1205 #define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD (7<<1)
1206 #define LINK_STATUS_SPEED_AND_DUPLEX_1000XFD (7<<1)
1207 #define LINK_STATUS_SPEED_AND_DUPLEX_2500THD (8<<1)
1208 #define LINK_STATUS_SPEED_AND_DUPLEX_2500TFD (9<<1)
1209 #define LINK_STATUS_SPEED_AND_DUPLEX_2500XFD (9<<1)
1210 #define LINK_STATUS_SPEED_AND_DUPLEX_10GTFD (10<<1)
1211 #define LINK_STATUS_SPEED_AND_DUPLEX_10GXFD (10<<1)
1212 #define LINK_STATUS_SPEED_AND_DUPLEX_20GTFD (11<<1)
1213 #define LINK_STATUS_SPEED_AND_DUPLEX_20GXFD (11<<1)
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001214
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001215 #define LINK_STATUS_AUTO_NEGOTIATE_FLAG_MASK 0x00000020
1216 #define LINK_STATUS_AUTO_NEGOTIATE_ENABLED 0x00000020
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001217
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001218 #define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE 0x00000040
1219 #define LINK_STATUS_PARALLEL_DETECTION_FLAG_MASK 0x00000080
1220 #define LINK_STATUS_PARALLEL_DETECTION_USED 0x00000080
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001221
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001222 #define LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE 0x00000200
1223 #define LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE 0x00000400
1224 #define LINK_STATUS_LINK_PARTNER_100T4_CAPABLE 0x00000800
1225 #define LINK_STATUS_LINK_PARTNER_100TXFD_CAPABLE 0x00001000
1226 #define LINK_STATUS_LINK_PARTNER_100TXHD_CAPABLE 0x00002000
1227 #define LINK_STATUS_LINK_PARTNER_10TFD_CAPABLE 0x00004000
1228 #define LINK_STATUS_LINK_PARTNER_10THD_CAPABLE 0x00008000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001229
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001230 #define LINK_STATUS_TX_FLOW_CONTROL_FLAG_MASK 0x00010000
1231 #define LINK_STATUS_TX_FLOW_CONTROL_ENABLED 0x00010000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001232
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001233 #define LINK_STATUS_RX_FLOW_CONTROL_FLAG_MASK 0x00020000
1234 #define LINK_STATUS_RX_FLOW_CONTROL_ENABLED 0x00020000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001235
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001236 #define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK 0x000C0000
1237 #define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE (0<<18)
1238 #define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE (1<<18)
1239 #define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE (2<<18)
1240 #define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE (3<<18)
Eliezer Tamirf1410642008-02-28 11:51:50 -08001241
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001242 #define LINK_STATUS_SERDES_LINK 0x00100000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001243
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001244 #define LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE 0x00200000
1245 #define LINK_STATUS_LINK_PARTNER_2500XHD_CAPABLE 0x00400000
1246 #define LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE 0x00800000
1247 #define LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE 0x10000000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001248
Yaniv Rosnerb8d6d082011-07-05 01:06:27 +00001249 #define LINK_STATUS_PFC_ENABLED 0x20000000
1250
Yaniv Rosnerde6f3372011-08-02 22:59:25 +00001251 #define LINK_STATUS_PHYSICAL_LINK_FLAG 0x40000000
Yuval Mintzd0b8a6f2012-06-20 19:05:18 +00001252 #define LINK_STATUS_SFP_TX_FAULT 0x80000000
Yaniv Rosnerde6f3372011-08-02 22:59:25 +00001253
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001254 u32 port_stx;
1255
Eilon Greensteinde832a52009-02-12 08:36:33 +00001256 u32 stat_nig_timer;
1257
Eilon Greensteina35da8d2009-02-12 08:37:02 +00001258 /* MCP firmware does not use this field */
1259 u32 ext_phy_fw_version;
Eliezer Tamirf1410642008-02-28 11:51:50 -08001260
1261};
1262
1263
1264struct drv_func_mb {
1265
1266 u32 drv_mb_header;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001267 #define DRV_MSG_CODE_MASK 0xffff0000
1268 #define DRV_MSG_CODE_LOAD_REQ 0x10000000
1269 #define DRV_MSG_CODE_LOAD_DONE 0x11000000
1270 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_EN 0x20000000
1271 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS 0x20010000
1272 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP 0x20020000
1273 #define DRV_MSG_CODE_UNLOAD_DONE 0x21000000
1274 #define DRV_MSG_CODE_DCC_OK 0x30000000
1275 #define DRV_MSG_CODE_DCC_FAILURE 0x31000000
1276 #define DRV_MSG_CODE_DIAG_ENTER_REQ 0x50000000
1277 #define DRV_MSG_CODE_DIAG_EXIT_REQ 0x60000000
1278 #define DRV_MSG_CODE_VALIDATE_KEY 0x70000000
1279 #define DRV_MSG_CODE_GET_CURR_KEY 0x80000000
1280 #define DRV_MSG_CODE_GET_UPGRADE_KEY 0x81000000
1281 #define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000
1282 #define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000
Yuval Mintz76096472014-09-17 16:24:37 +03001283 #define DRV_MSG_CODE_OEM_OK 0x00010000
1284 #define DRV_MSG_CODE_OEM_FAILURE 0x00020000
1285 #define DRV_MSG_CODE_OEM_UPDATE_SVID_OK 0x00030000
1286 #define DRV_MSG_CODE_OEM_UPDATE_SVID_FAILURE 0x00040000
Eilon Greenstein4d295db2009-07-21 05:47:47 +00001287 /*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001288 * The optic module verification command requires bootcode
1289 * v5.0.6 or later, te specific optic module verification command
1290 * requires bootcode v5.2.12 or later
Eilon Greenstein4d295db2009-07-21 05:47:47 +00001291 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001292 #define DRV_MSG_CODE_VRFY_FIRST_PHY_OPT_MDL 0xa0000000
1293 #define REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL 0x00050006
1294 #define DRV_MSG_CODE_VRFY_SPECIFIC_PHY_OPT_MDL 0xa1000000
1295 #define REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL 0x00050234
Barak Witkowskia3348722012-04-23 03:04:46 +00001296 #define DRV_MSG_CODE_VRFY_AFEX_SUPPORTED 0xa2000000
1297 #define REQ_BC_VER_4_VRFY_AFEX_SUPPORTED 0x00070002
Yaniv Rosner85242ee2011-07-05 01:06:53 +00001298 #define REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED 0x00070014
Yaniv Rosner55386fe82012-11-27 03:46:30 +00001299 #define REQ_BC_VER_4_MT_SUPPORTED 0x00070201
Barak Witkowski0e898dd2011-12-05 21:52:22 +00001300 #define REQ_BC_VER_4_PFC_STATS_SUPPORTED 0x00070201
Barak Witkowski2e499d32012-06-26 01:31:19 +00001301 #define REQ_BC_VER_4_FCOE_FEATURES 0x00070209
Eliezer Tamirf1410642008-02-28 11:51:50 -08001302
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001303 #define DRV_MSG_CODE_DCBX_ADMIN_PMF_MSG 0xb0000000
1304 #define DRV_MSG_CODE_DCBX_PMF_DRV_OK 0xb2000000
Barak Witkowski98768792012-06-19 07:48:31 +00001305 #define REQ_BC_VER_4_DCBX_ADMIN_MSG_NON_PMF 0x00070401
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001306
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001307 #define DRV_MSG_CODE_VF_DISABLED_DONE 0xc0000000
Barak Witkowskia3348722012-04-23 03:04:46 +00001308
1309 #define DRV_MSG_CODE_AFEX_DRIVER_SETMAC 0xd0000000
1310 #define DRV_MSG_CODE_AFEX_LISTGET_ACK 0xd1000000
1311 #define DRV_MSG_CODE_AFEX_LISTSET_ACK 0xd2000000
1312 #define DRV_MSG_CODE_AFEX_STATSGET_ACK 0xd3000000
1313 #define DRV_MSG_CODE_AFEX_VIFSET_ACK 0xd4000000
1314
Barak Witkowski1d187b32011-12-05 22:41:50 +00001315 #define DRV_MSG_CODE_DRV_INFO_ACK 0xd8000000
1316 #define DRV_MSG_CODE_DRV_INFO_NACK 0xd9000000
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001317
Yuval Mintzc8c60d82012-06-06 17:13:07 +00001318 #define DRV_MSG_CODE_EEE_RESULTS_ACK 0xda000000
1319
Barak Witkowskya6d3a5b2013-08-13 02:25:02 +03001320 #define DRV_MSG_CODE_RMMOD 0xdb000000
1321 #define REQ_BC_VER_4_RMMOD_CMD 0x0007080f
1322
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001323 #define DRV_MSG_CODE_SET_MF_BW 0xe0000000
1324 #define REQ_BC_VER_4_SET_MF_BW 0x00060202
1325 #define DRV_MSG_CODE_SET_MF_BW_ACK 0xe1000000
1326
1327 #define DRV_MSG_CODE_LINK_STATUS_CHANGED 0x01000000
1328
Yuval Mintz452427b2012-03-26 20:47:07 +00001329 #define DRV_MSG_CODE_INITIATE_FLR 0x02000000
1330 #define REQ_BC_VER_4_INITIATE_FLR 0x00070213
1331
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001332 #define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000
1333 #define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000
1334 #define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000
1335 #define BIOS_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
1336
1337 #define DRV_MSG_SEQ_NUMBER_MASK 0x0000ffff
Eliezer Tamirf1410642008-02-28 11:51:50 -08001338
1339 u32 drv_mb_param;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001340 #define DRV_MSG_CODE_SET_MF_BW_MIN_MASK 0x00ff0000
1341 #define DRV_MSG_CODE_SET_MF_BW_MAX_MASK 0xff000000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001342
Yuval Mintz5d07d862012-09-13 02:56:21 +00001343 #define DRV_MSG_CODE_UNLOAD_SKIP_LINK_RESET 0x00000002
1344
1345 #define DRV_MSG_CODE_LOAD_REQ_WITH_LFA 0x0000100a
Dmitry Kravkov178135c2013-05-22 21:21:50 +00001346 #define DRV_MSG_CODE_LOAD_REQ_FORCE_LFA 0x00002000
1347
Eliezer Tamirf1410642008-02-28 11:51:50 -08001348 u32 fw_mb_header;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001349 #define FW_MSG_CODE_MASK 0xffff0000
1350 #define FW_MSG_CODE_DRV_LOAD_COMMON 0x10100000
1351 #define FW_MSG_CODE_DRV_LOAD_PORT 0x10110000
1352 #define FW_MSG_CODE_DRV_LOAD_FUNCTION 0x10120000
1353 /* Load common chip is supported from bc 6.0.0 */
1354 #define REQ_BC_VER_4_DRV_LOAD_COMMON_CHIP 0x00060000
1355 #define FW_MSG_CODE_DRV_LOAD_COMMON_CHIP 0x10130000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001356
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001357 #define FW_MSG_CODE_DRV_LOAD_REFUSED 0x10200000
1358 #define FW_MSG_CODE_DRV_LOAD_DONE 0x11100000
1359 #define FW_MSG_CODE_DRV_UNLOAD_COMMON 0x20100000
1360 #define FW_MSG_CODE_DRV_UNLOAD_PORT 0x20110000
1361 #define FW_MSG_CODE_DRV_UNLOAD_FUNCTION 0x20120000
1362 #define FW_MSG_CODE_DRV_UNLOAD_DONE 0x21100000
1363 #define FW_MSG_CODE_DCC_DONE 0x30100000
1364 #define FW_MSG_CODE_LLDP_DONE 0x40100000
1365 #define FW_MSG_CODE_DIAG_ENTER_DONE 0x50100000
1366 #define FW_MSG_CODE_DIAG_REFUSE 0x50200000
1367 #define FW_MSG_CODE_DIAG_EXIT_DONE 0x60100000
1368 #define FW_MSG_CODE_VALIDATE_KEY_SUCCESS 0x70100000
1369 #define FW_MSG_CODE_VALIDATE_KEY_FAILURE 0x70200000
1370 #define FW_MSG_CODE_GET_KEY_DONE 0x80100000
1371 #define FW_MSG_CODE_NO_KEY 0x80f00000
1372 #define FW_MSG_CODE_LIC_INFO_NOT_READY 0x80f80000
1373 #define FW_MSG_CODE_L2B_PRAM_LOADED 0x90100000
1374 #define FW_MSG_CODE_L2B_PRAM_T_LOAD_FAILURE 0x90210000
1375 #define FW_MSG_CODE_L2B_PRAM_C_LOAD_FAILURE 0x90220000
1376 #define FW_MSG_CODE_L2B_PRAM_X_LOAD_FAILURE 0x90230000
1377 #define FW_MSG_CODE_L2B_PRAM_U_LOAD_FAILURE 0x90240000
1378 #define FW_MSG_CODE_VRFY_OPT_MDL_SUCCESS 0xa0100000
1379 #define FW_MSG_CODE_VRFY_OPT_MDL_INVLD_IMG 0xa0200000
1380 #define FW_MSG_CODE_VRFY_OPT_MDL_UNAPPROVED 0xa0300000
1381 #define FW_MSG_CODE_VF_DISABLED_DONE 0xb0000000
Barak Witkowskia3348722012-04-23 03:04:46 +00001382 #define FW_MSG_CODE_HW_SET_INVALID_IMAGE 0xb0100000
1383
1384 #define FW_MSG_CODE_AFEX_DRIVER_SETMAC_DONE 0xd0100000
1385 #define FW_MSG_CODE_AFEX_LISTGET_ACK 0xd1100000
1386 #define FW_MSG_CODE_AFEX_LISTSET_ACK 0xd2100000
1387 #define FW_MSG_CODE_AFEX_STATSGET_ACK 0xd3100000
1388 #define FW_MSG_CODE_AFEX_VIFSET_ACK 0xd4100000
1389
Barak Witkowski1d187b32011-12-05 22:41:50 +00001390 #define FW_MSG_CODE_DRV_INFO_ACK 0xd8100000
1391 #define FW_MSG_CODE_DRV_INFO_NACK 0xd9100000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001392
Yuval Mintzc8c60d82012-06-06 17:13:07 +00001393 #define FW_MSG_CODE_EEE_RESULS_ACK 0xda100000
1394
Barak Witkowskya6d3a5b2013-08-13 02:25:02 +03001395 #define FW_MSG_CODE_RMMOD_ACK 0xdb100000
1396
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001397 #define FW_MSG_CODE_SET_MF_BW_SENT 0xe0000000
1398 #define FW_MSG_CODE_SET_MF_BW_DONE 0xe1000000
1399
1400 #define FW_MSG_CODE_LINK_CHANGED_ACK 0x01100000
1401
1402 #define FW_MSG_CODE_LIC_CHALLENGE 0xff010000
1403 #define FW_MSG_CODE_LIC_RESPONSE 0xff020000
1404 #define FW_MSG_CODE_VIRT_MAC_PRIM 0xff030000
1405 #define FW_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
1406
1407 #define FW_MSG_SEQ_NUMBER_MASK 0x0000ffff
Eliezer Tamirf1410642008-02-28 11:51:50 -08001408
1409 u32 fw_mb_param;
1410
1411 u32 drv_pulse_mb;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001412 #define DRV_PULSE_SEQ_MASK 0x00007fff
1413 #define DRV_PULSE_SYSTEM_TIME_MASK 0xffff0000
1414 /*
1415 * The system time is in the format of
1416 * (year-2001)*12*32 + month*32 + day.
1417 */
1418 #define DRV_PULSE_ALWAYS_ALIVE 0x00008000
1419 /*
1420 * Indicate to the firmware not to go into the
Eliezer Tamirf1410642008-02-28 11:51:50 -08001421 * OS-absent when it is not getting driver pulse.
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001422 * This is used for debugging as well for PXE(MBA).
1423 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001424
1425 u32 mcp_pulse_mb;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001426 #define MCP_PULSE_SEQ_MASK 0x00007fff
1427 #define MCP_PULSE_ALWAYS_ALIVE 0x00008000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001428 /* Indicates to the driver not to assert due to lack
1429 * of MCP response */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001430 #define MCP_EVENT_MASK 0xffff0000
1431 #define MCP_EVENT_OTHER_DRIVER_RESET_REQ 0x00010000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001432
1433 u32 iscsi_boot_signature;
1434 u32 iscsi_boot_block_offset;
1435
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001436 u32 drv_status;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001437 #define DRV_STATUS_PMF 0x00000001
1438 #define DRV_STATUS_VF_DISABLED 0x00000002
1439 #define DRV_STATUS_SET_MF_BW 0x00000004
1440 #define DRV_STATUS_LINK_EVENT 0x00000008
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001441
Yuval Mintz76096472014-09-17 16:24:37 +03001442 #define DRV_STATUS_OEM_EVENT_MASK 0x00000070
1443 #define DRV_STATUS_OEM_DISABLE_ENABLE_PF 0x00000010
1444 #define DRV_STATUS_OEM_BANDWIDTH_ALLOCATION 0x00000020
1445
1446 #define DRV_STATUS_OEM_UPDATE_SVID 0x00000080
1447
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001448 #define DRV_STATUS_DCC_EVENT_MASK 0x0000ff00
1449 #define DRV_STATUS_DCC_DISABLE_ENABLE_PF 0x00000100
1450 #define DRV_STATUS_DCC_BANDWIDTH_ALLOCATION 0x00000200
1451 #define DRV_STATUS_DCC_CHANGE_MAC_ADDRESS 0x00000400
1452 #define DRV_STATUS_DCC_RESERVED1 0x00000800
1453 #define DRV_STATUS_DCC_SET_PROTOCOL 0x00001000
1454 #define DRV_STATUS_DCC_SET_PRIORITY 0x00002000
1455
1456 #define DRV_STATUS_DCBX_EVENT_MASK 0x000f0000
1457 #define DRV_STATUS_DCBX_NEGOTIATION_RESULTS 0x00010000
Barak Witkowskia3348722012-04-23 03:04:46 +00001458 #define DRV_STATUS_AFEX_EVENT_MASK 0x03f00000
1459 #define DRV_STATUS_AFEX_LISTGET_REQ 0x00100000
1460 #define DRV_STATUS_AFEX_LISTSET_REQ 0x00200000
1461 #define DRV_STATUS_AFEX_STATSGET_REQ 0x00400000
1462 #define DRV_STATUS_AFEX_VIFSET_REQ 0x00800000
1463
Barak Witkowski1d187b32011-12-05 22:41:50 +00001464 #define DRV_STATUS_DRV_INFO_REQ 0x04000000
Eilon Greenstein2691d512009-08-12 08:22:08 +00001465
Yuval Mintzc8c60d82012-06-06 17:13:07 +00001466 #define DRV_STATUS_EEE_NEGOTIATION_RESULTS 0x08000000
1467
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001468 u32 virt_mac_upper;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001469 #define VIRT_MAC_SIGN_MASK 0xffff0000
1470 #define VIRT_MAC_SIGNATURE 0x564d0000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001471 u32 virt_mac_lower;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001472
1473};
1474
1475
1476/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001477 * Management firmware state *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001478 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -08001479/* Allocate 440 bytes for management firmware */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001480#define MGMTFW_STATE_WORD_SIZE 110
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001481
1482struct mgmtfw_state {
1483 u32 opaque[MGMTFW_STATE_WORD_SIZE];
1484};
1485
1486
1487/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001488 * Multi-Function configuration *
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001489 ****************************************************************************/
1490struct shared_mf_cfg {
1491
1492 u32 clp_mb;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001493 #define SHARED_MF_CLP_SET_DEFAULT 0x00000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001494 /* set by CLP */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001495 #define SHARED_MF_CLP_EXIT 0x00000001
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001496 /* set by MCP */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001497 #define SHARED_MF_CLP_EXIT_DONE 0x00010000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001498
1499};
1500
1501struct port_mf_cfg {
1502
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001503 u32 dynamic_cfg; /* device control channel */
1504 #define PORT_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
1505 #define PORT_MF_CFG_E1HOV_TAG_SHIFT 0
1506 #define PORT_MF_CFG_E1HOV_TAG_DEFAULT PORT_MF_CFG_E1HOV_TAG_MASK
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001507
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00001508 u32 reserved[1];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001509
1510};
1511
1512struct func_mf_cfg {
1513
1514 u32 config;
1515 /* E/R/I/D */
1516 /* function 0 of each port cannot be hidden */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001517 #define FUNC_MF_CFG_FUNC_HIDE 0x00000001
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001518
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001519 #define FUNC_MF_CFG_PROTOCOL_MASK 0x00000006
1520 #define FUNC_MF_CFG_PROTOCOL_FCOE 0x00000000
1521 #define FUNC_MF_CFG_PROTOCOL_ETHERNET 0x00000002
1522 #define FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA 0x00000004
1523 #define FUNC_MF_CFG_PROTOCOL_ISCSI 0x00000006
1524 #define FUNC_MF_CFG_PROTOCOL_DEFAULT \
1525 FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001526
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001527 #define FUNC_MF_CFG_FUNC_DISABLED 0x00000008
1528 #define FUNC_MF_CFG_FUNC_DELETED 0x00000010
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001529
1530 /* PRI */
1531 /* 0 - low priority, 3 - high priority */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001532 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_MASK 0x00000300
1533 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_SHIFT 8
1534 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_DEFAULT 0x00000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001535
1536 /* MINBW, MAXBW */
1537 /* value range - 0..100, increments in 100Mbps */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001538 #define FUNC_MF_CFG_MIN_BW_MASK 0x00ff0000
1539 #define FUNC_MF_CFG_MIN_BW_SHIFT 16
1540 #define FUNC_MF_CFG_MIN_BW_DEFAULT 0x00000000
1541 #define FUNC_MF_CFG_MAX_BW_MASK 0xff000000
1542 #define FUNC_MF_CFG_MAX_BW_SHIFT 24
1543 #define FUNC_MF_CFG_MAX_BW_DEFAULT 0x64000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001544
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001545 u32 mac_upper; /* MAC */
1546 #define FUNC_MF_CFG_UPPERMAC_MASK 0x0000ffff
1547 #define FUNC_MF_CFG_UPPERMAC_SHIFT 0
1548 #define FUNC_MF_CFG_UPPERMAC_DEFAULT FUNC_MF_CFG_UPPERMAC_MASK
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001549 u32 mac_lower;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001550 #define FUNC_MF_CFG_LOWERMAC_DEFAULT 0xffffffff
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001551
1552 u32 e1hov_tag; /* VNI */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001553 #define FUNC_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
1554 #define FUNC_MF_CFG_E1HOV_TAG_SHIFT 0
1555 #define FUNC_MF_CFG_E1HOV_TAG_DEFAULT FUNC_MF_CFG_E1HOV_TAG_MASK
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001556
Barak Witkowskia3348722012-04-23 03:04:46 +00001557 /* afex default VLAN ID - 12 bits */
1558 #define FUNC_MF_CFG_AFEX_VLAN_MASK 0x0fff0000
1559 #define FUNC_MF_CFG_AFEX_VLAN_SHIFT 16
1560
1561 u32 afex_config;
1562 #define FUNC_MF_CFG_AFEX_COS_FILTER_MASK 0x000000ff
1563 #define FUNC_MF_CFG_AFEX_COS_FILTER_SHIFT 0
1564 #define FUNC_MF_CFG_AFEX_MBA_ENABLED_MASK 0x0000ff00
1565 #define FUNC_MF_CFG_AFEX_MBA_ENABLED_SHIFT 8
1566 #define FUNC_MF_CFG_AFEX_MBA_ENABLED_VAL 0x00000100
1567 #define FUNC_MF_CFG_AFEX_VLAN_MODE_MASK 0x000f0000
1568 #define FUNC_MF_CFG_AFEX_VLAN_MODE_SHIFT 16
1569
1570 u32 reserved;
1571};
1572
1573enum mf_cfg_afex_vlan_mode {
1574 FUNC_MF_CFG_AFEX_VLAN_TRUNK_MODE = 0,
1575 FUNC_MF_CFG_AFEX_VLAN_ACCESS_MODE,
1576 FUNC_MF_CFG_AFEX_VLAN_TRUNK_TAG_NATIVE_MODE
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001577};
1578
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001579/* This structure is not applicable and should not be accessed on 57711 */
1580struct func_ext_cfg {
1581 u32 func_cfg;
Yuval Mintz79642112012-12-02 04:05:50 +00001582 #define MACP_FUNC_CFG_FLAGS_MASK 0x0000007F
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001583 #define MACP_FUNC_CFG_FLAGS_SHIFT 0
1584 #define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001
1585 #define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002
1586 #define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004
1587 #define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008
Yuval Mintz79642112012-12-02 04:05:50 +00001588 #define MACP_FUNC_CFG_PAUSE_ON_HOST_RING 0x00000080
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001589
1590 u32 iscsi_mac_addr_upper;
1591 u32 iscsi_mac_addr_lower;
1592
1593 u32 fcoe_mac_addr_upper;
1594 u32 fcoe_mac_addr_lower;
1595
1596 u32 fcoe_wwn_port_name_upper;
1597 u32 fcoe_wwn_port_name_lower;
1598
1599 u32 fcoe_wwn_node_name_upper;
1600 u32 fcoe_wwn_node_name_lower;
1601
1602 u32 preserve_data;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001603 #define MF_FUNC_CFG_PRESERVE_L2_MAC (1<<0)
1604 #define MF_FUNC_CFG_PRESERVE_ISCSI_MAC (1<<1)
1605 #define MF_FUNC_CFG_PRESERVE_FCOE_MAC (1<<2)
1606 #define MF_FUNC_CFG_PRESERVE_FCOE_WWN_P (1<<3)
1607 #define MF_FUNC_CFG_PRESERVE_FCOE_WWN_N (1<<4)
1608 #define MF_FUNC_CFG_PRESERVE_TX_BW (1<<5)
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001609};
1610
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001611struct mf_cfg {
1612
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001613 struct shared_mf_cfg shared_mf_config; /* 0x4 */
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00001614 /* 0x8*2*2=0x20 */
1615 struct port_mf_cfg port_mf_config[NVM_PATH_MAX][PORT_MAX];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001616 /* for all chips, there are 8 mf functions */
1617 struct func_mf_cfg func_mf_config[E1H_FUNC_MAX]; /* 0x18 * 8 = 0xc0 */
1618 /*
1619 * Extended configuration per function - this array does not exist and
1620 * should not be accessed on 57711
1621 */
1622 struct func_ext_cfg func_ext_config[E1H_FUNC_MAX]; /* 0x28 * 8 = 0x140*/
1623}; /* 0x224 */
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001624
1625/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001626 * Shared Memory Region *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001627 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001628struct shmem_region { /* SharedMem Offset (size) */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001629
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001630 u32 validity_map[PORT_MAX]; /* 0x0 (4*2 = 0x8) */
1631 #define SHR_MEM_FORMAT_REV_MASK 0xff000000
1632 #define SHR_MEM_FORMAT_REV_ID ('A'<<24)
Eliezer Tamirf1410642008-02-28 11:51:50 -08001633 /* validity bits */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001634 #define SHR_MEM_VALIDITY_PCI_CFG 0x00100000
1635 #define SHR_MEM_VALIDITY_MB 0x00200000
1636 #define SHR_MEM_VALIDITY_DEV_INFO 0x00400000
1637 #define SHR_MEM_VALIDITY_RESERVED 0x00000007
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001638 /* One licensing bit should be set */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001639 #define SHR_MEM_VALIDITY_LIC_KEY_IN_EFFECT_MASK 0x00000038
1640 #define SHR_MEM_VALIDITY_LIC_MANUF_KEY_IN_EFFECT 0x00000008
1641 #define SHR_MEM_VALIDITY_LIC_UPGRADE_KEY_IN_EFFECT 0x00000010
1642 #define SHR_MEM_VALIDITY_LIC_NO_KEY_IN_EFFECT 0x00000020
Eliezer Tamirf1410642008-02-28 11:51:50 -08001643 /* Active MFW */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001644 #define SHR_MEM_VALIDITY_ACTIVE_MFW_UNKNOWN 0x00000000
1645 #define SHR_MEM_VALIDITY_ACTIVE_MFW_MASK 0x000001c0
1646 #define SHR_MEM_VALIDITY_ACTIVE_MFW_IPMI 0x00000040
1647 #define SHR_MEM_VALIDITY_ACTIVE_MFW_UMP 0x00000080
1648 #define SHR_MEM_VALIDITY_ACTIVE_MFW_NCSI 0x000000c0
1649 #define SHR_MEM_VALIDITY_ACTIVE_MFW_NONE 0x000001c0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001650
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001651 struct shm_dev_info dev_info; /* 0x8 (0x438) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001652
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001653 struct license_key drv_lic_key[PORT_MAX]; /* 0x440 (52*2=0x68) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001654
1655 /* FW information (for internal FW use) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001656 u32 fw_info_fio_offset; /* 0x4a8 (0x4) */
1657 struct mgmtfw_state mgmtfw_state; /* 0x4ac (0x1b8) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001658
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001659 struct drv_port_mb port_mb[PORT_MAX]; /* 0x664 (16*2=0x20) */
1660
1661#ifdef BMAPI
1662 /* This is a variable length array */
1663 /* the number of function depends on the chip type */
1664 struct drv_func_mb func_mb[1]; /* 0x684 (44*2/4/8=0x58/0xb0/0x160) */
1665#else
1666 /* the number of function depends on the chip type */
1667 struct drv_func_mb func_mb[]; /* 0x684 (44*2/4/8=0x58/0xb0/0x160) */
1668#endif /* BMAPI */
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001669
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001670}; /* 57710 = 0x6dc | 57711 = 0x7E4 | 57712 = 0x734 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001671
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001672/****************************************************************************
1673 * Shared Memory 2 Region *
1674 ****************************************************************************/
1675/* The fw_flr_ack is actually built in the following way: */
1676/* 8 bit: PF ack */
1677/* 64 bit: VF ack */
1678/* 8 bit: ios_dis_ack */
1679/* In order to maintain endianity in the mailbox hsi, we want to keep using */
1680/* u32. The fw must have the VF right after the PF since this is how it */
1681/* access arrays(it expects always the VF to reside after the PF, and that */
1682/* makes the calculation much easier for it. ) */
1683/* In order to answer both limitations, and keep the struct small, the code */
1684/* will abuse the structure defined here to achieve the actual partition */
1685/* above */
1686/****************************************************************************/
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001687struct fw_flr_ack {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001688 u32 pf_ack;
1689 u32 vf_ack[1];
1690 u32 iov_dis_ack;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001691};
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001692
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001693struct fw_flr_mb {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001694 u32 aggint;
1695 u32 opgen_addr;
1696 struct fw_flr_ack ack;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001697};
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001698
Yuval Mintzc8c60d82012-06-06 17:13:07 +00001699struct eee_remote_vals {
1700 u32 tx_tw;
1701 u32 rx_tw;
1702};
1703
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001704/**** SUPPORT FOR SHMEM ARRRAYS ***
1705 * The SHMEM HSI is aligned on 32 bit boundaries which makes it difficult to
1706 * define arrays with storage types smaller then unsigned dwords.
1707 * The macros below add generic support for SHMEM arrays with numeric elements
1708 * that can span 2,4,8 or 16 bits. The array underlying type is a 32 bit dword
1709 * array with individual bit-filed elements accessed using shifts and masks.
1710 *
1711 */
1712
1713/* eb is the bitwidth of a single element */
1714#define SHMEM_ARRAY_MASK(eb) ((1<<(eb))-1)
1715#define SHMEM_ARRAY_ENTRY(i, eb) ((i)/(32/(eb)))
1716
1717/* the bit-position macro allows the used to flip the order of the arrays
1718 * elements on a per byte or word boundary.
1719 *
1720 * example: an array with 8 entries each 4 bit wide. This array will fit into
1721 * a single dword. The diagrmas below show the array order of the nibbles.
1722 *
1723 * SHMEM_ARRAY_BITPOS(i, 4, 4) defines the stadard ordering:
1724 *
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001725 * | | | |
1726 * 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
1727 * | | | |
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001728 *
1729 * SHMEM_ARRAY_BITPOS(i, 4, 8) defines a flip ordering per byte:
1730 *
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001731 * | | | |
1732 * 1 | 0 | 3 | 2 | 5 | 4 | 7 | 6 |
1733 * | | | |
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001734 *
1735 * SHMEM_ARRAY_BITPOS(i, 4, 16) defines a flip ordering per word:
1736 *
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001737 * | | | |
1738 * 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 |
1739 * | | | |
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001740 */
1741#define SHMEM_ARRAY_BITPOS(i, eb, fb) \
1742 ((((32/(fb)) - 1 - ((i)/((fb)/(eb))) % (32/(fb))) * (fb)) + \
1743 (((i)%((fb)/(eb))) * (eb)))
1744
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001745#define SHMEM_ARRAY_GET(a, i, eb, fb) \
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001746 ((a[SHMEM_ARRAY_ENTRY(i, eb)] >> SHMEM_ARRAY_BITPOS(i, eb, fb)) & \
1747 SHMEM_ARRAY_MASK(eb))
1748
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001749#define SHMEM_ARRAY_SET(a, i, eb, fb, val) \
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001750do { \
1751 a[SHMEM_ARRAY_ENTRY(i, eb)] &= ~(SHMEM_ARRAY_MASK(eb) << \
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001752 SHMEM_ARRAY_BITPOS(i, eb, fb)); \
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001753 a[SHMEM_ARRAY_ENTRY(i, eb)] |= (((val) & SHMEM_ARRAY_MASK(eb)) << \
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001754 SHMEM_ARRAY_BITPOS(i, eb, fb)); \
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001755} while (0)
1756
1757
1758/****START OF DCBX STRUCTURES DECLARATIONS****/
1759#define DCBX_MAX_NUM_PRI_PG_ENTRIES 8
1760#define DCBX_PRI_PG_BITWIDTH 4
1761#define DCBX_PRI_PG_FBITS 8
1762#define DCBX_PRI_PG_GET(a, i) \
1763 SHMEM_ARRAY_GET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS)
1764#define DCBX_PRI_PG_SET(a, i, val) \
1765 SHMEM_ARRAY_SET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS, val)
1766#define DCBX_MAX_NUM_PG_BW_ENTRIES 8
1767#define DCBX_BW_PG_BITWIDTH 8
1768#define DCBX_PG_BW_GET(a, i) \
1769 SHMEM_ARRAY_GET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH)
1770#define DCBX_PG_BW_SET(a, i, val) \
1771 SHMEM_ARRAY_SET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH, val)
1772#define DCBX_STRICT_PRI_PG 15
1773#define DCBX_MAX_APP_PROTOCOL 16
1774#define FCOE_APP_IDX 0
1775#define ISCSI_APP_IDX 1
1776#define PREDEFINED_APP_IDX_MAX 2
1777
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001778
1779/* Big/Little endian have the same representation. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001780struct dcbx_ets_feature {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001781 /*
1782 * For Admin MIB - is this feature supported by the
1783 * driver | For Local MIB - should this feature be enabled.
1784 */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001785 u32 enabled;
1786 u32 pg_bw_tbl[2];
1787 u32 pri_pg_tbl[1];
1788};
1789
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001790/* Driver structure in LE */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001791struct dcbx_pfc_feature {
1792#ifdef __BIG_ENDIAN
1793 u8 pri_en_bitmap;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001794 #define DCBX_PFC_PRI_0 0x01
1795 #define DCBX_PFC_PRI_1 0x02
1796 #define DCBX_PFC_PRI_2 0x04
1797 #define DCBX_PFC_PRI_3 0x08
1798 #define DCBX_PFC_PRI_4 0x10
1799 #define DCBX_PFC_PRI_5 0x20
1800 #define DCBX_PFC_PRI_6 0x40
1801 #define DCBX_PFC_PRI_7 0x80
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001802 u8 pfc_caps;
1803 u8 reserved;
1804 u8 enabled;
1805#elif defined(__LITTLE_ENDIAN)
1806 u8 enabled;
1807 u8 reserved;
1808 u8 pfc_caps;
1809 u8 pri_en_bitmap;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001810 #define DCBX_PFC_PRI_0 0x01
1811 #define DCBX_PFC_PRI_1 0x02
1812 #define DCBX_PFC_PRI_2 0x04
1813 #define DCBX_PFC_PRI_3 0x08
1814 #define DCBX_PFC_PRI_4 0x10
1815 #define DCBX_PFC_PRI_5 0x20
1816 #define DCBX_PFC_PRI_6 0x40
1817 #define DCBX_PFC_PRI_7 0x80
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001818#endif
1819};
1820
1821struct dcbx_app_priority_entry {
1822#ifdef __BIG_ENDIAN
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001823 u16 app_id;
1824 u8 pri_bitmap;
1825 u8 appBitfield;
1826 #define DCBX_APP_ENTRY_VALID 0x01
1827 #define DCBX_APP_ENTRY_SF_MASK 0x30
1828 #define DCBX_APP_ENTRY_SF_SHIFT 4
1829 #define DCBX_APP_SF_ETH_TYPE 0x10
1830 #define DCBX_APP_SF_PORT 0x20
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001831#elif defined(__LITTLE_ENDIAN)
1832 u8 appBitfield;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001833 #define DCBX_APP_ENTRY_VALID 0x01
1834 #define DCBX_APP_ENTRY_SF_MASK 0x30
1835 #define DCBX_APP_ENTRY_SF_SHIFT 4
1836 #define DCBX_APP_SF_ETH_TYPE 0x10
1837 #define DCBX_APP_SF_PORT 0x20
1838 u8 pri_bitmap;
1839 u16 app_id;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001840#endif
1841};
1842
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001843
1844/* FW structure in BE */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001845struct dcbx_app_priority_feature {
1846#ifdef __BIG_ENDIAN
1847 u8 reserved;
1848 u8 default_pri;
1849 u8 tc_supported;
1850 u8 enabled;
1851#elif defined(__LITTLE_ENDIAN)
1852 u8 enabled;
1853 u8 tc_supported;
1854 u8 default_pri;
1855 u8 reserved;
1856#endif
1857 struct dcbx_app_priority_entry app_pri_tbl[DCBX_MAX_APP_PROTOCOL];
1858};
1859
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001860/* FW structure in BE */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001861struct dcbx_features {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001862 /* PG feature */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001863 struct dcbx_ets_feature ets;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001864 /* PFC feature */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001865 struct dcbx_pfc_feature pfc;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001866 /* APP feature */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001867 struct dcbx_app_priority_feature app;
1868};
1869
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001870/* LLDP protocol parameters */
1871/* FW structure in BE */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001872struct lldp_params {
1873#ifdef __BIG_ENDIAN
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001874 u8 msg_fast_tx_interval;
1875 u8 msg_tx_hold;
1876 u8 msg_tx_interval;
1877 u8 admin_status;
1878 #define LLDP_TX_ONLY 0x01
1879 #define LLDP_RX_ONLY 0x02
1880 #define LLDP_TX_RX 0x03
1881 #define LLDP_DISABLED 0x04
1882 u8 reserved1;
1883 u8 tx_fast;
1884 u8 tx_crd_max;
1885 u8 tx_crd;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001886#elif defined(__LITTLE_ENDIAN)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001887 u8 admin_status;
1888 #define LLDP_TX_ONLY 0x01
1889 #define LLDP_RX_ONLY 0x02
1890 #define LLDP_TX_RX 0x03
1891 #define LLDP_DISABLED 0x04
1892 u8 msg_tx_interval;
1893 u8 msg_tx_hold;
1894 u8 msg_fast_tx_interval;
1895 u8 tx_crd;
1896 u8 tx_crd_max;
1897 u8 tx_fast;
1898 u8 reserved1;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001899#endif
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001900 #define REM_CHASSIS_ID_STAT_LEN 4
1901 #define REM_PORT_ID_STAT_LEN 4
1902 /* Holds remote Chassis ID TLV header, subtype and 9B of payload. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001903 u32 peer_chassis_id[REM_CHASSIS_ID_STAT_LEN];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001904 /* Holds remote Port ID TLV header, subtype and 9B of payload. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001905 u32 peer_port_id[REM_PORT_ID_STAT_LEN];
1906};
1907
1908struct lldp_dcbx_stat {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001909 #define LOCAL_CHASSIS_ID_STAT_LEN 2
1910 #define LOCAL_PORT_ID_STAT_LEN 2
1911 /* Holds local Chassis ID 8B payload of constant subtype 4. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001912 u32 local_chassis_id[LOCAL_CHASSIS_ID_STAT_LEN];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001913 /* Holds local Port ID 8B payload of constant subtype 3. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001914 u32 local_port_id[LOCAL_PORT_ID_STAT_LEN];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001915 /* Number of DCBX frames transmitted. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001916 u32 num_tx_dcbx_pkts;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001917 /* Number of DCBX frames received. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001918 u32 num_rx_dcbx_pkts;
1919};
1920
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001921/* ADMIN MIB - DCBX local machine default configuration. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001922struct lldp_admin_mib {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001923 u32 ver_cfg_flags;
1924 #define DCBX_ETS_CONFIG_TX_ENABLED 0x00000001
1925 #define DCBX_PFC_CONFIG_TX_ENABLED 0x00000002
1926 #define DCBX_APP_CONFIG_TX_ENABLED 0x00000004
1927 #define DCBX_ETS_RECO_TX_ENABLED 0x00000008
1928 #define DCBX_ETS_RECO_VALID 0x00000010
1929 #define DCBX_ETS_WILLING 0x00000020
1930 #define DCBX_PFC_WILLING 0x00000040
1931 #define DCBX_APP_WILLING 0x00000080
1932 #define DCBX_VERSION_CEE 0x00000100
1933 #define DCBX_VERSION_IEEE 0x00000200
1934 #define DCBX_DCBX_ENABLED 0x00000400
1935 #define DCBX_CEE_VERSION_MASK 0x0000f000
1936 #define DCBX_CEE_VERSION_SHIFT 12
1937 #define DCBX_CEE_MAX_VERSION_MASK 0x000f0000
1938 #define DCBX_CEE_MAX_VERSION_SHIFT 16
1939 struct dcbx_features features;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001940};
1941
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001942/* REMOTE MIB - remote machine DCBX configuration. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001943struct lldp_remote_mib {
1944 u32 prefix_seq_num;
1945 u32 flags;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001946 #define DCBX_ETS_TLV_RX 0x00000001
1947 #define DCBX_PFC_TLV_RX 0x00000002
1948 #define DCBX_APP_TLV_RX 0x00000004
1949 #define DCBX_ETS_RX_ERROR 0x00000010
1950 #define DCBX_PFC_RX_ERROR 0x00000020
1951 #define DCBX_APP_RX_ERROR 0x00000040
1952 #define DCBX_ETS_REM_WILLING 0x00000100
1953 #define DCBX_PFC_REM_WILLING 0x00000200
1954 #define DCBX_APP_REM_WILLING 0x00000400
1955 #define DCBX_REMOTE_ETS_RECO_VALID 0x00001000
1956 #define DCBX_REMOTE_MIB_VALID 0x00002000
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001957 struct dcbx_features features;
1958 u32 suffix_seq_num;
1959};
1960
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001961/* LOCAL MIB - operational DCBX configuration - transmitted on Tx LLDPDU. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001962struct lldp_local_mib {
1963 u32 prefix_seq_num;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001964 /* Indicates if there is mismatch with negotiation results. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001965 u32 error;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001966 #define DCBX_LOCAL_ETS_ERROR 0x00000001
1967 #define DCBX_LOCAL_PFC_ERROR 0x00000002
1968 #define DCBX_LOCAL_APP_ERROR 0x00000004
1969 #define DCBX_LOCAL_PFC_MISMATCH 0x00000010
1970 #define DCBX_LOCAL_APP_MISMATCH 0x00000020
Dmitry Kravkov6debea82011-07-19 01:42:04 +00001971 #define DCBX_REMOTE_MIB_ERROR 0x00000040
Dmitry Kravkov910b2202012-03-18 10:33:42 +00001972 #define DCBX_REMOTE_ETS_TLV_NOT_FOUND 0x00000080
1973 #define DCBX_REMOTE_PFC_TLV_NOT_FOUND 0x00000100
1974 #define DCBX_REMOTE_APP_TLV_NOT_FOUND 0x00000200
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001975 struct dcbx_features features;
1976 u32 suffix_seq_num;
1977};
1978/***END OF DCBX STRUCTURES DECLARATIONS***/
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001979
Yaniv Rosnerd3a8f132012-09-13 02:56:20 +00001980/***********************************************************/
1981/* Elink section */
1982/***********************************************************/
1983#define SHMEM_LINK_CONFIG_SIZE 2
1984struct shmem_lfa {
1985 u32 req_duplex;
1986 #define REQ_DUPLEX_PHY0_MASK 0x0000ffff
1987 #define REQ_DUPLEX_PHY0_SHIFT 0
1988 #define REQ_DUPLEX_PHY1_MASK 0xffff0000
1989 #define REQ_DUPLEX_PHY1_SHIFT 16
1990 u32 req_flow_ctrl;
1991 #define REQ_FLOW_CTRL_PHY0_MASK 0x0000ffff
1992 #define REQ_FLOW_CTRL_PHY0_SHIFT 0
1993 #define REQ_FLOW_CTRL_PHY1_MASK 0xffff0000
1994 #define REQ_FLOW_CTRL_PHY1_SHIFT 16
1995 u32 req_line_speed; /* Also determine AutoNeg */
1996 #define REQ_LINE_SPD_PHY0_MASK 0x0000ffff
1997 #define REQ_LINE_SPD_PHY0_SHIFT 0
1998 #define REQ_LINE_SPD_PHY1_MASK 0xffff0000
1999 #define REQ_LINE_SPD_PHY1_SHIFT 16
2000 u32 speed_cap_mask[SHMEM_LINK_CONFIG_SIZE];
2001 u32 additional_config;
2002 #define REQ_FC_AUTO_ADV_MASK 0x0000ffff
2003 #define REQ_FC_AUTO_ADV0_SHIFT 0
2004 #define NO_LFA_DUE_TO_DCC_MASK 0x00010000
2005 u32 lfa_sts;
2006 #define LFA_LINK_FLAP_REASON_OFFSET 0
2007 #define LFA_LINK_FLAP_REASON_MASK 0x000000ff
2008 #define LFA_LINK_DOWN 0x1
2009 #define LFA_LOOPBACK_ENABLED 0x2
2010 #define LFA_DUPLEX_MISMATCH 0x3
2011 #define LFA_MFW_IS_TOO_OLD 0x4
2012 #define LFA_LINK_SPEED_MISMATCH 0x5
2013 #define LFA_FLOW_CTRL_MISMATCH 0x6
2014 #define LFA_SPEED_CAP_MISMATCH 0x7
2015 #define LFA_DCC_LFA_DISABLED 0x8
2016 #define LFA_EEE_MISMATCH 0x9
2017
2018 #define LINK_FLAP_AVOIDANCE_COUNT_OFFSET 8
2019 #define LINK_FLAP_AVOIDANCE_COUNT_MASK 0x0000ff00
2020
2021 #define LINK_FLAP_COUNT_OFFSET 16
2022 #define LINK_FLAP_COUNT_MASK 0x00ff0000
2023
2024 #define LFA_FLAGS_MASK 0xff000000
2025 #define SHMEM_LFA_DONT_CLEAR_STAT (1<<24)
2026};
2027
Yuval Mintz42f82772014-03-23 18:12:23 +02002028/* Used to support NSCI get OS driver version
2029 * on driver load the version value will be set
2030 * on driver unload driver value of 0x0 will be set.
2031 */
2032struct os_drv_ver {
2033#define DRV_VER_NOT_LOADED 0
2034
2035 /* personalties order is important */
2036#define DRV_PERS_ETHERNET 0
2037#define DRV_PERS_ISCSI 1
2038#define DRV_PERS_FCOE 2
2039
2040 /* shmem2 struct is constant can't add more personalties here */
2041#define MAX_DRV_PERS 3
2042 u32 versions[MAX_DRV_PERS];
2043};
2044
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002045struct ncsi_oem_fcoe_features {
2046 u32 fcoe_features1;
2047 #define FCOE_FEATURES1_IOS_PER_CONNECTION_MASK 0x0000FFFF
2048 #define FCOE_FEATURES1_IOS_PER_CONNECTION_OFFSET 0
2049
2050 #define FCOE_FEATURES1_LOGINS_PER_PORT_MASK 0xFFFF0000
2051 #define FCOE_FEATURES1_LOGINS_PER_PORT_OFFSET 16
2052
2053 u32 fcoe_features2;
2054 #define FCOE_FEATURES2_EXCHANGES_MASK 0x0000FFFF
2055 #define FCOE_FEATURES2_EXCHANGES_OFFSET 0
2056
2057 #define FCOE_FEATURES2_NPIV_WWN_PER_PORT_MASK 0xFFFF0000
2058 #define FCOE_FEATURES2_NPIV_WWN_PER_PORT_OFFSET 16
2059
2060 u32 fcoe_features3;
2061 #define FCOE_FEATURES3_TARGETS_SUPPORTED_MASK 0x0000FFFF
2062 #define FCOE_FEATURES3_TARGETS_SUPPORTED_OFFSET 0
2063
2064 #define FCOE_FEATURES3_OUTSTANDING_COMMANDS_MASK 0xFFFF0000
2065 #define FCOE_FEATURES3_OUTSTANDING_COMMANDS_OFFSET 16
2066
2067 u32 fcoe_features4;
2068 #define FCOE_FEATURES4_FEATURE_SETTINGS_MASK 0x0000000F
2069 #define FCOE_FEATURES4_FEATURE_SETTINGS_OFFSET 0
2070};
2071
Yuval Mintz230d00e2015-07-22 09:16:25 +03002072enum curr_cfg_method_e {
2073 CURR_CFG_MET_NONE = 0, /* default config */
2074 CURR_CFG_MET_OS = 1,
2075 CURR_CFG_MET_VENDOR_SPEC = 2,/* e.g. Option ROM, NPAR, O/S Cfg Utils */
2076};
2077
Yuval Mintz97ac4ef2015-08-04 09:37:29 +03002078#define FC_NPIV_WWPN_SIZE 8
2079#define FC_NPIV_WWNN_SIZE 8
2080struct bdn_npiv_settings {
2081 u8 npiv_wwpn[FC_NPIV_WWPN_SIZE];
2082 u8 npiv_wwnn[FC_NPIV_WWNN_SIZE];
2083};
2084
2085struct bdn_fc_npiv_cfg {
2086 /* hdr used internally by the MFW */
2087 u32 hdr;
2088 u32 num_of_npiv;
2089};
2090
2091#define MAX_NUMBER_NPIV 64
2092struct bdn_fc_npiv_tbl {
2093 struct bdn_fc_npiv_cfg fc_npiv_cfg;
2094 struct bdn_npiv_settings settings[MAX_NUMBER_NPIV];
2095};
2096
Yuval Mintzc48f3502015-07-22 09:16:26 +03002097struct mdump_driver_info {
2098 u32 epoc;
2099 u32 drv_ver;
2100 u32 fw_ver;
2101
2102 u32 valid_dump;
2103 #define FIRST_DUMP_VALID (1 << 0)
2104 #define SECOND_DUMP_VALID (1 << 1)
2105
2106 u32 flags;
2107 #define ENABLE_ALL_TRIGGERS (0x7fffffff)
2108 #define TRIGGER_MDUMP_ONCE (1 << 31)
2109};
2110
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002111struct ncsi_oem_data {
2112 u32 driver_version[4];
2113 struct ncsi_oem_fcoe_features ncsi_oem_fcoe_features;
2114};
2115
Eilon Greenstein2691d512009-08-12 08:22:08 +00002116struct shmem2_region {
2117
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002118 u32 size; /* 0x0000 */
Eilon Greenstein2691d512009-08-12 08:22:08 +00002119
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002120 u32 dcc_support; /* 0x0004 */
2121 #define SHMEM_DCC_SUPPORT_NONE 0x00000000
2122 #define SHMEM_DCC_SUPPORT_DISABLE_ENABLE_PF_TLV 0x00000001
2123 #define SHMEM_DCC_SUPPORT_BANDWIDTH_ALLOCATION_TLV 0x00000004
2124 #define SHMEM_DCC_SUPPORT_CHANGE_MAC_ADDRESS_TLV 0x00000008
2125 #define SHMEM_DCC_SUPPORT_SET_PROTOCOL_TLV 0x00000040
2126 #define SHMEM_DCC_SUPPORT_SET_PRIORITY_TLV 0x00000080
2127
2128 u32 ext_phy_fw_version2[PORT_MAX]; /* 0x0008 */
Yaniv Rosnera22f0782010-09-07 11:41:20 +00002129 /*
2130 * For backwards compatibility, if the mf_cfg_addr does not exist
2131 * (the size filed is smaller than 0xc) the mf_cfg resides at the
2132 * end of struct shmem_region
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002133 */
2134 u32 mf_cfg_addr; /* 0x0010 */
2135 #define SHMEM_MF_CFG_ADDR_NONE 0x00000000
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002136
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002137 struct fw_flr_mb flr_mb; /* 0x0014 */
2138 u32 dcbx_lldp_params_offset; /* 0x0028 */
2139 #define SHMEM_LLDP_DCBX_PARAMS_NONE 0x00000000
2140 u32 dcbx_neg_res_offset; /* 0x002c */
2141 #define SHMEM_DCBX_NEG_RES_NONE 0x00000000
2142 u32 dcbx_remote_mib_offset; /* 0x0030 */
2143 #define SHMEM_DCBX_REMOTE_MIB_NONE 0x00000000
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002144 /*
2145 * The other shmemX_base_addr holds the other path's shmem address
2146 * required for example in case of common phy init, or for path1 to know
2147 * the address of mcp debug trace which is located in offset from shmem
2148 * of path0
Yaniv Rosnera22f0782010-09-07 11:41:20 +00002149 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002150 u32 other_shmem_base_addr; /* 0x0034 */
2151 u32 other_shmem2_base_addr; /* 0x0038 */
2152 /*
2153 * mcp_vf_disabled is set by the MCP to indicate the driver about VFs
2154 * which were disabled/flred
2155 */
2156 u32 mcp_vf_disabled[E2_VF_MAX / 32]; /* 0x003c */
2157
2158 /*
2159 * drv_ack_vf_disabled is set by the PF driver to ack handled disabled
2160 * VFs
2161 */
2162 u32 drv_ack_vf_disabled[E2_FUNC_MAX][E2_VF_MAX / 32]; /* 0x0044 */
2163
2164 u32 dcbx_lldp_dcbx_stat_offset; /* 0x0064 */
2165 #define SHMEM_LLDP_DCBX_STAT_NONE 0x00000000
2166
2167 /*
2168 * edebug_driver_if field is used to transfer messages between edebug
2169 * app to the driver through shmem2.
2170 *
2171 * message format:
2172 * bits 0-2 - function number / instance of driver to perform request
2173 * bits 3-5 - op code / is_ack?
2174 * bits 6-63 - data
2175 */
2176 u32 edebug_driver_if[2]; /* 0x0068 */
2177 #define EDEBUG_DRIVER_IF_OP_CODE_GET_PHYS_ADDR 1
2178 #define EDEBUG_DRIVER_IF_OP_CODE_GET_BUS_ADDR 2
2179 #define EDEBUG_DRIVER_IF_OP_CODE_DISABLE_STAT 3
2180
2181 u32 nvm_retain_bitmap_addr; /* 0x0070 */
2182
Barak Witkowskia3348722012-04-23 03:04:46 +00002183 /* afex support of that driver */
2184 u32 afex_driver_support; /* 0x0074 */
2185 #define SHMEM_AFEX_VERSION_MASK 0x100f
2186 #define SHMEM_AFEX_SUPPORTED_VERSION_ONE 0x1001
2187 #define SHMEM_AFEX_REDUCED_DRV_LOADED 0x8000
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002188
Barak Witkowskia3348722012-04-23 03:04:46 +00002189 /* driver receives addr in scratchpad to which it should respond */
2190 u32 afex_scratchpad_addr_to_write[E2_FUNC_MAX];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002191
Barak Witkowskia3348722012-04-23 03:04:46 +00002192 /* generic params from MCP to driver (value depends on the msg sent
2193 * to driver
2194 */
2195 u32 afex_param1_to_driver[E2_FUNC_MAX]; /* 0x0088 */
2196 u32 afex_param2_to_driver[E2_FUNC_MAX]; /* 0x0098 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002197
2198 u32 swim_base_addr; /* 0x0108 */
2199 u32 swim_funcs;
2200 u32 swim_main_cb;
2201
Barak Witkowskia3348722012-04-23 03:04:46 +00002202 /* bitmap notifying which VIF profiles stored in nvram are enabled by
2203 * switch
2204 */
2205 u32 afex_profiles_enabled[2];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002206
2207 /* generic flags controlled by the driver */
2208 u32 drv_flags;
Barak Witkowski4c704892012-12-02 04:05:47 +00002209 #define DRV_FLAGS_DCB_CONFIGURED 0x0
2210 #define DRV_FLAGS_DCB_CONFIGURATION_ABORTED 0x1
2211 #define DRV_FLAGS_DCB_MFW_CONFIGURED 0x2
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002212
Barak Witkowski4c704892012-12-02 04:05:47 +00002213 #define DRV_FLAGS_PORT_MASK ((1 << DRV_FLAGS_DCB_CONFIGURED) | \
2214 (1 << DRV_FLAGS_DCB_CONFIGURATION_ABORTED) | \
2215 (1 << DRV_FLAGS_DCB_MFW_CONFIGURED))
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002216 /* pointer to extended dev_info shared data copied from nvm image */
2217 u32 extended_dev_info_shared_addr;
2218 u32 ncsi_oem_data_addr;
2219
Barak Witkowski1d187b32011-12-05 22:41:50 +00002220 u32 ocsd_host_addr; /* initialized by option ROM */
2221 u32 ocbb_host_addr; /* initialized by option ROM */
2222 u32 ocsd_req_update_interval; /* initialized by option ROM */
2223 u32 temperature_in_half_celsius;
2224 u32 glob_struct_in_host;
2225
2226 u32 dcbx_neg_res_ext_offset;
2227#define SHMEM_DCBX_NEG_RES_EXT_NONE 0x00000000
2228
2229 u32 drv_capabilities_flag[E2_FUNC_MAX];
2230#define DRV_FLAGS_CAPABILITIES_LOADED_SUPPORTED 0x00000001
2231#define DRV_FLAGS_CAPABILITIES_LOADED_L2 0x00000002
2232#define DRV_FLAGS_CAPABILITIES_LOADED_FCOE 0x00000004
2233#define DRV_FLAGS_CAPABILITIES_LOADED_ISCSI 0x00000008
Yuval Mintz230d00e2015-07-22 09:16:25 +03002234#define DRV_FLAGS_MTU_MASK 0xffff0000
2235#define DRV_FLAGS_MTU_SHIFT 16
Barak Witkowski1d187b32011-12-05 22:41:50 +00002236
2237 u32 extended_dev_info_shared_cfg_size;
2238
2239 u32 dcbx_en[PORT_MAX];
2240
2241 /* The offset points to the multi threaded meta structure */
2242 u32 multi_thread_data_offset;
2243
2244 /* address of DMAable host address holding values from the drivers */
2245 u32 drv_info_host_addr_lo;
2246 u32 drv_info_host_addr_hi;
2247
2248 /* general values written by the MFW (such as current version) */
2249 u32 drv_info_control;
2250#define DRV_INFO_CONTROL_VER_MASK 0x000000ff
2251#define DRV_INFO_CONTROL_VER_SHIFT 0
2252#define DRV_INFO_CONTROL_OP_CODE_MASK 0x0000ff00
2253#define DRV_INFO_CONTROL_OP_CODE_SHIFT 8
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00002254 u32 ibft_host_addr; /* initialized by option ROM */
Yuval Mintzc8c60d82012-06-06 17:13:07 +00002255 struct eee_remote_vals eee_remote_vals[PORT_MAX];
2256 u32 reserved[E2_FUNC_MAX];
2257
2258
2259 /* the status of EEE auto-negotiation
2260 * bits 15:0 the configured tx-lpi entry timer value. Depends on bit 31.
2261 * bits 19:16 the supported modes for EEE.
2262 * bits 23:20 the speeds advertised for EEE.
2263 * bits 27:24 the speeds the Link partner advertised for EEE.
2264 * The supported/adv. modes in bits 27:19 originate from the
2265 * SHMEM_EEE_XXX_ADV definitions (where XXX is replaced by speed).
2266 * bit 28 when 1'b1 EEE was requested.
2267 * bit 29 when 1'b1 tx lpi was requested.
2268 * bit 30 when 1'b1 EEE was negotiated. Tx lpi will be asserted iff
2269 * 30:29 are 2'b11.
2270 * bit 31 when 1'b0 bits 15:0 contain a PORT_FEAT_CFG_EEE_ define as
2271 * value. When 1'b1 those bits contains a value times 16 microseconds.
2272 */
2273 u32 eee_status[PORT_MAX];
2274 #define SHMEM_EEE_TIMER_MASK 0x0000ffff
2275 #define SHMEM_EEE_SUPPORTED_MASK 0x000f0000
2276 #define SHMEM_EEE_SUPPORTED_SHIFT 16
2277 #define SHMEM_EEE_ADV_STATUS_MASK 0x00f00000
2278 #define SHMEM_EEE_100M_ADV (1<<0)
2279 #define SHMEM_EEE_1G_ADV (1<<1)
2280 #define SHMEM_EEE_10G_ADV (1<<2)
2281 #define SHMEM_EEE_ADV_STATUS_SHIFT 20
2282 #define SHMEM_EEE_LP_ADV_STATUS_MASK 0x0f000000
2283 #define SHMEM_EEE_LP_ADV_STATUS_SHIFT 24
2284 #define SHMEM_EEE_REQUESTED_BIT 0x10000000
2285 #define SHMEM_EEE_LPI_REQUESTED_BIT 0x20000000
2286 #define SHMEM_EEE_ACTIVE_BIT 0x40000000
2287 #define SHMEM_EEE_TIME_OUTPUT_BIT 0x80000000
2288
2289 u32 sizeof_port_stats;
Yaniv Rosnerb884d952012-11-27 03:46:28 +00002290
2291 /* Link Flap Avoidance */
2292 u32 lfa_host_addr[PORT_MAX];
2293 u32 reserved1;
2294
2295 u32 reserved2; /* Offset 0x148 */
2296 u32 reserved3; /* Offset 0x14C */
2297 u32 reserved4; /* Offset 0x150 */
Yaniv Rosner4e7b4992012-11-27 03:46:29 +00002298 u32 link_attr_sync[PORT_MAX]; /* Offset 0x154 */
Yaniv Rosner6e9e5642014-09-04 13:26:00 +03002299 #define LINK_ATTR_SYNC_KR2_ENABLE 0x00000001
Yaniv Rosner924c6212015-07-22 09:16:24 +03002300 #define LINK_ATTR_84858 0x00000002
Yaniv Rosner6e9e5642014-09-04 13:26:00 +03002301 #define LINK_SFP_EEPROM_COMP_CODE_MASK 0x0000ff00
2302 #define LINK_SFP_EEPROM_COMP_CODE_SHIFT 8
2303 #define LINK_SFP_EEPROM_COMP_CODE_SR 0x00001000
2304 #define LINK_SFP_EEPROM_COMP_CODE_LR 0x00002000
2305 #define LINK_SFP_EEPROM_COMP_CODE_LRM 0x00004000
Yuval Mintz42f82772014-03-23 18:12:23 +02002306
2307 u32 reserved5[2];
Yaniv Rosnerfcd02d22015-03-29 10:05:00 +03002308 u32 link_change_count[PORT_MAX]; /* Offset 0x160-0x164 */
2309 #define LINK_CHANGE_COUNT_MASK 0xff /* Offset 0x168 */
Yuval Mintz42f82772014-03-23 18:12:23 +02002310 /* driver version for each personality */
2311 struct os_drv_ver func_os_drv_ver[E2_FUNC_MAX]; /* Offset 0x16c */
2312
2313 /* Flag to the driver that PF's drv_info_host_addr buffer was read */
2314 u32 mfw_drv_indication;
2315
2316 /* We use indication for each PF (0..3) */
2317#define MFW_DRV_IND_READ_DONE_OFFSET(_pf_) (1 << (_pf_))
Yuval Mintz230d00e2015-07-22 09:16:25 +03002318 union { /* For various OEMs */ /* Offset 0x1a0 */
2319 u8 storage_boot_prog[E2_FUNC_MAX];
2320 #define STORAGE_BOOT_PROG_MASK 0x000000FF
2321 #define STORAGE_BOOT_PROG_NONE 0x00000000
2322 #define STORAGE_BOOT_PROG_ISCSI_IP_ACQUIRED 0x00000002
2323 #define STORAGE_BOOT_PROG_FCOE_FABRIC_LOGIN_SUCCESS 0x00000002
2324 #define STORAGE_BOOT_PROG_TARGET_FOUND 0x00000004
2325 #define STORAGE_BOOT_PROG_ISCSI_CHAP_SUCCESS 0x00000008
2326 #define STORAGE_BOOT_PROG_FCOE_LUN_FOUND 0x00000008
2327 #define STORAGE_BOOT_PROG_LOGGED_INTO_TGT 0x00000010
2328 #define STORAGE_BOOT_PROG_IMG_DOWNLOADED 0x00000020
2329 #define STORAGE_BOOT_PROG_OS_HANDOFF 0x00000040
2330 #define STORAGE_BOOT_PROG_COMPLETED 0x00000080
2331
2332 u32 oem_i2c_data_addr;
2333 };
2334
2335 /* 9 entires for the C2S PCP map for each inner VLAN PCP + 1 default */
2336 /* For PCP values 0-3 use the map lower */
2337 /* 0xFF000000 - PCP 0, 0x00FF0000 - PCP 1,
2338 * 0x0000FF00 - PCP 2, 0x000000FF PCP 3
2339 */
2340 u32 c2s_pcp_map_lower[E2_FUNC_MAX]; /* 0x1a4 */
2341
2342 /* For PCP values 4-7 use the map upper */
2343 /* 0xFF000000 - PCP 4, 0x00FF0000 - PCP 5,
2344 * 0x0000FF00 - PCP 6, 0x000000FF PCP 7
2345 */
2346 u32 c2s_pcp_map_upper[E2_FUNC_MAX]; /* 0x1b4 */
2347
2348 /* For PCP default value get the MSB byte of the map default */
2349 u32 c2s_pcp_map_default[E2_FUNC_MAX]; /* 0x1c4 */
2350
2351 /* FC_NPIV table offset in NVRAM */
2352 u32 fc_npiv_nvram_tbl_addr[PORT_MAX]; /* 0x1d4 */
2353
2354 /* Shows last method that changed configuration of this device */
2355 enum curr_cfg_method_e curr_cfg; /* 0x1dc */
2356
2357 /* Storm FW version, shold be kept in the format 0xMMmmbbdd:
2358 * MM - Major, mm - Minor, bb - Build ,dd - Drop
2359 */
2360 u32 netproc_fw_ver; /* 0x1e0 */
2361
2362 /* Option ROM SMASH CLP version */
2363 u32 clp_ver; /* 0x1e4 */
2364
2365 u32 pcie_bus_num; /* 0x1e8 */
2366
2367 u32 sriov_switch_mode; /* 0x1ec */
2368 #define SRIOV_SWITCH_MODE_NONE 0x0
2369 #define SRIOV_SWITCH_MODE_VEB 0x1
2370 #define SRIOV_SWITCH_MODE_VEPA 0x2
2371
2372 u8 rsrv2[E2_FUNC_MAX]; /* 0x1f0 */
2373
2374 u32 img_inv_table_addr; /* Address to INV_TABLE_P */ /* 0x1f4 */
2375
2376 u32 mtu_size[E2_FUNC_MAX]; /* 0x1f8 */
2377
2378 u32 os_driver_state[E2_FUNC_MAX]; /* 0x208 */
2379 #define OS_DRIVER_STATE_NOT_LOADED 0 /* not installed */
2380 #define OS_DRIVER_STATE_LOADING 1 /* transition state */
2381 #define OS_DRIVER_STATE_DISABLED 2 /* installed but disabled */
2382 #define OS_DRIVER_STATE_ACTIVE 3 /* installed and active */
Yuval Mintzc48f3502015-07-22 09:16:26 +03002383
2384 /* mini dump driver info */
2385 struct mdump_driver_info drv_info; /* 0x218 */
Eilon Greenstein2691d512009-08-12 08:22:08 +00002386};
2387
2388
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002389struct emac_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002390 u32 rx_stat_ifhcinoctets;
2391 u32 rx_stat_ifhcinbadoctets;
2392 u32 rx_stat_etherstatsfragments;
2393 u32 rx_stat_ifhcinucastpkts;
2394 u32 rx_stat_ifhcinmulticastpkts;
2395 u32 rx_stat_ifhcinbroadcastpkts;
2396 u32 rx_stat_dot3statsfcserrors;
2397 u32 rx_stat_dot3statsalignmenterrors;
2398 u32 rx_stat_dot3statscarriersenseerrors;
2399 u32 rx_stat_xonpauseframesreceived;
2400 u32 rx_stat_xoffpauseframesreceived;
2401 u32 rx_stat_maccontrolframesreceived;
2402 u32 rx_stat_xoffstateentered;
2403 u32 rx_stat_dot3statsframestoolong;
2404 u32 rx_stat_etherstatsjabbers;
2405 u32 rx_stat_etherstatsundersizepkts;
2406 u32 rx_stat_etherstatspkts64octets;
2407 u32 rx_stat_etherstatspkts65octetsto127octets;
2408 u32 rx_stat_etherstatspkts128octetsto255octets;
2409 u32 rx_stat_etherstatspkts256octetsto511octets;
2410 u32 rx_stat_etherstatspkts512octetsto1023octets;
2411 u32 rx_stat_etherstatspkts1024octetsto1522octets;
2412 u32 rx_stat_etherstatspktsover1522octets;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002413
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002414 u32 rx_stat_falsecarriererrors;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002415
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002416 u32 tx_stat_ifhcoutoctets;
2417 u32 tx_stat_ifhcoutbadoctets;
2418 u32 tx_stat_etherstatscollisions;
2419 u32 tx_stat_outxonsent;
2420 u32 tx_stat_outxoffsent;
2421 u32 tx_stat_flowcontroldone;
2422 u32 tx_stat_dot3statssinglecollisionframes;
2423 u32 tx_stat_dot3statsmultiplecollisionframes;
2424 u32 tx_stat_dot3statsdeferredtransmissions;
2425 u32 tx_stat_dot3statsexcessivecollisions;
2426 u32 tx_stat_dot3statslatecollisions;
2427 u32 tx_stat_ifhcoutucastpkts;
2428 u32 tx_stat_ifhcoutmulticastpkts;
2429 u32 tx_stat_ifhcoutbroadcastpkts;
2430 u32 tx_stat_etherstatspkts64octets;
2431 u32 tx_stat_etherstatspkts65octetsto127octets;
2432 u32 tx_stat_etherstatspkts128octetsto255octets;
2433 u32 tx_stat_etherstatspkts256octetsto511octets;
2434 u32 tx_stat_etherstatspkts512octetsto1023octets;
2435 u32 tx_stat_etherstatspkts1024octetsto1522octets;
2436 u32 tx_stat_etherstatspktsover1522octets;
2437 u32 tx_stat_dot3statsinternalmactransmiterrors;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002438};
2439
2440
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002441struct bmac1_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002442 u32 tx_stat_gtpkt_lo;
2443 u32 tx_stat_gtpkt_hi;
2444 u32 tx_stat_gtxpf_lo;
2445 u32 tx_stat_gtxpf_hi;
2446 u32 tx_stat_gtfcs_lo;
2447 u32 tx_stat_gtfcs_hi;
2448 u32 tx_stat_gtmca_lo;
2449 u32 tx_stat_gtmca_hi;
2450 u32 tx_stat_gtbca_lo;
2451 u32 tx_stat_gtbca_hi;
2452 u32 tx_stat_gtfrg_lo;
2453 u32 tx_stat_gtfrg_hi;
2454 u32 tx_stat_gtovr_lo;
2455 u32 tx_stat_gtovr_hi;
2456 u32 tx_stat_gt64_lo;
2457 u32 tx_stat_gt64_hi;
2458 u32 tx_stat_gt127_lo;
2459 u32 tx_stat_gt127_hi;
2460 u32 tx_stat_gt255_lo;
2461 u32 tx_stat_gt255_hi;
2462 u32 tx_stat_gt511_lo;
2463 u32 tx_stat_gt511_hi;
2464 u32 tx_stat_gt1023_lo;
2465 u32 tx_stat_gt1023_hi;
2466 u32 tx_stat_gt1518_lo;
2467 u32 tx_stat_gt1518_hi;
2468 u32 tx_stat_gt2047_lo;
2469 u32 tx_stat_gt2047_hi;
2470 u32 tx_stat_gt4095_lo;
2471 u32 tx_stat_gt4095_hi;
2472 u32 tx_stat_gt9216_lo;
2473 u32 tx_stat_gt9216_hi;
2474 u32 tx_stat_gt16383_lo;
2475 u32 tx_stat_gt16383_hi;
2476 u32 tx_stat_gtmax_lo;
2477 u32 tx_stat_gtmax_hi;
2478 u32 tx_stat_gtufl_lo;
2479 u32 tx_stat_gtufl_hi;
2480 u32 tx_stat_gterr_lo;
2481 u32 tx_stat_gterr_hi;
2482 u32 tx_stat_gtbyt_lo;
2483 u32 tx_stat_gtbyt_hi;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002484
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002485 u32 rx_stat_gr64_lo;
2486 u32 rx_stat_gr64_hi;
2487 u32 rx_stat_gr127_lo;
2488 u32 rx_stat_gr127_hi;
2489 u32 rx_stat_gr255_lo;
2490 u32 rx_stat_gr255_hi;
2491 u32 rx_stat_gr511_lo;
2492 u32 rx_stat_gr511_hi;
2493 u32 rx_stat_gr1023_lo;
2494 u32 rx_stat_gr1023_hi;
2495 u32 rx_stat_gr1518_lo;
2496 u32 rx_stat_gr1518_hi;
2497 u32 rx_stat_gr2047_lo;
2498 u32 rx_stat_gr2047_hi;
2499 u32 rx_stat_gr4095_lo;
2500 u32 rx_stat_gr4095_hi;
2501 u32 rx_stat_gr9216_lo;
2502 u32 rx_stat_gr9216_hi;
2503 u32 rx_stat_gr16383_lo;
2504 u32 rx_stat_gr16383_hi;
2505 u32 rx_stat_grmax_lo;
2506 u32 rx_stat_grmax_hi;
2507 u32 rx_stat_grpkt_lo;
2508 u32 rx_stat_grpkt_hi;
2509 u32 rx_stat_grfcs_lo;
2510 u32 rx_stat_grfcs_hi;
2511 u32 rx_stat_grmca_lo;
2512 u32 rx_stat_grmca_hi;
2513 u32 rx_stat_grbca_lo;
2514 u32 rx_stat_grbca_hi;
2515 u32 rx_stat_grxcf_lo;
2516 u32 rx_stat_grxcf_hi;
2517 u32 rx_stat_grxpf_lo;
2518 u32 rx_stat_grxpf_hi;
2519 u32 rx_stat_grxuo_lo;
2520 u32 rx_stat_grxuo_hi;
2521 u32 rx_stat_grjbr_lo;
2522 u32 rx_stat_grjbr_hi;
2523 u32 rx_stat_grovr_lo;
2524 u32 rx_stat_grovr_hi;
2525 u32 rx_stat_grflr_lo;
2526 u32 rx_stat_grflr_hi;
2527 u32 rx_stat_grmeg_lo;
2528 u32 rx_stat_grmeg_hi;
2529 u32 rx_stat_grmeb_lo;
2530 u32 rx_stat_grmeb_hi;
2531 u32 rx_stat_grbyt_lo;
2532 u32 rx_stat_grbyt_hi;
2533 u32 rx_stat_grund_lo;
2534 u32 rx_stat_grund_hi;
2535 u32 rx_stat_grfrg_lo;
2536 u32 rx_stat_grfrg_hi;
2537 u32 rx_stat_grerb_lo;
2538 u32 rx_stat_grerb_hi;
2539 u32 rx_stat_grfre_lo;
2540 u32 rx_stat_grfre_hi;
2541 u32 rx_stat_gripj_lo;
2542 u32 rx_stat_gripj_hi;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002543};
2544
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002545struct bmac2_stats {
2546 u32 tx_stat_gtpk_lo; /* gtpok */
2547 u32 tx_stat_gtpk_hi; /* gtpok */
2548 u32 tx_stat_gtxpf_lo; /* gtpf */
2549 u32 tx_stat_gtxpf_hi; /* gtpf */
2550 u32 tx_stat_gtpp_lo; /* NEW BMAC2 */
2551 u32 tx_stat_gtpp_hi; /* NEW BMAC2 */
2552 u32 tx_stat_gtfcs_lo;
2553 u32 tx_stat_gtfcs_hi;
2554 u32 tx_stat_gtuca_lo; /* NEW BMAC2 */
2555 u32 tx_stat_gtuca_hi; /* NEW BMAC2 */
2556 u32 tx_stat_gtmca_lo;
2557 u32 tx_stat_gtmca_hi;
2558 u32 tx_stat_gtbca_lo;
2559 u32 tx_stat_gtbca_hi;
2560 u32 tx_stat_gtovr_lo;
2561 u32 tx_stat_gtovr_hi;
2562 u32 tx_stat_gtfrg_lo;
2563 u32 tx_stat_gtfrg_hi;
2564 u32 tx_stat_gtpkt1_lo; /* gtpkt */
2565 u32 tx_stat_gtpkt1_hi; /* gtpkt */
2566 u32 tx_stat_gt64_lo;
2567 u32 tx_stat_gt64_hi;
2568 u32 tx_stat_gt127_lo;
2569 u32 tx_stat_gt127_hi;
2570 u32 tx_stat_gt255_lo;
2571 u32 tx_stat_gt255_hi;
2572 u32 tx_stat_gt511_lo;
2573 u32 tx_stat_gt511_hi;
2574 u32 tx_stat_gt1023_lo;
2575 u32 tx_stat_gt1023_hi;
2576 u32 tx_stat_gt1518_lo;
2577 u32 tx_stat_gt1518_hi;
2578 u32 tx_stat_gt2047_lo;
2579 u32 tx_stat_gt2047_hi;
2580 u32 tx_stat_gt4095_lo;
2581 u32 tx_stat_gt4095_hi;
2582 u32 tx_stat_gt9216_lo;
2583 u32 tx_stat_gt9216_hi;
2584 u32 tx_stat_gt16383_lo;
2585 u32 tx_stat_gt16383_hi;
2586 u32 tx_stat_gtmax_lo;
2587 u32 tx_stat_gtmax_hi;
2588 u32 tx_stat_gtufl_lo;
2589 u32 tx_stat_gtufl_hi;
2590 u32 tx_stat_gterr_lo;
2591 u32 tx_stat_gterr_hi;
2592 u32 tx_stat_gtbyt_lo;
2593 u32 tx_stat_gtbyt_hi;
2594
2595 u32 rx_stat_gr64_lo;
2596 u32 rx_stat_gr64_hi;
2597 u32 rx_stat_gr127_lo;
2598 u32 rx_stat_gr127_hi;
2599 u32 rx_stat_gr255_lo;
2600 u32 rx_stat_gr255_hi;
2601 u32 rx_stat_gr511_lo;
2602 u32 rx_stat_gr511_hi;
2603 u32 rx_stat_gr1023_lo;
2604 u32 rx_stat_gr1023_hi;
2605 u32 rx_stat_gr1518_lo;
2606 u32 rx_stat_gr1518_hi;
2607 u32 rx_stat_gr2047_lo;
2608 u32 rx_stat_gr2047_hi;
2609 u32 rx_stat_gr4095_lo;
2610 u32 rx_stat_gr4095_hi;
2611 u32 rx_stat_gr9216_lo;
2612 u32 rx_stat_gr9216_hi;
2613 u32 rx_stat_gr16383_lo;
2614 u32 rx_stat_gr16383_hi;
2615 u32 rx_stat_grmax_lo;
2616 u32 rx_stat_grmax_hi;
2617 u32 rx_stat_grpkt_lo;
2618 u32 rx_stat_grpkt_hi;
2619 u32 rx_stat_grfcs_lo;
2620 u32 rx_stat_grfcs_hi;
2621 u32 rx_stat_gruca_lo;
2622 u32 rx_stat_gruca_hi;
2623 u32 rx_stat_grmca_lo;
2624 u32 rx_stat_grmca_hi;
2625 u32 rx_stat_grbca_lo;
2626 u32 rx_stat_grbca_hi;
2627 u32 rx_stat_grxpf_lo; /* grpf */
2628 u32 rx_stat_grxpf_hi; /* grpf */
2629 u32 rx_stat_grpp_lo;
2630 u32 rx_stat_grpp_hi;
2631 u32 rx_stat_grxuo_lo; /* gruo */
2632 u32 rx_stat_grxuo_hi; /* gruo */
2633 u32 rx_stat_grjbr_lo;
2634 u32 rx_stat_grjbr_hi;
2635 u32 rx_stat_grovr_lo;
2636 u32 rx_stat_grovr_hi;
2637 u32 rx_stat_grxcf_lo; /* grcf */
2638 u32 rx_stat_grxcf_hi; /* grcf */
2639 u32 rx_stat_grflr_lo;
2640 u32 rx_stat_grflr_hi;
2641 u32 rx_stat_grpok_lo;
2642 u32 rx_stat_grpok_hi;
2643 u32 rx_stat_grmeg_lo;
2644 u32 rx_stat_grmeg_hi;
2645 u32 rx_stat_grmeb_lo;
2646 u32 rx_stat_grmeb_hi;
2647 u32 rx_stat_grbyt_lo;
2648 u32 rx_stat_grbyt_hi;
2649 u32 rx_stat_grund_lo;
2650 u32 rx_stat_grund_hi;
2651 u32 rx_stat_grfrg_lo;
2652 u32 rx_stat_grfrg_hi;
2653 u32 rx_stat_grerb_lo; /* grerrbyt */
2654 u32 rx_stat_grerb_hi; /* grerrbyt */
2655 u32 rx_stat_grfre_lo; /* grfrerr */
2656 u32 rx_stat_grfre_hi; /* grfrerr */
2657 u32 rx_stat_gripj_lo;
2658 u32 rx_stat_gripj_hi;
2659};
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002660
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002661struct mstat_stats {
2662 struct {
2663 /* OTE MSTAT on E3 has a bug where this register's contents are
2664 * actually tx_gtxpok + tx_gtxpf + (possibly)tx_gtxpp
2665 */
2666 u32 tx_gtxpok_lo;
2667 u32 tx_gtxpok_hi;
2668 u32 tx_gtxpf_lo;
2669 u32 tx_gtxpf_hi;
2670 u32 tx_gtxpp_lo;
2671 u32 tx_gtxpp_hi;
2672 u32 tx_gtfcs_lo;
2673 u32 tx_gtfcs_hi;
2674 u32 tx_gtuca_lo;
2675 u32 tx_gtuca_hi;
2676 u32 tx_gtmca_lo;
2677 u32 tx_gtmca_hi;
2678 u32 tx_gtgca_lo;
2679 u32 tx_gtgca_hi;
2680 u32 tx_gtpkt_lo;
2681 u32 tx_gtpkt_hi;
2682 u32 tx_gt64_lo;
2683 u32 tx_gt64_hi;
2684 u32 tx_gt127_lo;
2685 u32 tx_gt127_hi;
2686 u32 tx_gt255_lo;
2687 u32 tx_gt255_hi;
2688 u32 tx_gt511_lo;
2689 u32 tx_gt511_hi;
2690 u32 tx_gt1023_lo;
2691 u32 tx_gt1023_hi;
2692 u32 tx_gt1518_lo;
2693 u32 tx_gt1518_hi;
2694 u32 tx_gt2047_lo;
2695 u32 tx_gt2047_hi;
2696 u32 tx_gt4095_lo;
2697 u32 tx_gt4095_hi;
2698 u32 tx_gt9216_lo;
2699 u32 tx_gt9216_hi;
2700 u32 tx_gt16383_lo;
2701 u32 tx_gt16383_hi;
2702 u32 tx_gtufl_lo;
2703 u32 tx_gtufl_hi;
2704 u32 tx_gterr_lo;
2705 u32 tx_gterr_hi;
2706 u32 tx_gtbyt_lo;
2707 u32 tx_gtbyt_hi;
2708 u32 tx_collisions_lo;
2709 u32 tx_collisions_hi;
2710 u32 tx_singlecollision_lo;
2711 u32 tx_singlecollision_hi;
2712 u32 tx_multiplecollisions_lo;
2713 u32 tx_multiplecollisions_hi;
2714 u32 tx_deferred_lo;
2715 u32 tx_deferred_hi;
2716 u32 tx_excessivecollisions_lo;
2717 u32 tx_excessivecollisions_hi;
2718 u32 tx_latecollisions_lo;
2719 u32 tx_latecollisions_hi;
2720 } stats_tx;
2721
2722 struct {
2723 u32 rx_gr64_lo;
2724 u32 rx_gr64_hi;
2725 u32 rx_gr127_lo;
2726 u32 rx_gr127_hi;
2727 u32 rx_gr255_lo;
2728 u32 rx_gr255_hi;
2729 u32 rx_gr511_lo;
2730 u32 rx_gr511_hi;
2731 u32 rx_gr1023_lo;
2732 u32 rx_gr1023_hi;
2733 u32 rx_gr1518_lo;
2734 u32 rx_gr1518_hi;
2735 u32 rx_gr2047_lo;
2736 u32 rx_gr2047_hi;
2737 u32 rx_gr4095_lo;
2738 u32 rx_gr4095_hi;
2739 u32 rx_gr9216_lo;
2740 u32 rx_gr9216_hi;
2741 u32 rx_gr16383_lo;
2742 u32 rx_gr16383_hi;
2743 u32 rx_grpkt_lo;
2744 u32 rx_grpkt_hi;
2745 u32 rx_grfcs_lo;
2746 u32 rx_grfcs_hi;
2747 u32 rx_gruca_lo;
2748 u32 rx_gruca_hi;
2749 u32 rx_grmca_lo;
2750 u32 rx_grmca_hi;
2751 u32 rx_grbca_lo;
2752 u32 rx_grbca_hi;
2753 u32 rx_grxpf_lo;
2754 u32 rx_grxpf_hi;
2755 u32 rx_grxpp_lo;
2756 u32 rx_grxpp_hi;
2757 u32 rx_grxuo_lo;
2758 u32 rx_grxuo_hi;
2759 u32 rx_grovr_lo;
2760 u32 rx_grovr_hi;
2761 u32 rx_grxcf_lo;
2762 u32 rx_grxcf_hi;
2763 u32 rx_grflr_lo;
2764 u32 rx_grflr_hi;
2765 u32 rx_grpok_lo;
2766 u32 rx_grpok_hi;
2767 u32 rx_grbyt_lo;
2768 u32 rx_grbyt_hi;
2769 u32 rx_grund_lo;
2770 u32 rx_grund_hi;
2771 u32 rx_grfrg_lo;
2772 u32 rx_grfrg_hi;
2773 u32 rx_grerb_lo;
2774 u32 rx_grerb_hi;
2775 u32 rx_grfre_lo;
2776 u32 rx_grfre_hi;
2777
2778 u32 rx_alignmenterrors_lo;
2779 u32 rx_alignmenterrors_hi;
2780 u32 rx_falsecarrier_lo;
2781 u32 rx_falsecarrier_hi;
2782 u32 rx_llfcmsgcnt_lo;
2783 u32 rx_llfcmsgcnt_hi;
2784 } stats_rx;
2785};
2786
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002787union mac_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002788 struct emac_stats emac_stats;
2789 struct bmac1_stats bmac1_stats;
2790 struct bmac2_stats bmac2_stats;
2791 struct mstat_stats mstat_stats;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002792};
2793
2794
2795struct mac_stx {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002796 /* in_bad_octets */
2797 u32 rx_stat_ifhcinbadoctets_hi;
2798 u32 rx_stat_ifhcinbadoctets_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002799
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002800 /* out_bad_octets */
2801 u32 tx_stat_ifhcoutbadoctets_hi;
2802 u32 tx_stat_ifhcoutbadoctets_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002803
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002804 /* crc_receive_errors */
2805 u32 rx_stat_dot3statsfcserrors_hi;
2806 u32 rx_stat_dot3statsfcserrors_lo;
2807 /* alignment_errors */
2808 u32 rx_stat_dot3statsalignmenterrors_hi;
2809 u32 rx_stat_dot3statsalignmenterrors_lo;
2810 /* carrier_sense_errors */
2811 u32 rx_stat_dot3statscarriersenseerrors_hi;
2812 u32 rx_stat_dot3statscarriersenseerrors_lo;
2813 /* false_carrier_detections */
2814 u32 rx_stat_falsecarriererrors_hi;
2815 u32 rx_stat_falsecarriererrors_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002816
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002817 /* runt_packets_received */
2818 u32 rx_stat_etherstatsundersizepkts_hi;
2819 u32 rx_stat_etherstatsundersizepkts_lo;
2820 /* jabber_packets_received */
2821 u32 rx_stat_dot3statsframestoolong_hi;
2822 u32 rx_stat_dot3statsframestoolong_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002823
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002824 /* error_runt_packets_received */
2825 u32 rx_stat_etherstatsfragments_hi;
2826 u32 rx_stat_etherstatsfragments_lo;
2827 /* error_jabber_packets_received */
2828 u32 rx_stat_etherstatsjabbers_hi;
2829 u32 rx_stat_etherstatsjabbers_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002830
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002831 /* control_frames_received */
2832 u32 rx_stat_maccontrolframesreceived_hi;
2833 u32 rx_stat_maccontrolframesreceived_lo;
2834 u32 rx_stat_mac_xpf_hi;
2835 u32 rx_stat_mac_xpf_lo;
2836 u32 rx_stat_mac_xcf_hi;
2837 u32 rx_stat_mac_xcf_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002838
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002839 /* xoff_state_entered */
2840 u32 rx_stat_xoffstateentered_hi;
2841 u32 rx_stat_xoffstateentered_lo;
2842 /* pause_xon_frames_received */
2843 u32 rx_stat_xonpauseframesreceived_hi;
2844 u32 rx_stat_xonpauseframesreceived_lo;
2845 /* pause_xoff_frames_received */
2846 u32 rx_stat_xoffpauseframesreceived_hi;
2847 u32 rx_stat_xoffpauseframesreceived_lo;
2848 /* pause_xon_frames_transmitted */
2849 u32 tx_stat_outxonsent_hi;
2850 u32 tx_stat_outxonsent_lo;
2851 /* pause_xoff_frames_transmitted */
2852 u32 tx_stat_outxoffsent_hi;
2853 u32 tx_stat_outxoffsent_lo;
2854 /* flow_control_done */
2855 u32 tx_stat_flowcontroldone_hi;
2856 u32 tx_stat_flowcontroldone_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002857
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002858 /* ether_stats_collisions */
2859 u32 tx_stat_etherstatscollisions_hi;
2860 u32 tx_stat_etherstatscollisions_lo;
2861 /* single_collision_transmit_frames */
2862 u32 tx_stat_dot3statssinglecollisionframes_hi;
2863 u32 tx_stat_dot3statssinglecollisionframes_lo;
2864 /* multiple_collision_transmit_frames */
2865 u32 tx_stat_dot3statsmultiplecollisionframes_hi;
2866 u32 tx_stat_dot3statsmultiplecollisionframes_lo;
2867 /* deferred_transmissions */
2868 u32 tx_stat_dot3statsdeferredtransmissions_hi;
2869 u32 tx_stat_dot3statsdeferredtransmissions_lo;
2870 /* excessive_collision_frames */
2871 u32 tx_stat_dot3statsexcessivecollisions_hi;
2872 u32 tx_stat_dot3statsexcessivecollisions_lo;
2873 /* late_collision_frames */
2874 u32 tx_stat_dot3statslatecollisions_hi;
2875 u32 tx_stat_dot3statslatecollisions_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002876
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002877 /* frames_transmitted_64_bytes */
2878 u32 tx_stat_etherstatspkts64octets_hi;
2879 u32 tx_stat_etherstatspkts64octets_lo;
2880 /* frames_transmitted_65_127_bytes */
2881 u32 tx_stat_etherstatspkts65octetsto127octets_hi;
2882 u32 tx_stat_etherstatspkts65octetsto127octets_lo;
2883 /* frames_transmitted_128_255_bytes */
2884 u32 tx_stat_etherstatspkts128octetsto255octets_hi;
2885 u32 tx_stat_etherstatspkts128octetsto255octets_lo;
2886 /* frames_transmitted_256_511_bytes */
2887 u32 tx_stat_etherstatspkts256octetsto511octets_hi;
2888 u32 tx_stat_etherstatspkts256octetsto511octets_lo;
2889 /* frames_transmitted_512_1023_bytes */
2890 u32 tx_stat_etherstatspkts512octetsto1023octets_hi;
2891 u32 tx_stat_etherstatspkts512octetsto1023octets_lo;
2892 /* frames_transmitted_1024_1522_bytes */
2893 u32 tx_stat_etherstatspkts1024octetsto1522octets_hi;
2894 u32 tx_stat_etherstatspkts1024octetsto1522octets_lo;
2895 /* frames_transmitted_1523_9022_bytes */
2896 u32 tx_stat_etherstatspktsover1522octets_hi;
2897 u32 tx_stat_etherstatspktsover1522octets_lo;
2898 u32 tx_stat_mac_2047_hi;
2899 u32 tx_stat_mac_2047_lo;
2900 u32 tx_stat_mac_4095_hi;
2901 u32 tx_stat_mac_4095_lo;
2902 u32 tx_stat_mac_9216_hi;
2903 u32 tx_stat_mac_9216_lo;
2904 u32 tx_stat_mac_16383_hi;
2905 u32 tx_stat_mac_16383_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002906
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002907 /* internal_mac_transmit_errors */
2908 u32 tx_stat_dot3statsinternalmactransmiterrors_hi;
2909 u32 tx_stat_dot3statsinternalmactransmiterrors_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002910
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002911 /* if_out_discards */
2912 u32 tx_stat_mac_ufl_hi;
2913 u32 tx_stat_mac_ufl_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002914};
2915
2916
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002917#define MAC_STX_IDX_MAX 2
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002918
2919struct host_port_stats {
Barak Witkowski0e898dd2011-12-05 21:52:22 +00002920 u32 host_port_stats_counter;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002921
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002922 struct mac_stx mac_stx[MAC_STX_IDX_MAX];
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002923
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002924 u32 brb_drop_hi;
2925 u32 brb_drop_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002926
Barak Witkowski0e898dd2011-12-05 21:52:22 +00002927 u32 not_used; /* obsolete */
2928 u32 pfc_frames_tx_hi;
2929 u32 pfc_frames_tx_lo;
2930 u32 pfc_frames_rx_hi;
2931 u32 pfc_frames_rx_lo;
Yuval Mintzc8c60d82012-06-06 17:13:07 +00002932
2933 u32 eee_lpi_count_hi;
2934 u32 eee_lpi_count_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002935};
2936
2937
2938struct host_func_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002939 u32 host_func_stats_start;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002940
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002941 u32 total_bytes_received_hi;
2942 u32 total_bytes_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002943
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002944 u32 total_bytes_transmitted_hi;
2945 u32 total_bytes_transmitted_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002946
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002947 u32 total_unicast_packets_received_hi;
2948 u32 total_unicast_packets_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002949
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002950 u32 total_multicast_packets_received_hi;
2951 u32 total_multicast_packets_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002952
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002953 u32 total_broadcast_packets_received_hi;
2954 u32 total_broadcast_packets_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002955
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002956 u32 total_unicast_packets_transmitted_hi;
2957 u32 total_unicast_packets_transmitted_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002958
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002959 u32 total_multicast_packets_transmitted_hi;
2960 u32 total_multicast_packets_transmitted_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002961
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002962 u32 total_broadcast_packets_transmitted_hi;
2963 u32 total_broadcast_packets_transmitted_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002964
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002965 u32 valid_bytes_received_hi;
2966 u32 valid_bytes_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002967
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002968 u32 host_func_stats_end;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002969};
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002970
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002971/* VIC definitions */
2972#define VICSTATST_UIF_INDEX 2
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002973
Barak Witkowskia3348722012-04-23 03:04:46 +00002974
2975/* stats collected for afex.
2976 * NOTE: structure is exactly as expected to be received by the switch.
2977 * order must remain exactly as is unless protocol changes !
2978 */
2979struct afex_stats {
2980 u32 tx_unicast_frames_hi;
2981 u32 tx_unicast_frames_lo;
2982 u32 tx_unicast_bytes_hi;
2983 u32 tx_unicast_bytes_lo;
2984 u32 tx_multicast_frames_hi;
2985 u32 tx_multicast_frames_lo;
2986 u32 tx_multicast_bytes_hi;
2987 u32 tx_multicast_bytes_lo;
2988 u32 tx_broadcast_frames_hi;
2989 u32 tx_broadcast_frames_lo;
2990 u32 tx_broadcast_bytes_hi;
2991 u32 tx_broadcast_bytes_lo;
2992 u32 tx_frames_discarded_hi;
2993 u32 tx_frames_discarded_lo;
2994 u32 tx_frames_dropped_hi;
2995 u32 tx_frames_dropped_lo;
2996
2997 u32 rx_unicast_frames_hi;
2998 u32 rx_unicast_frames_lo;
2999 u32 rx_unicast_bytes_hi;
3000 u32 rx_unicast_bytes_lo;
3001 u32 rx_multicast_frames_hi;
3002 u32 rx_multicast_frames_lo;
3003 u32 rx_multicast_bytes_hi;
3004 u32 rx_multicast_bytes_lo;
3005 u32 rx_broadcast_frames_hi;
3006 u32 rx_broadcast_frames_lo;
3007 u32 rx_broadcast_bytes_hi;
3008 u32 rx_broadcast_bytes_lo;
3009 u32 rx_frames_discarded_hi;
3010 u32 rx_frames_discarded_lo;
3011 u32 rx_frames_dropped_hi;
3012 u32 rx_frames_dropped_lo;
3013};
3014
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003015#define BCM_5710_FW_MAJOR_VERSION 7
Yuval Mintz5e091e72015-11-22 15:01:29 +02003016#define BCM_5710_FW_MINOR_VERSION 13
3017#define BCM_5710_FW_REVISION_VERSION 1
Dmitry Kravkov91226792013-03-11 05:17:52 +00003018#define BCM_5710_FW_ENGINEERING_VERSION 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003019#define BCM_5710_FW_COMPILE_FLAGS 1
3020
3021
3022/*
3023 * attention bits
3024 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003025struct atten_sp_status_block {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003026 __le32 attn_bits;
3027 __le32 attn_bits_ack;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003028 u8 status_block_id;
3029 u8 reserved0;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003030 __le16 attn_bits_index;
3031 __le32 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003032};
3033
3034
3035/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003036 * The eth aggregative context of Cstorm
3037 */
3038struct cstorm_eth_ag_context {
3039 u32 __reserved0[10];
3040};
3041
3042
3043/*
3044 * dmae command structure
3045 */
3046struct dmae_command {
3047 u32 opcode;
3048#define DMAE_COMMAND_SRC (0x1<<0)
3049#define DMAE_COMMAND_SRC_SHIFT 0
3050#define DMAE_COMMAND_DST (0x3<<1)
3051#define DMAE_COMMAND_DST_SHIFT 1
3052#define DMAE_COMMAND_C_DST (0x1<<3)
3053#define DMAE_COMMAND_C_DST_SHIFT 3
3054#define DMAE_COMMAND_C_TYPE_ENABLE (0x1<<4)
3055#define DMAE_COMMAND_C_TYPE_ENABLE_SHIFT 4
3056#define DMAE_COMMAND_C_TYPE_CRC_ENABLE (0x1<<5)
3057#define DMAE_COMMAND_C_TYPE_CRC_ENABLE_SHIFT 5
3058#define DMAE_COMMAND_C_TYPE_CRC_OFFSET (0x7<<6)
3059#define DMAE_COMMAND_C_TYPE_CRC_OFFSET_SHIFT 6
3060#define DMAE_COMMAND_ENDIANITY (0x3<<9)
3061#define DMAE_COMMAND_ENDIANITY_SHIFT 9
3062#define DMAE_COMMAND_PORT (0x1<<11)
3063#define DMAE_COMMAND_PORT_SHIFT 11
3064#define DMAE_COMMAND_CRC_RESET (0x1<<12)
3065#define DMAE_COMMAND_CRC_RESET_SHIFT 12
3066#define DMAE_COMMAND_SRC_RESET (0x1<<13)
3067#define DMAE_COMMAND_SRC_RESET_SHIFT 13
3068#define DMAE_COMMAND_DST_RESET (0x1<<14)
3069#define DMAE_COMMAND_DST_RESET_SHIFT 14
3070#define DMAE_COMMAND_E1HVN (0x3<<15)
3071#define DMAE_COMMAND_E1HVN_SHIFT 15
3072#define DMAE_COMMAND_DST_VN (0x3<<17)
3073#define DMAE_COMMAND_DST_VN_SHIFT 17
3074#define DMAE_COMMAND_C_FUNC (0x1<<19)
3075#define DMAE_COMMAND_C_FUNC_SHIFT 19
3076#define DMAE_COMMAND_ERR_POLICY (0x3<<20)
3077#define DMAE_COMMAND_ERR_POLICY_SHIFT 20
3078#define DMAE_COMMAND_RESERVED0 (0x3FF<<22)
3079#define DMAE_COMMAND_RESERVED0_SHIFT 22
3080 u32 src_addr_lo;
3081 u32 src_addr_hi;
3082 u32 dst_addr_lo;
3083 u32 dst_addr_hi;
3084#if defined(__BIG_ENDIAN)
3085 u16 opcode_iov;
3086#define DMAE_COMMAND_SRC_VFID (0x3F<<0)
3087#define DMAE_COMMAND_SRC_VFID_SHIFT 0
3088#define DMAE_COMMAND_SRC_VFPF (0x1<<6)
3089#define DMAE_COMMAND_SRC_VFPF_SHIFT 6
3090#define DMAE_COMMAND_RESERVED1 (0x1<<7)
3091#define DMAE_COMMAND_RESERVED1_SHIFT 7
3092#define DMAE_COMMAND_DST_VFID (0x3F<<8)
3093#define DMAE_COMMAND_DST_VFID_SHIFT 8
3094#define DMAE_COMMAND_DST_VFPF (0x1<<14)
3095#define DMAE_COMMAND_DST_VFPF_SHIFT 14
3096#define DMAE_COMMAND_RESERVED2 (0x1<<15)
3097#define DMAE_COMMAND_RESERVED2_SHIFT 15
3098 u16 len;
3099#elif defined(__LITTLE_ENDIAN)
3100 u16 len;
3101 u16 opcode_iov;
3102#define DMAE_COMMAND_SRC_VFID (0x3F<<0)
3103#define DMAE_COMMAND_SRC_VFID_SHIFT 0
3104#define DMAE_COMMAND_SRC_VFPF (0x1<<6)
3105#define DMAE_COMMAND_SRC_VFPF_SHIFT 6
3106#define DMAE_COMMAND_RESERVED1 (0x1<<7)
3107#define DMAE_COMMAND_RESERVED1_SHIFT 7
3108#define DMAE_COMMAND_DST_VFID (0x3F<<8)
3109#define DMAE_COMMAND_DST_VFID_SHIFT 8
3110#define DMAE_COMMAND_DST_VFPF (0x1<<14)
3111#define DMAE_COMMAND_DST_VFPF_SHIFT 14
3112#define DMAE_COMMAND_RESERVED2 (0x1<<15)
3113#define DMAE_COMMAND_RESERVED2_SHIFT 15
3114#endif
3115 u32 comp_addr_lo;
3116 u32 comp_addr_hi;
3117 u32 comp_val;
3118 u32 crc32;
3119 u32 crc32_c;
3120#if defined(__BIG_ENDIAN)
3121 u16 crc16_c;
3122 u16 crc16;
3123#elif defined(__LITTLE_ENDIAN)
3124 u16 crc16;
3125 u16 crc16_c;
3126#endif
3127#if defined(__BIG_ENDIAN)
3128 u16 reserved3;
3129 u16 crc_t10;
3130#elif defined(__LITTLE_ENDIAN)
3131 u16 crc_t10;
3132 u16 reserved3;
3133#endif
3134#if defined(__BIG_ENDIAN)
3135 u16 xsum8;
3136 u16 xsum16;
3137#elif defined(__LITTLE_ENDIAN)
3138 u16 xsum16;
3139 u16 xsum8;
3140#endif
3141};
3142
3143
3144/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003145 * common data for all protocols
3146 */
3147struct doorbell_hdr {
3148 u8 header;
3149#define DOORBELL_HDR_RX (0x1<<0)
3150#define DOORBELL_HDR_RX_SHIFT 0
3151#define DOORBELL_HDR_DB_TYPE (0x1<<1)
3152#define DOORBELL_HDR_DB_TYPE_SHIFT 1
3153#define DOORBELL_HDR_DPM_SIZE (0x3<<2)
3154#define DOORBELL_HDR_DPM_SIZE_SHIFT 2
3155#define DOORBELL_HDR_CONN_TYPE (0xF<<4)
3156#define DOORBELL_HDR_CONN_TYPE_SHIFT 4
3157};
3158
3159/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003160 * Ethernet doorbell
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003161 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003162struct eth_tx_doorbell {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003163#if defined(__BIG_ENDIAN)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003164 u16 npackets;
3165 u8 params;
3166#define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
3167#define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
3168#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
3169#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
3170#define ETH_TX_DOORBELL_SPARE (0x1<<7)
3171#define ETH_TX_DOORBELL_SPARE_SHIFT 7
3172 struct doorbell_hdr hdr;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003173#elif defined(__LITTLE_ENDIAN)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003174 struct doorbell_hdr hdr;
3175 u8 params;
3176#define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
3177#define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
3178#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
3179#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
3180#define ETH_TX_DOORBELL_SPARE (0x1<<7)
3181#define ETH_TX_DOORBELL_SPARE_SHIFT 7
3182 u16 npackets;
Eilon Greensteinca003922009-08-12 22:53:28 -07003183#endif
3184};
3185
3186
3187/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003188 * 3 lines. status block
3189 */
3190struct hc_status_block_e1x {
3191 __le16 index_values[HC_SB_MAX_INDICES_E1X];
3192 __le16 running_index[HC_SB_MAX_SM];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003193 __le32 rsrv[11];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003194};
3195
3196/*
3197 * host status block
3198 */
3199struct host_hc_status_block_e1x {
3200 struct hc_status_block_e1x sb;
3201};
3202
3203
3204/*
3205 * 3 lines. status block
3206 */
3207struct hc_status_block_e2 {
3208 __le16 index_values[HC_SB_MAX_INDICES_E2];
3209 __le16 running_index[HC_SB_MAX_SM];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003210 __le32 reserved[11];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003211};
3212
3213/*
3214 * host status block
3215 */
3216struct host_hc_status_block_e2 {
3217 struct hc_status_block_e2 sb;
3218};
3219
3220
3221/*
3222 * 5 lines. slow-path status block
3223 */
3224struct hc_sp_status_block {
3225 __le16 index_values[HC_SP_SB_MAX_INDICES];
3226 __le16 running_index;
3227 __le16 rsrv;
3228 u32 rsrv1;
3229};
3230
3231/*
3232 * host status block
3233 */
3234struct host_sp_status_block {
3235 struct atten_sp_status_block atten_status_block;
3236 struct hc_sp_status_block sp_sb;
3237};
3238
3239
3240/*
3241 * IGU driver acknowledgment register
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003242 */
3243struct igu_ack_register {
3244#if defined(__BIG_ENDIAN)
3245 u16 sb_id_and_flags;
3246#define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
3247#define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
3248#define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
3249#define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
3250#define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
3251#define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
3252#define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
3253#define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
3254#define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
3255#define IGU_ACK_REGISTER_RESERVED_SHIFT 11
3256 u16 status_block_index;
3257#elif defined(__LITTLE_ENDIAN)
3258 u16 status_block_index;
3259 u16 sb_id_and_flags;
3260#define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
3261#define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
3262#define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
3263#define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
3264#define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
3265#define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
3266#define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
3267#define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
3268#define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
3269#define IGU_ACK_REGISTER_RESERVED_SHIFT 11
3270#endif
3271};
3272
3273
3274/*
Eilon Greensteinca003922009-08-12 22:53:28 -07003275 * IGU driver acknowledgement register
3276 */
3277struct igu_backward_compatible {
3278 u32 sb_id_and_flags;
3279#define IGU_BACKWARD_COMPATIBLE_SB_INDEX (0xFFFF<<0)
3280#define IGU_BACKWARD_COMPATIBLE_SB_INDEX_SHIFT 0
3281#define IGU_BACKWARD_COMPATIBLE_SB_SELECT (0x1F<<16)
3282#define IGU_BACKWARD_COMPATIBLE_SB_SELECT_SHIFT 16
3283#define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS (0x7<<21)
3284#define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS_SHIFT 21
3285#define IGU_BACKWARD_COMPATIBLE_BUPDATE (0x1<<24)
3286#define IGU_BACKWARD_COMPATIBLE_BUPDATE_SHIFT 24
3287#define IGU_BACKWARD_COMPATIBLE_ENABLE_INT (0x3<<25)
3288#define IGU_BACKWARD_COMPATIBLE_ENABLE_INT_SHIFT 25
3289#define IGU_BACKWARD_COMPATIBLE_RESERVED_0 (0x1F<<27)
3290#define IGU_BACKWARD_COMPATIBLE_RESERVED_0_SHIFT 27
3291 u32 reserved_2;
3292};
3293
3294
3295/*
3296 * IGU driver acknowledgement register
3297 */
3298struct igu_regular {
3299 u32 sb_id_and_flags;
3300#define IGU_REGULAR_SB_INDEX (0xFFFFF<<0)
3301#define IGU_REGULAR_SB_INDEX_SHIFT 0
3302#define IGU_REGULAR_RESERVED0 (0x1<<20)
3303#define IGU_REGULAR_RESERVED0_SHIFT 20
3304#define IGU_REGULAR_SEGMENT_ACCESS (0x7<<21)
3305#define IGU_REGULAR_SEGMENT_ACCESS_SHIFT 21
3306#define IGU_REGULAR_BUPDATE (0x1<<24)
3307#define IGU_REGULAR_BUPDATE_SHIFT 24
3308#define IGU_REGULAR_ENABLE_INT (0x3<<25)
3309#define IGU_REGULAR_ENABLE_INT_SHIFT 25
3310#define IGU_REGULAR_RESERVED_1 (0x1<<27)
3311#define IGU_REGULAR_RESERVED_1_SHIFT 27
3312#define IGU_REGULAR_CLEANUP_TYPE (0x3<<28)
3313#define IGU_REGULAR_CLEANUP_TYPE_SHIFT 28
3314#define IGU_REGULAR_CLEANUP_SET (0x1<<30)
3315#define IGU_REGULAR_CLEANUP_SET_SHIFT 30
3316#define IGU_REGULAR_BCLEANUP (0x1<<31)
3317#define IGU_REGULAR_BCLEANUP_SHIFT 31
3318 u32 reserved_2;
3319};
3320
3321/*
3322 * IGU driver acknowledgement register
3323 */
3324union igu_consprod_reg {
3325 struct igu_regular regular;
3326 struct igu_backward_compatible backward_compatible;
3327};
3328
3329
3330/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003331 * Igu control commands
3332 */
3333enum igu_ctrl_cmd {
3334 IGU_CTRL_CMD_TYPE_RD,
3335 IGU_CTRL_CMD_TYPE_WR,
3336 MAX_IGU_CTRL_CMD
3337};
3338
3339
3340/*
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00003341 * Control register for the IGU command register
3342 */
3343struct igu_ctrl_reg {
3344 u32 ctrl_data;
3345#define IGU_CTRL_REG_ADDRESS (0xFFF<<0)
3346#define IGU_CTRL_REG_ADDRESS_SHIFT 0
3347#define IGU_CTRL_REG_FID (0x7F<<12)
3348#define IGU_CTRL_REG_FID_SHIFT 12
3349#define IGU_CTRL_REG_RESERVED (0x1<<19)
3350#define IGU_CTRL_REG_RESERVED_SHIFT 19
3351#define IGU_CTRL_REG_TYPE (0x1<<20)
3352#define IGU_CTRL_REG_TYPE_SHIFT 20
3353#define IGU_CTRL_REG_UNUSED (0x7FF<<21)
3354#define IGU_CTRL_REG_UNUSED_SHIFT 21
3355};
3356
3357
3358/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003359 * Igu interrupt command
3360 */
3361enum igu_int_cmd {
3362 IGU_INT_ENABLE,
3363 IGU_INT_DISABLE,
3364 IGU_INT_NOP,
3365 IGU_INT_NOP2,
3366 MAX_IGU_INT_CMD
3367};
3368
3369
3370/*
3371 * Igu segments
3372 */
3373enum igu_seg_access {
3374 IGU_SEG_ACCESS_NORM,
3375 IGU_SEG_ACCESS_DEF,
3376 IGU_SEG_ACCESS_ATTN,
3377 MAX_IGU_SEG_ACCESS
3378};
3379
3380
3381/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003382 * Parser parsing flags field
3383 */
3384struct parsing_flags {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003385 __le16 flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003386#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0)
3387#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003388#define PARSING_FLAGS_VLAN (0x1<<1)
3389#define PARSING_FLAGS_VLAN_SHIFT 1
3390#define PARSING_FLAGS_EXTRA_VLAN (0x1<<2)
3391#define PARSING_FLAGS_EXTRA_VLAN_SHIFT 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003392#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL (0x3<<3)
3393#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT 3
3394#define PARSING_FLAGS_IP_OPTIONS (0x1<<5)
3395#define PARSING_FLAGS_IP_OPTIONS_SHIFT 5
3396#define PARSING_FLAGS_FRAGMENTATION_STATUS (0x1<<6)
3397#define PARSING_FLAGS_FRAGMENTATION_STATUS_SHIFT 6
3398#define PARSING_FLAGS_OVER_IP_PROTOCOL (0x3<<7)
3399#define PARSING_FLAGS_OVER_IP_PROTOCOL_SHIFT 7
3400#define PARSING_FLAGS_PURE_ACK_INDICATION (0x1<<9)
3401#define PARSING_FLAGS_PURE_ACK_INDICATION_SHIFT 9
3402#define PARSING_FLAGS_TCP_OPTIONS_EXIST (0x1<<10)
3403#define PARSING_FLAGS_TCP_OPTIONS_EXIST_SHIFT 10
3404#define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG (0x1<<11)
3405#define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG_SHIFT 11
3406#define PARSING_FLAGS_CONNECTION_MATCH (0x1<<12)
3407#define PARSING_FLAGS_CONNECTION_MATCH_SHIFT 12
3408#define PARSING_FLAGS_LLC_SNAP (0x1<<13)
3409#define PARSING_FLAGS_LLC_SNAP_SHIFT 13
3410#define PARSING_FLAGS_RESERVED0 (0x3<<14)
3411#define PARSING_FLAGS_RESERVED0_SHIFT 14
3412};
3413
3414
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003415/*
3416 * Parsing flags for TCP ACK type
3417 */
3418enum prs_flags_ack_type {
3419 PRS_FLAG_PUREACK_PIGGY,
3420 PRS_FLAG_PUREACK_PURE,
3421 MAX_PRS_FLAGS_ACK_TYPE
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003422};
3423
3424
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003425/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003426 * Parsing flags for Ethernet address type
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003427 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003428enum prs_flags_eth_addr_type {
3429 PRS_FLAG_ETHTYPE_NON_UNICAST,
3430 PRS_FLAG_ETHTYPE_UNICAST,
3431 MAX_PRS_FLAGS_ETH_ADDR_TYPE
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003432};
3433
3434
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003435/*
3436 * Parsing flags for over-ethernet protocol
3437 */
3438enum prs_flags_over_eth {
3439 PRS_FLAG_OVERETH_UNKNOWN,
3440 PRS_FLAG_OVERETH_IPV4,
3441 PRS_FLAG_OVERETH_IPV6,
3442 PRS_FLAG_OVERETH_LLCSNAP_UNKNOWN,
3443 MAX_PRS_FLAGS_OVER_ETH
3444};
3445
3446
3447/*
3448 * Parsing flags for over-IP protocol
3449 */
3450enum prs_flags_over_ip {
3451 PRS_FLAG_OVERIP_UNKNOWN,
3452 PRS_FLAG_OVERIP_TCP,
3453 PRS_FLAG_OVERIP_UDP,
3454 MAX_PRS_FLAGS_OVER_IP
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003455};
3456
3457
3458/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003459 * SDM operation gen command (generate aggregative interrupt)
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003460 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003461struct sdm_op_gen {
3462 __le32 command;
3463#define SDM_OP_GEN_COMP_PARAM (0x1F<<0)
3464#define SDM_OP_GEN_COMP_PARAM_SHIFT 0
3465#define SDM_OP_GEN_COMP_TYPE (0x7<<5)
3466#define SDM_OP_GEN_COMP_TYPE_SHIFT 5
3467#define SDM_OP_GEN_AGG_VECT_IDX (0xFF<<8)
3468#define SDM_OP_GEN_AGG_VECT_IDX_SHIFT 8
3469#define SDM_OP_GEN_AGG_VECT_IDX_VALID (0x1<<16)
3470#define SDM_OP_GEN_AGG_VECT_IDX_VALID_SHIFT 16
3471#define SDM_OP_GEN_RESERVED (0x7FFF<<17)
3472#define SDM_OP_GEN_RESERVED_SHIFT 17
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003473};
3474
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003475
3476/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003477 * Timers connection context
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003478 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003479struct timers_block_context {
3480 u32 __reserved_0;
3481 u32 __reserved_1;
3482 u32 __reserved_2;
3483 u32 flags;
3484#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS (0x3<<0)
3485#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS_SHIFT 0
3486#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG (0x1<<2)
3487#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG_SHIFT 2
3488#define __TIMERS_BLOCK_CONTEXT_RESERVED0 (0x1FFFFFFF<<3)
3489#define __TIMERS_BLOCK_CONTEXT_RESERVED0_SHIFT 3
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003490};
3491
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003492
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003493/*
3494 * The eth aggregative context of Tstorm
3495 */
3496struct tstorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003497 u32 __reserved0[14];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003498};
3499
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003500
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003501/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003502 * The eth aggregative context of Ustorm
3503 */
3504struct ustorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003505 u32 __reserved0;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003506#if defined(__BIG_ENDIAN)
3507 u8 cdu_usage;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003508 u8 __reserved2;
3509 u16 __reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003510#elif defined(__LITTLE_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003511 u16 __reserved1;
3512 u8 __reserved2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003513 u8 cdu_usage;
3514#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003515 u32 __reserved3[6];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003516};
3517
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003518
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003519/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003520 * The eth aggregative context of Xstorm
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003521 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003522struct xstorm_eth_ag_context {
3523 u32 reserved0;
3524#if defined(__BIG_ENDIAN)
3525 u8 cdu_reserved;
3526 u8 reserved2;
3527 u16 reserved1;
3528#elif defined(__LITTLE_ENDIAN)
3529 u16 reserved1;
3530 u8 reserved2;
3531 u8 cdu_reserved;
3532#endif
3533 u32 reserved3[30];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003534};
3535
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003536
3537/*
3538 * doorbell message sent to the chip
3539 */
3540struct doorbell {
3541#if defined(__BIG_ENDIAN)
3542 u16 zero_fill2;
3543 u8 zero_fill1;
3544 struct doorbell_hdr header;
3545#elif defined(__LITTLE_ENDIAN)
3546 struct doorbell_hdr header;
3547 u8 zero_fill1;
3548 u16 zero_fill2;
3549#endif
3550};
3551
3552
3553/*
3554 * doorbell message sent to the chip
3555 */
3556struct doorbell_set_prod {
3557#if defined(__BIG_ENDIAN)
3558 u16 prod;
3559 u8 zero_fill1;
3560 struct doorbell_hdr header;
3561#elif defined(__LITTLE_ENDIAN)
3562 struct doorbell_hdr header;
3563 u8 zero_fill1;
3564 u16 prod;
3565#endif
3566};
3567
3568
3569struct regpair {
3570 __le32 lo;
3571 __le32 hi;
3572};
3573
Yuval Mintz86564c32013-01-23 03:21:50 +00003574struct regpair_native {
3575 u32 lo;
3576 u32 hi;
3577};
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003578
3579/*
3580 * Classify rule opcodes in E2/E3
3581 */
3582enum classify_rule {
3583 CLASSIFY_RULE_OPCODE_MAC,
3584 CLASSIFY_RULE_OPCODE_VLAN,
3585 CLASSIFY_RULE_OPCODE_PAIR,
Yuval Mintz5e091e72015-11-22 15:01:29 +02003586 CLASSIFY_RULE_OPCODE_IMAC_VNI,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003587 MAX_CLASSIFY_RULE
3588};
3589
3590
3591/*
3592 * Classify rule types in E2/E3
3593 */
3594enum classify_rule_action_type {
3595 CLASSIFY_RULE_REMOVE,
3596 CLASSIFY_RULE_ADD,
3597 MAX_CLASSIFY_RULE_ACTION_TYPE
3598};
3599
3600
3601/*
3602 * client init ramrod data
3603 */
3604struct client_init_general_data {
3605 u8 client_id;
3606 u8 statistics_counter_id;
3607 u8 statistics_en_flg;
3608 u8 is_fcoe_flg;
3609 u8 activate_flg;
3610 u8 sp_client_id;
3611 __le16 mtu;
3612 u8 statistics_zero_flg;
3613 u8 func_id;
3614 u8 cos;
3615 u8 traffic_type;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03003616 u8 fp_hsi_ver;
3617 u8 reserved0[3];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003618};
3619
3620
3621/*
3622 * client init rx data
3623 */
3624struct client_init_rx_data {
3625 u8 tpa_en;
3626#define CLIENT_INIT_RX_DATA_TPA_EN_IPV4 (0x1<<0)
3627#define CLIENT_INIT_RX_DATA_TPA_EN_IPV4_SHIFT 0
3628#define CLIENT_INIT_RX_DATA_TPA_EN_IPV6 (0x1<<1)
3629#define CLIENT_INIT_RX_DATA_TPA_EN_IPV6_SHIFT 1
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00003630#define CLIENT_INIT_RX_DATA_TPA_MODE (0x1<<2)
3631#define CLIENT_INIT_RX_DATA_TPA_MODE_SHIFT 2
3632#define CLIENT_INIT_RX_DATA_RESERVED5 (0x1F<<3)
3633#define CLIENT_INIT_RX_DATA_RESERVED5_SHIFT 3
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003634 u8 vmqueue_mode_en_flg;
3635 u8 extra_data_over_sgl_en_flg;
3636 u8 cache_line_alignment_log_size;
3637 u8 enable_dynamic_hc;
3638 u8 max_sges_for_packet;
3639 u8 client_qzone_id;
3640 u8 drop_ip_cs_err_flg;
3641 u8 drop_tcp_cs_err_flg;
3642 u8 drop_ttl0_flg;
3643 u8 drop_udp_cs_err_flg;
3644 u8 inner_vlan_removal_enable_flg;
3645 u8 outer_vlan_removal_enable_flg;
3646 u8 status_block_id;
3647 u8 rx_sb_index_number;
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00003648 u8 dont_verify_rings_pause_thr_flg;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003649 u8 max_tpa_queues;
3650 u8 silent_vlan_removal_flg;
3651 __le16 max_bytes_on_bd;
3652 __le16 sge_buff_size;
3653 u8 approx_mcast_engine_id;
3654 u8 rss_engine_id;
3655 struct regpair bd_page_base;
3656 struct regpair sge_page_base;
3657 struct regpair cqe_page_base;
3658 u8 is_leading_rss;
3659 u8 is_approx_mcast;
3660 __le16 max_agg_size;
3661 __le16 state;
3662#define CLIENT_INIT_RX_DATA_UCAST_DROP_ALL (0x1<<0)
3663#define CLIENT_INIT_RX_DATA_UCAST_DROP_ALL_SHIFT 0
3664#define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_ALL (0x1<<1)
3665#define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_ALL_SHIFT 1
3666#define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_UNMATCHED (0x1<<2)
3667#define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_UNMATCHED_SHIFT 2
3668#define CLIENT_INIT_RX_DATA_MCAST_DROP_ALL (0x1<<3)
3669#define CLIENT_INIT_RX_DATA_MCAST_DROP_ALL_SHIFT 3
3670#define CLIENT_INIT_RX_DATA_MCAST_ACCEPT_ALL (0x1<<4)
3671#define CLIENT_INIT_RX_DATA_MCAST_ACCEPT_ALL_SHIFT 4
3672#define CLIENT_INIT_RX_DATA_BCAST_ACCEPT_ALL (0x1<<5)
3673#define CLIENT_INIT_RX_DATA_BCAST_ACCEPT_ALL_SHIFT 5
3674#define CLIENT_INIT_RX_DATA_ACCEPT_ANY_VLAN (0x1<<6)
3675#define CLIENT_INIT_RX_DATA_ACCEPT_ANY_VLAN_SHIFT 6
3676#define CLIENT_INIT_RX_DATA_RESERVED2 (0x1FF<<7)
3677#define CLIENT_INIT_RX_DATA_RESERVED2_SHIFT 7
3678 __le16 cqe_pause_thr_low;
3679 __le16 cqe_pause_thr_high;
3680 __le16 bd_pause_thr_low;
3681 __le16 bd_pause_thr_high;
3682 __le16 sge_pause_thr_low;
3683 __le16 sge_pause_thr_high;
3684 __le16 rx_cos_mask;
3685 __le16 silent_vlan_value;
3686 __le16 silent_vlan_mask;
Michal Kalderoneeed0182014-08-17 16:47:44 +03003687 u8 handle_ptp_pkts_flg;
3688 u8 reserved6[3];
3689 __le32 reserved7;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003690};
3691
3692/*
3693 * client init tx data
3694 */
3695struct client_init_tx_data {
3696 u8 enforce_security_flg;
3697 u8 tx_status_block_id;
3698 u8 tx_sb_index_number;
3699 u8 tss_leading_client_id;
3700 u8 tx_switching_flg;
3701 u8 anti_spoofing_flg;
3702 __le16 default_vlan;
3703 struct regpair tx_bd_page_base;
3704 __le16 state;
3705#define CLIENT_INIT_TX_DATA_UCAST_ACCEPT_ALL (0x1<<0)
3706#define CLIENT_INIT_TX_DATA_UCAST_ACCEPT_ALL_SHIFT 0
3707#define CLIENT_INIT_TX_DATA_MCAST_ACCEPT_ALL (0x1<<1)
3708#define CLIENT_INIT_TX_DATA_MCAST_ACCEPT_ALL_SHIFT 1
3709#define CLIENT_INIT_TX_DATA_BCAST_ACCEPT_ALL (0x1<<2)
3710#define CLIENT_INIT_TX_DATA_BCAST_ACCEPT_ALL_SHIFT 2
3711#define CLIENT_INIT_TX_DATA_ACCEPT_ANY_VLAN (0x1<<3)
3712#define CLIENT_INIT_TX_DATA_ACCEPT_ANY_VLAN_SHIFT 3
Dmitry Kravkov91226792013-03-11 05:17:52 +00003713#define CLIENT_INIT_TX_DATA_RESERVED0 (0xFFF<<4)
3714#define CLIENT_INIT_TX_DATA_RESERVED0_SHIFT 4
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003715 u8 default_vlan_flg;
Barak Witkowskia3348722012-04-23 03:04:46 +00003716 u8 force_default_pri_flg;
Dmitry Kravkov91226792013-03-11 05:17:52 +00003717 u8 tunnel_lso_inc_ip_id;
3718 u8 refuse_outband_vlan_flg;
3719 u8 tunnel_non_lso_pcsum_location;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03003720 u8 tunnel_non_lso_outer_ip_csum_location;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003721};
3722
3723/*
3724 * client init ramrod data
3725 */
3726struct client_init_ramrod_data {
3727 struct client_init_general_data general;
3728 struct client_init_rx_data rx;
3729 struct client_init_tx_data tx;
3730};
3731
3732
3733/*
3734 * client update ramrod data
3735 */
3736struct client_update_ramrod_data {
3737 u8 client_id;
3738 u8 func_id;
3739 u8 inner_vlan_removal_enable_flg;
3740 u8 inner_vlan_removal_change_flg;
3741 u8 outer_vlan_removal_enable_flg;
3742 u8 outer_vlan_removal_change_flg;
3743 u8 anti_spoofing_enable_flg;
3744 u8 anti_spoofing_change_flg;
3745 u8 activate_flg;
3746 u8 activate_change_flg;
3747 __le16 default_vlan;
3748 u8 default_vlan_enable_flg;
3749 u8 default_vlan_change_flg;
3750 __le16 silent_vlan_value;
3751 __le16 silent_vlan_mask;
3752 u8 silent_vlan_removal_flg;
3753 u8 silent_vlan_change_flg;
Dmitry Kravkov91226792013-03-11 05:17:52 +00003754 u8 refuse_outband_vlan_flg;
3755 u8 refuse_outband_vlan_change_flg;
3756 u8 tx_switching_flg;
3757 u8 tx_switching_change_flg;
Michal Kalderoneeed0182014-08-17 16:47:44 +03003758 u8 handle_ptp_pkts_flg;
3759 u8 handle_ptp_pkts_change_flg;
3760 __le16 reserved1;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003761 __le32 echo;
3762};
3763
3764
3765/*
3766 * The eth storm context of Cstorm
3767 */
3768struct cstorm_eth_st_context {
3769 u32 __reserved0[4];
3770};
3771
3772
3773struct double_regpair {
3774 u32 regpair0_lo;
3775 u32 regpair0_hi;
3776 u32 regpair1_lo;
3777 u32 regpair1_hi;
3778};
3779
Dmitry Kravkove42780b2014-08-17 16:47:43 +03003780/* 2nd parse bd type used in ethernet tx BDs */
3781enum eth_2nd_parse_bd_type {
3782 ETH_2ND_PARSE_BD_TYPE_LSO_TUNNEL,
3783 MAX_ETH_2ND_PARSE_BD_TYPE
3784};
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003785
3786/*
3787 * Ethernet address typesm used in ethernet tx BDs
3788 */
3789enum eth_addr_type {
3790 UNKNOWN_ADDRESS,
3791 UNICAST_ADDRESS,
3792 MULTICAST_ADDRESS,
3793 BROADCAST_ADDRESS,
3794 MAX_ETH_ADDR_TYPE
3795};
3796
3797
3798/*
3799 *
3800 */
3801struct eth_classify_cmd_header {
3802 u8 cmd_general_data;
3803#define ETH_CLASSIFY_CMD_HEADER_RX_CMD (0x1<<0)
3804#define ETH_CLASSIFY_CMD_HEADER_RX_CMD_SHIFT 0
3805#define ETH_CLASSIFY_CMD_HEADER_TX_CMD (0x1<<1)
3806#define ETH_CLASSIFY_CMD_HEADER_TX_CMD_SHIFT 1
3807#define ETH_CLASSIFY_CMD_HEADER_OPCODE (0x3<<2)
3808#define ETH_CLASSIFY_CMD_HEADER_OPCODE_SHIFT 2
3809#define ETH_CLASSIFY_CMD_HEADER_IS_ADD (0x1<<4)
3810#define ETH_CLASSIFY_CMD_HEADER_IS_ADD_SHIFT 4
3811#define ETH_CLASSIFY_CMD_HEADER_RESERVED0 (0x7<<5)
3812#define ETH_CLASSIFY_CMD_HEADER_RESERVED0_SHIFT 5
3813 u8 func_id;
3814 u8 client_id;
3815 u8 reserved1;
3816};
3817
3818
3819/*
3820 * header for eth classification config ramrod
3821 */
3822struct eth_classify_header {
3823 u8 rule_cnt;
3824 u8 reserved0;
3825 __le16 reserved1;
3826 __le32 echo;
3827};
3828
Yuval Mintz5e091e72015-11-22 15:01:29 +02003829/*
3830 * Command for adding/removing a Inner-MAC/VNI classification rule
3831 */
3832struct eth_classify_imac_vni_cmd {
3833 struct eth_classify_cmd_header header;
3834 __le32 vni;
3835 __le16 imac_lsb;
3836 __le16 imac_mid;
3837 __le16 imac_msb;
3838 __le16 reserved1;
3839};
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003840
3841/*
3842 * Command for adding/removing a MAC classification rule
3843 */
3844struct eth_classify_mac_cmd {
3845 struct eth_classify_cmd_header header;
Dmitry Kravkov91226792013-03-11 05:17:52 +00003846 __le16 reserved0;
3847 __le16 inner_mac;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003848 __le16 mac_lsb;
3849 __le16 mac_mid;
3850 __le16 mac_msb;
3851 __le16 reserved1;
3852};
3853
3854
3855/*
3856 * Command for adding/removing a MAC-VLAN pair classification rule
3857 */
3858struct eth_classify_pair_cmd {
3859 struct eth_classify_cmd_header header;
Dmitry Kravkov91226792013-03-11 05:17:52 +00003860 __le16 reserved0;
3861 __le16 inner_mac;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003862 __le16 mac_lsb;
3863 __le16 mac_mid;
3864 __le16 mac_msb;
3865 __le16 vlan;
3866};
3867
3868
3869/*
3870 * Command for adding/removing a VLAN classification rule
3871 */
3872struct eth_classify_vlan_cmd {
3873 struct eth_classify_cmd_header header;
3874 __le32 reserved0;
3875 __le32 reserved1;
3876 __le16 reserved2;
3877 __le16 vlan;
3878};
3879
3880/*
Dmitry Kravkove42780b2014-08-17 16:47:43 +03003881 * Command for adding/removing a VXLAN classification rule
3882 */
Dmitry Kravkove42780b2014-08-17 16:47:43 +03003883
3884/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003885 * union for eth classification rule
3886 */
3887union eth_classify_rule_cmd {
3888 struct eth_classify_mac_cmd mac;
3889 struct eth_classify_vlan_cmd vlan;
3890 struct eth_classify_pair_cmd pair;
Yuval Mintz5e091e72015-11-22 15:01:29 +02003891 struct eth_classify_imac_vni_cmd imac_vni;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003892};
3893
3894/*
3895 * parameters for eth classification configuration ramrod
3896 */
3897struct eth_classify_rules_ramrod_data {
3898 struct eth_classify_header header;
3899 union eth_classify_rule_cmd rules[CLASSIFY_RULES_COUNT];
3900};
3901
3902
3903/*
3904 * The data contain client ID need to the ramrod
3905 */
3906struct eth_common_ramrod_data {
3907 __le32 client_id;
3908 __le32 reserved1;
3909};
3910
3911
3912/*
3913 * The eth storm context of Ustorm
3914 */
3915struct ustorm_eth_st_context {
3916 u32 reserved0[52];
3917};
3918
3919/*
3920 * The eth storm context of Tstorm
3921 */
3922struct tstorm_eth_st_context {
3923 u32 __reserved0[28];
3924};
3925
3926/*
3927 * The eth storm context of Xstorm
3928 */
3929struct xstorm_eth_st_context {
3930 u32 reserved0[60];
3931};
3932
3933/*
3934 * Ethernet connection context
3935 */
3936struct eth_context {
3937 struct ustorm_eth_st_context ustorm_st_context;
3938 struct tstorm_eth_st_context tstorm_st_context;
3939 struct xstorm_eth_ag_context xstorm_ag_context;
3940 struct tstorm_eth_ag_context tstorm_ag_context;
3941 struct cstorm_eth_ag_context cstorm_ag_context;
3942 struct ustorm_eth_ag_context ustorm_ag_context;
3943 struct timers_block_context timers_context;
3944 struct xstorm_eth_st_context xstorm_st_context;
3945 struct cstorm_eth_st_context cstorm_st_context;
3946};
3947
3948
3949/*
3950 * union for sgl and raw data.
3951 */
3952union eth_sgl_or_raw_data {
3953 __le16 sgl[8];
3954 u32 raw_data[4];
3955};
3956
3957/*
3958 * eth FP end aggregation CQE parameters struct
3959 */
3960struct eth_end_agg_rx_cqe {
3961 u8 type_error_flags;
3962#define ETH_END_AGG_RX_CQE_TYPE (0x3<<0)
3963#define ETH_END_AGG_RX_CQE_TYPE_SHIFT 0
3964#define ETH_END_AGG_RX_CQE_SGL_RAW_SEL (0x1<<2)
3965#define ETH_END_AGG_RX_CQE_SGL_RAW_SEL_SHIFT 2
3966#define ETH_END_AGG_RX_CQE_RESERVED0 (0x1F<<3)
3967#define ETH_END_AGG_RX_CQE_RESERVED0_SHIFT 3
3968 u8 reserved1;
3969 u8 queue_index;
3970 u8 reserved2;
3971 __le32 timestamp_delta;
3972 __le16 num_of_coalesced_segs;
3973 __le16 pkt_len;
3974 u8 pure_ack_count;
3975 u8 reserved3;
3976 __le16 reserved4;
3977 union eth_sgl_or_raw_data sgl_or_raw_data;
3978 __le32 reserved5[8];
3979};
3980
3981
3982/*
3983 * regular eth FP CQE parameters struct
3984 */
3985struct eth_fast_path_rx_cqe {
3986 u8 type_error_flags;
3987#define ETH_FAST_PATH_RX_CQE_TYPE (0x3<<0)
3988#define ETH_FAST_PATH_RX_CQE_TYPE_SHIFT 0
3989#define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL (0x1<<2)
3990#define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL_SHIFT 2
3991#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG (0x1<<3)
3992#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG_SHIFT 3
3993#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG (0x1<<4)
3994#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG_SHIFT 4
3995#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG (0x1<<5)
3996#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG_SHIFT 5
Michal Kalderoneeed0182014-08-17 16:47:44 +03003997#define ETH_FAST_PATH_RX_CQE_PTP_PKT (0x1<<6)
3998#define ETH_FAST_PATH_RX_CQE_PTP_PKT_SHIFT 6
3999#define ETH_FAST_PATH_RX_CQE_RESERVED0 (0x1<<7)
4000#define ETH_FAST_PATH_RX_CQE_RESERVED0_SHIFT 7
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004001 u8 status_flags;
4002#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE (0x7<<0)
4003#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE_SHIFT 0
4004#define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG (0x1<<3)
4005#define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG_SHIFT 3
4006#define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG (0x1<<4)
4007#define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG_SHIFT 4
4008#define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG (0x1<<5)
4009#define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG_SHIFT 5
4010#define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG (0x1<<6)
4011#define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG_SHIFT 6
4012#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG (0x1<<7)
4013#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7
4014 u8 queue_index;
4015 u8 placement_offset;
4016 __le32 rss_hash_result;
4017 __le16 vlan_tag;
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00004018 __le16 pkt_len_or_gro_seg_len;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004019 __le16 len_on_bd;
4020 struct parsing_flags pars_flags;
4021 union eth_sgl_or_raw_data sgl_or_raw_data;
Yuval Mintz28311f82015-07-22 09:16:22 +03004022 u8 tunn_type;
4023 u8 tunn_inner_hdrs_offset;
4024 __le16 reserved1;
4025 __le32 tunn_tenant_id;
4026 __le32 padding[5];
Dmitry Kravkov75b29452013-06-19 01:36:05 +03004027 u32 marker;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004028};
4029
4030
4031/*
4032 * Command for setting classification flags for a client
4033 */
4034struct eth_filter_rules_cmd {
4035 u8 cmd_general_data;
4036#define ETH_FILTER_RULES_CMD_RX_CMD (0x1<<0)
4037#define ETH_FILTER_RULES_CMD_RX_CMD_SHIFT 0
4038#define ETH_FILTER_RULES_CMD_TX_CMD (0x1<<1)
4039#define ETH_FILTER_RULES_CMD_TX_CMD_SHIFT 1
4040#define ETH_FILTER_RULES_CMD_RESERVED0 (0x3F<<2)
4041#define ETH_FILTER_RULES_CMD_RESERVED0_SHIFT 2
4042 u8 func_id;
4043 u8 client_id;
4044 u8 reserved1;
4045 __le16 state;
4046#define ETH_FILTER_RULES_CMD_UCAST_DROP_ALL (0x1<<0)
4047#define ETH_FILTER_RULES_CMD_UCAST_DROP_ALL_SHIFT 0
4048#define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_ALL (0x1<<1)
4049#define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_ALL_SHIFT 1
4050#define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_UNMATCHED (0x1<<2)
4051#define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_UNMATCHED_SHIFT 2
4052#define ETH_FILTER_RULES_CMD_MCAST_DROP_ALL (0x1<<3)
4053#define ETH_FILTER_RULES_CMD_MCAST_DROP_ALL_SHIFT 3
4054#define ETH_FILTER_RULES_CMD_MCAST_ACCEPT_ALL (0x1<<4)
4055#define ETH_FILTER_RULES_CMD_MCAST_ACCEPT_ALL_SHIFT 4
4056#define ETH_FILTER_RULES_CMD_BCAST_ACCEPT_ALL (0x1<<5)
4057#define ETH_FILTER_RULES_CMD_BCAST_ACCEPT_ALL_SHIFT 5
4058#define ETH_FILTER_RULES_CMD_ACCEPT_ANY_VLAN (0x1<<6)
4059#define ETH_FILTER_RULES_CMD_ACCEPT_ANY_VLAN_SHIFT 6
4060#define ETH_FILTER_RULES_CMD_RESERVED2 (0x1FF<<7)
4061#define ETH_FILTER_RULES_CMD_RESERVED2_SHIFT 7
4062 __le16 reserved3;
4063 struct regpair reserved4;
4064};
4065
4066
4067/*
4068 * parameters for eth classification filters ramrod
4069 */
4070struct eth_filter_rules_ramrod_data {
4071 struct eth_classify_header header;
4072 struct eth_filter_rules_cmd rules[FILTER_RULES_COUNT];
4073};
4074
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004075/* Hsi version */
4076enum eth_fp_hsi_ver {
4077 ETH_FP_HSI_VER_0,
4078 ETH_FP_HSI_VER_1,
4079 ETH_FP_HSI_VER_2,
4080 MAX_ETH_FP_HSI_VER
4081};
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004082
4083/*
4084 * parameters for eth classification configuration ramrod
4085 */
4086struct eth_general_rules_ramrod_data {
4087 struct eth_classify_header header;
4088 union eth_classify_rule_cmd rules[CLASSIFY_RULES_COUNT];
4089};
4090
4091
4092/*
4093 * The data for Halt ramrod
4094 */
4095struct eth_halt_ramrod_data {
4096 __le32 client_id;
4097 __le32 reserved0;
4098};
4099
4100
4101/*
Dmitry Kravkov91226792013-03-11 05:17:52 +00004102 * destination and source mac address.
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004103 */
Dmitry Kravkov91226792013-03-11 05:17:52 +00004104struct eth_mac_addresses {
4105#if defined(__BIG_ENDIAN)
4106 __le16 dst_mid;
4107 __le16 dst_lo;
4108#elif defined(__LITTLE_ENDIAN)
4109 __le16 dst_lo;
4110 __le16 dst_mid;
4111#endif
4112#if defined(__BIG_ENDIAN)
4113 __le16 src_lo;
4114 __le16 dst_hi;
4115#elif defined(__LITTLE_ENDIAN)
4116 __le16 dst_hi;
4117 __le16 src_lo;
4118#endif
4119#if defined(__BIG_ENDIAN)
4120 __le16 src_hi;
4121 __le16 src_mid;
4122#elif defined(__LITTLE_ENDIAN)
4123 __le16 src_mid;
4124 __le16 src_hi;
4125#endif
4126};
4127
4128/* tunneling related data */
4129struct eth_tunnel_data {
Dmitry Kravkov91226792013-03-11 05:17:52 +00004130 __le16 dst_lo;
4131 __le16 dst_mid;
Dmitry Kravkov91226792013-03-11 05:17:52 +00004132 __le16 dst_hi;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004133 __le16 fw_ip_hdr_csum;
Dmitry Kravkov91226792013-03-11 05:17:52 +00004134 __le16 pseudo_csum;
4135 u8 ip_hdr_start_inner_w;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004136 u8 flags;
Yuval Mintz28311f82015-07-22 09:16:22 +03004137#define ETH_TUNNEL_DATA_IPV6_OUTER (0x1<<0)
4138#define ETH_TUNNEL_DATA_IPV6_OUTER_SHIFT 0
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004139#define ETH_TUNNEL_DATA_RESERVED (0x7F<<1)
4140#define ETH_TUNNEL_DATA_RESERVED_SHIFT 1
Dmitry Kravkov91226792013-03-11 05:17:52 +00004141};
4142
4143/* union for mac addresses and for tunneling data.
4144 * considered as tunneling data only if (tunnel_exist == 1).
4145 */
4146union eth_mac_addr_or_tunnel_data {
4147 struct eth_mac_addresses mac_addr;
4148 struct eth_tunnel_data tunnel_data;
4149};
4150
4151/*Command for setting multicast classification for a client */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004152struct eth_multicast_rules_cmd {
4153 u8 cmd_general_data;
4154#define ETH_MULTICAST_RULES_CMD_RX_CMD (0x1<<0)
4155#define ETH_MULTICAST_RULES_CMD_RX_CMD_SHIFT 0
4156#define ETH_MULTICAST_RULES_CMD_TX_CMD (0x1<<1)
4157#define ETH_MULTICAST_RULES_CMD_TX_CMD_SHIFT 1
4158#define ETH_MULTICAST_RULES_CMD_IS_ADD (0x1<<2)
4159#define ETH_MULTICAST_RULES_CMD_IS_ADD_SHIFT 2
4160#define ETH_MULTICAST_RULES_CMD_RESERVED0 (0x1F<<3)
4161#define ETH_MULTICAST_RULES_CMD_RESERVED0_SHIFT 3
4162 u8 func_id;
4163 u8 bin_id;
4164 u8 engine_id;
4165 __le32 reserved2;
4166 struct regpair reserved3;
4167};
4168
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004169/*
4170 * parameters for multicast classification ramrod
4171 */
4172struct eth_multicast_rules_ramrod_data {
4173 struct eth_classify_header header;
4174 struct eth_multicast_rules_cmd rules[MULTICAST_RULES_COUNT];
4175};
4176
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004177/*
4178 * Place holder for ramrods protocol specific data
4179 */
4180struct ramrod_data {
4181 __le32 data_lo;
4182 __le32 data_hi;
4183};
4184
4185/*
4186 * union for ramrod data for Ethernet protocol (CQE) (force size of 16 bits)
4187 */
4188union eth_ramrod_data {
4189 struct ramrod_data general;
4190};
4191
4192
4193/*
4194 * RSS toeplitz hash type, as reported in CQE
4195 */
4196enum eth_rss_hash_type {
4197 DEFAULT_HASH_TYPE,
4198 IPV4_HASH_TYPE,
4199 TCP_IPV4_HASH_TYPE,
4200 IPV6_HASH_TYPE,
4201 TCP_IPV6_HASH_TYPE,
4202 VLAN_PRI_HASH_TYPE,
4203 E1HOV_PRI_HASH_TYPE,
4204 DSCP_HASH_TYPE,
4205 MAX_ETH_RSS_HASH_TYPE
4206};
4207
4208
4209/*
4210 * Ethernet RSS mode
4211 */
4212enum eth_rss_mode {
4213 ETH_RSS_MODE_DISABLED,
4214 ETH_RSS_MODE_REGULAR,
4215 ETH_RSS_MODE_VLAN_PRI,
4216 ETH_RSS_MODE_E1HOV_PRI,
4217 ETH_RSS_MODE_IP_DSCP,
4218 MAX_ETH_RSS_MODE
4219};
4220
4221
4222/*
4223 * parameters for RSS update ramrod (E2)
4224 */
4225struct eth_rss_update_ramrod_data {
4226 u8 rss_engine_id;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004227 u8 rss_mode;
4228 __le16 capabilities;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004229#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_CAPABILITY (0x1<<0)
4230#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_CAPABILITY_SHIFT 0
4231#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_TCP_CAPABILITY (0x1<<1)
4232#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_TCP_CAPABILITY_SHIFT 1
4233#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_UDP_CAPABILITY (0x1<<2)
4234#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_UDP_CAPABILITY_SHIFT 2
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004235#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_VXLAN_CAPABILITY (0x1<<3)
4236#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_VXLAN_CAPABILITY_SHIFT 3
4237#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_CAPABILITY (0x1<<4)
4238#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_CAPABILITY_SHIFT 4
4239#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_TCP_CAPABILITY (0x1<<5)
4240#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_TCP_CAPABILITY_SHIFT 5
4241#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY (0x1<<6)
4242#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY_SHIFT 6
4243#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_VXLAN_CAPABILITY (0x1<<7)
4244#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_VXLAN_CAPABILITY_SHIFT 7
Yuval Mintz28311f82015-07-22 09:16:22 +03004245#define ETH_RSS_UPDATE_RAMROD_DATA_TUNN_INNER_HDRS_CAPABILITY (0x1<<8)
4246#define ETH_RSS_UPDATE_RAMROD_DATA_TUNN_INNER_HDRS_CAPABILITY_SHIFT 8
4247#define ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY (0x1<<9)
4248#define ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY_SHIFT 9
4249#define ETH_RSS_UPDATE_RAMROD_DATA_RESERVED (0x3F<<10)
4250#define ETH_RSS_UPDATE_RAMROD_DATA_RESERVED_SHIFT 10
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004251 u8 rss_result_mask;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004252 u8 reserved3;
4253 __le16 reserved4;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004254 u8 indirection_table[T_ETH_INDIRECTION_TABLE_SIZE];
4255 __le32 rss_key[T_ETH_RSS_KEY];
4256 __le32 echo;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004257 __le32 reserved5;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004258};
4259
4260
4261/*
4262 * The eth Rx Buffer Descriptor
4263 */
4264struct eth_rx_bd {
4265 __le32 addr_lo;
4266 __le32 addr_hi;
4267};
4268
4269
4270/*
4271 * Eth Rx Cqe structure- general structure for ramrods
4272 */
4273struct common_ramrod_eth_rx_cqe {
4274 u8 ramrod_type;
4275#define COMMON_RAMROD_ETH_RX_CQE_TYPE (0x3<<0)
4276#define COMMON_RAMROD_ETH_RX_CQE_TYPE_SHIFT 0
4277#define COMMON_RAMROD_ETH_RX_CQE_ERROR (0x1<<2)
4278#define COMMON_RAMROD_ETH_RX_CQE_ERROR_SHIFT 2
4279#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x1F<<3)
4280#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 3
4281 u8 conn_type;
4282 __le16 reserved1;
4283 __le32 conn_and_cmd_data;
4284#define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0)
4285#define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0
4286#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24)
4287#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24
4288 struct ramrod_data protocol_data;
4289 __le32 echo;
4290 __le32 reserved2[11];
4291};
4292
4293/*
4294 * Rx Last CQE in page (in ETH)
4295 */
4296struct eth_rx_cqe_next_page {
4297 __le32 addr_lo;
4298 __le32 addr_hi;
4299 __le32 reserved[14];
4300};
4301
4302/*
4303 * union for all eth rx cqe types (fix their sizes)
4304 */
4305union eth_rx_cqe {
4306 struct eth_fast_path_rx_cqe fast_path_cqe;
4307 struct common_ramrod_eth_rx_cqe ramrod_cqe;
4308 struct eth_rx_cqe_next_page next_page_cqe;
4309 struct eth_end_agg_rx_cqe end_agg_cqe;
4310};
4311
4312
4313/*
4314 * Values for RX ETH CQE type field
4315 */
4316enum eth_rx_cqe_type {
4317 RX_ETH_CQE_TYPE_ETH_FASTPATH,
4318 RX_ETH_CQE_TYPE_ETH_RAMROD,
4319 RX_ETH_CQE_TYPE_ETH_START_AGG,
4320 RX_ETH_CQE_TYPE_ETH_STOP_AGG,
4321 MAX_ETH_RX_CQE_TYPE
4322};
4323
4324
4325/*
4326 * Type of SGL/Raw field in ETH RX fast path CQE
4327 */
4328enum eth_rx_fp_sel {
4329 ETH_FP_CQE_REGULAR,
4330 ETH_FP_CQE_RAW,
4331 MAX_ETH_RX_FP_SEL
4332};
4333
4334
4335/*
4336 * The eth Rx SGE Descriptor
4337 */
4338struct eth_rx_sge {
4339 __le32 addr_lo;
4340 __le32 addr_hi;
4341};
4342
4343
4344/*
4345 * common data for all protocols
4346 */
4347struct spe_hdr {
4348 __le32 conn_and_cmd_data;
4349#define SPE_HDR_CID (0xFFFFFF<<0)
4350#define SPE_HDR_CID_SHIFT 0
4351#define SPE_HDR_CMD_ID (0xFF<<24)
4352#define SPE_HDR_CMD_ID_SHIFT 24
4353 __le16 type;
4354#define SPE_HDR_CONN_TYPE (0xFF<<0)
4355#define SPE_HDR_CONN_TYPE_SHIFT 0
4356#define SPE_HDR_FUNCTION_ID (0xFF<<8)
4357#define SPE_HDR_FUNCTION_ID_SHIFT 8
4358 __le16 reserved1;
4359};
4360
4361/*
4362 * specific data for ethernet slow path element
4363 */
4364union eth_specific_data {
4365 u8 protocol_data[8];
4366 struct regpair client_update_ramrod_data;
4367 struct regpair client_init_ramrod_init_data;
4368 struct eth_halt_ramrod_data halt_ramrod_data;
4369 struct regpair update_data_addr;
4370 struct eth_common_ramrod_data common_ramrod_data;
4371 struct regpair classify_cfg_addr;
4372 struct regpair filter_cfg_addr;
4373 struct regpair mcast_cfg_addr;
4374};
4375
4376/*
4377 * Ethernet slow path element
4378 */
4379struct eth_spe {
4380 struct spe_hdr hdr;
4381 union eth_specific_data data;
4382};
4383
4384
4385/*
4386 * Ethernet command ID for slow path elements
4387 */
4388enum eth_spqe_cmd_id {
4389 RAMROD_CMD_ID_ETH_UNUSED,
4390 RAMROD_CMD_ID_ETH_CLIENT_SETUP,
4391 RAMROD_CMD_ID_ETH_HALT,
4392 RAMROD_CMD_ID_ETH_FORWARD_SETUP,
4393 RAMROD_CMD_ID_ETH_TX_QUEUE_SETUP,
4394 RAMROD_CMD_ID_ETH_CLIENT_UPDATE,
4395 RAMROD_CMD_ID_ETH_EMPTY,
4396 RAMROD_CMD_ID_ETH_TERMINATE,
4397 RAMROD_CMD_ID_ETH_TPA_UPDATE,
4398 RAMROD_CMD_ID_ETH_CLASSIFICATION_RULES,
4399 RAMROD_CMD_ID_ETH_FILTER_RULES,
4400 RAMROD_CMD_ID_ETH_MULTICAST_RULES,
4401 RAMROD_CMD_ID_ETH_RSS_UPDATE,
4402 RAMROD_CMD_ID_ETH_SET_MAC,
4403 MAX_ETH_SPQE_CMD_ID
4404};
4405
4406
4407/*
4408 * eth tpa update command
4409 */
4410enum eth_tpa_update_command {
4411 TPA_UPDATE_NONE_COMMAND,
4412 TPA_UPDATE_ENABLE_COMMAND,
4413 TPA_UPDATE_DISABLE_COMMAND,
4414 MAX_ETH_TPA_UPDATE_COMMAND
4415};
4416
Dmitry Kravkov91226792013-03-11 05:17:52 +00004417/* In case of LSO over IPv4 tunnel, whether to increment
4418 * IP ID on external IP header or internal IP header
4419 */
4420enum eth_tunnel_lso_inc_ip_id {
4421 EXT_HEADER,
4422 INT_HEADER,
4423 MAX_ETH_TUNNEL_LSO_INC_IP_ID
4424};
4425
4426/* In case tunnel exist and L4 checksum offload,
4427 * the pseudo checksum location, on packet or on BD.
4428 */
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004429enum eth_tunnel_non_lso_csum_location {
4430 CSUM_ON_PKT,
4431 CSUM_ON_BD,
4432 MAX_ETH_TUNNEL_NON_LSO_CSUM_LOCATION
Dmitry Kravkov91226792013-03-11 05:17:52 +00004433};
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004434
Yuval Mintz28311f82015-07-22 09:16:22 +03004435enum eth_tunn_type {
4436 TUNN_TYPE_NONE,
4437 TUNN_TYPE_VXLAN,
4438 TUNN_TYPE_L2_GRE,
4439 TUNN_TYPE_IPV4_GRE,
4440 TUNN_TYPE_IPV6_GRE,
4441 TUNN_TYPE_L2_GENEVE,
4442 TUNN_TYPE_IPV4_GENEVE,
4443 TUNN_TYPE_IPV6_GENEVE,
4444 MAX_ETH_TUNN_TYPE
4445};
4446
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004447/*
4448 * Tx regular BD structure
4449 */
4450struct eth_tx_bd {
4451 __le32 addr_lo;
4452 __le32 addr_hi;
4453 __le16 total_pkt_bytes;
4454 __le16 nbytes;
4455 u8 reserved[4];
4456};
4457
4458
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004459/*
Eilon Greenstein33471622008-08-13 15:59:08 -07004460 * structure for easy accessibility to assembler
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004461 */
4462struct eth_tx_bd_flags {
4463 u8 as_bitfield;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004464#define ETH_TX_BD_FLAGS_IP_CSUM (0x1<<0)
4465#define ETH_TX_BD_FLAGS_IP_CSUM_SHIFT 0
4466#define ETH_TX_BD_FLAGS_L4_CSUM (0x1<<1)
4467#define ETH_TX_BD_FLAGS_L4_CSUM_SHIFT 1
4468#define ETH_TX_BD_FLAGS_VLAN_MODE (0x3<<2)
4469#define ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004470#define ETH_TX_BD_FLAGS_START_BD (0x1<<4)
4471#define ETH_TX_BD_FLAGS_START_BD_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004472#define ETH_TX_BD_FLAGS_IS_UDP (0x1<<5)
4473#define ETH_TX_BD_FLAGS_IS_UDP_SHIFT 5
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004474#define ETH_TX_BD_FLAGS_SW_LSO (0x1<<6)
4475#define ETH_TX_BD_FLAGS_SW_LSO_SHIFT 6
4476#define ETH_TX_BD_FLAGS_IPV6 (0x1<<7)
4477#define ETH_TX_BD_FLAGS_IPV6_SHIFT 7
4478};
4479
4480/*
4481 * The eth Tx Buffer Descriptor
4482 */
Eilon Greensteinca003922009-08-12 22:53:28 -07004483struct eth_tx_start_bd {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00004484 __le32 addr_lo;
4485 __le32 addr_hi;
4486 __le16 nbd;
4487 __le16 nbytes;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004488 __le16 vlan_or_ethertype;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004489 struct eth_tx_bd_flags bd_flags;
4490 u8 general_data;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004491#define ETH_TX_START_BD_HDR_NBDS (0x7<<0)
Eilon Greensteinca003922009-08-12 22:53:28 -07004492#define ETH_TX_START_BD_HDR_NBDS_SHIFT 0
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004493#define ETH_TX_START_BD_NO_ADDED_TAGS (0x1<<3)
4494#define ETH_TX_START_BD_NO_ADDED_TAGS_SHIFT 3
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004495#define ETH_TX_START_BD_FORCE_VLAN_MODE (0x1<<4)
4496#define ETH_TX_START_BD_FORCE_VLAN_MODE_SHIFT 4
Yuval Mintz96bed4b2012-10-01 03:46:19 +00004497#define ETH_TX_START_BD_PARSE_NBDS (0x3<<5)
4498#define ETH_TX_START_BD_PARSE_NBDS_SHIFT 5
Dmitry Kravkov91226792013-03-11 05:17:52 +00004499#define ETH_TX_START_BD_TUNNEL_EXIST (0x1<<7)
4500#define ETH_TX_START_BD_TUNNEL_EXIST_SHIFT 7
Eilon Greensteinca003922009-08-12 22:53:28 -07004501};
4502
4503/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004504 * Tx parsing BD structure for ETH E1/E1h
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004505 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004506struct eth_tx_parse_bd_e1x {
Yuval Mintz96bed4b2012-10-01 03:46:19 +00004507 __le16 global_data;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004508#define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W (0xF<<0)
4509#define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W_SHIFT 0
Yuval Mintz96bed4b2012-10-01 03:46:19 +00004510#define ETH_TX_PARSE_BD_E1X_ETH_ADDR_TYPE (0x3<<4)
4511#define ETH_TX_PARSE_BD_E1X_ETH_ADDR_TYPE_SHIFT 4
4512#define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN (0x1<<6)
4513#define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN_SHIFT 6
4514#define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN (0x1<<7)
4515#define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT 7
4516#define ETH_TX_PARSE_BD_E1X_NS_FLG (0x1<<8)
4517#define ETH_TX_PARSE_BD_E1X_NS_FLG_SHIFT 8
4518#define ETH_TX_PARSE_BD_E1X_RESERVED0 (0x7F<<9)
4519#define ETH_TX_PARSE_BD_E1X_RESERVED0_SHIFT 9
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004520 u8 tcp_flags;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004521#define ETH_TX_PARSE_BD_E1X_FIN_FLG (0x1<<0)
4522#define ETH_TX_PARSE_BD_E1X_FIN_FLG_SHIFT 0
4523#define ETH_TX_PARSE_BD_E1X_SYN_FLG (0x1<<1)
4524#define ETH_TX_PARSE_BD_E1X_SYN_FLG_SHIFT 1
4525#define ETH_TX_PARSE_BD_E1X_RST_FLG (0x1<<2)
4526#define ETH_TX_PARSE_BD_E1X_RST_FLG_SHIFT 2
4527#define ETH_TX_PARSE_BD_E1X_PSH_FLG (0x1<<3)
4528#define ETH_TX_PARSE_BD_E1X_PSH_FLG_SHIFT 3
4529#define ETH_TX_PARSE_BD_E1X_ACK_FLG (0x1<<4)
4530#define ETH_TX_PARSE_BD_E1X_ACK_FLG_SHIFT 4
4531#define ETH_TX_PARSE_BD_E1X_URG_FLG (0x1<<5)
4532#define ETH_TX_PARSE_BD_E1X_URG_FLG_SHIFT 5
4533#define ETH_TX_PARSE_BD_E1X_ECE_FLG (0x1<<6)
4534#define ETH_TX_PARSE_BD_E1X_ECE_FLG_SHIFT 6
4535#define ETH_TX_PARSE_BD_E1X_CWR_FLG (0x1<<7)
4536#define ETH_TX_PARSE_BD_E1X_CWR_FLG_SHIFT 7
4537 u8 ip_hlen_w;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004538 __le16 total_hlen_w;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00004539 __le16 tcp_pseudo_csum;
Eilon Greensteinca003922009-08-12 22:53:28 -07004540 __le16 lso_mss;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00004541 __le16 ip_id;
4542 __le32 tcp_send_seq;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004543};
4544
4545/*
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00004546 * Tx parsing BD structure for ETH E2
4547 */
4548struct eth_tx_parse_bd_e2 {
Dmitry Kravkov91226792013-03-11 05:17:52 +00004549 union eth_mac_addr_or_tunnel_data data;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00004550 __le32 parsing_data;
Dmitry Kravkov91226792013-03-11 05:17:52 +00004551#define ETH_TX_PARSE_BD_E2_L4_HDR_START_OFFSET_W (0x7FF<<0)
4552#define ETH_TX_PARSE_BD_E2_L4_HDR_START_OFFSET_W_SHIFT 0
Yuval Mintz96bed4b2012-10-01 03:46:19 +00004553#define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW (0xF<<11)
4554#define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT 11
4555#define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR (0x1<<15)
4556#define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR_SHIFT 15
4557#define ETH_TX_PARSE_BD_E2_LSO_MSS (0x3FFF<<16)
4558#define ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT 16
4559#define ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE (0x3<<30)
4560#define ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT 30
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00004561};
4562
4563/*
Dmitry Kravkov91226792013-03-11 05:17:52 +00004564 * Tx 2nd parsing BD structure for ETH packet
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004565 */
Dmitry Kravkov91226792013-03-11 05:17:52 +00004566struct eth_tx_parse_2nd_bd {
4567 __le16 global_data;
4568#define ETH_TX_PARSE_2ND_BD_IP_HDR_START_OUTER_W (0xF<<0)
4569#define ETH_TX_PARSE_2ND_BD_IP_HDR_START_OUTER_W_SHIFT 0
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004570#define ETH_TX_PARSE_2ND_BD_RESERVED0 (0x1<<4)
4571#define ETH_TX_PARSE_2ND_BD_RESERVED0_SHIFT 4
Dmitry Kravkov91226792013-03-11 05:17:52 +00004572#define ETH_TX_PARSE_2ND_BD_LLC_SNAP_EN (0x1<<5)
4573#define ETH_TX_PARSE_2ND_BD_LLC_SNAP_EN_SHIFT 5
4574#define ETH_TX_PARSE_2ND_BD_NS_FLG (0x1<<6)
4575#define ETH_TX_PARSE_2ND_BD_NS_FLG_SHIFT 6
4576#define ETH_TX_PARSE_2ND_BD_TUNNEL_UDP_EXIST (0x1<<7)
4577#define ETH_TX_PARSE_2ND_BD_TUNNEL_UDP_EXIST_SHIFT 7
4578#define ETH_TX_PARSE_2ND_BD_IP_HDR_LEN_OUTER_W (0x1F<<8)
4579#define ETH_TX_PARSE_2ND_BD_IP_HDR_LEN_OUTER_W_SHIFT 8
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004580#define ETH_TX_PARSE_2ND_BD_RESERVED1 (0x7<<13)
4581#define ETH_TX_PARSE_2ND_BD_RESERVED1_SHIFT 13
4582 u8 bd_type;
4583#define ETH_TX_PARSE_2ND_BD_TYPE (0xF<<0)
4584#define ETH_TX_PARSE_2ND_BD_TYPE_SHIFT 0
4585#define ETH_TX_PARSE_2ND_BD_RESERVED2 (0xF<<4)
4586#define ETH_TX_PARSE_2ND_BD_RESERVED2_SHIFT 4
4587 u8 reserved3;
Dmitry Kravkov91226792013-03-11 05:17:52 +00004588 u8 tcp_flags;
4589#define ETH_TX_PARSE_2ND_BD_FIN_FLG (0x1<<0)
4590#define ETH_TX_PARSE_2ND_BD_FIN_FLG_SHIFT 0
4591#define ETH_TX_PARSE_2ND_BD_SYN_FLG (0x1<<1)
4592#define ETH_TX_PARSE_2ND_BD_SYN_FLG_SHIFT 1
4593#define ETH_TX_PARSE_2ND_BD_RST_FLG (0x1<<2)
4594#define ETH_TX_PARSE_2ND_BD_RST_FLG_SHIFT 2
4595#define ETH_TX_PARSE_2ND_BD_PSH_FLG (0x1<<3)
4596#define ETH_TX_PARSE_2ND_BD_PSH_FLG_SHIFT 3
4597#define ETH_TX_PARSE_2ND_BD_ACK_FLG (0x1<<4)
4598#define ETH_TX_PARSE_2ND_BD_ACK_FLG_SHIFT 4
4599#define ETH_TX_PARSE_2ND_BD_URG_FLG (0x1<<5)
4600#define ETH_TX_PARSE_2ND_BD_URG_FLG_SHIFT 5
4601#define ETH_TX_PARSE_2ND_BD_ECE_FLG (0x1<<6)
4602#define ETH_TX_PARSE_2ND_BD_ECE_FLG_SHIFT 6
4603#define ETH_TX_PARSE_2ND_BD_CWR_FLG (0x1<<7)
4604#define ETH_TX_PARSE_2ND_BD_CWR_FLG_SHIFT 7
Dmitry Kravkove42780b2014-08-17 16:47:43 +03004605 u8 reserved4;
Dmitry Kravkov91226792013-03-11 05:17:52 +00004606 u8 tunnel_udp_hdr_start_w;
4607 u8 fw_ip_hdr_to_payload_w;
4608 __le16 fw_ip_csum_wo_len_flags_frag;
4609 __le16 hw_ip_id;
4610 __le32 tcp_send_seq;
4611};
4612
4613/* The last BD in the BD memory will hold a pointer to the next BD memory */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004614struct eth_tx_next_bd {
Eilon Greensteinca003922009-08-12 22:53:28 -07004615 __le32 addr_lo;
4616 __le32 addr_hi;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004617 u8 reserved[8];
4618};
4619
4620/*
Eilon Greensteinca003922009-08-12 22:53:28 -07004621 * union for 4 Bd types
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004622 */
4623union eth_tx_bd_types {
Eilon Greensteinca003922009-08-12 22:53:28 -07004624 struct eth_tx_start_bd start_bd;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004625 struct eth_tx_bd reg_bd;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004626 struct eth_tx_parse_bd_e1x parse_bd_e1x;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00004627 struct eth_tx_parse_bd_e2 parse_bd_e2;
Dmitry Kravkov91226792013-03-11 05:17:52 +00004628 struct eth_tx_parse_2nd_bd parse_2nd_bd;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004629 struct eth_tx_next_bd next_bd;
4630};
4631
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004632/*
Eilon Greensteinca003922009-08-12 22:53:28 -07004633 * array of 13 bds as appears in the eth xstorm context
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004634 */
Eilon Greensteinca003922009-08-12 22:53:28 -07004635struct eth_tx_bds_array {
4636 union eth_tx_bd_types bds[13];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004637};
4638
4639
4640/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004641 * VLAN mode on TX BDs
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004642 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004643enum eth_tx_vlan_type {
4644 X_ETH_NO_VLAN,
4645 X_ETH_OUTBAND_VLAN,
4646 X_ETH_INBAND_VLAN,
4647 X_ETH_FW_ADDED_VLAN,
4648 MAX_ETH_TX_VLAN_TYPE
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004649};
4650
Eilon Greensteinca003922009-08-12 22:53:28 -07004651
4652/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004653 * Ethernet VLAN filtering mode in E1x
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004654 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004655enum eth_vlan_filter_mode {
4656 ETH_VLAN_FILTER_ANY_VLAN,
4657 ETH_VLAN_FILTER_SPECIFIC_VLAN,
4658 ETH_VLAN_FILTER_CLASSIFY,
4659 MAX_ETH_VLAN_FILTER_MODE
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004660};
4661
4662
4663/*
4664 * MAC filtering configuration command header
4665 */
4666struct mac_configuration_hdr {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004667 u8 length;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004668 u8 offset;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004669 __le16 client_id;
4670 __le32 echo;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004671};
4672
4673/*
4674 * MAC address in list for ramrod
4675 */
4676struct mac_configuration_entry {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004677 __le16 lsb_mac_addr;
4678 __le16 middle_mac_addr;
4679 __le16 msb_mac_addr;
4680 __le16 vlan_id;
4681 u8 pf_id;
4682 u8 flags;
4683#define MAC_CONFIGURATION_ENTRY_ACTION_TYPE (0x1<<0)
4684#define MAC_CONFIGURATION_ENTRY_ACTION_TYPE_SHIFT 0
4685#define MAC_CONFIGURATION_ENTRY_RDMA_MAC (0x1<<1)
4686#define MAC_CONFIGURATION_ENTRY_RDMA_MAC_SHIFT 1
4687#define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE (0x3<<2)
4688#define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE_SHIFT 2
4689#define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL (0x1<<4)
4690#define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL_SHIFT 4
4691#define MAC_CONFIGURATION_ENTRY_BROADCAST (0x1<<5)
4692#define MAC_CONFIGURATION_ENTRY_BROADCAST_SHIFT 5
4693#define MAC_CONFIGURATION_ENTRY_RESERVED1 (0x3<<6)
4694#define MAC_CONFIGURATION_ENTRY_RESERVED1_SHIFT 6
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004695 __le16 reserved0;
4696 __le32 clients_bit_vector;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004697};
4698
4699/*
4700 * MAC filtering configuration command
4701 */
4702struct mac_configuration_cmd {
4703 struct mac_configuration_hdr hdr;
4704 struct mac_configuration_entry config_table[64];
4705};
4706
4707
4708/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004709 * Set-MAC command type (in E1x)
4710 */
4711enum set_mac_action_type {
4712 T_ETH_MAC_COMMAND_INVALIDATE,
4713 T_ETH_MAC_COMMAND_SET,
4714 MAX_SET_MAC_ACTION_TYPE
4715};
4716
4717
4718/*
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00004719 * Ethernet TPA Modes
4720 */
4721enum tpa_mode {
4722 TPA_LRO,
4723 TPA_GRO,
4724 MAX_TPA_MODE};
4725
4726
4727/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004728 * tpa update ramrod data
4729 */
4730struct tpa_update_ramrod_data {
4731 u8 update_ipv4;
4732 u8 update_ipv6;
4733 u8 client_id;
4734 u8 max_tpa_queues;
4735 u8 max_sges_for_packet;
4736 u8 complete_on_both_clients;
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00004737 u8 dont_verify_rings_pause_thr_flg;
4738 u8 tpa_mode;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004739 __le16 sge_buff_size;
4740 __le16 max_agg_size;
4741 __le32 sge_page_base_lo;
4742 __le32 sge_page_base_hi;
4743 __le16 sge_pause_thr_low;
4744 __le16 sge_pause_thr_high;
4745};
4746
4747
4748/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004749 * approximate-match multicast filtering for E1H per function in Tstorm
4750 */
4751struct tstorm_eth_approximate_match_multicast_filtering {
4752 u32 mcast_add_hash_bit_array[8];
4753};
4754
4755
4756/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004757 * Common configuration parameters per function in Tstorm
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004758 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004759struct tstorm_eth_function_common_config {
4760 __le16 config_flags;
4761#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
4762#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
4763#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
4764#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
4765#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
4766#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
4767#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
4768#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
4769#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4)
4770#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4
4771#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE (0x1<<7)
4772#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE_SHIFT 7
4773#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0xFF<<8)
4774#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 8
4775 u8 rss_result_mask;
4776 u8 reserved1;
4777 __le16 vlan_id[2];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004778};
4779
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004780
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004781/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004782 * MAC filtering configuration parameters per port in Tstorm
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004783 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004784struct tstorm_eth_mac_filter_config {
Yuval Mintz86564c32013-01-23 03:21:50 +00004785 u32 ucast_drop_all;
4786 u32 ucast_accept_all;
4787 u32 mcast_drop_all;
4788 u32 mcast_accept_all;
4789 u32 bcast_accept_all;
4790 u32 vlan_filter[2];
4791 u32 unmatched_unicast;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004792};
4793
4794
4795/*
4796 * tx only queue init ramrod data
4797 */
4798struct tx_queue_init_ramrod_data {
4799 struct client_init_general_data general;
4800 struct client_init_tx_data tx;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004801};
4802
4803
4804/*
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004805 * Three RX producers for ETH
4806 */
4807struct ustorm_eth_rx_producers {
4808#if defined(__BIG_ENDIAN)
4809 u16 bd_prod;
4810 u16 cqe_prod;
4811#elif defined(__LITTLE_ENDIAN)
4812 u16 cqe_prod;
4813 u16 bd_prod;
4814#endif
4815#if defined(__BIG_ENDIAN)
4816 u16 reserved;
4817 u16 sge_prod;
4818#elif defined(__LITTLE_ENDIAN)
4819 u16 sge_prod;
4820 u16 reserved;
4821#endif
4822};
4823
4824
4825/*
Barak Witkowski50f0a562011-12-05 21:52:23 +00004826 * FCoE RX statistics parameters section#0
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004827 */
Barak Witkowski50f0a562011-12-05 21:52:23 +00004828struct fcoe_rx_stat_params_section0 {
4829 __le32 fcoe_rx_pkt_cnt;
4830 __le32 fcoe_rx_byte_cnt;
4831};
4832
4833
4834/*
4835 * FCoE RX statistics parameters section#1
4836 */
4837struct fcoe_rx_stat_params_section1 {
4838 __le32 fcoe_ver_cnt;
4839 __le32 fcoe_rx_drop_pkt_cnt;
4840};
4841
4842
4843/*
4844 * FCoE RX statistics parameters section#2
4845 */
4846struct fcoe_rx_stat_params_section2 {
4847 __le32 fc_crc_cnt;
4848 __le32 eofa_del_cnt;
4849 __le32 miss_frame_cnt;
4850 __le32 seq_timeout_cnt;
4851 __le32 drop_seq_cnt;
4852 __le32 fcoe_rx_drop_pkt_cnt;
4853 __le32 fcp_rx_pkt_cnt;
4854 __le32 reserved0;
4855};
4856
4857
4858/*
4859 * FCoE TX statistics parameters
4860 */
4861struct fcoe_tx_stat_params {
4862 __le32 fcoe_tx_pkt_cnt;
4863 __le32 fcoe_tx_byte_cnt;
4864 __le32 fcp_tx_pkt_cnt;
4865 __le32 reserved0;
4866};
4867
4868/*
4869 * FCoE statistics parameters
4870 */
4871struct fcoe_statistics_params {
4872 struct fcoe_tx_stat_params tx_stat;
4873 struct fcoe_rx_stat_params_section0 rx_stat0;
4874 struct fcoe_rx_stat_params_section1 rx_stat1;
4875 struct fcoe_rx_stat_params_section2 rx_stat2;
4876};
4877
4878
4879/*
Barak Witkowskia3348722012-04-23 03:04:46 +00004880 * The data afex vif list ramrod need
4881 */
4882struct afex_vif_list_ramrod_data {
4883 u8 afex_vif_list_command;
4884 u8 func_bit_map;
4885 __le16 vif_list_index;
4886 u8 func_to_clear;
4887 u8 echo;
4888 __le16 reserved1;
4889};
4890
Yuval Mintz28311f82015-07-22 09:16:22 +03004891struct c2s_pri_trans_table_entry {
4892 u8 val[MAX_VLAN_PRIORITIES];
4893};
Barak Witkowskia3348722012-04-23 03:04:46 +00004894
4895/*
Barak Witkowski50f0a562011-12-05 21:52:23 +00004896 * cfc delete event data
Barak Witkowskia3348722012-04-23 03:04:46 +00004897 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004898struct cfc_del_event_data {
Michal Schmidtda472732016-03-02 13:47:09 +01004899 __le32 cid;
4900 __le32 reserved0;
4901 __le32 reserved1;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004902};
4903
4904
4905/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004906 * per-port SAFC demo variables
4907 */
4908struct cmng_flags_per_port {
Eilon Greenstein8a1c38d2009-02-12 08:36:40 +00004909 u32 cmng_enables;
4910#define CMNG_FLAGS_PER_PORT_FAIRNESS_VN (0x1<<0)
4911#define CMNG_FLAGS_PER_PORT_FAIRNESS_VN_SHIFT 0
4912#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN (0x1<<1)
4913#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN_SHIFT 1
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004914#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS (0x1<<2)
4915#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_SHIFT 2
4916#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE (0x1<<3)
4917#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE_SHIFT 3
4918#define __CMNG_FLAGS_PER_PORT_RESERVED0 (0xFFFFFFF<<4)
4919#define __CMNG_FLAGS_PER_PORT_RESERVED0_SHIFT 4
4920 u32 __reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004921};
4922
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004923
4924/*
4925 * per-port rate shaping variables
4926 */
4927struct rate_shaping_vars_per_port {
4928 u32 rs_periodic_timeout;
4929 u32 rs_threshold;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004930};
4931
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004932/*
4933 * per-port fairness variables
4934 */
4935struct fairness_vars_per_port {
4936 u32 upper_bound;
4937 u32 fair_threshold;
4938 u32 fairness_timeout;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004939 u32 reserved0;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004940};
4941
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004942/*
4943 * per-port SAFC variables
4944 */
4945struct safc_struct_per_port {
4946#if defined(__BIG_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004947 u16 __reserved1;
4948 u8 __reserved0;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004949 u8 safc_timeout_usec;
4950#elif defined(__LITTLE_ENDIAN)
4951 u8 safc_timeout_usec;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004952 u8 __reserved0;
4953 u16 __reserved1;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004954#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004955 u8 cos_to_traffic_types[MAX_COS_NUMBER];
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004956 u16 cos_to_pause_mask[NUM_OF_SAFC_BITS];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004957};
4958
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004959/*
4960 * Per-port congestion management variables
4961 */
4962struct cmng_struct_per_port {
4963 struct rate_shaping_vars_per_port rs_vars;
4964 struct fairness_vars_per_port fair_vars;
4965 struct safc_struct_per_port safc_vars;
4966 struct cmng_flags_per_port flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004967};
4968
Yuval Mintzb475d782012-04-03 18:41:29 +00004969/*
4970 * a single rate shaping counter. can be used as protocol or vnic counter
4971 */
4972struct rate_shaping_counter {
4973 u32 quota;
4974#if defined(__BIG_ENDIAN)
4975 u16 __reserved0;
4976 u16 rate;
4977#elif defined(__LITTLE_ENDIAN)
4978 u16 rate;
4979 u16 __reserved0;
4980#endif
4981};
4982
4983/*
4984 * per-vnic rate shaping variables
4985 */
4986struct rate_shaping_vars_per_vn {
4987 struct rate_shaping_counter vn_counter;
4988};
4989
4990/*
4991 * per-vnic fairness variables
4992 */
4993struct fairness_vars_per_vn {
4994 u32 cos_credit_delta[MAX_COS_NUMBER];
4995 u32 vn_credit_delta;
4996 u32 __reserved0;
4997};
4998
4999/*
5000 * cmng port init state
5001 */
5002struct cmng_vnic {
5003 struct rate_shaping_vars_per_vn vnic_max_rate[4];
5004 struct fairness_vars_per_vn vnic_min_rate[4];
5005};
5006
5007/*
5008 * cmng port init state
5009 */
5010struct cmng_init {
5011 struct cmng_struct_per_port port;
5012 struct cmng_vnic vnic;
5013};
5014
5015
5016/*
5017 * driver parameters for congestion management init, all rates are in Mbps
5018 */
5019struct cmng_init_input {
5020 u32 port_rate;
5021 u16 vnic_min_rate[4];
5022 u16 vnic_max_rate[4];
5023 u16 cos_min_rate[MAX_COS_NUMBER];
5024 u16 cos_to_pause_mask[MAX_COS_NUMBER];
5025 struct cmng_flags_per_port flags;
5026};
5027
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005028
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005029/*
5030 * Protocol-common command ID for slow path elements
5031 */
5032enum common_spqe_cmd_id {
5033 RAMROD_CMD_ID_COMMON_UNUSED,
5034 RAMROD_CMD_ID_COMMON_FUNCTION_START,
5035 RAMROD_CMD_ID_COMMON_FUNCTION_STOP,
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00005036 RAMROD_CMD_ID_COMMON_FUNCTION_UPDATE,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005037 RAMROD_CMD_ID_COMMON_CFC_DEL,
5038 RAMROD_CMD_ID_COMMON_CFC_DEL_WB,
5039 RAMROD_CMD_ID_COMMON_STAT_QUERY,
5040 RAMROD_CMD_ID_COMMON_STOP_TRAFFIC,
5041 RAMROD_CMD_ID_COMMON_START_TRAFFIC,
Barak Witkowskia3348722012-04-23 03:04:46 +00005042 RAMROD_CMD_ID_COMMON_AFEX_VIF_LISTS,
Dmitry Kravkov91226792013-03-11 05:17:52 +00005043 RAMROD_CMD_ID_COMMON_SET_TIMESYNC,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005044 MAX_COMMON_SPQE_CMD_ID
5045};
5046
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005047/*
5048 * Per-protocol connection types
5049 */
5050enum connection_type {
5051 ETH_CONNECTION_TYPE,
5052 TOE_CONNECTION_TYPE,
5053 RDMA_CONNECTION_TYPE,
5054 ISCSI_CONNECTION_TYPE,
5055 FCOE_CONNECTION_TYPE,
5056 RESERVED_CONNECTION_TYPE_0,
5057 RESERVED_CONNECTION_TYPE_1,
5058 RESERVED_CONNECTION_TYPE_2,
5059 NONE_CONNECTION_TYPE,
5060 MAX_CONNECTION_TYPE
5061};
5062
5063
5064/*
5065 * Cos modes
5066 */
5067enum cos_mode {
5068 OVERRIDE_COS,
5069 STATIC_COS,
5070 FW_WRR,
5071 MAX_COS_MODE
5072};
5073
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005074
5075/*
5076 * Dynamic HC counters set by the driver
5077 */
5078struct hc_dynamic_drv_counter {
5079 u32 val[HC_SB_MAX_DYNAMIC_INDICES];
5080};
5081
5082/*
5083 * zone A per-queue data
5084 */
5085struct cstorm_queue_zone_data {
5086 struct hc_dynamic_drv_counter hc_dyn_drv_cnt;
5087 struct regpair reserved[2];
5088};
5089
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005090
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005091/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005092 * Vf-PF channel data in cstorm ram (non-triggered zone)
Eilon Greensteinca003922009-08-12 22:53:28 -07005093 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005094struct vf_pf_channel_zone_data {
5095 u32 msg_addr_lo;
5096 u32 msg_addr_hi;
5097};
5098
5099/*
5100 * zone for VF non-triggered data
5101 */
5102struct non_trigger_vf_zone {
5103 struct vf_pf_channel_zone_data vf_pf_channel;
5104};
5105
5106/*
5107 * Vf-PF channel trigger zone in cstorm ram
5108 */
5109struct vf_pf_channel_zone_trigger {
5110 u8 addr_valid;
5111};
5112
5113/*
5114 * zone that triggers the in-bound interrupt
5115 */
5116struct trigger_vf_zone {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005117 struct vf_pf_channel_zone_trigger vf_pf_channel;
5118 u8 reserved0;
5119 u16 reserved1;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005120 u32 reserved2;
5121};
5122
5123/*
5124 * zone B per-VF data
5125 */
5126struct cstorm_vf_zone_data {
5127 struct non_trigger_vf_zone non_trigger;
5128 struct trigger_vf_zone trigger;
5129};
5130
5131
5132/*
5133 * Dynamic host coalescing init parameters, per state machine
5134 */
5135struct dynamic_hc_sm_config {
Eilon Greensteinca003922009-08-12 22:53:28 -07005136 u32 threshold[3];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005137 u8 shift_per_protocol[HC_SB_MAX_DYNAMIC_INDICES];
5138 u8 hc_timeout0[HC_SB_MAX_DYNAMIC_INDICES];
5139 u8 hc_timeout1[HC_SB_MAX_DYNAMIC_INDICES];
5140 u8 hc_timeout2[HC_SB_MAX_DYNAMIC_INDICES];
5141 u8 hc_timeout3[HC_SB_MAX_DYNAMIC_INDICES];
Eilon Greensteinca003922009-08-12 22:53:28 -07005142};
5143
Eilon Greensteinca003922009-08-12 22:53:28 -07005144/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005145 * Dynamic host coalescing init parameters
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005146 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005147struct dynamic_hc_config {
5148 struct dynamic_hc_sm_config sm_config[HC_SB_MAX_SM];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005149};
5150
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07005151
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005152struct e2_integ_data {
5153#if defined(__BIG_ENDIAN)
5154 u8 flags;
5155#define E2_INTEG_DATA_TESTING_EN (0x1<<0)
5156#define E2_INTEG_DATA_TESTING_EN_SHIFT 0
5157#define E2_INTEG_DATA_LB_TX (0x1<<1)
5158#define E2_INTEG_DATA_LB_TX_SHIFT 1
5159#define E2_INTEG_DATA_COS_TX (0x1<<2)
5160#define E2_INTEG_DATA_COS_TX_SHIFT 2
5161#define E2_INTEG_DATA_OPPORTUNISTICQM (0x1<<3)
5162#define E2_INTEG_DATA_OPPORTUNISTICQM_SHIFT 3
5163#define E2_INTEG_DATA_DPMTESTRELEASEDQ (0x1<<4)
5164#define E2_INTEG_DATA_DPMTESTRELEASEDQ_SHIFT 4
5165#define E2_INTEG_DATA_RESERVED (0x7<<5)
5166#define E2_INTEG_DATA_RESERVED_SHIFT 5
5167 u8 cos;
5168 u8 voq;
5169 u8 pbf_queue;
5170#elif defined(__LITTLE_ENDIAN)
5171 u8 pbf_queue;
5172 u8 voq;
5173 u8 cos;
5174 u8 flags;
5175#define E2_INTEG_DATA_TESTING_EN (0x1<<0)
5176#define E2_INTEG_DATA_TESTING_EN_SHIFT 0
5177#define E2_INTEG_DATA_LB_TX (0x1<<1)
5178#define E2_INTEG_DATA_LB_TX_SHIFT 1
5179#define E2_INTEG_DATA_COS_TX (0x1<<2)
5180#define E2_INTEG_DATA_COS_TX_SHIFT 2
5181#define E2_INTEG_DATA_OPPORTUNISTICQM (0x1<<3)
5182#define E2_INTEG_DATA_OPPORTUNISTICQM_SHIFT 3
5183#define E2_INTEG_DATA_DPMTESTRELEASEDQ (0x1<<4)
5184#define E2_INTEG_DATA_DPMTESTRELEASEDQ_SHIFT 4
5185#define E2_INTEG_DATA_RESERVED (0x7<<5)
5186#define E2_INTEG_DATA_RESERVED_SHIFT 5
5187#endif
5188#if defined(__BIG_ENDIAN)
5189 u16 reserved3;
5190 u8 reserved2;
5191 u8 ramEn;
5192#elif defined(__LITTLE_ENDIAN)
5193 u8 ramEn;
5194 u8 reserved2;
5195 u16 reserved3;
5196#endif
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005197};
5198
5199
5200/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005201 * set mac event data
5202 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005203struct eth_event_data {
Michal Schmidt9cd753a2016-03-02 13:47:05 +01005204 __le32 echo;
5205 __le32 reserved0;
5206 __le32 reserved1;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005207};
5208
5209
5210/*
5211 * pf-vf event data
5212 */
5213struct vf_pf_event_data {
5214 u8 vf_id;
5215 u8 reserved0;
Michal Schmidta524ef72016-03-02 13:47:07 +01005216 __le16 reserved1;
5217 __le32 msg_addr_lo;
5218 __le32 msg_addr_hi;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005219};
5220
5221/*
5222 * VF FLR event data
5223 */
5224struct vf_flr_event_data {
5225 u8 vf_id;
5226 u8 reserved0;
5227 u16 reserved1;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005228 u32 reserved2;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005229 u32 reserved3;
5230};
5231
5232/*
5233 * malicious VF event data
5234 */
5235struct malicious_vf_event_data {
5236 u8 vf_id;
Dmitry Kravkov91226792013-03-11 05:17:52 +00005237 u8 err_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005238 u16 reserved1;
5239 u32 reserved2;
5240 u32 reserved3;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005241};
5242
5243/*
Barak Witkowskia3348722012-04-23 03:04:46 +00005244 * vif list event data
5245 */
5246struct vif_list_event_data {
5247 u8 func_bit_map;
5248 u8 echo;
5249 __le16 reserved0;
5250 __le32 reserved1;
5251 __le32 reserved2;
5252};
5253
Merav Sicronbabc6722012-11-07 00:45:47 +00005254/* function update event data */
5255struct function_update_event_data {
5256 u8 echo;
5257 u8 reserved;
5258 __le16 reserved0;
5259 __le32 reserved1;
5260 __le32 reserved2;
5261};
5262
5263
5264/* union for all event ring message types */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005265union event_data {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005266 struct vf_pf_event_data vf_pf_event;
5267 struct eth_event_data eth_event;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005268 struct cfc_del_event_data cfc_del_event;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005269 struct vf_flr_event_data vf_flr_event;
5270 struct malicious_vf_event_data malicious_vf_event;
Barak Witkowskia3348722012-04-23 03:04:46 +00005271 struct vif_list_event_data vif_list_event;
Merav Sicronbabc6722012-11-07 00:45:47 +00005272 struct function_update_event_data function_update_event;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005273};
5274
5275
5276/*
5277 * per PF event ring data
5278 */
5279struct event_ring_data {
Yuval Mintz86564c32013-01-23 03:21:50 +00005280 struct regpair_native base_addr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005281#if defined(__BIG_ENDIAN)
5282 u8 index_id;
5283 u8 sb_id;
5284 u16 producer;
5285#elif defined(__LITTLE_ENDIAN)
5286 u16 producer;
5287 u8 sb_id;
5288 u8 index_id;
5289#endif
5290 u32 reserved0;
5291};
5292
5293
5294/*
5295 * event ring message element (each element is 128 bits)
5296 */
5297struct event_ring_msg {
5298 u8 opcode;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005299 u8 error;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005300 u16 reserved1;
5301 union event_data data;
5302};
5303
5304/*
5305 * event ring next page element (128 bits)
5306 */
5307struct event_ring_next {
5308 struct regpair addr;
5309 u32 reserved[2];
5310};
5311
5312/*
5313 * union for event ring element types (each element is 128 bits)
5314 */
5315union event_ring_elem {
5316 struct event_ring_msg message;
5317 struct event_ring_next next_page;
5318};
5319
5320
5321/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005322 * Common event ring opcodes
5323 */
5324enum event_ring_opcode {
5325 EVENT_RING_OPCODE_VF_PF_CHANNEL,
5326 EVENT_RING_OPCODE_FUNCTION_START,
5327 EVENT_RING_OPCODE_FUNCTION_STOP,
5328 EVENT_RING_OPCODE_CFC_DEL,
5329 EVENT_RING_OPCODE_CFC_DEL_WB,
5330 EVENT_RING_OPCODE_STAT_QUERY,
5331 EVENT_RING_OPCODE_STOP_TRAFFIC,
5332 EVENT_RING_OPCODE_START_TRAFFIC,
5333 EVENT_RING_OPCODE_VF_FLR,
5334 EVENT_RING_OPCODE_MALICIOUS_VF,
5335 EVENT_RING_OPCODE_FORWARD_SETUP,
5336 EVENT_RING_OPCODE_RSS_UPDATE_RULES,
Dmitry Kravkov621b4d62012-02-20 09:59:08 +00005337 EVENT_RING_OPCODE_FUNCTION_UPDATE,
Barak Witkowskia3348722012-04-23 03:04:46 +00005338 EVENT_RING_OPCODE_AFEX_VIF_LISTS,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005339 EVENT_RING_OPCODE_SET_MAC,
5340 EVENT_RING_OPCODE_CLASSIFICATION_RULES,
5341 EVENT_RING_OPCODE_FILTERS_RULES,
5342 EVENT_RING_OPCODE_MULTICAST_RULES,
Dmitry Kravkov91226792013-03-11 05:17:52 +00005343 EVENT_RING_OPCODE_SET_TIMESYNC,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005344 MAX_EVENT_RING_OPCODE
5345};
5346
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005347/*
5348 * Modes for fairness algorithm
5349 */
5350enum fairness_mode {
5351 FAIRNESS_COS_WRR_MODE,
5352 FAIRNESS_COS_ETS_MODE,
5353 MAX_FAIRNESS_MODE
5354};
5355
5356
5357/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005358 * Priority and cos
5359 */
5360struct priority_cos {
5361 u8 priority;
5362 u8 cos;
5363 __le16 reserved1;
5364};
5365
5366/*
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00005367 * The data for flow control configuration
5368 */
5369struct flow_control_configuration {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005370 struct priority_cos traffic_type_to_priority_cos[MAX_TRAFFIC_TYPES];
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00005371 u8 dcb_enabled;
5372 u8 dcb_version;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005373 u8 dont_add_pri_0_en;
5374 u8 reserved1;
5375 __le32 reserved2;
Yuval Mintz28311f82015-07-22 09:16:22 +03005376 u8 dcb_outer_pri[MAX_TRAFFIC_TYPES];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005377};
5378
5379
5380/*
5381 *
5382 */
5383struct function_start_data {
Yuval Mintz96bed4b2012-10-01 03:46:19 +00005384 u8 function_mode;
Dmitry Kravkov91226792013-03-11 05:17:52 +00005385 u8 allow_npar_tx_switching;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005386 __le16 sd_vlan_tag;
Barak Witkowskia3348722012-04-23 03:04:46 +00005387 __le16 vif_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005388 u8 path_id;
5389 u8 network_cos_mode;
Dmitry Kravkov91226792013-03-11 05:17:52 +00005390 u8 dmae_cmd_id;
Yuval Mintz28311f82015-07-22 09:16:22 +03005391 u8 no_added_tags;
5392 __le16 reserved0;
5393 __le32 reserved1;
5394 u8 inner_clss_vxlan;
5395 u8 inner_clss_l2gre;
5396 u8 inner_clss_l2geneve;
5397 u8 inner_rss;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03005398 __le16 vxlan_dst_port;
Yuval Mintz28311f82015-07-22 09:16:22 +03005399 __le16 geneve_dst_port;
5400 u8 sd_accept_mf_clss_fail;
5401 u8 sd_accept_mf_clss_fail_match_ethtype;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03005402 __le16 sd_accept_mf_clss_fail_ethtype;
5403 __le16 sd_vlan_eth_type;
5404 u8 sd_vlan_force_pri_flg;
5405 u8 sd_vlan_force_pri_val;
Yuval Mintz28311f82015-07-22 09:16:22 +03005406 u8 c2s_pri_tt_valid;
5407 u8 c2s_pri_default;
5408 u8 reserved2[6];
5409 struct c2s_pri_trans_table_entry c2s_pri_trans_table;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00005410};
5411
Barak Witkowskia3348722012-04-23 03:04:46 +00005412struct function_update_data {
5413 u8 vif_id_change_flg;
5414 u8 afex_default_vlan_change_flg;
5415 u8 allowed_priorities_change_flg;
5416 u8 network_cos_mode_change_flg;
5417 __le16 vif_id;
5418 __le16 afex_default_vlan;
5419 u8 allowed_priorities;
5420 u8 network_cos_mode;
Dmitry Kravkov91226792013-03-11 05:17:52 +00005421 u8 lb_mode_en_change_flg;
Barak Witkowskia3348722012-04-23 03:04:46 +00005422 u8 lb_mode_en;
Merav Sicronbabc6722012-11-07 00:45:47 +00005423 u8 tx_switch_suspend_change_flg;
5424 u8 tx_switch_suspend;
5425 u8 echo;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03005426 u8 update_tunn_cfg_flg;
Yuval Mintz28311f82015-07-22 09:16:22 +03005427 u8 inner_clss_vxlan;
5428 u8 inner_clss_l2gre;
5429 u8 inner_clss_l2geneve;
5430 u8 inner_rss;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03005431 __le16 vxlan_dst_port;
Yuval Mintz28311f82015-07-22 09:16:22 +03005432 __le16 geneve_dst_port;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03005433 u8 sd_vlan_force_pri_change_flg;
5434 u8 sd_vlan_force_pri_flg;
5435 u8 sd_vlan_force_pri_val;
5436 u8 sd_vlan_tag_change_flg;
5437 u8 sd_vlan_eth_type_change_flg;
Dmitry Kravkov91226792013-03-11 05:17:52 +00005438 u8 reserved1;
Dmitry Kravkove42780b2014-08-17 16:47:43 +03005439 __le16 sd_vlan_tag;
5440 __le16 sd_vlan_eth_type;
Yuval Mintz28311f82015-07-22 09:16:22 +03005441 __le16 reserved0;
5442 __le32 reserved2;
Barak Witkowskia3348722012-04-23 03:04:46 +00005443};
5444
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00005445/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005446 * FW version stored in the Xstorm RAM
5447 */
5448struct fw_version {
5449#if defined(__BIG_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08005450 u8 engineering;
5451 u8 revision;
5452 u8 minor;
5453 u8 major;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005454#elif defined(__LITTLE_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08005455 u8 major;
5456 u8 minor;
5457 u8 revision;
5458 u8 engineering;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005459#endif
5460 u32 flags;
5461#define FW_VERSION_OPTIMIZED (0x1<<0)
5462#define FW_VERSION_OPTIMIZED_SHIFT 0
5463#define FW_VERSION_BIG_ENDIEN (0x1<<1)
5464#define FW_VERSION_BIG_ENDIEN_SHIFT 1
Eilon Greenstein34f80b02008-06-23 20:33:01 -07005465#define FW_VERSION_CHIP_VERSION (0x3<<2)
5466#define FW_VERSION_CHIP_VERSION_SHIFT 2
5467#define __FW_VERSION_RESERVED (0xFFFFFFF<<4)
5468#define __FW_VERSION_RESERVED_SHIFT 4
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005469};
5470
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005471/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005472 * Dynamic Host-Coalescing - Driver(host) counters
5473 */
5474struct hc_dynamic_sb_drv_counters {
5475 u32 dynamic_hc_drv_counter[HC_SB_MAX_DYNAMIC_INDICES];
5476};
5477
5478
5479/*
5480 * 2 bytes. configuration/state parameters for a single protocol index
5481 */
5482struct hc_index_data {
5483#if defined(__BIG_ENDIAN)
5484 u8 flags;
5485#define HC_INDEX_DATA_SM_ID (0x1<<0)
5486#define HC_INDEX_DATA_SM_ID_SHIFT 0
5487#define HC_INDEX_DATA_HC_ENABLED (0x1<<1)
5488#define HC_INDEX_DATA_HC_ENABLED_SHIFT 1
5489#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2)
5490#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2
5491#define HC_INDEX_DATA_RESERVE (0x1F<<3)
5492#define HC_INDEX_DATA_RESERVE_SHIFT 3
5493 u8 timeout;
5494#elif defined(__LITTLE_ENDIAN)
5495 u8 timeout;
5496 u8 flags;
5497#define HC_INDEX_DATA_SM_ID (0x1<<0)
5498#define HC_INDEX_DATA_SM_ID_SHIFT 0
5499#define HC_INDEX_DATA_HC_ENABLED (0x1<<1)
5500#define HC_INDEX_DATA_HC_ENABLED_SHIFT 1
5501#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2)
5502#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2
5503#define HC_INDEX_DATA_RESERVE (0x1F<<3)
5504#define HC_INDEX_DATA_RESERVE_SHIFT 3
5505#endif
5506};
5507
5508
5509/*
5510 * HC state-machine
5511 */
5512struct hc_status_block_sm {
5513#if defined(__BIG_ENDIAN)
5514 u8 igu_seg_id;
5515 u8 igu_sb_id;
5516 u8 timer_value;
5517 u8 __flags;
5518#elif defined(__LITTLE_ENDIAN)
5519 u8 __flags;
5520 u8 timer_value;
5521 u8 igu_sb_id;
5522 u8 igu_seg_id;
5523#endif
5524 u32 time_to_expire;
5525};
5526
5527/*
5528 * hold PCI identification variables- used in various places in firmware
5529 */
5530struct pci_entity {
5531#if defined(__BIG_ENDIAN)
5532 u8 vf_valid;
5533 u8 vf_id;
5534 u8 vnic_id;
5535 u8 pf_id;
5536#elif defined(__LITTLE_ENDIAN)
5537 u8 pf_id;
5538 u8 vnic_id;
5539 u8 vf_id;
5540 u8 vf_valid;
5541#endif
5542};
5543
5544/*
5545 * The fast-path status block meta-data, common to all chips
5546 */
5547struct hc_sb_data {
Yuval Mintz86564c32013-01-23 03:21:50 +00005548 struct regpair_native host_sb_addr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005549 struct hc_status_block_sm state_machine[HC_SB_MAX_SM];
5550 struct pci_entity p_func;
5551#if defined(__BIG_ENDIAN)
5552 u8 rsrv0;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005553 u8 state;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005554 u8 dhc_qzone_id;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005555 u8 same_igu_sb_1b;
5556#elif defined(__LITTLE_ENDIAN)
5557 u8 same_igu_sb_1b;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005558 u8 dhc_qzone_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005559 u8 state;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005560 u8 rsrv0;
5561#endif
Yuval Mintz86564c32013-01-23 03:21:50 +00005562 struct regpair_native rsrv1[2];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005563};
5564
5565
5566/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005567 * Segment types for host coaslescing
5568 */
5569enum hc_segment {
5570 HC_REGULAR_SEGMENT,
5571 HC_DEFAULT_SEGMENT,
5572 MAX_HC_SEGMENT
5573};
5574
5575
5576/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005577 * The fast-path status block meta-data
5578 */
5579struct hc_sp_status_block_data {
Yuval Mintz86564c32013-01-23 03:21:50 +00005580 struct regpair_native host_sb_addr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005581#if defined(__BIG_ENDIAN)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005582 u8 rsrv1;
5583 u8 state;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005584 u8 igu_seg_id;
5585 u8 igu_sb_id;
5586#elif defined(__LITTLE_ENDIAN)
5587 u8 igu_sb_id;
5588 u8 igu_seg_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005589 u8 state;
5590 u8 rsrv1;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005591#endif
5592 struct pci_entity p_func;
5593};
5594
5595
5596/*
5597 * The fast-path status block meta-data
5598 */
5599struct hc_status_block_data_e1x {
5600 struct hc_index_data index_data[HC_SB_MAX_INDICES_E1X];
5601 struct hc_sb_data common;
5602};
5603
5604
5605/*
5606 * The fast-path status block meta-data
5607 */
5608struct hc_status_block_data_e2 {
5609 struct hc_index_data index_data[HC_SB_MAX_INDICES_E2];
5610 struct hc_sb_data common;
5611};
5612
5613
5614/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005615 * IGU block operartion modes (in Everest2)
5616 */
5617enum igu_mode {
5618 HC_IGU_BC_MODE,
5619 HC_IGU_NBC_MODE,
5620 MAX_IGU_MODE
5621};
5622
Yuval Mintz5e091e72015-11-22 15:01:29 +02005623/*
5624 * Inner Headers Classification Type
5625 */
5626enum inner_clss_type {
5627 INNER_CLSS_DISABLED,
5628 INNER_CLSS_USE_VLAN,
5629 INNER_CLSS_USE_VNI,
5630 MAX_INNER_CLSS_TYPE};
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005631
5632/*
5633 * IP versions
5634 */
5635enum ip_ver {
5636 IP_V4,
5637 IP_V6,
5638 MAX_IP_VER
5639};
5640
Dmitry Kravkov91226792013-03-11 05:17:52 +00005641/*
5642 * Malicious VF error ID
5643 */
5644enum malicious_vf_error_id {
Dmitry Kravkove42780b2014-08-17 16:47:43 +03005645 MALICIOUS_VF_NO_ERROR,
Dmitry Kravkov91226792013-03-11 05:17:52 +00005646 VF_PF_CHANNEL_NOT_READY,
5647 ETH_ILLEGAL_BD_LENGTHS,
5648 ETH_PACKET_TOO_SHORT,
5649 ETH_PAYLOAD_TOO_BIG,
5650 ETH_ILLEGAL_ETH_TYPE,
5651 ETH_ILLEGAL_LSO_HDR_LEN,
5652 ETH_TOO_MANY_BDS,
5653 ETH_ZERO_HDR_NBDS,
5654 ETH_START_BD_NOT_SET,
5655 ETH_ILLEGAL_PARSE_NBDS,
5656 ETH_IPV6_AND_CHECKSUM,
5657 ETH_VLAN_FLG_INCORRECT,
5658 ETH_ILLEGAL_LSO_MSS,
5659 ETH_TUNNEL_NOT_SUPPORTED,
5660 MAX_MALICIOUS_VF_ERROR_ID
5661};
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005662
5663/*
5664 * Multi-function modes
5665 */
5666enum mf_mode {
5667 SINGLE_FUNCTION,
5668 MULTI_FUNCTION_SD,
5669 MULTI_FUNCTION_SI,
Barak Witkowskia3348722012-04-23 03:04:46 +00005670 MULTI_FUNCTION_AFEX,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005671 MAX_MF_MODE
5672};
5673
5674/*
5675 * Protocol-common statistics collected by the Tstorm (per pf)
5676 */
5677struct tstorm_per_pf_stats {
5678 struct regpair rcv_error_bytes;
5679};
5680
5681/*
5682 *
5683 */
5684struct per_pf_stats {
5685 struct tstorm_per_pf_stats tstorm_pf_statistics;
5686};
5687
5688
5689/*
5690 * Protocol-common statistics collected by the Tstorm (per port)
5691 */
5692struct tstorm_per_port_stats {
5693 __le32 mac_discard;
5694 __le32 mac_filter_discard;
5695 __le32 brb_truncate_discard;
5696 __le32 mf_tag_discard;
5697 __le32 packet_drop;
5698 __le32 reserved;
5699};
5700
5701/*
5702 *
5703 */
5704struct per_port_stats {
5705 struct tstorm_per_port_stats tstorm_port_statistics;
5706};
5707
5708
5709/*
5710 * Protocol-common statistics collected by the Tstorm (per client)
5711 */
5712struct tstorm_per_queue_stats {
5713 struct regpair rcv_ucast_bytes;
5714 __le32 rcv_ucast_pkts;
5715 __le32 checksum_discard;
5716 struct regpair rcv_bcast_bytes;
5717 __le32 rcv_bcast_pkts;
5718 __le32 pkts_too_big_discard;
5719 struct regpair rcv_mcast_bytes;
5720 __le32 rcv_mcast_pkts;
5721 __le32 ttl0_discard;
5722 __le16 no_buff_discard;
5723 __le16 reserved0;
5724 __le32 reserved1;
5725};
5726
5727/*
5728 * Protocol-common statistics collected by the Ustorm (per client)
5729 */
5730struct ustorm_per_queue_stats {
5731 struct regpair ucast_no_buff_bytes;
5732 struct regpair mcast_no_buff_bytes;
5733 struct regpair bcast_no_buff_bytes;
5734 __le32 ucast_no_buff_pkts;
5735 __le32 mcast_no_buff_pkts;
5736 __le32 bcast_no_buff_pkts;
5737 __le32 coalesced_pkts;
5738 struct regpair coalesced_bytes;
5739 __le32 coalesced_events;
5740 __le32 coalesced_aborts;
5741};
5742
5743/*
5744 * Protocol-common statistics collected by the Xstorm (per client)
5745 */
5746struct xstorm_per_queue_stats {
5747 struct regpair ucast_bytes_sent;
5748 struct regpair mcast_bytes_sent;
5749 struct regpair bcast_bytes_sent;
5750 __le32 ucast_pkts_sent;
5751 __le32 mcast_pkts_sent;
5752 __le32 bcast_pkts_sent;
5753 __le32 error_drop_pkts;
5754};
5755
5756/*
5757 *
5758 */
5759struct per_queue_stats {
5760 struct tstorm_per_queue_stats tstorm_queue_statistics;
5761 struct ustorm_per_queue_stats ustorm_queue_statistics;
5762 struct xstorm_per_queue_stats xstorm_queue_statistics;
5763};
5764
5765
5766/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005767 * FW version stored in first line of pram
5768 */
5769struct pram_fw_version {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08005770 u8 major;
5771 u8 minor;
5772 u8 revision;
5773 u8 engineering;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005774 u8 flags;
5775#define PRAM_FW_VERSION_OPTIMIZED (0x1<<0)
5776#define PRAM_FW_VERSION_OPTIMIZED_SHIFT 0
5777#define PRAM_FW_VERSION_STORM_ID (0x3<<1)
5778#define PRAM_FW_VERSION_STORM_ID_SHIFT 1
5779#define PRAM_FW_VERSION_BIG_ENDIEN (0x1<<3)
5780#define PRAM_FW_VERSION_BIG_ENDIEN_SHIFT 3
Eilon Greenstein34f80b02008-06-23 20:33:01 -07005781#define PRAM_FW_VERSION_CHIP_VERSION (0x3<<4)
5782#define PRAM_FW_VERSION_CHIP_VERSION_SHIFT 4
5783#define __PRAM_FW_VERSION_RESERVED0 (0x3<<6)
5784#define __PRAM_FW_VERSION_RESERVED0_SHIFT 6
5785};
5786
5787
5788/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005789 * Ethernet slow path element
5790 */
5791union protocol_common_specific_data {
5792 u8 protocol_data[8];
5793 struct regpair phy_address;
5794 struct regpair mac_config_addr;
Barak Witkowskia3348722012-04-23 03:04:46 +00005795 struct afex_vif_list_ramrod_data afex_vif_list_data;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005796};
5797
5798/*
Eilon Greensteinca003922009-08-12 22:53:28 -07005799 * The send queue element
5800 */
5801struct protocol_common_spe {
5802 struct spe_hdr hdr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005803 union protocol_common_specific_data data;
Eilon Greensteinca003922009-08-12 22:53:28 -07005804};
5805
Michal Kalderoneeed0182014-08-17 16:47:44 +03005806/* The data for the Set Timesync Ramrod */
5807struct set_timesync_ramrod_data {
5808 u8 drift_adjust_cmd;
5809 u8 offset_cmd;
5810 u8 add_sub_drift_adjust_value;
5811 u8 drift_adjust_value;
5812 u32 drift_adjust_period;
5813 struct regpair offset_delta;
5814};
5815
Eilon Greensteinca003922009-08-12 22:53:28 -07005816/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005817 * The send queue element
5818 */
5819struct slow_path_element {
5820 struct spe_hdr hdr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005821 struct regpair protocol_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005822};
5823
5824
5825/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005826 * Protocol-common statistics counter
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005827 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005828struct stats_counter {
5829 __le16 xstats_counter;
5830 __le16 reserved0;
5831 __le32 reserved1;
5832 __le16 tstats_counter;
5833 __le16 reserved2;
5834 __le32 reserved3;
5835 __le16 ustats_counter;
5836 __le16 reserved4;
5837 __le32 reserved5;
5838 __le16 cstats_counter;
5839 __le16 reserved6;
5840 __le32 reserved7;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02005841};
5842
5843
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005844/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005845 *
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005846 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005847struct stats_query_entry {
5848 u8 kind;
5849 u8 index;
5850 __le16 funcID;
5851 __le32 reserved;
5852 struct regpair address;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005853};
5854
5855/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005856 * statistic command
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005857 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005858struct stats_query_cmd_group {
5859 struct stats_query_entry query[STATS_QUERY_CMD_COUNT];
5860};
5861
5862
5863/*
5864 * statistic command header
5865 */
5866struct stats_query_header {
5867 u8 cmd_num;
5868 u8 reserved0;
5869 __le16 drv_stats_counter;
5870 __le32 reserved1;
5871 struct regpair stats_counters_addrs;
5872};
5873
5874
5875/*
5876 * Types of statistcis query entry
5877 */
5878enum stats_query_type {
5879 STATS_TYPE_QUEUE,
5880 STATS_TYPE_PORT,
5881 STATS_TYPE_PF,
5882 STATS_TYPE_TOE,
5883 STATS_TYPE_FCOE,
5884 MAX_STATS_QUERY_TYPE
5885};
5886
5887
5888/*
5889 * Indicate of the function status block state
5890 */
5891enum status_block_state {
5892 SB_DISABLED,
5893 SB_ENABLED,
5894 SB_CLEANED,
5895 MAX_STATUS_BLOCK_STATE
5896};
5897
5898
5899/*
5900 * Storm IDs (including attentions for IGU related enums)
5901 */
5902enum storm_id {
5903 USTORM_ID,
5904 CSTORM_ID,
5905 XSTORM_ID,
5906 TSTORM_ID,
5907 ATTENTION_ID,
5908 MAX_STORM_ID
5909};
5910
5911
5912/*
5913 * Taffic types used in ETS and flow control algorithms
5914 */
5915enum traffic_type {
5916 LLFC_TRAFFIC_TYPE_NW,
5917 LLFC_TRAFFIC_TYPE_FCOE,
5918 LLFC_TRAFFIC_TYPE_ISCSI,
5919 MAX_TRAFFIC_TYPE
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005920};
5921
5922
5923/*
5924 * zone A per-queue data
5925 */
5926struct tstorm_queue_zone_data {
5927 struct regpair reserved[4];
5928};
5929
5930
5931/*
5932 * zone B per-VF data
5933 */
5934struct tstorm_vf_zone_data {
5935 struct regpair reserved;
5936};
5937
Michal Kalderoneeed0182014-08-17 16:47:44 +03005938/* Add or Subtract Value for Set Timesync Ramrod */
5939enum ts_add_sub_value {
5940 TS_SUB_VALUE,
5941 TS_ADD_VALUE,
5942 MAX_TS_ADD_SUB_VALUE
5943};
5944
5945/* Drift-Adjust Commands for Set Timesync Ramrod */
5946enum ts_drift_adjust_cmd {
5947 TS_DRIFT_ADJUST_KEEP,
5948 TS_DRIFT_ADJUST_SET,
5949 TS_DRIFT_ADJUST_RESET,
5950 MAX_TS_DRIFT_ADJUST_CMD
5951};
5952
5953/* Offset Commands for Set Timesync Ramrod */
5954enum ts_offset_cmd {
5955 TS_OFFSET_KEEP,
5956 TS_OFFSET_INC,
5957 TS_OFFSET_DEC,
5958 MAX_TS_OFFSET_CMD
5959};
5960
Dmitry Kravkove42780b2014-08-17 16:47:43 +03005961 /* zone A per-queue data */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005962struct ustorm_queue_zone_data {
5963 struct ustorm_eth_rx_producers eth_rx_producers;
5964 struct regpair reserved[3];
5965};
5966
5967
5968/*
5969 * zone B per-VF data
5970 */
5971struct ustorm_vf_zone_data {
5972 struct regpair reserved;
5973};
5974
5975
5976/*
5977 * data per VF-PF channel
5978 */
5979struct vf_pf_channel_data {
5980#if defined(__BIG_ENDIAN)
5981 u16 reserved0;
5982 u8 valid;
5983 u8 state;
5984#elif defined(__LITTLE_ENDIAN)
5985 u8 state;
5986 u8 valid;
5987 u16 reserved0;
5988#endif
5989 u32 reserved1;
5990};
5991
5992
5993/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005994 * State of VF-PF channel
5995 */
5996enum vf_pf_channel_state {
5997 VF_PF_CHANNEL_STATE_READY,
5998 VF_PF_CHANNEL_STATE_WAITING_FOR_ACK,
5999 MAX_VF_PF_CHANNEL_STATE
6000};
6001
6002
6003/*
Barak Witkowskia3348722012-04-23 03:04:46 +00006004 * vif_list_rule_kind
6005 */
6006enum vif_list_rule_kind {
6007 VIF_LIST_RULE_SET,
6008 VIF_LIST_RULE_GET,
6009 VIF_LIST_RULE_CLEAR_ALL,
6010 VIF_LIST_RULE_CLEAR_FUNC,
6011 MAX_VIF_LIST_RULE_KIND
6012};
6013
6014
6015/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00006016 * zone A per-queue data
6017 */
6018struct xstorm_queue_zone_data {
6019 struct regpair reserved[4];
6020};
6021
6022
6023/*
6024 * zone B per-VF data
6025 */
6026struct xstorm_vf_zone_data {
6027 struct regpair reserved;
6028};
6029
6030#endif /* BNX2X_HSI_H */