STRUCT IL_TFD(9)
π
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β bits0-4= number of active tbs; bit5= reserved; bits6-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
- 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