Lines Matching full:dd

144 	struct ath_descdma *dd, ath_bufhead *head,  in ath_descdma_alloc_desc()  argument
153 dd->dd_descsize = ds_size; in ath_descdma_alloc_desc()
157 __func__, name, ndesc, dd->dd_descsize); in ath_descdma_alloc_desc()
159 dd->dd_name = name; in ath_descdma_alloc_desc()
160 dd->dd_desc_len = dd->dd_descsize * ndesc; in ath_descdma_alloc_desc()
168 int numpages = dd->dd_desc_len / 4096; in ath_descdma_alloc_desc()
169 dd->dd_desc_len += ds_size * numpages; in ath_descdma_alloc_desc()
183 dd->dd_desc_len, /* maxsize */ in ath_descdma_alloc_desc()
185 dd->dd_desc_len, /* maxsegsize */ in ath_descdma_alloc_desc()
189 &dd->dd_dmat); in ath_descdma_alloc_desc()
192 "cannot allocate %s DMA tag\n", dd->dd_name); in ath_descdma_alloc_desc()
197 error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, in ath_descdma_alloc_desc()
199 &dd->dd_dmamap); in ath_descdma_alloc_desc()
203 ndesc, dd->dd_name, error); in ath_descdma_alloc_desc()
207 error = bus_dmamap_load(dd->dd_dmat, dd->dd_dmamap, in ath_descdma_alloc_desc()
208 dd->dd_desc, dd->dd_desc_len, in ath_descdma_alloc_desc()
209 ath_load_cb, &dd->dd_desc_paddr, in ath_descdma_alloc_desc()
214 dd->dd_name, error); in ath_descdma_alloc_desc()
219 __func__, dd->dd_name, (uint8_t *) dd->dd_desc, in ath_descdma_alloc_desc()
220 (u_long) dd->dd_desc_len, (caddr_t) dd->dd_desc_paddr, in ath_descdma_alloc_desc()
221 /*XXX*/ (u_long) dd->dd_desc_len); in ath_descdma_alloc_desc()
226 bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); in ath_descdma_alloc_desc()
228 bus_dma_tag_destroy(dd->dd_dmat); in ath_descdma_alloc_desc()
229 memset(dd, 0, sizeof(*dd)); in ath_descdma_alloc_desc()
237 struct ath_descdma *dd, ath_bufhead *head, in ath_descdma_setup() argument
249 error = ath_descdma_alloc_desc(sc, dd, head, name, ds_size, in ath_descdma_setup()
257 ds = (uint8_t *) dd->dd_desc; in ath_descdma_setup()
265 dd->dd_name, bsize); in ath_descdma_setup()
268 dd->dd_bufptr = bf; in ath_descdma_setup()
271 for (i = 0; i < nbuf; i++, bf++, ds += (ndesc * dd->dd_descsize)) { in ath_descdma_setup()
273 bf->bf_daddr = DS2PHYS(dd, ds); in ath_descdma_setup()
281 dd->dd_descsize)) { in ath_descdma_setup()
285 bf->bf_daddr = DS2PHYS(dd, ds); in ath_descdma_setup()
293 dd->dd_name, i, error); in ath_descdma_setup()
294 ath_descdma_cleanup(sc, dd, head); in ath_descdma_setup()
309 bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); in ath_descdma_setup()
310 bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); in ath_descdma_setup()
311 bus_dma_tag_destroy(dd->dd_dmat); in ath_descdma_setup()
312 memset(dd, 0, sizeof(*dd)); in ath_descdma_setup()
326 struct ath_descdma *dd, ath_bufhead *head, in ath_descdma_setup_rx_edma() argument
335 dd->dd_name = name; in ath_descdma_setup_rx_edma()
344 dd->dd_desc_len = rx_status_len * nbuf; in ath_descdma_setup_rx_edma()
345 dd->dd_descsize = rx_status_len; in ath_descdma_setup_rx_edma()
353 dd->dd_name, bsize); in ath_descdma_setup_rx_edma()
357 dd->dd_bufptr = bf; in ath_descdma_setup_rx_edma()
370 dd->dd_name, i, error); in ath_descdma_setup_rx_edma()
371 ath_descdma_cleanup(sc, dd, head); in ath_descdma_setup_rx_edma()
378 memset(dd, 0, sizeof(*dd)); in ath_descdma_setup_rx_edma()
384 struct ath_descdma *dd, ath_bufhead *head) in ath_descdma_cleanup() argument
390 if (dd->dd_dmamap != 0) { in ath_descdma_cleanup()
391 bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); in ath_descdma_cleanup()
392 bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); in ath_descdma_cleanup()
393 bus_dma_tag_destroy(dd->dd_dmat); in ath_descdma_cleanup()
411 dd->dd_name); in ath_descdma_cleanup()
437 if (dd->dd_bufptr != NULL) in ath_descdma_cleanup()
438 free(dd->dd_bufptr, M_ATHDEV); in ath_descdma_cleanup()
439 memset(dd, 0, sizeof(*dd)); in ath_descdma_cleanup()