summaryrefslogtreecommitdiffstats
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1994-01-29 10:30:41 +0000
committerrgrimes <rgrimes@FreeBSD.org>1994-01-29 10:30:41 +0000
commita3e76b107d028854c76e23751c764a554a0cceac (patch)
treed86ec8739b84cc647c8c5bd6e85c4a14d66c646a /sys/scsi/scsi_base.c
parentf0a631d52235cfabec2ccc253ed0cbeae0e78571 (diff)
downloadFreeBSD-src-a3e76b107d028854c76e23751c764a554a0cceac.zip
FreeBSD-src-a3e76b107d028854c76e23751c764a554a0cceac.tar.gz
Patch from Julian. Commit message by me.
cd.c: Initialize channel info in CDIOCSETVOL ioctl. Correct CDIOCSTOP and CDIOCEJCET ioctls to use scsi_stop_unit instead of scsi_start_unit. Add CDIOCALLOW and CDIOCPREVENT ioctls. ch.h: Return EBUSY instead of ENXIO if the device is already in use. scsi_base.c: Add scsi_stop_unit routine. sd.c: Add mising indirection through sc_link to sd_get_parms routine when checking for media loaded. st.c: Return EBUSY instead of ENXIO if the device is already in use. Clear the SDEV_WAITING flag in ststart if we do the wakeup call.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 39b1baf..22b826f 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -8,7 +8,7 @@
* file.
*
* Written by Julian Elischer (julian@dialix.oz.au)
- * $Id: scsi_base.c,v 1.3 1993/12/19 00:54:50 wollman Exp $
+ * $Id: scsi_base.c,v 1.4 1994/01/14 16:25:29 davidg Exp $
*/
#define SPLSD splbio
@@ -293,6 +293,34 @@ scsi_start_unit(sc_link, flags)
0,
0,
2,
+ 2000,
+ NULL,
+ flags));
+}
+
+/*
+ * Get scsi driver to send a "stop" command
+ */
+errval
+scsi_stop_unit(sc_link, eject, flags)
+ struct scsi_link *sc_link;
+ u_int32 eject;
+ u_int32 flags;
+{
+ struct scsi_start_stop scsi_cmd;
+
+ bzero(&scsi_cmd, sizeof(scsi_cmd));
+ scsi_cmd.op_code = START_STOP;
+ if (eject) {
+ scsi_cmd.how = SSS_LOEJ;
+ }
+
+ return (scsi_scsi_cmd(sc_link,
+ (struct scsi_generic *) &scsi_cmd,
+ sizeof(scsi_cmd),
+ 0,
+ 0,
+ 2,
6000,
NULL,
flags));
OpenPOWER on IntegriCloud