Lines Matching refs:cookie
208 struct atari_isa_dma_cookie *cookie;
211 if ((cookie = kmem_zalloc(isadma_bounce_cookiesize(map, cookieflags),
216 cookie->id_flags = cookieflags;
217 map->_dm_cookie = cookie;
225 struct atari_isa_dma_cookie *cookie = map->_dm_cookie;
227 if (cookie != NULL) {
229 isadma_bounce_cookiesize(map, cookie->id_flags));
240 struct atari_isa_dma_cookie *cookie;
254 * Allocate our cookie.
259 cookie = map->_dm_cookie;
261 if (cookie->id_flags & ID_MIGHT_NEED_BOUNCE) {
285 struct atari_isa_dma_cookie *cookie = map->_dm_cookie;
290 if (cookie->id_flags & ID_HAS_BOUNCE)
304 struct atari_isa_dma_cookie *cookie = map->_dm_cookie;
320 if (error == 0 || (cookie->id_flags & ID_MIGHT_NEED_BOUNCE) == 0)
332 if ((cookie->id_flags & ID_HAS_BOUNCE) == 0) {
342 cookie->id_origbuf = buf;
343 cookie->id_origbuflen = buflen;
344 cookie->id_buftype = ID_BUFTYPE_LINEAR;
345 error = _bus_dmamap_load(t, map, cookie->id_bouncebuf, buflen,
358 cookie->id_flags |= ID_IS_BOUNCING;
369 struct atari_isa_dma_cookie *cookie = map->_dm_cookie;
391 if (error == 0 || (cookie->id_flags & ID_MIGHT_NEED_BOUNCE) == 0)
403 if ((cookie->id_flags & ID_HAS_BOUNCE) == 0) {
414 cookie->id_origbuf = m0;
415 cookie->id_origbuflen = m0->m_pkthdr.len; /* not really used */
416 cookie->id_buftype = ID_BUFTYPE_MBUF;
417 error = _bus_dmamap_load(t, map, cookie->id_bouncebuf,
430 cookie->id_flags |= ID_IS_BOUNCING;
461 struct atari_isa_dma_cookie *cookie = map->_dm_cookie;
467 if ((cookie->id_flags & ID_HAS_BOUNCE) &&
471 cookie->id_flags &= ~ID_IS_BOUNCING;
472 cookie->id_buftype = ID_BUFTYPE_INVALID;
486 struct atari_isa_dma_cookie *cookie = map->_dm_cookie;
507 if ((cookie->id_flags & ID_IS_BOUNCING) == 0)
510 switch (cookie->id_buftype) {
520 memcpy((char *)cookie->id_bouncebuf + offset,
521 (char *)cookie->id_origbuf + offset, len);
528 memcpy((char *)cookie->id_origbuf + offset,
529 (char *)cookie->id_bouncebuf + offset, len);
539 struct mbuf *m, *m0 = cookie->id_origbuf;
551 (char *)cookie->id_bouncebuf + offset);
575 (char *)cookie->id_bouncebuf + offset,
603 printf("unknown buffer type %d\n", cookie->id_buftype);
632 struct atari_isa_dma_cookie *cookie = map->_dm_cookie;
635 cookie->id_bouncebuflen = round_page(size);
636 error = _isa_bus_dmamem_alloc(t, cookie->id_bouncebuflen,
637 PAGE_SIZE, map->_dm_boundary, cookie->id_bouncesegs,
638 map->_dm_segcnt, &cookie->id_nbouncesegs, flags);
641 error = bus_dmamem_map(t, cookie->id_bouncesegs,
642 cookie->id_nbouncesegs, cookie->id_bouncebuflen,
643 (void **)&cookie->id_bouncebuf, flags);
647 bus_dmamem_free(t, cookie->id_bouncesegs,
648 cookie->id_nbouncesegs);
649 cookie->id_bouncebuflen = 0;
650 cookie->id_nbouncesegs = 0;
652 cookie->id_flags |= ID_HAS_BOUNCE;
662 struct atari_isa_dma_cookie *cookie = map->_dm_cookie;
666 bus_dmamem_unmap(t, cookie->id_bouncebuf,
667 cookie->id_bouncebuflen);
668 bus_dmamem_free(t, cookie->id_bouncesegs,
669 cookie->id_nbouncesegs);
670 cookie->id_bouncebuflen = 0;
671 cookie->id_nbouncesegs = 0;
672 cookie->id_flags &= ~ID_HAS_BOUNCE;