From 4a770377d1e12682a4ed19692c8d2898afe67a0e Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Mon, 18 May 2009 15:48:44 +0200 Subject: [miiphy] add feature to force link present If a NIC's MII isn't connected to a PHY but directly to a switch port, the switch doesn't sent a link signal to the NIC. (Because strictly speaking, there isn't any ethernet link at all.) This patch adds a force link feature to the phy, to cope with this situation. Signed-off-by: Marc Kleine-Budde --- drivers/net/miiphy.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers') diff --git a/drivers/net/miiphy.c b/drivers/net/miiphy.c index a82ef75b59..43d37f5c77 100644 --- a/drivers/net/miiphy.c +++ b/drivers/net/miiphy.c @@ -35,6 +35,10 @@ int miiphy_restart_aneg(struct miiphy_device *mdev) * Reset PHY, then delay 300ns */ mdev->write(mdev, mdev->address, MII_BMCR, BMCR_RESET); + + if (mdev->flags & MIIPHY_FORCE_LINK) + return 0; + udelay(1000); if (mdev->flags & MIIPHY_FORCE_10) { @@ -71,6 +75,9 @@ int miiphy_wait_aneg(struct miiphy_device *mdev) uint64_t start; uint16_t status; + if (mdev->flags & MIIPHY_FORCE_LINK) + return 0; + /* * Wait for AN completion */ @@ -96,6 +103,11 @@ int miiphy_print_status(struct miiphy_device *mdev) char *duplex; int speed; + if (mdev->flags & MIIPHY_FORCE_LINK) { + printf("Forcing link present...\n"); + return 0; + } + if (mdev->read(mdev, mdev->address, MII_BMSR, &bmsr) != 0) goto err_out; if (mdev->read(mdev, mdev->address, MII_BMCR, &bmcr) != 0) -- cgit v1.2.3