scsi_execute_cmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« scsi_execute_cmd(9) πŸ’«

okay so bestie, welcome to the Kernel API Manual β€” this one's a kernel-API girly and honestly she's kind of a big deal. Let's get into it ✨


🌸 NAME 🌸

scsi_execute_cmd β€” insert request and wait for the result

like, you yeet the request in and then you wait. main character behavior fr πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int scsi_execute_cmd (struct scsi_device *sdev , const unsigned char
*cmd , blk_opf_t opf , void *buffer , unsigned int bufflen , int timeout
, int ml_retries , const struct scsi_exec_args *args );

πŸŽ€ ARGUMENTS πŸŽ€

  • sdev β€” the scsi_device. the whole reason we're here 🫢
  • cmd β€” the scsi command. iconic, necessary
  • opf β€” block layer request cmd_flags. flags girlies rise
  • buffer β€” data buffer. hold the data bestie
  • bufflen β€” len of buffer. yes, that's the length. of the buffer. 😭
  • timeout β€” request timeout in HZ. don't let it wait forever ngl
  • ml_retries β€” number of times SCSI midlayer will retry request. she's persistent ✨
  • args β€” Optional args. See struct definition for field descriptions. optional but lowkey important πŸ‘€

πŸ’– DESCRIPTION πŸ’–

Returns the scsi_cmnd result field if a command was executed, or a negative Linux error code if we didn't get that far.

so like β€” if it actually ran, you get the scsi_cmnd result field. if we never even got that far, you get a negative Linux error code instead. vibe check failed, basically πŸ’€


⭐ SEE ALSO ⭐

Kernel file ./drivers/scsi/scsi_lib.c β€” and here's the whole friend group, no cap:


ok that's the whole page bestie, go forth and execute commands responsibly πŸ§šβ€β™€οΈ

mwah πŸ’‹ this page lives in ./drivers/scsi and it's stamped October 2026 β€” scsi_execute_cmd(9) out. periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from