summaryrefslogtreecommitdiff
path: root/net/dsa
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-10-29 13:45:54 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-10-29 13:45:54 -0300
commita71852147516bc1cb5b0b3cbd13639bfd4022dc8 (patch)
treee1950ad489b1cc9f4404c643d94ff87ba595a8c1 /net/dsa
parentbadc0e42604c4465facd81d2323e98b3b1eb9188 (diff)
Linux-libre 4.2.5-gnupck-4.2.5-gnu
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 35c47ddd0..25dbb91e1 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -348,12 +348,17 @@ static int dsa_slave_stp_update(struct net_device *dev, u8 state)
static int dsa_slave_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr)
{
- int ret = 0;
+ struct dsa_slave_priv *p = netdev_priv(dev);
+ struct dsa_switch *ds = p->parent;
+ int ret;
switch (attr->id) {
case SWITCHDEV_ATTR_PORT_STP_STATE:
- if (attr->trans == SWITCHDEV_TRANS_COMMIT)
- ret = dsa_slave_stp_update(dev, attr->u.stp_state);
+ if (attr->trans == SWITCHDEV_TRANS_PREPARE)
+ ret = ds->drv->port_stp_update ? 0 : -EOPNOTSUPP;
+ else
+ ret = ds->drv->port_stp_update(ds, p->port,
+ attr->u.stp_state);
break;
default:
ret = -EOPNOTSUPP;