Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4453693pxb; Sun, 14 Feb 2021 10:51:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzd5CD5iulZqpDpp2Je7lQZQBRm+80G+Va9qx3ysVKQHXzxgoXTy5p/luqkyUq4PTPcz1j1 X-Received: by 2002:a17:906:d189:: with SMTP id c9mr12804948ejz.36.1613328698958; Sun, 14 Feb 2021 10:51:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613328698; cv=none; d=google.com; s=arc-20160816; b=u23GTL9pGxC815AKVug/kFrw48Qmk5UkGLxfVA2veVA11Y/WABDHw6PSr8sORvvgX4 gKDoYtT+hYEjANyZYRvIkWyJPJ7W12nJlwOooP8sfyXxXE884O7PBCSCnJ2TYsXVV9kd t7GXAhseVRiQQ0HWJCe+s/KG5uBnlv25eeZkNQ9J9VXd2lW+i2kxlbOjtGvq2y3KuyrU /UdW8vrvASCSKO0hiyNBAy0zaMJauOQW7CtrhtzGj8l39nUH6a022CMI7XfyonSePeyd RRkCpqJIhhgnsTp57JwbQaH7x2/poN+y6YOunWtxVr0N4kjv/oEFh6ovQBQouMcDBHDB WJ7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=q+cg1oObXGpi/3y0MDcBEnirsfQ+3Z1hURC29KRqHag=; b=HWN7+mjGlNtqpIXlqtUCxLJr1GIBW6NVfiI6gM2Fr+zB5hU5WdSIQL2xpZxz2V32Kj 4y32juvdM0/ZW44ltVHSu/YWiCtc1eraVaT7xMYfF5d0NXyF9HmW/7Fteh1TEH7smStf GmE38zylE7bU+RuauPQT21CBVn7QLOTIWSVd5rdelCAY/0nmCQn+4GHYdI9ty8B6mpJw OlugkkusZyvVXzr3Kn57/Fej61W9JF/ky35LMTxoIYqI3wxVqVoKLYcXmhw7EvAHcqHM aFrghauH/e6KBHxoOODriWRHOWl/xY63qYTrL1OUWG2vROwAt/dQCdaN3rbQ70Jb/nfB Oaqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=sztb+xsM; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si11025000edk.452.2021.02.14.10.51.07; Sun, 14 Feb 2021 10:51:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=sztb+xsM; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbhBNSuC (ORCPT + 99 others); Sun, 14 Feb 2021 13:50:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbhBNSt7 (ORCPT ); Sun, 14 Feb 2021 13:49:59 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02732C061574 for ; Sun, 14 Feb 2021 10:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=q+cg1oObXGpi/3y0MDcBEnirsfQ+3Z1hURC29KRqHag=; b=sztb+xsMylgaRKicwUUDDHoA6v ZUW5pD790dBYHqJset2nNYmnYrX3GfT5oINaCxFHE/Bt16x7LjoIvrxtEQBYKDQyXeJ0kzU0RnSAx OExlNwVAtybkzbfdFGUXqlCmbZE1qtrWw9X1YKq+yZeZdleHjVohXOiYYb9ki86sNLxU=; Received: from p4ff13c8d.dip0.t-ipconnect.de ([79.241.60.141] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1lBMSJ-00080x-Dx; Sun, 14 Feb 2021 19:49:15 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: kvalo@codeaurora.org, hurricos@gmail.com Subject: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode Date: Sun, 14 Feb 2021 19:49:11 +0100 Message-Id: <20210214184911.96702-1-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When transmitting to a receiver in dynamic SMPS mode, all transmissions that use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to give the receiver's extra chains some time to wake up. This fixes the tx rate getting stuck at <= MCS7 for some clients, especially Intel ones, which make aggressive use of SMPS. Cc: stable@vger.kernel.org Reported-by: Martin Kennedy Signed-off-by: Felix Fietkau --- drivers/net/wireless/ath/ath9k/ath9k.h | 3 ++- drivers/net/wireless/ath/ath9k/xmit.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 13b4f5f50f8a..ef6f5ea06c1f 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -177,7 +177,8 @@ struct ath_frame_info { s8 txq; u8 keyix; u8 rtscts_rate; - u8 retries : 7; + u8 retries : 6; + u8 dyn_smps : 1; u8 baw_tracked : 1; u8 tx_power; enum ath9k_key_type keytype:2; diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index e60d4737fc6e..5691bd6eb82c 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -1271,6 +1271,11 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, is_40, is_sgi, is_sp); if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC)) info->rates[i].RateFlags |= ATH9K_RATESERIES_STBC; + if (rix >= 8 && fi->dyn_smps) { + info->rates[i].RateFlags |= + ATH9K_RATESERIES_RTS_CTS; + info->flags |= ATH9K_TXDESC_CTSENA; + } info->txpower[i] = ath_get_rate_txpower(sc, bf, rix, is_40, false); @@ -2114,6 +2119,7 @@ static void setup_frame_info(struct ieee80211_hw *hw, fi->keyix = an->ps_key; else fi->keyix = ATH9K_TXKEYIX_INVALID; + fi->dyn_smps = sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC; fi->keytype = keytype; fi->framelen = framelen; fi->tx_power = txpower; -- 2.28.0