summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_ioctl.c
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1997-04-14 04:09:18 +0000
committerJason Downs <downsj@cvs.openbsd.org>1997-04-14 04:09:18 +0000
commit3237113ee6497bdf81974f24d03b6e5d1eaf6d47 (patch)
tree084de2514e030d0657a3c675a6f90f1a5f811a00 /sys/scsi/scsi_ioctl.c
parent7e3f93e1b77c8f4cf6793193e29fc7ac401f5b4a (diff)
Merge in various pieces of current NetBSD scsi code, including but not limited
to: * New changer driver. * Better optical support. * Different `done' semantics. * New quirks for SCSI QIC tape driver, SCSI floppy drives. * Better support for SCSI-I devices. Everybody needs to test this.
Diffstat (limited to 'sys/scsi/scsi_ioctl.c')
-rw-r--r--sys/scsi/scsi_ioctl.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c
index c9c5625dd44..f1fc067dff8 100644
--- a/sys/scsi/scsi_ioctl.c
+++ b/sys/scsi/scsi_ioctl.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: scsi_ioctl.c,v 1.6 1996/08/13 00:06:24 niklas Exp $ */
-/* $NetBSD: scsi_ioctl.c,v 1.20 1996/02/14 21:47:22 christos Exp $ */
+/* $OpenBSD: scsi_ioctl.c,v 1.7 1997/04/14 04:09:11 downsj Exp $ */
+/* $NetBSD: scsi_ioctl.c,v 1.23 1996/10/12 23:23:17 christos Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@@ -46,6 +46,7 @@
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/device.h>
+#include <sys/fcntl.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -289,6 +290,16 @@ scsi_do_ioctl(sc_link, dev, cmd, addr, flag, p)
SC_DEBUG(sc_link, SDEV_DB2, ("scsi_do_ioctl(0x%lx)\n", cmd));
+ /* Check for the safe-ness of this request. */
+ switch (cmd) {
+ case SCIOCIDENTIFY:
+ break;
+
+ default:
+ if ((flag & FWRITE) == 0)
+ return EBADF;
+ }
+
switch(cmd) {
case SCIOCCOMMAND: {
scsireq_t *screq = (scsireq_t *)addr;