diff options
47 files changed, 308 insertions, 281 deletions
diff --git a/sys/arch/luna88k/dev/mb89352.c b/sys/arch/luna88k/dev/mb89352.c index 5ad197b370f..e2d208e3242 100644 --- a/sys/arch/luna88k/dev/mb89352.c +++ b/sys/arch/luna88k/dev/mb89352.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mb89352.c,v 1.26 2020/07/16 21:18:29 krw Exp $ */ +/* $OpenBSD: mb89352.c,v 1.27 2020/07/19 18:57:57 krw Exp $ */ /* $NetBSD: mb89352.c,v 1.5 2000/03/23 07:01:31 thorpej Exp $ */ /* NecBSD: mb89352.c,v 1.4 1998/03/14 07:31:20 kmatsuda Exp */ @@ -214,13 +214,14 @@ spc_attach(struct spc_softc *sc, struct scsi_adapter *adapter) spc_init(sc); /* Init chip and driver */ - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_initiator; - sc->sc_link.adapter = adapter; sc->sc_link.openings = 2; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_initiator; + saa.saa_adapter = adapter; + saa.saa_luns = saa.saa_adapter_buswidth = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index 69813cb27a9..c86d02e142f 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsk.c,v 1.58 2020/07/16 21:18:29 krw Exp $ */ +/* $OpenBSD: vdsk.c,v 1.59 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2009, 2011 Mark Kettenis * @@ -345,15 +345,15 @@ vdsk_attach(struct device *parent, struct device *self, void *aux) scsi_iopool_init(&sc->sc_iopool, sc, vdsk_io_get, vdsk_io_put); - sc->sc_link.adapter = &vdsk_switch; - sc->sc_link.adapter_softc = self; - sc->sc_link.adapter_buswidth = 1; - sc->sc_link.luns = 1; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; sc->sc_link.openings = sc->sc_vd->vd_nentries - 1; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &vdsk_switch; + saa.saa_adapter_softc = self; + saa.saa_adapter_buswidth = 1; + saa.saa_luns = 1; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; config_found(self, &saa, scsiprint); diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c index 677714bedd9..b5df0df16b8 100644 --- a/sys/dev/ata/atascsi.c +++ b/sys/dev/ata/atascsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.c,v 1.140 2020/07/17 00:36:42 krw Exp $ */ +/* $OpenBSD: atascsi.c,v 1.141 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -182,14 +182,14 @@ atascsi_attach(struct device *self, struct atascsi_attach_args *aaa) as->as_host_ports = mallocarray(aaa->aaa_nports, sizeof(struct atascsi_host_port *), M_DEVBUF, M_WAITOK | M_ZERO); - as->as_link.adapter = &as->as_switch; - as->as_link.adapter_softc = as; - as->as_link.adapter_buswidth = aaa->aaa_nports; - as->as_link.luns = SATA_PMP_MAX_PORTS; - as->as_link.adapter_target = SDEV_NO_ADAPTER_TARGET; as->as_link.openings = 1; saa.saa_sc_link = &as->as_link; + saa.saa_adapter = &as->as_switch; + saa.saa_adapter_softc = as; + saa.saa_adapter_buswidth = aaa->aaa_nports; + saa.saa_luns = SATA_PMP_MAX_PORTS; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; as->as_scsibus = (struct scsibus_softc *)config_found(self, &saa, scsiprint); diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c index ff2741adbd3..a824432e108 100644 --- a/sys/dev/atapiscsi/atapiscsi.c +++ b/sys/dev/atapiscsi/atapiscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atapiscsi.c,v 1.113 2020/07/16 21:18:29 krw Exp $ */ +/* $OpenBSD: atapiscsi.c,v 1.114 2020/07/19 18:57:57 krw Exp $ */ /* * This code is derived from code with the copyright below. @@ -251,16 +251,16 @@ atapiscsi_attach(struct device *parent, struct device *self, void *aux) WDCDEBUG_PRINT(("driver caps %04x\n", drvp->atapi_cap), DEBUG_PROBE); - as->sc_adapterlink.adapter_softc = as; - as->sc_adapterlink.adapter_target = SDEV_NO_ADAPTER_TARGET; - as->sc_adapterlink.adapter_buswidth = 2; - as->sc_adapterlink.adapter = &atapiscsi_switch; - as->sc_adapterlink.luns = 1; as->sc_adapterlink.openings = 1; as->sc_adapterlink.flags = SDEV_ATAPI; as->sc_adapterlink.pool = &wdc_xfer_iopool; saa.saa_sc_link = &as->sc_adapterlink; + saa.saa_adapter_softc = as; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = 2; + saa.saa_adapter = &atapiscsi_switch; + saa.saa_luns = 1; child = config_found((struct device *)as, &saa, scsiprint); diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index d1431865aca..f883926d4b1 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.82 2020/07/16 21:18:29 krw Exp $ */ +/* $OpenBSD: aac.c,v 1.83 2020/07/19 18:57:57 krw Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -266,15 +266,16 @@ aac_attach(struct aac_softc *sc) if (error) return (error); - sc->aac_link.adapter_softc = sc; - sc->aac_link.adapter = &aac_switch; sc->aac_link.openings = (sc->total_fibs - 8) / (sc->aac_container_count ? sc->aac_container_count : 1); - sc->aac_link.adapter_buswidth = AAC_MAX_CONTAINERS; - sc->aac_link.adapter_target = SDEV_NO_ADAPTER_TARGET; sc->aac_link.pool = &sc->aac_iopool; saa.saa_sc_link = &sc->aac_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &aac_switch; + saa.saa_adapter_buswidth = AAC_MAX_CONTAINERS; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_luns = 8; config_found(&sc->aac_dev, &saa, scsiprint); diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c index fb89d866753..7a1d56eb728 100644 --- a/sys/dev/ic/adv.c +++ b/sys/dev/ic/adv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adv.c,v 1.46 2020/07/16 21:18:29 krw Exp $ */ +/* $OpenBSD: adv.c,v 1.47 2020/07/19 18:57:57 krw Exp $ */ /* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */ /* @@ -499,14 +499,15 @@ adv_attach(sc) sc->sc_dev.dv_xname, i, ADV_MAX_CCB); } - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->chip_scsi_id; - sc->sc_link.adapter = &adv_switch; sc->sc_link.openings = 4; sc->sc_link.pool = &sc->sc_iopool; - sc->sc_link.adapter_buswidth = 7; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->chip_scsi_id; + saa.saa_adapter = &adv_switch; + saa.saa_adapter_buswidth = 7; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c index 124c9640033..80865b0908c 100644 --- a/sys/dev/ic/adw.c +++ b/sys/dev/ic/adw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adw.c,v 1.64 2020/07/16 21:18:29 krw Exp $ */ +/* $OpenBSD: adw.c,v 1.65 2020/07/19 18:57:57 krw Exp $ */ /* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */ /* @@ -502,14 +502,15 @@ adw_attach(ADW_SOFTC *sc) break; } - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->chip_scsi_id; - sc->sc_link.adapter = &adw_switch; sc->sc_link.openings = 4; - sc->sc_link.adapter_buswidth = ADW_MAX_TID+1; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->chip_scsi_id; + saa.saa_adapter = &adw_switch; + saa.saa_adapter_buswidth = ADW_MAX_TID+1; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/aic6250.c b/sys/dev/ic/aic6250.c index 03ea46dcdc8..1394d63d8e0 100644 --- a/sys/dev/ic/aic6250.c +++ b/sys/dev/ic/aic6250.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic6250.c,v 1.10 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: aic6250.c,v 1.11 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2010, 2013 Miodrag Vallat. @@ -202,13 +202,14 @@ aic6250_attach(struct aic6250_softc *sc) aic6250_init(sc); /* init chip and driver */ - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_initiator; - sc->sc_link.adapter = &aic6250_switch; sc->sc_link.openings = 2; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_initiator; + saa.saa_adapter = &aic6250_switch; + saa.saa_luns = saa.saa_adapter_buswidth = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/aic6360.c b/sys/dev/ic/aic6360.c index 020d23cdec6..a1b60fbc3dc 100644 --- a/sys/dev/ic/aic6360.c +++ b/sys/dev/ic/aic6360.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic6360.c,v 1.35 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: aic6360.c,v 1.36 2020/07/19 18:57:57 krw Exp $ */ /* $NetBSD: aic6360.c,v 1.52 1996/12/10 21:27:51 thorpej Exp $ */ #ifdef DDB @@ -263,13 +263,14 @@ aicattach(struct aic_softc *sc) aic_init(sc); /* init chip and driver */ - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_initiator; - sc->sc_link.adapter = &aic_switch; sc->sc_link.openings = 2; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_initiator; + saa.saa_adapter = &aic_switch; + saa.saa_luns = saa.saa_adapter_buswidth = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c index e7a87416bad..de796ddab85 100644 --- a/sys/dev/ic/aic79xx_openbsd.c +++ b/sys/dev/ic/aic79xx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx_openbsd.c,v 1.55 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: aic79xx_openbsd.c,v 1.56 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -109,15 +109,15 @@ ahd_attach(struct ahd_softc *ahd) if (ahd->flags & AHD_RESET_BUS_A) ahd_reset_channel(ahd, 'A', TRUE); - ahd->sc_channel.adapter_target = ahd->our_id; - if (ahd->features & AHD_WIDE) - ahd->sc_channel.adapter_buswidth = 16; - ahd->sc_channel.adapter_softc = ahd; - ahd->sc_channel.adapter = &ahd_switch; ahd->sc_channel.openings = 16; /* Must ALWAYS be < 256!! */ ahd->sc_channel.pool = &ahd->sc_iopool; saa.saa_sc_link = &ahd->sc_channel; + saa.saa_adapter_target = ahd->our_id; + saa.saa_adapter_buswidth = (ahd->features & AHD_WIDE) ? 16 : 8; + saa.saa_adapter_softc = ahd; + saa.saa_adapter = &ahd_switch; + saa.saa_luns = 8; ahd->sc_child = config_found((void *)&ahd->sc_dev, &saa, scsiprint); diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c index b2921570ad1..5ef1d03d56f 100644 --- a/sys/dev/ic/aic7xxx_openbsd.c +++ b/sys/dev/ic/aic7xxx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx_openbsd.c,v 1.65 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: aic7xxx_openbsd.c,v 1.66 2020/07/19 18:57:57 krw Exp $ */ /* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -75,17 +75,11 @@ ahc_attach(struct ahc_softc *ahc) s = splbio(); - ahc->sc_channel.adapter_target = ahc->our_id; - if (ahc->features & AHC_WIDE) - ahc->sc_channel.adapter_buswidth = 16; - ahc->sc_channel.adapter_softc = ahc; - ahc->sc_channel.adapter = &ahc_switch; ahc->sc_channel.openings = 16; ahc->sc_channel.pool = &ahc->sc_iopool; if (ahc->features & AHC_TWIN) { ahc->sc_channel_b = ahc->sc_channel; - ahc->sc_channel_b.adapter_target = ahc->our_id_b; } #ifndef DEBUG @@ -103,22 +97,30 @@ ahc_attach(struct ahc_softc *ahc) if ((ahc->features & AHC_TWIN) && ahc->flags & AHC_RESET_BUS_B) ahc_reset_channel(ahc, 'B', TRUE); + saa.saa_adapter_buswidth = (ahc->features & AHC_WIDE) ? 16 :8; + saa.saa_adapter_softc = ahc; + saa.saa_adapter = &ahc_switch; + saa.saa_luns = saa.saa_adapter_buswidth = 8; if ((ahc->flags & AHC_PRIMARY_CHANNEL) == 0) { saa.saa_sc_link = &ahc->sc_channel; + saa.saa_adapter_target = ahc->our_id; ahc->sc_child = (struct scsibus_softc *)config_found( (void *)&ahc->sc_dev, &saa, scsiprint); if (ahc->features & AHC_TWIN) { saa.saa_sc_link = &ahc->sc_channel_b; + saa.saa_adapter_target = ahc->our_id; ahc->sc_child_b = (struct scsibus_softc *)config_found( (void *)&ahc->sc_dev, &saa, scsiprint); } } else { if (ahc->features & AHC_TWIN) { saa.saa_sc_link = &ahc->sc_channel_b; + saa.saa_adapter_target = ahc->our_id; ahc->sc_child = (struct scsibus_softc *)config_found( (void *)&ahc->sc_dev, &saa, scsiprint); } saa.saa_sc_link = &ahc->sc_channel; + saa.saa_adapter_target = ahc->our_id; ahc->sc_child_b = (struct scsibus_softc *)config_found( (void *)&ahc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 88dabf9bd0a..04dbbb10d0f 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.251 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: ami.c,v 1.252 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -536,13 +536,14 @@ ami_attach(struct ami_softc *sc) rw_init(&sc->sc_lock, NULL); sc->sc_link.openings = sc->sc_maxcmds; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &ami_switch; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = sc->sc_maxunits; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &ami_switch; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_maxunits; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); @@ -584,13 +585,14 @@ ami_attach(struct ami_softc *sc) /* TODO fetch adapter_target from the controller */ rsc->sc_link.openings = sc->sc_maxcmds; - rsc->sc_link.adapter_softc = rsc; - rsc->sc_link.adapter = &ami_raw_switch; - rsc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - rsc->sc_link.adapter_buswidth = 16; rsc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &rsc->sc_link; + saa.saa_adapter_softc = rsc; + saa.saa_adapter = &ami_raw_switch; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = 16; + saa.saa_luns = 8; ptbus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 54cf5ca7c9a..28a57a2de3d 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.63 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: cac.c,v 1.64 2020/07/19 18:57:57 krw Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -236,16 +236,17 @@ cac_init(struct cac_softc *sc, int startfw) return (-1); } - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &cac_switch; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = cinfo.num_drvs; sc->sc_link.openings = CAC_MAX_CCBS / sc->sc_nunits; if (sc->sc_link.openings < 4 ) sc->sc_link.openings = 4; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &cac_switch; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = cinfo.num_drvs; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dv, &saa, scsiprint); diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 2d47a8459ea..d6ad5246c9d 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss.c,v 1.85 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: ciss.c,v 1.86 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2005,2006 Michael Shalayeff @@ -353,15 +353,15 @@ ciss_attach(struct ciss_softc *sc) sc->sc_flush = CISS_FLUSH_ENABLE; - sc->sc_link.adapter_softc = sc; sc->sc_link.openings = sc->maxcmd; - sc->sc_link.adapter = &ciss_switch; - sc->sc_link.luns = 1; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = sc->maxunits; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &ciss_switch; + saa.saa_luns = 1; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->maxunits; scsibus = (struct scsibus_softc *)config_found_sm(&sc->sc_dev, &saa, scsiprint, NULL); diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c index 3e82810054e..9fc5b02046f 100644 --- a/sys/dev/ic/gdt_common.c +++ b/sys/dev/ic/gdt_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_common.c,v 1.74 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.75 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved. @@ -466,14 +466,15 @@ gdt_attach(struct gdt_softc *sc) else sc->sc_link.openings = (GDT_MAXCMDS - GDT_CMD_RESERVE) / sc->sc_ndevs; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &gdt_switch; - sc->sc_link.adapter_buswidth = - (sc->sc_class & GDT_FC) ? GDT_MAXID : GDT_MAX_HDRIVES; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &gdt_switch; + saa.saa_adapter_buswidth = + (sc->sc_class & GDT_FC) ? GDT_MAXID : GDT_MAX_HDRIVES; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index 80d58c7f0b2..6a492fa3417 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfi.c,v 1.182 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: mfi.c,v 1.183 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * @@ -771,15 +771,15 @@ mfi_attach(struct mfi_softc *sc, enum mfi_iop iop) for (i = 0; i < sc->sc_ld_cnt; i++) sc->sc_ld[i].ld_present = 1; - sc->sc_link.adapter = &mfi_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_buswidth = sc->sc_info.mci_max_lds; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.luns = 1; sc->sc_link.openings = sc->sc_max_cmds - 1; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &mfi_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_buswidth = sc->sc_info.mci_max_lds; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_luns = 1; sc->sc_scsibus = (struct scsibus_softc *) config_found(&sc->sc_dev, &saa, scsiprint); @@ -847,14 +847,15 @@ mfi_syspd(struct mfi_softc *sc) free(pd, M_TEMP, sizeof *pd); link = &sc->sc_pd->pd_link; - link->adapter = &mfi_pd_switch; - link->adapter_softc = sc; - link->adapter_buswidth = MFI_MAX_PD; - link->adapter_target = SDEV_NO_ADAPTER_TARGET; link->openings = sc->sc_max_cmds - 1; link->pool = &sc->sc_iopool; saa.saa_sc_link = link; + saa.saa_adapter = &mfi_pd_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_buswidth = MFI_MAX_PD; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_luns = 8; sc->sc_pd->pd_scsibus = (struct scsibus_softc *) config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 358fff02af6..2a1bb62baa5 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.219 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: mpi.c,v 1.220 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org> @@ -355,16 +355,17 @@ mpi_attach(struct mpi_softc *sc) } #endif /* NBIO > 0 */ - sc->sc_link.adapter = &mpi_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_target; - sc->sc_link.adapter_buswidth = sc->sc_buswidth; sc->sc_link.openings = MAX(sc->sc_maxcmds / sc->sc_buswidth, 16); sc->sc_link.pool = &sc->sc_iopool; sc->sc_link.port_wwn = sc->sc_port_wwn; sc->sc_link.node_wwn = sc->sc_node_wwn; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &mpi_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_target; + saa.saa_adapter_buswidth = sc->sc_buswidth; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index d6106e5b6ee..590aa55c5ee 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.74 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.75 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -261,14 +261,15 @@ ncr53c9x_attach(sc) sc->sc_state = 0; ncr53c9x_init(sc, 1); - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_id; - sc->sc_link.adapter = &ncr53c9x_switch; sc->sc_link.openings = 2; - sc->sc_link.adapter_buswidth = sc->sc_ntarg; sc->sc_link.pool = &ecb_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_id; + saa.saa_adapter = &ncr53c9x_switch; + saa.saa_adapter_buswidth = sc->sc_ntarg; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index 2830f9e68ca..af09ede0498 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvme.c,v 1.81 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: nvme.c,v 1.82 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2014 David Gwynne <dlg@openbsd.org> @@ -363,15 +363,15 @@ nvme_attach(struct nvme_softc *sc) sc->sc_namespaces = mallocarray(sc->sc_nn + 1, sizeof(*sc->sc_namespaces), M_DEVBUF, M_WAITOK|M_ZERO); - sc->sc_link.adapter = &nvme_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_buswidth = sc->sc_nn + 1; - sc->sc_link.luns = 1; - sc->sc_link.adapter_target = 0; sc->sc_link.openings = 64; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &nvme_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_buswidth = sc->sc_nn + 1; + saa.saa_luns = 1; + saa.saa_adapter_target = 0; config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/ic/oosiop.c b/sys/dev/ic/oosiop.c index 06e609f06aa..a5767521e1c 100644 --- a/sys/dev/ic/oosiop.c +++ b/sys/dev/ic/oosiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oosiop.c,v 1.31 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: oosiop.c,v 1.32 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: oosiop.c,v 1.4 2003/10/29 17:45:55 tsutsui Exp $ */ /* @@ -256,15 +256,16 @@ oosiop_attach(struct oosiop_softc *sc) sc->sc_active = 0; oosiop_write_4(sc, OOSIOP_DSP, sc->sc_scrbase + Ent_wait_reselect); - sc->sc_link.adapter = &oosiop_switch; - sc->sc_link.adapter_softc = sc; sc->sc_link.openings = 1; /* XXX */ - sc->sc_link.adapter_buswidth = OOSIOP_NTGT; - sc->sc_link.adapter_target = sc->sc_id; sc->sc_link.pool = &sc->sc_iopool; sc->sc_link.quirks = ADEV_NODOORLOCK; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &oosiop_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_buswidth = OOSIOP_NTGT; + saa.saa_adapter_target = sc->sc_id; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/osiop.c b/sys/dev/ic/osiop.c index 7bf60bdad77..14948641e30 100644 --- a/sys/dev/ic/osiop.c +++ b/sys/dev/ic/osiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osiop.c,v 1.59 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: osiop.c,v 1.60 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: osiop.c,v 1.9 2002/04/05 18:27:54 bouyer Exp $ */ /* @@ -324,14 +324,15 @@ osiop_attach(sc) */ osiop_init(sc); - sc->sc_link.adapter = &osiop_switch; - sc->sc_link.adapter_softc = sc; sc->sc_link.openings = 4; - sc->sc_link.adapter_buswidth = OSIOP_NTGT; - sc->sc_link.adapter_target = sc->sc_id; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &osiop_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_buswidth = OSIOP_NTGT; + saa.saa_adapter_target = sc->sc_id; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/qla.c b/sys/dev/ic/qla.c index 978082032f0..2aa37992308 100644 --- a/sys/dev/ic/qla.c +++ b/sys/dev/ic/qla.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qla.c,v 1.65 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: qla.c,v 1.66 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2011 David Gwynne <dlg@openbsd.org> @@ -672,14 +672,6 @@ qla_attach(struct qla_softc *sc) DEVNAME(sc)); } - sc->sc_link.adapter = &qla_switch; - sc->sc_link.adapter_softc = sc; - if (sc->sc_2k_logins) { - sc->sc_link.adapter_buswidth = QLA_2KL_BUSWIDTH; - } else { - sc->sc_link.adapter_buswidth = QLA_BUSWIDTH; - } - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; sc->sc_link.openings = sc->sc_maxcmds; sc->sc_link.pool = &sc->sc_iopool; sc->sc_link.port_wwn = sc->sc_port_name; @@ -694,6 +686,15 @@ qla_attach(struct qla_softc *sc) } saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &qla_switch; + saa.saa_adapter_softc = sc; + if (sc->sc_2k_logins) { + saa.saa_adapter_buswidth = QLA_2KL_BUSWIDTH; + } else { + saa.saa_adapter_buswidth = QLA_BUSWIDTH; + } + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c index fef616134ae..51b4290d282 100644 --- a/sys/dev/ic/qlw.c +++ b/sys/dev/ic/qlw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qlw.c,v 1.42 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: qlw.c,v 1.43 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2011 David Gwynne <dlg@openbsd.org> @@ -393,12 +393,12 @@ qlw_attach(struct qlw_softc *sc) /* wait for the busses to settle */ delay(reset_delay * 1000000); + saa.saa_adapter = &qlw_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_buswidth = QLW_MAX_TARGETS; + saa.saa_luns = QLW_MAX_LUNS; for (bus = 0; bus < sc->sc_numbusses; bus++) { - sc->sc_link[bus].adapter = &qlw_switch; - sc->sc_link[bus].adapter_softc = sc; - sc->sc_link[bus].adapter_target = sc->sc_initiator[bus]; - sc->sc_link[bus].adapter_buswidth = QLW_MAX_TARGETS; - sc->sc_link[bus].luns = QLW_MAX_LUNS; + saa.saa_adapter_target = sc->sc_initiator[bus]; sc->sc_link[bus].openings = sc->sc_max_queue_depth[bus]; sc->sc_link[bus].pool = &sc->sc_iopool; diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c index 84717d4520e..2a2aac3dff1 100644 --- a/sys/dev/ic/siop.c +++ b/sys/dev/ic/siop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop.c,v 1.81 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: siop.c,v 1.82 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: siop.c,v 1.79 2005/11/18 23:10:32 bouyer Exp $ */ /* @@ -210,15 +210,15 @@ siop_attach(sc) siop_dump_script(sc); #endif - sc->sc_c.sc_link.adapter_softc = sc; - sc->sc_c.sc_link.adapter = &siop_switch; sc->sc_c.sc_link.openings = SIOP_NTAG; sc->sc_c.sc_link.pool = &sc->iopool; - sc->sc_c.sc_link.adapter_target = sc->sc_c.sc_id; - sc->sc_c.sc_link.adapter_buswidth = (sc->sc_c.features & SF_BUS_WIDE) ? - 16 : 8; saa.saa_sc_link = &sc->sc_c.sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &siop_switch; + saa.saa_adapter_target = sc->sc_c.sc_id; + saa.saa_adapter_buswidth = (sc->sc_c.features & SF_BUS_WIDE) ? 16 : 8; + saa.saa_luns = 8; config_found((struct device*)sc, &saa, scsiprint); } diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c index eb9b6293521..6dad26aa42b 100644 --- a/sys/dev/ic/twe.c +++ b/sys/dev/ic/twe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: twe.c,v 1.55 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: twe.c,v 1.56 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved. @@ -394,14 +394,15 @@ twe_attach(sc) /* TODO: fetch & print cache params? */ - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &twe_switch; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; sc->sc_link.openings = TWE_MAXCMDS / nunits; - sc->sc_link.adapter_buswidth = TWE_MAX_UNITS; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &twe_switch; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = TWE_MAX_UNITS; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/ic/uha.c b/sys/dev/ic/uha.c index 3352107eab8..80c66e69f21 100644 --- a/sys/dev/ic/uha.c +++ b/sys/dev/ic/uha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uha.c,v 1.34 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: uha.c,v 1.35 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: uha.c,v 1.3 1996/10/13 01:37:29 christos Exp $ */ #undef UHADEBUG @@ -120,13 +120,14 @@ uha_attach(sc) mtx_init(&sc->sc_mscp_mtx, IPL_BIO); scsi_iopool_init(&sc->sc_iopool, sc, uha_mscp_alloc, uha_mscp_free); - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_scsi_dev; - sc->sc_link.adapter = &uha_switch; sc->sc_link.openings = 2; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_scsi_dev; + saa.saa_adapter = &uha_switch; + saa.saa_luns = saa.saa_adapter_buswidth = 8; config_found(&sc->sc_dev, &saa, uhaprint); } diff --git a/sys/dev/ic/wd33c93.c b/sys/dev/ic/wd33c93.c index 769da233ebf..2a55249cbda 100644 --- a/sys/dev/ic/wd33c93.c +++ b/sys/dev/ic/wd33c93.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd33c93.c,v 1.16 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: wd33c93.c,v 1.17 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: wd33c93.c,v 1.24 2010/11/13 13:52:02 uebayasi Exp $ */ /* @@ -202,15 +202,15 @@ wd33c93_attach(struct wd33c93_softc *sc, struct scsi_adapter *adapter) printf("\n"); } - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_id; - sc->sc_link.adapter_buswidth = SBIC_NTARG; - sc->sc_link.adapter = adapter; sc->sc_link.openings = 2; - sc->sc_link.luns = SBIC_NLUN; sc->sc_link.pool = &wd33c93_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_id; + saa.saa_adapter_buswidth = SBIC_NTARG; + saa.saa_adapter = adapter; + saa.saa_luns = SBIC_NLUN; config_found(&sc->sc_dev, &saa, scsiprint); timeout_add_sec(&sc->sc_watchdog, 60); diff --git a/sys/dev/isa/wds.c b/sys/dev/isa/wds.c index cdc39d2a6c5..57987caf342 100644 --- a/sys/dev/isa/wds.c +++ b/sys/dev/isa/wds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wds.c,v 1.52 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: wds.c,v 1.53 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: wds.c,v 1.13 1996/11/03 16:20:31 mycroft Exp $ */ #undef WDSDIAG @@ -284,9 +284,6 @@ wdsattach(struct device *parent, struct device *self, void *aux) sc->sc_ih = isa_intr_establish(ia->ia_ic, sc->sc_irq, IST_EDGE, IPL_BIO, wdsintr, sc, sc->sc_dev.dv_xname); - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_scsi_dev; - sc->sc_link.adapter = &wds_switch; /* XXX */ /* I don't think the -ASE can handle openings > 1. */ /* It gives Vendor Error 26 whenever I try it. */ @@ -294,6 +291,10 @@ wdsattach(struct device *parent, struct device *self, void *aux) sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_scsi_dev; + saa.saa_adapter = &wds_switch; + saa.saa_luns = saa.saa_adapter_buswidth = 8; config_found(self, &saa, wdsprint); } diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index bbc787bc669..b62e906d7bf 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.115 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: arc.c,v 1.116 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -801,14 +801,15 @@ arc_attach(struct device *parent, struct device *self, void *aux) goto unmap_pci; } - sc->sc_link.adapter = &arc_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = ARC_MAX_TARGET; sc->sc_link.openings = sc->sc_req_count; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &arc_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = ARC_MAX_TARGET; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(self, &saa, scsiprint); diff --git a/sys/dev/pci/iha_pci.c b/sys/dev/pci/iha_pci.c index a1c8a8f69d3..f01a374cdf4 100644 --- a/sys/dev/pci/iha_pci.c +++ b/sys/dev/pci/iha_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iha_pci.c,v 1.16 2020/07/11 13:34:06 krw Exp $ */ +/* $OpenBSD: iha_pci.c,v 1.17 2020/07/19 18:57:58 krw Exp $ */ /*------------------------------------------------------------------------- * * Device driver for the INI-9XXXU/UW or INIC-940/950 PCI SCSI Controller. @@ -134,14 +134,15 @@ iha_pci_attach(parent, self, aux) printf(": %s\n", intrstr); if (iha_init_tulip(sc) == 0) { - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &iha_switch; sc->sc_link.openings = 4; /* # xs's allowed per device */ - sc->sc_link.adapter_target = sc->sc_id; - sc->sc_link.adapter_buswidth = sc->sc_maxtargets; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &iha_switch; + saa.saa_adapter_target = sc->sc_id; + saa.saa_adapter_buswidth = sc->sc_maxtargets; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index 57e88973543..7fcf00d96c4 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.123 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: ips.c,v 1.124 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2006, 2007, 2009 Alexander Yurchenko <grange@openbsd.org> @@ -720,13 +720,15 @@ ips_attach(struct device *parent, struct device *self, void *aux) if (sc->sc_nunits > 0) sc->sc_scsi_link.openings = sc->sc_nccbs / sc->sc_nunits; - sc->sc_scsi_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_scsi_link.adapter_buswidth = sc->sc_nunits; - sc->sc_scsi_link.adapter = &ips_switch; - sc->sc_scsi_link.adapter_softc = sc; sc->sc_scsi_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_scsi_link; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_nunits; + saa.saa_adapter = &ips_switch; + saa.saa_adapter_softc = sc; + saa.saa_luns = 8; + sc->sc_scsibus = (struct scsibus_softc *)config_found(self, &saa, scsiprint); @@ -762,13 +764,14 @@ ips_attach(struct device *parent, struct device *self, void *aux) link = &pt->pt_link; link->openings = 1; - link->adapter_target = IPS_MAXTARGETS; - link->adapter_buswidth = lastarget + 1; - link->adapter = &ips_pt_switch; - link->adapter_softc = pt; link->pool = &sc->sc_iopool; saa.saa_sc_link = link; + saa.saa_adapter = &ips_pt_switch; + saa.saa_adapter_softc = pt; + saa.saa_adapter_buswidth = lastarget + 1; + saa.saa_adapter_target = IPS_MAXTARGETS; + saa.saa_luns = 8; config_found(self, &saa, scsiprint); } diff --git a/sys/dev/pci/mfii.c b/sys/dev/pci/mfii.c index c88c2463fec..054edaf6c41 100644 --- a/sys/dev/pci/mfii.c +++ b/sys/dev/pci/mfii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfii.c,v 1.77 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: mfii.c,v 1.78 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2012 David Gwynne <dlg@openbsd.org> @@ -782,13 +782,14 @@ mfii_attach(struct device *parent, struct device *self, void *aux) goto free_sgl; sc->sc_link.openings = sc->sc_max_cmds; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &mfii_switch; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = sc->sc_info.mci_max_lds; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &mfii_switch; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_info.mci_max_lds; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); @@ -917,14 +918,15 @@ mfii_syspd(struct mfii_softc *sc) goto free_pdsc; link = &sc->sc_pd->pd_link; - link->adapter = &mfii_pd_switch; - link->adapter_softc = sc; - link->adapter_buswidth = MFI_MAX_PD; - link->adapter_target = SDEV_NO_ADAPTER_TARGET; link->openings = sc->sc_max_cmds - 1; link->pool = &sc->sc_iopool; saa.saa_sc_link = link; + saa.saa_adapter = &mfii_pd_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_buswidth = MFI_MAX_PD; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_luns = 8; sc->sc_pd->pd_scsibus = (struct scsibus_softc *) config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c index adfcaf75a8a..714cc2436b7 100644 --- a/sys/dev/pci/mpii.c +++ b/sys/dev/pci/mpii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpii.c,v 1.135 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: mpii.c,v 1.136 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2010, 2012 Mike Belopuhov * Copyright (c) 2009 James Giannoules @@ -590,15 +590,15 @@ mpii_attach(struct device *parent, struct device *self, void *aux) sc->sc_pending = 1; config_pending_incr(); - sc->sc_link.adapter = &mpii_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = sc->sc_max_devices; - sc->sc_link.luns = 1; sc->sc_link.openings = sc->sc_max_cmds - 1; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &mpii_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_max_devices; + saa.saa_luns = 1; sc->sc_scsibus = (struct scsibus_softc *) config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index 8a259b89664..65669ecd537 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.57 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: qle.c,v 1.58 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -654,10 +654,6 @@ qle_attach(struct device *parent, struct device *self, void *aux) DEVNAME(sc)); } - sc->sc_link.adapter = &qle_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = QLE_MAX_TARGETS; sc->sc_link.openings = sc->sc_maxcmds; sc->sc_link.pool = &sc->sc_iopool; if (sc->sc_nvram_valid) { @@ -677,6 +673,11 @@ qle_attach(struct device *parent, struct device *self, void *aux) } saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &qle_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = QLE_MAX_TARGETS; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/pci/trm_pci.c b/sys/dev/pci/trm_pci.c index b1bafecea67..fbb991a759e 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.8 2020/07/11 13:34:06 krw Exp $ +/* $OpenBSD: trm_pci.c,v 1.9 2020/07/19 18:57:58 krw Exp $ * ------------------------------------------------------------ * O.S : OpenBSD * FILE NAME : trm_pci.c @@ -161,14 +161,15 @@ 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; + saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_AdaptSCSIID; + saa.saa_adapter = &trm_switch; + saa.saa_adapter_buswidth = ((sc->sc_config & HCC_WIDE_CARD) == 0) ? 8:16; + saa.saa_luns = 8; config_found(&sc->sc_device, &saa, scsiprint); } diff --git a/sys/dev/pci/vmwpvs.c b/sys/dev/pci/vmwpvs.c index 94d13b83e02..5f9ad29a67d 100644 --- a/sys/dev/pci/vmwpvs.c +++ b/sys/dev/pci/vmwpvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmwpvs.c,v 1.20 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: vmwpvs.c,v 1.21 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2013 David Gwynne <dlg@openbsd.org> @@ -558,14 +558,15 @@ vmwpvs_attach(struct device *parent, struct device *self, void *aux) scsi_iopool_init(&sc->sc_iopool, sc, vmwpvs_ccb_get, vmwpvs_ccb_put); - sc->sc_link.adapter = &vmwpvs_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = sc->sc_bus_width; sc->sc_link.openings = VMWPVS_OPENINGS; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &vmwpvs_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_bus_width; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/pv/hvs.c b/sys/dev/pv/hvs.c index 5165e6f4a97..98c789bf98b 100644 --- a/sys/dev/pv/hvs.c +++ b/sys/dev/pv/hvs.c @@ -308,15 +308,15 @@ hvs_attach(struct device *parent, struct device *self, void *aux) task_set(&sc->sc_probetask, hvs_scsi_probe, sc); - sc->sc_link.adapter = &hvs_switch; - sc->sc_link.adapter_softc = self; - sc->sc_link.luns = sc->sc_flags & HVSF_SCSI ? 64 : 1; - sc->sc_link.adapter_buswidth = 2; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; sc->sc_link.openings = sc->sc_nccb; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &hvs_switch; + saa.saa_adapter_softc = self; + saa.saa_luns = sc->sc_flags & HVSF_SCSI ? 64 : 1; + saa.saa_adapter_buswidth = 2; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; sc->sc_scsibus = config_found(self, &saa, scsiprint); diff --git a/sys/dev/pv/vioblk.c b/sys/dev/pv/vioblk.c index fb556a785a6..17521d1e2f1 100644 --- a/sys/dev/pv/vioblk.c +++ b/sys/dev/pv/vioblk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vioblk.c,v 1.23 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: vioblk.c,v 1.24 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch. @@ -239,16 +239,16 @@ vioblk_attach(struct device *parent, struct device *self, void *aux) printf("\n"); sc->sc_link.openings = sc->sc_nreqs; - sc->sc_link.adapter = &vioblk_switch; sc->sc_link.pool = &sc->sc_iopool; - sc->sc_link.adapter_softc = self; - sc->sc_link.adapter_buswidth = 1; - sc->sc_link.luns = 1; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; if (virtio_has_feature(vsc, VIRTIO_BLK_F_RO)) sc->sc_link.flags |= SDEV_READONLY; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &vioblk_switch; + saa.saa_adapter_softc = self; + saa.saa_adapter_buswidth = 1; + saa.saa_luns = 1; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; config_found(self, &saa, scsiprint); diff --git a/sys/dev/pv/vioscsi.c b/sys/dev/pv/vioscsi.c index eb36ae7a701..7ad3e7a866a 100644 --- a/sys/dev/pv/vioscsi.c +++ b/sys/dev/pv/vioscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vioscsi.c,v 1.22 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: vioscsi.c,v 1.23 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2013 Google Inc. * @@ -160,13 +160,14 @@ vioscsi_attach(struct device *parent, struct device *self, void *aux) } sc->sc_link.openings = (nreqs > cmd_per_lun) ? cmd_per_lun : nreqs; - sc->sc_link.adapter = &vioscsi_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = max_target; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &vioscsi_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = max_target; + saa.saa_luns = 8; config_found(self, &saa, scsiprint); return; diff --git a/sys/dev/pv/xbf.c b/sys/dev/pv/xbf.c index b090e1829f6..53c06ef7545 100644 --- a/sys/dev/pv/xbf.c +++ b/sys/dev/pv/xbf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbf.c,v 1.41 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: xbf.c,v 1.42 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2016, 2017 Mike Belopuhov @@ -300,15 +300,15 @@ xbf_attach(struct device *parent, struct device *self, void *aux) goto error; } - sc->sc_link.adapter = &xbf_switch; - sc->sc_link.adapter_softc = self; - sc->sc_link.adapter_buswidth = 1; - sc->sc_link.luns = 1; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; sc->sc_link.openings = sc->sc_nccb; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &xbf_switch; + saa.saa_adapter_softc = self; + saa.saa_adapter_buswidth = 1; + saa.saa_luns = 1; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; sc->sc_scsibus = config_found(self, &saa, scsiprint); diff --git a/sys/dev/sdmmc/sdmmc_scsi.c b/sys/dev/sdmmc/sdmmc_scsi.c index 3e10c29f0ba..f579f52a96e 100644 --- a/sys/dev/sdmmc/sdmmc_scsi.c +++ b/sys/dev/sdmmc/sdmmc_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_scsi.c,v 1.49 2020/07/16 21:18:31 krw Exp $ */ +/* $OpenBSD: sdmmc_scsi.c,v 1.50 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -137,16 +137,16 @@ sdmmc_scsi_attach(struct sdmmc_softc *sc) sc->sc_scsibus = scbus; - scbus->sc_link.adapter_target = SDMMC_SCSIID_HOST; - scbus->sc_link.adapter_buswidth = scbus->sc_ntargets; - scbus->sc_link.adapter_softc = sc; - scbus->sc_link.luns = 1; scbus->sc_link.openings = 1; - scbus->sc_link.adapter = &sdmmc_switch; scbus->sc_link.pool = &scbus->sc_iopool; bzero(&saa, sizeof(saa)); saa.saa.saa_sc_link = &scbus->sc_link; + saa.saa.saa_adapter_target = SDMMC_SCSIID_HOST; + saa.saa.saa_adapter_buswidth = scbus->sc_ntargets; + saa.saa.saa_adapter_softc = sc; + saa.saa.saa_luns = 1; + saa.saa.saa_adapter = &sdmmc_switch; scbus->sc_child = config_found(&sc->sc_dev, &saa, scsiprint); if (scbus->sc_child == NULL) { diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 7a3774b861e..a42c676e2f6 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.408 2020/07/16 21:18:29 krw Exp $ */ +/* $OpenBSD: softraid.c,v 1.409 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -1802,13 +1802,12 @@ sr_attach(struct device *parent, struct device *self, void *aux) printf("\n"); - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &sr_switch; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = SR_MAX_LD; - sc->sc_link.luns = 1; - saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &sr_switch; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = SR_MAX_LD; + saa.saa_luns = 1; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c index 81d046fed4e..4cacccf90d5 100644 --- a/sys/dev/usb/umass_scsi.c +++ b/sys/dev/usb/umass_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass_scsi.c,v 1.55 2020/07/16 21:18:31 krw Exp $ */ +/* $OpenBSD: umass_scsi.c,v 1.56 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -109,17 +109,17 @@ umass_scsi_attach(struct umass_softc *sc) scsi_iopool_init(&scbus->sc_iopool, scbus, umass_io_get, umass_io_put); - scbus->sc_link.adapter_buswidth = 2; - scbus->sc_link.adapter = &umass_scsi_switch; - scbus->sc_link.adapter_softc = sc; - scbus->sc_link.adapter_target = UMASS_SCSIID_HOST; scbus->sc_link.openings = 1; scbus->sc_link.quirks = SDEV_ONLYBIG | sc->sc_busquirks; scbus->sc_link.pool = &scbus->sc_iopool; - scbus->sc_link.luns = sc->maxlun + 1; scbus->sc_link.flags = flags; saa.saa_sc_link = &scbus->sc_link; + saa.saa_adapter_buswidth = 2; + saa.saa_adapter = &umass_scsi_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = UMASS_SCSIID_HOST; + saa.saa_luns = sc->maxlun + 1; sc->sc_refcnt++; scbus->sc_child = config_found((struct device *)sc, &saa, scsiprint); diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index 525ebc5d4d0..6ed16e46550 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.53 2020/07/16 21:18:29 krw Exp $ */ +/* $OpenBSD: vscsi.c,v 1.54 2020/07/19 18:57:57 krw Exp $ */ /* * Copyright (c) 2008 David Gwynne <dlg@openbsd.org> @@ -145,14 +145,15 @@ vscsi_attach(struct device *parent, struct device *self, void *aux) rw_init(&sc->sc_ioc_lock, "vscsiioc"); scsi_iopool_init(&sc->sc_iopool, sc, vscsi_ccb_get, vscsi_ccb_put); - sc->sc_link.adapter = &vscsi_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = 256; sc->sc_link.openings = 16; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &vscsi_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = 256; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/scsi/mpath.c b/sys/scsi/mpath.c index da37d4688a1..489e249d202 100644 --- a/sys/scsi/mpath.c +++ b/sys/scsi/mpath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpath.c,v 1.50 2020/07/16 14:44:55 krw Exp $ */ +/* $OpenBSD: mpath.c,v 1.51 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2009 David Gwynne <dlg@openbsd.org> @@ -119,14 +119,14 @@ mpath_attach(struct device *parent, struct device *self, void *aux) printf("\n"); - sc->sc_link.adapter = &mpath_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = MPATH_BUSWIDTH; - sc->sc_link.luns = 1; sc->sc_link.openings = 1024; /* XXX magical */ saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &mpath_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = MPATH_BUSWIDTH; + saa.saa_luns = 1; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 05f3e7f77fc..e4a28aa0827 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.227 2020/07/16 14:44:55 krw Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.228 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -141,15 +141,15 @@ scsibusattach(struct device *parent, struct device *self, void *aux) scsi_autoconf = 0; SLIST_INIT(&sb->sc_link_list); - sb->sb_adapter_softc = saa->saa_sc_link->adapter_softc; - sb->sb_adapter = saa->saa_sc_link->adapter; + sb->sb_adapter_softc = saa->saa_adapter_softc; + sb->sb_adapter = saa->saa_adapter; sb->sb_pool = saa->saa_sc_link->pool; sb->sb_quirks = saa->saa_sc_link->quirks; sb->sb_flags = saa->saa_sc_link->flags; sb->sb_openings = saa->saa_sc_link->openings; - sb->sb_adapter_buswidth = saa->saa_sc_link->adapter_buswidth; - sb->sb_adapter_target = saa->saa_sc_link->adapter_target; - sb->sb_luns = saa->saa_sc_link->luns; + sb->sb_adapter_buswidth = saa->saa_adapter_buswidth; + sb->sb_adapter_target = saa->saa_adapter_target; + sb->sb_luns = saa->saa_luns; if (sb->sb_adapter_buswidth == 0) sb->sb_adapter_buswidth = 8; @@ -839,19 +839,14 @@ scsi_probedev(struct scsibus_softc *sb, int target, int lun, int dumbscan) } link->state = 0; - link->luns = sb->sb_luns; link->target = target; link->lun = lun; link->openings = sb->sb_openings; link->node_wwn = link->port_wwn = 0; - link->adapter_target = sb->sb_adapter_target; - link->adapter_buswidth = sb->sb_adapter_buswidth; link->flags = sb->sb_flags; link->quirks = sb->sb_quirks; link->interpret_sense = scsi_interpret_sense; link->device_softc = NULL; - link->adapter = sb->sb_adapter; - link->adapter_softc = sb->sb_adapter_softc; link->bus = sb; memset(&link->inqdata, 0, sizeof(link->inqdata)); link->id = NULL; diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index 8074cf4dc0f..73c3169e000 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.h,v 1.191 2020/07/16 12:38:44 krw Exp $ */ +/* $OpenBSD: scsiconf.h,v 1.192 2020/07/19 18:57:58 krw Exp $ */ /* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */ /* @@ -284,15 +284,11 @@ struct scsi_link { u_int state; #define SDEV_S_DYING (1<<1) - u_int8_t luns; u_int16_t target; /* targ of this dev */ u_int16_t lun; /* lun of this dev */ u_int16_t openings; /* available operations per lun */ u_int64_t port_wwn; /* world wide name of port */ u_int64_t node_wwn; /* world wide name of node */ - u_int16_t adapter_target; /* what are we on the scsi bus (don't probe!) */ -#define SDEV_NO_ADAPTER_TARGET 0xffff /* we are not a target on the scsi bus */ - u_int16_t adapter_buswidth; /* number of targets to probe (0 becomes 8) */ u_int16_t flags; /* flags that all devices have */ #define SDEV_REMOVABLE 0x0001 /* media is removable */ #define SDEV_MEDIA_LOADED 0x0002 /* device figures are still valid */ @@ -317,8 +313,6 @@ struct scsi_link { #define SDEV_ONLYBIG 0x4000 /* always use READ_BIG and WRITE_BIG */ int (*interpret_sense)(struct scsi_xfer *); void *device_softc; /* needed for call to foo_start */ - struct scsi_adapter *adapter; /* adapter entry points */ - void *adapter_softc; /* needed for call to foo_scsi_cmd */ struct scsibus_softc *bus; /* link to the scsibus we're on */ struct scsi_inquiry_data inqdata; /* copy of INQUIRY data from probe */ struct devid *id; @@ -345,7 +339,13 @@ struct scsi_inquiry_pattern { }; struct scsibus_attach_args { - struct scsi_link *saa_sc_link; + struct scsi_link *saa_sc_link; + struct scsi_adapter *saa_adapter; + void *saa_adapter_softc; + u_int16_t saa_adapter_target; +#define SDEV_NO_ADAPTER_TARGET 0xffff + u_int16_t saa_adapter_buswidth; + u_int8_t saa_luns; }; /* |