diff options
Diffstat (limited to 'drivers/net/e1000/main.c')
-rw-r--r-- | drivers/net/e1000/main.c | 98 |
1 files changed, 50 insertions, 48 deletions
diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c index caa7274a8d..0ef8fd6231 100644 --- a/drivers/net/e1000/main.c +++ b/drivers/net/e1000/main.c @@ -231,7 +231,7 @@ static int32_t e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) if (!timeout) { /* Release semaphores */ e1000_put_hw_eeprom_semaphore(hw); - dev_dbg(hw->dev, "Driver can't access the Eeprom - " + dev_err(hw->dev, "Driver can't access the Eeprom - " "SWESMBI bit is set.\n"); return -E1000_ERR_EEPROM; } @@ -262,7 +262,7 @@ int32_t e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask) } if (!timeout) { - dev_dbg(hw->dev, "Driver can't access resource, SW_FW_SYNC timeout.\n"); + dev_err(hw->dev, "Driver can't access resource, SW_FW_SYNC timeout.\n"); return -E1000_ERR_SWFW_SYNC; } @@ -332,7 +332,7 @@ static int e1000_get_ethaddr(struct eth_device *edev, unsigned char *adr) for (i = 0; i < NODE_ADDRESS_SIZE; i += 2) { if (e1000_read_eeprom(hw, i >> 1, 1, &eeprom_data) < 0) { - dev_dbg(hw->dev, "EEPROM Read Error\n"); + dev_err(hw->dev, "EEPROM Read Error\n"); return -E1000_ERR_EEPROM; } adr[i] = eeprom_data & 0xff; @@ -832,20 +832,6 @@ static int e1000_setup_link(struct e1000_hw *hw) if (e1000_check_phy_reset_block(hw)) return E1000_SUCCESS; - /* Read and store word 0x0F of the EEPROM. This word contains bits - * that determine the hardware's default PAUSE (flow control) mode, - * a bit that determines whether the HW defaults to enabling or - * disabling auto-negotiation, and the direction of the - * SW defined pins. If there is no SW over-ride of the flow - * control setting, then the variable hw->fc will - * be initialized based on a value in the EEPROM. - */ - if (e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, 1, - &eeprom_data) < 0) { - dev_dbg(hw->dev, "EEPROM Read Error\n"); - return -E1000_ERR_EEPROM; - } - switch (hw->mac_type) { case e1000_ich8lan: case e1000_82573: @@ -854,6 +840,22 @@ static int e1000_setup_link(struct e1000_hw *hw) hw->fc = e1000_fc_full; break; default: + /* Read and store word 0x0F of the EEPROM. This word + * contains bits that determine the hardware's default + * PAUSE (flow control) mode, a bit that determines + * whether the HW defaults to enabling or disabling + * auto-negotiation, and the direction of the SW + * defined pins. If there is no SW over-ride of the + * flow control setting, then the variable hw->fc will + * be initialized based on a value in the EEPROM. + */ + ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, 1, + &eeprom_data); + if (ret_val < 0) { + dev_err(hw->dev, "EEPROM Read Error\n"); + return ret_val; + } + if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) hw->fc = e1000_fc_none; else if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == EEPROM_WORD0F_ASM_DIR) @@ -1006,7 +1008,7 @@ static int e1000_setup_fiber_link(struct e1000_hw *hw) txcw = E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK; break; default: - dev_dbg(hw->dev, "Flow control param set incorrectly\n"); + dev_err(hw->dev, "Flow control param set incorrectly\n"); return -E1000_ERR_CONFIG; break; } @@ -1044,7 +1046,7 @@ static int e1000_setup_fiber_link(struct e1000_hw *hw) * detect a signal. This will allow us to communicate with * non-autonegotiating link partners. */ - dev_dbg(hw->dev, "Never got a valid link from auto-neg!!!\n"); + dev_err(hw->dev, "Never got a valid link from auto-neg!!!\n"); hw->autoneg_failed = 1; return -E1000_ERR_NOLINK; } else { @@ -1052,7 +1054,7 @@ static int e1000_setup_fiber_link(struct e1000_hw *hw) dev_dbg(hw->dev, "Valid Link Found\n"); } } else { - dev_dbg(hw->dev, "No Signal Detected\n"); + dev_err(hw->dev, "No Signal Detected\n"); return -E1000_ERR_NOLINK; } return 0; @@ -1092,7 +1094,7 @@ static int32_t e1000_copper_link_preconfig(struct e1000_hw *hw) /* Make sure we have a valid PHY */ ret_val = e1000_detect_gig_phy(hw); if (ret_val) { - dev_dbg(hw->dev, "Error, did not detect valid phy.\n"); + dev_err(hw->dev, "Error, did not detect valid phy.\n"); return ret_val; } dev_dbg(hw->dev, "Phy ID = %x \n", hw->phy_id); @@ -1236,7 +1238,7 @@ static int32_t e1000_copper_link_igp_setup(struct e1000_hw *hw) ret_val = e1000_phy_reset(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Resetting the PHY\n"); + dev_err(hw->dev, "Error Resetting the PHY\n"); return ret_val; } @@ -1255,7 +1257,7 @@ static int32_t e1000_copper_link_igp_setup(struct e1000_hw *hw) /* disable lplu d3 during driver init */ ret_val = e1000_set_d3_lplu_state_off(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Disabling LPLU D3\n"); + dev_err(hw->dev, "Error Disabling LPLU D3\n"); return ret_val; } } @@ -1263,7 +1265,7 @@ static int32_t e1000_copper_link_igp_setup(struct e1000_hw *hw) /* disable lplu d0 during driver init */ ret_val = e1000_set_d0_lplu_state_off(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Disabling LPLU D0\n"); + dev_err(hw->dev, "Error Disabling LPLU D0\n"); return ret_val; } @@ -1457,7 +1459,7 @@ static int32_t e1000_copper_link_ggp_setup(struct e1000_hw *hw) /* SW Reset the PHY so all changes take effect */ ret_val = e1000_phy_reset(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Resetting the PHY\n"); + dev_err(hw->dev, "Error Resetting the PHY\n"); return ret_val; } @@ -1586,7 +1588,7 @@ static int32_t e1000_copper_link_mgp_setup(struct e1000_hw *hw) /* SW Reset the PHY so all changes take effect */ ret_val = e1000_phy_reset(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Resetting the PHY\n"); + dev_err(hw->dev, "Error Resetting the PHY\n"); return ret_val; } @@ -1615,7 +1617,7 @@ static int32_t e1000_copper_link_autoneg(struct e1000_hw *hw) dev_dbg(hw->dev, "Reconfiguring auto-neg advertisement params\n"); ret_val = e1000_phy_setup_autoneg(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Setting up Auto-Negotiation\n"); + dev_err(hw->dev, "Error Setting up Auto-Negotiation\n"); return ret_val; } dev_dbg(hw->dev, "Restarting Auto-Neg\n"); @@ -1634,7 +1636,7 @@ static int32_t e1000_copper_link_autoneg(struct e1000_hw *hw) ret_val = e1000_wait_autoneg(hw); if (ret_val) { - dev_dbg(hw->dev, "Error while waiting for autoneg to complete\n"); + dev_err(hw->dev, "Error while waiting for autoneg to complete\n"); return ret_val; } @@ -1663,14 +1665,14 @@ static int32_t e1000_copper_link_postconfig(struct e1000_hw *hw) } else { ret_val = e1000_config_mac_to_phy(hw); if (ret_val) { - dev_dbg(hw->dev, "Error configuring MAC to PHY settings\n"); + dev_err(hw->dev, "Error configuring MAC to PHY settings\n"); return ret_val; } } ret_val = e1000_config_fc_after_link_up(hw); if (ret_val) { - dev_dbg(hw->dev, "Error Configuring Flow Control\n"); + dev_err(hw->dev, "Error Configuring Flow Control\n"); return ret_val; } @@ -1983,7 +1985,7 @@ static int e1000_config_mac_to_phy(struct e1000_hw *hw) * registers depending on negotiated values. */ if (e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } if (phy_data & M88E1000_PSSR_DPLX) @@ -2059,7 +2061,7 @@ static int e1000_force_mac_fc(struct e1000_hw *hw) ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE); break; default: - dev_dbg(hw->dev, "Flow control param set incorrectly\n"); + dev_err(hw->dev, "Flow control param set incorrectly\n"); return -E1000_ERR_CONFIG; } @@ -2098,17 +2100,17 @@ static int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw) * some "sticky" (latched) bits. */ if (e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - dev_dbg(hw->dev, "PHY Read Error \n"); + dev_err(hw->dev, "PHY Read Error \n"); return -E1000_ERR_PHY; } if (e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - dev_dbg(hw->dev, "PHY Read Error \n"); + dev_err(hw->dev, "PHY Read Error \n"); return -E1000_ERR_PHY; } if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) { - dev_dbg(hw->dev, "Copper PHY and Auto Neg has not completed.\n"); + dev_err(hw->dev, "Copper PHY and Auto Neg has not completed.\n"); return 0; } @@ -2119,12 +2121,12 @@ static int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw) * negotiated. */ if (e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_nway_adv_reg) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } if (e1000_read_phy_reg(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } @@ -2250,7 +2252,7 @@ static int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw) */ ret_val = e1000_force_mac_fc(hw); if (ret_val < 0) { - dev_dbg(hw->dev, "Error forcing flow control settings\n"); + dev_err(hw->dev, "Error forcing flow control settings\n"); return ret_val; } @@ -2399,11 +2401,11 @@ static int e1000_wait_autoneg(struct e1000_hw *hw) * Complete bit to be set. */ if (e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } if (e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - dev_dbg(hw->dev, "PHY Read Error\n"); + dev_err(hw->dev, "PHY Read Error\n"); return -E1000_ERR_PHY; } if (phy_data & MII_SR_AUTONEG_COMPLETE) { @@ -2412,7 +2414,7 @@ static int e1000_wait_autoneg(struct e1000_hw *hw) } mdelay(100); } - dev_dbg(hw->dev, "Auto-Neg timedout.\n"); + dev_err(hw->dev, "Auto-Neg timedout.\n"); return -E1000_ERR_TIMEOUT; } @@ -2578,11 +2580,11 @@ static int e1000_phy_read(struct mii_bus *bus, int phy_addr, int reg_addr) break; } if (!(mdic & E1000_MDIC_READY)) { - dev_dbg(hw->dev, "MDI Read did not complete\n"); + dev_err(hw->dev, "MDI Read did not complete\n"); return -E1000_ERR_PHY; } if (mdic & E1000_MDIC_ERROR) { - dev_dbg(hw->dev, "MDI Error\n"); + dev_err(hw->dev, "MDI Error\n"); return -E1000_ERR_PHY; } return mdic; @@ -2667,7 +2669,7 @@ static int e1000_phy_write(struct mii_bus *bus, int phy_addr, break; } if (!(mdic & E1000_MDIC_READY)) { - dev_dbg(hw->dev, "MDI Write did not complete\n"); + dev_err(hw->dev, "MDI Write did not complete\n"); return -E1000_ERR_PHY; } } else { @@ -2774,7 +2776,7 @@ static int32_t e1000_get_phy_cfg_done(struct e1000_hw *hw) timeout--; } if (!timeout) { - dev_dbg(hw->dev, "MNG configuration cycle has not completed.\n"); + dev_err(hw->dev, "MNG configuration cycle has not completed.\n"); return -E1000_ERR_RESET; } break; @@ -2810,7 +2812,7 @@ static int32_t e1000_phy_hw_reset(struct e1000_hw *hw) swfw = E1000_SWFW_PHY1_SM; if (e1000_swfw_sync_acquire(hw, swfw)) { - dev_dbg(hw->dev, "Unable to acquire swfw sync\n"); + dev_err(hw->dev, "Unable to acquire swfw sync\n"); return -E1000_ERR_SWFW_SYNC; } @@ -3109,12 +3111,12 @@ static int32_t e1000_detect_gig_phy(struct e1000_hw *hw) phy_type = e1000_phy_igb; break; default: - dev_dbg(hw->dev, "Invalid MAC type %d\n", hw->mac_type); + dev_err(hw->dev, "Invalid MAC type %d\n", hw->mac_type); return -E1000_ERR_CONFIG; } if (phy_type == e1000_phy_undefined) { - dev_dbg(hw->dev, "Invalid PHY ID 0x%X\n", hw->phy_id); + dev_err(hw->dev, "Invalid PHY ID 0x%X\n", hw->phy_id); return -EINVAL; } |