aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2016-10-05 02:28:53 -0400
committerLuca Coelho <luciano.coelho@intel.com>2016-10-19 02:54:45 -0400
commit5a143db8c4a28dab6423cb6197e9f1389da375f2 (patch)
treeb449b3ea1ee6acf743885ac28ee5073adcd8d375 /drivers/net/wireless/intel/iwlwifi/mvm/scan.c
parente0d9727c111a5917a1184c71c1a8e6f78c7fc41d (diff)
iwlwifi: mvm: fix netdetect starting/stopping for unified images
With unified images, we need to make sure the net-detect scan is stopped after resuming, since we don't restart the FW. Also, we need to make sure we check if there are enough scan slots available to run it, as we do with other scans. Fixes: commit 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/scan.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/scan.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index f279fdd6eb44..fa9743205491 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -1199,6 +1199,9 @@ static int iwl_mvm_num_scans(struct iwl_mvm *mvm)
1199 1199
1200static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type) 1200static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type)
1201{ 1201{
1202 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa,
1203 IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG);
1204
1202 /* This looks a bit arbitrary, but the idea is that if we run 1205 /* This looks a bit arbitrary, but the idea is that if we run
1203 * out of possible simultaneous scans and the userspace is 1206 * out of possible simultaneous scans and the userspace is
1204 * trying to run a scan type that is already running, we 1207 * trying to run a scan type that is already running, we
@@ -1225,12 +1228,30 @@ static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type)
1225 return -EBUSY; 1228 return -EBUSY;
1226 return iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true); 1229 return iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true);
1227 case IWL_MVM_SCAN_NETDETECT: 1230 case IWL_MVM_SCAN_NETDETECT:
1228 /* No need to stop anything for net-detect since the 1231 /* For non-unified images, there's no need to stop
1229 * firmware is restarted anyway. This way, any sched 1232 * anything for net-detect since the firmware is
1230 * scans that were running will be restarted when we 1233 * restarted anyway. This way, any sched scans that
1231 * resume. 1234 * were running will be restarted when we resume.
1232 */ 1235 */
1233 return 0; 1236 if (!unified_image)
1237 return 0;
1238
1239 /* If this is a unified image and we ran out of scans,
1240 * we need to stop something. Prefer stopping regular
1241 * scans, because the results are useless at this
1242 * point, and we should be able to keep running
1243 * another scheduled scan while suspended.
1244 */
1245 if (mvm->scan_status & IWL_MVM_SCAN_REGULAR_MASK)
1246 return iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR,
1247 true);
1248 if (mvm->scan_status & IWL_MVM_SCAN_SCHED_MASK)
1249 return iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED,
1250 true);
1251
1252 /* fall through, something is wrong if no scan was
1253 * running but we ran out of scans.
1254 */
1234 default: 1255 default:
1235 WARN_ON(1); 1256 WARN_ON(1);
1236 break; 1257 break;