[PATCH 2/2] e100: power off PHY after reset when interface is down

From: Jiang Wang
Date: Wed Dec 14 2011 - 14:31:48 EST


PHYs supported by e100 re-starts auto-negotiation after writing to
BMCR_RESET bit. This patch powers down PHY when the interface is down
and reset is issued.

Signed-off-by: Jiang Wang <Jiang.Wang@xxxxxxxxxxxx>
---
drivers/net/ethernet/intel/e100.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 9824e0a..b8e4910 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -2386,6 +2386,13 @@ static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
err = mii_ethtool_sset(&nic->mii, cmd);
e100_exec_cb(nic, NULL, e100_configure);

+ if (!netif_running(netdev) && !(nic->flags & wol_magic)) {
+ uint16_t phy_data;
+ phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
+ phy_data |= BMCR_PDOWN;
+ mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ }
+
return err;
}

--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/