From nobody Tue Dec 03 22:48:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y2wmQ0Jcnz5gtKD; Tue, 03 Dec 2024 22:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y2wmP6jyRz53TC; Tue, 3 Dec 2024 22:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733266101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nt7TVL0N9vucWhih5SzaQQ/ma98pcBvU5/Gu/6ZefGg=; b=V1vLJpABzEaQoUmm6muhF8i4THIsBoLJrI+MD6i2jH6VnrRw2sgsC4oHtbNLeiPXdOpENp AT9AD4lu42VqQhs0rexDGe4AtaEXH04KN3V+xS7LvJyzNYoJFRGqnfdu33vueY82uuIM+K xGg+GFS/g6n77+gy3EcnlBYH+mYJhujta0fQ5ppXQcWs8F72BrUydhOZS8EZehoJhbW64U yv9Fn02liyyueubI8JXzAzWHkedrOfvWjJMrudOetGT9pghnR5dYEFGf9aBzSZNg5Qq59Y u5Capjz/26vsHMlBMR5OGF0/cZ+mIP3LJKgQSAS651Xj+oBRhU8f3mkHDUsB7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733266101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nt7TVL0N9vucWhih5SzaQQ/ma98pcBvU5/Gu/6ZefGg=; b=FsAnGH5T7fm+/Ku2D3Pj0MbWdMSzYsSioTpQSR/T+Dw1fag49qJSfINKq5vCuv2WVcY/65 JqDBZI/g1pwHPpzrHuaSg2ht4T+wq4InfE5DyqGhLc/QYTZ8mI7NUaQivkIJQih3r7qx4R hySz95nD7RANSHWxY0MXVxwJ6wktoKIfN8v0merQZiWkVAOMawYO1skTlVsVvcYl7QgwCw U2/ddJYBV2lb1HaS5ZFgRT6TyCV0zKpYy0Us/cxc+cLGSZZViqyR660mrooe+4HYEw9U/L fweHwO/34VwMKe4w8HGavJZUA4UYUqEfQGdDzVZn3JTjlx8G64iEeKnwZZIT6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733266101; a=rsa-sha256; cv=none; b=Fqku3E7iMXqXexHjlLUBWcqzcBSeEPQKo39gnZh2Fc7oq3ojaZbKOW2ix3MXdJ8/6dzNAg aEa8NgDnZ18KsZX6t82Wc1Jw0GPlHOLuNcE/ggfJPWUX2bW1/ZVEj9FKYT/3+wcwt3gy5W vCmhJvKlZMvhvzOrDnbCPzZWdpHnSZDDcHwL9vL5tyDShXhu28Kin8swOnKPh47ZSQIBdd KKeUoet5mLT3HlznV1aJG1pK3kMdJJnHSuamLzFSnPHOrSBdui5QBfNALNCp2HNN5PIVAz PmqsMMdmrlaVlzOr9AGPzB2Dgkn7eaia2s+CZDHcdqeccPoMdXWPyzEJGCRqRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y2wmP5kSrzhg1; Tue, 3 Dec 2024 22:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B3MmLFD059888; Tue, 3 Dec 2024 22:48:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B3MmLLv059885; Tue, 3 Dec 2024 22:48:21 GMT (envelope-from git) Date: Tue, 3 Dec 2024 22:48:21 GMT Message-Id: <202412032248.4B3MmLLv059885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 6749f059a586 - main - rtwn: use ieee80211_ht_check_tx_shortgi_20() and ieee80211_ht_check_tx_shortgi_40() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6749f059a586ff62f2909134c4f4599c82fabc5e Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=6749f059a586ff62f2909134c4f4599c82fabc5e commit 6749f059a586ff62f2909134c4f4599c82fabc5e Author: Adrian Chadd AuthorDate: 2024-11-25 23:20:42 +0000 Commit: Adrian Chadd CommitDate: 2024-12-03 22:46:46 +0000 rtwn: use ieee80211_ht_check_tx_shortgi_20() and ieee80211_ht_check_tx_shortgi_40() Use the new net80211 routines rather than rolling our own. (The first version of this diff landed a previous version of what was reviewed, so this brings it up to what was finally accepted in the review.) Differential Revision: https://reviews.freebsd.org/D47751 Reviewed by: bz --- sys/dev/rtwn/rtl8192c/r92c_tx.c | 20 ++++++++++++++------ sys/dev/rtwn/rtl8812a/r12a_tx.c | 20 ++++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c index 5c8b2e114727..b8c26d861a14 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_tx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c @@ -172,12 +172,20 @@ r92c_tx_set_sgi(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni) { struct r92c_tx_desc *txd = (struct r92c_tx_desc *)buf; - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan) - && ieee80211_ht_check_tx_shortgi_40(ni)) - txd->txdw5 |= htole32(R92C_TXDW5_SGI); - else if (IEEE80211_IS_CHAN_HT20(ni->ni_chan) - && ieee80211_ht_check_tx_shortgi_20(ni)) - txd->txdw5 |= htole32(R92C_TXDW5_SGI); + /* + * Only enable short-GI if we're transmitting in that + * width to that node. + * + * Specifically, do not enable shortgi for 20MHz if + * we're attempting to transmit at 40MHz. + */ + if (ieee80211_ht_check_tx_ht40(ni)) { + if (ieee80211_ht_check_tx_shortgi_40(ni)) + txd->txdw5 |= htole32(R92C_TXDW5_SGI); + } else if (ieee80211_ht_check_tx_ht(ni)) { + if (ieee80211_ht_check_tx_shortgi_20(ni)) + txd->txdw5 |= htole32(R92C_TXDW5_SGI); + } } void diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c index 7a8a7d3679b1..8cee2a16fbd5 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_tx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c @@ -202,12 +202,20 @@ r12a_tx_set_sgi(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni) /* TODO: VHT 20/40/80 checks */ - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan) - && ieee80211_ht_check_tx_shortgi_40(ni)) - txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT); - else if (IEEE80211_IS_CHAN_HT20(ni->ni_chan) - && ieee80211_ht_check_tx_shortgi_20(ni)) - txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT); + /* + * Only enable short-GI if we're transmitting in that + * width to that node. + * + * Specifically, do not enable shortgi for 20MHz if + * we're attempting to transmit at 40MHz. + */ + if (ieee80211_ht_check_tx_ht40(ni)) { + if (ieee80211_ht_check_tx_shortgi_40(ni)) + txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT); + } else if (ieee80211_ht_check_tx_ht(ni)) { + if (ieee80211_ht_check_tx_shortgi_20(ni)) + txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT); + } } static void