aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dsa/slave.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index a68fd79e9eca..99114e5b32e4 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -48,6 +48,16 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
48 48
49 49
50/* slave device handling ****************************************************/ 50/* slave device handling ****************************************************/
51static int dsa_slave_init(struct net_device *dev)
52{
53 struct dsa_slave_priv *p = netdev_priv(dev);
54 struct net_device *master = p->parent->master_netdev;
55
56 dev->iflink = master->ifindex;
57
58 return 0;
59}
60
51static int dsa_slave_open(struct net_device *dev) 61static int dsa_slave_open(struct net_device *dev)
52{ 62{
53 struct dsa_slave_priv *p = netdev_priv(dev); 63 struct dsa_slave_priv *p = netdev_priv(dev);
@@ -288,6 +298,7 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
288 298
289#ifdef CONFIG_NET_DSA_TAG_DSA 299#ifdef CONFIG_NET_DSA_TAG_DSA
290static const struct net_device_ops dsa_netdev_ops = { 300static const struct net_device_ops dsa_netdev_ops = {
301 .ndo_init = dsa_slave_init,
291 .ndo_open = dsa_slave_open, 302 .ndo_open = dsa_slave_open,
292 .ndo_stop = dsa_slave_close, 303 .ndo_stop = dsa_slave_close,
293 .ndo_start_xmit = dsa_xmit, 304 .ndo_start_xmit = dsa_xmit,
@@ -300,6 +311,7 @@ static const struct net_device_ops dsa_netdev_ops = {
300#endif 311#endif
301#ifdef CONFIG_NET_DSA_TAG_EDSA 312#ifdef CONFIG_NET_DSA_TAG_EDSA
302static const struct net_device_ops edsa_netdev_ops = { 313static const struct net_device_ops edsa_netdev_ops = {
314 .ndo_init = dsa_slave_init,
303 .ndo_open = dsa_slave_open, 315 .ndo_open = dsa_slave_open,
304 .ndo_stop = dsa_slave_close, 316 .ndo_stop = dsa_slave_close,
305 .ndo_start_xmit = edsa_xmit, 317 .ndo_start_xmit = edsa_xmit,
@@ -312,6 +324,7 @@ static const struct net_device_ops edsa_netdev_ops = {
312#endif 324#endif
313#ifdef CONFIG_NET_DSA_TAG_TRAILER 325#ifdef CONFIG_NET_DSA_TAG_TRAILER
314static const struct net_device_ops trailer_netdev_ops = { 326static const struct net_device_ops trailer_netdev_ops = {
327 .ndo_init = dsa_slave_init,
315 .ndo_open = dsa_slave_open, 328 .ndo_open = dsa_slave_open,
316 .ndo_stop = dsa_slave_close, 329 .ndo_stop = dsa_slave_close,
317 .ndo_start_xmit = trailer_xmit, 330 .ndo_start_xmit = trailer_xmit,