mirror of
https://github.com/torvalds/linux.git
synced 2024-11-05 19:41:54 +00:00
[PATCH] iwl4965: fix driver hang related to hardware scan
This patch fix the following: 1. make sure we are not scanning before we call REPLY_RXON 2. set RXON_FILTER_ASSOC_MSK only after we receive association response 3. call scan abort on scan watchdog instead of restart 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>
This commit is contained in:
parent
702004b745
commit
052c4b9f0a
@ -3870,7 +3870,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
|
|||||||
*/
|
*/
|
||||||
case IEEE80211_STYPE_ASSOC_RESP:
|
case IEEE80211_STYPE_ASSOC_RESP:
|
||||||
case IEEE80211_STYPE_REASSOC_RESP:
|
case IEEE80211_STYPE_REASSOC_RESP:
|
||||||
if (network_packet && iwl_is_associated(priv)) {
|
if (network_packet) {
|
||||||
#ifdef CONFIG_IWLWIFI_HT
|
#ifdef CONFIG_IWLWIFI_HT
|
||||||
u8 *pos = NULL;
|
u8 *pos = NULL;
|
||||||
struct ieee802_11_elems elems;
|
struct ieee802_11_elems elems;
|
||||||
|
@ -6845,8 +6845,9 @@ static void iwl_bg_scan_check(struct work_struct *data)
|
|||||||
IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN,
|
IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN,
|
||||||
"Scan completion watchdog resetting adapter (%dms)\n",
|
"Scan completion watchdog resetting adapter (%dms)\n",
|
||||||
jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
|
jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
|
||||||
|
|
||||||
if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
|
if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
|
||||||
queue_work(priv->workqueue, &priv->restart);
|
iwl_send_scan_abort(priv);
|
||||||
}
|
}
|
||||||
mutex_unlock(&priv->mutex);
|
mutex_unlock(&priv->mutex);
|
||||||
}
|
}
|
||||||
@ -6942,7 +6943,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
|
|||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
|
||||||
scan->suspend_time = 0;
|
scan->suspend_time = 0;
|
||||||
scan->max_out_time = cpu_to_le32(600 * 1024);
|
scan->max_out_time = cpu_to_le32(200 * 1024);
|
||||||
if (!interval)
|
if (!interval)
|
||||||
interval = suspend_time;
|
interval = suspend_time;
|
||||||
|
|
||||||
@ -7118,6 +7119,8 @@ static void iwl_bg_post_associate(struct work_struct *data)
|
|||||||
|
|
||||||
mutex_lock(&priv->mutex);
|
mutex_lock(&priv->mutex);
|
||||||
|
|
||||||
|
iwl_scan_cancel_timeout(priv, 200);
|
||||||
|
|
||||||
conf = ieee80211_get_hw_conf(priv->hw);
|
conf = ieee80211_get_hw_conf(priv->hw);
|
||||||
|
|
||||||
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
|
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
|
||||||
@ -7573,8 +7576,6 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
|
|||||||
if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
|
if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
|
||||||
iwl_config_ap(priv);
|
iwl_config_ap(priv);
|
||||||
else {
|
else {
|
||||||
priv->staging_rxon.filter_flags |=
|
|
||||||
RXON_FILTER_ASSOC_MSK;
|
|
||||||
rc = iwl_commit_rxon(priv);
|
rc = iwl_commit_rxon(priv);
|
||||||
if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc)
|
if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc)
|
||||||
iwl_rxon_add_station(
|
iwl_rxon_add_station(
|
||||||
@ -7582,6 +7583,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
iwl_scan_cancel_timeout(priv, 100);
|
||||||
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
|
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
|
||||||
iwl_commit_rxon(priv);
|
iwl_commit_rxon(priv);
|
||||||
}
|
}
|
||||||
@ -7642,6 +7644,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
|
|||||||
|
|
||||||
IWL_DEBUG_MAC80211("enter\n");
|
IWL_DEBUG_MAC80211("enter\n");
|
||||||
|
|
||||||
|
mutex_lock(&priv->mutex);
|
||||||
spin_lock_irqsave(&priv->lock, flags);
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
|
|
||||||
if (!iwl_is_ready_rf(priv)) {
|
if (!iwl_is_ready_rf(priv)) {
|
||||||
@ -7680,6 +7683,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
|
|||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
mutex_unlock(&priv->mutex);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -7713,6 +7717,8 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
|||||||
|
|
||||||
mutex_lock(&priv->mutex);
|
mutex_lock(&priv->mutex);
|
||||||
|
|
||||||
|
iwl_scan_cancel_timeout(priv, 100);
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SET_KEY:
|
case SET_KEY:
|
||||||
rc = iwl_update_sta_key_info(priv, key, sta_id);
|
rc = iwl_update_sta_key_info(priv, key, sta_id);
|
||||||
@ -7903,8 +7909,18 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
|
|||||||
|
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
|
||||||
|
/* we are restarting association process
|
||||||
|
* clear RXON_FILTER_ASSOC_MSK bit
|
||||||
|
*/
|
||||||
|
if (priv->iw_mode != IEEE80211_IF_TYPE_AP) {
|
||||||
|
iwl_scan_cancel_timeout(priv, 100);
|
||||||
|
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
|
||||||
|
iwl_commit_rxon(priv);
|
||||||
|
}
|
||||||
|
|
||||||
/* Per mac80211.h: This is only used in IBSS mode... */
|
/* Per mac80211.h: This is only used in IBSS mode... */
|
||||||
if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
|
if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
|
||||||
|
|
||||||
IWL_DEBUG_MAC80211("leave - not in IBSS\n");
|
IWL_DEBUG_MAC80211("leave - not in IBSS\n");
|
||||||
mutex_unlock(&priv->mutex);
|
mutex_unlock(&priv->mutex);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user