From nobody Tue Dec 03 05:32:38 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 4Y2TnM0fCRz5fnPL; Tue, 03 Dec 2024 05:32:39 +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 4Y2TnL2zgFz46CK; Tue, 3 Dec 2024 05:32:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733203958; 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=tgv8AC8xF8nvQQpc5me+NNhNl+SP1v4+on8IwPSEHKs=; b=VFoVUnsbTdKh5Dr1jY75WQenRYcTX0AmpPKTf44gyJCsdAI/2utIgCBPYPM7St3eIdxUpo rxweOJqLOdXG+ojDrKCejbOVah6ckSZgRwaKm8IXT15O/6mnDrpA9QGNyxCcmhCw+VuC1b UeODsDGY8JdjqE08QWRZZt8i8NB6Bxt3YsiHAtfgZJLQi1uuBOdWt9NbgTLbJ2fpUFnuWL U9BFMo5fNRrBWhtqqW2gz9xx2KD5BEl0sDfmQl/eUkLbPzEVemw0Eo0rg6iPuXYZ4urCzP KQNaztdzr4D0hPz7In35is+2zvClbaDBDmJxTRSuGOzBwYatkE2LBcdY+9FNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733203958; 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=tgv8AC8xF8nvQQpc5me+NNhNl+SP1v4+on8IwPSEHKs=; b=SjDrrmVx+39sFJIXG+CgE3/lLgseiPSV0E+PdX6xKlq7iQ7LMn8y61LnDqL7fAiAieNC9a EwFc7x2zwYfwdH5HaApQPjqVHjAYVw35lZAPD6KT2YBkTAZIWThjKJI41fQuqzSNLsMmnT kEaWiUW1g+RG2jT/3XO1lcSuLWJqSq3/pIi1/uOvWnkxJQv/wFSaha11lgrOP20SHvr7AW GuwzjBKGIsSQ+Lv8zKBWS2mTKqcsetFqr3YV4Cahn8rnA3Taxk5u4wkHs7OAEr+Kz//CtG eMzmR6MmVJJbFlaR/F4FdOKnWrzRmlzT/0p3chO/Cv4BEOJH0cEiJMcp/Yj4og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733203958; a=rsa-sha256; cv=none; b=HWH9O2GmGv+mTbmrAC1Y9UQ8v5QxqwaOSCVlPo8+mvGbgM97I1Mjuyl4u00ZHId51KG+vZ PYb7ny29oVSMWqpaQr0n7XaJTkCp/DMHFQMHL4aAIXLAVkfR4WCAm3bwsO3JNHVLIlEYft ToJt2oVXE6STIA9WxJSMOW2iT1vkYDzPd30ETo22FhAr3B8OvDRjeFXESN2LX02B5fJEAg ouED5srxZ06shykX91hdwY4IZbnG4wzd6WH3fWKaR8wPKctXKHEdykD1TtIfcobNFAqO7O t7mdO8Q8IgO75bJLDbMigwVPGmVMWQcNIWzml9hOj9KPWlYrNfq+Ba0UlmyRIA== 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 4Y2TnL1RGhz193k; Tue, 3 Dec 2024 05:32:38 +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 4B35Wcpf042103; Tue, 3 Dec 2024 05:32:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B35WchN042100; Tue, 3 Dec 2024 05:32:38 GMT (envelope-from git) Date: Tue, 3 Dec 2024 05:32:38 GMT Message-Id: <202412030532.4B35WchN042100@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: 2014462da5b3 - main - amrr: remove duplicate logic, use ieee80211_ht_check_tx_ht() 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: 2014462da5b3e630cdbf687d918bbfc0c3a344a4 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=2014462da5b3e630cdbf687d918bbfc0c3a344a4 commit 2014462da5b3e630cdbf687d918bbfc0c3a344a4 Author: Adrian Chadd AuthorDate: 2024-11-26 01:40:12 +0000 Commit: Adrian Chadd CommitDate: 2024-12-03 05:32:08 +0000 amrr: remove duplicate logic, use ieee80211_ht_check_tx_ht() This uses the new net80211 helper function to indicate that nodes can actually receive transmitted HT rates. Differential Revision: https://reviews.freebsd.org/D47754 Reviewed by: bz --- sys/net80211/ieee80211_amrr.c | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c index 461554d75ea1..386a3de92a74 100644 --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -138,25 +138,6 @@ amrr_deinit(struct ieee80211vap *vap) nrefs--; /* XXX locking */ } -/* - * Return whether 11n rates are possible. - * - * Some 11n devices may return HT information but no HT rates. - * Thus, we shouldn't treat them as an 11n node. - */ -static int -amrr_node_is_11n(struct ieee80211_node *ni) -{ - - if (ni->ni_chan == NULL) - return (0); - if (ni->ni_chan == IEEE80211_CHAN_ANYC) - return (0); - if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_htrates.rs_nrates == 0) - return (0); - return (IEEE80211_IS_CHAN_HT(ni->ni_chan)); -} - static void amrr_node_init(struct ieee80211_node *ni) { @@ -189,7 +170,7 @@ amrr_node_init(struct ieee80211_node *ni) amn->amn_success_threshold = amrr->amrr_min_success_threshold; /* 11n or not? Pick the right rateset */ - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { /* XXX ew */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "%s: 11n node", __func__); @@ -204,7 +185,7 @@ amrr_node_init(struct ieee80211_node *ni) rate = rs->rs_rates[0]; /* XXX clear the basic rate flag if it's not 11n */ - if (! amrr_node_is_11n(ni)) + if (! ieee80211_ht_check_tx_ht(ni)) rate &= IEEE80211_RATE_VAL; /* pick initial rate from the rateset - HT or otherwise */ @@ -213,7 +194,7 @@ amrr_node_init(struct ieee80211_node *ni) amn->amn_rix--) { /* legacy - anything < 36mbit, stop searching */ /* 11n - stop at MCS4 */ - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { if ((rs->rs_rates[amn->amn_rix] & 0x1f) < 4) break; } else if ((rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL) <= 72) @@ -222,7 +203,7 @@ amrr_node_init(struct ieee80211_node *ni) rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; /* if the rate is an 11n rate, ensure the MCS bit is set */ - if (amrr_node_is_11n(ni)) + if (ieee80211_ht_check_tx_ht(ni)) rate |= IEEE80211_RATE_MCS; /* Assign initial rate from the rateset */ @@ -234,7 +215,7 @@ amrr_node_init(struct ieee80211_node *ni) IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "AMRR: nrates=%d, initial rate %s%d", rs->rs_nrates, - amrr_node_is_11n(ni) ? "MCS " : "", + ieee80211_ht_check_tx_ht(ni) ? "MCS " : "", rate & IEEE80211_RATE_VAL); } @@ -254,7 +235,7 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, KASSERT(is_enough(amn), ("txcnt %d", amn->amn_txcnt)); /* 11n or not? Pick the right rateset */ - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { /* XXX ew */ rs = (struct ieee80211_rateset *) &ni->ni_htrates; } else { @@ -347,7 +328,7 @@ amrr_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused) amrr = amn->amn_amrr; /* 11n or not? Pick the right rateset */ - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { /* XXX ew */ rs = (struct ieee80211_rateset *) &ni->ni_htrates; } else { @@ -360,7 +341,7 @@ amrr_rate(struct ieee80211_node *ni, void *arg __unused, uint32_t iarg __unused) /* update public rate */ ni->ni_txrate = rs->rs_rates[rix]; /* XXX strip basic rate flag from txrate, if non-11n */ - if (amrr_node_is_11n(ni)) + if (ieee80211_ht_check_tx_ht(ni)) ni->ni_txrate |= IEEE80211_RATE_MCS; else ni->ni_txrate &= IEEE80211_RATE_VAL; @@ -482,7 +463,7 @@ amrr_print_node_rate(struct ieee80211_amrr_node *amn, int rate; struct ieee80211_rateset *rs; - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { rs = (struct ieee80211_rateset *) &ni->ni_htrates; rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; sbuf_printf(s, "rate: MCS %d\n", rate);