I have pulled that code into the function ieee80211_rssadapt_choose
so that I can re-use it in ath(4), atw(4), and in other drivers.
In rssadapt(9), I have also created a struct ieee80211_rssadapt_expavgctl
that contains parameters for rate adaptation. When IEEE80211_RSSADAPT_DEBUG
is enabled, I will using sysctl to expose an ieee80211_rssadapt_expavgctl
for each wireless device.
Also in rssadapt(9), I have introduced an interpolate() macro which
makes the exponential-averaging code more compact.