summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/dvm/main.c
diff options
context:
space:
mode:
authorAmit Beka <amit.beka@intel.com>2012-08-06 17:01:05 +0300
committerJohannes Berg <johannes.berg@intel.com>2012-08-21 18:32:09 +0200
commit40503f7b48260a91ab65a4f8b00a2c6f004fa807 (patch)
treeb242372e9994be0cc75a3569a7457e3f9b304af0 /drivers/net/wireless/iwlwifi/dvm/main.c
parent289e5501c3141191dd830957f1d764d3dc14a54f (diff)
downloadlinux-40503f7b48260a91ab65a4f8b00a2c6f004fa807.tar.gz
linux-40503f7b48260a91ab65a4f8b00a2c6f004fa807.tar.bz2
linux-40503f7b48260a91ab65a4f8b00a2c6f004fa807.zip
iwlwifi: fix FW restart on init FW
When unregistered with mac80211, we can't call its functionality for FW restart, so avoid it and prevent automatic FW restart for the init firmware. Signed-off-by: Amit Beka <amit.beka@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/dvm/main.c')
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index ab7b9ed00b8f..7ff3f1430678 100644
--- a/drivers/net/wireless/iwlwifi/dvm/main.c
+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
@@ -862,7 +862,8 @@ void iwl_down(struct iwl_priv *priv)
* No race since we hold the mutex here and a new one
* can't come in at this time.
*/
- ieee80211_remain_on_channel_expired(priv->hw);
+ if (priv->ucode_loaded && priv->cur_ucode != IWL_UCODE_INIT)
+ ieee80211_remain_on_channel_expired(priv->hw);
exit_pending =
test_and_set_bit(STATUS_EXIT_PENDING, &priv->status);
@@ -994,7 +995,11 @@ static void iwl_bg_restart(struct work_struct *data)
iwlagn_prepare_restart(priv);
mutex_unlock(&priv->mutex);
iwl_cancel_deferred_work(priv);
- ieee80211_restart_hw(priv->hw);
+ if (priv->mac80211_registered)
+ ieee80211_restart_hw(priv->hw);
+ else
+ IWL_ERR(priv,
+ "Cannot request restart before registrating with mac80211");
} else {
WARN_ON(1);
}