From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 00:20:26 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5384C106566C; Sun, 31 Oct 2010 00:20:26 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost2.sentex.ca (smarthost2-6.sentex.ca [IPv6:2607:f3e0:80:80::2]) by mx1.freebsd.org (Postfix) with ESMTP id 120658FC0C; Sun, 31 Oct 2010 00:20:23 +0000 (UTC) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by smarthost2.sentex.ca (8.14.4/8.14.4) with ESMTP id o9V0KKvD033012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 30 Oct 2010 20:20:20 -0400 (EDT) (envelope-from mike@sentex.net) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.14.4/8.14.4) with ESMTP id o9V0KHa9073828; Sat, 30 Oct 2010 20:20:17 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <201010310020.o9V0KHa9073828@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Sat, 30 Oct 2010 20:20:11 -0400 To: "Bjoern A. Zeeb" From: Mike Tancsa In-Reply-To: <20101029135858.E66242@maildrop.int.zabbadoz.net> References: <0C099B90-AFB9-422F-AB75-AFC138A36D20@berlin.ccc.de> <20101029013606.I66242@maildrop.int.zabbadoz.net> <201010291342.o9TDggVQ062469@lava.sentex.ca> <20101029135858.E66242@maildrop.int.zabbadoz.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Scanned-By: MIMEDefang 2.67 on 205.211.164.50 Cc: Denis Ahrens , svn-src-head@FreeBSD.org, Philipp, =?iso-8859-1?Q?W=FCnsche?= , Randy Bush Subject: Re: pending em0 commits for FreeBSD 8.1 STABLE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 00:20:26 -0000 At 10:06 AM 10/29/2010, Bjoern A. Zeeb wrote: >Yes what you have down there looks *sigh* hopefully like a different >issue thought it mbuf fiddling again but way further up the stack. > >Could you please concentrate on only reproducing the > if: discard frame w/o packet header >issue rather than breaking things left and right as well? ;-) OK, some good news. After recompiling RELENG_8 with the em driver from HEAD I am no longer able to recreate the "discard frame w/o packet header" ! ---Mike -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 02:36:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 436CB106566B; Sun, 31 Oct 2010 02:36:06 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16BEF8FC17; Sun, 31 Oct 2010 02:36:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9V2a53k039729; Sun, 31 Oct 2010 02:36:05 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9V2a5hO039726; Sun, 31 Oct 2010 02:36:05 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201010310236.o9V2a5hO039726@svn.freebsd.org> From: Garrett Wollman Date: Sun, 31 Oct 2010 02:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214583 - head/usr.bin/locate/locate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 02:36:06 -0000 Author: wollman Date: Sun Oct 31 02:36:05 2010 New Revision: 214583 URL: http://svn.freebsd.org/changeset/base/214583 Log: Make it possible to exclude directories by name no matter where they are in the filesystem from the locate database. By default, exclude ".zfs" directories, as users who who have set snapdir=visible and are taking frequent snapshots most likely do not want the snapshots included in the locate database. Modified: head/usr.bin/locate/locate/locate.rc head/usr.bin/locate/locate/updatedb.sh Modified: head/usr.bin/locate/locate/locate.rc ============================================================================== --- head/usr.bin/locate/locate/locate.rc Sun Oct 31 02:15:23 2010 (r214582) +++ head/usr.bin/locate/locate/locate.rc Sun Oct 31 02:36:05 2010 (r214583) @@ -15,9 +15,12 @@ # directories to be put in the database #SEARCHPATHS="/" -# directories unwanted in output +# paths unwanted in output #PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap" +# directories unwanted in output +#PRUNEDIRS=".zfs" + # filesystems allowed. Beware: a non-listed filesystem will be pruned # and if the SEARCHPATHS starts in such a filesystem locate will build # an empty database. Modified: head/usr.bin/locate/locate/updatedb.sh ============================================================================== --- head/usr.bin/locate/locate/updatedb.sh Sun Oct 31 02:15:23 2010 (r214582) +++ head/usr.bin/locate/locate/updatedb.sh Sun Oct 31 02:36:05 2010 (r214583) @@ -52,6 +52,7 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; ex : ${FCODES:=/var/db/locate.database} # the database : ${SEARCHPATHS:="/"} # directories to be put in the database : ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories +: ${PRUNEDIRS:=".zfs"} # unwanted directories, in any parent : ${FILESYSTEMS:="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ cut -d " " -f1)"} # allowed filesystems @@ -79,6 +80,14 @@ case X"$PRUNEPATHS" in done;; esac +case X"$PRUNEDIRS" in + X) ;; + *) for dir in $PRUNEDIRS + do + excludes="$excludes -or -name $dir -type d -prune" + done;; +esac + tmp=$TMPDIR/_updatedb$$ trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15 From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 03:03:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52BB2106566C; Sun, 31 Oct 2010 03:03:21 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2602D8FC08; Sun, 31 Oct 2010 03:03:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9V33LGP040997; Sun, 31 Oct 2010 03:03:21 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9V33LTm040994; Sun, 31 Oct 2010 03:03:21 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201010310303.o9V33LTm040994@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 31 Oct 2010 03:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214584 - in head/sys/pc98: include pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 03:03:21 -0000 Author: nyan Date: Sun Oct 31 03:03:20 2010 New Revision: 214584 URL: http://svn.freebsd.org/changeset/base/214584 Log: Rename BUS_SPACE_IO and BUS_SPACE_MEM defines to BUS_SPACE_TAG_IO and BUS_SPACE_TAG_MEM respectively to avoid conflict with nexus.c. Modified: head/sys/pc98/include/bus.h head/sys/pc98/pc98/busiosubr.c Modified: head/sys/pc98/include/bus.h ============================================================================== --- head/sys/pc98/include/bus.h Sun Oct 31 02:36:05 2010 (r214583) +++ head/sys/pc98/include/bus.h Sun Oct 31 03:03:20 2010 (r214584) @@ -158,8 +158,8 @@ struct bus_space_access_methods { * Access methods for bus resources and address space. */ struct bus_space_tag { -#define BUS_SPACE_IO 0 -#define BUS_SPACE_MEM 1 +#define BUS_SPACE_TAG_IO 0 +#define BUS_SPACE_TAG_MEM 1 u_int bs_tag; /* bus space flags */ struct bus_space_access_methods bs_da; /* direct access */ Modified: head/sys/pc98/pc98/busiosubr.c ============================================================================== --- head/sys/pc98/pc98/busiosubr.c Sun Oct 31 02:36:05 2010 (r214583) +++ head/sys/pc98/pc98/busiosubr.c Sun Oct 31 03:03:20 2010 (r214584) @@ -63,7 +63,7 @@ _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem, _BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int32_t,4) struct bus_space_tag SBUS_io_space_tag = { - BUS_SPACE_IO, + BUS_SPACE_TAG_IO, /* direct bus access methods */ { @@ -81,7 +81,7 @@ struct bus_space_tag SBUS_io_space_tag = }; struct bus_space_tag SBUS_mem_space_tag = { - BUS_SPACE_MEM, + BUS_SPACE_TAG_MEM, /* direct bus access methods */ { @@ -109,7 +109,7 @@ _BUS_SPACE_CALL_FUNCS_PROTO(NEPC_RA_io,u _BUS_SPACE_CALL_FUNCS_PROTO(NEPC_RA_io,u_int32_t,4) struct bus_space_tag NEPC_io_space_tag = { - BUS_SPACE_IO, + BUS_SPACE_TAG_IO, /* direct bus access methods */ { @@ -127,7 +127,7 @@ struct bus_space_tag NEPC_io_space_tag = }; struct bus_space_tag NEPC_mem_space_tag = { - BUS_SPACE_MEM, + BUS_SPACE_TAG_MEM, /* direct bus access methods */ { @@ -256,7 +256,7 @@ i386_memio_subregion(bus_space_tag_t t, pbase = pbsh->bsh_base + offset; switch (t->bs_tag) { - case BUS_SPACE_IO: + case BUS_SPACE_TAG_IO: if (pbsh->bsh_iatsz > 0) { if (offset >= pbsh->bsh_iatsz || offset + size > pbsh->bsh_iatsz) @@ -265,7 +265,7 @@ i386_memio_subregion(bus_space_tag_t t, } break; - case BUS_SPACE_MEM: + case BUS_SPACE_TAG_MEM: if (pbsh->bsh_iatsz > 0) return EINVAL; if (offset > pbsh->bsh_sz || offset + size > pbsh->bsh_sz) @@ -282,7 +282,7 @@ i386_memio_subregion(bus_space_tag_t t, return error; switch (t->bs_tag) { - case BUS_SPACE_IO: + case BUS_SPACE_TAG_IO: if (pbsh->bsh_iatsz > 0) { for (i = 0; i < size; i ++) bsh->bsh_iat[i] = pbsh->bsh_iat[i + offset]; @@ -295,7 +295,7 @@ i386_memio_subregion(bus_space_tag_t t, } break; - case BUS_SPACE_MEM: + case BUS_SPACE_TAG_MEM: break; } From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 04:45:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B65FD10656AA; Sun, 31 Oct 2010 04:45:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A64B8FC14; Sun, 31 Oct 2010 04:45:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9V4jPeV046284; Sun, 31 Oct 2010 04:45:25 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9V4jPZQ046281; Sun, 31 Oct 2010 04:45:25 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201010310445.o9V4jPZQ046281@svn.freebsd.org> From: Doug Barton Date: Sun, 31 Oct 2010 04:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214585 - in head/lib/bind: . isc/isc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 04:45:25 -0000 Author: dougb Date: Sun Oct 31 04:45:25 2010 New Revision: 214585 URL: http://svn.freebsd.org/changeset/base/214585 Log: Prep for the 9.6-ESV-R2 update Modified: head/lib/bind/config.h head/lib/bind/isc/isc/platform.h Modified: head/lib/bind/config.h ============================================================================== --- head/lib/bind/config.h Sun Oct 31 03:03:20 2010 (r214584) +++ head/lib/bind/config.h Sun Oct 31 04:45:25 2010 (r214585) @@ -147,6 +147,9 @@ int sigwait(const unsigned int *set, int /* Define if threads need PTHREAD_SCOPE_SYSTEM */ /* #undef NEED_PTHREAD_SCOPE_SYSTEM */ +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + /* Define if recvmsg() does not meet all of the BSD socket API specifications. */ /* #undef BROKEN_RECVMSG */ @@ -306,6 +309,9 @@ int sigwait(const unsigned int *set, int /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + /* Define to the version of this package. */ #define PACKAGE_VERSION "" @@ -327,11 +333,15 @@ int sigwait(const unsigned int *set, int /* #undef WITH_IDN */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ -#if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -#elif ! defined __LITTLE_ENDIAN__ -/* # undef WORDS_BIGENDIAN */ + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif #endif /* Define to empty if `const' does not conform to ANSI C. */ Modified: head/lib/bind/isc/isc/platform.h ============================================================================== --- head/lib/bind/isc/isc/platform.h Sun Oct 31 03:03:20 2010 (r214584) +++ head/lib/bind/isc/isc/platform.h Sun Oct 31 04:45:25 2010 (r214585) @@ -252,7 +252,14 @@ * If the "xaddq" operation (64bit xadd) is available on this architecture, * ISC_PLATFORM_HAVEXADDQ will be defined. */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#ifdef __amd64__ +#define ISC_PLATFORM_HAVEXADDQ 1 +#else #undef ISC_PLATFORM_HAVEXADDQ +#endif /* * If the "atomic swap" operation is available on this architecture, From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 04:45:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 736DB10656A9; Sun, 31 Oct 2010 04:45:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2678FC15; Sun, 31 Oct 2010 04:45:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9V4jsZK046362; Sun, 31 Oct 2010 04:45:54 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9V4jrBW046326; Sun, 31 Oct 2010 04:45:53 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201010310445.o9V4jrBW046326@svn.freebsd.org> From: Doug Barton Date: Sun, 31 Oct 2010 04:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214586 - in head/contrib/bind9: . bin/dnssec bin/named bin/named/include/named bin/nsupdate doc/arm lib/dns lib/dns/include/dns lib/isc lib/isc/include/isc lib/lwres/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 04:45:54 -0000 Author: dougb Date: Sun Oct 31 04:45:53 2010 New Revision: 214586 URL: http://svn.freebsd.org/changeset/base/214586 Log: Update to 9.6-ESV-R2, the latest from ISC. This version contains bug fixes that are relevant to any caching/resolving name server; as well as DNSSEC-related fixes. Modified: head/contrib/bind9/CHANGES head/contrib/bind9/README head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.html head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html head/contrib/bind9/bin/dnssec/dnssec-keygen.html head/contrib/bind9/bin/dnssec/dnssec-signzone.html head/contrib/bind9/bin/named/include/named/globals.h head/contrib/bind9/bin/named/main.c head/contrib/bind9/bin/named/query.c head/contrib/bind9/bin/named/server.c head/contrib/bind9/bin/nsupdate/nsupdate.html head/contrib/bind9/doc/arm/Bv9ARM-book.xml head/contrib/bind9/doc/arm/Bv9ARM.ch06.html head/contrib/bind9/doc/arm/Bv9ARM.ch07.html head/contrib/bind9/doc/arm/Bv9ARM.ch08.html head/contrib/bind9/doc/arm/Bv9ARM.ch09.html head/contrib/bind9/doc/arm/Bv9ARM.html head/contrib/bind9/doc/arm/Bv9ARM.pdf head/contrib/bind9/doc/arm/isc-logo.eps head/contrib/bind9/doc/arm/isc-logo.pdf head/contrib/bind9/doc/arm/man.dig.html head/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html head/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html head/contrib/bind9/doc/arm/man.dnssec-keygen.html head/contrib/bind9/doc/arm/man.dnssec-signzone.html head/contrib/bind9/doc/arm/man.host.html head/contrib/bind9/doc/arm/man.named-checkconf.html head/contrib/bind9/doc/arm/man.named-checkzone.html head/contrib/bind9/doc/arm/man.named.html head/contrib/bind9/doc/arm/man.nsupdate.html head/contrib/bind9/doc/arm/man.rndc-confgen.html head/contrib/bind9/doc/arm/man.rndc.conf.html head/contrib/bind9/doc/arm/man.rndc.html head/contrib/bind9/lib/dns/adb.c head/contrib/bind9/lib/dns/api head/contrib/bind9/lib/dns/include/dns/diff.h head/contrib/bind9/lib/dns/include/dns/ncache.h head/contrib/bind9/lib/dns/include/dns/rdataset.h head/contrib/bind9/lib/dns/include/dns/resolver.h head/contrib/bind9/lib/dns/include/dns/result.h head/contrib/bind9/lib/dns/include/dns/types.h head/contrib/bind9/lib/dns/include/dns/validator.h head/contrib/bind9/lib/dns/ncache.c head/contrib/bind9/lib/dns/rbtdb.c head/contrib/bind9/lib/dns/rdatalist.c head/contrib/bind9/lib/dns/rdataset.c head/contrib/bind9/lib/dns/rdataslab.c head/contrib/bind9/lib/dns/resolver.c head/contrib/bind9/lib/dns/result.c head/contrib/bind9/lib/dns/sdb.c head/contrib/bind9/lib/dns/sdlz.c head/contrib/bind9/lib/dns/validator.c head/contrib/bind9/lib/dns/view.c head/contrib/bind9/lib/isc/api head/contrib/bind9/lib/isc/include/isc/mem.h head/contrib/bind9/lib/isc/mem.c head/contrib/bind9/lib/lwres/man/lwres.html head/contrib/bind9/lib/lwres/man/lwres_buffer.html head/contrib/bind9/lib/lwres/man/lwres_config.html head/contrib/bind9/lib/lwres/man/lwres_context.html head/contrib/bind9/lib/lwres/man/lwres_gabn.html head/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html head/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html head/contrib/bind9/lib/lwres/man/lwres_gethostent.html head/contrib/bind9/lib/lwres/man/lwres_getipnode.html head/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html head/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html head/contrib/bind9/lib/lwres/man/lwres_gnba.html head/contrib/bind9/lib/lwres/man/lwres_hstrerror.html head/contrib/bind9/lib/lwres/man/lwres_inetntop.html head/contrib/bind9/lib/lwres/man/lwres_noop.html head/contrib/bind9/lib/lwres/man/lwres_packet.html head/contrib/bind9/lib/lwres/man/lwres_resutil.html head/contrib/bind9/version Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/CHANGES Sun Oct 31 04:45:53 2010 (r214586) @@ -1,9 +1,48 @@ - --- 9.6.2-P2 released --- + --- 9.6-ESV-R2 released --- + +2939. [func] Check that named successfully skips NSEC3 records + that fail to match the NSEC3PARAM record currently + in use. [RT# 21868] + +2937. [bug] Worked around an apparent race condition in over + memory conditions. Without this fix a DNS cache DB or + ADB could incorrectly stay in an over memory state, + effectively refusing further caching, which + subsequently made a BIND 9 caching server unworkable. + This fix prevents this problem from happening by + polling the state of the memory context, rather than + making a copy of the state, which appeared to cause + a race. This is a "workaround" in that it doesn't + solve the possible race per se, but several experiments + proved this change solves the symptom. Also, the + polling overhead hasn't been reported to be an issue. + This bug should only affect a caching server that + specifies a finite max-cache-size. It's also quite + likely that the bug happens only when enabling threads, + but it's not confirmed yet. [RT #21818] + +2925. [bug] Named failed to accept uncachable negative responses + from insecure zones. [RT# 21555] + +2921. [bug] The resolver could attempt to destroy a fetch context + too soon. [RT #19878] + +2900. [bug] The placeholder negative caching element was not + properly constructed triggering a INSIST in + dns_ncache_towire(). [RT #21346] + +2890. [bug] Handle the introduction of new trusted-keys and + DS, DLV RRsets better. [RT #21097] + +2869. [bug] Fix arguments to dns_keytable_findnextkeynode() call. + [RT #20877] + + --- 9.6-ESV-R1 released --- 2876. [bug] Named could return SERVFAIL for negative responses from unsigned zones. [RT #21131] - --- 9.6.2-P1 released --- + --- 9.6-ESV released --- 2852. [bug] Handle broken DNSSEC trust chains better. [RT #15619] Modified: head/contrib/bind9/README ============================================================================== --- head/contrib/bind9/README Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/README Sun Oct 31 04:45:53 2010 (r214586) @@ -42,6 +42,12 @@ BIND 9 Stichting NLnet - NLnet Foundation Nominum, Inc. +BIND 9.6-ESV (Extended Support Version) + + BIND 9.6-ESV will be supported until March 31, 2013, at + which time you will need to upgrade to the current release + of BIND. + BIND 9.6.2 BIND 9.6.2 is a maintenance release, fixing bugs in 9.6.1. Modified: head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.html ============================================================================== --- head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.html Sun Oct 31 04:45:53 2010 (r214586) @@ -1,5 +1,5 @@ - + @@ -33,14 +33,14 @@

dnssec-dsfromkey {-s} [-v level] [-1] [-2] [-a alg] [-c class] [-d dir] {dnsname}

-

DESCRIPTION

+

DESCRIPTION

dnssec-dsfromkey outputs the Delegation Signer (DS) resource record (RR), as defined in RFC 3658 and RFC 4509, for the given key(s).

-

OPTIONS

+

OPTIONS

-1

@@ -81,7 +81,7 @@

-

EXAMPLE

+

EXAMPLE

To build the SHA-256 DS RR from the Kexample.com.+003+26160 @@ -96,7 +96,7 @@

-

FILES

+

FILES

The keyfile can be designed by the key identification Knnnn.+aaa+iiiii or the full file name @@ -110,13 +110,13 @@

-

CAVEAT

+

CAVEAT

A keyfile error can give a "file not found" even if the file exists.

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -125,7 +125,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html ============================================================================== --- head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html Sun Oct 31 04:45:53 2010 (r214586) @@ -13,7 +13,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -31,7 +31,7 @@

dnssec-keyfromlabel {-a algorithm} {-l label} [-c class] [-f flag] [-k] [-n nametype] [-p protocol] [-t type] [-v level] {name}

-

DESCRIPTION

+

DESCRIPTION

dnssec-keyfromlabel gets keys with the given label from a crypto hardware and builds key files for DNSSEC (Secure DNS), as defined in RFC 2535 @@ -39,7 +39,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm
@@ -120,7 +120,7 @@
-

GENERATED KEY FILES

+

GENERATED KEY FILES

When dnssec-keyfromlabel completes successfully, @@ -161,7 +161,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -169,7 +169,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: head/contrib/bind9/bin/dnssec/dnssec-keygen.html ============================================================================== --- head/contrib/bind9/bin/dnssec/dnssec-keygen.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/dnssec/dnssec-keygen.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -32,7 +32,7 @@

dnssec-keygen {-a algorithm} {-b keysize} {-n nametype} [-c class] [-e] [-f flag] [-g generator] [-h] [-k] [-p protocol] [-r randomdev] [-s strength] [-t type] [-v level] {name}

-

DESCRIPTION

+

DESCRIPTION

dnssec-keygen generates keys for DNSSEC (Secure DNS), as defined in RFC 2535 and RFC 4034. It can also generate keys for use with @@ -45,7 +45,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm
@@ -155,7 +155,7 @@
-

GENERATED KEYS

+

GENERATED KEYS

When dnssec-keygen completes successfully, @@ -201,7 +201,7 @@

-

EXAMPLE

+

EXAMPLE

To generate a 768-bit DSA key for the domain example.com, the following command would be @@ -222,7 +222,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-signzone(8), BIND 9 Administrator Reference Manual, RFC 2539, @@ -231,7 +231,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: head/contrib/bind9/bin/dnssec/dnssec-signzone.html ============================================================================== --- head/contrib/bind9/bin/dnssec/dnssec-signzone.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/dnssec/dnssec-signzone.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -32,7 +32,7 @@

dnssec-signzone [-a] [-c class] [-d directory] [-e end-time] [-f output-file] [-g] [-h] [-k key] [-l domain] [-i interval] [-I input-format] [-j jitter] [-N soa-seria l-format] [-o origin] [-O output-format] [-p] [-P] [-r randomdev] [-s start-time] [-t] [-v level] [-z] [-3 salt] [-H iterations] [-A] {zonefile} [key...]

-

DESCRIPTION

+

DESCRIPTION

dnssec-signzone signs a zone. It generates NSEC and RRSIG records and produces a signed version of the @@ -43,7 +43,7 @@

-

OPTIONS

+

OPTIONS

-a

@@ -273,7 +273,7 @@

-

EXAMPLE

+

EXAMPLE

The following command signs the example.com zone with the DSA key generated by dnssec-keygen @@ -302,7 +302,7 @@ db.example.com.signed %

-

KNOWN BUGS

+

KNOWN BUGS

dnssec-signzone was designed so that it could sign a zone partially, using only a subset of the DNSSEC keys @@ -327,14 +327,14 @@ db.example.com.signed

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), BIND 9 Administrator Reference Manual, RFC 4033.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

Modified: head/contrib/bind9/bin/named/include/named/globals.h ============================================================================== --- head/contrib/bind9/bin/named/include/named/globals.h Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/named/include/named/globals.h Sun Oct 31 04:45:53 2010 (r214586) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008, 2010 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: globals.h,v 1.80 2008/11/16 22:49:18 marka Exp $ */ +/* $Id: globals.h,v 1.80.84.2 2010/06/26 23:46:15 tbox Exp $ */ #ifndef NAMED_GLOBALS_H #define NAMED_GLOBALS_H 1 @@ -132,6 +132,7 @@ EXTERN int ns_g_listen INIT(3); EXTERN isc_time_t ns_g_boottime; EXTERN isc_boolean_t ns_g_memstatistics INIT(ISC_FALSE); EXTERN isc_boolean_t ns_g_clienttest INIT(ISC_FALSE); +EXTERN isc_boolean_t ns_g_nosoa INIT(ISC_FALSE); #undef EXTERN #undef INIT Modified: head/contrib/bind9/bin/named/main.c ============================================================================== --- head/contrib/bind9/bin/named/main.c Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/named/main.c Sun Oct 31 04:45:53 2010 (r214586) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 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: main.c,v 1.166.34.3 2009/04/03 20:18:59 marka Exp $ */ +/* $Id: main.c,v 1.166.34.3.24.3 2010/09/06 03:58:32 marka Exp $ */ /*! \file */ @@ -446,13 +446,15 @@ parse_command_line(int argc, char *argv[ /* XXXJAB should we make a copy? */ ns_g_chrootdir = isc_commandline_argument; break; - case 'T': + case 'T': /* NOT DOCUMENTED */ /* * clienttest: make clients single shot with their * own memory context. */ if (strcmp(isc_commandline_argument, "clienttest") == 0) ns_g_clienttest = ISC_TRUE; + else if (!strcmp(isc_commandline_argument, "nosoa")) + ns_g_nosoa = ISC_TRUE; else fprintf(stderr, "unknown -T flag '%s\n", isc_commandline_argument); Modified: head/contrib/bind9/bin/named/query.c ============================================================================== --- head/contrib/bind9/bin/named/query.c Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/named/query.c Sun Oct 31 04:45:53 2010 (r214586) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 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: query.c,v 1.313.20.16 2009/12/30 08:34:29 jinmei Exp $ */ +/* $Id: query.c,v 1.313.20.16.10.2 2010/06/26 23:46:14 tbox Exp $ */ /*! \file */ @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -2038,7 +2039,7 @@ query_addrrset(ns_client_t *client, dns_ static inline isc_result_t query_addsoa(ns_client_t *client, dns_db_t *db, dns_dbversion_t *version, - isc_boolean_t zero_ttl) + isc_boolean_t zero_ttl, isc_boolean_t isassociated) { dns_name_t *name; dns_dbnode_t *node; @@ -2056,6 +2057,12 @@ query_addsoa(ns_client_t *client, dns_db node = NULL; /* + * Don't add the SOA record for test which set "-T nosoa". + */ + if (ns_g_nosoa && (!WANTDNSSEC(client) || !isassociated)) + return (ISC_R_SUCCESS); + + /* * Get resources and make 'name' be the database origin. */ result = dns_message_gettempname(client->message, &name); @@ -4324,7 +4331,8 @@ query_find(ns_client_t *client, dns_fetc /* * Add SOA. */ - result = query_addsoa(client, db, version, ISC_FALSE); + result = query_addsoa(client, db, version, ISC_FALSE, + dns_rdataset_isassociated(rdataset)); if (result != ISC_R_SUCCESS) { QUERY_ERROR(result); goto cleanup; @@ -4372,9 +4380,11 @@ query_find(ns_client_t *client, dns_fetc zone != NULL && #endif dns_zone_getzeronosoattl(zone)) - result = query_addsoa(client, db, version, ISC_TRUE); + result = query_addsoa(client, db, version, ISC_TRUE, + dns_rdataset_isassociated(rdataset)); else - result = query_addsoa(client, db, version, ISC_FALSE); + result = query_addsoa(client, db, version, ISC_FALSE, + dns_rdataset_isassociated(rdataset)); if (result != ISC_R_SUCCESS) { QUERY_ERROR(result); goto cleanup; @@ -4742,7 +4752,7 @@ query_find(ns_client_t *client, dns_fetc * Add SOA. */ result = query_addsoa(client, db, version, - ISC_FALSE); + ISC_FALSE, ISC_FALSE); if (result == ISC_R_SUCCESS) result = ISC_R_NOMORE; } else { Modified: head/contrib/bind9/bin/named/server.c ============================================================================== --- head/contrib/bind9/bin/named/server.c Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/named/server.c Sun Oct 31 04:45:53 2010 (r214586) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.520.12.11.8.2 2010/02/25 10:57:11 tbox Exp $ */ +/* $Id: server.c,v 1.520.12.11.10.1 2010/03/03 22:06:36 marka Exp $ */ /*! \file */ Modified: head/contrib/bind9/bin/nsupdate/nsupdate.html ============================================================================== --- head/contrib/bind9/bin/nsupdate/nsupdate.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/bin/nsupdate/nsupdate.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -32,7 +32,7 @@

nsupdate [-d] [-D] [[-g] | [-o] | [-y [hmac:]keyname:secret] | [-k keyfile]] [-t timeout] [-u udptimeout] [-r udpretries] [-R randomdev] [-v] [filename]

-

DESCRIPTION

+

DESCRIPTION

nsupdate is used to submit Dynamic DNS Update requests as defined in RFC2136 to a name server. @@ -169,7 +169,7 @@

-

INPUT FORMAT

+

INPUT FORMAT

nsupdate reads input from filename @@ -433,7 +433,7 @@

-

EXAMPLES

+

EXAMPLES

The examples below show how nsupdate @@ -487,7 +487,7 @@

-

FILES

+

FILES

/etc/resolv.conf

@@ -506,7 +506,7 @@

-

SEE ALSO

+

SEE ALSO

RFC2136, RFC3007, RFC2104, @@ -519,7 +519,7 @@

-

BUGS

+

BUGS

The TSIG key is redundantly stored in two separate files. This is a consequence of nsupdate using the DST library Modified: head/contrib/bind9/doc/arm/Bv9ARM-book.xml ============================================================================== --- head/contrib/bind9/doc/arm/Bv9ARM-book.xml Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/Bv9ARM-book.xml Sun Oct 31 04:45:53 2010 (r214586) @@ -18,7 +18,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - + BIND 9 Administrator Reference Manual Modified: head/contrib/bind9/doc/arm/Bv9ARM.ch06.html ============================================================================== --- head/contrib/bind9/doc/arm/Bv9ARM.ch06.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/Bv9ARM.ch06.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/Bv9ARM.ch07.html ============================================================================== --- head/contrib/bind9/doc/arm/Bv9ARM.ch07.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/Bv9ARM.ch07.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/Bv9ARM.ch08.html ============================================================================== --- head/contrib/bind9/doc/arm/Bv9ARM.ch08.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/Bv9ARM.ch08.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/Bv9ARM.ch09.html ============================================================================== --- head/contrib/bind9/doc/arm/Bv9ARM.ch09.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/Bv9ARM.ch09.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/Bv9ARM.html ============================================================================== --- head/contrib/bind9/doc/arm/Bv9ARM.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/Bv9ARM.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/Bv9ARM.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bind9/doc/arm/isc-logo.eps ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bind9/doc/arm/isc-logo.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bind9/doc/arm/man.dig.html ============================================================================== --- head/contrib/bind9/doc/arm/man.dig.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.dig.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html ============================================================================== --- head/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html ============================================================================== --- head/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.dnssec-keygen.html ============================================================================== --- head/contrib/bind9/doc/arm/man.dnssec-keygen.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.dnssec-keygen.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.dnssec-signzone.html ============================================================================== --- head/contrib/bind9/doc/arm/man.dnssec-signzone.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.dnssec-signzone.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.host.html ============================================================================== --- head/contrib/bind9/doc/arm/man.host.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.host.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.named-checkconf.html ============================================================================== --- head/contrib/bind9/doc/arm/man.named-checkconf.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.named-checkconf.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.named-checkzone.html ============================================================================== --- head/contrib/bind9/doc/arm/man.named-checkzone.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.named-checkzone.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.named.html ============================================================================== --- head/contrib/bind9/doc/arm/man.named.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.named.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.nsupdate.html ============================================================================== --- head/contrib/bind9/doc/arm/man.nsupdate.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.nsupdate.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.rndc-confgen.html ============================================================================== --- head/contrib/bind9/doc/arm/man.rndc-confgen.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.rndc-confgen.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.rndc.conf.html ============================================================================== --- head/contrib/bind9/doc/arm/man.rndc.conf.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.rndc.conf.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/doc/arm/man.rndc.html ============================================================================== --- head/contrib/bind9/doc/arm/man.rndc.html Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/doc/arm/man.rndc.html Sun Oct 31 04:45:53 2010 (r214586) @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: head/contrib/bind9/lib/dns/adb.c ============================================================================== --- head/contrib/bind9/lib/dns/adb.c Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/lib/dns/adb.c Sun Oct 31 04:45:53 2010 (r214586) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 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: adb.c,v 1.243.42.4 2009/02/03 22:34:28 jinmei Exp $ */ +/* $Id: adb.c,v 1.243.42.4.24.2 2010/08/12 23:46:24 tbox Exp $ */ /*! \file * @@ -118,7 +118,6 @@ struct dns_adb { isc_taskmgr_t *taskmgr; isc_task_t *task; - isc_boolean_t overmem; isc_interval_t tick_interval; int next_cleanbucket; @@ -294,8 +293,8 @@ static inline void inc_adb_irefcnt(dns_a static inline void inc_adb_erefcnt(dns_adb_t *); static inline void inc_entry_refcnt(dns_adb_t *, dns_adbentry_t *, isc_boolean_t); -static inline isc_boolean_t dec_entry_refcnt(dns_adb_t *, dns_adbentry_t *, - isc_boolean_t); +static inline isc_boolean_t dec_entry_refcnt(dns_adb_t *, isc_boolean_t, + dns_adbentry_t *, isc_boolean_t); static inline void violate_locking_hierarchy(isc_mutex_t *, isc_mutex_t *); static isc_boolean_t clean_namehooks(dns_adb_t *, dns_adbnamehooklist_t *); static void clean_target(dns_adb_t *, dns_name_t *); @@ -777,7 +776,7 @@ link_entry(dns_adb_t *adb, int bucket, d int i; dns_adbentry_t *e; - if (adb->overmem) { + if (isc_mem_isovermem(adb->mctx)) { for (i = 0; i < 2; i++) { e = ISC_LIST_TAIL(adb->entries[bucket]); if (e == NULL) @@ -943,6 +942,7 @@ clean_namehooks(dns_adb_t *adb, dns_adbn dns_adbnamehook_t *namehook; int addr_bucket; isc_boolean_t result = ISC_FALSE; + isc_boolean_t overmem = isc_mem_isovermem(adb->mctx); addr_bucket = DNS_ADB_INVALIDBUCKET; namehook = ISC_LIST_HEAD(*namehooks); @@ -963,7 +963,8 @@ clean_namehooks(dns_adb_t *adb, dns_adbn LOCK(&adb->entrylocks[addr_bucket]); } - result = dec_entry_refcnt(adb, entry, ISC_FALSE); + result = dec_entry_refcnt(adb, overmem, entry, + ISC_FALSE); } /* @@ -1235,7 +1236,9 @@ inc_entry_refcnt(dns_adb_t *adb, dns_adb } static inline isc_boolean_t -dec_entry_refcnt(dns_adb_t *adb, dns_adbentry_t *entry, isc_boolean_t lock) { +dec_entry_refcnt(dns_adb_t *adb, isc_boolean_t overmem, dns_adbentry_t *entry, + isc_boolean_t lock) +{ int bucket; isc_boolean_t destroy_entry; isc_boolean_t result = ISC_FALSE; @@ -1250,7 +1253,7 @@ dec_entry_refcnt(dns_adb_t *adb, dns_adb destroy_entry = ISC_FALSE; if (entry->refcnt == 0 && - (adb->entry_sd[bucket] || entry->expires == 0 || adb->overmem || + (adb->entry_sd[bucket] || entry->expires == 0 || overmem || (entry->flags & ENTRY_IS_DEAD) != 0)) { destroy_entry = ISC_TRUE; result = unlink_entry(adb, entry); @@ -1852,7 +1855,7 @@ check_stale_name(dns_adb_t *adb, int buc int victims, max_victims; isc_boolean_t result; dns_adbname_t *victim, *next_victim; - isc_boolean_t overmem = adb->overmem; + isc_boolean_t overmem = isc_mem_isovermem(adb->mctx); int scans = 0; INSIST(bucket != DNS_ADB_INVALIDBUCKET); @@ -2049,7 +2052,6 @@ dns_adb_create(isc_mem_t *mem, dns_view_ adb, NULL, NULL); adb->cevent_sent = ISC_FALSE; adb->shutting_down = ISC_FALSE; - adb->overmem = ISC_FALSE; ISC_LIST_INIT(adb->whenshutdown); isc_mem_attach(mem, &adb->mctx); @@ -2616,6 +2618,7 @@ dns_adb_destroyfind(dns_adbfind_t **find dns_adbaddrinfo_t *ai; int bucket; dns_adb_t *adb; + isc_boolean_t overmem; REQUIRE(findp != NULL && DNS_ADBFIND_VALID(*findp)); find = *findp; @@ -2640,13 +2643,14 @@ dns_adb_destroyfind(dns_adbfind_t **find * Return the find to the memory pool, and decrement the adb's * reference count. */ + overmem = isc_mem_isovermem(adb->mctx); ai = ISC_LIST_HEAD(find->list); while (ai != NULL) { ISC_LIST_UNLINK(find->list, ai, publink); entry = ai->entry; ai->entry = NULL; INSIST(DNS_ADBENTRY_VALID(entry)); - RUNTIME_CHECK(dec_entry_refcnt(adb, entry, ISC_TRUE) == + RUNTIME_CHECK(dec_entry_refcnt(adb, overmem, entry, ISC_TRUE) == ISC_FALSE); free_adbaddrinfo(adb, &ai); ai = ISC_LIST_HEAD(find->list); @@ -3509,6 +3513,7 @@ dns_adb_freeaddrinfo(dns_adb_t *adb, dns int bucket; isc_stdtime_t now; isc_boolean_t want_check_exit = ISC_FALSE; + isc_boolean_t overmem; REQUIRE(DNS_ADB_VALID(adb)); REQUIRE(addrp != NULL); @@ -3520,13 +3525,14 @@ dns_adb_freeaddrinfo(dns_adb_t *adb, dns isc_stdtime_get(&now); *addrp = NULL; + overmem = isc_mem_isovermem(adb->mctx); bucket = addr->entry->lock_bucket; LOCK(&adb->entrylocks[bucket]); entry->expires = now + ADB_ENTRY_WINDOW; - want_check_exit = dec_entry_refcnt(adb, entry, ISC_FALSE); + want_check_exit = dec_entry_refcnt(adb, overmem, entry, ISC_FALSE); UNLOCK(&adb->entrylocks[bucket]); @@ -3591,6 +3597,14 @@ dns_adb_flushname(dns_adb_t *adb, dns_na static void water(void *arg, int mark) { + /* + * We're going to change the way to handle overmem condition: use + * isc_mem_isovermem() instead of storing the state via this callback, + * since the latter way tends to cause race conditions. + * To minimize the change, and in case we re-enable the callback + * approach, however, keep this function at the moment. + */ + dns_adb_t *adb = arg; isc_boolean_t overmem = ISC_TF(mark == ISC_MEM_HIWATER); @@ -3598,17 +3612,6 @@ water(void *arg, int mark) { DP(ISC_LOG_DEBUG(1), "adb reached %s water mark", overmem ? "high" : "low"); - - /* - * We can't use adb->lock as there is potential for water - * to be called when adb->lock is held. - */ - LOCK(&adb->overmemlock); - if (adb->overmem != overmem) { - adb->overmem = overmem; - isc_mem_waterack(adb->mctx, mark); - } - UNLOCK(&adb->overmemlock); } void Modified: head/contrib/bind9/lib/dns/api ============================================================================== --- head/contrib/bind9/lib/dns/api Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/lib/dns/api Sun Oct 31 04:45:53 2010 (r214586) @@ -1,3 +1,3 @@ -LIBINTERFACE = 56 -LIBREVISION = 1 -LIBAGE = 1 +LIBINTERFACE = 57 +LIBREVISION = 0 +LIBAGE = 2 Modified: head/contrib/bind9/lib/dns/include/dns/diff.h ============================================================================== --- head/contrib/bind9/lib/dns/include/dns/diff.h Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/lib/dns/include/dns/diff.h Sun Oct 31 04:45:53 2010 (r214586) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: diff.h,v 1.15.120.2 2009/01/18 23:47:41 tbox Exp $ */ +/* $Id: diff.h,v 1.15.120.2.24.2 2010/06/04 23:49:23 tbox Exp $ */ #ifndef DNS_DIFF_H #define DNS_DIFF_H 1 @@ -70,7 +70,7 @@ typedef enum { DNS_DIFFOP_DEL = 1, /*%< Delete an RR. */ DNS_DIFFOP_EXISTS = 2, /*%< Assert RR existence. */ DNS_DIFFOP_ADDRESIGN = 4, /*%< ADD + RESIGN. */ - DNS_DIFFOP_DELRESIGN = 5, /*%< DEL + RESIGN. */ + DNS_DIFFOP_DELRESIGN = 5 /*%< DEL + RESIGN. */ } dns_diffop_t; typedef struct dns_difftuple dns_difftuple_t; Modified: head/contrib/bind9/lib/dns/include/dns/ncache.h ============================================================================== --- head/contrib/bind9/lib/dns/include/dns/ncache.h Sun Oct 31 04:45:25 2010 (r214585) +++ head/contrib/bind9/lib/dns/include/dns/ncache.h Sun Oct 31 04:45:53 2010 (r214586) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ncache.h,v 1.25.48.2 2009/12/30 23:47:31 tbox Exp $ */ +/* $Id: ncache.h,v 1.25.48.2.10.2 2010/05/14 23:48:44 tbox Exp $ */ #ifndef DNS_NCACHE_H #define DNS_NCACHE_H 1 @@ -161,6 +161,13 @@ dns_ncache_getrdataset(dns_rdataset_t *n * */ +isc_result_t +dns_ncache_getsigrdataset(dns_rdataset_t *ncacherdataset, dns_name_t *name, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 09:21:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52337106566C; Sun, 31 Oct 2010 09:21:28 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4160E8FC16; Sun, 31 Oct 2010 09:21:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9V9LSLT075410; Sun, 31 Oct 2010 09:21:28 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9V9LSo4075408; Sun, 31 Oct 2010 09:21:28 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201010310921.o9V9LSo4075408@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 31 Oct 2010 09:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 09:21:28 -0000 Author: uqs Date: Sun Oct 31 09:21:27 2010 New Revision: 214596 URL: http://svn.freebsd.org/changeset/base/214596 Log: Elaborate some more on the non-security implications of using -P Submitted by: delphij Discussion at: svn-src-all Modified: head/bin/rm/rm.1 Modified: head/bin/rm/rm.1 ============================================================================== --- head/bin/rm/rm.1 Sun Oct 31 09:05:04 2010 (r214595) +++ head/bin/rm/rm.1 Sun Oct 31 09:21:27 2010 (r214596) @@ -32,7 +32,7 @@ .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" $FreeBSD$ .\" -.Dd October 8, 2010 +.Dd October 31, 2010 .Dt RM 1 .Os .Sh NAME @@ -100,6 +100,11 @@ Specifying this flag for a read only fil .Nm to generate an error message and exit. The file will not be removed or overwritten. +.Pp +N.B.: The +.Fl P +flag is not considered a security feature +.Pq see Sx BUGS . .It Fl R Attempt to remove the file hierarchy rooted in each .Ar file @@ -229,8 +234,12 @@ command appeared in .Sh BUGS The .Fl P -option assumes that the underlying file system updates existing blocks -in-place and does not store new data in a new location. -This is true for UFS, but not for ZFS or other file systems which use -copy-on-write semantics. -In addition, only regular files are overwritten. +option assumes that the underlying storage overwrites file block +when data is written to an existing offset. +Several factors including the file system and its backing store could defeat +this assumption. +This includes, but is not limited to file systems that use a +Copy-On-Write strategy (e.g. ZFS or UFS when snapshots are being used), Flash +media that is using a wear leveling algorithm, or when the backing datastore +does journaling, etc. +In addition, only regular files are overwritten, other types of files are not. From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 10:55:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 3CC811065673; Sun, 31 Oct 2010 10:55:31 +0000 (UTC) Date: Sun, 31 Oct 2010 10:55:31 +0000 From: Alexander Best To: Ulrich Spoerlein Message-ID: <20101031105531.GA68591@freebsd.org> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: <201010310921.o9V9LSo4075408@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 10:55:31 -0000 --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun Oct 31 10, Ulrich Spoerlein wrote: > Author: uqs > Date: Sun Oct 31 09:21:27 2010 > New Revision: 214596 > URL: http://svn.freebsd.org/changeset/base/214596 > > Log: > Elaborate some more on the non-security implications of using -P thanks a lot. i think there are a few typos though (see attached patch). cheers. alex > > Submitted by: delphij > Discussion at: svn-src-all > > Modified: > head/bin/rm/rm.1 > > Modified: head/bin/rm/rm.1 > ============================================================================== > --- head/bin/rm/rm.1 Sun Oct 31 09:05:04 2010 (r214595) > +++ head/bin/rm/rm.1 Sun Oct 31 09:21:27 2010 (r214596) > @@ -32,7 +32,7 @@ > .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 > .\" $FreeBSD$ > .\" > -.Dd October 8, 2010 > +.Dd October 31, 2010 > .Dt RM 1 > .Os > .Sh NAME > @@ -100,6 +100,11 @@ Specifying this flag for a read only fil > .Nm > to generate an error message and exit. > The file will not be removed or overwritten. > +.Pp > +N.B.: The > +.Fl P > +flag is not considered a security feature > +.Pq see Sx BUGS . > .It Fl R > Attempt to remove the file hierarchy rooted in each > .Ar file > @@ -229,8 +234,12 @@ command appeared in > .Sh BUGS > The > .Fl P > -option assumes that the underlying file system updates existing blocks > -in-place and does not store new data in a new location. > -This is true for UFS, but not for ZFS or other file systems which use > -copy-on-write semantics. > -In addition, only regular files are overwritten. > +option assumes that the underlying storage overwrites file block > +when data is written to an existing offset. > +Several factors including the file system and its backing store could defeat > +this assumption. > +This includes, but is not limited to file systems that use a > +Copy-On-Write strategy (e.g. ZFS or UFS when snapshots are being used), Flash > +media that is using a wear leveling algorithm, or when the backing datastore > +does journaling, etc. > +In addition, only regular files are overwritten, other types of files are not. -- a13x --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rm.1.diff" diff --git a/bin/rm/rm.1 b/bin/rm/rm.1 index 4e4f240..ad81066 100644 --- a/bin/rm/rm.1 +++ b/bin/rm/rm.1 @@ -234,12 +234,12 @@ command appeared in .Sh BUGS The .Fl P -option assumes that the underlying storage overwrites file block +option assumes that the underlying storage overwrites file blocks when data is written to an existing offset. Several factors including the file system and its backing store could defeat this assumption. This includes, but is not limited to file systems that use a Copy-On-Write strategy (e.g. ZFS or UFS when snapshots are being used), Flash -media that is using a wear leveling algorithm, or when the backing datastore +media that are using a wear leveling algorithm, or when the backing datastore does journaling, etc. In addition, only regular files are overwritten, other types of files are not. --y0ulUmNC+osPPQO6-- From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 11:44:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28FC7106566B; Sun, 31 Oct 2010 11:44:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183E58FC1A; Sun, 31 Oct 2010 11:44:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VBifR3085972; Sun, 31 Oct 2010 11:44:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VBifsO085970; Sun, 31 Oct 2010 11:44:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010311144.o9VBifsO085970@svn.freebsd.org> From: Alexander Motin Date: Sun, 31 Oct 2010 11:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214597 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 11:44:42 -0000 Author: mav Date: Sun Oct 31 11:44:41 2010 New Revision: 214597 URL: http://svn.freebsd.org/changeset/base/214597 Log: Fix callout_tickstofirst() behavior after signed integer ticks overflow. This should fix callout precision drop to 1/4s after 25 days of uptime with HZ = 1000. Submitted by: Taku YAMAMOTO Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sun Oct 31 09:21:27 2010 (r214596) +++ head/sys/kern/kern_timeout.c Sun Oct 31 11:44:41 2010 (r214597) @@ -295,8 +295,7 @@ callout_tickstofirst(int limit) sc = &cc->cc_callwheel[ (curticks+skip) & callwheelmask ]; /* search scanning ticks */ TAILQ_FOREACH( c, sc, c_links.tqe ){ - if (c && (c->c_time <= curticks + ncallout) - && (c->c_time > 0)) + if (c->c_time - curticks <= ncallout) goto out; } skip++; From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 11:54:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C623B106566B; Sun, 31 Oct 2010 11:54:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 8C58B8FC08; Sun, 31 Oct 2010 11:54:01 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id F211E359A04; Sun, 31 Oct 2010 12:54:00 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id E7A48174A9; Sun, 31 Oct 2010 12:54:00 +0100 (CET) Date: Sun, 31 Oct 2010 12:54:00 +0100 From: Jilles Tjoelker To: Garrett Wollman Message-ID: <20101031115400.GA72674@stack.nl> References: <201010310236.o9V2a5hO039726@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010310236.o9V2a5hO039726@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214583 - head/usr.bin/locate/locate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 11:54:01 -0000 On Sun, Oct 31, 2010 at 02:36:05AM +0000, Garrett Wollman wrote: > Author: wollman > Date: Sun Oct 31 02:36:05 2010 > New Revision: 214583 > URL: http://svn.freebsd.org/changeset/base/214583 > Log: > Make it possible to exclude directories by name no matter where they > are in the filesystem from the locate database. By default, exclude > ".zfs" directories, as users who who have set snapdir=visible and are > taking frequent snapshots most likely do not want the snapshots > included in the locate database. > Modified: head/usr.bin/locate/locate/updatedb.sh > ============================================================================== > --- head/usr.bin/locate/locate/updatedb.sh Sun Oct 31 02:15:23 2010 (r214582) > +++ head/usr.bin/locate/locate/updatedb.sh Sun Oct 31 02:36:05 2010 (r214583) > @@ -52,6 +52,7 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; ex > : ${FCODES:=/var/db/locate.database} # the database > : ${SEARCHPATHS:="/"} # directories to be put in the database > : ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories > +: ${PRUNEDIRS:=".zfs"} # unwanted directories, in any parent This makes it impossible to use empty PRUNEDIRS as it will be changed to ".zfs". I suppose it should be changed to : ${PRUNEDIRS=".zfs"} There are also checks for empty SEARCHPATHS and FILESYSTEMS below which will never trigger for the same reason. > : ${FILESYSTEMS:="$(lsvfs | tail -n +3 | \ > egrep -vw "loopback|network|synthetic|read-only|0" | \ > cut -d " " -f1)"} # allowed filesystems > @@ -79,6 +80,14 @@ case X"$PRUNEPATHS" in > done;; > esac > > +case X"$PRUNEDIRS" in > + X) ;; > + *) for dir in $PRUNEDIRS > + do > + excludes="$excludes -or -name $dir -type d -prune" > + done;; > +esac > + > tmp=$TMPDIR/_updatedb$$ > trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15 The X stuff seems to be here for consistency with the rest of the script, but is unnecessary. Even in old shells, things like case $PRUNEDIRS in '') ;; esac work fine. On the other hand, for optimal portability one should indeed still write [ "X$FOO" = "X$BAR" ] since [ "$FOO" = "$BAR" ] will not work properly for some values of $FOO and $BAR on some only slightly old shells (e.g. FreeBSD 6.4, 7.0 sh treat [ \( = \) ] incorrectly). -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 12:06:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B5161065697; Sun, 31 Oct 2010 12:06:03 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A01F8FC1B; Sun, 31 Oct 2010 12:06:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VC62eo086930; Sun, 31 Oct 2010 12:06:03 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VC62qv086927; Sun, 31 Oct 2010 12:06:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010311206.o9VC62qv086927@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 31 Oct 2010 12:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214599 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 12:06:03 -0000 Author: jilles Date: Sun Oct 31 12:06:02 2010 New Revision: 214599 URL: http://svn.freebsd.org/changeset/base/214599 Log: sh: Use iteration instead of recursion to evaluate semicolon lists. This reduces CPU and memory usage when executing long lists (such as long functions). Modified: head/bin/sh/eval.c head/bin/sh/parser.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Oct 31 12:05:37 2010 (r214598) +++ head/bin/sh/eval.c Sun Oct 31 12:06:02 2010 (r214599) @@ -196,6 +196,7 @@ void evaltree(union node *n, int flags) { int do_etest; + union node *next; do_etest = 0; if (n == NULL) { @@ -203,6 +204,8 @@ evaltree(union node *n, int flags) exitstatus = 0; goto out; } + do { + next = NULL; #ifndef NO_HISTORY displayhist = 1; /* show history substitutions done with fc */ #endif @@ -212,20 +215,20 @@ evaltree(union node *n, int flags) evaltree(n->nbinary.ch1, flags & ~EV_EXIT); if (evalskip) goto out; - evaltree(n->nbinary.ch2, flags); + next = n->nbinary.ch2; break; case NAND: evaltree(n->nbinary.ch1, EV_TESTED); if (evalskip || exitstatus != 0) { goto out; } - evaltree(n->nbinary.ch2, flags); + next = n->nbinary.ch2; break; case NOR: evaltree(n->nbinary.ch1, EV_TESTED); if (evalskip || exitstatus == 0) goto out; - evaltree(n->nbinary.ch2, flags); + next = n->nbinary.ch2; break; case NREDIR: evalredir(n, flags); @@ -242,9 +245,9 @@ evaltree(union node *n, int flags) if (evalskip) goto out; if (exitstatus == 0) - evaltree(n->nif.ifpart, flags); + next = n->nif.ifpart; else if (n->nif.elsepart) - evaltree(n->nif.elsepart, flags); + next = n->nif.elsepart; else exitstatus = 0; break; @@ -281,6 +284,8 @@ evaltree(union node *n, int flags) flushout(&output); break; } + n = next; + } while (n != NULL); out: if (pendingsigs) dotrap(); Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Oct 31 12:05:37 2010 (r214598) +++ head/bin/sh/parser.c Sun Oct 31 12:06:02 2010 (r214599) @@ -227,13 +227,13 @@ parsecmd(int interact) static union node * list(int nlflag, int erflag) { - union node *n1, *n2, *n3; + union node *ntop, *n1, *n2, *n3; int tok; checkkwd = 2; if (!nlflag && !erflag && tokendlist[peektoken()]) return NULL; - n1 = NULL; + ntop = n1 = NULL; for (;;) { n2 = andor(); tok = readtoken(); @@ -250,14 +250,21 @@ list(int nlflag, int erflag) n2 = n3; } } - if (n1 == NULL) { - n1 = n2; + if (ntop == NULL) + ntop = n2; + else if (n1 == NULL) { + n1 = (union node *)stalloc(sizeof (struct nbinary)); + n1->type = NSEMI; + n1->nbinary.ch1 = ntop; + n1->nbinary.ch2 = n2; + ntop = n1; } else { n3 = (union node *)stalloc(sizeof (struct nbinary)); n3->type = NSEMI; - n3->nbinary.ch1 = n1; + n3->nbinary.ch1 = n1->nbinary.ch2; n3->nbinary.ch2 = n2; + n1->nbinary.ch2 = n3; n1 = n3; } switch (tok) { @@ -269,28 +276,28 @@ list(int nlflag, int erflag) if (tok == TNL) { parseheredoc(); if (nlflag) - return n1; + return ntop; } else if (tok == TEOF && nlflag) { parseheredoc(); - return n1; + return ntop; } else { tokpushback++; } checkkwd = 2; if (!nlflag && !erflag && tokendlist[peektoken()]) - return n1; + return ntop; break; case TEOF: if (heredoclist) parseheredoc(); else pungetc(); /* push back EOF on input */ - return n1; + return ntop; default: if (nlflag || erflag) synexpect(-1); tokpushback++; - return n1; + return ntop; } } } From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 12:08:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B6A0106567A; Sun, 31 Oct 2010 12:08:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A1658FC1A; Sun, 31 Oct 2010 12:08:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VC8Gj4087069; Sun, 31 Oct 2010 12:08:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VC8G6P087067; Sun, 31 Oct 2010 12:08:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010311208.o9VC8G6P087067@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 31 Oct 2010 12:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214600 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 12:08:17 -0000 Author: jilles Date: Sun Oct 31 12:08:16 2010 New Revision: 214600 URL: http://svn.freebsd.org/changeset/base/214600 Log: sh: Reindent evaltree(). Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Oct 31 12:06:02 2010 (r214599) +++ head/bin/sh/eval.c Sun Oct 31 12:08:16 2010 (r214600) @@ -205,86 +205,86 @@ evaltree(union node *n, int flags) goto out; } do { - next = NULL; + next = NULL; #ifndef NO_HISTORY - displayhist = 1; /* show history substitutions done with fc */ + displayhist = 1; /* show history substitutions done with fc */ #endif - TRACE(("evaltree(%p: %d) called\n", (void *)n, n->type)); - switch (n->type) { - case NSEMI: - evaltree(n->nbinary.ch1, flags & ~EV_EXIT); - if (evalskip) - goto out; - next = n->nbinary.ch2; - break; - case NAND: - evaltree(n->nbinary.ch1, EV_TESTED); - if (evalskip || exitstatus != 0) { - goto out; + TRACE(("evaltree(%p: %d) called\n", (void *)n, n->type)); + switch (n->type) { + case NSEMI: + evaltree(n->nbinary.ch1, flags & ~EV_EXIT); + if (evalskip) + goto out; + next = n->nbinary.ch2; + break; + case NAND: + evaltree(n->nbinary.ch1, EV_TESTED); + if (evalskip || exitstatus != 0) { + goto out; + } + next = n->nbinary.ch2; + break; + case NOR: + evaltree(n->nbinary.ch1, EV_TESTED); + if (evalskip || exitstatus == 0) + goto out; + next = n->nbinary.ch2; + break; + case NREDIR: + evalredir(n, flags); + break; + case NSUBSHELL: + evalsubshell(n, flags); + do_etest = !(flags & EV_TESTED); + break; + case NBACKGND: + evalsubshell(n, flags); + break; + case NIF: { + evaltree(n->nif.test, EV_TESTED); + if (evalskip) + goto out; + if (exitstatus == 0) + next = n->nif.ifpart; + else if (n->nif.elsepart) + next = n->nif.elsepart; + else + exitstatus = 0; + break; } - next = n->nbinary.ch2; - break; - case NOR: - evaltree(n->nbinary.ch1, EV_TESTED); - if (evalskip || exitstatus == 0) - goto out; - next = n->nbinary.ch2; - break; - case NREDIR: - evalredir(n, flags); - break; - case NSUBSHELL: - evalsubshell(n, flags); - do_etest = !(flags & EV_TESTED); - break; - case NBACKGND: - evalsubshell(n, flags); - break; - case NIF: { - evaltree(n->nif.test, EV_TESTED); - if (evalskip) - goto out; - if (exitstatus == 0) - next = n->nif.ifpart; - else if (n->nif.elsepart) - next = n->nif.elsepart; - else + case NWHILE: + case NUNTIL: + evalloop(n, flags & ~EV_EXIT); + break; + case NFOR: + evalfor(n, flags & ~EV_EXIT); + break; + case NCASE: + evalcase(n, flags); + break; + case NDEFUN: + defun(n->narg.text, n->narg.next); exitstatus = 0; - break; - } - case NWHILE: - case NUNTIL: - evalloop(n, flags & ~EV_EXIT); - break; - case NFOR: - evalfor(n, flags & ~EV_EXIT); - break; - case NCASE: - evalcase(n, flags); - break; - case NDEFUN: - defun(n->narg.text, n->narg.next); - exitstatus = 0; - break; - case NNOT: - evaltree(n->nnot.com, EV_TESTED); - exitstatus = !exitstatus; - break; - - case NPIPE: - evalpipe(n); - do_etest = !(flags & EV_TESTED); - break; - case NCMD: - evalcommand(n, flags, (struct backcmd *)NULL); - do_etest = !(flags & EV_TESTED); - break; - default: - out1fmt("Node type = %d\n", n->type); - flushout(&output); - break; - } - n = next; + break; + case NNOT: + evaltree(n->nnot.com, EV_TESTED); + exitstatus = !exitstatus; + break; + + case NPIPE: + evalpipe(n); + do_etest = !(flags & EV_TESTED); + break; + case NCMD: + evalcommand(n, flags, (struct backcmd *)NULL); + do_etest = !(flags & EV_TESTED); + break; + default: + out1fmt("Node type = %d\n", n->type); + flushout(&output); + break; + } + n = next; } while (n != NULL); out: if (pendingsigs) From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 15:07:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F31E106566B; Sun, 31 Oct 2010 15:07:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9D88FC18; Sun, 31 Oct 2010 15:07:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VF7Adi093124; Sun, 31 Oct 2010 15:07:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VF7AxF093122; Sun, 31 Oct 2010 15:07:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010311507.o9VF7AxF093122@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 31 Oct 2010 15:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214601 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 15:07:10 -0000 Author: nwhitehorn Date: Sun Oct 31 15:07:09 2010 New Revision: 214601 URL: http://svn.freebsd.org/changeset/base/214601 Log: Add some missing parentheses so that moea_bat_mapped() actually works. Submitted by: alc MFC after: 3 days Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sun Oct 31 12:08:16 2010 (r214600) +++ head/sys/powerpc/aim/mmu_oea.c Sun Oct 31 15:07:09 2010 (r214601) @@ -2430,7 +2430,7 @@ moea_bat_mapped(int idx, vm_offset_t pa, /* * Return immediately if not a valid mapping */ - if (!battable[idx].batu & BAT_Vs) + if (!(battable[idx].batu & BAT_Vs)) return (EINVAL); /* From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 16:06:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50B0E1065672; Sun, 31 Oct 2010 16:06:50 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id AE7898FC19; Sun, 31 Oct 2010 16:06:49 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 548AB45E5C; Sun, 31 Oct 2010 17:06:47 +0100 (CET) Received: from localhost (chello089073192049.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id A64E145CD9; Sun, 31 Oct 2010 17:06:41 +0100 (CET) Date: Sun, 31 Oct 2010 17:06:03 +0100 From: Pawel Jakub Dawidek To: Ulrich Spoerlein Message-ID: <20101031160603.GD2160@garage.freebsd.pl> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q9KOos5vDmpwPx9o" Content-Disposition: inline In-Reply-To: <201010310921.o9V9LSo4075408@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 16:06:50 -0000 --q9KOos5vDmpwPx9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 31, 2010 at 09:21:28AM +0000, Ulrich Spoerlein wrote: > Author: uqs > Date: Sun Oct 31 09:21:27 2010 > New Revision: 214596 > URL: http://svn.freebsd.org/changeset/base/214596 >=20 > Log: > Elaborate some more on the non-security implications of using -P [...] > +.Pp > +N.B.: The > +.Fl P > +flag is not considered a security feature > +.Pq see Sx BUGS . I'm sorry for jumping so late into the subject, but if it is not a security feature than what other purpose has left? Really guys, this option is useless. There is no reliable way to verify if the blocks are really overwritten. Period. If it is not used for security, then I see no other use for it (except for [1]). If it is used for security then we better have a way to give the user the right answer to the question "is my data really gone?" and don't make false assumptions or giving answers "we hope so". Why there is no reliable way to verify this? 1. Check file system type (UFS, ZFS). 2. Check file system configuration (UFS with snapshots?). 3. Be sure sync(2) the file system and send BIO_FLUSH to all the media involved (some cheap flash disks lie about BIO_FLUSH support). 4. Check underlying media (GLABEL provider - no modification to the data). 5. Check underlying media (ZVOL - data won't be overwritten, but...). 6. Check ZFS vdevs (on which providers ZVOL's pool is based on). 7. Check vdevs (GELI - cool, we have encryption). 8. Check GELI configuration (maybe NULL encryption algorithm?). 9. Check underlying media (HDD, SSD, swap-backed md(4) device? goto 3). 10. Check if the sectors weren't remapped while we were overwriting. In other words this is soooo complicated that it would simply be too hard to explain to regular user or implement in rm(1). IMHO this option should be removed and rm(1) should fail when a user is trying to use it. [1] When we have UFS file system on top of ZVOL with compression enabled, overwriting file content with zero bytes should convert blocks into holes, which will free some space - a usage definitely not worth keeping -P around. :) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --q9KOos5vDmpwPx9o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEUEARECAAYFAkzNk+sACgkQForvXbEpPzRhDgCYhFyFcevDUrN4msCrn8c0rADf UwCeKa5aw17CNdnoVcXfXXXJdr6m+AI= =9aU6 -----END PGP SIGNATURE----- --q9KOos5vDmpwPx9o-- From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 17:31:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 354D91065674; Sun, 31 Oct 2010 17:31:19 +0000 (UTC) Date: Sun, 31 Oct 2010 17:31:19 +0000 From: Alexander Best To: Pawel Jakub Dawidek Message-ID: <20101031173119.GA12918@freebsd.org> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101031160603.GD2160@garage.freebsd.pl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ulrich Spoerlein Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 17:31:19 -0000 On Sun Oct 31 10, Pawel Jakub Dawidek wrote: > On Sun, Oct 31, 2010 at 09:21:28AM +0000, Ulrich Spoerlein wrote: > > Author: uqs > > Date: Sun Oct 31 09:21:27 2010 > > New Revision: 214596 > > URL: http://svn.freebsd.org/changeset/base/214596 > > > > Log: > > Elaborate some more on the non-security implications of using -P > [...] > > +.Pp > > +N.B.: The > > +.Fl P > > +flag is not considered a security feature > > +.Pq see Sx BUGS . > > I'm sorry for jumping so late into the subject, but if it is not a > security feature than what other purpose has left? > > Really guys, this option is useless. i suggested to remove it and also came up with a patch [1], but quite a lot of developers decided the -P option should be kept rather than removed. although there was quite an elaborate discussion about it that followed after des@ commited r214431, i still haven't got the slightest idea just WHY it should stay. ;) [1] http://www.mail-archive.com/svn-src-head@freebsd.org/msg07404.html cheers. alex > > There is no reliable way to verify if the blocks are really overwritten. > Period. > > If it is not used for security, then I see no other use for it (except > for [1]). > > If it is used for security then we better have a way to give the user > the right answer to the question "is my data really gone?" and don't > make false assumptions or giving answers "we hope so". > > Why there is no reliable way to verify this? > 1. Check file system type (UFS, ZFS). > 2. Check file system configuration (UFS with snapshots?). > 3. Be sure sync(2) the file system and send BIO_FLUSH to all the media > involved (some cheap flash disks lie about BIO_FLUSH support). > 4. Check underlying media (GLABEL provider - no modification to the data). > 5. Check underlying media (ZVOL - data won't be overwritten, but...). > 6. Check ZFS vdevs (on which providers ZVOL's pool is based on). > 7. Check vdevs (GELI - cool, we have encryption). > 8. Check GELI configuration (maybe NULL encryption algorithm?). > 9. Check underlying media (HDD, SSD, swap-backed md(4) device? goto 3). > 10. Check if the sectors weren't remapped while we were overwriting. > > In other words this is soooo complicated that it would simply be too > hard to explain to regular user or implement in rm(1). > > IMHO this option should be removed and rm(1) should fail when a user is > trying to use it. > > [1] When we have UFS file system on top of ZVOL with compression > enabled, overwriting file content with zero bytes should convert blocks > into holes, which will free some space - a usage definitely not worth > keeping -P around. :) > > -- > Pawel Jakub Dawidek http://www.wheelsystems.com > pjd@FreeBSD.org http://www.FreeBSD.org > FreeBSD committer Am I Evil? Yes, I Am! -- a13x From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 18:19:13 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 341D2106566B; Sun, 31 Oct 2010 18:19:13 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 118A98FC12; Sun, 31 Oct 2010 18:19:12 +0000 (UTC) Received: from [10.123.2.178] (DIR-655 [192.168.1.65]) by monday.kientzle.com (8.14.3/8.14.3) with ESMTP id o9VHmhX5030159; Sun, 31 Oct 2010 17:48:43 GMT (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <20101031160603.GD2160@garage.freebsd.pl> Date: Sun, 31 Oct 2010 10:48:45 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ulrich Spoerlein Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 18:19:13 -0000 On Oct 31, 2010, at 9:06 AM, Pawel Jakub Dawidek wrote: > On Sun, Oct 31, 2010 at 09:21:28AM +0000, Ulrich Spoerlein wrote: >> Author: uqs >> Date: Sun Oct 31 09:21:27 2010 >> New Revision: 214596 >> URL: http://svn.freebsd.org/changeset/base/214596 >> >> Log: >> Elaborate some more on the non-security implications of using -P > [...] >> +.Pp >> +N.B.: The >> +.Fl P >> +flag is not considered a security feature >> +.Pq see Sx BUGS . > > I'm sorry for jumping so late into the subject, but if it is not a > security feature than what other purpose has left? > > Really guys, this option is useless. I completely agree. > There is no reliable way to verify if the blocks are really overwritten. > Period. Not from userspace, no. I think the only reasonable approach is to add a new syscall (unlink_with_overwrite(2)?) and chase the implications down through the filesystem, GEOM, and driver interfaces. Tim From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 18:27:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0860E106564A; Sun, 31 Oct 2010 18:27:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD6288FC08; Sun, 31 Oct 2010 18:27:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VIR5Nj099567; Sun, 31 Oct 2010 18:27:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VIR5PF099556; Sun, 31 Oct 2010 18:27:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010311827.o9VIR5PF099556@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 31 Oct 2010 18:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214603 - in head/sys: conf dev/agp modules modules/agp powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 18:27:06 -0000 Author: nwhitehorn Date: Sun Oct 31 18:27:05 2010 New Revision: 214603 URL: http://svn.freebsd.org/changeset/base/214603 Log: Add a driver for the Apple Uninorth AGP host bridge found in all PowerPC Macintoshes with an AGP bus. Added: head/sys/dev/agp/agp_apple.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/conf/options.powerpc head/sys/dev/agp/agp.c head/sys/modules/Makefile head/sys/modules/agp/Makefile head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/NOTES Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Oct 31 16:54:50 2010 (r214602) +++ head/sys/conf/files.powerpc Sun Oct 31 18:27:05 2010 (r214603) @@ -22,6 +22,7 @@ dev/adb/adb_kbd.c optional adb dev/adb/adb_mouse.c optional adb dev/adb/adb_hb_if.m optional adb dev/adb/adb_if.m optional adb +dev/agp/agp_apple.c optional agp powermac dev/cfi/cfi_bus_fdt.c optional cfi fdt dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Sun Oct 31 16:54:50 2010 (r214602) +++ head/sys/conf/options.powerpc Sun Oct 31 18:27:05 2010 (r214603) @@ -23,3 +23,7 @@ PSIM SC_OFWFB opt_ofwfb.h OFWCONS_POLL_HZ opt_ofw.h + +# AGP debugging support +AGP_DEBUG opt_agp.h + Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Sun Oct 31 16:54:50 2010 (r214602) +++ head/sys/dev/agp/agp.c Sun Oct 31 18:27:05 2010 (r214603) @@ -219,13 +219,16 @@ agp_generic_attach(device_t dev) * Find and map the aperture, RF_SHAREABLE for DRM but not RF_ACTIVE * because the kernel doesn't need to map it. */ - if (sc->as_aperture_rid == 0) - sc->as_aperture_rid = AGP_APBASE; - sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->as_aperture_rid, RF_SHAREABLE); - if (!sc->as_aperture) - return ENOMEM; + if (sc->as_aperture_rid != -1) { + if (sc->as_aperture_rid == 0) + sc->as_aperture_rid = AGP_APBASE; + + sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->as_aperture_rid, RF_SHAREABLE); + if (!sc->as_aperture) + return ENOMEM; + } /* * Work out an upper bound for agp memory allocation. This @@ -272,8 +275,9 @@ agp_free_res(device_t dev) { struct agp_softc *sc = device_get_softc(dev); - bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid, - sc->as_aperture); + if (sc->as_aperture != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid, + sc->as_aperture); mtx_destroy(&sc->as_lock); agp_flush_cache(); } @@ -729,7 +733,10 @@ agp_info_user(device_t dev, agp_info *in info->bridge_id = pci_get_devid(dev); info->agp_mode = pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); - info->aper_base = rman_get_start(sc->as_aperture); + if (sc->as_aperture) + info->aper_base = rman_get_start(sc->as_aperture); + else + info->aper_base = 0; info->aper_size = AGP_GET_APERTURE(dev) >> 20; info->pg_total = info->pg_system = sc->as_maxmem >> AGP_PAGE_SHIFT; info->pg_used = sc->as_allocated >> AGP_PAGE_SHIFT; @@ -876,6 +883,8 @@ agp_mmap(struct cdev *kdev, vm_ooffset_t if (offset > AGP_GET_APERTURE(dev)) return -1; + if (sc->as_aperture == NULL) + return -1; *paddr = rman_get_start(sc->as_aperture) + offset; return 0; } @@ -917,8 +926,11 @@ agp_get_info(device_t dev, struct agp_in info->ai_mode = pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4); - info->ai_aperture_base = rman_get_start(sc->as_aperture); - info->ai_aperture_size = rman_get_size(sc->as_aperture); + if (sc->as_aperture != NULL) + info->ai_aperture_base = rman_get_start(sc->as_aperture); + else + info->ai_aperture_base = 0; + info->ai_aperture_size = AGP_GET_APERTURE(dev); info->ai_memory_allowed = sc->as_maxmem; info->ai_memory_used = sc->as_allocated; } Added: head/sys/dev/agp/agp_apple.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/agp/agp_apple.c Sun Oct 31 18:27:05 2010 (r214603) @@ -0,0 +1,302 @@ +/*- + * Copyright (c) 2010 Nathan Whitehorn + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#define UNIN_AGP_GART_BASE 0x8c +#define UNIN_AGP_BASE_ADDR 0x90 +#define UNIN_AGP_GART_CONTROL 0x94 + +#define UNIN_AGP_GART_INVAL 0x00000001 +#define UNIN_AGP_GART_ENABLE 0x00000100 +#define UNIN_AGP_GART_2XRESET 0x00010000 +#define UNIN_AGP_U3_GART_PERFRD 0x00080000 + +struct agp_apple_softc { + struct agp_softc agp; + uint32_t aperture; + struct agp_gatt *gatt; + int u3; + int needs_2x_reset; +}; + +static int +agp_apple_probe(device_t dev) +{ + + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); + + if (pci_get_class(dev) != PCIC_BRIDGE + || pci_get_subclass(dev) != PCIS_BRIDGE_HOST) + return (ENXIO); + + if (agp_find_caps(dev) == 0) + return (ENXIO); + + if (pci_get_class(dev) != PCIC_BRIDGE + || pci_get_subclass(dev) != PCIS_BRIDGE_HOST) + return (ENXIO); + + switch (pci_get_devid(dev)) { + case 0x0020106b: + case 0x0027106b: + device_set_desc(dev, "Apple UniNorth AGP Bridge"); + return (BUS_PROBE_DEFAULT); + case 0x002d106b: + device_set_desc(dev, "Apple UniNorth 1.5 AGP Bridge"); + return (BUS_PROBE_DEFAULT); + case 0x0034106b: + device_set_desc(dev, "Apple UniNorth 2 AGP Bridge"); + return (BUS_PROBE_DEFAULT); + case 0x004b106b: + case 0x0058106b: + case 0x0059106b: + device_set_desc(dev, "Apple U3 AGP Bridge"); + return (BUS_PROBE_DEFAULT); + case 0x0066106b: + device_set_desc(dev, "Apple Intrepid AGP Bridge"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +agp_apple_attach(device_t dev) +{ + struct agp_apple_softc *sc = device_get_softc(dev); + int error; + + /* Record quirks */ + sc->needs_2x_reset = 0; + sc->u3 = 0; + switch (pci_get_devid(dev)) { + case 0x0020106b: + case 0x0027106b: + sc->needs_2x_reset = 1; + break; + case 0x004b106b: + case 0x0058106b: + case 0x0059106b: + sc->u3 = 1; + break; + } + + /* Set the aperture bus address base (must be 0) */ + pci_write_config(dev, UNIN_AGP_BASE_ADDR, 0, 4); + agp_set_aperture_resource(dev, -1); + + error = agp_generic_attach(dev); + if (error) + return (error); + + sc->aperture = 256*1024*1024; + + for (sc->aperture = 256*1024*1024; sc->aperture >= 4*1024*1024; + sc->aperture /= 2) { + sc->gatt = agp_alloc_gatt(dev); + if (sc->gatt) + break; + } + if (sc->aperture < 4*1024*1024) { + agp_generic_detach(dev); + return ENOMEM; + } + + /* Install the gatt. */ + AGP_SET_APERTURE(dev, sc->aperture); + + /* XXX: U3 scratch page? */ + + /* Enable the aperture and TLB. */ + AGP_FLUSH_TLB(dev); + + return (0); +} + +static int +agp_apple_detach(device_t dev) +{ + struct agp_apple_softc *sc = device_get_softc(dev); + + agp_free_cdev(dev); + + /* Disable the aperture and TLB */ + pci_write_config(dev, UNIN_AGP_GART_CONTROL, UNIN_AGP_GART_INVAL, 4); + pci_write_config(dev, UNIN_AGP_GART_CONTROL, 0, 4); + + if (sc->needs_2x_reset) { + pci_write_config(dev, UNIN_AGP_GART_CONTROL, + UNIN_AGP_GART_2XRESET, 4); + pci_write_config(dev, UNIN_AGP_GART_CONTROL, 0, 4); + } + + AGP_SET_APERTURE(dev, 0); + + agp_free_gatt(sc->gatt); + agp_free_res(dev); + return 0; +} + +static uint32_t +agp_apple_get_aperture(device_t dev) +{ + struct agp_apple_softc *sc = device_get_softc(dev); + + return (sc->aperture); +} + +static int +agp_apple_set_aperture(device_t dev, uint32_t aperture) +{ + struct agp_apple_softc *sc = device_get_softc(dev); + + /* + * Check for a multiple of 4 MB and make sure it is within the + * programmable range. + */ + if (aperture % (4*1024*1024) + || aperture < 4*1024*1024 + || aperture > ((sc->u3) ? 512 : 256)*1024*1024) + return EINVAL; + + /* The aperture value is a multiple of 4 MB */ + aperture /= (4*1024*1024); + + pci_write_config(dev, UNIN_AGP_GART_BASE, + (sc->gatt->ag_physical & 0xfffff000) | aperture, 4); + + return (0); +} + +static int +agp_apple_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) +{ + struct agp_apple_softc *sc = device_get_softc(dev); + + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + return EINVAL; + + sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; + __asm __volatile("dcbst 0,%0; sync" :: + "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); + return (0); +} + +static int +agp_apple_unbind_page(device_t dev, vm_offset_t offset) +{ + struct agp_apple_softc *sc = device_get_softc(dev); + + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + return EINVAL; + + sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; + __asm __volatile("dcbst 0,%0; sync" :: + "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); + return (0); +} + +static void +agp_apple_flush_tlb(device_t dev) +{ + struct agp_apple_softc *sc = device_get_softc(dev); + uint32_t cntrl = UNIN_AGP_GART_ENABLE; + + if (sc->u3) + cntrl |= UNIN_AGP_U3_GART_PERFRD; + + pci_write_config(dev, UNIN_AGP_GART_CONTROL, + cntrl | UNIN_AGP_GART_INVAL, 4); + pci_write_config(dev, UNIN_AGP_GART_CONTROL, cntrl, 4); + + if (sc->needs_2x_reset) { + pci_write_config(dev, UNIN_AGP_GART_CONTROL, + cntrl | UNIN_AGP_GART_2XRESET, 4); + pci_write_config(dev, UNIN_AGP_GART_CONTROL, cntrl, 4); + } +} + +static device_method_t agp_apple_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, agp_apple_probe), + DEVMETHOD(device_attach, agp_apple_attach), + DEVMETHOD(device_detach, agp_apple_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* AGP interface */ + DEVMETHOD(agp_get_aperture, agp_apple_get_aperture), + DEVMETHOD(agp_set_aperture, agp_apple_set_aperture), + DEVMETHOD(agp_bind_page, agp_apple_bind_page), + DEVMETHOD(agp_unbind_page, agp_apple_unbind_page), + DEVMETHOD(agp_flush_tlb, agp_apple_flush_tlb), + DEVMETHOD(agp_enable, agp_generic_enable), + DEVMETHOD(agp_alloc_memory, agp_generic_alloc_memory), + DEVMETHOD(agp_free_memory, agp_generic_free_memory), + DEVMETHOD(agp_bind_memory, agp_generic_bind_memory), + DEVMETHOD(agp_unbind_memory, agp_generic_unbind_memory), + + { 0, 0 } +}; + +static driver_t agp_apple_driver = { + "agp", + agp_apple_methods, + sizeof(struct agp_apple_softc), +}; + +static devclass_t agp_devclass; + +DRIVER_MODULE(agp_apple, hostb, agp_apple_driver, agp_devclass, 0, 0); +MODULE_DEPEND(agp_apple, agp, 1, 1, 1); +MODULE_DEPEND(agp_apple, pci, 1, 1, 1); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Oct 31 16:54:50 2010 (r214602) +++ head/sys/modules/Makefile Sun Oct 31 18:27:05 2010 (r214603) @@ -631,6 +631,7 @@ _xe= xe .endif .if ${MACHINE_CPUARCH} == "powerpc" +_agp= agp _an= an _bm= bm _cpufreq= cpufreq Modified: head/sys/modules/agp/Makefile ============================================================================== --- head/sys/modules/agp/Makefile Sun Oct 31 16:54:50 2010 (r214602) +++ head/sys/modules/agp/Makefile Sun Oct 31 18:27:05 2010 (r214603) @@ -11,9 +11,12 @@ SRCS+= agp_i810.c agp_intel.c agp_via.c .if ${MACHINE} == "i386" SRCS+= agp_amd64.c .endif -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= agp_amd64.c agp_i810.c agp_via.c .endif +.if ${MACHINE_CPUARCH} == "powerpc" +SRCS+= agp_apple.c +.endif SRCS+= device_if.h bus_if.h agp_if.h pci_if.h SRCS+= opt_agp.h opt_bus.h MFILES= kern/device_if.m kern/bus_if.m dev/agp/agp_if.m dev/pci/pci_if.m Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Oct 31 16:54:50 2010 (r214602) +++ head/sys/powerpc/conf/GENERIC Sun Oct 31 18:27:05 2010 (r214603) @@ -84,6 +84,7 @@ device cpufreq # Standard busses device pci +device agp # ATA and ATAPI devices device ata Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Sun Oct 31 16:54:50 2010 (r214602) +++ head/sys/powerpc/conf/GENERIC64 Sun Oct 31 18:27:05 2010 (r214603) @@ -83,6 +83,7 @@ device cpufreq # Standard busses device pci +device agp # ATA and ATAPI devices device ata Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Sun Oct 31 16:54:50 2010 (r214602) +++ head/sys/powerpc/conf/NOTES Sun Oct 31 18:27:05 2010 (r214603) @@ -30,6 +30,7 @@ device cpufreq # Standard busses device pci +device agp device bm # Apple BMAC (Big Mac Ethernet) device kiic # Apple Keywest I2C Controller From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 19:11:22 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FDC11065670; Sun, 31 Oct 2010 19:11:22 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 3DEDC8FC12; Sun, 31 Oct 2010 19:11:22 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o9VJBKQm021512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Oct 2010 20:11:20 +0100 (CET) (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o9VJBKGX021511; Sun, 31 Oct 2010 20:11:20 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Sun, 31 Oct 2010 20:11:19 +0100 From: Ulrich Spoerlein To: Pawel Jakub Dawidek Message-ID: <20101031191119.GM46314@acme.spoerlein.net> Mail-Followup-To: Ulrich Spoerlein , Pawel Jakub Dawidek , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101031160603.GD2160@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 19:11:22 -0000 On Sun, 31.10.2010 at 17:06:03 +0100, Pawel Jakub Dawidek wrote: > On Sun, Oct 31, 2010 at 09:21:28AM +0000, Ulrich Spoerlein wrote: > > Author: uqs > > Date: Sun Oct 31 09:21:27 2010 > > New Revision: 214596 > > URL: http://svn.freebsd.org/changeset/base/214596 > > > > Log: > > Elaborate some more on the non-security implications of using -P > [...] > > +.Pp > > +N.B.: The > > +.Fl P > > +flag is not considered a security feature > > +.Pq see Sx BUGS . > > I'm sorry for jumping so late into the subject, but if it is not a > security feature than what other purpose has left? > > Really guys, this option is useless. > > There is no reliable way to verify if the blocks are really overwritten. > Period. > > If it is not used for security, then I see no other use for it (except > for [1]). > > If it is used for security then we better have a way to give the user > the right answer to the question "is my data really gone?" and don't > make false assumptions or giving answers "we hope so". > > Why there is no reliable way to verify this? > 1. Check file system type (UFS, ZFS). > 2. Check file system configuration (UFS with snapshots?). > 3. Be sure sync(2) the file system and send BIO_FLUSH to all the media > involved (some cheap flash disks lie about BIO_FLUSH support). > 4. Check underlying media (GLABEL provider - no modification to the data). > 5. Check underlying media (ZVOL - data won't be overwritten, but...). > 6. Check ZFS vdevs (on which providers ZVOL's pool is based on). > 7. Check vdevs (GELI - cool, we have encryption). > 8. Check GELI configuration (maybe NULL encryption algorithm?). > 9. Check underlying media (HDD, SSD, swap-backed md(4) device? goto 3). > 10. Check if the sectors weren't remapped while we were overwriting. > > In other words this is soooo complicated that it would simply be too > hard to explain to regular user or implement in rm(1). > > IMHO this option should be removed and rm(1) should fail when a user is > trying to use it. No, this is a POLA violation for no apparent gain. The flag has been in FreeBSD since at least '94. Remember, that we are in the rope-selling business. We empower the users to shoot themselves in the foot. I, for one, am using the -P option in a certain case where I can be sure that ~99% of the data will be obliterated and I'm fine with that. For all other cases I'm using geli or gbde (where I can make sure, that data is lost). So we can either fix -P for all cases (impossible), or at least document its shortcomings. Documenting them clearly is better than what we had a couple of days before. Uli From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 19:16:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8549A1065673; Sun, 31 Oct 2010 19:16:54 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 745488FC15; Sun, 31 Oct 2010 19:16:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VJGsif001151; Sun, 31 Oct 2010 19:16:54 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VJGsmC001149; Sun, 31 Oct 2010 19:16:54 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201010311916.o9VJGsmC001149@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 31 Oct 2010 19:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214604 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 19:16:54 -0000 Author: uqs Date: Sun Oct 31 19:16:54 2010 New Revision: 214604 URL: http://svn.freebsd.org/changeset/base/214604 Log: Fix typo and grammar nit Submitted by: arundel MFC after: 7 days (or when the bikeshed has abated) Modified: head/bin/rm/rm.1 Modified: head/bin/rm/rm.1 ============================================================================== --- head/bin/rm/rm.1 Sun Oct 31 18:27:05 2010 (r214603) +++ head/bin/rm/rm.1 Sun Oct 31 19:16:54 2010 (r214604) @@ -234,12 +234,12 @@ command appeared in .Sh BUGS The .Fl P -option assumes that the underlying storage overwrites file block +option assumes that the underlying storage overwrites file blocks when data is written to an existing offset. Several factors including the file system and its backing store could defeat this assumption. This includes, but is not limited to file systems that use a Copy-On-Write strategy (e.g. ZFS or UFS when snapshots are being used), Flash -media that is using a wear leveling algorithm, or when the backing datastore +media that are using a wear leveling algorithm, or when the backing datastore does journaling, etc. In addition, only regular files are overwritten, other types of files are not. From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 19:50:55 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16E25106566C; Sun, 31 Oct 2010 19:50:55 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id ADBF18FC13; Sun, 31 Oct 2010 19:50:49 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 91FE745CAC; Sun, 31 Oct 2010 20:50:47 +0100 (CET) Received: from localhost (chello089073192049.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E33B245C8A; Sun, 31 Oct 2010 20:50:41 +0100 (CET) Date: Sun, 31 Oct 2010 20:50:03 +0100 From: Pawel Jakub Dawidek To: Ulrich Spoerlein , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20101031195003.GE2160@garage.freebsd.pl> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> <20101031191119.GM46314@acme.spoerlein.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5oH/S/bF6lOfqCQb" Content-Disposition: inline In-Reply-To: <20101031191119.GM46314@acme.spoerlein.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 19:50:55 -0000 --5oH/S/bF6lOfqCQb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 31, 2010 at 08:11:19PM +0100, Ulrich Spoerlein wrote: > On Sun, 31.10.2010 at 17:06:03 +0100, Pawel Jakub Dawidek wrote: > > IMHO this option should be removed and rm(1) should fail when a user is > > trying to use it. >=20 > No, this is a POLA violation for no apparent gain. The flag has been in > FreeBSD since at least '94. Remember, that we are in the rope-selling > business. We empower the users to shoot themselves in the foot. >=20 > I, for one, am using the -P option in a certain case where I can be sure > that ~99% of the data will be obliterated and I'm fine with that. For > all other cases I'm using geli or gbde (where I can make sure, that data > is lost). The question remains unanswered: If it is not a security feature then what's the purpose? IMHO this is a security feature, just a really lame one. Too many requirements have to be meet to make it work.=20 I don't think you would want to read in GELI or GBDE manual page that it encrypts the data sometimes, or if all the given requirements are meet. Of course requirements are fine, but they have to be really clear to the user and the list should be as short as possible, which is not the case here. > So we can either fix -P for all cases (impossible), or at least document > its shortcomings. Documenting them clearly is better than what we had a > couple of days before. I don't argue that the previous version of manual page was better I just pick your commit to discuss it mentioned functionality further. Maybe we could implement few simple checks which when satisfied don't emit a warning, ie. if this is UFS, on top of partition, on top of a slice and on top of a regular SCSI or SATA disk don't emit a warning, but if there is a doubt, do emit a warning. This might not be trivial, but might be doable. Alternatively we could always emit a warning. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --5oH/S/bF6lOfqCQb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkzNyGsACgkQForvXbEpPzT4yACg7TwsX93Bsgp2iIzgDbjbQLw8 prUAoIKipWPTiD3irUKPavBvNus31g2Q =ALQ7 -----END PGP SIGNATURE----- --5oH/S/bF6lOfqCQb-- From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 19:57:59 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AAC41065673; Sun, 31 Oct 2010 19:57:59 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id D4D3B8FC1A; Sun, 31 Oct 2010 19:57:58 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o9VJvvN9046220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Oct 2010 20:57:58 +0100 (CET) (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o9VJvvmf046219; Sun, 31 Oct 2010 20:57:57 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Sun, 31 Oct 2010 20:57:57 +0100 From: Ulrich Spoerlein To: Pawel Jakub Dawidek Message-ID: <20101031195757.GO46314@acme.spoerlein.net> Mail-Followup-To: Ulrich Spoerlein , Pawel Jakub Dawidek , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> <20101031191119.GM46314@acme.spoerlein.net> <20101031195003.GE2160@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101031195003.GE2160@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 19:57:59 -0000 On Sun, 31.10.2010 at 20:50:03 +0100, Pawel Jakub Dawidek wrote: > On Sun, Oct 31, 2010 at 08:11:19PM +0100, Ulrich Spoerlein wrote: > > On Sun, 31.10.2010 at 17:06:03 +0100, Pawel Jakub Dawidek wrote: > > > IMHO this option should be removed and rm(1) should fail when a user is > > > trying to use it. > > > > No, this is a POLA violation for no apparent gain. The flag has been in > > FreeBSD since at least '94. Remember, that we are in the rope-selling > > business. We empower the users to shoot themselves in the foot. > > > > I, for one, am using the -P option in a certain case where I can be sure > > that ~99% of the data will be obliterated and I'm fine with that. For > > all other cases I'm using geli or gbde (where I can make sure, that data > > is lost). > > The question remains unanswered: If it is not a security feature then > what's the purpose? > > IMHO this is a security feature, just a really lame one. Too many > requirements have to be meet to make it work. > > I don't think you would want to read in GELI or GBDE manual page that it > encrypts the data sometimes, or if all the given requirements are meet. > Of course requirements are fine, but they have to be really clear to the > user and the list should be as short as possible, which is not the case > here. True, this was obviously the case when the feature was introduced, a couple of years ago. As things change constantly, it may never be possible to have it work (and not break silently in the future). > > So we can either fix -P for all cases (impossible), or at least document > > its shortcomings. Documenting them clearly is better than what we had a > > couple of days before. > > I don't argue that the previous version of manual page was better I just > pick your commit to discuss it mentioned functionality further. Sorry, if my post came across a bit harsh. I only tried to document the current behaviour a bit more clearly, and perhaps give the user a warning that this feature might not do what it did 16 years ago. > Maybe we could implement few simple checks which when satisfied don't > emit a warning, ie. if this is UFS, on top of partition, on top of a > slice and on top of a regular SCSI or SATA disk don't emit a warning, > but if there is a doubt, do emit a warning. This might not be trivial, > but might be doable. Alternatively we could always emit a warning. Knock yourself out, code speaks louder than words ... Uli From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 22:41:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AA12106566B; Sun, 31 Oct 2010 22:41:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 196568FC1B; Sun, 31 Oct 2010 22:41:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VMfrVD009987; Sun, 31 Oct 2010 22:41:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VMfrYo009985; Sun, 31 Oct 2010 22:41:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010312241.o9VMfrYo009985@svn.freebsd.org> From: Marius Strobl Date: Sun, 31 Oct 2010 22:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214605 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 22:41:54 -0000 Author: marius Date: Sun Oct 31 22:41:53 2010 New Revision: 214605 URL: http://svn.freebsd.org/changeset/base/214605 Log: Make a comment reflect reality. Modified: head/sys/dev/mii/miivar.h Modified: head/sys/dev/mii/miivar.h ============================================================================== --- head/sys/dev/mii/miivar.h Sun Oct 31 19:16:54 2010 (r214604) +++ head/sys/dev/mii/miivar.h Sun Oct 31 22:41:53 2010 (r214605) @@ -148,7 +148,7 @@ typedef struct mii_softc mii_softc_t; /* * Special `locators' passed to mii_attach(). If one of these is not * an `any' value, we look for *that* PHY and configure it. If both - * are not `any', that is an error, and mii_attach() will panic. + * are not `any', that is an error, and mii_attach() will fail. */ #define MII_OFFSET_ANY -1 #define MII_PHY_ANY -1 From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 22:46:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 691E91065674; Sun, 31 Oct 2010 22:46:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5745B8FC14; Sun, 31 Oct 2010 22:46:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VMkdP5010259; Sun, 31 Oct 2010 22:46:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VMkdVp010256; Sun, 31 Oct 2010 22:46:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010312246.o9VMkdVp010256@svn.freebsd.org> From: Marius Strobl Date: Sun, 31 Oct 2010 22:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214606 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 22:46:39 -0000 Author: marius Date: Sun Oct 31 22:46:39 2010 New Revision: 214606 URL: http://svn.freebsd.org/changeset/base/214606 Log: Try to make the style consistent (including regarding NetBSD bits not yet merged) and adhere style(9). Modified: head/sys/dev/mii/mii_physubr.c Modified: head/sys/dev/mii/mii_physubr.c ============================================================================== --- head/sys/dev/mii/mii_physubr.c Sun Oct 31 22:41:53 2010 (r214605) +++ head/sys/dev/mii/mii_physubr.c Sun Oct 31 22:46:39 2010 (r214606) @@ -107,8 +107,8 @@ mii_phy_setmedia(struct mii_softc *sc) if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) { if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || - (sc->mii_flags & MIIF_FORCEANEG)) - (void) mii_phy_auto(sc); + (sc->mii_flags & MIIF_FORCEANEG) != 0) + (void)mii_phy_auto(sc); return; } @@ -124,10 +124,10 @@ mii_phy_setmedia(struct mii_softc *sc) bmcr = mii_media_table[ife->ifm_data].mm_bmcr; gtcr = mii_media_table[ife->ifm_data].mm_gtcr; - if (mii->mii_media.ifm_media & IFM_ETH_MASTER) { + if ((mii->mii_media.ifm_media & IFM_ETH_MASTER) != 0) { switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_1000_T: - gtcr |= GTCR_MAN_MS|GTCR_ADV_MS; + gtcr |= GTCR_MAN_MS | GTCR_ADV_MS; break; default: @@ -135,53 +135,48 @@ mii_phy_setmedia(struct mii_softc *sc) } } - if (ife->ifm_media & IFM_LOOP) + if ((ife->ifm_media & IFM_LOOP) != 0) bmcr |= BMCR_LOOP; PHY_WRITE(sc, MII_ANAR, anar); PHY_WRITE(sc, MII_BMCR, bmcr); - if (sc->mii_flags & MIIF_HAVE_GTCR) + if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) PHY_WRITE(sc, MII_100T2CR, gtcr); } int mii_phy_auto(struct mii_softc *sc) { + int anar, gtcr; /* * Check for 1000BASE-X. Autonegotiation is a bit * different on such devices. */ - if (sc->mii_flags & MIIF_IS_1000X) { - uint16_t anar = 0; - - if (sc->mii_extcapabilities & EXTSR_1000XFDX) + if ((sc->mii_flags & MIIF_IS_1000X) != 0) { + anar = 0; + if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0) anar |= ANAR_X_FD; - if (sc->mii_extcapabilities & EXTSR_1000XHDX) + if ((sc->mii_extcapabilities & EXTSR_1000XHDX) != 0) anar |= ANAR_X_HD; - if (sc->mii_flags & MIIF_DOPAUSE) { + if ((sc->mii_flags & MIIF_DOPAUSE) != 0) { /* XXX Asymmetric vs. symmetric? */ anar |= ANLPAR_X_PAUSE_TOWARDS; } - PHY_WRITE(sc, MII_ANAR, anar); } else { - uint16_t anar; - anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; - if (sc->mii_flags & MIIF_DOPAUSE) + if ((sc->mii_flags & MIIF_DOPAUSE) != 0) anar |= ANAR_FC; PHY_WRITE(sc, MII_ANAR, anar); - if (sc->mii_flags & MIIF_HAVE_GTCR) { - uint16_t gtcr = 0; - - if (sc->mii_extcapabilities & EXTSR_1000TFDX) + if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { + gtcr = 0; + if ((sc->mii_extcapabilities & EXTSR_1000TFDX) != 0) gtcr |= GTCR_ADV_1000TFDX; - if (sc->mii_extcapabilities & EXTSR_1000THDX) + if ((sc->mii_extcapabilities & EXTSR_1000THDX) != 0) gtcr |= GTCR_ADV_1000THDX; - PHY_WRITE(sc, MII_100T2CR, gtcr); } } @@ -213,7 +208,7 @@ mii_phy_tick(struct mii_softc *sc) /* Read the status register twice; BMSR_LINK is latch-low. */ reg = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); - if (reg & BMSR_LINK) { + if ((reg & BMSR_LINK) != 0) { sc->mii_ticks = 0; /* reset autonegotiation timer. */ /* See above. */ return (0); @@ -243,7 +238,7 @@ mii_phy_reset(struct mii_softc *sc) struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; int reg, i; - if (sc->mii_flags & MIIF_NOISOLATE) + if ((sc->mii_flags & MIIF_NOISOLATE) != 0) reg = BMCR_RESET; else reg = BMCR_RESET | BMCR_ISO; @@ -303,7 +298,10 @@ mii_phy_add_media(struct mii_softc *sc) return; } - /* Set aneg timer for 10/100 media. Gigabit media handled below. */ + /* + * Set the autonegotiation timer for 10/100 media. Gigabit media is + * handled below. + */ sc->mii_anegticks = MII_ANEGTICKS; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -318,55 +316,54 @@ mii_phy_add_media(struct mii_softc *sc) * HomePNA PHYs. And there is really only one media type * that is supported. */ - if (sc->mii_flags & MIIF_IS_HPNA) { - if (sc->mii_capabilities & BMSR_10THDX) { + if ((sc->mii_flags & MIIF_IS_HPNA) != 0) { + if ((sc->mii_capabilities & BMSR_10THDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_HPNA_1, 0, - sc->mii_inst), - MII_MEDIA_10_T); + sc->mii_inst), MII_MEDIA_10_T); PRINT("HomePNA1"); } return; } - if (sc->mii_capabilities & BMSR_10THDX) { + if ((sc->mii_capabilities & BMSR_10THDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), MII_MEDIA_10_T); PRINT("10baseT"); } - if (sc->mii_capabilities & BMSR_10TFDX) { + if ((sc->mii_capabilities & BMSR_10TFDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), MII_MEDIA_10_T_FDX); PRINT("10baseT-FDX"); } - if (sc->mii_capabilities & BMSR_100TXHDX) { + if ((sc->mii_capabilities & BMSR_100TXHDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), MII_MEDIA_100_TX); PRINT("100baseTX"); } - if (sc->mii_capabilities & BMSR_100TXFDX) { + if ((sc->mii_capabilities & BMSR_100TXFDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), MII_MEDIA_100_TX_FDX); PRINT("100baseTX-FDX"); } - if (sc->mii_capabilities & BMSR_100T4) { + if ((sc->mii_capabilities & BMSR_100T4) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_T4, 0, sc->mii_inst), MII_MEDIA_100_T4); PRINT("100baseT4"); } - if (sc->mii_extcapabilities & EXTSR_MEDIAMASK) { + if ((sc->mii_extcapabilities & EXTSR_MEDIAMASK) != 0) { /* * XXX Right now only handle 1000SX and 1000TX. Need - * XXX to handle 1000LX and 1000CX some how. + * XXX to handle 1000LX and 1000CX somehow. */ - if (sc->mii_extcapabilities & EXTSR_1000XHDX) { + if ((sc->mii_extcapabilities & EXTSR_1000XHDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_IS_1000X; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, 0, sc->mii_inst), MII_MEDIA_1000_X); PRINT("1000baseSX"); } - if (sc->mii_extcapabilities & EXTSR_1000XFDX) { + if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_IS_1000X; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, @@ -382,7 +379,7 @@ mii_phy_add_media(struct mii_softc *sc) * * All 1000baseT PHYs have a 1000baseT control register. */ - if (sc->mii_extcapabilities & EXTSR_1000THDX) { + if ((sc->mii_extcapabilities & EXTSR_1000THDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_HAVE_GTCR; mii->mii_media.ifm_mask |= IFM_ETH_MASTER; @@ -390,7 +387,7 @@ mii_phy_add_media(struct mii_softc *sc) sc->mii_inst), MII_MEDIA_1000_T); PRINT("1000baseT"); } - if (sc->mii_extcapabilities & EXTSR_1000TFDX) { + if ((sc->mii_extcapabilities & EXTSR_1000TFDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_HAVE_GTCR; mii->mii_media.ifm_mask |= IFM_ETH_MASTER; @@ -400,7 +397,7 @@ mii_phy_add_media(struct mii_softc *sc) } } - if (sc->mii_capabilities & BMSR_ANEG) { + if ((sc->mii_capabilities & BMSR_ANEG) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), MII_NMEDIA); /* intentionally invalid index */ PRINT("auto"); @@ -418,8 +415,7 @@ mii_phy_detach(device_t dev) mii_phy_down(sc); sc->mii_dev = NULL; LIST_REMOVE(sc, mii_list); - - return(0); + return (0); } const struct mii_phydesc * @@ -452,6 +448,5 @@ mii_phy_dev_probe(device_t dev, const st device_set_desc(dev, mpd->mpd_name); return (mrv); } - return (ENXIO); } From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 22:55:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A93C106564A; Sun, 31 Oct 2010 22:55:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E8168FC17; Sun, 31 Oct 2010 22:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VMtpvG011018; Sun, 31 Oct 2010 22:55:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VMtpJY011014; Sun, 31 Oct 2010 22:55:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010312255.o9VMtpJY011014@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 31 Oct 2010 22:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214607 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 22:55:51 -0000 Author: nwhitehorn Date: Sun Oct 31 22:55:51 2010 New Revision: 214607 URL: http://svn.freebsd.org/changeset/base/214607 Log: Next-to-leading-order perturbation of synchronization operations for switching the user segment register. All races should now be closed and a minimum of pipelines flushes be required to close them. Modified: head/sys/powerpc/aim/copyinout.c head/sys/powerpc/aim/swtch32.S head/sys/powerpc/aim/swtch64.S Modified: head/sys/powerpc/aim/copyinout.c ============================================================================== --- head/sys/powerpc/aim/copyinout.c Sun Oct 31 22:46:39 2010 (r214606) +++ head/sys/powerpc/aim/copyinout.c Sun Oct 31 22:55:51 2010 (r214607) @@ -117,9 +117,9 @@ set_user_sr(pmap_t pm, const void *addr) if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == vsid) return; - __asm __volatile ("sync; mtsr %0,%1; sync; isync" :: "n"(USER_SR), - "r"(vsid)); + __asm __volatile("isync"); curthread->td_pcb->pcb_cpu.aim.usr_vsid = vsid; + __asm __volatile("mtsr %0,%1; isync" :: "n"(USER_SR), "r"(vsid)); } #endif Modified: head/sys/powerpc/aim/swtch32.S ============================================================================== --- head/sys/powerpc/aim/swtch32.S Sun Oct 31 22:46:39 2010 (r214606) +++ head/sys/powerpc/aim/swtch32.S Sun Oct 31 22:55:51 2010 (r214607) @@ -89,7 +89,6 @@ ENTRY(cpu_switch) mflr %r16 /* Save the link register */ stw %r16,PCB_LR(%r6) mfsr %r16,USER_SR /* Save USER_SR for copyin/out */ - isync stw %r16,PCB_AIM_USR_VSID(%r6) stw %r1,PCB_SP(%r6) /* Save the stack pointer */ stw %r2,PCB_TOC(%r6) /* Save the TOC pointer */ @@ -162,6 +161,7 @@ blocked_loop: lwz %r5,PCB_LR(%r3) /* Load the link register */ mtlr %r5 lwz %r5,PCB_AIM_USR_VSID(%r3) /* Load the USER_SR segment reg */ + isync mtsr USER_SR,%r5 isync lwz %r1,PCB_SP(%r3) /* Load the stack pointer */ Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Sun Oct 31 22:46:39 2010 (r214606) +++ head/sys/powerpc/aim/swtch64.S Sun Oct 31 22:55:51 2010 (r214607) @@ -113,7 +113,6 @@ ENTRY(cpu_switch) li %r15,0 /* Save user segment for copyin/out */ li %r16,USER_SLB_SLOT slbmfev %r15, %r16 - isync std %r15,PCB_AIM_USR_VSID(%r6) mr %r14,%r3 /* Copy the old thread ptr... */ @@ -222,6 +221,7 @@ blocked_loop: ori %r5,%r5,USER_ADDR@highera sldi %r5,%r5,32 oris %r5,%r5,USER_ADDR@ha + isync slbie %r5 lis %r6,USER_SLB_SLBE@highesta ori %r6,%r6,USER_SLB_SLBE@highera @@ -230,8 +230,8 @@ blocked_loop: ori %r6,%r6,USER_SLB_SLBE@l ld %r5,PCB_AIM_USR_VSID(%r3) slbmte %r5,%r6 - isync + /* * Perform a dummy stdcx. to clear any reservations we may have * inherited from the previous thread. It doesn't matter if the From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 22:59:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826B5106566C; Sun, 31 Oct 2010 22:59:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 713EE8FC0C; Sun, 31 Oct 2010 22:59:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VMxnh5011245; Sun, 31 Oct 2010 22:59:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VMxnxi011243; Sun, 31 Oct 2010 22:59:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010312259.o9VMxnxi011243@svn.freebsd.org> From: Marius Strobl Date: Sun, 31 Oct 2010 22:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214608 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 22:59:49 -0000 Author: marius Date: Sun Oct 31 22:59:49 2010 New Revision: 214608 URL: http://svn.freebsd.org/changeset/base/214608 Log: Turn a panic into a printf so IFM_ETH_MASTER on !IFM_1000_T is complained about but otherwise ignored. When allowing the master to be set manually via ifconfig(8) by adding the former to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS (as it should be) it seems to be unfavorable that a machine can be made to panic with a simple ifconfig(8) invocation. Modified: head/sys/dev/mii/mii_physubr.c Modified: head/sys/dev/mii/mii_physubr.c ============================================================================== --- head/sys/dev/mii/mii_physubr.c Sun Oct 31 22:55:51 2010 (r214607) +++ head/sys/dev/mii/mii_physubr.c Sun Oct 31 22:59:49 2010 (r214608) @@ -131,7 +131,7 @@ mii_phy_setmedia(struct mii_softc *sc) break; default: - panic("mii_phy_setmedia: MASTER on wrong media"); + printf("mii_phy_setmedia: MASTER on wrong media\n"); } } From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 23:03:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 817AB1065679; Sun, 31 Oct 2010 23:03:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 702FD8FC18; Sun, 31 Oct 2010 23:03:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VN3CmW011421; Sun, 31 Oct 2010 23:03:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VN3Ch1011419; Sun, 31 Oct 2010 23:03:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010312303.o9VN3Ch1011419@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 31 Oct 2010 23:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214609 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 23:03:12 -0000 Author: jilles Date: Sun Oct 31 23:03:11 2010 New Revision: 214609 URL: http://svn.freebsd.org/changeset/base/214609 Log: sh(1): Correct synopsis and make precise how $0 is set. In particular, the extra argument to set $0 with -c was not documented. MFC after: 1 week Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Oct 31 22:59:49 2010 (r214608) +++ head/bin/sh/sh.1 Sun Oct 31 23:03:11 2010 (r214609) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd October 16, 2010 +.Dd October 31, 2010 .Dt SH 1 .Os .Sh NAME @@ -40,9 +40,24 @@ .Nd command interpreter (shell) .Sh SYNOPSIS .Nm -.Op Fl /+abCEefIimnPpsTuVvx +.Op Fl /+abCEefIimnPpTuVvx .Op Fl /+o Ar longname -.Op Fl c Ar string +.Oo +.Ar script +.Op Ar arg ... +.Oc +.Nm +.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+o Ar longname +.Fl c Ar string +.Oo +.Ar name +.Op Ar arg ... +.Oc +.Nm +.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+o Ar longname +.Fl s .Op Ar arg ... .Sh DESCRIPTION The @@ -1109,7 +1124,12 @@ the process ID and its exit status until .Ic wait built-in command reports completion of the process. .It Li $0 -(zero) Expands to the name of the shell or shell script. +(zero) Expands to the name of the shell script if passed on the command line, +the +.Ar name +operand if given (with +.Fl c ) +or otherwise argument 0 passed to the shell. .El .Ss Special Variables The following variables are set by the shell or From owner-svn-src-head@FreeBSD.ORG Sun Oct 31 23:04:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649C6106566C; Sun, 31 Oct 2010 23:04:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533B28FC19; Sun, 31 Oct 2010 23:04:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9VN4Fai011481; Sun, 31 Oct 2010 23:04:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9VN4Fxg011479; Sun, 31 Oct 2010 23:04:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010312304.o9VN4Fxg011479@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 31 Oct 2010 23:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214610 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 23:04:15 -0000 Author: nwhitehorn Date: Sun Oct 31 23:04:15 2010 New Revision: 214610 URL: http://svn.freebsd.org/changeset/base/214610 Log: Add a security nit to recent copyin/out changes: map the user segment no-execute in case of exploitable kernel bugs. MFC after: 1 week Modified: head/sys/powerpc/aim/copyinout.c Modified: head/sys/powerpc/aim/copyinout.c ============================================================================== --- head/sys/powerpc/aim/copyinout.c Sun Oct 31 23:03:11 2010 (r214609) +++ head/sys/powerpc/aim/copyinout.c Sun Oct 31 23:04:15 2010 (r214610) @@ -95,6 +95,9 @@ set_user_sr(pmap_t pm, const void *addr) slbv = slb->slbv; } + /* Mark segment no-execute */ + slbv |= SLBV_N; + /* If we have already set this VSID, we can just return */ if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == slbv) return; @@ -117,6 +120,9 @@ set_user_sr(pmap_t pm, const void *addr) if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == vsid) return; + /* Mark segment no-execute */ + vsid |= SR_N; + __asm __volatile("isync"); curthread->td_pcb->pcb_cpu.aim.usr_vsid = vsid; __asm __volatile("mtsr %0,%1; isync" :: "n"(USER_SR), "r"(vsid)); From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 00:42:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8724106566B; Mon, 1 Nov 2010 00:42:25 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6FF08FC0C; Mon, 1 Nov 2010 00:42:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA10gPWi016329; Mon, 1 Nov 2010 00:42:25 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA10gPeg016326; Mon, 1 Nov 2010 00:42:25 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201011010042.oA10gPeg016326@svn.freebsd.org> From: David Xu Date: Mon, 1 Nov 2010 00:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214611 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 00:42:25 -0000 Author: davidxu Date: Mon Nov 1 00:42:25 2010 New Revision: 214611 URL: http://svn.freebsd.org/changeset/base/214611 Log: Use integer for size of cpuset, as it won't be bigger than INT_MAX, This is requested by bge. Also move the sysctl into file kern_cpuset.c, because it should always be there, it is independent of thread scheduler. Modified: head/sys/kern/kern_cpuset.c head/sys/kern/sched_ule.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Sun Oct 31 23:04:15 2010 (r214610) +++ head/sys/kern/kern_cpuset.c Mon Nov 1 00:42:25 2010 (r214611) @@ -107,6 +107,10 @@ static struct setlist cpuset_ids; static struct unrhdr *cpuset_unr; static struct cpuset *cpuset_zero; +/* Return the size of cpuset_t at the kernel level */ +SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD, + 0, sizeof(cpuset_t), "sizeof(cpuset_t)"); + cpuset_t *cpuset_root; /* Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Oct 31 23:04:15 2010 (r214610) +++ head/sys/kern/sched_ule.c Mon Nov 1 00:42:25 2010 (r214611) @@ -2713,7 +2713,6 @@ sysctl_kern_sched_topology_spec(SYSCTL_H return (err); } -static size_t _kern_cpuset_size = sizeof(cpuset_t); #endif SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "Scheduler"); @@ -2751,14 +2750,6 @@ SYSCTL_PROC(_kern_sched, OID_AUTO, topol CTLFLAG_RD, NULL, 0, sysctl_kern_sched_topology_spec, "A", "XML dump of detected CPU topology"); -/* - * Return the size of cpuset_t at the kernel level - * - * XXX (gcooper): replace ULONG with SIZE once CTLTYPE_SIZE is implemented. - */ -SYSCTL_ULONG(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD, - &_kern_cpuset_size, 0, "Kernel-level cpuset_t struct size"); - #endif /* ps compat. All cpu percentages from ULE are weighted. */ From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 01:51:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6282A106566C; Mon, 1 Nov 2010 01:51:48 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 189328FC18; Mon, 1 Nov 2010 01:51:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA11plQX019762; Mon, 1 Nov 2010 01:51:47 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA11plGq019760; Mon, 1 Nov 2010 01:51:47 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201011010151.oA11plGq019760@svn.freebsd.org> From: Garrett Wollman Date: Mon, 1 Nov 2010 01:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214613 - head/usr.bin/locate/locate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 01:51:48 -0000 Author: wollman Date: Mon Nov 1 01:51:47 2010 New Revision: 214613 URL: http://svn.freebsd.org/changeset/base/214613 Log: jilles@ pointed out that using ${PRUNEDIRS:=".zfs"} in updatedb.sh made it impossible to override PRUNEDIRS to make it empty. Use the non-colon form to only set PRUNEDIRS if it is completely unset. (For parallelism, the other configuration defaults here could be done the same way, but that could be more obviously accomplished by disabling updatedb in periodic.conf, so leave them alone for now.) Modified: head/usr.bin/locate/locate/updatedb.sh Modified: head/usr.bin/locate/locate/updatedb.sh ============================================================================== --- head/usr.bin/locate/locate/updatedb.sh Mon Nov 1 01:03:05 2010 (r214612) +++ head/usr.bin/locate/locate/updatedb.sh Mon Nov 1 01:51:47 2010 (r214613) @@ -52,7 +52,7 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; ex : ${FCODES:=/var/db/locate.database} # the database : ${SEARCHPATHS:="/"} # directories to be put in the database : ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories -: ${PRUNEDIRS:=".zfs"} # unwanted directories, in any parent +: ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent : ${FILESYSTEMS:="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ cut -d " " -f1)"} # allowed filesystems From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 02:15:30 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F22481065673; Mon, 1 Nov 2010 02:15:30 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id A44B48FC12; Mon, 1 Nov 2010 02:15:30 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.4/8.14.4) with ESMTP id oA11sAEd050116; Sun, 31 Oct 2010 21:54:10 -0400 (EDT) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.4/8.14.4/Submit) id oA11sA3H050113; Sun, 31 Oct 2010 21:54:10 -0400 (EDT) (envelope-from wollman) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19662.7618.600259.973098@hergotha.csail.mit.edu> Date: Sun, 31 Oct 2010 21:54:10 -0400 From: Garrett Wollman To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org In-Reply-To: <201011010151.oA11plGq019760@svn.freebsd.org> References: <201011010151.oA11plGq019760@svn.freebsd.org> X-Mailer: VM 7.17 under 21.4 (patch 22) "Instant Classic" XEmacs Lucid X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (hergotha.csail.mit.edu [127.0.0.1]); Sun, 31 Oct 2010 21:54:10 -0400 (EDT) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hergotha.csail.mit.edu Cc: Subject: Re: svn commit: r214613 - head/usr.bin/locate/locate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 02:15:31 -0000 < said: > jilles@ pointed out that using ${PRUNEDIRS:=".zfs"} in updatedb.sh > made it impossible to override PRUNEDIRS to make it empty. Use the > non-colon form to only set PRUNEDIRS if it is completely unset. (For > parallelism, the other configuration defaults here could be done the > same way, but that could be more obviously accomplished by disabling > updatedb in periodic.conf, so leave them alone for now.) With this change, you can now make the locate database once again include all of your mounted ZFS snapshots by setting PRUNEDIRS="" in your /etc/locate.rc. -GAWollman From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 02:20:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F29E41065672; Mon, 1 Nov 2010 02:20:18 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C68348FC14; Mon, 1 Nov 2010 02:20:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA12KIVK021005; Mon, 1 Nov 2010 02:20:18 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA12KIEc021003; Mon, 1 Nov 2010 02:20:18 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201011010220.oA12KIEc021003@svn.freebsd.org> From: Garrett Wollman Date: Mon, 1 Nov 2010 02:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214615 - head/usr.bin/locate/locate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 02:20:19 -0000 Author: wollman Date: Mon Nov 1 02:20:18 2010 New Revision: 214615 URL: http://svn.freebsd.org/changeset/base/214615 Log: Style cleanup: make this look more like a 21st-century shell script and not something out of the early 1980s. Make sure all error messages go to stderr, not stdout. Since there's error-handling code to handle empty SEARCHPATHS and FILESYSTEMS, use the initialization form that allows this error to be diagnosed. (hat tip: jilles@) Modified: head/usr.bin/locate/locate/updatedb.sh Modified: head/usr.bin/locate/locate/updatedb.sh ============================================================================== --- head/usr.bin/locate/locate/updatedb.sh Mon Nov 1 01:55:15 2010 (r214614) +++ head/usr.bin/locate/locate/updatedb.sh Mon Nov 1 02:20:18 2010 (r214615) @@ -50,18 +50,20 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; ex : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database -: ${SEARCHPATHS:="/"} # directories to be put in the database -: ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories +: ${SEARCHPATHS="/"} # directories to be put in the database +: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories : ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent -: ${FILESYSTEMS:="$(lsvfs | tail -n +3 | \ +: ${FILESYSTEMS="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ cut -d " " -f1)"} # allowed filesystems : ${find:=find} -case X"$SEARCHPATHS" in - X) echo "$0: empty variable SEARCHPATHS"; exit 1;; esac -case X"$FILESYSTEMS" in - X) echo "$0: empty variable FILESYSTEMS"; exit 1;; esac +if [ -z "$SEARCHPATHS" ]; then + echo "$0: empty variable SEARCHPATHS" >&2; exit 1 +fi +if [ -z "$FILESYSTEMS" ]; then + echo "$0: empty variable FILESYSTEMS" >&2; exit 1 +fi # Make a list a paths to exclude in the locate run excludes="! (" or="" @@ -72,33 +74,29 @@ do done excludes="$excludes ) -prune" -case X"$PRUNEPATHS" in - X) ;; - *) for path in $PRUNEPATHS - do +if [ -n "$PRUNEPATHS" ]; then + for path in $PRUNEPATHS; do excludes="$excludes -or -path $path -prune" - done;; -esac + done +fi -case X"$PRUNEDIRS" in - X) ;; - *) for dir in $PRUNEDIRS - do +if [ -n "$PRUNEDIRS" ]; then + for dir in $PRUNEDIRS; do excludes="$excludes -or -name $dir -type d -prune" - done;; -esac + done +fi tmp=$TMPDIR/_updatedb$$ trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15 # search locally -# echo $find $SEARCHPATHS $excludes -or -print && exit if $find -s $SEARCHPATHS $excludes -or -print 2>/dev/null | $mklocatedb -presort > $tmp then - case X"`$find $tmp -size -257c -print`" in - X) cat $tmp > $FCODES;; - *) echo "updatedb: locate database $tmp is empty" - exit 1 - esac + if [ -n "$($find $tmp -size -257c -print)" ]; then + echo "updatedb: locate database $tmp is empty" >&2 + exit 1 + else + cat $tmp > $FCODES # should be cp? + fi fi From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 02:22:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9706C106564A; Mon, 1 Nov 2010 02:22:48 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B2D28FC1A; Mon, 1 Nov 2010 02:22:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA12Mm17021202; Mon, 1 Nov 2010 02:22:48 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA12Mm74021199; Mon, 1 Nov 2010 02:22:48 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011010222.oA12Mm74021199@svn.freebsd.org> From: Alan Cox Date: Mon, 1 Nov 2010 02:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214617 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 02:22:48 -0000 Author: alc Date: Mon Nov 1 02:22:48 2010 New Revision: 214617 URL: http://svn.freebsd.org/changeset/base/214617 Log: Implement pmap_is_prefaultable(). Reviewed by: nwhitehorn Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon Nov 1 02:21:35 2010 (r214616) +++ head/sys/powerpc/aim/mmu_oea.c Mon Nov 1 02:22:48 2010 (r214617) @@ -304,6 +304,7 @@ vm_paddr_t moea_extract(mmu_t, pmap_t, v vm_page_t moea_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); void moea_init(mmu_t); boolean_t moea_is_modified(mmu_t, vm_page_t); +boolean_t moea_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea_is_referenced(mmu_t, vm_page_t); boolean_t moea_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); @@ -347,6 +348,7 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_extract_and_hold, moea_extract_and_hold), MMUMETHOD(mmu_init, moea_init), MMUMETHOD(mmu_is_modified, moea_is_modified), + MMUMETHOD(mmu_is_prefaultable, moea_is_prefaultable), MMUMETHOD(mmu_is_referenced, moea_is_referenced), MMUMETHOD(mmu_ts_referenced, moea_ts_referenced), MMUMETHOD(mmu_map, moea_map), @@ -1324,6 +1326,19 @@ moea_is_modified(mmu_t mmu, vm_page_t m) return (moea_query_bit(m, PTE_CHG)); } +boolean_t +moea_is_prefaultable(mmu_t mmu, pmap_t pmap, vm_offset_t va) +{ + struct pvo_entry *pvo; + boolean_t rv; + + PMAP_LOCK(pmap); + pvo = moea_pvo_find_va(pmap, va & ~ADDR_POFF, NULL); + rv = pvo == NULL || (pvo->pvo_pte.pte.pte_hi & PTE_VALID) == 0; + PMAP_UNLOCK(pmap); + return (rv); +} + void moea_clear_reference(mmu_t mmu, vm_page_t m) { Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Nov 1 02:21:35 2010 (r214616) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Nov 1 02:22:48 2010 (r214617) @@ -400,6 +400,7 @@ vm_paddr_t moea64_extract(mmu_t, pmap_t, vm_page_t moea64_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); void moea64_init(mmu_t); boolean_t moea64_is_modified(mmu_t, vm_page_t); +boolean_t moea64_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea64_is_referenced(mmu_t, vm_page_t); boolean_t moea64_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); @@ -441,6 +442,7 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_extract_and_hold, moea64_extract_and_hold), MMUMETHOD(mmu_init, moea64_init), MMUMETHOD(mmu_is_modified, moea64_is_modified), + MMUMETHOD(mmu_is_prefaultable, moea64_is_prefaultable), MMUMETHOD(mmu_is_referenced, moea64_is_referenced), MMUMETHOD(mmu_ts_referenced, moea64_ts_referenced), MMUMETHOD(mmu_map, moea64_map), @@ -1786,6 +1788,19 @@ moea64_is_modified(mmu_t mmu, vm_page_t return (moea64_query_bit(m, LPTE_CHG)); } +boolean_t +moea64_is_prefaultable(mmu_t mmu, pmap_t pmap, vm_offset_t va) +{ + struct pvo_entry *pvo; + boolean_t rv; + + PMAP_LOCK(pmap); + pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF); + rv = pvo == NULL || (pvo->pvo_pte.lpte.pte_hi & LPTE_VALID) == 0; + PMAP_UNLOCK(pmap); + return (rv); +} + void moea64_clear_reference(mmu_t mmu, vm_page_t m) { From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 10:41:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE19D106567A; Mon, 1 Nov 2010 10:41:05 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC2568FC17; Mon, 1 Nov 2010 10:41:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1Af56R058078; Mon, 1 Nov 2010 10:41:05 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1Af58A058076; Mon, 1 Nov 2010 10:41:05 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201011011041.oA1Af58A058076@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 1 Nov 2010 10:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214622 - head/cddl/contrib/opensolaris/lib/libzpool/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 10:41:05 -0000 Author: pjd Date: Mon Nov 1 10:41:05 2010 New Revision: 214622 URL: http://svn.freebsd.org/changeset/base/214622 Log: 1. Remove invalid assertion. 2. Properly recalculate delta in case pthread_cond_timedwait() is interrupted. 3. Style fix. Reported by: [1] App Deb Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Nov 1 08:20:14 2010 (r214621) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Nov 1 10:41:05 2010 (r214622) @@ -308,9 +308,9 @@ cv_timedwait(kcondvar_t *cv, kmutex_t *m struct timeval tv; clock_t delta; - ASSERT(abstime > 0); + abstime += lbolt; top: - delta = abstime; + delta = abstime - lbolt; if (delta <= 0) return (-1); @@ -321,7 +321,7 @@ top: ts.tv_nsec = tv.tv_usec * 1000 + (delta % hz) * (NANOSEC / hz); ASSERT(ts.tv_nsec >= 0); - if(ts.tv_nsec >= NANOSEC) { + if (ts.tv_nsec >= NANOSEC) { ts.tv_sec++; ts.tv_nsec -= NANOSEC; } From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 10:42:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE2421065674; Mon, 1 Nov 2010 10:42:14 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC5AE8FC1D; Mon, 1 Nov 2010 10:42:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1AgE0H058140; Mon, 1 Nov 2010 10:42:14 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1AgEot058138; Mon, 1 Nov 2010 10:42:14 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201011011042.oA1AgEot058138@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 1 Nov 2010 10:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214623 - head/cddl/contrib/opensolaris/cmd/ztest X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 10:42:14 -0000 Author: pjd Date: Mon Nov 1 10:42:14 2010 New Revision: 214623 URL: http://svn.freebsd.org/changeset/base/214623 Log: Fix ztest when it is executed by just 'ztest' and not by full path '/usr/bin/ztest'. Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Nov 1 10:41:05 2010 (r214622) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Nov 1 10:42:14 2010 (r214623) @@ -3362,8 +3362,7 @@ ztest_verify_blocks(char *pool) int isalen; FILE *fp; - if (realpath(progname, zdb) == NULL) - assert(!"realpath() failed"); + strlcpy(zdb, "/usr/bin/ztest", sizeof(zdb)); /* zdb lives in /usr/sbin, while ztest lives in /usr/bin */ bin = strstr(zdb, "/usr/bin/"); From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 14:22:47 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEDAF106566B; Mon, 1 Nov 2010 14:22:47 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailA.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.196]) by mx1.freebsd.org (Postfix) with ESMTP id B7E178FC17; Mon, 1 Nov 2010 14:22:47 +0000 (UTC) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 6E5C1B51C; Mon, 1 Nov 2010 10:16:05 -0400 (EDT) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailA.acsu.buffalo.edu (Postfix) with ESMTP id 138D4B56E; Mon, 1 Nov 2010 10:16:03 -0400 (EDT) Received: from mweb1.acsu.buffalo.edu (mweb1.acsu.buffalo.edu [128.205.5.238]) by localmailA.acsu.buffalo.edu (Prefixe) with ESMTP id F3829B54C; Mon, 1 Nov 2010 10:16:02 -0400 (EDT) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) by mweb1.acsu.buffalo.edu (Postfix) with ESMTP id 359D25B0043; Mon, 1 Nov 2010 10:15:52 -0400 (EDT) From: Ken Smith To: Ulrich Spoerlein In-Reply-To: <20101031191119.GM46314@acme.spoerlein.net> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> <20101031191119.GM46314@acme.spoerlein.net> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-bS9egv1BU3VSzXx7UbUT" Date: Mon, 01 Nov 2010 10:15:51 -0400 Message-ID: <1288620951.3596.32.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 14:22:48 -0000 --=-bS9egv1BU3VSzXx7UbUT Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Sun, 2010-10-31 at 20:11 +0100, Ulrich Spoerlein wrote: > On Sun, 31.10.2010 at 17:06:03 +0100, Pawel Jakub Dawidek wrote: > > On Sun, Oct 31, 2010 at 09:21:28AM +0000, Ulrich Spoerlein wrote: > > > Author: uqs > > > Date: Sun Oct 31 09:21:27 2010 > > > New Revision: 214596 > > > URL: http://svn.freebsd.org/changeset/base/214596 > > >=20 > > > Log: > > > Elaborate some more on the non-security implications of using -P > > [...] > > > +.Pp > > > +N.B.: The > > > +.Fl P > > > +flag is not considered a security feature > > > +.Pq see Sx BUGS . > >=20 > > I'm sorry for jumping so late into the subject, but if it is not a > > security feature than what other purpose has left? > >=20 > > Really guys, this option is useless. > >=20 > > There is no reliable way to verify if the blocks are really overwritten= . > > Period. > >=20 > > If it is not used for security, then I see no other use for it (except > > for [1]). > >=20 > > If it is used for security then we better have a way to give the user > > the right answer to the question "is my data really gone?" and don't > > make false assumptions or giving answers "we hope so". > >=20 > > Why there is no reliable way to verify this? > > 1. Check file system type (UFS, ZFS). > > 2. Check file system configuration (UFS with snapshots?). > > 3. Be sure sync(2) the file system and send BIO_FLUSH to all the media > > involved (some cheap flash disks lie about BIO_FLUSH support). > > 4. Check underlying media (GLABEL provider - no modification to the dat= a). > > 5. Check underlying media (ZVOL - data won't be overwritten, but...). > > 6. Check ZFS vdevs (on which providers ZVOL's pool is based on). > > 7. Check vdevs (GELI - cool, we have encryption). > > 8. Check GELI configuration (maybe NULL encryption algorithm?). > > 9. Check underlying media (HDD, SSD, swap-backed md(4) device? goto 3). > > 10. Check if the sectors weren't remapped while we were overwriting. > >=20 > > In other words this is soooo complicated that it would simply be too > > hard to explain to regular user or implement in rm(1). > >=20 > > IMHO this option should be removed and rm(1) should fail when a user is > > trying to use it. >=20 > No, this is a POLA violation for no apparent gain. The flag has been in > FreeBSD since at least '94. Remember, that we are in the rope-selling > business. We empower the users to shoot themselves in the foot. Just playing Devils' Advocate... If the removal of -P were done as part of a new branch the POLA argument is moot if it's judged you are a bit off on the "no apparent gain" aspect. And the rope selling argument also only applies so far. One could argue having our installer by default leave a machine set up so SSH was enabled, remote root logins were allowed, and no initial password set up for root is fine because we're in the rope-selling business and for some portion of the user base that's just fine. I know that's extreme but that's the point, I'm saying it's hard to figure out exactly where the line is between activities that are ill-advised versus those that are just plain stupid sometimes. So, please, given all the attention being given to the security aspects of users properly erasing data they should erase I'd prefer we focus on whether providing -P at all is flat out lying and base the decision about whether it should go based on that. Lots of things we thought were OK back in 1994 we've changed our minds about since then. > I, for one, am using the -P option in a certain case where I can be sure > that ~99% of the data will be obliterated and I'm fine with that. For > all other cases I'm using geli or gbde (where I can make sure, that data > is lost). This strongly backs up Pawel's argument that the existence of -P is a lie. > So we can either fix -P for all cases (impossible), or at least document > its shortcomings. Documenting them clearly is better than what we had a > couple of days before. As I said above, with re@ hat on since the claim of POLA above is slightly based on branch/release guidelines, I think removal of -P is also still an option if it's decided -P is a lie. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-bS9egv1BU3VSzXx7UbUT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAkzOy44ACgkQ/G14VSmup/Z+oQCgjSGR8CI1gDTxsudzEsszAICr 9/AAoJU+/HB2kCgXNKtfOavMg8C6sO7A =tOcT -----END PGP SIGNATURE----- --=-bS9egv1BU3VSzXx7UbUT-- From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 15:18:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 469321065673; Mon, 1 Nov 2010 15:18:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34EB48FC2A; Mon, 1 Nov 2010 15:18:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1FIweL068525; Mon, 1 Nov 2010 15:18:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1FIw4r068523; Mon, 1 Nov 2010 15:18:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011011518.oA1FIw4r068523@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Nov 2010 15:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214625 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 15:18:58 -0000 Author: jhb Date: Mon Nov 1 15:18:57 2010 New Revision: 214625 URL: http://svn.freebsd.org/changeset/base/214625 Log: Correct the abbreviations for general I/O and signal traces. PR: docs/151854 Submitted by: Stephen Veiss stephen of brokenbottle net MFC after: 3 days Modified: head/usr.bin/kdump/kdump.1 Modified: head/usr.bin/kdump/kdump.1 ============================================================================== --- head/usr.bin/kdump/kdump.1 Mon Nov 1 11:38:04 2010 (r214624) +++ head/usr.bin/kdump/kdump.1 Mon Nov 1 15:18:57 2010 (r214625) @@ -162,13 +162,13 @@ Seven bytes were written by the system call, so 7 is the return value. .Pp The possible operations are: -.Bl -column -offset indent ".Li GENIO" ".No data from user process" +.Bl -column -offset indent ".Li CALL" ".No data from user process" .It Sy Name Ta Sy Operation Ta Sy Fourth field .It Li CALL Ta enter syscall Ta syscall name and arguments .It Li RET Ta return from syscall Ta syscall name and return value .It Li NAMI Ta file name lookup Ta path to file -.It Li GENIO Ta general I/O Ta fd, read/write, number of bytes -.It Li SIG Ta signal Ta signal name, handler, mask, code +.It Li GIO Ta general I/O Ta fd, read/write, number of bytes +.It Li PSIG Ta signal Ta signal name, handler, mask, code .It Li CSW Ta context switch Ta stop/resume user/kernel .It Li USER Ta data from user process Ta the data .It Li STRU Ta various syscalls Ta structure From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 17:19:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E886106564A; Mon, 1 Nov 2010 17:19:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B99A18FC13; Mon, 1 Nov 2010 17:19:08 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oA1HJ5gM092707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Nov 2010 19:19:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oA1HJ5Ap092795; Mon, 1 Nov 2010 19:19:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oA1HJ4S0092794; Mon, 1 Nov 2010 19:19:04 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 1 Nov 2010 19:19:04 +0200 From: Kostik Belousov To: Pawel Jakub Dawidek Message-ID: <20101101171904.GA92782@deviant.kiev.zoral.com.ua> References: <201008262341.o7QNfeR2057181@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline In-Reply-To: <201008262341.o7QNfeR2057181@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211854 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 17:19:09 -0000 --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 26, 2010 at 11:41:40PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Aug 26 23:41:40 2010 > New Revision: 211854 > URL: http://svn.freebsd.org/changeset/base/211854 >=20 > Log: > - When VFS_VGET() is not supported, switch to VOP_LOOKUP(). > - We are fine by only share-locking the vnode. > - Remove assertion that doesn't hold for ZFS where we cross mount points > boundaries by going into .zfs/snapshot//. > =20 > Reviewed by: rmacklem > MFC after: 1 month Do you still plan to merge this commit to stable/8 ? --xHFwDpU9dbj6ez1V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkzO9ogACgkQC3+MBN1Mb4hw5QCg7bxbvUqxJ6IIoGv/tha61/jp 88QAoK1H9GpGKRg3piYI5N74igMMmLxo =PDeZ -----END PGP SIGNATURE----- --xHFwDpU9dbj6ez1V-- From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 17:27:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3309106566C; Mon, 1 Nov 2010 17:27:09 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76E0E8FC0C; Mon, 1 Nov 2010 17:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1HR95w076572; Mon, 1 Nov 2010 17:27:09 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1HR9Ur076570; Mon, 1 Nov 2010 17:27:09 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201011011727.oA1HR9Ur076570@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 1 Nov 2010 17:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214628 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 17:27:09 -0000 Author: uqs Date: Mon Nov 1 17:27:09 2010 New Revision: 214628 URL: http://svn.freebsd.org/changeset/base/214628 Log: Add DragonflyBSD 2.8 and OpenBSD 4.8 releases Also expand a stray tab in the family tree MFC after: 1 week Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Nov 1 15:43:42 2010 (r214627) +++ head/share/misc/bsd-family-tree Mon Nov 1 17:27:09 2010 (r214628) @@ -151,7 +151,7 @@ FreeBSD 4.0 | | | | | NetBSD 1. | FreeBSD 4.5 | | | | | | | | \ | | | | BSD/OS 4.3 | FreeBSD 4.6 \ | | | OpenBSD 3.1 | - | | \ | | NetBSD 1.5.3 | | + | | \ | | NetBSD 1.5.3 | | | FreeBSD 4.6.2 Mac OS X | | | | | 10.2 | | | | FreeBSD 4.7 | | | | @@ -239,7 +239,8 @@ FreeBSD 5.2 | | | | | | OpenBSD 4.7 | | FreeBSD | | | | | 8.1 | | | | - | | | | | | + | | | | | DragonFly 2.8.0 + | | | | OpenBSD 4.8 | | V | | | | | | | | | FreeBSD 9 -current | NetBSD -current OpenBSD -current | @@ -520,6 +521,8 @@ FreeBSD 7.3 2010-03-23 [FBD] DragonFly 2.6.0 2010-03-28 [DFB] OpenBSD 4.7 2010-05-19 [OBD] FreeBSD 8.1 2010-07-24 [FBD] +DragonFly 2.8.0 2010-10-30 [DFB] +OpenBSD 4.8 2010-11-01 [OBD] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 17:34:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EEFA1065755; Mon, 1 Nov 2010 17:34:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5328FC0A; Mon, 1 Nov 2010 17:34:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1HY48c076953; Mon, 1 Nov 2010 17:34:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1HY4fp076949; Mon, 1 Nov 2010 17:34:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011011734.oA1HY4fp076949@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Nov 2010 17:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214629 - in head: include sys/conf sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 17:34:04 -0000 Author: jhb Date: Mon Nov 1 17:34:04 2010 New Revision: 214629 URL: http://svn.freebsd.org/changeset/base/214629 Log: Add an x86/include directory to the kernel to hold headers that are common to amd64, i386, and pc98. The headers are installed to /usr/include/x86 during an installworld, and an 'x86' symlink is created for kernel builds similar to 'machine' so that the headers can be included as . Reviewed by: imp Added: head/sys/x86/include/ Modified: head/include/Makefile head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Mon Nov 1 17:27:09 2010 (r214628) +++ head/include/Makefile Mon Nov 1 17:34:04 2010 (r214629) @@ -116,7 +116,10 @@ INCSLINKS+= sys/$i ${INCLUDEDIR}/$i .endfor .if ${MACHINE} != ${MACHINE_CPUARCH} -_MARCH=${MACHINE_CPUARCH} +_MARCHS= ${MACHINE_CPUARCH} +.endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +_MARCHS+= x86 .endif .include @@ -126,7 +129,7 @@ ${SHARED}: compat # Take care of stale directory-level symlinks. compat: -.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto +.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \ rm -f ${DESTDIR}${INCLUDEDIR}/$i; \ fi @@ -142,7 +145,7 @@ compat: copies: .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \ - ${_MARCH} + ${_MARCHS} .if exists(${DESTDIR}${INCLUDEDIR}/$i) cd ${DESTDIR}${INCLUDEDIR}/$i; \ for h in *.h; do \ @@ -189,7 +192,8 @@ copies: ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/machine/pc .endif -.if defined(_MARCH) && exists(${.CURDIR}/../sys/${_MARCH}/include) +.for _MARCH in ${_MARCHS} +.if exists(${.CURDIR}/../sys/${_MARCH}/include) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ cd ${.CURDIR}/../sys/${_MARCH}/include; \ @@ -203,6 +207,7 @@ copies: ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc .endif .endif +.endfor cd ${.CURDIR}/../sys/rpc; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \ ${DESTDIR}${INCLUDEDIR}/rpc @@ -276,7 +281,8 @@ symlinks: ${DESTDIR}${INCLUDEDIR}/machine/pc; \ done .endif -.if defined(_MARCH) && exists(${.CURDIR}/../sys/${_MARCH}/include) +.for _MARCH in ${_MARCHS} +.if exists(${.CURDIR}/../sys/${_MARCH}/include) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ cd ${.CURDIR}/../sys/${_MARCH}/include; \ @@ -294,6 +300,7 @@ symlinks: done .endif .endif +.endfor cd ${.CURDIR}/../sys/fs/cd9660; \ for h in *.h; do \ ln -fs ../../../../sys/fs/cd9660/$$h \ Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Mon Nov 1 17:27:09 2010 (r214628) +++ head/sys/conf/kern.post.mk Mon Nov 1 17:34:04 2010 (r214629) @@ -169,6 +169,9 @@ _ILINKS= machine .if ${MACHINE} != ${MACHINE_CPUARCH} _ILINKS+= ${MACHINE_CPUARCH} .endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +_ILINKS+= x86 +.endif # Ensure that the link exists without depending on it when it exists. .for _link in ${_ILINKS} @@ -181,8 +184,8 @@ ${_ILINKS}: @case ${.TARGET} in \ machine) \ path=${S}/${MACHINE}/include ;; \ - ${MACHINE_CPUARCH}) \ - path=${S}/${MACHINE_CPUARCH}/include ;; \ + *) \ + path=${S}/${.TARGET}/include ;; \ esac ; \ ${ECHO} ${.TARGET} "->" $$path ; \ ln -s $$path ${.TARGET} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Nov 1 17:27:09 2010 (r214628) +++ head/sys/conf/kmod.mk Mon Nov 1 17:34:04 2010 (r214629) @@ -238,6 +238,9 @@ _ILINKS=@ machine .if ${MACHINE} != ${MACHINE_CPUARCH} _ILINKS+=${MACHINE_CPUARCH} .endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +_ILINKS+=x86 +.endif all: objwarn ${PROG} @@ -263,12 +266,12 @@ SYSDIR= ${_dir} ${_ILINKS}: @case ${.TARGET} in \ - ${MACHINE_CPUARCH}) \ - path=${SYSDIR}/${MACHINE_CPUARCH}/include ;; \ machine) \ path=${SYSDIR}/${MACHINE}/include ;; \ @) \ path=${SYSDIR} ;; \ + *) \ + path=${SYSDIR}/${.TARGET}/include ;; \ esac ; \ path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET} "->" $$path ; \ From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 17:40:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F30610656C6; Mon, 1 Nov 2010 17:40:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 539158FC0A; Mon, 1 Nov 2010 17:40:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1HeaSC077339; Mon, 1 Nov 2010 17:40:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1Heatl077326; Mon, 1 Nov 2010 17:40:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011011740.oA1Heatl077326@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Nov 2010 17:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214630 - in head/sys: amd64/acpica amd64/amd64 amd64/include i386/acpica i386/i386 i386/include pc98/include pc98/pc98 x86/include x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 17:40:36 -0000 Author: jhb Date: Mon Nov 1 17:40:35 2010 New Revision: 214630 URL: http://svn.freebsd.org/changeset/base/214630 Log: Move the header to . Added: head/sys/x86/include/mca.h - copied, changed from r214624, head/sys/amd64/include/mca.h Deleted: head/sys/amd64/include/mca.h head/sys/i386/include/mca.h head/sys/pc98/include/mca.h Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/trap.c head/sys/i386/acpica/acpi_wakeup.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/trap.c head/sys/pc98/pc98/machdep.c head/sys/x86/x86/local_apic.c head/sys/x86/x86/mca.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/amd64/acpica/acpi_wakeup.c Mon Nov 1 17:40:35 2010 (r214630) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/amd64/amd64/machdep.c Mon Nov 1 17:40:35 2010 (r214630) @@ -112,7 +112,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/amd64/amd64/mp_machdep.c Mon Nov 1 17:40:35 2010 (r214630) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/amd64/amd64/trap.c Mon Nov 1 17:40:35 2010 (r214630) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #ifdef SMP Modified: head/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- head/sys/i386/acpica/acpi_wakeup.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/i386/acpica/acpi_wakeup.c Mon Nov 1 17:40:35 2010 (r214630) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/i386/i386/machdep.c Mon Nov 1 17:40:35 2010 (r214630) @@ -115,7 +115,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/i386/i386/mp_machdep.c Mon Nov 1 17:40:35 2010 (r214630) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/i386/i386/trap.c Mon Nov 1 17:40:35 2010 (r214630) @@ -86,7 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #ifdef SMP Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/pc98/pc98/machdep.c Mon Nov 1 17:40:35 2010 (r214630) @@ -112,7 +112,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Copied and modified: head/sys/x86/include/mca.h (from r214624, head/sys/amd64/include/mca.h) ============================================================================== --- head/sys/amd64/include/mca.h Mon Nov 1 11:38:04 2010 (r214624, copy source) +++ head/sys/x86/include/mca.h Mon Nov 1 17:40:35 2010 (r214630) @@ -27,8 +27,8 @@ * $FreeBSD$ */ -#ifndef __MACHINE_MCA_H__ -#define __MACHINE_MCA_H__ +#ifndef __X86_MCA_H__ +#define __X86_MCA_H__ struct mca_record { uint64_t mr_status; @@ -53,4 +53,4 @@ void mca_resume(void); #endif -#endif /* !__MACHINE_MCA_H__ */ +#endif /* !__X86_MCA_H__ */ Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/x86/x86/local_apic.c Mon Nov 1 17:40:35 2010 (r214630) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Mon Nov 1 17:34:04 2010 (r214629) +++ head/sys/x86/x86/mca.c Mon Nov 1 17:40:35 2010 (r214630) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 18:18:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ABF6106566B; Mon, 1 Nov 2010 18:18:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65E938FC13; Mon, 1 Nov 2010 18:18:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1IIlaV079708; Mon, 1 Nov 2010 18:18:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1IIkQt079688; Mon, 1 Nov 2010 18:18:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011011818.oA1IIkQt079688@svn.freebsd.org> From: John Baldwin Date: Mon, 1 Nov 2010 18:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214631 - in head/sys: amd64/acpica amd64/amd64 amd64/include i386/acpica i386/i386 i386/include i386/xen pc98/include x86/include x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 18:18:47 -0000 Author: jhb Date: Mon Nov 1 18:18:46 2010 New Revision: 214631 URL: http://svn.freebsd.org/changeset/base/214631 Log: Move to . Added: head/sys/x86/include/apicreg.h - copied, changed from r214624, head/sys/i386/include/apicreg.h Deleted: head/sys/amd64/include/apicreg.h head/sys/i386/include/apicreg.h head/sys/pc98/include/apicreg.h Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/acpica/madt.c head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/mp_watchdog.c head/sys/i386/acpica/madt.c head/sys/i386/i386/apic_vector.s head/sys/i386/i386/genassym.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/mp_watchdog.c head/sys/i386/i386/mpboot.s head/sys/i386/xen/mp_machdep.c head/sys/i386/xen/mptable.c head/sys/x86/x86/io_apic.c head/sys/x86/x86/local_apic.c head/sys/x86/x86/mptable.c head/sys/x86/x86/msi.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/amd64/acpica/acpi_wakeup.c Mon Nov 1 18:18:46 2010 (r214631) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef SMP -#include +#include #include #include #endif Modified: head/sys/amd64/acpica/madt.c ============================================================================== --- head/sys/amd64/acpica/madt.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/amd64/acpica/madt.c Mon Nov 1 18:18:46 2010 (r214631) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/amd64/amd64/apic_vector.S Mon Nov 1 18:18:46 2010 (r214631) @@ -39,7 +39,7 @@ #include "opt_smp.h" #include -#include +#include #include "assym.s" Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/amd64/amd64/genassym.c Mon Nov 1 18:18:46 2010 (r214631) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/amd64/amd64/mp_machdep.c Mon Nov 1 18:18:46 2010 (r214631) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/amd64/amd64/mp_watchdog.c ============================================================================== --- head/sys/amd64/amd64/mp_watchdog.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/amd64/amd64/mp_watchdog.c Mon Nov 1 18:18:46 2010 (r214631) @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include Modified: head/sys/i386/acpica/madt.c ============================================================================== --- head/sys/i386/acpica/madt.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/i386/acpica/madt.c Mon Nov 1 18:18:46 2010 (r214631) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/i386/i386/apic_vector.s Mon Nov 1 18:18:46 2010 (r214631) @@ -39,7 +39,7 @@ #include "opt_smp.h" #include -#include +#include #include "assym.s" Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/i386/i386/genassym.c Mon Nov 1 18:18:46 2010 (r214631) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef DEV_APIC -#include +#include #endif #include #include Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/i386/i386/mp_machdep.c Mon Nov 1 18:18:46 2010 (r214631) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/i386/i386/mp_watchdog.c ============================================================================== --- head/sys/i386/i386/mp_watchdog.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/i386/i386/mp_watchdog.c Mon Nov 1 18:18:46 2010 (r214631) @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include Modified: head/sys/i386/i386/mpboot.s ============================================================================== --- head/sys/i386/i386/mpboot.s Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/i386/i386/mpboot.s Mon Nov 1 18:18:46 2010 (r214631) @@ -32,7 +32,7 @@ #include "opt_pmap.h" #include /* miscellaneous asm macros */ -#include +#include #include #include "assym.s" Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/i386/xen/mp_machdep.c Mon Nov 1 18:18:46 2010 (r214631) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/i386/xen/mptable.c ============================================================================== --- head/sys/i386/xen/mptable.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/i386/xen/mptable.c Mon Nov 1 18:18:46 2010 (r214631) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Copied and modified: head/sys/x86/include/apicreg.h (from r214624, head/sys/i386/include/apicreg.h) ============================================================================== --- head/sys/i386/include/apicreg.h Mon Nov 1 11:38:04 2010 (r214624, copy source) +++ head/sys/x86/include/apicreg.h Mon Nov 1 18:18:46 2010 (r214631) @@ -25,8 +25,8 @@ * $FreeBSD$ */ -#ifndef _MACHINE_APICREG_H_ -#define _MACHINE_APICREG_H_ +#ifndef _X86_APICREG_H_ +#define _X86_APICREG_H_ /* * Local && I/O APIC definitions. @@ -442,4 +442,4 @@ typedef struct IOAPIC ioapic_t; #define IOART_INTVEC 0x000000ff /* R/W: INTerrupt vector field */ -#endif /* _MACHINE_APICREG_H_ */ +#endif /* _X86_APICREG_H_ */ Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/x86/x86/io_apic.c Mon Nov 1 18:18:46 2010 (r214631) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/x86/x86/local_apic.c Mon Nov 1 18:18:46 2010 (r214631) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/x86/x86/mptable.c ============================================================================== --- head/sys/x86/x86/mptable.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/x86/x86/mptable.c Mon Nov 1 18:18:46 2010 (r214631) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Mon Nov 1 17:40:35 2010 (r214630) +++ head/sys/x86/x86/msi.c Mon Nov 1 18:18:46 2010 (r214631) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 20:19:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB4B6106564A; Mon, 1 Nov 2010 20:19:25 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8BD38FC12; Mon, 1 Nov 2010 20:19:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1KJPRe087052; Mon, 1 Nov 2010 20:19:25 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1KJPRY087047; Mon, 1 Nov 2010 20:19:25 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201011012019.oA1KJPRY087047@svn.freebsd.org> From: Jack F Vogel Date: Mon, 1 Nov 2010 20:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214646 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 20:19:25 -0000 Author: jfv Date: Mon Nov 1 20:19:25 2010 New Revision: 214646 URL: http://svn.freebsd.org/changeset/base/214646 Log: Sync the lem code up with the vlan and other fixes in em. Delete a unneeded test from the beginning of em_xmit. CRITICAL: shared code fix for 82574, a mutex might not be released, this can cause hangs. Modified: head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h Modified: head/sys/dev/e1000/e1000_82571.c ============================================================================== --- head/sys/dev/e1000/e1000_82571.c Mon Nov 1 20:17:15 2010 (r214645) +++ head/sys/dev/e1000/e1000_82571.c Mon Nov 1 20:19:25 2010 (r214646) @@ -666,10 +666,15 @@ static void e1000_put_hw_semaphore_82573 **/ static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw) { + s32 ret_val; + DEBUGFUNC("e1000_get_hw_semaphore_82574"); E1000_MUTEX_LOCK(&hw->dev_spec._82571.swflag_mutex); - return e1000_get_hw_semaphore_82573(hw); + ret_val = e1000_get_hw_semaphore_82573(hw); + if (ret_val) + E1000_MUTEX_UNLOCK(&hw->dev_spec._82571.swflag_mutex); + return ret_val; } /** Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Nov 1 20:17:15 2010 (r214645) +++ head/sys/dev/e1000/if_em.c Mon Nov 1 20:19:25 2010 (r214646) @@ -1766,19 +1766,6 @@ em_xmit(struct tx_ring *txr, struct mbuf ip_off = poff = 0; /* - ** When doing checksum offload, it is critical to - ** make sure the first mbuf has more than header, - ** because that routine expects data to be present. - */ - if ((m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD) && - (m_head->m_len < ETHER_HDR_LEN + sizeof(struct ip))) { - m_head = m_pullup(m_head, ETHER_HDR_LEN + sizeof(struct ip)); - *m_headp = m_head; - if (m_head == NULL) - return (ENOBUFS); - } - - /* * Intel recommends entire IP/TCP header length reside in a single * buffer. If multiple descriptors are used to describe the IP and * TCP header, each descriptor should describe one or more Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Mon Nov 1 20:17:15 2010 (r214645) +++ head/sys/dev/e1000/if_lem.c Mon Nov 1 20:19:25 2010 (r214646) @@ -51,9 +51,7 @@ #include #include #include -#if __FreeBSD_version >= 700029 #include -#endif #include #include @@ -86,8 +84,7 @@ /********************************************************************* * Legacy Em Driver version: *********************************************************************/ -char lem_driver_version[] = "1.0.2"; - +char lem_driver_version[] = "1.0.3"; /********************************************************************* * PCI Device ID Table @@ -209,11 +206,9 @@ static void lem_disable_promisc(struct a static void lem_set_multi(struct adapter *); static void lem_update_link_status(struct adapter *); static int lem_get_buf(struct adapter *, int); -#if __FreeBSD_version >= 700029 static void lem_register_vlan(void *, struct ifnet *, u16); static void lem_unregister_vlan(void *, struct ifnet *, u16); static void lem_setup_vlan_hw_support(struct adapter *); -#endif static int lem_xmit(struct adapter *, struct mbuf **); static void lem_smartspeed(struct adapter *); static int lem_82547_fifo_workaround(struct adapter *, int); @@ -231,6 +226,8 @@ static u32 lem_fill_descriptors (bus_add static int lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS); static void lem_add_int_delay_sysctl(struct adapter *, const char *, const char *, struct em_int_delay_info *, int, int); +static void lem_set_flow_cntrl(struct adapter *, const char *, + const char *, int *, int); /* Management and WOL Support */ static void lem_init_manageability(struct adapter *); static void lem_release_manageability(struct adapter *); @@ -244,11 +241,7 @@ static void lem_led_func(void *, int); #ifdef EM_LEGACY_IRQ static void lem_intr(void *); #else /* FAST IRQ */ -#if __FreeBSD_version < 700000 -static void lem_irq_fast(void *); -#else static int lem_irq_fast(void *); -#endif static void lem_handle_rxtx(void *context, int pending); static void lem_handle_link(void *context, int pending); static void lem_add_rx_process_limit(struct adapter *, const char *, @@ -320,14 +313,6 @@ TUNABLE_INT("hw.em.rx_process_limit", &l static int lem_fc_setting = e1000_fc_full; TUNABLE_INT("hw.em.fc_setting", &lem_fc_setting); -/* -** Shadow VFTA table, this is needed because -** the real vlan filter table gets cleared during -** a soft reset and the driver needs to be able -** to repopulate it. -*/ -static u32 lem_shadow_vfta[EM_VFTA_SIZE]; - /* Global used in WOL setup with multiport cards */ static int global_quad_port_a = 0; @@ -462,6 +447,11 @@ lem_attach(device_t dev) lem_rx_process_limit); #endif + /* Sysctl for setting the interface flow control */ + lem_set_flow_cntrl(adapter, "flow_control", + "max number of rx packets to process", + &adapter->fc_setting, lem_fc_setting); + /* * Validate number of transmit and receive descriptors. It * must not exceed hardware maximum, and must be multiple @@ -638,13 +628,11 @@ lem_attach(device_t dev) else adapter->pcix_82544 = FALSE; -#if __FreeBSD_version >= 700029 /* Register for VLAN events */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, lem_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, lem_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); -#endif lem_add_hw_stats(adapter); @@ -702,11 +690,7 @@ lem_detach(device_t dev) INIT_DEBUGOUT("em_detach: begin"); /* Make sure VLANS are not using driver */ -#if __FreeBSD_version >= 700000 if (adapter->ifp->if_vlantrunk != NULL) { -#else - if (adapter->ifp->if_nvlans != 0) { -#endif device_printf(dev,"Vlan in use, detach first\n"); return (EBUSY); } @@ -730,13 +714,11 @@ lem_detach(device_t dev) EM_TX_UNLOCK(adapter); EM_CORE_UNLOCK(adapter); -#if __FreeBSD_version >= 700029 /* Unregister VLAN events */ if (adapter->vlan_attach != NULL) EVENTHANDLER_DEREGISTER(vlan_config, adapter->vlan_attach); if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); -#endif ether_ifdetach(adapter->ifp); callout_drain(&adapter->timer); @@ -831,6 +813,19 @@ lem_start_locked(struct ifnet *ifp) if (!adapter->link_active) return; + /* + * Force a cleanup if number of TX descriptors + * available hits the threshold + */ + if (adapter->num_tx_desc_avail <= EM_TX_CLEANUP_THRESHOLD) { + lem_txeof(adapter); + /* Now do we at least have a minimal? */ + if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) { + adapter->no_tx_desc_avail1++; + return; + } + } + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); @@ -1043,9 +1038,7 @@ lem_ioctl(struct ifnet *ifp, u_long comm } if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) lem_init(adapter); -#if __FreeBSD_version >= 700000 VLAN_CAPABILITIES(ifp); -#endif break; } @@ -1135,17 +1128,8 @@ lem_init_locked(struct adapter *adapter) /* Setup VLAN support, basic and offload if available */ E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN); -#if __FreeBSD_version < 700029 - if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { - u32 ctrl; - ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); - ctrl |= E1000_CTRL_VME; - E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); - } -#else /* Use real VLAN Filter support */ lem_setup_vlan_hw_support(adapter); -#endif /* Set hardware offload abilities */ ifp->if_hwassist = 0; @@ -1174,6 +1158,19 @@ lem_init_locked(struct adapter *adapter) } lem_initialize_receive_unit(adapter); + /* Use real VLAN Filter support? */ + if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) + /* Use real VLAN Filter support */ + lem_setup_vlan_hw_support(adapter); + else { + u32 ctrl; + ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); + ctrl |= E1000_CTRL_VME; + E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); + } + } + /* Don't lose promiscuous settings */ lem_set_promisc(adapter); @@ -1276,7 +1273,6 @@ lem_poll(struct ifnet *ifp, enum poll_cm * Legacy Interrupt Service routine * *********************************************************************/ - static void lem_intr(void *arg) { @@ -1311,7 +1307,6 @@ lem_intr(void *arg) } EM_TX_LOCK(adapter); - lem_txeof(adapter); lem_rxeof(adapter, -1, NULL); lem_txeof(adapter); if (ifp->if_drv_flags & IFF_DRV_RUNNING && @@ -1354,8 +1349,7 @@ lem_handle_rxtx(void *context, int pendi if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (lem_rxeof(adapter, adapter->rx_process_limit, NULL) != 0) - taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); + lem_rxeof(adapter, adapter->rx_process_limit, NULL); EM_TX_LOCK(adapter); lem_txeof(adapter); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1363,7 +1357,8 @@ lem_handle_rxtx(void *context, int pendi EM_TX_UNLOCK(adapter); } - lem_enable_intr(adapter); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + lem_enable_intr(adapter); } /********************************************************************* @@ -1371,13 +1366,7 @@ lem_handle_rxtx(void *context, int pendi * Fast Legacy/MSI Combined Interrupt Service routine * *********************************************************************/ -#if __FreeBSD_version < 700000 -#define FILTER_STRAY -#define FILTER_HANDLED -static void -#else static int -#endif lem_irq_fast(void *arg) { struct adapter *adapter = arg; @@ -1550,25 +1539,10 @@ lem_xmit(struct adapter *adapter, struct struct mbuf *m_head; u32 txd_upper, txd_lower, txd_used, txd_saved; int error, nsegs, i, j, first, last = 0; -#if __FreeBSD_version < 700000 - struct m_tag *mtag; -#endif + m_head = *m_headp; txd_upper = txd_lower = txd_used = txd_saved = 0; - /* - * Force a cleanup if number of TX descriptors - * available hits the threshold - */ - if (adapter->num_tx_desc_avail <= EM_TX_CLEANUP_THRESHOLD) { - lem_txeof(adapter); - /* Now do we at least have a minimal? */ - if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) { - adapter->no_tx_desc_avail1++; - return (ENOBUFS); - } - } - /* ** When doing checksum offload, it is critical to ** make sure the first mbuf has more than header, @@ -1712,20 +1686,6 @@ lem_xmit(struct adapter *adapter, struct else adapter->num_tx_desc_avail -= nsegs; - /* - ** Handle VLAN tag, this is the - ** biggest difference between - ** 6.x and 7 - */ -#if __FreeBSD_version < 700000 - /* Find out if we are in vlan mode. */ - mtag = VLAN_OUTPUT_TAG(ifp, m_head); - if (mtag != NULL) { - ctxd->upper.fields.special = - htole16(VLAN_TAG_VALUE(mtag)); - ctxd->lower.data |= htole32(E1000_TXD_CMD_VLE); - } -#else /* FreeBSD 7 */ if (m_head->m_flags & M_VLANTAG) { /* Set the vlan id. */ ctxd->upper.fields.special = @@ -1733,7 +1693,6 @@ lem_xmit(struct adapter *adapter, struct /* Tell hardware to add tag */ ctxd->lower.data |= htole32(E1000_TXD_CMD_VLE); } -#endif tx_buffer->m_head = m_head; tx_buffer_mapped->map = tx_buffer->map; @@ -2249,11 +2208,7 @@ lem_allocate_irq(struct adapter *adapter #ifdef EM_LEGACY_IRQ /* We do Legacy setup */ if ((error = bus_setup_intr(dev, adapter->res[0], -#if __FreeBSD_version > 700000 INTR_TYPE_NET | INTR_MPSAFE, NULL, lem_intr, adapter, -#else /* 6.X */ - INTR_TYPE_NET | INTR_MPSAFE, lem_intr, adapter, -#endif &adapter->tag[0])) != 0) { device_printf(dev, "Failed to register interrupt handler"); return (error); @@ -2270,13 +2225,8 @@ lem_allocate_irq(struct adapter *adapter taskqueue_thread_enqueue, &adapter->tq); taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s taskq", device_get_nameunit(adapter->dev)); -#if __FreeBSD_version < 700000 - if ((error = bus_setup_intr(dev, adapter->res[0], - INTR_TYPE_NET | INTR_FAST, lem_irq_fast, adapter, -#else if ((error = bus_setup_intr(dev, adapter->res[0], INTR_TYPE_NET, lem_irq_fast, NULL, adapter, -#endif &adapter->tag[0])) != 0) { device_printf(dev, "Failed to register fast interrupt " "handler: %d\n", error); @@ -2362,7 +2312,7 @@ lem_hardware_init(struct adapter *adapte adapter->hw.fc.send_xon = TRUE; /* Set Flow control, use the tunable location if sane */ - if ((lem_fc_setting >= 0) || (lem_fc_setting < 4)) + if ((lem_fc_setting >= 0) && (lem_fc_setting < 4)) adapter->hw.fc.requested_mode = lem_fc_setting; else adapter->hw.fc.requested_mode = e1000_fc_none; @@ -2410,14 +2360,8 @@ lem_setup_interface(device_t dev, struct ifp->if_capabilities = ifp->if_capenable = 0; if (adapter->hw.mac.type >= e1000_82543) { - int version_cap; -#if __FreeBSD_version < 700000 - version_cap = IFCAP_HWCSUM; -#else - version_cap = IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; -#endif - ifp->if_capabilities |= version_cap; - ifp->if_capenable |= version_cap; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; + ifp->if_capenable |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; } /* @@ -2427,6 +2371,16 @@ lem_setup_interface(device_t dev, struct ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + /* + ** Dont turn this on by default, if vlans are + ** created on another pseudo device (eg. lagg) + ** then vlan events are not passed thru, breaking + ** operation, but with HW FILTER off it works. If + ** using vlans directly on the em driver you can + ** enable this and get full hardware tag filtering. + */ + ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; + #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif @@ -2551,11 +2505,7 @@ lem_dma_malloc(struct adapter *adapter, { int error; -#if __FreeBSD_version >= 700000 error = bus_dma_tag_create(bus_get_dma_tag(adapter->dev), /* parent */ -#else - error = bus_dma_tag_create(NULL, /* parent */ -#endif EM_DBA_ALIGN, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -2640,21 +2590,17 @@ lem_allocate_transmit_structures(struct /* * Create DMA tags for tx descriptors */ -#if __FreeBSD_version >= 700000 if ((error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ -#else - if ((error = bus_dma_tag_create(NULL, /* parent */ -#endif 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - EM_TSO_SIZE, /* maxsize */ + MCLBYTES * EM_MAX_SCATTER, /* maxsize */ EM_MAX_SCATTER, /* nsegments */ - EM_TSO_SEG_SIZE, /* maxsegsize */ + MCLBYTES, /* maxsegsize */ 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockarg */ + NULL, /* lockfunc */ + NULL, /* lockarg */ &adapter->txtag)) != 0) { device_printf(dev, "Unable to allocate TX DMA tag\n"); goto fail; @@ -3072,23 +3018,20 @@ lem_txeof(struct adapter *adapter) BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); adapter->next_tx_to_clean = first; + adapter->num_tx_desc_avail = num_avail; /* * If we have enough room, clear IFF_DRV_OACTIVE to * tell the stack that it is OK to send packets. * If there are no pending descriptors, clear the watchdog. */ - if (num_avail > EM_TX_CLEANUP_THRESHOLD) { + if (adapter->num_tx_desc_avail > EM_TX_CLEANUP_THRESHOLD) { ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - if (num_avail == adapter->num_tx_desc) { + if (adapter->num_tx_desc_avail == adapter->num_tx_desc) { adapter->watchdog_check = FALSE; - adapter->num_tx_desc_avail = num_avail; return; } } - - adapter->num_tx_desc_avail = num_avail; - return; } /********************************************************************* @@ -3185,11 +3128,7 @@ lem_allocate_receive_structures(struct a return (ENOMEM); } -#if __FreeBSD_version >= 700000 error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ -#else - error = bus_dma_tag_create(NULL, /* parent */ -#endif 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -3459,7 +3398,7 @@ lem_rxeof(struct adapter *adapter, int c { struct ifnet *ifp = adapter->ifp;; struct mbuf *mp; - u8 status, accept_frame = 0, eop = 0; + u8 status = 0, accept_frame = 0, eop = 0; u16 len, desc_len, prev_len_adj; int i, rx_sent = 0; struct e1000_rx_desc *current_desc; @@ -3477,11 +3416,13 @@ lem_rxeof(struct adapter *adapter, int c return (FALSE); } - while ((current_desc->status & E1000_RXD_STAT_DD) && - (count != 0) && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + while (count != 0 && ifp->if_drv_flags & IFF_DRV_RUNNING) { struct mbuf *m = NULL; + status = current_desc->status; + if ((status & E1000_RXD_STAT_DD) == 0) + break; + mp = adapter->rx_buffer_area[i].m_head; /* * Can't defer bus_dmamap_sync(9) because TBI_ACCEPT @@ -3493,7 +3434,6 @@ lem_rxeof(struct adapter *adapter, int c accept_frame = 1; prev_len_adj = 0; desc_len = le16toh(current_desc->length); - status = current_desc->status; if (status & E1000_RXD_STAT_EOP) { count--; eop = 1; @@ -3571,16 +3511,10 @@ lem_rxeof(struct adapter *adapter, int c goto skip; #endif if (status & E1000_RXD_STAT_VP) { -#if __FreeBSD_version < 700000 - VLAN_INPUT_TAG_NEW(ifp, adapter->fmp, - (le16toh(current_desc->special) & - E1000_RXD_SPC_VLAN_MASK)); -#else adapter->fmp->m_pkthdr.ether_vtag = (le16toh(current_desc->special) & E1000_RXD_SPC_VLAN_MASK); adapter->fmp->m_flags |= M_VLANTAG; -#endif } #ifndef __NO_STRICT_ALIGNMENT skip: @@ -3636,7 +3570,7 @@ discard: if (done != NULL) *done = rx_sent; EM_RX_UNLOCK(adapter); - return (current_desc->status & E1000_RXD_STAT_DD); + return ((status & E1000_RXD_STAT_DD) ? TRUE : FALSE); } #ifndef __NO_STRICT_ALIGNMENT @@ -3728,7 +3662,6 @@ lem_receive_checksum(struct adapter *ada } } -#if __FreeBSD_version >= 700029 /* * This routine is run via an vlan * config EVENT @@ -3745,12 +3678,15 @@ lem_register_vlan(void *arg, struct ifne if ((vtag == 0) || (vtag > 4095)) /* Invalid ID */ return; + EM_CORE_LOCK(adapter); index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; - lem_shadow_vfta[index] |= (1 << bit); + adapter->shadow_vfta[index] |= (1 << bit); ++adapter->num_vlans; /* Re-init to load the changes */ - lem_init(adapter); + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) + lem_init_locked(adapter); + EM_CORE_UNLOCK(adapter); } /* @@ -3769,12 +3705,15 @@ lem_unregister_vlan(void *arg, struct if if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; + EM_CORE_LOCK(adapter); index = (vtag >> 5) & 0x7F; bit = vtag & 0x1F; - lem_shadow_vfta[index] &= ~(1 << bit); + adapter->shadow_vfta[index] &= ~(1 << bit); --adapter->num_vlans; /* Re-init to load the changes */ - lem_init(adapter); + if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) + lem_init_locked(adapter); + EM_CORE_UNLOCK(adapter); } static void @@ -3797,9 +3736,9 @@ lem_setup_vlan_hw_support(struct adapter ** we need to repopulate it now. */ for (int i = 0; i < EM_VFTA_SIZE; i++) - if (lem_shadow_vfta[i] != 0) + if (adapter->shadow_vfta[i] != 0) E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, - i, lem_shadow_vfta[i]); + i, adapter->shadow_vfta[i]); reg = E1000_READ_REG(hw, E1000_CTRL); reg |= E1000_CTRL_VME; @@ -3815,7 +3754,6 @@ lem_setup_vlan_hw_support(struct adapter E1000_WRITE_REG(&adapter->hw, E1000_RLPML, adapter->max_frame_size + VLAN_TAG_SIZE); } -#endif static void lem_enable_intr(struct adapter *adapter) @@ -4661,6 +4599,16 @@ lem_add_int_delay_sysctl(struct adapter info, 0, lem_sysctl_int_delay, "I", description); } +static void +lem_set_flow_cntrl(struct adapter *adapter, const char *name, + const char *description, int *limit, int value) +{ + *limit = value; + SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), + OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); +} + #ifndef EM_LEGACY_IRQ static void lem_add_rx_process_limit(struct adapter *adapter, const char *name, @@ -4672,5 +4620,3 @@ lem_add_rx_process_limit(struct adapter OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, limit, value, description); } #endif - - Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Mon Nov 1 20:17:15 2010 (r214645) +++ head/sys/dev/e1000/if_lem.h Mon Nov 1 20:19:25 2010 (r214646) @@ -328,11 +328,9 @@ struct adapter { struct task tx_task; struct taskqueue *tq; /* private task queue */ -#if __FreeBSD_version >= 700029 eventhandler_tag vlan_attach; eventhandler_tag vlan_detach; u32 num_vlans; -#endif /* Management and WOL features */ u32 wol; @@ -341,11 +339,22 @@ struct adapter { /* Multicast array memory */ u8 *mta; - /* Info about the board itself */ + + /* + ** Shadow VFTA table, this is needed because + ** the real vlan filter table gets cleared during + ** a soft reset and the driver needs to be able + ** to repopulate it. + */ + u32 shadow_vfta[EM_VFTA_SIZE]; + + /* Info about the interface */ uint8_t link_active; uint16_t link_speed; uint16_t link_duplex; uint32_t smartspeed; + uint32_t fc_setting; + struct em_int_delay_info tx_int_delay; struct em_int_delay_info tx_abs_int_delay; struct em_int_delay_info rx_int_delay; @@ -407,6 +416,9 @@ struct adapter { unsigned long no_tx_dma_setup; unsigned long watchdog_events; unsigned long rx_overruns; + unsigned long rx_irq; + unsigned long tx_irq; + unsigned long link_irq; /* 82547 workaround */ uint32_t tx_fifo_size; From owner-svn-src-head@FreeBSD.ORG Mon Nov 1 21:04:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD2381065675; Mon, 1 Nov 2010 21:04:23 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B201B8FC29; Mon, 1 Nov 2010 21:04:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA1L4NtB089090; Mon, 1 Nov 2010 21:04:23 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA1L4NfX089088; Mon, 1 Nov 2010 21:04:23 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201011012104.oA1L4NfX089088@svn.freebsd.org> From: Olivier Houchard Date: Mon, 1 Nov 2010 21:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214648 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2010 21:04:24 -0000 Author: cognet Date: Mon Nov 1 21:04:23 2010 New Revision: 214648 URL: http://svn.freebsd.org/changeset/base/214648 Log: Try to be a little smart at guessing where _start is located in flash, instead of relying on a binutils bug. Reported by: dim Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Mon Nov 1 20:20:31 2010 (r214647) +++ head/sys/arm/arm/elf_trampoline.c Mon Nov 1 21:04:23 2010 (r214648) @@ -159,7 +159,7 @@ _startC(void) #if defined(FLASHADDR) && defined(LOADERRAMADDR) unsigned int pc; - __asm __volatile("adr %0, _start\n" + __asm __volatile("mov %0, pc\n" : "=r" (pc)); if ((FLASHADDR > LOADERRAMADDR && pc >= FLASHADDR) || (FLASHADDR < LOADERRAMADDR && pc < LOADERRAMADDR)) { @@ -173,11 +173,13 @@ _startC(void) */ unsigned int target_addr; unsigned int tmp_sp; + uint32_t src_addr = (uint32_t)&_start - PHYSADDR + FLASHADDR + + (pc - FLASHADDR - ((uint32_t)&_startC - PHYSADDR)) & 0xfffff000; target_addr = (unsigned int)&_start - PHYSADDR + LOADERRAMADDR; tmp_sp = target_addr + 0x100000 + (unsigned int)&_end - (unsigned int)&_start; - memcpy((char *)target_addr, (char *)pc, + memcpy((char *)target_addr, (char *)src_addr, (unsigned int)&_end - (unsigned int)&_start); /* Temporary set the sp and jump to the new location. */ __asm __volatile( From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 01:24:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54F5E1065672; Tue, 2 Nov 2010 01:24:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4315C8FC16; Tue, 2 Nov 2010 01:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA21OoVD003614; Tue, 2 Nov 2010 01:24:50 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA21OoXf003612; Tue, 2 Nov 2010 01:24:50 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011020124.oA21OoXf003612@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 2 Nov 2010 01:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214651 - head/contrib/gdb/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 01:24:50 -0000 Author: gonzo Date: Tue Nov 2 01:24:49 2010 New Revision: 214651 URL: http://svn.freebsd.org/changeset/base/214651 Log: Fix reading of .debug_line on MIPS64, big-endian: read_initial_length detects pointer size by checking first 4 bytes of .debug_line and stores it in struct comp_unit_head * passed to it as second argument. By passing NULL to a read_initial_length we ignore actual pointer size (8 bytes) and use default (4 bytes) which results in wrong offsets of header fields. Modified: head/contrib/gdb/gdb/dwarf2read.c Modified: head/contrib/gdb/gdb/dwarf2read.c ============================================================================== --- head/contrib/gdb/gdb/dwarf2read.c Mon Nov 1 22:11:18 2010 (r214650) +++ head/contrib/gdb/gdb/dwarf2read.c Tue Nov 2 01:24:49 2010 (r214651) @@ -5178,7 +5178,7 @@ dwarf_decode_line_header (unsigned int o line_ptr = dwarf_line_buffer + offset; /* read in the header */ - lh->total_length = read_initial_length (abfd, line_ptr, NULL, &bytes_read); + lh->total_length = read_initial_length (abfd, line_ptr, &cu->header, &bytes_read); line_ptr += bytes_read; if (line_ptr + lh->total_length > dwarf_line_buffer + dwarf_line_size) { From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 01:26:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD5381065673; Tue, 2 Nov 2010 01:26:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B8188FC17; Tue, 2 Nov 2010 01:26:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA21QLcA003789; Tue, 2 Nov 2010 01:26:21 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA21QLDD003788; Tue, 2 Nov 2010 01:26:21 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011020126.oA21QLDD003788@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 2 Nov 2010 01:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214652 - head/contrib/gdb/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 01:26:21 -0000 Author: gonzo Date: Tue Nov 2 01:26:21 2010 New Revision: 214652 URL: http://svn.freebsd.org/changeset/base/214652 Log: - Add ELF core for FreeBSD/mips - Register all known cores in init function Modified: head/contrib/gdb/gdb/mipsfbsd-tdep.c Modified: head/contrib/gdb/gdb/mipsfbsd-tdep.c ============================================================================== --- head/contrib/gdb/gdb/mipsfbsd-tdep.c Tue Nov 2 01:24:49 2010 (r214651) +++ head/contrib/gdb/gdb/mipsfbsd-tdep.c Tue Nov 2 01:26:21 2010 (r214652) @@ -187,6 +187,14 @@ static struct core_fns mipsfbsd_core_fns NULL /* next */ }; +static struct core_fns mipsfbsd_elfcore_fns = +{ + bfd_target_elf_flavour, /* core_flavour */ + default_check_format, /* check_format */ + default_core_sniffer, /* core_sniffer */ + fetch_elfcore_registers, /* core_read_registers */ + NULL /* next */ +}; /* * MIPSFBSD Offsets @@ -576,4 +584,6 @@ _initialize_mipsfbsd_tdep (void) { gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_FREEBSD_ELF, mipsfbsd_init_abi); + add_core_fns (&mipsfbsd_core_fns); + add_core_fns (&mipsfbsd_elfcore_fns); } From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 01:41:00 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F28F21065670; Tue, 2 Nov 2010 01:40:59 +0000 (UTC) Date: Tue, 2 Nov 2010 01:40:59 +0000 From: Alexander Best To: Ken Smith Message-ID: <20101102014059.GA91353@freebsd.org> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> <20101031191119.GM46314@acme.spoerlein.net> <1288620951.3596.32.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1288620951.3596.32.camel@bauer.cse.buffalo.edu> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek , Ulrich Spoerlein Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 01:41:00 -0000 On Mon Nov 1 10, Ken Smith wrote: > On Sun, 2010-10-31 at 20:11 +0100, Ulrich Spoerlein wrote: > > On Sun, 31.10.2010 at 17:06:03 +0100, Pawel Jakub Dawidek wrote: > > > On Sun, Oct 31, 2010 at 09:21:28AM +0000, Ulrich Spoerlein wrote: > > > > Author: uqs > > > > Date: Sun Oct 31 09:21:27 2010 > > > > New Revision: 214596 > > > > URL: http://svn.freebsd.org/changeset/base/214596 > > > > > > > > Log: > > > > Elaborate some more on the non-security implications of using -P > > > [...] > > > > +.Pp > > > > +N.B.: The > > > > +.Fl P > > > > +flag is not considered a security feature > > > > +.Pq see Sx BUGS . > > > > > > I'm sorry for jumping so late into the subject, but if it is not a > > > security feature than what other purpose has left? > > > > > > Really guys, this option is useless. > > > > > > There is no reliable way to verify if the blocks are really overwritten. > > > Period. > > > > > > If it is not used for security, then I see no other use for it (except > > > for [1]). > > > > > > If it is used for security then we better have a way to give the user > > > the right answer to the question "is my data really gone?" and don't > > > make false assumptions or giving answers "we hope so". > > > > > > Why there is no reliable way to verify this? > > > 1. Check file system type (UFS, ZFS). > > > 2. Check file system configuration (UFS with snapshots?). > > > 3. Be sure sync(2) the file system and send BIO_FLUSH to all the media > > > involved (some cheap flash disks lie about BIO_FLUSH support). > > > 4. Check underlying media (GLABEL provider - no modification to the data). > > > 5. Check underlying media (ZVOL - data won't be overwritten, but...). > > > 6. Check ZFS vdevs (on which providers ZVOL's pool is based on). > > > 7. Check vdevs (GELI - cool, we have encryption). > > > 8. Check GELI configuration (maybe NULL encryption algorithm?). > > > 9. Check underlying media (HDD, SSD, swap-backed md(4) device? goto 3). > > > 10. Check if the sectors weren't remapped while we were overwriting. > > > > > > In other words this is soooo complicated that it would simply be too > > > hard to explain to regular user or implement in rm(1). > > > > > > IMHO this option should be removed and rm(1) should fail when a user is > > > trying to use it. > > > > No, this is a POLA violation for no apparent gain. The flag has been in > > FreeBSD since at least '94. Remember, that we are in the rope-selling > > business. We empower the users to shoot themselves in the foot. > > Just playing Devils' Advocate... If the removal of -P were done as > part of a new branch the POLA argument is moot if it's judged you > are a bit off on the "no apparent gain" aspect. And the rope selling > argument also only applies so far. One could argue having our installer > by default leave a machine set up so SSH was enabled, remote root logins > were allowed, and no initial password set up for root is fine because > we're in the rope-selling business and for some portion of the user > base that's just fine. I know that's extreme but that's the point, > I'm saying it's hard to figure out exactly where the line is between > activities that are ill-advised versus those that are just plain > stupid sometimes. > > So, please, given all the attention being given to the security aspects > of users properly erasing data they should erase I'd prefer we focus on > whether providing -P at all is flat out lying and base the decision > about whether it should go based on that. Lots of things we thought > were OK back in 1994 we've changed our minds about since then. > > > I, for one, am using the -P option in a certain case where I can be sure > > that ~99% of the data will be obliterated and I'm fine with that. For > > all other cases I'm using geli or gbde (where I can make sure, that data > > is lost). > > This strongly backs up Pawel's argument that the existence of -P is a > lie. > > > So we can either fix -P for all cases (impossible), or at least document > > its shortcomings. Documenting them clearly is better than what we had a > > couple of days before. > > As I said above, with re@ hat on since the claim of POLA above is > slightly based on branch/release guidelines, I think removal of -P > is also still an option if it's decided -P is a lie. how about a compromise then? let's leave the -P switch in rm, but make it a no op! in addition to that add a new rm(1) entry explaining what the -P switch did and why exactly it was turned into a no op. let's be really eloborate on this issue and tell the user exactly every tiny detail that lead to the conclusion that currently the -P switch serves no purpose and thus it was turned into a no op. also a statement should be added to rm(1) that makes clear that the -P flag *will* come back to rm, once the low level work has been finished in order to decide (from userland) whether a specific disk supports overwriting blocks or not. thoughts? cheers. alex > > -- > Ken Smith > - From there to here, from here to | kensmith@buffalo.edu > there, funny things are everywhere. | > - Theodor Geisel | -- a13x From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 02:03:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A71C1065670; Tue, 2 Nov 2010 02:03:11 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 16AB58FC13; Tue, 2 Nov 2010 02:03:09 +0000 (UTC) Received: by wwb17 with SMTP id 17so768379wwb.31 for ; Mon, 01 Nov 2010 19:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=ABPm3U6i6cGxF0o4jGEMuqVGKfC7WCIiE1K0Jqmsp14=; b=VV6RW7eg2slVozkIeKoyI4vIcv6jKkdybzDS5dPbhsjqFj53B1wYC//snpZwpAaGhA hO4V+CaM7iugMNDmcZqZsv34tPAtYuoZsnetLZRMON6h7oET6u9cU0uq1dfZnc7W1OxZ kCWhvAyUdDYso7w4E4hG/n3RNIUHr0xUPCHkk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=VmelnFdPjzjAqmDoyxHFMrDb73brcNztiEyM80VwbQtlBzrM6mz6ehPJi1vBvGgtWB M5WQM8EfstMf+10JOugaN0gm3cf/Tb8tfhOM2VMsIBc7qRqI/f9nuKtHLV8igId4ygp7 mM+2XMXNX9ZWDVFU9bFBTRKuPnIH30QembnO4= MIME-Version: 1.0 Received: by 10.216.82.197 with SMTP id o47mr16417052wee.45.1288663388220; Mon, 01 Nov 2010 19:03:08 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Mon, 1 Nov 2010 19:03:07 -0700 (PDT) In-Reply-To: <20101102014059.GA91353@freebsd.org> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> <20101031191119.GM46314@acme.spoerlein.net> <1288620951.3596.32.camel@bauer.cse.buffalo.edu> <20101102014059.GA91353@freebsd.org> Date: Mon, 1 Nov 2010 19:03:07 -0700 X-Google-Sender-Auth: x_S5RXo13EjqD_cNjdMAj_XdXa0 Message-ID: From: Garrett Cooper To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Ken Smith , svn-src-all@freebsd.org, Ulrich Spoerlein , svn-src-head@freebsd.org Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 02:03:11 -0000 On Mon, Nov 1, 2010 at 6:40 PM, Alexander Best wrote: > On Mon Nov =A01 10, Ken Smith wrote: >> On Sun, 2010-10-31 at 20:11 +0100, Ulrich Spoerlein wrote: >> > On Sun, 31.10.2010 at 17:06:03 +0100, Pawel Jakub Dawidek wrote: >> > > On Sun, Oct 31, 2010 at 09:21:28AM +0000, Ulrich Spoerlein wrote: >> > > > Author: uqs >> > > > Date: Sun Oct 31 09:21:27 2010 >> > > > New Revision: 214596 >> > > > URL: http://svn.freebsd.org/changeset/base/214596 >> > > > >> > > > Log: >> > > > =A0 Elaborate some more on the non-security implications of using = -P >> > > [...] >> > > > +.Pp >> > > > +N.B.: The >> > > > +.Fl P >> > > > +flag is not considered a security feature >> > > > +.Pq see Sx BUGS . >> > > >> > > I'm sorry for jumping so late into the subject, but if it is not a >> > > security feature than what other purpose has left? >> > > >> > > Really guys, this option is useless. >> > > >> > > There is no reliable way to verify if the blocks are really overwrit= ten. >> > > Period. >> > > >> > > If it is not used for security, then I see no other use for it (exce= pt >> > > for [1]). >> > > >> > > If it is used for security then we better have a way to give the use= r >> > > the right answer to the question "is my data really gone?" and don't >> > > make false assumptions or giving answers "we hope so". >> > > >> > > Why there is no reliable way to verify this? >> > > 1. Check file system type (UFS, ZFS). >> > > 2. Check file system configuration (UFS with snapshots?). >> > > 3. Be sure sync(2) the file system and send BIO_FLUSH to all the med= ia >> > > =A0 =A0involved (some cheap flash disks lie about BIO_FLUSH support)= . >> > > 4. Check underlying media (GLABEL provider - no modification to the = data). >> > > 5. Check underlying media (ZVOL - data won't be overwritten, but...)= . >> > > 6. Check ZFS vdevs (on which providers ZVOL's pool is based on). >> > > 7. Check vdevs (GELI - cool, we have encryption). >> > > 8. Check GELI configuration (maybe NULL encryption algorithm?). >> > > 9. Check underlying media (HDD, SSD, swap-backed md(4) device? goto = 3). >> > > 10. Check if the sectors weren't remapped while we were overwriting. >> > > >> > > In other words this is soooo complicated that it would simply be too >> > > hard to explain to regular user or implement in rm(1). >> > > >> > > IMHO this option should be removed and rm(1) should fail when a user= is >> > > trying to use it. >> > >> > No, this is a POLA violation for no apparent gain. The flag has been i= n >> > FreeBSD since at least '94. Remember, that we are in the rope-selling >> > business. We empower the users to shoot themselves in the foot. >> >> Just playing Devils' Advocate... =A0If the removal of -P were done as >> part of a new branch the POLA argument is moot if it's judged you >> are a bit off on the "no apparent gain" aspect. =A0And the rope selling >> argument also only applies so far. =A0One could argue having our install= er >> by default leave a machine set up so SSH was enabled, remote root logins >> were allowed, and no initial password set up for root is fine because >> we're in the rope-selling business and for some portion of the user >> base that's just fine. =A0I know that's extreme but that's the point, >> I'm saying it's hard to figure out exactly where the line is between >> activities that are ill-advised versus those that are just plain >> stupid sometimes. >> >> So, please, given all the attention being given to the security aspects >> of users properly erasing data they should erase I'd prefer we focus on >> whether providing -P at all is flat out lying and base the decision >> about whether it should go based on that. =A0Lots of things we thought >> were OK back in 1994 we've changed our minds about since then. >> >> > I, for one, am using the -P option in a certain case where I can be su= re >> > that ~99% of the data will be obliterated and I'm fine with that. For >> > all other cases I'm using geli or gbde (where I can make sure, that da= ta >> > is lost). >> >> This strongly backs up Pawel's argument that the existence of -P is a >> lie. >> >> > So we can either fix -P for all cases (impossible), or at least docume= nt >> > its shortcomings. Documenting them clearly is better than what we had = a >> > couple of days before. >> >> As I said above, with re@ hat on since the claim of POLA above is >> slightly based on branch/release guidelines, I think removal of -P >> is also still an option if it's decided -P is a lie. > > how about a compromise then? let's leave the -P switch in rm, but make it= a no > op! in addition to that add a new rm(1) entry explaining what the -P swit= ch did > and why exactly it was turned into a no op. let's be really eloborate on = this > issue and tell the user exactly every tiny detail that lead to the conclu= sion > that currently the -P switch serves no purpose and thus it was turned int= o a no > op. also a statement should be added to rm(1) that makes clear that the -= P flag > *will* come back to rm, once the low level work has been finished in orde= r to > decide (from userland) whether a specific disk supports overwriting block= s or > not. I agree with all you said but the "*will* come back to rm" part. I wouldn't open up that particular door unless you were absolutely certain that you could fulfill that commitment. It sounds like with some filesystems that's virtually impossible (like ZFS) because of the way that they're designed (COW snapshots). I could be completely wrong though. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 02:13:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F693106564A; Tue, 2 Nov 2010 02:13:13 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9D68FC0C; Tue, 2 Nov 2010 02:13:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA22DDEs007932; Tue, 2 Nov 2010 02:13:13 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA22DDuS007930; Tue, 2 Nov 2010 02:13:13 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201011020213.oA22DDuS007930@svn.freebsd.org> From: David Xu Date: Tue, 2 Nov 2010 02:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214653 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 02:13:13 -0000 Author: davidxu Date: Tue Nov 2 02:13:13 2010 New Revision: 214653 URL: http://svn.freebsd.org/changeset/base/214653 Log: Use sysctl kern.sched.cpusetsize to retrieve size of kernel cpuset. Modified: head/lib/libthr/thread/thr_attr.c Modified: head/lib/libthr/thread/thr_attr.c ============================================================================== --- head/lib/libthr/thread/thr_attr.c Tue Nov 2 01:26:21 2010 (r214652) +++ head/lib/libthr/thread/thr_attr.c Tue Nov 2 02:13:13 2010 (r214653) @@ -569,14 +569,11 @@ _get_kern_cpuset_size(void) if (kern_cpuset_size == 0) { size_t len; - int maxcpus; - len = sizeof(maxcpus); - if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &len, NULL, 0)) - PANIC("failed to get sysctl kern.smp.maxcpus"); - int nbits_long = sizeof(long) * NBBY; - int num_long = (maxcpus + nbits_long - 1) / nbits_long; - kern_cpuset_size = num_long * sizeof(long); + len = sizeof(kern_cpuset_size); + if (sysctlbyname("kern.sched.cpusetsize", &kern_cpuset_size, + &len, NULL, 0)) + PANIC("failed to get sysctl kern.sched.cpusetsize"); } return (kern_cpuset_size); From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 05:27:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11D71065674; Tue, 2 Nov 2010 05:27:05 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF8CA8FC12; Tue, 2 Nov 2010 05:27:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA25R5f8021629; Tue, 2 Nov 2010 05:27:05 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA25R5mA021627; Tue, 2 Nov 2010 05:27:05 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011020527.oA25R5mA021627@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 2 Nov 2010 05:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214654 - head/usr.sbin/config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 05:27:06 -0000 Author: obrien Date: Tue Nov 2 05:27:05 2010 New Revision: 214654 URL: http://svn.freebsd.org/changeset/base/214654 Log: Give the user a hint as to what config(8) is unhappy with. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Tue Nov 2 02:13:13 2010 (r214653) +++ head/usr.sbin/config/mkmakefile.c Tue Nov 2 05:27:05 2010 (r214654) @@ -382,8 +382,8 @@ next: mandatory = 1; } else if (!eq(wd, "optional")) { fprintf(stderr, - "%s: %s must be optional, mandatory or standard\n", - fname, this); + "%s: \"%s\" %s must be optional, mandatory or standard\n", + fname, wd, this); exit(1); } nextparam: From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 05:39:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CF7F106564A; Tue, 2 Nov 2010 05:39:58 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4EEA8FC12; Tue, 2 Nov 2010 05:39:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA25dvlt022076; Tue, 2 Nov 2010 05:39:57 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA25dvkL022074; Tue, 2 Nov 2010 05:39:57 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011020539.oA25dvkL022074@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 2 Nov 2010 05:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214655 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 05:39:58 -0000 Author: obrien Date: Tue Nov 2 05:39:57 2010 New Revision: 214655 URL: http://svn.freebsd.org/changeset/base/214655 Log: Shorten long lines. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Nov 2 05:27:05 2010 (r214654) +++ head/sys/conf/files Tue Nov 2 05:39:57 2010 (r214655) @@ -67,12 +67,12 @@ fdt_static_dtb.h optional fdt fdt_dtb_s compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ." \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" -p16v-alsa%diked.h optional snd_emu10kx pci \ +p16v-alsa%diked.h optional snd_emu10kx pci \ dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h" \ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h p16v-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ clean "p16v-alsa%diked.h" -p17v-alsa%diked.h optional snd_emu10kx pci \ +p17v-alsa%diked.h optional snd_emu10kx pci \ dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h" \ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h p17v-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ @@ -83,12 +83,12 @@ feeder_eq_gen.h optional sound \ no-obj no-implicit-rule before-depend \ clean "feeder_eq_gen.h" feeder_rate_gen.h optional sound \ - dependency "$S/tools/sound/feeder_rate_mkfilter.awk" \ + dependency "$S/tools/sound/feeder_rate_mkfilter.awk" \ compile-with "${AWK} -f $S/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > feeder_rate_gen.h" \ no-obj no-implicit-rule before-depend \ clean "feeder_rate_gen.h" snd_fxdiv_gen.h optional sound \ - dependency "$S/tools/sound/snd_fxdiv_gen.awk" \ + dependency "$S/tools/sound/snd_fxdiv_gen.awk" \ compile-with "${AWK} -f $S/tools/sound/snd_fxdiv_gen.awk -- > snd_fxdiv_gen.h" \ no-obj no-implicit-rule before-depend \ clean "snd_fxdiv_gen.h" From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 09:29:31 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F368106566B; Tue, 2 Nov 2010 09:29:31 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from scuttle.submonkey.net (scuttle.submonkey.net [208.111.43.184]) by mx1.freebsd.org (Postfix) with ESMTP id D78668FC17; Tue, 2 Nov 2010 09:29:26 +0000 (UTC) Received: from cpc6-cdif11-2-0-cust58.5-1.cable.virginmedia.com ([62.255.146.59] helo=shrike.submonkey.net) by scuttle.submonkey.net with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1PDDB5-0007CF-Ku; Tue, 02 Nov 2010 09:29:15 +0000 Received: from ceri by shrike.submonkey.net with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1PDDB2-000Msd-Ug; Tue, 02 Nov 2010 09:29:12 +0000 Date: Tue, 2 Nov 2010 09:29:12 +0000 From: Ceri Davies To: Alexander Best Message-ID: <20101102092912.GA91295@submonkey.net> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> <20101031191119.GM46314@acme.spoerlein.net> <1288620951.3596.32.camel@bauer.cse.buffalo.edu> <20101102014059.GA91353@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline In-Reply-To: <20101102014059.GA91353@freebsd.org> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.20 (2009-06-14) Sender: Ceri Davies Cc: src-committers@FreeBSD.org, Pawel Jakub Dawidek , Ken Smith , svn-src-all@FreeBSD.org, Ulrich Spoerlein , svn-src-head@FreeBSD.org Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 09:29:31 -0000 --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 02, 2010 at 01:40:59AM +0000, Alexander Best wrote: >=20 > how about a compromise then? let's leave the -P switch in rm, but make it= a no > op! in addition to that add a new rm(1) entry explaining what the -P swit= ch did > and why exactly it was turned into a no op. let's be really eloborate on = this > issue and tell the user exactly every tiny detail that lead to the conclu= sion > that currently the -P switch serves no purpose and thus it was turned int= o a no > op. also a statement should be added to rm(1) that makes clear that the -= P flag > *will* come back to rm, once the low level work has been finished in orde= r to > decide (from userland) whether a specific disk supports overwriting block= s or > not. Making it a no-op silently breaks it even in the cases where it was working before. It should fail. Ceri --=20 Haffely, Gaffely, Gaffely, Gonward. --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iD8DBQFMz9noocfcwTS3JF8RAkJXAKCH80b+IKru40pqKzkqJtZSdgxAvwCfcFt0 E6FowjoQ3V8/T4gPuArXA8s= =zmeX -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G-- From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 09:31:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E1B6106564A; Tue, 2 Nov 2010 09:31:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C15E8FC15; Tue, 2 Nov 2010 09:31:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA29VOGm033342; Tue, 2 Nov 2010 09:31:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA29VOw2033340; Tue, 2 Nov 2010 09:31:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011020931.oA29VOw2033340@svn.freebsd.org> From: Alexander Motin Date: Tue, 2 Nov 2010 09:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214672 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 09:31:24 -0000 Author: mav Date: Tue Nov 2 09:31:24 2010 New Revision: 214672 URL: http://svn.freebsd.org/changeset/base/214672 Log: Remove stale line, accidentally slipped into r214016. MFC after: 3 days Modified: head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Tue Nov 2 09:26:12 2010 (r214671) +++ head/sys/dev/ata/chipsets/ata-intel.c Tue Nov 2 09:31:24 2010 (r214672) @@ -315,7 +315,6 @@ ata_intel_ch_attach(device_t dev) map &= 0x03; if (map == 0x00) { ch->flags |= ATA_SATA; - smap[ch->unit] = (ch->unit == 0) ? 0x20 : 0x31; smap[0] = (ch->unit == 0) ? 0 : 1; smap[1] = (ch->unit == 0) ? 2 : 3; } else if (map == 0x02 && ch->unit == 0) { From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 12:40:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC66C106564A; Tue, 2 Nov 2010 12:40:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C08E98FC1A; Tue, 2 Nov 2010 12:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2CeDVZ045638; Tue, 2 Nov 2010 12:40:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2CeD0l045636; Tue, 2 Nov 2010 12:40:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011021240.oA2CeD0l045636@svn.freebsd.org> From: John Baldwin Date: Tue, 2 Nov 2010 12:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214673 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 12:40:14 -0000 Author: jhb Date: Tue Nov 2 12:40:13 2010 New Revision: 214673 URL: http://svn.freebsd.org/changeset/base/214673 Log: Fix a few typos and style nits in the example code. Submitted by: Arnaud Lacombe lacombar of gmail MFC after: 3 days Modified: head/share/man/man9/sysctl_ctx_init.9 Modified: head/share/man/man9/sysctl_ctx_init.9 ============================================================================== --- head/share/man/man9/sysctl_ctx_init.9 Tue Nov 2 09:31:24 2010 (r214672) +++ head/share/man/man9/sysctl_ctx_init.9 Tue Nov 2 12:40:13 2010 (r214673) @@ -188,27 +188,27 @@ This example uses contexts to keep track struct sysctl_ctx_list clist; struct sysctl_oid *oidp; int a_int; -char *string = "dynamic sysctl"; +const char *string = "dynamic sysctl"; ... sysctl_ctx_init(&clist); -oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(/* tree top */), - OID_AUTO, "newtree", CTFLAG_RW, 0, "new top level tree"); -oidp = SYSCTL_ADD_INT( &clist, SYSCTL_CHILDREN(oidp), +oidp = SYSCTL_ADD_NODE(&clist, SYSCTL_STATIC_CHILDREN(/* tree top */), + OID_AUTO, "newtree", CTLFLAG_RW, 0, "new top level tree"); +oidp = SYSCTL_ADD_INT(&clist, SYSCTL_CHILDREN(oidp), OID_AUTO, "newint", CTLFLAG_RW, &a_int, 0, "new int leaf"); ... -oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(_debug), - OID_AUTO, "newtree", CTFLAG_RW, 0, "new tree under debug"); -oidp = SYSCTL_ADD_STRING( &clist, SYSCTL_CHILDREN(oidp), - OID_AUTO, "newstring", CTLFLAG_R, string, 0, "new string leaf"); +oidp = SYSCTL_ADD_NODE(&clist, SYSCTL_STATIC_CHILDREN(_debug), + OID_AUTO, "newtree", CTLFLAG_RW, 0, "new tree under debug"); +oidp = SYSCTL_ADD_STRING(&clist, SYSCTL_CHILDREN(oidp), + OID_AUTO, "newstring", CTLFLAG_RD, string, 0, "new string leaf"); ... /* Now we can free up the oids */ -if(sysctl_ctx_free(&clist)) { +if (sysctl_ctx_free(&clist)) { printf("can't free this context - other oids depend on it"); - return(ENOTEMPTY); + return (ENOTEMPTY); } else { - printf("Success!\\n"): - return(0); + printf("Success!\\n"); + return (0); } .Ed .Pp From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 13:00:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 394CF1065670; Tue, 2 Nov 2010 13:00:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 281598FC0C; Tue, 2 Nov 2010 13:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2D0vgc047230; Tue, 2 Nov 2010 13:00:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2D0vi2047228; Tue, 2 Nov 2010 13:00:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011021300.oA2D0vi2047228@svn.freebsd.org> From: John Baldwin Date: Tue, 2 Nov 2010 13:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214675 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 13:00:57 -0000 Author: jhb Date: Tue Nov 2 13:00:56 2010 New Revision: 214675 URL: http://svn.freebsd.org/changeset/base/214675 Log: Don't leak the LLE lock if the arptimer callout is pending or inactive. Reported by: David Rhodus MFC after: 1 month Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Tue Nov 2 12:42:46 2010 (r214674) +++ head/sys/netinet/if_ether.c Tue Nov 2 13:00:56 2010 (r214675) @@ -178,16 +178,16 @@ arptimer(void *arg) LLE_REMREF(lle); (void) llentry_free(lle); ARPSTAT_INC(timeouts); - } + } else { #ifdef DIAGNOSTIC - else { struct sockaddr *l3addr = L3_ADDR(lle); log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle, inet_ntoa( ((const struct sockaddr_in *)l3addr)->sin_addr)); - } #endif + LLE_WUNLOCK(lle); + } } IF_AFDATA_UNLOCK(ifp); CURVNET_RESTORE(); From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 13:04:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57A00106564A; Tue, 2 Nov 2010 13:04:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BD548FC1B; Tue, 2 Nov 2010 13:04:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2D4QQk047495; Tue, 2 Nov 2010 13:04:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2D4QEB047493; Tue, 2 Nov 2010 13:04:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011021304.oA2D4QEB047493@svn.freebsd.org> From: John Baldwin Date: Tue, 2 Nov 2010 13:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214676 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 13:04:26 -0000 Author: jhb Date: Tue Nov 2 13:04:25 2010 New Revision: 214676 URL: http://svn.freebsd.org/changeset/base/214676 Log: Skip SMAP regions above 4GB on i386 since they will not fit into a long. While here, update some comments to better explain the new code flow. Tested by: dhw Modified: head/sys/x86/x86/nexus.c Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Tue Nov 2 13:00:56 2010 (r214675) +++ head/sys/x86/x86/nexus.c Tue Nov 2 13:04:25 2010 (r214676) @@ -694,15 +694,24 @@ ram_attach(device_t dev) if (smap->type != SMAP_TYPE_MEMORY || smap->length == 0) continue; +#ifdef __i386__ + /* + * Resources use long's to track resources, so + * we can't include memory regions above 4GB. + */ + if (smap->base >= ~0ul) + break; +#endif error = bus_set_resource(dev, SYS_RES_MEMORY, rid, smap->base, smap->length); if (error) - panic("ram_attach: resource %d failed set with %d", + panic( + "ram_attach: resource %d failed set with %d", rid, error); res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0); if (res == NULL) - panic("ram_attach: resource %d failed to attach", + panic("ram_attach: resource %d failed to attach", rid); rid++; } @@ -710,19 +719,17 @@ ram_attach(device_t dev) } /* - * We use the dump_avail[] array rather than phys_avail[] for - * the memory map as phys_avail[] contains holes for kernel - * memory, page 0, the message buffer, and the dcons buffer. - * We test the end address in the loop instead of the start - * since the start address for the first segment is 0. - * - * XXX: It would be preferable to use the SMAP if it exists - * instead since if the SMAP is very fragmented we may not - * include some memory regions in dump_avail[] and phys_avail[]. + * If the system map is not available, fall back to using + * dump_avail[]. We use the dump_avail[] array rather than + * phys_avail[] for the memory map as phys_avail[] contains + * holes for kernel memory, page 0, the message buffer, and + * the dcons buffer. We test the end address in the loop + * instead of the start since the start address for the first + * segment is 0. */ for (i = 0, p = dump_avail; p[1] != 0; i++, p += 2) { rid = i; -#ifdef PAE +#ifdef __i386__ /* * Resources use long's to track resources, so we can't * include memory regions above 4GB. From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 13:06:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 169CC10656D2; Tue, 2 Nov 2010 13:06:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id DE3CB8FC19; Tue, 2 Nov 2010 13:06:41 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9966946B1A; Tue, 2 Nov 2010 09:06:41 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B84168A029; Tue, 2 Nov 2010 09:06:40 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Tue, 2 Nov 2010 09:06:24 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201011021300.oA2D0vi2047228@svn.freebsd.org> In-Reply-To: <201011021300.oA2D0vi2047228@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201011020906.24337.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 02 Nov 2010 09:06:40 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r214675 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 13:06:42 -0000 On Tuesday, November 02, 2010 9:00:57 am John Baldwin wrote: > Author: jhb > Date: Tue Nov 2 13:00:56 2010 > New Revision: 214675 > URL: http://svn.freebsd.org/changeset/base/214675 > > Log: > Don't leak the LLE lock if the arptimer callout is pending or inactive. > > Reported by: David Rhodus > MFC after: 1 month I wonder if this should not be a panic offense instead? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 13:58:33 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 208081065679; Tue, 2 Nov 2010 13:58:33 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id DBDDF8FC08; Tue, 2 Nov 2010 13:58:32 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id BE46E133A; Tue, 2 Nov 2010 09:42:31 -0400 (EDT) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id E19A0139F; Tue, 2 Nov 2010 09:42:30 -0400 (EDT) Received: from mweb1.acsu.buffalo.edu (mweb1.acsu.buffalo.edu [128.205.5.238]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id D3E35148A; Tue, 2 Nov 2010 09:42:30 -0400 (EDT) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) by mweb1.acsu.buffalo.edu (Postfix) with ESMTP id BC4795B003B; Tue, 2 Nov 2010 09:42:30 -0400 (EDT) From: Ken Smith To: Alexander Best In-Reply-To: <20101102014059.GA91353@freebsd.org> References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> <20101031191119.GM46314@acme.spoerlein.net> <1288620951.3596.32.camel@bauer.cse.buffalo.edu> <20101102014059.GA91353@freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-U70p7GzrMpUxTsTTu+x7" Date: Tue, 02 Nov 2010 09:42:30 -0400 Message-ID: <1288705350.7246.24.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek , Ulrich Spoerlein Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 13:58:33 -0000 --=-U70p7GzrMpUxTsTTu+x7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Tue, 2010-11-02 at 01:40 +0000, Alexander Best wrote: > how about a compromise then? let's leave the -P switch in rm, but make it= a no > op! in addition to that add a new rm(1) entry explaining what the -P swit= ch did > and why exactly it was turned into a no op. let's be really eloborate on = this > issue and tell the user exactly every tiny detail that lead to the conclu= sion > that currently the -P switch serves no purpose and thus it was turned int= o a no > op. also a statement should be added to rm(1) that makes clear that the -= P flag > *will* come back to rm, once the low level work has been finished in orde= r to > decide (from userland) whether a specific disk supports overwriting block= s or > not. >=20 > thoughts?=20 This doesn't quite solve the issue I'm most concerned with. As a "best practices" type thing people are told to be careful to erase sensitive data. People right now may be using "rm -P" to do that, thinking they followed the best practices. And how many of you re-read the manual page for every command you use when a new version of the OS comes out? The tweaks to the manual page would prevent new people from being fooled into thinking they're following best practices but would do nothing to let people who found -P a while ago know they aren't actually following best practices after all. Making -P a no-op actually makes the above issue worse. As Ceri said, if anything it should fail. But I'm not sure what the difference is between -P failing any time you use it versus just removing -P until the support for it is in place. From the discussions so far it seems like the world has changed to the point support for it may not be possible. =20 --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-U70p7GzrMpUxTsTTu+x7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAkzQFTkACgkQ/G14VSmup/YyfgCghXC/2nQvpe2bEZgEzSciN19f 828An3Mss8LjasqmHuNph0+79QswjhVK =MrIi -----END PGP SIGNATURE----- --=-U70p7GzrMpUxTsTTu+x7-- From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 16:56:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FE3E106566B; Tue, 2 Nov 2010 16:56:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D032B8FC0C; Tue, 2 Nov 2010 16:56:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5E1CD46BA3; Tue, 2 Nov 2010 12:56:13 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 67E788A009; Tue, 2 Nov 2010 12:56:12 -0400 (EDT) From: John Baldwin To: David Rhodus Date: Tue, 2 Nov 2010 12:56:01 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201011021300.oA2D0vi2047228@svn.freebsd.org> <753733.9668.qm@web114311.mail.gq1.yahoo.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201011021256.01083.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 02 Nov 2010 12:56:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: Fw: svn commit: r214675 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 16:56:14 -0000 On Tuesday, November 02, 2010 12:41:54 pm David Rhodus wrote: > > ----- Forwarded Message ---- > > From: John Baldwin > > To: src-committers@freebsd.org > > Cc: svn-src-head@freebsd.org; svn-src-all@freebsd.org > > Sent: Tue, November 2, 2010 9:06:24 AM > > Subject: Re: svn commit: r214675 - head/sys/netinet > > > > On Tuesday, November 02, 2010 9:00:57 am John Baldwin wrote: > >> Author: jhb > >> Date: Tue Nov 2 13:00:56 2010 > >> New Revision: 214675 > >> URL: http://svn.freebsd.org/changeset/base/214675 > >> > >> Log: > >> Don't leak the LLE lock if the arptimer callout is pending or inactive. > >> > >> Reported by: David Rhodus > >> MFC after: 1 month > > > > I wonder if this should not be a panic offense instead? > > > > No panic but that kernel appears to have deadlocked. > > dmesg -a|grep arp > arptimer issue: 0xc9335280, IPv4 address: "207.230.215.97" > > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND > 11 root 4 171 ki31 0K 32K RUN 0 500.3H 393.12% idle > 12 root 24 -60 - 0K 192K WAIT 0 18.6H 10.94% intr > 22 root 1 45 - 0K 8K syncer 2 67:36 0.98% syncer > 64402 root 1 44 0 9944K 2232K CPU0 0 0:13 0.10% top > 0 root 11 44 0 0K 80K deadlk 1 37.4H 0.00% kernel That is not a deadlock, that is just the deadlkres thread being idle. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 17:00:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 110FE106566C; Tue, 2 Nov 2010 17:00:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F23778FC08; Tue, 2 Nov 2010 17:00:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2H0usM069317; Tue, 2 Nov 2010 17:00:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2H0uwE069308; Tue, 2 Nov 2010 17:00:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201011021700.oA2H0uwE069308@svn.freebsd.org> From: Ed Schouten Date: Tue, 2 Nov 2010 17:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214680 - in head: bin/stty include lib/libc/gen libexec/getty libexec/rlogind X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 17:00:57 -0000 Author: ed Date: Tue Nov 2 17:00:56 2010 New Revision: 214680 URL: http://svn.freebsd.org/changeset/base/214680 Log: Add a new libc function: cfmakesane(3). I've noticed various terminal emulators that need to obtain a sane default termios structure use very complex `hacks'. Even though POSIX doesn't provide any functionality for this, extend our termios API with cfmakesane(3), which is similar to the commonly supported cfmakeraw(3), except that it fills the termios structure with sane defaults. Change all code in our base system to use this function, instead of depending on to provide TTYDEF_*. Modified: head/bin/stty/key.c head/include/termios.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/tcsetattr.3 head/lib/libc/gen/termios.c head/libexec/getty/main.c head/libexec/rlogind/rlogind.c Modified: head/bin/stty/key.c ============================================================================== --- head/bin/stty/key.c Tue Nov 2 14:29:39 2010 (r214679) +++ head/bin/stty/key.c Tue Nov 2 17:00:56 2010 (r214680) @@ -257,14 +257,15 @@ f_rows(struct info *ip) void f_sane(struct info *ip) { + struct termios def; - ip->t.c_cflag = TTYDEF_CFLAG | (ip->t.c_cflag & CLOCAL); - ip->t.c_iflag = TTYDEF_IFLAG; - ip->t.c_iflag |= ICRNL; + cfmakesane(&def); + ip->t.c_cflag = def.c_cflag | (ip->t.c_cflag & CLOCAL); + ip->t.c_iflag = def.c_iflag; /* preserve user-preference flags in lflag */ #define LKEEP (ECHOKE|ECHOE|ECHOK|ECHOPRT|ECHOCTL|ALTWERASE|TOSTOP|NOFLSH) - ip->t.c_lflag = TTYDEF_LFLAG | (ip->t.c_lflag & LKEEP); - ip->t.c_oflag = TTYDEF_OFLAG; + ip->t.c_lflag = def.c_lflag | (ip->t.c_lflag & LKEEP); + ip->t.c_oflag = def.c_oflag; ip->set = 1; } Modified: head/include/termios.h ============================================================================== --- head/include/termios.h Tue Nov 2 14:29:39 2010 (r214679) +++ head/include/termios.h Tue Nov 2 17:00:56 2010 (r214680) @@ -88,6 +88,7 @@ pid_t tcgetsid(int); int tcsetsid(int, pid_t); void cfmakeraw(struct termios *); +void cfmakesane(struct termios *); int cfsetspeed(struct termios *, speed_t); #endif __END_DECLS Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Nov 2 14:29:39 2010 (r214679) +++ head/lib/libc/gen/Makefile.inc Tue Nov 2 17:00:56 2010 (r214680) @@ -180,9 +180,9 @@ MLINKS+=syslog.3 closelog.3 syslog.3 ope syslog.3 vsyslog.3 MLINKS+=tcsendbreak.3 tcdrain.3 tcsendbreak.3 tcflow.3 tcsendbreak.3 tcflush.3 MLINKS+=tcsetattr.3 cfgetispeed.3 tcsetattr.3 cfgetospeed.3 \ - tcsetattr.3 cfmakeraw.3 tcsetattr.3 cfsetispeed.3 \ - tcsetattr.3 cfsetospeed.3 tcsetattr.3 cfsetspeed.3 \ - tcsetattr.3 tcgetattr.3 + tcsetattr.3 cfmakeraw.3 tcsetattr.3 cfmakesane.3 \ + tcsetattr.3 cfsetispeed.3 tcsetattr.3 cfsetospeed.3 \ + tcsetattr.3 cfsetspeed.3 tcsetattr.3 tcgetattr.3 MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyname_r.3 MLINKS+=tzset.3 tzsetwall.3 MLINKS+=unvis.3 strunvis.3 unvis.3 strunvisx.3 Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Tue Nov 2 14:29:39 2010 (r214679) +++ head/lib/libc/gen/Symbol.map Tue Nov 2 17:00:56 2010 (r214680) @@ -358,6 +358,7 @@ FBSD_1.1 { FBSD_1.2 { basename_r; + cfmakesane; endutxent; getpagesizes; getutxent; Modified: head/lib/libc/gen/tcsetattr.3 ============================================================================== --- head/lib/libc/gen/tcsetattr.3 Tue Nov 2 14:29:39 2010 (r214679) +++ head/lib/libc/gen/tcsetattr.3 Tue Nov 2 17:00:56 2010 (r214680) @@ -38,6 +38,7 @@ .Nm cfsetospeed , .Nm cfsetspeed , .Nm cfmakeraw , +.Nm cfmakesane , .Nm tcgetattr , .Nm tcsetattr .Nd manipulating the termios structure @@ -57,6 +58,8 @@ .Fn cfsetspeed "struct termios *t" "speed_t speed" .Ft void .Fn cfmakeraw "struct termios *t" +.Ft void +.Fn cfmakesane "struct termios *t" .Ft int .Fn tcgetattr "int fd" "struct termios *t" .Ft int @@ -64,6 +67,7 @@ .Sh DESCRIPTION The .Fn cfmakeraw , +.Fn cfmakesane , .Fn tcgetattr and .Fn tcsetattr @@ -180,14 +184,20 @@ The .Fn cfmakeraw function sets the flags stored in the termios structure to a state disabling all input and output processing, giving a -.Dq raw I/O path . +.Dq raw I/O path , +while the +.Fn cfmakesane +function sets them to a state similar to those of a newly created +terminal device. It should be noted that there is no function to reverse this effect. This is because there are a variety of processing options that could be re-enabled and the correct method is for an application to snapshot the current terminal state using the function .Fn tcgetattr , -setting raw mode with +setting raw or sane mode with .Fn cfmakeraw +or +.Fn cfmakesane and the subsequent .Fn tcsetattr , and then using another @@ -316,7 +326,8 @@ functions are expected to be compliant w .St -p1003.1-88 specification. The -.Fn cfmakeraw +.Fn cfmakeraw , +.Fn cfmakesane and .Fn cfsetspeed functions, Modified: head/lib/libc/gen/termios.c ============================================================================== --- head/lib/libc/gen/termios.c Tue Nov 2 14:29:39 2010 (r214679) +++ head/lib/libc/gen/termios.c Tue Nov 2 17:00:56 2010 (r214680) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#define TTYDEFCHARS #include #include #include "un-namespace.h" @@ -173,6 +175,23 @@ cfmakeraw(struct termios *t) t->c_cc[VTIME] = 0; } +/* + * Obtain a termios structure which is similar to the one provided by + * the kernel. + */ +void +cfmakesane(struct termios *t) +{ + + t->c_cflag = TTYDEF_CFLAG; + t->c_iflag = TTYDEF_IFLAG; + t->c_lflag = TTYDEF_LFLAG; + t->c_oflag = TTYDEF_OFLAG; + t->c_ispeed = TTYDEF_SPEED; + t->c_ospeed = TTYDEF_SPEED; + memcpy(&t->c_cc, ttydefchars, sizeof ttydefchars); +} + int tcsendbreak(int fd, int len __unused) { Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Tue Nov 2 14:29:39 2010 (r214679) +++ head/libexec/getty/main.c Tue Nov 2 17:00:56 2010 (r214680) @@ -454,8 +454,9 @@ opentty(const char *tty, int flags) } static void -defttymode() +defttymode(void) { + struct termios def; /* Start with default tty settings. */ if (tcgetattr(STDIN_FILENO, &tmode) < 0) { @@ -471,10 +472,11 @@ defttymode() * to leave their idea of the preferred VERASE key value * there. */ - tmode.c_iflag = TTYDEF_IFLAG; - tmode.c_oflag = TTYDEF_OFLAG; - tmode.c_lflag = TTYDEF_LFLAG; - tmode.c_cflag = TTYDEF_CFLAG; + cfmakesane(&def); + tmode.c_iflag = def.c_iflag; + tmode.c_oflag = def.c_oflag; + tmode.c_lflag = def.c_lflag; + tmode.c_cflag = def.c_cflag; if (NC) tmode.c_cflag |= CLOCAL; omode = tmode; Modified: head/libexec/rlogind/rlogind.c ============================================================================== --- head/libexec/rlogind/rlogind.c Tue Nov 2 14:29:39 2010 (r214679) +++ head/libexec/rlogind/rlogind.c Tue Nov 2 17:00:56 2010 (r214680) @@ -545,7 +545,7 @@ setup_term(int fd) { char *cp = index(term+ENVSIZE, '/'); char *speed; - struct termios tt; + struct termios tt, def; #ifndef notyet tcgetattr(fd, &tt); @@ -558,9 +558,10 @@ setup_term(int fd) cfsetspeed(&tt, atoi(speed)); } - tt.c_iflag = TTYDEF_IFLAG; - tt.c_oflag = TTYDEF_OFLAG; - tt.c_lflag = TTYDEF_LFLAG; + cfmakesane(&def); + tt.c_iflag = def.c_iflag; + tt.c_oflag = def.c_oflag; + tt.c_lflag = def.c_lflag; tcsetattr(fd, TCSAFLUSH, &tt); #else if (cp) { From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 17:08:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 728D6106564A; Tue, 2 Nov 2010 17:08:34 +0000 (UTC) (envelope-from sdrhodus@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id AA2D58FC23; Tue, 2 Nov 2010 17:08:33 +0000 (UTC) Received: by wyb42 with SMTP id 42so6857222wyb.13 for ; Tue, 02 Nov 2010 10:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Y+fSh3tObVFiqlDDxqQvEROQhnDtVC1vV9VilunoAEE=; b=B6DQysMW9sypy9uhbNet3Xyt0aI2WE9EZ8l31LWP9o0DfNl3i5K0U0UG9zzQozpFUg KAqWjuQ6A9vXyBSL5lVt5Q7huIkpPrLHbo0yScTKGQogvUVwkzbPKUrOFlxftoLjzaib p65B+Oj9/UvhtT3aYRVck4/YOQph7Qy7WgfTs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=nwqHyXy7fw5QCjAwk7VrNGwo5RWPxHpga98Llolw3JJYAqCSeV7dNGSGWheUYzVOS6 WmRE9vzMq7MhUuYSI78eui9SShWEk2F9ody3/BwpOXDSRP4Q6x1LjAj5d0KTvjwZg6UP uplSmHhsvKlGekzb2VO2y7XHMZglqZYziwsbU= Received: by 10.227.157.148 with SMTP id b20mr9745954wbx.14.1288716134748; Tue, 02 Nov 2010 09:42:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.60.137 with HTTP; Tue, 2 Nov 2010 09:41:54 -0700 (PDT) In-Reply-To: <753733.9668.qm@web114311.mail.gq1.yahoo.com> References: <201011021300.oA2D0vi2047228@svn.freebsd.org> <753733.9668.qm@web114311.mail.gq1.yahoo.com> From: David Rhodus Date: Tue, 2 Nov 2010 12:41:54 -0400 Message-ID: To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: Fw: svn commit: r214675 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 17:08:34 -0000 > ----- Forwarded Message ---- > From: John Baldwin > To: src-committers@freebsd.org > Cc: svn-src-head@freebsd.org; svn-src-all@freebsd.org > Sent: Tue, November 2, 2010 9:06:24 AM > Subject: Re: svn commit: r214675 - head/sys/netinet > > On Tuesday, November 02, 2010 9:00:57 am John Baldwin wrote: >> Author: jhb >> Date: Tue Nov =A02 13:00:56 2010 >> New Revision: 214675 >> URL: http://svn.freebsd.org/changeset/base/214675 >> >> Log: >> =A0 Don't leak the LLE lock if the arptimer callout is pending or inacti= ve. >> >> =A0 Reported by: =A0 =A0David Rhodus >> =A0 MFC after: =A0 =A01 month > > I wonder if this should not be a panic offense instead? > No panic but that kernel appears to have deadlocked. dmesg -a|grep arp arptimer issue: 0xc9335280, IPv4 address: "207.230.215.97" PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 11 root 4 171 ki31 0K 32K RUN 0 500.3H 393.12% idle 12 root 24 -60 - 0K 192K WAIT 0 18.6H 10.94% intr 22 root 1 45 - 0K 8K syncer 2 67:36 0.98% syncer 64402 root 1 44 0 9944K 2232K CPU0 0 0:13 0.10% top 0 root 11 44 0 0K 80K deadlk 1 37.4H 0.00% kernel From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 17:56:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F158C106566C; Tue, 2 Nov 2010 17:56:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C58E18FC0C; Tue, 2 Nov 2010 17:56:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2HuGw1073486; Tue, 2 Nov 2010 17:56:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2HuGWd073483; Tue, 2 Nov 2010 17:56:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011021756.oA2HuGWd073483@svn.freebsd.org> From: John Baldwin Date: Tue, 2 Nov 2010 17:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214681 - in head/sys: i386/i386 x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 17:56:17 -0000 Author: jhb Date: Tue Nov 2 17:56:16 2010 New Revision: 214681 URL: http://svn.freebsd.org/changeset/base/214681 Log: Further tweaks to the ram_attach() routine: - Use > 2^32 - 1 instead of >= when checking for memory regions above 4G. - Skip SMAP entries > 4G on i386 rather than breaking out of the loop since SMAP entries are not guaranteed to be in order. - Remove 'i' and loop over 'rid' directly in the dump_avail[] case. - Only check for 4G regions in the dump_avail[] case on i386 if PAE is enabled since vm_paddr_t is 32-bit in the !PAE case. Submitted by: alc Modified: head/sys/i386/i386/machdep.c head/sys/x86/x86/nexus.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Nov 2 17:00:56 2010 (r214680) +++ head/sys/i386/i386/machdep.c Tue Nov 2 17:56:16 2010 (r214681) @@ -1970,7 +1970,7 @@ add_smap_entry(struct bios_smap *smap, v return (1); #ifndef PAE - if (smap->base >= 0xffffffff) { + if (smap->base > 0xffffffff) { printf("%uK of memory above 4GB ignored\n", (u_int)(smap->length / 1024)); return (1); Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Tue Nov 2 17:00:56 2010 (r214680) +++ head/sys/x86/x86/nexus.c Tue Nov 2 17:56:16 2010 (r214681) @@ -674,7 +674,7 @@ ram_attach(device_t dev) vm_paddr_t *p; caddr_t kmdp; uint32_t smapsize; - int error, i, rid; + int error, rid; /* Retrieve the system memory map from the loader. */ kmdp = preload_search_by_type("elf kernel"); @@ -699,8 +699,8 @@ ram_attach(device_t dev) * Resources use long's to track resources, so * we can't include memory regions above 4GB. */ - if (smap->base >= ~0ul) - break; + if (smap->base > ~0ul) + continue; #endif error = bus_set_resource(dev, SYS_RES_MEMORY, rid, smap->base, smap->length); @@ -727,24 +727,23 @@ ram_attach(device_t dev) * instead of the start since the start address for the first * segment is 0. */ - for (i = 0, p = dump_avail; p[1] != 0; i++, p += 2) { - rid = i; -#ifdef __i386__ + for (rid = 0, p = dump_avail; p[1] != 0; rid++, p += 2) { +#if defined(__i386__) && defined(PAE) /* * Resources use long's to track resources, so we can't * include memory regions above 4GB. */ - if (p[0] >= ~0ul) + if (p[0] > ~0ul) break; #endif error = bus_set_resource(dev, SYS_RES_MEMORY, rid, p[0], p[1] - p[0]); if (error) - panic("ram_attach: resource %d failed set with %d", i, + panic("ram_attach: resource %d failed set with %d", rid, error); res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0); if (res == NULL) - panic("ram_attach: resource %d failed to attach", i); + panic("ram_attach: resource %d failed to attach", rid); } return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 18:34:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A649106566B; Tue, 2 Nov 2010 18:34:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 196E68FC08; Tue, 2 Nov 2010 18:34:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2IYVX0075506; Tue, 2 Nov 2010 18:34:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2IYVIS075504; Tue, 2 Nov 2010 18:34:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011021834.oA2IYVIS075504@svn.freebsd.org> From: John Baldwin Date: Tue, 2 Nov 2010 18:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214682 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 18:34:32 -0000 Author: jhb Date: Tue Nov 2 18:34:31 2010 New Revision: 214682 URL: http://svn.freebsd.org/changeset/base/214682 Log: Tweak the waitchannel messages for the dead lock detection kthread. Use a shorter message (userland generally only sees the first 6 to 8 characters) when waiting for the allproc lock. Use "-" when idle to math the behavior of other kthreads. Reviewed by: attilio MFC after: 1 week Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Tue Nov 2 17:56:16 2010 (r214681) +++ head/sys/kern/kern_clock.c Tue Nov 2 18:34:31 2010 (r214682) @@ -195,7 +195,7 @@ deadlkres(void) panic("%s: possible deadlock detected on allproc_lock\n", __func__); tryl++; - pause("allproc_lock deadlkres", sleepfreq * hz); + pause("allproc", sleepfreq * hz); continue; } tryl = 0; @@ -288,7 +288,7 @@ deadlkres(void) sx_sunlock(&allproc_lock); /* Sleep for sleepfreq seconds. */ - pause("deadlkres", sleepfreq * hz); + pause("-", sleepfreq * hz); } } From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 20:16:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681871065672; Tue, 2 Nov 2010 20:16:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56E7D8FC1E; Tue, 2 Nov 2010 20:16:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2KGfrt083195; Tue, 2 Nov 2010 20:16:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2KGfOP083193; Tue, 2 Nov 2010 20:16:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011022016.oA2KGfOP083193@svn.freebsd.org> From: John Baldwin Date: Tue, 2 Nov 2010 20:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214686 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 20:16:41 -0000 Author: jhb Date: Tue Nov 2 20:16:41 2010 New Revision: 214686 URL: http://svn.freebsd.org/changeset/base/214686 Log: Cosmetic change to revert one of my earlier ones. #if __i386__ && PAE is identical to just #if PAE since PAE is only a valid option for i386. Submitted by: attilio Modified: head/sys/x86/x86/nexus.c Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Tue Nov 2 20:06:49 2010 (r214685) +++ head/sys/x86/x86/nexus.c Tue Nov 2 20:16:41 2010 (r214686) @@ -728,7 +728,7 @@ ram_attach(device_t dev) * segment is 0. */ for (rid = 0, p = dump_avail; p[1] != 0; rid++, p += 2) { -#if defined(__i386__) && defined(PAE) +#ifdef PAE /* * Resources use long's to track resources, so we can't * include memory regions above 4GB. From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 22:13:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A127F1065672; Tue, 2 Nov 2010 22:13:08 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8ED6B8FC1F; Tue, 2 Nov 2010 22:13:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2MD8XT092603; Tue, 2 Nov 2010 22:13:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2MD8FF092601; Tue, 2 Nov 2010 22:13:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201011022213.oA2MD8FF092601@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 2 Nov 2010 22:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214692 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 22:13:08 -0000 Author: pjd Date: Tue Nov 2 22:13:08 2010 New Revision: 214692 URL: http://svn.freebsd.org/changeset/base/214692 Log: Send packets to remote node only via the send thread to avoid possible races - in this case a keepalive packet was send from wrong thread which lead to connection dropping, because of corrupted packet. Fix it by sending keepalive packets directly from the send thread. As a bonus we now send keepalive packets only when connection is idle. Submitted by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Tue Nov 2 22:12:12 2010 (r214691) +++ head/sbin/hastd/primary.c Tue Nov 2 22:13:08 2010 (r214692) @@ -180,14 +180,21 @@ static pthread_mutex_t metadata_lock; if (_wakeup) \ cv_signal(&hio_##name##_list_cond); \ } while (0) -#define QUEUE_TAKE1(hio, name, ncomp) do { \ +#define QUEUE_TAKE1(hio, name, ncomp, timeout) do { \ + bool _last; \ + \ mtx_lock(&hio_##name##_list_lock[(ncomp)]); \ - while (((hio) = TAILQ_FIRST(&hio_##name##_list[(ncomp)])) == NULL) { \ - cv_wait(&hio_##name##_list_cond[(ncomp)], \ - &hio_##name##_list_lock[(ncomp)]); \ + _last = false; \ + while (((hio) = TAILQ_FIRST(&hio_##name##_list[(ncomp)])) == NULL && !_last) { \ + cv_timedwait(&hio_##name##_list_cond[(ncomp)], \ + &hio_##name##_list_lock[(ncomp)], (timeout)); \ + if ((timeout) != 0) \ + _last = true; \ + } \ + if (hio != NULL) { \ + TAILQ_REMOVE(&hio_##name##_list[(ncomp)], (hio), \ + hio_next[(ncomp)]); \ } \ - TAILQ_REMOVE(&hio_##name##_list[(ncomp)], (hio), \ - hio_next[(ncomp)]); \ mtx_unlock(&hio_##name##_list_lock[(ncomp)]); \ } while (0) #define QUEUE_TAKE2(hio, name) do { \ @@ -1112,7 +1119,7 @@ local_send_thread(void *arg) for (;;) { pjdlog_debug(2, "local_send: Taking request."); - QUEUE_TAKE1(hio, send, ncomp); + QUEUE_TAKE1(hio, send, ncomp, 0); pjdlog_debug(2, "local_send: (%p) Got request.", hio); ggio = &hio->hio_ggio; switch (ggio->gctl_cmd) { @@ -1176,6 +1183,38 @@ local_send_thread(void *arg) return (NULL); } +static void +keepalive_send(struct hast_resource *res, unsigned int ncomp) +{ + struct nv *nv; + + if (!ISCONNECTED(res, ncomp)) + return; + + assert(res->hr_remotein != NULL); + assert(res->hr_remoteout != NULL); + + nv = nv_alloc(); + nv_add_uint8(nv, HIO_KEEPALIVE, "cmd"); + if (nv_error(nv) != 0) { + nv_free(nv); + pjdlog_debug(1, + "keepalive_send: Unable to prepare header to send."); + return; + } + if (hast_proto_send(res, res->hr_remoteout, nv, NULL, 0) < 0) { + pjdlog_common(LOG_DEBUG, 1, errno, + "keepalive_send: Unable to send request"); + nv_free(nv); + rw_unlock(&hio_remote_lock[ncomp]); + remote_close(res, ncomp); + rw_rlock(&hio_remote_lock[ncomp]); + return; + } + nv_free(nv); + pjdlog_debug(2, "keepalive_send: Request sent."); +} + /* * Thread sends request to secondary node. */ @@ -1184,6 +1223,7 @@ remote_send_thread(void *arg) { struct hast_resource *res = arg; struct g_gate_ctl_io *ggio; + time_t lastcheck, now; struct hio *hio; struct nv *nv; unsigned int ncomp; @@ -1194,10 +1234,19 @@ remote_send_thread(void *arg) /* Remote component is 1 for now. */ ncomp = 1; + lastcheck = time(NULL); for (;;) { pjdlog_debug(2, "remote_send: Taking request."); - QUEUE_TAKE1(hio, send, ncomp); + QUEUE_TAKE1(hio, send, ncomp, RETRY_SLEEP); + if (hio == NULL) { + now = time(NULL); + if (lastcheck + RETRY_SLEEP <= now) { + keepalive_send(res, ncomp); + lastcheck = now; + } + continue; + } pjdlog_debug(2, "remote_send: (%p) Got request.", hio); ggio = &hio->hio_ggio; switch (ggio->gctl_cmd) { @@ -1883,32 +1932,6 @@ failed: } static void -keepalive_send(struct hast_resource *res, unsigned int ncomp) -{ - struct nv *nv; - - nv = nv_alloc(); - nv_add_uint8(nv, HIO_KEEPALIVE, "cmd"); - if (nv_error(nv) != 0) { - nv_free(nv); - pjdlog_debug(1, - "keepalive_send: Unable to prepare header to send."); - return; - } - if (hast_proto_send(res, res->hr_remoteout, nv, NULL, 0) < 0) { - pjdlog_common(LOG_DEBUG, 1, errno, - "keepalive_send: Unable to send request"); - nv_free(nv); - rw_unlock(&hio_remote_lock[ncomp]); - remote_close(res, ncomp); - rw_rlock(&hio_remote_lock[ncomp]); - return; - } - nv_free(nv); - pjdlog_debug(2, "keepalive_send: Request sent."); -} - -static void guard_one(struct hast_resource *res, unsigned int ncomp) { struct proto_conn *in, *out; @@ -1926,12 +1949,6 @@ guard_one(struct hast_resource *res, uns if (ISCONNECTED(res, ncomp)) { assert(res->hr_remotein != NULL); assert(res->hr_remoteout != NULL); - keepalive_send(res, ncomp); - } - - if (ISCONNECTED(res, ncomp)) { - assert(res->hr_remotein != NULL); - assert(res->hr_remoteout != NULL); rw_unlock(&hio_remote_lock[ncomp]); pjdlog_debug(2, "remote_guard: Connection to %s is ok.", res->hr_remoteaddr); From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 22:30:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D1891065694; Tue, 2 Nov 2010 22:30:40 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id F2FA88FC13; Tue, 2 Nov 2010 22:30:39 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 58A0245E49; Tue, 2 Nov 2010 23:30:38 +0100 (CET) Received: from localhost (chello089073192049.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5328C45C9F; Tue, 2 Nov 2010 23:30:32 +0100 (CET) Date: Tue, 2 Nov 2010 23:29:54 +0100 From: Pawel Jakub Dawidek To: Kostik Belousov Message-ID: <20101102222954.GH2051@garage.freebsd.pl> References: <201008262341.o7QNfeR2057181@svn.freebsd.org> <20101101171904.GA92782@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OpLPJvDmhXTZE4Lg" Content-Disposition: inline In-Reply-To: <20101101171904.GA92782@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211854 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 22:30:40 -0000 --OpLPJvDmhXTZE4Lg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 01, 2010 at 07:19:04PM +0200, Kostik Belousov wrote: > On Thu, Aug 26, 2010 at 11:41:40PM +0000, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Thu Aug 26 23:41:40 2010 > > New Revision: 211854 > > URL: http://svn.freebsd.org/changeset/base/211854 > >=20 > > Log: > > - When VFS_VGET() is not supported, switch to VOP_LOOKUP(). > > - We are fine by only share-locking the vnode. > > - Remove assertion that doesn't hold for ZFS where we cross mount poi= nts > > boundaries by going into .zfs/snapshot//. > > =20 > > Reviewed by: rmacklem > > MFC after: 1 month > Do you still plan to merge this commit to stable/8 ? Yes, just did. Thanks for the reminder. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --OpLPJvDmhXTZE4Lg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkzQkOIACgkQForvXbEpPzRGhQCbB2dBXMkksQBYrKEAx5dGng6D hHYAnRaSiSPvPMDaD1nVzG+6OBhnCYrn =CISX -----END PGP SIGNATURE----- --OpLPJvDmhXTZE4Lg-- From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 23:43:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3240C106566B; Tue, 2 Nov 2010 23:43:45 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20B828FC1D; Tue, 2 Nov 2010 23:43:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2NhjvQ098804; Tue, 2 Nov 2010 23:43:45 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2Nhji1098802; Tue, 2 Nov 2010 23:43:45 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011022343.oA2Nhji1098802@svn.freebsd.org> From: Juli Mallett Date: Tue, 2 Nov 2010 23:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214708 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 23:43:45 -0000 Author: jmallett Date: Tue Nov 2 23:43:44 2010 New Revision: 214708 URL: http://svn.freebsd.org/changeset/base/214708 Log: Declare the CF GEOM class so that g_modevent will get called, the class will be recorded, etc. This fixes libgeom on Octeon. Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- head/sys/mips/cavium/octeon_ebt3000_cf.c Tue Nov 2 23:43:27 2010 (r214707) +++ head/sys/mips/cavium/octeon_ebt3000_cf.c Tue Nov 2 23:43:44 2010 (r214708) @@ -148,6 +148,8 @@ struct g_class g_cf_class = { .ioctl = cf_ioctl, }; +DECLARE_GEOM_CLASS(g_cf_class, g_cf); + /* Device methods */ static int cf_probe(device_t); static void cf_identify(driver_t *, device_t); From owner-svn-src-head@FreeBSD.ORG Tue Nov 2 23:44:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CD131065674; Tue, 2 Nov 2010 23:44:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE6978FC24; Tue, 2 Nov 2010 23:44:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA2NiTJK098879; Tue, 2 Nov 2010 23:44:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA2NiTJY098876; Tue, 2 Nov 2010 23:44:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011022344.oA2NiTJY098876@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 2 Nov 2010 23:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214709 - in head: bin/sh tools/regression/bin/sh/parser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 23:44:30 -0000 Author: jilles Date: Tue Nov 2 23:44:29 2010 New Revision: 214709 URL: http://svn.freebsd.org/changeset/base/214709 Log: sh: Fix some issues with aliases and case, by importing dash checkkwd code. This moves the function of the noaliases variable into the checkkwd variable. This way it is properly reset on errors and aliases can be used normally in the commands for each case (the case labels recognize the keyword esac but no aliases). The new code is clearer as well. Obtained from: dash Added: head/tools/regression/bin/sh/parser/alias3.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Tue Nov 2 23:43:44 2010 (r214708) +++ head/bin/sh/parser.c Tue Nov 2 23:44:29 2010 (r214709) @@ -69,6 +69,11 @@ __FBSDID("$FreeBSD$"); #define EOFMARKLEN 79 #define PROMPTLEN 128 +/* values of checkkwd variable */ +#define CHKALIAS 0x1 +#define CHKKWD 0x2 +#define CHKNL 0x4 + /* values returned by readtoken */ #include "token.h" @@ -102,9 +107,6 @@ static int startlinno; /* line # where static int funclinno; /* line # where the current function started */ static struct parser_temp *parser_temp; -/* XXX When 'noaliases' is set to one, no alias expansion takes place. */ -static int noaliases = 0; - static union node *list(int, int); static union node *andor(void); @@ -230,7 +232,7 @@ list(int nlflag, int erflag) union node *ntop, *n1, *n2, *n3; int tok; - checkkwd = 2; + checkkwd = CHKNL | CHKKWD | CHKALIAS; if (!nlflag && !erflag && tokendlist[peektoken()]) return NULL; ntop = n1 = NULL; @@ -283,7 +285,7 @@ list(int nlflag, int erflag) } else { tokpushback++; } - checkkwd = 2; + checkkwd = CHKNL | CHKKWD | CHKALIAS; if (!nlflag && !erflag && tokendlist[peektoken()]) return ntop; break; @@ -339,7 +341,7 @@ pipeline(void) int negate, t; negate = 0; - checkkwd = 2; + checkkwd = CHKNL | CHKKWD | CHKALIAS; TRACE(("pipeline: entered\n")); while (readtoken() == TNOT) negate = !negate; @@ -355,7 +357,7 @@ pipeline(void) do { prev = lp; lp = (struct nodelist *)stalloc(sizeof (struct nodelist)); - checkkwd = 2; + checkkwd = CHKNL | CHKKWD | CHKALIAS; t = readtoken(); tokpushback++; if (t == TNOT) @@ -388,7 +390,7 @@ command(void) union node *redir, **rpp; int t; - checkkwd = 2; + checkkwd = CHKNL | CHKKWD | CHKALIAS; redir = NULL; n1 = NULL; rpp = &redir; @@ -429,7 +431,7 @@ command(void) } if (readtoken() != TFI) synexpect(TFI); - checkkwd = 1; + checkkwd = CHKKWD | CHKALIAS; break; case TWHILE: case TUNTIL: { @@ -445,7 +447,7 @@ TRACE(("expecting DO got %s %s\n", tokna n1->nbinary.ch2 = list(0, 0); if (readtoken() != TDONE) synexpect(TDONE); - checkkwd = 1; + checkkwd = CHKKWD | CHKALIAS; break; } case TFOR: @@ -487,7 +489,7 @@ TRACE(("expecting DO got %s %s\n", tokna if (lasttoken != TNL && lasttoken != TSEMI) tokpushback++; } - checkkwd = 2; + checkkwd = CHKNL | CHKKWD | CHKALIAS; if ((t = readtoken()) == TDO) t = TDONE; else if (t == TBEGIN) @@ -497,7 +499,7 @@ TRACE(("expecting DO got %s %s\n", tokna n1->nfor.body = list(0, 0); if (readtoken() != t) synexpect(t); - checkkwd = 1; + checkkwd = CHKKWD | CHKALIAS; break; case TCASE: n1 = (union node *)stalloc(sizeof (struct ncase)); @@ -513,8 +515,7 @@ TRACE(("expecting DO got %s %s\n", tokna if (lasttoken != TWORD || ! equal(wordtext, "in")) synerror("expecting \"in\""); cpp = &n1->ncase.cases; - noaliases = 1; /* turn off alias expansion */ - checkkwd = 2, readtoken(); + checkkwd = CHKNL | CHKKWD, readtoken(); while (lasttoken != TESAC) { *cpp = cp = (union node *)stalloc(sizeof (struct nclist)); cp->type = NCLIST; @@ -526,28 +527,28 @@ TRACE(("expecting DO got %s %s\n", tokna ap->type = NARG; ap->narg.text = wordtext; ap->narg.backquote = backquotelist; - if (checkkwd = 2, readtoken() != TPIPE) + checkkwd = CHKNL | CHKKWD; + if (readtoken() != TPIPE) break; app = &ap->narg.next; readtoken(); } ap->narg.next = NULL; if (lasttoken != TRP) - noaliases = 0, synexpect(TRP); + synexpect(TRP); cp->nclist.body = list(0, 0); - checkkwd = 2; + checkkwd = CHKNL | CHKKWD | CHKALIAS; if ((t = readtoken()) != TESAC) { if (t != TENDCASE) - noaliases = 0, synexpect(TENDCASE); + synexpect(TENDCASE); else - checkkwd = 2, readtoken(); + checkkwd = CHKNL | CHKKWD, readtoken(); } cpp = &cp->nclist.next; } - noaliases = 0; /* reset alias expansion */ *cpp = NULL; - checkkwd = 1; + checkkwd = CHKKWD | CHKALIAS; break; case TLP: n1 = (union node *)stalloc(sizeof (struct nredir)); @@ -556,13 +557,13 @@ TRACE(("expecting DO got %s %s\n", tokna n1->nredir.redirect = NULL; if (readtoken() != TRP) synexpect(TRP); - checkkwd = 1; + checkkwd = CHKKWD | CHKALIAS; break; case TBEGIN: n1 = list(0, 0); if (readtoken() != TEND) synexpect(TEND); - checkkwd = 1; + checkkwd = CHKKWD | CHKALIAS; break; /* Handle an empty command like other simple commands. */ case TBACKGND: @@ -796,7 +797,6 @@ static int readtoken(void) { int t; - int savecheckkwd = checkkwd; struct alias *ap; #ifdef DEBUG int alreadyseen = tokpushback; @@ -805,25 +805,24 @@ readtoken(void) top: t = xxreadtoken(); - if (checkkwd) { - /* - * eat newlines - */ - if (checkkwd == 2) { - checkkwd = 0; - while (t == TNL) { - parseheredoc(); - t = xxreadtoken(); - } - } else - checkkwd = 0; - /* - * check for keywords and aliases - */ - if (t == TWORD && !quoteflag) - { - const char * const *pp; + /* + * eat newlines + */ + if (checkkwd & CHKNL) { + while (t == TNL) { + parseheredoc(); + t = xxreadtoken(); + } + } + /* + * check for keywords and aliases + */ + if (t == TWORD && !quoteflag) + { + const char * const *pp; + + if (checkkwd & CHKKWD) for (pp = parsekwd; *pp; pp++) { if (**pp == *wordtext && equal(*pp, wordtext)) { @@ -832,16 +831,16 @@ readtoken(void) goto out; } } - if (noaliases == 0 && - (ap = lookupalias(wordtext, 1)) != NULL) { - pushstring(ap->val, strlen(ap->val), ap); - checkkwd = savecheckkwd; - goto top; - } + if (checkkwd & CHKALIAS && + (ap = lookupalias(wordtext, 1)) != NULL) { + pushstring(ap->val, strlen(ap->val), ap); + goto top; } -out: - checkkwd = (t == TNOT) ? savecheckkwd : 0; } +out: + if (t != TNOT) + checkkwd = 0; + #ifdef DEBUG if (!alreadyseen) TRACE(("token %s %s\n", tokname[t], t == TWORD ? wordtext : "")); Added: head/tools/regression/bin/sh/parser/alias3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias3.0 Tue Nov 2 23:44:29 2010 (r214709) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +alias alias0=exit +x=alias0 +eval 'case $x in "alias0") alias0 0;; esac' +exit 1 From owner-svn-src-head@FreeBSD.ORG Wed Nov 3 01:30:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEA13106564A; Wed, 3 Nov 2010 01:30:56 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 922B58FC19; Wed, 3 Nov 2010 01:30:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA31UunX002804; Wed, 3 Nov 2010 01:30:56 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA31Uunn002802; Wed, 3 Nov 2010 01:30:56 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201011030130.oA31Uunn002802@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 3 Nov 2010 01:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214722 - head/contrib/tzdata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2010 01:30:56 -0000 Author: edwin Date: Wed Nov 3 01:30:56 2010 New Revision: 214722 URL: http://svn.freebsd.org/changeset/base/214722 Log: MFV of tzdata2010o, r214716 - Fiji moves to DST three weeks earlier in 2010. Modified: head/contrib/tzdata/australasia Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Wed Nov 3 01:28:57 2010 (r214721) +++ head/contrib/tzdata/australasia Wed Nov 3 01:30:56 2010 (r214722) @@ -1,5 +1,5 @@ #

-# @(#)australasia	8.18
+# @(#)australasia	8.20
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -284,13 +284,26 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
 # 
 
+# From Alexander Krivenyshev (2010-10-24):
+# According to Radio Fiji and Fiji Times online, Fiji will end DST 3 
+# weeks earlier than expected - on March 6, 2011, not March 27, 2011...
+# Here is confirmation from Government of the Republic of the Fiji Islands, 
+# Ministry of Information (fiji.gov.fj) web site:
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=2608:daylight-savings&catid=71:press-releases&Itemid=155
+# 
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_fiji04.html
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
 Rule	Fiji	2009	only	-	Nov	29	2:00	1:00	S
 Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0	-
 Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
-Rule	Fiji	2011	only	-	Mar	lastSun 3:00	0	-
+Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time
@@ -487,11 +500,21 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
 # 
 
+# From Raymond Hughes (2010-10-07):
+# Please see
+# 
+# http://www.mcil.gov.ws
+# ,
+# the Ministry of Commerce, Industry and Labour (sideframe) "Last Sunday
+# September 2010 (26/09/10) - adjust clocks forward from 12:00 midnight
+# to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
+# backwards from 1:00am to 12:00am"
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
 			-11:00	-	WST	2010 Sep 26
-			-11:00	1:00	WSDT	2011 Apr 3
+			-11:00	1:00	WSDT	2011 Apr 3 1:00
 			-11:00	-	WST
 
 # Solomon Is

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 07:51:33 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 70C59106564A;
	Wed,  3 Nov 2010 07:51:33 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5EEDB8FC12;
	Wed,  3 Nov 2010 07:51:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA37pX68011896;
	Wed, 3 Nov 2010 07:51:33 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA37pXab011894;
	Wed, 3 Nov 2010 07:51:33 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201011030751.oA37pXab011894@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Wed, 3 Nov 2010 07:51:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214726 - head/sys/dev/usb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 07:51:33 -0000

Author: hselasky
Date: Wed Nov  3 07:51:33 2010
New Revision: 214726
URL: http://svn.freebsd.org/changeset/base/214726

Log:
  Clean up leftover USB device ID after r213856. This fixes:
  options USB_VERBOSE
  
  Submitted by:	Lucius Windschuh
  Approved by:	thompsa (mentor)

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Wed Nov  3 01:32:50 2010	(r214725)
+++ head/sys/dev/usb/usbdevs	Wed Nov  3 07:51:33 2010	(r214726)
@@ -3270,9 +3270,6 @@ product UMEDIA AR5523_2_NF	0x3206	AR5523
 /* Universal Access products */
 product UNIACCESS PANACHE	0x0101	Panache Surf USB ISDN Adapter
 
-/* Unknown vendors */
-product UNKNOWN5 USB2IDEBRIDGE	0x00ff	USB 2.0 ATA/SATA Bridge
-
 /* USI products */
 product USI MC60		0x10c5	MC60 Serial
 

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 09:23:09 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D505106566B;
	Wed,  3 Nov 2010 09:23:09 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E47BB8FC0A;
	Wed,  3 Nov 2010 09:23:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA39N8OC014151;
	Wed, 3 Nov 2010 09:23:08 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA39N8Ki014148;
	Wed, 3 Nov 2010 09:23:08 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201011030923.oA39N8Ki014148@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 3 Nov 2010 09:23:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214728 - head/libexec/rtld-elf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 09:23:09 -0000

Author: kib
Date: Wed Nov  3 09:23:08 2010
New Revision: 214728
URL: http://svn.freebsd.org/changeset/base/214728

Log:
  If dlopen() is called for the dso that has been already loaded as a
  dependency, then the dso never has its DAG initialized. Empty DAG
  makes ref_dag() call in dlopen() a nop, and the dso refcount is off
  by one.
  
  Initialize the DAG on the first dlopen() call, using a boolean flag
  to prevent double initialization.
  
  From the PR (edited):
  Assume we have a library liba.so, containing a function a(), and a
  library libb.so, containing function b(). liba.so needs functionality
  from libb.so, so liba.so links in libb.so.
  
  An application doesn't know about the relation between these libraries,
  but needs to call a() and b(). It dlopen()s liba.so and obtains a
  pointer to a(), then it dlopen()s libb.so and obtains a pointer to b().
  
  As soon as the application doesn't need a() anymore, it dlclose()s liba.so.
  
  Expected result: the pointer to b() is still valid and can be called
  Actual result: the pointer to b() has become invalid, even though the
  application did not dlclose() the handle to libb.so. On calling b(), the
  application crashes with a segmentation fault.
  
  PR:	misc/151861
  Based on patch by:	jh
  Reviewed by:	kan
  Tested by:	Arjan van Leeuwen 
  MFC after:	1 week

Modified:
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Wed Nov  3 08:34:00 2010	(r214727)
+++ head/libexec/rtld-elf/rtld.c	Wed Nov  3 09:23:08 2010	(r214728)
@@ -1275,8 +1275,11 @@ init_dag(Obj_Entry *root)
 {
     DoneList donelist;
 
+    if (root->dag_inited)
+	    return;
     donelist_init(&donelist);
     init_dag1(root, root, &donelist);
+    root->dag_inited = true;
 }
 
 static void
@@ -2045,8 +2048,16 @@ dlopen(const char *name, int mode)
 	    }
 	} else {
 
-	    /* Bump the reference counts for objects on this DAG. */
-	    ref_dag(obj);
+	    /*
+	     * Bump the reference counts for objects on this DAG.  If
+	     * this is the first dlopen() call for the object that was
+	     * already loaded as a dependency, initialize the dag
+	     * starting at it.
+	     */
+	    if (obj->dl_refcount == 1)
+		init_dag(obj);
+	    else
+		ref_dag(obj);
 
 	    if (ld_tracing)
 		goto trace;

Modified: head/libexec/rtld-elf/rtld.h
==============================================================================
--- head/libexec/rtld-elf/rtld.h	Wed Nov  3 08:34:00 2010	(r214727)
+++ head/libexec/rtld-elf/rtld.h	Wed Nov  3 09:23:08 2010	(r214728)
@@ -222,6 +222,7 @@ typedef struct Struct_Obj_Entry {
     bool ref_nodel : 1;		/* Refcount increased to prevent dlclose */
     bool init_scanned: 1;	/* Object is already on init list. */
     bool on_fini_list: 1;	/* Object is already on fini list. */
+    bool dag_inited : 1;	/* Object has its DAG initialized. */
 
     struct link_map linkmap;	/* For GDB and dlinfo() */
     Objlist dldags;		/* Object belongs to these dlopened DAGs (%) */

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 10:43:39 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A32E1065672;
	Wed,  3 Nov 2010 10:43:39 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1321E8FC12;
	Wed,  3 Nov 2010 10:43:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3AhdsQ018146;
	Wed, 3 Nov 2010 10:43:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3Ahdf8018142;
	Wed, 3 Nov 2010 10:43:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201011031043.oA3Ahdf8018142@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 3 Nov 2010 10:43:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214734 - in head/contrib/wpa: hostapd hostapd/logwatch
	patches src src/ap src/common src/crypto src/drivers
	src/eap_common src/eap_peer src/eap_server src/eapol_auth
	src/eapol_supp src...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 10:43:39 -0000

Author: rpaulo
Date: Wed Nov  3 10:43:38 2010
New Revision: 214734
URL: http://svn.freebsd.org/changeset/base/214734

Log:
  Merge wpa_supplicant and hostapd 0.7.3.

Added:
  head/contrib/wpa/patches/
     - copied from r214505, vendor/wpa/dist/patches/
  head/contrib/wpa/src/ap/
     - copied from r214505, vendor/wpa/dist/src/ap/
  head/contrib/wpa/src/crypto/.gitignore
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/.gitignore
  head/contrib/wpa/src/crypto/aes-cbc.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-cbc.c
  head/contrib/wpa/src/crypto/aes-ctr.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-ctr.c
  head/contrib/wpa/src/crypto/aes-eax.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-eax.c
  head/contrib/wpa/src/crypto/aes-encblock.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-encblock.c
  head/contrib/wpa/src/crypto/aes-internal-dec.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-internal-dec.c
  head/contrib/wpa/src/crypto/aes-internal-enc.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-internal-enc.c
  head/contrib/wpa/src/crypto/aes-internal.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-internal.c
  head/contrib/wpa/src/crypto/aes-omac1.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-omac1.c
  head/contrib/wpa/src/crypto/aes-unwrap.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-unwrap.c
  head/contrib/wpa/src/crypto/aes-wrap.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes-wrap.c
  head/contrib/wpa/src/crypto/aes_i.h
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/aes_i.h
  head/contrib/wpa/src/crypto/crypto_internal-cipher.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/crypto_internal-cipher.c
  head/contrib/wpa/src/crypto/crypto_internal-modexp.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/crypto_internal-modexp.c
  head/contrib/wpa/src/crypto/crypto_internal-rsa.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/crypto_internal-rsa.c
  head/contrib/wpa/src/crypto/crypto_nss.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/crypto_nss.c
  head/contrib/wpa/src/crypto/des-internal.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/des-internal.c
  head/contrib/wpa/src/crypto/des_i.h
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/des_i.h
  head/contrib/wpa/src/crypto/dh_group5.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/dh_group5.c
  head/contrib/wpa/src/crypto/dh_group5.h
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/dh_group5.h
  head/contrib/wpa/src/crypto/fips_prf_cryptoapi.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/fips_prf_cryptoapi.c
  head/contrib/wpa/src/crypto/fips_prf_gnutls.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/fips_prf_gnutls.c
  head/contrib/wpa/src/crypto/fips_prf_internal.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/fips_prf_internal.c
  head/contrib/wpa/src/crypto/fips_prf_nss.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/fips_prf_nss.c
  head/contrib/wpa/src/crypto/fips_prf_openssl.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/fips_prf_openssl.c
  head/contrib/wpa/src/crypto/md4-internal.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/md4-internal.c
  head/contrib/wpa/src/crypto/md5-internal.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/md5-internal.c
  head/contrib/wpa/src/crypto/md5-non-fips.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/md5-non-fips.c
  head/contrib/wpa/src/crypto/md5_i.h
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/md5_i.h
  head/contrib/wpa/src/crypto/milenage.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/milenage.c
  head/contrib/wpa/src/crypto/milenage.h
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/milenage.h
  head/contrib/wpa/src/crypto/sha1-internal.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/sha1-internal.c
  head/contrib/wpa/src/crypto/sha1-pbkdf2.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/sha1-pbkdf2.c
  head/contrib/wpa/src/crypto/sha1-tlsprf.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/sha1-tlsprf.c
  head/contrib/wpa/src/crypto/sha1-tprf.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/sha1-tprf.c
  head/contrib/wpa/src/crypto/sha1_i.h
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/sha1_i.h
  head/contrib/wpa/src/crypto/sha256-internal.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/sha256-internal.c
  head/contrib/wpa/src/crypto/tls_nss.c
     - copied unchanged from r214505, vendor/wpa/dist/src/crypto/tls_nss.c
  head/contrib/wpa/src/drivers/.gitignore
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/.gitignore
  head/contrib/wpa/src/drivers/driver_atheros.c
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/driver_atheros.c
  head/contrib/wpa/src/drivers/driver_none.c
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/driver_none.c
  head/contrib/wpa/src/drivers/drivers.mak
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/drivers.mak
  head/contrib/wpa/src/drivers/linux_ioctl.c
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/linux_ioctl.c
  head/contrib/wpa/src/drivers/linux_ioctl.h
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/linux_ioctl.h
  head/contrib/wpa/src/drivers/netlink.c
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/netlink.c
  head/contrib/wpa/src/drivers/netlink.h
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/netlink.h
  head/contrib/wpa/src/drivers/nl80211_copy.h
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/nl80211_copy.h
  head/contrib/wpa/src/drivers/wireless_copy.h
     - copied unchanged from r214505, vendor/wpa/dist/src/drivers/wireless_copy.h
  head/contrib/wpa/src/eap_server/eap_server.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server.c
  head/contrib/wpa/src/eap_server/eap_server_aka.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_aka.c
  head/contrib/wpa/src/eap_server/eap_server_fast.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_fast.c
  head/contrib/wpa/src/eap_server/eap_server_gpsk.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_gpsk.c
  head/contrib/wpa/src/eap_server/eap_server_gtc.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_gtc.c
  head/contrib/wpa/src/eap_server/eap_server_identity.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_identity.c
  head/contrib/wpa/src/eap_server/eap_server_ikev2.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_ikev2.c
  head/contrib/wpa/src/eap_server/eap_server_md5.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_md5.c
  head/contrib/wpa/src/eap_server/eap_server_methods.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_methods.c
  head/contrib/wpa/src/eap_server/eap_server_mschapv2.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_mschapv2.c
  head/contrib/wpa/src/eap_server/eap_server_pax.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_pax.c
  head/contrib/wpa/src/eap_server/eap_server_peap.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_peap.c
  head/contrib/wpa/src/eap_server/eap_server_psk.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_psk.c
  head/contrib/wpa/src/eap_server/eap_server_sake.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_sake.c
  head/contrib/wpa/src/eap_server/eap_server_sim.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_sim.c
  head/contrib/wpa/src/eap_server/eap_server_tls.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_tls.c
  head/contrib/wpa/src/eap_server/eap_server_tls_common.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_tls_common.c
  head/contrib/wpa/src/eap_server/eap_server_tnc.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_tnc.c
  head/contrib/wpa/src/eap_server/eap_server_ttls.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_ttls.c
  head/contrib/wpa/src/eap_server/eap_server_vendor_test.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_vendor_test.c
  head/contrib/wpa/src/eap_server/eap_server_wsc.c
     - copied unchanged from r214505, vendor/wpa/dist/src/eap_server/eap_server_wsc.c
  head/contrib/wpa/src/eapol_auth/
     - copied from r214505, vendor/wpa/dist/src/eapol_auth/
  head/contrib/wpa/src/lib.rules
     - copied unchanged from r214505, vendor/wpa/dist/src/lib.rules
  head/contrib/wpa/src/radius/.gitignore
     - copied unchanged from r214505, vendor/wpa/dist/src/radius/.gitignore
  head/contrib/wpa/src/tls/.gitignore
     - copied unchanged from r214505, vendor/wpa/dist/src/tls/.gitignore
  head/contrib/wpa/src/tls/pkcs1.c
     - copied unchanged from r214505, vendor/wpa/dist/src/tls/pkcs1.c
  head/contrib/wpa/src/tls/pkcs1.h
     - copied unchanged from r214505, vendor/wpa/dist/src/tls/pkcs1.h
  head/contrib/wpa/src/tls/pkcs5.c
     - copied unchanged from r214505, vendor/wpa/dist/src/tls/pkcs5.c
  head/contrib/wpa/src/tls/pkcs5.h
     - copied unchanged from r214505, vendor/wpa/dist/src/tls/pkcs5.h
  head/contrib/wpa/src/tls/pkcs8.c
     - copied unchanged from r214505, vendor/wpa/dist/src/tls/pkcs8.c
  head/contrib/wpa/src/tls/pkcs8.h
     - copied unchanged from r214505, vendor/wpa/dist/src/tls/pkcs8.h
  head/contrib/wpa/src/utils/.gitignore
     - copied unchanged from r214505, vendor/wpa/dist/src/utils/.gitignore
  head/contrib/wpa/src/utils/list.h
     - copied unchanged from r214505, vendor/wpa/dist/src/utils/list.h
  head/contrib/wpa/src/utils/radiotap.c
     - copied unchanged from r214505, vendor/wpa/dist/src/utils/radiotap.c
  head/contrib/wpa/src/utils/radiotap.h
     - copied unchanged from r214505, vendor/wpa/dist/src/utils/radiotap.h
  head/contrib/wpa/src/utils/radiotap_iter.h
     - copied unchanged from r214505, vendor/wpa/dist/src/utils/radiotap_iter.h
  head/contrib/wpa/src/utils/trace.c
     - copied unchanged from r214505, vendor/wpa/dist/src/utils/trace.c
  head/contrib/wpa/src/utils/trace.h
     - copied unchanged from r214505, vendor/wpa/dist/src/utils/trace.h
  head/contrib/wpa/src/wps/http.h
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/http.h
  head/contrib/wpa/src/wps/http_client.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/http_client.c
  head/contrib/wpa/src/wps/http_client.h
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/http_client.h
  head/contrib/wpa/src/wps/http_server.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/http_server.c
  head/contrib/wpa/src/wps/http_server.h
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/http_server.h
  head/contrib/wpa/src/wps/ndef.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/ndef.c
  head/contrib/wpa/src/wps/upnp_xml.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/upnp_xml.c
  head/contrib/wpa/src/wps/upnp_xml.h
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/upnp_xml.h
  head/contrib/wpa/src/wps/wps_er.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/wps_er.c
  head/contrib/wpa/src/wps/wps_er.h
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/wps_er.h
  head/contrib/wpa/src/wps/wps_er_ssdp.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/wps_er_ssdp.c
  head/contrib/wpa/src/wps/wps_nfc.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/wps_nfc.c
  head/contrib/wpa/src/wps/wps_nfc_pn531.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/wps_nfc_pn531.c
  head/contrib/wpa/src/wps/wps_ufd.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/wps_ufd.c
  head/contrib/wpa/src/wps/wps_upnp_ap.c
     - copied unchanged from r214505, vendor/wpa/dist/src/wps/wps_upnp_ap.c
  head/contrib/wpa/wpa_supplicant/.gitignore
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/.gitignore
  head/contrib/wpa/wpa_supplicant/ap.c
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/ap.c
  head/contrib/wpa/wpa_supplicant/ap.h
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/ap.h
  head/contrib/wpa/wpa_supplicant/bgscan.c
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/bgscan.c
  head/contrib/wpa/wpa_supplicant/bgscan.h
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/bgscan.h
  head/contrib/wpa/wpa_supplicant/bgscan_simple.c
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/bgscan_simple.c
  head/contrib/wpa/wpa_supplicant/bss.c
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/bss.c
  head/contrib/wpa/wpa_supplicant/bss.h
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/bss.h
  head/contrib/wpa/wpa_supplicant/dbus/
     - copied from r214505, vendor/wpa/dist/wpa_supplicant/dbus/
  head/contrib/wpa/wpa_supplicant/doc/docbook/.gitignore
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/doc/docbook/.gitignore
  head/contrib/wpa/wpa_supplicant/driver_i.h
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/driver_i.h
  head/contrib/wpa/wpa_supplicant/eap_register.c
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/eap_register.c
  head/contrib/wpa/wpa_supplicant/examples/60_wpa_supplicant
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/examples/60_wpa_supplicant
  head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-getall.py
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/examples/wpas-dbus-new-getall.py
  head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-signals.py
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/examples/wpas-dbus-new-signals.py
  head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-wps.py
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/examples/wpas-dbus-new-wps.py
  head/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new.py
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/examples/wpas-dbus-new.py
  head/contrib/wpa/wpa_supplicant/ibss_rsn.c
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/ibss_rsn.c
  head/contrib/wpa/wpa_supplicant/ibss_rsn.h
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/ibss_rsn.h
  head/contrib/wpa/wpa_supplicant/notify.c
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/notify.c
  head/contrib/wpa/wpa_supplicant/notify.h
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/notify.h
  head/contrib/wpa/wpa_supplicant/scan.h
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/scan.h
  head/contrib/wpa/wpa_supplicant/sme.c
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/sme.c
  head/contrib/wpa/wpa_supplicant/sme.h
     - copied unchanged from r214505, vendor/wpa/dist/wpa_supplicant/sme.h
  head/contrib/wpa/wpa_supplicant/xcode/
     - copied from r214505, vendor/wpa/dist/wpa_supplicant/xcode/
Replaced:
  head/contrib/wpa/hostapd/
     - copied from r214505, vendor/wpa/dist/hostapd/
  head/contrib/wpa/hostapd/ChangeLog
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/ChangeLog
  head/contrib/wpa/hostapd/Makefile
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/Makefile
  head/contrib/wpa/hostapd/README
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/README
  head/contrib/wpa/hostapd/README-WPS
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/README-WPS
  head/contrib/wpa/hostapd/ctrl_iface.c
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/ctrl_iface.c
  head/contrib/wpa/hostapd/ctrl_iface.h
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/ctrl_iface.h
  head/contrib/wpa/hostapd/defconfig
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/defconfig
  head/contrib/wpa/hostapd/eap_testing.txt
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/eap_testing.txt
  head/contrib/wpa/hostapd/hostapd.8
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.8
  head/contrib/wpa/hostapd/hostapd.accept
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.accept
  head/contrib/wpa/hostapd/hostapd.conf
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.conf
  head/contrib/wpa/hostapd/hostapd.deny
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.deny
  head/contrib/wpa/hostapd/hostapd.eap_user
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.eap_user
  head/contrib/wpa/hostapd/hostapd.radius_clients
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.radius_clients
  head/contrib/wpa/hostapd/hostapd.sim_db
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.sim_db
  head/contrib/wpa/hostapd/hostapd.vlan
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.vlan
  head/contrib/wpa/hostapd/hostapd.wpa_psk
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd.wpa_psk
  head/contrib/wpa/hostapd/hostapd_cli.1
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd_cli.1
  head/contrib/wpa/hostapd/hostapd_cli.c
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/hostapd_cli.c
  head/contrib/wpa/hostapd/logwatch/
     - copied from r214505, vendor/wpa/dist/hostapd/logwatch/
  head/contrib/wpa/hostapd/logwatch/README
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/logwatch/README
  head/contrib/wpa/hostapd/logwatch/hostapd
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/logwatch/hostapd
  head/contrib/wpa/hostapd/logwatch/hostapd.conf
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/logwatch/hostapd.conf
  head/contrib/wpa/hostapd/nt_password_hash.c
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/nt_password_hash.c
  head/contrib/wpa/hostapd/wired.conf
     - copied unchanged from r214505, vendor/wpa/dist/hostapd/wired.conf
Deleted:
  head/contrib/wpa/src/common/nl80211_copy.h
  head/contrib/wpa/src/common/wireless_copy.h
  head/contrib/wpa/src/crypto/aes.c
  head/contrib/wpa/src/crypto/aes_wrap.c
  head/contrib/wpa/src/crypto/des.c
  head/contrib/wpa/src/crypto/md4.c
  head/contrib/wpa/src/crypto/rc4.h
  head/contrib/wpa/src/drivers/radiotap.c
  head/contrib/wpa/src/drivers/radiotap.h
  head/contrib/wpa/src/drivers/radiotap_iter.h
  head/contrib/wpa/src/drivers/scan_helpers.c
  head/contrib/wpa/src/eap_server/eap.c
  head/contrib/wpa/src/eap_server/eap_aka.c
  head/contrib/wpa/src/eap_server/eap_fast.c
  head/contrib/wpa/src/eap_server/eap_gpsk.c
  head/contrib/wpa/src/eap_server/eap_gtc.c
  head/contrib/wpa/src/eap_server/eap_identity.c
  head/contrib/wpa/src/eap_server/eap_ikev2.c
  head/contrib/wpa/src/eap_server/eap_md5.c
  head/contrib/wpa/src/eap_server/eap_methods.c
  head/contrib/wpa/src/eap_server/eap_mschapv2.c
  head/contrib/wpa/src/eap_server/eap_pax.c
  head/contrib/wpa/src/eap_server/eap_peap.c
  head/contrib/wpa/src/eap_server/eap_psk.c
  head/contrib/wpa/src/eap_server/eap_sake.c
  head/contrib/wpa/src/eap_server/eap_sim.c
  head/contrib/wpa/src/eap_server/eap_tls.c
  head/contrib/wpa/src/eap_server/eap_tls_common.c
  head/contrib/wpa/src/eap_server/eap_tnc.c
  head/contrib/wpa/src/eap_server/eap_ttls.c
  head/contrib/wpa/src/eap_server/eap_vendor_test.c
  head/contrib/wpa/src/eap_server/eap_wsc.c
  head/contrib/wpa/src/hlr_auc_gw/Makefile
  head/contrib/wpa/src/hlr_auc_gw/hlr_auc_gw.c
  head/contrib/wpa/src/hlr_auc_gw/hlr_auc_gw.milenage_db
  head/contrib/wpa/src/hlr_auc_gw/milenage.c
  head/contrib/wpa/src/hlr_auc_gw/milenage.h
  head/contrib/wpa/src/tls/asn1_test.c
  head/contrib/wpa/wpa_supplicant/ctrl_iface_dbus.c
  head/contrib/wpa/wpa_supplicant/ctrl_iface_dbus.h
  head/contrib/wpa/wpa_supplicant/ctrl_iface_dbus_handlers.c
  head/contrib/wpa/wpa_supplicant/ctrl_iface_dbus_handlers.h
  head/contrib/wpa/wpa_supplicant/dbus-wpa_supplicant.conf
  head/contrib/wpa/wpa_supplicant/dbus-wpa_supplicant.service
  head/contrib/wpa/wpa_supplicant/dbus_dict_helpers.c
  head/contrib/wpa/wpa_supplicant/dbus_dict_helpers.h
  head/contrib/wpa/wpa_supplicant/doc/code_structure.doxygen
  head/contrib/wpa/wpa_supplicant/doc/ctrl_iface.doxygen
  head/contrib/wpa/wpa_supplicant/doc/doxygen.fast
  head/contrib/wpa/wpa_supplicant/doc/doxygen.full
  head/contrib/wpa/wpa_supplicant/doc/driver_wrapper.doxygen
  head/contrib/wpa/wpa_supplicant/doc/eap.doxygen
  head/contrib/wpa/wpa_supplicant/doc/kerneldoc2doxygen.pl
  head/contrib/wpa/wpa_supplicant/doc/mainpage.doxygen
  head/contrib/wpa/wpa_supplicant/doc/porting.doxygen
  head/contrib/wpa/wpa_supplicant/doc/testing_tools.doxygen
  head/contrib/wpa/wpa_supplicant/doc/wpa_supplicant.fig
  head/contrib/wpa/wpa_supplicant/tests/test_aes.c
  head/contrib/wpa/wpa_supplicant/tests/test_md4.c
  head/contrib/wpa/wpa_supplicant/tests/test_md5.c
  head/contrib/wpa/wpa_supplicant/tests/test_ms_funcs.c
  head/contrib/wpa/wpa_supplicant/tests/test_sha1.c
  head/contrib/wpa/wpa_supplicant/tests/test_sha256.c
  head/contrib/wpa/wpa_supplicant/tests/test_x509v3.c
  head/contrib/wpa/wpa_supplicant/tests/test_x509v3_nist.sh
  head/contrib/wpa/wpa_supplicant/tests/test_x509v3_nist2.sh
Modified:
  head/contrib/wpa/src/Makefile
  head/contrib/wpa/src/common/Makefile
  head/contrib/wpa/src/common/defs.h
  head/contrib/wpa/src/common/ieee802_11_common.c
  head/contrib/wpa/src/common/ieee802_11_common.h
  head/contrib/wpa/src/common/ieee802_11_defs.h
  head/contrib/wpa/src/common/privsep_commands.h
  head/contrib/wpa/src/common/version.h
  head/contrib/wpa/src/common/wpa_common.c
  head/contrib/wpa/src/common/wpa_common.h
  head/contrib/wpa/src/common/wpa_ctrl.h
  head/contrib/wpa/src/crypto/Makefile
  head/contrib/wpa/src/crypto/aes.h
  head/contrib/wpa/src/crypto/crypto.h
  head/contrib/wpa/src/crypto/crypto_cryptoapi.c
  head/contrib/wpa/src/crypto/crypto_gnutls.c
  head/contrib/wpa/src/crypto/crypto_internal.c
  head/contrib/wpa/src/crypto/crypto_libtomcrypt.c
  head/contrib/wpa/src/crypto/crypto_none.c
  head/contrib/wpa/src/crypto/crypto_openssl.c
  head/contrib/wpa/src/crypto/dh_groups.c
  head/contrib/wpa/src/crypto/md5.c
  head/contrib/wpa/src/crypto/md5.h
  head/contrib/wpa/src/crypto/ms_funcs.c
  head/contrib/wpa/src/crypto/ms_funcs.h
  head/contrib/wpa/src/crypto/rc4.c
  head/contrib/wpa/src/crypto/sha1.c
  head/contrib/wpa/src/crypto/sha1.h
  head/contrib/wpa/src/crypto/sha256.c
  head/contrib/wpa/src/crypto/tls.h
  head/contrib/wpa/src/crypto/tls_gnutls.c
  head/contrib/wpa/src/crypto/tls_internal.c
  head/contrib/wpa/src/crypto/tls_none.c
  head/contrib/wpa/src/crypto/tls_openssl.c
  head/contrib/wpa/src/crypto/tls_schannel.c
  head/contrib/wpa/src/drivers/Makefile
  head/contrib/wpa/src/drivers/driver.h
  head/contrib/wpa/src/drivers/driver_ndis.c
  head/contrib/wpa/src/drivers/driver_ndis.h
  head/contrib/wpa/src/drivers/driver_ndiswrapper.c
  head/contrib/wpa/src/drivers/driver_wired.c
  head/contrib/wpa/src/drivers/drivers.c
  head/contrib/wpa/src/eap_common/Makefile
  head/contrib/wpa/src/eap_common/chap.c
  head/contrib/wpa/src/eap_common/chap.h
  head/contrib/wpa/src/eap_common/eap_fast_common.c
  head/contrib/wpa/src/eap_common/eap_gpsk_common.c
  head/contrib/wpa/src/eap_common/eap_pax_common.c
  head/contrib/wpa/src/eap_common/eap_peap_common.c
  head/contrib/wpa/src/eap_common/eap_psk_common.c
  head/contrib/wpa/src/eap_common/eap_sake_common.c
  head/contrib/wpa/src/eap_common/eap_sim_common.c
  head/contrib/wpa/src/eap_common/eap_sim_common.h
  head/contrib/wpa/src/eap_common/ikev2_common.c
  head/contrib/wpa/src/eap_peer/Makefile
  head/contrib/wpa/src/eap_peer/eap.c
  head/contrib/wpa/src/eap_peer/eap.h
  head/contrib/wpa/src/eap_peer/eap_aka.c
  head/contrib/wpa/src/eap_peer/eap_config.h
  head/contrib/wpa/src/eap_peer/eap_fast.c
  head/contrib/wpa/src/eap_peer/eap_fast_pac.c
  head/contrib/wpa/src/eap_peer/eap_leap.c
  head/contrib/wpa/src/eap_peer/eap_md5.c
  head/contrib/wpa/src/eap_peer/eap_methods.c
  head/contrib/wpa/src/eap_peer/eap_methods.h
  head/contrib/wpa/src/eap_peer/eap_mschapv2.c
  head/contrib/wpa/src/eap_peer/eap_pax.c
  head/contrib/wpa/src/eap_peer/eap_peap.c
  head/contrib/wpa/src/eap_peer/eap_psk.c
  head/contrib/wpa/src/eap_peer/eap_sim.c
  head/contrib/wpa/src/eap_peer/eap_tls.c
  head/contrib/wpa/src/eap_peer/eap_tls_common.c
  head/contrib/wpa/src/eap_peer/eap_tls_common.h
  head/contrib/wpa/src/eap_peer/eap_tnc.c
  head/contrib/wpa/src/eap_peer/eap_ttls.c
  head/contrib/wpa/src/eap_peer/eap_wsc.c
  head/contrib/wpa/src/eap_peer/ikev2.c
  head/contrib/wpa/src/eap_peer/mschapv2.c
  head/contrib/wpa/src/eap_peer/mschapv2.h
  head/contrib/wpa/src/eap_server/Makefile
  head/contrib/wpa/src/eap_server/eap.h
  head/contrib/wpa/src/eap_server/eap_i.h
  head/contrib/wpa/src/eap_server/eap_methods.h
  head/contrib/wpa/src/eap_server/eap_sim_db.c
  head/contrib/wpa/src/eap_server/eap_sim_db.h
  head/contrib/wpa/src/eap_server/eap_tls_common.h
  head/contrib/wpa/src/eap_server/ikev2.c
  head/contrib/wpa/src/eap_server/tncs.c
  head/contrib/wpa/src/eapol_supp/Makefile
  head/contrib/wpa/src/eapol_supp/eapol_supp_sm.c
  head/contrib/wpa/src/eapol_supp/eapol_supp_sm.h
  head/contrib/wpa/src/l2_packet/Makefile
  head/contrib/wpa/src/l2_packet/l2_packet_freebsd.c
  head/contrib/wpa/src/l2_packet/l2_packet_ndis.c
  head/contrib/wpa/src/radius/Makefile
  head/contrib/wpa/src/radius/radius.c
  head/contrib/wpa/src/radius/radius.h
  head/contrib/wpa/src/radius/radius_client.c
  head/contrib/wpa/src/radius/radius_client.h
  head/contrib/wpa/src/radius/radius_server.c
  head/contrib/wpa/src/radius/radius_server.h
  head/contrib/wpa/src/rsn_supp/Makefile
  head/contrib/wpa/src/rsn_supp/peerkey.c
  head/contrib/wpa/src/rsn_supp/pmksa_cache.c
  head/contrib/wpa/src/rsn_supp/pmksa_cache.h
  head/contrib/wpa/src/rsn_supp/preauth.c
  head/contrib/wpa/src/rsn_supp/preauth.h
  head/contrib/wpa/src/rsn_supp/wpa.c
  head/contrib/wpa/src/rsn_supp/wpa.h
  head/contrib/wpa/src/rsn_supp/wpa_ft.c
  head/contrib/wpa/src/rsn_supp/wpa_i.h
  head/contrib/wpa/src/rsn_supp/wpa_ie.c
  head/contrib/wpa/src/rsn_supp/wpa_ie.h
  head/contrib/wpa/src/tls/Makefile
  head/contrib/wpa/src/tls/asn1.c
  head/contrib/wpa/src/tls/asn1.h
  head/contrib/wpa/src/tls/rsa.c
  head/contrib/wpa/src/tls/tlsv1_client.c
  head/contrib/wpa/src/tls/tlsv1_client_read.c
  head/contrib/wpa/src/tls/tlsv1_client_write.c
  head/contrib/wpa/src/tls/tlsv1_common.h
  head/contrib/wpa/src/tls/tlsv1_cred.c
  head/contrib/wpa/src/tls/tlsv1_record.c
  head/contrib/wpa/src/tls/tlsv1_record.h
  head/contrib/wpa/src/tls/tlsv1_server.c
  head/contrib/wpa/src/tls/tlsv1_server_read.c
  head/contrib/wpa/src/tls/tlsv1_server_write.c
  head/contrib/wpa/src/tls/x509v3.c
  head/contrib/wpa/src/tls/x509v3.h
  head/contrib/wpa/src/utils/Makefile
  head/contrib/wpa/src/utils/base64.c
  head/contrib/wpa/src/utils/build_config.h
  head/contrib/wpa/src/utils/common.c
  head/contrib/wpa/src/utils/common.h
  head/contrib/wpa/src/utils/eloop.c
  head/contrib/wpa/src/utils/eloop.h
  head/contrib/wpa/src/utils/eloop_none.c
  head/contrib/wpa/src/utils/eloop_win.c
  head/contrib/wpa/src/utils/ip_addr.h
  head/contrib/wpa/src/utils/os.h
  head/contrib/wpa/src/utils/os_internal.c
  head/contrib/wpa/src/utils/os_unix.c
  head/contrib/wpa/src/utils/uuid.c
  head/contrib/wpa/src/utils/uuid.h
  head/contrib/wpa/src/utils/wpa_debug.c
  head/contrib/wpa/src/utils/wpa_debug.h
  head/contrib/wpa/src/utils/wpabuf.c
  head/contrib/wpa/src/utils/wpabuf.h
  head/contrib/wpa/src/wps/Makefile
  head/contrib/wpa/src/wps/httpread.c
  head/contrib/wpa/src/wps/httpread.h
  head/contrib/wpa/src/wps/wps.c
  head/contrib/wpa/src/wps/wps.h
  head/contrib/wpa/src/wps/wps_attr_build.c
  head/contrib/wpa/src/wps/wps_attr_parse.c
  head/contrib/wpa/src/wps/wps_attr_process.c
  head/contrib/wpa/src/wps/wps_common.c
  head/contrib/wpa/src/wps/wps_defs.h
  head/contrib/wpa/src/wps/wps_dev_attr.c
  head/contrib/wpa/src/wps/wps_enrollee.c
  head/contrib/wpa/src/wps/wps_i.h
  head/contrib/wpa/src/wps/wps_registrar.c
  head/contrib/wpa/src/wps/wps_upnp.c
  head/contrib/wpa/src/wps/wps_upnp.h
  head/contrib/wpa/src/wps/wps_upnp_event.c
  head/contrib/wpa/src/wps/wps_upnp_i.h
  head/contrib/wpa/src/wps/wps_upnp_ssdp.c
  head/contrib/wpa/src/wps/wps_upnp_web.c
  head/contrib/wpa/wpa_supplicant/ChangeLog
  head/contrib/wpa/wpa_supplicant/Makefile
  head/contrib/wpa/wpa_supplicant/README
  head/contrib/wpa/wpa_supplicant/README-WPS
  head/contrib/wpa/wpa_supplicant/config.c
  head/contrib/wpa/wpa_supplicant/config.h
  head/contrib/wpa/wpa_supplicant/config_file.c
  head/contrib/wpa/wpa_supplicant/config_ssid.h
  head/contrib/wpa/wpa_supplicant/ctrl_iface.c
  head/contrib/wpa/wpa_supplicant/ctrl_iface_named_pipe.c
  head/contrib/wpa/wpa_supplicant/ctrl_iface_udp.c
  head/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c
  head/contrib/wpa/wpa_supplicant/defconfig
  head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_background.8
  head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_cli.8
  head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_gui.8
  head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_passphrase.8
  head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_priv.8
  head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_supplicant.8
  head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5
  head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_supplicant.sgml
  head/contrib/wpa/wpa_supplicant/eapol_test.c
  head/contrib/wpa/wpa_supplicant/events.c
  head/contrib/wpa/wpa_supplicant/main.c
  head/contrib/wpa/wpa_supplicant/mlme.c
  head/contrib/wpa/wpa_supplicant/mlme.h
  head/contrib/wpa/wpa_supplicant/nmake.mak
  head/contrib/wpa/wpa_supplicant/preauth_test.c
  head/contrib/wpa/wpa_supplicant/scan.c
  head/contrib/wpa/wpa_supplicant/tests/test_eap_sim_common.c
  head/contrib/wpa/wpa_supplicant/tests/test_wpa.c
  head/contrib/wpa/wpa_supplicant/todo.txt
  head/contrib/wpa/wpa_supplicant/wpa_cli.c
  head/contrib/wpa/wpa_supplicant/wpa_passphrase.c
  head/contrib/wpa/wpa_supplicant/wpa_priv.c
  head/contrib/wpa/wpa_supplicant/wpa_supplicant.c
  head/contrib/wpa/wpa_supplicant/wpa_supplicant.conf
  head/contrib/wpa/wpa_supplicant/wpa_supplicant.nsi
  head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h
  head/contrib/wpa/wpa_supplicant/wpas_glue.c
  head/contrib/wpa/wpa_supplicant/wps_supplicant.c
  head/contrib/wpa/wpa_supplicant/wps_supplicant.h
Directory Properties:
  head/contrib/wpa/   (props changed)

Copied: head/contrib/wpa/hostapd/ChangeLog (from r214505, vendor/wpa/dist/hostapd/ChangeLog)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/wpa/hostapd/ChangeLog	Wed Nov  3 10:43:38 2010	(r214734, copy of r214505, vendor/wpa/dist/hostapd/ChangeLog)
@@ -0,0 +1,663 @@
+ChangeLog for hostapd
+
+2010-09-07 - v0.7.3
+	* fixed re-association after WPS not initializing WPA state machine in
+	  some cases
+	* fixed WPS IE update on reconfiguration
+	* fixed WPS code not to proxy Probe Request frames for foreign SSIDs
+	* added WPS workaround for open networks and some known interop issues
+	* fixed WPS Diffie-Hellman derivation to use correct public key length
+	* fixed FT RRB messages on big endian CPUs
+	* changed WPS protection for brute force AP PIN attacks to disable AP
+	  PIN only temporarily (but with increasing time) to avoid usability
+	  issues on Label-only devices
+	* added wps_ap_pin command for more secure handling of AP PIN
+	  operations (e.g., to generate a random AP PIN and only use it for
+	  short amount of time)
+	* fixed HT STBC negotiation
+
+2010-04-18 - v0.7.2
+	* fix WPS internal Registrar use when an external Registrar is also
+	  active
+	* bsd: Cleaned up driver wrapper and added various low-level
+	  configuration options
+	* TNC: fixed issues with fragmentation
+	* EAP-TNC: add Flags field into fragment acknowledgement (needed to
+	  interoperate with other implementations; may potentially breaks
+	  compatibility with older wpa_supplicant/hostapd versions)
+	* cleaned up driver wrapper API for multi-BSS operations
+	* nl80211: fix multi-BSS and VLAN operations
+	* fix number of issues with IEEE 802.11r/FT; this version is not
+	  backwards compatible with old versions
+	* add SA Query Request processing in AP mode (IEEE 802.11w)
+	* fix IGTK PN in group rekeying (IEEE 802.11w)
+	* fix WPS PBC session overlap detection to use correct attribute
+	* hostapd_notif_Assoc() can now be called with all IEs to simplify
+	  driver wrappers
+	* work around interoperability issue with some WPS External Registrar
+	  implementations
+	* nl80211: fix WPS IE update
+	* hostapd_cli: add support for action script operations (run a script
+	  on hostapd events)
+	* fix DH padding with internal crypto code (mainly, for WPS)
+	* fix WPS association with both WPS IE and WPA/RSN IE present with
+	  driver wrappers that use hostapd MLME (e.g., nl80211)
+
+2010-01-16 - v0.7.1
+	* cleaned up driver wrapper API (struct wpa_driver_ops); the new API
+	  is not fully backwards compatible, so out-of-tree driver wrappers
+	  will need modifications
+	* cleaned up various module interfaces
+	* merge hostapd and wpa_supplicant developers' documentation into a
+	  single document
+	* fixed HT Capabilities IE with nl80211 drivers
+	* moved generic AP functionality code into src/ap
+	* WPS: handle Selected Registrar as union of info from all Registrars
+	* remove obsolte Prism54.org driver wrapper
+	* added internal debugging mechanism with backtrace support and memory
+	  allocation/freeing validation, etc. tests (CONFIG_WPA_TRACE=y)
+	* EAP-FAST server: piggyback Phase 2 start with the end of Phase 1
+	* WPS: add support for dynamically selecting whether to provision the
+	  PSK as an ASCII passphrase or PSK
+	* added support for WDS (4-address frame) mode with per-station virtual
+	  interfaces (wds_sta=1 in config file; only supported with
+	  driver=nl80211 for now)
+	* fixed WPS Probe Request processing to handle missing required
+	  attribute
+	* fixed PKCS#12 use with OpenSSL 1.0.0
+	* detect bridge interface automatically so that bridge parameter in
+	  hostapd.conf becomes optional (though, it may now be used to
+	  automatically add then WLAN interface into a bridge with
+	  driver=nl80211)
+
+2009-11-21 - v0.7.0
+	* increased hostapd_cli ping interval to 5 seconds and made this
+	  configurable with a new command line options (-G)
+	* driver_nl80211: use Linux socket filter to improve performance
+	* added support for external Registrars with WPS (UPnP transport)
+	* 802.11n: scan for overlapping BSSes before starting 20/40 MHz channel
+	* driver_nl80211: fixed STA accounting data collection (TX/RX bytes
+	  reported correctly; TX/RX packets not yet available from kernel)
+	* added support for WPS USBA out-of-band mechanism with USB Flash
+	  Drives (UFD) (CONFIG_WPS_UFD=y)
+	* fixed EAPOL/EAP reauthentication when using an external RADIUS
+	  authentication server
+	* fixed TNC with EAP-TTLS
+	* fixed IEEE 802.11r key derivation function to match with the standard
+	  (note: this breaks interoperability with previous version) [Bug 303]
+	* fixed SHA-256 based key derivation function to match with the
+	  standard when using CCMP (for IEEE 802.11r and IEEE 802.11w)
+	  (note: this breaks interoperability with previous version) [Bug 307]
+	* added number of code size optimizations to remove unnecessary
+	  functionality from the program binary based on build configuration
+	  (part of this automatic; part configurable with CONFIG_NO_* build
+	  options)
+	* use shared driver wrapper files with wpa_supplicant
+	* driver_nl80211: multiple updates to provide support for new Linux
+	  nl80211/mac80211 functionality
+	* updated management frame protection to use IEEE Std 802.11w-2009
+	* fixed number of small WPS issues and added workarounds to
+	  interoperate with common deployed broken implementations
+	* added some IEEE 802.11n co-existance rules to disable 40 MHz channels
+	  or modify primary/secondary channels if needed based on neighboring
+	  networks
+	* added support for NFC out-of-band mechanism with WPS
+	* added preliminary support for IEEE 802.11r RIC processing
+
+2009-01-06 - v0.6.7
+	* added support for Wi-Fi Protected Setup (WPS)
+	  (hostapd can now be configured to act as an integrated WPS Registrar
+	  and provision credentials for WPS Enrollees using PIN and PBC
+	  methods; external wireless Registrar can configure the AP, but
+	  external WLAN Manager Registrars are not supported); WPS support can
+	  be enabled by adding CONFIG_WPS=y into .config and setting the
+	  runtime configuration variables in hostapd.conf (see WPS section in
+	  the example configuration file); new hostapd_cli commands wps_pin and
+	  wps_pbc are used to configure WPS negotiation; see README-WPS for
+	  more details
+	* added IEEE 802.11n HT capability configuration (ht_capab)
+	* added support for generating Country IE based on nl80211 regulatory
+	  information (added if ieee80211d=1 in configuration)
+	* fixed WEP authentication (both Open System and Shared Key) with
+	  mac80211
+	* added support for EAP-AKA' (draft-arkko-eap-aka-kdf)
+	* added support for using driver_test over UDP socket
+	* changed EAP-GPSK to use the IANA assigned EAP method type 51
+	* updated management frame protection to use IEEE 802.11w/D7.0
+	* fixed retransmission of EAP requests if no response is received
+
+2008-11-23 - v0.6.6
+	* added a new configuration option, wpa_ptk_rekey, that can be used to
+	  enforce frequent PTK rekeying, e.g., to mitigate some attacks against
+	  TKIP deficiencies
+	* updated OpenSSL code for EAP-FAST to use an updated version of the
+	  session ticket overriding API that was included into the upstream
+	  OpenSSL 0.9.9 tree on 2008-11-15 (no additional OpenSSL patch is
+	  needed with that version anymore)
+	* changed channel flags configuration to read the information from
+	  the driver (e.g., via driver_nl80211 when using mac80211) instead of
+	  using hostapd as the source of the regulatory information (i.e.,
+	  information from CRDA is now used with mac80211); this allows 5 GHz
+	  channels to be used with hostapd (if allowed in the current
+	  regulatory domain)
+	* fixed EAP-TLS message processing for the last TLS message if it is
+	  large enough to require fragmentation (e.g., if a large Session
+	  Ticket data is included)
+	* fixed listen interval configuration for nl80211 drivers
+
+2008-11-01 - v0.6.5
+	* added support for SHA-256 as X.509 certificate digest when using the
+	  internal X.509/TLSv1 implementation
+	* fixed EAP-FAST PAC-Opaque padding (0.6.4 broke this for some peer
+	  identity lengths)
+	* fixed internal TLSv1 implementation for abbreviated handshake (used
+	  by EAP-FAST server)
+	* added support for setting VLAN ID for STAs based on local MAC ACL
+	  (accept_mac_file) as an alternative for RADIUS server-based
+	  configuration
+	* updated management frame protection to use IEEE 802.11w/D6.0
+	  (adds a new association ping to protect against unauthenticated
+	  authenticate or (re)associate request frames dropping association)
+	* added support for using SHA256-based stronger key derivation for WPA2
+	  (IEEE 802.11w)
+	* added new "driver wrapper" for RADIUS-only configuration
+	  (driver=none in hostapd.conf; CONFIG_DRIVER_NONE=y in .config)
+	* fixed WPA/RSN IE validation to verify that the proto (WPA vs. WPA2)
+	  is enabled in configuration
+	* changed EAP-FAST configuration to use separate fields for A-ID and
+	  A-ID-Info (eap_fast_a_id_info) to allow A-ID to be set to a fixed
+	  16-octet len binary value for better interoperability with some peer
+	  implementations; eap_fast_a_id is now configured as a hex string
+	* driver_nl80211: Updated to match the current Linux mac80211 AP mode
+	  configuration (wireless-testing.git and Linux kernel releases
+	  starting from 2.6.29)
+
+2008-08-10 - v0.6.4
+	* added peer identity into EAP-FAST PAC-Opaque and skip Phase 2
+	  Identity Request if identity is already known
+	* added support for EAP Sequences in EAP-FAST Phase 2
+	* added support for EAP-TNC (Trusted Network Connect)
+	  (this version implements the EAP-TNC method and EAP-TTLS/EAP-FAST
+	  changes needed to run two methods in sequence (IF-T) and the IF-IMV
+	  and IF-TNCCS interfaces from TNCS)
+	* added support for optional cryptobinding with PEAPv0
+	* added fragmentation support for EAP-TNC
+	* added support for fragmenting EAP-TTLS/PEAP/FAST Phase 2 (tunneled)
+	  data
+	* added support for opportunistic key caching (OKC)
+
+2008-02-22 - v0.6.3
+	* fixed Reassociation Response callback processing when using internal
+	  MLME (driver_{hostap,nl80211,test}.c)
+	* updated FT support to use the latest draft, IEEE 802.11r/D9.0
+	* copy optional Proxy-State attributes into RADIUS response when acting
+	  as a RADIUS authentication server
+	* fixed EAPOL state machine to handle a case in which no response is
+	  received from the RADIUS authentication server; previous version
+	  could have triggered a crash in some cases after a timeout
+	* fixed EAP-SIM/AKA realm processing to allow decorated usernames to
+	  be used
+	* added a workaround for EAP-SIM/AKA peers that include incorrect null
+	  termination in the username
+	* fixed EAP-SIM/AKA protected result indication to include AT_COUNTER
+	  attribute in notification messages only when using fast
+	  reauthentication
+	* fixed EAP-SIM Start response processing for fast reauthentication
+	  case
+	* added support for pending EAP processing in EAP-{PEAP,TTLS,FAST}
+	  phase 2 to allow EAP-SIM and EAP-AKA to be used as the Phase 2 method
+
+2008-01-01 - v0.6.2
+	* fixed EAP-SIM and EAP-AKA message parser to validate attribute
+	  lengths properly to avoid potential crash caused by invalid messages
+	* added data structure for storing allocated buffers (struct wpabuf);
+	  this does not affect hostapd usage, but many of the APIs changed
+	  and various interfaces (e.g., EAP) is not compatible with old
+	  versions
+	* added support for protecting EAP-AKA/Identity messages with
+	  AT_CHECKCODE (optional feature in RFC 4187)
+	* added support for protected result indication with AT_RESULT_IND for
+	  EAP-SIM and EAP-AKA (eap_sim_aka_result_ind=1)
+	* added support for configuring EAP-TTLS phase 2 non-EAP methods in
+	  EAP server configuration; previously all four were enabled for every
+	  phase 2 user, now all four are disabled by default and need to be
+	  enabled with new method names TTLS-PAP, TTLS-CHAP, TTLS-MSCHAP,
+	  TTLS-MSCHAPV2
+	* removed old debug printing mechanism and the related 'debug'
+	  parameter in the configuration file; debug verbosity is now set with
+	  -d (or -dd) command line arguments
+	* added support for EAP-IKEv2 (draft-tschofenig-eap-ikev2-15.txt);
+	  only shared key/password authentication is supported in this version
+
+2007-11-24 - v0.6.1
+	* added experimental, integrated TLSv1 server implementation with the
+	  needed X.509/ASN.1/RSA/bignum processing (this can be enabled by
+	  setting CONFIG_TLS=internal and CONFIG_INTERNAL_LIBTOMMATH=y in
+	  .config); this can be useful, e.g., if the target system does not
+	  have a suitable TLS library and a minimal code size is required
+	* added support for EAP-FAST server method to the integrated EAP
+	  server
+	* updated EAP Generalized Pre-Shared Key (EAP-GPSK) to use the latest
+	  draft (draft-ietf-emu-eap-gpsk-07.txt)
+	* added a new configuration parameter, rsn_pairwise, to allow different
+	  pairwise cipher suites to be enabled for WPA and RSN/WPA2
+	  (note: if wpa_pairwise differs from rsn_pairwise, the driver will
+	  either need to support this or will have to use the WPA/RSN IEs from
+	  hostapd; currently, the included madwifi and bsd driver interfaces do
+	  not have support for this)
+	* updated FT support to use the latest draft, IEEE 802.11r/D8.0
+
+2007-05-28 - v0.6.0
+	* added experimental IEEE 802.11r/D6.0 support
+	* updated EAP-SAKE to RFC 4763 and the IANA-allocated EAP type 48
+	* updated EAP-PSK to use the IANA-allocated EAP type 47
+	* fixed EAP-PSK bit ordering of the Flags field
+	* fixed configuration reloading (SIGHUP) to re-initialize WPA PSKs
+	  by reading wpa_psk_file [Bug 181]
+	* fixed EAP-TTLS AVP parser processing for too short AVP lengths
+	* fixed IPv6 connection to RADIUS accounting server
+	* updated EAP Generalized Pre-Shared Key (EAP-GPSK) to use the latest
+	  draft (draft-ietf-emu-eap-gpsk-04.txt)
+	* hlr_auc_gw: read GSM triplet file into memory and rotate through the
+	  entries instead of only using the same three triplets every time
+	  (this does not work properly with tests using multiple clients, but
+	  provides bit better triplet data for testing a single client; anyway,
+	  if a better quality triplets are needed, GSM-Milenage should be used
+	  instead of hardcoded triplet file)
+	* fixed EAP-MSCHAPv2 server to use a space between S and M parameters
+	  in Success Request [Bug 203]
+	* added support for sending EAP-AKA Notifications in error cases
+	* updated to use IEEE 802.11w/D2.0 for management frame protection
+	  (still experimental)
+	* RADIUS server: added support for processing duplicate messages
+	  (retransmissions from RADIUS client) by replying with the previous
+	  reply
+
+2006-11-24 - v0.5.6
+	* added support for configuring and controlling multiple BSSes per
+	  radio interface (bss= in hostapd.conf); this is only
+	  available with Devicescape and test driver interfaces
+	* fixed PMKSA cache update in the end of successful RSN
+	  pre-authentication
+	* added support for dynamic VLAN configuration (i.e., selecting VLAN-ID
+	  for each STA based on RADIUS Access-Accept attributes); this requires
+	  VLAN support from the kernel driver/802.11 stack and this is
+	  currently only available with Devicescape and test driver interfaces
+	* driver_madwifi: fixed configuration of unencrypted modes (plaintext
+	  and IEEE 802.1X without WEP)
+	* removed STAKey handshake since PeerKey handshake has replaced it in
+	  IEEE 802.11ma and there are no known deployments of STAKey
+	* updated EAP Generalized Pre-Shared Key (EAP-GPSK) to use the latest
+	  draft (draft-ietf-emu-eap-gpsk-01.txt)
+	* added preliminary implementation of IEEE 802.11w/D1.0 (management
+	  frame protection)
+	  (Note: this requires driver support to work properly.)
+	  (Note2: IEEE 802.11w is an unapproved draft and subject to change.)
+	* hlr_auc_gw: added support for GSM-Milenage (for EAP-SIM)
+	* hlr_auc_gw: added support for reading per-IMSI Milenage keys and
+	  parameters from a text file to make it possible to implement proper
+	  GSM/UMTS authentication server for multiple SIM/USIM cards using
+	  EAP-SIM/EAP-AKA
+	* fixed session timeout processing with drivers that do not use
+	  ieee802_11.c (e.g., madwifi)
+
+2006-08-27 - v0.5.5
+	* added 'hostapd_cli new_sta ' command for adding a new STA into
+	  hostapd (e.g., to initialize wired network authentication based on an
+	  external signal)
+	* fixed hostapd to add PMKID KDE into 4-Way Handshake Message 1 when
+	  using WPA2 even if PMKSA caching is not used
+	* added -P argument for hostapd to write the current process
+	  id into a file
+	* added support for RADIUS Authentication Server MIB (RFC 2619)
+
+2006-06-20 - v0.5.4
+	* fixed nt_password_hash build [Bug 144]
+	* added PeerKey handshake implementation for IEEE 802.11e
+	  direct link setup (DLS) to replace STAKey handshake
+	* added support for EAP Generalized Pre-Shared Key (EAP-GPSK,
+	  draft-clancy-emu-eap-shared-secret-00.txt)
+	* fixed a segmentation fault when RSN pre-authentication was completed
+	  successfully [Bug 152]
+
+2006-04-27 - v0.5.3
+	* do not build nt_password_hash and hlr_auc_gw by default to avoid
+	  requiring a TLS library for a successful build; these programs can be
+	  build with 'make nt_password_hash' and 'make hlr_auc_gw'
+	* added a new configuration option, eapol_version, that can be used to
+	  set EAPOL version to 1 (default is 2) to work around broken client
+	  implementations that drop EAPOL frames which use version number 2
+	  [Bug 89]
+	* added support for EAP-SAKE (no EAP method number allocated yet, so
+	  this is using the same experimental type 255 as EAP-PSK)
+	* fixed EAP-MSCHAPv2 message length validation
+
+2006-03-19 - v0.5.2
+	* fixed stdarg use in hostapd_logger(): if both stdout and syslog
+	  logging was enabled, hostapd could trigger a segmentation fault in
+	  vsyslog on some CPU -- C library combinations
+	* moved HLR/AuC gateway implementation for EAP-SIM/AKA into an external
+	  program to make it easier to use for implementing real SS7 gateway;
+	  eap_sim_db is not anymore used as a file name for GSM authentication
+	  triplets; instead, it is path to UNIX domain socket that will be used
+	  to communicate with the external gateway program (e.g., hlr_auc_gw)
+	* added example HLR/AuC gateway implementation, hlr_auc_gw, that uses
+	  local information (GSM authentication triplets from a text file and
+	  hardcoded AKA authentication data); this can be used to test EAP-SIM
+	  and EAP-AKA
+	* added Milenage algorithm (example 3GPP AKA algorithm) to hlr_auc_gw
+	  to make it possible to test EAP-AKA with real USIM cards (this is
+	  disabled by default; define AKA_USE_MILENAGE when building hlr_auc_gw
+	  to enable this)
+	* driver_madwifi: added support for getting station RSN IE from
+	  madwifi-ng svn r1453 and newer; this fixes RSN that was apparently
+	  broken with earlier change (r1357) in the driver
+	* changed EAP method registration to use a dynamic list of methods
+	  instead of a static list generated at build time
+	* fixed WPA message 3/4 not to encrypt Key Data field (WPA IE)
+	  [Bug 125]
+	* added ap_max_inactivity configuration parameter
+
+2006-01-29 - v0.5.1
+	* driver_test: added better support for multiple APs and STAs by using
+	  a directory with sockets that include MAC address for each device in
+	  the name (test_socket=DIR:/tmp/test)
+	* added support for EAP expanded type (vendor specific EAP methods)
+
+2005-12-18 - v0.5.0 (beginning of 0.5.x development releases)
+	* added experimental STAKey handshake implementation for IEEE 802.11e
+	  direct link setup (DLS); note: this is disabled by default in both
+	  build and runtime configuration (can be enabled with CONFIG_STAKEY=y
+	  and stakey=1)
+	* added support for EAP methods to use callbacks to external programs
+	  by buffering a pending request and processing it after the EAP method
+	  is ready to continue
+	* improved EAP-SIM database interface to allow external request to GSM
+	  HLR/AuC without blocking hostapd process
+	* added support for using EAP-SIM pseudonyms and fast re-authentication
+	* added support for EAP-AKA in the integrated EAP authenticator
+	* added support for matching EAP identity prefixes (e.g., "1"*) in EAP
+	  user database to allow EAP-SIM/AKA selection without extra roundtrip
+	  for EAP-Nak negotiation
+	* added support for storing EAP user password as NtPasswordHash instead
+	  of plaintext password when using MSCHAP or MSCHAPv2 for
+	  authentication (hash:<16-octet hex value>); added nt_password_hash
+	  tool for hashing password to generate NtPasswordHash
+
+2005-11-20 - v0.4.7 (beginning of 0.4.x stable releases)
+	* driver_wired: fixed EAPOL sending to optionally use PAE group address
+	  as the destination instead of supplicant MAC address; this is
+	  disabled by default, but should be enabled with use_pae_group_addr=1
+	  in configuration file if the wired interface is used by only one
+	  device at the time (common switch configuration)
+	* driver_madwifi: configure driver to use TKIP countermeasures in order
+	  to get correct behavior (IEEE 802.11 association failing; previously,
+	  association succeeded, but hostpad forced disassociation immediately)
+	* driver_madwifi: added support for madwifi-ng
+
+2005-10-27 - v0.4.6
+	* added support for replacing user identity from EAP with RADIUS
+	  User-Name attribute from Access-Accept message, if that is included,
+	  for the RADIUS accounting messages (e.g., for EAP-PEAP/TTLS to get
+	  tunneled identity into accounting messages when the RADIUS server
+	  does not support better way of doing this with Class attribute)
+	* driver_madwifi: fixed EAPOL packet receive for configuration where
+	  ath# is part of a bridge interface
+	* added a configuration file and log analyzer script for logwatch
+	* fixed EAPOL state machine step function to process all state
+	  transitions before processing new events; this resolves a race
+	  condition in which EAPOL-Start message could trigger hostapd to send
+	  two EAP-Response/Identity frames to the authentication server
+
+2005-09-25 - v0.4.5
+	* added client CA list to the TLS certificate request in order to make
+	  it easier for the client to select which certificate to use
+	* added experimental support for EAP-PSK
+	* added support for WE-19 (hostap, madwifi)
+
+2005-08-21 - v0.4.4
+	* fixed build without CONFIG_RSN_PREAUTH
+	* fixed FreeBSD build
+
+2005-06-26 - v0.4.3
+	* fixed PMKSA caching to copy User-Name and Class attributes so that
+	  RADIUS accounting gets correct information
+	* start RADIUS accounting only after successful completion of WPA
+	  4-Way Handshake if WPA-PSK is used
+	* fixed PMKSA caching for the case where STA (re)associates without
+	  first disassociating
+
+2005-06-12 - v0.4.2
+	* EAP-PAX is now registered as EAP type 46
+	* fixed EAP-PAX MAC calculation
+	* fixed EAP-PAX CK and ICK key derivation
+	* renamed eap_authenticator configuration variable to eap_server to
+	  better match with RFC 3748 (EAP) terminology
+	* driver_test: added support for testing hostapd with wpa_supplicant
+	  by using test driver interface without any kernel drivers or network
+	  cards
+
+2005-05-22 - v0.4.1
+	* fixed RADIUS server initialization when only auth or acct server
+	  is configured and the other one is left empty
+	* driver_madwifi: added support for RADIUS accounting
+	* driver_madwifi: added preliminary support for compiling against 'BSD'
+	  branch of madwifi CVS tree
+	* driver_madwifi: fixed pairwise key removal to allow WPA reauth
+	  without disassociation
+	* added support for reading additional certificates from PKCS#12 files
+	  and adding them to the certificate chain
+	* fixed RADIUS Class attribute processing to only use Access-Accept
+	  packets to update Class; previously, other RADIUS authentication
+	  packets could have cleared Class attribute
+	* added support for more than one Class attribute in RADIUS packets
+	* added support for verifying certificate revocation list (CRL) when
+	  using integrated EAP authenticator for EAP-TLS; new hostapd.conf
+	  options 'check_crl'; CRL must be included in the ca_cert file for now
+
+2005-04-25 - v0.4.0 (beginning of 0.4.x development releases)
+	* added support for including network information into
+	  EAP-Request/Identity message (ASCII-0 (nul) in eap_message)
+	  (e.g., to implement draft-adrange-eap-network-discovery-07.txt)
+	* fixed a bug which caused some RSN pre-authentication cases to use
+	  freed memory and potentially crash hostapd
+	* fixed private key loading for cases where passphrase is not set
+	* added support for sending TLS alerts and aborting authentication
+	  when receiving a TLS alert
+	* fixed WPA2 to add PMKSA cache entry when using integrated EAP
+	  authenticator
+	* fixed PMKSA caching (EAP authentication was not skipped correctly
+	  with the new state machine changes from IEEE 802.1X draft)
+	* added support for RADIUS over IPv6; own_ip_addr, auth_server_addr,
+	  and acct_server_addr can now be IPv6 addresses (CONFIG_IPV6=y needs
+	  to be added to .config to include IPv6 support); for RADIUS server,
+	  radius_server_ipv6=1 needs to be set in hostapd.conf and addresses
+	  in RADIUS clients file can then use IPv6 format
+	* added experimental support for EAP-PAX
+	* replaced hostapd control interface library (hostapd_ctrl.[ch]) with
+	  the same implementation that wpa_supplicant is using (wpa_ctrl.[ch])
+
+2005-02-12 - v0.3.7 (beginning of 0.3.x stable releases)
+
+2005-01-23 - v0.3.5
+	* added support for configuring a forced PEAP version based on the
+	  Phase 1 identity
+	* fixed PEAPv1 to use tunneled EAP-Success/Failure instead of EAP-TLV
+	  to terminate authentication
+	* fixed EAP identifier duplicate processing with the new IEEE 802.1X
+	  draft
+	* clear accounting data in the driver when starting a new accounting
+	  session
+	* driver_madwifi: filter wireless events based on ifindex to allow more
+	  than one network interface to be used
+	* fixed WPA message 2/4 processing not to cancel timeout for TimeoutEvt
+	  setting if the packet does not pass MIC verification (e.g., due to
+	  incorrect PSK); previously, message 1/4 was not tried again if an
+	  invalid message 2/4 was received
+	* fixed reconfiguration of RADIUS client retransmission timer when
+	  adding a new message to the pending list; previously, timer was not
+	  updated at this point and if there was a pending message with long
+	  time for the next retry, the new message needed to wait that long for
+	  its first retry, too
+
+2005-01-09 - v0.3.4
+	* added support for configuring multiple allowed EAP types for Phase 2
+	  authentication (EAP-PEAP, EAP-TTLS)
+	* fixed EAPOL-Start processing to trigger WPA reauthentication
+	  (previously, only EAPOL authentication was done)
+
+2005-01-02 - v0.3.3
+	* added support for EAP-PEAP in the integrated EAP authenticator
+	* added support for EAP-GTC in the integrated EAP authenticator
+	* added support for configuring list of EAP methods for Phase 1 so that
+	  the integrated EAP authenticator can, e.g., use the wildcard entry
+	  for EAP-TLS and EAP-PEAP
+	* added support for EAP-TTLS in the integrated EAP authenticator
+	* added support for EAP-SIM in the integrated EAP authenticator
+	* added support for using hostapd as a RADIUS authentication server
+	  with the integrated EAP authenticator taking care of EAP
+	  authentication (new hostapd.conf options: radius_server_clients and
+	  radius_server_auth_port); this is not included in default build; use
+	  CONFIG_RADIUS_SERVER=y in .config to include
+
+2004-12-19 - v0.3.2
+	* removed 'daemonize' configuration file option since it has not really
+	  been used at all for more than year
+	* driver_madwifi: fixed group key setup and added get_ssid method
+	* added support for EAP-MSCHAPv2 in the integrated EAP authenticator
+
+2004-12-12 - v0.3.1
+	* added support for integrated EAP-TLS authentication (new hostapd.conf
+	  variables: ca_cert, server_cert, private_key, private_key_passwd);
+	  this enabled dynamic keying (WPA2/WPA/IEEE 802.1X/WEP) without
+	  external RADIUS server
+	* added support for reading PKCS#12 (PFX) files (as a replacement for
+	  PEM/DER) to get certificate and private key (CONFIG_PKCS12)
+
+2004-12-05 - v0.3.0 (beginning of 0.3.x development releases)
+	* added support for Acct-{Input,Output}-Gigawords
+	* added support for Event-Timestamp (in RADIUS Accounting-Requests)
+	* added support for RADIUS Authentication Client MIB (RFC2618)
+	* added support for RADIUS Accounting Client MIB (RFC2620)
+	* made EAP re-authentication period configurable (eap_reauth_period)
+	* fixed EAPOL reauthentication to trigger WPA/WPA2 reauthentication
+	* fixed EAPOL state machine to stop if STA is removed during
+	  eapol_sm_step(); this fixes at least one segfault triggering bug with
+	  IEEE 802.11i pre-authentication
+	* added support for multiple WPA pre-shared keys (e.g., one for each
+	  client MAC address or keys shared by a group of clients);
+	  new hostapd.conf field wpa_psk_file for setting path to a text file
+	  containing PSKs, see hostapd.wpa_psk for an example
+	* added support for multiple driver interfaces to allow hostapd to be
+	  used with other drivers
+	* added wired authenticator driver interface (driver=wired in
+	  hostapd.conf, see wired.conf for example configuration)
+	* added madwifi driver interface (driver=madwifi in hostapd.conf, see
+	  madwifi.conf for example configuration; Note: include files from
+	  madwifi project is needed for building and a configuration file,
+	  .config, needs to be created in hostapd directory with
+	  CONFIG_DRIVER_MADWIFI=y to include this driver interface in hostapd
+	  build)
+	* fixed an alignment issue that could cause SHA-1 to fail on some
+	  platforms (e.g., Intel ixp425 with a compiler that does not 32-bit
+	  align variables)
+	* fixed RADIUS reconnection after an error in sending interim
+	  accounting packets
+	* added hostapd control interface for external programs and an example
+	  CLI, hostapd_cli (like wpa_cli for wpa_supplicant)
+	* started adding dot11, dot1x, radius MIBs ('hostapd_cli mib',
+	  'hostapd_cli sta ')
+	* finished update from IEEE 802.1X-2001 to IEEE 802.1X-REV (now d11)
+	* added support for strict GTK rekeying (wpa_strict_rekey in
+	  hostapd.conf)
+	* updated IAPP to use UDP port 3517 and multicast address 224.0.1.178
+	  (instead of broadcast) for IAPP ADD-notify (moved from draft 3 to
+	  IEEE 802.11F-2003)
+	* added Prism54 driver interface (driver=prism54 in hostapd.conf;
+	  note: .config needs to be created in hostapd directory with
+	  CONFIG_DRIVER_PRISM54=y to include this driver interface in hostapd
+	  build)
+	* dual-licensed hostapd (GPLv2 and BSD licenses)
+	* fixed RADIUS accounting to generate a new session id for cases where
+	  a station reassociates without first being complete deauthenticated
+	* fixed STA disassociation handler to mark next timeout state to
+	  deauthenticate the station, i.e., skip long wait for inactivity poll
+	  and extra disassociation, if the STA disassociates without
+	  deauthenticating
+	* added integrated EAP authenticator that can be used instead of
+	  external RADIUS authentication server; currently, only EAP-MD5 is
+	  supported, so this cannot yet be used for key distribution; the EAP
+	  method interface is generic, though, so adding new EAP methods should
+	  be straightforward; new hostapd.conf variables: 'eap_authenticator'
+	  and 'eap_user_file'; this obsoletes "minimal authentication server"
+	  ('minimal_eap' in hostapd.conf) which is now removed
+	* added support for FreeBSD and driver interface for the BSD net80211
+	  layer (driver=bsd in hostapd.conf and CONFIG_DRIVER_BSD=y in
+	  .config); please note that some of the required kernel mods have not
+	  yet been committed
+
+2004-07-17 - v0.2.4 (beginning of 0.2.x stable releases)
+	* fixed some accounting cases where Accounting-Start was sent when
+	  IEEE 802.1X port was being deauthorized
+
+2004-06-20 - v0.2.3
+	* modified RADIUS client to re-connect the socket in case of certain
+	  error codes that are generated when a network interface state is
+	  changes (e.g., when IP address changes or the interface is set UP)
+	* fixed couple of cases where EAPOL state for a station was freed
+	  twice causing a segfault for hostapd
+	* fixed couple of bugs in processing WPA deauthentication (freed data
+	  was used)
+
+2004-05-31 - v0.2.2
+	* fixed WPA/WPA2 group rekeying to use key index correctly (GN/GM)
+	* fixed group rekeying to send zero TSC in EAPOL-Key messages to fix
+	  cases where STAs dropped multicast frames as replay attacks
+	* added support for copying RADIUS Attribute 'Class' from
+	  authentication messages into accounting messages
+	* send canned EAP failure if RADIUS server sends Access-Reject without
+	  EAP message (previously, Supplicant was not notified in this case)
+	* fixed mixed WPA-PSK and WPA-EAP mode to work with WPA-PSK (i.e., do
+	  not start EAPOL state machines if the STA selected to use WPA-PSK)
+
+2004-05-06 - v0.2.1
+	* added WPA and IEEE 802.11i/RSN (WPA2) Authenticator functionality
+	  - based on IEEE 802.11i/D10.0 but modified to interoperate with WPA
+	    (i.e., IEEE 802.11i/D3.0)
+	  - supports WPA-only, RSN-only, and mixed WPA/RSN mode
+	  - both WPA-PSK and WPA-RADIUS/EAP are supported
+	  - PMKSA caching and pre-authentication
+	  - new hostapd.conf variables: wpa, wpa_psk, wpa_passphrase,
+	    wpa_key_mgmt, wpa_pairwise, wpa_group_rekey, wpa_gmk_rekey,
+	    rsn_preauth, rsn_preauth_interfaces
+	* fixed interim accounting to remove any pending accounting messages
+	  to the STA before sending a new one
+
+2004-02-15 - v0.2.0
+	* added support for Acct-Interim-Interval:
+	  - draft-ietf-radius-acct-interim-01.txt
+	  - use Acct-Interim-Interval attribute from Access-Accept if local
+	    'radius_acct_interim_interval' is not set
+	  - allow different update intervals for each STA
+	* fixed event loop to call signal handlers only after returning from
+	  the real signal handler
+	* reset sta->timeout_next after successful association to make sure
+	  that the previously registered inactivity timer will not remove the
+	  STA immediately (e.g., if STA deauthenticates and re-associates
+	  before the timer is triggered).
+	* added new hostapd.conf variable, nas_identifier, that can be used to
+	  add an optional RADIUS Attribute, NAS-Identifier, into authentication
+	  and accounting messages
+	* added support for Accounting-On and Accounting-Off messages
+	* fixed accounting session handling to send Accounting-Start only once
+	  per session and not to send Accounting-Stop if the session was not
+	  initialized properly
+	* fixed Accounting-Stop statistics in cases where the message was
+	  previously sent after the kernel entry for the STA (and/or IEEE
+	  802.1X data) was removed
+
+
+Note:
+
+Older changes up to and including v0.1.0 are included in the ChangeLog
+of the Host AP driver.

Copied: head/contrib/wpa/hostapd/Makefile (from r214505, vendor/wpa/dist/hostapd/Makefile)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/wpa/hostapd/Makefile	Wed Nov  3 10:43:38 2010	(r214734, copy of r214505, vendor/wpa/dist/hostapd/Makefile)
@@ -0,0 +1,791 @@
+ifndef CC
+CC=gcc
+endif
+
+ifndef CFLAGS
+CFLAGS = -MMD -O2 -Wall -g
+endif
+
+CFLAGS += -I../src
+CFLAGS += -I../src/utils
+
+# Uncomment following line and set the path to your kernel tree include
+# directory if your C library does not include all header files.
+# CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
+
+-include .config
+
+ifndef CONFIG_OS
+ifdef CONFIG_NATIVE_WINDOWS
+CONFIG_OS=win32
+else
+CONFIG_OS=unix
+endif
+endif
+
+ifeq ($(CONFIG_OS), internal)
+CFLAGS += -DOS_NO_C_LIB_DEFINES
+endif
+
+ifdef CONFIG_NATIVE_WINDOWS
+CFLAGS += -DCONFIG_NATIVE_WINDOWS
+LIBS += -lws2_32
+endif
+
+OBJS += main.o
+OBJS += config_file.o
+
+OBJS += ../src/ap/hostapd.o
+OBJS += ../src/ap/wpa_auth_glue.o
+OBJS += ../src/ap/drv_callbacks.o
+OBJS += ../src/ap/ap_drv_ops.o
+OBJS += ../src/ap/utils.o
+OBJS += ../src/ap/authsrv.o
+OBJS += ../src/ap/ieee802_1x.o
+OBJS += ../src/ap/ap_config.o
+OBJS += ../src/ap/ieee802_11_auth.o
+OBJS += ../src/ap/sta_info.o
+OBJS += ../src/ap/wpa_auth.o
+OBJS += ../src/ap/tkip_countermeasures.o
+OBJS += ../src/ap/ap_mlme.o
+OBJS += ../src/ap/wpa_auth_ie.o
+OBJS += ../src/ap/preauth_auth.o
+OBJS += ../src/ap/pmksa_cache_auth.o
+
+NEED_RC4=y
+NEED_AES=y
+NEED_MD5=y
+NEED_SHA1=y
+
+OBJS += ../src/drivers/drivers.o
+CFLAGS += -DHOSTAPD
+
+ifdef CONFIG_WPA_TRACE
+CFLAGS += -DWPA_TRACE
+OBJS += ../src/utils/trace.o
+LDFLAGS += -rdynamic
+CFLAGS += -funwind-tables
+ifdef CONFIG_WPA_TRACE_BFD
+CFLAGS += -DWPA_TRACE_BFD
+LIBS += -lbfd
+LIBS_c += -lbfd
+endif
+endif
+
+OBJS += ../src/utils/eloop.o
+OBJS += ../src/utils/common.o
+OBJS += ../src/utils/wpa_debug.o
+OBJS += ../src/utils/wpabuf.o
+OBJS += ../src/utils/os_$(CONFIG_OS).o
+OBJS += ../src/utils/ip_addr.o
+
+OBJS += ../src/common/ieee802_11_common.o
+OBJS += ../src/common/wpa_common.o
+
+OBJS += ../src/eapol_auth/eapol_auth_sm.o
+
+
+ifndef CONFIG_NO_DUMP_STATE
+# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
+# a file (undefine it, if you want to save in binary size)
+CFLAGS += -DHOSTAPD_DUMP_STATE
+OBJS += dump_state.o
+OBJS += ../src/eapol_auth/eapol_auth_dump.o
+endif
+
+ifdef CONFIG_NO_RADIUS
+CFLAGS += -DCONFIG_NO_RADIUS
+CONFIG_NO_ACCOUNTING=y
+else
+OBJS += ../src/radius/radius.o
+OBJS += ../src/radius/radius_client.o
+endif
+
+ifdef CONFIG_NO_ACCOUNTING
+CFLAGS += -DCONFIG_NO_ACCOUNTING
+else
+OBJS += ../src/ap/accounting.o
+endif
+
+ifdef CONFIG_NO_VLAN
+CFLAGS += -DCONFIG_NO_VLAN
+else
+OBJS += ../src/ap/vlan_init.o
+endif
+
+ifdef CONFIG_NO_CTRL_IFACE
+CFLAGS += -DCONFIG_NO_CTRL_IFACE
+else
+OBJS += ctrl_iface.o
+OBJS += ../src/ap/ctrl_iface_ap.o
+endif
+
+OBJS += ../src/crypto/md5.o
+
+CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
+
+ifdef CONFIG_IAPP
+CFLAGS += -DCONFIG_IAPP
+OBJS += ../src/ap/iapp.o
+endif
+
+ifdef CONFIG_RSN_PREAUTH
+CFLAGS += -DCONFIG_RSN_PREAUTH
+CONFIG_L2_PACKET=y
+endif
+
+ifdef CONFIG_PEERKEY
+CFLAGS += -DCONFIG_PEERKEY
+OBJS += ../src/ap/peerkey_auth.o
+endif
+
+ifdef CONFIG_IEEE80211W
+CFLAGS += -DCONFIG_IEEE80211W
+NEED_SHA256=y
+NEED_AES_OMAC1=y
+endif
+
+ifdef CONFIG_IEEE80211R
+CFLAGS += -DCONFIG_IEEE80211R
+OBJS += ../src/ap/wpa_auth_ft.o
+NEED_SHA256=y
+NEED_AES_OMAC1=y
+NEED_AES_UNWRAP=y
+endif
+
+ifdef CONFIG_IEEE80211N
+CFLAGS += -DCONFIG_IEEE80211N
+endif
+
+include ../src/drivers/drivers.mak
+OBJS += $(DRV_AP_OBJS)
+CFLAGS += $(DRV_AP_CFLAGS)
+LDFLAGS += $(DRV_AP_LDFLAGS)
+LIBS += $(DRV_AP_LIBS)
+
+ifdef CONFIG_L2_PACKET
+ifdef CONFIG_DNET_PCAP
+ifdef CONFIG_L2_FREEBSD
+LIBS += -lpcap
+OBJS += ../src/l2_packet/l2_packet_freebsd.o
+else
+LIBS += -ldnet -lpcap
+OBJS += ../src/l2_packet/l2_packet_pcap.o
+endif
+else
+OBJS += ../src/l2_packet/l2_packet_linux.o
+endif
+else
+OBJS += ../src/l2_packet/l2_packet_none.o
+endif
+
+
+ifdef CONFIG_EAP_MD5
+CFLAGS += -DEAP_SERVER_MD5
+OBJS += ../src/eap_server/eap_server_md5.o
+CHAP=y
+endif
+
+ifdef CONFIG_EAP_TLS
+CFLAGS += -DEAP_SERVER_TLS
+OBJS += ../src/eap_server/eap_server_tls.o
+TLS_FUNCS=y
+endif
+
+ifdef CONFIG_EAP_PEAP
+CFLAGS += -DEAP_SERVER_PEAP
+OBJS += ../src/eap_server/eap_server_peap.o
+OBJS += ../src/eap_common/eap_peap_common.o
+TLS_FUNCS=y
+CONFIG_EAP_MSCHAPV2=y
+endif
+
+ifdef CONFIG_EAP_TTLS
+CFLAGS += -DEAP_SERVER_TTLS
+OBJS += ../src/eap_server/eap_server_ttls.o
+TLS_FUNCS=y
+CHAP=y
+endif
+
+ifdef CONFIG_EAP_MSCHAPV2
+CFLAGS += -DEAP_SERVER_MSCHAPV2
+OBJS += ../src/eap_server/eap_server_mschapv2.o
+MS_FUNCS=y
+endif
+
+ifdef CONFIG_EAP_GTC
+CFLAGS += -DEAP_SERVER_GTC
+OBJS += ../src/eap_server/eap_server_gtc.o
+endif
+
+ifdef CONFIG_EAP_SIM
+CFLAGS += -DEAP_SERVER_SIM
+OBJS += ../src/eap_server/eap_server_sim.o
+CONFIG_EAP_SIM_COMMON=y
+NEED_AES_CBC=y
+endif
+
+ifdef CONFIG_EAP_AKA
+CFLAGS += -DEAP_SERVER_AKA
+OBJS += ../src/eap_server/eap_server_aka.o
+CONFIG_EAP_SIM_COMMON=y
+NEED_SHA256=y
+NEED_AES_CBC=y
+endif
+
+ifdef CONFIG_EAP_AKA_PRIME
+CFLAGS += -DEAP_SERVER_AKA_PRIME
+endif
+
+ifdef CONFIG_EAP_SIM_COMMON
+OBJS += ../src/eap_common/eap_sim_common.o
+# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
+# replaced with another file implementating the interface specified in
+# eap_sim_db.h.
+OBJS += ../src/eap_server/eap_sim_db.o
+NEED_FIPS186_2_PRF=y
+endif
+
+ifdef CONFIG_EAP_PAX
+CFLAGS += -DEAP_SERVER_PAX
+OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o
+endif
+
+ifdef CONFIG_EAP_PSK
+CFLAGS += -DEAP_SERVER_PSK
+OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o
+NEED_AES_OMAC1=y
+NEED_AES_ENCBLOCK=y
+NEED_AES_EAX=y
+endif
+
+ifdef CONFIG_EAP_SAKE
+CFLAGS += -DEAP_SERVER_SAKE
+OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o
+endif
+
+ifdef CONFIG_EAP_GPSK
+CFLAGS += -DEAP_SERVER_GPSK
+OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o
+ifdef CONFIG_EAP_GPSK_SHA256
+CFLAGS += -DEAP_SERVER_GPSK_SHA256
+endif
+NEED_SHA256=y
+NEED_AES_OMAC1=y
+endif
+
+ifdef CONFIG_EAP_VENDOR_TEST
+CFLAGS += -DEAP_SERVER_VENDOR_TEST
+OBJS += ../src/eap_server/eap_server_vendor_test.o
+endif
+
+ifdef CONFIG_EAP_FAST
+CFLAGS += -DEAP_SERVER_FAST
+OBJS += ../src/eap_server/eap_server_fast.o
+OBJS += ../src/eap_common/eap_fast_common.o
+TLS_FUNCS=y
+NEED_T_PRF=y
+NEED_AES_UNWRAP=y
+endif
+
+ifdef CONFIG_WPS
+CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
+OBJS += ../src/utils/uuid.o
+OBJS += ../src/ap/wps_hostapd.o
+OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
+OBJS += ../src/wps/wps.o
+OBJS += ../src/wps/wps_common.o
+OBJS += ../src/wps/wps_attr_parse.o
+OBJS += ../src/wps/wps_attr_build.o
+OBJS += ../src/wps/wps_attr_process.o
+OBJS += ../src/wps/wps_dev_attr.o
+OBJS += ../src/wps/wps_enrollee.o
+OBJS += ../src/wps/wps_registrar.o
+NEED_DH_GROUPS=y
+NEED_SHA256=y
+NEED_BASE64=y
+NEED_AES_CBC=y
+NEED_MODEXP=y
+CONFIG_EAP=y
+
+ifdef CONFIG_WPS_UFD
+CFLAGS += -DCONFIG_WPS_UFD
+OBJS += ../src/wps/wps_ufd.o
+NEED_WPS_OOB=y
+endif
+
+ifdef CONFIG_WPS_NFC
+CFLAGS += -DCONFIG_WPS_NFC
+OBJS += ../src/wps/ndef.o
+OBJS += ../src/wps/wps_nfc.o
+NEED_WPS_OOB=y
+ifdef CONFIG_WPS_NFC_PN531
+PN531_PATH ?= /usr/local/src/nfc
+CFLAGS += -DCONFIG_WPS_NFC_PN531
+CFLAGS += -I${PN531_PATH}/inc
+OBJS += ../src/wps/wps_nfc_pn531.o
+LIBS += ${PN531_PATH}/lib/wpsnfc.dll
+LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
+endif
+endif
+

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 10:44:25 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DEE8B1065695;
	Wed,  3 Nov 2010 10:44:25 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CBA678FC24;
	Wed,  3 Nov 2010 10:44:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3AiPE4018219;
	Wed, 3 Nov 2010 10:44:25 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3AiPwS018213;
	Wed, 3 Nov 2010 10:44:25 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201011031044.oA3AiPwS018213@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 3 Nov 2010 10:44:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214735 - in head/usr.sbin/wpa: hostapd wpa_passphrase
	wpa_supplicant
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 10:44:26 -0000

Author: rpaulo
Date: Wed Nov  3 10:44:25 2010
New Revision: 214735
URL: http://svn.freebsd.org/changeset/base/214735

Log:
  Adapt for wpa_supplicant / hostapd 0.7.3.

Modified:
  head/usr.sbin/wpa/hostapd/Makefile
  head/usr.sbin/wpa/hostapd/driver_freebsd.c
  head/usr.sbin/wpa/wpa_passphrase/Makefile
  head/usr.sbin/wpa/wpa_supplicant/Makefile
  head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c

Modified: head/usr.sbin/wpa/hostapd/Makefile
==============================================================================
--- head/usr.sbin/wpa/hostapd/Makefile	Wed Nov  3 10:43:38 2010	(r214734)
+++ head/usr.sbin/wpa/hostapd/Makefile	Wed Nov  3 10:44:25 2010	(r214735)
@@ -3,17 +3,31 @@
 .include "${.CURDIR}/../Makefile.inc"
 
 .PATH.c:${HOSTAPD_DISTDIR} \
+	${WPA_DISTDIR}/src/ap \
 	${WPA_DISTDIR}/src/eap_server \
+	${WPA_DISTDIR}/src/eap_common \
+	${WPA_DISTDIR}/src/eapol_auth \
+	${WPA_DISTDIR}/src/drivers \
 	${WPA_DISTDIR}/src/radius \
+	${WPA_DISTDIR}
 
 PROG=	hostapd
-SRCS=	accounting.c aes.c aes_wrap.c ap_list.c beacon.c common.c \
-	config.c ctrl_iface.c drivers.c eapol_sm.c eap.c eap_common.c \
-	eap_identity.c eap_methods.c eloop.c hostapd.c \
-	hw_features.c ieee802_11.c ieee802_11_common.c ieee802_11_auth.c \
-	ieee802_1x.c ip_addr.c md5.c mlme.c pmksa_cache.c radius.c \
-	radius_client.c rc4.c sha1.c sta_info.c vlan_init.c wme.c \
-	wpa.c wpa_auth_ie.c wpa_common.c wpa_debug.c wpabuf.c
+SRCS=	accounting.c aes-wrap.c ap_config.c \
+	ap_drv_ops.c ap_mlme.c authsrv.c \
+	chap.c common.c config_file.c ctrl_iface.c crypto_openssl.c \
+	ctrl_iface_ap.c drivers.c drv_callbacks.c dump_state.c \
+	eap_common.c eap_peap_common.c eap_register.c eap_server.c \
+	eap_server_gtc.c eap_server_identity.c eap_server_md5.c \
+	eap_server_methods.c eap_server_mschapv2.c eap_server_peap.c \
+	eap_server_tls.c eap_server_tls_common.c eap_server_ttls.c \
+	eapol_auth_dump.c eapol_auth_sm.c eloop.c hostapd.c ieee802_11_auth.c \
+	ieee802_11_common.c ieee802_11_ht.c ieee802_1x.c ip_addr.c \
+	md5.c main.c ms_funcs.c peerkey_auth.c pmksa_cache_auth.c \
+	preauth_auth.c radius.c radius_client.c sta_info.c \
+	sha1-pbkdf2.c sha1-tlsprf.c sha1-tprf.c sha1.c \
+	tkip_countermeasures.c utils.c \
+	vlan_init.c wpa_auth.c wpa_auth_glue.c wpa_auth_ie.c wpa_common.c \
+	wpa_debug.c wpabuf.c
 SRCS+=	l2_packet_freebsd.c driver_freebsd.c os_unix.c
 
 MAN=	hostapd.8 hostapd.conf.5
@@ -24,16 +38,16 @@ FILESDIR= ${SHAREDIR}/examples/hostapd
 FILES=	hostapd.conf hostapd.eap_user hostapd.wpa_psk
 .endif
 
-CFLAGS+= -I${HOSTAPD_DISTDIR}
+CFLAGS+= -I${HOSTAPD_DISTDIR} -I${WPA_DISTDIR}/src/drivers
 
-CFLAGS+= -DCONFIG_DRIVER_BSD
+CFLAGS+= -DCONFIG_DRIVER_BSD -DHOSTAPD
 CFLAGS+= -DCONFIG_DRIVER_RADIUS_ACL
 .if ${MK_INET6} != "no"
 CFLAGS+= -DCONFIG_IPV6
 .endif
-CFLAGS+= -g
-DPADD+=	${LIBPCAP}
-LDADD+=	-lpcap
+#CFLAGS+= -g
+DPADD+=	${LIBPCAP} ${LIBSSL}
+LDADD+=	-lpcap -lssl
 
 # User customizations for wpa_supplicant/hostapd build environment
 CFLAGS+=${HOSTAPD_CFLAGS}

Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c
==============================================================================
--- head/usr.sbin/wpa/hostapd/driver_freebsd.c	Wed Nov  3 10:43:38 2010	(r214734)
+++ head/usr.sbin/wpa/hostapd/driver_freebsd.c	Wed Nov  3 10:44:25 2010	(r214735)
@@ -14,12 +14,13 @@
  *
  * $FreeBSD$
  */
-#include 
-#include 
-#include 
-#include 
+#include "includes.h"
 #include 
-#include 
+
+#include "common.h"
+#include "driver.h"
+#include "eloop.h"
+#include "common/ieee802_11_defs.h"
 
 #include 
 #include 
@@ -32,34 +33,29 @@
 #undef WPA_OUI_TYPE
 #undef WME_OUI_TYPE
 
-#include "hostapd.h"
-#include "driver.h"
-#include "ieee802_1x.h"
-#include "ieee802_11_auth.h"
-#include "eloop.h"
-#include "sta_info.h"
 #include "l2_packet/l2_packet.h"
 
-#include "eapol_sm.h"
-#include "wpa.h"
-#include "radius/radius.h"
-#include "ieee802_11.h"
-#include "common.h"
-#include "hostap_common.h"
-
 struct bsd_driver_data {
-	struct hostapd_data *hapd;		/* back pointer */
+	struct hostapd_data *hapd;      /* back pointer */
 
-	char	iface[IFNAMSIZ + 1];
-	unsigned int ifindex;			/* interface index */
-	struct l2_packet_data *sock_xmit;	/* raw packet xmit socket */
-	int	ioctl_sock;			/* socket for ioctl() use */
-	int	wext_sock;			/* socket for wireless events */
+	int     ioctl_sock;                  /* open socket for 802.11 ioctls */
+	int     wext_sock;
+	struct l2_packet_data *sock_xmit;/* raw packet xmit socket */
+	int     route;                  /* routing socket for events */
+	char    iface[IFNAMSIZ+1];     /* interface name */
+	unsigned int ifindex;           /* interface index */
+	void    *ctx;
+	struct wpa_driver_capa capa;    /* driver capability */
+	int     is_ap;                  /* Access point mode */
+	int     prev_roaming;   /* roaming state to restore on deinit */
+	int     prev_privacy;   /* privacy state to restore on deinit */
+	int     prev_wpa;       /* wpa state to restore on deinit */
 };
 
 static const struct wpa_driver_ops bsd_driver_ops;
 
-static int bsd_sta_deauth(void *priv, const u8 *addr, int reason_code);
+static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr,
+    int reason_code);
 
 static int
 set80211var(struct bsd_driver_data *drv, int op, const void *arg, int arg_len)
@@ -171,44 +167,37 @@ bsd_commit(void *priv)
 }
 
 static int
-bsd_set_ieee8021x(const char *ifname, void *priv, int enabled)
+bsd_set_ieee8021x(void *priv, struct wpa_bss_params *params)
 {
-	struct bsd_driver_data *drv = priv;
-	struct hostapd_data *hapd = drv->hapd;
-	struct hostapd_bss_config *conf = hapd->conf;
-
-	wpa_printf(MSG_DEBUG, "%s: enabled=%d\n", __func__, enabled);
+	wpa_printf(MSG_DEBUG, "%s: enabled=%d\n", __func__, params->enabled);
 
-	if (!enabled) {
+	if (!params->enabled) {
 		/* XXX restore state */
 		return set80211param(priv, IEEE80211_IOC_AUTHMODE,
 			IEEE80211_AUTH_AUTO);
 	}
-	if (!conf->wpa && !conf->ieee802_1x) {
-		hostapd_logger(hapd, NULL, HOSTAPD_MODULE_DRIVER,
-			HOSTAPD_LEVEL_WARNING, "No 802.1X or WPA enabled!");
+	if (!params->wpa && !params->ieee802_1x) {
+		wpa_printf(MSG_ERROR, "%s: No 802.1X or WPA enabled",
+			   __func__);
 		return -1;
 	}
-	if (conf->wpa && set80211param(drv, IEEE80211_IOC_WPA, conf->wpa)) {
-		hostapd_logger(hapd, NULL, HOSTAPD_MODULE_DRIVER,
-			HOSTAPD_LEVEL_WARNING, "Error configuring WPA state!");
+	if (params->wpa && set80211param(priv,IEEE80211_IOC_WPA, params->wpa)) {
+		wpa_printf(MSG_ERROR, "%s: Failed to configure WPA state",
+			  __func__);
 		return -1;
 	}
 	if (set80211param(priv, IEEE80211_IOC_AUTHMODE,
-		(conf->wpa ?  IEEE80211_AUTH_WPA : IEEE80211_AUTH_8021X))) {
-		hostapd_logger(hapd, NULL, HOSTAPD_MODULE_DRIVER,
-			HOSTAPD_LEVEL_WARNING, "Error enabling WPA/802.1X!");
+		(params->wpa ?  IEEE80211_AUTH_WPA : IEEE80211_AUTH_8021X))) {
+		wpa_printf(MSG_ERROR, "%s: Failed to enable WPA/802.1X",
+			   __func__);
 		return -1;
 	}
 	return 0;
 }
 
 static int
-bsd_set_privacy(const char *ifname, void *priv, int enabled)
+bsd_set_privacy(void *priv, int enabled)
 {
-	struct bsd_driver_data *drv = priv;
-	struct hostapd_data *hapd = drv->hapd;
-
 	wpa_printf(MSG_DEBUG, "%s: enabled=%d\n", __func__, enabled);
 
 	return set80211param(priv, IEEE80211_IOC_PRIVACY, enabled);
@@ -238,9 +227,9 @@ bsd_sta_set_flags(void *priv, const u8 *
 	int flags_or, int flags_and)
 {
 	/* For now, only support setting Authorized flag */
-	if (flags_or & WLAN_STA_AUTHORIZED)
+	if (flags_or & WPA_STA_AUTHORIZED)
 		return bsd_set_sta_authorized(priv, addr, 1);
-	if (!(flags_and & WLAN_STA_AUTHORIZED))
+	if (!(flags_and & WPA_STA_AUTHORIZED))
 		return bsd_set_sta_authorized(priv, addr, 0);
 	return 0;
 }
@@ -267,53 +256,64 @@ bsd_del_key(void *priv, const unsigned c
 }
 
 static int
-bsd_set_key(const char *ifname, void *priv, const char *alg,
-	    const u8 *addr, int key_idx,
-	    const u8 *key, size_t key_len, int txkey)
+bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg,
+	    const unsigned char *addr, int key_idx, int set_tx, const u8 *seq,
+	    size_t seq_len, const u8 *key, size_t key_len)
 {
-	struct bsd_driver_data *drv = priv;
-	struct hostapd_data *hapd = drv->hapd;
 	struct ieee80211req_key wk;
-	u_int8_t cipher;
 
-	if (strcmp(alg, "none") == 0)
-		return bsd_del_key(priv, addr, key_idx);
+	wpa_printf(MSG_DEBUG, "%s: alg=%d addr=%p key_idx=%d set_tx=%d "
+		  "seq_len=%zu key_len=%zu", __func__, alg, addr, key_idx,
+		  set_tx, seq_len, key_len);
 
-	wpa_printf(MSG_DEBUG, "%s: alg=%s addr=%s key_idx=%d\n",
-		__func__, alg, ether_sprintf(addr), key_idx);
+	if (alg == WPA_ALG_NONE) {
+		return bsd_del_key(priv, addr, key_idx);
+	}
 
-	if (strcmp(alg, "WEP") == 0)
-		cipher = IEEE80211_CIPHER_WEP;
-	else if (strcmp(alg, "TKIP") == 0)
-		cipher = IEEE80211_CIPHER_TKIP;
-	else if (strcmp(alg, "CCMP") == 0)
-		cipher = IEEE80211_CIPHER_AES_CCM;
-	else {
-		printf("%s: unknown/unsupported algorithm %s\n",
-			__func__, alg);
+	os_memset(&wk, 0, sizeof(wk));
+	switch (alg) {
+	case WPA_ALG_WEP:
+		wk.ik_type = IEEE80211_CIPHER_WEP;
+		break;
+	case WPA_ALG_TKIP:
+		wk.ik_type = IEEE80211_CIPHER_TKIP;
+		break;
+	case WPA_ALG_CCMP:
+		wk.ik_type = IEEE80211_CIPHER_AES_CCM;
+		break;
+	default:
+		wpa_printf(MSG_ERROR, "%s: unknown alg=%d", __func__, alg);
 		return -1;
 	}
 
-	if (key_len > sizeof(wk.ik_keydata)) {
-		printf("%s: key length %d too big\n", __func__, key_len);
-		return -3;
-	}
+	wk.ik_flags = IEEE80211_KEY_RECV;
+	if (set_tx)
+		wk.ik_flags |= IEEE80211_KEY_XMIT;
 
-	memset(&wk, 0, sizeof(wk));
-	wk.ik_type = cipher;
 	if (addr == NULL) {
-		memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN);
+		os_memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN);
 		wk.ik_keyix = key_idx;
-		wk.ik_flags = IEEE80211_KEY_XMIT
-			    | IEEE80211_KEY_GROUP
-			    | IEEE80211_KEY_DEFAULT;
 	} else {
-		memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN);
-		wk.ik_keyix = IEEE80211_KEYIX_NONE;
-		wk.ik_flags = IEEE80211_KEY_RECV | IEEE80211_KEY_XMIT;
+		os_memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN);
+		/*
+		 * Deduce whether group/global or unicast key by checking
+		 * the address (yech).  Note also that we can only mark global
+		 * keys default; doing this for a unicast key is an error.
+		 */
+		if (os_memcmp(addr, "\xff\xff\xff\xff\xff\xff",
+			      IEEE80211_ADDR_LEN) == 0) {
+			wk.ik_flags |= IEEE80211_KEY_GROUP;
+			wk.ik_keyix = key_idx;
+		} else {
+			wk.ik_keyix = key_idx == 0 ? IEEE80211_KEYIX_NONE :
+				key_idx;
+		}
 	}
+	if (wk.ik_keyix != IEEE80211_KEYIX_NONE && set_tx)
+		wk.ik_flags |= IEEE80211_KEY_DEFAULT;
 	wk.ik_keylen = key_len;
-	memcpy(wk.ik_keydata, key, key_len);
+	os_memcpy(&wk.ik_keyrsc, seq, seq_len);
+	os_memcpy(wk.ik_keydata, key, key_len);
 
 	return set80211var(priv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk));
 }
@@ -355,7 +355,7 @@ bsd_flush(void *priv)
 	u8 allsta[IEEE80211_ADDR_LEN];
 
 	memset(allsta, 0xff, IEEE80211_ADDR_LEN);
-	return bsd_sta_deauth(priv, allsta, IEEE80211_REASON_AUTH_LEAVE);
+	return bsd_sta_deauth(priv, NULL, allsta, IEEE80211_REASON_AUTH_LEAVE);
 }
 
 
@@ -393,7 +393,7 @@ bsd_sta_clear_stats(void *priv, const u8
 }
 
 static int
-bsd_set_opt_ie(const char *ifname, void *priv, const u8 *ie, size_t ie_len)
+bsd_set_opt_ie(void *priv, const u8 *ie, size_t ie_len)
 {
 	struct bsd_driver_data *drv = priv;
 	struct hostapd_data *hapd = drv->hapd;
@@ -416,7 +416,7 @@ bsd_set_opt_ie(const char *ifname, void 
 }
 
 static int
-bsd_sta_deauth(void *priv, const u8 *addr, int reason_code)
+bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, int reason_code)
 {
 	struct bsd_driver_data *drv = priv;
 	struct hostapd_data *hapd = drv->hapd;
@@ -432,7 +432,7 @@ bsd_sta_deauth(void *priv, const u8 *add
 }
 
 static int
-bsd_sta_disassoc(void *priv, const u8 *addr, int reason_code)
+bsd_sta_disassoc(void *priv, const u8 *own_addr, const u8 *addr, int reason_code)
 {
 	struct bsd_driver_data *drv = priv;
 	struct hostapd_data *hapd = drv->hapd;
@@ -446,85 +446,32 @@ bsd_sta_disassoc(void *priv, const u8 *a
 	return set80211var(priv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme));
 }
 
-static int
-bsd_del_sta(struct bsd_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
-{
-	struct hostapd_data *hapd = drv->hapd;
-	struct hostapd_bss_config *conf = hapd->conf;
-	struct sta_info *sta;
-
-	hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
-		HOSTAPD_LEVEL_INFO, "deassociated");
-
-	sta = ap_get_sta(hapd, addr);
-	if (sta != NULL) {
-		sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC);
-		if (conf->wpa)
-			wpa_auth_sm_event(sta->wpa_sm, WPA_DISASSOC);
-		sta->acct_terminate_cause = RADIUS_ACCT_TERMINATE_CAUSE_USER_REQUEST;
-		ieee802_1x_notify_port_enabled(sta->eapol_sm, 0);
-		ap_free_sta(hapd, sta);
-	}
-	return 0;
-}
-
-static int
-bsd_new_sta(struct bsd_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
+static void
+bsd_new_sta(void *priv, void *ctx, u8 addr[IEEE80211_ADDR_LEN])
 {
-	struct hostapd_data *hapd = drv->hapd;
-	struct hostapd_bss_config *conf = hapd->conf;
-	struct sta_info *sta;
 	struct ieee80211req_wpaie ie;
-	int new_assoc, ielen, res;
-
-	hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
-		HOSTAPD_LEVEL_INFO, "associated");
+	int ielen = 0;
+	u8 *iebuf = NULL;
 
-	sta = ap_sta_add(hapd, addr);
-	if (sta == NULL)
-		return -1;
 	/*
 	 * Fetch and validate any negotiated WPA/RSN parameters.
 	 */
-	if (conf->wpa) {
-		memset(&ie, 0, sizeof(ie));
-		memcpy(ie.wpa_macaddr, addr, IEEE80211_ADDR_LEN);
-		if (get80211var(drv, IEEE80211_IOC_WPAIE, &ie, sizeof(ie)) < 0) {
-			printf("Failed to get WPA/RSN information element.\n");
-			return -1;		/* XXX not right */
-		}
-		if (ie.wpa_ie[1] == 0) {
-			printf("No WPA/RSN information element for station!\n");
-			return -1;		/* XXX not right */
-		}
-		if (sta->wpa_sm == NULL)
-			sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth,
-							sta->addr);
-		if (sta->wpa_sm == NULL) {
-			printf("Failed to initialize WPA state machine\n");
-			return -1;
-		}
-		ielen = 2 + ie.wpa_ie[1];
-		res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
-					  ie.wpa_ie, ielen, NULL, 0);
-		if (res != WPA_IE_OK) {
-			printf("WPA/RSN information element rejected? "
-				"(res %u)\n", res);
-			return -1;
-		}
-	}
+	memset(&ie, 0, sizeof(ie));
+	memcpy(ie.wpa_macaddr, addr, IEEE80211_ADDR_LEN);
+	if (get80211var(priv, IEEE80211_IOC_WPAIE, &ie, sizeof(ie)) < 0) {
+		printf("Failed to get WPA/RSN information element.\n");
+		goto no_ie;
+	}
+	iebuf = ie.wpa_ie;
+	ielen = ie.wpa_ie[1];
+	if (ielen == 0)
+		iebuf = NULL;
+	else
+		ielen += 2;
 
-	/*
-	 * Now that the internal station state is setup
-	 * kick the authenticator into action.
-	 */
-	new_assoc = (sta->flags & WLAN_STA_ASSOC) == 0;
-	sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC;
-	wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC);
-	hostapd_new_assoc_sta(hapd, sta, !new_assoc);
-	ieee802_1x_notify_port_enabled(sta->eapol_sm, 1);
+no_ie:
+        drv_event_assoc(ctx, addr, iebuf, ielen);
 
-	return 0;
 }
 
 #include 
@@ -545,6 +492,7 @@ bsd_wireless_event_receive(int sock, voi
 	struct ieee80211_auth_event *auth;
 #endif
 	int n;
+	union wpa_event_data data;
 
 	n = read(sock, buf, sizeof(buf));
 	if (n < 0) {
@@ -576,14 +524,14 @@ bsd_wireless_event_receive(int sock, voi
 			break;
 		case RTM_IEEE80211_LEAVE:
 			leave = (struct ieee80211_leave_event *) &ifan[1];
-			bsd_del_sta(drv, leave->iev_addr);
+			drv_event_disassoc(drv->hapd, leave->iev_addr);
 			break;
 		case RTM_IEEE80211_JOIN:
 #ifdef RTM_IEEE80211_REJOIN
 		case RTM_IEEE80211_REJOIN:
 #endif
 			join = (struct ieee80211_join_event *) &ifan[1];
-			bsd_new_sta(drv, join->iev_addr);
+			bsd_new_sta(drv, drv->hapd, join->iev_addr);
 			break;
 		case RTM_IEEE80211_REPLAY:
 			/* ignore */
@@ -594,9 +542,13 @@ bsd_wireless_event_receive(int sock, voi
 				"Michael MIC failure wireless event: "
 				"keyix=%u src_addr=" MACSTR, mic->iev_keyix,
 				MAC2STR(mic->iev_src));
-			ieee80211_michael_mic_failure(hapd, mic->iev_src, 1);
+			os_memset(&data, 0, sizeof(data));
+			data.michael_mic_failure.unicast = 1;
+			data.michael_mic_failure.src = mic->iev_src;
+			wpa_supplicant_event(drv->hapd,
+					     EVENT_MICHAEL_MIC_FAILURE, &data);
 			break;
-#ifdef CONFIG_DRIVER_RADIUS_ACL
+#ifdef CONFIG_DRIVER_RADIUS_ACL_NOT_YET
 		case RTM_IEEE80211_AUTH:
 			auth = (struct ieee80211_auth_event *) &ifan[1];
 			wpa_printf(MSG_DEBUG, "802.11 AUTH, STA = " MACSTR,
@@ -628,41 +580,9 @@ bsd_wireless_event_receive(int sock, voi
 }
 
 static int
-bsd_wireless_event_init(void *priv)
-{
-	struct bsd_driver_data *drv = priv;
-	int s;
-
-	drv->wext_sock = -1;
-
-	s = socket(PF_ROUTE, SOCK_RAW, 0);
-	if (s < 0) {
-		perror("socket(PF_ROUTE,SOCK_RAW)");
-		return -1;
-	}
-	eloop_register_read_sock(s, bsd_wireless_event_receive, drv, NULL);
-	drv->wext_sock = s;
-
-	return 0;
-}
-
-static void
-bsd_wireless_event_deinit(void *priv)
-{
-	struct bsd_driver_data *drv = priv;
-
-	if (drv != NULL) {
-		if (drv->wext_sock < 0)
-			return;
-		eloop_unregister_read_sock(drv->wext_sock);
-		close(drv->wext_sock);
-	}
-}
-
-
-static int
 bsd_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len,
 	       int encrypt, const u8 *own_addr)
+	      
 {
 	struct bsd_driver_data *drv = priv;
 	struct hostapd_data *hapd = drv->hapd;
@@ -706,25 +626,14 @@ static void
 handle_read(void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
 {
 	struct bsd_driver_data *drv = ctx;
-	struct hostapd_data *hapd = drv->hapd;
-	struct sta_info *sta;
-
-	sta = ap_get_sta(hapd, src_addr);
-	if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
-		printf("Data frame from not associated STA %s\n",
-		       ether_sprintf(src_addr));
-		/* XXX cannot happen */
-		return;
-	}
-	ieee802_1x_receive(hapd, src_addr, buf + sizeof(struct l2_ethhdr),
-			   len - sizeof(struct l2_ethhdr));
+	drv_event_eapol_rx(drv->hapd, src_addr, buf, len);
 }
 
 static int
-bsd_get_ssid(const char *ifname, void *priv, u8 *buf, int len)
+bsd_get_ssid(void *priv, u8 *buf, int len)
 {
 	struct bsd_driver_data *drv = priv;
-	struct hostapd_data *hapd = drv->hapd;
+
 	int ssid_len = get80211var(priv, IEEE80211_IOC_SSID, buf, len);
 
 	wpa_printf(MSG_DEBUG, "%s: ssid=\"%.*s\"\n", __func__, ssid_len, buf);
@@ -733,7 +642,7 @@ bsd_get_ssid(const char *ifname, void *p
 }
 
 static int
-bsd_set_ssid(const char *ifname, void *priv, const u8 *buf, int len)
+bsd_set_ssid(void *priv, const u8 *buf, int len)
 {
 	struct bsd_driver_data *drv = priv;
 	struct hostapd_data *hapd = drv->hapd;
@@ -752,7 +661,7 @@ bsd_set_countermeasures(void *priv, int 
 	return set80211param(drv, IEEE80211_IOC_COUNTERMEASURES, enabled);
 }
 
-#ifdef CONFIG_DRIVER_RADIUS_ACL
+#ifdef CONFIG_DRIVER_RADIUS_ACL_NOT_YET
 static int 
 bsd_set_radius_acl_auth(void *priv, const u8 *mac, int accepted, 
 	u32 session_timeout)
@@ -814,24 +723,23 @@ bsd_set_radius_acl_expire(void *priv, co
 #endif /* CONFIG_DRIVER_RADIUS_ACL */
 
 static void *
-bsd_init(struct hostapd_data *hapd)
+bsd_init(struct hostapd_data *hapd, struct wpa_init_params *params)
 {
 	struct bsd_driver_data *drv;
 
-	drv = malloc(sizeof(struct bsd_driver_data));
+	drv = os_zalloc(sizeof(struct bsd_driver_data));
 	if (drv == NULL) {
 		printf("Could not allocate memory for bsd driver data\n");
 		goto bad;
 	}
 
-	memset(drv, 0, sizeof(*drv));
 	drv->hapd = hapd;
 	drv->ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0);
 	if (drv->ioctl_sock < 0) {
 		perror("socket[PF_INET,SOCK_DGRAM]");
 		goto bad;
 	}
-	memcpy(drv->iface, hapd->conf->iface, sizeof(drv->iface));
+	memcpy(drv->iface, params->ifname, sizeof(drv->iface));
 	/*
 	 * NB: We require the interface name be mappable to an index.
 	 *     This implies we do not support having wpa_supplicant
@@ -849,10 +757,20 @@ bsd_init(struct hostapd_data *hapd)
 					handle_read, drv, 1);
 	if (drv->sock_xmit == NULL)
 		goto bad;
-	if (l2_packet_get_own_addr(drv->sock_xmit, hapd->own_addr))
+	if (l2_packet_get_own_addr(drv->sock_xmit, params->own_addr))
 		goto bad;
 
-	bsd_set_iface_flags(drv, -IFF_UP);	/* mark down during setup */
+	/* mark down during setup */
+	if (bsd_set_iface_flags(drv, -IFF_UP) < 0)
+		goto bad;
+
+	drv->route = socket(PF_ROUTE, SOCK_RAW, 0);
+	if (drv->route < 0) {
+		perror("socket(PF_ROUTE,SOCK_RAW)");
+		goto bad;
+	}
+	eloop_register_read_sock(drv->route, bsd_wireless_event_receive, drv,
+				 NULL);
 
 	return drv;
 bad:
@@ -872,6 +790,10 @@ bsd_deinit(void *priv)
 {
 	struct bsd_driver_data *drv = priv;
 
+	if (drv->route >= 0) {
+		eloop_unregister_read_sock(drv->route);
+		close(drv->route);
+	}
 	(void) bsd_set_iface_flags(drv, -IFF_UP);
 	if (drv->ioctl_sock >= 0)
 		close(drv->ioctl_sock);
@@ -882,27 +804,25 @@ bsd_deinit(void *priv)
 
 const struct wpa_driver_ops wpa_driver_bsd_ops = {
 	.name			= "bsd",
-	.init			= bsd_init,
-	.deinit			= bsd_deinit,
+	.hapd_init		= bsd_init,
+	.hapd_deinit		= bsd_deinit,
 	.set_ieee8021x		= bsd_set_ieee8021x,
 	.set_privacy		= bsd_set_privacy,
-	.set_encryption		= bsd_set_key,
+	.set_key		= bsd_set_key,
 	.get_seqnum		= bsd_get_seqnum,
 	.flush			= bsd_flush,
 	.set_generic_elem	= bsd_set_opt_ie,
-	.wireless_event_init	= bsd_wireless_event_init,
-	.wireless_event_deinit	= bsd_wireless_event_deinit,
 	.sta_set_flags		= bsd_sta_set_flags,
 	.read_sta_data		= bsd_read_sta_driver_data,
-	.send_eapol		= bsd_send_eapol,
+	.hapd_send_eapol	= bsd_send_eapol,
 	.sta_disassoc		= bsd_sta_disassoc,
 	.sta_deauth		= bsd_sta_deauth,
-	.set_ssid		= bsd_set_ssid,
-	.get_ssid		= bsd_get_ssid,
+	.hapd_set_ssid		= bsd_set_ssid,
+	.hapd_get_ssid		= bsd_get_ssid,
 	.set_countermeasures	= bsd_set_countermeasures,
 	.sta_clear_stats        = bsd_sta_clear_stats,
 	.commit			= bsd_commit,
-#ifdef CONFIG_DRIVER_RADIUS_ACL
+#ifdef CONFIG_DRIVER_RADIUS_ACL_NOT_YET
 	.set_radius_acl_auth	= bsd_set_radius_acl_auth,
 	.set_radius_acl_expire	= bsd_set_radius_acl_expire,
 #endif

Modified: head/usr.sbin/wpa/wpa_passphrase/Makefile
==============================================================================
--- head/usr.sbin/wpa/wpa_passphrase/Makefile	Wed Nov  3 10:43:38 2010	(r214734)
+++ head/usr.sbin/wpa/wpa_passphrase/Makefile	Wed Nov  3 10:44:25 2010	(r214735)
@@ -5,7 +5,8 @@
 .PATH.c:${WPA_SUPPLICANT_DISTDIR}
 
 PROG=	wpa_passphrase
-SRCS=	wpa_passphrase.c sha1.c md5.c
+SRCS=	wpa_passphrase.c sha1.c sha1-internal.c sha1-pbkdf2.c \
+	md5.c md5-internal.c
 
 CFLAGS+= -DINTERNAL_SHA1
 CFLAGS+= -DINTERNAL_MD5

Modified: head/usr.sbin/wpa/wpa_supplicant/Makefile
==============================================================================
--- head/usr.sbin/wpa/wpa_supplicant/Makefile	Wed Nov  3 10:43:38 2010	(r214734)
+++ head/usr.sbin/wpa/wpa_supplicant/Makefile	Wed Nov  3 10:44:25 2010	(r214735)
@@ -6,11 +6,15 @@
 	${WPA_DISTDIR}/src/drivers \
 	${WPA_DISTDIR}/src/eap_peer \
 	${WPA_DISTDIR}/src/rsn_supp
+	${WPA_DISTDIR}/src/crypto
 
 PROG=	wpa_supplicant
-SRCS=	aes.c aes_wrap.c blacklist.c common.c config.c ctrl_iface.c \
+SRCS=	aes-cbc.c aes-ctr.c aes-eax.c aes-encblock.c \
+	aes-internal.c aes-omac1.c aes-unwrap.c \
+	aes-wrap.c bss.c blacklist.c common.c config.c ctrl_iface.c \
 	ctrl_iface_unix.c drivers.c eloop.c events.c l2_packet_freebsd.c main.c\
-	md5.c preauth.c pmksa_cache.c rc4.c scan.c scan_helpers.c sha1.c \
+	md5.c notify.c preauth.c pmksa_cache.c scan.c \
+	sha1-pbkdf2.c sha1-tlsprf.c sha1-tprf.c sha1.c \
 	wpa.c wpa_common.c wpa_debug.c wpa_ie.c wpa_supplicant.c \
 	wpabuf.c wpas_glue.c \
 	driver_ndis.c Packet32.c \
@@ -34,7 +38,7 @@ CFLAGS+= -DCONFIG_DRIVER_NDIS
 CFLAGS+= -DCONFIG_DRIVER_WIRED
 CFLAGS+= -DCONFIG_TERMINATE_ONLASTIF
 CFLAGS+= -DCONFIG_DEBUG_SYSLOG
-CFLAGS+= -g
+#CFLAGS+= -g
 DPADD+=	${LIBPCAP}
 LDADD+=	-lpcap
 
@@ -49,7 +53,7 @@ LDADD+=${WPA_SUPPLICANT_LDADD}
 #LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS}
 
 .if ${MK_WPA_SUPPLICANT_EAPOL} != "no"
-SRCS+=	eapol_supp_sm.c eap.c eap_common.c eap_methods.c
+SRCS+=	eapol_supp_sm.c eap.c eap_common.c eap_methods.c eap_register.c
 CFLAGS+= -DIEEE8021X_EAPOL
 
 .if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)

Modified: head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
==============================================================================
--- head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c	Wed Nov  3 10:43:38 2010	(r214734)
+++ head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c	Wed Nov  3 10:44:25 2010	(r214735)
@@ -220,7 +220,7 @@ wpa_driver_bsd_set_ssid(void *priv, cons
 
 static int
 wpa_driver_bsd_set_wpa_ie(struct wpa_driver_bsd_data *drv,
-	const char *wpa_ie, size_t wpa_ie_len)
+	const u8 *wpa_ie, size_t wpa_ie_len)
 {
 	struct ieee80211req ireq;
 
@@ -259,14 +259,6 @@ wpa_driver_bsd_set_wpa_internal(void *pr
 }
 
 static int
-wpa_driver_bsd_set_wpa(void *priv, int enabled)
-{
-	wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled);
-
-	return wpa_driver_bsd_set_wpa_internal(priv, enabled ? 3 : 0, enabled);
-}
-
-static int
 wpa_driver_bsd_del_key(struct wpa_driver_bsd_data *drv, int key_idx,
 		       const unsigned char *addr)
 {
@@ -290,7 +282,7 @@ wpa_driver_bsd_del_key(struct wpa_driver
 }
 
 static int
-wpa_driver_bsd_set_key(void *priv, wpa_alg alg,
+wpa_driver_bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg,
 		       const unsigned char *addr, int key_idx, int set_tx,
 		       const u8 *seq, size_t seq_len,
 		       const u8 *key, size_t key_len)
@@ -393,6 +385,26 @@ wpa_driver_bsd_set_drop_unencrypted(void
 }
 
 static int
+wpa_driver_bsd_set_auth_alg(void *priv, int auth_alg)
+{
+	struct wpa_driver_bsd_data *drv = priv;
+	int authmode;
+
+	if ((auth_alg & WPA_AUTH_ALG_OPEN) &&
+	    (auth_alg & WPA_AUTH_ALG_SHARED))
+		authmode = IEEE80211_AUTH_AUTO;
+	else if (auth_alg & WPA_AUTH_ALG_SHARED)
+		authmode = IEEE80211_AUTH_SHARED;
+	else
+		authmode = IEEE80211_AUTH_OPEN;
+
+	wpa_printf(MSG_DEBUG, "%s alg 0x%x authmode %u",
+		__func__, auth_alg, authmode);
+
+	return set80211param(drv, IEEE80211_IOC_AUTHMODE, authmode);
+}
+
+static int
 wpa_driver_bsd_deauthenticate(void *priv, const u8 *addr, int reason_code)
 {
 	struct wpa_driver_bsd_data *drv = priv;
@@ -452,6 +464,11 @@ wpa_driver_bsd_associate(void *priv, str
 		return -1;
 	}
 
+        if (wpa_driver_bsd_set_drop_unencrypted(drv, params->drop_unencrypted)
+            < 0)
+                return -1;
+	if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0)
+		return -1;
 	/* XXX error handling is wrong but unclear what to do... */
 	if (wpa_driver_bsd_set_wpa_ie(drv, params->wpa_ie, params->wpa_ie_len) < 0)
 		return -1;
@@ -485,30 +502,11 @@ wpa_driver_bsd_associate(void *priv, str
 }
 
 static int
-wpa_driver_bsd_set_auth_alg(void *priv, int auth_alg)
-{
-	struct wpa_driver_bsd_data *drv = priv;
-	int authmode;
-
-	if ((auth_alg & AUTH_ALG_OPEN_SYSTEM) &&
-	    (auth_alg & AUTH_ALG_SHARED_KEY))
-		authmode = IEEE80211_AUTH_AUTO;
-	else if (auth_alg & AUTH_ALG_SHARED_KEY)
-		authmode = IEEE80211_AUTH_SHARED;
-	else
-		authmode = IEEE80211_AUTH_OPEN;
-
-	wpa_printf(MSG_DEBUG, "%s alg 0x%x authmode %u",
-		__func__, auth_alg, authmode);
-
-	return set80211param(drv, IEEE80211_IOC_AUTHMODE, authmode);
-}
-
-static int
-wpa_driver_bsd_scan(void *priv, const u8 *ssid, size_t ssid_len)
+wpa_driver_bsd_scan(void *priv, struct wpa_driver_scan_params *params)
 {
 	struct wpa_driver_bsd_data *drv = priv;
 	struct ieee80211_scan_req sr;
+	int i;
 	int flags;
 
 	/* XXX not true but easiest to perpetuate the myth */
@@ -529,30 +527,21 @@ wpa_driver_bsd_scan(void *priv, const u8
 		    | IEEE80211_IOC_SCAN_NOJOIN
 		    ;
 	sr.sr_duration = IEEE80211_IOC_SCAN_FOREVER;
-	if (ssid_len != 0) {
-		/* XXX ssid_len must be <= IEEE80211_NWID_LEN */
-		memcpy(sr.sr_ssid[sr.sr_nssid].ssid, ssid, ssid_len);
-		sr.sr_ssid[sr.sr_nssid].len = ssid_len;
-		sr.sr_nssid++;
-	}
-	if (drv->lastssid_len != 0 &&
-	    (drv->lastssid_len != ssid_len ||
-	     memcmp(drv->lastssid, ssid, ssid_len) != 0)) {
-		/*
-		 * If we are scanning because we received a deauth
-		 * and the scan cache is warm then we'll find the
-		 * ap there and short circuit a full-blown scan.
-		 */
-		memcpy(sr.sr_ssid[sr.sr_nssid].ssid, drv->lastssid,
-		    drv->lastssid_len);
-		sr.sr_ssid[sr.sr_nssid].len = drv->lastssid_len;
-		sr.sr_nssid++;
-		/* NB: clear so we don't retry w/o associating first */
-		drv->lastssid_len = 0;
-	}
-	if (sr.sr_nssid != 0)		/* NB: check scan cache first */
+	if (params->num_ssids > 0) {
+		sr.sr_nssid = params->num_ssids;
+#if 0
+		/* Boundary check is done by upper layer */
+		if (sr.sr_nssid > IEEE80211_IOC_SCAN_MAX_SSID)
+			sr.sr_nssid = IEEE80211_IOC_SCAN_MAX_SSID;
+#endif
+		/* NB: check scan cache first */
 		sr.sr_flags |= IEEE80211_IOC_SCAN_CHECK;
-
+}
+	for (i = 0; i < sr.sr_nssid; i++) {
+		sr.sr_ssid[i].len = params->ssids[i].ssid_len;
+		os_memcpy(sr.sr_ssid[i].ssid, params->ssids[i].ssid,
+			  sr.sr_ssid[i].len);
+	}
 	/* NB: net80211 delivers a scan complete event so no need to poll */
 	return set80211var(drv, IEEE80211_IOC_SCAN_REQ, &sr, sizeof(sr));
 }
@@ -654,40 +643,6 @@ wpa_driver_bsd_event_receive(int sock, v
 	}
 }
 
-/* Compare function for sorting scan results. Return >0 if @b is consider
- * better. */
-static int
-wpa_scan_result_compar(const void *a, const void *b)
-{
-	const struct wpa_scan_result *wa = a;
-	const struct wpa_scan_result *wb = b;
-
-	/* WPA/WPA2 support preferred */
-	if ((wb->wpa_ie_len || wb->rsn_ie_len) &&
-	    !(wa->wpa_ie_len || wa->rsn_ie_len))
-		return 1;
-	if (!(wb->wpa_ie_len || wb->rsn_ie_len) &&
-	    (wa->wpa_ie_len || wa->rsn_ie_len))
-		return -1;
-
-	/* privacy support preferred */
-	if ((wa->caps & IEEE80211_CAPINFO_PRIVACY) &&
-	    (wb->caps & IEEE80211_CAPINFO_PRIVACY) == 0)
-		return 1;
-	if ((wa->caps & IEEE80211_CAPINFO_PRIVACY) == 0 &&
-	    (wb->caps & IEEE80211_CAPINFO_PRIVACY))
-		return -1;
-
-	/* best/max rate preferred if signal level close enough XXX */
-	if (wa->maxrate != wb->maxrate && abs(wb->level - wa->level) < 5)
-		return wb->maxrate - wa->maxrate;
-
-	/* use freq for channel preference */
-
-	/* all things being equal, use signal level */
-	return wb->level - wa->level;
-}
-
 static int
 getmaxrate(const uint8_t rates[15], uint8_t nrates)
 {
@@ -715,74 +670,97 @@ iswpaoui(const u_int8_t *frm)
 	return frm[1] > 3 && LE_READ_4(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI);
 }
 
-static int
-wpa_driver_bsd_get_scan_results(void *priv,
-				     struct wpa_scan_result *results,
-				     size_t max_size)
-{
-#define	min(a,b)	((a)>(b)?(b):(a))
-	struct wpa_driver_bsd_data *drv = priv;
-	uint8_t buf[24*1024];
-	const uint8_t *cp, *vp;
-	const struct ieee80211req_scan_result *sr;
-	struct wpa_scan_result *wsr;
-	int len, ielen;
 
-	memset(results, 0, max_size * sizeof(struct wpa_scan_result));
+static void
+wpa_driver_bsd_add_scan_entry(struct wpa_scan_results *res,
+                              struct ieee80211req_scan_result *sr)
+{
+        struct wpa_scan_res *result, **tmp;
+        size_t extra_len;
+        u8 *pos;
+
+        extra_len = 2 + sr->isr_ssid_len;
+        extra_len += 2 + sr->isr_nrates;
+        extra_len += 3; /* ERP IE */
+        extra_len += sr->isr_ie_len;
+
+        result = os_zalloc(sizeof(*result) + extra_len);
+        if (result == NULL)
+                return;
+        os_memcpy(result->bssid, sr->isr_bssid, ETH_ALEN);
+        result->freq = sr->isr_freq;
+        result->beacon_int = sr->isr_intval;
+        result->caps = sr->isr_capinfo;
+        result->qual = sr->isr_rssi;
+        result->noise = sr->isr_noise;
+
+        pos = (u8 *)(result + 1);
+
+        *pos++ = WLAN_EID_SSID;
+        *pos++ = sr->isr_ssid_len;
+        os_memcpy(pos, sr + 1, sr->isr_ssid_len);
+        pos += sr->isr_ssid_len;
+
+        /*
+         * Deal all rates as supported rate.
+         * Because net80211 doesn't report extended supported rate or not.
+         */
+        *pos++ = WLAN_EID_SUPP_RATES;
+        *pos++ = sr->isr_nrates;
+        os_memcpy(pos, sr->isr_rates, sr->isr_nrates);
+       pos += sr->isr_nrates;
+
+        *pos++ = WLAN_EID_ERP_INFO;
+        *pos++ = 1;
+        *pos++ = sr->isr_erp;
+
+        os_memcpy(pos, (u8 *)(sr + 1) + sr->isr_ssid_len, sr->isr_ie_len);
+        pos += sr->isr_ie_len;
+
+        result->ie_len = pos - (u8 *)(result + 1);
+
+        tmp = os_realloc(res->res,
+                         (res->num + 1) * sizeof(struct wpa_scan_res *));
+        if (tmp == NULL) {
+                os_free(result);
+                return;
+        }
+        tmp[res->num++] = result;
+        res->res = tmp;
+}
+
+static struct wpa_scan_results *
+wpa_driver_bsd_get_scan_results2(void *priv)
+{
+	struct ieee80211req_scan_result *sr;
+	struct wpa_scan_results *res;
+	int len, rest;
+	uint8_t buf[24*1024], *pos;
 
-	len = get80211var(drv, IEEE80211_IOC_SCAN_RESULTS, buf, sizeof(buf));
+	len = get80211var(priv, IEEE80211_IOC_SCAN_RESULTS, buf, 24*1024);
 	if (len < 0)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 10:46:39 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB02810656A7;
	Wed,  3 Nov 2010 10:46:39 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7F6098FC27;
	Wed,  3 Nov 2010 10:46:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3Akdxf018316;
	Wed, 3 Nov 2010 10:46:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3AkdGV018315;
	Wed, 3 Nov 2010 10:46:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201011031046.oA3AkdGV018315@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 3 Nov 2010 10:46:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214736 - in head/contrib/wpa: src/drivers
	wpa_supplicant/xcode
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 10:46:39 -0000

Author: rpaulo
Date: Wed Nov  3 10:46:39 2010
New Revision: 214736
URL: http://svn.freebsd.org/changeset/base/214736

Log:
  Remove unused files.

Deleted:
  head/contrib/wpa/src/drivers/driver_atheros.c
  head/contrib/wpa/src/drivers/driver_none.c
  head/contrib/wpa/src/drivers/linux_ioctl.c
  head/contrib/wpa/src/drivers/linux_ioctl.h
  head/contrib/wpa/src/drivers/netlink.c
  head/contrib/wpa/src/drivers/netlink.h
  head/contrib/wpa/src/drivers/nl80211_copy.h
  head/contrib/wpa/src/drivers/wireless_copy.h
  head/contrib/wpa/wpa_supplicant/xcode/

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 13:43:00 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06BBD106564A;
	Wed,  3 Nov 2010 13:43:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EA42B8FC16;
	Wed,  3 Nov 2010 13:42:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3DgxbD022468;
	Wed, 3 Nov 2010 13:42:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3DgxeC022466;
	Wed, 3 Nov 2010 13:42:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201011031342.oA3DgxeC022466@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 3 Nov 2010 13:42:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214738 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 13:43:00 -0000

Author: jhb
Date: Wed Nov  3 13:42:59 2010
New Revision: 214738
URL: http://svn.freebsd.org/changeset/base/214738

Log:
  Delete machine/foo.h headers moved to x86/.  I forgot to commit this
  earlier.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Nov  3 12:12:29 2010	(r214737)
+++ head/ObsoleteFiles.inc	Wed Nov  3 13:42:59 2010	(r214738)
@@ -14,6 +14,11 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20101101: headers moved to machine/ to x86/
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
+OLD_FILES+=usr/include/machine/apicreg.h
+OLD_FILES+=usr/include/machine/mca.h
+.endif
 # 20101020: catch up with vm_page_sleep_if_busy rename
 OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz
 # 20101011: removed subblock.h from liblzma

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 15:15:48 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CEF83106564A;
	Wed,  3 Nov 2010 15:15:48 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BD3718FC08;
	Wed,  3 Nov 2010 15:15:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3FFmND024448;
	Wed, 3 Nov 2010 15:15:48 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3FFmiP024443;
	Wed, 3 Nov 2010 15:15:48 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201011031515.oA3FFmiP024443@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 3 Nov 2010 15:15:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214739 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 15:15:49 -0000

Author: nwhitehorn
Date: Wed Nov  3 15:15:48 2010
New Revision: 214739
URL: http://svn.freebsd.org/changeset/base/214739

Log:
  Clean up the user segment handling code a little more. Now that
  set_user_sr() itself caches the user segment VSID, there is no need for
  cpu_switch() to do it again. This change also unifies the 32 and 64-bit
  code paths for kernel faults on user pages and remaps the user SLB slot
  on 64-bit systems when taking a syscall to avoid some unnecessary segment
  exception traps.

Modified:
  head/sys/powerpc/aim/copyinout.c
  head/sys/powerpc/aim/swtch32.S
  head/sys/powerpc/aim/swtch64.S
  head/sys/powerpc/aim/trap.c

Modified: head/sys/powerpc/aim/copyinout.c
==============================================================================
--- head/sys/powerpc/aim/copyinout.c	Wed Nov  3 13:42:59 2010	(r214738)
+++ head/sys/powerpc/aim/copyinout.c	Wed Nov  3 15:15:48 2010	(r214739)
@@ -102,11 +102,12 @@ set_user_sr(pmap_t pm, const void *addr)
 	if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == slbv) 
 		return;
 
-	__asm __volatile ("isync; slbie %0; slbmte %1, %2; isync" ::
-	    "r"(USER_ADDR), "r"(slbv), "r"(USER_SLB_SLBE));
+	__asm __volatile("isync");
 	curthread->td_pcb->pcb_cpu.aim.usr_segm =
 	    (uintptr_t)addr >> ADDR_SR_SHFT;
 	curthread->td_pcb->pcb_cpu.aim.usr_vsid = slbv;
+	__asm __volatile ("slbie %0; slbmte %1, %2; isync" ::
+	    "r"(USER_ADDR), "r"(slbv), "r"(USER_SLB_SLBE));
 }
 #else
 static __inline void
@@ -124,6 +125,8 @@ set_user_sr(pmap_t pm, const void *addr)
 	vsid |= SR_N;
 
 	__asm __volatile("isync");
+	curthread->td_pcb->pcb_cpu.aim.usr_segm =
+	    (uintptr_t)addr >> ADDR_SR_SHFT;
 	curthread->td_pcb->pcb_cpu.aim.usr_vsid = vsid;
 	__asm __volatile("mtsr %0,%1; isync" :: "n"(USER_SR), "r"(vsid));
 }

Modified: head/sys/powerpc/aim/swtch32.S
==============================================================================
--- head/sys/powerpc/aim/swtch32.S	Wed Nov  3 13:42:59 2010	(r214738)
+++ head/sys/powerpc/aim/swtch32.S	Wed Nov  3 15:15:48 2010	(r214739)
@@ -88,8 +88,6 @@ ENTRY(cpu_switch)
 	stw	%r16,PCB_CR(%r6)
 	mflr	%r16			/* Save the link register */
 	stw	%r16,PCB_LR(%r6)
-	mfsr	%r16,USER_SR		/* Save USER_SR for copyin/out */
-	stw	%r16,PCB_AIM_USR_VSID(%r6)
 	stw	%r1,PCB_SP(%r6)		/* Save the stack pointer */
 	stw	%r2,PCB_TOC(%r6)	/* Save the TOC pointer */
 

Modified: head/sys/powerpc/aim/swtch64.S
==============================================================================
--- head/sys/powerpc/aim/swtch64.S	Wed Nov  3 13:42:59 2010	(r214738)
+++ head/sys/powerpc/aim/swtch64.S	Wed Nov  3 15:15:48 2010	(r214739)
@@ -110,11 +110,6 @@ ENTRY(cpu_switch)
 	std	%r1,PCB_SP(%r6)		/* Save the stack pointer */
 	std	%r2,PCB_TOC(%r6)	/* Save the TOC pointer */
 	
-	li	%r15,0			/* Save user segment for copyin/out */
-	li	%r16,USER_SLB_SLOT
-	slbmfev %r15, %r16
-	std	%r15,PCB_AIM_USR_VSID(%r6)
-
 	mr	%r14,%r3		/* Copy the old thread ptr... */
 	mr	%r15,%r4		/* and the new thread ptr in scratch */
 	mr	%r16,%r5		/* and the new lock */

Modified: head/sys/powerpc/aim/trap.c
==============================================================================
--- head/sys/powerpc/aim/trap.c	Wed Nov  3 13:42:59 2010	(r214738)
+++ head/sys/powerpc/aim/trap.c	Wed Nov  3 15:15:48 2010	(r214739)
@@ -455,6 +455,13 @@ syscall(struct trapframe *frame)
 	td = PCPU_GET(curthread);
 	td->td_frame = frame;
 
+	/*
+	 * Speculatively restore last user SLB segment, which we know is
+	 * invalid already, since we are likely to do copyin()/copyout().
+	 */
+	__asm __volatile ("slbmte %0, %1; isync" ::
+            "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE));
+
 	error = syscallenter(td, &sa);
 	syscallret(td, error, &sa);
 }
@@ -532,13 +539,7 @@ trap_pfault(struct trapframe *frame, int
 
 			map = &p->p_vmspace->vm_map;
 
-			#ifdef __powerpc64__
 			user_sr = td->td_pcb->pcb_cpu.aim.usr_segm;
-			#else
-			__asm ("mfsr %0, %1"
-			    : "=r"(user_sr)
-			    : "K"(USER_SR));
-			#endif
 			eva &= ADDR_PIDX | ADDR_POFF;
 			eva |= user_sr << ADDR_SR_SHFT;
 		} else {

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 15:38:53 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 327721065675;
	Wed,  3 Nov 2010 15:38:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 216E28FC0A;
	Wed,  3 Nov 2010 15:38:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3FcrEN025432;
	Wed, 3 Nov 2010 15:38:53 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3FcrvQ025429;
	Wed, 3 Nov 2010 15:38:53 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201011031538.oA3FcrvQ025429@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 3 Nov 2010 15:38:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214746 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 15:38:53 -0000

Author: jhb
Date: Wed Nov  3 15:38:52 2010
New Revision: 214746
URL: http://svn.freebsd.org/changeset/base/214746

Log:
  Remove 'softclock_ih' as it is no longer used.

Modified:
  head/sys/kern/kern_timeout.c
  head/sys/sys/interrupt.h

Modified: head/sys/kern/kern_timeout.c
==============================================================================
--- head/sys/kern/kern_timeout.c	Wed Nov  3 15:31:37 2010	(r214745)
+++ head/sys/kern/kern_timeout.c	Wed Nov  3 15:38:52 2010	(r214746)
@@ -214,8 +214,6 @@ kern_timeout_callwheel_init(void)
 /*
  * Start standard softclock thread.
  */
-void    *softclock_ih;
-
 static void
 start_softclock(void *dummy)
 {
@@ -226,9 +224,8 @@ start_softclock(void *dummy)
 
 	cc = CC_CPU(timeout_cpu);
 	if (swi_add(&clk_intr_event, "clock", softclock, cc, SWI_CLOCK,
-	    INTR_MPSAFE, &softclock_ih))
+	    INTR_MPSAFE, &cc->cc_cookie))
 		panic("died while creating standard software ithreads");
-	cc->cc_cookie = softclock_ih;
 #ifdef SMP
 	CPU_FOREACH(cpu) {
 		if (cpu == timeout_cpu)

Modified: head/sys/sys/interrupt.h
==============================================================================
--- head/sys/sys/interrupt.h	Wed Nov  3 15:31:37 2010	(r214745)
+++ head/sys/sys/interrupt.h	Wed Nov  3 15:38:52 2010	(r214746)
@@ -146,7 +146,6 @@ struct proc;
 
 extern struct	intr_event *tty_intr_event;
 extern struct	intr_event *clk_intr_event;
-extern void	*softclock_ih;
 extern void	*vm_ih;
 
 /* Counts and names for statistics (defined in MD code). */

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 16:19:35 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA3C5106564A;
	Wed,  3 Nov 2010 16:19:35 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B95848FC1C;
	Wed,  3 Nov 2010 16:19:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3GJZKO026525;
	Wed, 3 Nov 2010 16:19:35 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3GJZ2s026523;
	Wed, 3 Nov 2010 16:19:35 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201011031619.oA3GJZ2s026523@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 3 Nov 2010 16:19:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214748 - head/sys/geom
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 16:19:35 -0000

Author: jh
Date: Wed Nov  3 16:19:35 2010
New Revision: 214748
URL: http://svn.freebsd.org/changeset/base/214748

Log:
  Extend the g_eventlock mutex coverage in one_event() to include setting
  of the EV_DONE flag and use the mutex to protect against losing wakeups
  in g_waitfor_event().
  
  Reported by:	davidxu
  Tested by:	davidxu
  Discussed on:	freebsd-current

Modified:
  head/sys/geom/geom_event.c

Modified: head/sys/geom/geom_event.c
==============================================================================
--- head/sys/geom/geom_event.c	Wed Nov  3 15:54:50 2010	(r214747)
+++ head/sys/geom/geom_event.c	Wed Nov  3 16:19:35 2010	(r214748)
@@ -220,11 +220,12 @@ one_event(void)
 	mtx_lock(&g_eventlock);
 	TAILQ_REMOVE(&g_events, ep, events);
 	ep->flag &= ~EV_INPROGRESS;
-	mtx_unlock(&g_eventlock);
 	if (ep->flag & EV_WAKEUP) {
 		ep->flag |= EV_DONE;
+		mtx_unlock(&g_eventlock);
 		wakeup(ep);
 	} else {
+		mtx_unlock(&g_eventlock);
 		g_free(ep);
 	}
 	g_topology_unlock();
@@ -365,11 +366,14 @@ g_waitfor_event(g_event_t *func, void *a
 	va_end(ap);
 	if (error)
 		return (error);
-	do 
-		tsleep(ep, PRIBIO, "g_waitfor_event", hz);
-	while (!(ep->flag & EV_DONE));
+
+	mtx_lock(&g_eventlock);
+	while (!(ep->flag & EV_DONE))
+		msleep(ep, &g_eventlock, PRIBIO, "g_waitfor_event", hz);
 	if (ep->flag & EV_CANCELED)
 		error = EAGAIN;
+	mtx_unlock(&g_eventlock);
+
 	g_free(ep);
 	return (error);
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 16:21:47 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EDA86106566B;
	Wed,  3 Nov 2010 16:21:47 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DC1F18FC1C;
	Wed,  3 Nov 2010 16:21:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3GLl3u026615;
	Wed, 3 Nov 2010 16:21:47 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3GLlOk026612;
	Wed, 3 Nov 2010 16:21:47 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201011031621.oA3GLlOk026612@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 3 Nov 2010 16:21:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214749 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 16:21:48 -0000

Author: nwhitehorn
Date: Wed Nov  3 16:21:47 2010
New Revision: 214749
URL: http://svn.freebsd.org/changeset/base/214749

Log:
  Fix two mistakes on 32-bit systems. The slbmte code in syscall() is 64-bit
  only, and should be protected with an ifdef, and the no-execute bit in
  32-bit set_user_sr() should be set before the comparison, not after, or
  it will never match.

Modified:
  head/sys/powerpc/aim/copyinout.c
  head/sys/powerpc/aim/trap.c

Modified: head/sys/powerpc/aim/copyinout.c
==============================================================================
--- head/sys/powerpc/aim/copyinout.c	Wed Nov  3 16:19:35 2010	(r214748)
+++ head/sys/powerpc/aim/copyinout.c	Wed Nov  3 16:21:47 2010	(r214749)
@@ -117,13 +117,13 @@ set_user_sr(pmap_t pm, const void *addr)
 
 	vsid = va_to_vsid(pm, (vm_offset_t)addr);
 
+	/* Mark segment no-execute */
+	vsid |= SR_N;
+
 	/* If we have already set this VSID, we can just return */
 	if (curthread->td_pcb->pcb_cpu.aim.usr_vsid == vsid)
 		return;
 
-	/* Mark segment no-execute */
-	vsid |= SR_N;
-
 	__asm __volatile("isync");
 	curthread->td_pcb->pcb_cpu.aim.usr_segm =
 	    (uintptr_t)addr >> ADDR_SR_SHFT;

Modified: head/sys/powerpc/aim/trap.c
==============================================================================
--- head/sys/powerpc/aim/trap.c	Wed Nov  3 16:19:35 2010	(r214748)
+++ head/sys/powerpc/aim/trap.c	Wed Nov  3 16:21:47 2010	(r214749)
@@ -455,12 +455,14 @@ syscall(struct trapframe *frame)
 	td = PCPU_GET(curthread);
 	td->td_frame = frame;
 
+#ifdef __powerpc64__
 	/*
 	 * Speculatively restore last user SLB segment, which we know is
 	 * invalid already, since we are likely to do copyin()/copyout().
 	 */
 	__asm __volatile ("slbmte %0, %1; isync" ::
             "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE));
+#endif
 
 	error = syscallenter(td, &sa);
 	syscallret(td, error, &sa);

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 18:49:51 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 206C8106564A;
	Wed,  3 Nov 2010 18:49:51 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0EEDE8FC0A;
	Wed,  3 Nov 2010 18:49:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3InodZ030025;
	Wed, 3 Nov 2010 18:49:50 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3InofI030022;
	Wed, 3 Nov 2010 18:49:50 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201011031849.oA3InofI030022@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 3 Nov 2010 18:49:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214752 - head/share/man/man9
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 18:49:51 -0000

Author: trasz
Date: Wed Nov  3 18:49:50 2010
New Revision: 214752
URL: http://svn.freebsd.org/changeset/base/214752

Log:
  Xref BUS_SETUP_INTR(9) and locking(9).

Modified:
  head/share/man/man9/BUS_SETUP_INTR.9
  head/share/man/man9/locking.9

Modified: head/share/man/man9/BUS_SETUP_INTR.9
==============================================================================
--- head/share/man/man9/BUS_SETUP_INTR.9	Wed Nov  3 16:46:05 2010	(r214751)
+++ head/share/man/man9/BUS_SETUP_INTR.9	Wed Nov  3 18:49:50 2010	(r214752)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 18, 2007
+.Dd November 3, 2010
 .Dt BUS_SETUP_INTR 9
 .Os
 .Sh NAME
@@ -205,8 +205,7 @@ otherwise an appropriate error is return
 .Xr random 4 ,
 .Xr device 9 ,
 .Xr driver 9 ,
-.Xr mtx_init 9 ,
-.Xr wakeup 9
+.Xr locking 9
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by

Modified: head/share/man/man9/locking.9
==============================================================================
--- head/share/man/man9/locking.9	Wed Nov  3 16:46:05 2010	(r214751)
+++ head/share/man/man9/locking.9	Wed Nov  3 18:49:50 2010	(r214752)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 24, 2010
+.Dd November 3, 2010
 .Dt LOCKING 9
 .Os
 .Sh NAME
@@ -356,6 +356,7 @@ At this time this is a rather easy to re
 .Xr sema 9 ,
 .Xr sleep 9 ,
 .Xr sx 9 ,
+.Xr BUS_SETUP_INTR 9 ,
 .Xr LOCK_PROFILING 9
 .Sh HISTORY
 These

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 21:10:12 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8343A1065670;
	Wed,  3 Nov 2010 21:10:12 +0000 (UTC)
	(envelope-from n_hibma@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7288D8FC26;
	Wed,  3 Nov 2010 21:10:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3LAC4H033325;
	Wed, 3 Nov 2010 21:10:12 GMT (envelope-from n_hibma@svn.freebsd.org)
Received: (from n_hibma@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3LACTT033323;
	Wed, 3 Nov 2010 21:10:12 GMT (envelope-from n_hibma@svn.freebsd.org)
Message-Id: <201011032110.oA3LACTT033323@svn.freebsd.org>
From: Nick Hibma 
Date: Wed, 3 Nov 2010 21:10:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214754 - head/sys/netinet/libalias
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 21:10:12 -0000

Author: n_hibma
Date: Wed Nov  3 21:10:12 2010
New Revision: 214754
URL: http://svn.freebsd.org/changeset/base/214754

Log:
  Don't spam the console with loaded modules during boot and/or during
  startup of ppp.
  
  Note: This cannot be hidden behind bootverbose as this file is included
  from lib/libalias as well.

Modified:
  head/sys/netinet/libalias/alias.c

Modified: head/sys/netinet/libalias/alias.c
==============================================================================
--- head/sys/netinet/libalias/alias.c	Wed Nov  3 20:50:41 2010	(r214753)
+++ head/sys/netinet/libalias/alias.c	Wed Nov  3 21:10:12 2010	(r214754)
@@ -1665,7 +1665,6 @@ LibAliasRefreshModules(void)
 			if (buf[i] == '#')
 				continue;
 			buf[len - 1] = '\0';
-			printf("Loading %s\n", buf);
 			LibAliasLoadModule(buf);
 		}
 	}

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 21:50:50 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08E1F1065670;
	Wed,  3 Nov 2010 21:50:50 +0000 (UTC)
	(envelope-from n_hibma@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EAB8B8FC0A;
	Wed,  3 Nov 2010 21:50:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3Longg034778;
	Wed, 3 Nov 2010 21:50:49 GMT (envelope-from n_hibma@svn.freebsd.org)
Received: (from n_hibma@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3LonRB034757;
	Wed, 3 Nov 2010 21:50:49 GMT (envelope-from n_hibma@svn.freebsd.org)
Message-Id: <201011032150.oA3LonRB034757@svn.freebsd.org>
From: Nick Hibma 
Date: Wed, 3 Nov 2010 21:50:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214761 - in head/sys/dev/usb: net serial
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 21:50:50 -0000

Author: n_hibma
Date: Wed Nov  3 21:50:49 2010
New Revision: 214761
URL: http://svn.freebsd.org/changeset/base/214761

Log:
  - Simplify the way unit/subunit allocation is done in ucom.
  - hw.usb.ucom.cons_unit is now split into
    hw.usb.ucom.cons_unit/...cons_subunit.
  
  Note: The tunable/sysctl hw.usb.ucom.cons_unit needs to be reviewed if
  
  a) a console was defined a USB serial devices, and a USB device with
  more than 1 subunit is present, and this device is attached before the
  device functioning as a console
  
  or
  
  b) a console was defined on a USB device with more than 1 subunit
  
  Reviewed by:	hps
  MFC after:	2 weeks

Modified:
  head/sys/dev/usb/net/uhso.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/serial/uark.c
  head/sys/dev/usb/serial/ubsa.c
  head/sys/dev/usb/serial/ubser.c
  head/sys/dev/usb/serial/uchcom.c
  head/sys/dev/usb/serial/ucycom.c
  head/sys/dev/usb/serial/ufoma.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/ugensa.c
  head/sys/dev/usb/serial/uipaq.c
  head/sys/dev/usb/serial/umct.c
  head/sys/dev/usb/serial/umodem.c
  head/sys/dev/usb/serial/umoscom.c
  head/sys/dev/usb/serial/uplcom.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h
  head/sys/dev/usb/serial/uslcom.c
  head/sys/dev/usb/serial/uvisor.c
  head/sys/dev/usb/serial/uvscom.c

Modified: head/sys/dev/usb/net/uhso.c
==============================================================================
--- head/sys/dev/usb/net/uhso.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/net/uhso.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -633,11 +633,10 @@ uhso_attach(device_t self)
 
 		ht->ht_name[0] = 0;
 		if (sc->sc_ttys == 1)
-			snprintf(ht->ht_name, 32, "cuaU%d", ucom->sc_unit);
+			snprintf(ht->ht_name, 32, "cuaU%d", ucom->sc_super->sc_unit);
 		else {
 			snprintf(ht->ht_name, 32, "cuaU%d.%d",
-			    ucom->sc_unit - ucom->sc_local_unit,
-			    ucom->sc_local_unit);
+			    ucom->sc_super->sc_unit, ucom->sc_subunit);
 		}
 
 		desc = uhso_port_type[port];
@@ -666,7 +665,7 @@ uhso_detach(device_t self)
 	usbd_transfer_unsetup(sc->sc_xfer, 3);
 	usbd_transfer_unsetup(sc->sc_ctrl_xfer, UHSO_CTRL_MAX);
 	if (sc->sc_ttys > 0) {
-		ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_ttys);
+		ucom_detach(&sc->sc_super_ucom, sc->sc_ucom);
 
 		for (i = 0; i < sc->sc_ttys; i++) {
 			if (sc->sc_tty[i].ht_muxport != -1) {
@@ -1448,11 +1447,11 @@ uhso_ucom_start_read(struct ucom_softc *
 {
 	struct uhso_softc *sc = ucom->sc_parent;
 
-	UHSO_DPRINTF(3, "unit=%d, local_unit=%d\n",
-	    ucom->sc_unit, ucom->sc_local_unit);
+	UHSO_DPRINTF(3, "unit=%d, subunit=%d\n",
+	    ucom->sc_super->sc_unit, ucom->sc_subunit);
 
 	if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) {
-		sc->sc_tty[ucom->sc_local_unit].ht_open = 1;
+		sc->sc_tty[ucom->sc_subunit].ht_open = 1;
 		usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]);
 	}
 	else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) {
@@ -1470,9 +1469,9 @@ uhso_ucom_stop_read(struct ucom_softc *u
 	struct uhso_softc *sc = ucom->sc_parent;
 
 	if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) {
-		sc->sc_tty[ucom->sc_local_unit].ht_open = 0;
+		sc->sc_tty[ucom->sc_subunit].ht_open = 0;
 		usbd_transfer_stop(
-		    sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_READ]);
+		    sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_READ]);
 	}
 	else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) {
 		sc->sc_tty[0].ht_open = 0;
@@ -1488,15 +1487,15 @@ uhso_ucom_start_write(struct ucom_softc 
 	struct uhso_softc *sc = ucom->sc_parent;
 
 	if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) {
-		UHSO_DPRINTF(3, "local unit %d\n", ucom->sc_local_unit);
+		UHSO_DPRINTF(3, "local unit %d\n", ucom->sc_subunit);
 
 		usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]);
 
 		usbd_xfer_set_priv(
-		    sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE],
-		    &sc->sc_tty[ucom->sc_local_unit]);
+		    sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE],
+		    &sc->sc_tty[ucom->sc_subunit]);
 		usbd_transfer_start(
-		    sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE]);
+		    sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE]);
 
 	}
 	else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) {
@@ -1511,7 +1510,7 @@ uhso_ucom_stop_write(struct ucom_softc *
 
 	if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) {
 		usbd_transfer_stop(
-		    sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE]);
+		    sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE]);
 	}
 	else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) {
 		usbd_transfer_stop(sc->sc_xfer[UHSO_BULK_ENDPT_WRITE]);

Modified: head/sys/dev/usb/serial/u3g.c
==============================================================================
--- head/sys/dev/usb/serial/u3g.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/u3g.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -831,15 +831,15 @@ static int
 u3g_detach(device_t dev)
 {
 	struct u3g_softc *sc = device_get_softc(dev);
-	uint8_t m;
+	uint8_t subunit;
 
 	DPRINTF("sc=%p\n", sc);
 
 	/* NOTE: It is not dangerous to detach more ports than attached! */
-	ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, U3G_MAXPORTS);
+	ucom_detach(&sc->sc_super_ucom, sc->sc_ucom);
 
-	for (m = 0; m != U3G_MAXPORTS; m++)
-		usbd_transfer_unsetup(sc->sc_xfer[m], U3G_N_TRANSFER);
+	for (subunit = 0; subunit != U3G_MAXPORTS; subunit++)
+		usbd_transfer_unsetup(sc->sc_xfer[subunit], U3G_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 
 	return (0);
@@ -851,7 +851,7 @@ u3g_start_read(struct ucom_softc *ucom)
 	struct u3g_softc *sc = ucom->sc_parent;
 
 	/* start read endpoint */
-	usbd_transfer_start(sc->sc_xfer[ucom->sc_local_unit][U3G_BULK_RD]);
+	usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]);
 	return;
 }
 
@@ -861,7 +861,7 @@ u3g_stop_read(struct ucom_softc *ucom)
 	struct u3g_softc *sc = ucom->sc_parent;
 
 	/* stop read endpoint */
-	usbd_transfer_stop(sc->sc_xfer[ucom->sc_local_unit][U3G_BULK_RD]);
+	usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]);
 	return;
 }
 
@@ -870,7 +870,7 @@ u3g_start_write(struct ucom_softc *ucom)
 {
 	struct u3g_softc *sc = ucom->sc_parent;
 
-	usbd_transfer_start(sc->sc_xfer[ucom->sc_local_unit][U3G_BULK_WR]);
+	usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_WR]);
 	return;
 }
 
@@ -879,7 +879,7 @@ u3g_stop_write(struct ucom_softc *ucom)
 {
 	struct u3g_softc *sc = ucom->sc_parent;
 
-	usbd_transfer_stop(sc->sc_xfer[ucom->sc_local_unit][U3G_BULK_WR]);
+	usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_WR]);
 	return;
 }
 

Modified: head/sys/dev/usb/serial/uark.c
==============================================================================
--- head/sys/dev/usb/serial/uark.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/uark.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -239,7 +239,7 @@ uark_detach(device_t dev)
 {
 	struct uark_softc *sc = device_get_softc(dev);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UARK_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/ubsa.c
==============================================================================
--- head/sys/dev/usb/serial/ubsa.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/ubsa.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -345,7 +345,7 @@ ubsa_detach(device_t dev)
 
 	DPRINTF("sc=%p\n", sc);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UBSA_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/ubser.c
==============================================================================
--- head/sys/dev/usb/serial/ubser.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/ubser.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -317,7 +317,7 @@ ubser_detach(device_t dev)
 
 	DPRINTF("\n");
 
-	ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_numser);
+	ucom_detach(&sc->sc_super_ucom, sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UBSER_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/uchcom.c
==============================================================================
--- head/sys/dev/usb/serial/uchcom.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/uchcom.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -368,7 +368,7 @@ uchcom_detach(device_t dev)
 
 	DPRINTFN(11, "\n");
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UCHCOM_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/ucycom.c
==============================================================================
--- head/sys/dev/usb/serial/ucycom.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/ucycom.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -294,7 +294,7 @@ ucycom_detach(device_t dev)
 {
 	struct ucycom_softc *sc = device_get_softc(dev);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UCYCOM_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/ufoma.c
==============================================================================
--- head/sys/dev/usb/serial/ufoma.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/ufoma.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -466,7 +466,7 @@ ufoma_attach(device_t dev)
 			CTLFLAG_RW|CTLTYPE_STRING, sc, 0, ufoma_sysctl_open,
 			"A", "Mode to transit when port is opened");
 	SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "comunit",
-			CTLFLAG_RD, &(sc->sc_ucom.sc_unit), 0, 
+			CTLFLAG_RD, &(sc->sc_super_ucom.sc_unit), 0, 
 			"Unit number as USB serial");
 
 	return (0);			/* success */
@@ -481,7 +481,7 @@ ufoma_detach(device_t dev)
 {
 	struct ufoma_softc *sc = device_get_softc(dev);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_ctrl_xfer, UFOMA_CTRL_ENDPT_MAX);
 	usbd_transfer_unsetup(sc->sc_bulk_xfer, UFOMA_BULK_ENDPT_MAX);
 

Modified: head/sys/dev/usb/serial/uftdi.c
==============================================================================
--- head/sys/dev/usb/serial/uftdi.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/uftdi.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -344,7 +344,7 @@ uftdi_detach(device_t dev)
 {
 	struct uftdi_softc *sc = device_get_softc(dev);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UFTDI_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/ugensa.c
==============================================================================
--- head/sys/dev/usb/serial/ugensa.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/ugensa.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -260,7 +260,7 @@ ugensa_detach(device_t dev)
 	struct ugensa_softc *sc = device_get_softc(dev);
 	uint8_t x;
 
-	ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_niface);
+	ucom_detach(&sc->sc_super_ucom, sc->sc_ucom);
 
 	for (x = 0; x < sc->sc_niface; x++) {
 		usbd_transfer_unsetup(sc->sc_sub[x].sc_xfer, UGENSA_N_TRANSFER);

Modified: head/sys/dev/usb/serial/uipaq.c
==============================================================================
--- head/sys/dev/usb/serial/uipaq.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/uipaq.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -1173,7 +1173,7 @@ uipaq_detach(device_t dev)
 {
 	struct uipaq_softc *sc = device_get_softc(dev);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UIPAQ_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/umct.c
==============================================================================
--- head/sys/dev/usb/serial/umct.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/umct.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -309,7 +309,7 @@ umct_detach(device_t dev)
 {
 	struct umct_softc *sc = device_get_softc(dev);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UMCT_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/umodem.c
==============================================================================
--- head/sys/dev/usb/serial/umodem.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/umodem.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -816,7 +816,7 @@ umodem_detach(device_t dev)
 
 	DPRINTF("sc=%p\n", sc);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UMODEM_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/umoscom.c
==============================================================================
--- head/sys/dev/usb/serial/umoscom.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/umoscom.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -351,7 +351,7 @@ umoscom_detach(device_t dev)
 {
 	struct umoscom_softc *sc = device_get_softc(dev);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UMOSCOM_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/uplcom.c
==============================================================================
--- head/sys/dev/usb/serial/uplcom.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/uplcom.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -459,7 +459,7 @@ uplcom_detach(device_t dev)
 
 	DPRINTF("sc=%p\n", sc);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UPLCOM_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/usb_serial.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -123,13 +123,16 @@ static unsigned int ucom_cons_tx_low = 0
 static unsigned int ucom_cons_tx_high = 0;
 
 static int ucom_cons_unit = -1;
+static int ucom_cons_subunit = 0;
 static int ucom_cons_baud = 9600;
 static struct ucom_softc *ucom_cons_softc = NULL;
 
 TUNABLE_INT("hw.usb.ucom.cons_unit", &ucom_cons_unit);
 SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW,
     &ucom_cons_unit, 0, "console unit number");
-
+TUNABLE_INT("hw.usb.ucom.cons_subunit", &ucom_cons_subunit);
+SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW,
+    &ucom_cons_subunit, 0, "console subunit number");
 TUNABLE_INT("hw.usb.ucom.cons_baud", &ucom_cons_baud);
 SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW,
     &ucom_cons_baud, 0, "console baud rate");
@@ -141,9 +144,9 @@ static usb_proc_callback_t ucom_cfg_line
 static usb_proc_callback_t ucom_cfg_status_change;
 static usb_proc_callback_t ucom_cfg_param;
 
-static uint8_t	ucom_units_alloc(uint32_t, uint32_t *);
-static void	ucom_units_free(uint32_t, uint32_t);
-static int	ucom_attach_tty(struct ucom_softc *, uint32_t);
+static int	ucom_unit_alloc(void);
+static void	ucom_unit_free(int);
+static int	ucom_attach_tty(struct ucom_super_softc *, struct ucom_softc *);
 static void	ucom_detach_tty(struct ucom_softc *);
 static void	ucom_queue_command(struct ucom_softc *,
 		    usb_proc_callback_t *, struct termios *pt,
@@ -176,84 +179,52 @@ static struct ttydevsw ucom_class = {
 MODULE_DEPEND(ucom, usb, 1, 1, 1);
 MODULE_VERSION(ucom, 1);
 
-#define	UCOM_UNIT_MAX 0x200		/* exclusive */
-#define	UCOM_SUB_UNIT_MAX 0x100		/* exclusive */
+#define	UCOM_UNIT_MAX 		128	/* limits size of ucom_bitmap */
 
 static uint8_t ucom_bitmap[(UCOM_UNIT_MAX + 7) / 8];
 static struct mtx ucom_bitmap_mtx;
 MTX_SYSINIT(ucom_bitmap_mtx, &ucom_bitmap_mtx, "ucom bitmap", MTX_DEF);
 
-static uint8_t
-ucom_units_alloc(uint32_t sub_units, uint32_t *p_root_unit)
+/*
+ * Mark a unit number (the X in cuaUX) as in use.
+ *
+ * Note that devices using a different naming scheme (see ucom_tty_name()
+ * callback) still use this unit allocation.
+ */
+static int
+ucom_unit_alloc(void)
 {
-	uint32_t n;
-	uint32_t o;
-	uint32_t x;
-	uint32_t max = UCOM_UNIT_MAX - (UCOM_UNIT_MAX % sub_units);
-	uint8_t error = 1;
+	int unit;
 
 	mtx_lock(&ucom_bitmap_mtx);
 
-	for (n = 0; n < max; n += sub_units) {
-
-		/* check for free consecutive bits */
-
-		for (o = 0; o < sub_units; o++) {
-
-			x = n + o;
-
-			if (ucom_bitmap[x / 8] & (1 << (x % 8))) {
-				goto skip;
-			}
-		}
-
-		/* allocate */
-
-		for (o = 0; o < sub_units; o++) {
-
-			x = n + o;
-
-			ucom_bitmap[x / 8] |= (1 << (x % 8));
-		}
-
-		error = 0;
-
-		break;
-
-skip:		;
-	}
+	for (unit = 0; unit < UCOM_UNIT_MAX; unit++)
+		if ((ucom_bitmap[unit / 8] & (1 << (unit % 8))) == 0)
+			break;
 
 	mtx_unlock(&ucom_bitmap_mtx);
 
-	/*
-	 * Always set the variable pointed to by "p_root_unit" so that
-	 * the compiler does not think that it is used uninitialised:
-	 */
-	*p_root_unit = n;
-
-	return (error);
+	if (unit == UCOM_UNIT_MAX)
+		return -1;
+	else
+		return unit;
 }
 
+/*
+ * Mark the unit number as not in use.
+ */
 static void
-ucom_units_free(uint32_t root_unit, uint32_t sub_units)
+ucom_unit_free(int unit)
 {
-	uint32_t x;
-
 	mtx_lock(&ucom_bitmap_mtx);
 
-	while (sub_units--) {
-		x = root_unit + sub_units;
-		ucom_bitmap[x / 8] &= ~(1 << (x % 8));
-	}
+	ucom_bitmap[unit / 8] &= ~(1 << (unit % 8));
 
 	mtx_unlock(&ucom_bitmap_mtx);
 }
 
 /*
- * "N" sub_units are setup at a time. All sub-units will
- * be given sequential unit numbers. The number of
- * sub-units can be used to differentiate among
- * different types of devices.
+ * Setup a group of one or more serial ports.
  *
  * The mutex pointed to by "mtx" is applied before all
  * callbacks are called back. Also "mtx" must be applied
@@ -261,47 +232,47 @@ ucom_units_free(uint32_t root_unit, uint
  */
 int
 ucom_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
-    uint32_t sub_units, void *parent,
+    uint32_t subunits, void *parent,
     const struct ucom_callback *callback, struct mtx *mtx)
 {
-	uint32_t n;
-	uint32_t root_unit;
+	uint32_t subunit;
 	int error = 0;
 
 	if ((sc == NULL) ||
-	    (sub_units == 0) ||
-	    (sub_units > UCOM_SUB_UNIT_MAX) ||
+	    (subunits == 0) ||
 	    (callback == NULL)) {
 		return (EINVAL);
 	}
 
-	/* XXX unit management does not really belong here */
-	if (ucom_units_alloc(sub_units, &root_unit)) {
+	ssc->sc_unit = ucom_unit_alloc();
+	if (ssc->sc_unit == -1)
 		return (ENOMEM);
-	}
 
 	error = usb_proc_create(&ssc->sc_tq, mtx, "ucom", USB_PRI_MED);
 	if (error) {
-		ucom_units_free(root_unit, sub_units);
+		ucom_unit_free(ssc->sc_unit);
 		return (error);
 	}
+	ssc->sc_subunits = subunits;
 
-	for (n = 0; n != sub_units; n++, sc++) {
-		sc->sc_unit = root_unit + n;
-		sc->sc_local_unit = n;
-		sc->sc_super = ssc;
-		sc->sc_mtx = mtx;
-		sc->sc_parent = parent;
-		sc->sc_callback = callback;
+	for (subunit = 0; subunit != ssc->sc_subunits; subunit++) {
+		sc[subunit].sc_subunit = subunit;
+		sc[subunit].sc_super = ssc;
+		sc[subunit].sc_mtx = mtx;
+		sc[subunit].sc_parent = parent;
+		sc[subunit].sc_callback = callback;
 
-		error = ucom_attach_tty(sc, sub_units);
+		error = ucom_attach_tty(ssc, &sc[subunit]);
 		if (error) {
-			ucom_detach(ssc, sc - n, n);
-			ucom_units_free(root_unit + n, sub_units - n);
+			ucom_detach(ssc, &sc[0]);
 			return (error);
 		}
-		sc->sc_flag |= UCOM_FLAG_ATTACHED;
+		sc[subunit].sc_flag |= UCOM_FLAG_ATTACHED;
 	}
+
+	DPRINTF("tp = %p, unit = %d, subunits = %d, device name subunit 0 = %s\n",
+		sc->sc_tty, ssc->sc_unit, ssc->sc_subunits, sc[0].sc_devname);
+
 	return (0);
 }
 
@@ -310,62 +281,50 @@ ucom_attach(struct ucom_super_softc *ssc
  * the structure pointed to by "ssc" and "sc" is zero.
  */
 void
-ucom_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
-    uint32_t sub_units)
+ucom_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc)
 {
-	uint32_t n;
+	uint32_t subunit;
 
 	usb_proc_drain(&ssc->sc_tq);
 
-	for (n = 0; n != sub_units; n++, sc++) {
-		if (sc->sc_flag & UCOM_FLAG_ATTACHED) {
-
-			ucom_detach_tty(sc);
+	for (subunit = 0; subunit <= ssc->sc_subunits; subunit++) {
+		if (sc[subunit].sc_flag & UCOM_FLAG_ATTACHED) {
 
-			ucom_units_free(sc->sc_unit, 1);
+			ucom_detach_tty(&sc[subunit]);
 
-			/* avoid duplicate detach: */
-			sc->sc_flag &= ~UCOM_FLAG_ATTACHED;
+			/* avoid duplicate detach */
+			sc[subunit].sc_flag &= ~UCOM_FLAG_ATTACHED;
 		}
 	}
+	ucom_unit_free(ssc->sc_unit);
 	usb_proc_free(&ssc->sc_tq);
 }
 
 static int
-ucom_attach_tty(struct ucom_softc *sc, uint32_t sub_units)
+ucom_attach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc)
 {
 	struct tty *tp;
-	int error = 0;
-	char buf[32];			/* temporary TTY device name buffer */
+	char buf[10];			/* temporary TTY device name buffer */
 
 	tp = tty_alloc_mutex(&ucom_class, sc, sc->sc_mtx);
-	if (tp == NULL) {
-		error = ENOMEM;
-		goto done;
-	}
-	DPRINTF("tp = %p, unit = %d\n", tp, sc->sc_unit);
-
-	buf[0] = 0;			/* set some default value */
+	if (tp == NULL)
+		return (ENOMEM);
 
 	/* Check if the client has a custom TTY name */
+	buf[0] = '\0';
 	if (sc->sc_callback->ucom_tty_name) {
 		sc->sc_callback->ucom_tty_name(sc, buf,
-		    sizeof(buf), sc->sc_local_unit);
+		    sizeof(buf), ssc->sc_unit, sc->sc_subunit);
 	}
 	if (buf[0] == 0) {
 		/* Use default TTY name */
-		if (sub_units > 1) {
+		if (ssc->sc_subunits > 1) {
 			/* multiple modems in one */
-			if (snprintf(buf, sizeof(buf), "U%u.%u",
-			    sc->sc_unit - sc->sc_local_unit,
-			    sc->sc_local_unit)) {
-				/* ignore */
-			}
+			snprintf(buf, sizeof(buf), "U%u.%u",
+			    ssc->sc_unit, sc->sc_subunit);
 		} else {
 			/* single modem */
-			if (snprintf(buf, sizeof(buf), "U%u", sc->sc_unit)) {
-				/* ignore */
-			}
+			snprintf(buf, sizeof(buf), "U%u", ssc->sc_unit);
 		}
 	}
 	tty_makedev(tp, NULL, "%s", buf);
@@ -377,10 +336,12 @@ ucom_attach_tty(struct ucom_softc *sc, u
 
 	/* Check if this device should be a console */
 	if ((ucom_cons_softc == NULL) && 
-	    (sc->sc_unit == ucom_cons_unit)) {
-
+	    (ssc->sc_unit == ucom_cons_unit) &&
+	    (sc->sc_subunit == ucom_cons_subunit)) {
 		struct termios t;
 
+		DPRINTF("unit %d subunit %d is console", ssc->sc_unit, sc->sc_subunit);
+
 		ucom_cons_softc = sc;
 
 		memset(&t, 0, sizeof(t));
@@ -398,8 +359,8 @@ ucom_attach_tty(struct ucom_softc *sc, u
 		ucom_param(ucom_cons_softc->sc_tty, &t);
 		mtx_unlock(ucom_cons_softc->sc_mtx);
 	}
-done:
-	return (error);
+
+	return (0);
 }
 
 static void
@@ -412,6 +373,7 @@ ucom_detach_tty(struct ucom_softc *sc)
 	if (sc->sc_flag & UCOM_FLAG_CONSOLE) {
 		mtx_lock(ucom_cons_softc->sc_mtx);
 		ucom_close(ucom_cons_softc->sc_tty);
+		sc->sc_flag &= ~UCOM_FLAG_CONSOLE;
 		mtx_unlock(ucom_cons_softc->sc_mtx);
 		ucom_cons_softc = NULL;
 	}

Modified: head/sys/dev/usb/serial/usb_serial.h
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.h	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/usb_serial.h	Wed Nov  3 21:50:49 2010	(r214761)
@@ -104,7 +104,7 @@ struct ucom_callback {
 	void    (*ucom_stop_read) (struct ucom_softc *);
 	void    (*ucom_start_write) (struct ucom_softc *);
 	void    (*ucom_stop_write) (struct ucom_softc *);
-	void    (*ucom_tty_name) (struct ucom_softc *, char *pbuf, uint16_t buflen, uint16_t local_subunit);
+	void    (*ucom_tty_name) (struct ucom_softc *, char *pbuf, uint16_t buflen, uint16_t unit, uint16_t subunit);
 	void    (*ucom_poll) (struct ucom_softc *);
 };
 
@@ -132,6 +132,8 @@ struct ucom_param_task {
 
 struct ucom_super_softc {
 	struct usb_process sc_tq;
+	uint32_t sc_unit;
+	uint32_t sc_subunits;
 };
 
 struct ucom_softc {
@@ -158,10 +160,10 @@ struct ucom_softc {
 	const struct ucom_callback *sc_callback;
 	struct ucom_super_softc *sc_super;
 	struct tty *sc_tty;
+	char sc_devname[10];
 	struct mtx *sc_mtx;
 	void   *sc_parent;
-	uint32_t sc_unit;
-	uint32_t sc_local_unit;
+	uint32_t sc_subunit;
 	uint16_t sc_portno;
 	uint16_t sc_flag;
 #define	UCOM_FLAG_RTS_IFLOW	0x01	/* use RTS input flow control */
@@ -191,8 +193,7 @@ struct ucom_softc {
 int	ucom_attach(struct ucom_super_softc *,
 	    struct ucom_softc *, uint32_t, void *,
 	    const struct ucom_callback *callback, struct mtx *);
-void	ucom_detach(struct ucom_super_softc *,
-	    struct ucom_softc *, uint32_t);
+void	ucom_detach(struct ucom_super_softc *, struct ucom_softc *);
 void	ucom_status_change(struct ucom_softc *);
 uint8_t	ucom_get_data(struct ucom_softc *, struct usb_page_cache *,
 	    uint32_t, uint32_t, uint32_t *);

Modified: head/sys/dev/usb/serial/uslcom.c
==============================================================================
--- head/sys/dev/usb/serial/uslcom.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/uslcom.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -338,7 +338,7 @@ uslcom_detach(device_t dev)
 
 	DPRINTF("sc=%p\n", sc);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, USLCOM_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/uvisor.c
==============================================================================
--- head/sys/dev/usb/serial/uvisor.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/uvisor.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -361,7 +361,7 @@ uvisor_detach(device_t dev)
 
 	DPRINTF("sc=%p\n", sc);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UVISOR_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

Modified: head/sys/dev/usb/serial/uvscom.c
==============================================================================
--- head/sys/dev/usb/serial/uvscom.c	Wed Nov  3 21:40:57 2010	(r214760)
+++ head/sys/dev/usb/serial/uvscom.c	Wed Nov  3 21:50:49 2010	(r214761)
@@ -345,7 +345,7 @@ uvscom_detach(device_t dev)
 	if (sc->sc_xfer[UVSCOM_INTR_DT_RD])
 		usbd_transfer_stop(sc->sc_xfer[UVSCOM_INTR_DT_RD]);
 
-	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
+	ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom);
 	usbd_transfer_unsetup(sc->sc_xfer, UVSCOM_N_TRANSFER);
 	mtx_destroy(&sc->sc_mtx);
 

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 23:16:35 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FE381065675;
	Wed,  3 Nov 2010 23:16:35 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 55F8E8FC19;
	Wed,  3 Nov 2010 23:16:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3NGZDe036908;
	Wed, 3 Nov 2010 23:16:35 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3NGZra036906;
	Wed, 3 Nov 2010 23:16:35 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201011032316.oA3NGZra036906@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 3 Nov 2010 23:16:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214765 - head/sys/dev/acpica
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 23:16:35 -0000

Author: jkim
Date: Wed Nov  3 23:16:35 2010
New Revision: 214765
URL: http://svn.freebsd.org/changeset/base/214765

Log:
  Adjust a comment to clarify why \_SB_ and \_TZ_ are defined as device type
  in ACPICA.  Reshuffle the code a bit to make sure this kludge only applies
  to these two specical cases and to make it cleaner.

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Wed Nov  3 22:21:21 2010	(r214764)
+++ head/sys/dev/acpica/acpi.c	Wed Nov  3 23:16:35 2010	(r214765)
@@ -1673,38 +1673,36 @@ acpi_probe_child(ACPI_HANDLE handle, UIN
     ACPI_OBJECT_TYPE type;
     ACPI_HANDLE h;
     device_t bus, child;
+    char *handle_str;
     int order;
-    char *handle_str, **search;
-    static char *scopes[] = {"\\_PR_", "\\_TZ_", "\\_SI_", "\\_SB_", NULL};
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
+    if (acpi_disabled("children"))
+	return_ACPI_STATUS (AE_OK);
+
     /* Skip this device if we think we'll have trouble with it. */
     if (acpi_avoid(handle))
 	return_ACPI_STATUS (AE_OK);
 
     bus = (device_t)context;
     if (ACPI_SUCCESS(AcpiGetType(handle, &type))) {
+	handle_str = acpi_name(handle);
 	switch (type) {
 	case ACPI_TYPE_DEVICE:
-	case ACPI_TYPE_PROCESSOR:
-	case ACPI_TYPE_THERMAL:
-	case ACPI_TYPE_POWER:
-	    if (acpi_disabled("children"))
-		break;
-
 	    /*
 	     * Since we scan from \, be sure to skip system scope objects.
-	     * At least \_SB and \_TZ are detected as devices (ACPI-CA bug?)
+	     * \_SB_ and \_TZ_ are defined in ACPICA as devices to work around
+	     * BIOS bugs.  For example, \_SB_ is to allow \_SB._INI to be run
+	     * during the intialization and \_TZ_ is to support Notify() on it.
 	     */
-	    handle_str = acpi_name(handle);
-	    for (search = scopes; *search != NULL; search++) {
-		if (strcmp(handle_str, *search) == 0)
-		    break;
-	    }
-	    if (*search != NULL)
+	    if (strcmp(handle_str, "\\_SB_") == 0 ||
+		strcmp(handle_str, "\\_TZ_") == 0)
 		break;
-
+	    /* FALLTHROUGH */
+	case ACPI_TYPE_PROCESSOR:
+	case ACPI_TYPE_THERMAL:
+	case ACPI_TYPE_POWER:
 	    /* 
 	     * Create a placeholder device for this node.  Sort the
 	     * placeholder so that the probe/attach passes will run

From owner-svn-src-head@FreeBSD.ORG  Wed Nov  3 23:29:52 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C8474106564A;
	Wed,  3 Nov 2010 23:29:52 +0000 (UTC)
	(envelope-from jmallett@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B7D508FC14;
	Wed,  3 Nov 2010 23:29:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA3NTqbH037214;
	Wed, 3 Nov 2010 23:29:52 GMT (envelope-from jmallett@svn.freebsd.org)
Received: (from jmallett@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA3NTqaw037212;
	Wed, 3 Nov 2010 23:29:52 GMT (envelope-from jmallett@svn.freebsd.org)
Message-Id: <201011032329.oA3NTqaw037212@svn.freebsd.org>
From: Juli Mallett 
Date: Wed, 3 Nov 2010 23:29:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214766 - head/sys/mips/cavium
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 03 Nov 2010 23:29:52 -0000

Author: jmallett
Date: Wed Nov  3 23:29:52 2010
New Revision: 214766
URL: http://svn.freebsd.org/changeset/base/214766

Log:
  Don't attach the PCI bus driver if the board we're being run on has PCIe.  The
  two are mutually-exclusive on Octeon.

Modified:
  head/sys/mips/cavium/octopci.c

Modified: head/sys/mips/cavium/octopci.c
==============================================================================
--- head/sys/mips/cavium/octopci.c	Wed Nov  3 23:16:35 2010	(r214765)
+++ head/sys/mips/cavium/octopci.c	Wed Nov  3 23:29:52 2010	(r214766)
@@ -108,6 +108,8 @@ octopci_probe(device_t dev)
 {
 	if (device_get_unit(dev) != 0)
 		return (ENXIO);
+	if (octeon_has_feature(OCTEON_FEATURE_PCIE))
+		return (ENXIO);
 	/* XXX Check sysinfo flag.  */
 	device_set_desc(dev, "Cavium Octeon PCI bridge");
 	return (0);

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 08:51:45 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 75932106566C;
	Thu,  4 Nov 2010 08:51:45 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 57F8B8FC18;
	Thu,  4 Nov 2010 08:51:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA48pjF1049603;
	Thu, 4 Nov 2010 08:51:45 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA48pj96049600;
	Thu, 4 Nov 2010 08:51:45 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201011040851.oA48pj96049600@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 4 Nov 2010 08:51:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214774 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 08:51:45 -0000

Author: avg
Date: Thu Nov  4 08:51:45 2010
New Revision: 214774
URL: http://svn.freebsd.org/changeset/base/214774

Log:
  x86 topo_probe: do not probe smp topology if only one cpu is visible
  
  This could lead to a division by zero if hardware is multi-core and/or
  multi-threaded, but for some (quite unusual) reason FreeBSD sees only
  one logical processor.  This could happen, for example, if neither MADT
  nor MP Table are presented by BIOS.
  
  Also:
  - assert in topo_probe_0x4 that BSP is accounted for
  - neither cpu_cores nor cpu_logical should be zero after successful
    probing, so either being zero is an indication of failed probing
  
  Reported by:	vwe, Dan Allen 
  Tested by:	Dan Allen 
  MFC after:	3 days

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/i386/i386/mp_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- head/sys/amd64/amd64/mp_machdep.c	Thu Nov  4 07:53:09 2010	(r214773)
+++ head/sys/amd64/amd64/mp_machdep.c	Thu Nov  4 08:51:45 2010	(r214774)
@@ -239,6 +239,9 @@ topo_probe_0x4(void)
 			cpu_logical++;
 	}
 
+	KASSERT(cpu_cores >= 1 && cpu_logical >= 1,
+	    ("topo_probe_0x4 couldn't find BSP"));
+
 	cpu_cores /= cpu_logical;
 	hyperthreading_cpus = cpu_logical;
 }
@@ -310,7 +313,9 @@ topo_probe(void)
 		return;
 
 	logical_cpus_mask = 0;
-	if (cpu_vendor_id == CPU_VENDOR_AMD)
+	if (mp_ncpus <= 1)
+		cpu_cores = cpu_logical = 1;
+	else if (cpu_vendor_id == CPU_VENDOR_AMD)
 		topo_probe_amd();
 	else if (cpu_vendor_id == CPU_VENDOR_INTEL) {
 		/*
@@ -332,10 +337,8 @@ topo_probe(void)
 	 * Fallback: assume each logical CPU is in separate
 	 * physical package.  That is, no multi-core, no SMT.
 	 */
-	if (cpu_cores == 0)
-		cpu_cores = 1;
-	if (cpu_logical == 0)
-		cpu_logical = 1;
+	if (cpu_cores == 0 || cpu_logical == 0)
+		cpu_cores = cpu_logical = 1;
 	cpu_topo_probed = 1;
 }
 

Modified: head/sys/i386/i386/mp_machdep.c
==============================================================================
--- head/sys/i386/i386/mp_machdep.c	Thu Nov  4 07:53:09 2010	(r214773)
+++ head/sys/i386/i386/mp_machdep.c	Thu Nov  4 08:51:45 2010	(r214774)
@@ -286,6 +286,9 @@ topo_probe_0x4(void)
 			cpu_logical++;
 	}
 
+	KASSERT(cpu_cores >= 1 && cpu_logical >= 1,
+	    ("topo_probe_0x4 couldn't find BSP"));
+
 	cpu_cores /= cpu_logical;
 	hyperthreading_cpus = cpu_logical;
 }
@@ -357,7 +360,9 @@ topo_probe(void)
 		return;
 
 	logical_cpus_mask = 0;
-	if (cpu_vendor_id == CPU_VENDOR_AMD)
+	if (mp_ncpus <= 1)
+		cpu_cores = cpu_logical = 1;
+	else if (cpu_vendor_id == CPU_VENDOR_AMD)
 		topo_probe_amd();
 	else if (cpu_vendor_id == CPU_VENDOR_INTEL) {
 		/*
@@ -379,10 +384,8 @@ topo_probe(void)
 	 * Fallback: assume each logical CPU is in separate
 	 * physical package.  That is, no multi-core, no SMT.
 	 */
-	if (cpu_cores == 0)
-		cpu_cores = 1;
-	if (cpu_logical == 0)
-		cpu_logical = 1;
+	if (cpu_cores == 0 || cpu_logical == 0)
+		cpu_cores = cpu_logical = 1;
 	cpu_topo_probed = 1;
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 09:19:14 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A79B11065672;
	Thu,  4 Nov 2010 09:19:14 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 95B108FC16;
	Thu,  4 Nov 2010 09:19:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA49JEYe050244;
	Thu, 4 Nov 2010 09:19:14 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA49JEVI050242;
	Thu, 4 Nov 2010 09:19:14 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201011040919.oA49JEVI050242@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 4 Nov 2010 09:19:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214776 - head/libexec/rtld-elf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 09:19:14 -0000

Author: kib
Date: Thu Nov  4 09:19:14 2010
New Revision: 214776
URL: http://svn.freebsd.org/changeset/base/214776

Log:
  Fix style.
  
  MFC after:	6 days

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Thu Nov  4 08:58:16 2010	(r214775)
+++ head/libexec/rtld-elf/rtld.c	Thu Nov  4 09:19:14 2010	(r214776)
@@ -1276,7 +1276,7 @@ init_dag(Obj_Entry *root)
     DoneList donelist;
 
     if (root->dag_inited)
-	    return;
+	return;
     donelist_init(&donelist);
     init_dag1(root, root, &donelist);
     root->dag_inited = true;

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 09:29:00 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90EC4106564A;
	Thu,  4 Nov 2010 09:29:00 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 645C88FC13;
	Thu,  4 Nov 2010 09:29:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA49T0ZP050500;
	Thu, 4 Nov 2010 09:29:00 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA49T0Xb050498;
	Thu, 4 Nov 2010 09:29:00 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201011040929.oA49T0Xb050498@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 4 Nov 2010 09:29:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214777 - head/libexec/rtld-elf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 09:29:00 -0000

Author: kib
Date: Thu Nov  4 09:29:00 2010
New Revision: 214777
URL: http://svn.freebsd.org/changeset/base/214777

Log:
  In r214728, if dlopen() is called for the object that has been already
  loaded as a dependency and marked -z nodlopen, object' DAG is already
  initialized by load_needed_objects(). Due to this, the init_dag() call
  from dlopen() does not increment refcount for the object [1].
  
  Change init_dag() to not increment DAG refcount. Require explicit calls
  to ref_dag() to increment, and assert that ref_dag() and unref_dag()
  are called for root that has dag initialized. To fix the noted issue,
  unconditionally call both init_dag() and ref_dag() in dlopen() for the
  case when the object was already loaded, making it similar to the case
  of newly loaded object.
  
  Noted by:	jh [1]
  Reviewed by:	jh, kan
  MFC after:	6 days

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Thu Nov  4 09:19:14 2010	(r214776)
+++ head/libexec/rtld-elf/rtld.c	Thu Nov  4 09:29:00 2010	(r214777)
@@ -1290,7 +1290,6 @@ init_dag1(Obj_Entry *root, Obj_Entry *ob
     if (donelist_check(dlp, obj))
 	return;
 
-    obj->refcount++;
     objlist_push_tail(&obj->dldags, root);
     objlist_push_tail(&root->dagmembers, obj);
     for (needed = obj->needed;  needed != NULL;  needed = needed->next)
@@ -2031,6 +2030,7 @@ dlopen(const char *name, int mode)
 	    assert(*old_obj_tail == obj);
 	    result = load_needed_objects(obj, RTLD_LO_DLOPEN);
 	    init_dag(obj);
+	    ref_dag(obj);
 	    if (result != -1)
 		result = rtld_verify_versions(&obj->dagmembers);
 	    if (result != -1 && ld_tracing)
@@ -2054,10 +2054,8 @@ dlopen(const char *name, int mode)
 	     * already loaded as a dependency, initialize the dag
 	     * starting at it.
 	     */
-	    if (obj->dl_refcount == 1)
-		init_dag(obj);
-	    else
-		ref_dag(obj);
+	    init_dag(obj);
+	    ref_dag(obj);
 
 	    if (ld_tracing)
 		goto trace;
@@ -3085,6 +3083,7 @@ ref_dag(Obj_Entry *root)
 {
     Objlist_Entry *elm;
 
+    assert(root->dag_inited);
     STAILQ_FOREACH(elm, &root->dagmembers, link)
 	elm->obj->refcount++;
 }
@@ -3094,6 +3093,7 @@ unref_dag(Obj_Entry *root)
 {
     Objlist_Entry *elm;
 
+    assert(root->dag_inited);
     STAILQ_FOREACH(elm, &root->dagmembers, link)
 	elm->obj->refcount--;
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 10:47:19 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CCD511065672;
	Thu,  4 Nov 2010 10:47:19 +0000 (UTC) (envelope-from bcr@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BAD8D8FC21;
	Thu,  4 Nov 2010 10:47:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4AlJn5057505;
	Thu, 4 Nov 2010 10:47:19 GMT (envelope-from bcr@svn.freebsd.org)
Received: (from bcr@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4AlJv2057503;
	Thu, 4 Nov 2010 10:47:19 GMT (envelope-from bcr@svn.freebsd.org)
Message-Id: <201011041047.oA4AlJv2057503@svn.freebsd.org>
From: Benedict Reuschling 
Date: Thu, 4 Nov 2010 10:47:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214778 - head/usr.sbin/mfiutil
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 10:47:19 -0000

Author: bcr (doc committer)
Date: Thu Nov  4 10:47:19 2010
New Revision: 214778
URL: http://svn.freebsd.org/changeset/base/214778

Log:
  Fix typo.

Modified:
  head/usr.sbin/mfiutil/mfi_cmd.c

Modified: head/usr.sbin/mfiutil/mfi_cmd.c
==============================================================================
--- head/usr.sbin/mfiutil/mfi_cmd.c	Thu Nov  4 09:29:00 2010	(r214777)
+++ head/usr.sbin/mfiutil/mfi_cmd.c	Thu Nov  4 10:47:19 2010	(r214778)
@@ -46,7 +46,7 @@
 #include 
 
 static const char *mfi_status_codes[] = {
-	"Command completed succesfully",
+	"Command completed successfully",
 	"Invalid command",
 	"Invalid DMCD opcode",
 	"Invalid parameter",

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 15:24:32 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 906891065695;
	Thu,  4 Nov 2010 15:24:32 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7F8B58FC25;
	Thu,  4 Nov 2010 15:24:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4FOWql063814;
	Thu, 4 Nov 2010 15:24:32 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4FOWd7063812;
	Thu, 4 Nov 2010 15:24:32 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201011041524.oA4FOWd7063812@svn.freebsd.org>
From: Bruce Cran 
Date: Thu, 4 Nov 2010 15:24:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214781 - head/sbin/camcontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 15:24:32 -0000

Author: brucec
Date: Thu Nov  4 15:24:32 2010
New Revision: 214781
URL: http://svn.freebsd.org/changeset/base/214781

Log:
  Fix standby timer calculation: the timer was being set 30 minutes later
  than the user requested.
  Also, 21 minutes is encoded as 252 and 22-29 minutes cannot be encoded
  so must be rounded up to 30.
  
  PR:	bin/151871

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Thu Nov  4 12:33:07 2010	(r214780)
+++ head/sbin/camcontrol/camcontrol.c	Thu Nov  4 15:24:32 2010	(r214781)
@@ -4316,10 +4316,17 @@ atapm(struct cam_device *device, int arg
 		sc = 0;
 	else if (t <= (240 * 5))
 		sc = t / 5;
+	else if (t == (252 * 5))
+		/* special encoding for 21 minutes */
+		sc = 252;
+	else if (t < (30 * 60))
+		/* no encoding exists for 22-29 minutes, so set to 30 mins */
+		sc = 241;
 	else if (t <= (11 * 30 * 60))
-		sc = t / (30 * 60) + 241;
+		sc = t / (30 * 60) + 240;
 	else
 		sc = 253;
+
 	cam_fill_ataio(&ccb->ataio,
 		      retry_count,
 		      NULL,

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 15:33:50 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8824E10656A6;
	Thu,  4 Nov 2010 15:33:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 775AA8FC1D;
	Thu,  4 Nov 2010 15:33:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4FXoDt064063;
	Thu, 4 Nov 2010 15:33:50 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4FXox4064061;
	Thu, 4 Nov 2010 15:33:50 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201011041533.oA4FXox4064061@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 4 Nov 2010 15:33:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214782 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 15:33:50 -0000

Author: jhb
Date: Thu Nov  4 15:33:50 2010
New Revision: 214782
URL: http://svn.freebsd.org/changeset/base/214782

Log:
  Update startup_alloc() to support multi-page allocations and allow internal
  zones whose objects are larger than a page to use startup_alloc().  This
  allows allocation of zone objects during early boot on machines with a large
  number of CPUs since the resulting zone objects are larger than a page.
  
  Submitted by:	trema
  Reviewed by:	attilio
  MFC after:	1 week

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Thu Nov  4 15:24:32 2010	(r214781)
+++ head/sys/vm/uma_core.c	Thu Nov  4 15:33:50 2010	(r214782)
@@ -930,15 +930,32 @@ startup_alloc(uma_zone_t zone, int bytes
 {
 	uma_keg_t keg;
 	uma_slab_t tmps;
+	int pages, check_pages;
 
 	keg = zone_first_keg(zone);
+	pages = howmany(bytes, PAGE_SIZE);
+	check_pages = pages - 1;
+	KASSERT(pages > 0, ("startup_alloc can't reserve 0 pages\n"));
 
 	/*
 	 * Check our small startup cache to see if it has pages remaining.
 	 */
 	mtx_lock(&uma_boot_pages_mtx);
-	if ((tmps = LIST_FIRST(&uma_boot_pages)) != NULL) {
-		LIST_REMOVE(tmps, us_link);
+
+	/* First check if we have enough room. */
+	tmps = LIST_FIRST(&uma_boot_pages);
+	while (tmps != NULL && check_pages-- > 0)
+		tmps = LIST_NEXT(tmps, us_link);
+	if (tmps != NULL) {
+		/*
+		 * It's ok to lose tmps references.  The last one will
+		 * have tmps->us_data pointing to the start address of
+		 * "pages" contiguous pages of memory.
+		 */
+		while (pages-- > 0) {
+			tmps = LIST_FIRST(&uma_boot_pages);
+			LIST_REMOVE(tmps, us_link);
+		}
 		mtx_unlock(&uma_boot_pages_mtx);
 		*pflag = tmps->us_flags;
 		return (tmps->us_data);
@@ -950,7 +967,7 @@ startup_alloc(uma_zone_t zone, int bytes
 	 * Now that we've booted reset these users to their real allocator.
 	 */
 #ifdef UMA_MD_SMALL_ALLOC
-	keg->uk_allocf = uma_small_alloc;
+	keg->uk_allocf = (keg->uk_ppera > 1) ? page_alloc : uma_small_alloc;
 #else
 	keg->uk_allocf = page_alloc;
 #endif
@@ -1177,12 +1194,15 @@ keg_large_init(uma_keg_t keg)
 
 	keg->uk_ppera = pages;
 	keg->uk_ipers = 1;
+	keg->uk_rsize = keg->uk_size;
+
+	/* We can't do OFFPAGE if we're internal, bail out here. */
+	if (keg->uk_flags & UMA_ZFLAG_INTERNAL)
+		return;
 
 	keg->uk_flags |= UMA_ZONE_OFFPAGE;
 	if ((keg->uk_flags & UMA_ZONE_VTOSLAB) == 0)
 		keg->uk_flags |= UMA_ZONE_HASH;
-
-	keg->uk_rsize = keg->uk_size;
 }
 
 static void
@@ -1301,7 +1321,8 @@ keg_ctor(void *mem, int size, void *udat
 #endif
 		if (booted == 0)
 			keg->uk_allocf = startup_alloc;
-	}
+	} else if (booted == 0 && (keg->uk_flags & UMA_ZFLAG_INTERNAL))
+		keg->uk_allocf = startup_alloc;
 
 	/*
 	 * Initialize keg's lock (shared among zones).
@@ -1330,7 +1351,7 @@ keg_ctor(void *mem, int size, void *udat
 		if (totsize & UMA_ALIGN_PTR)
 			totsize = (totsize & ~UMA_ALIGN_PTR) +
 			    (UMA_ALIGN_PTR + 1);
-		keg->uk_pgoff = UMA_SLAB_SIZE - totsize;
+		keg->uk_pgoff = (UMA_SLAB_SIZE * keg->uk_ppera) - totsize;
 
 		if (keg->uk_flags & UMA_ZONE_REFCNT)
 			totsize = keg->uk_pgoff + sizeof(struct uma_slab_refcnt)
@@ -1346,7 +1367,7 @@ keg_ctor(void *mem, int size, void *udat
 		 * mathematically possible for all cases, so we make
 		 * sure here anyway.
 		 */
-		if (totsize > UMA_SLAB_SIZE) {
+		if (totsize > UMA_SLAB_SIZE * keg->uk_ppera) {
 			printf("zone %s ipers %d rsize %d size %d\n",
 			    zone->uz_name, keg->uk_ipers, keg->uk_rsize,
 			    keg->uk_size);

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 17:49:36 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC5A1106564A;
	Thu,  4 Nov 2010 17:49:36 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com
	[209.85.213.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 471528FC08;
	Thu,  4 Nov 2010 17:49:35 +0000 (UTC)
Received: by yxl31 with SMTP id 31so1668105yxl.13
	for ; Thu, 04 Nov 2010 10:49:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:message-id:date:from
	:user-agent:mime-version:to:cc:subject:references:in-reply-to
	:x-enigmail-version:content-type:content-transfer-encoding;
	bh=qSAwPhemYgoUD0SkwlpBjFngPDREfxz42bIXaLGscCg=;
	b=rzjvMNEFVvq9/4I7xT3kM8gasAyvfXxuF2nZ8k465AmlP33kxHcr43dS9eK9/MAZcK
	OPEZkjoBObzqizYhk11HAEgRCfBmJTCdSGg7bptRA1hy3E/T5AaU3eVaM8N4OMPCNjnK
	E2zPe9qfFjN22SMCu7JbRdFd6pR+qfI4f7yuo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	b=JJ6XbezopNRr0kUAIsOMAua6PyexDNHd0dNf79TRbqTS+ljX4PYO/pTQz0LhN/OqBz
	3ljs1OUplKAKi6F5wu4egg6YRJkP+7U6pKTiUI8iMZlXADwEsenepe5qJVlaRRX7HXrq
	oKZBF9qRf1AJzhqij/dJkPFKhopDuvCk9fViM=
Received: by 10.204.54.16 with SMTP id o16mr903275bkg.196.1288892974453;
	Thu, 04 Nov 2010 10:49:34 -0700 (PDT)
Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id 4sm196705bki.1.2010.11.04.10.49.31
	(version=SSLv3 cipher=RC4-MD5); Thu, 04 Nov 2010 10:49:33 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4CD2F224.1040008@FreeBSD.org>
Date: Thu, 04 Nov 2010 19:49:24 +0200
From: Alexander Motin 
User-Agent: Thunderbird 2.0.0.23 (X11/20091212)
MIME-Version: 1.0
To: Bruce Cran 
References: <201011041524.oA4FOWd7063812@svn.freebsd.org>
In-Reply-To: <201011041524.oA4FOWd7063812@svn.freebsd.org>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214781 - head/sbin/camcontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 17:49:36 -0000

Bruce Cran wrote:
> Author: brucec
> Date: Thu Nov  4 15:24:32 2010
> New Revision: 214781
> URL: http://svn.freebsd.org/changeset/base/214781
> 
> Log:
>   Fix standby timer calculation: the timer was being set 30 minutes later
>   than the user requested.
>   Also, 21 minutes is encoded as 252 and 22-29 minutes cannot be encoded
>   so must be rounded up to 30.
>   
>   PR:	bin/151871
> 
> Modified:
>   head/sbin/camcontrol/camcontrol.c
> 
> Modified: head/sbin/camcontrol/camcontrol.c
> ==============================================================================
> --- head/sbin/camcontrol/camcontrol.c	Thu Nov  4 12:33:07 2010	(r214780)
> +++ head/sbin/camcontrol/camcontrol.c	Thu Nov  4 15:24:32 2010	(r214781)
> @@ -4316,10 +4316,17 @@ atapm(struct cam_device *device, int arg
>  		sc = 0;
>  	else if (t <= (240 * 5))
>  		sc = t / 5;
> +	else if (t == (252 * 5))

There should be "<=".

> +		/* special encoding for 21 minutes */
> +		sc = 252;
> +	else if (t < (30 * 60))
> +		/* no encoding exists for 22-29 minutes, so set to 30 mins */
> +		sc = 241;
>  	else if (t <= (11 * 30 * 60))
> -		sc = t / (30 * 60) + 241;
> +		sc = t / (30 * 60) + 240;

This will round period down. You will get 30 minutes instead of 59. In
this case rounding up IMHO more appropriate. I agree that previous
rounding up was over aggressive. I would prefer something like:
		sc = (t - 1) / (30 * 60) + 241;
or at least
		sc = (t + 15 * 60) / (30 * 60) + 240;
This will also make previous range unneeded.

Range "t <= (240 * 5)" probably also should be corrected to round up or
at least closest.

-- 
Alexander Motin

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 18:43:57 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B99661065673;
	Thu,  4 Nov 2010 18:43:57 +0000 (UTC)
	(envelope-from bschmidt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A75C68FC19;
	Thu,  4 Nov 2010 18:43:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4IhvRA069355;
	Thu, 4 Nov 2010 18:43:57 GMT (envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4IhvWF069351;
	Thu, 4 Nov 2010 18:43:57 GMT (envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201011041843.oA4IhvWF069351@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Thu, 4 Nov 2010 18:43:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214798 - head/sys/compat/ndis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 18:43:57 -0000

Author: bschmidt
Date: Thu Nov  4 18:43:57 2010
New Revision: 214798
URL: http://svn.freebsd.org/changeset/base/214798

Log:
  Remove 4.x, 5.x and 6.x compatibility bits.
  
  Submitted by:	Paul B Mahol 

Modified:
  head/sys/compat/ndis/kern_ndis.c
  head/sys/compat/ndis/subr_ndis.c
  head/sys/compat/ndis/subr_ntoskrnl.c

Modified: head/sys/compat/ndis/kern_ndis.c
==============================================================================
--- head/sys/compat/ndis/kern_ndis.c	Thu Nov  4 18:40:29 2010	(r214797)
+++ head/sys/compat/ndis/kern_ndis.c	Thu Nov  4 18:43:57 2010	(r214798)
@@ -287,15 +287,6 @@ ndis_create_sysctls(arg)
 
 	TAILQ_INIT(&sc->ndis_cfglist_head);
 
-#if __FreeBSD_version < 502113
-	/* Create the sysctl tree. */
-
-	sc->ndis_tree = SYSCTL_ADD_NODE(&sc->ndis_ctx,
-	    SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO,
-	    device_get_nameunit(sc->ndis_dev), CTLFLAG_RD, 0,
-	    device_get_desc(sc->ndis_dev));
-
-#endif
 	/* Add the driver-specific registry keys. */
 
 	while(1) {
@@ -310,11 +301,7 @@ ndis_create_sysctls(arg)
 		/* See if we already have a sysctl with this name */
 
 		oidp = NULL;
-#if __FreeBSD_version < 502113
-		TAILQ_FOREACH(e, &sc->ndis_ctx, link) {
-#else
 		TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) {
-#endif
 			oidp = e->entry;
 			if (strcasecmp(oidp->oid_name, vals->nc_cfgkey) == 0)
 				break;
@@ -395,18 +382,11 @@ ndis_add_sysctl(arg, key, desc, val, fla
 	TAILQ_INSERT_TAIL(&sc->ndis_cfglist_head, cfg, link);
 
 	cfg->ndis_oid =
-#if __FreeBSD_version < 502113
-	SYSCTL_ADD_STRING(&sc->ndis_ctx, SYSCTL_CHILDREN(sc->ndis_tree),
-	    OID_AUTO, cfg->ndis_cfg.nc_cfgkey, flag,
-	    cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val),
-	    cfg->ndis_cfg.nc_cfgdesc);
-#else
 	SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev),
 	    SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)),
 	    OID_AUTO, cfg->ndis_cfg.nc_cfgkey, flag,
 	    cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val),
 	    cfg->ndis_cfg.nc_cfgdesc);
-#endif
 
 	return (0);
 }
@@ -428,11 +408,7 @@ ndis_flush_sysctls(arg)
 
 	sc = arg;
 
-#if __FreeBSD_version < 502113
-	clist = &sc->ndis_ctx;
-#else
 	clist = device_get_sysctl_ctx(sc->ndis_dev);
-#endif
 
 	while (!TAILQ_EMPTY(&sc->ndis_cfglist_head)) {
 		cfg = TAILQ_FIRST(&sc->ndis_cfglist_head);

Modified: head/sys/compat/ndis/subr_ndis.c
==============================================================================
--- head/sys/compat/ndis/subr_ndis.c	Thu Nov  4 18:40:29 2010	(r214797)
+++ head/sys/compat/ndis/subr_ndis.c	Thu Nov  4 18:43:57 2010	(r214798)
@@ -639,11 +639,7 @@ NdisReadConfiguration(status, parm, cfg,
 	 * See if registry key is already in a list of known keys
 	 * included with the driver.
 	 */
-#if __FreeBSD_version < 502113
-	TAILQ_FOREACH(e, &sc->ndis_ctx, link) {
-#else
 	TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) {
-#endif
 		oidp = e->entry;
 		if (strcasecmp(oidp->oid_name, keystr) == 0) {
 			if (strcmp((char *)oidp->oid_arg1, "UNSET") == 0) {
@@ -746,11 +742,7 @@ NdisWriteConfiguration(status, cfg, key,
 
 	/* See if the key already exists. */
 
-#if __FreeBSD_version < 502113
-	TAILQ_FOREACH(e, &sc->ndis_ctx, link) {
-#else
 	TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) {
-#endif
 		oidp = e->entry;
 		if (strcasecmp(oidp->oid_name, keystr) == 0) {
 			/* Found it, set the value. */
@@ -1318,23 +1310,11 @@ NdisReadNetworkAddress(status, addr, add
 		return;
 	}
 
-#ifdef IFP2ENADDR
-	if (bcmp(IFP2ENADDR(sc->ifp), empty, ETHER_ADDR_LEN) == 0)
-#elif __FreeBSD_version >= 700000
 	if (sc->ifp->if_addr == NULL ||
 	    bcmp(IF_LLADDR(sc->ifp), empty, ETHER_ADDR_LEN) == 0)
-#else
-	if (bcmp(sc->arpcom.ac_enaddr, empty, ETHER_ADDR_LEN) == 0)
-#endif
 		*status = NDIS_STATUS_FAILURE;
 	else {
-#ifdef IFP2ENADDR
-		*addr = IFP2ENADDR(sc->ifp);
-#elif __FreeBSD_version >= 700000
 		*addr = IF_LLADDR(sc->ifp);
-#else
-		*addr = sc->arpcom.ac_enaddr;
-#endif
 		*addrlen = ETHER_ADDR_LEN;
 		*status = NDIS_STATUS_SUCCESS;
 	}

Modified: head/sys/compat/ndis/subr_ntoskrnl.c
==============================================================================
--- head/sys/compat/ndis/subr_ntoskrnl.c	Thu Nov  4 18:40:29 2010	(r214797)
+++ head/sys/compat/ndis/subr_ntoskrnl.c	Thu Nov  4 18:43:57 2010	(r214798)
@@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#if __FreeBSD_version > 502113
 #include 
-#endif
 #include 
 #include 
 #include 
@@ -2602,11 +2600,7 @@ ntoskrnl_finddev(dev, paddr, res)
 
 	rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev);
 	if (rl != NULL) {
-#if __FreeBSD_version < 600022
-		SLIST_FOREACH(rle, rl, link) {
-#else
 		STAILQ_FOREACH(rle, rl, link) {
-#endif
 			r = rle->res;
 
 			if (r == NULL)
@@ -2698,9 +2692,6 @@ ntoskrnl_workitem_thread(arg)
 		KeReleaseSpinLock(&kq->kq_lock, irql);
 	}
 
-#if __FreeBSD_version < 502113
-	mtx_lock(&Giant);
-#endif
 	kproc_exit(0);
 	return; /* notreached */
 }
@@ -3429,9 +3420,6 @@ PsTerminateSystemThread(status)
 
 	ntoskrnl_kth--;
 
-#if __FreeBSD_version < 502113
-	mtx_lock(&Giant);
-#endif
 	kproc_exit(0);
 	return (0);	/* notreached */
 }
@@ -3453,11 +3441,7 @@ static void
 DbgBreakPoint(void)
 {
 
-#if __FreeBSD_version < 502113
-	Debugger("DbgBreakPoint(): breakpoint");
-#else
 	kdb_enter(KDB_WHY_NDIS, "DbgBreakPoint(): breakpoint");
-#endif
 }
 
 static void
@@ -3697,14 +3681,9 @@ ntoskrnl_dpc_thread(arg)
 
 	thread_lock(curthread);
 #ifdef NTOSKRNL_MULTIPLE_DPCS
-#if __FreeBSD_version >= 502102
 	sched_bind(curthread, kq->kq_cpu);
 #endif
-#endif
 	sched_prio(curthread, PRI_MIN_KERN);
-#if __FreeBSD_version < 600000
-	curthread->td_base_pri = PRI_MIN_KERN;
-#endif
 	thread_unlock(curthread);
 
 	while (1) {
@@ -3737,9 +3716,6 @@ ntoskrnl_dpc_thread(arg)
 		KeSetEvent(&kq->kq_done, IO_NO_INCREMENT, FALSE);
 	}
 
-#if __FreeBSD_version < 502113
-	mtx_lock(&Giant);
-#endif
 	kproc_exit(0);
 	return; /* notreached */
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 19:05:35 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C9D671065674;
	Thu,  4 Nov 2010 19:05:35 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B80398FC21;
	Thu,  4 Nov 2010 19:05:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4J5Z1f070000;
	Thu, 4 Nov 2010 19:05:35 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4J5Zfd069997;
	Thu, 4 Nov 2010 19:05:35 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201011041905.oA4J5Zfd069997@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Thu, 4 Nov 2010 19:05:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214800 - in head/sys/dev/usb: . quirk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 19:05:35 -0000

Author: hselasky
Date: Thu Nov  4 19:05:35 2010
New Revision: 214800
URL: http://svn.freebsd.org/changeset/base/214800

Log:
  Add new USB quirk.
  
  Submitted by:	Dmitry Luhtionov
  Approved by:	thompsa (mentor)

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- head/sys/dev/usb/quirk/usb_quirk.c	Thu Nov  4 18:57:51 2010	(r214799)
+++ head/sys/dev/usb/quirk/usb_quirk.c	Thu Nov  4 19:05:35 2010	(r214800)
@@ -120,6 +120,7 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(MGE, UPS2, 0x0000, 0xffff, UQ_HID_IGNORE),
 	USB_QUIRK(APPLE, IPHONE, 0x0000, 0xffff, UQ_HID_IGNORE),
 	USB_QUIRK(APPLE, IPHONE_3G, 0x0000, 0xffff, UQ_HID_IGNORE),
+	USB_QUIRK(MEGATEC, UPS, 0x0000, 0xffff, UQ_HID_IGNORE),
 	/* Devices which should be ignored by both ukbd and uhid */
 	USB_QUIRK(CYPRESS, WISPY1A, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE),
 	USB_QUIRK(METAGEEK, WISPY1B, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE),

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Thu Nov  4 18:57:51 2010	(r214799)
+++ head/sys/dev/usb/usbdevs	Thu Nov  4 19:05:35 2010	(r214800)
@@ -2518,7 +2518,7 @@ product PHILIPS RT2870		0x200f	RT2870
 product PHILIPSSEMI HUB1122	0x1122	HUB
 
 /* Megatec */
-product MEGATEC UPS		0x5161	Protocol based UPS
+product MEGATEC UPS		0x5161	Phoenixtec protocol based UPS
 
 /* P.I. Engineering products */
 product PIENGINEERING PS2USB	0x020b	PS2 to Mac USB Adapter

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 19:24:21 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BCD8F106566C;
	Thu,  4 Nov 2010 19:24:21 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AAB908FC17;
	Thu,  4 Nov 2010 19:24:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4JOLgG070563;
	Thu, 4 Nov 2010 19:24:21 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4JOLDx070560;
	Thu, 4 Nov 2010 19:24:21 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201011041924.oA4JOLDx070560@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Thu, 4 Nov 2010 19:24:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214804 - head/sys/dev/usb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 19:24:21 -0000

Author: hselasky
Date: Thu Nov  4 19:24:21 2010
New Revision: 214804
URL: http://svn.freebsd.org/changeset/base/214804

Log:
  Add code to warm reset a USB 3.0 port.
  
  Approved by:	thompsa (mentor)

Modified:
  head/sys/dev/usb/usb_request.c
  head/sys/dev/usb/usb_request.h

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Thu Nov  4 19:20:03 2010	(r214803)
+++ head/sys/dev/usb/usb_request.c	Thu Nov  4 19:24:21 2010	(r214804)
@@ -741,7 +741,7 @@ done:
 /*------------------------------------------------------------------------*
  *	usbd_req_reset_port
  *
- * This function will instruct an USB HUB to perform a reset sequence
+ * This function will instruct a USB HUB to perform a reset sequence
  * on the specified port number.
  *
  * Returns:
@@ -793,12 +793,105 @@ usbd_req_reset_port(struct usb_device *u
 		if (err) {
 			goto done;
 		}
+		/* check if reset is complete */
+		if (UGETW(ps.wPortChange) & UPS_C_PORT_RESET) {
+			break;
+		}
+		/* check for timeout */
+		if (n > 1000) {
+			n = 0;
+			break;
+		}
+	}
+
+	/* clear port reset first */
+	err = usbd_req_clear_port_feature(
+	    udev, mtx, port, UHF_C_PORT_RESET);
+	if (err) {
+		goto done;
+	}
+	/* check for timeout */
+	if (n == 0) {
+		err = USB_ERR_TIMEOUT;
+		goto done;
+	}
+#ifdef USB_DEBUG
+	/* wait for the device to recover from reset */
+	usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay));
+#else
+	/* wait for the device to recover from reset */
+	usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_RECOVERY));
+#endif
+
+done:
+	DPRINTFN(2, "port %d reset returning error=%s\n",
+	    port, usbd_errstr(err));
+	return (err);
+}
+
+/*------------------------------------------------------------------------*
+ *	usbd_req_warm_reset_port
+ *
+ * This function will instruct an USB HUB to perform a warm reset
+ * sequence on the specified port number. This kind of reset is not
+ * mandatory for LOW-, FULL- and HIGH-speed USB HUBs and is targeted
+ * for SUPER-speed USB HUBs.
+ *
+ * Returns:
+ *    0: Success. The USB device should now be available again.
+ * Else: Failure. No USB device is present and the USB port should be
+ *       disabled.
+ *------------------------------------------------------------------------*/
+usb_error_t
+usbd_req_warm_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
+{
+	struct usb_port_status ps;
+	usb_error_t err;
+	uint16_t n;
+
+#ifdef USB_DEBUG
+	uint16_t pr_poll_delay;
+	uint16_t pr_recovery_delay;
+
+#endif
+	err = usbd_req_set_port_feature(udev, mtx, port, UHF_BH_PORT_RESET);
+	if (err) {
+		goto done;
+	}
+#ifdef USB_DEBUG
+	/* range check input parameters */
+	pr_poll_delay = usb_pr_poll_delay;
+	if (pr_poll_delay < 1) {
+		pr_poll_delay = 1;
+	} else if (pr_poll_delay > 1000) {
+		pr_poll_delay = 1000;
+	}
+	pr_recovery_delay = usb_pr_recovery_delay;
+	if (pr_recovery_delay > 1000) {
+		pr_recovery_delay = 1000;
+	}
+#endif
+	n = 0;
+	while (1) {
+#ifdef USB_DEBUG
+		/* wait for the device to recover from reset */
+		usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay));
+		n += pr_poll_delay;
+#else
+		/* wait for the device to recover from reset */
+		usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_DELAY));
+		n += USB_PORT_RESET_DELAY;
+#endif
+		err = usbd_req_get_port_status(udev, mtx, &ps, port);
+		if (err) {
+			goto done;
+		}
 		/* if the device disappeared, just give up */
 		if (!(UGETW(ps.wPortStatus) & UPS_CURRENT_CONNECT_STATUS)) {
 			goto done;
 		}
 		/* check if reset is complete */
-		if (UGETW(ps.wPortChange) & UPS_C_PORT_RESET) {
+		if (UGETW(ps.wPortChange) & UPS_C_BH_PORT_RESET) {
 			break;
 		}
 		/* check for timeout */
@@ -810,7 +903,7 @@ usbd_req_reset_port(struct usb_device *u
 
 	/* clear port reset first */
 	err = usbd_req_clear_port_feature(
-	    udev, mtx, port, UHF_C_PORT_RESET);
+	    udev, mtx, port, UHF_C_BH_PORT_RESET);
 	if (err) {
 		goto done;
 	}
@@ -828,7 +921,7 @@ usbd_req_reset_port(struct usb_device *u
 #endif
 
 done:
-	DPRINTFN(2, "port %d reset returning error=%s\n",
+	DPRINTFN(2, "port %d warm reset returning error=%s\n",
 	    port, usbd_errstr(err));
 	return (err);
 }

Modified: head/sys/dev/usb/usb_request.h
==============================================================================
--- head/sys/dev/usb/usb_request.h	Thu Nov  4 19:20:03 2010	(r214803)
+++ head/sys/dev/usb/usb_request.h	Thu Nov  4 19:24:21 2010	(r214804)
@@ -65,6 +65,8 @@ usb_error_t usbd_req_get_port_status(str
 		    struct usb_port_status *ps, uint8_t port);
 usb_error_t usbd_req_reset_port(struct usb_device *udev, struct mtx *mtx,
 		    uint8_t port);
+usb_error_t usbd_req_warm_reset_port(struct usb_device *udev,
+		    struct mtx *mtx, uint8_t port);
 usb_error_t usbd_req_set_address(struct usb_device *udev, struct mtx *mtx,
 		    uint16_t addr);
 usb_error_t usbd_req_set_hub_feature(struct usb_device *udev, struct mtx *mtx,

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 20:22:08 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 996CF106564A;
	Thu,  4 Nov 2010 20:22:08 +0000 (UTC)
	(envelope-from bruce@cran.org.uk)
Received: from muon.cran.org.uk (muon.cran.org.uk
	[IPv6:2a01:348:0:15:5d59:5c40:0:1])
	by mx1.freebsd.org (Postfix) with ESMTP id 3125B8FC0A;
	Thu,  4 Nov 2010 20:22:08 +0000 (UTC)
Received: from muon.cran.org.uk (localhost [127.0.0.1])
	by muon.cran.org.uk (Postfix) with ESMTP id 459A1E7211;
	Thu,  4 Nov 2010 20:22:07 +0000 (GMT)
Received: from unknown (client-82-26-147-199.pete.adsl.virginmedia.com
	[82.26.147.199])
	(using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by muon.cran.org.uk (Postfix) with ESMTPSA;
	Thu,  4 Nov 2010 20:22:06 +0000 (GMT)
Date: Thu, 4 Nov 2010 20:22:03 +0000
From: Bruce Cran 
To: Alexander Motin 
Message-ID: <20101104202203.000043a6@unknown>
In-Reply-To: <4CD2F224.1040008@FreeBSD.org>
References: <201011041524.oA4FOWd7063812@svn.freebsd.org>
	<4CD2F224.1040008@FreeBSD.org>
X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.6; i586-pc-mingw32msvc)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Bruce Cran 
Subject: Re: svn commit: r214781 - head/sbin/camcontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 20:22:08 -0000

On Thu, 04 Nov 2010 19:49:24 +0200
Alexander Motin  wrote:

> This will round period down. You will get 30 minutes instead of 59. In
> this case rounding up IMHO more appropriate. I agree that previous
> rounding up was over aggressive. I would prefer something like:
> 		sc = (t - 1) / (30 * 60) + 241;
> or at least
> 		sc = (t + 15 * 60) / (30 * 60) + 240;
> This will also make previous range unneeded.
> 
> Range "t <= (240 * 5)" probably also should be corrected to round up
> or at least closest.
> 

Of course rounding up is more suitable. Would the following patch be
ok:

Index: camcontrol.c
===================================================================
--- camcontrol.c	(revision 214793)
+++ camcontrol.c	(working copy)
@@ -4312,18 +4312,16 @@
 		cmd = ATA_SLEEP;
 		t = -1;
 	}
+
 	if (t < 0)
 		sc = 0;
 	else if (t <= (240 * 5))
-		sc = t / 5;
-	else if (t == (252 * 5))
+		sc = (t + 4) / 5;
+	else if (t <= (252 * 5))
 		/* special encoding for 21 minutes */
 		sc = 252;
-	else if (t < (30 * 60))
-		/* no encoding exists for 22-29 minutes, so set to 30
mins */
-		sc = 241;
 	else if (t <= (11 * 30 * 60))
-		sc = t / (30 * 60) + 240;
+		sc = (t - 1) / (30 * 60) + 241;
 	else
 		sc = 253;
 

-- 
Bruce Cran

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 20:24:18 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 395EB106566B;
	Thu,  4 Nov 2010 20:24:18 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54])
	by mx1.freebsd.org (Postfix) with ESMTP id A64F88FC08;
	Thu,  4 Nov 2010 20:24:17 +0000 (UTC)
Received: by gwj16 with SMTP id 16so1824297gwj.13
	for ; Thu, 04 Nov 2010 13:24:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:message-id:date:from
	:user-agent:mime-version:to:cc:subject:references:in-reply-to
	:x-enigmail-version:content-type:content-transfer-encoding;
	bh=3g7QLFyMYJK0+n8VsxAckrvvGn/Gk4xo4aNTMFgmL3M=;
	b=xbPtcCL4iPk32MdlzODk963Yll3yQVRt0Y1L9kgizrkcq3bAE65QeqrKnrFfW+nCZ+
	udHFuSx1JodzkNVHlaZBa+rKkc8GWCR7ex8VY45Z/sJnPPvn/+OQLDZDQbnQGdHeFQEn
	zqCV6801qSKLTHVtOS6YcIEbVgDo3taQpP7Wc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	b=kphl/cbBnDyVCqOe9eT00wxmiK6xBD4kSgD3CkkS4lm4JIr1q+xXfMErmWIUrI1ga2
	lvWjPcC0xx3mDKFErFdMOVH5dbvyFH06KVTwe1cYUSHZ8YsYvyjNjMRZ4g7pS2m+wB5/
	vOgrfl7A94qFFMbK9RLkfTKjFIJ/bj9kS8X7I=
Received: by 10.204.68.142 with SMTP id v14mr1043503bki.106.1288902255715;
	Thu, 04 Nov 2010 13:24:15 -0700 (PDT)
Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id d12sm335120bkw.7.2010.11.04.13.24.13
	(version=SSLv3 cipher=RC4-MD5); Thu, 04 Nov 2010 13:24:14 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4CD3166C.4030003@FreeBSD.org>
Date: Thu, 04 Nov 2010 22:24:12 +0200
From: Alexander Motin 
User-Agent: Thunderbird 2.0.0.24 (X11/20100402)
MIME-Version: 1.0
To: Bruce Cran 
References: <201011041524.oA4FOWd7063812@svn.freebsd.org>	<4CD2F224.1040008@FreeBSD.org>
	<20101104202203.000043a6@unknown>
In-Reply-To: <20101104202203.000043a6@unknown>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Bruce Cran 
Subject: Re: svn commit: r214781 - head/sbin/camcontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 20:24:18 -0000

Bruce Cran wrote:
> On Thu, 04 Nov 2010 19:49:24 +0200
> Alexander Motin  wrote:
> 
>> This will round period down. You will get 30 minutes instead of 59. In
>> this case rounding up IMHO more appropriate. I agree that previous
>> rounding up was over aggressive. I would prefer something like:
>> 		sc = (t - 1) / (30 * 60) + 241;
>> or at least
>> 		sc = (t + 15 * 60) / (30 * 60) + 240;
>> This will also make previous range unneeded.
>>
>> Range "t <= (240 * 5)" probably also should be corrected to round up
>> or at least closest.
>>
> 
> Of course rounding up is more suitable. Would the following patch be
> ok:
> 
> Index: camcontrol.c
> ===================================================================
> --- camcontrol.c	(revision 214793)
> +++ camcontrol.c	(working copy)
> @@ -4312,18 +4312,16 @@
>  		cmd = ATA_SLEEP;
>  		t = -1;
>  	}
> +
>  	if (t < 0)
>  		sc = 0;
>  	else if (t <= (240 * 5))
> -		sc = t / 5;
> -	else if (t == (252 * 5))
> +		sc = (t + 4) / 5;
> +	else if (t <= (252 * 5))
>  		/* special encoding for 21 minutes */
>  		sc = 252;
> -	else if (t < (30 * 60))
> -		/* no encoding exists for 22-29 minutes, so set to 30
> mins */
> -		sc = 241;
>  	else if (t <= (11 * 30 * 60))
> -		sc = t / (30 * 60) + 240;
> +		sc = (t - 1) / (30 * 60) + 241;
>  	else
>  		sc = 253;

It seems so. Thank you.

-- 
Alexander Motin

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 20:31:12 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DDE4F1065674;
	Thu,  4 Nov 2010 20:31:12 +0000 (UTC)
	(envelope-from brucec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC8838FC15;
	Thu,  4 Nov 2010 20:31:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4KVC3X072260;
	Thu, 4 Nov 2010 20:31:12 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4KVCYW072258;
	Thu, 4 Nov 2010 20:31:12 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201011042031.oA4KVCYW072258@svn.freebsd.org>
From: Bruce Cran 
Date: Thu, 4 Nov 2010 20:31:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214807 - head/sbin/camcontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 20:31:13 -0000

Author: brucec
Date: Thu Nov  4 20:31:12 2010
New Revision: 214807
URL: http://svn.freebsd.org/changeset/base/214807

Log:
  r214781 caused the timer value to be rounded down, so that if the user asked
  for 59 minutes 30 was sent to the drive. The timer value is now always
  rounded up.
  
  Reported by: mav

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Thu Nov  4 20:22:44 2010	(r214806)
+++ head/sbin/camcontrol/camcontrol.c	Thu Nov  4 20:31:12 2010	(r214807)
@@ -4312,18 +4312,16 @@ atapm(struct cam_device *device, int arg
 		cmd = ATA_SLEEP;
 		t = -1;
 	}
+
 	if (t < 0)
 		sc = 0;
 	else if (t <= (240 * 5))
-		sc = t / 5;
-	else if (t == (252 * 5))
+		sc = (t + 4) / 5;
+	else if (t <= (252 * 5))
 		/* special encoding for 21 minutes */
 		sc = 252;
-	else if (t < (30 * 60))
-		/* no encoding exists for 22-29 minutes, so set to 30 mins */
-		sc = 241;
 	else if (t <= (11 * 30 * 60))
-		sc = t / (30 * 60) + 240;
+		sc = (t - 1) / (30 * 60) + 241;
 	else
 		sc = 253;
 

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 21:03:51 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 057B3106566C;
	Thu,  4 Nov 2010 21:03:51 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E7D318FC14;
	Thu,  4 Nov 2010 21:03:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4L3oJb073059;
	Thu, 4 Nov 2010 21:03:50 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4L3odc073056;
	Thu, 4 Nov 2010 21:03:50 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201011042103.oA4L3odc073056@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 4 Nov 2010 21:03:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214808 - head/share/man/man4/man4.sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 21:03:51 -0000

Author: uqs
Date: Thu Nov  4 21:03:50 2010
New Revision: 214808
URL: http://svn.freebsd.org/changeset/base/214808

Log:
  In man section 4, ERRORS is spelled DIAGNOSTICS

Modified:
  head/share/man/man4/man4.sparc64/openfirm.4
  head/share/man/man4/man4.sparc64/openprom.4

Modified: head/share/man/man4/man4.sparc64/openfirm.4
==============================================================================
--- head/share/man/man4/man4.sparc64/openfirm.4	Thu Nov  4 20:31:12 2010	(r214807)
+++ head/share/man/man4/man4.sparc64/openfirm.4	Thu Nov  4 21:03:50 2010	(r214808)
@@ -231,7 +231,7 @@ is returned.
 .It Pa /dev/openfirm
 Open Firmware interface node
 .El
-.Sh ERRORS
+.Sh DIAGNOSTICS
 The following may result in rejection of an operation:
 .Bl -tag -width Er
 .It Bq Er EBADF

Modified: head/share/man/man4/man4.sparc64/openprom.4
==============================================================================
--- head/share/man/man4/man4.sparc64/openprom.4	Thu Nov  4 20:31:12 2010	(r214807)
+++ head/share/man/man4/man4.sparc64/openprom.4	Thu Nov  4 21:03:50 2010	(r214808)
@@ -187,7 +187,7 @@ an empty string is returned.
 .It Pa /dev/openprom
 OPENPROM interface node
 .El
-.Sh ERRORS
+.Sh DIAGNOSTICS
 The following may result in rejection of an operation:
 .Bl -tag -width Er
 .It Bq Er EBUSY

From owner-svn-src-head@FreeBSD.ORG  Thu Nov  4 21:06:36 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E6F1D106566C;
	Thu,  4 Nov 2010 21:06:36 +0000 (UTC)
	(envelope-from n_hibma@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D5A028FC12;
	Thu,  4 Nov 2010 21:06:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA4L6acY073147;
	Thu, 4 Nov 2010 21:06:36 GMT (envelope-from n_hibma@svn.freebsd.org)
Received: (from n_hibma@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA4L6aBT073145;
	Thu, 4 Nov 2010 21:06:36 GMT (envelope-from n_hibma@svn.freebsd.org)
Message-Id: <201011042106.oA4L6aBT073145@svn.freebsd.org>
From: Nick Hibma 
Date: Thu, 4 Nov 2010 21:06:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214809 - head/sys/dev/usb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 04 Nov 2010 21:06:37 -0000

Author: n_hibma
Date: Thu Nov  4 21:06:36 2010
New Revision: 214809
URL: http://svn.freebsd.org/changeset/base/214809

Log:
  Don't terminate the notification with \n. This is done in
  usb_device.c:devctl_notify_f().

Modified:
  head/sys/dev/usb/usb_device.c

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Thu Nov  4 21:03:50 2010	(r214808)
+++ head/sys/dev/usb/usb_device.c	Thu Nov  4 21:06:36 2010	(r214809)
@@ -2486,7 +2486,7 @@ usb_notify_addq(const char *type, struct
 	    "mode=%s "
 	    "port=%u "
 #if USB_HAVE_UGEN
-	    "parent=%s\n"
+	    "parent=%s"
 #endif
 	    "",
 #if USB_HAVE_UGEN
@@ -2534,7 +2534,7 @@ usb_notify_addq(const char *type, struct
 		    "endpoints=%d "
 		    "intclass=0x%02x "
 		    "intsubclass=0x%02x "
-		    "intprotocol=0x%02x\n",
+		    "intprotocol=0x%02x",
 #if USB_HAVE_UGEN
 		    udev->ugen_name,
 #endif

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 00:56:21 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79C92106564A;
	Fri,  5 Nov 2010 00:56:21 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4DB228FC12;
	Fri,  5 Nov 2010 00:56:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA50uLSY078429;
	Fri, 5 Nov 2010 00:56:21 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA50uLk5078426;
	Fri, 5 Nov 2010 00:56:21 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201011050056.oA50uLk5078426@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 5 Nov 2010 00:56:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 00:56:21 -0000

Author: ed
Date: Fri Nov  5 00:56:21 2010
New Revision: 214817
URL: http://svn.freebsd.org/changeset/base/214817

Log:
  Partially implement the mysterious cons25 \e[x escape sequence.
  
  It seems the terminfo library on some systems (OS X, Linux) may emit the
  sequence \e[x to reset to default attributes. Apart from using the
  zero-command, this escape sequence allows many more operations, such as
  setting ANSI colors. I don't see this used anywhere, so this should be
  sufficient for now.
  
  This deficiency was spotted by the Debian GNU/kFreeBSD. They have their
  own patch, which is slightly flawed in my opinion. I don't know why they
  never reported this issue to us.
  
  MFC after:	1 week

Modified:
  head/sys/teken/sequences
  head/sys/teken/teken_subr_compat.h

Modified: head/sys/teken/sequences
==============================================================================
--- head/sys/teken/sequences	Fri Nov  5 00:31:09 2010	(r214816)
+++ head/sys/teken/sequences	Fri Nov  5 00:56:21 2010	(r214817)
@@ -106,6 +106,7 @@ C25ADFG	Cons25 set adapter foreground		^
 C25BLPD	Cons25 set bell pitch duration		^[ [ = B	r r
 C25CURS	Cons25 set cursor type			^[ [ = S	r
 C25MODE	Cons25 set terminal mode		^[ [ = T	r
+C25SGR	Cons25 set graphic rendition		^[ [ x		r r
 C25VTSW	Cons25 switch virtual terminal		^[ [ z		r
 
 # VT52 compatibility

Modified: head/sys/teken/teken_subr_compat.h
==============================================================================
--- head/sys/teken/teken_subr_compat.h	Fri Nov  5 00:31:09 2010	(r214816)
+++ head/sys/teken/teken_subr_compat.h	Fri Nov  5 00:56:21 2010	(r214817)
@@ -88,6 +88,20 @@ teken_subr_cons25_set_bell_pitch_duratio
 }
 
 static void
+teken_subr_cons25_set_graphic_rendition(teken_t *t, unsigned int cmd,
+    unsigned int param __unused)
+{
+
+	switch (cmd) {
+	case 0: /* Reset. */
+		t->t_curattr = t->t_defattr;
+		break;
+	default:
+		teken_printf("unsupported attribute %u\n", cmd);
+	}
+}
+
+static void
 teken_subr_cons25_set_terminal_mode(teken_t *t, unsigned int mode)
 {
 

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 01:21:03 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 7C00F1065694; Fri,  5 Nov 2010 01:21:03 +0000 (UTC)
Date: Fri, 5 Nov 2010 01:21:03 +0000
From: Alexander Best 
To: Ed Schouten 
Message-ID: <20101105012103.GA26789@freebsd.org>
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201011050056.oA50uLk5078426@svn.freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 01:21:03 -0000

On Fri Nov  5 10, Ed Schouten wrote:
> Author: ed
> Date: Fri Nov  5 00:56:21 2010
> New Revision: 214817
> URL: http://svn.freebsd.org/changeset/base/214817
> 
> Log:
>   Partially implement the mysterious cons25 \e[x escape sequence.
>   
>   It seems the terminfo library on some systems (OS X, Linux) may emit the
>   sequence \e[x to reset to default attributes. Apart from using the
>   zero-command, this escape sequence allows many more operations, such as
>   setting ANSI colors. I don't see this used anywhere, so this should be
>   sufficient for now.
>   
>   This deficiency was spotted by the Debian GNU/kFreeBSD. They have their
>   own patch, which is slightly flawed in my opinion. I don't know why they
>   never reported this issue to us.

maybe, because nearly all PRs (most of them including patches) they have
submitted via GNATS in the past remain unnoticed and thus they've gotten tired
of reporting issues and submitting patches if nobody seems to care? ;)

cheers.
alex

>   
>   MFC after:	1 week
> 
> Modified:
>   head/sys/teken/sequences
>   head/sys/teken/teken_subr_compat.h
> 
> Modified: head/sys/teken/sequences
> ==============================================================================
> --- head/sys/teken/sequences	Fri Nov  5 00:31:09 2010	(r214816)
> +++ head/sys/teken/sequences	Fri Nov  5 00:56:21 2010	(r214817)
> @@ -106,6 +106,7 @@ C25ADFG	Cons25 set adapter foreground		^
>  C25BLPD	Cons25 set bell pitch duration		^[ [ = B	r r
>  C25CURS	Cons25 set cursor type			^[ [ = S	r
>  C25MODE	Cons25 set terminal mode		^[ [ = T	r
> +C25SGR	Cons25 set graphic rendition		^[ [ x		r r
>  C25VTSW	Cons25 switch virtual terminal		^[ [ z		r
>  
>  # VT52 compatibility
> 
> Modified: head/sys/teken/teken_subr_compat.h
> ==============================================================================
> --- head/sys/teken/teken_subr_compat.h	Fri Nov  5 00:31:09 2010	(r214816)
> +++ head/sys/teken/teken_subr_compat.h	Fri Nov  5 00:56:21 2010	(r214817)
> @@ -88,6 +88,20 @@ teken_subr_cons25_set_bell_pitch_duratio
>  }
>  
>  static void
> +teken_subr_cons25_set_graphic_rendition(teken_t *t, unsigned int cmd,
> +    unsigned int param __unused)
> +{
> +
> +	switch (cmd) {
> +	case 0: /* Reset. */
> +		t->t_curattr = t->t_defattr;
> +		break;
> +	default:
> +		teken_printf("unsupported attribute %u\n", cmd);
> +	}
> +}
> +
> +static void
>  teken_subr_cons25_set_terminal_mode(teken_t *t, unsigned int mode)
>  {
>  

-- 
a13x

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 05:11:54 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89BC8106564A;
	Fri,  5 Nov 2010 05:11:54 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 762A38FC16;
	Fri,  5 Nov 2010 05:11:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA55BsXP085277;
	Fri, 5 Nov 2010 05:11:54 GMT (envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA55BsCK085263;
	Fri, 5 Nov 2010 05:11:54 GMT (envelope-from kientzle@svn.freebsd.org)
Message-Id: <201011050511.oA55BsCK085263@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 5 Nov 2010 05:11:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214822 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 05:11:54 -0000

Author: kientzle
Date: Fri Nov  5 05:11:54 2010
New Revision: 214822
URL: http://svn.freebsd.org/changeset/base/214822

Log:
  Clarify the naming:  Methods that free an object should
  be called "free".  Retain the old "finish" names to preserve
  source compatibility for now.

Modified:
  head/lib/libarchive/archive.h
  head/lib/libarchive/archive_private.h
  head/lib/libarchive/archive_read.3
  head/lib/libarchive/archive_read.c
  head/lib/libarchive/archive_read_disk.3
  head/lib/libarchive/archive_read_disk.c
  head/lib/libarchive/archive_read_extract.c
  head/lib/libarchive/archive_virtual.c
  head/lib/libarchive/archive_write.3
  head/lib/libarchive/archive_write.c
  head/lib/libarchive/archive_write_disk.3
  head/lib/libarchive/archive_write_disk.c
  head/lib/libarchive/libarchive.3

Modified: head/lib/libarchive/archive.h
==============================================================================
--- head/lib/libarchive/archive.h	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive.h	Fri Nov  5 05:11:54 2010	(r214822)
@@ -482,11 +482,10 @@ __LA_DECL void		archive_read_extract_set
 /* Close the file and release most resources. */
 __LA_DECL int		 archive_read_close(struct archive *);
 /* Release all resources and destroy the object. */
-/* Note that archive_read_finish will call archive_read_close for you. */
-#if ARCHIVE_VERSION_NUMBER < 2000000
-/* Erroneously declared to return void in libarchive 1.x */
-__LA_DECL void		 archive_read_finish(struct archive *);
-#else
+/* Note that archive_read_free will call archive_read_close for you. */
+__LA_DECL int		 archive_read_free(struct archive *);
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* Synonym for archive_read_free() for backwards compatibility. */
 __LA_DECL int		 archive_read_finish(struct archive *);
 #endif
 
@@ -503,7 +502,7 @@ __LA_DECL int		 archive_read_finish(stru
  *      - archive_write_header to write the header
  *      - archive_write_data to write the entry data
  *   5) archive_write_close to close the output
- *   6) archive_write_finish to cleanup the writer and release resources
+ *   6) archive_write_free to cleanup the writer and release resources
  */
 __LA_DECL struct archive	*archive_write_new(void);
 __LA_DECL int		 archive_write_set_bytes_per_block(struct archive *,
@@ -584,13 +583,12 @@ __LA_DECL __LA_SSIZE_T	 archive_write_da
 #endif
 __LA_DECL int		 archive_write_finish_entry(struct archive *);
 __LA_DECL int		 archive_write_close(struct archive *);
-#if ARCHIVE_VERSION_NUMBER < 2000000
-/* Return value was incorrect in libarchive 1.x. */
-__LA_DECL void		 archive_write_finish(struct archive *);
-#else
-/* Libarchive 2.x and later returns an error if this fails. */
-/* It can fail if the archive wasn't already closed, in which case
- * archive_write_finish() will implicitly call archive_write_close(). */
+
+/* This can fail if the archive wasn't already closed, in which case
+ * archive_write_free() will implicitly call archive_write_close(). */
+__LA_DECL int		 archive_write_free(struct archive *);
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* Synonym for archive_write_free() for backwards compatibility. */
 __LA_DECL int		 archive_write_finish(struct archive *);
 #endif
 
@@ -619,7 +617,7 @@ __LA_DECL int		archive_write_set_options
  *      - construct an appropriate struct archive_entry structure
  *      - archive_write_header to create the file/dir/etc on disk
  *      - archive_write_data to write the entry data
- *   4) archive_write_finish to cleanup the writer and release resources
+ *   4) archive_write_free to cleanup the writer and release resources
  *
  * In particular, you can use this in conjunction with archive_read()
  * to pull entries out of an archive and create them on disk.

Modified: head/lib/libarchive/archive_private.h
==============================================================================
--- head/lib/libarchive/archive_private.h	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_private.h	Fri Nov  5 05:11:54 2010	(r214822)
@@ -58,7 +58,7 @@
 
 struct archive_vtable {
 	int	(*archive_close)(struct archive *);
-	int	(*archive_finish)(struct archive *);
+	int	(*archive_free)(struct archive *);
 	int	(*archive_write_header)(struct archive *,
 	    struct archive_entry *);
 	int	(*archive_write_finish_entry)(struct archive *);

Modified: head/lib/libarchive/archive_read.3
==============================================================================
--- head/lib/libarchive/archive_read.3	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_read.3	Fri Nov  5 05:11:54 2010	(r214822)
@@ -69,7 +69,7 @@
 .Nm archive_read_extract2 ,
 .Nm archive_read_extract_set_progress_callback ,
 .Nm archive_read_close ,
-.Nm archive_read_finish
+.Nm archive_read_free
 .Nd functions for reading streaming archives
 .Sh SYNOPSIS
 .In archive.h
@@ -196,7 +196,7 @@
 .Ft int
 .Fn archive_read_close "struct archive *"
 .Ft int
-.Fn archive_read_finish "struct archive *"
+.Fn archive_read_free "struct archive *"
 .Sh DESCRIPTION
 These functions provide a complete API for reading streaming archives.
 The general process is to first create the
@@ -457,7 +457,7 @@ object and the archive_entry object so t
 can be retrieved for the progress display.
 .It Fn archive_read_close
 Complete the archive and invoke the close callback.
-.It Fn archive_read_finish
+.It Fn archive_read_free
 Invokes
 .Fn archive_read_close
 if it was not invoked manually, then release all resources.
@@ -600,7 +600,7 @@ list_archive(const char *name)
     printf("%s\\n",archive_entry_pathname(entry));
     archive_read_data_skip(a);
   }
-  archive_read_finish(a);
+  archive_read_free(a);
   free(mydata);
 }
 

Modified: head/lib/libarchive/archive_read.c
==============================================================================
--- head/lib/libarchive/archive_read.c	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_read.c	Fri Nov  5 05:11:54 2010	(r214822)
@@ -60,7 +60,7 @@ static int	choose_format(struct archive_
 static int	cleanup_filters(struct archive_read *);
 static struct archive_vtable *archive_read_vtable(void);
 static int	_archive_read_close(struct archive *);
-static int	_archive_read_finish(struct archive *);
+static int	_archive_read_free(struct archive *);
 
 static struct archive_vtable *
 archive_read_vtable(void)
@@ -69,7 +69,7 @@ archive_read_vtable(void)
 	static int inited = 0;
 
 	if (!inited) {
-		av.archive_finish = _archive_read_finish;
+		av.archive_free = _archive_read_free;
 		av.archive_close = _archive_read_close;
 	}
 	return (&av);
@@ -779,7 +779,7 @@ cleanup_filters(struct archive_read *a)
  * Release memory and other resources.
  */
 static int
-_archive_read_finish(struct archive *_a)
+_archive_read_free(struct archive *_a)
 {
 	struct archive_read *a = (struct archive_read *)_a;
 	int i;
@@ -787,7 +787,7 @@ _archive_read_finish(struct archive *_a)
 	int r = ARCHIVE_OK;
 
 	__archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_ANY,
-	    "archive_read_finish");
+	    "archive_read_free");
 	if (a->archive.state != ARCHIVE_STATE_CLOSED)
 		r = archive_read_close(&a->archive);
 

Modified: head/lib/libarchive/archive_read_disk.3
==============================================================================
--- head/lib/libarchive/archive_read_disk.3	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_read_disk.3	Fri Nov  5 05:11:54 2010	(r214822)
@@ -39,7 +39,7 @@
 .Nm archive_read_disk_set_gname_lookup ,
 .Nm archive_read_disk_set_standard_lookup ,
 .Nm archive_read_close ,
-.Nm archive_read_finish
+.Nm archive_read_free
 .Nd functions for reading objects from disk
 .Sh SYNOPSIS
 .In archive.h
@@ -81,7 +81,7 @@
 .Ft int
 .Fn archive_read_close "struct archive *"
 .Ft int
-.Fn archive_read_finish "struct archive *"
+.Fn archive_read_free "struct archive *"
 .Sh DESCRIPTION
 These functions provide an API for reading information about
 objects on disk.
@@ -178,9 +178,9 @@ This affects the file ownership fields a
 object.
 .It Fn archive_read_close
 This currently does nothing.
-.It Fn archive_write_finish
+.It Fn archive_read_free
 Invokes
-.Fn archive_write_close
+.Fn archive_read_close
 if it was not invoked manually, then releases all resources.
 .El
 More information about the
@@ -213,7 +213,7 @@ file_to_archive(struct archive *a, const
   while ((bytes_read = read(fd, buff, sizeof(buff))) > 0)
     archive_write_data(a, buff, bytes_read);
   archive_write_finish_entry(a);
-  archive_read_finish(ard);
+  archive_read_free(ard);
   archive_entry_free(entry);
 }
 .Ed

Modified: head/lib/libarchive/archive_read_disk.c
==============================================================================
--- head/lib/libarchive/archive_read_disk.c	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_read_disk.c	Fri Nov  5 05:11:54 2010	(r214822)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 #include "archive_private.h"
 #include "archive_read_disk_private.h"
 
-static int	_archive_read_finish(struct archive *);
+static int	_archive_read_free(struct archive *);
 static int	_archive_read_close(struct archive *);
 static const char *trivial_lookup_gname(void *, gid_t gid);
 static const char *trivial_lookup_uname(void *, uid_t uid);
@@ -45,7 +45,7 @@ archive_read_disk_vtable(void)
 	static int inited = 0;
 
 	if (!inited) {
-		av.archive_finish = _archive_read_finish;
+		av.archive_free = _archive_read_free;
 		av.archive_close = _archive_read_close;
 	}
 	return (&av);
@@ -129,7 +129,7 @@ archive_read_disk_new(void)
 }
 
 static int
-_archive_read_finish(struct archive *_a)
+_archive_read_free(struct archive *_a)
 {
 	struct archive_read_disk *a = (struct archive_read_disk *)_a;
 

Modified: head/lib/libarchive/archive_read_extract.c
==============================================================================
--- head/lib/libarchive/archive_read_extract.c	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_read_extract.c	Fri Nov  5 05:11:54 2010	(r214822)
@@ -172,10 +172,7 @@ archive_read_extract_cleanup(struct arch
 {
 	int ret = ARCHIVE_OK;
 
-#if ARCHIVE_API_VERSION > 1
-	ret =
-#endif
-	    archive_write_finish(a->extract->ad);
+	ret = archive_write_free(a->extract->ad);
 	free(a->extract);
 	a->extract = NULL;
 	return (ret);

Modified: head/lib/libarchive/archive_virtual.c
==============================================================================
--- head/lib/libarchive/archive_virtual.c	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_virtual.c	Fri Nov  5 05:11:54 2010	(r214822)
@@ -42,26 +42,35 @@ archive_read_close(struct archive *a)
 	return ((a->vtable->archive_close)(a));
 }
 
-#if ARCHIVE_API_VERSION > 1
 int
-archive_write_finish(struct archive *a)
+archive_write_free(struct archive *a)
 {
-	return ((a->vtable->archive_finish)(a));
+	return ((a->vtable->archive_free)(a));
 }
-#else
-/* Temporarily allow library to compile with either 1.x or 2.0 API. */
-void
+
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* For backwards compatibility; will be removed with libarchive 4.0. */
+int
 archive_write_finish(struct archive *a)
 {
-	(void)(a->vtable->archive_finish)(a);
+	return ((a->vtable->archive_free)(a));
 }
 #endif
 
 int
+archive_read_free(struct archive *a)
+{
+	return ((a->vtable->archive_free)(a));
+}
+
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* For backwards compatibility; will be removed with libarchive 4.0. */
+int
 archive_read_finish(struct archive *a)
 {
-	return ((a->vtable->archive_finish)(a));
+	return ((a->vtable->archive_free)(a));
 }
+#endif
 
 int
 archive_write_header(struct archive *a, struct archive_entry *entry)
@@ -76,12 +85,7 @@ archive_write_finish_entry(struct archiv
 	return ((a->vtable->archive_write_finish_entry)(a));
 }
 
-#if ARCHIVE_API_VERSION > 1
 ssize_t
-#else
-/* Temporarily allow library to compile with either 1.x or 2.0 API. */
-int
-#endif
 archive_write_data(struct archive *a, const void *buff, size_t s)
 {
 	return ((a->vtable->archive_write_data)(a, buff, s));

Modified: head/lib/libarchive/archive_write.3
==============================================================================
--- head/lib/libarchive/archive_write.3	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_write.3	Fri Nov  5 05:11:54 2010	(r214822)
@@ -55,7 +55,7 @@
 .Nm archive_write_data ,
 .Nm archive_write_finish_entry ,
 .Nm archive_write_close ,
-.Nm archive_write_finish
+.Nm archive_write_free
 .Nd functions for creating archives
 .Sh SYNOPSIS
 .In archive.h
@@ -125,7 +125,7 @@
 .Ft int
 .Fn archive_write_close "struct archive *"
 .Ft int
-.Fn archive_write_finish "struct archive *"
+.Fn archive_write_free "struct archive *"
 .Sh DESCRIPTION
 These functions provide a complete API for creating streaming
 archive files.
@@ -363,16 +363,16 @@ and
 as needed.
 .It Fn archive_write_close
 Complete the archive and invoke the close callback.
-.It Fn archive_write_finish
+.It Fn archive_write_free
 Invokes
 .Fn archive_write_close
-if it was not invoked manually, then releases all resources.
-Note that this function was declared to return
-.Ft void
-in libarchive 1.x, which made it impossible to detect errors when
+if necessary, then releases all resources.
+If you need detailed information about
 .Fn archive_write_close
-was invoked implicitly from this function.
-This is corrected beginning with libarchive 2.0.
+failures, you should be careful to call it separately, as
+you cannot obtain error information after
+.Fn archive_write_free
+returns.
 .El
 More information about the
 .Va struct archive
@@ -529,7 +529,7 @@ write_archive(const char *outname, const
     archive_entry_free(entry);
     filename++;
   }
-  archive_write_finish(a);
+  archive_write_free(a);
 }
 
 int main(int argc, const char **argv)
@@ -580,7 +580,7 @@ may include
 .Fn archive_write_data ,
 .Fn archive_write_close ,
 or
-.Fn archive_write_finish .
+.Fn archive_write_free .
 The client callback can call
 .Fn archive_set_error
 to provide values that can then be retrieved by

Modified: head/lib/libarchive/archive_write.c
==============================================================================
--- head/lib/libarchive/archive_write.c	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_write.c	Fri Nov  5 05:11:54 2010	(r214822)
@@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
 static struct archive_vtable *archive_write_vtable(void);
 
 static int	_archive_write_close(struct archive *);
-static int	_archive_write_finish(struct archive *);
+static int	_archive_write_free(struct archive *);
 static int	_archive_write_header(struct archive *, struct archive_entry *);
 static int	_archive_write_finish_entry(struct archive *);
 static ssize_t	_archive_write_data(struct archive *, const void *, size_t);
@@ -73,7 +73,7 @@ archive_write_vtable(void)
 
 	if (!inited) {
 		av.archive_close = _archive_write_close;
-		av.archive_finish = _archive_write_finish;
+		av.archive_free = _archive_write_free;
 		av.archive_write_header = _archive_write_header;
 		av.archive_write_finish_entry = _archive_write_finish_entry;
 		av.archive_write_data = _archive_write_data;
@@ -383,13 +383,13 @@ _archive_write_close(struct archive *_a)
  * Destroy the archive structure.
  */
 static int
-_archive_write_finish(struct archive *_a)
+_archive_write_free(struct archive *_a)
 {
 	struct archive_write *a = (struct archive_write *)_a;
 	int r = ARCHIVE_OK;
 
 	__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
-	    ARCHIVE_STATE_ANY, "archive_write_finish");
+	    ARCHIVE_STATE_ANY, "archive_write_free");
 	if (a->archive.state != ARCHIVE_STATE_CLOSED)
 		r = archive_write_close(&a->archive);
 

Modified: head/lib/libarchive/archive_write_disk.3
==============================================================================
--- head/lib/libarchive/archive_write_disk.3	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_write_disk.3	Fri Nov  5 05:11:54 2010	(r214822)
@@ -38,7 +38,7 @@
 .Nm archive_write_data ,
 .Nm archive_write_finish_entry ,
 .Nm archive_write_close ,
-.Nm archive_write_finish
+.Nm archive_write_free
 .Nd functions for creating objects on disk
 .Sh SYNOPSIS
 .In archive.h
@@ -73,7 +73,7 @@
 .Ft int
 .Fn archive_write_close "struct archive *"
 .Ft int
-.Fn archive_write_finish "struct archive *"
+.Fn archive_write_free "struct archive *"
 .Sh DESCRIPTION
 These functions provide a complete API for creating objects on
 disk from
@@ -239,7 +239,7 @@ The
 .Nm
 library maintains a list of all such deferred attributes and
 sets them when this function is invoked.
-.It Fn archive_write_finish
+.It Fn archive_write_free
 Invokes
 .Fn archive_write_close
 if it was not invoked manually, then releases all resources.

Modified: head/lib/libarchive/archive_write_disk.c
==============================================================================
--- head/lib/libarchive/archive_write_disk.c	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/archive_write_disk.c	Fri Nov  5 05:11:54 2010	(r214822)
@@ -252,7 +252,7 @@ static ssize_t	write_data_block(struct a
 static struct archive_vtable *archive_write_disk_vtable(void);
 
 static int	_archive_write_close(struct archive *);
-static int	_archive_write_finish(struct archive *);
+static int	_archive_write_free(struct archive *);
 static int	_archive_write_header(struct archive *, struct archive_entry *);
 static int	_archive_write_finish_entry(struct archive *);
 static ssize_t	_archive_write_data(struct archive *, const void *, size_t);
@@ -291,7 +291,7 @@ archive_write_disk_vtable(void)
 
 	if (!inited) {
 		av.archive_close = _archive_write_close;
-		av.archive_finish = _archive_write_finish;
+		av.archive_free = _archive_write_free;
 		av.archive_write_header = _archive_write_header;
 		av.archive_write_finish_entry = _archive_write_finish_entry;
 		av.archive_write_data = _archive_write_data;
@@ -1295,7 +1295,7 @@ _archive_write_close(struct archive *_a)
 }
 
 static int
-_archive_write_finish(struct archive *_a)
+_archive_write_free(struct archive *_a)
 {
 	struct archive_write_disk *a = (struct archive_write_disk *)_a;
 	int ret;

Modified: head/lib/libarchive/libarchive.3
==============================================================================
--- head/lib/libarchive/libarchive.3	Fri Nov  5 02:45:13 2010	(r214821)
+++ head/lib/libarchive/libarchive.3	Fri Nov  5 05:11:54 2010	(r214822)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 17, 2010
+.Dd February 6, 2010
 .Dt LIBARCHIVE 3
 .Os
 .Sh NAME
@@ -61,13 +61,14 @@ GNU-format tar archives,
 .It
 most common cpio archive formats,
 .It
-ISO9660 CD images (with or without RockRidge extensions),
+ISO9660 CD images (including RockRidge and Joliet extensions),
 .It
 Zip archives.
 .El
 The library automatically detects archives compressed with
 .Xr gzip 1 ,
 .Xr bzip2 1 ,
+.Xr xz 1 ,
 or
 .Xr compress 1
 and decompresses them transparently.
@@ -87,6 +88,8 @@ archives,
 .It
 POSIX octet-oriented cpio archives,
 .It
+Zip archive,
+.It
 two different variants of shar archives.
 .El
 Pax interchange format is an extension of the tar archive format that
@@ -168,12 +171,12 @@ You can use
 (which works much like the
 .Xr read 2
 system call)
-to read this data from the archive.
+to read this data from the archive, or
+.Fn archive_read_data_block
+which provides a slightly more efficient interface.
 You may prefer to use the higher-level
 .Fn archive_read_data_skip ,
 which reads and discards the data for this entry,
-.Fn archive_read_data_to_buffer ,
-which reads the data into an in-memory buffer,
 .Fn archive_read_data_to_file ,
 which copies the data to the provided file descriptor, or
 .Fn archive_read_extract ,
@@ -192,7 +195,7 @@ Once you have finished reading data from
 should call
 .Fn archive_read_close
 to close the archive, then call
-.Fn archive_read_finish
+.Fn archive_read_free
 to release all resources, including all memory allocated by the library.
 .Pp
 The
@@ -230,12 +233,34 @@ You can then use
 to write the actual data.
 .Pp
 After all entries have been written, use the
-.Fn archive_write_finish
+.Fn archive_write_free
 function to release all resources.
 .Pp
 The
 .Xr archive_write 3
 manual page provides more detailed calling information for this API.
+.Sh WRITING ENTRIES TO DISK
+The
+.Xr archive_write_disk 3
+API allows you to write
+.Xr archive_entry 3
+objects to disk using the same API used by
+.Xr archive_write 3 .
+The
+.Xr archive_write_disk 3
+API is used internally by
+.Fn archive_read_extract ;
+using it directly can provide greater control over how entries
+get written to disk.
+This API also makes it possible to share code between
+archive-to-archive copy and archive-to-disk extraction
+operations.
+.Sh READING ENTRIES FROM DISK
+The
+.Xr archive_read_disk 3
+provides some support for populating
+.Xr archive_entry 3
+objects from information in the filesystem.
 .Sh DESCRIPTION
 Detailed descriptions of each function are provided by the
 corresponding manual pages.
@@ -259,7 +284,9 @@ In particular, pax interchange format ca
 in arbitrary character sets that exceed
 .Va PATH_MAX .
 .Sh RETURN VALUES
-Most functions return zero on success, non-zero on error.
+Most functions return
+.Cm ARCHIVE_OK
+(zero) on success, non-zero on error.
 The return value indicates the general severity of the error, ranging
 from
 .Cm ARCHIVE_WARN ,
@@ -329,3 +356,14 @@ stored in a
 is supported by all formats.
 For example, cpio formats do not support nanosecond timestamps;
 old tar formats do not support large device numbers.
+.Pp
+The
+.Xr archive_read_disk 3
+API should support iterating over filesystems;
+that would make it possible to share code among
+disk-to-archive, archive-to-archive, archive-to-disk,
+and disk-to-disk operations.
+Currently, it only supports reading the
+information for a single file.
+(Which is still quite useful, as it hides a lot
+of system-specific details.)

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 06:03:17 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5925C1065694;
	Fri,  5 Nov 2010 06:03:17 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
	by mx1.freebsd.org (Postfix) with ESMTP id BBED08FC25;
	Fri,  5 Nov 2010 06:03:15 +0000 (UTC)
Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua
	[212.40.38.100])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA07056;
	Fri, 05 Nov 2010 08:03:13 +0200 (EET) (envelope-from avg@freebsd.org)
Received: from localhost.topspin.kiev.ua ([127.0.0.1])
	by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
	id 1PEFOL-000HPP-MB; Fri, 05 Nov 2010 08:03:13 +0200
Message-ID: <4CD39E20.1000402@freebsd.org>
Date: Fri, 05 Nov 2010 08:03:12 +0200
From: Andriy Gapon 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6
MIME-Version: 1.0
To: Alexander Best 
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
	<20101105012103.GA26789@freebsd.org>
In-Reply-To: <20101105012103.GA26789@freebsd.org>
X-Enigmail-Version: 1.1.2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ed Schouten 
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 06:03:17 -0000

on 05/11/2010 03:21 Alexander Best said the following:
> On Fri Nov  5 10, Ed Schouten wrote:
>> Author: ed
>> Date: Fri Nov  5 00:56:21 2010
>> New Revision: 214817
>> URL: http://svn.freebsd.org/changeset/base/214817
>>
>> Log:
>>   Partially implement the mysterious cons25 \e[x escape sequence.
>>   
>>   It seems the terminfo library on some systems (OS X, Linux) may emit the
>>   sequence \e[x to reset to default attributes. Apart from using the
>>   zero-command, this escape sequence allows many more operations, such as
>>   setting ANSI colors. I don't see this used anywhere, so this should be
>>   sufficient for now.
>>   
>>   This deficiency was spotted by the Debian GNU/kFreeBSD. They have their
>>   own patch, which is slightly flawed in my opinion. I don't know why they
>>   never reported this issue to us.
> 
> maybe, because nearly all PRs (most of them including patches) they have
> submitted via GNATS in the past remain unnoticed and thus they've gotten tired
> of reporting issues and submitting patches if nobody seems to care? ;)

Pity that they haven't discovered the mailing lists.

-- 
Andriy Gapon

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 07:44:10 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41271106566C;
	Fri,  5 Nov 2010 07:44:10 +0000 (UTC)
	(envelope-from linimon@lonesome.com)
Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40])
	by mx1.freebsd.org (Postfix) with ESMTP id 1EB338FC08;
	Fri,  5 Nov 2010 07:44:09 +0000 (UTC)
Received: by mail.soaustin.net (Postfix, from userid 502)
	id 7C26F56026; Fri,  5 Nov 2010 07:25:15 +0000 (UTC)
Date: Fri, 5 Nov 2010 07:25:15 +0000
From: Mark Linimon 
To: Alexander Best 
Message-ID: <20101105072515.GA8725@lonesome.com>
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
	<20101105012103.GA26789@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20101105012103.GA26789@freebsd.org>
User-Agent: Mutt/1.5.18 (2008-05-17)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ed Schouten 
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 07:44:10 -0000

On Fri, Nov 05, 2010 at 01:21:03AM +0000, Alexander Best wrote:
> maybe, because nearly all PRs (most of them including patches) they
> have submitted via GNATS in the past remain unnoticed and thus they've
> gotten tired of reporting issues and submitting patches if nobody
> seems to care? ;)

We actually do better these days w/rt userland bugs (and some src
bugs) than we were a few years ago.  I'm always looking for suggestions
on how we can get more committers interested in PRs (especially those
with patches).

mcl

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 08:30:16 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF0B9106566C;
	Fri,  5 Nov 2010 08:30:16 +0000 (UTC)
	(envelope-from n_hibma@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BCC168FC12;
	Fri,  5 Nov 2010 08:30:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA58UGUL089875;
	Fri, 5 Nov 2010 08:30:16 GMT (envelope-from n_hibma@svn.freebsd.org)
Received: (from n_hibma@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA58UG1j089873;
	Fri, 5 Nov 2010 08:30:16 GMT (envelope-from n_hibma@svn.freebsd.org)
Message-Id: <201011050830.oA58UG1j089873@svn.freebsd.org>
From: Nick Hibma 
Date: Fri, 5 Nov 2010 08:30:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214830 - head/sys/dev/usb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 08:30:16 -0000

Author: n_hibma
Date: Fri Nov  5 08:30:16 2010
New Revision: 214830
URL: http://svn.freebsd.org/changeset/base/214830

Log:
  Bugfix: Move the 'at =') and
  hence prevent 'port=X' (and 'bus=<"on" string>) from making it into the
  environment for the devd action.
  
  Reviewed by:	hselasky
  MFC after:	2 weeks

Modified:
  head/sys/dev/usb/usb_device.c

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Fri Nov  5 07:49:47 2010	(r214829)
+++ head/sys/dev/usb/usb_device.c	Fri Nov  5 08:30:16 2010	(r214830)
@@ -2426,14 +2426,13 @@ usb_notify_addq_compat(const char *type,
 #if USB_HAVE_UGEN
 	    "%s "
 #endif
+	    "at port=%u "
 	    "vendor=0x%04x "
 	    "product=0x%04x "
 	    "devclass=0x%02x "
 	    "devsubclass=0x%02x "
 	    "sernum=\"%s\" "
 	    "release=0x%04x "
-	    "at "
-	    "port=%u "
 #if USB_HAVE_UGEN
 	    "on %s\n"
 #endif
@@ -2442,13 +2441,13 @@ usb_notify_addq_compat(const char *type,
 #if USB_HAVE_UGEN
 	    udev->ugen_name,
 #endif
+	    udev->port_no,
 	    UGETW(udev->ddesc.idVendor),
 	    UGETW(udev->ddesc.idProduct),
 	    udev->ddesc.bDeviceClass,
 	    udev->ddesc.bDeviceSubClass,
 	    usb_get_serial(udev),
-	    UGETW(udev->ddesc.bcdDevice),
-	    udev->port_no
+	    UGETW(udev->ddesc.bcdDevice)
 #if USB_HAVE_UGEN
 	    , udev->parent_hub != NULL ?
 		udev->parent_hub->ugen_name :

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 08:59:41 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9C7D1106567A;
	Fri,  5 Nov 2010 08:59:41 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 838178FC1F;
	Fri,  5 Nov 2010 08:59:40 +0000 (UTC)
Received: by wwb17 with SMTP id 17so2691987wwb.31
	for ; Fri, 05 Nov 2010 01:59:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=RXFZlSDv8nuHWv4D6PzKtZAs1vtdO+5YxCbVVLPx04s=;
	b=mHZZfUEaBsh7usnMw6We0UIAdB18uzcq8dsbbB74xecAv4NlZlisPl8V6ijbgT19i8
	iKjrdoVyotMSK8FNvKMprxB5C2TJdBI8b8yKabDpJsqRKb9a0eWlMva1d0LIE0qE8Awu
	9Zl4koXjs0mpm2QC7B8Z6E9gkOtm1iS/NH5nE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=WDKClw2YVZI0MBf3fpcxtdkYP5qv380xX5nlY9bRpML03C0ZTs5ff6I8cab5zuo3w+
	OEAUW4yaZnUh30pauXmbySYbfJWD2xkxMHw2H3zMAGJW2Nk1YuiOFFrnMRg3DB6WU3eN
	HJ4yGm7QpFpNKiv7OUtUiUXNSrcdCmlq+2Wqc=
MIME-Version: 1.0
Received: by 10.216.175.18 with SMTP id y18mr1849291wel.30.1288947578821; Fri,
	05 Nov 2010 01:59:38 -0700 (PDT)
Sender: yanegomi@gmail.com
Received: by 10.216.198.27 with HTTP; Fri, 5 Nov 2010 01:59:38 -0700 (PDT)
In-Reply-To: <20101105072515.GA8725@lonesome.com>
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
	<20101105012103.GA26789@freebsd.org>
	<20101105072515.GA8725@lonesome.com>
Date: Fri, 5 Nov 2010 01:59:38 -0700
X-Google-Sender-Auth: UkHxKiTTDNpf7ol7RbTOQ4oIM-M
Message-ID: 
From: Garrett Cooper 
To: Mark Linimon 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, Alexander Best ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Ed Schouten 
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 08:59:41 -0000

On Fri, Nov 5, 2010 at 12:25 AM, Mark Linimon  wrote:
> On Fri, Nov 05, 2010 at 01:21:03AM +0000, Alexander Best wrote:
>> maybe, because nearly all PRs (most of them including patches) they
>> have submitted via GNATS in the past remain unnoticed and thus they've
>> gotten tired of reporting issues and submitting patches if nobody
>> seems to care? ;)
>
> We actually do better these days w/rt userland bugs (and some src
> bugs) than we were a few years ago. =A0I'm always looking for suggestions
> on how we can get more committers interested in PRs (especially those
> with patches).

    [As is probably well known already among FreeBSD developers] it's
better for junior committers (and otherwise newbie committers) to get
into the whole userland commit arena. Most of what I see in committer
status seems to evolve from userland (optional) to kernel due to the
sexiness of kernel work vs userland work.
-Garrett

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 09:06:24 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 03D59106566B;
	Fri,  5 Nov 2010 09:06:24 +0000 (UTC)
	(envelope-from n_hibma@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CAF3C8FC12;
	Fri,  5 Nov 2010 09:06:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA596NPD090655;
	Fri, 5 Nov 2010 09:06:23 GMT (envelope-from n_hibma@svn.freebsd.org)
Received: (from n_hibma@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA596Ntp090652;
	Fri, 5 Nov 2010 09:06:23 GMT (envelope-from n_hibma@svn.freebsd.org)
Message-Id: <201011050906.oA596Ntp090652@svn.freebsd.org>
From: Nick Hibma 
Date: Fri, 5 Nov 2010 09:06:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214831 - head/sys/dev/usb/serial
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 09:06:24 -0000

Author: n_hibma
Date: Fri Nov  5 09:06:23 2010
New Revision: 214831
URL: http://svn.freebsd.org/changeset/base/214831

Log:
  - Remove an unused entry from the softc (only used in a debugging printf).
  - Fix the loop count on detach (causing a panic on detaching a serial
    dongle).
  - Increase a buffer in case some driver want extra long tty device names
    (postfixing the purpose of the tty for example, e.g. u3g.ppp).

Modified:
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h

Modified: head/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.c	Fri Nov  5 08:30:16 2010	(r214830)
+++ head/sys/dev/usb/serial/usb_serial.c	Fri Nov  5 09:06:23 2010	(r214831)
@@ -255,7 +255,7 @@ ucom_attach(struct ucom_super_softc *ssc
 	}
 	ssc->sc_subunits = subunits;
 
-	for (subunit = 0; subunit != ssc->sc_subunits; subunit++) {
+	for (subunit = 0; subunit < ssc->sc_subunits; subunit++) {
 		sc[subunit].sc_subunit = subunit;
 		sc[subunit].sc_super = ssc;
 		sc[subunit].sc_mtx = mtx;
@@ -270,8 +270,8 @@ ucom_attach(struct ucom_super_softc *ssc
 		sc[subunit].sc_flag |= UCOM_FLAG_ATTACHED;
 	}
 
-	DPRINTF("tp = %p, unit = %d, subunits = %d, device name subunit 0 = %s\n",
-		sc->sc_tty, ssc->sc_unit, ssc->sc_subunits, sc[0].sc_devname);
+	DPRINTF("tp = %p, unit = %d, subunits = %d\n",
+		sc->sc_tty, ssc->sc_unit, ssc->sc_subunits);
 
 	return (0);
 }
@@ -287,7 +287,7 @@ ucom_detach(struct ucom_super_softc *ssc
 
 	usb_proc_drain(&ssc->sc_tq);
 
-	for (subunit = 0; subunit <= ssc->sc_subunits; subunit++) {
+	for (subunit = 0; subunit < ssc->sc_subunits; subunit++) {
 		if (sc[subunit].sc_flag & UCOM_FLAG_ATTACHED) {
 
 			ucom_detach_tty(&sc[subunit]);
@@ -304,7 +304,7 @@ static int
 ucom_attach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc)
 {
 	struct tty *tp;
-	char buf[10];			/* temporary TTY device name buffer */
+	char buf[32];			/* temporary TTY device name buffer */
 
 	tp = tty_alloc_mutex(&ucom_class, sc, sc->sc_mtx);
 	if (tp == NULL)

Modified: head/sys/dev/usb/serial/usb_serial.h
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.h	Fri Nov  5 08:30:16 2010	(r214830)
+++ head/sys/dev/usb/serial/usb_serial.h	Fri Nov  5 09:06:23 2010	(r214831)
@@ -160,7 +160,6 @@ struct ucom_softc {
 	const struct ucom_callback *sc_callback;
 	struct ucom_super_softc *sc_super;
 	struct tty *sc_tty;
-	char sc_devname[10];
 	struct mtx *sc_mtx;
 	void   *sc_parent;
 	uint32_t sc_subunit;

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 09:38:44 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 96DEA1065672; Fri,  5 Nov 2010 09:38:44 +0000 (UTC)
Date: Fri, 5 Nov 2010 09:38:44 +0000
From: Alexander Best 
To: Mark Linimon 
Message-ID: <20101105093844.GA75981@freebsd.org>
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
	<20101105012103.GA26789@freebsd.org>
	<20101105072515.GA8725@lonesome.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20101105072515.GA8725@lonesome.com>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ed Schouten 
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 09:38:44 -0000

On Fri Nov  5 10, Mark Linimon wrote:
> On Fri, Nov 05, 2010 at 01:21:03AM +0000, Alexander Best wrote:
> > maybe, because nearly all PRs (most of them including patches) they
> > have submitted via GNATS in the past remain unnoticed and thus they've
> > gotten tired of reporting issues and submitting patches if nobody
> > seems to care? ;)
> 
> We actually do better these days w/rt userland bugs (and some src
> bugs) than we were a few years ago.  I'm always looking for suggestions
> on how we can get more committers interested in PRs (especially those
> with patches).

unfortunately this might come too late. in 2006 and 2007 apple e.g. submitted
quite some patches and tried contributing some work back to the freebsd
project. since most of their PR didn't trigger any attention at all, they
seem to have completely stopped sending in patches.
even if a higher response rate in connection with GNATS can be achieved, these
parties (GNU/kFreeBSD, apple, ...) and their "manpower" are probably lost
forever for the freebsd project. since their patches didn't trigger any
interest, it is very likely that they have no intentions anymore to contribute
any work back: reasonably.

expecially in the apple case that's a huge loss. personally i think any
contributions by such companies like apple need to have high priority. maybe
having a single committer who will interact with apple or other major
companies might even be a good idea. this doesn't mean that user contributions
aren't as valuable as contributions by companies, but the fact that certain
companies have quite a massive "manpower", the impact of ignoring their patches
is far more severe.

if a company wished to have their work pushed back into the freebsd tree this
seems to be quite a complex process. maybe 2 or 3 years ago nvidia requested
some VM changes for their closed source driver to work on freebsd amd64. they
decided to skip the PR databse and directly interacted with developers (i think
mostly alc@). so that kinda prooves that the PR databse is not suited very well
to get patches committed to freebsd; instead contacting with developers
directly seems to be far more successful.

but again (as mark pointed out many times) freebsd doesn't have a culture of
bug busting.

cheers.
alex

> 
> mcl

-- 
a13x

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 11:31:39 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6F65C106564A;
	Fri,  5 Nov 2010 11:31:39 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 443E28FC2A;
	Fri,  5 Nov 2010 11:31:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5BVdmK095629;
	Fri, 5 Nov 2010 11:31:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5BVdd4095627;
	Fri, 5 Nov 2010 11:31:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201011051131.oA5BVdd4095627@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 5 Nov 2010 11:31:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214834 - head/sbin/pflogd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 11:31:39 -0000

Author: rpaulo
Date: Fri Nov  5 11:31:39 2010
New Revision: 214834
URL: http://svn.freebsd.org/changeset/base/214834

Log:
  Append to CFLAGS, don't clobber it.
  
  Submitted by:	loos

Modified:
  head/sbin/pflogd/Makefile

Modified: head/sbin/pflogd/Makefile
==============================================================================
--- head/sbin/pflogd/Makefile	Fri Nov  5 09:32:32 2010	(r214833)
+++ head/sbin/pflogd/Makefile	Fri Nov  5 11:31:39 2010	(r214834)
@@ -6,7 +6,7 @@ PROG=	pflogd
 SRCS= 	pflogd.c pidfile.c privsep.c privsep_fdpass.c
 MAN=	pflogd.8
 
-CFLAGS=-include ${.CURDIR}/../../lib/libpcap/config.h
+CFLAGS+=-include ${.CURDIR}/../../lib/libpcap/config.h
 
 LDADD=	-lpcap -lutil
 DPADD=	${LIBPCAP} ${LIBUTIL}

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 11:59:37 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 945081065675;
	Fri,  5 Nov 2010 11:59:37 +0000 (UTC)
	(envelope-from skip@menantico.com)
Received: from vms173003pub.verizon.net (vms173003pub.verizon.net
	[206.46.173.3])
	by mx1.freebsd.org (Postfix) with ESMTP id 6FCD48FC22;
	Fri,  5 Nov 2010 11:59:37 +0000 (UTC)
Received: from mx.menantico.com ([unknown] [71.168.247.194])
	by vms173003.mailsrvcs.net
	(Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16
	2009))
	with ESMTPA id <0LBE00MCSRUMYDW5@vms173003.mailsrvcs.net>; Fri,
	05 Nov 2010 05:59:11 -0500 (CDT)
Date: Fri, 05 Nov 2010 07:02:44 -0400
From: Skip Ford 
To: Mark Linimon 
Message-id: <20101105110244.GE72983@menantico.com>
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
	<20101105012103.GA26789@freebsd.org>
	<20101105072515.GA8725@lonesome.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-disposition: inline
In-reply-to: <20101105072515.GA8725@lonesome.com>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@freebsd.org, Alexander Best ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Ed Schouten 
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 11:59:37 -0000

Mark Linimon wrote:
> I'm always looking for suggestions on how we can get more committers
> interested in PRs (especially those with patches).

For PRs with patches that apply to code with a listed MAINTAINER, that
maintainer should have to address the PR within 3 days or their own
commits should get blocked until they do.  

Maintainers will then either handle PRs, or stop listing themselves as
maintainers, which would open "their" code up to other committers to
commit without maintainer review.  It's a win either way, IMO, as far as
handling PRs goes.

-- 
Skip

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 12:11:10 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1233)
	id 8CD121065679; Fri,  5 Nov 2010 12:11:10 +0000 (UTC)
Date: Fri, 5 Nov 2010 12:11:10 +0000
From: Alexander Best 
To: Skip Ford 
Message-ID: <20101105121110.GA95191@freebsd.org>
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
	<20101105012103.GA26789@freebsd.org>
	<20101105072515.GA8725@lonesome.com>
	<20101105110244.GE72983@menantico.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20101105110244.GE72983@menantico.com>
Cc: svn-src-head@freebsd.org, Mark Linimon ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Ed Schouten 
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 12:11:10 -0000

On Fri Nov  5 10, Skip Ford wrote:
> Mark Linimon wrote:
> > I'm always looking for suggestions on how we can get more committers
> > interested in PRs (especially those with patches).
> 
> For PRs with patches that apply to code with a listed MAINTAINER, that
> maintainer should have to address the PR within 3 days or their own
> commits should get blocked until they do.  
> 
> Maintainers will then either handle PRs, or stop listing themselves as
> maintainers, which would open "their" code up to other committers to
> commit without maintainer review.  It's a win either way, IMO, as far as
> handling PRs goes.

*lol* that would be like polititians agreeing to have their salaries cut in
half: NOT GOING TO HAPPEN!

> 
> -- 
> Skip

-- 
a13x

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 13:04:28 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F09D106566B;
	Fri,  5 Nov 2010 13:04:28 +0000 (UTC)
	(envelope-from emaste@freebsd.org)
Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134])
	by mx1.freebsd.org (Postfix) with ESMTP id 5777C8FC14;
	Fri,  5 Nov 2010 13:04:27 +0000 (UTC)
Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by
	WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id
	14.0.694.0; Fri, 5 Nov 2010 09:04:26 -0400
Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332)	id
	6BD1433C00; Fri,  5 Nov 2010 09:04:26 -0400 (EDT)
Date: Fri, 5 Nov 2010 09:04:26 -0400
From: Ed Maste 
To: Ed Schouten 
Message-ID: <20101105130426.GA47601@sandvine.com>
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <201011050056.oA50uLk5078426@svn.freebsd.org>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 13:04:28 -0000

On Fri, Nov 05, 2010 at 12:56:21AM +0000, Ed Schouten wrote:

> Author: ed
> Date: Fri Nov  5 00:56:21 2010
> New Revision: 214817
> URL: http://svn.freebsd.org/changeset/base/214817
> 
> Log:
>   Partially implement the mysterious cons25 \e[x escape sequence.
>   
>   It seems the terminfo library on some systems (OS X, Linux) may emit the
>   sequence \e[x to reset to default attributes. Apart from using the
>   zero-command, this escape sequence allows many more operations, such as
>   setting ANSI colors. I don't see this used anywhere, so this should be
>   sufficient for now.
>   
>   This deficiency was spotted by the Debian GNU/kFreeBSD. They have their
>   own patch, which is slightly flawed in my opinion. I don't know why they
>   never reported this issue to us.

I'm not sure what happened with this specific patch, but as a general
plan they wish to push patches upstream, although it seems we've rejected
several of their diffs so far.  The full set of their patches are in their
svn repository at

http://svn.debian.org/wsvn/glibc-bsd/trunk/kfreebsd-8/debian/patches/

and are divided into three categories - changes that are already in our
tree now but were not in 8.1, patches they intend to send our way, and
patches that are not appropriate for FreeBSD or that we've rejected.

I'll see if I can find one of the GNU/kFreeBSD people willing to write
up a short summary for each of the patches they apply (and take the
thread to freebsd-hackers, if so).

-Ed

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 13:42:59 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F7F1106566B;
	Fri,  5 Nov 2010 13:42:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1AFB18FC12;
	Fri,  5 Nov 2010 13:42:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5Dgx23098557;
	Fri, 5 Nov 2010 13:42:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5DgwNr098546;
	Fri, 5 Nov 2010 13:42:58 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201011051342.oA5DgwNr098546@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 5 Nov 2010 13:42:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214835 - in head/sys: amd64/amd64 arm/arm i386/i386
	ia64/ia64 mips/mips pc98/pc98 powerpc/aim powerpc/booke
	sparc64/sparc64 sun4v/sun4v
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 13:42:59 -0000

Author: jhb
Date: Fri Nov  5 13:42:58 2010
New Revision: 214835
URL: http://svn.freebsd.org/changeset/base/214835

Log:
  Adjust the order of operations in spinlock_enter() and spinlock_exit() to
  work properly with single-stepping in a kernel debugger.  Specifically,
  these routines have always disabled interrupts before increasing the nesting
  count and restored the prior state of interrupts after decreasing the nesting
  count to avoid problems with a nested interrupt not disabling interrupts
  when acquiring a spin lock.  However, trap interrupts for single-stepping
  can still occur even when interrupts are disabled.  Now the saved state of
  interrupts is not saved in the thread until after interrupts have been
  disabled and the nesting count has been increased.  Similarly, the saved
  state from the thread cannot be read once the nesting count has been
  decreased to zero.  To fix this, use temporary variables to store interrupt
  state and shuffle it between the thread's MD area and the appropriate
  registers.
  
  In cooperation with:	bde
  MFC after:     1 month

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/arm/arm/machdep.c
  head/sys/i386/i386/machdep.c
  head/sys/ia64/ia64/machdep.c
  head/sys/mips/mips/machdep.c
  head/sys/pc98/pc98/machdep.c
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/booke/machdep.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/sun4v/sun4v/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/amd64/amd64/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -1762,11 +1762,15 @@ void
 spinlock_enter(void)
 {
 	struct thread *td;
+	register_t flags;
 
 	td = curthread;
-	if (td->td_md.md_spinlock_count == 0)
-		td->td_md.md_saved_flags = intr_disable();
-	td->td_md.md_spinlock_count++;
+	if (td->td_md.md_spinlock_count == 0) {
+		flags = intr_disable();
+		td->td_md.md_spinlock_count = 1;
+		td->td_md.md_saved_flags = flags;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -1774,12 +1778,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t flags;
 
 	td = curthread;
 	critical_exit();
+	flags = td->td_md.md_saved_flags;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		intr_restore(td->td_md.md_saved_flags);
+		intr_restore(flags);
 }
 
 /*

Modified: head/sys/arm/arm/machdep.c
==============================================================================
--- head/sys/arm/arm/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/arm/arm/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -493,11 +493,15 @@ void
 spinlock_enter(void)
 {
 	struct thread *td;
+	register_t cspr;
 
 	td = curthread;
-	if (td->td_md.md_spinlock_count == 0)
-		td->td_md.md_saved_cspr = disable_interrupts(I32_bit | F32_bit);
-	td->td_md.md_spinlock_count++;
+	if (td->td_md.md_spinlock_count == 0) {
+		cspr = disable_interrupts(I32_bit | F32_bit);
+		td->td_md.md_spinlock_count = 1;
+		td->td_md.md_saved_cspr = cspr;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -505,12 +509,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t cspr;
 
 	td = curthread;
 	critical_exit();
+	cspr = td->td_md.md_saved_cspr;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		restore_interrupts(td->td_md.md_saved_cspr);
+		restore_interrupts(cspr);
 }
 
 /*

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/i386/i386/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -2997,11 +2997,15 @@ void
 spinlock_enter(void)
 {
 	struct thread *td;
+	register_t flags;
 
 	td = curthread;
-	if (td->td_md.md_spinlock_count == 0)
-		td->td_md.md_saved_flags = intr_disable();
-	td->td_md.md_spinlock_count++;
+	if (td->td_md.md_spinlock_count == 0) {
+		flags = intr_disable();
+		td->td_md.md_spinlock_count = 1;
+		td->td_md.md_saved_flags = flags;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -3009,12 +3013,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t flags;
 
 	td = curthread;
 	critical_exit();
+	flags = td->td_md.md_saved_flags;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		intr_restore(td->td_md.md_saved_flags);
+		intr_restore(flags);
 }
 
 #if defined(I586_CPU) && !defined(NO_F00F_HACK)

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/ia64/ia64/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -513,11 +513,15 @@ void
 spinlock_enter(void)
 {
 	struct thread *td;
+	int intr;
 
 	td = curthread;
-	if (td->td_md.md_spinlock_count == 0)
-		td->td_md.md_saved_intr = intr_disable();
-	td->td_md.md_spinlock_count++;
+	if (td->td_md.md_spinlock_count == 0) {
+		intr = intr_disable();
+		td->td_md.md_spinlock_count = 1;
+		td->td_md.md_saved_intr = intr;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -525,12 +529,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	int intr;
 
 	td = curthread;
 	critical_exit();
+	intr = td->td_md.md_saved_intr;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		intr_restore(td->td_md.md_saved_intr);
+		intr_restore(intr);
 }
 
 void

Modified: head/sys/mips/mips/machdep.c
==============================================================================
--- head/sys/mips/mips/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/mips/mips/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -450,11 +450,15 @@ void
 spinlock_enter(void)
 {
 	struct thread *td;
+	register_t intr;
 
 	td = curthread;
-	if (td->td_md.md_spinlock_count == 0)
-		td->td_md.md_saved_intr = intr_disable();
-	td->td_md.md_spinlock_count++;
+	if (td->td_md.md_spinlock_count == 0) {
+		intr = intr_disable();
+		td->td_md.md_spinlock_count = 1;
+		td->td_md.md_saved_intr = intr;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -462,12 +466,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t intr;
 
 	td = curthread;
 	critical_exit();
+	intr = td->td_md.md_saved_intr;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		intr_restore(td->td_md.md_saved_intr);
+		intr_restore(intr);
 }
 
 /*

Modified: head/sys/pc98/pc98/machdep.c
==============================================================================
--- head/sys/pc98/pc98/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/pc98/pc98/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -2340,11 +2340,15 @@ void
 spinlock_enter(void)
 {
 	struct thread *td;
+	register_t flags;
 
 	td = curthread;
-	if (td->td_md.md_spinlock_count == 0)
-		td->td_md.md_saved_flags = intr_disable();
-	td->td_md.md_spinlock_count++;
+	if (td->td_md.md_spinlock_count == 0) {
+		flags = intr_disable();
+		td->td_md.md_spinlock_count = 1;
+		td->td_md.md_saved_flags = flags;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -2352,12 +2356,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t flags;
 
 	td = curthread;
 	critical_exit();
+	flags = td->td_md.md_saved_flags;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		intr_restore(td->td_md.md_saved_flags);
+		intr_restore(flags);
 }
 
 #if defined(I586_CPU) && !defined(NO_F00F_HACK)

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/powerpc/aim/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -751,11 +751,15 @@ void
 spinlock_enter(void)
 {
 	struct thread *td;
+	register_t msr;
 
 	td = curthread;
-	if (td->td_md.md_spinlock_count == 0)
-		td->td_md.md_saved_msr = intr_disable();
-	td->td_md.md_spinlock_count++;
+	if (td->td_md.md_spinlock_count == 0) {
+		msr = intr_disable();
+		td->td_md.md_spinlock_count = 1;
+		td->td_md.md_saved_msr = msr;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -763,12 +767,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t msr;
 
 	td = curthread;
 	critical_exit();
+	msr = td->td_md.md_saved_msr;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		intr_restore(td->td_md.md_saved_msr);
+		intr_restore(msr);
 }
 
 /*

Modified: head/sys/powerpc/booke/machdep.c
==============================================================================
--- head/sys/powerpc/booke/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/powerpc/booke/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -516,11 +516,15 @@ void
 spinlock_enter(void)
 {
 	struct thread *td;
+	register_t msr;
 
 	td = curthread;
-	if (td->td_md.md_spinlock_count == 0)
-		td->td_md.md_saved_msr = intr_disable();
-	td->td_md.md_spinlock_count++;
+	if (td->td_md.md_spinlock_count == 0) {
+		msr = intr_disable();
+		td->td_md.md_spinlock_count = 1;
+		td->td_md.md_saved_msr = msr;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -528,12 +532,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t msr;
 
 	td = curthread;
 	critical_exit();
+	msr = td->td_md.md_saved_msr;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		intr_restore(td->td_md.md_saved_msr);
+		intr_restore(msr);
 }
 
 /* Shutdown the CPU as much as possible. */

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/sparc64/sparc64/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -224,9 +224,10 @@ spinlock_enter(void)
 	if (td->td_md.md_spinlock_count == 0) {
 		pil = rdpr(pil);
 		wrpr(pil, 0, PIL_TICK);
+		td->td_md.md_spinlock_count = 1;
 		td->td_md.md_saved_pil = pil;
-	}
-	td->td_md.md_spinlock_count++;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -234,12 +235,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t pil;
 
 	td = curthread;
 	critical_exit();
+	pil = td->td_md.md_saved_pil;
 	td->td_md.md_spinlock_count--;
 	if (td->td_md.md_spinlock_count == 0)
-		wrpr(pil, td->td_md.md_saved_pil, 0);
+		wrpr(pil, pil, 0);
 }
 
 static phandle_t

Modified: head/sys/sun4v/sun4v/machdep.c
==============================================================================
--- head/sys/sun4v/sun4v/machdep.c	Fri Nov  5 11:31:39 2010	(r214834)
+++ head/sys/sun4v/sun4v/machdep.c	Fri Nov  5 13:42:58 2010	(r214835)
@@ -269,9 +269,10 @@ spinlock_enter(void)
 	td = curthread;
 	if (td->td_md.md_spinlock_count == 0) {
 		pil = intr_disable();
+		td->td_md.md_spinlock_count = 1;
 		td->td_md.md_saved_pil = pil;
-	}
-	td->td_md.md_spinlock_count++;
+	} else
+		td->td_md.md_spinlock_count++;
 	critical_enter();
 }
 
@@ -279,14 +280,14 @@ void
 spinlock_exit(void)
 {
 	struct thread *td;
+	register_t pil;
 
 	td = curthread;
 	critical_exit();
+	pil = td->td_md.md_saved_pil;
 	td->td_md.md_spinlock_count--;
-	if (td->td_md.md_spinlock_count == 0) {
-		intr_restore(td->td_md.md_saved_pil);
-	}
-
+	if (td->td_md.md_spinlock_count == 0)
+		intr_restore(pil);
 }
 
 unsigned

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 14:56:13 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0EC261065673;
	Fri,  5 Nov 2010 14:56:13 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au
	[211.29.132.184])
	by mx1.freebsd.org (Postfix) with ESMTP id 831818FC08;
	Fri,  5 Nov 2010 14:56:12 +0000 (UTC)
Received: from c122-107-112-122.carlnfd1.nsw.optusnet.com.au
	(c122-107-112-122.carlnfd1.nsw.optusnet.com.au [122.107.112.122])
	by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	oA5Eu8Cn016050
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 6 Nov 2010 01:56:10 +1100
Date: Sat, 6 Nov 2010 01:56:08 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Ed Schouten 
In-Reply-To: <201011050056.oA50uLk5078426@svn.freebsd.org>
Message-ID: <20101105231811.V1254@besplex.bde.org>
References: <201011050056.oA50uLk5078426@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214817 - head/sys/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 14:56:13 -0000

On Fri, 5 Nov 2010, Ed Schouten wrote:

> Log:
>  Partially implement the mysterious cons25 \e[x escape sequence.

CSI x is not mysterious.  It is from pccons in 386BSD (probably from
Net/2, since pccons is also in 4.4BSD).  I think it came from pc3
originally.  It is still in pccons in NetBSD, at least in 2005.

NetBSD pccons only supports CSI [0-3];*x, even in 2005.  I added CSI
[5-7];*x (set reverse video colors) to pccons in FreeBSD-1.  syscons
supported all these until recently.  Syscons also had the aliases
CSI =F/G/H/I, where F/G set normal video colors and H/I set reverse
video colors.  Now it only has F/G, and has lost its support for
setting reverse video colors.

I use CSI x in ~/.profile since it was more portable that CSI =F/G/H/I.
This broke when I downgraded to -current, so I now use the partial
workaround of setting reverse video colors in $TERMCAP:

%%%
case $TERM in
cons25)
# Broken in -current:
 	printf '\033[x\033[2;6x\033[1;0x\033[6;7x\033[5;4x'
# CSI 0x     reset to defaults
# CSI 2;6x   set ansi foreground cyan
#            default to ansi background black
# CSI 6;7x   set ansi reverse foreground white
# CSI 5;4x   set ansi reverse background blue
# Part that still works in -current:
 	printf '\033[=3F\033[=0G'
# CSI =3F    set ansi foreground cyan (not different color numbers)
# CSI =0G    set ansi background black
 	;;
linux)
# I don't remember what this does.  Probably less.
 	printf '\033[36;40m\033[1;4]\033[8]'
 	;;
esac
case $TERM in
cons25)
# Workaround for -current brokenness: set colors in termcap, and use better
# colors too.  This loses mainly the simple restore of defaults by CSI m,
# and by expanding the size of the escape sequences.
 	TERMCAP="$TERM:md=\E[1;37m:so=\E[37;44m:se=\E[39;49m:us=\E[1;33;44m:ue=\E[22;39;49m:tc=$TERM:"
 	;;
esac
%%%

The reasons for this fiddling like this with colors are:

(1) Reverse video that just reverses the colors tends to give a horrible
     combination of colors, since the best choices for foreground/background
     tend to be the worst choices when they are reversed.  Thus reverse
     video should normally be configured to not just reverse the colors,
     and there should be a way to control this.  The CSI [6-7]*x sequences
     and the CSI =*H/I provided a good way to do this.

(2) The colors selected for reverse video should not be undone by other
     color selections or by almost any escape sequence.  the CSI x
     sequences and CSI =F/G/H/I sequences work right for this.  They are
     not affected by the ANSI color escapes.  Of course, an ANSI color
     escape will change colors set by CSI x, but then on the next CSI m
     to normal or reverse (etc.) mode, the colors selected by CSI x will
     be restored.  Only a "hard" terminal reset should lose the settings
     of CSI x.  Hardware terminals are now rare, but ESC c is considered
     to be a hard reset and does undo CSI x.  You have to be careful not
     to use it.  cons25 may also have a "soft" reset but I don't remember
     what it is.  IIRC, ESC c is from vt100, and vt220 or vt320 had escape
     sequences for several levels of softer resets, some involving keeping
     color settings and others not.  Termcaps for vt100 mostly don't use
     ESC c since it really is a hard reset so it resets too much for most
     purposes.

(3) The ANSI color sequences (put in TERMCAP as above) don't work so well
     for this.  First you have to put them in TERMCAP and propagate this
     to many machines, instead of just writing a single setup sequence on
     the machine emulating a terminal.  Then they have to be written on
     ever change to/from reverse video/standout/underline.  I've noticed
     a couple of bugs involving the normal mode not being restored.
     Simpler CSI m sequences tend to restore the normal mode (if there
     is one) more reliably.

(4) To be complete, there would be a separate reverse color pair for
     every normal color pair (256 combinations even for only 8 colors),
     but configuring this would be too painful, and fixing 1 normal
     color pair and its corresponding reverse color pair works OK in
     practice.  Note that normal reverse video gives a different reverse
     pair for every normal pair, and this feature is lost by fixing the
     reverse pair.

(5) To be complete, standout, underline and blinking (all 2**N
     combinations of these) would be handled similarly, with a CSI x
     sequence to select the default colors used in all these modes.
     x86 displays have various deficiencies in being able to display
     all combinations of attributes simultaneously or at all, and syscons
     has too many hard-coded color choices for combinations that are
     not directly representable.  But configuring the general case would
     be too painful.  In the above, my TERMCAP color choices don't worry
     about this, so standout followed by underline would give the colors
     for just one of standout or underline depending on which order the
     escape sequences happen to be written in.  ORing together colors
     in their RGB or other representation would be worse.

>  It seems the terminfo library on some systems (OS X, Linux) may emit the
>  sequence \e[x to reset to default attributes. Apart from using the
>  zero-command, this escape sequence allows many more operations, such as
>  setting ANSI colors. I don't see this used anywhere, so this should be
>  sufficient for now.

Perhaps plain CSI x (\e[0x or \e[x) is used because it is a good or the
only "soft" reset.

Grepping in termcap.src didn't show many uses of CSI x.  Here it is for
pc3 (only the reset sequence):

% # The following is a version of the ibm-pc entry distributed with PC/IX,
% # (Interactive Systems' System 3 for the Big Blue), modified by Richard
% # McIntosh at UCB/CSM.  The :pt: and :uc: have been removed from the original,
% # (the former is untrue, and the latter failed under UCB/man); standout and
% # underline modes have been added.  Note: this entry describes the "native"
% # capabilities of the PC monochrome display, without ANY emulation; most
% # communications packages (but NOT PC/IX connect) do some kind of emulation.
% pc|ibmpc|ibm pc PC/IX:\
% 	...
% pc3|ibmpc3|IBM PC 386BSD Console:\
% 	...
% 	:op=\E[x:\
% 	...

cons25 is basically pc3 + sco cons.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 18:19:55 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 559D61065674;
	Fri,  5 Nov 2010 18:19:55 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 437408FC0C;
	Fri,  5 Nov 2010 18:19:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5IJti9005066;
	Fri, 5 Nov 2010 18:19:55 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5IJtk2005064;
	Fri, 5 Nov 2010 18:19:55 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201011051819.oA5IJtk2005064@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 5 Nov 2010 18:19:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214840 - head/sys/dev/re
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 18:19:55 -0000

Author: yongari
Date: Fri Nov  5 18:19:54 2010
New Revision: 214840
URL: http://svn.freebsd.org/changeset/base/214840

Log:
  Enable 64bit DMA addressing for RTL810xE/RTL8168/RTL8111 PCIe
  controllers. Some old PCI controllers may work with DAC but it was
  known to be buggy so 64bit DMA addressing is used only on PCIe
  controllers.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==============================================================================
--- head/sys/dev/re/if_re.c	Fri Nov  5 16:04:10 2010	(r214839)
+++ head/sys/dev/re/if_re.c	Fri Nov  5 18:19:54 2010	(r214840)
@@ -934,6 +934,7 @@ re_dma_map_addr(void *arg, bus_dma_segme
 static int
 re_allocmem(device_t dev, struct rl_softc *sc)
 {
+	bus_addr_t		lowaddr;
 	bus_size_t		rx_list_size, tx_list_size;
 	int			error;
 	int			i;
@@ -947,10 +948,13 @@ re_allocmem(device_t dev, struct rl_soft
 	 * register should be set. However some RealTek chips are known
 	 * to be buggy on DAC handling, therefore disable DAC by limiting
 	 * DMA address space to 32bit. PCIe variants of RealTek chips
-	 * may not have the limitation but I took safer path.
+	 * may not have the limitation.
 	 */
+	lowaddr = BUS_SPACE_MAXADDR;
+	if ((sc->rl_flags & RL_FLAG_PCIE) == 0)
+		lowaddr = BUS_SPACE_MAXADDR_32BIT;
 	error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0,
-	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+	    lowaddr, BUS_SPACE_MAXADDR, NULL, NULL,
 	    BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0,
 	    NULL, NULL, &sc->rl_parent_tag);
 	if (error) {

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 18:23:43 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 61252106566B;
	Fri,  5 Nov 2010 18:23:43 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4EF008FC15;
	Fri,  5 Nov 2010 18:23:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5INhgK005202;
	Fri, 5 Nov 2010 18:23:43 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5INhJI005200;
	Fri, 5 Nov 2010 18:23:43 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201011051823.oA5INhJI005200@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 5 Nov 2010 18:23:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214841 - head/sys/dev/re
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 18:23:43 -0000

Author: yongari
Date: Fri Nov  5 18:23:43 2010
New Revision: 214841
URL: http://svn.freebsd.org/changeset/base/214841

Log:
  Remove extra white spaces.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==============================================================================
--- head/sys/dev/re/if_re.c	Fri Nov  5 18:19:54 2010	(r214840)
+++ head/sys/dev/re/if_re.c	Fri Nov  5 18:23:43 2010	(r214841)
@@ -880,7 +880,7 @@ re_probe(device_t dev)
 	uint16_t		devid, vendor;
 	uint16_t		revid, sdevid;
 	int			i;
-	
+
 	vendor = pci_get_vendor(dev);
 	devid = pci_get_device(dev);
 	revid = pci_get_revid(dev);
@@ -1121,7 +1121,7 @@ re_attach(device_t dev)
 	/*
 	 * Prefer memory space register mapping over IO space.
 	 * Because RTL8169SC does not seem to work when memory mapping
-	 * is used always activate io mapping. 
+	 * is used always activate io mapping.
 	 */
 	if (devid == RT_DEVICEID_8169SC)
 		prefer_iomap = 1;
@@ -2111,7 +2111,7 @@ re_tick(void *xsc)
 	 * Reclaim transmitted frames here. Technically it is not
 	 * necessary to do here but it ensures periodic reclamation
 	 * regardless of Tx completion interrupt which seems to be
-	 * lost on PCIe based controllers under certain situations. 
+	 * lost on PCIe based controllers under certain situations.
 	 */
 	re_txeof(sc);
 	re_watchdog(sc);

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 18:24:50 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86F1A1065672;
	Fri,  5 Nov 2010 18:24:50 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 74CDF8FC18;
	Fri,  5 Nov 2010 18:24:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5IOo5r005261;
	Fri, 5 Nov 2010 18:24:50 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5IOoaT005259;
	Fri, 5 Nov 2010 18:24:50 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201011051824.oA5IOoaT005259@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 5 Nov 2010 18:24:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214842 - head/sys/dev/re
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 18:24:50 -0000

Author: yongari
Date: Fri Nov  5 18:24:50 2010
New Revision: 214842
URL: http://svn.freebsd.org/changeset/base/214842

Log:
  style(9).

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==============================================================================
--- head/sys/dev/re/if_re.c	Fri Nov  5 18:23:43 2010	(r214841)
+++ head/sys/dev/re/if_re.c	Fri Nov  5 18:24:50 2010	(r214842)
@@ -2020,9 +2020,9 @@ re_rxeof(struct rl_softc *sc, int *rx_np
 	if (rx_npktsp != NULL)
 		*rx_npktsp = rx_npkts;
 	if (maxpkt)
-		return(EAGAIN);
+		return (EAGAIN);
 
-	return(0);
+	return (0);
 }
 
 static void
@@ -2839,7 +2839,7 @@ re_ioctl(struct ifnet *ifp, u_long comma
 			if (ifr->ifr_reqcap & IFCAP_POLLING) {
 				error = ether_poll_register(re_poll, ifp);
 				if (error)
-					return(error);
+					return (error);
 				RL_LOCK(sc);
 				/* Disable interrupts */
 				CSR_WRITE_2(sc, RL_IMR, 0x0000);

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 19:12:48 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E98810656A5;
	Fri,  5 Nov 2010 19:12:48 +0000 (UTC)
	(envelope-from n_hibma@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 821EA8FC1B;
	Fri,  5 Nov 2010 19:12:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5JCmAs006494;
	Fri, 5 Nov 2010 19:12:48 GMT (envelope-from n_hibma@svn.freebsd.org)
Received: (from n_hibma@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5JCmJ2006473;
	Fri, 5 Nov 2010 19:12:48 GMT (envelope-from n_hibma@svn.freebsd.org)
Message-Id: <201011051912.oA5JCmJ2006473@svn.freebsd.org>
From: Nick Hibma 
Date: Fri, 5 Nov 2010 19:12:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214843 - in head/sys/dev/usb: net serial
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 19:12:48 -0000

Author: n_hibma
Date: Fri Nov  5 19:12:48 2010
New Revision: 214843
URL: http://svn.freebsd.org/changeset/base/214843

Log:
  Implement ucom_set_pnpinfo_usb() providing ttyname and port number
  information through devd. My E220 now produces the notification (1 line):
  
  	+u3g0 at bus=1 hubaddr=1 port=0 devaddr=2 interface=0 \
  	vendor=0x12d1 product=0x1003 devclass=0x00 devsubclass=0x00 \
  	sernum="" release=0x0000 intclass=0xff intsubclass=0xff \
  	ttyname=U0 ttyports=2 on uhub0
  
  Note: serial/ufoma and net/uhso still provide port number and tty name
  (uhso only) information through sysctls, which should now be removed.
  
  Reviewed by:	hpselasky

Modified:
  head/sys/dev/usb/net/uhso.c
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/serial/uark.c
  head/sys/dev/usb/serial/ubsa.c
  head/sys/dev/usb/serial/ubser.c
  head/sys/dev/usb/serial/uchcom.c
  head/sys/dev/usb/serial/ucycom.c
  head/sys/dev/usb/serial/ufoma.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/ugensa.c
  head/sys/dev/usb/serial/uipaq.c
  head/sys/dev/usb/serial/umct.c
  head/sys/dev/usb/serial/umodem.c
  head/sys/dev/usb/serial/umoscom.c
  head/sys/dev/usb/serial/uplcom.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h
  head/sys/dev/usb/serial/uslcom.c
  head/sys/dev/usb/serial/uvisor.c
  head/sys/dev/usb/serial/uvscom.c

Modified: head/sys/dev/usb/net/uhso.c
==============================================================================
--- head/sys/dev/usb/net/uhso.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/net/uhso.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -902,6 +902,7 @@ uhso_probe_iface(struct uhso_softc *sc, 
 				device_printf(sc->sc_dev, "ucom_attach failed\n");
 				return (ENXIO);
 			}
+			ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev);
 
 			mtx_lock(&sc->sc_mtx);
 			usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]);
@@ -920,6 +921,7 @@ uhso_probe_iface(struct uhso_softc *sc, 
 			device_printf(sc->sc_dev, "ucom_attach failed\n");
 			return (ENXIO);
 		}
+		ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev);
 	}
 	else {
 		UHSO_DPRINTF(0, "Unknown type %x\n", type);

Modified: head/sys/dev/usb/serial/u3g.c
==============================================================================
--- head/sys/dev/usb/serial/u3g.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/u3g.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -818,8 +818,10 @@ u3g_attach(device_t dev)
 		DPRINTF("ucom_attach failed\n");
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
 	device_printf(dev, "Found %u port%s.\n", sc->sc_numports,
 	    sc->sc_numports > 1 ? "s":"");
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/uark.c
==============================================================================
--- head/sys/dev/usb/serial/uark.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/uark.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -227,6 +227,8 @@ uark_attach(device_t dev)
 		DPRINTF("ucom_attach failed\n");
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);			/* success */
 
 detach:

Modified: head/sys/dev/usb/serial/ubsa.c
==============================================================================
--- head/sys/dev/usb/serial/ubsa.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/ubsa.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -331,6 +331,8 @@ ubsa_attach(device_t dev)
 		DPRINTF("ucom_attach failed\n");
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/ubser.c
==============================================================================
--- head/sys/dev/usb/serial/ubser.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/ubser.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -296,6 +296,7 @@ ubser_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
 
 	mtx_lock(&sc->sc_mtx);
 	usbd_xfer_set_stall(sc->sc_xfer[UBSER_BULK_DT_WR]);

Modified: head/sys/dev/usb/serial/uchcom.c
==============================================================================
--- head/sys/dev/usb/serial/uchcom.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/uchcom.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -354,6 +354,8 @@ uchcom_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/ucycom.c
==============================================================================
--- head/sys/dev/usb/serial/ucycom.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/ucycom.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -272,13 +272,15 @@ ucycom_attach(device_t dev)
 	}
 	error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
 	    &ucycom_callback, &sc->sc_mtx);
-
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	if (urd_ptr) {
 		free(urd_ptr, M_USBDEV);
 	}
+
 	return (0);			/* success */
 
 detach:

Modified: head/sys/dev/usb/serial/ufoma.c
==============================================================================
--- head/sys/dev/usb/serial/ufoma.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/ufoma.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -450,6 +450,8 @@ ufoma_attach(device_t dev)
 		DPRINTF("ucom_attach failed\n");
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	/*Sysctls*/
 	sctx = device_get_sysctl_ctx(dev);
 	soid = device_get_sysctl_tree(dev);

Modified: head/sys/dev/usb/serial/uftdi.c
==============================================================================
--- head/sys/dev/usb/serial/uftdi.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/uftdi.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -332,6 +332,8 @@ uftdi_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);			/* success */
 
 detach:

Modified: head/sys/dev/usb/serial/ugensa.c
==============================================================================
--- head/sys/dev/usb/serial/ugensa.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/ugensa.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -247,6 +247,8 @@ ugensa_attach(device_t dev)
 		DPRINTF("attach failed\n");
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);			/* success */
 
 detach:

Modified: head/sys/dev/usb/serial/uipaq.c
==============================================================================
--- head/sys/dev/usb/serial/uipaq.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/uipaq.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -1161,6 +1161,8 @@ uipaq_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/umct.c
==============================================================================
--- head/sys/dev/usb/serial/umct.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/umct.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -297,6 +297,8 @@ umct_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);			/* success */
 
 detach:

Modified: head/sys/dev/usb/serial/umodem.c
==============================================================================
--- head/sys/dev/usb/serial/umodem.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/umodem.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -389,6 +389,8 @@ umodem_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/umoscom.c
==============================================================================
--- head/sys/dev/usb/serial/umoscom.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/umoscom.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -338,6 +338,8 @@ umoscom_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/uplcom.c
==============================================================================
--- head/sys/dev/usb/serial/uplcom.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/uplcom.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -445,6 +445,8 @@ uplcom_attach(device_t dev)
 		device_printf(dev, "init failed\n");
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/usb_serial.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -185,6 +185,8 @@ static uint8_t ucom_bitmap[(UCOM_UNIT_MA
 static struct mtx ucom_bitmap_mtx;
 MTX_SYSINIT(ucom_bitmap_mtx, &ucom_bitmap_mtx, "ucom bitmap", MTX_DEF);
 
+#define UCOM_TTY_PREFIX		"U"
+
 /*
  * Mark a unit number (the X in cuaUX) as in use.
  *
@@ -320,11 +322,12 @@ ucom_attach_tty(struct ucom_super_softc 
 		/* Use default TTY name */
 		if (ssc->sc_subunits > 1) {
 			/* multiple modems in one */
-			snprintf(buf, sizeof(buf), "U%u.%u",
+			snprintf(buf, sizeof(buf), UCOM_TTY_PREFIX "%u.%u",
 			    ssc->sc_unit, sc->sc_subunit);
 		} else {
 			/* single modem */
-			snprintf(buf, sizeof(buf), "U%u", ssc->sc_unit);
+			snprintf(buf, sizeof(buf), UCOM_TTY_PREFIX "%u",
+			    ssc->sc_unit);
 		}
 	}
 	tty_makedev(tp, NULL, "%s", buf);
@@ -409,6 +412,24 @@ ucom_detach_tty(struct ucom_softc *sc)
 	cv_destroy(&sc->sc_cv);
 }
 
+void
+ucom_set_pnpinfo_usb(struct ucom_super_softc *ssc, device_t dev)
+{
+    char buf[64];
+    uint8_t iface_index;
+    struct usb_attach_arg *uaa;
+
+    snprintf(buf, sizeof(buf), "ttyname=%s%d ttyports=%d",
+	     UCOM_TTY_PREFIX, ssc->sc_unit, ssc->sc_subunits);
+
+    /* Store the PNP info in the first interface for the dev */
+    uaa = device_get_ivars(dev);
+    iface_index = uaa->info.bIfaceIndex;
+    
+    if (usbd_set_pnpinfo(uaa->device, iface_index, buf) != 0)
+	device_printf(dev, "Could not set PNP info\n");
+}
+
 static void
 ucom_queue_command(struct ucom_softc *sc,
     usb_proc_callback_t *fn, struct termios *pt,

Modified: head/sys/dev/usb/serial/usb_serial.h
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.h	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/usb_serial.h	Fri Nov  5 19:12:48 2010	(r214843)
@@ -193,6 +193,7 @@ int	ucom_attach(struct ucom_super_softc 
 	    struct ucom_softc *, uint32_t, void *,
 	    const struct ucom_callback *callback, struct mtx *);
 void	ucom_detach(struct ucom_super_softc *, struct ucom_softc *);
+void	ucom_set_pnpinfo_usb(struct ucom_super_softc *, device_t);
 void	ucom_status_change(struct ucom_softc *);
 uint8_t	ucom_get_data(struct ucom_softc *, struct usb_page_cache *,
 	    uint32_t, uint32_t, uint32_t *);

Modified: head/sys/dev/usb/serial/uslcom.c
==============================================================================
--- head/sys/dev/usb/serial/uslcom.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/uslcom.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -324,6 +324,8 @@ uslcom_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/uvisor.c
==============================================================================
--- head/sys/dev/usb/serial/uvisor.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/uvisor.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -347,6 +347,8 @@ uvisor_attach(device_t dev)
 		DPRINTF("ucom_attach failed\n");
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	return (0);
 
 detach:

Modified: head/sys/dev/usb/serial/uvscom.c
==============================================================================
--- head/sys/dev/usb/serial/uvscom.c	Fri Nov  5 18:24:50 2010	(r214842)
+++ head/sys/dev/usb/serial/uvscom.c	Fri Nov  5 19:12:48 2010	(r214843)
@@ -321,6 +321,8 @@ uvscom_attach(device_t dev)
 	if (error) {
 		goto detach;
 	}
+	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
 	/* start interrupt pipe */
 	mtx_lock(&sc->sc_mtx);
 	usbd_transfer_start(sc->sc_xfer[UVSCOM_INTR_DT_RD]);

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 19:26:55 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86F691065672;
	Fri,  5 Nov 2010 19:26:55 +0000 (UTC)
	(envelope-from nick@van-laarhoven.org)
Received: from cpsmtpb-ews10.kpnxchange.com (cpsmtpb-ews10.kpnxchange.com
	[213.75.39.15])
	by mx1.freebsd.org (Postfix) with ESMTP id 01CC18FC0C;
	Fri,  5 Nov 2010 19:26:54 +0000 (UTC)
Received: from cpbrm-ews33.kpnxchange.com ([10.94.84.164]) by
	cpsmtpb-ews10.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.4675); 
	Fri, 5 Nov 2010 20:14:49 +0100
Received: from CPSMTPM-EML109.kpnxchange.com ([195.121.3.13]) by
	cpbrm-ews33.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.4675); 
	Fri, 5 Nov 2010 20:14:48 +0100
Received: from uitsmijter.van-laarhoven.org ([81.207.207.222]) by
	CPSMTPM-EML109.kpnxchange.com with Microsoft
	SMTPSVC(7.0.6002.18222); Fri, 5 Nov 2010 20:14:47 +0100
Received: from hillary.van-laarhoven.org (Hillary.van-laarhoven.org
	[10.66.0.100]) (using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by uitsmijter.van-laarhoven.org (Postfix) with ESMTPSA id 691D64567;
	Fri,  5 Nov 2010 20:14:34 +0100 (CET)
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Nick Hibma 
In-Reply-To: <201011051912.oA5JCmJ2006473@svn.freebsd.org>
Date: Fri, 5 Nov 2010 20:14:33 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201011051912.oA5JCmJ2006473@svn.freebsd.org>
To: Nick Hibma 
X-Mailer: Apple Mail (2.1081)
X-Spam-Status: No, score=-15.4 required=5.0 tests=J_CHICKENPOX_83,
	UNPARSEABLE_RELAY,USER_IN_WHITELIST,USER_IN_WHITELIST_TO autolearn=no
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	uitsmijter.van-laarhoven.org
X-OriginalArrivalTime: 05 Nov 2010 19:14:48.0077 (UTC)
	FILETIME=[B69283D0:01CB7D1D]
X-RcptDomain: freebsd.org
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r214843 - in head/sys/dev/usb: net serial
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 19:26:55 -0000

Forgot to mention:

MFC:	2 weeks

On 5 Nov 2010, at 20:12, Nick Hibma wrote:

> Author: n_hibma
> Date: Fri Nov  5 19:12:48 2010
> New Revision: 214843
> URL: http://svn.freebsd.org/changeset/base/214843
>=20
> Log:
>  Implement ucom_set_pnpinfo_usb() providing ttyname and port number
>  information through devd. My E220 now produces the notification (1 =
line):
>=20
>  	+u3g0 at bus=3D1 hubaddr=3D1 port=3D0 devaddr=3D2 interface=3D0 =
\
>  	vendor=3D0x12d1 product=3D0x1003 devclass=3D0x00 =
devsubclass=3D0x00 \
>  	sernum=3D"" release=3D0x0000 intclass=3D0xff intsubclass=3D0xff =
\
>  	ttyname=3DU0 ttyports=3D2 on uhub0
>=20
>  Note: serial/ufoma and net/uhso still provide port number and tty =
name
>  (uhso only) information through sysctls, which should now be removed.
>=20
>  Reviewed by:	hpselasky
>=20
> Modified:
>  head/sys/dev/usb/net/uhso.c
>  head/sys/dev/usb/serial/u3g.c
>  head/sys/dev/usb/serial/uark.c
>  head/sys/dev/usb/serial/ubsa.c
>  head/sys/dev/usb/serial/ubser.c
>  head/sys/dev/usb/serial/uchcom.c
>  head/sys/dev/usb/serial/ucycom.c
>  head/sys/dev/usb/serial/ufoma.c
>  head/sys/dev/usb/serial/uftdi.c
>  head/sys/dev/usb/serial/ugensa.c
>  head/sys/dev/usb/serial/uipaq.c
>  head/sys/dev/usb/serial/umct.c
>  head/sys/dev/usb/serial/umodem.c
>  head/sys/dev/usb/serial/umoscom.c
>  head/sys/dev/usb/serial/uplcom.c
>  head/sys/dev/usb/serial/usb_serial.c
>  head/sys/dev/usb/serial/usb_serial.h
>  head/sys/dev/usb/serial/uslcom.c
>  head/sys/dev/usb/serial/uvisor.c
>  head/sys/dev/usb/serial/uvscom.c
>=20
> Modified: head/sys/dev/usb/net/uhso.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/net/uhso.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/net/uhso.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -902,6 +902,7 @@ uhso_probe_iface(struct uhso_softc *sc,=20
> 				device_printf(sc->sc_dev, "ucom_attach =
failed\n");
> 				return (ENXIO);
> 			}
> +			ucom_set_pnpinfo_usb(&sc->sc_super_ucom, =
sc->sc_dev);
>=20
> 			mtx_lock(&sc->sc_mtx);
> 			=
usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]);
> @@ -920,6 +921,7 @@ uhso_probe_iface(struct uhso_softc *sc,=20
> 			device_printf(sc->sc_dev, "ucom_attach =
failed\n");
> 			return (ENXIO);
> 		}
> +		ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev);
> 	}
> 	else {
> 		UHSO_DPRINTF(0, "Unknown type %x\n", type);
>=20
> Modified: head/sys/dev/usb/serial/u3g.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/u3g.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/u3g.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -818,8 +818,10 @@ u3g_attach(device_t dev)
> 		DPRINTF("ucom_attach failed\n");
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> 	device_printf(dev, "Found %u port%s.\n", sc->sc_numports,
> 	    sc->sc_numports > 1 ? "s":"");
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/uark.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/uark.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/uark.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -227,6 +227,8 @@ uark_attach(device_t dev)
> 		DPRINTF("ucom_attach failed\n");
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);			/* success */
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/ubsa.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/ubsa.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/ubsa.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -331,6 +331,8 @@ ubsa_attach(device_t dev)
> 		DPRINTF("ucom_attach failed\n");
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/ubser.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/ubser.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/ubser.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -296,6 +296,7 @@ ubser_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
>=20
> 	mtx_lock(&sc->sc_mtx);
> 	usbd_xfer_set_stall(sc->sc_xfer[UBSER_BULK_DT_WR]);
>=20
> Modified: head/sys/dev/usb/serial/uchcom.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/uchcom.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/uchcom.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -354,6 +354,8 @@ uchcom_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/ucycom.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/ucycom.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/ucycom.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -272,13 +272,15 @@ ucycom_attach(device_t dev)
> 	}
> 	error =3D ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
> 	    &ucycom_callback, &sc->sc_mtx);
> -
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	if (urd_ptr) {
> 		free(urd_ptr, M_USBDEV);
> 	}
> +
> 	return (0);			/* success */
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/ufoma.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/ufoma.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/ufoma.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -450,6 +450,8 @@ ufoma_attach(device_t dev)
> 		DPRINTF("ucom_attach failed\n");
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	/*Sysctls*/
> 	sctx =3D device_get_sysctl_ctx(dev);
> 	soid =3D device_get_sysctl_tree(dev);
>=20
> Modified: head/sys/dev/usb/serial/uftdi.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/uftdi.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/uftdi.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -332,6 +332,8 @@ uftdi_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);			/* success */
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/ugensa.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/ugensa.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/ugensa.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -247,6 +247,8 @@ ugensa_attach(device_t dev)
> 		DPRINTF("attach failed\n");
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);			/* success */
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/uipaq.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/uipaq.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/uipaq.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -1161,6 +1161,8 @@ uipaq_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/umct.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/umct.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/umct.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -297,6 +297,8 @@ umct_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);			/* success */
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/umodem.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/umodem.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/umodem.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -389,6 +389,8 @@ umodem_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/umoscom.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/umoscom.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/umoscom.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -338,6 +338,8 @@ umoscom_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/uplcom.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/uplcom.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/uplcom.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -445,6 +445,8 @@ uplcom_attach(device_t dev)
> 		device_printf(dev, "init failed\n");
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/usb_serial.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/usb_serial.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/usb_serial.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -185,6 +185,8 @@ static uint8_t ucom_bitmap[(UCOM_UNIT_MA
> static struct mtx ucom_bitmap_mtx;
> MTX_SYSINIT(ucom_bitmap_mtx, &ucom_bitmap_mtx, "ucom bitmap", =
MTX_DEF);
>=20
> +#define UCOM_TTY_PREFIX		"U"
> +
> /*
>  * Mark a unit number (the X in cuaUX) as in use.
>  *
> @@ -320,11 +322,12 @@ ucom_attach_tty(struct ucom_super_softc=20
> 		/* Use default TTY name */
> 		if (ssc->sc_subunits > 1) {
> 			/* multiple modems in one */
> -			snprintf(buf, sizeof(buf), "U%u.%u",
> +			snprintf(buf, sizeof(buf), UCOM_TTY_PREFIX =
"%u.%u",
> 			    ssc->sc_unit, sc->sc_subunit);
> 		} else {
> 			/* single modem */
> -			snprintf(buf, sizeof(buf), "U%u", ssc->sc_unit);
> +			snprintf(buf, sizeof(buf), UCOM_TTY_PREFIX "%u",
> +			    ssc->sc_unit);
> 		}
> 	}
> 	tty_makedev(tp, NULL, "%s", buf);
> @@ -409,6 +412,24 @@ ucom_detach_tty(struct ucom_softc *sc)
> 	cv_destroy(&sc->sc_cv);
> }
>=20
> +void
> +ucom_set_pnpinfo_usb(struct ucom_super_softc *ssc, device_t dev)
> +{
> +    char buf[64];
> +    uint8_t iface_index;
> +    struct usb_attach_arg *uaa;
> +
> +    snprintf(buf, sizeof(buf), "ttyname=3D%s%d ttyports=3D%d",
> +	     UCOM_TTY_PREFIX, ssc->sc_unit, ssc->sc_subunits);
> +
> +    /* Store the PNP info in the first interface for the dev */
> +    uaa =3D device_get_ivars(dev);
> +    iface_index =3D uaa->info.bIfaceIndex;
> +   =20
> +    if (usbd_set_pnpinfo(uaa->device, iface_index, buf) !=3D 0)
> +	device_printf(dev, "Could not set PNP info\n");
> +}
> +
> static void
> ucom_queue_command(struct ucom_softc *sc,
>     usb_proc_callback_t *fn, struct termios *pt,
>=20
> Modified: head/sys/dev/usb/serial/usb_serial.h
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/usb_serial.h	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/usb_serial.h	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -193,6 +193,7 @@ int	ucom_attach(struct ucom_super_softc=20
> 	    struct ucom_softc *, uint32_t, void *,
> 	    const struct ucom_callback *callback, struct mtx *);
> void	ucom_detach(struct ucom_super_softc *, struct ucom_softc *);
> +void	ucom_set_pnpinfo_usb(struct ucom_super_softc *, device_t);
> void	ucom_status_change(struct ucom_softc *);
> uint8_t	ucom_get_data(struct ucom_softc *, struct usb_page_cache =
*,
> 	    uint32_t, uint32_t, uint32_t *);
>=20
> Modified: head/sys/dev/usb/serial/uslcom.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/uslcom.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/uslcom.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -324,6 +324,8 @@ uslcom_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/uvisor.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/uvisor.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/uvisor.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -347,6 +347,8 @@ uvisor_attach(device_t dev)
> 		DPRINTF("ucom_attach failed\n");
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	return (0);
>=20
> detach:
>=20
> Modified: head/sys/dev/usb/serial/uvscom.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/dev/usb/serial/uvscom.c	Fri Nov  5 18:24:50 2010	=
(r214842)
> +++ head/sys/dev/usb/serial/uvscom.c	Fri Nov  5 19:12:48 2010	=
(r214843)
> @@ -321,6 +321,8 @@ uvscom_attach(device_t dev)
> 	if (error) {
> 		goto detach;
> 	}
> +	ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> 	/* start interrupt pipe */
> 	mtx_lock(&sc->sc_mtx);
> 	usbd_transfer_start(sc->sc_xfer[UVSCOM_INTR_DT_RD]);
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"


From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 19:28:01 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D913106566C;
	Fri,  5 Nov 2010 19:28:01 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C93328FC19;
	Fri,  5 Nov 2010 19:28:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5JS09R006864;
	Fri, 5 Nov 2010 19:28:00 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5JS0G8006861;
	Fri, 5 Nov 2010 19:28:00 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201011051928.oA5JS0G8006861@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 5 Nov 2010 19:28:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214844 - in head/sys: dev/re pci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 19:28:01 -0000

Author: yongari
Date: Fri Nov  5 19:28:00 2010
New Revision: 214844
URL: http://svn.freebsd.org/changeset/base/214844

Log:
  Add simple MAC statistics counter reading support. Unfortunately
  useful counters like rl_missed_pkts is 16 bits quantity which is
  too small to hold meaningful information happened in a second. This
  means driver should frequently read these counters in order not to
  lose accuracy and that approach is too inefficient in driver's
  view. Moreover it seems there is no way to trigger an interrupt to
  detect counter near-full or wraparound event as well as lacking
  clearing the MAC counters. Another limitation of reading the
  counters from RealTek controllers is lack of interrupt firing at
  the end of DMA cycle of MAC counter read request such that driver
  have to poll the end of the DMA which is a time consuming process
  as well as inefficient. The more severe issue of the MAC counter
  read request is it takes too long to complete the DMA. All these
  limitation made maintaining MAC counters in driver impractical. For
  now, just provide simple sysctl interface to trigger reading the
  MAC counters. These counters could be used to track down driver
  issues. Users can read MAC counters maintained in controller with
  the following command.
  #sysctl dev.re.0.stats=1
  
  While I'm here add check for validity of dma map and allocated
  memory before unloading/freeing them.
  
  Tested by:	rmacklem

Modified:
  head/sys/dev/re/if_re.c
  head/sys/pci/if_rlreg.h

Modified: head/sys/dev/re/if_re.c
==============================================================================
--- head/sys/dev/re/if_re.c	Fri Nov  5 19:12:48 2010	(r214843)
+++ head/sys/dev/re/if_re.c	Fri Nov  5 19:28:00 2010	(r214844)
@@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -281,6 +282,9 @@ static void re_clrwol		(struct rl_softc 
 static int re_diag		(struct rl_softc *);
 #endif
 
+static void re_add_sysctls	(struct rl_softc *);
+static int re_sysctl_stats	(SYSCTL_HANDLER_ARGS);
+
 static device_method_t re_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe,		re_probe),
@@ -1084,6 +1088,35 @@ re_allocmem(device_t dev, struct rl_soft
 		}
 	}
 
+	/* Create DMA map for statistics. */
+	error = bus_dma_tag_create(sc->rl_parent_tag, RL_DUMP_ALIGN, 0,
+	    BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
+	    sizeof(struct rl_stats), 1, sizeof(struct rl_stats), 0, NULL, NULL,
+	    &sc->rl_ldata.rl_stag);
+	if (error) {
+		device_printf(dev, "could not create statistics DMA tag\n");
+		return (error);
+	}
+	/* Allocate DMA'able memory for statistics. */
+	error = bus_dmamem_alloc(sc->rl_ldata.rl_stag,
+	    (void **)&sc->rl_ldata.rl_stats,
+	    BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO,
+	    &sc->rl_ldata.rl_smap);
+	if (error) {
+		device_printf(dev,
+		    "could not allocate statistics DMA memory\n");
+		return (error);
+	}
+	/* Load the map for statistics. */
+	sc->rl_ldata.rl_stats_addr = 0;
+	error = bus_dmamap_load(sc->rl_ldata.rl_stag, sc->rl_ldata.rl_smap,
+	    sc->rl_ldata.rl_stats, sizeof(struct rl_stats), re_dma_map_addr,
+	     &sc->rl_ldata.rl_stats_addr, BUS_DMA_NOWAIT);
+	if (error != 0 || sc->rl_ldata.rl_stats_addr == 0) {
+		device_printf(dev, "could not load statistics DMA memory\n");
+		return (ENOMEM);
+	}
+
 	return (0);
 }
 
@@ -1374,6 +1407,7 @@ re_attach(device_t dev)
 	error = re_allocmem(dev, sc);
 	if (error)
 		goto fail;
+	re_add_sysctls(sc);
 
 	ifp = sc->rl_ifp = if_alloc(IFT_ETHER);
 	if (ifp == NULL) {
@@ -1603,22 +1637,26 @@ re_detach(device_t dev)
 	/* Unload and free the RX DMA ring memory and map */
 
 	if (sc->rl_ldata.rl_rx_list_tag) {
-		bus_dmamap_unload(sc->rl_ldata.rl_rx_list_tag,
-		    sc->rl_ldata.rl_rx_list_map);
-		bus_dmamem_free(sc->rl_ldata.rl_rx_list_tag,
-		    sc->rl_ldata.rl_rx_list,
-		    sc->rl_ldata.rl_rx_list_map);
+		if (sc->rl_ldata.rl_rx_list_map)
+			bus_dmamap_unload(sc->rl_ldata.rl_rx_list_tag,
+			    sc->rl_ldata.rl_rx_list_map);
+		if (sc->rl_ldata.rl_rx_list_map && sc->rl_ldata.rl_rx_list)
+			bus_dmamem_free(sc->rl_ldata.rl_rx_list_tag,
+			    sc->rl_ldata.rl_rx_list,
+			    sc->rl_ldata.rl_rx_list_map);
 		bus_dma_tag_destroy(sc->rl_ldata.rl_rx_list_tag);
 	}
 
 	/* Unload and free the TX DMA ring memory and map */
 
 	if (sc->rl_ldata.rl_tx_list_tag) {
-		bus_dmamap_unload(sc->rl_ldata.rl_tx_list_tag,
-		    sc->rl_ldata.rl_tx_list_map);
-		bus_dmamem_free(sc->rl_ldata.rl_tx_list_tag,
-		    sc->rl_ldata.rl_tx_list,
-		    sc->rl_ldata.rl_tx_list_map);
+		if (sc->rl_ldata.rl_tx_list_map)
+			bus_dmamap_unload(sc->rl_ldata.rl_tx_list_tag,
+			    sc->rl_ldata.rl_tx_list_map);
+		if (sc->rl_ldata.rl_tx_list_map && sc->rl_ldata.rl_tx_list)
+			bus_dmamem_free(sc->rl_ldata.rl_tx_list_tag,
+			    sc->rl_ldata.rl_tx_list,
+			    sc->rl_ldata.rl_tx_list_map);
 		bus_dma_tag_destroy(sc->rl_ldata.rl_tx_list_tag);
 	}
 
@@ -1643,11 +1681,12 @@ re_detach(device_t dev)
 	/* Unload and free the stats buffer and map */
 
 	if (sc->rl_ldata.rl_stag) {
-		bus_dmamap_unload(sc->rl_ldata.rl_stag,
-		    sc->rl_ldata.rl_rx_list_map);
-		bus_dmamem_free(sc->rl_ldata.rl_stag,
-		    sc->rl_ldata.rl_stats,
-		    sc->rl_ldata.rl_smap);
+		if (sc->rl_ldata.rl_smap)
+			bus_dmamap_unload(sc->rl_ldata.rl_stag,
+			    sc->rl_ldata.rl_smap);
+		if (sc->rl_ldata.rl_smap && sc->rl_ldata.rl_stats)
+			bus_dmamem_free(sc->rl_ldata.rl_stag,
+			    sc->rl_ldata.rl_stats, sc->rl_ldata.rl_smap);
 		bus_dma_tag_destroy(sc->rl_ldata.rl_stag);
 	}
 
@@ -3185,3 +3224,88 @@ re_clrwol(struct rl_softc *sc)
 	v &= ~RL_CFG5_WOL_LANWAKE;
 	CSR_WRITE_1(sc, RL_CFG5, v);
 }
+
+static void
+re_add_sysctls(struct rl_softc *sc)
+{
+	struct sysctl_ctx_list	*ctx;
+	struct sysctl_oid_list	*children;
+
+	ctx = device_get_sysctl_ctx(sc->rl_dev);
+	children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev));
+
+	SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats",
+	    CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I",
+	    "Statistics Information");
+}
+
+static int
+re_sysctl_stats(SYSCTL_HANDLER_ARGS)
+{
+	struct rl_softc		*sc;
+	struct rl_stats		*stats;
+	int			error, i, result;
+
+	result = -1;
+	error = sysctl_handle_int(oidp, &result, 0, req);
+	if (error || req->newptr == NULL)
+		return (error);
+
+	if (result == 1) {
+		sc = (struct rl_softc *)arg1;
+		RL_LOCK(sc);
+		bus_dmamap_sync(sc->rl_ldata.rl_stag,
+		    sc->rl_ldata.rl_smap, BUS_DMASYNC_PREREAD);
+		CSR_WRITE_4(sc, RL_DUMPSTATS_HI,
+		    RL_ADDR_HI(sc->rl_ldata.rl_stats_addr));
+		CSR_WRITE_4(sc, RL_DUMPSTATS_LO,
+		    RL_ADDR_LO(sc->rl_ldata.rl_stats_addr));
+		CSR_WRITE_4(sc, RL_DUMPSTATS_LO,
+		    RL_ADDR_LO(sc->rl_ldata.rl_stats_addr |
+		    RL_DUMPSTATS_START));
+		for (i = RL_TIMEOUT; i > 0; i--) {
+			if ((CSR_READ_4(sc, RL_DUMPSTATS_LO) &
+			    RL_DUMPSTATS_START) == 0)
+				break;
+			DELAY(1000);
+		}
+		bus_dmamap_sync(sc->rl_ldata.rl_stag,
+		    sc->rl_ldata.rl_smap, BUS_DMASYNC_POSTREAD);
+		RL_UNLOCK(sc);
+		if (i == 0) {
+			device_printf(sc->rl_dev,
+			    "DUMP statistics request timedout\n");
+			return (ETIMEDOUT);
+		}
+		stats = sc->rl_ldata.rl_stats;
+		printf("%s statistics:\n", device_get_nameunit(sc->rl_dev));
+		printf("Tx frames : %ju\n",
+		    (uintmax_t)le64toh(stats->rl_tx_pkts));
+		printf("Rx frames : %ju\n",
+		    (uintmax_t)le64toh(stats->rl_rx_pkts));
+		printf("Tx errors : %ju\n",
+		    (uintmax_t)le64toh(stats->rl_tx_errs));
+		printf("Rx errors : %u\n",
+		    le32toh(stats->rl_rx_errs));
+		printf("Rx missed frames : %u\n",
+		    (uint32_t)le16toh(stats->rl_missed_pkts));
+		printf("Rx frame alignment errs : %u\n",
+		    (uint32_t)le16toh(stats->rl_rx_framealign_errs));
+		printf("Tx single collisions : %u\n",
+		    le32toh(stats->rl_tx_onecoll));
+		printf("Tx multiple collisions : %u\n",
+		    le32toh(stats->rl_tx_multicolls));
+		printf("Rx unicast frames : %ju\n",
+		    (uintmax_t)le64toh(stats->rl_rx_ucasts));
+		printf("Rx broadcast frames : %ju\n",
+		    (uintmax_t)le64toh(stats->rl_rx_bcasts));
+		printf("Rx multicast frames : %u\n",
+		    le32toh(stats->rl_rx_mcasts));
+		printf("Tx aborts : %u\n",
+		    (uint32_t)le16toh(stats->rl_tx_aborts));
+		printf("Tx underruns : %u\n",
+		    (uint32_t)le16toh(stats->rl_rx_underruns));
+	}
+
+	return (error);
+}

Modified: head/sys/pci/if_rlreg.h
==============================================================================
--- head/sys/pci/if_rlreg.h	Fri Nov  5 19:12:48 2010	(r214843)
+++ head/sys/pci/if_rlreg.h	Fri Nov  5 19:28:00 2010	(r214844)
@@ -723,19 +723,16 @@ struct rl_desc {
  * Statistics counter structure (8139C+ and 8169 only)
  */
 struct rl_stats {
-	uint32_t		rl_tx_pkts_lo;
-	uint32_t		rl_tx_pkts_hi;
-	uint32_t		rl_tx_errs_lo;
-	uint32_t		rl_tx_errs_hi;
-	uint32_t		rl_tx_errs;
+	uint64_t		rl_tx_pkts;
+	uint64_t		rl_rx_pkts;
+	uint64_t		rl_tx_errs;
+	uint32_t		rl_rx_errs;
 	uint16_t		rl_missed_pkts;
 	uint16_t		rl_rx_framealign_errs;
 	uint32_t		rl_tx_onecoll;
 	uint32_t		rl_tx_multicolls;
-	uint32_t		rl_rx_ucasts_hi;
-	uint32_t		rl_rx_ucasts_lo;
-	uint32_t		rl_rx_bcasts_lo;
-	uint32_t		rl_rx_bcasts_hi;
+	uint64_t		rl_rx_ucasts;
+	uint64_t		rl_rx_bcasts;
 	uint32_t		rl_rx_mcasts;
 	uint16_t		rl_tx_aborts;
 	uint16_t		rl_rx_underruns;
@@ -769,6 +766,7 @@ struct rl_stats {
 #define	RL_NTXSEGS		32
 
 #define RL_RING_ALIGN		256
+#define RL_DUMP_ALIGN		64
 #define RL_IFQ_MAXLEN		512
 #define RL_TX_DESC_NXT(sc,x)	((x + 1) & ((sc)->rl_ldata.rl_tx_desc_cnt - 1))
 #define RL_TX_DESC_PRV(sc,x)	((x - 1) & ((sc)->rl_ldata.rl_tx_desc_cnt - 1))

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 19:38:29 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1433C106566C;
	Fri,  5 Nov 2010 19:38:29 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 026008FC08;
	Fri,  5 Nov 2010 19:38:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5JcSQA007160;
	Fri, 5 Nov 2010 19:38:28 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5JcS6T007158;
	Fri, 5 Nov 2010 19:38:28 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201011051938.oA5JcS6T007158@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 5 Nov 2010 19:38:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214846 - head/sys/dev/xl
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 19:38:29 -0000

Author: marius
Date: Fri Nov  5 19:38:28 2010
New Revision: 214846
URL: http://svn.freebsd.org/changeset/base/214846

Log:
  Correct an inverted check in r213893.

Modified:
  head/sys/dev/xl/if_xl.c

Modified: head/sys/dev/xl/if_xl.c
==============================================================================
--- head/sys/dev/xl/if_xl.c	Fri Nov  5 19:30:30 2010	(r214845)
+++ head/sys/dev/xl/if_xl.c	Fri Nov  5 19:38:28 2010	(r214846)
@@ -1461,7 +1461,7 @@ xl_attach(device_t dev)
 		 * control registers at all MII addresses.
 		 */
 		phy = MII_PHY_ANY;
-		if ((sc->xl_flags & XL_FLAG_PHYOK) != 0)
+		if ((sc->xl_flags & XL_FLAG_PHYOK) == 0)
 			phy = 24;
 		error = mii_attach(dev, &sc->xl_miibus, ifp, xl_ifmedia_upd,
 		    xl_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0);

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 19:50:09 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D99EB1065670;
	Fri,  5 Nov 2010 19:50:09 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C727D8FC19;
	Fri,  5 Nov 2010 19:50:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5Jo9lJ007457;
	Fri, 5 Nov 2010 19:50:09 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5Jo9nt007455;
	Fri, 5 Nov 2010 19:50:09 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201011051950.oA5Jo9nt007455@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 5 Nov 2010 19:50:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214848 - head/sys/dev/acpica
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 19:50:09 -0000

Author: jkim
Date: Fri Nov  5 19:50:09 2010
New Revision: 214848
URL: http://svn.freebsd.org/changeset/base/214848

Log:
  Fix a use-after-free bug for extended IRQ resource[1].  When _PRS buffer is
  copied as a template for _SRS, a string pointer for descriptor name is also
  copied and it becomes stale as soon as it gets de-allocated[2].  Now _CRS is
  used as a template for _SRS as ACPI specification suggests if it is usable.
  The template from _PRS is still utilized but only when _CRS is not available
  or broken.  To avoid use-after-free the problem in this case, however, only
  mandatory fields are copied, optional data is removed, and structure length
  is adjusted accordingly.
  
  Reported by:	hps[1]
  Analyzed by:	avg[2]
  Tested by:	hps

Modified:
  head/sys/dev/acpica/acpi_pci_link.c

Modified: head/sys/dev/acpica/acpi_pci_link.c
==============================================================================
--- head/sys/dev/acpica/acpi_pci_link.c	Fri Nov  5 19:40:27 2010	(r214847)
+++ head/sys/dev/acpica/acpi_pci_link.c	Fri Nov  5 19:50:09 2010	(r214848)
@@ -268,6 +268,7 @@ link_add_crs(ACPI_RESOURCE *res, void *c
 static ACPI_STATUS
 link_add_prs(ACPI_RESOURCE *res, void *context)
 {
+	ACPI_RESOURCE *tmp;
 	struct link_res_request *req;
 	struct link *link;
 	UINT8 *irqs = NULL;
@@ -321,12 +322,23 @@ link_add_prs(ACPI_RESOURCE *res, void *c
 		 * Stash a copy of the resource for later use when doing
 		 * _SRS.
 		 */
-		bcopy(res, &link->l_prs_template, sizeof(ACPI_RESOURCE));
+		tmp = &link->l_prs_template;
 		if (is_ext_irq) {
+			bcopy(res, tmp, ACPI_RS_SIZE(tmp->Data.ExtendedIrq));
+
+			/*
+			 * XXX acpi_AppendBufferResource() cannot handle
+			 * optional data.
+			 */
+			bzero(&tmp->Data.ExtendedIrq.ResourceSource,
+			    sizeof(tmp->Data.ExtendedIrq.ResourceSource));
+			tmp->Length = ACPI_RS_SIZE(tmp->Data.ExtendedIrq);
+
 			link->l_num_irqs =
 			    res->Data.ExtendedIrq.InterruptCount;
 			ext_irqs = res->Data.ExtendedIrq.Interrupts;
 		} else {
+			bcopy(res, tmp, ACPI_RS_SIZE(tmp->Data.Irq));
 			link->l_num_irqs = res->Data.Irq.InterruptCount;
 			irqs = res->Data.Irq.Interrupts;
 		}
@@ -688,18 +700,17 @@ acpi_pci_link_add_reference(device_t dev
 static ACPI_STATUS
 acpi_pci_link_srs_from_crs(struct acpi_pci_link_softc *sc, ACPI_BUFFER *srsbuf)
 {
-	ACPI_RESOURCE *resource, *end, newres, *resptr;
-	ACPI_BUFFER crsbuf;
+	ACPI_RESOURCE *end, *res;
 	ACPI_STATUS status;
 	struct link *link;
 	int i, in_dpf;
 
 	/* Fetch the _CRS. */
 	ACPI_SERIAL_ASSERT(pci_link);
-	crsbuf.Pointer = NULL;
-	crsbuf.Length = ACPI_ALLOCATE_BUFFER;
-	status = AcpiGetCurrentResources(acpi_get_handle(sc->pl_dev), &crsbuf);
-	if (ACPI_SUCCESS(status) && crsbuf.Pointer == NULL)
+	srsbuf->Pointer = NULL;
+	srsbuf->Length = ACPI_ALLOCATE_BUFFER;
+	status = AcpiGetCurrentResources(acpi_get_handle(sc->pl_dev), srsbuf);
+	if (ACPI_SUCCESS(status) && srsbuf->Pointer == NULL)
 		status = AE_NO_MEMORY;
 	if (ACPI_FAILURE(status)) {
 		if (bootverbose)
@@ -710,14 +721,13 @@ acpi_pci_link_srs_from_crs(struct acpi_p
 	}
 
 	/* Fill in IRQ resources via link structures. */
-	srsbuf->Pointer = NULL;
 	link = sc->pl_links;
 	i = 0;
 	in_dpf = DPF_OUTSIDE;
-	resource = (ACPI_RESOURCE *)crsbuf.Pointer;
-	end = (ACPI_RESOURCE *)((char *)crsbuf.Pointer + crsbuf.Length);
+	res = (ACPI_RESOURCE *)srsbuf->Pointer;
+	end = (ACPI_RESOURCE *)((char *)srsbuf->Pointer + srsbuf->Length);
 	for (;;) {
-		switch (resource->Type) {
+		switch (res->Type) {
 		case ACPI_RESOURCE_TYPE_START_DEPENDENT:
 			switch (in_dpf) {
 			case DPF_OUTSIDE:
@@ -731,67 +741,44 @@ acpi_pci_link_srs_from_crs(struct acpi_p
 				    __func__);
 				break;
 			}
-			resptr = NULL;
 			break;
 		case ACPI_RESOURCE_TYPE_END_DEPENDENT:
 			/* We are finished with DPF parsing. */
 			KASSERT(in_dpf != DPF_OUTSIDE,
 			    ("%s: end dpf when not parsing a dpf", __func__));
 			in_dpf = DPF_OUTSIDE;
-			resptr = NULL;
 			break;
 		case ACPI_RESOURCE_TYPE_IRQ:
 			MPASS(i < sc->pl_num_links);
-			MPASS(link->l_prs_template.Type == ACPI_RESOURCE_TYPE_IRQ);
-			newres = link->l_prs_template;
-			resptr = &newres;
-			resptr->Data.Irq.InterruptCount = 1;
+			res->Data.Irq.InterruptCount = 1;
 			if (PCI_INTERRUPT_VALID(link->l_irq)) {
 				KASSERT(link->l_irq < NUM_ISA_INTERRUPTS,
 		("%s: can't put non-ISA IRQ %d in legacy IRQ resource type",
 				    __func__, link->l_irq));
-				resptr->Data.Irq.Interrupts[0] = link->l_irq;
+				res->Data.Irq.Interrupts[0] = link->l_irq;
 			} else
-				resptr->Data.Irq.Interrupts[0] = 0;
+				res->Data.Irq.Interrupts[0] = 0;
 			link++;
 			i++;
 			break;
 		case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
 			MPASS(i < sc->pl_num_links);
-			MPASS(link->l_prs_template.Type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ);
-			newres = link->l_prs_template;
-			resptr = &newres;
-			resptr->Data.ExtendedIrq.InterruptCount = 1;
+			res->Data.ExtendedIrq.InterruptCount = 1;
 			if (PCI_INTERRUPT_VALID(link->l_irq))
-				resptr->Data.ExtendedIrq.Interrupts[0] =
+				res->Data.ExtendedIrq.Interrupts[0] =
 				    link->l_irq;
 			else
-				resptr->Data.ExtendedIrq.Interrupts[0] = 0;
+				res->Data.ExtendedIrq.Interrupts[0] = 0;
 			link++;
 			i++;
 			break;
-		default:
-			resptr = resource;
-		}
-		if (resptr != NULL) {
-			status = acpi_AppendBufferResource(srsbuf, resptr);
-			if (ACPI_FAILURE(status)) {
-				device_printf(sc->pl_dev,
-				    "Unable to build resources: %s\n",
-				    AcpiFormatException(status));
-				if (srsbuf->Pointer != NULL)
-					AcpiOsFree(srsbuf->Pointer);
-				AcpiOsFree(crsbuf.Pointer);
-				return (status);
-			}
 		}
-		if (resource->Type == ACPI_RESOURCE_TYPE_END_TAG)
+		if (res->Type == ACPI_RESOURCE_TYPE_END_TAG)
 			break;
-		resource = ACPI_NEXT_RESOURCE(resource);
-		if (resource >= end)
+		res = ACPI_NEXT_RESOURCE(res);
+		if (res >= end)
 			break;
 	}
-	AcpiOsFree(crsbuf.Pointer);
 	return (AE_OK);
 }
 
@@ -811,10 +798,11 @@ acpi_pci_link_srs_from_links(struct acpi
 
 		/* Add a new IRQ resource from each link. */
 		link = &sc->pl_links[i];
-		newres = link->l_prs_template;
 		if (newres.Type == ACPI_RESOURCE_TYPE_IRQ) {
 
 			/* Build an IRQ resource. */
+			bcopy(&link->l_prs_template, &newres,
+			    ACPI_RS_SIZE(newres.Data.Irq));
 			newres.Data.Irq.InterruptCount = 1;
 			if (PCI_INTERRUPT_VALID(link->l_irq)) {
 				KASSERT(link->l_irq < NUM_ISA_INTERRUPTS,
@@ -826,6 +814,8 @@ acpi_pci_link_srs_from_links(struct acpi
 		} else {
 
 			/* Build an ExtIRQ resuorce. */
+			bcopy(&link->l_prs_template, &newres,
+			    ACPI_RS_SIZE(newres.Data.ExtendedIrq));
 			newres.Data.ExtendedIrq.InterruptCount = 1;
 			if (PCI_INTERRUPT_VALID(link->l_irq))
 				newres.Data.ExtendedIrq.Interrupts[0] =

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 20:24:26 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82E6F106566C;
	Fri,  5 Nov 2010 20:24:26 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 717308FC12;
	Fri,  5 Nov 2010 20:24:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5KOQhe008222;
	Fri, 5 Nov 2010 20:24:26 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5KOQbV008220;
	Fri, 5 Nov 2010 20:24:26 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201011052024.oA5KOQbV008220@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 5 Nov 2010 20:24:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214849 - head/sys/dev/acpica
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 20:24:26 -0000

Author: jkim
Date: Fri Nov  5 20:24:26 2010
New Revision: 214849
URL: http://svn.freebsd.org/changeset/base/214849

Log:
  Add a forgotten change from the previous commit.

Modified:
  head/sys/dev/acpica/acpi_pci_link.c

Modified: head/sys/dev/acpica/acpi_pci_link.c
==============================================================================
--- head/sys/dev/acpica/acpi_pci_link.c	Fri Nov  5 19:50:09 2010	(r214848)
+++ head/sys/dev/acpica/acpi_pci_link.c	Fri Nov  5 20:24:26 2010	(r214849)
@@ -798,7 +798,7 @@ acpi_pci_link_srs_from_links(struct acpi
 
 		/* Add a new IRQ resource from each link. */
 		link = &sc->pl_links[i];
-		if (newres.Type == ACPI_RESOURCE_TYPE_IRQ) {
+		if (link->l_prs_template.Type == ACPI_RESOURCE_TYPE_IRQ) {
 
 			/* Build an IRQ resource. */
 			bcopy(&link->l_prs_template, &newres,

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 21:13:16 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE3CD1065672;
	Fri,  5 Nov 2010 21:13:16 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DCC8B8FC16;
	Fri,  5 Nov 2010 21:13:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5LDGLa009416;
	Fri, 5 Nov 2010 21:13:16 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5LDGxH009414;
	Fri, 5 Nov 2010 21:13:16 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201011052113.oA5LDGxH009414@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 5 Nov 2010 21:13:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214851 - head/sys/nfsserver
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 21:13:17 -0000

Author: kib
Date: Fri Nov  5 21:13:16 2010
New Revision: 214851
URL: http://svn.freebsd.org/changeset/base/214851

Log:
  Fix a bug in r214049. The nvp == vp case shall be handled specially
  only for !usevget case. If VFS_VGET is working, the vnode shared lock
  is obtained recursively and vput() shall be done, not vunref().
  
  Submitted by:	rmacklem
  Tested by:	Josh Carroll 
  MFC after:	3 days

Modified:
  head/sys/nfsserver/nfs_serv.c

Modified: head/sys/nfsserver/nfs_serv.c
==============================================================================
--- head/sys/nfsserver/nfs_serv.c	Fri Nov  5 20:58:18 2010	(r214850)
+++ head/sys/nfsserver/nfs_serv.c	Fri Nov  5 21:13:16 2010	(r214851)
@@ -3252,7 +3252,7 @@ again:
 			nfhp->fh_fsid = nvp->v_mount->mnt_stat.f_fsid;
 			if ((error1 = VOP_VPTOFH(nvp, &nfhp->fh_fid)) == 0)
 				error1 = VOP_GETATTR(nvp, vap, cred);
-			if (vp == nvp)
+			if (!usevget && vp == nvp)
 				vunref(nvp);
 			else
 				vput(nvp);

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 21:17:56 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 303801065673;
	Fri,  5 Nov 2010 21:17:56 +0000 (UTC)
	(envelope-from n_hibma@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E6158FC1B;
	Fri,  5 Nov 2010 21:17:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5LHt2v009551;
	Fri, 5 Nov 2010 21:17:55 GMT (envelope-from n_hibma@svn.freebsd.org)
Received: (from n_hibma@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5LHtnH009548;
	Fri, 5 Nov 2010 21:17:55 GMT (envelope-from n_hibma@svn.freebsd.org)
Message-Id: <201011052117.oA5LHtnH009548@svn.freebsd.org>
From: Nick Hibma 
Date: Fri, 5 Nov 2010 21:17:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214852 - in head/sys/dev/usb: . serial
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 21:17:56 -0000

Author: n_hibma
Date: Fri Nov  5 21:17:55 2010
New Revision: 214852
URL: http://svn.freebsd.org/changeset/base/214852

Log:
  Bugfix: In rev 213509 Alexander committed a duplicate ID for ZTE STOR
  based devices (QUALCOMMINC 0x2000). He made it use SCSI eject instead of
  ZTE STOR eject. This prevented my ZTE MF626 dongle from switching.
  
  - Apply both eject methods for ZTE STOR based devices. Works on my as
    well as mav's device.
  - Remove the duplicate.
  - Sort the usbdevs entries for Qualcomm so this won't happen again.
  - Add bootverbose message displaying the fact that we are ejecting (and
    how).
  
  Reviewed by:	mav
  MFC after:	2 weeks

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==============================================================================
--- head/sys/dev/usb/serial/u3g.c	Fri Nov  5 21:13:16 2010	(r214851)
+++ head/sys/dev/usb/serial/u3g.c	Fri Nov  5 21:17:55 2010	(r214852)
@@ -411,7 +411,6 @@ static const struct usb_device_id u3g_de
 	U3G_DEV(QUALCOMMINC, E0078, 0),
 	U3G_DEV(QUALCOMMINC, E0082, 0),
 	U3G_DEV(QUALCOMMINC, E0086, 0),
-	U3G_DEV(QUALCOMMINC, E2000, U3GINIT_SCSIEJECT),
 	U3G_DEV(QUALCOMMINC, E2002, 0),
 	U3G_DEV(QUALCOMMINC, E2003, 0),
 	U3G_DEV(QUALCOMMINC, MF626, 0),
@@ -655,6 +654,12 @@ u3g_test_autoinst(void *arg, struct usb_
 	if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa))
 		return;		/* no device match */
 
+	if (bootverbose) {
+		printf("Ejecting 0x%04x:0x%04x using method %ld\n",
+		       uaa->info.idVendor, uaa->info.idProduct,
+		       USB_GET_DRIVER_INFO(uaa));
+	}
+
 	switch (USB_GET_DRIVER_INFO(uaa)) {
 		case U3GINIT_HUAWEI:
 			error = u3g_huawei_init(udev);
@@ -669,7 +674,8 @@ u3g_test_autoinst(void *arg, struct usb_
 			error = usb_msc_eject(udev, 0, MSC_EJECT_REZERO);
 			break;
 		case U3GINIT_ZTESTOR:
-			error = usb_msc_eject(udev, 0, MSC_EJECT_ZTESTOR);
+			error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT);
+			error |= usb_msc_eject(udev, 0, MSC_EJECT_ZTESTOR);
 			break;
 		case U3GINIT_CMOTECH:
 			error = usb_msc_eject(udev, 0, MSC_EJECT_CMOTECH);

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Fri Nov  5 21:13:16 2010	(r214851)
+++ head/sys/dev/usb/usbdevs	Fri Nov  5 21:17:55 2010	(r214852)
@@ -2612,15 +2612,11 @@ product QISDA H20_2		0x4519	3G modem
 
 /* Qualcomm products */
 product QUALCOMM CDMA_MSM	0x6000	CDMA Technologies MSM phone
+product QUALCOMM2 MF330		0x6613	MF330
 product QUALCOMM2 RWT_FCT	0x3100	RWT FCT-CDMA 2000 1xRTT modem
 product QUALCOMM2 CDMA_MSM	0x3196	CDMA Technologies MSM modem
 product QUALCOMM2 AC8700	0x6000	AC8700
-product QUALCOMM2 MF330		0x6613	MF330
 product QUALCOMMINC CDMA_MSM	0x0001	CDMA Technologies MSM modem
-product QUALCOMMINC ZTE_STOR	0x2000	USB ZTE Storage
-product QUALCOMMINC AC8710	0xfff1	3G modem
-product QUALCOMMINC AC2726	0xfff5	3G modem
-product QUALCOMMINC AC8700	0xfffe	CDMA 1xEVDO USB modem
 product QUALCOMMINC E0002	0x0002	3G modem
 product QUALCOMMINC E0003	0x0003	3G modem
 product QUALCOMMINC E0004	0x0004	3G modem
@@ -2686,9 +2682,12 @@ product QUALCOMMINC E0076	0x0076	3G mode
 product QUALCOMMINC E0078	0x0078	3G modem
 product QUALCOMMINC E0082	0x0082	3G modem
 product QUALCOMMINC E0086	0x0086	3G modem
-product QUALCOMMINC E2000	0x2000	3G modem
+product QUALCOMMINC ZTE_STOR	0x2000	USB ZTE Storage
 product QUALCOMMINC E2002	0x2002	3G modem
 product QUALCOMMINC E2003	0x2003	3G modem
+product QUALCOMMINC AC8710	0xfff1	3G modem
+product QUALCOMMINC AC2726	0xfff5	3G modem
+product QUALCOMMINC AC8700	0xfffe	CDMA 1xEVDO USB modem
 
 /* Quanta products */
 product QUANTA RW6815_1		0x00ce	HP iPAQ rw6815

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 21:47:59 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CF3E106566C;
	Fri,  5 Nov 2010 21:47:59 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B2D78FC13;
	Fri,  5 Nov 2010 21:47:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5LlxTe010162;
	Fri, 5 Nov 2010 21:47:59 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5Llxmc010160;
	Fri, 5 Nov 2010 21:47:59 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201011052147.oA5Llxmc010160@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 5 Nov 2010 21:47:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214853 - head/tools/regression/bin/sh/builtins
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 21:47:59 -0000

Author: jilles
Date: Fri Nov  5 21:47:58 2010
New Revision: 214853
URL: http://svn.freebsd.org/changeset/base/214853

Log:
  sh: Add simple tests for printf.
  
  These are not meant as a replacement for tools/regression/usr.bin/printf/*
  but to detect errors specific to making it a shell builtin.

Added:
  head/tools/regression/bin/sh/builtins/printf1.0   (contents, props changed)
  head/tools/regression/bin/sh/builtins/printf2.0   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/printf1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/printf1.0	Fri Nov  5 21:47:58 2010	(r214853)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+[ "$(printf '%c\0%s%d' x '\' 010 | tr '\0' Z)" = 'xZ\8' ]

Added: head/tools/regression/bin/sh/builtins/printf2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/printf2.0	Fri Nov  5 21:47:58 2010	(r214853)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+[ "$(printf '%cZ%s%d' x '\' 010)" = 'xZ\8' ]

From owner-svn-src-head@FreeBSD.ORG  Fri Nov  5 22:18:10 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 071EE1065672;
	Fri,  5 Nov 2010 22:18:10 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E95298FC18;
	Fri,  5 Nov 2010 22:18:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA5MI9vX010849;
	Fri, 5 Nov 2010 22:18:09 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA5MI9MR010847;
	Fri, 5 Nov 2010 22:18:09 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201011052218.oA5MI9MR010847@svn.freebsd.org>
From: Xin LI 
Date: Fri, 5 Nov 2010 22:18:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214854 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 05 Nov 2010 22:18:10 -0000

Author: delphij
Date: Fri Nov  5 22:18:09 2010
New Revision: 214854
URL: http://svn.freebsd.org/changeset/base/214854

Log:
  Validate whether the zfs_cmd_t submitted from userland is not smaller than
  what we have.  Without the check the kernel could accessing memory that
  does not belong to the request struct.
  
  Note that we do not test if the struct equals in size at this time, which
  may faciliate forward compatibility with newer binaries.
  
  Reviewed by:	pjd at MeetBSD CA '2010
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Fri Nov  5 21:47:58 2010	(r214853)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Fri Nov  5 22:18:09 2010	(r214854)
@@ -3627,6 +3627,14 @@ zfsdev_ioctl(struct cdev *dev, u_long cm
 	uint_t vec;
 	int error;
 
+	/*
+	 * Check if we have sufficient kernel memory allocated
+	 * for the zfs_cmd_t request.  Bail out if not so we
+	 * will not access undefined memory region.
+	 */
+	if (IOCPARM_LEN(cmd) < sizeof(zfs_cmd_t))
+		return (EINVAL);
+
 	vec = ZFS_IOC(cmd);
 
 	if (vec >= sizeof (zfs_ioc_vec) / sizeof (zfs_ioc_vec[0]))

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 03:59:21 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5027106564A;
	Sat,  6 Nov 2010 03:59:21 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A36788FC1F;
	Sat,  6 Nov 2010 03:59:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA63xLAC018364;
	Sat, 6 Nov 2010 03:59:21 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA63xLED018361;
	Sat, 6 Nov 2010 03:59:21 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201011060359.oA63xLED018361@svn.freebsd.org>
From: Xin LI 
Date: Sat, 6 Nov 2010 03:59:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214857 - head/contrib/top
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 03:59:21 -0000

Author: delphij
Date: Sat Nov  6 03:59:21 2010
New Revision: 214857
URL: http://svn.freebsd.org/changeset/base/214857

Log:
  Inverse display of top(1)'s table header when running in inactive mode.
  
  MFC after:	2 weeks

Modified:
  head/contrib/top/display.c
  head/contrib/top/top.h

Modified: head/contrib/top/display.c
==============================================================================
--- head/contrib/top/display.c	Sat Nov  6 01:09:00 2010	(r214856)
+++ head/contrib/top/display.c	Sat Nov  6 03:59:21 2010	(r214857)
@@ -694,7 +694,7 @@ char *text;
 	int width;
 
 	s = NULL;
-	width = display_width;
+	width = screen_width;
 	header_length = strlen(text);
 	if (header_length >= width) {
 		s = malloc((width + 1) * sizeof(char));
@@ -702,6 +702,14 @@ char *text;
 			return (NULL);
 		strncpy(s, text, width);
 		s[width] = '\0';
+	} else {
+		s = malloc((width + 1) * sizeof(char));
+		if (s == NULL)
+			return (NULL);
+		strncpy(s, text, width);
+		while (screen_width > header_length)
+			s[header_length++] = ' ';
+		s[width] = '\0';
 	}
 	return (s);
 }
@@ -726,7 +734,7 @@ char *text;
     if (header_status == ON)
     {
 	putchar('\n');
-	fputs(text, stdout);
+	standout(text, stdout);
 	lastline++;
     }
     else if (header_status == ERASE)

Modified: head/contrib/top/top.h
==============================================================================
--- head/contrib/top/top.h	Sat Nov  6 01:09:00 2010	(r214856)
+++ head/contrib/top/top.h	Sat Nov  6 03:59:21 2010	(r214857)
@@ -14,7 +14,7 @@
 extern int Header_lines;	/* 7 */
 
 /* Maximum number of columns allowed for display */
-#define MAX_COLS	128
+#define MAX_COLS	512
 
 /* Log base 2 of 1024 is 10 (2^10 == 1024) */
 #define LOG1024		10

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 04:55:10 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4BEF51065675;
	Sat,  6 Nov 2010 04:55:10 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:100:1043::3])
	by mx1.freebsd.org (Postfix) with ESMTP id EEB948FC15;
	Sat,  6 Nov 2010 04:55:09 +0000 (UTC)
Received: from core.vx.sk (localhost [127.0.0.1])
	by mail.vx.sk (Postfix) with ESMTP id 57AA712A8EA;
	Sat,  6 Nov 2010 05:55:09 +0100 (CET)
X-Virus-Scanned: amavisd-new at mail.vx.sk
Received: from mail.vx.sk ([127.0.0.1])
	by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id R80I7BWZweQa; Sat,  6 Nov 2010 05:55:07 +0100 (CET)
Received: from [10.9.8.1] (188-167-78-139.dynamic.chello.sk [188.167.78.139])
	by mail.vx.sk (Postfix) with ESMTPSA id 3D97C12A8DC;
	Sat,  6 Nov 2010 05:55:07 +0100 (CET)
Message-ID: <4CD4DFAB.3030500@FreeBSD.org>
Date: Sat, 06 Nov 2010 05:55:07 +0100
From: Martin Matuska 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk;
	rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23
	Mnenhy/0.7.5.0
MIME-Version: 1.0
To: Pawel Jakub Dawidek 
References: <201008211141.o7LBfWdv067923@svn.freebsd.org>
	<20100828172744.GJ2077@garage.freebsd.pl>
In-Reply-To: <20100828172744.GJ2077@garage.freebsd.pl>
X-Enigmail-Version: 1.1.2
Content-Type: text/plain; charset=windows-1250
Content-Transfer-Encoding: 8bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Rui Paulo 
Subject: Re: svn commit: r211553 - head/sys/cddl/compat/opensolaris/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 04:55:10 -0000

I agree with Pawel, we should use "FreeBSD".
Is this (+ the dtrace test) going to be changed + set for MFC?

Dòa 28.08.2010 19:27, Pawel Jakub Dawidek  wrote / napísal(a):
> On Sat, Aug 21, 2010 at 11:41:32AM +0000, Rui Paulo wrote:
>> Author: rpaulo
>> Date: Sat Aug 21 11:41:32 2010
>> New Revision: 211553
>> URL: http://svn.freebsd.org/changeset/base/211553
>>
>> Log:
>>   Add sysname to struct opensolaris_utsname. This is needed by one DTrace
>>   test.
>>   
>>   Sponsored by:	The FreeBSD Foundation
>>
>> Modified:
>>   head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c
>>
>> Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c
>> ==============================================================================
>> --- head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c	Sat Aug 21 11:33:49 2010	(r211552)
>> +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c	Sat Aug 21 11:41:32 2010	(r211553)
>> @@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$");
>>  char hw_serial[11] = "0";
>>  
>>  struct opensolaris_utsname utsname = {
>> -	.nodename = "unset"
>> +	.nodename = "unset",
>> +	.sysname  = "SunOS"
> 
> This collides with the changes I have in perforce. Could you take a look at:
> 
> 	//depot/user/pjd/zfs/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c
> 	//depot/user/pjd/zfs/sys/cddl/compat/opensolaris/sys/misc.h
> 
> I'd prefer sysname to say FreeBSD on FreeBSD, rather than SunOS.
> I see it is being used in one DTrace test. Changing 'tst.str.d.out' to
> expect "FreeBSD" instead of "SunOS" is ok?
> 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 10:54:34 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 557061065670;
	Sat,  6 Nov 2010 10:54:34 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 426E08FC13;
	Sat,  6 Nov 2010 10:54:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6AsYeC028519;
	Sat, 6 Nov 2010 10:54:34 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6AsY5o028514;
	Sat, 6 Nov 2010 10:54:34 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201011061054.oA6AsY5o028514@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Sat, 6 Nov 2010 10:54:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214867 - in head: lib/libarchive lib/libpmc
	usr.bin/setchannel
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 10:54:34 -0000

Author: uqs
Date: Sat Nov  6 10:54:33 2010
New Revision: 214867
URL: http://svn.freebsd.org/changeset/base/214867

Log:
  Fix manpage markup.

Modified:
  head/lib/libarchive/libarchive_internals.3
  head/lib/libpmc/pmc.mips.3
  head/lib/libpmc/pmc.xscale.3
  head/usr.bin/setchannel/setchannel.1

Modified: head/lib/libarchive/libarchive_internals.3
==============================================================================
--- head/lib/libarchive/libarchive_internals.3	Sat Nov  6 10:31:52 2010	(r214866)
+++ head/lib/libarchive/libarchive_internals.3	Sat Nov  6 10:54:33 2010	(r214867)
@@ -363,4 +363,3 @@ The
 .Nm libarchive
 library was written by
 .An Tim Kientzle Aq kientzle@acm.org .
-.Sh BUGS

Modified: head/lib/libpmc/pmc.mips.3
==============================================================================
--- head/lib/libpmc/pmc.mips.3	Sat Nov  6 10:31:52 2010	(r214866)
+++ head/lib/libpmc/pmc.mips.3	Sat Nov  6 10:54:33 2010	(r214867)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd February 11, 2010
-.Os
 .Dt PMC.MIPS 3
+.Os
 .Sh NAME
 .Nm pmc.mips
 .Nd measurement events for
@@ -123,7 +123,6 @@ Counts every time the instruction cache 
 wasted fetches etc. are counted.
 For example, following a branch, even though the prediction is taken,
 the fall through access is counted.
-
 .It Li IC_MISS
 .Pq Event 9, Counter 1
 Counts all instruction cache misses that result in a bus request.

Modified: head/lib/libpmc/pmc.xscale.3
==============================================================================
--- head/lib/libpmc/pmc.xscale.3	Sat Nov  6 10:31:52 2010	(r214866)
+++ head/lib/libpmc/pmc.xscale.3	Sat Nov  6 10:54:33 2010	(r214867)
@@ -24,8 +24,8 @@
 .\" $FreeBSD$
 .\"
 .Dd December 23, 2009
-.Os
 .Dt PMC.XSCALE 3
+.Os
 .Sh NAME
 .Nm pmc.xscale
 .Nd measurement events for

Modified: head/usr.bin/setchannel/setchannel.1
==============================================================================
--- head/usr.bin/setchannel/setchannel.1	Sat Nov  6 10:31:52 2010	(r214866)
+++ head/usr.bin/setchannel/setchannel.1	Sat Nov  6 10:54:33 2010	(r214867)
@@ -1,32 +1,32 @@
+.\"-
+.\" Copyright (C) 2004-2006 The FreeBSD Project. 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.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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) 2004-2006 The FreeBSD Project. 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.
-.\ 
-.\ THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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.
-.\
 .\" $Id: cxm.4,v 1.1 2004/10/16 00:12:35 mavetju Exp $
 .\" $FreeBSD$
 .\"
 .Dd November 30, 2006
-.Dt pvr250-setchannel 1
+.Dt PVR250-SETCHANNEL 1
 .Os
 .Sh NAME
 .Nm pvr250-setchannel
@@ -48,10 +48,10 @@ Disable AFC.
 .It Fl c
 Select composite input.
 .It Fl d
-Select the tuner unit number.  
-This is appended to the base device file name 
+Select the tuner unit number.
+This is appended to the base device file name
 .Pa /dev/cxm
-to form a device name such as 
+to form a device name such as
 .Pa /dev/cxm0
 or
 .Pa /dev/cxm1 .

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 11:38:50 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 42E6110657AF;
	Sat,  6 Nov 2010 11:38:50 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 168F18FC14;
	Sat,  6 Nov 2010 11:38:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6Bcn39029693;
	Sat, 6 Nov 2010 11:38:49 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6BcnLi029691;
	Sat, 6 Nov 2010 11:38:49 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201011061138.oA6BcnLi029691@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 6 Nov 2010 11:38:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214873 - head/release/doc/en_US.ISO8859-1/hardware
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 11:38:50 -0000

Author: marius
Date: Sat Nov  6 11:38:49 2010
New Revision: 214873
URL: http://svn.freebsd.org/changeset/base/214873

Log:
  - Move Sun Fire V240 to the list of known working machines.
  - For the parallel stable/7 and stable/8 branches mention both releases that
    first supported a particular sparc64 machine and update the sparc64 hardware
    list regarding machines that will be supported beginning with 7.4-RELEASE.

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.sgml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Sat Nov  6 11:38:40 2010	(r214872)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Sat Nov  6 11:38:49 2010	(r214873)
@@ -585,7 +585,11 @@
 	
 
 	
-	  &sun.fire; V215 (support first appeared in 7.3-RELEASE)
+	  &sun.fire; V215 (support first appeared in 7.3-RELEASE and 8.1-RELEASE)
+	
+
+	
+	  &sun.fire; V240
 	
 
 	
@@ -594,12 +598,12 @@
 
 	
 	  &sun.fire; V440 (support for the on-board NICs first
-	    appeared in 8.0-RELEASE)
+	    appeared in 7.3-RELEASE and 8.0-RELEASE)
 	
 
 	
 	  &sun.fire; V480 (501-6780 and 501-6790 centerplanes only, for
-	    which support first appeared in 7.3-RELEASE)
+	    which support first appeared in 7.3-RELEASE and 8.1-RELEASE)
 	
 
 	
@@ -607,7 +611,7 @@
 	
 
 	
-	  &sun.fire; V890 (support first appeared in 8.1-RELEASE,
+	  &sun.fire; V890 (support first appeared in 7.4-RELEASE and 8.1-RELEASE,
 	    non-mixed &ultrasparc; IV/IV+ CPU-configurations only)
 	
 
@@ -625,20 +629,16 @@
 	
 
 	
-	  &sun.fire; V240
-	
-
-	
-	  &sun.fire; V245 (support first appeared in 7.3-RELEASE)
+	  &sun.fire; V245 (support first appeared in 7.3-RELEASE and 8.1-RELEASE)
 	
 
 	
-	  &sun.fire; V490 (support first appeared in 8.1-RELEASE,
+	  &sun.fire; V490 (support first appeared in 7.4-RELEASE and 8.1-RELEASE,
 	    non-mixed &ultrasparc; IV/IV+ CPU-configurations only)
 	
       
 
-      Starting with 8.1-RELEASE, &arch.sparc64; systems based on
+      Starting with 7.4-RELEASE and 8.1-RELEASE, &arch.sparc64; systems based on
 	Fujitsu &sparc64; V are also supported by &os;, which
 	includes the following known working systems:
 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 13:30:54 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCE8B1065673;
	Sat,  6 Nov 2010 13:30:54 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CB3858FC18;
	Sat,  6 Nov 2010 13:30:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6DUskn032470;
	Sat, 6 Nov 2010 13:30:54 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6DUsGl032468;
	Sat, 6 Nov 2010 13:30:54 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201011061330.oA6DUsGl032468@svn.freebsd.org>
From: Michael Tuexen 
Date: Sat, 6 Nov 2010 13:30:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214876 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 13:30:55 -0000

Author: tuexen
Date: Sat Nov  6 13:30:54 2010
New Revision: 214876
URL: http://svn.freebsd.org/changeset/base/214876

Log:
  * Fix an accounting bug regarding SACK/NR-SACK chunks.
  * Fix the generation of the SACK/NR-SACK gap lists.
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Sat Nov  6 13:03:33 2010	(r214875)
+++ head/sys/netinet/sctp_output.c	Sat Nov  6 13:30:54 2010	(r214876)
@@ -9927,7 +9927,7 @@ sctp_send_sack(struct sctp_tcb *stcb)
 	caddr_t limit;
 	uint32_t *dup;
 	int limit_reached = 0;
-	unsigned int i, sel_start, siz, j, starting_index;
+	unsigned int i, sel_start, siz, j;
 	unsigned int num_gap_blocks = 0, num_nr_gap_blocks = 0, space;
 	int num_dups = 0;
 	int space_req;
@@ -9954,7 +9954,7 @@ sctp_send_sack(struct sctp_tcb *stcb)
 		if (chk->rec.chunk_id.id == type) {
 			/* Hmm, found a sack already on queue, remove it */
 			TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
-			asoc->ctrl_queue_cnt++;
+			asoc->ctrl_queue_cnt--;
 			a_chk = chk;
 			if (a_chk->data) {
 				sctp_m_freem(a_chk->data);
@@ -9993,15 +9993,13 @@ sctp_send_sack(struct sctp_tcb *stcb)
 	a_chk->whoTo = NULL;
 
 	if ((asoc->numduptsns) ||
-	    (asoc->last_data_chunk_from->dest_state & SCTP_ADDR_NOT_REACHABLE)
-	    ) {
+	    (asoc->last_data_chunk_from->dest_state & SCTP_ADDR_NOT_REACHABLE)) {
 		/*-
 		 * Ok, we have some duplicates or the destination for the
 		 * sack is unreachable, lets see if we can select an
 		 * alternate than asoc->last_data_chunk_from
 		 */
-		if ((!(asoc->last_data_chunk_from->dest_state &
-		    SCTP_ADDR_NOT_REACHABLE)) &&
+		if ((!(asoc->last_data_chunk_from->dest_state & SCTP_ADDR_NOT_REACHABLE)) &&
 		    (asoc->used_alt_onsack > asoc->numnets)) {
 			/* We used an alt last time, don't this time */
 			a_chk->whoTo = NULL;
@@ -10120,53 +10118,25 @@ sctp_send_sack(struct sctp_tcb *stcb)
 		}
 	}
 
-	if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) {
-		offset = 1;
-		/*-
-		 * The base TSN is intialized to be the first TSN the peer
-		 * will send us. If the cum-ack is behind this then when they
-		 * send us the next in sequence it will mark the base_tsn bit.
-		 * Thus we need to use the very first selector and the offset
-		 * is 1. Our table is built for this case.
-		 */
-		starting_index = 0;
+	if (((type == SCTP_SELECTIVE_ACK) &&
+	    (((asoc->mapping_array[0] | asoc->nr_mapping_array[0]) & 0x01) == 0x00)) ||
+	    ((type == SCTP_NR_SELECTIVE_ACK) &&
+	    ((asoc->mapping_array[0] & 0x01) == 0x00))) {
 		sel_start = 0;
 	} else {
-		/*-
-		 * we skip the first selector  when the cum-ack is at or above the
-		 * mapping array base. This is because the bits at the base or above
-		 * are turned on and our first selector in the table assumes they are
-		 * off. We thus will use the second selector (first is 0). We use
-		 * the reverse of our macro to fix the offset, in bits, that our
-		 * table is at. Note that this method assumes that the cum-tsn is
-		 * within the first bit, i.e. its value is 0-7 which means the
-		 * result to our offset will be either a 0 - -7. If the cumack
-		 * is NOT in the first byte (0) (which it should be since we did
-		 * a mapping array slide above) then we need to calculate the starting
-		 * index i.e. which byte of the mapping array we should start at. We
-		 * do this by dividing by 8 and pushing the remainder (mod) into offset.
-		 * then we multiply the offset to be negative, since we need a negative
-		 * offset into the selector table.
-		 */
-		SCTP_CALC_TSN_TO_GAP(offset, asoc->cumulative_tsn, asoc->mapping_array_base_tsn);
-		if (offset > 7) {
-			starting_index = offset / 8;
-			offset = offset % 8;
-			printf("Strange starting index is %d offset:%d (not 0/x)\n",
-			    starting_index, offset);
-		} else {
-			starting_index = 0;
-		}
-		/* We need a negative offset in our table */
-		offset *= -1;
 		sel_start = 1;
 	}
+	if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) {
+		offset = 1;
+	} else {
+		offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn;
+	}
 	if (((type == SCTP_SELECTIVE_ACK) &&
 	    compare_with_wrap(highest_tsn, asoc->cumulative_tsn, MAX_TSN)) ||
 	    ((type == SCTP_NR_SELECTIVE_ACK) &&
 	    compare_with_wrap(asoc->highest_tsn_inside_map, asoc->cumulative_tsn, MAX_TSN))) {
 		/* we have a gap .. maybe */
-		for (i = starting_index; i < siz; i++) {
+		for (i = 0; i < siz; i++) {
 			if (type == SCTP_SELECTIVE_ACK) {
 				selector = &sack_array[asoc->mapping_array[i] | asoc->nr_mapping_array[i]];
 			} else {
@@ -10224,25 +10194,21 @@ sctp_send_sack(struct sctp_tcb *stcb)
 
 		mergeable = 0;
 
-		if (asoc->highest_tsn_inside_nr_map > asoc->mapping_array_base_tsn)
+		if (asoc->highest_tsn_inside_nr_map > asoc->mapping_array_base_tsn) {
 			siz = (((asoc->highest_tsn_inside_nr_map - asoc->mapping_array_base_tsn) + 1) + 7) / 8;
-		else
+		} else {
 			siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + asoc->highest_tsn_inside_nr_map + 7) / 8;
+		}
 
+		if ((asoc->nr_mapping_array[0] & 0x01) == 0x00) {
+			sel_start = 0;
+		} else {
+			sel_start = 1;
+		}
 		if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) {
 			offset = 1;
-			/*-
-			* cum-ack behind the mapping array, so we start and use all
-			* entries.
-			*/
-			sel_start = 0;
 		} else {
 			offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn;
-			/*-
-			* we skip the first one when the cum-ack is at or above the
-			* mapping array base. Note this only works if
-			*/
-			sel_start = 1;
 		}
 		if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn, MAX_TSN)) {
 			/* we have a gap .. maybe */

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 13:43:19 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D7E8106564A;
	Sat,  6 Nov 2010 13:43:19 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C4688FC12;
	Sat,  6 Nov 2010 13:43:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6DhJHu032747;
	Sat, 6 Nov 2010 13:43:19 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6DhJJ8032745;
	Sat, 6 Nov 2010 13:43:19 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201011061343.oA6DhJJ8032745@svn.freebsd.org>
From: Michael Tuexen 
Date: Sat, 6 Nov 2010 13:43:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214877 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 13:43:19 -0000

Author: tuexen
Date: Sat Nov  6 13:43:18 2010
New Revision: 214877
URL: http://svn.freebsd.org/changeset/base/214877

Log:
  Do not resend DATA chunks without delay when dropped by the peer and
  the CRC was correct.
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_input.c
==============================================================================
--- head/sys/netinet/sctp_input.c	Sat Nov  6 13:30:54 2010	(r214876)
+++ head/sys/netinet/sctp_input.c	Sat Nov  6 13:43:18 2010	(r214877)
@@ -3115,6 +3115,10 @@ process_chunk_drop(struct sctp_tcb *stcb
 			if ((tp1) && (tp1->sent < SCTP_DATAGRAM_ACKED)) {
 				uint8_t *ddp;
 
+				if (((flg & SCTP_BADCRC) == 0) &&
+				    ((flg & SCTP_FROM_MIDDLE_BOX) == 0)) {
+					return (0);
+				}
 				if ((stcb->asoc.peers_rwnd == 0) &&
 				    ((flg & SCTP_FROM_MIDDLE_BOX) == 0)) {
 					SCTP_STAT_INCR(sctps_pdrpdiwnp);

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 13:58:25 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 548151065702;
	Sat,  6 Nov 2010 13:58:25 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 431CF8FC1A;
	Sat,  6 Nov 2010 13:58:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6DwPnk033155;
	Sat, 6 Nov 2010 13:58:25 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6DwPC1033153;
	Sat, 6 Nov 2010 13:58:25 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201011061358.oA6DwPC1033153@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 6 Nov 2010 13:58:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214879 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 13:58:25 -0000

Author: marius
Date: Sat Nov  6 13:58:24 2010
New Revision: 214879
URL: http://svn.freebsd.org/changeset/base/214879

Log:
  Implement pmap_is_prefaultable().
  
  Reviewed by:	alc (with bugfix)

Modified:
  head/sys/sparc64/sparc64/pmap.c

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Sat Nov  6 13:46:58 2010	(r214878)
+++ head/sys/sparc64/sparc64/pmap.c	Sat Nov  6 13:58:24 2010	(r214879)
@@ -1960,8 +1960,12 @@ pmap_is_modified(vm_page_t m)
 boolean_t
 pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr)
 {
+	boolean_t rv;
 
-	return (FALSE);
+	PMAP_LOCK(pmap);
+	rv = tsb_tte_lookup(pmap, addr) == NULL;
+	PMAP_UNLOCK(pmap);
+	return (rv);
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 14:22:51 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 01D5C1065694;
	Sat,  6 Nov 2010 14:22:51 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA2D38FC19;
	Sat,  6 Nov 2010 14:22:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6EMoXS033711;
	Sat, 6 Nov 2010 14:22:50 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6EMout033709;
	Sat, 6 Nov 2010 14:22:50 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201011061422.oA6EMout033709@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 6 Nov 2010 14:22:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214880 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 14:22:51 -0000

Author: mav
Date: Sat Nov  6 14:22:50 2010
New Revision: 214880
URL: http://svn.freebsd.org/changeset/base/214880

Log:
  Add support for odd-sized PIO transfers, sometimes used by ATAPI.

Modified:
  head/sys/dev/ata/ata-lowlevel.c

Modified: head/sys/dev/ata/ata-lowlevel.c
==============================================================================
--- head/sys/dev/ata/ata-lowlevel.c	Sat Nov  6 13:58:24 2010	(r214879)
+++ head/sys/dev/ata/ata-lowlevel.c	Sat Nov  6 14:22:50 2010	(r214880)
@@ -833,12 +833,18 @@ ata_pio_read(struct ata_request *request
     struct ata_channel *ch = device_get_softc(request->parent);
     int size = min(request->transfersize, length);
     int resid;
+    uint8_t buf[2];
 
-    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)))
+    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) {
 	ATA_IDX_INSW_STRM(ch, ATA_DATA,
 			  (void*)((uintptr_t)request->data+request->donecount),
 			  size / sizeof(int16_t));
-    else
+	if (size & 1) {
+	    ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1);
+	    ((uint8_t *)request->data + request->donecount +
+		(size & ~1))[0] = buf[0];
+	}
+    } else
 	ATA_IDX_INSL_STRM(ch, ATA_DATA,
 			  (void*)((uintptr_t)request->data+request->donecount),
 			  size / sizeof(int32_t));
@@ -846,7 +852,7 @@ ata_pio_read(struct ata_request *request
     if (request->transfersize < length) {
 	device_printf(request->parent, "WARNING - %s read data overrun %d>%d\n",
 		   ata_cmd2str(request), length, request->transfersize);
-	for (resid = request->transfersize; resid < length;
+	for (resid = request->transfersize + (size & 1); resid < length;
 	     resid += sizeof(int16_t))
 	    ATA_IDX_INW(ch, ATA_DATA);
     }
@@ -858,12 +864,18 @@ ata_pio_write(struct ata_request *reques
     struct ata_channel *ch = device_get_softc(request->parent);
     int size = min(request->transfersize, length);
     int resid;
+    uint8_t buf[2];
 
-    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)))
+    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t))) {
 	ATA_IDX_OUTSW_STRM(ch, ATA_DATA,
 			   (void*)((uintptr_t)request->data+request->donecount),
 			   size / sizeof(int16_t));
-    else
+	if (size & 1) {
+	    buf[0] = ((uint8_t *)request->data + request->donecount +
+		(size & ~1))[0];
+	    ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1);
+	}
+    } else
 	ATA_IDX_OUTSL_STRM(ch, ATA_DATA,
 			   (void*)((uintptr_t)request->data+request->donecount),
 			   size / sizeof(int32_t));
@@ -871,7 +883,7 @@ ata_pio_write(struct ata_request *reques
     if (request->transfersize < length) {
 	device_printf(request->parent, "WARNING - %s write data underrun %d>%d\n",
 		   ata_cmd2str(request), length, request->transfersize);
-	for (resid = request->transfersize; resid < length;
+	for (resid = request->transfersize + (size & 1); resid < length;
 	     resid += sizeof(int16_t))
 	    ATA_IDX_OUTW(ch, ATA_DATA, 0);
     }

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 15:04:49 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CDA1106566B;
	Sat,  6 Nov 2010 15:04:49 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 217B98FC08;
	Sat,  6 Nov 2010 15:04:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6F4nbq034912;
	Sat, 6 Nov 2010 15:04:49 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6F4nhe034910;
	Sat, 6 Nov 2010 15:04:49 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201011061504.oA6F4nhe034910@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Sat, 6 Nov 2010 15:04:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214885 - head/usr.sbin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 15:04:49 -0000

Author: uqs
Date: Sat Nov  6 15:04:48 2010
New Revision: 214885
URL: http://svn.freebsd.org/changeset/base/214885

Log:
  Put string in quotes, like is done everywhere.

Modified:
  head/usr.sbin/Makefile

Modified: head/usr.sbin/Makefile
==============================================================================
--- head/usr.sbin/Makefile	Sat Nov  6 14:53:22 2010	(r214884)
+++ head/usr.sbin/Makefile	Sat Nov  6 15:04:48 2010	(r214885)
@@ -155,7 +155,7 @@ SUBDIR+=	fdwrite
 SUBDIR+=	freebsd-update
 .endif
 
-.if ${MK_GSSAPI} != no
+.if ${MK_GSSAPI} != "no"
 SUBDIR+=	gssd
 .endif
 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 15:04:56 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D3AE51065728;
	Sat,  6 Nov 2010 15:04:56 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B679E8FC0A;
	Sat,  6 Nov 2010 15:04:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6F4ufY034951;
	Sat, 6 Nov 2010 15:04:56 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6F4uEN034949;
	Sat, 6 Nov 2010 15:04:56 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201011061504.oA6F4uEN034949@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Sat, 6 Nov 2010 15:04:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214886 - head/usr.bin/setchannel
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 15:04:56 -0000

Author: uqs
Date: Sat Nov  6 15:04:56 2010
New Revision: 214886
URL: http://svn.freebsd.org/changeset/base/214886

Log:
  Apply style(9) and unbreak build.
  
  This went unnoticed during the WARNS bump, as this tool is not connected
  to the build.

Modified:
  head/usr.bin/setchannel/setchannel.c

Modified: head/usr.bin/setchannel/setchannel.c
==============================================================================
--- head/usr.bin/setchannel/setchannel.c	Sat Nov  6 15:04:48 2010	(r214885)
+++ head/usr.bin/setchannel/setchannel.c	Sat Nov  6 15:04:56 2010	(r214886)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright (c) 2003, 2004, 2005
  *	John Wehle .  All rights reserved.
  *
@@ -28,40 +28,34 @@
 
 /* Set the channel of the tuner card. */
 
-#include 
-#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
-#include 
-#include 
-#include 
 #include 
 
-#if __FreeBSD_version < 503001
-#  include 
-#  include 
-#else
-#  include 
-#  include 
-#endif
-
+#include 
+#include 
 
 static void
-usage()
+usage(void)
 {
 	printf
 	    ("Usage: setchannel [-a {on|off}] [-c | -r | -s | -t] "
 	    "[-g geom] [-m chnl_set] [chnl | freq]\n"
 	    "  -a    Enable / disable AFC.\n"
 	    "  -c    Select composite input.\n"
-            "  -d    Select tuner unit number.\n"
-            "  -r    Select radio input.\n"
+	    "  -d    Select tuner unit number.\n"
+	    "  -r    Select radio input.\n"
 	    "  -s    Select svideo input.\n"
-            "  -t    Select tuner.\n"
+	    "  -t    Select tuner.\n"
 	    "  -g    Select geometry.\n"
-            "          352x240 or 352x288 = VCD\n"
+	    "          352x240 or 352x288 = VCD\n"
 	    "          480x480 or 480x576 = SVCD\n"
 	    "          352x480 or 352x576 = DVD (half D1)\n"
 	    "          720x480 or 720x576 = DVD (full D1)\n"
@@ -74,7 +68,7 @@ usage()
 	    "          %u = Japan Cable / NTSC\n"
 	    "          %u = Australia / PAL\n"
 	    "          %u = France / SECAM\n"
-            "  chnl  Channel\n"
+	    "  chnl  Channel\n"
 	    "  freq  Frequency in MHz (must include decimal point).\n",
 	    CHNLSET_NABCST, CHNLSET_CABLEIRC, CHNLSET_WEUROPE, CHNLSET_JPNBCST,
 	    CHNLSET_JPNCABLE, CHNLSET_AUSTRALIA, CHNLSET_FRANCE);
@@ -94,7 +88,7 @@ main(int argc, char *argv[])
 	int channel_set;
 	int i;
 	int status;
-        int unit;
+	int unit;
 	int tfd;
 	unsigned int channel;
 	unsigned int fraction;
@@ -111,7 +105,7 @@ main(int argc, char *argv[])
 	device = 0;
 	freq = 0;
 	status = 0;
-        unit = 0;
+	unit = 0;
 	x_size = 0;
 	y_size = 0;
 
@@ -214,11 +208,11 @@ main(int argc, char *argv[])
 		exit(1);
 	}
 
-        sprintf(dev_name, DEVNAME_BASE "%d", unit);
-        tfd = open(dev_name, O_RDONLY);
+	sprintf(dev_name, DEVNAME_BASE "%d", unit);
+	tfd = open(dev_name, O_RDONLY);
 	if (tfd < 0) {
 		fprintf(stderr, "Can't open %s: %s (%d)\n", dev_name,
-                        strerror(errno), errno);
+		    strerror(errno), errno);
 		exit(1);
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 17:48:46 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA2091065675;
	Sat,  6 Nov 2010 17:48:46 +0000 (UTC)
	(envelope-from dumbbell@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9DE928FC15;
	Sat,  6 Nov 2010 17:48:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6HmkPp038861;
	Sat, 6 Nov 2010 17:48:46 GMT (envelope-from dumbbell@svn.freebsd.org)
Received: (from dumbbell@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6HmkTi038859;
	Sat, 6 Nov 2010 17:48:46 GMT (envelope-from dumbbell@svn.freebsd.org)
Message-Id: <201011061748.oA6HmkTi038859@svn.freebsd.org>
From: Jean-Sebastien Pedron 
Date: Sat, 6 Nov 2010 17:48:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214893 - head/usr.bin/fold
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 17:48:46 -0000

Author: dumbbell
Date: Sat Nov  6 17:48:46 2010
New Revision: 214893
URL: http://svn.freebsd.org/changeset/base/214893

Log:
  Fix a segmentation fault in argument processing.
  
  The crash was caused by a command line such as this one:
  # foldl -b1
  
  PR:		bin/151592
  Reported by:	Marcus Reid 
  Tested by:	Marcus Reid 
  MFC after:	3 days

Modified:
  head/usr.bin/fold/fold.c

Modified: head/usr.bin/fold/fold.c
==============================================================================
--- head/usr.bin/fold/fold.c	Sat Nov  6 16:09:25 2010	(r214892)
+++ head/usr.bin/fold/fold.c	Sat Nov  6 17:48:46 2010	(r214893)
@@ -71,14 +71,14 @@ int sflag;			/* Split on word boundaries
 int
 main(int argc, char **argv)
 {
-	int ch;
+	int ch, previous_ch;
 	int rval, width;
-	char *p;
 
 	(void) setlocale(LC_CTYPE, "");
 
 	width = -1;
-	while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1)
+	previous_ch = 0;
+	while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1) {
 		switch (ch) {
 		case 'b':
 			bflag = 1;
@@ -93,17 +93,33 @@ main(int argc, char **argv)
 			break;
 		case '0': case '1': case '2': case '3': case '4':
 		case '5': case '6': case '7': case '8': case '9':
-			if (width == -1) {
-				p = argv[optind - 1];
-				if (p[0] == '-' && p[1] == ch && !p[2])
-					width = atoi(++p);
-				else
-					width = atoi(argv[optind] + 1);
+			/* Accept a width as eg. -30. Note that a width
+			 * specified using the -w option is always used prior
+			 * to this undocumented option. */
+			switch (previous_ch) {
+			case '0': case '1': case '2': case '3': case '4':
+			case '5': case '6': case '7': case '8': case '9':
+				/* The width is a number with multiple digits:
+				 * add the last one. */
+				width = width * 10 + (ch - '0');
+				break;
+			default:
+				/* Set the width, unless it was previously
+				 * set. For instance, the following options
+				 * would all give a width of 5 and not 10:
+				 *   -10 -w5
+				 *   -5b10
+				 *   -5 -10b */
+				if (width == -1)
+					width = ch - '0';
+				break;
 			}
 			break;
 		default:
 			usage();
 		}
+		previous_ch = ch;
+	}
 	argv += optind;
 	argc -= optind;
 

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 18:17:21 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2EA83106564A;
	Sat,  6 Nov 2010 18:17:21 +0000 (UTC)
	(envelope-from bschmidt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B2448FC12;
	Sat,  6 Nov 2010 18:17:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6IHLnI043537;
	Sat, 6 Nov 2010 18:17:21 GMT (envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6IHKcp043518;
	Sat, 6 Nov 2010 18:17:20 GMT (envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201011061817.oA6IHKcp043518@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Sat, 6 Nov 2010 18:17:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214894 - in head/sys: dev/bwi dev/bwn dev/iwn dev/ral
	dev/usb/wlan dev/wpi net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 18:17:21 -0000

Author: bschmidt
Date: Sat Nov  6 18:17:20 2010
New Revision: 214894
URL: http://svn.freebsd.org/changeset/base/214894

Log:
  Instead of using the AMRR ratectl algo as default for drivers which have
  the IEEE80211_C_RATECTL flag set, default to NONE for all drivers. Only if
  a driver calls ieee80211_ratectl_init() check if the NONE algo is still
  selected and try to use AMRR in that case. Drivers are still free to use
  any other algo by calling ieee80211_ratectl_set() prior to the
  ieee80211_ratectl_init() call.
  
  After this change it is now safe to assume that a ratectl algo is always
  available and selected, which renders the IEEE80211_C_RATECTL flag pretty
  much useless. Therefore revert r211314 and 211546.
  
  Reviewed by:	rpaulo
  MFC after:	2 weeks

Modified:
  head/sys/dev/bwi/if_bwi.c
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/ral/rt2560.c
  head/sys/dev/ral/rt2661.c
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_zyd.c
  head/sys/dev/wpi/if_wpi.c
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_node.c
  head/sys/net80211/ieee80211_ratectl.c
  head/sys/net80211/ieee80211_ratectl.h
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/dev/bwi/if_bwi.c
==============================================================================
--- head/sys/dev/bwi/if_bwi.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/bwi/if_bwi.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -511,8 +511,7 @@ bwi_attach(struct bwi_softc *sc)
 		      IEEE80211_C_SHPREAMBLE |
 		      IEEE80211_C_WPA |
 		      IEEE80211_C_BGSCAN |
-		      IEEE80211_C_MONITOR |
-		      IEEE80211_C_RATECTL;
+		      IEEE80211_C_MONITOR;
 	ic->ic_opmode = IEEE80211_M_STA;
 	ieee80211_ifattach(ic, macaddr);
 

Modified: head/sys/dev/bwn/if_bwn.c
==============================================================================
--- head/sys/dev/bwn/if_bwn.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/bwn/if_bwn.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -1070,7 +1070,6 @@ bwn_attach_post(struct bwn_softc *sc)
 		| IEEE80211_C_WPA		/* capable of WPA1+WPA2 */
 		| IEEE80211_C_BGSCAN		/* capable of bg scanning */
 		| IEEE80211_C_TXPMGT		/* capable of txpow mgt */
-		| IEEE80211_C_RATECTL		/* use ratectl */
 		;
 
 	ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS;	/* s/w bmiss */

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/iwn/if_iwn.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -584,7 +584,6 @@ iwn_attach(device_t dev)
 		| IEEE80211_C_IBSS		/* ibss/adhoc mode */
 #endif
 		| IEEE80211_C_WME		/* WME */
-		| IEEE80211_C_RATECTL		/* use ratectl */
 		;
 #if 0	/* HT */
 	/* XXX disable until HT channel setup works */

Modified: head/sys/dev/ral/rt2560.c
==============================================================================
--- head/sys/dev/ral/rt2560.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/ral/rt2560.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -291,7 +291,6 @@ rt2560_attach(device_t dev, int id)
 #ifdef notyet
 		| IEEE80211_C_TXFRAG		/* handle tx frags */
 #endif
-		| IEEE80211_C_RATECTL		/* use ratectl */
 		;
 
 	bands = 0;

Modified: head/sys/dev/ral/rt2661.c
==============================================================================
--- head/sys/dev/ral/rt2661.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/ral/rt2661.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -294,7 +294,6 @@ rt2661_attach(device_t dev, int id)
 		| IEEE80211_C_TXFRAG		/* handle tx frags */
 		| IEEE80211_C_WME		/* 802.11e */
 #endif
-		| IEEE80211_C_RATECTL		/* use ratectl */
 		;
 
 	bands = 0;

Modified: head/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rum.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/usb/wlan/if_rum.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -496,7 +496,6 @@ rum_attach(device_t self)
 	    | IEEE80211_C_SHSLOT	/* short slot time supported */
 	    | IEEE80211_C_BGSCAN	/* bg scanning supported */
 	    | IEEE80211_C_WPA		/* 802.11i */
-	    | IEEE80211_C_RATECTL	/* use ratectl */
 	    ;
 
 	bands = 0;

Modified: head/sys/dev/usb/wlan/if_run.c
==============================================================================
--- head/sys/dev/usb/wlan/if_run.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/usb/wlan/if_run.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -632,8 +632,7 @@ run_attach(device_t self)
 	    IEEE80211_C_SHPREAMBLE |	/* short preamble supported */
 	    IEEE80211_C_SHSLOT |	/* short slot time supported */
 	    IEEE80211_C_WME |		/* WME */
-	    IEEE80211_C_WPA |		/* WPA1|WPA2(RSN) */
-	    IEEE80211_C_RATECTL;	/* use ratectl */
+	    IEEE80211_C_WPA;		/* WPA1|WPA2(RSN) */
 
 	ic->ic_cryptocaps =
 	    IEEE80211_CRYPTO_WEP |

Modified: head/sys/dev/usb/wlan/if_ural.c
==============================================================================
--- head/sys/dev/usb/wlan/if_ural.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/usb/wlan/if_ural.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -486,7 +486,6 @@ ural_attach(device_t self)
 	    | IEEE80211_C_SHSLOT	/* short slot time supported */
 	    | IEEE80211_C_BGSCAN	/* bg scanning supported */
 	    | IEEE80211_C_WPA		/* 802.11i */
-	    | IEEE80211_C_RATECTL	/* use ratectl */
 	    ;
 
 	bands = 0;

Modified: head/sys/dev/usb/wlan/if_zyd.c
==============================================================================
--- head/sys/dev/usb/wlan/if_zyd.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/usb/wlan/if_zyd.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -397,7 +397,6 @@ zyd_attach(device_t dev)
 	        | IEEE80211_C_SHSLOT		/* short slot time supported */
 		| IEEE80211_C_BGSCAN		/* capable of bg scanning */
 	        | IEEE80211_C_WPA		/* 802.11i */
-		| IEEE80211_C_RATECTL		/* use ratectl */
 		;
 
 	bands = 0;

Modified: head/sys/dev/wpi/if_wpi.c
==============================================================================
--- head/sys/dev/wpi/if_wpi.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/dev/wpi/if_wpi.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -634,7 +634,6 @@ wpi_attach(device_t dev)
 		| IEEE80211_C_WME		/* 802.11e */
 		| IEEE80211_C_HOSTAP		/* Host access point mode */
 #endif
-		| IEEE80211_C_RATECTL		/* use ratectl */
 		;
 
 	/*

Modified: head/sys/net80211/ieee80211.c
==============================================================================
--- head/sys/net80211/ieee80211.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/net80211/ieee80211.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -486,9 +486,7 @@ ieee80211_vap_setup(struct ieee80211com 
 	ieee80211_scan_vattach(vap);
 	ieee80211_regdomain_vattach(vap);
 	ieee80211_radiotap_vattach(vap);
-
-	if (vap->iv_caps & IEEE80211_C_RATECTL)
-		ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR);
+	ieee80211_ratectl_set(vap, IEEE80211_RATECTL_NONE);
 
 	return 0;
 }

Modified: head/sys/net80211/ieee80211_node.c
==============================================================================
--- head/sys/net80211/ieee80211_node.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/net80211/ieee80211_node.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -817,8 +817,7 @@ ieee80211_sta_join(struct ieee80211vap *
 	if (ieee80211_iserp_rateset(&ni->ni_rates))
 		ni->ni_flags |= IEEE80211_NODE_ERP;
 	ieee80211_node_setuptxparms(ni);
-	if (vap->iv_caps & IEEE80211_C_RATECTL)
-		ieee80211_ratectl_node_init(ni);
+	ieee80211_ratectl_node_init(ni);
 
 	return ieee80211_sta_join1(ieee80211_ref_node(ni));
 }
@@ -1038,8 +1037,7 @@ node_free(struct ieee80211_node *ni)
 {
 	struct ieee80211com *ic = ni->ni_ic;
 
-	if (ni->ni_vap->iv_caps & IEEE80211_C_RATECTL)
-		ieee80211_ratectl_node_deinit(ni);
+	ieee80211_ratectl_node_deinit(ni);
 	ic->ic_node_cleanup(ni);
 	ieee80211_ies_cleanup(&ni->ni_ies);
 	ieee80211_psq_cleanup(&ni->ni_psq);
@@ -1404,8 +1402,7 @@ ieee80211_fakeup_adhoc_node(struct ieee8
 #endif
 		}
 		ieee80211_node_setuptxparms(ni);
-		if (vap->iv_caps & IEEE80211_C_RATECTL)
-			ieee80211_ratectl_node_init(ni);
+		ieee80211_ratectl_node_init(ni);
 		if (ic->ic_newassoc != NULL)
 			ic->ic_newassoc(ni, 1);
 		/* XXX not right for 802.1x/WPA */
@@ -1475,8 +1472,7 @@ ieee80211_add_neighbor(struct ieee80211v
 		if (ieee80211_iserp_rateset(&ni->ni_rates))
 			ni->ni_flags |= IEEE80211_NODE_ERP;
 		ieee80211_node_setuptxparms(ni);
-		if (vap->iv_caps & IEEE80211_C_RATECTL)
-			ieee80211_ratectl_node_init(ni);
+		ieee80211_ratectl_node_init(ni);
 		if (ic->ic_newassoc != NULL)
 			ic->ic_newassoc(ni, 1);
 		/* XXX not right for 802.1x/WPA */
@@ -2345,8 +2341,7 @@ ieee80211_node_join(struct ieee80211_nod
 	);
 
 	ieee80211_node_setuptxparms(ni);
-	if (vap->iv_caps & IEEE80211_C_RATECTL)
-		ieee80211_ratectl_node_init(ni);
+	ieee80211_ratectl_node_init(ni);
 	/* give driver a chance to setup state like ni_txrate */
 	if (ic->ic_newassoc != NULL)
 		ic->ic_newassoc(ni, newassoc);

Modified: head/sys/net80211/ieee80211_ratectl.c
==============================================================================
--- head/sys/net80211/ieee80211_ratectl.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/net80211/ieee80211_ratectl.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -66,6 +66,14 @@ ieee80211_ratectl_unregister(int type)
 }
 
 void
+ieee80211_ratectl_init(struct ieee80211vap *vap)
+{
+	if (vap->iv_rate == ratectls[IEEE80211_RATECTL_NONE])
+		ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR);
+	vap->iv_rate->ir_init(vap);
+}
+
+void
 ieee80211_ratectl_set(struct ieee80211vap *vap, int type)
 {
 	if (type >= IEEE80211_RATECTL_MAX)

Modified: head/sys/net80211/ieee80211_ratectl.h
==============================================================================
--- head/sys/net80211/ieee80211_ratectl.h	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/net80211/ieee80211_ratectl.h	Sat Nov  6 18:17:20 2010	(r214894)
@@ -57,17 +57,12 @@ struct ieee80211_ratectl {
 
 void	ieee80211_ratectl_register(int, const struct ieee80211_ratectl *);
 void	ieee80211_ratectl_unregister(int);
+void	ieee80211_ratectl_init(struct ieee80211vap *);
 void	ieee80211_ratectl_set(struct ieee80211vap *, int);
 
 MALLOC_DECLARE(M_80211_RATECTL);
 
 static void __inline
-ieee80211_ratectl_init(struct ieee80211vap *vap)
-{
-	vap->iv_rate->ir_init(vap);
-}
-
-static void __inline
 ieee80211_ratectl_deinit(struct ieee80211vap *vap)
 {
 	vap->iv_rate->ir_deinit(vap);

Modified: head/sys/net80211/ieee80211_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_sta.c	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/net80211/ieee80211_sta.c	Sat Nov  6 18:17:20 2010	(r214894)
@@ -1597,8 +1597,7 @@ sta_recv_mgmt(struct ieee80211_node *ni,
 			     IEEE80211_F_JOIN | IEEE80211_F_DOBRS);
 			ieee80211_setup_basic_htrates(ni, htinfo);
 			ieee80211_node_setuptxparms(ni);
-			if (vap->iv_caps & IEEE80211_C_RATECTL)
-				ieee80211_ratectl_node_init(ni);
+			ieee80211_ratectl_node_init(ni);
 		} else {
 #ifdef IEEE80211_SUPPORT_SUPERG
 			if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_ATH))

Modified: head/sys/net80211/ieee80211_var.h
==============================================================================
--- head/sys/net80211/ieee80211_var.h	Sat Nov  6 17:48:46 2010	(r214893)
+++ head/sys/net80211/ieee80211_var.h	Sat Nov  6 18:17:20 2010	(r214894)
@@ -601,8 +601,7 @@ MALLOC_DECLARE(M_80211_VAP);
 #define	IEEE80211_C_MONITOR	0x00010000	/* CAPABILITY: monitor mode */
 #define	IEEE80211_C_DFS		0x00020000	/* CAPABILITY: DFS/radar avail*/
 #define	IEEE80211_C_MBSS	0x00040000	/* CAPABILITY: MBSS available */
-#define	IEEE80211_C_RATECTL	0x00080000	/* CAPABILITY: use ratectl */
-/* 0x700000 available */
+/* 0x7c0000 available */
 #define	IEEE80211_C_WPA1	0x00800000	/* CAPABILITY: WPA1 avail */
 #define	IEEE80211_C_WPA2	0x01000000	/* CAPABILITY: WPA2 avail */
 #define	IEEE80211_C_WPA		0x01800000	/* CAPABILITY: WPA1+WPA2 avail*/

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 19:11:49 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC51C1065672;
	Sat,  6 Nov 2010 19:11:49 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 906E98FC14;
	Sat,  6 Nov 2010 19:11:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6JBnUF045200;
	Sat, 6 Nov 2010 19:11:49 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6JBnaQ045198;
	Sat, 6 Nov 2010 19:11:49 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201011061911.oA6JBnaQ045198@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 6 Nov 2010 19:11:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214896 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 19:11:49 -0000

Author: mav
Date: Sat Nov  6 19:11:49 2010
New Revision: 214896
URL: http://svn.freebsd.org/changeset/base/214896

Log:
  Mark command submission timeouts as timeouts. This should trigger device
  resets and increase chances of getting device back again.

Modified:
  head/sys/dev/ata/ata-lowlevel.c

Modified: head/sys/dev/ata/ata-lowlevel.c
==============================================================================
--- head/sys/dev/ata/ata-lowlevel.c	Sat Nov  6 18:36:21 2010	(r214895)
+++ head/sys/dev/ata/ata-lowlevel.c	Sat Nov  6 19:11:49 2010	(r214896)
@@ -672,7 +672,8 @@ ata_generic_command(struct ata_request *
     /* ready to issue command ? */
     if (ata_wait(ch, request->unit, 0) < 0) { 
 	device_printf(request->parent, "timeout waiting to issue command\n");
-	return -1;
+	request->flags |= ATA_R_TIMEOUT;
+	return (-1);
     }
 
     /* enable interrupt */
@@ -697,13 +698,16 @@ ata_generic_command(struct ata_request *
 
 	/* command interrupt device ? just return and wait for interrupt */
 	if (request->flags & ATA_R_ATAPI_INTR)
-	    return 0;
+	    return (0);
 
 	/* command processed ? */
 	res = ata_wait(ch, request->unit, 0);
 	if (res != 0) {
-	    if (res < 0)
-		    device_printf(request->parent, "timeout waiting for PACKET command\n");
+	    if (res < 0) {
+		    device_printf(request->parent,
+			"timeout waiting for PACKET command\n");
+		    request->flags |= ATA_R_TIMEOUT;
+	    }
 	    return (-1);
 	}
 	/* wait for ready to write ATAPI command block */
@@ -717,9 +721,10 @@ ata_generic_command(struct ata_request *
 	    DELAY(20);
 	}
 	if (timeout <= 0) {
-	    device_printf(request->parent, "timeout waiting for ATAPI ready\n");
-	    request->result = EIO;
-	    return -1;
+	    device_printf(request->parent,
+		"timeout waiting for ATAPI ready\n");
+	    request->flags |= ATA_R_TIMEOUT;
+	    return (-1);
 	}
 
 	/* this seems to be needed for some (slow) devices */
@@ -735,7 +740,7 @@ ata_generic_command(struct ata_request *
 	/* issue command to controller */
 	ATA_IDX_OUTB(ch, ATA_COMMAND, request->u.ata.command);
     }
-    return 0;
+    return (0);
 }
 
 static void

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 21:54:33 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DE4791065675;
	Sat,  6 Nov 2010 21:54:32 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC7D58FC1A;
	Sat,  6 Nov 2010 21:54:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6LsWAA053088;
	Sat, 6 Nov 2010 21:54:32 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6LsWB6053086;
	Sat, 6 Nov 2010 21:54:32 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201011062154.oA6LsWB6053086@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Sat, 6 Nov 2010 21:54:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214898 - head/sys/dev/sk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 21:54:33 -0000

Author: yongari
Date: Sat Nov  6 21:54:32 2010
New Revision: 214898
URL: http://svn.freebsd.org/changeset/base/214898

Log:
  If we got an invalid station address, generate random address. This
  might be caused by broken BIOS.
  
  Reported by:	"Mikhail T."  aldan.algebra.com>
  MFC after:	1 week

Modified:
  head/sys/dev/sk/if_sk.c

Modified: head/sys/dev/sk/if_sk.c
==============================================================================
--- head/sys/dev/sk/if_sk.c	Sat Nov  6 21:04:01 2010	(r214897)
+++ head/sys/dev/sk/if_sk.c	Sat Nov  6 21:54:32 2010	(r214898)
@@ -1319,8 +1319,10 @@ sk_attach(dev)
 	struct sk_softc		*sc;
 	struct sk_if_softc	*sc_if;
 	struct ifnet		*ifp;
+	u_int32_t		r;
 	int			error, i, phy, port;
 	u_char			eaddr[6];
+	u_char			inv_mac[] = {0, 0, 0, 0, 0, 0};
 
 	if (dev == NULL)
 		return(EINVAL);
@@ -1400,6 +1402,23 @@ sk_attach(dev)
 		eaddr[i] =
 		    sk_win_read_1(sc, SK_MAC0_0 + (port * 8) + i);
 
+	/* Verify whether the station address is invalid or not. */
+	if (bcmp(eaddr, inv_mac, sizeof(inv_mac)) == 0) {
+		device_printf(sc_if->sk_if_dev,
+		    "Generating random ethernet address\n");
+		r = arc4random();
+		/*
+		 * Set OUI to convenient locally assigned address.  'b'
+		 * is 0x62, which has the locally assigned bit set, and
+		 * the broadcast/multicast bit clear.
+		 */
+		eaddr[0] = 'b';
+		eaddr[1] = 's';
+		eaddr[2] = 'd';
+		eaddr[3] = (r >> 16) & 0xff;
+		eaddr[4] = (r >>  8) & 0xff;
+		eaddr[5] = (r >>  0) & 0xff;
+	}
 	/*
 	 * Set up RAM buffer addresses. The NIC will have a certain
 	 * amount of SRAM on it, somewhere between 512K and 2MB. We

From owner-svn-src-head@FreeBSD.ORG  Sat Nov  6 22:07:23 2010
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 703FA106564A;
	Sat,  6 Nov 2010 22:07:23 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 43EF98FC0C;
	Sat,  6 Nov 2010 22:07:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA6M7Nmh055458;
	Sat, 6 Nov 2010 22:07:23 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA6M7NtM055456;
	Sat, 6 Nov 2010 22:07:23 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201011062207.oA6M7NtM055456@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Sat, 6 Nov 2010 22:07:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r214899 - head/sys/dev/sk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 06 Nov 2010 22:07:23 -0000

Author: yongari
Date: Sat Nov  6 22:07:22 2010
New Revision: 214899
URL: http://svn.freebsd.org/changeset/base/214899

Log:
  Fix a long standing bug in programming station address for Yukon
  controllers. sk(4) never reprogrammed station address for Yukon
  controllers so overriding station address with ifconfig(8) was not
  possible.
  Fix the bug by reprogramming all registers that control station
  address, flow-control and virtual station address. Virtual station
  address has no use at this moment since driver does not make use of
  fail over feature.
  
  Tested by:	"Mikhail T."  aldan.algebra.com>
  MFC after:	1 week

Modified:
  head/sys/dev/sk/if_sk.c

Modified: head/sys/dev/sk/if_sk.c
==============================================================================
--- head/sys/dev/sk/if_sk.c	Sat Nov  6 21:54:32 2010	(r214898)
+++ head/sys/dev/sk/if_sk.c	Sat Nov  6 22:07:22 2010	(r214899)
@@ -3356,6 +3356,7 @@ sk_init_yukon(sc_if)
 	u_int16_t		reg;
 	struct sk_softc		*sc;
 	struct ifnet		*ifp;
+	u_int8_t		*eaddr;
 	int			i;
 
 	SK_IF_LOCK_ASSERT(sc_if);
@@ -3431,19 +3432,19 @@ sk_init_yukon(sc_if)
 		reg |= YU_SMR_MFL_JUMBO;
 	SK_YU_WRITE_2(sc_if, YUKON_SMR, reg);
 
-	/* Setup Yukon's address */
-	for (i = 0; i < 3; i++) {
-		/* Write Source Address 1 (unicast filter) */
+	/* Setup Yukon's station address */
+	eaddr = IF_LLADDR(sc_if->sk_ifp);
+	for (i = 0; i < 3; i++)
+		SK_YU_WRITE_2(sc_if, SK_MAC0_0 + i * 4,
+		    eaddr[i * 2] | eaddr[i * 2 + 1] << 8);
+	/* Set GMAC source address of flow control. */
+	for (i = 0; i < 3; i++)
 		SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4,
-			      IF_LLADDR(sc_if->sk_ifp)[i * 2] |
-			      IF_LLADDR(sc_if->sk_ifp)[i * 2 + 1] << 8);
-	}
-
-	for (i = 0; i < 3; i++) {
-		reg = sk_win_read_2(sc_if->sk_softc,
-				    SK_MAC1_0 + i * 2 + sc_if->sk_port * 8);
-		SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, reg);
-	}
+		    eaddr[i * 2] | eaddr[i * 2 + 1] << 8);
+	/* Set GMAC virtual address. */
+	for (i = 0; i < 3; i++)
+		SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4,
+		    eaddr[i * 2] | eaddr[i * 2 + 1] << 8);
 
 	/* Set Rx filter */
 	sk_rxfilter_yukon(sc_if);