hl_get_sw_ma...nor_subminor(9)
π 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 thehl_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 π«Άβ¨:
hl_fw_version_cmp(9)extract_u32_until_given_char(9)hl_get_preboot_major_minor(9)hl_release_firmware(9)hl_fw_copy_fw_to_device(9)hl_fw_copy_msg_to_device(9)hl_fw_load_fw_to_device(9)hl_fw_send_cpu_message(9)hl_fw_preboot_update_state(9)hl_fw_dynamic_report_error_status(9)hl_fw_dynamic_send_cmd(9)hl_fw_dynamic_extract_fw_response(9)hl_fw_dynamic_wait_for_status(9)hl_fw_dynamic_send_clear_cmd(9)hl_fw_dynamic_send_protocol_cmd(9)hl_fw_compat_crc32(9)hl_fw_dynamic_validate_memory_bound(9)hl_fw_dynamic_validate_descriptor(9)hl_fw_dynamic_read_and_validate_descriptor(9)hl_fw_dynamic_request_descriptor(9)hl_fw_dynamic_read_device_fw_version(9)hl_fw_dynamic_copy_image(9)hl_fw_dynamic_copy_msg(9)hl_fw_boot_fit_update_state(9)hl_fw_dynamic_load_image(9)hl_fw_linux_update_state(9)hl_fw_dynamic_send_msg(9)hl_fw_dynamic_init_cpu(9)hl_fw_static_init_cpu(9)hl_fw_init_cpu(9)
like, the whole firmware squad showed up. we love a full roster π§π
friendly reminder bestie:fw_strhas to match one of those two formats, and the return is0on 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
- 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