diff options
| author | Scott Long <scottl@FreeBSD.org> | 2007-06-17 05:55:54 +0000 |
|---|---|---|
| committer | Scott Long <scottl@FreeBSD.org> | 2007-06-17 05:55:54 +0000 |
| commit | b50569b71dfb110a58aa3e83f629115291802a74 (patch) | |
| tree | 1f069a0af9a8c28e09089c8dc789bcd435a94cce | |
| parent | 6eb9bbf3299f31b6cbda15bb91fc20ed7c808e35 (diff) | |
Notes
49 files changed, 68 insertions, 53 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 51a8a3871c76..56a16a3bf4b3 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -197,6 +197,7 @@ struct cam_eb { #define CAM_EB_RUNQ_SCHEDULED 0x01 u_int32_t refcount; u_int generation; + device_t parent_dev; }; struct cam_path { @@ -1505,7 +1506,7 @@ xpt_init(void *dummy) xpt_sim->max_ccbs = 16; mtx_lock(&xsoftc.xpt_lock); - if ((status = xpt_bus_register(xpt_sim, /*bus #*/0)) != CAM_SUCCESS) { + if ((status = xpt_bus_register(xpt_sim, NULL, 0)) != CAM_SUCCESS) { printf("xpt_init: xpt_bus_register failed with status %#x," " failing attach\n", status); return (EINVAL); @@ -4320,7 +4321,7 @@ xpt_release_ccb(union ccb *free_ccb) * availible, the bus will be probed. */ int32_t -xpt_bus_register(struct cam_sim *sim, u_int32_t bus) +xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus) { struct cam_eb *new_bus; struct cam_eb *old_bus; diff --git a/sys/cam/cam_xpt_sim.h b/sys/cam/cam_xpt_sim.h index 603c9efa22f8..d82409380689 100644 --- a/sys/cam/cam_xpt_sim.h +++ b/sys/cam/cam_xpt_sim.h @@ -37,7 +37,8 @@ /* Functions accessed by SIM drivers */ #ifdef _KERNEL -int32_t xpt_bus_register(struct cam_sim *sim, u_int32_t bus); +int32_t xpt_bus_register(struct cam_sim *sim, device_t parent, + u_int32_t bus); int32_t xpt_bus_deregister(path_id_t path_id); u_int32_t xpt_freeze_simq(struct cam_sim *sim, u_int count); void xpt_release_simq(struct cam_sim *sim, int run_queue); diff --git a/sys/cam/scsi/scsi_low.c b/sys/cam/scsi/scsi_low.c index 695815ceb876..0f4fe2713c88 100644 --- a/sys/cam/scsi/scsi_low.c +++ b/sys/cam/scsi/scsi_low.c @@ -1351,7 +1351,7 @@ scsi_low_attach_cam(slp) return ENODEV; } - if (xpt_bus_register(slp->sl_si.sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(slp->sl_si.sim, NULL, 0) != CAM_SUCCESS) { free(slp->sl_si.sim, M_SCSILOW); return ENODEV; } diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c index 88112b53fb7b..c7e2f984b899 100644 --- a/sys/dev/aac/aac_cam.c +++ b/sys/dev/aac/aac_cam.c @@ -178,7 +178,7 @@ aac_cam_attach(device_t dev) } /* Since every bus has it's own sim, every bus 'appears' as bus 0 */ - if (xpt_bus_register(sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(sim, dev, 0) != CAM_SUCCESS) { cam_sim_free(sim, TRUE); return (EIO); } diff --git a/sys/dev/advansys/advansys.c b/sys/dev/advansys/advansys.c index 79c1f06318e7..7027bcf0842b 100644 --- a/sys/dev/advansys/advansys.c +++ b/sys/dev/advansys/advansys.c @@ -1423,7 +1423,7 @@ adv_attach(adv) * * XXX Twin Channel EISA Cards??? */ - if (xpt_bus_register(adv->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(adv->sim, adv->dev, 0) != CAM_SUCCESS) { cam_sim_free(adv->sim, /*free devq*/TRUE); return (ENXIO); } diff --git a/sys/dev/advansys/advlib.h b/sys/dev/advansys/advlib.h index f7a3acb633b5..ac7da33d5c7e 100644 --- a/sys/dev/advansys/advlib.h +++ b/sys/dev/advansys/advlib.h @@ -493,7 +493,7 @@ struct adv_target_transinfo { }; struct adv_softc { - device_t dev; + device_t dev; bus_space_tag_t tag; bus_space_handle_t bsh; struct cam_sim *sim; diff --git a/sys/dev/advansys/adwcam.c b/sys/dev/advansys/adwcam.c index 2ba42daedda8..7e3b4f4baeba 100644 --- a/sys/dev/advansys/adwcam.c +++ b/sys/dev/advansys/adwcam.c @@ -1243,7 +1243,7 @@ adw_attach(struct adw_softc *adw) /* * Register the bus. */ - if (xpt_bus_register(adw->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(adw->sim, adw->device, 0) != CAM_SUCCESS) { cam_sim_free(adw->sim, /*free devq*/TRUE); error = ENOMEM; goto fail; diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c index b52b201b47ca..7dcf264e302e 100644 --- a/sys/dev/aha/aha.c +++ b/sys/dev/aha/aha.c @@ -611,7 +611,7 @@ aha_attach(struct aha_softc *aha) cam_simq_free(devq); return (ENOMEM); } - if (xpt_bus_register(aha->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(aha->sim, aha->dev, 0) != CAM_SUCCESS) { cam_sim_free(aha->sim, /*free_devq*/TRUE); return (ENXIO); } diff --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c index 3f4a588aec09..dc0f9333ccbf 100644 --- a/sys/dev/ahb/ahb.c +++ b/sys/dev/ahb/ahb.c @@ -69,7 +69,7 @@ bus_space_write_4((ahb)->tag, (ahb)->bsh, port, value) static const char *ahbmatch(eisa_id_t type); -static struct ahb_softc *ahballoc(u_long unit, struct resource *res); +static struct ahb_softc *ahballoc(device_t dev, struct resource *res); static void ahbfree(struct ahb_softc *ahb); static int ahbreset(struct ahb_softc *ahb); static void ahbmapecbs(void *arg, bus_dma_segment_t *segs, @@ -271,7 +271,7 @@ ahbattach(device_t dev) return ENOMEM; } - if ((ahb = ahballoc(device_get_unit(dev), io)) == NULL) { + if ((ahb = ahballoc(dev, io)) == NULL) { goto error_exit2; } @@ -400,7 +400,7 @@ error_exit2: } static struct ahb_softc * -ahballoc(u_long unit, struct resource *res) +ahballoc(device_t dev, struct resource *res) { struct ahb_softc *ahb; @@ -414,11 +414,12 @@ ahballoc(u_long unit, struct resource *res) } SLIST_INIT(&ahb->free_ecbs); LIST_INIT(&ahb->pending_ccbs); - ahb->unit = unit; + ahb->unit = device_get_unit(dev); ahb->tag = rman_get_bustag(res); ahb->bsh = rman_get_bushandle(res); ahb->disc_permitted = ~0; ahb->tags_permitted = ~0; + ahb->dev = dev; return (ahb); } @@ -559,7 +560,7 @@ ahbxptattach(struct ahb_softc *ahb) return (ENOMEM); } - if (xpt_bus_register(ahb->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(ahb->sim, ahb->dev, 0) != CAM_SUCCESS) { cam_sim_free(ahb->sim, /*free_devq*/TRUE); return (ENXIO); } diff --git a/sys/dev/ahb/ahbreg.h b/sys/dev/ahb/ahbreg.h index d4544434eadb..da1e03e538a6 100644 --- a/sys/dev/ahb/ahbreg.h +++ b/sys/dev/ahb/ahbreg.h @@ -258,6 +258,7 @@ struct ecb { }; struct ahb_softc { + device_t dev; bus_space_tag_t tag; bus_space_handle_t bsh; struct cam_sim *sim; diff --git a/sys/dev/aic/aic.c b/sys/dev/aic/aic.c index b647cd43c650..f2d3203fab15 100644 --- a/sys/dev/aic/aic.c +++ b/sys/dev/aic/aic.c @@ -1549,7 +1549,7 @@ aic_attach(struct aic_softc *aic) return (ENOMEM); } - if (xpt_bus_register(aic->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(aic->sim, aic->dev, 0) != CAM_SUCCESS) { cam_sim_free(aic->sim, /*free_devq*/TRUE); return (ENXIO); } diff --git a/sys/dev/aic/aic_cbus.c b/sys/dev/aic/aic_cbus.c index aa43782b904f..c6419899d342 100644 --- a/sys/dev/aic/aic_cbus.c +++ b/sys/dev/aic/aic_cbus.c @@ -125,6 +125,7 @@ aic_isa_alloc_resources(device_t dev) } } + sc->sc_aic.dev = dev; sc->sc_aic.unit = device_get_unit(dev); sc->sc_aic.tag = rman_get_bustag(sc->sc_port); sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port); diff --git a/sys/dev/aic/aic_isa.c b/sys/dev/aic/aic_isa.c index f5f96e8edf05..b80b3873363b 100644 --- a/sys/dev/aic/aic_isa.c +++ b/sys/dev/aic/aic_isa.c @@ -101,6 +101,7 @@ aic_isa_alloc_resources(device_t dev) } } + sc->sc_aic.dev = dev; sc->sc_aic.unit = device_get_unit(dev); sc->sc_aic.tag = rman_get_bustag(sc->sc_port); sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port); diff --git a/sys/dev/aic/aic_pccard.c b/sys/dev/aic/aic_pccard.c index e4273c6537a7..400038814082 100644 --- a/sys/dev/aic/aic_pccard.c +++ b/sys/dev/aic/aic_pccard.c @@ -86,6 +86,7 @@ aic_pccard_alloc_resources(device_t dev) return (ENOMEM); } + sc->sc_aic.dev = dev; sc->sc_aic.unit = device_get_unit(dev); sc->sc_aic.tag = rman_get_bustag(sc->sc_port); sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port); diff --git a/sys/dev/aic/aicvar.h b/sys/dev/aic/aicvar.h index d834fb64dda4..3bce66cb8508 100644 --- a/sys/dev/aic/aicvar.h +++ b/sys/dev/aic/aicvar.h @@ -69,6 +69,7 @@ struct aic_scb { enum { AIC6260, AIC6360, AIC6370, GM82C700 }; struct aic_softc { + device_t dev; int unit; bus_space_tag_t tag; bus_space_handle_t bsh; diff --git a/sys/dev/aic7xxx/aic79xx_osm.c b/sys/dev/aic7xxx/aic79xx_osm.c index e6a1cadc84de..db8fd8877f26 100644 --- a/sys/dev/aic7xxx/aic79xx_osm.c +++ b/sys/dev/aic7xxx/aic79xx_osm.c @@ -148,7 +148,7 @@ ahd_attach(struct ahd_softc *ahd) goto fail; } - if (xpt_bus_register(sim, /*bus_id*/0) != CAM_SUCCESS) { + if (xpt_bus_register(sim, ahd->dev_softc, /*bus_id*/0) != CAM_SUCCESS) { cam_sim_free(sim, /*free_devq*/TRUE); sim = NULL; goto fail; diff --git a/sys/dev/aic7xxx/aic7xxx_osm.c b/sys/dev/aic7xxx/aic7xxx_osm.c index ff8106deb9d5..eeb06af0c235 100644 --- a/sys/dev/aic7xxx/aic7xxx_osm.c +++ b/sys/dev/aic7xxx/aic7xxx_osm.c @@ -202,7 +202,7 @@ ahc_attach(struct ahc_softc *ahc) goto fail; } - if (xpt_bus_register(sim, bus_id) != CAM_SUCCESS) { + if (xpt_bus_register(sim, ahc->dev_softc, bus_id) != CAM_SUCCESS) { cam_sim_free(sim, /*free_devq*/TRUE); sim = NULL; goto fail; @@ -237,7 +237,8 @@ ahc_attach(struct ahc_softc *ahc) goto fail; } - if (xpt_bus_register(sim2, bus_id2) != CAM_SUCCESS) { + if (xpt_bus_register(sim2, ahc->dev_softc, bus_id2) != + CAM_SUCCESS) { printf("ahc_attach: Unable to attach second " "bus due to resource shortage"); /* diff --git a/sys/dev/amd/amd.c b/sys/dev/amd/amd.c index 7e5c4dfa20b2..53753994ec8d 100644 --- a/sys/dev/amd/amd.c +++ b/sys/dev/amd/amd.c @@ -2491,7 +2491,7 @@ amd_attach(device_t dev) return ENXIO; } - if (xpt_bus_register(amd->psim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(amd->psim, dev, 0) != CAM_SUCCESS) { cam_sim_free(amd->psim, /*free_devq*/TRUE); if (bootverbose) printf("amd_attach: xpt_bus_register failure!\n"); diff --git a/sys/dev/amr/amr_cam.c b/sys/dev/amr/amr_cam.c index 78cd4ec3d7be..56b486fcec76 100644 --- a/sys/dev/amr/amr_cam.c +++ b/sys/dev/amr/amr_cam.c @@ -158,7 +158,7 @@ amr_cam_attach(struct amr_softc *sc) } /* register the bus ID so we can get it later */ - if (xpt_bus_register(sc->amr_cam_sim[chn], chn)) { + if (xpt_bus_register(sc->amr_cam_sim[chn], sc->amr_dev, chn)) { device_printf(sc->amr_dev, "CAM XPT bus registration failed\n"); return(ENXIO); } diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index f4e79b5bea5c..1208c74d754e 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -2155,7 +2155,7 @@ static u_int32_t arcmsr_attach(device_t dev) printf("arcmsr%d: cam_sim_alloc failure!\n", unit); return ENXIO; } - if(xpt_bus_register(acb->psim, 0) != CAM_SUCCESS) { + if(xpt_bus_register(acb->psim, dev, 0) != CAM_SUCCESS) { arcmsr_free_resource(acb); bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres); cam_sim_free(acb->psim, /*free_devq*/TRUE); diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c index 260cbbd47d21..2e3aae2b9e0e 100644 --- a/sys/dev/asr/asr.c +++ b/sys/dev/asr/asr.c @@ -2657,7 +2657,7 @@ asr_attach(device_t dev) continue; } - if (xpt_bus_register(sc->ha_sim[bus], bus) != CAM_SUCCESS) { + if (xpt_bus_register(sc->ha_sim[bus], dev, bus) != CAM_SUCCESS){ cam_sim_free(sc->ha_sim[bus], /*free_devq*/TRUE); sc->ha_sim[bus] = NULL; diff --git a/sys/dev/ata/atapi-cam.c b/sys/dev/ata/atapi-cam.c index 7742af9b6915..d8f0b86274d4 100644 --- a/sys/dev/ata/atapi-cam.c +++ b/sys/dev/ata/atapi-cam.c @@ -218,7 +218,7 @@ atapi_cam_attach(device_t dev) scp->sim = sim; mtx_lock(&scp->state_lock); - if (xpt_bus_register(sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(sim, dev, 0) != CAM_SUCCESS) { error = EINVAL; mtx_unlock(&scp->state_lock); goto out; diff --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c index 21579ea77e88..b7df4b48522e 100644 --- a/sys/dev/buslogic/bt.c +++ b/sys/dev/buslogic/bt.c @@ -880,7 +880,7 @@ bt_attach(device_t dev) return (ENOMEM); } - if (xpt_bus_register(bt->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(bt->sim, dev, 0) != CAM_SUCCESS) { cam_sim_free(bt->sim, /*free_devq*/TRUE); return (ENXIO); } diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index 522afa598bff..64b1cc978c55 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -2503,7 +2503,7 @@ ciss_cam_init(struct ciss_softc *sc) */ mtx_lock(&sc->ciss_mtx); if (i == 0 || sc->ciss_controllers[i].physical.bus != 0) { - if (xpt_bus_register(sc->ciss_cam_sim[i], i) != 0) { + if (xpt_bus_register(sc->ciss_cam_sim[i], sc->ciss_dev, i) != 0) { ciss_printf(sc, "can't register SCSI bus %d\n", i); mtx_unlock(&sc->ciss_mtx); return (ENXIO); @@ -2525,7 +2525,7 @@ ciss_cam_init(struct ciss_softc *sc) } mtx_lock(&sc->ciss_mtx); - if (xpt_bus_register(sc->ciss_cam_sim[i], i) != 0) { + if (xpt_bus_register(sc->ciss_cam_sim[i], sc->ciss_dev, i) != 0) { ciss_printf(sc, "can't register SCSI bus %d\n", i); mtx_unlock(&sc->ciss_mtx); return (ENXIO); diff --git a/sys/dev/dpt/dpt.h b/sys/dev/dpt/dpt.h index bf87be16edaa..b1562d3cd3b2 100644 --- a/sys/dev/dpt/dpt.h +++ b/sys/dev/dpt/dpt.h @@ -1018,6 +1018,7 @@ struct sg_map_node { /* Main state machine and interface structure */ typedef struct dpt_softc { + device_t dev; struct resource * io_res; int io_rid; diff --git a/sys/dev/dpt/dpt_eisa.c b/sys/dev/dpt/dpt_eisa.c index 431cf1e50a79..9c367c444372 100644 --- a/sys/dev/dpt/dpt_eisa.c +++ b/sys/dev/dpt/dpt_eisa.c @@ -109,6 +109,7 @@ dpt_eisa_attach (device_t dev) int error = 0; dpt = device_get_softc(dev); + dpt->dev = dev; dpt->io_rid = 0; dpt->io_type = SYS_RES_IOPORT; diff --git a/sys/dev/dpt/dpt_isa.c b/sys/dev/dpt/dpt_isa.c index 96b67f2fcb0a..62cf0776bcfe 100644 --- a/sys/dev/dpt/dpt_isa.c +++ b/sys/dev/dpt/dpt_isa.c @@ -154,7 +154,7 @@ dpt_isa_attach (device_t dev) int error = 0; dpt = device_get_softc(dev); - + dpt->dev = dev; dpt->io_rid = 0; dpt->io_type = SYS_RES_IOPORT; diff --git a/sys/dev/dpt/dpt_pci.c b/sys/dev/dpt/dpt_pci.c index 9ca718c7b9f0..df925659e758 100644 --- a/sys/dev/dpt/dpt_pci.c +++ b/sys/dev/dpt/dpt_pci.c @@ -81,6 +81,7 @@ dpt_pci_attach (device_t dev) u_int32_t command; dpt = device_get_softc(dev); + dpt->dev = dev; command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c index 276f0c9b0601..eb1f3f444626 100644 --- a/sys/dev/dpt/dpt_scsi.c +++ b/sys/dev/dpt/dpt_scsi.c @@ -1579,7 +1579,7 @@ dpt_attach(dpt_softc_t *dpt) break; } - if (xpt_bus_register(dpt->sims[i], i) != CAM_SUCCESS) { + if (xpt_bus_register(dpt->sims[i], dpt->dev, i) != CAM_SUCCESS){ cam_sim_free(dpt->sims[i], /*free_devq*/i == 0); dpt->sims[i] = NULL; break; diff --git a/sys/dev/esp/ncr53c9x.c b/sys/dev/esp/ncr53c9x.c index cba58d53552e..5492b371ddc1 100644 --- a/sys/dev/esp/ncr53c9x.c +++ b/sys/dev/esp/ncr53c9x.c @@ -332,7 +332,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *sc) error = ENOMEM; goto fail_devq; } - if (xpt_bus_register(sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(sim, sc->sc_dev, 0) != CAM_SUCCESS) { device_printf(sc->sc_dev, "cannot register bus\n"); error = EIO; goto fail_sim; diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index f4aadb24f233..b4d89d54fcf3 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -2033,7 +2033,7 @@ END_DEBUG } SBP_LOCK(sbp); - if (xpt_bus_register(sbp->sim, /*bus*/0) != CAM_SUCCESS) + if (xpt_bus_register(sbp->sim, dev, /*bus*/0) != CAM_SUCCESS) goto fail; if (xpt_create_path(&sbp->path, xpt_periph, cam_sim_path(sbp->sim), diff --git a/sys/dev/firewire/sbp_targ.c b/sys/dev/firewire/sbp_targ.c index 3967458abb22..c5b9d2312cac 100644 --- a/sys/dev/firewire/sbp_targ.c +++ b/sys/dev/firewire/sbp_targ.c @@ -1703,7 +1703,7 @@ sbp_targ_attach(device_t dev) } SBP_LOCK(sc); - if (xpt_bus_register(sc->sim, /*bus*/0) != CAM_SUCCESS) + if (xpt_bus_register(sc->sim, dev, /*bus*/0) != CAM_SUCCESS) goto fail; if (xpt_create_path(&sc->path, /*periph*/ NULL, cam_sim_path(sc->sim), diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c index c9eddadc60b6..9f4a895a47d2 100644 --- a/sys/dev/hptiop/hptiop.c +++ b/sys/dev/hptiop/hptiop.c @@ -681,7 +681,7 @@ attach_failed: goto attach_failed; } - if (xpt_bus_register(hba->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(hba->sim, dev, 0) != CAM_SUCCESS) { printf("hptiop: xpt_bus_register failed\n"); cam_sim_free(hba->sim, /*free devq*/ TRUE); hba->sim = NULL; diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c index f58329d43e53..aa67e947ea59 100644 --- a/sys/dev/hptmv/entry.c +++ b/sys/dev/hptmv/entry.c @@ -1966,7 +1966,7 @@ hpt_attach(device_t dev) return ENOMEM; } - if(xpt_bus_register(hpt_vsim, 0) != CAM_SUCCESS) + if(xpt_bus_register(hpt_vsim, dev, 0) != CAM_SUCCESS) { cam_sim_free(hpt_vsim, /*free devq*/ TRUE); hpt_vsim = NULL; diff --git a/sys/dev/iir/iir.c b/sys/dev/iir/iir.c index b58306b73798..34a801c211c5 100644 --- a/sys/dev/iir/iir.c +++ b/sys/dev/iir/iir.c @@ -505,7 +505,7 @@ iir_attach(struct gdt_softc *gdt) gdt, gdt->sc_hanum, &Giant, /*untagged*/1, /*tagged*/GDT_MAXCMDS, devq); - if (xpt_bus_register(gdt->sims[i], i) != CAM_SUCCESS) { + if (xpt_bus_register(gdt->sims[i], gdt->sc_devnode, i) != CAM_SUCCESS) { cam_sim_free(gdt->sims[i], /*free_devq*/i == 0); break; } diff --git a/sys/dev/iir/iir.h b/sys/dev/iir/iir.h index 62f429abf117..dca493d6b844 100644 --- a/sys/dev/iir/iir.h +++ b/sys/dev/iir/iir.h @@ -590,6 +590,7 @@ struct gdt_intr_ctx { /* softc structure */ struct gdt_softc { + device_t sc_devnode; int sc_hanum; int sc_class; /* Controller class */ #define GDT_MPR 0x05 diff --git a/sys/dev/iir/iir_pci.c b/sys/dev/iir/iir_pci.c index dbeff0bedc62..528b7d71ef95 100644 --- a/sys/dev/iir/iir_pci.c +++ b/sys/dev/iir/iir_pci.c @@ -209,7 +209,7 @@ iir_pci_attach(device_t dev) } gdt = device_get_softc(dev); - bzero(gdt, sizeof(struct gdt_softc)); + gdt->sc_devnode = dev; gdt->sc_init_level = 0; gdt->sc_dpmemt = rman_get_bustag(io); gdt->sc_dpmemh = rman_get_bushandle(io); diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index 7db7b2474944..14a1d63a7a4b 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -156,7 +156,7 @@ isp_attach(ispsoftc_t *isp) } ISP_LOCK(isp); - if (xpt_bus_register(sim, primary) != CAM_SUCCESS) { + if (xpt_bus_register(sim, isp->isp_dev, primary) != CAM_SUCCESS) { cam_sim_free(sim, TRUE); return; } @@ -191,7 +191,8 @@ isp_attach(ispsoftc_t *isp) config_intrhook_disestablish(&isp->isp_osinfo.ehook); return; } - if (xpt_bus_register(sim, secondary) != CAM_SUCCESS) { + if (xpt_bus_register(sim, isp->isp_dev, secondary) != + CAM_SUCCESS) { xpt_bus_deregister(cam_sim_path(isp->isp_sim)); xpt_free_path(isp->isp_path); cam_sim_free(sim, TRUE); diff --git a/sys/dev/mfi/mfi_cam.c b/sys/dev/mfi/mfi_cam.c index 498064bf2ced..bc37bddace7d 100644 --- a/sys/dev/mfi/mfi_cam.c +++ b/sys/dev/mfi/mfi_cam.c @@ -134,7 +134,7 @@ mfip_attach(device_t dev) } mtx_lock(&mfisc->mfi_io_lock); - if (xpt_bus_register(sc->sim, 0) != 0) { + if (xpt_bus_register(sc->sim, dev, 0) != 0) { device_printf(dev, "XPT bus registration failed\n"); cam_sim_free(sc->sim, FALSE); cam_simq_free(sc->devq); diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c index f9ca34b2b5ba..d9e78bd7c563 100644 --- a/sys/dev/mly/mly.c +++ b/sys/dev/mly/mly.c @@ -1950,7 +1950,7 @@ mly_cam_attach(struct mly_softc *sc) 1, devq)) == NULL) { return(ENOMEM); } - if (xpt_bus_register(sc->mly_cam_sim[chn], chn)) { + if (xpt_bus_register(sc->mly_cam_sim[chn], sc->mly_dev, chn)) { mly_printf(sc, "CAM XPT phsyical channel registration failed\n"); return(ENXIO); } @@ -1970,7 +1970,7 @@ mly_cam_attach(struct mly_softc *sc) 0, devq)) == NULL) { return(ENOMEM); } - if (xpt_bus_register(sc->mly_cam_sim[chn], chn)) { + if (xpt_bus_register(sc->mly_cam_sim[chn], sc->mly_dev, chn)) { mly_printf(sc, "CAM XPT virtual channel registration failed\n"); return(ENXIO); } diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index f1e6eef4fd99..eba5b8c87956 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -323,7 +323,7 @@ mpt_cam_attach(struct mpt_softc *mpt) /* * Create the device queue for our SIM(s). */ - devq = cam_simq_alloc(maxq); + devq = cam_simq_alloc(1); if (devq == NULL) { mpt_prt(mpt, "Unable to allocate CAM SIMQ!\n"); error = ENOMEM; @@ -334,7 +334,7 @@ mpt_cam_attach(struct mpt_softc *mpt) * Construct our SIM entry. */ mpt->sim = - mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, maxq, devq); + mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, 1, devq); if (mpt->sim == NULL) { mpt_prt(mpt, "Unable to allocate CAM SIM!\n"); cam_simq_free(devq); @@ -346,7 +346,7 @@ mpt_cam_attach(struct mpt_softc *mpt) * Register exactly this bus. */ MPT_LOCK(mpt); - if (xpt_bus_register(mpt->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(mpt->sim, mpt->dev, 0) != CAM_SUCCESS) { mpt_prt(mpt, "Bus registration Failed!\n"); error = ENOMEM; MPT_UNLOCK(mpt); @@ -374,7 +374,7 @@ mpt_cam_attach(struct mpt_softc *mpt) * Create a "bus" to export all hidden disks to CAM. */ mpt->phydisk_sim = - mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, maxq, devq); + mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, 1, devq); if (mpt->phydisk_sim == NULL) { mpt_prt(mpt, "Unable to allocate Physical Disk CAM SIM!\n"); error = ENOMEM; @@ -385,7 +385,7 @@ mpt_cam_attach(struct mpt_softc *mpt) * Register this bus. */ MPT_LOCK(mpt); - if (xpt_bus_register(mpt->phydisk_sim, 1) != CAM_SUCCESS) { + if (xpt_bus_register(mpt->phydisk_sim, mpt->dev, 1) != CAM_SUCCESS) { mpt_prt(mpt, "Physical Disk Bus registration Failed!\n"); error = ENOMEM; MPT_UNLOCK(mpt); diff --git a/sys/dev/ppbus/vpo.c b/sys/dev/ppbus/vpo.c index c9510b281064..189a58c4eaa8 100644 --- a/sys/dev/ppbus/vpo.c +++ b/sys/dev/ppbus/vpo.c @@ -169,7 +169,7 @@ vpo_attach(device_t dev) return (ENXIO); } - if (xpt_bus_register(vpo->sim, /*bus*/0) != CAM_SUCCESS) { + if (xpt_bus_register(vpo->sim, dev, /*bus*/0) != CAM_SUCCESS) { cam_sim_free(vpo->sim, /*free_devq*/TRUE); return (ENXIO); } diff --git a/sys/dev/rr232x/osm_bsd.c b/sys/dev/rr232x/osm_bsd.c index ae394f427d41..0beacb04f1a7 100644 --- a/sys/dev/rr232x/osm_bsd.c +++ b/sys/dev/rr232x/osm_bsd.c @@ -1097,7 +1097,8 @@ static void hpt_final_init(void *dummy) return ; } - if (xpt_bus_register(vbus_ext->sim, 0) != CAM_SUCCESS) { + /* XXX No single device parent */ + if (xpt_bus_register(vbus_ext->sim, NULL, 0) != CAM_SUCCESS) { os_printk("xpt_bus_register failed"); cam_sim_free(vbus_ext->sim, /*free devq*/ TRUE); vbus_ext->sim = NULL; diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index 679b98bdde46..f33ba5951630 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -8978,7 +8978,7 @@ static int sym_cam_attach(hcb_p np) goto fail; devq = 0; - if (xpt_bus_register(sim, 0) != CAM_SUCCESS) + if (xpt_bus_register(sim, np->device, 0) != CAM_SUCCESS) goto fail; np->sim = sim; sim = 0; diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c index b3690ac5cf91..222857fb7c37 100644 --- a/sys/dev/trm/trm.c +++ b/sys/dev/trm/trm.c @@ -3645,7 +3645,7 @@ trm_attach(device_t dev) cam_simq_free(device_Q); /* SIM allocate fault*/ goto bad; } - if (xpt_bus_register(pACB->psim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(pACB->psim, dev, 0) != CAM_SUCCESS) { printf("trm%d: xpt_bus_register fault !\n",unit); goto bad; } diff --git a/sys/dev/twa/tw_osl_cam.c b/sys/dev/twa/tw_osl_cam.c index eb3c57a20b57..aaa1d51bea97 100644 --- a/sys/dev/twa/tw_osl_cam.c +++ b/sys/dev/twa/tw_osl_cam.c @@ -121,7 +121,7 @@ tw_osli_cam_attach(struct twa_softc *sc) */ tw_osli_dbg_dprintf(3, sc, "Calling xpt_bus_register"); mtx_lock(&Giant); - if (xpt_bus_register(sc->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(sc->sim, sc->bus_dev, 0) != CAM_SUCCESS) { cam_sim_free(sc->sim, TRUE); sc->sim = NULL; /* so cam_detach will not try to free it */ tw_osli_printf(sc, "error = %d", diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 3058a815f120..a114711e5559 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -2263,7 +2263,7 @@ umass_cam_attach_sim(struct umass_softc *sc) return(ENOMEM); } - if(xpt_bus_register(sc->umass_sim, device_get_unit(sc->sc_dev)) != + if(xpt_bus_register(sc->umass_sim, NULL, device_get_unit(sc->sc_dev)) != CAM_SUCCESS) return(ENOMEM); diff --git a/sys/dev/wds/wd7000.c b/sys/dev/wds/wd7000.c index 05695c745016..bad36e162981 100644 --- a/sys/dev/wds/wd7000.c +++ b/sys/dev/wds/wd7000.c @@ -614,7 +614,7 @@ wds_attach(device_t dev) } wp->sim = sim; - if (xpt_bus_register(sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(sim, dev, 0) != CAM_SUCCESS) { cam_sim_free(sim, /* free_devq */ TRUE); goto bad; } diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index 2aea447a2878..c344a1e85fd7 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -3784,7 +3784,7 @@ ncr_attach (device_t dev) } - if (xpt_bus_register(np->sim, 0) != CAM_SUCCESS) { + if (xpt_bus_register(np->sim, dev, 0) != CAM_SUCCESS) { cam_sim_free(np->sim, /*free_devq*/ TRUE); return ENOMEM; } |
