diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/scan.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/scan.c | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index 004b1f5d0314..bf9c63dc4a7d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -6,6 +6,7 @@ | |||
6 | * GPL LICENSE SUMMARY | 6 | * GPL LICENSE SUMMARY |
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 - 2014 Intel Mobile Communications GmbH | ||
9 | * | 10 | * |
10 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of version 2 of the GNU General Public License as | 12 | * it under the terms of version 2 of the GNU General Public License as |
@@ -31,6 +32,7 @@ | |||
31 | * BSD LICENSE | 32 | * BSD LICENSE |
32 | * | 33 | * |
33 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. | 34 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
35 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | ||
34 | * All rights reserved. | 36 | * All rights reserved. |
35 | * | 37 | * |
36 | * Redistribution and use in source and binary forms, with or without | 38 | * Redistribution and use in source and binary forms, with or without |
@@ -279,6 +281,7 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, | |||
279 | { | 281 | { |
280 | bool global_bound = false; | 282 | bool global_bound = false; |
281 | enum ieee80211_band band; | 283 | enum ieee80211_band band; |
284 | u8 frag_passive_dwell = 0; | ||
282 | 285 | ||
283 | ieee80211_iterate_active_interfaces_atomic(mvm->hw, | 286 | ieee80211_iterate_active_interfaces_atomic(mvm->hw, |
284 | IEEE80211_IFACE_ITER_NORMAL, | 287 | IEEE80211_IFACE_ITER_NORMAL, |
@@ -288,12 +291,36 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, | |||
288 | if (!global_bound) | 291 | if (!global_bound) |
289 | goto not_bound; | 292 | goto not_bound; |
290 | 293 | ||
291 | params->suspend_time = 100; | 294 | params->suspend_time = 30; |
292 | params->max_out_time = 600; | 295 | params->max_out_time = 170; |
293 | 296 | ||
294 | if (iwl_mvm_low_latency(mvm)) { | 297 | if (iwl_mvm_low_latency(mvm)) { |
295 | params->suspend_time = 250; | 298 | if (mvm->fw->ucode_capa.api[0] & |
296 | params->max_out_time = 250; | 299 | IWL_UCODE_TLV_API_FRAGMENTED_SCAN) { |
300 | params->suspend_time = 105; | ||
301 | params->max_out_time = 70; | ||
302 | frag_passive_dwell = 20; | ||
303 | } else { | ||
304 | params->suspend_time = 120; | ||
305 | params->max_out_time = 120; | ||
306 | } | ||
307 | } | ||
308 | |||
309 | if (frag_passive_dwell && (mvm->fw->ucode_capa.api[0] & | ||
310 | IWL_UCODE_TLV_API_FRAGMENTED_SCAN)) { | ||
311 | /* | ||
312 | * P2P device scan should not be fragmented to avoid negative | ||
313 | * impact on P2P device discovery. Configure max_out_time to be | ||
314 | * equal to dwell time on passive channel. Take a longest | ||
315 | * possible value, one that corresponds to 2GHz band | ||
316 | */ | ||
317 | if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { | ||
318 | u32 passive_dwell = | ||
319 | iwl_mvm_get_passive_dwell(IEEE80211_BAND_2GHZ); | ||
320 | params->max_out_time = passive_dwell; | ||
321 | } else { | ||
322 | params->passive_fragmented = true; | ||
323 | } | ||
297 | } | 324 | } |
298 | 325 | ||
299 | if (flags & NL80211_SCAN_FLAG_LOW_PRIORITY) | 326 | if (flags & NL80211_SCAN_FLAG_LOW_PRIORITY) |
@@ -302,7 +329,11 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, | |||
302 | not_bound: | 329 | not_bound: |
303 | 330 | ||
304 | for (band = IEEE80211_BAND_2GHZ; band < IEEE80211_NUM_BANDS; band++) { | 331 | for (band = IEEE80211_BAND_2GHZ; band < IEEE80211_NUM_BANDS; band++) { |
305 | params->dwell[band].passive = iwl_mvm_get_passive_dwell(band); | 332 | if (params->passive_fragmented) |
333 | params->dwell[band].passive = frag_passive_dwell; | ||
334 | else | ||
335 | params->dwell[band].passive = | ||
336 | iwl_mvm_get_passive_dwell(band); | ||
306 | params->dwell[band].active = iwl_mvm_get_active_dwell(band, | 337 | params->dwell[band].active = iwl_mvm_get_active_dwell(band, |
307 | n_ssids); | 338 | n_ssids); |
308 | } | 339 | } |
@@ -1100,10 +1131,11 @@ iwl_mvm_build_generic_unified_scan_cmd(struct iwl_mvm *mvm, | |||
1100 | struct iwl_mvm_scan_params *params) | 1131 | struct iwl_mvm_scan_params *params) |
1101 | { | 1132 | { |
1102 | memset(cmd, 0, ksize(cmd)); | 1133 | memset(cmd, 0, ksize(cmd)); |
1103 | cmd->active_dwell = (u8)params->dwell[IEEE80211_BAND_2GHZ].active; | 1134 | cmd->active_dwell = params->dwell[IEEE80211_BAND_2GHZ].active; |
1104 | cmd->passive_dwell = (u8)params->dwell[IEEE80211_BAND_2GHZ].passive; | 1135 | cmd->passive_dwell = params->dwell[IEEE80211_BAND_2GHZ].passive; |
1105 | /* TODO: Use params; now fragmented isn't used. */ | 1136 | if (params->passive_fragmented) |
1106 | cmd->fragmented_dwell = 0; | 1137 | cmd->fragmented_dwell = |
1138 | params->dwell[IEEE80211_BAND_2GHZ].passive; | ||
1107 | cmd->rx_chain_select = iwl_mvm_scan_rx_chain(mvm); | 1139 | cmd->rx_chain_select = iwl_mvm_scan_rx_chain(mvm); |
1108 | cmd->max_out_time = cpu_to_le32(params->max_out_time); | 1140 | cmd->max_out_time = cpu_to_le32(params->max_out_time); |
1109 | cmd->suspend_time = cpu_to_le32(params->suspend_time); | 1141 | cmd->suspend_time = cpu_to_le32(params->suspend_time); |