VSCSI(4)
okay bestie, welcome to VSCSI(4) from the Kernel Interfaces Manual β it's giving virtual SCSI controller realness and I'm literally obsessed π β¨
π NAME π
vscsi β virtual SCSI controller π¦
β¨ SYNOPSIS β¨
vscsi0 at root
#include <sys/types.h>
#include <sys/ioctl.h>
#include <scsi/scsi_all.h>
#include <dev/vscsivar.h>
π DESCRIPTION π
okay so the vscsi device is the middle bestie between the kernel SCSI midlayer and userland: it takes commands from the kernel SCSI midlayer and makes them available to userland for handling. Using this interface it is possible to implement virtual SCSI devices that are usable by the kernel. no cap.
These ioctl(2) commands are how userland dequeues SCSI commands and replies to them:
VSCSI_I2Tstruct vscsi_ioc_i2t *β dequeue a SCSI command. If no SCSI commands are available to dequeue,ioctl(2)will fail and seterrnotoEAGAIN.
When one or more SCSI commands are available to dequeue, select(2) will indicate the descriptor as ready to read.
struct vscsi_ioc_i2t {
int tag;
u_int target;
u_int lun;
struct scsi_generic cmd;
size_t cmdlen;
size_t datalen;
int direction;
#define VSCSI_DIR_NONE 0
#define VSCSI_DIR_READ 1
#define VSCSI_DIR_WRITE 2
};
VSCSI_DATA_READstruct vscsi_ioc_data *andVSCSI_DATA_WRITEstruct vscsi_ioc_data *β read or write data in response to a SCSI command identified bytag.
struct vscsi_ioc_data {
int tag;
void * data;
size_t datalen;
};
VSCSI_T2Istruct vscsi_ioc_t2i *β signal completion of a SCSI command identified bytag.
struct vscsi_ioc_t2i {
int tag;
int status;
#define VSCSI_STAT_DONE 0
#define VSCSI_STAT_SENSE 1
#define VSCSI_STAT_RESET 2
#define VSCSI_STAT_ERR 3
struct scsi_sense_data sense;
};
VSCSI_REQPROBEstruct vscsi_ioc_devevent *andVSCSI_REQDETACHstruct vscsi_ioc_devevent *β request a probe or a detach of the device at the addresses specified by thetargetandlunfields.
struct vscsi_ioc_devevent {
u_int target;
u_int lun;
};
ποΈ FILES ποΈ
/dev/vscsi0β the path, right there, periodt π
π SEE ALSO π
go read these too bestie: ioctl(2), intro(4), scsi(4) β all iconic, fr fr.
πΈ HISTORY πΈ
The vscsi driver first appeared in OpenBSD 4.5 β¨
π AUTHORS π
David Gwynne <dlg@openbsd.org>. ty king π«Ά
mwah π this page is from the Debian edition, dated September 12, 2017, and it's literally the VSCSI(4) manual β bye bestie π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2008 David Gwynne <dlg@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms