MAC80211 SOFTWARE TX QUEUEING(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mac80211 software tx queueing πŸ’…

okay so bestie, you're on the mac80211 so... tx queueing(9) page from the Kernel API Manual, and it is genuinely giving "intermediate queues that keep the hardware from spiraling" ✨. mac80211 uses an intermediate queueing implementation, designed to let the driver keep hardware queues short and to provide some fairness between different stations/interfaces. slay.

Drivers must provide the .wake_tx_queue driver operation β€” either link it to ieee80211_handle_wake_tx_queue or implement a custom handler. no cap, that part is mandatory 🫢.

The intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, plus another per-sta queue for non-data/non-mgmt and bufferable management frames, plus a single per-vif queue for multicast data frames. the way that's organized? obsessed πŸŽ€.

Drivers are expected to initialize their private per-queue data for stations and interfaces in the .add_interface and .sta_add ops. πŸ’–

The driver can't access the internal TX queues (iTXQs) directly. Whenever mac80211 adds a new frame to a queue, it calls the .wake_tx_queue driver op. Drivers implementing a custom .wake_tx_queue op can get them by calling ieee80211_tx_dequeue. Drivers using ieee80211_handle_wake_tx_queue will simply get the individual frames pushed via the .tx driver operation. iykyk πŸ’….

Drivers can optionally delegate responsibility for scheduling queues to mac80211, to take advantage of airtime fairness accounting. In this case, to obtain the next queue to pull frames from, the driver calls ieee80211_next_txq. The driver is then expected to return the txq using ieee80211_return_txq. that's the whole loop, bestie πŸ”.

For AP powersave TIM handling, the driver only needs to indicate if it has buffered packets in the driver specific data structures by calling ieee80211_sta_set_buffered. For frames buffered in the ieee80211_txq struct, mac80211 sets the appropriate TIM PVB bits and calls .release_buffered_frames. In that callback the driver is therefore expected to release its own buffered frames and afterwards also frames from the ieee80211_txq (obtained via the usual ieee80211_tx_dequeue). periodt πŸ’–.


🌈 SEE ALSO 🌈

bestie, if you wanna fall down the kernel-doc rabbit hole, every single linked page is right here β€” not a crumb left out πŸ“:

made with πŸ’– from source/version ./include/net, dated October 2026 β€” that's the mac80211 so... tx queueing(9) page in the Kernel API Manual, bestie. go forth and queue responsibly 🫢.

πŸ“¦ where this page comes from