aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/dvm/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/dvm/main.c')
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/main.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index 84d3db5aa506..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)
862 * No race since we hold the mutex here and a new one 862 * No race since we hold the mutex here and a new one
863 * can't come in at this time. 863 * can't come in at this time.
864 */ 864 */
865 ieee80211_remain_on_channel_expired(priv->hw); 865 if (priv->ucode_loaded && priv->cur_ucode != IWL_UCODE_INIT)
866 ieee80211_remain_on_channel_expired(priv->hw);
866 867
867 exit_pending = 868 exit_pending =
868 test_and_set_bit(STATUS_EXIT_PENDING, &priv->status); 869 test_and_set_bit(STATUS_EXIT_PENDING, &priv->status);
@@ -994,7 +995,11 @@ static void iwl_bg_restart(struct work_struct *data)
994 iwlagn_prepare_restart(priv); 995 iwlagn_prepare_restart(priv);
995 mutex_unlock(&priv->mutex); 996 mutex_unlock(&priv->mutex);
996 iwl_cancel_deferred_work(priv); 997 iwl_cancel_deferred_work(priv);
997 ieee80211_restart_hw(priv->hw); 998 if (priv->mac80211_registered)
999 ieee80211_restart_hw(priv->hw);
1000 else
1001 IWL_ERR(priv,
1002 "Cannot request restart before registrating with mac80211");
998 } else { 1003 } else {
999 WARN_ON(1); 1004 WARN_ON(1);
1000 } 1005 }
@@ -1222,7 +1227,8 @@ static int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
1222 1227
1223static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, 1228static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1224 const struct iwl_cfg *cfg, 1229 const struct iwl_cfg *cfg,
1225 const struct iwl_fw *fw) 1230 const struct iwl_fw *fw,
1231 struct dentry *dbgfs_dir)
1226{ 1232{
1227 struct iwl_priv *priv; 1233 struct iwl_priv *priv;
1228 struct ieee80211_hw *hw; 1234 struct ieee80211_hw *hw;
@@ -1466,13 +1472,17 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1466 if (iwlagn_mac_setup_register(priv, &fw->ucode_capa)) 1472 if (iwlagn_mac_setup_register(priv, &fw->ucode_capa))
1467 goto out_destroy_workqueue; 1473 goto out_destroy_workqueue;
1468 1474
1469 if (iwl_dbgfs_register(priv, DRV_NAME)) 1475 if (iwl_dbgfs_register(priv, dbgfs_dir))
1470 IWL_ERR(priv, 1476 goto out_mac80211_unregister;
1471 "failed to create debugfs files. Ignoring error\n");
1472 1477
1473 return op_mode; 1478 return op_mode;
1474 1479
1480out_mac80211_unregister:
1481 iwlagn_mac_unregister(priv);
1475out_destroy_workqueue: 1482out_destroy_workqueue:
1483 iwl_tt_exit(priv);
1484 iwl_testmode_free(priv);
1485 iwl_cancel_deferred_work(priv);
1476 destroy_workqueue(priv->workqueue); 1486 destroy_workqueue(priv->workqueue);
1477 priv->workqueue = NULL; 1487 priv->workqueue = NULL;
1478 iwl_uninit_drv(priv); 1488 iwl_uninit_drv(priv);
@@ -1493,8 +1503,6 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
1493 1503
1494 IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n"); 1504 IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n");
1495 1505
1496 iwl_dbgfs_unregister(priv);
1497
1498 iwl_testmode_free(priv); 1506 iwl_testmode_free(priv);
1499 iwlagn_mac_unregister(priv); 1507 iwlagn_mac_unregister(priv);
1500 1508