From nobody Wed Jan 08 02:59:17 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 4YSXgn65c7z5kRbf; Wed, 08 Jan 2025 02:59:17 +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 4YSXgn3fHRz4cXD; Wed, 8 Jan 2025 02:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736305157; 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=LOUblnmhwHdtVRrLFnORzChKRoZkMk84D4U7gh2K+2I=; b=wU1EjkK+Lhs1fUnmQDR/WUrsZ9w4hDwyJ3cNnh6xMnmn81yLTPoeWGwXPTP63cRnZVzVlb A+ocIpD6CDIyIWh9InLeihPn1ei7yDwrJeiumtzUUbpcTKwF6tSrJwVON/sZn2FtKXYNlv 6B05EJZl538vcwKcN5rKP5JncdlS9lkVRNoSALieE2GDgAlYvoulg8uqV2yjnADzUVPSx6 wJdnn+tB5CfIKPp50emoFiawm098ImSHGCWyXvSi59anAB0sDpJXUTktY65PNqGCkXmu1J cPnTWgsbK07pofChTh/55YsE9+lZ0ziDKBbNhfA+BUEnogeKQ4DuUQqBzS/E2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736305157; 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=LOUblnmhwHdtVRrLFnORzChKRoZkMk84D4U7gh2K+2I=; b=VHfSKKvjFsV7EZZ9JjN4cdOCvwJhfXJ0pEJM5f2p7Cc8W+XUnUtYl3yWjqjVQ3nfWrJVy1 Tqmp0Uufb9bZ6BrTJY7iBFU5HPrKa3TLrli+w1sm/aXxrz/0EBzJRp4BeWYKPMgzx9t0vq PM7bbvl4jlPsIbyiKruRKuYqWhyiANNNArNjaZFLkHQ9H7jS1Ar188vJ2sh4vMEz61G+B/ r9ozGpWyzbLXCUw5glUDXEKFGL9sW4e3pakAaneszmlvTjl/fNYbv4UcAZZewwZvTxMfb7 Jc5jbMoFf8/YZB6g8QNPUn4pCVL9uLF77fGRHHK5+c1kFP7nSsjEv2H6OpdQnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736305157; a=rsa-sha256; cv=none; b=Ny6+tMW6qnngtESjsN5MQkWmRS0NNiv00Bth8OVo+wXHBVh/f+jXwPiFP3+8aJROYJWGIx ys6JYcofZKF8Y8btMo5UV6J80BdXpYZevCA4NJSjBAjBjr3+T7jVjGqLR+/mMUoYmzK9Iw VO7J02U0uj4aecgYu7CbA14NRUEwBHo0Byv/gL3nFzFRtFrx/6+HmBeA/ckb6OwohpB86S 6zik+Tho1ioRIYOAgGeBSGEo+sSW4monqd5lJa2X0q2HhKZ6zfCnv85gsfdqsIfE+2xfXC 7aqWJH5YCIHnkhX5tcXQOib0uVTxWHJbP0NYDdYA/ey+mg/97afxgBm4H13GGA== 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 4YSXgn38gGzfF0; Wed, 08 Jan 2025 02:59:17 +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 5082xHeX002425; Wed, 8 Jan 2025 02:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5082xH1L002422; Wed, 8 Jan 2025 02:59:17 GMT (envelope-from git) Date: Wed, 8 Jan 2025 02:59:17 GMT Message-Id: <202501080259.5082xH1L002422@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: dd58d03a2a46 - main - rtwn: set the maximum A-MPDU size correctly for RTL8812AU/RTL8821AU 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: dd58d03a2a46dddf2ce661d623224a947751beff Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=dd58d03a2a46dddf2ce661d623224a947751beff commit dd58d03a2a46dddf2ce661d623224a947751beff Author: Adrian Chadd AuthorDate: 2024-12-17 05:36:02 +0000 Commit: Adrian Chadd CommitDate: 2025-01-08 02:32:56 +0000 rtwn: set the maximum A-MPDU size correctly for RTL8812AU/RTL8821AU The vendor driver sets it to 64k or 128k depending upon chipset, along with bit 31 being set in hal/rtl8812a_hal_init.c:SetHwReg8812A(). Differential Revision: https://reviews.freebsd.org/D48118 Obtained from: https://github.com/lwfinger/rtl8812au Reviewed by: bz --- sys/dev/rtwn/rtl8812a/r12a_var.h | 1 + sys/dev/rtwn/rtl8812a/usb/r12au_attach.c | 1 + sys/dev/rtwn/rtl8812a/usb/r12au_init.c | 12 +++++++++++- sys/dev/rtwn/rtl8821a/usb/r21au_attach.c | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/dev/rtwn/rtl8812a/r12a_var.h b/sys/dev/rtwn/rtl8812a/r12a_var.h index 182e6b902758..0a76e013b6a7 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_var.h +++ b/sys/dev/rtwn/rtl8812a/r12a_var.h @@ -99,6 +99,7 @@ struct r12a_softc { int ac_usb_dma_size; int ac_usb_dma_time; int ampdu_max_time; + int ampdu_max_size; }; #define R12A_SOFTC(_sc) ((struct r12a_softc *)((_sc)->sc_priv)) diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c index 84bfcfbda0e8..c87bffb4db19 100644 --- a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c +++ b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c @@ -141,6 +141,7 @@ r12a_attach_private(struct rtwn_softc *sc) rs->rs_iq_calib_sw = r12a_iq_calib_sw; rs->ampdu_max_time = 0x70; + rs->ampdu_max_size = 0x1ffff; /* 128k */ sc->sc_priv = rs; } diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_init.c b/sys/dev/rtwn/rtl8812a/usb/r12au_init.c index ac6a599895ac..1bee2c665657 100644 --- a/sys/dev/rtwn/rtl8812a/usb/r12au_init.c +++ b/sys/dev/rtwn/rtl8812a/usb/r12au_init.c @@ -142,7 +142,17 @@ r12au_init_ampdu(struct rtwn_softc *sc) /* Setup AMPDU aggregation. */ rtwn_write_1(sc, R12A_AMPDU_MAX_TIME, rs->ampdu_max_time); - rtwn_write_4(sc, R12A_AMPDU_MAX_LENGTH, 0xffffffff); + /* + * Note: The vendor driver (hal/rtl8812a_hal_init.c:SetHwReg8812A()) + * also sets bit 31. + */ + /* + * TODO: this should be limited to the peer in STA mode, + * and perhaps the minimum A-MPDU of all VAPs/peers in + * multi-STA / other operating modes. + */ + rtwn_write_4(sc, R12A_AMPDU_MAX_LENGTH, + rs->ampdu_max_size | (1<<31)); /* 80 MHz clock (again?) */ rtwn_write_1(sc, R92C_USTIME_TSF, 0x50); diff --git a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c index 9f0e2c950a1e..175bac8f6fc9 100644 --- a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c +++ b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c @@ -141,6 +141,7 @@ r21a_attach_private(struct rtwn_softc *sc) rs->rs_iq_calib_sw = r21a_iq_calib_sw; rs->ampdu_max_time = 0x5e; + rs->ampdu_max_size = 0xffff; /* 64k */ rs->ac_usb_dma_size = 0x01; rs->ac_usb_dma_time = 0x10;