sound.h (45550658617bab1a5e2228cc0adb133e5e76aea0) sound.h (5ee30e277a97679dd1cbd4a1746339a5f14546aa)
1/*
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
3 * Copyright by Hannu Savolainen 1995
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

93struct pcm_feeder;
94struct snd_dbuf;
95struct snd_mixer;
96
97#include <dev/sound/pcm/buffer.h>
98#include <dev/sound/pcm/channel.h>
99#include <dev/sound/pcm/feeder.h>
100#include <dev/sound/pcm/mixer.h>
1/*
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
3 * Copyright by Hannu Savolainen 1995
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

93struct pcm_feeder;
94struct snd_dbuf;
95struct snd_mixer;
96
97#include <dev/sound/pcm/buffer.h>
98#include <dev/sound/pcm/channel.h>
99#include <dev/sound/pcm/feeder.h>
100#include <dev/sound/pcm/mixer.h>
101#include <dev/sound/pcm/dsp.h>
102
103#define PCM_SOFTC_SIZE 512
104
105#define SND_STATUSLEN 64
106
107#define PCM_MODVER 1
108
109#define PCM_MINVER 1

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

217struct pcm_channel *pcm_getfakechan(struct snddev_info *d);
218struct pcm_channel *pcm_chnalloc(struct snddev_info *d, int direction, pid_t pid, int chnum);
219int pcm_chnrelease(struct pcm_channel *c);
220int pcm_chnref(struct pcm_channel *c, int ref);
221int pcm_inprog(struct snddev_info *d, int delta);
222
223struct pcm_channel *pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, void *devinfo);
224int pcm_chn_destroy(struct pcm_channel *ch);
101
102#define PCM_SOFTC_SIZE 512
103
104#define SND_STATUSLEN 64
105
106#define PCM_MODVER 1
107
108#define PCM_MINVER 1

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

216struct pcm_channel *pcm_getfakechan(struct snddev_info *d);
217struct pcm_channel *pcm_chnalloc(struct snddev_info *d, int direction, pid_t pid, int chnum);
218int pcm_chnrelease(struct pcm_channel *c);
219int pcm_chnref(struct pcm_channel *c, int ref);
220int pcm_inprog(struct snddev_info *d, int delta);
221
222struct pcm_channel *pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, void *devinfo);
223int pcm_chn_destroy(struct pcm_channel *ch);
225int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch, int mkdev);
226int pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch, int rmdev);
224int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch);
225int pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch);
227
228int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo);
229unsigned int pcm_getbuffersize(device_t dev, unsigned int min, unsigned int deflt, unsigned int max);
230int pcm_register(device_t dev, void *devinfo, int numplay, int numrec);
231int pcm_unregister(device_t dev);
232int pcm_setstatus(device_t dev, char *str);
233u_int32_t pcm_getflags(device_t dev);
234void pcm_setflags(device_t dev, u_int32_t val);
235void *pcm_getdevinfo(device_t dev);
236
226
227int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo);
228unsigned int pcm_getbuffersize(device_t dev, unsigned int min, unsigned int deflt, unsigned int max);
229int pcm_register(device_t dev, void *devinfo, int numplay, int numrec);
230int pcm_unregister(device_t dev);
231int pcm_setstatus(device_t dev, char *str);
232u_int32_t pcm_getflags(device_t dev);
233void pcm_setflags(device_t dev, u_int32_t val);
234void *pcm_getdevinfo(device_t dev);
235
237int pcm_regdevt(dev_t dev, unsigned unit, unsigned type, unsigned channel);
238dev_t pcm_getdevt(unsigned unit, unsigned type, unsigned channel);
239int pcm_unregdevt(unsigned unit, unsigned type, unsigned channel);
240
241int snd_setup_intr(device_t dev, struct resource *res, int flags,
242 driver_intr_t hand, void *param, void **cookiep);
243
244void *snd_mtxcreate(const char *desc, const char *type);
245void snd_mtxfree(void *m);
246void snd_mtxassert(void *m);
247#define snd_mtxlock(m) mtx_lock(m)

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

281 * this is rather kludgey- we need to duplicate these struct def'ns from sound.c
282 * so that the macro versions of pcm_{,un}lock can dereference them.
283 * we also have to do this now makedev() has gone away.
284 */
285
286struct snddev_channel {
287 SLIST_ENTRY(snddev_channel) link;
288 struct pcm_channel *channel;
236
237int snd_setup_intr(device_t dev, struct resource *res, int flags,
238 driver_intr_t hand, void *param, void **cookiep);
239
240void *snd_mtxcreate(const char *desc, const char *type);
241void snd_mtxfree(void *m);
242void snd_mtxassert(void *m);
243#define snd_mtxlock(m) mtx_lock(m)

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

277 * this is rather kludgey- we need to duplicate these struct def'ns from sound.c
278 * so that the macro versions of pcm_{,un}lock can dereference them.
279 * we also have to do this now makedev() has gone away.
280 */
281
282struct snddev_channel {
283 SLIST_ENTRY(snddev_channel) link;
284 struct pcm_channel *channel;
285 int chan_num;
286 dev_t dsp_devt;
287 dev_t dspW_devt;
288 dev_t audio_devt;
289 dev_t dspr_devt;
289};
290
290};
291
291struct snddev_devt {
292 SLIST_ENTRY(snddev_devt) link;
293 dev_t dev;
294 unsigned channel;
295 unsigned type;
296};
297
298struct snddev_info {
299 SLIST_HEAD(, snddev_channel) channels;
292struct snddev_info {
293 SLIST_HEAD(, snddev_channel) channels;
300 SLIST_HEAD(, snddev_devt) devs;
301 struct pcm_channel *fakechan;
302 unsigned devcount, playcount, reccount, vchancount;
303 unsigned flags;
304 int inprog;
305 unsigned int bufsz;
306 void *devinfo;
307 device_t dev;
308 char status[SND_STATUSLEN];

--- 18 unchanged lines hidden ---
294 struct pcm_channel *fakechan;
295 unsigned devcount, playcount, reccount, vchancount;
296 unsigned flags;
297 int inprog;
298 unsigned int bufsz;
299 void *devinfo;
300 device_t dev;
301 char status[SND_STATUSLEN];

--- 18 unchanged lines hidden ---