The branch main has been updated by adrian:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0da0a5fc73e66c8839ebc8455dd12a9c3c273d5a

commit 0da0a5fc73e66c8839ebc8455dd12a9c3c273d5a
Author:     Adrian Chadd <adr...@freebsd.org>
AuthorDate: 2025-01-13 02:13:51 +0000
Commit:     Adrian Chadd <adr...@freebsd.org>
CommitDate: 2025-02-26 19:29:52 +0000

    net80211: add ieee80211_node_get_txrate() to populate the "new" transmit 
struct
    
    ieee80211_node_get_txrate() populates the passed-in ieee80211_node_txrate 
with
    the current rate configuration.
    
    This is a no-op - nothing is yet setting VHT rates.
    
    Differential Revision:  https://reviews.freebsd.org/D48605
    Reviewed by:    bz
---
 sys/net80211/ieee80211_node.c | 20 ++++++++++++++++++++
 sys/net80211/ieee80211_node.h |  2 ++
 2 files changed, 22 insertions(+)

diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 01f7c8904237..c781280d5e8a 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -3171,6 +3171,26 @@ ieee80211_node_get_txrate_dot11rate(struct 
ieee80211_node *ni)
        }
 }
 
+/**
+ * @brief return the txrate representing the current transmit rate
+ *
+ * This is the API call for drivers and rate control APIs to fetch
+ * rates.  It will populate 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 populate
+ */
+void
+ieee80211_node_get_txrate(struct ieee80211_node *ni,
+    struct ieee80211_node_txrate *txr)
+{
+       MPASS(ni != NULL);
+       MPASS(txr != NULL);
+
+       *txr = ni->ni_txrate;
+}
+
 /**
  * @brief set the dot11rate / ratecode representing the current transmit rate
  *
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h
index 859b8b0288a1..bb14c8c4bb42 100644
--- a/sys/net80211/ieee80211_node.h
+++ b/sys/net80211/ieee80211_node.h
@@ -519,6 +519,8 @@ void        ieee80211_getsignal(struct ieee80211vap *, 
int8_t *, int8_t *);
  * This should eventually be refactored into its own type.
  */
 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_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 *);

Reply via email to