|
70 | 70 |
|
71 | 71 | #include "mvm.h"
|
72 | 72 | #include "fw-api-scan.h"
|
| 73 | +#include "iwl-io.h" |
73 | 74 |
|
74 | 75 | #define IWL_DENSE_EBS_SCAN_RATIO 5
|
75 | 76 | #define IWL_SPARSE_EBS_SCAN_RATIO 1
|
@@ -398,6 +399,10 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
|
398 | 399 | ieee80211_scan_completed(mvm->hw,
|
399 | 400 | scan_notif->status == IWL_SCAN_OFFLOAD_ABORTED);
|
400 | 401 | iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
|
| 402 | + del_timer(&mvm->scan_timer); |
| 403 | + } else { |
| 404 | + IWL_ERR(mvm, |
| 405 | + "got scan complete notification but no scan is running\n"); |
401 | 406 | }
|
402 | 407 |
|
403 | 408 | mvm->last_ebs_successful =
|
@@ -1217,6 +1222,18 @@ static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type)
|
1217 | 1222 | return -EIO;
|
1218 | 1223 | }
|
1219 | 1224 |
|
| 1225 | +#define SCAN_TIMEOUT (16 * HZ) |
| 1226 | + |
| 1227 | +void iwl_mvm_scan_timeout(unsigned long data) |
| 1228 | +{ |
| 1229 | + struct iwl_mvm *mvm = (struct iwl_mvm *)data; |
| 1230 | + |
| 1231 | + IWL_ERR(mvm, "regular scan timed out\n"); |
| 1232 | + |
| 1233 | + del_timer(&mvm->scan_timer); |
| 1234 | + iwl_force_nmi(mvm->trans); |
| 1235 | +} |
| 1236 | + |
1220 | 1237 | int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
1221 | 1238 | struct cfg80211_scan_request *req,
|
1222 | 1239 | struct ieee80211_scan_ies *ies)
|
@@ -1296,6 +1313,8 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
1296 | 1313 | mvm->scan_status |= IWL_MVM_SCAN_REGULAR;
|
1297 | 1314 | iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN);
|
1298 | 1315 |
|
| 1316 | + mod_timer(&mvm->scan_timer, jiffies + SCAN_TIMEOUT); |
| 1317 | + |
1299 | 1318 | return 0;
|
1300 | 1319 | }
|
1301 | 1320 |
|
@@ -1413,6 +1432,7 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
|
1413 | 1432 | if (mvm->scan_uid_status[uid] == IWL_MVM_SCAN_REGULAR) {
|
1414 | 1433 | ieee80211_scan_completed(mvm->hw, aborted);
|
1415 | 1434 | iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
|
| 1435 | + del_timer(&mvm->scan_timer); |
1416 | 1436 | } else if (mvm->scan_uid_status[uid] == IWL_MVM_SCAN_SCHED) {
|
1417 | 1437 | ieee80211_sched_scan_stopped(mvm->hw);
|
1418 | 1438 | mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
|
@@ -1608,6 +1628,7 @@ int iwl_mvm_scan_stop(struct iwl_mvm *mvm, int type, bool notify)
|
1608 | 1628 | * to release the scan reference here.
|
1609 | 1629 | */
|
1610 | 1630 | iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
|
| 1631 | + del_timer(&mvm->scan_timer); |
1611 | 1632 | if (notify)
|
1612 | 1633 | ieee80211_scan_completed(mvm->hw, true);
|
1613 | 1634 | } else if (notify) {
|
|
0 commit comments