Commit 5795f533 authored by Jedrzej Jagielski's avatar Jedrzej Jagielski Committed by Tony Nguyen

ixgbe: Refactor returning internal error codes

Change returning codes to the kernel ones instead of
the internal ones for the entire ixgbe driver.
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarJedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 6c1b4af8
...@@ -123,14 +123,14 @@ static s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw) ...@@ -123,14 +123,14 @@ static s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw)
if (ret_val) if (ret_val)
return ret_val; return ret_val;
if (hw->phy.sfp_type == ixgbe_sfp_type_unknown) if (hw->phy.sfp_type == ixgbe_sfp_type_unknown)
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
/* Check to see if SFP+ module is supported */ /* Check to see if SFP+ module is supported */
ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, ret_val = ixgbe_get_sfp_init_sequence_offsets(hw,
&list_offset, &list_offset,
&data_offset); &data_offset);
if (ret_val) if (ret_val)
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
break; break;
default: default:
break; break;
...@@ -213,7 +213,7 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, ...@@ -213,7 +213,7 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw,
break; break;
default: default:
return IXGBE_ERR_LINK_SETUP; return -EIO;
} }
return 0; return 0;
...@@ -283,7 +283,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) ...@@ -283,7 +283,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
/* Validate the water mark configuration */ /* Validate the water mark configuration */
if (!hw->fc.pause_time) if (!hw->fc.pause_time)
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
/* Low water mark of zero causes XOFF floods */ /* Low water mark of zero causes XOFF floods */
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
...@@ -292,7 +292,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) ...@@ -292,7 +292,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
if (!hw->fc.low_water[i] || if (!hw->fc.low_water[i] ||
hw->fc.low_water[i] >= hw->fc.high_water[i]) { hw->fc.low_water[i] >= hw->fc.high_water[i]) {
hw_dbg(hw, "Invalid water mark configuration\n"); hw_dbg(hw, "Invalid water mark configuration\n");
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
} }
} }
} }
...@@ -369,7 +369,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) ...@@ -369,7 +369,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
break; break;
default: default:
hw_dbg(hw, "Flow control param set incorrectly\n"); hw_dbg(hw, "Flow control param set incorrectly\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
/* Set 802.3x based flow control settings. */ /* Set 802.3x based flow control settings. */
...@@ -438,7 +438,7 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, ...@@ -438,7 +438,7 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw,
msleep(100); msleep(100);
} }
if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) { if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
status = IXGBE_ERR_AUTONEG_NOT_COMPLETE; status = -EIO;
hw_dbg(hw, "Autonegotiation did not complete.\n"); hw_dbg(hw, "Autonegotiation did not complete.\n");
} }
} }
...@@ -478,7 +478,7 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) ...@@ -478,7 +478,7 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw)
if (timeout == IXGBE_VALIDATE_LINK_READY_TIMEOUT) { if (timeout == IXGBE_VALIDATE_LINK_READY_TIMEOUT) {
hw_dbg(hw, "Link was indicated but link is down\n"); hw_dbg(hw, "Link was indicated but link is down\n");
return IXGBE_ERR_LINK_SETUP; return -EIO;
} }
return 0; return 0;
...@@ -594,7 +594,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, ...@@ -594,7 +594,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw,
speed &= link_capabilities; speed &= link_capabilities;
if (speed == IXGBE_LINK_SPEED_UNKNOWN) if (speed == IXGBE_LINK_SPEED_UNKNOWN)
return IXGBE_ERR_LINK_SETUP; return -EINVAL;
/* Set KX4/KX support according to speed requested */ /* Set KX4/KX support according to speed requested */
else if (link_mode == IXGBE_AUTOC_LMS_KX4_AN || else if (link_mode == IXGBE_AUTOC_LMS_KX4_AN ||
...@@ -701,9 +701,9 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) ...@@ -701,9 +701,9 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
/* Init PHY and function pointers, perform SFP setup */ /* Init PHY and function pointers, perform SFP setup */
phy_status = hw->phy.ops.init(hw); phy_status = hw->phy.ops.init(hw);
if (phy_status == IXGBE_ERR_SFP_NOT_SUPPORTED) if (phy_status == -EOPNOTSUPP)
return phy_status; return phy_status;
if (phy_status == IXGBE_ERR_SFP_NOT_PRESENT) if (phy_status == -ENOENT)
goto mac_reset_top; goto mac_reset_top;
hw->phy.ops.reset(hw); hw->phy.ops.reset(hw);
...@@ -727,7 +727,7 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) ...@@ -727,7 +727,7 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
udelay(1); udelay(1);
} }
if (ctrl & IXGBE_CTRL_RST) { if (ctrl & IXGBE_CTRL_RST) {
status = IXGBE_ERR_RESET_FAILED; status = -EIO;
hw_dbg(hw, "Reset polling failed to complete.\n"); hw_dbg(hw, "Reset polling failed to complete.\n");
} }
...@@ -789,7 +789,7 @@ static s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) ...@@ -789,7 +789,7 @@ static s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
/* Make sure we are using a valid rar index range */ /* Make sure we are using a valid rar index range */
if (rar >= rar_entries) { if (rar >= rar_entries) {
hw_dbg(hw, "RAR index %d is out of range.\n", rar); hw_dbg(hw, "RAR index %d is out of range.\n", rar);
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
} }
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar)); rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar));
...@@ -814,7 +814,7 @@ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) ...@@ -814,7 +814,7 @@ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
/* Make sure we are using a valid rar index range */ /* Make sure we are using a valid rar index range */
if (rar >= rar_entries) { if (rar >= rar_entries) {
hw_dbg(hw, "RAR index %d is out of range.\n", rar); hw_dbg(hw, "RAR index %d is out of range.\n", rar);
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
} }
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar)); rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar));
...@@ -845,7 +845,7 @@ static s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, ...@@ -845,7 +845,7 @@ static s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind,
u32 vftabyte; u32 vftabyte;
if (vlan > 4095) if (vlan > 4095)
return IXGBE_ERR_PARAM; return -EINVAL;
/* Determine 32-bit word position in array */ /* Determine 32-bit word position in array */
regindex = (vlan >> 5) & 0x7F; /* upper seven bits */ regindex = (vlan >> 5) & 0x7F; /* upper seven bits */
...@@ -964,7 +964,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, ...@@ -964,7 +964,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr,
gssr = IXGBE_GSSR_PHY0_SM; gssr = IXGBE_GSSR_PHY0_SM;
if (hw->mac.ops.acquire_swfw_sync(hw, gssr) != 0) if (hw->mac.ops.acquire_swfw_sync(hw, gssr) != 0)
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
if (hw->phy.type == ixgbe_phy_nl) { if (hw->phy.type == ixgbe_phy_nl) {
/* /*
...@@ -993,7 +993,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, ...@@ -993,7 +993,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr,
if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_PASS) { if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_PASS) {
hw_dbg(hw, "EEPROM read did not pass.\n"); hw_dbg(hw, "EEPROM read did not pass.\n");
status = IXGBE_ERR_SFP_NOT_PRESENT; status = -ENOENT;
goto out; goto out;
} }
...@@ -1003,7 +1003,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, ...@@ -1003,7 +1003,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr,
*eeprom_data = (u8)(sfp_data >> 8); *eeprom_data = (u8)(sfp_data >> 8);
} else { } else {
status = IXGBE_ERR_PHY; status = -EIO;
} }
out: out:
......
...@@ -117,7 +117,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) ...@@ -117,7 +117,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
ret_val = hw->mac.ops.acquire_swfw_sync(hw, ret_val = hw->mac.ops.acquire_swfw_sync(hw,
IXGBE_GSSR_MAC_CSR_SM); IXGBE_GSSR_MAC_CSR_SM);
if (ret_val) if (ret_val)
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
if (hw->eeprom.ops.read(hw, ++data_offset, &data_value)) if (hw->eeprom.ops.read(hw, ++data_offset, &data_value))
goto setup_sfp_err; goto setup_sfp_err;
...@@ -144,7 +144,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) ...@@ -144,7 +144,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
if (ret_val) { if (ret_val) {
hw_dbg(hw, " sfp module setup not complete\n"); hw_dbg(hw, " sfp module setup not complete\n");
return IXGBE_ERR_SFP_SETUP_NOT_COMPLETE; return -EIO;
} }
} }
...@@ -159,7 +159,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) ...@@ -159,7 +159,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
usleep_range(hw->eeprom.semaphore_delay * 1000, usleep_range(hw->eeprom.semaphore_delay * 1000,
hw->eeprom.semaphore_delay * 2000); hw->eeprom.semaphore_delay * 2000);
hw_err(hw, "eeprom read at offset %d failed\n", data_offset); hw_err(hw, "eeprom read at offset %d failed\n", data_offset);
return IXGBE_ERR_SFP_SETUP_NOT_COMPLETE; return -EIO;
} }
/** /**
...@@ -184,7 +184,7 @@ static s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, ...@@ -184,7 +184,7 @@ static s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked,
ret_val = hw->mac.ops.acquire_swfw_sync(hw, ret_val = hw->mac.ops.acquire_swfw_sync(hw,
IXGBE_GSSR_MAC_CSR_SM); IXGBE_GSSR_MAC_CSR_SM);
if (ret_val) if (ret_val)
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
*locked = true; *locked = true;
} }
...@@ -219,7 +219,7 @@ static s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked) ...@@ -219,7 +219,7 @@ static s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked)
ret_val = hw->mac.ops.acquire_swfw_sync(hw, ret_val = hw->mac.ops.acquire_swfw_sync(hw,
IXGBE_GSSR_MAC_CSR_SM); IXGBE_GSSR_MAC_CSR_SM);
if (ret_val) if (ret_val)
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
locked = true; locked = true;
} }
...@@ -400,7 +400,7 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, ...@@ -400,7 +400,7 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
break; break;
default: default:
return IXGBE_ERR_LINK_SETUP; return -EIO;
} }
if (hw->phy.multispeed_fiber) { if (hw->phy.multispeed_fiber) {
...@@ -541,7 +541,7 @@ static s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, ...@@ -541,7 +541,7 @@ static s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw,
msleep(100); msleep(100);
} }
if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) { if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
status = IXGBE_ERR_AUTONEG_NOT_COMPLETE; status = -EIO;
hw_dbg(hw, "Autoneg did not complete.\n"); hw_dbg(hw, "Autoneg did not complete.\n");
} }
} }
...@@ -794,7 +794,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, ...@@ -794,7 +794,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
speed &= link_capabilities; speed &= link_capabilities;
if (speed == IXGBE_LINK_SPEED_UNKNOWN) if (speed == IXGBE_LINK_SPEED_UNKNOWN)
return IXGBE_ERR_LINK_SETUP; return -EINVAL;
/* Use stored value (EEPROM defaults) of AUTOC to find KR/KX4 support*/ /* Use stored value (EEPROM defaults) of AUTOC to find KR/KX4 support*/
if (hw->mac.orig_link_settings_stored) if (hw->mac.orig_link_settings_stored)
...@@ -861,8 +861,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, ...@@ -861,8 +861,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
msleep(100); msleep(100);
} }
if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) { if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
status = status = -EIO;
IXGBE_ERR_AUTONEG_NOT_COMPLETE;
hw_dbg(hw, "Autoneg did not complete.\n"); hw_dbg(hw, "Autoneg did not complete.\n");
} }
} }
...@@ -927,7 +926,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) ...@@ -927,7 +926,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
/* Identify PHY and related function pointers */ /* Identify PHY and related function pointers */
status = hw->phy.ops.init(hw); status = hw->phy.ops.init(hw);
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) if (status == -EOPNOTSUPP)
return status; return status;
/* Setup SFP module if there is one present. */ /* Setup SFP module if there is one present. */
...@@ -936,7 +935,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) ...@@ -936,7 +935,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
hw->phy.sfp_setup_needed = false; hw->phy.sfp_setup_needed = false;
} }
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) if (status == -EOPNOTSUPP)
return status; return status;
/* Reset PHY */ /* Reset PHY */
...@@ -974,7 +973,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) ...@@ -974,7 +973,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
} }
if (ctrl & IXGBE_CTRL_RST_MASK) { if (ctrl & IXGBE_CTRL_RST_MASK) {
status = IXGBE_ERR_RESET_FAILED; status = -EIO;
hw_dbg(hw, "Reset polling failed to complete.\n"); hw_dbg(hw, "Reset polling failed to complete.\n");
} }
...@@ -1093,7 +1092,7 @@ static s32 ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, u32 *fdircmd) ...@@ -1093,7 +1092,7 @@ static s32 ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, u32 *fdircmd)
udelay(10); udelay(10);
} }
return IXGBE_ERR_FDIR_CMD_INCOMPLETE; return -EIO;
} }
/** /**
...@@ -1155,7 +1154,7 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) ...@@ -1155,7 +1154,7 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw)
} }
if (i >= IXGBE_FDIR_INIT_DONE_POLL) { if (i >= IXGBE_FDIR_INIT_DONE_POLL) {
hw_dbg(hw, "Flow Director Signature poll time exceeded!\n"); hw_dbg(hw, "Flow Director Signature poll time exceeded!\n");
return IXGBE_ERR_FDIR_REINIT_FAILED; return -EIO;
} }
/* Clear FDIR statistics registers (read to clear) */ /* Clear FDIR statistics registers (read to clear) */
...@@ -1387,7 +1386,7 @@ s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw, ...@@ -1387,7 +1386,7 @@ s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
break; break;
default: default:
hw_dbg(hw, " Error on flow type input\n"); hw_dbg(hw, " Error on flow type input\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
/* configure FDIRCMD register */ /* configure FDIRCMD register */
...@@ -1546,7 +1545,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ...@@ -1546,7 +1545,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
break; break;
default: default:
hw_dbg(hw, " Error on vm pool mask\n"); hw_dbg(hw, " Error on vm pool mask\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
switch (input_mask->formatted.flow_type & IXGBE_ATR_L4TYPE_MASK) { switch (input_mask->formatted.flow_type & IXGBE_ATR_L4TYPE_MASK) {
...@@ -1555,14 +1554,14 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ...@@ -1555,14 +1554,14 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
if (input_mask->formatted.dst_port || if (input_mask->formatted.dst_port ||
input_mask->formatted.src_port) { input_mask->formatted.src_port) {
hw_dbg(hw, " Error on src/dst port mask\n"); hw_dbg(hw, " Error on src/dst port mask\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
break; break;
case IXGBE_ATR_L4TYPE_MASK: case IXGBE_ATR_L4TYPE_MASK:
break; break;
default: default:
hw_dbg(hw, " Error on flow type mask\n"); hw_dbg(hw, " Error on flow type mask\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
switch (ntohs(input_mask->formatted.vlan_id) & 0xEFFF) { switch (ntohs(input_mask->formatted.vlan_id) & 0xEFFF) {
...@@ -1583,7 +1582,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ...@@ -1583,7 +1582,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
break; break;
default: default:
hw_dbg(hw, " Error on VLAN mask\n"); hw_dbg(hw, " Error on VLAN mask\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
switch ((__force u16)input_mask->formatted.flex_bytes & 0xFFFF) { switch ((__force u16)input_mask->formatted.flex_bytes & 0xFFFF) {
...@@ -1595,7 +1594,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ...@@ -1595,7 +1594,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
break; break;
default: default:
hw_dbg(hw, " Error on flexible byte mask\n"); hw_dbg(hw, " Error on flexible byte mask\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
/* Now mask VM pool and destination IPv6 - bits 5 and 2 */ /* Now mask VM pool and destination IPv6 - bits 5 and 2 */
...@@ -1824,7 +1823,7 @@ static s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw) ...@@ -1824,7 +1823,7 @@ static s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
/* Return error if SFP module has been detected but is not supported */ /* Return error if SFP module has been detected but is not supported */
if (hw->phy.type == ixgbe_phy_sfp_unsupported) if (hw->phy.type == ixgbe_phy_sfp_unsupported)
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
return status; return status;
} }
...@@ -1863,13 +1862,13 @@ static s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval) ...@@ -1863,13 +1862,13 @@ static s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval)
* Verifies that installed the firmware version is 0.6 or higher * Verifies that installed the firmware version is 0.6 or higher
* for SFI devices. All 82599 SFI devices should have version 0.6 or higher. * for SFI devices. All 82599 SFI devices should have version 0.6 or higher.
* *
* Returns IXGBE_ERR_EEPROM_VERSION if the FW is not present or * Return: -EACCES if the FW is not present or if the FW version is
* if the FW version is not supported. * not supported.
**/ **/
static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw) static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
{ {
s32 status = IXGBE_ERR_EEPROM_VERSION;
u16 fw_offset, fw_ptp_cfg_offset; u16 fw_offset, fw_ptp_cfg_offset;
s32 status = -EACCES;
u16 offset; u16 offset;
u16 fw_version = 0; u16 fw_version = 0;
...@@ -1883,7 +1882,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw) ...@@ -1883,7 +1882,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
goto fw_version_err; goto fw_version_err;
if (fw_offset == 0 || fw_offset == 0xFFFF) if (fw_offset == 0 || fw_offset == 0xFFFF)
return IXGBE_ERR_EEPROM_VERSION; return -EACCES;
/* get the offset to the Pass Through Patch Configuration block */ /* get the offset to the Pass Through Patch Configuration block */
offset = fw_offset + IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR; offset = fw_offset + IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR;
...@@ -1891,7 +1890,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw) ...@@ -1891,7 +1890,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
goto fw_version_err; goto fw_version_err;
if (fw_ptp_cfg_offset == 0 || fw_ptp_cfg_offset == 0xFFFF) if (fw_ptp_cfg_offset == 0 || fw_ptp_cfg_offset == 0xFFFF)
return IXGBE_ERR_EEPROM_VERSION; return -EACCES;
/* get the firmware version */ /* get the firmware version */
offset = fw_ptp_cfg_offset + IXGBE_FW_PATCH_VERSION_4; offset = fw_ptp_cfg_offset + IXGBE_FW_PATCH_VERSION_4;
...@@ -1905,7 +1904,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw) ...@@ -1905,7 +1904,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
fw_version_err: fw_version_err:
hw_err(hw, "eeprom read at offset %d failed\n", offset); hw_err(hw, "eeprom read at offset %d failed\n", offset);
return IXGBE_ERR_EEPROM_VERSION; return -EACCES;
} }
/** /**
...@@ -2038,7 +2037,7 @@ static s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw) ...@@ -2038,7 +2037,7 @@ static s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw)
if (!(anlp1_reg & IXGBE_ANLP1_AN_STATE_MASK)) { if (!(anlp1_reg & IXGBE_ANLP1_AN_STATE_MASK)) {
hw_dbg(hw, "auto negotiation not completed\n"); hw_dbg(hw, "auto negotiation not completed\n");
ret_val = IXGBE_ERR_RESET_FAILED; ret_val = -EIO;
goto reset_pipeline_out; goto reset_pipeline_out;
} }
...@@ -2087,7 +2086,7 @@ static s32 ixgbe_read_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset, ...@@ -2087,7 +2086,7 @@ static s32 ixgbe_read_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset,
if (!timeout) { if (!timeout) {
hw_dbg(hw, "Driver can't access resource, acquiring I2C bus timeout.\n"); hw_dbg(hw, "Driver can't access resource, acquiring I2C bus timeout.\n");
status = IXGBE_ERR_I2C; status = -EIO;
goto release_i2c_access; goto release_i2c_access;
} }
} }
...@@ -2141,7 +2140,7 @@ static s32 ixgbe_write_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset, ...@@ -2141,7 +2140,7 @@ static s32 ixgbe_write_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset,
if (!timeout) { if (!timeout) {
hw_dbg(hw, "Driver can't access resource, acquiring I2C bus timeout.\n"); hw_dbg(hw, "Driver can't access resource, acquiring I2C bus timeout.\n");
status = IXGBE_ERR_I2C; status = -EIO;
goto release_i2c_access; goto release_i2c_access;
} }
} }
......
...@@ -124,7 +124,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw) ...@@ -124,7 +124,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw)
*/ */
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
hw_dbg(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); hw_dbg(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
} }
/* /*
...@@ -215,7 +215,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw) ...@@ -215,7 +215,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw)
break; break;
default: default:
hw_dbg(hw, "Flow control param set incorrectly\n"); hw_dbg(hw, "Flow control param set incorrectly\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
if (hw->mac.type != ixgbe_mac_X540) { if (hw->mac.type != ixgbe_mac_X540) {
...@@ -500,7 +500,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, ...@@ -500,7 +500,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
if (pba_num == NULL) { if (pba_num == NULL) {
hw_dbg(hw, "PBA string buffer was null\n"); hw_dbg(hw, "PBA string buffer was null\n");
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
} }
ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data); ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data);
...@@ -526,7 +526,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, ...@@ -526,7 +526,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
/* we will need 11 characters to store the PBA */ /* we will need 11 characters to store the PBA */
if (pba_num_size < 11) { if (pba_num_size < 11) {
hw_dbg(hw, "PBA string buffer too small\n"); hw_dbg(hw, "PBA string buffer too small\n");
return IXGBE_ERR_NO_SPACE; return -ENOSPC;
} }
/* extract hex string from data and pba_ptr */ /* extract hex string from data and pba_ptr */
...@@ -563,13 +563,13 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, ...@@ -563,13 +563,13 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
if (length == 0xFFFF || length == 0) { if (length == 0xFFFF || length == 0) {
hw_dbg(hw, "NVM PBA number section invalid length\n"); hw_dbg(hw, "NVM PBA number section invalid length\n");
return IXGBE_ERR_PBA_SECTION; return -EIO;
} }
/* check if pba_num buffer is big enough */ /* check if pba_num buffer is big enough */
if (pba_num_size < (((u32)length * 2) - 1)) { if (pba_num_size < (((u32)length * 2) - 1)) {
hw_dbg(hw, "PBA string buffer too small\n"); hw_dbg(hw, "PBA string buffer too small\n");
return IXGBE_ERR_NO_SPACE; return -ENOSPC;
} }
/* trim pba length from start of string */ /* trim pba length from start of string */
...@@ -805,7 +805,7 @@ s32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index) ...@@ -805,7 +805,7 @@ s32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index)
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
if (index > 3) if (index > 3)
return IXGBE_ERR_PARAM; return -EINVAL;
/* To turn on the LED, set mode to ON. */ /* To turn on the LED, set mode to ON. */
led_reg &= ~IXGBE_LED_MODE_MASK(index); led_reg &= ~IXGBE_LED_MODE_MASK(index);
...@@ -826,7 +826,7 @@ s32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index) ...@@ -826,7 +826,7 @@ s32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index)
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
if (index > 3) if (index > 3)
return IXGBE_ERR_PARAM; return -EINVAL;
/* To turn off the LED, set mode to OFF. */ /* To turn off the LED, set mode to OFF. */
led_reg &= ~IXGBE_LED_MODE_MASK(index); led_reg &= ~IXGBE_LED_MODE_MASK(index);
...@@ -903,11 +903,8 @@ s32 ixgbe_write_eeprom_buffer_bit_bang_generic(struct ixgbe_hw *hw, u16 offset, ...@@ -903,11 +903,8 @@ s32 ixgbe_write_eeprom_buffer_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
hw->eeprom.ops.init_params(hw); hw->eeprom.ops.init_params(hw);
if (words == 0) if (words == 0 || (offset + words > hw->eeprom.word_size))
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
if (offset + words > hw->eeprom.word_size)
return IXGBE_ERR_EEPROM;
/* /*
* The EEPROM page size cannot be queried from the chip. We do lazy * The EEPROM page size cannot be queried from the chip. We do lazy
...@@ -961,7 +958,7 @@ static s32 ixgbe_write_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset, ...@@ -961,7 +958,7 @@ static s32 ixgbe_write_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset,
if (ixgbe_ready_eeprom(hw) != 0) { if (ixgbe_ready_eeprom(hw) != 0) {
ixgbe_release_eeprom(hw); ixgbe_release_eeprom(hw);
return IXGBE_ERR_EEPROM; return -EIO;
} }
for (i = 0; i < words; i++) { for (i = 0; i < words; i++) {
...@@ -1027,7 +1024,7 @@ s32 ixgbe_write_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 data) ...@@ -1027,7 +1024,7 @@ s32 ixgbe_write_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 data)
hw->eeprom.ops.init_params(hw); hw->eeprom.ops.init_params(hw);
if (offset >= hw->eeprom.word_size) if (offset >= hw->eeprom.word_size)
return IXGBE_ERR_EEPROM; return -EINVAL;
return ixgbe_write_eeprom_buffer_bit_bang(hw, offset, 1, &data); return ixgbe_write_eeprom_buffer_bit_bang(hw, offset, 1, &data);
} }
...@@ -1049,11 +1046,8 @@ s32 ixgbe_read_eeprom_buffer_bit_bang_generic(struct ixgbe_hw *hw, u16 offset, ...@@ -1049,11 +1046,8 @@ s32 ixgbe_read_eeprom_buffer_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
hw->eeprom.ops.init_params(hw); hw->eeprom.ops.init_params(hw);
if (words == 0) if (words == 0 || (offset + words > hw->eeprom.word_size))
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
if (offset + words > hw->eeprom.word_size)
return IXGBE_ERR_EEPROM;
/* /*
* We cannot hold synchronization semaphores for too long * We cannot hold synchronization semaphores for too long
...@@ -1098,7 +1092,7 @@ static s32 ixgbe_read_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset, ...@@ -1098,7 +1092,7 @@ static s32 ixgbe_read_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset,
if (ixgbe_ready_eeprom(hw) != 0) { if (ixgbe_ready_eeprom(hw) != 0) {
ixgbe_release_eeprom(hw); ixgbe_release_eeprom(hw);
return IXGBE_ERR_EEPROM; return -EIO;
} }
for (i = 0; i < words; i++) { for (i = 0; i < words; i++) {
...@@ -1141,7 +1135,7 @@ s32 ixgbe_read_eeprom_bit_bang_generic(struct ixgbe_hw *hw, u16 offset, ...@@ -1141,7 +1135,7 @@ s32 ixgbe_read_eeprom_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
hw->eeprom.ops.init_params(hw); hw->eeprom.ops.init_params(hw);
if (offset >= hw->eeprom.word_size) if (offset >= hw->eeprom.word_size)
return IXGBE_ERR_EEPROM; return -EINVAL;
return ixgbe_read_eeprom_buffer_bit_bang(hw, offset, 1, data); return ixgbe_read_eeprom_buffer_bit_bang(hw, offset, 1, data);
} }
...@@ -1164,11 +1158,8 @@ s32 ixgbe_read_eerd_buffer_generic(struct ixgbe_hw *hw, u16 offset, ...@@ -1164,11 +1158,8 @@ s32 ixgbe_read_eerd_buffer_generic(struct ixgbe_hw *hw, u16 offset,
hw->eeprom.ops.init_params(hw); hw->eeprom.ops.init_params(hw);
if (words == 0) if (words == 0 || offset >= hw->eeprom.word_size)
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
if (offset >= hw->eeprom.word_size)
return IXGBE_ERR_EEPROM;
for (i = 0; i < words; i++) { for (i = 0; i < words; i++) {
eerd = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) | eerd = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) |
...@@ -1261,11 +1252,8 @@ s32 ixgbe_write_eewr_buffer_generic(struct ixgbe_hw *hw, u16 offset, ...@@ -1261,11 +1252,8 @@ s32 ixgbe_write_eewr_buffer_generic(struct ixgbe_hw *hw, u16 offset,
hw->eeprom.ops.init_params(hw); hw->eeprom.ops.init_params(hw);
if (words == 0) if (words == 0 || offset >= hw->eeprom.word_size)
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
if (offset >= hw->eeprom.word_size)
return IXGBE_ERR_EEPROM;
for (i = 0; i < words; i++) { for (i = 0; i < words; i++) {
eewr = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) | eewr = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) |
...@@ -1327,7 +1315,7 @@ static s32 ixgbe_poll_eerd_eewr_done(struct ixgbe_hw *hw, u32 ee_reg) ...@@ -1327,7 +1315,7 @@ static s32 ixgbe_poll_eerd_eewr_done(struct ixgbe_hw *hw, u32 ee_reg)
} }
udelay(5); udelay(5);
} }
return IXGBE_ERR_EEPROM; return -EIO;
} }
/** /**
...@@ -1343,7 +1331,7 @@ static s32 ixgbe_acquire_eeprom(struct ixgbe_hw *hw) ...@@ -1343,7 +1331,7 @@ static s32 ixgbe_acquire_eeprom(struct ixgbe_hw *hw)
u32 i; u32 i;
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) != 0) if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) != 0)
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw));
...@@ -1365,7 +1353,7 @@ static s32 ixgbe_acquire_eeprom(struct ixgbe_hw *hw) ...@@ -1365,7 +1353,7 @@ static s32 ixgbe_acquire_eeprom(struct ixgbe_hw *hw)
hw_dbg(hw, "Could not acquire EEPROM grant\n"); hw_dbg(hw, "Could not acquire EEPROM grant\n");
hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
return IXGBE_ERR_EEPROM; return -EIO;
} }
/* Setup EEPROM for Read/Write */ /* Setup EEPROM for Read/Write */
...@@ -1418,7 +1406,7 @@ static s32 ixgbe_get_eeprom_semaphore(struct ixgbe_hw *hw) ...@@ -1418,7 +1406,7 @@ static s32 ixgbe_get_eeprom_semaphore(struct ixgbe_hw *hw)
swsm = IXGBE_READ_REG(hw, IXGBE_SWSM(hw)); swsm = IXGBE_READ_REG(hw, IXGBE_SWSM(hw));
if (swsm & IXGBE_SWSM_SMBI) { if (swsm & IXGBE_SWSM_SMBI) {
hw_dbg(hw, "Software semaphore SMBI between device drivers not granted.\n"); hw_dbg(hw, "Software semaphore SMBI between device drivers not granted.\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
} }
...@@ -1446,7 +1434,7 @@ static s32 ixgbe_get_eeprom_semaphore(struct ixgbe_hw *hw) ...@@ -1446,7 +1434,7 @@ static s32 ixgbe_get_eeprom_semaphore(struct ixgbe_hw *hw)
if (i >= timeout) { if (i >= timeout) {
hw_dbg(hw, "SWESMBI Software EEPROM semaphore not granted.\n"); hw_dbg(hw, "SWESMBI Software EEPROM semaphore not granted.\n");
ixgbe_release_eeprom_semaphore(hw); ixgbe_release_eeprom_semaphore(hw);
return IXGBE_ERR_EEPROM; return -EIO;
} }
return 0; return 0;
...@@ -1502,7 +1490,7 @@ static s32 ixgbe_ready_eeprom(struct ixgbe_hw *hw) ...@@ -1502,7 +1490,7 @@ static s32 ixgbe_ready_eeprom(struct ixgbe_hw *hw)
*/ */
if (i >= IXGBE_EEPROM_MAX_RETRY_SPI) { if (i >= IXGBE_EEPROM_MAX_RETRY_SPI) {
hw_dbg(hw, "SPI EEPROM Status error\n"); hw_dbg(hw, "SPI EEPROM Status error\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
return 0; return 0;
...@@ -1714,7 +1702,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw) ...@@ -1714,7 +1702,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)
for (i = IXGBE_PCIE_ANALOG_PTR; i < IXGBE_FW_PTR; i++) { for (i = IXGBE_PCIE_ANALOG_PTR; i < IXGBE_FW_PTR; i++) {
if (hw->eeprom.ops.read(hw, i, &pointer)) { if (hw->eeprom.ops.read(hw, i, &pointer)) {
hw_dbg(hw, "EEPROM read failed\n"); hw_dbg(hw, "EEPROM read failed\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
/* If the pointer seems invalid */ /* If the pointer seems invalid */
...@@ -1723,7 +1711,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw) ...@@ -1723,7 +1711,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)
if (hw->eeprom.ops.read(hw, pointer, &length)) { if (hw->eeprom.ops.read(hw, pointer, &length)) {
hw_dbg(hw, "EEPROM read failed\n"); hw_dbg(hw, "EEPROM read failed\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
if (length == 0xFFFF || length == 0) if (length == 0xFFFF || length == 0)
...@@ -1732,7 +1720,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw) ...@@ -1732,7 +1720,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)
for (j = pointer + 1; j <= pointer + length; j++) { for (j = pointer + 1; j <= pointer + length; j++) {
if (hw->eeprom.ops.read(hw, j, &word)) { if (hw->eeprom.ops.read(hw, j, &word)) {
hw_dbg(hw, "EEPROM read failed\n"); hw_dbg(hw, "EEPROM read failed\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
checksum += word; checksum += word;
} }
...@@ -1785,7 +1773,7 @@ s32 ixgbe_validate_eeprom_checksum_generic(struct ixgbe_hw *hw, ...@@ -1785,7 +1773,7 @@ s32 ixgbe_validate_eeprom_checksum_generic(struct ixgbe_hw *hw,
* calculated checksum * calculated checksum
*/ */
if (read_checksum != checksum) if (read_checksum != checksum)
status = IXGBE_ERR_EEPROM_CHECKSUM; status = -EIO;
/* If the user cares, return the calculated checksum */ /* If the user cares, return the calculated checksum */
if (checksum_val) if (checksum_val)
...@@ -1844,7 +1832,7 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, ...@@ -1844,7 +1832,7 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
/* Make sure we are using a valid rar index range */ /* Make sure we are using a valid rar index range */
if (index >= rar_entries) { if (index >= rar_entries) {
hw_dbg(hw, "RAR index %d is out of range.\n", index); hw_dbg(hw, "RAR index %d is out of range.\n", index);
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
} }
/* setup VMDq pool selection before this RAR gets enabled */ /* setup VMDq pool selection before this RAR gets enabled */
...@@ -1896,7 +1884,7 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index) ...@@ -1896,7 +1884,7 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index)
/* Make sure we are using a valid rar index range */ /* Make sure we are using a valid rar index range */
if (index >= rar_entries) { if (index >= rar_entries) {
hw_dbg(hw, "RAR index %d is out of range.\n", index); hw_dbg(hw, "RAR index %d is out of range.\n", index);
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
} }
/* /*
...@@ -2145,7 +2133,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) ...@@ -2145,7 +2133,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
/* Validate the water mark configuration. */ /* Validate the water mark configuration. */
if (!hw->fc.pause_time) if (!hw->fc.pause_time)
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
/* Low water mark of zero causes XOFF floods */ /* Low water mark of zero causes XOFF floods */
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) { for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
...@@ -2154,7 +2142,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) ...@@ -2154,7 +2142,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
if (!hw->fc.low_water[i] || if (!hw->fc.low_water[i] ||
hw->fc.low_water[i] >= hw->fc.high_water[i]) { hw->fc.low_water[i] >= hw->fc.high_water[i]) {
hw_dbg(hw, "Invalid water mark configuration\n"); hw_dbg(hw, "Invalid water mark configuration\n");
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
} }
} }
} }
...@@ -2211,7 +2199,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) ...@@ -2211,7 +2199,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
break; break;
default: default:
hw_dbg(hw, "Flow control param set incorrectly\n"); hw_dbg(hw, "Flow control param set incorrectly\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
/* Set 802.3x based flow control settings. */ /* Set 802.3x based flow control settings. */
...@@ -2268,7 +2256,7 @@ s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, ...@@ -2268,7 +2256,7 @@ s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg,
u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm) u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm)
{ {
if ((!(adv_reg)) || (!(lp_reg))) if ((!(adv_reg)) || (!(lp_reg)))
return IXGBE_ERR_FC_NOT_NEGOTIATED; return -EINVAL;
if ((adv_reg & adv_sym) && (lp_reg & lp_sym)) { if ((adv_reg & adv_sym) && (lp_reg & lp_sym)) {
/* /*
...@@ -2320,7 +2308,7 @@ static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw) ...@@ -2320,7 +2308,7 @@ static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw)
linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA); linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA);
if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) || if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) ||
(!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) (!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1))
return IXGBE_ERR_FC_NOT_NEGOTIATED; return -EIO;
pcs_anadv_reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA); pcs_anadv_reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA);
pcs_lpab_reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANLP); pcs_lpab_reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANLP);
...@@ -2352,12 +2340,12 @@ static s32 ixgbe_fc_autoneg_backplane(struct ixgbe_hw *hw) ...@@ -2352,12 +2340,12 @@ static s32 ixgbe_fc_autoneg_backplane(struct ixgbe_hw *hw)
*/ */
links = IXGBE_READ_REG(hw, IXGBE_LINKS); links = IXGBE_READ_REG(hw, IXGBE_LINKS);
if ((links & IXGBE_LINKS_KX_AN_COMP) == 0) if ((links & IXGBE_LINKS_KX_AN_COMP) == 0)
return IXGBE_ERR_FC_NOT_NEGOTIATED; return -EIO;
if (hw->mac.type == ixgbe_mac_82599EB) { if (hw->mac.type == ixgbe_mac_82599EB) {
links2 = IXGBE_READ_REG(hw, IXGBE_LINKS2); links2 = IXGBE_READ_REG(hw, IXGBE_LINKS2);
if ((links2 & IXGBE_LINKS2_AN_SUPPORTED) == 0) if ((links2 & IXGBE_LINKS2_AN_SUPPORTED) == 0)
return IXGBE_ERR_FC_NOT_NEGOTIATED; return -EIO;
} }
/* /*
* Read the 10g AN autoc and LP ability registers and resolve * Read the 10g AN autoc and LP ability registers and resolve
...@@ -2406,8 +2394,8 @@ static s32 ixgbe_fc_autoneg_copper(struct ixgbe_hw *hw) ...@@ -2406,8 +2394,8 @@ static s32 ixgbe_fc_autoneg_copper(struct ixgbe_hw *hw)
**/ **/
void ixgbe_fc_autoneg(struct ixgbe_hw *hw) void ixgbe_fc_autoneg(struct ixgbe_hw *hw)
{ {
s32 ret_val = IXGBE_ERR_FC_NOT_NEGOTIATED;
ixgbe_link_speed speed; ixgbe_link_speed speed;
s32 ret_val = -EIO;
bool link_up; bool link_up;
/* /*
...@@ -2509,7 +2497,7 @@ static u32 ixgbe_pcie_timeout_poll(struct ixgbe_hw *hw) ...@@ -2509,7 +2497,7 @@ static u32 ixgbe_pcie_timeout_poll(struct ixgbe_hw *hw)
* @hw: pointer to hardware structure * @hw: pointer to hardware structure
* *
* Disables PCI-Express primary access and verifies there are no pending * Disables PCI-Express primary access and verifies there are no pending
* requests. IXGBE_ERR_PRIMARY_REQUESTS_PENDING is returned if primary disable * requests. -EALREADY is returned if primary disable
* bit hasn't caused the primary requests to be disabled, else 0 * bit hasn't caused the primary requests to be disabled, else 0
* is returned signifying primary requests disabled. * is returned signifying primary requests disabled.
**/ **/
...@@ -2574,7 +2562,7 @@ static s32 ixgbe_disable_pcie_primary(struct ixgbe_hw *hw) ...@@ -2574,7 +2562,7 @@ static s32 ixgbe_disable_pcie_primary(struct ixgbe_hw *hw)
} }
hw_dbg(hw, "PCIe transaction pending bit also did not clear.\n"); hw_dbg(hw, "PCIe transaction pending bit also did not clear.\n");
return IXGBE_ERR_PRIMARY_REQUESTS_PENDING; return -EALREADY;
} }
/** /**
...@@ -2599,7 +2587,7 @@ s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u32 mask) ...@@ -2599,7 +2587,7 @@ s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u32 mask)
* SW_FW_SYNC bits (not just NVM) * SW_FW_SYNC bits (not just NVM)
*/ */
if (ixgbe_get_eeprom_semaphore(hw)) if (ixgbe_get_eeprom_semaphore(hw))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
gssr = IXGBE_READ_REG(hw, IXGBE_GSSR); gssr = IXGBE_READ_REG(hw, IXGBE_GSSR);
if (!(gssr & (fwmask | swmask))) { if (!(gssr & (fwmask | swmask))) {
...@@ -2619,7 +2607,7 @@ s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u32 mask) ...@@ -2619,7 +2607,7 @@ s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u32 mask)
ixgbe_release_swfw_sync(hw, gssr & (fwmask | swmask)); ixgbe_release_swfw_sync(hw, gssr & (fwmask | swmask));
usleep_range(5000, 10000); usleep_range(5000, 10000);
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
} }
/** /**
...@@ -2756,7 +2744,7 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index) ...@@ -2756,7 +2744,7 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
s32 ret_val; s32 ret_val;
if (index > 3) if (index > 3)
return IXGBE_ERR_PARAM; return -EINVAL;
/* /*
* Link must be up to auto-blink the LEDs; * Link must be up to auto-blink the LEDs;
...@@ -2802,7 +2790,7 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index) ...@@ -2802,7 +2790,7 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
s32 ret_val; s32 ret_val;
if (index > 3) if (index > 3)
return IXGBE_ERR_PARAM; return -EINVAL;
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
if (ret_val) if (ret_val)
...@@ -2962,7 +2950,7 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq) ...@@ -2962,7 +2950,7 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
/* Make sure we are using a valid rar index range */ /* Make sure we are using a valid rar index range */
if (rar >= rar_entries) { if (rar >= rar_entries) {
hw_dbg(hw, "RAR index %d is out of range.\n", rar); hw_dbg(hw, "RAR index %d is out of range.\n", rar);
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
} }
mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar)); mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar));
...@@ -3013,7 +3001,7 @@ s32 ixgbe_set_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq) ...@@ -3013,7 +3001,7 @@ s32 ixgbe_set_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
/* Make sure we are using a valid rar index range */ /* Make sure we are using a valid rar index range */
if (rar >= rar_entries) { if (rar >= rar_entries) {
hw_dbg(hw, "RAR index %d is out of range.\n", rar); hw_dbg(hw, "RAR index %d is out of range.\n", rar);
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
} }
if (vmdq < 32) { if (vmdq < 32) {
...@@ -3090,7 +3078,7 @@ static s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan, bool vlvf_bypass) ...@@ -3090,7 +3078,7 @@ static s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan, bool vlvf_bypass)
* will simply bypass the VLVF if there are no entries present in the * will simply bypass the VLVF if there are no entries present in the
* VLVF that contain our VLAN * VLVF that contain our VLAN
*/ */
first_empty_slot = vlvf_bypass ? IXGBE_ERR_NO_SPACE : 0; first_empty_slot = vlvf_bypass ? -ENOSPC : 0;
/* add VLAN enable bit for comparison */ /* add VLAN enable bit for comparison */
vlan |= IXGBE_VLVF_VIEN; vlan |= IXGBE_VLVF_VIEN;
...@@ -3114,7 +3102,7 @@ static s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan, bool vlvf_bypass) ...@@ -3114,7 +3102,7 @@ static s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan, bool vlvf_bypass)
if (!first_empty_slot) if (!first_empty_slot)
hw_dbg(hw, "No space in VLVF.\n"); hw_dbg(hw, "No space in VLVF.\n");
return first_empty_slot ? : IXGBE_ERR_NO_SPACE; return first_empty_slot ? : -ENOSPC;
} }
/** /**
...@@ -3134,7 +3122,7 @@ s32 ixgbe_set_vfta_generic(struct ixgbe_hw *hw, u32 vlan, u32 vind, ...@@ -3134,7 +3122,7 @@ s32 ixgbe_set_vfta_generic(struct ixgbe_hw *hw, u32 vlan, u32 vind,
s32 vlvf_index; s32 vlvf_index;
if ((vlan > 4095) || (vind > 63)) if ((vlan > 4095) || (vind > 63))
return IXGBE_ERR_PARAM; return -EINVAL;
/* /*
* this is a 2 part operation - first the VFTA, then the * this is a 2 part operation - first the VFTA, then the
...@@ -3610,7 +3598,8 @@ u8 ixgbe_calculate_checksum(u8 *buffer, u32 length) ...@@ -3610,7 +3598,8 @@ u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)
* *
* Communicates with the manageability block. On success return 0 * Communicates with the manageability block. On success return 0
* else returns semaphore error when encountering an error acquiring * else returns semaphore error when encountering an error acquiring
* semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails. * semaphore, -EINVAL when incorrect parameters passed or -EIO when
* command fails.
* *
* This function assumes that the IXGBE_GSSR_SW_MNG_SM semaphore is held * This function assumes that the IXGBE_GSSR_SW_MNG_SM semaphore is held
* by the caller. * by the caller.
...@@ -3623,7 +3612,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length, ...@@ -3623,7 +3612,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
if (!length || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) { if (!length || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) {
hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length); hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length);
return IXGBE_ERR_HOST_INTERFACE_COMMAND; return -EINVAL;
} }
/* Set bit 9 of FWSTS clearing FW reset indication */ /* Set bit 9 of FWSTS clearing FW reset indication */
...@@ -3634,13 +3623,13 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length, ...@@ -3634,13 +3623,13 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
hicr = IXGBE_READ_REG(hw, IXGBE_HICR); hicr = IXGBE_READ_REG(hw, IXGBE_HICR);
if (!(hicr & IXGBE_HICR_EN)) { if (!(hicr & IXGBE_HICR_EN)) {
hw_dbg(hw, "IXGBE_HOST_EN bit disabled.\n"); hw_dbg(hw, "IXGBE_HOST_EN bit disabled.\n");
return IXGBE_ERR_HOST_INTERFACE_COMMAND; return -EIO;
} }
/* Calculate length in DWORDs. We must be DWORD aligned */ /* Calculate length in DWORDs. We must be DWORD aligned */
if (length % sizeof(u32)) { if (length % sizeof(u32)) {
hw_dbg(hw, "Buffer length failure, not aligned to dword"); hw_dbg(hw, "Buffer length failure, not aligned to dword");
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
} }
dword_len = length >> 2; dword_len = length >> 2;
...@@ -3665,7 +3654,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length, ...@@ -3665,7 +3654,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
/* Check command successful completion. */ /* Check command successful completion. */
if ((timeout && i == timeout) || if ((timeout && i == timeout) ||
!(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV)) !(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV))
return IXGBE_ERR_HOST_INTERFACE_COMMAND; return -EIO;
return 0; return 0;
} }
...@@ -3685,7 +3674,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length, ...@@ -3685,7 +3674,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
* in these cases. * in these cases.
* *
* Communicates with the manageability block. On success return 0 * Communicates with the manageability block. On success return 0
* else return IXGBE_ERR_HOST_INTERFACE_COMMAND. * else return -EIO or -EINVAL.
**/ **/
s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer, s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,
u32 length, u32 timeout, u32 length, u32 timeout,
...@@ -3700,7 +3689,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer, ...@@ -3700,7 +3689,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,
if (!length || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) { if (!length || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) {
hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length); hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length);
return IXGBE_ERR_HOST_INTERFACE_COMMAND; return -EINVAL;
} }
/* Take management host interface semaphore */ /* Take management host interface semaphore */
status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM); status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM);
...@@ -3730,7 +3719,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer, ...@@ -3730,7 +3719,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,
if (length < round_up(buf_len, 4) + hdr_size) { if (length < round_up(buf_len, 4) + hdr_size) {
hw_dbg(hw, "Buffer not large enough for reply message.\n"); hw_dbg(hw, "Buffer not large enough for reply message.\n");
status = IXGBE_ERR_HOST_INTERFACE_COMMAND; status = -EIO;
goto rel_out; goto rel_out;
} }
...@@ -3761,8 +3750,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer, ...@@ -3761,8 +3750,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,
* *
* Sends driver version number to firmware through the manageability * Sends driver version number to firmware through the manageability
* block. On success return 0 * block. On success return 0
* else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring * else returns -EBUSY when encountering an error acquiring
* semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails. * semaphore or -EIO when command fails.
**/ **/
s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min, s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
u8 build, u8 sub, __always_unused u16 len, u8 build, u8 sub, __always_unused u16 len,
...@@ -3798,7 +3787,7 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min, ...@@ -3798,7 +3787,7 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
FW_CEM_RESP_STATUS_SUCCESS) FW_CEM_RESP_STATUS_SUCCESS)
ret_val = 0; ret_val = 0;
else else
ret_val = IXGBE_ERR_HOST_INTERFACE_COMMAND; ret_val = -EIO;
break; break;
} }
...@@ -3896,14 +3885,14 @@ static s32 ixgbe_get_ets_data(struct ixgbe_hw *hw, u16 *ets_cfg, ...@@ -3896,14 +3885,14 @@ static s32 ixgbe_get_ets_data(struct ixgbe_hw *hw, u16 *ets_cfg,
return status; return status;
if ((*ets_offset == 0x0000) || (*ets_offset == 0xFFFF)) if ((*ets_offset == 0x0000) || (*ets_offset == 0xFFFF))
return IXGBE_NOT_IMPLEMENTED; return -EOPNOTSUPP;
status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg); status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg);
if (status) if (status)
return status; return status;
if ((*ets_cfg & IXGBE_ETS_TYPE_MASK) != IXGBE_ETS_TYPE_EMC_SHIFTED) if ((*ets_cfg & IXGBE_ETS_TYPE_MASK) != IXGBE_ETS_TYPE_EMC_SHIFTED)
return IXGBE_NOT_IMPLEMENTED; return -EOPNOTSUPP;
return 0; return 0;
} }
...@@ -3926,7 +3915,7 @@ s32 ixgbe_get_thermal_sensor_data_generic(struct ixgbe_hw *hw) ...@@ -3926,7 +3915,7 @@ s32 ixgbe_get_thermal_sensor_data_generic(struct ixgbe_hw *hw)
/* Only support thermal sensors attached to physical port 0 */ /* Only support thermal sensors attached to physical port 0 */
if ((IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1)) if ((IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1))
return IXGBE_NOT_IMPLEMENTED; return -EOPNOTSUPP;
status = ixgbe_get_ets_data(hw, &ets_cfg, &ets_offset); status = ixgbe_get_ets_data(hw, &ets_cfg, &ets_offset);
if (status) if (status)
...@@ -3986,7 +3975,7 @@ s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw) ...@@ -3986,7 +3975,7 @@ s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw)
/* Only support thermal sensors attached to physical port 0 */ /* Only support thermal sensors attached to physical port 0 */
if ((IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1)) if ((IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1))
return IXGBE_NOT_IMPLEMENTED; return -EOPNOTSUPP;
status = ixgbe_get_ets_data(hw, &ets_cfg, &ets_offset); status = ixgbe_get_ets_data(hw, &ets_cfg, &ets_offset);
if (status) if (status)
......
...@@ -3372,7 +3372,7 @@ static int ixgbe_get_module_eeprom(struct net_device *dev, ...@@ -3372,7 +3372,7 @@ static int ixgbe_get_module_eeprom(struct net_device *dev,
{ {
struct ixgbe_adapter *adapter = netdev_priv(dev); struct ixgbe_adapter *adapter = netdev_priv(dev);
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
s32 status = IXGBE_ERR_PHY_ADDR_INVALID; s32 status = -EFAULT;
u8 databyte = 0xFF; u8 databyte = 0xFF;
int i = 0; int i = 0;
......
...@@ -5510,7 +5510,7 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) ...@@ -5510,7 +5510,7 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
{ {
u32 speed; u32 speed;
bool autoneg, link_up = false; bool autoneg, link_up = false;
int ret = IXGBE_ERR_LINK_SETUP; int ret = -EIO;
if (hw->mac.ops.check_link) if (hw->mac.ops.check_link)
ret = hw->mac.ops.check_link(hw, &speed, &link_up, false); ret = hw->mac.ops.check_link(hw, &speed, &link_up, false);
...@@ -5981,13 +5981,13 @@ void ixgbe_reset(struct ixgbe_adapter *adapter) ...@@ -5981,13 +5981,13 @@ void ixgbe_reset(struct ixgbe_adapter *adapter)
err = hw->mac.ops.init_hw(hw); err = hw->mac.ops.init_hw(hw);
switch (err) { switch (err) {
case 0: case 0:
case IXGBE_ERR_SFP_NOT_PRESENT: case -ENOENT:
case IXGBE_ERR_SFP_NOT_SUPPORTED: case -EOPNOTSUPP:
break; break;
case IXGBE_ERR_PRIMARY_REQUESTS_PENDING: case -EALREADY:
e_dev_err("primary disable timed out\n"); e_dev_err("primary disable timed out\n");
break; break;
case IXGBE_ERR_EEPROM_VERSION: case -EACCES:
/* We are running on a pre-production device, log a warning */ /* We are running on a pre-production device, log a warning */
e_dev_warn("This device is a pre-production adapter/LOM. " e_dev_warn("This device is a pre-production adapter/LOM. "
"Please be aware there may be issues associated with " "Please be aware there may be issues associated with "
...@@ -7827,10 +7827,10 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter) ...@@ -7827,10 +7827,10 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
adapter->sfp_poll_time = jiffies + IXGBE_SFP_POLL_JIFFIES - 1; adapter->sfp_poll_time = jiffies + IXGBE_SFP_POLL_JIFFIES - 1;
err = hw->phy.ops.identify_sfp(hw); err = hw->phy.ops.identify_sfp(hw);
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) if (err == -EOPNOTSUPP)
goto sfp_out; goto sfp_out;
if (err == IXGBE_ERR_SFP_NOT_PRESENT) { if (err == -ENOENT) {
/* If no cable is present, then we need to reset /* If no cable is present, then we need to reset
* the next time we find a good cable. */ * the next time we find a good cable. */
adapter->flags2 |= IXGBE_FLAG2_SFP_NEEDS_RESET; adapter->flags2 |= IXGBE_FLAG2_SFP_NEEDS_RESET;
...@@ -7856,7 +7856,7 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter) ...@@ -7856,7 +7856,7 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
else else
err = hw->mac.ops.setup_sfp(hw); err = hw->mac.ops.setup_sfp(hw);
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) if (err == -EOPNOTSUPP)
goto sfp_out; goto sfp_out;
adapter->flags |= IXGBE_FLAG_NEED_LINK_CONFIG; adapter->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
...@@ -7865,8 +7865,8 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter) ...@@ -7865,8 +7865,8 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
sfp_out: sfp_out:
clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state); clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);
if ((err == IXGBE_ERR_SFP_NOT_SUPPORTED) && if (err == -EOPNOTSUPP &&
(adapter->netdev->reg_state == NETREG_REGISTERED)) { adapter->netdev->reg_state == NETREG_REGISTERED) {
e_dev_err("failed to initialize because an unsupported " e_dev_err("failed to initialize because an unsupported "
"SFP+ module type was detected.\n"); "SFP+ module type was detected.\n");
e_dev_err("Reload the driver after installing a " e_dev_err("Reload the driver after installing a "
...@@ -10918,9 +10918,9 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -10918,9 +10918,9 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err = hw->mac.ops.reset_hw(hw); err = hw->mac.ops.reset_hw(hw);
hw->phy.reset_if_overtemp = false; hw->phy.reset_if_overtemp = false;
ixgbe_set_eee_capable(adapter); ixgbe_set_eee_capable(adapter);
if (err == IXGBE_ERR_SFP_NOT_PRESENT) { if (err == -ENOENT) {
err = 0; err = 0;
} else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { } else if (err == -EOPNOTSUPP) {
e_dev_err("failed to load because an unsupported SFP+ or QSFP module type was detected.\n"); e_dev_err("failed to load because an unsupported SFP+ or QSFP module type was detected.\n");
e_dev_err("Reload the driver after installing a supported module.\n"); e_dev_err("Reload the driver after installing a supported module.\n");
goto err_sw_init; goto err_sw_init;
...@@ -11139,7 +11139,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -11139,7 +11139,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* reset the hardware with the new settings */ /* reset the hardware with the new settings */
err = hw->mac.ops.start_hw(hw); err = hw->mac.ops.start_hw(hw);
if (err == IXGBE_ERR_EEPROM_VERSION) { if (err == -EACCES) {
/* We are running on a pre-production device, log a warning */ /* We are running on a pre-production device, log a warning */
e_dev_warn("This device is a pre-production adapter/LOM. " e_dev_warn("This device is a pre-production adapter/LOM. "
"Please be aware there may be issues associated " "Please be aware there may be issues associated "
......
...@@ -24,7 +24,7 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) ...@@ -24,7 +24,7 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
size = mbx->size; size = mbx->size;
if (!mbx->ops) if (!mbx->ops)
return IXGBE_ERR_MBX; return -EIO;
return mbx->ops->read(hw, msg, size, mbx_id); return mbx->ops->read(hw, msg, size, mbx_id);
} }
...@@ -43,10 +43,10 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) ...@@ -43,10 +43,10 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
struct ixgbe_mbx_info *mbx = &hw->mbx; struct ixgbe_mbx_info *mbx = &hw->mbx;
if (size > mbx->size) if (size > mbx->size)
return IXGBE_ERR_MBX; return -EINVAL;
if (!mbx->ops) if (!mbx->ops)
return IXGBE_ERR_MBX; return -EIO;
return mbx->ops->write(hw, msg, size, mbx_id); return mbx->ops->write(hw, msg, size, mbx_id);
} }
...@@ -63,7 +63,7 @@ s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id) ...@@ -63,7 +63,7 @@ s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
struct ixgbe_mbx_info *mbx = &hw->mbx; struct ixgbe_mbx_info *mbx = &hw->mbx;
if (!mbx->ops) if (!mbx->ops)
return IXGBE_ERR_MBX; return -EIO;
return mbx->ops->check_for_msg(hw, mbx_id); return mbx->ops->check_for_msg(hw, mbx_id);
} }
...@@ -80,7 +80,7 @@ s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id) ...@@ -80,7 +80,7 @@ s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
struct ixgbe_mbx_info *mbx = &hw->mbx; struct ixgbe_mbx_info *mbx = &hw->mbx;
if (!mbx->ops) if (!mbx->ops)
return IXGBE_ERR_MBX; return -EIO;
return mbx->ops->check_for_ack(hw, mbx_id); return mbx->ops->check_for_ack(hw, mbx_id);
} }
...@@ -97,7 +97,7 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id) ...@@ -97,7 +97,7 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id)
struct ixgbe_mbx_info *mbx = &hw->mbx; struct ixgbe_mbx_info *mbx = &hw->mbx;
if (!mbx->ops) if (!mbx->ops)
return IXGBE_ERR_MBX; return -EIO;
return mbx->ops->check_for_rst(hw, mbx_id); return mbx->ops->check_for_rst(hw, mbx_id);
} }
...@@ -115,12 +115,12 @@ static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id) ...@@ -115,12 +115,12 @@ static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
int countdown = mbx->timeout; int countdown = mbx->timeout;
if (!countdown || !mbx->ops) if (!countdown || !mbx->ops)
return IXGBE_ERR_MBX; return -EIO;
while (mbx->ops->check_for_msg(hw, mbx_id)) { while (mbx->ops->check_for_msg(hw, mbx_id)) {
countdown--; countdown--;
if (!countdown) if (!countdown)
return IXGBE_ERR_MBX; return -EIO;
udelay(mbx->usec_delay); udelay(mbx->usec_delay);
} }
...@@ -140,12 +140,12 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id) ...@@ -140,12 +140,12 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
int countdown = mbx->timeout; int countdown = mbx->timeout;
if (!countdown || !mbx->ops) if (!countdown || !mbx->ops)
return IXGBE_ERR_MBX; return -EIO;
while (mbx->ops->check_for_ack(hw, mbx_id)) { while (mbx->ops->check_for_ack(hw, mbx_id)) {
countdown--; countdown--;
if (!countdown) if (!countdown)
return IXGBE_ERR_MBX; return -EIO;
udelay(mbx->usec_delay); udelay(mbx->usec_delay);
} }
...@@ -169,7 +169,7 @@ static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, ...@@ -169,7 +169,7 @@ static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
s32 ret_val; s32 ret_val;
if (!mbx->ops) if (!mbx->ops)
return IXGBE_ERR_MBX; return -EIO;
ret_val = ixgbe_poll_for_msg(hw, mbx_id); ret_val = ixgbe_poll_for_msg(hw, mbx_id);
if (ret_val) if (ret_val)
...@@ -197,7 +197,7 @@ static s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, ...@@ -197,7 +197,7 @@ static s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
/* exit if either we can't write or there isn't a defined timeout */ /* exit if either we can't write or there isn't a defined timeout */
if (!mbx->ops || !mbx->timeout) if (!mbx->ops || !mbx->timeout)
return IXGBE_ERR_MBX; return -EIO;
/* send msg */ /* send msg */
ret_val = mbx->ops->write(hw, msg, size, mbx_id); ret_val = mbx->ops->write(hw, msg, size, mbx_id);
...@@ -217,7 +217,7 @@ static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index) ...@@ -217,7 +217,7 @@ static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index)
return 0; return 0;
} }
return IXGBE_ERR_MBX; return -EIO;
} }
/** /**
...@@ -238,7 +238,7 @@ static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number) ...@@ -238,7 +238,7 @@ static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number)
return 0; return 0;
} }
return IXGBE_ERR_MBX; return -EIO;
} }
/** /**
...@@ -259,7 +259,7 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number) ...@@ -259,7 +259,7 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number)
return 0; return 0;
} }
return IXGBE_ERR_MBX; return -EIO;
} }
/** /**
...@@ -295,7 +295,7 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number) ...@@ -295,7 +295,7 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number)
return 0; return 0;
} }
return IXGBE_ERR_MBX; return -EIO;
} }
/** /**
...@@ -317,7 +317,7 @@ static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number) ...@@ -317,7 +317,7 @@ static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number)
if (p2v_mailbox & IXGBE_PFMAILBOX_PFU) if (p2v_mailbox & IXGBE_PFMAILBOX_PFU)
return 0; return 0;
return IXGBE_ERR_MBX; return -EIO;
} }
/** /**
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "ixgbe_type.h" #include "ixgbe_type.h"
#define IXGBE_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */ #define IXGBE_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */
#define IXGBE_ERR_MBX -100
#define IXGBE_VFMAILBOX 0x002FC #define IXGBE_VFMAILBOX 0x002FC
#define IXGBE_VFMBMEM 0x00200 #define IXGBE_VFMBMEM 0x00200
......
...@@ -102,7 +102,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, ...@@ -102,7 +102,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
csum = ~csum; csum = ~csum;
do { do {
if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask)) if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
ixgbe_i2c_start(hw); ixgbe_i2c_start(hw);
/* Device Address and write indication */ /* Device Address and write indication */
if (ixgbe_out_i2c_byte_ack(hw, addr)) if (ixgbe_out_i2c_byte_ack(hw, addr))
...@@ -150,7 +150,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, ...@@ -150,7 +150,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
hw_dbg(hw, "I2C byte read combined error.\n"); hw_dbg(hw, "I2C byte read combined error.\n");
} while (retry < max_retry); } while (retry < max_retry);
return IXGBE_ERR_I2C; return -EIO;
} }
/** /**
...@@ -179,7 +179,7 @@ s32 ixgbe_write_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, ...@@ -179,7 +179,7 @@ s32 ixgbe_write_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
csum = ~csum; csum = ~csum;
do { do {
if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask)) if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
ixgbe_i2c_start(hw); ixgbe_i2c_start(hw);
/* Device Address and write indication */ /* Device Address and write indication */
if (ixgbe_out_i2c_byte_ack(hw, addr)) if (ixgbe_out_i2c_byte_ack(hw, addr))
...@@ -215,7 +215,7 @@ s32 ixgbe_write_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, ...@@ -215,7 +215,7 @@ s32 ixgbe_write_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
hw_dbg(hw, "I2C byte write combined error.\n"); hw_dbg(hw, "I2C byte write combined error.\n");
} while (retry < max_retry); } while (retry < max_retry);
return IXGBE_ERR_I2C; return -EIO;
} }
/** /**
...@@ -262,8 +262,8 @@ static bool ixgbe_probe_phy(struct ixgbe_hw *hw, u16 phy_addr) ...@@ -262,8 +262,8 @@ static bool ixgbe_probe_phy(struct ixgbe_hw *hw, u16 phy_addr)
**/ **/
s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw) s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
{ {
u32 status = -EFAULT;
u32 phy_addr; u32 phy_addr;
u32 status = IXGBE_ERR_PHY_ADDR_INVALID;
if (!hw->phy.phy_semaphore_mask) { if (!hw->phy.phy_semaphore_mask) {
if (hw->bus.lan_id) if (hw->bus.lan_id)
...@@ -281,7 +281,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw) ...@@ -281,7 +281,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
if (ixgbe_probe_phy(hw, phy_addr)) if (ixgbe_probe_phy(hw, phy_addr))
return 0; return 0;
else else
return IXGBE_ERR_PHY_ADDR_INVALID; return -EFAULT;
} }
for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) { for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) {
...@@ -455,7 +455,7 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw) ...@@ -455,7 +455,7 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
if (ctrl & MDIO_CTRL1_RESET) { if (ctrl & MDIO_CTRL1_RESET) {
hw_dbg(hw, "PHY reset polling failed to complete.\n"); hw_dbg(hw, "PHY reset polling failed to complete.\n");
return IXGBE_ERR_RESET_FAILED; return -EIO;
} }
return 0; return 0;
...@@ -498,7 +498,7 @@ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, ...@@ -498,7 +498,7 @@ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) { if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
hw_dbg(hw, "PHY address command did not complete.\n"); hw_dbg(hw, "PHY address command did not complete.\n");
return IXGBE_ERR_PHY; return -EIO;
} }
/* Address cycle complete, setup and write the read /* Address cycle complete, setup and write the read
...@@ -525,7 +525,7 @@ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, ...@@ -525,7 +525,7 @@ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) { if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
hw_dbg(hw, "PHY read command didn't complete\n"); hw_dbg(hw, "PHY read command didn't complete\n");
return IXGBE_ERR_PHY; return -EIO;
} }
/* Read operation is complete. Get the data /* Read operation is complete. Get the data
...@@ -557,7 +557,7 @@ s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr, ...@@ -557,7 +557,7 @@ s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
phy_data); phy_data);
hw->mac.ops.release_swfw_sync(hw, gssr); hw->mac.ops.release_swfw_sync(hw, gssr);
} else { } else {
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
} }
return status; return status;
...@@ -602,7 +602,7 @@ s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, ...@@ -602,7 +602,7 @@ s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr,
if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) { if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
hw_dbg(hw, "PHY address cmd didn't complete\n"); hw_dbg(hw, "PHY address cmd didn't complete\n");
return IXGBE_ERR_PHY; return -EIO;
} }
/* /*
...@@ -630,7 +630,7 @@ s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, ...@@ -630,7 +630,7 @@ s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr,
if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) { if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
hw_dbg(hw, "PHY write cmd didn't complete\n"); hw_dbg(hw, "PHY write cmd didn't complete\n");
return IXGBE_ERR_PHY; return -EIO;
} }
return 0; return 0;
...@@ -655,7 +655,7 @@ s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr, ...@@ -655,7 +655,7 @@ s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
phy_data); phy_data);
hw->mac.ops.release_swfw_sync(hw, gssr); hw->mac.ops.release_swfw_sync(hw, gssr);
} else { } else {
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
} }
return status; return status;
...@@ -1428,7 +1428,7 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw) ...@@ -1428,7 +1428,7 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw)
if ((phy_data & MDIO_CTRL1_RESET) != 0) { if ((phy_data & MDIO_CTRL1_RESET) != 0) {
hw_dbg(hw, "PHY reset did not complete.\n"); hw_dbg(hw, "PHY reset did not complete.\n");
return IXGBE_ERR_PHY; return -EIO;
} }
/* Get init offsets */ /* Get init offsets */
...@@ -1484,12 +1484,12 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw) ...@@ -1484,12 +1484,12 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw)
hw_dbg(hw, "SOL\n"); hw_dbg(hw, "SOL\n");
} else { } else {
hw_dbg(hw, "Bad control value\n"); hw_dbg(hw, "Bad control value\n");
return IXGBE_ERR_PHY; return -EIO;
} }
break; break;
default: default:
hw_dbg(hw, "Bad control type\n"); hw_dbg(hw, "Bad control type\n");
return IXGBE_ERR_PHY; return -EIO;
} }
} }
...@@ -1497,7 +1497,7 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw) ...@@ -1497,7 +1497,7 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw)
err_eeprom: err_eeprom:
hw_err(hw, "eeprom read at offset %d failed\n", data_offset); hw_err(hw, "eeprom read at offset %d failed\n", data_offset);
return IXGBE_ERR_PHY; return -EIO;
} }
/** /**
...@@ -1515,10 +1515,10 @@ s32 ixgbe_identify_module_generic(struct ixgbe_hw *hw) ...@@ -1515,10 +1515,10 @@ s32 ixgbe_identify_module_generic(struct ixgbe_hw *hw)
return ixgbe_identify_qsfp_module_generic(hw); return ixgbe_identify_qsfp_module_generic(hw);
default: default:
hw->phy.sfp_type = ixgbe_sfp_type_not_present; hw->phy.sfp_type = ixgbe_sfp_type_not_present;
return IXGBE_ERR_SFP_NOT_PRESENT; return -ENOENT;
} }
return IXGBE_ERR_SFP_NOT_PRESENT; return -ENOENT;
} }
/** /**
...@@ -1543,7 +1543,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) ...@@ -1543,7 +1543,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber) { if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber) {
hw->phy.sfp_type = ixgbe_sfp_type_not_present; hw->phy.sfp_type = ixgbe_sfp_type_not_present;
return IXGBE_ERR_SFP_NOT_PRESENT; return -ENOENT;
} }
/* LAN ID is needed for sfp_type determination */ /* LAN ID is needed for sfp_type determination */
...@@ -1558,7 +1558,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) ...@@ -1558,7 +1558,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
if (identifier != IXGBE_SFF_IDENTIFIER_SFP) { if (identifier != IXGBE_SFF_IDENTIFIER_SFP) {
hw->phy.type = ixgbe_phy_sfp_unsupported; hw->phy.type = ixgbe_phy_sfp_unsupported;
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} }
status = hw->phy.ops.read_i2c_eeprom(hw, status = hw->phy.ops.read_i2c_eeprom(hw,
IXGBE_SFF_1GBE_COMP_CODES, IXGBE_SFF_1GBE_COMP_CODES,
...@@ -1749,7 +1749,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) ...@@ -1749,7 +1749,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) { hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
hw->phy.type = ixgbe_phy_sfp_unsupported; hw->phy.type = ixgbe_phy_sfp_unsupported;
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} }
/* Anything else 82598-based is supported */ /* Anything else 82598-based is supported */
...@@ -1773,7 +1773,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) ...@@ -1773,7 +1773,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
} }
hw_dbg(hw, "SFP+ module not supported\n"); hw_dbg(hw, "SFP+ module not supported\n");
hw->phy.type = ixgbe_phy_sfp_unsupported; hw->phy.type = ixgbe_phy_sfp_unsupported;
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} }
return 0; return 0;
...@@ -1783,7 +1783,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) ...@@ -1783,7 +1783,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
hw->phy.id = 0; hw->phy.id = 0;
hw->phy.type = ixgbe_phy_unknown; hw->phy.type = ixgbe_phy_unknown;
} }
return IXGBE_ERR_SFP_NOT_PRESENT; return -ENOENT;
} }
/** /**
...@@ -1810,7 +1810,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) ...@@ -1810,7 +1810,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber_qsfp) { if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber_qsfp) {
hw->phy.sfp_type = ixgbe_sfp_type_not_present; hw->phy.sfp_type = ixgbe_sfp_type_not_present;
return IXGBE_ERR_SFP_NOT_PRESENT; return -ENOENT;
} }
/* LAN ID is needed for sfp_type determination */ /* LAN ID is needed for sfp_type determination */
...@@ -1824,7 +1824,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) ...@@ -1824,7 +1824,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
if (identifier != IXGBE_SFF_IDENTIFIER_QSFP_PLUS) { if (identifier != IXGBE_SFF_IDENTIFIER_QSFP_PLUS) {
hw->phy.type = ixgbe_phy_sfp_unsupported; hw->phy.type = ixgbe_phy_sfp_unsupported;
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} }
hw->phy.id = identifier; hw->phy.id = identifier;
...@@ -1892,7 +1892,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) ...@@ -1892,7 +1892,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
} else { } else {
/* unsupported module type */ /* unsupported module type */
hw->phy.type = ixgbe_phy_sfp_unsupported; hw->phy.type = ixgbe_phy_sfp_unsupported;
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} }
} }
...@@ -1952,7 +1952,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) ...@@ -1952,7 +1952,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
} }
hw_dbg(hw, "QSFP module not supported\n"); hw_dbg(hw, "QSFP module not supported\n");
hw->phy.type = ixgbe_phy_sfp_unsupported; hw->phy.type = ixgbe_phy_sfp_unsupported;
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} }
return 0; return 0;
} }
...@@ -1963,7 +1963,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) ...@@ -1963,7 +1963,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
hw->phy.id = 0; hw->phy.id = 0;
hw->phy.type = ixgbe_phy_unknown; hw->phy.type = ixgbe_phy_unknown;
return IXGBE_ERR_SFP_NOT_PRESENT; return -ENOENT;
} }
/** /**
...@@ -1983,14 +1983,14 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, ...@@ -1983,14 +1983,14 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
u16 sfp_type = hw->phy.sfp_type; u16 sfp_type = hw->phy.sfp_type;
if (hw->phy.sfp_type == ixgbe_sfp_type_unknown) if (hw->phy.sfp_type == ixgbe_sfp_type_unknown)
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
if (hw->phy.sfp_type == ixgbe_sfp_type_not_present) if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
return IXGBE_ERR_SFP_NOT_PRESENT; return -ENOENT;
if ((hw->device_id == IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM) && if ((hw->device_id == IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM) &&
(hw->phy.sfp_type == ixgbe_sfp_type_da_cu)) (hw->phy.sfp_type == ixgbe_sfp_type_da_cu))
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
/* /*
* Limiting active cables and 1G Phys must be initialized as * Limiting active cables and 1G Phys must be initialized as
...@@ -2011,11 +2011,11 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, ...@@ -2011,11 +2011,11 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
if (hw->eeprom.ops.read(hw, IXGBE_PHY_INIT_OFFSET_NL, list_offset)) { if (hw->eeprom.ops.read(hw, IXGBE_PHY_INIT_OFFSET_NL, list_offset)) {
hw_err(hw, "eeprom read at %d failed\n", hw_err(hw, "eeprom read at %d failed\n",
IXGBE_PHY_INIT_OFFSET_NL); IXGBE_PHY_INIT_OFFSET_NL);
return IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT; return -EIO;
} }
if ((!*list_offset) || (*list_offset == 0xFFFF)) if ((!*list_offset) || (*list_offset == 0xFFFF))
return IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT; return -EIO;
/* Shift offset to first ID word */ /* Shift offset to first ID word */
(*list_offset)++; (*list_offset)++;
...@@ -2034,7 +2034,7 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, ...@@ -2034,7 +2034,7 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
goto err_phy; goto err_phy;
if ((!*data_offset) || (*data_offset == 0xFFFF)) { if ((!*data_offset) || (*data_offset == 0xFFFF)) {
hw_dbg(hw, "SFP+ module not supported\n"); hw_dbg(hw, "SFP+ module not supported\n");
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} else { } else {
break; break;
} }
...@@ -2047,14 +2047,14 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, ...@@ -2047,14 +2047,14 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
if (sfp_id == IXGBE_PHY_INIT_END_NL) { if (sfp_id == IXGBE_PHY_INIT_END_NL) {
hw_dbg(hw, "No matching SFP+ module found\n"); hw_dbg(hw, "No matching SFP+ module found\n");
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} }
return 0; return 0;
err_phy: err_phy:
hw_err(hw, "eeprom read at offset %d failed\n", *list_offset); hw_err(hw, "eeprom read at offset %d failed\n", *list_offset);
return IXGBE_ERR_PHY; return -EIO;
} }
/** /**
...@@ -2149,7 +2149,7 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, ...@@ -2149,7 +2149,7 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset,
do { do {
if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask)) if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
ixgbe_i2c_start(hw); ixgbe_i2c_start(hw);
...@@ -2265,7 +2265,7 @@ static s32 ixgbe_write_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, ...@@ -2265,7 +2265,7 @@ static s32 ixgbe_write_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset,
u32 swfw_mask = hw->phy.phy_semaphore_mask; u32 swfw_mask = hw->phy.phy_semaphore_mask;
if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask)) if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
do { do {
ixgbe_i2c_start(hw); ixgbe_i2c_start(hw);
...@@ -2507,7 +2507,7 @@ static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw) ...@@ -2507,7 +2507,7 @@ static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw)
if (ack == 1) { if (ack == 1) {
hw_dbg(hw, "I2C ack was not received.\n"); hw_dbg(hw, "I2C ack was not received.\n");
status = IXGBE_ERR_I2C; status = -EIO;
} }
ixgbe_lower_i2c_clk(hw, &i2cctl); ixgbe_lower_i2c_clk(hw, &i2cctl);
...@@ -2579,7 +2579,7 @@ static s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data) ...@@ -2579,7 +2579,7 @@ static s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data)
udelay(IXGBE_I2C_T_LOW); udelay(IXGBE_I2C_T_LOW);
} else { } else {
hw_dbg(hw, "I2C data was not set to %X\n", data); hw_dbg(hw, "I2C data was not set to %X\n", data);
return IXGBE_ERR_I2C; return -EIO;
} }
return 0; return 0;
...@@ -2675,7 +2675,7 @@ static s32 ixgbe_set_i2c_data(struct ixgbe_hw *hw, u32 *i2cctl, bool data) ...@@ -2675,7 +2675,7 @@ static s32 ixgbe_set_i2c_data(struct ixgbe_hw *hw, u32 *i2cctl, bool data)
*i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL(hw)); *i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL(hw));
if (data != ixgbe_get_i2c_data(hw, i2cctl)) { if (data != ixgbe_get_i2c_data(hw, i2cctl)) {
hw_dbg(hw, "Error - I2C data was not set to %X.\n", data); hw_dbg(hw, "Error - I2C data was not set to %X.\n", data);
return IXGBE_ERR_I2C; return -EIO;
} }
return 0; return 0;
......
...@@ -1325,7 +1325,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) ...@@ -1325,7 +1325,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
break; break;
default: default:
e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]); e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]);
retval = IXGBE_ERR_MBX; retval = -EIO;
break; break;
} }
......
...@@ -3665,45 +3665,6 @@ struct ixgbe_info { ...@@ -3665,45 +3665,6 @@ struct ixgbe_info {
const u32 *mvals; const u32 *mvals;
}; };
/* Error Codes */
#define IXGBE_ERR_EEPROM -1
#define IXGBE_ERR_EEPROM_CHECKSUM -2
#define IXGBE_ERR_PHY -3
#define IXGBE_ERR_CONFIG -4
#define IXGBE_ERR_PARAM -5
#define IXGBE_ERR_MAC_TYPE -6
#define IXGBE_ERR_UNKNOWN_PHY -7
#define IXGBE_ERR_LINK_SETUP -8
#define IXGBE_ERR_ADAPTER_STOPPED -9
#define IXGBE_ERR_INVALID_MAC_ADDR -10
#define IXGBE_ERR_DEVICE_NOT_SUPPORTED -11
#define IXGBE_ERR_PRIMARY_REQUESTS_PENDING -12
#define IXGBE_ERR_INVALID_LINK_SETTINGS -13
#define IXGBE_ERR_AUTONEG_NOT_COMPLETE -14
#define IXGBE_ERR_RESET_FAILED -15
#define IXGBE_ERR_SWFW_SYNC -16
#define IXGBE_ERR_PHY_ADDR_INVALID -17
#define IXGBE_ERR_I2C -18
#define IXGBE_ERR_SFP_NOT_SUPPORTED -19
#define IXGBE_ERR_SFP_NOT_PRESENT -20
#define IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT -21
#define IXGBE_ERR_NO_SAN_ADDR_PTR -22
#define IXGBE_ERR_FDIR_REINIT_FAILED -23
#define IXGBE_ERR_EEPROM_VERSION -24
#define IXGBE_ERR_NO_SPACE -25
#define IXGBE_ERR_OVERTEMP -26
#define IXGBE_ERR_FC_NOT_NEGOTIATED -27
#define IXGBE_ERR_FC_NOT_SUPPORTED -28
#define IXGBE_ERR_SFP_SETUP_NOT_COMPLETE -30
#define IXGBE_ERR_PBA_SECTION -31
#define IXGBE_ERR_INVALID_ARGUMENT -32
#define IXGBE_ERR_HOST_INTERFACE_COMMAND -33
#define IXGBE_ERR_FDIR_CMD_INCOMPLETE -38
#define IXGBE_ERR_FW_RESP_INVALID -39
#define IXGBE_ERR_TOKEN_RETRY -40
#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF
#define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4)) #define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4))
#define IXGBE_FUSES0_300MHZ BIT(5) #define IXGBE_FUSES0_300MHZ BIT(5)
#define IXGBE_FUSES0_REV_MASK (3u << 6) #define IXGBE_FUSES0_REV_MASK (3u << 6)
......
...@@ -84,7 +84,7 @@ s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw) ...@@ -84,7 +84,7 @@ s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw)
status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
if (status) { if (status) {
hw_dbg(hw, "semaphore failed with %d", status); hw_dbg(hw, "semaphore failed with %d", status);
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
} }
ctrl = IXGBE_CTRL_RST; ctrl = IXGBE_CTRL_RST;
...@@ -103,7 +103,7 @@ s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw) ...@@ -103,7 +103,7 @@ s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw)
} }
if (ctrl & IXGBE_CTRL_RST_MASK) { if (ctrl & IXGBE_CTRL_RST_MASK) {
status = IXGBE_ERR_RESET_FAILED; status = -EIO;
hw_dbg(hw, "Reset polling failed to complete.\n"); hw_dbg(hw, "Reset polling failed to complete.\n");
} }
msleep(100); msleep(100);
...@@ -220,7 +220,7 @@ static s32 ixgbe_read_eerd_X540(struct ixgbe_hw *hw, u16 offset, u16 *data) ...@@ -220,7 +220,7 @@ static s32 ixgbe_read_eerd_X540(struct ixgbe_hw *hw, u16 offset, u16 *data)
s32 status; s32 status;
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
status = ixgbe_read_eerd_generic(hw, offset, data); status = ixgbe_read_eerd_generic(hw, offset, data);
...@@ -243,7 +243,7 @@ static s32 ixgbe_read_eerd_buffer_X540(struct ixgbe_hw *hw, ...@@ -243,7 +243,7 @@ static s32 ixgbe_read_eerd_buffer_X540(struct ixgbe_hw *hw,
s32 status; s32 status;
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
status = ixgbe_read_eerd_buffer_generic(hw, offset, words, data); status = ixgbe_read_eerd_buffer_generic(hw, offset, words, data);
...@@ -264,7 +264,7 @@ static s32 ixgbe_write_eewr_X540(struct ixgbe_hw *hw, u16 offset, u16 data) ...@@ -264,7 +264,7 @@ static s32 ixgbe_write_eewr_X540(struct ixgbe_hw *hw, u16 offset, u16 data)
s32 status; s32 status;
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
status = ixgbe_write_eewr_generic(hw, offset, data); status = ixgbe_write_eewr_generic(hw, offset, data);
...@@ -287,7 +287,7 @@ static s32 ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw, ...@@ -287,7 +287,7 @@ static s32 ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw,
s32 status; s32 status;
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
status = ixgbe_write_eewr_buffer_generic(hw, offset, words, data); status = ixgbe_write_eewr_buffer_generic(hw, offset, words, data);
...@@ -324,7 +324,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw) ...@@ -324,7 +324,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
for (i = 0; i < checksum_last_word; i++) { for (i = 0; i < checksum_last_word; i++) {
if (ixgbe_read_eerd_generic(hw, i, &word)) { if (ixgbe_read_eerd_generic(hw, i, &word)) {
hw_dbg(hw, "EEPROM read failed\n"); hw_dbg(hw, "EEPROM read failed\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
checksum += word; checksum += word;
} }
...@@ -349,7 +349,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw) ...@@ -349,7 +349,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
if (ixgbe_read_eerd_generic(hw, pointer, &length)) { if (ixgbe_read_eerd_generic(hw, pointer, &length)) {
hw_dbg(hw, "EEPROM read failed\n"); hw_dbg(hw, "EEPROM read failed\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
/* Skip pointer section if length is invalid. */ /* Skip pointer section if length is invalid. */
...@@ -360,7 +360,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw) ...@@ -360,7 +360,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
for (j = pointer + 1; j <= pointer + length; j++) { for (j = pointer + 1; j <= pointer + length; j++) {
if (ixgbe_read_eerd_generic(hw, j, &word)) { if (ixgbe_read_eerd_generic(hw, j, &word)) {
hw_dbg(hw, "EEPROM read failed\n"); hw_dbg(hw, "EEPROM read failed\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
checksum += word; checksum += word;
} }
...@@ -397,7 +397,7 @@ static s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw, ...@@ -397,7 +397,7 @@ static s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw,
} }
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
status = hw->eeprom.ops.calc_checksum(hw); status = hw->eeprom.ops.calc_checksum(hw);
if (status < 0) if (status < 0)
...@@ -418,7 +418,7 @@ static s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw, ...@@ -418,7 +418,7 @@ static s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw,
*/ */
if (read_checksum != checksum) { if (read_checksum != checksum) {
hw_dbg(hw, "Invalid EEPROM checksum"); hw_dbg(hw, "Invalid EEPROM checksum");
status = IXGBE_ERR_EEPROM_CHECKSUM; status = -EIO;
} }
/* If the user cares, return the calculated checksum */ /* If the user cares, return the calculated checksum */
...@@ -455,7 +455,7 @@ static s32 ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw) ...@@ -455,7 +455,7 @@ static s32 ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw)
} }
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
status = hw->eeprom.ops.calc_checksum(hw); status = hw->eeprom.ops.calc_checksum(hw);
if (status < 0) if (status < 0)
...@@ -490,7 +490,7 @@ static s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw) ...@@ -490,7 +490,7 @@ static s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw)
s32 status; s32 status;
status = ixgbe_poll_flash_update_done_X540(hw); status = ixgbe_poll_flash_update_done_X540(hw);
if (status == IXGBE_ERR_EEPROM) { if (status == -EIO) {
hw_dbg(hw, "Flash update time out\n"); hw_dbg(hw, "Flash update time out\n");
return status; return status;
} }
...@@ -540,7 +540,7 @@ static s32 ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw) ...@@ -540,7 +540,7 @@ static s32 ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw)
return 0; return 0;
udelay(5); udelay(5);
} }
return IXGBE_ERR_EEPROM; return -EIO;
} }
/** /**
...@@ -575,7 +575,7 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) ...@@ -575,7 +575,7 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask)
* SW_FW_SYNC bits (not just NVM) * SW_FW_SYNC bits (not just NVM)
*/ */
if (ixgbe_get_swfw_sync_semaphore(hw)) if (ixgbe_get_swfw_sync_semaphore(hw))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw));
if (!(swfw_sync & (fwmask | swmask | hwmask))) { if (!(swfw_sync & (fwmask | swmask | hwmask))) {
...@@ -599,7 +599,7 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) ...@@ -599,7 +599,7 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask)
* bits in the SW_FW_SYNC register. * bits in the SW_FW_SYNC register.
*/ */
if (ixgbe_get_swfw_sync_semaphore(hw)) if (ixgbe_get_swfw_sync_semaphore(hw))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw));
if (swfw_sync & (fwmask | hwmask)) { if (swfw_sync & (fwmask | hwmask)) {
swfw_sync |= swmask; swfw_sync |= swmask;
...@@ -622,11 +622,11 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) ...@@ -622,11 +622,11 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask)
rmask |= IXGBE_GSSR_I2C_MASK; rmask |= IXGBE_GSSR_I2C_MASK;
ixgbe_release_swfw_sync_X540(hw, rmask); ixgbe_release_swfw_sync_X540(hw, rmask);
ixgbe_release_swfw_sync_semaphore(hw); ixgbe_release_swfw_sync_semaphore(hw);
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
} }
ixgbe_release_swfw_sync_semaphore(hw); ixgbe_release_swfw_sync_semaphore(hw);
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
} }
/** /**
...@@ -680,7 +680,7 @@ static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw) ...@@ -680,7 +680,7 @@ static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw)
if (i == timeout) { if (i == timeout) {
hw_dbg(hw, hw_dbg(hw,
"Software semaphore SMBI between device drivers not granted.\n"); "Software semaphore SMBI between device drivers not granted.\n");
return IXGBE_ERR_EEPROM; return -EIO;
} }
/* Now get the semaphore between SW/FW through the REGSMP bit */ /* Now get the semaphore between SW/FW through the REGSMP bit */
...@@ -697,7 +697,7 @@ static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw) ...@@ -697,7 +697,7 @@ static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw)
*/ */
hw_dbg(hw, "REGSMP Software NVM semaphore not granted\n"); hw_dbg(hw, "REGSMP Software NVM semaphore not granted\n");
ixgbe_release_swfw_sync_semaphore(hw); ixgbe_release_swfw_sync_semaphore(hw);
return IXGBE_ERR_EEPROM; return -EIO;
} }
/** /**
...@@ -768,7 +768,7 @@ s32 ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index) ...@@ -768,7 +768,7 @@ s32 ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index)
bool link_up; bool link_up;
if (index > 3) if (index > 3)
return IXGBE_ERR_PARAM; return -EINVAL;
/* Link should be up in order for the blink bit in the LED control /* Link should be up in order for the blink bit in the LED control
* register to work. Force link and speed in the MAC if link is down. * register to work. Force link and speed in the MAC if link is down.
...@@ -804,7 +804,7 @@ s32 ixgbe_blink_led_stop_X540(struct ixgbe_hw *hw, u32 index) ...@@ -804,7 +804,7 @@ s32 ixgbe_blink_led_stop_X540(struct ixgbe_hw *hw, u32 index)
u32 ledctl_reg; u32 ledctl_reg;
if (index > 3) if (index > 3)
return IXGBE_ERR_PARAM; return -EINVAL;
/* Restore the LED to its default value. */ /* Restore the LED to its default value. */
ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
......
...@@ -206,13 +206,13 @@ static s32 ixgbe_reset_cs4227(struct ixgbe_hw *hw) ...@@ -206,13 +206,13 @@ static s32 ixgbe_reset_cs4227(struct ixgbe_hw *hw)
} }
if (retry == IXGBE_CS4227_RETRIES) { if (retry == IXGBE_CS4227_RETRIES) {
hw_err(hw, "CS4227 reset did not complete\n"); hw_err(hw, "CS4227 reset did not complete\n");
return IXGBE_ERR_PHY; return -EIO;
} }
status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value); status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value);
if (status || !(value & IXGBE_CS4227_EEPROM_LOAD_OK)) { if (status || !(value & IXGBE_CS4227_EEPROM_LOAD_OK)) {
hw_err(hw, "CS4227 EEPROM did not load successfully\n"); hw_err(hw, "CS4227 EEPROM did not load successfully\n");
return IXGBE_ERR_PHY; return -EIO;
} }
return 0; return 0;
...@@ -350,13 +350,13 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) ...@@ -350,13 +350,13 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
static s32 ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, static s32 ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr,
u32 device_type, u16 *phy_data) u32 device_type, u16 *phy_data)
{ {
return IXGBE_NOT_IMPLEMENTED; return -EOPNOTSUPP;
} }
static s32 ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, static s32 ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr,
u32 device_type, u16 phy_data) u32 device_type, u16 phy_data)
{ {
return IXGBE_NOT_IMPLEMENTED; return -EOPNOTSUPP;
} }
/** /**
...@@ -463,7 +463,7 @@ s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity, ...@@ -463,7 +463,7 @@ s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity,
--retries; --retries;
} while (retries > 0); } while (retries > 0);
return IXGBE_ERR_HOST_INTERFACE_COMMAND; return -EIO;
} }
static const struct { static const struct {
...@@ -511,7 +511,7 @@ static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw) ...@@ -511,7 +511,7 @@ static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw)
hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK; hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK;
hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK; hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK;
if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK) if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK)
return IXGBE_ERR_PHY_ADDR_INVALID; return -EFAULT;
hw->phy.autoneg_advertised = hw->phy.speeds_supported; hw->phy.autoneg_advertised = hw->phy.speeds_supported;
hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL | hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL |
...@@ -568,7 +568,7 @@ static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw) ...@@ -568,7 +568,7 @@ static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw)
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
hw_err(hw, "rx_pause not valid in strict IEEE mode\n"); hw_err(hw, "rx_pause not valid in strict IEEE mode\n");
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
} }
switch (hw->fc.requested_mode) { switch (hw->fc.requested_mode) {
...@@ -677,7 +677,7 @@ static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl) ...@@ -677,7 +677,7 @@ static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl)
*ctrl = command; *ctrl = command;
if (i == IXGBE_MDIO_COMMAND_TIMEOUT) { if (i == IXGBE_MDIO_COMMAND_TIMEOUT) {
hw_dbg(hw, "IOSF wait timed out\n"); hw_dbg(hw, "IOSF wait timed out\n");
return IXGBE_ERR_PHY; return -EIO;
} }
return 0; return 0;
...@@ -716,7 +716,7 @@ static s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, ...@@ -716,7 +716,7 @@ static s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr,
if ((command & IXGBE_SB_IOSF_CTRL_RESP_STAT_MASK) != 0) { if ((command & IXGBE_SB_IOSF_CTRL_RESP_STAT_MASK) != 0) {
error = FIELD_GET(IXGBE_SB_IOSF_CTRL_CMPL_ERR_MASK, command); error = FIELD_GET(IXGBE_SB_IOSF_CTRL_CMPL_ERR_MASK, command);
hw_dbg(hw, "Failed to read, error %x\n", error); hw_dbg(hw, "Failed to read, error %x\n", error);
return IXGBE_ERR_PHY; return -EIO;
} }
if (!ret) if (!ret)
...@@ -751,9 +751,9 @@ static s32 ixgbe_get_phy_token(struct ixgbe_hw *hw) ...@@ -751,9 +751,9 @@ static s32 ixgbe_get_phy_token(struct ixgbe_hw *hw)
if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK) if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
return 0; return 0;
if (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY) if (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY)
return IXGBE_ERR_FW_RESP_INVALID; return -EIO;
return IXGBE_ERR_TOKEN_RETRY; return -EAGAIN;
} }
/** /**
...@@ -779,7 +779,7 @@ static s32 ixgbe_put_phy_token(struct ixgbe_hw *hw) ...@@ -779,7 +779,7 @@ static s32 ixgbe_put_phy_token(struct ixgbe_hw *hw)
return status; return status;
if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK) if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
return 0; return 0;
return IXGBE_ERR_FW_RESP_INVALID; return -EIO;
} }
/** /**
...@@ -943,7 +943,7 @@ static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr, ...@@ -943,7 +943,7 @@ static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr,
local_buffer = buf; local_buffer = buf;
} else { } else {
if (buffer_size < ptr) if (buffer_size < ptr)
return IXGBE_ERR_PARAM; return -EINVAL;
local_buffer = &buffer[ptr]; local_buffer = &buffer[ptr];
} }
...@@ -961,7 +961,7 @@ static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr, ...@@ -961,7 +961,7 @@ static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr,
} }
if (buffer && ((u32)start + (u32)length > buffer_size)) if (buffer && ((u32)start + (u32)length > buffer_size))
return IXGBE_ERR_PARAM; return -EINVAL;
for (i = start; length; i++, length--) { for (i = start; length; i++, length--) {
if (i == bufsz && !buffer) { if (i == bufsz && !buffer) {
...@@ -1013,7 +1013,7 @@ static s32 ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer, ...@@ -1013,7 +1013,7 @@ static s32 ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer,
local_buffer = eeprom_ptrs; local_buffer = eeprom_ptrs;
} else { } else {
if (buffer_size < IXGBE_EEPROM_LAST_WORD) if (buffer_size < IXGBE_EEPROM_LAST_WORD)
return IXGBE_ERR_PARAM; return -EINVAL;
local_buffer = buffer; local_buffer = buffer;
} }
...@@ -1149,7 +1149,7 @@ static s32 ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw, ...@@ -1149,7 +1149,7 @@ static s32 ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw,
* calculated checksum * calculated checksum
*/ */
if (read_checksum != checksum) { if (read_checksum != checksum) {
status = IXGBE_ERR_EEPROM_CHECKSUM; status = -EIO;
hw_dbg(hw, "Invalid EEPROM checksum"); hw_dbg(hw, "Invalid EEPROM checksum");
} }
...@@ -1204,7 +1204,7 @@ static s32 ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 data) ...@@ -1204,7 +1204,7 @@ static s32 ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 data)
hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
} else { } else {
hw_dbg(hw, "write ee hostif failed to get semaphore"); hw_dbg(hw, "write ee hostif failed to get semaphore");
status = IXGBE_ERR_SWFW_SYNC; status = -EBUSY;
} }
return status; return status;
...@@ -1415,7 +1415,7 @@ static s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, ...@@ -1415,7 +1415,7 @@ static s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr,
if ((command & IXGBE_SB_IOSF_CTRL_RESP_STAT_MASK) != 0) { if ((command & IXGBE_SB_IOSF_CTRL_RESP_STAT_MASK) != 0) {
error = FIELD_GET(IXGBE_SB_IOSF_CTRL_CMPL_ERR_MASK, command); error = FIELD_GET(IXGBE_SB_IOSF_CTRL_CMPL_ERR_MASK, command);
hw_dbg(hw, "Failed to write, error %x\n", error); hw_dbg(hw, "Failed to write, error %x\n", error);
return IXGBE_ERR_PHY; return -EIO;
} }
out: out:
...@@ -1558,7 +1558,7 @@ static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed) ...@@ -1558,7 +1558,7 @@ static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
/* iXFI is only supported with X552 */ /* iXFI is only supported with X552 */
if (mac->type != ixgbe_mac_X550EM_x) if (mac->type != ixgbe_mac_X550EM_x)
return IXGBE_ERR_LINK_SETUP; return -EIO;
/* Disable AN and force speed to 10G Serial. */ /* Disable AN and force speed to 10G Serial. */
status = ixgbe_read_iosf_sb_reg_x550(hw, status = ixgbe_read_iosf_sb_reg_x550(hw,
...@@ -1580,7 +1580,7 @@ static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed) ...@@ -1580,7 +1580,7 @@ static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
break; break;
default: default:
/* Other link speeds are not supported by internal KR PHY. */ /* Other link speeds are not supported by internal KR PHY. */
return IXGBE_ERR_LINK_SETUP; return -EINVAL;
} }
status = ixgbe_write_iosf_sb_reg_x550(hw, status = ixgbe_write_iosf_sb_reg_x550(hw,
...@@ -1611,7 +1611,7 @@ static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear) ...@@ -1611,7 +1611,7 @@ static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear)
{ {
switch (hw->phy.sfp_type) { switch (hw->phy.sfp_type) {
case ixgbe_sfp_type_not_present: case ixgbe_sfp_type_not_present:
return IXGBE_ERR_SFP_NOT_PRESENT; return -ENOENT;
case ixgbe_sfp_type_da_cu_core0: case ixgbe_sfp_type_da_cu_core0:
case ixgbe_sfp_type_da_cu_core1: case ixgbe_sfp_type_da_cu_core1:
*linear = true; *linear = true;
...@@ -1630,7 +1630,7 @@ static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear) ...@@ -1630,7 +1630,7 @@ static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear)
case ixgbe_sfp_type_1g_cu_core0: case ixgbe_sfp_type_1g_cu_core0:
case ixgbe_sfp_type_1g_cu_core1: case ixgbe_sfp_type_1g_cu_core1:
default: default:
return IXGBE_ERR_SFP_NOT_SUPPORTED; return -EOPNOTSUPP;
} }
return 0; return 0;
...@@ -1660,7 +1660,7 @@ ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw, ...@@ -1660,7 +1660,7 @@ ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
* there is no reason to configure CS4227 and SFP not present error is * there is no reason to configure CS4227 and SFP not present error is
* not accepted in the setup MAC link flow. * not accepted in the setup MAC link flow.
*/ */
if (status == IXGBE_ERR_SFP_NOT_PRESENT) if (status == -ENOENT)
return 0; return 0;
if (status) if (status)
...@@ -1718,7 +1718,7 @@ static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed) ...@@ -1718,7 +1718,7 @@ static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
break; break;
default: default:
/* Other link speeds are not supported by internal PHY. */ /* Other link speeds are not supported by internal PHY. */
return IXGBE_ERR_LINK_SETUP; return -EINVAL;
} }
(void)mac->ops.write_iosf_sb_reg(hw, (void)mac->ops.write_iosf_sb_reg(hw,
...@@ -1803,7 +1803,7 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1803,7 +1803,7 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed,
/* If no SFP module present, then return success. Return success since /* If no SFP module present, then return success. Return success since
* SFP not present error is not excepted in the setup MAC link flow. * SFP not present error is not excepted in the setup MAC link flow.
*/ */
if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT) if (ret_val == -ENOENT)
return 0; return 0;
if (ret_val) if (ret_val)
...@@ -1853,7 +1853,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1853,7 +1853,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
/* If no SFP module present, then return success. Return success since /* If no SFP module present, then return success. Return success since
* SFP not present error is not excepted in the setup MAC link flow. * SFP not present error is not excepted in the setup MAC link flow.
*/ */
if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT) if (ret_val == -ENOENT)
return 0; return 0;
if (ret_val) if (ret_val)
...@@ -1863,7 +1863,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1863,7 +1863,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
ixgbe_setup_kr_speed_x550em(hw, speed); ixgbe_setup_kr_speed_x550em(hw, speed);
if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE) if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE)
return IXGBE_ERR_PHY_ADDR_INVALID; return -EFAULT;
/* Get external PHY SKU id */ /* Get external PHY SKU id */
ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU, ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU,
...@@ -1962,7 +1962,7 @@ static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ...@@ -1962,7 +1962,7 @@ static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw,
u16 i, autoneg_status; u16 i, autoneg_status;
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
return IXGBE_ERR_CONFIG; return -EIO;
status = ixgbe_check_mac_link_generic(hw, speed, link_up, status = ixgbe_check_mac_link_generic(hw, speed, link_up,
link_up_wait_to_complete); link_up_wait_to_complete);
...@@ -2145,9 +2145,9 @@ static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -2145,9 +2145,9 @@ static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed,
*/ */
static void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw) static void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
{ {
s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED;
u32 info[FW_PHY_ACT_DATA_COUNT] = { 0 }; u32 info[FW_PHY_ACT_DATA_COUNT] = { 0 };
ixgbe_link_speed speed; ixgbe_link_speed speed;
s32 status = -EIO;
bool link_up; bool link_up;
/* AN should have completed when the cable was plugged in. /* AN should have completed when the cable was plugged in.
...@@ -2165,7 +2165,7 @@ static void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw) ...@@ -2165,7 +2165,7 @@ static void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
/* Check if auto-negotiation has completed */ /* Check if auto-negotiation has completed */
status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info); status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info);
if (status || !(info[0] & FW_PHY_ACT_GET_LINK_INFO_AN_COMPLETE)) { if (status || !(info[0] & FW_PHY_ACT_GET_LINK_INFO_AN_COMPLETE)) {
status = IXGBE_ERR_FC_NOT_NEGOTIATED; status = -EIO;
goto out; goto out;
} }
...@@ -2693,7 +2693,7 @@ static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw) ...@@ -2693,7 +2693,7 @@ static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
u16 speed; u16 speed;
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
return IXGBE_ERR_CONFIG; return -EIO;
if (!(hw->mac.type == ixgbe_mac_X550EM_x && if (!(hw->mac.type == ixgbe_mac_X550EM_x &&
!(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE))) { !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE))) {
...@@ -2736,7 +2736,7 @@ static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw) ...@@ -2736,7 +2736,7 @@ static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
break; break;
default: default:
/* Internal PHY does not support anything else */ /* Internal PHY does not support anything else */
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
} }
return ixgbe_setup_ixfi_x550em(hw, &force_speed); return ixgbe_setup_ixfi_x550em(hw, &force_speed);
...@@ -2768,7 +2768,7 @@ static s32 ixgbe_led_on_t_x550em(struct ixgbe_hw *hw, u32 led_idx) ...@@ -2768,7 +2768,7 @@ static s32 ixgbe_led_on_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
u16 phy_data; u16 phy_data;
if (led_idx >= IXGBE_X557_MAX_LED_INDEX) if (led_idx >= IXGBE_X557_MAX_LED_INDEX)
return IXGBE_ERR_PARAM; return -EINVAL;
/* To turn on the LED, set mode to ON. */ /* To turn on the LED, set mode to ON. */
hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
...@@ -2790,7 +2790,7 @@ static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx) ...@@ -2790,7 +2790,7 @@ static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
u16 phy_data; u16 phy_data;
if (led_idx >= IXGBE_X557_MAX_LED_INDEX) if (led_idx >= IXGBE_X557_MAX_LED_INDEX)
return IXGBE_ERR_PARAM; return -EINVAL;
/* To turn on the LED, set mode to ON. */ /* To turn on the LED, set mode to ON. */
hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
...@@ -2814,8 +2814,9 @@ static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx) ...@@ -2814,8 +2814,9 @@ static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
* *
* Sends driver version number to firmware through the manageability * Sends driver version number to firmware through the manageability
* block. On success return 0 * block. On success return 0
* else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring * else returns -EBUSY when encountering an error acquiring
* semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails. * semaphore, -EIO when command fails or -ENIVAL when incorrect
* params passed.
**/ **/
static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
u8 build, u8 sub, u16 len, u8 build, u8 sub, u16 len,
...@@ -2826,7 +2827,7 @@ static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, ...@@ -2826,7 +2827,7 @@ static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
int i; int i;
if (!len || !driver_ver || (len > sizeof(fw_cmd.driver_string))) if (!len || !driver_ver || (len > sizeof(fw_cmd.driver_string)))
return IXGBE_ERR_INVALID_ARGUMENT; return -EINVAL;
fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO; fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;
fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN + len; fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN + len;
...@@ -2851,7 +2852,7 @@ static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, ...@@ -2851,7 +2852,7 @@ static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
if (fw_cmd.hdr.cmd_or_resp.ret_status != if (fw_cmd.hdr.cmd_or_resp.ret_status !=
FW_CEM_RESP_STATUS_SUCCESS) FW_CEM_RESP_STATUS_SUCCESS)
return IXGBE_ERR_HOST_INTERFACE_COMMAND; return -EIO;
return 0; return 0;
} }
...@@ -2908,7 +2909,7 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw) ...@@ -2908,7 +2909,7 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw)
/* Validate the requested mode */ /* Validate the requested mode */
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
} }
/* 10gig parts do not have a word in the EEPROM to determine the /* 10gig parts do not have a word in the EEPROM to determine the
...@@ -2943,7 +2944,7 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw) ...@@ -2943,7 +2944,7 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw)
break; break;
default: default:
hw_err(hw, "Flow control param set incorrectly\n"); hw_err(hw, "Flow control param set incorrectly\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
switch (hw->device_id) { switch (hw->device_id) {
...@@ -2987,8 +2988,8 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw) ...@@ -2987,8 +2988,8 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw)
static void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw) static void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw)
{ {
u32 link_s1, lp_an_page_low, an_cntl_1; u32 link_s1, lp_an_page_low, an_cntl_1;
s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED;
ixgbe_link_speed speed; ixgbe_link_speed speed;
s32 status = -EIO;
bool link_up; bool link_up;
/* AN should have completed when the cable was plugged in. /* AN should have completed when the cable was plugged in.
...@@ -3014,7 +3015,7 @@ static void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw) ...@@ -3014,7 +3015,7 @@ static void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw)
if (status || (link_s1 & IXGBE_KRM_LINK_S1_MAC_AN_COMPLETE) == 0) { if (status || (link_s1 & IXGBE_KRM_LINK_S1_MAC_AN_COMPLETE) == 0) {
hw_dbg(hw, "Auto-Negotiation did not complete\n"); hw_dbg(hw, "Auto-Negotiation did not complete\n");
status = IXGBE_ERR_FC_NOT_NEGOTIATED; status = -EIO;
goto out; goto out;
} }
...@@ -3253,8 +3254,7 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) ...@@ -3253,8 +3254,7 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
/* Identify the PHY or SFP module */ /* Identify the PHY or SFP module */
ret_val = phy->ops.identify(hw); ret_val = phy->ops.identify(hw);
if (ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED || if (ret_val == -EOPNOTSUPP || ret_val == -EFAULT)
ret_val == IXGBE_ERR_PHY_ADDR_INVALID)
return ret_val; return ret_val;
/* Setup function pointers based on detected hardware */ /* Setup function pointers based on detected hardware */
...@@ -3462,8 +3462,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) ...@@ -3462,8 +3462,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
/* PHY ops must be identified and initialized prior to reset */ /* PHY ops must be identified and initialized prior to reset */
status = hw->phy.ops.init(hw); status = hw->phy.ops.init(hw);
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED || if (status == -EOPNOTSUPP || status == -EFAULT)
status == IXGBE_ERR_PHY_ADDR_INVALID)
return status; return status;
/* start the external PHY */ /* start the external PHY */
...@@ -3479,7 +3478,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) ...@@ -3479,7 +3478,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
hw->phy.sfp_setup_needed = false; hw->phy.sfp_setup_needed = false;
} }
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) if (status == -EOPNOTSUPP)
return status; return status;
/* Reset PHY */ /* Reset PHY */
...@@ -3503,7 +3502,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) ...@@ -3503,7 +3502,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
if (status) { if (status) {
hw_dbg(hw, "semaphore failed with %d", status); hw_dbg(hw, "semaphore failed with %d", status);
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
} }
ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
...@@ -3521,7 +3520,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) ...@@ -3521,7 +3520,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
} }
if (ctrl & IXGBE_CTRL_RST_MASK) { if (ctrl & IXGBE_CTRL_RST_MASK) {
status = IXGBE_ERR_RESET_FAILED; status = -EIO;
hw_dbg(hw, "Reset polling failed to complete.\n"); hw_dbg(hw, "Reset polling failed to complete.\n");
} }
...@@ -3617,7 +3616,7 @@ static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw) ...@@ -3617,7 +3616,7 @@ static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw)
/* Validate the requested mode */ /* Validate the requested mode */
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
return IXGBE_ERR_INVALID_LINK_SETTINGS; return -EINVAL;
} }
if (hw->fc.requested_mode == ixgbe_fc_default) if (hw->fc.requested_mode == ixgbe_fc_default)
...@@ -3674,7 +3673,7 @@ static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw) ...@@ -3674,7 +3673,7 @@ static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw)
break; break;
default: default:
hw_err(hw, "Flow control param set incorrectly\n"); hw_err(hw, "Flow control param set incorrectly\n");
return IXGBE_ERR_CONFIG; return -EIO;
} }
status = hw->mac.ops.write_iosf_sb_reg(hw, status = hw->mac.ops.write_iosf_sb_reg(hw,
...@@ -3770,7 +3769,7 @@ static s32 ixgbe_acquire_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask) ...@@ -3770,7 +3769,7 @@ static s32 ixgbe_acquire_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask)
return 0; return 0;
if (hmask) if (hmask)
ixgbe_release_swfw_sync_X540(hw, hmask); ixgbe_release_swfw_sync_X540(hw, hmask);
if (status != IXGBE_ERR_TOKEN_RETRY) if (status != -EAGAIN)
return status; return status;
msleep(FW_PHY_TOKEN_DELAY); msleep(FW_PHY_TOKEN_DELAY);
} }
...@@ -3814,7 +3813,7 @@ static s32 ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, ...@@ -3814,7 +3813,7 @@ static s32 ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
s32 status; s32 status;
if (hw->mac.ops.acquire_swfw_sync(hw, mask)) if (hw->mac.ops.acquire_swfw_sync(hw, mask))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data); status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data);
...@@ -3840,7 +3839,7 @@ static s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, ...@@ -3840,7 +3839,7 @@ static s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
s32 status; s32 status;
if (hw->mac.ops.acquire_swfw_sync(hw, mask)) if (hw->mac.ops.acquire_swfw_sync(hw, mask))
return IXGBE_ERR_SWFW_SYNC; return -EBUSY;
status = ixgbe_write_phy_reg_mdi(hw, reg_addr, device_type, phy_data); status = ixgbe_write_phy_reg_mdi(hw, reg_addr, device_type, phy_data);
hw->mac.ops.release_swfw_sync(hw, mask); hw->mac.ops.release_swfw_sync(hw, mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment