Skip to content

Commit

Permalink
iwlwifi: fix FW restart on init FW
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amit Beka authored and Johannes Berg committed Aug 21, 2012
1 parent 289e550 commit 40503f7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/net/wireless/iwlwifi/dvm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 40503f7

Please sign in to comment.