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

Toke Høiland-Jørgensen toke at redhat.com
Tue Oct 1 05:09:30 EDT 2019


Johannes Berg <johannes at sipsolutions.net> writes:

> 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?

Yeah. I only remembered to make it a ULL constant later, and forgot to
remove the cast. But I guess this should be using do_div() anyway...

-Toke



More information about the Make-wifi-fast mailing list