summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-11-25 22:28:55 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-11-25 22:28:55 +0000
commitdbb5f4cd4dea6d160a44e1f16c75bf47ec1625a5 (patch)
tree608c729f190670e6c583bfbd5dffc58bcd26e81e /sys/scsi
parent88b7bfd8f80bb0f30eeb353499f8caf283c0d92e (diff)
dont use the adapter_softc member of scsi_link as a softc anymore. the
"adapter_softc" is simply a way for the adapter to determine what scsibus it is now dealing with, not a pointer back to the adapters device struct. ok deraadt@ marco@
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/scsi_base.c6
-rw-r--r--sys/scsi/scsiconf.c3
-rw-r--r--sys/scsi/scsiconf.h4
3 files changed, 9 insertions, 4 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index d4355114148..e95064c63d9 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.123 2007/09/16 01:30:24 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.124 2007/11/25 22:28:53 dlg Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -1171,10 +1171,12 @@ scsi_interpret_sense(struct scsi_xfer *xs)
void
sc_print_addr(struct scsi_link *sc_link)
{
+ struct device *adapter_device = sc_link->bus->sc_dev.dv_parent;
+
printf("%s(%s:%d:%d): ",
sc_link->device_softc ?
((struct device *)sc_link->device_softc)->dv_xname : "probe",
- ((struct device *)sc_link->adapter_softc)->dv_xname,
+ adapter_device->dv_xname,
sc_link->target, sc_link->lun);
}
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index b2c4e367216..101228588d6 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.127 2007/11/06 02:49:19 krw Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.128 2007/11/25 22:28:54 dlg Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -149,6 +149,7 @@ scsibusattach(struct device *parent, struct device *self, void *aux)
if (!cold)
scsi_autoconf = 0;
+ sc_link_proto->bus = sb;
sc_link_proto->scsibus = sb->sc_dev.dv_unit;
sb->adapter_link = sc_link_proto;
if (sb->adapter_link->adapter_buswidth == 0)
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index 09f16d14adf..6dd5ff63549 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.87 2007/06/23 19:19:49 krw Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.88 2007/11/25 22:28:54 dlg Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -88,6 +88,7 @@
struct buf;
struct scsi_xfer;
struct scsi_link;
+struct scsibus_softc;
/*
* Temporary hack
@@ -175,6 +176,7 @@ struct scsi_link {
void *device_softc; /* needed for call to foo_start */
struct scsi_adapter *adapter; /* adapter entry points etc. */
void *adapter_softc; /* needed for call to foo_scsi_cmd */
+ struct scsibus_softc *bus; /* link to the scsibus we're on */
struct scsi_inquiry_data inqdata; /* copy of INQUIRY data from probe */
};