Document a new method, dev_ioctl, for passing ioctl() down to the hardware

driver.
This commit is contained in:
augustss 2001-10-02 23:58:03 +00:00
parent 9cf205c410
commit 8972205779
1 changed files with 43 additions and 33 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: audio.9,v 1.17 2001/06/21 11:59:00 wiz Exp $
.\" $NetBSD: audio.9,v 1.18 2001/10/02 23:58:03 augustss Exp $
.\"
.\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -49,49 +49,51 @@ the
structure.
.Bd -literal
struct audio_hw_if {
int (*open)__P((void *, int));
void (*close)__P((void *));
int (*drain)__P((void *));
int (*open)(void *, int);
void (*close)(void *);
int (*drain)(void *);
int (*query_encoding)__P((void *, struct audio_encoding *));
int (*set_params)__P((void *, int, int,
struct audio_params *, struct audio_params *));
int (*round_blocksize)__P((void *, int));
int (*query_encoding)(void *, struct audio_encoding *);
int (*set_params)(void *, int, int,
struct audio_params *, struct audio_params *);
int (*round_blocksize)(void *, int);
int (*commit_settings)__P((void *));
int (*commit_settings)(void *);
int (*init_output)__P((void *, void *, int));
int (*init_input)__P((void *, void *, int));
int (*start_output)__P((void *, void *, int,
void (*)(void *), void *));
int (*start_input)__P((void *, void *, int,
void (*)(void *), void *));
int (*halt_output)__P((void *));
int (*halt_input)__P((void *));
int (*init_output)(void *, void *, int);
int (*init_input)(void *, void *, int);
int (*start_output)(void *, void *, int, void (*)(void *),
void *);
int (*start_input)(void *, void *, int, void (*)(void *),
void *);
int (*halt_output)(void *);
int (*halt_input)(void *);
int (*speaker_ctl)__P((void *, int));
int (*speaker_ctl)(void *, int);
#define SPKR_ON 1
#define SPKR_OFF 0
int (*getdev)__P((void *, struct audio_device *));
int (*setfd)__P((void *, int));
int (*getdev)(void *, struct audio_device *);
int (*setfd)(void *, int);
int (*set_port)__P((void *, mixer_ctrl_t *));
int (*get_port)__P((void *, mixer_ctrl_t *));
int (*set_port)(void *, mixer_ctrl_t *);
int (*get_port)(void *, mixer_ctrl_t *);
int (*query_devinfo)__P((void *, mixer_devinfo_t *));
int (*query_devinfo)(void *, mixer_devinfo_t *);
void *(*allocm)__P((void *, int, size_t, int, int));
void (*freem)__P((void *, void *, int));
size_t (*round_buffersize)__P((void *, int, size_t));
int (*mappage)__P((void *, void *, int, int));
void *(*allocm)(void *, int, size_t, int, int);
void (*freem)(void *, void *, int);
size_t (*round_buffersize)(void *, int, size_t);
int (*mappage)(void *, void *, int, int);
int (*get_props)__P((void *));
int (*get_props)(void *);
int (*trigger_output)__P((void *, void *, void *, int,
void (*)(void *), void *, struct audio_params *));
int (*trigger_input)__P((void *, void *, void *, int,
void (*)(void *), void *, struct audio_params *));
int (*trigger_output)(void *, void *, void *, int,
void (*)(void *), void *, struct audio_params *);
int (*trigger_input)(void *, void *, void *, int,
void (*)(void *), void *, struct audio_params *);
int (*dev_ioctl)(struct audio_softc *sc, u_long cmd,
caddr_t addr, int flag, struct proc *p);
};
struct audio_params {
@ -100,7 +102,7 @@ struct audio_params {
u_int precision; /* bits/sample */
u_int channels; /* mono(1), stereo(2) */
/* Software en/decode functions, set if SW coding required by HW */
void (*sw_code)__P((void *, u_char *, int));
void (*sw_code)(void *, u_char *, int);
int factor; /* coding space change */
};
.Ed
@ -409,6 +411,14 @@ should be called with the argument
Once started the transfer may be stopped using
.Va halt_input .
Return 0 on success, otherwise an error code.
.It Dv int dev_ioctl(struct audio_softc *sc, u_long cmd, caddr_t addr,
.br
.Dv "int flag, struct proc *p)"
.br
optional, is called when an
.Xr ioctl 2
is not recognized by the generic audio driver.
Return 0 on success, otherwise an error code.
.El
.Pp
The