diff options
author | Mohamed Abbas <mabbas@linux.intel.com> | 2007-10-25 05:15:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-10-25 22:15:43 -0400 |
commit | 948c171cfe9c63102cfb530af8a4b64e9643dde9 (patch) | |
tree | c95f159884d85eb65116da54793858fb580ecfa4 /drivers/net/wireless/iwlwifi/iwl4965-base.c | |
parent | 052c4b9f0a83a83f3fee735b57c5b1e4edc1da8c (diff) |
[PATCH] iwl4965: fix scan problem
This patch fixes the following problems for 4965:
1. Fix direct scan by make sure we set one_direct_scan only when the
mac80211 ask for direct scan.
2. Fix mac_stop and mac_remove_interface calles, we make sure we cancel any
scan and disassoc on these call.
Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 27b8569b659e..d60adcb9bd4a 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -6966,7 +6966,7 @@ static void iwl_bg_request_scan(struct work_struct *data) | |||
6966 | memcpy(scan->direct_scan[0].ssid, | 6966 | memcpy(scan->direct_scan[0].ssid, |
6967 | priv->direct_ssid, priv->direct_ssid_len); | 6967 | priv->direct_ssid, priv->direct_ssid_len); |
6968 | direct_mask = 1; | 6968 | direct_mask = 1; |
6969 | } else if (!iwl_is_associated(priv)) { | 6969 | } else if (!iwl_is_associated(priv) && priv->essid_len) { |
6970 | scan->direct_scan[0].id = WLAN_EID_SSID; | 6970 | scan->direct_scan[0].id = WLAN_EID_SSID; |
6971 | scan->direct_scan[0].len = priv->essid_len; | 6971 | scan->direct_scan[0].len = priv->essid_len; |
6972 | memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); | 6972 | memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); |
@@ -7119,6 +7119,10 @@ static void iwl_bg_post_associate(struct work_struct *data) | |||
7119 | 7119 | ||
7120 | mutex_lock(&priv->mutex); | 7120 | mutex_lock(&priv->mutex); |
7121 | 7121 | ||
7122 | if (!priv->interface_id || !priv->is_open) { | ||
7123 | mutex_unlock(&priv->mutex); | ||
7124 | return; | ||
7125 | } | ||
7122 | iwl_scan_cancel_timeout(priv, 200); | 7126 | iwl_scan_cancel_timeout(priv, 200); |
7123 | 7127 | ||
7124 | conf = ieee80211_get_hw_conf(priv->hw); | 7128 | conf = ieee80211_get_hw_conf(priv->hw); |
@@ -7274,9 +7278,19 @@ static void iwl_mac_stop(struct ieee80211_hw *hw) | |||
7274 | struct iwl_priv *priv = hw->priv; | 7278 | struct iwl_priv *priv = hw->priv; |
7275 | 7279 | ||
7276 | IWL_DEBUG_MAC80211("enter\n"); | 7280 | IWL_DEBUG_MAC80211("enter\n"); |
7281 | |||
7282 | |||
7283 | mutex_lock(&priv->mutex); | ||
7284 | /* stop mac, cancel any scan request and clear | ||
7285 | * RXON_FILTER_ASSOC_MSK BIT | ||
7286 | */ | ||
7277 | priv->is_open = 0; | 7287 | priv->is_open = 0; |
7278 | /*netif_stop_queue(dev); */ | 7288 | iwl_scan_cancel_timeout(priv, 100); |
7279 | flush_workqueue(priv->workqueue); | 7289 | cancel_delayed_work(&priv->post_associate); |
7290 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
7291 | iwl_commit_rxon(priv); | ||
7292 | mutex_unlock(&priv->mutex); | ||
7293 | |||
7280 | IWL_DEBUG_MAC80211("leave\n"); | 7294 | IWL_DEBUG_MAC80211("leave\n"); |
7281 | } | 7295 | } |
7282 | 7296 | ||
@@ -7623,6 +7637,12 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw, | |||
7623 | IWL_DEBUG_MAC80211("enter\n"); | 7637 | IWL_DEBUG_MAC80211("enter\n"); |
7624 | 7638 | ||
7625 | mutex_lock(&priv->mutex); | 7639 | mutex_lock(&priv->mutex); |
7640 | |||
7641 | iwl_scan_cancel_timeout(priv, 100); | ||
7642 | cancel_delayed_work(&priv->post_associate); | ||
7643 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
7644 | iwl_commit_rxon(priv); | ||
7645 | |||
7626 | if (priv->interface_id == conf->if_id) { | 7646 | if (priv->interface_id == conf->if_id) { |
7627 | priv->interface_id = 0; | 7647 | priv->interface_id = 0; |
7628 | memset(priv->bssid, 0, ETH_ALEN); | 7648 | memset(priv->bssid, 0, ETH_ALEN); |
@@ -7675,7 +7695,8 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) | |||
7675 | priv->direct_ssid_len = (u8) | 7695 | priv->direct_ssid_len = (u8) |
7676 | min((u8) len, (u8) IW_ESSID_MAX_SIZE); | 7696 | min((u8) len, (u8) IW_ESSID_MAX_SIZE); |
7677 | memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len); | 7697 | memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len); |
7678 | } | 7698 | } else |
7699 | priv->one_direct_scan = 0; | ||
7679 | 7700 | ||
7680 | rc = iwl_scan_initiate(priv); | 7701 | rc = iwl_scan_initiate(priv); |
7681 | 7702 | ||
@@ -9168,6 +9189,9 @@ static void iwl_pci_remove(struct pci_dev *pdev) | |||
9168 | iwl_rate_control_unregister(priv->hw); | 9189 | iwl_rate_control_unregister(priv->hw); |
9169 | } | 9190 | } |
9170 | 9191 | ||
9192 | /*netif_stop_queue(dev); */ | ||
9193 | flush_workqueue(priv->workqueue); | ||
9194 | |||
9171 | /* ieee80211_unregister_hw calls iwl_mac_stop, which flushes | 9195 | /* ieee80211_unregister_hw calls iwl_mac_stop, which flushes |
9172 | * priv->workqueue... so we can't take down the workqueue | 9196 | * priv->workqueue... so we can't take down the workqueue |
9173 | * until now... */ | 9197 | * until now... */ |