summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/trm.c22
-rw-r--r--sys/dev/ic/trm.h4
-rw-r--r--sys/dev/pci/trm_pci.c17
3 files changed, 20 insertions, 23 deletions
diff --git a/sys/dev/ic/trm.c b/sys/dev/ic/trm.c
index 9d226e2d6a1..941cdc7274f 100644
--- a/sys/dev/ic/trm.c
+++ b/sys/dev/ic/trm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trm.c,v 1.39 2020/02/15 18:02:00 krw Exp $
+/* $OpenBSD: trm.c,v 1.40 2020/07/02 13:29:20 krw Exp $
* ------------------------------------------------------------
* O.S : OpenBSD
* File Name : trm.c
@@ -74,8 +74,6 @@ u_int8_t trm_get_data(bus_space_tag_t, bus_space_handle_t, u_int8_t);
void trm_wait_30us(bus_space_tag_t, bus_space_handle_t);
-void trm_scsi_cmd(struct scsi_xfer *);
-
void *trm_srb_alloc(void *);
void trm_DataOutPhase0(struct trm_softc *, struct trm_scsi_req_q *, u_int8_t *);
@@ -125,17 +123,6 @@ void trm_timeout(void *);
void trm_print_info(struct trm_softc *, struct trm_dcb *);
/*
- * Define structures
- */
-struct cfdriver trm_cd = {
- NULL, "trm", DV_DULL
-};
-
-struct scsi_adapter trm_switch = {
- trm_scsi_cmd, NULL, NULL, NULL, NULL
-};
-
-/*
* ------------------------------------------------------------
*
* stateV = (void *) trm_SCSI_phase0[phase]
@@ -2412,13 +2399,6 @@ trm_initACB(struct trm_softc *sc, int unit)
}
}
- 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;
-
trm_reset(sc);
}
diff --git a/sys/dev/ic/trm.h b/sys/dev/ic/trm.h
index 8b0317b3f91..027a57648d0 100644
--- a/sys/dev/ic/trm.h
+++ b/sys/dev/ic/trm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: trm.h,v 1.5 2020/02/06 19:17:54 krw Exp $
+/* $OpenBSD: trm.h,v 1.6 2020/07/02 13:29:20 krw Exp $
* ------------------------------------------------------------
* O.S : OpenBSD
* File Name : trm.h
@@ -527,5 +527,7 @@ struct trm_adapter_nvram
int trm_Interrupt(void *);
int trm_init(struct trm_softc *, int);
+void trm_scsi_cmd(struct scsi_xfer *);
+
#endif /* trm_h */
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 */