From nobody Mon Jun 29 06:34:13 2026 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 4gpc1x6Lf0z6k5CK for ; Mon, 29 Jun 2026 06:34: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gpc1x3bpPz4Gb8 for ; Mon, 29 Jun 2026 06:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782714853; 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=awV9364gwRktFPA0/ONeEi8x5BlnogNvKnfgXQa3HRg=; b=Q/lJDXK4ObrXw5F9ysIMlO2+McKgFuAkJ65d2BM438EG4S2U6WVuTAR1UAE69i0keAlrhf lel4HJkSxHdLT8TW9Bx6lwoBZxDdz2HsgEk9zrkcB5aYcWepG02KtxVaf7c9GjFLowq5r9 FocJh5+pU5e465f4+vJ5dBENT8V3S66nb0WF6VUvXqCN8evTeFaXi3cahB5pjz916paM8i qDgCb7SnGg75dfhYYhAUrK9PA1W/TsFhOunq7ppe9tB5/i3Obf3+UOND9Da1u5RCL6iVM1 dxPrrQ8EKy2fgFOhSsPgHxzDoR4wyuVVnjNMuaa0DPGM2TL8XlP38VTzZsIzjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782714853; a=rsa-sha256; cv=none; b=nYpT1dasgcy9rFH1CB0KzUb094G682bWmk8Z94342C/Uo+7g4sDFoRrKaNUdiQm2ZNmKcx 7HK8iJSVqvcVAJoV60xmeQ7nmgMPOhmBwV1lVGIUUHgWshBpQnbyEPX9k7yvq994QChqRF p4BEoKgBM4N1JBz+cctb5GLnzawGrMj5Wr8qAYKLEwTV7d0fAz3lZsS8NCcpH0vXxuFVjl 59OtQvLlY9RJLy40X4/enRfv4up3BcfHGrr7QaNGhoV7c0hKd5sQO5G/22WibjRrRGNaAT sPVfumXmWcS76nGJyVwsA7siohkko41k1Z4I9y5Fzbx4KS3KlMSZSuyRFh+1jg== 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=1782714853; 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=awV9364gwRktFPA0/ONeEi8x5BlnogNvKnfgXQa3HRg=; b=WaFpXatuk0HX2fAVPkzjaU9wHt/BVPPZ01a8uOqNNT30Bsb0fgXtCvh3n0nwhG0ArqaEmZ ko0G1YT518ngBXm865yx2u8Wh+UlE83B8Vmo3AMCBRwoNCP86b/VsKbMNROmsAcUySoaSz coJP9LNB9VXOTx/TWZWAFH6Z+prD2n8elo7HrM8eYR/vS6D5lK4S4YCaRAuK3Ge7bTcot5 QMn69iaaAyySfwe6gg8BJENf/I54Al2w9Fe1+aal3LjJjkyKjPymbV8OzP/c9nY8ATF0St CWQJ5j8h02GQ4UNKNxXZRJNIadLetRkStJNbqtqcnKWySazfv1T+xOd7Pta+fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gpc1x2W1ZzmVD for ; Mon, 29 Jun 2026 06:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46996 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 29 Jun 2026 06:34:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 19ee959ca1fc - stable/15 - LinuxKPI: 802.11: implement ieee80211_start_tx_ba_session() 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 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 19ee959ca1fccb8b7d2c0f99decdc4fcdde249c4 Auto-Submitted: auto-generated Date: Mon, 29 Jun 2026 06:34:13 +0000 Message-Id: <6a4211e5.46996.1205c141@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=19ee959ca1fccb8b7d2c0f99decdc4fcdde249c4 commit 19ee959ca1fccb8b7d2c0f99decdc4fcdde249c4 Author: Bjoern A. Zeeb AuthorDate: 2026-04-26 19:58:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-29 03:51:54 +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 (cherry picked from commit fb97712a7f13b85ca707f52f206a2944ee66cf2c) --- 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 cade61e8446f..ad842ea7a7d2 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6435,6 +6435,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)