diff options
author | David Spinadel <david.spinadel@intel.com> | 2014-07-22 06:11:18 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-09-03 15:49:02 -0400 |
commit | 2ce89cd6dfc2ea57497ab38f88d4878c06869a81 (patch) | |
tree | e905d5fd7eba9503f3f8f972a162ca22acd835cd /drivers | |
parent | fea7795f1c976513a3262284c4001606075abf5c (diff) |
iwlwifi: mvm: enable passive fragmented scan changes
Enable fragmented scan that was diabled due to a FW bug.
New fixed FWs use a TLV bit to advertise fragmented scan support.
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-fw.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/scan.c | 48 |
2 files changed, 42 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h index 1bb5193c5b1b..99e0ec4635ee 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw.h | |||
@@ -125,6 +125,8 @@ enum iwl_ucode_tlv_flag { | |||
125 | * @IWL_UCODE_TLV_API_CSA_FLOW: ucode can do unbind-bind flow for CSA. | 125 | * @IWL_UCODE_TLV_API_CSA_FLOW: ucode can do unbind-bind flow for CSA. |
126 | * @IWL_UCODE_TLV_API_DISABLE_STA_TX: ucode supports tx_disable bit. | 126 | * @IWL_UCODE_TLV_API_DISABLE_STA_TX: ucode supports tx_disable bit. |
127 | * @IWL_UCODE_TLV_API_LMAC_SCAN: This ucode uses LMAC unified scan API. | 127 | * @IWL_UCODE_TLV_API_LMAC_SCAN: This ucode uses LMAC unified scan API. |
128 | * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time | ||
129 | * longer than the passive one, which is essential for fragmented scan. | ||
128 | */ | 130 | */ |
129 | enum iwl_ucode_tlv_api { | 131 | enum iwl_ucode_tlv_api { |
130 | IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0), | 132 | IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0), |
@@ -133,6 +135,7 @@ enum iwl_ucode_tlv_api { | |||
133 | IWL_UCODE_TLV_API_CSA_FLOW = BIT(4), | 135 | IWL_UCODE_TLV_API_CSA_FLOW = BIT(4), |
134 | IWL_UCODE_TLV_API_DISABLE_STA_TX = BIT(5), | 136 | IWL_UCODE_TLV_API_DISABLE_STA_TX = BIT(5), |
135 | IWL_UCODE_TLV_API_LMAC_SCAN = BIT(6), | 137 | IWL_UCODE_TLV_API_LMAC_SCAN = BIT(6), |
138 | IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8), | ||
136 | }; | 139 | }; |
137 | 140 | ||
138 | /** | 141 | /** |
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index 004b1f5d0314..d01954dcc75d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -279,6 +279,7 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, | |||
279 | { | 279 | { |
280 | bool global_bound = false; | 280 | bool global_bound = false; |
281 | enum ieee80211_band band; | 281 | enum ieee80211_band band; |
282 | u8 frag_passive_dwell = 0; | ||
282 | 283 | ||
283 | ieee80211_iterate_active_interfaces_atomic(mvm->hw, | 284 | ieee80211_iterate_active_interfaces_atomic(mvm->hw, |
284 | IEEE80211_IFACE_ITER_NORMAL, | 285 | IEEE80211_IFACE_ITER_NORMAL, |
@@ -288,12 +289,36 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, | |||
288 | if (!global_bound) | 289 | if (!global_bound) |
289 | goto not_bound; | 290 | goto not_bound; |
290 | 291 | ||
291 | params->suspend_time = 100; | 292 | params->suspend_time = 30; |
292 | params->max_out_time = 600; | 293 | params->max_out_time = 170; |
293 | 294 | ||
294 | if (iwl_mvm_low_latency(mvm)) { | 295 | if (iwl_mvm_low_latency(mvm)) { |
295 | params->suspend_time = 250; | 296 | if (mvm->fw->ucode_capa.api[0] & |
296 | params->max_out_time = 250; | 297 | IWL_UCODE_TLV_API_FRAGMENTED_SCAN) { |
298 | params->suspend_time = 105; | ||
299 | params->max_out_time = 70; | ||
300 | frag_passive_dwell = 20; | ||
301 | } else { | ||
302 | params->suspend_time = 120; | ||
303 | params->max_out_time = 120; | ||
304 | } | ||
305 | } | ||
306 | |||
307 | if (frag_passive_dwell && (mvm->fw->ucode_capa.api[0] & | ||
308 | IWL_UCODE_TLV_API_FRAGMENTED_SCAN)) { | ||
309 | /* | ||
310 | * P2P device scan should not be fragmented to avoid negative | ||
311 | * impact on P2P device discovery. Configure max_out_time to be | ||
312 | * equal to dwell time on passive channel. Take a longest | ||
313 | * possible value, one that corresponds to 2GHz band | ||
314 | */ | ||
315 | if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { | ||
316 | u32 passive_dwell = | ||
317 | iwl_mvm_get_passive_dwell(IEEE80211_BAND_2GHZ); | ||
318 | params->max_out_time = passive_dwell; | ||
319 | } else { | ||
320 | params->passive_fragmented = true; | ||
321 | } | ||
297 | } | 322 | } |
298 | 323 | ||
299 | if (flags & NL80211_SCAN_FLAG_LOW_PRIORITY) | 324 | if (flags & NL80211_SCAN_FLAG_LOW_PRIORITY) |
@@ -302,7 +327,11 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, | |||
302 | not_bound: | 327 | not_bound: |
303 | 328 | ||
304 | for (band = IEEE80211_BAND_2GHZ; band < IEEE80211_NUM_BANDS; band++) { | 329 | for (band = IEEE80211_BAND_2GHZ; band < IEEE80211_NUM_BANDS; band++) { |
305 | params->dwell[band].passive = iwl_mvm_get_passive_dwell(band); | 330 | if (params->passive_fragmented) |
331 | params->dwell[band].passive = frag_passive_dwell; | ||
332 | else | ||
333 | params->dwell[band].passive = | ||
334 | iwl_mvm_get_passive_dwell(band); | ||
306 | params->dwell[band].active = iwl_mvm_get_active_dwell(band, | 335 | params->dwell[band].active = iwl_mvm_get_active_dwell(band, |
307 | n_ssids); | 336 | n_ssids); |
308 | } | 337 | } |
@@ -1100,10 +1129,11 @@ iwl_mvm_build_generic_unified_scan_cmd(struct iwl_mvm *mvm, | |||
1100 | struct iwl_mvm_scan_params *params) | 1129 | struct iwl_mvm_scan_params *params) |
1101 | { | 1130 | { |
1102 | memset(cmd, 0, ksize(cmd)); | 1131 | memset(cmd, 0, ksize(cmd)); |
1103 | cmd->active_dwell = (u8)params->dwell[IEEE80211_BAND_2GHZ].active; | 1132 | cmd->active_dwell = params->dwell[IEEE80211_BAND_2GHZ].active; |
1104 | cmd->passive_dwell = (u8)params->dwell[IEEE80211_BAND_2GHZ].passive; | 1133 | cmd->passive_dwell = params->dwell[IEEE80211_BAND_2GHZ].passive; |
1105 | /* TODO: Use params; now fragmented isn't used. */ | 1134 | if (params->passive_fragmented) |
1106 | cmd->fragmented_dwell = 0; | 1135 | cmd->fragmented_dwell = |
1136 | params->dwell[IEEE80211_BAND_2GHZ].passive; | ||
1107 | cmd->rx_chain_select = iwl_mvm_scan_rx_chain(mvm); | 1137 | cmd->rx_chain_select = iwl_mvm_scan_rx_chain(mvm); |
1108 | cmd->max_out_time = cpu_to_le32(params->max_out_time); | 1138 | cmd->max_out_time = cpu_to_le32(params->max_out_time); |
1109 | cmd->suspend_time = cpu_to_le32(params->suspend_time); | 1139 | cmd->suspend_time = cpu_to_le32(params->suspend_time); |