scsi_sanitiz...quiry_string(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so bestie, gather round β€” scsi_sanitize_inquiry_string is literally the glow-up artist for your SCSI strings: it removes non-graphical chars from an INQUIRY result string. that's it, that's the whole job, and it does it flawlessly ✨


πŸŽ€ SYNOPSIS πŸŽ€

void scsi_sanitize_inquiry_string (unsigned char *s , int len );

🌸 ARGUMENTS 🌸

  • s β€” the INQUIRY result string that's about to get sanitized 🧼 like it's getting a whole makeover
  • len β€” the length of the string, aka how much of it we're cleaning up

πŸ’– DESCRIPTION πŸ’–

so the SCSI spec is very clear about this, no cap: INQUIRY vendor, product, and revision strings must consist entirely of graphic ASCII characters, padded on the right with spaces. that's the rule. that's the standard. iconic behavior only ✨

but πŸ’€ not all devices obey this rule. some of them are out here sending us the most unhinged bytes imaginable, and honestly? we're not mad, we're just gonna fix it. so we replace non-graphic or non-ASCII characters with spaces. simple as that, slay.

Exception, and this is important bestie: a NUL character is interpreted as a string terminator, so all the following characters are set to spaces. periodt. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file ./drivers/scsi/scsi_scan.c is the main character here, and it brought its whole friend group:


ngl if you're deep in ./drivers/scsi reading this, you're lowkey built different. go off πŸ‘‘

and that's the whole page, bestie πŸ“ this one came straight out of ./drivers/scsi β€” October 2026 energy, kernel API manual vibes, absolutely ate and left no crumbs πŸ’œβœ¨

πŸ“¦ where this page comes from