aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2002-07-30 23:26:22 +0000
committerIan Dowse <iedowse@FreeBSD.org>2002-07-30 23:26:22 +0000
commitb4dc6ff9bcad6aecd643a488efc1dc5fd195f75d (patch)
tree79896d74aa47f10ac2d9aa089d440bb1322eb651 /sys/dev
parent04f3985d888edc89d0d0acb262fc4f30a1cc92fb (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uhci.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 06e7f923e078..34b24dde1830 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -581,32 +581,8 @@ uhci_detach(struct uhci_softc *sc, int flags)
usbd_status
uhci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
{
- struct uhci_softc *sc = (struct uhci_softc *)bus;
- u_int32_t n;
-
- /*
- * XXX
- * Since we are allocating a buffer we can assume that we will
- * need TDs for it. Since we don't want to allocate those from
- * an interrupt context, we allocate them here and free them again.
- * This is no guarantee that we'll get the TDs next time...
- */
- n = size / 8;
- if (n > 16) {
- u_int32_t i;
- uhci_soft_td_t **stds;
- DPRINTF(("uhci_allocm: get %d TDs\n", n));
- stds = malloc(sizeof(uhci_soft_td_t *) * n, M_TEMP,
- M_WAITOK|M_ZERO);
- for(i=0; i < n; i++)
- stds[i] = uhci_alloc_std(sc);
- for(i=0; i < n; i++)
- if (stds[i] != NULL)
- uhci_free_std(sc, stds[i]);
- free(stds, M_TEMP);
- }
-
- return (usb_allocmem(&sc->sc_bus, size, 0, dma));
+ return (usb_allocmem(&((struct uhci_softc *)bus)->sc_bus, size, 0,
+ dma));
}
void