dmap 334 fs/jfs/jfs_dmap.c struct dmap *dp; dmap 370 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 425 fs/jfs/jfs_dmap.c struct dmap *dp; dmap 465 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 701 fs/jfs/jfs_dmap.c struct dmap *dp; dmap 780 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 892 fs/jfs/jfs_dmap.c struct dmap *dp; dmap 923 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 1026 fs/jfs/jfs_dmap.c struct dmap *dp; dmap 1081 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 1743 fs/jfs/jfs_dmap.c struct dmap *dp; dmap 1754 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 1783 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 1840 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 3106 fs/jfs/jfs_dmap.c struct dmap *dp; dmap 3134 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 3291 fs/jfs/jfs_dmap.c struct dmap *dp; dmap 3468 fs/jfs/jfs_dmap.c dp = (struct dmap *) mp->data; dmap 76 fs/ocfs2/dlm/dlmdomain.c memset(dmap, 0, ((sz + 7) >> 3)); dmap 79 fs/ocfs2/dlm/dlmdomain.c byte_set_bit(nn, dmap); dmap 139 sound/oss/audio.c struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; dmap 141 sound/oss/audio.c if (dmap->fragment_size <= 0) dmap 143 sound/oss/audio.c dmap->flags |= DMA_POST; dmap 147 sound/oss/audio.c if ((l = dmap->user_counter % dmap->fragment_size) > 0) dmap 150 sound/oss/audio.c unsigned long offs = dmap->user_counter % dmap->bytes_in_use; dmap 152 sound/oss/audio.c len = dmap->fragment_size - l; dmap 153 sound/oss/audio.c memset(dmap->raw_buf + offs, dmap->neutral_byte, len); dmap 161 sound/oss/audio.c p = dmap->qtail; dmap 162 sound/oss/audio.c dmap->flags |= DMA_POST; dmap 164 sound/oss/audio.c for (i = dmap->qlen + 1; i < dmap->nbufs; i++) dmap 166 sound/oss/audio.c p = (p + 1) % dmap->nbufs; dmap 167 sound/oss/audio.c if (((dmap->raw_buf + p * dmap->fragment_size) + dmap->fragment_size) > dmap 168 sound/oss/audio.c (dmap->raw_buf + dmap->buffsize)) dmap 171 sound/oss/audio.c memset(dmap->raw_buf + p * dmap->fragment_size, dmap 172 sound/oss/audio.c dmap->neutral_byte, dmap 173 sound/oss/audio.c dmap->fragment_size); dmap 176 sound/oss/audio.c dmap->flags |= DMA_DIRTY; dmap 372 sound/oss/audio.c struct dma_buffparms *dmap; dmap 499 sound/oss/audio.c dmap = audio_devs[dev]->dmap_out; dmap 502 sound/oss/audio.c if (!(dmap->flags & DMA_ALLOC_DONE)) dmap 508 sound/oss/audio.c spin_lock_irqsave(&dmap->lock,flags); dmap 510 sound/oss/audio.c count = DMAbuf_get_buffer_pointer (dev, dmap, DMODE_OUTPUT); dmap 511 sound/oss/audio.c if (count < dmap->fragment_size && dmap->qhead != 0) dmap 512 sound/oss/audio.c count += dmap->bytes_in_use; /* Pointer wrap not handled yet */ dmap 513 sound/oss/audio.c count += dmap->byte_counter; dmap 516 sound/oss/audio.c count = dmap->user_counter - count; dmap 519 sound/oss/audio.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 552 sound/oss/audio.c dmap->neutral_byte = NEUTRAL8; dmap 554 sound/oss/audio.c dmap->neutral_byte = NEUTRAL16; dmap 567 sound/oss/audio.c dmap->data_rate = sz; dmap 569 sound/oss/audio.c if (!dmap->needs_reorg) dmap 571 sound/oss/audio.c dmap->needs_reorg = 0; dmap 573 sound/oss/audio.c if (dmap->fragment_size == 0) dmap 583 sound/oss/audio.c bsz = dmap->buffsize; dmap 587 sound/oss/audio.c if (bsz == dmap->buffsize) dmap 596 sound/oss/audio.c if (dmap->subdivision == 0) /* Not already set */ dmap 598 sound/oss/audio.c dmap->subdivision = 4; /* Init to the default value */ dmap 600 sound/oss/audio.c if ((bsz / dmap->subdivision) > 4096) dmap 601 sound/oss/audio.c dmap->subdivision *= 2; dmap 602 sound/oss/audio.c if ((bsz / dmap->subdivision) < 4096) dmap 603 sound/oss/audio.c dmap->subdivision = 1; dmap 605 sound/oss/audio.c bsz /= dmap->subdivision; dmap 610 sound/oss/audio.c dmap->fragment_size = bsz; dmap 618 sound/oss/audio.c if (dmap->fragment_size > (dmap->buffsize / 2)) dmap 619 sound/oss/audio.c dmap->fragment_size = (dmap->buffsize / 2); dmap 620 sound/oss/audio.c bsz = dmap->fragment_size; dmap 634 sound/oss/audio.c n = dmap->buffsize / bsz; dmap 637 sound/oss/audio.c if (n > dmap->max_fragments) dmap 638 sound/oss/audio.c n = dmap->max_fragments; dmap 645 sound/oss/audio.c dmap->nbufs = n; dmap 646 sound/oss/audio.c dmap->bytes_in_use = n * bsz; dmap 647 sound/oss/audio.c dmap->fragment_size = bsz; dmap 648 sound/oss/audio.c dmap->max_byte_counter = (dmap->data_rate * 60 * 60) + dmap 649 sound/oss/audio.c dmap->bytes_in_use; /* Approximately one hour */ dmap 651 sound/oss/audio.c if (dmap->raw_buf) dmap 653 sound/oss/audio.c memset(dmap->raw_buf, dmap->neutral_byte, dmap->bytes_in_use); dmap 656 sound/oss/audio.c for (i = 0; i < dmap->nbufs; i++) dmap 658 sound/oss/audio.c dmap->counts[i] = 0; dmap 661 sound/oss/audio.c dmap->flags |= DMA_ALLOC_DONE | DMA_EMPTY; dmap 668 sound/oss/audio.c fact = dmap->subdivision; dmap 673 sound/oss/audio.c if (dmap->subdivision != 0 || dmap->fragment_size) /* Too late to change */ dmap 682 sound/oss/audio.c dmap->subdivision = fact; dmap 693 sound/oss/audio.c if (dmap->subdivision != 0 || dmap 694 sound/oss/audio.c dmap->fragment_size) /* Too late to change */ dmap 724 sound/oss/audio.c dmap->fragment_size = (1 << bytes); dmap 725 sound/oss/audio.c dmap->max_fragments = count; dmap 727 sound/oss/audio.c if (dmap->fragment_size > dmap->buffsize) dmap 728 sound/oss/audio.c dmap->fragment_size = dmap->buffsize; dmap 730 sound/oss/audio.c if (dmap->fragment_size == dmap->buffsize && dmap 732 sound/oss/audio.c dmap->fragment_size /= 2; /* Needs at least 2 buffers */ dmap 734 sound/oss/audio.c dmap->subdivision = 1; /* Disable SNDCTL_DSP_SUBDIVIDE */ dmap 742 sound/oss/audio.c struct dma_buffparms *dmap; dmap 768 sound/oss/audio.c dmap = dmap_out; dmap 774 sound/oss/audio.c dmap = dmap_in; dmap 775 sound/oss/audio.c if (dmap->mapping_flags & DMA_MAP_MAPPED) dmap 777 sound/oss/audio.c if (!(dmap->flags & DMA_ALLOC_DONE)) dmap 778 sound/oss/audio.c reorganize_buffers(dev, dmap, (cmd == SNDCTL_DSP_GETISPACE)); dmap 779 sound/oss/audio.c info.fragstotal = dmap->nbufs; dmap 781 sound/oss/audio.c info.fragments = dmap->qlen; dmap 802 sound/oss/audio.c else if (info.fragments > dmap->nbufs) dmap 803 sound/oss/audio.c info.fragments = dmap->nbufs; dmap 805 sound/oss/audio.c info.fragsize = dmap->fragment_size; dmap 806 sound/oss/audio.c info.bytes = info.fragments * dmap->fragment_size; dmap 808 sound/oss/audio.c if (cmd == SNDCTL_DSP_GETISPACE && dmap->qlen) dmap 809 sound/oss/audio.c info.bytes -= dmap->counts[dmap->qhead]; dmap 812 sound/oss/audio.c info.fragments = info.bytes / dmap->fragment_size; dmap 813 sound/oss/audio.c info.bytes -= dmap->user_counter % dmap->fragment_size; dmap 947 sound/oss/audio.c dmap = dmap_out; dmap 955 sound/oss/audio.c dmap = dmap_in; dmap 956 sound/oss/audio.c ret = dmap->fragment_size; dmap 48 sound/oss/dmabuf.c tmout = (dmap->fragment_size * HZ) / dmap->data_rate; dmap 64 sound/oss/dmabuf.c dmap->mapping_flags &= ~DMA_MAP_MAPPED; dmap 66 sound/oss/dmabuf.c if (dmap->raw_buf != NULL) dmap 70 sound/oss/dmabuf.c dma_pagesize = (dmap->dma < 4) ? (64 * 1024) : (128 * 1024); dmap 79 sound/oss/dmabuf.c dmap->raw_buf = NULL; dmap 80 sound/oss/dmabuf.c dmap->buffsize = dma_buffsize; dmap 81 sound/oss/dmabuf.c if (dmap->buffsize > dma_pagesize) dmap 82 sound/oss/dmabuf.c dmap->buffsize = dma_pagesize; dmap 89 sound/oss/dmabuf.c while (start_addr == NULL && dmap->buffsize > PAGE_SIZE) { dmap 90 sound/oss/dmabuf.c for (sz = 0, size = PAGE_SIZE; size < dmap->buffsize; sz++, size <<= 1); dmap 91 sound/oss/dmabuf.c dmap->buffsize = PAGE_SIZE * (1 << sz); dmap 94 sound/oss/dmabuf.c dmap->buffsize /= 2; dmap 102 sound/oss/dmabuf.c end_addr = start_addr + dmap->buffsize - 1; dmap 111 sound/oss/dmabuf.c printk(KERN_ERR "sound: Got invalid address 0x%lx for %db DMA-buffer\n", (long) start_addr, dmap->buffsize); dmap 115 sound/oss/dmabuf.c dmap->raw_buf = start_addr; dmap 116 sound/oss/dmabuf.c dmap->raw_buf_phys = virt_to_bus(start_addr); dmap 129 sound/oss/dmabuf.c if (dmap->raw_buf == NULL) dmap 131 sound/oss/dmabuf.c if (dmap->mapping_flags & DMA_MAP_MAPPED) dmap 133 sound/oss/dmabuf.c for (sz = 0, size = PAGE_SIZE; size < dmap->buffsize; sz++, size <<= 1); dmap 135 sound/oss/dmabuf.c start_addr = (unsigned long) dmap->raw_buf; dmap 136 sound/oss/dmabuf.c end_addr = start_addr + dmap->buffsize; dmap 141 sound/oss/dmabuf.c free_pages((unsigned long) dmap->raw_buf, sz); dmap 142 sound/oss/dmabuf.c dmap->raw_buf = NULL; dmap 151 sound/oss/dmabuf.c int chan = dmap->dma; dmap 169 sound/oss/dmabuf.c dmap->qlen = dmap->qhead = dmap->qtail = dmap->user_counter = 0; dmap 170 sound/oss/dmabuf.c dmap->byte_counter = 0; dmap 171 sound/oss/dmabuf.c dmap->max_byte_counter = 8000 * 60 * 60; dmap 172 sound/oss/dmabuf.c dmap->bytes_in_use = dmap->buffsize; dmap 174 sound/oss/dmabuf.c dmap->dma_mode = DMODE_NONE; dmap 175 sound/oss/dmabuf.c dmap->mapping_flags = 0; dmap 176 sound/oss/dmabuf.c dmap->neutral_byte = 0x80; dmap 177 sound/oss/dmabuf.c dmap->data_rate = 8000; dmap 178 sound/oss/dmabuf.c dmap->cfrag = -1; dmap 179 sound/oss/dmabuf.c dmap->closing = 0; dmap 180 sound/oss/dmabuf.c dmap->nbufs = 1; dmap 181 sound/oss/dmabuf.c dmap->flags = DMA_BUSY; /* Other flags off */ dmap 188 sound/oss/dmabuf.c if (dmap->flags & DMA_BUSY) dmap 190 sound/oss/dmabuf.c if ((err = sound_alloc_dmap(dmap)) < 0) dmap 193 sound/oss/dmabuf.c if (dmap->raw_buf == NULL) { dmap 197 sound/oss/dmabuf.c if (dmap->dma >= 0 && sound_open_dma(dmap->dma, adev->name)) { dmap 198 sound/oss/dmabuf.c printk(KERN_WARNING "Unable to grab(2) DMA%d for the audio driver\n", dmap->dma); dmap 201 sound/oss/dmabuf.c dma_init_buffers(dmap); dmap 202 sound/oss/dmabuf.c spin_lock_init(&dmap->lock); dmap 203 sound/oss/dmabuf.c dmap->open_mode = mode; dmap 204 sound/oss/dmabuf.c dmap->subdivision = dmap->underrun_count = 0; dmap 205 sound/oss/dmabuf.c dmap->fragment_size = 0; dmap 206 sound/oss/dmabuf.c dmap->max_fragments = 65536; /* Just a large value */ dmap 207 sound/oss/dmabuf.c dmap->byte_counter = 0; dmap 208 sound/oss/dmabuf.c dmap->max_byte_counter = 8000 * 60 * 60; dmap 209 sound/oss/dmabuf.c dmap->applic_profile = APF_NORMAL; dmap 210 sound/oss/dmabuf.c dmap->needs_reorg = 1; dmap 211 sound/oss/dmabuf.c dmap->audio_callback = NULL; dmap 212 sound/oss/dmabuf.c dmap->callback_parm = 0; dmap 220 sound/oss/dmabuf.c if (dmap->dma >= 0) { dmap 221 sound/oss/dmabuf.c sound_close_dma(dmap->dma); dmap 223 sound/oss/dmabuf.c disable_dma(dmap->dma); dmap 226 sound/oss/dmabuf.c if (dmap->flags & DMA_BUSY) dmap 227 sound/oss/dmabuf.c dmap->dma_mode = DMODE_NONE; dmap 228 sound/oss/dmabuf.c dmap->flags &= ~DMA_BUSY; dmap 231 sound/oss/dmabuf.c sound_free_dmap(dmap); dmap 337 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 339 sound/oss/dmabuf.c if (!(dmap->flags & DMA_STARTED)) /* DMA is not active */ dmap 345 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 351 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 353 sound/oss/dmabuf.c dmabuf_timeout(dmap)); dmap 354 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 368 sound/oss/dmabuf.c clear_dma_ff(dmap->dma); dmap 369 sound/oss/dmabuf.c disable_dma(dmap->dma); dmap 372 sound/oss/dmabuf.c dmap->byte_counter = 0; dmap 374 sound/oss/dmabuf.c dmap->qlen = dmap->qhead = dmap->qtail = dmap->user_counter = 0; dmap 375 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 382 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_in; dmap 384 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 391 sound/oss/dmabuf.c dmap->qlen = dmap->qhead = dmap->qtail = dmap->user_counter = 0; dmap 392 sound/oss/dmabuf.c dmap->byte_counter = 0; dmap 394 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 403 sound/oss/dmabuf.c dmap->dma_mode = DMODE_OUTPUT; dmap 405 sound/oss/dmabuf.c if (!(dmap->flags & DMA_ACTIVE) || !(adev->flags & DMA_AUTOMODE) || (dmap->flags & DMA_NODMA)) { dmap 406 sound/oss/dmabuf.c if (!(dmap->flags & DMA_STARTED)) { dmap 407 sound/oss/dmabuf.c reorganize_buffers(dev, dmap, 0); dmap 408 sound/oss/dmabuf.c if (adev->d->prepare_for_output(dev, dmap->fragment_size, dmap->nbufs)) dmap 410 sound/oss/dmabuf.c if (!(dmap->flags & DMA_NODMA)) dmap 411 sound/oss/dmabuf.c local_start_dma(adev, dmap->raw_buf_phys, dmap->bytes_in_use,DMA_MODE_WRITE); dmap 412 sound/oss/dmabuf.c dmap->flags |= DMA_STARTED; dmap 414 sound/oss/dmabuf.c if (dmap->counts[dmap->qhead] == 0) dmap 415 sound/oss/dmabuf.c dmap->counts[dmap->qhead] = dmap->fragment_size; dmap 416 sound/oss/dmabuf.c dmap->dma_mode = DMODE_OUTPUT; dmap 417 sound/oss/dmabuf.c adev->d->output_block(dev, dmap->raw_buf_phys + dmap->qhead * dmap->fragment_size, dmap 418 sound/oss/dmabuf.c dmap->counts[dmap->qhead], 1); dmap 422 sound/oss/dmabuf.c dmap->flags |= DMA_ACTIVE; dmap 430 sound/oss/dmabuf.c struct dma_buffparms *dmap; dmap 436 sound/oss/dmabuf.c dmap = adev->dmap_out; dmap 437 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 438 sound/oss/dmabuf.c if (dmap->qlen > 0 && !(dmap->flags & DMA_ACTIVE)) dmap 439 sound/oss/dmabuf.c DMAbuf_launch_output(dev, dmap); dmap 444 sound/oss/dmabuf.c long t = dmabuf_timeout(dmap); dmap 445 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 448 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 451 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 466 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 468 sound/oss/dmabuf.c dmabuf_timeout(dmap)); dmap 469 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 472 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 481 sound/oss/dmabuf.c struct dma_buffparms *dmap; dmap 484 sound/oss/dmabuf.c dmap = adev->dmap_out; dmap 490 sound/oss/dmabuf.c dmap = adev->dmap_in; dmap 500 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 511 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 524 sound/oss/dmabuf.c if (dmap->dma_mode == DMODE_OUTPUT) { /* Direction change */ dmap 526 sound/oss/dmabuf.c spin_unlock_irq(&dmap->lock); dmap 529 sound/oss/dmabuf.c spin_lock_irq(&dmap->lock); dmap 530 sound/oss/dmabuf.c dmap->dma_mode = DMODE_NONE; dmap 532 sound/oss/dmabuf.c if (!dmap->dma_mode) { dmap 533 sound/oss/dmabuf.c reorganize_buffers(dev, dmap, 1); dmap 535 sound/oss/dmabuf.c dmap->fragment_size, dmap->nbufs)) < 0) dmap 537 sound/oss/dmabuf.c dmap->dma_mode = DMODE_INPUT; dmap 539 sound/oss/dmabuf.c if (!(dmap->flags & DMA_ACTIVE)) { dmap 540 sound/oss/dmabuf.c if (dmap->needs_reorg) dmap 541 sound/oss/dmabuf.c reorganize_buffers(dev, dmap, 0); dmap 542 sound/oss/dmabuf.c local_start_dma(adev, dmap->raw_buf_phys, dmap->bytes_in_use, DMA_MODE_READ); dmap 543 sound/oss/dmabuf.c adev->d->start_input(dev, dmap->raw_buf_phys + dmap->qtail * dmap->fragment_size, dmap 544 sound/oss/dmabuf.c dmap->fragment_size, 0); dmap 545 sound/oss/dmabuf.c dmap->flags |= DMA_ACTIVE; dmap 557 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_in; dmap 562 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 563 sound/oss/dmabuf.c if (dmap->needs_reorg) dmap 564 sound/oss/dmabuf.c reorganize_buffers(dev, dmap, 0); dmap 567 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 569 sound/oss/dmabuf.c } else while (dmap->qlen <= 0 && n++ < 10) { dmap 572 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 575 sound/oss/dmabuf.c if ((err = DMAbuf_activate_recording(dev, dmap)) < 0) { dmap 576 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 582 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 586 sound/oss/dmabuf.c timeout = dmabuf_timeout(dmap); dmap 588 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 598 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 600 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 602 sound/oss/dmabuf.c if (dmap->qlen <= 0) dmap 604 sound/oss/dmabuf.c *buf = &dmap->raw_buf[dmap->qhead * dmap->fragment_size + dmap->counts[dmap->qhead]]; dmap 605 sound/oss/dmabuf.c *len = dmap->fragment_size - dmap->counts[dmap->qhead]; dmap 607 sound/oss/dmabuf.c return dmap->qhead; dmap 613 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_in; dmap 614 sound/oss/dmabuf.c int p = dmap->counts[dmap->qhead] + c; dmap 616 sound/oss/dmabuf.c if (dmap->mapping_flags & DMA_MAP_MAPPED) dmap 621 sound/oss/dmabuf.c else if (dmap->qlen <= 0) dmap 623 sound/oss/dmabuf.c else if (p >= dmap->fragment_size) { /* This buffer is completely empty */ dmap 624 sound/oss/dmabuf.c dmap->counts[dmap->qhead] = 0; dmap 625 sound/oss/dmabuf.c dmap->qlen--; dmap 626 sound/oss/dmabuf.c dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; dmap 628 sound/oss/dmabuf.c else dmap->counts[dmap->qhead] = p; dmap 643 sound/oss/dmabuf.c if (!(dmap->flags & DMA_ACTIVE)) dmap 646 sound/oss/dmabuf.c int chan = dmap->dma; dmap 652 sound/oss/dmabuf.c disable_dma(dmap->dma); dmap 656 sound/oss/dmabuf.c pos = dmap->bytes_in_use - pos; dmap 658 sound/oss/dmabuf.c if (!(dmap->mapping_flags & DMA_MAP_MAPPED)) { dmap 660 sound/oss/dmabuf.c if (dmap->qhead == 0) dmap 661 sound/oss/dmabuf.c if (pos > dmap->fragment_size) dmap 664 sound/oss/dmabuf.c if (dmap->qtail == 0) dmap 665 sound/oss/dmabuf.c if (pos > dmap->fragment_size) dmap 671 sound/oss/dmabuf.c if (pos >= dmap->bytes_in_use) dmap 675 sound/oss/dmabuf.c enable_dma(dmap->dma); dmap 714 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 715 sound/oss/dmabuf.c int lim = dmap->nbufs; dmap 720 sound/oss/dmabuf.c if (dmap->qlen >= lim) /* No space at all */ dmap 728 sound/oss/dmabuf.c max = dmap->max_fragments; dmap 731 sound/oss/dmabuf.c len = dmap->qlen; dmap 739 sound/oss/dmabuf.c if (dmap->byte_counter % dmap->fragment_size) /* There is a partial fragment */ dmap 751 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 765 sound/oss/dmabuf.c timeout = (adev->go && !(dmap->flags & DMA_NOTIMEOUT)); dmap 767 sound/oss/dmabuf.c timeout_value = dmabuf_timeout(dmap); dmap 785 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 789 sound/oss/dmabuf.c int occupied_bytes = (dmap->user_counter % dmap->fragment_size); dmap 791 sound/oss/dmabuf.c *buf = dmap->raw_buf; dmap 796 sound/oss/dmabuf.c active_offs = dmap->byte_counter + dmap->qhead * dmap->fragment_size; dmap 798 sound/oss/dmabuf.c active_offs = max(DMAbuf_get_buffer_pointer(dev, dmap, DMODE_OUTPUT), 0); dmap 800 sound/oss/dmabuf.c if (active_offs >= dmap->bytes_in_use) dmap 802 sound/oss/dmabuf.c active_offs += dmap->byte_counter; dmap 805 sound/oss/dmabuf.c offs = (dmap->user_counter % dmap->bytes_in_use) & ~SAMPLE_ROUNDUP; dmap 806 sound/oss/dmabuf.c if (offs < 0 || offs >= dmap->bytes_in_use) { dmap 808 sound/oss/dmabuf.c printk("Counter = %ld, bytes=%d\n", dmap->user_counter, dmap->bytes_in_use); dmap 811 sound/oss/dmabuf.c *buf = dmap->raw_buf + offs; dmap 813 sound/oss/dmabuf.c len = active_offs + dmap->bytes_in_use - dmap->user_counter; /* Number of unused bytes in buffer */ dmap 815 sound/oss/dmabuf.c if ((offs + len) > dmap->bytes_in_use) dmap 816 sound/oss/dmabuf.c len = dmap->bytes_in_use - offs; dmap 820 sound/oss/dmabuf.c if (len > ((maxfrags * dmap->fragment_size) - occupied_bytes)) dmap 821 sound/oss/dmabuf.c len = (maxfrags * dmap->fragment_size) - occupied_bytes; dmap 831 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 833 sound/oss/dmabuf.c if (dmap->mapping_flags & DMA_MAP_MAPPED) { dmap 837 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 838 sound/oss/dmabuf.c if (dmap->needs_reorg) dmap 839 sound/oss/dmabuf.c reorganize_buffers(dev, dmap, 0); dmap 841 sound/oss/dmabuf.c if (dmap->dma_mode == DMODE_INPUT) { /* Direction change */ dmap 842 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 844 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 846 sound/oss/dmabuf.c dmap->dma_mode = DMODE_OUTPUT; dmap 849 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 853 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 856 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 863 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 869 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 870 sound/oss/dmabuf.c post= (dmap->flags & DMA_POST); dmap 871 sound/oss/dmabuf.c ptr = (dmap->user_counter / dmap->fragment_size) * dmap->fragment_size; dmap 873 sound/oss/dmabuf.c dmap->flags &= ~DMA_POST; dmap 874 sound/oss/dmabuf.c dmap->cfrag = -1; dmap 875 sound/oss/dmabuf.c dmap->user_counter += l; dmap 876 sound/oss/dmabuf.c dmap->flags |= DMA_DIRTY; dmap 878 sound/oss/dmabuf.c if (dmap->byte_counter >= dmap->max_byte_counter) { dmap 880 sound/oss/dmabuf.c long decr = dmap->byte_counter; dmap 881 sound/oss/dmabuf.c dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use); dmap 882 sound/oss/dmabuf.c decr -= dmap->byte_counter; dmap 883 sound/oss/dmabuf.c dmap->user_counter -= decr; dmap 885 sound/oss/dmabuf.c end_ptr = (dmap->user_counter / dmap->fragment_size) * dmap->fragment_size; dmap 887 sound/oss/dmabuf.c p = (dmap->user_counter - 1) % dmap->bytes_in_use; dmap 888 sound/oss/dmabuf.c dmap->neutral_byte = dmap->raw_buf[p]; dmap 892 sound/oss/dmabuf.c dmap->counts[dmap->qtail] = dmap->fragment_size; dmap 893 sound/oss/dmabuf.c dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; dmap 894 sound/oss/dmabuf.c dmap->qlen++; dmap 895 sound/oss/dmabuf.c ptr += dmap->fragment_size; dmap 898 sound/oss/dmabuf.c dmap->counts[dmap->qtail] = dmap->user_counter - ptr; dmap 907 sound/oss/dmabuf.c if (!(dmap->flags & DMA_ACTIVE)) dmap 908 sound/oss/dmabuf.c if (dmap->qlen > 1 || (dmap->qlen > 0 && (post || dmap->qlen >= dmap->nbufs - 1))) dmap 909 sound/oss/dmabuf.c DMAbuf_launch_output(dev, dmap); dmap 911 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 918 sound/oss/dmabuf.c struct dma_buffparms *dmap = (dma_mode == DMA_MODE_WRITE) ? adev->dmap_out : adev->dmap_in; dmap 920 sound/oss/dmabuf.c if (dmap->raw_buf == NULL) { dmap 922 sound/oss/dmabuf.c printk("Device %d, chn=%s\n", dev, (dmap == adev->dmap_out) ? "out" : "in"); dmap 925 sound/oss/dmabuf.c if (dmap->dma < 0) dmap 927 sound/oss/dmabuf.c sound_start_dma(dmap, physaddr, count, dma_mode); dmap 934 sound/oss/dmabuf.c struct dma_buffparms *dmap = (dma_mode == DMA_MODE_WRITE) ? adev->dmap_out : adev->dmap_in; dmap 936 sound/oss/dmabuf.c if (dmap->raw_buf == NULL) { dmap 938 sound/oss/dmabuf.c printk(KERN_ERR "Device %s, chn=%s\n", adev->name, (dmap == adev->dmap_out) ? "out" : "in"); dmap 941 sound/oss/dmabuf.c if (dmap->flags & DMA_NODMA) dmap 943 sound/oss/dmabuf.c if (dmap->dma < 0) dmap 945 sound/oss/dmabuf.c sound_start_dma(dmap, dmap->raw_buf_phys, dmap->bytes_in_use, dma_mode | DMA_AUTOINIT); dmap 946 sound/oss/dmabuf.c dmap->flags |= DMA_STARTED; dmap 954 sound/oss/dmabuf.c if (dmap->audio_callback != NULL) dmap 955 sound/oss/dmabuf.c dmap->audio_callback(dev, dmap->callback_parm); dmap 963 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 966 sound/oss/dmabuf.c if (dmap->raw_buf == NULL) { dmap 970 sound/oss/dmabuf.c if (dmap->mapping_flags & DMA_MAP_MAPPED) { /* Virtual memory mapped access */ dmap 972 sound/oss/dmabuf.c dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; dmap 973 sound/oss/dmabuf.c if (dmap->qhead == 0) { /* Wrapped */ dmap 974 sound/oss/dmabuf.c dmap->byte_counter += dmap->bytes_in_use; dmap 975 sound/oss/dmabuf.c if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */ dmap 976 sound/oss/dmabuf.c long decr = dmap->byte_counter; dmap 977 sound/oss/dmabuf.c dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use); dmap 978 sound/oss/dmabuf.c decr -= dmap->byte_counter; dmap 979 sound/oss/dmabuf.c dmap->user_counter -= decr; dmap 982 sound/oss/dmabuf.c dmap->qlen++; /* Yes increment it (don't decrement) */ dmap 984 sound/oss/dmabuf.c dmap->flags &= ~DMA_ACTIVE; dmap 985 sound/oss/dmabuf.c dmap->counts[dmap->qhead] = dmap->fragment_size; dmap 986 sound/oss/dmabuf.c DMAbuf_launch_output(dev, dmap); dmap 987 sound/oss/dmabuf.c finish_output_interrupt(dev, dmap); dmap 991 sound/oss/dmabuf.c dmap->qlen--; dmap 992 sound/oss/dmabuf.c this_fragment = dmap->qhead; dmap 993 sound/oss/dmabuf.c dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; dmap 995 sound/oss/dmabuf.c if (dmap->qhead == 0) { /* Wrapped */ dmap 996 sound/oss/dmabuf.c dmap->byte_counter += dmap->bytes_in_use; dmap 997 sound/oss/dmabuf.c if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */ dmap 998 sound/oss/dmabuf.c long decr = dmap->byte_counter; dmap 999 sound/oss/dmabuf.c dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use); dmap 1000 sound/oss/dmabuf.c decr -= dmap->byte_counter; dmap 1001 sound/oss/dmabuf.c dmap->user_counter -= decr; dmap 1005 sound/oss/dmabuf.c dmap->flags &= ~DMA_ACTIVE; dmap 1012 sound/oss/dmabuf.c while (dmap->qlen <= -dmap->closing) { dmap 1013 sound/oss/dmabuf.c dmap->underrun_count++; dmap 1014 sound/oss/dmabuf.c dmap->qlen++; dmap 1015 sound/oss/dmabuf.c if ((dmap->flags & DMA_DIRTY) && dmap->applic_profile != APF_CPUINTENS) { dmap 1016 sound/oss/dmabuf.c dmap->flags &= ~DMA_DIRTY; dmap 1020 sound/oss/dmabuf.c dmap->user_counter += dmap->fragment_size; dmap 1021 sound/oss/dmabuf.c dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; dmap 1023 sound/oss/dmabuf.c if (dmap->qlen > 0) dmap 1024 sound/oss/dmabuf.c DMAbuf_launch_output(dev, dmap); dmap 1025 sound/oss/dmabuf.c finish_output_interrupt(dev, dmap); dmap 1032 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 1034 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 1035 sound/oss/dmabuf.c if (!(dmap->flags & DMA_NODMA)) { dmap 1036 sound/oss/dmabuf.c int chan = dmap->dma, pos, n; dmap 1042 sound/oss/dmabuf.c disable_dma(dmap->dma); dmap 1044 sound/oss/dmabuf.c pos = dmap->bytes_in_use - get_dma_residue(chan); dmap 1046 sound/oss/dmabuf.c enable_dma(dmap->dma); dmap 1049 sound/oss/dmabuf.c pos = pos / dmap->fragment_size; /* Actual qhead */ dmap 1050 sound/oss/dmabuf.c if (pos < 0 || pos >= dmap->nbufs) dmap 1053 sound/oss/dmabuf.c while (dmap->qhead != pos && n++ < dmap->nbufs) dmap 1058 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 1066 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_in; dmap 1068 sound/oss/dmabuf.c if (dmap->raw_buf == NULL) { dmap 1072 sound/oss/dmabuf.c if (dmap->mapping_flags & DMA_MAP_MAPPED) { dmap 1073 sound/oss/dmabuf.c dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; dmap 1074 sound/oss/dmabuf.c if (dmap->qtail == 0) { /* Wrapped */ dmap 1075 sound/oss/dmabuf.c dmap->byte_counter += dmap->bytes_in_use; dmap 1076 sound/oss/dmabuf.c if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */ dmap 1077 sound/oss/dmabuf.c long decr = dmap->byte_counter; dmap 1078 sound/oss/dmabuf.c dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use) + dmap->bytes_in_use; dmap 1079 sound/oss/dmabuf.c decr -= dmap->byte_counter; dmap 1080 sound/oss/dmabuf.c dmap->user_counter -= decr; dmap 1083 sound/oss/dmabuf.c dmap->qlen++; dmap 1086 sound/oss/dmabuf.c if (dmap->needs_reorg) dmap 1087 sound/oss/dmabuf.c reorganize_buffers(dev, dmap, 0); dmap 1088 sound/oss/dmabuf.c local_start_dma(adev, dmap->raw_buf_phys, dmap->bytes_in_use,DMA_MODE_READ); dmap 1089 sound/oss/dmabuf.c adev->d->start_input(dev, dmap->raw_buf_phys + dmap->qtail * dmap->fragment_size, dmap 1090 sound/oss/dmabuf.c dmap->fragment_size, 1); dmap 1094 sound/oss/dmabuf.c dmap->flags |= DMA_ACTIVE; dmap 1095 sound/oss/dmabuf.c } else if (dmap->qlen >= (dmap->nbufs - 1)) { dmap 1097 sound/oss/dmabuf.c dmap->underrun_count++; dmap 1100 sound/oss/dmabuf.c dmap->qhead = (dmap->qhead + 1) % dmap->nbufs; dmap 1101 sound/oss/dmabuf.c dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; dmap 1102 sound/oss/dmabuf.c } else if (dmap->qlen >= 0 && dmap->qlen < dmap->nbufs) { dmap 1103 sound/oss/dmabuf.c dmap->qlen++; dmap 1104 sound/oss/dmabuf.c dmap->qtail = (dmap->qtail + 1) % dmap->nbufs; dmap 1105 sound/oss/dmabuf.c if (dmap->qtail == 0) { /* Wrapped */ dmap 1106 sound/oss/dmabuf.c dmap->byte_counter += dmap->bytes_in_use; dmap 1107 sound/oss/dmabuf.c if (dmap->byte_counter >= dmap->max_byte_counter) { /* Overflow */ dmap 1108 sound/oss/dmabuf.c long decr = dmap->byte_counter; dmap 1109 sound/oss/dmabuf.c dmap->byte_counter = (dmap->byte_counter % dmap->bytes_in_use) + dmap->bytes_in_use; dmap 1110 sound/oss/dmabuf.c decr -= dmap->byte_counter; dmap 1111 sound/oss/dmabuf.c dmap->user_counter -= decr; dmap 1115 sound/oss/dmabuf.c if (!(adev->flags & DMA_AUTOMODE) || (dmap->flags & DMA_NODMA)) { dmap 1116 sound/oss/dmabuf.c local_start_dma(adev, dmap->raw_buf_phys, dmap->bytes_in_use, DMA_MODE_READ); dmap 1117 sound/oss/dmabuf.c adev->d->start_input(dev, dmap->raw_buf_phys + dmap->qtail * dmap->fragment_size, dmap->fragment_size, 1); dmap 1121 sound/oss/dmabuf.c dmap->flags |= DMA_ACTIVE; dmap 1122 sound/oss/dmabuf.c if (dmap->qlen > 0) dmap 1132 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_in; dmap 1135 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 1137 sound/oss/dmabuf.c if (!(dmap->flags & DMA_NODMA)) { dmap 1138 sound/oss/dmabuf.c int chan = dmap->dma, pos, n; dmap 1143 sound/oss/dmabuf.c disable_dma(dmap->dma); dmap 1145 sound/oss/dmabuf.c pos = dmap->bytes_in_use - get_dma_residue(chan); dmap 1147 sound/oss/dmabuf.c enable_dma(dmap->dma); dmap 1150 sound/oss/dmabuf.c pos = pos / dmap->fragment_size; /* Actual qhead */ dmap 1151 sound/oss/dmabuf.c if (pos < 0 || pos >= dmap->nbufs) dmap 1155 sound/oss/dmabuf.c while (dmap->qtail != pos && ++n < dmap->nbufs) dmap 1159 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 1200 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_in; dmap 1204 sound/oss/dmabuf.c if (dmap->mapping_flags & DMA_MAP_MAPPED) { dmap 1205 sound/oss/dmabuf.c if (dmap->qlen) dmap 1209 sound/oss/dmabuf.c if (dmap->dma_mode != DMODE_INPUT) { dmap 1210 sound/oss/dmabuf.c if (dmap->dma_mode == DMODE_NONE && dmap 1212 sound/oss/dmabuf.c !dmap->qlen && adev->go) { dmap 1215 sound/oss/dmabuf.c spin_lock_irqsave(&dmap->lock,flags); dmap 1216 sound/oss/dmabuf.c DMAbuf_activate_recording(dev, dmap); dmap 1217 sound/oss/dmabuf.c spin_unlock_irqrestore(&dmap->lock,flags); dmap 1221 sound/oss/dmabuf.c if (!dmap->qlen) dmap 1229 sound/oss/dmabuf.c struct dma_buffparms *dmap = adev->dmap_out; dmap 1233 sound/oss/dmabuf.c if (dmap->mapping_flags & DMA_MAP_MAPPED) { dmap 1234 sound/oss/dmabuf.c if (dmap->qlen) dmap 1238 sound/oss/dmabuf.c if (dmap->dma_mode == DMODE_INPUT) dmap 1240 sound/oss/dmabuf.c if (dmap->dma_mode == DMODE_NONE) dmap 422 sound/oss/soundcard.c struct dma_buffparms *dmap = NULL; dmap 434 sound/oss/soundcard.c dmap = audio_devs[dev]->dmap_out; dmap 436 sound/oss/soundcard.c dmap = audio_devs[dev]->dmap_in; dmap 443 sound/oss/soundcard.c if (dmap == NULL) { dmap 448 sound/oss/soundcard.c if (dmap->raw_buf == NULL) { dmap 453 sound/oss/soundcard.c if (dmap->mapping_flags) { dmap 465 sound/oss/soundcard.c if (size != dmap->bytes_in_use) { dmap 466 sound/oss/soundcard.c printk(KERN_WARNING "Sound: mmap() size = %ld. Should be %d\n", size, dmap->bytes_in_use); dmap 469 sound/oss/soundcard.c virt_to_phys(dmap->raw_buf) >> PAGE_SHIFT, dmap 475 sound/oss/soundcard.c dmap->mapping_flags |= DMA_MAP_MAPPED; dmap 480 sound/oss/soundcard.c memset(dmap->raw_buf, dmap 481 sound/oss/soundcard.c dmap->neutral_byte, dmap 482 sound/oss/soundcard.c dmap->bytes_in_use); dmap 307 sound/oss/vidc.c struct dma_buffparms *dmap = audio_devs[dev]->dmap_out; dmap 311 sound/oss/vidc.c dma_start = buf - (unsigned long)dmap->raw_buf_phys + (unsigned long)dmap->raw_buf;