From patchwork Tue Dec 30 14:19:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 5552541 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 77A58BFE6A for ; Tue, 30 Dec 2014 14:20:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA8C22012E for ; Tue, 30 Dec 2014 14:20:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4A4620172 for ; Tue, 30 Dec 2014 14:20:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752072AbaL3OUh (ORCPT ); Tue, 30 Dec 2014 09:20:37 -0500 Received: from mga11.intel.com ([192.55.52.93]:50567 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752032AbaL3OUf (ORCPT ); Tue, 30 Dec 2014 09:20:35 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 30 Dec 2014 06:20:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,666,1413270000"; d="scan'208";a="644559146" Received: from egrumbacbox.jer.intel.com ([10.12.126.105]) by fmsmga001.fm.intel.com with ESMTP; 30 Dec 2014 06:20:33 -0800 From: Emmanuel Grumbach To: linux-wireless@vger.kernel.org Cc: Haim Dreyfuss , Emmanuel Grumbach Subject: [PATCH 32/33] iwlwifi: mvm: Alter passive scan fragmentation parameters in case of multi-MAC Date: Tue, 30 Dec 2014 16:19:07 +0200 Message-Id: <1419949148-24046-32-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1419948357.21410.4.camel@egrumbacBox> References: <1419948357.21410.4.camel@egrumbacBox> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Haim Dreyfuss Make passive scan fragmentation depends on the number of active interfaces. In case of single-MAC, make passive scan less fragmented. Signed-off-by: Haim Dreyfuss Reviewed-by: Alexander Bondar Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/scan.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index ed229a8..348b9c4 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c @@ -284,11 +284,11 @@ static void iwl_mvm_scan_condition_iterator(void *data, u8 *mac, struct ieee80211_vif *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 && mvmvif->phy_ctxt->id < MAX_PHYS) - *global_bound = true; + *global_cnt += 1; } 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, struct iwl_mvm_scan_params *params) { - bool global_bound = false; + int global_cnt = 0; enum ieee80211_band band; u8 frag_passive_dwell = 0; ieee80211_iterate_active_interfaces_atomic(mvm->hw, IEEE80211_IFACE_ITER_NORMAL, iwl_mvm_scan_condition_iterator, - &global_bound); + &global_cnt); - if (!global_bound) + if (!global_cnt) goto not_bound; 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) { params->suspend_time = 105; 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 { params->suspend_time = 120; params->max_out_time = 120;