STRUCT FW_MAC(9)
πΈ struct fw_mac(9) β the Kernel API Manual, but make it make sense πΈ
okay bestie, welcome to struct fw_mac(9) β this is a page from the kernel API manual, and it's literally all about one struct. no cap, that's the whole vibe.
β¨ NAME β¨
struct fw_mac β a firmware block used by RTL_FW_PLA and RTL_FW_USB. and the layout of the firmware block is, in this exact order:
<struct fw_mac> + <info> + <firmware data>
so it's giving "header, then little info note, then the actual firmware goodies" π
π SYNOPSIS π
here's the whole struct, character for character, don't touch:
struct fw_mac {
struct fw_block blk_hdr;
__le16 fw_offset;
__le16 fw_reg;
__le16 bp_ba_addr;
__le16 bp_ba_value;
__le16 bp_en_addr;
__le16 bp_en_value;
__le16 bp_start;
__le16 bp_num;
__le16 bp[16];
__le32 reserved;
__le16 fw_ver_reg;
u8 fw_ver_data;
char info[];
};
the way this is just a whole little neighborhood of fieldsβ¦ obsessed π«Ά
π¦ Members π¦
blk_hdrβ the firmware descriptor. it's got the type and the length, so like, the ID card of the block πͺͺfw_offsetβ the offset of the firmware binary data. the start address of that data would be the address ofstruct fw_mac+fw_offset. do the math, bestie β¨fw_regβ the register to load the firmware into. depends on chip, so no universal answer, iykyk.bp_ba_addrβ the register you write the break point base address to. depends on chip.bp_ba_valueβ the break point base address itself. depends on chip.bp_en_addrβ the register to write the break point enabled mask to. depends on chip.bp_en_valueβ the break point enabled mask. this one depends on the firmware, not the chip β main character energy tbh πbp_startβ the start register of the break points. depends on chip.bp_numβ the break point number that needs to be set for this firmware. depends on the firmware.bpβ the break points. depends on firmware. yes it's an array of16, and yes that's a lot of break points, slay πreservedβ reserved space. literally unused. it's just sitting there, vibing πfw_ver_regβ the register to store the fw version.fw_ver_dataβ the firmware version of the current type.infoβ additional information for debugging, and it's followed by the binary data of firmware. so it's the little gossip note right before the payload πΈ
quick vibe check: half these fields say "Depends on chip" and the other half say "Depends on the firmware." that's not me being vague, that's the actual documentation. don't @ me π
π SEE ALSO π
go look at the kernel file ./drivers/net/usb/r8152.c, plus these iconic siblings:
struct fw_block(9)struct fw_header(9)struct fw_phy_patch_key(9)struct fw_phy_nc(9)
and that's the page, bestie π it lives in ./drivers/net/usb, dated October 2026, from the kernel API manual's struct fw_mac(9) edition. go read your structs, ily, bye πβ¨
π¦ 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