Commit 720daf20 authored by David Spinadel's avatar David Spinadel Committed by Emmanuel Grumbach

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: default avatarDavid Spinadel <david.spinadel@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 7e2a3883
...@@ -243,6 +243,9 @@ enum iwl_ucode_tlv_flag { ...@@ -243,6 +243,9 @@ enum iwl_ucode_tlv_flag {
* @IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF: ucode supports disabling dummy notif. * @IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF: ucode supports disabling dummy notif.
* @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time
* longer than the passive one, which is essential for fragmented scan. * longer than the passive one, which is essential for fragmented scan.
* @IWL_UCODE_TLV_API_BASIC_DWELL: use only basic dwell time in scan command,
* regardless of the band or the number of the probes. FW will calculate
* the actual dwell time.
*/ */
enum iwl_ucode_tlv_api { enum iwl_ucode_tlv_api {
IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0), IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0),
...@@ -253,6 +256,7 @@ enum iwl_ucode_tlv_api { ...@@ -253,6 +256,7 @@ enum iwl_ucode_tlv_api {
IWL_UCODE_TLV_API_LMAC_SCAN = BIT(6), IWL_UCODE_TLV_API_LMAC_SCAN = BIT(6),
IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF = BIT(7), IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF = BIT(7),
IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8), IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8),
IWL_UCODE_TLV_API_BASIC_DWELL = BIT(13),
}; };
/** /**
......
...@@ -171,15 +171,21 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_ssid_ie *cmd_ssid, ...@@ -171,15 +171,21 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_ssid_ie *cmd_ssid,
* already included in the probe template, so we need to set only * already included in the probe template, so we need to set only
* req->n_ssids - 1 bits in addition to the first bit. * req->n_ssids - 1 bits in addition to the first bit.
*/ */
static u16 iwl_mvm_get_active_dwell(enum ieee80211_band band, int n_ssids) static u16 iwl_mvm_get_active_dwell(struct iwl_mvm *mvm,
enum ieee80211_band band, int n_ssids)
{ {
if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BASIC_DWELL)
return 10;
if (band == IEEE80211_BAND_2GHZ) if (band == IEEE80211_BAND_2GHZ)
return 20 + 3 * (n_ssids + 1); return 20 + 3 * (n_ssids + 1);
return 10 + 2 * (n_ssids + 1); return 10 + 2 * (n_ssids + 1);
} }
static u16 iwl_mvm_get_passive_dwell(enum ieee80211_band band) static u16 iwl_mvm_get_passive_dwell(struct iwl_mvm *mvm,
enum ieee80211_band band)
{ {
if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BASIC_DWELL)
return 110;
return band == IEEE80211_BAND_2GHZ ? 100 + 20 : 100 + 10; return band == IEEE80211_BAND_2GHZ ? 100 + 20 : 100 + 10;
} }
...@@ -331,7 +337,8 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, ...@@ -331,7 +337,8 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm,
*/ */
if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
u32 passive_dwell = u32 passive_dwell =
iwl_mvm_get_passive_dwell(IEEE80211_BAND_2GHZ); iwl_mvm_get_passive_dwell(mvm,
IEEE80211_BAND_2GHZ);
params->max_out_time = passive_dwell; params->max_out_time = passive_dwell;
} else { } else {
params->passive_fragmented = true; params->passive_fragmented = true;
...@@ -348,8 +355,8 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, ...@@ -348,8 +355,8 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm,
params->dwell[band].passive = frag_passive_dwell; params->dwell[band].passive = frag_passive_dwell;
else else
params->dwell[band].passive = params->dwell[band].passive =
iwl_mvm_get_passive_dwell(band); iwl_mvm_get_passive_dwell(mvm, band);
params->dwell[band].active = iwl_mvm_get_active_dwell(band, params->dwell[band].active = iwl_mvm_get_active_dwell(mvm, band,
n_ssids); n_ssids);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment