Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1 | /* bnx2x_hsi.h: Broadcom Everest network driver. |
| 2 | * |
Ariel Elior | 85b26ea | 2012-01-26 06:01:54 +0000 | [diff] [blame] | 3 | * Copyright (c) 2007-2012 Broadcom Corporation |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4 | * |
| 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 Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 9 | #ifndef BNX2X_HSI_H |
| 10 | #define BNX2X_HSI_H |
| 11 | |
| 12 | #include "bnx2x_fw_defs.h" |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 13 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 14 | #define FW_ENCODE_32BIT_PATTERN 0x1e1e1e1e |
Vladislav Zolotarov | 2ba4514 | 2011-01-31 14:39:17 +0000 | [diff] [blame] | 15 | |
Michael Chan | e251306 | 2009-10-10 13:46:58 +0000 | [diff] [blame] | 16 | struct license_key { |
| 17 | u32 reserved[6]; |
| 18 | |
Vladislav Zolotarov | 2ba4514 | 2011-01-31 14:39:17 +0000 | [diff] [blame] | 19 | 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 Chan | e251306 | 2009-10-10 13:46:58 +0000 | [diff] [blame] | 24 | |
Vladislav Zolotarov | 2ba4514 | 2011-01-31 14:39:17 +0000 | [diff] [blame] | 25 | 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 Chan | e251306 | 2009-10-10 13:46:58 +0000 | [diff] [blame] | 34 | }; |
| 35 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 36 | |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 37 | #define PORT_0 0 |
| 38 | #define PORT_1 1 |
| 39 | #define PORT_MAX 2 |
| 40 | #define NVM_PATH_MAX 2 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 41 | |
| 42 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 43 | * Shared HW configuration * |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 44 | ****************************************************************************/ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 45 | #define PIN_CFG_NA 0x00000000 |
| 46 | #define PIN_CFG_GPIO0_P0 0x00000001 |
| 47 | #define PIN_CFG_GPIO1_P0 0x00000002 |
| 48 | #define PIN_CFG_GPIO2_P0 0x00000003 |
| 49 | #define PIN_CFG_GPIO3_P0 0x00000004 |
| 50 | #define PIN_CFG_GPIO0_P1 0x00000005 |
| 51 | #define PIN_CFG_GPIO1_P1 0x00000006 |
| 52 | #define PIN_CFG_GPIO2_P1 0x00000007 |
| 53 | #define PIN_CFG_GPIO3_P1 0x00000008 |
| 54 | #define PIN_CFG_EPIO0 0x00000009 |
| 55 | #define PIN_CFG_EPIO1 0x0000000a |
| 56 | #define PIN_CFG_EPIO2 0x0000000b |
| 57 | #define PIN_CFG_EPIO3 0x0000000c |
| 58 | #define PIN_CFG_EPIO4 0x0000000d |
| 59 | #define PIN_CFG_EPIO5 0x0000000e |
| 60 | #define PIN_CFG_EPIO6 0x0000000f |
| 61 | #define PIN_CFG_EPIO7 0x00000010 |
| 62 | #define PIN_CFG_EPIO8 0x00000011 |
| 63 | #define PIN_CFG_EPIO9 0x00000012 |
| 64 | #define PIN_CFG_EPIO10 0x00000013 |
| 65 | #define PIN_CFG_EPIO11 0x00000014 |
| 66 | #define PIN_CFG_EPIO12 0x00000015 |
| 67 | #define PIN_CFG_EPIO13 0x00000016 |
| 68 | #define PIN_CFG_EPIO14 0x00000017 |
| 69 | #define PIN_CFG_EPIO15 0x00000018 |
| 70 | #define PIN_CFG_EPIO16 0x00000019 |
| 71 | #define PIN_CFG_EPIO17 0x0000001a |
| 72 | #define PIN_CFG_EPIO18 0x0000001b |
| 73 | #define PIN_CFG_EPIO19 0x0000001c |
| 74 | #define PIN_CFG_EPIO20 0x0000001d |
| 75 | #define PIN_CFG_EPIO21 0x0000001e |
| 76 | #define PIN_CFG_EPIO22 0x0000001f |
| 77 | #define PIN_CFG_EPIO23 0x00000020 |
| 78 | #define PIN_CFG_EPIO24 0x00000021 |
| 79 | #define PIN_CFG_EPIO25 0x00000022 |
| 80 | #define PIN_CFG_EPIO26 0x00000023 |
| 81 | #define PIN_CFG_EPIO27 0x00000024 |
| 82 | #define PIN_CFG_EPIO28 0x00000025 |
| 83 | #define PIN_CFG_EPIO29 0x00000026 |
| 84 | #define PIN_CFG_EPIO30 0x00000027 |
| 85 | #define PIN_CFG_EPIO31 0x00000028 |
| 86 | |
| 87 | /* EPIO definition */ |
| 88 | #define EPIO_CFG_NA 0x00000000 |
| 89 | #define EPIO_CFG_EPIO0 0x00000001 |
| 90 | #define EPIO_CFG_EPIO1 0x00000002 |
| 91 | #define EPIO_CFG_EPIO2 0x00000003 |
| 92 | #define EPIO_CFG_EPIO3 0x00000004 |
| 93 | #define EPIO_CFG_EPIO4 0x00000005 |
| 94 | #define EPIO_CFG_EPIO5 0x00000006 |
| 95 | #define EPIO_CFG_EPIO6 0x00000007 |
| 96 | #define EPIO_CFG_EPIO7 0x00000008 |
| 97 | #define EPIO_CFG_EPIO8 0x00000009 |
| 98 | #define EPIO_CFG_EPIO9 0x0000000a |
| 99 | #define EPIO_CFG_EPIO10 0x0000000b |
| 100 | #define EPIO_CFG_EPIO11 0x0000000c |
| 101 | #define EPIO_CFG_EPIO12 0x0000000d |
| 102 | #define EPIO_CFG_EPIO13 0x0000000e |
| 103 | #define EPIO_CFG_EPIO14 0x0000000f |
| 104 | #define EPIO_CFG_EPIO15 0x00000010 |
| 105 | #define EPIO_CFG_EPIO16 0x00000011 |
| 106 | #define EPIO_CFG_EPIO17 0x00000012 |
| 107 | #define EPIO_CFG_EPIO18 0x00000013 |
| 108 | #define EPIO_CFG_EPIO19 0x00000014 |
| 109 | #define EPIO_CFG_EPIO20 0x00000015 |
| 110 | #define EPIO_CFG_EPIO21 0x00000016 |
| 111 | #define EPIO_CFG_EPIO22 0x00000017 |
| 112 | #define EPIO_CFG_EPIO23 0x00000018 |
| 113 | #define EPIO_CFG_EPIO24 0x00000019 |
| 114 | #define EPIO_CFG_EPIO25 0x0000001a |
| 115 | #define EPIO_CFG_EPIO26 0x0000001b |
| 116 | #define EPIO_CFG_EPIO27 0x0000001c |
| 117 | #define EPIO_CFG_EPIO28 0x0000001d |
| 118 | #define EPIO_CFG_EPIO29 0x0000001e |
| 119 | #define EPIO_CFG_EPIO30 0x0000001f |
| 120 | #define EPIO_CFG_EPIO31 0x00000020 |
| 121 | |
| 122 | |
| 123 | struct shared_hw_cfg { /* NVRAM Offset */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 124 | /* Up to 16 bytes of NULL-terminated string */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 125 | u8 part_num[16]; /* 0x104 */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 126 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 127 | u32 config; /* 0x114 */ |
| 128 | #define SHARED_HW_CFG_MDIO_VOLTAGE_MASK 0x00000001 |
| 129 | #define SHARED_HW_CFG_MDIO_VOLTAGE_SHIFT 0 |
| 130 | #define SHARED_HW_CFG_MDIO_VOLTAGE_1_2V 0x00000000 |
| 131 | #define SHARED_HW_CFG_MDIO_VOLTAGE_2_5V 0x00000001 |
| 132 | #define SHARED_HW_CFG_MCP_RST_ON_CORE_RST_EN 0x00000002 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 133 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 134 | #define SHARED_HW_CFG_PORT_SWAP 0x00000004 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 135 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 136 | #define SHARED_HW_CFG_BEACON_WOL_EN 0x00000008 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 137 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 138 | #define SHARED_HW_CFG_PCIE_GEN3_DISABLED 0x00000000 |
| 139 | #define SHARED_HW_CFG_PCIE_GEN3_ENABLED 0x00000010 |
| 140 | |
| 141 | #define SHARED_HW_CFG_MFW_SELECT_MASK 0x00000700 |
| 142 | #define SHARED_HW_CFG_MFW_SELECT_SHIFT 8 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 143 | /* Whatever MFW found in NVM |
| 144 | (if multiple found, priority order is: NC-SI, UMP, IPMI) */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 145 | #define SHARED_HW_CFG_MFW_SELECT_DEFAULT 0x00000000 |
| 146 | #define SHARED_HW_CFG_MFW_SELECT_NC_SI 0x00000100 |
| 147 | #define SHARED_HW_CFG_MFW_SELECT_UMP 0x00000200 |
| 148 | #define SHARED_HW_CFG_MFW_SELECT_IPMI 0x00000300 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 149 | /* Use SPIO4 as an arbiter between: 0-NC_SI, 1-IPMI |
| 150 | (can only be used when an add-in board, not BMC, pulls-down SPIO4) */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 151 | #define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_IPMI 0x00000400 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 152 | /* Use SPIO4 as an arbiter between: 0-UMP, 1-IPMI |
| 153 | (can only be used when an add-in board, not BMC, pulls-down SPIO4) */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 154 | #define SHARED_HW_CFG_MFW_SELECT_SPIO4_UMP_IPMI 0x00000500 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 155 | /* Use SPIO4 as an arbiter between: 0-NC-SI, 1-UMP |
| 156 | (can only be used when an add-in board, not BMC, pulls-down SPIO4) */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 157 | #define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_UMP 0x00000600 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 158 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 159 | #define SHARED_HW_CFG_LED_MODE_MASK 0x000f0000 |
| 160 | #define SHARED_HW_CFG_LED_MODE_SHIFT 16 |
| 161 | #define SHARED_HW_CFG_LED_MAC1 0x00000000 |
| 162 | #define SHARED_HW_CFG_LED_PHY1 0x00010000 |
| 163 | #define SHARED_HW_CFG_LED_PHY2 0x00020000 |
| 164 | #define SHARED_HW_CFG_LED_PHY3 0x00030000 |
| 165 | #define SHARED_HW_CFG_LED_MAC2 0x00040000 |
| 166 | #define SHARED_HW_CFG_LED_PHY4 0x00050000 |
| 167 | #define SHARED_HW_CFG_LED_PHY5 0x00060000 |
| 168 | #define SHARED_HW_CFG_LED_PHY6 0x00070000 |
| 169 | #define SHARED_HW_CFG_LED_MAC3 0x00080000 |
| 170 | #define SHARED_HW_CFG_LED_PHY7 0x00090000 |
| 171 | #define SHARED_HW_CFG_LED_PHY9 0x000a0000 |
| 172 | #define SHARED_HW_CFG_LED_PHY11 0x000b0000 |
| 173 | #define SHARED_HW_CFG_LED_MAC4 0x000c0000 |
| 174 | #define SHARED_HW_CFG_LED_PHY8 0x000d0000 |
| 175 | #define SHARED_HW_CFG_LED_EXTPHY1 0x000e0000 |
Yaniv Rosner | 7f02c4a | 2010-09-07 11:41:23 +0000 | [diff] [blame] | 176 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 177 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 178 | #define SHARED_HW_CFG_AN_ENABLE_MASK 0x3f000000 |
| 179 | #define SHARED_HW_CFG_AN_ENABLE_SHIFT 24 |
| 180 | #define SHARED_HW_CFG_AN_ENABLE_CL37 0x01000000 |
| 181 | #define SHARED_HW_CFG_AN_ENABLE_CL73 0x02000000 |
| 182 | #define SHARED_HW_CFG_AN_ENABLE_BAM 0x04000000 |
| 183 | #define SHARED_HW_CFG_AN_ENABLE_PARALLEL_DETECTION 0x08000000 |
| 184 | #define SHARED_HW_CFG_AN_EN_SGMII_FIBER_AUTO_DETECT 0x10000000 |
| 185 | #define SHARED_HW_CFG_AN_ENABLE_REMOTE_PHY 0x20000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 186 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 187 | #define SHARED_HW_CFG_SRIOV_MASK 0x40000000 |
| 188 | #define SHARED_HW_CFG_SRIOV_DISABLED 0x00000000 |
| 189 | #define SHARED_HW_CFG_SRIOV_ENABLED 0x40000000 |
| 190 | |
| 191 | #define SHARED_HW_CFG_ATC_MASK 0x80000000 |
| 192 | #define SHARED_HW_CFG_ATC_DISABLED 0x00000000 |
| 193 | #define SHARED_HW_CFG_ATC_ENABLED 0x80000000 |
| 194 | |
| 195 | u32 config2; /* 0x118 */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 196 | /* one time auto detect grace period (in sec) */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 197 | #define SHARED_HW_CFG_GRACE_PERIOD_MASK 0x000000ff |
| 198 | #define SHARED_HW_CFG_GRACE_PERIOD_SHIFT 0 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 199 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 200 | #define SHARED_HW_CFG_PCIE_GEN2_ENABLED 0x00000100 |
| 201 | #define SHARED_HW_CFG_PCIE_GEN2_DISABLED 0x00000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 202 | |
| 203 | /* The default value for the core clock is 250MHz and it is |
| 204 | achieved by setting the clock change to 4 */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 205 | #define SHARED_HW_CFG_CLOCK_CHANGE_MASK 0x00000e00 |
| 206 | #define SHARED_HW_CFG_CLOCK_CHANGE_SHIFT 9 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 207 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 208 | #define SHARED_HW_CFG_SMBUS_TIMING_MASK 0x00001000 |
| 209 | #define SHARED_HW_CFG_SMBUS_TIMING_100KHZ 0x00000000 |
| 210 | #define SHARED_HW_CFG_SMBUS_TIMING_400KHZ 0x00001000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 211 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 212 | #define SHARED_HW_CFG_HIDE_PORT1 0x00002000 |
| 213 | |
| 214 | #define SHARED_HW_CFG_WOL_CAPABLE_MASK 0x00004000 |
| 215 | #define SHARED_HW_CFG_WOL_CAPABLE_DISABLED 0x00000000 |
| 216 | #define SHARED_HW_CFG_WOL_CAPABLE_ENABLED 0x00004000 |
| 217 | |
| 218 | /* Output low when PERST is asserted */ |
| 219 | #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_MASK 0x00008000 |
| 220 | #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_DISABLED 0x00000000 |
| 221 | #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_ENABLED 0x00008000 |
| 222 | |
| 223 | #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_MASK 0x00070000 |
| 224 | #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_SHIFT 16 |
| 225 | #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_HW 0x00000000 |
| 226 | #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_0DB 0x00010000 |
| 227 | #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_3_5DB 0x00020000 |
| 228 | #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_6_0DB 0x00030000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 229 | |
Eilon Greenstein | fd4ef40 | 2009-07-21 05:47:27 +0000 | [diff] [blame] | 230 | /* The fan failure mechanism is usually related to the PHY type |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 231 | since the power consumption of the board is determined by the PHY. |
| 232 | Currently, fan is required for most designs with SFX7101, BCM8727 |
| 233 | and BCM8481. If a fan is not required for a board which uses one |
| 234 | of those PHYs, this field should be set to "Disabled". If a fan is |
| 235 | required for a different PHY type, this option should be set to |
| 236 | "Enabled". The fan failure indication is expected on SPIO5 */ |
| 237 | #define SHARED_HW_CFG_FAN_FAILURE_MASK 0x00180000 |
| 238 | #define SHARED_HW_CFG_FAN_FAILURE_SHIFT 19 |
| 239 | #define SHARED_HW_CFG_FAN_FAILURE_PHY_TYPE 0x00000000 |
| 240 | #define SHARED_HW_CFG_FAN_FAILURE_DISABLED 0x00080000 |
| 241 | #define SHARED_HW_CFG_FAN_FAILURE_ENABLED 0x00100000 |
Eilon Greenstein | fd4ef40 | 2009-07-21 05:47:27 +0000 | [diff] [blame] | 242 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 243 | /* ASPM Power Management support */ |
| 244 | #define SHARED_HW_CFG_ASPM_SUPPORT_MASK 0x00600000 |
| 245 | #define SHARED_HW_CFG_ASPM_SUPPORT_SHIFT 21 |
| 246 | #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_L1_ENABLED 0x00000000 |
| 247 | #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_DISABLED 0x00200000 |
| 248 | #define SHARED_HW_CFG_ASPM_SUPPORT_L1_DISABLED 0x00400000 |
| 249 | #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_L1_DISABLED 0x00600000 |
Yaniv Rosner | e10bc84 | 2010-09-07 11:40:50 +0000 | [diff] [blame] | 250 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 251 | /* The value of PM_TL_IGNORE_REQS (bit0) in PCI register |
| 252 | tl_control_0 (register 0x2800) */ |
| 253 | #define SHARED_HW_CFG_PREVENT_L1_ENTRY_MASK 0x00800000 |
| 254 | #define SHARED_HW_CFG_PREVENT_L1_ENTRY_DISABLED 0x00000000 |
| 255 | #define SHARED_HW_CFG_PREVENT_L1_ENTRY_ENABLED 0x00800000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 256 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 257 | #define SHARED_HW_CFG_PORT_MODE_MASK 0x01000000 |
| 258 | #define SHARED_HW_CFG_PORT_MODE_2 0x00000000 |
| 259 | #define SHARED_HW_CFG_PORT_MODE_4 0x01000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 260 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 261 | #define SHARED_HW_CFG_PATH_SWAP_MASK 0x02000000 |
| 262 | #define SHARED_HW_CFG_PATH_SWAP_DISABLED 0x00000000 |
| 263 | #define SHARED_HW_CFG_PATH_SWAP_ENABLED 0x02000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 264 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 265 | /* Set the MDC/MDIO access for the first external phy */ |
| 266 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_MASK 0x1C000000 |
| 267 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SHIFT 26 |
| 268 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_PHY_TYPE 0x00000000 |
| 269 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC0 0x04000000 |
| 270 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC1 0x08000000 |
| 271 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_BOTH 0x0c000000 |
| 272 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SWAPPED 0x10000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 273 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 274 | /* Set the MDC/MDIO access for the second external phy */ |
| 275 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_MASK 0xE0000000 |
| 276 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SHIFT 29 |
| 277 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_PHY_TYPE 0x00000000 |
| 278 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC0 0x20000000 |
| 279 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC1 0x40000000 |
| 280 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_BOTH 0x60000000 |
| 281 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SWAPPED 0x80000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 282 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 283 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 284 | u32 power_dissipated; /* 0x11c */ |
| 285 | #define SHARED_HW_CFG_POWER_MGNT_SCALE_MASK 0x00ff0000 |
| 286 | #define SHARED_HW_CFG_POWER_MGNT_SCALE_SHIFT 16 |
| 287 | #define SHARED_HW_CFG_POWER_MGNT_UNKNOWN_SCALE 0x00000000 |
| 288 | #define SHARED_HW_CFG_POWER_MGNT_DOT_1_WATT 0x00010000 |
| 289 | #define SHARED_HW_CFG_POWER_MGNT_DOT_01_WATT 0x00020000 |
| 290 | #define SHARED_HW_CFG_POWER_MGNT_DOT_001_WATT 0x00030000 |
Eilon Greenstein | 35b19ba | 2009-02-12 08:36:47 +0000 | [diff] [blame] | 291 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 292 | #define SHARED_HW_CFG_POWER_DIS_CMN_MASK 0xff000000 |
| 293 | #define SHARED_HW_CFG_POWER_DIS_CMN_SHIFT 24 |
Eilon Greenstein | 35b19ba | 2009-02-12 08:36:47 +0000 | [diff] [blame] | 294 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 295 | u32 ump_nc_si_config; /* 0x120 */ |
| 296 | #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MASK 0x00000003 |
| 297 | #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_SHIFT 0 |
| 298 | #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MAC 0x00000000 |
| 299 | #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_PHY 0x00000001 |
| 300 | #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MII 0x00000000 |
| 301 | #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_RMII 0x00000002 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 302 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 303 | #define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_MASK 0x00000f00 |
| 304 | #define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_SHIFT 8 |
| 305 | |
| 306 | #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_MASK 0x00ff0000 |
| 307 | #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_SHIFT 16 |
| 308 | #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_NONE 0x00000000 |
| 309 | #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_BCM5221 0x00010000 |
| 310 | |
| 311 | u32 board; /* 0x124 */ |
| 312 | #define SHARED_HW_CFG_E3_I2C_MUX0_MASK 0x0000003F |
| 313 | #define SHARED_HW_CFG_E3_I2C_MUX0_SHIFT 0 |
| 314 | #define SHARED_HW_CFG_E3_I2C_MUX1_MASK 0x00000FC0 |
| 315 | #define SHARED_HW_CFG_E3_I2C_MUX1_SHIFT 6 |
| 316 | /* Use the PIN_CFG_XXX defines on top */ |
| 317 | #define SHARED_HW_CFG_BOARD_REV_MASK 0x00ff0000 |
| 318 | #define SHARED_HW_CFG_BOARD_REV_SHIFT 16 |
| 319 | |
| 320 | #define SHARED_HW_CFG_BOARD_MAJOR_VER_MASK 0x0f000000 |
| 321 | #define SHARED_HW_CFG_BOARD_MAJOR_VER_SHIFT 24 |
| 322 | |
| 323 | #define SHARED_HW_CFG_BOARD_MINOR_VER_MASK 0xf0000000 |
| 324 | #define SHARED_HW_CFG_BOARD_MINOR_VER_SHIFT 28 |
| 325 | |
| 326 | u32 wc_lane_config; /* 0x128 */ |
| 327 | #define SHARED_HW_CFG_LANE_SWAP_CFG_MASK 0x0000FFFF |
| 328 | #define SHARED_HW_CFG_LANE_SWAP_CFG_SHIFT 0 |
| 329 | #define SHARED_HW_CFG_LANE_SWAP_CFG_32103210 0x00001b1b |
| 330 | #define SHARED_HW_CFG_LANE_SWAP_CFG_32100123 0x00001be4 |
| 331 | #define SHARED_HW_CFG_LANE_SWAP_CFG_01233210 0x0000e41b |
| 332 | #define SHARED_HW_CFG_LANE_SWAP_CFG_01230123 0x0000e4e4 |
| 333 | #define SHARED_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000FF |
| 334 | #define SHARED_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0 |
| 335 | #define SHARED_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000FF00 |
| 336 | #define SHARED_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8 |
| 337 | |
| 338 | /* TX lane Polarity swap */ |
| 339 | #define SHARED_HW_CFG_TX_LANE0_POL_FLIP_ENABLED 0x00010000 |
| 340 | #define SHARED_HW_CFG_TX_LANE1_POL_FLIP_ENABLED 0x00020000 |
| 341 | #define SHARED_HW_CFG_TX_LANE2_POL_FLIP_ENABLED 0x00040000 |
| 342 | #define SHARED_HW_CFG_TX_LANE3_POL_FLIP_ENABLED 0x00080000 |
| 343 | /* TX lane Polarity swap */ |
| 344 | #define SHARED_HW_CFG_RX_LANE0_POL_FLIP_ENABLED 0x00100000 |
| 345 | #define SHARED_HW_CFG_RX_LANE1_POL_FLIP_ENABLED 0x00200000 |
| 346 | #define SHARED_HW_CFG_RX_LANE2_POL_FLIP_ENABLED 0x00400000 |
| 347 | #define SHARED_HW_CFG_RX_LANE3_POL_FLIP_ENABLED 0x00800000 |
| 348 | |
| 349 | /* Selects the port layout of the board */ |
| 350 | #define SHARED_HW_CFG_E3_PORT_LAYOUT_MASK 0x0F000000 |
| 351 | #define SHARED_HW_CFG_E3_PORT_LAYOUT_SHIFT 24 |
| 352 | #define SHARED_HW_CFG_E3_PORT_LAYOUT_2P_01 0x00000000 |
| 353 | #define SHARED_HW_CFG_E3_PORT_LAYOUT_2P_10 0x01000000 |
| 354 | #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_0123 0x02000000 |
| 355 | #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_1032 0x03000000 |
| 356 | #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_2301 0x04000000 |
| 357 | #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_3210 0x05000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 358 | }; |
| 359 | |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 360 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 361 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 362 | * Port HW configuration * |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 363 | ****************************************************************************/ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 364 | struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 365 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 366 | u32 pci_id; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 367 | #define PORT_HW_CFG_PCI_VENDOR_ID_MASK 0xffff0000 |
| 368 | #define PORT_HW_CFG_PCI_DEVICE_ID_MASK 0x0000ffff |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 369 | |
| 370 | u32 pci_sub_id; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 371 | #define PORT_HW_CFG_PCI_SUBSYS_DEVICE_ID_MASK 0xffff0000 |
| 372 | #define PORT_HW_CFG_PCI_SUBSYS_VENDOR_ID_MASK 0x0000ffff |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 373 | |
| 374 | u32 power_dissipated; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 375 | #define PORT_HW_CFG_POWER_DIS_D0_MASK 0x000000ff |
| 376 | #define PORT_HW_CFG_POWER_DIS_D0_SHIFT 0 |
| 377 | #define PORT_HW_CFG_POWER_DIS_D1_MASK 0x0000ff00 |
| 378 | #define PORT_HW_CFG_POWER_DIS_D1_SHIFT 8 |
| 379 | #define PORT_HW_CFG_POWER_DIS_D2_MASK 0x00ff0000 |
| 380 | #define PORT_HW_CFG_POWER_DIS_D2_SHIFT 16 |
| 381 | #define PORT_HW_CFG_POWER_DIS_D3_MASK 0xff000000 |
| 382 | #define PORT_HW_CFG_POWER_DIS_D3_SHIFT 24 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 383 | |
| 384 | u32 power_consumed; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 385 | #define PORT_HW_CFG_POWER_CONS_D0_MASK 0x000000ff |
| 386 | #define PORT_HW_CFG_POWER_CONS_D0_SHIFT 0 |
| 387 | #define PORT_HW_CFG_POWER_CONS_D1_MASK 0x0000ff00 |
| 388 | #define PORT_HW_CFG_POWER_CONS_D1_SHIFT 8 |
| 389 | #define PORT_HW_CFG_POWER_CONS_D2_MASK 0x00ff0000 |
| 390 | #define PORT_HW_CFG_POWER_CONS_D2_SHIFT 16 |
| 391 | #define PORT_HW_CFG_POWER_CONS_D3_MASK 0xff000000 |
| 392 | #define PORT_HW_CFG_POWER_CONS_D3_SHIFT 24 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 393 | |
| 394 | u32 mac_upper; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 395 | #define PORT_HW_CFG_UPPERMAC_MASK 0x0000ffff |
| 396 | #define PORT_HW_CFG_UPPERMAC_SHIFT 0 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 397 | u32 mac_lower; |
| 398 | |
| 399 | u32 iscsi_mac_upper; /* Upper 16 bits are always zeroes */ |
| 400 | u32 iscsi_mac_lower; |
| 401 | |
| 402 | u32 rdma_mac_upper; /* Upper 16 bits are always zeroes */ |
| 403 | u32 rdma_mac_lower; |
| 404 | |
| 405 | u32 serdes_config; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 406 | #define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_MASK 0x0000ffff |
| 407 | #define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_SHIFT 0 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 408 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 409 | #define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_MASK 0xffff0000 |
| 410 | #define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_SHIFT 16 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 411 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 412 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 413 | /* Default values: 2P-64, 4P-32 */ |
| 414 | u32 pf_config; /* 0x158 */ |
| 415 | #define PORT_HW_CFG_PF_NUM_VF_MASK 0x0000007F |
| 416 | #define PORT_HW_CFG_PF_NUM_VF_SHIFT 0 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 417 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 418 | /* Default values: 17 */ |
| 419 | #define PORT_HW_CFG_PF_NUM_MSIX_VECTORS_MASK 0x00007F00 |
| 420 | #define PORT_HW_CFG_PF_NUM_MSIX_VECTORS_SHIFT 8 |
Yaniv Rosner | 020c7e3 | 2011-05-31 21:28:43 +0000 | [diff] [blame] | 421 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 422 | #define PORT_HW_CFG_ENABLE_FLR_MASK 0x00010000 |
| 423 | #define PORT_HW_CFG_FLR_ENABLED 0x00010000 |
Yaniv Rosner | 020c7e3 | 2011-05-31 21:28:43 +0000 | [diff] [blame] | 424 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 425 | u32 vf_config; /* 0x15C */ |
| 426 | #define PORT_HW_CFG_VF_NUM_MSIX_VECTORS_MASK 0x0000007F |
| 427 | #define PORT_HW_CFG_VF_NUM_MSIX_VECTORS_SHIFT 0 |
Yaniv Rosner | 1ac9e42 | 2011-05-31 21:26:11 +0000 | [diff] [blame] | 428 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 429 | #define PORT_HW_CFG_VF_PCI_DEVICE_ID_MASK 0xFFFF0000 |
| 430 | #define PORT_HW_CFG_VF_PCI_DEVICE_ID_SHIFT 16 |
Yaniv Rosner | 1ac9e42 | 2011-05-31 21:26:11 +0000 | [diff] [blame] | 431 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 432 | u32 mf_pci_id; /* 0x160 */ |
| 433 | #define PORT_HW_CFG_MF_PCI_DEVICE_ID_MASK 0x0000FFFF |
| 434 | #define PORT_HW_CFG_MF_PCI_DEVICE_ID_SHIFT 0 |
Yaniv Rosner | 1ac9e42 | 2011-05-31 21:26:11 +0000 | [diff] [blame] | 435 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 436 | /* Controls the TX laser of the SFP+ module */ |
| 437 | u32 sfp_ctrl; /* 0x164 */ |
| 438 | #define PORT_HW_CFG_TX_LASER_MASK 0x000000FF |
| 439 | #define PORT_HW_CFG_TX_LASER_SHIFT 0 |
| 440 | #define PORT_HW_CFG_TX_LASER_MDIO 0x00000000 |
| 441 | #define PORT_HW_CFG_TX_LASER_GPIO0 0x00000001 |
| 442 | #define PORT_HW_CFG_TX_LASER_GPIO1 0x00000002 |
| 443 | #define PORT_HW_CFG_TX_LASER_GPIO2 0x00000003 |
| 444 | #define PORT_HW_CFG_TX_LASER_GPIO3 0x00000004 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 445 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 446 | /* Controls the fault module LED of the SFP+ */ |
| 447 | #define PORT_HW_CFG_FAULT_MODULE_LED_MASK 0x0000FF00 |
| 448 | #define PORT_HW_CFG_FAULT_MODULE_LED_SHIFT 8 |
| 449 | #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO0 0x00000000 |
| 450 | #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO1 0x00000100 |
| 451 | #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO2 0x00000200 |
| 452 | #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO3 0x00000300 |
| 453 | #define PORT_HW_CFG_FAULT_MODULE_LED_DISABLED 0x00000400 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 454 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 455 | /* The output pin TX_DIS that controls the TX laser of the SFP+ |
| 456 | module. Use the PIN_CFG_XXX defines on top */ |
| 457 | u32 e3_sfp_ctrl; /* 0x168 */ |
| 458 | #define PORT_HW_CFG_E3_TX_LASER_MASK 0x000000FF |
| 459 | #define PORT_HW_CFG_E3_TX_LASER_SHIFT 0 |
Yaniv Rosner | a8db5b4 | 2011-01-31 04:22:28 +0000 | [diff] [blame] | 460 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 461 | /* The output pin for SFPP_TYPE which turns on the Fault module LED */ |
| 462 | #define PORT_HW_CFG_E3_FAULT_MDL_LED_MASK 0x0000FF00 |
| 463 | #define PORT_HW_CFG_E3_FAULT_MDL_LED_SHIFT 8 |
Yaniv Rosner | a8db5b4 | 2011-01-31 04:22:28 +0000 | [diff] [blame] | 464 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 465 | /* The input pin MOD_ABS that indicates whether SFP+ module is |
| 466 | present or not. Use the PIN_CFG_XXX defines on top */ |
| 467 | #define PORT_HW_CFG_E3_MOD_ABS_MASK 0x00FF0000 |
| 468 | #define PORT_HW_CFG_E3_MOD_ABS_SHIFT 16 |
Yaniv Rosner | a8db5b4 | 2011-01-31 04:22:28 +0000 | [diff] [blame] | 469 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 470 | /* The output pin PWRDIS_SFP_X which disable the power of the SFP+ |
| 471 | module. Use the PIN_CFG_XXX defines on top */ |
| 472 | #define PORT_HW_CFG_E3_PWR_DIS_MASK 0xFF000000 |
| 473 | #define PORT_HW_CFG_E3_PWR_DIS_SHIFT 24 |
Yaniv Rosner | a8db5b4 | 2011-01-31 04:22:28 +0000 | [diff] [blame] | 474 | |
| 475 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 476 | * The input pin which signals module transmit fault. Use the |
| 477 | * PIN_CFG_XXX defines on top |
Yaniv Rosner | a8db5b4 | 2011-01-31 04:22:28 +0000 | [diff] [blame] | 478 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 479 | u32 e3_cmn_pin_cfg; /* 0x16C */ |
| 480 | #define PORT_HW_CFG_E3_TX_FAULT_MASK 0x000000FF |
| 481 | #define PORT_HW_CFG_E3_TX_FAULT_SHIFT 0 |
| 482 | |
| 483 | /* The output pin which reset the PHY. Use the PIN_CFG_XXX defines on |
| 484 | top */ |
| 485 | #define PORT_HW_CFG_E3_PHY_RESET_MASK 0x0000FF00 |
| 486 | #define PORT_HW_CFG_E3_PHY_RESET_SHIFT 8 |
| 487 | |
| 488 | /* |
| 489 | * The output pin which powers down the PHY. Use the PIN_CFG_XXX |
| 490 | * defines on top |
| 491 | */ |
| 492 | #define PORT_HW_CFG_E3_PWR_DOWN_MASK 0x00FF0000 |
| 493 | #define PORT_HW_CFG_E3_PWR_DOWN_SHIFT 16 |
| 494 | |
| 495 | /* The output pin values BSC_SEL which selects the I2C for this port |
| 496 | in the I2C Mux */ |
| 497 | #define PORT_HW_CFG_E3_I2C_MUX0_MASK 0x01000000 |
| 498 | #define PORT_HW_CFG_E3_I2C_MUX1_MASK 0x02000000 |
| 499 | |
| 500 | |
| 501 | /* |
| 502 | * The input pin I_FAULT which indicate over-current has occurred. |
| 503 | * Use the PIN_CFG_XXX defines on top |
| 504 | */ |
| 505 | u32 e3_cmn_pin_cfg1; /* 0x170 */ |
| 506 | #define PORT_HW_CFG_E3_OVER_CURRENT_MASK 0x000000FF |
| 507 | #define PORT_HW_CFG_E3_OVER_CURRENT_SHIFT 0 |
| 508 | u32 reserved0[7]; /* 0x174 */ |
| 509 | |
| 510 | u32 aeu_int_mask; /* 0x190 */ |
| 511 | |
| 512 | u32 media_type; /* 0x194 */ |
| 513 | #define PORT_HW_CFG_MEDIA_TYPE_PHY0_MASK 0x000000FF |
| 514 | #define PORT_HW_CFG_MEDIA_TYPE_PHY0_SHIFT 0 |
| 515 | |
| 516 | #define PORT_HW_CFG_MEDIA_TYPE_PHY1_MASK 0x0000FF00 |
| 517 | #define PORT_HW_CFG_MEDIA_TYPE_PHY1_SHIFT 8 |
| 518 | |
| 519 | #define PORT_HW_CFG_MEDIA_TYPE_PHY2_MASK 0x00FF0000 |
| 520 | #define PORT_HW_CFG_MEDIA_TYPE_PHY2_SHIFT 16 |
| 521 | |
| 522 | /* 4 times 16 bits for all 4 lanes. In case external PHY is present |
| 523 | (not direct mode), those values will not take effect on the 4 XGXS |
| 524 | lanes. For some external PHYs (such as 8706 and 8726) the values |
| 525 | will be used to configure the external PHY in those cases, not |
| 526 | all 4 values are needed. */ |
| 527 | u16 xgxs_config_rx[4]; /* 0x198 */ |
| 528 | u16 xgxs_config_tx[4]; /* 0x1A0 */ |
| 529 | |
| 530 | /* For storing FCOE mac on shared memory */ |
| 531 | u32 fcoe_fip_mac_upper; |
| 532 | #define PORT_HW_CFG_FCOE_UPPERMAC_MASK 0x0000ffff |
| 533 | #define PORT_HW_CFG_FCOE_UPPERMAC_SHIFT 0 |
| 534 | u32 fcoe_fip_mac_lower; |
| 535 | |
| 536 | u32 fcoe_wwn_port_name_upper; |
| 537 | u32 fcoe_wwn_port_name_lower; |
| 538 | |
| 539 | u32 fcoe_wwn_node_name_upper; |
| 540 | u32 fcoe_wwn_node_name_lower; |
| 541 | |
Yaniv Rosner | 0520e63 | 2011-07-05 01:06:59 +0000 | [diff] [blame] | 542 | u32 Reserved1[49]; /* 0x1C0 */ |
| 543 | |
| 544 | /* Enable RJ45 magjack pair swapping on 10GBase-T PHY (0=default), |
| 545 | 84833 only */ |
| 546 | u32 xgbt_phy_cfg; /* 0x284 */ |
| 547 | #define PORT_HW_CFG_RJ45_PAIR_SWAP_MASK 0x000000FF |
| 548 | #define PORT_HW_CFG_RJ45_PAIR_SWAP_SHIFT 0 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 549 | |
| 550 | u32 default_cfg; /* 0x288 */ |
| 551 | #define PORT_HW_CFG_GPIO0_CONFIG_MASK 0x00000003 |
| 552 | #define PORT_HW_CFG_GPIO0_CONFIG_SHIFT 0 |
| 553 | #define PORT_HW_CFG_GPIO0_CONFIG_NA 0x00000000 |
| 554 | #define PORT_HW_CFG_GPIO0_CONFIG_LOW 0x00000001 |
| 555 | #define PORT_HW_CFG_GPIO0_CONFIG_HIGH 0x00000002 |
| 556 | #define PORT_HW_CFG_GPIO0_CONFIG_INPUT 0x00000003 |
| 557 | |
| 558 | #define PORT_HW_CFG_GPIO1_CONFIG_MASK 0x0000000C |
| 559 | #define PORT_HW_CFG_GPIO1_CONFIG_SHIFT 2 |
| 560 | #define PORT_HW_CFG_GPIO1_CONFIG_NA 0x00000000 |
| 561 | #define PORT_HW_CFG_GPIO1_CONFIG_LOW 0x00000004 |
| 562 | #define PORT_HW_CFG_GPIO1_CONFIG_HIGH 0x00000008 |
| 563 | #define PORT_HW_CFG_GPIO1_CONFIG_INPUT 0x0000000c |
| 564 | |
| 565 | #define PORT_HW_CFG_GPIO2_CONFIG_MASK 0x00000030 |
| 566 | #define PORT_HW_CFG_GPIO2_CONFIG_SHIFT 4 |
| 567 | #define PORT_HW_CFG_GPIO2_CONFIG_NA 0x00000000 |
| 568 | #define PORT_HW_CFG_GPIO2_CONFIG_LOW 0x00000010 |
| 569 | #define PORT_HW_CFG_GPIO2_CONFIG_HIGH 0x00000020 |
| 570 | #define PORT_HW_CFG_GPIO2_CONFIG_INPUT 0x00000030 |
| 571 | |
| 572 | #define PORT_HW_CFG_GPIO3_CONFIG_MASK 0x000000C0 |
| 573 | #define PORT_HW_CFG_GPIO3_CONFIG_SHIFT 6 |
| 574 | #define PORT_HW_CFG_GPIO3_CONFIG_NA 0x00000000 |
| 575 | #define PORT_HW_CFG_GPIO3_CONFIG_LOW 0x00000040 |
| 576 | #define PORT_HW_CFG_GPIO3_CONFIG_HIGH 0x00000080 |
| 577 | #define PORT_HW_CFG_GPIO3_CONFIG_INPUT 0x000000c0 |
| 578 | |
| 579 | /* When KR link is required to be set to force which is not |
| 580 | KR-compliant, this parameter determine what is the trigger for it. |
| 581 | When GPIO is selected, low input will force the speed. Currently |
| 582 | default speed is 1G. In the future, it may be widen to select the |
| 583 | forced speed in with another parameter. Note when force-1G is |
| 584 | enabled, it override option 56: Link Speed option. */ |
| 585 | #define PORT_HW_CFG_FORCE_KR_ENABLER_MASK 0x00000F00 |
| 586 | #define PORT_HW_CFG_FORCE_KR_ENABLER_SHIFT 8 |
| 587 | #define PORT_HW_CFG_FORCE_KR_ENABLER_NOT_FORCED 0x00000000 |
| 588 | #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P0 0x00000100 |
| 589 | #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P0 0x00000200 |
| 590 | #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P0 0x00000300 |
| 591 | #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P0 0x00000400 |
| 592 | #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P1 0x00000500 |
| 593 | #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P1 0x00000600 |
| 594 | #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P1 0x00000700 |
| 595 | #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P1 0x00000800 |
| 596 | #define PORT_HW_CFG_FORCE_KR_ENABLER_FORCED 0x00000900 |
| 597 | /* Enable to determine with which GPIO to reset the external phy */ |
| 598 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_MASK 0x000F0000 |
| 599 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_SHIFT 16 |
| 600 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_PHY_TYPE 0x00000000 |
| 601 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P0 0x00010000 |
| 602 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P0 0x00020000 |
| 603 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P0 0x00030000 |
| 604 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P0 0x00040000 |
| 605 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P1 0x00050000 |
| 606 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P1 0x00060000 |
| 607 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P1 0x00070000 |
| 608 | #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P1 0x00080000 |
| 609 | |
Yaniv Rosner | 121839b | 2010-11-01 05:32:38 +0000 | [diff] [blame] | 610 | /* Enable BAM on KR */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 611 | #define PORT_HW_CFG_ENABLE_BAM_ON_KR_MASK 0x00100000 |
| 612 | #define PORT_HW_CFG_ENABLE_BAM_ON_KR_SHIFT 20 |
| 613 | #define PORT_HW_CFG_ENABLE_BAM_ON_KR_DISABLED 0x00000000 |
| 614 | #define PORT_HW_CFG_ENABLE_BAM_ON_KR_ENABLED 0x00100000 |
Yaniv Rosner | 121839b | 2010-11-01 05:32:38 +0000 | [diff] [blame] | 615 | |
Yaniv Rosner | 1bef68e | 2011-01-31 04:22:46 +0000 | [diff] [blame] | 616 | /* Enable Common Mode Sense */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 617 | #define PORT_HW_CFG_ENABLE_CMS_MASK 0x00200000 |
| 618 | #define PORT_HW_CFG_ENABLE_CMS_SHIFT 21 |
| 619 | #define PORT_HW_CFG_ENABLE_CMS_DISABLED 0x00000000 |
| 620 | #define PORT_HW_CFG_ENABLE_CMS_ENABLED 0x00200000 |
| 621 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 622 | /* Determine the Serdes electrical interface */ |
| 623 | #define PORT_HW_CFG_NET_SERDES_IF_MASK 0x0F000000 |
| 624 | #define PORT_HW_CFG_NET_SERDES_IF_SHIFT 24 |
| 625 | #define PORT_HW_CFG_NET_SERDES_IF_SGMII 0x00000000 |
| 626 | #define PORT_HW_CFG_NET_SERDES_IF_XFI 0x01000000 |
| 627 | #define PORT_HW_CFG_NET_SERDES_IF_SFI 0x02000000 |
| 628 | #define PORT_HW_CFG_NET_SERDES_IF_KR 0x03000000 |
| 629 | #define PORT_HW_CFG_NET_SERDES_IF_DXGXS 0x04000000 |
| 630 | #define PORT_HW_CFG_NET_SERDES_IF_KR2 0x05000000 |
| 631 | |
Yaniv Rosner | 1bef68e | 2011-01-31 04:22:46 +0000 | [diff] [blame] | 632 | |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 633 | u32 speed_capability_mask2; /* 0x28C */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 634 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_MASK 0x0000FFFF |
| 635 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_SHIFT 0 |
| 636 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10M_FULL 0x00000001 |
| 637 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3__ 0x00000002 |
| 638 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3___ 0x00000004 |
| 639 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_100M_FULL 0x00000008 |
| 640 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_1G 0x00000010 |
| 641 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_2_DOT_5G 0x00000020 |
| 642 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10G 0x00000040 |
| 643 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_20G 0x00000080 |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 644 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 645 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_MASK 0xFFFF0000 |
| 646 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_SHIFT 16 |
| 647 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10M_FULL 0x00010000 |
| 648 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0__ 0x00020000 |
| 649 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0___ 0x00040000 |
| 650 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_100M_FULL 0x00080000 |
| 651 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_1G 0x00100000 |
| 652 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_2_DOT_5G 0x00200000 |
| 653 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10G 0x00400000 |
| 654 | #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_20G 0x00800000 |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 655 | |
| 656 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 657 | /* In the case where two media types (e.g. copper and fiber) are |
| 658 | present and electrically active at the same time, PHY Selection |
| 659 | will determine which of the two PHYs will be designated as the |
| 660 | Active PHY and used for a connection to the network. */ |
| 661 | u32 multi_phy_config; /* 0x290 */ |
| 662 | #define PORT_HW_CFG_PHY_SELECTION_MASK 0x00000007 |
| 663 | #define PORT_HW_CFG_PHY_SELECTION_SHIFT 0 |
| 664 | #define PORT_HW_CFG_PHY_SELECTION_HARDWARE_DEFAULT 0x00000000 |
| 665 | #define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY 0x00000001 |
| 666 | #define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY 0x00000002 |
| 667 | #define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY 0x00000003 |
| 668 | #define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY_PRIORITY 0x00000004 |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 669 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 670 | /* When enabled, all second phy nvram parameters will be swapped |
| 671 | with the first phy parameters */ |
| 672 | #define PORT_HW_CFG_PHY_SWAPPED_MASK 0x00000008 |
| 673 | #define PORT_HW_CFG_PHY_SWAPPED_SHIFT 3 |
| 674 | #define PORT_HW_CFG_PHY_SWAPPED_DISABLED 0x00000000 |
| 675 | #define PORT_HW_CFG_PHY_SWAPPED_ENABLED 0x00000008 |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 676 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 677 | |
| 678 | /* Address of the second external phy */ |
| 679 | u32 external_phy_config2; /* 0x294 */ |
| 680 | #define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_MASK 0x000000FF |
| 681 | #define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_SHIFT 0 |
| 682 | |
| 683 | /* The second XGXS external PHY type */ |
| 684 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_MASK 0x0000FF00 |
| 685 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SHIFT 8 |
| 686 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_DIRECT 0x00000000 |
| 687 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8071 0x00000100 |
| 688 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8072 0x00000200 |
| 689 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8073 0x00000300 |
| 690 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8705 0x00000400 |
| 691 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8706 0x00000500 |
| 692 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8726 0x00000600 |
| 693 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8481 0x00000700 |
| 694 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SFX7101 0x00000800 |
| 695 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727 0x00000900 |
| 696 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727_NOC 0x00000a00 |
| 697 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84823 0x00000b00 |
| 698 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54640 0x00000c00 |
| 699 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84833 0x00000d00 |
Yaniv Rosner | 52c4d6c | 2011-07-05 01:06:34 +0000 | [diff] [blame] | 700 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54618SE 0x00000e00 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 701 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8722 0x00000f00 |
Yaniv Rosner | 3756a89 | 2011-08-23 06:33:24 +0000 | [diff] [blame] | 702 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54616 0x00001000 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 703 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_FAILURE 0x0000fd00 |
| 704 | #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_NOT_CONN 0x0000ff00 |
| 705 | |
| 706 | |
| 707 | /* 4 times 16 bits for all 4 lanes. For some external PHYs (such as |
| 708 | 8706, 8726 and 8727) not all 4 values are needed. */ |
| 709 | u16 xgxs_config2_rx[4]; /* 0x296 */ |
| 710 | u16 xgxs_config2_tx[4]; /* 0x2A0 */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 711 | |
| 712 | u32 lane_config; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 713 | #define PORT_HW_CFG_LANE_SWAP_CFG_MASK 0x0000ffff |
| 714 | #define PORT_HW_CFG_LANE_SWAP_CFG_SHIFT 0 |
| 715 | /* AN and forced */ |
| 716 | #define PORT_HW_CFG_LANE_SWAP_CFG_01230123 0x00001b1b |
| 717 | /* forced only */ |
| 718 | #define PORT_HW_CFG_LANE_SWAP_CFG_01233210 0x00001be4 |
| 719 | /* forced only */ |
| 720 | #define PORT_HW_CFG_LANE_SWAP_CFG_31203120 0x0000d8d8 |
| 721 | /* forced only */ |
| 722 | #define PORT_HW_CFG_LANE_SWAP_CFG_32103210 0x0000e4e4 |
| 723 | #define PORT_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000ff |
| 724 | #define PORT_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0 |
| 725 | #define PORT_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000ff00 |
| 726 | #define PORT_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8 |
| 727 | #define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_MASK 0x0000c000 |
| 728 | #define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_SHIFT 14 |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 729 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 730 | /* Indicate whether to swap the external phy polarity */ |
| 731 | #define PORT_HW_CFG_SWAP_PHY_POLARITY_MASK 0x00010000 |
| 732 | #define PORT_HW_CFG_SWAP_PHY_POLARITY_DISABLED 0x00000000 |
| 733 | #define PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED 0x00010000 |
| 734 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 735 | |
| 736 | u32 external_phy_config; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 737 | #define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK 0x000000ff |
| 738 | #define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT 0 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 739 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 740 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK 0x0000ff00 |
| 741 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SHIFT 8 |
| 742 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT 0x00000000 |
| 743 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8071 0x00000100 |
| 744 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072 0x00000200 |
| 745 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073 0x00000300 |
| 746 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705 0x00000400 |
| 747 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706 0x00000500 |
| 748 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726 0x00000600 |
| 749 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481 0x00000700 |
| 750 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101 0x00000800 |
| 751 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727 0x00000900 |
| 752 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727_NOC 0x00000a00 |
| 753 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823 0x00000b00 |
| 754 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54640 0x00000c00 |
| 755 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833 0x00000d00 |
Yaniv Rosner | 52c4d6c | 2011-07-05 01:06:34 +0000 | [diff] [blame] | 756 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE 0x00000e00 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 757 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722 0x00000f00 |
Yaniv Rosner | 3756a89 | 2011-08-23 06:33:24 +0000 | [diff] [blame] | 758 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616 0x00001000 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 759 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT_WC 0x0000fc00 |
| 760 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00 |
| 761 | #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 762 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 763 | #define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_MASK 0x00ff0000 |
| 764 | #define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_SHIFT 16 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 765 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 766 | #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK 0xff000000 |
| 767 | #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_SHIFT 24 |
| 768 | #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT 0x00000000 |
| 769 | #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_BCM5482 0x01000000 |
| 770 | #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT_SD 0x02000000 |
| 771 | #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_NOT_CONN 0xff000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 772 | |
| 773 | u32 speed_capability_mask; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 774 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_MASK 0x0000ffff |
| 775 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_SHIFT 0 |
| 776 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_FULL 0x00000001 |
| 777 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_HALF 0x00000002 |
| 778 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_HALF 0x00000004 |
| 779 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_FULL 0x00000008 |
| 780 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_1G 0x00000010 |
| 781 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_2_5G 0x00000020 |
| 782 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10G 0x00000040 |
| 783 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_20G 0x00000080 |
| 784 | #define PORT_HW_CFG_SPEED_CAPABILITY_D3_RESERVED 0x0000f000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 785 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 786 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK 0xffff0000 |
| 787 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_SHIFT 16 |
| 788 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL 0x00010000 |
| 789 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF 0x00020000 |
| 790 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF 0x00040000 |
| 791 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL 0x00080000 |
| 792 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_1G 0x00100000 |
| 793 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G 0x00200000 |
| 794 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10G 0x00400000 |
| 795 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_20G 0x00800000 |
| 796 | #define PORT_HW_CFG_SPEED_CAPABILITY_D0_RESERVED 0xf0000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 797 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 798 | /* A place to hold the original MAC address as a backup */ |
| 799 | u32 backup_mac_upper; /* 0x2B4 */ |
| 800 | u32 backup_mac_lower; /* 0x2B8 */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 801 | |
| 802 | }; |
| 803 | |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 804 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 805 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 806 | * Shared Feature configuration * |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 807 | ****************************************************************************/ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 808 | struct shared_feat_cfg { /* NVRAM Offset */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 809 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 810 | u32 config; /* 0x450 */ |
| 811 | #define SHARED_FEATURE_BMC_ECHO_MODE_EN 0x00000001 |
Eilon Greenstein | 589abe3 | 2009-02-12 08:36:55 +0000 | [diff] [blame] | 812 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 813 | /* Use NVRAM values instead of HW default values */ |
| 814 | #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_MASK \ |
| 815 | 0x00000002 |
| 816 | #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_DISABLED \ |
| 817 | 0x00000000 |
| 818 | #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_ENABLED \ |
| 819 | 0x00000002 |
Eilon Greenstein | 589abe3 | 2009-02-12 08:36:55 +0000 | [diff] [blame] | 820 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 821 | #define SHARED_FEAT_CFG_NCSI_ID_METHOD_MASK 0x00000008 |
| 822 | #define SHARED_FEAT_CFG_NCSI_ID_METHOD_SPIO 0x00000000 |
| 823 | #define SHARED_FEAT_CFG_NCSI_ID_METHOD_NVRAM 0x00000008 |
| 824 | |
| 825 | #define SHARED_FEAT_CFG_NCSI_ID_MASK 0x00000030 |
| 826 | #define SHARED_FEAT_CFG_NCSI_ID_SHIFT 4 |
| 827 | |
| 828 | /* Override the OTP back to single function mode. When using GPIO, |
| 829 | high means only SF, 0 is according to CLP configuration */ |
| 830 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_MASK 0x00000700 |
| 831 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_SHIFT 8 |
| 832 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_MF_ALLOWED 0x00000000 |
| 833 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_FORCED_SF 0x00000100 |
| 834 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_SPIO4 0x00000200 |
| 835 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT 0x00000300 |
| 836 | |
| 837 | /* The interval in seconds between sending LLDP packets. Set to zero |
| 838 | to disable the feature */ |
| 839 | #define SHARED_FEAT_CFG_LLDP_XMIT_INTERVAL_MASK 0x00ff0000 |
| 840 | #define SHARED_FEAT_CFG_LLDP_XMIT_INTERVAL_SHIFT 16 |
| 841 | |
| 842 | /* The assigned device type ID for LLDP usage */ |
| 843 | #define SHARED_FEAT_CFG_LLDP_DEVICE_TYPE_ID_MASK 0xff000000 |
| 844 | #define SHARED_FEAT_CFG_LLDP_DEVICE_TYPE_ID_SHIFT 24 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 845 | |
| 846 | }; |
| 847 | |
| 848 | |
| 849 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 850 | * Port Feature configuration * |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 851 | ****************************************************************************/ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 852 | struct port_feat_cfg { /* port 0: 0x454 port 1: 0x4c8 */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 853 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 854 | u32 config; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 855 | #define PORT_FEATURE_BAR1_SIZE_MASK 0x0000000f |
| 856 | #define PORT_FEATURE_BAR1_SIZE_SHIFT 0 |
| 857 | #define PORT_FEATURE_BAR1_SIZE_DISABLED 0x00000000 |
| 858 | #define PORT_FEATURE_BAR1_SIZE_64K 0x00000001 |
| 859 | #define PORT_FEATURE_BAR1_SIZE_128K 0x00000002 |
| 860 | #define PORT_FEATURE_BAR1_SIZE_256K 0x00000003 |
| 861 | #define PORT_FEATURE_BAR1_SIZE_512K 0x00000004 |
| 862 | #define PORT_FEATURE_BAR1_SIZE_1M 0x00000005 |
| 863 | #define PORT_FEATURE_BAR1_SIZE_2M 0x00000006 |
| 864 | #define PORT_FEATURE_BAR1_SIZE_4M 0x00000007 |
| 865 | #define PORT_FEATURE_BAR1_SIZE_8M 0x00000008 |
| 866 | #define PORT_FEATURE_BAR1_SIZE_16M 0x00000009 |
| 867 | #define PORT_FEATURE_BAR1_SIZE_32M 0x0000000a |
| 868 | #define PORT_FEATURE_BAR1_SIZE_64M 0x0000000b |
| 869 | #define PORT_FEATURE_BAR1_SIZE_128M 0x0000000c |
| 870 | #define PORT_FEATURE_BAR1_SIZE_256M 0x0000000d |
| 871 | #define PORT_FEATURE_BAR1_SIZE_512M 0x0000000e |
| 872 | #define PORT_FEATURE_BAR1_SIZE_1G 0x0000000f |
| 873 | #define PORT_FEATURE_BAR2_SIZE_MASK 0x000000f0 |
| 874 | #define PORT_FEATURE_BAR2_SIZE_SHIFT 4 |
| 875 | #define PORT_FEATURE_BAR2_SIZE_DISABLED 0x00000000 |
| 876 | #define PORT_FEATURE_BAR2_SIZE_64K 0x00000010 |
| 877 | #define PORT_FEATURE_BAR2_SIZE_128K 0x00000020 |
| 878 | #define PORT_FEATURE_BAR2_SIZE_256K 0x00000030 |
| 879 | #define PORT_FEATURE_BAR2_SIZE_512K 0x00000040 |
| 880 | #define PORT_FEATURE_BAR2_SIZE_1M 0x00000050 |
| 881 | #define PORT_FEATURE_BAR2_SIZE_2M 0x00000060 |
| 882 | #define PORT_FEATURE_BAR2_SIZE_4M 0x00000070 |
| 883 | #define PORT_FEATURE_BAR2_SIZE_8M 0x00000080 |
| 884 | #define PORT_FEATURE_BAR2_SIZE_16M 0x00000090 |
| 885 | #define PORT_FEATURE_BAR2_SIZE_32M 0x000000a0 |
| 886 | #define PORT_FEATURE_BAR2_SIZE_64M 0x000000b0 |
| 887 | #define PORT_FEATURE_BAR2_SIZE_128M 0x000000c0 |
| 888 | #define PORT_FEATURE_BAR2_SIZE_256M 0x000000d0 |
| 889 | #define PORT_FEATURE_BAR2_SIZE_512M 0x000000e0 |
| 890 | #define PORT_FEATURE_BAR2_SIZE_1G 0x000000f0 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 891 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 892 | #define PORT_FEAT_CFG_DCBX_MASK 0x00000100 |
| 893 | #define PORT_FEAT_CFG_DCBX_DISABLED 0x00000000 |
| 894 | #define PORT_FEAT_CFG_DCBX_ENABLED 0x00000100 |
Eilon Greenstein | 4d295db | 2009-07-21 05:47:47 +0000 | [diff] [blame] | 895 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 896 | #define PORT_FEATURE_EN_SIZE_MASK 0x0f000000 |
| 897 | #define PORT_FEATURE_EN_SIZE_SHIFT 24 |
| 898 | #define PORT_FEATURE_WOL_ENABLED 0x01000000 |
| 899 | #define PORT_FEATURE_MBA_ENABLED 0x02000000 |
| 900 | #define PORT_FEATURE_MFW_ENABLED 0x04000000 |
| 901 | |
| 902 | /* Advertise expansion ROM even if MBA is disabled */ |
| 903 | #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_MASK 0x08000000 |
| 904 | #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_DISABLED 0x00000000 |
| 905 | #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_ENABLED 0x08000000 |
| 906 | |
| 907 | /* Check the optic vendor via i2c against a list of approved modules |
| 908 | in a separate nvram image */ |
| 909 | #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK 0xe0000000 |
| 910 | #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_SHIFT 29 |
| 911 | #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_NO_ENFORCEMENT \ |
| 912 | 0x00000000 |
| 913 | #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER \ |
| 914 | 0x20000000 |
| 915 | #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_WARNING_MSG 0x40000000 |
| 916 | #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_POWER_DOWN 0x60000000 |
Eilon Greenstein | 589abe3 | 2009-02-12 08:36:55 +0000 | [diff] [blame] | 917 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 918 | u32 wol_config; |
| 919 | /* Default is used when driver sets to "auto" mode */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 920 | #define PORT_FEATURE_WOL_DEFAULT_MASK 0x00000003 |
| 921 | #define PORT_FEATURE_WOL_DEFAULT_SHIFT 0 |
| 922 | #define PORT_FEATURE_WOL_DEFAULT_DISABLE 0x00000000 |
| 923 | #define PORT_FEATURE_WOL_DEFAULT_MAGIC 0x00000001 |
| 924 | #define PORT_FEATURE_WOL_DEFAULT_ACPI 0x00000002 |
| 925 | #define PORT_FEATURE_WOL_DEFAULT_MAGIC_AND_ACPI 0x00000003 |
| 926 | #define PORT_FEATURE_WOL_RES_PAUSE_CAP 0x00000004 |
| 927 | #define PORT_FEATURE_WOL_RES_ASYM_PAUSE_CAP 0x00000008 |
| 928 | #define PORT_FEATURE_WOL_ACPI_UPON_MGMT 0x00000010 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 929 | |
| 930 | u32 mba_config; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 931 | #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_MASK 0x00000007 |
| 932 | #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_SHIFT 0 |
| 933 | #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_PXE 0x00000000 |
| 934 | #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_RPL 0x00000001 |
| 935 | #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_BOOTP 0x00000002 |
| 936 | #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_ISCSIB 0x00000003 |
| 937 | #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_FCOE_BOOT 0x00000004 |
| 938 | #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_NONE 0x00000007 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 939 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 940 | #define PORT_FEATURE_MBA_BOOT_RETRY_MASK 0x00000038 |
| 941 | #define PORT_FEATURE_MBA_BOOT_RETRY_SHIFT 3 |
| 942 | |
| 943 | #define PORT_FEATURE_MBA_RES_PAUSE_CAP 0x00000100 |
| 944 | #define PORT_FEATURE_MBA_RES_ASYM_PAUSE_CAP 0x00000200 |
| 945 | #define PORT_FEATURE_MBA_SETUP_PROMPT_ENABLE 0x00000400 |
| 946 | #define PORT_FEATURE_MBA_HOTKEY_MASK 0x00000800 |
| 947 | #define PORT_FEATURE_MBA_HOTKEY_CTRL_S 0x00000000 |
| 948 | #define PORT_FEATURE_MBA_HOTKEY_CTRL_B 0x00000800 |
| 949 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_MASK 0x000ff000 |
| 950 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_SHIFT 12 |
| 951 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_DISABLED 0x00000000 |
| 952 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_2K 0x00001000 |
| 953 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_4K 0x00002000 |
| 954 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_8K 0x00003000 |
| 955 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_16K 0x00004000 |
| 956 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_32K 0x00005000 |
| 957 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_64K 0x00006000 |
| 958 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_128K 0x00007000 |
| 959 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_256K 0x00008000 |
| 960 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_512K 0x00009000 |
| 961 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_1M 0x0000a000 |
| 962 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_2M 0x0000b000 |
| 963 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_4M 0x0000c000 |
| 964 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_8M 0x0000d000 |
| 965 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_16M 0x0000e000 |
| 966 | #define PORT_FEATURE_MBA_EXP_ROM_SIZE_32M 0x0000f000 |
| 967 | #define PORT_FEATURE_MBA_MSG_TIMEOUT_MASK 0x00f00000 |
| 968 | #define PORT_FEATURE_MBA_MSG_TIMEOUT_SHIFT 20 |
| 969 | #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_MASK 0x03000000 |
| 970 | #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_SHIFT 24 |
| 971 | #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_AUTO 0x00000000 |
| 972 | #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_BBS 0x01000000 |
| 973 | #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT18H 0x02000000 |
| 974 | #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT19H 0x03000000 |
| 975 | #define PORT_FEATURE_MBA_LINK_SPEED_MASK 0x3c000000 |
| 976 | #define PORT_FEATURE_MBA_LINK_SPEED_SHIFT 26 |
| 977 | #define PORT_FEATURE_MBA_LINK_SPEED_AUTO 0x00000000 |
| 978 | #define PORT_FEATURE_MBA_LINK_SPEED_10HD 0x04000000 |
| 979 | #define PORT_FEATURE_MBA_LINK_SPEED_10FD 0x08000000 |
| 980 | #define PORT_FEATURE_MBA_LINK_SPEED_100HD 0x0c000000 |
| 981 | #define PORT_FEATURE_MBA_LINK_SPEED_100FD 0x10000000 |
| 982 | #define PORT_FEATURE_MBA_LINK_SPEED_1GBPS 0x14000000 |
| 983 | #define PORT_FEATURE_MBA_LINK_SPEED_2_5GBPS 0x18000000 |
| 984 | #define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_CX4 0x1c000000 |
| 985 | #define PORT_FEATURE_MBA_LINK_SPEED_20GBPS 0x20000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 986 | u32 bmc_config; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 987 | #define PORT_FEATURE_BMC_LINK_OVERRIDE_MASK 0x00000001 |
| 988 | #define PORT_FEATURE_BMC_LINK_OVERRIDE_DEFAULT 0x00000000 |
| 989 | #define PORT_FEATURE_BMC_LINK_OVERRIDE_EN 0x00000001 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 990 | |
| 991 | u32 mba_vlan_cfg; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 992 | #define PORT_FEATURE_MBA_VLAN_TAG_MASK 0x0000ffff |
| 993 | #define PORT_FEATURE_MBA_VLAN_TAG_SHIFT 0 |
| 994 | #define PORT_FEATURE_MBA_VLAN_EN 0x00010000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 995 | |
| 996 | u32 resource_cfg; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 997 | #define PORT_FEATURE_RESOURCE_CFG_VALID 0x00000001 |
| 998 | #define PORT_FEATURE_RESOURCE_CFG_DIAG 0x00000002 |
| 999 | #define PORT_FEATURE_RESOURCE_CFG_L2 0x00000004 |
| 1000 | #define PORT_FEATURE_RESOURCE_CFG_ISCSI 0x00000008 |
| 1001 | #define PORT_FEATURE_RESOURCE_CFG_RDMA 0x00000010 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1002 | |
| 1003 | u32 smbus_config; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1004 | #define PORT_FEATURE_SMBUS_ADDR_MASK 0x000000fe |
| 1005 | #define PORT_FEATURE_SMBUS_ADDR_SHIFT 1 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1006 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1007 | u32 vf_config; |
| 1008 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_MASK 0x0000000f |
| 1009 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_SHIFT 0 |
| 1010 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_DISABLED 0x00000000 |
| 1011 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_4K 0x00000001 |
| 1012 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_8K 0x00000002 |
| 1013 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_16K 0x00000003 |
| 1014 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_32K 0x00000004 |
| 1015 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_64K 0x00000005 |
| 1016 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_128K 0x00000006 |
| 1017 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_256K 0x00000007 |
| 1018 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_512K 0x00000008 |
| 1019 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_1M 0x00000009 |
| 1020 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_2M 0x0000000a |
| 1021 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_4M 0x0000000b |
| 1022 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_8M 0x0000000c |
| 1023 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_16M 0x0000000d |
| 1024 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_32M 0x0000000e |
| 1025 | #define PORT_FEAT_CFG_VF_BAR2_SIZE_64M 0x0000000f |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1026 | |
| 1027 | u32 link_config; /* Used as HW defaults for the driver */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1028 | #define PORT_FEATURE_CONNECTED_SWITCH_MASK 0x03000000 |
| 1029 | #define PORT_FEATURE_CONNECTED_SWITCH_SHIFT 24 |
| 1030 | /* (forced) low speed switch (< 10G) */ |
| 1031 | #define PORT_FEATURE_CON_SWITCH_1G_SWITCH 0x00000000 |
| 1032 | /* (forced) high speed switch (>= 10G) */ |
| 1033 | #define PORT_FEATURE_CON_SWITCH_10G_SWITCH 0x01000000 |
| 1034 | #define PORT_FEATURE_CON_SWITCH_AUTO_DETECT 0x02000000 |
| 1035 | #define PORT_FEATURE_CON_SWITCH_ONE_TIME_DETECT 0x03000000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1036 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1037 | #define PORT_FEATURE_LINK_SPEED_MASK 0x000f0000 |
| 1038 | #define PORT_FEATURE_LINK_SPEED_SHIFT 16 |
| 1039 | #define PORT_FEATURE_LINK_SPEED_AUTO 0x00000000 |
| 1040 | #define PORT_FEATURE_LINK_SPEED_10M_FULL 0x00010000 |
| 1041 | #define PORT_FEATURE_LINK_SPEED_10M_HALF 0x00020000 |
| 1042 | #define PORT_FEATURE_LINK_SPEED_100M_HALF 0x00030000 |
| 1043 | #define PORT_FEATURE_LINK_SPEED_100M_FULL 0x00040000 |
| 1044 | #define PORT_FEATURE_LINK_SPEED_1G 0x00050000 |
| 1045 | #define PORT_FEATURE_LINK_SPEED_2_5G 0x00060000 |
| 1046 | #define PORT_FEATURE_LINK_SPEED_10G_CX4 0x00070000 |
| 1047 | #define PORT_FEATURE_LINK_SPEED_20G 0x00080000 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1048 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1049 | #define PORT_FEATURE_FLOW_CONTROL_MASK 0x00000700 |
| 1050 | #define PORT_FEATURE_FLOW_CONTROL_SHIFT 8 |
| 1051 | #define PORT_FEATURE_FLOW_CONTROL_AUTO 0x00000000 |
| 1052 | #define PORT_FEATURE_FLOW_CONTROL_TX 0x00000100 |
| 1053 | #define PORT_FEATURE_FLOW_CONTROL_RX 0x00000200 |
| 1054 | #define PORT_FEATURE_FLOW_CONTROL_BOTH 0x00000300 |
| 1055 | #define PORT_FEATURE_FLOW_CONTROL_NONE 0x00000400 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1056 | |
| 1057 | /* The default for MCP link configuration, |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1058 | uses the same defines as link_config */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1059 | u32 mfw_wol_link_cfg; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1060 | |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 1061 | /* The default for the driver of the second external phy, |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1062 | uses the same defines as link_config */ |
| 1063 | u32 link_config2; /* 0x47C */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1064 | |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 1065 | /* The default for MCP of the second external phy, |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1066 | uses the same defines as link_config */ |
| 1067 | u32 mfw_wol_link_cfg2; /* 0x480 */ |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 1068 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1069 | u32 Reserved2[17]; /* 0x484 */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1070 | |
| 1071 | }; |
| 1072 | |
| 1073 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1074 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1075 | * Device Information * |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1076 | ****************************************************************************/ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1077 | struct shm_dev_info { /* size */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1078 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1079 | u32 bc_rev; /* 8 bits each: major, minor, build */ /* 4 */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1080 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1081 | struct shared_hw_cfg shared_hw_config; /* 40 */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1082 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1083 | struct port_hw_cfg port_hw_config[PORT_MAX]; /* 400*2=800 */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1084 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1085 | struct shared_feat_cfg shared_feature_config; /* 4 */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1086 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1087 | struct port_feat_cfg port_feature_config[PORT_MAX];/* 116*2=232 */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1088 | |
| 1089 | }; |
| 1090 | |
| 1091 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1092 | #if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN) |
| 1093 | #error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition." |
| 1094 | #endif |
Eilon Greenstein | ad8d394 | 2008-06-23 20:29:02 -0700 | [diff] [blame] | 1095 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1096 | #define FUNC_0 0 |
| 1097 | #define FUNC_1 1 |
| 1098 | #define FUNC_2 2 |
| 1099 | #define FUNC_3 3 |
| 1100 | #define FUNC_4 4 |
| 1101 | #define FUNC_5 5 |
| 1102 | #define FUNC_6 6 |
| 1103 | #define FUNC_7 7 |
| 1104 | #define E1_FUNC_MAX 2 |
| 1105 | #define E1H_FUNC_MAX 8 |
| 1106 | #define E2_FUNC_MAX 4 /* per path */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1107 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1108 | #define VN_0 0 |
| 1109 | #define VN_1 1 |
| 1110 | #define VN_2 2 |
| 1111 | #define VN_3 3 |
| 1112 | #define E1VN_MAX 1 |
| 1113 | #define E1HVN_MAX 4 |
| 1114 | |
| 1115 | #define E2_VF_MAX 64 /* HC_REG_VF_CONFIGURATION_SIZE */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1116 | /* This value (in milliseconds) determines the frequency of the driver |
| 1117 | * issuing the PULSE message code. The firmware monitors this periodic |
| 1118 | * pulse to determine when to switch to an OS-absent mode. */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1119 | #define DRV_PULSE_PERIOD_MS 250 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1120 | |
| 1121 | /* This value (in milliseconds) determines how long the driver should |
| 1122 | * wait for an acknowledgement from the firmware before timing out. Once |
| 1123 | * the firmware has timed out, the driver will assume there is no firmware |
| 1124 | * running and there won't be any firmware-driver synchronization during a |
| 1125 | * driver reset. */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1126 | #define FW_ACK_TIME_OUT_MS 5000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1127 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1128 | #define FW_ACK_POLL_TIME_MS 1 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1129 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1130 | #define FW_ACK_NUM_OF_POLL (FW_ACK_TIME_OUT_MS/FW_ACK_POLL_TIME_MS) |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1131 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1132 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1133 | * Driver <-> FW Mailbox * |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1134 | ****************************************************************************/ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1135 | struct drv_port_mb { |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1136 | |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1137 | u32 link_status; |
| 1138 | /* Driver should update this field on any link change event */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1139 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1140 | #define LINK_STATUS_LINK_FLAG_MASK 0x00000001 |
| 1141 | #define LINK_STATUS_LINK_UP 0x00000001 |
| 1142 | #define LINK_STATUS_SPEED_AND_DUPLEX_MASK 0x0000001E |
| 1143 | #define LINK_STATUS_SPEED_AND_DUPLEX_AN_NOT_COMPLETE (0<<1) |
| 1144 | #define LINK_STATUS_SPEED_AND_DUPLEX_10THD (1<<1) |
| 1145 | #define LINK_STATUS_SPEED_AND_DUPLEX_10TFD (2<<1) |
| 1146 | #define LINK_STATUS_SPEED_AND_DUPLEX_100TXHD (3<<1) |
| 1147 | #define LINK_STATUS_SPEED_AND_DUPLEX_100T4 (4<<1) |
| 1148 | #define LINK_STATUS_SPEED_AND_DUPLEX_100TXFD (5<<1) |
| 1149 | #define LINK_STATUS_SPEED_AND_DUPLEX_1000THD (6<<1) |
| 1150 | #define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD (7<<1) |
| 1151 | #define LINK_STATUS_SPEED_AND_DUPLEX_1000XFD (7<<1) |
| 1152 | #define LINK_STATUS_SPEED_AND_DUPLEX_2500THD (8<<1) |
| 1153 | #define LINK_STATUS_SPEED_AND_DUPLEX_2500TFD (9<<1) |
| 1154 | #define LINK_STATUS_SPEED_AND_DUPLEX_2500XFD (9<<1) |
| 1155 | #define LINK_STATUS_SPEED_AND_DUPLEX_10GTFD (10<<1) |
| 1156 | #define LINK_STATUS_SPEED_AND_DUPLEX_10GXFD (10<<1) |
| 1157 | #define LINK_STATUS_SPEED_AND_DUPLEX_20GTFD (11<<1) |
| 1158 | #define LINK_STATUS_SPEED_AND_DUPLEX_20GXFD (11<<1) |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1159 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1160 | #define LINK_STATUS_AUTO_NEGOTIATE_FLAG_MASK 0x00000020 |
| 1161 | #define LINK_STATUS_AUTO_NEGOTIATE_ENABLED 0x00000020 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1162 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1163 | #define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE 0x00000040 |
| 1164 | #define LINK_STATUS_PARALLEL_DETECTION_FLAG_MASK 0x00000080 |
| 1165 | #define LINK_STATUS_PARALLEL_DETECTION_USED 0x00000080 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1166 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1167 | #define LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE 0x00000200 |
| 1168 | #define LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE 0x00000400 |
| 1169 | #define LINK_STATUS_LINK_PARTNER_100T4_CAPABLE 0x00000800 |
| 1170 | #define LINK_STATUS_LINK_PARTNER_100TXFD_CAPABLE 0x00001000 |
| 1171 | #define LINK_STATUS_LINK_PARTNER_100TXHD_CAPABLE 0x00002000 |
| 1172 | #define LINK_STATUS_LINK_PARTNER_10TFD_CAPABLE 0x00004000 |
| 1173 | #define LINK_STATUS_LINK_PARTNER_10THD_CAPABLE 0x00008000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1174 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1175 | #define LINK_STATUS_TX_FLOW_CONTROL_FLAG_MASK 0x00010000 |
| 1176 | #define LINK_STATUS_TX_FLOW_CONTROL_ENABLED 0x00010000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1177 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1178 | #define LINK_STATUS_RX_FLOW_CONTROL_FLAG_MASK 0x00020000 |
| 1179 | #define LINK_STATUS_RX_FLOW_CONTROL_ENABLED 0x00020000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1180 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1181 | #define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK 0x000C0000 |
| 1182 | #define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE (0<<18) |
| 1183 | #define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE (1<<18) |
| 1184 | #define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE (2<<18) |
| 1185 | #define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE (3<<18) |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1186 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1187 | #define LINK_STATUS_SERDES_LINK 0x00100000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1188 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1189 | #define LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE 0x00200000 |
| 1190 | #define LINK_STATUS_LINK_PARTNER_2500XHD_CAPABLE 0x00400000 |
| 1191 | #define LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE 0x00800000 |
| 1192 | #define LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE 0x10000000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1193 | |
Yaniv Rosner | b8d6d08 | 2011-07-05 01:06:27 +0000 | [diff] [blame] | 1194 | #define LINK_STATUS_PFC_ENABLED 0x20000000 |
| 1195 | |
Yaniv Rosner | de6f337 | 2011-08-02 22:59:25 +0000 | [diff] [blame] | 1196 | #define LINK_STATUS_PHYSICAL_LINK_FLAG 0x40000000 |
| 1197 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1198 | u32 port_stx; |
| 1199 | |
Eilon Greenstein | de832a5 | 2009-02-12 08:36:33 +0000 | [diff] [blame] | 1200 | u32 stat_nig_timer; |
| 1201 | |
Eilon Greenstein | a35da8d | 2009-02-12 08:37:02 +0000 | [diff] [blame] | 1202 | /* MCP firmware does not use this field */ |
| 1203 | u32 ext_phy_fw_version; |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1204 | |
| 1205 | }; |
| 1206 | |
| 1207 | |
| 1208 | struct drv_func_mb { |
| 1209 | |
| 1210 | u32 drv_mb_header; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1211 | #define DRV_MSG_CODE_MASK 0xffff0000 |
| 1212 | #define DRV_MSG_CODE_LOAD_REQ 0x10000000 |
| 1213 | #define DRV_MSG_CODE_LOAD_DONE 0x11000000 |
| 1214 | #define DRV_MSG_CODE_UNLOAD_REQ_WOL_EN 0x20000000 |
| 1215 | #define DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS 0x20010000 |
| 1216 | #define DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP 0x20020000 |
| 1217 | #define DRV_MSG_CODE_UNLOAD_DONE 0x21000000 |
| 1218 | #define DRV_MSG_CODE_DCC_OK 0x30000000 |
| 1219 | #define DRV_MSG_CODE_DCC_FAILURE 0x31000000 |
| 1220 | #define DRV_MSG_CODE_DIAG_ENTER_REQ 0x50000000 |
| 1221 | #define DRV_MSG_CODE_DIAG_EXIT_REQ 0x60000000 |
| 1222 | #define DRV_MSG_CODE_VALIDATE_KEY 0x70000000 |
| 1223 | #define DRV_MSG_CODE_GET_CURR_KEY 0x80000000 |
| 1224 | #define DRV_MSG_CODE_GET_UPGRADE_KEY 0x81000000 |
| 1225 | #define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000 |
| 1226 | #define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000 |
Eilon Greenstein | 4d295db | 2009-07-21 05:47:47 +0000 | [diff] [blame] | 1227 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1228 | * The optic module verification command requires bootcode |
| 1229 | * v5.0.6 or later, te specific optic module verification command |
| 1230 | * requires bootcode v5.2.12 or later |
Eilon Greenstein | 4d295db | 2009-07-21 05:47:47 +0000 | [diff] [blame] | 1231 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1232 | #define DRV_MSG_CODE_VRFY_FIRST_PHY_OPT_MDL 0xa0000000 |
| 1233 | #define REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL 0x00050006 |
| 1234 | #define DRV_MSG_CODE_VRFY_SPECIFIC_PHY_OPT_MDL 0xa1000000 |
| 1235 | #define REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL 0x00050234 |
Yaniv Rosner | 85242ee | 2011-07-05 01:06:53 +0000 | [diff] [blame] | 1236 | #define REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED 0x00070014 |
Barak Witkowski | 0e898dd | 2011-12-05 21:52:22 +0000 | [diff] [blame] | 1237 | #define REQ_BC_VER_4_PFC_STATS_SUPPORTED 0x00070201 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1238 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1239 | #define DRV_MSG_CODE_DCBX_ADMIN_PMF_MSG 0xb0000000 |
| 1240 | #define DRV_MSG_CODE_DCBX_PMF_DRV_OK 0xb2000000 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1241 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1242 | #define DRV_MSG_CODE_VF_DISABLED_DONE 0xc0000000 |
Barak Witkowski | 1d187b3 | 2011-12-05 22:41:50 +0000 | [diff] [blame] | 1243 | #define DRV_MSG_CODE_DRV_INFO_ACK 0xd8000000 |
| 1244 | #define DRV_MSG_CODE_DRV_INFO_NACK 0xd9000000 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1245 | |
| 1246 | #define DRV_MSG_CODE_SET_MF_BW 0xe0000000 |
| 1247 | #define REQ_BC_VER_4_SET_MF_BW 0x00060202 |
| 1248 | #define DRV_MSG_CODE_SET_MF_BW_ACK 0xe1000000 |
| 1249 | |
| 1250 | #define DRV_MSG_CODE_LINK_STATUS_CHANGED 0x01000000 |
| 1251 | |
| 1252 | #define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000 |
| 1253 | #define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000 |
| 1254 | #define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000 |
| 1255 | #define BIOS_MSG_CODE_VIRT_MAC_ISCSI 0xff040000 |
| 1256 | |
| 1257 | #define DRV_MSG_SEQ_NUMBER_MASK 0x0000ffff |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1258 | |
| 1259 | u32 drv_mb_param; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1260 | #define DRV_MSG_CODE_SET_MF_BW_MIN_MASK 0x00ff0000 |
| 1261 | #define DRV_MSG_CODE_SET_MF_BW_MAX_MASK 0xff000000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1262 | |
| 1263 | u32 fw_mb_header; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1264 | #define FW_MSG_CODE_MASK 0xffff0000 |
| 1265 | #define FW_MSG_CODE_DRV_LOAD_COMMON 0x10100000 |
| 1266 | #define FW_MSG_CODE_DRV_LOAD_PORT 0x10110000 |
| 1267 | #define FW_MSG_CODE_DRV_LOAD_FUNCTION 0x10120000 |
| 1268 | /* Load common chip is supported from bc 6.0.0 */ |
| 1269 | #define REQ_BC_VER_4_DRV_LOAD_COMMON_CHIP 0x00060000 |
| 1270 | #define FW_MSG_CODE_DRV_LOAD_COMMON_CHIP 0x10130000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1271 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1272 | #define FW_MSG_CODE_DRV_LOAD_REFUSED 0x10200000 |
| 1273 | #define FW_MSG_CODE_DRV_LOAD_DONE 0x11100000 |
| 1274 | #define FW_MSG_CODE_DRV_UNLOAD_COMMON 0x20100000 |
| 1275 | #define FW_MSG_CODE_DRV_UNLOAD_PORT 0x20110000 |
| 1276 | #define FW_MSG_CODE_DRV_UNLOAD_FUNCTION 0x20120000 |
| 1277 | #define FW_MSG_CODE_DRV_UNLOAD_DONE 0x21100000 |
| 1278 | #define FW_MSG_CODE_DCC_DONE 0x30100000 |
| 1279 | #define FW_MSG_CODE_LLDP_DONE 0x40100000 |
| 1280 | #define FW_MSG_CODE_DIAG_ENTER_DONE 0x50100000 |
| 1281 | #define FW_MSG_CODE_DIAG_REFUSE 0x50200000 |
| 1282 | #define FW_MSG_CODE_DIAG_EXIT_DONE 0x60100000 |
| 1283 | #define FW_MSG_CODE_VALIDATE_KEY_SUCCESS 0x70100000 |
| 1284 | #define FW_MSG_CODE_VALIDATE_KEY_FAILURE 0x70200000 |
| 1285 | #define FW_MSG_CODE_GET_KEY_DONE 0x80100000 |
| 1286 | #define FW_MSG_CODE_NO_KEY 0x80f00000 |
| 1287 | #define FW_MSG_CODE_LIC_INFO_NOT_READY 0x80f80000 |
| 1288 | #define FW_MSG_CODE_L2B_PRAM_LOADED 0x90100000 |
| 1289 | #define FW_MSG_CODE_L2B_PRAM_T_LOAD_FAILURE 0x90210000 |
| 1290 | #define FW_MSG_CODE_L2B_PRAM_C_LOAD_FAILURE 0x90220000 |
| 1291 | #define FW_MSG_CODE_L2B_PRAM_X_LOAD_FAILURE 0x90230000 |
| 1292 | #define FW_MSG_CODE_L2B_PRAM_U_LOAD_FAILURE 0x90240000 |
| 1293 | #define FW_MSG_CODE_VRFY_OPT_MDL_SUCCESS 0xa0100000 |
| 1294 | #define FW_MSG_CODE_VRFY_OPT_MDL_INVLD_IMG 0xa0200000 |
| 1295 | #define FW_MSG_CODE_VRFY_OPT_MDL_UNAPPROVED 0xa0300000 |
| 1296 | #define FW_MSG_CODE_VF_DISABLED_DONE 0xb0000000 |
Barak Witkowski | 1d187b3 | 2011-12-05 22:41:50 +0000 | [diff] [blame] | 1297 | #define FW_MSG_CODE_DRV_INFO_ACK 0xd8100000 |
| 1298 | #define FW_MSG_CODE_DRV_INFO_NACK 0xd9100000 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1299 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1300 | #define FW_MSG_CODE_SET_MF_BW_SENT 0xe0000000 |
| 1301 | #define FW_MSG_CODE_SET_MF_BW_DONE 0xe1000000 |
| 1302 | |
| 1303 | #define FW_MSG_CODE_LINK_CHANGED_ACK 0x01100000 |
| 1304 | |
| 1305 | #define FW_MSG_CODE_LIC_CHALLENGE 0xff010000 |
| 1306 | #define FW_MSG_CODE_LIC_RESPONSE 0xff020000 |
| 1307 | #define FW_MSG_CODE_VIRT_MAC_PRIM 0xff030000 |
| 1308 | #define FW_MSG_CODE_VIRT_MAC_ISCSI 0xff040000 |
| 1309 | |
| 1310 | #define FW_MSG_SEQ_NUMBER_MASK 0x0000ffff |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1311 | |
| 1312 | u32 fw_mb_param; |
| 1313 | |
| 1314 | u32 drv_pulse_mb; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1315 | #define DRV_PULSE_SEQ_MASK 0x00007fff |
| 1316 | #define DRV_PULSE_SYSTEM_TIME_MASK 0xffff0000 |
| 1317 | /* |
| 1318 | * The system time is in the format of |
| 1319 | * (year-2001)*12*32 + month*32 + day. |
| 1320 | */ |
| 1321 | #define DRV_PULSE_ALWAYS_ALIVE 0x00008000 |
| 1322 | /* |
| 1323 | * Indicate to the firmware not to go into the |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1324 | * OS-absent when it is not getting driver pulse. |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1325 | * This is used for debugging as well for PXE(MBA). |
| 1326 | */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1327 | |
| 1328 | u32 mcp_pulse_mb; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1329 | #define MCP_PULSE_SEQ_MASK 0x00007fff |
| 1330 | #define MCP_PULSE_ALWAYS_ALIVE 0x00008000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1331 | /* Indicates to the driver not to assert due to lack |
| 1332 | * of MCP response */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1333 | #define MCP_EVENT_MASK 0xffff0000 |
| 1334 | #define MCP_EVENT_OTHER_DRIVER_RESET_REQ 0x00010000 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1335 | |
| 1336 | u32 iscsi_boot_signature; |
| 1337 | u32 iscsi_boot_block_offset; |
| 1338 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1339 | u32 drv_status; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1340 | #define DRV_STATUS_PMF 0x00000001 |
| 1341 | #define DRV_STATUS_VF_DISABLED 0x00000002 |
| 1342 | #define DRV_STATUS_SET_MF_BW 0x00000004 |
| 1343 | #define DRV_STATUS_LINK_EVENT 0x00000008 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1344 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1345 | #define DRV_STATUS_DCC_EVENT_MASK 0x0000ff00 |
| 1346 | #define DRV_STATUS_DCC_DISABLE_ENABLE_PF 0x00000100 |
| 1347 | #define DRV_STATUS_DCC_BANDWIDTH_ALLOCATION 0x00000200 |
| 1348 | #define DRV_STATUS_DCC_CHANGE_MAC_ADDRESS 0x00000400 |
| 1349 | #define DRV_STATUS_DCC_RESERVED1 0x00000800 |
| 1350 | #define DRV_STATUS_DCC_SET_PROTOCOL 0x00001000 |
| 1351 | #define DRV_STATUS_DCC_SET_PRIORITY 0x00002000 |
| 1352 | |
| 1353 | #define DRV_STATUS_DCBX_EVENT_MASK 0x000f0000 |
| 1354 | #define DRV_STATUS_DCBX_NEGOTIATION_RESULTS 0x00010000 |
Barak Witkowski | 1d187b3 | 2011-12-05 22:41:50 +0000 | [diff] [blame] | 1355 | #define DRV_STATUS_DRV_INFO_REQ 0x04000000 |
Eilon Greenstein | 2691d51 | 2009-08-12 08:22:08 +0000 | [diff] [blame] | 1356 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1357 | u32 virt_mac_upper; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1358 | #define VIRT_MAC_SIGN_MASK 0xffff0000 |
| 1359 | #define VIRT_MAC_SIGNATURE 0x564d0000 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1360 | u32 virt_mac_lower; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1361 | |
| 1362 | }; |
| 1363 | |
| 1364 | |
| 1365 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1366 | * Management firmware state * |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1367 | ****************************************************************************/ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1368 | /* Allocate 440 bytes for management firmware */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1369 | #define MGMTFW_STATE_WORD_SIZE 110 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1370 | |
| 1371 | struct mgmtfw_state { |
| 1372 | u32 opaque[MGMTFW_STATE_WORD_SIZE]; |
| 1373 | }; |
| 1374 | |
| 1375 | |
| 1376 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1377 | * Multi-Function configuration * |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1378 | ****************************************************************************/ |
| 1379 | struct shared_mf_cfg { |
| 1380 | |
| 1381 | u32 clp_mb; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1382 | #define SHARED_MF_CLP_SET_DEFAULT 0x00000000 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1383 | /* set by CLP */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1384 | #define SHARED_MF_CLP_EXIT 0x00000001 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1385 | /* set by MCP */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1386 | #define SHARED_MF_CLP_EXIT_DONE 0x00010000 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1387 | |
| 1388 | }; |
| 1389 | |
| 1390 | struct port_mf_cfg { |
| 1391 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1392 | u32 dynamic_cfg; /* device control channel */ |
| 1393 | #define PORT_MF_CFG_E1HOV_TAG_MASK 0x0000ffff |
| 1394 | #define PORT_MF_CFG_E1HOV_TAG_SHIFT 0 |
| 1395 | #define PORT_MF_CFG_E1HOV_TAG_DEFAULT PORT_MF_CFG_E1HOV_TAG_MASK |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1396 | |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 1397 | u32 reserved[1]; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1398 | |
| 1399 | }; |
| 1400 | |
| 1401 | struct func_mf_cfg { |
| 1402 | |
| 1403 | u32 config; |
| 1404 | /* E/R/I/D */ |
| 1405 | /* function 0 of each port cannot be hidden */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1406 | #define FUNC_MF_CFG_FUNC_HIDE 0x00000001 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1407 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1408 | #define FUNC_MF_CFG_PROTOCOL_MASK 0x00000006 |
| 1409 | #define FUNC_MF_CFG_PROTOCOL_FCOE 0x00000000 |
| 1410 | #define FUNC_MF_CFG_PROTOCOL_ETHERNET 0x00000002 |
| 1411 | #define FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA 0x00000004 |
| 1412 | #define FUNC_MF_CFG_PROTOCOL_ISCSI 0x00000006 |
| 1413 | #define FUNC_MF_CFG_PROTOCOL_DEFAULT \ |
| 1414 | FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1415 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1416 | #define FUNC_MF_CFG_FUNC_DISABLED 0x00000008 |
| 1417 | #define FUNC_MF_CFG_FUNC_DELETED 0x00000010 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1418 | |
| 1419 | /* PRI */ |
| 1420 | /* 0 - low priority, 3 - high priority */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1421 | #define FUNC_MF_CFG_TRANSMIT_PRIORITY_MASK 0x00000300 |
| 1422 | #define FUNC_MF_CFG_TRANSMIT_PRIORITY_SHIFT 8 |
| 1423 | #define FUNC_MF_CFG_TRANSMIT_PRIORITY_DEFAULT 0x00000000 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1424 | |
| 1425 | /* MINBW, MAXBW */ |
| 1426 | /* value range - 0..100, increments in 100Mbps */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1427 | #define FUNC_MF_CFG_MIN_BW_MASK 0x00ff0000 |
| 1428 | #define FUNC_MF_CFG_MIN_BW_SHIFT 16 |
| 1429 | #define FUNC_MF_CFG_MIN_BW_DEFAULT 0x00000000 |
| 1430 | #define FUNC_MF_CFG_MAX_BW_MASK 0xff000000 |
| 1431 | #define FUNC_MF_CFG_MAX_BW_SHIFT 24 |
| 1432 | #define FUNC_MF_CFG_MAX_BW_DEFAULT 0x64000000 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1433 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1434 | u32 mac_upper; /* MAC */ |
| 1435 | #define FUNC_MF_CFG_UPPERMAC_MASK 0x0000ffff |
| 1436 | #define FUNC_MF_CFG_UPPERMAC_SHIFT 0 |
| 1437 | #define FUNC_MF_CFG_UPPERMAC_DEFAULT FUNC_MF_CFG_UPPERMAC_MASK |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1438 | u32 mac_lower; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1439 | #define FUNC_MF_CFG_LOWERMAC_DEFAULT 0xffffffff |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1440 | |
| 1441 | u32 e1hov_tag; /* VNI */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1442 | #define FUNC_MF_CFG_E1HOV_TAG_MASK 0x0000ffff |
| 1443 | #define FUNC_MF_CFG_E1HOV_TAG_SHIFT 0 |
| 1444 | #define FUNC_MF_CFG_E1HOV_TAG_DEFAULT FUNC_MF_CFG_E1HOV_TAG_MASK |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1445 | |
| 1446 | u32 reserved[2]; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1447 | }; |
| 1448 | |
Dmitry Kravkov | 0793f83f | 2010-12-01 12:39:28 -0800 | [diff] [blame] | 1449 | /* This structure is not applicable and should not be accessed on 57711 */ |
| 1450 | struct func_ext_cfg { |
| 1451 | u32 func_cfg; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1452 | #define MACP_FUNC_CFG_FLAGS_MASK 0x000000FF |
| 1453 | #define MACP_FUNC_CFG_FLAGS_SHIFT 0 |
| 1454 | #define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001 |
| 1455 | #define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002 |
| 1456 | #define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004 |
| 1457 | #define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008 |
Dmitry Kravkov | 0793f83f | 2010-12-01 12:39:28 -0800 | [diff] [blame] | 1458 | |
| 1459 | u32 iscsi_mac_addr_upper; |
| 1460 | u32 iscsi_mac_addr_lower; |
| 1461 | |
| 1462 | u32 fcoe_mac_addr_upper; |
| 1463 | u32 fcoe_mac_addr_lower; |
| 1464 | |
| 1465 | u32 fcoe_wwn_port_name_upper; |
| 1466 | u32 fcoe_wwn_port_name_lower; |
| 1467 | |
| 1468 | u32 fcoe_wwn_node_name_upper; |
| 1469 | u32 fcoe_wwn_node_name_lower; |
| 1470 | |
| 1471 | u32 preserve_data; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1472 | #define MF_FUNC_CFG_PRESERVE_L2_MAC (1<<0) |
| 1473 | #define MF_FUNC_CFG_PRESERVE_ISCSI_MAC (1<<1) |
| 1474 | #define MF_FUNC_CFG_PRESERVE_FCOE_MAC (1<<2) |
| 1475 | #define MF_FUNC_CFG_PRESERVE_FCOE_WWN_P (1<<3) |
| 1476 | #define MF_FUNC_CFG_PRESERVE_FCOE_WWN_N (1<<4) |
| 1477 | #define MF_FUNC_CFG_PRESERVE_TX_BW (1<<5) |
Dmitry Kravkov | 0793f83f | 2010-12-01 12:39:28 -0800 | [diff] [blame] | 1478 | }; |
| 1479 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1480 | struct mf_cfg { |
| 1481 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1482 | struct shared_mf_cfg shared_mf_config; /* 0x4 */ |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 1483 | /* 0x8*2*2=0x20 */ |
| 1484 | struct port_mf_cfg port_mf_config[NVM_PATH_MAX][PORT_MAX]; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1485 | /* for all chips, there are 8 mf functions */ |
| 1486 | struct func_mf_cfg func_mf_config[E1H_FUNC_MAX]; /* 0x18 * 8 = 0xc0 */ |
| 1487 | /* |
| 1488 | * Extended configuration per function - this array does not exist and |
| 1489 | * should not be accessed on 57711 |
| 1490 | */ |
| 1491 | struct func_ext_cfg func_ext_config[E1H_FUNC_MAX]; /* 0x28 * 8 = 0x140*/ |
| 1492 | }; /* 0x224 */ |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1493 | |
| 1494 | /**************************************************************************** |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1495 | * Shared Memory Region * |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1496 | ****************************************************************************/ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1497 | struct shmem_region { /* SharedMem Offset (size) */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1498 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1499 | u32 validity_map[PORT_MAX]; /* 0x0 (4*2 = 0x8) */ |
| 1500 | #define SHR_MEM_FORMAT_REV_MASK 0xff000000 |
| 1501 | #define SHR_MEM_FORMAT_REV_ID ('A'<<24) |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1502 | /* validity bits */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1503 | #define SHR_MEM_VALIDITY_PCI_CFG 0x00100000 |
| 1504 | #define SHR_MEM_VALIDITY_MB 0x00200000 |
| 1505 | #define SHR_MEM_VALIDITY_DEV_INFO 0x00400000 |
| 1506 | #define SHR_MEM_VALIDITY_RESERVED 0x00000007 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1507 | /* One licensing bit should be set */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1508 | #define SHR_MEM_VALIDITY_LIC_KEY_IN_EFFECT_MASK 0x00000038 |
| 1509 | #define SHR_MEM_VALIDITY_LIC_MANUF_KEY_IN_EFFECT 0x00000008 |
| 1510 | #define SHR_MEM_VALIDITY_LIC_UPGRADE_KEY_IN_EFFECT 0x00000010 |
| 1511 | #define SHR_MEM_VALIDITY_LIC_NO_KEY_IN_EFFECT 0x00000020 |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1512 | /* Active MFW */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1513 | #define SHR_MEM_VALIDITY_ACTIVE_MFW_UNKNOWN 0x00000000 |
| 1514 | #define SHR_MEM_VALIDITY_ACTIVE_MFW_MASK 0x000001c0 |
| 1515 | #define SHR_MEM_VALIDITY_ACTIVE_MFW_IPMI 0x00000040 |
| 1516 | #define SHR_MEM_VALIDITY_ACTIVE_MFW_UMP 0x00000080 |
| 1517 | #define SHR_MEM_VALIDITY_ACTIVE_MFW_NCSI 0x000000c0 |
| 1518 | #define SHR_MEM_VALIDITY_ACTIVE_MFW_NONE 0x000001c0 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1519 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1520 | struct shm_dev_info dev_info; /* 0x8 (0x438) */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1521 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1522 | struct license_key drv_lic_key[PORT_MAX]; /* 0x440 (52*2=0x68) */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1523 | |
| 1524 | /* FW information (for internal FW use) */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1525 | u32 fw_info_fio_offset; /* 0x4a8 (0x4) */ |
| 1526 | struct mgmtfw_state mgmtfw_state; /* 0x4ac (0x1b8) */ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1527 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1528 | struct drv_port_mb port_mb[PORT_MAX]; /* 0x664 (16*2=0x20) */ |
| 1529 | |
| 1530 | #ifdef BMAPI |
| 1531 | /* This is a variable length array */ |
| 1532 | /* the number of function depends on the chip type */ |
| 1533 | struct drv_func_mb func_mb[1]; /* 0x684 (44*2/4/8=0x58/0xb0/0x160) */ |
| 1534 | #else |
| 1535 | /* the number of function depends on the chip type */ |
| 1536 | struct drv_func_mb func_mb[]; /* 0x684 (44*2/4/8=0x58/0xb0/0x160) */ |
| 1537 | #endif /* BMAPI */ |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 1538 | |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 1539 | }; /* 57710 = 0x6dc | 57711 = 0x7E4 | 57712 = 0x734 */ |
Eliezer Tamir | f141064 | 2008-02-28 11:51:50 -0800 | [diff] [blame] | 1540 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1541 | /**************************************************************************** |
| 1542 | * Shared Memory 2 Region * |
| 1543 | ****************************************************************************/ |
| 1544 | /* The fw_flr_ack is actually built in the following way: */ |
| 1545 | /* 8 bit: PF ack */ |
| 1546 | /* 64 bit: VF ack */ |
| 1547 | /* 8 bit: ios_dis_ack */ |
| 1548 | /* In order to maintain endianity in the mailbox hsi, we want to keep using */ |
| 1549 | /* u32. The fw must have the VF right after the PF since this is how it */ |
| 1550 | /* access arrays(it expects always the VF to reside after the PF, and that */ |
| 1551 | /* makes the calculation much easier for it. ) */ |
| 1552 | /* In order to answer both limitations, and keep the struct small, the code */ |
| 1553 | /* will abuse the structure defined here to achieve the actual partition */ |
| 1554 | /* above */ |
| 1555 | /****************************************************************************/ |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 1556 | struct fw_flr_ack { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1557 | u32 pf_ack; |
| 1558 | u32 vf_ack[1]; |
| 1559 | u32 iov_dis_ack; |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 1560 | }; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 1561 | |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 1562 | struct fw_flr_mb { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1563 | u32 aggint; |
| 1564 | u32 opgen_addr; |
| 1565 | struct fw_flr_ack ack; |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 1566 | }; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1567 | |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1568 | /**** SUPPORT FOR SHMEM ARRRAYS *** |
| 1569 | * The SHMEM HSI is aligned on 32 bit boundaries which makes it difficult to |
| 1570 | * define arrays with storage types smaller then unsigned dwords. |
| 1571 | * The macros below add generic support for SHMEM arrays with numeric elements |
| 1572 | * that can span 2,4,8 or 16 bits. The array underlying type is a 32 bit dword |
| 1573 | * array with individual bit-filed elements accessed using shifts and masks. |
| 1574 | * |
| 1575 | */ |
| 1576 | |
| 1577 | /* eb is the bitwidth of a single element */ |
| 1578 | #define SHMEM_ARRAY_MASK(eb) ((1<<(eb))-1) |
| 1579 | #define SHMEM_ARRAY_ENTRY(i, eb) ((i)/(32/(eb))) |
| 1580 | |
| 1581 | /* the bit-position macro allows the used to flip the order of the arrays |
| 1582 | * elements on a per byte or word boundary. |
| 1583 | * |
| 1584 | * example: an array with 8 entries each 4 bit wide. This array will fit into |
| 1585 | * a single dword. The diagrmas below show the array order of the nibbles. |
| 1586 | * |
| 1587 | * SHMEM_ARRAY_BITPOS(i, 4, 4) defines the stadard ordering: |
| 1588 | * |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1589 | * | | | | |
| 1590 | * 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
| 1591 | * | | | | |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1592 | * |
| 1593 | * SHMEM_ARRAY_BITPOS(i, 4, 8) defines a flip ordering per byte: |
| 1594 | * |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1595 | * | | | | |
| 1596 | * 1 | 0 | 3 | 2 | 5 | 4 | 7 | 6 | |
| 1597 | * | | | | |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1598 | * |
| 1599 | * SHMEM_ARRAY_BITPOS(i, 4, 16) defines a flip ordering per word: |
| 1600 | * |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1601 | * | | | | |
| 1602 | * 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | |
| 1603 | * | | | | |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1604 | */ |
| 1605 | #define SHMEM_ARRAY_BITPOS(i, eb, fb) \ |
| 1606 | ((((32/(fb)) - 1 - ((i)/((fb)/(eb))) % (32/(fb))) * (fb)) + \ |
| 1607 | (((i)%((fb)/(eb))) * (eb))) |
| 1608 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1609 | #define SHMEM_ARRAY_GET(a, i, eb, fb) \ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1610 | ((a[SHMEM_ARRAY_ENTRY(i, eb)] >> SHMEM_ARRAY_BITPOS(i, eb, fb)) & \ |
| 1611 | SHMEM_ARRAY_MASK(eb)) |
| 1612 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1613 | #define SHMEM_ARRAY_SET(a, i, eb, fb, val) \ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1614 | do { \ |
| 1615 | a[SHMEM_ARRAY_ENTRY(i, eb)] &= ~(SHMEM_ARRAY_MASK(eb) << \ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1616 | SHMEM_ARRAY_BITPOS(i, eb, fb)); \ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1617 | a[SHMEM_ARRAY_ENTRY(i, eb)] |= (((val) & SHMEM_ARRAY_MASK(eb)) << \ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1618 | SHMEM_ARRAY_BITPOS(i, eb, fb)); \ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1619 | } while (0) |
| 1620 | |
| 1621 | |
| 1622 | /****START OF DCBX STRUCTURES DECLARATIONS****/ |
| 1623 | #define DCBX_MAX_NUM_PRI_PG_ENTRIES 8 |
| 1624 | #define DCBX_PRI_PG_BITWIDTH 4 |
| 1625 | #define DCBX_PRI_PG_FBITS 8 |
| 1626 | #define DCBX_PRI_PG_GET(a, i) \ |
| 1627 | SHMEM_ARRAY_GET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS) |
| 1628 | #define DCBX_PRI_PG_SET(a, i, val) \ |
| 1629 | SHMEM_ARRAY_SET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS, val) |
| 1630 | #define DCBX_MAX_NUM_PG_BW_ENTRIES 8 |
| 1631 | #define DCBX_BW_PG_BITWIDTH 8 |
| 1632 | #define DCBX_PG_BW_GET(a, i) \ |
| 1633 | SHMEM_ARRAY_GET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH) |
| 1634 | #define DCBX_PG_BW_SET(a, i, val) \ |
| 1635 | SHMEM_ARRAY_SET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH, val) |
| 1636 | #define DCBX_STRICT_PRI_PG 15 |
| 1637 | #define DCBX_MAX_APP_PROTOCOL 16 |
| 1638 | #define FCOE_APP_IDX 0 |
| 1639 | #define ISCSI_APP_IDX 1 |
| 1640 | #define PREDEFINED_APP_IDX_MAX 2 |
| 1641 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1642 | |
| 1643 | /* Big/Little endian have the same representation. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1644 | struct dcbx_ets_feature { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1645 | /* |
| 1646 | * For Admin MIB - is this feature supported by the |
| 1647 | * driver | For Local MIB - should this feature be enabled. |
| 1648 | */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1649 | u32 enabled; |
| 1650 | u32 pg_bw_tbl[2]; |
| 1651 | u32 pri_pg_tbl[1]; |
| 1652 | }; |
| 1653 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1654 | /* Driver structure in LE */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1655 | struct dcbx_pfc_feature { |
| 1656 | #ifdef __BIG_ENDIAN |
| 1657 | u8 pri_en_bitmap; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1658 | #define DCBX_PFC_PRI_0 0x01 |
| 1659 | #define DCBX_PFC_PRI_1 0x02 |
| 1660 | #define DCBX_PFC_PRI_2 0x04 |
| 1661 | #define DCBX_PFC_PRI_3 0x08 |
| 1662 | #define DCBX_PFC_PRI_4 0x10 |
| 1663 | #define DCBX_PFC_PRI_5 0x20 |
| 1664 | #define DCBX_PFC_PRI_6 0x40 |
| 1665 | #define DCBX_PFC_PRI_7 0x80 |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1666 | u8 pfc_caps; |
| 1667 | u8 reserved; |
| 1668 | u8 enabled; |
| 1669 | #elif defined(__LITTLE_ENDIAN) |
| 1670 | u8 enabled; |
| 1671 | u8 reserved; |
| 1672 | u8 pfc_caps; |
| 1673 | u8 pri_en_bitmap; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1674 | #define DCBX_PFC_PRI_0 0x01 |
| 1675 | #define DCBX_PFC_PRI_1 0x02 |
| 1676 | #define DCBX_PFC_PRI_2 0x04 |
| 1677 | #define DCBX_PFC_PRI_3 0x08 |
| 1678 | #define DCBX_PFC_PRI_4 0x10 |
| 1679 | #define DCBX_PFC_PRI_5 0x20 |
| 1680 | #define DCBX_PFC_PRI_6 0x40 |
| 1681 | #define DCBX_PFC_PRI_7 0x80 |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1682 | #endif |
| 1683 | }; |
| 1684 | |
| 1685 | struct dcbx_app_priority_entry { |
| 1686 | #ifdef __BIG_ENDIAN |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1687 | u16 app_id; |
| 1688 | u8 pri_bitmap; |
| 1689 | u8 appBitfield; |
| 1690 | #define DCBX_APP_ENTRY_VALID 0x01 |
| 1691 | #define DCBX_APP_ENTRY_SF_MASK 0x30 |
| 1692 | #define DCBX_APP_ENTRY_SF_SHIFT 4 |
| 1693 | #define DCBX_APP_SF_ETH_TYPE 0x10 |
| 1694 | #define DCBX_APP_SF_PORT 0x20 |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1695 | #elif defined(__LITTLE_ENDIAN) |
| 1696 | u8 appBitfield; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1697 | #define DCBX_APP_ENTRY_VALID 0x01 |
| 1698 | #define DCBX_APP_ENTRY_SF_MASK 0x30 |
| 1699 | #define DCBX_APP_ENTRY_SF_SHIFT 4 |
| 1700 | #define DCBX_APP_SF_ETH_TYPE 0x10 |
| 1701 | #define DCBX_APP_SF_PORT 0x20 |
| 1702 | u8 pri_bitmap; |
| 1703 | u16 app_id; |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1704 | #endif |
| 1705 | }; |
| 1706 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1707 | |
| 1708 | /* FW structure in BE */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1709 | struct dcbx_app_priority_feature { |
| 1710 | #ifdef __BIG_ENDIAN |
| 1711 | u8 reserved; |
| 1712 | u8 default_pri; |
| 1713 | u8 tc_supported; |
| 1714 | u8 enabled; |
| 1715 | #elif defined(__LITTLE_ENDIAN) |
| 1716 | u8 enabled; |
| 1717 | u8 tc_supported; |
| 1718 | u8 default_pri; |
| 1719 | u8 reserved; |
| 1720 | #endif |
| 1721 | struct dcbx_app_priority_entry app_pri_tbl[DCBX_MAX_APP_PROTOCOL]; |
| 1722 | }; |
| 1723 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1724 | /* FW structure in BE */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1725 | struct dcbx_features { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1726 | /* PG feature */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1727 | struct dcbx_ets_feature ets; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1728 | /* PFC feature */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1729 | struct dcbx_pfc_feature pfc; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1730 | /* APP feature */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1731 | struct dcbx_app_priority_feature app; |
| 1732 | }; |
| 1733 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1734 | /* LLDP protocol parameters */ |
| 1735 | /* FW structure in BE */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1736 | struct lldp_params { |
| 1737 | #ifdef __BIG_ENDIAN |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1738 | u8 msg_fast_tx_interval; |
| 1739 | u8 msg_tx_hold; |
| 1740 | u8 msg_tx_interval; |
| 1741 | u8 admin_status; |
| 1742 | #define LLDP_TX_ONLY 0x01 |
| 1743 | #define LLDP_RX_ONLY 0x02 |
| 1744 | #define LLDP_TX_RX 0x03 |
| 1745 | #define LLDP_DISABLED 0x04 |
| 1746 | u8 reserved1; |
| 1747 | u8 tx_fast; |
| 1748 | u8 tx_crd_max; |
| 1749 | u8 tx_crd; |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1750 | #elif defined(__LITTLE_ENDIAN) |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1751 | u8 admin_status; |
| 1752 | #define LLDP_TX_ONLY 0x01 |
| 1753 | #define LLDP_RX_ONLY 0x02 |
| 1754 | #define LLDP_TX_RX 0x03 |
| 1755 | #define LLDP_DISABLED 0x04 |
| 1756 | u8 msg_tx_interval; |
| 1757 | u8 msg_tx_hold; |
| 1758 | u8 msg_fast_tx_interval; |
| 1759 | u8 tx_crd; |
| 1760 | u8 tx_crd_max; |
| 1761 | u8 tx_fast; |
| 1762 | u8 reserved1; |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1763 | #endif |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1764 | #define REM_CHASSIS_ID_STAT_LEN 4 |
| 1765 | #define REM_PORT_ID_STAT_LEN 4 |
| 1766 | /* Holds remote Chassis ID TLV header, subtype and 9B of payload. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1767 | u32 peer_chassis_id[REM_CHASSIS_ID_STAT_LEN]; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1768 | /* Holds remote Port ID TLV header, subtype and 9B of payload. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1769 | u32 peer_port_id[REM_PORT_ID_STAT_LEN]; |
| 1770 | }; |
| 1771 | |
| 1772 | struct lldp_dcbx_stat { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1773 | #define LOCAL_CHASSIS_ID_STAT_LEN 2 |
| 1774 | #define LOCAL_PORT_ID_STAT_LEN 2 |
| 1775 | /* Holds local Chassis ID 8B payload of constant subtype 4. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1776 | u32 local_chassis_id[LOCAL_CHASSIS_ID_STAT_LEN]; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1777 | /* Holds local Port ID 8B payload of constant subtype 3. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1778 | u32 local_port_id[LOCAL_PORT_ID_STAT_LEN]; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1779 | /* Number of DCBX frames transmitted. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1780 | u32 num_tx_dcbx_pkts; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1781 | /* Number of DCBX frames received. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1782 | u32 num_rx_dcbx_pkts; |
| 1783 | }; |
| 1784 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1785 | /* ADMIN MIB - DCBX local machine default configuration. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1786 | struct lldp_admin_mib { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1787 | u32 ver_cfg_flags; |
| 1788 | #define DCBX_ETS_CONFIG_TX_ENABLED 0x00000001 |
| 1789 | #define DCBX_PFC_CONFIG_TX_ENABLED 0x00000002 |
| 1790 | #define DCBX_APP_CONFIG_TX_ENABLED 0x00000004 |
| 1791 | #define DCBX_ETS_RECO_TX_ENABLED 0x00000008 |
| 1792 | #define DCBX_ETS_RECO_VALID 0x00000010 |
| 1793 | #define DCBX_ETS_WILLING 0x00000020 |
| 1794 | #define DCBX_PFC_WILLING 0x00000040 |
| 1795 | #define DCBX_APP_WILLING 0x00000080 |
| 1796 | #define DCBX_VERSION_CEE 0x00000100 |
| 1797 | #define DCBX_VERSION_IEEE 0x00000200 |
| 1798 | #define DCBX_DCBX_ENABLED 0x00000400 |
| 1799 | #define DCBX_CEE_VERSION_MASK 0x0000f000 |
| 1800 | #define DCBX_CEE_VERSION_SHIFT 12 |
| 1801 | #define DCBX_CEE_MAX_VERSION_MASK 0x000f0000 |
| 1802 | #define DCBX_CEE_MAX_VERSION_SHIFT 16 |
| 1803 | struct dcbx_features features; |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1804 | }; |
| 1805 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1806 | /* REMOTE MIB - remote machine DCBX configuration. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1807 | struct lldp_remote_mib { |
| 1808 | u32 prefix_seq_num; |
| 1809 | u32 flags; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1810 | #define DCBX_ETS_TLV_RX 0x00000001 |
| 1811 | #define DCBX_PFC_TLV_RX 0x00000002 |
| 1812 | #define DCBX_APP_TLV_RX 0x00000004 |
| 1813 | #define DCBX_ETS_RX_ERROR 0x00000010 |
| 1814 | #define DCBX_PFC_RX_ERROR 0x00000020 |
| 1815 | #define DCBX_APP_RX_ERROR 0x00000040 |
| 1816 | #define DCBX_ETS_REM_WILLING 0x00000100 |
| 1817 | #define DCBX_PFC_REM_WILLING 0x00000200 |
| 1818 | #define DCBX_APP_REM_WILLING 0x00000400 |
| 1819 | #define DCBX_REMOTE_ETS_RECO_VALID 0x00001000 |
| 1820 | #define DCBX_REMOTE_MIB_VALID 0x00002000 |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1821 | struct dcbx_features features; |
| 1822 | u32 suffix_seq_num; |
| 1823 | }; |
| 1824 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1825 | /* LOCAL MIB - operational DCBX configuration - transmitted on Tx LLDPDU. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1826 | struct lldp_local_mib { |
| 1827 | u32 prefix_seq_num; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1828 | /* Indicates if there is mismatch with negotiation results. */ |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1829 | u32 error; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1830 | #define DCBX_LOCAL_ETS_ERROR 0x00000001 |
| 1831 | #define DCBX_LOCAL_PFC_ERROR 0x00000002 |
| 1832 | #define DCBX_LOCAL_APP_ERROR 0x00000004 |
| 1833 | #define DCBX_LOCAL_PFC_MISMATCH 0x00000010 |
| 1834 | #define DCBX_LOCAL_APP_MISMATCH 0x00000020 |
Dmitry Kravkov | 6debea8 | 2011-07-19 01:42:04 +0000 | [diff] [blame] | 1835 | #define DCBX_REMOTE_MIB_ERROR 0x00000040 |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 1836 | struct dcbx_features features; |
| 1837 | u32 suffix_seq_num; |
| 1838 | }; |
| 1839 | /***END OF DCBX STRUCTURES DECLARATIONS***/ |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 1840 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1841 | struct ncsi_oem_fcoe_features { |
| 1842 | u32 fcoe_features1; |
| 1843 | #define FCOE_FEATURES1_IOS_PER_CONNECTION_MASK 0x0000FFFF |
| 1844 | #define FCOE_FEATURES1_IOS_PER_CONNECTION_OFFSET 0 |
| 1845 | |
| 1846 | #define FCOE_FEATURES1_LOGINS_PER_PORT_MASK 0xFFFF0000 |
| 1847 | #define FCOE_FEATURES1_LOGINS_PER_PORT_OFFSET 16 |
| 1848 | |
| 1849 | u32 fcoe_features2; |
| 1850 | #define FCOE_FEATURES2_EXCHANGES_MASK 0x0000FFFF |
| 1851 | #define FCOE_FEATURES2_EXCHANGES_OFFSET 0 |
| 1852 | |
| 1853 | #define FCOE_FEATURES2_NPIV_WWN_PER_PORT_MASK 0xFFFF0000 |
| 1854 | #define FCOE_FEATURES2_NPIV_WWN_PER_PORT_OFFSET 16 |
| 1855 | |
| 1856 | u32 fcoe_features3; |
| 1857 | #define FCOE_FEATURES3_TARGETS_SUPPORTED_MASK 0x0000FFFF |
| 1858 | #define FCOE_FEATURES3_TARGETS_SUPPORTED_OFFSET 0 |
| 1859 | |
| 1860 | #define FCOE_FEATURES3_OUTSTANDING_COMMANDS_MASK 0xFFFF0000 |
| 1861 | #define FCOE_FEATURES3_OUTSTANDING_COMMANDS_OFFSET 16 |
| 1862 | |
| 1863 | u32 fcoe_features4; |
| 1864 | #define FCOE_FEATURES4_FEATURE_SETTINGS_MASK 0x0000000F |
| 1865 | #define FCOE_FEATURES4_FEATURE_SETTINGS_OFFSET 0 |
| 1866 | }; |
| 1867 | |
| 1868 | struct ncsi_oem_data { |
| 1869 | u32 driver_version[4]; |
| 1870 | struct ncsi_oem_fcoe_features ncsi_oem_fcoe_features; |
| 1871 | }; |
| 1872 | |
Eilon Greenstein | 2691d51 | 2009-08-12 08:22:08 +0000 | [diff] [blame] | 1873 | struct shmem2_region { |
| 1874 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1875 | u32 size; /* 0x0000 */ |
Eilon Greenstein | 2691d51 | 2009-08-12 08:22:08 +0000 | [diff] [blame] | 1876 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1877 | u32 dcc_support; /* 0x0004 */ |
| 1878 | #define SHMEM_DCC_SUPPORT_NONE 0x00000000 |
| 1879 | #define SHMEM_DCC_SUPPORT_DISABLE_ENABLE_PF_TLV 0x00000001 |
| 1880 | #define SHMEM_DCC_SUPPORT_BANDWIDTH_ALLOCATION_TLV 0x00000004 |
| 1881 | #define SHMEM_DCC_SUPPORT_CHANGE_MAC_ADDRESS_TLV 0x00000008 |
| 1882 | #define SHMEM_DCC_SUPPORT_SET_PROTOCOL_TLV 0x00000040 |
| 1883 | #define SHMEM_DCC_SUPPORT_SET_PRIORITY_TLV 0x00000080 |
| 1884 | |
| 1885 | u32 ext_phy_fw_version2[PORT_MAX]; /* 0x0008 */ |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 1886 | /* |
| 1887 | * For backwards compatibility, if the mf_cfg_addr does not exist |
| 1888 | * (the size filed is smaller than 0xc) the mf_cfg resides at the |
| 1889 | * end of struct shmem_region |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1890 | */ |
| 1891 | u32 mf_cfg_addr; /* 0x0010 */ |
| 1892 | #define SHMEM_MF_CFG_ADDR_NONE 0x00000000 |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 1893 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1894 | struct fw_flr_mb flr_mb; /* 0x0014 */ |
| 1895 | u32 dcbx_lldp_params_offset; /* 0x0028 */ |
| 1896 | #define SHMEM_LLDP_DCBX_PARAMS_NONE 0x00000000 |
| 1897 | u32 dcbx_neg_res_offset; /* 0x002c */ |
| 1898 | #define SHMEM_DCBX_NEG_RES_NONE 0x00000000 |
| 1899 | u32 dcbx_remote_mib_offset; /* 0x0030 */ |
| 1900 | #define SHMEM_DCBX_REMOTE_MIB_NONE 0x00000000 |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 1901 | /* |
| 1902 | * The other shmemX_base_addr holds the other path's shmem address |
| 1903 | * required for example in case of common phy init, or for path1 to know |
| 1904 | * the address of mcp debug trace which is located in offset from shmem |
| 1905 | * of path0 |
Yaniv Rosner | a22f078 | 2010-09-07 11:41:20 +0000 | [diff] [blame] | 1906 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1907 | u32 other_shmem_base_addr; /* 0x0034 */ |
| 1908 | u32 other_shmem2_base_addr; /* 0x0038 */ |
| 1909 | /* |
| 1910 | * mcp_vf_disabled is set by the MCP to indicate the driver about VFs |
| 1911 | * which were disabled/flred |
| 1912 | */ |
| 1913 | u32 mcp_vf_disabled[E2_VF_MAX / 32]; /* 0x003c */ |
| 1914 | |
| 1915 | /* |
| 1916 | * drv_ack_vf_disabled is set by the PF driver to ack handled disabled |
| 1917 | * VFs |
| 1918 | */ |
| 1919 | u32 drv_ack_vf_disabled[E2_FUNC_MAX][E2_VF_MAX / 32]; /* 0x0044 */ |
| 1920 | |
| 1921 | u32 dcbx_lldp_dcbx_stat_offset; /* 0x0064 */ |
| 1922 | #define SHMEM_LLDP_DCBX_STAT_NONE 0x00000000 |
| 1923 | |
| 1924 | /* |
| 1925 | * edebug_driver_if field is used to transfer messages between edebug |
| 1926 | * app to the driver through shmem2. |
| 1927 | * |
| 1928 | * message format: |
| 1929 | * bits 0-2 - function number / instance of driver to perform request |
| 1930 | * bits 3-5 - op code / is_ack? |
| 1931 | * bits 6-63 - data |
| 1932 | */ |
| 1933 | u32 edebug_driver_if[2]; /* 0x0068 */ |
| 1934 | #define EDEBUG_DRIVER_IF_OP_CODE_GET_PHYS_ADDR 1 |
| 1935 | #define EDEBUG_DRIVER_IF_OP_CODE_GET_BUS_ADDR 2 |
| 1936 | #define EDEBUG_DRIVER_IF_OP_CODE_DISABLE_STAT 3 |
| 1937 | |
| 1938 | u32 nvm_retain_bitmap_addr; /* 0x0070 */ |
| 1939 | |
| 1940 | u32 reserved1; /* 0x0074 */ |
| 1941 | |
| 1942 | u32 reserved2[E2_FUNC_MAX]; |
| 1943 | |
| 1944 | u32 reserved3[E2_FUNC_MAX];/* 0x0088 */ |
| 1945 | u32 reserved4[E2_FUNC_MAX];/* 0x0098 */ |
| 1946 | |
| 1947 | u32 swim_base_addr; /* 0x0108 */ |
| 1948 | u32 swim_funcs; |
| 1949 | u32 swim_main_cb; |
| 1950 | |
| 1951 | u32 reserved5[2]; |
| 1952 | |
| 1953 | /* generic flags controlled by the driver */ |
| 1954 | u32 drv_flags; |
| 1955 | #define DRV_FLAGS_DCB_CONFIGURED 0x1 |
| 1956 | |
| 1957 | /* pointer to extended dev_info shared data copied from nvm image */ |
| 1958 | u32 extended_dev_info_shared_addr; |
| 1959 | u32 ncsi_oem_data_addr; |
| 1960 | |
Barak Witkowski | 1d187b3 | 2011-12-05 22:41:50 +0000 | [diff] [blame] | 1961 | u32 ocsd_host_addr; /* initialized by option ROM */ |
| 1962 | u32 ocbb_host_addr; /* initialized by option ROM */ |
| 1963 | u32 ocsd_req_update_interval; /* initialized by option ROM */ |
| 1964 | u32 temperature_in_half_celsius; |
| 1965 | u32 glob_struct_in_host; |
| 1966 | |
| 1967 | u32 dcbx_neg_res_ext_offset; |
| 1968 | #define SHMEM_DCBX_NEG_RES_EXT_NONE 0x00000000 |
| 1969 | |
| 1970 | u32 drv_capabilities_flag[E2_FUNC_MAX]; |
| 1971 | #define DRV_FLAGS_CAPABILITIES_LOADED_SUPPORTED 0x00000001 |
| 1972 | #define DRV_FLAGS_CAPABILITIES_LOADED_L2 0x00000002 |
| 1973 | #define DRV_FLAGS_CAPABILITIES_LOADED_FCOE 0x00000004 |
| 1974 | #define DRV_FLAGS_CAPABILITIES_LOADED_ISCSI 0x00000008 |
| 1975 | |
| 1976 | u32 extended_dev_info_shared_cfg_size; |
| 1977 | |
| 1978 | u32 dcbx_en[PORT_MAX]; |
| 1979 | |
| 1980 | /* The offset points to the multi threaded meta structure */ |
| 1981 | u32 multi_thread_data_offset; |
| 1982 | |
| 1983 | /* address of DMAable host address holding values from the drivers */ |
| 1984 | u32 drv_info_host_addr_lo; |
| 1985 | u32 drv_info_host_addr_hi; |
| 1986 | |
| 1987 | /* general values written by the MFW (such as current version) */ |
| 1988 | u32 drv_info_control; |
| 1989 | #define DRV_INFO_CONTROL_VER_MASK 0x000000ff |
| 1990 | #define DRV_INFO_CONTROL_VER_SHIFT 0 |
| 1991 | #define DRV_INFO_CONTROL_OP_CODE_MASK 0x0000ff00 |
| 1992 | #define DRV_INFO_CONTROL_OP_CODE_SHIFT 8 |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 1993 | u32 ibft_host_addr; /* initialized by option ROM */ |
Eilon Greenstein | 2691d51 | 2009-08-12 08:22:08 +0000 | [diff] [blame] | 1994 | }; |
| 1995 | |
| 1996 | |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 1997 | struct emac_stats { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 1998 | u32 rx_stat_ifhcinoctets; |
| 1999 | u32 rx_stat_ifhcinbadoctets; |
| 2000 | u32 rx_stat_etherstatsfragments; |
| 2001 | u32 rx_stat_ifhcinucastpkts; |
| 2002 | u32 rx_stat_ifhcinmulticastpkts; |
| 2003 | u32 rx_stat_ifhcinbroadcastpkts; |
| 2004 | u32 rx_stat_dot3statsfcserrors; |
| 2005 | u32 rx_stat_dot3statsalignmenterrors; |
| 2006 | u32 rx_stat_dot3statscarriersenseerrors; |
| 2007 | u32 rx_stat_xonpauseframesreceived; |
| 2008 | u32 rx_stat_xoffpauseframesreceived; |
| 2009 | u32 rx_stat_maccontrolframesreceived; |
| 2010 | u32 rx_stat_xoffstateentered; |
| 2011 | u32 rx_stat_dot3statsframestoolong; |
| 2012 | u32 rx_stat_etherstatsjabbers; |
| 2013 | u32 rx_stat_etherstatsundersizepkts; |
| 2014 | u32 rx_stat_etherstatspkts64octets; |
| 2015 | u32 rx_stat_etherstatspkts65octetsto127octets; |
| 2016 | u32 rx_stat_etherstatspkts128octetsto255octets; |
| 2017 | u32 rx_stat_etherstatspkts256octetsto511octets; |
| 2018 | u32 rx_stat_etherstatspkts512octetsto1023octets; |
| 2019 | u32 rx_stat_etherstatspkts1024octetsto1522octets; |
| 2020 | u32 rx_stat_etherstatspktsover1522octets; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2021 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2022 | u32 rx_stat_falsecarriererrors; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2023 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2024 | u32 tx_stat_ifhcoutoctets; |
| 2025 | u32 tx_stat_ifhcoutbadoctets; |
| 2026 | u32 tx_stat_etherstatscollisions; |
| 2027 | u32 tx_stat_outxonsent; |
| 2028 | u32 tx_stat_outxoffsent; |
| 2029 | u32 tx_stat_flowcontroldone; |
| 2030 | u32 tx_stat_dot3statssinglecollisionframes; |
| 2031 | u32 tx_stat_dot3statsmultiplecollisionframes; |
| 2032 | u32 tx_stat_dot3statsdeferredtransmissions; |
| 2033 | u32 tx_stat_dot3statsexcessivecollisions; |
| 2034 | u32 tx_stat_dot3statslatecollisions; |
| 2035 | u32 tx_stat_ifhcoutucastpkts; |
| 2036 | u32 tx_stat_ifhcoutmulticastpkts; |
| 2037 | u32 tx_stat_ifhcoutbroadcastpkts; |
| 2038 | u32 tx_stat_etherstatspkts64octets; |
| 2039 | u32 tx_stat_etherstatspkts65octetsto127octets; |
| 2040 | u32 tx_stat_etherstatspkts128octetsto255octets; |
| 2041 | u32 tx_stat_etherstatspkts256octetsto511octets; |
| 2042 | u32 tx_stat_etherstatspkts512octetsto1023octets; |
| 2043 | u32 tx_stat_etherstatspkts1024octetsto1522octets; |
| 2044 | u32 tx_stat_etherstatspktsover1522octets; |
| 2045 | u32 tx_stat_dot3statsinternalmactransmiterrors; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2046 | }; |
| 2047 | |
| 2048 | |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 2049 | struct bmac1_stats { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2050 | u32 tx_stat_gtpkt_lo; |
| 2051 | u32 tx_stat_gtpkt_hi; |
| 2052 | u32 tx_stat_gtxpf_lo; |
| 2053 | u32 tx_stat_gtxpf_hi; |
| 2054 | u32 tx_stat_gtfcs_lo; |
| 2055 | u32 tx_stat_gtfcs_hi; |
| 2056 | u32 tx_stat_gtmca_lo; |
| 2057 | u32 tx_stat_gtmca_hi; |
| 2058 | u32 tx_stat_gtbca_lo; |
| 2059 | u32 tx_stat_gtbca_hi; |
| 2060 | u32 tx_stat_gtfrg_lo; |
| 2061 | u32 tx_stat_gtfrg_hi; |
| 2062 | u32 tx_stat_gtovr_lo; |
| 2063 | u32 tx_stat_gtovr_hi; |
| 2064 | u32 tx_stat_gt64_lo; |
| 2065 | u32 tx_stat_gt64_hi; |
| 2066 | u32 tx_stat_gt127_lo; |
| 2067 | u32 tx_stat_gt127_hi; |
| 2068 | u32 tx_stat_gt255_lo; |
| 2069 | u32 tx_stat_gt255_hi; |
| 2070 | u32 tx_stat_gt511_lo; |
| 2071 | u32 tx_stat_gt511_hi; |
| 2072 | u32 tx_stat_gt1023_lo; |
| 2073 | u32 tx_stat_gt1023_hi; |
| 2074 | u32 tx_stat_gt1518_lo; |
| 2075 | u32 tx_stat_gt1518_hi; |
| 2076 | u32 tx_stat_gt2047_lo; |
| 2077 | u32 tx_stat_gt2047_hi; |
| 2078 | u32 tx_stat_gt4095_lo; |
| 2079 | u32 tx_stat_gt4095_hi; |
| 2080 | u32 tx_stat_gt9216_lo; |
| 2081 | u32 tx_stat_gt9216_hi; |
| 2082 | u32 tx_stat_gt16383_lo; |
| 2083 | u32 tx_stat_gt16383_hi; |
| 2084 | u32 tx_stat_gtmax_lo; |
| 2085 | u32 tx_stat_gtmax_hi; |
| 2086 | u32 tx_stat_gtufl_lo; |
| 2087 | u32 tx_stat_gtufl_hi; |
| 2088 | u32 tx_stat_gterr_lo; |
| 2089 | u32 tx_stat_gterr_hi; |
| 2090 | u32 tx_stat_gtbyt_lo; |
| 2091 | u32 tx_stat_gtbyt_hi; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2092 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2093 | u32 rx_stat_gr64_lo; |
| 2094 | u32 rx_stat_gr64_hi; |
| 2095 | u32 rx_stat_gr127_lo; |
| 2096 | u32 rx_stat_gr127_hi; |
| 2097 | u32 rx_stat_gr255_lo; |
| 2098 | u32 rx_stat_gr255_hi; |
| 2099 | u32 rx_stat_gr511_lo; |
| 2100 | u32 rx_stat_gr511_hi; |
| 2101 | u32 rx_stat_gr1023_lo; |
| 2102 | u32 rx_stat_gr1023_hi; |
| 2103 | u32 rx_stat_gr1518_lo; |
| 2104 | u32 rx_stat_gr1518_hi; |
| 2105 | u32 rx_stat_gr2047_lo; |
| 2106 | u32 rx_stat_gr2047_hi; |
| 2107 | u32 rx_stat_gr4095_lo; |
| 2108 | u32 rx_stat_gr4095_hi; |
| 2109 | u32 rx_stat_gr9216_lo; |
| 2110 | u32 rx_stat_gr9216_hi; |
| 2111 | u32 rx_stat_gr16383_lo; |
| 2112 | u32 rx_stat_gr16383_hi; |
| 2113 | u32 rx_stat_grmax_lo; |
| 2114 | u32 rx_stat_grmax_hi; |
| 2115 | u32 rx_stat_grpkt_lo; |
| 2116 | u32 rx_stat_grpkt_hi; |
| 2117 | u32 rx_stat_grfcs_lo; |
| 2118 | u32 rx_stat_grfcs_hi; |
| 2119 | u32 rx_stat_grmca_lo; |
| 2120 | u32 rx_stat_grmca_hi; |
| 2121 | u32 rx_stat_grbca_lo; |
| 2122 | u32 rx_stat_grbca_hi; |
| 2123 | u32 rx_stat_grxcf_lo; |
| 2124 | u32 rx_stat_grxcf_hi; |
| 2125 | u32 rx_stat_grxpf_lo; |
| 2126 | u32 rx_stat_grxpf_hi; |
| 2127 | u32 rx_stat_grxuo_lo; |
| 2128 | u32 rx_stat_grxuo_hi; |
| 2129 | u32 rx_stat_grjbr_lo; |
| 2130 | u32 rx_stat_grjbr_hi; |
| 2131 | u32 rx_stat_grovr_lo; |
| 2132 | u32 rx_stat_grovr_hi; |
| 2133 | u32 rx_stat_grflr_lo; |
| 2134 | u32 rx_stat_grflr_hi; |
| 2135 | u32 rx_stat_grmeg_lo; |
| 2136 | u32 rx_stat_grmeg_hi; |
| 2137 | u32 rx_stat_grmeb_lo; |
| 2138 | u32 rx_stat_grmeb_hi; |
| 2139 | u32 rx_stat_grbyt_lo; |
| 2140 | u32 rx_stat_grbyt_hi; |
| 2141 | u32 rx_stat_grund_lo; |
| 2142 | u32 rx_stat_grund_hi; |
| 2143 | u32 rx_stat_grfrg_lo; |
| 2144 | u32 rx_stat_grfrg_hi; |
| 2145 | u32 rx_stat_grerb_lo; |
| 2146 | u32 rx_stat_grerb_hi; |
| 2147 | u32 rx_stat_grfre_lo; |
| 2148 | u32 rx_stat_grfre_hi; |
| 2149 | u32 rx_stat_gripj_lo; |
| 2150 | u32 rx_stat_gripj_hi; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2151 | }; |
| 2152 | |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 2153 | struct bmac2_stats { |
| 2154 | u32 tx_stat_gtpk_lo; /* gtpok */ |
| 2155 | u32 tx_stat_gtpk_hi; /* gtpok */ |
| 2156 | u32 tx_stat_gtxpf_lo; /* gtpf */ |
| 2157 | u32 tx_stat_gtxpf_hi; /* gtpf */ |
| 2158 | u32 tx_stat_gtpp_lo; /* NEW BMAC2 */ |
| 2159 | u32 tx_stat_gtpp_hi; /* NEW BMAC2 */ |
| 2160 | u32 tx_stat_gtfcs_lo; |
| 2161 | u32 tx_stat_gtfcs_hi; |
| 2162 | u32 tx_stat_gtuca_lo; /* NEW BMAC2 */ |
| 2163 | u32 tx_stat_gtuca_hi; /* NEW BMAC2 */ |
| 2164 | u32 tx_stat_gtmca_lo; |
| 2165 | u32 tx_stat_gtmca_hi; |
| 2166 | u32 tx_stat_gtbca_lo; |
| 2167 | u32 tx_stat_gtbca_hi; |
| 2168 | u32 tx_stat_gtovr_lo; |
| 2169 | u32 tx_stat_gtovr_hi; |
| 2170 | u32 tx_stat_gtfrg_lo; |
| 2171 | u32 tx_stat_gtfrg_hi; |
| 2172 | u32 tx_stat_gtpkt1_lo; /* gtpkt */ |
| 2173 | u32 tx_stat_gtpkt1_hi; /* gtpkt */ |
| 2174 | u32 tx_stat_gt64_lo; |
| 2175 | u32 tx_stat_gt64_hi; |
| 2176 | u32 tx_stat_gt127_lo; |
| 2177 | u32 tx_stat_gt127_hi; |
| 2178 | u32 tx_stat_gt255_lo; |
| 2179 | u32 tx_stat_gt255_hi; |
| 2180 | u32 tx_stat_gt511_lo; |
| 2181 | u32 tx_stat_gt511_hi; |
| 2182 | u32 tx_stat_gt1023_lo; |
| 2183 | u32 tx_stat_gt1023_hi; |
| 2184 | u32 tx_stat_gt1518_lo; |
| 2185 | u32 tx_stat_gt1518_hi; |
| 2186 | u32 tx_stat_gt2047_lo; |
| 2187 | u32 tx_stat_gt2047_hi; |
| 2188 | u32 tx_stat_gt4095_lo; |
| 2189 | u32 tx_stat_gt4095_hi; |
| 2190 | u32 tx_stat_gt9216_lo; |
| 2191 | u32 tx_stat_gt9216_hi; |
| 2192 | u32 tx_stat_gt16383_lo; |
| 2193 | u32 tx_stat_gt16383_hi; |
| 2194 | u32 tx_stat_gtmax_lo; |
| 2195 | u32 tx_stat_gtmax_hi; |
| 2196 | u32 tx_stat_gtufl_lo; |
| 2197 | u32 tx_stat_gtufl_hi; |
| 2198 | u32 tx_stat_gterr_lo; |
| 2199 | u32 tx_stat_gterr_hi; |
| 2200 | u32 tx_stat_gtbyt_lo; |
| 2201 | u32 tx_stat_gtbyt_hi; |
| 2202 | |
| 2203 | u32 rx_stat_gr64_lo; |
| 2204 | u32 rx_stat_gr64_hi; |
| 2205 | u32 rx_stat_gr127_lo; |
| 2206 | u32 rx_stat_gr127_hi; |
| 2207 | u32 rx_stat_gr255_lo; |
| 2208 | u32 rx_stat_gr255_hi; |
| 2209 | u32 rx_stat_gr511_lo; |
| 2210 | u32 rx_stat_gr511_hi; |
| 2211 | u32 rx_stat_gr1023_lo; |
| 2212 | u32 rx_stat_gr1023_hi; |
| 2213 | u32 rx_stat_gr1518_lo; |
| 2214 | u32 rx_stat_gr1518_hi; |
| 2215 | u32 rx_stat_gr2047_lo; |
| 2216 | u32 rx_stat_gr2047_hi; |
| 2217 | u32 rx_stat_gr4095_lo; |
| 2218 | u32 rx_stat_gr4095_hi; |
| 2219 | u32 rx_stat_gr9216_lo; |
| 2220 | u32 rx_stat_gr9216_hi; |
| 2221 | u32 rx_stat_gr16383_lo; |
| 2222 | u32 rx_stat_gr16383_hi; |
| 2223 | u32 rx_stat_grmax_lo; |
| 2224 | u32 rx_stat_grmax_hi; |
| 2225 | u32 rx_stat_grpkt_lo; |
| 2226 | u32 rx_stat_grpkt_hi; |
| 2227 | u32 rx_stat_grfcs_lo; |
| 2228 | u32 rx_stat_grfcs_hi; |
| 2229 | u32 rx_stat_gruca_lo; |
| 2230 | u32 rx_stat_gruca_hi; |
| 2231 | u32 rx_stat_grmca_lo; |
| 2232 | u32 rx_stat_grmca_hi; |
| 2233 | u32 rx_stat_grbca_lo; |
| 2234 | u32 rx_stat_grbca_hi; |
| 2235 | u32 rx_stat_grxpf_lo; /* grpf */ |
| 2236 | u32 rx_stat_grxpf_hi; /* grpf */ |
| 2237 | u32 rx_stat_grpp_lo; |
| 2238 | u32 rx_stat_grpp_hi; |
| 2239 | u32 rx_stat_grxuo_lo; /* gruo */ |
| 2240 | u32 rx_stat_grxuo_hi; /* gruo */ |
| 2241 | u32 rx_stat_grjbr_lo; |
| 2242 | u32 rx_stat_grjbr_hi; |
| 2243 | u32 rx_stat_grovr_lo; |
| 2244 | u32 rx_stat_grovr_hi; |
| 2245 | u32 rx_stat_grxcf_lo; /* grcf */ |
| 2246 | u32 rx_stat_grxcf_hi; /* grcf */ |
| 2247 | u32 rx_stat_grflr_lo; |
| 2248 | u32 rx_stat_grflr_hi; |
| 2249 | u32 rx_stat_grpok_lo; |
| 2250 | u32 rx_stat_grpok_hi; |
| 2251 | u32 rx_stat_grmeg_lo; |
| 2252 | u32 rx_stat_grmeg_hi; |
| 2253 | u32 rx_stat_grmeb_lo; |
| 2254 | u32 rx_stat_grmeb_hi; |
| 2255 | u32 rx_stat_grbyt_lo; |
| 2256 | u32 rx_stat_grbyt_hi; |
| 2257 | u32 rx_stat_grund_lo; |
| 2258 | u32 rx_stat_grund_hi; |
| 2259 | u32 rx_stat_grfrg_lo; |
| 2260 | u32 rx_stat_grfrg_hi; |
| 2261 | u32 rx_stat_grerb_lo; /* grerrbyt */ |
| 2262 | u32 rx_stat_grerb_hi; /* grerrbyt */ |
| 2263 | u32 rx_stat_grfre_lo; /* grfrerr */ |
| 2264 | u32 rx_stat_grfre_hi; /* grfrerr */ |
| 2265 | u32 rx_stat_gripj_lo; |
| 2266 | u32 rx_stat_gripj_hi; |
| 2267 | }; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2268 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2269 | struct mstat_stats { |
| 2270 | struct { |
| 2271 | /* OTE MSTAT on E3 has a bug where this register's contents are |
| 2272 | * actually tx_gtxpok + tx_gtxpf + (possibly)tx_gtxpp |
| 2273 | */ |
| 2274 | u32 tx_gtxpok_lo; |
| 2275 | u32 tx_gtxpok_hi; |
| 2276 | u32 tx_gtxpf_lo; |
| 2277 | u32 tx_gtxpf_hi; |
| 2278 | u32 tx_gtxpp_lo; |
| 2279 | u32 tx_gtxpp_hi; |
| 2280 | u32 tx_gtfcs_lo; |
| 2281 | u32 tx_gtfcs_hi; |
| 2282 | u32 tx_gtuca_lo; |
| 2283 | u32 tx_gtuca_hi; |
| 2284 | u32 tx_gtmca_lo; |
| 2285 | u32 tx_gtmca_hi; |
| 2286 | u32 tx_gtgca_lo; |
| 2287 | u32 tx_gtgca_hi; |
| 2288 | u32 tx_gtpkt_lo; |
| 2289 | u32 tx_gtpkt_hi; |
| 2290 | u32 tx_gt64_lo; |
| 2291 | u32 tx_gt64_hi; |
| 2292 | u32 tx_gt127_lo; |
| 2293 | u32 tx_gt127_hi; |
| 2294 | u32 tx_gt255_lo; |
| 2295 | u32 tx_gt255_hi; |
| 2296 | u32 tx_gt511_lo; |
| 2297 | u32 tx_gt511_hi; |
| 2298 | u32 tx_gt1023_lo; |
| 2299 | u32 tx_gt1023_hi; |
| 2300 | u32 tx_gt1518_lo; |
| 2301 | u32 tx_gt1518_hi; |
| 2302 | u32 tx_gt2047_lo; |
| 2303 | u32 tx_gt2047_hi; |
| 2304 | u32 tx_gt4095_lo; |
| 2305 | u32 tx_gt4095_hi; |
| 2306 | u32 tx_gt9216_lo; |
| 2307 | u32 tx_gt9216_hi; |
| 2308 | u32 tx_gt16383_lo; |
| 2309 | u32 tx_gt16383_hi; |
| 2310 | u32 tx_gtufl_lo; |
| 2311 | u32 tx_gtufl_hi; |
| 2312 | u32 tx_gterr_lo; |
| 2313 | u32 tx_gterr_hi; |
| 2314 | u32 tx_gtbyt_lo; |
| 2315 | u32 tx_gtbyt_hi; |
| 2316 | u32 tx_collisions_lo; |
| 2317 | u32 tx_collisions_hi; |
| 2318 | u32 tx_singlecollision_lo; |
| 2319 | u32 tx_singlecollision_hi; |
| 2320 | u32 tx_multiplecollisions_lo; |
| 2321 | u32 tx_multiplecollisions_hi; |
| 2322 | u32 tx_deferred_lo; |
| 2323 | u32 tx_deferred_hi; |
| 2324 | u32 tx_excessivecollisions_lo; |
| 2325 | u32 tx_excessivecollisions_hi; |
| 2326 | u32 tx_latecollisions_lo; |
| 2327 | u32 tx_latecollisions_hi; |
| 2328 | } stats_tx; |
| 2329 | |
| 2330 | struct { |
| 2331 | u32 rx_gr64_lo; |
| 2332 | u32 rx_gr64_hi; |
| 2333 | u32 rx_gr127_lo; |
| 2334 | u32 rx_gr127_hi; |
| 2335 | u32 rx_gr255_lo; |
| 2336 | u32 rx_gr255_hi; |
| 2337 | u32 rx_gr511_lo; |
| 2338 | u32 rx_gr511_hi; |
| 2339 | u32 rx_gr1023_lo; |
| 2340 | u32 rx_gr1023_hi; |
| 2341 | u32 rx_gr1518_lo; |
| 2342 | u32 rx_gr1518_hi; |
| 2343 | u32 rx_gr2047_lo; |
| 2344 | u32 rx_gr2047_hi; |
| 2345 | u32 rx_gr4095_lo; |
| 2346 | u32 rx_gr4095_hi; |
| 2347 | u32 rx_gr9216_lo; |
| 2348 | u32 rx_gr9216_hi; |
| 2349 | u32 rx_gr16383_lo; |
| 2350 | u32 rx_gr16383_hi; |
| 2351 | u32 rx_grpkt_lo; |
| 2352 | u32 rx_grpkt_hi; |
| 2353 | u32 rx_grfcs_lo; |
| 2354 | u32 rx_grfcs_hi; |
| 2355 | u32 rx_gruca_lo; |
| 2356 | u32 rx_gruca_hi; |
| 2357 | u32 rx_grmca_lo; |
| 2358 | u32 rx_grmca_hi; |
| 2359 | u32 rx_grbca_lo; |
| 2360 | u32 rx_grbca_hi; |
| 2361 | u32 rx_grxpf_lo; |
| 2362 | u32 rx_grxpf_hi; |
| 2363 | u32 rx_grxpp_lo; |
| 2364 | u32 rx_grxpp_hi; |
| 2365 | u32 rx_grxuo_lo; |
| 2366 | u32 rx_grxuo_hi; |
| 2367 | u32 rx_grovr_lo; |
| 2368 | u32 rx_grovr_hi; |
| 2369 | u32 rx_grxcf_lo; |
| 2370 | u32 rx_grxcf_hi; |
| 2371 | u32 rx_grflr_lo; |
| 2372 | u32 rx_grflr_hi; |
| 2373 | u32 rx_grpok_lo; |
| 2374 | u32 rx_grpok_hi; |
| 2375 | u32 rx_grbyt_lo; |
| 2376 | u32 rx_grbyt_hi; |
| 2377 | u32 rx_grund_lo; |
| 2378 | u32 rx_grund_hi; |
| 2379 | u32 rx_grfrg_lo; |
| 2380 | u32 rx_grfrg_hi; |
| 2381 | u32 rx_grerb_lo; |
| 2382 | u32 rx_grerb_hi; |
| 2383 | u32 rx_grfre_lo; |
| 2384 | u32 rx_grfre_hi; |
| 2385 | |
| 2386 | u32 rx_alignmenterrors_lo; |
| 2387 | u32 rx_alignmenterrors_hi; |
| 2388 | u32 rx_falsecarrier_lo; |
| 2389 | u32 rx_falsecarrier_hi; |
| 2390 | u32 rx_llfcmsgcnt_lo; |
| 2391 | u32 rx_llfcmsgcnt_hi; |
| 2392 | } stats_rx; |
| 2393 | }; |
| 2394 | |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2395 | union mac_stats { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2396 | struct emac_stats emac_stats; |
| 2397 | struct bmac1_stats bmac1_stats; |
| 2398 | struct bmac2_stats bmac2_stats; |
| 2399 | struct mstat_stats mstat_stats; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2400 | }; |
| 2401 | |
| 2402 | |
| 2403 | struct mac_stx { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2404 | /* in_bad_octets */ |
| 2405 | u32 rx_stat_ifhcinbadoctets_hi; |
| 2406 | u32 rx_stat_ifhcinbadoctets_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2407 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2408 | /* out_bad_octets */ |
| 2409 | u32 tx_stat_ifhcoutbadoctets_hi; |
| 2410 | u32 tx_stat_ifhcoutbadoctets_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2411 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2412 | /* crc_receive_errors */ |
| 2413 | u32 rx_stat_dot3statsfcserrors_hi; |
| 2414 | u32 rx_stat_dot3statsfcserrors_lo; |
| 2415 | /* alignment_errors */ |
| 2416 | u32 rx_stat_dot3statsalignmenterrors_hi; |
| 2417 | u32 rx_stat_dot3statsalignmenterrors_lo; |
| 2418 | /* carrier_sense_errors */ |
| 2419 | u32 rx_stat_dot3statscarriersenseerrors_hi; |
| 2420 | u32 rx_stat_dot3statscarriersenseerrors_lo; |
| 2421 | /* false_carrier_detections */ |
| 2422 | u32 rx_stat_falsecarriererrors_hi; |
| 2423 | u32 rx_stat_falsecarriererrors_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2424 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2425 | /* runt_packets_received */ |
| 2426 | u32 rx_stat_etherstatsundersizepkts_hi; |
| 2427 | u32 rx_stat_etherstatsundersizepkts_lo; |
| 2428 | /* jabber_packets_received */ |
| 2429 | u32 rx_stat_dot3statsframestoolong_hi; |
| 2430 | u32 rx_stat_dot3statsframestoolong_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2431 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2432 | /* error_runt_packets_received */ |
| 2433 | u32 rx_stat_etherstatsfragments_hi; |
| 2434 | u32 rx_stat_etherstatsfragments_lo; |
| 2435 | /* error_jabber_packets_received */ |
| 2436 | u32 rx_stat_etherstatsjabbers_hi; |
| 2437 | u32 rx_stat_etherstatsjabbers_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2438 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2439 | /* control_frames_received */ |
| 2440 | u32 rx_stat_maccontrolframesreceived_hi; |
| 2441 | u32 rx_stat_maccontrolframesreceived_lo; |
| 2442 | u32 rx_stat_mac_xpf_hi; |
| 2443 | u32 rx_stat_mac_xpf_lo; |
| 2444 | u32 rx_stat_mac_xcf_hi; |
| 2445 | u32 rx_stat_mac_xcf_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2446 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2447 | /* xoff_state_entered */ |
| 2448 | u32 rx_stat_xoffstateentered_hi; |
| 2449 | u32 rx_stat_xoffstateentered_lo; |
| 2450 | /* pause_xon_frames_received */ |
| 2451 | u32 rx_stat_xonpauseframesreceived_hi; |
| 2452 | u32 rx_stat_xonpauseframesreceived_lo; |
| 2453 | /* pause_xoff_frames_received */ |
| 2454 | u32 rx_stat_xoffpauseframesreceived_hi; |
| 2455 | u32 rx_stat_xoffpauseframesreceived_lo; |
| 2456 | /* pause_xon_frames_transmitted */ |
| 2457 | u32 tx_stat_outxonsent_hi; |
| 2458 | u32 tx_stat_outxonsent_lo; |
| 2459 | /* pause_xoff_frames_transmitted */ |
| 2460 | u32 tx_stat_outxoffsent_hi; |
| 2461 | u32 tx_stat_outxoffsent_lo; |
| 2462 | /* flow_control_done */ |
| 2463 | u32 tx_stat_flowcontroldone_hi; |
| 2464 | u32 tx_stat_flowcontroldone_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2465 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2466 | /* ether_stats_collisions */ |
| 2467 | u32 tx_stat_etherstatscollisions_hi; |
| 2468 | u32 tx_stat_etherstatscollisions_lo; |
| 2469 | /* single_collision_transmit_frames */ |
| 2470 | u32 tx_stat_dot3statssinglecollisionframes_hi; |
| 2471 | u32 tx_stat_dot3statssinglecollisionframes_lo; |
| 2472 | /* multiple_collision_transmit_frames */ |
| 2473 | u32 tx_stat_dot3statsmultiplecollisionframes_hi; |
| 2474 | u32 tx_stat_dot3statsmultiplecollisionframes_lo; |
| 2475 | /* deferred_transmissions */ |
| 2476 | u32 tx_stat_dot3statsdeferredtransmissions_hi; |
| 2477 | u32 tx_stat_dot3statsdeferredtransmissions_lo; |
| 2478 | /* excessive_collision_frames */ |
| 2479 | u32 tx_stat_dot3statsexcessivecollisions_hi; |
| 2480 | u32 tx_stat_dot3statsexcessivecollisions_lo; |
| 2481 | /* late_collision_frames */ |
| 2482 | u32 tx_stat_dot3statslatecollisions_hi; |
| 2483 | u32 tx_stat_dot3statslatecollisions_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2484 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2485 | /* frames_transmitted_64_bytes */ |
| 2486 | u32 tx_stat_etherstatspkts64octets_hi; |
| 2487 | u32 tx_stat_etherstatspkts64octets_lo; |
| 2488 | /* frames_transmitted_65_127_bytes */ |
| 2489 | u32 tx_stat_etherstatspkts65octetsto127octets_hi; |
| 2490 | u32 tx_stat_etherstatspkts65octetsto127octets_lo; |
| 2491 | /* frames_transmitted_128_255_bytes */ |
| 2492 | u32 tx_stat_etherstatspkts128octetsto255octets_hi; |
| 2493 | u32 tx_stat_etherstatspkts128octetsto255octets_lo; |
| 2494 | /* frames_transmitted_256_511_bytes */ |
| 2495 | u32 tx_stat_etherstatspkts256octetsto511octets_hi; |
| 2496 | u32 tx_stat_etherstatspkts256octetsto511octets_lo; |
| 2497 | /* frames_transmitted_512_1023_bytes */ |
| 2498 | u32 tx_stat_etherstatspkts512octetsto1023octets_hi; |
| 2499 | u32 tx_stat_etherstatspkts512octetsto1023octets_lo; |
| 2500 | /* frames_transmitted_1024_1522_bytes */ |
| 2501 | u32 tx_stat_etherstatspkts1024octetsto1522octets_hi; |
| 2502 | u32 tx_stat_etherstatspkts1024octetsto1522octets_lo; |
| 2503 | /* frames_transmitted_1523_9022_bytes */ |
| 2504 | u32 tx_stat_etherstatspktsover1522octets_hi; |
| 2505 | u32 tx_stat_etherstatspktsover1522octets_lo; |
| 2506 | u32 tx_stat_mac_2047_hi; |
| 2507 | u32 tx_stat_mac_2047_lo; |
| 2508 | u32 tx_stat_mac_4095_hi; |
| 2509 | u32 tx_stat_mac_4095_lo; |
| 2510 | u32 tx_stat_mac_9216_hi; |
| 2511 | u32 tx_stat_mac_9216_lo; |
| 2512 | u32 tx_stat_mac_16383_hi; |
| 2513 | u32 tx_stat_mac_16383_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2514 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2515 | /* internal_mac_transmit_errors */ |
| 2516 | u32 tx_stat_dot3statsinternalmactransmiterrors_hi; |
| 2517 | u32 tx_stat_dot3statsinternalmactransmiterrors_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2518 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2519 | /* if_out_discards */ |
| 2520 | u32 tx_stat_mac_ufl_hi; |
| 2521 | u32 tx_stat_mac_ufl_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2522 | }; |
| 2523 | |
| 2524 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2525 | #define MAC_STX_IDX_MAX 2 |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2526 | |
| 2527 | struct host_port_stats { |
Barak Witkowski | 0e898dd | 2011-12-05 21:52:22 +0000 | [diff] [blame] | 2528 | u32 host_port_stats_counter; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2529 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2530 | struct mac_stx mac_stx[MAC_STX_IDX_MAX]; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2531 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2532 | u32 brb_drop_hi; |
| 2533 | u32 brb_drop_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2534 | |
Barak Witkowski | 0e898dd | 2011-12-05 21:52:22 +0000 | [diff] [blame] | 2535 | u32 not_used; /* obsolete */ |
| 2536 | u32 pfc_frames_tx_hi; |
| 2537 | u32 pfc_frames_tx_lo; |
| 2538 | u32 pfc_frames_rx_hi; |
| 2539 | u32 pfc_frames_rx_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2540 | }; |
| 2541 | |
| 2542 | |
| 2543 | struct host_func_stats { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2544 | u32 host_func_stats_start; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2545 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2546 | u32 total_bytes_received_hi; |
| 2547 | u32 total_bytes_received_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2548 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2549 | u32 total_bytes_transmitted_hi; |
| 2550 | u32 total_bytes_transmitted_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2551 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2552 | u32 total_unicast_packets_received_hi; |
| 2553 | u32 total_unicast_packets_received_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2554 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2555 | u32 total_multicast_packets_received_hi; |
| 2556 | u32 total_multicast_packets_received_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2557 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2558 | u32 total_broadcast_packets_received_hi; |
| 2559 | u32 total_broadcast_packets_received_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2560 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2561 | u32 total_unicast_packets_transmitted_hi; |
| 2562 | u32 total_unicast_packets_transmitted_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2563 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2564 | u32 total_multicast_packets_transmitted_hi; |
| 2565 | u32 total_multicast_packets_transmitted_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2566 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2567 | u32 total_broadcast_packets_transmitted_hi; |
| 2568 | u32 total_broadcast_packets_transmitted_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2569 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2570 | u32 valid_bytes_received_hi; |
| 2571 | u32 valid_bytes_received_lo; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2572 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2573 | u32 host_func_stats_end; |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 2574 | }; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 2575 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2576 | /* VIC definitions */ |
| 2577 | #define VICSTATST_UIF_INDEX 2 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 2578 | |
Barak Witkowski | 1d187b3 | 2011-12-05 22:41:50 +0000 | [diff] [blame] | 2579 | /* current drv_info version */ |
| 2580 | #define DRV_INFO_CUR_VER 1 |
| 2581 | |
| 2582 | /* drv_info op codes supported */ |
| 2583 | enum drv_info_opcode { |
| 2584 | ETH_STATS_OPCODE, |
| 2585 | FCOE_STATS_OPCODE, |
| 2586 | ISCSI_STATS_OPCODE |
| 2587 | }; |
| 2588 | |
| 2589 | #define ETH_STAT_INFO_VERSION_LEN 12 |
| 2590 | /* Per PCI Function Ethernet Statistics required from the driver */ |
| 2591 | struct eth_stats_info { |
| 2592 | /* Function's Driver Version. padded to 12 */ |
| 2593 | u8 version[ETH_STAT_INFO_VERSION_LEN]; |
| 2594 | /* Locally Admin Addr. BigEndian EIU48. Actual size is 6 bytes */ |
| 2595 | u8 mac_local[8]; |
| 2596 | u8 mac_add1[8]; /* Additional Programmed MAC Addr 1. */ |
| 2597 | u8 mac_add2[8]; /* Additional Programmed MAC Addr 2. */ |
| 2598 | u32 mtu_size; /* MTU Size. Note : Negotiated MTU */ |
| 2599 | u32 feature_flags; /* Feature_Flags. */ |
| 2600 | #define FEATURE_ETH_CHKSUM_OFFLOAD_MASK 0x01 |
| 2601 | #define FEATURE_ETH_LSO_MASK 0x02 |
| 2602 | #define FEATURE_ETH_BOOTMODE_MASK 0x1C |
| 2603 | #define FEATURE_ETH_BOOTMODE_SHIFT 2 |
| 2604 | #define FEATURE_ETH_BOOTMODE_NONE (0x0 << 2) |
| 2605 | #define FEATURE_ETH_BOOTMODE_PXE (0x1 << 2) |
| 2606 | #define FEATURE_ETH_BOOTMODE_ISCSI (0x2 << 2) |
| 2607 | #define FEATURE_ETH_BOOTMODE_FCOE (0x3 << 2) |
| 2608 | #define FEATURE_ETH_TOE_MASK 0x20 |
| 2609 | u32 lso_max_size; /* LSO MaxOffloadSize. */ |
| 2610 | u32 lso_min_seg_cnt; /* LSO MinSegmentCount. */ |
| 2611 | /* Num Offloaded Connections TCP_IPv4. */ |
| 2612 | u32 ipv4_ofld_cnt; |
| 2613 | /* Num Offloaded Connections TCP_IPv6. */ |
| 2614 | u32 ipv6_ofld_cnt; |
| 2615 | u32 promiscuous_mode; /* Promiscuous Mode. non-zero true */ |
| 2616 | u32 txq_size; /* TX Descriptors Queue Size */ |
| 2617 | u32 rxq_size; /* RX Descriptors Queue Size */ |
| 2618 | /* TX Descriptor Queue Avg Depth. % Avg Queue Depth since last poll */ |
| 2619 | u32 txq_avg_depth; |
| 2620 | /* RX Descriptors Queue Avg Depth. % Avg Queue Depth since last poll */ |
| 2621 | u32 rxq_avg_depth; |
| 2622 | /* IOV_Offload. 0=none; 1=MultiQueue, 2=VEB 3= VEPA*/ |
| 2623 | u32 iov_offload; |
| 2624 | /* Number of NetQueue/VMQ Config'd. */ |
| 2625 | u32 netq_cnt; |
| 2626 | u32 vf_cnt; /* Num VF assigned to this PF. */ |
| 2627 | }; |
| 2628 | |
| 2629 | /* Per PCI Function FCOE Statistics required from the driver */ |
| 2630 | struct fcoe_stats_info { |
| 2631 | u8 version[12]; /* Function's Driver Version. */ |
| 2632 | u8 mac_local[8]; /* Locally Admin Addr. */ |
| 2633 | u8 mac_add1[8]; /* Additional Programmed MAC Addr 1. */ |
| 2634 | u8 mac_add2[8]; /* Additional Programmed MAC Addr 2. */ |
| 2635 | /* QoS Priority (per 802.1p). 0-7255 */ |
| 2636 | u32 qos_priority; |
| 2637 | u32 txq_size; /* FCoE TX Descriptors Queue Size. */ |
| 2638 | u32 rxq_size; /* FCoE RX Descriptors Queue Size. */ |
| 2639 | /* FCoE TX Descriptor Queue Avg Depth. */ |
| 2640 | u32 txq_avg_depth; |
| 2641 | /* FCoE RX Descriptors Queue Avg Depth. */ |
| 2642 | u32 rxq_avg_depth; |
| 2643 | u32 rx_frames_lo; /* FCoE RX Frames received. */ |
| 2644 | u32 rx_frames_hi; /* FCoE RX Frames received. */ |
| 2645 | u32 rx_bytes_lo; /* FCoE RX Bytes received. */ |
| 2646 | u32 rx_bytes_hi; /* FCoE RX Bytes received. */ |
| 2647 | u32 tx_frames_lo; /* FCoE TX Frames sent. */ |
| 2648 | u32 tx_frames_hi; /* FCoE TX Frames sent. */ |
| 2649 | u32 tx_bytes_lo; /* FCoE TX Bytes sent. */ |
| 2650 | u32 tx_bytes_hi; /* FCoE TX Bytes sent. */ |
| 2651 | }; |
| 2652 | |
| 2653 | /* Per PCI Function iSCSI Statistics required from the driver*/ |
| 2654 | struct iscsi_stats_info { |
| 2655 | u8 version[12]; /* Function's Driver Version. */ |
| 2656 | u8 mac_local[8]; /* Locally Admin iSCSI MAC Addr. */ |
| 2657 | u8 mac_add1[8]; /* Additional Programmed MAC Addr 1. */ |
| 2658 | /* QoS Priority (per 802.1p). 0-7255 */ |
| 2659 | u32 qos_priority; |
| 2660 | u8 initiator_name[64]; /* iSCSI Boot Initiator Node name. */ |
| 2661 | u8 ww_port_name[64]; /* iSCSI World wide port name */ |
| 2662 | u8 boot_target_name[64];/* iSCSI Boot Target Name. */ |
| 2663 | u8 boot_target_ip[16]; /* iSCSI Boot Target IP. */ |
| 2664 | u32 boot_target_portal; /* iSCSI Boot Target Portal. */ |
| 2665 | u8 boot_init_ip[16]; /* iSCSI Boot Initiator IP Address. */ |
| 2666 | u32 max_frame_size; /* Max Frame Size. bytes */ |
| 2667 | u32 txq_size; /* PDU TX Descriptors Queue Size. */ |
| 2668 | u32 rxq_size; /* PDU RX Descriptors Queue Size. */ |
| 2669 | u32 txq_avg_depth; /* PDU TX Descriptor Queue Avg Depth. */ |
| 2670 | u32 rxq_avg_depth; /* PDU RX Descriptors Queue Avg Depth. */ |
| 2671 | u32 rx_pdus_lo; /* iSCSI PDUs received. */ |
| 2672 | u32 rx_pdus_hi; /* iSCSI PDUs received. */ |
| 2673 | u32 rx_bytes_lo; /* iSCSI RX Bytes received. */ |
| 2674 | u32 rx_bytes_hi; /* iSCSI RX Bytes received. */ |
| 2675 | u32 tx_pdus_lo; /* iSCSI PDUs sent. */ |
| 2676 | u32 tx_pdus_hi; /* iSCSI PDUs sent. */ |
| 2677 | u32 tx_bytes_lo; /* iSCSI PDU TX Bytes sent. */ |
| 2678 | u32 tx_bytes_hi; /* iSCSI PDU TX Bytes sent. */ |
| 2679 | u32 pcp_prior_map_tbl; /* C-PCP to S-PCP Priority MapTable. |
| 2680 | * 9 nibbles, the position of each nibble |
| 2681 | * represents the C-PCP value, the value |
| 2682 | * of the nibble = S-PCP value. |
| 2683 | */ |
| 2684 | }; |
| 2685 | |
| 2686 | union drv_info_to_mcp { |
| 2687 | struct eth_stats_info ether_stat; |
| 2688 | struct fcoe_stats_info fcoe_stat; |
| 2689 | struct iscsi_stats_info iscsi_stat; |
| 2690 | }; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2691 | #define BCM_5710_FW_MAJOR_VERSION 7 |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 2692 | #define BCM_5710_FW_MINOR_VERSION 2 |
| 2693 | #define BCM_5710_FW_REVISION_VERSION 16 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2694 | #define BCM_5710_FW_ENGINEERING_VERSION 0 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 2695 | #define BCM_5710_FW_COMPILE_FLAGS 1 |
| 2696 | |
| 2697 | |
| 2698 | /* |
| 2699 | * attention bits |
| 2700 | */ |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 2701 | struct atten_sp_status_block { |
Eilon Greenstein | 4781bfa | 2009-02-12 08:38:17 +0000 | [diff] [blame] | 2702 | __le32 attn_bits; |
| 2703 | __le32 attn_bits_ack; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 2704 | u8 status_block_id; |
| 2705 | u8 reserved0; |
Eilon Greenstein | 4781bfa | 2009-02-12 08:38:17 +0000 | [diff] [blame] | 2706 | __le16 attn_bits_index; |
| 2707 | __le32 reserved1; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 2708 | }; |
| 2709 | |
| 2710 | |
| 2711 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2712 | * The eth aggregative context of Cstorm |
| 2713 | */ |
| 2714 | struct cstorm_eth_ag_context { |
| 2715 | u32 __reserved0[10]; |
| 2716 | }; |
| 2717 | |
| 2718 | |
| 2719 | /* |
| 2720 | * dmae command structure |
| 2721 | */ |
| 2722 | struct dmae_command { |
| 2723 | u32 opcode; |
| 2724 | #define DMAE_COMMAND_SRC (0x1<<0) |
| 2725 | #define DMAE_COMMAND_SRC_SHIFT 0 |
| 2726 | #define DMAE_COMMAND_DST (0x3<<1) |
| 2727 | #define DMAE_COMMAND_DST_SHIFT 1 |
| 2728 | #define DMAE_COMMAND_C_DST (0x1<<3) |
| 2729 | #define DMAE_COMMAND_C_DST_SHIFT 3 |
| 2730 | #define DMAE_COMMAND_C_TYPE_ENABLE (0x1<<4) |
| 2731 | #define DMAE_COMMAND_C_TYPE_ENABLE_SHIFT 4 |
| 2732 | #define DMAE_COMMAND_C_TYPE_CRC_ENABLE (0x1<<5) |
| 2733 | #define DMAE_COMMAND_C_TYPE_CRC_ENABLE_SHIFT 5 |
| 2734 | #define DMAE_COMMAND_C_TYPE_CRC_OFFSET (0x7<<6) |
| 2735 | #define DMAE_COMMAND_C_TYPE_CRC_OFFSET_SHIFT 6 |
| 2736 | #define DMAE_COMMAND_ENDIANITY (0x3<<9) |
| 2737 | #define DMAE_COMMAND_ENDIANITY_SHIFT 9 |
| 2738 | #define DMAE_COMMAND_PORT (0x1<<11) |
| 2739 | #define DMAE_COMMAND_PORT_SHIFT 11 |
| 2740 | #define DMAE_COMMAND_CRC_RESET (0x1<<12) |
| 2741 | #define DMAE_COMMAND_CRC_RESET_SHIFT 12 |
| 2742 | #define DMAE_COMMAND_SRC_RESET (0x1<<13) |
| 2743 | #define DMAE_COMMAND_SRC_RESET_SHIFT 13 |
| 2744 | #define DMAE_COMMAND_DST_RESET (0x1<<14) |
| 2745 | #define DMAE_COMMAND_DST_RESET_SHIFT 14 |
| 2746 | #define DMAE_COMMAND_E1HVN (0x3<<15) |
| 2747 | #define DMAE_COMMAND_E1HVN_SHIFT 15 |
| 2748 | #define DMAE_COMMAND_DST_VN (0x3<<17) |
| 2749 | #define DMAE_COMMAND_DST_VN_SHIFT 17 |
| 2750 | #define DMAE_COMMAND_C_FUNC (0x1<<19) |
| 2751 | #define DMAE_COMMAND_C_FUNC_SHIFT 19 |
| 2752 | #define DMAE_COMMAND_ERR_POLICY (0x3<<20) |
| 2753 | #define DMAE_COMMAND_ERR_POLICY_SHIFT 20 |
| 2754 | #define DMAE_COMMAND_RESERVED0 (0x3FF<<22) |
| 2755 | #define DMAE_COMMAND_RESERVED0_SHIFT 22 |
| 2756 | u32 src_addr_lo; |
| 2757 | u32 src_addr_hi; |
| 2758 | u32 dst_addr_lo; |
| 2759 | u32 dst_addr_hi; |
| 2760 | #if defined(__BIG_ENDIAN) |
| 2761 | u16 opcode_iov; |
| 2762 | #define DMAE_COMMAND_SRC_VFID (0x3F<<0) |
| 2763 | #define DMAE_COMMAND_SRC_VFID_SHIFT 0 |
| 2764 | #define DMAE_COMMAND_SRC_VFPF (0x1<<6) |
| 2765 | #define DMAE_COMMAND_SRC_VFPF_SHIFT 6 |
| 2766 | #define DMAE_COMMAND_RESERVED1 (0x1<<7) |
| 2767 | #define DMAE_COMMAND_RESERVED1_SHIFT 7 |
| 2768 | #define DMAE_COMMAND_DST_VFID (0x3F<<8) |
| 2769 | #define DMAE_COMMAND_DST_VFID_SHIFT 8 |
| 2770 | #define DMAE_COMMAND_DST_VFPF (0x1<<14) |
| 2771 | #define DMAE_COMMAND_DST_VFPF_SHIFT 14 |
| 2772 | #define DMAE_COMMAND_RESERVED2 (0x1<<15) |
| 2773 | #define DMAE_COMMAND_RESERVED2_SHIFT 15 |
| 2774 | u16 len; |
| 2775 | #elif defined(__LITTLE_ENDIAN) |
| 2776 | u16 len; |
| 2777 | u16 opcode_iov; |
| 2778 | #define DMAE_COMMAND_SRC_VFID (0x3F<<0) |
| 2779 | #define DMAE_COMMAND_SRC_VFID_SHIFT 0 |
| 2780 | #define DMAE_COMMAND_SRC_VFPF (0x1<<6) |
| 2781 | #define DMAE_COMMAND_SRC_VFPF_SHIFT 6 |
| 2782 | #define DMAE_COMMAND_RESERVED1 (0x1<<7) |
| 2783 | #define DMAE_COMMAND_RESERVED1_SHIFT 7 |
| 2784 | #define DMAE_COMMAND_DST_VFID (0x3F<<8) |
| 2785 | #define DMAE_COMMAND_DST_VFID_SHIFT 8 |
| 2786 | #define DMAE_COMMAND_DST_VFPF (0x1<<14) |
| 2787 | #define DMAE_COMMAND_DST_VFPF_SHIFT 14 |
| 2788 | #define DMAE_COMMAND_RESERVED2 (0x1<<15) |
| 2789 | #define DMAE_COMMAND_RESERVED2_SHIFT 15 |
| 2790 | #endif |
| 2791 | u32 comp_addr_lo; |
| 2792 | u32 comp_addr_hi; |
| 2793 | u32 comp_val; |
| 2794 | u32 crc32; |
| 2795 | u32 crc32_c; |
| 2796 | #if defined(__BIG_ENDIAN) |
| 2797 | u16 crc16_c; |
| 2798 | u16 crc16; |
| 2799 | #elif defined(__LITTLE_ENDIAN) |
| 2800 | u16 crc16; |
| 2801 | u16 crc16_c; |
| 2802 | #endif |
| 2803 | #if defined(__BIG_ENDIAN) |
| 2804 | u16 reserved3; |
| 2805 | u16 crc_t10; |
| 2806 | #elif defined(__LITTLE_ENDIAN) |
| 2807 | u16 crc_t10; |
| 2808 | u16 reserved3; |
| 2809 | #endif |
| 2810 | #if defined(__BIG_ENDIAN) |
| 2811 | u16 xsum8; |
| 2812 | u16 xsum16; |
| 2813 | #elif defined(__LITTLE_ENDIAN) |
| 2814 | u16 xsum16; |
| 2815 | u16 xsum8; |
| 2816 | #endif |
| 2817 | }; |
| 2818 | |
| 2819 | |
| 2820 | /* |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 2821 | * common data for all protocols |
| 2822 | */ |
| 2823 | struct doorbell_hdr { |
| 2824 | u8 header; |
| 2825 | #define DOORBELL_HDR_RX (0x1<<0) |
| 2826 | #define DOORBELL_HDR_RX_SHIFT 0 |
| 2827 | #define DOORBELL_HDR_DB_TYPE (0x1<<1) |
| 2828 | #define DOORBELL_HDR_DB_TYPE_SHIFT 1 |
| 2829 | #define DOORBELL_HDR_DPM_SIZE (0x3<<2) |
| 2830 | #define DOORBELL_HDR_DPM_SIZE_SHIFT 2 |
| 2831 | #define DOORBELL_HDR_CONN_TYPE (0xF<<4) |
| 2832 | #define DOORBELL_HDR_CONN_TYPE_SHIFT 4 |
| 2833 | }; |
| 2834 | |
| 2835 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2836 | * Ethernet doorbell |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 2837 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2838 | struct eth_tx_doorbell { |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 2839 | #if defined(__BIG_ENDIAN) |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2840 | u16 npackets; |
| 2841 | u8 params; |
| 2842 | #define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0) |
| 2843 | #define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0 |
| 2844 | #define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6) |
| 2845 | #define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6 |
| 2846 | #define ETH_TX_DOORBELL_SPARE (0x1<<7) |
| 2847 | #define ETH_TX_DOORBELL_SPARE_SHIFT 7 |
| 2848 | struct doorbell_hdr hdr; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 2849 | #elif defined(__LITTLE_ENDIAN) |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2850 | struct doorbell_hdr hdr; |
| 2851 | u8 params; |
| 2852 | #define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0) |
| 2853 | #define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0 |
| 2854 | #define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6) |
| 2855 | #define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6 |
| 2856 | #define ETH_TX_DOORBELL_SPARE (0x1<<7) |
| 2857 | #define ETH_TX_DOORBELL_SPARE_SHIFT 7 |
| 2858 | u16 npackets; |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 2859 | #endif |
| 2860 | }; |
| 2861 | |
| 2862 | |
| 2863 | /* |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 2864 | * 3 lines. status block |
| 2865 | */ |
| 2866 | struct hc_status_block_e1x { |
| 2867 | __le16 index_values[HC_SB_MAX_INDICES_E1X]; |
| 2868 | __le16 running_index[HC_SB_MAX_SM]; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2869 | __le32 rsrv[11]; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 2870 | }; |
| 2871 | |
| 2872 | /* |
| 2873 | * host status block |
| 2874 | */ |
| 2875 | struct host_hc_status_block_e1x { |
| 2876 | struct hc_status_block_e1x sb; |
| 2877 | }; |
| 2878 | |
| 2879 | |
| 2880 | /* |
| 2881 | * 3 lines. status block |
| 2882 | */ |
| 2883 | struct hc_status_block_e2 { |
| 2884 | __le16 index_values[HC_SB_MAX_INDICES_E2]; |
| 2885 | __le16 running_index[HC_SB_MAX_SM]; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 2886 | __le32 reserved[11]; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 2887 | }; |
| 2888 | |
| 2889 | /* |
| 2890 | * host status block |
| 2891 | */ |
| 2892 | struct host_hc_status_block_e2 { |
| 2893 | struct hc_status_block_e2 sb; |
| 2894 | }; |
| 2895 | |
| 2896 | |
| 2897 | /* |
| 2898 | * 5 lines. slow-path status block |
| 2899 | */ |
| 2900 | struct hc_sp_status_block { |
| 2901 | __le16 index_values[HC_SP_SB_MAX_INDICES]; |
| 2902 | __le16 running_index; |
| 2903 | __le16 rsrv; |
| 2904 | u32 rsrv1; |
| 2905 | }; |
| 2906 | |
| 2907 | /* |
| 2908 | * host status block |
| 2909 | */ |
| 2910 | struct host_sp_status_block { |
| 2911 | struct atten_sp_status_block atten_status_block; |
| 2912 | struct hc_sp_status_block sp_sb; |
| 2913 | }; |
| 2914 | |
| 2915 | |
| 2916 | /* |
| 2917 | * IGU driver acknowledgment register |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 2918 | */ |
| 2919 | struct igu_ack_register { |
| 2920 | #if defined(__BIG_ENDIAN) |
| 2921 | u16 sb_id_and_flags; |
| 2922 | #define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0) |
| 2923 | #define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0 |
| 2924 | #define IGU_ACK_REGISTER_STORM_ID (0x7<<5) |
| 2925 | #define IGU_ACK_REGISTER_STORM_ID_SHIFT 5 |
| 2926 | #define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8) |
| 2927 | #define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8 |
| 2928 | #define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9) |
| 2929 | #define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9 |
| 2930 | #define IGU_ACK_REGISTER_RESERVED (0x1F<<11) |
| 2931 | #define IGU_ACK_REGISTER_RESERVED_SHIFT 11 |
| 2932 | u16 status_block_index; |
| 2933 | #elif defined(__LITTLE_ENDIAN) |
| 2934 | u16 status_block_index; |
| 2935 | u16 sb_id_and_flags; |
| 2936 | #define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0) |
| 2937 | #define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0 |
| 2938 | #define IGU_ACK_REGISTER_STORM_ID (0x7<<5) |
| 2939 | #define IGU_ACK_REGISTER_STORM_ID_SHIFT 5 |
| 2940 | #define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8) |
| 2941 | #define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8 |
| 2942 | #define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9) |
| 2943 | #define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9 |
| 2944 | #define IGU_ACK_REGISTER_RESERVED (0x1F<<11) |
| 2945 | #define IGU_ACK_REGISTER_RESERVED_SHIFT 11 |
| 2946 | #endif |
| 2947 | }; |
| 2948 | |
| 2949 | |
| 2950 | /* |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 2951 | * IGU driver acknowledgement register |
| 2952 | */ |
| 2953 | struct igu_backward_compatible { |
| 2954 | u32 sb_id_and_flags; |
| 2955 | #define IGU_BACKWARD_COMPATIBLE_SB_INDEX (0xFFFF<<0) |
| 2956 | #define IGU_BACKWARD_COMPATIBLE_SB_INDEX_SHIFT 0 |
| 2957 | #define IGU_BACKWARD_COMPATIBLE_SB_SELECT (0x1F<<16) |
| 2958 | #define IGU_BACKWARD_COMPATIBLE_SB_SELECT_SHIFT 16 |
| 2959 | #define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS (0x7<<21) |
| 2960 | #define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS_SHIFT 21 |
| 2961 | #define IGU_BACKWARD_COMPATIBLE_BUPDATE (0x1<<24) |
| 2962 | #define IGU_BACKWARD_COMPATIBLE_BUPDATE_SHIFT 24 |
| 2963 | #define IGU_BACKWARD_COMPATIBLE_ENABLE_INT (0x3<<25) |
| 2964 | #define IGU_BACKWARD_COMPATIBLE_ENABLE_INT_SHIFT 25 |
| 2965 | #define IGU_BACKWARD_COMPATIBLE_RESERVED_0 (0x1F<<27) |
| 2966 | #define IGU_BACKWARD_COMPATIBLE_RESERVED_0_SHIFT 27 |
| 2967 | u32 reserved_2; |
| 2968 | }; |
| 2969 | |
| 2970 | |
| 2971 | /* |
| 2972 | * IGU driver acknowledgement register |
| 2973 | */ |
| 2974 | struct igu_regular { |
| 2975 | u32 sb_id_and_flags; |
| 2976 | #define IGU_REGULAR_SB_INDEX (0xFFFFF<<0) |
| 2977 | #define IGU_REGULAR_SB_INDEX_SHIFT 0 |
| 2978 | #define IGU_REGULAR_RESERVED0 (0x1<<20) |
| 2979 | #define IGU_REGULAR_RESERVED0_SHIFT 20 |
| 2980 | #define IGU_REGULAR_SEGMENT_ACCESS (0x7<<21) |
| 2981 | #define IGU_REGULAR_SEGMENT_ACCESS_SHIFT 21 |
| 2982 | #define IGU_REGULAR_BUPDATE (0x1<<24) |
| 2983 | #define IGU_REGULAR_BUPDATE_SHIFT 24 |
| 2984 | #define IGU_REGULAR_ENABLE_INT (0x3<<25) |
| 2985 | #define IGU_REGULAR_ENABLE_INT_SHIFT 25 |
| 2986 | #define IGU_REGULAR_RESERVED_1 (0x1<<27) |
| 2987 | #define IGU_REGULAR_RESERVED_1_SHIFT 27 |
| 2988 | #define IGU_REGULAR_CLEANUP_TYPE (0x3<<28) |
| 2989 | #define IGU_REGULAR_CLEANUP_TYPE_SHIFT 28 |
| 2990 | #define IGU_REGULAR_CLEANUP_SET (0x1<<30) |
| 2991 | #define IGU_REGULAR_CLEANUP_SET_SHIFT 30 |
| 2992 | #define IGU_REGULAR_BCLEANUP (0x1<<31) |
| 2993 | #define IGU_REGULAR_BCLEANUP_SHIFT 31 |
| 2994 | u32 reserved_2; |
| 2995 | }; |
| 2996 | |
| 2997 | /* |
| 2998 | * IGU driver acknowledgement register |
| 2999 | */ |
| 3000 | union igu_consprod_reg { |
| 3001 | struct igu_regular regular; |
| 3002 | struct igu_backward_compatible backward_compatible; |
| 3003 | }; |
| 3004 | |
| 3005 | |
| 3006 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3007 | * Igu control commands |
| 3008 | */ |
| 3009 | enum igu_ctrl_cmd { |
| 3010 | IGU_CTRL_CMD_TYPE_RD, |
| 3011 | IGU_CTRL_CMD_TYPE_WR, |
| 3012 | MAX_IGU_CTRL_CMD |
| 3013 | }; |
| 3014 | |
| 3015 | |
| 3016 | /* |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 3017 | * Control register for the IGU command register |
| 3018 | */ |
| 3019 | struct igu_ctrl_reg { |
| 3020 | u32 ctrl_data; |
| 3021 | #define IGU_CTRL_REG_ADDRESS (0xFFF<<0) |
| 3022 | #define IGU_CTRL_REG_ADDRESS_SHIFT 0 |
| 3023 | #define IGU_CTRL_REG_FID (0x7F<<12) |
| 3024 | #define IGU_CTRL_REG_FID_SHIFT 12 |
| 3025 | #define IGU_CTRL_REG_RESERVED (0x1<<19) |
| 3026 | #define IGU_CTRL_REG_RESERVED_SHIFT 19 |
| 3027 | #define IGU_CTRL_REG_TYPE (0x1<<20) |
| 3028 | #define IGU_CTRL_REG_TYPE_SHIFT 20 |
| 3029 | #define IGU_CTRL_REG_UNUSED (0x7FF<<21) |
| 3030 | #define IGU_CTRL_REG_UNUSED_SHIFT 21 |
| 3031 | }; |
| 3032 | |
| 3033 | |
| 3034 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3035 | * Igu interrupt command |
| 3036 | */ |
| 3037 | enum igu_int_cmd { |
| 3038 | IGU_INT_ENABLE, |
| 3039 | IGU_INT_DISABLE, |
| 3040 | IGU_INT_NOP, |
| 3041 | IGU_INT_NOP2, |
| 3042 | MAX_IGU_INT_CMD |
| 3043 | }; |
| 3044 | |
| 3045 | |
| 3046 | /* |
| 3047 | * Igu segments |
| 3048 | */ |
| 3049 | enum igu_seg_access { |
| 3050 | IGU_SEG_ACCESS_NORM, |
| 3051 | IGU_SEG_ACCESS_DEF, |
| 3052 | IGU_SEG_ACCESS_ATTN, |
| 3053 | MAX_IGU_SEG_ACCESS |
| 3054 | }; |
| 3055 | |
| 3056 | |
| 3057 | /* |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3058 | * Parser parsing flags field |
| 3059 | */ |
| 3060 | struct parsing_flags { |
Eilon Greenstein | 4781bfa | 2009-02-12 08:38:17 +0000 | [diff] [blame] | 3061 | __le16 flags; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3062 | #define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0) |
| 3063 | #define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 3064 | #define PARSING_FLAGS_VLAN (0x1<<1) |
| 3065 | #define PARSING_FLAGS_VLAN_SHIFT 1 |
| 3066 | #define PARSING_FLAGS_EXTRA_VLAN (0x1<<2) |
| 3067 | #define PARSING_FLAGS_EXTRA_VLAN_SHIFT 2 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3068 | #define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL (0x3<<3) |
| 3069 | #define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT 3 |
| 3070 | #define PARSING_FLAGS_IP_OPTIONS (0x1<<5) |
| 3071 | #define PARSING_FLAGS_IP_OPTIONS_SHIFT 5 |
| 3072 | #define PARSING_FLAGS_FRAGMENTATION_STATUS (0x1<<6) |
| 3073 | #define PARSING_FLAGS_FRAGMENTATION_STATUS_SHIFT 6 |
| 3074 | #define PARSING_FLAGS_OVER_IP_PROTOCOL (0x3<<7) |
| 3075 | #define PARSING_FLAGS_OVER_IP_PROTOCOL_SHIFT 7 |
| 3076 | #define PARSING_FLAGS_PURE_ACK_INDICATION (0x1<<9) |
| 3077 | #define PARSING_FLAGS_PURE_ACK_INDICATION_SHIFT 9 |
| 3078 | #define PARSING_FLAGS_TCP_OPTIONS_EXIST (0x1<<10) |
| 3079 | #define PARSING_FLAGS_TCP_OPTIONS_EXIST_SHIFT 10 |
| 3080 | #define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG (0x1<<11) |
| 3081 | #define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG_SHIFT 11 |
| 3082 | #define PARSING_FLAGS_CONNECTION_MATCH (0x1<<12) |
| 3083 | #define PARSING_FLAGS_CONNECTION_MATCH_SHIFT 12 |
| 3084 | #define PARSING_FLAGS_LLC_SNAP (0x1<<13) |
| 3085 | #define PARSING_FLAGS_LLC_SNAP_SHIFT 13 |
| 3086 | #define PARSING_FLAGS_RESERVED0 (0x3<<14) |
| 3087 | #define PARSING_FLAGS_RESERVED0_SHIFT 14 |
| 3088 | }; |
| 3089 | |
| 3090 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3091 | /* |
| 3092 | * Parsing flags for TCP ACK type |
| 3093 | */ |
| 3094 | enum prs_flags_ack_type { |
| 3095 | PRS_FLAG_PUREACK_PIGGY, |
| 3096 | PRS_FLAG_PUREACK_PURE, |
| 3097 | MAX_PRS_FLAGS_ACK_TYPE |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 3098 | }; |
| 3099 | |
| 3100 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3101 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3102 | * Parsing flags for Ethernet address type |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3103 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3104 | enum prs_flags_eth_addr_type { |
| 3105 | PRS_FLAG_ETHTYPE_NON_UNICAST, |
| 3106 | PRS_FLAG_ETHTYPE_UNICAST, |
| 3107 | MAX_PRS_FLAGS_ETH_ADDR_TYPE |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3108 | }; |
| 3109 | |
| 3110 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3111 | /* |
| 3112 | * Parsing flags for over-ethernet protocol |
| 3113 | */ |
| 3114 | enum prs_flags_over_eth { |
| 3115 | PRS_FLAG_OVERETH_UNKNOWN, |
| 3116 | PRS_FLAG_OVERETH_IPV4, |
| 3117 | PRS_FLAG_OVERETH_IPV6, |
| 3118 | PRS_FLAG_OVERETH_LLCSNAP_UNKNOWN, |
| 3119 | MAX_PRS_FLAGS_OVER_ETH |
| 3120 | }; |
| 3121 | |
| 3122 | |
| 3123 | /* |
| 3124 | * Parsing flags for over-IP protocol |
| 3125 | */ |
| 3126 | enum prs_flags_over_ip { |
| 3127 | PRS_FLAG_OVERIP_UNKNOWN, |
| 3128 | PRS_FLAG_OVERIP_TCP, |
| 3129 | PRS_FLAG_OVERIP_UDP, |
| 3130 | MAX_PRS_FLAGS_OVER_IP |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3131 | }; |
| 3132 | |
| 3133 | |
| 3134 | /* |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3135 | * SDM operation gen command (generate aggregative interrupt) |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 3136 | */ |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3137 | struct sdm_op_gen { |
| 3138 | __le32 command; |
| 3139 | #define SDM_OP_GEN_COMP_PARAM (0x1F<<0) |
| 3140 | #define SDM_OP_GEN_COMP_PARAM_SHIFT 0 |
| 3141 | #define SDM_OP_GEN_COMP_TYPE (0x7<<5) |
| 3142 | #define SDM_OP_GEN_COMP_TYPE_SHIFT 5 |
| 3143 | #define SDM_OP_GEN_AGG_VECT_IDX (0xFF<<8) |
| 3144 | #define SDM_OP_GEN_AGG_VECT_IDX_SHIFT 8 |
| 3145 | #define SDM_OP_GEN_AGG_VECT_IDX_VALID (0x1<<16) |
| 3146 | #define SDM_OP_GEN_AGG_VECT_IDX_VALID_SHIFT 16 |
| 3147 | #define SDM_OP_GEN_RESERVED (0x7FFF<<17) |
| 3148 | #define SDM_OP_GEN_RESERVED_SHIFT 17 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 3149 | }; |
| 3150 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3151 | |
| 3152 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3153 | * Timers connection context |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 3154 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3155 | struct timers_block_context { |
| 3156 | u32 __reserved_0; |
| 3157 | u32 __reserved_1; |
| 3158 | u32 __reserved_2; |
| 3159 | u32 flags; |
| 3160 | #define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS (0x3<<0) |
| 3161 | #define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS_SHIFT 0 |
| 3162 | #define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG (0x1<<2) |
| 3163 | #define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG_SHIFT 2 |
| 3164 | #define __TIMERS_BLOCK_CONTEXT_RESERVED0 (0x1FFFFFFF<<3) |
| 3165 | #define __TIMERS_BLOCK_CONTEXT_RESERVED0_SHIFT 3 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 3166 | }; |
| 3167 | |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3168 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3169 | /* |
| 3170 | * The eth aggregative context of Tstorm |
| 3171 | */ |
| 3172 | struct tstorm_eth_ag_context { |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3173 | u32 __reserved0[14]; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3174 | }; |
| 3175 | |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3176 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3177 | /* |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3178 | * The eth aggregative context of Ustorm |
| 3179 | */ |
| 3180 | struct ustorm_eth_ag_context { |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3181 | u32 __reserved0; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3182 | #if defined(__BIG_ENDIAN) |
| 3183 | u8 cdu_usage; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3184 | u8 __reserved2; |
| 3185 | u16 __reserved1; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3186 | #elif defined(__LITTLE_ENDIAN) |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3187 | u16 __reserved1; |
| 3188 | u8 __reserved2; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3189 | u8 cdu_usage; |
| 3190 | #endif |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 3191 | u32 __reserved3[6]; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3192 | }; |
| 3193 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3194 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3195 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3196 | * The eth aggregative context of Xstorm |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3197 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3198 | struct xstorm_eth_ag_context { |
| 3199 | u32 reserved0; |
| 3200 | #if defined(__BIG_ENDIAN) |
| 3201 | u8 cdu_reserved; |
| 3202 | u8 reserved2; |
| 3203 | u16 reserved1; |
| 3204 | #elif defined(__LITTLE_ENDIAN) |
| 3205 | u16 reserved1; |
| 3206 | u8 reserved2; |
| 3207 | u8 cdu_reserved; |
| 3208 | #endif |
| 3209 | u32 reserved3[30]; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3210 | }; |
| 3211 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3212 | |
| 3213 | /* |
| 3214 | * doorbell message sent to the chip |
| 3215 | */ |
| 3216 | struct doorbell { |
| 3217 | #if defined(__BIG_ENDIAN) |
| 3218 | u16 zero_fill2; |
| 3219 | u8 zero_fill1; |
| 3220 | struct doorbell_hdr header; |
| 3221 | #elif defined(__LITTLE_ENDIAN) |
| 3222 | struct doorbell_hdr header; |
| 3223 | u8 zero_fill1; |
| 3224 | u16 zero_fill2; |
| 3225 | #endif |
| 3226 | }; |
| 3227 | |
| 3228 | |
| 3229 | /* |
| 3230 | * doorbell message sent to the chip |
| 3231 | */ |
| 3232 | struct doorbell_set_prod { |
| 3233 | #if defined(__BIG_ENDIAN) |
| 3234 | u16 prod; |
| 3235 | u8 zero_fill1; |
| 3236 | struct doorbell_hdr header; |
| 3237 | #elif defined(__LITTLE_ENDIAN) |
| 3238 | struct doorbell_hdr header; |
| 3239 | u8 zero_fill1; |
| 3240 | u16 prod; |
| 3241 | #endif |
| 3242 | }; |
| 3243 | |
| 3244 | |
| 3245 | struct regpair { |
| 3246 | __le32 lo; |
| 3247 | __le32 hi; |
| 3248 | }; |
| 3249 | |
| 3250 | |
| 3251 | /* |
| 3252 | * Classify rule opcodes in E2/E3 |
| 3253 | */ |
| 3254 | enum classify_rule { |
| 3255 | CLASSIFY_RULE_OPCODE_MAC, |
| 3256 | CLASSIFY_RULE_OPCODE_VLAN, |
| 3257 | CLASSIFY_RULE_OPCODE_PAIR, |
| 3258 | MAX_CLASSIFY_RULE |
| 3259 | }; |
| 3260 | |
| 3261 | |
| 3262 | /* |
| 3263 | * Classify rule types in E2/E3 |
| 3264 | */ |
| 3265 | enum classify_rule_action_type { |
| 3266 | CLASSIFY_RULE_REMOVE, |
| 3267 | CLASSIFY_RULE_ADD, |
| 3268 | MAX_CLASSIFY_RULE_ACTION_TYPE |
| 3269 | }; |
| 3270 | |
| 3271 | |
| 3272 | /* |
| 3273 | * client init ramrod data |
| 3274 | */ |
| 3275 | struct client_init_general_data { |
| 3276 | u8 client_id; |
| 3277 | u8 statistics_counter_id; |
| 3278 | u8 statistics_en_flg; |
| 3279 | u8 is_fcoe_flg; |
| 3280 | u8 activate_flg; |
| 3281 | u8 sp_client_id; |
| 3282 | __le16 mtu; |
| 3283 | u8 statistics_zero_flg; |
| 3284 | u8 func_id; |
| 3285 | u8 cos; |
| 3286 | u8 traffic_type; |
| 3287 | u32 reserved0; |
| 3288 | }; |
| 3289 | |
| 3290 | |
| 3291 | /* |
| 3292 | * client init rx data |
| 3293 | */ |
| 3294 | struct client_init_rx_data { |
| 3295 | u8 tpa_en; |
| 3296 | #define CLIENT_INIT_RX_DATA_TPA_EN_IPV4 (0x1<<0) |
| 3297 | #define CLIENT_INIT_RX_DATA_TPA_EN_IPV4_SHIFT 0 |
| 3298 | #define CLIENT_INIT_RX_DATA_TPA_EN_IPV6 (0x1<<1) |
| 3299 | #define CLIENT_INIT_RX_DATA_TPA_EN_IPV6_SHIFT 1 |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 3300 | #define CLIENT_INIT_RX_DATA_TPA_MODE (0x1<<2) |
| 3301 | #define CLIENT_INIT_RX_DATA_TPA_MODE_SHIFT 2 |
| 3302 | #define CLIENT_INIT_RX_DATA_RESERVED5 (0x1F<<3) |
| 3303 | #define CLIENT_INIT_RX_DATA_RESERVED5_SHIFT 3 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3304 | u8 vmqueue_mode_en_flg; |
| 3305 | u8 extra_data_over_sgl_en_flg; |
| 3306 | u8 cache_line_alignment_log_size; |
| 3307 | u8 enable_dynamic_hc; |
| 3308 | u8 max_sges_for_packet; |
| 3309 | u8 client_qzone_id; |
| 3310 | u8 drop_ip_cs_err_flg; |
| 3311 | u8 drop_tcp_cs_err_flg; |
| 3312 | u8 drop_ttl0_flg; |
| 3313 | u8 drop_udp_cs_err_flg; |
| 3314 | u8 inner_vlan_removal_enable_flg; |
| 3315 | u8 outer_vlan_removal_enable_flg; |
| 3316 | u8 status_block_id; |
| 3317 | u8 rx_sb_index_number; |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 3318 | u8 dont_verify_rings_pause_thr_flg; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3319 | u8 max_tpa_queues; |
| 3320 | u8 silent_vlan_removal_flg; |
| 3321 | __le16 max_bytes_on_bd; |
| 3322 | __le16 sge_buff_size; |
| 3323 | u8 approx_mcast_engine_id; |
| 3324 | u8 rss_engine_id; |
| 3325 | struct regpair bd_page_base; |
| 3326 | struct regpair sge_page_base; |
| 3327 | struct regpair cqe_page_base; |
| 3328 | u8 is_leading_rss; |
| 3329 | u8 is_approx_mcast; |
| 3330 | __le16 max_agg_size; |
| 3331 | __le16 state; |
| 3332 | #define CLIENT_INIT_RX_DATA_UCAST_DROP_ALL (0x1<<0) |
| 3333 | #define CLIENT_INIT_RX_DATA_UCAST_DROP_ALL_SHIFT 0 |
| 3334 | #define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_ALL (0x1<<1) |
| 3335 | #define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_ALL_SHIFT 1 |
| 3336 | #define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_UNMATCHED (0x1<<2) |
| 3337 | #define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_UNMATCHED_SHIFT 2 |
| 3338 | #define CLIENT_INIT_RX_DATA_MCAST_DROP_ALL (0x1<<3) |
| 3339 | #define CLIENT_INIT_RX_DATA_MCAST_DROP_ALL_SHIFT 3 |
| 3340 | #define CLIENT_INIT_RX_DATA_MCAST_ACCEPT_ALL (0x1<<4) |
| 3341 | #define CLIENT_INIT_RX_DATA_MCAST_ACCEPT_ALL_SHIFT 4 |
| 3342 | #define CLIENT_INIT_RX_DATA_BCAST_ACCEPT_ALL (0x1<<5) |
| 3343 | #define CLIENT_INIT_RX_DATA_BCAST_ACCEPT_ALL_SHIFT 5 |
| 3344 | #define CLIENT_INIT_RX_DATA_ACCEPT_ANY_VLAN (0x1<<6) |
| 3345 | #define CLIENT_INIT_RX_DATA_ACCEPT_ANY_VLAN_SHIFT 6 |
| 3346 | #define CLIENT_INIT_RX_DATA_RESERVED2 (0x1FF<<7) |
| 3347 | #define CLIENT_INIT_RX_DATA_RESERVED2_SHIFT 7 |
| 3348 | __le16 cqe_pause_thr_low; |
| 3349 | __le16 cqe_pause_thr_high; |
| 3350 | __le16 bd_pause_thr_low; |
| 3351 | __le16 bd_pause_thr_high; |
| 3352 | __le16 sge_pause_thr_low; |
| 3353 | __le16 sge_pause_thr_high; |
| 3354 | __le16 rx_cos_mask; |
| 3355 | __le16 silent_vlan_value; |
| 3356 | __le16 silent_vlan_mask; |
| 3357 | __le32 reserved6[2]; |
| 3358 | }; |
| 3359 | |
| 3360 | /* |
| 3361 | * client init tx data |
| 3362 | */ |
| 3363 | struct client_init_tx_data { |
| 3364 | u8 enforce_security_flg; |
| 3365 | u8 tx_status_block_id; |
| 3366 | u8 tx_sb_index_number; |
| 3367 | u8 tss_leading_client_id; |
| 3368 | u8 tx_switching_flg; |
| 3369 | u8 anti_spoofing_flg; |
| 3370 | __le16 default_vlan; |
| 3371 | struct regpair tx_bd_page_base; |
| 3372 | __le16 state; |
| 3373 | #define CLIENT_INIT_TX_DATA_UCAST_ACCEPT_ALL (0x1<<0) |
| 3374 | #define CLIENT_INIT_TX_DATA_UCAST_ACCEPT_ALL_SHIFT 0 |
| 3375 | #define CLIENT_INIT_TX_DATA_MCAST_ACCEPT_ALL (0x1<<1) |
| 3376 | #define CLIENT_INIT_TX_DATA_MCAST_ACCEPT_ALL_SHIFT 1 |
| 3377 | #define CLIENT_INIT_TX_DATA_BCAST_ACCEPT_ALL (0x1<<2) |
| 3378 | #define CLIENT_INIT_TX_DATA_BCAST_ACCEPT_ALL_SHIFT 2 |
| 3379 | #define CLIENT_INIT_TX_DATA_ACCEPT_ANY_VLAN (0x1<<3) |
| 3380 | #define CLIENT_INIT_TX_DATA_ACCEPT_ANY_VLAN_SHIFT 3 |
| 3381 | #define CLIENT_INIT_TX_DATA_RESERVED1 (0xFFF<<4) |
| 3382 | #define CLIENT_INIT_TX_DATA_RESERVED1_SHIFT 4 |
| 3383 | u8 default_vlan_flg; |
| 3384 | u8 reserved2; |
| 3385 | __le32 reserved3; |
| 3386 | }; |
| 3387 | |
| 3388 | /* |
| 3389 | * client init ramrod data |
| 3390 | */ |
| 3391 | struct client_init_ramrod_data { |
| 3392 | struct client_init_general_data general; |
| 3393 | struct client_init_rx_data rx; |
| 3394 | struct client_init_tx_data tx; |
| 3395 | }; |
| 3396 | |
| 3397 | |
| 3398 | /* |
| 3399 | * client update ramrod data |
| 3400 | */ |
| 3401 | struct client_update_ramrod_data { |
| 3402 | u8 client_id; |
| 3403 | u8 func_id; |
| 3404 | u8 inner_vlan_removal_enable_flg; |
| 3405 | u8 inner_vlan_removal_change_flg; |
| 3406 | u8 outer_vlan_removal_enable_flg; |
| 3407 | u8 outer_vlan_removal_change_flg; |
| 3408 | u8 anti_spoofing_enable_flg; |
| 3409 | u8 anti_spoofing_change_flg; |
| 3410 | u8 activate_flg; |
| 3411 | u8 activate_change_flg; |
| 3412 | __le16 default_vlan; |
| 3413 | u8 default_vlan_enable_flg; |
| 3414 | u8 default_vlan_change_flg; |
| 3415 | __le16 silent_vlan_value; |
| 3416 | __le16 silent_vlan_mask; |
| 3417 | u8 silent_vlan_removal_flg; |
| 3418 | u8 silent_vlan_change_flg; |
| 3419 | __le32 echo; |
| 3420 | }; |
| 3421 | |
| 3422 | |
| 3423 | /* |
| 3424 | * The eth storm context of Cstorm |
| 3425 | */ |
| 3426 | struct cstorm_eth_st_context { |
| 3427 | u32 __reserved0[4]; |
| 3428 | }; |
| 3429 | |
| 3430 | |
| 3431 | struct double_regpair { |
| 3432 | u32 regpair0_lo; |
| 3433 | u32 regpair0_hi; |
| 3434 | u32 regpair1_lo; |
| 3435 | u32 regpair1_hi; |
| 3436 | }; |
| 3437 | |
| 3438 | |
| 3439 | /* |
| 3440 | * Ethernet address typesm used in ethernet tx BDs |
| 3441 | */ |
| 3442 | enum eth_addr_type { |
| 3443 | UNKNOWN_ADDRESS, |
| 3444 | UNICAST_ADDRESS, |
| 3445 | MULTICAST_ADDRESS, |
| 3446 | BROADCAST_ADDRESS, |
| 3447 | MAX_ETH_ADDR_TYPE |
| 3448 | }; |
| 3449 | |
| 3450 | |
| 3451 | /* |
| 3452 | * |
| 3453 | */ |
| 3454 | struct eth_classify_cmd_header { |
| 3455 | u8 cmd_general_data; |
| 3456 | #define ETH_CLASSIFY_CMD_HEADER_RX_CMD (0x1<<0) |
| 3457 | #define ETH_CLASSIFY_CMD_HEADER_RX_CMD_SHIFT 0 |
| 3458 | #define ETH_CLASSIFY_CMD_HEADER_TX_CMD (0x1<<1) |
| 3459 | #define ETH_CLASSIFY_CMD_HEADER_TX_CMD_SHIFT 1 |
| 3460 | #define ETH_CLASSIFY_CMD_HEADER_OPCODE (0x3<<2) |
| 3461 | #define ETH_CLASSIFY_CMD_HEADER_OPCODE_SHIFT 2 |
| 3462 | #define ETH_CLASSIFY_CMD_HEADER_IS_ADD (0x1<<4) |
| 3463 | #define ETH_CLASSIFY_CMD_HEADER_IS_ADD_SHIFT 4 |
| 3464 | #define ETH_CLASSIFY_CMD_HEADER_RESERVED0 (0x7<<5) |
| 3465 | #define ETH_CLASSIFY_CMD_HEADER_RESERVED0_SHIFT 5 |
| 3466 | u8 func_id; |
| 3467 | u8 client_id; |
| 3468 | u8 reserved1; |
| 3469 | }; |
| 3470 | |
| 3471 | |
| 3472 | /* |
| 3473 | * header for eth classification config ramrod |
| 3474 | */ |
| 3475 | struct eth_classify_header { |
| 3476 | u8 rule_cnt; |
| 3477 | u8 reserved0; |
| 3478 | __le16 reserved1; |
| 3479 | __le32 echo; |
| 3480 | }; |
| 3481 | |
| 3482 | |
| 3483 | /* |
| 3484 | * Command for adding/removing a MAC classification rule |
| 3485 | */ |
| 3486 | struct eth_classify_mac_cmd { |
| 3487 | struct eth_classify_cmd_header header; |
| 3488 | __le32 reserved0; |
| 3489 | __le16 mac_lsb; |
| 3490 | __le16 mac_mid; |
| 3491 | __le16 mac_msb; |
| 3492 | __le16 reserved1; |
| 3493 | }; |
| 3494 | |
| 3495 | |
| 3496 | /* |
| 3497 | * Command for adding/removing a MAC-VLAN pair classification rule |
| 3498 | */ |
| 3499 | struct eth_classify_pair_cmd { |
| 3500 | struct eth_classify_cmd_header header; |
| 3501 | __le32 reserved0; |
| 3502 | __le16 mac_lsb; |
| 3503 | __le16 mac_mid; |
| 3504 | __le16 mac_msb; |
| 3505 | __le16 vlan; |
| 3506 | }; |
| 3507 | |
| 3508 | |
| 3509 | /* |
| 3510 | * Command for adding/removing a VLAN classification rule |
| 3511 | */ |
| 3512 | struct eth_classify_vlan_cmd { |
| 3513 | struct eth_classify_cmd_header header; |
| 3514 | __le32 reserved0; |
| 3515 | __le32 reserved1; |
| 3516 | __le16 reserved2; |
| 3517 | __le16 vlan; |
| 3518 | }; |
| 3519 | |
| 3520 | /* |
| 3521 | * union for eth classification rule |
| 3522 | */ |
| 3523 | union eth_classify_rule_cmd { |
| 3524 | struct eth_classify_mac_cmd mac; |
| 3525 | struct eth_classify_vlan_cmd vlan; |
| 3526 | struct eth_classify_pair_cmd pair; |
| 3527 | }; |
| 3528 | |
| 3529 | /* |
| 3530 | * parameters for eth classification configuration ramrod |
| 3531 | */ |
| 3532 | struct eth_classify_rules_ramrod_data { |
| 3533 | struct eth_classify_header header; |
| 3534 | union eth_classify_rule_cmd rules[CLASSIFY_RULES_COUNT]; |
| 3535 | }; |
| 3536 | |
| 3537 | |
| 3538 | /* |
| 3539 | * The data contain client ID need to the ramrod |
| 3540 | */ |
| 3541 | struct eth_common_ramrod_data { |
| 3542 | __le32 client_id; |
| 3543 | __le32 reserved1; |
| 3544 | }; |
| 3545 | |
| 3546 | |
| 3547 | /* |
| 3548 | * The eth storm context of Ustorm |
| 3549 | */ |
| 3550 | struct ustorm_eth_st_context { |
| 3551 | u32 reserved0[52]; |
| 3552 | }; |
| 3553 | |
| 3554 | /* |
| 3555 | * The eth storm context of Tstorm |
| 3556 | */ |
| 3557 | struct tstorm_eth_st_context { |
| 3558 | u32 __reserved0[28]; |
| 3559 | }; |
| 3560 | |
| 3561 | /* |
| 3562 | * The eth storm context of Xstorm |
| 3563 | */ |
| 3564 | struct xstorm_eth_st_context { |
| 3565 | u32 reserved0[60]; |
| 3566 | }; |
| 3567 | |
| 3568 | /* |
| 3569 | * Ethernet connection context |
| 3570 | */ |
| 3571 | struct eth_context { |
| 3572 | struct ustorm_eth_st_context ustorm_st_context; |
| 3573 | struct tstorm_eth_st_context tstorm_st_context; |
| 3574 | struct xstorm_eth_ag_context xstorm_ag_context; |
| 3575 | struct tstorm_eth_ag_context tstorm_ag_context; |
| 3576 | struct cstorm_eth_ag_context cstorm_ag_context; |
| 3577 | struct ustorm_eth_ag_context ustorm_ag_context; |
| 3578 | struct timers_block_context timers_context; |
| 3579 | struct xstorm_eth_st_context xstorm_st_context; |
| 3580 | struct cstorm_eth_st_context cstorm_st_context; |
| 3581 | }; |
| 3582 | |
| 3583 | |
| 3584 | /* |
| 3585 | * union for sgl and raw data. |
| 3586 | */ |
| 3587 | union eth_sgl_or_raw_data { |
| 3588 | __le16 sgl[8]; |
| 3589 | u32 raw_data[4]; |
| 3590 | }; |
| 3591 | |
| 3592 | /* |
| 3593 | * eth FP end aggregation CQE parameters struct |
| 3594 | */ |
| 3595 | struct eth_end_agg_rx_cqe { |
| 3596 | u8 type_error_flags; |
| 3597 | #define ETH_END_AGG_RX_CQE_TYPE (0x3<<0) |
| 3598 | #define ETH_END_AGG_RX_CQE_TYPE_SHIFT 0 |
| 3599 | #define ETH_END_AGG_RX_CQE_SGL_RAW_SEL (0x1<<2) |
| 3600 | #define ETH_END_AGG_RX_CQE_SGL_RAW_SEL_SHIFT 2 |
| 3601 | #define ETH_END_AGG_RX_CQE_RESERVED0 (0x1F<<3) |
| 3602 | #define ETH_END_AGG_RX_CQE_RESERVED0_SHIFT 3 |
| 3603 | u8 reserved1; |
| 3604 | u8 queue_index; |
| 3605 | u8 reserved2; |
| 3606 | __le32 timestamp_delta; |
| 3607 | __le16 num_of_coalesced_segs; |
| 3608 | __le16 pkt_len; |
| 3609 | u8 pure_ack_count; |
| 3610 | u8 reserved3; |
| 3611 | __le16 reserved4; |
| 3612 | union eth_sgl_or_raw_data sgl_or_raw_data; |
| 3613 | __le32 reserved5[8]; |
| 3614 | }; |
| 3615 | |
| 3616 | |
| 3617 | /* |
| 3618 | * regular eth FP CQE parameters struct |
| 3619 | */ |
| 3620 | struct eth_fast_path_rx_cqe { |
| 3621 | u8 type_error_flags; |
| 3622 | #define ETH_FAST_PATH_RX_CQE_TYPE (0x3<<0) |
| 3623 | #define ETH_FAST_PATH_RX_CQE_TYPE_SHIFT 0 |
| 3624 | #define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL (0x1<<2) |
| 3625 | #define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL_SHIFT 2 |
| 3626 | #define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG (0x1<<3) |
| 3627 | #define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG_SHIFT 3 |
| 3628 | #define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG (0x1<<4) |
| 3629 | #define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG_SHIFT 4 |
| 3630 | #define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG (0x1<<5) |
| 3631 | #define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG_SHIFT 5 |
| 3632 | #define ETH_FAST_PATH_RX_CQE_RESERVED0 (0x3<<6) |
| 3633 | #define ETH_FAST_PATH_RX_CQE_RESERVED0_SHIFT 6 |
| 3634 | u8 status_flags; |
| 3635 | #define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE (0x7<<0) |
| 3636 | #define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE_SHIFT 0 |
| 3637 | #define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG (0x1<<3) |
| 3638 | #define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG_SHIFT 3 |
| 3639 | #define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG (0x1<<4) |
| 3640 | #define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG_SHIFT 4 |
| 3641 | #define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG (0x1<<5) |
| 3642 | #define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG_SHIFT 5 |
| 3643 | #define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG (0x1<<6) |
| 3644 | #define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG_SHIFT 6 |
| 3645 | #define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG (0x1<<7) |
| 3646 | #define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7 |
| 3647 | u8 queue_index; |
| 3648 | u8 placement_offset; |
| 3649 | __le32 rss_hash_result; |
| 3650 | __le16 vlan_tag; |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 3651 | __le16 pkt_len_or_gro_seg_len; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 3652 | __le16 len_on_bd; |
| 3653 | struct parsing_flags pars_flags; |
| 3654 | union eth_sgl_or_raw_data sgl_or_raw_data; |
| 3655 | __le32 reserved1[8]; |
| 3656 | }; |
| 3657 | |
| 3658 | |
| 3659 | /* |
| 3660 | * Command for setting classification flags for a client |
| 3661 | */ |
| 3662 | struct eth_filter_rules_cmd { |
| 3663 | u8 cmd_general_data; |
| 3664 | #define ETH_FILTER_RULES_CMD_RX_CMD (0x1<<0) |
| 3665 | #define ETH_FILTER_RULES_CMD_RX_CMD_SHIFT 0 |
| 3666 | #define ETH_FILTER_RULES_CMD_TX_CMD (0x1<<1) |
| 3667 | #define ETH_FILTER_RULES_CMD_TX_CMD_SHIFT 1 |
| 3668 | #define ETH_FILTER_RULES_CMD_RESERVED0 (0x3F<<2) |
| 3669 | #define ETH_FILTER_RULES_CMD_RESERVED0_SHIFT 2 |
| 3670 | u8 func_id; |
| 3671 | u8 client_id; |
| 3672 | u8 reserved1; |
| 3673 | __le16 state; |
| 3674 | #define ETH_FILTER_RULES_CMD_UCAST_DROP_ALL (0x1<<0) |
| 3675 | #define ETH_FILTER_RULES_CMD_UCAST_DROP_ALL_SHIFT 0 |
| 3676 | #define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_ALL (0x1<<1) |
| 3677 | #define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_ALL_SHIFT 1 |
| 3678 | #define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_UNMATCHED (0x1<<2) |
| 3679 | #define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_UNMATCHED_SHIFT 2 |
| 3680 | #define ETH_FILTER_RULES_CMD_MCAST_DROP_ALL (0x1<<3) |
| 3681 | #define ETH_FILTER_RULES_CMD_MCAST_DROP_ALL_SHIFT 3 |
| 3682 | #define ETH_FILTER_RULES_CMD_MCAST_ACCEPT_ALL (0x1<<4) |
| 3683 | #define ETH_FILTER_RULES_CMD_MCAST_ACCEPT_ALL_SHIFT 4 |
| 3684 | #define ETH_FILTER_RULES_CMD_BCAST_ACCEPT_ALL (0x1<<5) |
| 3685 | #define ETH_FILTER_RULES_CMD_BCAST_ACCEPT_ALL_SHIFT 5 |
| 3686 | #define ETH_FILTER_RULES_CMD_ACCEPT_ANY_VLAN (0x1<<6) |
| 3687 | #define ETH_FILTER_RULES_CMD_ACCEPT_ANY_VLAN_SHIFT 6 |
| 3688 | #define ETH_FILTER_RULES_CMD_RESERVED2 (0x1FF<<7) |
| 3689 | #define ETH_FILTER_RULES_CMD_RESERVED2_SHIFT 7 |
| 3690 | __le16 reserved3; |
| 3691 | struct regpair reserved4; |
| 3692 | }; |
| 3693 | |
| 3694 | |
| 3695 | /* |
| 3696 | * parameters for eth classification filters ramrod |
| 3697 | */ |
| 3698 | struct eth_filter_rules_ramrod_data { |
| 3699 | struct eth_classify_header header; |
| 3700 | struct eth_filter_rules_cmd rules[FILTER_RULES_COUNT]; |
| 3701 | }; |
| 3702 | |
| 3703 | |
| 3704 | /* |
| 3705 | * parameters for eth classification configuration ramrod |
| 3706 | */ |
| 3707 | struct eth_general_rules_ramrod_data { |
| 3708 | struct eth_classify_header header; |
| 3709 | union eth_classify_rule_cmd rules[CLASSIFY_RULES_COUNT]; |
| 3710 | }; |
| 3711 | |
| 3712 | |
| 3713 | /* |
| 3714 | * The data for Halt ramrod |
| 3715 | */ |
| 3716 | struct eth_halt_ramrod_data { |
| 3717 | __le32 client_id; |
| 3718 | __le32 reserved0; |
| 3719 | }; |
| 3720 | |
| 3721 | |
| 3722 | /* |
| 3723 | * Command for setting multicast classification for a client |
| 3724 | */ |
| 3725 | struct eth_multicast_rules_cmd { |
| 3726 | u8 cmd_general_data; |
| 3727 | #define ETH_MULTICAST_RULES_CMD_RX_CMD (0x1<<0) |
| 3728 | #define ETH_MULTICAST_RULES_CMD_RX_CMD_SHIFT 0 |
| 3729 | #define ETH_MULTICAST_RULES_CMD_TX_CMD (0x1<<1) |
| 3730 | #define ETH_MULTICAST_RULES_CMD_TX_CMD_SHIFT 1 |
| 3731 | #define ETH_MULTICAST_RULES_CMD_IS_ADD (0x1<<2) |
| 3732 | #define ETH_MULTICAST_RULES_CMD_IS_ADD_SHIFT 2 |
| 3733 | #define ETH_MULTICAST_RULES_CMD_RESERVED0 (0x1F<<3) |
| 3734 | #define ETH_MULTICAST_RULES_CMD_RESERVED0_SHIFT 3 |
| 3735 | u8 func_id; |
| 3736 | u8 bin_id; |
| 3737 | u8 engine_id; |
| 3738 | __le32 reserved2; |
| 3739 | struct regpair reserved3; |
| 3740 | }; |
| 3741 | |
| 3742 | |
| 3743 | /* |
| 3744 | * parameters for multicast classification ramrod |
| 3745 | */ |
| 3746 | struct eth_multicast_rules_ramrod_data { |
| 3747 | struct eth_classify_header header; |
| 3748 | struct eth_multicast_rules_cmd rules[MULTICAST_RULES_COUNT]; |
| 3749 | }; |
| 3750 | |
| 3751 | |
| 3752 | /* |
| 3753 | * Place holder for ramrods protocol specific data |
| 3754 | */ |
| 3755 | struct ramrod_data { |
| 3756 | __le32 data_lo; |
| 3757 | __le32 data_hi; |
| 3758 | }; |
| 3759 | |
| 3760 | /* |
| 3761 | * union for ramrod data for Ethernet protocol (CQE) (force size of 16 bits) |
| 3762 | */ |
| 3763 | union eth_ramrod_data { |
| 3764 | struct ramrod_data general; |
| 3765 | }; |
| 3766 | |
| 3767 | |
| 3768 | /* |
| 3769 | * RSS toeplitz hash type, as reported in CQE |
| 3770 | */ |
| 3771 | enum eth_rss_hash_type { |
| 3772 | DEFAULT_HASH_TYPE, |
| 3773 | IPV4_HASH_TYPE, |
| 3774 | TCP_IPV4_HASH_TYPE, |
| 3775 | IPV6_HASH_TYPE, |
| 3776 | TCP_IPV6_HASH_TYPE, |
| 3777 | VLAN_PRI_HASH_TYPE, |
| 3778 | E1HOV_PRI_HASH_TYPE, |
| 3779 | DSCP_HASH_TYPE, |
| 3780 | MAX_ETH_RSS_HASH_TYPE |
| 3781 | }; |
| 3782 | |
| 3783 | |
| 3784 | /* |
| 3785 | * Ethernet RSS mode |
| 3786 | */ |
| 3787 | enum eth_rss_mode { |
| 3788 | ETH_RSS_MODE_DISABLED, |
| 3789 | ETH_RSS_MODE_REGULAR, |
| 3790 | ETH_RSS_MODE_VLAN_PRI, |
| 3791 | ETH_RSS_MODE_E1HOV_PRI, |
| 3792 | ETH_RSS_MODE_IP_DSCP, |
| 3793 | MAX_ETH_RSS_MODE |
| 3794 | }; |
| 3795 | |
| 3796 | |
| 3797 | /* |
| 3798 | * parameters for RSS update ramrod (E2) |
| 3799 | */ |
| 3800 | struct eth_rss_update_ramrod_data { |
| 3801 | u8 rss_engine_id; |
| 3802 | u8 capabilities; |
| 3803 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_CAPABILITY (0x1<<0) |
| 3804 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_CAPABILITY_SHIFT 0 |
| 3805 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_TCP_CAPABILITY (0x1<<1) |
| 3806 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_TCP_CAPABILITY_SHIFT 1 |
| 3807 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_UDP_CAPABILITY (0x1<<2) |
| 3808 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_UDP_CAPABILITY_SHIFT 2 |
| 3809 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_CAPABILITY (0x1<<3) |
| 3810 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_CAPABILITY_SHIFT 3 |
| 3811 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_TCP_CAPABILITY (0x1<<4) |
| 3812 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_TCP_CAPABILITY_SHIFT 4 |
| 3813 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY (0x1<<5) |
| 3814 | #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY_SHIFT 5 |
| 3815 | #define ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY (0x1<<6) |
| 3816 | #define ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY_SHIFT 6 |
| 3817 | #define __ETH_RSS_UPDATE_RAMROD_DATA_RESERVED0 (0x1<<7) |
| 3818 | #define __ETH_RSS_UPDATE_RAMROD_DATA_RESERVED0_SHIFT 7 |
| 3819 | u8 rss_result_mask; |
| 3820 | u8 rss_mode; |
| 3821 | __le32 __reserved2; |
| 3822 | u8 indirection_table[T_ETH_INDIRECTION_TABLE_SIZE]; |
| 3823 | __le32 rss_key[T_ETH_RSS_KEY]; |
| 3824 | __le32 echo; |
| 3825 | __le32 reserved3; |
| 3826 | }; |
| 3827 | |
| 3828 | |
| 3829 | /* |
| 3830 | * The eth Rx Buffer Descriptor |
| 3831 | */ |
| 3832 | struct eth_rx_bd { |
| 3833 | __le32 addr_lo; |
| 3834 | __le32 addr_hi; |
| 3835 | }; |
| 3836 | |
| 3837 | |
| 3838 | /* |
| 3839 | * Eth Rx Cqe structure- general structure for ramrods |
| 3840 | */ |
| 3841 | struct common_ramrod_eth_rx_cqe { |
| 3842 | u8 ramrod_type; |
| 3843 | #define COMMON_RAMROD_ETH_RX_CQE_TYPE (0x3<<0) |
| 3844 | #define COMMON_RAMROD_ETH_RX_CQE_TYPE_SHIFT 0 |
| 3845 | #define COMMON_RAMROD_ETH_RX_CQE_ERROR (0x1<<2) |
| 3846 | #define COMMON_RAMROD_ETH_RX_CQE_ERROR_SHIFT 2 |
| 3847 | #define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x1F<<3) |
| 3848 | #define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 3 |
| 3849 | u8 conn_type; |
| 3850 | __le16 reserved1; |
| 3851 | __le32 conn_and_cmd_data; |
| 3852 | #define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0) |
| 3853 | #define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0 |
| 3854 | #define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24) |
| 3855 | #define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24 |
| 3856 | struct ramrod_data protocol_data; |
| 3857 | __le32 echo; |
| 3858 | __le32 reserved2[11]; |
| 3859 | }; |
| 3860 | |
| 3861 | /* |
| 3862 | * Rx Last CQE in page (in ETH) |
| 3863 | */ |
| 3864 | struct eth_rx_cqe_next_page { |
| 3865 | __le32 addr_lo; |
| 3866 | __le32 addr_hi; |
| 3867 | __le32 reserved[14]; |
| 3868 | }; |
| 3869 | |
| 3870 | /* |
| 3871 | * union for all eth rx cqe types (fix their sizes) |
| 3872 | */ |
| 3873 | union eth_rx_cqe { |
| 3874 | struct eth_fast_path_rx_cqe fast_path_cqe; |
| 3875 | struct common_ramrod_eth_rx_cqe ramrod_cqe; |
| 3876 | struct eth_rx_cqe_next_page next_page_cqe; |
| 3877 | struct eth_end_agg_rx_cqe end_agg_cqe; |
| 3878 | }; |
| 3879 | |
| 3880 | |
| 3881 | /* |
| 3882 | * Values for RX ETH CQE type field |
| 3883 | */ |
| 3884 | enum eth_rx_cqe_type { |
| 3885 | RX_ETH_CQE_TYPE_ETH_FASTPATH, |
| 3886 | RX_ETH_CQE_TYPE_ETH_RAMROD, |
| 3887 | RX_ETH_CQE_TYPE_ETH_START_AGG, |
| 3888 | RX_ETH_CQE_TYPE_ETH_STOP_AGG, |
| 3889 | MAX_ETH_RX_CQE_TYPE |
| 3890 | }; |
| 3891 | |
| 3892 | |
| 3893 | /* |
| 3894 | * Type of SGL/Raw field in ETH RX fast path CQE |
| 3895 | */ |
| 3896 | enum eth_rx_fp_sel { |
| 3897 | ETH_FP_CQE_REGULAR, |
| 3898 | ETH_FP_CQE_RAW, |
| 3899 | MAX_ETH_RX_FP_SEL |
| 3900 | }; |
| 3901 | |
| 3902 | |
| 3903 | /* |
| 3904 | * The eth Rx SGE Descriptor |
| 3905 | */ |
| 3906 | struct eth_rx_sge { |
| 3907 | __le32 addr_lo; |
| 3908 | __le32 addr_hi; |
| 3909 | }; |
| 3910 | |
| 3911 | |
| 3912 | /* |
| 3913 | * common data for all protocols |
| 3914 | */ |
| 3915 | struct spe_hdr { |
| 3916 | __le32 conn_and_cmd_data; |
| 3917 | #define SPE_HDR_CID (0xFFFFFF<<0) |
| 3918 | #define SPE_HDR_CID_SHIFT 0 |
| 3919 | #define SPE_HDR_CMD_ID (0xFF<<24) |
| 3920 | #define SPE_HDR_CMD_ID_SHIFT 24 |
| 3921 | __le16 type; |
| 3922 | #define SPE_HDR_CONN_TYPE (0xFF<<0) |
| 3923 | #define SPE_HDR_CONN_TYPE_SHIFT 0 |
| 3924 | #define SPE_HDR_FUNCTION_ID (0xFF<<8) |
| 3925 | #define SPE_HDR_FUNCTION_ID_SHIFT 8 |
| 3926 | __le16 reserved1; |
| 3927 | }; |
| 3928 | |
| 3929 | /* |
| 3930 | * specific data for ethernet slow path element |
| 3931 | */ |
| 3932 | union eth_specific_data { |
| 3933 | u8 protocol_data[8]; |
| 3934 | struct regpair client_update_ramrod_data; |
| 3935 | struct regpair client_init_ramrod_init_data; |
| 3936 | struct eth_halt_ramrod_data halt_ramrod_data; |
| 3937 | struct regpair update_data_addr; |
| 3938 | struct eth_common_ramrod_data common_ramrod_data; |
| 3939 | struct regpair classify_cfg_addr; |
| 3940 | struct regpair filter_cfg_addr; |
| 3941 | struct regpair mcast_cfg_addr; |
| 3942 | }; |
| 3943 | |
| 3944 | /* |
| 3945 | * Ethernet slow path element |
| 3946 | */ |
| 3947 | struct eth_spe { |
| 3948 | struct spe_hdr hdr; |
| 3949 | union eth_specific_data data; |
| 3950 | }; |
| 3951 | |
| 3952 | |
| 3953 | /* |
| 3954 | * Ethernet command ID for slow path elements |
| 3955 | */ |
| 3956 | enum eth_spqe_cmd_id { |
| 3957 | RAMROD_CMD_ID_ETH_UNUSED, |
| 3958 | RAMROD_CMD_ID_ETH_CLIENT_SETUP, |
| 3959 | RAMROD_CMD_ID_ETH_HALT, |
| 3960 | RAMROD_CMD_ID_ETH_FORWARD_SETUP, |
| 3961 | RAMROD_CMD_ID_ETH_TX_QUEUE_SETUP, |
| 3962 | RAMROD_CMD_ID_ETH_CLIENT_UPDATE, |
| 3963 | RAMROD_CMD_ID_ETH_EMPTY, |
| 3964 | RAMROD_CMD_ID_ETH_TERMINATE, |
| 3965 | RAMROD_CMD_ID_ETH_TPA_UPDATE, |
| 3966 | RAMROD_CMD_ID_ETH_CLASSIFICATION_RULES, |
| 3967 | RAMROD_CMD_ID_ETH_FILTER_RULES, |
| 3968 | RAMROD_CMD_ID_ETH_MULTICAST_RULES, |
| 3969 | RAMROD_CMD_ID_ETH_RSS_UPDATE, |
| 3970 | RAMROD_CMD_ID_ETH_SET_MAC, |
| 3971 | MAX_ETH_SPQE_CMD_ID |
| 3972 | }; |
| 3973 | |
| 3974 | |
| 3975 | /* |
| 3976 | * eth tpa update command |
| 3977 | */ |
| 3978 | enum eth_tpa_update_command { |
| 3979 | TPA_UPDATE_NONE_COMMAND, |
| 3980 | TPA_UPDATE_ENABLE_COMMAND, |
| 3981 | TPA_UPDATE_DISABLE_COMMAND, |
| 3982 | MAX_ETH_TPA_UPDATE_COMMAND |
| 3983 | }; |
| 3984 | |
| 3985 | |
| 3986 | /* |
| 3987 | * Tx regular BD structure |
| 3988 | */ |
| 3989 | struct eth_tx_bd { |
| 3990 | __le32 addr_lo; |
| 3991 | __le32 addr_hi; |
| 3992 | __le16 total_pkt_bytes; |
| 3993 | __le16 nbytes; |
| 3994 | u8 reserved[4]; |
| 3995 | }; |
| 3996 | |
| 3997 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 3998 | /* |
Eilon Greenstein | 3347162 | 2008-08-13 15:59:08 -0700 | [diff] [blame] | 3999 | * structure for easy accessibility to assembler |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4000 | */ |
| 4001 | struct eth_tx_bd_flags { |
| 4002 | u8 as_bitfield; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4003 | #define ETH_TX_BD_FLAGS_IP_CSUM (0x1<<0) |
| 4004 | #define ETH_TX_BD_FLAGS_IP_CSUM_SHIFT 0 |
| 4005 | #define ETH_TX_BD_FLAGS_L4_CSUM (0x1<<1) |
| 4006 | #define ETH_TX_BD_FLAGS_L4_CSUM_SHIFT 1 |
| 4007 | #define ETH_TX_BD_FLAGS_VLAN_MODE (0x3<<2) |
| 4008 | #define ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT 2 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4009 | #define ETH_TX_BD_FLAGS_START_BD (0x1<<4) |
| 4010 | #define ETH_TX_BD_FLAGS_START_BD_SHIFT 4 |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4011 | #define ETH_TX_BD_FLAGS_IS_UDP (0x1<<5) |
| 4012 | #define ETH_TX_BD_FLAGS_IS_UDP_SHIFT 5 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4013 | #define ETH_TX_BD_FLAGS_SW_LSO (0x1<<6) |
| 4014 | #define ETH_TX_BD_FLAGS_SW_LSO_SHIFT 6 |
| 4015 | #define ETH_TX_BD_FLAGS_IPV6 (0x1<<7) |
| 4016 | #define ETH_TX_BD_FLAGS_IPV6_SHIFT 7 |
| 4017 | }; |
| 4018 | |
| 4019 | /* |
| 4020 | * The eth Tx Buffer Descriptor |
| 4021 | */ |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4022 | struct eth_tx_start_bd { |
Eilon Greenstein | 4781bfa | 2009-02-12 08:38:17 +0000 | [diff] [blame] | 4023 | __le32 addr_lo; |
| 4024 | __le32 addr_hi; |
| 4025 | __le16 nbd; |
| 4026 | __le16 nbytes; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4027 | __le16 vlan_or_ethertype; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4028 | struct eth_tx_bd_flags bd_flags; |
| 4029 | u8 general_data; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4030 | #define ETH_TX_START_BD_HDR_NBDS (0xF<<0) |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4031 | #define ETH_TX_START_BD_HDR_NBDS_SHIFT 0 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4032 | #define ETH_TX_START_BD_FORCE_VLAN_MODE (0x1<<4) |
| 4033 | #define ETH_TX_START_BD_FORCE_VLAN_MODE_SHIFT 4 |
| 4034 | #define ETH_TX_START_BD_RESREVED (0x1<<5) |
| 4035 | #define ETH_TX_START_BD_RESREVED_SHIFT 5 |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4036 | #define ETH_TX_START_BD_ETH_ADDR_TYPE (0x3<<6) |
| 4037 | #define ETH_TX_START_BD_ETH_ADDR_TYPE_SHIFT 6 |
| 4038 | }; |
| 4039 | |
| 4040 | /* |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4041 | * Tx parsing BD structure for ETH E1/E1h |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4042 | */ |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4043 | struct eth_tx_parse_bd_e1x { |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4044 | u8 global_data; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4045 | #define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W (0xF<<0) |
| 4046 | #define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W_SHIFT 0 |
| 4047 | #define ETH_TX_PARSE_BD_E1X_RESERVED0 (0x1<<4) |
| 4048 | #define ETH_TX_PARSE_BD_E1X_RESERVED0_SHIFT 4 |
| 4049 | #define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN (0x1<<5) |
| 4050 | #define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN_SHIFT 5 |
| 4051 | #define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN (0x1<<6) |
| 4052 | #define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT 6 |
| 4053 | #define ETH_TX_PARSE_BD_E1X_NS_FLG (0x1<<7) |
| 4054 | #define ETH_TX_PARSE_BD_E1X_NS_FLG_SHIFT 7 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4055 | u8 tcp_flags; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4056 | #define ETH_TX_PARSE_BD_E1X_FIN_FLG (0x1<<0) |
| 4057 | #define ETH_TX_PARSE_BD_E1X_FIN_FLG_SHIFT 0 |
| 4058 | #define ETH_TX_PARSE_BD_E1X_SYN_FLG (0x1<<1) |
| 4059 | #define ETH_TX_PARSE_BD_E1X_SYN_FLG_SHIFT 1 |
| 4060 | #define ETH_TX_PARSE_BD_E1X_RST_FLG (0x1<<2) |
| 4061 | #define ETH_TX_PARSE_BD_E1X_RST_FLG_SHIFT 2 |
| 4062 | #define ETH_TX_PARSE_BD_E1X_PSH_FLG (0x1<<3) |
| 4063 | #define ETH_TX_PARSE_BD_E1X_PSH_FLG_SHIFT 3 |
| 4064 | #define ETH_TX_PARSE_BD_E1X_ACK_FLG (0x1<<4) |
| 4065 | #define ETH_TX_PARSE_BD_E1X_ACK_FLG_SHIFT 4 |
| 4066 | #define ETH_TX_PARSE_BD_E1X_URG_FLG (0x1<<5) |
| 4067 | #define ETH_TX_PARSE_BD_E1X_URG_FLG_SHIFT 5 |
| 4068 | #define ETH_TX_PARSE_BD_E1X_ECE_FLG (0x1<<6) |
| 4069 | #define ETH_TX_PARSE_BD_E1X_ECE_FLG_SHIFT 6 |
| 4070 | #define ETH_TX_PARSE_BD_E1X_CWR_FLG (0x1<<7) |
| 4071 | #define ETH_TX_PARSE_BD_E1X_CWR_FLG_SHIFT 7 |
| 4072 | u8 ip_hlen_w; |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4073 | s8 reserved; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4074 | __le16 total_hlen_w; |
Eilon Greenstein | 4781bfa | 2009-02-12 08:38:17 +0000 | [diff] [blame] | 4075 | __le16 tcp_pseudo_csum; |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4076 | __le16 lso_mss; |
Eilon Greenstein | 4781bfa | 2009-02-12 08:38:17 +0000 | [diff] [blame] | 4077 | __le16 ip_id; |
| 4078 | __le32 tcp_send_seq; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4079 | }; |
| 4080 | |
| 4081 | /* |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 4082 | * Tx parsing BD structure for ETH E2 |
| 4083 | */ |
| 4084 | struct eth_tx_parse_bd_e2 { |
| 4085 | __le16 dst_mac_addr_lo; |
| 4086 | __le16 dst_mac_addr_mid; |
| 4087 | __le16 dst_mac_addr_hi; |
| 4088 | __le16 src_mac_addr_lo; |
| 4089 | __le16 src_mac_addr_mid; |
| 4090 | __le16 src_mac_addr_hi; |
| 4091 | __le32 parsing_data; |
| 4092 | #define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W (0x1FFF<<0) |
| 4093 | #define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT 0 |
| 4094 | #define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW (0xF<<13) |
| 4095 | #define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT 13 |
| 4096 | #define ETH_TX_PARSE_BD_E2_LSO_MSS (0x3FFF<<17) |
| 4097 | #define ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT 17 |
| 4098 | #define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR (0x1<<31) |
| 4099 | #define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR_SHIFT 31 |
| 4100 | }; |
| 4101 | |
| 4102 | /* |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4103 | * The last BD in the BD memory will hold a pointer to the next BD memory |
| 4104 | */ |
| 4105 | struct eth_tx_next_bd { |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4106 | __le32 addr_lo; |
| 4107 | __le32 addr_hi; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4108 | u8 reserved[8]; |
| 4109 | }; |
| 4110 | |
| 4111 | /* |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4112 | * union for 4 Bd types |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4113 | */ |
| 4114 | union eth_tx_bd_types { |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4115 | struct eth_tx_start_bd start_bd; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4116 | struct eth_tx_bd reg_bd; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4117 | struct eth_tx_parse_bd_e1x parse_bd_e1x; |
Dmitry Kravkov | f2e0899 | 2010-10-06 03:28:26 +0000 | [diff] [blame] | 4118 | struct eth_tx_parse_bd_e2 parse_bd_e2; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4119 | struct eth_tx_next_bd next_bd; |
| 4120 | }; |
| 4121 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4122 | /* |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4123 | * array of 13 bds as appears in the eth xstorm context |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4124 | */ |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4125 | struct eth_tx_bds_array { |
| 4126 | union eth_tx_bd_types bds[13]; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4127 | }; |
| 4128 | |
| 4129 | |
| 4130 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4131 | * VLAN mode on TX BDs |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4132 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4133 | enum eth_tx_vlan_type { |
| 4134 | X_ETH_NO_VLAN, |
| 4135 | X_ETH_OUTBAND_VLAN, |
| 4136 | X_ETH_INBAND_VLAN, |
| 4137 | X_ETH_FW_ADDED_VLAN, |
| 4138 | MAX_ETH_TX_VLAN_TYPE |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4139 | }; |
| 4140 | |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4141 | |
| 4142 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4143 | * Ethernet VLAN filtering mode in E1x |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4144 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4145 | enum eth_vlan_filter_mode { |
| 4146 | ETH_VLAN_FILTER_ANY_VLAN, |
| 4147 | ETH_VLAN_FILTER_SPECIFIC_VLAN, |
| 4148 | ETH_VLAN_FILTER_CLASSIFY, |
| 4149 | MAX_ETH_VLAN_FILTER_MODE |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4150 | }; |
| 4151 | |
| 4152 | |
| 4153 | /* |
| 4154 | * MAC filtering configuration command header |
| 4155 | */ |
| 4156 | struct mac_configuration_hdr { |
Eilon Greenstein | 8d9c5f3 | 2009-02-15 23:24:08 -0800 | [diff] [blame] | 4157 | u8 length; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4158 | u8 offset; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4159 | __le16 client_id; |
| 4160 | __le32 echo; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4161 | }; |
| 4162 | |
| 4163 | /* |
| 4164 | * MAC address in list for ramrod |
| 4165 | */ |
| 4166 | struct mac_configuration_entry { |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4167 | __le16 lsb_mac_addr; |
| 4168 | __le16 middle_mac_addr; |
| 4169 | __le16 msb_mac_addr; |
| 4170 | __le16 vlan_id; |
| 4171 | u8 pf_id; |
| 4172 | u8 flags; |
| 4173 | #define MAC_CONFIGURATION_ENTRY_ACTION_TYPE (0x1<<0) |
| 4174 | #define MAC_CONFIGURATION_ENTRY_ACTION_TYPE_SHIFT 0 |
| 4175 | #define MAC_CONFIGURATION_ENTRY_RDMA_MAC (0x1<<1) |
| 4176 | #define MAC_CONFIGURATION_ENTRY_RDMA_MAC_SHIFT 1 |
| 4177 | #define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE (0x3<<2) |
| 4178 | #define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE_SHIFT 2 |
| 4179 | #define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL (0x1<<4) |
| 4180 | #define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL_SHIFT 4 |
| 4181 | #define MAC_CONFIGURATION_ENTRY_BROADCAST (0x1<<5) |
| 4182 | #define MAC_CONFIGURATION_ENTRY_BROADCAST_SHIFT 5 |
| 4183 | #define MAC_CONFIGURATION_ENTRY_RESERVED1 (0x3<<6) |
| 4184 | #define MAC_CONFIGURATION_ENTRY_RESERVED1_SHIFT 6 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4185 | __le16 reserved0; |
| 4186 | __le32 clients_bit_vector; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4187 | }; |
| 4188 | |
| 4189 | /* |
| 4190 | * MAC filtering configuration command |
| 4191 | */ |
| 4192 | struct mac_configuration_cmd { |
| 4193 | struct mac_configuration_hdr hdr; |
| 4194 | struct mac_configuration_entry config_table[64]; |
| 4195 | }; |
| 4196 | |
| 4197 | |
| 4198 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4199 | * Set-MAC command type (in E1x) |
| 4200 | */ |
| 4201 | enum set_mac_action_type { |
| 4202 | T_ETH_MAC_COMMAND_INVALIDATE, |
| 4203 | T_ETH_MAC_COMMAND_SET, |
| 4204 | MAX_SET_MAC_ACTION_TYPE |
| 4205 | }; |
| 4206 | |
| 4207 | |
| 4208 | /* |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 4209 | * Ethernet TPA Modes |
| 4210 | */ |
| 4211 | enum tpa_mode { |
| 4212 | TPA_LRO, |
| 4213 | TPA_GRO, |
| 4214 | MAX_TPA_MODE}; |
| 4215 | |
| 4216 | |
| 4217 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4218 | * tpa update ramrod data |
| 4219 | */ |
| 4220 | struct tpa_update_ramrod_data { |
| 4221 | u8 update_ipv4; |
| 4222 | u8 update_ipv6; |
| 4223 | u8 client_id; |
| 4224 | u8 max_tpa_queues; |
| 4225 | u8 max_sges_for_packet; |
| 4226 | u8 complete_on_both_clients; |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 4227 | u8 dont_verify_rings_pause_thr_flg; |
| 4228 | u8 tpa_mode; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4229 | __le16 sge_buff_size; |
| 4230 | __le16 max_agg_size; |
| 4231 | __le32 sge_page_base_lo; |
| 4232 | __le32 sge_page_base_hi; |
| 4233 | __le16 sge_pause_thr_low; |
| 4234 | __le16 sge_pause_thr_high; |
| 4235 | }; |
| 4236 | |
| 4237 | |
| 4238 | /* |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4239 | * approximate-match multicast filtering for E1H per function in Tstorm |
| 4240 | */ |
| 4241 | struct tstorm_eth_approximate_match_multicast_filtering { |
| 4242 | u32 mcast_add_hash_bit_array[8]; |
| 4243 | }; |
| 4244 | |
| 4245 | |
| 4246 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4247 | * Common configuration parameters per function in Tstorm |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4248 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4249 | struct tstorm_eth_function_common_config { |
| 4250 | __le16 config_flags; |
| 4251 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0) |
| 4252 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0 |
| 4253 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1) |
| 4254 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1 |
| 4255 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2) |
| 4256 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2 |
| 4257 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3) |
| 4258 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3 |
| 4259 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4) |
| 4260 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4 |
| 4261 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE (0x1<<7) |
| 4262 | #define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE_SHIFT 7 |
| 4263 | #define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0xFF<<8) |
| 4264 | #define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 8 |
| 4265 | u8 rss_result_mask; |
| 4266 | u8 reserved1; |
| 4267 | __le16 vlan_id[2]; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4268 | }; |
| 4269 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4270 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4271 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4272 | * MAC filtering configuration parameters per port in Tstorm |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4273 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4274 | struct tstorm_eth_mac_filter_config { |
| 4275 | __le32 ucast_drop_all; |
| 4276 | __le32 ucast_accept_all; |
| 4277 | __le32 mcast_drop_all; |
| 4278 | __le32 mcast_accept_all; |
| 4279 | __le32 bcast_accept_all; |
| 4280 | __le32 vlan_filter[2]; |
| 4281 | __le32 unmatched_unicast; |
| 4282 | }; |
| 4283 | |
| 4284 | |
| 4285 | /* |
| 4286 | * tx only queue init ramrod data |
| 4287 | */ |
| 4288 | struct tx_queue_init_ramrod_data { |
| 4289 | struct client_init_general_data general; |
| 4290 | struct client_init_tx_data tx; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4291 | }; |
| 4292 | |
| 4293 | |
| 4294 | /* |
Eilon Greenstein | 8d9c5f3 | 2009-02-15 23:24:08 -0800 | [diff] [blame] | 4295 | * Three RX producers for ETH |
| 4296 | */ |
| 4297 | struct ustorm_eth_rx_producers { |
| 4298 | #if defined(__BIG_ENDIAN) |
| 4299 | u16 bd_prod; |
| 4300 | u16 cqe_prod; |
| 4301 | #elif defined(__LITTLE_ENDIAN) |
| 4302 | u16 cqe_prod; |
| 4303 | u16 bd_prod; |
| 4304 | #endif |
| 4305 | #if defined(__BIG_ENDIAN) |
| 4306 | u16 reserved; |
| 4307 | u16 sge_prod; |
| 4308 | #elif defined(__LITTLE_ENDIAN) |
| 4309 | u16 sge_prod; |
| 4310 | u16 reserved; |
| 4311 | #endif |
| 4312 | }; |
| 4313 | |
| 4314 | |
| 4315 | /* |
Barak Witkowski | 50f0a56 | 2011-12-05 21:52:23 +0000 | [diff] [blame] | 4316 | * FCoE RX statistics parameters section#0 |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4317 | */ |
Barak Witkowski | 50f0a56 | 2011-12-05 21:52:23 +0000 | [diff] [blame] | 4318 | struct fcoe_rx_stat_params_section0 { |
| 4319 | __le32 fcoe_rx_pkt_cnt; |
| 4320 | __le32 fcoe_rx_byte_cnt; |
| 4321 | }; |
| 4322 | |
| 4323 | |
| 4324 | /* |
| 4325 | * FCoE RX statistics parameters section#1 |
| 4326 | */ |
| 4327 | struct fcoe_rx_stat_params_section1 { |
| 4328 | __le32 fcoe_ver_cnt; |
| 4329 | __le32 fcoe_rx_drop_pkt_cnt; |
| 4330 | }; |
| 4331 | |
| 4332 | |
| 4333 | /* |
| 4334 | * FCoE RX statistics parameters section#2 |
| 4335 | */ |
| 4336 | struct fcoe_rx_stat_params_section2 { |
| 4337 | __le32 fc_crc_cnt; |
| 4338 | __le32 eofa_del_cnt; |
| 4339 | __le32 miss_frame_cnt; |
| 4340 | __le32 seq_timeout_cnt; |
| 4341 | __le32 drop_seq_cnt; |
| 4342 | __le32 fcoe_rx_drop_pkt_cnt; |
| 4343 | __le32 fcp_rx_pkt_cnt; |
| 4344 | __le32 reserved0; |
| 4345 | }; |
| 4346 | |
| 4347 | |
| 4348 | /* |
| 4349 | * FCoE TX statistics parameters |
| 4350 | */ |
| 4351 | struct fcoe_tx_stat_params { |
| 4352 | __le32 fcoe_tx_pkt_cnt; |
| 4353 | __le32 fcoe_tx_byte_cnt; |
| 4354 | __le32 fcp_tx_pkt_cnt; |
| 4355 | __le32 reserved0; |
| 4356 | }; |
| 4357 | |
| 4358 | /* |
| 4359 | * FCoE statistics parameters |
| 4360 | */ |
| 4361 | struct fcoe_statistics_params { |
| 4362 | struct fcoe_tx_stat_params tx_stat; |
| 4363 | struct fcoe_rx_stat_params_section0 rx_stat0; |
| 4364 | struct fcoe_rx_stat_params_section1 rx_stat1; |
| 4365 | struct fcoe_rx_stat_params_section2 rx_stat2; |
| 4366 | }; |
| 4367 | |
| 4368 | |
| 4369 | /* |
| 4370 | * cfc delete event data |
| 4371 | */ |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4372 | struct cfc_del_event_data { |
| 4373 | u32 cid; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4374 | u32 reserved0; |
| 4375 | u32 reserved1; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4376 | }; |
| 4377 | |
| 4378 | |
| 4379 | /* |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4380 | * per-port SAFC demo variables |
| 4381 | */ |
| 4382 | struct cmng_flags_per_port { |
Eilon Greenstein | 8a1c38d | 2009-02-12 08:36:40 +0000 | [diff] [blame] | 4383 | u32 cmng_enables; |
| 4384 | #define CMNG_FLAGS_PER_PORT_FAIRNESS_VN (0x1<<0) |
| 4385 | #define CMNG_FLAGS_PER_PORT_FAIRNESS_VN_SHIFT 0 |
| 4386 | #define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN (0x1<<1) |
| 4387 | #define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN_SHIFT 1 |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4388 | #define CMNG_FLAGS_PER_PORT_FAIRNESS_COS (0x1<<2) |
| 4389 | #define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_SHIFT 2 |
| 4390 | #define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE (0x1<<3) |
| 4391 | #define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE_SHIFT 3 |
| 4392 | #define __CMNG_FLAGS_PER_PORT_RESERVED0 (0xFFFFFFF<<4) |
| 4393 | #define __CMNG_FLAGS_PER_PORT_RESERVED0_SHIFT 4 |
| 4394 | u32 __reserved1; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4395 | }; |
| 4396 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4397 | |
| 4398 | /* |
| 4399 | * per-port rate shaping variables |
| 4400 | */ |
| 4401 | struct rate_shaping_vars_per_port { |
| 4402 | u32 rs_periodic_timeout; |
| 4403 | u32 rs_threshold; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4404 | }; |
| 4405 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4406 | /* |
| 4407 | * per-port fairness variables |
| 4408 | */ |
| 4409 | struct fairness_vars_per_port { |
| 4410 | u32 upper_bound; |
| 4411 | u32 fair_threshold; |
| 4412 | u32 fairness_timeout; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4413 | u32 reserved0; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4414 | }; |
| 4415 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4416 | /* |
| 4417 | * per-port SAFC variables |
| 4418 | */ |
| 4419 | struct safc_struct_per_port { |
| 4420 | #if defined(__BIG_ENDIAN) |
Eilon Greenstein | 8d9c5f3 | 2009-02-15 23:24:08 -0800 | [diff] [blame] | 4421 | u16 __reserved1; |
| 4422 | u8 __reserved0; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4423 | u8 safc_timeout_usec; |
| 4424 | #elif defined(__LITTLE_ENDIAN) |
| 4425 | u8 safc_timeout_usec; |
Eilon Greenstein | 8d9c5f3 | 2009-02-15 23:24:08 -0800 | [diff] [blame] | 4426 | u8 __reserved0; |
| 4427 | u16 __reserved1; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4428 | #endif |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4429 | u8 cos_to_traffic_types[MAX_COS_NUMBER]; |
Eilon Greenstein | 8d9c5f3 | 2009-02-15 23:24:08 -0800 | [diff] [blame] | 4430 | u16 cos_to_pause_mask[NUM_OF_SAFC_BITS]; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4431 | }; |
| 4432 | |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4433 | /* |
| 4434 | * Per-port congestion management variables |
| 4435 | */ |
| 4436 | struct cmng_struct_per_port { |
| 4437 | struct rate_shaping_vars_per_port rs_vars; |
| 4438 | struct fairness_vars_per_port fair_vars; |
| 4439 | struct safc_struct_per_port safc_vars; |
| 4440 | struct cmng_flags_per_port flags; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4441 | }; |
| 4442 | |
| 4443 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4444 | /* |
| 4445 | * Protocol-common command ID for slow path elements |
| 4446 | */ |
| 4447 | enum common_spqe_cmd_id { |
| 4448 | RAMROD_CMD_ID_COMMON_UNUSED, |
| 4449 | RAMROD_CMD_ID_COMMON_FUNCTION_START, |
| 4450 | RAMROD_CMD_ID_COMMON_FUNCTION_STOP, |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 4451 | RAMROD_CMD_ID_COMMON_FUNCTION_UPDATE, |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4452 | RAMROD_CMD_ID_COMMON_CFC_DEL, |
| 4453 | RAMROD_CMD_ID_COMMON_CFC_DEL_WB, |
| 4454 | RAMROD_CMD_ID_COMMON_STAT_QUERY, |
| 4455 | RAMROD_CMD_ID_COMMON_STOP_TRAFFIC, |
| 4456 | RAMROD_CMD_ID_COMMON_START_TRAFFIC, |
| 4457 | RAMROD_CMD_ID_COMMON_RESERVED1, |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4458 | MAX_COMMON_SPQE_CMD_ID |
| 4459 | }; |
| 4460 | |
| 4461 | |
| 4462 | /* |
| 4463 | * Per-protocol connection types |
| 4464 | */ |
| 4465 | enum connection_type { |
| 4466 | ETH_CONNECTION_TYPE, |
| 4467 | TOE_CONNECTION_TYPE, |
| 4468 | RDMA_CONNECTION_TYPE, |
| 4469 | ISCSI_CONNECTION_TYPE, |
| 4470 | FCOE_CONNECTION_TYPE, |
| 4471 | RESERVED_CONNECTION_TYPE_0, |
| 4472 | RESERVED_CONNECTION_TYPE_1, |
| 4473 | RESERVED_CONNECTION_TYPE_2, |
| 4474 | NONE_CONNECTION_TYPE, |
| 4475 | MAX_CONNECTION_TYPE |
| 4476 | }; |
| 4477 | |
| 4478 | |
| 4479 | /* |
| 4480 | * Cos modes |
| 4481 | */ |
| 4482 | enum cos_mode { |
| 4483 | OVERRIDE_COS, |
| 4484 | STATIC_COS, |
| 4485 | FW_WRR, |
| 4486 | MAX_COS_MODE |
| 4487 | }; |
| 4488 | |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4489 | |
| 4490 | /* |
| 4491 | * Dynamic HC counters set by the driver |
| 4492 | */ |
| 4493 | struct hc_dynamic_drv_counter { |
| 4494 | u32 val[HC_SB_MAX_DYNAMIC_INDICES]; |
| 4495 | }; |
| 4496 | |
| 4497 | /* |
| 4498 | * zone A per-queue data |
| 4499 | */ |
| 4500 | struct cstorm_queue_zone_data { |
| 4501 | struct hc_dynamic_drv_counter hc_dyn_drv_cnt; |
| 4502 | struct regpair reserved[2]; |
| 4503 | }; |
| 4504 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4505 | |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4506 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4507 | * Vf-PF channel data in cstorm ram (non-triggered zone) |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4508 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4509 | struct vf_pf_channel_zone_data { |
| 4510 | u32 msg_addr_lo; |
| 4511 | u32 msg_addr_hi; |
| 4512 | }; |
| 4513 | |
| 4514 | /* |
| 4515 | * zone for VF non-triggered data |
| 4516 | */ |
| 4517 | struct non_trigger_vf_zone { |
| 4518 | struct vf_pf_channel_zone_data vf_pf_channel; |
| 4519 | }; |
| 4520 | |
| 4521 | /* |
| 4522 | * Vf-PF channel trigger zone in cstorm ram |
| 4523 | */ |
| 4524 | struct vf_pf_channel_zone_trigger { |
| 4525 | u8 addr_valid; |
| 4526 | }; |
| 4527 | |
| 4528 | /* |
| 4529 | * zone that triggers the in-bound interrupt |
| 4530 | */ |
| 4531 | struct trigger_vf_zone { |
| 4532 | #if defined(__BIG_ENDIAN) |
| 4533 | u16 reserved1; |
| 4534 | u8 reserved0; |
| 4535 | struct vf_pf_channel_zone_trigger vf_pf_channel; |
| 4536 | #elif defined(__LITTLE_ENDIAN) |
| 4537 | struct vf_pf_channel_zone_trigger vf_pf_channel; |
| 4538 | u8 reserved0; |
| 4539 | u16 reserved1; |
| 4540 | #endif |
| 4541 | u32 reserved2; |
| 4542 | }; |
| 4543 | |
| 4544 | /* |
| 4545 | * zone B per-VF data |
| 4546 | */ |
| 4547 | struct cstorm_vf_zone_data { |
| 4548 | struct non_trigger_vf_zone non_trigger; |
| 4549 | struct trigger_vf_zone trigger; |
| 4550 | }; |
| 4551 | |
| 4552 | |
| 4553 | /* |
| 4554 | * Dynamic host coalescing init parameters, per state machine |
| 4555 | */ |
| 4556 | struct dynamic_hc_sm_config { |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4557 | u32 threshold[3]; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4558 | u8 shift_per_protocol[HC_SB_MAX_DYNAMIC_INDICES]; |
| 4559 | u8 hc_timeout0[HC_SB_MAX_DYNAMIC_INDICES]; |
| 4560 | u8 hc_timeout1[HC_SB_MAX_DYNAMIC_INDICES]; |
| 4561 | u8 hc_timeout2[HC_SB_MAX_DYNAMIC_INDICES]; |
| 4562 | u8 hc_timeout3[HC_SB_MAX_DYNAMIC_INDICES]; |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4563 | }; |
| 4564 | |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 4565 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4566 | * Dynamic host coalescing init parameters |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4567 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4568 | struct dynamic_hc_config { |
| 4569 | struct dynamic_hc_sm_config sm_config[HC_SB_MAX_SM]; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4570 | }; |
| 4571 | |
Yitchak Gertner | bb2a0f7 | 2008-06-23 20:33:36 -0700 | [diff] [blame] | 4572 | |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4573 | struct e2_integ_data { |
| 4574 | #if defined(__BIG_ENDIAN) |
| 4575 | u8 flags; |
| 4576 | #define E2_INTEG_DATA_TESTING_EN (0x1<<0) |
| 4577 | #define E2_INTEG_DATA_TESTING_EN_SHIFT 0 |
| 4578 | #define E2_INTEG_DATA_LB_TX (0x1<<1) |
| 4579 | #define E2_INTEG_DATA_LB_TX_SHIFT 1 |
| 4580 | #define E2_INTEG_DATA_COS_TX (0x1<<2) |
| 4581 | #define E2_INTEG_DATA_COS_TX_SHIFT 2 |
| 4582 | #define E2_INTEG_DATA_OPPORTUNISTICQM (0x1<<3) |
| 4583 | #define E2_INTEG_DATA_OPPORTUNISTICQM_SHIFT 3 |
| 4584 | #define E2_INTEG_DATA_DPMTESTRELEASEDQ (0x1<<4) |
| 4585 | #define E2_INTEG_DATA_DPMTESTRELEASEDQ_SHIFT 4 |
| 4586 | #define E2_INTEG_DATA_RESERVED (0x7<<5) |
| 4587 | #define E2_INTEG_DATA_RESERVED_SHIFT 5 |
| 4588 | u8 cos; |
| 4589 | u8 voq; |
| 4590 | u8 pbf_queue; |
| 4591 | #elif defined(__LITTLE_ENDIAN) |
| 4592 | u8 pbf_queue; |
| 4593 | u8 voq; |
| 4594 | u8 cos; |
| 4595 | u8 flags; |
| 4596 | #define E2_INTEG_DATA_TESTING_EN (0x1<<0) |
| 4597 | #define E2_INTEG_DATA_TESTING_EN_SHIFT 0 |
| 4598 | #define E2_INTEG_DATA_LB_TX (0x1<<1) |
| 4599 | #define E2_INTEG_DATA_LB_TX_SHIFT 1 |
| 4600 | #define E2_INTEG_DATA_COS_TX (0x1<<2) |
| 4601 | #define E2_INTEG_DATA_COS_TX_SHIFT 2 |
| 4602 | #define E2_INTEG_DATA_OPPORTUNISTICQM (0x1<<3) |
| 4603 | #define E2_INTEG_DATA_OPPORTUNISTICQM_SHIFT 3 |
| 4604 | #define E2_INTEG_DATA_DPMTESTRELEASEDQ (0x1<<4) |
| 4605 | #define E2_INTEG_DATA_DPMTESTRELEASEDQ_SHIFT 4 |
| 4606 | #define E2_INTEG_DATA_RESERVED (0x7<<5) |
| 4607 | #define E2_INTEG_DATA_RESERVED_SHIFT 5 |
| 4608 | #endif |
| 4609 | #if defined(__BIG_ENDIAN) |
| 4610 | u16 reserved3; |
| 4611 | u8 reserved2; |
| 4612 | u8 ramEn; |
| 4613 | #elif defined(__LITTLE_ENDIAN) |
| 4614 | u8 ramEn; |
| 4615 | u8 reserved2; |
| 4616 | u16 reserved3; |
| 4617 | #endif |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4618 | }; |
| 4619 | |
| 4620 | |
| 4621 | /* |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4622 | * set mac event data |
| 4623 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4624 | struct eth_event_data { |
| 4625 | u32 echo; |
| 4626 | u32 reserved0; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4627 | u32 reserved1; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4628 | }; |
| 4629 | |
| 4630 | |
| 4631 | /* |
| 4632 | * pf-vf event data |
| 4633 | */ |
| 4634 | struct vf_pf_event_data { |
| 4635 | u8 vf_id; |
| 4636 | u8 reserved0; |
| 4637 | u16 reserved1; |
| 4638 | u32 msg_addr_lo; |
| 4639 | u32 msg_addr_hi; |
| 4640 | }; |
| 4641 | |
| 4642 | /* |
| 4643 | * VF FLR event data |
| 4644 | */ |
| 4645 | struct vf_flr_event_data { |
| 4646 | u8 vf_id; |
| 4647 | u8 reserved0; |
| 4648 | u16 reserved1; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4649 | u32 reserved2; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4650 | u32 reserved3; |
| 4651 | }; |
| 4652 | |
| 4653 | /* |
| 4654 | * malicious VF event data |
| 4655 | */ |
| 4656 | struct malicious_vf_event_data { |
| 4657 | u8 vf_id; |
| 4658 | u8 reserved0; |
| 4659 | u16 reserved1; |
| 4660 | u32 reserved2; |
| 4661 | u32 reserved3; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4662 | }; |
| 4663 | |
| 4664 | /* |
| 4665 | * union for all event ring message types |
| 4666 | */ |
| 4667 | union event_data { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4668 | struct vf_pf_event_data vf_pf_event; |
| 4669 | struct eth_event_data eth_event; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4670 | struct cfc_del_event_data cfc_del_event; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4671 | struct vf_flr_event_data vf_flr_event; |
| 4672 | struct malicious_vf_event_data malicious_vf_event; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4673 | }; |
| 4674 | |
| 4675 | |
| 4676 | /* |
| 4677 | * per PF event ring data |
| 4678 | */ |
| 4679 | struct event_ring_data { |
| 4680 | struct regpair base_addr; |
| 4681 | #if defined(__BIG_ENDIAN) |
| 4682 | u8 index_id; |
| 4683 | u8 sb_id; |
| 4684 | u16 producer; |
| 4685 | #elif defined(__LITTLE_ENDIAN) |
| 4686 | u16 producer; |
| 4687 | u8 sb_id; |
| 4688 | u8 index_id; |
| 4689 | #endif |
| 4690 | u32 reserved0; |
| 4691 | }; |
| 4692 | |
| 4693 | |
| 4694 | /* |
| 4695 | * event ring message element (each element is 128 bits) |
| 4696 | */ |
| 4697 | struct event_ring_msg { |
| 4698 | u8 opcode; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4699 | u8 error; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4700 | u16 reserved1; |
| 4701 | union event_data data; |
| 4702 | }; |
| 4703 | |
| 4704 | /* |
| 4705 | * event ring next page element (128 bits) |
| 4706 | */ |
| 4707 | struct event_ring_next { |
| 4708 | struct regpair addr; |
| 4709 | u32 reserved[2]; |
| 4710 | }; |
| 4711 | |
| 4712 | /* |
| 4713 | * union for event ring element types (each element is 128 bits) |
| 4714 | */ |
| 4715 | union event_ring_elem { |
| 4716 | struct event_ring_msg message; |
| 4717 | struct event_ring_next next_page; |
| 4718 | }; |
| 4719 | |
| 4720 | |
| 4721 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4722 | * Common event ring opcodes |
| 4723 | */ |
| 4724 | enum event_ring_opcode { |
| 4725 | EVENT_RING_OPCODE_VF_PF_CHANNEL, |
| 4726 | EVENT_RING_OPCODE_FUNCTION_START, |
| 4727 | EVENT_RING_OPCODE_FUNCTION_STOP, |
| 4728 | EVENT_RING_OPCODE_CFC_DEL, |
| 4729 | EVENT_RING_OPCODE_CFC_DEL_WB, |
| 4730 | EVENT_RING_OPCODE_STAT_QUERY, |
| 4731 | EVENT_RING_OPCODE_STOP_TRAFFIC, |
| 4732 | EVENT_RING_OPCODE_START_TRAFFIC, |
| 4733 | EVENT_RING_OPCODE_VF_FLR, |
| 4734 | EVENT_RING_OPCODE_MALICIOUS_VF, |
| 4735 | EVENT_RING_OPCODE_FORWARD_SETUP, |
| 4736 | EVENT_RING_OPCODE_RSS_UPDATE_RULES, |
Dmitry Kravkov | 621b4d6 | 2012-02-20 09:59:08 +0000 | [diff] [blame^] | 4737 | EVENT_RING_OPCODE_FUNCTION_UPDATE, |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4738 | EVENT_RING_OPCODE_RESERVED1, |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4739 | EVENT_RING_OPCODE_SET_MAC, |
| 4740 | EVENT_RING_OPCODE_CLASSIFICATION_RULES, |
| 4741 | EVENT_RING_OPCODE_FILTERS_RULES, |
| 4742 | EVENT_RING_OPCODE_MULTICAST_RULES, |
| 4743 | MAX_EVENT_RING_OPCODE |
| 4744 | }; |
| 4745 | |
| 4746 | |
| 4747 | /* |
| 4748 | * Modes for fairness algorithm |
| 4749 | */ |
| 4750 | enum fairness_mode { |
| 4751 | FAIRNESS_COS_WRR_MODE, |
| 4752 | FAIRNESS_COS_ETS_MODE, |
| 4753 | MAX_FAIRNESS_MODE |
| 4754 | }; |
| 4755 | |
| 4756 | |
| 4757 | /* |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4758 | * per-vnic fairness variables |
| 4759 | */ |
| 4760 | struct fairness_vars_per_vn { |
Eilon Greenstein | 8a1c38d | 2009-02-12 08:36:40 +0000 | [diff] [blame] | 4761 | u32 cos_credit_delta[MAX_COS_NUMBER]; |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4762 | u32 vn_credit_delta; |
| 4763 | u32 __reserved0; |
| 4764 | }; |
| 4765 | |
| 4766 | |
| 4767 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4768 | * Priority and cos |
| 4769 | */ |
| 4770 | struct priority_cos { |
| 4771 | u8 priority; |
| 4772 | u8 cos; |
| 4773 | __le16 reserved1; |
| 4774 | }; |
| 4775 | |
| 4776 | /* |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 4777 | * The data for flow control configuration |
| 4778 | */ |
| 4779 | struct flow_control_configuration { |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4780 | struct priority_cos traffic_type_to_priority_cos[MAX_TRAFFIC_TYPES]; |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 4781 | u8 dcb_enabled; |
| 4782 | u8 dcb_version; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4783 | u8 dont_add_pri_0_en; |
| 4784 | u8 reserved1; |
| 4785 | __le32 reserved2; |
| 4786 | }; |
| 4787 | |
| 4788 | |
| 4789 | /* |
| 4790 | * |
| 4791 | */ |
| 4792 | struct function_start_data { |
| 4793 | __le16 function_mode; |
| 4794 | __le16 sd_vlan_tag; |
| 4795 | u16 reserved; |
| 4796 | u8 path_id; |
| 4797 | u8 network_cos_mode; |
Vladislav Zolotarov | e4901dd | 2010-12-13 05:44:18 +0000 | [diff] [blame] | 4798 | }; |
| 4799 | |
| 4800 | |
| 4801 | /* |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4802 | * FW version stored in the Xstorm RAM |
| 4803 | */ |
| 4804 | struct fw_version { |
| 4805 | #if defined(__BIG_ENDIAN) |
Eilon Greenstein | 8d9c5f3 | 2009-02-15 23:24:08 -0800 | [diff] [blame] | 4806 | u8 engineering; |
| 4807 | u8 revision; |
| 4808 | u8 minor; |
| 4809 | u8 major; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4810 | #elif defined(__LITTLE_ENDIAN) |
Eilon Greenstein | 8d9c5f3 | 2009-02-15 23:24:08 -0800 | [diff] [blame] | 4811 | u8 major; |
| 4812 | u8 minor; |
| 4813 | u8 revision; |
| 4814 | u8 engineering; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4815 | #endif |
| 4816 | u32 flags; |
| 4817 | #define FW_VERSION_OPTIMIZED (0x1<<0) |
| 4818 | #define FW_VERSION_OPTIMIZED_SHIFT 0 |
| 4819 | #define FW_VERSION_BIG_ENDIEN (0x1<<1) |
| 4820 | #define FW_VERSION_BIG_ENDIEN_SHIFT 1 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 4821 | #define FW_VERSION_CHIP_VERSION (0x3<<2) |
| 4822 | #define FW_VERSION_CHIP_VERSION_SHIFT 2 |
| 4823 | #define __FW_VERSION_RESERVED (0xFFFFFFF<<4) |
| 4824 | #define __FW_VERSION_RESERVED_SHIFT 4 |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 4825 | }; |
| 4826 | |
| 4827 | |
| 4828 | /* |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4829 | * Dynamic Host-Coalescing - Driver(host) counters |
| 4830 | */ |
| 4831 | struct hc_dynamic_sb_drv_counters { |
| 4832 | u32 dynamic_hc_drv_counter[HC_SB_MAX_DYNAMIC_INDICES]; |
| 4833 | }; |
| 4834 | |
| 4835 | |
| 4836 | /* |
| 4837 | * 2 bytes. configuration/state parameters for a single protocol index |
| 4838 | */ |
| 4839 | struct hc_index_data { |
| 4840 | #if defined(__BIG_ENDIAN) |
| 4841 | u8 flags; |
| 4842 | #define HC_INDEX_DATA_SM_ID (0x1<<0) |
| 4843 | #define HC_INDEX_DATA_SM_ID_SHIFT 0 |
| 4844 | #define HC_INDEX_DATA_HC_ENABLED (0x1<<1) |
| 4845 | #define HC_INDEX_DATA_HC_ENABLED_SHIFT 1 |
| 4846 | #define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2) |
| 4847 | #define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2 |
| 4848 | #define HC_INDEX_DATA_RESERVE (0x1F<<3) |
| 4849 | #define HC_INDEX_DATA_RESERVE_SHIFT 3 |
| 4850 | u8 timeout; |
| 4851 | #elif defined(__LITTLE_ENDIAN) |
| 4852 | u8 timeout; |
| 4853 | u8 flags; |
| 4854 | #define HC_INDEX_DATA_SM_ID (0x1<<0) |
| 4855 | #define HC_INDEX_DATA_SM_ID_SHIFT 0 |
| 4856 | #define HC_INDEX_DATA_HC_ENABLED (0x1<<1) |
| 4857 | #define HC_INDEX_DATA_HC_ENABLED_SHIFT 1 |
| 4858 | #define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2) |
| 4859 | #define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2 |
| 4860 | #define HC_INDEX_DATA_RESERVE (0x1F<<3) |
| 4861 | #define HC_INDEX_DATA_RESERVE_SHIFT 3 |
| 4862 | #endif |
| 4863 | }; |
| 4864 | |
| 4865 | |
| 4866 | /* |
| 4867 | * HC state-machine |
| 4868 | */ |
| 4869 | struct hc_status_block_sm { |
| 4870 | #if defined(__BIG_ENDIAN) |
| 4871 | u8 igu_seg_id; |
| 4872 | u8 igu_sb_id; |
| 4873 | u8 timer_value; |
| 4874 | u8 __flags; |
| 4875 | #elif defined(__LITTLE_ENDIAN) |
| 4876 | u8 __flags; |
| 4877 | u8 timer_value; |
| 4878 | u8 igu_sb_id; |
| 4879 | u8 igu_seg_id; |
| 4880 | #endif |
| 4881 | u32 time_to_expire; |
| 4882 | }; |
| 4883 | |
| 4884 | /* |
| 4885 | * hold PCI identification variables- used in various places in firmware |
| 4886 | */ |
| 4887 | struct pci_entity { |
| 4888 | #if defined(__BIG_ENDIAN) |
| 4889 | u8 vf_valid; |
| 4890 | u8 vf_id; |
| 4891 | u8 vnic_id; |
| 4892 | u8 pf_id; |
| 4893 | #elif defined(__LITTLE_ENDIAN) |
| 4894 | u8 pf_id; |
| 4895 | u8 vnic_id; |
| 4896 | u8 vf_id; |
| 4897 | u8 vf_valid; |
| 4898 | #endif |
| 4899 | }; |
| 4900 | |
| 4901 | /* |
| 4902 | * The fast-path status block meta-data, common to all chips |
| 4903 | */ |
| 4904 | struct hc_sb_data { |
| 4905 | struct regpair host_sb_addr; |
| 4906 | struct hc_status_block_sm state_machine[HC_SB_MAX_SM]; |
| 4907 | struct pci_entity p_func; |
| 4908 | #if defined(__BIG_ENDIAN) |
| 4909 | u8 rsrv0; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4910 | u8 state; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4911 | u8 dhc_qzone_id; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4912 | u8 same_igu_sb_1b; |
| 4913 | #elif defined(__LITTLE_ENDIAN) |
| 4914 | u8 same_igu_sb_1b; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4915 | u8 dhc_qzone_id; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4916 | u8 state; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4917 | u8 rsrv0; |
| 4918 | #endif |
| 4919 | struct regpair rsrv1[2]; |
| 4920 | }; |
| 4921 | |
| 4922 | |
| 4923 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4924 | * Segment types for host coaslescing |
| 4925 | */ |
| 4926 | enum hc_segment { |
| 4927 | HC_REGULAR_SEGMENT, |
| 4928 | HC_DEFAULT_SEGMENT, |
| 4929 | MAX_HC_SEGMENT |
| 4930 | }; |
| 4931 | |
| 4932 | |
| 4933 | /* |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4934 | * The fast-path status block meta-data |
| 4935 | */ |
| 4936 | struct hc_sp_status_block_data { |
| 4937 | struct regpair host_sb_addr; |
| 4938 | #if defined(__BIG_ENDIAN) |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4939 | u8 rsrv1; |
| 4940 | u8 state; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4941 | u8 igu_seg_id; |
| 4942 | u8 igu_sb_id; |
| 4943 | #elif defined(__LITTLE_ENDIAN) |
| 4944 | u8 igu_sb_id; |
| 4945 | u8 igu_seg_id; |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4946 | u8 state; |
| 4947 | u8 rsrv1; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 4948 | #endif |
| 4949 | struct pci_entity p_func; |
| 4950 | }; |
| 4951 | |
| 4952 | |
| 4953 | /* |
| 4954 | * The fast-path status block meta-data |
| 4955 | */ |
| 4956 | struct hc_status_block_data_e1x { |
| 4957 | struct hc_index_data index_data[HC_SB_MAX_INDICES_E1X]; |
| 4958 | struct hc_sb_data common; |
| 4959 | }; |
| 4960 | |
| 4961 | |
| 4962 | /* |
| 4963 | * The fast-path status block meta-data |
| 4964 | */ |
| 4965 | struct hc_status_block_data_e2 { |
| 4966 | struct hc_index_data index_data[HC_SB_MAX_INDICES_E2]; |
| 4967 | struct hc_sb_data common; |
| 4968 | }; |
| 4969 | |
| 4970 | |
| 4971 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 4972 | * IGU block operartion modes (in Everest2) |
| 4973 | */ |
| 4974 | enum igu_mode { |
| 4975 | HC_IGU_BC_MODE, |
| 4976 | HC_IGU_NBC_MODE, |
| 4977 | MAX_IGU_MODE |
| 4978 | }; |
| 4979 | |
| 4980 | |
| 4981 | /* |
| 4982 | * IP versions |
| 4983 | */ |
| 4984 | enum ip_ver { |
| 4985 | IP_V4, |
| 4986 | IP_V6, |
| 4987 | MAX_IP_VER |
| 4988 | }; |
| 4989 | |
| 4990 | |
| 4991 | /* |
| 4992 | * Multi-function modes |
| 4993 | */ |
| 4994 | enum mf_mode { |
| 4995 | SINGLE_FUNCTION, |
| 4996 | MULTI_FUNCTION_SD, |
| 4997 | MULTI_FUNCTION_SI, |
| 4998 | MULTI_FUNCTION_RESERVED, |
| 4999 | MAX_MF_MODE |
| 5000 | }; |
| 5001 | |
| 5002 | /* |
| 5003 | * Protocol-common statistics collected by the Tstorm (per pf) |
| 5004 | */ |
| 5005 | struct tstorm_per_pf_stats { |
| 5006 | struct regpair rcv_error_bytes; |
| 5007 | }; |
| 5008 | |
| 5009 | /* |
| 5010 | * |
| 5011 | */ |
| 5012 | struct per_pf_stats { |
| 5013 | struct tstorm_per_pf_stats tstorm_pf_statistics; |
| 5014 | }; |
| 5015 | |
| 5016 | |
| 5017 | /* |
| 5018 | * Protocol-common statistics collected by the Tstorm (per port) |
| 5019 | */ |
| 5020 | struct tstorm_per_port_stats { |
| 5021 | __le32 mac_discard; |
| 5022 | __le32 mac_filter_discard; |
| 5023 | __le32 brb_truncate_discard; |
| 5024 | __le32 mf_tag_discard; |
| 5025 | __le32 packet_drop; |
| 5026 | __le32 reserved; |
| 5027 | }; |
| 5028 | |
| 5029 | /* |
| 5030 | * |
| 5031 | */ |
| 5032 | struct per_port_stats { |
| 5033 | struct tstorm_per_port_stats tstorm_port_statistics; |
| 5034 | }; |
| 5035 | |
| 5036 | |
| 5037 | /* |
| 5038 | * Protocol-common statistics collected by the Tstorm (per client) |
| 5039 | */ |
| 5040 | struct tstorm_per_queue_stats { |
| 5041 | struct regpair rcv_ucast_bytes; |
| 5042 | __le32 rcv_ucast_pkts; |
| 5043 | __le32 checksum_discard; |
| 5044 | struct regpair rcv_bcast_bytes; |
| 5045 | __le32 rcv_bcast_pkts; |
| 5046 | __le32 pkts_too_big_discard; |
| 5047 | struct regpair rcv_mcast_bytes; |
| 5048 | __le32 rcv_mcast_pkts; |
| 5049 | __le32 ttl0_discard; |
| 5050 | __le16 no_buff_discard; |
| 5051 | __le16 reserved0; |
| 5052 | __le32 reserved1; |
| 5053 | }; |
| 5054 | |
| 5055 | /* |
| 5056 | * Protocol-common statistics collected by the Ustorm (per client) |
| 5057 | */ |
| 5058 | struct ustorm_per_queue_stats { |
| 5059 | struct regpair ucast_no_buff_bytes; |
| 5060 | struct regpair mcast_no_buff_bytes; |
| 5061 | struct regpair bcast_no_buff_bytes; |
| 5062 | __le32 ucast_no_buff_pkts; |
| 5063 | __le32 mcast_no_buff_pkts; |
| 5064 | __le32 bcast_no_buff_pkts; |
| 5065 | __le32 coalesced_pkts; |
| 5066 | struct regpair coalesced_bytes; |
| 5067 | __le32 coalesced_events; |
| 5068 | __le32 coalesced_aborts; |
| 5069 | }; |
| 5070 | |
| 5071 | /* |
| 5072 | * Protocol-common statistics collected by the Xstorm (per client) |
| 5073 | */ |
| 5074 | struct xstorm_per_queue_stats { |
| 5075 | struct regpair ucast_bytes_sent; |
| 5076 | struct regpair mcast_bytes_sent; |
| 5077 | struct regpair bcast_bytes_sent; |
| 5078 | __le32 ucast_pkts_sent; |
| 5079 | __le32 mcast_pkts_sent; |
| 5080 | __le32 bcast_pkts_sent; |
| 5081 | __le32 error_drop_pkts; |
| 5082 | }; |
| 5083 | |
| 5084 | /* |
| 5085 | * |
| 5086 | */ |
| 5087 | struct per_queue_stats { |
| 5088 | struct tstorm_per_queue_stats tstorm_queue_statistics; |
| 5089 | struct ustorm_per_queue_stats ustorm_queue_statistics; |
| 5090 | struct xstorm_per_queue_stats xstorm_queue_statistics; |
| 5091 | }; |
| 5092 | |
| 5093 | |
| 5094 | /* |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 5095 | * FW version stored in first line of pram |
| 5096 | */ |
| 5097 | struct pram_fw_version { |
Eilon Greenstein | 8d9c5f3 | 2009-02-15 23:24:08 -0800 | [diff] [blame] | 5098 | u8 major; |
| 5099 | u8 minor; |
| 5100 | u8 revision; |
| 5101 | u8 engineering; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 5102 | u8 flags; |
| 5103 | #define PRAM_FW_VERSION_OPTIMIZED (0x1<<0) |
| 5104 | #define PRAM_FW_VERSION_OPTIMIZED_SHIFT 0 |
| 5105 | #define PRAM_FW_VERSION_STORM_ID (0x3<<1) |
| 5106 | #define PRAM_FW_VERSION_STORM_ID_SHIFT 1 |
| 5107 | #define PRAM_FW_VERSION_BIG_ENDIEN (0x1<<3) |
| 5108 | #define PRAM_FW_VERSION_BIG_ENDIEN_SHIFT 3 |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 5109 | #define PRAM_FW_VERSION_CHIP_VERSION (0x3<<4) |
| 5110 | #define PRAM_FW_VERSION_CHIP_VERSION_SHIFT 4 |
| 5111 | #define __PRAM_FW_VERSION_RESERVED0 (0x3<<6) |
| 5112 | #define __PRAM_FW_VERSION_RESERVED0_SHIFT 6 |
| 5113 | }; |
| 5114 | |
| 5115 | |
| 5116 | /* |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5117 | * Ethernet slow path element |
| 5118 | */ |
| 5119 | union protocol_common_specific_data { |
| 5120 | u8 protocol_data[8]; |
| 5121 | struct regpair phy_address; |
| 5122 | struct regpair mac_config_addr; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5123 | }; |
| 5124 | |
| 5125 | /* |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 5126 | * The send queue element |
| 5127 | */ |
| 5128 | struct protocol_common_spe { |
| 5129 | struct spe_hdr hdr; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5130 | union protocol_common_specific_data data; |
Eilon Greenstein | ca00392 | 2009-08-12 22:53:28 -0700 | [diff] [blame] | 5131 | }; |
| 5132 | |
| 5133 | |
| 5134 | /* |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 5135 | * a single rate shaping counter. can be used as protocol or vnic counter |
| 5136 | */ |
| 5137 | struct rate_shaping_counter { |
| 5138 | u32 quota; |
| 5139 | #if defined(__BIG_ENDIAN) |
| 5140 | u16 __reserved0; |
| 5141 | u16 rate; |
| 5142 | #elif defined(__LITTLE_ENDIAN) |
| 5143 | u16 rate; |
| 5144 | u16 __reserved0; |
| 5145 | #endif |
| 5146 | }; |
| 5147 | |
| 5148 | |
| 5149 | /* |
| 5150 | * per-vnic rate shaping variables |
| 5151 | */ |
| 5152 | struct rate_shaping_vars_per_vn { |
Eilon Greenstein | 34f80b0 | 2008-06-23 20:33:01 -0700 | [diff] [blame] | 5153 | struct rate_shaping_counter vn_counter; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 5154 | }; |
| 5155 | |
| 5156 | |
| 5157 | /* |
| 5158 | * The send queue element |
| 5159 | */ |
| 5160 | struct slow_path_element { |
| 5161 | struct spe_hdr hdr; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5162 | struct regpair protocol_data; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 5163 | }; |
| 5164 | |
| 5165 | |
| 5166 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 5167 | * Protocol-common statistics counter |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 5168 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 5169 | struct stats_counter { |
| 5170 | __le16 xstats_counter; |
| 5171 | __le16 reserved0; |
| 5172 | __le32 reserved1; |
| 5173 | __le16 tstats_counter; |
| 5174 | __le16 reserved2; |
| 5175 | __le32 reserved3; |
| 5176 | __le16 ustats_counter; |
| 5177 | __le16 reserved4; |
| 5178 | __le32 reserved5; |
| 5179 | __le16 cstats_counter; |
| 5180 | __le16 reserved6; |
| 5181 | __le32 reserved7; |
Eliezer Tamir | a2fbb9e | 2007-11-15 20:09:02 +0200 | [diff] [blame] | 5182 | }; |
| 5183 | |
| 5184 | |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5185 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 5186 | * |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5187 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 5188 | struct stats_query_entry { |
| 5189 | u8 kind; |
| 5190 | u8 index; |
| 5191 | __le16 funcID; |
| 5192 | __le32 reserved; |
| 5193 | struct regpair address; |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5194 | }; |
| 5195 | |
| 5196 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 5197 | * statistic command |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5198 | */ |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 5199 | struct stats_query_cmd_group { |
| 5200 | struct stats_query_entry query[STATS_QUERY_CMD_COUNT]; |
| 5201 | }; |
| 5202 | |
| 5203 | |
| 5204 | /* |
| 5205 | * statistic command header |
| 5206 | */ |
| 5207 | struct stats_query_header { |
| 5208 | u8 cmd_num; |
| 5209 | u8 reserved0; |
| 5210 | __le16 drv_stats_counter; |
| 5211 | __le32 reserved1; |
| 5212 | struct regpair stats_counters_addrs; |
| 5213 | }; |
| 5214 | |
| 5215 | |
| 5216 | /* |
| 5217 | * Types of statistcis query entry |
| 5218 | */ |
| 5219 | enum stats_query_type { |
| 5220 | STATS_TYPE_QUEUE, |
| 5221 | STATS_TYPE_PORT, |
| 5222 | STATS_TYPE_PF, |
| 5223 | STATS_TYPE_TOE, |
| 5224 | STATS_TYPE_FCOE, |
| 5225 | MAX_STATS_QUERY_TYPE |
| 5226 | }; |
| 5227 | |
| 5228 | |
| 5229 | /* |
| 5230 | * Indicate of the function status block state |
| 5231 | */ |
| 5232 | enum status_block_state { |
| 5233 | SB_DISABLED, |
| 5234 | SB_ENABLED, |
| 5235 | SB_CLEANED, |
| 5236 | MAX_STATUS_BLOCK_STATE |
| 5237 | }; |
| 5238 | |
| 5239 | |
| 5240 | /* |
| 5241 | * Storm IDs (including attentions for IGU related enums) |
| 5242 | */ |
| 5243 | enum storm_id { |
| 5244 | USTORM_ID, |
| 5245 | CSTORM_ID, |
| 5246 | XSTORM_ID, |
| 5247 | TSTORM_ID, |
| 5248 | ATTENTION_ID, |
| 5249 | MAX_STORM_ID |
| 5250 | }; |
| 5251 | |
| 5252 | |
| 5253 | /* |
| 5254 | * Taffic types used in ETS and flow control algorithms |
| 5255 | */ |
| 5256 | enum traffic_type { |
| 5257 | LLFC_TRAFFIC_TYPE_NW, |
| 5258 | LLFC_TRAFFIC_TYPE_FCOE, |
| 5259 | LLFC_TRAFFIC_TYPE_ISCSI, |
| 5260 | MAX_TRAFFIC_TYPE |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5261 | }; |
| 5262 | |
| 5263 | |
| 5264 | /* |
| 5265 | * zone A per-queue data |
| 5266 | */ |
| 5267 | struct tstorm_queue_zone_data { |
| 5268 | struct regpair reserved[4]; |
| 5269 | }; |
| 5270 | |
| 5271 | |
| 5272 | /* |
| 5273 | * zone B per-VF data |
| 5274 | */ |
| 5275 | struct tstorm_vf_zone_data { |
| 5276 | struct regpair reserved; |
| 5277 | }; |
| 5278 | |
| 5279 | |
| 5280 | /* |
| 5281 | * zone A per-queue data |
| 5282 | */ |
| 5283 | struct ustorm_queue_zone_data { |
| 5284 | struct ustorm_eth_rx_producers eth_rx_producers; |
| 5285 | struct regpair reserved[3]; |
| 5286 | }; |
| 5287 | |
| 5288 | |
| 5289 | /* |
| 5290 | * zone B per-VF data |
| 5291 | */ |
| 5292 | struct ustorm_vf_zone_data { |
| 5293 | struct regpair reserved; |
| 5294 | }; |
| 5295 | |
| 5296 | |
| 5297 | /* |
| 5298 | * data per VF-PF channel |
| 5299 | */ |
| 5300 | struct vf_pf_channel_data { |
| 5301 | #if defined(__BIG_ENDIAN) |
| 5302 | u16 reserved0; |
| 5303 | u8 valid; |
| 5304 | u8 state; |
| 5305 | #elif defined(__LITTLE_ENDIAN) |
| 5306 | u8 state; |
| 5307 | u8 valid; |
| 5308 | u16 reserved0; |
| 5309 | #endif |
| 5310 | u32 reserved1; |
| 5311 | }; |
| 5312 | |
| 5313 | |
| 5314 | /* |
Vlad Zolotarov | 619c5cb | 2011-06-14 14:33:44 +0300 | [diff] [blame] | 5315 | * State of VF-PF channel |
| 5316 | */ |
| 5317 | enum vf_pf_channel_state { |
| 5318 | VF_PF_CHANNEL_STATE_READY, |
| 5319 | VF_PF_CHANNEL_STATE_WAITING_FOR_ACK, |
| 5320 | MAX_VF_PF_CHANNEL_STATE |
| 5321 | }; |
| 5322 | |
| 5323 | |
| 5324 | /* |
Dmitry Kravkov | 523224a | 2010-10-06 03:23:26 +0000 | [diff] [blame] | 5325 | * zone A per-queue data |
| 5326 | */ |
| 5327 | struct xstorm_queue_zone_data { |
| 5328 | struct regpair reserved[4]; |
| 5329 | }; |
| 5330 | |
| 5331 | |
| 5332 | /* |
| 5333 | * zone B per-VF data |
| 5334 | */ |
| 5335 | struct xstorm_vf_zone_data { |
| 5336 | struct regpair reserved; |
| 5337 | }; |
| 5338 | |
| 5339 | #endif /* BNX2X_HSI_H */ |