summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>1998-11-19 21:43:00 +0000
committerthorpej <thorpej@NetBSD.org>1998-11-19 21:43:00 +0000
commit5f0577babcbc26fe5fa4ad3d2769a11aa5fcd505 (patch)
treeb572ceb9cf4c7afd2305bbeafcf32487e5e7c45c /sys
parentf9ace50af3b2068274312cf0ab1794b40408216e (diff)
Adapt to the new scsipi_adapter interface.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/tc/asc.c14
-rw-r--r--sys/arch/amiga/dev/afsc.c13
-rw-r--r--sys/arch/amiga/dev/ahsc.c15
-rw-r--r--sys/arch/amiga/dev/atzsc.c13
-rw-r--r--sys/arch/amiga/dev/bzivsc.c12
-rw-r--r--sys/arch/amiga/dev/bzsc.c12
-rw-r--r--sys/arch/amiga/dev/bztzsc.c12
-rw-r--r--sys/arch/amiga/dev/cbiisc.c12
-rw-r--r--sys/arch/amiga/dev/cbsc.c12
-rw-r--r--sys/arch/amiga/dev/drsc.c13
-rw-r--r--sys/arch/amiga/dev/empsc.c13
-rw-r--r--sys/arch/amiga/dev/flsc.c12
-rw-r--r--sys/arch/amiga/dev/gtsc.c13
-rw-r--r--sys/arch/amiga/dev/idesc.c14
-rw-r--r--sys/arch/amiga/dev/ivsc.c13
-rw-r--r--sys/arch/amiga/dev/mgnsc.c13
-rw-r--r--sys/arch/amiga/dev/mlhsc.c13
-rw-r--r--sys/arch/amiga/dev/otgsc.c13
-rw-r--r--sys/arch/amiga/dev/sbicvar.h3
-rw-r--r--sys/arch/amiga/dev/scivar.h3
-rw-r--r--sys/arch/amiga/dev/siopvar.h3
-rw-r--r--sys/arch/amiga/dev/wesc.c13
-rw-r--r--sys/arch/amiga/dev/wstsc.c13
-rw-r--r--sys/arch/amiga/dev/zssc.c13
-rw-r--r--sys/arch/arm32/podulebus/asc.c15
-rw-r--r--sys/arch/arm32/podulebus/cosc.c13
-rw-r--r--sys/arch/arm32/podulebus/csa.c15
-rw-r--r--sys/arch/arm32/podulebus/csc.c13
-rw-r--r--sys/arch/arm32/podulebus/escvar.h3
-rw-r--r--sys/arch/arm32/podulebus/oak.c15
-rw-r--r--sys/arch/arm32/podulebus/ptsc.c13
-rw-r--r--sys/arch/arm32/podulebus/sbicvar.h3
-rw-r--r--sys/arch/arm32/podulebus/sfasvar.h3
-rw-r--r--sys/arch/atari/dev/ncr5380.c13
-rw-r--r--sys/arch/atari/dev/ncr5380reg.h3
-rw-r--r--sys/arch/mac68k/dev/ncr5380.c13
-rw-r--r--sys/arch/mac68k/dev/ncr5380reg.h3
-rw-r--r--sys/arch/mac68k/dev/sbc.c8
-rw-r--r--sys/arch/mac68k/dev/sbcvar.h3
-rw-r--r--sys/arch/mac68k/obio/esp.c12
-rw-r--r--sys/arch/mac68k/obio/sbc_obio.c10
-rw-r--r--sys/arch/macppc/dev/esp.c12
-rw-r--r--sys/arch/mvme68k/dev/sbicvar.h5
-rw-r--r--sys/arch/mvme68k/dev/wdsc.c13
-rw-r--r--sys/arch/newsmips/dev/sc_wrap.c13
-rw-r--r--sys/arch/newsmips/dev/scsireg.h3
-rw-r--r--sys/arch/next68k/dev/esp.c12
-rw-r--r--sys/arch/pc532/dev/ncr.c16
-rw-r--r--sys/arch/pica/dev/asc.c17
-rw-r--r--sys/arch/sparc/dev/esp_obio.c12
-rw-r--r--sys/arch/sparc/dev/si.c16
-rw-r--r--sys/arch/sun3/dev/esp.c12
-rw-r--r--sys/arch/sun3/dev/si.c16
-rw-r--r--sys/arch/sun3/dev/si_sebuf.c15
-rw-r--r--sys/arch/vax/vsa/ncr.c17
-rw-r--r--sys/arch/x68k/dev/mha.c16
-rw-r--r--sys/arch/x68k/dev/mhavar.h3
-rw-r--r--sys/arch/x68k/dev/spc.c17
-rw-r--r--sys/dev/eisa/ahb.c17
-rw-r--r--sys/dev/ic/adv.c17
-rw-r--r--sys/dev/ic/advlib.h3
-rw-r--r--sys/dev/ic/adw.c17
-rw-r--r--sys/dev/ic/adwlib.h3
-rw-r--r--sys/dev/ic/aha.c16
-rw-r--r--sys/dev/ic/ahavar.h3
-rw-r--r--sys/dev/ic/aic6360.c16
-rw-r--r--sys/dev/ic/aic6360var.h3
-rw-r--r--sys/dev/ic/aic7xxx.c21
-rw-r--r--sys/dev/ic/aic7xxxvar.h3
-rw-r--r--sys/dev/ic/bha.c16
-rw-r--r--sys/dev/ic/bhavar.h3
-rw-r--r--sys/dev/ic/isp_netbsd.c14
-rw-r--r--sys/dev/ic/isp_netbsd.h3
-rw-r--r--sys/dev/ic/ncr5380var.h3
-rw-r--r--sys/dev/ic/ncr53c9x.c7
-rw-r--r--sys/dev/ic/ncr53c9xvar.h8
-rw-r--r--sys/dev/ic/uha.c16
-rw-r--r--sys/dev/ic/uhavar.h3
-rw-r--r--sys/dev/ic/wdcvar.h11
79 files changed, 386 insertions, 470 deletions
diff --git a/sys/arch/alpha/tc/asc.c b/sys/arch/alpha/tc/asc.c
index 32f6970498b..06a1b1d5651 100644
--- a/sys/arch/alpha/tc/asc.c
+++ b/sys/arch/alpha/tc/asc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: asc.c,v 1.14 1998/10/10 00:28:30 thorpej Exp $ */
+/* $NetBSD: asc.c,v 1.15 1998/11/19 21:43:00 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.14 1998/10/10 00:28:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.15 1998/11/19 21:43:00 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -115,12 +115,6 @@ struct cfattach asc_tcds_ca = {
sizeof(struct asc_tcds_softc), asc_tcds_match, asc_tcds_attach
};
-struct scsipi_adapter asc_tcds_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device asc_tcds_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -237,7 +231,9 @@ asc_tcds_attach(parent, self, aux)
sc->sc_maxxfer = 64 * 1024;
/* Do the common parts of attachment. */
- ncr53c9x_attach(sc, &asc_tcds_switch, &asc_tcds_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &asc_tcds_dev);
}
/*
diff --git a/sys/arch/amiga/dev/afsc.c b/sys/arch/amiga/dev/afsc.c
index 8603a835785..607a5fba122 100644
--- a/sys/arch/amiga/dev/afsc.c
+++ b/sys/arch/amiga/dev/afsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: afsc.c,v 1.23 1998/10/10 00:28:35 thorpej Exp $ */
+/* $NetBSD: afsc.c,v 1.24 1998/11/19 21:44:33 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -59,12 +59,6 @@ int afsc_dmaintr __P((void *));
void afsc_dump __P((void));
#endif
-struct scsipi_adapter afsc_scsiswitch = {
- siop_scsicmd,
- siop_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device afsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -145,10 +139,13 @@ afscattach(pdp, dp, auxp)
sc->sc_ctest7 = SIOP_CTEST7_CDIS;
sc->sc_dcntl = SIOP_DCNTL_EA;
+ sc->sc_adapter.scsipi_cmd = siop_scsicmd;
+ sc->sc_adapter.scsipi_minphys = siop_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &afsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &afsc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/ahsc.c b/sys/arch/amiga/dev/ahsc.c
index 4a094af9a66..850150891a3 100644
--- a/sys/arch/amiga/dev/ahsc.c
+++ b/sys/arch/amiga/dev/ahsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ahsc.c,v 1.23 1998/10/10 00:28:35 thorpej Exp $ */
+/* $NetBSD: ahsc.c,v 1.24 1998/11/19 21:44:34 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -66,12 +66,6 @@ int ahsc_dmago __P((struct sbic_softc *, char *, int, int));
void ahsc_dump __P((void));
#endif
-struct scsipi_adapter ahsc_scsiswitch = {
- sbic_scsicmd,
- sbic_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device ahsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -151,11 +145,14 @@ ahscattach(pdp, dp, auxp)
}
sc->sc_clkfreq = sbic_clock_override ? sbic_clock_override : 143;
-
+
+ sc->sc_adapter.scsipi_cmd = sbic_scsicmd;
+ sc->sc_adapter.scsipi_minphys = sbic_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &ahsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &ahsc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/atzsc.c b/sys/arch/amiga/dev/atzsc.c
index 7fe0fbb8bf8..e1d044500f6 100644
--- a/sys/arch/amiga/dev/atzsc.c
+++ b/sys/arch/amiga/dev/atzsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: atzsc.c,v 1.26 1998/10/10 00:28:35 thorpej Exp $ */
+/* $NetBSD: atzsc.c,v 1.27 1998/11/19 21:44:34 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -65,12 +65,6 @@ int atzsc_dmago __P((struct sbic_softc *, char *, int, int));
void atzsc_dump __P((void));
#endif
-struct scsipi_adapter atzsc_scsiswitch = {
- sbic_scsicmd,
- sbic_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device atzsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -160,10 +154,13 @@ atzscattach(pdp, dp, auxp)
printf(": dmamask 0x%lx\n", ~sc->sc_dmamask);
+ sc->sc_adapter.scsipi_cmd = sbic_scsicmd;
+ sc->sc_adapter.scsipi_minphys = sbic_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &atzsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &atzsc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/bzivsc.c b/sys/arch/amiga/dev/bzivsc.c
index 0e942f57d2f..3dfd49fcea3 100644
--- a/sys/arch/amiga/dev/bzivsc.c
+++ b/sys/arch/amiga/dev/bzivsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bzivsc.c,v 1.5 1998/10/10 00:28:35 thorpej Exp $ */
+/* $NetBSD: bzivsc.c,v 1.6 1998/11/19 21:44:34 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@@ -70,12 +70,6 @@ struct cfattach bzivsc_ca = {
sizeof(struct bzivsc_softc), bzivscmatch, bzivscattach
};
-struct scsipi_adapter bzivsc_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device bzivsc_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -247,7 +241,9 @@ bzivscattach(parent, self, aux)
/*
* Now try to attach all the sub-devices
*/
- ncr53c9x_attach(sc, &bzivsc_switch, &bzivsc_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &bzivsc_dev);
}
/*
diff --git a/sys/arch/amiga/dev/bzsc.c b/sys/arch/amiga/dev/bzsc.c
index b89cd24c8ee..d1d3a2e44e5 100644
--- a/sys/arch/amiga/dev/bzsc.c
+++ b/sys/arch/amiga/dev/bzsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bzsc.c,v 1.23 1998/10/10 00:28:35 thorpej Exp $ */
+/* $NetBSD: bzsc.c,v 1.24 1998/11/19 21:44:34 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@@ -76,12 +76,6 @@ struct cfattach bzsc_ca = {
sizeof(struct bzsc_softc), bzscmatch, bzscattach
};
-struct scsipi_adapter bzsc_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device bzsc_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -251,7 +245,9 @@ bzscattach(parent, self, aux)
/*
* Now try to attach all the sub-devices
*/
- ncr53c9x_attach(sc, &bzsc_switch, &bzsc_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &bzsc_dev);
}
/*
diff --git a/sys/arch/amiga/dev/bztzsc.c b/sys/arch/amiga/dev/bztzsc.c
index 93d86a18986..8cd4a84cb6e 100644
--- a/sys/arch/amiga/dev/bztzsc.c
+++ b/sys/arch/amiga/dev/bztzsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bztzsc.c,v 1.10 1998/10/10 00:28:35 thorpej Exp $ */
+/* $NetBSD: bztzsc.c,v 1.11 1998/11/19 21:44:35 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@@ -76,12 +76,6 @@ struct cfattach bztzsc_ca = {
sizeof(struct bztzsc_softc), bztzscmatch, bztzscattach
};
-struct scsipi_adapter bztzsc_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device bztzsc_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -251,7 +245,9 @@ bztzscattach(parent, self, aux)
/*
* Now try to attach all the sub-devices
*/
- ncr53c9x_attach(sc, &bztzsc_switch, &bztzsc_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &bztzsc_dev);
}
/*
diff --git a/sys/arch/amiga/dev/cbiisc.c b/sys/arch/amiga/dev/cbiisc.c
index 6a5936e2da5..7c36c81f113 100644
--- a/sys/arch/amiga/dev/cbiisc.c
+++ b/sys/arch/amiga/dev/cbiisc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cbiisc.c,v 1.6 1998/10/10 00:28:36 thorpej Exp $ */
+/* $NetBSD: cbiisc.c,v 1.7 1998/11/19 21:44:35 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@@ -70,12 +70,6 @@ struct cfattach cbiisc_ca = {
sizeof(struct cbiisc_softc), cbiiscmatch, cbiiscattach
};
-struct scsipi_adapter cbiisc_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device cbiisc_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -243,7 +237,9 @@ cbiiscattach(parent, self, aux)
/*
* Now try to attach all the sub-devices
*/
- ncr53c9x_attach(sc, &cbiisc_switch, &cbiisc_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &cbiisc_dev);
}
/*
diff --git a/sys/arch/amiga/dev/cbsc.c b/sys/arch/amiga/dev/cbsc.c
index 916e3073e9e..5a3eb5f8adb 100644
--- a/sys/arch/amiga/dev/cbsc.c
+++ b/sys/arch/amiga/dev/cbsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cbsc.c,v 1.7 1998/11/14 21:48:22 mhitch Exp $ */
+/* $NetBSD: cbsc.c,v 1.8 1998/11/19 21:44:35 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@@ -70,12 +70,6 @@ struct cfattach cbsc_ca = {
sizeof(struct cbsc_softc), cbscmatch, cbscattach
};
-struct scsipi_adapter cbsc_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device cbsc_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -247,7 +241,9 @@ cbscattach(parent, self, aux)
/*
* Now try to attach all the sub-devices
*/
- ncr53c9x_attach(sc, &cbsc_switch, &cbsc_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &cbsc_dev);
}
/*
diff --git a/sys/arch/amiga/dev/drsc.c b/sys/arch/amiga/dev/drsc.c
index fff4864e6b2..85648b3145d 100644
--- a/sys/arch/amiga/dev/drsc.c
+++ b/sys/arch/amiga/dev/drsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: drsc.c,v 1.13 1998/10/10 00:28:36 thorpej Exp $ */
+/* $NetBSD: drsc.c,v 1.14 1998/11/19 21:44:35 thorpej Exp $ */
/*
* Copyright (c) 1996 Ignatios Souvatzis
@@ -59,12 +59,6 @@ int drsc_dmaintr __P((struct siop_softc *));
void drsc_dump __P((void));
#endif
-struct scsipi_adapter drsc_scsiswitch = {
- siop_scsicmd,
- siop_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device drsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -122,10 +116,13 @@ drscattach(pdp, dp, auxp)
alloc_sicallback();
+ sc->sc_adapter.scsipi_cmd = siop_scsicmd;
+ sc->sc_adapter.scsipi_minphys = siop_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &drsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &drsc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/empsc.c b/sys/arch/amiga/dev/empsc.c
index 094a68faacd..6b1ba4cadd0 100644
--- a/sys/arch/amiga/dev/empsc.c
+++ b/sys/arch/amiga/dev/empsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: empsc.c,v 1.16 1998/10/10 00:28:36 thorpej Exp $ */
+/* $NetBSD: empsc.c,v 1.17 1998/11/19 21:44:35 thorpej Exp $ */
/*
@@ -54,12 +54,6 @@ void empscattach __P((struct device *, struct device *, void *));
int empscmatch __P((struct device *, struct cfdata *, void *));
int empsc_intr __P((void *));
-struct scsipi_adapter empsc_scsiswitch = {
- sci_scsicmd,
- sci_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device empsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -135,10 +129,13 @@ empscattach(pdp, dp, auxp)
scireset(sc);
+ sc->sc_adapter.scsipi_cmd = sci_scsicmd;
+ sc->sc_adapter.scsipi_minphys = sci_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &empsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &empsc_scsidev;
sc->sc_link.openings = 1;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/flsc.c b/sys/arch/amiga/dev/flsc.c
index 41be16113ea..2a76f6faa2c 100644
--- a/sys/arch/amiga/dev/flsc.c
+++ b/sys/arch/amiga/dev/flsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: flsc.c,v 1.22 1998/10/10 00:28:36 thorpej Exp $ */
+/* $NetBSD: flsc.c,v 1.23 1998/11/19 21:44:36 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@@ -78,12 +78,6 @@ struct cfattach flsc_ca = {
sizeof(struct flsc_softc), flscmatch, flscattach
};
-struct scsipi_adapter flsc_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device flsc_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -229,7 +223,9 @@ flscattach(parent, self, aux)
/*
* Now try to attach all the sub-devices
*/
- ncr53c9x_attach(sc, &flsc_switch, &flsc_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &flsc_dev);
}
/*
diff --git a/sys/arch/amiga/dev/gtsc.c b/sys/arch/amiga/dev/gtsc.c
index 99765cb9bb6..0869ee24670 100644
--- a/sys/arch/amiga/dev/gtsc.c
+++ b/sys/arch/amiga/dev/gtsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gtsc.c,v 1.25 1998/10/10 00:28:36 thorpej Exp $ */
+/* $NetBSD: gtsc.c,v 1.26 1998/11/19 21:44:36 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -66,12 +66,6 @@ int gtsc_dmago __P((struct sbic_softc *, char *, int, int));
void gtsc_dump __P((void));
#endif
-struct scsipi_adapter gtsc_scsiswitch = {
- sbic_scsicmd,
- sbic_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device gtsc_scsidev = {
NULL, /* use default error handler */
NULL, /* have a queue served by this ??? */
@@ -185,10 +179,13 @@ gtscattach(pdp, dp, auxp)
((gap->flags & GVP_14MHZ) ? 143 : 72);
printf("sc_clkfreg: %ld.%ldMhz\n", sc->sc_clkfreq / 10, sc->sc_clkfreq % 10);
+ sc->sc_adapter.scsipi_cmd = sbic_scsicmd;
+ sc->sc_adapter.scsipi_minphys = sbic_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &gtsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &gtsc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/idesc.c b/sys/arch/amiga/dev/idesc.c
index b221fe642cd..83bc62f81a7 100644
--- a/sys/arch/amiga/dev/idesc.c
+++ b/sys/arch/amiga/dev/idesc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: idesc.c,v 1.33 1998/10/10 00:28:36 thorpej Exp $ */
+/* $NetBSD: idesc.c,v 1.34 1998/11/19 21:44:36 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -217,6 +217,7 @@ struct idec_softc
struct isr sc_isr;
struct scsipi_link sc_link; /* proto for sub devices */
+ struct scsipi_adapter sc_adapter;
ide_regmap_p sc_cregs; /* driver specific regs */
volatile u_char *sc_a1200; /* A1200 interrupt control */
TAILQ_HEAD(,ide_pending) sc_xslist; /* LIFO */
@@ -253,12 +254,6 @@ void ide_scsidone __P((struct idec_softc *, int));
void ide_donextcmd __P((struct idec_softc *));
int idesc_intr __P((void *));
-struct scsipi_adapter idesc_scsiswitch = {
- ide_scsicmd,
- minphys, /* no max transfer len, at this level */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device idesc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -402,10 +397,13 @@ idescattach(pdp, dp, auxp)
printf ("\n");
+ sc->sc_adapter.scsipi_cmd = ide_scsicmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &idesc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &idesc_scsidev;
sc->sc_link.openings = 1;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/ivsc.c b/sys/arch/amiga/dev/ivsc.c
index e752218e0bb..e303298bffd 100644
--- a/sys/arch/amiga/dev/ivsc.c
+++ b/sys/arch/amiga/dev/ivsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ivsc.c,v 1.24 1998/10/10 00:28:37 thorpej Exp $ */
+/* $NetBSD: ivsc.c,v 1.25 1998/11/19 21:44:36 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -58,12 +58,6 @@ int ivsc_dma_xfer_in __P((struct sci_softc *dev, int len,
int ivsc_dma_xfer_out __P((struct sci_softc *dev, int len,
register u_char *buf, int phase));
-struct scsipi_adapter ivsc_scsiswitch = {
- sci_scsicmd,
- sci_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device ivsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -152,10 +146,13 @@ ivscattach(pdp, dp, auxp)
scireset(sc);
+ sc->sc_adapter.scsipi_cmd = sci_scsicmd;
+ sc->sc_adapter.scsipi_minphys = sci_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &ivsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &ivsc_scsidev;
sc->sc_link.openings = 1;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/mgnsc.c b/sys/arch/amiga/dev/mgnsc.c
index 2124c7457ff..4e39d41d87b 100644
--- a/sys/arch/amiga/dev/mgnsc.c
+++ b/sys/arch/amiga/dev/mgnsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mgnsc.c,v 1.27 1998/10/10 00:28:37 thorpej Exp $ */
+/* $NetBSD: mgnsc.c,v 1.28 1998/11/19 21:44:36 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -58,12 +58,6 @@ int mgnsc_dmaintr __P((void *));
void mgnsc_dump __P((void));
#endif
-struct scsipi_adapter mgnsc_scsiswitch = {
- siop_scsicmd,
- siop_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device mgnsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -120,10 +114,13 @@ mgnscattach(pdp, dp, auxp)
alloc_sicallback();
+ sc->sc_adapter.scsipi_cmd = siop_scsicmd;
+ sc->sc_adapter.scsipi_minphys = siop_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &mgnsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &mgnsc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/mlhsc.c b/sys/arch/amiga/dev/mlhsc.c
index 4a36bbed294..700a85aa354 100644
--- a/sys/arch/amiga/dev/mlhsc.c
+++ b/sys/arch/amiga/dev/mlhsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mlhsc.c,v 1.19 1998/10/10 00:28:37 thorpej Exp $ */
+/* $NetBSD: mlhsc.c,v 1.20 1998/11/19 21:44:37 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -56,12 +56,6 @@ int mlhsc_dma_xfer_in __P((struct sci_softc *dev, int len,
int mlhsc_dma_xfer_out __P((struct sci_softc *dev, int len,
register u_char *buf, int phase));
-struct scsipi_adapter mlhsc_scsiswitch = {
- sci_scsicmd,
- sci_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device mlhsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -138,10 +132,13 @@ mlhscattach(pdp, dp, auxp)
scireset(sc);
+ sc->sc_link.scsipi_cmd = sci_scsicmd;
+ sc->sc_link.scsipi_minphys = sci_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &mlhsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &mlhsc_scsidev;
sc->sc_link.openings = 1;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/otgsc.c b/sys/arch/amiga/dev/otgsc.c
index 9731d196f69..c247e56e740 100644
--- a/sys/arch/amiga/dev/otgsc.c
+++ b/sys/arch/amiga/dev/otgsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: otgsc.c,v 1.20 1998/10/10 00:28:37 thorpej Exp $ */
+/* $NetBSD: otgsc.c,v 1.21 1998/11/19 21:44:37 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -57,12 +57,6 @@ int otgsc_dma_xfer_out __P((struct sci_softc *dev, int len,
register u_char *buf, int phase));
int otgsc_intr __P((void *));
-struct scsipi_adapter otgsc_scsiswitch = {
- sci_scsicmd,
- sci_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device otgsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -145,10 +139,13 @@ otgscattach(pdp, dp, auxp)
scireset(sc);
+ sc->sc_adapter.scsipi_cmd = sci_scsicmd;
+ sc->sc_adapter.scsipi_minphys = sci_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &otgsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &otgsc_scsidev;
sc->sc_link.openings = 1;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/sbicvar.h b/sys/arch/amiga/dev/sbicvar.h
index 7db6a6754dc..736689b9e2a 100644
--- a/sys/arch/amiga/dev/sbicvar.h
+++ b/sys/arch/amiga/dev/sbicvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sbicvar.h,v 1.13 1998/08/21 19:13:29 is Exp $ */
+/* $NetBSD: sbicvar.h,v 1.14 1998/11/19 21:44:37 thorpej Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -113,6 +113,7 @@ struct sbic_softc {
u_char target; /* Currently active target */
u_char lun;
struct scsipi_link sc_link; /* proto for sub devices */
+ struct scsipi_adapter sc_adapter;
sbic_regmap_t sc_sbic; /* the two SBIC pointers */
volatile void *sc_cregs; /* driver specific regs */
diff --git a/sys/arch/amiga/dev/scivar.h b/sys/arch/amiga/dev/scivar.h
index 8e9cbe6c907..2feb59a6ebb 100644
--- a/sys/arch/amiga/dev/scivar.h
+++ b/sys/arch/amiga/dev/scivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: scivar.h,v 1.11 1997/08/27 11:23:18 bouyer Exp $ */
+/* $NetBSD: scivar.h,v 1.12 1998/11/19 21:44:37 thorpej Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -51,6 +51,7 @@ struct sci_softc {
struct device sc_dev;
struct isr sc_isr;
struct scsipi_link sc_link; /* proto for sub devices */
+ struct scsipi_adapter sc_adapter;
TAILQ_HEAD(,sci_pending) sc_xslist;
struct sci_pending sc_xsstore[8][8];
struct scsipi_xfer *sc_xs; /* transfer from high level code */
diff --git a/sys/arch/amiga/dev/siopvar.h b/sys/arch/amiga/dev/siopvar.h
index 838444c53ac..3061f77430d 100644
--- a/sys/arch/amiga/dev/siopvar.h
+++ b/sys/arch/amiga/dev/siopvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: siopvar.h,v 1.15 1997/08/27 11:23:22 bouyer Exp $ */
+/* $NetBSD: siopvar.h,v 1.16 1998/11/19 21:44:37 thorpej Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -131,6 +131,7 @@ struct siop_softc {
u_char sc_sstat1;
u_long sc_intcode;
struct scsipi_link sc_link; /* proto for sub devices */
+ struct scsipi_adapter sc_adapter;
u_long sc_scriptspa; /* physical address of scripts */
siop_regmap_p sc_siopp; /* the SIOP */
u_long sc_active; /* number of active I/O's */
diff --git a/sys/arch/amiga/dev/wesc.c b/sys/arch/amiga/dev/wesc.c
index 65e69c03d2e..d1e83b403d4 100644
--- a/sys/arch/amiga/dev/wesc.c
+++ b/sys/arch/amiga/dev/wesc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wesc.c,v 1.22 1998/10/10 00:28:37 thorpej Exp $ */
+/* $NetBSD: wesc.c,v 1.23 1998/11/19 21:44:37 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -58,12 +58,6 @@ int wesc_dmaintr __P((void *));
void wesc_dump __P((void));
#endif
-struct scsipi_adapter wesc_scsiswitch = {
- siop_scsicmd,
- siop_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device wesc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -119,10 +113,13 @@ wescattach(pdp, dp, auxp)
sc->sc_ctest7 = SIOP_CTEST7_SC0 | SIOP_CTEST7_TT1;
sc->sc_dcntl = 0x00;
+ sc->sc_adapter.scsipi_cmd = siop_scsicmd;
+ sc->sc_adapter.scsipi_minphys = siop_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &wesc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &wesc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/wstsc.c b/sys/arch/amiga/dev/wstsc.c
index d33f23e1042..331db8bfef0 100644
--- a/sys/arch/amiga/dev/wstsc.c
+++ b/sys/arch/amiga/dev/wstsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wstsc.c,v 1.21 1998/10/10 00:28:37 thorpej Exp $ */
+/* $NetBSD: wstsc.c,v 1.22 1998/11/19 21:44:37 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -61,12 +61,6 @@ int wstsc_dma_xfer_out2 __P((struct sci_softc *dev, int len,
register u_short *buf, int phase));
int wstsc_intr __P((void *));
-struct scsipi_adapter wstsc_scsiswitch = {
- sci_scsicmd,
- sci_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device wstsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -163,10 +157,13 @@ wstscattach(pdp, dp, auxp)
scireset(sc);
+ sc->sc_adapter.scsipi_cmd = sci_scsicmd;
+ sc->sc_adapter.scsipi_minphys = sci_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &wstsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &wstsc_scsidev;
sc->sc_link.openings = 1;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/amiga/dev/zssc.c b/sys/arch/amiga/dev/zssc.c
index 750e45d3556..2f9662a53ce 100644
--- a/sys/arch/amiga/dev/zssc.c
+++ b/sys/arch/amiga/dev/zssc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: zssc.c,v 1.25 1998/10/10 00:28:37 thorpej Exp $ */
+/* $NetBSD: zssc.c,v 1.26 1998/11/19 21:44:38 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -58,12 +58,6 @@ int zssc_dmaintr __P((void *));
void zssc_dump __P((void));
#endif
-struct scsipi_adapter zssc_scsiswitch = {
- siop_scsicmd,
- siop_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device zssc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -121,10 +115,13 @@ zsscattach(pdp, dp, auxp)
alloc_sicallback();
+ sc->sc_adapter.scsipi_cmd = siop_scsicmd;
+ sc->sc_adapter.scsipi_minphys = siop_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &zssc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &zssc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/arm32/podulebus/asc.c b/sys/arch/arm32/podulebus/asc.c
index 53b61971cd2..d5bc6dfd68f 100644
--- a/sys/arch/arm32/podulebus/asc.c
+++ b/sys/arch/arm32/podulebus/asc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: asc.c,v 1.23 1998/10/10 00:28:38 thorpej Exp $ */
+/* $NetBSD: asc.c,v 1.24 1998/11/19 21:44:59 thorpej Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
@@ -82,12 +82,6 @@ int asc_scsicmd __P((struct scsipi_xfer *xs));
int asc_intr __P((void *arg));
void asc_minphys __P((struct buf *bp));
-struct scsipi_adapter asc_scsiswitch = {
- asc_scsicmd,
- asc_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device asc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -167,11 +161,14 @@ ascattach(pdp, dp, auxp)
sbic->sc_dmamask = 0;
sbic->sc_sbicp = (sbic_regmap_p) (sc->sc_podule->mod_base + ASC_SBIC);
sbic->sc_clkfreq = sbic_clock_override ? sbic_clock_override : 143;
-
+
+ sbic->sc_adapter.scsipi_cmd = asc_scsicmd;
+ sbic->sc_adapter.scsipi_minphys = asc_minphys;
+
sbic->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sbic->sc_link.adapter_softc = sbic;
sbic->sc_link.scsipi_scsi.adapter_target = 7;
- sbic->sc_link.adapter = &asc_scsiswitch;
+ sbic->sc_link.adapter = &sbic->sc_adapter;
sbic->sc_link.device = &asc_scsidev;
sbic->sc_link.openings = 1; /* was 2 */
sbic->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/arm32/podulebus/cosc.c b/sys/arch/arm32/podulebus/cosc.c
index 79b458c3793..0ebad0fd130 100644
--- a/sys/arch/arm32/podulebus/cosc.c
+++ b/sys/arch/arm32/podulebus/cosc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cosc.c,v 1.8 1998/10/10 00:28:38 thorpej Exp $ */
+/* $NetBSD: cosc.c,v 1.9 1998/11/19 21:44:59 thorpej Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
@@ -63,12 +63,6 @@ void coscattach __P((struct device *, struct device *, void *));
int coscmatch __P((struct device *, struct cfdata *, void *));
int cosc_scsicmd __P((struct scsipi_xfer *));
-struct scsipi_adapter cosc_scsiswitch = {
- cosc_scsicmd, /* Eventually call esc_scsicmd directly */
- esc_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device cosc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start function */
@@ -255,10 +249,13 @@ coscattach(pdp, dp, auxp)
escinitialize((struct esc_softc *)sc);
+ sc->sc_softc.sc_adapter.scsipi_cmd = cosc_scsicmd;
+ sc->sc_softc.sc_adapter.scsipi_minphys = esc_minphys;
+
sc->sc_softc.sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_softc.sc_link.adapter_softc = sc;
sc->sc_softc.sc_link.scsipi_scsi.adapter_target = sc->sc_softc.sc_host_id;
- sc->sc_softc.sc_link.adapter = &cosc_scsiswitch;
+ sc->sc_softc.sc_link.adapter = &sc->sc_softc.sc_adapter;
sc->sc_softc.sc_link.device = &cosc_scsidev;
sc->sc_softc.sc_link.openings = 1;
sc->sc_softc.sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/arm32/podulebus/csa.c b/sys/arch/arm32/podulebus/csa.c
index e9738e18685..f56b5b6e037 100644
--- a/sys/arch/arm32/podulebus/csa.c
+++ b/sys/arch/arm32/podulebus/csa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: csa.c,v 1.3 1998/10/10 00:28:38 thorpej Exp $ */
+/* $NetBSD: csa.c,v 1.4 1998/11/19 21:44:59 thorpej Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -77,12 +77,6 @@ void csa_attach __P((struct device *, struct device *, void *));
int csa_match __P((struct device *, struct cfdata *, void *));
static void csa_minphys __P((struct buf *bp));
-struct scsipi_adapter csa_scsiswitch = {
- ncr5380_scsi_cmd, /* scsipi_cmd */
- csa_minphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device csa_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -190,11 +184,14 @@ csa_attach(parent, self, aux)
sc->sc_ncr5380.sc_pio_in = ncr5380_pio_in;
sc->sc_ncr5380.sc_pio_out = ncr5380_pio_out;
-
+
+ sc->sc_ncr5380.sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ sc->sc_ncr5380.sc_adapter.scsipi_minphys = csa_minphys;
+
sc->sc_ncr5380.sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_ncr5380.sc_link.adapter_softc = sc;
sc->sc_ncr5380.sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_ncr5380.sc_link.adapter = &csa_scsiswitch;
+ sc->sc_ncr5380.sc_link.adapter = &sc->sc_ncr5380.sc_adapter;
sc->sc_ncr5380.sc_link.device = &csa_scsidev;
/* Provide an override for the host id */
diff --git a/sys/arch/arm32/podulebus/csc.c b/sys/arch/arm32/podulebus/csc.c
index 4c23cd12e22..1fd1f1fbc6c 100644
--- a/sys/arch/arm32/podulebus/csc.c
+++ b/sys/arch/arm32/podulebus/csc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: csc.c,v 1.2 1998/10/10 00:28:38 thorpej Exp $ */
+/* $NetBSD: csc.c,v 1.3 1998/11/19 21:44:59 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,12 +65,6 @@ void cscattach __P((struct device *, struct device *, void *));
int cscmatch __P((struct device *, struct cfdata *, void *));
int csc_scsicmd __P((struct scsipi_xfer *));
-struct scsipi_adapter csc_scsiswitch = {
- csc_scsicmd,
- sfas_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device csc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -170,10 +164,13 @@ cscattach(pdp, dp, auxp)
sfasinitialize((struct sfas_softc *)sc);
+ sc->sc_softc.sc_adapter.scsipi_cmd = csc_scsicmd;
+ sc->sc_softc.sc_adapter.scsipi_minphys = sfas_minphys;
+
sc->sc_softc.sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_softc.sc_link.adapter_softc = sc;
sc->sc_softc.sc_link.scsipi_scsi.adapter_target = sc->sc_softc.sc_host_id;
- sc->sc_softc.sc_link.adapter = &csc_scsiswitch;
+ sc->sc_softc.sc_link.adapter = &sc->sc_adapter;
sc->sc_softc.sc_link.device = &csc_scsidev;
sc->sc_softc.sc_link.openings = 1;
sc->sc_softc.sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/arm32/podulebus/escvar.h b/sys/arch/arm32/podulebus/escvar.h
index b2705b8f530..3bd96194551 100644
--- a/sys/arch/arm32/podulebus/escvar.h
+++ b/sys/arch/arm32/podulebus/escvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: escvar.h,v 1.3 1997/08/27 11:23:29 bouyer Exp $ */
+/* $NetBSD: escvar.h,v 1.4 1998/11/19 21:44:59 thorpej Exp $ */
/*
* Copyright (c) 1995 Daniel Widenfalk
@@ -157,6 +157,7 @@ struct nexus {
struct esc_softc {
struct device sc_dev; /* System required struct */
struct scsipi_link sc_link; /* For sub devices */
+ struct scsipi_adapter sc_adapter;
irqhandler_t sc_ih; /* Interrupt chain struct */
TAILQ_HEAD(,esc_pending) sc_xs_pending;
diff --git a/sys/arch/arm32/podulebus/oak.c b/sys/arch/arm32/podulebus/oak.c
index d6767949065..7d891ea37b1 100644
--- a/sys/arch/arm32/podulebus/oak.c
+++ b/sys/arch/arm32/podulebus/oak.c
@@ -1,4 +1,4 @@
-/* $NetBSD: oak.c,v 1.15 1998/10/10 00:28:38 thorpej Exp $ */
+/* $NetBSD: oak.c,v 1.16 1998/11/19 21:44:59 thorpej Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -62,12 +62,6 @@ void oak_attach __P((struct device *, struct device *, void *));
int oak_match __P((struct device *, struct cfdata *, void *));
static void oak_minphys __P((struct buf *bp));
-struct scsipi_adapter oak_scsiswitch = {
- ncr5380_scsi_cmd, /* scsipi_cmd */
- oak_minphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device oak_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -163,11 +157,14 @@ oak_attach(parent, self, aux)
sc->sc_ncr5380.sc_pio_in = ncr5380_pio_in;
sc->sc_ncr5380.sc_pio_out = ncr5380_pio_out;
-
+
+ sc->sc_ncr5380.sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ sc->sc_ncr5380.sc_adapter.scsipi_minphys = oak_minphys;
+
sc->sc_ncr5380.sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_ncr5380.sc_link.adapter_softc = sc;
sc->sc_ncr5380.sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_ncr5380.sc_link.adapter = &oak_scsiswitch;
+ sc->sc_ncr5380.sc_link.adapter = &sc->sc_ncr5380.sc_adapter;
sc->sc_ncr5380.sc_link.device = &oak_scsidev;
/* Provide an override for the host id */
diff --git a/sys/arch/arm32/podulebus/ptsc.c b/sys/arch/arm32/podulebus/ptsc.c
index bdb50bfa1b4..449fbaef329 100644
--- a/sys/arch/arm32/podulebus/ptsc.c
+++ b/sys/arch/arm32/podulebus/ptsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ptsc.c,v 1.20 1998/10/10 00:28:38 thorpej Exp $ */
+/* $NetBSD: ptsc.c,v 1.21 1998/11/19 21:44:59 thorpej Exp $ */
/*
* Copyright (c) 1995 Scott Stevens
@@ -70,12 +70,6 @@ void ptscattach __P((struct device *, struct device *, void *));
int ptscmatch __P((struct device *, struct cfdata *, void *));
int ptsc_scsicmd __P((struct scsipi_xfer *));
-struct scsipi_adapter ptsc_scsiswitch = {
- ptsc_scsicmd,
- sfas_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device ptsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -177,10 +171,13 @@ ptscattach(pdp, dp, auxp)
sfasinitialize((struct sfas_softc *)sc);
+ sc->sc_softc.sc_adapter.scsipi_cmd = ptsc_scsicmd;
+ sc->sc_softc.sc_adapter.scsipi_minphys = sfas_minphys;
+
sc->sc_softc.sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_softc.sc_link.adapter_softc = sc;
sc->sc_softc.sc_link.scsipi_scsi.adapter_target = sc->sc_softc.sc_host_id;
- sc->sc_softc.sc_link.adapter = &ptsc_scsiswitch;
+ sc->sc_softc.sc_link.adapter = &sc->sc_softc.sc_adapter;
sc->sc_softc.sc_link.device = &ptsc_scsidev;
sc->sc_softc.sc_link.openings = 1;
sc->sc_softc.sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/arm32/podulebus/sbicvar.h b/sys/arch/arm32/podulebus/sbicvar.h
index 213b0b988df..628aec7cee0 100644
--- a/sys/arch/arm32/podulebus/sbicvar.h
+++ b/sys/arch/arm32/podulebus/sbicvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sbicvar.h,v 1.3 1997/08/27 11:23:35 bouyer Exp $ */
+/* $NetBSD: sbicvar.h,v 1.4 1998/11/19 21:45:00 thorpej Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -114,6 +114,7 @@ struct sbic_softc {
u_char target; /* Currently active target */
u_char lun;
struct scsipi_link sc_link; /* proto for sub devices */
+ struct scsipi_adapter sc_adapter;
sbic_regmap_p sc_sbicp; /* the SBIC */
volatile void *sc_cregs; /* driver specific regs */
diff --git a/sys/arch/arm32/podulebus/sfasvar.h b/sys/arch/arm32/podulebus/sfasvar.h
index aee45a61559..4d9ebf66f5f 100644
--- a/sys/arch/arm32/podulebus/sfasvar.h
+++ b/sys/arch/arm32/podulebus/sfasvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sfasvar.h,v 1.5 1997/08/27 11:23:37 bouyer Exp $ */
+/* $NetBSD: sfasvar.h,v 1.6 1998/11/19 21:45:00 thorpej Exp $ */
/*
* Copyright (c) 1995 Daniel Widenfalk
@@ -156,6 +156,7 @@ struct nexus {
struct sfas_softc {
struct device sc_dev; /* System required struct */
struct scsipi_link sc_link; /* For sub devices */
+ struct scsipi_adapter sc_adapter;
irqhandler_t sc_ih; /* Interrupt chain struct */
TAILQ_HEAD(,sfas_pending) sc_xs_pending;
diff --git a/sys/arch/atari/dev/ncr5380.c b/sys/arch/atari/dev/ncr5380.c
index fc88d4b0e7f..7a871a95bcd 100644
--- a/sys/arch/atari/dev/ncr5380.c
+++ b/sys/arch/atari/dev/ncr5380.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr5380.c,v 1.33 1998/10/10 00:28:30 thorpej Exp $ */
+/* $NetBSD: ncr5380.c,v 1.34 1998/11/19 21:45:39 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@@ -81,12 +81,6 @@ static void ncr5380_minphys __P((struct buf *bp));
static int ncr5380_scsi_cmd __P((struct scsipi_xfer *xs));
static void ncr5380_show_scsi_cmd __P((struct scsipi_xfer *xs));
-struct scsipi_adapter ncr5380_switch = {
- ncr5380_scsi_cmd, /* scsipi_cmd */
- ncr5380_minphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device ncr5380_dev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -233,10 +227,13 @@ void *auxp;
sc = (struct ncr_softc *)dp;
+ sc->sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = ncr5380_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &ncr5380_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &ncr5380_dev;
sc->sc_link.openings = NREQ - 1;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/atari/dev/ncr5380reg.h b/sys/arch/atari/dev/ncr5380reg.h
index 22392d97eca..4e28d8391c0 100644
--- a/sys/arch/atari/dev/ncr5380reg.h
+++ b/sys/arch/atari/dev/ncr5380reg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr5380reg.h,v 1.12 1997/08/27 11:23:42 bouyer Exp $ */
+/* $NetBSD: ncr5380reg.h,v 1.13 1998/11/19 21:45:39 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@@ -159,6 +159,7 @@
struct ncr_softc {
struct device sc_dev;
struct scsipi_link sc_link;
+ struct scsipi_adapter sc_adapter;
/*
* Some (pre-SCSI2) devices don't support select with ATN.
diff --git a/sys/arch/mac68k/dev/ncr5380.c b/sys/arch/mac68k/dev/ncr5380.c
index 65cb3b8cf2a..341af98d0f4 100644
--- a/sys/arch/mac68k/dev/ncr5380.c
+++ b/sys/arch/mac68k/dev/ncr5380.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr5380.c,v 1.42 1998/10/10 00:28:38 thorpej Exp $ */
+/* $NetBSD: ncr5380.c,v 1.43 1998/11/19 21:46:24 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@@ -81,12 +81,6 @@ static void ncr5380_minphys __P((struct buf *bp));
static int ncr5380_scsi_cmd __P((struct scsipi_xfer *xs));
static void ncr5380_show_scsi_cmd __P((struct scsipi_xfer *xs));
-struct scsipi_adapter ncr5380_switch = {
- ncr5380_scsi_cmd, /* scsipi_cmd */
- ncr5380_minphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device ncr5380_dev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -235,10 +229,13 @@ void *auxp;
sc = (struct ncr_softc *)dp;
+ sc->sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = ncr5380_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &ncr5380_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &ncr5380_dev;
sc->sc_link.openings = NREQ - 1;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/mac68k/dev/ncr5380reg.h b/sys/arch/mac68k/dev/ncr5380reg.h
index c69fcf6c3ce..4a8933f6375 100644
--- a/sys/arch/mac68k/dev/ncr5380reg.h
+++ b/sys/arch/mac68k/dev/ncr5380reg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr5380reg.h,v 1.10 1997/08/27 11:23:51 bouyer Exp $ */
+/* $NetBSD: ncr5380reg.h,v 1.11 1998/11/19 21:46:24 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@@ -159,6 +159,7 @@
struct ncr_softc {
struct device sc_dev;
struct scsipi_link sc_link;
+ struct scsipi_adapter sc_adapter;
/*
* Some (pre-SCSI2) devices don't support select with ATN.
diff --git a/sys/arch/mac68k/dev/sbc.c b/sys/arch/mac68k/dev/sbc.c
index a4b47ce4f90..a97abd5f351 100644
--- a/sys/arch/mac68k/dev/sbc.c
+++ b/sys/arch/mac68k/dev/sbc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbc.c,v 1.37 1998/10/10 00:28:38 thorpej Exp $ */
+/* $NetBSD: sbc.c,v 1.38 1998/11/19 21:46:24 thorpej Exp $ */
/*
* Copyright (C) 1996 Scott Reynolds. All rights reserved.
@@ -89,12 +89,6 @@ int sbc_debug = 0 /* | SBC_DB_INTR | SBC_DB_DMA */;
int sbc_link_flags = 0 /* | SDEV_DB2 */;
int sbc_options = 0 /* | SBC_PDMA */;
-struct scsipi_adapter sbc_ops = {
- ncr5380_scsi_cmd, /* scsipi_cmd */
- minphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
/* This is copied from julian's bt driver */
/* "so we have a default dev struct for our link struct." */
struct scsipi_device sbc_dev = {
diff --git a/sys/arch/mac68k/dev/sbcvar.h b/sys/arch/mac68k/dev/sbcvar.h
index 99818456df9..ba35bab30eb 100644
--- a/sys/arch/mac68k/dev/sbcvar.h
+++ b/sys/arch/mac68k/dev/sbcvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sbcvar.h,v 1.5 1998/07/04 22:18:27 jonathan Exp $ */
+/* $NetBSD: sbcvar.h,v 1.6 1998/11/19 21:46:24 thorpej Exp $ */
/*
* Copyright (C) 1996 Scott Reynolds. All rights reserved.
@@ -85,7 +85,6 @@ struct sbc_softc {
extern int sbc_debug;
extern int sbc_link_flags;
extern int sbc_options;
-extern struct scsipi_adapter sbc_ops;
extern struct scsipi_device sbc_dev;
int sbc_pdma_in __P((struct ncr5380_softc *, int, int, u_char *));
diff --git a/sys/arch/mac68k/obio/esp.c b/sys/arch/mac68k/obio/esp.c
index 655941ab8c3..afba295d2f6 100644
--- a/sys/arch/mac68k/obio/esp.c
+++ b/sys/arch/mac68k/obio/esp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esp.c,v 1.18 1998/10/10 00:28:30 thorpej Exp $ */
+/* $NetBSD: esp.c,v 1.19 1998/11/19 21:46:24 thorpej Exp $ */
/*
* Copyright (c) 1997 Jason R. Thorpe.
@@ -113,12 +113,6 @@ struct cfattach esp_ca = {
sizeof(struct esp_softc), espmatch, espattach
};
-struct scsipi_adapter esp_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device esp_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -316,7 +310,9 @@ espattach(parent, self, aux)
/*
* Now try to attach all the sub-devices
*/
- ncr53c9x_attach(sc, &esp_switch, &esp_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &esp_dev);
/*
* Configure interrupts.
diff --git a/sys/arch/mac68k/obio/sbc_obio.c b/sys/arch/mac68k/obio/sbc_obio.c
index 6839a1a14eb..2232cf6e30a 100644
--- a/sys/arch/mac68k/obio/sbc_obio.c
+++ b/sys/arch/mac68k/obio/sbc_obio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbc_obio.c,v 1.8 1998/05/02 16:45:31 scottr Exp $ */
+/* $NetBSD: sbc_obio.c,v 1.9 1998/11/19 21:46:25 thorpej Exp $ */
/*
* Copyright (C) 1996,1997 Scott Reynolds. All rights reserved.
@@ -160,12 +160,18 @@ sbc_obio_attach(parent, self, args)
}
/*
+ * Fill in the adapter.
+ */
+ ncr_sc->sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ ncr_sc->sc_adapter.scsipi_minphys = minphys;
+
+ /*
* Fill in the prototype scsi_link.
*/
ncr_sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
ncr_sc->sc_link.adapter_softc = sc;
ncr_sc->sc_link.scsipi_scsi.adapter_target = 7;
- ncr_sc->sc_link.adapter = &sbc_ops;
+ ncr_sc->sc_link.adapter = &ncr_sc->sc_adapter;
ncr_sc->sc_link.device = &sbc_dev;
ncr_sc->sc_link.type = BUS_SCSI;
diff --git a/sys/arch/macppc/dev/esp.c b/sys/arch/macppc/dev/esp.c
index 35d0c073c3c..79d16fbd408 100644
--- a/sys/arch/macppc/dev/esp.c
+++ b/sys/arch/macppc/dev/esp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esp.c,v 1.8 1998/10/10 00:28:31 thorpej Exp $ */
+/* $NetBSD: esp.c,v 1.9 1998/11/19 21:46:41 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -116,12 +116,6 @@ struct cfattach esp_ca = {
sizeof(struct esp_softc), espmatch, espattach
};
-struct scsipi_adapter esp_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device esp_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -264,7 +258,9 @@ espattach(parent, self, aux)
shutdownhook_establish(esp_shutdownhook, sc);
/* Do the common parts of attachment. */
- ncr53c9x_attach(sc, &esp_switch, &esp_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &esp_dev);
/* Turn on target selection using the `dma' method */
ncr53c9x_dmaselect = 1;
diff --git a/sys/arch/mvme68k/dev/sbicvar.h b/sys/arch/mvme68k/dev/sbicvar.h
index 2bfe6fd6b5c..4c328f2fa27 100644
--- a/sys/arch/mvme68k/dev/sbicvar.h
+++ b/sys/arch/mvme68k/dev/sbicvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sbicvar.h,v 1.4 1997/08/27 11:23:59 bouyer Exp $ */
+/* $NetBSD: sbicvar.h,v 1.5 1998/11/19 21:47:03 thorpej Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -99,7 +99,8 @@ struct sbic_softc {
} sc_sync[8];
u_char target; /* Currently active target */
u_char lun;
- struct scsipi_link sc_link; /* proto for sub devices */
+ struct scsipi_link sc_link; /* proto for sub devices */
+ struct scsipi_adapter sc_adapter;
sbic_regmap_p sc_sbicp; /* the SBIC */
volatile void *sc_cregs; /* driver specific regs */
int sc_ipl;
diff --git a/sys/arch/mvme68k/dev/wdsc.c b/sys/arch/mvme68k/dev/wdsc.c
index cddbc745a7c..d03a89e7feb 100644
--- a/sys/arch/mvme68k/dev/wdsc.c
+++ b/sys/arch/mvme68k/dev/wdsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdsc.c,v 1.12 1998/10/10 00:28:31 thorpej Exp $ */
+/* $NetBSD: wdsc.c,v 1.13 1998/11/19 21:47:03 thorpej Exp $ */
/*
* Copyright (c) 1996 Steve Woodford
@@ -64,12 +64,6 @@ void wdsc_dmastop __P((struct sbic_softc *));
int wdsc_dmaintr __P((void *));
int wdsc_scsiintr __P((void *));
-struct scsipi_adapter wdsc_scsiswitch = {
- sbic_scsicmd,
- sbic_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device wdsc_scsidev = {
NULL, /* use default error handler */
NULL, /* do not have a start functio */
@@ -132,10 +126,13 @@ wdsc_pcc_attach(pdp, dp, auxp)
sc->sc_dmastop = wdsc_dmastop;
sc->sc_dmacmd = 0;
+ sc->sc_adapter.scsipi_cmd = sbic_scsicmd;
+ sc->sc_adapter.scsipi_minphys = sbic_minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &wdsc_scsiswitch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &wdsc_scsidev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/newsmips/dev/sc_wrap.c b/sys/arch/newsmips/dev/sc_wrap.c
index 4043b230ada..2608c004cc8 100644
--- a/sys/arch/newsmips/dev/sc_wrap.c
+++ b/sys/arch/newsmips/dev/sc_wrap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sc_wrap.c,v 1.7 1998/10/10 00:28:31 thorpej Exp $ */
+/* $NetBSD: sc_wrap.c,v 1.8 1998/11/19 21:47:21 thorpej Exp $ */
/*
* This driver is slow! Need to rewrite.
@@ -54,12 +54,6 @@ extern paddr_t kvtophys __P((vaddr_t));
static int sc_disconnect = IDT_DISCON;
-struct scsipi_adapter cxd1185_switch = {
- sc_scsi_cmd,
- minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device cxd1185_dev = {
NULL,
NULL,
@@ -95,10 +89,13 @@ cxd1185_attach(parent, self, aux)
else
sc->scsi_1185AQ = 0;
+ sc->sc_adapter.scsipi_cmd = sc_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &cxd1185_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &cxd1185_dev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/newsmips/dev/scsireg.h b/sys/arch/newsmips/dev/scsireg.h
index b91821ab406..9326246cfa2 100644
--- a/sys/arch/newsmips/dev/scsireg.h
+++ b/sys/arch/newsmips/dev/scsireg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: scsireg.h,v 1.2 1998/06/10 16:27:30 tsubai Exp $ */
+/* $NetBSD: scsireg.h,v 1.3 1998/11/19 21:47:21 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -249,6 +249,7 @@ struct sc_scb {
struct sc_softc {
struct device sc_dev;
struct scsipi_link sc_link;
+ struct scsipi_adapter sc_adapter;
TAILQ_HEAD(scb_list, sc_scb) ready_list, free_list;
struct sc_scb sc_scb[3*NTARGET];
diff --git a/sys/arch/next68k/dev/esp.c b/sys/arch/next68k/dev/esp.c
index 5aae1baf667..ec158ac88eb 100644
--- a/sys/arch/next68k/dev/esp.c
+++ b/sys/arch/next68k/dev/esp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esp.c,v 1.8 1998/10/10 00:28:31 thorpej Exp $ */
+/* $NetBSD: esp.c,v 1.9 1998/11/19 21:47:39 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -137,12 +137,6 @@ struct cfattach esp_ca = {
sizeof(struct esp_softc), espmatch_intio, espattach_intio
};
-struct scsipi_adapter esp_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device esp_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -354,7 +348,9 @@ espattach_intio(parent, self, aux)
evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
/* Do the common parts of attachment. */
- ncr53c9x_attach(sc, &esp_switch, &esp_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &esp_dev);
}
/*
diff --git a/sys/arch/pc532/dev/ncr.c b/sys/arch/pc532/dev/ncr.c
index 3f68bf548dd..bb67a88f2df 100644
--- a/sys/arch/pc532/dev/ncr.c
+++ b/sys/arch/pc532/dev/ncr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr.c,v 1.42 1998/10/10 00:28:32 thorpej Exp $ */
+/* $NetBSD: ncr.c,v 1.43 1998/11/19 21:48:00 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Matthias Pfaller.
@@ -81,12 +81,6 @@ static void ncr_wait_not_req __P((struct ncr5380_softc *sc));
*/
int ncr_default_options = 0;
-struct scsipi_adapter ncr_switch = {
- ncr5380_scsi_cmd, /* scsipi_cmd */
- minphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device ncr_dev = {
NULL, /* use default error handler */
NULL, /* do not have a start function */
@@ -138,12 +132,18 @@ ncr_attach(parent, self, aux)
printf("\n");
/*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+
+ /*
* Fill in the prototype scsi_link.
*/
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = 7;
- sc->sc_link.adapter = &ncr_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &ncr_dev;
sc->sc_link.type = BUS_SCSI;
diff --git a/sys/arch/pica/dev/asc.c b/sys/arch/pica/dev/asc.c
index e2b8d62fa96..e11d88a9a3e 100644
--- a/sys/arch/pica/dev/asc.c
+++ b/sys/arch/pica/dev/asc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: asc.c,v 1.14 1998/10/10 00:28:32 thorpej Exp $ */
+/* $NetBSD: asc.c,v 1.15 1998/11/19 21:48:28 thorpej Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -427,6 +427,7 @@ struct asc_softc {
int timeout_250; /* 250ms timeout */
int tb_ticks; /* 4ns. ticks/tb channel ticks */
struct scsipi_link sc_link; /* scsi link struct */
+ struct scsipi_adapter sc_adapter;
};
#define ASC_STATE_IDLE 0 /* idle state */
@@ -454,12 +455,6 @@ struct cfattach asc_ca = {
int asc_scsi_cmd __P((struct scsipi_xfer *));
void asc_minphys __P((struct buf *));
-struct scsipi_adapter asc_switch = {
- asc_scsi_cmd,
-/*XXX*/ asc_minphys, /* no max transfer size, DMA driver negotiates */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device asc_dev = {
/*XXX*/ NULL, /* Use default error handler */
/*XXX*/ NULL, /* have a queue, served by this */
@@ -584,12 +579,18 @@ ascattach(parent, self, aux)
printf(": NCR53C94, target %d\n", id);
/*
+ * Fill in the adapter.
+ */
+ asc->sc_adapter.scsipi_cmd = asc_scsi_cmd;
+ asc->sc_adapter.scsipi_minphys = asc_minphys;
+
+ /*
* Fill in the prototype scsipi link.
*/
asc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
asc->sc_link.adapter_softc = asc;
asc->sc_link.scsipi_scsi.adapter_target = asc->sc_id;
- asc->sc_link.adapter = &asc_switch;
+ asc->sc_link.adapter = &asc->sc_adapter;
asc->sc_link.device = &asc_dev;
asc->sc_link.openings = 2;
asc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/sparc/dev/esp_obio.c b/sys/arch/sparc/dev/esp_obio.c
index 93bf960a6a3..80108656606 100644
--- a/sys/arch/sparc/dev/esp_obio.c
+++ b/sys/arch/sparc/dev/esp_obio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esp_obio.c,v 1.3 1998/10/10 00:28:39 thorpej Exp $ */
+/* $NetBSD: esp_obio.c,v 1.4 1998/11/19 21:49:17 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -79,12 +79,6 @@ struct cfattach esp_obio_ca = {
sizeof(struct esp_softc), espmatch_obio, espattach_obio
};
-static struct scsipi_adapter esp_obio_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
static struct scsipi_device esp_obio_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -281,7 +275,9 @@ espattach_obio(parent, self, aux)
evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
/* Do the common parts of attachment. */
- ncr53c9x_attach(sc, &esp_obio_switch, &esp_obio_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &esp_obio_dev);
/* Turn on target selection using the `dma' method */
ncr53c9x_dmaselect = 1;
diff --git a/sys/arch/sparc/dev/si.c b/sys/arch/sparc/dev/si.c
index 06a252ee1c4..f193e660492 100644
--- a/sys/arch/sparc/dev/si.c
+++ b/sys/arch/sparc/dev/si.c
@@ -1,4 +1,4 @@
-/* $NetBSD: si.c,v 1.49 1998/10/10 00:28:39 thorpej Exp $ */
+/* $NetBSD: si.c,v 1.50 1998/11/19 21:49:17 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -243,12 +243,6 @@ void si_obio_dma_stop __P((struct ncr5380_softc *));
void si_obio_intr_on __P((struct ncr5380_softc *));
void si_obio_intr_off __P((struct ncr5380_softc *));
-static struct scsipi_adapter si_ops = {
- ncr5380_scsi_cmd, /* scsipi_cmd() */
- si_minphys, /* scsipi_minphys() */
- NULL, /* scsipi_ioctl() */
-};
-
/* This is copied from julian's bt driver */
/* "so we have a default dev struct for our link struct." */
static struct scsipi_device si_dev = {
@@ -465,12 +459,18 @@ si_attach_common(parent, sc)
regs = sc->sc_regs;
/*
+ * Fill in the adapter.
+ */
+ ncr_sc->sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ ncr_sc->sc_adapter.scsipi_minphys = si_minphys;
+
+ /*
* Fill in the prototype scsipi_link.
*/
ncr_sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
ncr_sc->sc_link.adapter_softc = sc;
ncr_sc->sc_link.scsipi_scsi.adapter_target = 7;
- ncr_sc->sc_link.adapter = &si_ops;
+ ncr_sc->sc_link.adapter = &ncr_sc->sc_adapter;
ncr_sc->sc_link.device = &si_dev;
/*
diff --git a/sys/arch/sun3/dev/esp.c b/sys/arch/sun3/dev/esp.c
index a0ae1ffdaa7..22f43dad9f3 100644
--- a/sys/arch/sun3/dev/esp.c
+++ b/sys/arch/sun3/dev/esp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: esp.c,v 1.8 1998/10/10 00:28:39 thorpej Exp $ */
+/* $NetBSD: esp.c,v 1.9 1998/11/19 21:49:46 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -83,12 +83,6 @@ struct cfattach esp_ca = {
sizeof(struct esp_softc), espmatch, espattach
};
-struct scsipi_adapter esp_switch = {
- ncr53c9x_scsi_cmd,
- minphys, /* no max at this level; handled by DMA code */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device esp_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -300,7 +294,9 @@ espattach(parent, self, aux)
evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
/* Do the common parts of attachment. */
- ncr53c9x_attach(sc, &esp_switch, &esp_dev);
+ sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = minphys;
+ ncr53c9x_attach(sc, &esp_dev);
}
diff --git a/sys/arch/sun3/dev/si.c b/sys/arch/sun3/dev/si.c
index de912b96a54..0cee939451c 100644
--- a/sys/arch/sun3/dev/si.c
+++ b/sys/arch/sun3/dev/si.c
@@ -1,4 +1,4 @@
-/* $NetBSD: si.c,v 1.40 1998/10/10 00:28:39 thorpej Exp $ */
+/* $NetBSD: si.c,v 1.41 1998/11/19 21:49:46 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -118,12 +118,6 @@ int si_dma_intr_timo = 500; /* ticks (sec. X 100) */
static void si_minphys __P((struct buf *));
-static struct scsipi_adapter si_ops = {
- ncr5380_scsi_cmd, /* scsipi_cmd() */
- si_minphys, /* scsipi_minphys() */
- NULL, /* scsipi_ioctl() */
-};
-
/* This is copied from julian's bt driver */
/* "so we have a default dev struct for our link struct." */
static struct scsipi_device si_dev = {
@@ -168,12 +162,18 @@ si_attach(sc)
ncr_sc->sc_min_dma_len = MIN_DMA_LEN;
/*
+ * Fill in the adapter.
+ */
+ ncr_sc->sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ ncr_sc->sc_adapter.scsipi_minphys = si_minphys;
+
+ /*
* Fill in the prototype scsi_link.
*/
ncr_sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
ncr_sc->sc_link.adapter_softc = sc;
ncr_sc->sc_link.scsipi_scsi.adapter_target = 7;
- ncr_sc->sc_link.adapter = &si_ops;
+ ncr_sc->sc_link.adapter = &ncr_sc->sc_adapter;
ncr_sc->sc_link.device = &si_dev;
ncr_sc->sc_link.type = BUS_SCSI;
diff --git a/sys/arch/sun3/dev/si_sebuf.c b/sys/arch/sun3/dev/si_sebuf.c
index 7cdc2ab202e..de17be061f7 100644
--- a/sys/arch/sun3/dev/si_sebuf.c
+++ b/sys/arch/sun3/dev/si_sebuf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: si_sebuf.c,v 1.6 1998/10/10 00:28:39 thorpej Exp $ */
+/* $NetBSD: si_sebuf.c,v 1.7 1998/11/19 21:49:46 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -143,11 +143,6 @@ struct cfattach si_sebuf_ca = {
};
static void se_minphys __P((struct buf *));
-static struct scsipi_adapter se_ops = {
- ncr5380_scsi_cmd, /* scsipi_cmd() */
- se_minphys, /* scsipi_minphys() */
- NULL, /* scsipi_ioctl() */
-};
/* This is copied from julian's bt driver */
/* "so we have a default dev struct for our link struct." */
@@ -260,12 +255,18 @@ se_attach(parent, self, args)
ncr_sc->sc_min_dma_len = MIN_DMA_LEN;
/*
+ * Fill in the adapter.
+ */
+ ncr_sc->sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ ncr_sc->sc_adapter.scsipi_minphys = se_minphys;
+
+ /*
* Fill in the prototype scsi_link.
*/
ncr_sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
ncr_sc->sc_link.adapter_softc = sc;
ncr_sc->sc_link.scsipi_scsi.adapter_target = 7;
- ncr_sc->sc_link.adapter = &se_ops;
+ ncr_sc->sc_link.adapter = &ncr_sc->sc_adapter;
ncr_sc->sc_link.device = &se_dev;
ncr_sc->sc_link.type = BUS_SCSI;
diff --git a/sys/arch/vax/vsa/ncr.c b/sys/arch/vax/vsa/ncr.c
index 411ae9f70b0..f4bc454f335 100644
--- a/sys/arch/vax/vsa/ncr.c
+++ b/sys/arch/vax/vsa/ncr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr.c,v 1.14 1998/10/10 00:28:32 thorpej Exp $ */
+/* $NetBSD: ncr.c,v 1.15 1998/11/19 21:50:02 thorpej Exp $ */
#define USE_VMAPBUF
@@ -255,12 +255,6 @@ void si_dma_start __P((struct ncr5380_softc *));
void si_dma_eop __P((struct ncr5380_softc *));
void si_dma_stop __P((struct ncr5380_softc *));
-static struct scsipi_adapter si_ops = {
- ncr5380_scsi_cmd, /* scsipi_cmd() */
- si_minphys, /* scsipi_minphys() */
- NULL, /* scsipi_ioctl() */
-};
-
/* This is copied from julian's bt driver */
/* "so we have a default dev struct for our link struct." */
static struct scsipi_device si_dev = {
@@ -400,13 +394,20 @@ si_attach(parent, self, aux)
sc->sc_dsize = ca->ca_dsize;
sc->sc_dflags = 4; /* XXX */
sc->sc_xflags = ca->ca_dflag; /* should/will be renamed */
+
+ /*
+ * Fill in the adapter.
+ */
+ ncr_sc->sc_adapter.scsipi_cmd = ncr5380_scsi_cmd;
+ ncr_sc->sc_adapter.scsipi_minphys = si_minphys;
+
/*
* Fill in the prototype scsi_link.
*/
ncr_sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
ncr_sc->sc_link.adapter_softc = sc;
ncr_sc->sc_link.scsipi_scsi.adapter_target = ca->ca_idval;
- ncr_sc->sc_link.adapter = &si_ops;
+ ncr_sc->sc_link.adapter = &ncr_sc->sc_adapter;
ncr_sc->sc_link.device = &si_dev;
ncr_sc->sc_link.type = BUS_SCSI;
diff --git a/sys/arch/x68k/dev/mha.c b/sys/arch/x68k/dev/mha.c
index b20a4d084b2..693f8770ff7 100644
--- a/sys/arch/x68k/dev/mha.c
+++ b/sys/arch/x68k/dev/mha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mha.c,v 1.9 1998/10/10 00:28:39 thorpej Exp $ */
+/* $NetBSD: mha.c,v 1.10 1998/11/19 21:50:30 thorpej Exp $ */
/*
* Copyright (c) 1996 Masaru Oki, Takumi Nakamura and Masanobu Saitoh. All rights reserved.
@@ -254,12 +254,6 @@ struct cfattach mha_ca = {
extern struct cfdriver mha_cd;
-struct scsipi_adapter mha_switch = {
- mha_scsi_cmd,
- mha_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device mha_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -332,12 +326,18 @@ mhaattach(parent, self, aux)
sc->sc_phase = BUSFREE_PHASE;
/*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = mha_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = mha_minphys;
+
+ /*
* Fill in the prototype scsi_link
*/
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = sc->sc_id;
- sc->sc_link.adapter = &mha_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &mha_dev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/arch/x68k/dev/mhavar.h b/sys/arch/x68k/dev/mhavar.h
index d8c98f74aec..7a5d001f84c 100644
--- a/sys/arch/x68k/dev/mhavar.h
+++ b/sys/arch/x68k/dev/mhavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mhavar.h,v 1.1 1997/10/19 09:29:36 oki Exp $ */
+/* $NetBSD: mhavar.h,v 1.2 1998/11/19 21:50:30 thorpej Exp $ */
/*
* Copyright (c) 1994 Peter Galbavy. All rights reserved.
@@ -92,6 +92,7 @@ struct mha_softc {
volatile u_char *sc_pcx;
struct scsipi_link sc_link; /* prototype for subdevs */
+ struct scsipi_adapter sc_adapter;
TAILQ_HEAD(, acb) free_list, ready_list, nexus_list;
struct acb *sc_nexus; /* current command */
diff --git a/sys/arch/x68k/dev/spc.c b/sys/arch/x68k/dev/spc.c
index 47db9eb6e00..3c4eb597b91 100644
--- a/sys/arch/x68k/dev/spc.c
+++ b/sys/arch/x68k/dev/spc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: spc.c,v 1.17 1998/10/10 00:28:40 thorpej Exp $ */
+/* $NetBSD: spc.c,v 1.18 1998/11/19 21:50:30 thorpej Exp $ */
#define integrate __inline static
@@ -266,6 +266,7 @@ struct spc_softc {
volatile struct mb89352 *sc_iobase;
struct scsipi_link sc_link; /* prototype for subdevs */
+ struct scsipi_adapter sc_adapter;
TAILQ_HEAD(, spc_acb) free_list, ready_list, nexus_list;
struct spc_acb *sc_nexus; /* current command */
@@ -386,12 +387,6 @@ struct cfattach spc_ca = {
extern struct cfdriver spc_cd;
-struct scsipi_adapter spc_switch = {
- spc_scsi_cmd,
- spc_minphys,
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device spc_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -466,12 +461,18 @@ spcattach(parent, self, aux)
spc_init(sc); /* Init chip and driver */
/*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = spc_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = spc_minphys;
+
+ /*
* Fill in the prototype scsipi_link
*/
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = sc->sc_initiator;
- sc->sc_link.adapter = &spc_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &spc_dev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/dev/eisa/ahb.c b/sys/dev/eisa/ahb.c
index 2d92502b1b6..eddc0902748 100644
--- a/sys/dev/eisa/ahb.c
+++ b/sys/dev/eisa/ahb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ahb.c,v 1.24 1998/10/10 00:28:28 thorpej Exp $ */
+/* $NetBSD: ahb.c,v 1.25 1998/11/19 21:50:47 thorpej Exp $ */
#include "opt_ddb.h"
@@ -112,6 +112,7 @@ struct ahb_softc {
struct ahb_ecb *sc_immed_ecb; /* an outstanding immediete command */
int sc_numecbs;
struct scsipi_link sc_link;
+ struct scsipi_adapter sc_adapter;
LIST_HEAD(, scsipi_xfer) sc_queue;
struct scsipi_xfer *sc_queuelast;
@@ -147,12 +148,6 @@ struct scsipi_xfer *ahb_dequeue __P((struct ahb_softc *));
integrate void ahb_reset_ecb __P((struct ahb_softc *, struct ahb_ecb *));
integrate int ahb_init_ecb __P((struct ahb_softc *, struct ahb_ecb *));
-struct scsipi_adapter ahb_switch = {
- ahb_scsi_cmd, /* scsipi_cmd */
- ahbminphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
/* the below structure is so we have a default dev struct for our link struct */
struct scsipi_device ahb_dev = {
NULL, /* Use default error handler */
@@ -254,12 +249,18 @@ ahbattach(parent, self, aux)
}
/*
+ * Fill in the adapter switch.
+ */
+ sc->sc_adapter.scsipi_cmd = ahb_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = ahbminphys;
+
+ /*
* fill in the prototype scsipi_link.
*/
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = apd.sc_scsi_dev;
- sc->sc_link.adapter = &ahb_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &ahb_dev;
sc->sc_link.openings = 4;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c
index d2adb2e0510..ac37363bb17 100644
--- a/sys/dev/ic/adv.c
+++ b/sys/dev/ic/adv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */
+/* $NetBSD: adv.c,v 1.7 1998/11/19 21:52:58 thorpej Exp $ */
/*
* Generic driver for the Advanced Systems Inc. Narrow SCSI controllers
@@ -99,14 +99,6 @@ static void adv_watchdog __P((void *));
/******************************************************************************/
-struct scsipi_adapter adv_switch =
-{
- adv_scsi_cmd, /* called to start/enqueue a SCSI command */
- advminphys, /* to limit the transfer to max device can do */
- NULL, /* scsipi_ioctl */
-};
-
-
/* the below structure is so we have a default dev struct for out link struct */
struct scsipi_device adv_dev =
{
@@ -569,6 +561,11 @@ adv_attach(sc)
sc->sc_dev.dv_xname);
}
+ /*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = adv_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = advminphys;
/*
* fill in the prototype scsipi_link.
@@ -576,7 +573,7 @@ adv_attach(sc)
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = sc->chip_scsi_id;
- sc->sc_link.adapter = &adv_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &adv_dev;
sc->sc_link.openings = 4;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/dev/ic/advlib.h b/sys/dev/ic/advlib.h
index 2503b5457e5..8e0e1db1442 100644
--- a/sys/dev/ic/advlib.h
+++ b/sys/dev/ic/advlib.h
@@ -1,4 +1,4 @@
-/* $NetBSD: advlib.h,v 1.5 1998/10/28 20:39:46 dante Exp $ */
+/* $NetBSD: advlib.h,v 1.6 1998/11/19 21:52:58 thorpej Exp $ */
/*
* Definitions for low level routines and data structures
@@ -841,6 +841,7 @@ typedef struct asc_softc
struct adv_control *sc_control; /* control structures */
TAILQ_HEAD(, adv_ccb) sc_free_ccb, sc_waiting_ccb;
struct scsipi_link sc_link; /* prototype for devs */
+ struct scsipi_adapter sc_adapter;
LIST_HEAD(, scsipi_xfer) sc_queue;
struct scsipi_xfer *sc_queuelast;
diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c
index 69be65f522d..4fadccddc6b 100644
--- a/sys/dev/ic/adw.c
+++ b/sys/dev/ic/adw.c
@@ -1,4 +1,4 @@
-/* $NetBSD: adw.c,v 1.3 1998/10/10 00:28:33 thorpej Exp $ */
+/* $NetBSD: adw.c,v 1.4 1998/11/19 21:52:59 thorpej Exp $ */
/*
* Generic driver for the Advanced Systems Inc. SCSI controllers
@@ -96,14 +96,6 @@ static void adw_watchdog __P((void *));
/******************************************************************************/
-struct scsipi_adapter adw_switch =
-{
- adw_scsi_cmd, /* called to start/enqueue a SCSI command */
- adwminphys, /* to limit the transfer to max device can do */
- NULL, /* scsipi_ioctl */
-};
-
-
/* the below structure is so we have a default dev struct for out link struct */
struct scsipi_device adw_dev =
{
@@ -460,6 +452,11 @@ adw_attach(sc)
break;
}
+ /*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = adw_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = adwminphys;
/*
* fill in the prototype scsipi_link.
@@ -467,7 +464,7 @@ adw_attach(sc)
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = sc->chip_scsi_id;
- sc->sc_link.adapter = &adw_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &adw_dev;
sc->sc_link.openings = 4;
sc->sc_link.scsipi_scsi.max_target = ADW_MAX_TID;
diff --git a/sys/dev/ic/adwlib.h b/sys/dev/ic/adwlib.h
index a43a87fcdd9..5eb2e2df837 100644
--- a/sys/dev/ic/adwlib.h
+++ b/sys/dev/ic/adwlib.h
@@ -1,4 +1,4 @@
-/* $NetBSD: adwlib.h,v 1.1 1998/09/26 16:10:42 dante Exp $ */
+/* $NetBSD: adwlib.h,v 1.2 1998/11/19 21:52:59 thorpej Exp $ */
/*
* Definitions for low level routines and data structures
@@ -695,6 +695,7 @@ typedef struct adw_softc {
struct adw_control *sc_control; /* control structures */
TAILQ_HEAD(, adw_ccb) sc_free_ccb, sc_waiting_ccb;
struct scsipi_link sc_link; /* prototype for devs */
+ struct scsipi_adapter sc_adapter;
LIST_HEAD(, scsipi_xfer) sc_queue;
struct scsipi_xfer *sc_queuelast;
diff --git a/sys/dev/ic/aha.c b/sys/dev/ic/aha.c
index af3d69b39fd..c842a4029e8 100644
--- a/sys/dev/ic/aha.c
+++ b/sys/dev/ic/aha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aha.c,v 1.19 1998/10/10 00:28:33 thorpej Exp $ */
+/* $NetBSD: aha.c,v 1.20 1998/11/19 21:52:59 thorpej Exp $ */
#include "opt_ddb.h"
@@ -115,12 +115,6 @@ int aha_create_ccbs __P((struct aha_softc *, struct aha_ccb *, int));
void aha_enqueue __P((struct aha_softc *, struct scsipi_xfer *, int));
struct scsipi_xfer *aha_dequeue __P((struct aha_softc *));
-struct scsipi_adapter aha_switch = {
- aha_scsi_cmd, /* scsipi_cmd */
- ahaminphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
/* the below structure is so we have a default dev struct for out link struct */
struct scsipi_device aha_dev = {
NULL, /* Use default error handler */
@@ -316,12 +310,18 @@ aha_attach(sc, apd)
LIST_INIT(&sc->sc_queue);
/*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = aha_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = ahaminphys;
+
+ /*
* fill in the prototype scsipi_link.
*/
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = apd->sc_scsi_dev;
- sc->sc_link.adapter = &aha_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &aha_dev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/dev/ic/ahavar.h b/sys/dev/ic/ahavar.h
index 8717cd12ca2..ccfb8942a4a 100644
--- a/sys/dev/ic/ahavar.h
+++ b/sys/dev/ic/ahavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ahavar.h,v 1.8 1998/08/15 10:51:17 mycroft Exp $ */
+/* $NetBSD: ahavar.h,v 1.9 1998/11/19 21:52:59 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -86,6 +86,7 @@ struct aha_softc {
TAILQ_HEAD(, aha_ccb) sc_free_ccb, sc_waiting_ccb;
int sc_mbofull;
struct scsipi_link sc_link; /* prototype for devs */
+ struct scsipi_adapter sc_adapter;
LIST_HEAD(, scsipi_xfer) sc_queue;
struct scsipi_xfer *sc_queuelast;
diff --git a/sys/dev/ic/aic6360.c b/sys/dev/ic/aic6360.c
index 3c226bbcb24..5eb227e4b6b 100644
--- a/sys/dev/ic/aic6360.c
+++ b/sys/dev/ic/aic6360.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aic6360.c,v 1.59 1998/10/10 00:28:33 thorpej Exp $ */
+/* $NetBSD: aic6360.c,v 1.60 1998/11/19 21:52:59 thorpej Exp $ */
#include "opt_ddb.h"
#ifdef DDB
@@ -183,12 +183,6 @@ void aic_show_scsi_cmd __P((struct aic_acb *));
void aic_print_active_acb __P((void));
#endif
-struct scsipi_adapter aic_switch = {
- aic_scsi_cmd, /* scsipi_cmd */
- aic_minphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
struct scsipi_device aic_dev = {
NULL, /* Use default error handler */
NULL, /* have a queue, served by this */
@@ -279,12 +273,18 @@ aicattach(sc)
aic_init(sc); /* Init chip and driver */
/*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = aic_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = aic_minphys;
+
+ /*
* Fill in the prototype scsipi_link
*/
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = sc->sc_initiator;
- sc->sc_link.adapter = &aic_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &aic_dev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/dev/ic/aic6360var.h b/sys/dev/ic/aic6360var.h
index a16882c0d27..24a23e9c08d 100644
--- a/sys/dev/ic/aic6360var.h
+++ b/sys/dev/ic/aic6360var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: aic6360var.h,v 1.2 1997/10/16 22:57:02 enami Exp $ */
+/* $NetBSD: aic6360var.h,v 1.3 1998/11/19 21:52:59 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
@@ -118,6 +118,7 @@ struct aic_softc {
bus_space_handle_t sc_ioh;
struct scsipi_link sc_link; /* prototype for subdevs */
+ struct scsipi_adapter sc_adapter;
TAILQ_HEAD(, aic_acb) free_list, ready_list, nexus_list;
struct aic_acb *sc_nexus; /* current command */
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index 33160d6826e..7fe637007fe 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aic7xxx.c,v 1.31 1998/10/10 00:28:33 thorpej Exp $ */
+/* $NetBSD: aic7xxx.c,v 1.32 1998/11/19 21:52:59 thorpej Exp $ */
/*
* Generic driver for the aic7xxx based adaptec SCSI controllers
@@ -218,20 +218,18 @@ static inline void unpause_sequencer __P((struct ahc_data *ahc,
int unpause_always));
static inline void restart_sequencer __P((struct ahc_data *ahc));
+#if !defined(__NetBSD__)
static struct scsipi_adapter ahc_switch =
{
ahc_scsi_cmd,
ahcminphys,
-#if defined(__NetBSD__)
- NULL, /* scsipi_ioctl */
-#elif defined(__FreeBSD__)
0,
0,
0,
"ahc",
{ 0, 0 }
-#endif
};
+#endif
/* the below structure is so we have a default dev struct for our link struct */
static struct scsipi_device ahc_dev =
@@ -659,6 +657,15 @@ ahc_attach(ahc)
if (cpu_class == CPUCLASS_386) /* doesn't have "wbinvd" instruction */
ahc_broken_cache = 0;
#endif
+
+#if defined(__NetBSD__)
+ /*
+ * Fill in the adapter.
+ */
+ ahc->sc_adapter.scsipi_cmd = ahc_scsi_cmd;
+ ahc->sc_adapter.scsipi_minphys = ahcminphys;
+#endif
+
/*
* fill in the prototype scsi_links.
*/
@@ -676,7 +683,11 @@ ahc_attach(ahc)
ahc->sc_link.scsipi_scsi.max_target = (ahc->type & AHC_WIDE) ? 15 : 7;
#endif
ahc->sc_link.adapter_softc = ahc;
+#if defined(__NetBSD__)
+ ahc->sc_link.adapter = &ahc->sc_adapter;
+#else
ahc->sc_link.adapter = &ahc_switch;
+#endif
ahc->sc_link.opennings = 2;
ahc->sc_link.device = &ahc_dev;
#ifndef __NetBSD__
diff --git a/sys/dev/ic/aic7xxxvar.h b/sys/dev/ic/aic7xxxvar.h
index 60f34117955..df3aa6fe206 100644
--- a/sys/dev/ic/aic7xxxvar.h
+++ b/sys/dev/ic/aic7xxxvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: aic7xxxvar.h,v 1.17 1998/06/22 20:02:54 sommerfe Exp $ */
+/* $NetBSD: aic7xxxvar.h,v 1.18 1998/11/19 21:53:00 thorpej Exp $ */
/*
* Interface to the generic driver for the aic7xxx based adaptec
@@ -269,6 +269,7 @@ struct ahc_data {
#ifdef __NetBSD__
struct scsipi_link sc_link;
struct scsipi_link sc_link_b; /* Second bus for Twin channel cards */
+ struct scsipi_adapter sc_adapter;
#else
struct scsi_link sc_link;
struct scsi_link sc_link_b; /* Second bus for Twin channel cards */
diff --git a/sys/dev/ic/bha.c b/sys/dev/ic/bha.c
index 339070fc121..8b632516f1b 100644
--- a/sys/dev/ic/bha.c
+++ b/sys/dev/ic/bha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bha.c,v 1.26 1998/10/10 00:28:34 thorpej Exp $ */
+/* $NetBSD: bha.c,v 1.27 1998/11/19 21:53:00 thorpej Exp $ */
#include "opt_ddb.h"
#undef BHADIAG
@@ -113,12 +113,6 @@ int bha_create_ccbs __P((struct bha_softc *, struct bha_ccb *, int));
void bha_enqueue __P((struct bha_softc *, struct scsipi_xfer *, int));
struct scsipi_xfer *bha_dequeue __P((struct bha_softc *));
-struct scsipi_adapter bha_switch = {
- bha_scsi_cmd, /* scsipi_ioctl */
- bhaminphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
/* the below structure is so we have a default dev struct for out link struct */
struct scsipi_device bha_dev = {
NULL, /* Use default error handler */
@@ -318,12 +312,18 @@ bha_attach(sc, bpd)
{
/*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = bha_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = bhaminphys;
+
+ /*
* fill in the prototype scsipi_link.
*/
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = bpd->sc_scsi_dev;
- sc->sc_link.adapter = &bha_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &bha_dev;
sc->sc_link.openings = 4;
sc->sc_link.scsipi_scsi.max_target = bpd->sc_iswide ? 15 : 7;
diff --git a/sys/dev/ic/bhavar.h b/sys/dev/ic/bhavar.h
index e6ee857e0a8..228f9fbf55b 100644
--- a/sys/dev/ic/bhavar.h
+++ b/sys/dev/ic/bhavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: bhavar.h,v 1.11 1998/08/15 10:51:18 mycroft Exp $ */
+/* $NetBSD: bhavar.h,v 1.12 1998/11/19 21:53:00 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -87,6 +87,7 @@ struct bha_softc {
TAILQ_HEAD(, bha_ccb) sc_free_ccb, sc_waiting_ccb;
int sc_mbofull;
struct scsipi_link sc_link; /* prototype for devs */
+ struct scsipi_adapter sc_adapter;
LIST_HEAD(, scsipi_xfer) sc_queue;
struct scsipi_xfer *sc_queuelast;
diff --git a/sys/dev/ic/isp_netbsd.c b/sys/dev/ic/isp_netbsd.c
index 8af4c72454d..be4e634d397 100644
--- a/sys/dev/ic/isp_netbsd.c
+++ b/sys/dev/ic/isp_netbsd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.5 1998/10/10 00:28:34 thorpej Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.6 1998/11/19 21:53:00 thorpej Exp $ */
/*
* Platform (NetBSD) dependent common attachment code for Qlogic adapters.
*
@@ -51,12 +51,6 @@
static void ispminphys __P((struct buf *));
static int32_t ispcmd __P((ISP_SCSI_XFER_T *));
-static struct scsipi_adapter isp_switch = {
- ispcmd, /* scsipi_cmd */
- ispminphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
static struct scsipi_device isp_dev = { NULL, NULL, NULL, NULL };
static int isp_poll __P((struct ispsoftc *, ISP_SCSI_XFER_T *, int));
@@ -67,11 +61,15 @@ void
isp_attach(isp)
struct ispsoftc *isp;
{
+
+ isp->isp_osinfo._adapter.scsipi_cmd = ispcmd;
+ isp->isp_osinfo._adapter.scsipi_minphys = ispminphys;
+
isp->isp_state = ISP_RUNSTATE;
isp->isp_osinfo._link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
isp->isp_osinfo._link.adapter_softc = isp;
isp->isp_osinfo._link.device = &isp_dev;
- isp->isp_osinfo._link.adapter = &isp_switch;
+ isp->isp_osinfo._link.adapter = &isp->isp_osinfo._adapter;
if (isp->isp_type & ISP_HA_FC) {
isp->isp_osinfo._link.scsipi_scsi.max_target = MAX_FC_TARG-1;
diff --git a/sys/dev/ic/isp_netbsd.h b/sys/dev/ic/isp_netbsd.h
index 9e00c88046a..062f16b5738 100644
--- a/sys/dev/ic/isp_netbsd.h
+++ b/sys/dev/ic/isp_netbsd.h
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.h,v 1.4 1998/09/17 22:50:53 mjacob Exp $ */
+/* $NetBSD: isp_netbsd.h,v 1.5 1998/11/19 21:53:00 thorpej Exp $ */
/*
* NetBSD Specific definitions for the Qlogic ISP Host Adapter
*
@@ -68,6 +68,7 @@
struct isposinfo {
struct device _dev;
struct scsipi_link _link;
+ struct scsipi_adapter _adapter;
};
#define MAXISPREQUEST 256
diff --git a/sys/dev/ic/ncr5380var.h b/sys/dev/ic/ncr5380var.h
index d06f9068461..4aa4b91f8a7 100644
--- a/sys/dev/ic/ncr5380var.h
+++ b/sys/dev/ic/ncr5380var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr5380var.h,v 1.12 1998/10/26 04:42:47 scottr Exp $ */
+/* $NetBSD: ncr5380var.h,v 1.13 1998/11/19 21:53:00 thorpej Exp $ */
/*
* Copyright (c) 1995 David Jones, Gordon W. Ross
@@ -107,6 +107,7 @@ struct sci_req {
struct ncr5380_softc {
struct device sc_dev;
struct scsipi_link sc_link;
+ struct scsipi_adapter sc_adapter;
#ifdef NCR5380_USE_BUS_SPACE
/* Pointers to bus_space */
diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c
index 557dd00e883..6136eff6870 100644
--- a/sys/dev/ic/ncr53c9x.c
+++ b/sys/dev/ic/ncr53c9x.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr53c9x.c,v 1.27 1998/08/15 10:51:18 mycroft Exp $ */
+/* $NetBSD: ncr53c9x.c,v 1.28 1998/11/19 21:53:00 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -149,9 +149,8 @@ const char *ncr53c9x_variant_names[] = {
* Attach this instance, and then all the sub-devices
*/
void
-ncr53c9x_attach(sc, adapter, dev)
+ncr53c9x_attach(sc, dev)
struct ncr53c9x_softc *sc;
- struct scsipi_adapter *adapter;
struct scsipi_device *dev;
{
@@ -217,7 +216,7 @@ ncr53c9x_attach(sc, adapter, dev)
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = sc->sc_id;
- sc->sc_link.adapter = adapter;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = dev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/dev/ic/ncr53c9xvar.h b/sys/dev/ic/ncr53c9xvar.h
index 9e53e93b9bc..a2ae9ec9316 100644
--- a/sys/dev/ic/ncr53c9xvar.h
+++ b/sys/dev/ic/ncr53c9xvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr53c9xvar.h,v 1.15 1998/09/01 22:56:00 pk Exp $ */
+/* $NetBSD: ncr53c9xvar.h,v 1.16 1998/11/19 21:53:00 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -231,7 +231,8 @@ struct ncr53c9x_softc {
struct device sc_dev; /* us as a device */
struct evcnt sc_intrcnt; /* intr count */
- struct scsipi_link sc_link; /* scsipi lint struct */
+ struct scsipi_link sc_link; /* scsipi link struct */
+ struct scsipi_adapter sc_adapter; /* scsipi adapter glue */
struct ncr53c9x_glue *sc_glue; /* glue to MD code */
@@ -389,8 +390,7 @@ struct ncr53c9x_softc {
#define ncr53c9x_cpb2stp(sc, cpb) \
((250 * (cpb)) / (sc)->sc_freq)
-void ncr53c9x_attach __P((struct ncr53c9x_softc *,
- struct scsipi_adapter *, struct scsipi_device *));
+void ncr53c9x_attach __P((struct ncr53c9x_softc *, struct scsipi_device *));
int ncr53c9x_scsi_cmd __P((struct scsipi_xfer *));
void ncr53c9x_reset __P((struct ncr53c9x_softc *));
int ncr53c9x_intr __P((struct ncr53c9x_softc *));
diff --git a/sys/dev/ic/uha.c b/sys/dev/ic/uha.c
index 97ad5994c4c..0b2329ed5df 100644
--- a/sys/dev/ic/uha.c
+++ b/sys/dev/ic/uha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uha.c,v 1.18 1998/10/10 00:28:34 thorpej Exp $ */
+/* $NetBSD: uha.c,v 1.19 1998/11/19 21:53:00 thorpej Exp $ */
#undef UHADEBUG
#ifdef DDB
@@ -104,12 +104,6 @@ int uha_create_mscps __P((struct uha_softc *, struct uha_mscp *, int));
void uha_enqueue __P((struct uha_softc *, struct scsipi_xfer *, int));
struct scsipi_xfer *uha_dequeue __P((struct uha_softc *));
-struct scsipi_adapter uha_switch = {
- uha_scsi_cmd, /* scsipi_cmd */
- uhaminphys, /* scsipi_minphys */
- NULL, /* scsipi_ioctl */
-};
-
/* the below structure is so we have a default dev struct for out link struct */
struct scsipi_device uha_dev = {
NULL, /* Use default error handler */
@@ -178,12 +172,18 @@ uha_attach(sc, upd)
(sc->init)(sc);
/*
+ * Fill in the adapter.
+ */
+ sc->sc_adapter.scsipi_cmd = uha_scsi_cmd;
+ sc->sc_adapter.scsipi_minphys = uhaminphys;
+
+ /*
* fill in the prototype scsipi_link.
*/
sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
sc->sc_link.adapter_softc = sc;
sc->sc_link.scsipi_scsi.adapter_target = upd->sc_scsi_dev;
- sc->sc_link.adapter = &uha_switch;
+ sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &uha_dev;
sc->sc_link.openings = 2;
sc->sc_link.scsipi_scsi.max_target = 7;
diff --git a/sys/dev/ic/uhavar.h b/sys/dev/ic/uhavar.h
index 0a910d4017f..935c3a3678e 100644
--- a/sys/dev/ic/uhavar.h
+++ b/sys/dev/ic/uhavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: uhavar.h,v 1.9 1998/08/15 10:51:18 mycroft Exp $ */
+/* $NetBSD: uhavar.h,v 1.10 1998/11/19 21:53:00 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,6 +65,7 @@ struct uha_softc {
TAILQ_HEAD(, uha_mscp) sc_free_mscp;
int sc_nummscps;
struct scsipi_link sc_link;
+ struct scsipi_adapter sc_adapter;
LIST_HEAD(, scsipi_xfer) sc_queue;
struct scsipi_xfer *sc_queuelast;
diff --git a/sys/dev/ic/wdcvar.h b/sys/dev/ic/wdcvar.h
index 289bd07249f..41d90e8636c 100644
--- a/sys/dev/ic/wdcvar.h
+++ b/sys/dev/ic/wdcvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: wdcvar.h,v 1.7 1998/11/17 14:14:52 bouyer Exp $ */
+/* $NetBSD: wdcvar.h,v 1.8 1998/11/19 21:53:00 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -36,6 +36,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+/* XXX for scsipi_adapter */
+#include <dev/scsipi/scsipi_all.h>
+#include <dev/scsipi/scsipiconf.h>
+
#define WAITTIME (10 * hz) /* time to wait for a completion */
/* this is a lot for hard drives, but not for cdroms */
@@ -91,6 +95,11 @@ struct wdc_softc { /* Per controller state */
int nchannels; /* Number of channels on this controller */
struct channel_softc *channels; /* channels-specific datas (array) */
+ /*
+ * The reference count here is used for both IDE and ATAPI devices.
+ */
+ struct scsipi_adapter sc_atapi_adapter;
+
/* if WDC_CAPABILITY_DMA set in 'cap' */
void *dma_arg;
int (*dma_init) __P((void *, int, int, void *, size_t,