Turn on interrupt-entropy harvesting for all/any mass storage devices

I could find. I have no doubt missed a couple.

Interrupt entropy harvesting is still conditional on the
kern.random.sys.harvest_interrupt sysctl.
This commit is contained in:
Mark Murray 2001-03-01 17:09:09 +00:00
parent 7bf8fc01e9
commit ed34d0ade2
32 changed files with 45 additions and 38 deletions

View File

@ -181,7 +181,7 @@ aac_pci_attach(device_t dev)
device_printf(sc->aac_dev, "can't allocate interrupt\n");
goto out;
}
if (bus_setup_intr(sc->aac_dev, sc->aac_irq, INTR_TYPE_BIO, aac_intr, sc, &sc->aac_intr)) {
if (bus_setup_intr(sc->aac_dev, sc->aac_irq, INTR_TYPE_BIO|INTR_ENTROPY, aac_intr, sc, &sc->aac_intr)) {
device_printf(sc->aac_dev, "can't set up interrupt\n");
goto out;
}

View File

@ -309,7 +309,7 @@ adv_eisa_attach(device_t dev)
/*
* Enable our interrupt handler.
*/
bus_setup_intr(dev, irq, INTR_TYPE_CAM, adv_intr, adv, &ih);
bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv, &ih);
/* Attach sub-devices - always succeeds */
adv_attach(adv);

View File

@ -319,7 +319,7 @@ adv_isa_probe(device_t dev)
irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_ACTIVE);
if (irqres == NULL ||
bus_setup_intr(dev, irqres, INTR_TYPE_CAM, adv_intr, adv,
bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv,
&ih)) {
bus_dmamap_unload(overrun_dmat, overrun_dmamap);
bus_dmamem_free(overrun_dmat, overrun_buf,

View File

@ -293,7 +293,7 @@ adv_pci_attach(device_t dev)
irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_SHAREABLE | RF_ACTIVE);
if (irqres == NULL ||
bus_setup_intr(dev, irqres, INTR_TYPE_CAM, adv_intr, adv, &ih)) {
bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv, &ih)) {
adv_free(adv);
bus_release_resource(dev, SYS_RES_IOPORT, 0, iores);
return ENXIO;

View File

@ -1169,8 +1169,9 @@ adw_attach(struct adw_softc *adw)
error = 0;
s = splcam();
/* Hook up our interrupt handler */
if ((error = bus_setup_intr(adw->device, adw->irq, INTR_TYPE_CAM,
adw_intr, adw, &adw->ih)) != 0) {
if ((error = bus_setup_intr(adw->device, adw->irq,
INTR_TYPE_CAM | INTR_ENTROPY, adw_intr,
adw, &adw->ih)) != 0) {
device_printf(adw->device, "bus_setup_intr() failed: %d\n",
error);
goto fail;

View File

@ -277,7 +277,7 @@ aha_isa_attach(device_t dev)
return (error);
}
error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM, aha_intr, aha,
error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM|INTR_ENTROPY, aha_intr, aha,
&ih);
if (error) {
device_printf(dev, "Unable to register interrupt handler\n");

View File

@ -201,7 +201,7 @@ aha_mca_attach (device_t dev)
goto bad;
}
error = bus_setup_intr(dev, irq, INTR_TYPE_CAM, aha_intr, sc, &ih);
error = bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, aha_intr, sc, &ih);
if (error) {
device_printf(dev, "Unable to register interrupt handler\n");
goto bad;

View File

@ -367,7 +367,7 @@ ahbattach(device_t dev)
goto error_exit;
/* Enable our interrupt */
bus_setup_intr(dev, irq, INTR_TYPE_CAM, ahbintr, ahb, &ih);
bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, ahbintr, ahb, &ih);
return (0);
error_exit:

View File

@ -231,8 +231,8 @@ aic_isa_attach(device_t dev)
return (error);
}
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM, aic_intr,
aic, &sc->sc_ih);
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY,
aic_intr, aic, &sc->sc_ih);
if (error) {
device_printf(dev, "failed to register interrupt handler\n");
aic_isa_release_resources(dev);

View File

@ -177,8 +177,8 @@ aic_isa_attach(device_t dev)
return (error);
}
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM, aic_intr,
aic, &sc->sc_ih);
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY,
aic_intr, aic, &sc->sc_ih);
if (error) {
device_printf(dev, "failed to register interrupt handler\n");
aic_isa_release_resources(dev);

View File

@ -161,8 +161,8 @@ aic_pccard_attach(device_t dev)
return (error);
}
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM, aic_intr,
aic, &sc->sc_ih);
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY,
aic_intr, aic, &sc->sc_ih);
if (error) {
device_printf(dev, "failed to register interrupt handler\n");
aic_pccard_release_resources(dev);

View File

@ -2372,7 +2372,8 @@ amd_attach(device_t dev)
irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_SHAREABLE | RF_ACTIVE);
if (irqres == NULL ||
bus_setup_intr(dev, irqres, INTR_TYPE_CAM, amd_intr, amd, &ih)) {
bus_setup_intr(dev, irqres, INTR_TYPE_CAM | INTR_ENTROPY,
amd_intr, amd, &ih)) {
if (bootverbose)
printf("amd%d: unable to register interrupt handler!\n",
unit);

View File

@ -196,7 +196,7 @@ amr_pci_attach(device_t dev)
device_printf(sc->amr_dev, "can't allocate interrupt\n");
goto out;
}
if (bus_setup_intr(sc->amr_dev, sc->amr_irq, INTR_TYPE_BIO, amr_pci_intr, sc, &sc->amr_intr)) {
if (bus_setup_intr(sc->amr_dev, sc->amr_irq, INTR_TYPE_BIO | INTR_ENTROPY, amr_pci_intr, sc, &sc->amr_intr)) {
device_printf(sc->amr_dev, "can't set up interrupt\n");
goto out;
}

View File

@ -2480,7 +2480,7 @@ asr_pci_map_int (
if (sc->ha_irq_res == (struct resource *)NULL) {
return (0);
}
if (bus_setup_intr(tag, sc->ha_irq_res, INTR_TYPE_CAM,
if (bus_setup_intr(tag, sc->ha_irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
(driver_intr_t *)asr_intr, (void *)sc, &(sc->ha_intr))) {
return (0);
}

View File

@ -873,7 +873,7 @@ bt_attach(device_t dev)
/*
* Setup interrupt.
*/
error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM,
error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM|INTR_ENTROPY,
bt_intr, bt, &bt->ih);
if (error) {
device_printf(dev, "bus_setup_intr() failed: %d\n", error);

View File

@ -161,7 +161,8 @@ dpt_eisa_attach (device_t dev)
splx(s);
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM, dpt_intr, dpt, &ih)) {
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM | INTR_ENTROPY, dpt_intr,
dpt, &ih)) {
device_printf(dev, "Unable to register interrupt handler\n");
error = ENXIO;
goto bad;

View File

@ -146,7 +146,8 @@ dpt_isa_attach (device_t dev)
splx(s);
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM, dpt_intr, dpt, &ih)) {
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM | INTR_ENTROPY, dpt_intr,
dpt, &ih)) {
device_printf(dev, "Unable to register interrupt handler\n");
error = ENXIO;
goto bad;

View File

@ -166,7 +166,8 @@ dpt_pci_attach (device_t dev)
splx(s);
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM, dpt_intr, dpt, &ih)) {
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM | INTR_ENTROPY, dpt_intr,
dpt, &ih)) {
device_printf(dev, "Unable to register interrupt handler\n");
error = ENXIO;
goto bad;

View File

@ -319,7 +319,7 @@ ida_eisa_attach(device_t dev)
return (ENOMEM);
}
error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO,
error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY,
ida_intr, ida, &ida->ih);
if (error) {
device_printf(dev, "can't setup interrupt\n");

View File

@ -281,7 +281,7 @@ ida_pci_attach(device_t dev)
ida_free(ida);
return (ENOMEM);
}
error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO,
error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY,
ida_intr, ida, &ida->ih);
if (error) {
device_printf(dev, "can't setup interrupt\n");

View File

@ -616,13 +616,13 @@ isp_pci_attach(device_t dev)
mtx_init(&isp->isp_osinfo.lock, "isp", MTX_DEF);
locksetup++;
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM | INTR_MPSAFE,
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM | INTR_MPSAFE | INTR_ENTROPY,
isp_pci_intr, isp, &pcs->ih)) {
device_printf(dev, "could not setup interrupt\n");
goto bad;
}
#else
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM,
if (bus_setup_intr(dev, irq, INTR_TYPE_CAM | INTR_ENTROPY,
isp_pci_intr, isp, &pcs->ih)) {
device_printf(dev, "could not setup interrupt\n");
goto bad;

View File

@ -366,7 +366,7 @@ mlx_attach(struct mlx_softc *sc)
mlx_free(sc);
return(ENXIO);
}
error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO, mlx_intr, sc, &sc->mlx_intr);
error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | INTR_ENTROPY, mlx_intr, sc, &sc->mlx_intr);
if (error) {
device_printf(sc->mlx_dev, "can't set up interrupt\n");
mlx_free(sc);

View File

@ -186,7 +186,7 @@ mly_pci_attach(device_t dev)
mly_printf(sc, "can't allocate interrupt\n");
goto fail;
}
if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM, mly_pci_intr, sc, &sc->mly_intr)) {
if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM | INTR_ENTROPY, mly_pci_intr, sc, &sc->mly_intr)) {
mly_printf(sc, "can't set up interrupt\n");
goto fail;
}

View File

@ -241,7 +241,7 @@ ncv_pccard_attach(DEVPORT_PDEVICE dev)
return(error);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM,
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
ncv_pccard_intr, (void *)sc, &sc->ncv_intrhand);
if (error) {
ncv_release_resource(dev);

View File

@ -218,7 +218,7 @@ nsp_pccard_attach(DEVPORT_PDEVICE dev)
return(error);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM,
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
nsp_pccard_intr, (void *)sc, &sc->nsp_intrhand);
if (error) {
nsp_release_resource(dev);

View File

@ -192,7 +192,7 @@ stg_isa_attach(device_t dev)
return(error);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM,
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
stg_isa_intr, (void *)sc, &sc->stg_intrhand);
if (error) {
stg_release_resource(dev);

View File

@ -217,7 +217,7 @@ stg_pccard_attach(DEVPORT_PDEVICE dev)
return(error);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM,
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
stg_pccard_intr, (void *)sc, &sc->stg_intrhand);
if (error) {
stg_release_resource(dev);

View File

@ -9452,8 +9452,9 @@ int sym_cam_attach(hcb_p np)
* Establish our interrupt handler.
*/
#ifdef FreeBSD_Bus_Io_Abstraction
err = bus_setup_intr(np->device, np->irq_res, INTR_TYPE_CAM,
sym_intr, np, &np->intr);
err = bus_setup_intr(np->device, np->irq_res,
INTR_TYPE_CAM | INTR_ENTROPY, sym_intr, np,
&np->intr);
if (err) {
device_printf(np->device, "bus_setup_intr() failed: %d\n",
err);

View File

@ -258,7 +258,7 @@ twe_attach(device_t dev)
twe_free(sc);
return(ENXIO);
}
if (bus_setup_intr(sc->twe_dev, sc->twe_irq, INTR_TYPE_BIO, twe_pci_intr, sc, &sc->twe_intr)) {
if (bus_setup_intr(sc->twe_dev, sc->twe_irq, INTR_TYPE_BIO | INTR_ENTROPY, twe_pci_intr, sc, &sc->twe_intr)) {
twe_printf(sc, "can't set up interrupt\n");
twe_free(sc);
return(ENXIO);

View File

@ -539,7 +539,7 @@ wds_attach(device_t dev)
/*count*/ 0, RF_ACTIVE);
if (wp->intr_r == NULL)
goto bad;
error = bus_setup_intr(dev, wp->intr_r, INTR_TYPE_CAM,
error = bus_setup_intr(dev, wp->intr_r, INTR_TYPE_CAM | INTR_ENTROPY,
(driver_intr_t *)wds_intr, (void *)wp,
&wp->intr_cookie);
if (error)

View File

@ -2372,7 +2372,8 @@ amd_attach(device_t dev)
irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_SHAREABLE | RF_ACTIVE);
if (irqres == NULL ||
bus_setup_intr(dev, irqres, INTR_TYPE_CAM, amd_intr, amd, &ih)) {
bus_setup_intr(dev, irqres, INTR_TYPE_CAM | INTR_ENTROPY,
amd_intr, amd, &ih)) {
if (bootverbose)
printf("amd%d: unable to register interrupt handler!\n",
unit);

View File

@ -3770,7 +3770,7 @@ ncr_attach (device_t dev)
device_printf(dev,
"interruptless mode: reduced performance.\n");
} else {
bus_setup_intr(dev, np->irq_res, INTR_TYPE_CAM,
bus_setup_intr(dev, np->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
ncr_intr, np, &np->irq_handle);
}