Deleted Added
full compact
channel.h (67652) channel.h (70134)
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/sound/pcm/channel.h 67652 2000-10-26 20:46:58Z cg $
26 * $FreeBSD: head/sys/dev/sound/pcm/channel.h 70134 2000-12-18 01:36:41Z cg $
27 */
28
27 */
28
29#include "channel_if.h"
30
29int chn_reinit(pcm_channel *c);
30int chn_write(pcm_channel *c, struct uio *buf);
31int chn_read(pcm_channel *c, struct uio *buf);
32u_int32_t chn_start(pcm_channel *c, int force);
33int chn_sync(pcm_channel *c, int threshold);
34int chn_flush(pcm_channel *c);
35int chn_poll(pcm_channel *c, int ev, struct proc *p);
36

--- 43 unchanged lines hidden (view full) ---

80#define CHN_F_NOTRIGGER 0x00000040
81
82#define CHN_F_BUSY 0x00001000 /* has been opened */
83#define CHN_F_HAS_SIZE 0x00002000 /* user set block size */
84#define CHN_F_NBIO 0x00004000 /* do non-blocking i/o */
85#define CHN_F_INIT 0x00008000 /* changed parameters. need init */
86#define CHN_F_MAPPED 0x00010000 /* has been mmap()ed */
87#define CHN_F_DEAD 0x00020000
31int chn_reinit(pcm_channel *c);
32int chn_write(pcm_channel *c, struct uio *buf);
33int chn_read(pcm_channel *c, struct uio *buf);
34u_int32_t chn_start(pcm_channel *c, int force);
35int chn_sync(pcm_channel *c, int threshold);
36int chn_flush(pcm_channel *c);
37int chn_poll(pcm_channel *c, int ev, struct proc *p);
38

--- 43 unchanged lines hidden (view full) ---

82#define CHN_F_NOTRIGGER 0x00000040
83
84#define CHN_F_BUSY 0x00001000 /* has been opened */
85#define CHN_F_HAS_SIZE 0x00002000 /* user set block size */
86#define CHN_F_NBIO 0x00004000 /* do non-blocking i/o */
87#define CHN_F_INIT 0x00008000 /* changed parameters. need init */
88#define CHN_F_MAPPED 0x00010000 /* has been mmap()ed */
89#define CHN_F_DEAD 0x00020000
90#define CHN_F_BADSETTING 0x00040000
88
91
89
90#define CHN_F_RESET (CHN_F_BUSY | CHN_F_DEAD)
91
92/*
93 * This should be large enough to hold all pcm data between
94 * tsleeps in chn_{read,write} at the highest sample rate.
95 * (which is usually 48kHz * 16bit * stereo = 192000 bytes/sec)
96 */
97#define CHN_2NDBUFBLKSIZE (2 * 1024)
98/* The total number of blocks per secondary buffer. */
99#define CHN_2NDBUFBLKNUM (32)
100/* The size of a whole secondary buffer. */
101#define CHN_2NDBUFMAXSIZE (131072)
92#define CHN_F_RESET (CHN_F_BUSY | CHN_F_DEAD)
93
94/*
95 * This should be large enough to hold all pcm data between
96 * tsleeps in chn_{read,write} at the highest sample rate.
97 * (which is usually 48kHz * 16bit * stereo = 192000 bytes/sec)
98 */
99#define CHN_2NDBUFBLKSIZE (2 * 1024)
100/* The total number of blocks per secondary buffer. */
101#define CHN_2NDBUFBLKNUM (32)
102/* The size of a whole secondary buffer. */
103#define CHN_2NDBUFMAXSIZE (131072)
104
105#define CHANNEL_DECLARE(name) static DEFINE_CLASS(name, name ## _methods, sizeof(struct kobj))