aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorMohamed Abbas <mabbas@linux.intel.com>2007-11-28 22:10:13 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:36 -0500
commit7878a5a4fcc5002e805c054730c4c5639c9d071d (patch)
tree4c9dafcb1b996548a2220df8458008bc7601bb69 /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent2bdc7031f9ea1826e16bffc3540d05de891c98bc (diff)
iwlwifi: enhance WPA authenication stability
This patch enhanced WPA authenication stability by avoiding scan immediately followed by association. We don't do any scanning right after association in next several seconds. This will allow WPA authentication to take place without any interruption. 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/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 71e9b7c52d57..82c1e0d45cf2 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2800,7 +2800,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
2800 IWL_DEBUG_TX("Sending REASSOC frame\n"); 2800 IWL_DEBUG_TX("Sending REASSOC frame\n");
2801#endif 2801#endif
2802 2802
2803 if (!iwl3945_is_associated(priv) && 2803 /* drop all data frame if we are not associated */
2804 if (!iwl3945_is_associated(priv) && !priv->assoc_id &&
2804 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) { 2805 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) {
2805 IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n"); 2806 IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n");
2806 goto drop_unlock; 2807 goto drop_unlock;
@@ -3737,6 +3738,7 @@ static void iwl3945_rx_scan_results_notif(struct iwl3945_priv *priv,
3737 (priv->last_scan_jiffies, jiffies))); 3738 (priv->last_scan_jiffies, jiffies)));
3738 3739
3739 priv->last_scan_jiffies = jiffies; 3740 priv->last_scan_jiffies = jiffies;
3741 priv->next_scan_jiffies = 0;
3740} 3742}
3741 3743
3742/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */ 3744/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
@@ -3779,6 +3781,7 @@ static void iwl3945_rx_scan_complete_notif(struct iwl3945_priv *priv,
3779 } 3781 }
3780 3782
3781 priv->last_scan_jiffies = jiffies; 3783 priv->last_scan_jiffies = jiffies;
3784 priv->next_scan_jiffies = 0;
3782 IWL_DEBUG_INFO("Setting scan to off\n"); 3785 IWL_DEBUG_INFO("Setting scan to off\n");
3783 3786
3784 clear_bit(STATUS_SCANNING, &priv->status); 3787 clear_bit(STATUS_SCANNING, &priv->status);
@@ -6806,6 +6809,8 @@ static void iwl3945_bg_rx_replenish(struct work_struct *data)
6806 mutex_unlock(&priv->mutex); 6809 mutex_unlock(&priv->mutex);
6807} 6810}
6808 6811
6812#define IWL_DELAY_NEXT_SCAN (HZ*2)
6813
6809static void iwl3945_bg_post_associate(struct work_struct *data) 6814static void iwl3945_bg_post_associate(struct work_struct *data)
6810{ 6815{
6811 struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, 6816 struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv,
@@ -6906,6 +6911,8 @@ static void iwl3945_bg_post_associate(struct work_struct *data)
6906#ifdef CONFIG_IWL3945_QOS 6911#ifdef CONFIG_IWL3945_QOS
6907 iwl3945_activate_qos(priv, 0); 6912 iwl3945_activate_qos(priv, 0);
6908#endif /* CONFIG_IWL3945_QOS */ 6913#endif /* CONFIG_IWL3945_QOS */
6914 /* we have just associated, don't start scan too early */
6915 priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN;
6909 mutex_unlock(&priv->mutex); 6916 mutex_unlock(&priv->mutex);
6910} 6917}
6911 6918
@@ -7338,7 +7345,6 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
7338 7345
7339} 7346}
7340 7347
7341#define IWL_DELAY_NEXT_SCAN (HZ*2)
7342static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) 7348static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
7343{ 7349{
7344 int rc = 0; 7350 int rc = 0;
@@ -7362,16 +7368,20 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
7362 goto out_unlock; 7368 goto out_unlock;
7363 } 7369 }
7364 7370
7371 /* we don't schedule scan within next_scan_jiffies period */
7372 if (priv->next_scan_jiffies &&
7373 time_after(priv->next_scan_jiffies, jiffies)) {
7374 rc = -EAGAIN;
7375 goto out_unlock;
7376 }
7365 /* if we just finished scan ask for delay */ 7377 /* if we just finished scan ask for delay */
7366 if (priv->last_scan_jiffies && 7378 if (priv->last_scan_jiffies && time_after(priv->last_scan_jiffies +
7367 time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, 7379 IWL_DELAY_NEXT_SCAN, jiffies)) {
7368 jiffies)) {
7369 rc = -EAGAIN; 7380 rc = -EAGAIN;
7370 goto out_unlock; 7381 goto out_unlock;
7371 } 7382 }
7372 if (len) { 7383 if (len) {
7373 IWL_DEBUG_SCAN("direct scan for " 7384 IWL_DEBUG_SCAN("direct scan for %s [%d]\n ",
7374 "%s [%d]\n ",
7375 iwl3945_escape_essid(ssid, len), (int)len); 7385 iwl3945_escape_essid(ssid, len), (int)len);
7376 7386
7377 priv->one_direct_scan = 1; 7387 priv->one_direct_scan = 1;