STRUCT IL_TFD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct il_tfd(9) β€” Kernel API Manual energy ✨

okay bestie, so this is a page from the Kernel API Manual (the struct il_tfd(9) one, yes that's the whole vibe) and we're gonna get you so comfy with it. no cap, this is genuinely a slay little data structure. let's go 🫢


🌸 NAME 🌸

struct il_tfd β€” and that's literally it, the description slot is empty, she said "no thoughts, head empty." πŸ’€ iconic honestly.


✨ SYNOPSIS ✨

struct il_tfd {
    u8 __reserved1[3];
    u8 num_tbs;
    struct il_tfd_tb tbs[IL_NUM_OF_TBS];
    __le32 __pad;
 };

bestie, copy that exactly, do not freestyle it πŸ™ˆ


πŸŽ€ Members πŸŽ€

the manpage puts a Members heading right here, but there's no separate member list under it β€” all the member deets live in the Description block below. so keep scrolling, she's all there πŸ’–


πŸ¦‹ Description πŸ¦‹

so what is this? it's a Transmit Frame Descriptor (TFD). main character of the Tx path, honestly πŸ‘‘

here's the member breakdown, one by one:

  • __reserved1[3] β€” reserved. hands off, it's not yours πŸ’…
  • num_tbs β€” bits 0-4 = number of active tbs; bit 5 = reserved; bits 6-7 = padding (not used). yes, it's bit-packed, she's compact like that ✨
  • tbs[20] β€” the transmit frame buffer descriptors πŸŽ€
  • __pad β€” padding. that's it. that's the whole job 😌

now the actual tea β˜•

each Tx queue uses a circular buffer of 256 TFDs stored in host DRAM. both the driver and the device share these circular buffers, and each one must be contiguous β€” 256 TFDs x 128 bytes-per-TFD = 32 KBytes. the math is mathing, we love to see it 🧚

the driver must indicate the physical address of the base of each circular buffer via the FH49_MEM_CBBC_QUEUE registers. that's a hard requirement, not a suggestion, so don't skip it πŸ™

each TFD contains pointer/size information for up to 20 data buffers in host DRAM. those buffers collectively contain the (one) frame described by the TFD β€” yes, one frame, many buffers. each buffer must be a single contiguous block of memory within itself, but buffers may be scattered in host DRAM. so it's giving "organized chaos" 🌈

each buffer has a max size of (4K - 4). and it concatenates all of a TFD's buffers into a single Tx frame, up to 8 KBytes in size. periodt πŸ”₯

⚠️ and the plot twist, bestie: a maximum of 255 (not 256!) TFDs may be on a queue waiting for Tx. not 256. 255. don't do it. the manpage is literally yelling at us, respect it πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./drivers/net/wireless/intel/iwlegacy/common.h and honestly a whole friend group of structs and functions, all (9):

struct il_device_cmd(9), struct il_device_cmd_huge(9), struct il_rx_queue(9), struct il_ht_agg(9), struct il_vif_priv(9), struct il_hw_params(9), struct il_cfg(9), il_clear_driver_stations(9), il_sta_id_or_broadcast(9), il_queue_inc_wrap(9), il_queue_dec_wrap(9), il_beacon_time_mask_low(9), il_beacon_time_mask_high(9), struct il_rb_status(9), struct il_tfd_tb(9), struct il_rate_scale_data(9), struct il_scale_tbl_info(9), struct il_lq_sta(9), il3945_rate_scale_init(9)

go read them, bestie, iykyk πŸ’œ


and that's the page!! 🌟 this cutie came from ./drivers/net/wireless/intel/i... and it's dated October 2026, footer vibes being struct il_tfd(9) β€” so like, cite her properly if you quote her πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from