diff options
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r-- | net/dsa/slave.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 91de3a663226..70395a0ae52e 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -362,18 +362,23 @@ static int dsa_slave_port_obj_del(struct net_device *dev, | |||
362 | return err; | 362 | return err; |
363 | } | 363 | } |
364 | 364 | ||
365 | static int dsa_slave_port_attr_get(struct net_device *dev, | 365 | static int dsa_slave_get_port_parent_id(struct net_device *dev, |
366 | struct switchdev_attr *attr) | 366 | struct netdev_phys_item_id *ppid) |
367 | { | 367 | { |
368 | struct dsa_port *dp = dsa_slave_to_port(dev); | 368 | struct dsa_port *dp = dsa_slave_to_port(dev); |
369 | struct dsa_switch *ds = dp->ds; | 369 | struct dsa_switch *ds = dp->ds; |
370 | struct dsa_switch_tree *dst = ds->dst; | 370 | struct dsa_switch_tree *dst = ds->dst; |
371 | 371 | ||
372 | ppid->id_len = sizeof(dst->index); | ||
373 | memcpy(&ppid->id, &dst->index, ppid->id_len); | ||
374 | |||
375 | return 0; | ||
376 | } | ||
377 | |||
378 | static int dsa_slave_port_attr_get(struct net_device *dev, | ||
379 | struct switchdev_attr *attr) | ||
380 | { | ||
372 | switch (attr->id) { | 381 | switch (attr->id) { |
373 | case SWITCHDEV_ATTR_ID_PORT_PARENT_ID: | ||
374 | attr->u.ppid.id_len = sizeof(dst->index); | ||
375 | memcpy(&attr->u.ppid.id, &dst->index, attr->u.ppid.id_len); | ||
376 | break; | ||
377 | case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT: | 382 | case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT: |
378 | attr->u.brport_flags_support = 0; | 383 | attr->u.brport_flags_support = 0; |
379 | break; | 384 | break; |
@@ -1046,6 +1051,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = { | |||
1046 | .ndo_get_phys_port_name = dsa_slave_get_phys_port_name, | 1051 | .ndo_get_phys_port_name = dsa_slave_get_phys_port_name, |
1047 | .ndo_setup_tc = dsa_slave_setup_tc, | 1052 | .ndo_setup_tc = dsa_slave_setup_tc, |
1048 | .ndo_get_stats64 = dsa_slave_get_stats64, | 1053 | .ndo_get_stats64 = dsa_slave_get_stats64, |
1054 | .ndo_get_port_parent_id = dsa_slave_get_port_parent_id, | ||
1049 | }; | 1055 | }; |
1050 | 1056 | ||
1051 | static const struct switchdev_ops dsa_slave_switchdev_ops = { | 1057 | static const struct switchdev_ops dsa_slave_switchdev_ops = { |