summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2012-10-09 13:41:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2012-10-09 13:41:05 +0000
commit322a466c1c91aa3c4cf4c2a88d7fdad680153aa6 (patch)
treeeb718924afaa56a337db7c33de82078089b5b0b5 /sys/dev
parent9162d9c4af4edd1b2764ac0e89ca54b4f78b86bd (diff)
Our arc4random() is safe to use in any context, so we don't the crazy
fake randomizer for pre-boot. We still need better interrupt scheduling, but this makes that more clear. ok yuo mpi
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ehci.c12
-rw-r--r--sys/dev/usb/ehcivar.h3
2 files changed, 3 insertions, 12 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index 8dd140ad489..20788ef7463 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.127 2012/10/08 21:47:50 deraadt Exp $ */
+/* $OpenBSD: ehci.c,v 1.128 2012/10/09 13:41:04 deraadt Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -375,9 +375,6 @@ ehci_init(ehci_softc_t *sc)
return (USBD_IOERROR);
}
- /* XXX need proper intr scheduling */
- sc->sc_rand = 96;
-
/* frame list size at default, read back what we got and use that */
switch (EHCI_CMD_FLS(EOREAD4(sc, EHCI_USBCMD))) {
case 0:
@@ -3402,12 +3399,7 @@ ehci_device_setintr(ehci_softc_t *sc, ehci_soft_qh_t *sqh, int ival)
/* Pick an interrupt slot at the right level. */
/* XXX could do better than picking at random */
- if (cold) {
- /* XXX prevent panics at boot by not using arc4random */
- sc->sc_rand = (sc->sc_rand + 192) % sc->sc_flsize;
- islot = EHCI_IQHIDX(lev, sc->sc_rand);
- } else
- islot = EHCI_IQHIDX(lev, arc4random());
+ islot = EHCI_IQHIDX(lev, arc4random());
sqh->islot = islot;
isp = &sc->sc_islots[islot];
diff --git a/sys/dev/usb/ehcivar.h b/sys/dev/usb/ehcivar.h
index 51a71d1c9a6..d3967570061 100644
--- a/sys/dev/usb/ehcivar.h
+++ b/sys/dev/usb/ehcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehcivar.h,v 1.23 2012/10/08 21:47:50 deraadt Exp $ */
+/* $OpenBSD: ehcivar.h,v 1.24 2012/10/09 13:41:04 deraadt Exp $ */
/* $NetBSD: ehcivar.h,v 1.19 2005/04/29 15:04:29 augustss Exp $ */
/*
@@ -130,7 +130,6 @@ typedef struct ehci_softc {
usb_dma_t sc_fldma;
ehci_link_t *sc_flist;
u_int sc_flsize;
- u_int sc_rand; /* XXX need proper intr scheduling */
struct ehci_soft_islot sc_islots[EHCI_INTRQHS];