Add a new optional method, dev_ioctl, to the audio hardware driver interface.

It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
This commit is contained in:
augustss 2001-10-03 00:04:47 +00:00
parent 8972205779
commit 1339e88a86
37 changed files with 113 additions and 47 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: aucc.c,v 1.27 2001/05/08 06:09:30 is Exp $ */
/* $NetBSD: aucc.c,v 1.28 2001/10/03 00:04:47 augustss Exp $ */
/*
* Copyright (c) 1999 Bernardo Innocenti
@ -261,6 +261,9 @@ struct audio_hw_if sa_hw_if = {
NULL,
NULL,
aucc_get_props,
NULL,
NULL,
NULL,
};
/* autoconfig routines */

View File

@ -1,4 +1,4 @@
/* $NetBSD: repulse.c,v 1.1 2001/08/25 21:15:44 is Exp $ */
/* $NetBSD: repulse.c,v 1.2 2001/10/03 00:04:47 augustss Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -128,7 +128,7 @@ struct audio_hw_if rep_hw_if = {
rep_get_props,
/* trigger_output */ 0,
/* trigger_input */ 0,
/* dev_ioctl */ 0,
};
/* hardware registers */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lmcaudio.c,v 1.31 2001/07/28 18:12:45 chris Exp $ */
/* $NetBSD: lmcaudio.c,v 1.32 2001/10/03 00:04:48 augustss Exp $ */
/*
* Copyright (c) 1996, Danny C Tsen.
@ -160,6 +160,9 @@ struct audio_hw_if lmcaudio_hw_if = {
0,
0,
lmcaudio_get_props,
0,
0,
0,
};
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: vidcaudio.c,v 1.39 2001/07/28 18:12:45 chris Exp $ */
/* $NetBSD: vidcaudio.c,v 1.40 2001/10/03 00:04:48 augustss Exp $ */
/*
* Copyright (c) 1995 Melvin Tang-Richardson
@ -150,6 +150,9 @@ struct audio_hw_if vidcaudio_hw_if = {
0,
0,
vidcaudio_get_props,
0,
0,
0,
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: awacs.c,v 1.11 2001/06/19 12:02:55 simonb Exp $ */
/* $NetBSD: awacs.c,v 1.12 2001/10/03 00:04:48 augustss Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
@ -145,6 +145,7 @@ struct audio_hw_if awacs_hw_if = {
awacs_get_props,
awacs_trigger_output,
awacs_trigger_input,
NULL,
};
struct audio_device awacs_device = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: paud_isa.c,v 1.1 2000/12/06 23:42:34 matt Exp $ */
/* $NetBSD: paud_isa.c,v 1.2 2001/10/03 00:04:48 augustss Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -124,6 +124,7 @@ static struct audio_hw_if paud_hw_if = {
ad1848_isa_get_props,
ad1848_isa_trigger_output,
ad1848_isa_trigger_input,
NULL,
};
/* autoconfig routines */

View File

@ -1,4 +1,4 @@
/* $NetBSD: am7930_sparc.c,v 1.47 2000/07/09 20:57:45 pk Exp $ */
/* $NetBSD: am7930_sparc.c,v 1.48 2001/10/03 00:04:48 augustss Exp $ */
/*
* Copyright (c) 1995 Rolf Grossmann
@ -135,6 +135,9 @@ struct audio_hw_if sa_hw_if = {
0,
0,
am7930_get_props,
0,
0,
0,
};
/* autoconfig routines */

View File

@ -1,4 +1,4 @@
/* $NetBSD: audioamd.c,v 1.6 2000/07/09 20:57:45 pk Exp $ */
/* $NetBSD: audioamd.c,v 1.7 2001/10/03 00:04:48 augustss Exp $ */
/* NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp */
/*
@ -182,6 +182,9 @@ struct audio_hw_if sa_hw_if = {
0,
0,
am7930_get_props,
0,
0,
0,
};
struct audio_device audioamd_device = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: vs.c,v 1.7 2001/05/28 06:18:20 minoura Exp $ */
/* $NetBSD: vs.c,v 1.8 2001/10/03 00:04:49 augustss Exp $ */
/*
* Copyright (c) 2001 Tetsuya Isaki. All rights reserved.
@ -143,6 +143,8 @@ static struct audio_hw_if vs_hw_if = {
vs_trigger_output,
vs_trigger_input,
NULL,
};
static struct audio_device vs_device = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: audio.c,v 1.140 2001/10/02 23:31:54 augustss Exp $ */
/* $NetBSD: audio.c,v 1.141 2001/10/03 00:04:49 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -1670,8 +1670,12 @@ audio_ioctl(struct audio_softc *sc, u_long cmd, caddr_t addr, int flag,
break;
default:
DPRINTF(("audio_ioctl: unknown ioctl\n"));
error = EINVAL;
if (hw->dev_ioctl) {
error = hw->dev_ioctl(sc, cmd, addr, flag, p);
} else {
DPRINTF(("audio_ioctl: unknown ioctl\n"));
error = EINVAL;
}
break;
}
DPRINTF(("audio_ioctl(%lu,'%c',%lu) result %d\n",
@ -2887,7 +2891,11 @@ mixer_ioctl(struct audio_softc *sc, u_long cmd, caddr_t addr, int flag,
break;
default:
error = EINVAL;
if (hw->dev_ioctl) {
error = hw->dev_ioctl(sc, cmd, addr, flag, p);
} else {
error = EINVAL;
}
break;
}
DPRINTF(("mixer_ioctl(%lu,'%c',%lu) result %d\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: audio_if.h,v 1.36 2001/10/02 23:31:55 augustss Exp $ */
/* $NetBSD: audio_if.h,v 1.37 2001/10/03 00:04:49 augustss Exp $ */
/*
* Copyright (c) 1994 Havard Eidnes.
@ -122,6 +122,8 @@ struct audio_hw_if {
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_attach_args {

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs4231.c,v 1.4 2000/06/16 11:47:35 pk Exp $ */
/* $NetBSD: cs4231.c,v 1.5 2001/10/03 00:04:49 augustss Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -161,7 +161,8 @@ struct audio_hw_if audiocs_hw_if = {
0,
cs4231_get_props,
cs4231_trigger_output,
cs4231_trigger_input
cs4231_trigger_input,
NULL,
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: tms320av110.c,v 1.8 1999/02/16 23:34:13 is Exp $ */
/* $NetBSD: tms320av110.c,v 1.9 2001/10/03 00:04:50 augustss Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -102,7 +102,8 @@ struct audio_hw_if tav_audio_if = {
0 /* free */, /* optional */
0 /* round_buffersize */, /* optional */
0 /* mappage */, /* optional */
tav_get_props
tav_get_props,
0 /* dev_ioctl */ /* optional */
};
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: aria.c,v 1.9 2001/09/26 21:40:07 thorpej Exp $ */
/* $NetBSD: aria.c,v 1.10 2001/10/03 00:04:50 augustss Exp $ */
/*-
* Copyright (c) 1995, 1996, 1998 Roland C. Dowdeswell. All rights reserved.
@ -228,6 +228,9 @@ struct audio_hw_if aria_hw_if = {
NULL,
NULL,
aria_get_props,
NULL,
NULL,
NULL,
};
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: ess.c,v 1.53 2001/01/06 22:50:02 nathanw Exp $ */
/* $NetBSD: ess.c,v 1.54 2001/10/03 00:04:50 augustss Exp $ */
/*
* Copyright 1997
@ -231,6 +231,7 @@ struct audio_hw_if ess_1788_hw_if = {
ess_1788_get_props,
ess_audio1_trigger_output,
ess_audio1_trigger_input,
NULL,
};
struct audio_hw_if ess_1888_hw_if = {
@ -260,6 +261,7 @@ struct audio_hw_if ess_1888_hw_if = {
ess_1888_get_props,
ess_audio2_trigger_output,
ess_audio1_trigger_input,
NULL,
};
#ifdef AUDIO_DEBUG

View File

@ -1,4 +1,4 @@
/* $NetBSD: gus.c,v 1.71 2001/07/18 20:52:47 thorpej Exp $ */
/* $NetBSD: gus.c,v 1.72 2001/10/03 00:04:50 augustss Exp $ */
/*-
* Copyright (c) 1996, 1999 The NetBSD Foundation, Inc.
@ -613,6 +613,9 @@ struct audio_hw_if gus_hw_if = {
ad1848_isa_round_buffersize,
ad1848_isa_mappage,
gus_get_props,
NULL,
NULL,
NULL,
};
static struct audio_hw_if gusmax_hw_if = {
@ -648,6 +651,9 @@ static struct audio_hw_if gusmax_hw_if = {
ad1848_isa_round_buffersize,
ad1848_isa_mappage,
gusmax_get_props,
NULL,
NULL,
NULL,
};
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pas.c,v 1.49 2001/07/18 20:39:53 thorpej Exp $ */
/* $NetBSD: pas.c,v 1.50 2001/10/03 00:04:50 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -146,6 +146,7 @@ struct audio_hw_if pas_hw_if = {
sbdsp_get_props,
sbdsp_trigger_output,
sbdsp_trigger_input,
0,
};
/* The Address Translation code is used to convert I/O register addresses to

View File

@ -1,4 +1,4 @@
/* $NetBSD: pss.c,v 1.56 2001/07/18 20:39:53 thorpej Exp $ */
/* $NetBSD: pss.c,v 1.57 2001/10/03 00:04:51 augustss Exp $ */
/*
* Copyright (c) 1994 John Brezak
@ -239,6 +239,7 @@ struct audio_hw_if pss_audio_if = {
ad1848_isa_get_props,
ad1848_isa_trigger_output,
ad1848_isa_trigger_input,
NULL,
};
/* Interrupt translation for WSS config */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sb.c,v 1.70 2000/12/19 01:09:15 mjl Exp $ */
/* $NetBSD: sb.c,v 1.71 2001/10/03 00:04:51 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -110,6 +110,7 @@ struct audio_hw_if sb_hw_if = {
sbdsp_get_props,
sbdsp_trigger_output,
sbdsp_trigger_input,
0,
};
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: wss.c,v 1.57 1999/02/18 17:27:39 mycroft Exp $ */
/* $NetBSD: wss.c,v 1.58 2001/10/03 00:04:51 augustss Exp $ */
/*
* Copyright (c) 1994 John Brezak
@ -108,6 +108,7 @@ struct audio_hw_if wss_hw_if = {
ad1848_isa_get_props,
ad1848_isa_trigger_output,
ad1848_isa_trigger_input,
NULL,
};
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: ym.c,v 1.17 2000/11/26 11:08:59 takemura Exp $ */
/* $NetBSD: ym.c,v 1.18 2001/10/03 00:04:51 augustss Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -200,6 +200,7 @@ struct audio_hw_if ym_hw_if = {
ad1848_isa_get_props,
ad1848_isa_trigger_output,
ad1848_isa_trigger_input,
NULL,
};
static __inline int ym_read __P((struct ym_softc *, int));

View File

@ -1,4 +1,4 @@
/* $NetBSD: gus_isapnp.c,v 1.15 2000/02/07 22:07:32 thorpej Exp $ */
/* $NetBSD: gus_isapnp.c,v 1.16 2001/10/03 00:04:51 augustss Exp $ */
/*
* Copyright (c) 1997, 1999 The NetBSD Foundation, Inc.
@ -106,6 +106,9 @@ static struct audio_hw_if guspnp_hw_if = {
iw_round_buffersize,
iw_mappage,
iw_get_props,
NULL,
NULL,
NULL,
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: auich.c,v 1.3 2000/12/28 22:59:11 sommerfeld Exp $ */
/* $NetBSD: auich.c,v 1.4 2001/10/03 00:04:51 augustss Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -246,6 +246,7 @@ struct audio_hw_if auich_hw_if = {
auich_get_props,
auich_trigger_output,
auich_trigger_input,
NULL, /* dev_ioctl */
};
int auich_attach_codec(void *, struct ac97_codec_if *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: auvia.c,v 1.12 2001/08/04 22:15:56 jdolecek Exp $ */
/* $NetBSD: auvia.c,v 1.13 2001/10/03 00:04:51 augustss Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -180,6 +180,7 @@ struct audio_hw_if auvia_hw_if = {
auvia_get_props,
auvia_trigger_output,
auvia_trigger_input,
NULL, /* dev_ioctl */
};
int auvia_attach_codec(void *, struct ac97_codec_if *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmpci.c,v 1.8 2001/09/04 13:36:07 itohy Exp $ */
/* $NetBSD: cmpci.c,v 1.9 2001/10/03 00:04:51 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -176,7 +176,8 @@ static struct audio_hw_if cmpci_hw_if = {
cmpci_mappage, /* mappage */
cmpci_get_props, /* get_props */
cmpci_trigger_output, /* trigger_output */
cmpci_trigger_input /* trigger_input */
cmpci_trigger_input, /* trigger_input */
NULL, /* dev_ioctl */
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs4280.c,v 1.16 2001/04/18 01:35:06 tacha Exp $ */
/* $NetBSD: cs4280.c,v 1.17 2001/10/03 00:04:52 augustss Exp $ */
/*
* Copyright (c) 1999, 2000 Tatoku Ogaito. All rights reserved.
@ -148,6 +148,7 @@ struct audio_hw_if cs4280_hw_if = {
cs428x_get_props,
cs4280_trigger_output,
cs4280_trigger_input,
NULL,
};
#if NMIDI > 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs4281.c,v 1.5 2001/09/16 16:34:38 wiz Exp $ */
/* $NetBSD: cs4281.c,v 1.6 2001/10/03 00:04:52 augustss Exp $ */
/*
* Copyright (c) 2000 Tatoku Ogaito. All rights reserved.
@ -129,6 +129,7 @@ struct audio_hw_if cs4281_hw_if = {
cs428x_get_props,
cs4281_trigger_output,
cs4281_trigger_input,
NULL,
};
#if NMIDI > 0 && 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: eap.c,v 1.46 2001/09/03 15:07:37 reinoud Exp $ */
/* $NetBSD: eap.c,v 1.47 2001/10/03 00:04:52 augustss Exp $ */
/* $OpenBSD: eap.c,v 1.6 1999/10/05 19:24:42 csapuntz Exp $ */
/*
@ -230,6 +230,7 @@ struct audio_hw_if eap1370_hw_if = {
eap_get_props,
eap_trigger_output,
eap_trigger_input,
NULL,
};
struct audio_hw_if eap1371_hw_if = {
@ -259,6 +260,7 @@ struct audio_hw_if eap1371_hw_if = {
eap_get_props,
eap_trigger_output,
eap_trigger_input,
NULL,
};
#if NMIDI > 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: esm.c,v 1.10 2001/04/25 03:06:11 simonb Exp $ */
/* $NetBSD: esm.c,v 1.11 2001/10/03 00:04:52 augustss Exp $ */
/*-
* Copyright (c) 2000, 2001 Rene Hexel <rh@netbsd.org>
@ -171,7 +171,8 @@ struct audio_hw_if esm_hw_if = {
esm_mappage,
esm_get_props,
esm_trigger_output,
esm_trigger_input
esm_trigger_input,
NULL,
};
struct audio_device esm_device = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: eso.c,v 1.21 2001/07/19 17:19:40 kleink Exp $ */
/* $NetBSD: eso.c,v 1.22 2001/10/03 00:04:52 augustss Exp $ */
/*
* Copyright (c) 1999, 2000 Klaus J. Klein
@ -139,7 +139,8 @@ static struct audio_hw_if eso_hw_if = {
eso_mappage,
eso_get_props,
eso_trigger_output,
eso_trigger_input
eso_trigger_input,
NULL, /* dev_ioctl */
};
static const char * const eso_rev2model[] = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: fms.c,v 1.9 2000/12/28 22:59:12 sommerfeld Exp $ */
/* $NetBSD: fms.c,v 1.10 2001/10/03 00:04:52 augustss Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -141,6 +141,7 @@ struct audio_hw_if fms_hw_if = {
fms_get_props,
fms_trigger_output,
fms_trigger_input,
NULL,
};
int fms_attach_codec __P((void *, struct ac97_codec_if *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: neo.c,v 1.9 2001/09/04 07:12:12 thorpej Exp $ */
/* $NetBSD: neo.c,v 1.10 2001/10/03 00:04:52 augustss Exp $ */
/*
* Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
@ -258,6 +258,7 @@ struct audio_hw_if neo_hw_if = {
neo_get_props,
neo_trigger_output,
neo_trigger_input,
NULL,
};
/* -------------------------------------------------------------------- */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sv.c,v 1.13 2001/07/19 17:47:18 kleink Exp $ */
/* $NetBSD: sv.c,v 1.14 2001/10/03 00:04:52 augustss Exp $ */
/* $OpenBSD: sv.c,v 1.2 1998/07/13 01:50:15 csapuntz Exp $ */
/*
@ -185,6 +185,7 @@ struct audio_hw_if sv_hw_if = {
sv_get_props,
sv_trigger_output,
sv_trigger_input,
NULL,
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: yds.c,v 1.6 2001/07/07 16:46:35 thorpej Exp $ */
/* $NetBSD: yds.c,v 1.7 2001/10/03 00:04:52 augustss Exp $ */
/*
* Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
@ -221,6 +221,7 @@ static struct audio_hw_if yds_hw_if = {
yds_get_props,
yds_trigger_output,
yds_trigger_input,
NULL,
};
struct audio_device yds_device = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: esl.c,v 1.3 2001/09/29 19:30:29 augustss Exp $ */
/* $NetBSD: esl.c,v 1.4 2001/10/03 00:04:53 augustss Exp $ */
/*
* Copyright (c) 2001 Jared D. McNeill <jmcneill@invisible.yi.org>
@ -132,6 +132,7 @@ struct audio_hw_if esl_hw_if = {
esl_get_props,
esl_trigger_output,
NULL
NULL,
};
static char *eslmodel[] = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: bba.c,v 1.13 2001/07/19 16:43:44 thorpej Exp $ */
/* $NetBSD: bba.c,v 1.14 2001/10/03 00:04:53 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -171,7 +171,8 @@ struct audio_hw_if sa_hw_if = {
bba_mappage,
bba_get_props,
bba_trigger_output, /* md */
bba_trigger_input /* md */
bba_trigger_input, /* md */
0,
};
struct audio_device bba_device = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: uaudio.c,v 1.42 2001/05/12 19:18:57 christos Exp $ */
/* $NetBSD: uaudio.c,v 1.43 2001/10/03 00:04:53 augustss Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -303,6 +303,7 @@ Static struct audio_hw_if uaudio_hw_if = {
uaudio_get_props,
uaudio_trigger_output,
uaudio_trigger_input,
NULL,
};
Static struct audio_device uaudio_device = {