STRUCT IWL_CMD_HEADER(9)
π struct iwl_cmd_header β the short command header format, bestie
okay so this is struct iwl_cmd_header from the Kernel API Manual, and it's literally the little header that kicks off every command and every response in iwlwifi land. it's short, it's cute, it's iconic. let's get into it π
β¨ NAME β¨
struct iwl_cmd_header β the (short) command header format. yes bestie, "short" is doing real work in that sentence, we'll get to why π«Ά
πΈ SYNOPSIS πΈ
struct iwl_cmd_header {
u8 cmd;
u8 group_id;
__le16 sequence;
};
three little fields, one big vibe. no cap β¨
π¦ Members π¦
cmdβ the Command ID, likeREPLY_RXONand friends. this is the "what am I even doing" field πgroup_idβ the group ID, for commands that have groups. iykyk π₯sequenceβ the sequence number for the command. lowkey the most interesting one, so buckle up π
π§ the sequence field, explained
so the driver sets up the sequence number to values of its choosing. uCode does not use this value β but it does pass it back to the driver when it sends the response to each driver-originated command, so the driver can match the response to the command. it's giving "you dropped this, bestie" energy π«Ά
and since the values don't actually get used by uCode, the driver may set up an arbitrary format. literally whatever it wants. main character freedom π
there is one exception π β uCode sets bit 15 when it originates the response/notification, i.e. when the response/notification is not a direct response to a command sent by the driver. for example, uCode issues REPLY_RX when it sends a received frame to the driver; it is not a direct response to any driver command. so bit 15 is like the "this one's from me, not a reply" flag β¨
π and the Linux driver uses this format:
0:7 tfd index - position within TX queue 8:12 TX queue id
13:14 reserved 15 unsolicited RX or uCode-originated
notification
so: bits 0:7 are the tfd index (position within the TX queue), 8:12 are the TX queue id, 13:14 are reserved, and bit 15 is the unsolicited RX or uCode-originated notification bit. obsessed with how it's all packed in there π
π Description π
this header format appears at the beginning of each command sent from the driver, and each response/notification received from uCode. that's it, that's the whole gig β it shows up first, every single time. it's the opening act, and honestly? it ate π₯
β SEE ALSO β
- Kernel file
./drivers/net/wireless/intel/iwlwifi/fw/api/cmdhdr.h Host command section(9)struct iwl_cmd_header_wide(9)struct iwl_calib_res_notif_phy_db(9)struct iwl_phy_db_cmd(9)struct iwl_cmd_response(9)
go read them, bestie, they're all connected π¦
π sign-off π
and that's the page, fr fr π β this was struct iwl_cmd_header(9) from the Kernel API Manual, sourced from ./drivers/net/wireless/intel/i..., dated October 2026. ty for coming to my ted talk, mwah π
π
π¦ 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