[patch 35/45] b43legacy: fix suspend/resume

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Thursday, February 7, 2008 - 1:48 pm

2.6.24-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Stefano Brivio <stefano.brivio@polimi.it>

patch ada50731c0346bf900dc387edd3a6961297bf2d3 in mainline.

This patch makes suspend/resume work with the b43legacy driver.
We must not overwrite the MAC addresses in the init function, as this
would also overwrite the MAC on resume. With an all-zero MAC the device
firmware is not able to ACK any received packets anymore.
Fix this by moving the initializion stuff that must be done on init but
not on resume to the start function.
Also zero out filter_flags to make sure we don't have some flags
from a previous instance for a tiny timeframe until mac80211 reconfigures
them.

This patch by Michael Buesch has been ported to b43legacy.

Cc: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/wireless/b43legacy/main.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3215,8 +3215,6 @@ static int b43legacy_wireless_core_init(
 	b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x0414, 0x01F4);
 
 	ssb_bus_powerup(bus, 1); /* Enable dynamic PCTL */
-	memset(wl->bssid, 0, ETH_ALEN);
-	memset(wl->mac_addr, 0, ETH_ALEN);
 	b43legacy_upload_card_macaddress(dev);
 	b43legacy_security_init(dev);
 	b43legacy_rng_init(wl);
@@ -3311,6 +3309,13 @@ static int b43legacy_start(struct ieee80
 	int did_init = 0;
 	int err = 0;
 
+	/* Kill all old instance specific information to make sure
+	 * the card won't use it in the short timeframe between start
+	 * and mac80211 reconfiguring it. */
+	memset(wl->bssid, 0, ETH_ALEN);
+	memset(wl->mac_addr, 0, ETH_ALEN);
+	wl->filter_flags = 0;
+
 	mutex_lock(&wl->mutex);
 
 	if (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED) {

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/45] 2.6.24-stable review, Greg KH, (Thu Feb 7, 1:45 pm)
[patch 04/45] USB: keyspan: Fix oops, Greg KH, (Thu Feb 7, 1:46 pm)
[patch 06/45] USB: CP2101 New Device IDs, Greg KH, (Thu Feb 7, 1:46 pm)
[patch 10/45] USB: sierra driver - add devices, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 17/45] USB: use GFP_NOIO in reset path, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 21/45] USB: handle idVendor of 0x0000, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 23/45] forcedeth: mac address mcp77/79, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 24/45] lockdep: annotate epoll, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 26/45] PCI: Fix fakephp deadlock, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 27/45] ACPI: update ACPI blacklist, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 31/45] b43: Fix suspend/resume, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 34/45] b43legacy: fix PIO crash, Greg KH, (Thu Feb 7, 1:47 pm)
[patch 35/45] b43legacy: fix suspend/resume, Greg KH, (Thu Feb 7, 1:48 pm)
[patch 39/45] b43: Reject new firmware early, Greg KH, (Thu Feb 7, 1:48 pm)
Re: [patch 00/45] 2.6.24-stable review, S.Çağlar, (Thu Feb 7, 2:41 pm)
Re: [patch 00/45] 2.6.24-stable review, Greg KH, (Thu Feb 7, 2:58 pm)
Re: [patch 00/45] 2.6.24-stable review, Chuck Ebbert, (Thu Feb 7, 4:50 pm)
Re: [patch 00/45] 2.6.24-stable review, David Chinner, (Thu Feb 7, 5:44 pm)
Re: [stable] [patch 00/45] 2.6.24-stable review, David Chinner, (Thu Feb 7, 6:24 pm)
Re: [stable] [patch 00/45] 2.6.24-stable review, Greg KH, (Thu Feb 7, 10:31 pm)
Re: [patch 43/45] x86: replace LOCK_PREFIX in futex.h, Stefan Lippers-Hollmann, (Fri Feb 8, 11:35 am)
Re: [patch 43/45] x86: replace LOCK_PREFIX in futex.h, Chuck Ebbert, (Fri Feb 8, 2:45 pm)