Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorDavid S. Miller <davem@davemloft.net>
Tue, 11 May 2010 05:53:41 +0000 (22:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 May 2010 05:53:41 +0000 (22:53 -0700)
1  2 
drivers/net/wireless/ath/ar9170/usb.c
drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
net/mac80211/mlme.c

@@@ -38,7 -38,6 +38,7 @@@
   */
  
  #include <linux/module.h>
 +#include <linux/slab.h>
  #include <linux/usb.h>
  #include <linux/firmware.h>
  #include <linux/etherdevice.h>
@@@ -727,12 -726,16 +727,16 @@@ static void ar9170_usb_firmware_failed(
  {
        struct device *parent = aru->udev->dev.parent;
  
+       complete(&aru->firmware_loading_complete);
        /* unbind anything failed */
        if (parent)
                down(&parent->sem);
        device_release_driver(&aru->udev->dev);
        if (parent)
                up(&parent->sem);
+       usb_put_dev(aru->udev);
  }
  
  static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context)
        if (err)
                goto err_unrx;
  
+       complete(&aru->firmware_loading_complete);
+       usb_put_dev(aru->udev);
        return;
  
   err_unrx:
@@@ -858,6 -863,7 +864,7 @@@ static int ar9170_usb_probe(struct usb_
        init_usb_anchor(&aru->tx_pending);
        init_usb_anchor(&aru->tx_submitted);
        init_completion(&aru->cmd_wait);
+       init_completion(&aru->firmware_loading_complete);
        spin_lock_init(&aru->tx_urb_lock);
  
        aru->tx_pending_urbs = 0;
        if (err)
                goto err_freehw;
  
+       usb_get_dev(aru->udev);
        return request_firmware_nowait(THIS_MODULE, 1, "ar9170.fw",
                                       &aru->udev->dev, GFP_KERNEL, aru,
                                       ar9170_usb_firmware_step2);
@@@ -896,6 -903,9 +904,9 @@@ static void ar9170_usb_disconnect(struc
                return;
  
        aru->common.state = AR9170_IDLE;
+       wait_for_completion(&aru->firmware_loading_complete);
        ar9170_unregister(&aru->common);
        ar9170_usb_cancel_urbs(aru);
  
@@@ -25,7 -25,6 +25,7 @@@
   *  Intel Linux Wireless <ilw@linux.intel.com>
   * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
   *****************************************************************************/
 +#include <linux/slab.h>
  #include <linux/types.h>
  #include <linux/etherdevice.h>
  #include <net/mac80211.h>
@@@ -813,16 -812,29 +813,29 @@@ static void iwl_bg_request_scan(struct 
                        rate = IWL_RATE_1M_PLCP;
                        rate_flags = RATE_MCS_CCK_MSK;
                }
-               scan->good_CRC_th = 0;
+               scan->good_CRC_th = IWL_GOOD_CRC_TH_DISABLED;
        } else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ)) {
                band = IEEE80211_BAND_5GHZ;
                rate = IWL_RATE_6M_PLCP;
                /*
-                * If active scaning is requested but a certain channel
-                * is marked passive, we can do active scanning if we
-                * detect transmissions.
+                * If active scanning is requested but a certain channel is
+                * marked passive, we can do active scanning if we detect
+                * transmissions.
+                *
+                * There is an issue with some firmware versions that triggers
+                * a sysassert on a "good CRC threshold" of zero (== disabled),
+                * on a radar channel even though this means that we should NOT
+                * send probes.
+                *
+                * The "good CRC threshold" is the number of frames that we
+                * need to receive during our dwell time on a channel before
+                * sending out probes -- setting this to a huge value will
+                * mean we never reach it, but at the same time work around
+                * the aforementioned issue. Thus use IWL_GOOD_CRC_TH_NEVER
+                * here instead of IWL_GOOD_CRC_TH_DISABLED.
                 */
-               scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH : 0;
+               scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT :
+                                               IWL_GOOD_CRC_TH_NEVER;
  
                /* Force use of chains B and C (0x6) for scan Rx for 4965
                 * Avoid A (0x1) because of its off-channel reception on A-band.
@@@ -31,7 -31,6 +31,7 @@@
  #include <linux/module.h>
  #include <linux/init.h>
  #include <linux/pci.h>
 +#include <linux/slab.h>
  #include <linux/dma-mapping.h>
  #include <linux/delay.h>
  #include <linux/sched.h>
@@@ -2967,7 -2966,8 +2967,8 @@@ static void iwl3945_bg_request_scan(str
                 * is marked passive, we can do active scanning if we
                 * detect transmissions.
                 */
-               scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH : 0;
+               scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT :
+                                               IWL_GOOD_CRC_TH_DISABLED;
                band = IEEE80211_BAND_5GHZ;
        } else {
                IWL_WARN(priv, "Invalid scan band count\n");
diff --combined net/mac80211/mlme.c
@@@ -19,7 -19,6 +19,7 @@@
  #include <linux/rtnetlink.h>
  #include <linux/pm_qos_params.h>
  #include <linux/crc32.h>
 +#include <linux/slab.h>
  #include <net/mac80211.h>
  #include <asm/unaligned.h>
  
@@@ -2030,7 -2029,8 +2030,8 @@@ int ieee80211_mgd_deauth(struct ieee802
                                continue;
  
                        if (wk->type != IEEE80211_WORK_DIRECT_PROBE &&
-                           wk->type != IEEE80211_WORK_AUTH)
+                           wk->type != IEEE80211_WORK_AUTH &&
+                           wk->type != IEEE80211_WORK_ASSOC)
                                continue;
  
                        if (memcmp(req->bss->bssid, wk->filter_ta, ETH_ALEN))