Date: Sat, 7 Oct 2006 00:39:36 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 107385 for review Message-ID: <200610070039.k970daG6091024@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=107385 Change 107385 by jb@jb_freebsd7 on 2006/10/07 00:39:13 IFC Affected files ... .. //depot/projects/dtrace/doc/en_US.ISO8859-1/books/handbook/audit/chapter.sgml#6 integrate .. //depot/projects/dtrace/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml#24 integrate .. //depot/projects/dtrace/ports/MOVED#19 integrate .. //depot/projects/dtrace/src/sys/compat/freebsd32/freebsd32_proto.h#8 integrate .. //depot/projects/dtrace/src/sys/compat/freebsd32/freebsd32_syscall.h#8 integrate .. //depot/projects/dtrace/src/sys/compat/freebsd32/freebsd32_syscalls.c#8 integrate .. //depot/projects/dtrace/src/sys/compat/freebsd32/freebsd32_sysent.c#8 integrate .. //depot/projects/dtrace/src/sys/compat/freebsd32/syscalls.master#9 integrate .. //depot/projects/dtrace/src/sys/conf/NOTES#19 integrate .. //depot/projects/dtrace/src/sys/conf/files#31 integrate .. //depot/projects/dtrace/src/sys/conf/options#20 integrate .. //depot/projects/dtrace/src/sys/dev/fxp/if_fxp.c#5 integrate .. //depot/projects/dtrace/src/sys/dev/pci/pci_user.c#3 integrate .. //depot/projects/dtrace/src/sys/dev/sound/pci/hda/hdac.c#3 integrate .. //depot/projects/dtrace/src/sys/dev/sound/pci/hda/hdac_private.h#2 integrate .. //depot/projects/dtrace/src/sys/geom/cache/g_cache.c#1 branch .. //depot/projects/dtrace/src/sys/geom/cache/g_cache.h#1 branch .. //depot/projects/dtrace/src/sys/ia64/ia32/ia32_signal.c#3 integrate .. //depot/projects/dtrace/src/sys/kern/kern_umtx.c#8 integrate .. //depot/projects/dtrace/src/sys/modules/geom/Makefile#3 integrate .. //depot/projects/dtrace/src/sys/modules/geom/geom_cache/Makefile#1 branch .. //depot/projects/dtrace/www/en/index.xsl#8 integrate .. //depot/projects/dtrace/www/en/internal/new-account.sgml#5 integrate .. //depot/projects/dtrace/www/en/projects/summerofcode-2006.sgml#3 integrate .. //depot/projects/dtrace/www/en/releases/6.2R/schedule.sgml#4 integrate Differences ... ==== //depot/projects/dtrace/doc/en_US.ISO8859-1/books/handbook/audit/chapter.sgml#6 (text+ko) ==== @@ -1,6 +1,6 @@ <!-- The FreeBSD Documentation Project - $FreeBSD: doc/en_US.ISO8859-1/books/handbook/audit/chapter.sgml,v 1.23 2006/10/05 12:14:46 rwatson Exp $ + $FreeBSD: doc/en_US.ISO8859-1/books/handbook/audit/chapter.sgml,v 1.24 2006/10/06 09:09:36 rwatson Exp $ --> <!-- Need more documentation on praudit, auditreduce, etc. Plus more info @@ -599,6 +599,19 @@ </sect2> <sect2> + <title>Delegating Audit Review Rights</title> + + <para>Members of the <literal>audit</literal> group are given + permission to read audit trails in <filename>/var/audit</filename>; + by default, this group is empty, so only the root user may read + audit trails. Users may be added to the <literal>audit</literal> + group in order to delegate audit review rights to the user. As + the ability to track audit log contents provides significant insight + into the behavior of users and processes, it is recommended that the + delegation of audit review rights be performed with caution.</para> + </sect2> + + <sect2> <title>Live Monitoring Using Audit Pipes</title> <para>Audit pipes are cloning pseudo-devices in the device file system @@ -696,18 +709,5 @@ audit trail files are cleanly terminated, so will not be run on trails left unterminated following an improper shutdown.</para> </sect2> - - <sect2> - <title>Delegating Audit Review Rights</title> - - <para>Members of the <literal>audit</literal> group are given - permission to read audit trails in <filename>/var/audit</filename>; - by default, this group is empty, so only the root user may read - audit trails. Users may be added to the <literal>audit</literal> - group in order to delegate audit review rights to the user. As - the ability to track audit log contents provides significant insight - into the behavior of users and processes, it is recommended that the - delegation of audit review rights be performed with caution.</para> - </sect2> </sect1> </chapter> ==== //depot/projects/dtrace/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml#24 (text+ko) ==== @@ -1,7 +1,7 @@ <!-- The FreeBSD Documentation Project - $FreeBSD: doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v 1.756 2006/10/02 06:15:59 dds Exp $ + $FreeBSD: doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v 1.757 2006/10/06 19:18:17 novel Exp $ --> <!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ @@ -7004,6 +7004,23 @@ stripped of <makevar>DESTDIR</makevar>, as all these files are processed of a context of target environment.</para> </sect1> + + <sect1 id="testing-tinderbox"> + <title>Tinderbox</title> + + <para>If you're an avid ports contributor, you might want to take a + look at <application>Tinderbox</application>. It is a powerful + system for building and testing ports based on the scripts used on + <link linkend="build-cluster">Pointyhat</link>. You can install + <application>Tinderbox</application> using + <filename role="package">misc/tinderbox</filename> port. Be sure + to read supplied documentation since the configuration is not + trivial.</para> + + <para>Visit the <ulink url="http://tinderbox.marcuscom.com/">Tinderbox website</ulink> + for more details.</para> + + </sect1> </chapter> <chapter id="port-upgrading"> ==== //depot/projects/dtrace/ports/MOVED#19 (text+ko) ==== @@ -1,7 +1,7 @@ # # MOVED - a list of (recently) moved or removed ports # -# $FreeBSD: ports/MOVED,v 1.1149 2006/10/06 03:53:42 maho Exp $ +# $FreeBSD: ports/MOVED,v 1.1151 2006/10/06 20:48:15 joerg Exp $ # # Each entry consists of a single line containing the following four # fields in the order named, separated with the pipe (`|') character: @@ -927,7 +927,6 @@ games/linux_nwndata|games/nwndata|2004-03-01|Data files are not Linux-specific games/linux_nwnclient|games/linux-nwnclient|2004-03-01|Misnamed sysutils/fsck_ext2fs|sysutils/e2fsprogs|2004-03-01|Better utility -audio/audacity-devel|audio/audacity|2004-03-03|removed (obsolete) japanese/vfxdvi118||2004-03-04|removed (obsolate) japanese/vfxdvi240||2004-03-04|removed (obsolate) japanese/vfxdvi300||2004-03-04|removed (obsolate) @@ -2484,3 +2483,5 @@ net/coda5_client||2006-10-05|Has expired: no longer available from mastersite net/coda5_doc||2006-10-05|Has expired: coda5 removed math/ufspase|math/suitespase|2006-10-05|portname has been changed +devel/avr-gcc|devel/avr-gcc-3|2006-10-05|retire AVR-GCC 3.x +devel/avr-gcc-devel|devel/avr-gcc|2006-10-06|make AVR-GCC 4.x the default version ==== //depot/projects/dtrace/src/sys/compat/freebsd32/freebsd32_proto.h#8 (text+ko) ==== @@ -2,7 +2,7 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.68 2006/10/05 01:58:56 davidxu Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.69 2006/10/06 08:24:37 davidxu Exp $ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.81 2006/10/05 01:56:10 davidxu Exp */ @@ -289,6 +289,12 @@ char oucp_l_[PADL_(struct freebsd32_ucontext *)]; struct freebsd32_ucontext * oucp; char oucp_r_[PADR_(struct freebsd32_ucontext *)]; char ucp_l_[PADL_(const struct freebsd32_ucontext *)]; const struct freebsd32_ucontext * ucp; char ucp_r_[PADR_(const struct freebsd32_ucontext *)]; }; +struct freebsd32_umtx_lock_args { + char umtx_l_[PADL_(struct umtx *)]; struct umtx * umtx; char umtx_r_[PADR_(struct umtx *)]; +}; +struct freebsd32_umtx_unlock_args { + char umtx_l_[PADL_(struct umtx *)]; struct umtx * umtx; char umtx_r_[PADR_(struct umtx *)]; +}; struct freebsd32_thr_suspend_args { char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; }; @@ -351,6 +357,8 @@ int freebsd32_getcontext(struct thread *, struct freebsd32_getcontext_args *); int freebsd32_setcontext(struct thread *, struct freebsd32_setcontext_args *); int freebsd32_swapcontext(struct thread *, struct freebsd32_swapcontext_args *); +int freebsd32_umtx_lock(struct thread *, struct freebsd32_umtx_lock_args *); +int freebsd32_umtx_unlock(struct thread *, struct freebsd32_umtx_unlock_args *); int freebsd32_thr_suspend(struct thread *, struct freebsd32_thr_suspend_args *); int freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *); int freebsd32_thr_new(struct thread *, struct freebsd32_thr_new_args *); @@ -491,6 +499,8 @@ #define FREEBSD32_SYS_AUE_freebsd32_getcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_setcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_swapcontext AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_umtx_lock AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_umtx_unlock AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_thr_suspend AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_umtx_op AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_thr_new AUE_NULL ==== //depot/projects/dtrace/src/sys/compat/freebsd32/freebsd32_syscall.h#8 (text+ko) ==== @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.66 2006/10/05 01:58:57 davidxu Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.67 2006/10/06 08:24:37 davidxu Exp $ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.81 2006/10/05 01:56:10 davidxu Exp */ @@ -306,8 +306,8 @@ #define FREEBSD32_SYS_thr_exit 431 #define FREEBSD32_SYS_thr_self 432 #define FREEBSD32_SYS_thr_kill 433 -#define FREEBSD32_SYS__umtx_lock 434 -#define FREEBSD32_SYS__umtx_unlock 435 +#define FREEBSD32_SYS_freebsd32_umtx_lock 434 +#define FREEBSD32_SYS_freebsd32_umtx_unlock 435 #define FREEBSD32_SYS_jail_attach 436 #define FREEBSD32_SYS_freebsd32_thr_suspend 442 #define FREEBSD32_SYS_thr_wake 443 ==== //depot/projects/dtrace/src/sys/compat/freebsd32/freebsd32_syscalls.c#8 (text+ko) ==== @@ -2,7 +2,7 @@ * System call names. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.57 2006/10/05 01:58:57 davidxu Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.58 2006/10/06 08:24:37 davidxu Exp $ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.81 2006/10/05 01:56:10 davidxu Exp */ @@ -441,8 +441,8 @@ "thr_exit", /* 431 = thr_exit */ "thr_self", /* 432 = thr_self */ "thr_kill", /* 433 = thr_kill */ - "_umtx_lock", /* 434 = _umtx_lock */ - "_umtx_unlock", /* 435 = _umtx_unlock */ + "freebsd32_umtx_lock", /* 434 = freebsd32_umtx_lock */ + "freebsd32_umtx_unlock", /* 435 = freebsd32_umtx_unlock */ "jail_attach", /* 436 = jail_attach */ "#437", /* 437 = extattr_list_fd */ "#438", /* 438 = extattr_list_file */ ==== //depot/projects/dtrace/src/sys/compat/freebsd32/freebsd32_sysent.c#8 (text+ko) ==== @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.67 2006/10/05 01:58:57 davidxu Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.68 2006/10/06 08:24:37 davidxu Exp $ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.81 2006/10/05 01:56:10 davidxu Exp */ @@ -466,8 +466,8 @@ { AS(thr_exit_args), (sy_call_t *)thr_exit, AUE_NULL, NULL, 0, 0 }, /* 431 = thr_exit */ { AS(thr_self_args), (sy_call_t *)thr_self, AUE_NULL, NULL, 0, 0 }, /* 432 = thr_self */ { AS(thr_kill_args), (sy_call_t *)thr_kill, AUE_NULL, NULL, 0, 0 }, /* 433 = thr_kill */ - { AS(_umtx_lock_args), (sy_call_t *)_umtx_lock, AUE_NULL, NULL, 0, 0 }, /* 434 = _umtx_lock */ - { AS(_umtx_unlock_args), (sy_call_t *)_umtx_unlock, AUE_NULL, NULL, 0, 0 }, /* 435 = _umtx_unlock */ + { AS(freebsd32_umtx_lock_args), (sy_call_t *)freebsd32_umtx_lock, AUE_NULL, NULL, 0, 0 }, /* 434 = freebsd32_umtx_lock */ + { AS(freebsd32_umtx_unlock_args), (sy_call_t *)freebsd32_umtx_unlock, AUE_NULL, NULL, 0, 0 }, /* 435 = freebsd32_umtx_unlock */ { AS(jail_attach_args), (sy_call_t *)jail_attach, AUE_NULL, NULL, 0, 0 }, /* 436 = jail_attach */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 437 = extattr_list_fd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 438 = extattr_list_file */ ==== //depot/projects/dtrace/src/sys/compat/freebsd32/syscalls.master#9 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.81 2006/10/05 01:56:10 davidxu Exp $ + $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.82 2006/10/06 08:22:08 davidxu Exp $ ; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 ; from: src/sys/kern/syscalls.master 1.107 ; @@ -721,8 +721,8 @@ 431 AUE_NULL NOPROTO { void thr_exit(long *state); } 432 AUE_NULL NOPROTO { int thr_self(long *id); } 433 AUE_NULL NOPROTO { int thr_kill(long id, int sig); } -434 AUE_NULL NOPROTO { int _umtx_lock(struct umtx *umtx); } -435 AUE_NULL NOPROTO { int _umtx_unlock(struct umtx *umtx); } +434 AUE_NULL STD { int freebsd32_umtx_lock(struct umtx *umtx); } +435 AUE_NULL STD { int freebsd32_umtx_unlock(struct umtx *umtx); } 436 AUE_NULL NOPROTO { int jail_attach(int jid); } 437 AUE_EXTATTR_LIST_FD UNIMPL extattr_list_fd 438 AUE_EXTATTR_LIST_FILE UNIMPL extattr_list_file ==== //depot/projects/dtrace/src/sys/conf/NOTES#19 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1386 2006/10/05 20:31:58 simon Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1387 2006/10/06 10:43:40 ru Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -124,6 +124,7 @@ options GEOM_APPLE # Apple partitioning options GEOM_BDE # Disk encryption. options GEOM_BSD # BSD disklabels +options GEOM_CACHE # Disk cache. options GEOM_CONCAT # Disk concatenation. options GEOM_ELI # Disk encryption. options GEOM_FOX # Redundant path mitigation ==== //depot/projects/dtrace/src/sys/conf/files#31 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1148 2006/10/02 15:42:01 phk Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1149 2006/10/06 10:43:41 ru Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1167,6 +1167,7 @@ geom/bde/g_bde_crypt.c optional geom_bde geom/bde/g_bde_lock.c optional geom_bde geom/bde/g_bde_work.c optional geom_bde +geom/cache/g_cache.c optional geom_cache geom/concat/g_concat.c optional geom_concat geom/eli/g_eli.c optional geom_eli geom/eli/g_eli_crypto.c optional geom_eli ==== //depot/projects/dtrace/src/sys/conf/options#20 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.559 2006/09/26 12:36:33 ru Exp $ +# $FreeBSD: src/sys/conf/options,v 1.560 2006/10/06 10:43:42 ru Exp $ # # On the handling of kernel options # @@ -78,6 +78,7 @@ GEOM_APPLE opt_geom.h GEOM_BDE opt_geom.h GEOM_BSD opt_geom.h +GEOM_CACHE opt_geom.h GEOM_CONCAT opt_geom.h GEOM_ELI opt_geom.h GEOM_FOX opt_geom.h ==== //depot/projects/dtrace/src/sys/dev/fxp/if_fxp.c#5 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.257 2006/05/16 14:36:25 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.258 2006/10/06 20:53:01 jmg Exp $"); /* * Intel EtherExpress Pro/100B PCI Fast Ethernet driver @@ -2192,6 +2192,11 @@ mii = device_get_softc(sc->miibus); FXP_LOCK(sc); + if (mii->mii_instance) { + struct mii_softc *miisc; + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + } mii_mediachg(mii); FXP_UNLOCK(sc); return (0); ==== //depot/projects/dtrace/src/sys/dev/pci/pci_user.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/pci/pci_user.c,v 1.20 2005/08/26 01:00:19 ps Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/pci/pci_user.c,v 1.21 2006/10/06 14:31:32 ru Exp $"); #include "opt_bus.h" /* XXX trim includes */ #include "opt_compat.h" @@ -374,12 +374,14 @@ case 4: case 2: case 1: - /* make sure register is in bounds and aligned */ - if (cmd == PCIOCREAD || cmd == PCIOCWRITE) - if (io->pi_reg < 0 || - io->pi_reg + io->pi_width > PCI_REGMAX || - io->pi_reg & (io->pi_width - 1)) - error = EINVAL; + /* Make sure register is in bounds and aligned. */ + if ((cmd == PCIOCREAD || cmd == PCIOCWRITE) && + (io->pi_reg < 0 || + io->pi_reg + io->pi_width > PCI_REGMAX + 1 || + io->pi_reg & (io->pi_width - 1))) { + error = EINVAL; + break; + } /* * Assume that the user-level bus number is * in fact the physical PCI bus number. ==== //depot/projects/dtrace/src/sys/dev/sound/pci/hda/hdac.c#3 (text+ko) ==== @@ -67,6 +67,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include <sys/ctype.h> + #include <dev/sound/pcm/sound.h> #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> @@ -78,25 +80,23 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20061003_0029" +#define HDA_DRV_TEST_REV "20061007_0030" #define HDA_WIDGET_PARSER_REV 1 -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/hda/hdac.c,v 1.3 2006/10/02 16:30:04 ariff Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/hda/hdac.c,v 1.4 2006/10/06 18:59:27 ariff Exp $"); #undef HDA_DEBUG_ENABLED #define HDA_DEBUG_ENABLED 1 #ifdef HDA_DEBUG_ENABLED -#define HDA_DEBUG_MSG(stmt) do { \ - if (bootverbose) { \ - stmt \ - } \ +#define HDA_DEBUG(stmt) do { \ + stmt \ } while(0) #else -#define HDA_DEBUG_MSG(stmt) +#define HDA_DEBUG(stmt) #endif -#define HDA_BOOTVERBOSE_MSG(stmt) do { \ +#define HDA_BOOTVERBOSE(stmt) do { \ if (bootverbose) { \ stmt \ } \ @@ -109,6 +109,8 @@ #define hdac_lock(sc) snd_mtxlock((sc)->lock) #define hdac_unlock(sc) snd_mtxunlock((sc)->lock) +#define hdac_lockassert(sc) snd_mtxassert((sc)->lock) +#define hdac_lockowned(sc) mtx_owned((sc)->lock) #define HDA_FLAG_MATCH(fl, v) (((fl) & (v)) == (v)) #define HDA_MATCH_ALL 0xffffffff @@ -180,15 +182,32 @@ #define HDA_ADC_PATH (1 << 1) #define HDA_ADC_RECSEL (1 << 2) -#define HDA_CTL_OUT 0x1 -#define HDA_CTL_IN 0x2 +#define HDA_CTL_OUT (1 << 0) +#define HDA_CTL_IN (1 << 1) #define HDA_CTL_BOTH (HDA_CTL_IN | HDA_CTL_OUT) -#define HDA_QUIRK_GPIO1 (1 << 0) -#define HDA_QUIRK_GPIO2 (1 << 1) -#define HDA_QUIRK_SOFTPCMVOL (1 << 2) -#define HDA_QUIRK_FIXEDRATE (1 << 3) -#define HDA_QUIRK_FORCESTEREO (1 << 4) +#define HDA_GPIO_MAX 15 +/* 0 - 14 = GPIO */ +#define HDA_QUIRK_GPIO0 (1 << 0) +#define HDA_QUIRK_GPIO1 (1 << 1) +#define HDA_QUIRK_GPIO2 (1 << 2) +#define HDA_QUIRK_SOFTPCMVOL (1 << 15) +#define HDA_QUIRK_FIXEDRATE (1 << 16) +#define HDA_QUIRK_FORCESTEREO (1 << 17) + +static const struct { + char *key; + uint32_t value; +} hdac_quirks_tab[] = { + { "gpio0", HDA_QUIRK_GPIO0 }, + { "gpio1", HDA_QUIRK_GPIO1 }, + { "gpio2", HDA_QUIRK_GPIO2 }, + { "softpcmvol", HDA_QUIRK_SOFTPCMVOL }, + { "fixedrate", HDA_QUIRK_FIXEDRATE }, + { "forcestereo", HDA_QUIRK_FORCESTEREO } +}; +#define HDAC_QUIRKS_TAB_LEN \ + (sizeof(hdac_quirks_tab) / sizeof(hdac_quirks_tab[0])) #define HDA_BDL_MIN 2 #define HDA_BDL_MAX 256 @@ -287,7 +306,8 @@ #define HDA_CODEC_ALC260 HDA_CODEC_CONSTRUCT(REALTEK, 0x0260) #define HDA_CODEC_ALC861 HDA_CODEC_CONSTRUCT(REALTEK, 0x0861) #define HDA_CODEC_ALC880 HDA_CODEC_CONSTRUCT(REALTEK, 0x0880) -#define HDA_CODEC_ALC882 HDA_CODEC_CONSTRUCT(REALTEK, 0x0260) +#define HDA_CODEC_ALC882 HDA_CODEC_CONSTRUCT(REALTEK, 0x0882) +#define HDA_CODEC_ALC883 HDA_CODEC_CONSTRUCT(REALTEK, 0x0883) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) /* Analog Device */ @@ -316,9 +336,13 @@ * Ok, the truth is, I don't have any idea at all whether * it is "Venice" or "Waikiki" or other unnamed CXyadayada. The only * place that tell me it is "Venice" is from its Windows driver INF. + * + * Venice - CX????? + * Waikiki - CX20551-22 */ #define CONEXANT_VENDORID 0x14f1 #define HDA_CODEC_CXVENICE HDA_CODEC_CONSTRUCT(CONEXANT, 0x5045) +#define HDA_CODEC_CXWAIKIKI HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) @@ -331,6 +355,7 @@ { HDA_CODEC_ALC861, "Realtek ALC861" }, { HDA_CODEC_ALC880, "Realtek ALC880" }, { HDA_CODEC_ALC882, "Realtek ALC882" }, + { HDA_CODEC_ALC883, "Realtek ALC883" }, { HDA_CODEC_AD1981HD, "Analog Device AD1981HD" }, { HDA_CODEC_AD1983, "Analog Device AD1983" }, { HDA_CODEC_AD1986A, "Analog Device AD1986A" }, @@ -340,6 +365,7 @@ { HDA_CODEC_STAC9220, "Sigmatel STAC9220" }, { HDA_CODEC_STAC922XD, "Sigmatel STAC9220D/9223D" }, { HDA_CODEC_CXVENICE, "Conexant Venice" }, + { HDA_CODEC_CXWAIKIKI, "Conexant Waikiki" }, /* Unknown codec */ { HDA_CODEC_ALCXXXX, "Realtek (Unknown)" }, { HDA_CODEC_ADXXXX, "Analog Device (Unknown)" }, @@ -582,9 +608,9 @@ res = hdac_command(sc, HDA_CMD_GET_PIN_SENSE(cad, hdac_hp_switch[i].hpnid), cad); - HDA_BOOTVERBOSE_MSG( + HDA_BOOTVERBOSE( device_printf(sc->dev, - "Pin sense: nid=%d res=0x%08x\n", + "HDA_DEBUG: Pin sense: nid=%d res=0x%08x\n", hdac_hp_switch[i].hpnid, res); ); res >>= 31; @@ -616,7 +642,8 @@ if (res != 0) { /* HP in */ w = hdac_widget_get(devinfo, hdac_hp_switch[i].hpnid); - if (w != NULL) { + if (w != NULL && w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { if (forcemute == 0) w->wclass.pin.ctrl |= HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; @@ -630,7 +657,8 @@ for (j = 0; hdac_hp_switch[i].spkrnid[j] != -1; j++) { w = hdac_widget_get(devinfo, hdac_hp_switch[i].spkrnid[j]); - if (w != NULL) { + if (w != NULL && w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { w->wclass.pin.ctrl &= ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; hdac_command(sc, @@ -642,7 +670,8 @@ } else { /* HP out */ w = hdac_widget_get(devinfo, hdac_hp_switch[i].hpnid); - if (w != NULL) { + if (w != NULL && w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { w->wclass.pin.ctrl &= ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; hdac_command(sc, @@ -652,7 +681,8 @@ for (j = 0; hdac_hp_switch[i].spkrnid[j] != -1; j++) { w = hdac_widget_get(devinfo, hdac_hp_switch[i].spkrnid[j]); - if (w != NULL) { + if (w != NULL && w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { if (forcemute == 0) w->wclass.pin.ctrl |= HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; @@ -685,8 +715,8 @@ sc = codec->sc; - HDA_BOOTVERBOSE_MSG( - device_printf(sc->dev, "Unsol Tag: 0x%08x\n", tag); + HDA_BOOTVERBOSE( + device_printf(sc->dev, "HDA_DEBUG: Unsol Tag: 0x%08x\n", tag); ); device_get_children(sc->dev, &devlist, &devcount); @@ -733,14 +763,17 @@ /* XXX to be removed */ #ifdef HDAC_INTR_EXTRA - if ((res & HDAC_SDSTS_DESE) || (res & HDAC_SDSTS_FIFOE)) - device_printf(sc->dev, - "PCMDIR_%s intr triggered beyond stream boundary: %08x\n", - (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", res); + HDA_BOOTVERBOSE( + if (res & (HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE)) + device_printf(sc->dev, + "PCMDIR_%s intr triggered beyond stream boundary:" + "%08x\n", + (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", res); + ); #endif HDAC_WRITE_1(&sc->mem, ch->off + HDAC_SDSTS, - HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE | HDAC_SDSTS_BCIS ); + HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE | HDAC_SDSTS_BCIS ); /* XXX to be removed */ #ifdef HDAC_INTR_EXTRA @@ -779,17 +812,17 @@ hdac_lock(sc); /* Do we have anything to do? */ intsts = HDAC_READ_4(&sc->mem, HDAC_INTSTS); - if ((intsts & HDAC_INTSTS_GIS) != HDAC_INTSTS_GIS) { + if (!HDA_FLAG_MATCH(intsts, HDAC_INTSTS_GIS)) { hdac_unlock(sc); return; } /* Was this a controller interrupt? */ - if ((intsts & HDAC_INTSTS_CIS) == HDAC_INTSTS_CIS) { + if (HDA_FLAG_MATCH(intsts, HDAC_INTSTS_CIS)) { rirb_base = (struct hdac_rirb *)sc->rirb_dma.dma_vaddr; rirbsts = HDAC_READ_1(&sc->mem, HDAC_RIRBSTS); /* Get as many responses that we can */ - while ((rirbsts & HDAC_RIRBSTS_RINTFL) == HDAC_RIRBSTS_RINTFL) { + while (HDA_FLAG_MATCH(rirbsts, HDAC_RIRBSTS_RINTFL)) { HDAC_WRITE_1(&sc->mem, HDAC_RIRBSTS, HDAC_RIRBSTS_RINTFL); rirbwp = HDAC_READ_1(&sc->mem, HDAC_RIRBWP); bus_dmamap_sync(sc->rirb_dma.dma_tag, sc->rirb_dma.dma_map, @@ -818,7 +851,7 @@ HDAC_WRITE_4(&sc->mem, HDAC_INTSTS, HDAC_INTSTS_CIS); #endif } - if ((intsts & HDAC_INTSTS_SIS_MASK)) { + if (intsts & HDAC_INTSTS_SIS_MASK) { if (intsts & (1 << sc->num_iss)) hdac_stream_intr(sc, &sc->play); if (intsts & (1 << 0)) @@ -844,7 +877,7 @@ } /**************************************************************************** - * int had_reset(hdac_softc *) + * int hdac_reset(hdac_softc *) * * Reset the hdac to a quiescent and known state. ****************************************************************************/ @@ -893,7 +926,7 @@ count = 10000; do { gctl = HDAC_READ_4(&sc->mem, HDAC_GCTL); - if ((gctl & HDAC_GCTL_CRST)) + if (gctl & HDAC_GCTL_CRST) break; DELAY(10); } while (--count); @@ -903,12 +936,6 @@ } /* - * Enable unsolicited interrupt. - */ - gctl = HDAC_READ_4(&sc->mem, HDAC_GCTL); - HDAC_WRITE_4(&sc->mem, HDAC_GCTL, gctl | HDAC_GCTL_UNSOL); - - /* * Wait for codecs to finish their own reset sequence. The delay here * should be of 250us but for some reasons, on it's not enough on my * computer. Let's use twice as much as necessary to make sure that @@ -941,7 +968,7 @@ sc->num_oss = HDAC_GCAP_OSS(gcap); sc->num_bss = HDAC_GCAP_BSS(gcap); - sc->support_64bit = (gcap & HDAC_GCAP_64OK) == HDAC_GCAP_64OK; + sc->support_64bit = HDA_FLAG_MATCH(gcap, HDAC_GCAP_64OK); corbsize = HDAC_READ_1(&sc->mem, HDAC_CORBSIZE); if ((corbsize & HDAC_CORBSIZE_CORBSZCAP_256) == @@ -1356,8 +1383,6 @@ int i; uint16_t statests; - SLIST_INIT(&sc->codec_list); - statests = HDAC_READ_2(&sc->mem, HDAC_STATESTS); for (i = 0; i < HDAC_CODEC_MAX; i++) { if (HDAC_STATESTS_SDIWAKE(statests, i)) { @@ -1375,13 +1400,12 @@ codec->sc = sc; codec->cad = i; sc->codecs[i] = codec; - SLIST_INSERT_HEAD(&sc->codec_list, codec, next_codec); if (hdac_probe_codec(codec) != 0) break; } } /* All codecs have been probed, now try to attach drivers to them */ - bus_generic_attach(sc->dev); + /* bus_generic_attach(sc->dev); */ } /**************************************************************************** @@ -1400,9 +1424,8 @@ int i; nid_t cad = codec->cad; - HDA_DEBUG_MSG( - device_printf(sc->dev, "%s: Probing codec: %d\n", - __func__, cad); + HDA_BOOTVERBOSE( + device_printf(sc->dev, "HDA_DEBUG: Probing codec: %d\n", cad); ); vendorid = hdac_command(sc, HDA_CMD_GET_PARAMETER(cad, 0x0, HDA_PARAM_VENDOR_ID), @@ -1416,9 +1439,9 @@ startnode = HDA_PARAM_SUB_NODE_COUNT_START(subnode); endnode = startnode + HDA_PARAM_SUB_NODE_COUNT_TOTAL(subnode); - HDA_DEBUG_MSG( - device_printf(sc->dev, "%s: \tstartnode=%d endnode=%d\n", - __func__, startnode, endnode); + HDA_BOOTVERBOSE( + device_printf(sc->dev, "HDA_DEBUG: \tstartnode=%d endnode=%d\n", + startnode, endnode); ); for (i = startnode; i < endnode; i++) { devinfo = hdac_probe_function(codec, i); @@ -1432,20 +1455,18 @@ HDA_PARAM_REVISION_ID_REVISION_ID(revisionid); devinfo->stepping_id = HDA_PARAM_REVISION_ID_STEPPING_ID(revisionid); - HDA_DEBUG_MSG( + HDA_BOOTVERBOSE( device_printf(sc->dev, - "%s: \tFound AFG nid=%d " + "HDA_DEBUG: \tFound AFG nid=%d " "[startnode=%d endnode=%d]\n", - __func__, devinfo->nid, - startnode, endnode); + devinfo->nid, startnode, endnode); ); return (1); } } - HDA_DEBUG_MSG( - device_printf(sc->dev, "%s: \tAFG not found\n", - __func__); + HDA_BOOTVERBOSE( + device_printf(sc->dev, "HDA_DEBUG: \tAFG not found\n"); ); return (0); } @@ -1536,10 +1557,10 @@ i += entnum; } - HDA_BOOTVERBOSE_MSG( + HDA_BOOTVERBOSE( if (w->nconns != found) { device_printf(sc->dev, - "node %d: WARNING!!! Connection " + "HDA_DEBUG: nid=%d WARNING!!! Connection " "length=%d != found=%d\n", nid, w->nconns, found); } @@ -1904,7 +1925,7 @@ break; DELAY(10); } while (--to); - if ((ctl & HDAC_SDCTL_SRST)) + if (ctl & HDAC_SDCTL_SRST) device_printf(sc->dev, "can't reset!\n"); } @@ -2052,7 +2073,7 @@ struct hdac_command_list cl; uint32_t response = HDAC_INVALID; - if (!mtx_owned(sc->lock)) + if (!hdac_lockowned(sc)) device_printf(sc->dev, "WARNING!!!! mtx not owned!!!!\n"); cl.num_commands = 1; cl.verbs = &verb; @@ -2312,13 +2333,6 @@ nid_t cad = ch->devinfo->codec->cad; uint16_t fmt; - /* - * 8bit = 0 - * 16bit = 1 - * 20bit = 2 - * 24bit = 3 - * 32bit = 4 - */ fmt = 0; if (ch->fmt & AFMT_S16_LE) fmt |= ch->bit16 << 4; @@ -2342,9 +2356,10 @@ HDAC_WRITE_2(&sc->mem, ch->off + HDAC_SDFMT, fmt); for (i = 0; ch->io[i] != -1; i++) { - HDA_BOOTVERBOSE_MSG( + HDA_BOOTVERBOSE( device_printf(sc->dev, - "PCMDIR_%s: Stream setup nid=%d fmt=0x%08x\n", + "HDA_DEBUG: PCMDIR_%s: Stream setup nid=%d " + "fmt=0x%08x\n", (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", ch->io[i], fmt); ); @@ -2474,14 +2489,6 @@ int i, j, softpcmvol; nid_t cad; - if (resource_int_value(device_get_name(sc->dev), - device_get_unit(sc->dev), "softpcmvol", &softpcmvol) == 0) - softpcmvol = (softpcmvol != 0) ? 1 : 0; - else - softpcmvol = (devinfo->function.audio.quirks & - HDA_QUIRK_SOFTPCMVOL) ? - 1 : 0; - hdac_lock(sc); mask = 0; @@ -2505,6 +2512,16 @@ HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE| HDAC_UNSOLTAG_EVENT_HP), cad); hdac_hp_switch_handler(devinfo); + HDA_BOOTVERBOSE( + device_printf(sc->dev, + "HDA_DEBUG: Enabling headphone/speaker " + "audio routing switching:\n"); + device_printf(sc->dev, + "HDA_DEBUG: \tindex=%d nid=%d " + "pci_subvendor=0x%08x " + "codec=0x%08x\n", + i, w->nid, sc->pci_subvendor, id); + ); } break; } @@ -2541,7 +2558,9 @@ if (!(mask & SOUND_MASK_PCM)) { softpcmvol = 1; mask |= SOUND_MASK_PCM; - } + } else + softpcmvol = (devinfo->function.audio.quirks & + HDA_QUIRK_SOFTPCMVOL) ? 1 : 0; i = 0; ctl = NULL; @@ -2559,9 +2578,9 @@ d = device_get_softc(sc->dev); if (d != NULL) { d->flags |= SD_F_SOFTPCMVOL; - HDA_BOOTVERBOSE_MSG( + HDA_BOOTVERBOSE( device_printf(sc->dev, - "%s Soft PCM volume\n", + "HDA_DEBUG: %s Soft PCM volume\n", (softpcmvol == 1) ? "Forcing" : "Enabling"); ); @@ -2593,9 +2612,8 @@ NULL) { if (ctl->widget == NULL || ctl->enable == 0) continue; - if ((ctl->ossmask & (SOUND_MASK_VOLUME | - SOUND_MASK_PCM)) != (SOUND_MASK_VOLUME | - SOUND_MASK_PCM)) + if (!HDA_FLAG_MATCH(ctl->ossmask, + SOUND_MASK_VOLUME | SOUND_MASK_PCM)) continue; if (!(ctl->mute == 1 && ctl->step == 0)) ctl->enable = 0; @@ -2789,6 +2807,14 @@ device_printf(dev, "cannot allocate softc\n"); return (ENOMEM); } + + sc->lock = snd_mtxcreate(device_get_nameunit(dev), HDAC_MTX_NAME); + if (sc->lock == NULL) { + device_printf(dev, "mutex creation failed\n"); + free(sc, M_DEVBUF); + return (ENOMEM); + } + sc->dev = dev; sc->pci_subvendor = pci_get_subdevice(sc->dev) << 16; sc->pci_subvendor |= pci_get_subvendor(sc->dev); @@ -2827,6 +2853,7 @@ if (result != 0) { device_printf(sc->dev, "%s: bus_dma_tag_create failed (%x)\n", __func__, result); + snd_mtxfree(sc->lock); free(sc, M_DEVBUF); return (ENXIO); } @@ -2838,31 +2865,28 @@ pci_enable_busmaster(dev); - /* Initialize driver mutex */ - sc->lock = snd_mtxcreate(device_get_nameunit(dev), HDAC_MTX_NAME); - /* Allocate resources */ result = hdac_mem_alloc(sc); if (result != 0) - goto fail; + goto hdac_attach_fail; result = hdac_irq_alloc(sc); if (result != 0) - goto fail; + goto hdac_attach_fail; /* Get Capabilities */ result = hdac_get_capabilities(sc); if (result != 0) - goto fail; + goto hdac_attach_fail; /* Allocate CORB and RIRB dma memory */ result = hdac_dma_alloc(sc, &sc->corb_dma, sc->corb_size * sizeof(uint32_t)); if (result != 0) - goto fail; + goto hdac_attach_fail; result = hdac_dma_alloc(sc, &sc->rirb_dma, sc->rirb_size * sizeof(struct hdac_rirb)); if (result != 0) - goto fail; + goto hdac_attach_fail; /* Quiesce everything */ hdac_reset(sc); @@ -2883,16 +2907,17 @@ hdac_attach2((void *)sc); } - return(0); + return (0); -fail: +hdac_attach_fail: hdac_dma_free(&sc->rirb_dma); hdac_dma_free(&sc->corb_dma); hdac_irq_free(sc); hdac_mem_free(sc); snd_mtxfree(sc->lock); + free(sc, M_DEVBUF); - return(ENXIO); + return (ENXIO); } static void @@ -2919,7 +2944,7 @@ devinfo->startnode = HDA_PARAM_SUB_NODE_COUNT_START(res); devinfo->endnode = devinfo->startnode + devinfo->nodecnt; - HDA_BOOTVERBOSE_MSG( + HDA_BOOTVERBOSE( device_printf(sc->dev, " Vendor: 0x%08x\n", devinfo->vendor_id); device_printf(sc->dev, " Device: 0x%08x\n", @@ -2995,6 +3020,7 @@ struct hdac_audio_ctl *ctls; struct hdac_widget *w, *cw; int i, j, cnt, max, ocap, icap; + int mute, offset, step, size; /* XXX This is redundant */ max = 0; @@ -3053,22 +3079,44 @@ ocap = w->param.outamp_cap; icap = w->param.inamp_cap; if (ocap != 0) { + mute = HDA_PARAM_OUTPUT_AMP_CAP_MUTE_CAP(ocap); + step = HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS(ocap); + size = HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE(ocap); + offset = HDA_PARAM_OUTPUT_AMP_CAP_OFFSET(ocap); + /*if (offset > step) { + HDA_BOOTVERBOSE( + device_printf(sc->dev, + "HDA_DEBUG: BUGGY outamp: nid=%d " + "[offset=%d > step=%d]\n", + w->nid, offset, step); + ); + offset = step; + }*/ ctls[cnt].enable = 1; ctls[cnt].widget = w; - ctls[cnt].mute = - HDA_PARAM_OUTPUT_AMP_CAP_MUTE_CAP(ocap); - ctls[cnt].step = - HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS(ocap); - ctls[cnt].size = - HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE(ocap); - ctls[cnt].offset = - HDA_PARAM_OUTPUT_AMP_CAP_OFFSET(ocap); - ctls[cnt].left = ctls[cnt].offset; >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610070039.k970daG6091024>