From nobody Thu Jan 09 00:59:12 2025 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 4YT5ym3p5mz5kLmp; Thu, 09 Jan 2025 00:59:12 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YT5ym3Mhdz4yXv; Thu, 9 Jan 2025 00:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384352; 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=kqE9iWMEVSp9A/oq7TUL6OHVKlIYYsZKTTYq/Xc7hjk=; b=pdbtAOvcEn/ZuyccgXx4ICb+E/M+6ea7Em7+YqKBo5IKJh7tYzAvSoYUTnCJMtEEksvD9D 5bQ77W0poAUuP3pFtMRKjdv/7V2+MsVXnDSyhcsdn/6FTeE9cXG5Ebn0YQ5R7aJd6X9cSW s3FiUt7MnDwmSXwRHSjw7+8l0XwquwpesbRNMpJhbTGh1uG/7TiRjbUWbAWSID1sI1BrdW pBtCrxiyZTyPHCnMfbP1eFQNThuCHKbu6y60H09ER4lLEuC9vDCDp6mZq5fB8aKBcMRQHQ 8xs8OhDJ5C5V5zcBPiXrwwqysFfq3SURtV80OZWh9ti6xWz3uPjUSptnNkr3bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384352; 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=kqE9iWMEVSp9A/oq7TUL6OHVKlIYYsZKTTYq/Xc7hjk=; b=qtT12A76S4tgVgkosOkZ1cTzVJUIywP4iynSRPoRgQiq1aWMGalbun2v4Zugb26zR/B8MG gLu1Ajq0Sbf+qALau7ub0E0AdGFMI+4A6w8OgPe4RVEjhgh4cPPQ0DTZHM/piyD2r3Z4sv 6GLLhCZiv8LJi+Do209SFepTeG97EJ+flAMyj1+TaJamCLuONYYaNQxMDZU49xn94bqOYu LygtdTmtAFjnt65kR+ifKR40GdxG+VIl8t1TV0bcUs/TypS0+pgfYCq3EIzVmTMMC4+jJU j4B8CLyda0oeZOfenwTFtAAyofBPhvOpqI4mnDf6a1lE031CoCmh1n9xMmFzTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736384352; a=rsa-sha256; cv=none; b=pS/u/0VkIlZ58ArnymcFWOrROhPvo5OZoUhRSlOaq9czApUT5VRe/iNy+Y/HPnFSinaxr6 fmJZrnRF92hi2YcLdjqcIG2rB4XigHlz11JZkqFo5Cy6nF7HNPEHa/xxJVP6EyPotJpO1z +wM91H4RotRDvhgj2VzzVSIWWMDzDSfXCmahnwRy1SVet7WTHVwl/NAfDtxOFBWR3zN/az UFR/+ETGSU+DW3X5gbsBXe8FfcM6xG1U7+MkOkUH12TjPgwi4oyPJKCxiKFTaCCtmBJn+o 6b+kAYwTvUWMGNzy382awoQpCSmd352A0uvewtoDT7OaYI0c63aRPuDefrzIrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YT5ym2McBz1JHv; Thu, 09 Jan 2025 00:59:12 +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 5090xCpo075452; Thu, 9 Jan 2025 00:59:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5090xCxD075449; Thu, 9 Jan 2025 00:59:12 GMT (envelope-from git) Date: Thu, 9 Jan 2025 00:59:12 GMT Message-Id: <202501090059.5090xCxD075449@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: 82182587bcc3 - main - rtwn: add VHT20/VHT40/VHT80 bandwidth configuration for transmit. 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: 82182587bcc3adf39d6b3b6347f052865c3a34e2 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=82182587bcc3adf39d6b3b6347f052865c3a34e2 commit 82182587bcc3adf39d6b3b6347f052865c3a34e2 Author: Adrian Chadd AuthorDate: 2024-12-16 02:35:28 +0000 Commit: Adrian Chadd CommitDate: 2025-01-09 00:52:00 +0000 rtwn: add VHT20/VHT40/VHT80 bandwidth configuration for transmit. Add a separate function and path for VHT 20/40/80MHz bandwidth transmission. Differential Revision: https://reviews.freebsd.org/D48102 --- sys/dev/rtwn/rtl8812a/r12a_tx.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c index 336ad75a0b1f..acb238316559 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_tx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c @@ -47,6 +47,7 @@ #include #include +#include #include #include @@ -87,12 +88,42 @@ r12a_get_primary_channel(struct rtwn_softc *sc, struct ieee80211_channel *c) return (0); } +/* + * Configure VHT20/VHT40/VHT80 as appropriate. + * + * This is only called for VHT, not for HT. + */ +static void +r12a_tx_set_vht_bw(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni) +{ + struct r12a_tx_desc *txd = (struct r12a_tx_desc *)buf; + int prim_chan; + + prim_chan = r12a_get_primary_channel(sc, ni->ni_chan); + + if (ieee80211_vht_check_tx_bw(ni, IEEE80211_STA_RX_BW_80)) { + txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_BW, + R12A_TXDW5_DATA_BW80)); + txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_PRIM_CHAN, + prim_chan)); + } else if (ieee80211_vht_check_tx_bw(ni, IEEE80211_STA_RX_BW_40)) { + txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_BW, + R12A_TXDW5_DATA_BW40)); + txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_PRIM_CHAN, + prim_chan)); + } +} + +/* + * Configure HT20/HT40 as appropriate. + * + * This is only called for HT, not for VHT. + */ static void r12a_tx_set_ht40(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni) { struct r12a_tx_desc *txd = (struct r12a_tx_desc *)buf; - /* XXX VHT80; VHT40; VHT20 */ if (ieee80211_ht_check_tx_ht40(ni)) { int prim_chan; @@ -353,8 +384,12 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT); prot = IEEE80211_PROT_NONE; - /* TODO: VHT */ - if (RTWN_RATE_IS_HT(ridx)) { + if (RTWN_RATE_IS_VHT(ridx)) { + r12a_tx_set_vht_bw(sc, txd, ni); + /* XXX TODO: sgi */ + /* XXX TODO: ldpc */ + prot = ic->ic_htprotmode; + } else if (RTWN_RATE_IS_HT(ridx)) { r12a_tx_set_ht40(sc, txd, ni); r12a_tx_set_sgi(sc, txd, ni); r12a_tx_set_ldpc(sc, txd, ni);