hl_get_sw_ma...nor_subminor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hl_get_sw_ma...nor_subminor(9) β€” like, the Kernel API Manual page, bestie πŸŽ€

okay so real talk, we're deep in the Kernel API Manual today and this one is literally about parsing a firmware version string. iykyk. it's giving "small function, big responsibility" energy and honestly? obsessed. ✨


🌸 NAME 🌸

hl_get_sw_major_minor_subminor β€” the icon that pulls the FW's SW version major, minor, and sub-minor out of the version string 🫢


⭐ SYNOPSIS ⭐

int hl_get_sw_major_minor_subminor (struct hl_device *hdev , const char
*fw_str );

no cap, that's the whole signature. keep it exactly like that πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • hdev β€” pointer to the hl_device. like, the device struct we're gonna write into. main character energy fr fr πŸ‘‘
  • fw_str β€” the FW's version string. the raw text we're about to dissect πŸ“

πŸ’œ DESCRIPTION πŸ’œ

so here's the vibe: the extracted version gets set in the hdev fields:

fw_sw_{major/minor/sub_minor}_ver

fw_str is expected to have one of two possible formats, examples:

1
2

In those examples, the SW major, minor, subminor are correspondingly: 1,9,0.

(yes bestie, that's the number drop πŸ’€ two formats, one truth, and the answer is 1,9,0. ate.)


πŸ”₯ RETURN πŸ”₯

0 for success or a negative error code for failure. that's it, that's the whole story. slay πŸ’…


🌈 SEE ALSO 🌈

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

and now the whole friend group, in order, no skipping anybody 🫢✨:

like, the whole firmware squad showed up. we love a full roster πŸ§šπŸ’–


friendly reminder bestie: fw_str has to match one of those two formats, and the return is 0 on success or a negative error code on failure β€” don't come for me if you skip that 😭

and that's the page!! brought to you from ./drivers/accel/habanalabs/common, dated October 2026 β€” mwah, drink water, and go parse some version strings πŸ’œπŸŽ€β­

πŸ“¦ where this page comes from