linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Stanislaw Gruszka <sgruszka@redhat.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Ben Hutchings <bhutchings@solarflare.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [ 19/61] net, wireless: overwrite default_ethtool_ops
Date: Tue, 12 Feb 2013 12:34:39 -0800	[thread overview]
Message-ID: <20130212203420.957757920@linuxfoundation.org> (raw)
In-Reply-To: <20130212203417.890993903@linuxfoundation.org>

3.7-stable review patch.  If anyone has any objections, please let me know.

------------------


From: Stanislaw Gruszka <sgruszka@redhat.com>

[ Upstream commit d07d7507bfb4e23735c9b83e397c43e1e8a173e8 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/netdevice.h |    3 +++
 net/core/dev.c            |    8 ++++++++
 net/wireless/core.c       |    3 +--
 3 files changed, 12 insertions(+), 2 deletions(-)

--- a/include/linux/netdevice.h
+++ b/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 */
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6012,6 +6012,14 @@ struct netdev_queue *dev_ingress_queue_c
 
 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
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -856,8 +856,7 @@ static int cfg80211_netdev_notifier_call
 		/* 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 ||



  parent reply	other threads:[~2013-02-12 20:35 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 20:34 [ 00/61] 3.7.8-stable review Greg Kroah-Hartman
2013-02-12 20:34 ` [ 01/61] rtlwifi: Fix the usage of the wrong variable in usb.c Greg Kroah-Hartman
2013-02-12 20:34 ` [ 02/61] rtlwifi: Fix scheduling while atomic bug Greg Kroah-Hartman
2013-02-12 20:34 ` [ 03/61] regulator: max8998: fix incorrect min_uV value for ldo10 Greg Kroah-Hartman
2013-02-12 20:34 ` [ 04/61] regulator: clear state each invocation of of_regulator_match Greg Kroah-Hartman
2013-02-12 20:34 ` [ 05/61] regulator: s2mps11: fix incorrect register for buck10 Greg Kroah-Hartman
2013-02-12 20:34 ` [ 06/61] IB/qib: Fix for broken sparse warning fix Greg Kroah-Hartman
2013-02-12 20:34 ` [ 07/61] virtio_console: Dont access uninitialized data Greg Kroah-Hartman
2013-02-12 20:34 ` [ 08/61] Bluetooth: Fix handling of unexpected SMP PDUs Greg Kroah-Hartman
2013-02-12 20:34 ` [ 09/61] Revert "iwlwifi: fix the reclaimed packet tracking upon flush queue" Greg Kroah-Hartman
2013-02-12 20:34 ` [ 10/61] can: c_can: Set reserved bit in IFx_MASK2 to 1 on write Greg Kroah-Hartman
2013-02-12 20:34 ` [ 11/61] mwifiex: fix incomplete scan in case of IE parsing error Greg Kroah-Hartman
2013-02-12 20:34 ` [ 12/61] e1000e: enable ECC on I217/I218 to catch packet buffer memory errors Greg Kroah-Hartman
2013-02-12 20:34 ` [ 13/61] media: pwc-if: must check vb2_queue_init() success Greg Kroah-Hartman
2013-02-12 20:34 ` [ 14/61] ath9k_hw: fix calibration issues on chainmask that dont include chain 0 Greg Kroah-Hartman
2013-02-12 20:34 ` [ 15/61] mfd: db8500-prcmu: Fix irqdomain usage Greg Kroah-Hartman
2013-02-12 20:34 ` [ 16/61] dm thin: fix queue limits stacking Greg Kroah-Hartman
2013-02-12 20:34 ` [ 17/61] net: prevent setting ttl=0 via IP_TTL Greg Kroah-Hartman
2013-02-12 20:34 ` [ 18/61] ipv6: fix the noflags test in addrconf_get_prefix_route Greg Kroah-Hartman
2013-02-12 20:34 ` Greg Kroah-Hartman [this message]
2013-02-12 20:34 ` [ 20/61] tcp: fix a panic on UP machines in reqsk_fastopen_remove Greg Kroah-Hartman
2013-02-12 20:34 ` [ 21/61] MAINTAINERS: Stephen Hemminger email change Greg Kroah-Hartman
2013-02-12 20:34 ` [ 22/61] ipv6: fix header length calculation in ip6_append_data() Greg Kroah-Hartman
2013-02-12 20:34 ` [ 23/61] macvlan: fix macvlan_get_size() Greg Kroah-Hartman
2013-02-12 20:34 ` [ 24/61] net: calxedaxgmac: throw away overrun frames Greg Kroah-Hartman
2013-02-12 20:34 ` [ 25/61] net/mlx4_en: Fix bridged vSwitch configuration for non SRIOV mode Greg Kroah-Hartman
2013-02-12 20:34 ` [ 26/61] net/mlx4_core: Set number of msix vectors under SRIOV mode to firmware defaults Greg Kroah-Hartman
2013-02-12 20:34 ` [ 27/61] tcp: fix incorrect LOCKDROPPEDICMPS counter Greg Kroah-Hartman
2013-02-12 20:34 ` [ 28/61] isdn/gigaset: fix zero size border case in debug dump Greg Kroah-Hartman
2013-02-12 20:34 ` [ 29/61] netxen: fix off by one bug in netxen_release_tx_buffer() Greg Kroah-Hartman
2013-02-12 20:34 ` [ 30/61] r8169: remove the obsolete and incorrect AMD workaround Greg Kroah-Hartman
2013-02-12 20:34 ` [ 31/61] net: loopback: fix a dst refcounting issue Greg Kroah-Hartman
2013-02-12 20:34 ` [ 32/61] IP_GRE: Fix kernel panic in IP_GRE with GRE csum Greg Kroah-Hartman
2013-02-12 20:34 ` [ 33/61] pktgen: correctly handle failures when adding a device Greg Kroah-Hartman
2013-02-12 20:34 ` [ 34/61] ipv6: do not create neighbor entries for local delivery Greg Kroah-Hartman
2013-02-12 20:34 ` [ 35/61] via-rhine: Fix bugs in NAPI support Greg Kroah-Hartman
2013-02-12 20:34 ` [ 36/61] packet: fix leakage of tx_ring memory Greg Kroah-Hartman
2013-02-12 20:34 ` [ 37/61] ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit() Greg Kroah-Hartman
2013-02-12 20:34 ` [ 38/61] atm/iphase: rename fregt_t -> ffreg_t Greg Kroah-Hartman
2013-02-12 20:34 ` [ 39/61] xen/netback: shutdown the ring if it contains garbage Greg Kroah-Hartman
2013-02-12 20:35 ` [ 40/61] xen/netback: dont leak pages on failure in xen_netbk_tx_check_gop Greg Kroah-Hartman
2013-02-12 20:35 ` [ 41/61] xen/netback: free already allocated memory on failure in xen_netbk_get_requests Greg Kroah-Hartman
2013-02-12 20:35 ` [ 42/61] netback: correct netbk_tx_err to handle wrap around Greg Kroah-Hartman
2013-02-12 20:35 ` [ 43/61] ipv4: Remove output route check in ipv4_mtu Greg Kroah-Hartman
2013-02-12 20:35 ` [ 44/61] ipv4: Dont update the pmtu on mtu locked routes Greg Kroah-Hartman
2013-02-12 20:35 ` [ 45/61] ipv6: Add an error handler for icmp6 Greg Kroah-Hartman
2013-02-12 20:35 ` [ 46/61] ipv4: Invalidate the socket cached route on pmtu events if possible Greg Kroah-Hartman
2013-02-12 20:35 ` [ 47/61] ipv4: Add a socket release callback for datagram sockets Greg Kroah-Hartman
2013-02-12 20:35 ` [ 48/61] ipv4: Fix route refcount on pmtu discovery Greg Kroah-Hartman
2013-02-12 20:35 ` [ 49/61] sctp: refactor sctp_outq_teardown to insure proper re-initalization Greg Kroah-Hartman
2013-02-12 20:35 ` [ 50/61] net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree Greg Kroah-Hartman
2013-02-12 20:35 ` [ 51/61] net: sctp: sctp_endpoint_free: zero out secret key data Greg Kroah-Hartman
2013-02-12 20:35 ` [ 52/61] tcp: detect SYN/data drop when F-RTO is disabled Greg Kroah-Hartman
2013-02-12 20:35 ` [ 53/61] tcp: fix an infinite loop in tcp_slow_start() Greg Kroah-Hartman
2013-02-12 20:35 ` [ 54/61] tcp: frto should not set snd_cwnd to 0 Greg Kroah-Hartman
2013-02-12 20:35 ` [ 55/61] tcp: fix for zero packets_in_flight was too broad Greg Kroah-Hartman
2013-02-12 20:35 ` [ 56/61] tcp: dont abort splice() after small transfers Greg Kroah-Hartman
2013-02-12 20:35 ` [ 57/61] tcp: splice: fix an infinite loop in tcp_read_sock() Greg Kroah-Hartman
2013-02-12 20:35 ` [ 58/61] tcp: fix splice() and tcp collapsing interaction Greg Kroah-Hartman
2013-02-12 20:35 ` [ 59/61] net: splice: avoid high order page splitting Greg Kroah-Hartman
2013-02-12 20:35 ` [ 60/61] net: splice: fix __splice_segment() Greg Kroah-Hartman
2013-02-12 20:35 ` [ 61/61] drm/nouveau: add lockdep annotations Greg Kroah-Hartman
2013-02-13  3:35   ` Peter Hurley
2013-02-13  9:33     ` Arend van Spriel
2013-02-13  9:43       ` Ben Skeggs
2013-02-13  9:52         ` Arend van Spriel
2013-02-13 17:46         ` Marcin Slusarz
2013-02-13 18:38           ` Marcin Slusarz
2013-02-13  7:06 ` [ 00/61] 3.7.8-stable review Satoru Takeuchi
2013-02-13 15:51 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130212203420.957757920@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).