iwlwifi: mvm: allow to collect debug data when restart is disabled
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / mvm / mac80211.c
index 5c33d2d154888dbba4ef1ceaa1e1ebf925537bda..e4d62f21a04707b0188bb693e271a34b2b9e4ce5 100644 (file)
@@ -670,8 +670,9 @@ static void iwl_mvm_cleanup_iterator(void *data, u8 *mac,
 }
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
-static void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)
+void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)
 {
+       static char *env[] = { "DRIVER=iwlwifi", "EVENT=error_dump", NULL };
        struct iwl_fw_error_dump_file *dump_file;
        struct iwl_fw_error_dump_data *dump_data;
        struct iwl_fw_error_dump_info *dump_info;
@@ -763,20 +764,16 @@ static void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)
                file_len += fw_error_dump->trans_ptr->len;
        dump_file->file_len = cpu_to_le32(file_len);
        mvm->fw_error_dump = fw_error_dump;
+
+       /* notify the userspace about the error we had */
+       kobject_uevent_env(&mvm->hw->wiphy->dev.kobj, KOBJ_CHANGE, env);
 }
 #endif
 
 static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
 {
-#ifdef CONFIG_IWLWIFI_DEBUGFS
-       static char *env[] = { "DRIVER=iwlwifi", "EVENT=error_dump", NULL };
-
        iwl_mvm_fw_error_dump(mvm);
 
-       /* notify the userspace about the error we had */
-       kobject_uevent_env(&mvm->hw->wiphy->dev.kobj, KOBJ_CHANGE, env);
-#endif
-
        iwl_trans_stop_device(mvm->trans);
 
        mvm->scan_status = IWL_MVM_SCAN_NONE;
@@ -903,6 +900,7 @@ static void iwl_mvm_mac_stop(struct ieee80211_hw *hw)
 
        flush_work(&mvm->d0i3_exit_work);
        flush_work(&mvm->async_handlers_wk);
+       flush_work(&mvm->fw_error_dump_wk);
 
        mutex_lock(&mvm->mutex);
        __iwl_mvm_mac_stop(mvm);
This page took 0.026512 seconds and 5 git commands to generate.