summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-07-05 20:17:26 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-07-05 20:17:26 +0000
commit694656f66d5eeb2b1275f06488ace57c813f2f0e (patch)
treee22e0a17e906a5f84a6784cbd9e77820677f950e
parentb2f74e37793918132b02e9da1a7b2c3f63e8d698 (diff)
Nuke struct scsi_link's "scsibus" member. The two drivers using it
(ahc(4) and qlw(4)) can just compare the values of the "bus" member directly. A slightly different path to the same result that matthew@ traversed in his work culminating in scsiconf.h r1.146.
-rw-r--r--sys/dev/eisa/ahc_eisa.c8
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.h4
-rw-r--r--sys/dev/ic/qlw.c4
-rw-r--r--sys/dev/pci/ahc_pci.c8
-rw-r--r--sys/scsi/scsiconf.c3
-rw-r--r--sys/scsi/scsiconf.h3
6 files changed, 14 insertions, 16 deletions
diff --git a/sys/dev/eisa/ahc_eisa.c b/sys/dev/eisa/ahc_eisa.c
index d6f4017a50b..f658eac26aa 100644
--- a/sys/dev/eisa/ahc_eisa.c
+++ b/sys/dev/eisa/ahc_eisa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahc_eisa.c,v 1.21 2012/05/12 21:54:39 miod Exp $ */
+/* $OpenBSD: ahc_eisa.c,v 1.22 2020/07/05 20:17:25 krw Exp $ */
/* $NetBSD: ahc_eisa.c,v 1.10 1996/10/21 22:30:58 thorpej Exp $ */
/*
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ahc_eisa.c,v 1.21 2012/05/12 21:54:39 miod Exp $
+ * $Id: ahc_eisa.c,v 1.22 2020/07/05 20:17:25 krw Exp $
*/
#include <sys/param.h>
@@ -184,9 +184,9 @@ void *aux;
/*
* SCSI_IS_SCSIBUS_B() must returns false until sc_channel_b
- * has been properly initialized. XXX Breaks if >254 scsi buses.
+ * has been properly initialized.
*/
- ahc->sc_channel_b.scsibus = 0xff;
+ ahc->sc_channel_b.bus = NULL;
ahc->channel = 'A';
ahc->chip = AHC_AIC7770|AHC_EISA;
diff --git a/sys/dev/ic/aic7xxx_openbsd.h b/sys/dev/ic/aic7xxx_openbsd.h
index 8b3f26afd05..963daca5841 100644
--- a/sys/dev/ic/aic7xxx_openbsd.h
+++ b/sys/dev/ic/aic7xxx_openbsd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.h,v 1.27 2017/12/12 12:33:36 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.h,v 1.28 2020/07/05 20:17:25 krw Exp $ */
/* $NetBSD: aic7xxx_osm.h,v 1.7 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -87,7 +87,7 @@
/****************************** Platform Macros *******************************/
#define SCSI_IS_SCSIBUS_B(ahc, sc_link) \
- ((sc_link)->scsibus == (ahc)->sc_channel_b.scsibus)
+ (((sc_link)->bus != NULL) && ((sc_link)->bus == (ahc)->sc_channel_b.bus))
#define SCSI_SCSI_ID(ahc, sc_link) \
(SCSI_IS_SCSIBUS_B(ahc, sc_link) ? ahc->our_id_b : ahc->our_id)
#define SCSI_CHANNEL(ahc, sc_link) \
diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c
index 4b59d38da5a..215a3804724 100644
--- a/sys/dev/ic/qlw.c
+++ b/sys/dev/ic/qlw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlw.c,v 1.37 2020/06/27 17:28:58 krw Exp $ */
+/* $OpenBSD: qlw.c,v 1.38 2020/07/05 20:17:25 krw Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -129,7 +129,7 @@ void qlw_dump_iocb_segs(struct qlw_softc *, void *, int);
static inline int
qlw_xs_bus(struct qlw_softc *sc, struct scsi_xfer *xs)
{
- return ((xs->sc_link->scsibus == sc->sc_link[0].scsibus) ? 0 : 1);
+ return ((xs->sc_link->bus == sc->sc_link[0].bus) ? 0 : 1);
}
static inline u_int16_t
diff --git a/sys/dev/pci/ahc_pci.c b/sys/dev/pci/ahc_pci.c
index 6ccb019e6e2..7908a181924 100644
--- a/sys/dev/pci/ahc_pci.c
+++ b/sys/dev/pci/ahc_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahc_pci.c,v 1.57 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: ahc_pci.c,v 1.58 2020/07/05 20:17:25 krw Exp $ */
/* $NetBSD: ahc_pci.c,v 1.43 2003/08/18 09:16:22 taca Exp $ */
/*
@@ -42,7 +42,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: ahc_pci.c,v 1.57 2015/03/14 03:38:48 jsg Exp $
+ * $Id: ahc_pci.c,v 1.58 2020/07/05 20:17:25 krw Exp $
*
* //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#57 $
*
@@ -737,9 +737,9 @@ ahc_pci_attach(parent, self, aux)
/*
* SCSI_IS_SCSIBUS_B() must returns false until sc_channel_b
- * has been properly initialized. XXX Breaks if >254 scsi buses.
+ * has been properly initialized.
*/
- ahc->sc_channel_b.scsibus = 0xff;
+ ahc->sc_channel_b.bus = NULL;
ahc->dev_softc = pa;
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index 812a22d2091..87744c0ed12 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.224 2020/06/30 18:43:37 krw Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.225 2020/07/05 20:17:25 krw Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -142,7 +142,6 @@ scsibusattach(struct device *parent, struct device *self, void *aux)
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)
sb->adapter_link->adapter_buswidth = 8;
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index 64b7f771776..f3330a759c5 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.189 2020/06/30 18:43:37 krw Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.190 2020/07/05 20:17:25 krw Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -284,7 +284,6 @@ struct scsi_link {
u_int state;
#define SDEV_S_DYING (1<<1)
- u_int8_t scsibus; /* the Nth scsibus */
u_int8_t luns;
u_int16_t target; /* targ of this dev */
u_int16_t lun; /* lun of this dev */