From patchwork Fri Dec 12 11:41:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5481911 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D7939F507 for ; Fri, 12 Dec 2014 11:55:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FD172014A for ; Fri, 12 Dec 2014 11:55:05 +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 7CAFC20148 for ; Fri, 12 Dec 2014 11:55:04 +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 1XzOoG-0008I6-PR; Fri, 12 Dec 2014 11:55:00 +0000 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XzOoC-0008AK-8c for ath10k@lists.infradead.org; Fri, 12 Dec 2014 11:54:57 +0000 Received: by mail-wi0-f177.google.com with SMTP id l15so2261972wiw.16 for ; Fri, 12 Dec 2014 03:54:34 -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=JshokST1BxYBpgBsANYsYZQhizx47kg+fQ5yenmlqF8=; b=Ob15HQJPQGkYVUjXWdWucE3CXQGWuNU5dIhELsT9kygbAbN3ytk1zpeK5UJnJL7214 3iA6HiamOFH5yi4WRGQJ9LEY8RICvXD90ungE0NhkVDzz+iLO3tQ895cxUa+sZFQT0BR 0EX3w9P4YQKVY8mRju0vvodTk0oinlJlTZEbE= 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=JshokST1BxYBpgBsANYsYZQhizx47kg+fQ5yenmlqF8=; b=ZT+TIvzxFB06SsSL4SUpzK+GvCx8nMe4mnIvMsbnh/FcC1jGzeE+vjhHkF2XSHmuFH UvkZzlyavG4pgk7fB5A4Xjyoh1xmPkUVEJWvX0fupJia91AQYhMoz82j7cNJdGvfEOCa 4zkT1Q8M/mhWlmkzXglj/LPlaywvwlOjIXVBUO5wnyuY022UsWViXLX7BZMyTHRKiYpF 4dXeErzFBQ7lhaYePGQlU8ldzXsdMBzmwXt3A6e20SPe+hJ3GBIL1aF7b7A8RdK4ZlWN f156589JkAcRV/7qVavnJmyTLvB7r6BPklPwxXrhLY0ctMvVr0E11IRKOPmzVFkfpQQl HFcA== X-Gm-Message-State: ALoCoQnL5napgmPsg4/IwoJ2jOD8Sn5pqaYAP9jIueeFNveb+noC1layiME5Roy1CzMVKKr9PpCEGvccUJi1oUTFjNrEXbnsODrAgK02Z1tAGJtBK6yki+vHQJlzz/v+n0rukdVDWNH9a8fAK4LC/6KEAlOa28J+ku6tVsV1JQCZK9j9YlaQw5E= X-Received: by 10.180.198.145 with SMTP id jc17mr6899981wic.67.1418385273207; Fri, 12 Dec 2014 03:54:33 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id pf4sm1516796wjb.36.2014.12.12.03.54.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Dec 2014 03:54:32 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH v2 4/5] ath10k: enable per-vif sta powersave Date: Fri, 12 Dec 2014 12:41:38 +0100 Message-Id: <1418384499-31660-5-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1418384499-31660-1-git-send-email-michal.kazior@tieto.com> References: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com> <1418384499-31660-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-20141212_035456_490572_08444945 X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. 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=ham 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 Per-vif bss_conf.ps should be used to configure powersave. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 2804952..19ddbc6 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1099,9 +1099,6 @@ static int ath10k_mac_vif_recalc_ps_poll_count(struct ath10k_vif *arvif) return 0; } -/* - * Review this when mac80211 gains per-interface powersave support. - */ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) { struct ath10k *ar = arvif->ar; @@ -1117,7 +1114,7 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) if (arvif->vif->type != NL80211_IFTYPE_STATION) return 0; - if (conf->flags & IEEE80211_CONF_PS) { + if (vif->bss_conf.ps) { psmode = WMI_STA_PS_MODE_ENABLED; param = WMI_STA_PS_PARAM_INACTIVITY_TIME; @@ -3378,6 +3375,13 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, ath10k_warn(ar, "failed to recalc tx power: %d\n", ret); } + if (changed & BSS_CHANGED_PS) { + ret = ath10k_mac_vif_setup_ps(arvif); + if (ret) + ath10k_warn(ar, "failed to setup ps on vdev %i: %d\n", + arvif->vdev_id, ret); + } + mutex_unlock(&ar->conf_mutex); }