scsi_ioctl(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scsi_ioctl β€” like, the kernel API manual page, bestie

okay so this is scsi_ioctl(9) from the Kernel API Manual, and honestly? she's iconic, she's a little different from the other ioctls, and we're gonna get into all of it. grab a snack πŸ“


✨ NAME ✨

scsi_ioctl β€” dispatch ioctl to scsi device

like, she takes your ioctl and yeets it to the right scsi device. that's the whole job. main character energy fr fr πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

int scsi_ioctl (struct scsi_device *sdev , bool open_for_write , int cmd
, void __user *arg );

copy it exactly, don't @ me β€” the spacing in there is canon πŸ’€


🌸 ARGUMENTS 🌸

  • sdev β€” the scsi device receiving the ioctl. she's the one getting the message 🫢
  • open_for_write β€” is the file / block device opened for writing? yes/no, that's the whole vibe check here
  • cmd β€” which ioctl is it. like, which one. be specific 😭
  • arg β€” the data associated with the ioctl. what she's carrying in her little bag ✨

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the thing that makes scsi_ioctl lowkey special: it differs from most ioctls in that it does not take a major/minor number as the dev field. nope. not her.

rather, it takes a pointer to a struct scsi_device. that's it. that's the flex. instead of the usual dev-number situation, you hand her the actual struct scsi_device pointer and she's like "got it, say less" πŸ’…

ngl it's giving "different from the other girls" and I mean that in the best way πŸŽ€


πŸ”₯ RETURN πŸ”₯

varies depending on the cmd 😭😭

like... it literally varies. depends on which cmd you passed. no single answer, bestie. that's just how she is. check your specific cmd and act accordingly β€” no cap πŸ™ˆ


⭐ SEE ALSO ⭐

all of these are the girlies you should also be looking at, iykyk 🌈


🧚 sign-off 🧚

this lil page lives under ./drivers/scsi, dated October 2026 β€” that's the source/version and date, and yes I'm telling you about them instead of copy-pasting the footer line, because we're cute like that πŸ’–

now go dispatch some ioctls, you absolute icon β­πŸŽ€πŸ’…

πŸ“¦ where this page comes from