Lines Matching refs:cookie

65 	struct mips_bus_dma_cookie *cookie;
80 cookiesize = sizeof(*cookie);
110 * Allocate our cookie.
118 cookie = (struct mips_bus_dma_cookie *)cookiestore;
119 cookie->id_flags = cookieflags;
120 map->_dm_cookie = cookie;
148 struct mips_bus_dma_cookie *cookie = map->_dm_cookie;
153 if (cookie->id_flags & _BUS_DMA_HAS_BOUNCE)
156 free(cookie, M_DMAMAP);
167 struct mips_bus_dma_cookie *cookie = map->_dm_cookie;
181 if (error == 0 || (cookie->id_flags & _BUS_DMA_MIGHT_NEED_BOUNCE) == 0)
191 if ((cookie->id_flags & _BUS_DMA_HAS_BOUNCE) == 0) {
201 cookie->id_origbuf = buf;
202 cookie->id_origbuflen = buflen;
203 cookie->id_buftype = _BUS_DMA_BUFTYPE_LINEAR;
204 error = _bus_dmamap_load(t, map, cookie->id_bouncebuf, buflen,
217 cookie->id_flags |= _BUS_DMA_IS_BOUNCING;
228 struct mips_bus_dma_cookie *cookie = map->_dm_cookie;
250 if (error == 0 || (cookie->id_flags & _BUS_DMA_MIGHT_NEED_BOUNCE) == 0)
260 if ((cookie->id_flags & _BUS_DMA_HAS_BOUNCE) == 0) {
271 cookie->id_origbuf = m0;
272 cookie->id_origbuflen = m0->m_pkthdr.len; /* not really used */
273 cookie->id_buftype = _BUS_DMA_BUFTYPE_MBUF;
274 error = _bus_dmamap_load(t, map, cookie->id_bouncebuf,
287 cookie->id_flags |= _BUS_DMA_IS_BOUNCING;
320 struct mips_bus_dma_cookie *cookie = map->_dm_cookie;
326 if ((cookie->id_flags & _BUS_DMA_HAS_BOUNCE) &&
330 cookie->id_flags &= ~_BUS_DMA_IS_BOUNCING;
331 cookie->id_buftype = _BUS_DMA_BUFTYPE_INVALID;
346 struct mips_bus_dma_cookie *cookie = map->_dm_cookie;
368 if ((cookie->id_flags & _BUS_DMA_IS_BOUNCING) == 0) {
385 switch (cookie->id_buftype) {
395 memcpy((char *)cookie->id_bouncebuf + offset,
396 (char *)cookie->id_origbuf + offset, len);
404 memcpy((char *)cookie->id_origbuf + offset,
405 (char *)cookie->id_bouncebuf + offset, len);
415 struct mbuf *m, *m0 = cookie->id_origbuf;
427 (char *)cookie->id_bouncebuf + offset);
451 (char *)cookie->id_bouncebuf + offset,
479 printf("unknown buffer type %d\n", cookie->id_buftype);
488 mips_dcache_wbinv_range((vaddr_t)cookie->id_bouncebuf + offset,
519 struct mips_bus_dma_cookie *cookie = map->_dm_cookie;
522 cookie->id_bouncebuflen = round_page(size);
523 error = isadma_bounce_dmamem_alloc(t, cookie->id_bouncebuflen,
524 PAGE_SIZE, map->_dm_boundary, cookie->id_bouncesegs,
525 map->_dm_segcnt, &cookie->id_nbouncesegs, flags);
528 error = _bus_dmamem_map(t, cookie->id_bouncesegs,
529 cookie->id_nbouncesegs, cookie->id_bouncebuflen,
530 (void **)&cookie->id_bouncebuf, flags);
534 _bus_dmamem_free(t, cookie->id_bouncesegs,
535 cookie->id_nbouncesegs);
536 cookie->id_bouncebuflen = 0;
537 cookie->id_nbouncesegs = 0;
539 cookie->id_flags |= _BUS_DMA_HAS_BOUNCE;
547 struct mips_bus_dma_cookie *cookie = map->_dm_cookie;
549 _bus_dmamem_unmap(t, cookie->id_bouncebuf,
550 cookie->id_bouncebuflen);
551 _bus_dmamem_free(t, cookie->id_bouncesegs,
552 cookie->id_nbouncesegs);
553 cookie->id_bouncebuflen = 0;
554 cookie->id_nbouncesegs = 0;
555 cookie->id_flags &= ~_BUS_DMA_HAS_BOUNCE;