summaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-10-29 23:31:53 +0100
committerDavid S. Miller <davem@davemloft.net>2008-10-29 23:31:53 +0100
commit9edb8bb68b5ea63061ba833831b00c229ac9fbd2 (patch)
tree393425309ce96e2a4dd7b4cdb11b4a4ba651028a /drivers/net/macvlan.c
parentprintk: remove %p6 format specifier, fix up comments (diff)
downloadlinux-9edb8bb68b5ea63061ba833831b00c229ac9fbd2.tar.xz
linux-9edb8bb68b5ea63061ba833831b00c229ac9fbd2.zip
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/net/macvlan.c')
-rw-r--r--drivers/net/macvlan.c24
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)
return lowerdev->ethtool_ops->get_rx_csum(lowerdev);
}
+static int macvlan_ethtool_get_settings(struct net_device *dev,
+ struct ethtool_cmd *cmd)
+{
+ const struct macvlan_dev *vlan = netdev_priv(dev);
+ struct net_device *lowerdev = vlan->lowerdev;
+
+ if (!lowerdev->ethtool_ops->get_settings)
+ return -EOPNOTSUPP;
+
+ return lowerdev->ethtool_ops->get_settings(lowerdev, cmd);
+}
+
+static u32 macvlan_ethtool_get_flags(struct net_device *dev)
+{
+ const struct macvlan_dev *vlan = netdev_priv(dev);
+ struct net_device *lowerdev = vlan->lowerdev;
+
+ if (!lowerdev->ethtool_ops->get_flags)
+ return 0;
+ return lowerdev->ethtool_ops->get_flags(lowerdev);
+}
+
static const struct ethtool_ops macvlan_ethtool_ops = {
.get_link = ethtool_op_get_link,
+ .get_settings = macvlan_ethtool_get_settings,
.get_rx_csum = macvlan_ethtool_get_rx_csum,
.get_drvinfo = macvlan_ethtool_get_drvinfo,
+ .get_flags = macvlan_ethtool_get_flags,
};
static void macvlan_setup(struct net_device *dev)