net: dsa: start and stop the PHY state machine
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 25 Sep 2014 00:05:17 +0000 (17:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Sep 2014 21:14:08 +0000 (17:14 -0400)
dsa_slave_open() should start the PHY library state machine for its PHY
interface, and dsa_slave_close() should stop the PHY library state
machine accordingly.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c

index 43c1e4ade6892356fbc13ff5c6fefec4ea776f21..4392e983abda87d1d9eea3df8343c64b533f6cfe 100644 (file)
@@ -84,6 +84,9 @@ static int dsa_slave_open(struct net_device *dev)
                        goto clear_allmulti;
        }
 
+       if (p->phy)
+               phy_start(p->phy);
+
        return 0;
 
 clear_allmulti:
@@ -101,6 +104,9 @@ static int dsa_slave_close(struct net_device *dev)
        struct dsa_slave_priv *p = netdev_priv(dev);
        struct net_device *master = p->parent->dst->master_netdev;
 
+       if (p->phy)
+               phy_stop(p->phy);
+
        dev_mc_unsync(master, dev);
        dev_uc_unsync(master, dev);
        if (dev->flags & IFF_ALLMULTI)