aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Spinadel <david.spinadel@intel.com>2014-12-29 08:43:48 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-01-22 10:54:01 -0500
commit3cae0734af7c17976ecf4e99a0447168e7fdf4cc (patch)
tree4bf6db4ce0948fda32c77e2c874da5695ce57bac
parentd42537bc479c9a0fdafc12c69b7f38a7a0379beb (diff)
iwlwifi: mvm: scan dwell time corrections
Use only basic dwell time (10 ms for active scan and 110 for passive), regardless of the number of the probes and the band, if it is supported by the FW. The FW will add 3 ms for each probe sent and 10 ms for low band channels. Add a TLV flag to indicate such support in FW. This fix is needed to fix few bugs regarding scans that take too much time. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fw-file.h4
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/scan.c17
2 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
index 731f1db90857..c4266b01bdb9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
@@ -241,6 +241,9 @@ enum iwl_ucode_tlv_flag {
241 * @IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF: ucode supports disabling dummy notif. 241 * @IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF: ucode supports disabling dummy notif.
242 * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time 242 * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time
243 * longer than the passive one, which is essential for fragmented scan. 243 * longer than the passive one, which is essential for fragmented scan.
244 * @IWL_UCODE_TLV_API_BASIC_DWELL: use only basic dwell time in scan command,
245 * regardless of the band or the number of the probes. FW will calculate
246 * the actual dwell time.
244 */ 247 */
245enum iwl_ucode_tlv_api { 248enum iwl_ucode_tlv_api {
246 IWL_UCODE_TLV_API_BT_COEX_SPLIT = BIT(3), 249 IWL_UCODE_TLV_API_BT_COEX_SPLIT = BIT(3),
@@ -248,6 +251,7 @@ enum iwl_ucode_tlv_api {
248 IWL_UCODE_TLV_API_LMAC_SCAN = BIT(6), 251 IWL_UCODE_TLV_API_LMAC_SCAN = BIT(6),
249 IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF = BIT(7), 252 IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF = BIT(7),
250 IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8), 253 IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8),
254 IWL_UCODE_TLV_API_BASIC_DWELL = BIT(13),
251}; 255};
252 256
253/** 257/**
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 0ee0f81113fe..33e42841c9a2 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -173,15 +173,21 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_ssid_ie *cmd_ssid,
173 * already included in the probe template, so we need to set only 173 * already included in the probe template, so we need to set only
174 * req->n_ssids - 1 bits in addition to the first bit. 174 * req->n_ssids - 1 bits in addition to the first bit.
175 */ 175 */
176static u16 iwl_mvm_get_active_dwell(enum ieee80211_band band, int n_ssids) 176static u16 iwl_mvm_get_active_dwell(struct iwl_mvm *mvm,
177 enum ieee80211_band band, int n_ssids)
177{ 178{
179 if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BASIC_DWELL)
180 return 10;
178 if (band == IEEE80211_BAND_2GHZ) 181 if (band == IEEE80211_BAND_2GHZ)
179 return 20 + 3 * (n_ssids + 1); 182 return 20 + 3 * (n_ssids + 1);
180 return 10 + 2 * (n_ssids + 1); 183 return 10 + 2 * (n_ssids + 1);
181} 184}
182 185
183static u16 iwl_mvm_get_passive_dwell(enum ieee80211_band band) 186static u16 iwl_mvm_get_passive_dwell(struct iwl_mvm *mvm,
187 enum ieee80211_band band)
184{ 188{
189 if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BASIC_DWELL)
190 return 110;
185 return band == IEEE80211_BAND_2GHZ ? 100 + 20 : 100 + 10; 191 return band == IEEE80211_BAND_2GHZ ? 100 + 20 : 100 + 10;
186} 192}
187 193
@@ -337,7 +343,8 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm,
337 */ 343 */
338 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { 344 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
339 u32 passive_dwell = 345 u32 passive_dwell =
340 iwl_mvm_get_passive_dwell(IEEE80211_BAND_2GHZ); 346 iwl_mvm_get_passive_dwell(mvm,
347 IEEE80211_BAND_2GHZ);
341 params->max_out_time = passive_dwell; 348 params->max_out_time = passive_dwell;
342 } else { 349 } else {
343 params->passive_fragmented = true; 350 params->passive_fragmented = true;
@@ -354,8 +361,8 @@ not_bound:
354 params->dwell[band].passive = frag_passive_dwell; 361 params->dwell[band].passive = frag_passive_dwell;
355 else 362 else
356 params->dwell[band].passive = 363 params->dwell[band].passive =
357 iwl_mvm_get_passive_dwell(band); 364 iwl_mvm_get_passive_dwell(mvm, band);
358 params->dwell[band].active = iwl_mvm_get_active_dwell(band, 365 params->dwell[band].active = iwl_mvm_get_active_dwell(mvm, band,
359 n_ssids); 366 n_ssids);
360 } 367 }
361} 368}