es58x_parse_sw_version(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– es58x_parse_sw_version(9) πŸ’–

okay so bestie, this one's from the Kernel API Manual and it's literally about digging the version numbers out of a USB string. buckle up πŸŽ€


✨ NAME ✨

es58x_parse_sw_version β€” extracts the boot loader or firmware version, that's the whole gig πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int es58x_parse_sw_version (struct es58x_device *es58x_dev , const char
*prod_info , const char *prefix );

yeah it takes three things and gives you back an int, no cap ✨


🌸 ARGUMENTS 🌸

  • es58x_dev β€” your ES58X device, the main character of this whole function 🫢
  • prod_info β€” the USB custom string that the device itself hands back to you, like a lil note it wrote
  • prefix β€” this one picks which info gets parsed. set it to "FW" for the firmware version, or to "BL" for the bootloader version. that's it, that's the switch πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

so the prod_info string is lowkey a little soup πŸ“ β€” it's got the firmware version and the bootloader version in there, all prefixed by a magic string and concatenated with other numbers. it's giving chaos but it's fine.

depending on the device, the firmware (bootloader) format is either:

  • "FW_Vxx.xx.xx" (or "BL_Vxx.xx.xx")
  • "FW:xx.xx.xx" (or "BL:xx.xx.xx")

where x is a digit, obviously πŸ’…

and prod_info must contain the common part of those prefixes: "FW" or "BL". like, the actual shared bit, not the whole fancy thing.

then it parses prod_info and stores the version number in es58x_dev.firmware_version or es58x_dev.bootloader_version β€” which one depends on the prefix value you passed in. iconic behaviour, honestly 🌈


πŸ”₯ RETURN πŸ”₯

  • zero on success β€” slay, we got it πŸŽ‰
  • -EINVAL if prefix contains an invalid value β€” bestie, you sent the wrong word 😭
  • -EBADMSG if prod_info could not be parsed β€” the string said nope πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

go read the whole friend group, they're all connected fr fr 🧚


ngl if you're calling this and ignoring the return value, the version might just silently stay stale. vibe check your error handling, bestie πŸ™ˆ

mwah πŸ’– that's the whole page! brought to you from ./drivers/net/can/usb/etas_es58x, dated October 2026 β€” catch you in the next manpage, bestie! πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from