From nobody Tue Dec 03 05:32:35 2024 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 4Y2TnJ1hx3z5fnDg; Tue, 03 Dec 2024 05:32:36 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y2TnJ03wqz46Qs; Tue, 3 Dec 2024 05:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733203956; 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=BkMZ7cbGScA3+TGq9qx0Tw3aYaAjYDgCZ1xC3DwLUH0=; b=C/QM3cr1Asj/b7L6V/Qo/SXzmgIDzfpq1oTmEZ25TDSxuF4sN2SHI89eZ9aKslYkpmqa7K +KEgOQ198oc3FyqCgkbyVaEYwXvKuOX+o7Es3XLPSrPh4I4I1pExcRJYL366nbI+Z9lgCp wKUkRlDVAFzAN2II79UcChuFiEzaWd/kyasJUS/BWMV9/x+zbyuITM9lUiWn+1i5EIFrS6 mcGqmEoLb6kbMkYaZEjVf3gwiM30oc6jujiu6gXps+f480tZHyy+NnHdc+T4K881zZ25YZ 8+ujXKkbRN1YGwIsq649flv5XPJdqyQCiTaV+FbHc8lsJoPYsy7JQ7qzgUYAvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733203956; 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=BkMZ7cbGScA3+TGq9qx0Tw3aYaAjYDgCZ1xC3DwLUH0=; b=AHjyjTooND5g6GYQxns0cq1B+Zsh84CHWoIeSZgvkYNFDXbKGQaz4n8MbxFguboaqKanSu ZcRYoieRobb+KUu/mwxstStlCToG3dsgjgcjik6twE3b+46hd6dKRG6XilB2DeoS3zcsfy RPIpI/LKVWt/ihP39vI4G0gk5AvbkuWgp0knL4s+1vg4vIOCogFcnQc4W6GyrEbIIY5z+X lVL2/sG5YWmX3P9oERCNVDTRF1hzPl2Kaf8+MZ/QxDUs1sWWb8zLSBjn1rPkNjc3kWeguD xrUq/xvBjLevBPLnrOJt0CmHD3XkxM7+cXykSPXvtrMGX7Jh9gHNqV5MwtvHQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733203956; a=rsa-sha256; cv=none; b=Ehanbo2ypM1ty3SJfAbzeEGFmYktKZGcupmhzA1F40sijDJ4m8v+kyK4SJlJaM340BBNVT HcOZl9ZABxWiAhF0VsI+HIfry0pLJGFLkHMzrzkBqiIWLpmpYSyeH0sJYIVWVXQ+oW4Hr/ OqoEhOd/GyKYpevOIZiOYaj7TXbrK6k+cYfNaJuFMVyBwzWc6i5Wm7tV0jyBEmBFNqZLlo 4N/a5OMU/bwzFXvMxE6f3KkNtIWVngD+BhBcwzim3MKEeVu9JCmXM1xcuBkNhzRz0nLrrh R32w0kUZU77Vu8OIqDUuaEO0U2xJRCl7RXA9XhUGAKKmstsUnssDySqN8mNoPw== 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 4Y2TnH6VPBz18Sk; Tue, 3 Dec 2024 05:32:35 +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 4B35WZlY042014; Tue, 3 Dec 2024 05:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B35WZTw042011; Tue, 3 Dec 2024 05:32:35 GMT (envelope-from git) Date: Tue, 3 Dec 2024 05:32:35 GMT Message-Id: <202412030532.4B35WZTw042011@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: 3d54d9e364f8 - main - ath: use the new net80211 methods for AMPDU density/limit, short-GI 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: 3d54d9e364f88117fa9f7126ef0184c6da5069fc Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=3d54d9e364f88117fa9f7126ef0184c6da5069fc commit 3d54d9e364f88117fa9f7126ef0184c6da5069fc Author: Adrian Chadd AuthorDate: 2024-11-25 23:02:26 +0000 Commit: Adrian Chadd CommitDate: 2024-12-03 05:31:05 +0000 ath: use the new net80211 methods for AMPDU density/limit, short-GI Now that net80211 has this code, just leverage it instead of rolling our own. Differential Revision: https://reviews.freebsd.org/D47748 Reviewed by: bz --- sys/dev/ath/if_ath_tx_ht.c | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c index ca69d4558d76..9558b7c9e696 100644 --- a/sys/dev/ath/if_ath_tx_ht.c +++ b/sys/dev/ath/if_ath_tx_ht.c @@ -222,7 +222,6 @@ void ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf) { struct ieee80211_node *ni = bf->bf_node; - struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; const HAL_RATE_TABLE *rt = sc->sc_currates; struct ath_rc_series *rc = bf->bf_state.bfs_rc; @@ -297,17 +296,13 @@ ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf) * we are always "out" by some amount. */ if (ni->ni_chw == 40 && - ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40 && - ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40 && - vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40 && + ieee80211_ht_check_tx_shortgi_40(ni) && (bf->bf_flags & ATH_BUF_TOA_PROBE) == 0) { rc[i].flags |= ATH_RC_SGI_FLAG; } if (ni->ni_chw == 20 && - ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20 && - ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20 && - vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20 && + ieee80211_ht_check_tx_shortgi_20(ni) && (bf->bf_flags & ATH_BUF_TOA_PROBE) == 0) { rc[i].flags |= ATH_RC_SGI_FLAG; } @@ -406,7 +401,6 @@ ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf, { const HAL_RATE_TABLE *rt = sc->sc_currates; struct ieee80211_node *ni = first_bf->bf_node; - struct ieee80211vap *vap = ni->ni_vap; int ndelim, mindelim = 0; int mpdudensity; /* in 1/100'th of a microsecond */ int peer_mpdudensity; /* net80211 value */ @@ -418,17 +412,7 @@ ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf, /* * Get the advertised density from the node. */ - peer_mpdudensity = - _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); - - /* - * vap->iv_ampdu_density is a net80211 value, rather than the actual - * density. Larger values are longer A-MPDU density spacing values, - * and we want to obey larger configured / negotiated density values - * per station if we get it. - */ - if (vap->iv_ampdu_density > peer_mpdudensity) - peer_mpdudensity = vap->iv_ampdu_density; + peer_mpdudensity = ieee80211_ht_get_node_ampdu_density(ni); /* * Convert the A-MPDU density net80211 value to a 1/100 microsecond @@ -563,8 +547,6 @@ static int ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf) { - struct ieee80211vap *vap = ni->ni_vap; - int amin = ATH_AGGR_MAXSIZE; int i; @@ -572,15 +554,9 @@ ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni, if (sc->sc_aggr_limit > 0 && sc->sc_aggr_limit < ATH_AGGR_MAXSIZE) amin = sc->sc_aggr_limit; - /* Check the vap configured transmit limit */ - amin = MIN(amin, ath_rx_ampdu_to_byte(vap->iv_ampdu_limit)); - - /* - * Check the HTCAP field for the maximum size the node has - * negotiated. If it's smaller than what we have, cap it there. - */ - amin = MIN(amin, ath_rx_ampdu_to_byte( - _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU))); + /* Check the vap and node configured transmit limit */ + amin = MIN(amin, + ath_rx_ampdu_to_byte(ieee80211_ht_get_node_ampdu_limit(ni))); for (i = 0; i < ATH_RC_NUM; i++) { if (bf->bf_state.bfs_rc[i].tries == 0) @@ -593,7 +569,7 @@ ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni, "peer maxrxampdu=%d, max frame len=%d\n", __func__, sc->sc_aggr_limit, - vap->iv_ampdu_limit, + ni->ni_vap->iv_ampdu_limit, _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU), amin);