For QoS/WMM (EDCA) mac80211 needs driver to have at least four queues. It will then program the queues according to the advertised access parameters.
mac80211 will use the queues as follows:
AC |
queue |
BK |
3 |
BE |
2 |
VI |
1 |
VO |
0 |
802.11 uses the following number scheme (cf. Table 7-36)
AC |
ACI [binary] (AC index [decimal]) |
BK |
01 (1) |
BE |
00 (0) |
VI |
10 (2) |
VO |
11 (3) |
Therefore, we have:
AC |
ACI |
queue |
BK |
01 |
3 |
BE |
00 |
2 |
VI |
10 |
1 |
VO |
11 |
0 |
Due to internal collisions (we don't really know what this means either) the queue numbering is important, and queue 0 is highest priority, 3 lowest. If your hardware has a different idea of queue priority, you may need to rewrite the queue number, but make sure to do it everywhere mac80211 passes a queue number (conf_tx, skb_get_queue_mapping).
The user priority is used as follows (802.11-2007 table 9-1):
UP |
AC |
1 |
BK |
2 |
BK |
0 |
BE |
3 |
BE |
4 |
VI |
5 |
VI |
6 |
VO |
7 |
VO |
mac80211 determines the UP based on the IP TOS field, unless the packet priority is set to 256..263 with setsockopt(SO_PRIORITY), in which case this maps directly to the UP (priority - 256) for testing.