diff options
author | Patrick McHardy <kaber@trash.net> | 2009-04-20 00:49:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-21 05:00:51 -0400 |
commit | b1b67dd45a6b629eb41553856805aaa1614fbb83 (patch) | |
tree | 23d2b8dc59223b649f466564dac338c899595a7c /drivers/net/macvlan.c | |
parent | 4510d7cb8b4e7d389652b8a4f89fad469a5ecc92 (diff) |
net: factor out ethtool invocation of vlan/macvlan drivers
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r-- | drivers/net/macvlan.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 214a8cf2b708..329cd50d0e29 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -374,36 +374,20 @@ static void macvlan_ethtool_get_drvinfo(struct net_device *dev, | |||
374 | static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev) | 374 | static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev) |
375 | { | 375 | { |
376 | const struct macvlan_dev *vlan = netdev_priv(dev); | 376 | const struct macvlan_dev *vlan = netdev_priv(dev); |
377 | struct net_device *lowerdev = vlan->lowerdev; | 377 | return dev_ethtool_get_rx_csum(vlan->lowerdev); |
378 | |||
379 | if (lowerdev->ethtool_ops == NULL || | ||
380 | lowerdev->ethtool_ops->get_rx_csum == NULL) | ||
381 | return 0; | ||
382 | return lowerdev->ethtool_ops->get_rx_csum(lowerdev); | ||
383 | } | 378 | } |
384 | 379 | ||
385 | static int macvlan_ethtool_get_settings(struct net_device *dev, | 380 | static int macvlan_ethtool_get_settings(struct net_device *dev, |
386 | struct ethtool_cmd *cmd) | 381 | struct ethtool_cmd *cmd) |
387 | { | 382 | { |
388 | const struct macvlan_dev *vlan = netdev_priv(dev); | 383 | const struct macvlan_dev *vlan = netdev_priv(dev); |
389 | struct net_device *lowerdev = vlan->lowerdev; | 384 | return dev_ethtool_get_settings(vlan->lowerdev, cmd); |
390 | |||
391 | if (!lowerdev->ethtool_ops || | ||
392 | !lowerdev->ethtool_ops->get_settings) | ||
393 | return -EOPNOTSUPP; | ||
394 | |||
395 | return lowerdev->ethtool_ops->get_settings(lowerdev, cmd); | ||
396 | } | 385 | } |
397 | 386 | ||
398 | static u32 macvlan_ethtool_get_flags(struct net_device *dev) | 387 | static u32 macvlan_ethtool_get_flags(struct net_device *dev) |
399 | { | 388 | { |
400 | const struct macvlan_dev *vlan = netdev_priv(dev); | 389 | const struct macvlan_dev *vlan = netdev_priv(dev); |
401 | struct net_device *lowerdev = vlan->lowerdev; | 390 | return dev_ethtool_get_flags(vlan->lowerdev); |
402 | |||
403 | if (!lowerdev->ethtool_ops || | ||
404 | !lowerdev->ethtool_ops->get_flags) | ||
405 | return 0; | ||
406 | return lowerdev->ethtool_ops->get_flags(lowerdev); | ||
407 | } | 391 | } |
408 | 392 | ||
409 | static const struct ethtool_ops macvlan_ethtool_ops = { | 393 | static const struct ethtool_ops macvlan_ethtool_ops = { |