scsi_report_opcode(9)
πΈ scsi_report_opcode(9) πΈ
okay bestie, welcome to the Kernel API Manual β specifically the page for scsi_report_opcode(9). this one's short and sweet, so let's get into it π
β¨ NAME β¨
scsi_report_opcode β find out if a given command is supported π΅οΈββοΈ
π¦ SYNOPSIS π¦
int scsi_report_opcode (struct scsi_device *sdev , unsigned char *buffer , unsigned int len , unsigned char opcode , unsigned short sa );
π ARGUMENTS π
sdevβ the scsi device you're querying, like, the one you want the tea from π«bufferβ a scratch buffer. and she must be at least20bytes long, no exceptions bestie π€lenβ the length ofbuffer(yes, you have to tell it β it's not psychic)opcodeβ the opcode of the command you're looking up πsaβ the service action for the command you're looking up
π DESCRIPTION π
so the way this works is it uses REPORT SUPPORTED OPERATION CODES to check whether the command identified by opcode and sa is supported. iconic, love that for us.
quick note tho: if the command doesn't have a service action, then sa must be 0 β like, that's the rule, no cap π
and here's the return vibe check:
- returns
-EINVALif RSOC fails π - returns
0if the command is not supported π - returns
1if the device claims to support the command π (claims!! we're taking its word for it, bestie)
π SEE ALSO π
kernel file ./drivers/scsi/scsi.c β and literally the whole friend group:
scsi_finish_command(9)scsi_change_queue_depth(9)scsi_track_queue_full(9)scsi_vpd_inquiry(9)scsi_get_vpd_page(9)scsi_get_vpd_buf(9)scsi_attach_vpd(9)scsi_cdl_check(9)scsi_cdl_enable(9)scsi_device_get(9)scsi_device_put(9)starget_for_each_device(9)__starget_for_each_device(9)__scsi_device_lookup_by_target(9)scsi_device_lookup_by_target(9)__scsi_device_lookup(9)scsi_device_lookup(9)
ngl, this whole page lives in ./drivers/scsi β that's her address, that's her home π‘
and that's the whole page, bestie! sign-off time: this one's from ./drivers/scsi, dated October 2026, and it's scsi_report_opcode(9) through and through. slay, study it, periodt πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms