From nobody Fri Jun 5 12:10:06 2026 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 4gX0cb0MvGz6gy3F for ; Fri, 05 Jun 2026 12:10:07 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gX0cZ6HKxz44QR for ; Fri, 05 Jun 2026 12:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780661406; 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=SmekEY2In5qSnlOI84o1UjkwQySDBnzfmco7X1YL+I4=; b=knCEoZrPQSlUqNRdiBOATdgRgQcZcxpXeuxl9zlQvBtWJ6DRArD7QiaZ+i3Rk2iQ0TXWYd m1HeTx6jY8E2JPgotAcsMwllZU9V7bTFzsXv2oJwzykf39OtVKjGDlhKhJHwy84QjG8ywl BDZ4MQhnY1dG8lIHG9FmIuxqIR/JRC+x8i681lEk8U0vcvAf41PVT4P1y8cb/qB/r+uVbN RJw+eZgt9F5hNv6ozvfC6xFH6uILSggVPg1VcadVXBrfkJ7dVsqfbu2z9FT7E7ck0vRCUH UHuZE5zfHZUjzZFAUFeCgjH6XCtQk8jySbr0CVfg7DOkU5shynmwAuskIr0d4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780661406; a=rsa-sha256; cv=none; b=YD3N3KP1XQnmMHVhdMveLW2TpR0csPeKRvMlfB/fJzmes1oFgE0lm9/Zj2/pQDUfD7tf9z s48m4IxK8Vj6BMyJmq6XGTemYyztElWqP36EBJIJP/UBspF0yNnRX+SeqSyUzWoMpSdEpG 76LeQEu9t0D/Nb+IcWiQIyS1QBfR5SKDrkowiAzbbwe9vfR2L39z/PsUdA8PHNSSFNUPIs roqm2+zPE6a0C/Kl3H0jNNXByGeIg6hZv1qRnnKIVtB36e8TIz7/Q+BDHWn0AZAyFrg9TO LAqspPtLnBD7updTuzgmW2WyWFY4fFQzsAwVAaFSgBHkIu5jgyWd6k+lmCM4oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780661406; 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=SmekEY2In5qSnlOI84o1UjkwQySDBnzfmco7X1YL+I4=; b=BZWT/+3AwFG3jd5qi8WI9dkDmp/AJ0TWGq0P5GK0CnMAr1DA0WaOQdBqCpHyN/TWmGC7iV UQjCNcM6f+SswXx0G60zCE4mfu9oIVgFlWrYwqItB7MW5CsyfEXxhch//0JkMjjEWXkTCg ncgtVMlDi4PX3N1yDHJdBnLDDTdwIYTd5gL/QD0/8Q0pXyoevJl9fqe5ntJU09nOJUZ3qs xdHvDfmticauLKPg5aNJywddNZrItR93AcZw8qrEmyA5zJ5hjBwc1TUSZwxscdhfp8DSK6 y0I5TJCJVpeowYsJFf7ymr6Y88NJOe+Qxp6RK5zs9QIV21LwyI+mRotGYJZPtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gX0cZ5dfVzBxf for ; Fri, 05 Jun 2026 12:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24cd3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Jun 2026 12:10:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: fb97712a7f13 - main - LinuxKPI: 802.11: implement ieee80211_start_tx_ba_session() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb97712a7f13b85ca707f52f206a2944ee66cf2c Auto-Submitted: auto-generated Date: Fri, 05 Jun 2026 12:10:06 +0000 Message-Id: <6a22bc9e.24cd3.e6a64df@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fb97712a7f13b85ca707f52f206a2944ee66cf2c commit fb97712a7f13b85ca707f52f206a2944ee66cf2c Author: Bjoern A. Zeeb AuthorDate: 2026-04-26 19:58:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-05 12:09:22 +0000 LinuxKPI: 802.11: implement ieee80211_start_tx_ba_session() Implement ieee80211_start_tx_ba_session() as a start for rtw8x (and select mt76 chipsets) to support more throughput. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 6 +- sys/compat/linuxkpi/common/src/linux_80211.c | 102 ++++++++++++++++++++++ 2 files changed, 105 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 3c783d1f3c8a..c77d37e72fd1 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1197,6 +1197,7 @@ void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *, struct ieee80211_txq *, bool); void linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *, struct ieee80211_txq *); +int linuxkpi_ieee80211_start_tx_ba_session(struct ieee80211_sta *, uint8_t, int); /* -------------------------------------------------------------------------- */ @@ -2118,10 +2119,9 @@ ieee80211_sta_eosp(struct ieee80211_sta *sta) } static __inline int -ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid, int x) +ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid, int timeout) { - TODO("rtw8x"); - return (-EINVAL); + return (linuxkpi_ieee80211_start_tx_ba_session(sta, tid, timeout)); } static __inline int diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 901c59702840..7e55e0912bb1 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6441,6 +6441,108 @@ net80211_only: } #endif +int +linuxkpi_ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid, + int timeout) +{ + struct lkpi_sta *lsta; + struct ieee80211_hw *hw; + struct lkpi_hw *lhw; + struct ieee80211_tx_ampdu *tap; + int worked; + + lsta = STA_TO_LSTA(sta); + + /* If tid is out of range, fail gracefully. */ + /* XXX-BZ are we limited to 8? */ + if (tid >= IEEE80211_NUM_TIDS) { + net80211_vap_printf(lsta->ni->ni_vap, "%s: tid %u out of range " + ">= %u\n", __func__, tid, IEEE80211_NUM_TIDS); + return (-EINVAL); + } + + hw = lsta->hw; + lhw = HW_TO_LHW(hw); + + /* No ampdu_action support, just error. */ + if (lhw->ops->ampdu_action == NULL) { + net80211_vap_printf(lsta->ni->ni_vap, "%s: (*ampdu_action) " + "not supported\n", __func__); + return (-ENOTSUPP); + } + + /* Does HW allow us to set this up? */ + if (!ieee80211_hw_check(hw, AMPDU_AGGREGATION)) { + net80211_vap_printf(lsta->ni->ni_vap, "%s: !AMPDU_AGGREGATION\n", + __func__); + return (-ENOTSUPP); + } + if (ieee80211_hw_check(hw, TX_AMPDU_SETUP_IN_HW)) { + net80211_vap_printf(lsta->ni->ni_vap, "%s: TX_AMPDU_SETUP_IN_HW\n", + __func__); + return (-EPERM); + } + + /* We need at least HT or higher support enabled. */ + if (!sta->deflink.ht_cap.ht_supported && + !sta->deflink.vht_cap.vht_supported && + !sta->deflink.he_cap.has_he && + !sta->deflink.eht_cap.has_eht) { + net80211_vap_printf(lsta->ni->ni_vap, "%s: HT or later not " + "supported\n", __func__); + return (-ENOTSUPP); + } + +#ifdef __notyet__ + /* + * We need some rate limiting/disabling in case we try too hard and + * get NACKed over and over. + * XXX-BZ This check should likely go to addba_req along with a counter. + */ + if (lsta->block_ba) + return (-EACCESS); +#endif + + /* XXX-BZ locking? */ + + /* Do we have a running session already? */ + tap = &lsta->ni->ni_tx_ampdu[tid]; + if (IEEE80211_AMPDU_REQUESTED(tap)) { + net80211_vap_printf(lsta->ni->ni_vap, "%s: " + "AMPDU requested/running\n", __func__); + return (-EINPROGRESS); + } + + /* Tell net80211 to setup an aggr sessions. */ + /* XXX-BZ we have no way to carry the timeout forward easily. */ + worked = ieee80211_ampdu_tx_request_ext(lsta->ni, tid); + TRACEOK("ieee80211_ampdu_tx_request_ext %d", worked); + + if (worked != 1) { + net80211_vap_printf(lsta->ni->ni_vap, "%s: " + "ieee80211_ampdu_tx_request_ext returned %d != 1\n", + __func__, worked); + return (-EINVAL); + } + + /* + * How do we make sure the EAPOL handshake has completed? + * Let ieee80211_output do it. + */ + if (1) { + /* Immediately trigger the setup and output of the action frame. */ + worked = ieee80211_ampdu_request(lsta->ni, tap); + if (worked != 1) { + net80211_vap_printf(lsta->ni->ni_vap, "%s: " + "ieee80211_ampdu_request returned %d != 1\n", + __func__, worked); + return (-EAGAIN); + } + } + + return (0); +} + static void lkpi_ic_getradiocaps_ht(struct ieee80211com *ic, struct ieee80211_hw *hw, uint8_t *bands, int *chan_flags, enum nl80211_band band)