diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -519,6 +519,8 @@ * 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 *); diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -3171,6 +3171,24 @@ } } +/** + * @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) +{ + + *txr = ni->ni_txrate; +} + /** * @brief set the dot11rate / ratecode representing the current transmit rate *