taglinefilesource code
dmap488drivers/sound/dev_table.hint sound_alloc_dmap (int dev, struct dma_buffparms *dmap, int chan);
dmap489drivers/sound/dev_table.hvoid sound_free_dmap (int dev, struct dma_buffparms *dmap);
dmap490drivers/sound/dev_table.hextern int soud_map_buffer (int dev, struct dma_buffparms *dmap, buffmem_desc *info);
dmap65drivers/sound/dmabuf.creorganize_buffers (int dev, struct dma_buffparms *dmap)
dmap76drivers/sound/dmabuf.cif (dmap->fragment_size == 0)
dmap84drivers/sound/dmabuf.cdmap->neutral_byte = 0x80;
dmap86drivers/sound/dmabuf.cdmap->neutral_byte = 0x00;
dmap114drivers/sound/dmabuf.cif (dmap->subdivision == 0)  /* Not already set */
dmap115drivers/sound/dmabuf.cdmap->subdivision = 1;  /* Init to default value */
dmap117drivers/sound/dmabuf.cbsz /= dmap->subdivision;
dmap122drivers/sound/dmabuf.cdmap->fragment_size = bsz;
dmap130drivers/sound/dmabuf.cif (dmap->fragment_size > (audio_devs[dev]->buffsize / 2))
dmap131drivers/sound/dmabuf.cdmap->fragment_size = (audio_devs[dev]->buffsize / 2);
dmap132drivers/sound/dmabuf.cbsz = dmap->fragment_size;
dmap140drivers/sound/dmabuf.cif (n > dmap->max_fragments)
dmap141drivers/sound/dmabuf.cn = dmap->max_fragments;
dmap142drivers/sound/dmabuf.cdmap->nbufs = n;
dmap143drivers/sound/dmabuf.cdmap->bytes_in_use = n * bsz;
dmap145drivers/sound/dmabuf.cfor (i = 0; i < dmap->nbufs; i++)
dmap147drivers/sound/dmabuf.cdmap->counts[i] = 0;
dmap150drivers/sound/dmabuf.cdmap->flags |= DMA_ALLOC_DONE;
dmap154drivers/sound/dmabuf.cdma_init_buffers (int dev, struct dma_buffparms *dmap)
dmap156drivers/sound/dmabuf.cif (dmap == audio_devs[dev]->dmap_out)
dmap169drivers/sound/dmabuf.cdmap->flags = DMA_BUSY;  /* Other flags off */
dmap170drivers/sound/dmabuf.cdmap->qlen = dmap->qhead = dmap->qtail = 0;
dmap171drivers/sound/dmabuf.cdmap->nbufs = 1;
dmap172drivers/sound/dmabuf.cdmap->bytes_in_use = audio_devs[dev]->buffsize;
dmap174drivers/sound/dmabuf.cdmap->dma_mode = DMODE_NONE;
dmap175drivers/sound/dmabuf.cdmap->mapping_flags = 0;
dmap176drivers/sound/dmabuf.cdmap->neutral_byte = 0x00;
dmap180drivers/sound/dmabuf.copen_dmap (int dev, int mode, struct dma_buffparms *dmap, int chan)
dmap182drivers/sound/dmabuf.cif (dmap->flags & DMA_BUSY)
dmap188drivers/sound/dmabuf.cif ((err = sound_alloc_dmap (dev, dmap, chan)) < 0)
dmap192drivers/sound/dmabuf.cif (dmap->raw_buf == NULL)
dmap201drivers/sound/dmabuf.cdmap->open_mode = mode;
dmap202drivers/sound/dmabuf.cdmap->subdivision = dmap->underrun_count = 0;
dmap203drivers/sound/dmabuf.cdmap->fragment_size = 0;
dmap204drivers/sound/dmabuf.cdmap->max_fragments = 65536;  /* Just a large value */
dmap205drivers/sound/dmabuf.cdmap->byte_counter = 0;
dmap207drivers/sound/dmabuf.cdma_init_buffers (dev, dmap);
dmap213drivers/sound/dmabuf.cclose_dmap (int dev, struct dma_buffparms *dmap, int chan)
dmap217drivers/sound/dmabuf.cif (dmap->flags & DMA_BUSY)
dmap218drivers/sound/dmabuf.cdmap->dma_mode = DMODE_NONE;
dmap219drivers/sound/dmabuf.cdmap->flags &= ~DMA_BUSY;
dmap221drivers/sound/dmabuf.csound_free_dmap (dev, dmap);
dmap441drivers/sound/dmabuf.cactivate_recording (int dev, struct dma_buffparms *dmap)
dmap446drivers/sound/dmabuf.cif (dmap->flags & DMA_RESTART)
dmap449drivers/sound/dmabuf.cdmap->flags &= ~DMA_RESTART;
dmap452drivers/sound/dmabuf.cif (dmap->dma_mode == DMODE_OUTPUT)  /* Direction change */
dmap456drivers/sound/dmabuf.cdmap->dma_mode = DMODE_NONE;
dmap459drivers/sound/dmabuf.cif (!(dmap->flags & DMA_ALLOC_DONE))
dmap460drivers/sound/dmabuf.creorganize_buffers (dev, dmap);
dmap462drivers/sound/dmabuf.cif (!dmap->dma_mode)
dmap467drivers/sound/dmabuf.cdmap->fragment_size, dmap->nbufs)) < 0)
dmap471drivers/sound/dmabuf.cdmap->dma_mode = DMODE_INPUT;
dmap474drivers/sound/dmabuf.cif (!(dmap->flags & DMA_ACTIVE))
dmap476drivers/sound/dmabuf.caudio_devs[dev]->start_input (dev, dmap->raw_buf_phys +
dmap477drivers/sound/dmabuf.cdmap->qtail * dmap->fragment_size,
dmap478drivers/sound/dmabuf.cdmap->fragment_size, 0,
dmap480drivers/sound/dmabuf.c!(dmap->flags & DMA_STARTED));
dmap481drivers/sound/dmabuf.cdmap->flags |= DMA_ACTIVE | DMA_STARTED;
dmap494drivers/sound/dmabuf.cstruct dma_buffparms *dmap = audio_devs[dev]->dmap_in;
dmap503drivers/sound/dmabuf.celse if (!dmap->qlen)
dmap507drivers/sound/dmabuf.cif ((err = activate_recording (dev, dmap)) < 0)
dmap563drivers/sound/dmabuf.cif (!dmap->qlen)
dmap566drivers/sound/dmabuf.c*buf = &dmap->raw_buf[dmap->qhead * dmap->fragment_size + dmap->counts[dmap->qhead]];
dmap567drivers/sound/dmabuf.c*len = dmap->fragment_size - dmap->counts[dmap->qhead];
dmap569drivers/sound/dmabuf.creturn dmap->qhead;
dmap575drivers/sound/dmabuf.cstruct dma_buffparms *dmap = audio_devs[dev]->dmap_in;
dmap577drivers/sound/dmabuf.cint             p = dmap->counts[dmap->qhead] + c;
dmap584drivers/sound/dmabuf.celse if (p >= dmap->fragment_size)
dmap586drivers/sound/dmabuf.cdmap->counts[dmap->qhead] = 0;
dmap587drivers/sound/dmabuf.cif (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs)
dmap589drivers/sound/dmabuf.cdev, dmap->qlen, dmap->nbufs);
dmap590drivers/sound/dmabuf.cdmap->qlen--;
dmap591drivers/sound/dmabuf.cdmap->qhead = (dmap->qhead + 1) % dmap->nbufs;
dmap594drivers/sound/dmabuf.cdmap->counts[dmap->qhead] = p;
dmap600drivers/sound/dmabuf.cdma_subdivide (int dev, struct dma_buffparms *dmap, ioctl_arg arg, int fact)
dmap604drivers/sound/dmabuf.cfact = dmap->subdivision;
dmap610drivers/sound/dmabuf.cif (dmap->subdivision != 0 ||
dmap611drivers/sound/dmabuf.cdmap->fragment_size)  /* Loo late to change */
dmap620drivers/sound/dmabuf.cdmap->subdivision = fact;
dmap625drivers/sound/dmabuf.cdma_set_fragment (int dev, struct dma_buffparms *dmap, ioctl_arg arg, int fact)
dmap632drivers/sound/dmabuf.cif (dmap->subdivision != 0 ||
dmap633drivers/sound/dmabuf.cdmap->fragment_size)  /* Loo late to change */
dmap648drivers/sound/dmabuf.cdmap->fragment_size = (1 << bytes);
dmap649drivers/sound/dmabuf.cdmap->max_fragments = count;
dmap651drivers/sound/dmabuf.cif (dmap->fragment_size > audio_devs[dev]->buffsize)
dmap652drivers/sound/dmabuf.cdmap->fragment_size = audio_devs[dev]->buffsize;
dmap654drivers/sound/dmabuf.cif (dmap->fragment_size == audio_devs[dev]->buffsize &&
dmap656drivers/sound/dmabuf.cdmap->fragment_size /= 2;  /* Needs at least 2 buffers */
dmap658drivers/sound/dmabuf.cdmap->subdivision = 1;  /* Disable SNDCTL_DSP_SUBDIVIDE */
dmap663drivers/sound/dmabuf.cget_buffer_pointer (int dev, int chan, struct dma_buffparms *dmap)
dmap670drivers/sound/dmabuf.cif (!(dmap->flags & DMA_ACTIVE))
dmap683drivers/sound/dmabuf.creturn dmap->bytes_in_use - pos;
dmap686drivers/sound/dmabuf.cpos = dmap->fragment_size - pos;
dmap757drivers/sound/dmabuf.cstruct dma_buffparms *dmap = dmap_out;
dmap762drivers/sound/dmabuf.cdmap = dmap_in;
dmap764drivers/sound/dmabuf.cif (dmap->mapping_flags & DMA_MAP_MAPPED)
dmap767drivers/sound/dmabuf.cif (!(dmap->flags & DMA_ALLOC_DONE))
dmap768drivers/sound/dmabuf.creorganize_buffers (dev, dmap);
dmap770drivers/sound/dmabuf.cinfo->fragstotal = dmap->nbufs;
dmap773drivers/sound/dmabuf.cinfo->fragments = dmap->qlen;
dmap780drivers/sound/dmabuf.cinfo->fragments = dmap->nbufs - dmap->qlen;
dmap796drivers/sound/dmabuf.celse if (info->fragments > dmap->nbufs)
dmap797drivers/sound/dmabuf.cinfo->fragments = dmap->nbufs;
dmap799drivers/sound/dmabuf.cinfo->fragsize = dmap->fragment_size;
dmap800drivers/sound/dmabuf.cinfo->bytes = info->fragments * dmap->fragment_size;
dmap802drivers/sound/dmabuf.cif (cmd == SNDCTL_DSP_GETISPACE && dmap->qlen)
dmap803drivers/sound/dmabuf.cinfo->bytes -= dmap->counts[dmap->qhead];
dmap927drivers/sound/dmabuf.cstruct dma_buffparms *dmap = audio_devs[dev]->dmap_out;
dmap929drivers/sound/dmabuf.cif (dmap->qlen >= dmap->nbufs)  /* No space at all */
dmap937drivers/sound/dmabuf.cmax = dmap->max_fragments;
dmap938drivers/sound/dmabuf.clen = dmap->qlen;
dmap960drivers/sound/dmabuf.cstruct dma_buffparms *dmap = audio_devs[dev]->dmap_out;
dmap968drivers/sound/dmabuf.cif (dmap->dma_mode == DMODE_INPUT)  /* Direction change */
dmap971drivers/sound/dmabuf.cdmap->dma_mode = DMODE_NONE;
dmap973drivers/sound/dmabuf.celse if (dmap->flags & DMA_RESTART)  /* Restart buffering */
dmap979drivers/sound/dmabuf.cdmap->flags &= ~DMA_RESTART;
dmap981drivers/sound/dmabuf.cif (!(dmap->flags & DMA_ALLOC_DONE))
dmap982drivers/sound/dmabuf.creorganize_buffers (dev, dmap);
dmap984drivers/sound/dmabuf.cif (!dmap->dma_mode)
dmap988drivers/sound/dmabuf.cdmap->dma_mode = DMODE_OUTPUT;
dmap990drivers/sound/dmabuf.cdmap->fragment_size, dmap->nbufs)) < 0)
dmap1063drivers/sound/dmabuf.c*buf = dmap->raw_buf + dmap->qtail * dmap->fragment_size;
dmap1064drivers/sound/dmabuf.c*size = dmap->fragment_size;
dmap1065drivers/sound/dmabuf.cdmap->counts[dmap->qtail] = 0;
dmap1067drivers/sound/dmabuf.creturn dmap->qtail;
dmap1073drivers/sound/dmabuf.cstruct dma_buffparms *dmap = audio_devs[dev]->dmap_out;
dmap1081drivers/sound/dmabuf.cl = dmap->fragment_size;
dmap1082drivers/sound/dmabuf.cdmap->counts[dmap->qtail] = l;
dmap1083drivers/sound/dmabuf.cdmap->flags &= ~DMA_RESTART;
dmap1084drivers/sound/dmabuf.cdmap->qtail = (dmap->qtail + 1) % dmap->nbufs;
dmap1089drivers/sound/dmabuf.cif (buff_no != dmap->qtail)
dmap1090drivers/sound/dmabuf.cprintk ("Sound warning: DMA buffers out of sync %d != %d\n", buff_no, dmap->qtail);
dmap1092drivers/sound/dmabuf.cdmap->qlen++;
dmap1093drivers/sound/dmabuf.cif (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs)
dmap1095drivers/sound/dmabuf.cdev, dmap->qlen, dmap->nbufs);
dmap1097drivers/sound/dmabuf.cdmap->counts[dmap->qtail] = l;
dmap1099drivers/sound/dmabuf.cif ((l != dmap->fragment_size) &&
dmap1102drivers/sound/dmabuf.cdmap->flags |= DMA_RESTART;
dmap1104drivers/sound/dmabuf.cdmap->flags &= ~DMA_RESTART;
dmap1106drivers/sound/dmabuf.cdmap->qtail = (dmap->qtail + 1) % dmap->nbufs;
dmap1109drivers/sound/dmabuf.cif (!(dmap->flags & DMA_ACTIVE))
dmap1111drivers/sound/dmabuf.cdmap->flags |= DMA_ACTIVE;
dmap1112drivers/sound/dmabuf.caudio_devs[dev]->output_block (dev, dmap->raw_buf_phys +
dmap1113drivers/sound/dmabuf.cdmap->qhead * dmap->fragment_size,
dmap1114drivers/sound/dmabuf.cdmap->counts[dmap->qhead], 0,
dmap1116drivers/sound/dmabuf.c!(dmap->flags & DMA_STARTED));
dmap1117drivers/sound/dmabuf.cdmap->flags |= DMA_STARTED;
dmap1130drivers/sound/dmabuf.cstruct dma_buffparms *dmap;
dmap1136drivers/sound/dmabuf.cdmap = audio_devs[dev]->dmap_out;
dmap1141drivers/sound/dmabuf.cdmap = audio_devs[dev]->dmap_in;
dmap1159drivers/sound/dmabuf.cset_dma_addr (chan, dmap->raw_buf_phys);
dmap1160drivers/sound/dmabuf.cset_dma_count (chan, dmap->bytes_in_use);
dmap1218drivers/sound/dmabuf.cstruct dma_buffparms *dmap = audio_devs[dev]->dmap_out;
dmap1220drivers/sound/dmabuf.cdmap->byte_counter += dmap->counts[dmap->qhead];
dmap1223drivers/sound/dmabuf.cif (dmap->mapping_flags & DMA_MAP_MAPPED)
dmap1227drivers/sound/dmabuf.cint             p = dmap->fragment_size * dmap->qhead;
dmap1229drivers/sound/dmabuf.cmemset (dmap->raw_buf + p,
dmap1230drivers/sound/dmabuf.cdmap->neutral_byte,
dmap1231drivers/sound/dmabuf.cdmap->fragment_size);
dmap1233drivers/sound/dmabuf.cdmap->qhead = (dmap->qhead + 1) % dmap->nbufs;
dmap1234drivers/sound/dmabuf.cdmap->qlen++;    /* Yes increment it (don't decrement) */
dmap1235drivers/sound/dmabuf.cdmap->flags &= ~DMA_ACTIVE;
dmap1236drivers/sound/dmabuf.cdmap->counts[dmap->qhead] = dmap->fragment_size;
dmap1240drivers/sound/dmabuf.caudio_devs[dev]->output_block (dev, dmap->raw_buf_phys +
dmap1241drivers/sound/dmabuf.cdmap->qhead * dmap->fragment_size,
dmap1242drivers/sound/dmabuf.cdmap->counts[dmap->qhead], 1,
dmap1248drivers/sound/dmabuf.cdmap->flags |= DMA_ACTIVE;
dmap1252drivers/sound/dmabuf.cif (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs)
dmap1255drivers/sound/dmabuf.cdev, dmap->qlen, dmap->nbufs);
dmap1259drivers/sound/dmabuf.cdmap->qlen--;
dmap1260drivers/sound/dmabuf.cdmap->qhead = (dmap->qhead + 1) % dmap->nbufs;
dmap1261drivers/sound/dmabuf.cdmap->flags &= ~DMA_ACTIVE;
dmap1263drivers/sound/dmabuf.cif (dmap->qlen)
dmap1267drivers/sound/dmabuf.caudio_devs[dev]->output_block (dev, dmap->raw_buf_phys +
dmap1268drivers/sound/dmabuf.cdmap->qhead * dmap->fragment_size,
dmap1269drivers/sound/dmabuf.cdmap->counts[dmap->qhead], 1,
dmap1275drivers/sound/dmabuf.cdmap->flags |= DMA_ACTIVE;
dmap1279drivers/sound/dmabuf.cdmap->underrun_count++;
dmap1288drivers/sound/dmabuf.cdmap->flags |= DMA_RESTART;
dmap1290drivers/sound/dmabuf.cdmap->flags &= ~DMA_RESTART;
dmap1310drivers/sound/dmabuf.cstruct dma_buffparms *dmap = audio_devs[dev]->dmap_in;
dmap1312drivers/sound/dmabuf.cdmap->byte_counter += dmap->fragment_size;
dmap1315drivers/sound/dmabuf.cif (dmap->mapping_flags & DMA_MAP_MAPPED)
dmap1317drivers/sound/dmabuf.cdmap->qtail = (dmap->qtail + 1) % dmap->nbufs;
dmap1318drivers/sound/dmabuf.cdmap->qlen++;
dmap1322drivers/sound/dmabuf.caudio_devs[dev]->start_input (dev, dmap->raw_buf_phys +
dmap1323drivers/sound/dmabuf.cdmap->qtail * dmap->fragment_size,
dmap1324drivers/sound/dmabuf.cdmap->fragment_size, 1,
dmap1331drivers/sound/dmabuf.cdmap->flags |= DMA_ACTIVE;
dmap1333drivers/sound/dmabuf.celse if (dmap->qlen == (dmap->nbufs - 1))
dmap1336drivers/sound/dmabuf.cdmap->underrun_count++;
dmap1343drivers/sound/dmabuf.cdmap->flags &= ~DMA_ACTIVE;
dmap1345drivers/sound/dmabuf.cdmap->flags |= DMA_RESTART;
dmap1347drivers/sound/dmabuf.cdmap->flags &= ~DMA_RESTART;
dmap1351drivers/sound/dmabuf.cdmap->qlen++;
dmap1352drivers/sound/dmabuf.cif (dmap->qlen <= 0 || dmap->qlen > dmap->nbufs)
dmap1354drivers/sound/dmabuf.cdev, dmap->qlen, dmap->nbufs);
dmap1355drivers/sound/dmabuf.cdmap->qtail = (dmap->qtail + 1) % dmap->nbufs;
dmap1359drivers/sound/dmabuf.caudio_devs[dev]->start_input (dev, dmap->raw_buf_phys +
dmap1360drivers/sound/dmabuf.cdmap->qtail * dmap->fragment_size,
dmap1361drivers/sound/dmabuf.cdmap->fragment_size, 1,
dmap1368drivers/sound/dmabuf.cdmap->flags |= DMA_ACTIVE;
dmap1448drivers/sound/dmabuf.cstruct dma_buffparms *dmap;
dmap1454drivers/sound/dmabuf.cdmap = audio_devs[dev]->dmap_in;
dmap1456drivers/sound/dmabuf.cif (dmap->dma_mode != DMODE_INPUT)
dmap1458drivers/sound/dmabuf.cif ((audio_devs[dev]->flags & DMA_DUPLEX) && !dmap->qlen &&
dmap1466drivers/sound/dmabuf.cactivate_recording (dev, dmap);
dmap1472drivers/sound/dmabuf.cif (!dmap->qlen)
dmap1485drivers/sound/dmabuf.cdmap = audio_devs[dev]->dmap_out;
dmap1486drivers/sound/dmabuf.cif (dmap->dma_mode == DMODE_INPUT)
dmap1491drivers/sound/dmabuf.cif (dmap->dma_mode == DMODE_NONE)
dmap249drivers/sound/soundcard.cstruct dma_buffparms *dmap = NULL;
dmap271drivers/sound/soundcard.cdmap = audio_devs[dev]->dmap_in;
dmap275drivers/sound/soundcard.cdmap = audio_devs[dev]->dmap_out;
dmap283drivers/sound/soundcard.cif (dmap == NULL)
dmap289drivers/sound/soundcard.cif (dmap->raw_buf == NULL)
dmap295drivers/sound/soundcard.cif (dmap->mapping_flags)
dmap309drivers/sound/soundcard.cif (size != dmap->bytes_in_use)
dmap312drivers/sound/soundcard.csize, dmap->bytes_in_use);
dmap315drivers/sound/soundcard.cif (remap_page_range (vma->vm_start, dmap->raw_buf_phys, vma->vm_end - vma->vm_start, vma->vm_page_prot))
dmap322drivers/sound/soundcard.cdmap->mapping_flags |= DMA_MAP_MAPPED;
dmap324drivers/sound/soundcard.cmemset (dmap->raw_buf,
dmap325drivers/sound/soundcard.cdmap->neutral_byte,
dmap326drivers/sound/soundcard.cdmap->bytes_in_use);
dmap605drivers/sound/soundcard.csound_alloc_dmap (int dev, struct dma_buffparms *dmap, int chan)
dmap610drivers/sound/soundcard.cif (dmap->raw_buf != NULL)
dmap621drivers/sound/soundcard.cdmap->raw_buf = NULL;
dmap679drivers/sound/soundcard.cdmap->raw_buf = start_addr;
dmap680drivers/sound/soundcard.cdmap->raw_buf_phys = (unsigned long) start_addr;
dmap695drivers/sound/soundcard.csound_free_dmap (int dev, struct dma_buffparms *dmap)
dmap697drivers/sound/soundcard.cif (dmap->raw_buf == NULL)
dmap707drivers/sound/soundcard.cstart_addr = (unsigned long) dmap->raw_buf;
dmap718drivers/sound/soundcard.cfree_pages ((unsigned long) dmap->raw_buf, sz);
dmap720drivers/sound/soundcard.cdmap->raw_buf = NULL;
dmap724drivers/sound/soundcard.csoud_map_buffer (int dev, struct dma_buffparms *dmap, buffmem_desc * info)