Go to the documentation of this file.
25 #define DEFAULT_PHY_DEV_ADDR 3
26 #define E2_DEFAULT_PHY_DEV_ADDR 5
30 #define BNX2X_FLOW_CTRL_AUTO PORT_FEATURE_FLOW_CONTROL_AUTO
31 #define BNX2X_FLOW_CTRL_TX PORT_FEATURE_FLOW_CONTROL_TX
32 #define BNX2X_FLOW_CTRL_RX PORT_FEATURE_FLOW_CONTROL_RX
33 #define BNX2X_FLOW_CTRL_BOTH PORT_FEATURE_FLOW_CONTROL_BOTH
34 #define BNX2X_FLOW_CTRL_NONE PORT_FEATURE_FLOW_CONTROL_NONE
36 #define NET_SERDES_IF_XFI 1
37 #define NET_SERDES_IF_SFI 2
38 #define NET_SERDES_IF_KR 3
39 #define NET_SERDES_IF_DXGXS 4
41 #define SPEED_AUTO_NEG 0
42 #define SPEED_20000 20000
44 #define SFP_EEPROM_PAGE_SIZE 16
45 #define SFP_EEPROM_VENDOR_NAME_ADDR 0x14
46 #define SFP_EEPROM_VENDOR_NAME_SIZE 16
47 #define SFP_EEPROM_VENDOR_OUI_ADDR 0x25
48 #define SFP_EEPROM_VENDOR_OUI_SIZE 3
49 #define SFP_EEPROM_PART_NO_ADDR 0x28
50 #define SFP_EEPROM_PART_NO_SIZE 16
51 #define SFP_EEPROM_REVISION_ADDR 0x38
52 #define SFP_EEPROM_REVISION_SIZE 4
53 #define SFP_EEPROM_SERIAL_ADDR 0x44
54 #define SFP_EEPROM_SERIAL_SIZE 16
55 #define SFP_EEPROM_DATE_ADDR 0x54
56 #define SFP_EEPROM_DATE_SIZE 6
57 #define PWR_FLT_ERR_MSG_LEN 250
59 #define XGXS_EXT_PHY_TYPE(ext_phy_config) \
60 ((ext_phy_config) & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK)
61 #define XGXS_EXT_PHY_ADDR(ext_phy_config) \
62 (((ext_phy_config) & PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> \
63 PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT)
64 #define SERDES_EXT_PHY_TYPE(ext_phy_config) \
65 ((ext_phy_config) & PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK)
68 #define SINGLE_MEDIA_DIRECT(params) (params->num_phys == 1)
70 #define SINGLE_MEDIA(params) (params->num_phys == 2)
72 #define DUAL_MEDIA(params) (params->num_phys == 3)
74 #define FW_PARAM_PHY_ADDR_MASK 0x000000FF
75 #define FW_PARAM_PHY_TYPE_MASK 0x0000FF00
76 #define FW_PARAM_MDIO_CTRL_MASK 0xFFFF0000
77 #define FW_PARAM_MDIO_CTRL_OFFSET 16
78 #define FW_PARAM_PHY_ADDR(fw_param) (fw_param & \
79 FW_PARAM_PHY_ADDR_MASK)
80 #define FW_PARAM_PHY_TYPE(fw_param) (fw_param & \
81 FW_PARAM_PHY_TYPE_MASK)
82 #define FW_PARAM_MDIO_CTRL(fw_param) ((fw_param & \
83 FW_PARAM_MDIO_CTRL_MASK) >> \
84 FW_PARAM_MDIO_CTRL_OFFSET)
85 #define FW_PARAM_SET(phy_addr, phy_type, mdio_access) \
86 (phy_addr | phy_type | mdio_access << FW_PARAM_MDIO_CTRL_OFFSET)
89 #define PFC_BRB_FULL_LB_XOFF_THRESHOLD 170
90 #define PFC_BRB_FULL_LB_XON_THRESHOLD 250
92 #define MAXVAL(a, b) (((a) > (b)) ? (a) : (b))
94 #define BMAC_CONTROL_RX_ENABLE 2
104 #define LINK_CONFIG_SIZE (MAX_PHYS - 1)
105 #define LINK_CONFIG_IDX(_phy_idx) ((_phy_idx == INT_PHY) ? \
143 #define FLAGS_HW_LOCK_REQUIRED (1<<0)
145 #define FLAGS_NOC (1<<1)
147 #define FLAGS_FAN_FAILURE_DET_REQ (1<<2)
149 #define FLAGS_INIT_XGXS_FIRST (1<<3)
150 #define FLAGS_WC_DUAL_MODE (1<<4)
151 #define FLAGS_4_PORT_MODE (1<<5)
152 #define FLAGS_REARM_LATCH_SIGNAL (1<<6)
153 #define FLAGS_SFP_NOT_APPROVED (1<<7)
154 #define FLAGS_MDC_MDIO_WA (1<<8)
155 #define FLAGS_DUMMY_READ (1<<9)
156 #define FLAGS_MDC_MDIO_WA_B0 (1<<10)
157 #define FLAGS_TX_ERROR_CHECK (1<<12)
158 #define FLAGS_EEE (1<<13)
172 #define ETH_PHY_UNSPECIFIED 0x0
173 #define ETH_PHY_SFPP_10G_FIBER 0x1
174 #define ETH_PHY_XFP_FIBER 0x2
175 #define ETH_PHY_DA_TWINAX 0x3
176 #define ETH_PHY_BASE_T 0x4
177 #define ETH_PHY_SFP_1G_FIBER 0x5
178 #define ETH_PHY_KR 0xf0
179 #define ETH_PHY_CX4 0xf1
180 #define ETH_PHY_NOT_PRESENT 0xff
229 #define LOOPBACK_NONE 0
230 #define LOOPBACK_EMAC 1
231 #define LOOPBACK_BMAC 2
232 #define LOOPBACK_XGXS 3
233 #define LOOPBACK_EXT_PHY 4
234 #define LOOPBACK_EXT 5
235 #define LOOPBACK_UMAC 6
236 #define LOOPBACK_XMAC 7
251 #define SWITCH_CFG_1G PORT_FEATURE_CON_SWITCH_1G_SWITCH
252 #define SWITCH_CFG_10G PORT_FEATURE_CON_SWITCH_10G_SWITCH
253 #define SWITCH_CFG_AUTO_DETECT PORT_FEATURE_CON_SWITCH_AUTO_DETECT
262 #define FEATURE_CONFIG_OVERRIDE_PREEMPHASIS_ENABLED (1<<0)
263 #define FEATURE_CONFIG_PFC_ENABLED (1<<1)
264 #define FEATURE_CONFIG_BC_SUPPORTS_OPT_MDL_VRFY (1<<2)
265 #define FEATURE_CONFIG_BC_SUPPORTS_DUAL_PHY_OPT_MDL_VRFY (1<<3)
266 #define FEATURE_CONFIG_BC_SUPPORTS_AFEX (1<<8)
267 #define FEATURE_CONFIG_AUTOGREEEN_ENABLED (1<<9)
268 #define FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED (1<<10)
269 #define FEATURE_CONFIG_DISABLE_REMOTE_FAULT_DET (1<<11)
291 #define EEE_MODE_NVRAM_BALANCED_TIME (0xa00)
292 #define EEE_MODE_NVRAM_AGGRESSIVE_TIME (0x100)
293 #define EEE_MODE_NVRAM_LATENCY_TIME (0x6000)
294 #define EEE_MODE_NVRAM_MASK (0x3)
295 #define EEE_MODE_TIMER_MASK (0xfffff)
296 #define EEE_MODE_OUTPUT_TIME (1<<28)
297 #define EEE_MODE_OVERRIDE_NVRAM (1<<29)
298 #define EEE_MODE_ENABLE_LPI (1<<30)
299 #define EEE_MODE_ADV_LPI (1<<31)
315 #define PHY_XGXS_FLAG (1<<0)
316 #define PHY_SGMII_FLAG (1<<1)
317 #define PHY_PHYSICAL_LINK_FLAG (1<<2)
318 #define PHY_HALF_OPEN_CONN_FLAG (1<<3)
319 #define PHY_OVER_CURRENT_FLAG (1<<4)
320 #define PHY_SFP_TX_FAULT_FLAG (1<<5)
323 #define MAC_TYPE_NONE 0
324 #define MAC_TYPE_EMAC 1
325 #define MAC_TYPE_BMAC 2
326 #define MAC_TYPE_UMAC 3
327 #define MAC_TYPE_XMAC 4
344 #define PERIODIC_FLAGS_LINK_EVENT 0x0001
390 #define LED_MODE_OFF 0
391 #define LED_MODE_ON 1
392 #define LED_MODE_OPER 2
393 #define LED_MODE_FRONT_PANEL_OFF 3
417 u8 byte_cnt,
u8 *o_buf);
440 #define DCBX_E2E3_MAX_NUM_COS (2)
441 #define DCBX_E3B0_MAX_NUM_COS_PORT0 (6)
442 #define DCBX_E3B0_MAX_NUM_COS_PORT1 (3)
443 #define DCBX_E3B0_MAX_NUM_COS ( \
444 MAXVAL(DCBX_E3B0_MAX_NUM_COS_PORT0, \
445 DCBX_E3B0_MAX_NUM_COS_PORT1))
447 #define DCBX_MAX_NUM_COS ( \
448 MAXVAL(DCBX_E3B0_MAX_NUM_COS, \
449 DCBX_E2E3_MAX_NUM_COS))
525 u32 pfc_frames_sent[2],
526 u32 pfc_frames_received[2]);