scsi_add_single_device(9)
β¨ scsi_add_single_device(9) β¨
okay so bestie, welcome to the scsi_add_single_device page from the Kernel API Manual π
no cap, this one's a little cutie β it's the function that answers when a user asks the kernel to go find a SCSI device. let's get into it π«Ά
πΈ SYNOPSIS πΈ
int scsi_add_single_device (uint host , uint channel , uint id , uint lun );
four uint args, one int coming back at you. slay β¨
π ARGUMENTS π
hostβ a user-supplied decimal integer, periodt.channelβ a user-supplied decimal integer, fr fr.idβ a user-supplied decimal integer, no cap.lunβ a user-supplied decimal integer, iconic.
like yes they're all the same description, that's literally what the page says and we respect it π all four are decimal integers that came from the user.
π DESCRIPTION π
so the way this gets called is lowkey iconic: the user writes "scsi add-single-device" to /proc/scsi/scsi, and that's what triggers it. iykyk π¦
once it's in there, it does a scsi_host_lookup, and then it's giving two possible paths:
- it calls
user_scanif that transport type supports it π₯ - or else it falls back to
scsi_scan_host_selectedβ¨
either way, the device gets probed/added. main character energy honestly π
β NOTE β
heads up bestie β this seems to be aimed exclusively at SCSI parallel busses. like, that's the vibe check and it passed π
πΈ SEE ALSO πΈ
go look at the kernel file ./drivers/scsi/scsi_proc.c first, and then the whole friend group:
struct scsi_proc_entry(9)scsi_template_proc_dir(9)scsi_proc_hostdir_add(9)scsi_proc_hostdir_rm(9)scsi_proc_host_add(9)scsi_proc_host_rm(9)proc_print_scsidevice(9)scsi_remove_single_device(9)proc_scsi_write(9)proc_scsi_open(9)scsi_init_procfs(9)scsi_exit_procfs(9)
π«Ά and that's the whole page!! this one lives out of ./drivers/scsi, dated October 2026 β so when you see that version/date in the footer, that's just the page being its cute self. mwah π go add some devices bestie β¨π
π¦ 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