9
0
Fork 0

phy: fix force mode

do not try to read the status in force mode
the link is up

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2013-02-24 10:34:12 +01:00 committed by Sascha Hauer
parent 7ba9f45f6a
commit 62acc70dc1
3 changed files with 9 additions and 0 deletions

View File

@ -167,10 +167,14 @@ static int mdio_bus_probe(struct device_d *_dev)
dev->speed = SPEED_10;
dev->duplex = DUPLEX_FULL;
dev->autoneg = !AUTONEG_ENABLE;
dev->force = 1;
dev->link = 1;
} else if (dev->dev_flags & PHYLIB_FORCE_100) {
dev->speed = SPEED_100;
dev->duplex = DUPLEX_FULL;
dev->autoneg = !AUTONEG_ENABLE;
dev->force = 1;
dev->link = 1;
}
}

View File

@ -549,6 +549,10 @@ int genphy_read_status(struct phy_device *phydev)
int lpa;
int lpagb = 0;
/* if force the status and link are set */
if (phydev->force)
return 0;
/* Update the link, but return if there
* was an error */
err = genphy_update_link(phydev);

View File

@ -158,6 +158,7 @@ struct phy_device {
u32 advertising;
int autoneg;
int force;
/* private data pointer */