summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/uaudio.c315
1 files changed, 154 insertions, 161 deletions
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c
index beea76fa0f0..e757110fd52 100644
--- a/sys/dev/usb/uaudio.c
+++ b/sys/dev/usb/uaudio.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uaudio.c,v 1.31 2006/01/02 03:52:29 fgsch Exp $ */
-/* $NetBSD: uaudio.c,v 1.83 2004/10/22 15:25:56 kent Exp $ */
+/* $OpenBSD: uaudio.c,v 1.32 2006/01/02 04:05:50 fgsch Exp $ */
+/* $NetBSD: uaudio.c,v 1.86 2004/10/22 16:01:49 kent Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -156,23 +156,17 @@ struct chan {
};
struct uaudio_softc {
- USBBASEDEVICE sc_dev; /* base device */
+ USBBASEDEVICE sc_dev; /* base device */
usbd_device_handle sc_udev; /* USB device */
-
- int sc_ac_iface; /* Audio Control interface */
+ int sc_ac_iface; /* Audio Control interface */
usbd_interface_handle sc_ac_ifaceh;
-
- struct chan sc_playchan; /* play channel */
- struct chan sc_recchan; /* record channel */
-
- int sc_nullalt;
-
- int sc_audio_rev;
-
- struct as_info *sc_alts;
- int sc_nalts;
-
- int sc_altflags;
+ struct chan sc_playchan; /* play channel */
+ struct chan sc_recchan; /* record channel */
+ int sc_nullalt;
+ int sc_audio_rev;
+ struct as_info *sc_alts; /* alternate settings */
+ int sc_nalts; /* # of alternate settings */
+ int sc_altflags;
#define HAS_8 0x01
#define HAS_16 0x02
#define HAS_8U 0x04
@@ -180,14 +174,11 @@ struct uaudio_softc {
#define HAS_MULAW 0x10
#define UA_NOFRAC 0x20 /* don't do sample rate adjustment */
#define HAS_24 0x40
-
- int sc_mode; /* play/record capability */
-
- struct mixerctl *sc_ctls;
- int sc_nctls;
-
- device_ptr_t sc_audiodev;
- char sc_dying;
+ int sc_mode; /* play/record capability */
+ struct mixerctl *sc_ctls; /* mixer controls */
+ int sc_nctls; /* # of mixer controls */
+ device_ptr_t sc_audiodev;
+ char sc_dying;
};
struct terminal_list {
@@ -225,13 +216,13 @@ Static const char *uac_names[] = {
};
#endif
-Static usbd_status uaudio_identify_ac(struct uaudio_softc *,
- const usb_config_descriptor_t *);
-Static usbd_status uaudio_identify_as(struct uaudio_softc *,
- const usb_config_descriptor_t *);
-Static usbd_status uaudio_process_as(struct uaudio_softc *,
- const char *, int *, int,
- const usb_interface_descriptor_t *);
+Static usbd_status uaudio_identify_ac
+ (struct uaudio_softc *, const usb_config_descriptor_t *);
+Static usbd_status uaudio_identify_as
+ (struct uaudio_softc *, const usb_config_descriptor_t *);
+Static usbd_status uaudio_process_as
+ (struct uaudio_softc *, const char *, int *, int,
+ const usb_interface_descriptor_t *);
Static void uaudio_add_alt(struct uaudio_softc *, const struct as_info *);
@@ -239,89 +230,91 @@ Static const usb_interface_descriptor_t *uaudio_find_iface
(const char *, int, int *, int);
Static void uaudio_mixer_add_ctl(struct uaudio_softc *, struct mixerctl *);
-Static char *uaudio_id_name(struct uaudio_softc *,
- const struct io_terminal *, int);
-Static struct usb_audio_cluster uaudio_get_cluster(int,
- const struct io_terminal *);
-Static void uaudio_add_input(struct uaudio_softc *,
- const struct io_terminal *, int);
-Static void uaudio_add_output(struct uaudio_softc *,
- const struct io_terminal *, int);
-Static void uaudio_add_mixer(struct uaudio_softc *,
- const struct io_terminal *, int);
-Static void uaudio_add_selector(struct uaudio_softc *,
- const struct io_terminal *, int);
+Static char *uaudio_id_name
+ (struct uaudio_softc *, const struct io_terminal *, int);
+Static struct usb_audio_cluster uaudio_get_cluster
+ (int, const struct io_terminal *);
+Static void uaudio_add_input
+ (struct uaudio_softc *, const struct io_terminal *, int);
+Static void uaudio_add_output
+ (struct uaudio_softc *, const struct io_terminal *, int);
+Static void uaudio_add_mixer
+ (struct uaudio_softc *, const struct io_terminal *, int);
+Static void uaudio_add_selector
+ (struct uaudio_softc *, const struct io_terminal *, int);
#ifdef UAUDIO_DEBUG
Static const char *uaudio_get_terminal_name(int);
#endif
-Static int uaudio_determine_class(const struct io_terminal *,
- struct mixerctl *);
-Static const char *uaudio_feature_name(const struct io_terminal *,
- struct mixerctl *);
-Static void uaudio_add_feature(struct uaudio_softc *,
- const struct io_terminal *, int);
-Static void uaudio_add_processing_updown(struct uaudio_softc *,
- const struct io_terminal *, int);
-Static void uaudio_add_processing(struct uaudio_softc *,
- const struct io_terminal *, int);
-Static void uaudio_add_extension(struct uaudio_softc *,
- const struct io_terminal *, int);
-Static struct terminal_list *uaudio_merge_terminal_list
- (const struct io_terminal *);
-Static struct terminal_list *uaudio_io_terminaltype(int,
- struct io_terminal *, int);
-Static usbd_status uaudio_identify(struct uaudio_softc *,
- const usb_config_descriptor_t *);
+Static int uaudio_determine_class
+ (const struct io_terminal *, struct mixerctl *);
+Static const char *uaudio_feature_name
+ (const struct io_terminal *, struct mixerctl *);
+Static void uaudio_add_feature
+ (struct uaudio_softc *, const struct io_terminal *, int);
+Static void uaudio_add_processing_updown
+ (struct uaudio_softc *, const struct io_terminal *, int);
+Static void uaudio_add_processing
+ (struct uaudio_softc *, const struct io_terminal *, int);
+Static void uaudio_add_extension
+ (struct uaudio_softc *, const struct io_terminal *, int);
+Static struct terminal_list *uaudio_merge_terminal_list
+ (const struct io_terminal *);
+Static struct terminal_list *uaudio_io_terminaltype
+ (int, struct io_terminal *, int);
+Static usbd_status uaudio_identify
+ (struct uaudio_softc *, const usb_config_descriptor_t *);
Static int uaudio_signext(int, int);
Static int uaudio_value2bsd(struct mixerctl *, int);
Static int uaudio_bsd2value(struct mixerctl *, int);
Static int uaudio_get(struct uaudio_softc *, int, int, int, int, int);
-Static int uaudio_ctl_get(struct uaudio_softc *, int,
- struct mixerctl *, int);
-Static void uaudio_set(struct uaudio_softc *, int,
- int, int, int, int, int);
-Static void uaudio_ctl_set(struct uaudio_softc *, int,
- struct mixerctl *, int, int);
+Static int uaudio_ctl_get
+ (struct uaudio_softc *, int, struct mixerctl *, int);
+Static void uaudio_set
+ (struct uaudio_softc *, int, int, int, int, int, int);
+Static void uaudio_ctl_set
+ (struct uaudio_softc *, int, struct mixerctl *, int, int);
Static usbd_status uaudio_set_speed(struct uaudio_softc *, int, u_int);
Static usbd_status uaudio_chan_open(struct uaudio_softc *, struct chan *);
Static void uaudio_chan_close(struct uaudio_softc *, struct chan *);
-Static usbd_status uaudio_chan_alloc_buffers(struct uaudio_softc *,
- struct chan *);
+Static usbd_status uaudio_chan_alloc_buffers
+ (struct uaudio_softc *, struct chan *);
Static void uaudio_chan_free_buffers(struct uaudio_softc *, struct chan *);
-Static void uaudio_chan_init(struct chan *, int,
- const struct audio_params *, int);
+Static void uaudio_chan_init
+ (struct chan *, int, const struct audio_params *, int);
Static void uaudio_chan_set_param(struct chan *, u_char *, u_char *, int);
Static void uaudio_chan_ptransfer(struct chan *);
-Static void uaudio_chan_pintr(usbd_xfer_handle,
- usbd_private_handle, usbd_status);
+Static void uaudio_chan_pintr
+ (usbd_xfer_handle, usbd_private_handle, usbd_status);
Static void uaudio_chan_rtransfer(struct chan *);
-Static void uaudio_chan_rintr(usbd_xfer_handle,
- usbd_private_handle, usbd_status);
+Static void uaudio_chan_rintr
+ (usbd_xfer_handle, usbd_private_handle, usbd_status);
Static int uaudio_open(void *, int);
Static void uaudio_close(void *);
Static int uaudio_drain(void *);
Static int uaudio_query_encoding(void *, struct audio_encoding *);
-Static void uaudio_get_minmax_rates(int, const struct as_info *,
- const struct audio_params *,
- int, u_long *, u_long *);
-Static int uaudio_match_alt_sub(int, const struct as_info *,
- const struct audio_params *, int, u_long);
-Static int uaudio_match_alt_chan(int, const struct as_info *,
- struct audio_params *, int);
-Static int uaudio_match_alt(int, const struct as_info *,
- struct audio_params *, int);
-Static int uaudio_set_params(void *, int, int, struct audio_params *,
- struct audio_params *);
+Static void uaudio_get_minmax_rates
+ (int, const struct as_info *, const struct audio_params *,
+ int, u_long *, u_long *);
+Static int uaudio_match_alt_sub
+ (int, const struct as_info *, const struct audio_params *, int, u_long);
+Static int uaudio_match_alt_chan
+ (int, const struct as_info *, struct audio_params *, int);
+Static int uaudio_match_alt
+ (int, const struct as_info *, struct audio_params *, int);
+Static int uaudio_set_params
+ (void *, int, int, struct audio_params *, struct audio_params *);
Static int uaudio_round_blocksize(void *, int);
-Static int uaudio_trigger_output(void *, void *, void *, int,
- void (*)(void *), void *, struct audio_params *);
-Static int uaudio_trigger_input (void *, void *, void *, int,
- void (*)(void *), void *, struct audio_params *);
+Static int uaudio_trigger_output
+ (void *, void *, void *, int, void (*)(void *), void *,
+ struct audio_params *);
+Static int uaudio_trigger_input
+ (void *, void *, void *, int, void (*)(void *), void *,
+ struct audio_params *);
Static int uaudio_halt_in_dma(void *);
Static int uaudio_halt_out_dma(void *);
Static int uaudio_getdev(void *, struct audio_device *);
@@ -520,7 +513,7 @@ uaudio_detach(device_ptr_t self, int flags)
return (rv);
}
-int
+Static int
uaudio_query_encoding(void *addr, struct audio_encoding *fp)
{
struct uaudio_softc *sc = addr;
@@ -588,7 +581,7 @@ uaudio_query_encoding(void *addr, struct audio_encoding *fp)
}
}
-const usb_interface_descriptor_t *
+Static const usb_interface_descriptor_t *
uaudio_find_iface(const char *buf, int size, int *offsp, int subtype)
{
const usb_interface_descriptor_t *d;
@@ -604,12 +597,12 @@ uaudio_find_iface(const char *buf, int size, int *offsp, int subtype)
return (NULL);
}
-void
+Static void
uaudio_mixer_add_ctl(struct uaudio_softc *sc, struct mixerctl *mc)
{
int res;
- size_t len = sizeof(*mc) * (sc->sc_nctls + 1);
- struct mixerctl *nmc = malloc(len, M_USBDEV, M_NOWAIT);
+ size_t len;
+ struct mixerctl *nmc;
if (mc->class < UAC_NCLASSES) {
DPRINTF(("%s: adding %s.%s\n",
@@ -617,17 +610,17 @@ uaudio_mixer_add_ctl(struct uaudio_softc *sc, struct mixerctl *mc)
} else {
DPRINTF(("%s: adding %s\n", __func__, mc->ctlname));
}
+ len = sizeof(*mc) * (sc->sc_nctls + 1);
+ nmc = malloc(len, M_USBDEV, M_NOWAIT);
if (nmc == NULL) {
printf("uaudio_mixer_add_ctl: no memory\n");
return;
}
-
/* Copy old data, if there was any */
if (sc->sc_nctls != 0) {
- bcopy(sc->sc_ctls, nmc, sizeof(*mc) * (sc->sc_nctls));
- free(sc->sc_ctls, M_USBDEV);
+ bcopy(sc->sc_ctls, nmc, sizeof(*mc) * (sc->sc_nctls));
+ free(sc->sc_ctls, M_USBDEV);
}
-
sc->sc_ctls = nmc;
mc->delta = 0;
@@ -672,7 +665,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc *sc, struct mixerctl *mc)
#endif
}
-char *
+Static char *
uaudio_id_name(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
{
static char buf[32];
@@ -680,7 +673,7 @@ uaudio_id_name(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
return (buf);
}
-struct usb_audio_cluster
+Static struct usb_audio_cluster
uaudio_get_cluster(int id, const struct io_terminal *iot)
{
struct usb_audio_cluster r;
@@ -730,7 +723,7 @@ uaudio_get_cluster(int id, const struct io_terminal *iot)
}
-void
+Static void
uaudio_add_input(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
{
#ifdef UAUDIO_DEBUG
@@ -745,7 +738,7 @@ uaudio_add_input(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
#endif
}
-void
+Static void
uaudio_add_output(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
{
#ifdef UAUDIO_DEBUG
@@ -758,7 +751,7 @@ uaudio_add_output(struct uaudio_softc *sc, const struct io_terminal *iot, int id
#endif
}
-void
+Static void
uaudio_add_mixer(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
{
const struct usb_audio_mixer_unit *d = iot[id].d.mu;
@@ -822,7 +815,7 @@ uaudio_add_mixer(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
}
-void
+Static void
uaudio_add_selector(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
{
const struct usb_audio_selector_unit *d = iot[id].d.su;
@@ -851,7 +844,7 @@ uaudio_add_selector(struct uaudio_softc *sc, const struct io_terminal *iot, int
}
#ifdef UAUDIO_DEBUG
-const char *
+Static const char *
uaudio_get_terminal_name(int terminal_type)
{
static char buf[100];
@@ -925,7 +918,7 @@ uaudio_get_terminal_name(int terminal_type)
}
#endif
-int
+Static int
uaudio_determine_class(const struct io_terminal *iot, struct mixerctl *mix)
{
int terminal_type;
@@ -975,7 +968,7 @@ uaudio_determine_class(const struct io_terminal *iot, struct mixerctl *mix)
return terminal_type;
}
-const char *
+Static const char *
uaudio_feature_name(const struct io_terminal *iot, struct mixerctl *mix)
{
int terminal_type;
@@ -1073,7 +1066,7 @@ uaudio_feature_name(const struct io_terminal *iot, struct mixerctl *mix)
return AudioNmaster;
}
-void
+Static void
uaudio_add_feature(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
{
const struct usb_audio_feature_unit *d = iot[id].d.fu;
@@ -1186,7 +1179,7 @@ uaudio_add_feature(struct uaudio_softc *sc, const struct io_terminal *iot, int i
}
}
-void
+Static void
uaudio_add_processing_updown(struct uaudio_softc *sc,
const struct io_terminal *iot, int id)
{
@@ -1223,7 +1216,7 @@ uaudio_add_processing_updown(struct uaudio_softc *sc,
uaudio_mixer_add_ctl(sc, &mix);
}
-void
+Static void
uaudio_add_processing(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
{
const struct usb_audio_processing_unit *d = iot[id].d.pu;
@@ -1265,7 +1258,7 @@ uaudio_add_processing(struct uaudio_softc *sc, const struct io_terminal *iot, in
}
}
-void
+Static void
uaudio_add_extension(struct uaudio_softc *sc, const struct io_terminal *iot, int id)
{
const struct usb_audio_extension_unit *d = iot[id].d.eu;
@@ -1292,7 +1285,7 @@ uaudio_add_extension(struct uaudio_softc *sc, const struct io_terminal *iot, int
}
}
-struct terminal_list*
+Static struct terminal_list*
uaudio_merge_terminal_list(const struct io_terminal *iot)
{
struct terminal_list *tml;
@@ -1327,7 +1320,7 @@ uaudio_merge_terminal_list(const struct io_terminal *iot)
return tml;
}
-struct terminal_list *
+Static struct terminal_list *
uaudio_io_terminaltype(int outtype, struct io_terminal *iot, int id)
{
struct terminal_list *tml;
@@ -1478,7 +1471,7 @@ uaudio_io_terminaltype(int outtype, struct io_terminal *iot, int id)
}
}
-usbd_status
+Static usbd_status
uaudio_identify(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc)
{
usbd_status err;
@@ -1489,30 +1482,30 @@ uaudio_identify(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc)
return (uaudio_identify_as(sc, cdesc));
}
-void
+Static void
uaudio_add_alt(struct uaudio_softc *sc, const struct as_info *ai)
{
- size_t len = sizeof(*ai) * (sc->sc_nalts + 1);
- struct as_info *nai = malloc(len, M_USBDEV, M_NOWAIT);
+ size_t len;
+ struct as_info *nai;
+ len = sizeof(*ai) * (sc->sc_nalts + 1);
+ nai = malloc(len, M_USBDEV, M_NOWAIT);
if (nai == NULL) {
printf("uaudio_add_alt: no memory\n");
return;
}
-
/* Copy old data, if there was any */
if (sc->sc_nalts != 0) {
- bcopy(sc->sc_alts, nai, sizeof(*ai) * (sc->sc_nalts));
- free(sc->sc_alts, M_USBDEV);
+ bcopy(sc->sc_alts, nai, sizeof(*ai) * (sc->sc_nalts));
+ free(sc->sc_alts, M_USBDEV);
}
-
sc->sc_alts = nai;
DPRINTFN(2,("uaudio_add_alt: adding alt=%d, enc=%d\n",
ai->alt, ai->encoding));
sc->sc_alts[sc->sc_nalts++] = *ai;
}
-usbd_status
+Static usbd_status
uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp,
int size, const usb_interface_descriptor_t *id)
#define offs (*offsp)
@@ -1723,7 +1716,7 @@ uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp,
}
#undef offs
-usbd_status
+Static usbd_status
uaudio_identify_as(struct uaudio_softc *sc,
const usb_config_descriptor_t *cdesc)
{
@@ -1779,7 +1772,7 @@ uaudio_identify_as(struct uaudio_softc *sc,
return (USBD_NORMAL_COMPLETION);
}
-usbd_status
+Static usbd_status
uaudio_identify_ac(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc)
{
struct io_terminal* iot;
@@ -1993,7 +1986,7 @@ uaudio_identify_ac(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc
return (USBD_NORMAL_COMPLETION);
}
-int
+Static int
uaudio_query_devinfo(void *addr, mixer_devinfo_t *mi)
{
struct uaudio_softc *sc = addr;
@@ -2077,7 +2070,7 @@ uaudio_query_devinfo(void *addr, mixer_devinfo_t *mi)
return (0);
}
-int
+Static int
uaudio_open(void *addr, int flags)
{
struct uaudio_softc *sc = addr;
@@ -2097,12 +2090,12 @@ uaudio_open(void *addr, int flags)
/*
* Close function is called at splaudio().
*/
-void
+Static void
uaudio_close(void *addr)
{
}
-int
+Static int
uaudio_drain(void *addr)
{
struct uaudio_softc *sc = addr;
@@ -2112,7 +2105,7 @@ uaudio_drain(void *addr)
return (0);
}
-int
+Static int
uaudio_halt_out_dma(void *addr)
{
struct uaudio_softc *sc = addr;
@@ -2127,7 +2120,7 @@ uaudio_halt_out_dma(void *addr)
return (0);
}
-int
+Static int
uaudio_halt_in_dma(void *addr)
{
struct uaudio_softc *sc = addr;
@@ -2142,7 +2135,7 @@ uaudio_halt_in_dma(void *addr)
return (0);
}
-int
+Static int
uaudio_getdev(void *addr, struct audio_device *retp)
{
struct uaudio_softc *sc = addr;
@@ -2158,7 +2151,7 @@ uaudio_getdev(void *addr, struct audio_device *retp)
/*
* Make sure the block size is large enough to hold all outstanding transfers.
*/
-int
+Static int
uaudio_round_blocksize(void *addr, int blk)
{
struct uaudio_softc *sc = addr;
@@ -2193,14 +2186,14 @@ uaudio_round_blocksize(void *addr, int blk)
return (blk);
}
-int
+Static int
uaudio_get_props(void *addr)
{
return (AUDIO_PROP_FULLDUPLEX | AUDIO_PROP_INDEPENDENT);
}
-int
+Static int
uaudio_get(struct uaudio_softc *sc, int which, int type, int wValue,
int wIndex, int len)
{
@@ -2240,7 +2233,7 @@ uaudio_get(struct uaudio_softc *sc, int which, int type, int wValue,
return (val);
}
-void
+Static void
uaudio_set(struct uaudio_softc *sc, int which, int type, int wValue,
int wIndex, int len, int val)
{
@@ -2277,7 +2270,7 @@ uaudio_set(struct uaudio_softc *sc, int which, int type, int wValue,
#endif
}
-int
+Static int
uaudio_signext(int type, int val)
{
if (!MIX_UNSIGNED(type)) {
@@ -2289,7 +2282,7 @@ uaudio_signext(int type, int val)
return (val);
}
-int
+Static int
uaudio_value2bsd(struct mixerctl *mc, int val)
{
DPRINTFN(5, ("uaudio_value2bsd: type=%03x val=%d min=%d max=%d ",
@@ -2322,7 +2315,7 @@ uaudio_bsd2value(struct mixerctl *mc, int val)
return (val);
}
-int
+Static int
uaudio_ctl_get(struct uaudio_softc *sc, int which, struct mixerctl *mc,
int chan)
{
@@ -2334,7 +2327,7 @@ uaudio_ctl_get(struct uaudio_softc *sc, int which, struct mixerctl *mc,
return (uaudio_value2bsd(mc, val));
}
-void
+Static void
uaudio_ctl_set(struct uaudio_softc *sc, int which, struct mixerctl *mc,
int chan, int val)
{
@@ -2343,7 +2336,7 @@ uaudio_ctl_set(struct uaudio_softc *sc, int which, struct mixerctl *mc,
mc->wIndex, MIX_SIZE(mc->type), val);
}
-int
+Static int
uaudio_mixer_get_port(void *addr, mixer_ctrl_t *cp)
{
struct uaudio_softc *sc = addr;
@@ -2388,7 +2381,7 @@ uaudio_mixer_get_port(void *addr, mixer_ctrl_t *cp)
return (0);
}
-int
+Static int
uaudio_mixer_set_port(void *addr, mixer_ctrl_t *cp)
{
struct uaudio_softc *sc = addr;
@@ -2429,7 +2422,7 @@ uaudio_mixer_set_port(void *addr, mixer_ctrl_t *cp)
return (0);
}
-int
+Static int
uaudio_trigger_input(void *addr, void *start, void *end, int blksize,
void (*intr)(void *), void *arg,
struct audio_params *param)
@@ -2471,7 +2464,7 @@ uaudio_trigger_input(void *addr, void *start, void *end, int blksize,
return (0);
}
-int
+Static int
uaudio_trigger_output(void *addr, void *start, void *end, int blksize,
void (*intr)(void *), void *arg,
struct audio_params *param)
@@ -2514,7 +2507,7 @@ uaudio_trigger_output(void *addr, void *start, void *end, int blksize,
}
/* Set up a pipe for a channel. */
-usbd_status
+Static usbd_status
uaudio_chan_open(struct uaudio_softc *sc, struct chan *ch)
{
struct as_info *as = &sc->sc_alts[ch->altidx];
@@ -2553,7 +2546,7 @@ uaudio_chan_open(struct uaudio_softc *sc, struct chan *ch)
return err;
}
-void
+Static void
uaudio_chan_close(struct uaudio_softc *sc, struct chan *ch)
{
struct as_info *as = &sc->sc_alts[ch->altidx];
@@ -2574,7 +2567,7 @@ uaudio_chan_close(struct uaudio_softc *sc, struct chan *ch)
}
}
-usbd_status
+Static usbd_status
uaudio_chan_alloc_buffers(struct uaudio_softc *sc, struct chan *ch)
{
usbd_xfer_handle xfer;
@@ -2605,7 +2598,7 @@ bad:
return (USBD_NOMEM);
}
-void
+Static void
uaudio_chan_free_buffers(struct uaudio_softc *sc, struct chan *ch)
{
int i;
@@ -2615,7 +2608,7 @@ uaudio_chan_free_buffers(struct uaudio_softc *sc, struct chan *ch)
}
/* Called at splusb() */
-void
+Static void
uaudio_chan_ptransfer(struct chan *ch)
{
struct chanbuf *cb;
@@ -2680,7 +2673,7 @@ uaudio_chan_ptransfer(struct chan *ch)
(void)usbd_transfer(cb->xfer);
}
-void
+Static void
uaudio_chan_pintr(usbd_xfer_handle xfer, usbd_private_handle priv,
usbd_status status)
{
@@ -2719,7 +2712,7 @@ uaudio_chan_pintr(usbd_xfer_handle xfer, usbd_private_handle priv,
}
/* Called at splusb() */
-void
+Static void
uaudio_chan_rtransfer(struct chan *ch)
{
struct chanbuf *cb;
@@ -2764,7 +2757,7 @@ uaudio_chan_rtransfer(struct chan *ch)
(void)usbd_transfer(cb->xfer);
}
-void
+Static void
uaudio_chan_rintr(usbd_xfer_handle xfer, usbd_private_handle priv,
usbd_status status)
{
@@ -2822,7 +2815,7 @@ uaudio_chan_rintr(usbd_xfer_handle xfer, usbd_private_handle priv,
uaudio_chan_rtransfer(ch);
}
-void
+Static void
uaudio_chan_init(struct chan *ch, int altidx, const struct audio_params *param,
int maxpktsize)
{
@@ -2843,7 +2836,7 @@ uaudio_chan_init(struct chan *ch, int altidx, const struct audio_params *param,
ch->residue = 0;
}
-void
+Static void
uaudio_chan_set_param(struct chan *ch, u_char *start, u_char *end, int blksize)
{
ch->start = start;
@@ -2855,7 +2848,7 @@ uaudio_chan_set_param(struct chan *ch, u_char *start, u_char *end, int blksize)
ch->curchanbuf = 0;
}
-void
+Static void
uaudio_get_minmax_rates(int nalts, const struct as_info *alts,
const struct audio_params *p, int mode,
u_long *min, u_long *max)
@@ -2897,7 +2890,7 @@ uaudio_get_minmax_rates(int nalts, const struct as_info *alts,
}
}
-int
+Static int
uaudio_match_alt_sub(int nalts, const struct as_info *alts,
const struct audio_params *p, int mode, u_long rate)
{
@@ -2936,7 +2929,7 @@ uaudio_match_alt_sub(int nalts, const struct as_info *alts,
return -1;
}
-int
+Static int
uaudio_match_alt_chan(int nalts, const struct as_info *alts,
struct audio_params *p, int mode)
{
@@ -2980,7 +2973,7 @@ uaudio_match_alt_chan(int nalts, const struct as_info *alts,
return -1;
}
-int
+Static int
uaudio_match_alt(int nalts, const struct as_info *alts,
struct audio_params *p, int mode)
{
@@ -3004,7 +2997,7 @@ uaudio_match_alt(int nalts, const struct as_info *alts,
return uaudio_match_alt_chan(nalts, alts, p, mode);
}
-int
+Static int
uaudio_set_params(void *addr, int setmode, int usemode,
struct audio_params *play, struct audio_params *rec)
{
@@ -3193,7 +3186,7 @@ uaudio_set_params(void *addr, int setmode, int usemode,
return (0);
}
-usbd_status
+Static usbd_status
uaudio_set_speed(struct uaudio_softc *sc, int endpt, u_int speed)
{
usb_device_request_t req;