diff options
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/slave.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 182d30ae6818..36953c84ff2d 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -342,6 +342,44 @@ static int dsa_slave_set_wol(struct net_device *dev, struct ethtool_wolinfo *w) | |||
342 | return ret; | 342 | return ret; |
343 | } | 343 | } |
344 | 344 | ||
345 | static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e) | ||
346 | { | ||
347 | struct dsa_slave_priv *p = netdev_priv(dev); | ||
348 | struct dsa_switch *ds = p->parent; | ||
349 | int ret; | ||
350 | |||
351 | if (!ds->drv->set_eee) | ||
352 | return -EOPNOTSUPP; | ||
353 | |||
354 | ret = ds->drv->set_eee(ds, p->port, p->phy, e); | ||
355 | if (ret) | ||
356 | return ret; | ||
357 | |||
358 | if (p->phy) | ||
359 | ret = phy_ethtool_set_eee(p->phy, e); | ||
360 | |||
361 | return ret; | ||
362 | } | ||
363 | |||
364 | static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e) | ||
365 | { | ||
366 | struct dsa_slave_priv *p = netdev_priv(dev); | ||
367 | struct dsa_switch *ds = p->parent; | ||
368 | int ret; | ||
369 | |||
370 | if (!ds->drv->get_eee) | ||
371 | return -EOPNOTSUPP; | ||
372 | |||
373 | ret = ds->drv->get_eee(ds, p->port, e); | ||
374 | if (ret) | ||
375 | return ret; | ||
376 | |||
377 | if (p->phy) | ||
378 | ret = phy_ethtool_get_eee(p->phy, e); | ||
379 | |||
380 | return ret; | ||
381 | } | ||
382 | |||
345 | static const struct ethtool_ops dsa_slave_ethtool_ops = { | 383 | static const struct ethtool_ops dsa_slave_ethtool_ops = { |
346 | .get_settings = dsa_slave_get_settings, | 384 | .get_settings = dsa_slave_get_settings, |
347 | .set_settings = dsa_slave_set_settings, | 385 | .set_settings = dsa_slave_set_settings, |
@@ -353,6 +391,8 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = { | |||
353 | .get_sset_count = dsa_slave_get_sset_count, | 391 | .get_sset_count = dsa_slave_get_sset_count, |
354 | .set_wol = dsa_slave_set_wol, | 392 | .set_wol = dsa_slave_set_wol, |
355 | .get_wol = dsa_slave_get_wol, | 393 | .get_wol = dsa_slave_get_wol, |
394 | .set_eee = dsa_slave_set_eee, | ||
395 | .get_eee = dsa_slave_get_eee, | ||
356 | }; | 396 | }; |
357 | 397 | ||
358 | static const struct net_device_ops dsa_slave_netdev_ops = { | 398 | static const struct net_device_ops dsa_slave_netdev_ops = { |