aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/scan.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index c91dc8498852..63e7b16edb55 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -348,7 +348,10 @@ int iwl_mvm_scan_request(struct iwl_mvm *mvm,
348 struct iwl_mvm_scan_params params = {}; 348 struct iwl_mvm_scan_params params = {};
349 349
350 lockdep_assert_held(&mvm->mutex); 350 lockdep_assert_held(&mvm->mutex);
351 BUG_ON(mvm->scan_cmd == NULL); 351
352 /* we should have failed registration if scan_cmd was NULL */
353 if (WARN_ON(mvm->scan_cmd == NULL))
354 return -ENOMEM;
352 355
353 IWL_DEBUG_SCAN(mvm, "Handling mac80211 scan request\n"); 356 IWL_DEBUG_SCAN(mvm, "Handling mac80211 scan request\n");
354 mvm->scan_status = IWL_MVM_SCAN_OS; 357 mvm->scan_status = IWL_MVM_SCAN_OS;
@@ -567,9 +570,13 @@ int iwl_mvm_rx_scan_offload_complete_notif(struct iwl_mvm *mvm,
567 /* scan status must be locked for proper checking */ 570 /* scan status must be locked for proper checking */
568 lockdep_assert_held(&mvm->mutex); 571 lockdep_assert_held(&mvm->mutex);
569 572
570 IWL_DEBUG_SCAN(mvm, "Scheduled scan completed, status %s\n", 573 IWL_DEBUG_SCAN(mvm,
574 "Scheduled scan completed, status %s EBS status %s:%d\n",
571 scan_notif->status == IWL_SCAN_OFFLOAD_COMPLETED ? 575 scan_notif->status == IWL_SCAN_OFFLOAD_COMPLETED ?
572 "completed" : "aborted"); 576 "completed" : "aborted", scan_notif->ebs_status ==
577 IWL_SCAN_EBS_SUCCESS ? "success" : "failed",
578 scan_notif->ebs_status);
579
573 580
574 /* only call mac80211 completion if the stop was initiated by FW */ 581 /* only call mac80211 completion if the stop was initiated by FW */
575 if (mvm->scan_status == IWL_MVM_SCAN_SCHED) { 582 if (mvm->scan_status == IWL_MVM_SCAN_SCHED) {
@@ -577,6 +584,8 @@ int iwl_mvm_rx_scan_offload_complete_notif(struct iwl_mvm *mvm,
577 ieee80211_sched_scan_stopped(mvm->hw); 584 ieee80211_sched_scan_stopped(mvm->hw);
578 } 585 }
579 586
587 mvm->last_ebs_successful = !scan_notif->ebs_status;
588
580 return 0; 589 return 0;
581} 590}
582 591
@@ -913,6 +922,11 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
913 scan_req.flags |= cpu_to_le16(IWL_SCAN_OFFLOAD_FLAG_PASS_ALL); 922 scan_req.flags |= cpu_to_le16(IWL_SCAN_OFFLOAD_FLAG_PASS_ALL);
914 } 923 }
915 924
925 if (mvm->last_ebs_successful &&
926 mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_EBS_SUPPORT)
927 scan_req.flags |=
928 cpu_to_le16(IWL_SCAN_OFFLOAD_FLAG_EBS_ACCURATE_MODE);
929
916 return iwl_mvm_send_cmd_pdu(mvm, SCAN_OFFLOAD_REQUEST_CMD, CMD_SYNC, 930 return iwl_mvm_send_cmd_pdu(mvm, SCAN_OFFLOAD_REQUEST_CMD, CMD_SYNC,
917 sizeof(scan_req), &scan_req); 931 sizeof(scan_req), &scan_req);
918} 932}