From nobody Sun Jan 05 17:22:14 2025 X-Original-To: dev-commits-src-all@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 4YR3yt4cwkz5k0SJ; Sun, 05 Jan 2025 17:22:14 +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 4YR3yt2TFGz4CbY; Sun, 5 Jan 2025 17:22:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736097734; 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=2X2FZsZ2S2NCzq6yuvzM4bCiPMeb64vbhXxO1LiwBlU=; b=NuqbJjH4VBMIG6D71MQdnfpJkHfxYNQuUCPwOFzxnJYFcgBOA9U9/aFzwRRgHub7qideyQ vwyTZu8NvGmTkkqh7izCVDrcryRCmeyVJj1rgdjcWEm7MpA7pLE+X6B0zEaJxyc1nzKMSI EzQjWkYIo9bBabEPb4WlUFCLEkghUEHwCnfjvX29JrgB47QloeyxCNsSPPKzurqzyem5FU ZZJVMCav7GI7gStUAN/gZzfuuPNA4pcnPpsH8vcZ3s1CVsqN1jWk0M0mCQW7TTxF8VcVyL Sme+fth+UxpMoYEgXbLyQ44gpd8X43J9Cgx1gqpEr+taMfsQ2HHPOycIBAOzJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736097734; 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=2X2FZsZ2S2NCzq6yuvzM4bCiPMeb64vbhXxO1LiwBlU=; b=QDUdQd7R9GlwPBqNrb0d6ZTPeSZ0k0CCFVEgv7x8184Kg35JjpzVUCrEgDelROJ9MsoT/O kTSLLudeiLvgxXTr8GimoVG3OOYCxXlvLIASodiSS1sPywkGmlJiVfDPvDEyJ5NMlV6jCF VNnCnUdGKop9XrB4tjvgV5MbSoKjKClnb4TjyimlI/qCthpLfpTYuvKJKieKlnHv62UO5x uPcncZVa3BTR2872hA36upDh8YkG4l/YO0VxP/Apvmu4Ljc4MLT3egya+TIvr+CkpCqHgd aVPRa7dg4RqoTGgVPME8hBGZXfsr6Q0LM89iVzQhwebBDnqlDmlk83OA3rOaZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736097734; a=rsa-sha256; cv=none; b=NT1DbWrCrBRsl4S+6k9yllED7S18JzcDbtdfNhUrf017WbZ6UGEiXbRZtQSUm4s1EJ5OkV zJ1qt+G+5v1osY5Ot6PPvb7vxFoTHyXGrbPF2/QTHVpaThqwB9XSTU0jXRwZv2DsmDMmiz 14wOfUUHQmrI6ghJWZh4YJ9YHh9oFSyLKUmUWp4HYNNosv9rOuO8HhuzzNMhBZVV7QYDsJ f2tr5cPwOvIUJLPu7Og+FocJONKw8nHQkeMy8zIkQCepVnWAtKOgp9DYHEddPpQ/mDlabL mGqmx9dQaQ97vlQtnWM/CZjzswCy4qsJo2RYbYDNS0zWyt9KBMVoeXeco2wUrQ== 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 4YR3yt1x4PznY8; Sun, 05 Jan 2025 17:22:14 +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 505HME5v034242; Sun, 5 Jan 2025 17:22:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 505HME2j034239; Sun, 5 Jan 2025 17:22:14 GMT (envelope-from git) Date: Sun, 5 Jan 2025 17:22:14 GMT Message-Id: <202501051722.505HME2j034239@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: 93411b39fff2 - main - rtwn: calculate control rate for VHT rate frames List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 93411b39fff24ab4c9bf2b0395c7789b1a1c7a42 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=93411b39fff24ab4c9bf2b0395c7789b1a1c7a42 commit 93411b39fff24ab4c9bf2b0395c7789b1a1c7a42 Author: Adrian Chadd AuthorDate: 2024-12-16 02:05:13 +0000 Commit: Adrian Chadd CommitDate: 2025-01-05 17:21:53 +0000 rtwn: calculate control rate for VHT rate frames If the passed in rate is a VHT rate, use rtwn_ctl_vhtrate() to find a suitable rate for RTS/CTS. Differential Revision: https://reviews.freebsd.org/D48295 Reviewed by: bz, cy, emaste --- sys/dev/rtwn/rtl8812a/r12a_tx.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/rtwn/rtl8812a/r12a_tx.c b/sys/dev/rtwn/rtl8812a/r12a_tx.c index cc686668e4a2..582e6e0ddaf4 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_tx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_tx.c @@ -103,11 +103,17 @@ r12a_tx_protection(struct rtwn_softc *sc, struct r12a_tx_desc *txd, if (mode == IEEE80211_PROT_CTSONLY || mode == IEEE80211_PROT_RTSCTS) { - /* TODO: VHT */ - if (RTWN_RATE_IS_HT(ridx)) + /* + * Note: this code assumes basic rates for protection for + * both 802.11abg and 802.11n rates. + */ + if (RTWN_RATE_IS_VHT(ridx)) + rate = rtwn_ctl_vhtrate(ic->ic_rt, ridx); + else if (RTWN_RATE_IS_HT(ridx)) rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx); else rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]); + /* Map basic rate back to ridx */ ridx = rate2ridx(IEEE80211_RV(rate)); txd->txdw4 |= htole32(SM(R12A_TXDW4_RTSRATE, ridx));