Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixgbe/if_ix.c
Show First 20 Lines • Show All 431 Lines • ▼ Show 20 Lines | |||||
* return 0 on success, positive on failure | * return 0 on success, positive on failure | ||||
************************************************************************/ | ************************************************************************/ | ||||
static int | static int | ||||
ixgbe_attach(device_t dev) | ixgbe_attach(device_t dev) | ||||
{ | { | ||||
struct adapter *adapter; | struct adapter *adapter; | ||||
struct ixgbe_hw *hw; | struct ixgbe_hw *hw; | ||||
int error = 0; | int error = 0; | ||||
u16 csum; | |||||
u32 ctrl_ext; | u32 ctrl_ext; | ||||
INIT_DEBUGOUT("ixgbe_attach: begin"); | INIT_DEBUGOUT("ixgbe_attach: begin"); | ||||
/* Allocate, clear, and link in our adapter structure */ | /* Allocate, clear, and link in our adapter structure */ | ||||
adapter = device_get_softc(dev); | adapter = device_get_softc(dev); | ||||
adapter->dev = dev; | adapter->dev = dev; | ||||
hw = &adapter->hw; | hw = &adapter->hw; | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | if (error == IXGBE_ERR_SFP_NOT_PRESENT) { | ||||
goto err_late; | goto err_late; | ||||
} else if (error) { | } else if (error) { | ||||
device_printf(dev, "Unable to initialize the shared code\n"); | device_printf(dev, "Unable to initialize the shared code\n"); | ||||
error = EIO; | error = EIO; | ||||
goto err_late; | goto err_late; | ||||
} | } | ||||
/* Make sure we have a good EEPROM before we read from it */ | /* Make sure we have a good EEPROM before we read from it */ | ||||
if (ixgbe_validate_eeprom_checksum(&adapter->hw, &csum) < 0) { | if (ixgbe_validate_eeprom_checksum(&adapter->hw, NULL) < 0) { | ||||
device_printf(dev, "The EEPROM Checksum Is Not Valid\n"); | device_printf(dev, "The EEPROM Checksum Is Not Valid\n"); | ||||
error = EIO; | error = EIO; | ||||
goto err_late; | goto err_late; | ||||
} | } | ||||
error = ixgbe_init_hw(hw); | error = ixgbe_init_hw(hw); | ||||
switch (error) { | switch (error) { | ||||
case IXGBE_ERR_EEPROM_VERSION: | case IXGBE_ERR_EEPROM_VERSION: | ||||
▲ Show 20 Lines • Show All 5,444 Lines • Show Last 20 Lines |