summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2011-04-26 22:55:59 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2011-04-26 22:55:59 +0000
commit051ca5db44e93f5727c37f6e9897dcaf5656df1e (patch)
tree7bd9c35dc538f3b79f36f023f80623a843cec489 /sys/dev
parent718e2a1dacdcc46a1796f4aa71da45b006fa9d83 (diff)
No point in a per-attachment scsi_adapter; move to global dpt_switch
like we do in other SCSI drivers.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/dpt.c14
-rw-r--r--sys/dev/ic/dptvar.h3
2 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/ic/dpt.c b/sys/dev/ic/dpt.c
index 4d4e691c221..52dd9a00791 100644
--- a/sys/dev/ic/dpt.c
+++ b/sys/dev/ic/dpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dpt.c,v 1.31 2011/04/26 22:46:25 matthew Exp $ */
+/* $OpenBSD: dpt.c,v 1.32 2011/04/26 22:55:58 matthew Exp $ */
/* $NetBSD: dpt.c,v 1.12 1999/10/23 16:26:33 ad Exp $ */
/*-
@@ -86,6 +86,11 @@ struct cfdriver dpt_cd = {
void *dpt_ccb_alloc(void *);
void dpt_ccb_free(void *, void *);
+struct scsi_adapter dpt_switch = {
+ dpt_scsi_cmd,
+ dpt_minphys
+};
+
#ifndef offsetof
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
#endif /* offsetof */
@@ -350,10 +355,7 @@ dpt_init(sc, intrstr)
panic("%s: dpt_cmd failed", sc->sc_dv.dv_xname);
DELAY(20000);
- /* Fill in the adapter, each link and attach in turn */
- sc->sc_adapter.scsi_cmd = dpt_scsi_cmd;
- sc->sc_adapter.scsi_minphys = dpt_minphys;
-
+ /* Fill in each link and attach in turn */
for (i = 0; i <= ec->ec_maxchannel; i++) {
struct scsi_link *link;
sc->sc_hbaid[i] = ec->ec_hba[3 - i];
@@ -362,7 +364,7 @@ dpt_init(sc, intrstr)
link->adapter_target = sc->sc_hbaid[i];
link->luns = ec->ec_maxlun + 1;
link->adapter_buswidth = ec->ec_maxtarget + 1;
- link->adapter = &sc->sc_adapter;
+ link->adapter = &dpt_switch;
link->adapter_softc = sc;
link->openings = sc->sc_nccbs;
link->pool = &sc->sc_iopool;
diff --git a/sys/dev/ic/dptvar.h b/sys/dev/ic/dptvar.h
index d2ec14cd9b7..be4b8672608 100644
--- a/sys/dev/ic/dptvar.h
+++ b/sys/dev/ic/dptvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dptvar.h,v 1.8 2011/04/26 22:46:25 matthew Exp $ */
+/* $OpenBSD: dptvar.h,v 1.9 2011/04/26 22:55:58 matthew Exp $ */
/* $NetBSD: dptvar.h,v 1.5 1999/10/23 16:26:32 ad Exp $ */
/*
@@ -57,7 +57,6 @@ struct dpt_ccb {
struct dpt_softc {
struct device sc_dv; /* generic device data */
bus_space_handle_t sc_ioh; /* bus space handle */
- struct scsi_adapter sc_adapter;/* scsipi adapter */
struct scsi_link sc_link[3]; /* prototype link for each channel */
struct eata_cfg sc_ec; /* EATA configuration data */
bus_space_tag_t sc_iot; /* bus space tag */