summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/aac/aac_cam.c2
-rw-r--r--sys/dev/advansys/advansys.c2
-rw-r--r--sys/dev/advansys/advlib.h2
-rw-r--r--sys/dev/advansys/adwcam.c2
-rw-r--r--sys/dev/aha/aha.c2
-rw-r--r--sys/dev/ahb/ahb.c11
-rw-r--r--sys/dev/ahb/ahbreg.h1
-rw-r--r--sys/dev/aic/aic.c2
-rw-r--r--sys/dev/aic/aic_cbus.c1
-rw-r--r--sys/dev/aic/aic_isa.c1
-rw-r--r--sys/dev/aic/aic_pccard.c1
-rw-r--r--sys/dev/aic/aicvar.h1
-rw-r--r--sys/dev/aic7xxx/aic79xx_osm.c2
-rw-r--r--sys/dev/aic7xxx/aic7xxx_osm.c5
-rw-r--r--sys/dev/amd/amd.c2
-rw-r--r--sys/dev/amr/amr_cam.c2
-rw-r--r--sys/dev/arcmsr/arcmsr.c2
-rw-r--r--sys/dev/asr/asr.c2
-rw-r--r--sys/dev/ata/atapi-cam.c2
-rw-r--r--sys/dev/buslogic/bt.c2
-rw-r--r--sys/dev/ciss/ciss.c4
-rw-r--r--sys/dev/dpt/dpt.h1
-rw-r--r--sys/dev/dpt/dpt_eisa.c1
-rw-r--r--sys/dev/dpt/dpt_isa.c2
-rw-r--r--sys/dev/dpt/dpt_pci.c1
-rw-r--r--sys/dev/dpt/dpt_scsi.c2
-rw-r--r--sys/dev/esp/ncr53c9x.c2
-rw-r--r--sys/dev/firewire/sbp.c2
-rw-r--r--sys/dev/firewire/sbp_targ.c2
-rw-r--r--sys/dev/hptiop/hptiop.c2
-rw-r--r--sys/dev/hptmv/entry.c2
-rw-r--r--sys/dev/iir/iir.c2
-rw-r--r--sys/dev/iir/iir.h1
-rw-r--r--sys/dev/iir/iir_pci.c2
-rw-r--r--sys/dev/isp/isp_freebsd.c5
-rw-r--r--sys/dev/mfi/mfi_cam.c2
-rw-r--r--sys/dev/mly/mly.c4
-rw-r--r--sys/dev/mpt/mpt_cam.c10
-rw-r--r--sys/dev/ppbus/vpo.c2
-rw-r--r--sys/dev/rr232x/osm_bsd.c3
-rw-r--r--sys/dev/sym/sym_hipd.c2
-rw-r--r--sys/dev/trm/trm.c2
-rw-r--r--sys/dev/twa/tw_osl_cam.c2
-rw-r--r--sys/dev/usb/umass.c2
-rw-r--r--sys/dev/wds/wd7000.c2
45 files changed, 61 insertions, 48 deletions
diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c
index 88112b5..c7e2f98 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 79c1f06..7027bcf 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 f7a3acb..ac7da33 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 2ba42da..7e3b4f4 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 b52b201..7dcf264 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 3f4a588..dc0f933 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 d454443..da1e03e 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 b647cd4..f2d3203 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 aa43782..c641989 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 f5f96e8..b80b387 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 e4273c6..4000388 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 d834fb6..3bce66c 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 e6a1cad..db8fd88 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 ff8106d..eeb06af 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 7e5c4df..5375399 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 78cd4ec..56b486f 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 f4e79b5..1208c74 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 260cbbd..2e3aae2 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 7742af9..d8f0b86 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 21579ea..b7df4b4 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 522afa5..64b1cc9 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 bf87be1..b1562d3 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 431cf1e..9c367c4 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 96b67f2..62cf077 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 9ca718c7b..df92565 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 276f0c9..eb1f3f4 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 cba58d5..5492b37 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 f4aadb2..b4d89d5 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 3967458..c5b9d23 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 c9eddad..9f4a895 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 f58329d..aa67e94 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 b58306b..34a801c 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 62f429a..dca493d 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 dbeff0b..528b7d7 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 7db7b24..14a1d63 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 498064b..bc37bdd 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 f9ca34b..d9e78bd 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 f1e6eef..eba5b8c 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 c9510b2..189a58c 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 ae394f4..0beacb0 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 679b98b..f33ba59 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 b3690ac..222857f 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 eb3c57a..aaa1d51 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 3058a81..a114711 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 05695c7..bad36e1 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;
}
OpenPOWER on IntegriCloud