summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-11-13 02:39:46 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-11-13 02:39:46 +0000
commit1769ad36a1a2afc078d261b3d5becd1a22256870 (patch)
treef464efaff846238d89f0167458d6b18b891330df /sys
parentf8bfa9101fc44bd4dd9f5719786bdba80fff40ea (diff)
Use scsi_delay() instead of delay() when waiting for scsi disk to
become ready. Make verbiage SC_DEBUG(). ok dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/scsi_base.c3
-rw-r--r--sys/scsi/scsiconf.h3
-rw-r--r--sys/scsi/sd.c14
3 files changed, 8 insertions, 12 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 97566fafc2c..badb63d741a 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.94 2005/11/07 23:49:32 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.95 2005/11/13 02:39:45 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -58,7 +58,6 @@ static __inline void asc2ascii(u_int8_t, u_int8_t ascq, char *result,
size_t len);
int sc_err1(struct scsi_xfer *);
int scsi_interpret_sense(struct scsi_xfer *);
-int scsi_delay(struct scsi_xfer *, int);
char *scsi_decode_sense(struct scsi_sense_data *, int);
/* Values for flag parameter to scsi_decode_sense. */
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index da6330b2920..b659a7de5bb 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.61 2005/09/11 17:34:27 krw Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.62 2005/11/13 02:39:45 krw Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -359,6 +359,7 @@ void show_scsi_cmd(struct scsi_xfer *);
void show_mem(u_char *, int);
int scsi_probe_busses(int, int, int);
void scsi_strvis(u_char *, u_char *, int);
+int scsi_delay(struct scsi_xfer *, int);
static __inline void _lto2b(u_int32_t val, u_int8_t *bytes);
static __inline void _lto3b(u_int32_t val, u_int8_t *bytes);
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 8d74761bdd1..4238caa2f34 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.96 2005/11/07 23:49:32 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.97 2005/11/13 02:39:45 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -1104,15 +1104,11 @@ sd_interpret_sense(xs)
return (EJUSTRETURN);
switch (sense->add_sense_code_qual) {
- case 0x01:
- printf("%s: ..is spinning up...waiting\n", sd->sc_dev.dv_xname);
- /*
- * I really need a sdrestart function I can call here.
- */
- delay(1000000 * 5); /* 5 seconds */
- retval = ERESTART;
+ case 0x01: /* In process of becoming ready. */
+ SC_DEBUG(sc_link, SDEV_DB1, ("becoming ready.\n"));
+ retval = scsi_delay(xs, 5);
break;
- case 0x02:
+ case 0x02: /* Initialization command required. */
if (sd->sc_link->flags & SDEV_REMOVABLE) {
printf("%s: removable disk stopped - not restarting\n",
sd->sc_dev.dv_xname);