Commit 508e32e1 authored by Reinette Chatre's avatar Reinette Chatre Committed by John W. Linville

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: default avatarReinette Chatre <reinette.chatre@intel.com>
Acked-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent eadd3c4b
...@@ -1840,7 +1840,7 @@ static void iwl4965_set_flags_for_phymode(struct iwl_priv *priv, ...@@ -1840,7 +1840,7 @@ static void iwl4965_set_flags_for_phymode(struct iwl_priv *priv,
| RXON_FLG_CCK_MSK); | RXON_FLG_CCK_MSK);
priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
} else { } else {
/* Copied from iwl4965_bg_post_associate() */ /* Copied from iwl4965_post_associate() */
if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)
priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
else else
...@@ -6004,10 +6004,8 @@ static void iwl4965_bg_rx_replenish(struct work_struct *data) ...@@ -6004,10 +6004,8 @@ static void iwl4965_bg_rx_replenish(struct work_struct *data)
#define IWL_DELAY_NEXT_SCAN (HZ*2) #define IWL_DELAY_NEXT_SCAN (HZ*2)
static void iwl4965_bg_post_associate(struct work_struct *data) static void iwl4965_post_associate(struct iwl_priv *priv)
{ {
struct iwl_priv *priv = container_of(data, struct iwl_priv,
post_associate.work);
struct ieee80211_conf *conf = NULL; struct ieee80211_conf *conf = NULL;
int ret = 0; int ret = 0;
DECLARE_MAC_BUF(mac); DECLARE_MAC_BUF(mac);
...@@ -6025,12 +6023,10 @@ static void iwl4965_bg_post_associate(struct work_struct *data) ...@@ -6025,12 +6023,10 @@ static void iwl4965_bg_post_associate(struct work_struct *data)
if (test_bit(STATUS_EXIT_PENDING, &priv->status)) if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return; return;
mutex_lock(&priv->mutex);
if (!priv->vif || !priv->is_open) { if (!priv->vif || !priv->is_open)
mutex_unlock(&priv->mutex);
return; return;
}
iwl4965_scan_cancel_timeout(priv, 200); iwl4965_scan_cancel_timeout(priv, 200);
conf = ieee80211_get_hw_conf(priv->hw); conf = ieee80211_get_hw_conf(priv->hw);
...@@ -6114,7 +6110,18 @@ static void iwl4965_bg_post_associate(struct work_struct *data) ...@@ -6114,7 +6110,18 @@ static void iwl4965_bg_post_associate(struct work_struct *data)
/* we have just associated, don't start scan too early */ /* we have just associated, don't start scan too early */
priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN; priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN;
}
static void iwl4965_bg_post_associate(struct work_struct *data)
{
struct iwl_priv *priv = container_of(data, struct iwl_priv,
post_associate.work);
mutex_lock(&priv->mutex);
iwl4965_post_associate(priv);
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
} }
static void iwl4965_bg_abort_scan(struct work_struct *work) static void iwl4965_bg_abort_scan(struct work_struct *work)
...@@ -6736,6 +6743,10 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, ...@@ -6736,6 +6743,10 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
if (changes & BSS_CHANGED_ASSOC) { if (changes & BSS_CHANGED_ASSOC) {
IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc); IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc);
/* This should never happen as this function should
* never be called from interrupt context. */
if (WARN_ON_ONCE(in_interrupt()))
return;
if (bss_conf->assoc) { if (bss_conf->assoc) {
priv->assoc_id = bss_conf->aid; priv->assoc_id = bss_conf->aid;
priv->beacon_int = bss_conf->beacon_int; priv->beacon_int = bss_conf->beacon_int;
...@@ -6743,7 +6754,9 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, ...@@ -6743,7 +6754,9 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
priv->assoc_capability = bss_conf->assoc_capability; priv->assoc_capability = bss_conf->assoc_capability;
priv->next_scan_jiffies = jiffies + priv->next_scan_jiffies = jiffies +
IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
queue_work(priv->workqueue, &priv->post_associate.work); mutex_lock(&priv->mutex);
iwl4965_post_associate(priv);
mutex_unlock(&priv->mutex);
} else { } else {
priv->assoc_id = 0; priv->assoc_id = 0;
IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc); IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment