Implement a generic TX rate control algorithm framework in 802.11 layer.
It is highly modulized so TX rate control algorithms can be added with ease.
Only limited interfaces are exported for driver to use, so most of the WiFi
drivers can be converted without too much trouble. It does not affect WiFi
drivers which are unaware of the new framework yet. Also, the new framework
allows TX rate control algorithm to be changed without touching the 802.11
state machine or reinitializing WiFi devices.
Two TX rate control algorithms are factored out from ath(4) driver:
1) Onoe TX rate control algorithm, which is suitable for almost any kinds of
WiFi NIC driver, especially for 11b devices. (*)
2) AMRR TX rate control algorithm, which should _only_ be used by the WiFi NIC
which supports multi-rate retry. More information of this TX rate control
algorithm is available at:
http://www-sop.inria.fr/rapports/sophia/RR-5208.html
In order to use the framework, individual WiFi driver needs to do following:
1) Tell the framework, which TX rate control algorithms it supports and which
one to be used as the default, by setting up ieee80211com.ic_ratectl.
2) Call ieee80211_ratectl_newstate() in driver's own newstate() function.
3) When set up hardware TX descriptors, which normally contain TX rate related
fields, instead of accessing ieee80211_node.ni_txrate directly, call
ieee80211_ratectl_findrate() to get a rate set from the framework.
4) When TX completes, feed TX state (e.g. failure, number of retries) to the
framework by calling ieee80211_ratectl_tx_complete().
Teach ifconfig(8) to print and set the TX rate control algorithm.
# (*) There is no formal paper for this algorithm, but following two papers
# have brief introduction of this TX rate control algorithm:
# http://www-sop.inria.fr/rapports/sophia/RR-5208.html
# http://www.pdos.lcs.mit.edu/papers/jbicket-ms.pdf
24 files changed: