diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-10-29 01:12:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-29 02:02:34 -0400 |
commit | b30200616f97a81243e6d0c644d8ab06bf0b8115 (patch) | |
tree | a87436afe55a6d8f5323df8ce7af99315713b78e /net/8021q/vlan_dev.c | |
parent | 3717746ef8b5a9279281b5d318496710984ed739 (diff) |
vlan: propogate ethtool speed values
This enables more ethtool information. The speed and settings of the
underlying device are propagated up. This makes services like SNMP that
use ethtool to get speed setting, work when managing a vlan, without adding
silly heurtistics into SNMP daemon.
For the driver info, just use existing driver strings.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r-- | net/8021q/vlan_dev.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 8883e9c8a223..c269fcbd13d5 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -648,6 +648,26 @@ static void vlan_dev_uninit(struct net_device *dev) | |||
648 | } | 648 | } |
649 | } | 649 | } |
650 | 650 | ||
651 | static int vlan_ethtool_get_settings(struct net_device *dev, | ||
652 | struct ethtool_cmd *cmd) | ||
653 | { | ||
654 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); | ||
655 | struct net_device *real_dev = vlan->real_dev; | ||
656 | |||
657 | if (!real_dev->ethtool_ops->get_settings) | ||
658 | return -EOPNOTSUPP; | ||
659 | |||
660 | return real_dev->ethtool_ops->get_settings(real_dev, cmd); | ||
661 | } | ||
662 | |||
663 | static void vlan_ethtool_get_drvinfo(struct net_device *dev, | ||
664 | struct ethtool_drvinfo *info) | ||
665 | { | ||
666 | strcpy(info->driver, vlan_fullname); | ||
667 | strcpy(info->version, vlan_version); | ||
668 | strcpy(info->fw_version, "N/A"); | ||
669 | } | ||
670 | |||
651 | static u32 vlan_ethtool_get_rx_csum(struct net_device *dev) | 671 | static u32 vlan_ethtool_get_rx_csum(struct net_device *dev) |
652 | { | 672 | { |
653 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); | 673 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); |
@@ -672,6 +692,8 @@ static u32 vlan_ethtool_get_flags(struct net_device *dev) | |||
672 | } | 692 | } |
673 | 693 | ||
674 | static const struct ethtool_ops vlan_ethtool_ops = { | 694 | static const struct ethtool_ops vlan_ethtool_ops = { |
695 | .get_settings = vlan_ethtool_get_settings, | ||
696 | .get_drvinfo = vlan_ethtool_get_drvinfo, | ||
675 | .get_link = ethtool_op_get_link, | 697 | .get_link = ethtool_op_get_link, |
676 | .get_rx_csum = vlan_ethtool_get_rx_csum, | 698 | .get_rx_csum = vlan_ethtool_get_rx_csum, |
677 | .get_flags = vlan_ethtool_get_flags, | 699 | .get_flags = vlan_ethtool_get_flags, |