From: Stephen Hemminger <shemminger@vyatta.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 1/2] macvlan: add support for ethtool get settings
Date: Wed, 29 Oct 2008 12:53:43 -0700 [thread overview]
Message-ID: <20081029125343.695eeb3c@extreme> (raw)
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>
--- 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)
next reply other threads:[~2008-10-29 19:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-29 19:53 Stephen Hemminger [this message]
2008-10-29 19:59 ` [PATCH 2/2] macvlan: propogate mtu changes Stephen Hemminger
2008-10-29 21:02 ` Patrick McHardy
2008-10-29 21:05 ` Patrick McHardy
2008-10-29 21:05 ` David Miller
2008-10-29 21:06 ` Patrick McHardy
2008-10-29 21:01 ` [PATCH 1/2] macvlan: add support for ethtool get settings Patrick McHardy
2008-10-29 22:32 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081029125343.695eeb3c@extreme \
--to=shemminger@vyatta.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).