bgmac: start/stop PHY on netdev open/stop
authorRafał Miłecki <zajec5@gmail.com>
Tue, 10 Dec 2013 16:19:39 +0000 (17:19 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Dec 2013 23:09:12 +0000 (18:09 -0500)
I've realized that I need to call ethtool command to get Ethernet
working after booting. Ex call: ethtool -s eth0 autoneg on
It was fixing Ethernet even if auto-negotiation was already on.

Adding calls to phy_start and phy_stop look like a real solution.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bgmac.c

index 0452937227ff188a78a7cee3582cf2a68a296f9a..fd6a22e3dd7528ea464373bc7356fcc87fc2011f 100644 (file)
@@ -1141,6 +1141,8 @@ static int bgmac_open(struct net_device *net_dev)
        }
        napi_enable(&bgmac->napi);
 
+       phy_start(bgmac->phy_dev);
+
        netif_carrier_on(net_dev);
 
 err_out:
@@ -1153,6 +1155,8 @@ static int bgmac_stop(struct net_device *net_dev)
 
        netif_carrier_off(net_dev);
 
+       phy_stop(bgmac->phy_dev);
+
        napi_disable(&bgmac->napi);
        bgmac_chip_intrs_off(bgmac);
        free_irq(bgmac->core->irq, net_dev);