Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2657385pxa; Mon, 17 Aug 2020 15:43:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz2oGwdfi0OB9/+m+F7PeZ9hF2sqoDDFPDAoZedN9W7PGH1QppVI0luy1osvncQ51t+ryP X-Received: by 2002:a17:906:7108:: with SMTP id x8mr17247455ejj.447.1597704205558; Mon, 17 Aug 2020 15:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704205; cv=none; d=google.com; s=arc-20160816; b=X7o9zoBRocX/3m5ugZZLd2LHYfDdCtMsi94EykTX1zC0eQlOaGPjH3LXI0X3YjggMw iTZjSwb7OqLjOa7TsXIybYLbIFDIy/FRKPmX+6wVVMMuJlXcZX96neARvonKnGBvmcsX X9CYvS22Hrh9C6t++odV4FM57qX0TA/5Fh5fDYpMvTX8yHdkocR/cCRK3yIr4wTYXJd9 SfXWE7l9XwP4aULPK8veuIh7ofFCMV/sYtE/bnSEei8GFesQkhO95NFhDhM5IA4pb6aQ nIzRuMdJTJOPgsMypla2k5E6sT6hc5C/i/qGbqTMweVX8uRkKTVrjdigI6lPK1dYjA4f Jkzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9sCX0b8unM564hbfp/mhRkHdsYYnJ01bcFo4K/t9Tt8=; b=t6wW6D8T0HQ3s4v8qiDQD2PFJjFZz69nIUwH0K8dJnR2zx4o7TAVK1/dlJzaJ3WEOV nQps6gqz7m63+8H+vp3NClajOAnSYrYYl8ljwdjDRIS0+3yMav0nMb9nUor2uBaWXKtM dQm3etofm7t5YxdDWE5Kyc/fqE1BpnV6Z1rvb5NvIsC2BH17JnD+Jeo4d7O2Gl7tbCGK 6DkGxWRKgaCl2wYHfHxRTD/AQuD4vZo/NXGf5FtlQ0W0Qo4LOdyK8pm12rwFTau7WdMh cwqCPmvd/7xMlDbK83JAFIwUdRL7tLAYWo6XUDw9BPIPNhQs8zT9XOOwpFbjMWTwOnpd IdhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Cy8Ctmfu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si13407002ejj.168.2020.08.17.15.43.02; Mon, 17 Aug 2020 15:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Cy8Ctmfu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391680AbgHQStR (ORCPT + 99 others); Mon, 17 Aug 2020 14:49:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387989AbgHQPyc (ORCPT ); Mon, 17 Aug 2020 11:54:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 050C52072E; Mon, 17 Aug 2020 15:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679671; bh=fh3jWp5XO68vRG+wNMkxh5Ih2pnjQBAY0X+73kiWaj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cy8Ctmfu7gOid+H0v+EvYYRq6YOoN44TBGVljIzIK08VmeFsryh+yB6BcYaQqgS/J Ylii4erI3YU8DCiUM8mEYypjCQ7OC+TW1Xl4VMOcqUYvC+dTRVvcefFgJ39K7FaUey BXFMJjWfOAzTtH1KJfc/NIqa9YgiiegPFbkmtrbk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tsang-Shian Lin , Yan-Hsuan Chuang , Kalle Valo , Sasha Levin Subject: [PATCH 5.7 287/393] rtw88: fix short GI capability based on current bandwidth Date: Mon, 17 Aug 2020 17:15:37 +0200 Message-Id: <20200817143833.544231071@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tsang-Shian Lin [ Upstream commit 4dd86b901d1373ef8446ecb50a7ca009f3475211 ] Fix the transmission is not sent with short GI under some conditions even if the receiver supports short GI. If VHT capability IE exists in the beacon, the original code uses the short GI for 80M field as driver's short GI setting for transmission, even the current bandwidth is not 80MHz. Short GI supported fields for 20M/40M are informed in HT capability information element, and short GI supported field for 80M is informed in VHT capability information element. These three fields may be set to different values. Driver needs to record each short GI support field for each bandwidth, and send correct info depends on current bandwidth to the WiFi firmware. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Tsang-Shian Lin Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200717064937.27966-3-yhchuang@realtek.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw88/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index 7640e97706f52..72fe026e8a3c9 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -703,8 +703,6 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si) stbc_en = VHT_STBC_EN; if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC) ldpc_en = VHT_LDPC_EN; - if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) - is_support_sgi = true; } else if (sta->ht_cap.ht_supported) { ra_mask |= (sta->ht_cap.mcs.rx_mask[1] << 20) | (sta->ht_cap.mcs.rx_mask[0] << 12); @@ -712,9 +710,6 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si) stbc_en = HT_STBC_EN; if (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING) ldpc_en = HT_LDPC_EN; - if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20 || - sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) - is_support_sgi = true; } if (efuse->hw_cap.nss == 1) @@ -756,12 +751,18 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si) switch (sta->bandwidth) { case IEEE80211_STA_RX_BW_80: bw_mode = RTW_CHANNEL_WIDTH_80; + is_support_sgi = sta->vht_cap.vht_supported && + (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80); break; case IEEE80211_STA_RX_BW_40: bw_mode = RTW_CHANNEL_WIDTH_40; + is_support_sgi = sta->ht_cap.ht_supported && + (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40); break; default: bw_mode = RTW_CHANNEL_WIDTH_20; + is_support_sgi = sta->ht_cap.ht_supported && + (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20); break; } -- 2.25.1