summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-07-11 19:28:08 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-07-11 19:28:08 +0000
commit61e49873a08c765ee03bcf5ade4e9f14c87a3ba9 (patch)
treeb7e5df8cb43fa971261d2cf22b121cc90c9ac36d /sys
parent945ace6394fde5451cc5794edc65b0447dc52f19 (diff)
Cache a pointer to the scsibus_softc rather than hoping the copy in
sc->sc_link is preserved by the nefarious forces outside of the adapter code.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ami.c7
-rw-r--r--sys/dev/ic/amivar.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c
index 23b2b5afe92..2572f21f2aa 100644
--- a/sys/dev/ic/ami.c
+++ b/sys/dev/ic/ami.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ami.c,v 1.246 2020/07/11 15:26:15 krw Exp $ */
+/* $OpenBSD: ami.c,v 1.247 2020/07/11 19:28:07 krw Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -544,7 +544,8 @@ ami_attach(struct ami_softc *sc)
saa.saa_sc_link = &sc->sc_link;
- config_found(&sc->sc_dev, &saa, scsiprint);
+ sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa,
+ scsiprint);
/* can't do bioctls, sensors, or pass-through on broken devices */
if (sc->sc_flags & AMI_BROKEN)
@@ -2390,7 +2391,7 @@ ami_create_sensors(struct ami_softc *sc)
/* check if this is the scsibus for the logical disks */
ssc = (struct scsibus_softc *)dev;
- if (ssc->adapter_link == &sc->sc_link)
+ if (ssc == sc->sc_scsibus)
break;
}
diff --git a/sys/dev/ic/amivar.h b/sys/dev/ic/amivar.h
index 21cafc33392..c2929967e59 100644
--- a/sys/dev/ic/amivar.h
+++ b/sys/dev/ic/amivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amivar.h,v 1.58 2010/06/23 04:53:53 dlg Exp $ */
+/* $OpenBSD: amivar.h,v 1.59 2020/07/11 19:28:07 krw Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -87,6 +87,7 @@ struct ami_softc {
struct device sc_dev;
void *sc_ih;
struct scsi_link sc_link;
+ struct scsibus_softc *sc_scsibus;
int sc_flags;
#define AMI_CHECK_SIGN 0x0001