]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/phy/marvell.c
r8169: support additional 8168cp chipset
[linux-2.6-omap-h63xx.git] / drivers / net / phy / marvell.c
index b5f4c28f6b79a3316c92aba88b76251fc482c13a..4aa54794704045dfdec94bbaafea2d88970e163a 100644 (file)
@@ -158,11 +158,10 @@ static int m88e1111_config_init(struct phy_device *phydev)
 {
        int err;
        int temp;
-       int mode;
 
        /* Enable Fiber/Copper auto selection */
        temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
-       temp |= MII_M1111_HWCFG_FIBER_COPPER_AUTO;
+       temp &= ~MII_M1111_HWCFG_FIBER_COPPER_AUTO;
        phy_write(phydev, MII_M1111_PHY_EXT_SR, temp);
 
        temp = phy_read(phydev, MII_BMCR);
@@ -198,9 +197,7 @@ static int m88e1111_config_init(struct phy_device *phydev)
 
                temp &= ~(MII_M1111_HWCFG_MODE_MASK);
 
-               mode = phy_read(phydev, MII_M1111_PHY_EXT_CR);
-
-               if (mode & MII_M1111_HWCFG_FIBER_COPPER_RES)
+               if (temp & MII_M1111_HWCFG_FIBER_COPPER_RES)
                        temp |= MII_M1111_HWCFG_MODE_FIBER_RGMII;
                else
                        temp |= MII_M1111_HWCFG_MODE_COPPER_RGMII;
@@ -211,8 +208,6 @@ static int m88e1111_config_init(struct phy_device *phydev)
        }
 
        if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
-               int temp;
-
                temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
                if (temp < 0)
                        return temp;
@@ -297,7 +292,7 @@ static int m88e1145_config_init(struct phy_device *phydev)
 /* marvell_read_status
  *
  * Generic status code does not detect Fiber correctly!
- * Description: 
+ * Description:
  *   Check the link, then figure out the current state
  *   by comparing what we advertise with what the link partner
  *   advertises.  Start by checking the gigabit possibilities,