diff options
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/slave.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 4392e983abda..182d30ae6818 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -62,6 +62,7 @@ static int dsa_slave_open(struct net_device *dev) | |||
62 | { | 62 | { |
63 | struct dsa_slave_priv *p = netdev_priv(dev); | 63 | struct dsa_slave_priv *p = netdev_priv(dev); |
64 | struct net_device *master = p->parent->dst->master_netdev; | 64 | struct net_device *master = p->parent->dst->master_netdev; |
65 | struct dsa_switch *ds = p->parent; | ||
65 | int err; | 66 | int err; |
66 | 67 | ||
67 | if (!(master->flags & IFF_UP)) | 68 | if (!(master->flags & IFF_UP)) |
@@ -84,11 +85,20 @@ static int dsa_slave_open(struct net_device *dev) | |||
84 | goto clear_allmulti; | 85 | goto clear_allmulti; |
85 | } | 86 | } |
86 | 87 | ||
88 | if (ds->drv->port_enable) { | ||
89 | err = ds->drv->port_enable(ds, p->port, p->phy); | ||
90 | if (err) | ||
91 | goto clear_promisc; | ||
92 | } | ||
93 | |||
87 | if (p->phy) | 94 | if (p->phy) |
88 | phy_start(p->phy); | 95 | phy_start(p->phy); |
89 | 96 | ||
90 | return 0; | 97 | return 0; |
91 | 98 | ||
99 | clear_promisc: | ||
100 | if (dev->flags & IFF_PROMISC) | ||
101 | dev_set_promiscuity(master, 0); | ||
92 | clear_allmulti: | 102 | clear_allmulti: |
93 | if (dev->flags & IFF_ALLMULTI) | 103 | if (dev->flags & IFF_ALLMULTI) |
94 | dev_set_allmulti(master, -1); | 104 | dev_set_allmulti(master, -1); |
@@ -103,6 +113,7 @@ static int dsa_slave_close(struct net_device *dev) | |||
103 | { | 113 | { |
104 | struct dsa_slave_priv *p = netdev_priv(dev); | 114 | struct dsa_slave_priv *p = netdev_priv(dev); |
105 | struct net_device *master = p->parent->dst->master_netdev; | 115 | struct net_device *master = p->parent->dst->master_netdev; |
116 | struct dsa_switch *ds = p->parent; | ||
106 | 117 | ||
107 | if (p->phy) | 118 | if (p->phy) |
108 | phy_stop(p->phy); | 119 | phy_stop(p->phy); |
@@ -117,6 +128,9 @@ static int dsa_slave_close(struct net_device *dev) | |||
117 | if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) | 128 | if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) |
118 | dev_uc_del(master, dev->dev_addr); | 129 | dev_uc_del(master, dev->dev_addr); |
119 | 130 | ||
131 | if (ds->drv->port_disable) | ||
132 | ds->drv->port_disable(ds, p->port, p->phy); | ||
133 | |||
120 | return 0; | 134 | return 0; |
121 | } | 135 | } |
122 | 136 | ||