aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Spinadel <david.spinadel@intel.com>2014-01-09 07:22:55 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-02-03 15:23:34 -0500
commit992f81fcd97e87e7ebbb26e544430adf483203f0 (patch)
treed7649ff1ec208de79f281d5ca722d35692764fef
parentdf8fe3aed04a158ea657724209081c8322f8eac1 (diff)
iwlwifi: mvm: notify scan completed even if no fw_restart
Notify scan completed if fw_restart flow isn't going to be run. Otherwise, the scan will stay stack forever and mac80211 will not be able to remove the interface. Signed-off-by: David Spinadel <david.spinadel@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/ops.c43
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/scan.c2
2 files changed, 24 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c
index 734b022d339a..fdadfe95d314 100644
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -714,6 +714,29 @@ static void iwl_mvm_nic_restart(struct iwl_mvm *mvm)
714 iwl_abort_notification_waits(&mvm->notif_wait); 714 iwl_abort_notification_waits(&mvm->notif_wait);
715 715
716 /* 716 /*
717 * This is a bit racy, but worst case we tell mac80211 about
718 * a stopped/aborted scan when that was already done which
719 * is not a problem. It is necessary to abort any os scan
720 * here because mac80211 requires having the scan cleared
721 * before restarting.
722 * We'll reset the scan_status to NONE in restart cleanup in
723 * the next start() call from mac80211. If restart isn't called
724 * (no fw restart) scan status will stay busy.
725 */
726 switch (mvm->scan_status) {
727 case IWL_MVM_SCAN_NONE:
728 break;
729 case IWL_MVM_SCAN_OS:
730 ieee80211_scan_completed(mvm->hw, true);
731 break;
732 case IWL_MVM_SCAN_SCHED:
733 /* Sched scan will be restarted by mac80211 in restart_hw. */
734 if (!mvm->restart_fw)
735 ieee80211_sched_scan_stopped(mvm->hw);
736 break;
737 }
738
739 /*
717 * If we're restarting already, don't cycle restarts. 740 * If we're restarting already, don't cycle restarts.
718 * If INIT fw asserted, it will likely fail again. 741 * If INIT fw asserted, it will likely fail again.
719 * If WoWLAN fw asserted, don't restart either, mac80211 742 * If WoWLAN fw asserted, don't restart either, mac80211
@@ -744,26 +767,6 @@ static void iwl_mvm_nic_restart(struct iwl_mvm *mvm)
744 INIT_WORK(&reprobe->work, iwl_mvm_reprobe_wk); 767 INIT_WORK(&reprobe->work, iwl_mvm_reprobe_wk);
745 schedule_work(&reprobe->work); 768 schedule_work(&reprobe->work);
746 } else if (mvm->cur_ucode == IWL_UCODE_REGULAR && mvm->restart_fw) { 769 } else if (mvm->cur_ucode == IWL_UCODE_REGULAR && mvm->restart_fw) {
747 /*
748 * This is a bit racy, but worst case we tell mac80211 about
749 * a stopped/aborted (sched) scan when that was already done
750 * which is not a problem. It is necessary to abort any scan
751 * here because mac80211 requires having the scan cleared
752 * before restarting.
753 * We'll reset the scan_status to NONE in restart cleanup in
754 * the next start() call from mac80211.
755 */
756 switch (mvm->scan_status) {
757 case IWL_MVM_SCAN_NONE:
758 break;
759 case IWL_MVM_SCAN_OS:
760 ieee80211_scan_completed(mvm->hw, true);
761 break;
762 case IWL_MVM_SCAN_SCHED:
763 /* Sched scan will be restarted by mac80211. */
764 break;
765 }
766
767 if (mvm->restart_fw > 0) 770 if (mvm->restart_fw > 0)
768 mvm->restart_fw--; 771 mvm->restart_fw--;
769 ieee80211_restart_hw(mvm->hw); 772 ieee80211_restart_hw(mvm->hw);
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 0e0007960612..6c5c17397f7e 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -487,7 +487,7 @@ void iwl_mvm_cancel_scan(struct iwl_mvm *mvm)
487 ret = iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_CMD, CMD_SYNC, 0, NULL); 487 ret = iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_CMD, CMD_SYNC, 0, NULL);
488 if (ret) { 488 if (ret) {
489 IWL_ERR(mvm, "Couldn't send SCAN_ABORT_CMD: %d\n", ret); 489 IWL_ERR(mvm, "Couldn't send SCAN_ABORT_CMD: %d\n", ret);
490 /* mac80211's state will be cleaned in the fw_restart flow */ 490 /* mac80211's state will be cleaned in the nic_restart flow */
491 goto out_remove_notif; 491 goto out_remove_notif;
492 } 492 }
493 493