Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1765200ybh; Thu, 16 Jul 2020 23:53:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3L+jiICil3L4oQOpgdBfXgQNpbB4RAC/WshWeThpVxQ7zq/k7KYrZjaIfHDftT85SFZwS X-Received: by 2002:a17:906:4dd4:: with SMTP id f20mr7711317ejw.170.1594968821052; Thu, 16 Jul 2020 23:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594968821; cv=none; d=google.com; s=arc-20160816; b=l9K1NDCVgCUnzJOSaITxUy7cQ+zH9z90l28qFnS5+mwG5mXR+4x9o9O6gKRSRdyhqC AP1jpoubBSChWT857ql8T48p7qYaNWkI22+xYzsno+WXVIKaoAAi7j7/FY/RA8CNoFRq NwtLAwjn06pq9xW3Swio+uBHQlXfem4EnROB9PgQwlAtqZKp+6PoqSmsuaq0q9G18u8w s80rxfT3JTk2DeRYRDjOcCqY4D88p/RN3JpvByIEaprQ3IzdXdZ4deMfecGiQoAIkmA4 c0VQtvOhsW92hdrWViXWI/f/7OnghjLvw93SHKMbQTKzVqHDeRe6KcmQR4408N7Q/+o8 3O/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=/24JPb+e5Kx2snzJ/4Uwjydxp8sMl7eqkK24EuSSFow=; b=b5aNqQzUYUaKrChQ9b4gOwtTGGrMSfoaVtdGY8AjYw4zUhNABDZYBsF+NZRWQ3JrA/ XZ2VTgcpPck5m3OcjKx3GLEMUY/aRWNPto3NGoypA1/x6eo82ywGC+dP6XzDL605T++o W8L1i6mgGk+HHs9aSsEturnlCTgWcOhz2arZNKt5JdiKAraFuWblDEda2JUWXaRh8HKW n6NY/nqFaSBTONGFRQHYrPa+guE/+4K6e70Ipq0F1WlltccWYkJJQBmWacTr6+zlixKs hz48pLpmprHRe4OUPlwEYv+z8aaM2oWLb/v8acA6hlYEJlYSolQGY1Z+BV89DXBKT/P2 ca7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 f21si4469501ejr.172.2020.07.16.23.53.17; Thu, 16 Jul 2020 23:53:41 -0700 (PDT) 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; 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 S1726970AbgGQGuG (ORCPT + 99 others); Fri, 17 Jul 2020 02:50:06 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:55017 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbgGQGuF (ORCPT ); Fri, 17 Jul 2020 02:50:05 -0400 Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.69 with qID 06H6o0Mu9028960, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexmb06.realtek.com.tw[172.21.6.99]) by rtits2.realtek.com.tw (8.15.2/2.66/5.86) with ESMTPS id 06H6o0Mu9028960 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 17 Jul 2020 14:50:00 +0800 Received: from RTEXMB04.realtek.com.tw (172.21.6.97) by RTEXMB06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Fri, 17 Jul 2020 14:49:59 +0800 Received: from localhost.localdomain (172.21.68.128) by RTEXMB04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Fri, 17 Jul 2020 14:49:59 +0800 From: To: CC: Subject: [PATCH 2/7] rtw88: fix short GI capability based on current bandwidth Date: Fri, 17 Jul 2020 14:49:32 +0800 Message-ID: <20200717064937.27966-3-yhchuang@realtek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200717064937.27966-1-yhchuang@realtek.com> References: <20200717064937.27966-1-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.128] X-ClientProxiedBy: RTEXMB02.realtek.com.tw (172.21.6.95) To RTEXMB04.realtek.com.tw (172.21.6.97) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Tsang-Shian Lin 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 --- 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 7304e8bc5e31..54044abf30d7 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -722,8 +722,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); @@ -731,9 +729,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) @@ -775,12 +770,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.17.1