From nobody Thu Jan 09 00:59:13 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 4YT5yn5cp4z5kLq9; Thu, 09 Jan 2025 00:59:13 +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 4YT5yn3h2kz4ypc; Thu, 9 Jan 2025 00:59:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384353; 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=f4auZkwAVUQoVDllIoPv4OW3F2aw8hKYpFmfr9cT58g=; b=J8fOuZkEGnjqIK7E5qnlQrEmsfY+FdPXaG3qGY3JQx1xr1dRaWg3yt/CpGiksI2QvCdfxU Ir6urDaFJ7BLDZKTvWyM8W8UFGpvvBztAYyYt1XizEKPxYab8NoCLyXijeygCfn+q/qHV/ bDTFjaDJhpblkUKYJ2QrjBJcwMbN1VDACxeYM1RIZZiT/+LW2lkz62kAVCudraD31V2EKP u86Eh9TJCcapcEWK9kDnGI80LwRmksilUsTGsfaJ8+5SwgTPfdqgO8Ffq7m+nHDUsjCexW yiZxNj+TzU1zo5INHPp818DZSbszDXg7kxSqP9C2nJjaJqJnwN0KY0+rVk3bEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736384353; 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=f4auZkwAVUQoVDllIoPv4OW3F2aw8hKYpFmfr9cT58g=; b=MsM4RDTu3WK0D167IWYo1TCl/3ub7HSZoRZCf2BnH/9pSumvXi2/2qmtkheXqXm7DN2B69 2pNduAN874OiOCLIE7JuCbtUhXO6SLKX/FRFBtfCM4BxFoMjctXcBduOXq8Hc5o+bI66ZW jWVyGpYzOEXfemr8NSfVq2pP6PWIO8qjVX6PKQgpmq+69n9klIrJJtkGHW1BSsHXHCCQm9 H7fHcm/HTiKS0Z/IgZOdj+D9gkHntMNqLEnl5pfvU7Ck+4XS6n41bGHqsX9RP9TJMX0rZR n+6nY4mtwxLXBfzC6GtozFmvqI5/nwacNoEYjNCILNgMJKIaFXvPNbuU1GynGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736384353; a=rsa-sha256; cv=none; b=yKVGViN5nNk0zoW0BJLMQBKKX2HjmaEfWOyn4a/3iK4tck+2C/ih0TxH5b4rFTyWpvV9fm szFFjEabewILS9nf+eJpZPM4REvuiBuDuz8puxBdtpwmrVxQ/OHRtzSqZRUV8QJjrU67wX 6dDdaxDxkIA5C7Kp1iH8pzNMn20e8bkx83BDuGeuOL8RcwAvFc+7RH6WgzDjtoy87A+3LQ EHsgCJw/3ePWQybsqFJExVbuXUgDOFmit4IM/kBC+NX4CHZhkTD1lodbKgUHE9CIi+TJq1 t2toe6UE16nqmFFRaVNgdP4tvZ9XcGnLOFGjJyhgqLz1ng0WsuY3C/Z/qq81+A== 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 4YT5yn3GMfz1JTP; Thu, 09 Jan 2025 00:59:13 +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 5090xDHW075502; Thu, 9 Jan 2025 00:59:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5090xDOY075499; Thu, 9 Jan 2025 00:59:13 GMT (envelope-from git) Date: Thu, 9 Jan 2025 00:59:13 GMT Message-Id: <202501090059.5090xDOY075499@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: ec07af2a3d49 - main - rtwn: announce VHT support for RTL8812AU/RTL8821AU. 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: ec07af2a3d494de36a20a541efdd24874c841db5 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=ec07af2a3d494de36a20a541efdd24874c841db5 commit ec07af2a3d494de36a20a541efdd24874c841db5 Author: Adrian Chadd AuthorDate: 2024-12-16 04:15:46 +0000 Commit: Adrian Chadd CommitDate: 2025-01-09 00:52:12 +0000 rtwn: announce VHT support for RTL8812AU/RTL8821AU. Although the transmit path doesn't yet support VHT rates (because the rate control and rate representation in net80211 doesn't yet know about VHT rates) the NIC will receive VHT frames but only transmit HT frames. Locally tested: * RTL8812AU, STA mode Differential Revision: https://reviews.freebsd.org/D48103 --- sys/dev/rtwn/if_rtwn.c | 23 +++++++++++++++++++++++ sys/dev/rtwn/if_rtwnvar.h | 2 ++ sys/dev/rtwn/rtl8812a/usb/r12au_attach.c | 19 ++++++++++++++++--- sys/dev/rtwn/rtl8821a/usb/r21au_attach.c | 17 ++++++++++++++--- 4 files changed, 55 insertions(+), 6 deletions(-) diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c index ed84950b1a94..f9950c5acf4d 100644 --- a/sys/dev/rtwn/if_rtwn.c +++ b/sys/dev/rtwn/if_rtwn.c @@ -436,6 +436,29 @@ rtwn_resume(struct rtwn_softc *sc) ieee80211_resume_all(ic); } +void +rtwn_attach_vht_cap_info_mcs(struct rtwn_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t rx_mcs = 0, tx_mcs = 0; + + for (int i = 0 ; i < 8; i++) { + if (i < sc->ntxchains) + tx_mcs |= (IEEE80211_VHT_MCS_SUPPORT_0_9 << (i*2)); + else + tx_mcs |= (IEEE80211_VHT_MCS_NOT_SUPPORTED << (i*2)); + + if (i < sc->nrxchains) + rx_mcs |= (IEEE80211_VHT_MCS_SUPPORT_0_9 << (i*2)); + else + rx_mcs |= (IEEE80211_VHT_MCS_NOT_SUPPORTED << (i*2)); + } + ic->ic_vht_cap.supp_mcs.rx_mcs_map = rx_mcs; + ic->ic_vht_cap.supp_mcs.rx_highest = 0; + ic->ic_vht_cap.supp_mcs.tx_mcs_map = tx_mcs; + ic->ic_vht_cap.supp_mcs.tx_highest = 0; +} + static void rtwn_vap_decrement_counters(struct rtwn_softc *sc, enum ieee80211_opmode opmode, int id) diff --git a/sys/dev/rtwn/if_rtwnvar.h b/sys/dev/rtwn/if_rtwnvar.h index fa4b6d0a5df7..aa42715b1674 100644 --- a/sys/dev/rtwn/if_rtwnvar.h +++ b/sys/dev/rtwn/if_rtwnvar.h @@ -436,6 +436,8 @@ void rtwn_detach(struct rtwn_softc *); void rtwn_resume(struct rtwn_softc *); void rtwn_suspend(struct rtwn_softc *); +void rtwn_attach_vht_cap_info_mcs(struct rtwn_softc *); + /* Interface-specific. */ #define rtwn_write_1(_sc, _addr, _val) \ (((_sc)->sc_write_1)((_sc), (_addr), (_val))) diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c index c87bffb4db19..b6850eb9fa23 100644 --- a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c +++ b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c @@ -175,11 +175,24 @@ r12au_adj_devcaps(struct rtwn_softc *sc) } ic->ic_htcaps |= - IEEE80211_HTCAP_CHWIDTH40 /* 40 MHz channel width */ - | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ + IEEE80211_HTCAP_CHWIDTH40 | /* 40 MHz channel width */ + IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ ; - /* TODO: STBC, VHT etc */ + /* TODO: STBC */ + + /* VHT config */ + ic->ic_flags_ext |= IEEE80211_FEXT_VHT; + ic->ic_vht_cap.vht_cap_info = + IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 | + IEEE80211_VHTCAP_SHORT_GI_80 | + IEEE80211_VHTCAP_TXSTBC | + IEEE80211_VHTCAP_RXSTBC_1 | + IEEE80211_VHTCAP_HTC_VHT | + _IEEE80211_SHIFTMASK(7, + IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK); + + rtwn_attach_vht_cap_info_mcs(sc); } void diff --git a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c index 175bac8f6fc9..60cb6d3fc61d 100644 --- a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c +++ b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c @@ -160,11 +160,22 @@ r21au_adj_devcaps(struct rtwn_softc *sc) ic->ic_caps |= IEEE80211_C_DFS; ic->ic_htcaps |= - IEEE80211_HTCAP_CHWIDTH40 /* 40 MHz channel width */ - | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ + IEEE80211_HTCAP_CHWIDTH40 | /* 40 MHz channel width */ + IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ ; - /* TODO: VHT */ + /* VHT config */ + ic->ic_flags_ext |= IEEE80211_FEXT_VHT; + ic->ic_vht_cap.vht_cap_info = + IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 | + IEEE80211_VHTCAP_SHORT_GI_80 | + IEEE80211_VHTCAP_TXSTBC | + IEEE80211_VHTCAP_RXSTBC_1 | + IEEE80211_VHTCAP_HTC_VHT | + _IEEE80211_SHIFTMASK(7, + IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK); + + rtwn_attach_vht_cap_info_mcs(sc); } void