Lines Matching refs:hcd
65 int hcd_buffer_create(struct usb_hcd *hcd) in hcd_buffer_create() argument
70 if (hcd->localmem_pool || !hcd_uses_dma(hcd)) in hcd_buffer_create()
78 hcd->pool[i] = dma_pool_create(name, hcd->self.sysdev, in hcd_buffer_create()
80 if (!hcd->pool[i]) { in hcd_buffer_create()
81 hcd_buffer_destroy(hcd); in hcd_buffer_create()
97 void hcd_buffer_destroy(struct usb_hcd *hcd) in hcd_buffer_destroy() argument
105 dma_pool_destroy(hcd->pool[i]); in hcd_buffer_destroy()
106 hcd->pool[i] = NULL; in hcd_buffer_destroy()
122 struct usb_hcd *hcd = bus_to_hcd(bus); in hcd_buffer_alloc() local
128 if (hcd->localmem_pool) in hcd_buffer_alloc()
129 return gen_pool_dma_alloc(hcd->localmem_pool, size, dma); in hcd_buffer_alloc()
132 if (!hcd_uses_dma(hcd)) { in hcd_buffer_alloc()
139 return dma_pool_alloc(hcd->pool[i], mem_flags, dma); in hcd_buffer_alloc()
141 return dma_alloc_coherent(hcd->self.sysdev, size, dma, mem_flags); in hcd_buffer_alloc()
151 struct usb_hcd *hcd = bus_to_hcd(bus); in hcd_buffer_free() local
157 if (hcd->localmem_pool) { in hcd_buffer_free()
158 gen_pool_free(hcd->localmem_pool, (unsigned long)addr, size); in hcd_buffer_free()
162 if (!hcd_uses_dma(hcd)) { in hcd_buffer_free()
169 dma_pool_free(hcd->pool[i], addr, dma); in hcd_buffer_free()
173 dma_free_coherent(hcd->self.sysdev, size, addr, dma); in hcd_buffer_free()