diff options
Diffstat (limited to 'sys/dev')
33 files changed, 229 insertions, 91 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c index b23ec973848..a93222ca4b6 100644 --- a/sys/dev/atapiscsi/atapiscsi.c +++ b/sys/dev/atapiscsi/atapiscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atapiscsi.c,v 1.75 2006/10/22 22:43:21 dlg Exp $ */ +/* $OpenBSD: atapiscsi.c,v 1.76 2006/11/28 23:59:45 dlg Exp $ */ /* * This code is derived from code with the copyright below. @@ -228,6 +228,7 @@ atapiscsi_attach(parent, self, aux) { struct atapiscsi_softc *as = (struct atapiscsi_softc *)self; struct ata_atapi_attach *aa_link = aux; + struct scsibus_attach_args saa; struct ata_drive_datas *drvp = aa_link->aa_drv_data; struct channel_softc *chp = drvp->chnl_softc; struct ataparams *id = &drvp->id; @@ -286,8 +287,10 @@ atapiscsi_attach(parent, self, aux) WDCDEBUG_PRINT(("driver caps %04x\n", drvp->atapi_cap), DEBUG_PROBE); - child = config_found((struct device *)as, &as->sc_adapterlink, - scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &as->sc_adapterlink; + + child = config_found((struct device *)as, &saa, scsiprint); if (child != NULL) { struct scsibus_softc *scsi = (struct scsibus_softc *)child; diff --git a/sys/dev/eisa/aha1742.c b/sys/dev/eisa/aha1742.c index 859dba59b1a..cf2b3bf4d84 100644 --- a/sys/dev/eisa/aha1742.c +++ b/sys/dev/eisa/aha1742.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aha1742.c,v 1.21 2005/12/03 17:13:22 krw Exp $ */ +/* $OpenBSD: aha1742.c,v 1.22 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: aha1742.c,v 1.61 1996/05/12 23:40:01 mycroft Exp $ */ /* @@ -475,6 +475,7 @@ ahbattach(parent, self, aux) { struct eisa_attach_args *ea = aux; struct ahb_softc *sc = (void *)self; + struct scsibus_attach_args saa; bus_space_tag_t iot = ea->ea_iot; bus_space_handle_t ioh; eisa_chipset_tag_t ec = ea->ea_ec; @@ -534,10 +535,13 @@ ahbattach(parent, self, aux) if (intrstr != NULL) printf("%s\n", intrstr); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + /* * ask the adapter what subunits are present */ - config_found(self, &sc->sc_link, ahbprint); + config_found(self, &saa, ahbprint); } /* diff --git a/sys/dev/i2o/ioprbs.c b/sys/dev/i2o/ioprbs.c index f4fb924c710..d9f619ad820 100644 --- a/sys/dev/i2o/ioprbs.c +++ b/sys/dev/i2o/ioprbs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioprbs.c,v 1.10 2005/12/04 04:05:25 krw Exp $ */ +/* $OpenBSD: ioprbs.c,v 1.11 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -179,6 +179,7 @@ ioprbs_attach(struct device *parent, struct device *self, void *aux) struct iop_attach_args *ia = aux; struct ioprbs_softc *sc = (struct ioprbs_softc *)self; struct iop_softc *iop = (struct iop_softc *)parent; + struct scsibus_attach_args saa; int rv, state = 0; int enable; u_int32_t cachesz; @@ -357,7 +358,10 @@ ioprbs_attach(struct device *parent, struct device *self, void *aux) sc->sc_link.adapter_buswidth = 1; sc->sc_link.adapter_target = 1; - config_found(&sc->sc_dv, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + config_found(&sc->sc_dv, &saa, scsiprint); return; diff --git a/sys/dev/i2o/iopsp.c b/sys/dev/i2o/iopsp.c index 4fc885728a7..4604bd2a94b 100644 --- a/sys/dev/i2o/iopsp.c +++ b/sys/dev/i2o/iopsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iopsp.c,v 1.8 2005/11/19 02:18:00 pedro Exp $ */ +/* $OpenBSD: iopsp.c,v 1.9 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD$ */ /*- @@ -136,6 +136,7 @@ iopsp_attach(struct device *parent, struct device *self, void *aux) struct iop_softc *iop = (struct iop_softc *)parent; struct iopsp_softc *sc = (struct iopsp_softc *)self; struct iop_attach_args *ia = (struct iop_attach_args *)aux; + struct scsibus_attach_args saa; struct { struct i2o_param_op_results pr; struct i2o_param_read_results prr; @@ -217,7 +218,10 @@ iopsp_attach(struct device *parent, struct device *self, void *aux) goto bad; } - config_found(&sc->sc_dv, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + config_found(&sc->sc_dv, &saa, scsiprint); return; bad: diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index b934a4e0dd9..3a7c3fec973 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.32 2006/07/21 19:11:11 mickey Exp $ */ +/* $OpenBSD: aac.c,v 1.33 2006/11/28 23:59:45 dlg Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -223,6 +223,7 @@ int aac_debug = AAC_DEBUG; int aac_attach(struct aac_softc *sc) { + struct scsibus_attach_args; int error; /* @@ -274,7 +275,10 @@ aac_attach(struct aac_softc *sc) sc->aac_link.adapter_buswidth = AAC_MAX_CONTAINERS; sc->aac_link.adapter_target = AAC_MAX_CONTAINERS; - config_found(&sc->aac_dev, &sc->aac_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->aac_link; + + config_found(&sc->aac_dev, &saa, scsiprint); /* Create the AIF thread */ sc->aifthread = 0; diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c index cc9f47404f3..3b393a486e8 100644 --- a/sys/dev/ic/adv.c +++ b/sys/dev/ic/adv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adv.c,v 1.15 2005/12/03 16:53:15 krw Exp $ */ +/* $OpenBSD: adv.c,v 1.16 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */ /* @@ -549,7 +549,8 @@ void adv_attach(sc) ASC_SOFTC *sc; { - int i, error; + struct scsibus_attach_args saa; + int i, error; /* * Initialize board RISC chip and enable interrupts. @@ -614,7 +615,10 @@ adv_attach(sc) printf("%s: WARNING: only %d of %d control blocks created\n", sc->sc_dev.dv_xname, i, ADV_MAX_CCB); } - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + + bzero(&saa, sizeof(saa)); + saa->sa_sc_link = &sc->sc_link; + config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c index d802fd7a511..f0b2a23cc8b 100644 --- a/sys/dev/ic/adw.c +++ b/sys/dev/ic/adw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adw.c,v 1.30 2005/12/03 16:53:15 krw Exp $ */ +/* $OpenBSD: adw.c,v 1.31 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */ /* @@ -517,7 +517,8 @@ void adw_attach(sc) ADW_SOFTC *sc; { - int i, error; + struct scsibus_attach_args saa; + int i, error; TAILQ_INIT(&sc->sc_free_ccb); @@ -628,7 +629,10 @@ adw_attach(sc) sc->sc_link.openings = 4; sc->sc_link.adapter_buswidth = ADW_MAX_TID+1; - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/ic/aic6360.c b/sys/dev/ic/aic6360.c index b2d185cd9b8..72d97ac1344 100644 --- a/sys/dev/ic/aic6360.c +++ b/sys/dev/ic/aic6360.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic6360.c,v 1.12 2006/06/03 01:51:54 martin Exp $ */ +/* $OpenBSD: aic6360.c,v 1.13 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: aic6360.c,v 1.52 1996/12/10 21:27:51 thorpej Exp $ */ #ifdef DDB @@ -264,6 +264,7 @@ void aicattach(sc) struct aic_softc *sc; { + struct scsibus_attach_args saa; AIC_TRACE(("aicattach ")); sc->sc_state = AIC_INIT; @@ -293,7 +294,10 @@ aicattach(sc) sc->sc_link.device = &aic_dev; sc->sc_link.openings = 2; - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + config_found(&sc->sc_dev, &saa, scsiprint); } int diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c index dae58bc9e3c..d65be5480d8 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.25 2006/05/22 20:35:12 krw Exp $ */ +/* $OpenBSD: aic79xx_openbsd.c,v 1.26 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -110,6 +110,7 @@ static struct scsi_device ahd_dev = int ahd_attach(struct ahd_softc *ahd) { + struct scsibus_attach_args saa; char ahd_info[256]; int s; @@ -138,8 +139,10 @@ ahd_attach(struct ahd_softc *ahd) if (ahd->flags & AHD_RESET_BUS_A) ahd_reset_channel(ahd, 'A', TRUE); - ahd->sc_child = config_found((void *)&ahd->sc_dev, - &ahd->sc_channel, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &ahd->sc_channel; + + ahd->sc_child = config_found((void *)&ahd->sc_dev, &saa, scsiprint); ahd_unlock(ahd, &s); diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c index 8969172287c..693bf2bd4ee 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.32 2006/03/04 14:20:37 krw Exp $ */ +/* $OpenBSD: aic7xxx_openbsd.c,v 1.33 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -87,6 +87,7 @@ static struct scsi_device ahc_dev = int ahc_attach(struct ahc_softc *ahc) { + struct scsibus_attach_args saa; char ahc_info[256]; int s; @@ -121,18 +122,25 @@ ahc_attach(struct ahc_softc *ahc) if ((ahc->features & AHC_TWIN) && ahc->flags & AHC_RESET_BUS_B) ahc_reset_channel(ahc, 'B', TRUE); + bzero(&saa, sizeof(saa)); if ((ahc->flags & AHC_PRIMARY_CHANNEL) == 0) { + saa.saa_sc_link = &ahc->sc_channel; ahc->sc_child = config_found((void *)&ahc->sc_dev, - &ahc->sc_channel, scsiprint); - if (ahc->features & AHC_TWIN) + &saa, scsiprint); + if (ahc->features & AHC_TWIN) { + saa.saa_sc_link = &ahc->sc_channel_b; ahc->sc_child_b = config_found((void *)&ahc->sc_dev, - &ahc->sc_channel_b, scsiprint); + &saa, scsiprint); + } } else { - if (ahc->features & AHC_TWIN) + if (ahc->features & AHC_TWIN) { + saa.saa_sc_link = &ahc->sc_channel_b; ahc->sc_child = config_found((void *)&ahc->sc_dev, - &ahc->sc_channel_b, scsiprint); + &saa, scsiprint); + } + saa.saa_sc_link = &ahc->sc_channel; ahc->sc_child_b = config_found((void *)&ahc->sc_dev, - &ahc->sc_channel, scsiprint); + &saa, scsiprint); } ahc_unlock(ahc, &s); diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 570bd58d871..3d45012fe09 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.173 2006/08/28 01:34:52 krw Exp $ */ +/* $OpenBSD: ami.c,v 1.174 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -364,6 +364,7 @@ free_ccbs: int ami_attach(struct ami_softc *sc) { + struct scsibus_attach_args saa; struct ami_rawsoftc *rsc; struct ami_ccb iccb; struct ami_iocmd *cmd; @@ -539,7 +540,10 @@ ami_attach(struct ami_softc *sc) /* lock around ioctl requests */ lockinit(&sc->sc_lock, PZERO, DEVNAME(sc), 0, 0); - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + config_found(&sc->sc_dev, &saa, scsiprint); /* can't do bioctls, sensors, or pass-through on broken devices */ if (sc->sc_flags & AMI_BROKEN) @@ -577,7 +581,10 @@ ami_attach(struct ami_softc *sc) rsc->sc_link.adapter_target = 16; rsc->sc_link.adapter_buswidth = 16; - config_found(&sc->sc_dev, &rsc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &rsc->sc_link; + + config_found(&sc->sc_dev, &saa, scsiprint); } return (0); diff --git a/sys/dev/ic/bha.c b/sys/dev/ic/bha.c index 2e142368308..98d365f3553 100644 --- a/sys/dev/ic/bha.c +++ b/sys/dev/ic/bha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bha.c,v 1.8 2005/12/03 16:53:15 krw Exp $ */ +/* $OpenBSD: bha.c,v 1.9 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: bha.c,v 1.27 1998/11/19 21:53:00 thorpej Exp $ */ #undef BHADEBUG @@ -312,6 +312,7 @@ bha_attach(sc, bpd) struct bha_softc *sc; struct bha_probe_data *bpd; { + struct scsibus_attach_args saa; int s; /* @@ -347,10 +348,13 @@ bha_attach(sc, bpd) splx(s); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + /* * ask the adapter what subunits are present */ - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + config_found(&sc->sc_dev, &saa, scsiprint); } integrate void diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index d7e3bcc8c89..665e22ceeb8 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.22 2006/08/31 12:34:39 marco Exp $ */ +/* $OpenBSD: cac.c,v 1.23 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -141,6 +141,7 @@ struct cac_linkage cac_l0 = { int cac_init(struct cac_softc *sc, int startfw) { + struct scsibus_attach_args saa; struct cac_controller_info cinfo; int error, rseg, size, i; bus_dma_segment_t seg[1]; @@ -241,7 +242,10 @@ cac_init(struct cac_softc *sc, int startfw) if (sc->sc_link.openings < 4 ) sc->sc_link.openings = 4; - config_found(&sc->sc_dv, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + config_found(&sc->sc_dv, &saa, scsiprint); /* Set our `shutdownhook' before we start any device activity. */ if (cac_sdh == NULL) diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 1f15ceaa402..36993173f27 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss.c,v 1.21 2006/09/15 23:47:52 krw Exp $ */ +/* $OpenBSD: ciss.c,v 1.22 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2005,2006 Michael Shalayeff @@ -139,6 +139,7 @@ ciss_put_ccb(struct ciss_ccb *ccb) int ciss_attach(struct ciss_softc *sc) { + struct scsibus_attach_args saa; struct scsibus_softc *scsibus; struct ciss_ccb *ccb; struct ciss_cmd *cmd; @@ -382,8 +383,10 @@ ciss_attach(struct ciss_softc *sc) sc->sc_link.adapter = &ciss_switch; sc->sc_link.adapter_target = sc->maxunits; sc->sc_link.adapter_buswidth = sc->maxunits; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; scsibus = (struct scsibus_softc *)config_found_sm(&sc->sc_dev, - &sc->sc_link, scsiprint, NULL); + &saa, scsiprint, NULL); #if 0 sc->sc_link_raw.device = &ciss_raw_dev; @@ -392,8 +395,10 @@ ciss_attach(struct ciss_softc *sc) sc->sc_link_raw.adapter = &ciss_raw_switch; sc->sc_link_raw.adapter_target = sc->ndrives; sc->sc_link_raw.adapter_buswidth = sc->ndrives; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link_raw; rawbus = (struct scsibus_softc *)config_found_sm(&sc->sc_dev, - &sc->sc_link_raw, scsiprint, NULL); + &saa, scsiprint, NULL); #endif #if NBIO > 0 diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c index 2db3a131f18..ed0b4b6f093 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.36 2006/05/08 19:52:13 deraadt Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.37 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved. @@ -120,6 +120,7 @@ int gdt_attach(gdt) struct gdt_softc *gdt; { + struct scsibus_attach_args saa; u_int16_t cdev_cnt; int i, id, drv_cyls, drv_hds, drv_secs, error, nsegs; @@ -484,7 +485,10 @@ gdt_attach(gdt) #endif gdt_cnt++; - config_found(&gdt->sc_dev, &gdt->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &gdt->sc_link; + + config_found(&gdt->sc_dev, &saa, scsiprint); gdt->sc_raw_link = malloc(gdt->sc_bus_cnt * sizeof (struct scsi_link), M_DEVBUF, M_NOWAIT); @@ -502,7 +506,10 @@ gdt_attach(gdt) gdt->sc_raw_link[i].adapter_buswidth = (gdt->sc_class & GDT_FC) ? GDT_MAXID : 16; /* XXX */ - config_found(&gdt->sc_dev, &gdt->sc_raw_link[i], scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &gdt->sc_raw_link[i]; + + config_found(&gdt->sc_dev, &saa, scsiprint); } gdt_polling = 0; diff --git a/sys/dev/ic/isp_openbsd.c b/sys/dev/ic/isp_openbsd.c index ece2a2aa439..252e1e2df90 100644 --- a/sys/dev/ic/isp_openbsd.c +++ b/sys/dev/ic/isp_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_openbsd.c,v 1.28 2005/12/03 16:53:16 krw Exp $ */ +/* $OpenBSD: isp_openbsd.c,v 1.29 2006/11/28 23:59:45 dlg Exp $ */ /* * Platform (OpenBSD) dependent common attachment code for Qlogic adapters. * @@ -85,6 +85,7 @@ struct cfdriver isp_cd = { void isp_attach(struct ispsoftc *isp) { + struct scsibus_attach_args saa; struct scsi_link *lptr = &isp->isp_osinfo._link[0]; isp->isp_osinfo._adapter.scsi_minphys = ispminphys; @@ -158,13 +159,19 @@ isp_attach(struct ispsoftc *isp) ISP_UNLOCK(isp); lptr->adapter_target = defid; } + + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = lptr; + /* * And attach children (if any). */ - config_found((void *)isp, lptr, scsiprint); + config_found((void *)isp, &saa, scsiprint); if (IS_DUALBUS(isp)) { lptr++; - config_found((void *)isp, lptr, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = lptr; + config_found((void *)isp, &saa, scsiprint); } } diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index ab36b4aded8..f17197b551b 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfi.c,v 1.65 2006/08/31 18:13:17 marco Exp $ */ +/* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * @@ -576,6 +576,7 @@ mfiminphys(struct buf *bp) int mfi_attach(struct mfi_softc *sc) { + struct scsibus_attach_args saa; uint32_t status, frames; int i; @@ -667,7 +668,10 @@ mfi_attach(struct mfi_softc *sc) sc->sc_link.adapter_target = MFI_MAX_LD; sc->sc_link.adapter_buswidth = sc->sc_max_ld; - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + config_found(&sc->sc_dev, &saa, scsiprint); /* enable interrupts */ mfi_write(sc, MFI_OMSK, MFI_ENABLE_INTR); diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index f96f7551db9..8e358a0cf84 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.81 2006/11/28 13:22:56 dlg Exp $ */ +/* $OpenBSD: mpi.c,v 1.82 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org> @@ -147,6 +147,7 @@ int mpi_cfg_page(struct mpi_softc *, u_int32_t, int mpi_attach(struct mpi_softc *sc) { + struct scsibus_attach_args saa; struct mpi_ccb *ccb; printf("\n"); @@ -224,10 +225,12 @@ mpi_attach(struct mpi_softc *sc) sc->sc_link.adapter_buswidth = sc->sc_buswidth; sc->sc_link.openings = sc->sc_maxcmds / sc->sc_buswidth; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; - /* config_found() returns the scsibus we should attach to */ + /* config_found() returns the scsibus attached to us */ sc->sc_scsibus = (struct scsibus_softc *) config_found(&sc->sc_dev, - &sc->sc_link, scsiprint); + &saa, scsiprint); /* get raid pages */ mpi_get_raid(sc); diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index eadec7473e9..700703f61fb 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.32 2006/06/26 22:16:23 miod Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.33 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -191,6 +191,8 @@ ncr53c9x_attach(sc, adapter, dev) struct scsi_adapter *adapter; struct scsi_device *dev; { + struct scsibus_attach_args saa; + timeout_set(&sc->sc_watchdog, ncr53c9x_watch, sc); /* * Allocate SCSI message buffers. @@ -268,10 +270,13 @@ ncr53c9x_attach(sc, adapter, dev) sc->sc_link.openings = 2; sc->sc_link.adapter_buswidth = sc->sc_ntarg; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + /* * Now try to attach all the sub-devices */ - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + config_found(&sc->sc_dev, &saa, scsiprint); timeout_add(&sc->sc_watchdog, 60*hz); } diff --git a/sys/dev/ic/oosiop.c b/sys/dev/ic/oosiop.c index b7eb32840fc..4c6928e17cc 100644 --- a/sys/dev/ic/oosiop.c +++ b/sys/dev/ic/oosiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oosiop.c,v 1.4 2004/03/14 19:23:33 miod Exp $ */ +/* $OpenBSD: oosiop.c,v 1.5 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: oosiop.c,v 1.4 2003/10/29 17:45:55 tsutsui Exp $ */ /* @@ -145,6 +145,7 @@ struct scsi_device oosiop_dev = { void oosiop_attach(struct oosiop_softc *sc) { + struct scsibus_attach_args saa; bus_size_t scrsize; bus_dma_segment_t seg; struct oosiop_cb *cb; @@ -248,10 +249,13 @@ oosiop_attach(struct oosiop_softc *sc) sc->sc_link.adapter_target = sc->sc_id; sc->sc_link.quirks = ADEV_NODOORLOCK; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + /* * Now try to attach all the sub devices. */ - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + config_found(&sc->sc_dev, &saa, scsiprint); } int diff --git a/sys/dev/ic/osiop.c b/sys/dev/ic/osiop.c index 442e6694f80..e9550d9bd2a 100644 --- a/sys/dev/ic/osiop.c +++ b/sys/dev/ic/osiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osiop.c,v 1.26 2005/12/03 16:53:16 krw Exp $ */ +/* $OpenBSD: osiop.c,v 1.27 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: osiop.c,v 1.9 2002/04/05 18:27:54 bouyer Exp $ */ /* @@ -202,6 +202,7 @@ void osiop_attach(sc) struct osiop_softc *sc; { + struct scsibus_attach_args saa; struct osiop_acb *acb; bus_dma_segment_t seg; int nseg; @@ -349,10 +350,13 @@ osiop_attach(sc) sc->sc_link.adapter_buswidth = OSIOP_NTGT; sc->sc_link.adapter_target = sc->sc_id; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + /* * Now try to attach all the sub devices. */ - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + config_found(&sc->sc_dev, &saa, scsiprint); } /* diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c index 16c7caec417..745e6850bec 100644 --- a/sys/dev/ic/siop.c +++ b/sys/dev/ic/siop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop.c,v 1.44 2006/05/22 22:22:11 martin Exp $ */ +/* $OpenBSD: siop.c,v 1.45 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: siop.c,v 1.79 2005/11/18 23:10:32 bouyer Exp $ */ /* @@ -186,6 +186,8 @@ void siop_attach(sc) struct siop_softc *sc; { + struct scsibus_attach_args saa; + if (siop_common_attach(&sc->sc_c) != 0) return; @@ -218,7 +220,10 @@ siop_attach(sc) siop_dump_script(sc); #endif - config_found((struct device*)sc, &sc->sc_c.sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_c.sc_link; + + config_found((struct device*)sc, &saa, scsiprint); } void diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c index 3d2f4e77b62..dfe26330469 100644 --- a/sys/dev/ic/twe.c +++ b/sys/dev/ic/twe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: twe.c,v 1.25 2005/12/03 16:53:16 krw Exp $ */ +/* $OpenBSD: twe.c,v 1.26 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved. @@ -129,6 +129,7 @@ int twe_attach(sc) struct twe_softc *sc; { + struct scsibus_attach_args saa; /* this includes a buffer for drive config req, and a capacity req */ u_int8_t param_buf[2 * TWE_SECTOR_SIZE + TWE_ALIGN - 1]; struct twe_param *pb = (void *) @@ -388,7 +389,10 @@ twe_attach(sc) sc->sc_link.openings = TWE_MAXCMDS / nunits; sc->sc_link.adapter_buswidth = TWE_MAX_UNITS; - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + config_found(&sc->sc_dev, &saa, scsiprint); kthread_create_deferred(twe_thread_create, sc); diff --git a/sys/dev/ic/uha.c b/sys/dev/ic/uha.c index f9a04eab7b6..600203ee182 100644 --- a/sys/dev/ic/uha.c +++ b/sys/dev/ic/uha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uha.c,v 1.8 2005/12/03 16:53:16 krw Exp $ */ +/* $OpenBSD: uha.c,v 1.9 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: uha.c,v 1.3 1996/10/13 01:37:29 christos Exp $ */ #undef UHADEBUG @@ -136,6 +136,7 @@ void uha_attach(sc) struct uha_softc *sc; { + struct scsibus_attach_args saa; (sc->init)(sc); TAILQ_INIT(&sc->sc_free_mscp); @@ -143,23 +144,19 @@ uha_attach(sc) /* * fill in the prototype scsi_link. */ -#ifndef __OpenBSD__ - sc->sc_link.channel = SCSI_CHANNEL_ONLY_ONE; -#endif sc->sc_link.adapter_softc = sc; sc->sc_link.adapter_target = sc->sc_scsi_dev; sc->sc_link.adapter = &uha_switch; sc->sc_link.device = &uha_dev; sc->sc_link.openings = 2; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + /* * ask the adapter what subunits are present */ -#ifdef __OpenBSD__ - config_found(&sc->sc_dev, &sc->sc_link, uhaprint); -#else - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); -#endif + config_found(&sc->sc_dev, &saa, uhaprint); } integrate void diff --git a/sys/dev/isa/aha.c b/sys/dev/isa/aha.c index 3167d419773..11213ef4a07 100644 --- a/sys/dev/isa/aha.c +++ b/sys/dev/isa/aha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aha.c,v 1.55 2005/12/03 17:13:22 krw Exp $ */ +/* $OpenBSD: aha.c,v 1.56 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: aha.c,v 1.11 1996/05/12 23:51:23 mycroft Exp $ */ #undef AHADIAG @@ -377,6 +377,7 @@ ahaattach(parent, self, aux) { struct isa_attach_args *ia = aux; struct aha_softc *sc = (void *)self; + struct scsibus_attach_args saa; int isapnp = !strcmp(parent->dv_cfdata->cf_driver->cd_name, "isapnp"); if (isapnp) { @@ -406,13 +407,16 @@ ahaattach(parent, self, aux) sc->sc_link.device = &aha_dev; sc->sc_link.openings = 2; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + sc->sc_ih = isa_intr_establish(ia->ia_ic, sc->sc_irq, IST_EDGE, IPL_BIO, ahaintr, sc, sc->sc_dev.dv_xname); /* * ask the adapter what subunits are present */ - config_found(self, &sc->sc_link, scsiprint); + config_found(self, &saa, scsiprint); } void diff --git a/sys/dev/isa/seagate.c b/sys/dev/isa/seagate.c index 80e697f7a34..1a9ee156c28 100644 --- a/sys/dev/isa/seagate.c +++ b/sys/dev/isa/seagate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: seagate.c,v 1.19 2005/12/03 17:13:22 krw Exp $ */ +/* $OpenBSD: seagate.c,v 1.20 2006/11/28 23:59:45 dlg Exp $ */ /* * ST01/02, Future Domain TMC-885, TMC-950 SCSI driver @@ -432,6 +432,7 @@ seaattach(parent, self, aux) { struct isa_attach_args *ia = aux; struct sea_softc *sea = (void *)self; + struct scsibus_attach_args saa; sea_init(sea); @@ -449,10 +450,13 @@ seaattach(parent, self, aux) sea->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE, IPL_BIO, seaintr, sea, sea->sc_dev.dv_xname); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sea->sc_link; + /* * ask the adapter what subunits are present */ - config_found(self, &sea->sc_link, seaprint); + config_found(self, &saa, seaprint); } /* diff --git a/sys/dev/isa/wds.c b/sys/dev/isa/wds.c index 5bba55c5b41..9b14b251eaa 100644 --- a/sys/dev/isa/wds.c +++ b/sys/dev/isa/wds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wds.c,v 1.22 2005/12/03 17:13:22 krw Exp $ */ +/* $OpenBSD: wds.c,v 1.23 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: wds.c,v 1.13 1996/11/03 16:20:31 mycroft Exp $ */ #undef WDSDIAG @@ -287,6 +287,7 @@ wdsattach(parent, self, aux) { struct isa_attach_args *ia = aux; struct wds_softc *sc = (void *)self; + struct scsibus_attach_args saa; bus_space_tag_t iot = ia->ia_iot; bus_space_handle_t ioh; @@ -324,10 +325,13 @@ wdsattach(parent, self, aux) sc->sc_ih = isa_intr_establish(ia->ia_ic, sc->sc_irq, IST_EDGE, IPL_BIO, wdsintr, sc, sc->sc_dev.dv_xname); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + /* * ask the adapter what subunits are present */ - config_found(self, &sc->sc_link, wdsprint); + config_found(self, &saa, wdsprint); } integrate void diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index 65d08b7c4a5..5f2d4ebcee7 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.54 2006/11/04 23:11:31 dlg Exp $ */ +/* $OpenBSD: arc.c,v 1.55 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -508,6 +508,7 @@ arc_attach(struct device *parent, struct device *self, void *aux) { struct arc_softc *sc = (struct arc_softc *)self; struct pci_attach_args *pa = aux; + struct scsibus_attach_args saa; struct device *child; sc->sc_talking = 0; @@ -539,7 +540,10 @@ arc_attach(struct device *parent, struct device *self, void *aux) sc->sc_link.adapter_buswidth = ARC_MAX_TARGET; sc->sc_link.openings = sc->sc_req_count / ARC_MAX_TARGET; - child = config_found(self, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + child = config_found(self, &saa, scsiprint); sc->sc_scsibus = (struct scsibus_softc *)child; /* enable interrupts */ diff --git a/sys/dev/pci/iha_pci.c b/sys/dev/pci/iha_pci.c index 138d0cc6ec0..d787d1683d2 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.9 2005/08/09 04:10:12 mickey Exp $ */ +/* $OpenBSD: iha_pci.c,v 1.10 2006/11/28 23:59:45 dlg Exp $ */ /*------------------------------------------------------------------------- * * Device driver for the INI-9XXXU/UW or INIC-940/950 PCI SCSI Controller. @@ -82,6 +82,7 @@ iha_pci_attach(parent, self, aux) void *aux; { struct pci_attach_args *pa = aux; + struct scsibus_attach_args saa; bus_space_handle_t ioh; pci_intr_handle_t ih; struct iha_softc *sc = (void *)self; @@ -123,7 +124,9 @@ iha_pci_attach(parent, self, aux) if (intrstr != NULL) printf(": %s\n", intrstr); - if (iha_init_tulip(sc) == 0) - config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + if (iha_init_tulip(sc) == 0) { + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + config_found(&sc->sc_dev, &saa, scsiprint); } } diff --git a/sys/dev/pci/trm_pci.c b/sys/dev/pci/trm_pci.c index faf719a67e8..584410e0637 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.3 2006/01/21 23:20:44 miod Exp $ +/* $OpenBSD: trm_pci.c,v 1.4 2006/11/28 23:59:45 dlg Exp $ * ------------------------------------------------------------ * O.S : OpenBSD * FILE NAME : trm_pci.c @@ -100,6 +100,7 @@ void trm_pci_attach(struct device *parent, struct device *self, void *aux) { struct pci_attach_args *pa = aux; + struct scsibus_attach_args saa; bus_space_handle_t ioh;/* bus space handle */ pci_intr_handle_t ih; struct trm_softc *sc = (void *)self; @@ -152,7 +153,10 @@ trm_pci_attach(struct device *parent, struct device *self, void *aux) if (intrstr != NULL) printf(": %s\n", intrstr); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + /* Tell SCSI layer about our SCSI bus */ - config_found(&sc->sc_device, &sc->sc_link, scsiprint); + config_found(&sc->sc_device, &saa, scsiprint); } } diff --git a/sys/dev/sdmmc/sdmmc_scsi.c b/sys/dev/sdmmc/sdmmc_scsi.c index f33299b56e6..0a476127478 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.6 2006/10/17 01:26:26 dlg Exp $ */ +/* $OpenBSD: sdmmc_scsi.c,v 1.7 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -95,6 +95,7 @@ void sdmmc_scsi_minphys(struct buf *); void sdmmc_scsi_attach(struct sdmmc_softc *sc) { + struct scsibus_attach_args saa; struct sdmmc_scsi_softc *scbus; struct sdmmc_function *sf; @@ -137,8 +138,10 @@ sdmmc_scsi_attach(struct sdmmc_softc *sc) scbus->sc_link.openings = 1; scbus->sc_link.adapter = &scbus->sc_adapter; - scbus->sc_child = config_found(&sc->sc_dev, &scbus->sc_link, - scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &scbus->sc_link; + + scbus->sc_child = config_found(&sc->sc_dev, &saa, scsiprint); if (scbus->sc_child == NULL) { printf("%s: can't attach scsibus\n", sc->sc_dev.dv_xname); goto free_ccbs; diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c index 575f232f62b..ddf33188013 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.13 2005/05/25 21:12:54 krw Exp $ */ +/* $OpenBSD: umass_scsi.c,v 1.14 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -93,6 +93,7 @@ struct scsi_device umass_atapiscsi_dev = { NULL, NULL, NULL, NULL, }; int umass_scsi_attach(struct umass_softc *sc) { + struct scsibus_attach_args saa; struct umass_scsi_softc *scbus; scbus = umass_scsi_setup(sc); @@ -102,13 +103,14 @@ umass_scsi_attach(struct umass_softc *sc) scbus->sc_link.flags |= SDEV_UMASS; scbus->sc_link.device = &umass_scsi_dev; + DPRINTF(UDMASS_USB, ("%s: umass_attach_bus: SCSI\n" "sc = 0x%x, scbus = 0x%x\n", USBDEVNAME(sc->sc_dev), sc, scbus)); sc->sc_refcnt++; scbus->base.sc_child = - config_found((struct device *)sc, &scbus->sc_link, scsiprint); + config_found((struct device *)sc, &saa, scsiprint); if (--sc->sc_refcnt < 0) usb_detach_wakeup(USBDEV(sc->sc_dev)); @@ -119,6 +121,7 @@ umass_scsi_attach(struct umass_softc *sc) int umass_atapi_attach(struct umass_softc *sc) { + struct scsibus_attach_args saa; struct umass_scsi_softc *scbus; scbus = umass_scsi_setup(sc); @@ -128,13 +131,16 @@ umass_atapi_attach(struct umass_softc *sc) scbus->sc_link.flags |= SDEV_ATAPI; scbus->sc_link.device = &umass_atapiscsi_dev; + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &scbus->sc_link; + DPRINTF(UDMASS_USB, ("%s: umass_attach_bus: ATAPI\n" "sc = 0x%x, scbus = 0x%x\n", USBDEVNAME(sc->sc_dev), sc, scbus)); sc->sc_refcnt++; - scbus->base.sc_child = - config_found((struct device *)sc, &scbus->sc_link, scsiprint); + scbus->base.sc_child = config_found((struct device *)sc, + &saa, scsiprint); if (--sc->sc_refcnt < 0) usb_detach_wakeup(USBDEV(sc->sc_dev)); diff --git a/sys/dev/usb/usscanner.c b/sys/dev/usb/usscanner.c index d669ee1d245..e588d4b2ed3 100644 --- a/sys/dev/usb/usscanner.c +++ b/sys/dev/usb/usscanner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usscanner.c,v 1.11 2006/06/23 06:27:12 miod Exp $ */ +/* $OpenBSD: usscanner.c,v 1.12 2006/11/28 23:59:45 dlg Exp $ */ /* $NetBSD: usscanner.c,v 1.6 2001/01/23 14:04:14 augustss Exp $ */ /* @@ -204,6 +204,7 @@ USB_MATCH(usscanner) USB_ATTACH(usscanner) { USB_ATTACH_START(usscanner, sc, uaa); + struct scsibus_attach_args saa; usbd_device_handle dev = uaa->device; usbd_interface_handle iface; char *devinfop; @@ -364,7 +365,10 @@ USB_ATTACH(usscanner) sc->sc_link.scsipi_scsi.max_lun = 0; #endif - sc->sc_child = config_found(&sc->sc_dev, &sc->sc_link, scsiprint); + bzero(&saa, sizeof(saa)); + saa.saa_sc_link = &sc->sc_link; + + sc->sc_child = config_found(&sc->sc_dev, &saa, scsiprint); usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, USBDEV(sc->sc_dev)); |