igb: Enable auto-crossover during forced operation on 82580 and above.
authorMatthew Vick <matthew.vick@intel.com>
Tue, 16 Oct 2012 07:44:45 +0000 (07:44 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 30 Oct 2012 06:49:11 +0000 (23:49 -0700)
Newer devices supported by igb can support auto-crossover detection in
forced operation modes. Enable this in the driver, rather than clobbering
this functionality in forced operation.

Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/e1000_mac.c
drivers/net/ethernet/intel/igb/e1000_phy.c

index 819c145ac762229df4330ea1d79110133e43e0e9..7acddfe9e6d57768837476f485819a4909922f69 100644 (file)
@@ -1391,6 +1391,10 @@ s32 igb_validate_mdi_setting(struct e1000_hw *hw)
 {
        s32 ret_val = 0;
 
+       /* All MDI settings are supported on 82580 and newer. */
+       if (hw->mac.type >= e1000_82580)
+               goto out;
+
        if (!hw->mac.autoneg && (hw->phy.mdix == 0 || hw->phy.mdix == 3)) {
                hw_dbg("Invalid MDI setting detected\n");
                hw->phy.mdix = 1;
index c62a4c388194f6e31e0bb793c45e0b28f20c406e..fe76004aca4e7a8464811629d9cfec18dac2f8b2 100644 (file)
@@ -1207,20 +1207,25 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
        u16 phy_data;
        bool link;
 
-       /*
-        * Clear Auto-Crossover to force MDI manually.  M88E1000 requires MDI
-        * forced whenever speed and duplex are forced.
-        */
-       ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
-       if (ret_val)
-               goto out;
+       /* I210 and I211 devices support Auto-Crossover in forced operation. */
+       if (phy->type != e1000_phy_i210) {
+               /*
+                * Clear Auto-Crossover to force MDI manually.  M88E1000
+                * requires MDI forced whenever speed and duplex are forced.
+                */
+               ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL,
+                                           &phy_data);
+               if (ret_val)
+                       goto out;
 
-       phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
-       ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
-       if (ret_val)
-               goto out;
+               phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
+               ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL,
+                                            phy_data);
+               if (ret_val)
+                       goto out;
 
-       hw_dbg("M88E1000 PSCR: %X\n", phy_data);
+               hw_dbg("M88E1000 PSCR: %X\n", phy_data);
+       }
 
        ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
        if (ret_val)