Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[pandora-kernel.git] / drivers / net / e1000 / e1000_hw.c
index aed223b..8545c7a 100644 (file)
@@ -124,6 +124,7 @@ static s32 e1000_set_phy_type(struct e1000_hw *hw)
        case M88E1000_I_PHY_ID:
        case M88E1011_I_PHY_ID:
        case M88E1111_I_PHY_ID:
+       case M88E1118_E_PHY_ID:
                hw->phy_type = e1000_phy_m88;
                break;
        case IGP01E1000_I_PHY_ID:
@@ -445,6 +446,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw)
        /* Must reset the PHY before resetting the MAC */
        if ((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) {
                ew32(CTRL, (ctrl | E1000_CTRL_PHY_RST));
+               E1000_WRITE_FLUSH();
                msleep(5);
        }
 
@@ -3079,7 +3081,6 @@ s32 e1000_phy_hw_reset(struct e1000_hw *hw)
 {
        u32 ctrl, ctrl_ext;
        u32 led_ctrl;
-       s32 ret_val;
 
        e_dbg("e1000_phy_hw_reset");
 
@@ -3125,11 +3126,7 @@ s32 e1000_phy_hw_reset(struct e1000_hw *hw)
        }
 
        /* Wait for FW to finish PHY configuration. */
-       ret_val = e1000_get_phy_cfg_done(hw);
-       if (ret_val != E1000_SUCCESS)
-               return ret_val;
-
-       return ret_val;
+       return e1000_get_phy_cfg_done(hw);
 }
 
 /**
@@ -3222,7 +3219,8 @@ static s32 e1000_detect_gig_phy(struct e1000_hw *hw)
                break;
        case e1000_ce4100:
                if ((hw->phy_id == RTL8211B_PHY_ID) ||
-                   (hw->phy_id == RTL8201N_PHY_ID))
+                   (hw->phy_id == RTL8201N_PHY_ID) ||
+                   (hw->phy_id == M88E1118_E_PHY_ID))
                        match = true;
                break;
        case e1000_82541:
@@ -3755,6 +3753,7 @@ static s32 e1000_acquire_eeprom(struct e1000_hw *hw)
                /* Clear SK and CS */
                eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
                ew32(EECD, eecd);
+               E1000_WRITE_FLUSH();
                udelay(1);
        }
 
@@ -3827,6 +3826,7 @@ static void e1000_release_eeprom(struct e1000_hw *hw)
                eecd &= ~E1000_EECD_SK; /* Lower SCK */
 
                ew32(EECD, eecd);
+               E1000_WRITE_FLUSH();
 
                udelay(hw->eeprom.delay_usec);
        } else if (hw->eeprom.type == e1000_eeprom_microwire) {