summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2008-12-04 00:37:40 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2008-12-04 00:37:40 +0000
commitc3123110224a826de6e66f526ea7dec5d4b94852 (patch)
tree3d692076641a91bd4c0bec5720a0e87c36a58c66 /share
parentd51b0f668bb1d35879bdf8727f070485b284a819 (diff)
start documenting vscsi(4)
Diffstat (limited to 'share')
-rw-r--r--share/man/man4/Makefile3
-rw-r--r--share/man/man4/vscsi.4103
2 files changed, 105 insertions, 1 deletions
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 6101d2300fd..3f278c5b7a3 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.470 2008/11/29 02:13:57 deraadt Exp $
+# $OpenBSD: Makefile,v 1.471 2008/12/04 00:37:39 dlg Exp $
MAN= aac.4 ac97.4 acphy.4 \
acpi.4 acpiac.4 acpiasus.4 acpibat.4 acpibtn.4 acpicpu.4 acpidock.4 \
@@ -55,6 +55,7 @@ MAN= aac.4 ac97.4 acphy.4 \
urtw.4 usb.4 usbf.4 uscanner.4 uslcom.4 usscanner.4 uticom.4 uts.4 \
uts.4 uvideo.4 uvisor.4 uvscom.4 uyap.4 vga.4 vgafb.4 vge.4 \
viaenv.4 viapm.4 viasio.4 vic.4 video.4 vlan.4 vmt.4 vnd.4 vr.4 \
+ vscsi.4 \
watchdog.4 wb.4 wbenv.4 wbng.4 wbsio.4 wd.4 wdc.4 we.4 wi.4tbl wpi.4 \
wscons.4 wsdisplay.4 wskbd.4 wsmouse.4 wsmux.4 xe.4 xf86.4 xge.4 \
xl.4 xmphy.4 yds.4 ym.4 zero.4 zyd.4
diff --git a/share/man/man4/vscsi.4 b/share/man/man4/vscsi.4
new file mode 100644
index 00000000000..cb34d6544b9
--- /dev/null
+++ b/share/man/man4/vscsi.4
@@ -0,0 +1,103 @@
+.\" $OpenBSD: vscsi.4,v 1.1 2008/12/04 00:37:39 dlg Exp $
+.\"
+.\" Copyright (c) 2008 David Gwynne <dlg@openbsd.org>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: December 4 2008 $
+.Dt VSCSI 4
+.Os
+.Sh NAME
+.Nm vscsi
+.Nd Virtual SCSI controller
+.Sh SYNOPSIS
+.Cd "vscsi0 at root"
+.Cd "scsibus* at vscsi?"
+.Pp
+.Fd #include <sys/types.h>
+.Fd #include <sys/ioctl.h>
+.Fd #include <sys/scsi/scsi_all.h>
+.Fd #include <sys/dev/vscsivar.h>
+.Sh DESCRIPTION
+The
+.Nm
+device 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.
+.Sh IOCTLS
+The following
+.Xr ioctl 2
+commands are provided to allow userland to dequeue SCSI commands and reply to
+them:
+.Bl -tag -width Ds
+.It VSCSI_I2T (struct vscsi_ioc_i2t *)
+Dequeue a SCSI command.
+.Bd -literal
+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
+};
+.Ed
+.It VSCSI_DATA_READ (struct vscsi_ioc_data *)
+.It VSCSI_DATA_WRITE (struct vscsi_ioc_data *)
+Read or write data in response to a SCSI command identified by tag.
+.Bd -literal
+struct vscsi_ioc_data {
+ int tag;
+
+ void * data;
+ size_t datalen;
+};
+.Ed
+.It VSCSI_T2I (struct vscsi_ioc_t2i *)
+Signal completion of a SCSI command identified by tag.
+.Bd -literal
+struct vscsi_ioc_t2i {
+ int tag;
+
+ int status;
+#define VSCSI_STAT_DONE 0
+#define VSCSI_STAT_SENSE 1
+#define VSCSI_STAT_ERR 2
+ struct scsi_sense_data sense;
+ size_t senselen;
+};
+.Ed
+.Sh FILES
+.Bl -tag -width /dev/vscsi0
+.It Pa /dev/vscsi0
+.El
+.Sh SEE ALSO
+.Xr ioctl 2 ,
+.Xr intro 4 ,
+.Xr scsi 4 ,
+.Xr MAKEDEV 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Ox 4.5 .
+.Sh AUTHORS
+.An David Gwynne Aq dlg@openbsd.org .