diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-07-01 05:11:19 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-07-01 05:11:19 +0000 |
commit | 470720b3f65a90bd25915bbbe67b9fd17a29d38f (patch) | |
tree | 4a651dbe72b4a3e17480d015f9b34b877585e356 /sys/scsi/ch.c | |
parent | d4b4fc44c12bd5709aa833bc1f4322dcefd077ce (diff) |
Die struct scsi_device! Die! Instead, save a pointer to the routine
to interpret sense errors. This is initialized to the basic
interpretation routine, and specific scsi drivers (sd/st/cd) can
replace this with their own. While here kill EJUSTRETURN dance and
make more specialized interpretation routines directly call the
basic routine if desired.
Fixes by matthew@ to my first diff. Most original work by dlg@.
ok matthew@ marco@ dlg@
Diffstat (limited to 'sys/scsi/ch.c')
-rw-r--r-- | sys/scsi/ch.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index 47da62265b1..6a9b82ab874 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ch.c,v 1.39 2010/06/26 23:24:45 guenther Exp $ */ +/* $OpenBSD: ch.c,v 1.40 2010/07/01 05:11:18 krw Exp $ */ /* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */ /* @@ -119,14 +119,6 @@ int ch_get_params(struct ch_softc *, int); int ch_interpret_sense(struct scsi_xfer *xs); void ch_get_quirks(struct ch_softc *, struct scsi_inquiry_data *); -/* SCSI glue */ -struct scsi_device ch_switch = { - ch_interpret_sense, - NULL, - NULL, - NULL -}; - /* * SCSI changer quirks. */ @@ -167,7 +159,7 @@ chattach(parent, self, aux) /* Glue into the SCSI bus */ sc->sc_link = link; - link->device = &ch_switch; + link->interpret_sense = ch_interpret_sense; link->device_softc = sc; link->openings = 1; @@ -765,7 +757,7 @@ ch_interpret_sense(xs) if (((sc_link->flags & SDEV_OPEN) == 0) || (serr != SSD_ERRCODE_CURRENT && serr != SSD_ERRCODE_DEFERRED)) - return (EJUSTRETURN); /* let the generic code handle it */ + return (scsi_interpret_sense(xs)); switch (skey) { @@ -792,9 +784,9 @@ ch_interpret_sense(xs) xs->retries++; return (scsi_delay(xs, 1)); default: - return (EJUSTRETURN); + return (scsi_interpret_sense(xs)); } default: - return (EJUSTRETURN); + return (scsi_interpret_sense(xs)); } } |