Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3f8d0a3 authored by Haim Dreyfuss's avatar Haim Dreyfuss Committed by Emmanuel Grumbach
Browse files

iwlwifi: mvm: Alter passive scan fragmentation parameters in case of multi-MAC



Make passive scan fragmentation depends on the number of active
interfaces. In case of single-MAC, make passive scan less fragmented.

Signed-off-by: default avatarHaim Dreyfuss <haim.dreyfuss@intel.com>
Reviewed-by: default avatarAlexander Bondar <alexander.bondar@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent ff298624
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -284,11 +284,11 @@ static void iwl_mvm_scan_condition_iterator(void *data, u8 *mac,
					    struct ieee80211_vif *vif)
					    struct ieee80211_vif *vif)
{
{
	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
	bool *global_bound = data;
	int *global_cnt = data;


	if (vif->type != NL80211_IFTYPE_P2P_DEVICE && mvmvif->phy_ctxt &&
	if (vif->type != NL80211_IFTYPE_P2P_DEVICE && mvmvif->phy_ctxt &&
	    mvmvif->phy_ctxt->id < MAX_PHYS)
	    mvmvif->phy_ctxt->id < MAX_PHYS)
		*global_bound = true;
		*global_cnt += 1;
}
}


static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm,
static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm,
@@ -296,16 +296,16 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm,
				     int n_ssids, u32 flags,
				     int n_ssids, u32 flags,
				     struct iwl_mvm_scan_params *params)
				     struct iwl_mvm_scan_params *params)
{
{
	bool global_bound = false;
	int global_cnt = 0;
	enum ieee80211_band band;
	enum ieee80211_band band;
	u8 frag_passive_dwell = 0;
	u8 frag_passive_dwell = 0;


	ieee80211_iterate_active_interfaces_atomic(mvm->hw,
	ieee80211_iterate_active_interfaces_atomic(mvm->hw,
					    IEEE80211_IFACE_ITER_NORMAL,
					    IEEE80211_IFACE_ITER_NORMAL,
					    iwl_mvm_scan_condition_iterator,
					    iwl_mvm_scan_condition_iterator,
					    &global_bound);
					    &global_cnt);


	if (!global_bound)
	if (!global_cnt)
		goto not_bound;
		goto not_bound;


	params->suspend_time = 30;
	params->suspend_time = 30;
@@ -316,7 +316,11 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm,
		    IWL_UCODE_TLV_API_FRAGMENTED_SCAN) {
		    IWL_UCODE_TLV_API_FRAGMENTED_SCAN) {
			params->suspend_time = 105;
			params->suspend_time = 105;
			params->max_out_time = 70;
			params->max_out_time = 70;
			frag_passive_dwell = 20;
			/*
			 * If there is more than one active interface make
			 * passive scan more fragmented.
			 */
			frag_passive_dwell = (global_cnt < 2) ? 40 : 20;
		} else {
		} else {
			params->suspend_time = 120;
			params->suspend_time = 120;
			params->max_out_time = 120;
			params->max_out_time = 120;