summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-07-02 13:29:21 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-07-02 13:29:21 +0000
commitc81e6079859c9af397c26844f5b3b5c21548cadc (patch)
treea1e315c9e8a0de9619fcf83c70f21b339f756982 /sys/dev/pci
parent26b65ed3fb29c6a405a965245af8a35a8d439a8a (diff)
Shuffle things around so that sc->sc_link initialization is
done just before config_found(), as all other drivers do.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/trm_pci.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/pci/trm_pci.c b/sys/dev/pci/trm_pci.c
index f39f9a4d555..e95fadde6d0 100644
--- a/sys/dev/pci/trm_pci.c
+++ b/sys/dev/pci/trm_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trm_pci.c,v 1.6 2020/06/27 17:28:58 krw Exp $
+/* $OpenBSD: trm_pci.c,v 1.7 2020/07/02 13:29:20 krw Exp $
* ------------------------------------------------------------
* O.S : OpenBSD
* FILE NAME : trm_pci.c
@@ -65,6 +65,14 @@ struct cfattach trm_pci_ca = {
NULL, /* Activate */
};
+struct cfdriver trm_cd = {
+ NULL, "trm", DV_DULL
+};
+
+struct scsi_adapter trm_switch = {
+ trm_scsi_cmd, NULL, NULL, NULL, NULL
+};
+
/*
* ------------------------------------------------------------
@@ -153,6 +161,13 @@ trm_pci_attach(struct device *parent, struct device *self, void *aux)
if (intrstr != NULL)
printf(": %s\n", intrstr);
+ sc->sc_link.adapter_softc = sc;
+ sc->sc_link.adapter_target = sc->sc_AdaptSCSIID;
+ sc->sc_link.openings = 30; /* So TagMask (32 bit integer) always has space */
+ sc->sc_link.adapter = &trm_switch;
+ sc->sc_link.adapter_buswidth = ((sc->sc_config & HCC_WIDE_CARD) == 0) ? 8:16;
+ sc->sc_link.pool = &sc->sc_iopool;
+
saa.saa_sc_link = &sc->sc_link;
/* Tell SCSI layer about our SCSI bus */