Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 17 Jun 2010 20:21:14 +0000 (16:21 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 17 Jun 2010 20:21:14 +0000 (16:21 -0400)
Conflicts:
net/mac80211/mlme.c

1  2 
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/net/wireless/iwlwifi/iwl-sta.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
net/mac80211/mlme.c
net/mac80211/work.c

index 637b22411d4195523f55c86a0a54bb1d48c5b814,f803f8b72a930dd58b60ae362ea1b7117f1247b2..85c3ca33333eae4eb9277d9a14064a2ed08e7fdd
@@@ -1704,8 -1760,47 +1704,45 @@@ void ieee80211_sta_rx_queued_mgmt(struc
        mutex_unlock(&ifmgd->mtx);
  
        if (skb->len >= 24 + 2 /* mgmt + deauth reason */ &&
-           (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_DEAUTH)
+           (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_DEAUTH) {
+               struct ieee80211_local *local = sdata->local;
+               struct ieee80211_work *wk;
+               mutex_lock(&local->work_mtx);
+               list_for_each_entry(wk, &local->work_list, list) {
+                       if (wk->sdata != sdata)
+                               continue;
+                       if (wk->type != IEEE80211_WORK_ASSOC)
+                               continue;
+                       if (memcmp(mgmt->bssid, wk->filter_ta, ETH_ALEN))
+                               continue;
+                       if (memcmp(mgmt->sa, wk->filter_ta, ETH_ALEN))
+                               continue;
+                       /*
+                        * Printing the message only here means we can't
+                        * spuriously print it, but it also means that it
+                        * won't be printed when the frame comes in before
+                        * we even tried to associate or in similar cases.
+                        *
+                        * Ultimately, I suspect cfg80211 should print the
+                        * messages instead.
+                        */
+                       printk(KERN_DEBUG
+                              "%s: deauthenticated from %pM (Reason: %u)\n",
+                              sdata->name, mgmt->bssid,
+                              le16_to_cpu(mgmt->u.deauth.reason_code));
+                       list_del_rcu(&wk->list);
+                       free_work(wk);
+                       break;
+               }
+               mutex_unlock(&local->work_mtx);
                cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len);
 - out:
 -      kfree_skb(skb);
+       }
  }
  
  static void ieee80211_sta_timer(unsigned long data)
Simple merge