xref: /freebsd/sys/dev/sound/pcm/buffer.h (revision 350a5fafb1e6ac54471b60a61ce248dc123386c0)
1350a5fafSCameron Grant /*
2350a5fafSCameron Grant  * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3350a5fafSCameron Grant  * All rights reserved.
4350a5fafSCameron Grant  *
5350a5fafSCameron Grant  * Redistribution and use in source and binary forms, with or without
6350a5fafSCameron Grant  * modification, are permitted provided that the following conditions
7350a5fafSCameron Grant  * are met:
8350a5fafSCameron Grant  * 1. Redistributions of source code must retain the above copyright
9350a5fafSCameron Grant  *    notice, this list of conditions and the following disclaimer.
10350a5fafSCameron Grant  * 2. Redistributions in binary form must reproduce the above copyright
11350a5fafSCameron Grant  *    notice, this list of conditions and the following disclaimer in the
12350a5fafSCameron Grant  *    documentation and/or other materials provided with the distribution.
13350a5fafSCameron Grant  *
14350a5fafSCameron Grant  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15350a5fafSCameron Grant  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16350a5fafSCameron Grant  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17350a5fafSCameron Grant  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18350a5fafSCameron Grant  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19350a5fafSCameron Grant  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20350a5fafSCameron Grant  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21350a5fafSCameron Grant  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22350a5fafSCameron Grant  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23350a5fafSCameron Grant  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24350a5fafSCameron Grant  * SUCH DAMAGE.
25350a5fafSCameron Grant  *
26350a5fafSCameron Grant  * $FreeBSD$
27350a5fafSCameron Grant  */
28350a5fafSCameron Grant 
29350a5fafSCameron Grant #define ISA_DMA(b) (((b)->chan >= 0 && (b)->chan != 4 && (b)->chan < 8))
30350a5fafSCameron Grant 
31350a5fafSCameron Grant int sndbuf_alloc(snd_dbuf *b, bus_dma_tag_t dmatag, int size);
32350a5fafSCameron Grant int sndbuf_setup(snd_dbuf *b, void *buf, int size);
33350a5fafSCameron Grant void sndbuf_free(snd_dbuf *b);
34350a5fafSCameron Grant int sndbuf_resize(snd_dbuf *b, int blkcnt, int blksz);
35350a5fafSCameron Grant void sndbuf_reset(snd_dbuf *b);
36350a5fafSCameron Grant void sndbuf_clear(snd_dbuf *b, int length);
37350a5fafSCameron Grant int sndbuf_setfmt(snd_dbuf *b, u_int32_t fmt);
38350a5fafSCameron Grant int sndbuf_getbps(snd_dbuf *b);
39350a5fafSCameron Grant void *sndbuf_getbuf(snd_dbuf *b);
40350a5fafSCameron Grant int sndbuf_getsize(snd_dbuf *b);
41350a5fafSCameron Grant int sndbuf_runsz(snd_dbuf *b);
42350a5fafSCameron Grant 
43350a5fafSCameron Grant int sndbuf_isadmasetup(snd_dbuf *b, struct resource *drq);
44350a5fafSCameron Grant int sndbuf_isadmasetdir(snd_dbuf *b, int dir);
45350a5fafSCameron Grant void sndbuf_isadma(snd_dbuf *b, int go);
46350a5fafSCameron Grant int sndbuf_isadmaptr(snd_dbuf *b);
47350a5fafSCameron Grant void sndbuf_isadmabounce(snd_dbuf *b);
48350a5fafSCameron Grant 
49350a5fafSCameron Grant 
50