From nobody Wed Feb 26 19:31:43 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 4Z34NK34Ksz5nl5P; Wed, 26 Feb 2025 19:31:45 +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 4Z34NJ0jt5z3dY9; Wed, 26 Feb 2025 19:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740598304; 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=k/OdvO6KM2kveG2la6gTIOEujkR75h2UR3GI3oNhMtw=; b=ARHGf4j0w+utvEEILS+aad863oza510QuyWmR1OMhyE82V5c6icmU/VVk3HaC4darna7oh IRMZMKxR9egTlkP3Uxe45uIFmo32PL5OOtedAgUwToJ0ss0Kk+VQMPZw8mwjeBSza8oGpn CV81d87jB7G9GR5dtEygzf2uC4srns17tPQG5vDuUU6C2BuWjVHXcTVQZgkiEZo3CskvJ6 omCt6OymlG6HFswPfvjgcUakQv3Re+UJAuxwFRa/BPYV3m/U09/zWfrBICE+SJe9JdZBnC flQxKjNDnxtufLE1pVSBeHSJt9SsZs40lfe6uCn4yahDmLwNoiHjq8ED4MGAsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740598304; a=rsa-sha256; cv=none; b=IBmeTxrmDBcKZE84qq2Jhk40ncGvVEHZPhuQ16MNLqx2MQbS8E7BFdUtZn3MJlpV81dAG3 uic4yXtbyIoL4CKeUcyKDkixpiDzBtEGHWUkT3H6Kk+J46a5BlkDVdky+gQJaZm+eMQmYq cgQNC1tmm9DUcdXdmEZ3PitRYYHKp6oRwOIF2FmDMbOylr+iu4ilRlKZYQ6tWwczBUk2jc hnKvdOov4JfS45iktM2iYUz15+/DeFHgZisqaAtsMH87bq5pDbOqIsIMvJnOh1owShUY3O UZqmczg+u8gDOk3GROtLmfOEpw+nJ87/idKfpnm9g0KhvNQ7pFCne/sFHbeQTw== 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=1740598304; 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=k/OdvO6KM2kveG2la6gTIOEujkR75h2UR3GI3oNhMtw=; b=iuPkbQ1IpDjkkaeH6ISy3VUZsXhITkKwQ89+8pvE84sADJD6xbNj2moAeOIXbZQXGFyArc j0Sz7ZfOOIndIJWijjLU16ePx0Qpcu/Bm1afJttnrO9iGwLklXe3s1LbxMQxQy8IkIRZ5g 5jO2RfhIppOvpx0+qV1HoHXqX2/byg53bJVfV/mWWLxT3BFZxXrbMpwUsUc0LhIM5sBDK8 yP5uJbrWvAzGSYilnu42QaDSL2zKvwzJl/zjQ31S7vB1xr3jyNG2vb9tAOYPZRMcW/R4hM qXBUOJ+O7leDGRo1fzyEHXj1dnxekEyOsb9f4vkne74sAyH+38s3kcREnygT4A== 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 4Z34NH6vHsz1PYl; Wed, 26 Feb 2025 19:31:43 +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 51QJVhjb017761; Wed, 26 Feb 2025 19:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QJVhp8017757; Wed, 26 Feb 2025 19:31:43 GMT (envelope-from git) Date: Wed, 26 Feb 2025 19:31:43 GMT Message-Id: <202502261931.51QJVhp8017757@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: 1086f7bab303 - main - net80211: add node VHT transmit rate helper functions 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: 1086f7bab303cc61b3dce1ae51cb008675ad758a Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=1086f7bab303cc61b3dce1ae51cb008675ad758a commit 1086f7bab303cc61b3dce1ae51cb008675ad758a Author: Adrian Chadd AuthorDate: 2025-01-13 05:50:34 +0000 Commit: Adrian Chadd CommitDate: 2025-02-26 19:30:51 +0000 net80211: add node VHT transmit rate helper functions * add a node VHT transmit function, which configures the parameters accordingly. * add a node VHT transmit function which just copies in another ieee80211_node_txrate struct. Differential Revision: https://reviews.freebsd.org/D48609 Reviewed by: bz --- sys/net80211/ieee80211_node.c | 40 ++++++++++++++++++++++++++++++++++++++++ sys/net80211/ieee80211_node.h | 4 ++++ 2 files changed, 44 insertions(+) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 5a239bbd30f6..bc0358feb7a8 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -3188,6 +3188,26 @@ ieee80211_node_get_txrate(struct ieee80211_node *ni, *txr = ni->ni_txrate; } +/** + * @brief Set the txrate representing the current transmit rate + * + * This is the API call for drivers and rate control APIs to set + * rates. It will copy a struct ieee80211_node_txrate with the + * current rate configuration to use. + * + * @param ni the ieee80211_node to return the transmit rate for + * @param txrate the struct ieee80211_node_txrate to copy to the node + */ +void +ieee80211_node_set_txrate(struct ieee80211_node *ni, + const struct ieee80211_node_txrate *txr) +{ + MPASS(ni != NULL); + MPASS(txr != NULL); + + ni->ni_txrate = *txr; +} + /** * @brief set the dot11rate / ratecode representing the current transmit rate * @@ -3240,6 +3260,26 @@ ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *ni, ni->ni_txrate.dot11rate = IEEE80211_RATE_MCS | mcs; } +/** + * @brief set the rate to the given VHT transmission rate. + * + * This sets the current transmit rate to the given VHT NSS/MCS. + * + * @param ni the ieee80211_node to set the transmit rate for + * @param nss the number of spatial streams + * @param mcs the MCS rate to select + */ +void +ieee80211_node_set_txrate_vht_rate(struct ieee80211_node *ni, + uint8_t nss, uint8_t mcs) +{ + MPASS(ni != NULL); + + ni->ni_txrate.type = IEEE80211_NODE_TXRATE_VHT; + ni->ni_txrate.mcs = mcs; + ni->ni_txrate.nss = nss; + ni->ni_txrate.dot11rate = 0; +} /* * @brief Fetch the transmit rate for the given node in kbit/s. diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 969d8e563fa9..ae5f72a070b6 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -521,8 +521,12 @@ void ieee80211_getsignal(struct ieee80211vap *, int8_t *, int8_t *); uint8_t ieee80211_node_get_txrate_dot11rate(struct ieee80211_node *); void ieee80211_node_get_txrate(struct ieee80211_node *, struct ieee80211_node_txrate *); +void ieee80211_node_set_txrate(struct ieee80211_node *, + const struct ieee80211_node_txrate *); void ieee80211_node_set_txrate_dot11rate(struct ieee80211_node *, uint8_t); void ieee80211_node_set_txrate_ht_mcsrate(struct ieee80211_node *, uint8_t); uint32_t ieee80211_node_get_txrate_kbit(struct ieee80211_node *); +void ieee80211_node_set_txrate_vht_rate(struct ieee80211_node *ni, + uint8_t nss, uint8_t mcs); #endif /* _NET80211_IEEE80211_NODE_H_ */