Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Increase the number of frequencies in the usb_au...
details: https://anonhg.NetBSD.org/src/rev/b36bd1a01e36
branches: trunk
changeset: 779312:b36bd1a01e36
user: jdc <jdc%NetBSD.org@localhost>
date: Fri May 18 07:52:54 2012 +0000
description:
Increase the number of frequencies in the usb_audio_streaming_type1_descriptor
to be the same number that we support elsewhere (AUFMT_MAX_FREQUENCIES).
Set frequency_type to be AUFMT_MAX_FREQUENCIES in the case where a uaudio
device reports more frequencies than we handle.
Fixes a crash in uaudio_chan_ptransfer() because we read uninitialised data
in uaudio_identify_as().
diffstat:
sys/dev/usb/uaudio.c | 12 ++++--------
sys/dev/usb/uaudioreg.h | 4 ++--
sys/dev/usb/umidi.c | 5 +++--
sys/dev/usb/umidi_quirks.c | 5 +++--
4 files changed, 12 insertions(+), 14 deletions(-)
diffs (103 lines):
diff -r 1da30c6811d8 -r b36bd1a01e36 sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c Fri May 18 02:28:16 2012 +0000
+++ b/sys/dev/usb/uaudio.c Fri May 18 07:52:54 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uaudio.c,v 1.131 2012/04/22 01:31:48 jakllsch Exp $ */
+/* $NetBSD: uaudio.c,v 1.132 2012/05/18 07:52:54 jdc Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.131 2012/04/22 01:31:48 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.132 2012/05/18 07:52:54 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1847,12 +1847,8 @@
aprint_error("%s: please increase "
"AUFMT_MAX_FREQUENCIES to %d\n",
__func__, t1desc->bSamFreqType);
- break;
- }
- if (j >= 2) {
- aprint_error("%s: too much tSamFreq: "
- "%d\n",
- __func__, t1desc->bSamFreqType);
+ auf->frequency_type =
+ AUFMT_MAX_FREQUENCIES;
break;
}
auf->frequency[j] = UA_GETSAMP(t1desc, j);
diff -r 1da30c6811d8 -r b36bd1a01e36 sys/dev/usb/uaudioreg.h
--- a/sys/dev/usb/uaudioreg.h Fri May 18 02:28:16 2012 +0000
+++ b/sys/dev/usb/uaudioreg.h Fri May 18 07:52:54 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uaudioreg.h,v 1.15 2008/04/28 20:23:59 martin Exp $ */
+/* $NetBSD: uaudioreg.h,v 1.16 2012/05/18 07:52:54 jdc Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -113,7 +113,7 @@
uByte bBitResolution;
uByte bSamFreqType;
#define UA_SAMP_CONTNUOUS 0
- uByte tSamFreq[3*2]; /* room for low and high */
+ uByte tSamFreq[3*AUFMT_MAX_FREQUENCIES];
#define UA_GETSAMP(p, n) ((p)->tSamFreq[(n)*3+0] | ((p)->tSamFreq[(n)*3+1] << 8) | ((p)->tSamFreq[(n)*3+2] << 16))
#define UA_SAMP_LO(p) UA_GETSAMP(p, 0)
#define UA_SAMP_HI(p) UA_GETSAMP(p, 1)
diff -r 1da30c6811d8 -r b36bd1a01e36 sys/dev/usb/umidi.c
--- a/sys/dev/usb/umidi.c Fri May 18 02:28:16 2012 +0000
+++ b/sys/dev/usb/umidi.c Fri May 18 07:52:54 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umidi.c,v 1.61 2012/03/11 01:06:07 mrg Exp $ */
+/* $NetBSD: umidi.c,v 1.62 2012/05/18 07:52:54 jdc Exp $ */
/*
* Copyright (c) 2001, 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.61 2012/03/11 01:06:07 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.62 2012/05/18 07:52:54 jdc Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -52,6 +52,7 @@
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
+#include <dev/auconv.h>
#include <dev/usb/usbdevs.h>
#include <dev/usb/uaudioreg.h>
#include <dev/usb/umidireg.h>
diff -r 1da30c6811d8 -r b36bd1a01e36 sys/dev/usb/umidi_quirks.c
--- a/sys/dev/usb/umidi_quirks.c Fri May 18 02:28:16 2012 +0000
+++ b/sys/dev/usb/umidi_quirks.c Fri May 18 07:52:54 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umidi_quirks.c,v 1.17 2012/02/11 05:28:30 plunky Exp $ */
+/* $NetBSD: umidi_quirks.c,v 1.18 2012/05/18 07:52:54 jdc Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umidi_quirks.c,v 1.17 2012/02/11 05:28:30 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi_quirks.c,v 1.18 2012/05/18 07:52:54 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -49,6 +49,7 @@
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
+#include <dev/auconv.h>
#include <dev/usb/usbdevs.h>
#include <dev/usb/uaudioreg.h>
#include <dev/usb/umidireg.h>
Home |
Main Index |
Thread Index |
Old Index