aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2008-04-15 00:16:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-16 15:59:59 -0400
commit508e32e177f54d1f6ebcfa181b9d6f2583c3b1c0 (patch)
tree85bb3396f410d5da821fd11ba7fa7aec0a780586 /drivers
parenteadd3c4b9a90e31d5b6034a8813bfabecbe48681 (diff)
iwlwifi: perform bss_info_changed post association work right away
Do not use workqueue for bss_info_changed post association work. When driver is notified of association the upper layer will be notified right after that the association is complete. Doing the post association work in a workqueue introduces a race condition where the upper layer may want to make use of the association, but it is not yet complete. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 9fb985770fd..1f343409c90 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1840,7 +1840,7 @@ static void iwl4965_set_flags_for_phymode(struct iwl_priv *priv,
1840 | RXON_FLG_CCK_MSK); 1840 | RXON_FLG_CCK_MSK);
1841 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; 1841 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
1842 } else { 1842 } else {
1843 /* Copied from iwl4965_bg_post_associate() */ 1843 /* Copied from iwl4965_post_associate() */
1844 if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) 1844 if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)
1845 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; 1845 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
1846 else 1846 else
@@ -6004,10 +6004,8 @@ static void iwl4965_bg_rx_replenish(struct work_struct *data)
6004 6004
6005#define IWL_DELAY_NEXT_SCAN (HZ*2) 6005#define IWL_DELAY_NEXT_SCAN (HZ*2)
6006 6006
6007static void iwl4965_bg_post_associate(struct work_struct *data) 6007static void iwl4965_post_associate(struct iwl_priv *priv)
6008{ 6008{
6009 struct iwl_priv *priv = container_of(data, struct iwl_priv,
6010 post_associate.work);
6011 struct ieee80211_conf *conf = NULL; 6009 struct ieee80211_conf *conf = NULL;
6012 int ret = 0; 6010 int ret = 0;
6013 DECLARE_MAC_BUF(mac); 6011 DECLARE_MAC_BUF(mac);
@@ -6025,12 +6023,10 @@ static void iwl4965_bg_post_associate(struct work_struct *data)
6025 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 6023 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
6026 return; 6024 return;
6027 6025
6028 mutex_lock(&priv->mutex);
6029 6026
6030 if (!priv->vif || !priv->is_open) { 6027 if (!priv->vif || !priv->is_open)
6031 mutex_unlock(&priv->mutex);
6032 return; 6028 return;
6033 } 6029
6034 iwl4965_scan_cancel_timeout(priv, 200); 6030 iwl4965_scan_cancel_timeout(priv, 200);
6035 6031
6036 conf = ieee80211_get_hw_conf(priv->hw); 6032 conf = ieee80211_get_hw_conf(priv->hw);
@@ -6114,7 +6110,18 @@ static void iwl4965_bg_post_associate(struct work_struct *data)
6114 6110
6115 /* we have just associated, don't start scan too early */ 6111 /* we have just associated, don't start scan too early */
6116 priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN; 6112 priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN;
6113}
6114
6115
6116static void iwl4965_bg_post_associate(struct work_struct *data)
6117{
6118 struct iwl_priv *priv = container_of(data, struct iwl_priv,
6119 post_associate.work);
6120
6121 mutex_lock(&priv->mutex);
6122 iwl4965_post_associate(priv);
6117 mutex_unlock(&priv->mutex); 6123 mutex_unlock(&priv->mutex);
6124
6118} 6125}
6119 6126
6120static void iwl4965_bg_abort_scan(struct work_struct *work) 6127static void iwl4965_bg_abort_scan(struct work_struct *work)
@@ -6736,6 +6743,10 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
6736 6743
6737 if (changes & BSS_CHANGED_ASSOC) { 6744 if (changes & BSS_CHANGED_ASSOC) {
6738 IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc); 6745 IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc);
6746 /* This should never happen as this function should
6747 * never be called from interrupt context. */
6748 if (WARN_ON_ONCE(in_interrupt()))
6749 return;
6739 if (bss_conf->assoc) { 6750 if (bss_conf->assoc) {
6740 priv->assoc_id = bss_conf->aid; 6751 priv->assoc_id = bss_conf->aid;
6741 priv->beacon_int = bss_conf->beacon_int; 6752 priv->beacon_int = bss_conf->beacon_int;
@@ -6743,7 +6754,9 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
6743 priv->assoc_capability = bss_conf->assoc_capability; 6754 priv->assoc_capability = bss_conf->assoc_capability;
6744 priv->next_scan_jiffies = jiffies + 6755 priv->next_scan_jiffies = jiffies +
6745 IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; 6756 IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
6746 queue_work(priv->workqueue, &priv->post_associate.work); 6757 mutex_lock(&priv->mutex);
6758 iwl4965_post_associate(priv);
6759 mutex_unlock(&priv->mutex);
6747 } else { 6760 } else {
6748 priv->assoc_id = 0; 6761 priv->assoc_id = 0;
6749 IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc); 6762 IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc);