blob: 5bfdbcc94a7c0338cfd363ef7495db66e2bece9c [file] [log] [blame]
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001/* bnx2x_hsi.h: Broadcom Everest network driver.
2 *
Dmitry Kravkov5de92402011-05-04 23:51:13 +00003 * Copyright (c) 2007-2011 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
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000014#define FW_ENCODE_32BIT_PATTERN 0x1e1e1e1e
15
Michael Chane2513062009-10-10 13:46:58 +000016struct license_key {
17 u32 reserved[6];
18
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000019 u32 max_iscsi_conn;
20#define BNX2X_MAX_ISCSI_TRGT_CONN_MASK 0xFFFF
21#define BNX2X_MAX_ISCSI_TRGT_CONN_SHIFT 0
22#define BNX2X_MAX_ISCSI_INIT_CONN_MASK 0xFFFF0000
23#define BNX2X_MAX_ISCSI_INIT_CONN_SHIFT 16
Michael Chane2513062009-10-10 13:46:58 +000024
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000025 u32 reserved_a;
26
27 u32 max_fcoe_conn;
28#define BNX2X_MAX_FCOE_TRGT_CONN_MASK 0xFFFF
29#define BNX2X_MAX_FCOE_TRGT_CONN_SHIFT 0
30#define BNX2X_MAX_FCOE_INIT_CONN_MASK 0xFFFF0000
31#define BNX2X_MAX_FCOE_INIT_CONN_SHIFT 16
32
33 u32 reserved_b[4];
Michael Chane2513062009-10-10 13:46:58 +000034};
35
Eliezer Tamirf1410642008-02-28 11:51:50 -080036#define PORT_0 0
37#define PORT_1 1
38#define PORT_MAX 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020039
40/****************************************************************************
41 * Shared HW configuration *
42 ****************************************************************************/
43struct shared_hw_cfg { /* NVRAM Offset */
44 /* Up to 16 bytes of NULL-terminated string */
45 u8 part_num[16]; /* 0x104 */
46
47 u32 config; /* 0x114 */
48#define SHARED_HW_CFG_MDIO_VOLTAGE_MASK 0x00000001
49#define SHARED_HW_CFG_MDIO_VOLTAGE_SHIFT 0
50#define SHARED_HW_CFG_MDIO_VOLTAGE_1_2V 0x00000000
51#define SHARED_HW_CFG_MDIO_VOLTAGE_2_5V 0x00000001
52#define SHARED_HW_CFG_MCP_RST_ON_CORE_RST_EN 0x00000002
53
54#define SHARED_HW_CFG_PORT_SWAP 0x00000004
55
56#define SHARED_HW_CFG_BEACON_WOL_EN 0x00000008
57
58#define SHARED_HW_CFG_MFW_SELECT_MASK 0x00000700
59#define SHARED_HW_CFG_MFW_SELECT_SHIFT 8
60 /* Whatever MFW found in NVM
61 (if multiple found, priority order is: NC-SI, UMP, IPMI) */
62#define SHARED_HW_CFG_MFW_SELECT_DEFAULT 0x00000000
63#define SHARED_HW_CFG_MFW_SELECT_NC_SI 0x00000100
64#define SHARED_HW_CFG_MFW_SELECT_UMP 0x00000200
65#define SHARED_HW_CFG_MFW_SELECT_IPMI 0x00000300
66 /* Use SPIO4 as an arbiter between: 0-NC_SI, 1-IPMI
67 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
68#define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_IPMI 0x00000400
69 /* Use SPIO4 as an arbiter between: 0-UMP, 1-IPMI
70 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
71#define SHARED_HW_CFG_MFW_SELECT_SPIO4_UMP_IPMI 0x00000500
72 /* Use SPIO4 as an arbiter between: 0-NC-SI, 1-UMP
73 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
74#define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_UMP 0x00000600
75
76#define SHARED_HW_CFG_LED_MODE_MASK 0x000f0000
77#define SHARED_HW_CFG_LED_MODE_SHIFT 16
78#define SHARED_HW_CFG_LED_MAC1 0x00000000
79#define SHARED_HW_CFG_LED_PHY1 0x00010000
80#define SHARED_HW_CFG_LED_PHY2 0x00020000
81#define SHARED_HW_CFG_LED_PHY3 0x00030000
82#define SHARED_HW_CFG_LED_MAC2 0x00040000
83#define SHARED_HW_CFG_LED_PHY4 0x00050000
84#define SHARED_HW_CFG_LED_PHY5 0x00060000
85#define SHARED_HW_CFG_LED_PHY6 0x00070000
86#define SHARED_HW_CFG_LED_MAC3 0x00080000
87#define SHARED_HW_CFG_LED_PHY7 0x00090000
88#define SHARED_HW_CFG_LED_PHY9 0x000a0000
89#define SHARED_HW_CFG_LED_PHY11 0x000b0000
90#define SHARED_HW_CFG_LED_MAC4 0x000c0000
91#define SHARED_HW_CFG_LED_PHY8 0x000d0000
Yaniv Rosner7f02c4a2010-09-07 11:41:23 +000092#define SHARED_HW_CFG_LED_EXTPHY1 0x000e0000
93
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020094
95#define SHARED_HW_CFG_AN_ENABLE_MASK 0x3f000000
96#define SHARED_HW_CFG_AN_ENABLE_SHIFT 24
97#define SHARED_HW_CFG_AN_ENABLE_CL37 0x01000000
98#define SHARED_HW_CFG_AN_ENABLE_CL73 0x02000000
99#define SHARED_HW_CFG_AN_ENABLE_BAM 0x04000000
100#define SHARED_HW_CFG_AN_ENABLE_PARALLEL_DETECTION 0x08000000
101#define SHARED_HW_CFG_AN_EN_SGMII_FIBER_AUTO_DETECT 0x10000000
102#define SHARED_HW_CFG_AN_ENABLE_REMOTE_PHY 0x20000000
103
104 u32 config2; /* 0x118 */
105 /* one time auto detect grace period (in sec) */
106#define SHARED_HW_CFG_GRACE_PERIOD_MASK 0x000000ff
107#define SHARED_HW_CFG_GRACE_PERIOD_SHIFT 0
108
109#define SHARED_HW_CFG_PCIE_GEN2_ENABLED 0x00000100
110
111 /* The default value for the core clock is 250MHz and it is
112 achieved by setting the clock change to 4 */
113#define SHARED_HW_CFG_CLOCK_CHANGE_MASK 0x00000e00
114#define SHARED_HW_CFG_CLOCK_CHANGE_SHIFT 9
115
116#define SHARED_HW_CFG_SMBUS_TIMING_100KHZ 0x00000000
117#define SHARED_HW_CFG_SMBUS_TIMING_400KHZ 0x00001000
118
Eliezer Tamirf1410642008-02-28 11:51:50 -0800119#define SHARED_HW_CFG_HIDE_PORT1 0x00002000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200120
Eilon Greensteinfd4ef402009-07-21 05:47:27 +0000121 /* The fan failure mechanism is usually related to the PHY type
122 since the power consumption of the board is determined by the PHY.
123 Currently, fan is required for most designs with SFX7101, BCM8727
124 and BCM8481. If a fan is not required for a board which uses one
125 of those PHYs, this field should be set to "Disabled". If a fan is
126 required for a different PHY type, this option should be set to
127 "Enabled".
128 The fan failure indication is expected on
129 SPIO5 */
130#define SHARED_HW_CFG_FAN_FAILURE_MASK 0x00180000
131#define SHARED_HW_CFG_FAN_FAILURE_SHIFT 19
132#define SHARED_HW_CFG_FAN_FAILURE_PHY_TYPE 0x00000000
133#define SHARED_HW_CFG_FAN_FAILURE_DISABLED 0x00080000
134#define SHARED_HW_CFG_FAN_FAILURE_ENABLED 0x00100000
135
Yaniv Rosnere10bc842010-09-07 11:40:50 +0000136 /* Set the MDC/MDIO access for the first external phy */
137#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_MASK 0x1C000000
138#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SHIFT 26
139#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_PHY_TYPE 0x00000000
140#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC0 0x04000000
141#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC1 0x08000000
142#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_BOTH 0x0c000000
143#define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SWAPPED 0x10000000
144
145 /* Set the MDC/MDIO access for the second external phy */
146#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_MASK 0xE0000000
147#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SHIFT 29
148#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_PHY_TYPE 0x00000000
149#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC0 0x20000000
150#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC1 0x40000000
151#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_BOTH 0x60000000
152#define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SWAPPED 0x80000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200153 u32 power_dissipated; /* 0x11c */
154#define SHARED_HW_CFG_POWER_DIS_CMN_MASK 0xff000000
155#define SHARED_HW_CFG_POWER_DIS_CMN_SHIFT 24
156
157#define SHARED_HW_CFG_POWER_MGNT_SCALE_MASK 0x00ff0000
158#define SHARED_HW_CFG_POWER_MGNT_SCALE_SHIFT 16
159#define SHARED_HW_CFG_POWER_MGNT_UNKNOWN_SCALE 0x00000000
160#define SHARED_HW_CFG_POWER_MGNT_DOT_1_WATT 0x00010000
161#define SHARED_HW_CFG_POWER_MGNT_DOT_01_WATT 0x00020000
162#define SHARED_HW_CFG_POWER_MGNT_DOT_001_WATT 0x00030000
163
164 u32 ump_nc_si_config; /* 0x120 */
165#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MASK 0x00000003
166#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_SHIFT 0
167#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MAC 0x00000000
168#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_PHY 0x00000001
169#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MII 0x00000000
170#define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_RMII 0x00000002
171
172#define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_MASK 0x00000f00
173#define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_SHIFT 8
174
175#define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_MASK 0x00ff0000
176#define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_SHIFT 16
177#define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_NONE 0x00000000
178#define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_BCM5221 0x00010000
179
180 u32 board; /* 0x124 */
Eilon Greenstein35b19ba2009-02-12 08:36:47 +0000181#define SHARED_HW_CFG_BOARD_REV_MASK 0x00FF0000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200182#define SHARED_HW_CFG_BOARD_REV_SHIFT 16
183
Eilon Greenstein35b19ba2009-02-12 08:36:47 +0000184#define SHARED_HW_CFG_BOARD_MAJOR_VER_MASK 0x0F000000
185#define SHARED_HW_CFG_BOARD_MAJOR_VER_SHIFT 24
186
187#define SHARED_HW_CFG_BOARD_MINOR_VER_MASK 0xF0000000
188#define SHARED_HW_CFG_BOARD_MINOR_VER_SHIFT 28
189
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200190 u32 reserved; /* 0x128 */
191
192};
193
Eliezer Tamirf1410642008-02-28 11:51:50 -0800194
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200195/****************************************************************************
196 * Port HW configuration *
197 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -0800198struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200199
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200200 u32 pci_id;
201#define PORT_HW_CFG_PCI_VENDOR_ID_MASK 0xffff0000
202#define PORT_HW_CFG_PCI_DEVICE_ID_MASK 0x0000ffff
203
204 u32 pci_sub_id;
205#define PORT_HW_CFG_PCI_SUBSYS_DEVICE_ID_MASK 0xffff0000
206#define PORT_HW_CFG_PCI_SUBSYS_VENDOR_ID_MASK 0x0000ffff
207
208 u32 power_dissipated;
209#define PORT_HW_CFG_POWER_DIS_D3_MASK 0xff000000
210#define PORT_HW_CFG_POWER_DIS_D3_SHIFT 24
211#define PORT_HW_CFG_POWER_DIS_D2_MASK 0x00ff0000
212#define PORT_HW_CFG_POWER_DIS_D2_SHIFT 16
213#define PORT_HW_CFG_POWER_DIS_D1_MASK 0x0000ff00
214#define PORT_HW_CFG_POWER_DIS_D1_SHIFT 8
215#define PORT_HW_CFG_POWER_DIS_D0_MASK 0x000000ff
216#define PORT_HW_CFG_POWER_DIS_D0_SHIFT 0
217
218 u32 power_consumed;
219#define PORT_HW_CFG_POWER_CONS_D3_MASK 0xff000000
220#define PORT_HW_CFG_POWER_CONS_D3_SHIFT 24
221#define PORT_HW_CFG_POWER_CONS_D2_MASK 0x00ff0000
222#define PORT_HW_CFG_POWER_CONS_D2_SHIFT 16
223#define PORT_HW_CFG_POWER_CONS_D1_MASK 0x0000ff00
224#define PORT_HW_CFG_POWER_CONS_D1_SHIFT 8
225#define PORT_HW_CFG_POWER_CONS_D0_MASK 0x000000ff
226#define PORT_HW_CFG_POWER_CONS_D0_SHIFT 0
227
228 u32 mac_upper;
229#define PORT_HW_CFG_UPPERMAC_MASK 0x0000ffff
230#define PORT_HW_CFG_UPPERMAC_SHIFT 0
231 u32 mac_lower;
232
233 u32 iscsi_mac_upper; /* Upper 16 bits are always zeroes */
234 u32 iscsi_mac_lower;
235
236 u32 rdma_mac_upper; /* Upper 16 bits are always zeroes */
237 u32 rdma_mac_lower;
238
239 u32 serdes_config;
Eilon Greensteinc2c8b032009-02-12 08:37:14 +0000240#define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_MASK 0x0000FFFF
241#define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200242
Eilon Greensteinc2c8b032009-02-12 08:37:14 +0000243#define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_MASK 0xFFFF0000
244#define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_SHIFT 16
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200245
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200246
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000247 u32 Reserved0[3]; /* 0x158 */
248 /* Controls the TX laser of the SFP+ module */
249 u32 sfp_ctrl; /* 0x164 */
250#define PORT_HW_CFG_TX_LASER_MASK 0x000000FF
251#define PORT_HW_CFG_TX_LASER_SHIFT 0
252#define PORT_HW_CFG_TX_LASER_MDIO 0x00000000
253#define PORT_HW_CFG_TX_LASER_GPIO0 0x00000001
254#define PORT_HW_CFG_TX_LASER_GPIO1 0x00000002
255#define PORT_HW_CFG_TX_LASER_GPIO2 0x00000003
256#define PORT_HW_CFG_TX_LASER_GPIO3 0x00000004
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200257
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000258 /* Controls the fault module LED of the SFP+ */
259#define PORT_HW_CFG_FAULT_MODULE_LED_MASK 0x0000FF00
260#define PORT_HW_CFG_FAULT_MODULE_LED_SHIFT 8
261#define PORT_HW_CFG_FAULT_MODULE_LED_GPIO0 0x00000000
262#define PORT_HW_CFG_FAULT_MODULE_LED_GPIO1 0x00000100
263#define PORT_HW_CFG_FAULT_MODULE_LED_GPIO2 0x00000200
264#define PORT_HW_CFG_FAULT_MODULE_LED_GPIO3 0x00000300
265#define PORT_HW_CFG_FAULT_MODULE_LED_DISABLED 0x00000400
Yaniv Rosner1ac9e422011-05-31 21:26:11 +0000266 u32 Reserved01[11]; /* 0x158 */
267
268 u32 media_type; /* 0x194 */
269#define PORT_HW_CFG_MEDIA_TYPE_PHY0_MASK 0x000000FF
270#define PORT_HW_CFG_MEDIA_TYPE_PHY0_SHIFT 0
271
272#define PORT_HW_CFG_MEDIA_TYPE_PHY1_MASK 0x0000FF00
273#define PORT_HW_CFG_MEDIA_TYPE_PHY1_SHIFT 8
274
275#define PORT_HW_CFG_MEDIA_TYPE_PHY2_MASK 0x00FF0000
276#define PORT_HW_CFG_MEDIA_TYPE_PHY2_SHIFT 16
Eilon Greensteinc2c8b032009-02-12 08:37:14 +0000277 /* for external PHY, or forced mode or during AN */
278 u16 xgxs_config_rx[4]; /* 0x198 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200279
Eilon Greensteinc2c8b032009-02-12 08:37:14 +0000280 u16 xgxs_config_tx[4]; /* 0x1A0 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200281
Yaniv Rosner121839b2010-11-01 05:32:38 +0000282 u32 Reserved1[56]; /* 0x1A8 */
283 u32 default_cfg; /* 0x288 */
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000284#define PORT_HW_CFG_GPIO0_CONFIG_MASK 0x00000003
285#define PORT_HW_CFG_GPIO0_CONFIG_SHIFT 0
286#define PORT_HW_CFG_GPIO0_CONFIG_NA 0x00000000
287#define PORT_HW_CFG_GPIO0_CONFIG_LOW 0x00000001
288#define PORT_HW_CFG_GPIO0_CONFIG_HIGH 0x00000002
289#define PORT_HW_CFG_GPIO0_CONFIG_INPUT 0x00000003
290
291#define PORT_HW_CFG_GPIO1_CONFIG_MASK 0x0000000C
292#define PORT_HW_CFG_GPIO1_CONFIG_SHIFT 2
293#define PORT_HW_CFG_GPIO1_CONFIG_NA 0x00000000
294#define PORT_HW_CFG_GPIO1_CONFIG_LOW 0x00000004
295#define PORT_HW_CFG_GPIO1_CONFIG_HIGH 0x00000008
296#define PORT_HW_CFG_GPIO1_CONFIG_INPUT 0x0000000c
297
298#define PORT_HW_CFG_GPIO2_CONFIG_MASK 0x00000030
299#define PORT_HW_CFG_GPIO2_CONFIG_SHIFT 4
300#define PORT_HW_CFG_GPIO2_CONFIG_NA 0x00000000
301#define PORT_HW_CFG_GPIO2_CONFIG_LOW 0x00000010
302#define PORT_HW_CFG_GPIO2_CONFIG_HIGH 0x00000020
303#define PORT_HW_CFG_GPIO2_CONFIG_INPUT 0x00000030
304
305#define PORT_HW_CFG_GPIO3_CONFIG_MASK 0x000000C0
306#define PORT_HW_CFG_GPIO3_CONFIG_SHIFT 6
307#define PORT_HW_CFG_GPIO3_CONFIG_NA 0x00000000
308#define PORT_HW_CFG_GPIO3_CONFIG_LOW 0x00000040
309#define PORT_HW_CFG_GPIO3_CONFIG_HIGH 0x00000080
310#define PORT_HW_CFG_GPIO3_CONFIG_INPUT 0x000000c0
311
312 /*
313 * When KR link is required to be set to force which is not
314 * KR-compliant, this parameter determine what is the trigger for it.
315 * When GPIO is selected, low input will force the speed. Currently
316 * default speed is 1G. In the future, it may be widen to select the
317 * forced speed in with another parameter. Note when force-1G is
318 * enabled, it override option 56: Link Speed option.
319 */
320#define PORT_HW_CFG_FORCE_KR_ENABLER_MASK 0x00000F00
321#define PORT_HW_CFG_FORCE_KR_ENABLER_SHIFT 8
322#define PORT_HW_CFG_FORCE_KR_ENABLER_NOT_FORCED 0x00000000
323#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P0 0x00000100
324#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P0 0x00000200
325#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P0 0x00000300
326#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P0 0x00000400
327#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P1 0x00000500
328#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P1 0x00000600
329#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P1 0x00000700
330#define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P1 0x00000800
331#define PORT_HW_CFG_FORCE_KR_ENABLER_FORCED 0x00000900
332 /* Enable to determine with which GPIO to reset the external phy */
333#define PORT_HW_CFG_EXT_PHY_GPIO_RST_MASK 0x000F0000
334#define PORT_HW_CFG_EXT_PHY_GPIO_RST_SHIFT 16
335#define PORT_HW_CFG_EXT_PHY_GPIO_RST_PHY_TYPE 0x00000000
336#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P0 0x00010000
337#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P0 0x00020000
338#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P0 0x00030000
339#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P0 0x00040000
340#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P1 0x00050000
341#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P1 0x00060000
342#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P1 0x00070000
343#define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P1 0x00080000
Yaniv Rosner121839b2010-11-01 05:32:38 +0000344 /* Enable BAM on KR */
345#define PORT_HW_CFG_ENABLE_BAM_ON_KR_MASK 0x00100000
346#define PORT_HW_CFG_ENABLE_BAM_ON_KR_SHIFT 20
347#define PORT_HW_CFG_ENABLE_BAM_ON_KR_DISABLED 0x00000000
348#define PORT_HW_CFG_ENABLE_BAM_ON_KR_ENABLED 0x00100000
349
Yaniv Rosner1bef68e2011-01-31 04:22:46 +0000350 /* Enable Common Mode Sense */
351#define PORT_HW_CFG_ENABLE_CMS_MASK 0x00200000
352#define PORT_HW_CFG_ENABLE_CMS_SHIFT 21
353#define PORT_HW_CFG_ENABLE_CMS_DISABLED 0x00000000
354#define PORT_HW_CFG_ENABLE_CMS_ENABLED 0x00200000
355
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000356 u32 speed_capability_mask2; /* 0x28C */
357#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_MASK 0x0000FFFF
358#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_SHIFT 0
359#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10M_FULL 0x00000001
360#define PORT_HW_CFG_SPEED_CAPABILITY2_D3__ 0x00000002
361#define PORT_HW_CFG_SPEED_CAPABILITY2_D3___ 0x00000004
362#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_100M_FULL 0x00000008
363#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_1G 0x00000010
364#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_2_DOT_5G 0x00000020
365#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10G 0x00000040
366#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_12G 0x00000080
367#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_12_DOT_5G 0x00000100
368#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_13G 0x00000200
369#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_15G 0x00000400
370#define PORT_HW_CFG_SPEED_CAPABILITY2_D3_16G 0x00000800
371
372#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_MASK 0xFFFF0000
373#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_SHIFT 16
374#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10M_FULL 0x00010000
375#define PORT_HW_CFG_SPEED_CAPABILITY2_D0__ 0x00020000
376#define PORT_HW_CFG_SPEED_CAPABILITY2_D0___ 0x00040000
377#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_100M_FULL 0x00080000
378#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_1G 0x00100000
379#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_2_DOT_5G 0x00200000
380#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10G 0x00400000
381#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_12G 0x00800000
382#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_12_DOT_5G 0x01000000
383#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_13G 0x02000000
384#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_15G 0x04000000
385#define PORT_HW_CFG_SPEED_CAPABILITY2_D0_16G 0x08000000
386
387 /* In the case where two media types (e.g. copper and fiber) are
388 present and electrically active at the same time, PHY Selection
389 will determine which of the two PHYs will be designated as the
390 Active PHY and used for a connection to the network. */
391 u32 multi_phy_config; /* 0x290 */
392#define PORT_HW_CFG_PHY_SELECTION_MASK 0x00000007
393#define PORT_HW_CFG_PHY_SELECTION_SHIFT 0
394#define PORT_HW_CFG_PHY_SELECTION_HARDWARE_DEFAULT 0x00000000
395#define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY 0x00000001
396#define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY 0x00000002
397#define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY 0x00000003
398#define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY_PRIORITY 0x00000004
399
400 /* When enabled, all second phy nvram parameters will be swapped
401 with the first phy parameters */
402#define PORT_HW_CFG_PHY_SWAPPED_MASK 0x00000008
403#define PORT_HW_CFG_PHY_SWAPPED_SHIFT 3
404#define PORT_HW_CFG_PHY_SWAPPED_DISABLED 0x00000000
405#define PORT_HW_CFG_PHY_SWAPPED_ENABLED 0x00000008
406
407
408 /* Address of the second external phy */
409 u32 external_phy_config2; /* 0x294 */
410#define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_MASK 0x000000FF
411#define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_SHIFT 0
412
413 /* The second XGXS external PHY type */
414#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_MASK 0x0000FF00
415#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SHIFT 8
416#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_DIRECT 0x00000000
417#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8071 0x00000100
418#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8072 0x00000200
419#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8073 0x00000300
420#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8705 0x00000400
421#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8706 0x00000500
422#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8726 0x00000600
423#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8481 0x00000700
424#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SFX7101 0x00000800
425#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727 0x00000900
426#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727_NOC 0x00000a00
427#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84823 0x00000b00
428#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54640 0x00000c00
429#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84833 0x00000d00
Yaniv Rosnere4d78f12011-05-31 21:25:55 +0000430#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8722 0x00000f00
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000431#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_FAILURE 0x0000fd00
432#define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_NOT_CONN 0x0000ff00
433
434 /* 4 times 16 bits for all 4 lanes. For some external PHYs (such as
435 8706, 8726 and 8727) not all 4 values are needed. */
436 u16 xgxs_config2_rx[4]; /* 0x296 */
437 u16 xgxs_config2_tx[4]; /* 0x2A0 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200438
439 u32 lane_config;
440#define PORT_HW_CFG_LANE_SWAP_CFG_MASK 0x0000ffff
441#define PORT_HW_CFG_LANE_SWAP_CFG_SHIFT 0
Dmitry Kravkov523224a2010-10-06 03:23:26 +0000442
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200443#define PORT_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000ff
444#define PORT_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0
445#define PORT_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000ff00
446#define PORT_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8
447#define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_MASK 0x0000c000
448#define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_SHIFT 14
449 /* AN and forced */
450#define PORT_HW_CFG_LANE_SWAP_CFG_01230123 0x00001b1b
451 /* forced only */
452#define PORT_HW_CFG_LANE_SWAP_CFG_01233210 0x00001be4
453 /* forced only */
454#define PORT_HW_CFG_LANE_SWAP_CFG_31203120 0x0000d8d8
455 /* forced only */
456#define PORT_HW_CFG_LANE_SWAP_CFG_32103210 0x0000e4e4
Yaniv Rosner74d7a112011-01-18 04:33:18 +0000457 /* Indicate whether to swap the external phy polarity */
458#define PORT_HW_CFG_SWAP_PHY_POLARITY_MASK 0x00010000
459#define PORT_HW_CFG_SWAP_PHY_POLARITY_DISABLED 0x00000000
460#define PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED 0x00010000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200461
462 u32 external_phy_config;
463#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK 0xff000000
464#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_SHIFT 24
465#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT 0x00000000
466#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_BCM5482 0x01000000
467#define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_NOT_CONN 0xff000000
468
469#define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_MASK 0x00ff0000
470#define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_SHIFT 16
471
472#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK 0x0000ff00
473#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SHIFT 8
474#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT 0x00000000
475#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8071 0x00000100
476#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072 0x00000200
477#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073 0x00000300
478#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705 0x00000400
479#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706 0x00000500
Eilon Greenstein589abe32009-02-12 08:36:55 +0000480#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726 0x00000600
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200481#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481 0x00000700
Eliezer Tamirf1410642008-02-28 11:51:50 -0800482#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101 0x00000800
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000483#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727 0x00000900
484#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727_NOC 0x00000a00
Yaniv Rosner4f60dab2009-11-05 19:18:23 +0200485#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823 0x00000b00
Yaniv Rosnerc87bca12011-01-31 04:22:41 +0000486#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833 0x00000d00
Yaniv Rosnere4d78f12011-05-31 21:25:55 +0000487#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722 0x00000f00
Eliezer Tamirf1410642008-02-28 11:51:50 -0800488#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200489#define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00
490
491#define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK 0x000000ff
492#define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT 0
493
494 u32 speed_capability_mask;
495#define PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK 0xffff0000
496#define PORT_HW_CFG_SPEED_CAPABILITY_D0_SHIFT 16
497#define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL 0x00010000
498#define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF 0x00020000
499#define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF 0x00040000
500#define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL 0x00080000
501#define PORT_HW_CFG_SPEED_CAPABILITY_D0_1G 0x00100000
502#define PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G 0x00200000
503#define PORT_HW_CFG_SPEED_CAPABILITY_D0_10G 0x00400000
504#define PORT_HW_CFG_SPEED_CAPABILITY_D0_12G 0x00800000
505#define PORT_HW_CFG_SPEED_CAPABILITY_D0_12_5G 0x01000000
506#define PORT_HW_CFG_SPEED_CAPABILITY_D0_13G 0x02000000
507#define PORT_HW_CFG_SPEED_CAPABILITY_D0_15G 0x04000000
508#define PORT_HW_CFG_SPEED_CAPABILITY_D0_16G 0x08000000
509#define PORT_HW_CFG_SPEED_CAPABILITY_D0_RESERVED 0xf0000000
510
511#define PORT_HW_CFG_SPEED_CAPABILITY_D3_MASK 0x0000ffff
512#define PORT_HW_CFG_SPEED_CAPABILITY_D3_SHIFT 0
513#define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_FULL 0x00000001
514#define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_HALF 0x00000002
515#define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_HALF 0x00000004
516#define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_FULL 0x00000008
517#define PORT_HW_CFG_SPEED_CAPABILITY_D3_1G 0x00000010
518#define PORT_HW_CFG_SPEED_CAPABILITY_D3_2_5G 0x00000020
519#define PORT_HW_CFG_SPEED_CAPABILITY_D3_10G 0x00000040
520#define PORT_HW_CFG_SPEED_CAPABILITY_D3_12G 0x00000080
521#define PORT_HW_CFG_SPEED_CAPABILITY_D3_12_5G 0x00000100
522#define PORT_HW_CFG_SPEED_CAPABILITY_D3_13G 0x00000200
523#define PORT_HW_CFG_SPEED_CAPABILITY_D3_15G 0x00000400
524#define PORT_HW_CFG_SPEED_CAPABILITY_D3_16G 0x00000800
525#define PORT_HW_CFG_SPEED_CAPABILITY_D3_RESERVED 0x0000f000
526
527 u32 reserved[2];
528
529};
530
Eliezer Tamirf1410642008-02-28 11:51:50 -0800531
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200532/****************************************************************************
533 * Shared Feature configuration *
534 ****************************************************************************/
535struct shared_feat_cfg { /* NVRAM Offset */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800536
537 u32 config; /* 0x450 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200538#define SHARED_FEATURE_BMC_ECHO_MODE_EN 0x00000001
Eilon Greenstein589abe32009-02-12 08:36:55 +0000539
540 /* Use the values from options 47 and 48 instead of the HW default
541 values */
542#define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_DISABLED 0x00000000
543#define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_ENABLED 0x00000002
544
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -0800545#define SHARED_FEAT_CFG_FORCE_SF_MODE_MASK 0x00000700
546#define SHARED_FEAT_CFG_FORCE_SF_MODE_SHIFT 8
547#define SHARED_FEAT_CFG_FORCE_SF_MODE_MF_ALLOWED 0x00000000
548#define SHARED_FEAT_CFG_FORCE_SF_MODE_FORCED_SF 0x00000100
549#define SHARED_FEAT_CFG_FORCE_SF_MODE_SPIO4 0x00000200
550#define SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT 0x00000300
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200551
552};
553
554
555/****************************************************************************
556 * Port Feature configuration *
557 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -0800558struct port_feat_cfg { /* port 0: 0x454 port 1: 0x4c8 */
559
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200560 u32 config;
561#define PORT_FEATURE_BAR1_SIZE_MASK 0x0000000f
562#define PORT_FEATURE_BAR1_SIZE_SHIFT 0
563#define PORT_FEATURE_BAR1_SIZE_DISABLED 0x00000000
564#define PORT_FEATURE_BAR1_SIZE_64K 0x00000001
565#define PORT_FEATURE_BAR1_SIZE_128K 0x00000002
566#define PORT_FEATURE_BAR1_SIZE_256K 0x00000003
567#define PORT_FEATURE_BAR1_SIZE_512K 0x00000004
568#define PORT_FEATURE_BAR1_SIZE_1M 0x00000005
569#define PORT_FEATURE_BAR1_SIZE_2M 0x00000006
570#define PORT_FEATURE_BAR1_SIZE_4M 0x00000007
571#define PORT_FEATURE_BAR1_SIZE_8M 0x00000008
572#define PORT_FEATURE_BAR1_SIZE_16M 0x00000009
573#define PORT_FEATURE_BAR1_SIZE_32M 0x0000000a
574#define PORT_FEATURE_BAR1_SIZE_64M 0x0000000b
575#define PORT_FEATURE_BAR1_SIZE_128M 0x0000000c
576#define PORT_FEATURE_BAR1_SIZE_256M 0x0000000d
577#define PORT_FEATURE_BAR1_SIZE_512M 0x0000000e
578#define PORT_FEATURE_BAR1_SIZE_1G 0x0000000f
579#define PORT_FEATURE_BAR2_SIZE_MASK 0x000000f0
580#define PORT_FEATURE_BAR2_SIZE_SHIFT 4
581#define PORT_FEATURE_BAR2_SIZE_DISABLED 0x00000000
582#define PORT_FEATURE_BAR2_SIZE_64K 0x00000010
583#define PORT_FEATURE_BAR2_SIZE_128K 0x00000020
584#define PORT_FEATURE_BAR2_SIZE_256K 0x00000030
585#define PORT_FEATURE_BAR2_SIZE_512K 0x00000040
586#define PORT_FEATURE_BAR2_SIZE_1M 0x00000050
587#define PORT_FEATURE_BAR2_SIZE_2M 0x00000060
588#define PORT_FEATURE_BAR2_SIZE_4M 0x00000070
589#define PORT_FEATURE_BAR2_SIZE_8M 0x00000080
590#define PORT_FEATURE_BAR2_SIZE_16M 0x00000090
591#define PORT_FEATURE_BAR2_SIZE_32M 0x000000a0
592#define PORT_FEATURE_BAR2_SIZE_64M 0x000000b0
593#define PORT_FEATURE_BAR2_SIZE_128M 0x000000c0
594#define PORT_FEATURE_BAR2_SIZE_256M 0x000000d0
595#define PORT_FEATURE_BAR2_SIZE_512M 0x000000e0
596#define PORT_FEATURE_BAR2_SIZE_1G 0x000000f0
597#define PORT_FEATURE_EN_SIZE_MASK 0x07000000
598#define PORT_FEATURE_EN_SIZE_SHIFT 24
599#define PORT_FEATURE_WOL_ENABLED 0x01000000
600#define PORT_FEATURE_MBA_ENABLED 0x02000000
601#define PORT_FEATURE_MFW_ENABLED 0x04000000
602
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000603 /* Reserved bits: 28-29 */
604 /* Check the optic vendor via i2c against a list of approved modules
605 in a separate nvram image */
606#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK 0xE0000000
607#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_SHIFT 29
608#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_NO_ENFORCEMENT 0x00000000
609#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER 0x20000000
610#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_WARNING_MSG 0x40000000
611#define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_POWER_DOWN 0x60000000
612
Eilon Greenstein589abe32009-02-12 08:36:55 +0000613
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200614 u32 wol_config;
615 /* Default is used when driver sets to "auto" mode */
616#define PORT_FEATURE_WOL_DEFAULT_MASK 0x00000003
617#define PORT_FEATURE_WOL_DEFAULT_SHIFT 0
618#define PORT_FEATURE_WOL_DEFAULT_DISABLE 0x00000000
619#define PORT_FEATURE_WOL_DEFAULT_MAGIC 0x00000001
620#define PORT_FEATURE_WOL_DEFAULT_ACPI 0x00000002
621#define PORT_FEATURE_WOL_DEFAULT_MAGIC_AND_ACPI 0x00000003
622#define PORT_FEATURE_WOL_RES_PAUSE_CAP 0x00000004
623#define PORT_FEATURE_WOL_RES_ASYM_PAUSE_CAP 0x00000008
624#define PORT_FEATURE_WOL_ACPI_UPON_MGMT 0x00000010
625
626 u32 mba_config;
627#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_MASK 0x00000003
628#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_SHIFT 0
629#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_PXE 0x00000000
630#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_RPL 0x00000001
631#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_BOOTP 0x00000002
632#define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_ISCSIB 0x00000003
633#define PORT_FEATURE_MBA_RES_PAUSE_CAP 0x00000100
634#define PORT_FEATURE_MBA_RES_ASYM_PAUSE_CAP 0x00000200
635#define PORT_FEATURE_MBA_SETUP_PROMPT_ENABLE 0x00000400
636#define PORT_FEATURE_MBA_HOTKEY_CTRL_S 0x00000000
637#define PORT_FEATURE_MBA_HOTKEY_CTRL_B 0x00000800
638#define PORT_FEATURE_MBA_EXP_ROM_SIZE_MASK 0x000ff000
639#define PORT_FEATURE_MBA_EXP_ROM_SIZE_SHIFT 12
640#define PORT_FEATURE_MBA_EXP_ROM_SIZE_DISABLED 0x00000000
641#define PORT_FEATURE_MBA_EXP_ROM_SIZE_2K 0x00001000
642#define PORT_FEATURE_MBA_EXP_ROM_SIZE_4K 0x00002000
643#define PORT_FEATURE_MBA_EXP_ROM_SIZE_8K 0x00003000
644#define PORT_FEATURE_MBA_EXP_ROM_SIZE_16K 0x00004000
645#define PORT_FEATURE_MBA_EXP_ROM_SIZE_32K 0x00005000
646#define PORT_FEATURE_MBA_EXP_ROM_SIZE_64K 0x00006000
647#define PORT_FEATURE_MBA_EXP_ROM_SIZE_128K 0x00007000
648#define PORT_FEATURE_MBA_EXP_ROM_SIZE_256K 0x00008000
649#define PORT_FEATURE_MBA_EXP_ROM_SIZE_512K 0x00009000
650#define PORT_FEATURE_MBA_EXP_ROM_SIZE_1M 0x0000a000
651#define PORT_FEATURE_MBA_EXP_ROM_SIZE_2M 0x0000b000
652#define PORT_FEATURE_MBA_EXP_ROM_SIZE_4M 0x0000c000
653#define PORT_FEATURE_MBA_EXP_ROM_SIZE_8M 0x0000d000
654#define PORT_FEATURE_MBA_EXP_ROM_SIZE_16M 0x0000e000
655#define PORT_FEATURE_MBA_EXP_ROM_SIZE_32M 0x0000f000
656#define PORT_FEATURE_MBA_MSG_TIMEOUT_MASK 0x00f00000
657#define PORT_FEATURE_MBA_MSG_TIMEOUT_SHIFT 20
658#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_MASK 0x03000000
659#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_SHIFT 24
660#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_AUTO 0x00000000
661#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_BBS 0x01000000
662#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT18H 0x02000000
663#define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT19H 0x03000000
664#define PORT_FEATURE_MBA_LINK_SPEED_MASK 0x3c000000
665#define PORT_FEATURE_MBA_LINK_SPEED_SHIFT 26
666#define PORT_FEATURE_MBA_LINK_SPEED_AUTO 0x00000000
667#define PORT_FEATURE_MBA_LINK_SPEED_10HD 0x04000000
668#define PORT_FEATURE_MBA_LINK_SPEED_10FD 0x08000000
669#define PORT_FEATURE_MBA_LINK_SPEED_100HD 0x0c000000
670#define PORT_FEATURE_MBA_LINK_SPEED_100FD 0x10000000
671#define PORT_FEATURE_MBA_LINK_SPEED_1GBPS 0x14000000
672#define PORT_FEATURE_MBA_LINK_SPEED_2_5GBPS 0x18000000
673#define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_CX4 0x1c000000
674#define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_KX4 0x20000000
675#define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_KR 0x24000000
676#define PORT_FEATURE_MBA_LINK_SPEED_12GBPS 0x28000000
677#define PORT_FEATURE_MBA_LINK_SPEED_12_5GBPS 0x2c000000
678#define PORT_FEATURE_MBA_LINK_SPEED_13GBPS 0x30000000
679#define PORT_FEATURE_MBA_LINK_SPEED_15GBPS 0x34000000
680#define PORT_FEATURE_MBA_LINK_SPEED_16GBPS 0x38000000
681
682 u32 bmc_config;
683#define PORT_FEATURE_BMC_LINK_OVERRIDE_DEFAULT 0x00000000
684#define PORT_FEATURE_BMC_LINK_OVERRIDE_EN 0x00000001
685
686 u32 mba_vlan_cfg;
687#define PORT_FEATURE_MBA_VLAN_TAG_MASK 0x0000ffff
688#define PORT_FEATURE_MBA_VLAN_TAG_SHIFT 0
689#define PORT_FEATURE_MBA_VLAN_EN 0x00010000
690
691 u32 resource_cfg;
692#define PORT_FEATURE_RESOURCE_CFG_VALID 0x00000001
693#define PORT_FEATURE_RESOURCE_CFG_DIAG 0x00000002
694#define PORT_FEATURE_RESOURCE_CFG_L2 0x00000004
695#define PORT_FEATURE_RESOURCE_CFG_ISCSI 0x00000008
696#define PORT_FEATURE_RESOURCE_CFG_RDMA 0x00000010
697
698 u32 smbus_config;
699 /* Obsolete */
700#define PORT_FEATURE_SMBUS_EN 0x00000001
701#define PORT_FEATURE_SMBUS_ADDR_MASK 0x000000fe
702#define PORT_FEATURE_SMBUS_ADDR_SHIFT 1
703
Eliezer Tamirf1410642008-02-28 11:51:50 -0800704 u32 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200705
706 u32 link_config; /* Used as HW defaults for the driver */
707#define PORT_FEATURE_CONNECTED_SWITCH_MASK 0x03000000
708#define PORT_FEATURE_CONNECTED_SWITCH_SHIFT 24
709 /* (forced) low speed switch (< 10G) */
710#define PORT_FEATURE_CON_SWITCH_1G_SWITCH 0x00000000
711 /* (forced) high speed switch (>= 10G) */
712#define PORT_FEATURE_CON_SWITCH_10G_SWITCH 0x01000000
713#define PORT_FEATURE_CON_SWITCH_AUTO_DETECT 0x02000000
714#define PORT_FEATURE_CON_SWITCH_ONE_TIME_DETECT 0x03000000
715
716#define PORT_FEATURE_LINK_SPEED_MASK 0x000f0000
717#define PORT_FEATURE_LINK_SPEED_SHIFT 16
718#define PORT_FEATURE_LINK_SPEED_AUTO 0x00000000
719#define PORT_FEATURE_LINK_SPEED_10M_FULL 0x00010000
720#define PORT_FEATURE_LINK_SPEED_10M_HALF 0x00020000
721#define PORT_FEATURE_LINK_SPEED_100M_HALF 0x00030000
722#define PORT_FEATURE_LINK_SPEED_100M_FULL 0x00040000
723#define PORT_FEATURE_LINK_SPEED_1G 0x00050000
724#define PORT_FEATURE_LINK_SPEED_2_5G 0x00060000
725#define PORT_FEATURE_LINK_SPEED_10G_CX4 0x00070000
726#define PORT_FEATURE_LINK_SPEED_10G_KX4 0x00080000
727#define PORT_FEATURE_LINK_SPEED_10G_KR 0x00090000
728#define PORT_FEATURE_LINK_SPEED_12G 0x000a0000
729#define PORT_FEATURE_LINK_SPEED_12_5G 0x000b0000
730#define PORT_FEATURE_LINK_SPEED_13G 0x000c0000
731#define PORT_FEATURE_LINK_SPEED_15G 0x000d0000
732#define PORT_FEATURE_LINK_SPEED_16G 0x000e0000
733
734#define PORT_FEATURE_FLOW_CONTROL_MASK 0x00000700
735#define PORT_FEATURE_FLOW_CONTROL_SHIFT 8
736#define PORT_FEATURE_FLOW_CONTROL_AUTO 0x00000000
737#define PORT_FEATURE_FLOW_CONTROL_TX 0x00000100
738#define PORT_FEATURE_FLOW_CONTROL_RX 0x00000200
739#define PORT_FEATURE_FLOW_CONTROL_BOTH 0x00000300
740#define PORT_FEATURE_FLOW_CONTROL_NONE 0x00000400
741
742 /* The default for MCP link configuration,
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000743 uses the same defines as link_config */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200744 u32 mfw_wol_link_cfg;
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000745 /* The default for the driver of the second external phy,
746 uses the same defines as link_config */
747 u32 link_config2; /* 0x47C */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200748
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000749 /* The default for MCP of the second external phy,
750 uses the same defines as link_config */
751 u32 mfw_wol_link_cfg2; /* 0x480 */
752
753 u32 Reserved2[17]; /* 0x484 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200754
755};
756
757
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700758/****************************************************************************
759 * Device Information *
760 ****************************************************************************/
Eilon Greenstein5cd65a92009-02-12 08:38:11 +0000761struct shm_dev_info { /* size */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800762
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700763 u32 bc_rev; /* 8 bits each: major, minor, build */ /* 4 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800764
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700765 struct shared_hw_cfg shared_hw_config; /* 40 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800766
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700767 struct port_hw_cfg port_hw_config[PORT_MAX]; /* 400*2=800 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800768
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700769 struct shared_feat_cfg shared_feature_config; /* 4 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800770
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700771 struct port_feat_cfg port_feature_config[PORT_MAX];/* 116*2=232 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800772
773};
774
775
776#define FUNC_0 0
777#define FUNC_1 1
Eilon Greensteinad8d3942008-06-23 20:29:02 -0700778#define FUNC_2 2
779#define FUNC_3 3
780#define FUNC_4 4
781#define FUNC_5 5
782#define FUNC_6 6
783#define FUNC_7 7
Eliezer Tamirf1410642008-02-28 11:51:50 -0800784#define E1_FUNC_MAX 2
Eilon Greensteinad8d3942008-06-23 20:29:02 -0700785#define E1H_FUNC_MAX 8
Dmitry Kravkovf2e08992010-10-06 03:28:26 +0000786#define E2_FUNC_MAX 4 /* per path */
Eilon Greensteinad8d3942008-06-23 20:29:02 -0700787
788#define VN_0 0
789#define VN_1 1
790#define VN_2 2
791#define VN_3 3
792#define E1VN_MAX 1
793#define E1HVN_MAX 4
Eliezer Tamirf1410642008-02-28 11:51:50 -0800794
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +0000795#define E2_VF_MAX 64
Eliezer Tamirf1410642008-02-28 11:51:50 -0800796/* This value (in milliseconds) determines the frequency of the driver
797 * issuing the PULSE message code. The firmware monitors this periodic
798 * pulse to determine when to switch to an OS-absent mode. */
799#define DRV_PULSE_PERIOD_MS 250
800
801/* This value (in milliseconds) determines how long the driver should
802 * wait for an acknowledgement from the firmware before timing out. Once
803 * the firmware has timed out, the driver will assume there is no firmware
804 * running and there won't be any firmware-driver synchronization during a
805 * driver reset. */
806#define FW_ACK_TIME_OUT_MS 5000
807
808#define FW_ACK_POLL_TIME_MS 1
809
810#define FW_ACK_NUM_OF_POLL (FW_ACK_TIME_OUT_MS/FW_ACK_POLL_TIME_MS)
811
812/* LED Blink rate that will achieve ~15.9Hz */
813#define LED_BLINK_RATE_VAL 480
814
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200815/****************************************************************************
Eliezer Tamirf1410642008-02-28 11:51:50 -0800816 * Driver <-> FW Mailbox *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200817 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -0800818struct drv_port_mb {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200819
Eliezer Tamirf1410642008-02-28 11:51:50 -0800820 u32 link_status;
821 /* Driver should update this field on any link change event */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200822
Eliezer Tamirf1410642008-02-28 11:51:50 -0800823#define LINK_STATUS_LINK_FLAG_MASK 0x00000001
824#define LINK_STATUS_LINK_UP 0x00000001
825#define LINK_STATUS_SPEED_AND_DUPLEX_MASK 0x0000001E
826#define LINK_STATUS_SPEED_AND_DUPLEX_AN_NOT_COMPLETE (0<<1)
827#define LINK_STATUS_SPEED_AND_DUPLEX_10THD (1<<1)
828#define LINK_STATUS_SPEED_AND_DUPLEX_10TFD (2<<1)
829#define LINK_STATUS_SPEED_AND_DUPLEX_100TXHD (3<<1)
830#define LINK_STATUS_SPEED_AND_DUPLEX_100T4 (4<<1)
831#define LINK_STATUS_SPEED_AND_DUPLEX_100TXFD (5<<1)
832#define LINK_STATUS_SPEED_AND_DUPLEX_1000THD (6<<1)
833#define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD (7<<1)
834#define LINK_STATUS_SPEED_AND_DUPLEX_1000XFD (7<<1)
835#define LINK_STATUS_SPEED_AND_DUPLEX_2500THD (8<<1)
836#define LINK_STATUS_SPEED_AND_DUPLEX_2500TFD (9<<1)
837#define LINK_STATUS_SPEED_AND_DUPLEX_2500XFD (9<<1)
838#define LINK_STATUS_SPEED_AND_DUPLEX_10GTFD (10<<1)
839#define LINK_STATUS_SPEED_AND_DUPLEX_10GXFD (10<<1)
840#define LINK_STATUS_SPEED_AND_DUPLEX_12GTFD (11<<1)
841#define LINK_STATUS_SPEED_AND_DUPLEX_12GXFD (11<<1)
842#define LINK_STATUS_SPEED_AND_DUPLEX_12_5GTFD (12<<1)
843#define LINK_STATUS_SPEED_AND_DUPLEX_12_5GXFD (12<<1)
844#define LINK_STATUS_SPEED_AND_DUPLEX_13GTFD (13<<1)
845#define LINK_STATUS_SPEED_AND_DUPLEX_13GXFD (13<<1)
846#define LINK_STATUS_SPEED_AND_DUPLEX_15GTFD (14<<1)
847#define LINK_STATUS_SPEED_AND_DUPLEX_15GXFD (14<<1)
848#define LINK_STATUS_SPEED_AND_DUPLEX_16GTFD (15<<1)
849#define LINK_STATUS_SPEED_AND_DUPLEX_16GXFD (15<<1)
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200850
Eliezer Tamirf1410642008-02-28 11:51:50 -0800851#define LINK_STATUS_AUTO_NEGOTIATE_FLAG_MASK 0x00000020
852#define LINK_STATUS_AUTO_NEGOTIATE_ENABLED 0x00000020
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200853
Eliezer Tamirf1410642008-02-28 11:51:50 -0800854#define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE 0x00000040
855#define LINK_STATUS_PARALLEL_DETECTION_FLAG_MASK 0x00000080
856#define LINK_STATUS_PARALLEL_DETECTION_USED 0x00000080
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200857
Eliezer Tamirf1410642008-02-28 11:51:50 -0800858#define LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE 0x00000200
859#define LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE 0x00000400
860#define LINK_STATUS_LINK_PARTNER_100T4_CAPABLE 0x00000800
861#define LINK_STATUS_LINK_PARTNER_100TXFD_CAPABLE 0x00001000
862#define LINK_STATUS_LINK_PARTNER_100TXHD_CAPABLE 0x00002000
863#define LINK_STATUS_LINK_PARTNER_10TFD_CAPABLE 0x00004000
864#define LINK_STATUS_LINK_PARTNER_10THD_CAPABLE 0x00008000
865
866#define LINK_STATUS_TX_FLOW_CONTROL_FLAG_MASK 0x00010000
867#define LINK_STATUS_TX_FLOW_CONTROL_ENABLED 0x00010000
868
869#define LINK_STATUS_RX_FLOW_CONTROL_FLAG_MASK 0x00020000
870#define LINK_STATUS_RX_FLOW_CONTROL_ENABLED 0x00020000
871
872#define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK 0x000C0000
873#define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE (0<<18)
874#define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE (1<<18)
875#define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE (2<<18)
876#define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE (3<<18)
877
878#define LINK_STATUS_SERDES_LINK 0x00100000
879
880#define LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE 0x00200000
881#define LINK_STATUS_LINK_PARTNER_2500XHD_CAPABLE 0x00400000
882#define LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE 0x00800000
883#define LINK_STATUS_LINK_PARTNER_12GXFD_CAPABLE 0x01000000
884#define LINK_STATUS_LINK_PARTNER_12_5GXFD_CAPABLE 0x02000000
885#define LINK_STATUS_LINK_PARTNER_13GXFD_CAPABLE 0x04000000
886#define LINK_STATUS_LINK_PARTNER_15GXFD_CAPABLE 0x08000000
887#define LINK_STATUS_LINK_PARTNER_16GXFD_CAPABLE 0x10000000
888
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700889 u32 port_stx;
890
Eilon Greensteinde832a52009-02-12 08:36:33 +0000891 u32 stat_nig_timer;
892
Eilon Greensteina35da8d2009-02-12 08:37:02 +0000893 /* MCP firmware does not use this field */
894 u32 ext_phy_fw_version;
Eliezer Tamirf1410642008-02-28 11:51:50 -0800895
896};
897
898
899struct drv_func_mb {
900
901 u32 drv_mb_header;
902#define DRV_MSG_CODE_MASK 0xffff0000
903#define DRV_MSG_CODE_LOAD_REQ 0x10000000
904#define DRV_MSG_CODE_LOAD_DONE 0x11000000
905#define DRV_MSG_CODE_UNLOAD_REQ_WOL_EN 0x20000000
906#define DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS 0x20010000
907#define DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP 0x20020000
908#define DRV_MSG_CODE_UNLOAD_DONE 0x21000000
Eilon Greenstein2691d512009-08-12 08:22:08 +0000909#define DRV_MSG_CODE_DCC_OK 0x30000000
910#define DRV_MSG_CODE_DCC_FAILURE 0x31000000
Eliezer Tamirf1410642008-02-28 11:51:50 -0800911#define DRV_MSG_CODE_DIAG_ENTER_REQ 0x50000000
912#define DRV_MSG_CODE_DIAG_EXIT_REQ 0x60000000
913#define DRV_MSG_CODE_VALIDATE_KEY 0x70000000
914#define DRV_MSG_CODE_GET_CURR_KEY 0x80000000
915#define DRV_MSG_CODE_GET_UPGRADE_KEY 0x81000000
916#define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000
917#define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000918 /*
Gilles Espinassef77f13e2010-03-29 15:41:47 +0200919 * The optic module verification commands require bootcode
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000920 * v5.0.6 or later
921 */
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000922#define DRV_MSG_CODE_VRFY_FIRST_PHY_OPT_MDL 0xa0000000
923#define REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL 0x00050006
924 /*
925 * The specific optic module verification command requires bootcode
926 * v5.2.12 or later
927 */
928#define DRV_MSG_CODE_VRFY_SPECIFIC_PHY_OPT_MDL 0xa1000000
929#define REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL 0x00050234
Eliezer Tamirf1410642008-02-28 11:51:50 -0800930
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +0000931#define DRV_MSG_CODE_DCBX_ADMIN_PMF_MSG 0xb0000000
932#define DRV_MSG_CODE_DCBX_PMF_DRV_OK 0xb2000000
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -0800933#define DRV_MSG_CODE_SET_MF_BW 0xe0000000
934#define REQ_BC_VER_4_SET_MF_BW 0x00060202
935#define DRV_MSG_CODE_SET_MF_BW_ACK 0xe1000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700936#define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000
937#define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000
938#define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000
939#define BIOS_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
940
Eliezer Tamirf1410642008-02-28 11:51:50 -0800941#define DRV_MSG_SEQ_NUMBER_MASK 0x0000ffff
942
943 u32 drv_mb_param;
944
945 u32 fw_mb_header;
946#define FW_MSG_CODE_MASK 0xffff0000
947#define FW_MSG_CODE_DRV_LOAD_COMMON 0x10100000
948#define FW_MSG_CODE_DRV_LOAD_PORT 0x10110000
949#define FW_MSG_CODE_DRV_LOAD_FUNCTION 0x10120000
Dmitry Kravkovf2e08992010-10-06 03:28:26 +0000950 /* Load common chip is supported from bc 6.0.0 */
951#define REQ_BC_VER_4_DRV_LOAD_COMMON_CHIP 0x00060000
952#define FW_MSG_CODE_DRV_LOAD_COMMON_CHIP 0x10130000
Eliezer Tamirf1410642008-02-28 11:51:50 -0800953#define FW_MSG_CODE_DRV_LOAD_REFUSED 0x10200000
954#define FW_MSG_CODE_DRV_LOAD_DONE 0x11100000
955#define FW_MSG_CODE_DRV_UNLOAD_COMMON 0x20100000
956#define FW_MSG_CODE_DRV_UNLOAD_PORT 0x20110000
957#define FW_MSG_CODE_DRV_UNLOAD_FUNCTION 0x20120000
958#define FW_MSG_CODE_DRV_UNLOAD_DONE 0x21100000
Eilon Greenstein2691d512009-08-12 08:22:08 +0000959#define FW_MSG_CODE_DCC_DONE 0x30100000
Eliezer Tamirf1410642008-02-28 11:51:50 -0800960#define FW_MSG_CODE_DIAG_ENTER_DONE 0x50100000
961#define FW_MSG_CODE_DIAG_REFUSE 0x50200000
962#define FW_MSG_CODE_DIAG_EXIT_DONE 0x60100000
963#define FW_MSG_CODE_VALIDATE_KEY_SUCCESS 0x70100000
964#define FW_MSG_CODE_VALIDATE_KEY_FAILURE 0x70200000
965#define FW_MSG_CODE_GET_KEY_DONE 0x80100000
966#define FW_MSG_CODE_NO_KEY 0x80f00000
967#define FW_MSG_CODE_LIC_INFO_NOT_READY 0x80f80000
968#define FW_MSG_CODE_L2B_PRAM_LOADED 0x90100000
969#define FW_MSG_CODE_L2B_PRAM_T_LOAD_FAILURE 0x90210000
970#define FW_MSG_CODE_L2B_PRAM_C_LOAD_FAILURE 0x90220000
971#define FW_MSG_CODE_L2B_PRAM_X_LOAD_FAILURE 0x90230000
972#define FW_MSG_CODE_L2B_PRAM_U_LOAD_FAILURE 0x90240000
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000973#define FW_MSG_CODE_VRFY_OPT_MDL_SUCCESS 0xa0100000
974#define FW_MSG_CODE_VRFY_OPT_MDL_INVLD_IMG 0xa0200000
975#define FW_MSG_CODE_VRFY_OPT_MDL_UNAPPROVED 0xa0300000
Eliezer Tamirf1410642008-02-28 11:51:50 -0800976
Eilon Greenstein34f80b02008-06-23 20:33:01 -0700977#define FW_MSG_CODE_LIC_CHALLENGE 0xff010000
978#define FW_MSG_CODE_LIC_RESPONSE 0xff020000
979#define FW_MSG_CODE_VIRT_MAC_PRIM 0xff030000
980#define FW_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
981
Eliezer Tamirf1410642008-02-28 11:51:50 -0800982#define FW_MSG_SEQ_NUMBER_MASK 0x0000ffff
983
984 u32 fw_mb_param;
985
986 u32 drv_pulse_mb;
987#define DRV_PULSE_SEQ_MASK 0x00007fff
988#define DRV_PULSE_SYSTEM_TIME_MASK 0xffff0000
989 /* The system time is in the format of
990 * (year-2001)*12*32 + month*32 + day. */
991#define DRV_PULSE_ALWAYS_ALIVE 0x00008000
992 /* Indicate to the firmware not to go into the
993 * OS-absent when it is not getting driver pulse.
994 * This is used for debugging as well for PXE(MBA). */
995
996 u32 mcp_pulse_mb;
997#define MCP_PULSE_SEQ_MASK 0x00007fff
998#define MCP_PULSE_ALWAYS_ALIVE 0x00008000
999 /* Indicates to the driver not to assert due to lack
1000 * of MCP response */
1001#define MCP_EVENT_MASK 0xffff0000
1002#define MCP_EVENT_OTHER_DRIVER_RESET_REQ 0x00010000
1003
1004 u32 iscsi_boot_signature;
1005 u32 iscsi_boot_block_offset;
1006
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001007 u32 drv_status;
1008#define DRV_STATUS_PMF 0x00000001
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001009#define DRV_STATUS_SET_MF_BW 0x00000004
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001010
Eilon Greenstein2691d512009-08-12 08:22:08 +00001011#define DRV_STATUS_DCC_EVENT_MASK 0x0000ff00
1012#define DRV_STATUS_DCC_DISABLE_ENABLE_PF 0x00000100
1013#define DRV_STATUS_DCC_BANDWIDTH_ALLOCATION 0x00000200
1014#define DRV_STATUS_DCC_CHANGE_MAC_ADDRESS 0x00000400
1015#define DRV_STATUS_DCC_RESERVED1 0x00000800
1016#define DRV_STATUS_DCC_SET_PROTOCOL 0x00001000
1017#define DRV_STATUS_DCC_SET_PRIORITY 0x00002000
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001018#define DRV_STATUS_DCBX_EVENT_MASK 0x000f0000
1019#define DRV_STATUS_DCBX_NEGOTIATION_RESULTS 0x00010000
Eilon Greenstein2691d512009-08-12 08:22:08 +00001020
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001021 u32 virt_mac_upper;
1022#define VIRT_MAC_SIGN_MASK 0xffff0000
1023#define VIRT_MAC_SIGNATURE 0x564d0000
1024 u32 virt_mac_lower;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001025
1026};
1027
1028
1029/****************************************************************************
1030 * Management firmware state *
1031 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -08001032/* Allocate 440 bytes for management firmware */
1033#define MGMTFW_STATE_WORD_SIZE 110
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001034
1035struct mgmtfw_state {
1036 u32 opaque[MGMTFW_STATE_WORD_SIZE];
1037};
1038
1039
1040/****************************************************************************
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001041 * Multi-Function configuration *
1042 ****************************************************************************/
1043struct shared_mf_cfg {
1044
1045 u32 clp_mb;
1046#define SHARED_MF_CLP_SET_DEFAULT 0x00000000
1047 /* set by CLP */
1048#define SHARED_MF_CLP_EXIT 0x00000001
1049 /* set by MCP */
1050#define SHARED_MF_CLP_EXIT_DONE 0x00010000
1051
1052};
1053
1054struct port_mf_cfg {
1055
1056 u32 dynamic_cfg; /* device control channel */
Eilon Greenstein2691d512009-08-12 08:22:08 +00001057#define PORT_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
1058#define PORT_MF_CFG_E1HOV_TAG_SHIFT 0
1059#define PORT_MF_CFG_E1HOV_TAG_DEFAULT PORT_MF_CFG_E1HOV_TAG_MASK
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001060
1061 u32 reserved[3];
1062
1063};
1064
1065struct func_mf_cfg {
1066
1067 u32 config;
1068 /* E/R/I/D */
1069 /* function 0 of each port cannot be hidden */
1070#define FUNC_MF_CFG_FUNC_HIDE 0x00000001
1071
1072#define FUNC_MF_CFG_PROTOCOL_MASK 0x00000007
1073#define FUNC_MF_CFG_PROTOCOL_ETHERNET 0x00000002
1074#define FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA 0x00000004
1075#define FUNC_MF_CFG_PROTOCOL_ISCSI 0x00000006
1076#define FUNC_MF_CFG_PROTOCOL_DEFAULT\
1077 FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA
1078
1079#define FUNC_MF_CFG_FUNC_DISABLED 0x00000008
1080
1081 /* PRI */
1082 /* 0 - low priority, 3 - high priority */
1083#define FUNC_MF_CFG_TRANSMIT_PRIORITY_MASK 0x00000300
1084#define FUNC_MF_CFG_TRANSMIT_PRIORITY_SHIFT 8
1085#define FUNC_MF_CFG_TRANSMIT_PRIORITY_DEFAULT 0x00000000
1086
1087 /* MINBW, MAXBW */
1088 /* value range - 0..100, increments in 100Mbps */
1089#define FUNC_MF_CFG_MIN_BW_MASK 0x00ff0000
1090#define FUNC_MF_CFG_MIN_BW_SHIFT 16
1091#define FUNC_MF_CFG_MIN_BW_DEFAULT 0x00000000
1092#define FUNC_MF_CFG_MAX_BW_MASK 0xff000000
1093#define FUNC_MF_CFG_MAX_BW_SHIFT 24
1094#define FUNC_MF_CFG_MAX_BW_DEFAULT 0x64000000
1095
1096 u32 mac_upper; /* MAC */
1097#define FUNC_MF_CFG_UPPERMAC_MASK 0x0000ffff
1098#define FUNC_MF_CFG_UPPERMAC_SHIFT 0
1099#define FUNC_MF_CFG_UPPERMAC_DEFAULT FUNC_MF_CFG_UPPERMAC_MASK
1100 u32 mac_lower;
1101#define FUNC_MF_CFG_LOWERMAC_DEFAULT 0xffffffff
1102
1103 u32 e1hov_tag; /* VNI */
1104#define FUNC_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
1105#define FUNC_MF_CFG_E1HOV_TAG_SHIFT 0
1106#define FUNC_MF_CFG_E1HOV_TAG_DEFAULT FUNC_MF_CFG_E1HOV_TAG_MASK
1107
1108 u32 reserved[2];
1109
1110};
1111
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001112/* This structure is not applicable and should not be accessed on 57711 */
1113struct func_ext_cfg {
1114 u32 func_cfg;
1115#define MACP_FUNC_CFG_FLAGS_MASK 0x000000FF
1116#define MACP_FUNC_CFG_FLAGS_SHIFT 0
1117#define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001
1118#define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002
1119#define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004
1120#define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008
1121
1122 u32 iscsi_mac_addr_upper;
1123 u32 iscsi_mac_addr_lower;
1124
1125 u32 fcoe_mac_addr_upper;
1126 u32 fcoe_mac_addr_lower;
1127
1128 u32 fcoe_wwn_port_name_upper;
1129 u32 fcoe_wwn_port_name_lower;
1130
1131 u32 fcoe_wwn_node_name_upper;
1132 u32 fcoe_wwn_node_name_lower;
1133
1134 u32 preserve_data;
1135#define MF_FUNC_CFG_PRESERVE_L2_MAC (1<<0)
1136#define MF_FUNC_CFG_PRESERVE_ISCSI_MAC (1<<1)
1137#define MF_FUNC_CFG_PRESERVE_FCOE_MAC (1<<2)
1138#define MF_FUNC_CFG_PRESERVE_FCOE_WWN_P (1<<3)
1139#define MF_FUNC_CFG_PRESERVE_FCOE_WWN_N (1<<4)
1140};
1141
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001142struct mf_cfg {
1143
1144 struct shared_mf_cfg shared_mf_config;
1145 struct port_mf_cfg port_mf_config[PORT_MAX];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001146 struct func_mf_cfg func_mf_config[E1H_FUNC_MAX];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001147
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001148 struct func_ext_cfg func_ext_config[E1H_FUNC_MAX];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001149};
1150
1151
1152/****************************************************************************
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001153 * Shared Memory Region *
1154 ****************************************************************************/
1155struct shmem_region { /* SharedMem Offset (size) */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001156
1157 u32 validity_map[PORT_MAX]; /* 0x0 (4*2 = 0x8) */
1158#define SHR_MEM_FORMAT_REV_ID ('A'<<24)
1159#define SHR_MEM_FORMAT_REV_MASK 0xff000000
1160 /* validity bits */
1161#define SHR_MEM_VALIDITY_PCI_CFG 0x00100000
1162#define SHR_MEM_VALIDITY_MB 0x00200000
1163#define SHR_MEM_VALIDITY_DEV_INFO 0x00400000
1164#define SHR_MEM_VALIDITY_RESERVED 0x00000007
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001165 /* One licensing bit should be set */
1166#define SHR_MEM_VALIDITY_LIC_KEY_IN_EFFECT_MASK 0x00000038
1167#define SHR_MEM_VALIDITY_LIC_MANUF_KEY_IN_EFFECT 0x00000008
1168#define SHR_MEM_VALIDITY_LIC_UPGRADE_KEY_IN_EFFECT 0x00000010
1169#define SHR_MEM_VALIDITY_LIC_NO_KEY_IN_EFFECT 0x00000020
Eliezer Tamirf1410642008-02-28 11:51:50 -08001170 /* Active MFW */
1171#define SHR_MEM_VALIDITY_ACTIVE_MFW_UNKNOWN 0x00000000
1172#define SHR_MEM_VALIDITY_ACTIVE_MFW_IPMI 0x00000040
1173#define SHR_MEM_VALIDITY_ACTIVE_MFW_UMP 0x00000080
1174#define SHR_MEM_VALIDITY_ACTIVE_MFW_NCSI 0x000000c0
1175#define SHR_MEM_VALIDITY_ACTIVE_MFW_NONE 0x000001c0
1176#define SHR_MEM_VALIDITY_ACTIVE_MFW_MASK 0x000001c0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001177
Eilon Greenstein5cd65a92009-02-12 08:38:11 +00001178 struct shm_dev_info dev_info; /* 0x8 (0x438) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001179
Michael Chane2513062009-10-10 13:46:58 +00001180 struct license_key drv_lic_key[PORT_MAX]; /* 0x440 (52*2=0x68) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001181
1182 /* FW information (for internal FW use) */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001183 u32 fw_info_fio_offset; /* 0x4a8 (0x4) */
1184 struct mgmtfw_state mgmtfw_state; /* 0x4ac (0x1b8) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001185
Eliezer Tamirf1410642008-02-28 11:51:50 -08001186 struct drv_port_mb port_mb[PORT_MAX]; /* 0x664 (16*2=0x20) */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001187 struct drv_func_mb func_mb[]; /* 0x684
1188 (44*2/4/8=0x58/0xb0/0x160) */
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001189
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001190}; /* 57710 = 0x6dc | 57711 = 0x7E4 | 57712 = 0x734 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001191
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001192struct fw_flr_ack {
1193 u32 pf_ack;
1194 u32 vf_ack[1];
1195 u32 iov_dis_ack;
1196};
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001197
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001198struct fw_flr_mb {
1199 u32 aggint;
1200 u32 opgen_addr;
1201 struct fw_flr_ack ack;
1202};
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001203
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001204/**** SUPPORT FOR SHMEM ARRRAYS ***
1205 * The SHMEM HSI is aligned on 32 bit boundaries which makes it difficult to
1206 * define arrays with storage types smaller then unsigned dwords.
1207 * The macros below add generic support for SHMEM arrays with numeric elements
1208 * that can span 2,4,8 or 16 bits. The array underlying type is a 32 bit dword
1209 * array with individual bit-filed elements accessed using shifts and masks.
1210 *
1211 */
1212
1213/* eb is the bitwidth of a single element */
1214#define SHMEM_ARRAY_MASK(eb) ((1<<(eb))-1)
1215#define SHMEM_ARRAY_ENTRY(i, eb) ((i)/(32/(eb)))
1216
1217/* the bit-position macro allows the used to flip the order of the arrays
1218 * elements on a per byte or word boundary.
1219 *
1220 * example: an array with 8 entries each 4 bit wide. This array will fit into
1221 * a single dword. The diagrmas below show the array order of the nibbles.
1222 *
1223 * SHMEM_ARRAY_BITPOS(i, 4, 4) defines the stadard ordering:
1224 *
1225 * | | | |
1226 * 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
1227 * | | | |
1228 *
1229 * SHMEM_ARRAY_BITPOS(i, 4, 8) defines a flip ordering per byte:
1230 *
1231 * | | | |
1232 * 1 | 0 | 3 | 2 | 5 | 4 | 7 | 6 |
1233 * | | | |
1234 *
1235 * SHMEM_ARRAY_BITPOS(i, 4, 16) defines a flip ordering per word:
1236 *
1237 * | | | |
1238 * 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 |
1239 * | | | |
1240 */
1241#define SHMEM_ARRAY_BITPOS(i, eb, fb) \
1242 ((((32/(fb)) - 1 - ((i)/((fb)/(eb))) % (32/(fb))) * (fb)) + \
1243 (((i)%((fb)/(eb))) * (eb)))
1244
1245#define SHMEM_ARRAY_GET(a, i, eb, fb) \
1246 ((a[SHMEM_ARRAY_ENTRY(i, eb)] >> SHMEM_ARRAY_BITPOS(i, eb, fb)) & \
1247 SHMEM_ARRAY_MASK(eb))
1248
1249#define SHMEM_ARRAY_SET(a, i, eb, fb, val) \
1250do { \
1251 a[SHMEM_ARRAY_ENTRY(i, eb)] &= ~(SHMEM_ARRAY_MASK(eb) << \
1252 SHMEM_ARRAY_BITPOS(i, eb, fb)); \
1253 a[SHMEM_ARRAY_ENTRY(i, eb)] |= (((val) & SHMEM_ARRAY_MASK(eb)) << \
1254 SHMEM_ARRAY_BITPOS(i, eb, fb)); \
1255} while (0)
1256
1257
1258/****START OF DCBX STRUCTURES DECLARATIONS****/
1259#define DCBX_MAX_NUM_PRI_PG_ENTRIES 8
1260#define DCBX_PRI_PG_BITWIDTH 4
1261#define DCBX_PRI_PG_FBITS 8
1262#define DCBX_PRI_PG_GET(a, i) \
1263 SHMEM_ARRAY_GET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS)
1264#define DCBX_PRI_PG_SET(a, i, val) \
1265 SHMEM_ARRAY_SET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS, val)
1266#define DCBX_MAX_NUM_PG_BW_ENTRIES 8
1267#define DCBX_BW_PG_BITWIDTH 8
1268#define DCBX_PG_BW_GET(a, i) \
1269 SHMEM_ARRAY_GET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH)
1270#define DCBX_PG_BW_SET(a, i, val) \
1271 SHMEM_ARRAY_SET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH, val)
1272#define DCBX_STRICT_PRI_PG 15
1273#define DCBX_MAX_APP_PROTOCOL 16
1274#define FCOE_APP_IDX 0
1275#define ISCSI_APP_IDX 1
1276#define PREDEFINED_APP_IDX_MAX 2
1277
1278struct dcbx_ets_feature {
1279 u32 enabled;
1280 u32 pg_bw_tbl[2];
1281 u32 pri_pg_tbl[1];
1282};
1283
1284struct dcbx_pfc_feature {
1285#ifdef __BIG_ENDIAN
1286 u8 pri_en_bitmap;
1287#define DCBX_PFC_PRI_0 0x01
1288#define DCBX_PFC_PRI_1 0x02
1289#define DCBX_PFC_PRI_2 0x04
1290#define DCBX_PFC_PRI_3 0x08
1291#define DCBX_PFC_PRI_4 0x10
1292#define DCBX_PFC_PRI_5 0x20
1293#define DCBX_PFC_PRI_6 0x40
1294#define DCBX_PFC_PRI_7 0x80
1295 u8 pfc_caps;
1296 u8 reserved;
1297 u8 enabled;
1298#elif defined(__LITTLE_ENDIAN)
1299 u8 enabled;
1300 u8 reserved;
1301 u8 pfc_caps;
1302 u8 pri_en_bitmap;
1303#define DCBX_PFC_PRI_0 0x01
1304#define DCBX_PFC_PRI_1 0x02
1305#define DCBX_PFC_PRI_2 0x04
1306#define DCBX_PFC_PRI_3 0x08
1307#define DCBX_PFC_PRI_4 0x10
1308#define DCBX_PFC_PRI_5 0x20
1309#define DCBX_PFC_PRI_6 0x40
1310#define DCBX_PFC_PRI_7 0x80
1311#endif
1312};
1313
1314struct dcbx_app_priority_entry {
1315#ifdef __BIG_ENDIAN
1316 u16 app_id;
1317 u8 pri_bitmap;
1318 u8 appBitfield;
1319#define DCBX_APP_ENTRY_VALID 0x01
1320#define DCBX_APP_ENTRY_SF_MASK 0x30
1321#define DCBX_APP_ENTRY_SF_SHIFT 4
1322#define DCBX_APP_SF_ETH_TYPE 0x10
1323#define DCBX_APP_SF_PORT 0x20
1324#elif defined(__LITTLE_ENDIAN)
1325 u8 appBitfield;
1326#define DCBX_APP_ENTRY_VALID 0x01
1327#define DCBX_APP_ENTRY_SF_MASK 0x30
1328#define DCBX_APP_ENTRY_SF_SHIFT 4
1329#define DCBX_APP_SF_ETH_TYPE 0x10
1330#define DCBX_APP_SF_PORT 0x20
1331 u8 pri_bitmap;
1332 u16 app_id;
1333#endif
1334};
1335
1336struct dcbx_app_priority_feature {
1337#ifdef __BIG_ENDIAN
1338 u8 reserved;
1339 u8 default_pri;
1340 u8 tc_supported;
1341 u8 enabled;
1342#elif defined(__LITTLE_ENDIAN)
1343 u8 enabled;
1344 u8 tc_supported;
1345 u8 default_pri;
1346 u8 reserved;
1347#endif
1348 struct dcbx_app_priority_entry app_pri_tbl[DCBX_MAX_APP_PROTOCOL];
1349};
1350
1351struct dcbx_features {
1352 struct dcbx_ets_feature ets;
1353 struct dcbx_pfc_feature pfc;
1354 struct dcbx_app_priority_feature app;
1355};
1356
1357struct lldp_params {
1358#ifdef __BIG_ENDIAN
1359 u8 msg_fast_tx_interval;
1360 u8 msg_tx_hold;
1361 u8 msg_tx_interval;
1362 u8 admin_status;
1363#define LLDP_TX_ONLY 0x01
1364#define LLDP_RX_ONLY 0x02
1365#define LLDP_TX_RX 0x03
1366#define LLDP_DISABLED 0x04
1367 u8 reserved1;
1368 u8 tx_fast;
1369 u8 tx_crd_max;
1370 u8 tx_crd;
1371#elif defined(__LITTLE_ENDIAN)
1372 u8 admin_status;
1373#define LLDP_TX_ONLY 0x01
1374#define LLDP_RX_ONLY 0x02
1375#define LLDP_TX_RX 0x03
1376#define LLDP_DISABLED 0x04
1377 u8 msg_tx_interval;
1378 u8 msg_tx_hold;
1379 u8 msg_fast_tx_interval;
1380 u8 tx_crd;
1381 u8 tx_crd_max;
1382 u8 tx_fast;
1383 u8 reserved1;
1384#endif
1385#define REM_CHASSIS_ID_STAT_LEN 4
1386#define REM_PORT_ID_STAT_LEN 4
1387 u32 peer_chassis_id[REM_CHASSIS_ID_STAT_LEN];
1388 u32 peer_port_id[REM_PORT_ID_STAT_LEN];
1389};
1390
1391struct lldp_dcbx_stat {
1392#define LOCAL_CHASSIS_ID_STAT_LEN 2
1393#define LOCAL_PORT_ID_STAT_LEN 2
1394 u32 local_chassis_id[LOCAL_CHASSIS_ID_STAT_LEN];
1395 u32 local_port_id[LOCAL_PORT_ID_STAT_LEN];
1396 u32 num_tx_dcbx_pkts;
1397 u32 num_rx_dcbx_pkts;
1398};
1399
1400struct lldp_admin_mib {
1401 u32 ver_cfg_flags;
1402#define DCBX_ETS_CONFIG_TX_ENABLED 0x00000001
1403#define DCBX_PFC_CONFIG_TX_ENABLED 0x00000002
1404#define DCBX_APP_CONFIG_TX_ENABLED 0x00000004
1405#define DCBX_ETS_RECO_TX_ENABLED 0x00000008
1406#define DCBX_ETS_RECO_VALID 0x00000010
1407#define DCBX_ETS_WILLING 0x00000020
1408#define DCBX_PFC_WILLING 0x00000040
1409#define DCBX_APP_WILLING 0x00000080
1410#define DCBX_VERSION_CEE 0x00000100
1411#define DCBX_VERSION_IEEE 0x00000200
1412#define DCBX_DCBX_ENABLED 0x00000400
1413#define DCBX_CEE_VERSION_MASK 0x0000f000
1414#define DCBX_CEE_VERSION_SHIFT 12
1415#define DCBX_CEE_MAX_VERSION_MASK 0x000f0000
1416#define DCBX_CEE_MAX_VERSION_SHIFT 16
1417 struct dcbx_features features;
1418};
1419
1420struct lldp_remote_mib {
1421 u32 prefix_seq_num;
1422 u32 flags;
1423#define DCBX_ETS_TLV_RX 0x00000001
1424#define DCBX_PFC_TLV_RX 0x00000002
1425#define DCBX_APP_TLV_RX 0x00000004
1426#define DCBX_ETS_RX_ERROR 0x00000010
1427#define DCBX_PFC_RX_ERROR 0x00000020
1428#define DCBX_APP_RX_ERROR 0x00000040
1429#define DCBX_ETS_REM_WILLING 0x00000100
1430#define DCBX_PFC_REM_WILLING 0x00000200
1431#define DCBX_APP_REM_WILLING 0x00000400
1432#define DCBX_REMOTE_ETS_RECO_VALID 0x00001000
1433 struct dcbx_features features;
1434 u32 suffix_seq_num;
1435};
1436
1437struct lldp_local_mib {
1438 u32 prefix_seq_num;
1439 u32 error;
1440#define DCBX_LOCAL_ETS_ERROR 0x00000001
1441#define DCBX_LOCAL_PFC_ERROR 0x00000002
1442#define DCBX_LOCAL_APP_ERROR 0x00000004
1443#define DCBX_LOCAL_PFC_MISMATCH 0x00000010
1444#define DCBX_LOCAL_APP_MISMATCH 0x00000020
1445 struct dcbx_features features;
1446 u32 suffix_seq_num;
1447};
1448/***END OF DCBX STRUCTURES DECLARATIONS***/
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001449
Eilon Greenstein2691d512009-08-12 08:22:08 +00001450struct shmem2_region {
1451
1452 u32 size;
1453
1454 u32 dcc_support;
1455#define SHMEM_DCC_SUPPORT_NONE 0x00000000
1456#define SHMEM_DCC_SUPPORT_DISABLE_ENABLE_PF_TLV 0x00000001
1457#define SHMEM_DCC_SUPPORT_BANDWIDTH_ALLOCATION_TLV 0x00000004
1458#define SHMEM_DCC_SUPPORT_CHANGE_MAC_ADDRESS_TLV 0x00000008
1459#define SHMEM_DCC_SUPPORT_SET_PROTOCOL_TLV 0x00000040
1460#define SHMEM_DCC_SUPPORT_SET_PRIORITY_TLV 0x00000080
1461#define SHMEM_DCC_SUPPORT_DEFAULT SHMEM_DCC_SUPPORT_NONE
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001462 u32 ext_phy_fw_version2[PORT_MAX];
1463 /*
1464 * For backwards compatibility, if the mf_cfg_addr does not exist
1465 * (the size filed is smaller than 0xc) the mf_cfg resides at the
1466 * end of struct shmem_region
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001467 */
1468 u32 mf_cfg_addr;
1469#define SHMEM_MF_CFG_ADDR_NONE 0x00000000
1470
1471 struct fw_flr_mb flr_mb;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001472 u32 dcbx_lldp_params_offset;
1473#define SHMEM_LLDP_DCBX_PARAMS_NONE 0x00000000
1474 u32 dcbx_neg_res_offset;
1475#define SHMEM_DCBX_NEG_RES_NONE 0x00000000
1476 u32 dcbx_remote_mib_offset;
1477#define SHMEM_DCBX_REMOTE_MIB_NONE 0x00000000
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001478 /*
1479 * The other shmemX_base_addr holds the other path's shmem address
1480 * required for example in case of common phy init, or for path1 to know
1481 * the address of mcp debug trace which is located in offset from shmem
1482 * of path0
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001483 */
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001484 u32 other_shmem_base_addr;
1485 u32 other_shmem2_base_addr;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001486 u32 reserved1[E2_VF_MAX / 32];
1487 u32 reserved2[E2_FUNC_MAX][E2_VF_MAX / 32];
1488 u32 dcbx_lldp_dcbx_stat_offset;
1489#define SHMEM_LLDP_DCBX_STAT_NONE 0x00000000
Eilon Greenstein2691d512009-08-12 08:22:08 +00001490};
1491
1492
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001493struct emac_stats {
1494 u32 rx_stat_ifhcinoctets;
1495 u32 rx_stat_ifhcinbadoctets;
1496 u32 rx_stat_etherstatsfragments;
1497 u32 rx_stat_ifhcinucastpkts;
1498 u32 rx_stat_ifhcinmulticastpkts;
1499 u32 rx_stat_ifhcinbroadcastpkts;
1500 u32 rx_stat_dot3statsfcserrors;
1501 u32 rx_stat_dot3statsalignmenterrors;
1502 u32 rx_stat_dot3statscarriersenseerrors;
1503 u32 rx_stat_xonpauseframesreceived;
1504 u32 rx_stat_xoffpauseframesreceived;
1505 u32 rx_stat_maccontrolframesreceived;
1506 u32 rx_stat_xoffstateentered;
1507 u32 rx_stat_dot3statsframestoolong;
1508 u32 rx_stat_etherstatsjabbers;
1509 u32 rx_stat_etherstatsundersizepkts;
1510 u32 rx_stat_etherstatspkts64octets;
1511 u32 rx_stat_etherstatspkts65octetsto127octets;
1512 u32 rx_stat_etherstatspkts128octetsto255octets;
1513 u32 rx_stat_etherstatspkts256octetsto511octets;
1514 u32 rx_stat_etherstatspkts512octetsto1023octets;
1515 u32 rx_stat_etherstatspkts1024octetsto1522octets;
1516 u32 rx_stat_etherstatspktsover1522octets;
1517
1518 u32 rx_stat_falsecarriererrors;
1519
1520 u32 tx_stat_ifhcoutoctets;
1521 u32 tx_stat_ifhcoutbadoctets;
1522 u32 tx_stat_etherstatscollisions;
1523 u32 tx_stat_outxonsent;
1524 u32 tx_stat_outxoffsent;
1525 u32 tx_stat_flowcontroldone;
1526 u32 tx_stat_dot3statssinglecollisionframes;
1527 u32 tx_stat_dot3statsmultiplecollisionframes;
1528 u32 tx_stat_dot3statsdeferredtransmissions;
1529 u32 tx_stat_dot3statsexcessivecollisions;
1530 u32 tx_stat_dot3statslatecollisions;
1531 u32 tx_stat_ifhcoutucastpkts;
1532 u32 tx_stat_ifhcoutmulticastpkts;
1533 u32 tx_stat_ifhcoutbroadcastpkts;
1534 u32 tx_stat_etherstatspkts64octets;
1535 u32 tx_stat_etherstatspkts65octetsto127octets;
1536 u32 tx_stat_etherstatspkts128octetsto255octets;
1537 u32 tx_stat_etherstatspkts256octetsto511octets;
1538 u32 tx_stat_etherstatspkts512octetsto1023octets;
1539 u32 tx_stat_etherstatspkts1024octetsto1522octets;
1540 u32 tx_stat_etherstatspktsover1522octets;
1541 u32 tx_stat_dot3statsinternalmactransmiterrors;
1542};
1543
1544
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001545struct bmac1_stats {
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001546 u32 tx_stat_gtpkt_lo;
1547 u32 tx_stat_gtpkt_hi;
1548 u32 tx_stat_gtxpf_lo;
1549 u32 tx_stat_gtxpf_hi;
1550 u32 tx_stat_gtfcs_lo;
1551 u32 tx_stat_gtfcs_hi;
1552 u32 tx_stat_gtmca_lo;
1553 u32 tx_stat_gtmca_hi;
1554 u32 tx_stat_gtbca_lo;
1555 u32 tx_stat_gtbca_hi;
1556 u32 tx_stat_gtfrg_lo;
1557 u32 tx_stat_gtfrg_hi;
1558 u32 tx_stat_gtovr_lo;
1559 u32 tx_stat_gtovr_hi;
1560 u32 tx_stat_gt64_lo;
1561 u32 tx_stat_gt64_hi;
1562 u32 tx_stat_gt127_lo;
1563 u32 tx_stat_gt127_hi;
1564 u32 tx_stat_gt255_lo;
1565 u32 tx_stat_gt255_hi;
1566 u32 tx_stat_gt511_lo;
1567 u32 tx_stat_gt511_hi;
1568 u32 tx_stat_gt1023_lo;
1569 u32 tx_stat_gt1023_hi;
1570 u32 tx_stat_gt1518_lo;
1571 u32 tx_stat_gt1518_hi;
1572 u32 tx_stat_gt2047_lo;
1573 u32 tx_stat_gt2047_hi;
1574 u32 tx_stat_gt4095_lo;
1575 u32 tx_stat_gt4095_hi;
1576 u32 tx_stat_gt9216_lo;
1577 u32 tx_stat_gt9216_hi;
1578 u32 tx_stat_gt16383_lo;
1579 u32 tx_stat_gt16383_hi;
1580 u32 tx_stat_gtmax_lo;
1581 u32 tx_stat_gtmax_hi;
1582 u32 tx_stat_gtufl_lo;
1583 u32 tx_stat_gtufl_hi;
1584 u32 tx_stat_gterr_lo;
1585 u32 tx_stat_gterr_hi;
1586 u32 tx_stat_gtbyt_lo;
1587 u32 tx_stat_gtbyt_hi;
1588
1589 u32 rx_stat_gr64_lo;
1590 u32 rx_stat_gr64_hi;
1591 u32 rx_stat_gr127_lo;
1592 u32 rx_stat_gr127_hi;
1593 u32 rx_stat_gr255_lo;
1594 u32 rx_stat_gr255_hi;
1595 u32 rx_stat_gr511_lo;
1596 u32 rx_stat_gr511_hi;
1597 u32 rx_stat_gr1023_lo;
1598 u32 rx_stat_gr1023_hi;
1599 u32 rx_stat_gr1518_lo;
1600 u32 rx_stat_gr1518_hi;
1601 u32 rx_stat_gr2047_lo;
1602 u32 rx_stat_gr2047_hi;
1603 u32 rx_stat_gr4095_lo;
1604 u32 rx_stat_gr4095_hi;
1605 u32 rx_stat_gr9216_lo;
1606 u32 rx_stat_gr9216_hi;
1607 u32 rx_stat_gr16383_lo;
1608 u32 rx_stat_gr16383_hi;
1609 u32 rx_stat_grmax_lo;
1610 u32 rx_stat_grmax_hi;
1611 u32 rx_stat_grpkt_lo;
1612 u32 rx_stat_grpkt_hi;
1613 u32 rx_stat_grfcs_lo;
1614 u32 rx_stat_grfcs_hi;
1615 u32 rx_stat_grmca_lo;
1616 u32 rx_stat_grmca_hi;
1617 u32 rx_stat_grbca_lo;
1618 u32 rx_stat_grbca_hi;
1619 u32 rx_stat_grxcf_lo;
1620 u32 rx_stat_grxcf_hi;
1621 u32 rx_stat_grxpf_lo;
1622 u32 rx_stat_grxpf_hi;
1623 u32 rx_stat_grxuo_lo;
1624 u32 rx_stat_grxuo_hi;
1625 u32 rx_stat_grjbr_lo;
1626 u32 rx_stat_grjbr_hi;
1627 u32 rx_stat_grovr_lo;
1628 u32 rx_stat_grovr_hi;
1629 u32 rx_stat_grflr_lo;
1630 u32 rx_stat_grflr_hi;
1631 u32 rx_stat_grmeg_lo;
1632 u32 rx_stat_grmeg_hi;
1633 u32 rx_stat_grmeb_lo;
1634 u32 rx_stat_grmeb_hi;
1635 u32 rx_stat_grbyt_lo;
1636 u32 rx_stat_grbyt_hi;
1637 u32 rx_stat_grund_lo;
1638 u32 rx_stat_grund_hi;
1639 u32 rx_stat_grfrg_lo;
1640 u32 rx_stat_grfrg_hi;
1641 u32 rx_stat_grerb_lo;
1642 u32 rx_stat_grerb_hi;
1643 u32 rx_stat_grfre_lo;
1644 u32 rx_stat_grfre_hi;
1645 u32 rx_stat_gripj_lo;
1646 u32 rx_stat_gripj_hi;
1647};
1648
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001649struct bmac2_stats {
1650 u32 tx_stat_gtpk_lo; /* gtpok */
1651 u32 tx_stat_gtpk_hi; /* gtpok */
1652 u32 tx_stat_gtxpf_lo; /* gtpf */
1653 u32 tx_stat_gtxpf_hi; /* gtpf */
1654 u32 tx_stat_gtpp_lo; /* NEW BMAC2 */
1655 u32 tx_stat_gtpp_hi; /* NEW BMAC2 */
1656 u32 tx_stat_gtfcs_lo;
1657 u32 tx_stat_gtfcs_hi;
1658 u32 tx_stat_gtuca_lo; /* NEW BMAC2 */
1659 u32 tx_stat_gtuca_hi; /* NEW BMAC2 */
1660 u32 tx_stat_gtmca_lo;
1661 u32 tx_stat_gtmca_hi;
1662 u32 tx_stat_gtbca_lo;
1663 u32 tx_stat_gtbca_hi;
1664 u32 tx_stat_gtovr_lo;
1665 u32 tx_stat_gtovr_hi;
1666 u32 tx_stat_gtfrg_lo;
1667 u32 tx_stat_gtfrg_hi;
1668 u32 tx_stat_gtpkt1_lo; /* gtpkt */
1669 u32 tx_stat_gtpkt1_hi; /* gtpkt */
1670 u32 tx_stat_gt64_lo;
1671 u32 tx_stat_gt64_hi;
1672 u32 tx_stat_gt127_lo;
1673 u32 tx_stat_gt127_hi;
1674 u32 tx_stat_gt255_lo;
1675 u32 tx_stat_gt255_hi;
1676 u32 tx_stat_gt511_lo;
1677 u32 tx_stat_gt511_hi;
1678 u32 tx_stat_gt1023_lo;
1679 u32 tx_stat_gt1023_hi;
1680 u32 tx_stat_gt1518_lo;
1681 u32 tx_stat_gt1518_hi;
1682 u32 tx_stat_gt2047_lo;
1683 u32 tx_stat_gt2047_hi;
1684 u32 tx_stat_gt4095_lo;
1685 u32 tx_stat_gt4095_hi;
1686 u32 tx_stat_gt9216_lo;
1687 u32 tx_stat_gt9216_hi;
1688 u32 tx_stat_gt16383_lo;
1689 u32 tx_stat_gt16383_hi;
1690 u32 tx_stat_gtmax_lo;
1691 u32 tx_stat_gtmax_hi;
1692 u32 tx_stat_gtufl_lo;
1693 u32 tx_stat_gtufl_hi;
1694 u32 tx_stat_gterr_lo;
1695 u32 tx_stat_gterr_hi;
1696 u32 tx_stat_gtbyt_lo;
1697 u32 tx_stat_gtbyt_hi;
1698
1699 u32 rx_stat_gr64_lo;
1700 u32 rx_stat_gr64_hi;
1701 u32 rx_stat_gr127_lo;
1702 u32 rx_stat_gr127_hi;
1703 u32 rx_stat_gr255_lo;
1704 u32 rx_stat_gr255_hi;
1705 u32 rx_stat_gr511_lo;
1706 u32 rx_stat_gr511_hi;
1707 u32 rx_stat_gr1023_lo;
1708 u32 rx_stat_gr1023_hi;
1709 u32 rx_stat_gr1518_lo;
1710 u32 rx_stat_gr1518_hi;
1711 u32 rx_stat_gr2047_lo;
1712 u32 rx_stat_gr2047_hi;
1713 u32 rx_stat_gr4095_lo;
1714 u32 rx_stat_gr4095_hi;
1715 u32 rx_stat_gr9216_lo;
1716 u32 rx_stat_gr9216_hi;
1717 u32 rx_stat_gr16383_lo;
1718 u32 rx_stat_gr16383_hi;
1719 u32 rx_stat_grmax_lo;
1720 u32 rx_stat_grmax_hi;
1721 u32 rx_stat_grpkt_lo;
1722 u32 rx_stat_grpkt_hi;
1723 u32 rx_stat_grfcs_lo;
1724 u32 rx_stat_grfcs_hi;
1725 u32 rx_stat_gruca_lo;
1726 u32 rx_stat_gruca_hi;
1727 u32 rx_stat_grmca_lo;
1728 u32 rx_stat_grmca_hi;
1729 u32 rx_stat_grbca_lo;
1730 u32 rx_stat_grbca_hi;
1731 u32 rx_stat_grxpf_lo; /* grpf */
1732 u32 rx_stat_grxpf_hi; /* grpf */
1733 u32 rx_stat_grpp_lo;
1734 u32 rx_stat_grpp_hi;
1735 u32 rx_stat_grxuo_lo; /* gruo */
1736 u32 rx_stat_grxuo_hi; /* gruo */
1737 u32 rx_stat_grjbr_lo;
1738 u32 rx_stat_grjbr_hi;
1739 u32 rx_stat_grovr_lo;
1740 u32 rx_stat_grovr_hi;
1741 u32 rx_stat_grxcf_lo; /* grcf */
1742 u32 rx_stat_grxcf_hi; /* grcf */
1743 u32 rx_stat_grflr_lo;
1744 u32 rx_stat_grflr_hi;
1745 u32 rx_stat_grpok_lo;
1746 u32 rx_stat_grpok_hi;
1747 u32 rx_stat_grmeg_lo;
1748 u32 rx_stat_grmeg_hi;
1749 u32 rx_stat_grmeb_lo;
1750 u32 rx_stat_grmeb_hi;
1751 u32 rx_stat_grbyt_lo;
1752 u32 rx_stat_grbyt_hi;
1753 u32 rx_stat_grund_lo;
1754 u32 rx_stat_grund_hi;
1755 u32 rx_stat_grfrg_lo;
1756 u32 rx_stat_grfrg_hi;
1757 u32 rx_stat_grerb_lo; /* grerrbyt */
1758 u32 rx_stat_grerb_hi; /* grerrbyt */
1759 u32 rx_stat_grfre_lo; /* grfrerr */
1760 u32 rx_stat_grfre_hi; /* grfrerr */
1761 u32 rx_stat_gripj_lo;
1762 u32 rx_stat_gripj_hi;
1763};
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001764
1765union mac_stats {
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001766 struct emac_stats emac_stats;
1767 struct bmac1_stats bmac1_stats;
1768 struct bmac2_stats bmac2_stats;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001769};
1770
1771
1772struct mac_stx {
1773 /* in_bad_octets */
1774 u32 rx_stat_ifhcinbadoctets_hi;
1775 u32 rx_stat_ifhcinbadoctets_lo;
1776
1777 /* out_bad_octets */
1778 u32 tx_stat_ifhcoutbadoctets_hi;
1779 u32 tx_stat_ifhcoutbadoctets_lo;
1780
1781 /* crc_receive_errors */
1782 u32 rx_stat_dot3statsfcserrors_hi;
1783 u32 rx_stat_dot3statsfcserrors_lo;
1784 /* alignment_errors */
1785 u32 rx_stat_dot3statsalignmenterrors_hi;
1786 u32 rx_stat_dot3statsalignmenterrors_lo;
1787 /* carrier_sense_errors */
1788 u32 rx_stat_dot3statscarriersenseerrors_hi;
1789 u32 rx_stat_dot3statscarriersenseerrors_lo;
1790 /* false_carrier_detections */
1791 u32 rx_stat_falsecarriererrors_hi;
1792 u32 rx_stat_falsecarriererrors_lo;
1793
1794 /* runt_packets_received */
1795 u32 rx_stat_etherstatsundersizepkts_hi;
1796 u32 rx_stat_etherstatsundersizepkts_lo;
1797 /* jabber_packets_received */
1798 u32 rx_stat_dot3statsframestoolong_hi;
1799 u32 rx_stat_dot3statsframestoolong_lo;
1800
1801 /* error_runt_packets_received */
1802 u32 rx_stat_etherstatsfragments_hi;
1803 u32 rx_stat_etherstatsfragments_lo;
1804 /* error_jabber_packets_received */
1805 u32 rx_stat_etherstatsjabbers_hi;
1806 u32 rx_stat_etherstatsjabbers_lo;
1807
1808 /* control_frames_received */
1809 u32 rx_stat_maccontrolframesreceived_hi;
1810 u32 rx_stat_maccontrolframesreceived_lo;
1811 u32 rx_stat_bmac_xpf_hi;
1812 u32 rx_stat_bmac_xpf_lo;
1813 u32 rx_stat_bmac_xcf_hi;
1814 u32 rx_stat_bmac_xcf_lo;
1815
1816 /* xoff_state_entered */
1817 u32 rx_stat_xoffstateentered_hi;
1818 u32 rx_stat_xoffstateentered_lo;
1819 /* pause_xon_frames_received */
1820 u32 rx_stat_xonpauseframesreceived_hi;
1821 u32 rx_stat_xonpauseframesreceived_lo;
1822 /* pause_xoff_frames_received */
1823 u32 rx_stat_xoffpauseframesreceived_hi;
1824 u32 rx_stat_xoffpauseframesreceived_lo;
1825 /* pause_xon_frames_transmitted */
1826 u32 tx_stat_outxonsent_hi;
1827 u32 tx_stat_outxonsent_lo;
1828 /* pause_xoff_frames_transmitted */
1829 u32 tx_stat_outxoffsent_hi;
1830 u32 tx_stat_outxoffsent_lo;
1831 /* flow_control_done */
1832 u32 tx_stat_flowcontroldone_hi;
1833 u32 tx_stat_flowcontroldone_lo;
1834
1835 /* ether_stats_collisions */
1836 u32 tx_stat_etherstatscollisions_hi;
1837 u32 tx_stat_etherstatscollisions_lo;
1838 /* single_collision_transmit_frames */
1839 u32 tx_stat_dot3statssinglecollisionframes_hi;
1840 u32 tx_stat_dot3statssinglecollisionframes_lo;
1841 /* multiple_collision_transmit_frames */
1842 u32 tx_stat_dot3statsmultiplecollisionframes_hi;
1843 u32 tx_stat_dot3statsmultiplecollisionframes_lo;
1844 /* deferred_transmissions */
1845 u32 tx_stat_dot3statsdeferredtransmissions_hi;
1846 u32 tx_stat_dot3statsdeferredtransmissions_lo;
1847 /* excessive_collision_frames */
1848 u32 tx_stat_dot3statsexcessivecollisions_hi;
1849 u32 tx_stat_dot3statsexcessivecollisions_lo;
1850 /* late_collision_frames */
1851 u32 tx_stat_dot3statslatecollisions_hi;
1852 u32 tx_stat_dot3statslatecollisions_lo;
1853
1854 /* frames_transmitted_64_bytes */
1855 u32 tx_stat_etherstatspkts64octets_hi;
1856 u32 tx_stat_etherstatspkts64octets_lo;
1857 /* frames_transmitted_65_127_bytes */
1858 u32 tx_stat_etherstatspkts65octetsto127octets_hi;
1859 u32 tx_stat_etherstatspkts65octetsto127octets_lo;
1860 /* frames_transmitted_128_255_bytes */
1861 u32 tx_stat_etherstatspkts128octetsto255octets_hi;
1862 u32 tx_stat_etherstatspkts128octetsto255octets_lo;
1863 /* frames_transmitted_256_511_bytes */
1864 u32 tx_stat_etherstatspkts256octetsto511octets_hi;
1865 u32 tx_stat_etherstatspkts256octetsto511octets_lo;
1866 /* frames_transmitted_512_1023_bytes */
1867 u32 tx_stat_etherstatspkts512octetsto1023octets_hi;
1868 u32 tx_stat_etherstatspkts512octetsto1023octets_lo;
1869 /* frames_transmitted_1024_1522_bytes */
1870 u32 tx_stat_etherstatspkts1024octetsto1522octets_hi;
1871 u32 tx_stat_etherstatspkts1024octetsto1522octets_lo;
1872 /* frames_transmitted_1523_9022_bytes */
1873 u32 tx_stat_etherstatspktsover1522octets_hi;
1874 u32 tx_stat_etherstatspktsover1522octets_lo;
1875 u32 tx_stat_bmac_2047_hi;
1876 u32 tx_stat_bmac_2047_lo;
1877 u32 tx_stat_bmac_4095_hi;
1878 u32 tx_stat_bmac_4095_lo;
1879 u32 tx_stat_bmac_9216_hi;
1880 u32 tx_stat_bmac_9216_lo;
1881 u32 tx_stat_bmac_16383_hi;
1882 u32 tx_stat_bmac_16383_lo;
1883
1884 /* internal_mac_transmit_errors */
1885 u32 tx_stat_dot3statsinternalmactransmiterrors_hi;
1886 u32 tx_stat_dot3statsinternalmactransmiterrors_lo;
1887
1888 /* if_out_discards */
1889 u32 tx_stat_bmac_ufl_hi;
1890 u32 tx_stat_bmac_ufl_lo;
1891};
1892
1893
1894#define MAC_STX_IDX_MAX 2
1895
1896struct host_port_stats {
1897 u32 host_port_stats_start;
1898
1899 struct mac_stx mac_stx[MAC_STX_IDX_MAX];
1900
1901 u32 brb_drop_hi;
1902 u32 brb_drop_lo;
1903
1904 u32 host_port_stats_end;
1905};
1906
1907
1908struct host_func_stats {
1909 u32 host_func_stats_start;
1910
1911 u32 total_bytes_received_hi;
1912 u32 total_bytes_received_lo;
1913
1914 u32 total_bytes_transmitted_hi;
1915 u32 total_bytes_transmitted_lo;
1916
1917 u32 total_unicast_packets_received_hi;
1918 u32 total_unicast_packets_received_lo;
1919
1920 u32 total_multicast_packets_received_hi;
1921 u32 total_multicast_packets_received_lo;
1922
1923 u32 total_broadcast_packets_received_hi;
1924 u32 total_broadcast_packets_received_lo;
1925
1926 u32 total_unicast_packets_transmitted_hi;
1927 u32 total_unicast_packets_transmitted_lo;
1928
1929 u32 total_multicast_packets_transmitted_hi;
1930 u32 total_multicast_packets_transmitted_lo;
1931
1932 u32 total_broadcast_packets_transmitted_hi;
1933 u32 total_broadcast_packets_transmitted_lo;
1934
1935 u32 valid_bytes_received_hi;
1936 u32 valid_bytes_received_lo;
1937
1938 u32 host_func_stats_end;
1939};
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001940
1941
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001942#define BCM_5710_FW_MAJOR_VERSION 6
Vladislav Zolotarov5928c8b2010-12-13 05:44:35 +00001943#define BCM_5710_FW_MINOR_VERSION 2
Dmitry Kravkov96b8e1a2011-03-31 17:03:36 -07001944#define BCM_5710_FW_REVISION_VERSION 9
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001945#define BCM_5710_FW_ENGINEERING_VERSION 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001946#define BCM_5710_FW_COMPILE_FLAGS 1
1947
1948
1949/*
1950 * attention bits
1951 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001952struct atten_sp_status_block {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00001953 __le32 attn_bits;
1954 __le32 attn_bits_ack;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001955 u8 status_block_id;
1956 u8 reserved0;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00001957 __le16 attn_bits_index;
1958 __le32 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001959};
1960
1961
1962/*
1963 * common data for all protocols
1964 */
1965struct doorbell_hdr {
1966 u8 header;
1967#define DOORBELL_HDR_RX (0x1<<0)
1968#define DOORBELL_HDR_RX_SHIFT 0
1969#define DOORBELL_HDR_DB_TYPE (0x1<<1)
1970#define DOORBELL_HDR_DB_TYPE_SHIFT 1
1971#define DOORBELL_HDR_DPM_SIZE (0x3<<2)
1972#define DOORBELL_HDR_DPM_SIZE_SHIFT 2
1973#define DOORBELL_HDR_CONN_TYPE (0xF<<4)
1974#define DOORBELL_HDR_CONN_TYPE_SHIFT 4
1975};
1976
1977/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001978 * doorbell message sent to the chip
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001979 */
1980struct doorbell {
1981#if defined(__BIG_ENDIAN)
1982 u16 zero_fill2;
1983 u8 zero_fill1;
1984 struct doorbell_hdr header;
1985#elif defined(__LITTLE_ENDIAN)
1986 struct doorbell_hdr header;
1987 u8 zero_fill1;
1988 u16 zero_fill2;
1989#endif
1990};
1991
1992
1993/*
Eilon Greensteinca003922009-08-12 22:53:28 -07001994 * doorbell message sent to the chip
1995 */
1996struct doorbell_set_prod {
1997#if defined(__BIG_ENDIAN)
1998 u16 prod;
1999 u8 zero_fill1;
2000 struct doorbell_hdr header;
2001#elif defined(__LITTLE_ENDIAN)
2002 struct doorbell_hdr header;
2003 u8 zero_fill1;
2004 u16 prod;
2005#endif
2006};
2007
2008
2009/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002010 * 3 lines. status block
2011 */
2012struct hc_status_block_e1x {
2013 __le16 index_values[HC_SB_MAX_INDICES_E1X];
2014 __le16 running_index[HC_SB_MAX_SM];
2015 u32 rsrv;
2016};
2017
2018/*
2019 * host status block
2020 */
2021struct host_hc_status_block_e1x {
2022 struct hc_status_block_e1x sb;
2023};
2024
2025
2026/*
2027 * 3 lines. status block
2028 */
2029struct hc_status_block_e2 {
2030 __le16 index_values[HC_SB_MAX_INDICES_E2];
2031 __le16 running_index[HC_SB_MAX_SM];
2032 u32 reserved;
2033};
2034
2035/*
2036 * host status block
2037 */
2038struct host_hc_status_block_e2 {
2039 struct hc_status_block_e2 sb;
2040};
2041
2042
2043/*
2044 * 5 lines. slow-path status block
2045 */
2046struct hc_sp_status_block {
2047 __le16 index_values[HC_SP_SB_MAX_INDICES];
2048 __le16 running_index;
2049 __le16 rsrv;
2050 u32 rsrv1;
2051};
2052
2053/*
2054 * host status block
2055 */
2056struct host_sp_status_block {
2057 struct atten_sp_status_block atten_status_block;
2058 struct hc_sp_status_block sp_sb;
2059};
2060
2061
2062/*
2063 * IGU driver acknowledgment register
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002064 */
2065struct igu_ack_register {
2066#if defined(__BIG_ENDIAN)
2067 u16 sb_id_and_flags;
2068#define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
2069#define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
2070#define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
2071#define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
2072#define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
2073#define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
2074#define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
2075#define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
2076#define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
2077#define IGU_ACK_REGISTER_RESERVED_SHIFT 11
2078 u16 status_block_index;
2079#elif defined(__LITTLE_ENDIAN)
2080 u16 status_block_index;
2081 u16 sb_id_and_flags;
2082#define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
2083#define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
2084#define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
2085#define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
2086#define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
2087#define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
2088#define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
2089#define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
2090#define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
2091#define IGU_ACK_REGISTER_RESERVED_SHIFT 11
2092#endif
2093};
2094
2095
2096/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002097 * IGU driver acknowledgement register
2098 */
2099struct igu_backward_compatible {
2100 u32 sb_id_and_flags;
2101#define IGU_BACKWARD_COMPATIBLE_SB_INDEX (0xFFFF<<0)
2102#define IGU_BACKWARD_COMPATIBLE_SB_INDEX_SHIFT 0
2103#define IGU_BACKWARD_COMPATIBLE_SB_SELECT (0x1F<<16)
2104#define IGU_BACKWARD_COMPATIBLE_SB_SELECT_SHIFT 16
2105#define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS (0x7<<21)
2106#define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS_SHIFT 21
2107#define IGU_BACKWARD_COMPATIBLE_BUPDATE (0x1<<24)
2108#define IGU_BACKWARD_COMPATIBLE_BUPDATE_SHIFT 24
2109#define IGU_BACKWARD_COMPATIBLE_ENABLE_INT (0x3<<25)
2110#define IGU_BACKWARD_COMPATIBLE_ENABLE_INT_SHIFT 25
2111#define IGU_BACKWARD_COMPATIBLE_RESERVED_0 (0x1F<<27)
2112#define IGU_BACKWARD_COMPATIBLE_RESERVED_0_SHIFT 27
2113 u32 reserved_2;
2114};
2115
2116
2117/*
2118 * IGU driver acknowledgement register
2119 */
2120struct igu_regular {
2121 u32 sb_id_and_flags;
2122#define IGU_REGULAR_SB_INDEX (0xFFFFF<<0)
2123#define IGU_REGULAR_SB_INDEX_SHIFT 0
2124#define IGU_REGULAR_RESERVED0 (0x1<<20)
2125#define IGU_REGULAR_RESERVED0_SHIFT 20
2126#define IGU_REGULAR_SEGMENT_ACCESS (0x7<<21)
2127#define IGU_REGULAR_SEGMENT_ACCESS_SHIFT 21
2128#define IGU_REGULAR_BUPDATE (0x1<<24)
2129#define IGU_REGULAR_BUPDATE_SHIFT 24
2130#define IGU_REGULAR_ENABLE_INT (0x3<<25)
2131#define IGU_REGULAR_ENABLE_INT_SHIFT 25
2132#define IGU_REGULAR_RESERVED_1 (0x1<<27)
2133#define IGU_REGULAR_RESERVED_1_SHIFT 27
2134#define IGU_REGULAR_CLEANUP_TYPE (0x3<<28)
2135#define IGU_REGULAR_CLEANUP_TYPE_SHIFT 28
2136#define IGU_REGULAR_CLEANUP_SET (0x1<<30)
2137#define IGU_REGULAR_CLEANUP_SET_SHIFT 30
2138#define IGU_REGULAR_BCLEANUP (0x1<<31)
2139#define IGU_REGULAR_BCLEANUP_SHIFT 31
2140 u32 reserved_2;
2141};
2142
2143/*
2144 * IGU driver acknowledgement register
2145 */
2146union igu_consprod_reg {
2147 struct igu_regular regular;
2148 struct igu_backward_compatible backward_compatible;
2149};
2150
2151
2152/*
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002153 * Control register for the IGU command register
2154 */
2155struct igu_ctrl_reg {
2156 u32 ctrl_data;
2157#define IGU_CTRL_REG_ADDRESS (0xFFF<<0)
2158#define IGU_CTRL_REG_ADDRESS_SHIFT 0
2159#define IGU_CTRL_REG_FID (0x7F<<12)
2160#define IGU_CTRL_REG_FID_SHIFT 12
2161#define IGU_CTRL_REG_RESERVED (0x1<<19)
2162#define IGU_CTRL_REG_RESERVED_SHIFT 19
2163#define IGU_CTRL_REG_TYPE (0x1<<20)
2164#define IGU_CTRL_REG_TYPE_SHIFT 20
2165#define IGU_CTRL_REG_UNUSED (0x7FF<<21)
2166#define IGU_CTRL_REG_UNUSED_SHIFT 21
2167};
2168
2169
2170/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002171 * Parser parsing flags field
2172 */
2173struct parsing_flags {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002174 __le16 flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002175#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0)
2176#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002177#define PARSING_FLAGS_VLAN (0x1<<1)
2178#define PARSING_FLAGS_VLAN_SHIFT 1
2179#define PARSING_FLAGS_EXTRA_VLAN (0x1<<2)
2180#define PARSING_FLAGS_EXTRA_VLAN_SHIFT 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002181#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL (0x3<<3)
2182#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT 3
2183#define PARSING_FLAGS_IP_OPTIONS (0x1<<5)
2184#define PARSING_FLAGS_IP_OPTIONS_SHIFT 5
2185#define PARSING_FLAGS_FRAGMENTATION_STATUS (0x1<<6)
2186#define PARSING_FLAGS_FRAGMENTATION_STATUS_SHIFT 6
2187#define PARSING_FLAGS_OVER_IP_PROTOCOL (0x3<<7)
2188#define PARSING_FLAGS_OVER_IP_PROTOCOL_SHIFT 7
2189#define PARSING_FLAGS_PURE_ACK_INDICATION (0x1<<9)
2190#define PARSING_FLAGS_PURE_ACK_INDICATION_SHIFT 9
2191#define PARSING_FLAGS_TCP_OPTIONS_EXIST (0x1<<10)
2192#define PARSING_FLAGS_TCP_OPTIONS_EXIST_SHIFT 10
2193#define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG (0x1<<11)
2194#define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG_SHIFT 11
2195#define PARSING_FLAGS_CONNECTION_MATCH (0x1<<12)
2196#define PARSING_FLAGS_CONNECTION_MATCH_SHIFT 12
2197#define PARSING_FLAGS_LLC_SNAP (0x1<<13)
2198#define PARSING_FLAGS_LLC_SNAP_SHIFT 13
2199#define PARSING_FLAGS_RESERVED0 (0x3<<14)
2200#define PARSING_FLAGS_RESERVED0_SHIFT 14
2201};
2202
2203
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002204struct regpair {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002205 __le32 lo;
2206 __le32 hi;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002207};
2208
2209
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002210/*
2211 * dmae command structure
2212 */
2213struct dmae_command {
2214 u32 opcode;
2215#define DMAE_COMMAND_SRC (0x1<<0)
2216#define DMAE_COMMAND_SRC_SHIFT 0
2217#define DMAE_COMMAND_DST (0x3<<1)
2218#define DMAE_COMMAND_DST_SHIFT 1
2219#define DMAE_COMMAND_C_DST (0x1<<3)
2220#define DMAE_COMMAND_C_DST_SHIFT 3
2221#define DMAE_COMMAND_C_TYPE_ENABLE (0x1<<4)
2222#define DMAE_COMMAND_C_TYPE_ENABLE_SHIFT 4
2223#define DMAE_COMMAND_C_TYPE_CRC_ENABLE (0x1<<5)
2224#define DMAE_COMMAND_C_TYPE_CRC_ENABLE_SHIFT 5
2225#define DMAE_COMMAND_C_TYPE_CRC_OFFSET (0x7<<6)
2226#define DMAE_COMMAND_C_TYPE_CRC_OFFSET_SHIFT 6
2227#define DMAE_COMMAND_ENDIANITY (0x3<<9)
2228#define DMAE_COMMAND_ENDIANITY_SHIFT 9
2229#define DMAE_COMMAND_PORT (0x1<<11)
2230#define DMAE_COMMAND_PORT_SHIFT 11
2231#define DMAE_COMMAND_CRC_RESET (0x1<<12)
2232#define DMAE_COMMAND_CRC_RESET_SHIFT 12
2233#define DMAE_COMMAND_SRC_RESET (0x1<<13)
2234#define DMAE_COMMAND_SRC_RESET_SHIFT 13
2235#define DMAE_COMMAND_DST_RESET (0x1<<14)
2236#define DMAE_COMMAND_DST_RESET_SHIFT 14
Eilon Greensteinad8d3942008-06-23 20:29:02 -07002237#define DMAE_COMMAND_E1HVN (0x3<<15)
2238#define DMAE_COMMAND_E1HVN_SHIFT 15
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002239#define DMAE_COMMAND_DST_VN (0x3<<17)
2240#define DMAE_COMMAND_DST_VN_SHIFT 17
2241#define DMAE_COMMAND_C_FUNC (0x1<<19)
2242#define DMAE_COMMAND_C_FUNC_SHIFT 19
2243#define DMAE_COMMAND_ERR_POLICY (0x3<<20)
2244#define DMAE_COMMAND_ERR_POLICY_SHIFT 20
2245#define DMAE_COMMAND_RESERVED0 (0x3FF<<22)
2246#define DMAE_COMMAND_RESERVED0_SHIFT 22
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002247 u32 src_addr_lo;
2248 u32 src_addr_hi;
2249 u32 dst_addr_lo;
2250 u32 dst_addr_hi;
2251#if defined(__BIG_ENDIAN)
2252 u16 reserved1;
2253 u16 len;
2254#elif defined(__LITTLE_ENDIAN)
2255 u16 len;
2256 u16 reserved1;
2257#endif
2258 u32 comp_addr_lo;
2259 u32 comp_addr_hi;
2260 u32 comp_val;
2261 u32 crc32;
2262 u32 crc32_c;
2263#if defined(__BIG_ENDIAN)
2264 u16 crc16_c;
2265 u16 crc16;
2266#elif defined(__LITTLE_ENDIAN)
2267 u16 crc16;
2268 u16 crc16_c;
2269#endif
2270#if defined(__BIG_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002271 u16 reserved3;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002272 u16 crc_t10;
2273#elif defined(__LITTLE_ENDIAN)
2274 u16 crc_t10;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002275 u16 reserved3;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002276#endif
2277#if defined(__BIG_ENDIAN)
2278 u16 xsum8;
2279 u16 xsum16;
2280#elif defined(__LITTLE_ENDIAN)
2281 u16 xsum16;
2282 u16 xsum8;
2283#endif
2284};
2285
2286
2287struct double_regpair {
2288 u32 regpair0_lo;
2289 u32 regpair0_hi;
2290 u32 regpair1_lo;
2291 u32 regpair1_hi;
2292};
2293
2294
2295/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002296 * SDM operation gen command (generate aggregative interrupt)
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002297 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002298struct sdm_op_gen {
2299 __le32 command;
2300#define SDM_OP_GEN_COMP_PARAM (0x1F<<0)
2301#define SDM_OP_GEN_COMP_PARAM_SHIFT 0
2302#define SDM_OP_GEN_COMP_TYPE (0x7<<5)
2303#define SDM_OP_GEN_COMP_TYPE_SHIFT 5
2304#define SDM_OP_GEN_AGG_VECT_IDX (0xFF<<8)
2305#define SDM_OP_GEN_AGG_VECT_IDX_SHIFT 8
2306#define SDM_OP_GEN_AGG_VECT_IDX_VALID (0x1<<16)
2307#define SDM_OP_GEN_AGG_VECT_IDX_VALID_SHIFT 16
2308#define SDM_OP_GEN_RESERVED (0x7FFF<<17)
2309#define SDM_OP_GEN_RESERVED_SHIFT 17
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002310};
2311
2312/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002313 * The eth Rx Buffer Descriptor
2314 */
2315struct eth_rx_bd {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002316 __le32 addr_lo;
2317 __le32 addr_hi;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002318};
2319
2320/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002321 * The eth Rx SGE Descriptor
2322 */
2323struct eth_rx_sge {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002324 __le32 addr_lo;
2325 __le32 addr_hi;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002326};
2327
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002328
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002329
2330/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002331 * The eth storm context of Ustorm
2332 */
2333struct ustorm_eth_st_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002334 u32 reserved0[48];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002335};
2336
2337/*
2338 * The eth storm context of Tstorm
2339 */
2340struct tstorm_eth_st_context {
2341 u32 __reserved0[28];
2342};
2343
2344/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002345 * The eth aggregative context of Xstorm
2346 */
2347struct xstorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002348 u32 reserved0;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002349#if defined(__BIG_ENDIAN)
2350 u8 cdu_reserved;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002351 u8 reserved2;
2352 u16 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002353#elif defined(__LITTLE_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002354 u16 reserved1;
2355 u8 reserved2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002356 u8 cdu_reserved;
2357#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002358 u32 reserved3[30];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002359};
2360
2361/*
2362 * The eth aggregative context of Tstorm
2363 */
2364struct tstorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002365 u32 __reserved0[14];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002366};
2367
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002368
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002369/*
2370 * The eth aggregative context of Cstorm
2371 */
2372struct cstorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002373 u32 __reserved0[10];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002374};
2375
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002376
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002377/*
2378 * The eth aggregative context of Ustorm
2379 */
2380struct ustorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002381 u32 __reserved0;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002382#if defined(__BIG_ENDIAN)
2383 u8 cdu_usage;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002384 u8 __reserved2;
2385 u16 __reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002386#elif defined(__LITTLE_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002387 u16 __reserved1;
2388 u8 __reserved2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002389 u8 cdu_usage;
2390#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002391 u32 __reserved3[6];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002392};
2393
2394/*
2395 * Timers connection context
2396 */
2397struct timers_block_context {
2398 u32 __reserved_0;
2399 u32 __reserved_1;
2400 u32 __reserved_2;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002401 u32 flags;
2402#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS (0x3<<0)
2403#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS_SHIFT 0
2404#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG (0x1<<2)
2405#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG_SHIFT 2
2406#define __TIMERS_BLOCK_CONTEXT_RESERVED0 (0x1FFFFFFF<<3)
2407#define __TIMERS_BLOCK_CONTEXT_RESERVED0_SHIFT 3
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002408};
2409
2410/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002411 * structure for easy accessibility to assembler
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002412 */
2413struct eth_tx_bd_flags {
2414 u8 as_bitfield;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002415#define ETH_TX_BD_FLAGS_IP_CSUM (0x1<<0)
2416#define ETH_TX_BD_FLAGS_IP_CSUM_SHIFT 0
2417#define ETH_TX_BD_FLAGS_L4_CSUM (0x1<<1)
2418#define ETH_TX_BD_FLAGS_L4_CSUM_SHIFT 1
2419#define ETH_TX_BD_FLAGS_VLAN_MODE (0x3<<2)
2420#define ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002421#define ETH_TX_BD_FLAGS_START_BD (0x1<<4)
2422#define ETH_TX_BD_FLAGS_START_BD_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002423#define ETH_TX_BD_FLAGS_IS_UDP (0x1<<5)
2424#define ETH_TX_BD_FLAGS_IS_UDP_SHIFT 5
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002425#define ETH_TX_BD_FLAGS_SW_LSO (0x1<<6)
2426#define ETH_TX_BD_FLAGS_SW_LSO_SHIFT 6
2427#define ETH_TX_BD_FLAGS_IPV6 (0x1<<7)
2428#define ETH_TX_BD_FLAGS_IPV6_SHIFT 7
2429};
2430
2431/*
2432 * The eth Tx Buffer Descriptor
2433 */
Eilon Greensteinca003922009-08-12 22:53:28 -07002434struct eth_tx_start_bd {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002435 __le32 addr_lo;
2436 __le32 addr_hi;
2437 __le16 nbd;
2438 __le16 nbytes;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002439 __le16 vlan_or_ethertype;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002440 struct eth_tx_bd_flags bd_flags;
2441 u8 general_data;
Eilon Greensteinca003922009-08-12 22:53:28 -07002442#define ETH_TX_START_BD_HDR_NBDS (0x3F<<0)
2443#define ETH_TX_START_BD_HDR_NBDS_SHIFT 0
2444#define ETH_TX_START_BD_ETH_ADDR_TYPE (0x3<<6)
2445#define ETH_TX_START_BD_ETH_ADDR_TYPE_SHIFT 6
2446};
2447
2448/*
2449 * Tx regular BD structure
2450 */
2451struct eth_tx_bd {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002452 __le32 addr_lo;
2453 __le32 addr_hi;
2454 __le16 total_pkt_bytes;
2455 __le16 nbytes;
Eilon Greensteinca003922009-08-12 22:53:28 -07002456 u8 reserved[4];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002457};
2458
2459/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002460 * Tx parsing BD structure for ETH E1/E1h
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002461 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002462struct eth_tx_parse_bd_e1x {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002463 u8 global_data;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002464#define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W (0xF<<0)
2465#define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W_SHIFT 0
2466#define ETH_TX_PARSE_BD_E1X_RESERVED0 (0x1<<4)
2467#define ETH_TX_PARSE_BD_E1X_RESERVED0_SHIFT 4
2468#define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN (0x1<<5)
2469#define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN_SHIFT 5
2470#define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN (0x1<<6)
2471#define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT 6
2472#define ETH_TX_PARSE_BD_E1X_NS_FLG (0x1<<7)
2473#define ETH_TX_PARSE_BD_E1X_NS_FLG_SHIFT 7
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002474 u8 tcp_flags;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002475#define ETH_TX_PARSE_BD_E1X_FIN_FLG (0x1<<0)
2476#define ETH_TX_PARSE_BD_E1X_FIN_FLG_SHIFT 0
2477#define ETH_TX_PARSE_BD_E1X_SYN_FLG (0x1<<1)
2478#define ETH_TX_PARSE_BD_E1X_SYN_FLG_SHIFT 1
2479#define ETH_TX_PARSE_BD_E1X_RST_FLG (0x1<<2)
2480#define ETH_TX_PARSE_BD_E1X_RST_FLG_SHIFT 2
2481#define ETH_TX_PARSE_BD_E1X_PSH_FLG (0x1<<3)
2482#define ETH_TX_PARSE_BD_E1X_PSH_FLG_SHIFT 3
2483#define ETH_TX_PARSE_BD_E1X_ACK_FLG (0x1<<4)
2484#define ETH_TX_PARSE_BD_E1X_ACK_FLG_SHIFT 4
2485#define ETH_TX_PARSE_BD_E1X_URG_FLG (0x1<<5)
2486#define ETH_TX_PARSE_BD_E1X_URG_FLG_SHIFT 5
2487#define ETH_TX_PARSE_BD_E1X_ECE_FLG (0x1<<6)
2488#define ETH_TX_PARSE_BD_E1X_ECE_FLG_SHIFT 6
2489#define ETH_TX_PARSE_BD_E1X_CWR_FLG (0x1<<7)
2490#define ETH_TX_PARSE_BD_E1X_CWR_FLG_SHIFT 7
2491 u8 ip_hlen_w;
Eilon Greensteinca003922009-08-12 22:53:28 -07002492 s8 reserved;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002493 __le16 total_hlen_w;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002494 __le16 tcp_pseudo_csum;
Eilon Greensteinca003922009-08-12 22:53:28 -07002495 __le16 lso_mss;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002496 __le16 ip_id;
2497 __le32 tcp_send_seq;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002498};
2499
2500/*
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002501 * Tx parsing BD structure for ETH E2
2502 */
2503struct eth_tx_parse_bd_e2 {
2504 __le16 dst_mac_addr_lo;
2505 __le16 dst_mac_addr_mid;
2506 __le16 dst_mac_addr_hi;
2507 __le16 src_mac_addr_lo;
2508 __le16 src_mac_addr_mid;
2509 __le16 src_mac_addr_hi;
2510 __le32 parsing_data;
2511#define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W (0x1FFF<<0)
2512#define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT 0
2513#define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW (0xF<<13)
2514#define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT 13
2515#define ETH_TX_PARSE_BD_E2_LSO_MSS (0x3FFF<<17)
2516#define ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT 17
2517#define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR (0x1<<31)
2518#define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR_SHIFT 31
2519};
2520
2521/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002522 * The last BD in the BD memory will hold a pointer to the next BD memory
2523 */
2524struct eth_tx_next_bd {
Eilon Greensteinca003922009-08-12 22:53:28 -07002525 __le32 addr_lo;
2526 __le32 addr_hi;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002527 u8 reserved[8];
2528};
2529
2530/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002531 * union for 4 Bd types
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002532 */
2533union eth_tx_bd_types {
Eilon Greensteinca003922009-08-12 22:53:28 -07002534 struct eth_tx_start_bd start_bd;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002535 struct eth_tx_bd reg_bd;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002536 struct eth_tx_parse_bd_e1x parse_bd_e1x;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002537 struct eth_tx_parse_bd_e2 parse_bd_e2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002538 struct eth_tx_next_bd next_bd;
2539};
2540
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002541
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002542/*
2543 * The eth storm context of Xstorm
2544 */
2545struct xstorm_eth_st_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002546 u32 reserved0[60];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002547};
2548
2549/*
2550 * The eth storm context of Cstorm
2551 */
2552struct cstorm_eth_st_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002553 u32 __reserved0[4];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002554};
2555
2556/*
2557 * Ethernet connection context
2558 */
2559struct eth_context {
2560 struct ustorm_eth_st_context ustorm_st_context;
2561 struct tstorm_eth_st_context tstorm_st_context;
2562 struct xstorm_eth_ag_context xstorm_ag_context;
2563 struct tstorm_eth_ag_context tstorm_ag_context;
2564 struct cstorm_eth_ag_context cstorm_ag_context;
2565 struct ustorm_eth_ag_context ustorm_ag_context;
2566 struct timers_block_context timers_context;
2567 struct xstorm_eth_st_context xstorm_st_context;
2568 struct cstorm_eth_st_context cstorm_st_context;
2569};
2570
2571
2572/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002573 * Ethernet doorbell
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002574 */
2575struct eth_tx_doorbell {
2576#if defined(__BIG_ENDIAN)
2577 u16 npackets;
2578 u8 params;
2579#define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
2580#define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
2581#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
2582#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
2583#define ETH_TX_DOORBELL_SPARE (0x1<<7)
2584#define ETH_TX_DOORBELL_SPARE_SHIFT 7
2585 struct doorbell_hdr hdr;
2586#elif defined(__LITTLE_ENDIAN)
2587 struct doorbell_hdr hdr;
2588 u8 params;
2589#define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
2590#define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
2591#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
2592#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
2593#define ETH_TX_DOORBELL_SPARE (0x1<<7)
2594#define ETH_TX_DOORBELL_SPARE_SHIFT 7
2595 u16 npackets;
2596#endif
2597};
2598
2599
2600/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002601 * client init fc data
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002602 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002603struct client_init_fc_data {
2604 __le16 cqe_pause_thr_low;
2605 __le16 cqe_pause_thr_high;
2606 __le16 bd_pause_thr_low;
2607 __le16 bd_pause_thr_high;
2608 __le16 sge_pause_thr_low;
2609 __le16 sge_pause_thr_high;
2610 __le16 rx_cos_mask;
2611 u8 safc_group_num;
2612 u8 safc_group_en_flg;
2613 u8 traffic_type;
2614 u8 reserved0;
2615 __le16 reserved1;
2616 __le32 reserved2;
2617};
2618
2619
2620/*
2621 * client init ramrod data
2622 */
2623struct client_init_general_data {
2624 u8 client_id;
2625 u8 statistics_counter_id;
2626 u8 statistics_en_flg;
2627 u8 is_fcoe_flg;
2628 u8 activate_flg;
2629 u8 sp_client_id;
2630 __le16 reserved0;
2631 __le32 reserved1[2];
2632};
2633
2634
2635/*
2636 * client init rx data
2637 */
2638struct client_init_rx_data {
2639 u8 tpa_en_flg;
2640 u8 vmqueue_mode_en_flg;
2641 u8 extra_data_over_sgl_en_flg;
2642 u8 cache_line_alignment_log_size;
2643 u8 enable_dynamic_hc;
2644 u8 max_sges_for_packet;
2645 u8 client_qzone_id;
2646 u8 drop_ip_cs_err_flg;
2647 u8 drop_tcp_cs_err_flg;
2648 u8 drop_ttl0_flg;
2649 u8 drop_udp_cs_err_flg;
2650 u8 inner_vlan_removal_enable_flg;
2651 u8 outer_vlan_removal_enable_flg;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002652 u8 status_block_id;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002653 u8 rx_sb_index_number;
2654 u8 reserved0[3];
2655 __le16 bd_buff_size;
2656 __le16 sge_buff_size;
2657 __le16 mtu;
2658 struct regpair bd_page_base;
2659 struct regpair sge_page_base;
2660 struct regpair cqe_page_base;
2661 u8 is_leading_rss;
2662 u8 is_approx_mcast;
2663 __le16 max_agg_size;
2664 __le32 reserved2[3];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002665};
2666
2667/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002668 * client init tx data
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002669 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002670struct client_init_tx_data {
2671 u8 enforce_security_flg;
2672 u8 tx_status_block_id;
2673 u8 tx_sb_index_number;
2674 u8 reserved0;
2675 __le16 mtu;
2676 __le16 reserved1;
2677 struct regpair tx_bd_page_base;
2678 __le32 reserved2[2];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002679};
2680
2681/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002682 * client init ramrod data
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002683 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002684struct client_init_ramrod_data {
2685 struct client_init_general_data general;
2686 struct client_init_rx_data rx;
2687 struct client_init_tx_data tx;
2688 struct client_init_fc_data fc;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002689};
2690
2691
2692/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002693 * The data contain client ID need to the ramrod
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002694 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002695struct eth_common_ramrod_data {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002696 u32 client_id;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002697 u32 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002698};
2699
2700
2701/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002702 * union for sgl and raw data.
2703 */
2704union eth_sgl_or_raw_data {
2705 __le16 sgl[8];
2706 u32 raw_data[4];
2707};
2708
2709/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002710 * regular eth FP CQE parameters struct
2711 */
2712struct eth_fast_path_rx_cqe {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002713 u8 type_error_flags;
2714#define ETH_FAST_PATH_RX_CQE_TYPE (0x1<<0)
2715#define ETH_FAST_PATH_RX_CQE_TYPE_SHIFT 0
2716#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG (0x1<<1)
2717#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG_SHIFT 1
2718#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG (0x1<<2)
2719#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG_SHIFT 2
2720#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG (0x1<<3)
2721#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG_SHIFT 3
2722#define ETH_FAST_PATH_RX_CQE_START_FLG (0x1<<4)
2723#define ETH_FAST_PATH_RX_CQE_START_FLG_SHIFT 4
2724#define ETH_FAST_PATH_RX_CQE_END_FLG (0x1<<5)
2725#define ETH_FAST_PATH_RX_CQE_END_FLG_SHIFT 5
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002726#define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL (0x3<<6)
2727#define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL_SHIFT 6
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002728 u8 status_flags;
2729#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE (0x7<<0)
2730#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE_SHIFT 0
2731#define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG (0x1<<3)
2732#define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG_SHIFT 3
2733#define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG (0x1<<4)
2734#define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG_SHIFT 4
2735#define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG (0x1<<5)
2736#define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG_SHIFT 5
2737#define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG (0x1<<6)
2738#define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG_SHIFT 6
2739#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG (0x1<<7)
2740#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7
2741 u8 placement_offset;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002742 u8 queue_index;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002743 __le32 rss_hash_result;
2744 __le16 vlan_tag;
2745 __le16 pkt_len;
2746 __le16 len_on_bd;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002747 struct parsing_flags pars_flags;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002748 union eth_sgl_or_raw_data sgl_or_raw_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002749};
2750
2751
2752/*
2753 * The data for RSS setup ramrod
2754 */
2755struct eth_halt_ramrod_data {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002756 u32 client_id;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002757 u32 reserved0;
2758};
2759
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002760/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002761 * The data for statistics query ramrod
2762 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002763struct common_query_ramrod_data {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002764#if defined(__BIG_ENDIAN)
2765 u8 reserved0;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002766 u8 collect_port;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002767 u16 drv_counter;
2768#elif defined(__LITTLE_ENDIAN)
2769 u16 drv_counter;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002770 u8 collect_port;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002771 u8 reserved0;
2772#endif
2773 u32 ctr_id_vector;
2774};
2775
2776
2777/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002778 * Place holder for ramrods protocol specific data
2779 */
2780struct ramrod_data {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002781 __le32 data_lo;
2782 __le32 data_hi;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002783};
2784
2785/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002786 * union for ramrod data for Ethernet protocol (CQE) (force size of 16 bits)
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002787 */
2788union eth_ramrod_data {
2789 struct ramrod_data general;
2790};
2791
2792
2793/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002794 * Eth Rx Cqe structure- general structure for ramrods
2795 */
2796struct common_ramrod_eth_rx_cqe {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002797 u8 ramrod_type;
2798#define COMMON_RAMROD_ETH_RX_CQE_TYPE (0x1<<0)
2799#define COMMON_RAMROD_ETH_RX_CQE_TYPE_SHIFT 0
Vladislav Zolotarov3359fce2010-02-17 13:35:01 -08002800#define COMMON_RAMROD_ETH_RX_CQE_ERROR (0x1<<1)
2801#define COMMON_RAMROD_ETH_RX_CQE_ERROR_SHIFT 1
2802#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x3F<<2)
2803#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 2
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002804 u8 conn_type;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002805 __le16 reserved1;
2806 __le32 conn_and_cmd_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002807#define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0)
2808#define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0
2809#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24)
2810#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24
2811 struct ramrod_data protocol_data;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002812 __le32 reserved2[4];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002813};
2814
2815/*
2816 * Rx Last CQE in page (in ETH)
2817 */
2818struct eth_rx_cqe_next_page {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002819 __le32 addr_lo;
2820 __le32 addr_hi;
2821 __le32 reserved[6];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002822};
2823
2824/*
2825 * union for all eth rx cqe types (fix their sizes)
2826 */
2827union eth_rx_cqe {
2828 struct eth_fast_path_rx_cqe fast_path_cqe;
2829 struct common_ramrod_eth_rx_cqe ramrod_cqe;
2830 struct eth_rx_cqe_next_page next_page_cqe;
2831};
2832
2833
2834/*
2835 * common data for all protocols
2836 */
2837struct spe_hdr {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002838 __le32 conn_and_cmd_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002839#define SPE_HDR_CID (0xFFFFFF<<0)
2840#define SPE_HDR_CID_SHIFT 0
2841#define SPE_HDR_CMD_ID (0xFF<<24)
2842#define SPE_HDR_CMD_ID_SHIFT 24
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002843 __le16 type;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002844#define SPE_HDR_CONN_TYPE (0xFF<<0)
2845#define SPE_HDR_CONN_TYPE_SHIFT 0
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002846#define SPE_HDR_FUNCTION_ID (0xFF<<8)
2847#define SPE_HDR_FUNCTION_ID_SHIFT 8
2848 __le16 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002849};
2850
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002851/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002852 * Ethernet slow path element
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002853 */
2854union eth_specific_data {
2855 u8 protocol_data[8];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002856 struct regpair client_init_ramrod_init_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002857 struct eth_halt_ramrod_data halt_ramrod_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002858 struct regpair update_data_addr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002859 struct eth_common_ramrod_data common_ramrod_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002860};
2861
2862/*
Eilon Greenstein33471622008-08-13 15:59:08 -07002863 * Ethernet slow path element
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002864 */
2865struct eth_spe {
2866 struct spe_hdr hdr;
2867 union eth_specific_data data;
2868};
2869
2870
2871/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002872 * array of 13 bds as appears in the eth xstorm context
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002873 */
Eilon Greensteinca003922009-08-12 22:53:28 -07002874struct eth_tx_bds_array {
2875 union eth_tx_bd_types bds[13];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002876};
2877
2878
2879/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002880 * Common configuration parameters per function in Tstorm
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002881 */
2882struct tstorm_eth_function_common_config {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002883#if defined(__BIG_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002884 u8 reserved1;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002885 u8 rss_result_mask;
2886 u16 config_flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002887#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
2888#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
2889#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
2890#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
2891#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
2892#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
2893#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
2894#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002895#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4)
2896#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002897#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA (0x1<<7)
2898#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA_SHIFT 7
2899#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE (0x1<<8)
2900#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE_SHIFT 8
2901#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x7F<<9)
2902#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 9
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002903#elif defined(__LITTLE_ENDIAN)
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002904 u16 config_flags;
2905#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
2906#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
2907#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
2908#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
2909#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
2910#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
2911#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
2912#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002913#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4)
2914#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002915#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA (0x1<<7)
2916#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA_SHIFT 7
2917#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE (0x1<<8)
2918#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE_SHIFT 8
2919#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x7F<<9)
2920#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 9
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002921 u8 rss_result_mask;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002922 u8 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002923#endif
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002924 u16 vlan_id[2];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002925};
2926
2927/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002928 * RSS idirection table update configuration
2929 */
2930struct rss_update_config {
2931#if defined(__BIG_ENDIAN)
2932 u16 toe_rss_bitmap;
2933 u16 flags;
2934#define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE (0x1<<0)
2935#define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE_SHIFT 0
2936#define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE (0x1<<1)
2937#define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE_SHIFT 1
2938#define __RSS_UPDATE_CONFIG_RESERVED0 (0x3FFF<<2)
2939#define __RSS_UPDATE_CONFIG_RESERVED0_SHIFT 2
2940#elif defined(__LITTLE_ENDIAN)
2941 u16 flags;
2942#define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE (0x1<<0)
2943#define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE_SHIFT 0
2944#define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE (0x1<<1)
2945#define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE_SHIFT 1
2946#define __RSS_UPDATE_CONFIG_RESERVED0 (0x3FFF<<2)
2947#define __RSS_UPDATE_CONFIG_RESERVED0_SHIFT 2
2948 u16 toe_rss_bitmap;
2949#endif
2950 u32 reserved1;
2951};
2952
2953/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002954 * parameters for eth update ramrod
2955 */
2956struct eth_update_ramrod_data {
2957 struct tstorm_eth_function_common_config func_config;
2958 u8 indirectionTable[128];
Eilon Greensteinca003922009-08-12 22:53:28 -07002959 struct rss_update_config rss_config;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002960};
2961
2962
2963/*
2964 * MAC filtering configuration command header
2965 */
2966struct mac_configuration_hdr {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08002967 u8 length;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002968 u8 offset;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002969 u16 client_id;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002970 u16 echo;
2971 u16 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002972};
2973
2974/*
2975 * MAC address in list for ramrod
2976 */
2977struct mac_configuration_entry {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002978 __le16 lsb_mac_addr;
2979 __le16 middle_mac_addr;
2980 __le16 msb_mac_addr;
2981 __le16 vlan_id;
2982 u8 pf_id;
2983 u8 flags;
2984#define MAC_CONFIGURATION_ENTRY_ACTION_TYPE (0x1<<0)
2985#define MAC_CONFIGURATION_ENTRY_ACTION_TYPE_SHIFT 0
2986#define MAC_CONFIGURATION_ENTRY_RDMA_MAC (0x1<<1)
2987#define MAC_CONFIGURATION_ENTRY_RDMA_MAC_SHIFT 1
2988#define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE (0x3<<2)
2989#define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE_SHIFT 2
2990#define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL (0x1<<4)
2991#define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL_SHIFT 4
2992#define MAC_CONFIGURATION_ENTRY_BROADCAST (0x1<<5)
2993#define MAC_CONFIGURATION_ENTRY_BROADCAST_SHIFT 5
2994#define MAC_CONFIGURATION_ENTRY_RESERVED1 (0x3<<6)
2995#define MAC_CONFIGURATION_ENTRY_RESERVED1_SHIFT 6
2996 u16 reserved0;
2997 u32 clients_bit_vector;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002998};
2999
3000/*
3001 * MAC filtering configuration command
3002 */
3003struct mac_configuration_cmd {
3004 struct mac_configuration_hdr hdr;
3005 struct mac_configuration_entry config_table[64];
3006};
3007
3008
3009/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003010 * approximate-match multicast filtering for E1H per function in Tstorm
3011 */
3012struct tstorm_eth_approximate_match_multicast_filtering {
3013 u32 mcast_add_hash_bit_array[8];
3014};
3015
3016
3017/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003018 * MAC filtering configuration parameters per port in Tstorm
3019 */
3020struct tstorm_eth_mac_filter_config {
3021 u32 ucast_drop_all;
3022 u32 ucast_accept_all;
3023 u32 mcast_drop_all;
3024 u32 mcast_accept_all;
3025 u32 bcast_drop_all;
3026 u32 bcast_accept_all;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003027 u32 vlan_filter[2];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003028 u32 unmatched_unicast;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003029 u32 reserved;
3030};
3031
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003032
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003033/*
Lucas De Marchi25985ed2011-03-30 22:57:33 -03003034 * common flag to indicate existence of TPA.
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003035 */
3036struct tstorm_eth_tpa_exist {
3037#if defined(__BIG_ENDIAN)
3038 u16 reserved1;
3039 u8 reserved0;
3040 u8 tpa_exist;
3041#elif defined(__LITTLE_ENDIAN)
3042 u8 tpa_exist;
3043 u8 reserved0;
3044 u16 reserved1;
3045#endif
3046 u32 reserved2;
3047};
3048
3049
3050/*
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003051 * Three RX producers for ETH
3052 */
3053struct ustorm_eth_rx_producers {
3054#if defined(__BIG_ENDIAN)
3055 u16 bd_prod;
3056 u16 cqe_prod;
3057#elif defined(__LITTLE_ENDIAN)
3058 u16 cqe_prod;
3059 u16 bd_prod;
3060#endif
3061#if defined(__BIG_ENDIAN)
3062 u16 reserved;
3063 u16 sge_prod;
3064#elif defined(__LITTLE_ENDIAN)
3065 u16 sge_prod;
3066 u16 reserved;
3067#endif
3068};
3069
3070
3071/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003072 * cfc delete event data
3073 */
3074struct cfc_del_event_data {
3075 u32 cid;
3076 u8 error;
3077 u8 reserved0;
3078 u16 reserved1;
3079 u32 reserved2;
3080};
3081
3082
3083/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003084 * per-port SAFC demo variables
3085 */
3086struct cmng_flags_per_port {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003087 u8 con_number[NUM_OF_PROTOCOLS];
Eilon Greenstein8a1c38d2009-02-12 08:36:40 +00003088 u32 cmng_enables;
3089#define CMNG_FLAGS_PER_PORT_FAIRNESS_VN (0x1<<0)
3090#define CMNG_FLAGS_PER_PORT_FAIRNESS_VN_SHIFT 0
3091#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN (0x1<<1)
3092#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN_SHIFT 1
3093#define CMNG_FLAGS_PER_PORT_FAIRNESS_PROTOCOL (0x1<<2)
3094#define CMNG_FLAGS_PER_PORT_FAIRNESS_PROTOCOL_SHIFT 2
3095#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_PROTOCOL (0x1<<3)
3096#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_PROTOCOL_SHIFT 3
3097#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS (0x1<<4)
3098#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003099#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE (0x1<<5)
3100#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE_SHIFT 5
3101#define __CMNG_FLAGS_PER_PORT_RESERVED0 (0x3FFFFFF<<6)
3102#define __CMNG_FLAGS_PER_PORT_RESERVED0_SHIFT 6
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003103};
3104
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003105
3106/*
3107 * per-port rate shaping variables
3108 */
3109struct rate_shaping_vars_per_port {
3110 u32 rs_periodic_timeout;
3111 u32 rs_threshold;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003112};
3113
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003114/*
3115 * per-port fairness variables
3116 */
3117struct fairness_vars_per_port {
3118 u32 upper_bound;
3119 u32 fair_threshold;
3120 u32 fairness_timeout;
3121};
3122
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003123/*
3124 * per-port SAFC variables
3125 */
3126struct safc_struct_per_port {
3127#if defined(__BIG_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003128 u16 __reserved1;
3129 u8 __reserved0;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003130 u8 safc_timeout_usec;
3131#elif defined(__LITTLE_ENDIAN)
3132 u8 safc_timeout_usec;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003133 u8 __reserved0;
3134 u16 __reserved1;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003135#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003136 u8 cos_to_traffic_types[MAX_COS_NUMBER];
3137 u32 __reserved2;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003138 u16 cos_to_pause_mask[NUM_OF_SAFC_BITS];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003139};
3140
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003141/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003142 * per-port PFC variables
3143 */
3144struct pfc_struct_per_port {
3145 u8 priority_to_traffic_types[MAX_PFC_PRIORITIES];
3146#if defined(__BIG_ENDIAN)
3147 u16 pfc_pause_quanta_in_nanosec;
3148 u8 __reserved0;
3149 u8 priority_non_pausable_mask;
3150#elif defined(__LITTLE_ENDIAN)
3151 u8 priority_non_pausable_mask;
3152 u8 __reserved0;
3153 u16 pfc_pause_quanta_in_nanosec;
3154#endif
3155};
3156
3157/*
3158 * Priority and cos
3159 */
3160struct priority_cos {
3161#if defined(__BIG_ENDIAN)
3162 u16 reserved1;
3163 u8 cos;
3164 u8 priority;
3165#elif defined(__LITTLE_ENDIAN)
3166 u8 priority;
3167 u8 cos;
3168 u16 reserved1;
3169#endif
3170 u32 reserved2;
3171};
3172
3173/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003174 * Per-port congestion management variables
3175 */
3176struct cmng_struct_per_port {
3177 struct rate_shaping_vars_per_port rs_vars;
3178 struct fairness_vars_per_port fair_vars;
3179 struct safc_struct_per_port safc_vars;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003180 struct pfc_struct_per_port pfc_vars;
3181#if defined(__BIG_ENDIAN)
3182 u16 __reserved1;
3183 u8 dcb_enabled;
3184 u8 llfc_mode;
3185#elif defined(__LITTLE_ENDIAN)
3186 u8 llfc_mode;
3187 u8 dcb_enabled;
3188 u16 __reserved1;
3189#endif
3190 struct priority_cos
3191 traffic_type_to_priority_cos[MAX_PFC_TRAFFIC_TYPES];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003192 struct cmng_flags_per_port flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003193};
3194
3195
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003196
3197/*
3198 * Dynamic HC counters set by the driver
3199 */
3200struct hc_dynamic_drv_counter {
3201 u32 val[HC_SB_MAX_DYNAMIC_INDICES];
3202};
3203
3204/*
3205 * zone A per-queue data
3206 */
3207struct cstorm_queue_zone_data {
3208 struct hc_dynamic_drv_counter hc_dyn_drv_cnt;
3209 struct regpair reserved[2];
3210};
3211
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003212/*
Eilon Greensteinca003922009-08-12 22:53:28 -07003213 * Dynamic host coalescing init parameters
3214 */
3215struct dynamic_hc_config {
3216 u32 threshold[3];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003217 u8 shift_per_protocol[HC_SB_MAX_DYNAMIC_INDICES];
3218 u8 hc_timeout0[HC_SB_MAX_DYNAMIC_INDICES];
3219 u8 hc_timeout1[HC_SB_MAX_DYNAMIC_INDICES];
3220 u8 hc_timeout2[HC_SB_MAX_DYNAMIC_INDICES];
3221 u8 hc_timeout3[HC_SB_MAX_DYNAMIC_INDICES];
Eilon Greensteinca003922009-08-12 22:53:28 -07003222};
3223
3224
3225/*
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003226 * Protocol-common statistics collected by the Xstorm (per client)
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003227 */
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003228struct xstorm_per_client_stats {
Eilon Greensteinca003922009-08-12 22:53:28 -07003229 __le32 reserved0;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003230 __le32 unicast_pkts_sent;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003231 struct regpair unicast_bytes_sent;
3232 struct regpair multicast_bytes_sent;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003233 __le32 multicast_pkts_sent;
3234 __le32 broadcast_pkts_sent;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003235 struct regpair broadcast_bytes_sent;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003236 __le16 stats_counter;
Eilon Greensteinca003922009-08-12 22:53:28 -07003237 __le16 reserved1;
3238 __le32 reserved2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003239};
3240
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003241/*
3242 * Common statistics collected by the Xstorm (per port)
3243 */
3244struct xstorm_common_stats {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003245 struct xstorm_per_client_stats client_statistics[MAX_STAT_COUNTER_ID];
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003246};
3247
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003248/*
3249 * Protocol-common statistics collected by the Tstorm (per port)
3250 */
3251struct tstorm_per_port_stats {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003252 __le32 mac_filter_discard;
3253 __le32 xxoverflow_discard;
3254 __le32 brb_truncate_discard;
3255 __le32 mac_discard;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003256};
3257
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003258/*
3259 * Protocol-common statistics collected by the Tstorm (per client)
3260 */
3261struct tstorm_per_client_stats {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003262 struct regpair rcv_unicast_bytes;
3263 struct regpair rcv_broadcast_bytes;
3264 struct regpair rcv_multicast_bytes;
3265 struct regpair rcv_error_bytes;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003266 __le32 checksum_discard;
3267 __le32 packets_too_big_discard;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003268 __le32 rcv_unicast_pkts;
3269 __le32 rcv_broadcast_pkts;
3270 __le32 rcv_multicast_pkts;
3271 __le32 no_buff_discard;
3272 __le32 ttl0_discard;
3273 __le16 stats_counter;
3274 __le16 reserved0;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003275};
3276
3277/*
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003278 * Protocol-common statistics collected by the Tstorm
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003279 */
3280struct tstorm_common_stats {
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07003281 struct tstorm_per_port_stats port_statistics;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003282 struct tstorm_per_client_stats client_statistics[MAX_STAT_COUNTER_ID];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003283};
3284
3285/*
Eilon Greensteinde832a52009-02-12 08:36:33 +00003286 * Protocol-common statistics collected by the Ustorm (per client)
3287 */
3288struct ustorm_per_client_stats {
3289 struct regpair ucast_no_buff_bytes;
3290 struct regpair mcast_no_buff_bytes;
3291 struct regpair bcast_no_buff_bytes;
3292 __le32 ucast_no_buff_pkts;
3293 __le32 mcast_no_buff_pkts;
3294 __le32 bcast_no_buff_pkts;
3295 __le16 stats_counter;
3296 __le16 reserved0;
3297};
3298
3299/*
3300 * Protocol-common statistics collected by the Ustorm
3301 */
3302struct ustorm_common_stats {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003303 struct ustorm_per_client_stats client_statistics[MAX_STAT_COUNTER_ID];
Eilon Greensteinde832a52009-02-12 08:36:33 +00003304};
3305
3306/*
Eilon Greenstein33471622008-08-13 15:59:08 -07003307 * Eth statistics query structure for the eth_stats_query ramrod
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003308 */
3309struct eth_stats_query {
3310 struct xstorm_common_stats xstorm_common;
3311 struct tstorm_common_stats tstorm_common;
Eilon Greensteinde832a52009-02-12 08:36:33 +00003312 struct ustorm_common_stats ustorm_common;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003313};
3314
3315
3316/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003317 * set mac event data
3318 */
3319struct set_mac_event_data {
3320 u16 echo;
3321 u16 reserved0;
3322 u32 reserved1;
3323 u32 reserved2;
3324};
3325
3326/*
3327 * union for all event ring message types
3328 */
3329union event_data {
3330 struct set_mac_event_data set_mac_event;
3331 struct cfc_del_event_data cfc_del_event;
3332};
3333
3334
3335/*
3336 * per PF event ring data
3337 */
3338struct event_ring_data {
3339 struct regpair base_addr;
3340#if defined(__BIG_ENDIAN)
3341 u8 index_id;
3342 u8 sb_id;
3343 u16 producer;
3344#elif defined(__LITTLE_ENDIAN)
3345 u16 producer;
3346 u8 sb_id;
3347 u8 index_id;
3348#endif
3349 u32 reserved0;
3350};
3351
3352
3353/*
3354 * event ring message element (each element is 128 bits)
3355 */
3356struct event_ring_msg {
3357 u8 opcode;
3358 u8 reserved0;
3359 u16 reserved1;
3360 union event_data data;
3361};
3362
3363/*
3364 * event ring next page element (128 bits)
3365 */
3366struct event_ring_next {
3367 struct regpair addr;
3368 u32 reserved[2];
3369};
3370
3371/*
3372 * union for event ring element types (each element is 128 bits)
3373 */
3374union event_ring_elem {
3375 struct event_ring_msg message;
3376 struct event_ring_next next_page;
3377};
3378
3379
3380/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003381 * per-vnic fairness variables
3382 */
3383struct fairness_vars_per_vn {
Eilon Greenstein8a1c38d2009-02-12 08:36:40 +00003384 u32 cos_credit_delta[MAX_COS_NUMBER];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003385 u32 protocol_credit_delta[NUM_OF_PROTOCOLS];
3386 u32 vn_credit_delta;
3387 u32 __reserved0;
3388};
3389
3390
3391/*
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00003392 * The data for flow control configuration
3393 */
3394struct flow_control_configuration {
3395 struct priority_cos
3396 traffic_type_to_priority_cos[MAX_PFC_TRAFFIC_TYPES];
3397#if defined(__BIG_ENDIAN)
3398 u16 reserved1;
3399 u8 dcb_version;
3400 u8 dcb_enabled;
3401#elif defined(__LITTLE_ENDIAN)
3402 u8 dcb_enabled;
3403 u8 dcb_version;
3404 u16 reserved1;
3405#endif
3406 u32 reserved2;
3407};
3408
3409
3410/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003411 * FW version stored in the Xstorm RAM
3412 */
3413struct fw_version {
3414#if defined(__BIG_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003415 u8 engineering;
3416 u8 revision;
3417 u8 minor;
3418 u8 major;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003419#elif defined(__LITTLE_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003420 u8 major;
3421 u8 minor;
3422 u8 revision;
3423 u8 engineering;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003424#endif
3425 u32 flags;
3426#define FW_VERSION_OPTIMIZED (0x1<<0)
3427#define FW_VERSION_OPTIMIZED_SHIFT 0
3428#define FW_VERSION_BIG_ENDIEN (0x1<<1)
3429#define FW_VERSION_BIG_ENDIEN_SHIFT 1
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003430#define FW_VERSION_CHIP_VERSION (0x3<<2)
3431#define FW_VERSION_CHIP_VERSION_SHIFT 2
3432#define __FW_VERSION_RESERVED (0xFFFFFFF<<4)
3433#define __FW_VERSION_RESERVED_SHIFT 4
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003434};
3435
3436
3437/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003438 * Dynamic Host-Coalescing - Driver(host) counters
3439 */
3440struct hc_dynamic_sb_drv_counters {
3441 u32 dynamic_hc_drv_counter[HC_SB_MAX_DYNAMIC_INDICES];
3442};
3443
3444
3445/*
3446 * 2 bytes. configuration/state parameters for a single protocol index
3447 */
3448struct hc_index_data {
3449#if defined(__BIG_ENDIAN)
3450 u8 flags;
3451#define HC_INDEX_DATA_SM_ID (0x1<<0)
3452#define HC_INDEX_DATA_SM_ID_SHIFT 0
3453#define HC_INDEX_DATA_HC_ENABLED (0x1<<1)
3454#define HC_INDEX_DATA_HC_ENABLED_SHIFT 1
3455#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2)
3456#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2
3457#define HC_INDEX_DATA_RESERVE (0x1F<<3)
3458#define HC_INDEX_DATA_RESERVE_SHIFT 3
3459 u8 timeout;
3460#elif defined(__LITTLE_ENDIAN)
3461 u8 timeout;
3462 u8 flags;
3463#define HC_INDEX_DATA_SM_ID (0x1<<0)
3464#define HC_INDEX_DATA_SM_ID_SHIFT 0
3465#define HC_INDEX_DATA_HC_ENABLED (0x1<<1)
3466#define HC_INDEX_DATA_HC_ENABLED_SHIFT 1
3467#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2)
3468#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2
3469#define HC_INDEX_DATA_RESERVE (0x1F<<3)
3470#define HC_INDEX_DATA_RESERVE_SHIFT 3
3471#endif
3472};
3473
3474
3475/*
3476 * HC state-machine
3477 */
3478struct hc_status_block_sm {
3479#if defined(__BIG_ENDIAN)
3480 u8 igu_seg_id;
3481 u8 igu_sb_id;
3482 u8 timer_value;
3483 u8 __flags;
3484#elif defined(__LITTLE_ENDIAN)
3485 u8 __flags;
3486 u8 timer_value;
3487 u8 igu_sb_id;
3488 u8 igu_seg_id;
3489#endif
3490 u32 time_to_expire;
3491};
3492
3493/*
3494 * hold PCI identification variables- used in various places in firmware
3495 */
3496struct pci_entity {
3497#if defined(__BIG_ENDIAN)
3498 u8 vf_valid;
3499 u8 vf_id;
3500 u8 vnic_id;
3501 u8 pf_id;
3502#elif defined(__LITTLE_ENDIAN)
3503 u8 pf_id;
3504 u8 vnic_id;
3505 u8 vf_id;
3506 u8 vf_valid;
3507#endif
3508};
3509
3510/*
3511 * The fast-path status block meta-data, common to all chips
3512 */
3513struct hc_sb_data {
3514 struct regpair host_sb_addr;
3515 struct hc_status_block_sm state_machine[HC_SB_MAX_SM];
3516 struct pci_entity p_func;
3517#if defined(__BIG_ENDIAN)
3518 u8 rsrv0;
3519 u8 dhc_qzone_id;
3520 u8 __dynamic_hc_level;
3521 u8 same_igu_sb_1b;
3522#elif defined(__LITTLE_ENDIAN)
3523 u8 same_igu_sb_1b;
3524 u8 __dynamic_hc_level;
3525 u8 dhc_qzone_id;
3526 u8 rsrv0;
3527#endif
3528 struct regpair rsrv1[2];
3529};
3530
3531
3532/*
3533 * The fast-path status block meta-data
3534 */
3535struct hc_sp_status_block_data {
3536 struct regpair host_sb_addr;
3537#if defined(__BIG_ENDIAN)
3538 u16 rsrv;
3539 u8 igu_seg_id;
3540 u8 igu_sb_id;
3541#elif defined(__LITTLE_ENDIAN)
3542 u8 igu_sb_id;
3543 u8 igu_seg_id;
3544 u16 rsrv;
3545#endif
3546 struct pci_entity p_func;
3547};
3548
3549
3550/*
3551 * The fast-path status block meta-data
3552 */
3553struct hc_status_block_data_e1x {
3554 struct hc_index_data index_data[HC_SB_MAX_INDICES_E1X];
3555 struct hc_sb_data common;
3556};
3557
3558
3559/*
3560 * The fast-path status block meta-data
3561 */
3562struct hc_status_block_data_e2 {
3563 struct hc_index_data index_data[HC_SB_MAX_INDICES_E2];
3564 struct hc_sb_data common;
3565};
3566
3567
3568/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003569 * FW version stored in first line of pram
3570 */
3571struct pram_fw_version {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08003572 u8 major;
3573 u8 minor;
3574 u8 revision;
3575 u8 engineering;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003576 u8 flags;
3577#define PRAM_FW_VERSION_OPTIMIZED (0x1<<0)
3578#define PRAM_FW_VERSION_OPTIMIZED_SHIFT 0
3579#define PRAM_FW_VERSION_STORM_ID (0x3<<1)
3580#define PRAM_FW_VERSION_STORM_ID_SHIFT 1
3581#define PRAM_FW_VERSION_BIG_ENDIEN (0x1<<3)
3582#define PRAM_FW_VERSION_BIG_ENDIEN_SHIFT 3
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003583#define PRAM_FW_VERSION_CHIP_VERSION (0x3<<4)
3584#define PRAM_FW_VERSION_CHIP_VERSION_SHIFT 4
3585#define __PRAM_FW_VERSION_RESERVED0 (0x3<<6)
3586#define __PRAM_FW_VERSION_RESERVED0_SHIFT 6
3587};
3588
3589
3590/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003591 * Ethernet slow path element
3592 */
3593union protocol_common_specific_data {
3594 u8 protocol_data[8];
3595 struct regpair phy_address;
3596 struct regpair mac_config_addr;
3597 struct common_query_ramrod_data query_ramrod_data;
3598};
3599
3600/*
Eilon Greensteinca003922009-08-12 22:53:28 -07003601 * The send queue element
3602 */
3603struct protocol_common_spe {
3604 struct spe_hdr hdr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003605 union protocol_common_specific_data data;
Eilon Greensteinca003922009-08-12 22:53:28 -07003606};
3607
3608
3609/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003610 * a single rate shaping counter. can be used as protocol or vnic counter
3611 */
3612struct rate_shaping_counter {
3613 u32 quota;
3614#if defined(__BIG_ENDIAN)
3615 u16 __reserved0;
3616 u16 rate;
3617#elif defined(__LITTLE_ENDIAN)
3618 u16 rate;
3619 u16 __reserved0;
3620#endif
3621};
3622
3623
3624/*
3625 * per-vnic rate shaping variables
3626 */
3627struct rate_shaping_vars_per_vn {
3628 struct rate_shaping_counter protocol_counters[NUM_OF_PROTOCOLS];
3629 struct rate_shaping_counter vn_counter;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003630};
3631
3632
3633/*
3634 * The send queue element
3635 */
3636struct slow_path_element {
3637 struct spe_hdr hdr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003638 struct regpair protocol_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003639};
3640
3641
3642/*
3643 * eth/toe flags that indicate if to query
3644 */
3645struct stats_indication_flags {
3646 u32 collect_eth;
3647 u32 collect_toe;
3648};
3649
3650
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003651/*
3652 * per-port PFC variables
3653 */
3654struct storm_pfc_struct_per_port {
3655#if defined(__BIG_ENDIAN)
3656 u16 mid_mac_addr;
3657 u16 msb_mac_addr;
3658#elif defined(__LITTLE_ENDIAN)
3659 u16 msb_mac_addr;
3660 u16 mid_mac_addr;
3661#endif
3662#if defined(__BIG_ENDIAN)
3663 u16 pfc_pause_quanta_in_nanosec;
3664 u16 lsb_mac_addr;
3665#elif defined(__LITTLE_ENDIAN)
3666 u16 lsb_mac_addr;
3667 u16 pfc_pause_quanta_in_nanosec;
3668#endif
3669};
3670
3671/*
3672 * Per-port congestion management variables
3673 */
3674struct storm_cmng_struct_per_port {
3675 struct storm_pfc_struct_per_port pfc_vars;
3676};
3677
3678
3679/*
3680 * zone A per-queue data
3681 */
3682struct tstorm_queue_zone_data {
3683 struct regpair reserved[4];
3684};
3685
3686
3687/*
3688 * zone B per-VF data
3689 */
3690struct tstorm_vf_zone_data {
3691 struct regpair reserved;
3692};
3693
3694
3695/*
3696 * zone A per-queue data
3697 */
3698struct ustorm_queue_zone_data {
3699 struct ustorm_eth_rx_producers eth_rx_producers;
3700 struct regpair reserved[3];
3701};
3702
3703
3704/*
3705 * zone B per-VF data
3706 */
3707struct ustorm_vf_zone_data {
3708 struct regpair reserved;
3709};
3710
3711
3712/*
3713 * data per VF-PF channel
3714 */
3715struct vf_pf_channel_data {
3716#if defined(__BIG_ENDIAN)
3717 u16 reserved0;
3718 u8 valid;
3719 u8 state;
3720#elif defined(__LITTLE_ENDIAN)
3721 u8 state;
3722 u8 valid;
3723 u16 reserved0;
3724#endif
3725 u32 reserved1;
3726};
3727
3728
3729/*
3730 * zone A per-queue data
3731 */
3732struct xstorm_queue_zone_data {
3733 struct regpair reserved[4];
3734};
3735
3736
3737/*
3738 * zone B per-VF data
3739 */
3740struct xstorm_vf_zone_data {
3741 struct regpair reserved;
3742};
3743
3744#endif /* BNX2X_HSI_H */