diff options
| -rw-r--r-- | include/linux/netdevice.h | 3 | ||||
| -rw-r--r-- | net/core/dev.c | 8 | ||||
| -rw-r--r-- | net/wireless/core.c | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c599e4782d4..9ef07d0868b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -60,6 +60,9 @@ struct wireless_dev; | |||
| 60 | #define SET_ETHTOOL_OPS(netdev,ops) \ | 60 | #define SET_ETHTOOL_OPS(netdev,ops) \ |
| 61 | ( (netdev)->ethtool_ops = (ops) ) | 61 | ( (netdev)->ethtool_ops = (ops) ) |
| 62 | 62 | ||
| 63 | extern void netdev_set_default_ethtool_ops(struct net_device *dev, | ||
| 64 | const struct ethtool_ops *ops); | ||
| 65 | |||
| 63 | /* hardware address assignment types */ | 66 | /* hardware address assignment types */ |
| 64 | #define NET_ADDR_PERM 0 /* address is permanent (default) */ | 67 | #define NET_ADDR_PERM 0 /* address is permanent (default) */ |
| 65 | #define NET_ADDR_RANDOM 1 /* address is generated randomly */ | 68 | #define NET_ADDR_RANDOM 1 /* address is generated randomly */ |
diff --git a/net/core/dev.c b/net/core/dev.c index 515473ee52c..f64e439b4a0 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 |
diff --git a/net/wireless/core.c b/net/wireless/core.c index 14d99040035..b677eab55b6 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
| @@ -866,8 +866,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
| 866 | /* allow mac80211 to determine the timeout */ | 866 | /* allow mac80211 to determine the timeout */ |
| 867 | wdev->ps_timeout = -1; | 867 | wdev->ps_timeout = -1; |
| 868 | 868 | ||
| 869 | if (!dev->ethtool_ops) | 869 | netdev_set_default_ethtool_ops(dev, &cfg80211_ethtool_ops); |
| 870 | dev->ethtool_ops = &cfg80211_ethtool_ops; | ||
| 871 | 870 | ||
| 872 | if ((wdev->iftype == NL80211_IFTYPE_STATION || | 871 | if ((wdev->iftype == NL80211_IFTYPE_STATION || |
| 873 | wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || | 872 | wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || |
