Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7be1bb6b798d506693d2d8668e801951996b5a4a
Commit:     7be1bb6b798d506693d2d8668e801951996b5a4a
Parent:     76f3915b4cbadf5f7dc80d3df6d3a7492914675a
Author:     Michael Buesch <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 23 21:10:56 2008 +0100
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 19:26:45 2008 -0800

    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 <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/wireless/b43/main.c |   10 ++++++++--
 drivers/net/wireless/b43/xmit.c |   31 +++++++++++++++++--------------
 2 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index f21355d..64c154d 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)
        b43_bluetooth_coext_enable(dev);
 
        ssb_bus_powerup(bus, 1);        /* Enable dynamic PCTL */
-       memset(wl->bssid, 0, ETH_ALEN);
-       memset(wl->mac_addr, 0, ETH_ALEN);
        b43_upload_card_macaddress(dev);
        b43_security_init(dev);
        b43_rng_init(wl);
@@ -3632,6 +3630,14 @@ static int b43_op_start(struct ieee80211_hw *hw)
        int err = 0;
        bool do_rfkill_exit = 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;
+       wl->radiotap_enabled = 0;
+
        /* First register RFkill.
         * LEDs that are registered later depend on it. */
        b43_rfkill_init(dev);
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index 3fc53e8..7de2814 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,
 
                B43_WARN_ON(key_idx >= dev->max_nr_keys);
                key = &(dev->key[key_idx]);
-               B43_WARN_ON(!key->keyconf);
-
-               /* Hardware appends ICV. */
-               plcp_fragment_len += txctl->icv_len;
-
-               key_idx = b43_kidx_to_fw(dev, key_idx);
-               mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) &
-                          B43_TXH_MAC_KEYIDX;
-               mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) &
-                          B43_TXH_MAC_KEYALG;
-               wlhdr_len = ieee80211_get_hdrlen(fctl);
-               iv_len = min((size_t) txctl->iv_len,
-                            ARRAY_SIZE(txhdr->iv));
-               memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len);
+
+               if (likely(key->keyconf)) {
+                       /* This key is valid. Use it for encryption. */
+
+                       /* Hardware appends ICV. */
+                       plcp_fragment_len += txctl->icv_len;
+
+                       key_idx = b43_kidx_to_fw(dev, key_idx);
+                       mac_ctl |= (key_idx << B43_TXH_MAC_KEYIDX_SHIFT) &
+                                  B43_TXH_MAC_KEYIDX;
+                       mac_ctl |= (key->algorithm << B43_TXH_MAC_KEYALG_SHIFT) 
&
+                                  B43_TXH_MAC_KEYALG;
+                       wlhdr_len = ieee80211_get_hdrlen(fctl);
+                       iv_len = min((size_t) txctl->iv_len,
+                                    ARRAY_SIZE(txhdr->iv));
+                       memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len);
+               }
        }
        if (b43_is_old_txhdr_format(dev)) {
                b43_generate_plcp_hdr((struct b43_plcp_hdr4 
*)(&txhdr->old_format.plcp),
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to