diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-09-20 05:55:36 -0700 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-09-20 05:55:36 -0700 |
commit | 6469f540ea37d53db089c8fea9c0c77a3d9353d4 (patch) | |
tree | 1dc9dc077150d57f4424cae49e711b5dd6e903a1 /drivers/net/mdio.c | |
parent | 304e6d5fe294b80e6d3107f99ec241816390ebcc (diff) | |
parent | 78f28b7c555359c67c2a0d23f7436e915329421e (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/mtd/mtdcore.c
Merged in order that I can apply the Nomadik nand/onenand support patches.
Diffstat (limited to 'drivers/net/mdio.c')
-rw-r--r-- | drivers/net/mdio.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/mdio.c b/drivers/net/mdio.c index 6851bdb2ce2..21f8754fcf4 100644 --- a/drivers/net/mdio.c +++ b/drivers/net/mdio.c @@ -109,13 +109,20 @@ int mdio45_links_ok(const struct mdio_if_info *mdio, u32 mmd_mask) if (mmd_mask & (1 << devad)) { mmd_mask &= ~(1 << devad); - /* Read twice because link state is latched and a - * read moves the current state into the register */ + /* Reset the latched status and fault flags */ mdio->mdio_read(mdio->dev, mdio->prtad, devad, MDIO_STAT1); + if (devad == MDIO_MMD_PMAPMD || devad == MDIO_MMD_PCS || + devad == MDIO_MMD_PHYXS || devad == MDIO_MMD_DTEXS) + mdio->mdio_read(mdio->dev, mdio->prtad, + devad, MDIO_STAT2); + + /* Check the current status and fault flags */ reg = mdio->mdio_read(mdio->dev, mdio->prtad, devad, MDIO_STAT1); - if (reg < 0 || !(reg & MDIO_STAT1_LSTATUS)) + if (reg < 0 || + (reg & (MDIO_STAT1_FAULT | MDIO_STAT1_LSTATUS)) != + MDIO_STAT1_LSTATUS) return false; } } @@ -373,10 +380,7 @@ int mdio_mii_ioctl(const struct mdio_if_info *mdio, cmd = SIOCGMIIREG; break; case SIOCGMIIREG: - break; case SIOCSMIIREG: - if (!capable(CAP_NET_ADMIN)) - return -EPERM; break; default: return -EOPNOTSUPP; |