Lines Matching full:hcd

3  * DMA memory management for framework level HCD code (hc_driver)
21 #include <linux/usb/hcd.h>
53 * @hcd: the bus whose buffer pools are to be initialized
64 int hcd_buffer_create(struct usb_hcd *hcd) in hcd_buffer_create() argument
69 if (hcd->localmem_pool || !hcd_uses_dma(hcd)) in hcd_buffer_create()
77 hcd->pool[i] = dma_pool_create(name, hcd->self.sysdev, in hcd_buffer_create()
79 if (!hcd->pool[i]) { in hcd_buffer_create()
80 hcd_buffer_destroy(hcd); in hcd_buffer_create()
90 * @hcd: the bus whose buffer pools are to be destroyed
95 void hcd_buffer_destroy(struct usb_hcd *hcd) in hcd_buffer_destroy() argument
103 dma_pool_destroy(hcd->pool[i]); in hcd_buffer_destroy()
104 hcd->pool[i] = NULL; in hcd_buffer_destroy()
120 struct usb_hcd *hcd = bus_to_hcd(bus); in hcd_buffer_alloc() local
126 if (hcd->localmem_pool) in hcd_buffer_alloc()
127 return gen_pool_dma_alloc(hcd->localmem_pool, size, dma); in hcd_buffer_alloc()
130 if (!hcd_uses_dma(hcd)) { in hcd_buffer_alloc()
137 return dma_pool_alloc(hcd->pool[i], mem_flags, dma); in hcd_buffer_alloc()
139 return dma_alloc_coherent(hcd->self.sysdev, size, dma, mem_flags); in hcd_buffer_alloc()
149 struct usb_hcd *hcd = bus_to_hcd(bus); in hcd_buffer_free() local
155 if (hcd->localmem_pool) { in hcd_buffer_free()
156 gen_pool_free(hcd->localmem_pool, (unsigned long)addr, size); in hcd_buffer_free()
160 if (!hcd_uses_dma(hcd)) { in hcd_buffer_free()
167 dma_pool_free(hcd->pool[i], addr, dma); in hcd_buffer_free()
171 dma_free_coherent(hcd->self.sysdev, size, addr, dma); in hcd_buffer_free()