ethtool: Provide a default implementation of ethtool_ops::get_drvinfo

The driver name and bus address for a net_device can normally be found
through the driver model now.  Instead of requiring drivers to provide
this information redundantly through the ethtool_ops::get_drvinfo
operation, use the driver model to do so if the driver does not define
the operation.  Since ETHTOOL_GDRVINFO no longer requires the driver
to implement any operations, do not require net_device::ethtool_ops to
be set either.

Remove implementations of get_drvinfo and ethtool_ops that provide
only this information.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ben Hutchings 2010-08-17 02:31:15 -07:00 committed by David S. Miller
parent bb8a10bbd1
commit 0141480205
17 changed files with 23 additions and 208 deletions

View file

@ -705,19 +705,6 @@ static int virtnet_close(struct net_device *dev)
return 0;
}
static void virtnet_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
struct virtnet_info *vi = netdev_priv(dev);
struct virtio_device *vdev = vi->vdev;
strncpy(drvinfo->driver, KBUILD_MODNAME, ARRAY_SIZE(drvinfo->driver));
strncpy(drvinfo->version, "N/A", ARRAY_SIZE(drvinfo->version));
strncpy(drvinfo->fw_version, "N/A", ARRAY_SIZE(drvinfo->fw_version));
strncpy(drvinfo->bus_info, dev_name(&vdev->dev),
ARRAY_SIZE(drvinfo->bus_info));
}
static int virtnet_set_tx_csum(struct net_device *dev, u32 data)
{
struct virtnet_info *vi = netdev_priv(dev);
@ -830,7 +817,6 @@ static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid)
}
static const struct ethtool_ops virtnet_ethtool_ops = {
.get_drvinfo = virtnet_get_drvinfo,
.set_tx_csum = virtnet_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = ethtool_op_set_tso,