Commit 5c40d860 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

iwlwifi: make EXIT_PENDING depend on mac80211

There's no reason to set EXIT_PENDING when we
start removing the module, as mac80211 will
cleanly shut down the device in this case.
Additionally, there's no point in rejecting
commands to the device when we're cleaning up
as that only leads to unwanted errors from
mac80211 being printed, such as
  failed to remove key (...) from hardware (-16)
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 08ae86ac
...@@ -422,9 +422,6 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) ...@@ -422,9 +422,6 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
lockdep_assert_held(&priv->shrd->mutex); lockdep_assert_held(&priv->shrd->mutex);
if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
return -EINVAL;
if (!iwl_is_alive(priv->shrd)) if (!iwl_is_alive(priv->shrd))
return -EBUSY; return -EBUSY;
...@@ -560,9 +557,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) ...@@ -560,9 +557,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
mutex_lock(&priv->shrd->mutex); mutex_lock(&priv->shrd->mutex);
if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
goto out;
if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) { if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) {
IWL_DEBUG_MAC80211(priv, "leave - scanning\n"); IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
goto out; goto out;
......
...@@ -1378,12 +1378,6 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode) ...@@ -1378,12 +1378,6 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
iwl_dbgfs_unregister(priv); iwl_dbgfs_unregister(priv);
/* ieee80211_unregister_hw call wil cause iwlagn_mac_stop to
* to be called and iwl_down since we are removing the device
* we need to set STATUS_EXIT_PENDING bit.
*/
set_bit(STATUS_EXIT_PENDING, &priv->shrd->status);
iwl_testmode_cleanup(priv); iwl_testmode_cleanup(priv);
iwlagn_mac_unregister(priv); iwlagn_mac_unregister(priv);
......
...@@ -649,8 +649,6 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw, ...@@ -649,8 +649,6 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
case IEEE80211_AMPDU_RX_STOP: case IEEE80211_AMPDU_RX_STOP:
IWL_DEBUG_HT(priv, "stop Rx\n"); IWL_DEBUG_HT(priv, "stop Rx\n");
ret = iwl_sta_rx_agg_stop(priv, sta, tid); ret = iwl_sta_rx_agg_stop(priv, sta, tid);
if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
ret = 0;
break; break;
case IEEE80211_AMPDU_TX_START: case IEEE80211_AMPDU_TX_START:
if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG)
...@@ -666,8 +664,6 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw, ...@@ -666,8 +664,6 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
IWL_DEBUG_HT(priv, "priv->agg_tids_count = %u\n", IWL_DEBUG_HT(priv, "priv->agg_tids_count = %u\n",
priv->agg_tids_count); priv->agg_tids_count);
} }
if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
ret = 0;
if (!priv->agg_tids_count && cfg(priv)->ht_params && if (!priv->agg_tids_count && cfg(priv)->ht_params &&
cfg(priv)->ht_params->use_rts_for_aggregation) { cfg(priv)->ht_params->use_rts_for_aggregation) {
/* /*
......
...@@ -69,8 +69,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv) ...@@ -69,8 +69,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
if (!test_bit(STATUS_READY, &priv->shrd->status) || if (!test_bit(STATUS_READY, &priv->shrd->status) ||
!test_bit(STATUS_GEO_CONFIGURED, &priv->shrd->status) || !test_bit(STATUS_GEO_CONFIGURED, &priv->shrd->status) ||
!test_bit(STATUS_SCAN_HW, &priv->shrd->status) || !test_bit(STATUS_SCAN_HW, &priv->shrd->status) ||
test_bit(STATUS_FW_ERROR, &priv->shrd->status) || test_bit(STATUS_FW_ERROR, &priv->shrd->status))
test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
return -EIO; return -EIO;
ret = iwl_trans_send_cmd(trans(priv), &cmd); ret = iwl_trans_send_cmd(trans(priv), &cmd);
......
...@@ -914,9 +914,6 @@ static int iwl_send_cmd_async(struct iwl_trans *trans, struct iwl_host_cmd *cmd) ...@@ -914,9 +914,6 @@ static int iwl_send_cmd_async(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
return -EINVAL; return -EINVAL;
if (test_bit(STATUS_EXIT_PENDING, &trans->shrd->status))
return -EBUSY;
ret = iwl_enqueue_hcmd(trans, cmd); ret = iwl_enqueue_hcmd(trans, cmd);
if (ret < 0) { if (ret < 0) {
IWL_DEBUG_QUIET_RFKILL(trans, IWL_DEBUG_QUIET_RFKILL(trans,
...@@ -938,10 +935,6 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) ...@@ -938,10 +935,6 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
IWL_DEBUG_INFO(trans, "Attempting to send sync command %s\n", IWL_DEBUG_INFO(trans, "Attempting to send sync command %s\n",
get_cmd_string(cmd->id)); get_cmd_string(cmd->id));
if (test_bit(STATUS_EXIT_PENDING, &trans->shrd->status))
return -EBUSY;
if (test_bit(STATUS_RF_KILL_HW, &trans->shrd->status)) { if (test_bit(STATUS_RF_KILL_HW, &trans->shrd->status)) {
IWL_ERR(trans, "Command %s aborted: RF KILL Switch\n", IWL_ERR(trans, "Command %s aborted: RF KILL Switch\n",
get_cmd_string(cmd->id)); get_cmd_string(cmd->id));
......
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