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 /net/8021q | |
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 'net/8021q')
-rw-r--r-- | net/8021q/vlan_dev.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 6b0921364014..04dc8c8a6854 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -666,13 +666,7 @@ static int vlan_ethtool_get_settings(struct net_device *dev, | |||
666 | struct ethtool_cmd *cmd) | 666 | struct ethtool_cmd *cmd) |
667 | { | 667 | { |
668 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); | 668 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); |
669 | struct net_device *real_dev = vlan->real_dev; | 669 | return dev_ethtool_get_settings(vlan->real_dev, cmd); |
670 | |||
671 | if (!real_dev->ethtool_ops || | ||
672 | !real_dev->ethtool_ops->get_settings) | ||
673 | return -EOPNOTSUPP; | ||
674 | |||
675 | return real_dev->ethtool_ops->get_settings(real_dev, cmd); | ||
676 | } | 670 | } |
677 | 671 | ||
678 | static void vlan_ethtool_get_drvinfo(struct net_device *dev, | 672 | static void vlan_ethtool_get_drvinfo(struct net_device *dev, |
@@ -686,24 +680,13 @@ static void vlan_ethtool_get_drvinfo(struct net_device *dev, | |||
686 | static u32 vlan_ethtool_get_rx_csum(struct net_device *dev) | 680 | static u32 vlan_ethtool_get_rx_csum(struct net_device *dev) |
687 | { | 681 | { |
688 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); | 682 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); |
689 | struct net_device *real_dev = vlan->real_dev; | 683 | return dev_ethtool_get_rx_csum(vlan->real_dev); |
690 | |||
691 | if (real_dev->ethtool_ops == NULL || | ||
692 | real_dev->ethtool_ops->get_rx_csum == NULL) | ||
693 | return 0; | ||
694 | return real_dev->ethtool_ops->get_rx_csum(real_dev); | ||
695 | } | 684 | } |
696 | 685 | ||
697 | static u32 vlan_ethtool_get_flags(struct net_device *dev) | 686 | static u32 vlan_ethtool_get_flags(struct net_device *dev) |
698 | { | 687 | { |
699 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); | 688 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); |
700 | struct net_device *real_dev = vlan->real_dev; | 689 | return dev_ethtool_get_flags(vlan->real_dev); |
701 | |||
702 | if (!(real_dev->features & NETIF_F_HW_VLAN_RX) || | ||
703 | real_dev->ethtool_ops == NULL || | ||
704 | real_dev->ethtool_ops->get_flags == NULL) | ||
705 | return 0; | ||
706 | return real_dev->ethtool_ops->get_flags(real_dev); | ||
707 | } | 690 | } |
708 | 691 | ||
709 | static const struct ethtool_ops vlan_ethtool_ops = { | 692 | static const struct ethtool_ops vlan_ethtool_ops = { |