diff options
author | David S. Miller <davem@davemloft.net> | 2008-03-05 12:26:41 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-05 12:26:41 -0800 |
commit | 255333c1db3ec63921de29b134418a4e56e5921e (patch) | |
tree | b1cd99373cabfa6fed020496d4d74500e7bc7e92 /drivers/net/phy/davicom.c | |
parent | 9a43b709a230705ca40a6f854a334a02334a3c1c (diff) | |
parent | 0d66afe7805b169b6bf3c7a88cf8163298b8ef05 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
net/mac80211/rc80211_pid_algo.c
Diffstat (limited to 'drivers/net/phy/davicom.c')
-rw-r--r-- | drivers/net/phy/davicom.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c index 7ed632db00d..d926168bc78 100644 --- a/drivers/net/phy/davicom.c +++ b/drivers/net/phy/davicom.c @@ -37,6 +37,7 @@ #define MII_DM9161_SCR 0x10 #define MII_DM9161_SCR_INIT 0x0610 +#define MII_DM9161_SCR_RMII 0x0100 /* DM9161 Interrupt Register */ #define MII_DM9161_INTR 0x15 @@ -103,7 +104,7 @@ static int dm9161_config_aneg(struct phy_device *phydev) static int dm9161_config_init(struct phy_device *phydev) { - int err; + int err, temp; /* Isolate the PHY */ err = phy_write(phydev, MII_BMCR, BMCR_ISOLATE); @@ -111,9 +112,19 @@ static int dm9161_config_init(struct phy_device *phydev) if (err < 0) return err; - /* Do not bypass the scrambler/descrambler */ - err = phy_write(phydev, MII_DM9161_SCR, MII_DM9161_SCR_INIT); + switch (phydev->interface) { + case PHY_INTERFACE_MODE_MII: + temp = MII_DM9161_SCR_INIT; + break; + case PHY_INTERFACE_MODE_RMII: + temp = MII_DM9161_SCR_INIT | MII_DM9161_SCR_RMII; + break; + default: + return -EINVAL; + } + /* Do not bypass the scrambler/descrambler */ + err = phy_write(phydev, MII_DM9161_SCR, temp); if (err < 0) return err; |