Patchwork [1/2] macvlan: add support for ethtool get settings

login
register
mail settings
Submitter stephen hemminger
Date Oct. 29, 2008, 7:53 p.m.
Message ID <20081029125343.695eeb3c@extreme>
Download mbox | patch
Permalink /patch/6303/
State Accepted
Delegated to: David Miller
Headers show

Comments

stephen hemminger - Oct. 29, 2008, 7:53 p.m.
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>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Patrick McHardy - Oct. 29, 2008, 9:01 p.m.
Stephen Hemminger wrote:
> If macvlan's are used, it is useful to propgate speed and other settings
> from underlying device up for application usage.
>   

Acked-by: Patrick McHardy <kaber@trash.net>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Oct. 29, 2008, 10:32 p.m.
From: Patrick McHardy <kaber@trash.net>
Date: Wed, 29 Oct 2008 22:01:28 +0100

> Stephen Hemminger wrote:
> > If macvlan's are used, it is useful to propgate speed and other settings
> > from underlying device up for application usage.
> >   
> 
> Acked-by: Patrick McHardy <kaber@trash.net>

Applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/drivers/net/macvlan.c	2008-10-29 09:42:06.000000000 -0700
+++ b/drivers/net/macvlan.c	2008-10-29 09:52:11.000000000 -0700
@@ -333,10 +333,34 @@  static u32 macvlan_ethtool_get_rx_csum(s
 	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)