[Make-wifi-fast] [PATCH RFC/RFT 2/4] mac80211: Add API function to set the last TX bitrate for a station

Johannes Berg johannes at sipsolutions.net
Tue Oct 1 04:46:30 EDT 2019


On Thu, 2019-09-19 at 14:22 +0200, Toke Høiland-Jørgensen wrote:

Given a ULL constant:

> +/* constants for calculating reciprocals to avoid division in fast path */
> +#define IEEE80211_RECIPROCAL_DIVISOR 0x100000000ULL

[...]

> +void ieee80211_sta_set_last_tx_bitrate(struct ieee80211_sta *pubsta,
> +				       u32 rate)
> +{
> +	struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
> +
> +	sta->last_tx_bitrate = rate;
> +	sta->last_tx_bitrate_reciprocal = ((u64)IEEE80211_RECIPROCAL_DIVISOR / rate);

that cast seems unnecessary?

johannes



More information about the Make-wifi-fast mailing list