aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-01-23 15:10:56 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:26:45 -0500
commit7be1bb6b798d506693d2d8668e801951996b5a4a (patch)
tree911bf4dd500e22d4b16e6052e3d36d55fef6174f /drivers/net/wireless
parent76f3915b4cbadf5f7dc80d3df6d3a7492914675a (diff)
b43: Fix suspend/resume
This fixes suspend/resume. We must not overwrite the MAC addresses on resume. Otherwise the card won't ACK any packets anymore. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/main.c10
-rw-r--r--drivers/net/wireless/b43/xmit.c31
2 files changed, 25 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index f21355da84bd..64c154d080d8 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3532,8 +3532,6 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
3532 b43_bluetooth_coext_enable(dev); 3532 b43_bluetooth_coext_enable(dev);
3533 3533
3534 ssb_bus_powerup(bus, 1); /* Enable dynamic PCTL */ 3534 ssb_bus_powerup(bus, 1); /* Enable dynamic PCTL */
3535 memset(wl->bssid, 0, ETH_ALEN);
3536 memset(wl->mac_addr, 0, ETH_ALEN);
3537 b43_upload_card_macaddress(dev); 3535 b43_upload_card_macaddress(dev);
3538 b43_security_init(dev); 3536 b43_security_init(dev);
3539 b43_rng_init(wl); 3537 b43_rng_init(wl);
@@ -3632,6 +3630,14 @@ static int b43_op_start(struct ieee80211_hw *hw)
3632 int err = 0; 3630 int err = 0;
3633 bool do_rfkill_exit = 0; 3631 bool do_rfkill_exit = 0;
3634 3632
3633 /* Kill all old instance specific information to make sure
3634 * the card won't use it in the short timeframe between start
3635 * and mac80211 reconfiguring it. */
3636 memset(wl->bssid, 0, ETH_ALEN);
3637 memset(wl->mac_addr, 0, ETH_ALEN);
3638 wl->filter_flags = 0;
3639 wl->radiotap_enabled = 0;
3640
3635 /* First register RFkill. 3641 /* First register RFkill.
3636 * LEDs that are registered later depend on it. */ 3642 * LEDs that are registered later depend on it. */
3637 b43_rfkill_init(dev); 3643 b43_rfkill_init(dev);
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index 3fc53e8b4416..7de2814d527e 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -237,20 +237,23 @@ void b43_generate_txhdr(struct b43_wldev *dev,
237 237
238 B43_WARN_ON(key_idx >= dev->max_nr_keys); 238 B43_WARN_ON(key_idx >= dev->max_nr_keys);
239 key = &(dev->key[key_idx]); 239 key = &(dev->key[key_idx]);
240 B43_WARN_ON(!key->keyconf); 240
241 241 if (likely(key->keyconf)) {
242 /* Hardware appends ICV. */ 242 /* This key is valid. Use it for encryption. */
243 plcp_fragment_len += txctl->icv_len; 243
244 244 /* Hardware appends ICV. */
245 key_idx = b43_kidx_to_fw(dev, key_idx); 245 plcp_fragment_len += txctl->icv_len;
246 mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) & 246
247 B43_TXH_MAC_KEYIDX; 247 key_idx = b43_kidx_to_fw(dev, key_idx);
248 mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) & 248 mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) &
249 B43_TXH_MAC_KEYALG; 249 B43_TXH_MAC_KEYIDX;
250 wlhdr_len = ieee80211_get_hdrlen(fctl); 250 mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) &
251 iv_len = min((size_t) txctl->iv_len, 251 B43_TXH_MAC_KEYALG;
252 ARRAY_SIZE(txhdr->iv)); 252 wlhdr_len = ieee80211_get_hdrlen(fctl);
253 memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len); 253 iv_len = min((size_t) txctl->iv_len,
254 ARRAY_SIZE(txhdr->iv));
255 memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len);
256 }
254 } 257 }
255 if (b43_is_old_txhdr_format(dev)) { 258 if (b43_is_old_txhdr_format(dev)) {
256 b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(&txhdr->old_format.plcp), 259 b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(&txhdr->old_format.plcp),