Deleted Added
sdiff udiff text old ( 164614 ) new ( 170161 )
full compact
1/*-
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
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 164614 2006-11-26 12:24:06Z ariff $
27 */
28
29struct pcmchan_children {
30 SLIST_ENTRY(pcmchan_children) link;
31 struct pcm_channel *channel;
32};
33
34struct pcmchan_caps {
35 u_int32_t minspeed, maxspeed;
36 u_int32_t *fmtlist;
37 u_int32_t caps;
38};
39
40/* Forward declarations */
41struct pcm_channel;

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

67 struct pcmchan_syncgroup *parent; /**< group head */
68 struct pcm_channel *ch;
69};
70
71#define CHN_NAMELEN 32
72struct pcm_channel {
73 kobj_t methods;
74
75 int num;
76 pid_t pid;
77 int refcount;
78 struct pcm_feeder *feeder;
79 u_int32_t align;
80
81 int volume;
82 int latency;
83 u_int32_t speed;

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

89 int direction;
90 unsigned int interrupts, xruns, feedcount;
91 unsigned int timeout;
92 struct snd_dbuf *bufhard, *bufsoft;
93 struct snddev_info *parentsnddev;
94 struct pcm_channel *parentchannel;
95 void *devinfo;
96 device_t dev;
97 char name[CHN_NAMELEN];
98 struct mtx *lock;
99 /**
100 * Increment,decrement this around operations that temporarily yield
101 * lock.
102 */
103 unsigned int inprog;
104 /**
105 * Special channel operations should examine @c inprog after acquiring
106 * lock. If zero, operations may continue. Else, thread should

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

118 /**
119 * If part of a sync group, this will point to the syncmember
120 * container.
121 */
122 struct pcmchan_syncmember *sm;
123#ifdef OSSV4_EXPERIMENT
124 u_int16_t lpeak, rpeak; /**< Peak value from 0-32767. */
125#endif
126 SLIST_HEAD(, pcmchan_children) children;
127};
128
129#include "channel_if.h"
130
131int chn_reinit(struct pcm_channel *c);
132int chn_write(struct pcm_channel *c, struct uio *buf);
133int chn_read(struct pcm_channel *c, struct uio *buf);
134u_int32_t chn_start(struct pcm_channel *c, int force);
135int chn_sync(struct pcm_channel *c, int threshold);
136int chn_flush(struct pcm_channel *c);

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

203int afmtstr_swap_endian(char *);
204u_int32_t afmtstr2afmt(struct afmtstr_table *, const char *, int);
205u_int32_t afmt2afmtstr(struct afmtstr_table *, u_int32_t, char *, size_t, int, int);
206
207extern int chn_latency;
208extern int chn_latency_profile;
209extern int report_soft_formats;
210
211#define PCMDIR_VIRTUAL 2
212#define PCMDIR_PLAY 1
213#define PCMDIR_REC -1
214
215#define PCMTRIG_START 1
216#define PCMTRIG_EMLDMAWR 2
217#define PCMTRIG_EMLDMARD 3
218#define PCMTRIG_STOP 0
219#define PCMTRIG_ABORT -1
220
221#define CHN_F_CLOSING 0x00000004 /* a pending close */
222#define CHN_F_ABORTING 0x00000008 /* a pending abort */
223#define CHN_F_RUNNING 0x00000010 /* dma is running */
224#define CHN_F_TRIGGERED 0x00000020
225#define CHN_F_NOTRIGGER 0x00000040
226
227#define CHN_F_BUSY 0x00001000 /* has been opened */
228#define CHN_F_HAS_SIZE 0x00002000 /* user set block size */
229#define CHN_F_NBIO 0x00004000 /* do non-blocking i/o */
230#define CHN_F_MAPPED 0x00010000 /* has been mmap()ed */
231#define CHN_F_DEAD 0x00020000
232#define CHN_F_BADSETTING 0x00040000
233#define CHN_F_SETBLOCKSIZE 0x00080000

--- 37 unchanged lines hidden ---