diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2013-01-10 18:19:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-11 18:55:48 -0500 |
commit | d07d7507bfb4e23735c9b83e397c43e1e8a173e8 (patch) | |
tree | 1422f8bc9cfa0340a7b1cdec03456a6bf5e3a7d5 /net/core/dev.c | |
parent | f7e9e230f41f991a6e3e7cb6096424fdfb626081 (diff) |
net, wireless: overwrite default_ethtool_ops
Since:
commit 2c60db037034d27f8c636403355d52872da92f81
Author: Eric Dumazet <edumazet@google.com>
Date: Sun Sep 16 09:17:26 2012 +0000
net: provide a default dev->ethtool_ops
wireless core does not correctly assign ethtool_ops.
After alloc_netdev*() call, some cfg80211 drivers provide they own
ethtool_ops, but some do not. For them, wireless core provide generic
cfg80211_ethtool_ops, which is assigned in NETDEV_REGISTER notify call:
if (!dev->ethtool_ops)
dev->ethtool_ops = &cfg80211_ethtool_ops;
But after Eric's commit, dev->ethtool_ops is no longer NULL (on cfg80211
drivers without custom ethtool_ops), but points to &default_ethtool_ops.
In order to fix the problem, provide function which will overwrite
default_ethtool_ops and use it by wireless core.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Acked-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 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 515473ee52cb..f64e439b4a00 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -6121,6 +6121,14 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev) | |||
6121 | 6121 | ||
6122 | static const struct ethtool_ops default_ethtool_ops; | 6122 | static const struct ethtool_ops default_ethtool_ops; |
6123 | 6123 | ||
6124 | void netdev_set_default_ethtool_ops(struct net_device *dev, | ||
6125 | const struct ethtool_ops *ops) | ||
6126 | { | ||
6127 | if (dev->ethtool_ops == &default_ethtool_ops) | ||
6128 | dev->ethtool_ops = ops; | ||
6129 | } | ||
6130 | EXPORT_SYMBOL_GPL(netdev_set_default_ethtool_ops); | ||
6131 | |||
6124 | /** | 6132 | /** |
6125 | * alloc_netdev_mqs - allocate network device | 6133 | * alloc_netdev_mqs - allocate network device |
6126 | * @sizeof_priv: size of private data to allocate space for | 6134 | * @sizeof_priv: size of private data to allocate space for |