From patchwork Fri Feb 13 12:30:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5824971 Return-Path: X-Original-To: patchwork-ath10k@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 9D3F2BF440 for ; Fri, 13 Feb 2015 12:32:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C82EF20263 for ; Fri, 13 Feb 2015 12:32:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A004820265 for ; Fri, 13 Feb 2015 12:32:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YMFPa-0008F7-Dn; Fri, 13 Feb 2015 12:31:58 +0000 Received: from mail-la0-f48.google.com ([209.85.215.48]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YMFPX-0008B6-SJ for ath10k@lists.infradead.org; Fri, 13 Feb 2015 12:31:57 +0000 Received: by labgd6 with SMTP id gd6so16076431lab.7 for ; Fri, 13 Feb 2015 04:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b7AJ0oxEDO515SUg2g3tlDppDySgUrGvCulppgdtj4Y=; b=valtKDCZ+h4/1t3gw9z+IuQY8uGfdEAJd81JeSMmt018qs7U/+odsDBLBV8Spq0jDP pX1WUJ09r85PkaxnKL693DVJX3+ncrXpBPH2wLvDqZC3xmDnKJKn/O/ohyFaKVV7FPXv GGK/jVs3oO62X4ZoeQ93aXc7ohmKYbsPqvX8g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=b7AJ0oxEDO515SUg2g3tlDppDySgUrGvCulppgdtj4Y=; b=bfCbmC+G8FDWXoU5niGDzpQ3YrFGeYWMnND8YQenJLG5eUOVvVQCjgLLPvaqc1/jCt 0JXVIrUlFmGXAW1fhnvYZP2J978ZIXM+0mOaaHnrtxaBnHkfRqgyyuF/kCVuclazDqO7 6K8YU8yPO4bx2yNRmcEdoIhgKkD9EKUFVYPwIgUIgYx8mMPmkCC75GoOBSzWb7M5Eaoa bt728kptOSgPy4Lj0mXiFU6DcvTDRop8EKJnd6n8sReCUnNtrZ2p1zRPZgafZ1Yxd/jO aBdzS2g+bZf5p9o3LH2DdWMtLElsCxkuxbH7xTwiYSrdX40CTg6ZZrr9Yi9P0GIElc1s pbdA== X-Gm-Message-State: ALoCoQl8JXST0qtHPaWk527LpGQ/1WP/HTjAAmIVALmLPzKCFxdSr7MLnPyyERzRcqobpfYWYV6ZYNjevE+YaW+EGsRdCuTiloGMu2XztAqeEe9vrLsCODd2xvJ2Fs+AQg+MWwCyEOBKZ27C3+b7+hExRt3/+D4mhMu18TpBlLCN7q5UfZvEbOs= X-Received: by 10.152.87.84 with SMTP id v20mr7727019laz.81.1423830693190; Fri, 13 Feb 2015 04:31:33 -0800 (PST) Received: from bob.homerouter.cpe (apn-31-1-134-151.dynamic.gprs.plus.pl. [31.1.134.151]) by mx.google.com with ESMTPSA id s5sm1350872lag.9.2015.02.13.04.31.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 04:31:32 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 2/2] ath10k: disable multi-vif ps by default Date: Fri, 13 Feb 2015 13:30:16 +0100 Message-Id: <1423830616-7516-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1423830616-7516-1-git-send-email-michal.kazior@tieto.com> References: <1423830616-7516-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150213_043156_114565_92E6CF8B X-CRM114-Status: GOOD ( 12.83 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 Not all firmware revisions have a proper multi-interface client powersaving implementation, e.g. qca6174 WLAN.RM.2.0-00073. Signed-off-by: Michal Kazior --- @Kalle: 999.999.0.636 seems to work okay with multi-vif PS so you might want to bump it with the MULTI_VIF_PS_SUPPORT feature flag set. drivers/net/wireless/ath/ath10k/core.h | 7 +++++++ drivers/net/wireless/ath/ath10k/mac.c | 31 +++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index d60e46f..c900ef2 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -288,6 +288,7 @@ struct ath10k_vif { bool is_started; bool is_up; bool spectral_enabled; + bool ps; u32 aid; u8 bssid[ETH_ALEN]; @@ -413,6 +414,12 @@ enum ath10k_fw_features { */ ATH10K_FW_FEATURE_WMI_10_2 = 4, + /* Some firmware revisions lack proper multi-interface client powersave + * implementation. Enabling PS could result in connection drops, + * traffic stalls, etc. + */ + ATH10K_FW_FEATURE_MULTI_VIF_PS_SUPPORT = 5, + /* keep last */ ATH10K_FW_FEATURE_COUNT, }; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 8ed0ba6..bab8adc 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1253,6 +1253,20 @@ static int ath10k_mac_vif_recalc_ps_poll_count(struct ath10k_vif *arvif) return 0; } +static int ath10k_mac_ps_vif_count(struct ath10k *ar) +{ + struct ath10k_vif *arvif; + int num = 0; + + lockdep_assert_held(&ar->conf_mutex); + + list_for_each_entry(arvif, &ar->arvifs, list) + if (arvif->ps) + num++; + + return num; +} + static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) { struct ath10k *ar = arvif->ar; @@ -1262,13 +1276,24 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) enum wmi_sta_ps_mode psmode; int ret; int ps_timeout; + bool enable_ps; lockdep_assert_held(&arvif->ar->conf_mutex); if (arvif->vif->type != NL80211_IFTYPE_STATION) return 0; - if (vif->bss_conf.ps) { + enable_ps = arvif->ps; + + if (enable_ps && ath10k_mac_ps_vif_count(ar) > 1 && + !test_bit(ATH10K_FW_FEATURE_MULTI_VIF_PS_SUPPORT, + ar->fw_features)) { + ath10k_warn(ar, "refusing to enable ps on vdev %i: not supported by fw\n", + arvif->vdev_id); + enable_ps = false; + } + + if (enable_ps) { psmode = WMI_STA_PS_MODE_ENABLED; param = WMI_STA_PS_PARAM_INACTIVITY_TIME; @@ -3546,7 +3571,9 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, } if (changed & BSS_CHANGED_PS) { - ret = ath10k_mac_vif_setup_ps(arvif); + arvif->ps = vif->bss_conf.ps; + + ret = ath10k_config_ps(ar); if (ret) ath10k_warn(ar, "failed to setup ps on vdev %i: %d\n", arvif->vdev_id, ret);