diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 5e1279263b2..d60adcb9bd4 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
| @@ -6845,8 +6845,9 @@ static void iwl_bg_scan_check(struct work_struct *data) | |||
| 6845 | IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN, | 6845 | IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN, |
| 6846 | "Scan completion watchdog resetting adapter (%dms)\n", | 6846 | "Scan completion watchdog resetting adapter (%dms)\n", |
| 6847 | jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG)); | 6847 | jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG)); |
| 6848 | |||
| 6848 | if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) | 6849 | if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) |
| 6849 | queue_work(priv->workqueue, &priv->restart); | 6850 | iwl_send_scan_abort(priv); |
| 6850 | } | 6851 | } |
| 6851 | mutex_unlock(&priv->mutex); | 6852 | mutex_unlock(&priv->mutex); |
| 6852 | } | 6853 | } |
| @@ -6942,7 +6943,7 @@ static void iwl_bg_request_scan(struct work_struct *data) | |||
| 6942 | spin_unlock_irqrestore(&priv->lock, flags); | 6943 | spin_unlock_irqrestore(&priv->lock, flags); |
| 6943 | 6944 | ||
| 6944 | scan->suspend_time = 0; | 6945 | scan->suspend_time = 0; |
| 6945 | scan->max_out_time = cpu_to_le32(600 * 1024); | 6946 | scan->max_out_time = cpu_to_le32(200 * 1024); |
| 6946 | if (!interval) | 6947 | if (!interval) |
| 6947 | interval = suspend_time; | 6948 | interval = suspend_time; |
| 6948 | 6949 | ||
| @@ -6965,7 +6966,7 @@ static void iwl_bg_request_scan(struct work_struct *data) | |||
| 6965 | memcpy(scan->direct_scan[0].ssid, | 6966 | memcpy(scan->direct_scan[0].ssid, |
| 6966 | priv->direct_ssid, priv->direct_ssid_len); | 6967 | priv->direct_ssid, priv->direct_ssid_len); |
| 6967 | direct_mask = 1; | 6968 | direct_mask = 1; |
| 6968 | } else if (!iwl_is_associated(priv)) { | 6969 | } else if (!iwl_is_associated(priv) && priv->essid_len) { |
| 6969 | scan->direct_scan[0].id = WLAN_EID_SSID; | 6970 | scan->direct_scan[0].id = WLAN_EID_SSID; |
| 6970 | scan->direct_scan[0].len = priv->essid_len; | 6971 | scan->direct_scan[0].len = priv->essid_len; |
| 6971 | memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); | 6972 | memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); |
| @@ -7118,6 +7119,12 @@ static void iwl_bg_post_associate(struct work_struct *data) | |||
| 7118 | 7119 | ||
| 7119 | mutex_lock(&priv->mutex); | 7120 | mutex_lock(&priv->mutex); |
| 7120 | 7121 | ||
| 7122 | if (!priv->interface_id || !priv->is_open) { | ||
| 7123 | mutex_unlock(&priv->mutex); | ||
| 7124 | return; | ||
| 7125 | } | ||
| 7126 | iwl_scan_cancel_timeout(priv, 200); | ||
| 7127 | |||
| 7121 | conf = ieee80211_get_hw_conf(priv->hw); | 7128 | conf = ieee80211_get_hw_conf(priv->hw); |
| 7122 | 7129 | ||
| 7123 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 7130 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
| @@ -7271,9 +7278,19 @@ static void iwl_mac_stop(struct ieee80211_hw *hw) | |||
| 7271 | struct iwl_priv *priv = hw->priv; | 7278 | struct iwl_priv *priv = hw->priv; |
| 7272 | 7279 | ||
| 7273 | 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 | */ | ||
| 7274 | priv->is_open = 0; | 7287 | priv->is_open = 0; |
| 7275 | /*netif_stop_queue(dev); */ | 7288 | iwl_scan_cancel_timeout(priv, 100); |
| 7276 | 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 | |||
| 7277 | IWL_DEBUG_MAC80211("leave\n"); | 7294 | IWL_DEBUG_MAC80211("leave\n"); |
| 7278 | } | 7295 | } |
| 7279 | 7296 | ||
| @@ -7573,8 +7590,6 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
| 7573 | if (priv->iw_mode == IEEE80211_IF_TYPE_AP) | 7590 | if (priv->iw_mode == IEEE80211_IF_TYPE_AP) |
| 7574 | iwl_config_ap(priv); | 7591 | iwl_config_ap(priv); |
| 7575 | else { | 7592 | else { |
| 7576 | priv->staging_rxon.filter_flags |= | ||
| 7577 | RXON_FILTER_ASSOC_MSK; | ||
| 7578 | rc = iwl_commit_rxon(priv); | 7593 | rc = iwl_commit_rxon(priv); |
| 7579 | if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc) | 7594 | if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc) |
| 7580 | iwl_rxon_add_station( | 7595 | iwl_rxon_add_station( |
| @@ -7582,6 +7597,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
| 7582 | } | 7597 | } |
| 7583 | 7598 | ||
| 7584 | } else { | 7599 | } else { |
| 7600 | iwl_scan_cancel_timeout(priv, 100); | ||
| 7585 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 7601 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
| 7586 | iwl_commit_rxon(priv); | 7602 | iwl_commit_rxon(priv); |
| 7587 | } | 7603 | } |
| @@ -7621,6 +7637,12 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw, | |||
| 7621 | IWL_DEBUG_MAC80211("enter\n"); | 7637 | IWL_DEBUG_MAC80211("enter\n"); |
| 7622 | 7638 | ||
| 7623 | 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 | |||
| 7624 | if (priv->interface_id == conf->if_id) { | 7646 | if (priv->interface_id == conf->if_id) { |
| 7625 | priv->interface_id = 0; | 7647 | priv->interface_id = 0; |
| 7626 | memset(priv->bssid, 0, ETH_ALEN); | 7648 | memset(priv->bssid, 0, ETH_ALEN); |
| @@ -7642,6 +7664,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) | |||
| 7642 | 7664 | ||
| 7643 | IWL_DEBUG_MAC80211("enter\n"); | 7665 | IWL_DEBUG_MAC80211("enter\n"); |
| 7644 | 7666 | ||
| 7667 | mutex_lock(&priv->mutex); | ||
| 7645 | spin_lock_irqsave(&priv->lock, flags); | 7668 | spin_lock_irqsave(&priv->lock, flags); |
| 7646 | 7669 | ||
| 7647 | if (!iwl_is_ready_rf(priv)) { | 7670 | if (!iwl_is_ready_rf(priv)) { |
| @@ -7672,7 +7695,8 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) | |||
| 7672 | priv->direct_ssid_len = (u8) | 7695 | priv->direct_ssid_len = (u8) |
| 7673 | min((u8) len, (u8) IW_ESSID_MAX_SIZE); | 7696 | min((u8) len, (u8) IW_ESSID_MAX_SIZE); |
| 7674 | memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len); | 7697 | memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len); |
| 7675 | } | 7698 | } else |
| 7699 | priv->one_direct_scan = 0; | ||
| 7676 | 7700 | ||
| 7677 | rc = iwl_scan_initiate(priv); | 7701 | rc = iwl_scan_initiate(priv); |
| 7678 | 7702 | ||
| @@ -7680,6 +7704,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) | |||
| 7680 | 7704 | ||
| 7681 | out_unlock: | 7705 | out_unlock: |
| 7682 | spin_unlock_irqrestore(&priv->lock, flags); | 7706 | spin_unlock_irqrestore(&priv->lock, flags); |
| 7707 | mutex_unlock(&priv->mutex); | ||
| 7683 | 7708 | ||
| 7684 | return rc; | 7709 | return rc; |
| 7685 | } | 7710 | } |
| @@ -7713,6 +7738,8 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
| 7713 | 7738 | ||
| 7714 | mutex_lock(&priv->mutex); | 7739 | mutex_lock(&priv->mutex); |
| 7715 | 7740 | ||
| 7741 | iwl_scan_cancel_timeout(priv, 100); | ||
| 7742 | |||
| 7716 | switch (cmd) { | 7743 | switch (cmd) { |
| 7717 | case SET_KEY: | 7744 | case SET_KEY: |
| 7718 | rc = iwl_update_sta_key_info(priv, key, sta_id); | 7745 | rc = iwl_update_sta_key_info(priv, key, sta_id); |
| @@ -7903,8 +7930,18 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw) | |||
| 7903 | 7930 | ||
| 7904 | spin_unlock_irqrestore(&priv->lock, flags); | 7931 | spin_unlock_irqrestore(&priv->lock, flags); |
| 7905 | 7932 | ||
| 7933 | /* we are restarting association process | ||
| 7934 | * clear RXON_FILTER_ASSOC_MSK bit | ||
| 7935 | */ | ||
| 7936 | if (priv->iw_mode != IEEE80211_IF_TYPE_AP) { | ||
| 7937 | iwl_scan_cancel_timeout(priv, 100); | ||
| 7938 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
| 7939 | iwl_commit_rxon(priv); | ||
| 7940 | } | ||
| 7941 | |||
| 7906 | /* Per mac80211.h: This is only used in IBSS mode... */ | 7942 | /* Per mac80211.h: This is only used in IBSS mode... */ |
| 7907 | if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) { | 7943 | if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) { |
| 7944 | |||
| 7908 | IWL_DEBUG_MAC80211("leave - not in IBSS\n"); | 7945 | IWL_DEBUG_MAC80211("leave - not in IBSS\n"); |
| 7909 | mutex_unlock(&priv->mutex); | 7946 | mutex_unlock(&priv->mutex); |
| 7910 | return; | 7947 | return; |
| @@ -9152,6 +9189,9 @@ static void iwl_pci_remove(struct pci_dev *pdev) | |||
| 9152 | iwl_rate_control_unregister(priv->hw); | 9189 | iwl_rate_control_unregister(priv->hw); |
| 9153 | } | 9190 | } |
| 9154 | 9191 | ||
| 9192 | /*netif_stop_queue(dev); */ | ||
| 9193 | flush_workqueue(priv->workqueue); | ||
| 9194 | |||
| 9155 | /* ieee80211_unregister_hw calls iwl_mac_stop, which flushes | 9195 | /* ieee80211_unregister_hw calls iwl_mac_stop, which flushes |
| 9156 | * priv->workqueue... so we can't take down the workqueue | 9196 | * priv->workqueue... so we can't take down the workqueue |
| 9157 | * until now... */ | 9197 | * until now... */ |
