aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2016-02-02 15:58:46 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2016-02-27 14:59:53 -0500
commita339e918daf281a0eb78783abc954c1e97af16c4 (patch)
treed73046ac84a7cfc7745a9e5b691ef2350626b522 /drivers/net/wireless/intel/iwlwifi/mvm/scan.c
parent3cce9bb07b5d40a3f8a10a1148f10896a7a42f5a (diff)
iwlwifi: mvm: handle pass all scan reporting
The firmware doesn't send match found notifications when no matchsets are passed. This makes sense because if there are no matchsets, nothing can be matched. But the nl80211 API should report when there are results available, even if no matchsets were passed. To handle this, we can use the firmware's ITERATION_COMPLETE reporting, which will send us notifications every time it completed a scheduled scan iteration. Then we can set a flag when we received beacons and use that to report that results are available. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/scan.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/scan.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index aa6d8074f63a..09eb72c4ae43 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -7,6 +7,7 @@
7 * 7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 Intel Deutschland GmbH
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 13 * it under the terms of version 2 of the GNU General Public License as
@@ -33,6 +34,7 @@
33 * 34 *
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 35 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 36 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
37 * Copyright(c) 2016 Intel Deutschland GmbH
36 * All rights reserved. 38 * All rights reserved.
37 * 39 *
38 * Redistribution and use in source and binary forms, with or without 40 * Redistribution and use in source and binary forms, with or without
@@ -297,6 +299,12 @@ void iwl_mvm_rx_lmac_scan_iter_complete_notif(struct iwl_mvm *mvm,
297 iwl_mvm_dump_channel_list(notif->results, 299 iwl_mvm_dump_channel_list(notif->results,
298 notif->scanned_channels, buf, 300 notif->scanned_channels, buf,
299 sizeof(buf))); 301 sizeof(buf)));
302
303 if (mvm->sched_scan_pass_all == SCHED_SCAN_PASS_ALL_FOUND) {
304 IWL_DEBUG_SCAN(mvm, "Pass all scheduled scan results found\n");
305 ieee80211_sched_scan_results(mvm->hw);
306 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_ENABLED;
307 }
300} 308}
301 309
302void iwl_mvm_rx_scan_match_found(struct iwl_mvm *mvm, 310void iwl_mvm_rx_scan_match_found(struct iwl_mvm *mvm,
@@ -380,6 +388,7 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
380 388
381 mvm->scan_status &= ~IWL_MVM_SCAN_SCHED; 389 mvm->scan_status &= ~IWL_MVM_SCAN_SCHED;
382 ieee80211_sched_scan_stopped(mvm->hw); 390 ieee80211_sched_scan_stopped(mvm->hw);
391 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
383 } else if (mvm->scan_status & IWL_MVM_SCAN_REGULAR) { 392 } else if (mvm->scan_status & IWL_MVM_SCAN_REGULAR) {
384 IWL_DEBUG_SCAN(mvm, "Regular scan %s, EBS status %s (FW)\n", 393 IWL_DEBUG_SCAN(mvm, "Regular scan %s, EBS status %s (FW)\n",
385 aborted ? "aborted" : "completed", 394 aborted ? "aborted" : "completed",
@@ -533,10 +542,13 @@ static bool iwl_mvm_scan_pass_all(struct iwl_mvm *mvm,
533 IWL_DEBUG_SCAN(mvm, 542 IWL_DEBUG_SCAN(mvm,
534 "Sending scheduled scan with filtering, n_match_sets %d\n", 543 "Sending scheduled scan with filtering, n_match_sets %d\n",
535 req->n_match_sets); 544 req->n_match_sets);
545 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
536 return false; 546 return false;
537 } 547 }
538 548
539 IWL_DEBUG_SCAN(mvm, "Sending Scheduled scan without filtering\n"); 549 IWL_DEBUG_SCAN(mvm, "Sending Scheduled scan without filtering\n");
550
551 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_ENABLED;
540 return true; 552 return true;
541} 553}
542 554
@@ -788,6 +800,9 @@ static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm,
788 flags |= IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE; 800 flags |= IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE;
789#endif 801#endif
790 802
803 if (mvm->sched_scan_pass_all == SCHED_SCAN_PASS_ALL_ENABLED)
804 flags |= IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE;
805
791 if (iwl_mvm_is_regular_scan(params) && 806 if (iwl_mvm_is_regular_scan(params) &&
792 vif->type != NL80211_IFTYPE_P2P_DEVICE && 807 vif->type != NL80211_IFTYPE_P2P_DEVICE &&
793 params->type != IWL_SCAN_TYPE_FRAGMENTED) 808 params->type != IWL_SCAN_TYPE_FRAGMENTED)
@@ -1074,6 +1089,9 @@ static u32 iwl_mvm_scan_umac_flags(struct iwl_mvm *mvm,
1074 flags |= IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE; 1089 flags |= IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE;
1075#endif 1090#endif
1076 1091
1092 if (mvm->sched_scan_pass_all == SCHED_SCAN_PASS_ALL_ENABLED)
1093 flags |= IWL_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE;
1094
1077 if (iwl_mvm_is_regular_scan(params) && 1095 if (iwl_mvm_is_regular_scan(params) &&
1078 vif->type != NL80211_IFTYPE_P2P_DEVICE && 1096 vif->type != NL80211_IFTYPE_P2P_DEVICE &&
1079 params->type != IWL_SCAN_TYPE_FRAGMENTED) 1097 params->type != IWL_SCAN_TYPE_FRAGMENTED)
@@ -1301,10 +1319,6 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
1301 return -EBUSY; 1319 return -EBUSY;
1302 } 1320 }
1303 1321
1304 /* we don't support "match all" in the firmware */
1305 if (!req->n_match_sets)
1306 return -EOPNOTSUPP;
1307
1308 ret = iwl_mvm_check_running_scans(mvm, type); 1322 ret = iwl_mvm_check_running_scans(mvm, type);
1309 if (ret) 1323 if (ret)
1310 return ret; 1324 return ret;
@@ -1400,6 +1414,7 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
1400 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); 1414 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
1401 } else if (mvm->scan_uid_status[uid] == IWL_MVM_SCAN_SCHED) { 1415 } else if (mvm->scan_uid_status[uid] == IWL_MVM_SCAN_SCHED) {
1402 ieee80211_sched_scan_stopped(mvm->hw); 1416 ieee80211_sched_scan_stopped(mvm->hw);
1417 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
1403 } 1418 }
1404 1419
1405 mvm->scan_status &= ~mvm->scan_uid_status[uid]; 1420 mvm->scan_status &= ~mvm->scan_uid_status[uid];
@@ -1434,6 +1449,12 @@ void iwl_mvm_rx_umac_scan_iter_complete_notif(struct iwl_mvm *mvm,
1434 iwl_mvm_dump_channel_list(notif->results, 1449 iwl_mvm_dump_channel_list(notif->results,
1435 notif->scanned_channels, buf, 1450 notif->scanned_channels, buf,
1436 sizeof(buf))); 1451 sizeof(buf)));
1452
1453 if (mvm->sched_scan_pass_all == SCHED_SCAN_PASS_ALL_FOUND) {
1454 IWL_DEBUG_SCAN(mvm, "Pass all scheduled scan results found\n");
1455 ieee80211_sched_scan_results(mvm->hw);
1456 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_ENABLED;
1457 }
1437} 1458}
1438 1459
1439static int iwl_mvm_umac_scan_abort(struct iwl_mvm *mvm, int type) 1460static int iwl_mvm_umac_scan_abort(struct iwl_mvm *mvm, int type)
@@ -1528,6 +1549,7 @@ void iwl_mvm_report_scan_aborted(struct iwl_mvm *mvm)
1528 uid = iwl_mvm_scan_uid_by_status(mvm, IWL_MVM_SCAN_SCHED); 1549 uid = iwl_mvm_scan_uid_by_status(mvm, IWL_MVM_SCAN_SCHED);
1529 if (uid >= 0 && !mvm->restart_fw) { 1550 if (uid >= 0 && !mvm->restart_fw) {
1530 ieee80211_sched_scan_stopped(mvm->hw); 1551 ieee80211_sched_scan_stopped(mvm->hw);
1552 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
1531 mvm->scan_uid_status[uid] = 0; 1553 mvm->scan_uid_status[uid] = 0;
1532 } 1554 }
1533 1555
@@ -1549,8 +1571,11 @@ void iwl_mvm_report_scan_aborted(struct iwl_mvm *mvm)
1549 * restart_hw, so do not report if FW is about to be 1571 * restart_hw, so do not report if FW is about to be
1550 * restarted. 1572 * restarted.
1551 */ 1573 */
1552 if ((mvm->scan_status & IWL_MVM_SCAN_SCHED) && !mvm->restart_fw) 1574 if ((mvm->scan_status & IWL_MVM_SCAN_SCHED) &&
1575 !mvm->restart_fw) {
1553 ieee80211_sched_scan_stopped(mvm->hw); 1576 ieee80211_sched_scan_stopped(mvm->hw);
1577 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
1578 }
1554 } 1579 }
1555} 1580}
1556 1581
@@ -1586,6 +1611,7 @@ out:
1586 ieee80211_scan_completed(mvm->hw, true); 1611 ieee80211_scan_completed(mvm->hw, true);
1587 } else if (notify) { 1612 } else if (notify) {
1588 ieee80211_sched_scan_stopped(mvm->hw); 1613 ieee80211_sched_scan_stopped(mvm->hw);
1614 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
1589 } 1615 }
1590 1616
1591 return ret; 1617 return ret;