From owner-svn-src-projects@FreeBSD.ORG Sun Nov 23 05:39:51 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 901E11065673; Sun, 23 Nov 2008 05:39:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FA538FC0A; Sun, 23 Nov 2008 05:39:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAN5dpCL041762; Sun, 23 Nov 2008 05:39:51 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAN5doPk041734; Sun, 23 Nov 2008 05:39:50 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811230539.mAN5doPk041734@svn.freebsd.org> From: Kip Macy Date: Sun, 23 Nov 2008 05:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185198 - in projects/releng_7_xen: . bin/chio contrib contrib/bind9 contrib/bind9/bin/dig contrib/bind9/bin/named contrib/bind9/bin/rndc contrib/bind9/doc/arm contrib/bind9/lib/bind co... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 05:39:51 -0000 Author: kmacy Date: Sun Nov 23 05:39:49 2008 New Revision: 185198 URL: http://svn.freebsd.org/changeset/base/185198 Log: IF_RELENG_7 184527:185197 Added: projects/releng_7_xen/contrib/traceroute/as.c projects/releng_7_xen/contrib/traceroute/as.h projects/releng_7_xen/lib/libc/string/ffsll.c projects/releng_7_xen/lib/libc/string/flsll.c projects/releng_7_xen/share/man/man4/igb.4 Modified: projects/releng_7_xen/Makefile.inc1 (contents, props changed) projects/releng_7_xen/bin/chio/ (props changed) projects/releng_7_xen/bin/chio/chio.c projects/releng_7_xen/contrib/ (props changed) projects/releng_7_xen/contrib/bind9/ (props changed) projects/releng_7_xen/contrib/bind9/CHANGES projects/releng_7_xen/contrib/bind9/COPYRIGHT projects/releng_7_xen/contrib/bind9/bin/dig/dighost.c projects/releng_7_xen/contrib/bind9/bin/named/client.c projects/releng_7_xen/contrib/bind9/bin/named/config.c projects/releng_7_xen/contrib/bind9/bin/named/controlconf.c projects/releng_7_xen/contrib/bind9/bin/named/interfacemgr.c projects/releng_7_xen/contrib/bind9/bin/named/lwresd.c projects/releng_7_xen/contrib/bind9/bin/named/named.conf.docbook projects/releng_7_xen/contrib/bind9/bin/named/server.c projects/releng_7_xen/contrib/bind9/bin/rndc/rndc.c projects/releng_7_xen/contrib/bind9/configure.in projects/releng_7_xen/contrib/bind9/doc/arm/Bv9ARM-book.xml projects/releng_7_xen/contrib/bind9/lib/bind/configure.in projects/releng_7_xen/contrib/bind9/lib/bind9/check.c projects/releng_7_xen/contrib/bind9/lib/dns/api projects/releng_7_xen/contrib/bind9/lib/dns/dispatch.c projects/releng_7_xen/contrib/bind9/lib/dns/include/dns/dispatch.h projects/releng_7_xen/contrib/bind9/lib/dns/request.c projects/releng_7_xen/contrib/bind9/lib/dns/resolver.c projects/releng_7_xen/contrib/bind9/lib/dns/xfrin.c projects/releng_7_xen/contrib/bind9/lib/isc/api projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/resource.h projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/socket.h projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/timer.h projects/releng_7_xen/contrib/bind9/lib/isc/timer.c projects/releng_7_xen/contrib/bind9/lib/isc/unix/app.c projects/releng_7_xen/contrib/bind9/lib/isc/unix/resource.c projects/releng_7_xen/contrib/bind9/lib/isc/unix/socket.c projects/releng_7_xen/contrib/bind9/lib/isc/unix/socket_p.h projects/releng_7_xen/contrib/bind9/lib/isccfg/api projects/releng_7_xen/contrib/bind9/lib/isccfg/namedconf.c projects/releng_7_xen/contrib/bind9/version projects/releng_7_xen/contrib/traceroute/ (props changed) projects/releng_7_xen/contrib/traceroute/traceroute.8 projects/releng_7_xen/contrib/traceroute/traceroute.c projects/releng_7_xen/include/ (props changed) projects/releng_7_xen/include/strings.h projects/releng_7_xen/include/time.h projects/releng_7_xen/include/unistd.h projects/releng_7_xen/lib/bind/ (props changed) projects/releng_7_xen/lib/bind/config.h projects/releng_7_xen/lib/libc/ (props changed) projects/releng_7_xen/lib/libc/amd64/SYS.h projects/releng_7_xen/lib/libc/amd64/gen/_setjmp.S projects/releng_7_xen/lib/libc/amd64/gen/fabs.S projects/releng_7_xen/lib/libc/amd64/gen/modf.S projects/releng_7_xen/lib/libc/amd64/gen/rfork_thread.S projects/releng_7_xen/lib/libc/amd64/gen/setjmp.S projects/releng_7_xen/lib/libc/amd64/gen/sigsetjmp.S projects/releng_7_xen/lib/libc/amd64/stdlib/div.S projects/releng_7_xen/lib/libc/amd64/stdlib/ldiv.S projects/releng_7_xen/lib/libc/amd64/stdlib/lldiv.S projects/releng_7_xen/lib/libc/amd64/string/bcmp.S projects/releng_7_xen/lib/libc/amd64/string/bcopy.S projects/releng_7_xen/lib/libc/amd64/string/bzero.S projects/releng_7_xen/lib/libc/amd64/string/memcmp.S projects/releng_7_xen/lib/libc/amd64/string/memset.S projects/releng_7_xen/lib/libc/amd64/string/strcat.S projects/releng_7_xen/lib/libc/amd64/string/strcmp.S projects/releng_7_xen/lib/libc/amd64/string/strcpy.S projects/releng_7_xen/lib/libc/amd64/sys/brk.S projects/releng_7_xen/lib/libc/amd64/sys/exect.S projects/releng_7_xen/lib/libc/amd64/sys/getcontext.S projects/releng_7_xen/lib/libc/amd64/sys/pipe.S projects/releng_7_xen/lib/libc/amd64/sys/ptrace.S projects/releng_7_xen/lib/libc/amd64/sys/reboot.S projects/releng_7_xen/lib/libc/amd64/sys/sbrk.S projects/releng_7_xen/lib/libc/amd64/sys/setlogin.S projects/releng_7_xen/lib/libc/amd64/sys/vfork.S projects/releng_7_xen/lib/libc/i386/SYS.h projects/releng_7_xen/lib/libc/i386/gen/_ctx_start.S projects/releng_7_xen/lib/libc/i386/gen/_setjmp.S projects/releng_7_xen/lib/libc/i386/gen/fabs.S projects/releng_7_xen/lib/libc/i386/gen/modf.S projects/releng_7_xen/lib/libc/i386/gen/rfork_thread.S projects/releng_7_xen/lib/libc/i386/gen/setjmp.S projects/releng_7_xen/lib/libc/i386/gen/sigsetjmp.S projects/releng_7_xen/lib/libc/i386/stdlib/abs.S projects/releng_7_xen/lib/libc/i386/stdlib/div.S projects/releng_7_xen/lib/libc/i386/stdlib/labs.S projects/releng_7_xen/lib/libc/i386/stdlib/ldiv.S projects/releng_7_xen/lib/libc/i386/string/bcmp.S projects/releng_7_xen/lib/libc/i386/string/bcopy.S projects/releng_7_xen/lib/libc/i386/string/bzero.S projects/releng_7_xen/lib/libc/i386/string/ffs.S projects/releng_7_xen/lib/libc/i386/string/index.S projects/releng_7_xen/lib/libc/i386/string/memchr.S projects/releng_7_xen/lib/libc/i386/string/memcmp.S projects/releng_7_xen/lib/libc/i386/string/memset.S projects/releng_7_xen/lib/libc/i386/string/rindex.S projects/releng_7_xen/lib/libc/i386/string/strcat.S projects/releng_7_xen/lib/libc/i386/string/strchr.S projects/releng_7_xen/lib/libc/i386/string/strcmp.S projects/releng_7_xen/lib/libc/i386/string/strcpy.S projects/releng_7_xen/lib/libc/i386/string/strlen.S projects/releng_7_xen/lib/libc/i386/string/strncmp.S projects/releng_7_xen/lib/libc/i386/string/strrchr.S projects/releng_7_xen/lib/libc/i386/string/swab.S projects/releng_7_xen/lib/libc/i386/string/wcschr.S projects/releng_7_xen/lib/libc/i386/string/wcscmp.S projects/releng_7_xen/lib/libc/i386/string/wcslen.S projects/releng_7_xen/lib/libc/i386/string/wmemchr.S projects/releng_7_xen/lib/libc/i386/sys/Ovfork.S projects/releng_7_xen/lib/libc/i386/sys/brk.S projects/releng_7_xen/lib/libc/i386/sys/exect.S projects/releng_7_xen/lib/libc/i386/sys/getcontext.S projects/releng_7_xen/lib/libc/i386/sys/pipe.S projects/releng_7_xen/lib/libc/i386/sys/ptrace.S projects/releng_7_xen/lib/libc/i386/sys/reboot.S projects/releng_7_xen/lib/libc/i386/sys/sbrk.S projects/releng_7_xen/lib/libc/i386/sys/setlogin.S projects/releng_7_xen/lib/libc/i386/sys/syscall.S projects/releng_7_xen/lib/libc/stdlib/malloc.3 projects/releng_7_xen/lib/libc/stdlib/malloc.c projects/releng_7_xen/lib/libc/string/Makefile.inc projects/releng_7_xen/lib/libc/string/Symbol.map projects/releng_7_xen/lib/libc/string/ffs.3 projects/releng_7_xen/lib/libcam/ (props changed) projects/releng_7_xen/lib/libcam/camlib.c projects/releng_7_xen/libexec/rtld-elf/ (props changed) projects/releng_7_xen/libexec/rtld-elf/rtld.c projects/releng_7_xen/release/Makefile projects/releng_7_xen/release/doc/en_US.ISO8859-1/hardware/article.sgml projects/releng_7_xen/release/doc/en_US.ISO8859-1/relnotes/article.sgml projects/releng_7_xen/release/doc/zh_CN.GB2312/hardware/article.sgml projects/releng_7_xen/release/doc/zh_CN.GB2312/relnotes/article.sgml projects/releng_7_xen/sbin/geom/ (props changed) projects/releng_7_xen/sbin/geom/class/part/ (props changed) projects/releng_7_xen/sbin/geom/class/part/Makefile projects/releng_7_xen/sbin/geom/class/part/geom_part.c projects/releng_7_xen/sbin/geom/class/part/gpart.8 projects/releng_7_xen/sbin/geom/misc/ (props changed) projects/releng_7_xen/share/man/man4/ (props changed) projects/releng_7_xen/share/man/man4/Makefile projects/releng_7_xen/share/man/man4/em.4 projects/releng_7_xen/sys/ (props changed) projects/releng_7_xen/sys/compat/freebsd32/freebsd32_misc.c projects/releng_7_xen/sys/compat/linux/linux_emul.c projects/releng_7_xen/sys/dev/aac/aac_pci.c projects/releng_7_xen/sys/dev/bce/if_bce.c projects/releng_7_xen/sys/dev/bce/if_bcefw.h projects/releng_7_xen/sys/dev/bce/if_bcereg.h projects/releng_7_xen/sys/dev/esp/esp_sbus.c projects/releng_7_xen/sys/dev/esp/ncr53c9x.c projects/releng_7_xen/sys/dev/esp/ncr53c9xreg.h projects/releng_7_xen/sys/dev/esp/ncr53c9xvar.h projects/releng_7_xen/sys/dev/et/if_et.c projects/releng_7_xen/sys/dev/le/if_le_ledma.c projects/releng_7_xen/sys/dev/mfi/mfi.c projects/releng_7_xen/sys/dev/mfi/mfi_ioctl.h projects/releng_7_xen/sys/dev/mfi/mfi_pci.c projects/releng_7_xen/sys/dev/mfi/mfireg.h projects/releng_7_xen/sys/dev/mfi/mfivar.h projects/releng_7_xen/sys/dev/mii/atphy.c projects/releng_7_xen/sys/dev/pccbb/pccbb_pci.c projects/releng_7_xen/sys/geom/part/g_part_gpt.c projects/releng_7_xen/sys/kern/kern_proc.c projects/releng_7_xen/sys/kern/kern_time.c projects/releng_7_xen/sys/kern/subr_smp.c projects/releng_7_xen/sys/kern/vfs_subr.c projects/releng_7_xen/sys/kern/vfs_vnops.c projects/releng_7_xen/sys/modules/cxgb/ (props changed) projects/releng_7_xen/sys/net/if_atmsubr.c projects/releng_7_xen/sys/net/if_fwsubr.c projects/releng_7_xen/sys/net/if_iso88025subr.c projects/releng_7_xen/sys/net/route.c projects/releng_7_xen/sys/net/route.h projects/releng_7_xen/sys/net80211/ieee80211_freebsd.h projects/releng_7_xen/sys/netinet/if_ether.c projects/releng_7_xen/sys/netinet/in_rmx.c projects/releng_7_xen/sys/netinet/in_var.h projects/releng_7_xen/sys/netinet/tcp_input.c projects/releng_7_xen/sys/netinet/tcp_sack.c projects/releng_7_xen/sys/netinet/tcp_syncache.c projects/releng_7_xen/sys/sparc64/sbus/dma_sbus.c projects/releng_7_xen/sys/sparc64/sbus/lsi64854.c projects/releng_7_xen/sys/sparc64/sbus/lsi64854var.h projects/releng_7_xen/sys/sparc64/sparc64/db_trace.c projects/releng_7_xen/sys/sparc64/sparc64/stack_machdep.c projects/releng_7_xen/sys/sun4v/sun4v/db_trace.c projects/releng_7_xen/sys/sun4v/sun4v/stack_machdep.c projects/releng_7_xen/sys/sys/time.h projects/releng_7_xen/sys/sys/user.h projects/releng_7_xen/sys/ufs/ffs/ffs_snapshot.c projects/releng_7_xen/sys/ufs/ffs/ffs_vnops.c projects/releng_7_xen/sys/ufs/ufs/ufs_vnops.c projects/releng_7_xen/usr.bin/sed/ (props changed) projects/releng_7_xen/usr.bin/sed/compile.c projects/releng_7_xen/usr.sbin/ (props changed) projects/releng_7_xen/usr.sbin/portsnap/ (props changed) projects/releng_7_xen/usr.sbin/portsnap/portsnap/portsnap.8 projects/releng_7_xen/usr.sbin/sysinstall/dist.c projects/releng_7_xen/usr.sbin/traceroute/ (props changed) projects/releng_7_xen/usr.sbin/traceroute/Makefile Modified: projects/releng_7_xen/Makefile.inc1 ============================================================================== --- projects/releng_7_xen/Makefile.inc1 Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/Makefile.inc1 Sun Nov 23 05:39:49 2008 (r185198) @@ -487,6 +487,9 @@ distribute32 install32: .if ${MK_CRYPT} != "no" cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} .endif +.if ${MK_KERBEROS} != "no" + cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} +.endif cd ${.CURDIR}/libexec/rtld-elf; \ PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} Modified: projects/releng_7_xen/bin/chio/chio.c ============================================================================== --- projects/releng_7_xen/bin/chio/chio.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/bin/chio/chio.c Sun Nov 23 05:39:49 2008 (r185198) @@ -69,7 +69,7 @@ static const char *bits_to_string(ces_st static void find_element(char *, uint16_t *, uint16_t *); static struct changer_element_status *get_element_status - (unsigned int, unsigned int); + (unsigned int, unsigned int, int); static int do_move(const char *, int, char **); static int do_exchange(const char *, int, char **); @@ -969,7 +969,8 @@ do_return(const char *cname, int argc, c ++argv; --argc; /* Get the status */ - ces = get_element_status((unsigned int)type, (unsigned int)element); + ces = get_element_status((unsigned int)type, (unsigned int)element, + CHET_VT == type); if (NULL == ces) errx(1, "%s: null element status pointer", cname); @@ -1004,7 +1005,7 @@ usage: * should free() it when done. */ static struct changer_element_status * -get_element_status(unsigned int type, unsigned int element) +get_element_status(unsigned int type, unsigned int element, int use_voltags) { struct changer_element_status_request cesr; struct changer_element_status *ces; @@ -1020,7 +1021,8 @@ get_element_status(unsigned int type, un cesr.cesr_element_type = (uint16_t)type; cesr.cesr_element_base = (uint16_t)element; cesr.cesr_element_count = 1; /* Only this one element */ - cesr.cesr_flags |= CESR_VOLTAGS; /* Grab voltags as well */ + if (use_voltags) + cesr.cesr_flags |= CESR_VOLTAGS; /* Grab voltags as well */ cesr.cesr_element_status = ces; if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { Modified: projects/releng_7_xen/contrib/bind9/CHANGES ============================================================================== --- projects/releng_7_xen/contrib/bind9/CHANGES Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/CHANGES Sun Nov 23 05:39:49 2008 (r185198) @@ -1,3 +1,47 @@ + --- 9.4.2-P2 released --- + +2406. [bug] Some operating systems have FD_SETSIZE set to a + low value by default, which can cause resource + exhaustion when many simultaneous connections are + open. Linux in particular makes it difficult to + increase this value. To use more sockets with + select(), set ISC_SOCKET_FDSETSIZE. Example: + STD_CDEFINES="-DISC_SOCKET_FDSETSIZE=4096" ./configure + (This should not be necessary in most cases, and + never for an authoritative-only server.) [RT #18328] + +2404. [port] hpux: files unlimited support. + +2403. [bug] TSIG context leak. [RT #18341] + +2402. [port] Support Solaris 2.11 and over. [RT #18362] + +2401. [bug] Expect to get E[MN]FILE errno internal_accept() + (from accept() or fcntl() system calls). [RT #18358] + +2399. [bug] Abort timeout queries to reduce the number of open + UDP sockets. [RT #18367] + +2398. [bug] Improve file descriptor management. New, + temporary, named.conf option reserved-sockets, + default 512. [RT #18344] + +2396. [bug] Don't set SO_REUSEADDR for randomized ports. + [RT #18336] + +2395. [port] Avoid warning and no effect from "files unlimited" + on Linux when running as root. [RT #18335] + +2394. [bug] Default configuration options set the limit for + open files to 'unlimited' as described in the + documentation. [RT #18331] + +2392. [bug] remove 'grep -q' from acl test script, some platforms + don't support it. [RT #18253] + +2322. [port] MacOS: work around the limitation of setrlimit() + for RLIMIT_NOFILE. [RT #17526] + --- 9.4.2-P1 released --- 2375. [security] Fully randomize UDP query ports to improve @@ -33,7 +77,7 @@ [RT #17113] 2249. [bug] Only set Authentic Data bit if client requested - DNSSEC, per RFC 3655 [RT #17175] + DNSSEC, per RFC 3655 [RT #17175] 2248. [cleanup] Fix several errors reported by Coverity. [RT #17160] Modified: projects/releng_7_xen/contrib/bind9/COPYRIGHT ============================================================================== --- projects/releng_7_xen/contrib/bind9/COPYRIGHT Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/COPYRIGHT Sun Nov 23 05:39:49 2008 (r185198) @@ -1,4 +1,4 @@ -Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") +Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") Copyright (C) 1996-2003 Internet Software Consortium. Permission to use, copy, modify, and/or distribute this software for any @@ -13,7 +13,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -$Id: COPYRIGHT,v 1.9.18.4 2007/08/28 07:19:54 tbox Exp $ +$Id: COPYRIGHT,v 1.9.18.4.10.1 2008/07/23 07:28:54 tbox Exp $ Portions Copyright (C) 1996-2001 Nominum, Inc. Modified: projects/releng_7_xen/contrib/bind9/bin/dig/dighost.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/dig/dighost.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/dig/dighost.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.259.18.43 2007/08/28 07:19:55 tbox Exp $ */ +/* $Id: dighost.c,v 1.259.18.43.10.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file * \note @@ -2217,14 +2217,15 @@ send_tcp_connect(dig_query_t *query) { sockcount++; debug("sockcount=%d", sockcount); if (specified_source) - result = isc_socket_bind(query->sock, &bind_address); + result = isc_socket_bind(query->sock, &bind_address, + ISC_SOCKET_REUSEADDRESS); else { if ((isc_sockaddr_pf(&query->sockaddr) == AF_INET) && have_ipv4) isc_sockaddr_any(&bind_any); else isc_sockaddr_any6(&bind_any); - result = isc_socket_bind(query->sock, &bind_any); + result = isc_socket_bind(query->sock, &bind_any, 0); } check_result(result, "isc_socket_bind"); bringup_timer(query, TCP_TIMEOUT); @@ -2271,11 +2272,12 @@ send_udp(dig_query_t *query) { sockcount++; debug("sockcount=%d", sockcount); if (specified_source) { - result = isc_socket_bind(query->sock, &bind_address); + result = isc_socket_bind(query->sock, &bind_address, + ISC_SOCKET_REUSEADDRESS); } else { isc_sockaddr_anyofpf(&bind_any, isc_sockaddr_pf(&query->sockaddr)); - result = isc_socket_bind(query->sock, &bind_any); + result = isc_socket_bind(query->sock, &bind_any, 0); } check_result(result, "isc_socket_bind"); Modified: projects/releng_7_xen/contrib/bind9/bin/named/client.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/named/client.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/named/client.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: client.c,v 1.219.18.28.10.1 2008/05/22 21:28:04 each Exp $ */ +/* $Id: client.c,v 1.219.18.28.10.2 2008/07/23 07:28:54 tbox Exp $ */ #include Modified: projects/releng_7_xen/contrib/bind9/bin/named/config.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/named/config.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/named/config.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.c,v 1.47.18.32 2007/09/13 05:04:01 each Exp $ */ +/* $Id: config.c,v 1.47.18.32.10.3 2008/07/23 23:48:17 tbox Exp $ */ /*! \file */ @@ -52,7 +52,7 @@ options {\n\ #ifndef WIN32 " coresize default;\n\ datasize default;\n\ - files default;\n\ + files unlimited;\n\ stacksize default;\n" #endif " deallocate-on-exit true;\n\ @@ -99,6 +99,7 @@ options {\n\ use-ixfr true;\n\ edns-udp-size 4096;\n\ max-udp-size 4096;\n\ + reserved-sockets 512;\n\ \n\ /* view */\n\ allow-notify {none;};\n\ Modified: projects/releng_7_xen/contrib/bind9/bin/named/controlconf.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/named/controlconf.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/named/controlconf.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001-2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: controlconf.c,v 1.40.18.10 2006/12/07 04:53:02 marka Exp $ */ +/* $Id: controlconf.c,v 1.40.18.10.40.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -1151,8 +1151,8 @@ add_listener(ns_controls_t *cp, controll type, &listener->sock); if (result == ISC_R_SUCCESS) - result = isc_socket_bind(listener->sock, - &listener->address); + result = isc_socket_bind(listener->sock, &listener->address, + ISC_SOCKET_REUSEADDRESS); if (result == ISC_R_SUCCESS && type == isc_sockettype_unix) { listener->perm = cfg_obj_asuint32(cfg_tuple_get(control, Modified: projects/releng_7_xen/contrib/bind9/bin/named/interfacemgr.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/named/interfacemgr.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/named/interfacemgr.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: interfacemgr.c,v 1.76.18.8 2006/07/20 01:10:30 marka Exp $ */ +/* $Id: interfacemgr.c,v 1.76.18.8.44.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -307,7 +307,8 @@ ns_interface_accepttcp(ns_interface_t *i #ifndef ISC_ALLOW_MAPPED isc_socket_ipv6only(ifp->tcpsocket, ISC_TRUE); #endif - result = isc_socket_bind(ifp->tcpsocket, &ifp->addr); + result = isc_socket_bind(ifp->tcpsocket, &ifp->addr, + ISC_SOCKET_REUSEADDRESS); if (result != ISC_R_SUCCESS) { isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERROR, "binding TCP socket: %s", Modified: projects/releng_7_xen/contrib/bind9/bin/named/lwresd.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/named/lwresd.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/named/lwresd.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lwresd.c,v 1.46.18.7 2006/03/02 00:37:21 marka Exp $ */ +/* $Id: lwresd.c,v 1.46.18.7.52.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file * \brief @@ -576,7 +576,8 @@ listener_bind(ns_lwreslistener_t *listen return (result); } - result = isc_socket_bind(sock, &listener->address); + result = isc_socket_bind(sock, &listener->address, + ISC_SOCKET_REUSEADDRESS); if (result != ISC_R_SUCCESS) { char socktext[ISC_SOCKADDR_FORMATSIZE]; isc_sockaddr_format(&listener->address, socktext, Modified: projects/releng_7_xen/contrib/bind9/bin/named/named.conf.docbook ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/named/named.conf.docbook Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/named/named.conf.docbook Sun Nov 23 05:39:49 2008 (r185198) @@ -2,7 +2,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []> - + Aug 13, 2004 @@ -40,6 +40,7 @@ 2005 2006 2007 + 2008 Internet Systems Consortium, Inc. ("ISC") @@ -201,6 +202,7 @@ options { port integer; querylog boolean; recursing-file quoted_string; + reserved-sockets integer; random-device quoted_string; recursive-clients integer; serial-query-rate integer; Modified: projects/releng_7_xen/contrib/bind9/bin/named/server.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/named/server.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/named/server.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.419.18.57.10.1 2008/05/22 21:28:04 each Exp $ */ +/* $Id: server.c,v 1.419.18.57.10.3 2008/07/23 12:04:32 marka Exp $ */ /*! \file */ @@ -2696,27 +2696,29 @@ static isc_result_t load_configuration(const char *filename, ns_server_t *server, isc_boolean_t first_time) { - isc_result_t result; - isc_interval_t interval; - cfg_parser_t *parser = NULL; + cfg_aclconfctx_t aclconfctx; cfg_obj_t *config; - const cfg_obj_t *options; - const cfg_obj_t *views; + cfg_parser_t *parser = NULL; + const cfg_listelt_t *element; + const cfg_obj_t *builtin_views; + const cfg_obj_t *maps[3]; const cfg_obj_t *obj; + const cfg_obj_t *options; const cfg_obj_t *v4ports, *v6ports; - const cfg_obj_t *maps[3]; - const cfg_obj_t *builtin_views; - const cfg_listelt_t *element; + const cfg_obj_t *views; dns_view_t *view = NULL; dns_view_t *view_next; - dns_viewlist_t viewlist; dns_viewlist_t tmpviewlist; - cfg_aclconfctx_t aclconfctx; - isc_uint32_t interface_interval; - isc_uint32_t heartbeat_interval; - isc_uint32_t udpsize; + dns_viewlist_t viewlist; in_port_t listen_port; int i; + isc_interval_t interval; + isc_resourcevalue_t files; + isc_result_t result; + isc_uint32_t heartbeat_interval; + isc_uint32_t interface_interval; + isc_uint32_t reserved; + isc_uint32_t udpsize; cfg_aclconfctx_init(&aclconfctx); ISC_LIST_INIT(viewlist); @@ -2797,6 +2799,43 @@ load_configuration(const char *filename, set_limits(maps); /* + * Sanity check on "files" limit. + */ + result = isc_resource_curlimit(isc_resource_openfiles, &files); + if (result == ISC_R_SUCCESS && files < FD_SETSIZE) { + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_WARNING, + "the 'files' limit (%" ISC_PRINT_QUADFORMAT "u) " + "is less than FD_SETSIZE (%d), increase " + "'files' in named.conf or recompile with a " + "smaller FD_SETSIZE.", files, FD_SETSIZE); + if (files > FD_SETSIZE) + files = FD_SETSIZE; + } else + files = FD_SETSIZE; + + /* + * Set the number of socket reserved for TCP, stdio etc. + */ + obj = NULL; + result = ns_config_get(maps, "reserved-sockets", &obj); + INSIST(result == ISC_R_SUCCESS); + reserved = cfg_obj_asuint32(obj); + if (files < 128U) /* Prevent underflow. */ + reserved = 0; + else if (reserved > files - 128U) /* Mimimum UDP space. */ + reserved = files - 128; + if (reserved < 128U) /* Mimimum TCP/stdio space. */ + reserved = 128; + if (reserved + 128U > files) { + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_WARNING, + "less than 128 UDP sockets available after " + "applying 'reserved-sockets' and 'files'"); + } + isc__socketmgr_setreserved(ns_g_socketmgr, reserved); + + /* * Configure various server options. */ configure_server_quota(maps, "transfers-out", &server->xfroutquota); Modified: projects/releng_7_xen/contrib/bind9/bin/rndc/rndc.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/bin/rndc/rndc.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/bin/rndc/rndc.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rndc.c,v 1.96.18.17 2006/08/04 03:03:41 marka Exp $ */ +/* $Id: rndc.c,v 1.96.18.17.42.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -400,10 +400,10 @@ rndc_startconnect(isc_sockaddr_t *addr, DO("create socket", isc_socket_create(socketmgr, pf, type, &sock)); switch (isc_sockaddr_pf(addr)) { case AF_INET: - DO("bind socket", isc_socket_bind(sock, &local4)); + DO("bind socket", isc_socket_bind(sock, &local4, 0)); break; case AF_INET6: - DO("bind socket", isc_socket_bind(sock, &local6)); + DO("bind socket", isc_socket_bind(sock, &local6, 0)); break; default: break; Modified: projects/releng_7_xen/contrib/bind9/configure.in ============================================================================== --- projects/releng_7_xen/contrib/bind9/configure.in Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/configure.in Sun Nov 23 05:39:49 2008 (r185198) @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2003 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.355.18.71 $) +AC_REVISION($Revision: 1.355.18.71.8.2 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.59) @@ -1839,7 +1839,7 @@ case "$host" in [*-solaris2.[89]]) hack_shutup_pthreadonceinit=yes ;; - *-solaris2.10) + *-solaris2.1[0-9]) hack_shutup_pthreadonceinit=yes ;; esac Modified: projects/releng_7_xen/contrib/bind9/doc/arm/Bv9ARM-book.xml ============================================================================== --- projects/releng_7_xen/contrib/bind9/doc/arm/Bv9ARM-book.xml Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/doc/arm/Bv9ARM-book.xml Sun Nov 23 05:39:49 2008 (r185198) @@ -2,7 +2,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []> - + BIND 9 Administrator Reference Manual @@ -28,6 +28,7 @@ 2005 2006 2007 + 2008 Internet Systems Consortium, Inc. ("ISC") @@ -4441,6 +4442,7 @@ category notify { null; }; max-transfer-idle-in number; max-transfer-idle-out number; tcp-clients number; + reserved-sockets number; recursive-clients number; serial-query-rate number; serial-queries number; @@ -6606,6 +6608,23 @@ query-source-v6 address * port *; + reserved-sockets + + + The number of file descriptors reserved for TCP, stdio, + etc. This needs to be big enough to cover the number of + interfaces named listens on, tcp-clients as well as + to provide room for outgoing TCP queries and incoming zone + transfers. The default is 512. + The minimum value is 128 and the + maximum value is 128 less than + 'files' or FD_SETSIZE (whichever is smaller). This + option may be removed in the future. + + + + + max-cache-size Modified: projects/releng_7_xen/contrib/bind9/lib/bind/configure.in ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/bind/configure.in Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/bind/configure.in Sun Nov 23 05:39:49 2008 (r185198) @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2001, 2003 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -AC_REVISION($Revision: 1.90.18.34 $) +AC_REVISION($Revision: 1.90.18.34.10.2 $) AC_INIT(resolv/herror.c) AC_PREREQ(2.13) @@ -2590,7 +2590,7 @@ case "$host" in *-solaris2.9) hack_shutup_in6addr_init_macros=yes ;; - *-solaris2.10) + *-solaris2.1[0-9]) hack_shutup_in6addr_init_macros=yes ;; esac Modified: projects/releng_7_xen/contrib/bind9/lib/bind9/check.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/bind9/check.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/bind9/check.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1015,10 +1015,10 @@ check_zoneconf(const cfg_obj_t *zconfig, isc_buffer_add(&b, strlen(zname)); tresult = dns_name_fromtext(dns_fixedname_name(&fixedname), &b, dns_rootname, ISC_TRUE, NULL); - if (tresult != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS) { cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, "zone '%s': is not a valid name", zname); - result = ISC_R_FAILURE; + tresult = ISC_R_FAILURE; } else { char namebuf[DNS_NAME_FORMATSIZE]; Modified: projects/releng_7_xen/contrib/bind9/lib/dns/api ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/dns/api Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/dns/api Sun Nov 23 05:39:49 2008 (r185198) @@ -1,3 +1,3 @@ LIBINTERFACE = 35 -LIBREVISION = 0 +LIBREVISION = 1 LIBAGE = 0 Modified: projects/releng_7_xen/contrib/bind9/lib/dns/dispatch.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/dns/dispatch.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/dns/dispatch.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dispatch.c,v 1.116.18.19.12.1 2008/05/22 21:28:06 each Exp $ */ +/* $Id: dispatch.c,v 1.116.18.19.12.5 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -276,7 +276,26 @@ request_log(dns_dispatch_t *disp, dns_di } /* - * ARC4 random number generator obtained from OpenBSD + * ARC4 random number generator derived from OpenBSD. + * Only dispatch_arc4random() and dispatch_arc4uniformrandom() are expected + * to be called from general dispatch routines; the rest of them are subroutines + * for these two. + * + * The original copyright follows: + * Copyright (c) 1996, David Mazieres + * Copyright (c) 2008, Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ static void dispatch_arc4init(arc4ctx_t *actx) { @@ -1172,7 +1191,7 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) { static isc_result_t create_socket(isc_socketmgr_t *mgr, isc_sockaddr_t *local, - isc_socket_t **sockp) + unsigned int options, isc_socket_t **sockp) { isc_socket_t *sock; isc_result_t result; @@ -1186,7 +1205,7 @@ create_socket(isc_socketmgr_t *mgr, isc_ #ifndef ISC_ALLOW_MAPPED isc_socket_ipv6only(sock, ISC_TRUE); #endif - result = isc_socket_bind(sock, local); + result = isc_socket_bind(sock, local, options); if (result != ISC_R_SUCCESS) { isc_socket_detach(&sock); return (result); @@ -1917,7 +1936,7 @@ dispatch_createudp(dns_dispatchmgr_t *mg attributes &= ~DNS_DISPATCHATTR_RANDOMPORT; goto getsocket; } - result = create_socket(sockmgr, &localaddr_bound, &sock); + result = create_socket(sockmgr, &localaddr_bound, 0, &sock); if (result == ISC_R_ADDRINUSE) { if (++k == 1024) attributes &= ~DNS_DISPATCHATTR_RANDOMPORT; @@ -1925,7 +1944,8 @@ dispatch_createudp(dns_dispatchmgr_t *mg } localport = prt; } else - result = create_socket(sockmgr, localaddr, &sock); + result = create_socket(sockmgr, localaddr, + ISC_SOCKET_REUSEADDRESS, &sock); if (result != ISC_R_SUCCESS) goto deallocate_dispatch; if ((attributes & DNS_DISPATCHATTR_RANDOMPORT) == 0 && Modified: projects/releng_7_xen/contrib/bind9/lib/dns/include/dns/dispatch.h ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/dns/include/dns/dispatch.h Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/dns/include/dns/dispatch.h Sun Nov 23 05:39:49 2008 (r185198) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dispatch.h,v 1.48.18.5.12.1 2008/05/22 21:28:06 each Exp $ */ +/* $Id: dispatch.h,v 1.48.18.5.12.2 2008/07/23 07:28:56 tbox Exp $ */ #ifndef DNS_DISPATCH_H #define DNS_DISPATCH_H 1 Modified: projects/releng_7_xen/contrib/bind9/lib/dns/request.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/dns/request.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/dns/request.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: request.c,v 1.72.18.5 2006/08/21 00:40:53 marka Exp $ */ +/* $Id: request.c,v 1.72.18.5.42.2 2008/07/23 07:28:56 tbox Exp $ */ /*! \file */ @@ -518,11 +518,11 @@ create_tcp_dispatch(dns_requestmgr_t *re if (srcaddr == NULL) { isc_sockaddr_anyofpf(&bind_any, isc_sockaddr_pf(destaddr)); - result = isc_socket_bind(socket, &bind_any); + result = isc_socket_bind(socket, &bind_any, 0); } else { src = *srcaddr; isc_sockaddr_setport(&src, 0); - result = isc_socket_bind(socket, &src); + result = isc_socket_bind(socket, &src, 0); } if (result != ISC_R_SUCCESS) goto cleanup; Modified: projects/releng_7_xen/contrib/bind9/lib/dns/resolver.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/dns/resolver.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/dns/resolver.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.284.18.66.8.1 2008/05/22 21:28:06 each Exp $ */ +/* $Id: resolver.c,v 1.284.18.66.8.4 2008/07/24 05:00:48 jinmei Exp $ */ /*! \file */ @@ -1123,7 +1123,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddr goto cleanup_query; #ifndef BROKEN_TCP_BIND_BEFORE_CONNECT - result = isc_socket_bind(query->tcpsocket, &addr); + result = isc_socket_bind(query->tcpsocket, &addr, 0); if (result != ISC_R_SUCCESS) goto cleanup_socket; #endif @@ -2689,6 +2689,8 @@ fctx_destroy(fetchctx_t *fctx) { static void fctx_timeout(isc_task_t *task, isc_event_t *event) { fetchctx_t *fctx = event->ev_arg; + isc_timerevent_t *tevent = (isc_timerevent_t *)event; + resquery_t *query; REQUIRE(VALID_FCTX(fctx)); @@ -2704,8 +2706,18 @@ fctx_timeout(isc_task_t *task, isc_event fctx->timeouts++; /* * We could cancel the running queries here, or we could let - * them keep going. Right now we choose the latter... - */ + * them keep going. Since we normally use separate sockets for + * different queries, we adopt the former approach to reduce + * the number of open sockets: cancel the oldest query if it + * expired after the query had started (this is usually the + * case but is not always so, depending on the task schedule + * timing). + */ + query = ISC_LIST_HEAD(fctx->queries); + if (query != NULL && + isc_time_compare(&tevent->due, &query->start) >= 0) { + fctx_cancelquery(&query, NULL, NULL, ISC_TRUE); + } fctx->attributes &= ~FCTX_ATTR_ADDRWAIT; /* * Our timer has triggered. Reestablish the fctx lifetime Modified: projects/releng_7_xen/contrib/bind9/lib/dns/xfrin.c ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/dns/xfrin.c Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/dns/xfrin.c Sun Nov 23 05:39:49 2008 (r185198) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: xfrin.c,v 1.135.18.16 2007/10/31 01:59:47 marka Exp $ */ +/* $Id: xfrin.c,v 1.135.18.16.10.3 2008/07/23 23:16:43 marka Exp $ */ /*! \file */ @@ -862,7 +862,8 @@ xfrin_start(dns_xfrin_ctx_t *xfr) { isc_sockettype_tcp, &xfr->socket)); #ifndef BROKEN_TCP_BIND_BEFORE_CONNECT - CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr)); + CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr, + ISC_SOCKET_REUSEADDRESS)); #endif CHECK(isc_socket_connect(xfr->socket, &xfr->masteraddr, xfr->task, xfrin_connect_done, xfr)); Modified: projects/releng_7_xen/contrib/bind9/lib/isc/api ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/isc/api Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/isc/api Sun Nov 23 05:39:49 2008 (r185198) @@ -1,3 +1,3 @@ -LIBINTERFACE = 32 -LIBREVISION = 5 +LIBINTERFACE = 35 +LIBREVISION = 0 LIBAGE = 0 Modified: projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/resource.h ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/resource.h Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/resource.h Sun Nov 23 05:39:49 2008 (r185198) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resource.h,v 1.5.18.2 2005/04/29 00:17:02 marka Exp $ */ +/* $Id: resource.h,v 1.5.18.2.52.2 2008/07/23 23:48:17 tbox Exp $ */ #ifndef ISC_RESOURCE_H #define ISC_RESOURCE_H 1 @@ -81,6 +81,19 @@ isc_resource_getlimit(isc_resource_t res *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. */ +isc_result_t +isc_resource_curlimit(isc_resource_t resource, isc_resourcevalue_t *value); +/* + * Get the current limit on a resource. + * + * Requires: + * 'resource' is a valid member of the isc_resource_t enumeration. + * + * Returns: + * ISC_R_SUCCESS Success. + * ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS. + */ + ISC_LANG_ENDDECLS #endif /* ISC_RESOURCE_H */ Modified: projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/socket.h ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/socket.h Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/socket.h Sun Nov 23 05:39:49 2008 (r185198) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.h,v 1.57.18.6 2006/06/07 00:29:45 marka Exp $ */ +/* $Id: socket.h,v 1.57.18.6.46.4 2008/07/23 23:16:43 marka Exp $ */ #ifndef ISC_SOCKET_H #define ISC_SOCKET_H 1 @@ -77,6 +77,12 @@ ISC_LANG_BEGINDECLS */ #define ISC_SOCKET_MAXSCATTERGATHER 8 +/*% + * In isc_socket_bind() set socket option SO_REUSEADDR prior to calling + * bind() if a non zero port is specified (AF_INET and AF_INET6). + */ +#define ISC_SOCKET_REUSEADDRESS 0x01U + /*** *** Types ***/ @@ -312,7 +318,8 @@ isc_socket_detach(isc_socket_t **socketp */ isc_result_t -isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp); +isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp, + unsigned int options); /*%< * Bind 'socket' to '*addressp'. * @@ -747,6 +754,12 @@ isc_socket_permunix(isc_sockaddr_t *sock * \li #ISC_R_FAILURE */ +void +isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t); +/*%< + * Temporary. For use by named only. + */ + ISC_LANG_ENDDECLS #endif /* ISC_SOCKET_H */ Modified: projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/timer.h ============================================================================== --- projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/timer.h Sun Nov 23 01:51:14 2008 (r185197) +++ projects/releng_7_xen/contrib/bind9/lib/isc/include/isc/timer.h Sun Nov 23 05:39:49 2008 (r185198) @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: timer.h,v 1.31.18.3 2005/10/26 06:50:50 marka Exp $ */ +/* $Id: timer.h,v 1.31.18.3.52.2 2008/07/24 23:48:09 tbox Exp $ */ #ifndef ISC_TIMER_H #define ISC_TIMER_H 1 @@ -76,6 +76,7 @@ #include #include #include +#include ISC_LANG_BEGINDECLS @@ -93,6 +94,7 @@ typedef enum { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sun Nov 23 14:53:21 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 586FA1065670; Sun, 23 Nov 2008 14:53:21 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DCFF8FC16; Sun, 23 Nov 2008 14:53:21 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mANErLrB054761; Sun, 23 Nov 2008 14:53:21 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mANErL5Q054760; Sun, 23 Nov 2008 14:53:21 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200811231453.mANErL5Q054760@svn.freebsd.org> From: Ulf Lilleengen Date: Sun, 23 Nov 2008 14:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185203 - projects/csup_cvsmode/contrib/csup X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 14:53:21 -0000 Author: lulf Date: Sun Nov 23 14:53:21 2008 New Revision: 185203 URL: http://svn.freebsd.org/changeset/base/185203 Log: - Add support for reading RCS info from status file to avoid having to detail a file if it is up to date. Modified: projects/csup_cvsmode/contrib/csup/lister.c Modified: projects/csup_cvsmode/contrib/csup/lister.c ============================================================================== --- projects/csup_cvsmode/contrib/csup/lister.c Sun Nov 23 14:32:40 2008 (r185202) +++ projects/csup_cvsmode/contrib/csup/lister.c Sun Nov 23 14:53:21 2008 (r185203) @@ -64,10 +64,10 @@ static int lister_dofile(struct lister * struct statusrec *); static int lister_dodead(struct lister *, struct coll *, struct statusrec *); -#if 0 static int lister_dorcsfile(struct lister *, struct coll *, - struct statusrec *, int); -#endif + struct statusrec *); +static int lister_dorcsdead(struct lister *, struct coll *, + struct statusrec *); void * lister(void *arg) @@ -150,14 +150,13 @@ lister_coll(struct lister *l, struct col struct statusrec *sr; struct fattr *fa; size_t i; - int depth, error, ret, prunedepth, attic; + int depth, error, ret, prunedepth; wr = l->wr; depth = 0; prunedepth = INT_MAX; as = attrstack_new(); while ((ret = status_get(st, NULL, 0, 0, &sr)) == 1) { - attic = 0; switch (sr->sr_type) { case SR_DIRDOWN: depth++; @@ -194,20 +193,24 @@ lister_coll(struct lister *l, struct col goto bad; } break; -#if 0 case SR_FILEDEAD: - attic = 1; + if (depth < prunedepth) { + if (!(coll->co_options & CO_CHECKOUTMODE)) { + error = lister_dorcsdead(l, coll, sr); + if (error) + goto bad; + } + } + break; case SR_FILELIVE: if (depth < prunedepth) { if (!(coll->co_options & CO_CHECKOUTMODE)) { - error = lister_dorcsfile(l, coll, sr, - attic); + error = lister_dorcsfile(l, coll, sr); if (error) goto bad; } } break; -#endif } } if (ret == -1) { @@ -402,18 +405,15 @@ send: return (0); } -#if 0 -/* Handle a file live or file dead entry found in the status file. */ +/* Handle a rcs file live entry found in the status file. */ static int -lister_dorcsfile(struct lister *l, struct coll *coll, struct statusrec *sr, - int attic) +lister_dorcsfile(struct lister *l, struct coll *coll, struct statusrec *sr) { struct config *config; struct stream *wr; const struct fattr *sendattr; struct fattr *fa; char *path, *spath; - char cmd; size_t len; int error; @@ -422,7 +422,7 @@ lister_dorcsfile(struct lister *l, struc config = l->config; wr = l->wr; if (!coll->co_options & CO_TRUSTSTATUSFILE) { - path = cvspath(coll->co_prefix, sr->sr_file, attic); + path = cvspath(coll->co_prefix, sr->sr_file, 0); if (path == NULL) { spath = coll_statuspath(coll); xasprintf(&l->errmsg, "Error in \"%s\": " @@ -434,9 +434,11 @@ lister_dorcsfile(struct lister *l, struc free(path); } else fa = sr->sr_clientattr; - /* XXX: Perhaps check attic path name here. */ - cmd = attic ? 'F' : 'f'; if (fattr_equal(fa, sr->sr_clientattr)) { + /* + * If the file is an RCS file, we use "loose" equality, so sizes + * may disagress because of differences in whitespace. + */ if (isrcs(sr->sr_file, &len) && !(coll->co_options & CO_NORCS) && !(coll->co_options & CO_STRICTCHECKRCS)) { @@ -444,15 +446,18 @@ lister_dorcsfile(struct lister *l, struc } sendattr = fa; } else { + /* + * If different, the user may have changed it, so we report + * bogus attributes to force a full comparison. + */ sendattr = fattr_bogus; } - error = proto_printf(wr, "%c %s %F\n", cmd, pathlast(sr->sr_file), fa, + error = proto_printf(wr, "F %s %F\n", pathlast(sr->sr_file), sendattr, config->fasupport, coll->co_attrignore); if (error) return (LISTER_ERR_WRITE); return (0); } -#endif /* Handle a checkout dead entry found in the status file. */ static int @@ -508,3 +513,57 @@ lister_dodead(struct lister *l, struct c return (LISTER_ERR_WRITE); return (0); } + +/* Handle a rcs file dead entry found in the status file. */ +static int +lister_dorcsdead(struct lister *l, struct coll *coll, struct statusrec *sr) +{ + struct config *config; + struct stream *wr; + const struct fattr *sendattr; + struct fattr *fa; + char *path, *spath; + size_t len; + int error; + + if (!globtree_test(coll->co_filefilter, sr->sr_file)) + return (0); + config = l->config; + wr = l->wr; + if (!coll->co_options & CO_TRUSTSTATUSFILE) { + path = cvspath(coll->co_prefix, sr->sr_file, 1); + if (path == NULL) { + spath = coll_statuspath(coll); + xasprintf(&l->errmsg, "Error in \"%s\": " + "Invalid filename \"%s\"", spath, sr->sr_file); + free(spath); + return (LISTER_ERR_STATUS); + } + fa = fattr_frompath(path, FATTR_NOFOLLOW); + free(path); + } else + fa = sr->sr_clientattr; + if (fattr_equal(fa, sr->sr_clientattr)) { + /* + * If the file is an RCS file, we use "loose" equality, so sizes + * may disagress because of differences in whitespace. + */ + if (isrcs(sr->sr_file, &len) && + !(coll->co_options & CO_NORCS) && + !(coll->co_options & CO_STRICTCHECKRCS)) { + fattr_maskout(fa, FA_SIZE); + } + sendattr = fa; + } else { + /* + * If different, the user may have changed it, so we report + * bogus attributes to force a full comparison. + */ + sendattr = fattr_bogus; + } + error = proto_printf(wr, "f %s %F\n", pathlast(sr->sr_file), sendattr, + config->fasupport, coll->co_attrignore); + if (error) + return (LISTER_ERR_WRITE); + return (0); +} From owner-svn-src-projects@FreeBSD.ORG Sun Nov 23 16:44:49 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3AF21065670; Sun, 23 Nov 2008 16:44:49 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A69BE8FC20; Sun, 23 Nov 2008 16:44:49 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mANGinld057438; Sun, 23 Nov 2008 16:44:49 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mANGins6057436; Sun, 23 Nov 2008 16:44:49 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200811231644.mANGins6057436@svn.freebsd.org> From: Ulf Lilleengen Date: Sun, 23 Nov 2008 16:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185211 - projects/csup_cvsmode/contrib/csup X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 16:44:49 -0000 Author: lulf Date: Sun Nov 23 16:44:49 2008 New Revision: 185211 URL: http://svn.freebsd.org/changeset/base/185211 Log: - Make sure comparisons are done on file types as well. - Handle the case where a repository may have been copied, and the symlinks have not been preserved. CVSup removes the files and creates the symlinks, so enable this behaviour in csup as well. - While there, fix comments and style issues. Modified: projects/csup_cvsmode/contrib/csup/fattr.c projects/csup_cvsmode/contrib/csup/updater.c Modified: projects/csup_cvsmode/contrib/csup/fattr.c ============================================================================== --- projects/csup_cvsmode/contrib/csup/fattr.c Sun Nov 23 16:08:36 2008 (r185210) +++ projects/csup_cvsmode/contrib/csup/fattr.c Sun Nov 23 16:44:49 2008 (r185211) @@ -840,6 +840,19 @@ fattr_install(struct fattr *fa, const ch } #endif + /* + * If it is changed from a file to a symlink, remove the file + * and create the symlink. + */ + if (inplace && (fa->type == FT_SYMLINK) && + (old->type == FT_FILE)) { + error = unlink(topath); + if (error) + goto bad; + error = symlink(fa->linktarget, topath); + if (error) + goto bad; + } /* Determine whether we need to remove the target first. */ if (!inplace && (fa->type == FT_DIRECTORY) != (old->type == FT_DIRECTORY)) { @@ -919,6 +932,9 @@ fattr_equal(const struct fattr *fa1, con mask = fa1->mask & fa2->mask; if (fa1->type == FT_UNKNOWN || fa2->type == FT_UNKNOWN) return (0); + if (mask & FA_FILETYPE) + if (fa1->type != fa2->type) + return (0); if (mask & FA_MODTIME) if (fa1->modtime != fa2->modtime) return (0); Modified: projects/csup_cvsmode/contrib/csup/updater.c ============================================================================== --- projects/csup_cvsmode/contrib/csup/updater.c Sun Nov 23 16:08:36 2008 (r185210) +++ projects/csup_cvsmode/contrib/csup/updater.c Sun Nov 23 16:44:49 2008 (r185211) @@ -1255,13 +1255,13 @@ updater_diff_apply(struct updater *up, s /* Update or create a node. */ static int -updater_updatenode(struct updater *up, struct coll *coll, struct file_update *fup, char *name, - char *attr) +updater_updatenode(struct updater *up, struct coll *coll, + struct file_update *fup, char *name, char *attr) { struct fattr *fa, *fileattr; struct status *st; struct statusrec *sr; - int error, issymlink, rv; + int error, rv; sr = &fup->srbuf; st = fup->st; @@ -1270,10 +1270,8 @@ updater_updatenode(struct updater *up, s if (fattr_type(fa) == FT_SYMLINK) { lprintf(1, " Symlink %s -> %s\n", name, fattr_getlinktarget(fa)); - issymlink = 1; } else { lprintf(1, " Mknod %s\n", name); - issymlink = 0; } /* Create directory. */ @@ -1281,11 +1279,11 @@ updater_updatenode(struct updater *up, s if (error) return (UPDATER_ERR_PROTO); - /* If it exists, update attributes. */ + /* If it does not exist, create it. */ if (access(fup->destpath, F_OK) != 0) fattr_makenode(fa, fup->destpath); - - /* + + /* * Coming from attic? I don't think this is a problem since we have * determined attic before we call this function (Look at UpdateNode in * cvsup). From owner-svn-src-projects@FreeBSD.ORG Sun Nov 23 19:43:46 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F0E2106564A; Sun, 23 Nov 2008 19:43:46 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1918FC16; Sun, 23 Nov 2008 19:43:46 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mANJhkxK061386; Sun, 23 Nov 2008 19:43:46 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mANJhk2x061385; Sun, 23 Nov 2008 19:43:46 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200811231943.mANJhk2x061385@svn.freebsd.org> From: Ulf Lilleengen Date: Sun, 23 Nov 2008 19:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185215 - projects/csup_cvsmode/usr.bin/csup X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 19:43:46 -0000 Author: lulf Date: Sun Nov 23 19:43:45 2008 New Revision: 185215 URL: http://svn.freebsd.org/changeset/base/185215 Log: - Add missing rsyncfile from Makefile Modified: projects/csup_cvsmode/usr.bin/csup/Makefile Modified: projects/csup_cvsmode/usr.bin/csup/Makefile ============================================================================== --- projects/csup_cvsmode/usr.bin/csup/Makefile Sun Nov 23 18:39:08 2008 (r185214) +++ projects/csup_cvsmode/usr.bin/csup/Makefile Sun Nov 23 19:43:45 2008 (r185215) @@ -23,6 +23,7 @@ SRCS= attrstack.c \ proto.c \ rcsfile.c \ rcsparse.c \ + rsyncfile.c \ status.c \ stream.c \ threads.c \ @@ -31,7 +32,7 @@ SRCS= attrstack.c \ CFLAGS+= -I. -I${.CURDIR}/../../contrib/csup CFLAGS+= -DHAVE_FFLAGS -DNDEBUG -WARNS?= 6 +WARNS?= 1 DPADD= ${LIBCRYPTO} ${LIBZ} ${LIBPTHREAD} LDADD= -lcrypto -lz -lpthread From owner-svn-src-projects@FreeBSD.ORG Sun Nov 23 19:59:43 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2767F1065675; Sun, 23 Nov 2008 19:59:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11D028FC14; Sun, 23 Nov 2008 19:59:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mANJxhus062515; Sun, 23 Nov 2008 19:59:43 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mANJxgNg062507; Sun, 23 Nov 2008 19:59:42 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811231959.mANJxgNg062507@svn.freebsd.org> From: Sam Leffler Date: Sun, 23 Nov 2008 19:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185222 - in projects/makefs: . compat compat/machine compat/mtree ffs sys sys/sys sys/ufs sys/ufs/ffs sys/ufs/ufs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 19:59:43 -0000 Author: sam Date: Sun Nov 23 19:59:42 2008 New Revision: 185222 URL: http://svn.freebsd.org/changeset/base/185222 Log: prepare makefs for import to base Added: projects/makefs/ projects/makefs/Makefile (contents, props changed) projects/makefs/compat/ projects/makefs/compat/compat_defs.h (contents, props changed) projects/makefs/compat/fparseln.c (contents, props changed) projects/makefs/compat/getmode.c (contents, props changed) projects/makefs/compat/machine/ projects/makefs/compat/machine/bswap.h (contents, props changed) projects/makefs/compat/mtree/ projects/makefs/compat/mtree/extern.h (contents, props changed) projects/makefs/compat/mtree/getid.c (contents, props changed) projects/makefs/compat/mtree/misc.c (contents, props changed) projects/makefs/compat/mtree/mtree.h (contents, props changed) projects/makefs/compat/mtree/spec.c (contents, props changed) projects/makefs/compat/namespace.h (contents, props changed) projects/makefs/compat/nbtool_config.h (contents, props changed) projects/makefs/compat/pack_dev.c (contents, props changed) projects/makefs/compat/pack_dev.h (contents, props changed) projects/makefs/compat/pwcache.c (contents, props changed) projects/makefs/compat/pwcache.h (contents, props changed) projects/makefs/compat/stat_flags.c (contents, props changed) projects/makefs/compat/stat_flags.h (contents, props changed) projects/makefs/compat/strsuftoll.c (contents, props changed) projects/makefs/compat/util.h (contents, props changed) projects/makefs/compat/vis.c (contents, props changed) projects/makefs/compat/vis.h (contents, props changed) projects/makefs/ffs/ projects/makefs/ffs.c (contents, props changed) projects/makefs/ffs/buf.c (contents, props changed) projects/makefs/ffs/buf.h (contents, props changed) projects/makefs/ffs/ffs_alloc.c (contents, props changed) projects/makefs/ffs/ffs_balloc.c (contents, props changed) projects/makefs/ffs/ffs_extern.h (contents, props changed) projects/makefs/ffs/mkfs.c (contents, props changed) projects/makefs/ffs/newfs_extern.h (contents, props changed) projects/makefs/ffs/ufs_bmap.c (contents, props changed) projects/makefs/ffs/ufs_inode.h (contents, props changed) projects/makefs/makefs.8 (contents, props changed) projects/makefs/makefs.c (contents, props changed) projects/makefs/makefs.h (contents, props changed) projects/makefs/sys/ projects/makefs/sys/sys/ projects/makefs/sys/sys/queue.h (contents, props changed) projects/makefs/sys/ufs/ projects/makefs/sys/ufs/ffs/ projects/makefs/sys/ufs/ffs/ffs_bswap.c (contents, props changed) projects/makefs/sys/ufs/ffs/ffs_extern.h (contents, props changed) projects/makefs/sys/ufs/ffs/ffs_subr.c (contents, props changed) projects/makefs/sys/ufs/ffs/ffs_tables.c (contents, props changed) projects/makefs/sys/ufs/ffs/fs.h (contents, props changed) projects/makefs/sys/ufs/ufs/ projects/makefs/sys/ufs/ufs/dinode.h (contents, props changed) projects/makefs/sys/ufs/ufs/dir.h (contents, props changed) projects/makefs/sys/ufs/ufs/ufs_bswap.h (contents, props changed) projects/makefs/walk.c (contents, props changed) Added: projects/makefs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/makefs/Makefile Sun Nov 23 19:59:42 2008 (r185222) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +PROG= makefs +COMPAT_MTREE= getid.c misc.c spec.c +COMPAT= fparseln.c getmode.c pack_dev.c pwcache.c stat_flags.c \ + strsuftoll.c vis.c +SRCS= ffs.c makefs.c walk.c \ + buf.c ffs_alloc.c ffs_balloc.c mkfs.c ufs_bmap.c \ + ffs_bswap.c ffs_subr.c ffs_tables.c \ + ${COMPAT} ${COMPAT_MTREE} +MAN= makefs.8 + +CFLAGS+=-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 +CFLAGS+=-I. +CFLAGS+=-Icompat -Icompat/mtree +CFLAGS+=-Iffs -Isys -Isys/ufs + +.PATH: compat compat/mtree ffs sys/ufs/ufs sys/ufs/ffs + +WARNS?= 2 + +.include Added: projects/makefs/compat/compat_defs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/makefs/compat/compat_defs.h Sun Nov 23 19:59:42 2008 (r185222) @@ -0,0 +1,167 @@ +/* $NetBSD: compat_defs.h,v 1.43 2004/06/23 11:08:01 tron Exp $ */ + +#ifndef __NETBSD_COMPAT_DEFS_H__ +#define __NETBSD_COMPAT_DEFS_H__ + +/* Work around some complete brain damage. */ + +#undef _POSIX_SOURCE +#undef _POSIX_C_SOURCE + +/* System headers needed for (re)definitions below. */ + +#include +#include +#include +/* time.h needs to be pulled in first at least on netbsd w/o _NETBSD_SOURCE */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if HAVE_SYS_CDEFS_H +#include +#endif +#if HAVE_SYS_SYSLIMITS_H +#include +#endif +#if HAVE_SYS_SYSMACROS_H +/* major(), minor() on SVR4 */ +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDDEF_H +#include +#endif + +/* We don't include here, so that "compat_pwd.h" works. */ +struct passwd; + +/* Some things usually in BSD . */ +#ifndef __RENAME +#define __RENAME(x) +#endif + +/* Dirent support. */ +#include +#define NAMLEN(dirent) (strlen((dirent)->d_name)) + +#if !HAVE_FPARSELN || defined(__NetBSD__) +# define FPARSELN_UNESCESC 0x01 +# define FPARSELN_UNESCCONT 0x02 +# define FPARSELN_UNESCCOMM 0x04 +# define FPARSELN_UNESCREST 0x08 +# define FPARSELN_UNESCALL 0x0f +char *fparseln(FILE *, size_t *, size_t *, const char [3], int); +#endif + +#define __nbcompat_bswap16(x) ((((x) << 8) & 0xff00) | (((x) >> 8) & 0x00ff)) + +#define __nbcompat_bswap32(x) ((((x) << 24) & 0xff000000) | \ + (((x) << 8) & 0x00ff0000) | \ + (((x) >> 8) & 0x0000ff00) | \ + (((x) >> 24) & 0x000000ff)) + +#define __nbcompat_bswap64(x) (((u_int64_t)bswap32((x)) << 32) | \ + ((u_int64_t)bswap32((x) >> 32))) + +#if !HAVE_BSWAP16 +#ifdef bswap16 +#undef bswap16 +#endif +#define bswap16(x) __nbcompat_bswap16(x) +#endif +#if !HAVE_BSWAP32 +#ifdef bswap32 +#undef bswap32 +#endif +#define bswap32(x) __nbcompat_bswap32(x) +#endif +#if !HAVE_BSWAP64 +#ifdef bswap64 +#undef bswap64 +#endif +#define bswap64(x) __nbcompat_bswap64(x) +#endif + +#if !HAVE_PWCACHE_USERDB +int uid_from_user(const char *, uid_t *); +int pwcache_userdb(int (*)(int), void (*)(void), + struct passwd * (*)(const char *), struct passwd * (*)(uid_t)); +int gid_from_group(const char *, gid_t *); +int pwcache_groupdb(int (*)(int), void (*)(void), + struct group * (*)(const char *), struct group * (*)(gid_t)); +#endif +/* Make them use our version */ +# define user_from_uid __nbcompat_user_from_uid +/* Make them use our version */ +# define group_from_gid __nbcompat_group_from_gid +#if HAVE_GROUP_FROM_GID +const char *group_from_gid(gid_t, int); +#endif + +#if !HAVE_SETENV +int setenv(const char *, const char *, int); +#endif + +#if !HAVE_STRSUFTOLL +long long strsuftoll(const char *, const char *, long long, long long); +long long strsuftollx(const char *, const char *, + long long, long long, char *, size_t); +#endif + +#if !HAVE_USER_FROM_UID +const char *user_from_uid(uid_t, int); +#endif + +#if !HAVE_GROUP_FROM_GID +const char *group_from_gid(gid_t, int); +#endif + +/* + * getmode() and setmode() are always defined, as these function names + * exist but with very different meanings on other OS's. The compat + * versions here simply accept an octal mode number; the "u+x,g-w" type + * of syntax is not accepted. + */ + +#define getmode __nbcompat_getmode +#define setmode __nbcompat_setmode + +mode_t getmode(const void *, mode_t); +void *setmode(const char *); + +/* Eliminate assertions embedded in binaries. */ + +#undef _DIAGASSERT +#define _DIAGASSERT(x) + +/* Various sources use this */ +#undef __RCSID +#define __RCSID(x) +#undef __SCCSID +#define __SCCSID(x) +#undef __COPYRIGHT +#define __COPYRIGHT(x) +#undef __KERNEL_RCSID +#define __KERNEL_RCSID(x,y) + +/* Heimdal expects this one. */ + +#undef RCSID +#define RCSID(x) + +#ifndef MAXFRAG +#define MAXFRAG 8 +#endif + +#endif /* !__NETBSD_COMPAT_DEFS_H__ */ Added: projects/makefs/compat/fparseln.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/makefs/compat/fparseln.c Sun Nov 23 19:59:42 2008 (r185222) @@ -0,0 +1,248 @@ +/* $NetBSD: fparseln.c,v 1.5 2004/06/20 22:20:15 jmc Exp $ */ + +/* + * Copyright (c) 1997 Christos Zoulas. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christos Zoulas. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: fparseln.c,v 1.5 2004/06/20 22:20:15 jmc Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" + +#include +#include +#include +#include +#include + +#ifdef __weak_alias +__weak_alias(fparseln,_fparseln) +#endif + +#if ! HAVE_FPARSELN + +#ifndef HAVE_NBTOOL_CONFIG_H +#include "reentrant.h" +#include "local.h" +#else +#define FLOCKFILE(fp) +#define FUNLOCKFILE(fp) +#endif + +#if defined(_REENTRANT) && !HAVE_NBTOOL_CONFIG_H +#define __fgetln(f, l) __fgetstr(f, l, '\n') +#else +#define __fgetln(f, l) fgetln(f, l) +#endif + +static int isescaped(const char *, const char *, int); + +/* isescaped(): + * Return true if the character in *p that belongs to a string + * that starts in *sp, is escaped by the escape character esc. + */ +static int +isescaped(const char *sp, const char *p, int esc) +{ + const char *cp; + size_t ne; + + _DIAGASSERT(sp != NULL); + _DIAGASSERT(p != NULL); + + /* No escape character */ + if (esc == '\0') + return 1; + + /* Count the number of escape characters that precede ours */ + for (ne = 0, cp = p; --cp >= sp && *cp == esc; ne++) + continue; + + /* Return true if odd number of escape characters */ + return (ne & 1) != 0; +} + + +/* fparseln(): + * Read a line from a file parsing continuations ending in \ + * and eliminating trailing newlines, or comments starting with + * the comment char. + */ +char * +fparseln(FILE *fp, size_t *size, size_t *lineno, const char str[3], int flags) +{ + static const char dstr[3] = { '\\', '\\', '#' }; + + size_t s, len; + char *buf; + char *ptr, *cp; + int cnt; + char esc, con, nl, com; + + _DIAGASSERT(fp != NULL); + + len = 0; + buf = NULL; + cnt = 1; + + if (str == NULL) + str = dstr; + + esc = str[0]; + con = str[1]; + com = str[2]; + /* + * XXX: it would be cool to be able to specify the newline character, + * but unfortunately, fgetln does not let us + */ + nl = '\n'; + + FLOCKFILE(fp); + + while (cnt) { + cnt = 0; + + if (lineno) + (*lineno)++; + + if ((ptr = __fgetln(fp, &s)) == NULL) + break; + + if (s && com) { /* Check and eliminate comments */ + for (cp = ptr; cp < ptr + s; cp++) + if (*cp == com && !isescaped(ptr, cp, esc)) { + s = cp - ptr; + cnt = s == 0 && buf == NULL; + break; + } + } + + if (s && nl) { /* Check and eliminate newlines */ + cp = &ptr[s - 1]; + + if (*cp == nl) + s--; /* forget newline */ + } + + if (s && con) { /* Check and eliminate continuations */ + cp = &ptr[s - 1]; + + if (*cp == con && !isescaped(ptr, cp, esc)) { + s--; /* forget escape */ + cnt = 1; + } + } + + if (s == 0 && buf != NULL) + continue; + + if ((cp = realloc(buf, len + s + 1)) == NULL) { + FUNLOCKFILE(fp); + free(buf); + return NULL; + } + buf = cp; + + (void) memcpy(buf + len, ptr, s); + len += s; + buf[len] = '\0'; + } + + FUNLOCKFILE(fp); + + if ((flags & FPARSELN_UNESCALL) != 0 && esc && buf != NULL && + strchr(buf, esc) != NULL) { + ptr = cp = buf; + while (cp[0] != '\0') { + int skipesc; + + while (cp[0] != '\0' && cp[0] != esc) + *ptr++ = *cp++; + if (cp[0] == '\0' || cp[1] == '\0') + break; + + skipesc = 0; + if (cp[1] == com) + skipesc += (flags & FPARSELN_UNESCCOMM); + if (cp[1] == con) + skipesc += (flags & FPARSELN_UNESCCONT); + if (cp[1] == esc) + skipesc += (flags & FPARSELN_UNESCESC); + if (cp[1] != com && cp[1] != con && cp[1] != esc) + skipesc = (flags & FPARSELN_UNESCREST); + + if (skipesc) + cp++; + else + *ptr++ = *cp++; + *ptr++ = *cp++; + } + *ptr = '\0'; + len = strlen(buf); + } + + if (size) + *size = len; + return buf; +} + +#ifdef TEST + +int main(int, char **); + +int +main(int argc, char **argv) +{ + char *ptr; + size_t size, line; + + line = 0; + while ((ptr = fparseln(stdin, &size, &line, NULL, + FPARSELN_UNESCALL)) != NULL) + printf("line %d (%d) |%s|\n", line, size, ptr); + return 0; +} + +/* + +# This is a test +line 1 +line 2 \ +line 3 # Comment +line 4 \# Not comment \\\\ + +# And a comment \ +line 5 \\\ +line 6 + +*/ + +#endif /* TEST */ +#endif /* ! HAVE_FPARSELN */ Added: projects/makefs/compat/getmode.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/makefs/compat/getmode.c Sun Nov 23 19:59:42 2008 (r185222) @@ -0,0 +1,63 @@ +/* $NetBSD: getmode.c,v 1.6 2004/01/13 00:53:06 simonb Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Todd Vierling. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "nbtool_config.h" +#include + +void * +setmode(const char *str) +{ + mode_t *mp = malloc(sizeof(mode_t)); + + *mp = strtoul(str, NULL, 8); + + return mp; +} + +mode_t +getmode(const void *mp, mode_t mode) +{ + mode_t m; + + m = *((const mode_t *)mp); + + mode &= ~ALLPERMS; /* input mode less RWX permissions */ + m &= ALLPERMS; /* new RWX permissions */ + + return m | mode; +} Added: projects/makefs/compat/machine/bswap.h ============================================================================== Added: projects/makefs/compat/mtree/extern.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/makefs/compat/mtree/extern.h Sun Nov 23 19:59:42 2008 (r185222) @@ -0,0 +1,81 @@ +/* $NetBSD: extern.h,v 1.28 2003/10/27 00:12:44 lukem Exp $ */ + +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)extern.h 8.1 (Berkeley) 6/6/93 + */ + +#include "mtree.h" + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#else +#define HAVE_STRUCT_STAT_ST_FLAGS 1 +#endif + +#include +#include + +#if HAVE_NETDB_H +/* For MAXHOSTNAMELEN on some platforms. */ +#include +#endif + +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 256 +#endif + +void addtag(slist_t *, char *); +int check_excludes(const char *, const char *); +int compare(NODE *, FTSENT *); +int crc(int, u_int32_t *, u_int32_t *); +void cwalk(void); +void dump_nodes(const char *, NODE *, int); +void init_excludes(void); +int matchtags(NODE *); +void mtree_err(const char *, ...) + __attribute__((__format__(__printf__, 1, 2))); +const char *nodetype(u_int); +u_int parsekey(const char *, int *); +void parsetags(slist_t *, char *); +u_int parsetype(const char *); +void read_excludes_file(const char *); +const char *rlink(const char *); +int verify(void); + +extern int dflag, eflag, iflag, lflag, mflag, rflag, sflag, tflag, uflag; +extern int Wflag; +extern size_t mtree_lineno; +extern u_int32_t crc_total; +extern int ftsoptions, keys; +extern char fullpath[]; +extern slist_t includetags, excludetags; + + +#include "stat_flags.h" Added: projects/makefs/compat/mtree/getid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/makefs/compat/mtree/getid.c Sun Nov 23 19:59:42 2008 (r185222) @@ -0,0 +1,435 @@ +/* $NetBSD: getid.c,v 1.5 2004/06/20 22:20:18 jmc Exp $ */ +/* from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */ +/* from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */ + +/* + * Copyright (c) 1987, 1988, 1989, 1993, 1994, 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Luke Mewburn of Wasabi Systems. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "extern.h" + +static struct group * gi_getgrnam(const char *); +static struct group * gi_getgrgid(gid_t); +static int gi_setgroupent(int); +static void gi_endgrent(void); +static int grstart(void); +static int grscan(int, gid_t, const char *); +static int grmatchline(int, gid_t, const char *); + +static struct passwd * gi_getpwnam(const char *); +static struct passwd * gi_getpwuid(uid_t); +static int gi_setpassent(int); +static void gi_endpwent(void); +static int pwstart(void); +static int pwscan(int, uid_t, const char *); +static int pwmatchline(int, uid_t, const char *); + +#define MAXGRP 200 +#define MAXLINELENGTH 1024 + +static FILE *_gr_fp; +static struct group _gr_group; +static int _gr_stayopen; +static int _gr_filesdone; +static FILE *_pw_fp; +static struct passwd _pw_passwd; /* password structure */ +static int _pw_stayopen; /* keep fd's open */ +static int _pw_filesdone; + +static char grfile[MAXPATHLEN]; +static char pwfile[MAXPATHLEN]; + +static char *members[MAXGRP]; +static char grline[MAXLINELENGTH]; +static char pwline[MAXLINELENGTH]; + +int +setup_getid(const char *dir) +{ + if (dir == NULL) + return (0); + + /* close existing databases */ + gi_endgrent(); + gi_endpwent(); + + /* build paths to new databases */ + snprintf(grfile, sizeof(grfile), "%s/group", dir); + snprintf(pwfile, sizeof(pwfile), "%s/master.passwd", dir); + + /* try to open new databases */ + if (!grstart() || !pwstart()) + return (0); + + /* switch pwcache(3) lookup functions */ + if (pwcache_groupdb(gi_setgroupent, gi_endgrent, + gi_getgrnam, gi_getgrgid) == -1 + || pwcache_userdb(gi_setpassent, gi_endpwent, + gi_getpwnam, gi_getpwuid) == -1) + return (0); + + return (1); +} + + +/* + * group lookup functions + */ + +static struct group * +gi_getgrnam(const char *name) +{ + int rval; + + if (!grstart()) + return NULL; + rval = grscan(1, 0, name); + if (!_gr_stayopen) + endgrent(); + return (rval) ? &_gr_group : NULL; +} + +static struct group * +gi_getgrgid(gid_t gid) +{ + int rval; + + if (!grstart()) + return NULL; + rval = grscan(1, gid, NULL); + if (!_gr_stayopen) + endgrent(); + return (rval) ? &_gr_group : NULL; +} + +static int +gi_setgroupent(int stayopen) +{ + + if (!grstart()) + return 0; + _gr_stayopen = stayopen; + return 1; +} + +static void +gi_endgrent(void) +{ + + _gr_filesdone = 0; + if (_gr_fp) { + (void)fclose(_gr_fp); + _gr_fp = NULL; + } +} + +static int +grstart(void) +{ + + _gr_filesdone = 0; + if (_gr_fp) { + rewind(_gr_fp); + return 1; + } + if (grfile[0] == '\0') /* sanity check */ + return 0; + return (_gr_fp = fopen(grfile, "r")) ? 1 : 0; +} + + +static int +grscan(int search, gid_t gid, const char *name) +{ + + if (_gr_filesdone) + return 0; + for (;;) { + if (!fgets(grline, sizeof(grline), _gr_fp)) { + if (!search) + _gr_filesdone = 1; + return 0; + } + /* skip lines that are too big */ + if (!strchr(grline, '\n')) { + int ch; + + while ((ch = getc(_gr_fp)) != '\n' && ch != EOF) + ; + continue; + } + if (grmatchline(search, gid, name)) + return 1; + } + /* NOTREACHED */ +} + +static int +grmatchline(int search, gid_t gid, const char *name) +{ + unsigned long id; + char **m; + char *cp, *bp, *ep; + + /* name may be NULL if search is nonzero */ + + bp = grline; + memset(&_gr_group, 0, sizeof(_gr_group)); + _gr_group.gr_name = strsep(&bp, ":\n"); + if (search && name && strcmp(_gr_group.gr_name, name)) + return 0; + _gr_group.gr_passwd = strsep(&bp, ":\n"); + if (!(cp = strsep(&bp, ":\n"))) + return 0; + id = strtoul(cp, &ep, 10); + if (id > GID_MAX || *ep != '\0') + return 0; + _gr_group.gr_gid = (gid_t)id; + if (search && name == NULL && _gr_group.gr_gid != gid) + return 0; + cp = NULL; + if (bp == NULL) + return 0; + for (_gr_group.gr_mem = m = members;; bp++) { + if (m == &members[MAXGRP - 1]) + break; + if (*bp == ',') { + if (cp) { + *bp = '\0'; + *m++ = cp; + cp = NULL; + } + } else if (*bp == '\0' || *bp == '\n' || *bp == ' ') { + if (cp) { + *bp = '\0'; + *m++ = cp; + } + break; + } else if (cp == NULL) + cp = bp; + } + *m = NULL; + return 1; +} + + +/* + * user lookup functions + */ + +static struct passwd * +gi_getpwnam(const char *name) +{ + int rval; + + if (!pwstart()) + return NULL; + rval = pwscan(1, 0, name); + if (!_pw_stayopen) + endpwent(); + return (rval) ? &_pw_passwd : NULL; +} + +static struct passwd * +gi_getpwuid(uid_t uid) +{ + int rval; + + if (!pwstart()) + return NULL; + rval = pwscan(1, uid, NULL); + if (!_pw_stayopen) + endpwent(); + return (rval) ? &_pw_passwd : NULL; +} + +static int +gi_setpassent(int stayopen) +{ + + if (!pwstart()) + return 0; + _pw_stayopen = stayopen; + return 1; +} + +static void +gi_endpwent(void) +{ + + _pw_filesdone = 0; + if (_pw_fp) { + (void)fclose(_pw_fp); + _pw_fp = NULL; + } +} + +static int +pwstart(void) +{ + + _pw_filesdone = 0; + if (_pw_fp) { + rewind(_pw_fp); + return 1; + } + if (pwfile[0] == '\0') /* sanity check */ + return 0; + return (_pw_fp = fopen(pwfile, "r")) ? 1 : 0; +} + + +static int +pwscan(int search, uid_t uid, const char *name) +{ + + if (_pw_filesdone) + return 0; + for (;;) { + if (!fgets(pwline, sizeof(pwline), _pw_fp)) { + if (!search) + _pw_filesdone = 1; + return 0; + } + /* skip lines that are too big */ + if (!strchr(pwline, '\n')) { + int ch; + + while ((ch = getc(_pw_fp)) != '\n' && ch != EOF) + ; + continue; + } + if (pwmatchline(search, uid, name)) + return 1; + } + /* NOTREACHED */ +} + +static int +pwmatchline(int search, uid_t uid, const char *name) +{ + unsigned long id; + char *cp, *bp, *ep; + + /* name may be NULL if search is nonzero */ + + bp = pwline; + memset(&_pw_passwd, 0, sizeof(_pw_passwd)); + _pw_passwd.pw_name = strsep(&bp, ":\n"); /* name */ + if (search && name && strcmp(_pw_passwd.pw_name, name)) + return 0; + + _pw_passwd.pw_passwd = strsep(&bp, ":\n"); /* passwd */ + + if (!(cp = strsep(&bp, ":\n"))) /* uid */ + return 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Mon Nov 24 06:47:27 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C69B6106568D; Mon, 24 Nov 2008 06:47:27 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0FDA8FC1E; Mon, 24 Nov 2008 06:47:27 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAO6lRmE077101; Mon, 24 Nov 2008 06:47:27 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAO6lRI2077099; Mon, 24 Nov 2008 06:47:27 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811240647.mAO6lRI2077099@svn.freebsd.org> From: Kip Macy Date: Mon, 24 Nov 2008 06:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185245 - projects/release_6_3_xen/sys/i386/xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2008 06:47:27 -0000 Author: kmacy Date: Mon Nov 24 06:47:27 2008 New Revision: 185245 URL: http://svn.freebsd.org/changeset/base/185245 Log: - ensure that all pages used as page tables are bzeroed and then mapped read-only - make sure that sysmaps->{CADDR1, CADDR2} are initialized Modified: projects/release_6_3_xen/sys/i386/xen/pmap.c projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Modified: projects/release_6_3_xen/sys/i386/xen/pmap.c ============================================================================== --- projects/release_6_3_xen/sys/i386/xen/pmap.c Mon Nov 24 02:21:50 2008 (r185244) +++ projects/release_6_3_xen/sys/i386/xen/pmap.c Mon Nov 24 06:47:27 2008 (r185245) @@ -237,7 +237,7 @@ struct sysmaps { static struct sysmaps sysmaps_pcpu[MAXCPU]; pt_entry_t *CMAP1 = 0; static pt_entry_t *CMAP3; -caddr_t CADDR1 = 0, ptvmmap = 0; +caddr_t ptvmmap = 0; static caddr_t CADDR3; struct msgbuf *msgbufp = 0; @@ -438,14 +438,11 @@ pmap_bootstrap(firstaddr, loadaddr) mtx_init(&sysmaps->lock, "SYSMAPS", NULL, MTX_DEF); SYSMAP(caddr_t, sysmaps->CMAP1, sysmaps->CADDR1, 1) SYSMAP(caddr_t, sysmaps->CMAP2, sysmaps->CADDR2, 1) + PT_SET_MA(sysmaps->CADDR1, 0); + PT_SET_MA(sysmaps->CADDR2, 0); } - SYSMAP(caddr_t, CMAP1, CADDR1, 1) SYSMAP(caddr_t, CMAP3, CADDR3, 1) -#ifdef XEN - PT_SET_MA(CADDR3, 0); -#else - *CMAP3 = 0; -#endif + PT_SET_MA(CADDR3, 0); /* * Crashdump maps. */ @@ -470,12 +467,6 @@ pmap_bootstrap(firstaddr, loadaddr) mtx_init(&PMAP2mutex, "PMAP2", NULL, MTX_DEF); virtual_avail = va; -#ifdef XEN - PT_SET_MA(CADDR1, 0); -#else - *CMAP1 = 0; -#endif - #if !defined(XEN) #ifdef XBOX /* FIXME: This is gross, but needed for the XBOX. Since we are in such Modified: projects/release_6_3_xen/sys/i386/xen/xen_machdep.c ============================================================================== --- projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Mon Nov 24 02:21:50 2008 (r185244) +++ projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Mon Nov 24 06:47:27 2008 (r185245) @@ -1010,10 +1010,10 @@ initvalues(start_info_t *startinfo) * make sure that all the initial page table pages * have been zeroed */ - PT_SET_MA(cur_space_pt, + PT_SET_MA(cur_space, xpmap_ptom(VTOP(cur_space)) | PG_V | PG_RW); - bzero((char *)cur_space_pt, PAGE_SIZE); - PT_SET_MA(cur_space_pt, (vm_paddr_t)0); + bzero((char *)cur_space, PAGE_SIZE); + PT_SET_MA(cur_space, (vm_paddr_t)0); xen_pt_pin(xpmap_ptom(VTOP(cur_space))); xen_queue_pt_update((vm_paddr_t)(IdlePTDnewma[pdir] + curoffset*sizeof(vm_paddr_t)), From owner-svn-src-projects@FreeBSD.ORG Mon Nov 24 20:59:30 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7E61065672; Mon, 24 Nov 2008 20:59:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DFF88FC20; Mon, 24 Nov 2008 20:59:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAOKxUs5098022; Mon, 24 Nov 2008 20:59:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAOKxU6E098020; Mon, 24 Nov 2008 20:59:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811242059.mAOKxU6E098020@svn.freebsd.org> From: Warner Losh Date: Mon, 24 Nov 2008 20:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185259 - in projects/makefs: . compat compat/mtree X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2008 20:59:30 -0000 Author: imp Date: Mon Nov 24 20:59:29 2008 New Revision: 185259 URL: http://svn.freebsd.org/changeset/base/185259 Log: Remove the dump_node and vispath routines from compat/mtree/spec.c. They aren't needed, and were the only users of the compat/vis.[ch] files. As such, remove them from the Makefile. Deleted: projects/makefs/compat/vis.c projects/makefs/compat/vis.h Modified: projects/makefs/Makefile projects/makefs/compat/mtree/spec.c Modified: projects/makefs/Makefile ============================================================================== --- projects/makefs/Makefile Mon Nov 24 20:05:14 2008 (r185258) +++ projects/makefs/Makefile Mon Nov 24 20:59:29 2008 (r185259) @@ -3,7 +3,7 @@ PROG= makefs COMPAT_MTREE= getid.c misc.c spec.c COMPAT= fparseln.c getmode.c pack_dev.c pwcache.c stat_flags.c \ - strsuftoll.c vis.c + strsuftoll.c SRCS= ffs.c makefs.c walk.c \ buf.c ffs_alloc.c ffs_balloc.c mkfs.c ufs_bmap.c \ ffs_bswap.c ffs_subr.c ffs_tables.c \ Modified: projects/makefs/compat/mtree/spec.c ============================================================================== --- projects/makefs/compat/mtree/spec.c Mon Nov 24 20:05:14 2008 (r185258) +++ projects/makefs/compat/mtree/spec.c Mon Nov 24 20:59:29 2008 (r185259) @@ -274,6 +274,7 @@ noparent: mtree_err("no parent node"); return (root); } +#if 0 /* * dump_nodes -- * dump the NODEs from `cur', based in the directory `dir'. @@ -369,7 +370,7 @@ vispath(const char *path) strsvis(pathbuf, path, VIS_CSTYLE, extra); return(pathbuf); } - +#endif static dev_t parsedev(char *arg) From owner-svn-src-projects@FreeBSD.ORG Mon Nov 24 21:08:44 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53ECA106564A; Mon, 24 Nov 2008 21:08:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E89B8FC22; Mon, 24 Nov 2008 21:08:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAOL8ifa098245; Mon, 24 Nov 2008 21:08:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAOL8i3n098244; Mon, 24 Nov 2008 21:08:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811242108.mAOL8i3n098244@svn.freebsd.org> From: Warner Losh Date: Mon, 24 Nov 2008 21:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185260 - projects/makefs/sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2008 21:08:44 -0000 Author: imp Date: Mon Nov 24 21:08:43 2008 New Revision: 185260 URL: http://svn.freebsd.org/changeset/base/185260 Log: This isn't needed... Deleted: projects/makefs/sys/sys/queue.h From owner-svn-src-projects@FreeBSD.ORG Mon Nov 24 21:10:08 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D1EE1065675; Mon, 24 Nov 2008 21:10:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 776A88FC18; Mon, 24 Nov 2008 21:10:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAOLA8hx098351; Mon, 24 Nov 2008 21:10:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAOLA83S098350; Mon, 24 Nov 2008 21:10:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811242110.mAOLA83S098350@svn.freebsd.org> From: Warner Losh Date: Mon, 24 Nov 2008 21:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185262 - projects/makefs/sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2008 21:10:08 -0000 Author: imp Date: Mon Nov 24 21:10:08 2008 New Revision: 185262 URL: http://svn.freebsd.org/changeset/base/185262 Log: This directory is now empty Deleted: projects/makefs/sys/sys/ From owner-svn-src-projects@FreeBSD.ORG Wed Nov 26 03:14:24 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A1701065673; Wed, 26 Nov 2008 03:14:24 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74EEF8FC16; Wed, 26 Nov 2008 03:14:24 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAQ3EOsh042713; Wed, 26 Nov 2008 03:14:24 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAQ3EOR5042712; Wed, 26 Nov 2008 03:14:24 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811260314.mAQ3EOR5042712@svn.freebsd.org> From: Kip Macy Date: Wed, 26 Nov 2008 03:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185325 - projects/release_6_3_xen/sys/i386/xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2008 03:14:24 -0000 Author: kmacy Date: Wed Nov 26 03:14:24 2008 New Revision: 185325 URL: http://svn.freebsd.org/changeset/base/185325 Log: make initvalues able to handle an arbitrary number of page directories or page tables at startup Modified: projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Modified: projects/release_6_3_xen/sys/i386/xen/xen_machdep.c ============================================================================== --- projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Wed Nov 26 01:09:48 2008 (r185324) +++ projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Wed Nov 26 03:14:24 2008 (r185325) @@ -821,16 +821,17 @@ initvalues(start_info_t *startinfo) vm_offset_t cur_space, cur_space_pt; struct physdev_set_iopl set_iopl; - vm_paddr_t KPTphys, IdlePTDma; vm_paddr_t console_page_ma, xen_store_ma; - vm_offset_t KPTphysoff, tmpva; + vm_offset_t tmpva; vm_paddr_t shinfo; #ifdef PAE vm_paddr_t IdlePDPTma, IdlePDPTnewma; vm_paddr_t IdlePTDnewma[4]; pd_entry_t *IdlePDPTnew, *IdlePTDnew; + vm_paddr_t IdlePTDma[4]; #else - vm_paddr_t pdir_shadow_ma; + vm_paddr_t IdlePTDma[1]; + #endif unsigned long i; int ncpus = MAXCPU; @@ -850,10 +851,37 @@ initvalues(start_info_t *startinfo) #endif xen_start_info = startinfo; xen_phys_machine = (xen_pfn_t *)startinfo->mfn_list; + IdlePTD = (pd_entry_t *)((uint8_t *)startinfo->pt_base + PAGE_SIZE); + l1_pages = 0; + +#ifdef PAE + l3_pages = 1; + l2_pages = 0; + IdlePDPT = (pd_entry_t *)startinfo->pt_base; + IdlePDPTma = xpmap_ptom(VTOP(startinfo->pt_base)); + for (i = (((KERNBASE >> 18) & PAGE_MASK) >> 30); + (i < 4) && (IdlePDPT[i] != 0); i++) + l2_pages++; + /* + * Note that only one page directory has been allocated at this point. + * Thus, if KERNBASE + */ + for (i = 0; i < l2_pages; i++) + IdlePTDma[i] = xpmap_ptom(VTOP(IdlePTD + i*PAGE_SIZE)); +#else + l3_pages = 0; + l2_pages = 1; +#endif + for (i = (((KERNBASE>>18) & PAGE_MASK)>>PAGE_SHIFT); + (i>PDRSHIFT)); i++) + if (IdlePTD[i] != 0) + l1_pages++; + /* number of pages allocated after the pts + 1*/; cur_space = xen_start_info->pt_base + - ((xen_start_info->nr_pt_frames) + 3 )*PAGE_SIZE; + (l3_pages + l2_pages + l1_pages + 1)*PAGE_SIZE; + printk("initvalues(): wooh - availmem=%x,%x\n", avail_space, cur_space); printk("KERNBASE=%x,pt_base=%x, VTOPFN(base)=%x, nr_pt_frames=%x\n", @@ -861,55 +889,14 @@ initvalues(start_info_t *startinfo) xen_start_info->nr_pt_frames); xendebug_flags = 0; /* 0xffffffff; */ - /* allocate 4 pages for bootmem allocator */ - bootmem_start = bootmem_current = (char *)cur_space; - cur_space += (4 * PAGE_SIZE); - bootmem_end = (char *)cur_space; - - /* allocate pages for gdt */ - gdt = (union descriptor *)cur_space; - cur_space += PAGE_SIZE*ncpus; - - /* allocate page for ldt */ - ldt = (union descriptor *)cur_space; cur_space += PAGE_SIZE; - cur_space += PAGE_SIZE; - HYPERVISOR_shared_info = (shared_info_t *)cur_space; - cur_space += PAGE_SIZE; - - xen_store = (struct ringbuf_head *)cur_space; - cur_space += PAGE_SIZE; - - console_page = (char *)cur_space; - cur_space += PAGE_SIZE; - #ifdef ADD_ISA_HOLE shift_phys_machine(xen_phys_machine, xen_start_info->nr_pages); #endif /* * pre-zero unused mapped pages - mapped on 4MB boundary */ -#ifdef PAE - IdlePDPT = (pd_entry_t *)startinfo->pt_base; - IdlePDPTma = xpmap_ptom(VTOP(startinfo->pt_base)); - /* - * Note that only one page directory has been allocated at this point. - * Thus, if KERNBASE - */ - IdlePTD = (pd_entry_t *)((uint8_t *)startinfo->pt_base + PAGE_SIZE); - IdlePTDma = xpmap_ptom(VTOP(IdlePTD)); - l3_pages = 1; -#else - IdlePTD = (pd_entry_t *)startinfo->pt_base; - IdlePTDma = xpmap_ptom(VTOP(startinfo->pt_base)); - l3_pages = 0; -#endif - l2_pages = 1; - l1_pages = xen_start_info->nr_pt_frames - l2_pages - l3_pages; - - KPTphysoff = (l2_pages + l3_pages)*PAGE_SIZE; - KPTphys = xpmap_ptom(VTOP(startinfo->pt_base + KPTphysoff)); XENPRINTF("IdlePTD %p\n", IdlePTD); XENPRINTF("nr_pages: %ld shared_info: 0x%lx flags: 0x%lx pt_base: 0x%lx " "mod_start: 0x%lx mod_len: 0x%lx\n", @@ -918,16 +905,6 @@ initvalues(start_info_t *startinfo) xen_start_info->mod_start, xen_start_info->mod_len); /* Map proc0's KSTACK */ - proc0kstack = cur_space; cur_space += (KSTACK_PAGES * PAGE_SIZE); - printk("proc0kstack=%u\n", proc0kstack); - - /* vm86/bios stack */ - cur_space += PAGE_SIZE; - - /* Map space for the vm86 region */ - vm86paddr = (vm_offset_t)cur_space; - cur_space += (PAGE_SIZE * 3); - #ifdef PAE IdlePDPTnew = (pd_entry_t *)cur_space; cur_space += PAGE_SIZE; bzero(IdlePDPTnew, PAGE_SIZE); @@ -948,7 +925,6 @@ initvalues(start_info_t *startinfo) for (i = 0; i < 4; i++) IdlePDPTnew[i] = IdlePTDnewma[i] | PG_V; - __asm__("nop;"); /* * * re-map the new PDPT read-only @@ -959,17 +935,30 @@ initvalues(start_info_t *startinfo) * Unpin the current PDPT */ xen_pt_unpin(IdlePDPTma); - - for (i = 0; i < 20; i++) { - int startidx = ((KERNBASE >> 18) & PAGE_MASK) >> 3; - - if (IdlePTD[startidx + i] == 0) { - l1_pages = i; - break; - } - } #endif /* PAE */ + proc0kstack = cur_space; cur_space += (KSTACK_PAGES * PAGE_SIZE); + printk("proc0kstack=%u\n", proc0kstack); + + /* vm86/bios stack */ + cur_space += PAGE_SIZE; + + /* Map space for the vm86 region */ + vm86paddr = (vm_offset_t)cur_space; + cur_space += (PAGE_SIZE * 3); + + /* allocate 4 pages for bootmem allocator */ + bootmem_start = bootmem_current = (char *)cur_space; + cur_space += (4 * PAGE_SIZE); + bootmem_end = (char *)cur_space; + + /* allocate pages for gdt */ + gdt = (union descriptor *)cur_space; + cur_space += PAGE_SIZE*ncpus; + + /* allocate page for ldt */ + ldt = (union descriptor *)cur_space; cur_space += PAGE_SIZE; + cur_space += PAGE_SIZE; /* unmap remaining pages from initial 4MB chunk * @@ -1035,6 +1024,15 @@ initvalues(start_info_t *startinfo) IdlePTD = IdlePTDnew; IdlePDPT = IdlePDPTnew; IdlePDPTma = IdlePDPTnewma; + + HYPERVISOR_shared_info = (shared_info_t *)cur_space; + cur_space += PAGE_SIZE; + + xen_store = (struct ringbuf_head *)cur_space; + cur_space += PAGE_SIZE; + + console_page = (char *)cur_space; + cur_space += PAGE_SIZE; /* * shared_info is an unsigned long so this will randomly break if @@ -1043,10 +1041,7 @@ initvalues(start_info_t *startinfo) */ shinfo = xen_start_info->shared_info; PT_SET_MA(HYPERVISOR_shared_info, shinfo | PG_KERNEL); - printk("#4\n"); - - xen_store_ma = (((vm_paddr_t)xen_start_info->store_mfn) << PAGE_SHIFT); PT_SET_MA(xen_store, xen_store_ma | PG_KERNEL); console_page_ma = (((vm_paddr_t)xen_start_info->console.domU.mfn) << PAGE_SHIFT); From owner-svn-src-projects@FreeBSD.ORG Wed Nov 26 19:27:51 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890491065672; Wed, 26 Nov 2008 19:27:51 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 784CE8FC0A; Wed, 26 Nov 2008 19:27:51 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAQJRpZe064172; Wed, 26 Nov 2008 19:27:51 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAQJRprp064171; Wed, 26 Nov 2008 19:27:51 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200811261927.mAQJRprp064171@svn.freebsd.org> From: Ulf Lilleengen Date: Wed, 26 Nov 2008 19:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185342 - projects/csup_cvsmode/contrib/csup X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2008 19:27:51 -0000 Author: lulf Date: Wed Nov 26 19:27:51 2008 New Revision: 185342 URL: http://svn.freebsd.org/changeset/base/185342 Log: - Fix a bug in csup where SKIP is not obeyed when sending collection information. Modified: projects/csup_cvsmode/contrib/csup/proto.c Modified: projects/csup_cvsmode/contrib/csup/proto.c ============================================================================== --- projects/csup_cvsmode/contrib/csup/proto.c Wed Nov 26 19:25:13 2008 (r185341) +++ projects/csup_cvsmode/contrib/csup/proto.c Wed Nov 26 19:27:51 2008 (r185342) @@ -365,6 +365,8 @@ proto_xchgcoll(struct config *config) s = config->server; lprintf(2, "Exchanging collection information\n"); STAILQ_FOREACH(coll, &config->colls, co_next) { + if (coll->co_options & CO_SKIP) + continue; proto_printf(s, "COLL %s %s %o %d\n", coll->co_name, coll->co_release, coll->co_umask, coll->co_options); for (i = 0; i < pattlist_size(coll->co_accepts); i++) { From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 00:03:42 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62F621065674; Fri, 28 Nov 2008 00:03:42 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1798FC12; Fri, 28 Nov 2008 00:03:42 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAS03gqj001741; Fri, 28 Nov 2008 00:03:42 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAS03gaw001736; Fri, 28 Nov 2008 00:03:42 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811280003.mAS03gaw001736@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 00:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185377 - in projects/ath_hal: . ar5210 ar5211 ar5212 ar5312 ar5416 linux public X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 00:03:42 -0000 Author: sam Date: Fri Nov 28 00:03:41 2008 New Revision: 185377 URL: http://svn.freebsd.org/changeset/base/185377 Log: virgin import of ath hal Added: projects/ath_hal/ projects/ath_hal/COPYRIGHT projects/ath_hal/Makefile (contents, props changed) projects/ath_hal/README projects/ath_hal/ah.c (contents, props changed) projects/ath_hal/ah.h (contents, props changed) projects/ath_hal/ah_debug.h (contents, props changed) projects/ath_hal/ah_decode.h (contents, props changed) projects/ath_hal/ah_desc.h (contents, props changed) projects/ath_hal/ah_devid.h (contents, props changed) projects/ath_hal/ah_eeprom.h (contents, props changed) projects/ath_hal/ah_eeprom_v14.c (contents, props changed) projects/ath_hal/ah_eeprom_v14.h (contents, props changed) projects/ath_hal/ah_eeprom_v3.c (contents, props changed) projects/ath_hal/ah_eeprom_v3.h (contents, props changed) projects/ath_hal/ah_internal.h (contents, props changed) projects/ath_hal/ah_regdomain.c (contents, props changed) projects/ath_hal/ah_soc.h (contents, props changed) projects/ath_hal/ar5210/ projects/ath_hal/ar5210/ar5210.h (contents, props changed) projects/ath_hal/ar5210/ar5210_attach.c (contents, props changed) projects/ath_hal/ar5210/ar5210_beacon.c (contents, props changed) projects/ath_hal/ar5210/ar5210_interrupts.c (contents, props changed) projects/ath_hal/ar5210/ar5210_keycache.c (contents, props changed) projects/ath_hal/ar5210/ar5210_misc.c (contents, props changed) projects/ath_hal/ar5210/ar5210_phy.c (contents, props changed) projects/ath_hal/ar5210/ar5210_power.c (contents, props changed) projects/ath_hal/ar5210/ar5210_recv.c (contents, props changed) projects/ath_hal/ar5210/ar5210_reset.c (contents, props changed) projects/ath_hal/ar5210/ar5210_xmit.c (contents, props changed) projects/ath_hal/ar5210/ar5210desc.h (contents, props changed) projects/ath_hal/ar5210/ar5210phy.h (contents, props changed) projects/ath_hal/ar5210/ar5210reg.h (contents, props changed) projects/ath_hal/ar5210/ar5k_0007.ini projects/ath_hal/ar5211/ projects/ath_hal/ar5211/ar5211.h (contents, props changed) projects/ath_hal/ar5211/ar5211_attach.c (contents, props changed) projects/ath_hal/ar5211/ar5211_beacon.c (contents, props changed) projects/ath_hal/ar5211/ar5211_interrupts.c (contents, props changed) projects/ath_hal/ar5211/ar5211_keycache.c (contents, props changed) projects/ath_hal/ar5211/ar5211_misc.c (contents, props changed) projects/ath_hal/ar5211/ar5211_phy.c (contents, props changed) projects/ath_hal/ar5211/ar5211_power.c (contents, props changed) projects/ath_hal/ar5211/ar5211_recv.c (contents, props changed) projects/ath_hal/ar5211/ar5211_reset.c (contents, props changed) projects/ath_hal/ar5211/ar5211_xmit.c (contents, props changed) projects/ath_hal/ar5211/ar5211desc.h (contents, props changed) projects/ath_hal/ar5211/ar5211phy.h (contents, props changed) projects/ath_hal/ar5211/ar5211reg.h (contents, props changed) projects/ath_hal/ar5211/boss.ini (contents, props changed) projects/ath_hal/ar5212/ projects/ath_hal/ar5212/ar2316.c (contents, props changed) projects/ath_hal/ar5212/ar2317.c (contents, props changed) projects/ath_hal/ar5212/ar2413.c (contents, props changed) projects/ath_hal/ar5212/ar2425.c (contents, props changed) projects/ath_hal/ar5212/ar5111.c (contents, props changed) projects/ath_hal/ar5212/ar5112.c (contents, props changed) projects/ath_hal/ar5212/ar5212.h (contents, props changed) projects/ath_hal/ar5212/ar5212.ini projects/ath_hal/ar5212/ar5212_ani.c (contents, props changed) projects/ath_hal/ar5212/ar5212_attach.c (contents, props changed) projects/ath_hal/ar5212/ar5212_beacon.c (contents, props changed) projects/ath_hal/ar5212/ar5212_eeprom.c (contents, props changed) projects/ath_hal/ar5212/ar5212_gpio.c (contents, props changed) projects/ath_hal/ar5212/ar5212_interrupts.c (contents, props changed) projects/ath_hal/ar5212/ar5212_keycache.c (contents, props changed) projects/ath_hal/ar5212/ar5212_misc.c (contents, props changed) projects/ath_hal/ar5212/ar5212_phy.c (contents, props changed) projects/ath_hal/ar5212/ar5212_power.c (contents, props changed) projects/ath_hal/ar5212/ar5212_recv.c (contents, props changed) projects/ath_hal/ar5212/ar5212_reset.c (contents, props changed) projects/ath_hal/ar5212/ar5212_xmit.c (contents, props changed) projects/ath_hal/ar5212/ar5212desc.h (contents, props changed) projects/ath_hal/ar5212/ar5212phy.h (contents, props changed) projects/ath_hal/ar5212/ar5212reg.h (contents, props changed) projects/ath_hal/ar5212/ar5311reg.h (contents, props changed) projects/ath_hal/ar5212/ar5413.c (contents, props changed) projects/ath_hal/ar5312/ projects/ath_hal/ar5312/ar5312.h (contents, props changed) projects/ath_hal/ar5312/ar5312_attach.c (contents, props changed) projects/ath_hal/ar5312/ar5312_eeprom.c (contents, props changed) projects/ath_hal/ar5312/ar5312_gpio.c (contents, props changed) projects/ath_hal/ar5312/ar5312_interrupts.c (contents, props changed) projects/ath_hal/ar5312/ar5312_misc.c (contents, props changed) projects/ath_hal/ar5312/ar5312_power.c (contents, props changed) projects/ath_hal/ar5312/ar5312_reset.c (contents, props changed) projects/ath_hal/ar5312/ar5312phy.h (contents, props changed) projects/ath_hal/ar5312/ar5312reg.h (contents, props changed) projects/ath_hal/ar5312/ar5315_gpio.c (contents, props changed) projects/ath_hal/ar5416/ projects/ath_hal/ar5416/ar2133.c (contents, props changed) projects/ath_hal/ar5416/ar5416.h (contents, props changed) projects/ath_hal/ar5416/ar5416.ini projects/ath_hal/ar5416/ar5416_attach.c (contents, props changed) projects/ath_hal/ar5416/ar5416_beacon.c (contents, props changed) projects/ath_hal/ar5416/ar5416_eeprom.c (contents, props changed) projects/ath_hal/ar5416/ar5416_gpio.c (contents, props changed) projects/ath_hal/ar5416/ar5416_interrupts.c (contents, props changed) projects/ath_hal/ar5416/ar5416_keycache.c (contents, props changed) projects/ath_hal/ar5416/ar5416_misc.c (contents, props changed) projects/ath_hal/ar5416/ar5416_phy.c (contents, props changed) projects/ath_hal/ar5416/ar5416_power.c (contents, props changed) projects/ath_hal/ar5416/ar5416_recv.c (contents, props changed) projects/ath_hal/ar5416/ar5416_reset.c (contents, props changed) projects/ath_hal/ar5416/ar5416_xmit.c (contents, props changed) projects/ath_hal/ar5416/ar5416desc.h (contents, props changed) projects/ath_hal/ar5416/ar5416phy.h (contents, props changed) projects/ath_hal/ar5416/ar5416reg.h (contents, props changed) projects/ath_hal/ar5416/ar9160.ini (contents, props changed) projects/ath_hal/ar5416/ar9160_attach.c (contents, props changed) projects/ath_hal/linux/ projects/ath_hal/linux/Makefile (contents, props changed) projects/ath_hal/linux/Makefile.inc (contents, props changed) projects/ath_hal/linux/ah_osdep.c (contents, props changed) projects/ath_hal/linux/ah_osdep.h (contents, props changed) projects/ath_hal/public/ projects/ath_hal/public/alpha-elf.inc projects/ath_hal/public/ap30.inc projects/ath_hal/public/ap43.inc projects/ath_hal/public/ap51.inc projects/ath_hal/public/ap61.inc projects/ath_hal/public/arm9-le-thumb-elf.inc projects/ath_hal/public/armv4-be-elf.inc projects/ath_hal/public/armv4-le-elf.inc projects/ath_hal/public/i386-elf.inc projects/ath_hal/public/mips-be-elf.inc projects/ath_hal/public/mips-le-elf.inc projects/ath_hal/public/mips1-be-elf.inc projects/ath_hal/public/mips1-le-elf.inc projects/ath_hal/public/mipsisa32-be-elf.inc projects/ath_hal/public/mipsisa32-le-elf.inc projects/ath_hal/public/powerpc-be-eabi.inc projects/ath_hal/public/powerpc-be-elf.inc projects/ath_hal/public/powerpc-le-eabi.inc projects/ath_hal/public/sh4-le-elf.inc projects/ath_hal/public/sparc-be-elf.inc projects/ath_hal/public/sparc64-be-elf.inc projects/ath_hal/public/wackelf.c (contents, props changed) projects/ath_hal/public/wisoc.inc projects/ath_hal/public/x86_64-elf.inc projects/ath_hal/public/xscale-be-elf.inc projects/ath_hal/public/xscale-le-elf.inc projects/ath_hal/version.h (contents, props changed) Added: projects/ath_hal/COPYRIGHT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ath_hal/COPYRIGHT Fri Nov 28 00:03:41 2008 (r185377) @@ -0,0 +1,18 @@ +All files are under this license where not stated. + +/* + * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ Added: projects/ath_hal/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ath_hal/Makefile Fri Nov 28 00:03:41 2008 (r185377) @@ -0,0 +1,101 @@ +# +# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting +# Copyright (c) 2002-2008 Atheros Communications, Inc. +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# $Id: Makefile,v 1.6 2008/11/10 01:23:57 sam Exp $ +# + +nop: + +# +# Release-related support. +# +FILES= COPYRIGHT README \ + ah.h ah_desc.h ah_devid.h ah_soc.h version.h \ + public/[a-z]*.inc public/*.hal.o.uu public/*.opt_ah.h \ + public/wackelf.c \ + ${NULL} +# +# Tag the tree and build a release tarball suitable for open +# distribution (e.g. to sourceforge). The tag is date-based. +# +release: + DATE=`date +'%Y%m%d'`; TAG="ATH_HAL_$${DATE}"; \ + cvs tag -F $${TAG} ${FILES} && make rerelease TAG=$${TAG} + +# +# Rebuild a release tarball using an existing tag. +# +rerelease: + if [ -z "${TAG}" ]; then \ + echo "You must specify a TAG to do a re-release"; \ + exit 1; \ + fi; \ + expr "${TAG}" : '^ATH_HAL_' || { \ + echo "TAG must be of the form ATH_HAL_YYYYMMDD"; \ + exit 1; \ + }; \ + DATE=`echo "${TAG}" | sed 's/^ATH_HAL_//'`; \ + DIR="ath_hal-$${DATE}"; \ + rm -rf $${DIR}; \ + mkdir $${DIR} && \ + cvs export -d $${DIR} -r ${TAG} hal && \ + tar zcf $${DIR}.tgz --exclude=CVS $${DIR} && \ + rm -rf $${DIR} + +# +# Build a release-like tarball suitable for open distribution +# using the current contents of the local directory. This is +# useful for distributing private changes that are not committed +# to cvs. Note that this should not be used to construct +# distributions as there is no cvs history or tag to use in +# tracking issues. +# +tarball: + DATE=`date +'%Y%m%d'`; DIR="ath_hal-$${DATE}"; \ + ln -s . $${DIR}; \ + TARFILES=`for i in ${FILES}; do echo $${DIR}/$$i; done`; \ + tar zcf $${DIR}.tgz --exclude=CVS $${TARFILES}; \ + rm -f $${DIR}; + +# +# Build a source distribution. Be sure to +# first tag the source files using src_tag then follow this with +# src_release to construct the tarball. Tags and filenames are +# constructed from the contents of version.h (as opposed to the +# current date) so be sure this file is up to date prior to rolling +# a release. Note that a source release does NOT include the +# pre-built binary hal files; it is assumed the recipient can/will +# do this themselves. +# + +# tag the source code according to the current version +src_tag: + TAG=`awk '/ATH_HAL_VERSION/ \ + { gsub("\\"","",$$3); \ + gsub("[-.]", "_", $$3); print "v" $$3; }' version.h`; \ + cvs tag ${TAGOPTS} $${TAG}; \ + cvs tag -d $${TAG} */*.uu */*opt_ah.h +# create a tarball of the source for the current tagged version +src_release: + TAG=`awk '/ATH_HAL_VERSION/ \ + { gsub("\\"","",$$3); \ + gsub("[-.]", "_", $$3); print "v" $$3; }' version.h`; \ + DIR=`awk '/ATH_HAL_VERSION/ \ + { gsub("\\"","",$$3); print "hal-" $$3; }' version.h`; \ + rm -rf $${DIR}; mkdir $${DIR}; \ + cvs export -d $${DIR} -r $${TAG} hal; \ + tar zcf $${DIR}.tgz --exclude=CVS $${DIR}; \ + rm -rf $${DIR}; Added: projects/ath_hal/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ath_hal/README Fri Nov 28 00:03:41 2008 (r185377) @@ -0,0 +1,47 @@ +$Id: README,v 1.1.1.1 2008/08/20 04:41:19 sam Exp $ + +Atheros Hardware Access Layer (HAL) +=================================== + +Read the file COPYRIGHT for the complete copyright. + +This code manages much of the chip-specific operation of the Atheros +driver. + +Atheros Hardware +================ +There are many generations of Atheros 802.11 wireless devices that +are typically referred to by their programming model: + +5210 supports 11a only +5211 supports both 11a and 11b +5212 supports 11a, 11b, and 11g + +These parts have been incorporated in a variety of retail products +including cardbus cards and mini-pci cards. In addition many laptop +vendors use Atheros mini-pci cards for their builtin wireless +support. + +The Atheros PCI vendor id is 0x168c. The file ah_devid.h lists most +known PCI device id's but is not exhaustive. Some vendors program +their own vendor and/or device id's to aid in BIOS-locking mini-pci +cards in laptops. + +Atheros SoC Hardware +==================== +In addition to the cardbus/pci devices Atheros makes System on Chip +(SoC) parts that integrate a MIPS cpu core and one or more MAC and +radio parts. Support for these parts is necessarily built +for the embedded MIPS processor where the code is to be run. + +Caveats +======= +The binary hal builds provided here include no floating point and +are operating system-independent. However due to toolchain +peculiarities the .o files may be wrongly rejected by development +tools. If that happens it may be possible to patch the file header +so that the native toolchain will accept the files. In particular +this has been observed for various Linux MIPS installations for the +SoC parts. If you have issues consult the associated .inc file in +the public directory; it explains exactly how the binary file was +created (e.g. toolchain and compilation options). Added: projects/ath_hal/ah.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ath_hal/ah.c Fri Nov 28 00:03:41 2008 (r185377) @@ -0,0 +1,1029 @@ +/* + * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ah.c,v 1.13 2008/11/10 04:08:00 sam Exp $ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_devid.h" + +#ifdef AH_SUPPORT_AR5210 +extern struct ath_hal *ar5210Attach(uint16_t, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); +#endif +#ifdef AH_SUPPORT_AR5211 +extern struct ath_hal *ar5211Attach(uint16_t, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); +#endif +#ifdef AH_SUPPORT_AR5212 +extern struct ath_hal *ar5212Attach(uint16_t, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); +#endif +#ifdef AH_SUPPORT_AR5312 +extern struct ath_hal *ar5312Attach(uint16_t, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); +#endif +#ifdef AH_SUPPORT_AR5416 +extern struct ath_hal *ar5416Attach(uint16_t, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); +#endif +#ifdef AH_SUPPORT_AR9160 +extern struct ath_hal *ar9160Attach(uint16_t, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); +#endif + +#include "version.h" +char ath_hal_version[] = ATH_HAL_VERSION; +const char* ath_hal_buildopts[] = { +#ifdef AH_SUPPORT_AR5210 + "AR5210", +#endif +#ifdef AH_SUPPORT_AR5211 + "AR5211", +#endif +#ifdef AH_SUPPORT_AR5212 + "AR5212", +#endif +#ifdef AH_SUPPORT_AR5312 + "AR5312", +#endif +#ifdef AH_SUPPORT_AR5416 + "AR5416", +#endif +#ifdef AH_SUPPORT_AR9180 + "AR9180", +#endif +#ifdef AH_SUPPORT_5111 + "RF5111", +#endif +#ifdef AH_SUPPORT_5112 + "RF5112", +#endif +#ifdef AH_SUPPORT_2413 + "RF2413", +#endif +#ifdef AH_SUPPORT_5413 + "RF5413", +#endif +#ifdef AH_SUPPORT_2316 + "RF2316", +#endif +#ifdef AH_SUPPORT_2317 + "RF2317", +#endif +#ifdef AH_SUPPORT_2133 + "RF2133", +#endif +#ifdef AH_SUPPORT_2425 + "RF2425", +#endif +#ifdef AH_SUPPORT_2417 + "RF2417", +#endif +#ifdef AH_DEBUG + "DEBUG", +#endif +#ifdef AH_ASSERT + "ASSERT", +#endif +#ifdef AH_DEBUG_ALQ + "DEBUG_ALQ", +#endif +#ifdef AH_REGOPS_FUNC + "REGOPS_FUNC", +#endif +#ifdef AH_PRIVATE_DIAG + "PRIVATE_DIAG", +#endif +#ifdef AH_DEBUG_COUNTRY + "DEBUG_COUNTRY", +#endif +#ifdef AH_NEED_DESC_SWAP + "TX_DESC_SWAP", +#endif +#ifdef AH_DISABLE_WME + "DISABLE_WME", +#endif +#ifdef AH_SUPPORT_11D + "11D", +#endif + AH_NULL +}; + +static const char* +ath_hal_devname(uint16_t devid) +{ + switch (devid) { + case AR5210_PROD: + case AR5210_DEFAULT: + return "Atheros 5210"; + + case AR5211_DEVID: + case AR5311_DEVID: + case AR5211_DEFAULT: + return "Atheros 5211"; + case AR5211_FPGA11B: + return "Atheros 5211 (FPGA)"; + + case AR5212_FPGA: + return "Atheros 5212 (FPGA)"; + case AR5212_AR5312_REV2: + case AR5212_AR5312_REV7: + return "Atheros 5312 WiSoC"; + case AR5212_AR2315_REV6: + case AR5212_AR2315_REV7: + return "Atheros 2315 WiSoC"; + case AR5212_AR2317_REV1: + return "Atheros 2317 WiSoC"; + case AR5212_AR2313_REV8: + return "Atheros 2313 WiSoC"; + case AR5212_DEVID: + case AR5212_DEVID_IBM: + case AR5212_DEFAULT: + return "Atheros 5212"; + case AR5212_AR2413: + return "Atheros 2413"; + case AR5212_AR2417: + return "Atheros 2417"; + case AR5212_AR5413: + return "Atheros 5413"; + case AR5212_AR5424: + return "Atheros 5424/2424"; + case AR5416_DEVID_PCI: + case AR5416_DEVID_PCIE: + return "Atheros 5416"; + case AR9160_DEVID_PCI: + return "Atheros 9160"; + } + return AH_NULL; +} + +const char* +ath_hal_probe(uint16_t vendorid, uint16_t devid) +{ + return (vendorid == ATHEROS_VENDOR_ID || + vendorid == ATHEROS_3COM_VENDOR_ID || + vendorid == ATHEROS_3COM2_VENDOR_ID ? + ath_hal_devname(devid) : 0); +} + +/* + * Attach detects device chip revisions, initializes the hwLayer + * function list, reads EEPROM information, + * selects reset vectors, and performs a short self test. + * Any failures will return an error that should cause a hardware + * disable. + */ +struct ath_hal* +ath_hal_attach(uint16_t devid, HAL_SOFTC sc, + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *error) +{ + struct ath_hal *ah=AH_NULL; + + switch (devid) { +#ifdef AH_SUPPORT_AR5210 + case AR5210_AP: + case AR5210_PROD: + case AR5210_DEFAULT: + ah = ar5210Attach(devid, sc, st, sh, error); + break; +#endif +#ifdef AH_SUPPORT_AR5211 + case AR5211_DEVID: + case AR5311_DEVID: + case AR5211_FPGA11B: + case AR5211_DEFAULT: + ah = ar5211Attach(devid, sc, st, sh, error); + break; +#endif +#ifdef AH_SUPPORT_AR5212 + case AR5212_DEVID_IBM: + case AR5212_AR2413: + case AR5212_AR2417: + case AR5212_AR5413: + case AR5212_AR5424: + case AR5212_DEVID_FF19: /* XXX PCI Express extra */ + devid = AR5212_DEVID; + /* fall thru... */ + case AR5212_DEVID: + case AR5212_FPGA: + case AR5212_DEFAULT: + ah = ar5212Attach(devid, sc, st, sh, error); + break; +#endif +#ifdef AH_SUPPORT_AR5312 + case AR5212_AR5312_REV2: + case AR5212_AR5312_REV7: + case AR5212_AR2313_REV8: + case AR5212_AR2315_REV6: + case AR5212_AR2315_REV7: + case AR5212_AR2317_REV1: + ah = ar5312Attach(devid, sc, st, sh, error); + break; +#endif +#ifdef AH_SUPPORT_AR5416 + case AR5416_DEVID_PCI: + case AR5416_DEVID_PCIE: + ah = ar5416Attach(devid, sc, st, sh, error); + break; +#endif +#ifdef AH_SUPPORT_AR9160 + case AR9160_DEVID_PCI: + ah = ar9160Attach(devid, sc, st, sh, error); + break; +#endif + default: + ah = AH_NULL; + *error = HAL_ENXIO; + break; + } + if (ah != AH_NULL) { + /* copy back private state to public area */ + ah->ah_devid = AH_PRIVATE(ah)->ah_devid; + ah->ah_subvendorid = AH_PRIVATE(ah)->ah_subvendorid; + ah->ah_macVersion = AH_PRIVATE(ah)->ah_macVersion; + ah->ah_macRev = AH_PRIVATE(ah)->ah_macRev; + ah->ah_phyRev = AH_PRIVATE(ah)->ah_phyRev; + ah->ah_analog5GhzRev = AH_PRIVATE(ah)->ah_analog5GhzRev; + ah->ah_analog2GhzRev = AH_PRIVATE(ah)->ah_analog2GhzRev; + } + return ah; +} + +/* + * Poll the register looking for a specific value. + */ +HAL_BOOL +ath_hal_wait(struct ath_hal *ah, u_int reg, uint32_t mask, uint32_t val) +{ +#define AH_TIMEOUT 1000 + int i; + + for (i = 0; i < AH_TIMEOUT; i++) { + if ((OS_REG_READ(ah, reg) & mask) == val) + return AH_TRUE; + OS_DELAY(10); + } + HALDEBUG(ah, HAL_DEBUG_REGIO | HAL_DEBUG_PHYIO, + "%s: timeout on reg 0x%x: 0x%08x & 0x%08x != 0x%08x\n", + __func__, reg, OS_REG_READ(ah, reg), mask, val); + return AH_FALSE; +#undef AH_TIMEOUT +} + +/* + * Reverse the bits starting at the low bit for a value of + * bit_count in size + */ +uint32_t +ath_hal_reverseBits(uint32_t val, uint32_t n) +{ + uint32_t retval; + int i; + + for (i = 0, retval = 0; i < n; i++) { + retval = (retval << 1) | (val & 1); + val >>= 1; + } + return retval; +} + +/* + * Compute the time to transmit a frame of length frameLen bytes + * using the specified rate, phy, and short preamble setting. + */ +uint16_t +ath_hal_computetxtime(struct ath_hal *ah, + const HAL_RATE_TABLE *rates, uint32_t frameLen, uint16_t rateix, + HAL_BOOL shortPreamble) +{ + uint32_t bitsPerSymbol, numBits, numSymbols, phyTime, txTime; + uint32_t kbps; + + kbps = rates->info[rateix].rateKbps; + /* + * index can be invalid duting dynamic Turbo transitions. + */ + if(kbps == 0) return 0; + switch (rates->info[rateix].phy) { + + case IEEE80211_T_CCK: +#define CCK_SIFS_TIME 10 +#define CCK_PREAMBLE_BITS 144 +#define CCK_PLCP_BITS 48 + phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS; + if (shortPreamble && rates->info[rateix].shortPreamble) + phyTime >>= 1; + numBits = frameLen << 3; + txTime = CCK_SIFS_TIME + phyTime + + ((numBits * 1000)/kbps); + break; +#undef CCK_SIFS_TIME +#undef CCK_PREAMBLE_BITS +#undef CCK_PLCP_BITS + + case IEEE80211_T_OFDM: +#define OFDM_SIFS_TIME 16 +#define OFDM_PREAMBLE_TIME 20 +#define OFDM_PLCP_BITS 22 +#define OFDM_SYMBOL_TIME 4 + +#define OFDM_SIFS_TIME_HALF 32 +#define OFDM_PREAMBLE_TIME_HALF 40 +#define OFDM_PLCP_BITS_HALF 22 +#define OFDM_SYMBOL_TIME_HALF 8 + +#define OFDM_SIFS_TIME_QUARTER 64 +#define OFDM_PREAMBLE_TIME_QUARTER 80 +#define OFDM_PLCP_BITS_QUARTER 22 +#define OFDM_SYMBOL_TIME_QUARTER 16 + + if (AH_PRIVATE(ah)->ah_curchan && + IS_CHAN_QUARTER_RATE(AH_PRIVATE(ah)->ah_curchan)) { + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000; + HALASSERT(bitsPerSymbol != 0); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME_QUARTER + + OFDM_PREAMBLE_TIME_QUARTER + + (numSymbols * OFDM_SYMBOL_TIME_QUARTER); + } else if (AH_PRIVATE(ah)->ah_curchan && + IS_CHAN_HALF_RATE(AH_PRIVATE(ah)->ah_curchan)) { + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_HALF) / 1000; + HALASSERT(bitsPerSymbol != 0); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME_HALF + + OFDM_PREAMBLE_TIME_HALF + + (numSymbols * OFDM_SYMBOL_TIME_HALF); + } else { /* full rate channel */ + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000; + HALASSERT(bitsPerSymbol != 0); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME + OFDM_PREAMBLE_TIME + + (numSymbols * OFDM_SYMBOL_TIME); + } + break; + +#undef OFDM_SIFS_TIME +#undef OFDM_PREAMBLE_TIME +#undef OFDM_PLCP_BITS +#undef OFDM_SYMBOL_TIME + + case IEEE80211_T_TURBO: +#define TURBO_SIFS_TIME 8 +#define TURBO_PREAMBLE_TIME 14 +#define TURBO_PLCP_BITS 22 +#define TURBO_SYMBOL_TIME 4 + /* we still save OFDM rates in kbps - so double them */ + bitsPerSymbol = ((kbps << 1) * TURBO_SYMBOL_TIME) / 1000; + HALASSERT(bitsPerSymbol != 0); + + numBits = TURBO_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = TURBO_SIFS_TIME + TURBO_PREAMBLE_TIME + + (numSymbols * TURBO_SYMBOL_TIME); + break; +#undef TURBO_SIFS_TIME +#undef TURBO_PREAMBLE_TIME +#undef TURBO_PLCP_BITS +#undef TURBO_SYMBOL_TIME + + default: + HALDEBUG(ah, HAL_DEBUG_PHYIO, + "%s: unknown phy %u (rate ix %u)\n", + __func__, rates->info[rateix].phy, rateix); + txTime = 0; + break; + } + return txTime; +} + +static __inline int +mappsb(u_int freq, u_int flags) +{ + return ((freq * 10) + (((freq % 5) == 2) ? 5 : 0) - 49400) / 5; +} + +/* + * Convert GHz frequency to IEEE channel number. + */ +int +ath_hal_mhz2ieee(struct ath_hal *ah, u_int freq, u_int flags) +{ + if (flags & CHANNEL_2GHZ) { /* 2GHz band */ + if (freq == 2484) + return 14; + if (freq < 2484) { + return ((int)freq - 2407) / 5; + } else + return 15 + ((freq - 2512) / 20); + } else if (flags & CHANNEL_5GHZ) {/* 5Ghz band */ + if (ath_hal_ispublicsafetysku(ah) && + IS_CHAN_IN_PUBLIC_SAFETY_BAND(freq)) { + return mappsb(freq, flags); + } else if ((flags & CHANNEL_A) && (freq <= 5000)) { + return (freq - 4000) / 5; + } else { + return (freq - 5000) / 5; + } + } else { /* either, guess */ + if (freq == 2484) + return 14; + if (freq < 2484) { + return ((int)freq - 2407) / 5; + } + if (freq < 5000) { + if (ath_hal_ispublicsafetysku(ah) && + IS_CHAN_IN_PUBLIC_SAFETY_BAND(freq)) { + return mappsb(freq, flags); + } else if (freq > 4900) { + return (freq - 4000) / 5; + } else { + return 15 + ((freq - 2512) / 20); + } + } + return (freq - 5000) / 5; + } +} + +typedef enum { + WIRELESS_MODE_11a = 0, + WIRELESS_MODE_TURBO = 1, + WIRELESS_MODE_11b = 2, + WIRELESS_MODE_11g = 3, + WIRELESS_MODE_108g = 4, + + WIRELESS_MODE_MAX +} WIRELESS_MODE; + +static WIRELESS_MODE +ath_hal_chan2wmode(struct ath_hal *ah, const HAL_CHANNEL *chan) +{ + if (IS_CHAN_CCK(chan)) + return WIRELESS_MODE_11b; + if (IS_CHAN_G(chan)) + return WIRELESS_MODE_11g; + if (IS_CHAN_108G(chan)) + return WIRELESS_MODE_108g; + if (IS_CHAN_TURBO(chan)) + return WIRELESS_MODE_TURBO; + return WIRELESS_MODE_11a; +} + +/* + * Convert between microseconds and core system clocks. + */ + /* 11a Turbo 11b 11g 108g */ +static const uint8_t CLOCK_RATE[] = { 40, 80, 22, 44, 88 }; + +u_int +ath_hal_mac_clks(struct ath_hal *ah, u_int usecs) +{ + const HAL_CHANNEL *c = (const HAL_CHANNEL *) AH_PRIVATE(ah)->ah_curchan; + u_int clks; + + /* NB: ah_curchan may be null when called attach time */ + if (c != AH_NULL) { + clks = usecs * CLOCK_RATE[ath_hal_chan2wmode(ah, c)]; + if (IS_CHAN_HT40(c)) + clks <<= 1; + else if (IS_CHAN_HALF_RATE(c)) + clks >>= 1; + else if (IS_CHAN_QUARTER_RATE(c)) + clks >>= 2; + } else + clks = usecs * CLOCK_RATE[WIRELESS_MODE_11b]; + return clks; +} + +u_int +ath_hal_mac_usec(struct ath_hal *ah, u_int clks) +{ + const HAL_CHANNEL *c = (const HAL_CHANNEL *) AH_PRIVATE(ah)->ah_curchan; + u_int usec; + + /* NB: ah_curchan may be null when called attach time */ + if (c != AH_NULL) { + usec = clks / CLOCK_RATE[ath_hal_chan2wmode(ah, c)]; + if (IS_CHAN_HT40(c)) + usec >>= 1; + else if (IS_CHAN_HALF_RATE(c)) + usec <<= 1; + else if (IS_CHAN_QUARTER_RATE(c)) + usec <<= 2; + } else + usec = clks / CLOCK_RATE[WIRELESS_MODE_11b]; + return usec; +} + +/* + * Setup a h/w rate table's reverse lookup table and + * fill in ack durations. This routine is called for + * each rate table returned through the ah_getRateTable + * method. The reverse lookup tables are assumed to be + * initialized to zero (or at least the first entry). + * We use this as a key that indicates whether or not + * we've previously setup the reverse lookup table. + * + * XXX not reentrant, but shouldn't matter + */ +void +ath_hal_setupratetable(struct ath_hal *ah, HAL_RATE_TABLE *rt) +{ +#define N(a) (sizeof(a)/sizeof(a[0])) + int i; + + if (rt->rateCodeToIndex[0] != 0) /* already setup */ + return; + for (i = 0; i < N(rt->rateCodeToIndex); i++) + rt->rateCodeToIndex[i] = (uint8_t) -1; + for (i = 0; i < rt->rateCount; i++) { + uint8_t code = rt->info[i].rateCode; + uint8_t cix = rt->info[i].controlRate; + + HALASSERT(code < N(rt->rateCodeToIndex)); + rt->rateCodeToIndex[code] = i; + HALASSERT((code | rt->info[i].shortPreamble) < + N(rt->rateCodeToIndex)); + rt->rateCodeToIndex[code | rt->info[i].shortPreamble] = i; + /* + * XXX for 11g the control rate to use for 5.5 and 11 Mb/s + * depends on whether they are marked as basic rates; + * the static tables are setup with an 11b-compatible + * 2Mb/s rate which will work but is suboptimal + */ + rt->info[i].lpAckDuration = ath_hal_computetxtime(ah, rt, + WLAN_CTRL_FRAME_SIZE, cix, AH_FALSE); + rt->info[i].spAckDuration = ath_hal_computetxtime(ah, rt, + WLAN_CTRL_FRAME_SIZE, cix, AH_TRUE); + } +#undef N +} + +HAL_STATUS +ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, + uint32_t capability, uint32_t *result) +{ + const HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; + + switch (type) { + case HAL_CAP_REG_DMN: /* regulatory domain */ + *result = AH_PRIVATE(ah)->ah_currentRD; + return HAL_OK; + case HAL_CAP_CIPHER: /* cipher handled in hardware */ + case HAL_CAP_TKIP_MIC: /* handle TKIP MIC in hardware */ + return HAL_ENOTSUPP; + case HAL_CAP_TKIP_SPLIT: /* hardware TKIP uses split keys */ + return HAL_ENOTSUPP; + case HAL_CAP_PHYCOUNTERS: /* hardware PHY error counters */ + return pCap->halHwPhyCounterSupport ? HAL_OK : HAL_ENXIO; + case HAL_CAP_WME_TKIPMIC: /* hardware can do TKIP MIC when WMM is turned on */ + return HAL_ENOTSUPP; + case HAL_CAP_DIVERSITY: /* hardware supports fast diversity */ + return HAL_ENOTSUPP; + case HAL_CAP_KEYCACHE_SIZE: /* hardware key cache size */ + *result = pCap->halKeyCacheSize; + return HAL_OK; + case HAL_CAP_NUM_TXQUEUES: /* number of hardware tx queues */ + *result = pCap->halTotalQueues; + return HAL_OK; + case HAL_CAP_VEOL: /* hardware supports virtual EOL */ + return pCap->halVEOLSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_PSPOLL: /* hardware PS-Poll support works */ + return pCap->halPSPollBroken ? HAL_ENOTSUPP : HAL_OK; + case HAL_CAP_COMPRESSION: + return pCap->halCompressSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_BURST: + return pCap->halBurstSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_FASTFRAME: + return pCap->halFastFramesSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_DIAG: /* hardware diagnostic support */ + *result = AH_PRIVATE(ah)->ah_diagreg; + return HAL_OK; + case HAL_CAP_TXPOW: /* global tx power limit */ + switch (capability) { + case 0: /* facility is supported */ + return HAL_OK; + case 1: /* current limit */ + *result = AH_PRIVATE(ah)->ah_powerLimit; + return HAL_OK; + case 2: /* current max tx power */ + *result = AH_PRIVATE(ah)->ah_maxPowerLevel; + return HAL_OK; + case 3: /* scale factor */ + *result = AH_PRIVATE(ah)->ah_tpScale; + return HAL_OK; + } + return HAL_ENOTSUPP; + case HAL_CAP_BSSIDMASK: /* hardware supports bssid mask */ + return pCap->halBssIdMaskSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_MCAST_KEYSRCH: /* multicast frame keycache search */ + return pCap->halMcastKeySrchSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_TSF_ADJUST: /* hardware has beacon tsf adjust */ + return HAL_ENOTSUPP; + case HAL_CAP_CHAN_HALFRATE: + return pCap->halChanHalfRate ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_CHAN_QUARTERRATE: + return pCap->halChanQuarterRate ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_RFSILENT: /* rfsilent support */ + switch (capability) { + case 0: /* facility is supported */ + return pCap->halRfSilentSupport ? HAL_OK : HAL_ENOTSUPP; + case 1: /* current setting */ + return AH_PRIVATE(ah)->ah_rfkillEnabled ? + HAL_OK : HAL_ENOTSUPP; + case 2: /* rfsilent config */ + *result = AH_PRIVATE(ah)->ah_rfsilent; + return HAL_OK; + } + return HAL_ENOTSUPP; + case HAL_CAP_11D: +#ifdef AH_SUPPORT_11D + return HAL_OK; +#else + return HAL_ENOTSUPP; +#endif + case HAL_CAP_RXORN_FATAL: /* HAL_INT_RXORN treated as fatal */ + return AH_PRIVATE(ah)->ah_rxornIsFatal ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_HT: + return pCap->halHTSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_TX_CHAINMASK: /* mask of TX chains supported */ + *result = pCap->halTxChainMask; + return HAL_OK; + case HAL_CAP_RX_CHAINMASK: /* mask of RX chains supported */ + *result = pCap->halRxChainMask; + return HAL_OK; + case HAL_CAP_RXTSTAMP_PREC: /* rx desc tstamp precision (bits) */ + *result = pCap->halTstampPrecision; + return HAL_OK; + default: + return HAL_EINVAL; + } +} + +HAL_BOOL +ath_hal_setcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, + uint32_t capability, uint32_t setting, HAL_STATUS *status) +{ + + switch (type) { + case HAL_CAP_TXPOW: + switch (capability) { + case 3: + if (setting <= HAL_TP_SCALE_MIN) { + AH_PRIVATE(ah)->ah_tpScale = setting; + return AH_TRUE; + } + break; + } + break; + case HAL_CAP_RFSILENT: /* rfsilent support */ + /* + * NB: allow even if halRfSilentSupport is false + * in case the EEPROM is misprogrammed. + */ + switch (capability) { + case 1: /* current setting */ + AH_PRIVATE(ah)->ah_rfkillEnabled = (setting != 0); + return AH_TRUE; + case 2: /* rfsilent config */ + /* XXX better done per-chip for validation? */ + AH_PRIVATE(ah)->ah_rfsilent = setting; + return AH_TRUE; + } + break; + case HAL_CAP_REG_DMN: /* regulatory domain */ + AH_PRIVATE(ah)->ah_currentRD = setting; + return AH_TRUE; + case HAL_CAP_RXORN_FATAL: /* HAL_INT_RXORN treated as fatal */ + AH_PRIVATE(ah)->ah_rxornIsFatal = setting; + return AH_TRUE; + default: + break; + } + if (status) + *status = HAL_EINVAL; + return AH_FALSE; +} + +/* + * Common support for getDiagState method. + */ + +static u_int +ath_hal_getregdump(struct ath_hal *ah, const HAL_REGRANGE *regs, + void *dstbuf, int space) +{ + uint32_t *dp = dstbuf; + int i; + + for (i = 0; space >= 2*sizeof(uint32_t); i++) { + u_int r = regs[i].start; + u_int e = regs[i].end; + *dp++ = (r<<16) | e; + space -= sizeof(uint32_t); + do { + *dp++ = OS_REG_READ(ah, r); + r += sizeof(uint32_t); + space -= sizeof(uint32_t); + } while (r <= e && space >= sizeof(uint32_t)); + } + return (char *) dp - (char *) dstbuf; +} + +HAL_BOOL +ath_hal_getdiagstate(struct ath_hal *ah, int request, + const void *args, uint32_t argsize, + void **result, uint32_t *resultsize) +{ + switch (request) { + case HAL_DIAG_REVS: + *result = &AH_PRIVATE(ah)->ah_devid; + *resultsize = sizeof(HAL_REVS); + return AH_TRUE; + case HAL_DIAG_REGS: + *resultsize = ath_hal_getregdump(ah, args, *result,*resultsize); + return AH_TRUE; + case HAL_DIAG_FATALERR: + *result = &AH_PRIVATE(ah)->ah_fatalState[0]; + *resultsize = sizeof(AH_PRIVATE(ah)->ah_fatalState); + return AH_TRUE; + case HAL_DIAG_EEREAD: + if (argsize != sizeof(uint16_t)) + return AH_FALSE; + if (!ath_hal_eepromRead(ah, *(const uint16_t *)args, *result)) + return AH_FALSE; + *resultsize = sizeof(uint16_t); + return AH_TRUE; +#ifdef AH_PRIVATE_DIAG + case HAL_DIAG_SETKEY: { + const HAL_DIAG_KEYVAL *dk; + + if (argsize != sizeof(HAL_DIAG_KEYVAL)) + return AH_FALSE; + dk = (const HAL_DIAG_KEYVAL *)args; + return ah->ah_setKeyCacheEntry(ah, dk->dk_keyix, + &dk->dk_keyval, dk->dk_mac, dk->dk_xor); + } + case HAL_DIAG_RESETKEY: + if (argsize != sizeof(uint16_t)) + return AH_FALSE; + return ah->ah_resetKeyCacheEntry(ah, *(const uint16_t *)args); +#endif /* AH_PRIVATE_DIAG */ + case HAL_DIAG_11NCOMPAT: + if (argsize == 0) { + *resultsize = sizeof(uint32_t); + *((uint32_t *)(*result)) = + AH_PRIVATE(ah)->ah_11nCompat; + } else if (argsize == sizeof(uint32_t)) { + AH_PRIVATE(ah)->ah_11nCompat = *(const uint32_t *)args; + } else + return AH_FALSE; + return AH_TRUE; + } + return AH_FALSE; +} + +/* + * Set the properties of the tx queue with the parameters + * from qInfo. + */ +HAL_BOOL +ath_hal_setTxQProps(struct ath_hal *ah, + HAL_TX_QUEUE_INFO *qi, const HAL_TXQ_INFO *qInfo) +{ + uint32_t cw; + + if (qi->tqi_type == HAL_TX_QUEUE_INACTIVE) { + HALDEBUG(ah, HAL_DEBUG_TXQUEUE, + "%s: inactive queue\n", __func__); + return AH_FALSE; + } + /* XXX validate parameters */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 00:16:31 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46B4B106564A; Fri, 28 Nov 2008 00:16:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 195BE8FC1E; Fri, 28 Nov 2008 00:16:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAS0GVI5002005; Fri, 28 Nov 2008 00:16:31 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAS0GVls002004; Fri, 28 Nov 2008 00:16:31 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811280016.mAS0GVls002004@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 00:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185378 - in projects/ath_hal: . linux public X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 00:16:31 -0000 Author: sam Date: Fri Nov 28 00:16:30 2008 New Revision: 185378 URL: http://svn.freebsd.org/changeset/base/185378 Log: remove unneeded stuff Deleted: projects/ath_hal/COPYRIGHT projects/ath_hal/README projects/ath_hal/linux/ projects/ath_hal/public/ From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 00:17:12 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 874911065672; Fri, 28 Nov 2008 00:17:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7F38FC24; Fri, 28 Nov 2008 00:17:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAS0HCsd002051; Fri, 28 Nov 2008 00:17:12 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAS0HC4x002050; Fri, 28 Nov 2008 00:17:12 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811280017.mAS0HC4x002050@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 00:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185379 - projects/ath_hal X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 00:17:12 -0000 Author: sam Date: Fri Nov 28 00:17:12 2008 New Revision: 185379 URL: http://svn.freebsd.org/changeset/base/185379 Log: not needed Deleted: projects/ath_hal/Makefile From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 00:48:06 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A294A106567C; Fri, 28 Nov 2008 00:48:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CA718FC0A; Fri, 28 Nov 2008 00:48:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAS0m6VA002718; Fri, 28 Nov 2008 00:48:06 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAS0m6hP002706; Fri, 28 Nov 2008 00:48:06 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811280048.mAS0m6hP002706@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 00:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185380 - in projects/ath_hal: . ar5210 ar5211 ar5212 ar5312 ar5416 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 00:48:06 -0000 Author: sam Date: Fri Nov 28 00:48:05 2008 New Revision: 185380 URL: http://svn.freebsd.org/changeset/base/185380 Log: Update to later code from my repository: o many bug fixes o add new periodic calibration api o break up 5416 periodic calibration code in preparation for 928x o move get noise floor to rf backends o 5416-specific ani (still disabled) o modularize 5210 eeprom format a la other eeprom formats o start cleaning up regdomain code o prepare for proper 1/2 and 1/4 width channel support o bring back 900MHz card support o clean up 5212 rf version handling o add 1/2 and 1/4 width channel support for 5212 parts o split 5212 rfgain handling out o improve ani debugging o add AH_USE_INIPDGAIN compile option o purge a bunch of dead 5212 state o add 1/2 and 1/4 rate modes o remove HAL_CAP_CHAN_HALFRATE and HAL_CAP_CHAN_QUARTERRATE; the same info can now be deduced from the set of supported modes Added: projects/ath_hal/ah_eeprom_v1.c (contents, props changed) projects/ath_hal/ah_eeprom_v1.h (contents, props changed) projects/ath_hal/ar5212/ar5212_rfgain.c (contents, props changed) projects/ath_hal/ar5416/ar5416_ani.c (contents, props changed) projects/ath_hal/ar5416/ar5416_cal.c (contents, props changed) projects/ath_hal/ar5416/ar5416_cal.h (contents, props changed) projects/ath_hal/ar5416/ar5416_cal_adcdc.c (contents, props changed) projects/ath_hal/ar5416/ar5416_cal_adcgain.c (contents, props changed) projects/ath_hal/ar5416/ar5416_cal_iq.c (contents, props changed) Modified: projects/ath_hal/ah.c projects/ath_hal/ah.h projects/ath_hal/ah_desc.h projects/ath_hal/ah_devid.h projects/ath_hal/ah_eeprom.h projects/ath_hal/ah_eeprom_v14.c projects/ath_hal/ah_eeprom_v3.c projects/ath_hal/ah_internal.h projects/ath_hal/ah_regdomain.c projects/ath_hal/ar5210/ar5210.h projects/ath_hal/ar5210/ar5210_attach.c projects/ath_hal/ar5210/ar5210_misc.c projects/ath_hal/ar5210/ar5210_reset.c projects/ath_hal/ar5210/ar5210desc.h projects/ath_hal/ar5211/ar5211.h projects/ath_hal/ar5211/ar5211_attach.c projects/ath_hal/ar5211/ar5211_interrupts.c projects/ath_hal/ar5211/ar5211_misc.c projects/ath_hal/ar5211/ar5211_reset.c projects/ath_hal/ar5211/ar5211_xmit.c projects/ath_hal/ar5212/ar2316.c projects/ath_hal/ar5212/ar2317.c projects/ath_hal/ar5212/ar2413.c projects/ath_hal/ar5212/ar2425.c projects/ath_hal/ar5212/ar5212.h projects/ath_hal/ar5212/ar5212_ani.c projects/ath_hal/ar5212/ar5212_attach.c projects/ath_hal/ar5212/ar5212_interrupts.c projects/ath_hal/ar5212/ar5212_misc.c projects/ath_hal/ar5212/ar5212_phy.c projects/ath_hal/ar5212/ar5212_reset.c projects/ath_hal/ar5212/ar5212phy.h projects/ath_hal/ar5212/ar5212reg.h projects/ath_hal/ar5212/ar5311reg.h projects/ath_hal/ar5212/ar5413.c projects/ath_hal/ar5312/ar5312.h projects/ath_hal/ar5312/ar5312_attach.c projects/ath_hal/ar5312/ar5312_misc.c projects/ath_hal/ar5312/ar5312_reset.c projects/ath_hal/ar5416/ar2133.c projects/ath_hal/ar5416/ar5416.h projects/ath_hal/ar5416/ar5416_attach.c projects/ath_hal/ar5416/ar5416_beacon.c projects/ath_hal/ar5416/ar5416_misc.c projects/ath_hal/ar5416/ar5416_phy.c projects/ath_hal/ar5416/ar5416_power.c projects/ath_hal/ar5416/ar5416_recv.c projects/ath_hal/ar5416/ar5416_reset.c projects/ath_hal/ar5416/ar5416_xmit.c projects/ath_hal/ar5416/ar5416desc.h projects/ath_hal/ar5416/ar5416phy.h projects/ath_hal/ar5416/ar5416reg.h projects/ath_hal/ar5416/ar9160_attach.c projects/ath_hal/version.h Modified: projects/ath_hal/ah.c ============================================================================== --- projects/ath_hal/ah.c Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah.c Fri Nov 28 00:48:05 2008 (r185380) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah.c,v 1.13 2008/11/10 04:08:00 sam Exp $ + * $Id: ah.c,v 1.15 2008/11/15 22:15:44 sam Exp $ */ #include "opt_ah.h" @@ -46,6 +46,14 @@ extern struct ath_hal *ar5416Attach(uint extern struct ath_hal *ar9160Attach(uint16_t, HAL_SOFTC, HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); #endif +#ifdef AH_SUPPORT_AR9280 +extern struct ath_hal *ar9280Attach(uint16_t, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); +#endif +#ifdef AH_SUPPORT_AR9285 +extern struct ath_hal *ar9285Attach(uint16_t, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); +#endif #include "version.h" char ath_hal_version[] = ATH_HAL_VERSION; @@ -68,6 +76,12 @@ const char* ath_hal_buildopts[] = { #ifdef AH_SUPPORT_AR9180 "AR9180", #endif +#ifdef AH_SUPPORT_AR9280 + "AR9280", +#endif +#ifdef AH_SUPPORT_AR9285 + "AR9285", +#endif #ifdef AH_SUPPORT_5111 "RF5111", #endif @@ -110,12 +124,21 @@ const char* ath_hal_buildopts[] = { #ifdef AH_PRIVATE_DIAG "PRIVATE_DIAG", #endif +#ifdef AH_SUPPORT_WRITE_EEPROM + "WRITE_EEPROM", +#endif +#ifdef AH_SUPPORT_WRITE_REGDOMAIN + "WRITE_REGDOMAIN", +#endif #ifdef AH_DEBUG_COUNTRY "DEBUG_COUNTRY", #endif #ifdef AH_NEED_DESC_SWAP "TX_DESC_SWAP", #endif +#ifdef AH_USE_INIPDGAIN + "INIPDGAIN", +#endif #ifdef AH_DISABLE_WME "DISABLE_WME", #endif @@ -169,6 +192,11 @@ ath_hal_devname(uint16_t devid) return "Atheros 5416"; case AR9160_DEVID_PCI: return "Atheros 9160"; + case AR9280_DEVID_PCI: + case AR9280_DEVID_PCIE: + return "Atheros 9280"; + case AR9285_DEVID_PCIE: + return "Atheros 9285"; } return AH_NULL; } @@ -247,6 +275,17 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC ah = ar9160Attach(devid, sc, st, sh, error); break; #endif +#ifdef AH_SUPPORT_AR9280 + case AR9280_DEVID_PCI: + case AR9280_DEVID_PCIE: + ah = ar9280Attach(devid, sc, st, sh, error); + break; +#endif +#ifdef AH_SUPPORT_AR9285 + case AR9285_DEVID_PCIE: + ah = ar9285Attach(devid, sc, st, sh, error); + break; +#endif default: ah = AH_NULL; *error = HAL_ENXIO; @@ -419,6 +458,19 @@ ath_hal_computetxtime(struct ath_hal *ah } static __inline int +mapgsm(u_int freq, u_int flags) +{ + freq *= 10; + if (flags & CHANNEL_QUARTER) + freq += 5; + else if (flags & CHANNEL_HALF) + freq += 10; + else + freq += 20; + return (freq - 24220) / 5; +} + +static __inline int mappsb(u_int freq, u_int flags) { return ((freq * 10) + (((freq % 5) == 2) ? 5 : 0) - 49400) / 5; @@ -434,6 +486,8 @@ ath_hal_mhz2ieee(struct ath_hal *ah, u_i if (freq == 2484) return 14; if (freq < 2484) { + if (ath_hal_isgsmsku(ah)) + return mapgsm(freq, flags); return ((int)freq - 2407) / 5; } else return 15 + ((freq - 2512) / 20); @@ -450,6 +504,8 @@ ath_hal_mhz2ieee(struct ath_hal *ah, u_i if (freq == 2484) return 14; if (freq < 2484) { + if (ath_hal_isgsmsku(ah)) + return mapgsm(freq, flags); return ((int)freq - 2407) / 5; } if (freq < 5000) { @@ -641,10 +697,6 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->halMcastKeySrchSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_TSF_ADJUST: /* hardware has beacon tsf adjust */ return HAL_ENOTSUPP; - case HAL_CAP_CHAN_HALFRATE: - return pCap->halChanHalfRate ? HAL_OK : HAL_ENOTSUPP; - case HAL_CAP_CHAN_QUARTERRATE: - return pCap->halChanQuarterRate ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_RFSILENT: /* rfsilent support */ switch (capability) { case 0: /* facility is supported */ @@ -789,6 +841,15 @@ ath_hal_getdiagstate(struct ath_hal *ah, if (argsize != sizeof(uint16_t)) return AH_FALSE; return ah->ah_resetKeyCacheEntry(ah, *(const uint16_t *)args); +#ifdef AH_SUPPORT_WRITE_EEPROM + case HAL_DIAG_EEWRITE: { + const HAL_DIAG_EEVAL *ee; + if (argsize != sizeof(HAL_DIAG_EEVAL)) + return AH_FALSE; + ee = (const HAL_DIAG_EEVAL *)args; + return ath_hal_eepromWrite(ah, ee->ee_off, ee->ee_data); + } +#endif /* AH_SUPPORT_WRITE_EEPROM */ #endif /* AH_PRIVATE_DIAG */ case HAL_DIAG_11NCOMPAT: if (argsize == 0) { Modified: projects/ath_hal/ah.h ============================================================================== --- projects/ath_hal/ah.h Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah.h Fri Nov 28 00:48:05 2008 (r185380) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah.h,v 1.13 2008/11/10 04:08:00 sam Exp $ + * $Id: ah.h,v 1.15 2008/11/15 03:43:50 sam Exp $ */ #ifndef _ATH_AH_H_ @@ -105,8 +105,8 @@ typedef enum { HAL_CAP_TSF_ADJUST = 20, /* hardware has beacon tsf adjust */ /* 21 was HAL_CAP_XR */ HAL_CAP_WME_TKIPMIC = 22, /* hardware can support TKIP MIC when WMM is turned on */ - HAL_CAP_CHAN_HALFRATE = 23, /* hardware can support half rate channels */ - HAL_CAP_CHAN_QUARTERRATE = 24, /* hardware can support quarter rate channels */ + /* 23 was HAL_CAP_CHAN_HALFRATE */ + /* 24 was HAL_CAP_CHAN_QUARTERRATE */ HAL_CAP_RFSILENT = 25, /* hardware has rfsilent support */ HAL_CAP_TPC_ACK = 26, /* ack txpower with per-packet tpc */ HAL_CAP_TPC_CTS = 27, /* cts txpower with per-packet tpc */ @@ -466,8 +466,10 @@ enum { #endif HAL_MODE_108G = 0x020, /* 11g+Turbo channels */ HAL_MODE_108A = 0x040, /* 11a+Turbo channels */ - HAL_MODE_11A_HALF_RATE = 0x200, /* 11A half rate channels */ - HAL_MODE_11A_QUARTER_RATE = 0x400, /* 11A quarter rate channels */ + HAL_MODE_11A_HALF_RATE = 0x200, /* 11a half width channels */ + HAL_MODE_11A_QUARTER_RATE = 0x400, /* 11a quarter width channels */ + HAL_MODE_11G_HALF_RATE = 0x800, /* 11g half width channels */ + HAL_MODE_11G_QUARTER_RATE = 0x1000, /* 11g quarter width channels */ HAL_MODE_11NG_HT20 = 0x008000, HAL_MODE_11NA_HT20 = 0x010000, HAL_MODE_11NG_HT40PLUS = 0x020000, @@ -654,7 +656,7 @@ struct ath_rx_status; struct ath_hal { uint32_t ah_magic; /* consistency check magic number */ uint32_t ah_abi; /* HAL ABI version */ -#define HAL_ABI_VERSION 0x08110600 /* YYMMDDnn */ +#define HAL_ABI_VERSION 0x08111400 /* YYMMDDnn */ uint16_t ah_devid; /* PCI device ID */ uint16_t ah_subvendorid; /* PCI subvendor ID */ HAL_SOFTC ah_sc; /* back pointer to driver/os state */ @@ -680,7 +682,11 @@ struct ath_hal { HAL_BOOL __ahdecl(*ah_phyDisable)(struct ath_hal *); HAL_BOOL __ahdecl(*ah_disable)(struct ath_hal *); void __ahdecl(*ah_setPCUConfig)(struct ath_hal *); - HAL_BOOL __ahdecl(*ah_perCalibration)(struct ath_hal*, HAL_CHANNEL *, HAL_BOOL *); + HAL_BOOL __ahdecl(*ah_perCalibration)(struct ath_hal*, HAL_CHANNEL *, + HAL_BOOL *); + HAL_BOOL __ahdecl(*ah_perCalibrationN)(struct ath_hal *, HAL_CHANNEL *, + u_int chainMask, HAL_BOOL longCal, HAL_BOOL *isCalDone); + HAL_BOOL __ahdecl(*ah_resetCalValid)(struct ath_hal *, HAL_CHANNEL *); HAL_BOOL __ahdecl(*ah_setTxPowerLimit)(struct ath_hal *, uint32_t); /* Transmit functions */ Modified: projects/ath_hal/ah_desc.h ============================================================================== --- projects/ath_hal/ah_desc.h Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah_desc.h Fri Nov 28 00:48:05 2008 (r185380) @@ -167,7 +167,8 @@ enum { /* * Definitions for the software frame/packet descriptors used by - * the Atheros HAL. Drivers are expected to fillin the + * the Atheros HAL. This definition obscures hardware-specific + * details from the driver. Drivers are expected to fillin the * portions of a descriptor that are not opaque then use HAL calls * to complete the work. Status for completed frames is returned * in a device-independent format. Modified: projects/ath_hal/ah_devid.h ============================================================================== --- projects/ath_hal/ah_devid.h Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah_devid.h Fri Nov 28 00:48:05 2008 (r185380) @@ -23,8 +23,8 @@ #define ATHEROS_VENDOR_ID 0x168c /* Atheros PCI vendor ID */ /* * NB: all Atheros-based devices should have a PCI vendor ID - * of 0x168c, but some vendors do not follow this so we - * must handle them specially. + * of 0x168c, but some vendors, in their infinite wisdom + * do not follow this so we must handle them specially. */ #define ATHEROS_3COM_VENDOR_ID 0xa727 /* 3Com 3CRPAG175 vendor ID */ #define ATHEROS_3COM2_VENDOR_ID 0x10b7 /* 3Com 3CRDAG675 vendor ID */ Modified: projects/ath_hal/ah_eeprom.h ============================================================================== --- projects/ath_hal/ah_eeprom.h Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah_eeprom.h Fri Nov 28 00:48:05 2008 (r185380) @@ -14,11 +14,12 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom.h,v 1.6 2008/11/10 04:08:00 sam Exp $ + * $Id: ah_eeprom.h,v 1.11 2008/11/27 22:32:48 sam Exp $ */ #ifndef _ATH_AH_EEPROM_H_ #define _ATH_AH_EEPROM_H_ +#define AR_EEPROM_VER1 0x1000 /* Version 1.0; 5210 only */ /* * Version 3 EEPROMs are all 16K. * 3.1 adds turbo limit, antenna gain, 16 CTL's, 11g info, @@ -34,15 +35,17 @@ #define AR_EEPROM_VER3_2 0x3002 /* Version 3.2 */ #define AR_EEPROM_VER3_3 0x3003 /* Version 3.3 */ #define AR_EEPROM_VER3_4 0x3004 /* Version 3.4 */ +#define AR_EEPROM_VER4 0x4000 /* Version 4.x */ #define AR_EEPROM_VER4_0 0x4000 /* Version 4.0 */ #define AR_EEPROM_VER4_1 0x4001 /* Version 4.0 */ #define AR_EEPROM_VER4_2 0x4002 /* Version 4.0 */ #define AR_EEPROM_VER4_3 0x4003 /* Version 4.0 */ #define AR_EEPROM_VER4_6 0x4006 /* Version 4.0 */ #define AR_EEPROM_VER4_7 0x3007 /* Version 4.7 */ -#define AR_EEPROM_VER4_9 0x4009 /* EEPROM EAR futureproofing */ -#define AR_EEPROM_VER5_0 0x5000 /* Adds new 2413 cal powers and added params */ -#define AR_EEPROM_VER5_1 0x5001 /* Adds capability values */ +#define AR_EEPROM_VER4_9 0x4009 /* EEPROM EAR futureproofing */ +#define AR_EEPROM_VER5 0x5000 /* Version 5.x */ +#define AR_EEPROM_VER5_0 0x5000 /* Adds new 2413 cal powers and added params */ +#define AR_EEPROM_VER5_1 0x5001 /* Adds capability values */ #define AR_EEPROM_VER5_3 0x5003 /* Adds spur mitigation table */ #define AR_EEPROM_VER5_4 0x5004 /* @@ -50,7 +53,8 @@ * 14.2 adds txFrameToPaOn, txFrameToDataStart, ht40PowerInc * 14.3 adds bswAtten, bswMargin, swSettle, and base OpFlags for HT20/40 */ -#define AR_EEPROM_VER14_1 0xE001 /* 11n support */ +#define AR_EEPROM_VER14 0xE000 /* Version 14.x */ +#define AR_EEPROM_VER14_1 0xE001 /* Adds 11n support */ #define AR_EEPROM_VER14_2 0xE002 #define AR_EEPROM_VER14_3 0xE003 #define AR_EEPROM_VER14_7 0xE007 @@ -75,8 +79,8 @@ enum { AR_EEP_BURST, /* use ath_hal_eepromGetFlag */ AR_EEP_MAXQCU, /* uint16_t* */ AR_EEP_KCENTRIES, /* uint16_t* */ - AR_EEP_NFTHRESH_5, /* uint8_t* */ - AR_EEP_NFTHRESH_2, /* uint8_t* */ + AR_EEP_NFTHRESH_5, /* int16_t* */ + AR_EEP_NFTHRESH_2, /* int16_t* */ AR_EEP_REGDMN_0, /* uint16_t* */ AR_EEP_REGDMN_1, /* uint16_t* */ AR_EEP_OPCAP, /* uint16_t* */ @@ -122,6 +126,8 @@ typedef struct { /* XXX exposed to chip code */ #define MAX_RATE_POWER 63 +HAL_STATUS ath_hal_v1EepromAttach(struct ath_hal *ah); HAL_STATUS ath_hal_legacyEepromAttach(struct ath_hal *ah); HAL_STATUS ath_hal_v14EepromAttach(struct ath_hal *ah); +HAL_STATUS ath_hal_v4kEepromAttach(struct ath_hal *ah); #endif /* _ATH_AH_EEPROM_H_ */ Added: projects/ath_hal/ah_eeprom_v1.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ath_hal/ah_eeprom_v1.c Fri Nov 28 00:48:05 2008 (r185380) @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2008 Sam Leffler, Errno Consulting + * Copyright (c) 2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ah_eeprom_v1.c,v 1.1 2008/11/11 02:40:11 sam Exp $ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_eeprom_v1.h" + +static HAL_STATUS +v1EepromGet(struct ath_hal *ah, int param, void *val) +{ + HAL_EEPROM_v1 *ee = AH_PRIVATE(ah)->ah_eeprom; + uint32_t sum; + uint16_t eeval; + uint8_t *macaddr; + int i; + + switch (param) { + case AR_EEP_MACADDR: /* Get MAC Address */ + sum = 0; + macaddr = val; + for (i = 0; i < 3; i++) { + if (!ath_hal_eepromRead(ah, AR_EEPROM_MAC(i), &eeval)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: cannot read EEPROM location %u\n", + __func__, i); + return HAL_EEREAD; + } + sum += eeval; + macaddr[2*i + 0] = eeval >> 8; + macaddr[2*i + 1] = eeval & 0xff; + } + if (sum == 0 || sum == 0xffff*3) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad mac address %s\n", + __func__, ath_hal_ether_sprintf(macaddr)); + return HAL_EEBADMAC; + } + return HAL_OK; + case AR_EEP_REGDMN_0: + *(uint16_t *) val = ee->ee_regDomain[0]; + return HAL_OK; + case AR_EEP_RFKILL: + HALASSERT(val == AH_NULL); + return ee->ee_rfKill ? HAL_OK : HAL_EIO; + case AR_EEP_WRITEPROTECT: + HALASSERT(val == AH_NULL); + return (ee->ee_protect & AR_EEPROM_PROTOTECT_WP_128_191) ? + HAL_OK : HAL_EIO; + default: + HALASSERT(0); + return HAL_EINVAL; + } +} + +static HAL_BOOL +v1EepromSet(struct ath_hal *ah, int param, int v) +{ + return HAL_EINVAL; +} + +static HAL_BOOL +v1EepromDiag(struct ath_hal *ah, int request, + const void *args, uint32_t argsize, void **result, uint32_t *resultsize) +{ + HAL_EEPROM_v1 *ee = AH_PRIVATE(ah)->ah_eeprom; + + switch (request) { + case HAL_DIAG_EEPROM: + *result = ee; + *resultsize = sizeof(*ee); + return AH_TRUE; + } + return AH_FALSE; +} + +static uint16_t +v1EepromGetSpurChan(struct ath_hal *ah, int ix, HAL_BOOL is2GHz) +{ + return AR_NO_SPUR; +} + +/* + * Reclaim any EEPROM-related storage. + */ +static void +v1EepromDetach(struct ath_hal *ah) +{ + HAL_EEPROM_v1 *ee = AH_PRIVATE(ah)->ah_eeprom; + + ath_hal_free(ee); + AH_PRIVATE(ah)->ah_eeprom = AH_NULL; +} + +HAL_STATUS +ath_hal_v1EepromAttach(struct ath_hal *ah) +{ + HAL_EEPROM_v1 *ee = AH_PRIVATE(ah)->ah_eeprom; + uint16_t athvals[AR_EEPROM_ATHEROS_MAX]; /* XXX off stack */ + uint16_t protect, version, eeval; + uint32_t sum; + int i, loc; + + HALASSERT(ee == AH_NULL); + + if (!ath_hal_eepromRead(ah, AR_EEPROM_MAGIC, &eeval)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: cannot read EEPROM magic number\n", __func__); + return HAL_EEREAD; + } + if (eeval != 0x5aa5) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: invalid EEPROM magic number 0x%x\n", __func__, eeval); + return HAL_EEMAGIC; + } + + if (!ath_hal_eepromRead(ah, AR_EEPROM_PROTECT, &protect)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: cannot read EEPROM protection bits; read locked?\n", + __func__); + return HAL_EEREAD; + } + HALDEBUG(ah, HAL_DEBUG_ATTACH, "EEPROM protect 0x%x\n", protect); + /* XXX check proper access before continuing */ + + if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &version)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: unable to read EEPROM version\n", __func__); + return HAL_EEREAD; + } + if (((version>>12) & 0xf) != 1) { + /* + * This code only groks the version 1 EEPROM layout. + */ + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: unsupported EEPROM version 0x%x found\n", + __func__, version); + return HAL_EEVERSION; + } + + /* + * Read the Atheros EEPROM entries and calculate the checksum. + */ + sum = 0; + for (i = 0; i < AR_EEPROM_ATHEROS_MAX; i++) { + if (!ath_hal_eepromRead(ah, AR_EEPROM_ATHEROS(i), &athvals[i])) + return HAL_EEREAD; + sum ^= athvals[i]; + } + if (sum != 0xffff) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad EEPROM checksum 0x%x\n", + __func__, sum); + return HAL_EEBADSUM; + } + + /* + * Valid checksum, fetch the regulatory domain and save values. + */ + if (!ath_hal_eepromRead(ah, AR_EEPROM_REG_DOMAIN, &eeval)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: cannot read regdomain from EEPROM\n", __func__); + return HAL_EEREAD; + } + + ee = ath_hal_malloc(sizeof(HAL_EEPROM_v1)); + if (ee == AH_NULL) { + /* XXX message */ + return HAL_ENOMEM; + } + + ee->ee_version = version; + ee->ee_protect = protect; + ee->ee_antenna = athvals[2]; + ee->ee_biasCurrents = athvals[3]; + ee->ee_thresh62 = athvals[4] & 0xff; + ee->ee_xlnaOn = (athvals[4] >> 8) & 0xff; + ee->ee_xpaOn = athvals[5] & 0xff; + ee->ee_xpaOff = (athvals[5] >> 8) & 0xff; + ee->ee_regDomain[0] = (athvals[6] >> 8) & 0xff; + ee->ee_regDomain[1] = athvals[6] & 0xff; + ee->ee_regDomain[2] = (athvals[7] >> 8) & 0xff; + ee->ee_regDomain[3] = athvals[7] & 0xff; + ee->ee_rfKill = athvals[8] & 0x1; + ee->ee_devType = (athvals[8] >> 1) & 0x7; + + for (i = 0, loc = AR_EEPROM_ATHEROS_TP_SETTINGS; i < AR_CHANNELS_MAX; i++, loc += AR_TP_SETTINGS_SIZE) { + struct tpcMap *chan = &ee->ee_tpc[i]; + + /* Copy pcdac and gain_f values from EEPROM */ + chan->pcdac[0] = (athvals[loc] >> 10) & 0x3F; + chan->gainF[0] = (athvals[loc] >> 4) & 0x3F; + chan->pcdac[1] = ((athvals[loc] << 2) & 0x3C) + | ((athvals[loc+1] >> 14) & 0x03); + chan->gainF[1] = (athvals[loc+1] >> 8) & 0x3F; + chan->pcdac[2] = (athvals[loc+1] >> 2) & 0x3F; + chan->gainF[2] = ((athvals[loc+1] << 4) & 0x30) + | ((athvals[loc+2] >> 12) & 0x0F); + chan->pcdac[3] = (athvals[loc+2] >> 6) & 0x3F; + chan->gainF[3] = athvals[loc+2] & 0x3F; + chan->pcdac[4] = (athvals[loc+3] >> 10) & 0x3F; + chan->gainF[4] = (athvals[loc+3] >> 4) & 0x3F; + chan->pcdac[5] = ((athvals[loc+3] << 2) & 0x3C) + | ((athvals[loc+4] >> 14) & 0x03); + chan->gainF[5] = (athvals[loc+4] >> 8) & 0x3F; + chan->pcdac[6] = (athvals[loc+4] >> 2) & 0x3F; + chan->gainF[6] = ((athvals[loc+4] << 4) & 0x30) + | ((athvals[loc+5] >> 12) & 0x0F); + chan->pcdac[7] = (athvals[loc+5] >> 6) & 0x3F; + chan->gainF[7] = athvals[loc+5] & 0x3F; + chan->pcdac[8] = (athvals[loc+6] >> 10) & 0x3F; + chan->gainF[8] = (athvals[loc+6] >> 4) & 0x3F; + chan->pcdac[9] = ((athvals[loc+6] << 2) & 0x3C) + | ((athvals[loc+7] >> 14) & 0x03); + chan->gainF[9] = (athvals[loc+7] >> 8) & 0x3F; + chan->pcdac[10] = (athvals[loc+7] >> 2) & 0x3F; + chan->gainF[10] = ((athvals[loc+7] << 4) & 0x30) + | ((athvals[loc+8] >> 12) & 0x0F); + + /* Copy Regulatory Domain and Rate Information from EEPROM */ + chan->rate36 = (athvals[loc+8] >> 6) & 0x3F; + chan->rate48 = athvals[loc+8] & 0x3F; + chan->rate54 = (athvals[loc+9] >> 10) & 0x3F; + chan->regdmn[0] = (athvals[loc+9] >> 4) & 0x3F; + chan->regdmn[1] = ((athvals[loc+9] << 2) & 0x3C) + | ((athvals[loc+10] >> 14) & 0x03); + chan->regdmn[2] = (athvals[loc+10] >> 8) & 0x3F; + chan->regdmn[3] = (athvals[loc+10] >> 2) & 0x3F; + } + + AH_PRIVATE(ah)->ah_eeprom = ee; + AH_PRIVATE(ah)->ah_eeversion = version; + AH_PRIVATE(ah)->ah_eepromDetach = v1EepromDetach; + AH_PRIVATE(ah)->ah_eepromGet = v1EepromGet; + AH_PRIVATE(ah)->ah_eepromSet = v1EepromSet; + AH_PRIVATE(ah)->ah_getSpurChan = v1EepromGetSpurChan; + AH_PRIVATE(ah)->ah_eepromDiag = v1EepromDiag; + return HAL_OK; +} Added: projects/ath_hal/ah_eeprom_v1.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ath_hal/ah_eeprom_v1.h Fri Nov 28 00:48:05 2008 (r185380) @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ah_eeprom_v1.h,v 1.1 2008/11/11 02:40:11 sam Exp $ + */ +#ifndef _ATH_AH_EEPROM_V1_H_ +#define _ATH_AH_EEPROM_V1_H_ + +#include "ah_eeprom.h" + +/* + * EEPROM defines for Version 1 Crete EEPROM. + * + * The EEPROM is segmented into three sections: + * + * PCI/Cardbus default configuration settings + * Cardbus CIS tuples and vendor-specific data + * Atheros-specific data + * + * EEPROM entries are read 32-bits at a time through the PCI bus + * interface but are all 16-bit values. + * + * Access to the Atheros-specific data is controlled by protection + * bits and the data is checksum'd. The driver reads the Atheros + * data from the EEPROM at attach and caches it in its private state. + * This data includes the local regulatory domain, channel calibration + * settings, and phy-related configuration settings. + */ +#define AR_EEPROM_MAC(i) (0x1f-(i))/* MAC address word */ +#define AR_EEPROM_MAGIC 0x3d /* magic number */ +#define AR_EEPROM_PROTECT 0x3f /* Atheros segment protect register */ +#define AR_EEPROM_PROTOTECT_WP_128_191 0x80 +#define AR_EEPROM_REG_DOMAIN 0xbf /* Current regulatory domain register */ +#define AR_EEPROM_ATHEROS_BASE 0xc0 /* Base of Atheros-specific data */ +#define AR_EEPROM_ATHEROS_MAX 64 /* 64x2=128 bytes of EEPROM settings */ +#define AR_EEPROM_ATHEROS(n) (AR_EEPROM_ATHEROS_BASE+(n)) +#define AR_EEPROM_VERSION AR_EEPROM_ATHEROS(1) +#define AR_EEPROM_ATHEROS_TP_SETTINGS 0x09 /* Transmit power settings */ +#define AR_REG_DOMAINS_MAX 4 /* # of Regulatory Domains */ +#define AR_CHANNELS_MAX 5 /* # of Channel calibration groups */ +#define AR_TP_SETTINGS_SIZE 11 /* # locations/Channel group */ +#define AR_TP_SCALING_ENTRIES 11 /* # entries in transmit power dBm->pcdac */ + +/* + * NB: we store the rfsilent select+polarity data packed + * with the encoding used in later parts so values + * returned to applications are consistent. + */ +#define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c +#define AR_EEPROM_RFSILENT_GPIO_SEL_S 2 +#define AR_EEPROM_RFSILENT_POLARITY 0x0002 +#define AR_EEPROM_RFSILENT_POLARITY_S 1 + +#define AR_I2DBM(x) ((uint8_t)((x * 2) + 3)) + +/* + * Transmit power and channel calibration settings. + */ +struct tpcMap { + uint8_t pcdac[AR_TP_SCALING_ENTRIES]; + uint8_t gainF[AR_TP_SCALING_ENTRIES]; + uint8_t rate36; + uint8_t rate48; + uint8_t rate54; + uint8_t regdmn[AR_REG_DOMAINS_MAX]; +}; + +/* + * Information retrieved from EEPROM. + */ +typedef struct { + uint16_t ee_version; /* Version field */ + uint16_t ee_protect; /* EEPROM protect field */ + uint16_t ee_antenna; /* Antenna Settings */ + uint16_t ee_biasCurrents; /* OB, DB */ + uint8_t ee_thresh62; /* thresh62 */ + uint8_t ee_xlnaOn; /* External LNA timing */ + uint8_t ee_xpaOff; /* Extern output stage timing */ + uint8_t ee_xpaOn; /* Extern output stage timing */ + uint8_t ee_rfKill; /* Single low bit signalling if RF Kill is implemented */ + uint8_t ee_devType; /* Type: PCI, miniPCI, CB */ + uint8_t ee_regDomain[AR_REG_DOMAINS_MAX]; + /* calibrated reg domains */ + struct tpcMap ee_tpc[AR_CHANNELS_MAX]; +} HAL_EEPROM_v1; +#endif /* _ATH_AH_EEPROM_V1_H_ */ Modified: projects/ath_hal/ah_eeprom_v14.c ============================================================================== --- projects/ath_hal/ah_eeprom_v14.c Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah_eeprom_v14.c Fri Nov 28 00:48:05 2008 (r185380) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v14.c,v 1.3 2008/11/10 04:08:00 sam Exp $ + * $Id: ah_eeprom_v14.c,v 1.4 2008/11/10 19:04:26 sam Exp $ */ #include "opt_ah.h" @@ -37,10 +37,10 @@ v14EepromGet(struct ath_hal *ah, int par switch (param) { case AR_EEP_NFTHRESH_5: - *(int8_t *)val = pModal[0].noiseFloorThreshCh[0]; + *(int16_t *)val = pModal[0].noiseFloorThreshCh[0]; return HAL_OK; case AR_EEP_NFTHRESH_2: - *(int8_t *)val = pModal[1].noiseFloorThreshCh[0]; + *(int16_t *)val = pModal[1].noiseFloorThreshCh[0]; return HAL_OK; case AR_EEP_MACADDR: /* Get MAC Address */ sum = 0; Modified: projects/ath_hal/ah_eeprom_v3.c ============================================================================== --- projects/ath_hal/ah_eeprom_v3.c Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah_eeprom_v3.c Fri Nov 28 00:48:05 2008 (r185380) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_eeprom_v3.c,v 1.3 2008/11/10 04:08:00 sam Exp $ + * $Id: ah_eeprom_v3.c,v 1.4 2008/11/27 22:39:42 sam Exp $ */ #include "opt_ah.h" @@ -1765,9 +1765,8 @@ legacyEepromDetach(struct ath_hal *ah) } /* - * TODO: Need to talk to Praveen about this, these are - * not valid 2.4 channels, either we change these - * or I need to change the beanie coding to accept these + * These are not valid 2.4 channels, either we change 'em + * or we need to change the coding to accept them. */ static const uint16_t channels11b[] = { 2412, 2447, 2484 }; static const uint16_t channels11g[] = { 2312, 2412, 2484 }; Modified: projects/ath_hal/ah_internal.h ============================================================================== --- projects/ath_hal/ah_internal.h Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah_internal.h Fri Nov 28 00:48:05 2008 (r185380) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_internal.h,v 1.17 2008/11/10 04:08:00 sam Exp $ + * $Id: ah_internal.h,v 1.21 2008/11/27 22:29:27 sam Exp $ */ #ifndef _ATH_AH_INTERAL_H_ #define _ATH_AH_INTERAL_H_ @@ -66,6 +66,9 @@ typedef struct { /* * Transmit power scale factor. + * + * NB: This is not public because we want to discourage the use of + * scaling; folks should use the tx power limit interface. */ typedef enum { HAL_TP_SCALE_MAX = 0, /* no scaling (default) */ @@ -165,7 +168,23 @@ typedef struct { /* * The ``private area'' follows immediately after the ``public area'' - * in the data structure returned by ath_hal_attach. + * in the data structure returned by ath_hal_attach. Private data are + * used by device-independent code such as the regulatory domain support. + * In general, code within the HAL should never depend on data in the + * public area. Instead any public data needed internally should be + * shadowed here. + * + * When declaring a device-specific ath_hal data structure this structure + * is assumed to at the front; e.g. + * + * struct ath_hal_5212 { + * struct ath_hal_private ah_priv; + * ... + * }; + * + * It might be better to manage the method pointers in this structure + * using an indirect pointer to a read-only data structure but this would + * disallow class-style method overriding. */ struct ath_hal_private { struct ath_hal h; /* public area */ @@ -189,6 +208,8 @@ struct ath_hal_private { HAL_CHANNEL *, uint32_t); int16_t (*ah_getNfAdjust)(struct ath_hal *, const HAL_CHANNEL_INTERNAL*); + void (*ah_getNoiseFloor)(struct ath_hal *, + int16_t nfarray[]); void *ah_eeprom; /* opaque EEPROM state */ uint16_t ah_eeversion; /* EEPROM version */ @@ -267,6 +288,8 @@ struct ath_hal_private { AH_PRIVATE(_ah)->ah_getChipPowerLimits(_ah, _chans, _nchan) #define ath_hal_getNfAdjust(_ah, _c) \ AH_PRIVATE(_ah)->ah_getNfAdjust(_ah, _c) +#define ath_hal_getNoiseFloor(_ah, _nfArray) \ + AH_PRIVATE(_ah)->ah_getNoiseFloor(_ah, _nfArray) #define ath_hal_eepromDetach(_ah) \ AH_PRIVATE(_ah)->ah_eepromDetach(_ah) Modified: projects/ath_hal/ah_regdomain.c ============================================================================== --- projects/ath_hal/ah_regdomain.c Fri Nov 28 00:17:12 2008 (r185379) +++ projects/ath_hal/ah_regdomain.c Fri Nov 28 00:48:05 2008 (r185380) @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_regdomain.c,v 1.17 2008/11/10 04:08:00 sam Exp $ + * $Id: ah_regdomain.c,v 1.24 2008/11/27 22:29:27 sam Exp $ */ #include "opt_ah.h" @@ -37,47 +37,49 @@ /* 10MHz is half the 11A bandwidth used to determine upper edge freq of the outdoor channel */ #define HALF_MAXCHANBW 10 - -/* - * Used to set the RegDomain bitmask which chooses which frequency - * band specs are used. - */ -#define BMLEN 2 /* Use 2 64 bit uint for channel bitmask - NB: Must agree with macro below (BM) */ -#define BMZERO {(uint64_t) 0, (uint64_t) 0} /* BMLEN zeros */ - -#define BM(_fa, _fb, _fc, _fd, _fe, _ff, _fg, _fh, _fi, _fj, _fk, _fl) \ - {((((_fa >= 0) && (_fa < 64)) ? (((uint64_t) 1) << _fa) : (uint64_t) 0) | \ - (((_fb >= 0) && (_fb < 64)) ? (((uint64_t) 1) << _fb) : (uint64_t) 0) | \ - (((_fc >= 0) && (_fc < 64)) ? (((uint64_t) 1) << _fc) : (uint64_t) 0) | \ - (((_fd >= 0) && (_fd < 64)) ? (((uint64_t) 1) << _fd) : (uint64_t) 0) | \ - (((_fe >= 0) && (_fe < 64)) ? (((uint64_t) 1) << _fe) : (uint64_t) 0) | \ - (((_ff >= 0) && (_ff < 64)) ? (((uint64_t) 1) << _ff) : (uint64_t) 0) | \ - (((_fg >= 0) && (_fg < 64)) ? (((uint64_t) 1) << _fg) : (uint64_t) 0) | \ - (((_fh >= 0) && (_fh < 64)) ? (((uint64_t) 1) << _fh) : (uint64_t) 0) | \ - (((_fi >= 0) && (_fi < 64)) ? (((uint64_t) 1) << _fi) : (uint64_t) 0) | \ - (((_fj >= 0) && (_fj < 64)) ? (((uint64_t) 1) << _fj) : (uint64_t) 0) | \ - (((_fk >= 0) && (_fk < 64)) ? (((uint64_t) 1) << _fk) : (uint64_t) 0) | \ - (((_fl >= 0) && (_fl < 64)) ? (((uint64_t) 1) << _fl) : (uint64_t) 0) | \ - ((((_fa > 63) && (_fa < 128)) ? (((uint64_t) 1) << (_fa - 64)) : (uint64_t) 0) | \ - (((_fb > 63) && (_fb < 128)) ? (((uint64_t) 1) << (_fb - 64)) : (uint64_t) 0) | \ - (((_fc > 63) && (_fc < 128)) ? (((uint64_t) 1) << (_fc - 64)) : (uint64_t) 0) | \ - (((_fd > 63) && (_fd < 128)) ? (((uint64_t) 1) << (_fd - 64)) : (uint64_t) 0) | \ - (((_fe > 63) && (_fe < 128)) ? (((uint64_t) 1) << (_fe - 64)) : (uint64_t) 0) | \ - (((_ff > 63) && (_ff < 128)) ? (((uint64_t) 1) << (_ff - 64)) : (uint64_t) 0) | \ - (((_fg > 63) && (_fg < 128)) ? (((uint64_t) 1) << (_fg - 64)) : (uint64_t) 0) | \ - (((_fh > 63) && (_fh < 128)) ? (((uint64_t) 1) << (_fh - 64)) : (uint64_t) 0) | \ - (((_fi > 63) && (_fi < 128)) ? (((uint64_t) 1) << (_fi - 64)) : (uint64_t) 0) | \ - (((_fj > 63) && (_fj < 128)) ? (((uint64_t) 1) << (_fj - 64)) : (uint64_t) 0) | \ - (((_fk > 63) && (_fk < 128)) ? (((uint64_t) 1) << (_fk - 64)) : (uint64_t) 0) | \ - (((_fl > 63) && (_fl < 128)) ? (((uint64_t) 1) << (_fl - 64)) : (uint64_t) 0)))} +/* + * BMLEN defines the size of the bitmask used to hold frequency + * band specifications. Note this must agree with the BM macro + * definition that's used to setup initializers. See also further + * comments below. + */ +#define BMLEN 2 /* 2 x 64 bits in each channel bitmask */ +typedef uint64_t chanbmask_t[BMLEN]; + +#define W0(_a) \ + (((_a) >= 0 && (_a) < 64 ? (((uint64_t) 1)<<(_a)) : (uint64_t) 0)) +#define W1(_a) \ + (((_a) > 63 && (_a) < 128 ? (((uint64_t) 1)<<((_a)-64)) : (uint64_t) 0)) +#define BM1(_fa) { W0(_fa), W1(_fa) } +#define BM2(_fa, _fb) { W0(_fa) | W0(_fb), W1(_fa) | W1(_fb) } +#define BM3(_fa, _fb, _fc) \ + { W0(_fa) | W0(_fb) | W0(_fc), W1(_fa) | W1(_fb) | W1(_fc) } +#define BM4(_fa, _fb, _fc, _fd) \ + { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd), \ + W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) } +#define BM5(_fa, _fb, _fc, _fd, _fe) \ + { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe), \ + W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) } +#define BM6(_fa, _fb, _fc, _fd, _fe, _ff) \ + { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe) | W0(_ff), \ + W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) | W1(_ff) } +#define BM7(_fa, _fb, _fc, _fd, _fe, _ff, _fg) \ + { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe) | W0(_ff) | \ + W0(_fg),\ + W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) | W1(_ff) | \ + W1(_fg) } +#define BM8(_fa, _fb, _fc, _fd, _fe, _ff, _fg, _fh) \ + { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd) | W0(_fe) | W0(_ff) | \ + W0(_fg) | W0(_fh) , \ + W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) | W1(_fe) | W1(_ff) | \ + W1(_fg) | W1(_fh) } /* * Country/Region Codes * Numbering from ISO 3166 */ -enum CountryCode { +enum { CTRY_ALBANIA = 8, /* Albania */ CTRY_ALGERIA = 12, /* Algeria */ CTRY_ARGENTINA = 32, /* Argentina */ @@ -202,6 +204,7 @@ enum CountryCode { CTRY_SLOVENIA = 705, /* Slovenia */ CTRY_SOUTH_AFRICA = 710, /* South Africa */ CTRY_SPAIN = 724, /* Spain */ + CTRY_SR9 = 5000, /* Ubiquiti SR9 (900MHz/GSM) */ CTRY_SWEDEN = 752, /* Sweden */ CTRY_SWITZERLAND = 756, /* Switzerland */ CTRY_SYRIA = 760, /* Syria */ @@ -219,23 +222,25 @@ enum CountryCode { CTRY_UZBEKISTAN = 860, /* Uzbekistan */ CTRY_VENEZUELA = 862, /* Venezuela */ CTRY_VIET_NAM = 704, /* Viet Nam */ + CTRY_XR9 = 5001, /* Ubiquiti XR9 (900MHz/GSM) */ + CTRY_GZ901 = 5002, /* Zcomax GZ-901 (900MHz/GSM) */ CTRY_YEMEN = 887, /* Yemen */ CTRY_ZIMBABWE = 716 /* Zimbabwe */ }; -/* Mask to check whether a domain is a multidomain or a single - domain */ - +/* + * Mask to check whether a domain is a multidomain or a single domain + */ #define MULTI_DOMAIN_MASK 0xFF00 -/* Enumerated Regulatory Domain Information 8 bit values indicate that +/* + * Enumerated Regulatory Domain Information 8 bit values indicate that * the regdomain is really a pair of unitary regdomains. 12 bit values * are the real unitary regdomains and are the only ones which have the * frequency bitmasks and flags set. */ - -enum EnumRd { +enum { /* * The following regulatory domain definitions are * found in the EEPROM. Each regulatory domain @@ -253,6 +258,7 @@ enum EnumRd { FCC1_FCCA = 0x10, /* USA */ FCC1_WORLD = 0x11, /* Hong Kong */ FCC4_FCCA = 0x12, /* USA - Public Safety */ + FCC5_FCCB = 0x13, /* USA w/ 1/2 and 1/4 width channels */ FCC2_FCCA = 0x20, /* Canada */ FCC2_WORLD = 0x21, /* Australia & HK */ @@ -380,7 +386,9 @@ enum EnumRd { FCC2 = 0x0120, /* Canada, Australia & New Zealand */ FCC3 = 0x0160, /* US w/new middle band & DFS */ FCC4 = 0x0165, /* US Public Safety */ + FCC5 = 0x0166, /* US w/ 1/2 and 1/4 width channels */ FCCA = 0x0A10, + FCCB = 0x0A11, /* US w/ 1/2 and 1/4 width channels */ APLD = 0x0D50, /* South Korea */ @@ -399,6 +407,9 @@ enum EnumRd { NULL1 = 0x0198, WORLD = 0x0199, + SR9_WORLD = 0x0298, + XR9_WORLD = 0x0299, + GZ901_WORLD = 0x029a, DEBUG_REG_DMN = 0x01ff, }; @@ -414,30 +425,24 @@ enum { /* conformance test limits */ /* * The following are flags for different requirements per reg domain. * These requirements are either inhereted from the reg domain pair or - * from the unitary reg domain if the reg domain pair flags value is - * 0 + * from the unitary reg domain if the reg domain pair flags value is 0 */ - enum { - NO_REQ = 0x00000000, + NO_REQ = 0x00000000, /* NB: must be zero */ DISALLOW_ADHOC_11A = 0x00000001, DISALLOW_ADHOC_11A_TURB = 0x00000002, NEED_NFC = 0x00000004, - ADHOC_PER_11D = 0x00000008, /* Start Ad-Hoc mode */ ADHOC_NO_11A = 0x00000010, - - PUBLIC_SAFETY_DOMAIN = 0x00000020, /* public safety domain */ - LIMIT_FRAME_4MS = 0x00000040, /* 4msec limit on the frame length */ - - NO_HOSTAP = 0x00000080, /* No HOSTAP mode opereation */ + LIMIT_FRAME_4MS = 0x00000020, /* 4msec limit on frame length*/ + NO_HOSTAP = 0x00000040, /* No HOSTAP mode opereation */ }; /* * The following describe the bit masks for different passive scan * capability/requirements per regdomain. */ -#define NO_PSCAN 0x0ULL +#define NO_PSCAN 0x0ULL /* NB: must be zero */ #define PSCAN_FCC 0x0000000000000001ULL #define PSCAN_FCC_T 0x0000000000000002ULL #define PSCAN_ETSI 0x0000000000000004ULL @@ -461,8 +466,7 @@ enum { * THE following table is the mapping of regdomain pairs specified by * an 8 bit regdomain value to the individual unitary reg domains */ - -typedef struct reg_dmn_pair_mapping { +typedef struct { HAL_REG_DOMAIN regDmnEnum; /* 16 bit reg domain pair */ HAL_REG_DOMAIN regDmn5GHz; /* 5GHz reg domain */ HAL_REG_DOMAIN regDmn2GHz; /* 2GHz reg domain */ @@ -487,12 +491,13 @@ static REG_DMN_PAIR_MAPPING regDomainPai {NULL1_ETSIB, NULL1, ETSIB, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, {NULL1_ETSIC, NULL1, ETSIC, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, - {FCC2_FCCA, FCC2, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, + {FCC2_FCCA, FCC2, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, {FCC2_WORLD, FCC2, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, {FCC2_ETSIC, FCC2, ETSIC, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, - {FCC3_FCCA, FCC3, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, - {FCC3_WORLD, FCC3, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, - {FCC4_FCCA, FCC4, FCCA, DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0 }, + {FCC3_FCCA, FCC3, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, + {FCC3_WORLD, FCC3, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, + {FCC4_FCCA, FCC4, FCCA, DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0 }, + {FCC5_FCCB, FCC5, FCCB, NO_REQ, NO_REQ, PSCAN_DEFER, 0 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 19:58:11 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD649106564A; Fri, 28 Nov 2008 19:58:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A608FC0C; Fri, 28 Nov 2008 19:58:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mASJwB93028242; Fri, 28 Nov 2008 19:58:11 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mASJwAFa028208; Fri, 28 Nov 2008 19:58:10 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811281958.mASJwAFa028208@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 19:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185406 - in projects/ath_hal: . ar5210 ar5211 ar5212 ar5312 ar5416 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 19:58:11 -0000 Author: sam Date: Fri Nov 28 19:58:09 2008 New Revision: 185406 URL: http://svn.freebsd.org/changeset/base/185406 Log: Replace most compile-time support options with linker sets for chip and RF backend support: o add OS_DATA_SET and OS_SET_DECLARE os requirements for setting up linker sets o add AH_CHIP macro for registering chip support (e.g. 5210) o add AH_RF macro for registering RF support (e.g. 2413); note this isn't required for single chip solutions where there's no ambiguity (e.g. 5416/9160+2133) but for 5212 class parts it's required because of the multi-chip solutions o remove all uses of AH_SUPPORT_AR5210, AH_SUPPORT_AR5211, AH_SUPPORT_5212, and AH_SUPPORT_AR9160; still need AH_SUPPORT_AR5416 to enable the 11n descriptor formats and 5312 support is presently broken o remove all uses of AH_SUPPORT_2133, AH_SUPPORT_2413, AH_SUPPORT_5111, AH_SUPPORT_5112, AH_SUPPORT_2417, AH_SUPPORT_2425, and AH_SUPPORT_5413; 5312-related support still requires fixup Remaining issues: o fixup SoC attach o ath_hal_attach uses a hack to probe w/o access to the vendorid o fallback handling of parts w/o a macrev needs to be restored Modified: projects/ath_hal/ah.c projects/ath_hal/ah_internal.h projects/ath_hal/ar5210/ar5210.h projects/ath_hal/ar5210/ar5210_attach.c projects/ath_hal/ar5210/ar5210_beacon.c projects/ath_hal/ar5210/ar5210_interrupts.c projects/ath_hal/ar5210/ar5210_keycache.c projects/ath_hal/ar5210/ar5210_misc.c projects/ath_hal/ar5210/ar5210_phy.c projects/ath_hal/ar5210/ar5210_power.c projects/ath_hal/ar5210/ar5210_recv.c projects/ath_hal/ar5210/ar5210_reset.c projects/ath_hal/ar5210/ar5210_xmit.c projects/ath_hal/ar5211/ar5211_attach.c projects/ath_hal/ar5211/ar5211_beacon.c projects/ath_hal/ar5211/ar5211_interrupts.c projects/ath_hal/ar5211/ar5211_keycache.c projects/ath_hal/ar5211/ar5211_misc.c projects/ath_hal/ar5211/ar5211_phy.c projects/ath_hal/ar5211/ar5211_power.c projects/ath_hal/ar5211/ar5211_recv.c projects/ath_hal/ar5211/ar5211_reset.c projects/ath_hal/ar5211/ar5211_xmit.c projects/ath_hal/ar5212/ar2316.c projects/ath_hal/ar5212/ar2317.c projects/ath_hal/ar5212/ar2413.c projects/ath_hal/ar5212/ar2425.c projects/ath_hal/ar5212/ar5111.c projects/ath_hal/ar5212/ar5112.c projects/ath_hal/ar5212/ar5212.h projects/ath_hal/ar5212/ar5212_ani.c projects/ath_hal/ar5212/ar5212_attach.c projects/ath_hal/ar5212/ar5212_beacon.c projects/ath_hal/ar5212/ar5212_eeprom.c projects/ath_hal/ar5212/ar5212_gpio.c projects/ath_hal/ar5212/ar5212_interrupts.c projects/ath_hal/ar5212/ar5212_keycache.c projects/ath_hal/ar5212/ar5212_misc.c projects/ath_hal/ar5212/ar5212_phy.c projects/ath_hal/ar5212/ar5212_power.c projects/ath_hal/ar5212/ar5212_recv.c projects/ath_hal/ar5212/ar5212_reset.c projects/ath_hal/ar5212/ar5212_rfgain.c projects/ath_hal/ar5212/ar5212_xmit.c projects/ath_hal/ar5212/ar5413.c projects/ath_hal/ar5312/ar5312_attach.c projects/ath_hal/ar5416/ar2133.c projects/ath_hal/ar5416/ar5416_ani.c projects/ath_hal/ar5416/ar5416_attach.c projects/ath_hal/ar5416/ar5416_beacon.c projects/ath_hal/ar5416/ar5416_cal.c projects/ath_hal/ar5416/ar5416_cal_adcdc.c projects/ath_hal/ar5416/ar5416_cal_adcgain.c projects/ath_hal/ar5416/ar5416_cal_iq.c projects/ath_hal/ar5416/ar5416_eeprom.c projects/ath_hal/ar5416/ar5416_gpio.c projects/ath_hal/ar5416/ar5416_interrupts.c projects/ath_hal/ar5416/ar5416_keycache.c projects/ath_hal/ar5416/ar5416_misc.c projects/ath_hal/ar5416/ar5416_phy.c projects/ath_hal/ar5416/ar5416_power.c projects/ath_hal/ar5416/ar5416_recv.c projects/ath_hal/ar5416/ar5416_reset.c projects/ath_hal/ar5416/ar5416_xmit.c projects/ath_hal/ar5416/ar9160_attach.c Modified: projects/ath_hal/ah.c ============================================================================== --- projects/ath_hal/ah.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ah.c Fri Nov 28 19:58:09 2008 (r185406) @@ -22,41 +22,10 @@ #include "ah_internal.h" #include "ah_devid.h" -#ifdef AH_SUPPORT_AR5210 -extern struct ath_hal *ar5210Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -#endif -#ifdef AH_SUPPORT_AR5211 -extern struct ath_hal *ar5211Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -#endif -#ifdef AH_SUPPORT_AR5212 -extern struct ath_hal *ar5212Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -#endif -#ifdef AH_SUPPORT_AR5312 -extern struct ath_hal *ar5312Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -#endif -#ifdef AH_SUPPORT_AR5416 -extern struct ath_hal *ar5416Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -#endif -#ifdef AH_SUPPORT_AR9160 -extern struct ath_hal *ar9160Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -#endif -#ifdef AH_SUPPORT_AR9280 -extern struct ath_hal *ar9280Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -#endif -#ifdef AH_SUPPORT_AR9285 -extern struct ath_hal *ar9285Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -#endif #include "version.h" char ath_hal_version[] = ATH_HAL_VERSION; +/* XXX chip+rf support no longer correct */ const char* ath_hal_buildopts[] = { #ifdef AH_SUPPORT_AR5210 "AR5210", @@ -148,66 +117,24 @@ const char* ath_hal_buildopts[] = { AH_NULL }; -static const char* -ath_hal_devname(uint16_t devid) -{ - switch (devid) { - case AR5210_PROD: - case AR5210_DEFAULT: - return "Atheros 5210"; - - case AR5211_DEVID: - case AR5311_DEVID: - case AR5211_DEFAULT: - return "Atheros 5211"; - case AR5211_FPGA11B: - return "Atheros 5211 (FPGA)"; - - case AR5212_FPGA: - return "Atheros 5212 (FPGA)"; - case AR5212_AR5312_REV2: - case AR5212_AR5312_REV7: - return "Atheros 5312 WiSoC"; - case AR5212_AR2315_REV6: - case AR5212_AR2315_REV7: - return "Atheros 2315 WiSoC"; - case AR5212_AR2317_REV1: - return "Atheros 2317 WiSoC"; - case AR5212_AR2313_REV8: - return "Atheros 2313 WiSoC"; - case AR5212_DEVID: - case AR5212_DEVID_IBM: - case AR5212_DEFAULT: - return "Atheros 5212"; - case AR5212_AR2413: - return "Atheros 2413"; - case AR5212_AR2417: - return "Atheros 2417"; - case AR5212_AR5413: - return "Atheros 5413"; - case AR5212_AR5424: - return "Atheros 5424/2424"; - case AR5416_DEVID_PCI: - case AR5416_DEVID_PCIE: - return "Atheros 5416"; - case AR9160_DEVID_PCI: - return "Atheros 9160"; - case AR9280_DEVID_PCI: - case AR9280_DEVID_PCIE: - return "Atheros 9280"; - case AR9285_DEVID_PCIE: - return "Atheros 9285"; - } - return AH_NULL; -} +/* linker set of registered chips */ +OS_SET_DECLARE(ah_chips, struct ath_hal_chip); +/* + * Check the set of registered chips to see if any recognize + * the device as one they can support. + */ const char* ath_hal_probe(uint16_t vendorid, uint16_t devid) { - return (vendorid == ATHEROS_VENDOR_ID || - vendorid == ATHEROS_3COM_VENDOR_ID || - vendorid == ATHEROS_3COM2_VENDOR_ID ? - ath_hal_devname(devid) : 0); + struct ath_hal_chip **pchip; + + SET_FOREACH(pchip, ah_chips) { + const char *name = (*pchip)->probe(vendorid, devid); + if (name != AH_NULL) + return name; + } + return AH_NULL; } /* @@ -221,87 +148,50 @@ struct ath_hal* ath_hal_attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *error) { - struct ath_hal *ah=AH_NULL; + struct ath_hal_chip **pchip; - switch (devid) { -#ifdef AH_SUPPORT_AR5210 - case AR5210_AP: - case AR5210_PROD: - case AR5210_DEFAULT: - ah = ar5210Attach(devid, sc, st, sh, error); - break; -#endif -#ifdef AH_SUPPORT_AR5211 - case AR5211_DEVID: - case AR5311_DEVID: - case AR5211_FPGA11B: - case AR5211_DEFAULT: - ah = ar5211Attach(devid, sc, st, sh, error); - break; -#endif -#ifdef AH_SUPPORT_AR5212 - case AR5212_DEVID_IBM: - case AR5212_AR2413: - case AR5212_AR2417: - case AR5212_AR5413: - case AR5212_AR5424: - case AR5212_DEVID_FF19: /* XXX PCI Express extra */ - devid = AR5212_DEVID; - /* fall thru... */ - case AR5212_DEVID: - case AR5212_FPGA: - case AR5212_DEFAULT: - ah = ar5212Attach(devid, sc, st, sh, error); - break; -#endif -#ifdef AH_SUPPORT_AR5312 - case AR5212_AR5312_REV2: - case AR5212_AR5312_REV7: - case AR5212_AR2313_REV8: - case AR5212_AR2315_REV6: - case AR5212_AR2315_REV7: - case AR5212_AR2317_REV1: - ah = ar5312Attach(devid, sc, st, sh, error); - break; -#endif -#ifdef AH_SUPPORT_AR5416 - case AR5416_DEVID_PCI: - case AR5416_DEVID_PCIE: - ah = ar5416Attach(devid, sc, st, sh, error); - break; -#endif -#ifdef AH_SUPPORT_AR9160 - case AR9160_DEVID_PCI: - ah = ar9160Attach(devid, sc, st, sh, error); - break; -#endif -#ifdef AH_SUPPORT_AR9280 - case AR9280_DEVID_PCI: - case AR9280_DEVID_PCIE: - ah = ar9280Attach(devid, sc, st, sh, error); - break; -#endif -#ifdef AH_SUPPORT_AR9285 - case AR9285_DEVID_PCIE: - ah = ar9285Attach(devid, sc, st, sh, error); - break; -#endif - default: - ah = AH_NULL; - *error = HAL_ENXIO; - break; + SET_FOREACH(pchip, ah_chips) { + struct ath_hal_chip *chip = *pchip; + struct ath_hal *ah; + + /* XXX don't have vendorid, assume atheros one works */ + if (chip->probe(ATHEROS_VENDOR_ID, devid) == AH_NULL) + continue; + ah = chip->attach(devid, sc, st, sh, error); + if (ah != AH_NULL) { + /* copy back private state to public area */ + ah->ah_devid = AH_PRIVATE(ah)->ah_devid; + ah->ah_subvendorid = AH_PRIVATE(ah)->ah_subvendorid; + ah->ah_macVersion = AH_PRIVATE(ah)->ah_macVersion; + ah->ah_macRev = AH_PRIVATE(ah)->ah_macRev; + ah->ah_phyRev = AH_PRIVATE(ah)->ah_phyRev; + ah->ah_analog5GhzRev = AH_PRIVATE(ah)->ah_analog5GhzRev; + ah->ah_analog2GhzRev = AH_PRIVATE(ah)->ah_analog2GhzRev; + return ah; + } } - if (ah != AH_NULL) { - /* copy back private state to public area */ - ah->ah_devid = AH_PRIVATE(ah)->ah_devid; - ah->ah_subvendorid = AH_PRIVATE(ah)->ah_subvendorid; - ah->ah_macVersion = AH_PRIVATE(ah)->ah_macVersion; - ah->ah_macRev = AH_PRIVATE(ah)->ah_macRev; - ah->ah_phyRev = AH_PRIVATE(ah)->ah_phyRev; - ah->ah_analog5GhzRev = AH_PRIVATE(ah)->ah_analog5GhzRev; - ah->ah_analog2GhzRev = AH_PRIVATE(ah)->ah_analog2GhzRev; + return AH_NULL; +} + +/* linker set of registered RF backends */ +OS_SET_DECLARE(ah_rfs, struct ath_hal_rf); + +/* + * Check the set of registered RF backends to see if + * any recognize the device as one they can support. + */ +struct ath_hal_rf * +ath_hal_rfprobe(struct ath_hal *ah, HAL_STATUS *ecode) +{ + struct ath_hal_rf **prf; + + SET_FOREACH(prf, ah_rfs) { + struct ath_hal_rf *rf = *prf; + if (rf->probe(ah)) + return rf; } - return ah; + *ecode = HAL_ENOTSUPP; + return AH_NULL; } /* Modified: projects/ath_hal/ah_internal.h ============================================================================== --- projects/ath_hal/ah_internal.h Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ah_internal.h Fri Nov 28 19:58:09 2008 (r185406) @@ -83,6 +83,42 @@ typedef enum { HAL_CAP_AR = 1, /* AR capability */ } HAL_PHYDIAG_CAPS; +/* + * Each chip or class of chips registers to offer support. + */ +struct ath_hal_chip { + const char *(*probe)(uint16_t vendorid, uint16_t devid); + struct ath_hal *(*attach)(uint16_t devid, HAL_SOFTC, + HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS *error); +}; +#ifndef AH_CHIP +#define AH_CHIP(name, _probe, _attach) \ +static struct ath_hal_chip name##_chip = { \ + .probe = _probe, \ + .attach = _attach \ +}; \ +OS_DATA_SET(ah_chips, name##_chip) +#endif + +/* + * Each RF backend registers to offer support; this is mostly + * used by multi-chip 5212 solutions. Single-chip solutions + * have a fixed idea about which RF to use. + */ +struct ath_hal_rf { + HAL_BOOL (*probe)(struct ath_hal *ah); + HAL_BOOL (*attach)(struct ath_hal *ah, HAL_STATUS *ecode); +}; +#ifndef AH_RF +#define AH_RF(name, _probe, _attach) \ +static struct ath_hal_rf name##_rf = { \ + .probe = _probe, \ + .attach = _attach \ +}; \ +OS_DATA_SET(ah_rfs, name##_rf) +#endif + +struct ath_hal_rf *ath_hal_rfprobe(struct ath_hal *ah, HAL_STATUS *ecode); /* * Internal form of a HAL_CHANNEL. Note that the structure Modified: projects/ath_hal/ar5210/ar5210.h ============================================================================== --- projects/ath_hal/ar5210/ar5210.h Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210.h Fri Nov 28 19:58:09 2008 (r185406) @@ -126,10 +126,7 @@ struct ath_hal_5210 { struct ath_hal; -extern struct ath_hal *ar5210Attach(uint16_t, HAL_SOFTC, - HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS *); -extern void ar5210Detach(struct ath_hal *); - +extern void ar5210Detach(struct ath_hal *ah); extern HAL_BOOL ar5210Reset(struct ath_hal *, HAL_OPMODE, HAL_CHANNEL *, HAL_BOOL bChannelChange, HAL_STATUS *); extern void ar5210SetPCUConfig(struct ath_hal *); Modified: projects/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_attach.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_attach.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,10 +18,9 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" +#include "ah_devid.h" #include "ar5210/ar5210.h" #include "ar5210/ar5210reg.h" @@ -170,8 +169,9 @@ static HAL_BOOL ar5210FillCapabilityInfo /* * Attach for an AR5210 part. */ -struct ath_hal * -ar5210Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) +static struct ath_hal * +ar5210Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, + HAL_STATUS *status) { #define N(a) (sizeof(a)/sizeof(a[0])) struct ath_hal_5210 *ahp; @@ -371,4 +371,13 @@ ar5210FillCapabilityInfo(struct ath_hal ahpriv->ah_rxornIsFatal = AH_TRUE; return AH_TRUE; } -#endif /* AH_SUPPORT_AR5210 */ + +static const char* +ar5210Probe(uint16_t vendorid, uint16_t devid) +{ + if (vendorid == ATHEROS_VENDOR_ID && + (devid == AR5210_PROD || devid == AR5210_DEFAULT)) + return "Atheros 5210"; + return AH_NULL; +} +AH_CHIP(ar5210, ar5210Probe, ar5210Attach); Modified: projects/ath_hal/ar5210/ar5210_beacon.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_beacon.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_beacon.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" #include "ah_desc.h" @@ -191,4 +189,3 @@ ar5210SetStaBeaconTimers(struct ath_hal OS_REG_WRITE(ah, AR_RSSI_THR, ahp->ah_rssiThr); #undef BMISS_MAX } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5210/ar5210_interrupts.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_interrupts.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_interrupts.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" @@ -134,4 +132,3 @@ ar5210SetInterrupts(struct ath_hal *ah, return omask; } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5210/ar5210_keycache.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_keycache.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_keycache.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" @@ -156,4 +154,3 @@ ar5210SetKeyCacheEntry(struct ath_hal *a OS_REG_WRITE(ah, AR_KEYTABLE_TYPE(entry), keyType); return ar5210SetKeyCacheEntryMac(ah, entry, mac); } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5210/ar5210_misc.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_misc.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_misc.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" @@ -642,4 +640,3 @@ ar5210GetDiagState(struct ath_hal *ah, i return ath_hal_getdiagstate(ah, request, args, argsize, result, resultsize); } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5210/ar5210_phy.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_phy.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_phy.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" @@ -85,4 +83,3 @@ ar5210GetRateTable(struct ath_hal *ah, u ath_hal_setupratetable(ah, rt); return rt; } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5210/ar5210_power.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_power.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_power.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" @@ -134,4 +132,3 @@ ar5210GetPowerMode(struct ath_hal *ah) /* Just so happens the h/w maps directly to the abstracted value */ return MS(OS_REG_READ(ah, AR_SCR), AR_SCR_SLE); } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5210/ar5210_recv.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_recv.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_recv.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" #include "ah_desc.h" @@ -266,4 +264,3 @@ ar5210ProcRxDesc(struct ath_hal *ah, str return HAL_OK; } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5210/ar5210_reset.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_reset.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_reset.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" @@ -1003,4 +1001,3 @@ ar5210GetRfgain(struct ath_hal *ah) { return HAL_RFGAIN_INACTIVE; } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5210/ar5210_xmit.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_xmit.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5210/ar5210_xmit.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5210 - #include "ah.h" #include "ah_internal.h" #include "ah_desc.h" @@ -623,4 +621,3 @@ ar5210GetTxIntrQueue(struct ath_hal *ah, { return; } -#endif /* AH_SUPPORT_AR5210 */ Modified: projects/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_attach.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_attach.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" #include "ah_devid.h" @@ -502,4 +500,17 @@ ar5211FillCapabilityInfo(struct ath_hal ahpriv->ah_rxornIsFatal = AH_TRUE; return AH_TRUE; } -#endif /* AH_SUPPORT_AR5211 */ + +static const char* +ar5211Probe(uint16_t vendorid, uint16_t devid) +{ + if (vendorid == ATHEROS_VENDOR_ID) { + if (devid == AR5211_DEVID || devid == AR5311_DEVID || + devid == AR5211_DEFAULT) + return "Atheros 5211"; + if (devid == AR5211_FPGA11B) + return "Atheros 5211 (FPGA)"; + } + return AH_NULL; +} +AH_CHIP(ar5211, ar5211Probe, ar5211Attach); Modified: projects/ath_hal/ar5211/ar5211_beacon.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_beacon.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_beacon.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" @@ -173,4 +171,3 @@ ar5211SetStaBeaconTimers(struct ath_hal (bs->bs_sleepduration - SLEEP_SLOP) << 3); #undef SLEEP_SLOP } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5211/ar5211_interrupts.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_interrupts.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_interrupts.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" @@ -160,4 +158,3 @@ ar5211SetInterrupts(struct ath_hal *ah, return omask; } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5211/ar5211_keycache.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_keycache.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_keycache.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" @@ -178,4 +176,3 @@ ar5211SetKeyCacheEntry(struct ath_hal *a OS_REG_WRITE(ah, AR_KEYTABLE_TYPE(entry), keyType); return ar5211SetKeyCacheEntryMac(ah, entry, mac); } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5211/ar5211_misc.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_misc.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_misc.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" @@ -685,4 +683,3 @@ ar5211GetDiagState(struct ath_hal *ah, i } return AH_FALSE; } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5211/ar5211_phy.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_phy.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_phy.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" @@ -104,4 +102,3 @@ ar5211GetRateTable(struct ath_hal *ah, u ath_hal_setupratetable(ah, rt); return rt; } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5211/ar5211_power.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_power.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_power.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" @@ -136,4 +134,3 @@ ar5211GetPowerMode(struct ath_hal *ah) /* Just so happens the h/w maps directly to the abstracted value */ return MS(OS_REG_READ(ah, AR_SCR), AR_SCR_SLE); } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5211/ar5211_recv.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_recv.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_recv.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" #include "ah_desc.h" @@ -245,4 +243,3 @@ ar5211ProcRxDesc(struct ath_hal *ah, str return HAL_OK; } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_reset.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_reset.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,7 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 /* * Chips specific device attachment and device info collection * Connects Init Reg Vectors, EEPROM Data, and device Functions. @@ -2137,4 +2136,3 @@ ar5211SetPCUConfig(struct ath_hal *ah) { ar5211SetOperatingMode(ah, AH_PRIVATE(ah)->ah_opmode); } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5211/ar5211_xmit.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_xmit.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5211/ar5211_xmit.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5211 - #include "ah.h" #include "ah_internal.h" #include "ah_desc.h" @@ -679,4 +677,3 @@ ar5211GetTxIntrQueue(struct ath_hal *ah, { return; } -#endif /* AH_SUPPORT_AR5211 */ Modified: projects/ath_hal/ar5212/ar2316.c ============================================================================== --- projects/ath_hal/ar5212/ar2316.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar2316.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_2316 - #include "ah.h" #include "ah_internal.h" @@ -727,7 +725,7 @@ ar2316RfDetach(struct ath_hal *ah) * Allocate memory for private state. * Scratch Buffer will be reinitialized every reset so no need to zero now */ -HAL_BOOL +static HAL_BOOL ar2316RfAttach(struct ath_hal *ah, HAL_STATUS *status) { struct ath_hal_5212 *ahp = AH5212(ah); @@ -760,4 +758,10 @@ ar2316RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } -#endif /* AH_SUPPORT_2316 */ + +static HAL_BOOL +ar2316Probe(struct ath_hal *ah) +{ + return IS_2316(ah); +} +AH_RF(ar2316, ar2316Probe, ar2316RfAttach); Modified: projects/ath_hal/ar5212/ar2317.c ============================================================================== --- projects/ath_hal/ar5212/ar2317.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar2317.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_2317 - #include "ah.h" #include "ah_internal.h" @@ -706,7 +704,7 @@ ar2317RfDetach(struct ath_hal *ah) * Allocate memory for analog bank scratch buffers * Scratch Buffer will be reinitialized every reset so no need to zero now */ -HAL_BOOL +static HAL_BOOL ar2317RfAttach(struct ath_hal *ah, HAL_STATUS *status) { struct ath_hal_5212 *ahp = AH5212(ah); @@ -737,4 +735,10 @@ ar2317RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } -#endif /* AH_SUPPORT_2317 */ + +static HAL_BOOL +ar2317Probe(struct ath_hal *ah) +{ + return IS_2317(ah); +} +AH_RF(ar2317, ar2317Probe, ar2317RfAttach); Modified: projects/ath_hal/ar5212/ar2413.c ============================================================================== --- projects/ath_hal/ar5212/ar2413.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar2413.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_2413 - #include "ah.h" #include "ah_internal.h" @@ -721,7 +719,7 @@ ar2413RfDetach(struct ath_hal *ah) * Allocate memory for analog bank scratch buffers * Scratch Buffer will be reinitialized every reset so no need to zero now */ -HAL_BOOL +static HAL_BOOL ar2413RfAttach(struct ath_hal *ah, HAL_STATUS *status) { struct ath_hal_5212 *ahp = AH5212(ah); @@ -752,4 +750,10 @@ ar2413RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } -#endif /* AH_SUPPORT_2413 */ + +static HAL_BOOL +ar2413Probe(struct ath_hal *ah) +{ + return IS_2413(ah); +} +AH_RF(ar2413, ar2413Probe, ar2413RfAttach); Modified: projects/ath_hal/ar5212/ar2425.c ============================================================================== --- projects/ath_hal/ar5212/ar2425.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar2425.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_2425 - #include "ah.h" #include "ah_internal.h" @@ -30,9 +28,7 @@ #include "ah_eeprom_v3.h" #define AH_5212_2425 -#ifdef AH_SUPPORT_2417 #define AH_5212_2417 -#endif #include "ar5212/ar5212.ini" #define N(a) (sizeof(a)/sizeof(a[0])) @@ -211,13 +207,11 @@ ar2425SetRfRegs(struct ath_hal *ah, HAL_ HAL_INI_WRITE_BANK(ah, ar5212Bank1_2425, priv->Bank1Data, regWrites); HAL_INI_WRITE_BANK(ah, ar5212Bank2_2425, priv->Bank2Data, regWrites); HAL_INI_WRITE_BANK(ah, ar5212Bank3_2425, priv->Bank3Data, regWrites); -#ifdef AH_SUPPORT_2417 if (IS_2417(ah)) { HALASSERT(N(ar5212Bank6_2425) == N(ar5212Bank6_2417)); HAL_INI_WRITE_BANK(ah, ar5212Bank6_2417, priv->Bank6Data, regWrites); } else -#endif /* AH_SUPPORT_2417 */ HAL_INI_WRITE_BANK(ah, ar5212Bank6_2425, priv->Bank6Data, regWrites); HAL_INI_WRITE_BANK(ah, ar5212Bank7_2425, priv->Bank7Data, regWrites); @@ -688,7 +682,7 @@ ar2425RfDetach(struct ath_hal *ah) * Allocate memory for analog bank scratch buffers * Scratch Buffer will be reinitialized every reset so no need to zero now */ -HAL_BOOL +static HAL_BOOL ar2425RfAttach(struct ath_hal *ah, HAL_STATUS *status) { struct ath_hal_5212 *ahp = AH5212(ah); @@ -719,4 +713,10 @@ ar2425RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } -#endif /* AH_SUPPORT_2425 */ + +static HAL_BOOL +ar2425Probe(struct ath_hal *ah) +{ + return IS_2425(ah) || IS_2417(ah); +} +AH_RF(ar2425, ar2425Probe, ar2425RfAttach); Modified: projects/ath_hal/ar5212/ar5111.c ============================================================================== --- projects/ath_hal/ar5212/ar5111.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar5111.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_5111 - #include "ah.h" #include "ah_internal.h" @@ -673,7 +671,7 @@ ar5111RfDetach(struct ath_hal *ah) * Allocate memory for analog bank scratch buffers * Scratch Buffer will be reinitialized every reset so no need to zero now */ -HAL_BOOL +static HAL_BOOL ar5111RfAttach(struct ath_hal *ah, HAL_STATUS *status) { struct ath_hal_5212 *ahp = AH5212(ah); @@ -704,4 +702,10 @@ ar5111RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } -#endif /* AH_SUPPORT_5111 */ + +static HAL_BOOL +ar5111Probe(struct ath_hal *ah) +{ + return IS_RAD5111(ah); +} +AH_RF(ar5111, ar5111Probe, ar5111RfAttach); Modified: projects/ath_hal/ar5212/ar5112.c ============================================================================== --- projects/ath_hal/ar5212/ar5112.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar5112.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_5112 - #include "ah.h" #include "ah_internal.h" @@ -843,7 +841,7 @@ ar5112RfDetach(struct ath_hal *ah) * Allocate memory for analog bank scratch buffers * Scratch Buffer will be reinitialized every reset so no need to zero now */ -HAL_BOOL +static HAL_BOOL ar5112RfAttach(struct ath_hal *ah, HAL_STATUS *status) { struct ath_hal_5212 *ahp = AH5212(ah); @@ -874,4 +872,10 @@ ar5112RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } -#endif /* AH_SUPPORT_5112 */ + +static HAL_BOOL +ar5112Probe(struct ath_hal *ah) +{ + return IS_RAD5112(ah); +} +AH_RF(ar5112, ar5112Probe, ar5112RfAttach); Modified: projects/ath_hal/ar5212/ar5212.h ============================================================================== --- projects/ath_hal/ar5212/ar5212.h Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar5212.h Fri Nov 28 19:58:09 2008 (r185406) @@ -408,21 +408,11 @@ struct ath_hal_5212 { } \ } while (0) -extern HAL_BOOL ar5111RfAttach(struct ath_hal *, HAL_STATUS *); -extern HAL_BOOL ar5112RfAttach(struct ath_hal *, HAL_STATUS *); -extern HAL_BOOL ar2413RfAttach(struct ath_hal *, HAL_STATUS *); -extern HAL_BOOL ar5413RfAttach(struct ath_hal *, HAL_STATUS *); -extern HAL_BOOL ar2316RfAttach(struct ath_hal *, HAL_STATUS *); -extern HAL_BOOL ar2317RfAttach(struct ath_hal *, HAL_STATUS *); -extern HAL_BOOL ar2425RfAttach(struct ath_hal *, HAL_STATUS *); - struct ath_hal; extern uint32_t ar5212GetRadioRev(struct ath_hal *ah); extern void ar5212InitState(struct ath_hal_5212 *, uint16_t devid, HAL_SOFTC, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); -extern struct ath_hal * ar5212Attach(uint16_t devid, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status); extern void ar5212Detach(struct ath_hal *ah); extern HAL_BOOL ar5212ChipTest(struct ath_hal *ah); extern HAL_BOOL ar5212GetChannelEdges(struct ath_hal *ah, Modified: projects/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- projects/ath_hal/ar5212/ar5212_ani.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar5212_ani.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,8 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5212 - #include "ah.h" #include "ah_internal.h" #include "ah_desc.h" @@ -1016,4 +1014,3 @@ ar5212AniPoll(struct ath_hal *ah, const } } } -#endif /* AH_SUPPORT_AR5212 */ Modified: projects/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- projects/ath_hal/ar5212/ar5212_attach.c Fri Nov 28 19:35:48 2008 (r185405) +++ projects/ath_hal/ar5212/ar5212_attach.c Fri Nov 28 19:58:09 2008 (r185406) @@ -18,16 +18,6 @@ */ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR5212 - -#if !defined(AH_SUPPORT_5112) && \ - !defined(AH_SUPPORT_5111) && \ - !defined(AH_SUPPORT_2413) && \ - !defined(AH_SUPPORT_5413) && \ - !defined(AH_SUPPORT_AR5312) -#error "No 5212 RF support defined" -#endif - #include "ah.h" #include "ah_internal.h" #include "ah_devid.h" @@ -35,9 +25,6 @@ #include "ar5212/ar5212.h" #include "ar5212/ar5212reg.h" #include "ar5212/ar5212phy.h" -#ifdef AH_SUPPORT_AR5311 -#include "ar5212/ar5311reg.h" -#endif #define AH_5212_COMMON #include "ar5212/ar5212.ini" @@ -334,7 +321,7 @@ ar5212IsMacSupported(uint8_t macVersion, /* * Attach for an AR5212 part. */ -struct ath_hal * +static struct ath_hal * ar5212Attach(uint16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) { @@ -342,10 +329,10 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s (IS_PCIE(ah) ? AR_EEPROM_PROTECT_PCIE : AR_EEPROM_PROTECT) struct ath_hal_5212 *ahp; struct ath_hal *ah; + struct ath_hal_rf *rf; uint32_t val; uint16_t eeval; HAL_STATUS ecode; - HAL_BOOL rfStatus; HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); @@ -417,6 +404,11 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s /* Read Radio Chip Rev Extract */ AH_PRIVATE(ah)->ah_analog5GhzRev = ar5212GetRadioRev(ah); + + rf = ath_hal_rfprobe(ah, &ecode); + if (rf == AH_NULL) + goto bad; + /* NB: silently accept anything in release code per Atheros */ switch (AH_PRIVATE(ah)->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR) { case AR_RAD5111_SREV_MAJOR: @@ -554,39 +546,7 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s goto bad; } - rfStatus = AH_FALSE; - if (IS_5413(ah)) { -#ifdef AH_SUPPORT_5413 - rfStatus = ar5413RfAttach(ah, &ecode); -#else - ecode = HAL_ENOTSUPP; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 19:58:31 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A53BB1065675; Fri, 28 Nov 2008 19:58:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78A678FC12; Fri, 28 Nov 2008 19:58:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mASJwVjQ028285; Fri, 28 Nov 2008 19:58:31 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mASJwVJW028284; Fri, 28 Nov 2008 19:58:31 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811281958.mASJwVJW028284@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 19:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185407 - projects/ath_hal X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 19:58:31 -0000 Author: sam Date: Fri Nov 28 19:58:31 2008 New Revision: 185407 URL: http://svn.freebsd.org/changeset/base/185407 Log: bump for linke set changes Modified: projects/ath_hal/version.h Modified: projects/ath_hal/version.h ============================================================================== --- projects/ath_hal/version.h Fri Nov 28 19:58:09 2008 (r185406) +++ projects/ath_hal/version.h Fri Nov 28 19:58:31 2008 (r185407) @@ -16,4 +16,4 @@ * * $Id: version.h,v 1.64 2008/11/27 22:29:27 sam Exp $ */ -#define ATH_HAL_VERSION "0.11.3.7" +#define ATH_HAL_VERSION "0.11.3.8" From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 20:26:34 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BC661065672; Fri, 28 Nov 2008 20:26:34 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 374F48FC19; Fri, 28 Nov 2008 20:26:34 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mASKQYrI029156; Fri, 28 Nov 2008 20:26:34 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mASKQXSD029152; Fri, 28 Nov 2008 20:26:33 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811282026.mASKQXSD029152@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 20:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185412 - in projects/ath_hal: . ar5211 ar5212 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 20:26:34 -0000 Author: sam Date: Fri Nov 28 20:26:33 2008 New Revision: 185412 URL: http://svn.freebsd.org/changeset/base/185412 Log: kill AH_DISABLE_WME stuff; it's been posible to do this from the driver for a while Modified: projects/ath_hal/ah.c projects/ath_hal/ar5211/ar5211_xmit.c projects/ath_hal/ar5212/ar5212_xmit.c projects/ath_hal/version.h Modified: projects/ath_hal/ah.c ============================================================================== --- projects/ath_hal/ah.c Fri Nov 28 20:14:41 2008 (r185411) +++ projects/ath_hal/ah.c Fri Nov 28 20:26:33 2008 (r185412) @@ -108,9 +108,6 @@ const char* ath_hal_buildopts[] = { #ifdef AH_USE_INIPDGAIN "INIPDGAIN", #endif -#ifdef AH_DISABLE_WME - "DISABLE_WME", -#endif #ifdef AH_SUPPORT_11D "11D", #endif Modified: projects/ath_hal/ar5211/ar5211_xmit.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_xmit.c Fri Nov 28 20:14:41 2008 (r185411) +++ projects/ath_hal/ar5211/ar5211_xmit.c Fri Nov 28 20:26:33 2008 (r185412) @@ -360,23 +360,6 @@ ar5211ResetTxQueue(struct ath_hal *ah, u break; } -#ifndef AH_DISABLE_WME - /* - * Yes, this is a hack and not the right way to do it, but - * it does get the lockout bits and backoff set for the - * high-pri WME queues for testing. We need to either extend - * the meaning of queueInfo->mode, or create something like - * queueInfo->dcumode. - */ - if (qi->tqi_intFlags & HAL_TXQ_USE_LOCKOUT_BKOFF_DIS) { - OS_REG_WRITE(ah, AR_DMISC(q), - OS_REG_READ(ah, AR_DMISC(q)) | - SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, - AR_D_MISC_ARB_LOCKOUT_CNTRL)| - AR_D_MISC_POST_FR_BKOFF_DIS); - } -#endif - /* * Always update the secondary interrupt mask registers - this * could be a new queue getting enabled in a running system or Modified: projects/ath_hal/ar5212/ar5212_xmit.c ============================================================================== --- projects/ath_hal/ar5212/ar5212_xmit.c Fri Nov 28 20:14:41 2008 (r185411) +++ projects/ath_hal/ar5212/ar5212_xmit.c Fri Nov 28 20:26:33 2008 (r185412) @@ -423,20 +423,6 @@ ar5212ResetTxQueue(struct ath_hal *ah, u break; } -#ifndef AH_DISABLE_WME - /* - * Yes, this is a hack and not the right way to do it, but - * it does get the lockout bits and backoff set for the - * high-pri WME queues for testing. We need to either extend - * the meaning of queueInfo->mode, or create something like - * queueInfo->dcumode. - */ - if (qi->tqi_intFlags & HAL_TXQ_USE_LOCKOUT_BKOFF_DIS) { - dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, - AR_D_MISC_ARB_LOCKOUT_CNTRL) - | AR_D_MISC_POST_FR_BKOFF_DIS; - } -#endif OS_REG_WRITE(ah, AR_QMISC(q), qmisc); OS_REG_WRITE(ah, AR_DMISC(q), dmisc); Modified: projects/ath_hal/version.h ============================================================================== --- projects/ath_hal/version.h Fri Nov 28 20:14:41 2008 (r185411) +++ projects/ath_hal/version.h Fri Nov 28 20:26:33 2008 (r185412) @@ -16,4 +16,4 @@ * * $Id: version.h,v 1.64 2008/11/27 22:29:27 sam Exp $ */ -#define ATH_HAL_VERSION "0.11.3.8" +#define ATH_HAL_VERSION "0.11.3.9" From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 22:25:31 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC40F1065672; Fri, 28 Nov 2008 22:25:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C78538FC18; Fri, 28 Nov 2008 22:25:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mASMPViQ031545; Fri, 28 Nov 2008 22:25:31 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mASMPV66031543; Fri, 28 Nov 2008 22:25:31 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811282225.mASMPV66031543@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 22:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185416 - projects/ath_hal X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 22:25:31 -0000 Author: sam Date: Fri Nov 28 22:25:31 2008 New Revision: 185416 URL: http://svn.freebsd.org/changeset/base/185416 Log: remove ath_hal_buildopts and ath_hal_version; they are not needed any more Modified: projects/ath_hal/ah.c projects/ath_hal/ah.h Modified: projects/ath_hal/ah.c ============================================================================== --- projects/ath_hal/ah.c Fri Nov 28 22:10:15 2008 (r185415) +++ projects/ath_hal/ah.c Fri Nov 28 22:25:31 2008 (r185416) @@ -22,98 +22,6 @@ #include "ah_internal.h" #include "ah_devid.h" - -#include "version.h" -char ath_hal_version[] = ATH_HAL_VERSION; -/* XXX chip+rf support no longer correct */ -const char* ath_hal_buildopts[] = { -#ifdef AH_SUPPORT_AR5210 - "AR5210", -#endif -#ifdef AH_SUPPORT_AR5211 - "AR5211", -#endif -#ifdef AH_SUPPORT_AR5212 - "AR5212", -#endif -#ifdef AH_SUPPORT_AR5312 - "AR5312", -#endif -#ifdef AH_SUPPORT_AR5416 - "AR5416", -#endif -#ifdef AH_SUPPORT_AR9180 - "AR9180", -#endif -#ifdef AH_SUPPORT_AR9280 - "AR9280", -#endif -#ifdef AH_SUPPORT_AR9285 - "AR9285", -#endif -#ifdef AH_SUPPORT_5111 - "RF5111", -#endif -#ifdef AH_SUPPORT_5112 - "RF5112", -#endif -#ifdef AH_SUPPORT_2413 - "RF2413", -#endif -#ifdef AH_SUPPORT_5413 - "RF5413", -#endif -#ifdef AH_SUPPORT_2316 - "RF2316", -#endif -#ifdef AH_SUPPORT_2317 - "RF2317", -#endif -#ifdef AH_SUPPORT_2133 - "RF2133", -#endif -#ifdef AH_SUPPORT_2425 - "RF2425", -#endif -#ifdef AH_SUPPORT_2417 - "RF2417", -#endif -#ifdef AH_DEBUG - "DEBUG", -#endif -#ifdef AH_ASSERT - "ASSERT", -#endif -#ifdef AH_DEBUG_ALQ - "DEBUG_ALQ", -#endif -#ifdef AH_REGOPS_FUNC - "REGOPS_FUNC", -#endif -#ifdef AH_PRIVATE_DIAG - "PRIVATE_DIAG", -#endif -#ifdef AH_SUPPORT_WRITE_EEPROM - "WRITE_EEPROM", -#endif -#ifdef AH_SUPPORT_WRITE_REGDOMAIN - "WRITE_REGDOMAIN", -#endif -#ifdef AH_DEBUG_COUNTRY - "DEBUG_COUNTRY", -#endif -#ifdef AH_NEED_DESC_SWAP - "TX_DESC_SWAP", -#endif -#ifdef AH_USE_INIPDGAIN - "INIPDGAIN", -#endif -#ifdef AH_SUPPORT_11D - "11D", -#endif - AH_NULL -}; - /* linker set of registered chips */ OS_SET_DECLARE(ah_chips, struct ath_hal_chip); Modified: projects/ath_hal/ah.h ============================================================================== --- projects/ath_hal/ah.h Fri Nov 28 22:10:15 2008 (r185415) +++ projects/ath_hal/ah.h Fri Nov 28 22:25:31 2008 (r185416) @@ -656,7 +656,7 @@ struct ath_rx_status; struct ath_hal { uint32_t ah_magic; /* consistency check magic number */ uint32_t ah_abi; /* HAL ABI version */ -#define HAL_ABI_VERSION 0x08111400 /* YYMMDDnn */ +#define HAL_ABI_VERSION 0x08112800 /* YYMMDDnn */ uint16_t ah_devid; /* PCI device ID */ uint16_t ah_subvendorid; /* PCI subvendor ID */ HAL_SOFTC ah_sc; /* back pointer to driver/os state */ @@ -908,13 +908,4 @@ extern HAL_BOOL ath_hal_isgsmsku(struct * using the specified channel flags; e.g. CHANNEL_2GHZ. */ extern int __ahdecl ath_hal_mhz2ieee(struct ath_hal *, u_int mhz, u_int flags); - -/* - * Return a version string for the HAL release. - */ -extern char ath_hal_version[]; -/* - * Return a NULL-terminated array of build/configuration options. - */ -extern const char* ath_hal_buildopts[]; #endif /* _ATH_AH_H_ */ From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 22:26:37 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F4C01065672; Fri, 28 Nov 2008 22:26:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AF398FC0A; Fri, 28 Nov 2008 22:26:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mASMQbkf031601; Fri, 28 Nov 2008 22:26:37 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mASMQba1031600; Fri, 28 Nov 2008 22:26:37 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811282226.mASMQba1031600@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 22:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185417 - projects/ath_hal X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 22:26:37 -0000 Author: sam Date: Fri Nov 28 22:26:36 2008 New Revision: 185417 URL: http://svn.freebsd.org/changeset/base/185417 Log: use os shim for linker set walking Modified: projects/ath_hal/ah.c Modified: projects/ath_hal/ah.c ============================================================================== --- projects/ath_hal/ah.c Fri Nov 28 22:25:31 2008 (r185416) +++ projects/ath_hal/ah.c Fri Nov 28 22:26:36 2008 (r185417) @@ -34,7 +34,7 @@ ath_hal_probe(uint16_t vendorid, uint16_ { struct ath_hal_chip **pchip; - SET_FOREACH(pchip, ah_chips) { + OS_SET_FOREACH(pchip, ah_chips) { const char *name = (*pchip)->probe(vendorid, devid); if (name != AH_NULL) return name; @@ -55,7 +55,7 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC { struct ath_hal_chip **pchip; - SET_FOREACH(pchip, ah_chips) { + OS_SET_FOREACH(pchip, ah_chips) { struct ath_hal_chip *chip = *pchip; struct ath_hal *ah; @@ -90,7 +90,7 @@ ath_hal_rfprobe(struct ath_hal *ah, HAL_ { struct ath_hal_rf **prf; - SET_FOREACH(prf, ah_rfs) { + OS_SET_FOREACH(prf, ah_rfs) { struct ath_hal_rf *rf = *prf; if (rf->probe(ah)) return rf; From owner-svn-src-projects@FreeBSD.ORG Fri Nov 28 22:27:27 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB75C1065676; Fri, 28 Nov 2008 22:27:27 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A55008FC22; Fri, 28 Nov 2008 22:27:27 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mASMRRRO031668; Fri, 28 Nov 2008 22:27:27 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mASMRQU2031654; Fri, 28 Nov 2008 22:27:26 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200811282227.mASMRQU2031654@svn.freebsd.org> From: Sam Leffler Date: Fri, 28 Nov 2008 22:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185418 - in projects/ath_hal: . ar5210 ar5211 ar5212 ar5312 ar5416 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 22:27:27 -0000 Author: sam Date: Fri Nov 28 22:27:26 2008 New Revision: 185418 URL: http://svn.freebsd.org/changeset/base/185418 Log: add chip+rf names for debug msgs, showing compiled-in support, etc. Modified: projects/ath_hal/ah_internal.h projects/ath_hal/ar5210/ar5210_attach.c projects/ath_hal/ar5211/ar5211_attach.c projects/ath_hal/ar5212/ar2316.c projects/ath_hal/ar5212/ar2317.c projects/ath_hal/ar5212/ar2413.c projects/ath_hal/ar5212/ar2425.c projects/ath_hal/ar5212/ar5111.c projects/ath_hal/ar5212/ar5112.c projects/ath_hal/ar5212/ar5212_attach.c projects/ath_hal/ar5212/ar5413.c projects/ath_hal/ar5312/ar5312_attach.c projects/ath_hal/ar5416/ar5416_attach.c projects/ath_hal/ar5416/ar9160_attach.c Modified: projects/ath_hal/ah_internal.h ============================================================================== --- projects/ath_hal/ah_internal.h Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ah_internal.h Fri Nov 28 22:27:26 2008 (r185418) @@ -87,13 +87,15 @@ typedef enum { * Each chip or class of chips registers to offer support. */ struct ath_hal_chip { + const char *name; const char *(*probe)(uint16_t vendorid, uint16_t devid); struct ath_hal *(*attach)(uint16_t devid, HAL_SOFTC, HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS *error); }; #ifndef AH_CHIP -#define AH_CHIP(name, _probe, _attach) \ +#define AH_CHIP(_name, _probe, _attach) \ static struct ath_hal_chip name##_chip = { \ + .name = #_name, \ .probe = _probe, \ .attach = _attach \ }; \ @@ -106,12 +108,14 @@ OS_DATA_SET(ah_chips, name##_chip) * have a fixed idea about which RF to use. */ struct ath_hal_rf { + const char *name; HAL_BOOL (*probe)(struct ath_hal *ah); HAL_BOOL (*attach)(struct ath_hal *ah, HAL_STATUS *ecode); }; #ifndef AH_RF -#define AH_RF(name, _probe, _attach) \ +#define AH_RF(_name, _probe, _attach) \ static struct ath_hal_rf name##_rf = { \ + .name = #_name, \ .probe = _probe, \ .attach = _attach \ }; \ Modified: projects/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- projects/ath_hal/ar5210/ar5210_attach.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5210/ar5210_attach.c Fri Nov 28 22:27:26 2008 (r185418) @@ -380,4 +380,4 @@ ar5210Probe(uint16_t vendorid, uint16_t return "Atheros 5210"; return AH_NULL; } -AH_CHIP(ar5210, ar5210Probe, ar5210Attach); +AH_CHIP(AR5210, ar5210Probe, ar5210Attach); Modified: projects/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- projects/ath_hal/ar5211/ar5211_attach.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5211/ar5211_attach.c Fri Nov 28 22:27:26 2008 (r185418) @@ -513,4 +513,4 @@ ar5211Probe(uint16_t vendorid, uint16_t } return AH_NULL; } -AH_CHIP(ar5211, ar5211Probe, ar5211Attach); +AH_CHIP(AR5211, ar5211Probe, ar5211Attach); Modified: projects/ath_hal/ar5212/ar2316.c ============================================================================== --- projects/ath_hal/ar5212/ar2316.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5212/ar2316.c Fri Nov 28 22:27:26 2008 (r185418) @@ -764,4 +764,4 @@ ar2316Probe(struct ath_hal *ah) { return IS_2316(ah); } -AH_RF(ar2316, ar2316Probe, ar2316RfAttach); +AH_RF(RF2316, ar2316Probe, ar2316RfAttach); Modified: projects/ath_hal/ar5212/ar2317.c ============================================================================== --- projects/ath_hal/ar5212/ar2317.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5212/ar2317.c Fri Nov 28 22:27:26 2008 (r185418) @@ -741,4 +741,4 @@ ar2317Probe(struct ath_hal *ah) { return IS_2317(ah); } -AH_RF(ar2317, ar2317Probe, ar2317RfAttach); +AH_RF(RF2317, ar2317Probe, ar2317RfAttach); Modified: projects/ath_hal/ar5212/ar2413.c ============================================================================== --- projects/ath_hal/ar5212/ar2413.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5212/ar2413.c Fri Nov 28 22:27:26 2008 (r185418) @@ -756,4 +756,4 @@ ar2413Probe(struct ath_hal *ah) { return IS_2413(ah); } -AH_RF(ar2413, ar2413Probe, ar2413RfAttach); +AH_RF(RF2413, ar2413Probe, ar2413RfAttach); Modified: projects/ath_hal/ar5212/ar2425.c ============================================================================== --- projects/ath_hal/ar5212/ar2425.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5212/ar2425.c Fri Nov 28 22:27:26 2008 (r185418) @@ -719,4 +719,4 @@ ar2425Probe(struct ath_hal *ah) { return IS_2425(ah) || IS_2417(ah); } -AH_RF(ar2425, ar2425Probe, ar2425RfAttach); +AH_RF(RF2425, ar2425Probe, ar2425RfAttach); Modified: projects/ath_hal/ar5212/ar5111.c ============================================================================== --- projects/ath_hal/ar5212/ar5111.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5212/ar5111.c Fri Nov 28 22:27:26 2008 (r185418) @@ -708,4 +708,4 @@ ar5111Probe(struct ath_hal *ah) { return IS_RAD5111(ah); } -AH_RF(ar5111, ar5111Probe, ar5111RfAttach); +AH_RF(RF5111, ar5111Probe, ar5111RfAttach); Modified: projects/ath_hal/ar5212/ar5112.c ============================================================================== --- projects/ath_hal/ar5212/ar5112.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5212/ar5112.c Fri Nov 28 22:27:26 2008 (r185418) @@ -878,4 +878,4 @@ ar5112Probe(struct ath_hal *ah) { return IS_RAD5112(ah); } -AH_RF(ar5112, ar5112Probe, ar5112RfAttach); +AH_RF(RF5112, ar5112Probe, ar5112RfAttach); Modified: projects/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- projects/ath_hal/ar5212/ar5212_attach.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5212/ar5212_attach.c Fri Nov 28 22:27:26 2008 (r185418) @@ -867,4 +867,4 @@ ar5212Probe(uint16_t vendorid, uint16_t } return AH_NULL; } -AH_CHIP(ar5212, ar5212Probe, ar5212Attach); +AH_CHIP(AR5212, ar5212Probe, ar5212Attach); Modified: projects/ath_hal/ar5212/ar5413.c ============================================================================== --- projects/ath_hal/ar5212/ar5413.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5212/ar5413.c Fri Nov 28 22:27:26 2008 (r185418) @@ -794,4 +794,4 @@ ar5413Probe(struct ath_hal *ah) { return IS_5413(ah); } -AH_RF(ar5413, ar5413Probe, ar5413RfAttach); +AH_RF(RF5413, ar5413Probe, ar5413RfAttach); Modified: projects/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- projects/ath_hal/ar5312/ar5312_attach.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5312/ar5312_attach.c Fri Nov 28 22:27:26 2008 (r185418) @@ -331,4 +331,4 @@ ar5312Probe(uint16_t vendorid, uint16_t } return AH_NULL; } -AH_CHIP(ar5312, ar5312Probe, ar5312Attach); +AH_CHIP(AR5312, ar5312Probe, ar5312Attach); Modified: projects/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- projects/ath_hal/ar5416/ar5416_attach.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5416/ar5416_attach.c Fri Nov 28 22:27:26 2008 (r185418) @@ -483,4 +483,4 @@ ar5416Probe(uint16_t vendorid, uint16_t return "Atheros 5416"; return AH_NULL; } -AH_CHIP(ar5416, ar5416Probe, ar5416Attach); +AH_CHIP(AR5416, ar5416Probe, ar5416Attach); Modified: projects/ath_hal/ar5416/ar9160_attach.c ============================================================================== --- projects/ath_hal/ar5416/ar9160_attach.c Fri Nov 28 22:26:36 2008 (r185417) +++ projects/ath_hal/ar5416/ar9160_attach.c Fri Nov 28 22:27:26 2008 (r185418) @@ -304,4 +304,4 @@ ar9160Probe(uint16_t vendorid, uint16_t return "Atheros 9160"; return AH_NULL; } -AH_CHIP(ar9160, ar9160Probe, ar9160Attach); +AH_CHIP(AR9160, ar9160Probe, ar9160Attach);