diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-10-29 18:31:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-29 18:31:53 -0400 |
commit | 9edb8bb68b5ea63061ba833831b00c229ac9fbd2 (patch) | |
tree | 393425309ce96e2a4dd7b4cdb11b4a4ba651028a /drivers | |
parent | 6b9a1066f8d4c57c1b778affd91fc38e1121b6f8 (diff) |
macvlan: add support for ethtool get settings
If macvlan's are used, it is useful to propgate speed and other settings
from underlying device up for application usage.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/macvlan.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 42394505bb50..1d2de0b77a2c 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -333,10 +333,34 @@ static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev) | |||
333 | return lowerdev->ethtool_ops->get_rx_csum(lowerdev); | 333 | return lowerdev->ethtool_ops->get_rx_csum(lowerdev); |
334 | } | 334 | } |
335 | 335 | ||
336 | static int macvlan_ethtool_get_settings(struct net_device *dev, | ||
337 | struct ethtool_cmd *cmd) | ||
338 | { | ||
339 | const struct macvlan_dev *vlan = netdev_priv(dev); | ||
340 | struct net_device *lowerdev = vlan->lowerdev; | ||
341 | |||
342 | if (!lowerdev->ethtool_ops->get_settings) | ||
343 | return -EOPNOTSUPP; | ||
344 | |||
345 | return lowerdev->ethtool_ops->get_settings(lowerdev, cmd); | ||
346 | } | ||
347 | |||
348 | static u32 macvlan_ethtool_get_flags(struct net_device *dev) | ||
349 | { | ||
350 | const struct macvlan_dev *vlan = netdev_priv(dev); | ||
351 | struct net_device *lowerdev = vlan->lowerdev; | ||
352 | |||
353 | if (!lowerdev->ethtool_ops->get_flags) | ||
354 | return 0; | ||
355 | return lowerdev->ethtool_ops->get_flags(lowerdev); | ||
356 | } | ||
357 | |||
336 | static const struct ethtool_ops macvlan_ethtool_ops = { | 358 | static const struct ethtool_ops macvlan_ethtool_ops = { |
337 | .get_link = ethtool_op_get_link, | 359 | .get_link = ethtool_op_get_link, |
360 | .get_settings = macvlan_ethtool_get_settings, | ||
338 | .get_rx_csum = macvlan_ethtool_get_rx_csum, | 361 | .get_rx_csum = macvlan_ethtool_get_rx_csum, |
339 | .get_drvinfo = macvlan_ethtool_get_drvinfo, | 362 | .get_drvinfo = macvlan_ethtool_get_drvinfo, |
363 | .get_flags = macvlan_ethtool_get_flags, | ||
340 | }; | 364 | }; |
341 | 365 | ||
342 | static void macvlan_setup(struct net_device *dev) | 366 | static void macvlan_setup(struct net_device *dev) |