diff options
author | Eric Dumazet <edumazet@google.com> | 2012-09-16 09:17:26 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-19 15:40:15 -0400 |
commit | 2c60db037034d27f8c636403355d52872da92f81 (patch) | |
tree | 68efc9ad7d95069bbc84feeb24bc58d250610ba3 /net/core/dev.c | |
parent | 828de4f6bf6e785f7b5497f8f7cfd4d4fbcfdb7e (diff) | |
download | op-kernel-dev-2c60db037034d27f8c636403355d52872da92f81.zip op-kernel-dev-2c60db037034d27f8c636403355d52872da92f81.tar.gz |
net: provide a default dev->ethtool_ops
Instead of forcing device drivers to provide empty ethtool_ops or tweak
net/core/ethtool.c again, we could provide a generic ethtool_ops.
This occurred to me when I wanted to add GSO support to GRE tunnels.
ethtool -k support should be generic for all drivers.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Maciej Żenczykowski <maze@google.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index bb42eb1..bbda819 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5974,6 +5974,8 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev) return queue; } +static const struct ethtool_ops default_ethtool_ops; + /** * alloc_netdev_mqs - allocate network device * @sizeof_priv: size of private data to allocate space for @@ -6061,6 +6063,8 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, strcpy(dev->name, name); dev->group = INIT_NETDEV_GROUP; + if (!dev->ethtool_ops) + dev->ethtool_ops = &default_ethtool_ops; return dev; free_all: |