PERFORCE change 172073 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Tue Dec 22 06:31:23 UTC 2009
http://p4web.freebsd.org/chv.cgi?CH=172073
Change 172073 by trasz at trasz_victim on 2009/12/22 06:30:37
IFC.
Affected files ...
.. //depot/projects/soc2008/trasz_nfs4acl/etc/rc.subr#9 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdio/sprintf.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdio/sscanf.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdio/vsscanf.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdtime/localtime.c#6 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/dumpfs/dumpfs.c#6 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/mount/mntopts.h#4 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/mount/mount.8#11 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/mount/mount.c#12 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/tunefs/tunefs.8#5 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/tunefs/tunefs.c#3 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ahci/ahci.c#8 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ata/chipsets/ata-amd.c#4 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/auxio/auxio.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/if_ndis/if_ndis_usb.c#8 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/usb/uaudio.c#12 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ste/if_ste.c#6 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/uart/uart_bus_acpi.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/controller/ehci_pci.c#9 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/controller/ohci_pci.c#7 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/serial/uftdi.c#9 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/usbdevs#36 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/raid3/g_raid3.c#3 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/raid3/g_raid3.h#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/central/central.c#4 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/fhc/fhc.c#4 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/pci/apb.c#4 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/pci/ofw_pcib.c#4 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/sbus/sbus.c#5 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/sparc64/nexus.c#4 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/tools/regression/acltools/02.t#7 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/usr.sbin/newsyslog/newsyslog.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/usr.sbin/powerd/powerd.8#5 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/usr.sbin/service/service.8#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/usr.sbin/service/service.sh#2 integrate
Differences ...
==== //depot/projects/soc2008/trasz_nfs4acl/etc/rc.subr#9 (text+ko) ====
@@ -1,5 +1,5 @@
# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $
-# $FreeBSD: src/etc/rc.subr,v 1.94 2009/10/18 19:51:06 ed Exp $
+# $FreeBSD: src/etc/rc.subr,v 1.95 2009/12/21 22:16:07 jilles Exp $
#
# Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -390,7 +390,7 @@
_list=$_nlist
echo -n ${_prefix:-"Waiting for PIDS: "}$_list
_prefix=", "
- sleep 2
+ pwait $_list 2>/dev/null || sleep 2
done
if [ -n "$_prefix" ]; then
echo "."
==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdio/sprintf.c#2 (text+ko) ====
@@ -34,7 +34,7 @@
static char sccsid[] = "@(#)sprintf.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/sprintf.c,v 1.16 2008/04/17 22:17:54 jhb Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/sprintf.c,v 1.17 2009/12/21 19:59:38 delphij Exp $");
#include <stdio.h>
#include <stdarg.h>
@@ -46,17 +46,9 @@
{
int ret;
va_list ap;
- FILE f;
- f._file = -1;
- f._flags = __SWR | __SSTR;
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._w = INT_MAX;
- f._orientation = 0;
- memset(&f._mbstate, 0, sizeof(mbstate_t));
va_start(ap, fmt);
- ret = __vfprintf(&f, fmt, ap);
+ ret = vsprintf(str, fmt, ap);
va_end(ap);
- *f._p = 0;
return (ret);
}
==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdio/sscanf.c#2 (text+ko) ====
@@ -34,44 +34,21 @@
static char sccsid[] = "@(#)sscanf.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/sscanf.c,v 1.13 2008/04/17 22:17:54 jhb Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/sscanf.c,v 1.14 2009/12/21 19:56:03 delphij Exp $");
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "local.h"
-static int eofread(void *, char *, int);
-
-/* ARGSUSED */
-static int
-eofread(cookie, buf, len)
- void *cookie;
- char *buf;
- int len;
-{
-
- return (0);
-}
-
int
sscanf(const char * __restrict str, char const * __restrict fmt, ...)
{
int ret;
va_list ap;
- FILE f;
- f._file = -1;
- f._flags = __SRD;
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._r = strlen(str);
- f._read = eofread;
- f._ub._base = NULL;
- f._lb._base = NULL;
- f._orientation = 0;
- memset(&f._mbstate, 0, sizeof(mbstate_t));
va_start(ap, fmt);
- ret = __svfscanf(&f, fmt, ap);
+ ret = vsscanf(str, fmt, ap);
va_end(ap);
return (ret);
}
==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdio/vsscanf.c#2 (text+ko) ====
@@ -34,7 +34,7 @@
static char sccsid[] = "@(#)vsscanf.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vsscanf.c,v 1.14 2008/04/17 22:17:54 jhb Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vsscanf.c,v 1.15 2009/12/21 19:55:05 delphij Exp $");
#include <stdio.h>
#include <string.h>
@@ -45,20 +45,15 @@
/* ARGSUSED */
static int
-eofread(cookie, buf, len)
- void *cookie;
- char *buf;
- int len;
+eofread(void *cookie, char *buf, int len)
{
return (0);
}
int
-vsscanf(str, fmt, ap)
- const char * __restrict str;
- const char * __restrict fmt;
- __va_list ap;
+vsscanf(const char * __restrict str, const char * __restrict fmt,
+ __va_list ap)
{
FILE f;
==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdtime/localtime.c#6 (text+ko) ====
@@ -9,7 +9,7 @@
static char elsieid[] __unused = "@(#)localtime.c 8.9";
#endif /* !defined NOID */
#endif /* !defined lint */
-__FBSDID("$FreeBSD: src/lib/libc/stdtime/localtime.c,v 1.47 2009/11/20 19:21:33 jhb Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdtime/localtime.c,v 1.48 2009/12/21 19:43:23 jhb Exp $");
/*
** Leap second handling from Bradley White.
@@ -237,6 +237,9 @@
static int lcl_is_set;
static pthread_once_t gmt_once = PTHREAD_ONCE_INIT;
static pthread_rwlock_t lcl_rwlock = PTHREAD_RWLOCK_INITIALIZER;
+static pthread_once_t localtime_once = PTHREAD_ONCE_INIT;
+static pthread_key_t localtime_key;
+static int localtime_key_error;
char * tzname[2] = {
wildabbr,
@@ -1406,27 +1409,24 @@
return result;
}
+static void
+localtime_key_init(void)
+{
+
+ localtime_key_error = _pthread_key_create(&localtime_key, free);
+}
+
struct tm *
localtime(timep)
const time_t * const timep;
{
- static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_key_t localtime_key = -1;
struct tm *p_tm;
- int r;
if (__isthreaded != 0) {
- if (localtime_key < 0) {
- _pthread_mutex_lock(&localtime_mutex);
- if (localtime_key < 0) {
- if ((r = _pthread_key_create(&localtime_key,
- free)) != 0) {
- _pthread_mutex_unlock(&localtime_mutex);
- errno = r;
- return(NULL);
- }
- }
- _pthread_mutex_unlock(&localtime_mutex);
+ _once(&localtime_once, localtime_key_init);
+ if (localtime_key_error != 0) {
+ errno = localtime_key_error;
+ return(NULL);
}
p_tm = _pthread_getspecific(localtime_key);
if (p_tm == NULL) {
==== //depot/projects/soc2008/trasz_nfs4acl/sbin/dumpfs/dumpfs.c#6 (text+ko) ====
@@ -53,7 +53,7 @@
static char sccsid[] = "@(#)dumpfs.c 8.5 (Berkeley) 4/29/95";
#endif
static const char rcsid[] =
- "$FreeBSD: src/sbin/dumpfs/dumpfs.c,v 1.47 2009/10/19 14:04:19 ru Exp $";
+ "$FreeBSD: src/sbin/dumpfs/dumpfs.c,v 1.48 2009/12/21 19:39:10 trasz Exp $";
#endif /* not lint */
#include <sys/param.h>
==== //depot/projects/soc2008/trasz_nfs4acl/sbin/mount/mntopts.h#4 (text+ko) ====
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*
* @(#)mntopts.h 8.7 (Berkeley) 3/29/95
- * $FreeBSD: src/sbin/mount/mntopts.h,v 1.29 2005/12/02 03:55:02 rodrigc Exp $
+ * $FreeBSD: src/sbin/mount/mntopts.h,v 1.30 2009/12/21 19:39:10 trasz Exp $
*/
struct mntopt {
==== //depot/projects/soc2008/trasz_nfs4acl/sbin/mount/mount.8#11 (text+ko) ====
@@ -26,7 +26,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mount.8 8.8 (Berkeley) 6/16/94
-.\" $FreeBSD: src/sbin/mount/mount.8,v 1.92 2009/11/11 12:55:58 trasz Exp $
+.\" $FreeBSD: src/sbin/mount/mount.8,v 1.93 2009/12/21 19:39:10 trasz Exp $
.\"
.Dd March 11, 2008
.Dt MOUNT 8
==== //depot/projects/soc2008/trasz_nfs4acl/sbin/mount/mount.c#12 (text+ko) ====
@@ -37,7 +37,7 @@
#endif /* not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/mount/mount.c,v 1.108 2009/09/14 21:08:22 pjd Exp $");
+__FBSDID("$FreeBSD: src/sbin/mount/mount.c,v 1.109 2009/12/21 19:39:10 trasz Exp $");
#include <sys/param.h>
#include <sys/mount.h>
==== //depot/projects/soc2008/trasz_nfs4acl/sbin/tunefs/tunefs.8#5 (text+ko) ====
@@ -26,7 +26,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93
-.\" $FreeBSD: src/sbin/tunefs/tunefs.8,v 1.41 2009/10/21 10:15:26 remko Exp $
+.\" $FreeBSD: src/sbin/tunefs/tunefs.8,v 1.42 2009/12/21 19:39:10 trasz Exp $
.\"
.Dd October 21, 2009
.Dt TUNEFS 8
==== //depot/projects/soc2008/trasz_nfs4acl/sbin/tunefs/tunefs.c#3 (text+ko) ====
@@ -39,7 +39,7 @@
#endif /* not lint */
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/tunefs/tunefs.c,v 1.43 2006/10/31 21:52:28 pjd Exp $");
+__FBSDID("$FreeBSD: src/sbin/tunefs/tunefs.c,v 1.44 2009/12/21 19:39:10 trasz Exp $");
/*
* tunefs: change layout parameters to an existing file system.
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ahci/ahci.c#8 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ahci/ahci.c,v 1.19 2009/12/06 23:56:54 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ahci/ahci.c,v 1.20 2009/12/21 21:27:56 mav Exp $");
#include <sys/param.h>
#include <sys/module.h>
@@ -596,20 +596,18 @@
unit = irq->r_irq_rid - 1;
is = ATA_INL(ctlr->r_mem, AHCI_IS);
}
+ /* Some controllers have edge triggered IS. */
+ if (ctlr->quirks & AHCI_Q_EDGEIS)
+ ATA_OUTL(ctlr->r_mem, AHCI_IS, is);
for (; unit < ctlr->channels; unit++) {
if ((is & (1 << unit)) != 0 &&
(arg = ctlr->interrupt[unit].argument)) {
- if (ctlr->quirks & AHCI_Q_EDGEIS) {
- /* Some controller have edge triggered IS. */
- ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
ctlr->interrupt[unit].function(arg);
- } else {
- /* but AHCI declares level triggered IS. */
- ctlr->interrupt[unit].function(arg);
- ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
- }
}
}
+ /* AHCI declares level triggered IS. */
+ if (!(ctlr->quirks & AHCI_Q_EDGEIS))
+ ATA_OUTL(ctlr->r_mem, AHCI_IS, is);
}
/*
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ata/chipsets/ata-amd.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/chipsets/ata-amd.c,v 1.4 2009/12/14 21:11:50 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/chipsets/ata-amd.c,v 1.5 2009/12/21 21:47:33 mav Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -61,7 +61,7 @@
#define AMD_CABLE 0x02
/*
- * American Micro Devices (AMD) chipset support functions
+ * Advanced Micro Devices (AMD) chipset support functions
*/
static int
ata_amd_probe(device_t dev)
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/auxio/auxio.c#2 (text+ko) ====
@@ -56,12 +56,12 @@
*/
/*
- * AUXIO registers support on the sbus & ebus2, used for the floppy driver
+ * AUXIO registers support on the SBus & EBus2, used for the floppy driver
* and to control the system LED, for the BLINK option.
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/auxio/auxio.c,v 1.5 2006/01/26 19:04:18 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/auxio/auxio.c,v 1.6 2009/12/21 21:29:16 marius Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -85,8 +85,8 @@
#include <dev/auxio/auxioreg.h>
/*
- * on sun4u, auxio exists with one register (LED) on the sbus, and 5
- * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
+ * On sun4u, auxio exists with one register (LED) on the SBus, and 5
+ * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI
* OSCILLATOR, and TEMP SENSE.
*/
@@ -142,6 +142,7 @@
static devclass_t auxio_devclass;
DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0);
+MODULE_DEPEND(auxio, sbus, 1, 1, 1);
/* EBus */
static device_method_t auxio_ebus_methods[] = {
@@ -158,6 +159,7 @@
};
DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0);
+MODULE_DEPEND(auxio, ebus, 1, 1, 1);
MODULE_VERSION(auxio, 1);
#define AUXIO_LOCK_INIT(sc) \
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/if_ndis/if_ndis_usb.c#8 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_usb.c,v 1.20 2009/11/02 11:07:42 rpaulo Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_usb.c,v 1.21 2009/12/22 02:04:16 thompsa Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -165,6 +165,7 @@
driver_object *drv;
int devidx = 0;
+ device_set_usb_desc(self);
db = uaa->driver_ivar;
sc = (struct ndis_softc *)dummy;
sc->ndis_dev = self;
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/usb/uaudio.c#12 (text+ko) ====
@@ -1,5 +1,5 @@
/* $NetBSD: uaudio.c,v 1.91 2004/11/05 17:46:14 kent Exp $ */
-/* $FreeBSD: src/sys/dev/sound/usb/uaudio.c,v 1.59 2009/11/22 21:26:27 thompsa Exp $ */
+/* $FreeBSD: src/sys/dev/sound/usb/uaudio.c,v 1.60 2009/12/22 02:11:37 thompsa Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -87,20 +87,27 @@
#include <dev/sound/chip.h>
#include "feeder_if.h"
-static int uaudio_default_rate = 96000;
+static int uaudio_default_rate = 0; /* use rate list */
static int uaudio_default_bits = 32;
-static int uaudio_default_channels = 2;
+static int uaudio_default_channels = 0; /* use default */
#if USB_DEBUG
static int uaudio_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio");
+
SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RW,
&uaudio_debug, 0, "uaudio debug level");
+
+TUNABLE_INT("hw.usb.uaudio.default_rate", &uaudio_default_rate);
SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RW,
&uaudio_default_rate, 0, "uaudio default sample rate");
+
+TUNABLE_INT("hw.usb.uaudio.default_bits", &uaudio_default_bits);
SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RW,
&uaudio_default_bits, 0, "uaudio default sample bits");
+
+TUNABLE_INT("hw.usb.uaudio.default_channels", &uaudio_default_channels);
SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RW,
&uaudio_default_channels, 0, "uaudio default sample channels");
#endif
@@ -169,10 +176,16 @@
uint32_t intr_size; /* in bytes */
uint32_t intr_frames; /* in units */
uint32_t sample_rate;
+ uint32_t frames_per_second;
+ uint32_t sample_rem;
+ uint32_t sample_curr;
+
uint32_t format;
uint32_t pcm_format[2];
- uint16_t bytes_per_frame;
+ uint16_t bytes_per_frame[2];
+
+ uint16_t sample_size;
uint8_t valid;
uint8_t iface_index;
@@ -330,7 +343,7 @@
static usb_callback_t umidi_bulk_write_callback;
static void uaudio_chan_fill_info_sub(struct uaudio_softc *,
- struct usb_device *, uint32_t, uint16_t, uint8_t, uint8_t);
+ struct usb_device *, uint32_t, uint8_t, uint8_t);
static void uaudio_chan_fill_info(struct uaudio_softc *,
struct usb_device *);
static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *,
@@ -787,8 +800,7 @@
static void
uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
- uint32_t rate, uint16_t fps, uint8_t channels,
- uint8_t bit_resolution)
+ uint32_t rate, uint8_t channels, uint8_t bit_resolution)
{
struct usb_descriptor *desc = NULL;
const struct usb2_audio_streaming_interface_descriptor *asid = NULL;
@@ -811,7 +823,6 @@
uint8_t bBitResolution;
uint8_t x;
uint8_t audio_if = 0;
- uint8_t sample_size;
while ((desc = usb_desc_foreach(cd, desc))) {
@@ -1040,16 +1051,10 @@
chan->usb2_cfg =
uaudio_cfg_play;
- sample_size = ((
+ chan->sample_size = ((
UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) *
chan->p_asf1d->bBitResolution) / 8);
- /*
- * NOTE: "chan->bytes_per_frame"
- * should not be zero!
- */
- chan->bytes_per_frame = ((rate / fps) * sample_size);
-
if (sc->sc_sndstat_valid) {
sbuf_printf(&sc->sc_sndstat, "\n\t"
"mode %d.%d:(%s) %dch, %d/%dbit, %s, %dHz",
@@ -1067,12 +1072,32 @@
}
}
+/* This structure defines all the supported rates. */
+
+static const uint32_t uaudio_rate_list[] = {
+ 96000,
+ 88000,
+ 80000,
+ 72000,
+ 64000,
+ 56000,
+ 48000,
+ 44100,
+ 40000,
+ 32000,
+ 24000,
+ 22050,
+ 16000,
+ 11025,
+ 8000,
+ 0
+};
+
static void
uaudio_chan_fill_info(struct uaudio_softc *sc, struct usb_device *udev)
{
uint32_t rate = uaudio_default_rate;
- uint32_t z;
- uint16_t fps = usbd_get_isoc_fps(udev);
+ uint8_t z;
uint8_t bits = uaudio_default_bits;
uint8_t y;
uint8_t channels = uaudio_default_channels;
@@ -1083,14 +1108,24 @@
/* set a valid value */
bits = 32;
}
- rate -= (rate % fps);
- if ((rate == 0) || (rate > 192000)) {
- /* set a valid value */
- rate = 192000 - (192000 % fps);
- }
- if ((channels == 0) || (channels > 2)) {
- /* set a valid value */
- channels = 2;
+ if (channels == 0) {
+ switch (usbd_get_speed(udev)) {
+ case USB_SPEED_LOW:
+ case USB_SPEED_FULL:
+ /*
+ * Due to high bandwidth usage and problems
+ * with HIGH-speed split transactions we
+ * disable surround setups on FULL-speed USB
+ * by default
+ */
+ channels = 2;
+ break;
+ default:
+ channels = 16;
+ break;
+ }
+ } else if (channels > 16) {
+ channels = 16;
}
if (sbuf_new(&sc->sc_sndstat, NULL, 4096, SBUF_AUTOEXTEND)) {
sc->sc_sndstat_valid = 1;
@@ -1099,8 +1134,14 @@
for (x = channels; x; x--) {
for (y = bits; y; y -= 8) {
- for (z = rate; z; z -= fps) {
- uaudio_chan_fill_info_sub(sc, udev, z, fps, x, y);
+
+ /* try user defined rate, if any */
+ if (rate != 0)
+ uaudio_chan_fill_info_sub(sc, udev, rate, x, y);
+
+ /* try find a matching rate, if any */
+ for (z = 0; uaudio_rate_list[z]; z++) {
+ uaudio_chan_fill_info_sub(sc, udev, uaudio_rate_list[z], x, y);
if (sc->sc_rec_chan.valid &&
sc->sc_play_chan.valid) {
@@ -1116,19 +1157,7 @@
}
}
-/*
- * The following function sets up data size and block count for the
- * next audio transfer.
- */
static void
-uaudio_setup_blockcount(struct uaudio_chan *ch,
- uint32_t *total, uint32_t *blockcount)
-{
- *total = ch->intr_size;
- *blockcount = ch->intr_frames;
-}
-
-static void
uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error)
{
struct uaudio_chan *ch = usbd_xfer_softc(xfer);
@@ -1137,12 +1166,11 @@
uint32_t blockcount;
uint32_t n;
uint32_t offset;
- int actlen, sumlen;
+ int actlen;
+ int sumlen;
usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL);
- uaudio_setup_blockcount(ch, &total, &blockcount);
-
if (ch->end == ch->start) {
DPRINTF("no buffer!\n");
return;
@@ -1153,22 +1181,39 @@
tr_transferred:
if (actlen < sumlen) {
DPRINTF("short transfer, "
- "%d of %d bytes\n", actlen, total);
+ "%d of %d bytes\n", actlen, sumlen);
}
chn_intr(ch->pcm_ch);
case USB_ST_SETUP:
- if (ch->bytes_per_frame > usbd_xfer_max_framelen(xfer)) {
+ if (ch->bytes_per_frame[1] > usbd_xfer_max_framelen(xfer)) {
DPRINTF("bytes per transfer, %d, "
"exceeds maximum, %d!\n",
- ch->bytes_per_frame,
+ ch->bytes_per_frame[1],
usbd_xfer_max_framelen(xfer));
break;
}
- /* setup frame length */
+
+ blockcount = ch->intr_frames;
+
+ /* setup number of frames */
usbd_xfer_set_frames(xfer, blockcount);
- for (n = 0; n != blockcount; n++)
- usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame);
+
+ /* reset total length */
+ total = 0;
+
+ /* setup frame lengths */
+ for (n = 0; n != blockcount; n++) {
+ ch->sample_curr += ch->sample_rem;
+ if (ch->sample_curr >= ch->frames_per_second) {
+ ch->sample_curr -= ch->frames_per_second;
+ usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame[1]);
+ total += ch->bytes_per_frame[1];
+ } else {
+ usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame[0]);
+ total += ch->bytes_per_frame[0];
+ }
+ }
DPRINTFN(6, "transfer %d bytes\n", total);
@@ -1210,7 +1255,6 @@
struct usb_page_cache *pc;
uint32_t n;
uint32_t m;
- uint32_t total;
uint32_t blockcount;
uint32_t offset0;
uint32_t offset1;
@@ -1222,8 +1266,6 @@
usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes);
mfl = usbd_xfer_max_framelen(xfer);
- uaudio_setup_blockcount(ch, &total, &blockcount);
-
if (ch->end == ch->start) {
DPRINTF("no buffer!\n");
return;
@@ -1231,12 +1273,8 @@
switch (USB_GET_STATE(xfer)) {
case USB_ST_TRANSFERRED:
- if (actlen < total) {
- DPRINTF("short transfer, "
- "%d of %d bytes\n", actlen, total);
- } else {
- DPRINTFN(6, "transferred %d bytes\n", actlen);
- }
+
+ DPRINTFN(6, "transferred %d bytes\n", actlen);
offset0 = 0;
pc = usbd_xfer_get_frame(xfer, 0);
@@ -1271,6 +1309,8 @@
case USB_ST_SETUP:
tr_setup:
+ blockcount = ch->intr_frames;
+
usbd_xfer_set_frames(xfer, blockcount);
for (n = 0; n < blockcount; n++) {
usbd_xfer_set_frame_len(xfer, n, mfl);
@@ -1295,6 +1335,8 @@
&sc->sc_play_chan : &sc->sc_rec_chan);
uint32_t buf_size;
uint32_t frames;
+ uint32_t format;
+ uint16_t fps;
uint8_t endpoint;
uint8_t blocks;
uint8_t iface_index;
@@ -1302,7 +1344,9 @@
uint8_t fps_shift;
usb_error_t err;
- if (usbd_get_isoc_fps(sc->sc_udev) < 8000) {
+ fps = usbd_get_isoc_fps(sc->sc_udev);
+
+ if (fps < 8000) {
/* FULL speed USB */
frames = 8;
} else {
@@ -1310,10 +1354,6 @@
frames = UAUDIO_NFRAMES;
}
- /* compute required buffer size */
-
- buf_size = (ch->bytes_per_frame * frames);
-
/* setup play/record format */
ch->pcm_cap.fmtlist = ch->pcm_format;
@@ -1329,15 +1369,34 @@
ch->pcm_ch = c;
ch->pcm_mtx = c->lock;
- if (ch->p_asf1d->bNrChannels >= 2)
- ch->pcm_cap.fmtlist[0] =
- SND_FORMAT(ch->p_fmt->freebsd_fmt, 2, 0);
- else
- ch->pcm_cap.fmtlist[0] =
- SND_FORMAT(ch->p_fmt->freebsd_fmt, 1, 0);
+ format = ch->p_fmt->freebsd_fmt;
+
+ switch (ch->p_asf1d->bNrChannels) {
+ case 2:
+ /* stereo */
+ format = SND_FORMAT(format, 2, 0);
+ break;
+ case 1:
+ /* mono */
+ format = SND_FORMAT(format, 1, 0);
+ break;
+ default:
+ /* surround and more */
+ format = feeder_matrix_default_format(
+ SND_FORMAT(format, ch->p_asf1d->bNrChannels, 0));
+ break;
+ }
+ ch->pcm_cap.fmtlist[0] = format;
ch->pcm_cap.fmtlist[1] = 0;
+ /* check if format is not supported */
+
+ if (format == 0) {
+ DPRINTF("The selected audio format is not supported\n");
+ goto error;
+ }
+
/* set alternate interface corresponding to the mode */
endpoint = ch->p_ed1->bEndpointAddress;
@@ -1377,10 +1436,27 @@
fps_shift = usbd_xfer_get_fps_shift(ch->xfer[0]);
- /* setup frame sizes */
+ /* down shift number of frames per second, if any */
+ fps >>= fps_shift;
+ frames >>= fps_shift;
+
+ /* bytes per frame should not be zero */
+ ch->bytes_per_frame[0] = ((ch->sample_rate / fps) * ch->sample_size);
+ ch->bytes_per_frame[1] = (((ch->sample_rate + fps - 1) / fps) * ch->sample_size);
+
+ /* setup data rate dithering, if any */
+ ch->frames_per_second = fps;
+ ch->sample_rem = ch->sample_rate % fps;
+ ch->sample_curr = 0;
+ ch->frames_per_second = fps;
+
+ /* compute required buffer size */
+ buf_size = (ch->bytes_per_frame[1] * frames);
+
ch->intr_size = buf_size;
- ch->intr_frames = (frames >> fps_shift);
- ch->bytes_per_frame <<= fps_shift;
+ ch->intr_frames = frames;
+
+ DPRINTF("fps=%d sample_rem=%d\n", fps, ch->sample_rem);
if (ch->intr_frames == 0) {
DPRINTF("frame shift is too high!\n");
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ste/if_ste.c#6 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ste/if_ste.c,v 1.9 2009/12/21 20:18:01 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ste/if_ste.c,v 1.10 2009/12/21 20:42:23 yongari Exp $");
#ifdef HAVE_KERNEL_OPTION_HEADERS
#include "opt_device_polling.h"
@@ -91,45 +91,44 @@
{ 0, 0, NULL }
};
-static int ste_probe(device_t);
-static int ste_attach(device_t);
-static int ste_detach(device_t);
-static void ste_init(void *);
-static void ste_init_locked(struct ste_softc *);
-static void ste_intr(void *);
-static void ste_rxeoc(struct ste_softc *);
-static int ste_rxeof(struct ste_softc *);
-static void ste_txeoc(struct ste_softc *);
-static void ste_txeof(struct ste_softc *);
-static void ste_stats_update(void *);
-static void ste_stop(struct ste_softc *);
-static void ste_reset(struct ste_softc *);
-static int ste_ioctl(struct ifnet *, u_long, caddr_t);
-static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *);
-static void ste_start(struct ifnet *);
-static void ste_start_locked(struct ifnet *);
-static void ste_watchdog(struct ste_softc *);
-static int ste_shutdown(device_t);
-static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *,
- struct mbuf *);
-static int ste_ifmedia_upd(struct ifnet *);
-static void ste_ifmedia_upd_locked(struct ifnet *);
-static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static int ste_attach(device_t);
+static int ste_detach(device_t);
+static int ste_probe(device_t);
+static int ste_shutdown(device_t);
-static void ste_mii_sync(struct ste_softc *);
-static void ste_mii_send(struct ste_softc *, uint32_t, int);
-static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *);
-static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *);
-static int ste_miibus_readreg(device_t, int, int);
-static int ste_miibus_writereg(device_t, int, int, int);
-static void ste_miibus_statchg(device_t);
-
-static int ste_eeprom_wait(struct ste_softc *);
-static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int);
-static void ste_wait(struct ste_softc *);
-static void ste_setmulti(struct ste_softc *);
-static int ste_init_rx_list(struct ste_softc *);
-static void ste_init_tx_list(struct ste_softc *);
+static int ste_eeprom_wait(struct ste_softc *);
+static int ste_encap(struct ste_softc *, struct ste_chain *, struct mbuf *);
+static int ste_ifmedia_upd(struct ifnet *);
+static void ste_ifmedia_upd_locked(struct ifnet *);
+static void ste_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static void ste_init(void *);
+static void ste_init_locked(struct ste_softc *);
+static int ste_init_rx_list(struct ste_softc *);
+static void ste_init_tx_list(struct ste_softc *);
+static void ste_intr(void *);
+static int ste_ioctl(struct ifnet *, u_long, caddr_t);
+static int ste_mii_readreg(struct ste_softc *, struct ste_mii_frame *);
+static void ste_mii_send(struct ste_softc *, uint32_t, int);
+static void ste_mii_sync(struct ste_softc *);
+static int ste_mii_writereg(struct ste_softc *, struct ste_mii_frame *);
+static int ste_miibus_readreg(device_t, int, int);
+static void ste_miibus_statchg(device_t);
+static int ste_miibus_writereg(device_t, int, int, int);
+static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *,
+ struct mbuf *);
+static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int);
+static void ste_reset(struct ste_softc *);
+static void ste_rxeoc(struct ste_softc *);
+static int ste_rxeof(struct ste_softc *);
+static void ste_setmulti(struct ste_softc *);
+static void ste_start(struct ifnet *);
+static void ste_start_locked(struct ifnet *);
+static void ste_stats_update(void *);
+static void ste_stop(struct ste_softc *);
+static void ste_txeoc(struct ste_softc *);
+static void ste_txeof(struct ste_softc *);
+static void ste_wait(struct ste_softc *);
+static void ste_watchdog(struct ste_softc *);
#ifdef STE_USEIOSPACE
#define STE_RES SYS_RES_IOPORT
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/uart/uart_bus_acpi.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_acpi.c,v 1.3 2005/01/06 01:43:26 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_acpi.c,v 1.4 2009/12/21 22:57:40 gavin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -59,6 +59,7 @@
static struct isa_pnp_id acpi_ns8250_ids[] = {
{0x0005d041, "Standard PC COM port"}, /* PNP0500 */
{0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */
+ {0x04f0235c, "Wacom Tablet PC Screen"}, /* WACF004 */
{0}
};
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/controller/ehci_pci.c#9 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci_pci.c,v 1.16 2009/12/09 20:17:22 thompsa Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/controller/ehci_pci.c,v 1.17 2009/12/22 01:57:34 thompsa Exp $");
/*
* USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller.
@@ -197,6 +197,10 @@
return "Intel 82801JI (ICH10) USB 2.0 controller USB-A";
case 0x3a3c8086:
return "Intel 82801JI (ICH10) USB 2.0 controller USB-B";
+ case 0x3b348086:
+ return ("Intel PCH USB 2.0 controller USB-A");
+ case 0x3b3c8086:
+ return ("Intel PCH USB 2.0 controller USB-B");
case 0x00e01033:
return ("NEC uPD 720100 USB 2.0 controller");
@@ -213,6 +217,12 @@
return "NVIDIA nForce4 USB 2.0 controller";
case 0x03f210de:
return "NVIDIA nForce MCP61 USB 2.0 controller";
+ case 0x0aa610de:
+ return "NVIDIA nForce MCP79 USB 2.0 controller";
+ case 0x0aa910de:
+ return "NVIDIA nForce MCP79 USB 2.0 controller";
+ case 0x0aaa10de:
+ return "NVIDIA nForce MCP79 USB 2.0 controller";
case 0x15621131:
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list