Lines Matching refs:hcd
21 #include <linux/usb/hcd.h>
53 * @hcd: the bus whose buffer pools are to be initialized
65 int hcd_buffer_create(struct usb_hcd *hcd)
70 if (hcd->localmem_pool || !hcd_uses_dma(hcd))
78 hcd->pool[i] = dma_pool_create(name, hcd->self.sysdev,
80 if (!hcd->pool[i]) {
81 hcd_buffer_destroy(hcd);
91 * @hcd: the bus whose buffer pools are to be destroyed
97 void hcd_buffer_destroy(struct usb_hcd *hcd)
105 dma_pool_destroy(hcd->pool[i]);
106 hcd->pool[i] = NULL;
122 struct usb_hcd *hcd = bus_to_hcd(bus);
128 if (hcd->localmem_pool)
129 return gen_pool_dma_alloc(hcd->localmem_pool, size, dma);
132 if (!hcd_uses_dma(hcd)) {
139 return dma_pool_alloc(hcd->pool[i], mem_flags, dma);
141 return dma_alloc_coherent(hcd->self.sysdev, size, dma, mem_flags);
151 struct usb_hcd *hcd = bus_to_hcd(bus);
157 if (hcd->localmem_pool) {
158 gen_pool_free(hcd->localmem_pool, (unsigned long)addr, size);
162 if (!hcd_uses_dma(hcd)) {
169 dma_pool_free(hcd->pool[i], addr, dma);
173 dma_free_coherent(hcd->self.sysdev, size, addr, dma);
176 void *hcd_buffer_alloc_pages(struct usb_hcd *hcd,
182 if (hcd->localmem_pool)
183 return gen_pool_dma_alloc_align(hcd->localmem_pool,
187 if (!hcd_uses_dma(hcd)) {
193 return dma_alloc_coherent(hcd->self.sysdev,
197 void hcd_buffer_free_pages(struct usb_hcd *hcd,
203 if (hcd->localmem_pool) {
204 gen_pool_free(hcd->localmem_pool,
209 if (!hcd_uses_dma(hcd)) {
214 dma_free_coherent(hcd->self.sysdev, size, addr, dma);