hl_get_preboot_major_minor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hl_get_preboot_major_minor(9) β€” Kernel API Manual, bestie edition ✨

okay so this is a kernel API manual page, and honestly? it's a little cutie. it lives in the 9 section (kernel API, iykyk), and it's all about reading the firmware's version number out of a string. let's get into it πŸŽ€


🌸 NAME 🌸

hl_get_preboot_major_minor β€” pull the FW's version major and minor out of the version string. that's it, that's the whole job, and it does it immaculately πŸ’…


✨ SYNOPSIS ✨

int hl_get_preboot_major_minor (struct hl_device *hdev , char
*preboot_ver );

yes the signature is literally that. int going in, int coming out, two args, no cap. πŸ¦‹


🫢 ARGUMENTS 🫢

  • hdev β€” pointer to the hl_device. your main character struct, fr fr. it's where the extracted version numbers get stashed.
  • preboot_ver β€” the FW's version string. the raw text we're about to dissect. πŸ”₯

🌈 DESCRIPTION 🌈

so preboot_ver is expected to be in the format <major>.<minor>.<sub minor>*, like for example:

42.0.1-sec-3

look at that. iconic. πŸ“

the extracted version gets set into the hdev fields: fw_inner_{major/minor}_ver. so yeah, after this runs, your device struct is holding the major and minor, all cozy in there. periodt. πŸ’œ

lowkey important: that format is expected, and the * on the end of <sub minor>* means there can be extra stuff trailing after the sub minor β€” like that -sec-3 in the example. don't come at it with a naked 42.0 and expect the world, okay? πŸ™ˆ

⭐ RETURN ⭐

  • 0 on success β€” slay, we're done here πŸŽ‰
  • negative error code for failure β€” not slay, something went sideways 😭

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file where the magic happens:

./drivers/accel/habanalabs/common/firmware_if.c

and a whole friend group of related functions, all listed here because we do not skip anybody in this house 🫢:

like, the whole firmware squad showed up. obsessed. πŸ’–


and that's the page!! this one came out of ./drivers/accel/habanalabs/common, dated October 2026, and it's filed as hl_get_preboot_major_minor(9). go forth and parse those version strings, bestie πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from