From 34d1117610e5f64b215c411ca8f24ce52fcacfce Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Wed, 21 May 2003 23:43:59 +0000 Subject: Make sure that the first scsi command issued to a device during sdattach() has the flag SCSI_IGNORE_MEDIA_CHANGE set. This was not true for devices with the quirk SDEV_NOSTARTUNIT, such as some umass devices. This fixes the display of the disk parameters for any loaded media. Previously the displayed parameters would show 0 size, 0 sectors and a faked number of cylinders, etc. By ignoring the error generated by devices trying to tell us the media may have changed since the last command the SCSI command completes correctly and valid values are obtained/displayed. We are interested in the current values and unconcerned about any previous ones. Tested by drahn@. --- sys/scsi/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/scsi/sd.c') diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 46e19691539..90e6850c52e 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.60 2003/05/18 16:06:35 mickey Exp $ */ +/* $OpenBSD: sd.c,v 1.61 2003/05/21 23:43:58 krw Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -234,7 +234,7 @@ sdattach(parent, self, aux) result = SDGP_RESULT_OFFLINE; else result = (*sd->sc_ops->sdo_get_parms)(sd, &sd->params, - scsi_autoconf); + scsi_autoconf | SCSI_IGNORE_MEDIA_CHANGE); printf("%s: ", sd->sc_dev.dv_xname); switch (result) { -- cgit v1.2.3