Implement a generic TX rate control algorithm framework in 802.11 layer.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 1 Sep 2006 15:12:12 +0000 (15:12 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 1 Sep 2006 15:12:12 +0000 (15:12 +0000)
commitb9334f94acb26ea52b9d3333fa4289cceb91e937
treebb03ffae878074ce414296c7800a07cbdd171afa
parent45eff2e960b56c330f1cc764c2d9d5120053b659
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:
sbin/ifconfig/ifconfig.8
sbin/ifconfig/ifieee80211.c
sys/conf/files
sys/config/LINT
sys/i386/conf/LINT
sys/netproto/802_11/Makefile
sys/netproto/802_11/ieee80211.h
sys/netproto/802_11/ieee80211_ioctl.h
sys/netproto/802_11/ieee80211_node.h
sys/netproto/802_11/ieee80211_ratectl.h [new file with mode: 0644]
sys/netproto/802_11/ieee80211_var.h
sys/netproto/802_11/wlan/Makefile
sys/netproto/802_11/wlan/ieee80211.c
sys/netproto/802_11/wlan/ieee80211_ioctl.c
sys/netproto/802_11/wlan/ieee80211_node.c
sys/netproto/802_11/wlan/ieee80211_ratectl.c [new file with mode: 0644]
sys/netproto/802_11/wlan/ieee80211_ratectl_none.c [new file with mode: 0644]
sys/netproto/802_11/wlan_ratectl/Makefile [new file with mode: 0644]
sys/netproto/802_11/wlan_ratectl/amrr/Makefile [new file with mode: 0644]
sys/netproto/802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.c [new file with mode: 0644]
sys/netproto/802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.h [new file with mode: 0644]
sys/netproto/802_11/wlan_ratectl/onoe/Makefile [new file with mode: 0644]
sys/netproto/802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.c [new file with mode: 0644]
sys/netproto/802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.h [new file with mode: 0644]