Lines Matching refs:ehci
94 struct ehci_hcd *ehci; in ehci_hcd_alloc() local
96 ehci = (struct ehci_hcd *) in ehci_hcd_alloc()
100 if (ehci != 0) in ehci_hcd_alloc()
102 diag_printf("ehci: %lx\n", (U32) ehci); in ehci_hcd_alloc()
103 memset (ehci, 0, sizeof (struct ehci_hcd)); in ehci_hcd_alloc()
105 memcpy(ehci->hcd.product_desc, "EHCI Host Controller", sizeof(ehci->hcd.product_desc)); in ehci_hcd_alloc()
106 return &ehci->hcd; in ehci_hcd_alloc()
115 static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, int flags) in ehci_qtd_alloc() argument
120 qtd = (struct ehci_qtd*) pci_pool_alloc (ehci->qtd_pool, flags, &dma); in ehci_qtd_alloc()
144 static __inline__ void ehci_qtd_free (struct ehci_hcd *ehci, struct ehci_qtd *qtd) in ehci_qtd_free() argument
146 pci_pool_free (ehci->qtd_pool, qtd, qtd->qtd_dma); in ehci_qtd_free()
150 static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, int flags) in ehci_qh_alloc() argument
157 pci_pool_alloc (ehci->qh_pool, flags, &dma); in ehci_qh_alloc()
170 qh->dummy = ehci_qtd_alloc (ehci, flags); in ehci_qh_alloc()
173 ehci_dbg (ehci, "no dummy td%s%s","\n",""); in ehci_qh_alloc()
174 pci_pool_free (ehci->qh_pool, qh, qh->qh_dma); in ehci_qh_alloc()
192 static void qh_put (struct ehci_hcd *ehci, struct ehci_qh *qh) in qh_put() argument
199 ehci_dbg (ehci, "unused qh not empty%s%s","!","\n"); in qh_put()
205 ehci_qtd_free (ehci, qh->dummy); in qh_put()
208 pci_pool_free (ehci->qh_pool, qh, qh->qh_dma); in qh_put()
214 static void ehci_mem_cleanup (struct ehci_hcd *ehci) in ehci_mem_cleanup() argument
216 if (ehci->async) in ehci_mem_cleanup()
217 qh_put (ehci, ehci->async); in ehci_mem_cleanup()
218 ehci->async = 0; in ehci_mem_cleanup()
221 if (ehci->qtd_pool) in ehci_mem_cleanup()
222 pci_pool_destroy (ehci->qtd_pool); in ehci_mem_cleanup()
223 ehci->qtd_pool = 0; in ehci_mem_cleanup()
225 if (ehci->qh_pool) { in ehci_mem_cleanup()
226 pci_pool_destroy (ehci->qh_pool); in ehci_mem_cleanup()
227 ehci->qh_pool = 0; in ehci_mem_cleanup()
230 if (ehci->itd_pool) in ehci_mem_cleanup()
231 pci_pool_destroy (ehci->itd_pool); in ehci_mem_cleanup()
232 ehci->itd_pool = 0; in ehci_mem_cleanup()
234 if (ehci->sitd_pool) in ehci_mem_cleanup()
235 pci_pool_destroy (ehci->sitd_pool); in ehci_mem_cleanup()
236 ehci->sitd_pool = 0; in ehci_mem_cleanup()
238 if (ehci->periodic) in ehci_mem_cleanup()
247 …hcd_buffer_free(&ehci->hcd.self, ehci->periodic_size * sizeof (void *), ehci->periodic, ehci->peri… in ehci_mem_cleanup()
249 ehci->periodic = 0; in ehci_mem_cleanup()
250 ehci->periodic_dma = 0; in ehci_mem_cleanup()
253 if (ehci->pshadow) in ehci_mem_cleanup()
254 kfree (ehci->pshadow); in ehci_mem_cleanup()
255 ehci->pshadow = 0; in ehci_mem_cleanup()
282 static int ehci_mem_init (struct ehci_hcd *ehci, int flags) in ehci_mem_init() argument
289 ehci->qtd_pool = pci_pool_create ("ehci_qtd", ehci->hcd.pdev, in ehci_mem_init()
293 if (!ehci->qtd_pool) in ehci_mem_init()
300 ehci->qh_pool = pci_pool_create ("ehci_qh", ehci->hcd.pdev, in ehci_mem_init()
304 if (!ehci->qh_pool) in ehci_mem_init()
308 ehci->async = ehci_qh_alloc (ehci, flags); in ehci_mem_init()
309 if (!ehci->async) in ehci_mem_init()
316 ehci->itd_pool = pci_pool_create ("ehci_itd", ehci->hcd.pdev, in ehci_mem_init()
320 if (!ehci->itd_pool) in ehci_mem_init()
326 ehci->sitd_pool = pci_pool_create ("ehci_sitd", ehci->hcd.pdev, in ehci_mem_init()
330 if (!ehci->sitd_pool) in ehci_mem_init()
346 …ehci->periodic = (U32*) hcd_buffer_alloc(&ehci->hcd.self,ehci->periodic_size * sizeof (void *),0,&… in ehci_mem_init()
348 vdbg("Allocate a non-cacheable memory poof for periodic frame list array %p\n",ehci->periodic); in ehci_mem_init()
350 if (ehci->periodic == 0) in ehci_mem_init()
354 for (i = 0; i < ehci->periodic_size; i++) in ehci_mem_init()
355 ehci->periodic [i] = EHCI_LIST_END; in ehci_mem_init()
358 ehci->pshadow = (union ehci_shadow *) kmalloc (ehci->periodic_size * sizeof (void *), flags); in ehci_mem_init()
359 if (ehci->pshadow == 0) in ehci_mem_init()
363 memset (ehci->pshadow, 0, ehci->periodic_size * sizeof (void *)); in ehci_mem_init()
367 ehci_dbg (ehci, "couldn't init memory%s",""); in ehci_mem_init()
368 ehci_mem_cleanup (ehci); in ehci_mem_init()