aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2010-10-22 11:04:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:24:30 -0500
commit3eb9616af24d6a1910ae6ae5c2d51719eba960cf (patch)
tree4059739f0593b3961be9e90a0bbe3bbd1ca764c2
parentac4f5457c7617999967e9740f8903b922714bab4 (diff)
iwlwifi: avoid commit rxon during scan in iwl_set_no_assoc
Currently we are canceling scan when changing BSSID. Behave the same when changing association and beacon enablement, to avoid committing rxon during scan in iwl_set_no_assoc(). Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 8bbd152617fc..87c18001d2c0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1590,6 +1590,19 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
1590 1590
1591 mutex_lock(&priv->mutex); 1591 mutex_lock(&priv->mutex);
1592 1592
1593 if (changes & (BSS_CHANGED_BSSID | BSS_CHANGED_ASSOC |
1594 BSS_CHANGED_BEACON_ENABLED)) {
1595 /*
1596 * If there is currently a HW scan going on in the
1597 * background then we need to cancel it else the RXON
1598 * below in post_associate or set_no_assoc can fail.
1599 */
1600 if (iwl_scan_cancel_timeout(priv, 200)) {
1601 IWL_WARN(priv, "Can not cancel scan\n");
1602 goto out;
1603 }
1604 }
1605
1593 if (changes & BSS_CHANGED_QOS) { 1606 if (changes & BSS_CHANGED_QOS) {
1594 unsigned long flags; 1607 unsigned long flags;
1595 1608
@@ -1622,18 +1635,6 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
1622 if (changes & BSS_CHANGED_BSSID) { 1635 if (changes & BSS_CHANGED_BSSID) {
1623 IWL_DEBUG_MAC80211(priv, "BSSID %pM\n", bss_conf->bssid); 1636 IWL_DEBUG_MAC80211(priv, "BSSID %pM\n", bss_conf->bssid);
1624 1637
1625 /*
1626 * If there is currently a HW scan going on in the
1627 * background then we need to cancel it else the RXON
1628 * below/in post_associate will fail.
1629 */
1630 if (iwl_scan_cancel_timeout(priv, 100)) {
1631 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
1632 IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
1633 mutex_unlock(&priv->mutex);
1634 return;
1635 }
1636
1637 /* mac80211 only sets assoc when in STATION mode */ 1638 /* mac80211 only sets assoc when in STATION mode */
1638 if (vif->type == NL80211_IFTYPE_ADHOC || bss_conf->assoc) { 1639 if (vif->type == NL80211_IFTYPE_ADHOC || bss_conf->assoc) {
1639 memcpy(ctx->staging.bssid_addr, 1640 memcpy(ctx->staging.bssid_addr,
@@ -1752,6 +1753,7 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
1752 IWL_ERR(priv, "failed to update PAN params\n"); 1753 IWL_ERR(priv, "failed to update PAN params\n");
1753 } 1754 }
1754 1755
1756out:
1755 mutex_unlock(&priv->mutex); 1757 mutex_unlock(&priv->mutex);
1756 1758
1757 IWL_DEBUG_MAC80211(priv, "leave\n"); 1759 IWL_DEBUG_MAC80211(priv, "leave\n");