STRUCT IWL_TXQ(9)
okay bestie, let's talk about struct iwl_txq(9) from the kernel API manual π
So like, this is a Tx Queue for DMA, and it's giving main character energy in the wireless driver world. Let me walk you through every single detail so you're not out here looking clueless, okay? π«Ά
β¨ SYNOPSIS β¨
struct iwl_txq {
void *tfds;
struct iwl_pcie_first_tb_buf *first_tb_bufs;
dma_addr_t first_tb_dma;
struct iwl_pcie_txq_entry *entries;
spinlock_t lock;
spinlock_t reclaim_lock;
unsigned long frozen_expiry_remainder;
struct timer_list stuck_timer;
struct iwl_trans *trans;
bool need_update;
bool frozen;
bool ampdu;
int block;
unsigned long wd_timeout;
struct sk_buff_head overflow_q;
struct iwl_dma_ptr bc_tbl;
int write_ptr;
int read_ptr;
dma_addr_t dma_addr;
int n_window;
u32 id;
int low_mark;
int high_mark;
bool overflow_tx;
};
πΈ MEMBERS πΈ
okay so every single one of these matters, no skipping, periodt π
tfdsβ transmit frame descriptors, and yes they live in DMA memory. iconic.first_tb_bufsβ start of command headers, including scratch buffers, for the writeback. This is DMA memory and an array holding one buffer for each command on the queue. she's fancy like that β¨first_tb_dmaβ the DMA address for thefirst_tb_bufsstart. literally just the address, nbd.entriesβ transmit entries, a.k.a. driver state. you know, the behind-the-scenes stuff πlockβ queue lock. don't touch without it.reclaim_lockβ reclaim lock. also important, also don't touch.frozen_expiry_remainderβ remember how long until the timer fires. it's giving "notes app reminder" energy.stuck_timerβ timer that fires if queue gets stuck. lowkey the drama detector πtransβ pointer back to transport (for timer). she needs to know where she came from.need_updateβ indicates need to update read/write index. simple as that.frozenβ tx stuck queue timer is frozen. like paused, not cold.ampduβtrueif this queue is an ampdu queue for a specific RA/TID. iykyk.blockβ queue is blocked. rude but necessary.wd_timeoutβ queue watchdog timeout (jiffies) β per queue. keep an eye on it.overflow_qβ overflow queue for handling frames that didn't fit on HW queue. the "spill the tea" queue, honestly πbc_tblβ byte count table of the queue (relevant only for gen2 transport). gen2 girlies only.write_ptrβ 1st empty entry (index)host_w. yes, that's the name.read_ptrβ last used entry (index)host_r. matching set, cute.dma_addrβ physical addr for BDs. not virtual, don't get it twisted.n_windowβ safe queue window. the comfy zone πidβ queue id. everyone has one.low_markβ low watermark, resume queue if free space more than this. wake her up when there's room.high_markβ high watermark, stop queue if free space less than this. hit the brakes, bestie.overflow_txβ need to transmit from overflow. when the overflow queue gets its moment π₯
π DESCRIPTION π
So a Tx queue consists of a circular buffer of BDs (a.k.a. TFDs, transmit frame descriptors) and required locking structures. That's the whole vibe.
Now pay attention, because this part is lowkey the most important thing on the page:
Note the difference betweenTFD_QUEUE_SIZE_MAXandn_window: the hardware always assumes 256 descriptors, soTFD_QUEUE_SIZE_MAXis always 256 (unless there might be HW changes in the future). For the normal TX queues,n_window, which is the size of the software queue data, is also 256; however, for the command queue,n_windowis only 32 since we don't need so many commands pending. Since the HW still uses 256 BDs for DMA though,TFD_QUEUE_SIZE_MAXstays 256.
This means that we end up with the following:
HW entries: | 0 | ... | N * 32 | ... | N * 32 + 31 | ... | 255 |
SW entries: | 0 | ... | 31 |
where N is a number between 0 and 7. This means that the SW data is a window overlaid over the HW queue. no cap, that's literally how it works πβ¨
π SEE ALSO π
okay bestie, here's the whole friend group β go check them out, they're all part of the same kernel file ./drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/internal.h:
struct iwl_rx_mem_buffer(9)struct iwl_rx_transfer_desc(9)struct iwl_rx_completion_desc(9)struct iwl_rx_completion_desc_bz(9)struct iwl_rxq(9)struct iwl_rb_allocator(9)iwl_get_closed_rb_stts(9)enum iwl_fw_mon_dbgfs_state(9)enum iwl_shared_irq_flags(9)enum iwl_image_response_code(9)struct cont_rec(9)enum iwl_pcie_imr_status(9)struct iwl_pcie_txqs(9)struct iwl_trans_pcie(9)iwl_txq_inc_wrap(9)iwl_txq_dec_wrap(9)
okay that's the whole page, bestie! this one came from ./drivers/net/wireless/intel/i... and it's dated October 2026, and it's all about struct iwl_txq(9). slay π
β¨ππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms