Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/dev/scsipi Pull up revision 1.170 (requested by exp...
details: https://anonhg.NetBSD.org/src/rev/8b7a2237e864
branches: netbsd-1-5
changeset: 490842:8b7a2237e864
user: he <he%NetBSD.org@localhost>
date: Sun Mar 11 22:25:30 2001 +0000
description:
Pull up revision 1.170 (requested by explorer):
Fix a problem with some Hitachi drives by only issuing the ``lock
media'' and ``unlock media'' commands to removable media.
diffstat:
sys/dev/scsipi/sd.c | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diffs (44 lines):
diff -r de72726b87ce -r 8b7a2237e864 sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c Sun Mar 11 22:23:08 2001 +0000
+++ b/sys/dev/scsipi/sd.c Sun Mar 11 22:25:30 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sd.c,v 1.163 2000/06/09 08:54:26 enami Exp $ */
+/* $NetBSD: sd.c,v 1.163.2.1 2001/03/11 22:25:30 he Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -411,11 +411,14 @@
sc_link->flags |= SDEV_OPEN;
- /* Lock the pack in. */
- error = scsipi_prevent(sc_link, PR_PREVENT,
- XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_MEDIA_CHANGE);
- if (error)
- goto bad;
+ if (sd->sc_link->flags & SDEV_REMOVABLE) {
+ /* Lock the pack in. */
+ error = scsipi_prevent(sc_link, PR_PREVENT,
+ XS_CTL_IGNORE_ILLEGAL_REQUEST
+ | XS_CTL_IGNORE_MEDIA_CHANGE);
+ if (error)
+ goto bad;
+ }
if ((sc_link->flags & SDEV_MEDIA_LOADED) == 0) {
sc_link->flags |= SDEV_MEDIA_LOADED;
@@ -528,8 +531,12 @@
scsipi_wait_drain(sd->sc_link);
- scsipi_prevent(sd->sc_link, PR_ALLOW,
- XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_NOT_READY);
+ if (sd->sc_link->flags & SDEV_REMOVABLE) {
+ scsipi_prevent(sd->sc_link, PR_ALLOW,
+ XS_CTL_IGNORE_ILLEGAL_REQUEST
+ | XS_CTL_IGNORE_NOT_READY);
+ }
+
sd->sc_link->flags &= ~SDEV_OPEN;
if (! (sd->sc_link->flags & SDEV_KEEP_LABEL))
Home |
Main Index |
Thread Index |
Old Index