FreeBSD kernel sound device code
vchan.c File Reference
Include dependency graph for vchan.c:

Go to the source code of this file.

Data Structures

struct  vchan_info
 

Macros

#define FMTLIST_MAX   6
 
#define FMTLIST_OFFSET   4
 
#define DIGFMTS_MAX   2
 
#define VCHAN_ACCESSIBLE(c)
 
#define VCHAN_FMT_HINT(x)
 
#define VCHAN_SPD_HINT(x)
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
static void * vchan_init (kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
 
static int vchan_free (kobj_t obj, void *data)
 
static int vchan_setformat (kobj_t obj, void *data, uint32_t format)
 
static uint32_t vchan_setspeed (kobj_t obj, void *data, uint32_t speed)
 
static int vchan_trigger (kobj_t obj, void *data, int go)
 
static struct pcmchan_capsvchan_getcaps (kobj_t obj, void *data)
 
static struct pcmchan_matrixvchan_getmatrix (kobj_t obj, void *data, uint32_t format)
 
 CHANNEL_DECLARE (vchan)
 
static void pcm_getparentchannel (struct snddev_info *d, struct pcm_channel **wrch, struct pcm_channel **rdch)
 
static int sysctl_dev_pcm_vchans (SYSCTL_HANDLER_ARGS)
 
static int sysctl_dev_pcm_vchanmode (SYSCTL_HANDLER_ARGS)
 
static int sysctl_dev_pcm_vchanrate (SYSCTL_HANDLER_ARGS)
 
static int sysctl_dev_pcm_vchanformat (SYSCTL_HANDLER_ARGS)
 
int vchan_create (struct pcm_channel *parent, int num)
 
int vchan_destroy (struct pcm_channel *c)
 
int vchan_sync (struct pcm_channel *c)
 
void vchan_initsys (device_t dev)
 

Variables

static kobj_method_t vchan_methods []
 

Macro Definition Documentation

◆ DIGFMTS_MAX

#define DIGFMTS_MAX   2

Definition at line 46 of file vchan.c.

◆ FMTLIST_MAX

#define FMTLIST_MAX   6

Definition at line 44 of file vchan.c.

◆ FMTLIST_OFFSET

#define FMTLIST_OFFSET   4

Definition at line 45 of file vchan.c.

◆ VCHAN_ACCESSIBLE

#define VCHAN_ACCESSIBLE (   c)
Value:
(!((c)->flags & (CHN_F_PASSTHROUGH | \
(((c)->flags & CHN_F_VCHAN_DYNAMIC) || \
#define CHN_STOPPED(c)
Definition: channel.h:430
#define CHN_F_PASSTHROUGH
Definition: channel.h:378
#define CHN_F_VCHAN_DYNAMIC
Definition: channel.h:374
#define CHN_F_EXCLUSIVE
Definition: channel.h:379
struct pcm_channel * c
Definition: channel_if.m:106

Definition at line 440 of file vchan.c.

◆ VCHAN_FMT_HINT

#define VCHAN_FMT_HINT (   x)
Value:
((x) == PCMDIR_PLAY_VIRTUAL) ? \
"play.vchanformat" : "rec.vchanformat"
#define PCMDIR_PLAY_VIRTUAL
Definition: channel.h:340

Definition at line 661 of file vchan.c.

◆ VCHAN_SPD_HINT

#define VCHAN_SPD_HINT (   x)
Value:
((x) == PCMDIR_PLAY_VIRTUAL) ? \
"play.vchanrate" : "rec.vchanrate"

Definition at line 663 of file vchan.c.

Function Documentation

◆ CHANNEL_DECLARE()

CHANNEL_DECLARE ( vchan  )

◆ pcm_getparentchannel()

static void pcm_getparentchannel ( struct snddev_info d,
struct pcm_channel **  wrch,
struct pcm_channel **  rdch 
)
static

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

◆ sysctl_dev_pcm_vchanformat()

◆ sysctl_dev_pcm_vchanmode()

static int sysctl_dev_pcm_vchanmode ( SYSCTL_HANDLER_ARGS  )
static

◆ sysctl_dev_pcm_vchanrate()

◆ sysctl_dev_pcm_vchans()

static int sysctl_dev_pcm_vchans ( SYSCTL_HANDLER_ARGS  )
static

◆ vchan_create()

◆ vchan_destroy()

int vchan_destroy ( struct pcm_channel c)

◆ vchan_free()

static int vchan_free ( kobj_t  obj,
void *  data 
)
static

Definition at line 102 of file vchan.c.

References data, and free.

◆ vchan_getcaps()

◆ vchan_getmatrix()

static struct pcmchan_matrix * vchan_getmatrix ( kobj_t  obj,
void *  data,
uint32_t  format 
)
static

Definition at line 235 of file vchan.c.

References feeder_matrix_format_map(), and format.

Here is the call graph for this function:

◆ vchan_init()

static void * vchan_init ( kobj_t  obj,
void *  devinfo,
struct snd_dbuf b,
struct pcm_channel c,
int  dir 
)
static

◆ vchan_initsys()

void vchan_initsys ( device_t  dev)

Definition at line 940 of file vchan.c.

References dev, snddev_info::play_sysctl_tree, snddev_info::rec_sysctl_ctx, snddev_info::rec_sysctl_tree, sysctl_dev_pcm_vchanformat(), sysctl_dev_pcm_vchanmode(), sysctl_dev_pcm_vchanrate(), sysctl_dev_pcm_vchans(), VCHAN_SYSCTL_DATA, and VCHAN_SYSCTL_DATA_SIZE.

Referenced by pcm_sysinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vchan_setformat()

static int vchan_setformat ( kobj_t  obj,
void *  data,
uint32_t  format 
)
static

Definition at line 111 of file vchan.c.

References vchan_info::caps, vchan_info::channel, CHN_LOCKASSERT, data, pcmchan_caps::fmtlist, format, and snd_fmtvalid().

Here is the call graph for this function:

◆ vchan_setspeed()

static uint32_t vchan_setspeed ( kobj_t  obj,
void *  data,
uint32_t  speed 
)
static

◆ vchan_sync()

◆ vchan_trigger()

static int vchan_trigger ( kobj_t  obj,
void *  data,
int  go 
)
static

Variable Documentation

◆ vchan_methods

kobj_method_t vchan_methods[]
static
Initial value:
= {
KOBJMETHOD(channel_init, vchan_init),
KOBJMETHOD(channel_free, vchan_free),
KOBJMETHOD(channel_setformat, vchan_setformat),
KOBJMETHOD(channel_setspeed, vchan_setspeed),
KOBJMETHOD(channel_trigger, vchan_trigger),
KOBJMETHOD(channel_getcaps, vchan_getcaps),
KOBJMETHOD(channel_getmatrix, vchan_getmatrix),
}
#define KOBJMETHOD_END
Definition: midi.c:76
static int vchan_free(kobj_t obj, void *data)
Definition: vchan.c:102
static struct pcmchan_caps * vchan_getcaps(kobj_t obj, void *data)
Definition: vchan.c:188
static uint32_t vchan_setspeed(kobj_t obj, void *data, uint32_t speed)
Definition: vchan.c:126
static void * vchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
Definition: vchan.c:63
static struct pcmchan_matrix * vchan_getmatrix(kobj_t obj, void *data, uint32_t format)
Definition: vchan.c:235
static int vchan_trigger(kobj_t obj, void *data, int go)
Definition: vchan.c:138
static int vchan_setformat(kobj_t obj, void *data, uint32_t format)
Definition: vchan.c:111

Definition at line 241 of file vchan.c.