blob: 51d69db23a715da6fbee1a624e9d3a34f5c743dd [file] [log] [blame]
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001/* bnx2x_hsi.h: Broadcom Everest network driver.
2 *
Vladislav Zolotarov3359fce2010-02-17 13:35:01 -08003 * Copyright (c) 2007-2010 Broadcom Corporation
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation.
8 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00009#ifndef BNX2X_HSI_H
10#define BNX2X_HSI_H
11
12#include "bnx2x_fw_defs.h"
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020013
Michael Chane2513062009-10-10 13:46:58 +000014struct license_key {
15 u32 reserved[6];
16
17#if defined(__BIG_ENDIAN)
18 u16 max_iscsi_init_conn;
19 u16 max_iscsi_trgt_conn;
20#elif defined(__LITTLE_ENDIAN)
21 u16 max_iscsi_trgt_conn;
22 u16 max_iscsi_init_conn;
23#endif
24
25 u32 reserved_a[6];
26};
27
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020028
Eliezer Tamirf1410642008-02-28 11:51:50 -080029#define PORT_0 0
30#define PORT_1 1
31#define PORT_MAX 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020032
33/****************************************************************************
34 * Shared HW configuration *
35 ****************************************************************************/
36struct shared_hw_cfg { /* NVRAM Offset */
37 /* Up to 16 bytes of NULL-terminated string */
38 u8 part_num[16]; /* 0x104 */
39
40 u32 config; /* 0x114 */
41#define SHARED_HW_CFG_MDIO_VOLTAGE_MASK 0x00000001
42#define SHARED_HW_CFG_MDIO_VOLTAGE_SHIFT 0
43#define SHARED_HW_CFG_MDIO_VOLTAGE_1_2V 0x00000000
44#define SHARED_HW_CFG_MDIO_VOLTAGE_2_5V 0x00000001
45#define SHARED_HW_CFG_MCP_RST_ON_CORE_RST_EN 0x00000002
46
47#define SHARED_HW_CFG_PORT_SWAP 0x00000004
48
49#define SHARED_HW_CFG_BEACON_WOL_EN 0x00000008
50
51#define SHARED_HW_CFG_MFW_SELECT_MASK 0x00000700
52#define SHARED_HW_CFG_MFW_SELECT_SHIFT 8
53 /* Whatever MFW found in NVM
54 (if multiple found, priority order is: NC-SI, UMP, IPMI) */
55#define SHARED_HW_CFG_MFW_SELECT_DEFAULT 0x00000000
56#define SHARED_HW_CFG_MFW_SELECT_NC_SI 0x00000100
57#define SHARED_HW_CFG_MFW_SELECT_UMP 0x00000200
58#define SHARED_HW_CFG_MFW_SELECT_IPMI 0x00000300
59 /* Use SPIO4 as an arbiter between: 0-NC_SI, 1-IPMI
60 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
61#define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_IPMI 0x00000400
62 /* Use SPIO4 as an arbiter between: 0-UMP, 1-IPMI
63 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
64#define SHARED_HW_CFG_MFW_SELECT_SPIO4_UMP_IPMI 0x00000500
65 /* Use SPIO4 as an arbiter between: 0-NC-SI, 1-UMP
66 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
67#define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_UMP 0x00000600
68
69#define SHARED_HW_CFG_LED_MODE_MASK 0x000f0000
70#define SHARED_HW_CFG_LED_MODE_SHIFT 16
71#define SHARED_HW_CFG_LED_MAC1 0x00000000
72#define SHARED_HW_CFG_LED_PHY1 0x00010000
73#define SHARED_HW_CFG_LED_PHY2 0x00020000
74#define SHARED_HW_CFG_LED_PHY3 0x00030000
75#define SHARED_HW_CFG_LED_MAC2 0x00040000
76#define SHARED_HW_CFG_LED_PHY4 0x00050000
77#define SHARED_HW_CFG_LED_PHY5 0x00060000
78#define SHARED_HW_CFG_LED_PHY6 0x00070000
79#define SHARED_HW_CFG_LED_MAC3 0x00080000
80#define SHARED_HW_CFG_LED_PHY7 0x00090000
81#define SHARED_HW_CFG_LED_PHY9 0x000a0000
82#define SHARED_HW_CFG_LED_PHY11 0x000b0000
83#define SHARED_HW_CFG_LED_MAC4 0x000c0000
84#define SHARED_HW_CFG_LED_PHY8 0x000d0000
Yaniv Rosner7f02c4a2010-09-07 11:41:23 +000085#define SHARED_HW_CFG_LED_EXTPHY1 0x000e0000
86
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020087
88#define SHARED_HW_CFG_AN_ENABLE_MASK 0x3f000000
89#define SHARED_HW_CFG_AN_ENABLE_SHIFT 24
90#define SHARED_HW_CFG_AN_ENABLE_CL37 0x01000000
91#define SHARED_HW_CFG_AN_ENABLE_CL73 0x02000000
92#define SHARED_HW_CFG_AN_ENABLE_BAM 0x04000000
93#define SHARED_HW_CFG_AN_ENABLE_PARALLEL_DETECTION 0x08000000
94#define SHARED_HW_CFG_AN_EN_SGMII_FIBER_AUTO_DETECT 0x10000000
95#define SHARED_HW_CFG_AN_ENABLE_REMOTE_PHY 0x20000000
96
97 u32 config2; /* 0x118 */
98 /* one time auto detect grace period (in sec) */
99#define SHARED_HW_CFG_GRACE_PERIOD_MASK 0x000000ff
100#define SHARED_HW_CFG_GRACE_PERIOD_SHIFT 0
101
102#define SHARED_HW_CFG_PCIE_GEN2_ENABLED 0x00000100
103
104 /* The default value for the core clock is 250MHz and it is
105 achieved by setting the clock change to 4 */
106#define SHARED_HW_CFG_CLOCK_CHANGE_MASK 0x00000e00
107#define SHARED_HW_CFG_CLOCK_CHANGE_SHIFT 9
108
109#define SHARED_HW_CFG_SMBUS_TIMING_100KHZ 0x00000000
110#define SHARED_HW_CFG_SMBUS_TIMING_400KHZ 0x00001000
111
Eliezer Tamirf1410642008-02-28 11:51:50 -0800112#define SHARED_HW_CFG_HIDE_PORT1 0x00002000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200113
Eilon Greensteinfd4ef402009-07-21 05:47:27 +0000114 /* The fan failure mechanism is usually related to the PHY type
115 since the power consumption of the board is determined by the PHY.
116 Currently, fan is required for most designs with SFX7101, BCM8727
117 and BCM8481. If a fan is not required for a board which uses one
118 of those PHYs, this field should be set to "Disabled". If a fan is
119 required for a different PHY type, this option should be set to
120 "Enabled".
121 The fan failure indication is expected on
122 SPIO5 */
123#define SHARED_HW_CFG_FAN_FAILURE_MASK 0x00180000
124#define SHARED_HW_CFG_FAN_FAILURE_SHIFT 19
125#define SHARED_HW_CFG_FAN_FAILURE_PHY_TYPE 0x00000000
126#define SHARED_HW_CFG_FAN_FAILURE_DISABLED 0x00080000
127#define SHARED_HW_CFG_FAN_FAILURE_ENABLED 0x00100000
128
Yaniv Rosnere10bc842010-09-07 11:40:50 +0000129 /* Set the MDC/MDIO access for the first external phy */
130#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_MASK 0x1C000000
131#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SHIFT 26
132#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_PHY_TYPE 0x00000000
133#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC0 0x04000000
134#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC1 0x08000000
135#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_BOTH 0x0c000000
136#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SWAPPED 0x10000000
137
138 /* Set the MDC/MDIO access for the second external phy */
139#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_MASK 0xE0000000
140#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SHIFT 29
141#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_PHY_TYPE 0x00000000
142#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC0 0x20000000
143#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC1 0x40000000
144#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_BOTH 0x60000000
145#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SWAPPED 0x80000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200146 u32 power_dissipated; /* 0x11c */
147#define SHARED_HW_CFG_POWER_DIS_CMN_MASK 0xff000000
148#define SHARED_HW_CFG_POWER_DIS_CMN_SHIFT 24
149
150#define SHARED_HW_CFG_POWER_MGNT_SCALE_MASK 0x00ff0000
151#define SHARED_HW_CFG_POWER_MGNT_SCALE_SHIFT 16
152#define SHARED_HW_CFG_POWER_MGNT_UNKNOWN_SCALE 0x00000000
153#define SHARED_HW_CFG_POWER_MGNT_DOT_1_WATT 0x00010000
154#define SHARED_HW_CFG_POWER_MGNT_DOT_01_WATT 0x00020000
155#define SHARED_HW_CFG_POWER_MGNT_DOT_001_WATT 0x00030000
156
157 u32 ump_nc_si_config; /* 0x120 */
158#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MASK 0x00000003
159#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_SHIFT 0
160#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MAC 0x00000000
161#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_PHY 0x00000001
162#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MII 0x00000000
163#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_RMII 0x00000002
164
165#define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_MASK 0x00000f00
166#define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_SHIFT 8
167
168#define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_MASK 0x00ff0000
169#define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_SHIFT 16
170#define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_NONE 0x00000000
171#define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_BCM5221 0x00010000
172
173 u32 board; /* 0x124 */
Eilon Greenstein35b19ba2009-02-12 08:36:47 +0000174#define SHARED_HW_CFG_BOARD_REV_MASK 0x00FF0000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200175#define SHARED_HW_CFG_BOARD_REV_SHIFT 16
176
Eilon Greenstein35b19ba2009-02-12 08:36:47 +0000177#define SHARED_HW_CFG_BOARD_MAJOR_VER_MASK 0x0F000000
178#define SHARED_HW_CFG_BOARD_MAJOR_VER_SHIFT 24
179
180#define SHARED_HW_CFG_BOARD_MINOR_VER_MASK 0xF0000000
181#define SHARED_HW_CFG_BOARD_MINOR_VER_SHIFT 28
182
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200183 u32 reserved; /* 0x128 */
184
185};
186
Eliezer Tamirf1410642008-02-28 11:51:50 -0800187
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200188/****************************************************************************
189 * Port HW configuration *
190 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -0800191struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200192
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200193 u32 pci_id;
194#define PORT_HW_CFG_PCI_VENDOR_ID_MASK 0xffff0000
195#define PORT_HW_CFG_PCI_DEVICE_ID_MASK 0x0000ffff
196
197 u32 pci_sub_id;
198#define PORT_HW_CFG_PCI_SUBSYS_DEVICE_ID_MASK 0xffff0000
199#define PORT_HW_CFG_PCI_SUBSYS_VENDOR_ID_MASK 0x0000ffff
200
201 u32 power_dissipated;
202#define PORT_HW_CFG_POWER_DIS_D3_MASK 0xff000000
203#define PORT_HW_CFG_POWER_DIS_D3_SHIFT 24
204#define PORT_HW_CFG_POWER_DIS_D2_MASK 0x00ff0000
205#define PORT_HW_CFG_POWER_DIS_D2_SHIFT 16
206#define PORT_HW_CFG_POWER_DIS_D1_MASK 0x0000ff00
207#define PORT_HW_CFG_POWER_DIS_D1_SHIFT 8
208#define PORT_HW_CFG_POWER_DIS_D0_MASK 0x000000ff
209#define PORT_HW_CFG_POWER_DIS_D0_SHIFT 0
210
211 u32 power_consumed;
212#define PORT_HW_CFG_POWER_CONS_D3_MASK 0xff000000
213#define PORT_HW_CFG_POWER_CONS_D3_SHIFT 24
214#define PORT_HW_CFG_POWER_CONS_D2_MASK 0x00ff0000
215#define PORT_HW_CFG_POWER_CONS_D2_SHIFT 16
216#define PORT_HW_CFG_POWER_CONS_D1_MASK 0x0000ff00
217#define PORT_HW_CFG_POWER_CONS_D1_SHIFT 8
218#define PORT_HW_CFG_POWER_CONS_D0_MASK 0x000000ff
219#define PORT_HW_CFG_POWER_CONS_D0_SHIFT 0
220
221 u32 mac_upper;
222#define PORT_HW_CFG_UPPERMAC_MASK 0x0000ffff
223#define PORT_HW_CFG_UPPERMAC_SHIFT 0
224 u32 mac_lower;
225
226 u32 iscsi_mac_upper; /* Upper 16 bits are always zeroes */
227 u32 iscsi_mac_lower;
228
229 u32 rdma_mac_upper; /* Upper 16 bits are always zeroes */
230 u32 rdma_mac_lower;
231
232 u32 serdes_config;
Eilon Greensteinc2c8b032009-02-12 08:37:14 +0000233#define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_MASK 0x0000FFFF
234#define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200235
Eilon Greensteinc2c8b032009-02-12 08:37:14 +0000236#define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_MASK 0xFFFF0000
237#define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_SHIFT 16
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200238
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200239
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000240 u32 Reserved0[3]; /* 0x158 */
241 /* Controls the TX laser of the SFP+ module */
242 u32 sfp_ctrl; /* 0x164 */
243#define PORT_HW_CFG_TX_LASER_MASK 0x000000FF
244#define PORT_HW_CFG_TX_LASER_SHIFT 0
245#define PORT_HW_CFG_TX_LASER_MDIO 0x00000000
246#define PORT_HW_CFG_TX_LASER_GPIO0 0x00000001
247#define PORT_HW_CFG_TX_LASER_GPIO1 0x00000002
248#define PORT_HW_CFG_TX_LASER_GPIO2 0x00000003
249#define PORT_HW_CFG_TX_LASER_GPIO3 0x00000004
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200250
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000251 /* Controls the fault module LED of the SFP+ */
252#define PORT_HW_CFG_FAULT_MODULE_LED_MASK 0x0000FF00
253#define PORT_HW_CFG_FAULT_MODULE_LED_SHIFT 8
254#define PORT_HW_CFG_FAULT_MODULE_LED_GPIO0 0x00000000
255#define PORT_HW_CFG_FAULT_MODULE_LED_GPIO1 0x00000100
256#define PORT_HW_CFG_FAULT_MODULE_LED_GPIO2 0x00000200
257#define PORT_HW_CFG_FAULT_MODULE_LED_GPIO3 0x00000300
258#define PORT_HW_CFG_FAULT_MODULE_LED_DISABLED 0x00000400
259 u32 Reserved01[12]; /* 0x158 */
Eilon Greensteinc2c8b032009-02-12 08:37:14 +0000260 /* for external PHY, or forced mode or during AN */
261 u16 xgxs_config_rx[4]; /* 0x198 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200262
Eilon Greensteinc2c8b032009-02-12 08:37:14 +0000263 u16 xgxs_config_tx[4]; /* 0x1A0 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200264
Yaniv Rosner121839b2010-11-01 05:32:38 +0000265 u32 Reserved1[56]; /* 0x1A8 */
266 u32 default_cfg; /* 0x288 */
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000267#define PORT_HW_CFG_GPIO0_CONFIG_MASK 0x00000003
268#define PORT_HW_CFG_GPIO0_CONFIG_SHIFT 0
269#define PORT_HW_CFG_GPIO0_CONFIG_NA 0x00000000
270#define PORT_HW_CFG_GPIO0_CONFIG_LOW 0x00000001
271#define PORT_HW_CFG_GPIO0_CONFIG_HIGH 0x00000002
272#define PORT_HW_CFG_GPIO0_CONFIG_INPUT 0x00000003
273
274#define PORT_HW_CFG_GPIO1_CONFIG_MASK 0x0000000C
275#define PORT_HW_CFG_GPIO1_CONFIG_SHIFT 2
276#define PORT_HW_CFG_GPIO1_CONFIG_NA 0x00000000
277#define PORT_HW_CFG_GPIO1_CONFIG_LOW 0x00000004
278#define PORT_HW_CFG_GPIO1_CONFIG_HIGH 0x00000008
279#define PORT_HW_CFG_GPIO1_CONFIG_INPUT 0x0000000c
280
281#define PORT_HW_CFG_GPIO2_CONFIG_MASK 0x00000030
282#define PORT_HW_CFG_GPIO2_CONFIG_SHIFT 4
283#define PORT_HW_CFG_GPIO2_CONFIG_NA 0x00000000
284#define PORT_HW_CFG_GPIO2_CONFIG_LOW 0x00000010
285#define PORT_HW_CFG_GPIO2_CONFIG_HIGH 0x00000020
286#define PORT_HW_CFG_GPIO2_CONFIG_INPUT 0x00000030
287
288#define PORT_HW_CFG_GPIO3_CONFIG_MASK 0x000000C0
289#define PORT_HW_CFG_GPIO3_CONFIG_SHIFT 6
290#define PORT_HW_CFG_GPIO3_CONFIG_NA 0x00000000
291#define PORT_HW_CFG_GPIO3_CONFIG_LOW 0x00000040
292#define PORT_HW_CFG_GPIO3_CONFIG_HIGH 0x00000080
293#define PORT_HW_CFG_GPIO3_CONFIG_INPUT 0x000000c0
294
295 /*
296 * When KR link is required to be set to force which is not
297 * KR-compliant, this parameter determine what is the trigger for it.
298 * When GPIO is selected, low input will force the speed. Currently
299 * default speed is 1G. In the future, it may be widen to select the
300 * forced speed in with another parameter. Note when force-1G is
301 * enabled, it override option 56: Link Speed option.
302 */
303#define PORT_HW_CFG_FORCE_KR_ENABLER_MASK 0x00000F00
304#define PORT_HW_CFG_FORCE_KR_ENABLER_SHIFT 8
305#define PORT_HW_CFG_FORCE_KR_ENABLER_NOT_FORCED 0x00000000
306#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P0 0x00000100
307#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P0 0x00000200
308#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P0 0x00000300
309#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P0 0x00000400
310#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P1 0x00000500
311#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P1 0x00000600
312#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P1 0x00000700
313#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P1 0x00000800
314#define PORT_HW_CFG_FORCE_KR_ENABLER_FORCED 0x00000900
315 /* Enable to determine with which GPIO to reset the external phy */
316#define PORT_HW_CFG_EXT_PHY_GPIO_RST_MASK 0x000F0000
317#define PORT_HW_CFG_EXT_PHY_GPIO_RST_SHIFT 16
318#define PORT_HW_CFG_EXT_PHY_GPIO_RST_PHY_TYPE 0x00000000
319#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P0 0x00010000
320#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P0 0x00020000
321#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P0 0x00030000
322#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P0 0x00040000
323#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P1 0x00050000
324#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P1 0x00060000
325#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P1 0x00070000
326#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P1 0x00080000
Yaniv Rosner121839b2010-11-01 05:32:38 +0000327 /* Enable BAM on KR */
328#define PORT_HW_CFG_ENABLE_BAM_ON_KR_MASK 0x00100000
329#define PORT_HW_CFG_ENABLE_BAM_ON_KR_SHIFT 20
330#define PORT_HW_CFG_ENABLE_BAM_ON_KR_DISABLED 0x00000000
331#define PORT_HW_CFG_ENABLE_BAM_ON_KR_ENABLED 0x00100000
332
Yaniv Rosner1bef68e2011-01-31 04:22:46 +0000333 /* Enable Common Mode Sense */
334#define PORT_HW_CFG_ENABLE_CMS_MASK 0x00200000
335#define PORT_HW_CFG_ENABLE_CMS_SHIFT 21
336#define PORT_HW_CFG_ENABLE_CMS_DISABLED 0x00000000
337#define PORT_HW_CFG_ENABLE_CMS_ENABLED 0x00200000
338
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000339 u32 speed_capability_mask2; /* 0x28C */
340#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_MASK 0x0000FFFF
341#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_SHIFT 0
342#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10M_FULL 0x00000001
343#define PORT_HW_CFG_SPEED_CAPABILITY2_D3__ 0x00000002
344#define PORT_HW_CFG_SPEED_CAPABILITY2_D3___ 0x00000004
345#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_100M_FULL 0x00000008
346#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_1G 0x00000010
347#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_2_DOT_5G 0x00000020
348#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10G 0x00000040
349#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_12G 0x00000080
350#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_12_DOT_5G 0x00000100
351#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_13G 0x00000200
352#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_15G 0x00000400
353#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_16G 0x00000800
354
355#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_MASK 0xFFFF0000
356#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_SHIFT 16
357#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10M_FULL 0x00010000
358#define PORT_HW_CFG_SPEED_CAPABILITY2_D0__ 0x00020000
359#define PORT_HW_CFG_SPEED_CAPABILITY2_D0___ 0x00040000
360#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_100M_FULL 0x00080000
361#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_1G 0x00100000
362#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_2_DOT_5G 0x00200000
363#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10G 0x00400000
364#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_12G 0x00800000
365#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_12_DOT_5G 0x01000000
366#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_13G 0x02000000
367#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_15G 0x04000000
368#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_16G 0x08000000
369
370 /* In the case where two media types (e.g. copper and fiber) are
371 present and electrically active at the same time, PHY Selection
372 will determine which of the two PHYs will be designated as the
373 Active PHY and used for a connection to the network. */
374 u32 multi_phy_config; /* 0x290 */
375#define PORT_HW_CFG_PHY_SELECTION_MASK 0x00000007
376#define PORT_HW_CFG_PHY_SELECTION_SHIFT 0
377#define PORT_HW_CFG_PHY_SELECTION_HARDWARE_DEFAULT 0x00000000
378#define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY 0x00000001
379#define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY 0x00000002
380#define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY 0x00000003
381#define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY_PRIORITY 0x00000004
382
383 /* When enabled, all second phy nvram parameters will be swapped
384 with the first phy parameters */
385#define PORT_HW_CFG_PHY_SWAPPED_MASK 0x00000008
386#define PORT_HW_CFG_PHY_SWAPPED_SHIFT 3
387#define PORT_HW_CFG_PHY_SWAPPED_DISABLED 0x00000000
388#define PORT_HW_CFG_PHY_SWAPPED_ENABLED 0x00000008
389
390
391 /* Address of the second external phy */
392 u32 external_phy_config2; /* 0x294 */
393#define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_MASK 0x000000FF
394#define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_SHIFT 0
395
396 /* The second XGXS external PHY type */
397#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_MASK 0x0000FF00
398#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SHIFT 8
399#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_DIRECT 0x00000000
400#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8071 0x00000100
401#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8072 0x00000200
402#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8073 0x00000300
403#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8705 0x00000400
404#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8706 0x00000500
405#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8726 0x00000600
406#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8481 0x00000700
407#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SFX7101 0x00000800
408#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727 0x00000900
409#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727_NOC 0x00000a00
410#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84823 0x00000b00
411#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54640 0x00000c00
412#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84833 0x00000d00
413#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_FAILURE 0x0000fd00
414#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_NOT_CONN 0x0000ff00
415
416 /* 4 times 16 bits for all 4 lanes. For some external PHYs (such as
417 8706, 8726 and 8727) not all 4 values are needed. */
418 u16 xgxs_config2_rx[4]; /* 0x296 */
419 u16 xgxs_config2_tx[4]; /* 0x2A0 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200420
421 u32 lane_config;
422#define PORT_HW_CFG_LANE_SWAP_CFG_MASK 0x0000ffff
423#define PORT_HW_CFG_LANE_SWAP_CFG_SHIFT 0
Dmitry Kravkov523224a2010-10-06 03:23:26 +0000424
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200425#define PORT_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000ff
426#define PORT_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0
427#define PORT_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000ff00
428#define PORT_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8
429#define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_MASK 0x0000c000
430#define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_SHIFT 14
431 /* AN and forced */
432#define PORT_HW_CFG_LANE_SWAP_CFG_01230123 0x00001b1b
433 /* forced only */
434#define PORT_HW_CFG_LANE_SWAP_CFG_01233210 0x00001be4
435 /* forced only */
436#define PORT_HW_CFG_LANE_SWAP_CFG_31203120 0x0000d8d8
437 /* forced only */
438#define PORT_HW_CFG_LANE_SWAP_CFG_32103210 0x0000e4e4
Yaniv Rosner74d7a112011-01-18 04:33:18 +0000439 /* Indicate whether to swap the external phy polarity */
440#define PORT_HW_CFG_SWAP_PHY_POLARITY_MASK 0x00010000
441#define PORT_HW_CFG_SWAP_PHY_POLARITY_DISABLED 0x00000000
442#define PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED 0x00010000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200443
444 u32 external_phy_config;
445#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK 0xff000000
446#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_SHIFT 24
447#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT 0x00000000
448#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_BCM5482 0x01000000
449#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_NOT_CONN 0xff000000
450
451#define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_MASK 0x00ff0000
452#define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_SHIFT 16
453
454#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK 0x0000ff00
455#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SHIFT 8
456#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT 0x00000000
457#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8071 0x00000100
458#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072 0x00000200
459#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073 0x00000300
460#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705 0x00000400
461#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706 0x00000500
Eilon Greenstein589abe32009-02-12 08:36:55 +0000462#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726 0x00000600
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200463#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481 0x00000700
Eliezer Tamirf1410642008-02-28 11:51:50 -0800464#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101 0x00000800
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000465#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727 0x00000900
466#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727_NOC 0x00000a00
Yaniv Rosner4f60dab2009-11-05 19:18:23 +0200467#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823 0x00000b00
Yaniv Rosnerc87bca12011-01-31 04:22:41 +0000468#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833 0x00000d00
Eliezer Tamirf1410642008-02-28 11:51:50 -0800469#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200470#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00
471
472#define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK 0x000000ff
473#define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT 0
474
475 u32 speed_capability_mask;
476#define PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK 0xffff0000
477#define PORT_HW_CFG_SPEED_CAPABILITY_D0_SHIFT 16
478#define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL 0x00010000
479#define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF 0x00020000
480#define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF 0x00040000
481#define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL 0x00080000
482#define PORT_HW_CFG_SPEED_CAPABILITY_D0_1G 0x00100000
483#define PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G 0x00200000
484#define PORT_HW_CFG_SPEED_CAPABILITY_D0_10G 0x00400000
485#define PORT_HW_CFG_SPEED_CAPABILITY_D0_12G 0x00800000
486#define PORT_HW_CFG_SPEED_CAPABILITY_D0_12_5G 0x01000000
487#define PORT_HW_CFG_SPEED_CAPABILITY_D0_13G 0x02000000
488#define PORT_HW_CFG_SPEED_CAPABILITY_D0_15G 0x04000000
489#define PORT_HW_CFG_SPEED_CAPABILITY_D0_16G 0x08000000
490#define PORT_HW_CFG_SPEED_CAPABILITY_D0_RESERVED 0xf0000000
491
492#define PORT_HW_CFG_SPEED_CAPABILITY_D3_MASK 0x0000ffff
493#define PORT_HW_CFG_SPEED_CAPABILITY_D3_SHIFT 0
494#define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_FULL 0x00000001
495#define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_HALF 0x00000002
496#define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_HALF 0x00000004
497#define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_FULL 0x00000008
498#define PORT_HW_CFG_SPEED_CAPABILITY_D3_1G 0x00000010
499#define PORT_HW_CFG_SPEED_CAPABILITY_D3_2_5G 0x00000020
500#define PORT_HW_CFG_SPEED_CAPABILITY_D3_10G 0x00000040
501#define PORT_HW_CFG_SPEED_CAPABILITY_D3_12G 0x00000080
502#define PORT_HW_CFG_SPEED_CAPABILITY_D3_12_5G 0x00000100
503#define PORT_HW_CFG_SPEED_CAPABILITY_D3_13G 0x00000200
504#define PORT_HW_CFG_SPEED_CAPABILITY_D3_15G 0x00000400
505#define PORT_HW_CFG_SPEED_CAPABILITY_D3_16G 0x00000800
506#define PORT_HW_CFG_SPEED_CAPABILITY_D3_RESERVED 0x0000f000
507
508 u32 reserved[2];
509
510};
511
Eliezer Tamirf1410642008-02-28 11:51:50 -0800512
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200513/****************************************************************************
514 * Shared Feature configuration *
515 ****************************************************************************/
516struct shared_feat_cfg { /* NVRAM Offset */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800517
518 u32 config; /* 0x450 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200519#define SHARED_FEATURE_BMC_ECHO_MODE_EN 0x00000001
Eilon Greenstein589abe32009-02-12 08:36:55 +0000520
521 /* Use the values from options 47 and 48 instead of the HW default
522 values */
523#define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_DISABLED 0x00000000
524#define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_ENABLED 0x00000002
525
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -0800526#define SHARED_FEAT_CFG_FORCE_SF_MODE_MASK 0x00000700
527#define SHARED_FEAT_CFG_FORCE_SF_MODE_SHIFT 8
528#define SHARED_FEAT_CFG_FORCE_SF_MODE_MF_ALLOWED 0x00000000
529#define SHARED_FEAT_CFG_FORCE_SF_MODE_FORCED_SF 0x00000100
530#define SHARED_FEAT_CFG_FORCE_SF_MODE_SPIO4 0x00000200
531#define SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT 0x00000300
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200532
533};
534
535
536/****************************************************************************
537 * Port Feature configuration *
538 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -0800539struct port_feat_cfg { /* port 0: 0x454 port 1: 0x4c8 */
540
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200541 u32 config;
542#define PORT_FEATURE_BAR1_SIZE_MASK 0x0000000f
543#define PORT_FEATURE_BAR1_SIZE_SHIFT 0
544#define PORT_FEATURE_BAR1_SIZE_DISABLED 0x00000000
545#define PORT_FEATURE_BAR1_SIZE_64K 0x00000001
546#define PORT_FEATURE_BAR1_SIZE_128K 0x00000002
547#define PORT_FEATURE_BAR1_SIZE_256K 0x00000003
548#define PORT_FEATURE_BAR1_SIZE_512K 0x00000004
549#define PORT_FEATURE_BAR1_SIZE_1M 0x00000005
550#define PORT_FEATURE_BAR1_SIZE_2M 0x00000006
551#define PORT_FEATURE_BAR1_SIZE_4M 0x00000007
552#define PORT_FEATURE_BAR1_SIZE_8M 0x00000008
553#define PORT_FEATURE_BAR1_SIZE_16M 0x00000009
554#define PORT_FEATURE_BAR1_SIZE_32M 0x0000000a
555#define PORT_FEATURE_BAR1_SIZE_64M 0x0000000b
556#define PORT_FEATURE_BAR1_SIZE_128M 0x0000000c
557#define PORT_FEATURE_BAR1_SIZE_256M 0x0000000d
558#define PORT_FEATURE_BAR1_SIZE_512M 0x0000000e
559#define PORT_FEATURE_BAR1_SIZE_1G 0x0000000f
560#define PORT_FEATURE_BAR2_SIZE_MASK 0x000000f0
561#define PORT_FEATURE_BAR2_SIZE_SHIFT 4
562#define PORT_FEATURE_BAR2_SIZE_DISABLED 0x00000000
563#define PORT_FEATURE_BAR2_SIZE_64K 0x00000010
564#define PORT_FEATURE_BAR2_SIZE_128K 0x00000020
565#define PORT_FEATURE_BAR2_SIZE_256K 0x00000030
566#define PORT_FEATURE_BAR2_SIZE_512K 0x00000040
567#define PORT_FEATURE_BAR2_SIZE_1M 0x00000050
568#define PORT_FEATURE_BAR2_SIZE_2M 0x00000060
569#define PORT_FEATURE_BAR2_SIZE_4M 0x00000070
570#define PORT_FEATURE_BAR2_SIZE_8M 0x00000080
571#define PORT_FEATURE_BAR2_SIZE_16M 0x00000090
572#define PORT_FEATURE_BAR2_SIZE_32M 0x000000a0
573#define PORT_FEATURE_BAR2_SIZE_64M 0x000000b0
574#define PORT_FEATURE_BAR2_SIZE_128M 0x000000c0
575#define PORT_FEATURE_BAR2_SIZE_256M 0x000000d0
576#define PORT_FEATURE_BAR2_SIZE_512M 0x000000e0
577#define PORT_FEATURE_BAR2_SIZE_1G 0x000000f0
578#define PORT_FEATURE_EN_SIZE_MASK 0x07000000
579#define PORT_FEATURE_EN_SIZE_SHIFT 24
580#define PORT_FEATURE_WOL_ENABLED 0x01000000
581#define PORT_FEATURE_MBA_ENABLED 0x02000000
582#define PORT_FEATURE_MFW_ENABLED 0x04000000
583
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000584 /* Reserved bits: 28-29 */
585 /* Check the optic vendor via i2c against a list of approved modules
586 in a separate nvram image */
587#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK 0xE0000000
588#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_SHIFT 29
589#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_NO_ENFORCEMENT 0x00000000
590#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER 0x20000000
591#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_WARNING_MSG 0x40000000
592#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_POWER_DOWN 0x60000000
593
Eilon Greenstein589abe32009-02-12 08:36:55 +0000594
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200595 u32 wol_config;
596 /* Default is used when driver sets to "auto" mode */
597#define PORT_FEATURE_WOL_DEFAULT_MASK 0x00000003
598#define PORT_FEATURE_WOL_DEFAULT_SHIFT 0
599#define PORT_FEATURE_WOL_DEFAULT_DISABLE 0x00000000
600#define PORT_FEATURE_WOL_DEFAULT_MAGIC 0x00000001
601#define PORT_FEATURE_WOL_DEFAULT_ACPI 0x00000002
602#define PORT_FEATURE_WOL_DEFAULT_MAGIC_AND_ACPI 0x00000003
603#define PORT_FEATURE_WOL_RES_PAUSE_CAP 0x00000004
604#define PORT_FEATURE_WOL_RES_ASYM_PAUSE_CAP 0x00000008
605#define PORT_FEATURE_WOL_ACPI_UPON_MGMT 0x00000010
606
607 u32 mba_config;
608#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_MASK 0x00000003
609#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_SHIFT 0
610#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_PXE 0x00000000
611#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_RPL 0x00000001
612#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_BOOTP 0x00000002
613#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_ISCSIB 0x00000003
614#define PORT_FEATURE_MBA_RES_PAUSE_CAP 0x00000100
615#define PORT_FEATURE_MBA_RES_ASYM_PAUSE_CAP 0x00000200
616#define PORT_FEATURE_MBA_SETUP_PROMPT_ENABLE 0x00000400
617#define PORT_FEATURE_MBA_HOTKEY_CTRL_S 0x00000000
618#define PORT_FEATURE_MBA_HOTKEY_CTRL_B 0x00000800
619#define PORT_FEATURE_MBA_EXP_ROM_SIZE_MASK 0x000ff000
620#define PORT_FEATURE_MBA_EXP_ROM_SIZE_SHIFT 12
621#define PORT_FEATURE_MBA_EXP_ROM_SIZE_DISABLED 0x00000000
622#define PORT_FEATURE_MBA_EXP_ROM_SIZE_2K 0x00001000
623#define PORT_FEATURE_MBA_EXP_ROM_SIZE_4K 0x00002000
624#define PORT_FEATURE_MBA_EXP_ROM_SIZE_8K 0x00003000
625#define PORT_FEATURE_MBA_EXP_ROM_SIZE_16K 0x00004000
626#define PORT_FEATURE_MBA_EXP_ROM_SIZE_32K 0x00005000
627#define PORT_FEATURE_MBA_EXP_ROM_SIZE_64K 0x00006000
628#define PORT_FEATURE_MBA_EXP_ROM_SIZE_128K 0x00007000
629#define PORT_FEATURE_MBA_EXP_ROM_SIZE_256K 0x00008000
630#define PORT_FEATURE_MBA_EXP_ROM_SIZE_512K 0x00009000
631#define PORT_FEATURE_MBA_EXP_ROM_SIZE_1M 0x0000a000
632#define PORT_FEATURE_MBA_EXP_ROM_SIZE_2M 0x0000b000
633#define PORT_FEATURE_MBA_EXP_ROM_SIZE_4M 0x0000c000
634#define PORT_FEATURE_MBA_EXP_ROM_SIZE_8M 0x0000d000
635#define PORT_FEATURE_MBA_EXP_ROM_SIZE_16M 0x0000e000
636#define PORT_FEATURE_MBA_EXP_ROM_SIZE_32M 0x0000f000
637#define PORT_FEATURE_MBA_MSG_TIMEOUT_MASK 0x00f00000
638#define PORT_FEATURE_MBA_MSG_TIMEOUT_SHIFT 20
639#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_MASK 0x03000000
640#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_SHIFT 24
641#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_AUTO 0x00000000
642#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_BBS 0x01000000
643#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT18H 0x02000000
644#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT19H 0x03000000
645#define PORT_FEATURE_MBA_LINK_SPEED_MASK 0x3c000000
646#define PORT_FEATURE_MBA_LINK_SPEED_SHIFT 26
647#define PORT_FEATURE_MBA_LINK_SPEED_AUTO 0x00000000
648#define PORT_FEATURE_MBA_LINK_SPEED_10HD 0x04000000
649#define PORT_FEATURE_MBA_LINK_SPEED_10FD 0x08000000
650#define PORT_FEATURE_MBA_LINK_SPEED_100HD 0x0c000000
651#define PORT_FEATURE_MBA_LINK_SPEED_100FD 0x10000000
652#define PORT_FEATURE_MBA_LINK_SPEED_1GBPS 0x14000000
653#define PORT_FEATURE_MBA_LINK_SPEED_2_5GBPS 0x18000000
654#define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_CX4 0x1c000000
655#define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_KX4 0x20000000
656#define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_KR 0x24000000
657#define PORT_FEATURE_MBA_LINK_SPEED_12GBPS 0x28000000
658#define PORT_FEATURE_MBA_LINK_SPEED_12_5GBPS 0x2c000000
659#define PORT_FEATURE_MBA_LINK_SPEED_13GBPS 0x30000000
660#define PORT_FEATURE_MBA_LINK_SPEED_15GBPS 0x34000000
661#define PORT_FEATURE_MBA_LINK_SPEED_16GBPS 0x38000000
662
663 u32 bmc_config;
664#define PORT_FEATURE_BMC_LINK_OVERRIDE_DEFAULT 0x00000000
665#define PORT_FEATURE_BMC_LINK_OVERRIDE_EN 0x00000001
666
667 u32 mba_vlan_cfg;
668#define PORT_FEATURE_MBA_VLAN_TAG_MASK 0x0000ffff
669#define PORT_FEATURE_MBA_VLAN_TAG_SHIFT 0
670#define PORT_FEATURE_MBA_VLAN_EN 0x00010000
671
672 u32 resource_cfg;
673#define PORT_FEATURE_RESOURCE_CFG_VALID 0x00000001
674#define PORT_FEATURE_RESOURCE_CFG_DIAG 0x00000002
675#define PORT_FEATURE_RESOURCE_CFG_L2 0x00000004
676#define PORT_FEATURE_RESOURCE_CFG_ISCSI 0x00000008
677#define PORT_FEATURE_RESOURCE_CFG_RDMA 0x00000010
678
679 u32 smbus_config;
680 /* Obsolete */
681#define PORT_FEATURE_SMBUS_EN 0x00000001
682#define PORT_FEATURE_SMBUS_ADDR_MASK 0x000000fe
683#define PORT_FEATURE_SMBUS_ADDR_SHIFT 1
684
Eliezer Tamirf1410642008-02-28 11:51:50 -0800685 u32 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200686
687 u32 link_config; /* Used as HW defaults for the driver */
688#define PORT_FEATURE_CONNECTED_SWITCH_MASK 0x03000000
689#define PORT_FEATURE_CONNECTED_SWITCH_SHIFT 24
690 /* (forced) low speed switch (< 10G) */
691#define PORT_FEATURE_CON_SWITCH_1G_SWITCH 0x00000000
692 /* (forced) high speed switch (>= 10G) */
693#define PORT_FEATURE_CON_SWITCH_10G_SWITCH 0x01000000
694#define PORT_FEATURE_CON_SWITCH_AUTO_DETECT 0x02000000
695#define PORT_FEATURE_CON_SWITCH_ONE_TIME_DETECT 0x03000000
696
697#define PORT_FEATURE_LINK_SPEED_MASK 0x000f0000
698#define PORT_FEATURE_LINK_SPEED_SHIFT 16
699#define PORT_FEATURE_LINK_SPEED_AUTO 0x00000000
700#define PORT_FEATURE_LINK_SPEED_10M_FULL 0x00010000
701#define PORT_FEATURE_LINK_SPEED_10M_HALF 0x00020000
702#define PORT_FEATURE_LINK_SPEED_100M_HALF 0x00030000
703#define PORT_FEATURE_LINK_SPEED_100M_FULL 0x00040000
704#define PORT_FEATURE_LINK_SPEED_1G 0x00050000
705#define PORT_FEATURE_LINK_SPEED_2_5G 0x00060000
706#define PORT_FEATURE_LINK_SPEED_10G_CX4 0x00070000
707#define PORT_FEATURE_LINK_SPEED_10G_KX4 0x00080000
708#define PORT_FEATURE_LINK_SPEED_10G_KR 0x00090000
709#define PORT_FEATURE_LINK_SPEED_12G 0x000a0000
710#define PORT_FEATURE_LINK_SPEED_12_5G 0x000b0000
711#define PORT_FEATURE_LINK_SPEED_13G 0x000c0000
712#define PORT_FEATURE_LINK_SPEED_15G 0x000d0000
713#define PORT_FEATURE_LINK_SPEED_16G 0x000e0000
714
715#define PORT_FEATURE_FLOW_CONTROL_MASK 0x00000700
716#define PORT_FEATURE_FLOW_CONTROL_SHIFT 8
717#define PORT_FEATURE_FLOW_CONTROL_AUTO 0x00000000
718#define PORT_FEATURE_FLOW_CONTROL_TX 0x00000100
719#define PORT_FEATURE_FLOW_CONTROL_RX 0x00000200
720#define PORT_FEATURE_FLOW_CONTROL_BOTH 0x00000300
721#define PORT_FEATURE_FLOW_CONTROL_NONE 0x00000400
722
723 /* The default for MCP link configuration,
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000724 uses the same defines as link_config */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200725 u32 mfw_wol_link_cfg;
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000726 /* The default for the driver of the second external phy,
727 uses the same defines as link_config */
728 u32 link_config2; /* 0x47C */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200729
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000730 /* The default for MCP of the second external phy,
731 uses the same defines as link_config */
732 u32 mfw_wol_link_cfg2; /* 0x480 */
733
734 u32 Reserved2[17]; /* 0x484 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200735
736};
737
738
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700739/****************************************************************************
740 * Device Information *
741 ****************************************************************************/
Eilon Greenstein5cd65a92009-02-12 08:38:11 +0000742struct shm_dev_info { /* size */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800743
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700744 u32 bc_rev; /* 8 bits each: major, minor, build */ /* 4 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800745
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700746 struct shared_hw_cfg shared_hw_config; /* 40 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800747
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700748 struct port_hw_cfg port_hw_config[PORT_MAX]; /* 400*2=800 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800749
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700750 struct shared_feat_cfg shared_feature_config; /* 4 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800751
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700752 struct port_feat_cfg port_feature_config[PORT_MAX];/* 116*2=232 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800753
754};
755
756
757#define FUNC_0 0
758#define FUNC_1 1
Eilon Greensteinad8d3942008-06-23 20:29:02 -0700759#define FUNC_2 2
760#define FUNC_3 3
761#define FUNC_4 4
762#define FUNC_5 5
763#define FUNC_6 6
764#define FUNC_7 7
Eliezer Tamirf1410642008-02-28 11:51:50 -0800765#define E1_FUNC_MAX 2
Eilon Greensteinad8d3942008-06-23 20:29:02 -0700766#define E1H_FUNC_MAX 8
Dmitry Kravkovf2e08992010-10-06 03:28:26 +0000767#define E2_FUNC_MAX 4 /* per path */
Eilon Greensteinad8d3942008-06-23 20:29:02 -0700768
769#define VN_0 0
770#define VN_1 1
771#define VN_2 2
772#define VN_3 3
773#define E1VN_MAX 1
774#define E1HVN_MAX 4
Eliezer Tamirf1410642008-02-28 11:51:50 -0800775
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +0000776#define E2_VF_MAX 64
Eliezer Tamirf1410642008-02-28 11:51:50 -0800777/* This value (in milliseconds) determines the frequency of the driver
778 * issuing the PULSE message code. The firmware monitors this periodic
779 * pulse to determine when to switch to an OS-absent mode. */
780#define DRV_PULSE_PERIOD_MS 250
781
782/* This value (in milliseconds) determines how long the driver should
783 * wait for an acknowledgement from the firmware before timing out. Once
784 * the firmware has timed out, the driver will assume there is no firmware
785 * running and there won't be any firmware-driver synchronization during a
786 * driver reset. */
787#define FW_ACK_TIME_OUT_MS 5000
788
789#define FW_ACK_POLL_TIME_MS 1
790
791#define FW_ACK_NUM_OF_POLL (FW_ACK_TIME_OUT_MS/FW_ACK_POLL_TIME_MS)
792
793/* LED Blink rate that will achieve ~15.9Hz */
794#define LED_BLINK_RATE_VAL 480
795
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200796/****************************************************************************
Eliezer Tamirf1410642008-02-28 11:51:50 -0800797 * Driver <-> FW Mailbox *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200798 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -0800799struct drv_port_mb {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200800
Eliezer Tamirf1410642008-02-28 11:51:50 -0800801 u32 link_status;
802 /* Driver should update this field on any link change event */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200803
Eliezer Tamirf1410642008-02-28 11:51:50 -0800804#define LINK_STATUS_LINK_FLAG_MASK 0x00000001
805#define LINK_STATUS_LINK_UP 0x00000001
806#define LINK_STATUS_SPEED_AND_DUPLEX_MASK 0x0000001E
807#define LINK_STATUS_SPEED_AND_DUPLEX_AN_NOT_COMPLETE (0<<1)
808#define LINK_STATUS_SPEED_AND_DUPLEX_10THD (1<<1)
809#define LINK_STATUS_SPEED_AND_DUPLEX_10TFD (2<<1)
810#define LINK_STATUS_SPEED_AND_DUPLEX_100TXHD (3<<1)
811#define LINK_STATUS_SPEED_AND_DUPLEX_100T4 (4<<1)
812#define LINK_STATUS_SPEED_AND_DUPLEX_100TXFD (5<<1)
813#define LINK_STATUS_SPEED_AND_DUPLEX_1000THD (6<<1)
814#define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD (7<<1)
815#define LINK_STATUS_SPEED_AND_DUPLEX_1000XFD (7<<1)
816#define LINK_STATUS_SPEED_AND_DUPLEX_2500THD (8<<1)
817#define LINK_STATUS_SPEED_AND_DUPLEX_2500TFD (9<<1)
818#define LINK_STATUS_SPEED_AND_DUPLEX_2500XFD (9<<1)
819#define LINK_STATUS_SPEED_AND_DUPLEX_10GTFD (10<<1)
820#define LINK_STATUS_SPEED_AND_DUPLEX_10GXFD (10<<1)
821#define LINK_STATUS_SPEED_AND_DUPLEX_12GTFD (11<<1)
822#define LINK_STATUS_SPEED_AND_DUPLEX_12GXFD (11<<1)
823#define LINK_STATUS_SPEED_AND_DUPLEX_12_5GTFD (12<<1)
824#define LINK_STATUS_SPEED_AND_DUPLEX_12_5GXFD (12<<1)
825#define LINK_STATUS_SPEED_AND_DUPLEX_13GTFD (13<<1)
826#define LINK_STATUS_SPEED_AND_DUPLEX_13GXFD (13<<1)
827#define LINK_STATUS_SPEED_AND_DUPLEX_15GTFD (14<<1)
828#define LINK_STATUS_SPEED_AND_DUPLEX_15GXFD (14<<1)
829#define LINK_STATUS_SPEED_AND_DUPLEX_16GTFD (15<<1)
830#define LINK_STATUS_SPEED_AND_DUPLEX_16GXFD (15<<1)
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200831
Eliezer Tamirf1410642008-02-28 11:51:50 -0800832#define LINK_STATUS_AUTO_NEGOTIATE_FLAG_MASK 0x00000020
833#define LINK_STATUS_AUTO_NEGOTIATE_ENABLED 0x00000020
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200834
Eliezer Tamirf1410642008-02-28 11:51:50 -0800835#define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE 0x00000040
836#define LINK_STATUS_PARALLEL_DETECTION_FLAG_MASK 0x00000080
837#define LINK_STATUS_PARALLEL_DETECTION_USED 0x00000080
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200838
Eliezer Tamirf1410642008-02-28 11:51:50 -0800839#define LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE 0x00000200
840#define LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE 0x00000400
841#define LINK_STATUS_LINK_PARTNER_100T4_CAPABLE 0x00000800
842#define LINK_STATUS_LINK_PARTNER_100TXFD_CAPABLE 0x00001000
843#define LINK_STATUS_LINK_PARTNER_100TXHD_CAPABLE 0x00002000
844#define LINK_STATUS_LINK_PARTNER_10TFD_CAPABLE 0x00004000
845#define LINK_STATUS_LINK_PARTNER_10THD_CAPABLE 0x00008000
846
847#define LINK_STATUS_TX_FLOW_CONTROL_FLAG_MASK 0x00010000
848#define LINK_STATUS_TX_FLOW_CONTROL_ENABLED 0x00010000
849
850#define LINK_STATUS_RX_FLOW_CONTROL_FLAG_MASK 0x00020000
851#define LINK_STATUS_RX_FLOW_CONTROL_ENABLED 0x00020000
852
853#define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK 0x000C0000
854#define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE (0<<18)
855#define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE (1<<18)
856#define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE (2<<18)
857#define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE (3<<18)
858
859#define LINK_STATUS_SERDES_LINK 0x00100000
860
861#define LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE 0x00200000
862#define LINK_STATUS_LINK_PARTNER_2500XHD_CAPABLE 0x00400000
863#define LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE 0x00800000
864#define LINK_STATUS_LINK_PARTNER_12GXFD_CAPABLE 0x01000000
865#define LINK_STATUS_LINK_PARTNER_12_5GXFD_CAPABLE 0x02000000
866#define LINK_STATUS_LINK_PARTNER_13GXFD_CAPABLE 0x04000000
867#define LINK_STATUS_LINK_PARTNER_15GXFD_CAPABLE 0x08000000
868#define LINK_STATUS_LINK_PARTNER_16GXFD_CAPABLE 0x10000000
869
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700870 u32 port_stx;
871
Eilon Greensteinde832a52009-02-12 08:36:33 +0000872 u32 stat_nig_timer;
873
Eilon Greensteina35da8d2009-02-12 08:37:02 +0000874 /* MCP firmware does not use this field */
875 u32 ext_phy_fw_version;
Eliezer Tamirf1410642008-02-28 11:51:50 -0800876
877};
878
879
880struct drv_func_mb {
881
882 u32 drv_mb_header;
883#define DRV_MSG_CODE_MASK 0xffff0000
884#define DRV_MSG_CODE_LOAD_REQ 0x10000000
885#define DRV_MSG_CODE_LOAD_DONE 0x11000000
886#define DRV_MSG_CODE_UNLOAD_REQ_WOL_EN 0x20000000
887#define DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS 0x20010000
888#define DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP 0x20020000
889#define DRV_MSG_CODE_UNLOAD_DONE 0x21000000
Eilon Greenstein2691d512009-08-12 08:22:08 +0000890#define DRV_MSG_CODE_DCC_OK 0x30000000
891#define DRV_MSG_CODE_DCC_FAILURE 0x31000000
Eliezer Tamirf1410642008-02-28 11:51:50 -0800892#define DRV_MSG_CODE_DIAG_ENTER_REQ 0x50000000
893#define DRV_MSG_CODE_DIAG_EXIT_REQ 0x60000000
894#define DRV_MSG_CODE_VALIDATE_KEY 0x70000000
895#define DRV_MSG_CODE_GET_CURR_KEY 0x80000000
896#define DRV_MSG_CODE_GET_UPGRADE_KEY 0x81000000
897#define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000
898#define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000899 /*
Gilles Espinassef77f13e2010-03-29 15:41:47 +0200900 * The optic module verification commands require bootcode
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000901 * v5.0.6 or later
902 */
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000903#define DRV_MSG_CODE_VRFY_FIRST_PHY_OPT_MDL 0xa0000000
904#define REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL 0x00050006
905 /*
906 * The specific optic module verification command requires bootcode
907 * v5.2.12 or later
908 */
909#define DRV_MSG_CODE_VRFY_SPECIFIC_PHY_OPT_MDL 0xa1000000
910#define REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL 0x00050234
Eliezer Tamirf1410642008-02-28 11:51:50 -0800911
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +0000912#define DRV_MSG_CODE_DCBX_ADMIN_PMF_MSG 0xb0000000
913#define DRV_MSG_CODE_DCBX_PMF_DRV_OK 0xb2000000
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -0800914#define DRV_MSG_CODE_SET_MF_BW 0xe0000000
915#define REQ_BC_VER_4_SET_MF_BW 0x00060202
916#define DRV_MSG_CODE_SET_MF_BW_ACK 0xe1000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700917#define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000
918#define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000
919#define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000
920#define BIOS_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
921
Eliezer Tamirf1410642008-02-28 11:51:50 -0800922#define DRV_MSG_SEQ_NUMBER_MASK 0x0000ffff
923
924 u32 drv_mb_param;
925
926 u32 fw_mb_header;
927#define FW_MSG_CODE_MASK 0xffff0000
928#define FW_MSG_CODE_DRV_LOAD_COMMON 0x10100000
929#define FW_MSG_CODE_DRV_LOAD_PORT 0x10110000
930#define FW_MSG_CODE_DRV_LOAD_FUNCTION 0x10120000
Dmitry Kravkovf2e08992010-10-06 03:28:26 +0000931 /* Load common chip is supported from bc 6.0.0 */
932#define REQ_BC_VER_4_DRV_LOAD_COMMON_CHIP 0x00060000
933#define FW_MSG_CODE_DRV_LOAD_COMMON_CHIP 0x10130000
Eliezer Tamirf1410642008-02-28 11:51:50 -0800934#define FW_MSG_CODE_DRV_LOAD_REFUSED 0x10200000
935#define FW_MSG_CODE_DRV_LOAD_DONE 0x11100000
936#define FW_MSG_CODE_DRV_UNLOAD_COMMON 0x20100000
937#define FW_MSG_CODE_DRV_UNLOAD_PORT 0x20110000
938#define FW_MSG_CODE_DRV_UNLOAD_FUNCTION 0x20120000
939#define FW_MSG_CODE_DRV_UNLOAD_DONE 0x21100000
Eilon Greenstein2691d512009-08-12 08:22:08 +0000940#define FW_MSG_CODE_DCC_DONE 0x30100000
Eliezer Tamirf1410642008-02-28 11:51:50 -0800941#define FW_MSG_CODE_DIAG_ENTER_DONE 0x50100000
942#define FW_MSG_CODE_DIAG_REFUSE 0x50200000
943#define FW_MSG_CODE_DIAG_EXIT_DONE 0x60100000
944#define FW_MSG_CODE_VALIDATE_KEY_SUCCESS 0x70100000
945#define FW_MSG_CODE_VALIDATE_KEY_FAILURE 0x70200000
946#define FW_MSG_CODE_GET_KEY_DONE 0x80100000
947#define FW_MSG_CODE_NO_KEY 0x80f00000
948#define FW_MSG_CODE_LIC_INFO_NOT_READY 0x80f80000
949#define FW_MSG_CODE_L2B_PRAM_LOADED 0x90100000
950#define FW_MSG_CODE_L2B_PRAM_T_LOAD_FAILURE 0x90210000
951#define FW_MSG_CODE_L2B_PRAM_C_LOAD_FAILURE 0x90220000
952#define FW_MSG_CODE_L2B_PRAM_X_LOAD_FAILURE 0x90230000
953#define FW_MSG_CODE_L2B_PRAM_U_LOAD_FAILURE 0x90240000
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000954#define FW_MSG_CODE_VRFY_OPT_MDL_SUCCESS 0xa0100000
955#define FW_MSG_CODE_VRFY_OPT_MDL_INVLD_IMG 0xa0200000
956#define FW_MSG_CODE_VRFY_OPT_MDL_UNAPPROVED 0xa0300000
Eliezer Tamirf1410642008-02-28 11:51:50 -0800957
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700958#define FW_MSG_CODE_LIC_CHALLENGE 0xff010000
959#define FW_MSG_CODE_LIC_RESPONSE 0xff020000
960#define FW_MSG_CODE_VIRT_MAC_PRIM 0xff030000
961#define FW_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
962
Eliezer Tamirf1410642008-02-28 11:51:50 -0800963#define FW_MSG_SEQ_NUMBER_MASK 0x0000ffff
964
965 u32 fw_mb_param;
966
967 u32 drv_pulse_mb;
968#define DRV_PULSE_SEQ_MASK 0x00007fff
969#define DRV_PULSE_SYSTEM_TIME_MASK 0xffff0000
970 /* The system time is in the format of
971 * (year-2001)*12*32 + month*32 + day. */
972#define DRV_PULSE_ALWAYS_ALIVE 0x00008000
973 /* Indicate to the firmware not to go into the
974 * OS-absent when it is not getting driver pulse.
975 * This is used for debugging as well for PXE(MBA). */
976
977 u32 mcp_pulse_mb;
978#define MCP_PULSE_SEQ_MASK 0x00007fff
979#define MCP_PULSE_ALWAYS_ALIVE 0x00008000
980 /* Indicates to the driver not to assert due to lack
981 * of MCP response */
982#define MCP_EVENT_MASK 0xffff0000
983#define MCP_EVENT_OTHER_DRIVER_RESET_REQ 0x00010000
984
985 u32 iscsi_boot_signature;
986 u32 iscsi_boot_block_offset;
987
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700988 u32 drv_status;
989#define DRV_STATUS_PMF 0x00000001
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -0800990#define DRV_STATUS_SET_MF_BW 0x00000004
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700991
Eilon Greenstein2691d512009-08-12 08:22:08 +0000992#define DRV_STATUS_DCC_EVENT_MASK 0x0000ff00
993#define DRV_STATUS_DCC_DISABLE_ENABLE_PF 0x00000100
994#define DRV_STATUS_DCC_BANDWIDTH_ALLOCATION 0x00000200
995#define DRV_STATUS_DCC_CHANGE_MAC_ADDRESS 0x00000400
996#define DRV_STATUS_DCC_RESERVED1 0x00000800
997#define DRV_STATUS_DCC_SET_PROTOCOL 0x00001000
998#define DRV_STATUS_DCC_SET_PRIORITY 0x00002000
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +0000999#define DRV_STATUS_DCBX_EVENT_MASK 0x000f0000
1000#define DRV_STATUS_DCBX_NEGOTIATION_RESULTS 0x00010000
Eilon Greenstein2691d512009-08-12 08:22:08 +00001001
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001002 u32 virt_mac_upper;
1003#define VIRT_MAC_SIGN_MASK 0xffff0000
1004#define VIRT_MAC_SIGNATURE 0x564d0000
1005 u32 virt_mac_lower;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001006
1007};
1008
1009
1010/****************************************************************************
1011 * Management firmware state *
1012 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -08001013/* Allocate 440 bytes for management firmware */
1014#define MGMTFW_STATE_WORD_SIZE 110
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001015
1016struct mgmtfw_state {
1017 u32 opaque[MGMTFW_STATE_WORD_SIZE];
1018};
1019
1020
1021/****************************************************************************
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001022 * Multi-Function configuration *
1023 ****************************************************************************/
1024struct shared_mf_cfg {
1025
1026 u32 clp_mb;
1027#define SHARED_MF_CLP_SET_DEFAULT 0x00000000
1028 /* set by CLP */
1029#define SHARED_MF_CLP_EXIT 0x00000001
1030 /* set by MCP */
1031#define SHARED_MF_CLP_EXIT_DONE 0x00010000
1032
1033};
1034
1035struct port_mf_cfg {
1036
1037 u32 dynamic_cfg; /* device control channel */
Eilon Greenstein2691d512009-08-12 08:22:08 +00001038#define PORT_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
1039#define PORT_MF_CFG_E1HOV_TAG_SHIFT 0
1040#define PORT_MF_CFG_E1HOV_TAG_DEFAULT PORT_MF_CFG_E1HOV_TAG_MASK
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001041
1042 u32 reserved[3];
1043
1044};
1045
1046struct func_mf_cfg {
1047
1048 u32 config;
1049 /* E/R/I/D */
1050 /* function 0 of each port cannot be hidden */
1051#define FUNC_MF_CFG_FUNC_HIDE 0x00000001
1052
1053#define FUNC_MF_CFG_PROTOCOL_MASK 0x00000007
1054#define FUNC_MF_CFG_PROTOCOL_ETHERNET 0x00000002
1055#define FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA 0x00000004
1056#define FUNC_MF_CFG_PROTOCOL_ISCSI 0x00000006
1057#define FUNC_MF_CFG_PROTOCOL_DEFAULT\
1058 FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA
1059
1060#define FUNC_MF_CFG_FUNC_DISABLED 0x00000008
1061
1062 /* PRI */
1063 /* 0 - low priority, 3 - high priority */
1064#define FUNC_MF_CFG_TRANSMIT_PRIORITY_MASK 0x00000300
1065#define FUNC_MF_CFG_TRANSMIT_PRIORITY_SHIFT 8
1066#define FUNC_MF_CFG_TRANSMIT_PRIORITY_DEFAULT 0x00000000
1067
1068 /* MINBW, MAXBW */
1069 /* value range - 0..100, increments in 100Mbps */
1070#define FUNC_MF_CFG_MIN_BW_MASK 0x00ff0000
1071#define FUNC_MF_CFG_MIN_BW_SHIFT 16
1072#define FUNC_MF_CFG_MIN_BW_DEFAULT 0x00000000
1073#define FUNC_MF_CFG_MAX_BW_MASK 0xff000000
1074#define FUNC_MF_CFG_MAX_BW_SHIFT 24
1075#define FUNC_MF_CFG_MAX_BW_DEFAULT 0x64000000
1076
1077 u32 mac_upper; /* MAC */
1078#define FUNC_MF_CFG_UPPERMAC_MASK 0x0000ffff
1079#define FUNC_MF_CFG_UPPERMAC_SHIFT 0
1080#define FUNC_MF_CFG_UPPERMAC_DEFAULT FUNC_MF_CFG_UPPERMAC_MASK
1081 u32 mac_lower;
1082#define FUNC_MF_CFG_LOWERMAC_DEFAULT 0xffffffff
1083
1084 u32 e1hov_tag; /* VNI */
1085#define FUNC_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
1086#define FUNC_MF_CFG_E1HOV_TAG_SHIFT 0
1087#define FUNC_MF_CFG_E1HOV_TAG_DEFAULT FUNC_MF_CFG_E1HOV_TAG_MASK
1088
1089 u32 reserved[2];
1090
1091};
1092
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001093/* This structure is not applicable and should not be accessed on 57711 */
1094struct func_ext_cfg {
1095 u32 func_cfg;
1096#define MACP_FUNC_CFG_FLAGS_MASK 0x000000FF
1097#define MACP_FUNC_CFG_FLAGS_SHIFT 0
1098#define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001
1099#define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002
1100#define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004
1101#define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008
1102
1103 u32 iscsi_mac_addr_upper;
1104 u32 iscsi_mac_addr_lower;
1105
1106 u32 fcoe_mac_addr_upper;
1107 u32 fcoe_mac_addr_lower;
1108
1109 u32 fcoe_wwn_port_name_upper;
1110 u32 fcoe_wwn_port_name_lower;
1111
1112 u32 fcoe_wwn_node_name_upper;
1113 u32 fcoe_wwn_node_name_lower;
1114
1115 u32 preserve_data;
1116#define MF_FUNC_CFG_PRESERVE_L2_MAC (1<<0)
1117#define MF_FUNC_CFG_PRESERVE_ISCSI_MAC (1<<1)
1118#define MF_FUNC_CFG_PRESERVE_FCOE_MAC (1<<2)
1119#define MF_FUNC_CFG_PRESERVE_FCOE_WWN_P (1<<3)
1120#define MF_FUNC_CFG_PRESERVE_FCOE_WWN_N (1<<4)
1121};
1122
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001123struct mf_cfg {
1124
1125 struct shared_mf_cfg shared_mf_config;
1126 struct port_mf_cfg port_mf_config[PORT_MAX];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001127 struct func_mf_cfg func_mf_config[E1H_FUNC_MAX];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001128
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001129 struct func_ext_cfg func_ext_config[E1H_FUNC_MAX];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001130};
1131
1132
1133/****************************************************************************
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001134 * Shared Memory Region *
1135 ****************************************************************************/
1136struct shmem_region { /* SharedMem Offset (size) */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001137
1138 u32 validity_map[PORT_MAX]; /* 0x0 (4*2 = 0x8) */
1139#define SHR_MEM_FORMAT_REV_ID ('A'<<24)
1140#define SHR_MEM_FORMAT_REV_MASK 0xff000000
1141 /* validity bits */
1142#define SHR_MEM_VALIDITY_PCI_CFG 0x00100000
1143#define SHR_MEM_VALIDITY_MB 0x00200000
1144#define SHR_MEM_VALIDITY_DEV_INFO 0x00400000
1145#define SHR_MEM_VALIDITY_RESERVED 0x00000007
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001146 /* One licensing bit should be set */
1147#define SHR_MEM_VALIDITY_LIC_KEY_IN_EFFECT_MASK 0x00000038
1148#define SHR_MEM_VALIDITY_LIC_MANUF_KEY_IN_EFFECT 0x00000008
1149#define SHR_MEM_VALIDITY_LIC_UPGRADE_KEY_IN_EFFECT 0x00000010
1150#define SHR_MEM_VALIDITY_LIC_NO_KEY_IN_EFFECT 0x00000020
Eliezer Tamirf1410642008-02-28 11:51:50 -08001151 /* Active MFW */
1152#define SHR_MEM_VALIDITY_ACTIVE_MFW_UNKNOWN 0x00000000
1153#define SHR_MEM_VALIDITY_ACTIVE_MFW_IPMI 0x00000040
1154#define SHR_MEM_VALIDITY_ACTIVE_MFW_UMP 0x00000080
1155#define SHR_MEM_VALIDITY_ACTIVE_MFW_NCSI 0x000000c0
1156#define SHR_MEM_VALIDITY_ACTIVE_MFW_NONE 0x000001c0
1157#define SHR_MEM_VALIDITY_ACTIVE_MFW_MASK 0x000001c0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001158
Eilon Greenstein5cd65a92009-02-12 08:38:11 +00001159 struct shm_dev_info dev_info; /* 0x8 (0x438) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001160
Michael Chane2513062009-10-10 13:46:58 +00001161 struct license_key drv_lic_key[PORT_MAX]; /* 0x440 (52*2=0x68) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001162
1163 /* FW information (for internal FW use) */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001164 u32 fw_info_fio_offset; /* 0x4a8 (0x4) */
1165 struct mgmtfw_state mgmtfw_state; /* 0x4ac (0x1b8) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001166
Eliezer Tamirf1410642008-02-28 11:51:50 -08001167 struct drv_port_mb port_mb[PORT_MAX]; /* 0x664 (16*2=0x20) */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001168 struct drv_func_mb func_mb[]; /* 0x684
1169 (44*2/4/8=0x58/0xb0/0x160) */
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001170
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001171}; /* 57710 = 0x6dc | 57711 = 0x7E4 | 57712 = 0x734 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001172
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001173struct fw_flr_ack {
1174 u32 pf_ack;
1175 u32 vf_ack[1];
1176 u32 iov_dis_ack;
1177};
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001178
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001179struct fw_flr_mb {
1180 u32 aggint;
1181 u32 opgen_addr;
1182 struct fw_flr_ack ack;
1183};
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001184
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001185/**** SUPPORT FOR SHMEM ARRRAYS ***
1186 * The SHMEM HSI is aligned on 32 bit boundaries which makes it difficult to
1187 * define arrays with storage types smaller then unsigned dwords.
1188 * The macros below add generic support for SHMEM arrays with numeric elements
1189 * that can span 2,4,8 or 16 bits. The array underlying type is a 32 bit dword
1190 * array with individual bit-filed elements accessed using shifts and masks.
1191 *
1192 */
1193
1194/* eb is the bitwidth of a single element */
1195#define SHMEM_ARRAY_MASK(eb) ((1<<(eb))-1)
1196#define SHMEM_ARRAY_ENTRY(i, eb) ((i)/(32/(eb)))
1197
1198/* the bit-position macro allows the used to flip the order of the arrays
1199 * elements on a per byte or word boundary.
1200 *
1201 * example: an array with 8 entries each 4 bit wide. This array will fit into
1202 * a single dword. The diagrmas below show the array order of the nibbles.
1203 *
1204 * SHMEM_ARRAY_BITPOS(i, 4, 4) defines the stadard ordering:
1205 *
1206 * | | | |
1207 * 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
1208 * | | | |
1209 *
1210 * SHMEM_ARRAY_BITPOS(i, 4, 8) defines a flip ordering per byte:
1211 *
1212 * | | | |
1213 * 1 | 0 | 3 | 2 | 5 | 4 | 7 | 6 |
1214 * | | | |
1215 *
1216 * SHMEM_ARRAY_BITPOS(i, 4, 16) defines a flip ordering per word:
1217 *
1218 * | | | |
1219 * 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 |
1220 * | | | |
1221 */
1222#define SHMEM_ARRAY_BITPOS(i, eb, fb) \
1223 ((((32/(fb)) - 1 - ((i)/((fb)/(eb))) % (32/(fb))) * (fb)) + \
1224 (((i)%((fb)/(eb))) * (eb)))
1225
1226#define SHMEM_ARRAY_GET(a, i, eb, fb) \
1227 ((a[SHMEM_ARRAY_ENTRY(i, eb)] >> SHMEM_ARRAY_BITPOS(i, eb, fb)) & \
1228 SHMEM_ARRAY_MASK(eb))
1229
1230#define SHMEM_ARRAY_SET(a, i, eb, fb, val) \
1231do { \
1232 a[SHMEM_ARRAY_ENTRY(i, eb)] &= ~(SHMEM_ARRAY_MASK(eb) << \
1233 SHMEM_ARRAY_BITPOS(i, eb, fb)); \
1234 a[SHMEM_ARRAY_ENTRY(i, eb)] |= (((val) & SHMEM_ARRAY_MASK(eb)) << \
1235 SHMEM_ARRAY_BITPOS(i, eb, fb)); \
1236} while (0)
1237
1238
1239/****START OF DCBX STRUCTURES DECLARATIONS****/
1240#define DCBX_MAX_NUM_PRI_PG_ENTRIES 8
1241#define DCBX_PRI_PG_BITWIDTH 4
1242#define DCBX_PRI_PG_FBITS 8
1243#define DCBX_PRI_PG_GET(a, i) \
1244 SHMEM_ARRAY_GET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS)
1245#define DCBX_PRI_PG_SET(a, i, val) \
1246 SHMEM_ARRAY_SET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS, val)
1247#define DCBX_MAX_NUM_PG_BW_ENTRIES 8
1248#define DCBX_BW_PG_BITWIDTH 8
1249#define DCBX_PG_BW_GET(a, i) \
1250 SHMEM_ARRAY_GET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH)
1251#define DCBX_PG_BW_SET(a, i, val) \
1252 SHMEM_ARRAY_SET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH, val)
1253#define DCBX_STRICT_PRI_PG 15
1254#define DCBX_MAX_APP_PROTOCOL 16
1255#define FCOE_APP_IDX 0
1256#define ISCSI_APP_IDX 1
1257#define PREDEFINED_APP_IDX_MAX 2
1258
1259struct dcbx_ets_feature {
1260 u32 enabled;
1261 u32 pg_bw_tbl[2];
1262 u32 pri_pg_tbl[1];
1263};
1264
1265struct dcbx_pfc_feature {
1266#ifdef __BIG_ENDIAN
1267 u8 pri_en_bitmap;
1268#define DCBX_PFC_PRI_0 0x01
1269#define DCBX_PFC_PRI_1 0x02
1270#define DCBX_PFC_PRI_2 0x04
1271#define DCBX_PFC_PRI_3 0x08
1272#define DCBX_PFC_PRI_4 0x10
1273#define DCBX_PFC_PRI_5 0x20
1274#define DCBX_PFC_PRI_6 0x40
1275#define DCBX_PFC_PRI_7 0x80
1276 u8 pfc_caps;
1277 u8 reserved;
1278 u8 enabled;
1279#elif defined(__LITTLE_ENDIAN)
1280 u8 enabled;
1281 u8 reserved;
1282 u8 pfc_caps;
1283 u8 pri_en_bitmap;
1284#define DCBX_PFC_PRI_0 0x01
1285#define DCBX_PFC_PRI_1 0x02
1286#define DCBX_PFC_PRI_2 0x04
1287#define DCBX_PFC_PRI_3 0x08
1288#define DCBX_PFC_PRI_4 0x10
1289#define DCBX_PFC_PRI_5 0x20
1290#define DCBX_PFC_PRI_6 0x40
1291#define DCBX_PFC_PRI_7 0x80
1292#endif
1293};
1294
1295struct dcbx_app_priority_entry {
1296#ifdef __BIG_ENDIAN
1297 u16 app_id;
1298 u8 pri_bitmap;
1299 u8 appBitfield;
1300#define DCBX_APP_ENTRY_VALID 0x01
1301#define DCBX_APP_ENTRY_SF_MASK 0x30
1302#define DCBX_APP_ENTRY_SF_SHIFT 4
1303#define DCBX_APP_SF_ETH_TYPE 0x10
1304#define DCBX_APP_SF_PORT 0x20
1305#elif defined(__LITTLE_ENDIAN)
1306 u8 appBitfield;
1307#define DCBX_APP_ENTRY_VALID 0x01
1308#define DCBX_APP_ENTRY_SF_MASK 0x30
1309#define DCBX_APP_ENTRY_SF_SHIFT 4
1310#define DCBX_APP_SF_ETH_TYPE 0x10
1311#define DCBX_APP_SF_PORT 0x20
1312 u8 pri_bitmap;
1313 u16 app_id;
1314#endif
1315};
1316
1317struct dcbx_app_priority_feature {
1318#ifdef __BIG_ENDIAN
1319 u8 reserved;
1320 u8 default_pri;
1321 u8 tc_supported;
1322 u8 enabled;
1323#elif defined(__LITTLE_ENDIAN)
1324 u8 enabled;
1325 u8 tc_supported;
1326 u8 default_pri;
1327 u8 reserved;
1328#endif
1329 struct dcbx_app_priority_entry app_pri_tbl[DCBX_MAX_APP_PROTOCOL];
1330};
1331
1332struct dcbx_features {
1333 struct dcbx_ets_feature ets;
1334 struct dcbx_pfc_feature pfc;
1335 struct dcbx_app_priority_feature app;
1336};
1337
1338struct lldp_params {
1339#ifdef __BIG_ENDIAN
1340 u8 msg_fast_tx_interval;
1341 u8 msg_tx_hold;
1342 u8 msg_tx_interval;
1343 u8 admin_status;
1344#define LLDP_TX_ONLY 0x01
1345#define LLDP_RX_ONLY 0x02
1346#define LLDP_TX_RX 0x03
1347#define LLDP_DISABLED 0x04
1348 u8 reserved1;
1349 u8 tx_fast;
1350 u8 tx_crd_max;
1351 u8 tx_crd;
1352#elif defined(__LITTLE_ENDIAN)
1353 u8 admin_status;
1354#define LLDP_TX_ONLY 0x01
1355#define LLDP_RX_ONLY 0x02
1356#define LLDP_TX_RX 0x03
1357#define LLDP_DISABLED 0x04
1358 u8 msg_tx_interval;
1359 u8 msg_tx_hold;
1360 u8 msg_fast_tx_interval;
1361 u8 tx_crd;
1362 u8 tx_crd_max;
1363 u8 tx_fast;
1364 u8 reserved1;
1365#endif
1366#define REM_CHASSIS_ID_STAT_LEN 4
1367#define REM_PORT_ID_STAT_LEN 4
1368 u32 peer_chassis_id[REM_CHASSIS_ID_STAT_LEN];
1369 u32 peer_port_id[REM_PORT_ID_STAT_LEN];
1370};
1371
1372struct lldp_dcbx_stat {
1373#define LOCAL_CHASSIS_ID_STAT_LEN 2
1374#define LOCAL_PORT_ID_STAT_LEN 2
1375 u32 local_chassis_id[LOCAL_CHASSIS_ID_STAT_LEN];
1376 u32 local_port_id[LOCAL_PORT_ID_STAT_LEN];
1377 u32 num_tx_dcbx_pkts;
1378 u32 num_rx_dcbx_pkts;
1379};
1380
1381struct lldp_admin_mib {
1382 u32 ver_cfg_flags;
1383#define DCBX_ETS_CONFIG_TX_ENABLED 0x00000001
1384#define DCBX_PFC_CONFIG_TX_ENABLED 0x00000002
1385#define DCBX_APP_CONFIG_TX_ENABLED 0x00000004
1386#define DCBX_ETS_RECO_TX_ENABLED 0x00000008
1387#define DCBX_ETS_RECO_VALID 0x00000010
1388#define DCBX_ETS_WILLING 0x00000020
1389#define DCBX_PFC_WILLING 0x00000040
1390#define DCBX_APP_WILLING 0x00000080
1391#define DCBX_VERSION_CEE 0x00000100
1392#define DCBX_VERSION_IEEE 0x00000200
1393#define DCBX_DCBX_ENABLED 0x00000400
1394#define DCBX_CEE_VERSION_MASK 0x0000f000
1395#define DCBX_CEE_VERSION_SHIFT 12
1396#define DCBX_CEE_MAX_VERSION_MASK 0x000f0000
1397#define DCBX_CEE_MAX_VERSION_SHIFT 16
1398 struct dcbx_features features;
1399};
1400
1401struct lldp_remote_mib {
1402 u32 prefix_seq_num;
1403 u32 flags;
1404#define DCBX_ETS_TLV_RX 0x00000001
1405#define DCBX_PFC_TLV_RX 0x00000002
1406#define DCBX_APP_TLV_RX 0x00000004
1407#define DCBX_ETS_RX_ERROR 0x00000010
1408#define DCBX_PFC_RX_ERROR 0x00000020
1409#define DCBX_APP_RX_ERROR 0x00000040
1410#define DCBX_ETS_REM_WILLING 0x00000100
1411#define DCBX_PFC_REM_WILLING 0x00000200
1412#define DCBX_APP_REM_WILLING 0x00000400
1413#define DCBX_REMOTE_ETS_RECO_VALID 0x00001000
1414 struct dcbx_features features;
1415 u32 suffix_seq_num;
1416};
1417
1418struct lldp_local_mib {
1419 u32 prefix_seq_num;
1420 u32 error;
1421#define DCBX_LOCAL_ETS_ERROR 0x00000001
1422#define DCBX_LOCAL_PFC_ERROR 0x00000002
1423#define DCBX_LOCAL_APP_ERROR 0x00000004
1424#define DCBX_LOCAL_PFC_MISMATCH 0x00000010
1425#define DCBX_LOCAL_APP_MISMATCH 0x00000020
1426 struct dcbx_features features;
1427 u32 suffix_seq_num;
1428};
1429/***END OF DCBX STRUCTURES DECLARATIONS***/
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001430
Eilon Greenstein2691d512009-08-12 08:22:08 +00001431struct shmem2_region {
1432
1433 u32 size;
1434
1435 u32 dcc_support;
1436#define SHMEM_DCC_SUPPORT_NONE 0x00000000
1437#define SHMEM_DCC_SUPPORT_DISABLE_ENABLE_PF_TLV 0x00000001
1438#define SHMEM_DCC_SUPPORT_BANDWIDTH_ALLOCATION_TLV 0x00000004
1439#define SHMEM_DCC_SUPPORT_CHANGE_MAC_ADDRESS_TLV 0x00000008
1440#define SHMEM_DCC_SUPPORT_SET_PROTOCOL_TLV 0x00000040
1441#define SHMEM_DCC_SUPPORT_SET_PRIORITY_TLV 0x00000080
1442#define SHMEM_DCC_SUPPORT_DEFAULT SHMEM_DCC_SUPPORT_NONE
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001443 u32 ext_phy_fw_version2[PORT_MAX];
1444 /*
1445 * For backwards compatibility, if the mf_cfg_addr does not exist
1446 * (the size filed is smaller than 0xc) the mf_cfg resides at the
1447 * end of struct shmem_region
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001448 */
1449 u32 mf_cfg_addr;
1450#define SHMEM_MF_CFG_ADDR_NONE 0x00000000
1451
1452 struct fw_flr_mb flr_mb;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001453 u32 dcbx_lldp_params_offset;
1454#define SHMEM_LLDP_DCBX_PARAMS_NONE 0x00000000
1455 u32 dcbx_neg_res_offset;
1456#define SHMEM_DCBX_NEG_RES_NONE 0x00000000
1457 u32 dcbx_remote_mib_offset;
1458#define SHMEM_DCBX_REMOTE_MIB_NONE 0x00000000
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001459 /*
1460 * The other shmemX_base_addr holds the other path's shmem address
1461 * required for example in case of common phy init, or for path1 to know
1462 * the address of mcp debug trace which is located in offset from shmem
1463 * of path0
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001464 */
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001465 u32 other_shmem_base_addr;
1466 u32 other_shmem2_base_addr;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001467 u32 reserved1[E2_VF_MAX / 32];
1468 u32 reserved2[E2_FUNC_MAX][E2_VF_MAX / 32];
1469 u32 dcbx_lldp_dcbx_stat_offset;
1470#define SHMEM_LLDP_DCBX_STAT_NONE 0x00000000
Eilon Greenstein2691d512009-08-12 08:22:08 +00001471};
1472
1473
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001474struct emac_stats {
1475 u32 rx_stat_ifhcinoctets;
1476 u32 rx_stat_ifhcinbadoctets;
1477 u32 rx_stat_etherstatsfragments;
1478 u32 rx_stat_ifhcinucastpkts;
1479 u32 rx_stat_ifhcinmulticastpkts;
1480 u32 rx_stat_ifhcinbroadcastpkts;
1481 u32 rx_stat_dot3statsfcserrors;
1482 u32 rx_stat_dot3statsalignmenterrors;
1483 u32 rx_stat_dot3statscarriersenseerrors;
1484 u32 rx_stat_xonpauseframesreceived;
1485 u32 rx_stat_xoffpauseframesreceived;
1486 u32 rx_stat_maccontrolframesreceived;
1487 u32 rx_stat_xoffstateentered;
1488 u32 rx_stat_dot3statsframestoolong;
1489 u32 rx_stat_etherstatsjabbers;
1490 u32 rx_stat_etherstatsundersizepkts;
1491 u32 rx_stat_etherstatspkts64octets;
1492 u32 rx_stat_etherstatspkts65octetsto127octets;
1493 u32 rx_stat_etherstatspkts128octetsto255octets;
1494 u32 rx_stat_etherstatspkts256octetsto511octets;
1495 u32 rx_stat_etherstatspkts512octetsto1023octets;
1496 u32 rx_stat_etherstatspkts1024octetsto1522octets;
1497 u32 rx_stat_etherstatspktsover1522octets;
1498
1499 u32 rx_stat_falsecarriererrors;
1500
1501 u32 tx_stat_ifhcoutoctets;
1502 u32 tx_stat_ifhcoutbadoctets;
1503 u32 tx_stat_etherstatscollisions;
1504 u32 tx_stat_outxonsent;
1505 u32 tx_stat_outxoffsent;
1506 u32 tx_stat_flowcontroldone;
1507 u32 tx_stat_dot3statssinglecollisionframes;
1508 u32 tx_stat_dot3statsmultiplecollisionframes;
1509 u32 tx_stat_dot3statsdeferredtransmissions;
1510 u32 tx_stat_dot3statsexcessivecollisions;
1511 u32 tx_stat_dot3statslatecollisions;
1512 u32 tx_stat_ifhcoutucastpkts;
1513 u32 tx_stat_ifhcoutmulticastpkts;
1514 u32 tx_stat_ifhcoutbroadcastpkts;
1515 u32 tx_stat_etherstatspkts64octets;
1516 u32 tx_stat_etherstatspkts65octetsto127octets;
1517 u32 tx_stat_etherstatspkts128octetsto255octets;
1518 u32 tx_stat_etherstatspkts256octetsto511octets;
1519 u32 tx_stat_etherstatspkts512octetsto1023octets;
1520 u32 tx_stat_etherstatspkts1024octetsto1522octets;
1521 u32 tx_stat_etherstatspktsover1522octets;
1522 u32 tx_stat_dot3statsinternalmactransmiterrors;
1523};
1524
1525
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001526struct bmac1_stats {
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001527 u32 tx_stat_gtpkt_lo;
1528 u32 tx_stat_gtpkt_hi;
1529 u32 tx_stat_gtxpf_lo;
1530 u32 tx_stat_gtxpf_hi;
1531 u32 tx_stat_gtfcs_lo;
1532 u32 tx_stat_gtfcs_hi;
1533 u32 tx_stat_gtmca_lo;
1534 u32 tx_stat_gtmca_hi;
1535 u32 tx_stat_gtbca_lo;
1536 u32 tx_stat_gtbca_hi;
1537 u32 tx_stat_gtfrg_lo;
1538 u32 tx_stat_gtfrg_hi;
1539 u32 tx_stat_gtovr_lo;
1540 u32 tx_stat_gtovr_hi;
1541 u32 tx_stat_gt64_lo;
1542 u32 tx_stat_gt64_hi;
1543 u32 tx_stat_gt127_lo;
1544 u32 tx_stat_gt127_hi;
1545 u32 tx_stat_gt255_lo;
1546 u32 tx_stat_gt255_hi;
1547 u32 tx_stat_gt511_lo;
1548 u32 tx_stat_gt511_hi;
1549 u32 tx_stat_gt1023_lo;
1550 u32 tx_stat_gt1023_hi;
1551 u32 tx_stat_gt1518_lo;
1552 u32 tx_stat_gt1518_hi;
1553 u32 tx_stat_gt2047_lo;
1554 u32 tx_stat_gt2047_hi;
1555 u32 tx_stat_gt4095_lo;
1556 u32 tx_stat_gt4095_hi;
1557 u32 tx_stat_gt9216_lo;
1558 u32 tx_stat_gt9216_hi;
1559 u32 tx_stat_gt16383_lo;
1560 u32 tx_stat_gt16383_hi;
1561 u32 tx_stat_gtmax_lo;
1562 u32 tx_stat_gtmax_hi;
1563 u32 tx_stat_gtufl_lo;
1564 u32 tx_stat_gtufl_hi;
1565 u32 tx_stat_gterr_lo;
1566 u32 tx_stat_gterr_hi;
1567 u32 tx_stat_gtbyt_lo;
1568 u32 tx_stat_gtbyt_hi;
1569
1570 u32 rx_stat_gr64_lo;
1571 u32 rx_stat_gr64_hi;
1572 u32 rx_stat_gr127_lo;
1573 u32 rx_stat_gr127_hi;
1574 u32 rx_stat_gr255_lo;
1575 u32 rx_stat_gr255_hi;
1576 u32 rx_stat_gr511_lo;
1577 u32 rx_stat_gr511_hi;
1578 u32 rx_stat_gr1023_lo;
1579 u32 rx_stat_gr1023_hi;
1580 u32 rx_stat_gr1518_lo;
1581 u32 rx_stat_gr1518_hi;
1582 u32 rx_stat_gr2047_lo;
1583 u32 rx_stat_gr2047_hi;
1584 u32 rx_stat_gr4095_lo;
1585 u32 rx_stat_gr4095_hi;
1586 u32 rx_stat_gr9216_lo;
1587 u32 rx_stat_gr9216_hi;
1588 u32 rx_stat_gr16383_lo;
1589 u32 rx_stat_gr16383_hi;
1590 u32 rx_stat_grmax_lo;
1591 u32 rx_stat_grmax_hi;
1592 u32 rx_stat_grpkt_lo;
1593 u32 rx_stat_grpkt_hi;
1594 u32 rx_stat_grfcs_lo;
1595 u32 rx_stat_grfcs_hi;
1596 u32 rx_stat_grmca_lo;
1597 u32 rx_stat_grmca_hi;
1598 u32 rx_stat_grbca_lo;
1599 u32 rx_stat_grbca_hi;
1600 u32 rx_stat_grxcf_lo;
1601 u32 rx_stat_grxcf_hi;
1602 u32 rx_stat_grxpf_lo;
1603 u32 rx_stat_grxpf_hi;
1604 u32 rx_stat_grxuo_lo;
1605 u32 rx_stat_grxuo_hi;
1606 u32 rx_stat_grjbr_lo;
1607 u32 rx_stat_grjbr_hi;
1608 u32 rx_stat_grovr_lo;
1609 u32 rx_stat_grovr_hi;
1610 u32 rx_stat_grflr_lo;
1611 u32 rx_stat_grflr_hi;
1612 u32 rx_stat_grmeg_lo;
1613 u32 rx_stat_grmeg_hi;
1614 u32 rx_stat_grmeb_lo;
1615 u32 rx_stat_grmeb_hi;
1616 u32 rx_stat_grbyt_lo;
1617 u32 rx_stat_grbyt_hi;
1618 u32 rx_stat_grund_lo;
1619 u32 rx_stat_grund_hi;
1620 u32 rx_stat_grfrg_lo;
1621 u32 rx_stat_grfrg_hi;
1622 u32 rx_stat_grerb_lo;
1623 u32 rx_stat_grerb_hi;
1624 u32 rx_stat_grfre_lo;
1625 u32 rx_stat_grfre_hi;
1626 u32 rx_stat_gripj_lo;
1627 u32 rx_stat_gripj_hi;
1628};
1629
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001630struct bmac2_stats {
1631 u32 tx_stat_gtpk_lo; /* gtpok */
1632 u32 tx_stat_gtpk_hi; /* gtpok */
1633 u32 tx_stat_gtxpf_lo; /* gtpf */
1634 u32 tx_stat_gtxpf_hi; /* gtpf */
1635 u32 tx_stat_gtpp_lo; /* NEW BMAC2 */
1636 u32 tx_stat_gtpp_hi; /* NEW BMAC2 */
1637 u32 tx_stat_gtfcs_lo;
1638 u32 tx_stat_gtfcs_hi;
1639 u32 tx_stat_gtuca_lo; /* NEW BMAC2 */
1640 u32 tx_stat_gtuca_hi; /* NEW BMAC2 */
1641 u32 tx_stat_gtmca_lo;
1642 u32 tx_stat_gtmca_hi;
1643 u32 tx_stat_gtbca_lo;
1644 u32 tx_stat_gtbca_hi;
1645 u32 tx_stat_gtovr_lo;
1646 u32 tx_stat_gtovr_hi;
1647 u32 tx_stat_gtfrg_lo;
1648 u32 tx_stat_gtfrg_hi;
1649 u32 tx_stat_gtpkt1_lo; /* gtpkt */
1650 u32 tx_stat_gtpkt1_hi; /* gtpkt */
1651 u32 tx_stat_gt64_lo;
1652 u32 tx_stat_gt64_hi;
1653 u32 tx_stat_gt127_lo;
1654 u32 tx_stat_gt127_hi;
1655 u32 tx_stat_gt255_lo;
1656 u32 tx_stat_gt255_hi;
1657 u32 tx_stat_gt511_lo;
1658 u32 tx_stat_gt511_hi;
1659 u32 tx_stat_gt1023_lo;
1660 u32 tx_stat_gt1023_hi;
1661 u32 tx_stat_gt1518_lo;
1662 u32 tx_stat_gt1518_hi;
1663 u32 tx_stat_gt2047_lo;
1664 u32 tx_stat_gt2047_hi;
1665 u32 tx_stat_gt4095_lo;
1666 u32 tx_stat_gt4095_hi;
1667 u32 tx_stat_gt9216_lo;
1668 u32 tx_stat_gt9216_hi;
1669 u32 tx_stat_gt16383_lo;
1670 u32 tx_stat_gt16383_hi;
1671 u32 tx_stat_gtmax_lo;
1672 u32 tx_stat_gtmax_hi;
1673 u32 tx_stat_gtufl_lo;
1674 u32 tx_stat_gtufl_hi;
1675 u32 tx_stat_gterr_lo;
1676 u32 tx_stat_gterr_hi;
1677 u32 tx_stat_gtbyt_lo;
1678 u32 tx_stat_gtbyt_hi;
1679
1680 u32 rx_stat_gr64_lo;
1681 u32 rx_stat_gr64_hi;
1682 u32 rx_stat_gr127_lo;
1683 u32 rx_stat_gr127_hi;
1684 u32 rx_stat_gr255_lo;
1685 u32 rx_stat_gr255_hi;
1686 u32 rx_stat_gr511_lo;
1687 u32 rx_stat_gr511_hi;
1688 u32 rx_stat_gr1023_lo;
1689 u32 rx_stat_gr1023_hi;
1690 u32 rx_stat_gr1518_lo;
1691 u32 rx_stat_gr1518_hi;
1692 u32 rx_stat_gr2047_lo;
1693 u32 rx_stat_gr2047_hi;
1694 u32 rx_stat_gr4095_lo;
1695 u32 rx_stat_gr4095_hi;
1696 u32 rx_stat_gr9216_lo;
1697 u32 rx_stat_gr9216_hi;
1698 u32 rx_stat_gr16383_lo;
1699 u32 rx_stat_gr16383_hi;
1700 u32 rx_stat_grmax_lo;
1701 u32 rx_stat_grmax_hi;
1702 u32 rx_stat_grpkt_lo;
1703 u32 rx_stat_grpkt_hi;
1704 u32 rx_stat_grfcs_lo;
1705 u32 rx_stat_grfcs_hi;
1706 u32 rx_stat_gruca_lo;
1707 u32 rx_stat_gruca_hi;
1708 u32 rx_stat_grmca_lo;
1709 u32 rx_stat_grmca_hi;
1710 u32 rx_stat_grbca_lo;
1711 u32 rx_stat_grbca_hi;
1712 u32 rx_stat_grxpf_lo; /* grpf */
1713 u32 rx_stat_grxpf_hi; /* grpf */
1714 u32 rx_stat_grpp_lo;
1715 u32 rx_stat_grpp_hi;
1716 u32 rx_stat_grxuo_lo; /* gruo */
1717 u32 rx_stat_grxuo_hi; /* gruo */
1718 u32 rx_stat_grjbr_lo;
1719 u32 rx_stat_grjbr_hi;
1720 u32 rx_stat_grovr_lo;
1721 u32 rx_stat_grovr_hi;
1722 u32 rx_stat_grxcf_lo; /* grcf */
1723 u32 rx_stat_grxcf_hi; /* grcf */
1724 u32 rx_stat_grflr_lo;
1725 u32 rx_stat_grflr_hi;
1726 u32 rx_stat_grpok_lo;
1727 u32 rx_stat_grpok_hi;
1728 u32 rx_stat_grmeg_lo;
1729 u32 rx_stat_grmeg_hi;
1730 u32 rx_stat_grmeb_lo;
1731 u32 rx_stat_grmeb_hi;
1732 u32 rx_stat_grbyt_lo;
1733 u32 rx_stat_grbyt_hi;
1734 u32 rx_stat_grund_lo;
1735 u32 rx_stat_grund_hi;
1736 u32 rx_stat_grfrg_lo;
1737 u32 rx_stat_grfrg_hi;
1738 u32 rx_stat_grerb_lo; /* grerrbyt */
1739 u32 rx_stat_grerb_hi; /* grerrbyt */
1740 u32 rx_stat_grfre_lo; /* grfrerr */
1741 u32 rx_stat_grfre_hi; /* grfrerr */
1742 u32 rx_stat_gripj_lo;
1743 u32 rx_stat_gripj_hi;
1744};
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001745
1746union mac_stats {
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001747 struct emac_stats emac_stats;
1748 struct bmac1_stats bmac1_stats;
1749 struct bmac2_stats bmac2_stats;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001750};
1751
1752
1753struct mac_stx {
1754 /* in_bad_octets */
1755 u32 rx_stat_ifhcinbadoctets_hi;
1756 u32 rx_stat_ifhcinbadoctets_lo;
1757
1758 /* out_bad_octets */
1759 u32 tx_stat_ifhcoutbadoctets_hi;
1760 u32 tx_stat_ifhcoutbadoctets_lo;
1761
1762 /* crc_receive_errors */
1763 u32 rx_stat_dot3statsfcserrors_hi;
1764 u32 rx_stat_dot3statsfcserrors_lo;
1765 /* alignment_errors */
1766 u32 rx_stat_dot3statsalignmenterrors_hi;
1767 u32 rx_stat_dot3statsalignmenterrors_lo;
1768 /* carrier_sense_errors */
1769 u32 rx_stat_dot3statscarriersenseerrors_hi;
1770 u32 rx_stat_dot3statscarriersenseerrors_lo;
1771 /* false_carrier_detections */
1772 u32 rx_stat_falsecarriererrors_hi;
1773 u32 rx_stat_falsecarriererrors_lo;
1774
1775 /* runt_packets_received */
1776 u32 rx_stat_etherstatsundersizepkts_hi;
1777 u32 rx_stat_etherstatsundersizepkts_lo;
1778 /* jabber_packets_received */
1779 u32 rx_stat_dot3statsframestoolong_hi;
1780 u32 rx_stat_dot3statsframestoolong_lo;
1781
1782 /* error_runt_packets_received */
1783 u32 rx_stat_etherstatsfragments_hi;
1784 u32 rx_stat_etherstatsfragments_lo;
1785 /* error_jabber_packets_received */
1786 u32 rx_stat_etherstatsjabbers_hi;
1787 u32 rx_stat_etherstatsjabbers_lo;
1788
1789 /* control_frames_received */
1790 u32 rx_stat_maccontrolframesreceived_hi;
1791 u32 rx_stat_maccontrolframesreceived_lo;
1792 u32 rx_stat_bmac_xpf_hi;
1793 u32 rx_stat_bmac_xpf_lo;
1794 u32 rx_stat_bmac_xcf_hi;
1795 u32 rx_stat_bmac_xcf_lo;
1796
1797 /* xoff_state_entered */
1798 u32 rx_stat_xoffstateentered_hi;
1799 u32 rx_stat_xoffstateentered_lo;
1800 /* pause_xon_frames_received */
1801 u32 rx_stat_xonpauseframesreceived_hi;
1802 u32 rx_stat_xonpauseframesreceived_lo;
1803 /* pause_xoff_frames_received */
1804 u32 rx_stat_xoffpauseframesreceived_hi;
1805 u32 rx_stat_xoffpauseframesreceived_lo;
1806 /* pause_xon_frames_transmitted */
1807 u32 tx_stat_outxonsent_hi;
1808 u32 tx_stat_outxonsent_lo;
1809 /* pause_xoff_frames_transmitted */
1810 u32 tx_stat_outxoffsent_hi;
1811 u32 tx_stat_outxoffsent_lo;
1812 /* flow_control_done */
1813 u32 tx_stat_flowcontroldone_hi;
1814 u32 tx_stat_flowcontroldone_lo;
1815
1816 /* ether_stats_collisions */
1817 u32 tx_stat_etherstatscollisions_hi;
1818 u32 tx_stat_etherstatscollisions_lo;
1819 /* single_collision_transmit_frames */
1820 u32 tx_stat_dot3statssinglecollisionframes_hi;
1821 u32 tx_stat_dot3statssinglecollisionframes_lo;
1822 /* multiple_collision_transmit_frames */
1823 u32 tx_stat_dot3statsmultiplecollisionframes_hi;
1824 u32 tx_stat_dot3statsmultiplecollisionframes_lo;
1825 /* deferred_transmissions */
1826 u32 tx_stat_dot3statsdeferredtransmissions_hi;
1827 u32 tx_stat_dot3statsdeferredtransmissions_lo;
1828 /* excessive_collision_frames */
1829 u32 tx_stat_dot3statsexcessivecollisions_hi;
1830 u32 tx_stat_dot3statsexcessivecollisions_lo;
1831 /* late_collision_frames */
1832 u32 tx_stat_dot3statslatecollisions_hi;
1833 u32 tx_stat_dot3statslatecollisions_lo;
1834
1835 /* frames_transmitted_64_bytes */
1836 u32 tx_stat_etherstatspkts64octets_hi;
1837 u32 tx_stat_etherstatspkts64octets_lo;
1838 /* frames_transmitted_65_127_bytes */
1839 u32 tx_stat_etherstatspkts65octetsto127octets_hi;
1840 u32 tx_stat_etherstatspkts65octetsto127octets_lo;
1841 /* frames_transmitted_128_255_bytes */
1842 u32 tx_stat_etherstatspkts128octetsto255octets_hi;
1843 u32 tx_stat_etherstatspkts128octetsto255octets_lo;
1844 /* frames_transmitted_256_511_bytes */
1845 u32 tx_stat_etherstatspkts256octetsto511octets_hi;
1846 u32 tx_stat_etherstatspkts256octetsto511octets_lo;
1847 /* frames_transmitted_512_1023_bytes */
1848 u32 tx_stat_etherstatspkts512octetsto1023octets_hi;
1849 u32 tx_stat_etherstatspkts512octetsto1023octets_lo;
1850 /* frames_transmitted_1024_1522_bytes */
1851 u32 tx_stat_etherstatspkts1024octetsto1522octets_hi;
1852 u32 tx_stat_etherstatspkts1024octetsto1522octets_lo;
1853 /* frames_transmitted_1523_9022_bytes */
1854 u32 tx_stat_etherstatspktsover1522octets_hi;
1855 u32 tx_stat_etherstatspktsover1522octets_lo;
1856 u32 tx_stat_bmac_2047_hi;
1857 u32 tx_stat_bmac_2047_lo;
1858 u32 tx_stat_bmac_4095_hi;
1859 u32 tx_stat_bmac_4095_lo;
1860 u32 tx_stat_bmac_9216_hi;
1861 u32 tx_stat_bmac_9216_lo;
1862 u32 tx_stat_bmac_16383_hi;
1863 u32 tx_stat_bmac_16383_lo;
1864
1865 /* internal_mac_transmit_errors */
1866 u32 tx_stat_dot3statsinternalmactransmiterrors_hi;
1867 u32 tx_stat_dot3statsinternalmactransmiterrors_lo;
1868
1869 /* if_out_discards */
1870 u32 tx_stat_bmac_ufl_hi;
1871 u32 tx_stat_bmac_ufl_lo;
1872};
1873
1874
1875#define MAC_STX_IDX_MAX 2
1876
1877struct host_port_stats {
1878 u32 host_port_stats_start;
1879
1880 struct mac_stx mac_stx[MAC_STX_IDX_MAX];
1881
1882 u32 brb_drop_hi;
1883 u32 brb_drop_lo;
1884
1885 u32 host_port_stats_end;
1886};
1887
1888
1889struct host_func_stats {
1890 u32 host_func_stats_start;
1891
1892 u32 total_bytes_received_hi;
1893 u32 total_bytes_received_lo;
1894
1895 u32 total_bytes_transmitted_hi;
1896 u32 total_bytes_transmitted_lo;
1897
1898 u32 total_unicast_packets_received_hi;
1899 u32 total_unicast_packets_received_lo;
1900
1901 u32 total_multicast_packets_received_hi;
1902 u32 total_multicast_packets_received_lo;
1903
1904 u32 total_broadcast_packets_received_hi;
1905 u32 total_broadcast_packets_received_lo;
1906
1907 u32 total_unicast_packets_transmitted_hi;
1908 u32 total_unicast_packets_transmitted_lo;
1909
1910 u32 total_multicast_packets_transmitted_hi;
1911 u32 total_multicast_packets_transmitted_lo;
1912
1913 u32 total_broadcast_packets_transmitted_hi;
1914 u32 total_broadcast_packets_transmitted_lo;
1915
1916 u32 valid_bytes_received_hi;
1917 u32 valid_bytes_received_lo;
1918
1919 u32 host_func_stats_end;
1920};
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001921
1922
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001923#define BCM_5710_FW_MAJOR_VERSION 6
Vladislav Zolotarov5928c8b2010-12-13 05:44:35 +00001924#define BCM_5710_FW_MINOR_VERSION 2
1925#define BCM_5710_FW_REVISION_VERSION 5
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001926#define BCM_5710_FW_ENGINEERING_VERSION 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001927#define BCM_5710_FW_COMPILE_FLAGS 1
1928
1929
1930/*
1931 * attention bits
1932 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001933struct atten_sp_status_block {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00001934 __le32 attn_bits;
1935 __le32 attn_bits_ack;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001936 u8 status_block_id;
1937 u8 reserved0;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00001938 __le16 attn_bits_index;
1939 __le32 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001940};
1941
1942
1943/*
1944 * common data for all protocols
1945 */
1946struct doorbell_hdr {
1947 u8 header;
1948#define DOORBELL_HDR_RX (0x1<<0)
1949#define DOORBELL_HDR_RX_SHIFT 0
1950#define DOORBELL_HDR_DB_TYPE (0x1<<1)
1951#define DOORBELL_HDR_DB_TYPE_SHIFT 1
1952#define DOORBELL_HDR_DPM_SIZE (0x3<<2)
1953#define DOORBELL_HDR_DPM_SIZE_SHIFT 2
1954#define DOORBELL_HDR_CONN_TYPE (0xF<<4)
1955#define DOORBELL_HDR_CONN_TYPE_SHIFT 4
1956};
1957
1958/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001959 * doorbell message sent to the chip
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001960 */
1961struct doorbell {
1962#if defined(__BIG_ENDIAN)
1963 u16 zero_fill2;
1964 u8 zero_fill1;
1965 struct doorbell_hdr header;
1966#elif defined(__LITTLE_ENDIAN)
1967 struct doorbell_hdr header;
1968 u8 zero_fill1;
1969 u16 zero_fill2;
1970#endif
1971};
1972
1973
1974/*
Eilon Greensteinca003922009-08-12 22:53:28 -07001975 * doorbell message sent to the chip
1976 */
1977struct doorbell_set_prod {
1978#if defined(__BIG_ENDIAN)
1979 u16 prod;
1980 u8 zero_fill1;
1981 struct doorbell_hdr header;
1982#elif defined(__LITTLE_ENDIAN)
1983 struct doorbell_hdr header;
1984 u8 zero_fill1;
1985 u16 prod;
1986#endif
1987};
1988
1989
1990/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001991 * 3 lines. status block
1992 */
1993struct hc_status_block_e1x {
1994 __le16 index_values[HC_SB_MAX_INDICES_E1X];
1995 __le16 running_index[HC_SB_MAX_SM];
1996 u32 rsrv;
1997};
1998
1999/*
2000 * host status block
2001 */
2002struct host_hc_status_block_e1x {
2003 struct hc_status_block_e1x sb;
2004};
2005
2006
2007/*
2008 * 3 lines. status block
2009 */
2010struct hc_status_block_e2 {
2011 __le16 index_values[HC_SB_MAX_INDICES_E2];
2012 __le16 running_index[HC_SB_MAX_SM];
2013 u32 reserved;
2014};
2015
2016/*
2017 * host status block
2018 */
2019struct host_hc_status_block_e2 {
2020 struct hc_status_block_e2 sb;
2021};
2022
2023
2024/*
2025 * 5 lines. slow-path status block
2026 */
2027struct hc_sp_status_block {
2028 __le16 index_values[HC_SP_SB_MAX_INDICES];
2029 __le16 running_index;
2030 __le16 rsrv;
2031 u32 rsrv1;
2032};
2033
2034/*
2035 * host status block
2036 */
2037struct host_sp_status_block {
2038 struct atten_sp_status_block atten_status_block;
2039 struct hc_sp_status_block sp_sb;
2040};
2041
2042
2043/*
2044 * IGU driver acknowledgment register
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002045 */
2046struct igu_ack_register {
2047#if defined(__BIG_ENDIAN)
2048 u16 sb_id_and_flags;
2049#define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
2050#define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
2051#define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
2052#define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
2053#define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
2054#define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
2055#define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
2056#define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
2057#define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
2058#define IGU_ACK_REGISTER_RESERVED_SHIFT 11
2059 u16 status_block_index;
2060#elif defined(__LITTLE_ENDIAN)
2061 u16 status_block_index;
2062 u16 sb_id_and_flags;
2063#define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
2064#define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
2065#define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
2066#define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
2067#define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
2068#define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
2069#define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
2070#define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
2071#define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
2072#define IGU_ACK_REGISTER_RESERVED_SHIFT 11
2073#endif
2074};
2075
2076
2077/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002078 * IGU driver acknowledgement register
2079 */
2080struct igu_backward_compatible {
2081 u32 sb_id_and_flags;
2082#define IGU_BACKWARD_COMPATIBLE_SB_INDEX (0xFFFF<<0)
2083#define IGU_BACKWARD_COMPATIBLE_SB_INDEX_SHIFT 0
2084#define IGU_BACKWARD_COMPATIBLE_SB_SELECT (0x1F<<16)
2085#define IGU_BACKWARD_COMPATIBLE_SB_SELECT_SHIFT 16
2086#define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS (0x7<<21)
2087#define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS_SHIFT 21
2088#define IGU_BACKWARD_COMPATIBLE_BUPDATE (0x1<<24)
2089#define IGU_BACKWARD_COMPATIBLE_BUPDATE_SHIFT 24
2090#define IGU_BACKWARD_COMPATIBLE_ENABLE_INT (0x3<<25)
2091#define IGU_BACKWARD_COMPATIBLE_ENABLE_INT_SHIFT 25
2092#define IGU_BACKWARD_COMPATIBLE_RESERVED_0 (0x1F<<27)
2093#define IGU_BACKWARD_COMPATIBLE_RESERVED_0_SHIFT 27
2094 u32 reserved_2;
2095};
2096
2097
2098/*
2099 * IGU driver acknowledgement register
2100 */
2101struct igu_regular {
2102 u32 sb_id_and_flags;
2103#define IGU_REGULAR_SB_INDEX (0xFFFFF<<0)
2104#define IGU_REGULAR_SB_INDEX_SHIFT 0
2105#define IGU_REGULAR_RESERVED0 (0x1<<20)
2106#define IGU_REGULAR_RESERVED0_SHIFT 20
2107#define IGU_REGULAR_SEGMENT_ACCESS (0x7<<21)
2108#define IGU_REGULAR_SEGMENT_ACCESS_SHIFT 21
2109#define IGU_REGULAR_BUPDATE (0x1<<24)
2110#define IGU_REGULAR_BUPDATE_SHIFT 24
2111#define IGU_REGULAR_ENABLE_INT (0x3<<25)
2112#define IGU_REGULAR_ENABLE_INT_SHIFT 25
2113#define IGU_REGULAR_RESERVED_1 (0x1<<27)
2114#define IGU_REGULAR_RESERVED_1_SHIFT 27
2115#define IGU_REGULAR_CLEANUP_TYPE (0x3<<28)
2116#define IGU_REGULAR_CLEANUP_TYPE_SHIFT 28
2117#define IGU_REGULAR_CLEANUP_SET (0x1<<30)
2118#define IGU_REGULAR_CLEANUP_SET_SHIFT 30
2119#define IGU_REGULAR_BCLEANUP (0x1<<31)
2120#define IGU_REGULAR_BCLEANUP_SHIFT 31
2121 u32 reserved_2;
2122};
2123
2124/*
2125 * IGU driver acknowledgement register
2126 */
2127union igu_consprod_reg {
2128 struct igu_regular regular;
2129 struct igu_backward_compatible backward_compatible;
2130};
2131
2132
2133/*
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002134 * Control register for the IGU command register
2135 */
2136struct igu_ctrl_reg {
2137 u32 ctrl_data;
2138#define IGU_CTRL_REG_ADDRESS (0xFFF<<0)
2139#define IGU_CTRL_REG_ADDRESS_SHIFT 0
2140#define IGU_CTRL_REG_FID (0x7F<<12)
2141#define IGU_CTRL_REG_FID_SHIFT 12
2142#define IGU_CTRL_REG_RESERVED (0x1<<19)
2143#define IGU_CTRL_REG_RESERVED_SHIFT 19
2144#define IGU_CTRL_REG_TYPE (0x1<<20)
2145#define IGU_CTRL_REG_TYPE_SHIFT 20
2146#define IGU_CTRL_REG_UNUSED (0x7FF<<21)
2147#define IGU_CTRL_REG_UNUSED_SHIFT 21
2148};
2149
2150
2151/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002152 * Parser parsing flags field
2153 */
2154struct parsing_flags {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002155 __le16 flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002156#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0)
2157#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002158#define PARSING_FLAGS_VLAN (0x1<<1)
2159#define PARSING_FLAGS_VLAN_SHIFT 1
2160#define PARSING_FLAGS_EXTRA_VLAN (0x1<<2)
2161#define PARSING_FLAGS_EXTRA_VLAN_SHIFT 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002162#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL (0x3<<3)
2163#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT 3
2164#define PARSING_FLAGS_IP_OPTIONS (0x1<<5)
2165#define PARSING_FLAGS_IP_OPTIONS_SHIFT 5
2166#define PARSING_FLAGS_FRAGMENTATION_STATUS (0x1<<6)
2167#define PARSING_FLAGS_FRAGMENTATION_STATUS_SHIFT 6
2168#define PARSING_FLAGS_OVER_IP_PROTOCOL (0x3<<7)
2169#define PARSING_FLAGS_OVER_IP_PROTOCOL_SHIFT 7
2170#define PARSING_FLAGS_PURE_ACK_INDICATION (0x1<<9)
2171#define PARSING_FLAGS_PURE_ACK_INDICATION_SHIFT 9
2172#define PARSING_FLAGS_TCP_OPTIONS_EXIST (0x1<<10)
2173#define PARSING_FLAGS_TCP_OPTIONS_EXIST_SHIFT 10
2174#define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG (0x1<<11)
2175#define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG_SHIFT 11
2176#define PARSING_FLAGS_CONNECTION_MATCH (0x1<<12)
2177#define PARSING_FLAGS_CONNECTION_MATCH_SHIFT 12
2178#define PARSING_FLAGS_LLC_SNAP (0x1<<13)
2179#define PARSING_FLAGS_LLC_SNAP_SHIFT 13
2180#define PARSING_FLAGS_RESERVED0 (0x3<<14)
2181#define PARSING_FLAGS_RESERVED0_SHIFT 14
2182};
2183
2184
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002185struct regpair {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002186 __le32 lo;
2187 __le32 hi;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002188};
2189
2190
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002191/*
2192 * dmae command structure
2193 */
2194struct dmae_command {
2195 u32 opcode;
2196#define DMAE_COMMAND_SRC (0x1<<0)
2197#define DMAE_COMMAND_SRC_SHIFT 0
2198#define DMAE_COMMAND_DST (0x3<<1)
2199#define DMAE_COMMAND_DST_SHIFT 1
2200#define DMAE_COMMAND_C_DST (0x1<<3)
2201#define DMAE_COMMAND_C_DST_SHIFT 3
2202#define DMAE_COMMAND_C_TYPE_ENABLE (0x1<<4)
2203#define DMAE_COMMAND_C_TYPE_ENABLE_SHIFT 4
2204#define DMAE_COMMAND_C_TYPE_CRC_ENABLE (0x1<<5)
2205#define DMAE_COMMAND_C_TYPE_CRC_ENABLE_SHIFT 5
2206#define DMAE_COMMAND_C_TYPE_CRC_OFFSET (0x7<<6)
2207#define DMAE_COMMAND_C_TYPE_CRC_OFFSET_SHIFT 6
2208#define DMAE_COMMAND_ENDIANITY (0x3<<9)
2209#define DMAE_COMMAND_ENDIANITY_SHIFT 9
2210#define DMAE_COMMAND_PORT (0x1<<11)
2211#define DMAE_COMMAND_PORT_SHIFT 11
2212#define DMAE_COMMAND_CRC_RESET (0x1<<12)
2213#define DMAE_COMMAND_CRC_RESET_SHIFT 12
2214#define DMAE_COMMAND_SRC_RESET (0x1<<13)
2215#define DMAE_COMMAND_SRC_RESET_SHIFT 13
2216#define DMAE_COMMAND_DST_RESET (0x1<<14)
2217#define DMAE_COMMAND_DST_RESET_SHIFT 14
Eilon Greensteinad8d3942008-06-23 20:29:02 -07002218#define DMAE_COMMAND_E1HVN (0x3<<15)
2219#define DMAE_COMMAND_E1HVN_SHIFT 15
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002220#define DMAE_COMMAND_DST_VN (0x3<<17)
2221#define DMAE_COMMAND_DST_VN_SHIFT 17
2222#define DMAE_COMMAND_C_FUNC (0x1<<19)
2223#define DMAE_COMMAND_C_FUNC_SHIFT 19
2224#define DMAE_COMMAND_ERR_POLICY (0x3<<20)
2225#define DMAE_COMMAND_ERR_POLICY_SHIFT 20
2226#define DMAE_COMMAND_RESERVED0 (0x3FF<<22)
2227#define DMAE_COMMAND_RESERVED0_SHIFT 22
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002228 u32 src_addr_lo;
2229 u32 src_addr_hi;
2230 u32 dst_addr_lo;
2231 u32 dst_addr_hi;
2232#if defined(__BIG_ENDIAN)
2233 u16 reserved1;
2234 u16 len;
2235#elif defined(__LITTLE_ENDIAN)
2236 u16 len;
2237 u16 reserved1;
2238#endif
2239 u32 comp_addr_lo;
2240 u32 comp_addr_hi;
2241 u32 comp_val;
2242 u32 crc32;
2243 u32 crc32_c;
2244#if defined(__BIG_ENDIAN)
2245 u16 crc16_c;
2246 u16 crc16;
2247#elif defined(__LITTLE_ENDIAN)
2248 u16 crc16;
2249 u16 crc16_c;
2250#endif
2251#if defined(__BIG_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002252 u16 reserved3;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002253 u16 crc_t10;
2254#elif defined(__LITTLE_ENDIAN)
2255 u16 crc_t10;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002256 u16 reserved3;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002257#endif
2258#if defined(__BIG_ENDIAN)
2259 u16 xsum8;
2260 u16 xsum16;
2261#elif defined(__LITTLE_ENDIAN)
2262 u16 xsum16;
2263 u16 xsum8;
2264#endif
2265};
2266
2267
2268struct double_regpair {
2269 u32 regpair0_lo;
2270 u32 regpair0_hi;
2271 u32 regpair1_lo;
2272 u32 regpair1_hi;
2273};
2274
2275
2276/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002277 * SDM operation gen command (generate aggregative interrupt)
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002278 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002279struct sdm_op_gen {
2280 __le32 command;
2281#define SDM_OP_GEN_COMP_PARAM (0x1F<<0)
2282#define SDM_OP_GEN_COMP_PARAM_SHIFT 0
2283#define SDM_OP_GEN_COMP_TYPE (0x7<<5)
2284#define SDM_OP_GEN_COMP_TYPE_SHIFT 5
2285#define SDM_OP_GEN_AGG_VECT_IDX (0xFF<<8)
2286#define SDM_OP_GEN_AGG_VECT_IDX_SHIFT 8
2287#define SDM_OP_GEN_AGG_VECT_IDX_VALID (0x1<<16)
2288#define SDM_OP_GEN_AGG_VECT_IDX_VALID_SHIFT 16
2289#define SDM_OP_GEN_RESERVED (0x7FFF<<17)
2290#define SDM_OP_GEN_RESERVED_SHIFT 17
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002291};
2292
2293/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002294 * The eth Rx Buffer Descriptor
2295 */
2296struct eth_rx_bd {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002297 __le32 addr_lo;
2298 __le32 addr_hi;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002299};
2300
2301/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002302 * The eth Rx SGE Descriptor
2303 */
2304struct eth_rx_sge {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002305 __le32 addr_lo;
2306 __le32 addr_hi;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002307};
2308
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002309
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002310
2311/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002312 * The eth storm context of Ustorm
2313 */
2314struct ustorm_eth_st_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002315 u32 reserved0[48];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002316};
2317
2318/*
2319 * The eth storm context of Tstorm
2320 */
2321struct tstorm_eth_st_context {
2322 u32 __reserved0[28];
2323};
2324
2325/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002326 * The eth aggregative context of Xstorm
2327 */
2328struct xstorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002329 u32 reserved0;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002330#if defined(__BIG_ENDIAN)
2331 u8 cdu_reserved;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002332 u8 reserved2;
2333 u16 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002334#elif defined(__LITTLE_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002335 u16 reserved1;
2336 u8 reserved2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002337 u8 cdu_reserved;
2338#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002339 u32 reserved3[30];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002340};
2341
2342/*
2343 * The eth aggregative context of Tstorm
2344 */
2345struct tstorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002346 u32 __reserved0[14];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002347};
2348
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002349
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002350/*
2351 * The eth aggregative context of Cstorm
2352 */
2353struct cstorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002354 u32 __reserved0[10];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002355};
2356
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002357
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002358/*
2359 * The eth aggregative context of Ustorm
2360 */
2361struct ustorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002362 u32 __reserved0;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002363#if defined(__BIG_ENDIAN)
2364 u8 cdu_usage;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002365 u8 __reserved2;
2366 u16 __reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002367#elif defined(__LITTLE_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002368 u16 __reserved1;
2369 u8 __reserved2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002370 u8 cdu_usage;
2371#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002372 u32 __reserved3[6];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002373};
2374
2375/*
2376 * Timers connection context
2377 */
2378struct timers_block_context {
2379 u32 __reserved_0;
2380 u32 __reserved_1;
2381 u32 __reserved_2;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002382 u32 flags;
2383#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS (0x3<<0)
2384#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS_SHIFT 0
2385#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG (0x1<<2)
2386#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG_SHIFT 2
2387#define __TIMERS_BLOCK_CONTEXT_RESERVED0 (0x1FFFFFFF<<3)
2388#define __TIMERS_BLOCK_CONTEXT_RESERVED0_SHIFT 3
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002389};
2390
2391/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002392 * structure for easy accessibility to assembler
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002393 */
2394struct eth_tx_bd_flags {
2395 u8 as_bitfield;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002396#define ETH_TX_BD_FLAGS_IP_CSUM (0x1<<0)
2397#define ETH_TX_BD_FLAGS_IP_CSUM_SHIFT 0
2398#define ETH_TX_BD_FLAGS_L4_CSUM (0x1<<1)
2399#define ETH_TX_BD_FLAGS_L4_CSUM_SHIFT 1
2400#define ETH_TX_BD_FLAGS_VLAN_MODE (0x3<<2)
2401#define ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002402#define ETH_TX_BD_FLAGS_START_BD (0x1<<4)
2403#define ETH_TX_BD_FLAGS_START_BD_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002404#define ETH_TX_BD_FLAGS_IS_UDP (0x1<<5)
2405#define ETH_TX_BD_FLAGS_IS_UDP_SHIFT 5
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002406#define ETH_TX_BD_FLAGS_SW_LSO (0x1<<6)
2407#define ETH_TX_BD_FLAGS_SW_LSO_SHIFT 6
2408#define ETH_TX_BD_FLAGS_IPV6 (0x1<<7)
2409#define ETH_TX_BD_FLAGS_IPV6_SHIFT 7
2410};
2411
2412/*
2413 * The eth Tx Buffer Descriptor
2414 */
Eilon Greensteinca003922009-08-12 22:53:28 -07002415struct eth_tx_start_bd {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002416 __le32 addr_lo;
2417 __le32 addr_hi;
2418 __le16 nbd;
2419 __le16 nbytes;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002420 __le16 vlan_or_ethertype;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002421 struct eth_tx_bd_flags bd_flags;
2422 u8 general_data;
Eilon Greensteinca003922009-08-12 22:53:28 -07002423#define ETH_TX_START_BD_HDR_NBDS (0x3F<<0)
2424#define ETH_TX_START_BD_HDR_NBDS_SHIFT 0
2425#define ETH_TX_START_BD_ETH_ADDR_TYPE (0x3<<6)
2426#define ETH_TX_START_BD_ETH_ADDR_TYPE_SHIFT 6
2427};
2428
2429/*
2430 * Tx regular BD structure
2431 */
2432struct eth_tx_bd {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002433 __le32 addr_lo;
2434 __le32 addr_hi;
2435 __le16 total_pkt_bytes;
2436 __le16 nbytes;
Eilon Greensteinca003922009-08-12 22:53:28 -07002437 u8 reserved[4];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002438};
2439
2440/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002441 * Tx parsing BD structure for ETH E1/E1h
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002442 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002443struct eth_tx_parse_bd_e1x {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002444 u8 global_data;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002445#define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W (0xF<<0)
2446#define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W_SHIFT 0
2447#define ETH_TX_PARSE_BD_E1X_RESERVED0 (0x1<<4)
2448#define ETH_TX_PARSE_BD_E1X_RESERVED0_SHIFT 4
2449#define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN (0x1<<5)
2450#define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN_SHIFT 5
2451#define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN (0x1<<6)
2452#define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT 6
2453#define ETH_TX_PARSE_BD_E1X_NS_FLG (0x1<<7)
2454#define ETH_TX_PARSE_BD_E1X_NS_FLG_SHIFT 7
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002455 u8 tcp_flags;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002456#define ETH_TX_PARSE_BD_E1X_FIN_FLG (0x1<<0)
2457#define ETH_TX_PARSE_BD_E1X_FIN_FLG_SHIFT 0
2458#define ETH_TX_PARSE_BD_E1X_SYN_FLG (0x1<<1)
2459#define ETH_TX_PARSE_BD_E1X_SYN_FLG_SHIFT 1
2460#define ETH_TX_PARSE_BD_E1X_RST_FLG (0x1<<2)
2461#define ETH_TX_PARSE_BD_E1X_RST_FLG_SHIFT 2
2462#define ETH_TX_PARSE_BD_E1X_PSH_FLG (0x1<<3)
2463#define ETH_TX_PARSE_BD_E1X_PSH_FLG_SHIFT 3
2464#define ETH_TX_PARSE_BD_E1X_ACK_FLG (0x1<<4)
2465#define ETH_TX_PARSE_BD_E1X_ACK_FLG_SHIFT 4
2466#define ETH_TX_PARSE_BD_E1X_URG_FLG (0x1<<5)
2467#define ETH_TX_PARSE_BD_E1X_URG_FLG_SHIFT 5
2468#define ETH_TX_PARSE_BD_E1X_ECE_FLG (0x1<<6)
2469#define ETH_TX_PARSE_BD_E1X_ECE_FLG_SHIFT 6
2470#define ETH_TX_PARSE_BD_E1X_CWR_FLG (0x1<<7)
2471#define ETH_TX_PARSE_BD_E1X_CWR_FLG_SHIFT 7
2472 u8 ip_hlen_w;
Eilon Greensteinca003922009-08-12 22:53:28 -07002473 s8 reserved;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002474 __le16 total_hlen_w;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002475 __le16 tcp_pseudo_csum;
Eilon Greensteinca003922009-08-12 22:53:28 -07002476 __le16 lso_mss;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002477 __le16 ip_id;
2478 __le32 tcp_send_seq;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002479};
2480
2481/*
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002482 * Tx parsing BD structure for ETH E2
2483 */
2484struct eth_tx_parse_bd_e2 {
2485 __le16 dst_mac_addr_lo;
2486 __le16 dst_mac_addr_mid;
2487 __le16 dst_mac_addr_hi;
2488 __le16 src_mac_addr_lo;
2489 __le16 src_mac_addr_mid;
2490 __le16 src_mac_addr_hi;
2491 __le32 parsing_data;
2492#define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W (0x1FFF<<0)
2493#define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT 0
2494#define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW (0xF<<13)
2495#define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT 13
2496#define ETH_TX_PARSE_BD_E2_LSO_MSS (0x3FFF<<17)
2497#define ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT 17
2498#define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR (0x1<<31)
2499#define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR_SHIFT 31
2500};
2501
2502/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002503 * The last BD in the BD memory will hold a pointer to the next BD memory
2504 */
2505struct eth_tx_next_bd {
Eilon Greensteinca003922009-08-12 22:53:28 -07002506 __le32 addr_lo;
2507 __le32 addr_hi;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002508 u8 reserved[8];
2509};
2510
2511/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002512 * union for 4 Bd types
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002513 */
2514union eth_tx_bd_types {
Eilon Greensteinca003922009-08-12 22:53:28 -07002515 struct eth_tx_start_bd start_bd;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002516 struct eth_tx_bd reg_bd;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002517 struct eth_tx_parse_bd_e1x parse_bd_e1x;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002518 struct eth_tx_parse_bd_e2 parse_bd_e2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002519 struct eth_tx_next_bd next_bd;
2520};
2521
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002522
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002523/*
2524 * The eth storm context of Xstorm
2525 */
2526struct xstorm_eth_st_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002527 u32 reserved0[60];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002528};
2529
2530/*
2531 * The eth storm context of Cstorm
2532 */
2533struct cstorm_eth_st_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002534 u32 __reserved0[4];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002535};
2536
2537/*
2538 * Ethernet connection context
2539 */
2540struct eth_context {
2541 struct ustorm_eth_st_context ustorm_st_context;
2542 struct tstorm_eth_st_context tstorm_st_context;
2543 struct xstorm_eth_ag_context xstorm_ag_context;
2544 struct tstorm_eth_ag_context tstorm_ag_context;
2545 struct cstorm_eth_ag_context cstorm_ag_context;
2546 struct ustorm_eth_ag_context ustorm_ag_context;
2547 struct timers_block_context timers_context;
2548 struct xstorm_eth_st_context xstorm_st_context;
2549 struct cstorm_eth_st_context cstorm_st_context;
2550};
2551
2552
2553/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002554 * Ethernet doorbell
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002555 */
2556struct eth_tx_doorbell {
2557#if defined(__BIG_ENDIAN)
2558 u16 npackets;
2559 u8 params;
2560#define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
2561#define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
2562#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
2563#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
2564#define ETH_TX_DOORBELL_SPARE (0x1<<7)
2565#define ETH_TX_DOORBELL_SPARE_SHIFT 7
2566 struct doorbell_hdr hdr;
2567#elif defined(__LITTLE_ENDIAN)
2568 struct doorbell_hdr hdr;
2569 u8 params;
2570#define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
2571#define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
2572#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
2573#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
2574#define ETH_TX_DOORBELL_SPARE (0x1<<7)
2575#define ETH_TX_DOORBELL_SPARE_SHIFT 7
2576 u16 npackets;
2577#endif
2578};
2579
2580
2581/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002582 * client init fc data
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002583 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002584struct client_init_fc_data {
2585 __le16 cqe_pause_thr_low;
2586 __le16 cqe_pause_thr_high;
2587 __le16 bd_pause_thr_low;
2588 __le16 bd_pause_thr_high;
2589 __le16 sge_pause_thr_low;
2590 __le16 sge_pause_thr_high;
2591 __le16 rx_cos_mask;
2592 u8 safc_group_num;
2593 u8 safc_group_en_flg;
2594 u8 traffic_type;
2595 u8 reserved0;
2596 __le16 reserved1;
2597 __le32 reserved2;
2598};
2599
2600
2601/*
2602 * client init ramrod data
2603 */
2604struct client_init_general_data {
2605 u8 client_id;
2606 u8 statistics_counter_id;
2607 u8 statistics_en_flg;
2608 u8 is_fcoe_flg;
2609 u8 activate_flg;
2610 u8 sp_client_id;
2611 __le16 reserved0;
2612 __le32 reserved1[2];
2613};
2614
2615
2616/*
2617 * client init rx data
2618 */
2619struct client_init_rx_data {
2620 u8 tpa_en_flg;
2621 u8 vmqueue_mode_en_flg;
2622 u8 extra_data_over_sgl_en_flg;
2623 u8 cache_line_alignment_log_size;
2624 u8 enable_dynamic_hc;
2625 u8 max_sges_for_packet;
2626 u8 client_qzone_id;
2627 u8 drop_ip_cs_err_flg;
2628 u8 drop_tcp_cs_err_flg;
2629 u8 drop_ttl0_flg;
2630 u8 drop_udp_cs_err_flg;
2631 u8 inner_vlan_removal_enable_flg;
2632 u8 outer_vlan_removal_enable_flg;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002633 u8 status_block_id;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002634 u8 rx_sb_index_number;
2635 u8 reserved0[3];
2636 __le16 bd_buff_size;
2637 __le16 sge_buff_size;
2638 __le16 mtu;
2639 struct regpair bd_page_base;
2640 struct regpair sge_page_base;
2641 struct regpair cqe_page_base;
2642 u8 is_leading_rss;
2643 u8 is_approx_mcast;
2644 __le16 max_agg_size;
2645 __le32 reserved2[3];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002646};
2647
2648/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002649 * client init tx data
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002650 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002651struct client_init_tx_data {
2652 u8 enforce_security_flg;
2653 u8 tx_status_block_id;
2654 u8 tx_sb_index_number;
2655 u8 reserved0;
2656 __le16 mtu;
2657 __le16 reserved1;
2658 struct regpair tx_bd_page_base;
2659 __le32 reserved2[2];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002660};
2661
2662/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002663 * client init ramrod data
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002664 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002665struct client_init_ramrod_data {
2666 struct client_init_general_data general;
2667 struct client_init_rx_data rx;
2668 struct client_init_tx_data tx;
2669 struct client_init_fc_data fc;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002670};
2671
2672
2673/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002674 * The data contain client ID need to the ramrod
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002675 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002676struct eth_common_ramrod_data {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002677 u32 client_id;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002678 u32 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002679};
2680
2681
2682/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002683 * union for sgl and raw data.
2684 */
2685union eth_sgl_or_raw_data {
2686 __le16 sgl[8];
2687 u32 raw_data[4];
2688};
2689
2690/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002691 * regular eth FP CQE parameters struct
2692 */
2693struct eth_fast_path_rx_cqe {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002694 u8 type_error_flags;
2695#define ETH_FAST_PATH_RX_CQE_TYPE (0x1<<0)
2696#define ETH_FAST_PATH_RX_CQE_TYPE_SHIFT 0
2697#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG (0x1<<1)
2698#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG_SHIFT 1
2699#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG (0x1<<2)
2700#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG_SHIFT 2
2701#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG (0x1<<3)
2702#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG_SHIFT 3
2703#define ETH_FAST_PATH_RX_CQE_START_FLG (0x1<<4)
2704#define ETH_FAST_PATH_RX_CQE_START_FLG_SHIFT 4
2705#define ETH_FAST_PATH_RX_CQE_END_FLG (0x1<<5)
2706#define ETH_FAST_PATH_RX_CQE_END_FLG_SHIFT 5
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002707#define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL (0x3<<6)
2708#define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL_SHIFT 6
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002709 u8 status_flags;
2710#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE (0x7<<0)
2711#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE_SHIFT 0
2712#define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG (0x1<<3)
2713#define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG_SHIFT 3
2714#define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG (0x1<<4)
2715#define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG_SHIFT 4
2716#define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG (0x1<<5)
2717#define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG_SHIFT 5
2718#define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG (0x1<<6)
2719#define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG_SHIFT 6
2720#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG (0x1<<7)
2721#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7
2722 u8 placement_offset;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002723 u8 queue_index;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002724 __le32 rss_hash_result;
2725 __le16 vlan_tag;
2726 __le16 pkt_len;
2727 __le16 len_on_bd;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002728 struct parsing_flags pars_flags;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002729 union eth_sgl_or_raw_data sgl_or_raw_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002730};
2731
2732
2733/*
2734 * The data for RSS setup ramrod
2735 */
2736struct eth_halt_ramrod_data {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002737 u32 client_id;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002738 u32 reserved0;
2739};
2740
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002741/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002742 * The data for statistics query ramrod
2743 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002744struct common_query_ramrod_data {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002745#if defined(__BIG_ENDIAN)
2746 u8 reserved0;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002747 u8 collect_port;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002748 u16 drv_counter;
2749#elif defined(__LITTLE_ENDIAN)
2750 u16 drv_counter;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002751 u8 collect_port;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002752 u8 reserved0;
2753#endif
2754 u32 ctr_id_vector;
2755};
2756
2757
2758/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002759 * Place holder for ramrods protocol specific data
2760 */
2761struct ramrod_data {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002762 __le32 data_lo;
2763 __le32 data_hi;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002764};
2765
2766/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002767 * union for ramrod data for Ethernet protocol (CQE) (force size of 16 bits)
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002768 */
2769union eth_ramrod_data {
2770 struct ramrod_data general;
2771};
2772
2773
2774/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002775 * Eth Rx Cqe structure- general structure for ramrods
2776 */
2777struct common_ramrod_eth_rx_cqe {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002778 u8 ramrod_type;
2779#define COMMON_RAMROD_ETH_RX_CQE_TYPE (0x1<<0)
2780#define COMMON_RAMROD_ETH_RX_CQE_TYPE_SHIFT 0
Vladislav Zolotarov3359fce2010-02-17 13:35:01 -08002781#define COMMON_RAMROD_ETH_RX_CQE_ERROR (0x1<<1)
2782#define COMMON_RAMROD_ETH_RX_CQE_ERROR_SHIFT 1
2783#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x3F<<2)
2784#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 2
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002785 u8 conn_type;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002786 __le16 reserved1;
2787 __le32 conn_and_cmd_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002788#define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0)
2789#define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0
2790#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24)
2791#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24
2792 struct ramrod_data protocol_data;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002793 __le32 reserved2[4];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002794};
2795
2796/*
2797 * Rx Last CQE in page (in ETH)
2798 */
2799struct eth_rx_cqe_next_page {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002800 __le32 addr_lo;
2801 __le32 addr_hi;
2802 __le32 reserved[6];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002803};
2804
2805/*
2806 * union for all eth rx cqe types (fix their sizes)
2807 */
2808union eth_rx_cqe {
2809 struct eth_fast_path_rx_cqe fast_path_cqe;
2810 struct common_ramrod_eth_rx_cqe ramrod_cqe;
2811 struct eth_rx_cqe_next_page next_page_cqe;
2812};
2813
2814
2815/*
2816 * common data for all protocols
2817 */
2818struct spe_hdr {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002819 __le32 conn_and_cmd_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002820#define SPE_HDR_CID (0xFFFFFF<<0)
2821#define SPE_HDR_CID_SHIFT 0
2822#define SPE_HDR_CMD_ID (0xFF<<24)
2823#define SPE_HDR_CMD_ID_SHIFT 24
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002824 __le16 type;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002825#define SPE_HDR_CONN_TYPE (0xFF<<0)
2826#define SPE_HDR_CONN_TYPE_SHIFT 0
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002827#define SPE_HDR_FUNCTION_ID (0xFF<<8)
2828#define SPE_HDR_FUNCTION_ID_SHIFT 8
2829 __le16 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002830};
2831
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002832/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002833 * Ethernet slow path element
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002834 */
2835union eth_specific_data {
2836 u8 protocol_data[8];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002837 struct regpair client_init_ramrod_init_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002838 struct eth_halt_ramrod_data halt_ramrod_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002839 struct regpair update_data_addr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002840 struct eth_common_ramrod_data common_ramrod_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002841};
2842
2843/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002844 * Ethernet slow path element
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002845 */
2846struct eth_spe {
2847 struct spe_hdr hdr;
2848 union eth_specific_data data;
2849};
2850
2851
2852/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002853 * array of 13 bds as appears in the eth xstorm context
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002854 */
Eilon Greensteinca003922009-08-12 22:53:28 -07002855struct eth_tx_bds_array {
2856 union eth_tx_bd_types bds[13];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002857};
2858
2859
2860/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002861 * Common configuration parameters per function in Tstorm
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002862 */
2863struct tstorm_eth_function_common_config {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002864#if defined(__BIG_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002865 u8 reserved1;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002866 u8 rss_result_mask;
2867 u16 config_flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002868#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
2869#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
2870#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
2871#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
2872#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
2873#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
2874#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
2875#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002876#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4)
2877#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002878#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA (0x1<<7)
2879#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA_SHIFT 7
2880#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE (0x1<<8)
2881#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE_SHIFT 8
2882#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x7F<<9)
2883#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 9
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002884#elif defined(__LITTLE_ENDIAN)
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002885 u16 config_flags;
2886#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
2887#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
2888#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
2889#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
2890#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
2891#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
2892#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
2893#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002894#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4)
2895#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002896#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA (0x1<<7)
2897#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA_SHIFT 7
2898#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE (0x1<<8)
2899#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE_SHIFT 8
2900#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x7F<<9)
2901#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 9
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002902 u8 rss_result_mask;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002903 u8 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002904#endif
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002905 u16 vlan_id[2];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002906};
2907
2908/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002909 * RSS idirection table update configuration
2910 */
2911struct rss_update_config {
2912#if defined(__BIG_ENDIAN)
2913 u16 toe_rss_bitmap;
2914 u16 flags;
2915#define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE (0x1<<0)
2916#define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE_SHIFT 0
2917#define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE (0x1<<1)
2918#define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE_SHIFT 1
2919#define __RSS_UPDATE_CONFIG_RESERVED0 (0x3FFF<<2)
2920#define __RSS_UPDATE_CONFIG_RESERVED0_SHIFT 2
2921#elif defined(__LITTLE_ENDIAN)
2922 u16 flags;
2923#define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE (0x1<<0)
2924#define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE_SHIFT 0
2925#define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE (0x1<<1)
2926#define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE_SHIFT 1
2927#define __RSS_UPDATE_CONFIG_RESERVED0 (0x3FFF<<2)
2928#define __RSS_UPDATE_CONFIG_RESERVED0_SHIFT 2
2929 u16 toe_rss_bitmap;
2930#endif
2931 u32 reserved1;
2932};
2933
2934/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002935 * parameters for eth update ramrod
2936 */
2937struct eth_update_ramrod_data {
2938 struct tstorm_eth_function_common_config func_config;
2939 u8 indirectionTable[128];
Eilon Greensteinca003922009-08-12 22:53:28 -07002940 struct rss_update_config rss_config;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002941};
2942
2943
2944/*
2945 * MAC filtering configuration command header
2946 */
2947struct mac_configuration_hdr {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002948 u8 length;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002949 u8 offset;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002950 u16 client_id;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002951 u16 echo;
2952 u16 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002953};
2954
2955/*
2956 * MAC address in list for ramrod
2957 */
2958struct mac_configuration_entry {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002959 __le16 lsb_mac_addr;
2960 __le16 middle_mac_addr;
2961 __le16 msb_mac_addr;
2962 __le16 vlan_id;
2963 u8 pf_id;
2964 u8 flags;
2965#define MAC_CONFIGURATION_ENTRY_ACTION_TYPE (0x1<<0)
2966#define MAC_CONFIGURATION_ENTRY_ACTION_TYPE_SHIFT 0
2967#define MAC_CONFIGURATION_ENTRY_RDMA_MAC (0x1<<1)
2968#define MAC_CONFIGURATION_ENTRY_RDMA_MAC_SHIFT 1
2969#define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE (0x3<<2)
2970#define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE_SHIFT 2
2971#define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL (0x1<<4)
2972#define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL_SHIFT 4
2973#define MAC_CONFIGURATION_ENTRY_BROADCAST (0x1<<5)
2974#define MAC_CONFIGURATION_ENTRY_BROADCAST_SHIFT 5
2975#define MAC_CONFIGURATION_ENTRY_RESERVED1 (0x3<<6)
2976#define MAC_CONFIGURATION_ENTRY_RESERVED1_SHIFT 6
2977 u16 reserved0;
2978 u32 clients_bit_vector;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002979};
2980
2981/*
2982 * MAC filtering configuration command
2983 */
2984struct mac_configuration_cmd {
2985 struct mac_configuration_hdr hdr;
2986 struct mac_configuration_entry config_table[64];
2987};
2988
2989
2990/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002991 * approximate-match multicast filtering for E1H per function in Tstorm
2992 */
2993struct tstorm_eth_approximate_match_multicast_filtering {
2994 u32 mcast_add_hash_bit_array[8];
2995};
2996
2997
2998/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002999 * MAC filtering configuration parameters per port in Tstorm
3000 */
3001struct tstorm_eth_mac_filter_config {
3002 u32 ucast_drop_all;
3003 u32 ucast_accept_all;
3004 u32 mcast_drop_all;
3005 u32 mcast_accept_all;
3006 u32 bcast_drop_all;
3007 u32 bcast_accept_all;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003008 u32 vlan_filter[2];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003009 u32 unmatched_unicast;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003010 u32 reserved;
3011};
3012
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003013
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003014/*
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003015 * common flag to indicate existance of TPA.
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003016 */
3017struct tstorm_eth_tpa_exist {
3018#if defined(__BIG_ENDIAN)
3019 u16 reserved1;
3020 u8 reserved0;
3021 u8 tpa_exist;
3022#elif defined(__LITTLE_ENDIAN)
3023 u8 tpa_exist;
3024 u8 reserved0;
3025 u16 reserved1;
3026#endif
3027 u32 reserved2;
3028};
3029
3030
3031/*
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003032 * Three RX producers for ETH
3033 */
3034struct ustorm_eth_rx_producers {
3035#if defined(__BIG_ENDIAN)
3036 u16 bd_prod;
3037 u16 cqe_prod;
3038#elif defined(__LITTLE_ENDIAN)
3039 u16 cqe_prod;
3040 u16 bd_prod;
3041#endif
3042#if defined(__BIG_ENDIAN)
3043 u16 reserved;
3044 u16 sge_prod;
3045#elif defined(__LITTLE_ENDIAN)
3046 u16 sge_prod;
3047 u16 reserved;
3048#endif
3049};
3050
3051
3052/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003053 * cfc delete event data
3054 */
3055struct cfc_del_event_data {
3056 u32 cid;
3057 u8 error;
3058 u8 reserved0;
3059 u16 reserved1;
3060 u32 reserved2;
3061};
3062
3063
3064/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003065 * per-port SAFC demo variables
3066 */
3067struct cmng_flags_per_port {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003068 u8 con_number[NUM_OF_PROTOCOLS];
Eilon Greenstein8a1c38d2009-02-12 08:36:40 +00003069 u32 cmng_enables;
3070#define CMNG_FLAGS_PER_PORT_FAIRNESS_VN (0x1<<0)
3071#define CMNG_FLAGS_PER_PORT_FAIRNESS_VN_SHIFT 0
3072#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN (0x1<<1)
3073#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN_SHIFT 1
3074#define CMNG_FLAGS_PER_PORT_FAIRNESS_PROTOCOL (0x1<<2)
3075#define CMNG_FLAGS_PER_PORT_FAIRNESS_PROTOCOL_SHIFT 2
3076#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_PROTOCOL (0x1<<3)
3077#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_PROTOCOL_SHIFT 3
3078#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS (0x1<<4)
3079#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003080#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE (0x1<<5)
3081#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE_SHIFT 5
3082#define __CMNG_FLAGS_PER_PORT_RESERVED0 (0x3FFFFFF<<6)
3083#define __CMNG_FLAGS_PER_PORT_RESERVED0_SHIFT 6
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003084};
3085
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003086
3087/*
3088 * per-port rate shaping variables
3089 */
3090struct rate_shaping_vars_per_port {
3091 u32 rs_periodic_timeout;
3092 u32 rs_threshold;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003093};
3094
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003095/*
3096 * per-port fairness variables
3097 */
3098struct fairness_vars_per_port {
3099 u32 upper_bound;
3100 u32 fair_threshold;
3101 u32 fairness_timeout;
3102};
3103
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003104/*
3105 * per-port SAFC variables
3106 */
3107struct safc_struct_per_port {
3108#if defined(__BIG_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003109 u16 __reserved1;
3110 u8 __reserved0;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003111 u8 safc_timeout_usec;
3112#elif defined(__LITTLE_ENDIAN)
3113 u8 safc_timeout_usec;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003114 u8 __reserved0;
3115 u16 __reserved1;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003116#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003117 u8 cos_to_traffic_types[MAX_COS_NUMBER];
3118 u32 __reserved2;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003119 u16 cos_to_pause_mask[NUM_OF_SAFC_BITS];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003120};
3121
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003122/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003123 * per-port PFC variables
3124 */
3125struct pfc_struct_per_port {
3126 u8 priority_to_traffic_types[MAX_PFC_PRIORITIES];
3127#if defined(__BIG_ENDIAN)
3128 u16 pfc_pause_quanta_in_nanosec;
3129 u8 __reserved0;
3130 u8 priority_non_pausable_mask;
3131#elif defined(__LITTLE_ENDIAN)
3132 u8 priority_non_pausable_mask;
3133 u8 __reserved0;
3134 u16 pfc_pause_quanta_in_nanosec;
3135#endif
3136};
3137
3138/*
3139 * Priority and cos
3140 */
3141struct priority_cos {
3142#if defined(__BIG_ENDIAN)
3143 u16 reserved1;
3144 u8 cos;
3145 u8 priority;
3146#elif defined(__LITTLE_ENDIAN)
3147 u8 priority;
3148 u8 cos;
3149 u16 reserved1;
3150#endif
3151 u32 reserved2;
3152};
3153
3154/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003155 * Per-port congestion management variables
3156 */
3157struct cmng_struct_per_port {
3158 struct rate_shaping_vars_per_port rs_vars;
3159 struct fairness_vars_per_port fair_vars;
3160 struct safc_struct_per_port safc_vars;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003161 struct pfc_struct_per_port pfc_vars;
3162#if defined(__BIG_ENDIAN)
3163 u16 __reserved1;
3164 u8 dcb_enabled;
3165 u8 llfc_mode;
3166#elif defined(__LITTLE_ENDIAN)
3167 u8 llfc_mode;
3168 u8 dcb_enabled;
3169 u16 __reserved1;
3170#endif
3171 struct priority_cos
3172 traffic_type_to_priority_cos[MAX_PFC_TRAFFIC_TYPES];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003173 struct cmng_flags_per_port flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003174};
3175
3176
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003177
3178/*
3179 * Dynamic HC counters set by the driver
3180 */
3181struct hc_dynamic_drv_counter {
3182 u32 val[HC_SB_MAX_DYNAMIC_INDICES];
3183};
3184
3185/*
3186 * zone A per-queue data
3187 */
3188struct cstorm_queue_zone_data {
3189 struct hc_dynamic_drv_counter hc_dyn_drv_cnt;
3190 struct regpair reserved[2];
3191};
3192
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003193/*
Eilon Greensteinca003922009-08-12 22:53:28 -07003194 * Dynamic host coalescing init parameters
3195 */
3196struct dynamic_hc_config {
3197 u32 threshold[3];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003198 u8 shift_per_protocol[HC_SB_MAX_DYNAMIC_INDICES];
3199 u8 hc_timeout0[HC_SB_MAX_DYNAMIC_INDICES];
3200 u8 hc_timeout1[HC_SB_MAX_DYNAMIC_INDICES];
3201 u8 hc_timeout2[HC_SB_MAX_DYNAMIC_INDICES];
3202 u8 hc_timeout3[HC_SB_MAX_DYNAMIC_INDICES];
Eilon Greensteinca003922009-08-12 22:53:28 -07003203};
3204
3205
3206/*
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003207 * Protocol-common statistics collected by the Xstorm (per client)
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003208 */
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003209struct xstorm_per_client_stats {
Eilon Greensteinca003922009-08-12 22:53:28 -07003210 __le32 reserved0;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003211 __le32 unicast_pkts_sent;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003212 struct regpair unicast_bytes_sent;
3213 struct regpair multicast_bytes_sent;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003214 __le32 multicast_pkts_sent;
3215 __le32 broadcast_pkts_sent;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003216 struct regpair broadcast_bytes_sent;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003217 __le16 stats_counter;
Eilon Greensteinca003922009-08-12 22:53:28 -07003218 __le16 reserved1;
3219 __le32 reserved2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003220};
3221
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003222/*
3223 * Common statistics collected by the Xstorm (per port)
3224 */
3225struct xstorm_common_stats {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003226 struct xstorm_per_client_stats client_statistics[MAX_STAT_COUNTER_ID];
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003227};
3228
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003229/*
3230 * Protocol-common statistics collected by the Tstorm (per port)
3231 */
3232struct tstorm_per_port_stats {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003233 __le32 mac_filter_discard;
3234 __le32 xxoverflow_discard;
3235 __le32 brb_truncate_discard;
3236 __le32 mac_discard;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003237};
3238
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003239/*
3240 * Protocol-common statistics collected by the Tstorm (per client)
3241 */
3242struct tstorm_per_client_stats {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003243 struct regpair rcv_unicast_bytes;
3244 struct regpair rcv_broadcast_bytes;
3245 struct regpair rcv_multicast_bytes;
3246 struct regpair rcv_error_bytes;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003247 __le32 checksum_discard;
3248 __le32 packets_too_big_discard;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003249 __le32 rcv_unicast_pkts;
3250 __le32 rcv_broadcast_pkts;
3251 __le32 rcv_multicast_pkts;
3252 __le32 no_buff_discard;
3253 __le32 ttl0_discard;
3254 __le16 stats_counter;
3255 __le16 reserved0;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003256};
3257
3258/*
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003259 * Protocol-common statistics collected by the Tstorm
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003260 */
3261struct tstorm_common_stats {
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003262 struct tstorm_per_port_stats port_statistics;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003263 struct tstorm_per_client_stats client_statistics[MAX_STAT_COUNTER_ID];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003264};
3265
3266/*
Eilon Greensteinde832a52009-02-12 08:36:33 +00003267 * Protocol-common statistics collected by the Ustorm (per client)
3268 */
3269struct ustorm_per_client_stats {
3270 struct regpair ucast_no_buff_bytes;
3271 struct regpair mcast_no_buff_bytes;
3272 struct regpair bcast_no_buff_bytes;
3273 __le32 ucast_no_buff_pkts;
3274 __le32 mcast_no_buff_pkts;
3275 __le32 bcast_no_buff_pkts;
3276 __le16 stats_counter;
3277 __le16 reserved0;
3278};
3279
3280/*
3281 * Protocol-common statistics collected by the Ustorm
3282 */
3283struct ustorm_common_stats {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003284 struct ustorm_per_client_stats client_statistics[MAX_STAT_COUNTER_ID];
Eilon Greensteinde832a52009-02-12 08:36:33 +00003285};
3286
3287/*
Eilon Greenstein33471622008-08-13 15:59:08 -07003288 * Eth statistics query structure for the eth_stats_query ramrod
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003289 */
3290struct eth_stats_query {
3291 struct xstorm_common_stats xstorm_common;
3292 struct tstorm_common_stats tstorm_common;
Eilon Greensteinde832a52009-02-12 08:36:33 +00003293 struct ustorm_common_stats ustorm_common;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003294};
3295
3296
3297/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003298 * set mac event data
3299 */
3300struct set_mac_event_data {
3301 u16 echo;
3302 u16 reserved0;
3303 u32 reserved1;
3304 u32 reserved2;
3305};
3306
3307/*
3308 * union for all event ring message types
3309 */
3310union event_data {
3311 struct set_mac_event_data set_mac_event;
3312 struct cfc_del_event_data cfc_del_event;
3313};
3314
3315
3316/*
3317 * per PF event ring data
3318 */
3319struct event_ring_data {
3320 struct regpair base_addr;
3321#if defined(__BIG_ENDIAN)
3322 u8 index_id;
3323 u8 sb_id;
3324 u16 producer;
3325#elif defined(__LITTLE_ENDIAN)
3326 u16 producer;
3327 u8 sb_id;
3328 u8 index_id;
3329#endif
3330 u32 reserved0;
3331};
3332
3333
3334/*
3335 * event ring message element (each element is 128 bits)
3336 */
3337struct event_ring_msg {
3338 u8 opcode;
3339 u8 reserved0;
3340 u16 reserved1;
3341 union event_data data;
3342};
3343
3344/*
3345 * event ring next page element (128 bits)
3346 */
3347struct event_ring_next {
3348 struct regpair addr;
3349 u32 reserved[2];
3350};
3351
3352/*
3353 * union for event ring element types (each element is 128 bits)
3354 */
3355union event_ring_elem {
3356 struct event_ring_msg message;
3357 struct event_ring_next next_page;
3358};
3359
3360
3361/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003362 * per-vnic fairness variables
3363 */
3364struct fairness_vars_per_vn {
Eilon Greenstein8a1c38d2009-02-12 08:36:40 +00003365 u32 cos_credit_delta[MAX_COS_NUMBER];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003366 u32 protocol_credit_delta[NUM_OF_PROTOCOLS];
3367 u32 vn_credit_delta;
3368 u32 __reserved0;
3369};
3370
3371
3372/*
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00003373 * The data for flow control configuration
3374 */
3375struct flow_control_configuration {
3376 struct priority_cos
3377 traffic_type_to_priority_cos[MAX_PFC_TRAFFIC_TYPES];
3378#if defined(__BIG_ENDIAN)
3379 u16 reserved1;
3380 u8 dcb_version;
3381 u8 dcb_enabled;
3382#elif defined(__LITTLE_ENDIAN)
3383 u8 dcb_enabled;
3384 u8 dcb_version;
3385 u16 reserved1;
3386#endif
3387 u32 reserved2;
3388};
3389
3390
3391/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003392 * FW version stored in the Xstorm RAM
3393 */
3394struct fw_version {
3395#if defined(__BIG_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003396 u8 engineering;
3397 u8 revision;
3398 u8 minor;
3399 u8 major;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003400#elif defined(__LITTLE_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003401 u8 major;
3402 u8 minor;
3403 u8 revision;
3404 u8 engineering;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003405#endif
3406 u32 flags;
3407#define FW_VERSION_OPTIMIZED (0x1<<0)
3408#define FW_VERSION_OPTIMIZED_SHIFT 0
3409#define FW_VERSION_BIG_ENDIEN (0x1<<1)
3410#define FW_VERSION_BIG_ENDIEN_SHIFT 1
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003411#define FW_VERSION_CHIP_VERSION (0x3<<2)
3412#define FW_VERSION_CHIP_VERSION_SHIFT 2
3413#define __FW_VERSION_RESERVED (0xFFFFFFF<<4)
3414#define __FW_VERSION_RESERVED_SHIFT 4
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003415};
3416
3417
3418/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003419 * Dynamic Host-Coalescing - Driver(host) counters
3420 */
3421struct hc_dynamic_sb_drv_counters {
3422 u32 dynamic_hc_drv_counter[HC_SB_MAX_DYNAMIC_INDICES];
3423};
3424
3425
3426/*
3427 * 2 bytes. configuration/state parameters for a single protocol index
3428 */
3429struct hc_index_data {
3430#if defined(__BIG_ENDIAN)
3431 u8 flags;
3432#define HC_INDEX_DATA_SM_ID (0x1<<0)
3433#define HC_INDEX_DATA_SM_ID_SHIFT 0
3434#define HC_INDEX_DATA_HC_ENABLED (0x1<<1)
3435#define HC_INDEX_DATA_HC_ENABLED_SHIFT 1
3436#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2)
3437#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2
3438#define HC_INDEX_DATA_RESERVE (0x1F<<3)
3439#define HC_INDEX_DATA_RESERVE_SHIFT 3
3440 u8 timeout;
3441#elif defined(__LITTLE_ENDIAN)
3442 u8 timeout;
3443 u8 flags;
3444#define HC_INDEX_DATA_SM_ID (0x1<<0)
3445#define HC_INDEX_DATA_SM_ID_SHIFT 0
3446#define HC_INDEX_DATA_HC_ENABLED (0x1<<1)
3447#define HC_INDEX_DATA_HC_ENABLED_SHIFT 1
3448#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2)
3449#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2
3450#define HC_INDEX_DATA_RESERVE (0x1F<<3)
3451#define HC_INDEX_DATA_RESERVE_SHIFT 3
3452#endif
3453};
3454
3455
3456/*
3457 * HC state-machine
3458 */
3459struct hc_status_block_sm {
3460#if defined(__BIG_ENDIAN)
3461 u8 igu_seg_id;
3462 u8 igu_sb_id;
3463 u8 timer_value;
3464 u8 __flags;
3465#elif defined(__LITTLE_ENDIAN)
3466 u8 __flags;
3467 u8 timer_value;
3468 u8 igu_sb_id;
3469 u8 igu_seg_id;
3470#endif
3471 u32 time_to_expire;
3472};
3473
3474/*
3475 * hold PCI identification variables- used in various places in firmware
3476 */
3477struct pci_entity {
3478#if defined(__BIG_ENDIAN)
3479 u8 vf_valid;
3480 u8 vf_id;
3481 u8 vnic_id;
3482 u8 pf_id;
3483#elif defined(__LITTLE_ENDIAN)
3484 u8 pf_id;
3485 u8 vnic_id;
3486 u8 vf_id;
3487 u8 vf_valid;
3488#endif
3489};
3490
3491/*
3492 * The fast-path status block meta-data, common to all chips
3493 */
3494struct hc_sb_data {
3495 struct regpair host_sb_addr;
3496 struct hc_status_block_sm state_machine[HC_SB_MAX_SM];
3497 struct pci_entity p_func;
3498#if defined(__BIG_ENDIAN)
3499 u8 rsrv0;
3500 u8 dhc_qzone_id;
3501 u8 __dynamic_hc_level;
3502 u8 same_igu_sb_1b;
3503#elif defined(__LITTLE_ENDIAN)
3504 u8 same_igu_sb_1b;
3505 u8 __dynamic_hc_level;
3506 u8 dhc_qzone_id;
3507 u8 rsrv0;
3508#endif
3509 struct regpair rsrv1[2];
3510};
3511
3512
3513/*
3514 * The fast-path status block meta-data
3515 */
3516struct hc_sp_status_block_data {
3517 struct regpair host_sb_addr;
3518#if defined(__BIG_ENDIAN)
3519 u16 rsrv;
3520 u8 igu_seg_id;
3521 u8 igu_sb_id;
3522#elif defined(__LITTLE_ENDIAN)
3523 u8 igu_sb_id;
3524 u8 igu_seg_id;
3525 u16 rsrv;
3526#endif
3527 struct pci_entity p_func;
3528};
3529
3530
3531/*
3532 * The fast-path status block meta-data
3533 */
3534struct hc_status_block_data_e1x {
3535 struct hc_index_data index_data[HC_SB_MAX_INDICES_E1X];
3536 struct hc_sb_data common;
3537};
3538
3539
3540/*
3541 * The fast-path status block meta-data
3542 */
3543struct hc_status_block_data_e2 {
3544 struct hc_index_data index_data[HC_SB_MAX_INDICES_E2];
3545 struct hc_sb_data common;
3546};
3547
3548
3549/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003550 * FW version stored in first line of pram
3551 */
3552struct pram_fw_version {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003553 u8 major;
3554 u8 minor;
3555 u8 revision;
3556 u8 engineering;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003557 u8 flags;
3558#define PRAM_FW_VERSION_OPTIMIZED (0x1<<0)
3559#define PRAM_FW_VERSION_OPTIMIZED_SHIFT 0
3560#define PRAM_FW_VERSION_STORM_ID (0x3<<1)
3561#define PRAM_FW_VERSION_STORM_ID_SHIFT 1
3562#define PRAM_FW_VERSION_BIG_ENDIEN (0x1<<3)
3563#define PRAM_FW_VERSION_BIG_ENDIEN_SHIFT 3
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003564#define PRAM_FW_VERSION_CHIP_VERSION (0x3<<4)
3565#define PRAM_FW_VERSION_CHIP_VERSION_SHIFT 4
3566#define __PRAM_FW_VERSION_RESERVED0 (0x3<<6)
3567#define __PRAM_FW_VERSION_RESERVED0_SHIFT 6
3568};
3569
3570
3571/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003572 * Ethernet slow path element
3573 */
3574union protocol_common_specific_data {
3575 u8 protocol_data[8];
3576 struct regpair phy_address;
3577 struct regpair mac_config_addr;
3578 struct common_query_ramrod_data query_ramrod_data;
3579};
3580
3581/*
Eilon Greensteinca003922009-08-12 22:53:28 -07003582 * The send queue element
3583 */
3584struct protocol_common_spe {
3585 struct spe_hdr hdr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003586 union protocol_common_specific_data data;
Eilon Greensteinca003922009-08-12 22:53:28 -07003587};
3588
3589
3590/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003591 * a single rate shaping counter. can be used as protocol or vnic counter
3592 */
3593struct rate_shaping_counter {
3594 u32 quota;
3595#if defined(__BIG_ENDIAN)
3596 u16 __reserved0;
3597 u16 rate;
3598#elif defined(__LITTLE_ENDIAN)
3599 u16 rate;
3600 u16 __reserved0;
3601#endif
3602};
3603
3604
3605/*
3606 * per-vnic rate shaping variables
3607 */
3608struct rate_shaping_vars_per_vn {
3609 struct rate_shaping_counter protocol_counters[NUM_OF_PROTOCOLS];
3610 struct rate_shaping_counter vn_counter;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003611};
3612
3613
3614/*
3615 * The send queue element
3616 */
3617struct slow_path_element {
3618 struct spe_hdr hdr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003619 struct regpair protocol_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003620};
3621
3622
3623/*
3624 * eth/toe flags that indicate if to query
3625 */
3626struct stats_indication_flags {
3627 u32 collect_eth;
3628 u32 collect_toe;
3629};
3630
3631
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003632/*
3633 * per-port PFC variables
3634 */
3635struct storm_pfc_struct_per_port {
3636#if defined(__BIG_ENDIAN)
3637 u16 mid_mac_addr;
3638 u16 msb_mac_addr;
3639#elif defined(__LITTLE_ENDIAN)
3640 u16 msb_mac_addr;
3641 u16 mid_mac_addr;
3642#endif
3643#if defined(__BIG_ENDIAN)
3644 u16 pfc_pause_quanta_in_nanosec;
3645 u16 lsb_mac_addr;
3646#elif defined(__LITTLE_ENDIAN)
3647 u16 lsb_mac_addr;
3648 u16 pfc_pause_quanta_in_nanosec;
3649#endif
3650};
3651
3652/*
3653 * Per-port congestion management variables
3654 */
3655struct storm_cmng_struct_per_port {
3656 struct storm_pfc_struct_per_port pfc_vars;
3657};
3658
3659
3660/*
3661 * zone A per-queue data
3662 */
3663struct tstorm_queue_zone_data {
3664 struct regpair reserved[4];
3665};
3666
3667
3668/*
3669 * zone B per-VF data
3670 */
3671struct tstorm_vf_zone_data {
3672 struct regpair reserved;
3673};
3674
3675
3676/*
3677 * zone A per-queue data
3678 */
3679struct ustorm_queue_zone_data {
3680 struct ustorm_eth_rx_producers eth_rx_producers;
3681 struct regpair reserved[3];
3682};
3683
3684
3685/*
3686 * zone B per-VF data
3687 */
3688struct ustorm_vf_zone_data {
3689 struct regpair reserved;
3690};
3691
3692
3693/*
3694 * data per VF-PF channel
3695 */
3696struct vf_pf_channel_data {
3697#if defined(__BIG_ENDIAN)
3698 u16 reserved0;
3699 u8 valid;
3700 u8 state;
3701#elif defined(__LITTLE_ENDIAN)
3702 u8 state;
3703 u8 valid;
3704 u16 reserved0;
3705#endif
3706 u32 reserved1;
3707};
3708
3709
3710/*
3711 * zone A per-queue data
3712 */
3713struct xstorm_queue_zone_data {
3714 struct regpair reserved[4];
3715};
3716
3717
3718/*
3719 * zone B per-VF data
3720 */
3721struct xstorm_vf_zone_data {
3722 struct regpair reserved;
3723};
3724
3725#endif /* BNX2X_HSI_H */