EMAC driver: add power down mode
authorVitja Makarov <vitja.makarov@gmail.com>
Wed, 30 Jan 2008 08:52:26 +0000 (16:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Feb 2008 12:28:50 +0000 (04:28 -0800)
This patch puts phy in power-down mode when interface is down.
Also we should think about energy detect power-down mode, that will
decrease power consumption when no link.

Signed-off-by: Vitja Makarov <vitja.makarov@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bfin_mac.c

index e9bd05916774c8350ee95decd65688563b47b2d7..f2368b71a7203b8ba2a4380b5f7639c28ba5f78c 100644 (file)
@@ -884,10 +884,10 @@ static int bf537mac_open(struct net_device *dev)
                return retval;
 
        phy_start(lp->phydev);
+       phy_write(lp->phydev, MII_BMCR, BMCR_RESET);
        setup_system_regs(dev);
        bf537mac_disable();
        bf537mac_enable();
-
        pr_debug("hardware init finished\n");
        netif_start_queue(dev);
        netif_carrier_on(dev);
@@ -910,6 +910,7 @@ static int bf537mac_close(struct net_device *dev)
        netif_carrier_off(dev);
 
        phy_stop(lp->phydev);
+       phy_write(lp->phydev, MII_BMCR, BMCR_PDOWN);
 
        /* clear everything */
        bf537mac_shutdown(dev);