• Home
  • Raw
  • Download

Lines Matching refs:ehci

25 static inline void ehci_qtd_init(struct ehci_hcd *ehci, struct ehci_qtd *qtd,  in ehci_qtd_init()  argument
30 qtd->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); in ehci_qtd_init()
31 qtd->hw_next = EHCI_LIST_END(ehci); in ehci_qtd_init()
32 qtd->hw_alt_next = EHCI_LIST_END(ehci); in ehci_qtd_init()
36 static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, gfp_t flags) in ehci_qtd_alloc() argument
41 qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma); in ehci_qtd_alloc()
43 ehci_qtd_init(ehci, qtd, dma); in ehci_qtd_alloc()
48 static inline void ehci_qtd_free (struct ehci_hcd *ehci, struct ehci_qtd *qtd) in ehci_qtd_free() argument
50 dma_pool_free (ehci->qtd_pool, qtd, qtd->qtd_dma); in ehci_qtd_free()
54 static void qh_destroy(struct ehci_hcd *ehci, struct ehci_qh *qh) in qh_destroy() argument
58 ehci_dbg (ehci, "unused qh not empty!\n"); in qh_destroy()
62 ehci_qtd_free (ehci, qh->dummy); in qh_destroy()
63 dma_pool_free(ehci->qh_pool, qh->hw, qh->qh_dma); in qh_destroy()
67 static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) in ehci_qh_alloc() argument
76 dma_pool_alloc(ehci->qh_pool, flags, &dma); in ehci_qh_alloc()
86 qh->dummy = ehci_qtd_alloc (ehci, flags); in ehci_qh_alloc()
88 ehci_dbg (ehci, "no dummy td\n"); in ehci_qh_alloc()
94 dma_pool_free(ehci->qh_pool, qh->hw, qh->qh_dma); in ehci_qh_alloc()
107 static void ehci_mem_cleanup (struct ehci_hcd *ehci) in ehci_mem_cleanup() argument
109 if (ehci->async) in ehci_mem_cleanup()
110 qh_destroy(ehci, ehci->async); in ehci_mem_cleanup()
111 ehci->async = NULL; in ehci_mem_cleanup()
113 if (ehci->dummy) in ehci_mem_cleanup()
114 qh_destroy(ehci, ehci->dummy); in ehci_mem_cleanup()
115 ehci->dummy = NULL; in ehci_mem_cleanup()
118 dma_pool_destroy(ehci->qtd_pool); in ehci_mem_cleanup()
119 ehci->qtd_pool = NULL; in ehci_mem_cleanup()
120 dma_pool_destroy(ehci->qh_pool); in ehci_mem_cleanup()
121 ehci->qh_pool = NULL; in ehci_mem_cleanup()
122 dma_pool_destroy(ehci->itd_pool); in ehci_mem_cleanup()
123 ehci->itd_pool = NULL; in ehci_mem_cleanup()
124 dma_pool_destroy(ehci->sitd_pool); in ehci_mem_cleanup()
125 ehci->sitd_pool = NULL; in ehci_mem_cleanup()
127 if (ehci->periodic) in ehci_mem_cleanup()
128 dma_free_coherent(ehci_to_hcd(ehci)->self.sysdev, in ehci_mem_cleanup()
129 ehci->periodic_size * sizeof (u32), in ehci_mem_cleanup()
130 ehci->periodic, ehci->periodic_dma); in ehci_mem_cleanup()
131 ehci->periodic = NULL; in ehci_mem_cleanup()
134 kfree(ehci->pshadow); in ehci_mem_cleanup()
135 ehci->pshadow = NULL; in ehci_mem_cleanup()
139 static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) in ehci_mem_init() argument
144 ehci->qtd_pool = dma_pool_create ("ehci_qtd", in ehci_mem_init()
145 ehci_to_hcd(ehci)->self.sysdev, in ehci_mem_init()
149 if (!ehci->qtd_pool) { in ehci_mem_init()
154 ehci->qh_pool = dma_pool_create ("ehci_qh", in ehci_mem_init()
155 ehci_to_hcd(ehci)->self.sysdev, in ehci_mem_init()
159 if (!ehci->qh_pool) { in ehci_mem_init()
162 ehci->async = ehci_qh_alloc (ehci, flags); in ehci_mem_init()
163 if (!ehci->async) { in ehci_mem_init()
168 ehci->itd_pool = dma_pool_create ("ehci_itd", in ehci_mem_init()
169 ehci_to_hcd(ehci)->self.sysdev, in ehci_mem_init()
173 if (!ehci->itd_pool) { in ehci_mem_init()
178 ehci->sitd_pool = dma_pool_create ("ehci_sitd", in ehci_mem_init()
179 ehci_to_hcd(ehci)->self.sysdev, in ehci_mem_init()
183 if (!ehci->sitd_pool) { in ehci_mem_init()
188 ehci->periodic = (__le32 *) in ehci_mem_init()
189 dma_alloc_coherent(ehci_to_hcd(ehci)->self.sysdev, in ehci_mem_init()
190 ehci->periodic_size * sizeof(__le32), in ehci_mem_init()
191 &ehci->periodic_dma, flags); in ehci_mem_init()
192 if (ehci->periodic == NULL) { in ehci_mem_init()
196 if (ehci->use_dummy_qh) { in ehci_mem_init()
198 ehci->dummy = ehci_qh_alloc(ehci, flags); in ehci_mem_init()
199 if (!ehci->dummy) in ehci_mem_init()
202 hw = ehci->dummy->hw; in ehci_mem_init()
203 hw->hw_next = EHCI_LIST_END(ehci); in ehci_mem_init()
204 hw->hw_qtd_next = EHCI_LIST_END(ehci); in ehci_mem_init()
205 hw->hw_alt_next = EHCI_LIST_END(ehci); in ehci_mem_init()
206 ehci->dummy->hw = hw; in ehci_mem_init()
208 for (i = 0; i < ehci->periodic_size; i++) in ehci_mem_init()
209 ehci->periodic[i] = cpu_to_hc32(ehci, in ehci_mem_init()
210 ehci->dummy->qh_dma); in ehci_mem_init()
212 for (i = 0; i < ehci->periodic_size; i++) in ehci_mem_init()
213 ehci->periodic[i] = EHCI_LIST_END(ehci); in ehci_mem_init()
217 ehci->pshadow = kcalloc(ehci->periodic_size, sizeof(void *), flags); in ehci_mem_init()
218 if (ehci->pshadow != NULL) in ehci_mem_init()
222 ehci_dbg (ehci, "couldn't init memory\n"); in ehci_mem_init()
223 ehci_mem_cleanup (ehci); in ehci_mem_init()