Update to PR206199
Actually, the code tries to find a 'next' (fallback) rate, which will be used if transmission on the current rate fails; the code will be incorrect, when HT support will be added to the driver (but currently it should 'just work').
rix is the 'rate' index in ni->ni_rates.rs_rates table; since rates are sorted, the previous (or current if 'rix' is 0) should be fine as a fallback candidate.
Ok looks like bwi doesn't need.
I don't know too much about bwn(4).
Given we have hard coded mapping tables with a limited set of 'rates' according to bwn_hwrate2ieeerate() and bwn_ieeerate2hwrate() would it make sense to manually code a "one lower than this" table? I cannot see where we set the custom (limited) list of rates. bwn_addchannels() seems to add a lot more if I am not mistaken?
Yeah, we should have a fallback rate function in net80211.
Why? Just to make sure that you're using the previously /negotiated/ rate, all the way back down to the lowest basic rate. Eg, you may not actually be allowed to use CCK 1Mbit rate according to the AP.
the atheros rate control code does this and it .. is wrong ;(