scsi_mode_sense(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scsi_mode_sense β€” the kernel API manual, bestie edition πŸŽ€

okay so real talk, this is scsi_mode_sense(9), a page from the Kernel API Manual, and it is genuinely about issuing a mode sense β€” and, icon behavior, it falls back from ten bytes to six bytes if it has to. lowkey resilient. we stan a flexible king πŸ‘‘


✨ SYNOPSIS ✨

int scsi_mode_sense (struct scsi_device *sdev , int dbd , int modepage ,
int subpage , unsigned char *buffer , int len , int timeout , int
retries , struct scsi_mode_data *data , struct scsi_sense_hdr *sshdr );

like, ten arguments. ten. she's high maintenance but she delivers πŸ’… and yes, that signature is copied exactly, do not come for me.


🌸 ARGUMENTS 🌸

okay bestie, here's the whole lineup, every single one, no skipping:

  • sdev β€” the SCSI device we're querying. the main character of this operation 🫢
  • dbd β€” set this bad boy to prevent mode sense from returning block descriptors. it's giving "no block descriptors, please" πŸ™ˆ
  • modepage β€” which mode page you're requesting. like ordering off a menu, but scarier.
  • subpage β€” the sub-page of the mode page you requested. yes there's a sub-level, it's very inception πŸ’«
  • buffer β€” your request buffer. heads up: it may not be smaller than eight bytes. eight! that's the floor, no exceptions, she will not budge ⚠️
  • len β€” length of the request buffer. (yes, the period is in the original, we keep the period, periodt πŸ’€)
  • timeout β€” command timeout, i.e. how long we're willing to sit here waiting and hoping ✨
  • retries β€” number of retries before failing. how many chances we give it before we accept reality 😭
  • data β€” returns a structure abstracting the mode header data. she returns things. a giver πŸ’–
  • sshdr β€” where to put the sense data (or NULL if no sense is to be collected). must be SCSI_SENSE_BUFFERSIZE big β€” no cap, that's a hard requirement, do not mess with the sizing πŸ”₯

πŸ¦‹ DESCRIPTION πŸ¦‹

Returns zero if successful, or a negative error number on failure. that's it, that's the whole description. iconic minimalism honestly. zero = slay, negative = not slay πŸ’€


πŸ‘‘ SEE ALSO πŸ‘‘

this list is LONG and we are NOT skipping a single one, so buckle up bestie, they're all living in the kernel file ./drivers/scsi/scsi_lib.c:

like, forty-ish functions. she has a LOT of friends, and honestly? good for her 🌈


okay that's the whole page, you made it, I'm so proud 🫢 this one lives in ./drivers/scsi and it's dated October 2026, so go forth and mode sense responsibly, bestie. mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from