From patchwork Tue Jan 20 10:24:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5667231 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 703559F333 for ; Tue, 20 Jan 2015 10:26:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3A65203AF for ; Tue, 20 Jan 2015 10:26:12 +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 D7D3720254 for ; Tue, 20 Jan 2015 10:26:11 +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 1YDW0e-0006TK-FU; Tue, 20 Jan 2015 10:26:08 +0000 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YDW0V-0006Hk-AY for ath10k@lists.infradead.org; Tue, 20 Jan 2015 10:26:00 +0000 Received: by mail-wg0-f47.google.com with SMTP id n12so6261255wgh.6 for ; Tue, 20 Jan 2015 02:25:37 -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=lw2ZeV+rslyEvdIZYrEB4vmkddsTTxS5buzURRJV3+E=; b=MW0z65qhFRG8UDV1JS8QlpRfVr9dBeZBXtr3OAwFCwgv0mffpL3OPYJDK7I7KvW4eD PbUr8jHl2Zt49l1TsHCoIq0JIxuMfwcssLdk1ijTxDTUbcGuzGiB67xGmQLYhvEKujcR +baMEC7SPhhuFUDEbuarcVruayNEkSJTlm29c= 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=lw2ZeV+rslyEvdIZYrEB4vmkddsTTxS5buzURRJV3+E=; b=TLIc+kzHKcRLekKRc8+AF64XvcA1fFgpfGcDhXbROfHxheyiFbiHZBytVDDjRSJviL nb6D7dcJbtOs/IjrghxPW/eF27MvyFYCdE8BmfYWIdwhR2Pzz5w2e1cW168gWhCeYwq4 z5YaICdu54+N9jZs8TfsCFMfFnWr7nPqLy8+oTpzUw7P9gv/7zwymwjVo1EHF7Z62jGl ynzP99mBrP94/YndGYMNqJoAAI8lB8dm36bM7HJQx8ooidasn5jAz0gAJ3kPYIYrTANh qK4fwHt+Ragrzn6ov2Gx0YN1sYgfEJSqdKwydI5hURuzHxae8BrK0y3s0w4Xwz+hzkJ9 Io2w== X-Gm-Message-State: ALoCoQnKrpKq+G6UG/wpbQZc9xUnsr94Jc3eLIsuf4Dg0v3SmpGymZ8xZOPHxz2zE6XszJ9RBfTg2c0RFySs/Ui79Pcwwz0RDvoQNbCGOkpkDOqvzmm4mPkS1NURKtWKB94Sst4vt8w8tGbR+qA0xiOc+rvSVHjzR3hPA0mUuERkkAUI999GC78= X-Received: by 10.194.60.70 with SMTP id f6mr71162510wjr.109.1421749537167; Tue, 20 Jan 2015 02:25:37 -0800 (PST) Received: from bob.homerouter.cpe (apn-46-76-65-212.dynamic.gprs.plus.pl. [46.76.65.212]) by mx.google.com with ESMTPSA id c10sm20681846wjy.4.2015.01.20.02.25.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jan 2015 02:25:36 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 2/2] ath10k: disable uapsd autotrigger Date: Tue, 20 Jan 2015 11:24:57 +0100 Message-Id: <1421749497-10553-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1421749497-10553-1-git-send-email-michal.kazior@tieto.com> References: <1421749497-10553-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-20150120_022559_556415_9C05B495 X-CRM114-Status: GOOD ( 10.19 ) X-Spam-Score: -0.8 (/) Cc: Janusz Dziedzic , 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 Only userspace can make an educated decision when a trigger frame is required so make sure the autotrigger service is disabled. Signed-off-by: Janusz Dziedzic Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 9524bc5..08e61cb 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3987,6 +3987,8 @@ static int ath10k_conf_tx_uapsd(struct ath10k *ar, struct ieee80211_vif *vif, u16 ac, bool enable) { struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); + struct wmi_sta_uapsd_auto_trig_arg arg = {}; + u32 prio = 0, acc = 0; u32 value = 0; int ret = 0; @@ -3999,18 +4001,26 @@ static int ath10k_conf_tx_uapsd(struct ath10k *ar, struct ieee80211_vif *vif, case IEEE80211_AC_VO: value = WMI_STA_PS_UAPSD_AC3_DELIVERY_EN | WMI_STA_PS_UAPSD_AC3_TRIGGER_EN; + prio = 7; + acc = 3; break; case IEEE80211_AC_VI: value = WMI_STA_PS_UAPSD_AC2_DELIVERY_EN | WMI_STA_PS_UAPSD_AC2_TRIGGER_EN; + prio = 5; + acc = 2; break; case IEEE80211_AC_BE: value = WMI_STA_PS_UAPSD_AC1_DELIVERY_EN | WMI_STA_PS_UAPSD_AC1_TRIGGER_EN; + prio = 2; + acc = 1; break; case IEEE80211_AC_BK: value = WMI_STA_PS_UAPSD_AC0_DELIVERY_EN | WMI_STA_PS_UAPSD_AC0_TRIGGER_EN; + prio = 0; + acc = 0; break; } @@ -4052,6 +4062,29 @@ static int ath10k_conf_tx_uapsd(struct ath10k *ar, struct ieee80211_vif *vif, return ret; } + if (test_bit(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, ar->wmi.svc_map) || + test_bit(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, ar->wmi.svc_map)) { + /* Only userspace can make an educated decision when to send + * trigger frame. The following effectively disables u-UAPSD + * autotrigger in firmware (which is enabled by default + * provided the autotrigger service is available). + */ + + arg.wmm_ac = acc; + arg.user_priority = prio; + arg.service_interval = 0; + arg.suspend_interval = WMI_STA_UAPSD_MAX_INTERVAL_MSEC; + arg.delay_interval = WMI_STA_UAPSD_MAX_INTERVAL_MSEC; + + ret = ath10k_wmi_vdev_sta_uapsd(ar, arvif->vdev_id, + arvif->bssid, &arg, 1); + if (ret) { + ath10k_warn(ar, "failed to set uapsd auto trigger %d\n", + ret); + return ret; + } + } + exit: return ret; }