diff options
author | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2015-02-10 14:18:35 +0000 |
---|---|---|
committer | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2015-02-10 14:18:35 +0000 |
commit | e1382ff951f15cfe6bd6bdf688fc272107fd78d7 (patch) | |
tree | d53225ed237abbabb95a42fed3772bb0a83ab644 | |
parent | 837100ce25a76447322a4c33fda32c5054f11a4e (diff) |
Convert pool(9) usages.
-rw-r--r-- | sys/dev/usb/dwc2/dwc2.c | 21 | ||||
-rw-r--r-- | sys/dev/usb/dwc2/dwc2_hcd.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/dwc2/dwc2_hcdqueue.c | 8 |
3 files changed, 19 insertions, 16 deletions
diff --git a/sys/dev/usb/dwc2/dwc2.c b/sys/dev/usb/dwc2/dwc2.c index 134ff2efa9f..76520c769fe 100644 --- a/sys/dev/usb/dwc2/dwc2.c +++ b/sys/dev/usb/dwc2/dwc2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwc2.c,v 1.9 2015/02/10 14:15:14 uebayasi Exp $ */ +/* $OpenBSD: dwc2.c,v 1.10 2015/02/10 14:18:34 uebayasi Exp $ */ /* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */ /*- @@ -270,7 +270,7 @@ dwc2_allocx(struct usbd_bus *bus) DPRINTFN(10, "\n"); DWC2_EVCNT_INCR(sc->sc_ev_xferpoolget); - dxfer = pool_get(sc->sc_xferpool, PR_NOWAIT); + dxfer = pool_get(&sc->sc_xferpool, PR_NOWAIT); if (dxfer != NULL) { memset(dxfer, 0, sizeof(*dxfer)); @@ -300,7 +300,7 @@ dwc2_freex(struct usbd_bus *bus, struct usbd_xfer *xfer) #endif DWC2_EVCNT_INCR(sc->sc_ev_xferpoolput); dwc2_hcd_urb_free(sc->sc_hsotg, dxfer->urb, DWC2_MAXISOCPACKETS); - pool_put(sc->sc_xferpool, xfer); + pool_put(&sc->sc_xferpool, xfer); } static void @@ -1593,12 +1593,15 @@ dwc2_init(struct dwc2_softc *sc) usb_setup_reserve(sc->sc_dev, &sc->sc_dma_reserve, sc->sc_bus.dmatag, USB_MEM_RESERVE); - sc->sc_xferpool = pool_init(sizeof(struct dwc2_xfer), 0, 0, 0, - "dwc2xfer", NULL, IPL_USB, NULL, NULL, NULL); - sc->sc_qhpool = pool_init(sizeof(struct dwc2_qh), 0, 0, 0, - "dwc2qh", NULL, IPL_USB, NULL, NULL, NULL); - sc->sc_qtdpool = pool_init(sizeof(struct dwc2_qtd), 0, 0, 0, - "dwc2qtd", NULL, IPL_USB, NULL, NULL, NULL); + pool_init(&sc->sc_xferpool, sizeof(struct dwc2_xfer), 0, 0, 0, + "dwc2xfer", NULL); + pool_setipl(&sc->sc_xferpool, IPL_USB); + pool_init(&sc->sc_qhpool, sizeof(struct dwc2_qh), 0, 0, 0, + "dwc2qh", NULL); + pool_setipl(&sc->sc_qhpool, IPL_USB); + pool_init(&sc->sc_qtdpool, sizeof(struct dwc2_qtd), 0, 0, 0, + "dwc2qtd", NULL); + pool_setipl(&sc->sc_qtdpool, IPL_USB); sc->sc_hsotg = malloc(sizeof(struct dwc2_hsotg), KM_SLEEP); if (sc->sc_hsotg == NULL) { diff --git a/sys/dev/usb/dwc2/dwc2_hcd.c b/sys/dev/usb/dwc2/dwc2_hcd.c index 73c115e441d..f7eb5963cc4 100644 --- a/sys/dev/usb/dwc2/dwc2_hcd.c +++ b/sys/dev/usb/dwc2/dwc2_hcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwc2_hcd.c,v 1.5 2015/02/10 13:49:48 uebayasi Exp $ */ +/* $OpenBSD: dwc2_hcd.c,v 1.6 2015/02/10 14:18:34 uebayasi Exp $ */ /* $NetBSD: dwc2_hcd.c,v 1.15 2014/11/24 10:14:14 skrll Exp $ */ /* @@ -398,7 +398,7 @@ dwc2_hcd_urb_enqueue(struct dwc2_hsotg *hsotg, struct dwc2_hcd_urb *urb, } } - qtd = pool_get(sc->sc_qtdpool, PR_NOWAIT); + qtd = pool_get(&sc->sc_qtdpool, PR_NOWAIT); if (!qtd) return -ENOMEM; @@ -411,7 +411,7 @@ dwc2_hcd_urb_enqueue(struct dwc2_hsotg *hsotg, struct dwc2_hcd_urb *urb, dev_err(hsotg->dev, "DWC OTG HCD URB Enqueue failed adding QTD. Error status %d\n", retval); - pool_put(sc->sc_qtdpool, qtd); + pool_put(&sc->sc_qtdpool, qtd); return retval; } diff --git a/sys/dev/usb/dwc2/dwc2_hcdqueue.c b/sys/dev/usb/dwc2/dwc2_hcdqueue.c index e830f985107..3e920d6a4d4 100644 --- a/sys/dev/usb/dwc2/dwc2_hcdqueue.c +++ b/sys/dev/usb/dwc2/dwc2_hcdqueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwc2_hcdqueue.c,v 1.4 2015/02/10 13:49:48 uebayasi Exp $ */ +/* $OpenBSD: dwc2_hcdqueue.c,v 1.5 2015/02/10 14:18:34 uebayasi Exp $ */ /* $NetBSD: dwc2_hcdqueue.c,v 1.11 2014/09/03 10:00:08 skrll Exp $ */ /* @@ -221,7 +221,7 @@ static struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg, return NULL; /* Allocate memory */ - qh = pool_get(sc->sc_qhpool, PR_NOWAIT); + qh = pool_get(&sc->sc_qhpool, PR_NOWAIT); if (!qh) return NULL; @@ -259,7 +259,7 @@ void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) usb_freemem(&hsotg->hsotg_sc->sc_bus, &qh->dw_align_buf_usbdma); } - pool_put(sc->sc_qhpool, qh); + pool_put(&sc->sc_qhpool, qh); } /** @@ -851,7 +851,7 @@ void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg, struct dwc2_softc *sc = hsotg->hsotg_sc; list_del_init(&qtd->qtd_list_entry); - pool_put(sc->sc_qtdpool, qtd); + pool_put(&sc->sc_qtdpool, qtd); } #define BITSTUFFTIME(bytecount) ((8 * 7 * (bytecount)) / 6) |