1 /* bnx2x_hsi.h: Broadcom Everest network driver.
3 * Copyright (c) 2007-2009 Broadcom Corporation
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.
15 /****************************************************************************
16 * Shared HW configuration *
17 ****************************************************************************/
18 struct shared_hw_cfg
{ /* NVRAM Offset */
19 /* Up to 16 bytes of NULL-terminated string */
20 u8 part_num
[16]; /* 0x104 */
22 u32 config
; /* 0x114 */
23 #define SHARED_HW_CFG_MDIO_VOLTAGE_MASK 0x00000001
24 #define SHARED_HW_CFG_MDIO_VOLTAGE_SHIFT 0
25 #define SHARED_HW_CFG_MDIO_VOLTAGE_1_2V 0x00000000
26 #define SHARED_HW_CFG_MDIO_VOLTAGE_2_5V 0x00000001
27 #define SHARED_HW_CFG_MCP_RST_ON_CORE_RST_EN 0x00000002
29 #define SHARED_HW_CFG_PORT_SWAP 0x00000004
31 #define SHARED_HW_CFG_BEACON_WOL_EN 0x00000008
33 #define SHARED_HW_CFG_MFW_SELECT_MASK 0x00000700
34 #define SHARED_HW_CFG_MFW_SELECT_SHIFT 8
35 /* Whatever MFW found in NVM
36 (if multiple found, priority order is: NC-SI, UMP, IPMI) */
37 #define SHARED_HW_CFG_MFW_SELECT_DEFAULT 0x00000000
38 #define SHARED_HW_CFG_MFW_SELECT_NC_SI 0x00000100
39 #define SHARED_HW_CFG_MFW_SELECT_UMP 0x00000200
40 #define SHARED_HW_CFG_MFW_SELECT_IPMI 0x00000300
41 /* Use SPIO4 as an arbiter between: 0-NC_SI, 1-IPMI
42 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
43 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_IPMI 0x00000400
44 /* Use SPIO4 as an arbiter between: 0-UMP, 1-IPMI
45 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
46 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_UMP_IPMI 0x00000500
47 /* Use SPIO4 as an arbiter between: 0-NC-SI, 1-UMP
48 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
49 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_UMP 0x00000600
51 #define SHARED_HW_CFG_LED_MODE_MASK 0x000f0000
52 #define SHARED_HW_CFG_LED_MODE_SHIFT 16
53 #define SHARED_HW_CFG_LED_MAC1 0x00000000
54 #define SHARED_HW_CFG_LED_PHY1 0x00010000
55 #define SHARED_HW_CFG_LED_PHY2 0x00020000
56 #define SHARED_HW_CFG_LED_PHY3 0x00030000
57 #define SHARED_HW_CFG_LED_MAC2 0x00040000
58 #define SHARED_HW_CFG_LED_PHY4 0x00050000
59 #define SHARED_HW_CFG_LED_PHY5 0x00060000
60 #define SHARED_HW_CFG_LED_PHY6 0x00070000
61 #define SHARED_HW_CFG_LED_MAC3 0x00080000
62 #define SHARED_HW_CFG_LED_PHY7 0x00090000
63 #define SHARED_HW_CFG_LED_PHY9 0x000a0000
64 #define SHARED_HW_CFG_LED_PHY11 0x000b0000
65 #define SHARED_HW_CFG_LED_MAC4 0x000c0000
66 #define SHARED_HW_CFG_LED_PHY8 0x000d0000
68 #define SHARED_HW_CFG_AN_ENABLE_MASK 0x3f000000
69 #define SHARED_HW_CFG_AN_ENABLE_SHIFT 24
70 #define SHARED_HW_CFG_AN_ENABLE_CL37 0x01000000
71 #define SHARED_HW_CFG_AN_ENABLE_CL73 0x02000000
72 #define SHARED_HW_CFG_AN_ENABLE_BAM 0x04000000
73 #define SHARED_HW_CFG_AN_ENABLE_PARALLEL_DETECTION 0x08000000
74 #define SHARED_HW_CFG_AN_EN_SGMII_FIBER_AUTO_DETECT 0x10000000
75 #define SHARED_HW_CFG_AN_ENABLE_REMOTE_PHY 0x20000000
77 u32 config2
; /* 0x118 */
78 /* one time auto detect grace period (in sec) */
79 #define SHARED_HW_CFG_GRACE_PERIOD_MASK 0x000000ff
80 #define SHARED_HW_CFG_GRACE_PERIOD_SHIFT 0
82 #define SHARED_HW_CFG_PCIE_GEN2_ENABLED 0x00000100
84 /* The default value for the core clock is 250MHz and it is
85 achieved by setting the clock change to 4 */
86 #define SHARED_HW_CFG_CLOCK_CHANGE_MASK 0x00000e00
87 #define SHARED_HW_CFG_CLOCK_CHANGE_SHIFT 9
89 #define SHARED_HW_CFG_SMBUS_TIMING_100KHZ 0x00000000
90 #define SHARED_HW_CFG_SMBUS_TIMING_400KHZ 0x00001000
92 #define SHARED_HW_CFG_HIDE_PORT1 0x00002000
94 /* The fan failure mechanism is usually related to the PHY type
95 since the power consumption of the board is determined by the PHY.
96 Currently, fan is required for most designs with SFX7101, BCM8727
97 and BCM8481. If a fan is not required for a board which uses one
98 of those PHYs, this field should be set to "Disabled". If a fan is
99 required for a different PHY type, this option should be set to
101 The fan failure indication is expected on
103 #define SHARED_HW_CFG_FAN_FAILURE_MASK 0x00180000
104 #define SHARED_HW_CFG_FAN_FAILURE_SHIFT 19
105 #define SHARED_HW_CFG_FAN_FAILURE_PHY_TYPE 0x00000000
106 #define SHARED_HW_CFG_FAN_FAILURE_DISABLED 0x00080000
107 #define SHARED_HW_CFG_FAN_FAILURE_ENABLED 0x00100000
109 u32 power_dissipated
; /* 0x11c */
110 #define SHARED_HW_CFG_POWER_DIS_CMN_MASK 0xff000000
111 #define SHARED_HW_CFG_POWER_DIS_CMN_SHIFT 24
113 #define SHARED_HW_CFG_POWER_MGNT_SCALE_MASK 0x00ff0000
114 #define SHARED_HW_CFG_POWER_MGNT_SCALE_SHIFT 16
115 #define SHARED_HW_CFG_POWER_MGNT_UNKNOWN_SCALE 0x00000000
116 #define SHARED_HW_CFG_POWER_MGNT_DOT_1_WATT 0x00010000
117 #define SHARED_HW_CFG_POWER_MGNT_DOT_01_WATT 0x00020000
118 #define SHARED_HW_CFG_POWER_MGNT_DOT_001_WATT 0x00030000
120 u32 ump_nc_si_config
; /* 0x120 */
121 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MASK 0x00000003
122 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_SHIFT 0
123 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MAC 0x00000000
124 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_PHY 0x00000001
125 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MII 0x00000000
126 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_RMII 0x00000002
128 #define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_MASK 0x00000f00
129 #define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_SHIFT 8
131 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_MASK 0x00ff0000
132 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_SHIFT 16
133 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_NONE 0x00000000
134 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_BCM5221 0x00010000
136 u32 board
; /* 0x124 */
137 #define SHARED_HW_CFG_BOARD_REV_MASK 0x00FF0000
138 #define SHARED_HW_CFG_BOARD_REV_SHIFT 16
140 #define SHARED_HW_CFG_BOARD_MAJOR_VER_MASK 0x0F000000
141 #define SHARED_HW_CFG_BOARD_MAJOR_VER_SHIFT 24
143 #define SHARED_HW_CFG_BOARD_MINOR_VER_MASK 0xF0000000
144 #define SHARED_HW_CFG_BOARD_MINOR_VER_SHIFT 28
146 u32 reserved
; /* 0x128 */
151 /****************************************************************************
152 * Port HW configuration *
153 ****************************************************************************/
154 struct port_hw_cfg
{ /* port 0: 0x12c port 1: 0x2bc */
157 #define PORT_HW_CFG_PCI_VENDOR_ID_MASK 0xffff0000
158 #define PORT_HW_CFG_PCI_DEVICE_ID_MASK 0x0000ffff
161 #define PORT_HW_CFG_PCI_SUBSYS_DEVICE_ID_MASK 0xffff0000
162 #define PORT_HW_CFG_PCI_SUBSYS_VENDOR_ID_MASK 0x0000ffff
164 u32 power_dissipated
;
165 #define PORT_HW_CFG_POWER_DIS_D3_MASK 0xff000000
166 #define PORT_HW_CFG_POWER_DIS_D3_SHIFT 24
167 #define PORT_HW_CFG_POWER_DIS_D2_MASK 0x00ff0000
168 #define PORT_HW_CFG_POWER_DIS_D2_SHIFT 16
169 #define PORT_HW_CFG_POWER_DIS_D1_MASK 0x0000ff00
170 #define PORT_HW_CFG_POWER_DIS_D1_SHIFT 8
171 #define PORT_HW_CFG_POWER_DIS_D0_MASK 0x000000ff
172 #define PORT_HW_CFG_POWER_DIS_D0_SHIFT 0
175 #define PORT_HW_CFG_POWER_CONS_D3_MASK 0xff000000
176 #define PORT_HW_CFG_POWER_CONS_D3_SHIFT 24
177 #define PORT_HW_CFG_POWER_CONS_D2_MASK 0x00ff0000
178 #define PORT_HW_CFG_POWER_CONS_D2_SHIFT 16
179 #define PORT_HW_CFG_POWER_CONS_D1_MASK 0x0000ff00
180 #define PORT_HW_CFG_POWER_CONS_D1_SHIFT 8
181 #define PORT_HW_CFG_POWER_CONS_D0_MASK 0x000000ff
182 #define PORT_HW_CFG_POWER_CONS_D0_SHIFT 0
185 #define PORT_HW_CFG_UPPERMAC_MASK 0x0000ffff
186 #define PORT_HW_CFG_UPPERMAC_SHIFT 0
189 u32 iscsi_mac_upper
; /* Upper 16 bits are always zeroes */
192 u32 rdma_mac_upper
; /* Upper 16 bits are always zeroes */
196 #define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_MASK 0x0000FFFF
197 #define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_SHIFT 0
199 #define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_MASK 0xFFFF0000
200 #define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_SHIFT 16
203 u32 Reserved0
[16]; /* 0x158 */
205 /* for external PHY, or forced mode or during AN */
206 u16 xgxs_config_rx
[4]; /* 0x198 */
208 u16 xgxs_config_tx
[4]; /* 0x1A0 */
210 u32 Reserved1
[64]; /* 0x1A8 */
213 #define PORT_HW_CFG_LANE_SWAP_CFG_MASK 0x0000ffff
214 #define PORT_HW_CFG_LANE_SWAP_CFG_SHIFT 0
215 #define PORT_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000ff
216 #define PORT_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0
217 #define PORT_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000ff00
218 #define PORT_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8
219 #define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_MASK 0x0000c000
220 #define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_SHIFT 14
222 #define PORT_HW_CFG_LANE_SWAP_CFG_01230123 0x00001b1b
224 #define PORT_HW_CFG_LANE_SWAP_CFG_01233210 0x00001be4
226 #define PORT_HW_CFG_LANE_SWAP_CFG_31203120 0x0000d8d8
228 #define PORT_HW_CFG_LANE_SWAP_CFG_32103210 0x0000e4e4
230 u32 external_phy_config
;
231 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK 0xff000000
232 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_SHIFT 24
233 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT 0x00000000
234 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_BCM5482 0x01000000
235 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_NOT_CONN 0xff000000
237 #define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_MASK 0x00ff0000
238 #define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_SHIFT 16
240 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK 0x0000ff00
241 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SHIFT 8
242 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT 0x00000000
243 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8071 0x00000100
244 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072 0x00000200
245 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073 0x00000300
246 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705 0x00000400
247 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706 0x00000500
248 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726 0x00000600
249 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481 0x00000700
250 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101 0x00000800
251 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727 0x00000900
252 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727_NOC 0x00000a00
253 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00
254 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00
256 #define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK 0x000000ff
257 #define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT 0
259 u32 speed_capability_mask
;
260 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK 0xffff0000
261 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_SHIFT 16
262 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL 0x00010000
263 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF 0x00020000
264 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF 0x00040000
265 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL 0x00080000
266 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_1G 0x00100000
267 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G 0x00200000
268 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10G 0x00400000
269 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_12G 0x00800000
270 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_12_5G 0x01000000
271 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_13G 0x02000000
272 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_15G 0x04000000
273 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_16G 0x08000000
274 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_RESERVED 0xf0000000
276 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_MASK 0x0000ffff
277 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_SHIFT 0
278 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_FULL 0x00000001
279 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_HALF 0x00000002
280 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_HALF 0x00000004
281 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_FULL 0x00000008
282 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_1G 0x00000010
283 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_2_5G 0x00000020
284 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10G 0x00000040
285 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_12G 0x00000080
286 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_12_5G 0x00000100
287 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_13G 0x00000200
288 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_15G 0x00000400
289 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_16G 0x00000800
290 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_RESERVED 0x0000f000
297 /****************************************************************************
298 * Shared Feature configuration *
299 ****************************************************************************/
300 struct shared_feat_cfg
{ /* NVRAM Offset */
302 u32 config
; /* 0x450 */
303 #define SHARED_FEATURE_BMC_ECHO_MODE_EN 0x00000001
305 /* Use the values from options 47 and 48 instead of the HW default
307 #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_DISABLED 0x00000000
308 #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_ENABLED 0x00000002
310 #define SHARED_FEATURE_MF_MODE_DISABLED 0x00000100
315 /****************************************************************************
316 * Port Feature configuration *
317 ****************************************************************************/
318 struct port_feat_cfg
{ /* port 0: 0x454 port 1: 0x4c8 */
321 #define PORT_FEATURE_BAR1_SIZE_MASK 0x0000000f
322 #define PORT_FEATURE_BAR1_SIZE_SHIFT 0
323 #define PORT_FEATURE_BAR1_SIZE_DISABLED 0x00000000
324 #define PORT_FEATURE_BAR1_SIZE_64K 0x00000001
325 #define PORT_FEATURE_BAR1_SIZE_128K 0x00000002
326 #define PORT_FEATURE_BAR1_SIZE_256K 0x00000003
327 #define PORT_FEATURE_BAR1_SIZE_512K 0x00000004
328 #define PORT_FEATURE_BAR1_SIZE_1M 0x00000005
329 #define PORT_FEATURE_BAR1_SIZE_2M 0x00000006
330 #define PORT_FEATURE_BAR1_SIZE_4M 0x00000007
331 #define PORT_FEATURE_BAR1_SIZE_8M 0x00000008
332 #define PORT_FEATURE_BAR1_SIZE_16M 0x00000009
333 #define PORT_FEATURE_BAR1_SIZE_32M 0x0000000a
334 #define PORT_FEATURE_BAR1_SIZE_64M 0x0000000b
335 #define PORT_FEATURE_BAR1_SIZE_128M 0x0000000c
336 #define PORT_FEATURE_BAR1_SIZE_256M 0x0000000d
337 #define PORT_FEATURE_BAR1_SIZE_512M 0x0000000e
338 #define PORT_FEATURE_BAR1_SIZE_1G 0x0000000f
339 #define PORT_FEATURE_BAR2_SIZE_MASK 0x000000f0
340 #define PORT_FEATURE_BAR2_SIZE_SHIFT 4
341 #define PORT_FEATURE_BAR2_SIZE_DISABLED 0x00000000
342 #define PORT_FEATURE_BAR2_SIZE_64K 0x00000010
343 #define PORT_FEATURE_BAR2_SIZE_128K 0x00000020
344 #define PORT_FEATURE_BAR2_SIZE_256K 0x00000030
345 #define PORT_FEATURE_BAR2_SIZE_512K 0x00000040
346 #define PORT_FEATURE_BAR2_SIZE_1M 0x00000050
347 #define PORT_FEATURE_BAR2_SIZE_2M 0x00000060
348 #define PORT_FEATURE_BAR2_SIZE_4M 0x00000070
349 #define PORT_FEATURE_BAR2_SIZE_8M 0x00000080
350 #define PORT_FEATURE_BAR2_SIZE_16M 0x00000090
351 #define PORT_FEATURE_BAR2_SIZE_32M 0x000000a0
352 #define PORT_FEATURE_BAR2_SIZE_64M 0x000000b0
353 #define PORT_FEATURE_BAR2_SIZE_128M 0x000000c0
354 #define PORT_FEATURE_BAR2_SIZE_256M 0x000000d0
355 #define PORT_FEATURE_BAR2_SIZE_512M 0x000000e0
356 #define PORT_FEATURE_BAR2_SIZE_1G 0x000000f0
357 #define PORT_FEATURE_EN_SIZE_MASK 0x07000000
358 #define PORT_FEATURE_EN_SIZE_SHIFT 24
359 #define PORT_FEATURE_WOL_ENABLED 0x01000000
360 #define PORT_FEATURE_MBA_ENABLED 0x02000000
361 #define PORT_FEATURE_MFW_ENABLED 0x04000000
363 /* Reserved bits: 28-29 */
364 /* Check the optic vendor via i2c against a list of approved modules
365 in a separate nvram image */
366 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK 0xE0000000
367 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_SHIFT 29
368 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_NO_ENFORCEMENT 0x00000000
369 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER 0x20000000
370 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_WARNING_MSG 0x40000000
371 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_POWER_DOWN 0x60000000
375 /* Default is used when driver sets to "auto" mode */
376 #define PORT_FEATURE_WOL_DEFAULT_MASK 0x00000003
377 #define PORT_FEATURE_WOL_DEFAULT_SHIFT 0
378 #define PORT_FEATURE_WOL_DEFAULT_DISABLE 0x00000000
379 #define PORT_FEATURE_WOL_DEFAULT_MAGIC 0x00000001
380 #define PORT_FEATURE_WOL_DEFAULT_ACPI 0x00000002
381 #define PORT_FEATURE_WOL_DEFAULT_MAGIC_AND_ACPI 0x00000003
382 #define PORT_FEATURE_WOL_RES_PAUSE_CAP 0x00000004
383 #define PORT_FEATURE_WOL_RES_ASYM_PAUSE_CAP 0x00000008
384 #define PORT_FEATURE_WOL_ACPI_UPON_MGMT 0x00000010
387 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_MASK 0x00000003
388 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_SHIFT 0
389 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_PXE 0x00000000
390 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_RPL 0x00000001
391 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_BOOTP 0x00000002
392 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_ISCSIB 0x00000003
393 #define PORT_FEATURE_MBA_RES_PAUSE_CAP 0x00000100
394 #define PORT_FEATURE_MBA_RES_ASYM_PAUSE_CAP 0x00000200
395 #define PORT_FEATURE_MBA_SETUP_PROMPT_ENABLE 0x00000400
396 #define PORT_FEATURE_MBA_HOTKEY_CTRL_S 0x00000000
397 #define PORT_FEATURE_MBA_HOTKEY_CTRL_B 0x00000800
398 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_MASK 0x000ff000
399 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_SHIFT 12
400 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_DISABLED 0x00000000
401 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_2K 0x00001000
402 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_4K 0x00002000
403 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_8K 0x00003000
404 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_16K 0x00004000
405 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_32K 0x00005000
406 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_64K 0x00006000
407 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_128K 0x00007000
408 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_256K 0x00008000
409 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_512K 0x00009000
410 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_1M 0x0000a000
411 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_2M 0x0000b000
412 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_4M 0x0000c000
413 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_8M 0x0000d000
414 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_16M 0x0000e000
415 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_32M 0x0000f000
416 #define PORT_FEATURE_MBA_MSG_TIMEOUT_MASK 0x00f00000
417 #define PORT_FEATURE_MBA_MSG_TIMEOUT_SHIFT 20
418 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_MASK 0x03000000
419 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_SHIFT 24
420 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_AUTO 0x00000000
421 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_BBS 0x01000000
422 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT18H 0x02000000
423 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT19H 0x03000000
424 #define PORT_FEATURE_MBA_LINK_SPEED_MASK 0x3c000000
425 #define PORT_FEATURE_MBA_LINK_SPEED_SHIFT 26
426 #define PORT_FEATURE_MBA_LINK_SPEED_AUTO 0x00000000
427 #define PORT_FEATURE_MBA_LINK_SPEED_10HD 0x04000000
428 #define PORT_FEATURE_MBA_LINK_SPEED_10FD 0x08000000
429 #define PORT_FEATURE_MBA_LINK_SPEED_100HD 0x0c000000
430 #define PORT_FEATURE_MBA_LINK_SPEED_100FD 0x10000000
431 #define PORT_FEATURE_MBA_LINK_SPEED_1GBPS 0x14000000
432 #define PORT_FEATURE_MBA_LINK_SPEED_2_5GBPS 0x18000000
433 #define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_CX4 0x1c000000
434 #define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_KX4 0x20000000
435 #define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_KR 0x24000000
436 #define PORT_FEATURE_MBA_LINK_SPEED_12GBPS 0x28000000
437 #define PORT_FEATURE_MBA_LINK_SPEED_12_5GBPS 0x2c000000
438 #define PORT_FEATURE_MBA_LINK_SPEED_13GBPS 0x30000000
439 #define PORT_FEATURE_MBA_LINK_SPEED_15GBPS 0x34000000
440 #define PORT_FEATURE_MBA_LINK_SPEED_16GBPS 0x38000000
443 #define PORT_FEATURE_BMC_LINK_OVERRIDE_DEFAULT 0x00000000
444 #define PORT_FEATURE_BMC_LINK_OVERRIDE_EN 0x00000001
447 #define PORT_FEATURE_MBA_VLAN_TAG_MASK 0x0000ffff
448 #define PORT_FEATURE_MBA_VLAN_TAG_SHIFT 0
449 #define PORT_FEATURE_MBA_VLAN_EN 0x00010000
452 #define PORT_FEATURE_RESOURCE_CFG_VALID 0x00000001
453 #define PORT_FEATURE_RESOURCE_CFG_DIAG 0x00000002
454 #define PORT_FEATURE_RESOURCE_CFG_L2 0x00000004
455 #define PORT_FEATURE_RESOURCE_CFG_ISCSI 0x00000008
456 #define PORT_FEATURE_RESOURCE_CFG_RDMA 0x00000010
460 #define PORT_FEATURE_SMBUS_EN 0x00000001
461 #define PORT_FEATURE_SMBUS_ADDR_MASK 0x000000fe
462 #define PORT_FEATURE_SMBUS_ADDR_SHIFT 1
466 u32 link_config
; /* Used as HW defaults for the driver */
467 #define PORT_FEATURE_CONNECTED_SWITCH_MASK 0x03000000
468 #define PORT_FEATURE_CONNECTED_SWITCH_SHIFT 24
469 /* (forced) low speed switch (< 10G) */
470 #define PORT_FEATURE_CON_SWITCH_1G_SWITCH 0x00000000
471 /* (forced) high speed switch (>= 10G) */
472 #define PORT_FEATURE_CON_SWITCH_10G_SWITCH 0x01000000
473 #define PORT_FEATURE_CON_SWITCH_AUTO_DETECT 0x02000000
474 #define PORT_FEATURE_CON_SWITCH_ONE_TIME_DETECT 0x03000000
476 #define PORT_FEATURE_LINK_SPEED_MASK 0x000f0000
477 #define PORT_FEATURE_LINK_SPEED_SHIFT 16
478 #define PORT_FEATURE_LINK_SPEED_AUTO 0x00000000
479 #define PORT_FEATURE_LINK_SPEED_10M_FULL 0x00010000
480 #define PORT_FEATURE_LINK_SPEED_10M_HALF 0x00020000
481 #define PORT_FEATURE_LINK_SPEED_100M_HALF 0x00030000
482 #define PORT_FEATURE_LINK_SPEED_100M_FULL 0x00040000
483 #define PORT_FEATURE_LINK_SPEED_1G 0x00050000
484 #define PORT_FEATURE_LINK_SPEED_2_5G 0x00060000
485 #define PORT_FEATURE_LINK_SPEED_10G_CX4 0x00070000
486 #define PORT_FEATURE_LINK_SPEED_10G_KX4 0x00080000
487 #define PORT_FEATURE_LINK_SPEED_10G_KR 0x00090000
488 #define PORT_FEATURE_LINK_SPEED_12G 0x000a0000
489 #define PORT_FEATURE_LINK_SPEED_12_5G 0x000b0000
490 #define PORT_FEATURE_LINK_SPEED_13G 0x000c0000
491 #define PORT_FEATURE_LINK_SPEED_15G 0x000d0000
492 #define PORT_FEATURE_LINK_SPEED_16G 0x000e0000
494 #define PORT_FEATURE_FLOW_CONTROL_MASK 0x00000700
495 #define PORT_FEATURE_FLOW_CONTROL_SHIFT 8
496 #define PORT_FEATURE_FLOW_CONTROL_AUTO 0x00000000
497 #define PORT_FEATURE_FLOW_CONTROL_TX 0x00000100
498 #define PORT_FEATURE_FLOW_CONTROL_RX 0x00000200
499 #define PORT_FEATURE_FLOW_CONTROL_BOTH 0x00000300
500 #define PORT_FEATURE_FLOW_CONTROL_NONE 0x00000400
502 /* The default for MCP link configuration,
503 uses the same defines as link_config */
504 u32 mfw_wol_link_cfg
;
511 /****************************************************************************
512 * Device Information *
513 ****************************************************************************/
514 struct shm_dev_info
{ /* size */
516 u32 bc_rev
; /* 8 bits each: major, minor, build */ /* 4 */
518 struct shared_hw_cfg shared_hw_config
; /* 40 */
520 struct port_hw_cfg port_hw_config
[PORT_MAX
]; /* 400*2=800 */
522 struct shared_feat_cfg shared_feature_config
; /* 4 */
524 struct port_feat_cfg port_feature_config
[PORT_MAX
];/* 116*2=232 */
537 #define E1_FUNC_MAX 2
538 #define E1H_FUNC_MAX 8
548 /* This value (in milliseconds) determines the frequency of the driver
549 * issuing the PULSE message code. The firmware monitors this periodic
550 * pulse to determine when to switch to an OS-absent mode. */
551 #define DRV_PULSE_PERIOD_MS 250
553 /* This value (in milliseconds) determines how long the driver should
554 * wait for an acknowledgement from the firmware before timing out. Once
555 * the firmware has timed out, the driver will assume there is no firmware
556 * running and there won't be any firmware-driver synchronization during a
558 #define FW_ACK_TIME_OUT_MS 5000
560 #define FW_ACK_POLL_TIME_MS 1
562 #define FW_ACK_NUM_OF_POLL (FW_ACK_TIME_OUT_MS/FW_ACK_POLL_TIME_MS)
564 /* LED Blink rate that will achieve ~15.9Hz */
565 #define LED_BLINK_RATE_VAL 480
567 /****************************************************************************
568 * Driver <-> FW Mailbox *
569 ****************************************************************************/
573 /* Driver should update this field on any link change event */
575 #define LINK_STATUS_LINK_FLAG_MASK 0x00000001
576 #define LINK_STATUS_LINK_UP 0x00000001
577 #define LINK_STATUS_SPEED_AND_DUPLEX_MASK 0x0000001E
578 #define LINK_STATUS_SPEED_AND_DUPLEX_AN_NOT_COMPLETE (0<<1)
579 #define LINK_STATUS_SPEED_AND_DUPLEX_10THD (1<<1)
580 #define LINK_STATUS_SPEED_AND_DUPLEX_10TFD (2<<1)
581 #define LINK_STATUS_SPEED_AND_DUPLEX_100TXHD (3<<1)
582 #define LINK_STATUS_SPEED_AND_DUPLEX_100T4 (4<<1)
583 #define LINK_STATUS_SPEED_AND_DUPLEX_100TXFD (5<<1)
584 #define LINK_STATUS_SPEED_AND_DUPLEX_1000THD (6<<1)
585 #define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD (7<<1)
586 #define LINK_STATUS_SPEED_AND_DUPLEX_1000XFD (7<<1)
587 #define LINK_STATUS_SPEED_AND_DUPLEX_2500THD (8<<1)
588 #define LINK_STATUS_SPEED_AND_DUPLEX_2500TFD (9<<1)
589 #define LINK_STATUS_SPEED_AND_DUPLEX_2500XFD (9<<1)
590 #define LINK_STATUS_SPEED_AND_DUPLEX_10GTFD (10<<1)
591 #define LINK_STATUS_SPEED_AND_DUPLEX_10GXFD (10<<1)
592 #define LINK_STATUS_SPEED_AND_DUPLEX_12GTFD (11<<1)
593 #define LINK_STATUS_SPEED_AND_DUPLEX_12GXFD (11<<1)
594 #define LINK_STATUS_SPEED_AND_DUPLEX_12_5GTFD (12<<1)
595 #define LINK_STATUS_SPEED_AND_DUPLEX_12_5GXFD (12<<1)
596 #define LINK_STATUS_SPEED_AND_DUPLEX_13GTFD (13<<1)
597 #define LINK_STATUS_SPEED_AND_DUPLEX_13GXFD (13<<1)
598 #define LINK_STATUS_SPEED_AND_DUPLEX_15GTFD (14<<1)
599 #define LINK_STATUS_SPEED_AND_DUPLEX_15GXFD (14<<1)
600 #define LINK_STATUS_SPEED_AND_DUPLEX_16GTFD (15<<1)
601 #define LINK_STATUS_SPEED_AND_DUPLEX_16GXFD (15<<1)
603 #define LINK_STATUS_AUTO_NEGOTIATE_FLAG_MASK 0x00000020
604 #define LINK_STATUS_AUTO_NEGOTIATE_ENABLED 0x00000020
606 #define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE 0x00000040
607 #define LINK_STATUS_PARALLEL_DETECTION_FLAG_MASK 0x00000080
608 #define LINK_STATUS_PARALLEL_DETECTION_USED 0x00000080
610 #define LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE 0x00000200
611 #define LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE 0x00000400
612 #define LINK_STATUS_LINK_PARTNER_100T4_CAPABLE 0x00000800
613 #define LINK_STATUS_LINK_PARTNER_100TXFD_CAPABLE 0x00001000
614 #define LINK_STATUS_LINK_PARTNER_100TXHD_CAPABLE 0x00002000
615 #define LINK_STATUS_LINK_PARTNER_10TFD_CAPABLE 0x00004000
616 #define LINK_STATUS_LINK_PARTNER_10THD_CAPABLE 0x00008000
618 #define LINK_STATUS_TX_FLOW_CONTROL_FLAG_MASK 0x00010000
619 #define LINK_STATUS_TX_FLOW_CONTROL_ENABLED 0x00010000
621 #define LINK_STATUS_RX_FLOW_CONTROL_FLAG_MASK 0x00020000
622 #define LINK_STATUS_RX_FLOW_CONTROL_ENABLED 0x00020000
624 #define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK 0x000C0000
625 #define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE (0<<18)
626 #define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE (1<<18)
627 #define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE (2<<18)
628 #define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE (3<<18)
630 #define LINK_STATUS_SERDES_LINK 0x00100000
632 #define LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE 0x00200000
633 #define LINK_STATUS_LINK_PARTNER_2500XHD_CAPABLE 0x00400000
634 #define LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE 0x00800000
635 #define LINK_STATUS_LINK_PARTNER_12GXFD_CAPABLE 0x01000000
636 #define LINK_STATUS_LINK_PARTNER_12_5GXFD_CAPABLE 0x02000000
637 #define LINK_STATUS_LINK_PARTNER_13GXFD_CAPABLE 0x04000000
638 #define LINK_STATUS_LINK_PARTNER_15GXFD_CAPABLE 0x08000000
639 #define LINK_STATUS_LINK_PARTNER_16GXFD_CAPABLE 0x10000000
645 /* MCP firmware does not use this field */
646 u32 ext_phy_fw_version
;
654 #define DRV_MSG_CODE_MASK 0xffff0000
655 #define DRV_MSG_CODE_LOAD_REQ 0x10000000
656 #define DRV_MSG_CODE_LOAD_DONE 0x11000000
657 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_EN 0x20000000
658 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS 0x20010000
659 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP 0x20020000
660 #define DRV_MSG_CODE_UNLOAD_DONE 0x21000000
661 #define DRV_MSG_CODE_DIAG_ENTER_REQ 0x50000000
662 #define DRV_MSG_CODE_DIAG_EXIT_REQ 0x60000000
663 #define DRV_MSG_CODE_VALIDATE_KEY 0x70000000
664 #define DRV_MSG_CODE_GET_CURR_KEY 0x80000000
665 #define DRV_MSG_CODE_GET_UPGRADE_KEY 0x81000000
666 #define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000
667 #define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000
669 * The optic module verification commands requris bootcode
672 #define DRV_MSG_CODE_VRFY_OPT_MDL 0xa0000000
673 #define REQ_BC_VER_4_VRFY_OPT_MDL 0x00050006
675 #define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000
676 #define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000
677 #define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000
678 #define BIOS_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
680 #define DRV_MSG_SEQ_NUMBER_MASK 0x0000ffff
685 #define FW_MSG_CODE_MASK 0xffff0000
686 #define FW_MSG_CODE_DRV_LOAD_COMMON 0x10100000
687 #define FW_MSG_CODE_DRV_LOAD_PORT 0x10110000
688 #define FW_MSG_CODE_DRV_LOAD_FUNCTION 0x10120000
689 #define FW_MSG_CODE_DRV_LOAD_REFUSED 0x10200000
690 #define FW_MSG_CODE_DRV_LOAD_DONE 0x11100000
691 #define FW_MSG_CODE_DRV_UNLOAD_COMMON 0x20100000
692 #define FW_MSG_CODE_DRV_UNLOAD_PORT 0x20110000
693 #define FW_MSG_CODE_DRV_UNLOAD_FUNCTION 0x20120000
694 #define FW_MSG_CODE_DRV_UNLOAD_DONE 0x21100000
695 #define FW_MSG_CODE_DIAG_ENTER_DONE 0x50100000
696 #define FW_MSG_CODE_DIAG_REFUSE 0x50200000
697 #define FW_MSG_CODE_DIAG_EXIT_DONE 0x60100000
698 #define FW_MSG_CODE_VALIDATE_KEY_SUCCESS 0x70100000
699 #define FW_MSG_CODE_VALIDATE_KEY_FAILURE 0x70200000
700 #define FW_MSG_CODE_GET_KEY_DONE 0x80100000
701 #define FW_MSG_CODE_NO_KEY 0x80f00000
702 #define FW_MSG_CODE_LIC_INFO_NOT_READY 0x80f80000
703 #define FW_MSG_CODE_L2B_PRAM_LOADED 0x90100000
704 #define FW_MSG_CODE_L2B_PRAM_T_LOAD_FAILURE 0x90210000
705 #define FW_MSG_CODE_L2B_PRAM_C_LOAD_FAILURE 0x90220000
706 #define FW_MSG_CODE_L2B_PRAM_X_LOAD_FAILURE 0x90230000
707 #define FW_MSG_CODE_L2B_PRAM_U_LOAD_FAILURE 0x90240000
708 #define FW_MSG_CODE_VRFY_OPT_MDL_SUCCESS 0xa0100000
709 #define FW_MSG_CODE_VRFY_OPT_MDL_INVLD_IMG 0xa0200000
710 #define FW_MSG_CODE_VRFY_OPT_MDL_UNAPPROVED 0xa0300000
712 #define FW_MSG_CODE_LIC_CHALLENGE 0xff010000
713 #define FW_MSG_CODE_LIC_RESPONSE 0xff020000
714 #define FW_MSG_CODE_VIRT_MAC_PRIM 0xff030000
715 #define FW_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
717 #define FW_MSG_SEQ_NUMBER_MASK 0x0000ffff
722 #define DRV_PULSE_SEQ_MASK 0x00007fff
723 #define DRV_PULSE_SYSTEM_TIME_MASK 0xffff0000
724 /* The system time is in the format of
725 * (year-2001)*12*32 + month*32 + day. */
726 #define DRV_PULSE_ALWAYS_ALIVE 0x00008000
727 /* Indicate to the firmware not to go into the
728 * OS-absent when it is not getting driver pulse.
729 * This is used for debugging as well for PXE(MBA). */
732 #define MCP_PULSE_SEQ_MASK 0x00007fff
733 #define MCP_PULSE_ALWAYS_ALIVE 0x00008000
734 /* Indicates to the driver not to assert due to lack
736 #define MCP_EVENT_MASK 0xffff0000
737 #define MCP_EVENT_OTHER_DRIVER_RESET_REQ 0x00010000
739 u32 iscsi_boot_signature
;
740 u32 iscsi_boot_block_offset
;
743 #define DRV_STATUS_PMF 0x00000001
746 #define VIRT_MAC_SIGN_MASK 0xffff0000
747 #define VIRT_MAC_SIGNATURE 0x564d0000
753 /****************************************************************************
754 * Management firmware state *
755 ****************************************************************************/
756 /* Allocate 440 bytes for management firmware */
757 #define MGMTFW_STATE_WORD_SIZE 110
759 struct mgmtfw_state
{
760 u32 opaque
[MGMTFW_STATE_WORD_SIZE
];
764 /****************************************************************************
765 * Multi-Function configuration *
766 ****************************************************************************/
767 struct shared_mf_cfg
{
770 #define SHARED_MF_CLP_SET_DEFAULT 0x00000000
772 #define SHARED_MF_CLP_EXIT 0x00000001
774 #define SHARED_MF_CLP_EXIT_DONE 0x00010000
780 u32 dynamic_cfg
; /* device control channel */
781 #define PORT_MF_CFG_OUTER_VLAN_TAG_MASK 0x0000ffff
782 #define PORT_MF_CFG_OUTER_VLAN_TAG_SHIFT 0
783 #define PORT_MF_CFG_DYNAMIC_CFG_ENABLED 0x00010000
784 #define PORT_MF_CFG_DYNAMIC_CFG_DEFAULT 0x00000000
794 /* function 0 of each port cannot be hidden */
795 #define FUNC_MF_CFG_FUNC_HIDE 0x00000001
797 #define FUNC_MF_CFG_PROTOCOL_MASK 0x00000007
798 #define FUNC_MF_CFG_PROTOCOL_ETHERNET 0x00000002
799 #define FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA 0x00000004
800 #define FUNC_MF_CFG_PROTOCOL_ISCSI 0x00000006
801 #define FUNC_MF_CFG_PROTOCOL_DEFAULT\
802 FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA
804 #define FUNC_MF_CFG_FUNC_DISABLED 0x00000008
807 /* 0 - low priority, 3 - high priority */
808 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_MASK 0x00000300
809 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_SHIFT 8
810 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_DEFAULT 0x00000000
813 /* value range - 0..100, increments in 100Mbps */
814 #define FUNC_MF_CFG_MIN_BW_MASK 0x00ff0000
815 #define FUNC_MF_CFG_MIN_BW_SHIFT 16
816 #define FUNC_MF_CFG_MIN_BW_DEFAULT 0x00000000
817 #define FUNC_MF_CFG_MAX_BW_MASK 0xff000000
818 #define FUNC_MF_CFG_MAX_BW_SHIFT 24
819 #define FUNC_MF_CFG_MAX_BW_DEFAULT 0x64000000
821 u32 mac_upper
; /* MAC */
822 #define FUNC_MF_CFG_UPPERMAC_MASK 0x0000ffff
823 #define FUNC_MF_CFG_UPPERMAC_SHIFT 0
824 #define FUNC_MF_CFG_UPPERMAC_DEFAULT FUNC_MF_CFG_UPPERMAC_MASK
826 #define FUNC_MF_CFG_LOWERMAC_DEFAULT 0xffffffff
828 u32 e1hov_tag
; /* VNI */
829 #define FUNC_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
830 #define FUNC_MF_CFG_E1HOV_TAG_SHIFT 0
831 #define FUNC_MF_CFG_E1HOV_TAG_DEFAULT FUNC_MF_CFG_E1HOV_TAG_MASK
839 struct shared_mf_cfg shared_mf_config
;
840 struct port_mf_cfg port_mf_config
[PORT_MAX
];
841 struct func_mf_cfg func_mf_config
[E1H_FUNC_MAX
];
846 /****************************************************************************
847 * Shared Memory Region *
848 ****************************************************************************/
849 struct shmem_region
{ /* SharedMem Offset (size) */
851 u32 validity_map
[PORT_MAX
]; /* 0x0 (4*2 = 0x8) */
852 #define SHR_MEM_FORMAT_REV_ID ('A'<<24)
853 #define SHR_MEM_FORMAT_REV_MASK 0xff000000
855 #define SHR_MEM_VALIDITY_PCI_CFG 0x00100000
856 #define SHR_MEM_VALIDITY_MB 0x00200000
857 #define SHR_MEM_VALIDITY_DEV_INFO 0x00400000
858 #define SHR_MEM_VALIDITY_RESERVED 0x00000007
859 /* One licensing bit should be set */
860 #define SHR_MEM_VALIDITY_LIC_KEY_IN_EFFECT_MASK 0x00000038
861 #define SHR_MEM_VALIDITY_LIC_MANUF_KEY_IN_EFFECT 0x00000008
862 #define SHR_MEM_VALIDITY_LIC_UPGRADE_KEY_IN_EFFECT 0x00000010
863 #define SHR_MEM_VALIDITY_LIC_NO_KEY_IN_EFFECT 0x00000020
865 #define SHR_MEM_VALIDITY_ACTIVE_MFW_UNKNOWN 0x00000000
866 #define SHR_MEM_VALIDITY_ACTIVE_MFW_IPMI 0x00000040
867 #define SHR_MEM_VALIDITY_ACTIVE_MFW_UMP 0x00000080
868 #define SHR_MEM_VALIDITY_ACTIVE_MFW_NCSI 0x000000c0
869 #define SHR_MEM_VALIDITY_ACTIVE_MFW_NONE 0x000001c0
870 #define SHR_MEM_VALIDITY_ACTIVE_MFW_MASK 0x000001c0
872 struct shm_dev_info dev_info
; /* 0x8 (0x438) */
874 u8 reserved
[52*PORT_MAX
];
876 /* FW information (for internal FW use) */
877 u32 fw_info_fio_offset
; /* 0x4a8 (0x4) */
878 struct mgmtfw_state mgmtfw_state
; /* 0x4ac (0x1b8) */
880 struct drv_port_mb port_mb
[PORT_MAX
]; /* 0x664 (16*2=0x20) */
881 struct drv_func_mb func_mb
[E1H_FUNC_MAX
];
883 struct mf_cfg mf_cfg
;
889 u32 rx_stat_ifhcinoctets
;
890 u32 rx_stat_ifhcinbadoctets
;
891 u32 rx_stat_etherstatsfragments
;
892 u32 rx_stat_ifhcinucastpkts
;
893 u32 rx_stat_ifhcinmulticastpkts
;
894 u32 rx_stat_ifhcinbroadcastpkts
;
895 u32 rx_stat_dot3statsfcserrors
;
896 u32 rx_stat_dot3statsalignmenterrors
;
897 u32 rx_stat_dot3statscarriersenseerrors
;
898 u32 rx_stat_xonpauseframesreceived
;
899 u32 rx_stat_xoffpauseframesreceived
;
900 u32 rx_stat_maccontrolframesreceived
;
901 u32 rx_stat_xoffstateentered
;
902 u32 rx_stat_dot3statsframestoolong
;
903 u32 rx_stat_etherstatsjabbers
;
904 u32 rx_stat_etherstatsundersizepkts
;
905 u32 rx_stat_etherstatspkts64octets
;
906 u32 rx_stat_etherstatspkts65octetsto127octets
;
907 u32 rx_stat_etherstatspkts128octetsto255octets
;
908 u32 rx_stat_etherstatspkts256octetsto511octets
;
909 u32 rx_stat_etherstatspkts512octetsto1023octets
;
910 u32 rx_stat_etherstatspkts1024octetsto1522octets
;
911 u32 rx_stat_etherstatspktsover1522octets
;
913 u32 rx_stat_falsecarriererrors
;
915 u32 tx_stat_ifhcoutoctets
;
916 u32 tx_stat_ifhcoutbadoctets
;
917 u32 tx_stat_etherstatscollisions
;
918 u32 tx_stat_outxonsent
;
919 u32 tx_stat_outxoffsent
;
920 u32 tx_stat_flowcontroldone
;
921 u32 tx_stat_dot3statssinglecollisionframes
;
922 u32 tx_stat_dot3statsmultiplecollisionframes
;
923 u32 tx_stat_dot3statsdeferredtransmissions
;
924 u32 tx_stat_dot3statsexcessivecollisions
;
925 u32 tx_stat_dot3statslatecollisions
;
926 u32 tx_stat_ifhcoutucastpkts
;
927 u32 tx_stat_ifhcoutmulticastpkts
;
928 u32 tx_stat_ifhcoutbroadcastpkts
;
929 u32 tx_stat_etherstatspkts64octets
;
930 u32 tx_stat_etherstatspkts65octetsto127octets
;
931 u32 tx_stat_etherstatspkts128octetsto255octets
;
932 u32 tx_stat_etherstatspkts256octetsto511octets
;
933 u32 tx_stat_etherstatspkts512octetsto1023octets
;
934 u32 tx_stat_etherstatspkts1024octetsto1522octets
;
935 u32 tx_stat_etherstatspktsover1522octets
;
936 u32 tx_stat_dot3statsinternalmactransmiterrors
;
941 u32 tx_stat_gtpkt_lo
;
942 u32 tx_stat_gtpkt_hi
;
943 u32 tx_stat_gtxpf_lo
;
944 u32 tx_stat_gtxpf_hi
;
945 u32 tx_stat_gtfcs_lo
;
946 u32 tx_stat_gtfcs_hi
;
947 u32 tx_stat_gtmca_lo
;
948 u32 tx_stat_gtmca_hi
;
949 u32 tx_stat_gtbca_lo
;
950 u32 tx_stat_gtbca_hi
;
951 u32 tx_stat_gtfrg_lo
;
952 u32 tx_stat_gtfrg_hi
;
953 u32 tx_stat_gtovr_lo
;
954 u32 tx_stat_gtovr_hi
;
957 u32 tx_stat_gt127_lo
;
958 u32 tx_stat_gt127_hi
;
959 u32 tx_stat_gt255_lo
;
960 u32 tx_stat_gt255_hi
;
961 u32 tx_stat_gt511_lo
;
962 u32 tx_stat_gt511_hi
;
963 u32 tx_stat_gt1023_lo
;
964 u32 tx_stat_gt1023_hi
;
965 u32 tx_stat_gt1518_lo
;
966 u32 tx_stat_gt1518_hi
;
967 u32 tx_stat_gt2047_lo
;
968 u32 tx_stat_gt2047_hi
;
969 u32 tx_stat_gt4095_lo
;
970 u32 tx_stat_gt4095_hi
;
971 u32 tx_stat_gt9216_lo
;
972 u32 tx_stat_gt9216_hi
;
973 u32 tx_stat_gt16383_lo
;
974 u32 tx_stat_gt16383_hi
;
975 u32 tx_stat_gtmax_lo
;
976 u32 tx_stat_gtmax_hi
;
977 u32 tx_stat_gtufl_lo
;
978 u32 tx_stat_gtufl_hi
;
979 u32 tx_stat_gterr_lo
;
980 u32 tx_stat_gterr_hi
;
981 u32 tx_stat_gtbyt_lo
;
982 u32 tx_stat_gtbyt_hi
;
986 u32 rx_stat_gr127_lo
;
987 u32 rx_stat_gr127_hi
;
988 u32 rx_stat_gr255_lo
;
989 u32 rx_stat_gr255_hi
;
990 u32 rx_stat_gr511_lo
;
991 u32 rx_stat_gr511_hi
;
992 u32 rx_stat_gr1023_lo
;
993 u32 rx_stat_gr1023_hi
;
994 u32 rx_stat_gr1518_lo
;
995 u32 rx_stat_gr1518_hi
;
996 u32 rx_stat_gr2047_lo
;
997 u32 rx_stat_gr2047_hi
;
998 u32 rx_stat_gr4095_lo
;
999 u32 rx_stat_gr4095_hi
;
1000 u32 rx_stat_gr9216_lo
;
1001 u32 rx_stat_gr9216_hi
;
1002 u32 rx_stat_gr16383_lo
;
1003 u32 rx_stat_gr16383_hi
;
1004 u32 rx_stat_grmax_lo
;
1005 u32 rx_stat_grmax_hi
;
1006 u32 rx_stat_grpkt_lo
;
1007 u32 rx_stat_grpkt_hi
;
1008 u32 rx_stat_grfcs_lo
;
1009 u32 rx_stat_grfcs_hi
;
1010 u32 rx_stat_grmca_lo
;
1011 u32 rx_stat_grmca_hi
;
1012 u32 rx_stat_grbca_lo
;
1013 u32 rx_stat_grbca_hi
;
1014 u32 rx_stat_grxcf_lo
;
1015 u32 rx_stat_grxcf_hi
;
1016 u32 rx_stat_grxpf_lo
;
1017 u32 rx_stat_grxpf_hi
;
1018 u32 rx_stat_grxuo_lo
;
1019 u32 rx_stat_grxuo_hi
;
1020 u32 rx_stat_grjbr_lo
;
1021 u32 rx_stat_grjbr_hi
;
1022 u32 rx_stat_grovr_lo
;
1023 u32 rx_stat_grovr_hi
;
1024 u32 rx_stat_grflr_lo
;
1025 u32 rx_stat_grflr_hi
;
1026 u32 rx_stat_grmeg_lo
;
1027 u32 rx_stat_grmeg_hi
;
1028 u32 rx_stat_grmeb_lo
;
1029 u32 rx_stat_grmeb_hi
;
1030 u32 rx_stat_grbyt_lo
;
1031 u32 rx_stat_grbyt_hi
;
1032 u32 rx_stat_grund_lo
;
1033 u32 rx_stat_grund_hi
;
1034 u32 rx_stat_grfrg_lo
;
1035 u32 rx_stat_grfrg_hi
;
1036 u32 rx_stat_grerb_lo
;
1037 u32 rx_stat_grerb_hi
;
1038 u32 rx_stat_grfre_lo
;
1039 u32 rx_stat_grfre_hi
;
1040 u32 rx_stat_gripj_lo
;
1041 u32 rx_stat_gripj_hi
;
1046 struct emac_stats emac_stats
;
1047 struct bmac_stats bmac_stats
;
1053 u32 rx_stat_ifhcinbadoctets_hi
;
1054 u32 rx_stat_ifhcinbadoctets_lo
;
1056 /* out_bad_octets */
1057 u32 tx_stat_ifhcoutbadoctets_hi
;
1058 u32 tx_stat_ifhcoutbadoctets_lo
;
1060 /* crc_receive_errors */
1061 u32 rx_stat_dot3statsfcserrors_hi
;
1062 u32 rx_stat_dot3statsfcserrors_lo
;
1063 /* alignment_errors */
1064 u32 rx_stat_dot3statsalignmenterrors_hi
;
1065 u32 rx_stat_dot3statsalignmenterrors_lo
;
1066 /* carrier_sense_errors */
1067 u32 rx_stat_dot3statscarriersenseerrors_hi
;
1068 u32 rx_stat_dot3statscarriersenseerrors_lo
;
1069 /* false_carrier_detections */
1070 u32 rx_stat_falsecarriererrors_hi
;
1071 u32 rx_stat_falsecarriererrors_lo
;
1073 /* runt_packets_received */
1074 u32 rx_stat_etherstatsundersizepkts_hi
;
1075 u32 rx_stat_etherstatsundersizepkts_lo
;
1076 /* jabber_packets_received */
1077 u32 rx_stat_dot3statsframestoolong_hi
;
1078 u32 rx_stat_dot3statsframestoolong_lo
;
1080 /* error_runt_packets_received */
1081 u32 rx_stat_etherstatsfragments_hi
;
1082 u32 rx_stat_etherstatsfragments_lo
;
1083 /* error_jabber_packets_received */
1084 u32 rx_stat_etherstatsjabbers_hi
;
1085 u32 rx_stat_etherstatsjabbers_lo
;
1087 /* control_frames_received */
1088 u32 rx_stat_maccontrolframesreceived_hi
;
1089 u32 rx_stat_maccontrolframesreceived_lo
;
1090 u32 rx_stat_bmac_xpf_hi
;
1091 u32 rx_stat_bmac_xpf_lo
;
1092 u32 rx_stat_bmac_xcf_hi
;
1093 u32 rx_stat_bmac_xcf_lo
;
1095 /* xoff_state_entered */
1096 u32 rx_stat_xoffstateentered_hi
;
1097 u32 rx_stat_xoffstateentered_lo
;
1098 /* pause_xon_frames_received */
1099 u32 rx_stat_xonpauseframesreceived_hi
;
1100 u32 rx_stat_xonpauseframesreceived_lo
;
1101 /* pause_xoff_frames_received */
1102 u32 rx_stat_xoffpauseframesreceived_hi
;
1103 u32 rx_stat_xoffpauseframesreceived_lo
;
1104 /* pause_xon_frames_transmitted */
1105 u32 tx_stat_outxonsent_hi
;
1106 u32 tx_stat_outxonsent_lo
;
1107 /* pause_xoff_frames_transmitted */
1108 u32 tx_stat_outxoffsent_hi
;
1109 u32 tx_stat_outxoffsent_lo
;
1110 /* flow_control_done */
1111 u32 tx_stat_flowcontroldone_hi
;
1112 u32 tx_stat_flowcontroldone_lo
;
1114 /* ether_stats_collisions */
1115 u32 tx_stat_etherstatscollisions_hi
;
1116 u32 tx_stat_etherstatscollisions_lo
;
1117 /* single_collision_transmit_frames */
1118 u32 tx_stat_dot3statssinglecollisionframes_hi
;
1119 u32 tx_stat_dot3statssinglecollisionframes_lo
;
1120 /* multiple_collision_transmit_frames */
1121 u32 tx_stat_dot3statsmultiplecollisionframes_hi
;
1122 u32 tx_stat_dot3statsmultiplecollisionframes_lo
;
1123 /* deferred_transmissions */
1124 u32 tx_stat_dot3statsdeferredtransmissions_hi
;
1125 u32 tx_stat_dot3statsdeferredtransmissions_lo
;
1126 /* excessive_collision_frames */
1127 u32 tx_stat_dot3statsexcessivecollisions_hi
;
1128 u32 tx_stat_dot3statsexcessivecollisions_lo
;
1129 /* late_collision_frames */
1130 u32 tx_stat_dot3statslatecollisions_hi
;
1131 u32 tx_stat_dot3statslatecollisions_lo
;
1133 /* frames_transmitted_64_bytes */
1134 u32 tx_stat_etherstatspkts64octets_hi
;
1135 u32 tx_stat_etherstatspkts64octets_lo
;
1136 /* frames_transmitted_65_127_bytes */
1137 u32 tx_stat_etherstatspkts65octetsto127octets_hi
;
1138 u32 tx_stat_etherstatspkts65octetsto127octets_lo
;
1139 /* frames_transmitted_128_255_bytes */
1140 u32 tx_stat_etherstatspkts128octetsto255octets_hi
;
1141 u32 tx_stat_etherstatspkts128octetsto255octets_lo
;
1142 /* frames_transmitted_256_511_bytes */
1143 u32 tx_stat_etherstatspkts256octetsto511octets_hi
;
1144 u32 tx_stat_etherstatspkts256octetsto511octets_lo
;
1145 /* frames_transmitted_512_1023_bytes */
1146 u32 tx_stat_etherstatspkts512octetsto1023octets_hi
;
1147 u32 tx_stat_etherstatspkts512octetsto1023octets_lo
;
1148 /* frames_transmitted_1024_1522_bytes */
1149 u32 tx_stat_etherstatspkts1024octetsto1522octets_hi
;
1150 u32 tx_stat_etherstatspkts1024octetsto1522octets_lo
;
1151 /* frames_transmitted_1523_9022_bytes */
1152 u32 tx_stat_etherstatspktsover1522octets_hi
;
1153 u32 tx_stat_etherstatspktsover1522octets_lo
;
1154 u32 tx_stat_bmac_2047_hi
;
1155 u32 tx_stat_bmac_2047_lo
;
1156 u32 tx_stat_bmac_4095_hi
;
1157 u32 tx_stat_bmac_4095_lo
;
1158 u32 tx_stat_bmac_9216_hi
;
1159 u32 tx_stat_bmac_9216_lo
;
1160 u32 tx_stat_bmac_16383_hi
;
1161 u32 tx_stat_bmac_16383_lo
;
1163 /* internal_mac_transmit_errors */
1164 u32 tx_stat_dot3statsinternalmactransmiterrors_hi
;
1165 u32 tx_stat_dot3statsinternalmactransmiterrors_lo
;
1167 /* if_out_discards */
1168 u32 tx_stat_bmac_ufl_hi
;
1169 u32 tx_stat_bmac_ufl_lo
;
1173 #define MAC_STX_IDX_MAX 2
1175 struct host_port_stats
{
1176 u32 host_port_stats_start
;
1178 struct mac_stx mac_stx
[MAC_STX_IDX_MAX
];
1183 u32 host_port_stats_end
;
1187 struct host_func_stats
{
1188 u32 host_func_stats_start
;
1190 u32 total_bytes_received_hi
;
1191 u32 total_bytes_received_lo
;
1193 u32 total_bytes_transmitted_hi
;
1194 u32 total_bytes_transmitted_lo
;
1196 u32 total_unicast_packets_received_hi
;
1197 u32 total_unicast_packets_received_lo
;
1199 u32 total_multicast_packets_received_hi
;
1200 u32 total_multicast_packets_received_lo
;
1202 u32 total_broadcast_packets_received_hi
;
1203 u32 total_broadcast_packets_received_lo
;
1205 u32 total_unicast_packets_transmitted_hi
;
1206 u32 total_unicast_packets_transmitted_lo
;
1208 u32 total_multicast_packets_transmitted_hi
;
1209 u32 total_multicast_packets_transmitted_lo
;
1211 u32 total_broadcast_packets_transmitted_hi
;
1212 u32 total_broadcast_packets_transmitted_lo
;
1214 u32 valid_bytes_received_hi
;
1215 u32 valid_bytes_received_lo
;
1217 u32 host_func_stats_end
;
1221 #define BCM_5710_FW_MAJOR_VERSION 5
1222 #define BCM_5710_FW_MINOR_VERSION 0
1223 #define BCM_5710_FW_REVISION_VERSION 21
1224 #define BCM_5710_FW_ENGINEERING_VERSION 0
1225 #define BCM_5710_FW_COMPILE_FLAGS 1
1231 struct atten_def_status_block
{
1233 __le32 attn_bits_ack
;
1236 __le16 attn_bits_index
;
1242 * common data for all protocols
1244 struct doorbell_hdr
{
1246 #define DOORBELL_HDR_RX (0x1<<0)
1247 #define DOORBELL_HDR_RX_SHIFT 0
1248 #define DOORBELL_HDR_DB_TYPE (0x1<<1)
1249 #define DOORBELL_HDR_DB_TYPE_SHIFT 1
1250 #define DOORBELL_HDR_DPM_SIZE (0x3<<2)
1251 #define DOORBELL_HDR_DPM_SIZE_SHIFT 2
1252 #define DOORBELL_HDR_CONN_TYPE (0xF<<4)
1253 #define DOORBELL_HDR_CONN_TYPE_SHIFT 4
1257 * doorbell message sent to the chip
1260 #if defined(__BIG_ENDIAN)
1263 struct doorbell_hdr header
;
1264 #elif defined(__LITTLE_ENDIAN)
1265 struct doorbell_hdr header
;
1273 * doorbell message sent to the chip
1275 struct doorbell_set_prod
{
1276 #if defined(__BIG_ENDIAN)
1279 struct doorbell_hdr header
;
1280 #elif defined(__LITTLE_ENDIAN)
1281 struct doorbell_hdr header
;
1289 * IGU driver acknowledgement register
1291 struct igu_ack_register
{
1292 #if defined(__BIG_ENDIAN)
1293 u16 sb_id_and_flags
;
1294 #define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
1295 #define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
1296 #define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
1297 #define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
1298 #define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
1299 #define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
1300 #define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
1301 #define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
1302 #define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
1303 #define IGU_ACK_REGISTER_RESERVED_SHIFT 11
1304 u16 status_block_index
;
1305 #elif defined(__LITTLE_ENDIAN)
1306 u16 status_block_index
;
1307 u16 sb_id_and_flags
;
1308 #define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
1309 #define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
1310 #define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
1311 #define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
1312 #define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
1313 #define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
1314 #define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
1315 #define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
1316 #define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
1317 #define IGU_ACK_REGISTER_RESERVED_SHIFT 11
1323 * IGU driver acknowledgement register
1325 struct igu_backward_compatible
{
1326 u32 sb_id_and_flags
;
1327 #define IGU_BACKWARD_COMPATIBLE_SB_INDEX (0xFFFF<<0)
1328 #define IGU_BACKWARD_COMPATIBLE_SB_INDEX_SHIFT 0
1329 #define IGU_BACKWARD_COMPATIBLE_SB_SELECT (0x1F<<16)
1330 #define IGU_BACKWARD_COMPATIBLE_SB_SELECT_SHIFT 16
1331 #define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS (0x7<<21)
1332 #define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS_SHIFT 21
1333 #define IGU_BACKWARD_COMPATIBLE_BUPDATE (0x1<<24)
1334 #define IGU_BACKWARD_COMPATIBLE_BUPDATE_SHIFT 24
1335 #define IGU_BACKWARD_COMPATIBLE_ENABLE_INT (0x3<<25)
1336 #define IGU_BACKWARD_COMPATIBLE_ENABLE_INT_SHIFT 25
1337 #define IGU_BACKWARD_COMPATIBLE_RESERVED_0 (0x1F<<27)
1338 #define IGU_BACKWARD_COMPATIBLE_RESERVED_0_SHIFT 27
1344 * IGU driver acknowledgement register
1346 struct igu_regular
{
1347 u32 sb_id_and_flags
;
1348 #define IGU_REGULAR_SB_INDEX (0xFFFFF<<0)
1349 #define IGU_REGULAR_SB_INDEX_SHIFT 0
1350 #define IGU_REGULAR_RESERVED0 (0x1<<20)
1351 #define IGU_REGULAR_RESERVED0_SHIFT 20
1352 #define IGU_REGULAR_SEGMENT_ACCESS (0x7<<21)
1353 #define IGU_REGULAR_SEGMENT_ACCESS_SHIFT 21
1354 #define IGU_REGULAR_BUPDATE (0x1<<24)
1355 #define IGU_REGULAR_BUPDATE_SHIFT 24
1356 #define IGU_REGULAR_ENABLE_INT (0x3<<25)
1357 #define IGU_REGULAR_ENABLE_INT_SHIFT 25
1358 #define IGU_REGULAR_RESERVED_1 (0x1<<27)
1359 #define IGU_REGULAR_RESERVED_1_SHIFT 27
1360 #define IGU_REGULAR_CLEANUP_TYPE (0x3<<28)
1361 #define IGU_REGULAR_CLEANUP_TYPE_SHIFT 28
1362 #define IGU_REGULAR_CLEANUP_SET (0x1<<30)
1363 #define IGU_REGULAR_CLEANUP_SET_SHIFT 30
1364 #define IGU_REGULAR_BCLEANUP (0x1<<31)
1365 #define IGU_REGULAR_BCLEANUP_SHIFT 31
1370 * IGU driver acknowledgement register
1372 union igu_consprod_reg
{
1373 struct igu_regular regular
;
1374 struct igu_backward_compatible backward_compatible
;
1379 * Parser parsing flags field
1381 struct parsing_flags
{
1383 #define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0)
1384 #define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0
1385 #define PARSING_FLAGS_VLAN (0x1<<1)
1386 #define PARSING_FLAGS_VLAN_SHIFT 1
1387 #define PARSING_FLAGS_EXTRA_VLAN (0x1<<2)
1388 #define PARSING_FLAGS_EXTRA_VLAN_SHIFT 2
1389 #define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL (0x3<<3)
1390 #define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT 3
1391 #define PARSING_FLAGS_IP_OPTIONS (0x1<<5)
1392 #define PARSING_FLAGS_IP_OPTIONS_SHIFT 5
1393 #define PARSING_FLAGS_FRAGMENTATION_STATUS (0x1<<6)
1394 #define PARSING_FLAGS_FRAGMENTATION_STATUS_SHIFT 6
1395 #define PARSING_FLAGS_OVER_IP_PROTOCOL (0x3<<7)
1396 #define PARSING_FLAGS_OVER_IP_PROTOCOL_SHIFT 7
1397 #define PARSING_FLAGS_PURE_ACK_INDICATION (0x1<<9)
1398 #define PARSING_FLAGS_PURE_ACK_INDICATION_SHIFT 9
1399 #define PARSING_FLAGS_TCP_OPTIONS_EXIST (0x1<<10)
1400 #define PARSING_FLAGS_TCP_OPTIONS_EXIST_SHIFT 10
1401 #define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG (0x1<<11)
1402 #define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG_SHIFT 11
1403 #define PARSING_FLAGS_CONNECTION_MATCH (0x1<<12)
1404 #define PARSING_FLAGS_CONNECTION_MATCH_SHIFT 12
1405 #define PARSING_FLAGS_LLC_SNAP (0x1<<13)
1406 #define PARSING_FLAGS_LLC_SNAP_SHIFT 13
1407 #define PARSING_FLAGS_RESERVED0 (0x3<<14)
1408 #define PARSING_FLAGS_RESERVED0_SHIFT 14
1419 * dmae command structure
1421 struct dmae_command
{
1423 #define DMAE_COMMAND_SRC (0x1<<0)
1424 #define DMAE_COMMAND_SRC_SHIFT 0
1425 #define DMAE_COMMAND_DST (0x3<<1)
1426 #define DMAE_COMMAND_DST_SHIFT 1
1427 #define DMAE_COMMAND_C_DST (0x1<<3)
1428 #define DMAE_COMMAND_C_DST_SHIFT 3
1429 #define DMAE_COMMAND_C_TYPE_ENABLE (0x1<<4)
1430 #define DMAE_COMMAND_C_TYPE_ENABLE_SHIFT 4
1431 #define DMAE_COMMAND_C_TYPE_CRC_ENABLE (0x1<<5)
1432 #define DMAE_COMMAND_C_TYPE_CRC_ENABLE_SHIFT 5
1433 #define DMAE_COMMAND_C_TYPE_CRC_OFFSET (0x7<<6)
1434 #define DMAE_COMMAND_C_TYPE_CRC_OFFSET_SHIFT 6
1435 #define DMAE_COMMAND_ENDIANITY (0x3<<9)
1436 #define DMAE_COMMAND_ENDIANITY_SHIFT 9
1437 #define DMAE_COMMAND_PORT (0x1<<11)
1438 #define DMAE_COMMAND_PORT_SHIFT 11
1439 #define DMAE_COMMAND_CRC_RESET (0x1<<12)
1440 #define DMAE_COMMAND_CRC_RESET_SHIFT 12
1441 #define DMAE_COMMAND_SRC_RESET (0x1<<13)
1442 #define DMAE_COMMAND_SRC_RESET_SHIFT 13
1443 #define DMAE_COMMAND_DST_RESET (0x1<<14)
1444 #define DMAE_COMMAND_DST_RESET_SHIFT 14
1445 #define DMAE_COMMAND_E1HVN (0x3<<15)
1446 #define DMAE_COMMAND_E1HVN_SHIFT 15
1447 #define DMAE_COMMAND_RESERVED0 (0x7FFF<<17)
1448 #define DMAE_COMMAND_RESERVED0_SHIFT 17
1453 #if defined(__BIG_ENDIAN)
1456 #elif defined(__LITTLE_ENDIAN)
1465 #if defined(__BIG_ENDIAN)
1468 #elif defined(__LITTLE_ENDIAN)
1472 #if defined(__BIG_ENDIAN)
1475 #elif defined(__LITTLE_ENDIAN)
1479 #if defined(__BIG_ENDIAN)
1482 #elif defined(__LITTLE_ENDIAN)
1489 struct double_regpair
{
1498 * The eth storm context of Ustorm (configuration part)
1500 struct ustorm_eth_st_context_config
{
1501 #if defined(__BIG_ENDIAN)
1503 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT (0x1<<0)
1504 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT_SHIFT 0
1505 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_DYNAMIC_HC (0x1<<1)
1506 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_DYNAMIC_HC_SHIFT 1
1507 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA (0x1<<2)
1508 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA_SHIFT 2
1509 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_STATISTICS (0x1<<3)
1510 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_STATISTICS_SHIFT 3
1511 #define __USTORM_ETH_ST_CONTEXT_CONFIG_RESERVED0 (0xF<<4)
1512 #define __USTORM_ETH_ST_CONTEXT_CONFIG_RESERVED0_SHIFT 4
1515 u8 sb_index_numbers
;
1516 #define USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER (0xF<<0)
1517 #define USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER_SHIFT 0
1518 #define USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER (0xF<<4)
1519 #define USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER_SHIFT 4
1520 #elif defined(__LITTLE_ENDIAN)
1521 u8 sb_index_numbers
;
1522 #define USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER (0xF<<0)
1523 #define USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER_SHIFT 0
1524 #define USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER (0xF<<4)
1525 #define USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER_SHIFT 4
1529 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT (0x1<<0)
1530 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT_SHIFT 0
1531 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_DYNAMIC_HC (0x1<<1)
1532 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_DYNAMIC_HC_SHIFT 1
1533 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA (0x1<<2)
1534 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA_SHIFT 2
1535 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_STATISTICS (0x1<<3)
1536 #define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_STATISTICS_SHIFT 3
1537 #define __USTORM_ETH_ST_CONTEXT_CONFIG_RESERVED0 (0xF<<4)
1538 #define __USTORM_ETH_ST_CONTEXT_CONFIG_RESERVED0_SHIFT 4
1540 #if defined(__BIG_ENDIAN)
1542 u8 statistics_counter_id
;
1543 u8 mc_alignment_log_size
;
1544 #elif defined(__LITTLE_ENDIAN)
1545 u8 mc_alignment_log_size
;
1546 u8 statistics_counter_id
;
1549 #if defined(__BIG_ENDIAN)
1550 u8 __local_sge_prod
;
1553 #elif defined(__LITTLE_ENDIAN)
1556 u8 __local_sge_prod
;
1558 #if defined(__BIG_ENDIAN)
1559 u16 __sdm_bd_expected_counter
;
1561 u8 __expected_bds_on_ram
;
1562 #elif defined(__LITTLE_ENDIAN)
1563 u8 __expected_bds_on_ram
;
1565 u16 __sdm_bd_expected_counter
;
1567 #if defined(__BIG_ENDIAN)
1568 u16 __ring_data_ram_addr
;
1569 u16 __hc_cstorm_ram_addr
;
1570 #elif defined(__LITTLE_ENDIAN)
1571 u16 __hc_cstorm_ram_addr
;
1572 u16 __ring_data_ram_addr
;
1574 #if defined(__BIG_ENDIAN)
1576 u8 max_sges_for_packet
;
1577 u16 __bd_ring_ram_addr
;
1578 #elif defined(__LITTLE_ENDIAN)
1579 u16 __bd_ring_ram_addr
;
1580 u8 max_sges_for_packet
;
1583 u32 bd_page_base_lo
;
1584 u32 bd_page_base_hi
;
1585 u32 sge_page_base_lo
;
1586 u32 sge_page_base_hi
;
1587 struct regpair reserved2
;
1591 * The eth Rx Buffer Descriptor
1599 * The eth Rx SGE Descriptor
1607 * Local BDs and SGEs rings (in ETH)
1609 struct eth_local_rx_rings
{
1610 struct eth_rx_bd __local_bd_ring
[8];
1611 struct eth_rx_sge __local_sge_ring
[10];
1615 * The eth storm context of Ustorm
1617 struct ustorm_eth_st_context
{
1618 struct ustorm_eth_st_context_config common
;
1619 struct eth_local_rx_rings __rings
;
1623 * The eth storm context of Tstorm
1625 struct tstorm_eth_st_context
{
1626 u32 __reserved0
[28];
1630 * The eth aggregative context section of Xstorm
1632 struct xstorm_eth_extra_ag_context_section
{
1633 #if defined(__BIG_ENDIAN)
1637 #elif defined(__LITTLE_ENDIAN)
1646 #if defined(__BIG_ENDIAN)
1649 u16 __tcp_agg_vars2
;
1650 #elif defined(__LITTLE_ENDIAN)
1651 u16 __tcp_agg_vars2
;
1659 #if defined(__BIG_ENDIAN)
1662 #elif defined(__LITTLE_ENDIAN)
1666 #if defined(__BIG_ENDIAN)
1671 #elif defined(__LITTLE_ENDIAN)
1677 u32 __tcp_agg_vars6
;
1678 #if defined(__BIG_ENDIAN)
1680 u16 __tcp_agg_vars7
;
1681 #elif defined(__LITTLE_ENDIAN)
1682 u16 __tcp_agg_vars7
;
1687 #if defined(__BIG_ENDIAN)
1691 #elif defined(__LITTLE_ENDIAN)
1699 * The eth aggregative context of Xstorm
1701 struct xstorm_eth_ag_context
{
1702 #if defined(__BIG_ENDIAN)
1706 #elif defined(__LITTLE_ENDIAN)
1711 #if defined(__BIG_ENDIAN)
1716 #elif defined(__LITTLE_ENDIAN)
1723 #if defined(__BIG_ENDIAN)
1726 #elif defined(__LITTLE_ENDIAN)
1730 struct xstorm_eth_extra_ag_context_section __extra_section
;
1731 #if defined(__BIG_ENDIAN)
1735 #elif defined(__LITTLE_ENDIAN)
1740 #if defined(__BIG_ENDIAN)
1743 #elif defined(__LITTLE_ENDIAN)
1747 #if defined(__BIG_ENDIAN)
1751 #elif defined(__LITTLE_ENDIAN)
1756 #if defined(__BIG_ENDIAN)
1759 #elif defined(__LITTLE_ENDIAN)
1764 #if defined(__BIG_ENDIAN)
1767 #elif defined(__LITTLE_ENDIAN)
1771 #if defined(__BIG_ENDIAN)
1776 #elif defined(__LITTLE_ENDIAN)
1782 #if defined(__BIG_ENDIAN)
1784 u16 __bd_ind_max_val
;
1785 #elif defined(__LITTLE_ENDIAN)
1786 u16 __bd_ind_max_val
;
1795 * The eth extra aggregative context section of Tstorm
1797 struct tstorm_eth_extra_ag_context_section
{
1799 #if defined(__BIG_ENDIAN)
1803 #elif defined(__LITTLE_ENDIAN)
1808 #if defined(__BIG_ENDIAN)
1812 #elif defined(__LITTLE_ENDIAN)
1822 u32 __tcp_agg_vars1
;
1829 * The eth aggregative context of Tstorm
1831 struct tstorm_eth_ag_context
{
1832 #if defined(__BIG_ENDIAN)
1836 #elif defined(__LITTLE_ENDIAN)
1841 #if defined(__BIG_ENDIAN)
1844 #elif defined(__LITTLE_ENDIAN)
1848 struct tstorm_eth_extra_ag_context_section __extra_section
;
1852 * The eth aggregative context of Cstorm
1854 struct cstorm_eth_ag_context
{
1856 #if defined(__BIG_ENDIAN)
1860 #elif defined(__LITTLE_ENDIAN)
1865 u32 __num_of_treated_packet
;
1866 u32 __last_packet_treated
;
1867 #if defined(__BIG_ENDIAN)
1870 #elif defined(__LITTLE_ENDIAN)
1874 #if defined(__BIG_ENDIAN)
1879 #elif defined(__LITTLE_ENDIAN)
1885 #if defined(__BIG_ENDIAN)
1888 #elif defined(__LITTLE_ENDIAN)
1893 #if defined(__BIG_ENDIAN)
1896 #elif defined(__LITTLE_ENDIAN)
1900 #if defined(__BIG_ENDIAN)
1901 u16 __packet_index_th
;
1903 #elif defined(__LITTLE_ENDIAN)
1905 u16 __packet_index_th
;
1910 * The eth aggregative context of Ustorm
1912 struct ustorm_eth_ag_context
{
1913 #if defined(__BIG_ENDIAN)
1914 u8 __aux_counter_flags
;
1918 #elif defined(__LITTLE_ENDIAN)
1922 u8 __aux_counter_flags
;
1924 #if defined(__BIG_ENDIAN)
1928 #elif defined(__LITTLE_ENDIAN)
1934 #if defined(__BIG_ENDIAN)
1938 #elif defined(__LITTLE_ENDIAN)
1945 #if defined(__BIG_ENDIAN)
1948 #elif defined(__LITTLE_ENDIAN)
1952 #if defined(__BIG_ENDIAN)
1954 u8 __decision_rules
;
1955 u8 __decision_rule_enable_bits
;
1956 #elif defined(__LITTLE_ENDIAN)
1957 u8 __decision_rule_enable_bits
;
1958 u8 __decision_rules
;
1964 * Timers connection context
1966 struct timers_block_context
{
1971 #define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS (0x3<<0)
1972 #define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS_SHIFT 0
1973 #define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG (0x1<<2)
1974 #define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG_SHIFT 2
1975 #define __TIMERS_BLOCK_CONTEXT_RESERVED0 (0x1FFFFFFF<<3)
1976 #define __TIMERS_BLOCK_CONTEXT_RESERVED0_SHIFT 3
1980 * structure for easy accessibility to assembler
1982 struct eth_tx_bd_flags
{
1984 #define ETH_TX_BD_FLAGS_VLAN_TAG (0x1<<0)
1985 #define ETH_TX_BD_FLAGS_VLAN_TAG_SHIFT 0
1986 #define ETH_TX_BD_FLAGS_IP_CSUM (0x1<<1)
1987 #define ETH_TX_BD_FLAGS_IP_CSUM_SHIFT 1
1988 #define ETH_TX_BD_FLAGS_L4_CSUM (0x1<<2)
1989 #define ETH_TX_BD_FLAGS_L4_CSUM_SHIFT 2
1990 #define ETH_TX_BD_FLAGS_END_BD (0x1<<3)
1991 #define ETH_TX_BD_FLAGS_END_BD_SHIFT 3
1992 #define ETH_TX_BD_FLAGS_START_BD (0x1<<4)
1993 #define ETH_TX_BD_FLAGS_START_BD_SHIFT 4
1994 #define ETH_TX_BD_FLAGS_HDR_POOL (0x1<<5)
1995 #define ETH_TX_BD_FLAGS_HDR_POOL_SHIFT 5
1996 #define ETH_TX_BD_FLAGS_SW_LSO (0x1<<6)
1997 #define ETH_TX_BD_FLAGS_SW_LSO_SHIFT 6
1998 #define ETH_TX_BD_FLAGS_IPV6 (0x1<<7)
1999 #define ETH_TX_BD_FLAGS_IPV6_SHIFT 7
2003 * The eth Tx Buffer Descriptor
2005 struct eth_tx_start_bd
{
2011 struct eth_tx_bd_flags bd_flags
;
2013 #define ETH_TX_START_BD_HDR_NBDS (0x3F<<0)
2014 #define ETH_TX_START_BD_HDR_NBDS_SHIFT 0
2015 #define ETH_TX_START_BD_ETH_ADDR_TYPE (0x3<<6)
2016 #define ETH_TX_START_BD_ETH_ADDR_TYPE_SHIFT 6
2020 * Tx regular BD structure
2025 u16 total_pkt_bytes
;
2031 * Tx parsing BD structure for ETH,Relevant in START
2033 struct eth_tx_parse_bd
{
2035 #define ETH_TX_PARSE_BD_IP_HDR_START_OFFSET (0xF<<0)
2036 #define ETH_TX_PARSE_BD_IP_HDR_START_OFFSET_SHIFT 0
2037 #define ETH_TX_PARSE_BD_UDP_CS_FLG (0x1<<4)
2038 #define ETH_TX_PARSE_BD_UDP_CS_FLG_SHIFT 4
2039 #define ETH_TX_PARSE_BD_PSEUDO_CS_WITHOUT_LEN (0x1<<5)
2040 #define ETH_TX_PARSE_BD_PSEUDO_CS_WITHOUT_LEN_SHIFT 5
2041 #define ETH_TX_PARSE_BD_LLC_SNAP_EN (0x1<<6)
2042 #define ETH_TX_PARSE_BD_LLC_SNAP_EN_SHIFT 6
2043 #define ETH_TX_PARSE_BD_NS_FLG (0x1<<7)
2044 #define ETH_TX_PARSE_BD_NS_FLG_SHIFT 7
2046 #define ETH_TX_PARSE_BD_FIN_FLG (0x1<<0)
2047 #define ETH_TX_PARSE_BD_FIN_FLG_SHIFT 0
2048 #define ETH_TX_PARSE_BD_SYN_FLG (0x1<<1)
2049 #define ETH_TX_PARSE_BD_SYN_FLG_SHIFT 1
2050 #define ETH_TX_PARSE_BD_RST_FLG (0x1<<2)
2051 #define ETH_TX_PARSE_BD_RST_FLG_SHIFT 2
2052 #define ETH_TX_PARSE_BD_PSH_FLG (0x1<<3)
2053 #define ETH_TX_PARSE_BD_PSH_FLG_SHIFT 3
2054 #define ETH_TX_PARSE_BD_ACK_FLG (0x1<<4)
2055 #define ETH_TX_PARSE_BD_ACK_FLG_SHIFT 4
2056 #define ETH_TX_PARSE_BD_URG_FLG (0x1<<5)
2057 #define ETH_TX_PARSE_BD_URG_FLG_SHIFT 5
2058 #define ETH_TX_PARSE_BD_ECE_FLG (0x1<<6)
2059 #define ETH_TX_PARSE_BD_ECE_FLG_SHIFT 6
2060 #define ETH_TX_PARSE_BD_CWR_FLG (0x1<<7)
2061 #define ETH_TX_PARSE_BD_CWR_FLG_SHIFT 7
2065 __le16 tcp_pseudo_csum
;
2068 __le32 tcp_send_seq
;
2072 * The last BD in the BD memory will hold a pointer to the next BD memory
2074 struct eth_tx_next_bd
{
2081 * union for 4 Bd types
2083 union eth_tx_bd_types
{
2084 struct eth_tx_start_bd start_bd
;
2085 struct eth_tx_bd reg_bd
;
2086 struct eth_tx_parse_bd parse_bd
;
2087 struct eth_tx_next_bd next_bd
;
2091 * The eth storm context of Xstorm
2093 struct xstorm_eth_st_context
{
2094 u32 tx_bd_page_base_lo
;
2095 u32 tx_bd_page_base_hi
;
2096 #if defined(__BIG_ENDIAN)
2099 #define XSTORM_ETH_ST_CONTEXT_STATISTICS_COUNTER_ID (0x7F<<0)
2100 #define XSTORM_ETH_ST_CONTEXT_STATISTICS_COUNTER_ID_SHIFT 0
2101 #define XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE (0x1<<7)
2102 #define XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE_SHIFT 7
2103 u8 __local_tx_bd_prod
;
2104 #elif defined(__LITTLE_ENDIAN)
2105 u8 __local_tx_bd_prod
;
2107 #define XSTORM_ETH_ST_CONTEXT_STATISTICS_COUNTER_ID (0x7F<<0)
2108 #define XSTORM_ETH_ST_CONTEXT_STATISTICS_COUNTER_ID_SHIFT 0
2109 #define XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE (0x1<<7)
2110 #define XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE_SHIFT 7
2115 #if defined(__BIG_ENDIAN)
2116 u8 __ram_cache_index
;
2117 u8 __double_buffer_client
;
2119 #elif defined(__LITTLE_ENDIAN)
2121 u8 __double_buffer_client
;
2122 u8 __ram_cache_index
;
2124 #if defined(__BIG_ENDIAN)
2125 u16 __statistics_address
;
2127 #elif defined(__LITTLE_ENDIAN)
2129 u16 __statistics_address
;
2131 #if defined(__BIG_ENDIAN)
2132 u8 __local_tx_bd_cons
;
2136 #elif defined(__LITTLE_ENDIAN)
2140 u8 __local_tx_bd_cons
;
2142 union eth_tx_bd_types __bds
[13];
2146 * The eth storm context of Cstorm
2148 struct cstorm_eth_st_context
{
2149 #if defined(__BIG_ENDIAN)
2153 #elif defined(__LITTLE_ENDIAN)
2162 * Ethernet connection context
2164 struct eth_context
{
2165 struct ustorm_eth_st_context ustorm_st_context
;
2166 struct tstorm_eth_st_context tstorm_st_context
;
2167 struct xstorm_eth_ag_context xstorm_ag_context
;
2168 struct tstorm_eth_ag_context tstorm_ag_context
;
2169 struct cstorm_eth_ag_context cstorm_ag_context
;
2170 struct ustorm_eth_ag_context ustorm_ag_context
;
2171 struct timers_block_context timers_context
;
2172 struct xstorm_eth_st_context xstorm_st_context
;
2173 struct cstorm_eth_st_context cstorm_st_context
;
2180 struct eth_tx_doorbell
{
2181 #if defined(__BIG_ENDIAN)
2184 #define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
2185 #define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
2186 #define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
2187 #define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
2188 #define ETH_TX_DOORBELL_SPARE (0x1<<7)
2189 #define ETH_TX_DOORBELL_SPARE_SHIFT 7
2190 struct doorbell_hdr hdr
;
2191 #elif defined(__LITTLE_ENDIAN)
2192 struct doorbell_hdr hdr
;
2194 #define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
2195 #define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
2196 #define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
2197 #define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
2198 #define ETH_TX_DOORBELL_SPARE (0x1<<7)
2199 #define ETH_TX_DOORBELL_SPARE_SHIFT 7
2206 * cstorm default status block, generated by ustorm
2208 struct cstorm_def_status_block_u
{
2209 __le16 index_values
[HC_USTORM_DEF_SB_NUM_INDICES
];
2210 __le16 status_block_index
;
2217 * cstorm default status block, generated by cstorm
2219 struct cstorm_def_status_block_c
{
2220 __le16 index_values
[HC_CSTORM_DEF_SB_NUM_INDICES
];
2221 __le16 status_block_index
;
2228 * xstorm status block
2230 struct xstorm_def_status_block
{
2231 __le16 index_values
[HC_XSTORM_DEF_SB_NUM_INDICES
];
2232 __le16 status_block_index
;
2239 * tstorm status block
2241 struct tstorm_def_status_block
{
2242 __le16 index_values
[HC_TSTORM_DEF_SB_NUM_INDICES
];
2243 __le16 status_block_index
;
2252 struct host_def_status_block
{
2253 struct atten_def_status_block atten_status_block
;
2254 struct cstorm_def_status_block_u u_def_status_block
;
2255 struct cstorm_def_status_block_c c_def_status_block
;
2256 struct xstorm_def_status_block x_def_status_block
;
2257 struct tstorm_def_status_block t_def_status_block
;
2262 * cstorm status block, generated by ustorm
2264 struct cstorm_status_block_u
{
2265 __le16 index_values
[HC_USTORM_SB_NUM_INDICES
];
2266 __le16 status_block_index
;
2273 * cstorm status block, generated by cstorm
2275 struct cstorm_status_block_c
{
2276 __le16 index_values
[HC_CSTORM_SB_NUM_INDICES
];
2277 __le16 status_block_index
;
2286 struct host_status_block
{
2287 struct cstorm_status_block_u u_status_block
;
2288 struct cstorm_status_block_c c_status_block
;
2293 * The data for RSS setup ramrod
2295 struct eth_client_setup_ramrod_data
{
2304 * regular eth FP CQE parameters struct
2306 struct eth_fast_path_rx_cqe
{
2307 u8 type_error_flags
;
2308 #define ETH_FAST_PATH_RX_CQE_TYPE (0x1<<0)
2309 #define ETH_FAST_PATH_RX_CQE_TYPE_SHIFT 0
2310 #define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG (0x1<<1)
2311 #define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG_SHIFT 1
2312 #define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG (0x1<<2)
2313 #define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG_SHIFT 2
2314 #define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG (0x1<<3)
2315 #define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG_SHIFT 3
2316 #define ETH_FAST_PATH_RX_CQE_START_FLG (0x1<<4)
2317 #define ETH_FAST_PATH_RX_CQE_START_FLG_SHIFT 4
2318 #define ETH_FAST_PATH_RX_CQE_END_FLG (0x1<<5)
2319 #define ETH_FAST_PATH_RX_CQE_END_FLG_SHIFT 5
2320 #define ETH_FAST_PATH_RX_CQE_RESERVED0 (0x3<<6)
2321 #define ETH_FAST_PATH_RX_CQE_RESERVED0_SHIFT 6
2323 #define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE (0x7<<0)
2324 #define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE_SHIFT 0
2325 #define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG (0x1<<3)
2326 #define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG_SHIFT 3
2327 #define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG (0x1<<4)
2328 #define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG_SHIFT 4
2329 #define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG (0x1<<5)
2330 #define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG_SHIFT 5
2331 #define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG (0x1<<6)
2332 #define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG_SHIFT 6
2333 #define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG (0x1<<7)
2334 #define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7
2335 u8 placement_offset
;
2337 __le32 rss_hash_result
;
2341 struct parsing_flags pars_flags
;
2347 * The data for RSS setup ramrod
2349 struct eth_halt_ramrod_data
{
2356 * The data for statistics query ramrod
2358 struct eth_query_ramrod_data
{
2359 #if defined(__BIG_ENDIAN)
2363 #elif defined(__LITTLE_ENDIAN)
2373 * Place holder for ramrods protocol specific data
2375 struct ramrod_data
{
2381 * union for ramrod data for Ethernet protocol (CQE) (force size of 16 bits)
2383 union eth_ramrod_data
{
2384 struct ramrod_data general
;
2389 * Eth Rx Cqe structure- general structure for ramrods
2391 struct common_ramrod_eth_rx_cqe
{
2393 #define COMMON_RAMROD_ETH_RX_CQE_TYPE (0x1<<0)
2394 #define COMMON_RAMROD_ETH_RX_CQE_TYPE_SHIFT 0
2395 #define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x7F<<1)
2396 #define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 1
2399 __le32 conn_and_cmd_data
;
2400 #define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0)
2401 #define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0
2402 #define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24)
2403 #define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24
2404 struct ramrod_data protocol_data
;
2405 __le32 reserved2
[4];
2409 * Rx Last CQE in page (in ETH)
2411 struct eth_rx_cqe_next_page
{
2418 * union for all eth rx cqe types (fix their sizes)
2421 struct eth_fast_path_rx_cqe fast_path_cqe
;
2422 struct common_ramrod_eth_rx_cqe ramrod_cqe
;
2423 struct eth_rx_cqe_next_page next_page_cqe
;
2428 * common data for all protocols
2431 __le32 conn_and_cmd_data
;
2432 #define SPE_HDR_CID (0xFFFFFF<<0)
2433 #define SPE_HDR_CID_SHIFT 0
2434 #define SPE_HDR_CMD_ID (0xFF<<24)
2435 #define SPE_HDR_CMD_ID_SHIFT 24
2437 #define SPE_HDR_CONN_TYPE (0xFF<<0)
2438 #define SPE_HDR_CONN_TYPE_SHIFT 0
2439 #define SPE_HDR_COMMON_RAMROD (0xFF<<8)
2440 #define SPE_HDR_COMMON_RAMROD_SHIFT 8
2445 * Ethernet slow path element
2447 union eth_specific_data
{
2448 u8 protocol_data
[8];
2449 struct regpair mac_config_addr
;
2450 struct eth_client_setup_ramrod_data client_setup_ramrod_data
;
2451 struct eth_halt_ramrod_data halt_ramrod_data
;
2452 struct regpair leading_cqe_addr
;
2453 struct regpair update_data_addr
;
2454 struct eth_query_ramrod_data query_ramrod_data
;
2458 * Ethernet slow path element
2462 union eth_specific_data data
;
2467 * array of 13 bds as appears in the eth xstorm context
2469 struct eth_tx_bds_array
{
2470 union eth_tx_bd_types bds
[13];
2475 * Common configuration parameters per function in Tstorm
2477 struct tstorm_eth_function_common_config
{
2478 #if defined(__BIG_ENDIAN)
2479 u8 leading_client_id
;
2482 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
2483 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
2484 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
2485 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
2486 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
2487 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
2488 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
2489 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
2490 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4)
2491 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4
2492 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE (0x1<<7)
2493 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE_SHIFT 7
2494 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_IN_CAM (0x1<<8)
2495 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_IN_CAM_SHIFT 8
2496 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_E1HOV_IN_CAM (0x1<<9)
2497 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_E1HOV_IN_CAM_SHIFT 9
2498 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA (0x1<<10)
2499 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA_SHIFT 10
2500 #define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x1F<<11)
2501 #define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 11
2502 #elif defined(__LITTLE_ENDIAN)
2504 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
2505 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
2506 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
2507 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
2508 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
2509 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
2510 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
2511 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
2512 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4)
2513 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4
2514 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE (0x1<<7)
2515 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE_SHIFT 7
2516 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_IN_CAM (0x1<<8)
2517 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_IN_CAM_SHIFT 8
2518 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_E1HOV_IN_CAM (0x1<<9)
2519 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_E1HOV_IN_CAM_SHIFT 9
2520 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA (0x1<<10)
2521 #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA_SHIFT 10
2522 #define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x1F<<11)
2523 #define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 11
2525 u8 leading_client_id
;
2531 * RSS idirection table update configuration
2533 struct rss_update_config
{
2534 #if defined(__BIG_ENDIAN)
2537 #define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE (0x1<<0)
2538 #define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE_SHIFT 0
2539 #define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE (0x1<<1)
2540 #define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE_SHIFT 1
2541 #define __RSS_UPDATE_CONFIG_RESERVED0 (0x3FFF<<2)
2542 #define __RSS_UPDATE_CONFIG_RESERVED0_SHIFT 2
2543 #elif defined(__LITTLE_ENDIAN)
2545 #define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE (0x1<<0)
2546 #define RSS_UPDATE_CONFIG_ETH_UPDATE_ENABLE_SHIFT 0
2547 #define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE (0x1<<1)
2548 #define RSS_UPDATE_CONFIG_TOE_UPDATE_ENABLE_SHIFT 1
2549 #define __RSS_UPDATE_CONFIG_RESERVED0 (0x3FFF<<2)
2550 #define __RSS_UPDATE_CONFIG_RESERVED0_SHIFT 2
2557 * parameters for eth update ramrod
2559 struct eth_update_ramrod_data
{
2560 struct tstorm_eth_function_common_config func_config
;
2561 u8 indirectionTable
[128];
2562 struct rss_update_config rss_config
;
2567 * MAC filtering configuration command header
2569 struct mac_configuration_hdr
{
2577 * MAC address in list for ramrod
2579 struct tstorm_cam_entry
{
2580 __le16 lsb_mac_addr
;
2581 __le16 middle_mac_addr
;
2582 __le16 msb_mac_addr
;
2584 #define TSTORM_CAM_ENTRY_PORT_ID (0x1<<0)
2585 #define TSTORM_CAM_ENTRY_PORT_ID_SHIFT 0
2586 #define TSTORM_CAM_ENTRY_RSRVVAL0 (0x7<<1)
2587 #define TSTORM_CAM_ENTRY_RSRVVAL0_SHIFT 1
2588 #define TSTORM_CAM_ENTRY_RESERVED0 (0xFFF<<4)
2589 #define TSTORM_CAM_ENTRY_RESERVED0_SHIFT 4
2593 * MAC filtering: CAM target table entry
2595 struct tstorm_cam_target_table_entry
{
2597 #define TSTORM_CAM_TARGET_TABLE_ENTRY_BROADCAST (0x1<<0)
2598 #define TSTORM_CAM_TARGET_TABLE_ENTRY_BROADCAST_SHIFT 0
2599 #define TSTORM_CAM_TARGET_TABLE_ENTRY_OVERRIDE_VLAN_REMOVAL (0x1<<1)
2600 #define TSTORM_CAM_TARGET_TABLE_ENTRY_OVERRIDE_VLAN_REMOVAL_SHIFT 1
2601 #define TSTORM_CAM_TARGET_TABLE_ENTRY_ACTION_TYPE (0x1<<2)
2602 #define TSTORM_CAM_TARGET_TABLE_ENTRY_ACTION_TYPE_SHIFT 2
2603 #define TSTORM_CAM_TARGET_TABLE_ENTRY_RDMA_MAC (0x1<<3)
2604 #define TSTORM_CAM_TARGET_TABLE_ENTRY_RDMA_MAC_SHIFT 3
2605 #define TSTORM_CAM_TARGET_TABLE_ENTRY_RESERVED0 (0xF<<4)
2606 #define TSTORM_CAM_TARGET_TABLE_ENTRY_RESERVED0_SHIFT 4
2609 u32 clients_bit_vector
;
2613 * MAC address in list for ramrod
2615 struct mac_configuration_entry
{
2616 struct tstorm_cam_entry cam_entry
;
2617 struct tstorm_cam_target_table_entry target_table_entry
;
2621 * MAC filtering configuration command
2623 struct mac_configuration_cmd
{
2624 struct mac_configuration_hdr hdr
;
2625 struct mac_configuration_entry config_table
[64];
2630 * MAC address in list for ramrod
2632 struct mac_configuration_entry_e1h
{
2633 __le16 lsb_mac_addr
;
2634 __le16 middle_mac_addr
;
2635 __le16 msb_mac_addr
;
2640 #define MAC_CONFIGURATION_ENTRY_E1H_PORT (0x1<<0)
2641 #define MAC_CONFIGURATION_ENTRY_E1H_PORT_SHIFT 0
2642 #define MAC_CONFIGURATION_ENTRY_E1H_ACTION_TYPE (0x1<<1)
2643 #define MAC_CONFIGURATION_ENTRY_E1H_ACTION_TYPE_SHIFT 1
2644 #define MAC_CONFIGURATION_ENTRY_E1H_RDMA_MAC (0x1<<2)
2645 #define MAC_CONFIGURATION_ENTRY_E1H_RDMA_MAC_SHIFT 2
2646 #define MAC_CONFIGURATION_ENTRY_E1H_RESERVED1 (0x1F<<3)
2647 #define MAC_CONFIGURATION_ENTRY_E1H_RESERVED1_SHIFT 3
2648 u32 clients_bit_vector
;
2652 * MAC filtering configuration command
2654 struct mac_configuration_cmd_e1h
{
2655 struct mac_configuration_hdr hdr
;
2656 struct mac_configuration_entry_e1h config_table
[32];
2661 * approximate-match multicast filtering for E1H per function in Tstorm
2663 struct tstorm_eth_approximate_match_multicast_filtering
{
2664 u32 mcast_add_hash_bit_array
[8];
2669 * Configuration parameters per client in Tstorm
2671 struct tstorm_eth_client_config
{
2672 #if defined(__BIG_ENDIAN)
2674 u8 statistics_counter_id
;
2676 #elif defined(__LITTLE_ENDIAN)
2678 u8 statistics_counter_id
;
2681 #if defined(__BIG_ENDIAN)
2683 #define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR (0x1<<0)
2684 #define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR_SHIFT 0
2685 #define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR (0x1<<1)
2686 #define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR_SHIFT 1
2687 #define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0 (0x1<<2)
2688 #define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0_SHIFT 2
2689 #define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR (0x1<<3)
2690 #define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR_SHIFT 3
2691 #define __TSTORM_ETH_CLIENT_CONFIG_RESERVED2 (0xFFF<<4)
2692 #define __TSTORM_ETH_CLIENT_CONFIG_RESERVED2_SHIFT 4
2694 #define TSTORM_ETH_CLIENT_CONFIG_VLAN_REM_ENABLE (0x1<<0)
2695 #define TSTORM_ETH_CLIENT_CONFIG_VLAN_REM_ENABLE_SHIFT 0
2696 #define TSTORM_ETH_CLIENT_CONFIG_E1HOV_REM_ENABLE (0x1<<1)
2697 #define TSTORM_ETH_CLIENT_CONFIG_E1HOV_REM_ENABLE_SHIFT 1
2698 #define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE (0x1<<2)
2699 #define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE_SHIFT 2
2700 #define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1 (0x1FFF<<3)
2701 #define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1_SHIFT 3
2702 #elif defined(__LITTLE_ENDIAN)
2704 #define TSTORM_ETH_CLIENT_CONFIG_VLAN_REM_ENABLE (0x1<<0)
2705 #define TSTORM_ETH_CLIENT_CONFIG_VLAN_REM_ENABLE_SHIFT 0
2706 #define TSTORM_ETH_CLIENT_CONFIG_E1HOV_REM_ENABLE (0x1<<1)
2707 #define TSTORM_ETH_CLIENT_CONFIG_E1HOV_REM_ENABLE_SHIFT 1
2708 #define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE (0x1<<2)
2709 #define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE_SHIFT 2
2710 #define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1 (0x1FFF<<3)
2711 #define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1_SHIFT 3
2713 #define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR (0x1<<0)
2714 #define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR_SHIFT 0
2715 #define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR (0x1<<1)
2716 #define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR_SHIFT 1
2717 #define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0 (0x1<<2)
2718 #define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0_SHIFT 2
2719 #define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR (0x1<<3)
2720 #define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR_SHIFT 3
2721 #define __TSTORM_ETH_CLIENT_CONFIG_RESERVED2 (0xFFF<<4)
2722 #define __TSTORM_ETH_CLIENT_CONFIG_RESERVED2_SHIFT 4
2728 * MAC filtering configuration parameters per port in Tstorm
2730 struct tstorm_eth_mac_filter_config
{
2732 u32 ucast_accept_all
;
2734 u32 mcast_accept_all
;
2736 u32 bcast_accept_all
;
2744 * common flag to indicate existance of TPA.
2746 struct tstorm_eth_tpa_exist
{
2747 #if defined(__BIG_ENDIAN)
2751 #elif defined(__LITTLE_ENDIAN)
2761 * rx rings pause data for E1h only
2763 struct ustorm_eth_rx_pause_data_e1h
{
2764 #if defined(__BIG_ENDIAN)
2767 #elif defined(__LITTLE_ENDIAN)
2771 #if defined(__BIG_ENDIAN)
2774 #elif defined(__LITTLE_ENDIAN)
2778 #if defined(__BIG_ENDIAN)
2781 #elif defined(__LITTLE_ENDIAN)
2785 #if defined(__BIG_ENDIAN)
2788 #elif defined(__LITTLE_ENDIAN)
2796 * Three RX producers for ETH
2798 struct ustorm_eth_rx_producers
{
2799 #if defined(__BIG_ENDIAN)
2802 #elif defined(__LITTLE_ENDIAN)
2806 #if defined(__BIG_ENDIAN)
2809 #elif defined(__LITTLE_ENDIAN)
2817 * per-port SAFC demo variables
2819 struct cmng_flags_per_port
{
2820 u8 con_number
[NUM_OF_PROTOCOLS
];
2822 #define CMNG_FLAGS_PER_PORT_FAIRNESS_VN (0x1<<0)
2823 #define CMNG_FLAGS_PER_PORT_FAIRNESS_VN_SHIFT 0
2824 #define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN (0x1<<1)
2825 #define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN_SHIFT 1
2826 #define CMNG_FLAGS_PER_PORT_FAIRNESS_PROTOCOL (0x1<<2)
2827 #define CMNG_FLAGS_PER_PORT_FAIRNESS_PROTOCOL_SHIFT 2
2828 #define CMNG_FLAGS_PER_PORT_RATE_SHAPING_PROTOCOL (0x1<<3)
2829 #define CMNG_FLAGS_PER_PORT_RATE_SHAPING_PROTOCOL_SHIFT 3
2830 #define CMNG_FLAGS_PER_PORT_FAIRNESS_COS (0x1<<4)
2831 #define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_SHIFT 4
2832 #define __CMNG_FLAGS_PER_PORT_RESERVED0 (0x7FFFFFF<<5)
2833 #define __CMNG_FLAGS_PER_PORT_RESERVED0_SHIFT 5
2838 * per-port rate shaping variables
2840 struct rate_shaping_vars_per_port
{
2841 u32 rs_periodic_timeout
;
2846 * per-port fairness variables
2848 struct fairness_vars_per_port
{
2851 u32 fairness_timeout
;
2855 * per-port SAFC variables
2857 struct safc_struct_per_port
{
2858 #if defined(__BIG_ENDIAN)
2861 u8 safc_timeout_usec
;
2862 #elif defined(__LITTLE_ENDIAN)
2863 u8 safc_timeout_usec
;
2867 u16 cos_to_pause_mask
[NUM_OF_SAFC_BITS
];
2871 * Per-port congestion management variables
2873 struct cmng_struct_per_port
{
2874 struct rate_shaping_vars_per_port rs_vars
;
2875 struct fairness_vars_per_port fair_vars
;
2876 struct safc_struct_per_port safc_vars
;
2877 struct cmng_flags_per_port flags
;
2882 * Dynamic host coalescing init parameters
2884 struct dynamic_hc_config
{
2886 u8 shift_per_protocol
[HC_USTORM_SB_NUM_INDICES
];
2887 u8 hc_timeout0
[HC_USTORM_SB_NUM_INDICES
];
2888 u8 hc_timeout1
[HC_USTORM_SB_NUM_INDICES
];
2889 u8 hc_timeout2
[HC_USTORM_SB_NUM_INDICES
];
2890 u8 hc_timeout3
[HC_USTORM_SB_NUM_INDICES
];
2895 * Protocol-common statistics collected by the Xstorm (per client)
2897 struct xstorm_per_client_stats
{
2899 __le32 unicast_pkts_sent
;
2900 struct regpair unicast_bytes_sent
;
2901 struct regpair multicast_bytes_sent
;
2902 __le32 multicast_pkts_sent
;
2903 __le32 broadcast_pkts_sent
;
2904 struct regpair broadcast_bytes_sent
;
2905 __le16 stats_counter
;
2911 * Common statistics collected by the Xstorm (per port)
2913 struct xstorm_common_stats
{
2914 struct xstorm_per_client_stats client_statistics
[MAX_X_STAT_COUNTER_ID
];
2918 * Protocol-common statistics collected by the Tstorm (per port)
2920 struct tstorm_per_port_stats
{
2921 __le32 mac_filter_discard
;
2922 __le32 xxoverflow_discard
;
2923 __le32 brb_truncate_discard
;
2928 * Protocol-common statistics collected by the Tstorm (per client)
2930 struct tstorm_per_client_stats
{
2931 struct regpair rcv_unicast_bytes
;
2932 struct regpair rcv_broadcast_bytes
;
2933 struct regpair rcv_multicast_bytes
;
2934 struct regpair rcv_error_bytes
;
2935 __le32 checksum_discard
;
2936 __le32 packets_too_big_discard
;
2937 __le32 rcv_unicast_pkts
;
2938 __le32 rcv_broadcast_pkts
;
2939 __le32 rcv_multicast_pkts
;
2940 __le32 no_buff_discard
;
2941 __le32 ttl0_discard
;
2942 __le16 stats_counter
;
2947 * Protocol-common statistics collected by the Tstorm
2949 struct tstorm_common_stats
{
2950 struct tstorm_per_port_stats port_statistics
;
2951 struct tstorm_per_client_stats client_statistics
[MAX_T_STAT_COUNTER_ID
];
2955 * Protocol-common statistics collected by the Ustorm (per client)
2957 struct ustorm_per_client_stats
{
2958 struct regpair ucast_no_buff_bytes
;
2959 struct regpair mcast_no_buff_bytes
;
2960 struct regpair bcast_no_buff_bytes
;
2961 __le32 ucast_no_buff_pkts
;
2962 __le32 mcast_no_buff_pkts
;
2963 __le32 bcast_no_buff_pkts
;
2964 __le16 stats_counter
;
2969 * Protocol-common statistics collected by the Ustorm
2971 struct ustorm_common_stats
{
2972 struct ustorm_per_client_stats client_statistics
[MAX_U_STAT_COUNTER_ID
];
2976 * Eth statistics query structure for the eth_stats_query ramrod
2978 struct eth_stats_query
{
2979 struct xstorm_common_stats xstorm_common
;
2980 struct tstorm_common_stats tstorm_common
;
2981 struct ustorm_common_stats ustorm_common
;
2986 * per-vnic fairness variables
2988 struct fairness_vars_per_vn
{
2989 u32 cos_credit_delta
[MAX_COS_NUMBER
];
2990 u32 protocol_credit_delta
[NUM_OF_PROTOCOLS
];
2991 u32 vn_credit_delta
;
2997 * FW version stored in the Xstorm RAM
3000 #if defined(__BIG_ENDIAN)
3005 #elif defined(__LITTLE_ENDIAN)
3012 #define FW_VERSION_OPTIMIZED (0x1<<0)
3013 #define FW_VERSION_OPTIMIZED_SHIFT 0
3014 #define FW_VERSION_BIG_ENDIEN (0x1<<1)
3015 #define FW_VERSION_BIG_ENDIEN_SHIFT 1
3016 #define FW_VERSION_CHIP_VERSION (0x3<<2)
3017 #define FW_VERSION_CHIP_VERSION_SHIFT 2
3018 #define __FW_VERSION_RESERVED (0xFFFFFFF<<4)
3019 #define __FW_VERSION_RESERVED_SHIFT 4
3024 * FW version stored in first line of pram
3026 struct pram_fw_version
{
3032 #define PRAM_FW_VERSION_OPTIMIZED (0x1<<0)
3033 #define PRAM_FW_VERSION_OPTIMIZED_SHIFT 0
3034 #define PRAM_FW_VERSION_STORM_ID (0x3<<1)
3035 #define PRAM_FW_VERSION_STORM_ID_SHIFT 1
3036 #define PRAM_FW_VERSION_BIG_ENDIEN (0x1<<3)
3037 #define PRAM_FW_VERSION_BIG_ENDIEN_SHIFT 3
3038 #define PRAM_FW_VERSION_CHIP_VERSION (0x3<<4)
3039 #define PRAM_FW_VERSION_CHIP_VERSION_SHIFT 4
3040 #define __PRAM_FW_VERSION_RESERVED0 (0x3<<6)
3041 #define __PRAM_FW_VERSION_RESERVED0_SHIFT 6
3046 * The send queue element
3048 struct protocol_common_spe
{
3050 struct regpair phy_address
;
3055 * a single rate shaping counter. can be used as protocol or vnic counter
3057 struct rate_shaping_counter
{
3059 #if defined(__BIG_ENDIAN)
3062 #elif defined(__LITTLE_ENDIAN)
3070 * per-vnic rate shaping variables
3072 struct rate_shaping_vars_per_vn
{
3073 struct rate_shaping_counter protocol_counters
[NUM_OF_PROTOCOLS
];
3074 struct rate_shaping_counter vn_counter
;
3079 * The send queue element
3081 struct slow_path_element
{
3083 u8 protocol_data
[8];
3088 * eth/toe flags that indicate if to query
3090 struct stats_indication_flags
{