diff --git a/sys/dev/scsipi/sd.c b/sys/dev/scsipi/sd.c index d234fb037e33..72e10949915d 100644 --- a/sys/dev/scsipi/sd.c +++ b/sys/dev/scsipi/sd.c @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.85 1996/01/12 22:43:33 thorpej Exp $ */ +/* $NetBSD: sd.c,v 1.86 1996/01/30 18:24:47 thorpej Exp $ */ /* * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. @@ -713,6 +713,14 @@ sdioctl(dev, cmd, addr, flag, p) sd->flags &= ~SDF_WLABEL; return 0; + case DIOCLOCK: + return scsi_prevent(sd->sc_link, + (*(int *)addr) ? PR_PREVENT : PR_ALLOW, 0); + + case DIOCEJECT: + return ((sd->sc_link->flags & SDEV_REMOVABLE == 0) ? ENOTTY : + scsi_start(sd->sc_link, SSS_STOP|SSS_LOEJ, 0)); + default: if (SDPART(dev) != RAW_PART) return ENOTTY; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index d234fb037e33..72e10949915d 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.85 1996/01/12 22:43:33 thorpej Exp $ */ +/* $NetBSD: sd.c,v 1.86 1996/01/30 18:24:47 thorpej Exp $ */ /* * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. @@ -713,6 +713,14 @@ sdioctl(dev, cmd, addr, flag, p) sd->flags &= ~SDF_WLABEL; return 0; + case DIOCLOCK: + return scsi_prevent(sd->sc_link, + (*(int *)addr) ? PR_PREVENT : PR_ALLOW, 0); + + case DIOCEJECT: + return ((sd->sc_link->flags & SDEV_REMOVABLE == 0) ? ENOTTY : + scsi_start(sd->sc_link, SSS_STOP|SSS_LOEJ, 0)); + default: if (SDPART(dev) != RAW_PART) return ENOTTY;