From 634a0006781b92b4dea9b94096f971dd03c4528f Mon Sep 17 00:00:00 2001 From: Stanislaw Gruszka Date: Thu, 10 Jan 2013 23:19:10 +0000 Subject: [PATCH] --- yaml --- r: 348629 b: refs/heads/master c: d07d7507bfb4e23735c9b83e397c43e1e8a173e8 h: refs/heads/master i: 348627: c9cdb0d5b84b9d462de7b6b729ae9de4f014dfe6 v: v3 --- [refs] | 2 +- trunk/include/linux/netdevice.h | 3 +++ trunk/net/core/dev.c | 8 ++++++++ trunk/net/wireless/core.c | 3 +-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 17362f8df715..bd55f5387f49 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f7e9e230f41f991a6e3e7cb6096424fdfb626081 +refs/heads/master: d07d7507bfb4e23735c9b83e397c43e1e8a173e8 diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index c599e4782d45..9ef07d0868b6 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -60,6 +60,9 @@ struct wireless_dev; #define SET_ETHTOOL_OPS(netdev,ops) \ ( (netdev)->ethtool_ops = (ops) ) +extern void netdev_set_default_ethtool_ops(struct net_device *dev, + const struct ethtool_ops *ops); + /* hardware address assignment types */ #define NET_ADDR_PERM 0 /* address is permanent (default) */ #define NET_ADDR_RANDOM 1 /* address is generated randomly */ diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 515473ee52cb..f64e439b4a00 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -6121,6 +6121,14 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev) static const struct ethtool_ops default_ethtool_ops; +void netdev_set_default_ethtool_ops(struct net_device *dev, + const struct ethtool_ops *ops) +{ + if (dev->ethtool_ops == &default_ethtool_ops) + dev->ethtool_ops = ops; +} +EXPORT_SYMBOL_GPL(netdev_set_default_ethtool_ops); + /** * alloc_netdev_mqs - allocate network device * @sizeof_priv: size of private data to allocate space for diff --git a/trunk/net/wireless/core.c b/trunk/net/wireless/core.c index 14d990400354..b677eab55b68 100644 --- a/trunk/net/wireless/core.c +++ b/trunk/net/wireless/core.c @@ -866,8 +866,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, /* allow mac80211 to determine the timeout */ wdev->ps_timeout = -1; - if (!dev->ethtool_ops) - dev->ethtool_ops = &cfg80211_ethtool_ops; + netdev_set_default_ethtool_ops(dev, &cfg80211_ethtool_ops); if ((wdev->iftype == NL80211_IFTYPE_STATION || wdev->iftype == NL80211_IFTYPE_P2P_CLIENT ||