STRUCT FW_PHY_NC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct fw_phy_nc

okay so bestie, this is a page straight out of the Kernel API Manual and it's about struct fw_phy_nc β€” a little struct that lowkey runs the whole show for the RTL_FW_PHY_NC firmware. The layout is genuinely iconic because it's not just the struct, it's a whole sandwich:

<struct fw_phy_nc> + <info> + <firmware data>

so like the struct, then the info, then the firmware data. in that order. periodt. ✨


πŸ¦‹ SYNOPSIS

struct fw_phy_nc {
    struct fw_block blk_hdr;
    __le16 fw_offset;
    __le16 fw_reg;
    __le16 ba_reg;
    __le16 ba_data;
    __le16 patch_en_addr;
    __le16 patch_en_value;
    __le16 mode_reg;
    __le16 mode_pre;
    __le16 mode_post;
    __le16 reserved;
    __le16 bp_start;
    __le16 bp_num;
    __le16 bp[4];
    char info[];
};

look at her. char info[] at the end with the flexible array moment β€” main character energy fr fr. πŸ’…


πŸŽ€ Members

  • blk_hdr β€” the firmware descriptor (it's got the type and the length, the lil ID card of the block).
  • fw_offset β€” the offset of the firmware binary data. wanna know where the data actually starts? it's the address of struct fw_phy_nc + fw_offset. math girlie behaviour.
  • fw_reg β€” the register you use to load the firmware. depends on chip, so don't come for me if it's not what you expected. 🫢
  • ba_reg β€” the register where you write the base address. also depends on chip.
  • ba_data β€” the base address itself. yep, chip-dependent again.
  • patch_en_addr β€” the register for enabling patch mode. chip-dependent, obviously. 🌸
  • patch_en_value β€” the patch mode enabled mask. this one depends on the firmware, not the chip β€” iykyk.
  • mode_reg β€” the register for switching the mode.
  • mode_pre β€” the mode that needs to be set before loading the firmware. pre-game ritual, literally.
  • mode_post β€” the mode you set when you're done loading the firmware. cool-down era.
  • reserved β€” reserved space. unused. she's just vibing there, taking up room, we respect her. πŸ™ˆ
  • bp_start β€” the start register of the break points. chip-dependent.
  • bp_num β€” the number of break points that need to be set for this firmware. firmware-dependent.
  • bp β€” the break points. depends on the firmware, bestie.
  • info β€” extra info for debugging, and it's followed by the binary data of the firmware. so she's not the end of the struct, she's the doorway to the data. πŸ’€

πŸ‘‘ SEE ALSO

go look at the kernel file ./drivers/net/usb/r8152.c β€” that's where the lore lives. also check out these iconic siblings:

  • struct fw_block(9)
  • struct fw_header(9)
  • struct fw_mac(9)
  • struct fw_phy_patch_key(9)

and that's the whole page, bestie πŸ’– this came from ./drivers/net/usb, dated October 2026, and it's filed under struct fw_phy_nc(9) β€” slay, go read the source, ily, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from