diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-04-19 08:58:54 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-04-19 08:58:54 +0000 |
commit | dcdd29e7921e5f1cf411c24cf6d3a2afada6a6ed (patch) | |
tree | d557f9a4f5a68cef32954f3fd594fdb0999d111b /sys/dev | |
parent | 1c324f611fc1317fdabbb42a2f01642912660de5 (diff) |
Remove allocm() and freem() from the USB bus interface now that they
are only used as wrappers around usb_{alloc,free}mem().
ok deraadt@, mglocker@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/ehci.c | 29 | ||||
-rw-r--r-- | sys/dev/usb/ohci.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/uhci.c | 21 | ||||
-rw-r--r-- | sys/dev/usb/usbdi.c | 12 | ||||
-rw-r--r-- | sys/dev/usb/usbdivar.h | 5 |
5 files changed, 10 insertions, 80 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index aefdd9bcab0..cba453d4846 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.130 2013/04/15 09:23:01 mglocker Exp $ */ +/* $OpenBSD: ehci.c,v 1.131 2013/04/19 08:58:53 mpi Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -135,9 +135,6 @@ void ehci_timeout(void *); void ehci_timeout_task(void *); void ehci_intrlist_timeout(void *); -usbd_status ehci_allocm(struct usbd_bus *, struct usb_dma *, u_int32_t); -void ehci_freem(struct usbd_bus *, struct usb_dma *); - struct usbd_xfer *ehci_allocx(struct usbd_bus *); void ehci_freex(struct usbd_bus *, struct usbd_xfer *); @@ -250,8 +247,6 @@ struct usbd_bus_methods ehci_bus_methods = { ehci_open, ehci_softintr, ehci_poll, - ehci_allocm, - ehci_freem, ehci_allocx, ehci_freex, }; @@ -1175,28 +1170,6 @@ ehci_shutdown(void *v) EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET); } -usbd_status -ehci_allocm(struct usbd_bus *bus, struct usb_dma *dma, u_int32_t size) -{ - struct ehci_softc *sc = (struct ehci_softc *)bus; - usbd_status err; - - err = usb_allocmem(&sc->sc_bus, size, 0, dma); -#ifdef EHCI_DEBUG - if (err) - printf("ehci_allocm: usb_allocmem()=%d\n", err); -#endif - return (err); -} - -void -ehci_freem(struct usbd_bus *bus, struct usb_dma *dma) -{ - struct ehci_softc *sc = (struct ehci_softc *)bus; - - usb_freemem(&sc->sc_bus, dma); -} - struct usbd_xfer * ehci_allocx(struct usbd_bus *bus) { diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index c107697d36e..f1e61abe7d0 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci.c,v 1.110 2013/04/16 12:10:03 mpi Exp $ */ +/* $OpenBSD: ohci.c,v 1.111 2013/04/19 08:58:53 mpi Exp $ */ /* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */ /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */ @@ -119,9 +119,6 @@ struct ohci_soft_itd *ohci_hash_find_itd(struct ohci_softc *, ohci_physaddr_t); usbd_status ohci_setup_isoc(struct usbd_pipe *pipe); void ohci_device_isoc_enter(struct usbd_xfer *); -usbd_status ohci_allocm(struct usbd_bus *, struct usb_dma *, u_int32_t); -void ohci_freem(struct usbd_bus *, struct usb_dma *); - struct usbd_xfer *ohci_allocx(struct usbd_bus *); void ohci_freex(struct usbd_bus *, struct usbd_xfer *); @@ -261,8 +258,6 @@ struct usbd_bus_methods ohci_bus_methods = { ohci_open, ohci_softintr, ohci_poll, - ohci_allocm, - ohci_freem, ohci_allocx, ohci_freex, }; @@ -948,22 +943,6 @@ ohci_init(struct ohci_softc *sc) return (err); } -usbd_status -ohci_allocm(struct usbd_bus *bus, struct usb_dma *dma, u_int32_t size) -{ - struct ohci_softc *sc = (struct ohci_softc *)bus; - - return (usb_allocmem(&sc->sc_bus, size, 0, dma)); -} - -void -ohci_freem(struct usbd_bus *bus, struct usb_dma *dma) -{ - struct ohci_softc *sc = (struct ohci_softc *)bus; - - usb_freemem(&sc->sc_bus, dma); -} - struct usbd_xfer * ohci_allocx(struct usbd_bus *bus) { diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index ea817cf562e..be8b5b16de2 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci.c,v 1.95 2013/04/16 12:22:49 mpi Exp $ */ +/* $OpenBSD: uhci.c,v 1.96 2013/04/19 08:58:53 mpi Exp $ */ /* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -167,9 +167,6 @@ void uhci_rem_loop(struct uhci_softc *sc); usbd_status uhci_setup_isoc(struct usbd_pipe *pipe); void uhci_device_isoc_enter(struct usbd_xfer *); -usbd_status uhci_allocm(struct usbd_bus *, struct usb_dma *, u_int32_t); -void uhci_freem(struct usbd_bus *, struct usb_dma *); - struct usbd_xfer *uhci_allocx(struct usbd_bus *); void uhci_freex(struct usbd_bus *, struct usbd_xfer *); @@ -283,8 +280,6 @@ struct usbd_bus_methods uhci_bus_methods = { uhci_open, uhci_softintr, uhci_poll, - uhci_allocm, - uhci_freem, uhci_allocx, uhci_freex, }; @@ -625,20 +620,6 @@ uhci_detach(struct uhci_softc *sc, int flags) return (rv); } -usbd_status -uhci_allocm(struct usbd_bus *bus, struct usb_dma *dma, u_int32_t size) -{ - struct uhci_softc *sc = (struct uhci_softc *)bus; - - return (usb_allocmem(&sc->sc_bus, size, 0, dma)); -} - -void -uhci_freem(struct usbd_bus *bus, struct usb_dma *dma) -{ - usb_freemem(&((struct uhci_softc *)bus)->sc_bus, dma); -} - struct usbd_xfer * uhci_allocx(struct usbd_bus *bus) { diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 8462b7568c7..df4e647311a 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi.c,v 1.51 2013/04/19 08:54:49 mpi Exp $ */ +/* $OpenBSD: usbdi.c,v 1.52 2013/04/19 08:58:53 mpi Exp $ */ /* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ @@ -340,7 +340,7 @@ usbd_transfer(struct usbd_xfer *xfer) if (xfer->rqflags & URQ_AUTO_DMABUF) printf("usbd_transfer: has old buffer!\n"); #endif - err = bus->methods->allocm(bus, dmap, size); + err = usb_allocmem(bus, size, 0, dmap); if (err) return (err); xfer->rqflags |= URQ_AUTO_DMABUF; @@ -358,7 +358,7 @@ usbd_transfer(struct usbd_xfer *xfer) if (xfer->rqflags & URQ_AUTO_DMABUF) { struct usbd_bus *bus = pipe->device->bus; - bus->methods->freem(bus, &xfer->dmabuf); + usb_freemem(bus, &xfer->dmabuf); xfer->rqflags &= ~URQ_AUTO_DMABUF; } } @@ -389,7 +389,7 @@ usbd_alloc_buffer(struct usbd_xfer *xfer, u_int32_t size) if (xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF)) printf("usbd_alloc_buffer: xfer already has a buffer\n"); #endif - err = bus->methods->allocm(bus, &xfer->dmabuf, size); + err = usb_allocmem(bus, size, 0, &xfer->dmabuf); if (err) return (NULL); xfer->rqflags |= URQ_DEV_DMABUF; @@ -406,7 +406,7 @@ usbd_free_buffer(struct usbd_xfer *xfer) } #endif xfer->rqflags &= ~(URQ_DEV_DMABUF | URQ_AUTO_DMABUF); - xfer->device->bus->methods->freem(xfer->device->bus, &xfer->dmabuf); + usb_freemem(xfer->device->bus, &xfer->dmabuf); } struct usbd_xfer * @@ -798,7 +798,7 @@ usb_transfer_complete(struct usbd_xfer *xfer) if (xfer->rqflags & URQ_AUTO_DMABUF) { if (!repeat) { struct usbd_bus *bus = pipe->device->bus; - bus->methods->freem(bus, dmap); + usb_freemem(bus, dmap); xfer->rqflags &= ~URQ_AUTO_DMABUF; } } diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h index a7809234b9c..3e5da437858 100644 --- a/sys/dev/usb/usbdivar.h +++ b/sys/dev/usb/usbdivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdivar.h,v 1.47 2013/04/15 09:23:02 mglocker Exp $ */ +/* $OpenBSD: usbdivar.h,v 1.48 2013/04/19 08:58:53 mpi Exp $ */ /* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */ @@ -54,9 +54,6 @@ struct usbd_bus_methods { usbd_status (*open_pipe)(struct usbd_pipe *pipe); void (*soft_intr)(void *); void (*do_poll)(struct usbd_bus *); - usbd_status (*allocm)(struct usbd_bus *, struct usb_dma *, - u_int32_t bufsize); - void (*freem)(struct usbd_bus *, struct usb_dma *); struct usbd_xfer * (*allocx)(struct usbd_bus *); void (*freex)(struct usbd_bus *, struct usbd_xfer *); }; |