From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 04:15:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D5BA106566B; Sun, 11 Jan 2009 04:15:44 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2EE358FC08; Sun, 11 Jan 2009 04:15:44 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0B4Fhk3018036; Sat, 10 Jan 2009 20:15:43 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0B4Fhp0018035; Sat, 10 Jan 2009 20:15:43 -0800 (PST) (envelope-from obrien) Date: Sat, 10 Jan 2009 20:15:43 -0800 From: "David O'Brien" To: Christoph Mallon Message-ID: <20090111041543.GB17602@dragon.NUXI.org> References: <200812262254.mBQMsrbR052676@svn.freebsd.org> <4960FA9A.1090509@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4960FA9A.1090509@gmx.de> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186504 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 04:15:44 -0000 On Sun, Jan 04, 2009 at 07:06:18PM +0100, Christoph Mallon wrote: > I'm pretty sure $SUPERNATURAL_BEING_OF_YOUR_CHOICE killed a kitten for the > ugly hack you added to mount. The moment you overflow a buffer, you are in > no man's land and there's no escape. I appended a patch, which solves this > issue once and for all: The argv array gets dynamically expanded, when its > limit is reached. > Please - for all kittens out there - commit this patch. Hi Christoph, Unfortunately your patch doesn't work. For a 'ufs' file system listed in /etc/fstab $ umount /foo $ mount /foo Does not work. I've committed a different patch. -- -- David (obrien@FreeBSD.org) Q: Because it reverses the logical flow of conversation. A: Why is top-posting (putting a reply at the top of the message) frowned upon? Let's not play "Jeopardy-style quoting" From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 04:39:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F022106566B; Sun, 11 Jan 2009 04:39:16 +0000 (UTC) (envelope-from prvs=julian=2559b44b0@elischer.org) Received: from smtp-outbound.ironport.com (smtp-outbound.ironport.com [63.251.108.112]) by mx1.freebsd.org (Postfix) with ESMTP id 19C878FC0A; Sun, 11 Jan 2009 04:39:16 +0000 (UTC) (envelope-from prvs=julian=2559b44b0@elischer.org) Received: from unknown (HELO julian-mac.elischer.org) ([10.251.60.87]) by smtp-outbound.ironport.com with ESMTP; 10 Jan 2009 20:10:41 -0800 Message-ID: <49697140.30205@elischer.org> Date: Sat, 10 Jan 2009 20:10:40 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: Robert Watson References: <200901091602.n09G2Jj1061164@svn.freebsd.org> <4967A500.30205@fsn.hu> <4967B6D9.90001@elischer.org> <4967C539.2060803@fsn.hu> <49686A30.4000205@fsn.hu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Attila Nagy , Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r186955 - in head/sys: conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 04:39:16 -0000 Robert Watson wrote: > > On Sat, 10 Jan 2009, Adrian Chadd wrote: > >> 2009/1/10 Robert Watson : >> >>> I think Julian's analysis, that this is more of an inet option than a >>> socket-layer option, seems more appropriate to me, the benefits of >>> portability in adopting the API used by OpenBSD/BSDI/etc seem more >>> compelling. We should make sure that, if we move to the socket >>> option used on those systems, we block setting it on non-supporting >>> protocols, or confusion will result. In particular, Adrian's change >>> only modified IPv4, not IPv6, so until it's implemented on IPv6 it >>> shouldn't be possible to set the option. >> >> I'm happy to (eventually) also implement the BSDI API once I actually >> spend time looking at what the difference in behaviours are. If we're >> lucky, the only difference is where the socket option hooks in and the >> actual network behaviour is the same. >> >> (Meanwhile, I think I have to go off and implement this particular >> behaviour in Squid, and see if the OpenBSD support indeed does >> function as advertised.) > > If the API turns out to be effectly semantically the same, or better, > then I think the suggestion is to entirely replace, rather than > supplement, the socket option you just added with it. There's no point > in having pointlessly divergent APIs where it can be avoided. I think just making the name the same should be enough.. > > Robert N M Watson > Computer Laboratory > University of Cambridge From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 05:59:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09BE2106564A; Sun, 11 Jan 2009 05:59:28 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB30F8FC08; Sun, 11 Jan 2009 05:59:27 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B5xR99018793; Sun, 11 Jan 2009 05:59:27 GMT (envelope-from chinsan@svn.freebsd.org) Received: (from chinsan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B5xRpZ018792; Sun, 11 Jan 2009 05:59:27 GMT (envelope-from chinsan@svn.freebsd.org) Message-Id: <200901110559.n0B5xRpZ018792@svn.freebsd.org> From: Chin-San Huang Date: Sun, 11 Jan 2009 05:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187043 - stable/6/usr.sbin/pkg_install/add X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 05:59:28 -0000 Author: chinsan (doc,ports committer) Date: Sun Jan 11 05:59:27 2009 New Revision: 187043 URL: http://svn.freebsd.org/changeset/base/187043 Log: Synchronize pkg_install(1) with HEAD: fix typo Modified: stable/6/usr.sbin/pkg_install/add/pkg_add.1 Modified: stable/6/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- stable/6/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 05:56:56 2009 (r187042) +++ stable/6/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 05:59:27 2009 (r187043) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2008 +.Dd Jan 4, 2009 .Dt PKG_ADD 1 .Os .Sh NAME @@ -90,7 +90,7 @@ if it is defined or in current directory .It Fl i , -no-deps Install the package without fetching and installing dependencies. -.It Fl I , -no-scripts +.It Fl I , -no-script If any installation scripts (pre-install or post-install) exist for a given package, do not execute them. .It Fl n , -dry-run From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 05:59:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B98110657B4; Sun, 11 Jan 2009 05:59:39 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 487168FC19; Sun, 11 Jan 2009 05:59:39 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B5xdVA018832; Sun, 11 Jan 2009 05:59:39 GMT (envelope-from chinsan@svn.freebsd.org) Received: (from chinsan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B5xdcG018831; Sun, 11 Jan 2009 05:59:39 GMT (envelope-from chinsan@svn.freebsd.org) Message-Id: <200901110559.n0B5xdcG018831@svn.freebsd.org> From: Chin-San Huang Date: Sun, 11 Jan 2009 05:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187044 - stable/7/usr.sbin/pkg_install/add X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 05:59:40 -0000 Author: chinsan (doc,ports committer) Date: Sun Jan 11 05:59:39 2009 New Revision: 187044 URL: http://svn.freebsd.org/changeset/base/187044 Log: Synchronize pkg_install(1) with HEAD: fix typo Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1 Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 05:59:27 2009 (r187043) +++ stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 05:59:39 2009 (r187044) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2008 +.Dd Jan 4, 2009 .Dt PKG_ADD 1 .Os .Sh NAME @@ -90,7 +90,7 @@ if it is defined or in current directory .It Fl i , -no-deps Install the package without fetching and installing dependencies. -.It Fl I , -no-scripts +.It Fl I , -no-script If any installation scripts (pre-install or post-install) exist for a given package, do not execute them. .It Fl n , -dry-run From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 07:56:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25460106566C for ; Sun, 11 Jan 2009 07:56:26 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 9286B8FC23 for ; Sun, 11 Jan 2009 07:56:25 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 11 Jan 2009 07:56:23 -0000 Received: from p54A3FBCD.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.251.205] by mail.gmx.net (mp071) with SMTP; 11 Jan 2009 08:56:23 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1/GSVM8ckXGxZdR0dnPLbBAi0FHlWTkyb5tUsmP4+ wf9gsaROxBX7SX Message-ID: <4969A626.6070908@gmx.de> Date: Sun, 11 Jan 2009 08:56:22 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: obrien@freebsd.org References: <200812262254.mBQMsrbR052676@svn.freebsd.org> <4960FA9A.1090509@gmx.de> <20090111041543.GB17602@dragon.NUXI.org> In-Reply-To: <20090111041543.GB17602@dragon.NUXI.org> Content-Type: multipart/mixed; boundary="------------070304040904040408080004" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.57,0.46 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186504 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 07:56:26 -0000 This is a multi-part message in MIME format. --------------070304040904040408080004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David O'Brien schrieb: > On Sun, Jan 04, 2009 at 07:06:18PM +0100, Christoph Mallon wrote: >> I'm pretty sure $SUPERNATURAL_BEING_OF_YOUR_CHOICE killed a kitten for the >> ugly hack you added to mount. The moment you overflow a buffer, you are in >> no man's land and there's no escape. I appended a patch, which solves this >> issue once and for all: The argv array gets dynamically expanded, when its >> limit is reached. >> Please - for all kittens out there - commit this patch. > > Hi Christoph, > Unfortunately your patch doesn't work. > > For a 'ufs' file system listed in /etc/fstab > $ umount /foo > $ mount /foo > > Does not work. Why haven't you told me earlier? It was a trivial glitch - just a missing "--mnt_argc;". I would've corrected it right away. I tested with a CD and this takes a different code path, which does not trigger the problem. Attached is the corrected patch. --------------070304040904040408080004 Content-Type: text/plain; name="mount.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mount.diff" Index: mount.c =================================================================== --- mount.c (Revision 187044) +++ mount.c (Arbeitskopie) @@ -69,20 +69,16 @@ #define MOUNT_META_OPTION_CURRENT "current" int debug, fstab_style, verbose; +static char **mnt_argv; +static int mnt_argv_size; +static int mnt_argc; -#define MAX_ARGS 100 -struct cpa { - char *a[MAX_ARGS]; - ssize_t m; - int c; -}; - char *catopt(char *, const char *); struct statfs *getmntpt(const char *); int hasopt(const char *, const char *); int ismounted(struct fstab *, struct statfs *, int); int isremountable(const char *); -void mangle(char *, struct cpa *); +static void mangle(char *); char *update_options(char *, char *, int); int mountfs(const char *, const char *, const char *, int, const char *, const char *); @@ -505,19 +501,21 @@ } static void -append_arg(struct cpa *sa, char *arg) +append_argv(char *arg) { - if (sa->c >= sa->m) - errx(1, "Cannot process more than %zd mount arguments", sa->m); - - sa->a[++sa->c] = arg; + if (mnt_argc == mnt_argv_size) { + mnt_argv_size = mnt_argv_size == 0 ? 16 : mnt_argv_size * 2; + mnt_argv = realloc(mnt_argv, sizeof(*mnt_argv) * mnt_argv_size); + if (mnt_argv == NULL) + errx(1, "realloc failed"); + } + mnt_argv[mnt_argc++] = arg; } int mountfs(const char *vfstype, const char *spec, const char *name, int flags, const char *options, const char *mntopts) { - struct cpa mnt_argv; struct statfs sf; int i, ret; char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; @@ -555,29 +553,28 @@ /* Construct the name of the appropriate mount command */ (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); - mnt_argv.m = MAX_ARGS; - mnt_argv.c = -1; - append_arg(&mnt_argv, execname); - mangle(optbuf, &mnt_argv); - append_arg(&mnt_argv, strdup(spec)); - append_arg(&mnt_argv, strdup(name)); - append_arg(&mnt_argv, NULL); + append_argv(execname); + mangle(optbuf); + append_argv(strdup(spec)); + append_argv(strdup(name)); + append_argv(NULL); + --mnt_argc; /* Do not count the terminating null pointer */ if (debug) { if (use_mountprog(vfstype)) printf("exec: mount_%s", vfstype); else printf("mount -t %s", vfstype); - for (i = 1; i < mnt_argv.c; i++) - (void)printf(" %s", mnt_argv.a[i]); + for (i = 1; i < mnt_argc; i++) + (void)printf(" %s", mnt_argv[i]); (void)printf("\n"); return (0); } if (use_mountprog(vfstype)) { - ret = exec_mountprog(name, execname, mnt_argv.a); + ret = exec_mountprog(name, execname, mnt_argv); } else { - ret = mount_fs(vfstype, mnt_argv.c, mnt_argv.a); + ret = mount_fs(vfstype, mnt_argc, mnt_argv); } free(optbuf); @@ -679,8 +676,8 @@ return (cp); } -void -mangle(char *options, struct cpa *a) +static void +mangle(char *options) { char *p, *s; @@ -715,15 +712,15 @@ sizeof(groupquotaeq) - 1) == 0) { continue; } else if (*p == '-') { - append_arg(a, p); + append_argv(p); p = strchr(p, '='); if (p != NULL) { *p = '\0'; - append_arg(a, p + 1); + append_argv(p + 1); } } else { - append_arg(a, strdup("-o")); - append_arg(a, p); + append_argv(strdup("-o")); + append_argv(p); } } } --------------070304040904040408080004-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 08:31:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AAD91065670; Sun, 11 Jan 2009 08:31:02 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77A9C8FC0C; Sun, 11 Jan 2009 08:31:02 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B8V22F021647; Sun, 11 Jan 2009 08:31:02 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B8V2Fc021646; Sun, 11 Jan 2009 08:31:02 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901110831.n0B8V2Fc021646@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 08:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187045 - stable/7/usr.sbin/nscd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 08:31:03 -0000 Author: maxim Date: Sun Jan 11 08:31:01 2009 New Revision: 187045 URL: http://svn.freebsd.org/changeset/base/187045 Log: MFC r186394: correct a database name. Modified: stable/7/usr.sbin/nscd/nscd.conf.5 Modified: stable/7/usr.sbin/nscd/nscd.conf.5 ============================================================================== --- stable/7/usr.sbin/nscd/nscd.conf.5 Sun Jan 11 05:59:39 2009 (r187044) +++ stable/7/usr.sbin/nscd/nscd.conf.5 Sun Jan 11 08:31:01 2009 (r187045) @@ -53,7 +53,7 @@ and a .Ar value . Usual cachenames are .Dq Li passwd , -.Dq Li groups , +.Dq Li group , .Dq Li hosts , .Dq Li services , .Dq Li protocols @@ -125,7 +125,7 @@ will act similarly to the NSCD. .Sy NOTE : this feature is currently experimental \[em] it supports only .Dq Li passwd , -.Dq Li groups +.Dq Li group and .Dq Li services cachenames. From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 08:34:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F00810656CA; Sun, 11 Jan 2009 08:34:52 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B7988FC19; Sun, 11 Jan 2009 08:34:52 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B8YqA9021781; Sun, 11 Jan 2009 08:34:52 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B8Yp0Q021780; Sun, 11 Jan 2009 08:34:51 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901110834.n0B8Yp0Q021780@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 08:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187046 - stable/7/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 08:34:52 -0000 Author: maxim Date: Sun Jan 11 08:34:51 2009 New Revision: 187046 URL: http://svn.freebsd.org/changeset/base/187046 Log: MFC r186498: fix typo. Modified: stable/7/usr.bin/netstat/inet6.c Modified: stable/7/usr.bin/netstat/inet6.c ============================================================================== --- stable/7/usr.bin/netstat/inet6.c Sun Jan 11 08:31:01 2009 (r187045) +++ stable/7/usr.bin/netstat/inet6.c Sun Jan 11 08:34:51 2009 (r187046) @@ -1058,7 +1058,7 @@ rip6_stats(u_long off, const char *name, #define p(f, m) if (rip6stat.f || sflag <= 1) \ printf(m, (uintmax_t)rip6stat.f, plural(rip6stat.f)) p(rip6s_ipackets, "\t%ju message%s received\n"); - p(rip6s_isum, "\t%ju checksum calcuration%s on inbound\n"); + p(rip6s_isum, "\t%ju checksum calculation%s on inbound\n"); p(rip6s_badsum, "\t%ju message%s with bad checksum\n"); p(rip6s_nosock, "\t%ju message%s dropped due to no socket\n"); p(rip6s_nosockmcast, From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 08:40:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BEB41065674; Sun, 11 Jan 2009 08:40:26 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 794978FC1D; Sun, 11 Jan 2009 08:40:26 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0B8eQhl021929; Sun, 11 Jan 2009 08:40:26 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0B8eQxD021928; Sun, 11 Jan 2009 08:40:26 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901110840.n0B8eQxD021928@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 08:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187047 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 08:40:27 -0000 Author: maxim Date: Sun Jan 11 08:40:26 2009 New Revision: 187047 URL: http://svn.freebsd.org/changeset/base/187047 Log: MFC r186274: sync comment and example. Modified: stable/7/usr.sbin/sysinstall/config.c Modified: stable/7/usr.sbin/sysinstall/config.c ============================================================================== --- stable/7/usr.sbin/sysinstall/config.c Sun Jan 11 08:34:51 2009 (r187046) +++ stable/7/usr.sbin/sysinstall/config.c Sun Jan 11 08:40:26 2009 (r187047) @@ -845,7 +845,7 @@ configNFSServer(dialogMenuItem *self) "kinds of access to your local file systems.\n" "Press [ENTER] now to invoke an editor on /etc/exports\n"); vsystem("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports"); - vsystem("echo '#/usr/src and /usr/ports read-only to machines named after trouble makers' >> /etc/exports"); + vsystem("echo '#/usr/src and /usr/obj read-only to machines named after trouble makers,' >> /etc/exports"); vsystem("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports"); vsystem("echo '#and, /a to a network of privileged machines allowed to write on it as root.' >> /etc/exports"); vsystem("echo '#/usr huey louie dewie' >> /etc/exports"); From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 10:50:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C037106564A; Sun, 11 Jan 2009 10:50:13 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88DE28FC0A; Sun, 11 Jan 2009 10:50:13 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BAoDL9026212; Sun, 11 Jan 2009 10:50:13 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BAoDA2026211; Sun, 11 Jan 2009 10:50:13 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901111050.n0BAoDA2026211@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 10:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187048 - stable/7/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 10:50:14 -0000 Author: maxim Date: Sun Jan 11 10:50:13 2009 New Revision: 187048 URL: http://svn.freebsd.org/changeset/base/187048 Log: Manually merge r183889:183890: do nothing in show_nat() for a test mode (-n). Modified: stable/7/sbin/ipfw/ipfw2.c Modified: stable/7/sbin/ipfw/ipfw2.c ============================================================================== --- stable/7/sbin/ipfw/ipfw2.c Sun Jan 11 08:40:26 2009 (r187047) +++ stable/7/sbin/ipfw/ipfw2.c Sun Jan 11 10:50:13 2009 (r187048) @@ -5983,6 +5983,9 @@ show_nat(int ac, char **av) { lrule = IPFW_DEFAULT_RULE; /* max ipfw rule number */ ac--; av++; + if (test_only) + return; + /* Parse parameters. */ for (cmd = IP_FW_NAT_GET_LOG, do_cfg = 0; ac != 0; ac--, av++) { if (!strncmp(av[0], "config", strlen(av[0]))) { From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 11:00:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAC921065680; Sun, 11 Jan 2009 11:00:56 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4478FC17; Sun, 11 Jan 2009 11:00:56 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BB0uCe026539; Sun, 11 Jan 2009 11:00:56 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BB0uG3026538; Sun, 11 Jan 2009 11:00:56 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901111100.n0BB0uG3026538@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 11:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187049 - stable/7/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 11:00:57 -0000 Author: maxim Date: Sun Jan 11 11:00:56 2009 New Revision: 187049 URL: http://svn.freebsd.org/changeset/base/187049 Log: Record merge r183889:183890. Modified: stable/7/sbin/ipfw/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 11:36:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AA2E1065672; Sun, 11 Jan 2009 11:36:00 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 886BE8FC14; Sun, 11 Jan 2009 11:36:00 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BBa0Da027210; Sun, 11 Jan 2009 11:36:00 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BBa0mU027209; Sun, 11 Jan 2009 11:36:00 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901111136.n0BBa0mU027209@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 11 Jan 2009 11:36: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: r187050 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 11:36:01 -0000 Author: maxim Date: Sun Jan 11 11:36:00 2009 New Revision: 187050 URL: http://svn.freebsd.org/changeset/base/187050 Log: o Tweak comments a bit. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jan 11 11:00:56 2009 (r187049) +++ head/sys/conf/NOTES Sun Jan 11 11:36:00 2009 (r187050) @@ -635,11 +635,11 @@ options ALTQ_DEBUG # IP optional behaviour. # IP_NONLOCALBIND disables the check that bind() usually makes that the -# Address is one that is assigned to an interface on this machine. +# address is one that is assigned to an interface on this machine. # It allows transparent proxies to pretend to be other machines. # How the packet GET to that machine is a problem solved elsewhere, # smart routers, ipfw fwd, etc. -options IP_NONLOCALBIND #Allow impersonation for proxies. +options IP_NONLOCALBIND # Allow impersonation for proxies. # netgraph(4). Enable the base netgraph code with the NETGRAPH option. # Individual node types can be enabled with the corresponding option From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 11:51:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E67B210659CF; Sun, 11 Jan 2009 11:51:18 +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 D31DD8FC14; Sun, 11 Jan 2009 11:51:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BBpI5r027597; Sun, 11 Jan 2009 11:51:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BBpIcA027596; Sun, 11 Jan 2009 11:51:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901111151.n0BBpIcA027596@svn.freebsd.org> From: Alexander Motin Date: Sun, 11 Jan 2009 11:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187051 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 11:51:19 -0000 Author: mav Date: Sun Jan 11 11:51:18 2009 New Revision: 187051 URL: http://svn.freebsd.org/changeset/base/187051 Log: MFC rev. 186907: Mark ng_vjc node as FORCE_WRITER to protect slcompress state. I think it can be the reason of livelock in netgraph reported by some mpd users. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netgraph/ng_vjc.c Modified: stable/7/sys/netgraph/ng_vjc.c ============================================================================== --- stable/7/sys/netgraph/ng_vjc.c Sun Jan 11 11:36:00 2009 (r187050) +++ stable/7/sys/netgraph/ng_vjc.c Sun Jan 11 11:51:18 2009 (r187051) @@ -249,6 +249,9 @@ ng_vjc_constructor(node_p node) NG_NODE_SET_PRIVATE(node, priv); + /* slcompress is not thread-safe. Protect it's state here. */ + NG_NODE_FORCE_WRITER(node); + /* Done */ return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 12:04:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DC8D10659B1; Sun, 11 Jan 2009 12:04:21 +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 2BD858FC0C; Sun, 11 Jan 2009 12:04:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BC4JWg027870; Sun, 11 Jan 2009 12:04:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BC4JtT027869; Sun, 11 Jan 2009 12:04:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901111204.n0BC4JtT027869@svn.freebsd.org> From: Alexander Motin Date: Sun, 11 Jan 2009 12:04: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: r187052 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 12:04:38 -0000 Author: mav Date: Sun Jan 11 12:04:18 2009 New Revision: 187052 URL: http://svn.freebsd.org/changeset/base/187052 Log: Fix unwanted crosschannel mixing, possible on some codecs like VIA VT1708B and Realtek ALC268. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sun Jan 11 11:51:18 2009 (r187051) +++ head/sys/dev/sound/pci/hda/hdac.c Sun Jan 11 12:04:18 2009 (r187052) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20081226_0122" +#define HDA_DRV_TEST_REV "20090110_0123" SND_DECLARE_FILE("$FreeBSD$"); @@ -5554,7 +5554,7 @@ hdac_audio_disable_crossas(struct hdac_d struct hdac_audio_ctl *ctl; int i, j; - /* Disable crossassociatement connections. */ + /* Disable crossassociatement and unwanted crosschannel connections. */ /* ... using selectors */ for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdac_widget_get(devinfo, i); @@ -5572,7 +5572,10 @@ hdac_audio_disable_crossas(struct hdac_d cw = hdac_widget_get(devinfo, w->conns[j]); if (cw == NULL || w->enable == 0) continue; - if (w->bindas == cw->bindas || cw->bindas == -2) + if (cw->bindas == -2) + continue; + if (w->bindas == cw->bindas && + (w->bindseqmask & cw->bindseqmask) != 0) continue; w->connsenable[j] = 0; HDA_BOOTHVERBOSE( @@ -5591,7 +5594,8 @@ hdac_audio_disable_crossas(struct hdac_d if (ctl->widget->bindas == -2 || ctl->childwidget->bindas == -2) continue; - if (ctl->widget->bindas != ctl->childwidget->bindas) { + if (ctl->widget->bindas != ctl->childwidget->bindas || + (ctl->widget->bindseqmask & ctl->childwidget->bindseqmask) == 0) { ctl->forcemute = 1; ctl->muted = HDA_AMP_MUTE_ALL; ctl->left = 0; From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 13:51:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C5481065670; Sun, 11 Jan 2009 13:51:04 +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 89F708FC1E; Sun, 11 Jan 2009 13:51:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BDp4JE029873; Sun, 11 Jan 2009 13:51:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BDp427029872; Sun, 11 Jan 2009 13:51:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901111351.n0BDp427029872@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 11 Jan 2009 13:51: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: r187053 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 13:51:05 -0000 Author: trasz Date: Sun Jan 11 13:51:04 2009 New Revision: 187053 URL: http://svn.freebsd.org/changeset/base/187053 Log: Prevent a panic that happens on SMP machines when removing a disk with many writes queued up. Reviewed by: phk, scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/geom/geom_vfs.c Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Sun Jan 11 12:04:18 2009 (r187052) +++ head/sys/geom/geom_vfs.c Sun Jan 11 13:51:04 2009 (r187053) @@ -71,6 +71,16 @@ g_vfs_done(struct bio *bip) struct buf *bp; int vfslocked; + /* + * Provider ('bio_to') could have withered away sometime + * between incrementing the 'nend' in g_io_deliver() and now, + * making 'bio_to' a dangling pointer. We cannot do that + * in g_wither_geom(), as it would require going over + * the 'g_bio_run_up' list, resetting the pointer. + */ + if (bip->bio_from->provider == NULL) + bip->bio_to = NULL; + if (bip->bio_error) { printf("g_vfs_done():"); g_print_bio(bip); @@ -136,7 +146,7 @@ g_vfs_orphan(struct g_consumer *cp) g_detach(cp); /* - * Do not destroy the geom. Filesystem will do this during unmount. + * Do not destroy the geom. Filesystem will do that during unmount. */ } From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 13:55:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30E5106564A; Sun, 11 Jan 2009 13:55:31 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FBC98FC0A; Sun, 11 Jan 2009 13:55:31 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BDtVsq030000; Sun, 11 Jan 2009 13:55:31 GMT (envelope-from chinsan@svn.freebsd.org) Received: (from chinsan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BDtVNf029999; Sun, 11 Jan 2009 13:55:31 GMT (envelope-from chinsan@svn.freebsd.org) Message-Id: <200901111355.n0BDtVNf029999@svn.freebsd.org> From: Chin-San Huang Date: Sun, 11 Jan 2009 13:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187054 - stable/6/usr.sbin/pkg_install/add X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 13:55:32 -0000 Author: chinsan (doc,ports committer) Date: Sun Jan 11 13:55:31 2009 New Revision: 187054 URL: http://svn.freebsd.org/changeset/base/187054 Log: Use full name (noticed by: ru@ Modified: stable/6/usr.sbin/pkg_install/add/pkg_add.1 Modified: stable/6/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- stable/6/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:51:04 2009 (r187053) +++ stable/6/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:55:31 2009 (r187054) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 4, 2009 +.Dd January 4, 2009 .Dt PKG_ADD 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 13:56:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE1661065672; Sun, 11 Jan 2009 13:56:08 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB41E8FC22; Sun, 11 Jan 2009 13:56:08 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BDu8Se030048; Sun, 11 Jan 2009 13:56:08 GMT (envelope-from chinsan@svn.freebsd.org) Received: (from chinsan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BDu8ce030047; Sun, 11 Jan 2009 13:56:08 GMT (envelope-from chinsan@svn.freebsd.org) Message-Id: <200901111356.n0BDu8ce030047@svn.freebsd.org> From: Chin-San Huang Date: Sun, 11 Jan 2009 13:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187055 - stable/7/usr.sbin/pkg_install/add X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 13:56:10 -0000 Author: chinsan (doc,ports committer) Date: Sun Jan 11 13:56:08 2009 New Revision: 187055 URL: http://svn.freebsd.org/changeset/base/187055 Log: Use full name (noticed by: ru@ Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1 Modified: stable/7/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:55:31 2009 (r187054) +++ stable/7/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:56:08 2009 (r187055) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 4, 2009 +.Dd January 4, 2009 .Dt PKG_ADD 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 13:56:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E287F1065673; Sun, 11 Jan 2009 13:56:55 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D082A8FC08; Sun, 11 Jan 2009 13:56:55 +0000 (UTC) (envelope-from chinsan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BDutFQ030100; Sun, 11 Jan 2009 13:56:55 GMT (envelope-from chinsan@svn.freebsd.org) Received: (from chinsan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BDutrG030099; Sun, 11 Jan 2009 13:56:55 GMT (envelope-from chinsan@svn.freebsd.org) Message-Id: <200901111356.n0BDutrG030099@svn.freebsd.org> From: Chin-San Huang Date: Sun, 11 Jan 2009 13:56: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: r187056 - head/usr.sbin/pkg_install/add X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 13:56:56 -0000 Author: chinsan (doc,ports committer) Date: Sun Jan 11 13:56:55 2009 New Revision: 187056 URL: http://svn.freebsd.org/changeset/base/187056 Log: Use full name (noticed by: ru@ Modified: head/usr.sbin/pkg_install/add/pkg_add.1 Modified: head/usr.sbin/pkg_install/add/pkg_add.1 ============================================================================== --- head/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:56:08 2009 (r187055) +++ head/usr.sbin/pkg_install/add/pkg_add.1 Sun Jan 11 13:56:55 2009 (r187056) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 4, 2009 +.Dd January 4, 2009 .Dt PKG_ADD 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 16:21:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E89ED106566C; Sun, 11 Jan 2009 16:21:33 +0000 (UTC) (envelope-from wilko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D63EA8FC20; Sun, 11 Jan 2009 16:21:33 +0000 (UTC) (envelope-from wilko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BGLXqo032973; Sun, 11 Jan 2009 16:21:33 GMT (envelope-from wilko@svn.freebsd.org) Received: (from wilko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BGLXVt032972; Sun, 11 Jan 2009 16:21:33 GMT (envelope-from wilko@svn.freebsd.org) Message-Id: <200901111621.n0BGLXVt032972@svn.freebsd.org> From: Wilko Bulte Date: Sun, 11 Jan 2009 16:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187057 - stable/7/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 16:21:34 -0000 Author: wilko Date: Sun Jan 11 16:21:33 2009 New Revision: 187057 URL: http://svn.freebsd.org/changeset/base/187057 Log: MFC: r186142 By default assume a 8139 chip if the EEPROM contents prove inconclusive. The same LOM hardware with goofed-up EEPROM programming also needed reading the Ethernet address from the chips registers as the EEPROM did not have a sensible address programmed. Patch developed by: pyun@ Funky hardware on loan: www.id-it.nl Modified: stable/7/sys/pci/if_rl.c Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Sun Jan 11 13:56:55 2009 (r187056) +++ stable/7/sys/pci/if_rl.c Sun Jan 11 16:21:33 2009 (r187057) @@ -857,9 +857,15 @@ rl_attach(device_t dev) } if (sc->rl_type == 0) { - device_printf(dev, "unknown device ID: %x\n", rl_did); - error = ENXIO; - goto fail; + device_printf(dev, "unknown device ID: %x assuming 8139\n", + rl_did); + sc->rl_type = RL_8139; + /* + * Read RL_IDR register to get ethernet address as accessing + * EEPROM may not extract correct address. + */ + for (i = 0; i < ETHER_ADDR_LEN; i++) + eaddr[i] = CSR_READ_1(sc, RL_IDR0 + i); } /* From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 16:40:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AF441065674; Sun, 11 Jan 2009 16:40:57 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 59F138FC17; Sun, 11 Jan 2009 16:40:57 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 5840420CC44; Sun, 11 Jan 2009 11:22:41 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 11 Jan 2009 11:22:41 -0500 X-Sasl-enc: +8teh+E1c9SDoXGUnypxZH51mrbeXvzkorAHXtJd1aSK 1231690960 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id C3776133F3; Sun, 11 Jan 2009 11:22:39 -0500 (EST) Message-ID: <496A1CCE.90701@FreeBSD.org> Date: Sun, 11 Jan 2009 16:22:38 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.19 (X11/20090107) MIME-Version: 1.0 To: Attila Nagy References: <200901091602.n09G2Jj1061164@svn.freebsd.org> <4967A500.30205@fsn.hu> <4967B6D9.90001@elischer.org> <4967C539.2060803@fsn.hu> <49686A30.4000205@fsn.hu> <4968E8B4.9090309@fsn.hu> In-Reply-To: <4968E8B4.9090309@fsn.hu> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Robert Watson , Julian Elischer , svn-src-head@freebsd.org Subject: Re: svn commit: r186955 - in head/sys: conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 16:40:58 -0000 Attila Nagy wrote: > ... > Do you know anything else which can do that now with an easy API > (accessible from high level languages like perl or python)? I sent a patch to the Python guys to implement the protocol-independent multicast socket API a good while back. It takes a long time to get feedback unless you're "in the loop" with the current development version of Python and know the developers. Adding support to Python for socket options itself isn't terribly difficult -- the socket module is reasonably lightweight C glue code -- it just takes time to jive with their development process, it seems. Having said that, their reference platform(s) already implement these particular socket options, so I guess it may just be down to lack of interest/time, which does happen... cheers BMS From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 17:11:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E59251065730; Sun, 11 Jan 2009 17:11:01 +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 92E278FC12; Sun, 11 Jan 2009 17:11:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BHB1u1033853; Sun, 11 Jan 2009 17:11:01 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BHB1eI033852; Sun, 11 Jan 2009 17:11:01 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901111711.n0BHB1eI033852@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 11 Jan 2009 17:11:01 +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: r187058 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 17:11:03 -0000 Author: trasz Date: Sun Jan 11 17:11:01 2009 New Revision: 187058 URL: http://svn.freebsd.org/changeset/base/187058 Log: Fix msdosfs_print(), which in turn fixes "show lockedvnods" for msdosfs vnodes. Reviewed by: kib Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/fs/msdosfs/msdosfs_denode.c Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Sun Jan 11 16:21:33 2009 (r187057) +++ head/sys/fs/msdosfs/msdosfs_denode.c Sun Jan 11 17:11:01 2009 (r187058) @@ -168,6 +168,7 @@ deget(pmp, dirclust, diroffset, depp) ldep->de_dirclust = dirclust; ldep->de_diroffset = diroffset; ldep->de_inode = inode; + ldep->de_dev = pmp->pm_devvp->v_rdev; fc_purge(ldep, 0); /* init the fat cache for this denode */ lockmgr(nvp->v_vnlock, LK_EXCLUSIVE, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 18:40:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A7791065692; Sun, 11 Jan 2009 18:40:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EADA78FC20; Sun, 11 Jan 2009 18:40:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BIeuLb035548; Sun, 11 Jan 2009 18:40:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BIeuG6035547; Sun, 11 Jan 2009 18:40:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200901111840.n0BIeuG6035547@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 11 Jan 2009 18:40: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: r187059 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 18:40:58 -0000 Author: bz Date: Sun Jan 11 18:40:56 2009 New Revision: 187059 URL: http://svn.freebsd.org/changeset/base/187059 Log: Add a short section talking about jails and file systems; mention the mountand jail-aware file systems as well as quota. PR: kern/68192 Reviewed by: simon MFC after: 2 weeks Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Jan 11 17:11:01 2009 (r187058) +++ head/usr.sbin/jail/jail.8 Sun Jan 11 18:40:56 2009 (r187059) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd January 11, 2009 .Dt JAIL 8 .Os .Sh NAME @@ -480,6 +480,29 @@ pkill -j 3 or: .Pp .Dl "killall -j 3" +.Ss "Jails and File Systems" +It is not possible to +.Xr mount 8 +or +.Xr unmount 8 +any file system inside a jail unless the file system is marked +jail-friendly. +See +.Va security.jail.mount_allowed +in the +.Va "Sysctl MIB Entries" +section. +.Pp +Multiple jails sharing the same file system can influence each other. +For example a user in one jail can fill the file system also +leaving no space for processes in the other jail. +Trying to use +.Xr quota 1 +to prevent this will not work either as the file system quotas +are not aware of jails but only look at the user and group IDs. +This means the same user ID in two jails share the same file +system quota. +One would need to use one file system per jail to make this working. .Ss "Sysctl MIB Entries" Certain aspects of the jail containments environment may be modified from the host environment using @@ -614,6 +637,7 @@ and .Xr pgrep 1 , .Xr pkill 1 , .Xr ps 1 , +.Xr quota 1 , .Xr chroot 2 , .Xr jail 2 , .Xr jail_attach 2 , @@ -626,6 +650,7 @@ and .Xr jexec 8 , .Xr jls 8 , .Xr mount 8 , +.Xr unmount 8 , .Xr named 8 , .Xr reboot 8 , .Xr rpcbind 8 , From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 18:59:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C127310656C3; Sun, 11 Jan 2009 18:59:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFCD58FC0A; Sun, 11 Jan 2009 18:59:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BIxEhF035916; Sun, 11 Jan 2009 18:59:14 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BIxEfn035915; Sun, 11 Jan 2009 18:59:14 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901111859.n0BIxEfn035915@svn.freebsd.org> From: Sam Leffler Date: Sun, 11 Jan 2009 18:59: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: r187060 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 18:59:15 -0000 Author: sam Date: Sun Jan 11 18:59:14 2009 New Revision: 187060 URL: http://svn.freebsd.org/changeset/base/187060 Log: add missing return that broke WPA1+2 support Submitted by: "Jared Go" Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Jan 11 18:40:56 2009 (r187059) +++ head/sys/net80211/ieee80211_ioctl.c Sun Jan 11 18:59:14 2009 (r187060) @@ -2696,6 +2696,7 @@ ieee80211_ioctl_set80211(struct ieee8021 break; case 3: if ((vap->iv_caps & IEEE80211_C_WPA) != IEEE80211_C_WPA) + return EOPNOTSUPP; flags |= IEEE80211_F_WPA1 | IEEE80211_F_WPA2; break; default: /* Can't set any -> error */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 19:41:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3248D106566C; Sun, 11 Jan 2009 19:41:39 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 064148FC1D; Sun, 11 Jan 2009 19:41:39 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BJfcYi036686; Sun, 11 Jan 2009 19:41:38 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BJfcLf036683; Sun, 11 Jan 2009 19:41:38 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901111941.n0BJfcLf036683@svn.freebsd.org> From: Andrew Thompson Date: Sun, 11 Jan 2009 19:41:38 +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: r187061 - in head/sys/dev/usb2: image misc storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 19:41:39 -0000 Author: thompsa Date: Sun Jan 11 19:41:38 2009 New Revision: 187061 URL: http://svn.freebsd.org/changeset/base/187061 Log: Remove unneeded includes. Modified: head/sys/dev/usb2/image/uscanner2.c head/sys/dev/usb2/misc/ufm2.c head/sys/dev/usb2/storage/urio2.c Modified: head/sys/dev/usb2/image/uscanner2.c ============================================================================== --- head/sys/dev/usb2/image/uscanner2.c Sun Jan 11 18:59:14 2009 (r187060) +++ head/sys/dev/usb2/image/uscanner2.c Sun Jan 11 19:41:38 2009 (r187061) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/misc/ufm2.c ============================================================================== --- head/sys/dev/usb2/misc/ufm2.c Sun Jan 11 18:59:14 2009 (r187060) +++ head/sys/dev/usb2/misc/ufm2.c Sun Jan 11 19:41:38 2009 (r187061) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/storage/urio2.c ============================================================================== --- head/sys/dev/usb2/storage/urio2.c Sun Jan 11 18:59:14 2009 (r187060) +++ head/sys/dev/usb2/storage/urio2.c Sun Jan 11 19:41:38 2009 (r187061) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 20:01:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 085D7106564A; Sun, 11 Jan 2009 20:01:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAF498FC14; Sun, 11 Jan 2009 20:01:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BK1hU1037085; Sun, 11 Jan 2009 20:01:43 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BK1how037084; Sun, 11 Jan 2009 20:01:43 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200901112001.n0BK1how037084@svn.freebsd.org> From: Robert Watson Date: Sun, 11 Jan 2009 20:01: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: r187062 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 20:01:44 -0000 Author: rwatson Date: Sun Jan 11 20:01:43 2009 New Revision: 187062 URL: http://svn.freebsd.org/changeset/base/187062 Log: Since we allow conditional allocation of labels on syncache entries, remove historic assertion that labels are always present. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Jan 11 19:41:38 2009 (r187061) +++ head/sys/netinet/tcp_syncache.c Sun Jan 11 20:01:43 2009 (r187062) @@ -1070,8 +1070,6 @@ _syncache_add(struct in_conninfo *inc, s * have an initialized label we can use. */ mac_syncache_destroy(&maclabel); - KASSERT(sc->sc_label != NULL, - ("%s: label not initialized", __func__)); #endif /* Retransmit SYN|ACK and reset retransmit count. */ if ((s = tcp_log_addrs(&sc->sc_inc, th, NULL, NULL))) { From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 21:24:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D9841065702; Sun, 11 Jan 2009 21:24:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 292408FC13; Sun, 11 Jan 2009 21:24:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BLO9Tl038743; Sun, 11 Jan 2009 21:24:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BLO8Wf038719; Sun, 11 Jan 2009 21:24:08 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200901112124.n0BLO8Wf038719@svn.freebsd.org> From: Robert Watson Date: Sun, 11 Jan 2009 21:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187063 - in vendor/openbsm/dist: . bin/auditd bin/auditreduce bsm libauditd libbsm man sys/bsm test/bsm test/reference X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 21:24:09 -0000 Author: rwatson Date: Sun Jan 11 21:24:07 2009 New Revision: 187063 URL: http://svn.freebsd.org/changeset/base/187063 Log: Vendor import of OpenBSM 1.1 alpha5, which incorporates the following changes since the last imported OpenBSM release: OpenBSM 1.1 alpha 5 - Stub libauditd(3) man page added. - All BSM error number constants with BSM_ERRNO_. - Interfaces to convert between local and BSM socket types and protocol families have been added: au_bsm_to_domain(3), au_bsm_to_socket_type(3), au_domain_to_bsm(3), and au_socket_type_to_bsm(3), along with definitions of constants in audit_domain.h and audit_socket_type.h. This improves interoperability by converting local constant spaces, which vary by OS, to and from Solaris constants (where available) or OpenBSM constants for protocol domains not present in Solaris (a fair number). These routines should be used when generating and interpreting extended socket tokens. - Fix build warnings with full gcc warnings enabled on most supported platforms. - Don't compile error strings into bsm_errno.c when building it in the kernel environment. - When started by launchd, use the label com.apple.auditd rather than org.trustedbsd.auditd. Obtained from: TrustedBSD Project Sponsored by: Apple Inc. Added: vendor/openbsm/dist/libauditd/libauditd.3 (contents, props changed) vendor/openbsm/dist/libbsm/au_domain.3 (contents, props changed) vendor/openbsm/dist/libbsm/au_socket_type.3 (contents, props changed) vendor/openbsm/dist/libbsm/bsm_domain.c (contents, props changed) vendor/openbsm/dist/libbsm/bsm_socket_type.c (contents, props changed) vendor/openbsm/dist/sys/bsm/audit_domain.h (contents, props changed) vendor/openbsm/dist/sys/bsm/audit_socket_type.h (contents, props changed) Modified: vendor/openbsm/dist/INSTALL vendor/openbsm/dist/NEWS vendor/openbsm/dist/VERSION vendor/openbsm/dist/bin/auditd/auditd.8 vendor/openbsm/dist/bin/auditd/auditd.c vendor/openbsm/dist/bin/auditd/auditd_darwin.c vendor/openbsm/dist/bin/auditd/auditd_fbsd.c vendor/openbsm/dist/bin/auditreduce/auditreduce.c vendor/openbsm/dist/bsm/auditd_lib.h vendor/openbsm/dist/bsm/libbsm.h vendor/openbsm/dist/configure vendor/openbsm/dist/configure.ac vendor/openbsm/dist/libauditd/Makefile.am vendor/openbsm/dist/libauditd/Makefile.in vendor/openbsm/dist/libauditd/auditd_lib.c vendor/openbsm/dist/libbsm/Makefile.am vendor/openbsm/dist/libbsm/Makefile.in vendor/openbsm/dist/libbsm/au_token.3 vendor/openbsm/dist/libbsm/bsm_audit.c vendor/openbsm/dist/libbsm/bsm_errno.c vendor/openbsm/dist/libbsm/bsm_io.c vendor/openbsm/dist/libbsm/bsm_token.c vendor/openbsm/dist/libbsm/libbsm.3 vendor/openbsm/dist/man/audit_user.5 vendor/openbsm/dist/sys/bsm/Makefile.am vendor/openbsm/dist/sys/bsm/Makefile.in vendor/openbsm/dist/sys/bsm/audit.h vendor/openbsm/dist/sys/bsm/audit_errno.h vendor/openbsm/dist/sys/bsm/audit_record.h vendor/openbsm/dist/test/bsm/generate.c vendor/openbsm/dist/test/reference/E2BIG_record vendor/openbsm/dist/test/reference/EACCES_record vendor/openbsm/dist/test/reference/EBADF_record vendor/openbsm/dist/test/reference/EBUSY_record vendor/openbsm/dist/test/reference/ECHILD_record vendor/openbsm/dist/test/reference/EDEADLK_record vendor/openbsm/dist/test/reference/EEXIST_record vendor/openbsm/dist/test/reference/EFAULT_record vendor/openbsm/dist/test/reference/EFBIG_record vendor/openbsm/dist/test/reference/EINTR_record vendor/openbsm/dist/test/reference/EINVAL_record vendor/openbsm/dist/test/reference/EIO_record vendor/openbsm/dist/test/reference/EISDIR_record vendor/openbsm/dist/test/reference/EMFILE_record vendor/openbsm/dist/test/reference/EMLINK_record vendor/openbsm/dist/test/reference/ENFILE_record vendor/openbsm/dist/test/reference/ENODEV_record vendor/openbsm/dist/test/reference/ENOENT_record vendor/openbsm/dist/test/reference/ENOEXEC_record vendor/openbsm/dist/test/reference/ENOMEM_record vendor/openbsm/dist/test/reference/ENOSPC_record vendor/openbsm/dist/test/reference/ENOTBLK_record vendor/openbsm/dist/test/reference/ENOTDIR_record vendor/openbsm/dist/test/reference/ENOTTY_record vendor/openbsm/dist/test/reference/ENXIO_record vendor/openbsm/dist/test/reference/EPERM_record vendor/openbsm/dist/test/reference/EPIPE_record vendor/openbsm/dist/test/reference/EROFS_record vendor/openbsm/dist/test/reference/ESPIPE_record vendor/openbsm/dist/test/reference/ESRCH_record vendor/openbsm/dist/test/reference/ETXTBSY_record vendor/openbsm/dist/test/reference/EXDEV_record vendor/openbsm/dist/test/reference/arg32_record vendor/openbsm/dist/test/reference/data_record vendor/openbsm/dist/test/reference/data_token vendor/openbsm/dist/test/reference/file_record vendor/openbsm/dist/test/reference/in_addr_record vendor/openbsm/dist/test/reference/ip_record vendor/openbsm/dist/test/reference/ipc_record vendor/openbsm/dist/test/reference/iport_record vendor/openbsm/dist/test/reference/opaque_record vendor/openbsm/dist/test/reference/path_record vendor/openbsm/dist/test/reference/process32_record vendor/openbsm/dist/test/reference/process32ex_record-IPv4 vendor/openbsm/dist/test/reference/process32ex_record-IPv6 vendor/openbsm/dist/test/reference/process64_record vendor/openbsm/dist/test/reference/process64ex_record-IPv4 vendor/openbsm/dist/test/reference/process64ex_record-IPv6 vendor/openbsm/dist/test/reference/return32_record vendor/openbsm/dist/test/reference/seq_record vendor/openbsm/dist/test/reference/socketex_record vendor/openbsm/dist/test/reference/socketex_token vendor/openbsm/dist/test/reference/subject32_record vendor/openbsm/dist/test/reference/subject32ex_record vendor/openbsm/dist/test/reference/text_record vendor/openbsm/dist/test/reference/zonename_record Modified: vendor/openbsm/dist/INSTALL ============================================================================== --- vendor/openbsm/dist/INSTALL Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/INSTALL Sun Jan 11 21:24:07 2009 (r187063) @@ -9,6 +9,12 @@ support are built conditionally. Typica ./configure make +If doing development work on OpenBSM with gcc, the following invocation of +configure may be preferred in order to generate full compiler warnings and +force the compile to fail if a warning is found: + + CFLAGS="-Wall -Werror" ./configure + To install, use: make install Modified: vendor/openbsm/dist/NEWS ============================================================================== --- vendor/openbsm/dist/NEWS Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/NEWS Sun Jan 11 21:24:07 2009 (r187063) @@ -1,5 +1,24 @@ OpenBSM Version History +OpenBSM 1.1 alpha 5 + +- Stub libauditd(3) man page added. +- All BSM error number constants with BSM_ERRNO_. +- Interfaces to convert between local and BSM socket types and protocol + families have been added: au_bsm_to_domain(3), au_bsm_to_socket_type(3), + au_domain_to_bsm(3), and au_socket_type_to_bsm(3), along with definitions + of constants in audit_domain.h and audit_socket_type.h. This improves + interoperability by converting local constant spaces, which vary by OS, to + and from Solaris constants (where available) or OpenBSM constants for + protocol domains not present in Solaris (a fair number). These routines + should be used when generating and interpreting extended socket tokens. +- Fix build warnings with full gcc warnings enabled on most supported + platforms. +- Don't compile error strings into bsm_errno.c when building it in the kernel + environment. +- When started by launchd, use the label com.apple.auditd rather than + org.trustedbsd.auditd. + OpenBSM 1.1 alpha 4 - With the addition of BSM error number mapping, we also need to map the @@ -393,4 +412,4 @@ OpenBSM 1.0 alpha 1 to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#21 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#27 $ Modified: vendor/openbsm/dist/VERSION ============================================================================== --- vendor/openbsm/dist/VERSION Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/VERSION Sun Jan 11 21:24:07 2009 (r187063) @@ -1 +1 @@ -OPENBSM_1_1_ALPHA_4 +OPENBSM_1_1_ALPHA_5 Modified: vendor/openbsm/dist/bin/auditd/auditd.8 ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd.8 Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/bin/auditd/auditd.8 Sun Jan 11 21:24:07 2009 (r187063) @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#16 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#17 $ .\" .Dd December 11, 2008 .Dt AUDITD 8 @@ -115,6 +115,7 @@ and are no longer available as arguments .Nm . .Sh SEE ALSO .Xr asl 3 , +.Xr libauditd 3 , .Xr audit 4 , .Xr audit_class 5 , .Xr audit_control 5 , Modified: vendor/openbsm/dist/bin/auditd/auditd.c ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd.c Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/bin/auditd/auditd.c Sun Jan 11 21:24:07 2009 (r187063) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#40 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#41 $ */ #include @@ -252,7 +252,7 @@ do_trail_file(void) */ err = auditd_read_dirs(audit_warn_soft, audit_warn_hard); if (err) { - auditd_log_err("auditd_read_dirs() %s: %m", + auditd_log_err("auditd_read_dirs(): %s", auditd_strerror(err)); if (err == ADE_HARDLIM) audit_warn_allhard(); Modified: vendor/openbsm/dist/bin/auditd/auditd_darwin.c ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd_darwin.c Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/bin/auditd/auditd_darwin.c Sun Jan 11 21:24:07 2009 (r187063) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#2 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#3 $ */ #include @@ -83,7 +83,7 @@ static int max_idletime = 0; #endif /* __BSM_INTERNAL_NOTIFY_KEY */ #ifndef __AUDIT_LAUNCHD_LABEL -#define __AUDIT_LAUNCHD_LABEL "org.trustedbsd.auditd" +#define __AUDIT_LAUNCHD_LABEL "com.apple.auditd" #endif /* __AUDIT_LAUNCHD_LABEL */ #define MAX_MSG_SIZE 4096 @@ -100,7 +100,7 @@ auditd_openlog(int debug, gid_t gid) if (debug) opt = ASL_OPT_STDERR; - au_aslclient = asl_open("auditd", "org.trustedbsd.auditd", opt); + au_aslclient = asl_open("auditd", "com.apple.auditd", opt); au_aslmsg = asl_new(ASL_TYPE_MSG); #ifdef ASL_KEY_READ_UID Modified: vendor/openbsm/dist/bin/auditd/auditd_fbsd.c ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd_fbsd.c Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/bin/auditd/auditd_fbsd.c Sun Jan 11 21:24:07 2009 (r187063) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#2 $ */ #include @@ -35,9 +35,11 @@ #include #include +#include #include +#include #include -#include +#include #include #include Modified: vendor/openbsm/dist/bin/auditreduce/auditreduce.c ============================================================================== --- vendor/openbsm/dist/bin/auditreduce/auditreduce.c Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/bin/auditreduce/auditreduce.c Sun Jan 11 21:24:07 2009 (r187063) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#29 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#31 $ */ /* @@ -41,6 +41,9 @@ */ #include + +#define _GNU_SOURCE /* Required for strptime() on glibc2. */ + #ifdef HAVE_FULL_QUEUE_H #include #else Modified: vendor/openbsm/dist/bsm/auditd_lib.h ============================================================================== --- vendor/openbsm/dist/bsm/auditd_lib.h Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/bsm/auditd_lib.h Sun Jan 11 21:24:07 2009 (r187063) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bsm/auditd_lib.h#2 $ + * $P4: //depot/projects/trustedbsd/openbsm/bsm/auditd_lib.h#3 $ */ #ifndef _BSM_AUDITD_LIB_H_ @@ -57,7 +57,7 @@ * Path of auditd plist file for launchd. */ #define AUDITD_PLIST_FILE \ - "/System/Library/LaunchDaemons/org.trustedbsd.auditd.plist" + "/System/Library/LaunchDaemons/com.apple.auditd.plist" /* * Error return codes for auditd_lib functions. Modified: vendor/openbsm/dist/bsm/libbsm.h ============================================================================== --- vendor/openbsm/dist/bsm/libbsm.h Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/bsm/libbsm.h Sun Jan 11 21:24:07 2009 (r187063) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#40 $ + * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#41 $ */ #ifndef _LIBBSM_H_ @@ -821,14 +821,22 @@ void au_print_tok_xml(FILE *outfp, to */ void au_print_xml_header(FILE *outfp); void au_print_xml_footer(FILE *outfp); -__END_DECLS /* - * Functions relating to BSM<->errno conversion. - */ -int au_bsm_to_errno(u_char bsm_error, int *errorp); -u_char au_errno_to_bsm(int error); -const char *au_strerror(u_char bsm_error); + * BSM library routines for converting between local and BSM constant spaces. + * (Note: some of these are replicated in audit_record.h for the benefit of + * the FreeBSD and Mac OS X kernels) + */ +int au_bsm_to_domain(u_short bsm_domain, int *local_domainp); +int au_bsm_to_errno(u_char bsm_error, int *errorp); +int au_bsm_to_socket_type(u_short bsm_socket_type, + int *local_socket_typep); +u_short au_domain_to_bsm(int local_domain); +u_char au_errno_to_bsm(int local_errno); +u_short au_socket_type_to_bsm(int local_socket_type); + +const char *au_strerror(u_char bsm_error); +__END_DECLS /* * The remaining APIs are associated with Apple's BSM implementation, in Modified: vendor/openbsm/dist/configure ============================================================================== --- vendor/openbsm/dist/configure Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/configure Sun Jan 11 21:24:07 2009 (r187063) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#47 . +# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#49 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for OpenBSM 1.1alpha4. +# Generated by GNU Autoconf 2.61 for OpenBSM 1.1alpha5. # # Report bugs to . # @@ -729,8 +729,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='OpenBSM' PACKAGE_TARNAME='openbsm' -PACKAGE_VERSION='1.1alpha4' -PACKAGE_STRING='OpenBSM 1.1alpha4' +PACKAGE_VERSION='1.1alpha5' +PACKAGE_STRING='OpenBSM 1.1alpha5' PACKAGE_BUGREPORT='trustedbsd-audit@TrustesdBSD.org' ac_unique_file="bin/auditreduce/auditreduce.c" @@ -1404,7 +1404,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenBSM 1.1alpha4 to adapt to many kinds of systems. +\`configure' configures OpenBSM 1.1alpha5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1474,7 +1474,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenBSM 1.1alpha4:";; + short | recursive ) echo "Configuration of OpenBSM 1.1alpha5:";; esac cat <<\_ACEOF @@ -1580,7 +1580,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenBSM configure 1.1alpha4 +OpenBSM configure 1.1alpha5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1594,7 +1594,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenBSM $as_me 1.1alpha4, which was +It was created by OpenBSM $as_me 1.1alpha5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -19076,7 +19076,7 @@ fi # Define the identity of the package. PACKAGE=OpenBSM - VERSION=1.1alpha4 + VERSION=1.1alpha5 cat >>confdefs.h <<_ACEOF @@ -23584,7 +23584,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenBSM $as_me 1.1alpha4, which was +This file was extended by OpenBSM $as_me 1.1alpha5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23637,7 +23637,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -OpenBSM config.status 1.1alpha4 +OpenBSM config.status 1.1alpha5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: vendor/openbsm/dist/configure.ac ============================================================================== --- vendor/openbsm/dist/configure.ac Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/configure.ac Sun Jan 11 21:24:07 2009 (r187063) @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([OpenBSM], [1.1alpha4], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) -AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#48 $]) +AC_INIT([OpenBSM], [1.1alpha5], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) +AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#49 $]) AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config/config.h]) Modified: vendor/openbsm/dist/libauditd/Makefile.am ============================================================================== --- vendor/openbsm/dist/libauditd/Makefile.am Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/libauditd/Makefile.am Sun Jan 11 21:24:07 2009 (r187063) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.am#1 $ +# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.am#2 $ # if USE_NATIVE_INCLUDES @@ -13,5 +13,5 @@ lib_LTLIBRARIES = libauditd.la libauditd_la_SOURCES = \ auditd_lib.c -#man3_MANS = \ -# libauditd.3 +man3_MANS = \ + libauditd.3 Modified: vendor/openbsm/dist/libauditd/Makefile.in ============================================================================== --- vendor/openbsm/dist/libauditd/Makefile.in Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/libauditd/Makefile.in Sun Jan 11 21:24:07 2009 (r187063) @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.in#1 $ +# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.in#2 $ # VPATH = @srcdir@ @@ -51,7 +51,7 @@ am__vpath_adj = case $$p in \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libauditd_la_LIBADD = @@ -71,6 +71,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLF $(LDFLAGS) -o $@ SOURCES = $(libauditd_la_SOURCES) DIST_SOURCES = $(libauditd_la_SOURCES) +man3dir = $(mandir)/man3 +NROFF = nroff +MANS = $(man3_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -188,6 +191,9 @@ lib_LTLIBRARIES = libauditd.la libauditd_la_SOURCES = \ auditd_lib.c +man3_MANS = \ + libauditd.3 + all: all-am .SUFFIXES: @@ -285,6 +291,51 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-man3: $(man3_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.3*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ + *) ext='3' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ + done +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.3*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ + *) ext='3' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -362,9 +413,9 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) +all-am: Makefile $(LTLIBRARIES) $(MANS) installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -412,7 +463,7 @@ info: info-am info-am: -install-data-am: +install-data-am: install-man install-dvi: install-dvi-am @@ -422,7 +473,7 @@ install-html: install-html-am install-info: install-info-am -install-man: +install-man: install-man3 install-pdf: install-pdf-am @@ -448,7 +499,9 @@ ps: ps-am ps-am: -uninstall-am: uninstall-libLTLIBRARIES +uninstall-am: uninstall-libLTLIBRARIES uninstall-man + +uninstall-man: uninstall-man3 .MAKE: install-am install-strip @@ -459,16 +512,14 @@ uninstall-am: uninstall-libLTLIBRARIES install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install-libLTLIBRARIES install-man install-man3 install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-libLTLIBRARIES - + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-man uninstall-man3 -#man3_MANS = \ -# libauditd.3 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Modified: vendor/openbsm/dist/libauditd/auditd_lib.c ============================================================================== --- vendor/openbsm/dist/libauditd/auditd_lib.c Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/libauditd/auditd_lib.c Sun Jan 11 21:24:07 2009 (r187063) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#2 $ */ #include @@ -823,7 +823,7 @@ audit_quick_stop(void) */ if (auditon(A_GETCOND, &cond, sizeof(cond)) < 0) return (-1); - if (cond == AUC_DISABLED) + if (cond == AUC_NOAUDIT) return (0); /* Added: vendor/openbsm/dist/libauditd/libauditd.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openbsm/dist/libauditd/libauditd.3 Sun Jan 11 21:24:07 2009 (r187063) @@ -0,0 +1,60 @@ +.\"- +.\" Copyright (c) 2008 Apple Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Inc. ("Apple") nor the names of +.\" its contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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. +.\" +.\" $P4: //depot/projects/trustedbsd/openbsm/libauditd/libauditd.3#1 $ +.\" +.Dd December 27, 2008 +.Dt LIBAUDITD 3 +.Os +.Sh NAME +.Nm libauditd +.Nd "auditd support library" +.Sh LIBRARY +.Lb libauditd +.Sh DESCRIPTION +The +.Nm +library provides the internal implementation of +.Xr auditd 8 . +.Sh INTERFACES +There are no public interfaces in +.Nm . +.Sh SEE ALSO +.Xr auditd 8 . +.Sh HISTORY +The OpenBSM implementation was created by McAfee Research, the security +division of McAfee Inc., under contract to Apple Computer, Inc., in 2004. +It was subsequently adopted by the TrustedBSD Project as the foundation for +the OpenBSM distribution. +.Sh AUTHORS +.An -nosplit +This software was created by +.An Stacey Son . +.Pp +The Basic Security Module (BSM) interface to audit records and audit event +stream format were defined by Sun Microsystems. Modified: vendor/openbsm/dist/libbsm/Makefile.am ============================================================================== --- vendor/openbsm/dist/libbsm/Makefile.am Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/libbsm/Makefile.am Sun Jan 11 21:24:07 2009 (r187063) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#7 $ +# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#8 $ # if USE_NATIVE_INCLUDES @@ -14,11 +14,13 @@ libbsm_la_SOURCES = \ bsm_audit.c \ bsm_class.c \ bsm_control.c \ + bsm_domain.c \ bsm_errno.c \ bsm_event.c \ bsm_flags.c \ bsm_io.c \ bsm_mask.c \ + bsm_socket_type.c \ bsm_token.c \ bsm_user.c @@ -31,12 +33,14 @@ endif man3_MANS = \ au_class.3 \ au_control.3 \ + au_domain.3 \ au_errno.3 \ au_event.3 \ au_free_token.3 \ au_io.3 \ au_mask.3 \ au_open.3 \ + au_socket_type.3 \ au_token.3 \ au_user.3 \ libbsm.3 Modified: vendor/openbsm/dist/libbsm/Makefile.in ============================================================================== --- vendor/openbsm/dist/libbsm/Makefile.in Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/libbsm/Makefile.in Sun Jan 11 21:24:07 2009 (r187063) @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#12 $ +# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#13 $ # VPATH = @srcdir@ @@ -60,13 +60,15 @@ libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libbsm_la_LIBADD = am__libbsm_la_SOURCES_DIST = bsm_audit.c bsm_class.c bsm_control.c \ - bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c \ - bsm_token.c bsm_user.c bsm_notify.c bsm_wrappers.c + bsm_domain.c bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c \ + bsm_mask.c bsm_socket_type.c bsm_token.c bsm_user.c \ + bsm_notify.c bsm_wrappers.c @HAVE_AUDIT_SYSCALLS_TRUE@am__objects_1 = bsm_notify.lo \ @HAVE_AUDIT_SYSCALLS_TRUE@ bsm_wrappers.lo am_libbsm_la_OBJECTS = bsm_audit.lo bsm_class.lo bsm_control.lo \ - bsm_errno.lo bsm_event.lo bsm_flags.lo bsm_io.lo bsm_mask.lo \ - bsm_token.lo bsm_user.lo $(am__objects_1) + bsm_domain.lo bsm_errno.lo bsm_event.lo bsm_flags.lo bsm_io.lo \ + bsm_mask.lo bsm_socket_type.lo bsm_token.lo bsm_user.lo \ + $(am__objects_1) libbsm_la_OBJECTS = $(am_libbsm_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp @@ -199,18 +201,20 @@ top_srcdir = @top_srcdir@ @USE_NATIVE_INCLUDES_FALSE@INCLUDES = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/sys @USE_NATIVE_INCLUDES_TRUE@INCLUDES = -I$(top_builddir) -I$(top_srcdir) lib_LTLIBRARIES = libbsm.la -libbsm_la_SOURCES = bsm_audit.c bsm_class.c bsm_control.c bsm_errno.c \ - bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c bsm_token.c \ - bsm_user.c $(am__append_1) +libbsm_la_SOURCES = bsm_audit.c bsm_class.c bsm_control.c bsm_domain.c \ + bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c \ + bsm_socket_type.c bsm_token.c bsm_user.c $(am__append_1) man3_MANS = \ au_class.3 \ au_control.3 \ + au_domain.3 \ au_errno.3 \ au_event.3 \ au_free_token.3 \ au_io.3 \ au_mask.3 \ au_open.3 \ + au_socket_type.3 \ au_token.3 \ au_user.3 \ libbsm.3 @@ -287,12 +291,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_audit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_class.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_control.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_domain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_errno.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_flags.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_mask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_notify.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_socket_type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_token.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_user.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_wrappers.Plo@am__quote@ Added: vendor/openbsm/dist/libbsm/au_domain.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openbsm/dist/libbsm/au_domain.3 Sun Jan 11 21:24:07 2009 (r187063) @@ -0,0 +1,87 @@ +.\"- +.\" Copyright (c) 2008 Apple Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Inc. ("Apple") nor the names of +.\" its contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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. +.\" +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_domain.3#1 $ +.\" +.Dd December 28, 2008 +.Dt AU_BSM_TO_DOMAIN 3 +.Os +.Sh NAME +.Nm au_bsm_to_domain , +.Nm au_domain_to_bsm +.Nd "convert between BSM and local protocol domains" +.Sh LIBRARY +.Lb libbsm +.Sh SYNOPSIS +.In bsm/libbsm.h +.Ft int +.Fn au_bsm_to_domain "u_short bsm_domain" "int *local_domainp" +.Ft u_short +.Fn au_domain_to_bsm "int local_domain" +.Sh DESCRIPTION +These interfaces may be used to convert between the local and BSM protocol +domains. +The +.Fn au_bsm_to_domain +function accepts a BSM domain, +.Fa bsm_domain , +and converts it to a local domain, such as those passed to +.Xr socket 2 , +that will be stored in the integer pointed to by +.Fa local_domainp +if successful. +This call will fail if the BSM domain cannot be mapped into a local domain, +which may occur if the socket token was generated on another operating +system. +.Pp +.Fn au_domain_to_bsm +function accepts a local domain, and returns the BSM domain for it. +This call cannot fail, and instead returns a BSM domain indicating to a later +decoder that the domain could not be encoded. +.Sh RETURN VALULES +On success, +.Fn au_bsm_to_domain +returns 0 and a converted domain; on failure, it returns -1 but does not set +.Xr errno 2 . +.Sh SEE ALSO +.Xr au_bsm_to_socket_type 3 , +.Xr au_socket_type_to_bsm 3 , +.Xr au_to_socket_ex 3 , +.Xr libbsm 3 +.Sh HISTORY +.Fn au_bsm_to_domain +and +.Fn au_domain_to_bsm +were introduced in OpenBSM 1.1. +.Sh AUTHORS +These functions were implemented by +.An Robert Watson +under contract to Apple Inc. +.Pp +The Basic Security Module (BSM) interface to audit records and audit event +stream format were defined by Sun Microsystems. Added: vendor/openbsm/dist/libbsm/au_socket_type.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openbsm/dist/libbsm/au_socket_type.3 Sun Jan 11 21:24:07 2009 (r187063) @@ -0,0 +1,93 @@ +.\"- +.\" Copyright (c) 2008 Apple Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Inc. ("Apple") nor the names of +.\" its contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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. +.\" +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_socket_type.3#1 $ +.\" +.Dd December 28, 2008 +.Dt AU_BSM_TO_SOCKET_TYPE 3 +.Os +.Sh NAME +.Nm au_bsm_to_socket_type , +.Nm au_socket_type_to_bsm +.Nd "convert between BSM and local socket types" +.Sh LIBRARY +.Lb libbsm +.Sh SYNOPSIS +.In bsm/libbsm.h +.Ft int +.Fn au_bsm_to_socket_type "u_short bsm_socket_type" "int *local_socket_typep" +.Ft u_short +.Fn au_socket_type_to_bsm "int local_socket_type" +.Sh DESCRIPTION +These interfaces may be used to convert between the local and BSM socket +types. +The +.Fn au_bsm_to_socket_type +function accepts a BSM socket type, +.Fa bsm_socket_type , +and converts it to a local socket type, such as those passed to +.Xr socket 2 , +that will be stored in the integer pointed to by +.Fa local_socket_typep +if successful. +This call will fail if the BSM socket type cannot be mapped into a local +socket type, which may occur if the socket token was generated on another +operating system. +.Pp +.Fn au_socket_type_to_bsm +function accepts a local socket type, and returns the BSM socket type for it. +This call cannot fail, and instead returns a BSM socket type indicating to a +later decoder that the socket type could not be encoded. +.Sh RETURN VALULES +On success, +.Fn au_bsm_to_socket_type +returns 0 and a converted socket type; on failure, it returns -1 but does not +set +.Xr errno 2 . +.Pp +On success, +.Fn au_strerror +returns a pointer to an error string; on failure it will return +.Dv NULL . +.Sh SEE ALSO +.Xr au_bsm_to_domain 3 , +.Xr au_domain_to_bsm 3 , +.Xr au_to_socket_ex 3 , +.Xr libbsm 3 +.Sh HISTORY +.Fn au_bsm_to_socket_type +and +.Fn au_socket_type_to_bsm +were introduced in OpenBSM 1.1. +.Sh AUTHORS +These functions were implemented by +.An Robert Watson +under contract to Apple Inc. +.Pp +The Basic Security Module (BSM) interface to audit records and audit event +stream format were defined by Sun Microsystems. Modified: vendor/openbsm/dist/libbsm/au_token.3 ============================================================================== --- vendor/openbsm/dist/libbsm/au_token.3 Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/libbsm/au_token.3 Sun Jan 11 21:24:07 2009 (r187063) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#16 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#17 $ .\" .Dd April 19, 2005 .Dt AU_TOKEN 3 @@ -60,6 +60,7 @@ .Nm au_to_sock_inet32 , .Nm au_to_sock_inet128 , .Nm au_to_sock_inet , +.Nm au_to_socket_ex , .Nm au_to_subject32 , .Nm au_to_subject64 , .Nm au_to_subject , @@ -156,6 +157,8 @@ .Ft "token_t *" .Fn au_to_sock_int "struct sockaddr_in *so" .Ft "token_t *" +.Fn au_to_socket_ex "u_short so_domain" "u_short so_type" "struct sockaddr *sa_local" "struct sockaddr *sa_remote" +.Ft "token_t *" .Fo au_to_subject32 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid" .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_t *tid" Modified: vendor/openbsm/dist/libbsm/bsm_audit.c ============================================================================== --- vendor/openbsm/dist/libbsm/bsm_audit.c Sun Jan 11 20:01:43 2009 (r187062) +++ vendor/openbsm/dist/libbsm/bsm_audit.c Sun Jan 11 21:24:07 2009 (r187063) @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#34 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#35 $ */ #include @@ -219,13 +219,16 @@ au_write(int d, token_t *tok) static int au_assemble(au_record_t *rec, short event) { - token_t *header, *tok, *trailer; - size_t tot_rec_size, hdrsize; - u_char *dptr; +#ifdef HAVE_AUDIT_SYSCALLS struct in6_addr *aptr; - int error; struct auditinfo_addr aia; struct timeval tm; + size_t hdrsize; +#endif /* HAVE_AUDIT_SYSCALLS */ + token_t *header, *tok, *trailer; + size_t tot_rec_size; + u_char *dptr; + int error; #ifdef HAVE_AUDIT_SYSCALLS /* Added: vendor/openbsm/dist/libbsm/bsm_domain.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openbsm/dist/libbsm/bsm_domain.c Sun Jan 11 21:24:07 2009 (r187063) @@ -0,0 +1,499 @@ +/*- + * Copyright (c) 2008 Apple Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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. + * + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_domain.c#2 $ + */ + +#include +#include + +#include + +#include +#include + +struct bsm_domain { + u_short bd_bsm_domain; + int bd_local_domain; +}; + +#define PF_NO_LOCAL_MAPPING -600 + +static const struct bsm_domain bsm_domains[] = { + { BSM_PF_UNSPEC, PF_UNSPEC }, + { BSM_PF_LOCAL, PF_LOCAL }, + { BSM_PF_INET, PF_INET }, + { BSM_PF_IMPLINK, +#ifdef PF_IMPLINK + PF_IMPLINK +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PUP, +#ifdef PF_PUP + PF_PUP +#else + PF_NO_LOCAL_MAPPING +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 21:27:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD595106566B; Sun, 11 Jan 2009 21:27:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91EEF8FC13; Sun, 11 Jan 2009 21:27:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BLRSVC038833; Sun, 11 Jan 2009 21:27:28 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BLRSmh038832; Sun, 11 Jan 2009 21:27:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200901112127.n0BLRSmh038832@svn.freebsd.org> From: Robert Watson Date: Sun, 11 Jan 2009 21:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187064 - vendor/openbsm/1.1-ALPHA-5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 21:27:29 -0000 Author: rwatson Date: Sun Jan 11 21:27:28 2009 New Revision: 187064 URL: http://svn.freebsd.org/changeset/base/187064 Log: Tag OpenBSM 1.1-alpha5 vendor import. Added: vendor/openbsm/1.1-ALPHA-5/ (props changed) - copied from r187063, vendor/openbsm/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 21:45:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 896CA1065674; Sun, 11 Jan 2009 21:45:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 745458FC1B; Sun, 11 Jan 2009 21:45:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BLjOjK039220; Sun, 11 Jan 2009 21:45:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BLjNGb039206; Sun, 11 Jan 2009 21:45:23 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901112145.n0BLjNGb039206@svn.freebsd.org> From: Sam Leffler Date: Sun, 11 Jan 2009 21:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187065 - in stable/7/sys: . dev/acpi_support dev/cxgb dev/led geom geom/concat geom/part geom/stripe kern security/mac_portacl sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 21:45:25 -0000 Author: sam Date: Sun Jan 11 21:45:23 2009 New Revision: 187065 URL: http://svn.freebsd.org/changeset/base/187065 Log: MFC r181463: add sbuf_new_auto Modified: stable/7/sys/ (props changed) stable/7/sys/dev/acpi_support/acpi_asus.c stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/led/led.c stable/7/sys/geom/concat/g_concat.c stable/7/sys/geom/geom_ccd.c stable/7/sys/geom/geom_ctl.c stable/7/sys/geom/geom_disk.c stable/7/sys/geom/geom_kern.c stable/7/sys/geom/geom_slice.c stable/7/sys/geom/geom_subr.c stable/7/sys/geom/part/g_part.c stable/7/sys/geom/stripe/g_stripe.c stable/7/sys/kern/vfs_mount.c stable/7/sys/security/mac_portacl/mac_portacl.c stable/7/sys/sys/sbuf.h Modified: stable/7/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- stable/7/sys/dev/acpi_support/acpi_asus.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/dev/acpi_support/acpi_asus.c Sun Jan 11 21:45:23 2009 (r187065) @@ -552,7 +552,7 @@ acpi_asus_probe(device_t dev) } } - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); if (sb == NULL) return (ENOMEM); Modified: stable/7/sys/dev/led/led.c ============================================================================== --- stable/7/sys/dev/led/led.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/dev/led/led.c Sun Jan 11 21:45:23 2009 (r187065) @@ -141,7 +141,7 @@ led_write(struct cdev *dev, struct uio * return(error); } - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); if (sb == NULL) { free(s2, M_DEVBUF); return (ENOMEM); Modified: stable/7/sys/geom/concat/g_concat.c ============================================================================== --- stable/7/sys/geom/concat/g_concat.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/concat/g_concat.c Sun Jan 11 21:45:23 2009 (r187065) @@ -748,7 +748,7 @@ g_concat_ctl_create(struct gctl_req *req } sc = gp->softc; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); for (attached = 0, no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); Modified: stable/7/sys/geom/geom_ccd.c ============================================================================== --- stable/7/sys/geom/geom_ccd.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_ccd.c Sun Jan 11 21:45:23 2009 (r187065) @@ -790,7 +790,7 @@ g_ccd_create(struct gctl_req *req, struc pp->sectorsize = sc->sc_secsize; g_error_provider(pp, 0); - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "ccd%d: %d components ", sc->sc_unit, *nprovider); for (i = 0; i < *nprovider; i++) { sbuf_printf(sb, "%s%s", @@ -840,7 +840,7 @@ g_ccd_list(struct gctl_req *req, struct up = gctl_get_paraml(req, "unit", sizeof (int)); unit = *up; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); LIST_FOREACH(gp, &mp->geom, geom) { cs = gp->softc; if (cs == NULL || (unit >= 0 && unit != cs->sc_unit)) Modified: stable/7/sys/geom/geom_ctl.c ============================================================================== --- stable/7/sys/geom/geom_ctl.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_ctl.c Sun Jan 11 21:45:23 2009 (r187065) @@ -464,7 +464,7 @@ g_ctl_ioctl_ctl(struct cdev *dev, u_long req = (void *)data; req->nerror = 0; - req->serror = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + req->serror = sbuf_new_auto(); /* It is an error if we cannot return an error text */ if (req->lerror < 2) return (EINVAL); Modified: stable/7/sys/geom/geom_disk.c ============================================================================== --- stable/7/sys/geom/geom_disk.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_disk.c Sun Jan 11 21:45:23 2009 (r187065) @@ -516,7 +516,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS) int error; struct sbuf *sb; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); g_waitfor_event(g_kern_disks, sb, M_WAITOK, NULL); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); Modified: stable/7/sys/geom/geom_kern.c ============================================================================== --- stable/7/sys/geom/geom_kern.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_kern.c Sun Jan 11 21:45:23 2009 (r187065) @@ -180,7 +180,7 @@ sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ int error; struct sbuf *sb; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); g_waitfor_event(g_conftxt, sb, M_WAITOK, NULL); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); @@ -193,7 +193,7 @@ sysctl_kern_geom_confdot(SYSCTL_HANDLER_ int error; struct sbuf *sb; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); g_waitfor_event(g_confdot, sb, M_WAITOK, NULL); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); @@ -206,7 +206,7 @@ sysctl_kern_geom_confxml(SYSCTL_HANDLER_ int error; struct sbuf *sb; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); g_waitfor_event(g_confxml, sb, M_WAITOK, NULL); error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); Modified: stable/7/sys/geom/geom_slice.c ============================================================================== --- stable/7/sys/geom/geom_slice.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_slice.c Sun Jan 11 21:45:23 2009 (r187065) @@ -385,7 +385,7 @@ g_slice_config(struct g_geom *gp, u_int pp->mediasize = gsl->length; return (0); } - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); va_start(ap, fmt); sbuf_vprintf(sb, fmt, ap); va_end(ap); Modified: stable/7/sys/geom/geom_subr.c ============================================================================== --- stable/7/sys/geom/geom_subr.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/geom_subr.c Sun Jan 11 21:45:23 2009 (r187065) @@ -324,7 +324,7 @@ g_new_geomf(struct g_class *mp, const ch g_topology_assert(); G_VALID_CLASS(mp); - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); va_start(ap, fmt); sbuf_vprintf(sb, fmt, ap); va_end(ap); @@ -564,7 +564,7 @@ g_new_providerf(struct g_geom *gp, const KASSERT(!(gp->flags & G_GEOM_WITHER), ("new provider on WITHERing geom(%s) (class %s)", gp->name, gp->class->name)); - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); va_start(ap, fmt); sbuf_vprintf(sb, fmt, ap); va_end(ap); Modified: stable/7/sys/geom/part/g_part.c ============================================================================== --- stable/7/sys/geom/part/g_part.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/part/g_part.c Sun Jan 11 21:45:23 2009 (r187065) @@ -506,7 +506,7 @@ g_part_ctl_add(struct gctl_req *req, str /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s added\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -545,7 +545,7 @@ g_part_ctl_bootcode(struct gctl_req *req /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s has bootcode\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -749,7 +749,7 @@ g_part_ctl_create(struct gctl_req *req, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s created\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -821,7 +821,7 @@ g_part_ctl_delete(struct gctl_req *req, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s deleted\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -877,7 +877,7 @@ g_part_ctl_destroy(struct gctl_req *req, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s destroyed\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -924,7 +924,7 @@ g_part_ctl_modify(struct gctl_req *req, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s modified\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -991,7 +991,7 @@ g_part_ctl_setunset(struct gctl_req *req /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s has %s %sset\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf)), gpp->gpp_attrib, (set) ? "" : "un"); Modified: stable/7/sys/geom/stripe/g_stripe.c ============================================================================== --- stable/7/sys/geom/stripe/g_stripe.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/geom/stripe/g_stripe.c Sun Jan 11 21:45:23 2009 (r187065) @@ -1069,7 +1069,7 @@ g_stripe_ctl_create(struct gctl_req *req } sc = gp->softc; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); for (attached = 0, no = 1; no < *nargs; no++) { snprintf(param, sizeof(param), "arg%u", no); Modified: stable/7/sys/kern/vfs_mount.c ============================================================================== --- stable/7/sys/kern/vfs_mount.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/kern/vfs_mount.c Sun Jan 11 21:45:23 2009 (r187065) @@ -2177,7 +2177,7 @@ mount_argf(struct mntarg *ma, const char ma->v[ma->len].iov_len = strlen(name) + 1; ma->len++; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); va_start(ap, fmt); sbuf_vprintf(sb, fmt, ap); va_end(ap); Modified: stable/7/sys/security/mac_portacl/mac_portacl.c ============================================================================== --- stable/7/sys/security/mac_portacl/mac_portacl.c Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/security/mac_portacl/mac_portacl.c Sun Jan 11 21:45:23 2009 (r187065) @@ -306,7 +306,7 @@ rules_to_string(void) int needcomma; char *temp; - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); needcomma = 0; mtx_lock(&rule_mtx); for (rule = TAILQ_FIRST(&rule_head); rule != NULL; Modified: stable/7/sys/sys/sbuf.h ============================================================================== --- stable/7/sys/sys/sbuf.h Sun Jan 11 21:27:28 2009 (r187064) +++ stable/7/sys/sys/sbuf.h Sun Jan 11 21:45:23 2009 (r187065) @@ -56,6 +56,8 @@ __BEGIN_DECLS * API functions */ struct sbuf *sbuf_new(struct sbuf *, char *, int, int); +#define sbuf_new_auto() \ + sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND) void sbuf_clear(struct sbuf *); int sbuf_setpos(struct sbuf *, int); int sbuf_bcat(struct sbuf *, const void *, size_t); From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 21:59:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3E17106564A; Sun, 11 Jan 2009 21:59:42 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A240A8FC13; Sun, 11 Jan 2009 21:59:42 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BLxgi3039632; Sun, 11 Jan 2009 21:59:42 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BLxgxX039631; Sun, 11 Jan 2009 21:59:42 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200901112159.n0BLxgxX039631@svn.freebsd.org> From: Tom Rhodes Date: Sun, 11 Jan 2009 21:59:42 +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: r187066 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 21:59:43 -0000 Author: trhodes Date: Sun Jan 11 21:59:42 2009 New Revision: 187066 URL: http://svn.freebsd.org/changeset/base/187066 Log: Quote the "u" as it's the name of the union, this may prevent some confusion when reading the manual page. PR: 117798 Discussed with: keramida, brueffer Recommended by: phk Modified: head/share/man/man4/sysmouse.4 Modified: head/share/man/man4/sysmouse.4 ============================================================================== --- head/share/man/man4/sysmouse.4 Sun Jan 11 21:45:23 2009 (r187065) +++ head/share/man/man4/sysmouse.4 Sun Jan 11 21:59:42 2009 (r187066) @@ -385,7 +385,7 @@ They are intended to replace functions p .Dv MOUSE_ACTION alone. .Pp -.It Dv u +.It Dv Sq u This union is one of .Pp .Bl -tag -width data -compact From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 22:36:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F6891065670; Sun, 11 Jan 2009 22:36:45 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E3C48FC19; Sun, 11 Jan 2009 22:36:45 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0BMajE7040397; Sun, 11 Jan 2009 22:36:45 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BMajVK040396; Sun, 11 Jan 2009 22:36:45 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200901112236.n0BMajVK040396@svn.freebsd.org> From: Daniel Gerzo Date: Sun, 11 Jan 2009 22:36: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: r187067 - head/sbin/ping X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 22:36:46 -0000 Author: danger (doc committer) Date: Sun Jan 11 22:36:45 2009 New Revision: 187067 URL: http://svn.freebsd.org/changeset/base/187067 Log: - improve readability Reviewed by: trhodes, keramida MFC after: 3 days Modified: head/sbin/ping/ping.8 Modified: head/sbin/ping/ping.8 ============================================================================== --- head/sbin/ping/ping.8 Sun Jan 11 21:59:42 2009 (r187066) +++ head/sbin/ping/ping.8 Sun Jan 11 22:36:45 2009 (r187067) @@ -506,14 +506,18 @@ Others may use completely wild values. .Sh EXIT STATUS The .Nm -utility returns an exit status of zero if at least one response was -heard from the specified -.Ar host ; -a status of two if the transmission was successful but no responses -were received; or another value -(from -.In sysexits.h ) -if an error occurred. +utility exits with one of the following values: +.Bl -tag -width indent +.It 0 +At least one response was heard from the specified +.Ar host . +.It 2 +The transmission was successful but no responses were received. +.It any other value +An error occurred. +These values are defined in +.In sysexits.h . +.El .Sh SEE ALSO .Xr netstat 1 , .Xr ifconfig 8 , From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 00:39:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF256106566B; Mon, 12 Jan 2009 00:39:22 +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 91B418FC21; Mon, 12 Jan 2009 00:39:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C0dMO8043219; Mon, 12 Jan 2009 00:39:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C0dMKX043214; Mon, 12 Jan 2009 00:39:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901120039.n0C0dMKX043214@svn.freebsd.org> From: Xin LI Date: Mon, 12 Jan 2009 00:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187069 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 00:39:23 -0000 Author: delphij Date: Mon Jan 12 00:39:22 2009 New Revision: 187069 URL: http://svn.freebsd.org/changeset/base/187069 Log: MFC revisions 178088 and 179656: Catastrophic recovery mode. Modified: stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/fsck_ffs/fsck.h stable/7/sbin/fsck_ffs/fsck_ffs.8 stable/7/sbin/fsck_ffs/fsutil.c stable/7/sbin/fsck_ffs/inode.c stable/7/sbin/fsck_ffs/main.c Modified: stable/7/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/7/sbin/fsck_ffs/fsck.h Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/fsck.h Mon Jan 12 00:39:22 2009 (r187069) @@ -270,6 +270,7 @@ char yflag; /* assume a yes response * int bkgrdflag; /* use a snapshot to run on an active system */ int bflag; /* location of alternate super block */ int debug; /* output debugging info */ +char catastrophicflag; /* run in catastrophic mode */ int cvtlevel; /* convert to newer file system format */ int bkgrdcheck; /* determine if background check is possible */ int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ @@ -335,6 +336,7 @@ void cacheino(union dinode *dp, ino_t i void catch(int); void catchquit(int); int changeino(ino_t dir, const char *name, ino_t newnum); +void check_cgmagic(int cg, struct cg *cgp); int chkrange(ufs2_daddr_t blk, int cnt); void ckfini(int markclean); int ckinode(union dinode *dp, struct inodesc *); Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 12 00:39:22 2009 (r187069) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 24, 2001 +.Dd April 10, 2008 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BFpfny +.Op Fl BCFpfny .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -175,6 +175,26 @@ Use the block specified immediately afte the super block for the file system. An alternate super block is usually located at block 32 for UFS1, and block 160 for UFS2. +.It Fl C +Run +.Nm +in 'catastrophic recovery' mode, which will enable certain aggressive +operations that can make +.Nm +to survive with file systems that has very serious data damage, which +is an useful last resort when on disk data damage is very serious +and causes +.Nm +to crash otherwise. Be +.Em very careful +using this flag, is dangerous if there are data transmission hazards +because a false positive cylinder group magic number mismatch could +cause +.Em irrevertible data loss! +.Pp +This option implies the +.Fl f +flag. .It Fl c Convert the file system to the specified level. Note that the level of a file system can only be raised. Modified: stable/7/sbin/fsck_ffs/fsutil.c ============================================================================== --- stable/7/sbin/fsck_ffs/fsutil.c Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/fsutil.c Mon Jan 12 00:39:22 2009 (r187069) @@ -418,6 +418,35 @@ blwrite(int fd, char *buf, ufs2_daddr_t } /* + * Check cg's magic number. If catastrophic mode is enabled and the cg's + * magic number is bad, offer an option to clear the whole cg. + */ +void +check_cgmagic(int cg, struct cg *cgp) +{ + + if (!cg_chkmagic(cgp)) { + pwarn("CG %d: BAD MAGIC NUMBER\n", cg); + if (catastrophicflag) { + if (reply("CLEAR CG")) { + memset(cgp, 0, (size_t)sblock.fs_cgsize); + cgp->cg_initediblk = sblock.fs_ipg; + cgp->cg_old_niblk = sblock.fs_ipg; + cgp->cg_old_ncyl = sblock.fs_old_cpg; + cgp->cg_cgx = cg; + cgp->cg_niblk = sblock.fs_ipg; + cgp->cg_ndblk = sblock.fs_size - cgbase(&sblock, cg); + cgp->cg_magic = CG_MAGIC; + cgdirty(); + printf("PLEASE RERUN FSCK.\n"); + rerun = 1; + } + } else + printf("YOU MAY NEED TO RERUN FSCK WITH -C IF IT CRASHED.\n"); + } +} + +/* * allocate a data block with the specified number of fragments */ ufs2_daddr_t @@ -441,8 +470,7 @@ allocblk(long frags) } cg = dtog(&sblock, i + j); getblk(&cgblk, cgtod(&sblock, cg), sblock.fs_cgsize); - if (!cg_chkmagic(cgp)) - pfatal("CG %d: BAD MAGIC NUMBER\n", cg); + check_cgmagic(cg, cgp); baseblk = dtogd(&sblock, i + j); for (k = 0; k < frags; k++) { setbmap(i + j + k); Modified: stable/7/sbin/fsck_ffs/inode.c ============================================================================== --- stable/7/sbin/fsck_ffs/inode.c Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/inode.c Mon Jan 12 00:39:22 2009 (r187069) @@ -617,8 +617,7 @@ allocino(ino_t request, int type) return (0); cg = ino_to_cg(&sblock, ino); getblk(&cgblk, cgtod(&sblock, cg), sblock.fs_cgsize); - if (!cg_chkmagic(cgp)) - pfatal("CG %d: BAD MAGIC NUMBER\n", cg); + check_cgmagic(cg, cgp); setbit(cg_inosused(cgp), ino % sblock.fs_ipg); cgp->cg_cs.cs_nifree--; switch (type & IFMT) { Modified: stable/7/sbin/fsck_ffs/main.c ============================================================================== --- stable/7/sbin/fsck_ffs/main.c Sun Jan 11 23:19:17 2009 (r187068) +++ stable/7/sbin/fsck_ffs/main.c Mon Jan 12 00:39:22 2009 (r187069) @@ -81,7 +81,8 @@ main(int argc, char *argv[]) sync(); skipclean = 1; - while ((ch = getopt(argc, argv, "b:Bc:dfFm:npy")) != -1) { + catastrophicflag = 0; + while ((ch = getopt(argc, argv, "b:Bc:CdfFm:npy")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -105,6 +106,10 @@ main(int argc, char *argv[]) debug++; break; + case 'C': + catastrophicflag = 1; + /* FALLTHROUGH */ + case 'f': skipclean = 0; break; @@ -610,7 +615,7 @@ static void usage(void) { (void) fprintf(stderr, - "usage: %s [-BFpfny] [-b block] [-c level] [-m mode] " + "usage: %s [-BCFpfny] [-b block] [-c level] [-m mode] " "filesystem ...\n", getprogname()); exit(1); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 01:36:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADEC7106564A; Mon, 12 Jan 2009 01:36:01 +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 913B98FC0C; Mon, 12 Jan 2009 01:36:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C1a1ps044429; Mon, 12 Jan 2009 01:36:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C1a182044428; Mon, 12 Jan 2009 01:36:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901120136.n0C1a182044428@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 12 Jan 2009 01:36:01 +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: r187071 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 01:36:02 -0000 Author: nwhitehorn Date: Mon Jan 12 01:36:01 2009 New Revision: 187071 URL: http://svn.freebsd.org/changeset/base/187071 Log: Some early Macintosh GPIO controllers don't provide reg properties for interrupt-only GPIOs. Honor this, and allow interrupt attachment, but not read/write access for such devices. Reported by: Niels Eliasen Modified: head/sys/powerpc/powermac/macgpio.c Modified: head/sys/powerpc/powermac/macgpio.c ============================================================================== --- head/sys/powerpc/powermac/macgpio.c Mon Jan 12 01:19:38 2009 (r187070) +++ head/sys/powerpc/powermac/macgpio.c Mon Jan 12 01:36:01 2009 (r187071) @@ -172,8 +172,14 @@ macgpio_attach(device_t dev) if (OF_getprop(child,"reg",&dinfo->gpio_num, sizeof(dinfo->gpio_num)) != sizeof(dinfo->gpio_num)) { - free(dinfo, M_MACGPIO); - continue; + /* + * Some early GPIO controllers don't provide GPIO + * numbers for GPIOs designed only to provide + * interrupt resources. We should still allow these + * to attach, but with caution. + */ + + dinfo->gpio_num = -1; } resource_list_init(&dinfo->mdi_resources); @@ -217,7 +223,7 @@ macgpio_print_child(device_t dev, device printf(" gpio %d", dinfo->gpio_num - GPIO_BASE); else if (dinfo->gpio_num >= GPIO_EXTINT_BASE) printf(" extint-gpio %d", dinfo->gpio_num - GPIO_EXTINT_BASE); - else + else if (dinfo->gpio_num >= 0) printf(" addr 0x%02x", dinfo->gpio_num); /* should not happen */ resource_list_print_type(&dinfo->mdi_resources, "irq", SYS_RES_IRQ, @@ -240,7 +246,8 @@ macgpio_probe_nomatch(device_t dev, devi if ((type = ofw_bus_get_type(child)) == NULL) type = "(unknown)"; device_printf(dev, "<%s, %s>", type, ofw_bus_get_name(child)); - printf(" gpio %d",dinfo->gpio_num); + if (dinfo->gpio_num >= 0) + printf(" gpio %d",dinfo->gpio_num); resource_list_print_type(&dinfo->mdi_resources, "irq", SYS_RES_IRQ, "%ld"); printf(" (no driver attached)\n"); @@ -279,9 +286,11 @@ macgpio_activate_resource(device_t bus, if (type != SYS_RES_IRQ) return ENXIO; - val = bus_read_1(sc->sc_gpios,dinfo->gpio_num); - val |= 0x80; - bus_write_1(sc->sc_gpios,dinfo->gpio_num,val); + if (dinfo->gpio_num >= 0) { + val = bus_read_1(sc->sc_gpios,dinfo->gpio_num); + val |= 0x80; + bus_write_1(sc->sc_gpios,dinfo->gpio_num,val); + } return (bus_activate_resource(bus, type, rid, res)); } @@ -301,9 +310,11 @@ macgpio_deactivate_resource(device_t bus if (type != SYS_RES_IRQ) return ENXIO; - val = bus_read_1(sc->sc_gpios,dinfo->gpio_num); - val &= ~0x80; - bus_write_1(sc->sc_gpios,dinfo->gpio_num,val); + if (dinfo->gpio_num >= 0) { + val = bus_read_1(sc->sc_gpios,dinfo->gpio_num); + val &= ~0x80; + bus_write_1(sc->sc_gpios,dinfo->gpio_num,val); + } return (bus_deactivate_resource(bus, type, rid, res)); } @@ -317,6 +328,9 @@ macgpio_read(device_t dev) sc = device_get_softc(device_get_parent(dev)); dinfo = device_get_ivars(dev); + if (dinfo->gpio_num < 0) + return (0); + return (bus_read_1(sc->sc_gpios,dinfo->gpio_num)); } @@ -329,6 +343,9 @@ macgpio_write(device_t dev, uint8_t val) sc = device_get_softc(device_get_parent(dev)); dinfo = device_get_ivars(dev); + if (dinfo->gpio_num < 0) + return; + bus_write_1(sc->sc_gpios,dinfo->gpio_num,val); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 02:07:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 012E1106572A; Mon, 12 Jan 2009 02:07:57 +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 D9F378FC1F; Mon, 12 Jan 2009 02:07:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C27vIq045058; Mon, 12 Jan 2009 02:07:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C27v8t045057; Mon, 12 Jan 2009 02:07:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120207.n0C27v8t045057@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 02:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187072 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:08:00 -0000 Author: yongari Date: Mon Jan 12 02:07:57 2009 New Revision: 187072 URL: http://svn.freebsd.org/changeset/base/187072 Log: MFC r183488-r183491: r183488: Announce link loss right after it happens. r183489: Use mii_anegticks instead of hardcoded MII_ANEGTICKS. r183490: Report current link state while auto-negotiation is in progress. r183491: Explicitly mark IFM_HDX for half-duplex media. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ciphy.c Modified: stable/7/sys/dev/mii/ciphy.c ============================================================================== --- stable/7/sys/dev/mii/ciphy.c Mon Jan 12 01:36:01 2009 (r187071) +++ stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:07:57 2009 (r187072) @@ -262,15 +262,18 @@ setit: if (reg & BMSR_LINK) break; + /* Announce link loss right after it happens. */ + if (++sc->mii_ticks == 0) + break; /* - * Only retry autonegotiation every 5 seconds. + * Only retry autonegotiation every mii_anegticks seconds. */ - if (++sc->mii_ticks <= MII_ANEGTICKS) + if (sc->mii_ticks <= sc->mii_anegticks) break; sc->mii_ticks = 0; mii_phy_auto(sc); - return (0); + break; } /* Update the media status. */ @@ -335,6 +338,8 @@ ciphy_status(struct mii_softc *sc) if (bmsr & CIPHY_AUXCSR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } static void From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 02:17:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67EB5106566B for ; Mon, 12 Jan 2009 02:17:10 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.224]) by mx1.freebsd.org (Postfix) with ESMTP id 375738FC08 for ; Mon, 12 Jan 2009 02:17:10 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so11943419rvf.43 for ; Sun, 11 Jan 2009 18:17:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=+4+4TpcSSKtCU70fhHVWXaOhGU0I5/ZifVDtvK7i+O8=; b=EDh2SKmn0NODGMofgA9ZzEQgWG+q3v5dFb1Gfp6lYcVLtTV3fJ3B8WFuAvmA5cqCSV L+Sc0NWLt2jnmwfq63msobFZZ0LWUX3rcqYRMXk9IuD++tD1GYqPZIHjokp/I6NVoKV/ qRhQUwdbv/FgL0XRR+AhV+MaS8dOH3OSuxiz0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=a0aMp8QzxATAho0VU8/a13pbLDQ7AWBVUK1E30DUWGf9uv6fm9AT0h8sJhzZpBaaOM LlIjY5LIAlyX2IAqOGrefvY32fAKzKxRlkVqyJM75nmIjdA0Rxu0508laFnbRYGPevxv gqb/gmGnRHfuFUcPEgbspSTxbMjiYKtuh8R20= Received: by 10.142.154.14 with SMTP id b14mr11872864wfe.69.1231725226721; Sun, 11 Jan 2009 17:53:46 -0800 (PST) Received: by 10.143.109.9 with HTTP; Sun, 11 Jan 2009 17:53:46 -0800 (PST) Message-ID: <47d0403c0901111753r48b9ebc0x43dfb4389194cf2c@mail.gmail.com> Date: Sun, 11 Jan 2009 20:53:46 -0500 From: "Ben Kaduk" To: "Xin LI" In-Reply-To: <200901120039.n0C0dMKX043214@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200901120039.n0C0dMKX043214@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, freebsd-doc@freebsd.org Subject: Re: svn commit: r187069 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:17:10 -0000 On Sun, Jan 11, 2009 at 7:39 PM, Xin LI wrote: > Author: delphij > Date: Mon Jan 12 00:39:22 2009 > New Revision: 187069 > URL: http://svn.freebsd.org/changeset/base/187069 > > Log: > MFC revisions 178088 and 179656: Catastrophic recovery mode. > > Modified: > stable/7/sbin/fsck_ffs/ (props changed) > stable/7/sbin/fsck_ffs/fsck.h > stable/7/sbin/fsck_ffs/fsck_ffs.8 > stable/7/sbin/fsck_ffs/fsutil.c > stable/7/sbin/fsck_ffs/inode.c > stable/7/sbin/fsck_ffs/main.c > > Modified: stable/7/sbin/fsck_ffs/fsck.h > ============================================================================== > Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 > ============================================================================== > --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Sun Jan 11 23:19:17 2009 (r187068) > +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 12 00:39:22 2009 (r187069) > @@ -29,7 +29,7 @@ > .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 > .\" $FreeBSD$ > .\" > -.Dd April 24, 2001 > +.Dd April 10, 2008 > .Dt FSCK_FFS 8 > .Os > .Sh NAME > @@ -38,7 +38,7 @@ > .Nd file system consistency check and interactive repair > .Sh SYNOPSIS > .Nm > -.Op Fl BFpfny > +.Op Fl BCFpfny > .Op Fl b Ar block > .Op Fl c Ar level > .Op Fl m Ar mode > @@ -175,6 +175,26 @@ Use the block specified immediately afte > the super block for the file system. > An alternate super block is usually located at block 32 for UFS1, > and block 160 for UFS2. > +.It Fl C > +Run > +.Nm > +in 'catastrophic recovery' mode, which will enable certain aggressive > +operations that can make > +.Nm > +to survive with file systems that has very serious data damage, which > +is an useful last resort when on disk data damage is very serious > +and causes > +.Nm > +to crash otherwise. Be > +.Em very careful > +using this flag, is dangerous if there are data transmission hazards I guess I missed this in HEAD, but there seems to be a missing 'it' before 'is dangerous'. -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 02:31:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F949106566C; Mon, 12 Jan 2009 02:31: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 027338FC14; Mon, 12 Jan 2009 02:31:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C2VM0T045508; Mon, 12 Jan 2009 02:31:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C2VM98045506; Mon, 12 Jan 2009 02:31:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120231.n0C2VM98045506@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 02:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187073 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:31:23 -0000 Author: yongari Date: Mon Jan 12 02:31:22 2009 New Revision: 187073 URL: http://svn.freebsd.org/changeset/base/187073 Log: MFC r183492,r184192 r183492: Add Vitesse VSC8211 PHY which is found on Planex GU-1000T. HW donated by: nork r184192: Correct PHY description and OUI of VSC8211. Previously VSC8211 was not recognized by ciphy(4) due to the incorrect OUI. Reported by: nork Tested by: nork Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ciphy.c stable/7/sys/dev/mii/miidevs Modified: stable/7/sys/dev/mii/ciphy.c ============================================================================== --- stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:07:57 2009 (r187072) +++ stable/7/sys/dev/mii/ciphy.c Mon Jan 12 02:31:22 2009 (r187073) @@ -91,6 +91,7 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(CICADA, CS8201), MII_PHY_DESC(CICADA, CS8201A), MII_PHY_DESC(CICADA, CS8201B), + MII_PHY_DESC(CICADA, VSC8211), MII_PHY_DESC(VITESSE, VSC8601), MII_PHY_END }; @@ -419,6 +420,7 @@ ciphy_fixup(struct mii_softc *sc) } break; + case MII_MODEL_CICADA_VSC8211: case MII_MODEL_VITESSE_VSC8601: break; default: Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Mon Jan 12 02:07:57 2009 (r187072) +++ stable/7/sys/dev/mii/miidevs Mon Jan 12 02:31:22 2009 (r187073) @@ -151,6 +151,7 @@ model BROADCOM2 BCM5906 0x0004 BCM5906 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY +model CICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY model VITESSE VSC8601 0x0002 Vitesse VSC8601 10/100/1000TX PHY From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 02:44:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55AE6106566C; Mon, 12 Jan 2009 02:44:25 +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 42A438FC0A; Mon, 12 Jan 2009 02:44:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C2iNN4045913; Mon, 12 Jan 2009 02:44:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C2iNOS045912; Mon, 12 Jan 2009 02:44:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120244.n0C2iNOS045912@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 02:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187074 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:44:26 -0000 Author: yongari Date: Mon Jan 12 02:44:23 2009 New Revision: 187074 URL: http://svn.freebsd.org/changeset/base/187074 Log: MFC r183493: Save extended address register prior to switching to 1000BASE-X only mode and restore original value of extended address register instead of overwriting it with page 1. There are still instance information passing issue(e.g configured media type: fiber or copper) from driver to PHY layer but this change make the selected PHY work with 88E1112 PHY. Reported by: Krzysztof Jedruczyk < beaker hot dot pl > Tested by: Krzysztof Jedruczyk < beaker hot dot pl > Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/e1000phy.c Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Mon Jan 12 02:31:22 2009 (r187073) +++ stable/7/sys/dev/mii/e1000phy.c Mon Jan 12 02:44:23 2009 (r187074) @@ -223,7 +223,7 @@ static void e1000phy_reset(struct mii_softc *sc) { struct e1000phy_softc *esc; - uint16_t reg; + uint16_t reg, page; esc = (struct e1000phy_softc *)sc; reg = PHY_READ(sc, E1000_SCR); @@ -232,12 +232,13 @@ e1000phy_reset(struct mii_softc *sc) PHY_WRITE(sc, E1000_SCR, reg); if (esc->mii_model == MII_MODEL_MARVELL_E1112) { /* Select 1000BASE-X only mode. */ + page = PHY_READ(sc, E1000_EADR); PHY_WRITE(sc, E1000_EADR, 2); reg = PHY_READ(sc, E1000_SCR); reg &= ~E1000_SCR_MODE_MASK; reg |= E1000_SCR_MODE_1000BX; PHY_WRITE(sc, E1000_SCR, reg); - PHY_WRITE(sc, E1000_EADR, 1); + PHY_WRITE(sc, E1000_EADR, page); } } else { switch (esc->mii_model) { From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 02:45:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E4351065674; Mon, 12 Jan 2009 02:45:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 006F18FC20; Mon, 12 Jan 2009 02:45:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C2j0L8045964; Mon, 12 Jan 2009 02:45:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C2j0ev045957; Mon, 12 Jan 2009 02:45:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901120245.n0C2j0ev045957@svn.freebsd.org> From: Andrew Thompson Date: Mon, 12 Jan 2009 02:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187075 - stable/7/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:45:02 -0000 Author: thompsa Date: Mon Jan 12 02:45:00 2009 New Revision: 187075 URL: http://svn.freebsd.org/changeset/base/187075 Log: MFC r185186 Allow multiple makeoption lines to be used with the += operator, this permits the following syntax in the kernel config. makeoptions MODULES_OVERRIDE=foo makeoptions MODULES_OVERRIDE+=bar makeoptions MODULES_OVERRIDE+=baz Bump config minor version to 600007. Modified: stable/7/usr.sbin/config/ (props changed) stable/7/usr.sbin/config/config.5 stable/7/usr.sbin/config/config.h stable/7/usr.sbin/config/config.y stable/7/usr.sbin/config/configvers.h stable/7/usr.sbin/config/lang.l stable/7/usr.sbin/config/mkmakefile.c Modified: stable/7/usr.sbin/config/config.5 ============================================================================== --- stable/7/usr.sbin/config/config.5 Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/config.5 Mon Jan 12 02:45:00 2009 (r187075) @@ -231,6 +231,7 @@ specifications. Each option specification has the form .Pp .D1 Ar MakeVariableName Ns Op = Ns Ar Value +.D1 Ar MakeVariableName Ns += Ns Ar Value .Pp and results in the appropriate .Xr make 1 @@ -243,7 +244,8 @@ is assumed to be the empty string. .Pp Example: .Bd -literal -offset indent -compact -makeoptions MYMAKEOPTION="foobar" +makeoptions MYMAKEOPTION="foo" +makeoptions MYMAKEOPTION+="bar" makeoptions MYNULLMAKEOPTION .Ed .\" -------- MAXUSERS -------- Modified: stable/7/usr.sbin/config/config.h ============================================================================== --- stable/7/usr.sbin/config/config.h Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/config.h Mon Jan 12 02:45:00 2009 (r187075) @@ -121,6 +121,7 @@ struct opt { char *op_value; int op_ownfile; /* true = own file, false = makefile */ SLIST_ENTRY(opt) op_next; + SLIST_ENTRY(opt) op_append; }; SLIST_HEAD(opt_head, opt) opt, mkopt, rmopts; Modified: stable/7/usr.sbin/config/config.y ============================================================================== --- stable/7/usr.sbin/config/config.y Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/config.y Mon Jan 12 02:45:00 2009 (r187075) @@ -13,6 +13,7 @@ %token NODEVICE %token ENV %token EQUALS +%token PLUSEQUALS %token HINTS %token IDENT %token MAXUSERS @@ -219,7 +220,7 @@ System_spec: System_id: Save_id - = { newopt(&mkopt, ns("KERNEL"), $1); }; + = { newopt(&mkopt, ns("KERNEL"), $1, 0); }; System_parameter_list: System_parameter_list ID @@ -235,14 +236,14 @@ Opt_list: Option: Save_id = { - newopt(&opt, $1, NULL); + newopt(&opt, $1, NULL, 0); if (strchr($1, '=') != NULL) errx(1, "%s:%d: The `=' in options should not be " "quoted", yyfile, yyline); } | Save_id EQUALS Opt_value = { - newopt(&opt, $1, $3); + newopt(&opt, $1, $3, 0); } ; Opt_value: @@ -269,9 +270,11 @@ Mkopt_list: Mkoption: Save_id - = { newopt(&mkopt, $1, ns("")); } | + = { newopt(&mkopt, $1, ns(""), 0); } | Save_id EQUALS Opt_value - = { newopt(&mkopt, $1, $3); } ; + = { newopt(&mkopt, $1, $3, 0); } | + Save_id PLUSEQUALS Opt_value + = { newopt(&mkopt, $1, $3, 1); } ; Dev: ID @@ -299,7 +302,7 @@ NoDev_list: Device: Dev = { - newopt(&opt, devopt($1), ns("1")); + newopt(&opt, devopt($1), ns("1"), 0); /* and the device part */ newdev($1); } @@ -419,9 +422,9 @@ findopt(struct opt_head *list, char *nam * Add an option to the list of options. */ static void -newopt(struct opt_head *list, char *name, char *value) +newopt(struct opt_head *list, char *name, char *value, int append) { - struct opt *op; + struct opt *op, *op2; /* * Ignore inclusions listed explicitly for configuration files. @@ -431,7 +434,8 @@ newopt(struct opt_head *list, char *name return; } - if (findopt(list, name)) { + op2 = findopt(list, name); + if (op2 != NULL && !append) { printf("WARNING: duplicate option `%s' encountered.\n", name); return; } @@ -440,7 +444,12 @@ newopt(struct opt_head *list, char *name op->op_name = name; op->op_ownfile = 0; op->op_value = value; - SLIST_INSERT_HEAD(list, op, op_next); + if (op2 != NULL) { + while (SLIST_NEXT(op2, op_append) != NULL) + op2 = SLIST_NEXT(op2, op_append); + SLIST_NEXT(op2, op_append) = op; + } else + SLIST_INSERT_HEAD(list, op, op_next); } /* Modified: stable/7/usr.sbin/config/configvers.h ============================================================================== --- stable/7/usr.sbin/config/configvers.h Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/configvers.h Mon Jan 12 02:45:00 2009 (r187075) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600006 +#define CONFIGVERS 600007 #define MAJOR_VERS(x) ((x) / 100000) Modified: stable/7/usr.sbin/config/lang.l ============================================================================== --- stable/7/usr.sbin/config/lang.l Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/lang.l Mon Jan 12 02:45:00 2009 (r187075) @@ -156,6 +156,7 @@ PATH [./][-/.%^A-Za-z_0-9]+ ";" { return SEMICOLON; } "," { return COMMA; } "=" { BEGIN TOEOL; return EQUALS; } +"+=" { BEGIN TOEOL; return PLUSEQUALS; } <> { int tok; Modified: stable/7/usr.sbin/config/mkmakefile.c ============================================================================== --- stable/7/usr.sbin/config/mkmakefile.c Mon Jan 12 02:44:23 2009 (r187074) +++ stable/7/usr.sbin/config/mkmakefile.c Mon Jan 12 02:45:00 2009 (r187075) @@ -110,7 +110,7 @@ makefile(void) { FILE *ifp, *ofp; char line[BUFSIZ]; - struct opt *op; + struct opt *op, *t; int versreq; read_files(); @@ -127,8 +127,12 @@ makefile(void) if (ofp == 0) err(1, "%s", path("Makefile.new")); fprintf(ofp, "KERN_IDENT=%s\n", ident); - SLIST_FOREACH(op, &mkopt, op_next) - fprintf(ofp, "%s=%s\n", op->op_name, op->op_value); + SLIST_FOREACH_SAFE(op, &mkopt, op_next, t) { + fprintf(ofp, "%s=%s", op->op_name, op->op_value); + while ((op = SLIST_NEXT(op, op_append)) != NULL) + fprintf(ofp, " %s", op->op_value); + fprintf(ofp, "\n"); + } if (debugging) fprintf(ofp, "DEBUG=-g\n"); if (profiling) From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 02:51:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D203F1065674; Mon, 12 Jan 2009 02:51:29 +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 BE8FE8FC16; Mon, 12 Jan 2009 02:51:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C2pTAc046122; Mon, 12 Jan 2009 02:51:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C2pTuF046119; Mon, 12 Jan 2009 02:51:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120251.n0C2pTuF046119@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 02:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187076 - in stable/7/sys: . contrib/pf dev/cxgb dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 02:51:30 -0000 Author: yongari Date: Mon Jan 12 02:51:29 2009 New Revision: 187076 URL: http://svn.freebsd.org/changeset/base/187076 Log: MFC r185596: Add support for newer JMC250/JMC260 revisions. o Chip full mask revision 2 or later controllers have to set correct Tx MAC and Tx offload clock depending on negotiated link speed. o JMC260 chip full mask revision 2 has a silicon bug that can't handle 64bit DMA addressing. Add workaround to the bug by limiting DMA address space to be within 32bit. o Valid FIFO space of receive control and status register was changed on chip full mask revision 2 or later controllers. For these controllers, use default 16QW as it's supposed to be the safest value for maximum PCIe compatibility. JMicron confirmed performance will not be reduced even if the FIFO space is set to 16QW. o When interface is put into suspend/shutdown state, remove Tx MAC and Tx offload clock to save more power. We don't need Tx clock at all in this state. o Added new register definition for chip full mask revision 2 or later controllers. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmereg.h stable/7/sys/dev/jme/if_jmevar.h Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:45:00 2009 (r187075) +++ stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:51:29 2009 (r187076) @@ -651,6 +651,13 @@ jme_attach(device_t dev) goto fail; } + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) { + if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260 && + CHIPMODE_REVFM(sc->jme_chip_rev) == 2) + sc->jme_flags |= JME_FLAG_DMA32BIT; + sc->jme_flags |= JME_FLAG_TXCLK; + } + /* Reset the ethernet controller. */ jme_reset(sc); @@ -1007,6 +1014,8 @@ jme_dma_alloc(struct jme_softc *sc) int error, i; lowaddr = BUS_SPACE_MAXADDR; + if ((sc->jme_flags & JME_FLAG_DMA32BIT) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; again: /* Create parent ring tag. */ @@ -1106,25 +1115,32 @@ again: } sc->jme_rdata.jme_rx_ring_paddr = ctx.jme_busaddr; - /* Tx/Rx descriptor queue should reside within 4GB boundary. */ - tx_ring_end = sc->jme_rdata.jme_tx_ring_paddr + JME_TX_RING_SIZE; - rx_ring_end = sc->jme_rdata.jme_rx_ring_paddr + JME_RX_RING_SIZE; - if ((JME_ADDR_HI(tx_ring_end) != - JME_ADDR_HI(sc->jme_rdata.jme_tx_ring_paddr)) || - (JME_ADDR_HI(rx_ring_end) != - JME_ADDR_HI(sc->jme_rdata.jme_rx_ring_paddr))) { - device_printf(sc->jme_dev, "4GB boundary crossed, " - "switching to 32bit DMA address mode.\n"); - jme_dma_free(sc); - /* Limit DMA address space to 32bit and try again. */ - lowaddr = BUS_SPACE_MAXADDR_32BIT; - goto again; + if (lowaddr != BUS_SPACE_MAXADDR_32BIT) { + /* Tx/Rx descriptor queue should reside within 4GB boundary. */ + tx_ring_end = sc->jme_rdata.jme_tx_ring_paddr + + JME_TX_RING_SIZE; + rx_ring_end = sc->jme_rdata.jme_rx_ring_paddr + + JME_RX_RING_SIZE; + if ((JME_ADDR_HI(tx_ring_end) != + JME_ADDR_HI(sc->jme_rdata.jme_tx_ring_paddr)) || + (JME_ADDR_HI(rx_ring_end) != + JME_ADDR_HI(sc->jme_rdata.jme_rx_ring_paddr))) { + device_printf(sc->jme_dev, "4GB boundary crossed, " + "switching to 32bit DMA address mode.\n"); + jme_dma_free(sc); + /* Limit DMA address space to 32bit and try again. */ + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } } + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->jme_flags & JME_FLAG_DMA32BIT) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; /* Create parent buffer tag. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->jme_dev),/* parent */ 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ + lowaddr, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ @@ -1445,6 +1461,11 @@ jme_setwol(struct jme_softc *sc) JME_LOCK_ASSERT(sc); if (pci_find_extcap(sc->jme_dev, PCIY_PMG, &pmc) != 0) { + /* Remove Tx MAC/offload clock to save more power. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & + ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | + GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); /* No PME capability, PHY power down. */ jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, BMCR_PDOWN); @@ -1466,7 +1487,11 @@ jme_setwol(struct jme_softc *sc) CSR_WRITE_4(sc, JME_PMCS, pmcs); CSR_WRITE_4(sc, JME_GPREG0, gpr); - + /* Remove Tx MAC/offload clock to save more power. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & + ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | + GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); /* Request PME. */ pmstat = pci_read_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, 2); pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); @@ -1941,6 +1966,7 @@ jme_mac_config(struct jme_softc *sc) { struct mii_data *mii; uint32_t ghc, gpreg, rxmac, txmac, txpause; + uint32_t txclk; JME_LOCK_ASSERT(sc); @@ -1950,6 +1976,7 @@ jme_mac_config(struct jme_softc *sc) DELAY(10); CSR_WRITE_4(sc, JME_GHC, 0); ghc = 0; + txclk = 0; rxmac = CSR_READ_4(sc, JME_RXMAC); rxmac &= ~RXMAC_FC_ENB; txmac = CSR_READ_4(sc, JME_TXMAC); @@ -1982,14 +2009,17 @@ jme_mac_config(struct jme_softc *sc) switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_10_T: ghc |= GHC_SPEED_10; + txclk |= GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100; break; case IFM_100_TX: ghc |= GHC_SPEED_100; + txclk |= GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100; break; case IFM_1000_T: if ((sc->jme_flags & JME_FLAG_FASTETH) != 0) break; ghc |= GHC_SPEED_1000; + txclk |= GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) == 0) txmac |= TXMAC_CARRIER_EXT | TXMAC_FRAME_BURST; break; @@ -2019,6 +2049,8 @@ jme_mac_config(struct jme_softc *sc) 0x1B, 0x0004); } } + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + ghc |= txclk; CSR_WRITE_4(sc, JME_GHC, ghc); CSR_WRITE_4(sc, JME_RXMAC, rxmac); CSR_WRITE_4(sc, JME_TXMAC, txmac); @@ -2637,13 +2669,19 @@ jme_init_locked(struct jme_softc *sc) * decrease FIFO threshold to reduce the FIFO overruns for * frames larger than 4000 bytes. * For best performance of standard MTU sized frames use - * maximum allowable FIFO threshold, 128QW. + * maximum allowable FIFO threshold, 128QW. Note these do + * not hold on chip full mask verion >=2. For these + * controllers 64QW and 128QW are not valid value. */ - if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + - ETHER_CRC_LEN) > JME_RX_FIFO_SIZE) + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) sc->jme_rxcsr |= RXCSR_FIFO_THRESH_16QW; - else - sc->jme_rxcsr |= RXCSR_FIFO_THRESH_128QW; + else { + if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + + ETHER_CRC_LEN) > JME_RX_FIFO_SIZE) + sc->jme_rxcsr |= RXCSR_FIFO_THRESH_16QW; + else + sc->jme_rxcsr |= RXCSR_FIFO_THRESH_128QW; + } sc->jme_rxcsr |= sc->jme_rx_dma_size | RXCSR_RXQ_N_SEL(RXCSR_RXQ0); sc->jme_rxcsr |= RXCSR_DESC_RT_CNT(RXCSR_DESC_RT_CNT_DEFAULT); sc->jme_rxcsr |= RXCSR_DESC_RT_GAP_256 & RXCSR_DESC_RT_GAP_MASK; Modified: stable/7/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:45:00 2009 (r187075) +++ stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:51:29 2009 (r187076) @@ -239,8 +239,8 @@ #define RXCSR_FIFO_FTHRESH_MASK 0x30000000 #define RXCSR_FIFO_THRESH_16QW 0x00000000 #define RXCSR_FIFO_THRESH_32QW 0x04000000 -#define RXCSR_FIFO_THRESH_64QW 0x08000000 -#define RXCSR_FIFO_THRESH_128QW 0x0C000000 +#define RXCSR_FIFO_THRESH_64QW 0x08000000 /* JMC250/JMC260 REVFM < 2 */ +#define RXCSR_FIFO_THRESH_128QW 0x0C000000 /* JMC250/JMC260 REVFM < 2 */ #define RXCSR_FIFO_THRESH_MASK 0x0C000000 #define RXCSR_DMA_SIZE_16 0x00000000 #define RXCSR_DMA_SIZE_32 0x01000000 @@ -357,6 +357,16 @@ #define JME_GHC 0x0054 #define GHC_LOOPBACK 0x80000000 #define GHC_RESET 0x40000000 +#define GHC_RX_DMA_PWR_DIS 0x04000000 /* JMC250 REVFM >= 2 */ +#define GHC_FIFO_RD_PWR_DIS 0x02000000 /* JMC250 REVFM >= 2 */ +#define GHC_FIFO_WR_PWR_DIS 0x01000000 /* JMC250 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_100 0x00800000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_1000 0x00400000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_OFFLD_CLK_DIS 0x00000000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_100 0x00200000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_1000 0x00100000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_TX_MAC_CLK_DIS 0x00000000 /* JMC250/JMC260 REVFM >= 2 */ +#define GHC_AUTO_PHY_STAT_DIS 0x00000080 /* JMC250/JMC260 REVFM >= 2 */ #define GHC_FULL_DUPLEX 0x00000040 #define GHC_SPEED_UNKNOWN 0x00000000 #define GHC_SPEED_10 0x00000010 @@ -755,6 +765,10 @@ #define CHIPMODE_MODE_128P_MAC 0x00000003 #define CHIPMODE_MODE_128P_DBG 0x00000002 #define CHIPMODE_MODE_128P_PHY 0x00000000 +/* Chip full mask revision. */ +#define CHIPMODE_REVFM(x) ((x) & 0x0F) +/* Chip ECO revision. */ +#define CHIPMODE_REVECO(x) (((x) >> 4) & 0x0F) /* Shadow status base address high/low. */ #define JME_SHBASE_ADDR_HI 0x0848 Modified: stable/7/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:45:00 2009 (r187075) +++ stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:51:29 2009 (r187076) @@ -181,6 +181,8 @@ struct jme_softc { #define JME_FLAG_PMCAP 0x0020 #define JME_FLAG_FASTETH 0x0040 #define JME_FLAG_NOJUMBO 0x0080 +#define JME_FLAG_TXCLK 0x0100 +#define JME_FLAG_DMA32BIT 0x0200 #define JME_FLAG_DETACH 0x4000 #define JME_FLAG_LINK 0x8000 From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 03:26:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 722A9106566B; Mon, 12 Jan 2009 03:26:53 +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 5E2B68FC12; Mon, 12 Jan 2009 03:26:53 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3QrVl047093; Mon, 12 Jan 2009 03:26:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3QrWV047090; Mon, 12 Jan 2009 03:26:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120326.n0C3QrWV047090@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 03:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187077 - in stable/7/sys: . contrib/pf dev/cxgb dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:26:54 -0000 Author: yongari Date: Mon Jan 12 03:26:52 2009 New Revision: 187077 URL: http://svn.freebsd.org/changeset/base/187077 Log: MFC r185597: Add HW MAC counter support for newer JMC250/JMC260 revisions. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmereg.h stable/7/sys/dev/jme/if_jmevar.h Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Mon Jan 12 02:51:29 2009 (r187076) +++ stable/7/sys/dev/jme/if_jme.c Mon Jan 12 03:26:52 2009 (r187077) @@ -150,6 +150,9 @@ static void jme_init_ssb(struct jme_soft static int jme_newbuf(struct jme_softc *, struct jme_rxdesc *); static void jme_set_vlan(struct jme_softc *); static void jme_set_filter(struct jme_softc *); +static void jme_stats_clear(struct jme_softc *); +static void jme_stats_save(struct jme_softc *); +static void jme_stats_update(struct jme_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_jme_tx_coal_to(SYSCTL_HANDLER_ARGS); static int sysctl_hw_jme_tx_coal_pkt(SYSCTL_HANDLER_ARGS); @@ -656,6 +659,7 @@ jme_attach(device_t dev) CHIPMODE_REVFM(sc->jme_chip_rev) == 2) sc->jme_flags |= JME_FLAG_DMA32BIT; sc->jme_flags |= JME_FLAG_TXCLK; + sc->jme_flags |= JME_FLAG_HWMIB; } /* Reset the ethernet controller. */ @@ -887,35 +891,41 @@ jme_detach(device_t dev) return (0); } +#define JME_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + static void jme_sysctl_node(struct jme_softc *sc) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct jme_hw_stats *stats; int error; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "tx_coal_to", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, - 0, sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "tx_coal_pkt", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, - 0, sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "rx_coal_to", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, - 0, sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "rx_coal_pkt", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, - 0, sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->jme_dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)), OID_AUTO, - "process_limit", CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, - 0, sysctl_hw_jme_proc_limit, "I", + stats = &sc->jme_stats; + ctx = device_get_sysctl_ctx(sc->jme_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_to", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, 0, + sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_pkt", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, 0, + sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_to", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, 0, + sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_pkt", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, 0, + sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", + CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, 0, + sysctl_hw_jme_proc_limit, "I", "max number of Rx events to process"); /* Pull in device tunables. */ @@ -984,8 +994,43 @@ jme_sysctl_node(struct jme_softc *sc) sc->jme_rx_coal_pkt = PCCRX_COAL_PKT_DEFAULT; } } + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "JME statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_good_frames, "Good frames"); + JME_SYSCTL_STAT_ADD32(ctx, child, "crc_errs", + &stats->rx_crc_errs, "CRC errors"); + JME_SYSCTL_STAT_ADD32(ctx, child, "mii_errs", + &stats->rx_mii_errs, "MII errors"); + JME_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + JME_SYSCTL_STAT_ADD32(ctx, child, "desc_empty", + &stats->rx_desc_empty, "Descriptor empty"); + JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", + &stats->rx_bad_frames, "Bad frames"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_good_frames, "Good frames"); + JME_SYSCTL_STAT_ADD32(ctx, child, "bad_frames", + &stats->tx_bad_frames, "Bad frames"); } +#undef JME_SYSCTL_STAT_ADD32 + struct jme_dmamap_arg { bus_addr_t jme_busaddr; }; @@ -2164,6 +2209,7 @@ jme_link_task(void *arg, int pending) /* Program MAC with resolved speed/duplex/flow-control. */ if ((sc->jme_flags & JME_FLAG_LINK) != 0) { jme_mac_config(sc); + jme_stats_clear(sc); CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr); CSR_WRITE_4(sc, JME_TXCSR, sc->jme_txcsr); @@ -2553,6 +2599,7 @@ jme_tick(void *arg) * faster and limit the maximum delay to a hz. */ jme_txeof(sc); + jme_stats_update(sc); jme_watchdog(sc); callout_reset(&sc->jme_tick_ch, hz, jme_tick, sc); } @@ -2862,6 +2909,8 @@ jme_stop(struct jme_softc *sc) txd->tx_ndesc = 0; } } + jme_stats_update(sc); + jme_stats_save(sc); } static void @@ -3093,6 +3142,76 @@ jme_set_filter(struct jme_softc *sc) CSR_WRITE_4(sc, JME_RXMAC, rxcfg); } +static void +jme_stats_clear(struct jme_softc *sc) +{ + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + + /* Disable and clear counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0xFFFFFFFF); + /* Activate hw counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0); + CSR_READ_4(sc, JME_STATCSR); + bzero(&sc->jme_stats, sizeof(struct jme_hw_stats)); +} + +static void +jme_stats_save(struct jme_softc *sc) +{ + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + /* Save current counters. */ + bcopy(&sc->jme_stats, &sc->jme_ostats, sizeof(struct jme_hw_stats)); + /* Disable and clear counters. */ + CSR_WRITE_4(sc, JME_STATCSR, 0xFFFFFFFF); +} + +static void +jme_stats_update(struct jme_softc *sc) +{ + struct jme_hw_stats *stat, *ostat; + uint32_t reg; + + JME_LOCK_ASSERT(sc); + + if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) + return; + stat = &sc->jme_stats; + ostat = &sc->jme_ostats; + stat->tx_good_frames = CSR_READ_4(sc, JME_STAT_TXGOOD); + stat->rx_good_frames = CSR_READ_4(sc, JME_STAT_RXGOOD); + reg = CSR_READ_4(sc, JME_STAT_CRCMII); + stat->rx_crc_errs = (reg & STAT_RX_CRC_ERR_MASK) >> + STAT_RX_CRC_ERR_SHIFT; + stat->rx_mii_errs = (reg & STAT_RX_MII_ERR_MASK) >> + STAT_RX_MII_ERR_SHIFT; + reg = CSR_READ_4(sc, JME_STAT_RXERR); + stat->rx_fifo_oflows = (reg & STAT_RXERR_OFLOW_MASK) >> + STAT_RXERR_OFLOW_SHIFT; + stat->rx_desc_empty = (reg & STAT_RXERR_MPTY_MASK) >> + STAT_RXERR_MPTY_SHIFT; + reg = CSR_READ_4(sc, JME_STAT_FAIL); + stat->rx_bad_frames = (reg & STAT_FAIL_RX_MASK) >> STAT_FAIL_RX_SHIFT; + stat->tx_bad_frames = (reg & STAT_FAIL_TX_MASK) >> STAT_FAIL_TX_SHIFT; + + /* Account for previous counters. */ + stat->rx_good_frames += ostat->rx_good_frames; + stat->rx_crc_errs += ostat->rx_crc_errs; + stat->rx_mii_errs += ostat->rx_mii_errs; + stat->rx_fifo_oflows += ostat->rx_fifo_oflows; + stat->rx_desc_empty += ostat->rx_desc_empty; + stat->rx_bad_frames += ostat->rx_bad_frames; + stat->tx_good_frames += ostat->tx_good_frames; + stat->tx_bad_frames += ostat->tx_bad_frames; +} + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: stable/7/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 02:51:29 2009 (r187076) +++ stable/7/sys/dev/jme/if_jmereg.h Mon Jan 12 03:26:52 2009 (r187077) @@ -199,6 +199,7 @@ #define TXMAC_IFG2_DEFAULT 0x40000000 #define TXMAC_IFG1_MASK 0x30000000 #define TXMAC_IFG1_DEFAULT 0x20000000 +#define TXMAC_PAUSE_CNT_MASK 0x00FF0000 #define TXMAC_THRESH_1_PKT 0x00000300 #define TXMAC_THRESH_1_2_PKT 0x00000200 #define TXMAC_THRESH_1_4_PKT 0x00000100 @@ -403,6 +404,44 @@ #define PMCS_MAGIC_FRAME_ENB 0x00000001 #define PMCS_WOL_ENB_MASK 0x0000FFFF +/* + * Statistic registers control and status. + * These statistics registers are valid only for JMC250/JMC260 REVFM >= 2. + */ +#define JME_STATCSR 0x0064 +#define STATCSR_RXMPT_DIS 0x00000080 +#define STATCSR_OFLOW_DIS 0x00000040 +#define STATCSR_MIIRXER_DIS 0x00000020 +#define STATCSR_CRCERR_DIS 0x00000010 +#define STATCSR_RXBAD_DIS 0x00000008 +#define STATCSR_RXGOOD_DIS 0x00000004 +#define STATCSR_TXBAD_DIS 0x00000002 +#define STATCSR_TXGOOD_DIS 0x00000001 + +#define JME_STAT_TXGOOD 0x0068 + +#define JME_STAT_RXGOOD 0x006C + +#define JME_STAT_CRCMII 0x0070 +#define STAT_RX_CRC_ERR_MASK 0xFFFF0000 +#define STAT_RX_MII_ERR_MASK 0x0000FFFF +#define STAT_RX_CRC_ERR_SHIFT 16 +#define STAT_RX_MII_ERR_SHIFT 0 + +#define JME_STAT_RXERR 0x0074 +#define STAT_RXERR_OFLOW_MASK 0xFFFF0000 +#define STAT_RXERR_MPTY_MASK 0x0000FFFF +#define STAT_RXERR_OFLOW_SHIFT 16 +#define STAT_RXERR_MPTY_SHIFT 0 + +#define JME_STAT_RESERVED1 0x0078 + +#define JME_STAT_FAIL 0x007C +#define STAT_FAIL_RX_MASK 0xFFFF0000 +#define STAT_FAIL_TX_MASK 0x0000FFFF +#define STAT_FAIL_RX_SHIFT 16 +#define STAT_FAIL_TX_SHIFT 0 + /* Giga PHY & EEPROM registers. */ #define JME_PHY_EEPROM_BASE_ADDR 0x0400 Modified: stable/7/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 02:51:29 2009 (r187076) +++ stable/7/sys/dev/jme/if_jmevar.h Mon Jan 12 03:26:52 2009 (r187077) @@ -154,6 +154,18 @@ struct jme_ring_data { (sizeof(struct jme_desc) * JME_RX_RING_CNT) #define JME_SSB_SIZE sizeof(struct jme_ssb) +/* Statistics counters. */ +struct jme_hw_stats { + uint32_t rx_good_frames; + uint32_t rx_crc_errs; + uint32_t rx_mii_errs; + uint32_t rx_fifo_oflows; + uint32_t rx_desc_empty; + uint32_t rx_bad_frames; + uint32_t tx_good_frames; + uint32_t tx_bad_frames; +}; + /* * Software state per device. */ @@ -183,9 +195,12 @@ struct jme_softc { #define JME_FLAG_NOJUMBO 0x0080 #define JME_FLAG_TXCLK 0x0100 #define JME_FLAG_DMA32BIT 0x0200 +#define JME_FLAG_HWMIB 0x0400 #define JME_FLAG_DETACH 0x4000 #define JME_FLAG_LINK 0x8000 + struct jme_hw_stats jme_ostats; + struct jme_hw_stats jme_stats; struct callout jme_tick_ch; struct jme_chain_data jme_cdata; struct jme_ring_data jme_rdata; From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 03:32:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C4B0106564A; Mon, 12 Jan 2009 03:32: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 592F88FC1A; Mon, 12 Jan 2009 03:32:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3Wt5O047253; Mon, 12 Jan 2009 03:32:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3Wt9V047252; Mon, 12 Jan 2009 03:32:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120332.n0C3Wt9V047252@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 03:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187078 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:32:56 -0000 Author: yongari Date: Mon Jan 12 03:32:54 2009 New Revision: 187078 URL: http://svn.freebsd.org/changeset/base/187078 Log: MFC r184908: Fix Rx/Tx checksum offload ioctl handling. Now checksum offload can be controlled by ifconfig(8). Note, VLAN hardware tagging controls still lacks required handler but it requires more driver cleanups so I didn't touch that part. PR: kern/128766 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/vge/if_vge.c Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Mon Jan 12 03:26:52 2009 (r187077) +++ stable/7/sys/dev/vge/if_vge.c Mon Jan 12 03:32:54 2009 (r187078) @@ -2226,15 +2226,17 @@ vge_ioctl(ifp, command, data) } } #endif /* DEVICE_POLLING */ - if (mask & IFCAP_HWCSUM) { - ifp->if_capenable |= ifr->ifr_reqcap & (IFCAP_HWCSUM); - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist = VGE_CSUM_FEATURES; + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= VGE_CSUM_FEATURES; else - ifp->if_hwassist = 0; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_init(sc); + ifp->if_hwassist &= ~VGE_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; } break; default: From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 03:33:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FF811065677; Mon, 12 Jan 2009 03:33:48 +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 4E9238FC0A; Mon, 12 Jan 2009 03:33:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3XmYf047324; Mon, 12 Jan 2009 03:33:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3Xmqi047323; Mon, 12 Jan 2009 03:33:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901120333.n0C3Xmqi047323@svn.freebsd.org> From: Xin LI Date: Mon, 12 Jan 2009 03:33: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: r187079 - head/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:33:49 -0000 Author: delphij Date: Mon Jan 12 03:33:48 2009 New Revision: 187079 URL: http://svn.freebsd.org/changeset/base/187079 Log: Fix typo. Submitted by: Ben Kaduk MFC after: 3 days Modified: head/sbin/fsck_ffs/fsck_ffs.8 Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 12 03:32:54 2009 (r187078) +++ head/sbin/fsck_ffs/fsck_ffs.8 Mon Jan 12 03:33:48 2009 (r187079) @@ -187,7 +187,7 @@ and causes .Nm to crash otherwise. Be .Em very careful -using this flag, is dangerous if there are data transmission hazards +using this flag, it is dangerous if there are data transmission hazards because a false positive cylinder group magic number mismatch could cause .Em irrevertible data loss! From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 03:48:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF22A106566B; Mon, 12 Jan 2009 03:48:25 +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 6F1DA8FC1C; Mon, 12 Jan 2009 03:48:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3mPNW047670; Mon, 12 Jan 2009 03:48:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3mPCg047667; Mon, 12 Jan 2009 03:48:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120348.n0C3mPCg047667@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 03:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187080 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:48:26 -0000 Author: yongari Date: Mon Jan 12 03:48:25 2009 New Revision: 187080 URL: http://svn.freebsd.org/changeset/base/187080 Log: MFC r184240: Various bus_dma(9) fixes. - The hardware does not support DAC so limit DMA address space to 4GB. - Removed BUS_DMA_ALLOC_NOW flag. - Created separated Tx buffer and Rx buffer DMA tags. Previously it used to single DMA tag and it was not possible to specify different DMA restrictions. - Apply 4 bytes alignment limitation of Tx buffer. - Apply 8 bytes alignment limitation of Rx buffer. - Tx side bus_dmamap_load_mbuf_sg(9) support. - Preallocate Tx DMA maps as creating DMA maps take very long time on architectures that require real DMA maps. - Adjust guard buffer size to 1522 + 8 as it should include VLAN and additional reserved bytes in Rx buffer. - Plug memory leak in device detach. Previously wrong buffer address was used to free allocated memory. - Added rl_list_rx_init() to clear Rx buffer and cleared the buffer. - Don't destroy DMA maps in rl_txeof() as the DMA map should be reused. There is no reason to destroy/recreate the DMA maps in this driver. - Removed rl_dma_map_rxbuf()/rl_dma_map_txbuf() callbacks. - The hardware does not support descriptor based DMA on Tx side and the Tx buffer address should be aligned on 4 bytes boundary as well as manual padding for short frames. Because of this hardware limitation rl(4) always used to invoke m_defrag(9) to get a 4 bytes aligned single buffer. However m_defrag(9) takes a lot of CPU cycles on slow machines and not all packets need the help of m_defrag(9). Armed with the information, don't invoke m_defrag(9) if the following conditions are true. 1. Buffer is not fragmented. 2. Buffer is aligned on 4 bytes boundary. 3. Manual padding is not necessary. 4. Or padding is necessary but upper stack passed a writable buffer and the space needed for padding is satisfied. This change combined with preallocated DMA maps greatly increased Tx performance of driver on sparc64. - Moved bus_dmamap_sync(9) in rl_start_locked() to rl_encap() and corrected memory synchronization operation specifier of bus_dmamap_sync(9). - Removed bus_dmamap_unload(9) in rl_stop(). There is no need to reload/unload Rx buffer as rl(4) always have to copy from the buffer. It just needs proper bus_dmamap_sync(9) calls before copying the received frame. With this change rl(4) should work on systems with more than 4GB memory. PR: kern/128143 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/if_rl.c stable/7/sys/pci/if_rlreg.h Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Mon Jan 12 03:33:48 2009 (r187079) +++ stable/7/sys/pci/if_rl.c Mon Jan 12 03:48:25 2009 (r187080) @@ -182,12 +182,14 @@ static struct rl_type rl_devs[] = { static int rl_attach(device_t); static int rl_detach(device_t); -static void rl_dma_map_rxbuf(void *, bus_dma_segment_t *, int, int); -static void rl_dma_map_txbuf(void *, bus_dma_segment_t *, int, int); +static void rl_dmamap_cb(void *, bus_dma_segment_t *, int, int); +static int rl_dma_alloc(struct rl_softc *); +static void rl_dma_free(struct rl_softc *); static void rl_eeprom_putbyte(struct rl_softc *, int); static void rl_eeprom_getword(struct rl_softc *, int, uint16_t *); -static int rl_encap(struct rl_softc *, struct mbuf * ); +static int rl_encap(struct rl_softc *, struct mbuf **); static int rl_list_tx_init(struct rl_softc *); +static int rl_list_rx_init(struct rl_softc *); static int rl_ifmedia_upd(struct ifnet *); static void rl_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int rl_ioctl(struct ifnet *, u_long, caddr_t); @@ -269,22 +271,6 @@ DRIVER_MODULE(miibus, rl, miibus_driver, CSR_WRITE_1(sc, RL_EECMD, \ CSR_READ_1(sc, RL_EECMD) & ~x) -static void -rl_dma_map_rxbuf(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct rl_softc *sc = arg; - - CSR_WRITE_4(sc, RL_RXADDR, segs->ds_addr & 0xFFFFFFFF); -} - -static void -rl_dma_map_txbuf(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct rl_softc *sc = arg; - - CSR_WRITE_4(sc, RL_CUR_TXADDR(sc), segs->ds_addr & 0xFFFFFFFF); -} - /* * Send a read command and address to the EEPROM, check for ACK. */ @@ -756,6 +742,24 @@ rl_probe(device_t dev) return (ENXIO); } +struct rl_dmamap_arg { + bus_addr_t rl_busaddr; +}; + +static void +rl_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct rl_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct rl_dmamap_arg *)arg; + ctx->rl_busaddr = segs[0].ds_addr; +} + /* * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. @@ -868,59 +872,9 @@ rl_attach(device_t dev) eaddr[i] = CSR_READ_1(sc, RL_IDR0 + i); } - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define RL_NSEG_NEW 32 - error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, RL_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->rl_parent_tag); - if (error) + if ((error = rl_dma_alloc(sc)) != 0) goto fail; - /* - * Now allocate a tag for the DMA descriptor lists. - * All of our lists are allocated as a contiguous block - * of memory. - */ - error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - RL_RXBUFLEN + 1518, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->rl_tag); - if (error) - goto fail; - - /* - * Now allocate a chunk of DMA-able memory based on the - * tag we just created. - */ - error = bus_dmamem_alloc(sc->rl_tag, - (void **)&sc->rl_cdata.rl_rx_buf, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->rl_cdata.rl_rx_dmamap); - if (error) { - device_printf(dev, "no memory for list buffers!\n"); - bus_dma_tag_destroy(sc->rl_tag); - sc->rl_tag = NULL; - goto fail; - } - - /* Leave a few bytes before the start of the RX ring buffer. */ - sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf; - sc->rl_cdata.rl_rx_buf += sizeof(uint64_t); - ifp = sc->rl_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -1019,20 +973,155 @@ rl_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->rl_tag) { - bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); - bus_dmamem_free(sc->rl_tag, sc->rl_cdata.rl_rx_buf, - sc->rl_cdata.rl_rx_dmamap); - bus_dma_tag_destroy(sc->rl_tag); - } - if (sc->rl_parent_tag) - bus_dma_tag_destroy(sc->rl_parent_tag); + rl_dma_free(sc); mtx_destroy(&sc->rl_mtx); return (0); } +static int +rl_dma_alloc(struct rl_softc *sc) +{ + struct rl_dmamap_arg ctx; + int error, i; + + /* + * Allocate the parent bus DMA tag appropriate for PCI. + */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->rl_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, 0, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_parent_tag); + if (error) { + device_printf(sc->rl_dev, + "failed to create parent DMA tag.\n"); + goto fail; + } + /* Create DMA tag for Rx memory block. */ + error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ + RL_RX_8139_BUF_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, 1, /* maxsize,nsegments */ + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_cdata.rl_rx_tag); + if (error) { + device_printf(sc->rl_dev, + "failed to create Rx memory block DMA tag.\n"); + goto fail; + } + /* Create DMA tag for Tx buffer. */ + error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ + RL_TX_8139_BUF_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, 1, /* maxsize, nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_cdata.rl_tx_tag); + if (error) { + device_printf(sc->rl_dev, "failed to create Tx DMA tag.\n"); + goto fail; + } + + /* + * Allocate DMA'able memory and load DMA map for Rx memory block. + */ + error = bus_dmamem_alloc(sc->rl_cdata.rl_rx_tag, + (void **)&sc->rl_cdata.rl_rx_buf, BUS_DMA_WAITOK | + BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->rl_cdata.rl_rx_dmamap); + if (error != 0) { + device_printf(sc->rl_dev, + "failed to allocate Rx DMA memory block.\n"); + goto fail; + } + ctx.rl_busaddr = 0; + error = bus_dmamap_load(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_dmamap, sc->rl_cdata.rl_rx_buf, + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, rl_dmamap_cb, &ctx, + BUS_DMA_NOWAIT); + if (error != 0 || ctx.rl_busaddr == 0) { + device_printf(sc->rl_dev, + "could not load Rx DMA memory block.\n"); + goto fail; + } + sc->rl_cdata.rl_rx_buf_paddr = ctx.rl_busaddr; + + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < RL_TX_LIST_CNT; i++) { + sc->rl_cdata.rl_tx_chain[i] = NULL; + sc->rl_cdata.rl_tx_dmamap[i] = NULL; + error = bus_dmamap_create(sc->rl_cdata.rl_tx_tag, 0, + &sc->rl_cdata.rl_tx_dmamap[i]); + if (error != 0) { + device_printf(sc->rl_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + + /* Leave a few bytes before the start of the RX ring buffer. */ + sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf; + sc->rl_cdata.rl_rx_buf += RL_RX_8139_BUF_RESERVE; + +fail: + return (error); +} + +static void +rl_dma_free(struct rl_softc *sc) +{ + int i; + + /* Rx memory block. */ + if (sc->rl_cdata.rl_rx_tag != NULL) { + if (sc->rl_cdata.rl_rx_dmamap != NULL) + bus_dmamap_unload(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_dmamap); + if (sc->rl_cdata.rl_rx_dmamap != NULL && + sc->rl_cdata.rl_rx_buf_ptr != NULL) + bus_dmamem_free(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_buf_ptr, + sc->rl_cdata.rl_rx_dmamap); + sc->rl_cdata.rl_rx_buf_ptr = NULL; + sc->rl_cdata.rl_rx_buf = NULL; + sc->rl_cdata.rl_rx_dmamap = NULL; + bus_dma_tag_destroy(sc->rl_cdata.rl_rx_tag); + sc->rl_cdata.rl_tx_tag = NULL; + } + + /* Tx buffers. */ + if (sc->rl_cdata.rl_tx_tag != NULL) { + for (i = 0; i < RL_TX_LIST_CNT; i++) { + if (sc->rl_cdata.rl_tx_dmamap[i] != NULL) { + bus_dmamap_destroy( + sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i]); + sc->rl_cdata.rl_tx_dmamap[i] = NULL; + } + bus_dma_tag_destroy(sc->rl_cdata.rl_tx_tag); + sc->rl_cdata.rl_tx_tag = NULL; + } + } + + if (sc->rl_parent_tag != NULL) { + bus_dma_tag_destroy(sc->rl_parent_tag); + sc->rl_parent_tag = NULL; + } +} + /* * Initialize the transmit descriptors. */ @@ -1057,6 +1146,20 @@ rl_list_tx_init(struct rl_softc *sc) return (0); } +static int +rl_list_rx_init(struct rl_softc *sc) +{ + + RL_LOCK_ASSERT(sc); + + bzero(sc->rl_cdata.rl_rx_buf_ptr, + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ); + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, sc->rl_cdata.rl_rx_dmamap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + return (0); +} + /* * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. @@ -1093,8 +1196,8 @@ rl_rxeof(struct rl_softc *sc) RL_LOCK_ASSERT(sc); - bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->rl_cdata.rl_rx_tag, sc->rl_cdata.rl_rx_dmamap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); cur_rx = (CSR_READ_2(sc, RL_CURRXADDR) + 16) % RL_RXBUFLEN; @@ -1192,6 +1295,8 @@ rl_rxeof(struct rl_softc *sc) (*ifp->if_input)(ifp, m); RL_LOCK(sc); } + + /* No need to sync Rx memory block as we didn't mofify it. */ } /* @@ -1220,8 +1325,9 @@ rl_txeof(struct rl_softc *sc) ifp->if_collisions += (txstat & RL_TXSTAT_COLLCNT) >> 24; - bus_dmamap_unload(sc->rl_tag, RL_LAST_DMAMAP(sc)); - bus_dmamap_destroy(sc->rl_tag, RL_LAST_DMAMAP(sc)); + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc), + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc)); m_freem(RL_LAST_TXMBUF(sc)); RL_LAST_TXMBUF(sc) = NULL; /* @@ -1369,41 +1475,64 @@ done_locked: * pointers to the fragment pointers. */ static int -rl_encap(struct rl_softc *sc, struct mbuf *m_head) +rl_encap(struct rl_softc *sc, struct mbuf **m_head) { - struct mbuf *m_new = NULL; + struct mbuf *m; + bus_dma_segment_t txsegs[1]; + int error, nsegs, padlen; RL_LOCK_ASSERT(sc); + m = *m_head; + padlen = 0; + /* + * Hardware doesn't auto-pad, so we have to make sure + * pad short frames out to the minimum frame length. + */ + if (m->m_pkthdr.len < RL_MIN_FRAMELEN) + padlen = RL_MIN_FRAMELEN - m->m_pkthdr.len; /* * The RealTek is brain damaged and wants longword-aligned * TX buffers, plus we can only have one fragment buffer * per packet. We have to copy pretty much all the time. */ - m_new = m_defrag(m_head, M_DONTWAIT); - - if (m_new == NULL) { - m_freem(m_head); - return (1); + if (m->m_next != NULL || (mtod(m, uintptr_t) & 3) != 0 || + (padlen > 0 && M_TRAILINGSPACE(m) < padlen)) { + m = m_defrag(*m_head, M_DONTWAIT); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOMEM); + } } - m_head = m_new; + *m_head = m; - /* Pad frames to at least 60 bytes. */ - if (m_head->m_pkthdr.len < RL_MIN_FRAMELEN) { + if (padlen > 0) { /* * Make security concious people happy: zero out the * bytes in the pad area, since we don't know what * this mbuf cluster buffer's previous user might * have left in it. */ - bzero(mtod(m_head, char *) + m_head->m_pkthdr.len, - RL_MIN_FRAMELEN - m_head->m_pkthdr.len); - m_head->m_pkthdr.len += - (RL_MIN_FRAMELEN - m_head->m_pkthdr.len); - m_head->m_len = m_head->m_pkthdr.len; + bzero(mtod(m, char *) + m->m_pkthdr.len, padlen); + m->m_pkthdr.len += padlen; + m->m_len = m->m_pkthdr.len; + } + + error = bus_dmamap_load_mbuf_sg(sc->rl_cdata.rl_tx_tag, + RL_CUR_DMAMAP(sc), m, txsegs, &nsegs, 0); + if (error != 0) + return (error); + if (nsegs == 0) { + m_freem(*m_head); + *m_head = NULL; + return (EIO); } - RL_CUR_TXMBUF(sc) = m_head; + RL_CUR_TXMBUF(sc) = m; + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_CUR_DMAMAP(sc), + BUS_DMASYNC_PREWRITE); + CSR_WRITE_4(sc, RL_CUR_TXADDR(sc), RL_ADDR_LO(txsegs[0].ds_addr)); return (0); } @@ -1436,19 +1565,18 @@ rl_start_locked(struct ifnet *ifp) if (m_head == NULL) break; - if (rl_encap(sc, m_head)) + if (rl_encap(sc, &m_head)) { + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; + } /* Pass a copy of this mbuf chain to the bpf subsystem. */ BPF_MTAP(ifp, RL_CUR_TXMBUF(sc)); /* Transmit the frame. */ - bus_dmamap_create(sc->rl_tag, 0, &RL_CUR_DMAMAP(sc)); - bus_dmamap_load(sc->rl_tag, RL_CUR_DMAMAP(sc), - mtod(RL_CUR_TXMBUF(sc), void *), - RL_CUR_TXMBUF(sc)->m_pkthdr.len, rl_dma_map_txbuf, sc, 0); - bus_dmamap_sync(sc->rl_tag, RL_CUR_DMAMAP(sc), - BUS_DMASYNC_PREREAD); CSR_WRITE_4(sc, RL_CUR_TXSTAT(sc), RL_TXTHRESH(sc->rl_txthresh) | RL_CUR_TXMBUF(sc)->m_pkthdr.len); @@ -1507,14 +1635,13 @@ rl_init_locked(struct rl_softc *sc) CSR_WRITE_STREAM_4(sc, RL_IDR4, eaddr[1]); CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); - /* Init the RX buffer pointer register. */ - bus_dmamap_load(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - sc->rl_cdata.rl_rx_buf, RL_RXBUFLEN, rl_dma_map_rxbuf, sc, 0); - bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - BUS_DMASYNC_PREWRITE); - + /* Init the RX memory block pointer register. */ + CSR_WRITE_4(sc, RL_RXADDR, sc->rl_cdata.rl_rx_buf_paddr + + RL_RX_8139_BUF_RESERVE); /* Init TX descriptors. */ rl_list_tx_init(sc); + /* Init Rx memory block. */ + rl_list_rx_init(sc); /* * Enable transmit and receive. @@ -1718,19 +1845,21 @@ rl_stop(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); - bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); /* * Free the TX list buffers. */ for (i = 0; i < RL_TX_LIST_CNT; i++) { if (sc->rl_cdata.rl_tx_chain[i] != NULL) { - bus_dmamap_unload(sc->rl_tag, - sc->rl_cdata.rl_tx_dmamap[i]); - bus_dmamap_destroy(sc->rl_tag, - sc->rl_cdata.rl_tx_dmamap[i]); - m_freem(sc->rl_cdata.rl_tx_chain[i]); - sc->rl_cdata.rl_tx_chain[i] = NULL; + if (sc->rl_cdata.rl_tx_chain[i] != NULL) { + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i]); + m_freem(sc->rl_cdata.rl_tx_chain[i]); + sc->rl_cdata.rl_tx_chain[i] = NULL; + } CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)), 0x0000000); } Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Mon Jan 12 03:33:48 2009 (r187079) +++ stable/7/sys/pci/if_rlreg.h Mon Jan 12 03:48:25 2009 (r187080) @@ -502,6 +502,11 @@ #define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) #define RL_TX_LIST_CNT 4 #define RL_MIN_FRAMELEN 60 +#define RL_TX_8139_BUF_ALIGN 4 +#define RL_RX_8139_BUF_ALIGN 8 +#define RL_RX_8139_BUF_RESERVE sizeof(int64_t) +#define RL_RX_8139_BUF_GUARD_SZ \ + (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) #define RL_TXTHRESH(x) ((x) << 11) #define RL_TX_THRESH_INIT 96 #define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH @@ -523,10 +528,13 @@ struct rl_chain_data { uint16_t cur_rx; uint8_t *rl_rx_buf; uint8_t *rl_rx_buf_ptr; - bus_dmamap_t rl_rx_dmamap; struct mbuf *rl_tx_chain[RL_TX_LIST_CNT]; bus_dmamap_t rl_tx_dmamap[RL_TX_LIST_CNT]; + bus_dma_tag_t rl_tx_tag; + bus_dma_tag_t rl_rx_tag; + bus_dmamap_t rl_rx_dmamap; + bus_addr_t rl_rx_buf_paddr; uint8_t last_tx; uint8_t cur_tx; }; @@ -814,7 +822,6 @@ struct rl_softc { void *rl_intrhand[RL_MSI_MESSAGES]; device_t rl_miibus; bus_dma_tag_t rl_parent_tag; - bus_dma_tag_t rl_tag; uint8_t rl_type; int rl_eecmd_read; int rl_eewidth; From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 03:54:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F2E210656D1; Mon, 12 Jan 2009 03:54:34 +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 2163B8FC08; Mon, 12 Jan 2009 03:54:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C3sYNw048252; Mon, 12 Jan 2009 03:54:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C3sYUS048251; Mon, 12 Jan 2009 03:54:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120354.n0C3sYUS048251@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 03:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187081 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 03:54:35 -0000 Author: yongari Date: Mon Jan 12 03:54:33 2009 New Revision: 187081 URL: http://svn.freebsd.org/changeset/base/187081 Log: MFC r184241-184243: r184241: Don't rearm watchdog timer in rl_txeof(). The watchdog timer was already set in rl_start_locked(). Touching the watchdog timer in other places will hide the root cause of watchdog timeouts. r184282: Make rl_init_locked() call rl_reset. This will put hardware into sane state after resume/watchdog timeouts. r184283: After sending stop command to MAC, give hardware chance to drain active DMA operation. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/if_rl.c Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Mon Jan 12 03:48:25 2009 (r187080) +++ stable/7/sys/pci/if_rl.c Mon Jan 12 03:54:33 2009 (r187081) @@ -1348,7 +1348,6 @@ rl_txeof(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); oldthresh = sc->rl_txthresh; /* error recovery */ - rl_reset(sc); rl_init_locked(sc); /* restore original threshold */ sc->rl_txthresh = oldthresh; @@ -1360,8 +1359,6 @@ rl_txeof(struct rl_softc *sc) if (RL_LAST_TXMBUF(sc) == NULL) sc->rl_watchdog_timer = 0; - else if (sc->rl_watchdog_timer == 0) - sc->rl_watchdog_timer = 5; } static void @@ -1417,10 +1414,8 @@ rl_poll_locked(struct ifnet *ifp, enum p /* XXX We should check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -1457,10 +1452,8 @@ rl_intr(void *arg) rl_rxeof(sc); if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR)) rl_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init_locked(sc); - } } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1623,6 +1616,8 @@ rl_init_locked(struct rl_softc *sc) */ rl_stop(sc); + rl_reset(sc); + /* * Init our MAC address. Even though the chipset * documentation doesn't mention it, we need to enter "Config @@ -1845,6 +1840,14 @@ rl_stop(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); + for (i = 0; i < RL_TIMEOUT; i++) { + DELAY(10); + if ((CSR_READ_1(sc, RL_COMMAND) & + (RL_CMD_RX_ENB | RL_CMD_TX_ENB)) == 0) + break; + } + if (i == RL_TIMEOUT) + device_printf(sc->rl_dev, "Unable to stop Tx/Rx MAC\n"); /* * Free the TX list buffers. From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 04:03:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 095FB106566B; Mon, 12 Jan 2009 04:03:26 +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 EA0D58FC0A; Mon, 12 Jan 2009 04:03:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C43Prt049135; Mon, 12 Jan 2009 04:03:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C43PHG049134; Mon, 12 Jan 2009 04:03:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120403.n0C43PHG049134@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187082 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:03:26 -0000 Author: yongari Date: Mon Jan 12 04:03:25 2009 New Revision: 187082 URL: http://svn.freebsd.org/changeset/base/187082 Log: MFC r184245,185575: r184245: Implement miibus_statchg handler. It detects whether rl(4) established a valid link or not. In rl_start_locked, don't try to send packets unless we have valid link. While I'm here add a check that verifies whether driver can accept Tx requests by inspecting IFF_DRV_OACTIVE/IFF_DRV_RUNNING flag. r185575: Update if_iqdrops instead of if_ierrors when m_devget(9) fails. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/if_rl.c Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Mon Jan 12 03:54:33 2009 (r187081) +++ stable/7/sys/pci/if_rl.c Mon Jan 12 04:03:25 2009 (r187082) @@ -636,6 +636,34 @@ rl_miibus_writereg(device_t dev, int phy static void rl_miibus_statchg(device_t dev) { + struct rl_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; + + sc = device_get_softc(dev); + mii = device_get_softc(sc->rl_miibus); + ifp = sc->rl_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->rl_flags &= ~RL_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->rl_flags |= RL_FLAG_LINK; + break; + default: + break; + } + } + /* + * RealTek controllers do not provide any interface to + * Tx/Rx MACs for resolved speed, duplex and flow-control + * parameters. + */ } /* @@ -1268,18 +1296,13 @@ rl_rxeof(struct rl_softc *sc) if (total_len > wrap) { m = m_devget(rxbufpos, total_len, RL_ETHER_ALIGN, ifp, NULL); - if (m == NULL) { - ifp->if_ierrors++; - } else { + if (m != NULL) m_copyback(m, wrap, total_len - wrap, sc->rl_cdata.rl_rx_buf); - } cur_rx = (total_len - wrap + ETHER_CRC_LEN); } else { m = m_devget(rxbufpos, total_len, RL_ETHER_ALIGN, ifp, NULL); - if (m == NULL) - ifp->if_ierrors++; cur_rx += total_len + 4 + ETHER_CRC_LEN; } @@ -1287,8 +1310,10 @@ rl_rxeof(struct rl_softc *sc) cur_rx = (cur_rx + 3) & ~3; CSR_WRITE_2(sc, RL_CURRXADDR, cur_rx - 16); - if (m == NULL) + if (m == NULL) { + ifp->if_iqdrops++; continue; + } ifp->if_ipackets++; RL_UNLOCK(sc); @@ -1551,6 +1576,10 @@ rl_start_locked(struct ifnet *ifp) RL_LOCK_ASSERT(sc); + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) + return; + while (RL_CUR_TXMBUF(sc) == NULL) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); @@ -1692,6 +1721,7 @@ rl_init_locked(struct rl_softc *sc) /* Enable receiver and transmitter. */ CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); + sc->rl_flags &= ~RL_FLAG_LINK; mii_mediachg(mii); CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX); @@ -1837,6 +1867,7 @@ rl_stop(struct rl_softc *sc) sc->rl_watchdog_timer = 0; callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->rl_flags &= ~RL_FLAG_LINK; CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 04:10:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0007106564A; Mon, 12 Jan 2009 04:10:40 +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 CD5038FC24; Mon, 12 Jan 2009 04:10:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4AeIO049745; Mon, 12 Jan 2009 04:10:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4Aecm049744; Mon, 12 Jan 2009 04:10:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120410.n0C4Aecm049744@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187083 - in stable/7/sys: . contrib/pf dev/cxgb pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:10:42 -0000 Author: yongari Date: Mon Jan 12 04:10:40 2009 New Revision: 187083 URL: http://svn.freebsd.org/changeset/base/187083 Log: MFC r186390: Since we don't request reset for rlphy(4), the link state 'UP' event from mii(4) may not be delivered if valid link was already established. To address the issue, check current link state after driving MII_TICK. This should fix a regression introduced in r184245. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/if_rl.c Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Mon Jan 12 04:03:25 2009 (r187082) +++ stable/7/sys/pci/if_rl.c Mon Jan 12 04:10:40 2009 (r187083) @@ -1395,6 +1395,8 @@ rl_tick(void *xsc) RL_LOCK_ASSERT(sc); mii = device_get_softc(sc->rl_miibus); mii_tick(mii); + if ((sc->rl_flags & RL_FLAG_LINK) == 0) + rl_miibus_statchg(sc->rl_dev); rl_watchdog(sc); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 04:15:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0422106566C; Mon, 12 Jan 2009 04:15:05 +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 BD9418FC18; Mon, 12 Jan 2009 04:15:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4F59M050180; Mon, 12 Jan 2009 04:15:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4F5RZ050179; Mon, 12 Jan 2009 04:15:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120415.n0C4F5RZ050179@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187085 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:15:06 -0000 Author: yongari Date: Mon Jan 12 04:15:05 2009 New Revision: 187085 URL: http://svn.freebsd.org/changeset/base/187085 Log: MFC r181717: Fix a typo: jme -> age Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_age.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:12:46 2009 (r187084) +++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:15:05 2009 (r187085) @@ -1427,7 +1427,7 @@ age_setwol(struct age_softc *sc) MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); DELAY(1000); if (aneg != 0) { - /* Poll link state until jme(4) get a 10/100 link. */ + /* Poll link state until age(4) get a 10/100 link. */ for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { mii_pollstat(mii); if ((mii->mii_media_status & IFM_AVALID) != 0) { From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 04:18:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63A7F106564A; Mon, 12 Jan 2009 04:18:22 +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 512788FC26; Mon, 12 Jan 2009 04:18:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4IMv6050479; Mon, 12 Jan 2009 04:18:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4IMgE050478; Mon, 12 Jan 2009 04:18:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120418.n0C4IMgE050478@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187086 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:18:23 -0000 Author: yongari Date: Mon Jan 12 04:18:22 2009 New Revision: 187086 URL: http://svn.freebsd.org/changeset/base/187086 Log: MFC r184106: No need to sync descriptors twice in age_rxintr() Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_age.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:15:05 2009 (r187085) +++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:18:22 2009 (r187086) @@ -2478,9 +2478,6 @@ age_rxintr(struct age_softc *sc, int rr_ bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag, sc->age_cdata.age_rr_ring_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag, - sc->age_cdata.age_rx_ring_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); for (prog = 0; rr_cons != rr_prod; prog++) { if (count <= 0) @@ -2513,9 +2510,6 @@ age_rxintr(struct age_softc *sc, int rr_ sc->age_cdata.age_rr_cons = rr_cons; /* Sync descriptors. */ - bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag, - sc->age_cdata.age_rx_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag, sc->age_cdata.age_rr_ring_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 04:20:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3C3B1065673; Mon, 12 Jan 2009 04:20:46 +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 D125C8FC17; Mon, 12 Jan 2009 04:20:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4Kkmd050721; Mon, 12 Jan 2009 04:20:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4KkPT050720; Mon, 12 Jan 2009 04:20:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120420.n0C4KkPT050720@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187087 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:20:47 -0000 Author: yongari Date: Mon Jan 12 04:20:46 2009 New Revision: 187087 URL: http://svn.freebsd.org/changeset/base/187087 Log: MFC r184107: Remove unused age_txdq Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_agevar.h stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_agevar.h ============================================================================== --- stable/7/sys/dev/age/if_agevar.h Mon Jan 12 04:18:22 2009 (r187086) +++ stable/7/sys/dev/age/if_agevar.h Mon Jan 12 04:20:46 2009 (r187087) @@ -68,8 +68,6 @@ struct age_txdesc { struct tx_desc *tx_desc; }; -STAILQ_HEAD(age_txdq, age_txdesc); - struct age_rxdesc { struct mbuf *rx_m; bus_dmamap_t rx_dmamap; From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 04:23:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1099A1065672; Mon, 12 Jan 2009 04:23:48 +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 D72BA8FC18; Mon, 12 Jan 2009 04:23:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4NlGp051045; Mon, 12 Jan 2009 04:23:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4NldE051044; Mon, 12 Jan 2009 04:23:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120423.n0C4NldE051044@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187088 - in stable/7/sys: . contrib/pf dev/age dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:23:48 -0000 Author: yongari Date: Mon Jan 12 04:23:47 2009 New Revision: 187088 URL: http://svn.freebsd.org/changeset/base/187088 Log: MFC r184743: Remove informational messages left. These messages were intended to show up in verbose boot mode. Reported by: pluknet ( pluknet<> gmail DOT com ) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/age/if_age.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Mon Jan 12 04:20:46 2009 (r187087) +++ stable/7/sys/dev/age/if_age.c Mon Jan 12 04:23:47 2009 (r187088) @@ -429,17 +429,17 @@ age_get_macaddr(struct age_softc *sc) ea[1] &= 0xFFFF; if ((ea[0] == 0 && ea[1] == 0) || (ea[0] == 0xFFFFFFFF && ea[1] == 0xFFFF)) { - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "invalid ethernet address " "returned from VPD.\n"); vpd_error = EINVAL; } } - if (vpd_error != 0 && (1 || bootverbose)) + if (vpd_error != 0 && (bootverbose)) device_printf(sc->age_dev, "VPD access failure!\n"); } else { - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "PCI VPD capability not found!\n"); } @@ -538,7 +538,7 @@ age_attach(device_t dev) sc->age_rev = pci_get_revid(dev); sc->age_chip_rev = CSR_READ_4(sc, AGE_MASTER_CFG) >> MASTER_CHIP_REV_SHIFT; - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "PCI device revision : 0x%04x\n", sc->age_rev); device_printf(dev, "Chip id/revision : 0x%04x\n", sc->age_chip_rev); @@ -565,7 +565,7 @@ age_attach(device_t dev) /* Allocate IRQ resources. */ msixc = pci_msix_count(dev); msic = pci_msi_count(dev); - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "MSIX count : %d\n", msixc); device_printf(dev, "MSI count : %d\n", msic); } @@ -612,7 +612,7 @@ age_attach(device_t dev) /* Max payload size. */ sc->age_dma_wr_burst = ((burst >> 5) & 0x07) << DMA_CFG_WR_BURST_SHIFT; - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); device_printf(dev, "TLP payload size : %d bytes.\n", @@ -2685,7 +2685,7 @@ age_init_locked(struct age_softc *sc) else reg |= MASTER_ITIMER_ENB; CSR_WRITE_4(sc, AGE_MASTER_CFG, reg); - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "interrupt moderation is %d us.\n", sc->age_int_mod); CSR_WRITE_2(sc, AGE_INTR_CLR_TIMER, AGE_USECS(1000)); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 04:30:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41AE5106566B; Mon, 12 Jan 2009 04:30:28 +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 2F0AD8FC17; Mon, 12 Jan 2009 04:30:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C4USQD051697; Mon, 12 Jan 2009 04:30:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C4USin051696; Mon, 12 Jan 2009 04:30:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901120430.n0C4USin051696@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 12 Jan 2009 04:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187089 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 04:30:28 -0000 Author: yongari Date: Mon Jan 12 04:30:27 2009 New Revision: 187089 URL: http://svn.freebsd.org/changeset/base/187089 Log: MFC r183137: Add ASUS P5KPL-C to the list of supported motherboard. Reported by: < nikola.lecic anthesphoria dot net > Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/age.4 stable/7/share/man/man4/igb.4 (props changed) Modified: stable/7/share/man/man4/age.4 ============================================================================== --- stable/7/share/man/man4/age.4 Mon Jan 12 04:23:47 2009 (r187088) +++ stable/7/share/man/man4/age.4 Mon Jan 12 04:30:27 2009 (r187089) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 19, 2008 +.Dd September 18, 2008 .Dt AGE 4 .Os .Sh NAME @@ -119,6 +119,8 @@ ASUS P5K .It ASUS P5KC .It +ASUS P5KPL-C +.It ASUS P5KPL-VM .It ASUS P5K-SE From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 06:09:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CB03106564A; Mon, 12 Jan 2009 06:09:35 +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 70D7C8FC16; Mon, 12 Jan 2009 06:09:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C69Z9G055403; Mon, 12 Jan 2009 06:09:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C69Z00055402; Mon, 12 Jan 2009 06:09:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901120609.n0C69Z00055402@svn.freebsd.org> From: Xin LI Date: Mon, 12 Jan 2009 06:09: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: r187090 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 06:09:36 -0000 Author: delphij Date: Mon Jan 12 06:09:34 2009 New Revision: 187090 URL: http://svn.freebsd.org/changeset/base/187090 Log: o ANSIfy. o Use ISC style copyright as did by the author. Obtained from: OpenBSD Modified: head/lib/libc/string/strlcat.c Modified: head/lib/libc/string/strlcat.c ============================================================================== --- head/lib/libc/string/strlcat.c Mon Jan 12 04:30:27 2009 (r187089) +++ head/lib/libc/string/strlcat.c Mon Jan 12 06:09:34 2009 (r187090) @@ -1,35 +1,21 @@ -/* $OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $ */ +/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */ /* * Copyright (c) 1998 Todd C. Miller - * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -44,10 +30,7 @@ __FBSDID("$FreeBSD$"); * If retval >= siz, truncation occurred. */ size_t -strlcat(dst, src, siz) - char *dst; - const char *src; - size_t siz; +strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 06:10:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FC45106566C; Mon, 12 Jan 2009 06:10:49 +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 02CA38FC1C; Mon, 12 Jan 2009 06:10:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C6Amkq055461; Mon, 12 Jan 2009 06:10:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C6AmjM055460; Mon, 12 Jan 2009 06:10:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901120610.n0C6AmjM055460@svn.freebsd.org> From: Xin LI Date: Mon, 12 Jan 2009 06:10: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: r187091 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 06:10:49 -0000 Author: delphij Date: Mon Jan 12 06:10:48 2009 New Revision: 187091 URL: http://svn.freebsd.org/changeset/base/187091 Log: o Language improvements from OpenBSD; o Use an ISC-style license as did by the author. Obtained from: OpenBSD Modified: head/lib/libc/string/strlcpy.3 Modified: head/lib/libc/string/strlcpy.3 ============================================================================== --- head/lib/libc/string/strlcpy.3 Mon Jan 12 06:09:34 2009 (r187090) +++ head/lib/libc/string/strlcpy.3 Mon Jan 12 06:10:48 2009 (r187091) @@ -1,18 +1,18 @@ -.\" $OpenBSD: strlcpy.3,v 1.5 1999/06/06 15:17:32 aaron Exp $ +.\" $OpenBSD: strlcpy.3,v 1.19 2007/05/31 19:19:32 jmc Exp $ .\" -.\" Copyright (c) 1998 Todd C. Miller -.\" All rights reserved. +.\" Copyright (c) 1998, 2000 Todd C. Miller .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -64,7 +64,7 @@ is larger than 0 or, in the case of .Fn strlcat , as long as there is at least one byte free in .Fa dst ) . -Note that you should include a byte for the NUL in +Note that a byte for the NUL should be included in .Fa size . Also note that .Fn strlcpy @@ -121,7 +121,7 @@ that means the initial length of plus the length of .Fa src . -While this may seem somewhat confusing it was done to make +While this may seem somewhat confusing, it was done to make truncation detection simple. .Pp Note however, that if @@ -168,8 +168,8 @@ if (strlcat(pname, file, sizeof(pname)) goto toolong; .Ed .Pp -Since we know how many characters we copied the first time, we can -speed things up a bit by using a copy instead of an append: +Since it is known how many characters were copied the first time, things +can be sped up a bit by using a copy instead of an append .Bd -literal -offset indent char *dir, *file, pname[MAXPATHLEN]; size_t n; From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 07:45:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F26D106566C; Mon, 12 Jan 2009 07:45:03 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DAD28FC12; Mon, 12 Jan 2009 07:45:03 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C7j3u1057186; Mon, 12 Jan 2009 07:45:03 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C7j3tQ057185; Mon, 12 Jan 2009 07:45:03 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901120745.n0C7j3tQ057185@svn.freebsd.org> From: Maxim Konovalov Date: Mon, 12 Jan 2009 07:45:03 +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: r187092 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 07:45:03 -0000 Author: maxim Date: Mon Jan 12 07:45:03 2009 New Revision: 187092 URL: http://svn.freebsd.org/changeset/base/187092 Log: o Sort .Xr. Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Mon Jan 12 06:10:48 2009 (r187091) +++ head/usr.sbin/jail/jail.8 Mon Jan 12 07:45:03 2009 (r187092) @@ -650,14 +650,14 @@ and .Xr jexec 8 , .Xr jls 8 , .Xr mount 8 , -.Xr unmount 8 , .Xr named 8 , .Xr reboot 8 , .Xr rpcbind 8 , .Xr sendmail 8 , .Xr shutdown 8 , .Xr sysctl 8 , -.Xr syslogd 8 +.Xr syslogd 8 , +.Xr unmount 8 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 08:22:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35185106566C; Mon, 12 Jan 2009 08:22:37 +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 086EC8FC29; Mon, 12 Jan 2009 08:22:37 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0C8MaeS057864; Mon, 12 Jan 2009 08:22:36 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0C8MaRh057863; Mon, 12 Jan 2009 08:22:36 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901120822.n0C8MaRh057863@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 12 Jan 2009 08:22: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: r187093 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 08:22:38 -0000 Author: obrien Date: Mon Jan 12 08:22:36 2009 New Revision: 187093 URL: http://svn.freebsd.org/changeset/base/187093 Log: Use a dynamically grown buffer for building the argv for the sub-mounts. Also fix RCSid spamage. Inspired by patch from: Christoph Mallon Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Mon Jan 12 07:45:03 2009 (r187092) +++ head/sbin/mount/mount.c Mon Jan 12 08:22:36 2009 (r187093) @@ -31,16 +31,14 @@ static const char copyright[] = "@(#) Copyright (c) 1980, 1989, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint #if 0 static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -70,10 +68,8 @@ static const char rcsid[] = int debug, fstab_style, verbose; -#define MAX_ARGS 100 struct cpa { - char *a[MAX_ARGS]; - ssize_t m; + char **a; int c; }; @@ -507,9 +503,14 @@ hasopt(const char *mntopts, const char * static void append_arg(struct cpa *sa, char *arg) { - if (sa->c >= sa->m) - errx(1, "Cannot process more than %zd mount arguments", sa->m); + static int a_sz; + if (sa->c + 1 == a_sz) { + a_sz = a_sz == 0 ? 8 : a_sz * 2; + sa->a = realloc(sa->a, sizeof(sa->a) * a_sz); + if (sa->a == NULL) + errx(1, "realloc failed"); + } sa->a[++sa->c] = arg; } @@ -521,6 +522,7 @@ mountfs(const char *vfstype, const char struct statfs sf; int i, ret; char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; + static int mnt_argv_inited; /* resolve the mountpoint with realpath(3) */ (void)checkpath(name, mntpath); @@ -555,7 +557,10 @@ mountfs(const char *vfstype, const char /* Construct the name of the appropriate mount command */ (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); - mnt_argv.m = MAX_ARGS; + if (!mnt_argv_inited) { + mnt_argv_inited++; + mnt_argv.a = NULL; + } mnt_argv.c = -1; append_arg(&mnt_argv, execname); mangle(optbuf, &mnt_argv); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 08:25:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D0531065672; Mon, 12 Jan 2009 08:25:11 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 435538FC13; Mon, 12 Jan 2009 08:25:11 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0C8PA7A069299; Mon, 12 Jan 2009 00:25:10 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0C8PA1a069298; Mon, 12 Jan 2009 00:25:10 -0800 (PST) (envelope-from obrien) Date: Mon, 12 Jan 2009 00:25:10 -0800 From: "David O'Brien" To: Christoph Mallon Message-ID: <20090112082510.GA69194@dragon.NUXI.org> References: <200812262254.mBQMsrbR052676@svn.freebsd.org> <4960FA9A.1090509@gmx.de> <20090111041543.GB17602@dragon.NUXI.org> <4969A626.6070908@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4969A626.6070908@gmx.de> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186504 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 08:25:11 -0000 On Sun, Jan 11, 2009 at 08:56:22AM +0100, Christoph Mallon wrote: > David O'Brien schrieb: >> On Sun, Jan 04, 2009 at 07:06:18PM +0100, Christoph Mallon wrote: >>> I'm pretty sure $SUPERNATURAL_BEING_OF_YOUR_CHOICE killed a kitten for >>> the ugly hack you added to mount. The moment you overflow a buffer, you >>> are in no man's land and there's no escape. I appended a patch, which >>> solves this issue once and for all: The argv array gets dynamically >>> expanded, when its limit is reached. >>> Please - for all kittens out there - commit this patch. >> >> Hi Christoph, >> Unfortunately your patch doesn't work. >> For a 'ufs' file system listed in /etc/fstab >> $ umount /foo >> $ mount /foo >> Does not work. > > Why haven't you told me earlier? Wow, wish I did have the gift to know something before I know something. Especially tomorrow's lotto #'s. ;-) > It was a trivial glitch - just a missing > "--mnt_argc;". I would've corrected it right away. I tested with a CD and > this takes a different code path, which does not trigger the problem. > Attached is the corrected patch. Actually this version doesn't work either. Trying to mount root from ufs:/dev/ad4s1a .. usage: mount [-t fstype] [-o options] target_fs mount_point Mounting /etc/fstab filesystems failed, startup aborted ERROR: ABORTING BOOT (sending SIGTERM to parent)! Your over use of global variables made my adult cat cry in pain. Too bad you didn't at least follow the lead of what I committed. I've committed something in the spirit of your patches. I hope that suits everyone. -- -- David (obrien@FreeBSD.org) Q: Because it reverses the logical flow of conversation. A: Why is top-posting (putting a reply at the top of the message) frowned upon? Let's not play "Jeopardy-style quoting" From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 08:31:44 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B86F5106566B; Mon, 12 Jan 2009 08:31:44 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9739F8FC1C; Mon, 12 Jan 2009 08:31:44 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0C8ViUb069542; Mon, 12 Jan 2009 00:31:44 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0C8Vi4t069541; Mon, 12 Jan 2009 00:31:44 -0800 (PST) (envelope-from obrien) Date: Mon, 12 Jan 2009 00:31:44 -0800 From: "David O'Brien" To: Xin LI Message-ID: <20090112083144.GA69408@dragon.NUXI.org> References: <200901120039.n0C0dMKX043214@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901120039.n0C0dMKX043214@svn.freebsd.org> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r187069 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 08:31:45 -0000 On Mon, Jan 12, 2009 at 12:39:22AM +0000, Xin LI wrote: > Author: delphij > Date: Mon Jan 12 00:39:22 2009 > New Revision: 187069 > URL: http://svn.freebsd.org/changeset/base/187069 > > Log: > MFC revisions 178088 and 179656: Catastrophic recovery mode. Hi Xin, I guess you missed my email to you about this. I was hoping to get an answer to this before it was MFC'ed. The use of 'C' conflicts with a Juniper Networks change Juniper wants to push back to FreeBSD. For Juniper the -C flag is the "clean" flag. Meaning don't do anything if the FS is clean, other wise do as full a fsck as possible (vs. just a "preen" fsck). It is useful as 'fsck -C -y /var' (for instance). Do you think your functionality could live under the "-D" (damaged) option? fsck_ffs already had a "-c" option, or Juniper would have used that letter. -- -- David (obrien@FreeBSD.org) Q: Because it reverses the logical flow of conversation. A: Why is top-posting (putting a reply at the top of the message) frowned upon? Let's not play "Jeopardy-style quoting" From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 09:44:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A686106567E for ; Mon, 12 Jan 2009 09:44:29 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 7AFEB8FC13 for ; Mon, 12 Jan 2009 09:44:27 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 12 Jan 2009 09:44:26 -0000 Received: from p54A3E57E.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.229.126] by mail.gmx.net (mp027) with SMTP; 12 Jan 2009 10:44:26 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX19AwuxRocBAenTPK2/Evp0Bt5lY5Ik/jEn+Ii+4Ej qiO5QWxZaRvfV+ Message-ID: <496B10F9.20201@gmx.de> Date: Mon, 12 Jan 2009 10:44:25 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: obrien@freebsd.org References: <200812262254.mBQMsrbR052676@svn.freebsd.org> <4960FA9A.1090509@gmx.de> <20090111041543.GB17602@dragon.NUXI.org> <4969A626.6070908@gmx.de> <20090112082510.GA69194@dragon.NUXI.org> In-Reply-To: <20090112082510.GA69194@dragon.NUXI.org> Content-Type: multipart/mixed; boundary="------------050908040806000001080607" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.51,0.46 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186504 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 09:44:30 -0000 This is a multi-part message in MIME format. --------------050908040806000001080607 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit David O'Brien schrieb: > On Sun, Jan 11, 2009 at 08:56:22AM +0100, Christoph Mallon wrote: >> David O'Brien schrieb: >>> On Sun, Jan 04, 2009 at 07:06:18PM +0100, Christoph Mallon wrote: >>>> I'm pretty sure $SUPERNATURAL_BEING_OF_YOUR_CHOICE killed a kitten for >>>> the ugly hack you added to mount. The moment you overflow a buffer, you >>>> are in no man's land and there's no escape. I appended a patch, which >>>> solves this issue once and for all: The argv array gets dynamically >>>> expanded, when its limit is reached. >>>> Please - for all kittens out there - commit this patch. >>> Hi Christoph, >>> Unfortunately your patch doesn't work. >>> For a 'ufs' file system listed in /etc/fstab >>> $ umount /foo >>> $ mount /foo >>> Does not work. >> Why haven't you told me earlier? > > Wow, wish I did have the gift to know something before I know something. > Especially tomorrow's lotto #'s. ;-) I sent you my patch almost a week before you commited your changes. I think, there was enough time to tell me, that my patch had a flaw. Alternatively I would have gladly reviewed your solution. >> It was a trivial glitch - just a missing >> "--mnt_argc;". I would've corrected it right away. I tested with a CD and >> this takes a different code path, which does not trigger the problem. >> Attached is the corrected patch. > > Actually this version doesn't work either. > Trying to mount root from ufs:/dev/ad4s1a > > .. > usage: mount [-t fstype] [-o options] target_fs mount_point > Mounting /etc/fstab filesystems failed, startup aborted > ERROR: ABORTING BOOT (sending SIGTERM to parent)! > > Your over use of global variables made my adult cat cry in pain. > Too bad you didn't at least follow the lead of what I committed. > > I've committed something in the spirit of your patches. I hope > that suits everyone. Actually this version doesn't work either. tron# ./mount -a usage: mount [-t fstype] [-o options] target_fs mount_point tron# ./mount -d -a mount -t ufs -o rw -o update /dev/ad0s1a / mount -t ufs ��`X (濿��`X /dev/ad0s1f /data (Sorry for the garbage, it actually printed that. You can turn it into a "clean" segfault by memset()ing mnt_argv just after its declaration) Your incorrect use of local variables and the resulting undefined behaviour made the cat, who visits me on a roof behind the house sometimes, almost fall from said roof, when he saw your commit: You expect the local variable "struct cpa mnt_argv" still to have the same values after mountfs() was left and reentered. Too bad you didn't at least follow the lead of what I proposed. I've attached a corrected version of my patch, which has a mnt_argc = 0; added in order to reset the argument vector on reentry of mountfs() (instead of appending to the arguments of the last round). --------------050908040806000001080607 Content-Type: text/plain; name="mount.diff" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="mount.diff" SW5kZXg6IG1vdW50LmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbW91bnQuYwkoUmV2aXNpb24gMTg3 MDkzKQorKysgbW91bnQuYwkoQXJiZWl0c2tvcGllKQpAQCAtNjcsMTggKzY3LDE2IEBACiAj ZGVmaW5lIE1PVU5UX01FVEFfT1BUSU9OX0NVUlJFTlQJImN1cnJlbnQiCiAKIGludCBkZWJ1 ZywgZnN0YWJfc3R5bGUsIHZlcmJvc2U7CitzdGF0aWMgY2hhciAqKm1udF9hcmd2Oworc3Rh dGljIGludCBtbnRfYXJndl9zaXplOworc3RhdGljIGludCBtbnRfYXJnYzsKIAotc3RydWN0 IGNwYSB7Ci0JY2hhcgkqKmE7Ci0JaW50CWM7Ci19OwotCiBjaGFyICAgKmNhdG9wdChjaGFy ICosIGNvbnN0IGNoYXIgKik7CiBzdHJ1Y3Qgc3RhdGZzICpnZXRtbnRwdChjb25zdCBjaGFy ICopOwogaW50CWhhc29wdChjb25zdCBjaGFyICosIGNvbnN0IGNoYXIgKik7CiBpbnQJaXNt b3VudGVkKHN0cnVjdCBmc3RhYiAqLCBzdHJ1Y3Qgc3RhdGZzICosIGludCk7CiBpbnQJaXNy ZW1vdW50YWJsZShjb25zdCBjaGFyICopOwotdm9pZAltYW5nbGUoY2hhciAqLCBzdHJ1Y3Qg Y3BhICopOworc3RhdGljIHZvaWQJbWFuZ2xlKGNoYXIgKik7CiBjaGFyICAgKnVwZGF0ZV9v cHRpb25zKGNoYXIgKiwgY2hhciAqLCBpbnQpOwogaW50CW1vdW50ZnMoY29uc3QgY2hhciAq LCBjb25zdCBjaGFyICosIGNvbnN0IGNoYXIgKiwKIAkJCWludCwgY29uc3QgY2hhciAqLCBj b25zdCBjaGFyICopOwpAQCAtNTAxLDI4ICs0OTksMjQgQEAKIH0KIAogc3RhdGljIHZvaWQK LWFwcGVuZF9hcmcoc3RydWN0IGNwYSAqc2EsIGNoYXIgKmFyZykKK2FwcGVuZF9hcmd2KGNo YXIgKmFyZykKIHsKLQlzdGF0aWMgaW50IGFfc3o7Ci0KLQlpZiAoc2EtPmMgKyAxID09IGFf c3opIHsKLQkJYV9zeiA9IGFfc3ogPT0gMCA/IDggOiBhX3N6ICogMjsKLQkJc2EtPmEgPSBy ZWFsbG9jKHNhLT5hLCBzaXplb2Yoc2EtPmEpICogYV9zeik7Ci0JCWlmIChzYS0+YSA9PSBO VUxMKQorCWlmIChtbnRfYXJnYyA9PSBtbnRfYXJndl9zaXplKSB7CisJCW1udF9hcmd2X3Np emUgPSBtbnRfYXJndl9zaXplID09IDAgPyAxNiA6IG1udF9hcmd2X3NpemUgKiAyOworCQlt bnRfYXJndiA9IHJlYWxsb2MobW50X2FyZ3YsIHNpemVvZigqbW50X2FyZ3YpICogbW50X2Fy Z3Zfc2l6ZSk7CisJCWlmIChtbnRfYXJndiA9PSBOVUxMKQogCQkJZXJyeCgxLCAicmVhbGxv YyBmYWlsZWQiKTsKIAl9Ci0Jc2EtPmFbKytzYS0+Y10gPSBhcmc7CisJbW50X2FyZ3ZbbW50 X2FyZ2MrK10gPSBhcmc7CiB9CiAKIGludAogbW91bnRmcyhjb25zdCBjaGFyICp2ZnN0eXBl LCBjb25zdCBjaGFyICpzcGVjLCBjb25zdCBjaGFyICpuYW1lLCBpbnQgZmxhZ3MsCiAJY29u c3QgY2hhciAqb3B0aW9ucywgY29uc3QgY2hhciAqbW50b3B0cykKIHsKLQlzdHJ1Y3QgY3Bh IG1udF9hcmd2OwogCXN0cnVjdCBzdGF0ZnMgc2Y7CiAJaW50IGksIHJldDsKIAljaGFyICpv cHRidWYsIGV4ZWNuYW1lW1BBVEhfTUFYXSwgbW50cGF0aFtQQVRIX01BWF07Ci0Jc3RhdGlj IGludCBtbnRfYXJndl9pbml0ZWQ7CiAKIAkvKiByZXNvbHZlIHRoZSBtb3VudHBvaW50IHdp dGggcmVhbHBhdGgoMykgKi8KIAkodm9pZCljaGVja3BhdGgobmFtZSwgbW50cGF0aCk7CkBA IC01NTcsMzIgKzU1MSwyOSBAQAogCS8qIENvbnN0cnVjdCB0aGUgbmFtZSBvZiB0aGUgYXBw cm9wcmlhdGUgbW91bnQgY29tbWFuZCAqLwogCSh2b2lkKXNucHJpbnRmKGV4ZWNuYW1lLCBz aXplb2YoZXhlY25hbWUpLCAibW91bnRfJXMiLCB2ZnN0eXBlKTsKIAotCWlmICghbW50X2Fy Z3ZfaW5pdGVkKSB7Ci0JCW1udF9hcmd2X2luaXRlZCsrOwotCQltbnRfYXJndi5hID0gTlVM TDsKLQl9Ci0JbW50X2FyZ3YuYyA9IC0xOwotCWFwcGVuZF9hcmcoJm1udF9hcmd2LCBleGVj bmFtZSk7Ci0JbWFuZ2xlKG9wdGJ1ZiwgJm1udF9hcmd2KTsKLQlhcHBlbmRfYXJnKCZtbnRf YXJndiwgc3RyZHVwKHNwZWMpKTsKLQlhcHBlbmRfYXJnKCZtbnRfYXJndiwgc3RyZHVwKG5h bWUpKTsKLQlhcHBlbmRfYXJnKCZtbnRfYXJndiwgTlVMTCk7CisJbW50X2FyZ2MgPSAwOyAv KiBSZXNldCBhcmd1bWVudCB2ZWN0b3IgKi8KKwlhcHBlbmRfYXJndihleGVjbmFtZSk7CisJ bWFuZ2xlKG9wdGJ1Zik7CisJYXBwZW5kX2FyZ3Yoc3RyZHVwKHNwZWMpKTsKKwlhcHBlbmRf YXJndihzdHJkdXAobmFtZSkpOworCWFwcGVuZF9hcmd2KE5VTEwpOworCS0tbW50X2FyZ2M7 IC8qIERvIG5vdCBjb3VudCB0aGUgdGVybWluYXRpbmcgbnVsbCBwb2ludGVyICovCiAKIAlp ZiAoZGVidWcpIHsKIAkJaWYgKHVzZV9tb3VudHByb2codmZzdHlwZSkpCiAJCQlwcmludGYo ImV4ZWM6IG1vdW50XyVzIiwgdmZzdHlwZSk7CiAJCWVsc2UKIAkJCXByaW50ZigibW91bnQg LXQgJXMiLCB2ZnN0eXBlKTsKLQkJZm9yIChpID0gMTsgaSA8IG1udF9hcmd2LmM7IGkrKykK LQkJCSh2b2lkKXByaW50ZigiICVzIiwgbW50X2FyZ3YuYVtpXSk7CisJCWZvciAoaSA9IDE7 IGkgPCBtbnRfYXJnYzsgaSsrKQorCQkJKHZvaWQpcHJpbnRmKCIgJXMiLCBtbnRfYXJndltp XSk7CiAJCSh2b2lkKXByaW50ZigiXG4iKTsKIAkJcmV0dXJuICgwKTsKIAl9CiAKIAlpZiAo dXNlX21vdW50cHJvZyh2ZnN0eXBlKSkgewotCQlyZXQgPSBleGVjX21vdW50cHJvZyhuYW1l LCBleGVjbmFtZSwgbW50X2FyZ3YuYSk7CisJCXJldCA9IGV4ZWNfbW91bnRwcm9nKG5hbWUs IGV4ZWNuYW1lLCBtbnRfYXJndik7CiAJfSBlbHNlIHsKLQkJcmV0ID0gbW91bnRfZnModmZz dHlwZSwgbW50X2FyZ3YuYywgbW50X2FyZ3YuYSk7CisJCXJldCA9IG1vdW50X2ZzKHZmc3R5 cGUsIG1udF9hcmdjLCBtbnRfYXJndik7CiAJfQogCiAJZnJlZShvcHRidWYpOwpAQCAtNjg0 LDggKzY3NSw4IEBACiAJcmV0dXJuIChjcCk7CiB9CiAKLXZvaWQKLW1hbmdsZShjaGFyICpv cHRpb25zLCBzdHJ1Y3QgY3BhICphKQorc3RhdGljIHZvaWQKK21hbmdsZShjaGFyICpvcHRp b25zKQogewogCWNoYXIgKnAsICpzOwogCkBAIC03MjAsMTUgKzcxMSwxNSBAQAogCQkJICAg IHNpemVvZihncm91cHF1b3RhZXEpIC0gMSkgPT0gMCkgewogCQkJCWNvbnRpbnVlOwogCQkJ fSBlbHNlIGlmICgqcCA9PSAnLScpIHsKLQkJCQlhcHBlbmRfYXJnKGEsIHApOworCQkJCWFw cGVuZF9hcmd2KHApOwogCQkJCXAgPSBzdHJjaHIocCwgJz0nKTsKIAkJCQlpZiAocCAhPSBO VUxMKSB7CiAJCQkJCSpwID0gJ1wwJzsKLQkJCQkJYXBwZW5kX2FyZyhhLCBwICsgMSk7CisJ CQkJCWFwcGVuZF9hcmd2KHAgKyAxKTsKIAkJCQl9CiAJCQl9IGVsc2UgewotCQkJCWFwcGVu ZF9hcmcoYSwgc3RyZHVwKCItbyIpKTsKLQkJCQlhcHBlbmRfYXJnKGEsIHApOworCQkJCWFw cGVuZF9hcmd2KHN0cmR1cCgiLW8iKSk7CisJCQkJYXBwZW5kX2FyZ3YocCk7CiAJCQl9CiAJ CX0KIH0K --------------050908040806000001080607-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 11:24:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0479010658AA; Mon, 12 Jan 2009 11:24:34 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1DA08FC17; Mon, 12 Jan 2009 11:24:32 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CBOWPu064718; Mon, 12 Jan 2009 11:24:32 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CBOWEl064714; Mon, 12 Jan 2009 11:24:32 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200901121124.n0CBOWEl064714@svn.freebsd.org> From: Qing Li Date: Mon, 12 Jan 2009 11: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: r187094 - in head/sys: conf net netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 11:24:37 -0000 Author: qingli Date: Mon Jan 12 11:24:32 2009 New Revision: 187094 URL: http://svn.freebsd.org/changeset/base/187094 Log: Revive the RTF_LLINFO flag in route.h. The kernel code is guarded by the new kernel option COMPAT_ROUTE_FLAGS for binary backward compatibility. The RTF_LLDATA flag maps to the same value as RTF_LLINFO. RTF_LLDATA is used by the arp and ndp utilities. The RTF_LLDATA flag is always returned to the userland regardless whether the COMPAT_ROUTE_FLAGS is defined. Modified: head/sys/conf/options head/sys/net/route.h head/sys/net/rtsock.c head/sys/netinet6/in6.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jan 12 08:22:36 2009 (r187093) +++ head/sys/conf/options Mon Jan 12 11:24:32 2009 (r187094) @@ -411,6 +411,7 @@ PPP_DEFLATE opt_ppp.h PPP_FILTER opt_ppp.h RADIX_MPATH opt_mpath.h ROUTETABLES opt_route.h +COMPAT_ROUTE_FLAGS opt_route.h SLIP_IFF_OPTS opt_slip.h TCPDEBUG TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Jan 12 08:22:36 2009 (r187093) +++ head/sys/net/route.h Mon Jan 12 11:24:32 2009 (r187094) @@ -173,7 +173,8 @@ struct ortentry { /* 0x80 unused, was RTF_DELCLONE */ /* 0x100 unused, was RTF_CLONING */ #define RTF_XRESOLVE 0x200 /* external daemon resolves name */ -/* 0x400 unused, was RTF_LLINFO */ +#define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward + compatibility */ #define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */ #define RTF_STATIC 0x800 /* manually added */ #define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Jan 12 08:22:36 2009 (r187093) +++ head/sys/net/rtsock.c Mon Jan 12 11:24:32 2009 (r187094) @@ -31,6 +31,7 @@ */ #include "opt_sctp.h" #include "opt_mpath.h" +#include "opt_route.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -1446,7 +1447,12 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) * take care of llinfo entries, the caller must * specify an AF */ - if (w.w_op == NET_RT_FLAGS && w.w_arg == 0) { + if (w.w_op == NET_RT_FLAGS && +#if defined(COMPAT_ROUTE_FLAGS) + (w.w_arg & RTF_LLINFO)) { +#else + w.w_arg == 0) { +#endif if (af != 0) error = lltable_sysctl_dumparp(af, w.w_req); else Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Jan 12 08:22:36 2009 (r187093) +++ head/sys/netinet6/in6.c Mon Jan 12 11:24:32 2009 (r187094) @@ -2252,6 +2252,10 @@ in6_lltable_dump(struct lltable *llt, st */ bzero(&ndpc, sizeof(ndpc)); ndpc.rtm.rtm_msglen = sizeof(ndpc); + ndpc.rtm.rtm_version = RTM_VERSION; + ndpc.rtm.rtm_type = RTM_GET; + ndpc.rtm.rtm_flags = RTF_UP; + ndpc.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY; ndpc.sin6.sin6_family = AF_INET6; ndpc.sin6.sin6_len = sizeof(ndpc.sin6); bcopy(L3_ADDR(lle), &ndpc.sin6, L3_ADDR_LEN(lle)); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 13:12:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D565B106564A; Mon, 12 Jan 2009 13:12:02 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2CE08FC1F; Mon, 12 Jan 2009 13:12:02 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CDC2Vm066901; Mon, 12 Jan 2009 13:12:02 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CDC2Qr066900; Mon, 12 Jan 2009 13:12:02 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200901121312.n0CDC2Qr066900@svn.freebsd.org> From: Daniel Gerzo Date: Mon, 12 Jan 2009 13:12: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: r187098 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 13:12:03 -0000 Author: danger (doc committer) Date: Mon Jan 12 13:12:02 2009 New Revision: 187098 URL: http://svn.freebsd.org/changeset/base/187098 Log: - add missing include - fix struct memeber's name [1] PR: docs/130413 [1] Submitted by: Thomas Mueller [1] MFC after: 3 days Modified: head/lib/libc/sys/timer_create.2 Modified: head/lib/libc/sys/timer_create.2 ============================================================================== --- head/lib/libc/sys/timer_create.2 Mon Jan 12 11:53:38 2009 (r187097) +++ head/lib/libc/sys/timer_create.2 Mon Jan 12 13:12:02 2009 (r187098) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2000 +.Dd January 12, 2009 .Dt TIMER_CREATE 2 .Os .Sh NAME @@ -37,6 +37,7 @@ .Lb librt .Sh SYNOPSIS .In time.h +.In signal.h .Ft int .Fo timer_create .Fa "clockid_t clockid" "struct sigevent *restrict evp" @@ -100,7 +101,7 @@ or .Dv CLOCK_MONOTONIC . .Pp If -.Fa evp->sigev_sigev_notify +.Fa evp->sigev_notify is .Dv SIGEV_THREAD and From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 15:48:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10E18106566B; Mon, 12 Jan 2009 15:48:24 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE6B48FC14; Mon, 12 Jan 2009 15:48:23 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CFmN2x069731; Mon, 12 Jan 2009 15:48:23 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CFmNRj069712; Mon, 12 Jan 2009 15:48:23 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200901121548.n0CFmNRj069712@svn.freebsd.org> From: Stanislav Sedov Date: Mon, 12 Jan 2009 15:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187099 - in stable/7: share/man/man4 sys sys/amd64/amd64 sys/amd64/conf sys/amd64/include sys/conf sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cpuctl sys/dev/cxgb sys/i386/conf sys/i386... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 15:48:24 -0000 Author: stas Date: Mon Jan 12 15:48:22 2009 New Revision: 187099 URL: http://svn.freebsd.org/changeset/base/187099 Log: - MFC cpuctl and related commits into RELENG_7. First revision of usr.sbin/cpucontrol was merged directly into usr.sbin since there're no such directory in stable/7 yet. Subsequient changes went into usr.sbin/cpucontrol. Approved by: kib (mentor) Added: stable/7/share/man/man4/cpuctl.4 - copied, changed from r181430, head/share/man/man4/cpuctl.4 stable/7/sys/dev/cpuctl/ - copied from r181430, head/sys/dev/cpuctl/ stable/7/sys/modules/cpuctl/ - copied from r181430, head/sys/modules/cpuctl/ stable/7/sys/sys/cpuctl.h - copied unchanged from r181430, head/sys/sys/cpuctl.h stable/7/usr.sbin/cpucontrol/ (props changed) - copied from r181430, head/usr.sbin/cpucontrol/ Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/Makefile stable/7/share/man/man4/igb.4 (props changed) stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/support.S stable/7/sys/amd64/conf/NOTES stable/7/sys/amd64/include/cpufunc.h stable/7/sys/amd64/include/specialreg.h stable/7/sys/conf/files.amd64 stable/7/sys/conf/files.i386 stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cpuctl/cpuctl.c stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/conf/NOTES stable/7/sys/i386/i386/support.s stable/7/sys/i386/include/cpufunc.h stable/7/sys/i386/include/specialreg.h stable/7/sys/modules/Makefile stable/7/sys/sys/priv.h stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/Makefile stable/7/usr.sbin/adduser/ (props changed) stable/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) stable/7/usr.sbin/cdcontrol/ (props changed) stable/7/usr.sbin/config/ (props changed) stable/7/usr.sbin/cpucontrol/cpucontrol.8 stable/7/usr.sbin/cpucontrol/cpucontrol.c stable/7/usr.sbin/cron/ (props changed) stable/7/usr.sbin/cron/cron/ (props changed) stable/7/usr.sbin/extattr/ (props changed) stable/7/usr.sbin/freebsd-update/ (props changed) stable/7/usr.sbin/fwcontrol/ (props changed) stable/7/usr.sbin/iostat/ (props changed) stable/7/usr.sbin/mergemaster/ (props changed) stable/7/usr.sbin/mountd/ (props changed) stable/7/usr.sbin/mtree/ (props changed) stable/7/usr.sbin/ndiscvt/ (props changed) stable/7/usr.sbin/newsyslog/newsyslog.conf.5 (props changed) stable/7/usr.sbin/nscd/ (props changed) stable/7/usr.sbin/ntp/ (props changed) stable/7/usr.sbin/pciconf/ (props changed) stable/7/usr.sbin/pkg_install/ (props changed) stable/7/usr.sbin/pmcstat/ (props changed) stable/7/usr.sbin/portsnap/ (props changed) stable/7/usr.sbin/pw/ (props changed) stable/7/usr.sbin/rpc.lockd/ (props changed) stable/7/usr.sbin/rpc.statd/ (props changed) stable/7/usr.sbin/rpc.yppasswdd/ (props changed) stable/7/usr.sbin/setfib/ (props changed) stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/syslogd/ (props changed) stable/7/usr.sbin/traceroute/ (props changed) stable/7/usr.sbin/tzsetup/ (props changed) stable/7/usr.sbin/wpa/wpa_supplicant/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/share/man/man4/Makefile Mon Jan 12 15:48:22 2009 (r187099) @@ -55,6 +55,7 @@ MAN= aac.4 \ cnw.4 \ coda.4 \ ${_coretemp.4} \ + ${_cpuctl.4} \ cpufreq.4 \ crypto.4 \ cue.4 \ @@ -554,6 +555,7 @@ MLINKS+=xl.4 if_xl.4 _acpi_dock.4= acpi_dock.4 _amdsmb.4= amdsmb.4 _coretemp.4= coretemp.4 +_cpuctl.4= cpuctl.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 Copied and modified: stable/7/share/man/man4/cpuctl.4 (from r181430, head/share/man/man4/cpuctl.4) ============================================================================== --- head/share/man/man4/cpuctl.4 Fri Aug 8 16:26:53 2008 (r181430, copy source) +++ stable/7/share/man/man4/cpuctl.4 Mon Jan 12 15:48:22 2009 (r187099) @@ -45,30 +45,33 @@ at boot time, place the following in cpuctl_load="YES" .Ed .Sh DESCRIPTION -The special file +The special device .Pa /dev/cpuctl -presents interace to the system CPU. It provides functionality to retrieve +presents interface to the system CPU. +It provides functionality to retrieve CPUID information, read/write machine specific registers (MSR) and perform -cpu firmware updates. +CPU firmware updates. .Pp -For each cpu present in the system, special file +For each CPU present in the system, the special device .Pa /dev/cpuctl%d -with the appropriate index will be created. For multicore cpus the -special file will be created for each core. +with the appropriate index will be created. +For multicore CPUs such a +special device will be created for each core. .Pp Currently, only i386 and amd64 processors are supported. .Sh IOCTL INTERFACE All of the supported operations are invoked using the -.Fr ioctl 2 -system call. Refer to that manpage for further information about -this interface. Currently, the following ioctls are defined: +.Xr ioctl 2 +system call. +Currently, the following ioctls are defined: .Bl -tag -width CPUCTL_UPDATE .It Dv CPUCTL_RDMSR Fa cpuctl_msr_args_t *args .It Dv CPUCTL_WRMSR Fa cpuctl_msr_args_t *args -Read/write cpu machine specific register. The +Read/write CPU machine specific register. +The .Vt cpuctl_msr_args_t -structure defined in +structure is defined in .In sys/cpuctl.h as: .Pp @@ -79,7 +82,8 @@ typedef struct { } cpuctl_msr_args_t; .Ed .It Dv CPUCTL_CPUID Fa cpuctl_cpuid_args_t *args -Retrieve CPUID information. Arguments are supplied in +Retrieve CPUID information. +Arguments are supplied in the following struct: .Pp .Bd -literal @@ -93,9 +97,10 @@ The .Va level field indicates the CPUID level to retrieve information for, while the .Va data -used to store CPUID data received. +field is used to store the received CPUID data. .It Dv CPUCTL_UPDATE cpuctl_update_args_t *args -Update cpu firmware (microcode). The structure defined in +Update CPU firmware (microcode). +The structure is defined in .In sys/cpuctl.h as: .Pp @@ -117,30 +122,31 @@ For additional information refer to .Sh RETURN VALUES .Bl -tag -width Er .It Bq Er ENXIO -The operation requested is not supported by device (e.g. unsupported -architecture or cpu was disabled) +The operation requested is not supported by the device (e.g. unsupported +architecture or the CPU is disabled) .It Bq Er EINVAL Incorrect request was supplied, or microcode image is not correct. .It Bq Er ENOMEM No physical memory was available to complete the request. .It Bq Er EFAULT -The firmware image address points outside process address space. +The firmware image address points outside the process address space. .El .Sh FILES .Bl -tag -width /dev/cpuctl -compact .It Pa /dev/cpuctl .El .Sh SEE ALSO -.Xr hwpmc 4 +.Xr hwpmc 4 , +.Xr cpucontrol 8 .Sh HISTORY The .Nm driver first appeared in -.Fx 8.0 +.Fx 8.0 . .Sh BUGS Yes, probably, report if any. .Sh AUTHORS The .Nm -module and this manual page was written by +module and this manual page were written by .An Stanislav Sedov Aq stas@FreeBSD.org . Modified: stable/7/sys/amd64/amd64/support.S ============================================================================== --- stable/7/sys/amd64/amd64/support.S Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/amd64/amd64/support.S Mon Jan 12 15:48:22 2009 (r187099) @@ -716,3 +716,47 @@ NON_GPROF_ENTRY(__bb_init_func) movq %rax,32(%rdi) movq %rdi,bbhead NON_GPROF_RET + +/* + * Support for reading MSRs in the safe manner. + */ +ENTRY(rdmsr_safe) +/* int rdmsr_safe(u_int msr, uint64_t *data) */ + movq PCPU(CURPCB),%r8 + movq $msr_onfault,PCB_ONFAULT(%r8) + movl %edi,%ecx + rdmsr /* Read MSR pointed by %ecx. Returns + hi byte in edx, lo in %eax */ + salq $32,%rdx /* sign-shift %rdx left */ + cltq /* sign-extend %eax -> %rax */ + orq %rdx,%rax + movq %rax,(%rsi) + xorq %rax,%rax + movq %rax,PCB_ONFAULT(%r8) + ret + +/* + * Support for writing MSRs in the safe manner. + */ +ENTRY(wrmsr_safe) +/* int wrmsr_safe(u_int msr, uint64_t data) */ + movq PCPU(CURPCB),%r8 + movq $msr_onfault,PCB_ONFAULT(%r8) + movl %edi,%ecx + movl %esi,%eax + sarq $32,%rsi + movl %esi,%edx + wrmsr /* Write MSR pointed by %ecx. Accepts + hi byte in edx, lo in %eax. */ + xorq %rax,%rax + movq %rax,PCB_ONFAULT(%r8) + ret + +/* + * MSR operations fault handler + */ + ALIGN_TEXT +msr_onfault: + movq $0,PCB_ONFAULT(%r8) + movl $EFAULT,%eax + ret Modified: stable/7/sys/amd64/conf/NOTES ============================================================================== --- stable/7/sys/amd64/conf/NOTES Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/amd64/conf/NOTES Mon Jan 12 15:48:22 2009 (r187099) @@ -575,6 +575,12 @@ options ELSA_QS1PCI #--------------------------------------------------------------------------- # +# CPU control pseudo-device. Provides access to MSRs, CPUID info and +# microcode update feature. +# +device cpuctl + +# # System Management Bus (SMB) # options ENABLE_ALART # Control alarm on Intel intpm driver Modified: stable/7/sys/amd64/include/cpufunc.h ============================================================================== --- stable/7/sys/amd64/include/cpufunc.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/amd64/include/cpufunc.h Mon Jan 12 15:48:22 2009 (r187099) @@ -777,4 +777,9 @@ void wrmsr(u_int msr, u_int64_t newval); void reset_dbregs(void); +#ifdef _KERNEL +int rdmsr_safe(u_int msr, uint64_t *val); +int wrmsr_safe(u_int msr, uint64_t newval); +#endif + #endif /* !_MACHINE_CPUFUNC_H_ */ Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/amd64/include/specialreg.h Mon Jan 12 15:48:22 2009 (r187099) @@ -161,6 +161,12 @@ #define AMDID_CMP_CORES 0x000000ff /* + * CPUID manufacturers identifiers + */ +#define INTEL_VENDOR_ID "GenuineIntel" +#define AMD_VENDOR_ID "AuthenticAMD" + +/* * Model-specific registers for the i386 family */ #define MSR_P5_MC_ADDR 0x000 @@ -409,5 +415,6 @@ #define MSR_IORRMASK1 0xc0010019 #define MSR_TOP_MEM 0xc001001a /* boundary for ram below 4G */ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ +#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #endif /* !_MACHINE_SPECIALREG_H_ */ Modified: stable/7/sys/conf/files.amd64 ============================================================================== --- stable/7/sys/conf/files.amd64 Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/conf/files.amd64 Mon Jan 12 15:48:22 2009 (r187099) @@ -149,6 +149,7 @@ dev/atkbdc/atkbdc_isa.c optional atkbdc dev/atkbdc/atkbdc_subr.c optional atkbdc dev/atkbdc/psm.c optional psm atkbdc dev/coretemp/coretemp.c optional coretemp +dev/cpuctl/cpuctl.c optional cpuctl # There are no systems with isa slots, so all ed isa entries should go.. dev/ed/if_ed_3c503.c optional ed isa ed_3c503 dev/ed/if_ed_isa.c optional ed isa Modified: stable/7/sys/conf/files.i386 ============================================================================== --- stable/7/sys/conf/files.i386 Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/conf/files.i386 Mon Jan 12 15:48:22 2009 (r187099) @@ -161,6 +161,7 @@ dev/cm/if_cm_isa.c optional cm isa dev/coretemp/coretemp.c optional coretemp dev/cp/cpddk.c optional cp dev/cp/if_cp.c optional cp +dev/cpuctl/cpuctl.c optional cpuctl dev/ctau/ctau.c optional ctau dev/ctau/ctddk.c optional ctau dev/ctau/if_ct.c optional ctau Modified: stable/7/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Fri Aug 8 16:26:53 2008 (r181430) +++ stable/7/sys/dev/cpuctl/cpuctl.c Mon Jan 12 15:48:22 2009 (r187099) @@ -80,7 +80,7 @@ static MALLOC_DEFINE(M_CPUCTL, "cpuctl", static struct cdevsw cpuctl_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDMINOR, + .d_flags = 0, .d_open = cpuctl_open, .d_ioctl = cpuctl_ioctl, .d_name = "cpuctl", Modified: stable/7/sys/i386/conf/NOTES ============================================================================== --- stable/7/sys/i386/conf/NOTES Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/i386/conf/NOTES Mon Jan 12 15:48:22 2009 (r187099) @@ -1102,6 +1102,12 @@ device i4bcapi #--------------------------------------------------------------------------- # +# CPU control pseudo-device. Provides access to MSRs, CPUID info and +# microcode update feature. +# +device cpuctl + +# # System Management Bus (SMB) # options ENABLE_ALART # Control alarm on Intel intpm driver Modified: stable/7/sys/i386/i386/support.s ============================================================================== --- stable/7/sys/i386/i386/support.s Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/i386/i386/support.s Mon Jan 12 15:48:22 2009 (r187099) @@ -1568,3 +1568,52 @@ NON_GPROF_ENTRY(__bb_init_func) movl %edx,16(%eax) movl %eax,bbhead NON_GPROF_RET + +/* + * Support for reading MSRs in the safe manner. + */ +ENTRY(rdmsr_safe) +/* int rdmsr_safe(u_int msr, uint64_t *data) */ + movl PCPU(CURPCB),%ecx + movl $msr_onfault,PCB_ONFAULT(%ecx) + + movl 4(%esp),%ecx + rdmsr + movl 8(%esp),%ecx + movl %eax,(%ecx) + movl %edx,4(%ecx) + xorl %eax,%eax + + movl PCPU(CURPCB),%ecx + movl %eax,PCB_ONFAULT(%ecx) + + ret + +/* + * Support for writing MSRs in the safe manner. + */ +ENTRY(wrmsr_safe) +/* int wrmsr_safe(u_int msr, uint64_t data) */ + movl PCPU(CURPCB),%ecx + movl $msr_onfault,PCB_ONFAULT(%ecx) + + movl 4(%esp),%ecx + movl 8(%esp),%eax + movl 12(%esp),%edx + wrmsr + xorl %eax,%eax + + movl PCPU(CURPCB),%ecx + movl %eax,PCB_ONFAULT(%ecx) + + ret + +/* + * MSR operations fault handler + */ + ALIGN_TEXT +msr_onfault: + movl PCPU(CURPCB),%ecx + movl $0,PCB_ONFAULT(%ecx) + movl $EFAULT,%eax + ret Modified: stable/7/sys/i386/include/cpufunc.h ============================================================================== --- stable/7/sys/i386/include/cpufunc.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/i386/include/cpufunc.h Mon Jan 12 15:48:22 2009 (r187099) @@ -735,4 +735,9 @@ void wrmsr(u_int msr, uint64_t newval); void reset_dbregs(void); +#ifdef _KERNEL +int rdmsr_safe(u_int msr, uint64_t *val); +int wrmsr_safe(u_int msr, uint64_t newval); +#endif + #endif /* !_MACHINE_CPUFUNC_H_ */ Modified: stable/7/sys/i386/include/specialreg.h ============================================================================== --- stable/7/sys/i386/include/specialreg.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/i386/include/specialreg.h Mon Jan 12 15:48:22 2009 (r187099) @@ -163,6 +163,12 @@ #define AMDID_CMP_CORES 0x000000ff /* + * CPUID manufacturers identifiers + */ +#define INTEL_VENDOR_ID "GenuineIntel" +#define AMD_VENDOR_ID "AuthenticAMD" + +/* * Model-specific registers for the i386 family */ #define MSR_P5_MC_ADDR 0x000 @@ -450,6 +456,7 @@ /* AMD64 MSR's */ #define MSR_EFER 0xc0000080 /* extended features */ +#define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/modules/Makefile Mon Jan 12 15:48:22 2009 (r187099) @@ -61,6 +61,7 @@ SUBDIR= ${_3dfx} \ ${_coff} \ ${_coretemp} \ ${_cp} \ + ${_cpuctl} \ ${_cpufreq} \ ${_crypto} \ ${_cryptodev} \ @@ -390,6 +391,7 @@ _cbb= cbb _ce= ce _coff= coff _cp= cp +_cpuctl= cpuctl _cpufreq= cpufreq _cs= cs .if ${MK_CDDL} != "no" || defined(ALL_MODULES) @@ -525,6 +527,7 @@ _cbb= cbb _cmx= cmx _ciss= ciss _coretemp= coretemp +_cpuctl= cpuctl _cpufreq= cpufreq .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _cyclic= cyclic Copied: stable/7/sys/sys/cpuctl.h (from r181430, head/sys/sys/cpuctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sys/cpuctl.h Mon Jan 12 15:48:22 2009 (r187099, copy of r181430, head/sys/sys/cpuctl.h) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2006-2008 Stanislav Sedov + * 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. + * + * $FreeBSD$ + */ + +#ifndef _CPUCTL_H_ +#define _CPUCTL_H_ + +typedef struct { + int msr; /* MSR to read */ + uint64_t data; +} cpuctl_msr_args_t; + +typedef struct { + int level; /* CPUID level */ + uint32_t data[4]; +} cpuctl_cpuid_args_t; + +typedef struct { + void *data; + size_t size; +} cpuctl_update_args_t; + +#define CPUCTL_RDMSR _IOWR('c', 1, cpuctl_msr_args_t) +#define CPUCTL_WRMSR _IOWR('c', 2, cpuctl_msr_args_t) +#define CPUCTL_CPUID _IOWR('c', 3, cpuctl_cpuid_args_t) +#define CPUCTL_UPDATE _IOWR('c', 4, cpuctl_update_args_t) + +#endif /* _CPUCTL_H_ */ Modified: stable/7/sys/sys/priv.h ============================================================================== --- stable/7/sys/sys/priv.h Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/sys/sys/priv.h Mon Jan 12 15:48:22 2009 (r187099) @@ -455,9 +455,15 @@ #define PRIV_NNPFS_DEBUG 630 /* Perforn ARLA_VIOC_NNPFSDEBUG. */ /* + * cpuctl(4) privileges. + */ +#define PRIV_CPUCTL_WRMSR 640 /* Write model-specific register. */ +#define PRIV_CPUCTL_UPDATE 641 /* Update cpu microcode. */ + +/* * Track end of privilege list. */ -#define _PRIV_HIGHEST 631 +#define _PRIV_HIGHEST 642 /* * Validate that a named privilege is known by the privilege system. Invalid Modified: stable/7/usr.sbin/Makefile ============================================================================== --- stable/7/usr.sbin/Makefile Mon Jan 12 13:12:02 2009 (r187098) +++ stable/7/usr.sbin/Makefile Mon Jan 12 15:48:22 2009 (r187099) @@ -34,6 +34,7 @@ SUBDIR= ac \ ckdist \ clear_locks \ config \ + ${_cpucontrol} \ crashinfo \ cron \ crunch \ @@ -302,6 +303,7 @@ _apm= apm _apmd= apmd _asf= asf _btxld= btxld +_cpucontrol= cpucontrol .if ${MK_I4B} != "no" _i4b= i4b .endif @@ -340,6 +342,7 @@ _acpi= acpi _asf= asf _boot0cfg= boot0cfg _btxld= btxld +_cpucontrol= cpucontrol _kgmon= kgmon _lptcontrol= lptcontrol .if ${MK_NCP} != "no" Modified: stable/7/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.8 Fri Aug 8 16:26:53 2008 (r181430) +++ stable/7/usr.sbin/cpucontrol/cpucontrol.8 Mon Jan 12 15:48:22 2009 (r187099) @@ -55,33 +55,36 @@ device. .Sh DESCRIPTION The .Nm -utility can be used to read and write an arbitrary machine-specific -CPU registers via +utility can be used to read and write arbitrary machine-specific +CPU registers via the .Xr cpuctl 4 -controlled special device and apply the CPU firmware updates. +special device. +It can also be used to apply CPU firmware updates. .Pp The following options are available: .Bl -tag -width indent .It Fl d Ar datadir -Where to look for microcode images. The option can be specified multiple times. +Where to look for microcode images. +The option can be specified multiple times. .It Fl m Ar msr Ns Op = Ns Ar value -Read/write the specified MSR. Both the MSR and the value should be given as a hex number. +Read/write the specified MSR. +Both the MSR and the value should be given as a hex number. .It Fl i Ar level -Retrieve CPUID info. Level should be given as a hex number. +Retrieve CPUID info. +Level should be given as a hex number. .It Fl u -Apply CPU firmware updates. The +Apply CPU firmware updates. +The .Nm utility will walk through the configured data directories -and will apply all firmware patches available for this CPU. +and apply all firmware updates available for this CPU. .It Fl v Increase the verbosity level. .It Fl h Show help message. .El .Sh EXIT STATUS -The -.Nm -utility exits 0 on success, and >0 if an error occurs. +.Ex -std .Sh EXAMPLES The command .Pp @@ -93,20 +96,24 @@ To set the CPU 0 TSC MSR register value .Pp .Dq Li "cpucontrol -m 0x10=0x1 /dev/cpuctl0" .Pp -.Pp The command .Pp .Dq Li "cpucontrol -i 0x1 /dev/cpuctl1" .Pp will retrieve the CPUID level 0x1 from CPU 1. .Pp -To perform firmware updated on CPU 0 from images located at +To perform firmware updates on CPU 0 from images located at .Pa /usr/local/share/cpuctl/ use the following command: .Pp .Dq Li "cpucontrol -d /usr/local/share/cpuctl/ -u /dev/cpuctl0" .Sh SEE ALSO .Xr cpuctl 4 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 8.0 . .Sh BUGS Yes, probably, report if any. .Sh AUTHORS Modified: stable/7/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.c Fri Aug 8 16:26:53 2008 (r181430) +++ stable/7/usr.sbin/cpucontrol/cpucontrol.c Mon Jan 12 15:48:22 2009 (r187099) @@ -146,12 +146,12 @@ do_cpuid(const char *cmdarg, const char args.level = level; fd = open(dev, O_RDONLY); if (fd < 0) { - WARNX(0, "error opening %s for reading", dev); + WARN(0, "error opening %s for reading", dev); return (1); } error = ioctl(fd, CPUCTL_CPUID, &args); if (error < 0) { - WARNX(0, "ioctl(%s, CPUCTL_CPUID)", dev); + WARN(0, "ioctl(%s, CPUCTL_CPUID)", dev); close(fd); return (error); } @@ -198,13 +198,13 @@ do_msr(const char *cmdarg, const char *d args.msr = msr; fd = open(dev, wr == 0 ? O_RDONLY : O_WRONLY); if (fd < 0) { - WARNX(0, "error opening %s for %s", dev, + WARN(0, "error opening %s for %s", dev, wr == 0 ? "reading" : "writing"); return (1); } error = ioctl(fd, wr == 0 ? CPUCTL_RDMSR : CPUCTL_WRMSR, &args); if (error < 0) { - WARNX(0, "ioctl(%s, %s)", dev, + WARN(0, "ioctl(%s, %s)", dev, wr == 0 ? "CPUCTL_RDMSR" : "CPUCTL_WRMSR"); close(fd); return (1); @@ -230,7 +230,7 @@ do_update(const char *dev) fd = open(dev, O_RDONLY); if (fd < 0) { - WARNX(0, "error opening %s for reading", dev); + WARN(0, "error opening %s for reading", dev); return (1); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 16:07:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFFE91065674; Mon, 12 Jan 2009 16:07:03 +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 6C1DD8FC1B; Mon, 12 Jan 2009 16:07:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CG73sn070103; Mon, 12 Jan 2009 16:07:03 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CG73bF070102; Mon, 12 Jan 2009 16:07:03 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901121607.n0CG73bF070102@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 12 Jan 2009 16:07:03 +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: r187100 - head/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 16:07:04 -0000 Author: jkim Date: Mon Jan 12 16:07:03 2009 New Revision: 187100 URL: http://svn.freebsd.org/changeset/base/187100 Log: Add support for AMD64 Family 10h processors. PR: kern/128331 MFC after: 3 days Modified: head/sys/dev/agp/agp_amd64.c Modified: head/sys/dev/agp/agp_amd64.c ============================================================================== --- head/sys/dev/agp/agp_amd64.c Mon Jan 12 15:48:22 2009 (r187099) +++ head/sys/dev/agp/agp_amd64.c Mon Jan 12 16:07:03 2009 (r187100) @@ -167,14 +167,16 @@ agp_amd64_attach(device_t dev) { struct agp_amd64_softc *sc = device_get_softc(dev); struct agp_gatt *gatt; + uint32_t devid; int i, n, error; - for (i = 0, n = 0; i < PCI_SLOTMAX && n < AMD64_MAX_MCTRL; i++) - if (pci_cfgregread(0, i, 3, 0, 4) == 0x11031022) { + for (i = 0, n = 0; i < PCI_SLOTMAX && n < AMD64_MAX_MCTRL; i++) { + devid = pci_cfgregread(0, i, 3, 0, 4); + if (devid == 0x11031022 || devid == 0x12031022) { sc->mctrl[n] = i; n++; } - + } if (n == 0) return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 16:28:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57863106568E; Mon, 12 Jan 2009 16:28:19 +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 455748FC24; Mon, 12 Jan 2009 16:28:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CGSJWH070500; Mon, 12 Jan 2009 16:28:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CGSJQp070499; Mon, 12 Jan 2009 16:28:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901121628.n0CGSJQp070499@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 12 Jan 2009 16:28: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: r187101 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 16:28:21 -0000 Author: jkim Date: Mon Jan 12 16:28:19 2009 New Revision: 187101 URL: http://svn.freebsd.org/changeset/base/187101 Log: Allow VIA Nano processors to boot FreeBSD/amd64. PR: amd64/130303 MFC after: 1 week Modified: head/sys/boot/i386/libi386/bootinfo64.c Modified: head/sys/boot/i386/libi386/bootinfo64.c ============================================================================== --- head/sys/boot/i386/libi386/bootinfo64.c Mon Jan 12 16:07:03 2009 (r187100) +++ head/sys/boot/i386/libi386/bootinfo64.c Mon Jan 12 16:28:19 2009 (r187101) @@ -150,8 +150,9 @@ bi_checkcpu(void) cpu_vendor = (char *)vendor; /* Check for vendors that support AMD features. */ - if (strncmp(cpu_vendor, "GenuineIntel", 12) != 0 && - strncmp(cpu_vendor, "AuthenticAMD", 12) != 0) + if (strncmp(cpu_vendor, INTEL_VENDOR_ID, 12) != 0 && + strncmp(cpu_vendor, AMD_VENDOR_ID, 12) != 0 && + strncmp(cpu_vendor, CENTAUR_VENDOR_ID, 12) != 0) return (0); /* Has to support AMD features. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 16:31:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 767C61065670; Mon, 12 Jan 2009 16:31:27 +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 64C278FC12; Mon, 12 Jan 2009 16:31:27 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CGVRQ3070598; Mon, 12 Jan 2009 16:31:27 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CGVRwJ070597; Mon, 12 Jan 2009 16:31:27 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901121631.n0CGVRwJ070597@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 12 Jan 2009 16:31:27 +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: r187102 - head/tools/tools/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 16:31:29 -0000 Author: obrien Date: Mon Jan 12 16:31:27 2009 New Revision: 187102 URL: http://svn.freebsd.org/changeset/base/187102 Log: Update fech URL. Submitted by: Alexander Best Modified: head/tools/tools/usb/print-usb-if-vids.sh Modified: head/tools/tools/usb/print-usb-if-vids.sh ============================================================================== --- head/tools/tools/usb/print-usb-if-vids.sh Mon Jan 12 16:28:19 2009 (r187101) +++ head/tools/tools/usb/print-usb-if-vids.sh Mon Jan 12 16:31:27 2009 (r187102) @@ -27,5 +27,5 @@ # $FreeBSD$ -fetch -o /tmp/usb.if http://www.usb.org/app/pub/dump/comp_dump/ +fetch -o /tmp/usb.if /tmp/usb.if http://www.usb.org/developers/tools/comp_dump/ awk -F '|' '{ printf "%#06x\t%s\n", $1, $2 }' < /tmp/usb.if | sort From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 16:53:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE1A81065670; Mon, 12 Jan 2009 16:53:54 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 797578FC26; Mon, 12 Jan 2009 16:53:54 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 5AAD76D43F; Mon, 12 Jan 2009 16:53:53 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 3BA27844EF; Mon, 12 Jan 2009 17:53:53 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ed Schouten References: <200901040020.n040KIcc041121@svn.freebsd.org> <20090104120434.GF93900@deviant.kiev.zoral.com.ua> <20090104121331.GC14235@hoeg.nl> <20090105171523.GC50568@dragon.NUXI.org> <20090105172243.GO14235@hoeg.nl> Date: Mon, 12 Jan 2009 17:53:53 +0100 In-Reply-To: <20090105172243.GO14235@hoeg.nl> (Ed Schouten's message of "Mon, 5 Jan 2009 18:22:43 +0100") Message-ID: <86ocyc5uu6.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David O'Brien Subject: Re: svn commit: r186731 - head/sys/dev/syscons/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 16:53:55 -0000 Ed Schouten writes: > The reason I'm proposing xterm, is because it is the best supported > [...] very portable [...] a lot of other pieces of software that try > to mimic it [...] It also supports a settable title bar, which I find very useful; many people have their shell set up to put the machine name, login name, tty, current directory and whatever on the title bar. We could easily use the top line on the VGA console for that. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 16:54:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78755106566C; Mon, 12 Jan 2009 16:54:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB848FC3E; Mon, 12 Jan 2009 16:54:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CGsfFv071103; Mon, 12 Jan 2009 16:54:41 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CGsfj7071102; Mon, 12 Jan 2009 16:54:41 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200901121654.n0CGsfj7071102@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 12 Jan 2009 16:54: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: r187103 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 16:54:42 -0000 Author: gnn Date: Mon Jan 12 16:54:41 2009 New Revision: 187103 URL: http://svn.freebsd.org/changeset/base/187103 Log: Fix CTF based builds to that if the debug build is being used we get debug symbols. Reviewed by: jhb Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Mon Jan 12 16:31:27 2009 (r187102) +++ head/sys/conf/kern.pre.mk Mon Jan 12 16:54:41 2009 (r187103) @@ -25,6 +25,7 @@ COPTFLAGS?= -O .else . if defined(DEBUG) _MINUS_O= -O +CTFFLAGS+= -g . else _MINUS_O= -O2 . endif From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 17:09:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B825F1065776; Mon, 12 Jan 2009 17:09:51 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1688FC29; Mon, 12 Jan 2009 17:09:51 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 66C1D6D43F; Mon, 12 Jan 2009 17:09:50 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 48EC9844EF; Mon, 12 Jan 2009 18:09:50 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Doug Barton References: <200901092210.n09MA7Xb070527@svn.freebsd.org> <4967DE41.20109@FreeBSD.org> <4967E849.8070100@FreeBSD.org> Date: Mon, 12 Jan 2009 18:09:50 +0100 In-Reply-To: <4967E849.8070100@FreeBSD.org> (Doug Barton's message of "Fri, 09 Jan 2009 16:14:01 -0800") Message-ID: <86k5905u3l.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, Alexander Motin , src-committers@freebsd.org, Robert Watson , svn-src-all@freebsd.org Subject: Re: svn commit: r186982 - stable/7/usr.sbin/powerd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:09:52 -0000 Doug Barton writes: > For something like this it's quite simple, just do the merge in > usr.sbin/powerd. Let's say you want to merge all the changes starting > with r185050: > > Set REPO to something useful like svn+ssh://svn.freebsd.org/base/ > > svn merge -r 185050:186476 $REPO/head/usr.sbin/powerd . This merges everything from *185051* to 186476. Think about it in terms of diff: 'svn diff -r185050:186476' clearly means "compare the tree as it was after r185050 was committed with the tree as it was after r186476 was committed" If you want to merge the change that was committed in r185050, you need to start at r185049. If there aren't many revisions to merge, you can also merge them individually with -cN, which is a shortcut for -r(N-1):N. Perhaps I should document this better on the wiki - my examples all merge individual revisions, not ranges. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 17:15:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D14D1065759; Mon, 12 Jan 2009 17:15:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D55C88FC1B; Mon, 12 Jan 2009 17:15:09 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CHF9Sm071541; Mon, 12 Jan 2009 17:15:09 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CHF9Td071540; Mon, 12 Jan 2009 17:15:09 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901121715.n0CHF9Td071540@svn.freebsd.org> From: Andrew Thompson Date: Mon, 12 Jan 2009 17:15: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: r187104 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:15:10 -0000 Author: thompsa Date: Mon Jan 12 17:15:09 2009 New Revision: 187104 URL: http://svn.freebsd.org/changeset/base/187104 Log: Provide a NDIS tx power level converstion to/from net80211, this uses a loookup table to approximate mW<->dBM. Submitted by: Paul B. Mahol Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Mon Jan 12 16:54:41 2009 (r187103) +++ head/sys/dev/if_ndis/if_ndis.c Mon Jan 12 17:15:09 2009 (r187104) @@ -101,6 +101,17 @@ int ndisusb_halt = 1; SYSCTL_INT(_hw_ndisusb, OID_AUTO, halt, CTLFLAG_RW, &ndisusb_halt, 0, "Halt NDIS USB driver when it's attached"); +/* 0 - 30 dBm to mW conversion table */ +const uint16_t dBm2mW[] = { + 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, + 3, 4, 4, 4, 5, 6, 6, 7, 8, 9, + 10, 11, 13, 14, 16, 18, 20, 22, 25, 28, + 32, 35, 40, 45, 50, 56, 63, 71, 79, 89, + 100, 112, 126, 141, 158, 178, 200, 224, 251, 282, + 316, 355, 398, 447, 501, 562, 631, 708, 794, 891, + 1000 +}; + MODULE_DEPEND(ndis, ether, 1, 1, 1); MODULE_DEPEND(ndis, wlan, 1, 1, 1); MODULE_DEPEND(ndis, ndisapi, 1, 1, 1); @@ -739,7 +750,7 @@ ndis_attach(dev) ic->ic_ifp = ifp; ic->ic_opmode = IEEE80211_M_STA; ic->ic_phytype = IEEE80211_T_DS; - ic->ic_caps = IEEE80211_C_STA | IEEE80211_C_IBSS; + ic->ic_caps = IEEE80211_C_STA | IEEE80211_C_IBSS | IEEE80211_C_TXPMGT; setbit(ic->ic_modecaps, IEEE80211_MODE_AUTO); len = 0; r = ndis_get_info(sc, OID_802_11_NETWORK_TYPES_SUPPORTED, @@ -2312,6 +2323,13 @@ ndis_setstate_80211(sc) arg = NDIS_80211_POWERMODE_CAM; ndis_set_info(sc, OID_802_11_POWER_MODE, &arg, &len); + /* Set TX power */ + if (ic->ic_txpowlimit < sizeof(dBm2mW)) { + len = sizeof(arg); + arg = dBm2mW[ic->ic_txpowlimit]; + ndis_set_info(sc, OID_802_11_TX_POWER_LEVEL, &arg, &len); + } + /* * Default encryption mode to off, authentication * to open and privacy to 'accept everything.' @@ -2778,6 +2796,17 @@ ndis_getstate_80211(sc) ic->ic_flags |= IEEE80211_F_PMGTON; } + /* Get TX power */ + len = sizeof(arg); + rval = ndis_get_info(sc, OID_802_11_TX_POWER_LEVEL, &arg, &len); + + if (!rval) { + for (i = 0; i < sizeof(dBm2mW); i++) + if (dBm2mW[i] >= arg) + break; + ic->ic_txpowlimit = i; + } + /* * Use the current association information to reflect * what channel we're on. From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 17:18:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A69F1106564A; Mon, 12 Jan 2009 17:18: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 9596D8FC17; Mon, 12 Jan 2009 17:18:58 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CHIw4d071665; Mon, 12 Jan 2009 17:18:58 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CHIwJx071664; Mon, 12 Jan 2009 17:18:58 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901121718.n0CHIwJx071664@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 12 Jan 2009 17: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: r187105 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:18:59 -0000 Author: obrien Date: Mon Jan 12 17:18:58 2009 New Revision: 187105 URL: http://svn.freebsd.org/changeset/base/187105 Log: Fix issue where ata_atapicmd() can never really return EBUSY which is expected in acd_fixate(). This should fix various problems folks are having with 'burncd' reporting "burncd: ioctl(CDRIOCFIXATE): Input/output error" during the fixate phase when "fixate" is issued together with the "data" command. PR: 95979 Submitted by: Jaakko Heinonen Modified: head/sys/dev/ata/ata-queue.c Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Mon Jan 12 17:15:09 2009 (r187104) +++ head/sys/dev/ata/ata-queue.c Mon Jan 12 17:18:58 2009 (r187105) @@ -434,7 +434,8 @@ ata_completed(void *context, int dummy) printf("\n"); } - if ((request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? + if (!request->result && + (request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? request->u.atapi.sense.key & ATA_SENSE_KEY_MASK : request->error)) request->result = EIO; From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 17:19:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CDD11065676; Mon, 12 Jan 2009 17:19:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 274C98FC22; Mon, 12 Jan 2009 17:19:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CHJJb2071746; Mon, 12 Jan 2009 17:19:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CHJIW0071709; Mon, 12 Jan 2009 17:19:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901121719.n0CHJIW0071709@svn.freebsd.org> From: Sam Leffler Date: Mon, 12 Jan 2009 17:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187106 - in stable/7: etc etc/periodic/daily etc/periodic/monthly etc/periodic/security etc/periodic/weekly gnu gnu/usr.bin lib libexec sbin share share/mk tools/build tools/build/opti... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:19:20 -0000 Author: sam Date: Mon Jan 12 17:19:17 2009 New Revision: 187106 URL: http://svn.freebsd.org/changeset/base/187106 Log: sync build infrastructure changes with HEAD Reviewed by: imp Added: stable/7/tools/build/options/WITHOUT_ACCT - copied unchanged from r183242, head/tools/build/options/WITHOUT_ACCT stable/7/tools/build/options/WITHOUT_AMD - copied unchanged from r183242, head/tools/build/options/WITHOUT_AMD stable/7/tools/build/options/WITHOUT_APM - copied unchanged from r183242, head/tools/build/options/WITHOUT_APM stable/7/tools/build/options/WITHOUT_AT - copied unchanged from r183242, head/tools/build/options/WITHOUT_AT stable/7/tools/build/options/WITHOUT_CTM - copied unchanged from r183242, head/tools/build/options/WITHOUT_CTM stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE - copied unchanged from r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE stable/7/tools/build/options/WITHOUT_IPFW - copied unchanged from r183242, head/tools/build/options/WITHOUT_IPFW stable/7/tools/build/options/WITHOUT_JAIL - copied unchanged from r183242, head/tools/build/options/WITHOUT_JAIL stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE - copied unchanged from r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE stable/7/tools/build/options/WITHOUT_LOCATE - copied unchanged from r183242, head/tools/build/options/WITHOUT_LOCATE stable/7/tools/build/options/WITHOUT_MAIL - copied unchanged from r183242, head/tools/build/options/WITHOUT_MAIL stable/7/tools/build/options/WITHOUT_MAKE - copied unchanged from r183242, head/tools/build/options/WITHOUT_MAKE stable/7/tools/build/options/WITHOUT_NDIS - copied unchanged from r183242, head/tools/build/options/WITHOUT_NDIS stable/7/tools/build/options/WITHOUT_NETGRAPH - copied unchanged from r183242, head/tools/build/options/WITHOUT_NETGRAPH stable/7/tools/build/options/WITHOUT_NTP - copied unchanged from r183242, head/tools/build/options/WITHOUT_NTP stable/7/tools/build/options/WITHOUT_PKGTOOLS - copied unchanged from r183242, head/tools/build/options/WITHOUT_PKGTOOLS stable/7/tools/build/options/WITHOUT_PMC - copied unchanged from r183242, head/tools/build/options/WITHOUT_PMC stable/7/tools/build/options/WITHOUT_PORTSNAP - copied unchanged from r183242, head/tools/build/options/WITHOUT_PORTSNAP stable/7/tools/build/options/WITHOUT_PPP - copied unchanged from r183242, head/tools/build/options/WITHOUT_PPP stable/7/tools/build/options/WITHOUT_QUOTAS - copied unchanged from r183242, head/tools/build/options/WITHOUT_QUOTAS stable/7/tools/build/options/WITHOUT_ROUTED - copied unchanged from r183242, head/tools/build/options/WITHOUT_ROUTED stable/7/tools/build/options/WITHOUT_SLIP - copied unchanged from r183242, head/tools/build/options/WITHOUT_SLIP stable/7/tools/build/options/WITHOUT_SYSINSTALL - copied unchanged from r183242, head/tools/build/options/WITHOUT_SYSINSTALL stable/7/tools/build/options/WITHOUT_TELNET - copied unchanged from r183242, head/tools/build/options/WITHOUT_TELNET stable/7/tools/build/options/WITHOUT_TEXTPROC - copied unchanged from r183242, head/tools/build/options/WITHOUT_TEXTPROC stable/7/tools/build/options/WITHOUT_WIRELESS - copied unchanged from r183242, head/tools/build/options/WITHOUT_WIRELESS Modified: stable/7/etc/ (props changed) stable/7/etc/Makefile stable/7/etc/periodic/daily/Makefile stable/7/etc/periodic/monthly/Makefile stable/7/etc/periodic/security/Makefile stable/7/etc/periodic/weekly/Makefile stable/7/gnu/ (props changed) stable/7/gnu/usr.bin/Makefile stable/7/lib/ (props changed) stable/7/lib/Makefile stable/7/libexec/ (props changed) stable/7/libexec/Makefile stable/7/sbin/ (props changed) stable/7/sbin/Makefile stable/7/share/ (props changed) stable/7/share/Makefile stable/7/share/mk/ (props changed) stable/7/share/mk/bsd.own.mk stable/7/tools/build/ (props changed) stable/7/usr.bin/ (props changed) stable/7/usr.bin/Makefile stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/Makefile Modified: stable/7/etc/Makefile ============================================================================== --- stable/7/etc/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -7,22 +7,19 @@ SUBDIR= sendmail .endif -BIN1= amd.map apmd.conf auth.conf \ - crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \ - ddb.conf dhclient.conf disktab fbtab freebsd-update.conf \ +BIN1= auth.conf \ + crontab devd.conf devfs.conf \ + ddb.conf dhclient.conf disktab fbtab \ ftpusers gettytab group \ - hosts hosts.allow hosts.equiv hosts.lpd \ + hosts hosts.allow hosts.equiv \ inetd.conf libalias.conf login.access login.conf mac.conf motd \ netconfig network.subr networks newsyslog.conf nsswitch.conf \ - portsnap.conf pf.os phones profile protocols \ + phones profile protocols \ rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \ rc.sendmail rc.shutdown \ rc.subr remote rpc services shells \ - snmpd.config sysctl.conf syslog.conf \ - etc.${MACHINE_ARCH}/ttys \ - ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \ - ${.CURDIR}/../usr.bin/mail/misc/mail.rc \ - ${.CURDIR}/../usr.bin/locate/locate/locate.rc + sysctl.conf syslog.conf \ + etc.${MACHINE_ARCH}/ttys OPENBSMDIR= ${.CURDIR}/../contrib/openbsm BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \ @@ -32,12 +29,38 @@ BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/ BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn BSM_ETC_DIR= ${DESTDIR}/etc/security +# NB: keep these sorted by MK_* knobs + +.if ${MK_AMD} != "no" +BIN1+= amd.map +.endif + +.if ${MK_APM} != "no" +BIN1+= apmd.conf +.endif + +.if ${MK_BSNMP} != "no" +BIN1+= snmpd.config +.endif + +.if ${MK_FREEBSD_UPDATE} != "no" +BIN1+= freebsd-update.conf +.endif + +.if ${MK_LOCATE} != "no" +BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc +.endif + .if ${MK_LPR} != "no" -BIN1+= printcap +BIN1+= hosts.lpd printcap .endif -.if ${MK_NS_CACHING} != "no" -BIN1+= nscd.conf +.if ${MK_MAIL} != "no" +BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc +.endif + +.if ${MK_MAN} != "no" +BIN1+= ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config .endif .if ${MK_OPENSSH} != "no" @@ -49,6 +72,22 @@ SSH= ${.CURDIR}/../crypto/openssh/ssh_co SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf .endif +.if ${MK_NS_CACHING} != "no" +BIN1+= nscd.conf +.endif + +.if ${MK_PORTSNAP} != "no" +BIN1+= portsnap.conf +.endif + +.if ${MK_PF} != "no" +BIN1+= pf.os +.endif + +.if ${MK_TCSH} != "no" +BIN1+= csh.cshrc csh.login csh.logout +.endif + # -rwxr-xr-x root:wheel, for the new cron root:wheel BIN2= netstart pccard_ether rc.suspend rc.resume @@ -109,10 +148,15 @@ distribution: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \ ${BIN2} ${DESTDIR}/etc; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ - master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; \ - pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \ - ${DESTDIR}/etc/master.passwd + master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; +.if ${MK_TCSH} == "no" + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd +.endif + pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \ + ${DESTDIR}/etc/master.passwd +.if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install @@ -157,18 +201,25 @@ distribution: .endif cd ${.CURDIR}/root; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + dot.profile ${DESTDIR}/root/.profile; \ + rm -f ${DESTDIR}/.profile; \ + ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile +.if ${MK_TCSH} != "no" + cd ${.CURDIR}/root; \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ dot.cshrc ${DESTDIR}/root/.cshrc; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ dot.login ${DESTDIR}/root/.login; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dot.profile ${DESTDIR}/root/.profile; \ - rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \ - ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \ - ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile + rm -f ${DESTDIR}/.cshrc; \ + ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc +.endif cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${MTREE} ${DESTDIR}/etc/mtree +.if ${MK_PPP} != "no" cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ ${PPPCNF} ${DESTDIR}/etc/ppp +.endif +.if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ @@ -176,6 +227,7 @@ distribution: set -x; \ ln -s mail/aliases ${DESTDIR}/etc/aliases; \ fi +.endif ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \ ${DESTDIR}/etc/dumpdates ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \ Modified: stable/7/etc/periodic/daily/Makefile ============================================================================== --- stable/7/etc/periodic/daily/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/periodic/daily/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -1,15 +1,11 @@ # $FreeBSD$ +.include + FILES= 100.clean-disks \ 110.clean-tmps \ 120.clean-preserve \ - 130.clean-msgs \ - 140.clean-rwho \ - 150.clean-hoststat \ 200.backup-passwd \ - 210.backup-aliases \ - 300.calendar \ - 310.accounting \ 330.news \ 400.status-disks \ 404.status-zfs \ @@ -19,13 +15,42 @@ FILES= 100.clean-disks \ 408.status-gstripe \ 409.status-gconcat \ 420.status-network \ - 430.status-rwho \ - 440.status-mailq \ 450.status-security \ - 460.status-mail-rejects \ - 470.status-named \ - 480.status-ntpd \ - 500.queuerun \ 999.local +# NB: keep these sorted by MK_* knobs + +.if ${MK_ACCT} != "no" +FILES+= 310.accounting +.endif + +.if ${MK_BIND_NAMED} != "no" +FILES+= 470.status-named +.endif + +.if ${MK_CALENDAR} != "no" +FILES+= 300.calendar +.endif + +.if ${MK_MAIL} != "no" +FILES+= 130.clean-msgs +.endif + +.if ${MK_NTP} != "no" +FILES+= 480.status-ntpd +.endif + +.if ${MK_RCMDS} != "no" +FILES+= 140.clean-rwho \ + 430.status-rwho +.endif + +.if ${MK_SENDMAIL} != "no" +FILES+= 150.clean-hoststat \ + 210.backup-aliases \ + 440.status-mailq \ + 460.status-mail-rejects \ + 500.queuerun +.endif + .include Modified: stable/7/etc/periodic/monthly/Makefile ============================================================================== --- stable/7/etc/periodic/monthly/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/periodic/monthly/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -1,6 +1,13 @@ # $FreeBSD$ -FILES= 200.accounting \ - 999.local +.include + +FILES= 999.local + +# NB: keep these sorted by MK_* knobs + +.if ${MK_ACCT} != "no" +FILES+= 200.accounting +.endif .include Modified: stable/7/etc/periodic/security/Makefile ============================================================================== --- stable/7/etc/periodic/security/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/periodic/security/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -1,17 +1,30 @@ # $FreeBSD$ +.include + FILES= 100.chksetuid \ 200.chkmounts \ 300.chkuid0 \ 400.passwdless \ 410.logincheck \ - 500.ipfwdenied \ - 510.ipfdenied \ - 520.pfdenied \ - 550.ipfwlimit \ 700.kernelmsg \ 800.loginfail \ 900.tcpwrap \ security.functions +# NB: keep these sorted by MK_* knobs + +.if ${MK_IPFILTER} != "no" +FILES+= 510.ipfdenied +.endif + +.if ${MK_IPFW} != "no" +FILES+= 500.ipfwdenied \ + 550.ipfwlimit +.endif + +.if ${MK_PF} != "no" +FILES+= 520.pfdenied +.endif + .include Modified: stable/7/etc/periodic/weekly/Makefile ============================================================================== --- stable/7/etc/periodic/weekly/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/etc/periodic/weekly/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -1,10 +1,22 @@ # $FreeBSD$ -FILES= 310.locate \ - 320.whatis \ - 330.catman \ - 340.noid \ - 400.status-pkg \ +.include + +FILES= 340.noid \ 999.local +# NB: keep these sorted by MK_* knobs + +.if ${MK_LOCATE} != "no" +FILES+= 310.locate +.endif + +.if ${MK_MAN} != "no" +FILES+= 320.whatis 330.catman +.endif + +.if ${MK_PKGTOOLS} != "no" +FLES+= 400.status-pkg +.endif + .include Modified: stable/7/gnu/usr.bin/Makefile ============================================================================== --- stable/7/gnu/usr.bin/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/gnu/usr.bin/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -34,12 +34,16 @@ _groff= groff _cvs= cvs .endif +.if ${MK_INFO} != "no" +_texinfo= texinfo +.endif + .if ${MK_MAN} != "no" _man= man .endif -.if ${MK_INFO} != "no" -_texinfo= texinfo +.if ${MK_RCS} != "no" +_rcs= rcs .endif .if ${MK_TOOLCHAIN} != "no" @@ -49,8 +53,5 @@ _cc= cc _gdb= gdb .endif .endif -.if ${MK_RCS} != "no" -_rcs= rcs -.endif .include Modified: stable/7/lib/Makefile ============================================================================== --- stable/7/lib/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/lib/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -26,17 +26,17 @@ # Otherwise, the SUBDIR list should be in alphabetical order. SUBDIR= ${_csu} libc libbsm libcom_err libcrypt libelf libkvm msun libmd \ - ncurses libnetgraph libradius librpcsvc libsbuf libtacplus libutil \ - ${_libypclnt} libalias libarchive ${_libatm} \ - libbegemot ${_libbluetooth} libbsnmp libbz2 \ + ncurses ${_libnetgraph} libradius librpcsvc libsbuf \ + libtacplus libutil ${_libypclnt} libalias libarchive ${_libatm} \ + libbegemot ${_libbluetooth} ${_libbsnmp} libbz2 \ libcalendar libcam libcompat libdevinfo libdevstat libdisk \ libdwarf libedit libexpat libfetch libftpio libgeom ${_libgpib} \ ${_libgssapi} libipsec \ ${_libipx} libkiconv libmagic libmemstat ${_libmilter} ${_libmp} \ ${_libncp} ${_libngatm} libopie libpam libpcap \ - libpmc libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \ + ${_libpmc} libproc ${_libkse} librt ${_libsdp} ${_libsm} ${_libsmb} \ ${_libsmdb} \ - ${_libsmutil} libstand libtelnet ${_libthr} libthread_db libufs \ + ${_libsmutil} libstand ${_libtelnet} ${_libthr} libthread_db libufs \ libugidfw ${_libusbhid} ${_libvgl} libwrap liby libz ${_bind} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) @@ -47,6 +47,8 @@ _csu=csu/${MACHINE_ARCH} _csu=csu .endif +# NB: keep these sorted by MK_* knobs + .if ${MK_ATM} != "no" _libngatm= libngatm .endif @@ -60,6 +62,14 @@ _libbluetooth= libbluetooth _libsdp= libsdp .endif +.if ${MK_BSNMP} != "no" +_libbsnmp= libbsnmp +.endif + +.if ${MK_GPIB} != "no" +_libgpib= libgpib +.endif + .if ${MK_GSSAPI} != "no" _libgssapi= libgssapi .endif @@ -68,6 +78,22 @@ _libgssapi= libgssapi _libipx= libipx .endif +.if ${MK_LIBKSE} != "no" +_libkse= libkse +.endif + +.if ${MK_LIBTHR} != "no" +_libthr= libthr +.endif + +.if ${MK_NETGRAPH} != "no" +_libnetgraph= libnetgraph +.endif + +.if ${MK_NIS} != "no" +_libypclnt= libypclnt +.endif + .if ${MACHINE_ARCH} == "i386" .if ${MK_NCP} != "no" _libncp= libncp @@ -80,17 +106,6 @@ _libvgl= libvgl _libsmb= libsmb .endif -.if ${MK_SENDMAIL} != "no" -_libmilter= libmilter -_libsm= libsm -_libsmdb= libsmdb -_libsmutil= libsmutil -.endif - -.if ${MK_OPENSSL} != "no" -_libmp= libmp -.endif - .if ${MACHINE_ARCH} == "amd64" .if ${MK_NCP} != "no" _libncp= libncp @@ -102,24 +117,27 @@ _libsmb= libsmb _libsmb= libsmb .endif -.if ${MK_LIBKSE} != "no" -_libkse= libkse +.if ${MK_OPENSSL} != "no" +_libmp= libmp .endif -.if ${MK_LIBTHR} != "no" -_libthr= libthr +.if ${MK_PMC} != "no" +_libpmc= libpmc .endif -.if ${MK_USB} != "no" -_libusbhid= libusbhid +.if ${MK_SENDMAIL} != "no" +_libmilter= libmilter +_libsm= libsm +_libsmdb= libsmdb +_libsmutil= libsmutil .endif -.if ${MK_NIS} != "no" -_libypclnt= libypclnt +.if ${MK_TELNET} != "no" +_libtelnet= libtelnet .endif -.if ${MK_GPIB} != "no" -_libgpib= libgpib +.if ${MK_USB} != "no" +_libusbhid= libusbhid .endif .include Modified: stable/7/libexec/Makefile ============================================================================== --- stable/7/libexec/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/libexec/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -3,9 +3,9 @@ .include -SUBDIR= atrun \ +SUBDIR= ${_atrun} \ bootpd \ - comsat \ + ${_comsat} \ fingerd \ ftpd \ getty \ @@ -13,7 +13,7 @@ SUBDIR= atrun \ ${_mail.local} \ makekey \ ${_mknetid} \ - pppoed \ + ${_pppoed} \ pt_chown \ rbootd \ revnetgroup \ @@ -29,16 +29,28 @@ SUBDIR= atrun \ ${_smrsh} \ talkd \ tcpd \ - telnetd \ + ${_telnetd} \ tftpd \ ${_tftp-proxy} \ ${_ypxfr} +.if ${MK_AT} != "no" +_atrun= atrun +.endif + +.if ${MK_MAIL} != "no" +_comsat= comsat +.endif + .if ${MK_NIS} != "no" _mknetid= mknetid _ypxfr= ypxfr .endif +.if ${MK_NETGRAPH} != "no" +_pppoed= pppoed +.endif + .if ${MK_PF} != "no" _tftp-proxy= tftp-proxy .endif @@ -54,7 +66,11 @@ _rshd= rshd .if ${MK_SENDMAIL} != "no" _mail.local= mail.local -_smrsh= smrsh +_smrsh= smrsh +.endif + +.if ${MK_TELNET} != "no" +_telnetd= telnetd .endif .include Modified: stable/7/sbin/Makefile ============================================================================== --- stable/7/sbin/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/sbin/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -41,7 +41,7 @@ SUBDIR= adjkerntz \ ifconfig \ init \ ${_ipf} \ - ipfw \ + ${_ipfw} \ iscontrol \ kldconfig \ kldload \ @@ -62,7 +62,7 @@ SUBDIR= adjkerntz \ mount_nullfs \ mount_udf \ mount_unionfs \ - natd \ + ${_natd} \ newfs \ newfs_msdos \ nfsiod \ @@ -71,13 +71,13 @@ SUBDIR= adjkerntz \ ${_pflogd} \ ping \ ${_ping6} \ - quotacheck \ + ${_quotacheck} \ rcorder \ reboot \ recoverdisk \ restore \ route \ - routed \ + ${_routed} \ ${_rtsol} \ savecore \ ${_sconfig} \ @@ -85,7 +85,7 @@ SUBDIR= adjkerntz \ shutdown \ slattach \ spppcontrol \ - startslip \ + ${_startslip} \ sunlabel \ swapon \ sysctl \ @@ -104,6 +104,11 @@ _devd= devd _ipf= ipf .endif +.if ${MK_IPFW} != "no" +_ipfw= ipfw +_natd= natd +.endif + .if ${MK_PF} != "no" _pfctl= pfctl _pflogd= pflogd @@ -114,6 +119,18 @@ _ping6= ping6 _rtsol= rtsol .endif +.if ${MK_QUOTAS} != "no" +_quotacheck= quotacheck +.endif + +.if ${MK_ROUTED} != "no" +_routed= routed +.endif + +.if ${MK_SLIP} != "no" +_startslip= startslip +.endif + .if ${MACHINE_ARCH} == "i386" .if ${MACHINE} == "i386" _fdisk= fdisk Modified: stable/7/share/Makefile ============================================================================== --- stable/7/share/Makefile Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/share/Makefile Mon Jan 12 17:19:17 2009 (r187106) @@ -13,51 +13,57 @@ SUBDIR= ${_colldef} \ ${_man} \ ${_me} \ misc \ - mk \ + ${_mk} \ ${_mklocale} \ ${_monetdef} \ ${_msgdef} \ ${_numericdef} \ ${_sendmail} \ skel \ - snmp \ + ${_snmp} \ ${_syscons} \ tabset \ termcap \ ${_timedef} \ ${_zoneinfo} -.if ${MK_LOCALES} != "no" -_colldef = colldef -_mklocale = mklocale -_monetdef = monetdef -_msgdef = msgdef -_numericdef = numericdef -_timedef = timedef +# NB: keep these sorted by MK_* knobs + +.if ${MK_BSNMP} != "no" +_snmp= snmp .endif -.if ${MK_SYSCONS} != "no" -_syscons= syscons +.if ${MK_DICT} != "no" +_dict= dict .endif -.if ${MK_MAN} != "no" -_man= man +.if ${MK_EXAMPLES} != "no" +_examples= examples .endif .if ${MK_GROFF} != "no" _me= me .endif -.if ${MK_EXAMPLES} != "no" -_examples= examples -.endif - .if ${MK_I4B} != "no" _isdn= isdn .endif -.if ${MK_DICT} != "no" -_dict= dict +.if ${MK_LOCALES} != "no" +_colldef = colldef +_mklocale = mklocale +_monetdef = monetdef +_msgdef = msgdef +_numericdef = numericdef +_timedef = timedef +.endif + +.if ${MK_MAKE} != "no" +_mk= mk +.endif + +.if ${MK_MAN} != "no" +_man= man .endif .if ${MK_SENDMAIL} != "no" @@ -68,6 +74,10 @@ _sendmail= sendmail _doc= doc .endif +.if ${MK_SYSCONS} != "no" +_syscons= syscons +.endif + .if ${MK_ZONEINFO} != "no" _zoneinfo= zoneinfo .endif Modified: stable/7/share/mk/bsd.own.mk ============================================================================== --- stable/7/share/mk/bsd.own.mk Mon Jan 12 17:18:58 2009 (r187105) +++ stable/7/share/mk/bsd.own.mk Mon Jan 12 17:19:17 2009 (r187106) @@ -285,8 +285,12 @@ WITH_IDEA= # MK_* options which default to "yes". # .for var in \ + ACCT \ ACPI \ + AMD \ + APM \ ASSERT_DEBUG \ + AT \ ATM \ AUDIT \ AUTHPF \ @@ -299,18 +303,22 @@ WITH_IDEA= BIND_UTILS \ BLUETOOTH \ BOOT \ + BSNMP \ BZIP2 \ CALENDAR \ CDDL \ CPP \ CRYPT \ + CTM \ CVS \ CXX \ DICT \ DYNAMICROOT \ EXAMPLES \ + FLOPPY \ FORTH \ FP_LIBC \ + FREEBSD_UPDATE \ GAMES \ GCOV \ GDB \ @@ -323,41 +331,61 @@ WITH_IDEA= INFO \ INSTALLLIB \ IPFILTER \ + IPFW \ IPX \ + JAIL \ KERBEROS \ KVM \ + LEGACY_CONSOLE \ LIB32 \ LIBPTHREAD \ LIBKSE \ LIBTHR \ LOCALES \ + LOCATE \ LPR \ + MAIL \ MAILWRAPPER \ + MAKE \ MAN \ NCP \ + NDIS \ NETCAT \ + NETGRAPH \ NIS \ NLS \ NLS_CATALOGS \ NS_CACHING \ + NTP \ OBJC \ OPENSSH \ OPENSSL \ PAM \ PF \ + PKGTOOLS \ + PMC \ + PORTSNAP \ + PPP \ PROFILE \ + QUOTAS \ RCMDS \ RCS \ RESCUE \ + ROUTED \ SENDMAIL \ SETUID_LOGIN \ SHAREDOCS \ + SLIP \ SSP \ + SYSINSTALL \ SYMVER \ SYSCONS \ TCSH \ + TELNET \ + TEXTPROC \ TOOLCHAIN \ USB \ + WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZONEINFO \ ZFS @@ -435,6 +463,11 @@ MK_KERBEROS:= no MK_NCP:= no .endif +.if ${MK_MAIL} == "no" +MK_MAILWRAPPER:= no +MK_SENDMAIL:= no +.endif + .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no @@ -444,6 +477,10 @@ MK_KERBEROS:= no MK_AUTHPF:= no .endif +.if ${MK_TEXTPROC} == "no" +MK_GROFF:= no +.endif + .if ${MK_TOOLCHAIN} == "no" MK_GDB:= no .endif @@ -463,7 +500,9 @@ MK_GDB:= no IPX \ KERBEROS \ KVM \ - PAM + NETGRAPH \ + PAM \ + WIRELESS .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. .endif Copied: stable/7/tools/build/options/WITHOUT_ACCT (from r183242, head/tools/build/options/WITHOUT_ACCT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_ACCT Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_ACCT) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build process accounting tools such as +.Xr ac 8 +and +.Xr accton 8 . Copied: stable/7/tools/build/options/WITHOUT_AMD (from r183242, head/tools/build/options/WITHOUT_AMD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_AMD Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_AMD) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr amd 8 , +and related programs. Copied: stable/7/tools/build/options/WITHOUT_APM (from r183242, head/tools/build/options/WITHOUT_APM) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_APM Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_APM) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build +.Xr apm 8 , +.Xr apmd 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_AT (from r183242, head/tools/build/options/WITHOUT_AT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_AT Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_AT) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr at 1 +and related utilities. Copied: stable/7/tools/build/options/WITHOUT_CTM (from r183242, head/tools/build/options/WITHOUT_CTM) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_CTM Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_CTM) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr ctm 1 +and related utilities. Copied: stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE (from r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_FREEBSD_UPDATE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_FREEBSD_UPDATE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build +.Xr freebsd-update 8 . Copied: stable/7/tools/build/options/WITHOUT_IPFW (from r183242, head/tools/build/options/WITHOUT_IPFW) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_IPFW Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_IPFW) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build IPFW tools. Copied: stable/7/tools/build/options/WITHOUT_JAIL (from r183242, head/tools/build/options/WITHOUT_JAIL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_JAIL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_JAIL) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build tools for the support of jails; e.g. +.Xr jail 8 . Copied: stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE (from r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_LEGACY_CONSOLE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_LEGACY_CONSOLE) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build programs that support a legacy PC console; e.g. +.Xr kbdcontrol 8 +and +.Xr vidcontrol 8 . Copied: stable/7/tools/build/options/WITHOUT_LOCATE (from r183242, head/tools/build/options/WITHOUT_LOCATE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_LOCATE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_LOCATE) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr locate 1 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_MAIL (from r183242, head/tools/build/options/WITHOUT_MAIL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_MAIL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_MAIL) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build any mail support (MUA or MTA). Copied: stable/7/tools/build/options/WITHOUT_MAKE (from r183242, head/tools/build/options/WITHOUT_MAKE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_MAKE Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_MAKE) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not install +.Xr make 1 +and related support files. Copied: stable/7/tools/build/options/WITHOUT_NDIS (from r183242, head/tools/build/options/WITHOUT_NDIS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_NDIS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NDIS) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build programs and libraries +related to NDIS emulation support. Copied: stable/7/tools/build/options/WITHOUT_NETGRAPH (from r183242, head/tools/build/options/WITHOUT_NETGRAPH) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_NETGRAPH Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NETGRAPH) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build applications to support +.Xr netgraph 4 . Copied: stable/7/tools/build/options/WITHOUT_NTP (from r183242, head/tools/build/options/WITHOUT_NTP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_NTP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_NTP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr ntpd 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_PKGTOOLS (from r183242, head/tools/build/options/WITHOUT_PKGTOOLS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_PKGTOOLS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PKGTOOLS) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pkg_add 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_PMC (from r183242, head/tools/build/options/WITHOUT_PMC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_PMC Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PMC) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pmccontrol 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_PORTSNAP (from r183242, head/tools/build/options/WITHOUT_PORTSNAP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_PORTSNAP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PORTSNAP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr portsnap 8 +and related files. Copied: stable/7/tools/build/options/WITHOUT_PPP (from r183242, head/tools/build/options/WITHOUT_PPP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_PPP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_PPP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr ppp 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_QUOTAS (from r183242, head/tools/build/options/WITHOUT_QUOTAS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_QUOTAS Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_QUOTAS) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr quota 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_ROUTED (from r183242, head/tools/build/options/WITHOUT_ROUTED) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_ROUTED Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_ROUTED) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr routed 8 +utility. Copied: stable/7/tools/build/options/WITHOUT_SLIP (from r183242, head/tools/build/options/WITHOUT_SLIP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_SLIP Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_SLIP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr sliplogin 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_SYSINSTALL (from r183242, head/tools/build/options/WITHOUT_SYSINSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_SYSINSTALL Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_SYSINSTALL) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr sysinstall 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_TELNET (from r183242, head/tools/build/options/WITHOUT_TELNET) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_TELNET Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_TELNET) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr telnet 8 +and related programs. Copied: stable/7/tools/build/options/WITHOUT_TEXTPROC (from r183242, head/tools/build/options/WITHOUT_TEXTPROC) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/build/options/WITHOUT_TEXTPROC Mon Jan 12 17:19:17 2009 (r187106, copy of r183242, head/tools/build/options/WITHOUT_TEXTPROC) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 17:26:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BACEA1065672; Mon, 12 Jan 2009 17:26:52 +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 A9B258FC16; Mon, 12 Jan 2009 17:26:52 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CHQqkR071941; Mon, 12 Jan 2009 17:26:52 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CHQqLu071940; Mon, 12 Jan 2009 17:26:52 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901121726.n0CHQqLu071940@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 12 Jan 2009 17:26: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: r187107 - head/tools/tools/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:26:53 -0000 Author: obrien Date: Mon Jan 12 17:26:52 2009 New Revision: 187107 URL: http://svn.freebsd.org/changeset/base/187107 Log: Vi got me in trouble in r187102 - fix typo of duplicate output filename. Submitted by: several Modified: head/tools/tools/usb/print-usb-if-vids.sh Modified: head/tools/tools/usb/print-usb-if-vids.sh ============================================================================== --- head/tools/tools/usb/print-usb-if-vids.sh Mon Jan 12 17:19:17 2009 (r187106) +++ head/tools/tools/usb/print-usb-if-vids.sh Mon Jan 12 17:26:52 2009 (r187107) @@ -27,5 +27,5 @@ # $FreeBSD$ -fetch -o /tmp/usb.if /tmp/usb.if http://www.usb.org/developers/tools/comp_dump/ +fetch -o /tmp/usb.if http://www.usb.org/developers/tools/comp_dump/ awk -F '|' '{ printf "%#06x\t%s\n", $1, $2 }' < /tmp/usb.if | sort From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 17:54:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A6641065670; Mon, 12 Jan 2009 17:54:27 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 00BAB8FC12; Mon, 12 Jan 2009 17:54:25 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0CHsOlY089263; Mon, 12 Jan 2009 09:54:24 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0CHsOcx089262; Mon, 12 Jan 2009 09:54:24 -0800 (PST) (envelope-from obrien) Date: Mon, 12 Jan 2009 09:54:24 -0800 From: "David O'Brien" To: Christoph Mallon Message-ID: <20090112175424.GA89144@dragon.NUXI.org> References: <200812262254.mBQMsrbR052676@svn.freebsd.org> <4960FA9A.1090509@gmx.de> <20090111041543.GB17602@dragon.NUXI.org> <4969A626.6070908@gmx.de> <20090112082510.GA69194@dragon.NUXI.org> <496B10F9.20201@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <496B10F9.20201@gmx.de> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186504 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 17:54:27 -0000 On Mon, Jan 12, 2009 at 10:44:25AM +0100, Christoph Mallon wrote: > David O'Brien schrieb: >> On Sun, Jan 11, 2009 at 08:56:22AM +0100, Christoph Mallon wrote: >>> David O'Brien schrieb: >>>> On Sun, Jan 04, 2009 at 07:06:18PM +0100, Christoph Mallon wrote: >>>>> I'm pretty sure $SUPERNATURAL_BEING_OF_YOUR_CHOICE killed a kitten for >>>>> the ugly hack you added to mount. The moment you overflow a buffer, you >>>>> are in no man's land and there's no escape. I appended a patch, which >>>>> solves this issue once and for all: The argv array gets dynamically >>>>> expanded, when its limit is reached. >>>>> Please - for all kittens out there - commit this patch. >>>> Hi Christoph, >>>> Unfortunately your patch doesn't work. >>>> For a 'ufs' file system listed in /etc/fstab >>>> $ umount /foo >>>> $ mount /foo >>>> Does not work. >>> Why haven't you told me earlier? >> Wow, wish I did have the gift to know something before I know something. >> Especially tomorrow's lotto #'s. ;-) > > I sent you my patch almost a week before you commited your changes. I > think, there was enough time to tell me, that my patch had a flaw. Christoph when I work for you for $$, then you can be demanding on when I read email and test the attached patches. Since this is in my free time... > I've attached a corrected version of my patch, which has a mnt_argc = 0; > added in order to reset the argument vector on reentry of mountfs() > (instead of appending to the arguments of the last round). If you want me to read your patches - stop making larger changes than necessary - that primarily undo the changes I've already done. Instead send patches that fix bugs you find in smaller ways (unless that's not possible). thanks, -- -- David (obrien@FreeBSD.org) Q: Because it reverses the logical flow of conversation. A: Why is top-posting (putting a reply at the top of the message) frowned upon? Let's not play "Jeopardy-style quoting" From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 19:16:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C048106564A; Mon, 12 Jan 2009 19:16:01 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6134A8FC0C; Mon, 12 Jan 2009 19:16:01 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CJG1A3073981; Mon, 12 Jan 2009 19:16:01 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CJG0MZ073971; Mon, 12 Jan 2009 19:16:00 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901121916.n0CJG0MZ073971@svn.freebsd.org> From: Sam Leffler Date: Mon, 12 Jan 2009 19:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187108 - in stable/7/sys: . arm/conf conf contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 19:16:02 -0000 Author: sam Date: Mon Jan 12 19:16:00 2009 New Revision: 187108 URL: http://svn.freebsd.org/changeset/base/187108 Log: MFC r185478: enable use of modules but disable them by adding MODULES_OVERRIDE="" Modified: stable/7/sys/ (props changed) stable/7/sys/arm/conf/AVILA stable/7/sys/arm/conf/BWCT stable/7/sys/arm/conf/CRB stable/7/sys/arm/conf/EP80219 stable/7/sys/arm/conf/HL200 stable/7/sys/arm/conf/IQ31244 stable/7/sys/arm/conf/KB920X stable/7/sys/arm/conf/SIMICS stable/7/sys/arm/conf/SKYEYE stable/7/sys/conf/Makefile.arm stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/arm/conf/AVILA ============================================================================== --- stable/7/sys/arm/conf/AVILA Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/AVILA Mon Jan 12 19:16:00 2009 (r187108) @@ -31,6 +31,7 @@ options STARTUP_PAGETABLE_ADDR=0x1000000 include "../xscale/ixp425/std.avila" #To statically compile in device wiring instead of /boot/device.hints hints "AVILA.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale Modified: stable/7/sys/arm/conf/BWCT ============================================================================== --- stable/7/sys/arm/conf/BWCT Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/BWCT Mon Jan 12 19:16:00 2009 (r187108) @@ -28,6 +28,7 @@ include "../at91/std.kb920x" #To statically compile in device wiring instead of /boot/device.hints #hints "hints.at91rm9200" hints "BWCT.hints" +makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB Modified: stable/7/sys/arm/conf/CRB ============================================================================== --- stable/7/sys/arm/conf/CRB Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/CRB Mon Jan 12 19:16:00 2009 (r187108) @@ -29,6 +29,7 @@ options STARTUP_PAGETABLE_ADDR=0x0000000 include "../xscale/i8134x/std.crb" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale Modified: stable/7/sys/arm/conf/EP80219 ============================================================================== --- stable/7/sys/arm/conf/EP80219 Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/EP80219 Mon Jan 12 19:16:00 2009 (r187108) @@ -29,6 +29,7 @@ options STARTUP_PAGETABLE_ADDR=0xa00000 include "../xscale/i80321/std.ep80219" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale Modified: stable/7/sys/arm/conf/HL200 ============================================================================== --- stable/7/sys/arm/conf/HL200 Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/HL200 Mon Jan 12 19:16:00 2009 (r187108) @@ -33,6 +33,7 @@ options KERNVIRTADDR=0xc0100000 #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. hints "KB920X.hints" +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB Modified: stable/7/sys/arm/conf/IQ31244 ============================================================================== --- stable/7/sys/arm/conf/IQ31244 Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/IQ31244 Mon Jan 12 19:16:00 2009 (r187108) @@ -30,6 +30,7 @@ options STARTUP_PAGETABLE_ADDR=0xa000000 include "../xscale/i80321/std.iq31244" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale Modified: stable/7/sys/arm/conf/KB920X ============================================================================== --- stable/7/sys/arm/conf/KB920X Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/KB920X Mon Jan 12 19:16:00 2009 (r187108) @@ -25,6 +25,7 @@ include "../at91/std.kb920x" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. hints "KB920X.hints" +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB Modified: stable/7/sys/arm/conf/SIMICS ============================================================================== --- stable/7/sys/arm/conf/SIMICS Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/SIMICS Mon Jan 12 19:16:00 2009 (r187108) @@ -26,6 +26,7 @@ options PHYSADDR=0xc0000000 include "../sa11x0/std.sa11x0" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=strongarm Modified: stable/7/sys/arm/conf/SKYEYE ============================================================================== --- stable/7/sys/arm/conf/SKYEYE Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/arm/conf/SKYEYE Mon Jan 12 19:16:00 2009 (r187108) @@ -27,6 +27,7 @@ options PHYSADDR=0xc0000000 include "../at91/std.kb920x" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. +makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=arm9 Modified: stable/7/sys/conf/Makefile.arm ============================================================================== --- stable/7/sys/conf/Makefile.arm Mon Jan 12 17:26:52 2009 (r187107) +++ stable/7/sys/conf/Makefile.arm Mon Jan 12 19:16:00 2009 (r187108) @@ -19,9 +19,6 @@ # Which version of config(8) is required. %VERSREQ= 600004 -# Temporary stuff while we're still embryonic -NO_MODULES= - STD8X16FONT?= iso .if !defined(S) @@ -109,6 +106,8 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$ rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ inflate-tramp.o tmphack.S +MKMODULESENV+= MACHINE=${MACHINE} + %BEFORE_DEPEND %OBJS From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 19:17:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A553106564A; Mon, 12 Jan 2009 19:17:36 +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 7957B8FC08; Mon, 12 Jan 2009 19:17:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CJHaBh074048; Mon, 12 Jan 2009 19:17:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CJHaBk074042; Mon, 12 Jan 2009 19:17:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901121917.n0CJHaBk074042@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 12 Jan 2009 19:17: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: r187109 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 19:17:37 -0000 Author: jkim Date: Mon Jan 12 19:17:35 2009 New Revision: 187109 URL: http://svn.freebsd.org/changeset/base/187109 Log: Add basic amd64 support for VIA Nano processors. Modified: head/sys/amd64/amd64/amd64_mem.c head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/msi.c head/sys/amd64/include/md_var.h head/sys/amd64/include/specialreg.h Modified: head/sys/amd64/amd64/amd64_mem.c ============================================================================== --- head/sys/amd64/amd64/amd64_mem.c Mon Jan 12 19:16:00 2009 (r187108) +++ head/sys/amd64/amd64/amd64_mem.c Mon Jan 12 19:17:35 2009 (r187109) @@ -678,9 +678,17 @@ amd64_mem_drvinit(void *unused) return; if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) return; - if (cpu_vendor_id != CPU_VENDOR_INTEL && - cpu_vendor_id != CPU_VENDOR_AMD) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (cpu_exthigh >= 0x80000008) + break; + /* FALLTHROUGH */ + default: return; + } mem_range_softc.mr_op = &amd64_mrops; } SYSINIT(amd64memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, amd64_mem_drvinit, NULL); Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Mon Jan 12 19:16:00 2009 (r187108) +++ head/sys/amd64/amd64/identcpu.c Mon Jan 12 19:17:35 2009 (r187109) @@ -72,6 +72,7 @@ void panicifcpuunsupported(void); static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_AMD_assoc(int i); +static void print_via_padlock_info(void); int cpu_class; char machine[] = "amd64"; @@ -132,24 +133,33 @@ printcpuinfo(void) } } - if (cpu_vendor_id == CPU_VENDOR_INTEL) { + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: /* Please make up your mind folks! */ strcat(cpu_model, "EM64T"); - } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + break; + case CPU_VENDOR_AMD: /* * Values taken from AMD Processor Recognition * http://www.amd.com/K6/k6docs/pdf/20734g.pdf * (also describes ``Features'' encodings. */ strcpy(cpu_model, "AMD "); - switch (cpu_id & 0xF00) { - case 0xf00: + if ((cpu_id & 0xf00) == 0xf00) strcat(cpu_model, "AMD64 Processor"); - break; - default: + else strcat(cpu_model, "Unknown"); - break; - } + break; + case CPU_VENDOR_CENTAUR: + strcpy(cpu_model, "VIA "); + if ((cpu_id & 0xff0) == 0x6f0) + strcat(cpu_model, "Nano Processor"); + else + strcat(cpu_model, "Unknown"); + break; + default: + strcat(cpu_model, "Unknown"); + break; } /* @@ -181,7 +191,8 @@ printcpuinfo(void) printf(" Id = 0x%x", cpu_id); if (cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD) { + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_CENTAUR) { printf(" Stepping = %u", cpu_id & 0xf); if (cpu_high > 0) { u_int cmp = 1, htt = 1; @@ -353,6 +364,9 @@ printcpuinfo(void) ); } + if (cpu_vendor_id == CPU_VENDOR_CENTAUR) + print_via_padlock_info(); + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; @@ -376,6 +390,11 @@ printcpuinfo(void) AMD64_CPU_MODEL(cpu_id) >= 0x3)) tsc_is_invariant = 1; break; + case CPU_VENDOR_CENTAUR: + if (AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf) + tsc_is_invariant = 1; + break; } if (tsc_is_invariant) printf("\n TSC: P-state invariant"); @@ -457,7 +476,7 @@ EVENTHANDLER_DEFINE(cpufreq_post_change, EVENTHANDLER_PRI_ANY); /* - * Final stage of CPU identification. -- Should I check TI? + * Final stage of CPU identification. */ void identify_cpu(void) @@ -479,7 +498,8 @@ identify_cpu(void) cpu_feature2 = regs[2]; if (cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD) { + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_CENTAUR) { do_cpuid(0x80000000, regs); cpu_exthigh = regs[0]; } @@ -600,3 +620,37 @@ print_AMD_info(void) print_AMD_l2_assoc((regs[2] >> 12) & 0x0f); } } + +static void +print_via_padlock_info(void) +{ + u_int regs[4]; + + /* Check for supported models. */ + switch (cpu_id & 0xff0) { + case 0x690: + if ((cpu_id & 0xf) < 3) + return; + case 0x6a0: + case 0x6d0: + case 0x6f0: + break; + default: + return; + } + + do_cpuid(0xc0000000, regs); + if (regs[0] >= 0xc0000001) + do_cpuid(0xc0000001, regs); + else + return; + + printf("\n VIA Padlock Features=0x%b", regs[3], + "\020" + "\003RNG" /* RNG */ + "\007AES" /* ACE */ + "\011AES-CTR" /* ACE2 */ + "\013SHA1,SHA256" /* PHE */ + "\015RSA" /* PMM */ + ); +} Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Mon Jan 12 19:16:00 2009 (r187108) +++ head/sys/amd64/amd64/initcpu.c Mon Jan 12 19:17:35 2009 (r187109) @@ -54,6 +54,8 @@ u_int cpu_feature2; /* Feature flags */ u_int amd_feature; /* AMD feature flags */ u_int amd_feature2; /* AMD feature flags */ u_int amd_pminfo; /* AMD advanced power management info */ +u_int via_feature_rng; /* VIA RNG features */ +u_int via_feature_xcrypt; /* VIA ACE features */ u_int cpu_high; /* Highest arg to CPUID */ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ @@ -64,6 +66,75 @@ u_int cpu_vendor_id; /* CPU vendor ID * u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ +SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, + &via_feature_rng, 0, "VIA C3/C7 RNG feature available in CPU"); +SYSCTL_UINT(_hw, OID_AUTO, via_feature_xcrypt, CTLFLAG_RD, + &via_feature_xcrypt, 0, "VIA C3/C7 xcrypt feature available in CPU"); + +/* + * Initialize special VIA C3/C7 features + */ +static void +init_via(void) +{ + u_int regs[4], val; + u_int64_t msreg; + + do_cpuid(0xc0000000, regs); + val = regs[0]; + if (val >= 0xc0000001) { + do_cpuid(0xc0000001, regs); + val = regs[3]; + } else + val = 0; + + /* Enable RNG if present and disabled */ + if (val & VIA_CPUID_HAS_RNG) { + if (!(val & VIA_CPUID_DO_RNG)) { + msreg = rdmsr(0x110B); + msreg |= 0x40; + wrmsr(0x110B, msreg); + } + via_feature_rng = VIA_HAS_RNG; + } + /* Enable AES engine if present and disabled */ + if (val & VIA_CPUID_HAS_ACE) { + if (!(val & VIA_CPUID_DO_ACE)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_AES; + } + /* Enable ACE2 engine if present and disabled */ + if (val & VIA_CPUID_HAS_ACE2) { + if (!(val & VIA_CPUID_DO_ACE2)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_AESCTR; + } + /* Enable SHA engine if present and disabled */ + if (val & VIA_CPUID_HAS_PHE) { + if (!(val & VIA_CPUID_DO_PHE)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28/**/); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_SHA; + } + /* Enable MM engine if present and disabled */ + if (val & VIA_CPUID_HAS_PMM) { + if (!(val & VIA_CPUID_DO_PMM)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28/**/); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_MM; + } +} + /* * Initialize CPU control registers */ @@ -81,4 +152,8 @@ initializecpu(void) wrmsr(MSR_EFER, msr); pg_nx = PG_NX; } + if (cpu_vendor_id == CPU_VENDOR_CENTAUR && + AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf) + init_via(); } Modified: head/sys/amd64/amd64/msi.c ============================================================================== --- head/sys/amd64/amd64/msi.c Mon Jan 12 19:16:00 2009 (r187108) +++ head/sys/amd64/amd64/msi.c Mon Jan 12 19:17:35 2009 (r187109) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* Fields in address for Intel MSI messages. */ @@ -212,9 +213,18 @@ msi_init(void) { /* Check if we have a supported CPU. */ - if (!(cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD)) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf) + break; + /* FALLTHROUGH */ + default: return; + } msi_enabled = 1; intr_register_pic(&msi_pic); Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Mon Jan 12 19:16:00 2009 (r187108) +++ head/sys/amd64/include/md_var.h Mon Jan 12 19:17:35 2009 (r187109) @@ -45,6 +45,8 @@ extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; extern u_int amd_pminfo; +extern u_int via_feature_rng; +extern u_int via_feature_xcrypt; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Mon Jan 12 19:16:00 2009 (r187108) +++ head/sys/amd64/include/specialreg.h Mon Jan 12 19:17:35 2009 (r187109) @@ -459,4 +459,40 @@ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ +/* VIA ACE crypto featureset: for via_feature_rng */ +#define VIA_HAS_RNG 1 /* cpu has RNG */ + +/* VIA ACE crypto featureset: for via_feature_xcrypt */ +#define VIA_HAS_AES 1 /* cpu has AES */ +#define VIA_HAS_SHA 2 /* cpu has SHA1 & SHA256 */ +#define VIA_HAS_MM 4 /* cpu has RSA instructions */ +#define VIA_HAS_AESCTR 8 /* cpu has AES-CTR instructions */ + +/* Centaur Extended Feature flags */ +#define VIA_CPUID_HAS_RNG 0x000004 +#define VIA_CPUID_DO_RNG 0x000008 +#define VIA_CPUID_HAS_ACE 0x000040 +#define VIA_CPUID_DO_ACE 0x000080 +#define VIA_CPUID_HAS_ACE2 0x000100 +#define VIA_CPUID_DO_ACE2 0x000200 +#define VIA_CPUID_HAS_PHE 0x000400 +#define VIA_CPUID_DO_PHE 0x000800 +#define VIA_CPUID_HAS_PMM 0x001000 +#define VIA_CPUID_DO_PMM 0x002000 + +/* VIA ACE xcrypt-* instruction context control options */ +#define VIA_CRYPT_CWLO_ROUND_M 0x0000000f +#define VIA_CRYPT_CWLO_ALG_M 0x00000070 +#define VIA_CRYPT_CWLO_ALG_AES 0x00000000 +#define VIA_CRYPT_CWLO_KEYGEN_M 0x00000080 +#define VIA_CRYPT_CWLO_KEYGEN_HW 0x00000000 +#define VIA_CRYPT_CWLO_KEYGEN_SW 0x00000080 +#define VIA_CRYPT_CWLO_NORMAL 0x00000000 +#define VIA_CRYPT_CWLO_INTERMEDIATE 0x00000100 +#define VIA_CRYPT_CWLO_ENCRYPT 0x00000000 +#define VIA_CRYPT_CWLO_DECRYPT 0x00000200 +#define VIA_CRYPT_CWLO_KEY128 0x0000000a /* 128bit, 10 rds */ +#define VIA_CRYPT_CWLO_KEY192 0x0000040c /* 192bit, 12 rds */ +#define VIA_CRYPT_CWLO_KEY256 0x0000080e /* 256bit, 15 rds */ + #endif /* !_MACHINE_SPECIALREG_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 19:17:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 419A51065751; Mon, 12 Jan 2009 19:17:43 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B188A8FC16; Mon, 12 Jan 2009 19:17:43 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CJHhA0074086; Mon, 12 Jan 2009 19:17:43 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CJHh73074085; Mon, 12 Jan 2009 19:17:43 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200901121917.n0CJHh73074085@svn.freebsd.org> From: "Simon L. Nielsen" Date: Mon, 12 Jan 2009 19:17: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: r187110 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 19:17:45 -0000 Author: simon Date: Mon Jan 12 19:17:43 2009 New Revision: 187110 URL: http://svn.freebsd.org/changeset/base/187110 Log: netcat is "now" in base, so point people at nc(1) instead of the port. MFC after: 1 week Modified: head/games/fortune/datfiles/freebsd-tips Modified: head/games/fortune/datfiles/freebsd-tips ============================================================================== --- head/games/fortune/datfiles/freebsd-tips Mon Jan 12 19:17:35 2009 (r187109) +++ head/games/fortune/datfiles/freebsd-tips Mon Jan 12 19:17:43 2009 (r187110) @@ -215,8 +215,8 @@ Over quota? "du -s * | sort -n " will g directory sizes. -- David Scheidt % -ports/net/netcat port is useful not only for redirecting input/output -to TCP or UDP connections, but also for proxying them with inetd(8). +nc(1) (or netcat) is useful not only for redirecting input/output to +TCP or UDP connections, but also for proxying them with inetd(8). % sh (the default Bourne shell in FreeBSD) supports command-line editing. Just ``set -o emacs'' or ``set -o vi'' to enable it. From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 19:23:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B1DB10656E0; Mon, 12 Jan 2009 19:23:47 +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 5A9BB8FC23; Mon, 12 Jan 2009 19:23:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CJNlpV074314; Mon, 12 Jan 2009 19:23:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CJNlTP074310; Mon, 12 Jan 2009 19:23:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901121923.n0CJNlTP074310@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 12 Jan 2009 19:23: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: r187112 - in head/sys: conf crypto/via modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 19:23:48 -0000 Author: jkim Date: Mon Jan 12 19:23:46 2009 New Revision: 187112 URL: http://svn.freebsd.org/changeset/base/187112 Log: Connect padlock(4) to amd64 build for VIA Nano processors. Modified: head/sys/conf/files.amd64 head/sys/crypto/via/padlock.c head/sys/crypto/via/padlock_hash.c head/sys/modules/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Jan 12 19:19:51 2009 (r187111) +++ head/sys/conf/files.amd64 Mon Jan 12 19:23:46 2009 (r187112) @@ -128,6 +128,9 @@ amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb +crypto/via/padlock.c optional padlock +crypto/via/padlock_cipher.c optional padlock +crypto/via/padlock_hash.c optional padlock dev/acpica/acpi_if.m standard dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp Modified: head/sys/crypto/via/padlock.c ============================================================================== --- head/sys/crypto/via/padlock.c Mon Jan 12 19:19:51 2009 (r187111) +++ head/sys/crypto/via/padlock.c Mon Jan 12 19:23:46 2009 (r187112) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__i386__) && !defined(PC98) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) #include #include #include @@ -85,7 +85,7 @@ padlock_probe(device_t dev) { char capp[256]; -#if defined(__i386__) && !defined(PC98) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) /* If there is no AES support, we has nothing to do here. */ if (!(via_feature_xcrypt & VIA_HAS_AES)) { device_printf(dev, "No ACE support.\n"); Modified: head/sys/crypto/via/padlock_hash.c ============================================================================== --- head/sys/crypto/via/padlock_hash.c Mon Jan 12 19:19:51 2009 (r187111) +++ head/sys/crypto/via/padlock_hash.c Mon Jan 12 19:23:46 2009 (r187112) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__i386__) && !defined(PC98) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) #include #include #include Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jan 12 19:19:51 2009 (r187111) +++ head/sys/modules/Makefile Mon Jan 12 19:23:46 2009 (r187112) @@ -553,6 +553,11 @@ _nxge= nxge .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris .endif +.if ${MK_CRYPT} != "no" || defined(ALL_MODULES) +.if exists(${.CURDIR}/../crypto/via) +_padlock= padlock +.endif +.endif _pccard= pccard _rdma= rdma _safe= safe From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 20:13:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3A021065677; Mon, 12 Jan 2009 20:13:14 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 850E88FC21; Mon, 12 Jan 2009 20:13:14 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CKDESO075279; Mon, 12 Jan 2009 20:13:14 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CKDEU3075278; Mon, 12 Jan 2009 20:13:14 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <200901122013.n0CKDEU3075278@svn.freebsd.org> From: Takanori Watanabe Date: Mon, 12 Jan 2009 20:13: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: r187113 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 20:13:15 -0000 Author: takawata Date: Mon Jan 12 20:13:14 2009 New Revision: 187113 URL: http://svn.freebsd.org/changeset/base/187113 Log: More usb2 foma driver update. 1. Export usb serial port unit number as sysctl. 2. Fix bug on handsfree port. Modified: head/sys/dev/usb2/serial/ufoma2.c Modified: head/sys/dev/usb2/serial/ufoma2.c ============================================================================== --- head/sys/dev/usb2/serial/ufoma2.c Mon Jan 12 19:23:46 2009 (r187112) +++ head/sys/dev/usb2/serial/ufoma2.c Mon Jan 12 20:13:14 2009 (r187113) @@ -3,7 +3,6 @@ #include __FBSDID("$FreeBSD$"); #define UFOMA_HANDSFREE - /*- * Copyright (c) 2005, Takanori Watanabe * Copyright (c) 2003, M. Warner Losh . @@ -486,7 +485,9 @@ ufoma_attach(device_t dev) SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "openmode", 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, + "Unit number as USB serial"); return (0); /* success */ @@ -758,7 +759,7 @@ ufoma_intr_callback(struct usb2_xfer *xf if (sc->sc_num_msg != 0xFF) { sc->sc_num_msg++; } - usb2_transfer_start(sc->sc_ctrl_xfer[3]); + usb2_transfer_start(sc->sc_ctrl_xfer[2]); break; case UCDC_N_SERIAL_STATE: From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 21:15:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73899106564A; Mon, 12 Jan 2009 21:15:08 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 393D98FC16; Mon, 12 Jan 2009 21:15:07 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id n0CLF71v093990; Mon, 12 Jan 2009 13:15:07 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id n0CLF70v093989; Mon, 12 Jan 2009 13:15:07 -0800 (PST) (envelope-from obrien) Date: Mon, 12 Jan 2009 13:15:07 -0800 From: "David O'Brien" To: Christoph Mallon Message-ID: <20090112211507.GA90878@dragon.NUXI.org> References: <200812262254.mBQMsrbR052676@svn.freebsd.org> <4960FA9A.1090509@gmx.de> <20090111041543.GB17602@dragon.NUXI.org> <4969A626.6070908@gmx.de> <20090112082510.GA69194@dragon.NUXI.org> <496B10F9.20201@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <496B10F9.20201@gmx.de> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186504 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 21:15:09 -0000 On Mon, Jan 12, 2009 at 10:44:25AM +0100, Christoph Mallon wrote: > Alternatively I would have gladly reviewed your solution. Feel free to review the below. > Actually this version doesn't work either. > tron# ./mount -a > usage: mount [-t fstype] [-o options] target_fs mount_point > tron# ./mount -d -a > mount -t ufs -o rw -o update /dev/ad0s1a / > mount -t ufs ��`X (濿��`X /dev/ad0s1f /data > (Sorry for the garbage, it actually printed that. You can turn it into a > "clean" segfault by memset()ing mnt_argv just after its declaration) > Your incorrect use of local variables and the resulting undefined behaviour > made the cat, who visits me on a roof behind the house sometimes, almost > fall from said roof, when he saw your commit: You expect the local variable > "struct cpa mnt_argv" still to have the same values after mountfs() was > left and reentered. Too bad you didn't at least follow the lead of what I > proposed. Please stop with the attitude - not one of your patches has passed the simple smoke test - "does it boot". Yes I goofed. I was unfortunately too lucky on my test AMD64 system - things just kept lining up perfectly for me. I partially took care of the reenterancy (I'm not sure you realized mountfs() is called multiple times), but failed to ensure the lifetime of the pointer. -- -- David (obrien@FreeBSD.org) Index: mount.c =================================================================== --- mount.c (revision 187107) +++ mount.c (working copy) @@ -518,11 +518,10 @@ int mountfs(const char *vfstype, const char *spec, const char *name, int flags, const char *options, const char *mntopts) { - struct cpa mnt_argv; struct statfs sf; int i, ret; char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; - static int mnt_argv_inited; + static struct cpa mnt_argv; /* resolve the mountpoint with realpath(3) */ (void)checkpath(name, mntpath); @@ -557,10 +556,6 @@ mountfs(const char *vfstype, const char /* Construct the name of the appropriate mount command */ (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); - if (!mnt_argv_inited) { - mnt_argv_inited++; - mnt_argv.a = NULL; - } mnt_argv.c = -1; append_arg(&mnt_argv, execname); mangle(optbuf, &mnt_argv); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 21:19:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAEAB1065688 for ; Mon, 12 Jan 2009 21:19:30 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 3CDF38FC13 for ; Mon, 12 Jan 2009 21:19:28 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 12 Jan 2009 21:19:26 -0000 Received: from p54A3E57E.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.229.126] by mail.gmx.net (mp030) with SMTP; 12 Jan 2009 22:19:26 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+n49Z11Vune2NYGlUps07hb0GyJ1TVTBm4ssM0XO I5XCIlvZYtkjBO Message-ID: <496BB3D9.7020603@gmx.de> Date: Mon, 12 Jan 2009 22:19:21 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: obrien@freebsd.org References: <200812262254.mBQMsrbR052676@svn.freebsd.org> <4960FA9A.1090509@gmx.de> <20090111041543.GB17602@dragon.NUXI.org> <4969A626.6070908@gmx.de> <20090112082510.GA69194@dragon.NUXI.org> <496B10F9.20201@gmx.de> <20090112175424.GA89144@dragon.NUXI.org> In-Reply-To: <20090112175424.GA89144@dragon.NUXI.org> Content-Type: multipart/mixed; boundary="------------040605090804050701070907" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.49,0.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186504 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 21:19:31 -0000 This is a multi-part message in MIME format. --------------040605090804050701070907 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit David O'Brien schrieb: > On Mon, Jan 12, 2009 at 10:44:25AM +0100, Christoph Mallon wrote: >> David O'Brien schrieb: >>> On Sun, Jan 11, 2009 at 08:56:22AM +0100, Christoph Mallon wrote: >>>> David O'Brien schrieb: >>>>> On Sun, Jan 04, 2009 at 07:06:18PM +0100, Christoph Mallon wrote: >>>>>> I'm pretty sure $SUPERNATURAL_BEING_OF_YOUR_CHOICE killed a kitten for >>>>>> the ugly hack you added to mount. The moment you overflow a buffer, you >>>>>> are in no man's land and there's no escape. I appended a patch, which >>>>>> solves this issue once and for all: The argv array gets dynamically >>>>>> expanded, when its limit is reached. >>>>>> Please - for all kittens out there - commit this patch. >>>>> Hi Christoph, >>>>> Unfortunately your patch doesn't work. >>>>> For a 'ufs' file system listed in /etc/fstab >>>>> $ umount /foo >>>>> $ mount /foo >>>>> Does not work. >>>> Why haven't you told me earlier? >>> Wow, wish I did have the gift to know something before I know something. >>> Especially tomorrow's lotto #'s. ;-) >> I sent you my patch almost a week before you commited your changes. I >> think, there was enough time to tell me, that my patch had a flaw. > > Christoph when I work for you for $$, then you can be demanding on when > I read email and test the attached patches. Since this is in my free > time... > >> I've attached a corrected version of my patch, which has a mnt_argc = 0; >> added in order to reset the argument vector on reentry of mountfs() >> (instead of appending to the arguments of the last round). > > If you want me to read your patches - stop making larger changes than > necessary - that primarily undo the changes I've already done. Instead > send patches that fix bugs you find in smaller ways (unless that's not > possible). > > thanks, David, when I work for you for €€, then you can be demanding on how I write patches to suit your taste. Since this is in my free time... Instead, to show that I'm not resentful and in case you didn't fully read my last email, here's a last piece of free advice: You broke HEAD in r187093. So take the attached patch and run with it. You're welcome --------------040605090804050701070907 Content-Type: text/plain; name="mount.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mount.diff" Index: mount.c =================================================================== --- mount.c (Revision 187093) +++ mount.c (Arbeitskopie) @@ -70,6 +70,7 @@ struct cpa { char **a; + int sz; int c; }; @@ -503,11 +504,9 @@ static void append_arg(struct cpa *sa, char *arg) { - static int a_sz; - - if (sa->c + 1 == a_sz) { - a_sz = a_sz == 0 ? 8 : a_sz * 2; - sa->a = realloc(sa->a, sizeof(sa->a) * a_sz); + if (sa->c + 1 == sa->sz) { + sa->sz = sa->sz == 0 ? 8 : sa->sz * 2; + sa->a = realloc(sa->a, sizeof(sa->a) * sa->sz); if (sa->a == NULL) errx(1, "realloc failed"); } @@ -518,11 +517,10 @@ mountfs(const char *vfstype, const char *spec, const char *name, int flags, const char *options, const char *mntopts) { - struct cpa mnt_argv; + static struct cpa mnt_argv; struct statfs sf; int i, ret; char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; - static int mnt_argv_inited; /* resolve the mountpoint with realpath(3) */ (void)checkpath(name, mntpath); @@ -557,10 +555,6 @@ /* Construct the name of the appropriate mount command */ (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); - if (!mnt_argv_inited) { - mnt_argv_inited++; - mnt_argv.a = NULL; - } mnt_argv.c = -1; append_arg(&mnt_argv, execname); mangle(optbuf, &mnt_argv); --------------040605090804050701070907-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 21:49:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E41F11065679; Mon, 12 Jan 2009 21:49:42 +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 9651E8FC1F; Mon, 12 Jan 2009 21:49:42 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CLngBN077256; Mon, 12 Jan 2009 21:49:42 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CLngA5077255; Mon, 12 Jan 2009 21:49:42 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901122149.n0CLngA5077255@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 12 Jan 2009 21:49:42 +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: r187116 - head/usr.bin/gprof X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 21:49:44 -0000 Author: obrien Date: Mon Jan 12 21:49:42 2009 New Revision: 187116 URL: http://svn.freebsd.org/changeset/base/187116 Log: If running with "-K" really do not information about symbols from the a.out argument. Before this fix, after searching the currently-running kernel, we would still search the a.out argument - completely override the in-kernel list, essentially defeating the K flag's purpose. PR: 47387 Submitted by: Ryan Beasley Modified: head/usr.bin/gprof/gprof.c Modified: head/usr.bin/gprof/gprof.c ============================================================================== --- head/usr.bin/gprof/gprof.c Mon Jan 12 21:30:22 2009 (r187115) +++ head/usr.bin/gprof/gprof.c Mon Jan 12 21:49:42 2009 (r187116) @@ -165,7 +165,7 @@ main(argc, argv) * get information from the executable file. */ if ((Kflag && kernel_getnfile(a_outname, &defaultEs) == -1) || - (elf_getnfile(a_outname, &defaultEs) == -1 && + (!Kflag && elf_getnfile(a_outname, &defaultEs) == -1 && aout_getnfile(a_outname, &defaultEs) == -1)) errx(1, "%s: bad format", a_outname); /* From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 21:58:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E80C61065679; Mon, 12 Jan 2009 21:58:19 +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 BB1A98FC12; Mon, 12 Jan 2009 21:58:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CLwJ1B077434; Mon, 12 Jan 2009 21:58:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CLwJdG077433; Mon, 12 Jan 2009 21:58:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901122158.n0CLwJdG077433@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 12 Jan 2009 21:58: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: r187117 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 21:58:22 -0000 Author: jkim Date: Mon Jan 12 21:58:19 2009 New Revision: 187117 URL: http://svn.freebsd.org/changeset/base/187117 Log: Replace more strcmp(cpu_vendor, "foo") with cpu_vendor_id. Modified: head/sys/i386/i386/initcpu.c Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Jan 12 21:49:42 2009 (r187116) +++ head/sys/i386/i386/initcpu.c Mon Jan 12 21:58:19 2009 (r187117) @@ -650,7 +650,7 @@ initializecpu(void) init_6x86MX(); break; case CPU_686: - if (strcmp(cpu_vendor, "GenuineIntel") == 0) { + if (cpu_vendor_id == CPU_VENDOR_INTEL) { switch (cpu_id & 0xff0) { case 0x610: init_ppro(); @@ -659,7 +659,7 @@ initializecpu(void) init_mendocino(); break; } - } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { #if defined(I686_CPU) && defined(CPU_ATHLON_SSE_HACK) /* * Sometimes the BIOS doesn't enable SSE instructions. @@ -678,7 +678,7 @@ initializecpu(void) cpu_feature = regs[3]; } #endif - } else if (strcmp(cpu_vendor, "CentaurHauls") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_CENTAUR) { switch (cpu_id & 0xff0) { case 0x690: if ((cpu_id & 0xf) < 3) @@ -718,7 +718,7 @@ initializecpu(void) * CPU_UPGRADE_HW_CACHE option in your kernel configuration file. * This option eliminates unneeded cache flush instruction(s). */ - if (strcmp(cpu_vendor, "CyrixInstead") == 0) { + if (cpu_vendor_id == CPU_VENDOR_CYRIX) { switch (cpu) { #ifdef I486_CPU case CPU_486DLC: @@ -737,7 +737,7 @@ initializecpu(void) default: break; } - } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { switch (cpu_id & 0xFF0) { case 0x470: /* Enhanced Am486DX2 WB */ case 0x490: /* Enhanced Am486DX4 WB */ @@ -745,7 +745,7 @@ initializecpu(void) need_pre_dma_flush = 1; break; } - } else if (strcmp(cpu_vendor, "IBM") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_IBM) { need_post_dma_flush = 1; } else { #ifdef CPU_I486_ON_386 @@ -941,7 +941,7 @@ DB_SHOW_COMMAND(cyrixreg, cyrixreg) u_char ccr0 = 0, ccr4 = 0, ccr5 = 0, pcr0 = 0; cr0 = rcr0(); - if (strcmp(cpu_vendor,"CyrixInstead") == 0) { + if (cpu_vendor_id == CPU_VENDOR_CYRIX) { eflags = read_eflags(); disable_intr(); From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 22:01:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DB39106568E; Mon, 12 Jan 2009 22:01:50 +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 22E678FC1B; Mon, 12 Jan 2009 22:01:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CM1o3a077553; Mon, 12 Jan 2009 22:01:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CM1n5N077550; Mon, 12 Jan 2009 22:01:49 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901122201.n0CM1n5N077550@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 12 Jan 2009 22:01: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: r187118 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 22:01:51 -0000 Author: jkim Date: Mon Jan 12 22:01:49 2009 New Revision: 187118 URL: http://svn.freebsd.org/changeset/base/187118 Log: Add basic i386 support for VIA Nano processors. Modified: head/sys/i386/i386/i686_mem.c head/sys/i386/i386/identcpu.c head/sys/i386/i386/initcpu.c Modified: head/sys/i386/i386/i686_mem.c ============================================================================== --- head/sys/i386/i386/i686_mem.c Mon Jan 12 21:58:19 2009 (r187117) +++ head/sys/i386/i386/i686_mem.c Mon Jan 12 22:01:49 2009 (r187118) @@ -678,9 +678,17 @@ i686_mem_drvinit(void *unused) return; if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) return; - if (cpu_vendor_id != CPU_VENDOR_INTEL && - cpu_vendor_id != CPU_VENDOR_AMD) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (cpu_exthigh >= 0x80000008) + break; + /* FALLTHROUGH */ + default: return; + } mem_range_softc.mr_op = &i686_mrops; } SYSINIT(i686memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, i686_mem_drvinit, NULL); Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Mon Jan 12 21:58:19 2009 (r187117) +++ head/sys/i386/i386/identcpu.c Mon Jan 12 22:01:49 2009 (r187118) @@ -606,6 +606,9 @@ printcpuinfo(void) case 0x6d0: strcpy(cpu_model, "VIA C7 Esther"); break; + case 0x6f0: + strcpy(cpu_model, "VIA Nano"); + break; default: strcpy(cpu_model, "VIA/IDT Unknown"); } @@ -856,6 +859,9 @@ printcpuinfo(void) ); } + if (cpu_vendor_id == CPU_VENDOR_CENTAUR) + print_via_padlock_info(); + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; @@ -879,6 +885,11 @@ printcpuinfo(void) I386_CPU_MODEL(cpu_id) >= 0x3)) tsc_is_invariant = 1; break; + case CPU_VENDOR_CENTAUR: + if (I386_CPU_FAMILY(cpu_id) == 0x6 && + I386_CPU_MODEL(cpu_id) >= 0xf) + tsc_is_invariant = 1; + break; } if (tsc_is_invariant) printf("\n TSC: P-state invariant"); @@ -915,8 +926,6 @@ printcpuinfo(void) printf("\n CPU cache: write-through mode"); #endif } - if (cpu_vendor_id == CPU_VENDOR_CENTAUR) - print_via_padlock_info(); /* Avoid ugly blank lines: only print newline when we have to. */ if (*cpu_vendor || cpu_id) @@ -1568,6 +1577,7 @@ print_via_padlock_info(void) return; case 0x6a0: case 0x6d0: + case 0x6f0: break; default: return; Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Jan 12 21:58:19 2009 (r187117) +++ head/sys/i386/i386/initcpu.c Mon Jan 12 22:01:49 2009 (r187118) @@ -686,6 +686,7 @@ initializecpu(void) /* fall through. */ case 0x6a0: case 0x6d0: + case 0x6f0: init_via(); break; default: From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 22:37:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D34611065674; Mon, 12 Jan 2009 22:37:05 +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 9D8D48FC1D; Mon, 12 Jan 2009 22:37:05 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CMb5NS078342; Mon, 12 Jan 2009 22:37:05 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CMb5o8078340; Mon, 12 Jan 2009 22:37:05 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200901122237.n0CMb5o8078340@svn.freebsd.org> From: Rui Paulo Date: Mon, 12 Jan 2009 22:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187119 - in stable/7/sys: . dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 22:37:08 -0000 Author: rpaulo Date: Mon Jan 12 22:37:05 2009 New Revision: 187119 URL: http://svn.freebsd.org/changeset/base/187119 Log: MFC r185268: Add support for Marvell PATA M88SX6121. PR: 129154 Submitted by: João Barros Modified: stable/7/sys/ (props changed) stable/7/sys/dev/ata/ata-chipset.c stable/7/sys/dev/ata/ata-pci.h Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Mon Jan 12 22:01:49 2009 (r187118) +++ stable/7/sys/dev/ata/ata-chipset.c Mon Jan 12 22:37:05 2009 (r187119) @@ -2555,6 +2555,7 @@ ata_marvell_ident(device_t dev) { ATA_M88SX6041, 0, 4, MV60XX, ATA_SA300, "88SX6041" }, { ATA_M88SX6081, 0, 8, MV60XX, ATA_SA300, "88SX6081" }, { ATA_M88SX6101, 0, 1, MV61XX, ATA_UDMA6, "88SX6101" }, + { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" }, { ATA_M88SX6145, 0, 2, MV61XX, ATA_UDMA6, "88SX6145" }, { 0, 0, 0, 0, 0, 0}}; Modified: stable/7/sys/dev/ata/ata-pci.h ============================================================================== --- stable/7/sys/dev/ata/ata-pci.h Mon Jan 12 22:01:49 2009 (r187118) +++ stable/7/sys/dev/ata/ata-pci.h Mon Jan 12 22:37:05 2009 (r187119) @@ -211,6 +211,7 @@ struct ata_connect_task { #define ATA_M88SX6041 0x604111ab #define ATA_M88SX6081 0x608111ab #define ATA_M88SX6101 0x610111ab +#define ATA_M88SX6121 0x612111ab #define ATA_M88SX6145 0x614511ab #define ATA_MICRON_ID 0x1042 From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 22:50:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78B0F106568A; Mon, 12 Jan 2009 22:50:55 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65ECF8FC1B; Mon, 12 Jan 2009 22:50:55 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0CMotuJ078637; Mon, 12 Jan 2009 22:50:55 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0CMotCw078634; Mon, 12 Jan 2009 22:50:55 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901122250.n0CMotCw078634@svn.freebsd.org> From: Sam Leffler Date: Mon, 12 Jan 2009 22:50: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: r187120 - in head/tools/tools/net80211: . wlantxtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 22:50:56 -0000 Author: sam Date: Mon Jan 12 22:50:55 2009 New Revision: 187120 URL: http://svn.freebsd.org/changeset/base/187120 Log: add tool to calculate air time for 802.11 packets Added: head/tools/tools/net80211/wlantxtime/ head/tools/tools/net80211/wlantxtime/Makefile (contents, props changed) head/tools/tools/net80211/wlantxtime/wlantxtime.c (contents, props changed) Modified: head/tools/tools/net80211/Makefile Modified: head/tools/tools/net80211/Makefile ============================================================================== --- head/tools/tools/net80211/Makefile Mon Jan 12 22:37:05 2009 (r187119) +++ head/tools/tools/net80211/Makefile Mon Jan 12 22:50:55 2009 (r187120) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= stumbler w00t wesside wlaninject wlanstats wlanwatch wlanwds +SUBDIR= stumbler w00t wesside wlaninject wlanstats wlantxtime wlanwatch wlanwds .include Added: head/tools/tools/net80211/wlantxtime/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/net80211/wlantxtime/Makefile Mon Jan 12 22:50:55 2009 (r187120) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= wlantxtime +BINDIR= /usr/local/bin +NO_MAN= + +.include Added: head/tools/tools/net80211/wlantxtime/wlantxtime.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/net80211/wlantxtime/wlantxtime.c Mon Jan 12 22:50:55 2009 (r187120) @@ -0,0 +1,596 @@ +/*- + * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * IEEE 802.11 PHY-related support. + */ + +#include +#include + +#include + +#include +#include + +#define IEEE80211_F_SHPREAMBLE 0x00040000 /* STATUS: use short preamble */ + +#include +#include +#include +#include +#include +#include + +struct ieee80211_rate_table { + int rateCount; /* NB: for proper padding */ + uint8_t rateCodeToIndex[256]; /* back mapping */ + struct { + uint8_t phy; /* CCK/OFDM/TURBO */ + uint32_t rateKbps; /* transfer rate in kbs */ + uint8_t shortPreamble; /* mask for enabling short + * preamble in CCK rate code */ + uint8_t dot11Rate; /* value for supported rates + * info element of MLME */ + uint8_t ctlRateIndex; /* index of next lower basic + * rate; used for dur. calcs */ + uint16_t lpAckDuration; /* long preamble ACK dur. */ + uint16_t spAckDuration; /* short preamble ACK dur. */ + } info[32]; +}; + +uint16_t +ieee80211_compute_duration(const struct ieee80211_rate_table *rt, + uint32_t frameLen, uint16_t rate, int isShortPreamble); + +#define KASSERT(c, msg) do { \ + if (!(c)) { \ + printf msg; \ + putchar('\n'); \ + exit(-1); \ + } \ +} while (0) + +static void +panic(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + exit(-1); +} + +/* shorthands to compact tables for readability */ +#define OFDM IEEE80211_T_OFDM +#define CCK IEEE80211_T_CCK +#define TURBO IEEE80211_T_TURBO +#define PBCC (IEEE80211_T_HT+1) /* XXX */ +#define B(r) (0x80 | r) +#define Mb(x) (x*1000) + +static struct ieee80211_rate_table ieee80211_11b_table = { + .rateCount = 4, /* XXX no PBCC */ + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = CCK, 1000, 0x00, B(2), 0 },/* 1 Mb */ + [1] = { .phy = CCK, 2000, 0x04, B(4), 1 },/* 2 Mb */ + [2] = { .phy = CCK, 5500, 0x04, B(11), 1 },/* 5.5 Mb */ + [3] = { .phy = CCK, 11000, 0x04, B(22), 1 },/* 11 Mb */ + [4] = { .phy = PBCC, 22000, 0x04, 44, 3 } /* 22 Mb */ + }, +}; + +static struct ieee80211_rate_table ieee80211_11g_table = { + .rateCount = 12, + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = CCK, 1000, 0x00, B(2), 0 }, + [1] = { .phy = CCK, 2000, 0x04, B(4), 1 }, + [2] = { .phy = CCK, 5500, 0x04, B(11), 2 }, + [3] = { .phy = CCK, 11000, 0x04, B(22), 3 }, + [4] = { .phy = OFDM, 6000, 0x00, 12, 4 }, + [5] = { .phy = OFDM, 9000, 0x00, 18, 4 }, + [6] = { .phy = OFDM, 12000, 0x00, 24, 6 }, + [7] = { .phy = OFDM, 18000, 0x00, 36, 6 }, + [8] = { .phy = OFDM, 24000, 0x00, 48, 8 }, + [9] = { .phy = OFDM, 36000, 0x00, 72, 8 }, + [10] = { .phy = OFDM, 48000, 0x00, 96, 8 }, + [11] = { .phy = OFDM, 54000, 0x00, 108, 8 } + }, +}; + +static struct ieee80211_rate_table ieee80211_11a_table = { + .rateCount = 8, + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = OFDM, 6000, 0x00, B(12), 0 }, + [1] = { .phy = OFDM, 9000, 0x00, 18, 0 }, + [2] = { .phy = OFDM, 12000, 0x00, B(24), 2 }, + [3] = { .phy = OFDM, 18000, 0x00, 36, 2 }, + [4] = { .phy = OFDM, 24000, 0x00, B(48), 4 }, + [5] = { .phy = OFDM, 36000, 0x00, 72, 4 }, + [6] = { .phy = OFDM, 48000, 0x00, 96, 4 }, + [7] = { .phy = OFDM, 54000, 0x00, 108, 4 } + }, +}; + +static struct ieee80211_rate_table ieee80211_half_table = { + .rateCount = 8, + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = OFDM, 3000, 0x00, B(6), 0 }, + [1] = { .phy = OFDM, 4500, 0x00, 9, 0 }, + [2] = { .phy = OFDM, 6000, 0x00, B(12), 2 }, + [3] = { .phy = OFDM, 9000, 0x00, 18, 2 }, + [4] = { .phy = OFDM, 12000, 0x00, B(24), 4 }, + [5] = { .phy = OFDM, 18000, 0x00, 36, 4 }, + [6] = { .phy = OFDM, 24000, 0x00, 48, 4 }, + [7] = { .phy = OFDM, 27000, 0x00, 54, 4 } + }, +}; + +static struct ieee80211_rate_table ieee80211_quarter_table = { + .rateCount = 8, + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = OFDM, 1500, 0x00, B(3), 0 }, + [1] = { .phy = OFDM, 2250, 0x00, 4, 0 }, + [2] = { .phy = OFDM, 3000, 0x00, B(9), 2 }, + [3] = { .phy = OFDM, 4500, 0x00, 9, 2 }, + [4] = { .phy = OFDM, 6000, 0x00, B(12), 4 }, + [5] = { .phy = OFDM, 9000, 0x00, 18, 4 }, + [6] = { .phy = OFDM, 12000, 0x00, 24, 4 }, + [7] = { .phy = OFDM, 13500, 0x00, 27, 4 } + }, +}; + +static struct ieee80211_rate_table ieee80211_turbog_table = { + .rateCount = 7, + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = TURBO, 12000, 0x00, B(12), 0 }, + [1] = { .phy = TURBO, 24000, 0x00, B(24), 1 }, + [2] = { .phy = TURBO, 36000, 0x00, 36, 1 }, + [3] = { .phy = TURBO, 48000, 0x00, B(48), 3 }, + [4] = { .phy = TURBO, 72000, 0x00, 72, 3 }, + [5] = { .phy = TURBO, 96000, 0x00, 96, 3 }, + [6] = { .phy = TURBO, 108000, 0x00, 108, 3 } + }, +}; + +static struct ieee80211_rate_table ieee80211_turboa_table = { + .rateCount = 8, + .info = { +/* short ctrl */ +/* Preamble dot11Rate Rate */ + [0] = { .phy = TURBO, 12000, 0x00, B(12), 0 }, + [1] = { .phy = TURBO, 18000, 0x00, 18, 0 }, + [2] = { .phy = TURBO, 24000, 0x00, B(24), 2 }, + [3] = { .phy = TURBO, 36000, 0x00, 36, 2 }, + [4] = { .phy = TURBO, 48000, 0x00, B(48), 4 }, + [5] = { .phy = TURBO, 72000, 0x00, 72, 4 }, + [6] = { .phy = TURBO, 96000, 0x00, 96, 4 }, + [7] = { .phy = TURBO, 108000, 0x00, 108, 4 } + }, +}; + +#undef Mb +#undef B +#undef OFDM +#undef CCK +#undef TURBO +#undef XR + +/* + * Setup a rate table's reverse lookup table and fill in + * ack durations. The reverse lookup tables are assumed + * to be initialized to zero (or at least the first entry). + * We use this as a key that indicates whether or not + * we've previously setup the reverse lookup table. + * + * XXX not reentrant, but shouldn't matter + */ +static void +ieee80211_setup_ratetable(struct ieee80211_rate_table *rt) +{ +#define N(a) (sizeof(a)/sizeof(a[0])) +#define WLAN_CTRL_FRAME_SIZE \ + (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN) + + int i; + + for (i = 0; i < N(rt->rateCodeToIndex); i++) + rt->rateCodeToIndex[i] = (uint8_t) -1; + for (i = 0; i < rt->rateCount; i++) { + uint8_t code = rt->info[i].dot11Rate; + uint8_t cix = rt->info[i].ctlRateIndex; + uint8_t ctl_rate = rt->info[cix].dot11Rate; + + rt->rateCodeToIndex[code] = i; + if (code & IEEE80211_RATE_BASIC) { + /* + * Map w/o basic rate bit too. + */ + code &= IEEE80211_RATE_VAL; + rt->rateCodeToIndex[code] = i; + } + + /* + * XXX for 11g the control rate to use for 5.5 and 11 Mb/s + * depends on whether they are marked as basic rates; + * the static tables are setup with an 11b-compatible + * 2Mb/s rate which will work but is suboptimal + * + * NB: Control rate is always less than or equal to the + * current rate, so control rate's reverse lookup entry + * has been installed and following call is safe. + */ + rt->info[i].lpAckDuration = ieee80211_compute_duration(rt, + WLAN_CTRL_FRAME_SIZE, ctl_rate, 0); + rt->info[i].spAckDuration = ieee80211_compute_duration(rt, + WLAN_CTRL_FRAME_SIZE, ctl_rate, IEEE80211_F_SHPREAMBLE); + } + +#undef WLAN_CTRL_FRAME_SIZE +#undef N +} + +/* Setup all rate tables */ +static void +ieee80211_phy_init(void) +{ +#define N(arr) (int)(sizeof(arr) / sizeof(arr[0])) + static struct ieee80211_rate_table * const ratetables[] = { + &ieee80211_half_table, + &ieee80211_quarter_table, + &ieee80211_11a_table, + &ieee80211_11g_table, + &ieee80211_turbog_table, + &ieee80211_turboa_table, + &ieee80211_turboa_table, + &ieee80211_11a_table, + &ieee80211_11g_table, + &ieee80211_11b_table + }; + int i; + + for (i = 0; i < N(ratetables); ++i) + ieee80211_setup_ratetable(ratetables[i]); + +#undef N +} + +/* + * Compute the time to transmit a frame of length frameLen bytes + * using the specified rate, phy, and short preamble setting. + * SIFS is included. + */ +uint16_t +ieee80211_compute_duration(const struct ieee80211_rate_table *rt, + uint32_t frameLen, uint16_t rate, int isShortPreamble) +{ + uint8_t rix = rt->rateCodeToIndex[rate]; + uint32_t bitsPerSymbol, numBits, numSymbols, phyTime, txTime; + uint32_t kbps; + + KASSERT(rix != (uint8_t)-1, ("rate %d has no info", rate)); + kbps = rt->info[rix].rateKbps; + if (kbps == 0) /* XXX bandaid for channel changes */ + return 0; + + switch (rt->info[rix].phy) { + case IEEE80211_T_CCK: +#define CCK_SIFS_TIME 10 +#define CCK_PREAMBLE_BITS 144 +#define CCK_PLCP_BITS 48 + phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS; + if (isShortPreamble && rt->info[rix].shortPreamble) + phyTime >>= 1; + numBits = frameLen << 3; + txTime = CCK_SIFS_TIME + phyTime + + ((numBits * 1000)/kbps); + break; +#undef CCK_SIFS_TIME +#undef CCK_PREAMBLE_BITS +#undef CCK_PLCP_BITS + + case IEEE80211_T_OFDM: +#define OFDM_SIFS_TIME 16 +#define OFDM_PREAMBLE_TIME 20 +#define OFDM_PLCP_BITS 22 +#define OFDM_SYMBOL_TIME 4 + +#define OFDM_SIFS_TIME_HALF 32 +#define OFDM_PREAMBLE_TIME_HALF 40 +#define OFDM_PLCP_BITS_HALF 22 +#define OFDM_SYMBOL_TIME_HALF 8 + +#define OFDM_SIFS_TIME_QUARTER 64 +#define OFDM_PREAMBLE_TIME_QUARTER 80 +#define OFDM_PLCP_BITS_QUARTER 22 +#define OFDM_SYMBOL_TIME_QUARTER 16 + if (rt == &ieee80211_half_table) { + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000; + KASSERT(bitsPerSymbol != 0, ("1/2 rate bps")); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME_QUARTER + + OFDM_PREAMBLE_TIME_QUARTER + + (numSymbols * OFDM_SYMBOL_TIME_QUARTER); + } else if (rt == &ieee80211_quarter_table) { + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_HALF) / 1000; + KASSERT(bitsPerSymbol != 0, ("1/4 rate bps")); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME_HALF + + OFDM_PREAMBLE_TIME_HALF + + (numSymbols * OFDM_SYMBOL_TIME_HALF); + } else { /* full rate channel */ + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000; + KASSERT(bitsPerSymbol != 0, ("full rate bps")); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME + + OFDM_PREAMBLE_TIME + + (numSymbols * OFDM_SYMBOL_TIME); + } + break; + +#undef OFDM_SIFS_TIME +#undef OFDM_PREAMBLE_TIME +#undef OFDM_PLCP_BITS +#undef OFDM_SYMBOL_TIME + + case IEEE80211_T_TURBO: +#define TURBO_SIFS_TIME 8 +#define TURBO_PREAMBLE_TIME 14 +#define TURBO_PLCP_BITS 22 +#define TURBO_SYMBOL_TIME 4 + /* we still save OFDM rates in kbps - so double them */ + bitsPerSymbol = ((kbps << 1) * TURBO_SYMBOL_TIME) / 1000; + KASSERT(bitsPerSymbol != 0, ("turbo bps")); + + numBits = TURBO_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = TURBO_SIFS_TIME + TURBO_PREAMBLE_TIME + + (numSymbols * TURBO_SYMBOL_TIME); + break; +#undef TURBO_SIFS_TIME +#undef TURBO_PREAMBLE_TIME +#undef TURBO_PLCP_BITS +#undef TURBO_SYMBOL_TIME + + default: + panic("%s: unknown phy %u (rate %u)\n", __func__, + rt->info[rix].phy, rate); + break; + } + return txTime; +} + +#define OFDM_PLCP_BITS 22 +#define HT_L_STF 8 +#define HT_L_LTF 8 +#define HT_L_SIG 4 +#define HT_SIG 8 +#define HT_STF 4 +#define HT_LTF(n) ((n) * 4) + +uint32_t +ieee80211_compute_duration_ht(const struct ieee80211_rate_table *rt, + uint32_t frameLen, uint16_t rate, + int streams, int isht40, int isShortGI) +{ + static const uint16_t ht20_bps[16] = { + 26, 52, 78, 104, 156, 208, 234, 260, + 52, 104, 156, 208, 312, 416, 468, 520 + }; + static const uint16_t ht40_bps[16] = { + 54, 108, 162, 216, 324, 432, 486, 540, + 108, 216, 324, 432, 648, 864, 972, 1080, + }; + uint32_t bitsPerSymbol, numBits, numSymbols, txTime; + + KASSERT(rate & IEEE80211_RATE_MCS, ("not mcs %d", rate)); + KASSERT((rate &~ IEEE80211_RATE_MCS) < 16, ("bad mcs 0x%x", rate)); + + if (isht40) + bitsPerSymbol = ht40_bps[rate & 0xf]; + else + bitsPerSymbol = ht20_bps[rate & 0xf]; + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + if (isShortGI) + txTime = ((numSymbols * 18) + 4) / 5; /* 3.6us */ + else + txTime = numSymbols * 4; /* 4us */ + return txTime + HT_L_STF + HT_L_LTF + + HT_L_SIG + HT_SIG + HT_STF + HT_LTF(streams); +} + +static const struct ieee80211_rate_table * +mode2table(const char *mode) +{ + if (strcasecmp(mode, "half") == 0) + return &ieee80211_half_table; + else if (strcasecmp(mode, "quarter") == 0) + return &ieee80211_quarter_table; + else if (strcasecmp(mode, "hta") == 0) + return &ieee80211_11a_table; /* XXX */ + else if (strcasecmp(mode, "htg") == 0) + return &ieee80211_11g_table; /* XXX */ + else if (strcasecmp(mode, "108g") == 0) + return &ieee80211_turbog_table; + else if (strcasecmp(mode, "sturbo") == 0) + return &ieee80211_turboa_table; + else if (strcasecmp(mode, "turbo") == 0) + return &ieee80211_turboa_table; + else if (strcasecmp(mode, "11a") == 0) + return &ieee80211_11a_table; + else if (strcasecmp(mode, "11g") == 0) + return &ieee80211_11g_table; + else if (strcasecmp(mode, "11b") == 0) + return &ieee80211_11b_table; + else + return NULL; +} + +const char * +srate(int rate) +{ + static char buf[32]; + if (rate & 1) + snprintf(buf, sizeof(buf), "%u.5", rate/2); + else + snprintf(buf, sizeof(buf), "%u", rate/2); + return buf; +} + +static int +checkpreamble(const struct ieee80211_rate_table *rt, uint8_t rix, + int isShortPreamble, int verbose) +{ + if (isShortPreamble) { + if (rt->info[rix].phy != IEEE80211_T_CCK) { + if (verbose) + warnx("short preamble not meaningful, ignored"); + isShortPreamble = 0; + } else if (!rt->info[rix].shortPreamble) { + if (verbose) + warnx("short preamble not meaningful with " + "rate %s, ignored", + srate(rt->info[rix].dot11Rate &~ IEEE80211_RATE_BASIC)); + isShortPreamble = 0; + } + } + return isShortPreamble; +} + +static void +usage(const char *progname) +{ + fprintf(stderr, "usage: %s [-a] [-l framelen] [-m mode] [-r rate] [-s]\n", + progname); + fprintf(stderr, "-a display calculations for all possible rates\n"); + fprintf(stderr, "-l framelen length in bytes of 802.11 payload (default 1536)\n"); + fprintf(stderr, "-m 11a calculate for 11a channel\n"); + fprintf(stderr, "-m 11b calculate for 11b channel\n"); + fprintf(stderr, "-m 11g calculate for 11g channel (default)\n"); + fprintf(stderr, "-m half calculate for 1/2 width channel\n"); + fprintf(stderr, "-m quarter calculate for 1/4 width channel\n"); + fprintf(stderr, "-m 108g calculate for dynamic turbo 11g channel\n"); + fprintf(stderr, "-m sturbo calculate for static turbo channel\n"); + fprintf(stderr, "-m turbo calculate for dynamic turbo 11a channel\n"); + fprintf(stderr, "-r rate IEEE rate code (default 54)\n"); + fprintf(stderr, "-s short preamble (default long)\n"); + exit(0); +} + +int +main(int argc, char *argv[]) +{ + const struct ieee80211_rate_table *rt; + const char *mode; + uint32_t frameLen; + uint16_t rate; + uint16_t time; + uint8_t rix; + int ch, allrates, isShortPreamble, isShort; + float frate; + + ieee80211_phy_init(); + + mode = "11g"; + isShortPreamble = 0; + frameLen = 1500 + + sizeof(struct ieee80211_frame) + + LLC_SNAPFRAMELEN + + IEEE80211_CRC_LEN + ; + rate = 2*54; + allrates = 0; + while ((ch = getopt(argc, argv, "al:m:r:s")) != -1) { + switch (ch) { + case 'a': + allrates = 1; + break; + case 'l': + frameLen = strtoul(optarg, NULL, 0); + break; + case 'm': + mode = optarg; + break; + case 'r': + frate = atof(optarg); + rate = (int) 2*frate; + break; + case 's': + isShortPreamble = 1; + break; + default: + usage(argv[0]); + break; + } + } + rt = mode2table(mode); + if (rt == NULL) + errx(-1, "unknown mode %s", mode); + if (!allrates) { + rix = rt->rateCodeToIndex[rate]; + if (rix == (uint8_t) -1) + errx(-1, "rate %s not valid for mode %s", srate(rate), mode); + isShort = checkpreamble(rt, rix, isShortPreamble, 1); + + time = ieee80211_compute_duration(rt, frameLen, rate, isShort); + printf("%u usec to send %u bytes @ %s Mb/s, %s preamble\n", + time, frameLen, srate(rate), + isShort ? "short" : "long"); + } else { + for (rix = 0; rix < rt->rateCount; rix++) { + rate = rt->info[rix].dot11Rate &~ IEEE80211_RATE_BASIC; + isShort = checkpreamble(rt, rix, isShortPreamble, 0); + time = ieee80211_compute_duration(rt, frameLen, rate, + isShort); + printf("%u usec to send %u bytes @ %s Mb/s, %s preamble\n", + time, frameLen, srate(rate), + isShort ? "short" : "long"); + } + } + return 0; +} From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 00:10:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DF98106564A; Tue, 13 Jan 2009 00:10:50 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B82D8FC24; Tue, 13 Jan 2009 00:10:50 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D0Aoam080223; Tue, 13 Jan 2009 00:10:50 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D0Ao9d080222; Tue, 13 Jan 2009 00:10:50 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200901130010.n0D0Ao9d080222@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 13 Jan 2009 00:10: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: r187123 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 00:10:51 -0000 Author: gnn Date: Tue Jan 13 00:10:50 2009 New Revision: 187123 URL: http://svn.freebsd.org/changeset/base/187123 Log: Fix a cut/paste bug which prevents us from setting the average latency tunable. Reviewed by: jfv MFC after: 1 day Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Jan 12 23:17:12 2009 (r187122) +++ head/sys/dev/e1000/if_igb.c Tue Jan 13 00:10:50 2009 (r187123) @@ -279,7 +279,7 @@ TUNABLE_INT("hw.igb.enable_aim", &igb_en static int igb_low_latency = IGB_LOW_LATENCY; TUNABLE_INT("hw.igb.low_latency", &igb_low_latency); static int igb_ave_latency = IGB_AVE_LATENCY; -TUNABLE_INT("hw.igb.ave_latency", &igb_low_latency); +TUNABLE_INT("hw.igb.ave_latency", &igb_ave_latency); static int igb_bulk_latency = IGB_BULK_LATENCY; TUNABLE_INT("hw.igb.bulk_latency", &igb_bulk_latency); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 01:39:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82B961065672; Tue, 13 Jan 2009 01:39:18 +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 707128FC27; Tue, 13 Jan 2009 01:39:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D1dIeH081862; Tue, 13 Jan 2009 01:39:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D1dIVE081861; Tue, 13 Jan 2009 01:39:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901130139.n0D1dIVE081861@svn.freebsd.org> From: Xin LI Date: Tue, 13 Jan 2009 01:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187124 - stable/7/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 01:39:19 -0000 Author: delphij Date: Tue Jan 13 01:39:17 2009 New Revision: 187124 URL: http://svn.freebsd.org/changeset/base/187124 Log: Fix build: MV_61XX is spelled as MV61XX in 7-STABLE. Modified: stable/7/sys/dev/ata/ata-chipset.c Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Tue Jan 13 00:10:50 2009 (r187123) +++ stable/7/sys/dev/ata/ata-chipset.c Tue Jan 13 01:39:17 2009 (r187124) @@ -2555,7 +2555,7 @@ ata_marvell_ident(device_t dev) { ATA_M88SX6041, 0, 4, MV60XX, ATA_SA300, "88SX6041" }, { ATA_M88SX6081, 0, 8, MV60XX, ATA_SA300, "88SX6081" }, { ATA_M88SX6101, 0, 1, MV61XX, ATA_UDMA6, "88SX6101" }, - { ATA_M88SX6121, 0, 1, MV_61XX, ATA_UDMA6, "88SX6121" }, + { ATA_M88SX6121, 0, 1, MV61XX, ATA_UDMA6, "88SX6121" }, { ATA_M88SX6145, 0, 2, MV61XX, ATA_UDMA6, "88SX6145" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 04:56:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FD84106564A; Tue, 13 Jan 2009 04:56:42 +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 F1B1C8FC14; Tue, 13 Jan 2009 04:56:41 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D4uf7E090316; Tue, 13 Jan 2009 04:56:41 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D4ufEC090315; Tue, 13 Jan 2009 04:56:41 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200901130456.n0D4ufEC090315@svn.freebsd.org> From: Tim Kientzle Date: Tue, 13 Jan 2009 04:56: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: r187126 - head/lib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 04:56:42 -0000 Author: kientzle Date: Tue Jan 13 04:56:41 2009 New Revision: 187126 URL: http://svn.freebsd.org/changeset/base/187126 Log: "The first part is just to give more info, the latter part fixes an error to read files past the 32bit byte offset, for instance on DVDs." Submitted by: phk@ MFC after: 10 days Modified: head/lib/libarchive/archive_read_support_format_iso9660.c Modified: head/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_iso9660.c Tue Jan 13 04:09:22 2009 (r187125) +++ head/lib/libarchive/archive_read_support_format_iso9660.c Tue Jan 13 04:56:41 2009 (r187126) @@ -466,7 +466,10 @@ archive_read_format_iso9660_read_header( * seek backwards to extract it, so issue a warning. */ if (file->offset < iso9660->current_position) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Ignoring out-of-order file"); + "Ignoring out-of-order file @%x (%s) %jd < %jd", + file, + iso9660->pathname.s, + file->offset, iso9660->current_position); iso9660->entry_bytes_remaining = 0; iso9660->entry_sparse_offset = 0; release_file(iso9660, file); @@ -607,7 +610,7 @@ parse_file_info(struct iso9660 *iso9660, file->parent = parent; if (parent != NULL) parent->refcount++; - file->offset = toi(isodirrec + DR_extent_offset, DR_extent_size) + file->offset = (uint64_t)toi(isodirrec + DR_extent_offset, DR_extent_size) * iso9660->logical_block_size; file->size = toi(isodirrec + DR_size_offset, DR_size_size); file->mtime = isodate7(isodirrec + DR_date_offset); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 05:13:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44EDC1065670; Tue, 13 Jan 2009 05:13:21 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19E3D8FC0A; Tue, 13 Jan 2009 05:13:21 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D5DKsL090727; Tue, 13 Jan 2009 05:13:20 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D5DK2h090722; Tue, 13 Jan 2009 05:13:20 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901130513.n0D5DK2h090722@svn.freebsd.org> From: David Schultz Date: Tue, 13 Jan 2009 05:13: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: r187128 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 05:13:21 -0000 Author: das Date: Tue Jan 13 05:13:20 2009 New Revision: 187128 URL: http://svn.freebsd.org/changeset/base/187128 Log: Use __gnu89_inline so that these files will compile with newer versions of gcc, where the meaning of 'inline' was changed to match C99. Noticed by: rdivacky Modified: head/lib/msun/src/e_rem_pio2.c head/lib/msun/src/e_rem_pio2f.c head/lib/msun/src/k_cosf.c head/lib/msun/src/k_sinf.c head/lib/msun/src/k_tanf.c Modified: head/lib/msun/src/e_rem_pio2.c ============================================================================== --- head/lib/msun/src/e_rem_pio2.c Tue Jan 13 04:57:25 2009 (r187127) +++ head/lib/msun/src/e_rem_pio2.c Tue Jan 13 05:13:20 2009 (r187128) @@ -49,7 +49,7 @@ pio2_3 = 2.02226624871116645580e-21, / pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ #ifdef INLINE_REM_PIO2 -extern inline +extern __gnu89_inline #endif int __ieee754_rem_pio2(double x, double *y) Modified: head/lib/msun/src/e_rem_pio2f.c ============================================================================== --- head/lib/msun/src/e_rem_pio2f.c Tue Jan 13 04:57:25 2009 (r187127) +++ head/lib/msun/src/e_rem_pio2f.c Tue Jan 13 05:13:20 2009 (r187128) @@ -41,7 +41,7 @@ pio2_1 = 1.57079631090164184570e+00, / pio2_1t = 1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */ #ifdef INLINE_REM_PIO2F -extern inline +extern __gnu89_inline #endif int __ieee754_rem_pio2f(float x, double *y) Modified: head/lib/msun/src/k_cosf.c ============================================================================== --- head/lib/msun/src/k_cosf.c Tue Jan 13 04:57:25 2009 (r187127) +++ head/lib/msun/src/k_cosf.c Tue Jan 13 05:13:20 2009 (r187128) @@ -31,7 +31,7 @@ C2 = -0x16c087e80f1e27.0p-62, /* -0.001 C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ #ifdef INLINE_KERNEL_COSDF -extern inline +extern __gnu89_inline #endif float __kernel_cosdf(double x) Modified: head/lib/msun/src/k_sinf.c ============================================================================== --- head/lib/msun/src/k_sinf.c Tue Jan 13 04:57:25 2009 (r187127) +++ head/lib/msun/src/k_sinf.c Tue Jan 13 05:13:20 2009 (r187128) @@ -30,7 +30,7 @@ S3 = -0x1a00f9e2cae774.0p-65, /* -0.0001 S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */ #ifdef INLINE_KERNEL_SINDF -extern inline +extern __gnu89_inline #endif float __kernel_sindf(double x) Modified: head/lib/msun/src/k_tanf.c ============================================================================== --- head/lib/msun/src/k_tanf.c Tue Jan 13 04:57:25 2009 (r187127) +++ head/lib/msun/src/k_tanf.c Tue Jan 13 05:13:20 2009 (r187128) @@ -33,7 +33,7 @@ T[] = { }; #ifdef INLINE_KERNEL_TANDF -extern inline +extern __gnu89_inline #endif float __kernel_tandf(double x, int iy) From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 05:50:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2544D1065680; Tue, 13 Jan 2009 05:50:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14DDE8FC1E; Tue, 13 Jan 2009 05:50:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D5oM23091435; Tue, 13 Jan 2009 05:50:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D5oMpG091434; Tue, 13 Jan 2009 05:50:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901130550.n0D5oMpG091434@svn.freebsd.org> From: Sam Leffler Date: Tue, 13 Jan 2009 05:50:22 +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: r187129 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 05:50:24 -0000 Author: sam Date: Tue Jan 13 05:50:22 2009 New Revision: 187129 URL: http://svn.freebsd.org/changeset/base/187129 Log: On some platforms touching the bb registers when the phy is powered down will cause a fault. Check the phy power state before possibly reading from the bb, this can happen as ar5212Reset intentionally calls ar5212GetRfgain before bringing the bb out of reset (but we do it here and not in the caller to guard against other possible uses). Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Tue Jan 13 05:13:20 2009 (r187128) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Tue Jan 13 05:50:22 2009 (r187129) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_rfgain.c,v 1.2 2008/11/19 21:23:01 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -280,7 +280,8 @@ ar5212GetRfgain(struct ath_hal *ah) GAIN_VALUES *gv = &ahp->ah_gainValues; uint32_t rddata, probeType; - if (!gv->active) + /* NB: beware of touching the BB when PHY is powered down */ + if (!gv->active || !ahp->ah_phyPowerOn) return HAL_RFGAIN_INACTIVE; if (ahp->ah_rfgainState == HAL_RFGAIN_READ_REQUESTED) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 06:08:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 320C510656C0; Tue, 13 Jan 2009 06:08:38 +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 2103E8FC08; Tue, 13 Jan 2009 06:08:38 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D68br5091811; Tue, 13 Jan 2009 06:08:37 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D68blf091810; Tue, 13 Jan 2009 06:08:37 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901130608.n0D68blf091810@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 13 Jan 2009 06:08:37 +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: r187130 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 06:08:38 -0000 Author: obrien Date: Tue Jan 13 06:08:37 2009 New Revision: 187130 URL: http://svn.freebsd.org/changeset/base/187130 Log: r187093 failed to keep the lifetime of the pointer suitable for reentrancy. Fix that. Also move the current buffer size into the 'cpa' structure. Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Tue Jan 13 05:50:22 2009 (r187129) +++ head/sbin/mount/mount.c Tue Jan 13 06:08:37 2009 (r187130) @@ -70,6 +70,7 @@ int debug, fstab_style, verbose; struct cpa { char **a; + ssize_t sz; int c; }; @@ -503,11 +504,9 @@ hasopt(const char *mntopts, const char * static void append_arg(struct cpa *sa, char *arg) { - static int a_sz; - - if (sa->c + 1 == a_sz) { - a_sz = a_sz == 0 ? 8 : a_sz * 2; - sa->a = realloc(sa->a, sizeof(sa->a) * a_sz); + if (sa->c + 1 == sa->sz) { + sa->sz = sa->sz == 0 ? 8 : sa->sz * 2; + sa->a = realloc(sa->a, sizeof(sa->a) * sa->sz); if (sa->a == NULL) errx(1, "realloc failed"); } @@ -518,11 +517,10 @@ int mountfs(const char *vfstype, const char *spec, const char *name, int flags, const char *options, const char *mntopts) { - struct cpa mnt_argv; struct statfs sf; int i, ret; char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; - static int mnt_argv_inited; + static struct cpa mnt_argv; /* resolve the mountpoint with realpath(3) */ (void)checkpath(name, mntpath); @@ -557,10 +555,6 @@ mountfs(const char *vfstype, const char /* Construct the name of the appropriate mount command */ (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); - if (!mnt_argv_inited) { - mnt_argv_inited++; - mnt_argv.a = NULL; - } mnt_argv.c = -1; append_arg(&mnt_argv, execname); mangle(optbuf, &mnt_argv); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 06:52:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E807106573B; Tue, 13 Jan 2009 06:52:52 +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 F19B58FC0A; Tue, 13 Jan 2009 06:52:51 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D6qp6G092658; Tue, 13 Jan 2009 06:52:51 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D6qpda092657; Tue, 13 Jan 2009 06:52:51 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901130652.n0D6qpda092657@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 13 Jan 2009 06:52: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: r187131 - head/usr.sbin/crunch/crunchgen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 06:52:53 -0000 Author: obrien Date: Tue Jan 13 06:52:51 2009 New Revision: 187131 URL: http://svn.freebsd.org/changeset/base/187131 Log: Set .POSIX mode, along with disable parallel mode. Crunchgen parses the output from make(1) and its picky what it should look like. Also use make's conditional assignment operator rather than test and set. Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Tue Jan 13 06:08:37 2009 (r187130) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Tue Jan 13 06:52:51 2009 (r187131) @@ -709,12 +709,13 @@ void fillin_program_objs(prog_t *p, char if (outhdrname[0] != '\0') fprintf(f, ".include \"%s\"\n", outhdrname); fprintf(f, ".include \"%s\"\n", path); + fprintf(f, ".NOTPARALLEL:\n.NO_PARALLEL:\n.POSIX:\n"); if (buildopts) { fprintf(f, "BUILDOPTS+="); output_strlst(f, buildopts); } - fprintf(f, ".if defined(PROG) && !defined(%s)\n", objvar); - fprintf(f, "%s=${PROG}.o\n", objvar); + fprintf(f, ".if defined(PROG)\n"); + fprintf(f, "%s?=${PROG}.o\n", objvar); fprintf(f, ".endif\n"); fprintf(f, "loop:\n\t@echo 'OBJS= '${%s}\n", objvar); @@ -727,7 +728,7 @@ void fillin_program_objs(prog_t *p, char fclose(f); - snprintf(line, MAXLINELEN, "cd %s && make -f %s crunchgen_objs", + snprintf(line, MAXLINELEN, "cd %s && make -f %s -Q crunchgen_objs", p->srcdir, tempfname); if ((f = popen(line, "r")) == NULL) { warn("submake pipe"); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 06:53:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 393B91065677; Tue, 13 Jan 2009 06:53:54 +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 28BA88FC19; Tue, 13 Jan 2009 06:53:54 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D6rs3q092721; Tue, 13 Jan 2009 06:53:54 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D6rrNX092719; Tue, 13 Jan 2009 06:53:53 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901130653.n0D6rrNX092719@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 13 Jan 2009 06:53: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: r187132 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 06:53:55 -0000 Author: obrien Date: Tue Jan 13 06:53:53 2009 New Revision: 187132 URL: http://svn.freebsd.org/changeset/base/187132 Log: Don't enable -Q by default - I've fixed the rescue build issue. Modified: head/usr.bin/make/job.c head/usr.bin/make/main.c Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Tue Jan 13 06:52:51 2009 (r187131) +++ head/usr.bin/make/job.c Tue Jan 13 06:53:53 2009 (r187132) @@ -2362,8 +2362,7 @@ Job_Init(int maxproc) makeErrors = 0; lastNode = NULL; - - if ((maxJobs == 1 && fifoFd < 0) || beQuiet || beVerbose == 0) { + if ((maxJobs == 1 && fifoFd < 0) || is_posix || beQuiet) { /* * If only one job can run at a time, there's no need for a * banner, no is there? Modified: head/usr.bin/make/main.c ============================================================================== --- head/usr.bin/make/main.c Tue Jan 13 06:52:51 2009 (r187131) +++ head/usr.bin/make/main.c Tue Jan 13 06:53:53 2009 (r187132) @@ -126,7 +126,7 @@ Boolean is_posix; /* .POSIX target seen Boolean mfAutoDeps; /* .MAKEFILEDEPS target seen */ Boolean beSilent; /* -s flag */ Boolean beVerbose; /* -v flag */ -Boolean beQuiet = TRUE; /* -Q flag */ +Boolean beQuiet; /* -Q flag */ Boolean compatMake; /* -B argument */ int debug; /* -d flag */ Boolean ignoreErrors; /* -i flag */ @@ -519,6 +519,7 @@ rearg: break; case 'Q': beQuiet = TRUE; + beVerbose = FALSE; MFLAGS_append("-Q", NULL); break; case 'q': From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 07:12:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC4171065674; Tue, 13 Jan 2009 07:12:32 +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 AC0318FC12; Tue, 13 Jan 2009 07:12:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D7CWLr093109; Tue, 13 Jan 2009 07:12:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D7CWVS093108; Tue, 13 Jan 2009 07:12:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901130712.n0D7CWVS093108@svn.freebsd.org> From: Xin LI Date: Tue, 13 Jan 2009 07:12: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: r187133 - head/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 07:12:33 -0000 Author: delphij Date: Tue Jan 13 07:12:32 2009 New Revision: 187133 URL: http://svn.freebsd.org/changeset/base/187133 Log: Add several HP OEM parts' PCI IDs. MFC after: 2 months Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Tue Jan 13 06:53:53 2009 (r187132) +++ head/sys/dev/bce/if_bce.c Tue Jan 13 07:12:32 2009 (r187133) @@ -106,6 +106,8 @@ static struct bce_type bce_devs[] = { "HP NC370T Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3106, "HP NC370i Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3070, + "HP NC380T PCI Express Dual Port Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5706 1000Base-T" }, @@ -116,18 +118,38 @@ static struct bce_type bce_devs[] = { "Broadcom NetXtreme II BCM5706 1000Base-SX" }, /* BCM5708C controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7037, + "HP NC373T PCI Express Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7038, + "HP NC373i Integrated Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-T" }, /* BCM5708S controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x1706, + "HP NC373m Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x7038, + "HP NC373i PCI Express Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703b, + "HP NC373i Integrated Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703d, + "HP NC373F PCI Express Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-SX" }, /* BCM5709C controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7055, + "HP NC382i Integrated Quad Port PCI Express Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7059, + "HP NC382T PCI Express Dual Port Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-T" }, /* BCM5709S controllers and OEM boards. */ + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x171d, + "HP NC382m Dual Port 1GbE Multifunction BL-c Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x7056, + "HP NC382i Integrated Quad Port PCI Express Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-SX" }, From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 07:58:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F45E1065678; Tue, 13 Jan 2009 07:58:57 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5268FC0C; Tue, 13 Jan 2009 07:58:57 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D7wvAt093948; Tue, 13 Jan 2009 07:58:57 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D7wvAK093947; Tue, 13 Jan 2009 07:58:57 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901130758.n0D7wvAK093947@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 13 Jan 2009 07:58: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: r187134 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 07:58:57 -0000 Author: maxim Date: Tue Jan 13 07:58:57 2009 New Revision: 187134 URL: http://svn.freebsd.org/changeset/base/187134 Log: o Respect -ss flags (suppress zero counters) for icmp6 "histogram of error messages" section. Submitted by: naddy MFC after: 1 week Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Tue Jan 13 07:12:32 2009 (r187133) +++ head/usr.bin/netstat/inet6.c Tue Jan 13 07:58:57 2009 (r187134) @@ -866,7 +866,8 @@ icmp6_stats(u_long off, const char *name #define p(f, m) if (icmp6stat.f || sflag <= 1) \ printf(m, (uintmax_t)icmp6stat.f, plural(icmp6stat.f)) -#define p_5(f, m) printf(m, (uintmax_t)icmp6stat.f) +#define p_5(f, m) if (icmp6stat.f || sflag <= 1) \ + printf(m, (uintmax_t)icmp6stat.f) p(icp6s_error, "\t%ju call%s to icmp6_error\n"); p(icp6s_canterror, From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 09:24:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7991065672; Tue, 13 Jan 2009 09:24:55 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B41D8FC18; Tue, 13 Jan 2009 09:24:55 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D9Ot8K095626; Tue, 13 Jan 2009 09:24:55 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D9OtDc095625; Tue, 13 Jan 2009 09:24:55 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200901130924.n0D9OtDc095625@svn.freebsd.org> From: Christian Brueffer Date: Tue, 13 Jan 2009 09:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187136 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 09:24:57 -0000 Author: brueffer Date: Tue Jan 13 09:24:55 2009 New Revision: 187136 URL: http://svn.freebsd.org/changeset/base/187136 Log: MFC: r186953 DEBUG_REDZONE needs DDB which needs KDB. Modified: stable/7/share/man/man9/ (props changed) stable/7/share/man/man9/redzone.9 Modified: stable/7/share/man/man9/redzone.9 ============================================================================== --- stable/7/share/man/man9/redzone.9 Tue Jan 13 09:21:11 2009 (r187135) +++ stable/7/share/man/man9/redzone.9 Tue Jan 13 09:24:55 2009 (r187136) @@ -24,13 +24,15 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2006 +.Dd January 9, 2009 .Dt REDZONE 9 .Os .Sh NAME .Nm RedZone .Nd "buffer corruptions detector" .Sh SYNOPSIS +.Cd "options KDB" +.Cd "options DDB" .Cd "options DEBUG_REDZONE" .Sh DESCRIPTION .Nm From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 09:30:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F87E106567D; Tue, 13 Jan 2009 09:30:39 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E26E8FC24; Tue, 13 Jan 2009 09:30:39 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D9UdKw095786; Tue, 13 Jan 2009 09:30:39 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D9UdKV095785; Tue, 13 Jan 2009 09:30:39 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200901130930.n0D9UdKV095785@svn.freebsd.org> From: Christian Brueffer Date: Tue, 13 Jan 2009 09:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187137 - stable/6/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 09:30:40 -0000 Author: brueffer Date: Tue Jan 13 09:30:38 2009 New Revision: 187137 URL: http://svn.freebsd.org/changeset/base/187137 Log: MFC: r186953 DEBUG_REDZONE needs DDB which needs KDB. Modified: stable/6/share/man/man9/ (props changed) stable/6/share/man/man9/redzone.9 Modified: stable/6/share/man/man9/redzone.9 ============================================================================== --- stable/6/share/man/man9/redzone.9 Tue Jan 13 09:24:55 2009 (r187136) +++ stable/6/share/man/man9/redzone.9 Tue Jan 13 09:30:38 2009 (r187137) @@ -24,13 +24,15 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2006 +.Dd January 9, 2009 .Dt REDZONE 9 .Os .Sh NAME .Nm RedZone .Nd "buffer corruptions detector" .Sh SYNOPSIS +.Cd "options KDB" +.Cd "options DDB" .Cd "options DEBUG_REDZONE" .Sh DESCRIPTION .Nm From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 10:58:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83D7A106564A; Tue, 13 Jan 2009 10:58:37 +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 58CFA8FC16; Tue, 13 Jan 2009 10:58:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DAwbIK001560; Tue, 13 Jan 2009 10:58:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DAwbAE001559; Tue, 13 Jan 2009 10:58:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901131058.n0DAwbAE001559@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 13 Jan 2009 10:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187138 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 10:58:38 -0000 Author: kib Date: Tue Jan 13 10:58:36 2009 New Revision: 187138 URL: http://svn.freebsd.org/changeset/base/187138 Log: Free stas. Approved by: core (implicit) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Jan 13 09:30:38 2009 (r187137) +++ svnadmin/conf/mentors Tue Jan 13 10:58:36 2009 (r187138) @@ -17,7 +17,6 @@ remko imp rnoland jhb sbruno scottl sson jb -stas kib trasz rwatson versus dds zec julian Co-mentor: silby From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 10:59:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82CC11065688; Tue, 13 Jan 2009 10:59:55 +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 586858FC31; Tue, 13 Jan 2009 10:59:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DAxteq001626; Tue, 13 Jan 2009 10:59:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DAxtQw001625; Tue, 13 Jan 2009 10:59:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901131059.n0DAxtQw001625@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 13 Jan 2009 10:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187139 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 10:59:56 -0000 Author: kib Date: Tue Jan 13 10:59:54 2009 New Revision: 187139 URL: http://svn.freebsd.org/changeset/base/187139 Log: Free rnoland. Approved by: core (implicit), jhb (rnoland' mentor) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Jan 13 10:58:36 2009 (r187138) +++ svnadmin/conf/mentors Tue Jan 13 10:59:54 2009 (r187139) @@ -14,7 +14,6 @@ eri mlaier Co-mentor: thompsa pho kib rdivacky kib remko imp -rnoland jhb sbruno scottl sson jb trasz rwatson From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 12:19:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52C7010656D8; Tue, 13 Jan 2009 12:19:44 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C7058FC18; Tue, 13 Jan 2009 12:19:44 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DCJirO003224; Tue, 13 Jan 2009 12:19:44 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DCJiDF003223; Tue, 13 Jan 2009 12:19:44 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901131219.n0DCJiDF003223@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 12:19:44 +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: r187142 - head/bin/kenv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 12:19:47 -0000 Author: luigi Date: Tue Jan 13 12:19:43 2009 New Revision: 187142 URL: http://svn.freebsd.org/changeset/base/187142 Log: Document how kernel environment can be statically compiled in, and reference a few related manpages. MFC after: 3 days Modified: head/bin/kenv/kenv.1 Modified: head/bin/kenv/kenv.1 ============================================================================== --- head/bin/kenv/kenv.1 Tue Jan 13 11:51:32 2009 (r187141) +++ head/bin/kenv/kenv.1 Tue Jan 13 12:19:43 2009 (r187142) @@ -67,8 +67,28 @@ If the .Fl q option is set, warnings normally printed as a result of being unable to perform the requested operation will be suppressed. +.Pp +Variables can be added to the kernel environment using the +.Xr /boot/oader.conf +file, or also statically compiled into the kernel using the statement +.Pp +.Dl Ic env Ar filename +.Pp +in the kernel config file. +The file can contain lines of the form +.Pp +.Dl name = "value" # this is a coment +.Pp +where whitespace around name and '=', and +everything after a '#' character, are ignored. Almost any printable +character except '=' is acceptable as part of a name. Quotes +are optional and necessary only if the value contains +whitespace. +.Pp .Sh SEE ALSO .Xr kenv 2 , +.Xr config 5 , +.Xr loader.conf 5 , .Xr loader 8 .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 12:28:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FBD01065687; Tue, 13 Jan 2009 12:28:15 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DAD58FC19; Tue, 13 Jan 2009 12:28:15 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DCSF2b003403; Tue, 13 Jan 2009 12:28:15 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DCSF9m003402; Tue, 13 Jan 2009 12:28:15 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901131228.n0DCSF9m003402@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 12:28: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: r187143 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 12:28:15 -0000 Author: luigi Date: Tue Jan 13 12:28:14 2009 New Revision: 187143 URL: http://svn.freebsd.org/changeset/base/187143 Log: comment out some debugging messages that slipped in by mistake. MFC after: 3 days Modified: head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Tue Jan 13 12:19:43 2009 (r187142) +++ head/sys/boot/forth/support.4th Tue Jan 13 12:28:14 2009 (r187143) @@ -820,7 +820,7 @@ only forth also support-functions defini \ Interface to loading conf files : load_conf ( addr len -- ) - ." ----- Trying conf " 2dup type cr + \ ." ----- Trying conf " 2dup type cr \ debugging 0 to end_of_file? reset_line_reading O_RDONLY fopen fd ! @@ -912,7 +912,7 @@ string current_file_name_ref \ used to p \ loader_conf_files processing support functions : get_conf_files ( -- addr len ) \ put addr/len on stack, reset var - ." -- starting on <" conf_files strtype ." >" cr + \ ." -- starting on <" conf_files strtype ." >" cr \ debugging conf_files strget 0 0 conf_files strset ; @@ -939,8 +939,7 @@ string current_file_name_ref \ used to p pos char+ to pos repeat addr len pos addr r@ + pos r> - - 2dup - ." get_file_name has " type cr + \ 2dup ." get_file_name has " type cr \ debugging ; : get_next_file ( addr len ptr -- addr len ptr' addr' len' | 0 ) From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 12:35:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E0E3106567E; Tue, 13 Jan 2009 12:35:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11E6F8FC26; Tue, 13 Jan 2009 12:35:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DCZXTq003594; Tue, 13 Jan 2009 12:35:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DCZXMr003592; Tue, 13 Jan 2009 12:35:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901131235.n0DCZXMr003592@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 12:35: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: r187144 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 12:35:35 -0000 Author: luigi Date: Tue Jan 13 12:35:33 2009 New Revision: 187144 URL: http://svn.freebsd.org/changeset/base/187144 Log: Documentation-only change: - add a reference to the config(5) manpage; - hopefully clarify the format of the 'env FILENAME' directive. I am putting these notes in sys/${arch}/conf/GENERIC and not in sys/conf/NOTES because: 1. i386/GENERIC already had reference to a similar option (hints..) and to documentation (handbook) 2. GENERIC is what most users look at when they have to modify or create a new kernel config, so having the suggestion there is more effective. I am only touching i386 and amd64 because the other GENERIC files are already out of sync, and I am not sure what is the overall plan. MFC after: 3 days Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Jan 13 12:28:14 2009 (r187143) +++ head/sys/amd64/conf/GENERIC Tue Jan 13 12:35:33 2009 (r187144) @@ -1,8 +1,8 @@ # # GENERIC -- Generic kernel configuration file for FreeBSD/amd64 # -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # @@ -24,6 +24,12 @@ ident GENERIC # To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. +# Use the following to compile in values accessible to the kernel +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value', see kenv(1) +# +# env "GENERIC.env" + makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options SCHED_ULE # ULE scheduler Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Jan 13 12:28:14 2009 (r187143) +++ head/sys/i386/conf/GENERIC Tue Jan 13 12:35:33 2009 (r187144) @@ -1,8 +1,8 @@ # # GENERIC -- Generic kernel configuration file for FreeBSD/i386 # -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # @@ -28,9 +28,9 @@ ident GENERIC # Use the following to compile in values accessible to the kernel # through getenv() (or kenv(1) in userland). The format of the file -# is 'variable=value' , same as for hints files. +# is 'variable=value', see kenv(1) # -# env "my_kenv_variables" +# env "GENERIC.env" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 12:37:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150731065686; Tue, 13 Jan 2009 12:37:03 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 035078FC1A; Tue, 13 Jan 2009 12:37:03 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DCb2eR003718; Tue, 13 Jan 2009 12:37:02 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DCb21g003717; Tue, 13 Jan 2009 12:37:02 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901131237.n0DCb21g003717@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 12:37: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: r187145 - head/bin/kenv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 12:37:03 -0000 Author: luigi Date: Tue Jan 13 12:37:02 2009 New Revision: 187145 URL: http://svn.freebsd.org/changeset/base/187145 Log: fix typo Submitted by: Colin Percival Modified: head/bin/kenv/kenv.1 Modified: head/bin/kenv/kenv.1 ============================================================================== --- head/bin/kenv/kenv.1 Tue Jan 13 12:35:33 2009 (r187144) +++ head/bin/kenv/kenv.1 Tue Jan 13 12:37:02 2009 (r187145) @@ -69,7 +69,7 @@ option is set, warnings normally printed perform the requested operation will be suppressed. .Pp Variables can be added to the kernel environment using the -.Xr /boot/oader.conf +.Xr /boot/loader.conf file, or also statically compiled into the kernel using the statement .Pp .Dl Ic env Ar filename From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 12:47:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA44B106564A; Tue, 13 Jan 2009 12:47:59 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C11EE8FC1E; Tue, 13 Jan 2009 12:47:59 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DClxq6003959; Tue, 13 Jan 2009 12:47:59 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DClxh7003958; Tue, 13 Jan 2009 12:47:59 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200901131247.n0DClxh7003958@svn.freebsd.org> From: Tom Rhodes Date: Tue, 13 Jan 2009 12: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: r187146 - head/share/examples/cvsup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 12:48:00 -0000 Author: trhodes Date: Tue Jan 13 12:47:59 2009 New Revision: 187146 URL: http://svn.freebsd.org/changeset/base/187146 Log: Fix broken URL and use the same base directory as the example files. PR: 123035 Submitted by: Lawrence Mayer (original version) Modified: head/share/examples/cvsup/refuse.README Modified: head/share/examples/cvsup/refuse.README ============================================================================== --- head/share/examples/cvsup/refuse.README Tue Jan 13 12:37:02 2009 (r187145) +++ head/share/examples/cvsup/refuse.README Tue Jan 13 12:47:59 2009 (r187146) @@ -12,8 +12,8 @@ everything beneath that directory will b You can copy "refuse" to your sup directory and add or remove whatever you like. The example supfiles in this directory set -CVSup's base directory to "/usr". The sup directory is in the base -directory; i.e., it is "/usr/sup". If you have changed your base +CVSup's base directory to "/var/db". The sup directory is in the base +directory; i.e., it is "/var/db/sup". If you have changed your base directory, your sup directory is /path/to/base/sup. This file used to contain /usr/src/etc/sendmail/freebsd.mc in case @@ -62,4 +62,4 @@ depend on files in completely different For more information about refuse files see cvsup(1), which is installed by the "cvsup" and "cvsup-bin" ports. See also the CVSup -FAQ at . +FAQ at . From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 13:19:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B92C1065672; Tue, 13 Jan 2009 13:19:42 +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 472E58FC08; Tue, 13 Jan 2009 13:19:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DDJgrK004620; Tue, 13 Jan 2009 13:19:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DDJgs8004619; Tue, 13 Jan 2009 13:19:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901131319.n0DDJgs8004619@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 13 Jan 2009 13:19:42 +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: r187147 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 13:19:42 -0000 Author: kib Date: Tue Jan 13 13:19:42 2009 New Revision: 187147 URL: http://svn.freebsd.org/changeset/base/187147 Log: Document that ffsll(3) and flsll(3) functions first appeared in FreeBSD 7.1 Submitted by: Jan Henrik Sylvester MFC after: 3 days Modified: head/lib/libc/string/ffs.3 Modified: head/lib/libc/string/ffs.3 ============================================================================== --- head/lib/libc/string/ffs.3 Tue Jan 13 12:47:59 2009 (r187146) +++ head/lib/libc/string/ffs.3 Tue Jan 13 13:19:42 2009 (r187147) @@ -108,4 +108,4 @@ The and .Fn flsll functions appeared in -.Fx 8.0 . +.Fx 7.1 . From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 15:24:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36F5A1065688; Tue, 13 Jan 2009 15:24:36 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242048FC1A; Tue, 13 Jan 2009 15:24:36 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DFOaMd007018; Tue, 13 Jan 2009 15:24:36 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DFOaXp007017; Tue, 13 Jan 2009 15:24:36 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200901131524.n0DFOaXp007017@svn.freebsd.org> From: Tom Rhodes Date: Tue, 13 Jan 2009 15:24: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: r187148 - head/bin/ln X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 15:24:37 -0000 Author: trhodes Date: Tue Jan 13 15:24:35 2009 New Revision: 187148 URL: http://svn.freebsd.org/changeset/base/187148 Log: Clean up a bit of confusing language and improve .Nd. PR: 47818 Reviewed by: keramida Modified: head/bin/ln/ln.1 Modified: head/bin/ln/ln.1 ============================================================================== --- head/bin/ln/ln.1 Tue Jan 13 13:19:42 2009 (r187147) +++ head/bin/ln/ln.1 Tue Jan 13 15:24:35 2009 (r187148) @@ -38,7 +38,7 @@ .Sh NAME .Nm ln , .Nm link -.Nd make links +.Nd link files .Sh SYNOPSIS .Nm .Op Fl s Op Fl F @@ -57,8 +57,13 @@ .Sh DESCRIPTION The .Nm -utility creates a new directory entry (linked file) which has the -same modes as the original file. +utility creates a new directory entry (linked file) for the file name +specified by +.Ar target_file . +The +.Ar target_file +will be created with the same file modes as the +.Ar source_file . It is useful for maintaining multiple copies of a file in many places at once without using up storage for the .Dq copies ; @@ -148,7 +153,7 @@ links. A hard link to a file is indistinguishable from the original directory entry; any changes to a file are effectively independent of the name used to reference the file. -Hard links may not normally refer to directories and may not span file systems. +Directories may not be hardlinked, and hard links may not span file systems. .Pp A symbolic link contains the name of the file to which it is linked. From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 15:41:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC9921065670; Tue, 13 Jan 2009 15:41:58 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D76798FC0C; Tue, 13 Jan 2009 15:41:58 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DFfwEJ007375; Tue, 13 Jan 2009 15:41:58 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DFfwhY007371; Tue, 13 Jan 2009 15:41:58 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200901131541.n0DFfwhY007371@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 13 Jan 2009 15:41: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: r187149 - in head/sys: conf powerpc/booke powerpc/include powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 15:42:00 -0000 Author: raj Date: Tue Jan 13 15:41:58 2009 New Revision: 187149 URL: http://svn.freebsd.org/changeset/base/187149 Log: Rework BookE pmap towards multi-core support. o Eliminate tlb0[] (a s/w copy of TLB0) - The table contents cannot be maintained reliably in multiple MMU environments, where asynchronous events (invalidations from other cores) can change our local TLB0 contents underneath. - Simplify and optimize TLB flushing: system wide invalidations are performed using tlbivax instruction (propagates to other cores), for local MMU invalidations a new optimized routine (assembly) is introduced. o Improve and simplify TID allocation and management. - Let each core keep track of its TID allocations. - Simplify TID recycling, eliminate dead code. - Drop the now unused powerpc/booke/support.S file. o Improve page tables management logic. o Simplify TLB1 manipulation routines. o Other improvements and polishing. Obtained from: Freescale, Semihalf Deleted: head/sys/powerpc/booke/support.S Modified: head/sys/conf/files.powerpc head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/pcpu.h head/sys/powerpc/include/pmap.h head/sys/powerpc/include/pte.h head/sys/powerpc/include/tlb.h head/sys/powerpc/powerpc/genassym.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Jan 13 15:24:35 2009 (r187148) +++ head/sys/conf/files.powerpc Tue Jan 13 15:41:58 2009 (r187149) @@ -84,7 +84,6 @@ powerpc/booke/interrupt.c optional e500 powerpc/booke/locore.S optional e500 no-obj powerpc/booke/machdep.c optional e500 powerpc/booke/pmap.c optional e500 -powerpc/booke/support.S optional e500 powerpc/booke/swtch.S optional e500 powerpc/booke/trap.c optional e500 powerpc/booke/uio_machdep.c optional e500 Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Tue Jan 13 15:24:35 2009 (r187148) +++ head/sys/powerpc/booke/locore.S Tue Jan 13 15:41:58 2009 (r187149) @@ -400,6 +400,87 @@ ivor_setup: blr /* + * void tid_flush(tlbtid_t tid); + * + * Invalidate all TLB0 entries which match the given TID. Note this is + * dedicated for cases when invalidation(s) should NOT be propagated to other + * CPUs. + * + * Global vars tlb0_ways, tlb0_entries_per_way are assumed to have been set up + * correctly (by tlb0_get_tlbconf()). + * + */ +ENTRY(tid_flush) + cmpwi %r3, TID_KERNEL + beq tid_flush_end /* don't evict kernel translations */ + + /* Number of TLB0 ways */ + lis %r4, tlb0_ways@h + ori %r4, %r4, tlb0_ways@l + lwz %r4, 0(%r4) + + /* Number of entries / way */ + lis %r5, tlb0_entries_per_way@h + ori %r5, %r5, tlb0_entries_per_way@l + lwz %r5, 0(%r5) + + /* Disable interrupts */ + mfmsr %r10 + wrteei 0 + + li %r6, 0 /* ways counter */ +loop_ways: + li %r7, 0 /* entries [per way] counter */ +loop_entries: + /* Select TLB0 and ESEL (way) */ + lis %r8, MAS0_TLBSEL0@h + rlwimi %r8, %r6, 16, 14, 15 + mtspr SPR_MAS0, %r8 + isync + + /* Select EPN (entry within the way) */ + rlwinm %r8, %r7, 12, 13, 19 + mtspr SPR_MAS2, %r8 + isync + tlbre + + /* Check if valid entry */ + mfspr %r8, SPR_MAS1 + andis. %r9, %r8, MAS1_VALID@h + beq next_entry /* invalid entry */ + + /* Check if this is our TID */ + rlwinm %r9, %r8, 16, 24, 31 + + cmplw %r9, %r3 + bne next_entry /* not our TID */ + + /* Clear VALID bit */ + rlwinm %r8, %r8, 0, 1, 31 + mtspr SPR_MAS1, %r8 + isync + tlbwe + isync + msync + +next_entry: + addi %r7, %r7, 1 + cmpw %r7, %r5 + bne loop_entries + + /* Next way */ + addi %r6, %r6, 1 + cmpw %r6, %r4 + bne loop_ways + + /* Restore MSR (possibly re-enable interrupts) */ + mtmsr %r10 + isync + +tid_flush_end: + blr + +/* * Cache disable/enable/inval sequences according * to section 2.16 of E500CORE RM. */ Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Tue Jan 13 15:24:35 2009 (r187148) +++ head/sys/powerpc/booke/machdep.c Tue Jan 13 15:41:58 2009 (r187149) @@ -490,6 +490,7 @@ void cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t sz) { + pcpu->pc_tid_next = TID_MIN; } /* Set set up registers on exec. */ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Jan 13 15:24:35 2009 (r187148) +++ head/sys/powerpc/booke/pmap.c Tue Jan 13 15:41:58 2009 (r187149) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2007 Semihalf, Rafal Jaworowski + * Copyright (C) 2007-2008 Semihalf, Rafal Jaworowski * Copyright (C) 2006 Semihalf, Marian Balakowicz * All rights reserved. * @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -118,6 +119,8 @@ int availmem_regions_sz; static vm_offset_t zero_page_va; static struct mtx zero_page_mutex; +static struct mtx tlbivax_mutex; + /* * Reserved KVA space for mmu_booke_zero_page_idle. This is used * by idle thred only, no lock required. @@ -148,55 +151,42 @@ static int pagedaemon_waken; #define PMAP_REMOVE_DONE(pmap) \ ((pmap) != kernel_pmap && (pmap)->pm_stats.resident_count == 0) -extern void load_pid0(tlbtid_t); +extern void tlb_lock(uint32_t *); +extern void tlb_unlock(uint32_t *); +extern void tid_flush(tlbtid_t); /**************************************************************************/ /* TLB and TID handling */ /**************************************************************************/ /* Translation ID busy table */ -static volatile pmap_t tidbusy[TID_MAX + 1]; +static volatile pmap_t tidbusy[MAXCPU][TID_MAX + 1]; /* - * Actual maximum number of TLB0 entries. - * This number differs between e500 core revisions. + * TLB0 capabilities (entry, way numbers etc.). These can vary between e500 + * core revisions and should be read from h/w registers during early config. */ -u_int32_t tlb0_size; -u_int32_t tlb0_nways; -u_int32_t tlb0_nentries_per_way; - -#define TLB0_SIZE (tlb0_size) -#define TLB0_NWAYS (tlb0_nways) -#define TLB0_ENTRIES_PER_WAY (tlb0_nentries_per_way) - -/* Pointer to kernel tlb0 table, allocated in mmu_booke_bootstrap() */ -tlb_entry_t *tlb0; +uint32_t tlb0_entries; +uint32_t tlb0_ways; +uint32_t tlb0_entries_per_way; -/* - * Spinlock to assure proper locking between threads and - * between tlb miss handler and kernel. - */ -static struct mtx tlb0_mutex; +#define TLB0_ENTRIES (tlb0_entries) +#define TLB0_WAYS (tlb0_ways) +#define TLB0_ENTRIES_PER_WAY (tlb0_entries_per_way) -#define TLB1_SIZE 16 +#define TLB1_ENTRIES 16 /* In-ram copy of the TLB1 */ -static tlb_entry_t tlb1[TLB1_SIZE]; +static tlb_entry_t tlb1[TLB1_ENTRIES]; /* Next free entry in the TLB1 */ static unsigned int tlb1_idx; static tlbtid_t tid_alloc(struct pmap *); -static void tid_flush(tlbtid_t); -extern void tlb1_inval_va(vm_offset_t); -extern void tlb0_inval_va(vm_offset_t); +static void tlb_print_entry(int, uint32_t, uint32_t, uint32_t, uint32_t); -static void tlb_print_entry(int, u_int32_t, u_int32_t, u_int32_t, u_int32_t); - -static int tlb1_set_entry(vm_offset_t, vm_offset_t, vm_size_t, u_int32_t); -static void __tlb1_set_entry(unsigned int, vm_offset_t, vm_offset_t, - vm_size_t, u_int32_t, unsigned int, unsigned int); +static int tlb1_set_entry(vm_offset_t, vm_offset_t, vm_size_t, uint32_t); static void tlb1_write_entry(unsigned int); static int tlb1_iomapped(int, vm_paddr_t, vm_size_t, vm_offset_t *); static vm_size_t tlb1_mapin_region(vm_offset_t, vm_offset_t, vm_size_t); @@ -207,11 +197,8 @@ static unsigned int ilog2(unsigned int); static void set_mas4_defaults(void); -static void tlb0_inval_entry(vm_offset_t, unsigned int); +static inline void tlb0_flush_entry(vm_offset_t); static inline unsigned int tlb0_tableidx(vm_offset_t, unsigned int); -static void tlb0_write_entry(unsigned int, unsigned int); -static void tlb0_flush_entry(pmap_t, vm_offset_t); -static void tlb0_init(void); /**************************************************************************/ /* Page table management */ @@ -233,17 +220,17 @@ static struct ptbl_buf *ptbl_buf_alloc(v static void ptbl_buf_free(struct ptbl_buf *); static void ptbl_free_pmap_ptbl(pmap_t, pte_t *); -static void ptbl_alloc(mmu_t, pmap_t, unsigned int); +static pte_t *ptbl_alloc(mmu_t, pmap_t, unsigned int); static void ptbl_free(mmu_t, pmap_t, unsigned int); static void ptbl_hold(mmu_t, pmap_t, unsigned int); static int ptbl_unhold(mmu_t, pmap_t, unsigned int); static vm_paddr_t pte_vatopa(mmu_t, pmap_t, vm_offset_t); static pte_t *pte_find(mmu_t, pmap_t, vm_offset_t); -void pte_enter(mmu_t, pmap_t, vm_page_t, vm_offset_t, u_int32_t); -static int pte_remove(mmu_t, pmap_t, vm_offset_t, u_int8_t); +static void pte_enter(mmu_t, pmap_t, vm_page_t, vm_offset_t, uint32_t); +static int pte_remove(mmu_t, pmap_t, vm_offset_t, uint8_t); -pv_entry_t pv_alloc(void); +static pv_entry_t pv_alloc(void); static void pv_free(pv_entry_t); static void pv_insert(pmap_t, vm_offset_t, vm_page_t); static void pv_remove(pmap_t, vm_offset_t, vm_page_t); @@ -384,9 +371,9 @@ tlb0_get_tlbconf(void) uint32_t tlb0_cfg; tlb0_cfg = mfspr(SPR_TLB0CFG); - tlb0_size = tlb0_cfg & TLBCFG_NENTRY_MASK; - tlb0_nways = (tlb0_cfg & TLBCFG_ASSOC_MASK) >> TLBCFG_ASSOC_SHIFT; - tlb0_nentries_per_way = tlb0_size/tlb0_nways; + tlb0_entries = tlb0_cfg & TLBCFG_NENTRY_MASK; + tlb0_ways = (tlb0_cfg & TLBCFG_ASSOC_MASK) >> TLBCFG_ASSOC_SHIFT; + tlb0_entries_per_way = tlb0_entries / tlb0_ways; } /* Initialize pool of kva ptbl buffers. */ @@ -434,54 +421,49 @@ static void ptbl_buf_free(struct ptbl_buf *buf) { - //debugf("ptbl_buf_free: s (buf = 0x%08x)\n", (u_int32_t)buf); + CTR2(KTR_PMAP, "%s: buf = %p", __func__, buf); mtx_lock(&ptbl_buf_freelist_lock); TAILQ_INSERT_TAIL(&ptbl_buf_freelist, buf, link); mtx_unlock(&ptbl_buf_freelist_lock); - - //debugf("ptbl_buf_free: e\n"); } /* - * Search the list of allocated ptbl bufs and find - * on list of allocated ptbls + * Search the list of allocated ptbl bufs and find on list of allocated ptbls */ static void ptbl_free_pmap_ptbl(pmap_t pmap, pte_t *ptbl) { struct ptbl_buf *pbuf; - //debugf("ptbl_free_pmap_ptbl: s (pmap = 0x%08x ptbl = 0x%08x)\n", - // (u_int32_t)pmap, (u_int32_t)ptbl); + CTR2(KTR_PMAP, "%s: ptbl = %p", __func__, ptbl); + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); - TAILQ_FOREACH(pbuf, &pmap->ptbl_list, link) { + TAILQ_FOREACH(pbuf, &pmap->pm_ptbl_list, link) if (pbuf->kva == (vm_offset_t)ptbl) { /* Remove from pmap ptbl buf list. */ - TAILQ_REMOVE(&pmap->ptbl_list, pbuf, link); + TAILQ_REMOVE(&pmap->pm_ptbl_list, pbuf, link); - /* Free correspondig ptbl buf. */ + /* Free corresponding ptbl buf. */ ptbl_buf_free(pbuf); - break; } - } - - //debugf("ptbl_free_pmap_ptbl: e\n"); } /* Allocate page table. */ -static void +static pte_t * ptbl_alloc(mmu_t mmu, pmap_t pmap, unsigned int pdir_idx) { vm_page_t mtbl[PTBL_PAGES]; vm_page_t m; struct ptbl_buf *pbuf; unsigned int pidx; + pte_t *ptbl; int i; - //int su = (pmap == kernel_pmap); - //debugf("ptbl_alloc: s (pmap = 0x%08x su = %d pdir_idx = %d)\n", (u_int32_t)pmap, su, pdir_idx); + CTR4(KTR_PMAP, "%s: pmap = %p su = %d pdir_idx = %d", __func__, pmap, + (pmap == kernel_pmap), pdir_idx); KASSERT((pdir_idx <= (VM_MAXUSER_ADDRESS / PDIR_SIZE)), ("ptbl_alloc: invalid pdir_idx")); @@ -491,13 +473,17 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, unsig pbuf = ptbl_buf_alloc(); if (pbuf == NULL) panic("pte_alloc: couldn't alloc kernel virtual memory"); - pmap->pm_pdir[pdir_idx] = (pte_t *)pbuf->kva; - //debugf("ptbl_alloc: kva = 0x%08x\n", (u_int32_t)pmap->pm_pdir[pdir_idx]); + + ptbl = (pte_t *)pbuf->kva; + + CTR2(KTR_PMAP, "%s: ptbl kva = %p", __func__, ptbl); /* Allocate ptbl pages, this will sleep! */ for (i = 0; i < PTBL_PAGES; i++) { pidx = (PTBL_PAGES * pdir_idx) + i; - while ((m = vm_page_alloc(NULL, pidx, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { + while ((m = vm_page_alloc(NULL, pidx, + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { + PMAP_UNLOCK(pmap); vm_page_unlock_queues(); VM_WAIT; @@ -507,16 +493,16 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, unsig mtbl[i] = m; } - /* Map in allocated pages into kernel_pmap. */ - mmu_booke_qenter(mmu, (vm_offset_t)pmap->pm_pdir[pdir_idx], mtbl, PTBL_PAGES); + /* Map allocated pages into kernel_pmap. */ + mmu_booke_qenter(mmu, (vm_offset_t)ptbl, mtbl, PTBL_PAGES); /* Zero whole ptbl. */ - bzero((caddr_t)pmap->pm_pdir[pdir_idx], PTBL_PAGES * PAGE_SIZE); + bzero((caddr_t)ptbl, PTBL_PAGES * PAGE_SIZE); /* Add pbuf to the pmap ptbl bufs list. */ - TAILQ_INSERT_TAIL(&pmap->ptbl_list, pbuf, link); + TAILQ_INSERT_TAIL(&pmap->pm_ptbl_list, pbuf, link); - //debugf("ptbl_alloc: e\n"); + return (ptbl); } /* Free ptbl pages and invalidate pdir entry. */ @@ -529,17 +515,28 @@ ptbl_free(mmu_t mmu, pmap_t pmap, unsign vm_page_t m; int i; - //int su = (pmap == kernel_pmap); - //debugf("ptbl_free: s (pmap = 0x%08x su = %d pdir_idx = %d)\n", (u_int32_t)pmap, su, pdir_idx); + CTR4(KTR_PMAP, "%s: pmap = %p su = %d pdir_idx = %d", __func__, pmap, + (pmap == kernel_pmap), pdir_idx); KASSERT((pdir_idx <= (VM_MAXUSER_ADDRESS / PDIR_SIZE)), ("ptbl_free: invalid pdir_idx")); ptbl = pmap->pm_pdir[pdir_idx]; - //debugf("ptbl_free: ptbl = 0x%08x\n", (u_int32_t)ptbl); + CTR2(KTR_PMAP, "%s: ptbl = %p", __func__, ptbl); + KASSERT((ptbl != NULL), ("ptbl_free: null ptbl")); + /* + * Invalidate the pdir entry as soon as possible, so that other CPUs + * don't attempt to look up the page tables we are releasing. + */ + mtx_lock_spin(&tlbivax_mutex); + + pmap->pm_pdir[pdir_idx] = NULL; + + mtx_unlock_spin(&tlbivax_mutex); + for (i = 0; i < PTBL_PAGES; i++) { va = ((vm_offset_t)ptbl + (i * PAGE_SIZE)); pa = pte_vatopa(mmu, kernel_pmap, va); @@ -550,9 +547,6 @@ ptbl_free(mmu_t mmu, pmap_t pmap, unsign } ptbl_free_pmap_ptbl(pmap, ptbl); - pmap->pm_pdir[pdir_idx] = NULL; - - //debugf("ptbl_free: e\n"); } /* @@ -776,8 +770,14 @@ pte_remove(mmu_t mmu, pmap_t pmap, vm_of } } + mtx_lock_spin(&tlbivax_mutex); + + tlb0_flush_entry(va); pte->flags = 0; pte->rpn = 0; + + mtx_unlock_spin(&tlbivax_mutex); + pmap->pm_stats.resident_count--; if (flags & PTBL_UNHOLD) { @@ -792,21 +792,23 @@ pte_remove(mmu_t mmu, pmap_t pmap, vm_of /* * Insert PTE for a given page and virtual address. */ -void -pte_enter(mmu_t mmu, pmap_t pmap, vm_page_t m, vm_offset_t va, u_int32_t flags) +static void +pte_enter(mmu_t mmu, pmap_t pmap, vm_page_t m, vm_offset_t va, uint32_t flags) { unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); - pte_t *ptbl; - pte_t *pte; + pte_t *ptbl, *pte; - //int su = (pmap == kernel_pmap); - //debugf("pte_enter: s (su = %d pmap = 0x%08x va = 0x%08x)\n", su, (u_int32_t)pmap, va); + CTR4(KTR_PMAP, "%s: su = %d pmap = %p va = %p", __func__, + pmap == kernel_pmap, pmap, va); /* Get the page table pointer. */ ptbl = pmap->pm_pdir[pdir_idx]; - if (ptbl) { + if (ptbl == NULL) { + /* Allocate page table pages. */ + ptbl = ptbl_alloc(mmu, pmap, pdir_idx); + } else { /* * Check if there is valid mapping for requested * va, if there is, remove it. @@ -822,36 +824,40 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_pag if (pmap != kernel_pmap) ptbl_hold(mmu, pmap, pdir_idx); } - } else { - /* Allocate page table pages. */ - ptbl_alloc(mmu, pmap, pdir_idx); } - /* Flush entry from TLB. */ - tlb0_flush_entry(pmap, va); - - pte = &(pmap->pm_pdir[pdir_idx][ptbl_idx]); - /* - * Insert pv_entry into pv_list for mapped page - * if part of managed memory. + * Insert pv_entry into pv_list for mapped page if part of managed + * memory. */ if ((m->flags & PG_FICTITIOUS) == 0) { if ((m->flags & PG_UNMANAGED) == 0) { - pte->flags |= PTE_MANAGED; + flags |= PTE_MANAGED; /* Create and insert pv entry. */ pv_insert(pmap, va, m); } } else { - pte->flags |= PTE_FAKE; + flags |= PTE_FAKE; } pmap->pm_stats.resident_count++; + + mtx_lock_spin(&tlbivax_mutex); + + tlb0_flush_entry(va); + if (pmap->pm_pdir[pdir_idx] == NULL) { + /* + * If we just allocated a new page table, hook it in + * the pdir. + */ + pmap->pm_pdir[pdir_idx] = ptbl; + } + pte = &(pmap->pm_pdir[pdir_idx][ptbl_idx]); pte->rpn = VM_PAGE_TO_PHYS(m) & ~PTE_PA_MASK; pte->flags |= (PTE_VALID | flags); - //debugf("pte_enter: e\n"); + mtx_unlock_spin(&tlbivax_mutex); } /* Return the pa for the given pmap/va. */ @@ -903,6 +909,12 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("mmu_booke_bootstrap: entered\n"); + /* Initialize invalidation mutex */ + mtx_init(&tlbivax_mutex, "tlbivax", NULL, MTX_SPIN); + + /* Read TLB0 size and associativity. */ + tlb0_get_tlbconf(); + /* Align kernel start and end address (kernel image). */ kernelstart = trunc_page(kernelstart); kernelend = round_page(kernelend); @@ -910,23 +922,15 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Allocate space for the message buffer. */ msgbufp = (struct msgbuf *)kernelend; kernelend += MSGBUF_SIZE; - debugf(" msgbufp at 0x%08x end = 0x%08x\n", (u_int32_t)msgbufp, + debugf(" msgbufp at 0x%08x end = 0x%08x\n", (uint32_t)msgbufp, kernelend); kernelend = round_page(kernelend); - /* Allocate space for tlb0 table. */ - tlb0_get_tlbconf(); /* Read TLB0 size and associativity. */ - tlb0 = (tlb_entry_t *)kernelend; - kernelend += sizeof(tlb_entry_t) * tlb0_size; - debugf(" tlb0 at 0x%08x end = 0x%08x\n", (u_int32_t)tlb0, kernelend); - - kernelend = round_page(kernelend); - /* Allocate space for ptbl_bufs. */ ptbl_bufs = (struct ptbl_buf *)kernelend; kernelend += sizeof(struct ptbl_buf) * PTBL_BUFS; - debugf(" ptbl_bufs at 0x%08x end = 0x%08x\n", (u_int32_t)ptbl_bufs, + debugf(" ptbl_bufs at 0x%08x end = 0x%08x\n", (uint32_t)ptbl_bufs, kernelend); kernelend = round_page(kernelend); @@ -937,8 +941,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset PDIR_SIZE - 1) / PDIR_SIZE; kernelend += kernel_ptbls * PTBL_PAGES * PAGE_SIZE; debugf(" kernel ptbls: %d\n", kernel_ptbls); - debugf(" kernel pdir at 0x%08x\n", kernel_pdir); + debugf(" kernel pdir at 0x%08x end = 0x%08x\n", kernel_pdir, kernelend); + debugf(" kernelend: 0x%08x\n", kernelend); if (kernelend - kernelstart > 0x1000000) { kernelend = (kernelend + 0x3fffff) & ~0x3fffff; tlb1_mapin_region(kernelstart + 0x1000000, @@ -946,12 +951,13 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset } else kernelend = (kernelend + 0xffffff) & ~0xffffff; + debugf(" updated kernelend: 0x%08x\n", kernelend); + /* * Clear the structures - note we can only do it safely after the - * possible additional TLB1 translations are in place so that + * possible additional TLB1 translations are in place (above) so that * all range up to the currently calculated 'kernelend' is covered. */ - memset((void *)tlb0, 0, sizeof(tlb_entry_t) * tlb0_size); memset((void *)ptbl_bufs, 0, sizeof(struct ptbl_buf) * PTBL_SIZE); memset((void *)kernel_pdir, 0, kernel_ptbls * PTBL_PAGES * PAGE_SIZE); @@ -970,25 +976,23 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset virtual_avail += PAGE_SIZE; copy_page_dst_va = virtual_avail; virtual_avail += PAGE_SIZE; + debugf("zero_page_va = 0x%08x\n", zero_page_va); + debugf("zero_page_idle_va = 0x%08x\n", zero_page_idle_va); + debugf("copy_page_src_va = 0x%08x\n", copy_page_src_va); + debugf("copy_page_dst_va = 0x%08x\n", copy_page_dst_va); /* Initialize page zero/copy mutexes. */ mtx_init(&zero_page_mutex, "mmu_booke_zero_page", NULL, MTX_DEF); mtx_init(©_page_mutex, "mmu_booke_copy_page", NULL, MTX_DEF); - /* Initialize tlb0 table mutex. */ - mtx_init(&tlb0_mutex, "tlb0", NULL, MTX_SPIN | MTX_RECURSE); - /* Allocate KVA space for ptbl bufs. */ ptbl_buf_pool_vabase = virtual_avail; virtual_avail += PTBL_BUFS * PTBL_PAGES * PAGE_SIZE; - - debugf("ptbl_buf_pool_vabase = 0x%08x\n", ptbl_buf_pool_vabase); - debugf("virtual_avail = %08x\n", virtual_avail); - debugf("virtual_end = %08x\n", virtual_end); + debugf("ptbl_buf_pool_vabase = 0x%08x end = 0x%08x\n", + ptbl_buf_pool_vabase, virtual_avail); /* Calculate corresponding physical addresses for the kernel region. */ phys_kernelend = kernload + (kernelend - kernelstart); - debugf("kernel image and allocated data:\n"); debugf(" kernload = 0x%08x\n", kernload); debugf(" kernelstart = 0x%08x\n", kernelstart); @@ -1125,8 +1129,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset PMAP_LOCK_INIT(kernel_pmap); kptbl_min = VM_MIN_KERNEL_ADDRESS / PDIR_SIZE; - debugf("kernel_pmap = 0x%08x\n", (u_int32_t)kernel_pmap); - debugf("kptbl_min = %d, kernel_kptbls = %d\n", kptbl_min, kernel_ptbls); + debugf("kernel_pmap = 0x%08x\n", (uint32_t)kernel_pmap); + debugf("kptbl_min = %d, kernel_ptbls = %d\n", kptbl_min, kernel_ptbls); debugf("kernel pdir range: 0x%08x - 0x%08x\n", kptbl_min * PDIR_SIZE, (kptbl_min + kernel_ptbls) * PDIR_SIZE - 1); @@ -1135,15 +1139,19 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset kernel_pmap->pm_pdir[kptbl_min + i] = (pte_t *)(kernel_pdir + (i * PAGE_SIZE * PTBL_PAGES)); - kernel_pmap->pm_tid = KERNEL_TID; + for (i = 0; i < MAXCPU; i++) { + kernel_pmap->pm_tid[i] = TID_KERNEL; + + /* Initialize each CPU's tidbusy entry 0 with kernel_pmap */ + tidbusy[i][0] = kernel_pmap; + } + /* Mark kernel_pmap active on all CPUs */ kernel_pmap->pm_active = ~0; - /* Initialize tidbusy with kenel_pmap entry. */ - tidbusy[0] = kernel_pmap; - /*******************************************************/ /* Final setup */ /*******************************************************/ + /* Enter kstack0 into kernel map, provide guard page */ kstack0 = virtual_avail + KSTACK_GUARD_PAGES * PAGE_SIZE; thread0.td_kstack = kstack0; @@ -1160,9 +1168,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset kstack0 += PAGE_SIZE; kstack0_phys += PAGE_SIZE; } - - /* Initialize TLB0 handling. */ - tlb0_init(); + + debugf("virtual_avail = %08x\n", virtual_avail); + debugf("virtual_end = %08x\n", virtual_end); debugf("mmu_booke_bootstrap: exit\n"); } @@ -1307,14 +1315,18 @@ mmu_booke_kenter(mmu_t mmu, vm_offset_t #endif flags |= (PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID); + flags |= PTE_M; pte = &(kernel_pmap->pm_pdir[pdir_idx][ptbl_idx]); + mtx_lock_spin(&tlbivax_mutex); + if (PTE_ISVALID(pte)) { - //debugf("mmu_booke_kenter: replacing entry!\n"); + + CTR1(KTR_PMAP, "%s: replacing entry!", __func__); /* Flush entry from TLB0 */ - tlb0_flush_entry(kernel_pmap, va); + tlb0_flush_entry(va); } pte->rpn = pa & ~PTE_PA_MASK; @@ -1329,7 +1341,7 @@ mmu_booke_kenter(mmu_t mmu, vm_offset_t __syncicache((void *)va, PAGE_SIZE); } - //debugf("mmu_booke_kenter: e\n"); + mtx_unlock_spin(&tlbivax_mutex); } /* @@ -1342,25 +1354,29 @@ mmu_booke_kremove(mmu_t mmu, vm_offset_t unsigned int ptbl_idx = PTBL_IDX(va); pte_t *pte; - //debugf("mmu_booke_kremove: s (va = 0x%08x)\n", va); +// CTR2(KTR_PMAP,("%s: s (va = 0x%08x)\n", __func__, va)); - KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)), + KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && + (va <= VM_MAX_KERNEL_ADDRESS)), ("mmu_booke_kremove: invalid va")); pte = &(kernel_pmap->pm_pdir[pdir_idx][ptbl_idx]); if (!PTE_ISVALID(pte)) { - //debugf("mmu_booke_kremove: e (invalid pte)\n"); + + CTR1(KTR_PMAP, "%s: invalid pte", __func__); + return; } - /* Invalidate entry in TLB0. */ - tlb0_flush_entry(kernel_pmap, va); + mtx_lock_spin(&tlbivax_mutex); + /* Invalidate entry in TLB0, update PTE. */ + tlb0_flush_entry(va); pte->flags = 0; pte->rpn = 0; - //debugf("mmu_booke_kremove: e\n"); + mtx_unlock_spin(&tlbivax_mutex); } /* @@ -1382,26 +1398,20 @@ mmu_booke_pinit0(mmu_t mmu, pmap_t pmap) static void mmu_booke_pinit(mmu_t mmu, pmap_t pmap) { + int i; - //struct thread *td; - //struct proc *p; - - //td = PCPU_GET(curthread); - //p = td->td_proc; - //debugf("mmu_booke_pinit: s (pmap = 0x%08x)\n", (u_int32_t)pmap); - //printf("mmu_booke_pinit: proc %d '%s'\n", p->p_pid, p->p_comm); + CTR4(KTR_PMAP, "%s: pmap = %p, proc %d '%s'", __func__, pmap, + curthread->td_proc->p_pid, curthread->td_proc->p_comm); - KASSERT((pmap != kernel_pmap), ("mmu_booke_pinit: initializing kernel_pmap")); + KASSERT((pmap != kernel_pmap), ("pmap_pinit: initializing kernel_pmap")); PMAP_LOCK_INIT(pmap); - pmap->pm_tid = 0; + for (i = 0; i < MAXCPU; i++) + pmap->pm_tid[i] = TID_NONE; pmap->pm_active = 0; bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); bzero(&pmap->pm_pdir, sizeof(pte_t *) * PDIR_NENTRIES); - - TAILQ_INIT(&pmap->ptbl_list); - - //debugf("mmu_booke_pinit: e\n"); + TAILQ_INIT(&pmap->pm_ptbl_list); } /* @@ -1478,53 +1488,76 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t */ if (((pte = pte_find(mmu, pmap, va)) != NULL) && (PTE_ISVALID(pte)) && (PTE_PA(pte) == pa)) { - - //debugf("mmu_booke_enter_locked: update\n"); + + /* + * Before actually updating pte->flags we calculate and + * prepare its new value in a helper var. + */ + flags = pte->flags; + flags &= ~(PTE_UW | PTE_UX | PTE_SW | PTE_SX | PTE_MODIFIED); /* Wiring change, just update stats. */ if (wired) { if (!PTE_ISWIRED(pte)) { - pte->flags |= PTE_WIRED; + flags |= PTE_WIRED; pmap->pm_stats.wired_count++; } } else { if (PTE_ISWIRED(pte)) { - pte->flags &= ~PTE_WIRED; + flags &= ~PTE_WIRED; pmap->pm_stats.wired_count--; } } - /* Save the old bits and clear the ones we're interested in. */ - flags = pte->flags; - pte->flags &= ~(PTE_UW | PTE_UX | PTE_SW | PTE_SX | PTE_MODIFIED); - if (prot & VM_PROT_WRITE) { /* Add write permissions. */ - pte->flags |= PTE_SW; + flags |= PTE_SW; if (!su) - pte->flags |= PTE_UW; + flags |= PTE_UW; } else { /* Handle modified pages, sense modify status. */ + + /* + * The PTE_MODIFIED flag could be set by underlying + * TLB misses since we last read it (above), possibly + * other CPUs could update it so we check in the PTE + * directly rather than rely on that saved local flags + * copy. + */ if (PTE_ISMODIFIED(pte)) vm_page_dirty(m); } - /* If we're turning on execute permissions, flush the icache. */ if (prot & VM_PROT_EXECUTE) { - pte->flags |= PTE_SX; + flags |= PTE_SX; if (!su) - pte->flags |= PTE_UX; + flags |= PTE_UX; + /* + * Check existing flags for execute permissions: if we + * are turning execute permissions on, icache should + * be flushed. + */ if ((flags & (PTE_UX | PTE_SX)) == 0) sync++; } - /* Flush the old mapping from TLB0. */ - pte->flags &= ~PTE_REFERENCED; - tlb0_flush_entry(pmap, va); + flags &= ~PTE_REFERENCED; + + /* + * The new flags value is all calculated -- only now actually + * update the PTE. + */ + mtx_lock_spin(&tlbivax_mutex); + + tlb0_flush_entry(va); + pte->flags = flags; + + mtx_unlock_spin(&tlbivax_mutex); + } else { /* - * If there is an existing mapping, but its for a different + * If there is an existing mapping, but it's for a different * physical address, pte_enter() will delete the old mapping. */ //if ((pte != NULL) && PTE_ISVALID(pte)) @@ -1534,6 +1567,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t /* Now set up the flags and install the new mapping. */ flags = (PTE_SR | PTE_VALID); + flags |= PTE_M; if (!su) flags |= PTE_UR; @@ -1576,7 +1610,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pte = pte_find(mmu, pmap, va); KASSERT(pte == NULL, ("%s:%d", __func__, __LINE__)); - flags = PTE_SR | PTE_VALID | PTE_UR; + flags = PTE_SR | PTE_VALID | PTE_UR | PTE_M; + pte_enter(mmu, pmap, m, va, flags); __syncicache((void *)va, PAGE_SIZE); pte_remove(mmu, pmap, va, PTBL_UNHOLD); @@ -1666,12 +1701,8 @@ mmu_booke_remove(mmu_t mmu, pmap_t pmap, PMAP_LOCK(pmap); for (; va < endva; va += PAGE_SIZE) { pte = pte_find(mmu, pmap, va); - if ((pte != NULL) && PTE_ISVALID(pte)) { + if ((pte != NULL) && PTE_ISVALID(pte)) pte_remove(mmu, pmap, va, hold_flag); - - /* Flush mapping from TLB0. */ - tlb0_flush_entry(pmap, va); - } } PMAP_UNLOCK(pmap); vm_page_unlock_queues(); @@ -1698,9 +1729,6 @@ mmu_booke_remove_all(mmu_t mmu, vm_page_ PMAP_LOCK(pv->pv_pmap); hold_flag = PTBL_HOLD_FLAG(pv->pv_pmap); pte_remove(mmu, pv->pv_pmap, pv->pv_va, hold_flag); - - /* Flush mapping from TLB0. */ - tlb0_flush_entry(pv->pv_pmap, pv->pv_va); PMAP_UNLOCK(pv->pv_pmap); } vm_page_flag_clear(m, PG_WRITEABLE); @@ -1749,26 +1777,27 @@ mmu_booke_activate(mmu_t mmu, struct thr pmap = &td->td_proc->p_vmspace->vm_pmap; - //debugf("mmu_booke_activate: s (proc = '%s', id = %d, pmap = 0x%08x)\n", - // td->td_proc->p_comm, td->td_proc->p_pid, pmap); + CTR5(KTR_PMAP, "%s: s (td = %p, proc = '%s', id = %d, pmap = 0x%08x)", + __func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap); KASSERT((pmap != kernel_pmap), ("mmu_booke_activate: kernel_pmap!")); mtx_lock_spin(&sched_lock); - pmap->pm_active |= PCPU_GET(cpumask); + atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask)); PCPU_SET(curpmap, pmap); - - if (!pmap->pm_tid) + + if (pmap->pm_tid[PCPU_GET(cpuid)] == TID_NONE) tid_alloc(pmap); /* Load PID0 register with pmap tid value. */ - load_pid0(pmap->pm_tid); + mtspr(SPR_PID0, pmap->pm_tid[PCPU_GET(cpuid)]); + __asm __volatile("isync"); mtx_unlock_spin(&sched_lock); - //debugf("mmu_booke_activate: e (tid = %d for '%s')\n", pmap->pm_tid, - // td->td_proc->p_comm); + CTR3(KTR_PMAP, "%s: e (tid = %d for '%s')", __func__, + pmap->pm_tid[PCPU_GET(cpuid)], td->td_proc->p_comm); } /* @@ -1780,7 +1809,11 @@ mmu_booke_deactivate(mmu_t mmu, struct t pmap_t pmap; pmap = &td->td_proc->p_vmspace->vm_pmap; - pmap->pm_active &= ~(PCPU_GET(cpumask)); + + CTR5(KTR_PMAP, "%s: td=%p, proc = '%s', id = %d, pmap = 0x%08x", + __func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap); + + atomic_clear_int(&pmap->pm_active, PCPU_GET(cpumask)); PCPU_SET(curpmap, NULL); } @@ -1824,6 +1857,8 @@ mmu_booke_protect(mmu_t mmu, pmap_t pmap if (PTE_ISVALID(pte)) { m = PHYS_TO_VM_PAGE(PTE_PA(pte)); + mtx_lock_spin(&tlbivax_mutex); + /* Handle modified pages. */ if (PTE_ISMODIFIED(pte)) vm_page_dirty(m); @@ -1832,10 +1867,11 @@ mmu_booke_protect(mmu_t mmu, pmap_t pmap if (PTE_ISREFERENCED(pte)) vm_page_flag_set(m, PG_REFERENCED); - /* Flush mapping from TLB0. */ + tlb0_flush_entry(va); pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED | PTE_REFERENCED); - tlb0_flush_entry(pmap, va); + + mtx_unlock_spin(&tlbivax_mutex); } } } @@ -1863,6 +1899,8 @@ mmu_booke_remove_write(mmu_t mmu, vm_pag if (PTE_ISVALID(pte)) { m = PHYS_TO_VM_PAGE(PTE_PA(pte)); + mtx_lock_spin(&tlbivax_mutex); + /* Handle modified pages. */ if (PTE_ISMODIFIED(pte)) vm_page_dirty(m); @@ -1874,7 +1912,8 @@ mmu_booke_remove_write(mmu_t mmu, vm_pag /* Flush mapping from TLB0. */ pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED | PTE_REFERENCED); - tlb0_flush_entry(pv->pv_pmap, pv->pv_va); + + mtx_unlock_spin(&tlbivax_mutex); } } PMAP_UNLOCK(pv->pv_pmap); @@ -1996,21 +2035,16 @@ mmu_booke_copy_page(mmu_t mmu, vm_page_t { vm_offset_t sva, dva; - //debugf("mmu_booke_copy_page: s\n"); - - mtx_lock(©_page_mutex); sva = copy_page_src_va; dva = copy_page_dst_va; + mtx_lock(©_page_mutex); mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); mmu_booke_kremove(mmu, dva); mmu_booke_kremove(mmu, sva); - mtx_unlock(©_page_mutex); - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 15:56:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EA061065764; Tue, 13 Jan 2009 15:56:54 +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 F01908FC0A; Tue, 13 Jan 2009 15:56:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DFurwg007715; Tue, 13 Jan 2009 15:56:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DFurj7007714; Tue, 13 Jan 2009 15:56:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901131556.n0DFurj7007714@svn.freebsd.org> From: John Baldwin Date: Tue, 13 Jan 2009 15:56: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: r187150 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 15:56:54 -0000 Author: jhb Date: Tue Jan 13 15:56:53 2009 New Revision: 187150 URL: http://svn.freebsd.org/changeset/base/187150 Log: Add a new KTR tracepoint in the KTR_CALLOUT class to note when a callout routine finishes executing. MFC after: 1 week Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Jan 13 15:41:58 2009 (r187149) +++ head/sys/kern/kern_timeout.c Tue Jan 13 15:56:53 2009 (r187150) @@ -414,6 +414,7 @@ softclock(void *arg) lastfunc = c_func; } #endif + CTR1(KTR_CALLOUT, "callout %p finished", c); if ((c_flags & CALLOUT_RETURNUNLOCKED) == 0) class->lc_unlock(c_lock); skip: From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 16:15:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93210106564A; Tue, 13 Jan 2009 16:15:49 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F0898FC12; Tue, 13 Jan 2009 16:15:49 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DGFnxR008183; Tue, 13 Jan 2009 16:15:49 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DGFnuC008182; Tue, 13 Jan 2009 16:15:49 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200901131615.n0DGFnuC008182@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 13 Jan 2009 16:15: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: r187151 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 16:15:50 -0000 Author: raj Date: Tue Jan 13 16:15:49 2009 New Revision: 187151 URL: http://svn.freebsd.org/changeset/base/187151 Log: Clean up BookE pmap. Improve comments, eliminate redundant debug output, fix style(9) and other minor tweaks for code readability. Obtained from: Freescale, Semihalf Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Jan 13 15:56:53 2009 (r187150) +++ head/sys/powerpc/booke/pmap.c Tue Jan 13 16:15:49 2009 (r187151) @@ -11,8 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -38,15 +36,16 @@ * * Virtual address space layout: * ----------------------------- - * 0x0000_0000 - 0xbfff_efff : user process - * 0xc000_0000 - 0xc1ff_ffff : kernel reserved - * 0xc000_0000 - kernelend : kernel code &data - * 0xc1ff_c000 - 0xc200_0000 : kstack0 - * 0xc200_0000 - 0xffef_ffff : KVA - * 0xc200_0000 - 0xc200_3fff : reserved for page zero/copy - * 0xc200_4000 - ptbl buf end: reserved for ptbl bufs - * ptbl buf end- 0xffef_ffff : actual free KVA space - * 0xfff0_0000 - 0xffff_ffff : I/O devices region + * 0x0000_0000 - 0xafff_ffff : user process + * 0xb000_0000 - 0xbfff_ffff : pmap_mapdev()-ed area (PCI/PCIE etc.) + * 0xc000_0000 - 0xc0ff_ffff : kernel reserved + * 0xc000_0000 - kernelend : kernel code+data, env, metadata etc. + * 0xc100_0000 - 0xfeef_ffff : KVA + * 0xc100_0000 - 0xc100_3fff : reserved for page zero/copy + * 0xc100_4000 - 0xc200_3fff : reserved for ptbl bufs + * 0xc200_4000 - 0xc200_8fff : guard page + kstack0 + * 0xc200_9000 - 0xfeef_ffff : actual free KVA space + * 0xfef0_0000 - 0xffff_ffff : I/O devices region */ #include @@ -382,10 +381,10 @@ ptbl_init(void) { int i; - //debugf("ptbl_init: s (ptbl_bufs = 0x%08x size 0x%08x)\n", - // (u_int32_t)ptbl_bufs, sizeof(struct ptbl_buf) * PTBL_BUFS); - //debugf("ptbl_init: s (ptbl_buf_pool_vabase = 0x%08x size = 0x%08x)\n", - // ptbl_buf_pool_vabase, PTBL_BUFS * PTBL_PAGES * PAGE_SIZE); + CTR3(KTR_PMAP, "%s: s (ptbl_bufs = 0x%08x size 0x%08x)", __func__, + (uint32_t)ptbl_bufs, sizeof(struct ptbl_buf) * PTBL_BUFS); + CTR3(KTR_PMAP, "%s: s (ptbl_buf_pool_vabase = 0x%08x size = 0x%08x)", + __func__, ptbl_buf_pool_vabase, PTBL_BUFS * PTBL_PAGES * PAGE_SIZE); mtx_init(&ptbl_buf_freelist_lock, "ptbl bufs lock", NULL, MTX_DEF); TAILQ_INIT(&ptbl_buf_freelist); @@ -394,8 +393,6 @@ ptbl_init(void) ptbl_bufs[i].kva = ptbl_buf_pool_vabase + i * PTBL_PAGES * PAGE_SIZE; TAILQ_INSERT_TAIL(&ptbl_buf_freelist, &ptbl_bufs[i], link); } - - //debugf("ptbl_init: e\n"); } /* Get a ptbl_buf from the freelist. */ @@ -404,15 +401,14 @@ ptbl_buf_alloc(void) { struct ptbl_buf *buf; - //debugf("ptbl_buf_alloc: s\n"); - mtx_lock(&ptbl_buf_freelist_lock); buf = TAILQ_FIRST(&ptbl_buf_freelist); if (buf != NULL) TAILQ_REMOVE(&ptbl_buf_freelist, buf, link); mtx_unlock(&ptbl_buf_freelist_lock); - //debugf("ptbl_buf_alloc: e (buf = 0x%08x)\n", (u_int32_t)buf); + CTR2(KTR_PMAP, "%s: buf = %p", __func__, buf); + return (buf); } @@ -563,9 +559,8 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, unsi vm_page_t m; int i; - //int su = (pmap == kernel_pmap); - //debugf("ptbl_unhold: s (pmap = %08x su = %d pdir_idx = %d)\n", - // (u_int32_t)pmap, su, pdir_idx); + CTR4(KTR_PMAP, "%s: pmap = %p su = %d pdir_idx = %d", __func__, pmap, + (pmap == kernel_pmap), pdir_idx); KASSERT((pdir_idx <= (VM_MAXUSER_ADDRESS / PDIR_SIZE)), ("ptbl_unhold: invalid pdir_idx")); @@ -580,15 +575,16 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, unsi /* decrement hold count */ for (i = 0; i < PTBL_PAGES; i++) { - pa = pte_vatopa(mmu, kernel_pmap, (vm_offset_t)ptbl + (i * PAGE_SIZE)); + pa = pte_vatopa(mmu, kernel_pmap, + (vm_offset_t)ptbl + (i * PAGE_SIZE)); m = PHYS_TO_VM_PAGE(pa); m->wire_count--; } /* * Free ptbl pages if there are no pte etries in this ptbl. - * wire_count has the same value for all ptbl pages, so check - * the last page. + * wire_count has the same value for all ptbl pages, so check the last + * page. */ if (m->wire_count == 0) { ptbl_free(mmu, pmap, pdir_idx); @@ -597,13 +593,12 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, unsi return (1); } - //debugf("ptbl_unhold: e\n"); return (0); } /* - * Increment hold count for ptbl pages. This routine is used when - * new pte entry is being inserted into ptbl. + * Increment hold count for ptbl pages. This routine is used when a new pte + * entry is being inserted into the ptbl. */ static void ptbl_hold(mmu_t mmu, pmap_t pmap, unsigned int pdir_idx) @@ -613,7 +608,8 @@ ptbl_hold(mmu_t mmu, pmap_t pmap, unsign vm_page_t m; int i; - //debugf("ptbl_hold: s (pmap = 0x%08x pdir_idx = %d)\n", (u_int32_t)pmap, pdir_idx); + CTR3(KTR_PMAP, "%s: pmap = %p pdir_idx = %d", __func__, pmap, + pdir_idx); KASSERT((pdir_idx <= (VM_MAXUSER_ADDRESS / PDIR_SIZE)), ("ptbl_hold: invalid pdir_idx")); @@ -625,12 +621,11 @@ ptbl_hold(mmu_t mmu, pmap_t pmap, unsign KASSERT((ptbl != NULL), ("ptbl_hold: null ptbl")); for (i = 0; i < PTBL_PAGES; i++) { - pa = pte_vatopa(mmu, kernel_pmap, (vm_offset_t)ptbl + (i * PAGE_SIZE)); + pa = pte_vatopa(mmu, kernel_pmap, + (vm_offset_t)ptbl + (i * PAGE_SIZE)); m = PHYS_TO_VM_PAGE(pa); m->wire_count++; } - - //debugf("ptbl_hold: e\n"); } /* Allocate pv_entry structure. */ @@ -639,16 +634,14 @@ pv_alloc(void) { pv_entry_t pv; - debugf("pv_alloc: s\n"); - pv_entry_count++; - if ((pv_entry_count > pv_entry_high_water) && (pagedaemon_waken == 0)) { + if ((pv_entry_count > pv_entry_high_water) && + (pagedaemon_waken == 0)) { pagedaemon_waken = 1; - wakeup (&vm_pages_needed); + wakeup(&vm_pages_needed); } pv = uma_zalloc(pvzone, M_NOWAIT); - debugf("pv_alloc: e\n"); return (pv); } @@ -656,12 +649,9 @@ pv_alloc(void) static __inline void pv_free(pv_entry_t pve) { - //debugf("pv_free: s\n"); pv_entry_count--; uma_zfree(pvzone, pve); - - //debugf("pv_free: e\n"); } @@ -713,7 +703,6 @@ pv_remove(pmap_t pmap, vm_offset_t va, v /* free pv entry struct */ pv_free(pve); - break; } } @@ -727,7 +716,7 @@ pv_remove(pmap_t pmap, vm_offset_t va, v * Return 1 if ptbl pages were freed, otherwise return 0. */ static int -pte_remove(mmu_t mmu, pmap_t pmap, vm_offset_t va, u_int8_t flags) +pte_remove(mmu_t mmu, pmap_t pmap, vm_offset_t va, uint8_t flags) { unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); @@ -1003,10 +992,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset panic("mmu_booke_bootstrap: phys_avail too small"); /* - * Removed kernel physical address range from avail - * regions list. Page align all regions. - * Non-page aligned memory isn't very interesting to us. - * Also, sort the entries for ascending addresses. + * Remove kernel physical address range from avail regions list. Page + * align all regions. Non-page aligned memory isn't very interesting + * to us. Also, sort the entries for ascending addresses. */ sz = 0; cnt = availmem_regions_sz; @@ -1089,7 +1077,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", availmem_regions[i].mr_start, - availmem_regions[i].mr_start + availmem_regions[i].mr_size, + availmem_regions[i].mr_start + + availmem_regions[i].mr_size, availmem_regions[i].mr_size); if (hwphyssz != 0 && @@ -1121,7 +1110,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("Maxmem = 0x%08lx\n", Maxmem); debugf("phys_avail_count = %d\n", phys_avail_count); - debugf("physsz = 0x%08x physmem = %ld (0x%08lx)\n", physsz, physmem, physmem); + debugf("physsz = 0x%08x physmem = %ld (0x%08lx)\n", physsz, physmem, + physmem); /*******************************************************/ /* Initialize (statically allocated) kernel pmap. */ @@ -1211,8 +1201,6 @@ mmu_booke_init(mmu_t mmu) { int shpgperproc = PMAP_SHPGPERPROC; - //debugf("mmu_booke_init: s\n"); - /* * Initialize the address space (zone) for the pv entries. Set a * high water mark so that the system can recover from excessive @@ -1234,8 +1222,6 @@ mmu_booke_init(mmu_t mmu) /* Initialize ptbl allocation. */ ptbl_init(); - - //debugf("mmu_booke_init: e\n"); } /* @@ -1248,16 +1234,12 @@ mmu_booke_qenter(mmu_t mmu, vm_offset_t { vm_offset_t va; - //debugf("mmu_booke_qenter: s (sva = 0x%08x count = %d)\n", sva, count); - va = sva; while (count-- > 0) { mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(*m)); va += PAGE_SIZE; m++; } - - //debugf("mmu_booke_qenter: e\n"); } /* @@ -1269,15 +1251,11 @@ mmu_booke_qremove(mmu_t mmu, vm_offset_t { vm_offset_t va; - //debugf("mmu_booke_qremove: s (sva = 0x%08x count = %d)\n", sva, count); - va = sva; while (count-- > 0) { mmu_booke_kremove(mmu, va); va += PAGE_SIZE; } - - //debugf("mmu_booke_qremove: e\n"); } /* @@ -1288,14 +1266,11 @@ mmu_booke_kenter(mmu_t mmu, vm_offset_t { unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); - u_int32_t flags; + uint32_t flags; pte_t *pte; - //debugf("mmu_booke_kenter: s (pdir_idx = %d ptbl_idx = %d va=0x%08x pa=0x%08x)\n", - // pdir_idx, ptbl_idx, va, pa); - - KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)), - ("mmu_booke_kenter: invalid va")); + KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && + (va <= VM_MAX_KERNEL_ADDRESS)), ("mmu_booke_kenter: invalid va")); #if 0 /* assume IO mapping, set I, G bits */ @@ -1385,10 +1360,9 @@ mmu_booke_kremove(mmu_t mmu, vm_offset_t static void mmu_booke_pinit0(mmu_t mmu, pmap_t pmap) { - //debugf("mmu_booke_pinit0: s (pmap = 0x%08x)\n", (u_int32_t)pmap); + mmu_booke_pinit(mmu, pmap); PCPU_SET(curpmap, pmap); - //debugf("mmu_booke_pinit0: e\n"); } /* @@ -1423,11 +1397,13 @@ static void mmu_booke_release(mmu_t mmu, pmap_t pmap) { - //debugf("mmu_booke_release: s\n"); + printf("mmu_booke_release: s\n"); - PMAP_LOCK_DESTROY(pmap); + KASSERT(pmap->pm_stats.resident_count == 0, + ("pmap_release: pmap resident count %ld != 0", + pmap->pm_stats.resident_count)); - //debugf("mmu_booke_release: e\n"); + PMAP_LOCK_DESTROY(pmap); } #if 0 @@ -1447,6 +1423,7 @@ static void mmu_booke_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t wired) { + vm_page_lock_queues(); PMAP_LOCK(pmap); mmu_booke_enter_locked(mmu, pmap, va, m, prot, wired); @@ -1460,7 +1437,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t { pte_t *pte; vm_paddr_t pa; - u_int32_t flags; + uint32_t flags; int su, sync; pa = VM_PAGE_TO_PHYS(m); @@ -1473,11 +1450,12 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t // (u_int32_t)m, va, pa, prot, wired); if (su) { - KASSERT(((va >= virtual_avail) && (va <= VM_MAX_KERNEL_ADDRESS)), - ("mmu_booke_enter_locked: kernel pmap, non kernel va")); + KASSERT(((va >= virtual_avail) && + (va <= VM_MAX_KERNEL_ADDRESS)), + ("mmu_booke_enter_locked: kernel pmap, non kernel va")); } else { KASSERT((va <= VM_MAXUSER_ADDRESS), - ("mmu_booke_enter_locked: user pmap, non user va")); + ("mmu_booke_enter_locked: user pmap, non user va")); } PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -1616,8 +1594,6 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t __syncicache((void *)va, PAGE_SIZE); pte_remove(mmu, pmap, va, PTBL_UNHOLD); } - - //debugf("mmu_booke_enter_locked: e\n"); } /* @@ -1643,8 +1619,8 @@ mmu_booke_enter_object(mmu_t mmu, pmap_t m = m_start; PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { - mmu_booke_enter_locked(mmu, pmap, start + ptoa(diff), m, prot & - (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); + mmu_booke_enter_locked(mmu, pmap, start + ptoa(diff), m, + prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } PMAP_UNLOCK(pmap); @@ -1655,14 +1631,10 @@ mmu_booke_enter_quick(mmu_t mmu, pmap_t vm_prot_t prot) { - //debugf("mmu_booke_enter_quick: s\n"); - PMAP_LOCK(pmap); mmu_booke_enter_locked(mmu, pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); PMAP_UNLOCK(pmap); - - //debugf("mmu_booke_enter_quick e\n"); } /* @@ -1674,7 +1646,7 @@ static void mmu_booke_remove(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_offset_t endva) { pte_t *pte; - u_int8_t hold_flag; + uint8_t hold_flag; int su = (pmap == kernel_pmap); @@ -1682,11 +1654,12 @@ mmu_booke_remove(mmu_t mmu, pmap_t pmap, // su, (u_int32_t)pmap, pmap->pm_tid, va, endva); if (su) { - KASSERT(((va >= virtual_avail) && (va <= VM_MAX_KERNEL_ADDRESS)), - ("mmu_booke_enter: kernel pmap, non kernel va")); + KASSERT(((va >= virtual_avail) && + (va <= VM_MAX_KERNEL_ADDRESS)), + ("mmu_booke_remove: kernel pmap, non kernel va")); } else { KASSERT((va <= VM_MAXUSER_ADDRESS), - ("mmu_booke_enter: user pmap, non user va")); + ("mmu_booke_remove: user pmap, non user va")); } if (PMAP_REMOVE_DONE(pmap)) { @@ -1717,9 +1690,7 @@ static void mmu_booke_remove_all(mmu_t mmu, vm_page_t m) { pv_entry_t pv, pvn; - u_int8_t hold_flag; - - //debugf("mmu_booke_remove_all: s\n"); + uint8_t hold_flag; mtx_assert(&vm_page_queue_mtx, MA_OWNED); @@ -1732,18 +1703,10 @@ mmu_booke_remove_all(mmu_t mmu, vm_page_ PMAP_UNLOCK(pv->pv_pmap); } vm_page_flag_clear(m, PG_WRITEABLE); - - //debugf("mmu_booke_remove_all: e\n"); } /* * Map a range of physical addresses into kernel virtual address space. - * - * The value passed in *virt is a suggested virtual address for the mapping. - * Architectures which can support a direct-mapped physical to virtual region - * can return the appropriate address within that region, leaving '*virt' - * unchanged. We cannot and therefore do not; *virt is updated with the - * first usable address after the mapped region. */ static vm_offset_t mmu_booke_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, @@ -1953,13 +1916,13 @@ mmu_booke_extract_and_hold(mmu_t mmu, pm { pte_t *pte; vm_page_t m; - u_int32_t pte_wbit; + uint32_t pte_wbit; m = NULL; vm_page_lock_queues(); PMAP_LOCK(pmap); - pte = pte_find(mmu, pmap, va); + pte = pte_find(mmu, pmap, va); if ((pte != NULL) && PTE_ISVALID(pte)) { if (pmap == kernel_pmap) pte_wbit = PTE_SW; @@ -1999,7 +1962,7 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_p { vm_offset_t va; - //debugf("mmu_booke_zero_page_area: s\n"); + /* XXX KASSERT off and size are within a single page? */ mtx_lock(&zero_page_mutex); va = zero_page_va; @@ -2009,8 +1972,6 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_p mmu_booke_kremove(mmu, va); mtx_unlock(&zero_page_mutex); - - //debugf("mmu_booke_zero_page_area: e\n"); } /* @@ -2020,9 +1981,7 @@ static void mmu_booke_zero_page(mmu_t mmu, vm_page_t m) { - //debugf("mmu_booke_zero_page: s\n"); mmu_booke_zero_page_area(mmu, m, 0, PAGE_SIZE); - //debugf("mmu_booke_zero_page: e\n"); } /* @@ -2070,14 +2029,10 @@ mmu_booke_zero_page_idle(mmu_t mmu, vm_p { vm_offset_t va; - //debugf("mmu_booke_zero_page_idle: s\n"); - va = zero_page_idle_va; mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); bzero((caddr_t)va, PAGE_SIZE); mmu_booke_kremove(mmu, va); - - //debugf("mmu_booke_zero_page_idle: e\n"); } /* @@ -2112,7 +2067,7 @@ make_sure_to_unlock: } /* - * Return whether or not the specified virtual address is elgible + * Return whether or not the specified virtual address is eligible * for prefault. */ static boolean_t @@ -2280,7 +2235,6 @@ mmu_booke_page_exists_quick(mmu_t mmu, p loops = 0; TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { - if (pv->pv_pmap == pmap) return (TRUE); @@ -2371,8 +2325,6 @@ mmu_booke_unmapdev(mmu_t mmu, vm_offset_ { vm_offset_t base, offset; - //debugf("mmu_booke_unmapdev: s (va = 0x%08x)\n", va); - /* * Unmap only if this is inside kernel virtual space. */ @@ -2382,19 +2334,18 @@ mmu_booke_unmapdev(mmu_t mmu, vm_offset_ size = roundup(offset + size, PAGE_SIZE); kmem_free(kernel_map, base, size); } - - //debugf("mmu_booke_unmapdev: e\n"); } /* - * mmu_booke_object_init_pt preloads the ptes for a given object - * into the specified pmap. This eliminates the blast of soft - * faults on process startup and immediately after an mmap. + * mmu_booke_object_init_pt preloads the ptes for a given object into the + * specified pmap. This eliminates the blast of soft faults on process startup + * and immediately after an mmap. */ static void mmu_booke_object_init_pt(mmu_t mmu, pmap_t pmap, vm_offset_t addr, vm_object_t object, vm_pindex_t pindex, vm_size_t size) { + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); KASSERT(object->type == OBJT_DEVICE, ("mmu_booke_object_init_pt: non-device object")); @@ -2575,7 +2526,7 @@ tlb0_print_tlbentries(void) static void tlb1_write_entry(unsigned int idx) { - u_int32_t mas0, mas7; + uint32_t mas0, mas7; //debugf("tlb1_write_entry: s\n"); @@ -2587,15 +2538,15 @@ tlb1_write_entry(unsigned int idx) //debugf("tlb1_write_entry: mas0 = 0x%08x\n", mas0); mtspr(SPR_MAS0, mas0); - __asm volatile("isync"); + __asm __volatile("isync"); mtspr(SPR_MAS1, tlb1[idx].mas1); - __asm volatile("isync"); + __asm __volatile("isync"); mtspr(SPR_MAS2, tlb1[idx].mas2); - __asm volatile("isync"); + __asm __volatile("isync"); mtspr(SPR_MAS3, tlb1[idx].mas3); - __asm volatile("isync"); + __asm __volatile("isync"); mtspr(SPR_MAS7, mas7); - __asm volatile("isync; tlbwe; isync; msync"); + __asm __volatile("isync; tlbwe; isync; msync"); //debugf("tlb1_write_entry: e\n");; } @@ -2700,10 +2651,10 @@ tlb1_entry_size_cmp(const void *a, const } /* - * Mapin contiguous RAM region into the TLB1 using maximum of + * Map in contiguous RAM region into the TLB1 using maximum of * KERNEL_REGION_MAX_TLB_ENTRIES entries. * - * If necessarry round up last entry size and return total size + * If necessary round up last entry size and return total size * used by all allocated entries. */ vm_size_t @@ -2714,8 +2665,8 @@ tlb1_mapin_region(vm_offset_t va, vm_off unsigned int log; int i; - debugf("tlb1_mapin_region:\n"); - debugf(" region size = 0x%08x va = 0x%08x pa = 0x%08x\n", size, va, pa); + CTR4(KTR_PMAP, "%s: region size = 0x%08x va = 0x%08x pa = 0x%08x", + __func__, size, va, pa); mapped_size = 0; sz = size; @@ -2751,16 +2702,18 @@ tlb1_mapin_region(vm_offset_t va, vm_off esz = entry_size[i]; if (!esz) break; - debugf(" entry %d: sz = 0x%08x (va = 0x%08x pa = 0x%08x)\n", - tlb1_idx, esz, va, pa); + + CTR5(KTR_PMAP, "%s: entry %d: sz = 0x%08x (va = 0x%08x " + "pa = 0x%08x)", __func__, tlb1_idx, esz, va, pa); + tlb1_set_entry(va, pa, esz, _TLB_ENTRY_MEM); va += esz; pa += esz; } - debugf(" mapped size 0x%08x (wasted space 0x%08x)\n", - mapped_size, mapped_size - size); + CTR3(KTR_PMAP, "%s: mapped size 0x%08x (wasted space 0x%08x)", + __func__, mapped_size, mapped_size - size); return (mapped_size); } @@ -2774,7 +2727,7 @@ tlb1_init(vm_offset_t ccsrbar) { uint32_t mas0; - /* TBL1[1] is used to map the kernel. Save that entry. */ + /* TLB1[1] is used to map the kernel. Save that entry. */ mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(1); mtspr(SPR_MAS0, mas0); __asm __volatile("isync; tlbre"); @@ -2804,14 +2757,14 @@ tlb1_init(vm_offset_t ccsrbar) static void set_mas4_defaults(void) { - u_int32_t mas4; + uint32_t mas4; /* Defaults: TLB0, PID0, TSIZED=4K */ mas4 = MAS4_TLBSELD0; mas4 |= (TLB_SIZE_4K << MAS4_TSIZED_SHIFT) & MAS4_TSIZED_MASK; mtspr(SPR_MAS4, mas4); - __asm volatile("isync"); + __asm __volatile("isync"); } /* @@ -2860,7 +2813,7 @@ tlb1_print_entries(void) static int tlb1_iomapped(int i, vm_paddr_t pa, vm_size_t size, vm_offset_t *va) { - u_int32_t prot; + uint32_t prot; vm_paddr_t pa_start; vm_paddr_t pa_end; unsigned int entry_tsize; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 16:17:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5876B1065672; Tue, 13 Jan 2009 16:17:23 +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 429BB8FC21; Tue, 13 Jan 2009 16:17:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DGHNsa008247; Tue, 13 Jan 2009 16:17:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DGHNGi008246; Tue, 13 Jan 2009 16:17:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901131617.n0DGHNGi008246@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Jan 2009 16:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187152 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 16:17:24 -0000 Author: mav Date: Tue Jan 13 16:17:22 2009 New Revision: 187152 URL: http://svn.freebsd.org/changeset/base/187152 Log: MRC rev. 186912, 187020, 187052: Add external connector jack color into widget names. It should help users to identify them while reading verbose messages. Add one more bunch of controller and codec IDs. Fix unwanted crosschannel mixing, possible on some codecs like VIA VT1708B and Realtek ALC268. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sound/pci/hda/hdac.c Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 16:15:49 2009 (r187151) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 16:17:22 2009 (r187152) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20081226_0122" +#define HDA_DRV_TEST_REV "20090110_0123" SND_DECLARE_FILE("$FreeBSD$"); @@ -149,6 +149,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_INTEL_82801H HDA_MODEL_CONSTRUCT(INTEL, 0x284b) #define HDA_INTEL_82801I HDA_MODEL_CONSTRUCT(INTEL, 0x293e) #define HDA_INTEL_82801J HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e) +#define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) @@ -178,6 +179,19 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ATI_VENDORID 0x1002 #define HDA_ATI_SB450 HDA_MODEL_CONSTRUCT(ATI, 0x437b) #define HDA_ATI_SB600 HDA_MODEL_CONSTRUCT(ATI, 0x4383) +#define HDA_ATI_RS600 HDA_MODEL_CONSTRUCT(ATI, 0x793b) +#define HDA_ATI_RS690 HDA_MODEL_CONSTRUCT(ATI, 0x7919) +#define HDA_ATI_RS780 HDA_MODEL_CONSTRUCT(ATI, 0x960f) +#define HDA_ATI_R600 HDA_MODEL_CONSTRUCT(ATI, 0xaa00) +#define HDA_ATI_RV630 HDA_MODEL_CONSTRUCT(ATI, 0xaa08) +#define HDA_ATI_RV610 HDA_MODEL_CONSTRUCT(ATI, 0xaa10) +#define HDA_ATI_RV670 HDA_MODEL_CONSTRUCT(ATI, 0xaa18) +#define HDA_ATI_RV635 HDA_MODEL_CONSTRUCT(ATI, 0xaa20) +#define HDA_ATI_RV620 HDA_MODEL_CONSTRUCT(ATI, 0xaa28) +#define HDA_ATI_RV770 HDA_MODEL_CONSTRUCT(ATI, 0xaa30) +#define HDA_ATI_RV730 HDA_MODEL_CONSTRUCT(ATI, 0xaa38) +#define HDA_ATI_RV710 HDA_MODEL_CONSTRUCT(ATI, 0xaa40) +#define HDA_ATI_RV740 HDA_MODEL_CONSTRUCT(ATI, 0xaa48) #define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff) /* VIA */ @@ -469,6 +483,7 @@ static const struct { { HDA_INTEL_82801H, "Intel 82801H" }, { HDA_INTEL_82801I, "Intel 82801I" }, { HDA_INTEL_82801J, "Intel 82801J" }, + { HDA_INTEL_PCH, "Intel PCH" }, { HDA_INTEL_SCH, "Intel SCH" }, { HDA_NVIDIA_MCP51, "NVidia MCP51" }, { HDA_NVIDIA_MCP55, "NVidia MCP55" }, @@ -488,8 +503,20 @@ static const struct { { HDA_NVIDIA_MCP79_2, "NVidia MCP79" }, { HDA_NVIDIA_MCP79_3, "NVidia MCP79" }, { HDA_NVIDIA_MCP79_4, "NVidia MCP79" }, - { HDA_ATI_SB450, "ATI SB450" }, - { HDA_ATI_SB600, "ATI SB600" }, + { HDA_ATI_SB450, "ATI SB450" }, + { HDA_ATI_SB600, "ATI SB600" }, + { HDA_ATI_RS600, "ATI RS600" }, + { HDA_ATI_RS690, "ATI RS690" }, + { HDA_ATI_RS780, "ATI RS780" }, + { HDA_ATI_R600, "ATI R600" }, + { HDA_ATI_RV610, "ATI RV610" }, + { HDA_ATI_RV620, "ATI RV620" }, + { HDA_ATI_RV630, "ATI RV630" }, + { HDA_ATI_RV635, "ATI RV635" }, + { HDA_ATI_RV710, "ATI RV710" }, + { HDA_ATI_RV730, "ATI RV730" }, + { HDA_ATI_RV740, "ATI RV740" }, + { HDA_ATI_RV770, "ATI RV770" }, { HDA_VIA_VT82XX, "VIA VT8251/8237A" }, { HDA_SIS_966, "SiS 966" }, { HDA_ULI_M5461, "ULI M5461" }, @@ -671,6 +698,7 @@ static const struct { /* Silicon Image */ #define SII_VENDORID 0x1095 +#define HDA_CODEC_SII1390 HDA_CODEC_CONSTRUCT(SII, 0x1390) #define HDA_CODEC_SII1392 HDA_CODEC_CONSTRUCT(SII, 0x1392) #define HDA_CODEC_SIIXXXX HDA_CODEC_CONSTRUCT(SII, 0xffff) @@ -706,6 +734,22 @@ static const struct { #define HDA_CODEC_VT1708B_5 HDA_CODEC_CONSTRUCT(VIA, 0xe725) #define HDA_CODEC_VT1708B_6 HDA_CODEC_CONSTRUCT(VIA, 0xe726) #define HDA_CODEC_VT1708B_7 HDA_CODEC_CONSTRUCT(VIA, 0xe727) +#define HDA_CODEC_VT1708S_0 HDA_CODEC_CONSTRUCT(VIA, 0x0397) +#define HDA_CODEC_VT1708S_1 HDA_CODEC_CONSTRUCT(VIA, 0x1397) +#define HDA_CODEC_VT1708S_2 HDA_CODEC_CONSTRUCT(VIA, 0x2397) +#define HDA_CODEC_VT1708S_3 HDA_CODEC_CONSTRUCT(VIA, 0x3397) +#define HDA_CODEC_VT1708S_4 HDA_CODEC_CONSTRUCT(VIA, 0x4397) +#define HDA_CODEC_VT1708S_5 HDA_CODEC_CONSTRUCT(VIA, 0x5397) +#define HDA_CODEC_VT1708S_6 HDA_CODEC_CONSTRUCT(VIA, 0x6397) +#define HDA_CODEC_VT1708S_7 HDA_CODEC_CONSTRUCT(VIA, 0x7397) +#define HDA_CODEC_VT1702_0 HDA_CODEC_CONSTRUCT(VIA, 0x0398) +#define HDA_CODEC_VT1702_1 HDA_CODEC_CONSTRUCT(VIA, 0x1398) +#define HDA_CODEC_VT1702_2 HDA_CODEC_CONSTRUCT(VIA, 0x2398) +#define HDA_CODEC_VT1702_3 HDA_CODEC_CONSTRUCT(VIA, 0x3398) +#define HDA_CODEC_VT1702_4 HDA_CODEC_CONSTRUCT(VIA, 0x4398) +#define HDA_CODEC_VT1702_5 HDA_CODEC_CONSTRUCT(VIA, 0x5398) +#define HDA_CODEC_VT1702_6 HDA_CODEC_CONSTRUCT(VIA, 0x6398) +#define HDA_CODEC_VT1702_7 HDA_CODEC_CONSTRUCT(VIA, 0x7398) #define HDA_CODEC_VTXXXX HDA_CODEC_CONSTRUCT(VIA, 0xffff) /* ATI */ @@ -716,9 +760,16 @@ static const struct { #define HDA_CODEC_ATIXXXX HDA_CODEC_CONSTRUCT(ATI, 0xffff) /* NVIDIA */ +#define HDA_CODEC_NVIDIAMCP78 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0002) +#define HDA_CODEC_NVIDIAMCP7A HDA_CODEC_CONSTRUCT(NVIDIA, 0x0007) +#define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) /* INTEL */ +#define HDA_CODEC_INTELG45_1 HDA_CODEC_CONSTRUCT(INTEL, 0x2801) +#define HDA_CODEC_INTELG45_2 HDA_CODEC_CONSTRUCT(INTEL, 0x2802) +#define HDA_CODEC_INTELG45_3 HDA_CODEC_CONSTRUCT(INTEL, 0x2803) +#define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) /* Codecs */ @@ -833,10 +884,34 @@ static const struct { { HDA_CODEC_VT1708B_5, "VIA VT1708B_5" }, { HDA_CODEC_VT1708B_6, "VIA VT1708B_6" }, { HDA_CODEC_VT1708B_7, "VIA VT1708B_7" }, + { HDA_CODEC_VT1708S_0, "VIA VT1708S_0" }, + { HDA_CODEC_VT1708S_1, "VIA VT1708S_1" }, + { HDA_CODEC_VT1708S_2, "VIA VT1708S_2" }, + { HDA_CODEC_VT1708S_3, "VIA VT1708S_3" }, + { HDA_CODEC_VT1708S_4, "VIA VT1708S_4" }, + { HDA_CODEC_VT1708S_5, "VIA VT1708S_5" }, + { HDA_CODEC_VT1708S_6, "VIA VT1708S_6" }, + { HDA_CODEC_VT1708S_7, "VIA VT1708S_7" }, + { HDA_CODEC_VT1702_0, "VIA VT1702_0" }, + { HDA_CODEC_VT1702_1, "VIA VT1702_1" }, + { HDA_CODEC_VT1702_2, "VIA VT1702_2" }, + { HDA_CODEC_VT1702_3, "VIA VT1702_3" }, + { HDA_CODEC_VT1702_4, "VIA VT1702_4" }, + { HDA_CODEC_VT1702_5, "VIA VT1702_5" }, + { HDA_CODEC_VT1702_6, "VIA VT1702_6" }, + { HDA_CODEC_VT1702_7, "VIA VT1702_7" }, { HDA_CODEC_ATIRS600_1,"ATI RS600 HDMI" }, { HDA_CODEC_ATIRS600_2,"ATI RS600 HDMI" }, { HDA_CODEC_ATIRS690, "ATI RS690/780 HDMI" }, { HDA_CODEC_ATIR6XX, "ATI R6xx HDMI" }, + { HDA_CODEC_NVIDIAMCP67, "NVidia MCP67 HDMI" }, + { HDA_CODEC_NVIDIAMCP78, "NVidia MCP78 HDMI" }, + { HDA_CODEC_NVIDIAMCP7A, "NVidia MCP7A HDMI" }, + { HDA_CODEC_INTELG45_1, "Intel G45 HDMI" }, + { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" }, + { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" }, + { HDA_CODEC_INTELG45_4, "Intel G45 HDMI" }, + { HDA_CODEC_SII1390, "Silicon Image SiI1390 HDMI" }, { HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" }, /* Unknown codec */ { HDA_CODEC_ALCXXXX, "Realtek (Unknown)" }, @@ -2443,9 +2518,10 @@ hdac_widget_pin_parse(struct hdac_widget { struct hdac_softc *sc = w->devinfo->codec->sc; uint32_t config, pincap; - const char *devstr, *connstr; + const char *devstr; nid_t cad = w->devinfo->codec->cad; nid_t nid = w->nid; + int conn, color; config = hdac_widget_pin_getconfig(w); w->wclass.pin.config = config; @@ -2467,13 +2543,19 @@ hdac_widget_pin_parse(struct hdac_widget devstr = HDA_DEVS[(config & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) >> HDA_CONFIG_DEFAULTCONF_DEVICE_SHIFT]; - connstr = HDA_CONNS[(config & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >> - HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT]; + conn = (config & HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_MASK) >> + HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_SHIFT; + color = (config & HDA_CONFIG_DEFAULTCONF_COLOR_MASK) >> + HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT; strlcat(w->name, ": ", sizeof(w->name)); strlcat(w->name, devstr, sizeof(w->name)); strlcat(w->name, " (", sizeof(w->name)); - strlcat(w->name, connstr, sizeof(w->name)); + if (conn == 0 && color != 0 && color != 15) { + strlcat(w->name, HDA_COLORS[color], sizeof(w->name)); + strlcat(w->name, " ", sizeof(w->name)); + } + strlcat(w->name, HDA_CONNS[conn], sizeof(w->name)); strlcat(w->name, ")", sizeof(w->name)); } @@ -5472,7 +5554,7 @@ hdac_audio_disable_crossas(struct hdac_d struct hdac_audio_ctl *ctl; int i, j; - /* Disable crossassociatement connections. */ + /* Disable crossassociatement and unwanted crosschannel connections. */ /* ... using selectors */ for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdac_widget_get(devinfo, i); @@ -5490,7 +5572,10 @@ hdac_audio_disable_crossas(struct hdac_d cw = hdac_widget_get(devinfo, w->conns[j]); if (cw == NULL || w->enable == 0) continue; - if (w->bindas == cw->bindas || cw->bindas == -2) + if (cw->bindas == -2) + continue; + if (w->bindas == cw->bindas && + (w->bindseqmask & cw->bindseqmask) != 0) continue; w->connsenable[j] = 0; HDA_BOOTHVERBOSE( @@ -5509,7 +5594,8 @@ hdac_audio_disable_crossas(struct hdac_d if (ctl->widget->bindas == -2 || ctl->childwidget->bindas == -2) continue; - if (ctl->widget->bindas != ctl->childwidget->bindas) { + if (ctl->widget->bindas != ctl->childwidget->bindas || + (ctl->widget->bindseqmask & ctl->childwidget->bindseqmask) == 0) { ctl->forcemute = 1; ctl->muted = HDA_AMP_MUTE_ALL; ctl->left = 0; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 16:19:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C070F1065679; Tue, 13 Jan 2009 16:19:58 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC1C48FC26; Tue, 13 Jan 2009 16:19:58 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DGJwFp008330; Tue, 13 Jan 2009 16:19:58 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DGJwWa008329; Tue, 13 Jan 2009 16:19:58 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200901131619.n0DGJwWa008329@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 13 Jan 2009 16:19: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: r187153 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 16:19:59 -0000 Author: raj Date: Tue Jan 13 16:19:58 2009 New Revision: 187153 URL: http://svn.freebsd.org/changeset/base/187153 Log: Clean up BookE low-level exceptions code. Improve comments, fix style(9) and typos, unify separators. Obtained from: Freescale, Semihalf Modified: head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Tue Jan 13 16:17:22 2009 (r187152) +++ head/sys/powerpc/booke/trap_subr.S Tue Jan 13 16:19:58 2009 (r187153) @@ -127,7 +127,7 @@ bf 17, 1f; \ GET_CPUINFO(%r1); /* Per-cpu structure */ \ lwz %r1, PC_CURPCB(%r1); /* Per-thread kernel stack */ \ -1: +1: #define STANDARD_CRIT_PROLOG(sprg_sp, savearea, isrr0, isrr1) \ mtspr sprg_sp, %r1; /* Save SP */ \ @@ -213,7 +213,6 @@ stw %r30, FRAME_SRR0+8(1); \ stw %r31, FRAME_SRR1+8(1) - /* * * isrr0-1 - save restore registers to restore CPU state to (may be @@ -250,7 +249,7 @@ * * Notes: * - potential TLB miss: NO. It is crucial that we do not generate a TLB - * miss withing the TLB prolog itself! + * miss within the TLB prolog itself! * - TLBSAVE is always translated */ #define TLB_PROLOG \ @@ -334,9 +333,9 @@ .align 5 interrupt_vector_base: -/**************************************** +/***************************************************************************** * Critical input interrupt - ****************************************/ + ****************************************************************************/ INTERRUPT(int_critical_input) STANDARD_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_CSRR0, SPR_CSRR1) FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_CRIT) @@ -346,9 +345,9 @@ INTERRUPT(int_critical_input) rfci -/**************************************** +/***************************************************************************** * Machine check interrupt - ****************************************/ + ****************************************************************************/ INTERRUPT(int_machine_check) STANDARD_PROLOG(SPR_SPRG3, PC_BOOKE_MCHKSAVE, SPR_MCSRR0, SPR_MCSRR1) FRAME_SETUP(SPR_SPRG3, PC_BOOKE_MCHKSAVE, EXC_MCHK) @@ -358,27 +357,27 @@ INTERRUPT(int_machine_check) rfmci -/**************************************** +/***************************************************************************** * Data storage interrupt - ****************************************/ + ****************************************************************************/ INTERRUPT(int_data_storage) STANDARD_PROLOG(SPR_SPRG1, PC_DISISAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_DISISAVE, EXC_DSI) b trap_common -/**************************************** +/***************************************************************************** * Instruction storage interrupt - ****************************************/ + ****************************************************************************/ INTERRUPT(int_instr_storage) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_ISI) b trap_common -/**************************************** +/***************************************************************************** * External input interrupt - ****************************************/ + ****************************************************************************/ INTERRUPT(int_external_input) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_EXI) @@ -398,18 +397,18 @@ INTERRUPT(int_program) b trap_common -/**************************************** +/***************************************************************************** * System call - ****************************************/ + ****************************************************************************/ INTERRUPT(int_syscall) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_SC) b trap_common -/**************************************** +/***************************************************************************** * Decrementer interrupt - ****************************************/ + ****************************************************************************/ INTERRUPT(int_decrementer) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_DECR) @@ -418,36 +417,34 @@ INTERRUPT(int_decrementer) b trapexit -/**************************************** +/***************************************************************************** * Fixed interval timer - ****************************************/ + ****************************************************************************/ INTERRUPT(int_fixed_interval_timer) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_FIT) b trap_common -/**************************************** +/***************************************************************************** * Watchdog interrupt - ****************************************/ + ****************************************************************************/ INTERRUPT(int_watchdog) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_WDOG) b trap_common -/**************************************** +/***************************************************************************** * Data TLB miss interrupt * - * There can be nested TLB misses - while - * handling a TLB miss we dereference data - * structures that may be not covered by - * translations. We support up to + * There can be nested TLB misses - while handling a TLB miss we reference + * data structures that may be not covered by translations. We support up to * TLB_NESTED_MAX-1 nested misses. * * Registers use: * r31 - dear - * r30 - tlb0 entry address + * r30 - unused * r29 - saved mas0 * r28 - saved mas1 * r27 - saved mas2 @@ -455,7 +452,7 @@ INTERRUPT(int_watchdog) * r25 - pte address * * r20:r23 - scratch registers - ****************************************/ + ****************************************************************************/ INTERRUPT(int_data_tlb_error) TLB_PROLOG @@ -554,8 +551,11 @@ pte_lookup: addi %r25, %r26, PM_PDIR /* pmap pm_dir[] address */ add %r25, %r25, %r21 /* offset within pm_pdir[] table */ - lwz %r25, 0(%r25) /* get ptbl address, i.e. pmap->pm_pdir[pdir_idx] */ - + /* + * Get ptbl address, i.e. pmap->pm_pdir[pdir_idx] + * This load may cause a Data TLB miss for non-kernel pmap! + */ + lwz %r25, 0(%r25) cmpwi %r25, 0 beq 2f @@ -567,7 +567,11 @@ pte_lookup: srwi %r21, %r21, (PTBL_SHIFT - PTBL_ENTRY_SHIFT) add %r25, %r25, %r21 /* address of pte entry */ - lwz %r21, PTE_FLAGS(%r25) /* get pte->flags */ + /* + * Get pte->flags + * This load may cause a Data TLB miss for non-kernel pmap! + */ + lwz %r21, PTE_FLAGS(%r25) andis. %r21, %r21, PTE_VALID@h bne 2f 1: @@ -631,12 +635,11 @@ tlb_fill_entry: msync blr -/**************************************** +/***************************************************************************** * Instruction TLB miss interrupt * * Same notes as for the Data TLB miss - * - ****************************************/ + ****************************************************************************/ INTERRUPT(int_inst_tlb_error) TLB_PROLOG @@ -661,9 +664,9 @@ INTERRUPT(int_inst_tlb_error) .globl interrupt_vector_top interrupt_vector_top: -/**************************************** +/***************************************************************************** * Debug interrupt - ****************************************/ + ****************************************************************************/ INTERRUPT(int_debug) STANDARD_CRIT_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_CSRR0, SPR_CSRR1) FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_DEBUG) @@ -678,7 +681,7 @@ INTERRUPT(int_debug) bge 1f /* Disable single-stepping for the interrupt handlers. */ lwz %r3, FRAME_SRR1+8(%r1); - rlwinm %r3,%r3,0,23,21 + rlwinm %r3, %r3, 0, 23, 21 stw %r3, FRAME_SRR1+8(%r1); /* Restore srr0 and srr1 as they could have been clobbered. */ lwz %r3, (PC_BOOKE_CRITSAVE+CPUSAVE_SRR0+8)(%r2); @@ -699,9 +702,9 @@ INTERRUPT(int_debug) rfci -/******************************** +/***************************************************************************** * Common trap code - ********************************/ + ****************************************************************************/ trap_common: /* Call C trap dispatcher */ addi %r3, %r1, 8 @@ -720,8 +723,8 @@ CNAME(trapexit): GET_CPUINFO(%r3) lwz %r4, PC_CURTHREAD(%r3) lwz %r4, TD_FLAGS(%r4) - lis %r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@h - ori %r5, %r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@l + lis %r5, (TDF_ASTPENDING | TDF_NEEDRESCHED)@h + ori %r5, %r5, (TDF_ASTPENDING | TDF_NEEDRESCHED)@l and. %r4, %r4, %r5 beq 1f @@ -747,12 +750,12 @@ CNAME(breakpoint): mtsprg1 %r1 mfmsr %r3 mtsrr1 %r3 - andi. %r3,%r3,~(PSL_EE|PSL_ME)@l + andi. %r3, %r3, ~(PSL_EE | PSL_ME)@l mtmsr %r3 /* disable interrupts */ isync GET_CPUINFO(%r3) - stw %r30,(PC_DBSAVE+CPUSAVE_R30)(%r3) - stw %r31,(PC_DBSAVE+CPUSAVE_R31)(%r3) + stw %r30, (PC_DBSAVE+CPUSAVE_R30)(%r3) + stw %r31, (PC_DBSAVE+CPUSAVE_R31)(%r3) mflr %r31 mtsrr0 %r31 @@ -776,9 +779,9 @@ CNAME(breakpoint): dbtrap: FRAME_SETUP(SPR_SPRG1, PC_DBSAVE, EXC_DEBUG) /* Call C trap code: */ - addi %r3,%r1,8 + addi %r3, %r1, 8 bl CNAME(db_trap_glue) - or. %r3,%r3,%r3 + or. %r3, %r3, %r3 bne dbleave /* This wasn't for KDB, so switch to real trap: */ b trap_common From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 16:27:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCFD106566B; Tue, 13 Jan 2009 16:27:04 +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 CAD828FC34; Tue, 13 Jan 2009 16:27:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DGR4mQ008501; Tue, 13 Jan 2009 16:27:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DGR4Xu008500; Tue, 13 Jan 2009 16:27:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901131627.n0DGR4Xu008500@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Jan 2009 16:27: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: r187154 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 16:27:05 -0000 Author: mav Date: Tue Jan 13 16:27:04 2009 New Revision: 187154 URL: http://svn.freebsd.org/changeset/base/187154 Log: Change configuration order to enable output only after codec is configured. Mute all mixer controllable amplifiers initially to let mixer to unmute only some of them later. This should reduce clicks and noises during boot. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 16:19:58 2009 (r187153) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 16:27:04 2009 (r187154) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090110_0123" +#define HDA_DRV_TEST_REV "20090113_0124" SND_DECLARE_FILE("$FreeBSD$"); @@ -6111,6 +6111,29 @@ hdac_audio_prepare_pin_ctrl(struct hdac_ } static void +hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) +{ + struct hdac_audio_ctl *ctl; + int i, z; + + i = 0; + while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { + if (ctl->enable == 0 || ctl->ossmask != 0) { + /* Mute disabled and mixer controllable controls. + * Last will be initialized by mixer_init(). + * This expected to reduce click on startup. */ + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); + continue; + } + /* Init fixed controls to 0dB amplification. */ + z = ctl->offset; + if (z > ctl->step) + z = ctl->step; + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); + } +} + +static void hdac_audio_commit(struct hdac_devinfo *devinfo) { struct hdac_softc *sc = devinfo->codec->sc; @@ -6126,11 +6149,41 @@ hdac_audio_commit(struct hdac_devinfo *d hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, 0x7e7, 0), cad); + /* Commit controls. */ + hdac_audio_ctl_commit(devinfo); + + /* Commit selectors, pins and EAPD. */ + for (i = 0; i < devinfo->nodecnt; i++) { + w = &devinfo->widget[i]; + if (w == NULL) + continue; + if (w->selconn == -1) + w->selconn = 0; + if (w->nconns > 0) + hdac_widget_connection_select(w, w->selconn); + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + hdac_command(sc, + HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, + w->wclass.pin.ctrl), cad); + } + if (w->param.eapdbtl != HDAC_INVALID) { + uint32_t val; + + val = w->param.eapdbtl; + if (devinfo->function.audio.quirks & + HDA_QUIRK_EAPDINV) + val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; + hdac_command(sc, + HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, + val), cad); + } + } + + /* Commit GPIOs. */ gdata = 0; gmask = 0; gdir = 0; commitgpio = 0; - numgpio = HDA_PARAM_GPIO_COUNT_NUM_GPIO( devinfo->function.audio.gpio); @@ -6185,54 +6238,6 @@ hdac_audio_commit(struct hdac_devinfo *d HDA_CMD_SET_GPIO_DATA(cad, devinfo->nid, gdata), cad); } - - for (i = 0; i < devinfo->nodecnt; i++) { - w = &devinfo->widget[i]; - if (w == NULL) - continue; - if (w->selconn == -1) - w->selconn = 0; - if (w->nconns > 0) - hdac_widget_connection_select(w, w->selconn); - if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - hdac_command(sc, - HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, - w->wclass.pin.ctrl), cad); - } - if (w->param.eapdbtl != HDAC_INVALID) { - uint32_t val; - - val = w->param.eapdbtl; - if (devinfo->function.audio.quirks & - HDA_QUIRK_EAPDINV) - val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; - hdac_command(sc, - HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, - val), cad); - - } - } -} - -static void -hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) -{ - struct hdac_audio_ctl *ctl; - int i, z; - - i = 0; - while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->enable == 0) { - /* Mute disabled controls. */ - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); - continue; - } - /* Init controls to 0dB amplification. */ - z = ctl->offset; - if (z > ctl->step) - z = ctl->step; - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); - } } static void @@ -7477,10 +7482,6 @@ hdac_attach2(void *arg) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(sc->dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(sc->dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); @@ -7730,10 +7731,6 @@ hdac_resume(device_t dev) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 16:33:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 956AE106566B; Tue, 13 Jan 2009 16:33:10 +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 81E108FC1A; Tue, 13 Jan 2009 16:33:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DGXAjw008677; Tue, 13 Jan 2009 16:33:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DGXAo6008675; Tue, 13 Jan 2009 16:33:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901131633.n0DGXAo6008675@svn.freebsd.org> From: John Baldwin Date: Tue, 13 Jan 2009 16:33: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: r187155 - head/tools/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 16:33:11 -0000 Author: jhb Date: Tue Jan 13 16:33:10 2009 New Revision: 187155 URL: http://svn.freebsd.org/changeset/base/187155 Log: - Add some rudimentary support for sorting the list of event sources (threads, CPU load counters, etc.). Each source is tagged with a group and an order similar to the SYSINIT SI_SUB_* and SI_ORDER_*. After the file is parsed, all the sources are then sorted. Currently, the only affects of this are that the CPU loads are now sorted by CPU ID (so CPU 0 is always first). However, this makes it easier to add new types of event sources in the future and have them all clustered together instead of intertwined with threads. - Python lists perform insertions at the tail much faster than insertions at the head. For a trace that had a lot of events for a single event source, the constant insertions of new events to the head of the per-source event list caused a noticable slow down. To compensate, append new events to the end of the list during parsing and then reverse the list prior to drawing. - Somewhere in the tkinter internals the coordinates of a canvas are stored in a signed 32-bit integer. As a result, if an the box for an event spans 2^31, it would actually end up having a negative X offset at one end. The result was a single box that covered the entire event source. Kris worked around this for some traces by bumping up the initial ticks/pixel ratio from 1 to 10. However, a divisor of 10 can still be too small for large tracefiles (e.g. with 4 million entries). Instead of hardcoding the initial scaling ratio, calculate it from the time span of the trace file. - Add support for using the mouse wheel to scroll the graph window up and down. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Tue Jan 13 16:27:04 2009 (r187154) +++ head/tools/sched/schedgraph.py Tue Jan 13 16:33:10 2009 (r187155) @@ -739,24 +739,36 @@ class Wokeup(PointEvent): configtypes.append(Wokeup) +(DEFAULT, LOAD, COUNT, THREAD) = range(4) + class EventSource: - def __init__(self, name): + def __init__(self, name, group=DEFAULT, order=0): self.name = name self.events = [] self.cpu = 0 self.cpux = 0 + self.group = group + self.order = order + def __cmp__(self, other): + if (self.group == other.group): + return cmp(self.order, other.order) + return cmp(self.group, other.group) + + # It is much faster to append items to a list then to insert them + # at the beginning. As a result, we add events in reverse order + # and then swap the list during fixup. def fixup(self): - pass + self.events.reverse() def event(self, event): - self.events.insert(0, event) + self.events.append(event) def remove(self, event): self.events.remove(event) def lastevent(self, event): - self.events.append(event) + self.events.insert(0, event) def draw(self, canvas, ypos): xpos = 10 @@ -819,7 +831,7 @@ class EventSource: class Thread(EventSource): names = {} def __init__(self, td, pcomm): - EventSource.__init__(self, pcomm) + EventSource.__init__(self, pcomm, THREAD) self.str = td try: cnt = Thread.names[pcomm] @@ -829,6 +841,7 @@ class Thread(EventSource): Thread.names[pcomm] = cnt + 1 def fixup(self): + EventSource.fixup(self) cnt = Thread.names[self.name] if (cnt == 0): return @@ -842,7 +855,7 @@ class Thread(EventSource): class Counter(EventSource): max = 0 def __init__(self, name): - EventSource.__init__(self, name) + EventSource.__init__(self, name, COUNT) def event(self, event): EventSource.event(self, event) @@ -863,6 +876,11 @@ class Counter(EventSource): def yscale(self): return (self.ysize() / Counter.max) +class CPULoad(Counter): + def __init__(self, cpu): + Counter.__init__(self, "cpu" + str(cpu) + " load") + self.group = LOAD + self.order = cpu class KTRFile: def __init__(self, file): @@ -1100,9 +1118,9 @@ class KTRFile: try: load = self.load[cpu] except: - load = Counter("cpu" + str(cpu) + " load") + load = CPULoad(cpu) self.load[cpu] = load - self.sources.insert(0, load) + self.sources.append(load) Count(load, cpu, timestamp, count) def cpuload2(self, cpu, timestamp, ncpu, count): @@ -1113,9 +1131,9 @@ class KTRFile: try: load = self.load[cpu] except: - load = Counter("cpu" + str(cpu) + " load") + load = CPULoad(cpu) self.load[cpu] = load - self.sources.insert(0, load) + self.sources.append(load) Count(load, cpu, timestamp, count) def loadglobal(self, cpu, timestamp, count): @@ -1128,7 +1146,7 @@ class KTRFile: except: load = Counter("CPU load") self.load[cpu] = load - self.sources.insert(0, load) + self.sources.append(load) Count(load, cpu, timestamp, count) def critsec(self, cpu, timestamp, td, pcomm, to): @@ -1141,7 +1159,7 @@ class KTRFile: except: crit = Counter("Critical Section") self.crit[cpu] = crit - self.sources.insert(0, crit) + self.sources.append(crit) Count(crit, cpu, timestamp, to) def findtd(self, td, pcomm): @@ -1158,12 +1176,14 @@ class KTRFile: Padevent(source, -1, self.timestamp_l) Padevent(source, -1, self.timestamp_f, last=1) source.fixup() + self.sources.sort() class SchedDisplay(Canvas): def __init__(self, master): - self.ratio = 10 + self.ratio = 1 self.ktrfile = None self.sources = None + self.parent = master self.bdheight = 10 self.events = {} @@ -1174,6 +1194,11 @@ class SchedDisplay(Canvas): self.ktrfile = ktrfile self.sources = ktrfile.sources + # Compute a ratio to ensure that the file's timespan fits into + # 2^31. Although python may handle larger values for X + # values, the Tk internals do not. + self.ratio = (ktrfile.timespan() - 1) / 2**31 + 1 + def draw(self): ypos = 0 xsize = self.xsize() @@ -1195,6 +1220,8 @@ class SchedDisplay(Canvas): self.tag_bind("event", "", self.mouseenter) self.tag_bind("event", "", self.mouseexit) self.tag_bind("event", "", self.mousepress) + self.bind("", self.wheelup) + self.bind("", self.wheeldown) def mouseenter(self, event): item, = self.find_withtag(CURRENT) @@ -1211,6 +1238,12 @@ class SchedDisplay(Canvas): event = self.events[item] event.mousepress(self, item) + def wheeldown(self, event): + self.parent.display_yview("scroll", 1, "units") + + def wheelup(self, event): + self.parent.display_yview("scroll", -1, "units") + def drawnames(self, canvas): status.startup("Drawing names") ypos = 0 From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 16:44:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E443F1065672; Tue, 13 Jan 2009 16:44:18 +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 D05F18FC1C; Tue, 13 Jan 2009 16:44:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DGiIN5009064; Tue, 13 Jan 2009 16:44:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DGiI9L009063; Tue, 13 Jan 2009 16:44:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901131644.n0DGiI9L009063@svn.freebsd.org> From: John Baldwin Date: Tue, 13 Jan 2009 16:44: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: r187156 - head/tools/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 16:44:19 -0000 Author: jhb Date: Tue Jan 13 16:44:18 2009 New Revision: 187156 URL: http://svn.freebsd.org/changeset/base/187156 Log: Add support for two new event source types: - Callwheels traced via KTR_CALLOUT. Each CPU is assigned a callwheel source. The events on this source are the execution of individual callout routines. Each routine shows up as a green rectangle while it is executed and the event details include the function pointer and argument. - Locks traced via KTR_LOCK. Currently, each lock name is assigned an event source (since the existing KTR_LOCK traces only include lock names and not pointers). This does mean that if multiple locks of the same name are manipulated, the source line for that name may be confusing. However, for many cases this can be useful. Locks are blue when they are held and purple when contested. The contention support is a bit weak due to limitations in the rw_rlock() and mtx_lock_spin() logging messages currently. I also have not added support for contention on lockmgr, sx, or rmlocks yet. What is there now can be profitably used to examine activity on Giant however. - Expand the width of the event source names column a bit to allow for some of the longer names of these new source types. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Tue Jan 13 16:33:10 2009 (r187155) +++ head/tools/sched/schedgraph.py Tue Jan 13 16:44:18 2009 (r187156) @@ -672,6 +672,86 @@ class Sched_exit(StateEvent): configtypes.append(Sched_exit) +# Events for running callout routines + +class CalloutIdle(StateEvent): + name = "callwheel idle" + color = "grey" + enabled = 0 + def __init__(self, wheel, cpu, timestamp): + StateEvent.__init__(self, wheel, cpu, timestamp) + +configtypes.append(CalloutIdle) + +class CalloutRunning(StateEvent): + name = "callout running" + color = "green" + enabled = 1 + def __init__(self, wheel, cpu, timestamp, func, arg): + StateEvent.__init__(self, wheel, cpu, timestamp) + self.textadd(("function:", func, 0)) + self.textadd(("argument:", arg, 0)) + self.arg = arg + self.func = func + + def stattxt(self): + statstr = StateEvent.stattxt(self) + statstr += " executing %s(%s)" % (self.func, self.arg) + return (statstr) + +configtypes.append(CalloutRunning) + +# Events on locks +# +# XXX: No support for upgrade/downgrade currently or differentiating +# between read/write in general. +# +# XXX: Point events for recursion perhaps? + +class LockAcquire(StateEvent): + name = "lock acquire" + color = "blue" + enabled = 1 + def __init__(self, lock, cpu, timestamp, file, line): + StateEvent.__init__(self, lock, cpu, timestamp) + self.textadd(("file:", file, 0)) + self.textadd(("line:", line, 0)) + +configtypes.append(LockAcquire) + +class LockContest(StateEvent): + name = "lock contest" + color = "purple" + enabled = 1 + def __init__(self, lock, cpu, timestamp, file, line): + StateEvent.__init__(self, lock, cpu, timestamp) + self.textadd(("file:", file, 0)) + self.textadd(("line:", line, 0)) + +configtypes.append(LockContest) + +class LockFailedTry(PointEvent): + name = "failed lock try" + color = "red" + enabled = 1 + def __init__(self, lock, cpu, timestamp, file, line): + PointEvent.__init__(self, lock, cpu, timestamp) + self.textadd(("file:", file, 0)) + self.textadd(("line:", line, 0)) + +configtypes.append(LockFailedTry) + +class LockRelease(StateEvent): + name = "lock release" + color = "grey" + enabled = 0 + def __init__(self, lock, cpu, timestamp, file, line): + StateEvent.__init__(self, lock, cpu, timestamp) + self.textadd(("file:", file, 0)) + self.textadd(("line:", line, 0)) + +configtypes.append(LockRelease) + class Padevent(StateEvent): def __init__(self, thread, cpu, timestamp, last=0): StateEvent.__init__(self, thread, cpu, timestamp, last) @@ -739,7 +819,7 @@ class Wokeup(PointEvent): configtypes.append(Wokeup) -(DEFAULT, LOAD, COUNT, THREAD) = range(4) +(DEFAULT, LOAD, COUNT, CALLWHEEL, LOCK, THREAD) = range(6) class EventSource: def __init__(self, name, group=DEFAULT, order=0): @@ -852,6 +932,29 @@ class Thread(EventSource): def ysize(self): return (10) +class Callwheel(EventSource): + count = 0 + def __init__(self, cpu): + EventSource.__init__(self, "Callwheel", CALLWHEEL, cpu) + self.wheel = cpu + Callwheel.count += 1 + + def fixup(self): + EventSource.fixup(self) + if (Callwheel.count == 1): + return + self.name += " (CPU %d)" % (self.wheel) + + def ysize(self): + return (10) + +class Lock(EventSource): + def __init__(self, lock): + EventSource.__init__(self, lock, LOCK) + + def ysize(self): + return (10) + class Counter(EventSource): max = 0 def __init__(self, name): @@ -888,6 +991,8 @@ class KTRFile: self.timestamp_l = None self.threads = [] self.sources = [] + self.locks = {} + self.callwheels = {} self.ticks = {} self.load = {} self.crit = {} @@ -959,6 +1064,46 @@ class KTRFile: ktrstr = "critical_\S+ by thread " + crittdname + " to (\d+)" critsec_re = re.compile(ktrhdr + ktrstr) + ktrstr = "callout 0x[a-f\d]+ " + ktrstr += "func (0x[a-f\d]+) arg (0x[a-f\d]+)" + callout_start_re = re.compile(ktrhdr + ktrstr) + + ktrstr = "callout mpsafe 0x[a-f\d]+ " + ktrstr += "func (0x[a-f\d]+) arg (0x[a-f\d]+)" + callout_mpsafe_re = re.compile(ktrhdr + ktrstr) + + ktrstr = "callout mtx 0x[a-f\d]+ " + ktrstr += "func (0x[a-f\d]+) arg (0x[a-f\d]+)" + callout_mtx_re = re.compile(ktrhdr + ktrstr) + + ktrstr = "callout 0x[a-f\d]+ finished" + callout_stop_re = re.compile(ktrhdr + ktrstr) + + ktrstr = "TRY_([RSWX]?LOCK) \(.*\) (.*) r = ([0-9]+)" + ktrstr += " at (?:\.\./)*(.*):([0-9]+)" + lock_try_re = re.compile(ktrhdr + ktrstr) + + ktrstr = "([RSWX]?UNLOCK) \(.*\) (.*) r = ([0-9]+)" + ktrstr += " at (?:\.\./)*(.*):([0-9]+)" + lock_release_re = re.compile(ktrhdr + ktrstr) + + ktrstr = "([RSWX]?LOCK) \(.*\) (.*) r = ([0-9]+)" + ktrstr += " at (?:\.\./)*(.*):([0-9]+)" + lock_acquire_re = re.compile(ktrhdr + ktrstr) + + ktrstr = "_mtx_lock_sleep: (.*) contested \(lock=0x?[0-9a-f]*\)" + ktrstr += " at (?:\.\./)*(.*):([0-9]+)" + mtx_contested_re = re.compile(ktrhdr + ktrstr) + + # XXX: Spin lock traces don't have lock name or file/line + + ktrstr = "_rw_wlock_hard: (.*) contested \(lock=0x?[0-9a-f]*\)" + ktrstr += " at (?:\.\./)*(.*):([0-9]+)" + rw_contested_re = re.compile(ktrhdr + ktrstr) + + # XXX: Read lock traces for rwlocks contesting don't have + # lock name or file/line + parsers = [[cpuload_re, self.cpuload], [cpuload2_re, self.cpuload2], [loadglobal_re, self.loadglobal], @@ -973,6 +1118,15 @@ class KTRFile: [sched_exit_re, self.sched_exit], [sched_clock_re, self.sched_clock], [critsec_re, self.critsec], + [callout_start_re, self.callout_start], + [callout_mpsafe_re, self.callout_start], + [callout_mtx_re, self.callout_start], + [callout_stop_re, self.callout_stop], + [lock_try_re, self.lock_try], + [lock_release_re, self.lock_release], + [lock_acquire_re, self.lock_acquire], + [mtx_contested_re, self.lock_contest], + [rw_contested_re, self.lock_contest], [idled_re, self.idled]] global lineno @@ -1162,6 +1316,74 @@ class KTRFile: self.sources.append(crit) Count(crit, cpu, timestamp, to) + def callout_start(self, cpu, timestamp, func, arg): + timestamp = self.checkstamp(cpu, timestamp) + if (timestamp == 0): + return + wheel = self.findwheel(cpu) + CalloutRunning(wheel, cpu, timestamp, func, arg) + + def callout_stop(self, cpu, timestamp): + timestamp = self.checkstamp(cpu, timestamp) + if (timestamp == 0): + return + wheel = self.findwheel(cpu) + CalloutIdle(wheel, cpu, timestamp) + + def lock_try(self, cpu, timestamp, op, name, result, file, line): + timestamp = self.checkstamp(cpu, timestamp) + if (timestamp == 0): + return + lock = self.findlock(name) + if (int(result) == 0): + LockFailedTry(lock, cpu, timestamp, file, line) + else: + LockAcquire(lock, cpu, timestamp, file, line) + + def lock_acquire(self, cpu, timestamp, op, name, recurse, file, line): + if (int(recurse) != 0): + return + timestamp = self.checkstamp(cpu, timestamp) + if (timestamp == 0): + return + lock = self.findlock(name) + LockAcquire(lock, cpu, timestamp, file, line) + + def lock_release(self, cpu, timestamp, op, name, recurse, file, line): + if (int(recurse) != 0): + return + timestamp = self.checkstamp(cpu, timestamp) + if (timestamp == 0): + return + lock = self.findlock(name) + LockRelease(lock, cpu, timestamp, file, line) + + def lock_contest(self, cpu, timestamp, name, file, line): + timestamp = self.checkstamp(cpu, timestamp) + if (timestamp == 0): + return + lock = self.findlock(name) + LockContest(lock, cpu, timestamp, file, line) + + def findlock(self, name): + try: + lock = self.locks[name] + except: + lock = Lock(name) + self.locks[name] = lock + self.sources.append(lock) + return (lock) + + def findwheel(self, cpu): + cpu = int(cpu) + try: + wheel = self.callwheels[cpu] + except: + wheel = Callwheel(cpu) + self.callwheels[cpu] = wheel + self.sources.append(wheel) + return (wheel) + def findtd(self, td, pcomm): for thread in self.threads: if (thread.str == td and thread.name == pcomm): @@ -1325,7 +1547,7 @@ class SchedGraph(Frame): self.menu = GraphMenu(self) self.display = SchedDisplay(self) self.names = Canvas(self, - width=100, height=self.display["height"], + width=120, height=self.display["height"], bg='grey', scrollregion=(0, 0, 50, 100)) self.scale = Scaler(self, self.display) status = self.status = Status(self) From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 16:48:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE8A51065673; Tue, 13 Jan 2009 16:48:01 +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 BC3D18FC0C; Tue, 13 Jan 2009 16:48:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DGm1NM009160; Tue, 13 Jan 2009 16:48:01 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DGm1Q8009159; Tue, 13 Jan 2009 16:48:01 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200901131648.n0DGm1Q8009159@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 13 Jan 2009 16:48:01 +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: r187157 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 16:48:02 -0000 Author: jkim Date: Tue Jan 13 16:48:01 2009 New Revision: 187157 URL: http://svn.freebsd.org/changeset/base/187157 Log: Enable MSI support for VIA Nano processors on i386 (missing in r187118). Modified: head/sys/i386/i386/msi.c Modified: head/sys/i386/i386/msi.c ============================================================================== --- head/sys/i386/i386/msi.c Tue Jan 13 16:44:18 2009 (r187156) +++ head/sys/i386/i386/msi.c Tue Jan 13 16:48:01 2009 (r187157) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* Fields in address for Intel MSI messages. */ @@ -212,9 +213,18 @@ msi_init(void) { /* Check if we have a supported CPU. */ - if (!(cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD)) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (I386_CPU_FAMILY(cpu_id) == 0x6 && + I386_CPU_MODEL(cpu_id) >= 0xf) + break; + /* FALLTHROUGH */ + default: return; + } msi_enabled = 1; intr_register_pic(&msi_pic); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 18:25:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC6B3106566B; Tue, 13 Jan 2009 18:25:56 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA8668FC19; Tue, 13 Jan 2009 18:25:56 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DIPuB0011142; Tue, 13 Jan 2009 18:25:56 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DIPuAO011141; Tue, 13 Jan 2009 18:25:56 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200901131825.n0DIPuAO011141@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 13 Jan 2009 18:25: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: r187159 - head/bin/kenv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 18:25:57 -0000 Author: maxim Date: Tue Jan 13 18:25:56 2009 New Revision: 187159 URL: http://svn.freebsd.org/changeset/base/187159 Log: o Fix a typo. Bump .Dd for the previous delta. Modified: head/bin/kenv/kenv.1 Modified: head/bin/kenv/kenv.1 ============================================================================== --- head/bin/kenv/kenv.1 Tue Jan 13 18:17:40 2009 (r187158) +++ head/bin/kenv/kenv.1 Tue Jan 13 18:25:56 2009 (r187159) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2005 +.Dd January 13, 2009 .Dt KENV 1 .Os .Sh NAME @@ -77,7 +77,7 @@ file, or also statically compiled into t in the kernel config file. The file can contain lines of the form .Pp -.Dl name = "value" # this is a coment +.Dl name = "value" # this is a comment .Pp where whitespace around name and '=', and everything after a '#' character, are ignored. Almost any printable From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 18:38:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 363E8106568C; Tue, 13 Jan 2009 18:38:19 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id EA1DE8FC16; Tue, 13 Jan 2009 18:38:18 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 0889773098; Tue, 13 Jan 2009 19:43:28 +0100 (CET) Date: Tue, 13 Jan 2009 19:43:28 +0100 From: Luigi Rizzo To: Maxim Konovalov Message-ID: <20090113184328.GD185@onelab2.iet.unipi.it> References: <200901131825.n0DIPuAO011141@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901131825.n0DIPuAO011141@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187159 - head/bin/kenv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 18:38:20 -0000 On Tue, Jan 13, 2009 at 06:25:56PM +0000, Maxim Konovalov wrote: > Author: maxim > Date: Tue Jan 13 18:25:56 2009 > New Revision: 187159 > URL: http://svn.freebsd.org/changeset/base/187159 > > Log: > o Fix a typo. Bump .Dd for the previous delta. thanks for the fix. BTW what's the policy for dates in the manpages ? My change was only a clarification of existing content, not documenting new features or a change of behaviour, that's why I felt it was not necessary to modify the date. But even for other cases I am never too sure on what to do... cheers luigi From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 18:49:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78DB31065713; Tue, 13 Jan 2009 18:49:35 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64A128FC2B; Tue, 13 Jan 2009 18:49:35 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DInZGR011678; Tue, 13 Jan 2009 18:49:35 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DInZVY011676; Tue, 13 Jan 2009 18:49:35 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131849.n0DInZVY011676@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 18:49: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: r187160 - in head/sys: dev/usb2/controller modules/usb2/controller_atmegadci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 18:49:36 -0000 Author: thompsa Date: Tue Jan 13 18:49:35 2009 New Revision: 187160 URL: http://svn.freebsd.org/changeset/base/187160 Log: MFp4: //depot/projects/usb@155869 Initial version of ATMEGA USB device controller driver. Has not been tested on real hardware yet. The driver is based upon the AT91DCI driver. Submitted by: Hans Petter Selasky Added: head/sys/dev/usb2/controller/atmegadci.c (contents, props changed) head/sys/dev/usb2/controller/atmegadci.h (contents, props changed) head/sys/dev/usb2/controller/atmegadci_atmelarm.c (contents, props changed) head/sys/modules/usb2/controller_atmegadci/ head/sys/modules/usb2/controller_atmegadci/Makefile (contents, props changed) Added: head/sys/dev/usb2/controller/atmegadci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb2/controller/atmegadci.c Tue Jan 13 18:49:35 2009 (r187160) @@ -0,0 +1,2327 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2009 Hans Petter Selasky. 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. + */ + +/* + * This file contains the driver for the ATMEGA series USB Device + * Controller + */ + +/* + * NOTE: When the chip detects BUS-reset it will also reset the + * endpoints, Function-address and more. + */ + +#include +#include +#include +#include + +#define USB_DEBUG_VAR atmegadci_debug + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define ATMEGA_BUS2SC(bus) \ + ((struct atmegadci_softc *)(((uint8_t *)(bus)) - \ + USB_P2U(&(((struct atmegadci_softc *)0)->sc_bus)))) + +#define ATMEGA_PC2SC(pc) \ + ATMEGA_BUS2SC((pc)->tag_parent->info->bus) + +#if USB_DEBUG +static int atmegadci_debug = 0; + +SYSCTL_NODE(_hw_usb2, OID_AUTO, atmegadci, CTLFLAG_RW, 0, "USB ATMEGA DCI"); +SYSCTL_INT(_hw_usb2_atmegadci, OID_AUTO, debug, CTLFLAG_RW, + &atmegadci_debug, 0, "ATMEGA DCI debug level"); +#endif + +#define ATMEGA_INTR_ENDPT 1 + +/* prototypes */ + +struct usb2_bus_methods atmegadci_bus_methods; +struct usb2_pipe_methods atmegadci_device_bulk_methods; +struct usb2_pipe_methods atmegadci_device_ctrl_methods; +struct usb2_pipe_methods atmegadci_device_intr_methods; +struct usb2_pipe_methods atmegadci_device_isoc_fs_methods; +struct usb2_pipe_methods atmegadci_root_ctrl_methods; +struct usb2_pipe_methods atmegadci_root_intr_methods; + +static atmegadci_cmd_t atmegadci_setup_rx; +static atmegadci_cmd_t atmegadci_data_rx; +static atmegadci_cmd_t atmegadci_data_tx; +static atmegadci_cmd_t atmegadci_data_tx_sync; +static void atmegadci_device_done(struct usb2_xfer *, usb2_error_t); +static void atmegadci_do_poll(struct usb2_bus *); +static void atmegadci_root_ctrl_poll(struct atmegadci_softc *); +static void atmegadci_standard_done(struct usb2_xfer *); + +static usb2_sw_transfer_func_t atmegadci_root_intr_done; +static usb2_sw_transfer_func_t atmegadci_root_ctrl_done; + +/* + * Here is a list of what the chip supports: + */ +static const struct usb2_hw_ep_profile + atmegadci_ep_profile[2] = { + + [0] = { + .max_in_frame_size = 64, + .max_out_frame_size = 64, + .is_simplex = 1, + .support_control = 1, + }, + [1] = { + .max_in_frame_size = 64, + .max_out_frame_size = 64, + .is_simplex = 1, + .support_multi_buffer = 1, + .support_bulk = 1, + .support_interrupt = 1, + .support_isochronous = 1, + .support_in = 1, + .support_out = 1, + }, +}; + +static void +atmegadci_get_hw_ep_profile(struct usb2_device *udev, + const struct usb2_hw_ep_profile **ppf, uint8_t ep_addr) +{ + if (ep_addr == 0) + *ppf = atmegadci_ep_profile; + else if (ep_addr < ATMEGA_EP_MAX) + *ppf = atmegadci_ep_profile + 1; + else + *ppf = NULL; +} + +static void +atmegadci_clocks_on(struct atmegadci_softc *sc) +{ + if (sc->sc_flags.clocks_off && + sc->sc_flags.port_powered) { + + DPRINTFN(5, "\n"); + + /* turn on clocks */ + (sc->sc_clocks_on) (&sc->sc_bus); + + ATMEGA_WRITE_1(sc, ATMEGA_USBCON, + ATMEGA_USBCON_USBE | + ATMEGA_USBCON_OTGPADE | + ATMEGA_USBCON_VBUSTE); + + sc->sc_flags.clocks_off = 0; + + /* enable transceiver ? */ + } +} + +static void +atmegadci_clocks_off(struct atmegadci_softc *sc) +{ + if (!sc->sc_flags.clocks_off) { + + DPRINTFN(5, "\n"); + + /* disable Transceiver ? */ + + ATMEGA_WRITE_1(sc, ATMEGA_USBCON, + ATMEGA_USBCON_USBE | + ATMEGA_USBCON_OTGPADE | + ATMEGA_USBCON_FRZCLK | + ATMEGA_USBCON_VBUSTE); + + /* turn clocks off */ + (sc->sc_clocks_off) (&sc->sc_bus); + + sc->sc_flags.clocks_off = 1; + } +} + +static void +atmegadci_pull_up(struct atmegadci_softc *sc) +{ + /* pullup D+, if possible */ + + if (!sc->sc_flags.d_pulled_up && + sc->sc_flags.port_powered) { + sc->sc_flags.d_pulled_up = 1; + ATMEGA_WRITE_1(sc, ATMEGA_UDCON, 0); + } +} + +static void +atmegadci_pull_down(struct atmegadci_softc *sc) +{ + /* pulldown D+, if possible */ + + if (sc->sc_flags.d_pulled_up) { + sc->sc_flags.d_pulled_up = 0; + ATMEGA_WRITE_1(sc, ATMEGA_UDCON, ATMEGA_UDCON_DETACH); + } +} + +static void +atmegadci_wakeup_peer(struct usb2_xfer *xfer) +{ + struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); + uint8_t use_polling; + uint8_t temp; + + if (!sc->sc_flags.status_suspend) { + return; + } + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; + + temp = ATMEGA_READ_1(sc, ATMEGA_UDCON); + ATMEGA_WRITE_1(sc, ATMEGA_UDCON, temp | ATMEGA_UDCON_RMWKUP); + + /* wait 8 milliseconds */ + if (use_polling) { + /* polling */ + DELAY(8000); + } else { + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, 8); + } + + /* hardware should have cleared RMWKUP bit */ +} + +static void +atmegadci_set_address(struct atmegadci_softc *sc, uint8_t addr) +{ + DPRINTFN(5, "addr=%d\n", addr); + + ATMEGA_WRITE_1(sc, ATMEGA_UDADDR, addr); + + addr |= ATMEGA_UDADDR_ADDEN; + + ATMEGA_WRITE_1(sc, ATMEGA_UDADDR, addr); +} + +static uint8_t +atmegadci_setup_rx(struct atmegadci_td *td) +{ + struct atmegadci_softc *sc; + struct usb2_device_request req; + uint16_t count; + uint8_t temp; + + /* get pointer to softc */ + sc = ATMEGA_PC2SC(td->pc); + + /* select endpoint number */ + ATMEGA_WRITE_1(sc, ATMEGA_UENUM, td->ep_no); + + /* check endpoint status */ + temp = ATMEGA_READ_1(sc, ATMEGA_UEINTX); + + DPRINTFN(5, "UEINTX=0x%02x\n", temp); + + if (!(temp & ATMEGA_UEINTX_RXSTPI)) { + /* abort any ongoing transfer */ + if (!td->did_stall) { + DPRINTFN(5, "stalling\n"); + ATMEGA_WRITE_1(sc, ATMEGA_UECONX, + ATMEGA_UECONX_EPEN | + ATMEGA_UECONX_STALLRQ); + td->did_stall = 1; + } + goto not_complete; + } + /* get the packet byte count */ + count = + (ATMEGA_READ_1(sc, ATMEGA_UEBCHX) << 8) | + (ATMEGA_READ_1(sc, ATMEGA_UEBCLX)); + + /* mask away undefined bits */ + count &= 0x7FF; + + /* verify data length */ + if (count != td->remainder) { + DPRINTFN(0, "Invalid SETUP packet " + "length, %d bytes\n", count); + goto not_complete; + } + if (count != sizeof(req)) { + DPRINTFN(0, "Unsupported SETUP packet " + "length, %d bytes\n", count); + goto not_complete; + } + /* receive data */ + ATMEGA_READ_MULTI_1(sc, ATMEGA_UEDATX, + (void *)&req, sizeof(req)); + + /* copy data into real buffer */ + usb2_copy_in(td->pc, 0, &req, sizeof(req)); + + td->offset = sizeof(req); + td->remainder = 0; + + /* sneak peek the set address */ + if ((req.bmRequestType == UT_WRITE_DEVICE) && + (req.bRequest == UR_SET_ADDRESS)) { + sc->sc_dv_addr = req.wValue[0] & 0x7F; + } else { + sc->sc_dv_addr = 0xFF; + } + + /* clear SETUP packet interrupt */ + ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, ~ATMEGA_UEINTX_RXSTPI); + return (0); /* complete */ + +not_complete: + /* we only want to know if there is a SETUP packet */ + ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, ATMEGA_UEIENX_RXSTPE); + return (1); /* not complete */ +} + +static uint8_t +atmegadci_data_rx(struct atmegadci_td *td) +{ + struct atmegadci_softc *sc; + struct usb2_page_search buf_res; + uint16_t count; + uint8_t temp; + uint8_t to; + uint8_t got_short; + + to = 3; /* don't loop forever! */ + got_short = 0; + + /* get pointer to softc */ + sc = ATMEGA_PC2SC(td->pc); + + /* select endpoint number */ + ATMEGA_WRITE_1(sc, ATMEGA_UENUM, td->ep_no); + +repeat: + /* check if any of the FIFO banks have data */ + /* check endpoint status */ + temp = ATMEGA_READ_1(sc, ATMEGA_UEINTX); + + DPRINTFN(5, "temp=0x%02x rem=%u\n", temp, td->remainder); + + if (temp & ATMEGA_UEINTX_RXSTPI) { + if (td->remainder == 0) { + /* + * We are actually complete and have + * received the next SETUP + */ + DPRINTFN(5, "faking complete\n"); + return (0); /* complete */ + } + /* + * USB Host Aborted the transfer. + */ + td->error = 1; + return (0); /* complete */ + } + /* check status */ + if (!(temp & (ATMEGA_UEINTX_FIFOCON | + ATMEGA_UEINTX_RXOUTI))) { + /* no data */ + goto not_complete; + } + /* get the packet byte count */ + count = + (ATMEGA_READ_1(sc, ATMEGA_UEBCHX) << 8) | + (ATMEGA_READ_1(sc, ATMEGA_UEBCLX)); + + /* mask away undefined bits */ + count &= 0x7FF; + + /* verify the packet byte count */ + if (count != td->max_packet_size) { + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error = 1; + return (0); /* we are complete */ + } + } + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error = 1; + return (0); /* we are complete */ + } + while (count > 0) { + usb2_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) { + buf_res.length = count; + } + /* receive data */ + ATMEGA_READ_MULTI_1(sc, ATMEGA_UEDATX, + buf_res.buffer, buf_res.length); + + /* update counters */ + count -= buf_res.length; + td->offset += buf_res.length; + td->remainder -= buf_res.length; + } + + /* clear OUT packet interrupt */ + ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, ATMEGA_UEINTX_RXOUTI ^ 0xFF); + + /* release FIFO bank */ + ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, ATMEGA_UEINTX_FIFOCON ^ 0xFF); + + /* check if we are complete */ + if ((td->remainder == 0) || got_short) { + if (td->short_pkt) { + /* we are complete */ + return (0); + } + /* else need to receive a zero length packet */ + } + if (--to) { + goto repeat; + } +not_complete: + /* we only want to know if there is a SETUP packet or OUT packet */ + ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, + ATMEGA_UEIENX_RXSTPE | ATMEGA_UEIENX_RXOUTE); + return (1); /* not complete */ +} + +static uint8_t +atmegadci_data_tx(struct atmegadci_td *td) +{ + struct atmegadci_softc *sc; + struct usb2_page_search buf_res; + uint16_t count; + uint8_t to; + uint8_t temp; + + to = 3; /* don't loop forever! */ + + /* get pointer to softc */ + sc = ATMEGA_PC2SC(td->pc); + + /* select endpoint number */ + ATMEGA_WRITE_1(sc, ATMEGA_UENUM, td->ep_no); + +repeat: + + /* check endpoint status */ + temp = ATMEGA_READ_1(sc, ATMEGA_UEINTX); + + DPRINTFN(5, "temp=0x%02x rem=%u\n", temp, td->remainder); + + if (temp & ATMEGA_UEINTX_RXSTPI) { + /* + * The current transfer was aborted + * by the USB Host + */ + td->error = 1; + return (0); /* complete */ + } + if (!(temp & (ATMEGA_UEINTX_FIFOCON | + ATMEGA_UEINTX_TXINI))) { + /* cannot write any data */ + goto not_complete; + } + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } + while (count > 0) { + + usb2_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) { + buf_res.length = count; + } + /* transmit data */ + ATMEGA_WRITE_MULTI_1(sc, ATMEGA_UEDATX, + buf_res.buffer, buf_res.length); + + /* update counters */ + count -= buf_res.length; + td->offset += buf_res.length; + td->remainder -= buf_res.length; + } + + /* clear IN packet interrupt */ + ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, 0xFF ^ ATMEGA_UEINTX_TXINI); + + /* allocate FIFO bank */ + ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, 0xFF ^ ATMEGA_UEINTX_FIFOCON); + + /* check remainder */ + if (td->remainder == 0) { + if (td->short_pkt) { + return (0); /* complete */ + } + /* else we need to transmit a short packet */ + } + if (--to) { + goto repeat; + } +not_complete: + /* we only want to know if there is a SETUP packet or free IN packet */ + ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, + ATMEGA_UEIENX_RXSTPE | ATMEGA_UEIENX_TXINE); + return (1); /* not complete */ +} + +static uint8_t +atmegadci_data_tx_sync(struct atmegadci_td *td) +{ + struct atmegadci_softc *sc; + uint8_t temp; + + /* get pointer to softc */ + sc = ATMEGA_PC2SC(td->pc); + + /* select endpoint number */ + ATMEGA_WRITE_1(sc, ATMEGA_UENUM, td->ep_no); + + /* check endpoint status */ + temp = ATMEGA_READ_1(sc, ATMEGA_UEINTX); + + DPRINTFN(5, "temp=0x%02x\n", temp); + + if (temp & ATMEGA_UEINTX_RXSTPI) { + DPRINTFN(5, "faking complete\n"); + /* Race condition */ + return (0); /* complete */ + } + /* + * The control endpoint has only got one bank, so if that bank + * is free the packet has been transferred! + */ + if (!(temp & (ATMEGA_UEINTX_FIFOCON | + ATMEGA_UEINTX_TXINI))) { + /* cannot write any data */ + goto not_complete; + } + if (sc->sc_dv_addr != 0xFF) { + /* set new address */ + atmegadci_set_address(sc, sc->sc_dv_addr); + } + return (0); /* complete */ + +not_complete: + /* we only want to know if there is a SETUP packet or free IN packet */ + ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, + ATMEGA_UEIENX_RXSTPE | ATMEGA_UEIENX_TXINE); + return (1); /* not complete */ +} + +static uint8_t +atmegadci_xfer_do_fifo(struct usb2_xfer *xfer) +{ + struct atmegadci_td *td; + + DPRINTFN(9, "\n"); + + td = xfer->td_transfer_cache; + while (1) { + if ((td->func) (td)) { + /* operation in progress */ + break; + } + if (((void *)td) == xfer->td_transfer_last) { + goto done; + } + if (td->error) { + goto done; + } else if (td->remainder > 0) { + /* + * We had a short transfer. If there is no alternate + * next, stop processing ! + */ + if (!td->alt_next) { + goto done; + } + } + /* + * Fetch the next transfer descriptor and transfer + * some flags to the next transfer descriptor + */ + td = td->obj_next; + xfer->td_transfer_cache = td; + } + return (1); /* not complete */ + +done: + /* compute all actual lengths */ + + atmegadci_standard_done(xfer); + return (0); /* complete */ +} + +static void +atmegadci_interrupt_poll(struct atmegadci_softc *sc) +{ + struct usb2_xfer *xfer; + +repeat: + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + if (!atmegadci_xfer_do_fifo(xfer)) { + /* queue has been modified */ + goto repeat; + } + } +} + +static void +atmegadci_vbus_interrupt(struct atmegadci_softc *sc, uint8_t is_on) +{ + DPRINTFN(5, "vbus = %u\n", is_on); + + if (is_on) { + if (!sc->sc_flags.status_vbus) { + sc->sc_flags.status_vbus = 1; + + /* complete root HUB interrupt endpoint */ + + usb2_sw_transfer(&sc->sc_root_intr, + &atmegadci_root_intr_done); + } + } else { + if (sc->sc_flags.status_vbus) { + sc->sc_flags.status_vbus = 0; + sc->sc_flags.status_bus_reset = 0; + sc->sc_flags.status_suspend = 0; + sc->sc_flags.change_suspend = 0; + sc->sc_flags.change_connect = 1; + + /* complete root HUB interrupt endpoint */ + + usb2_sw_transfer(&sc->sc_root_intr, + &atmegadci_root_intr_done); + } + } +} + +void +atmegadci_interrupt(struct atmegadci_softc *sc) +{ + uint8_t status; + + USB_BUS_LOCK(&sc->sc_bus); + + /* read interrupt status */ + status = ATMEGA_READ_1(sc, ATMEGA_UDINT); + + /* clear all set interrupts */ + ATMEGA_WRITE_1(sc, ATMEGA_UDINT, ~status); + + /* check for any bus state change interrupts */ + if (status & ATMEGA_UDINT_EORSTI) { + + DPRINTFN(5, "end of reset\n"); + + /* set correct state */ + sc->sc_flags.status_bus_reset = 1; + sc->sc_flags.status_suspend = 0; + sc->sc_flags.change_suspend = 0; + sc->sc_flags.change_connect = 1; + + /* disable resume interrupt */ + ATMEGA_WRITE_1(sc, ATMEGA_UDIEN, + ATMEGA_UDINT_SUSPE | + ATMEGA_UDINT_EORSTE); + + /* complete root HUB interrupt endpoint */ + usb2_sw_transfer(&sc->sc_root_intr, + &atmegadci_root_intr_done); + } + /* + * If resume and suspend is set at the same time we interpret + * that like RESUME. Resume is set when there is at least 3 + * milliseconds of inactivity on the USB BUS. + */ + if (status & ATMEGA_UDINT_EORSMI) { + + DPRINTFN(5, "resume interrupt\n"); + + if (sc->sc_flags.status_suspend) { + /* update status bits */ + sc->sc_flags.status_suspend = 0; + sc->sc_flags.change_suspend = 1; + + /* disable resume interrupt */ + ATMEGA_WRITE_1(sc, ATMEGA_UDIEN, + ATMEGA_UDINT_SUSPE | + ATMEGA_UDINT_EORSTE); + + /* complete root HUB interrupt endpoint */ + usb2_sw_transfer(&sc->sc_root_intr, + &atmegadci_root_intr_done); + } + } else if (status & ATMEGA_UDINT_SUSPI) { + + DPRINTFN(5, "suspend interrupt\n"); + + if (!sc->sc_flags.status_suspend) { + /* update status bits */ + sc->sc_flags.status_suspend = 1; + sc->sc_flags.change_suspend = 1; + + /* disable suspend interrupt */ + ATMEGA_WRITE_1(sc, ATMEGA_UDIEN, + ATMEGA_UDINT_EORSMI | + ATMEGA_UDINT_EORSTE); + + /* complete root HUB interrupt endpoint */ + usb2_sw_transfer(&sc->sc_root_intr, + &atmegadci_root_intr_done); + } + } + /* check VBUS */ + status = ATMEGA_READ_1(sc, ATMEGA_USBINT); + + /* clear all set interrupts */ + ATMEGA_WRITE_1(sc, ATMEGA_USBINT, ~status); + + if (status & ATMEGA_USBINT_VBUSTI) { + uint8_t temp; + + temp = ATMEGA_READ_1(sc, ATMEGA_USBSTA); + atmegadci_vbus_interrupt(sc, temp & ATMEGA_USBSTA_VBUS); + } + /* check for any endpoint interrupts */ + status = ATMEGA_READ_1(sc, ATMEGA_UEINT); + + /* clear all set interrupts */ + ATMEGA_WRITE_1(sc, ATMEGA_UEINT, ~status); + + if (status) { + + DPRINTFN(5, "real endpoint interrupt 0x%02x\n", status); + + atmegadci_interrupt_poll(sc); + } + USB_BUS_UNLOCK(&sc->sc_bus); +} + +static void +atmegadci_setup_standard_chain_sub(struct atmegadci_std_temp *temp) +{ + struct atmegadci_td *td; + + /* get current Transfer Descriptor */ + td = temp->td_next; + temp->td = td; + + /* prepare for next TD */ + temp->td_next = td->obj_next; + + /* fill out the Transfer Descriptor */ + td->func = temp->func; + td->pc = temp->pc; + td->offset = temp->offset; + td->remainder = temp->len; + td->error = 0; + td->did_stall = 0; + td->short_pkt = temp->short_pkt; + td->alt_next = temp->setup_alt_next; +} + +static void +atmegadci_setup_standard_chain(struct usb2_xfer *xfer) +{ + struct atmegadci_std_temp temp; + struct atmegadci_softc *sc; + struct atmegadci_td *td; + uint32_t x; + uint8_t ep_no; + uint8_t need_sync; + + DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", + xfer->address, UE_GET_ADDR(xfer->endpoint), + xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); + + temp.max_frame_size = xfer->max_frame_size; + + td = xfer->td_start[0]; + xfer->td_transfer_first = td; + xfer->td_transfer_cache = td; + + /* setup temp */ + + temp.td = NULL; + temp.td_next = xfer->td_start[0]; + temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.offset = 0; + + sc = ATMEGA_BUS2SC(xfer->xroot->bus); + ep_no = (xfer->endpoint & UE_ADDR); + + /* check if we should prepend a setup message */ + + if (xfer->flags_int.control_xfr) { + if (xfer->flags_int.control_hdr) { + + temp.func = &atmegadci_setup_rx; + temp.len = xfer->frlengths[0]; + temp.pc = xfer->frbuffers + 0; + temp.short_pkt = temp.len ? 1 : 0; + + atmegadci_setup_standard_chain_sub(&temp); + } + x = 1; + } else { + x = 0; + } + + if (x != xfer->nframes) { + if (xfer->endpoint & UE_DIR_IN) { + temp.func = &atmegadci_data_tx; + need_sync = 1; + } else { + temp.func = &atmegadci_data_rx; + need_sync = 0; + } + + /* setup "pc" pointer */ + temp.pc = xfer->frbuffers + x; + } else { + need_sync = 0; + } + while (x != xfer->nframes) { + + /* DATA0 / DATA1 message */ + + temp.len = xfer->frlengths[x]; + + x++; + + if (x == xfer->nframes) { + temp.setup_alt_next = 0; + } + if (temp.len == 0) { + + /* make sure that we send an USB packet */ + + temp.short_pkt = 0; + + } else { + + /* regular data transfer */ + + temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; + } + + atmegadci_setup_standard_chain_sub(&temp); + + if (xfer->flags_int.isochronous_xfr) { + temp.offset += temp.len; + } else { + /* get next Page Cache pointer */ + temp.pc = xfer->frbuffers + x; + } + } + + /* always setup a valid "pc" pointer for status and sync */ + temp.pc = xfer->frbuffers + 0; + + /* check if we need to sync */ + if (need_sync && xfer->flags_int.control_xfr) { + + /* we need a SYNC point after TX */ + temp.func = &atmegadci_data_tx_sync; + temp.len = 0; + temp.short_pkt = 0; + + atmegadci_setup_standard_chain_sub(&temp); + } + /* check if we should append a status stage */ + if (xfer->flags_int.control_xfr && + !xfer->flags_int.control_act) { + + /* + * Send a DATA1 message and invert the current + * endpoint direction. + */ + if (xfer->endpoint & UE_DIR_IN) { + temp.func = &atmegadci_data_rx; + need_sync = 0; + } else { + temp.func = &atmegadci_data_tx; + need_sync = 1; + } + temp.len = 0; + temp.short_pkt = 0; + + atmegadci_setup_standard_chain_sub(&temp); + if (need_sync) { + /* we need a SYNC point after TX */ + temp.func = &atmegadci_data_tx_sync; + temp.len = 0; + temp.short_pkt = 0; + + atmegadci_setup_standard_chain_sub(&temp); + } + } + /* must have at least one frame! */ + td = temp.td; + xfer->td_transfer_last = td; +} + +static void +atmegadci_timeout(void *arg) +{ + struct usb2_xfer *xfer = arg; + + DPRINTF("xfer=%p\n", xfer); + + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); + + /* transfer is transferred */ + atmegadci_device_done(xfer, USB_ERR_TIMEOUT); +} + +static void +atmegadci_start_standard_chain(struct usb2_xfer *xfer) +{ + DPRINTFN(9, "\n"); + + /* poll one time - will turn on interrupts */ + if (atmegadci_xfer_do_fifo(xfer)) { + + /* put transfer on interrupt queue */ + usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); + + /* start timeout, if any */ + if (xfer->timeout != 0) { + usb2_transfer_timeout_ms(xfer, + &atmegadci_timeout, xfer->timeout); + } + } +} + +static void +atmegadci_root_intr_done(struct usb2_xfer *xfer, + struct usb2_sw_transfer *std) +{ + struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); + + DPRINTFN(9, "\n"); + + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); + + if (std->state != USB_SW_TR_PRE_DATA) { + if (std->state == USB_SW_TR_PRE_CALLBACK) { + /* transfer transferred */ + atmegadci_device_done(xfer, std->err); + } + goto done; + } + /* setup buffer */ + std->ptr = sc->sc_hub_idata; + std->len = sizeof(sc->sc_hub_idata); + + /* set port bit */ + sc->sc_hub_idata[0] = 0x02; /* we only have one port */ + +done: + return; +} + +static usb2_error_t +atmegadci_standard_done_sub(struct usb2_xfer *xfer) +{ + struct atmegadci_td *td; + uint32_t len; + uint8_t error; + + DPRINTFN(9, "\n"); + + td = xfer->td_transfer_cache; + + do { + len = td->remainder; + + if (xfer->aframes != xfer->nframes) { + /* + * Verify the length and subtract + * the remainder from "frlengths[]": + */ + if (len > xfer->frlengths[xfer->aframes]) { + td->error = 1; + } else { + xfer->frlengths[xfer->aframes] -= len; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 18:55:33 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8E371065688; Tue, 13 Jan 2009 18:55:33 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (cl-2958.ham-01.de.sixxs.net [IPv6:2001:6f8:900:b8d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 40CE98FC1A; Tue, 13 Jan 2009 18:55:33 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.2/8.14.2) with ESMTP id n0DItVoN032694; Tue, 13 Jan 2009 21:55:32 +0300 (MSK) (envelope-from maxim@macomnet.ru) Date: Tue, 13 Jan 2009 21:55:31 +0300 (MSK) From: Maxim Konovalov To: Luigi Rizzo In-Reply-To: <20090113184328.GD185@onelab2.iet.unipi.it> Message-ID: <20090113215048.R31786@mp2.macomnet.net> References: <200901131825.n0DIPuAO011141@svn.freebsd.org> <20090113184328.GD185@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r187159 - head/bin/kenv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 18:55:34 -0000 On Tue, 13 Jan 2009, 19:43+0100, Luigi Rizzo wrote: > On Tue, Jan 13, 2009 at 06:25:56PM +0000, Maxim Konovalov wrote: > > Author: maxim > > Date: Tue Jan 13 18:25:56 2009 > > New Revision: 187159 > > URL: http://svn.freebsd.org/changeset/base/187159 > > > > Log: > > o Fix a typo. Bump .Dd for the previous delta. > > thanks for the fix. > > BTW what's the policy for dates in the manpages ? My change was only > a clarification of existing content, not documenting new features or > a change of behaviour, that's why I felt it was not necessary to > modify the date. But even for other cases I am never too sure on > what to do... > just intuition :-) -- Maxim Konovalov From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:01:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B33F61065679; Tue, 13 Jan 2009 19:01:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FCCA8FC13; Tue, 13 Jan 2009 19:01:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ13WS011942; Tue, 13 Jan 2009 19:01:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ13NM011941; Tue, 13 Jan 2009 19:01:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131901.n0DJ13NM011941@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:01:03 +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: r187161 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:01:05 -0000 Author: thompsa Date: Tue Jan 13 19:01:03 2009 New Revision: 187161 URL: http://svn.freebsd.org/changeset/base/187161 Log: MFp4: //depot/projects/usb@155730 Config index should be zero. Reported by: Stanislav Sedov Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/serial/ubsa2.c Modified: head/sys/dev/usb2/serial/ubsa2.c ============================================================================== --- head/sys/dev/usb2/serial/ubsa2.c Tue Jan 13 18:49:35 2009 (r187160) +++ head/sys/dev/usb2/serial/ubsa2.c Tue Jan 13 19:01:03 2009 (r187161) @@ -92,7 +92,7 @@ SYSCTL_INT(_hw_usb2_ubsa, OID_AUTO, debu #define UBSA_N_TRANSFER 6 /* units */ #define UBSA_BSIZE 1024 /* bytes */ -#define UBSA_CONFIG_INDEX 1 +#define UBSA_CONFIG_INDEX 0 #define UBSA_IFACE_INDEX 0 #define UBSA_REG_BAUDRATE 0x00 From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:01:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAC01065672; Tue, 13 Jan 2009 19:01:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69D208FC1D; Tue, 13 Jan 2009 19:01:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ1EEq011981; Tue, 13 Jan 2009 19:01:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ1EF1011980; Tue, 13 Jan 2009 19:01:14 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131901.n0DJ1EF1011980@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:01: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: r187162 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:01:15 -0000 Author: thompsa Date: Tue Jan 13 19:01:14 2009 New Revision: 187162 URL: http://svn.freebsd.org/changeset/base/187162 Log: MFp4: //depot/projects/usb@155731 Make printout more informative. Reported by: Volker Submitted by: Hans Petter Selasky Modified: head/usr.sbin/usbconfig/usbconfig.c Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Tue Jan 13 19:01:03 2009 (r187161) +++ head/usr.sbin/usbconfig/usbconfig.c Tue Jan 13 19:01:14 2009 (r187162) @@ -562,7 +562,7 @@ flush_command(struct libusb20_backend *p } if (matches == 0) { - printf("No device match\n"); + printf("No device match or lack of permissions.\n"); } done: reset_options(opt); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:01:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 775AD1065674; Tue, 13 Jan 2009 19:01:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65A1A8FC18; Tue, 13 Jan 2009 19:01:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ1POC012022; Tue, 13 Jan 2009 19:01:25 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ1PXY012020; Tue, 13 Jan 2009 19:01:25 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131901.n0DJ1PXY012020@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:01: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: r187163 - in head/sys/dev: usb usb2/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:01:26 -0000 Author: thompsa Date: Tue Jan 13 19:01:25 2009 New Revision: 187163 URL: http://svn.freebsd.org/changeset/base/187163 Log: MFp4: //depot/projects/usb@155748 Umass module quirk from Alexander Best to support Meizu Electronics MiniPlayer. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb2/storage/umass2.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jan 13 19:01:14 2009 (r187162) +++ head/sys/dev/usb/usbdevs Tue Jan 13 19:01:25 2009 (r187163) @@ -151,6 +151,7 @@ vendor PLANTRONICS 0x047f Plantronics vendor KYOCERA 0x0482 Kyocera Wireless Corp. vendor STMICRO 0x0483 STMicroelectronics vendor FOXCONN 0x0489 Foxconn +vendor MEIZU 0x0492 Meizu Electronics vendor YAMAHA 0x0499 YAMAHA vendor COMPAQ 0x049f Compaq vendor HITACHI 0x04a4 Hitachi @@ -1657,6 +1658,9 @@ product MCT DU_H3SP_USB232 0x0200 D-Link product MCT USB232 0x0210 USB-232 Interface product MCT SITECOM_USB232 0x0230 Sitecom USB-232 Products +/* Meizu Electronics */ +product MEIZU M6_SL 0x0140 MiniPlayer M6 (SL) + /* Melco, Inc products */ product MELCO LUATX1 0x0001 LUA-TX Ethernet product MELCO LUATX5 0x0005 LUA-TX Ethernet Modified: head/sys/dev/usb2/storage/umass2.c ============================================================================== --- head/sys/dev/usb2/storage/umass2.c Tue Jan 13 19:01:14 2009 (r187162) +++ head/sys/dev/usb2/storage/umass2.c Tue Jan 13 19:01:25 2009 (r187163) @@ -916,6 +916,10 @@ static const struct umass_devdescr umass UMASS_PROTO_ATAPI | UMASS_PROTO_CBI, NO_QUIRKS }, + {USB_VENDOR_MEIZU, USB_PRODUCT_MEIZU_M6_SL, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_INQUIRY | NO_SYNCHRONIZE_CACHE + }, {VID_EOT, PID_EOT, RID_EOT, 0, 0} }; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:01:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A9911065673; Tue, 13 Jan 2009 19:01:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 380488FC08; Tue, 13 Jan 2009 19:01:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ1ahN012061; Tue, 13 Jan 2009 19:01:36 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ1ail012059; Tue, 13 Jan 2009 19:01:36 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131901.n0DJ1ail012059@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:01: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: r187164 - head/sys/dev/usb2/core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:01:37 -0000 Author: thompsa Date: Tue Jan 13 19:01:35 2009 New Revision: 187164 URL: http://svn.freebsd.org/changeset/base/187164 Log: MFp4: //depot/projects/usb@155750 Patch to resolve problems with power mode off. Reported by Alexander Best. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_generic.c head/sys/dev/usb2/core/usb2_hub.c Modified: head/sys/dev/usb2/core/usb2_generic.c ============================================================================== --- head/sys/dev/usb2/core/usb2_generic.c Tue Jan 13 19:01:25 2009 (r187163) +++ head/sys/dev/usb2/core/usb2_generic.c Tue Jan 13 19:01:35 2009 (r187164) @@ -1699,11 +1699,12 @@ ugen_set_power_mode(struct usb2_fifo *f, } switch (mode) { case USB_POWER_MODE_OFF: - /* clear suspend */ - err = usb2_req_clear_port_feature(udev->parent_hub, - NULL, udev->port_no, UHF_PORT_SUSPEND); - if (err) - break; + /* get the device unconfigured */ + err = ugen_set_config(f, USB_UNCONFIG_INDEX); + if (err) { + DPRINTFN(0, "Could not unconfigure " + "device (ignored)\n"); + } /* clear port enable */ err = usb2_req_clear_port_feature(udev->parent_hub, Modified: head/sys/dev/usb2/core/usb2_hub.c ============================================================================== --- head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:01:25 2009 (r187163) +++ head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:01:35 2009 (r187164) @@ -1823,7 +1823,8 @@ void usb2_set_power_mode(struct usb2_device *udev, uint8_t power_mode) { /* filter input argument */ - if (power_mode != USB_POWER_MODE_ON) { + if ((power_mode != USB_POWER_MODE_ON) && + (power_mode != USB_POWER_MODE_OFF)) { power_mode = USB_POWER_MODE_SAVE; } udev->power_mode = power_mode; /* update copy of power mode */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:01:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F86010656F4; Tue, 13 Jan 2009 19:01:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6318FC38; Tue, 13 Jan 2009 19:01:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ1kfc012100; Tue, 13 Jan 2009 19:01:46 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ1k0T012099; Tue, 13 Jan 2009 19:01:46 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131901.n0DJ1k0T012099@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:01: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: r187165 - head/sys/dev/usb2/sound X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:01:49 -0000 Author: thompsa Date: Tue Jan 13 19:01:46 2009 New Revision: 187165 URL: http://svn.freebsd.org/changeset/base/187165 Log: MFp4: //depot/projects/usb@155754 Make sure that the cancelled error code is always checked and result in a return from the USB callback. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/sound/uaudio2.c Modified: head/sys/dev/usb2/sound/uaudio2.c ============================================================================== --- head/sys/dev/usb2/sound/uaudio2.c Tue Jan 13 19:01:35 2009 (r187164) +++ head/sys/dev/usb2/sound/uaudio2.c Tue Jan 13 19:01:46 2009 (r187165) @@ -2921,6 +2921,8 @@ uaudio_mixer_write_cfg_callback(struct u uint8_t chan; uint8_t buf[2]; + DPRINTF("\n"); + switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: tr_transferred: @@ -2980,11 +2982,14 @@ tr_setup: if (repeat) { goto tr_setup; } - return; + break; default: /* Error */ DPRINTF("error=%s\n", usb2_errstr(xfer->error)); - + if (xfer->error == USB_ERR_CANCELLED) { + /* do nothing - we are detaching */ + break; + } goto tr_transferred; } } From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:01:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8156A106578C; Tue, 13 Jan 2009 19:01:57 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37A4C8FC20; Tue, 13 Jan 2009 19:01:57 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ1vWW012139; Tue, 13 Jan 2009 19:01:57 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ1vkT012138; Tue, 13 Jan 2009 19:01:57 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131901.n0DJ1vkT012138@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:01: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: r187166 - head/sys/dev/usb2/core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:01:59 -0000 Author: thompsa Date: Tue Jan 13 19:01:56 2009 New Revision: 187166 URL: http://svn.freebsd.org/changeset/base/187166 Log: MFp4: //depot/projects/usb@155755 Fix a race causing the explore thread to hang when tearing down USB transfers at detach. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_transfer.c Modified: head/sys/dev/usb2/core/usb2_transfer.c ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.c Tue Jan 13 19:01:46 2009 (r187165) +++ head/sys/dev/usb2/core/usb2_transfer.c Tue Jan 13 19:01:56 2009 (r187166) @@ -1915,8 +1915,7 @@ usb2_callback_wrapper(struct usb2_xfer_q /* * Check if we got started after that we got cancelled, but - * before we managed to do the callback. Check if we are - * draining. + * before we managed to do the callback. */ if ((!xfer->flags_int.open) && (xfer->flags_int.started) && @@ -1924,13 +1923,19 @@ usb2_callback_wrapper(struct usb2_xfer_q /* try to loop, but not recursivly */ usb2_command_wrapper(&info->done_q, xfer); return; - } else if (xfer->flags_int.draining && + } + +done: + /* + * Check if we are draining. + */ + if (xfer->flags_int.draining && (!xfer->flags_int.transferring)) { /* "usb2_transfer_drain()" is waiting for end of transfer */ xfer->flags_int.draining = 0; usb2_cv_broadcast(&xfer->usb2_root->cv_drain); } -done: + /* do the next callback, if any */ usb2_command_wrapper(&info->done_q, info->done_q.curr); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:02:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55B62106564A; Tue, 13 Jan 2009 19:02:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 434CF8FC0A; Tue, 13 Jan 2009 19:02:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ28oE012183; Tue, 13 Jan 2009 19:02:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ284X012182; Tue, 13 Jan 2009 19:02:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131902.n0DJ284X012182@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:02: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: r187167 - head/sys/dev/usb2/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:02:09 -0000 Author: thompsa Date: Tue Jan 13 19:02:07 2009 New Revision: 187167 URL: http://svn.freebsd.org/changeset/base/187167 Log: MFp4: //depot/projects/usb@155759 Optimise: Remove extra flush calls. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/ohci2.c Modified: head/sys/dev/usb2/controller/ohci2.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2.c Tue Jan 13 19:01:56 2009 (r187166) +++ head/sys/dev/usb2/controller/ohci2.c Tue Jan 13 19:02:07 2009 (r187167) @@ -1558,13 +1558,12 @@ ohci_setup_standard_chain(struct usb2_xf } ed->ed_flags = htole32(ed_flags); - usb2_pc_cpu_flush(ed->page_cache); - td = xfer->td_transfer_first; ed->ed_headp = td->td_self; if (xfer->udev->pwr_save.suspended == 0) { + /* the append function will flush the endpoint descriptor */ OHCI_APPEND_QH(ed, *ed_last); if (methods == &ohci_device_bulk_methods) { @@ -2009,13 +2008,12 @@ ohci_device_isoc_enter(struct usb2_xfer } ed->ed_flags = htole32(ed_flags); - usb2_pc_cpu_flush(ed->page_cache); - td = xfer->td_transfer_first; ed->ed_headp = td->itd_self; /* isochronous transfers are not affected by suspend / resume */ + /* the append function will flush the endpoint descriptor */ OHCI_APPEND_QH(ed, sc->sc_isoc_p_last); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:02:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76AB61065689; Tue, 13 Jan 2009 19:02:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 105828FC14; Tue, 13 Jan 2009 19:02:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ2H60012226; Tue, 13 Jan 2009 19:02:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ2Hb0012225; Tue, 13 Jan 2009 19:02:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131902.n0DJ2Hb0012225@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:02:17 +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: r187168 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:02:19 -0000 Author: thompsa Date: Tue Jan 13 19:02:17 2009 New Revision: 187168 URL: http://svn.freebsd.org/changeset/base/187168 Log: MFp4: //depot/projects/usb@155807 Fix a typo. Reported by Alexander Best. Submitted by: Hans Petter Selasky Modified: head/usr.sbin/usbconfig/usbconfig.c Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Tue Jan 13 19:02:07 2009 (r187167) +++ head/usr.sbin/usbconfig/usbconfig.c Tue Jan 13 19:02:17 2009 (r187168) @@ -327,7 +327,7 @@ flush_command(struct libusb20_backend *p opt->got_power_save + opt->got_power_on + opt->got_power_off) > 1) { - err(1, "cannot only specify one of 'set_config', " + err(1, "can only specify one of 'set_config', " "'set_alt', 'reset', 'suspend', 'resume', " "'power_save', 'power_on' and 'power_off' " "at the same time!"); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:02:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36E8A10658BE; Tue, 13 Jan 2009 19:02:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 216DD8FC13; Tue, 13 Jan 2009 19:02:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ2Vor012268; Tue, 13 Jan 2009 19:02:31 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ2V65012267; Tue, 13 Jan 2009 19:02:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131902.n0DJ2V65012267@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:02: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: r187169 - head/sys/dev/usb2/core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:02:32 -0000 Author: thompsa Date: Tue Jan 13 19:02:30 2009 New Revision: 187169 URL: http://svn.freebsd.org/changeset/base/187169 Log: MFp4: //depot/projects/usb@155810 Usability improvement. Make sure that setting power mode ON resurrects the device if powered OFF. Reported by: Alexander Best. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_generic.c Modified: head/sys/dev/usb2/core/usb2_generic.c ============================================================================== --- head/sys/dev/usb2/core/usb2_generic.c Tue Jan 13 19:02:17 2009 (r187168) +++ head/sys/dev/usb2/core/usb2_generic.c Tue Jan 13 19:02:30 2009 (r187169) @@ -1688,15 +1688,23 @@ ugen_set_power_mode(struct usb2_fifo *f, { struct usb2_device *udev = f->udev; int err; + uint8_t old_mode; if ((udev == NULL) || (udev->parent_hub == NULL)) { return (EINVAL); } err = priv_check(curthread, PRIV_ROOT); - if (err) { + if (err) return (err); - } + + /* get old power mode */ + old_mode = udev->power_mode; + + /* if no change, then just return */ + if (old_mode == mode) + return (0); + switch (mode) { case USB_POWER_MODE_OFF: /* get the device unconfigured */ @@ -1734,6 +1742,13 @@ ugen_set_power_mode(struct usb2_fifo *f, if (err) return (ENXIO); /* I/O failure */ + /* if we are powered off we need to re-enumerate first */ + if (old_mode == USB_POWER_MODE_OFF) { + err = ugen_re_enumerate(f); + if (err) + return (err); + } + /* set new power mode */ usb2_set_power_mode(udev, mode); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:02:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FAAA1065756; Tue, 13 Jan 2009 19:02:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E57DF8FC3A; Tue, 13 Jan 2009 19:02:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ2eV6012327; Tue, 13 Jan 2009 19:02:40 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ2emX012309; Tue, 13 Jan 2009 19:02:40 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131902.n0DJ2emX012309@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:02:40 +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: r187170 - in head/sys/dev/usb2: controller core include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:02:43 -0000 Author: thompsa Date: Tue Jan 13 19:02:40 2009 New Revision: 187170 URL: http://svn.freebsd.org/changeset/base/187170 Log: MFp4: //depot/projects/usb@155820 USB memory usage reduction patch. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/at91dci.h head/sys/dev/usb2/controller/at91dci_atmelarm.c head/sys/dev/usb2/controller/ehci2.h head/sys/dev/usb2/controller/ehci2_pci.c head/sys/dev/usb2/controller/musb2_otg.h head/sys/dev/usb2/controller/musb2_otg_atmelarm.c head/sys/dev/usb2/controller/ohci2.h head/sys/dev/usb2/controller/ohci2_atmelarm.c head/sys/dev/usb2/controller/ohci2_pci.c head/sys/dev/usb2/controller/uhci2.h head/sys/dev/usb2/controller/uhci2_pci.c head/sys/dev/usb2/controller/usb2_bus.h head/sys/dev/usb2/controller/usb2_controller.c head/sys/dev/usb2/controller/uss820dci.h head/sys/dev/usb2/controller/uss820dci_atmelarm.c head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb2/include/usb2_defs.h Modified: head/sys/dev/usb2/controller/at91dci.h ============================================================================== --- head/sys/dev/usb2/controller/at91dci.h Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/at91dci.h Tue Jan 13 19:02:40 2009 (r187170) @@ -34,6 +34,8 @@ #ifndef _AT9100_DCI_H_ #define _AT9100_DCI_H_ +#define AT91_MAX_DEVICES (USB_MIN_DEVICES + 1) + #define AT91_UDP_FRM 0x00 /* Frame number register */ #define AT91_UDP_FRM_MASK (0x7FF << 0) /* Frame Number as Defined in * the Packet Field Formats */ @@ -206,6 +208,7 @@ struct at91dci_softc { struct usb2_sw_transfer sc_root_intr; struct usb2_config_td sc_config_td; + struct usb2_device *sc_devices[AT91_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; void *sc_intr_hdl; Modified: head/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 19:02:40 2009 (r187170) @@ -145,9 +145,12 @@ at91_udp_attach(device_t dev) sc->sc_dci.sc_pull_down = &at91_udp_pull_down; sc->sc_dci.sc_pull_arg = sc; - /* get all DMA memory */ - + /* initialise some bus fields */ sc->sc_dci.sc_bus.parent = dev; + sc->sc_dci.sc_bus.devices = sc->sc_dci.sc_devices; + sc->sc_dci.sc_bus.devices_max = AT91_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_dci.sc_bus, USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); Modified: head/sys/dev/usb2/controller/ehci2.h ============================================================================== --- head/sys/dev/usb2/controller/ehci2.h Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/ehci2.h Tue Jan 13 19:02:40 2009 (r187170) @@ -38,6 +38,8 @@ #ifndef _EHCI_H_ #define _EHCI_H_ +#define EHCI_MAX_DEVICES USB_MAX_DEVICES + /* PCI config registers */ #define PCI_CBMEM 0x10 /* configuration base MEM */ #define PCI_INTERFACE_EHCI 0x20 @@ -459,6 +461,7 @@ typedef struct ehci_softc { struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; + struct usb2_device *sc_devices[EHCI_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; struct ehci_qh *sc_async_p_last; Modified: head/sys/dev/usb2/controller/ehci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2_pci.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/ehci2_pci.c Tue Jan 13 19:02:40 2009 (r187170) @@ -232,12 +232,15 @@ ehci_pci_attach(device_t self) device_printf(self, "Could not allocate sc\n"); return (ENXIO); } - /* get all DMA memory */ - + /* initialise some bus fields */ sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { - return ENOMEM; + return (ENOMEM); } sc->sc_dev = self; Modified: head/sys/dev/usb2/controller/musb2_otg.h ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.h Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/musb2_otg.h Tue Jan 13 19:02:40 2009 (r187170) @@ -32,6 +32,8 @@ #ifndef _MUSB2_OTG_H_ #define _MUSB2_OTG_H_ +#define MUSB2_MAX_DEVICES (USB_MIN_DEVICES + 1) + /* Common registers */ #define MUSB2_REG_FADDR 0x0000 /* function address register */ @@ -365,6 +367,8 @@ struct musbotg_softc { struct usb2_sw_transfer sc_root_intr; struct usb2_config_td sc_config_td; struct usb2_hw_ep_profile sc_hw_ep_profile[16]; + + struct usb2_device *sc_devices[MUSB2_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; void *sc_intr_hdl; Modified: head/sys/dev/usb2/controller/musb2_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg_atmelarm.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/musb2_otg_atmelarm.c Tue Jan 13 19:02:40 2009 (r187170) @@ -102,9 +102,12 @@ musbotg_attach(device_t dev) sc->sc_otg.sc_clocks_off = &musbotg_clocks_off; sc->sc_otg.sc_clocks_arg = sc; - /* get all DMA memory */ - + /* initialise some bus fields */ sc->sc_otg.sc_bus.parent = dev; + sc->sc_otg.sc_bus.devices = sc->sc_otg.sc_devices; + sc->sc_otg.sc_bus.devices_max = MUSB2_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_otg.sc_bus, USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); Modified: head/sys/dev/usb2/controller/ohci2.h ============================================================================== --- head/sys/dev/usb2/controller/ohci2.h Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/ohci2.h Tue Jan 13 19:02:40 2009 (r187170) @@ -39,6 +39,8 @@ #ifndef _OHCI_H_ #define _OHCI_H_ +#define OHCI_MAX_DEVICES USB_MAX_DEVICES + /* PCI config registers */ #define PCI_CBMEM 0x10 /* configuration base memory */ #define PCI_INTERFACE_OHCI 0x10 @@ -324,6 +326,7 @@ typedef struct ohci_softc { struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; + struct usb2_device *sc_devices[OHCI_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; struct ohci_hcca *sc_hcca_p; Modified: head/sys/dev/usb2/controller/ohci2_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2_atmelarm.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/ohci2_atmelarm.c Tue Jan 13 19:02:40 2009 (r187170) @@ -73,12 +73,15 @@ ohci_atmelarm_attach(device_t dev) if (sc == NULL) { return (ENXIO); } - /* get all DMA memory */ - + /* initialise some bus fields */ sc->sc_ohci.sc_bus.parent = dev; + sc->sc_ohci.sc_bus.devices = sc->sc_ohci.sc_devices; + sc->sc_ohci.sc_bus.devices_max = OHCI_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_ohci.sc_bus, USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) { - return ENOMEM; + return (ENOMEM); } sc->iclk = at91_pmc_clock_ref("ohci_clk"); sc->fclk = at91_pmc_clock_ref("uhpck"); Modified: head/sys/dev/usb2/controller/ohci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2_pci.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/ohci2_pci.c Tue Jan 13 19:02:40 2009 (r187170) @@ -200,12 +200,15 @@ ohci_pci_attach(device_t self) device_printf(self, "Could not allocate sc\n"); return (ENXIO); } - /* get all DMA memory */ - + /* initialise some bus fields */ sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = OHCI_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), &ohci_iterate_hw_softc)) { - return ENOMEM; + return (ENOMEM); } sc->sc_dev = self; Modified: head/sys/dev/usb2/controller/uhci2.h ============================================================================== --- head/sys/dev/usb2/controller/uhci2.h Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/uhci2.h Tue Jan 13 19:02:40 2009 (r187170) @@ -39,6 +39,8 @@ #ifndef _UHCI_H_ #define _UHCI_H_ +#define UHCI_MAX_DEVICES USB_MAX_DEVICES + /* PCI config registers */ #define PCI_USBREV 0x60 /* USB protocol revision */ #define PCI_USB_REV_MASK 0xff @@ -273,6 +275,7 @@ typedef struct uhci_softc { struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; + struct usb2_device *sc_devices[UHCI_MAX_DEVICES]; struct uhci_td *sc_isoc_p_last[UHCI_VFRAMELIST_COUNT]; /* pointer to last TD * for isochronous */ struct uhci_qh *sc_intr_p_last[UHCI_IFRAMELIST_COUNT]; /* pointer to last QH Modified: head/sys/dev/usb2/controller/uhci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/uhci2_pci.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/uhci2_pci.c Tue Jan 13 19:02:40 2009 (r187170) @@ -251,9 +251,12 @@ uhci_pci_attach(device_t self) device_printf(self, "Could not allocate sc\n"); return (ENXIO); } - /* get all DMA memory */ - + /* initialise some bus fields */ sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = UHCI_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), &uhci_iterate_hw_softc)) { return ENOMEM; Modified: head/sys/dev/usb2/controller/usb2_bus.h ============================================================================== --- head/sys/dev/usb2/controller/usb2_bus.h Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/usb2_bus.h Tue Jan 13 19:02:40 2009 (r187170) @@ -70,7 +70,7 @@ struct usb2_bus { struct usb2_dma_tag dma_tags[USB_BUS_DMA_TAG_MAX]; struct usb2_bus_methods *methods; /* filled by HC driver */ - struct usb2_device *devices[USB_MAX_DEVICES]; + struct usb2_device **devices; uint32_t hw_power_state; /* see USB_HW_POWER_XXX */ uint32_t uframe_usage[USB_HS_MICRO_FRAMES_MAX]; Modified: head/sys/dev/usb2/controller/usb2_controller.c ============================================================================== --- head/sys/dev/usb2/controller/usb2_controller.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/usb2_controller.c Tue Jan 13 19:02:40 2009 (r187170) @@ -493,8 +493,6 @@ usb2_bus_mem_alloc_all(struct usb2_bus * { bus->alloc_failed = 0; - bus->devices_max = USB_MAX_DEVICES; - mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), NULL, MTX_DEF | MTX_RECURSE); @@ -506,6 +504,13 @@ usb2_bus_mem_alloc_all(struct usb2_bus * usb2_dma_tag_setup(bus->dma_parent_tag, bus->dma_tags, dmat, &bus->bus_mtx, NULL, NULL, 32, USB_BUS_DMA_TAG_MAX); + if ((bus->devices_max > USB_MAX_DEVICES) || + (bus->devices_max < USB_MIN_DEVICES) || + (bus->devices == NULL)) { + DPRINTFN(0, "Devices field has not been " + "initialised properly!\n"); + bus->alloc_failed = 1; /* failure */ + } if (cb) { cb(bus, &usb2_bus_mem_alloc_all_cb); } Modified: head/sys/dev/usb2/controller/uss820dci.h ============================================================================== --- head/sys/dev/usb2/controller/uss820dci.h Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/uss820dci.h Tue Jan 13 19:02:40 2009 (r187170) @@ -28,6 +28,8 @@ #ifndef _USS820_DCI_H_ #define _USS820_DCI_H_ +#define USS820_MAX_DEVICES (USB_MIN_DEVICES + 1) + #define USS820_EP_MAX 8 /* maximum number of endpoints */ #define USS820_TXDAT 0x00 /* Transmit FIFO data */ @@ -347,6 +349,7 @@ struct uss820dci_softc { struct usb2_sw_transfer sc_root_intr; struct usb2_config_td sc_config_td; + struct usb2_device *sc_devices[USS820_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; void *sc_intr_hdl; Modified: head/sys/dev/usb2/controller/uss820dci_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/uss820dci_atmelarm.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/controller/uss820dci_atmelarm.c Tue Jan 13 19:02:40 2009 (r187170) @@ -138,9 +138,13 @@ uss820_atmelarm_attach(device_t dev) if (sc == NULL) { return (ENXIO); } - /* get all DMA memory */ + /* initialise some bus fields */ sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = USS820_MAX_DEVICES; + + /* get all DMA memory */ if (usb2_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); Modified: head/sys/dev/usb2/core/usb2_device.c ============================================================================== --- head/sys/dev/usb2/core/usb2_device.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/core/usb2_device.c Tue Jan 13 19:02:40 2009 (r187170) @@ -1290,19 +1290,23 @@ usb2_alloc_device(device_t parent_dev, s * Find an unused device index. In USB Host mode this is the * same as the device address. * - * NOTE: Index 1 is reserved for the Root HUB. + * Device index zero is not used and device index 1 should + * always be the root hub. */ - for (device_index = USB_ROOT_HUB_ADDR; device_index != - USB_MAX_DEVICES; device_index++) { + for (device_index = USB_ROOT_HUB_ADDR;; device_index++) { +#if (USB_ROOT_HUB_ADDR > USB_MIN_DEVICES) +#error "Incorrect device limit." +#endif + if (device_index == bus->devices_max) { + device_printf(bus->bdev, + "No free USB device " + "index for new device!\n"); + return (NULL); + } if (bus->devices[device_index] == NULL) break; } - if (device_index == USB_MAX_DEVICES) { - device_printf(bus->bdev, - "No free USB device index for new device!\n"); - return (NULL); - } if (depth > 0x10) { device_printf(bus->bdev, "Invalid device depth!\n"); Modified: head/sys/dev/usb2/core/usb2_hub.c ============================================================================== --- head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:02:40 2009 (r187170) @@ -1520,8 +1520,12 @@ usb2_bus_powerd(struct usb2_bus *bus) * The root HUB device is never suspended * and we simply skip it. */ - for (x = USB_ROOT_HUB_ADDR + 1; - x != USB_MAX_DEVICES; x++) { + for (x = USB_ROOT_HUB_ADDR + 1;; x++) { +#if ((USB_ROOT_HUB_ADDR + 1) > USB_MIN_DEVICES) +#error "Incorrect device limit." +#endif + if (x == bus->devices_max) + break; udev = bus->devices[x]; if (udev == NULL) @@ -1564,8 +1568,12 @@ usb2_bus_powerd(struct usb2_bus *bus) /* Re-loop all the devices to get the actual state */ - for (x = USB_ROOT_HUB_ADDR + 1; - x != USB_MAX_DEVICES; x++) { + for (x = USB_ROOT_HUB_ADDR + 1;; x++) { +#if ((USB_ROOT_HUB_ADDR + 1) > USB_MIN_DEVICES) +#error "Incorrect device limit." +#endif + if (x == bus->devices_max) + break; udev = bus->devices[x]; if (udev == NULL) Modified: head/sys/dev/usb2/include/usb2_defs.h ============================================================================== --- head/sys/dev/usb2/include/usb2_defs.h Tue Jan 13 19:02:30 2009 (r187169) +++ head/sys/dev/usb2/include/usb2_defs.h Tue Jan 13 19:02:40 2009 (r187170) @@ -35,6 +35,8 @@ #define USB_EP_MAX (2*16) /* hardcoded */ #define USB_FIFO_MAX (4 * USB_EP_MAX) +#define USB_MIN_DEVICES 2 /* unused + root HUB */ + #define USB_MAX_DEVICES USB_DEV_MAX /* including virtual root HUB and * address zero */ #define USB_MAX_ENDPOINTS USB_EP_MAX /* 2 directions on 16 endpoints */ @@ -64,5 +66,7 @@ #if (USB_EP_MAX < (2*16)) #error "Misconfigured limits #3" #endif - +#if (USB_MAX_DEVICES < USB_MIN_DEVICES) +#error "Misconfigured limits #4" +#endif #endif /* _USB2_DEFS_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:02:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0217610657C5; Tue, 13 Jan 2009 19:02:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3C528FC3E; Tue, 13 Jan 2009 19:02:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ2oLq012369; Tue, 13 Jan 2009 19:02:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ2oMu012365; Tue, 13 Jan 2009 19:02:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131902.n0DJ2oMu012365@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:02: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: r187171 - in head/sys/dev/usb2: core include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:02:51 -0000 Author: thompsa Date: Tue Jan 13 19:02:50 2009 New Revision: 187171 URL: http://svn.freebsd.org/changeset/base/187171 Log: MFp4: //depot/projects/usb@155829 Code style changes requested by: M. Warner Losh Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_core.h head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb2/include/usb2_defs.h Modified: head/sys/dev/usb2/core/usb2_core.h ============================================================================== --- head/sys/dev/usb2/core/usb2_core.h Tue Jan 13 19:02:40 2009 (r187170) +++ head/sys/dev/usb2/core/usb2_core.h Tue Jan 13 19:02:50 2009 (r187171) @@ -101,8 +101,6 @@ #define USB_HOST_ALIGN 8 /* bytes, must be power of two */ -#define USB_ROOT_HUB_ADDR 1 /* value */ - #define USB_ISOC_TIME_MAX 128 /* ms */ #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ Modified: head/sys/dev/usb2/core/usb2_device.c ============================================================================== --- head/sys/dev/usb2/core/usb2_device.c Tue Jan 13 19:02:40 2009 (r187170) +++ head/sys/dev/usb2/core/usb2_device.c Tue Jan 13 19:02:50 2009 (r187171) @@ -1293,18 +1293,15 @@ usb2_alloc_device(device_t parent_dev, s * Device index zero is not used and device index 1 should * always be the root hub. */ - for (device_index = USB_ROOT_HUB_ADDR;; device_index++) { -#if (USB_ROOT_HUB_ADDR > USB_MIN_DEVICES) -#error "Incorrect device limit." -#endif - if (device_index == bus->devices_max) { - device_printf(bus->bdev, - "No free USB device " - "index for new device!\n"); - return (NULL); - } - if (bus->devices[device_index] == NULL) - break; + for (device_index = USB_ROOT_HUB_ADDR; + (device_index != bus->devices_max) && + (bus->devices[device_index] != NULL); + device_index++) /* nop */; + + if (device_index == bus->devices_max) { + device_printf(bus->bdev, + "No free USB device index for new device!\n"); + return (NULL); } if (depth > 0x10) { Modified: head/sys/dev/usb2/core/usb2_hub.c ============================================================================== --- head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:02:40 2009 (r187170) +++ head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:02:50 2009 (r187171) @@ -1520,12 +1520,8 @@ usb2_bus_powerd(struct usb2_bus *bus) * The root HUB device is never suspended * and we simply skip it. */ - for (x = USB_ROOT_HUB_ADDR + 1;; x++) { -#if ((USB_ROOT_HUB_ADDR + 1) > USB_MIN_DEVICES) -#error "Incorrect device limit." -#endif - if (x == bus->devices_max) - break; + for (x = USB_ROOT_HUB_ADDR + 1; + x != bus->devices_max; x++) { udev = bus->devices[x]; if (udev == NULL) @@ -1568,12 +1564,8 @@ usb2_bus_powerd(struct usb2_bus *bus) /* Re-loop all the devices to get the actual state */ - for (x = USB_ROOT_HUB_ADDR + 1;; x++) { -#if ((USB_ROOT_HUB_ADDR + 1) > USB_MIN_DEVICES) -#error "Incorrect device limit." -#endif - if (x == bus->devices_max) - break; + for (x = USB_ROOT_HUB_ADDR + 1; + x != bus->devices_max; x++) { udev = bus->devices[x]; if (udev == NULL) Modified: head/sys/dev/usb2/include/usb2_defs.h ============================================================================== --- head/sys/dev/usb2/include/usb2_defs.h Tue Jan 13 19:02:40 2009 (r187170) +++ head/sys/dev/usb2/include/usb2_defs.h Tue Jan 13 19:02:50 2009 (r187171) @@ -35,6 +35,8 @@ #define USB_EP_MAX (2*16) /* hardcoded */ #define USB_FIFO_MAX (4 * USB_EP_MAX) +#define USB_ROOT_HUB_ADDR 1 /* index */ + #define USB_MIN_DEVICES 2 /* unused + root HUB */ #define USB_MAX_DEVICES USB_DEV_MAX /* including virtual root HUB and @@ -58,15 +60,18 @@ /* sanity checks */ #if (USB_FIFO_MAX < USB_EP_MAX) -#error "Misconfigured limits #1" +#error "There cannot be less FIFOs than USB endpoints." #endif #if (USB_FIFO_MAX & 1) -#error "Misconfigured limits #2" +#error "Number of FIFOs must be odd." #endif #if (USB_EP_MAX < (2*16)) -#error "Misconfigured limits #3" +#error "Number of hardware USB endpoints cannot be less than 32." #endif #if (USB_MAX_DEVICES < USB_MIN_DEVICES) -#error "Misconfigured limits #4" +#error "Minimum number of devices is greater than maximum number of devices." +#endif +#if (USB_ROOT_HUB_ADDR >= USB_MIN_DEVICES) +#error "The root hub address must be less than USB_MIN_DEVICES." #endif #endif /* _USB2_DEFS_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:03:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB5F31065688; Tue, 13 Jan 2009 19:03:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5F568FC2C; Tue, 13 Jan 2009 19:03:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ329M012431; Tue, 13 Jan 2009 19:03:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ31oX012408; Tue, 13 Jan 2009 19:03:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131903.n0DJ31oX012408@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:03:01 +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: r187172 - head/sys/dev/usb2/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:03:04 -0000 Author: thompsa Date: Tue Jan 13 19:03:01 2009 New Revision: 187172 URL: http://svn.freebsd.org/changeset/base/187172 Log: MFp4: //depot/projects/usb@155834 Factor out roothub process into the USB bus structure for all USB controller drivers. Essentially I am trying to save some processes on the root HUB and get away from the config thread pradigm. There will be a follow up commit where the root HUB control and interrupt callback will be moved over to run from the roothub process. Total win: 3 processes become 1 for every USB controller. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/controller/at91dci.h head/sys/dev/usb2/controller/at91dci_atmelarm.c head/sys/dev/usb2/controller/ehci2.c head/sys/dev/usb2/controller/ehci2.h head/sys/dev/usb2/controller/ehci2_pci.c head/sys/dev/usb2/controller/musb2_otg.c head/sys/dev/usb2/controller/musb2_otg.h head/sys/dev/usb2/controller/musb2_otg_atmelarm.c head/sys/dev/usb2/controller/ohci2.c head/sys/dev/usb2/controller/ohci2.h head/sys/dev/usb2/controller/ohci2_atmelarm.c head/sys/dev/usb2/controller/ohci2_pci.c head/sys/dev/usb2/controller/uhci2.c head/sys/dev/usb2/controller/uhci2.h head/sys/dev/usb2/controller/uhci2_pci.c head/sys/dev/usb2/controller/usb2_bus.h head/sys/dev/usb2/controller/usb2_controller.c head/sys/dev/usb2/controller/usb2_controller.h head/sys/dev/usb2/controller/uss820dci.c head/sys/dev/usb2/controller/uss820dci.h head/sys/dev/usb2/controller/uss820dci_atmelarm.c Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:03:01 2009 (r187172) @@ -50,14 +50,11 @@ __FBSDID("$FreeBSD$"); #include #define USB_DEBUG_VAR at91dcidebug -#define usb2_config_td_cc at91dci_config_copy -#define usb2_config_td_softc at91dci_softc #include #include #include #include -#include #include #include #include @@ -106,7 +103,6 @@ static void at91dci_standard_done(struct static usb2_sw_transfer_func_t at91dci_root_intr_done; static usb2_sw_transfer_func_t at91dci_root_ctrl_done; -static usb2_config_td_command_t at91dci_root_ctrl_task; /* * NOTE: Some of the bits in the CSR register have inverse meaning so @@ -1817,15 +1813,13 @@ at91dci_root_ctrl_start(struct usb2_xfer sc->sc_root_ctrl.xfer = xfer; - usb2_config_td_queue_command( - &sc->sc_config_td, NULL, &at91dci_root_ctrl_task, 0, 0); + usb2_bus_roothub_exec(xfer->udev->bus); } static void -at91dci_root_ctrl_task(struct at91dci_softc *sc, - struct at91dci_config_copy *cc, uint16_t refcount) +at91dci_root_ctrl_task(struct usb2_bus *bus) { - at91dci_root_ctrl_poll(sc); + at91dci_root_ctrl_poll(AT9100_DCI_BUS2SC(bus)); } static void @@ -2478,4 +2472,5 @@ struct usb2_bus_methods at91dci_bus_meth .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, .vbus_interrupt = &at91dci_vbus_interrupt, + .roothub_exec = &at91dci_root_ctrl_task, }; Modified: head/sys/dev/usb2/controller/at91dci.h ============================================================================== --- head/sys/dev/usb2/controller/at91dci.h Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/at91dci.h Tue Jan 13 19:03:01 2009 (r187172) @@ -206,7 +206,6 @@ struct at91dci_softc { LIST_HEAD(, usb2_xfer) sc_interrupt_list_head; struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; - struct usb2_config_td sc_config_td; struct usb2_device *sc_devices[AT91_MAX_DEVICES]; struct resource *sc_io_res; Modified: head/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 19:03:01 2009 (r187172) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -208,12 +207,6 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); - err = usb2_config_td_setup(&sc->sc_dci.sc_config_td, sc, - &sc->sc_dci.sc_bus.bus_mtx, NULL, 0, 4); - if (err) { - device_printf(dev, "could not setup config thread!\n"); - goto error; - } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); @@ -308,8 +301,6 @@ at91_udp_detach(device_t dev) sc->sc_dci.sc_io_res); sc->sc_dci.sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_dci.sc_config_td); - usb2_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL); /* disable clocks */ Modified: head/sys/dev/usb2/controller/ehci2.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/ehci2.c Tue Jan 13 19:03:01 2009 (r187172) @@ -52,14 +52,11 @@ __FBSDID("$FreeBSD$"); #include #define USB_DEBUG_VAR ehcidebug -#define usb2_config_td_cc ehci_config_copy -#define usb2_config_td_softc ehci_softc #include #include #include #include -#include #include #include #include @@ -99,7 +96,6 @@ extern struct usb2_pipe_methods ehci_dev extern struct usb2_pipe_methods ehci_root_ctrl_methods; extern struct usb2_pipe_methods ehci_root_intr_methods; -static usb2_config_td_command_t ehci_root_ctrl_task; static void ehci_do_poll(struct usb2_bus *bus); static void ehci_root_ctrl_poll(ehci_softc_t *sc); static void ehci_device_done(struct usb2_xfer *xfer, usb2_error_t error); @@ -3031,15 +3027,13 @@ ehci_root_ctrl_start(struct usb2_xfer *x sc->sc_root_ctrl.xfer = xfer; - usb2_config_td_queue_command - (&sc->sc_config_td, NULL, &ehci_root_ctrl_task, 0, 0); + usb2_bus_roothub_exec(xfer->udev->bus); } static void -ehci_root_ctrl_task(ehci_softc_t *sc, - struct usb2_config_td_cc *cc, uint16_t refcount) +ehci_root_ctrl_task(struct usb2_bus *bus) { - ehci_root_ctrl_poll(sc); + ehci_root_ctrl_poll(EHCI_BUS2SC(bus)); } static void @@ -3969,4 +3963,5 @@ struct usb2_bus_methods ehci_bus_methods .device_resume = ehci_device_resume, .device_suspend = ehci_device_suspend, .set_hw_power = ehci_set_hw_power, + .roothub_exec = ehci_root_ctrl_task, }; Modified: head/sys/dev/usb2/controller/ehci2.h ============================================================================== --- head/sys/dev/usb2/controller/ehci2.h Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/ehci2.h Tue Jan 13 19:03:01 2009 (r187172) @@ -455,7 +455,6 @@ union ehci_hub_desc { typedef struct ehci_softc { struct ehci_hw_softc sc_hw; struct usb2_bus sc_bus; /* base device */ - struct usb2_config_td sc_config_td; struct usb2_callout sc_tmo_pcd; union ehci_hub_desc sc_hub_desc; struct usb2_sw_transfer sc_root_ctrl; Modified: head/sys/dev/usb2/controller/ehci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2_pci.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/ehci2_pci.c Tue Jan 13 19:03:01 2009 (r187172) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -341,12 +340,6 @@ ehci_pci_attach(device_t self) sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } - err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.bus_mtx, - NULL, 0, 4); - if (err) { - device_printf(self, "could not setup config thread!\n"); - goto error; - } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)(void *)ehci_interrupt, sc, &sc->sc_intr_hdl); @@ -381,8 +374,6 @@ ehci_pci_detach(device_t self) ehci_softc_t *sc = device_get_softc(self); device_t bdev; - usb2_config_td_drain(&sc->sc_config_td); - if (sc->sc_bus.bdev) { bdev = sc->sc_bus.bdev; device_detach(bdev); @@ -422,8 +413,6 @@ ehci_pci_detach(device_t self) sc->sc_io_res); sc->sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_config_td); - usb2_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); return (0); Modified: head/sys/dev/usb2/controller/musb2_otg.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/musb2_otg.c Tue Jan 13 19:03:01 2009 (r187172) @@ -42,14 +42,11 @@ #include #define USB_DEBUG_VAR musbotgdebug -#define usb2_config_td_cc musbotg_config_copy -#define usb2_config_td_softc musbotg_softc #include #include #include #include -#include #include #include #include @@ -101,7 +98,6 @@ static void musbotg_interrupt_poll(struc static usb2_sw_transfer_func_t musbotg_root_intr_done; static usb2_sw_transfer_func_t musbotg_root_ctrl_done; -static usb2_config_td_command_t musbotg_root_ctrl_task; /* * Here is a configuration that the chip supports. @@ -2222,15 +2218,13 @@ musbotg_root_ctrl_start(struct usb2_xfer sc->sc_root_ctrl.xfer = xfer; - usb2_config_td_queue_command( - &sc->sc_config_td, NULL, &musbotg_root_ctrl_task, 0, 0); + usb2_bus_roothub_exec(xfer->udev->bus); } static void -musbotg_root_ctrl_task(struct musbotg_softc *sc, - struct musbotg_config_copy *cc, uint16_t refcount) +musbotg_root_ctrl_task(struct usb2_bus *bus) { - musbotg_root_ctrl_poll(sc); + musbotg_root_ctrl_poll(MUSBOTG_BUS2SC(bus)); } static void @@ -2885,4 +2879,5 @@ struct usb2_bus_methods musbotg_bus_meth .set_stall = &musbotg_set_stall, .clear_stall = &musbotg_clear_stall, .vbus_interrupt = &musbotg_vbus_interrupt, + .roothub_exec = &musbotg_root_ctrl_task, }; Modified: head/sys/dev/usb2/controller/musb2_otg.h ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.h Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/musb2_otg.h Tue Jan 13 19:03:01 2009 (r187172) @@ -365,7 +365,6 @@ struct musbotg_softc { union musbotg_hub_temp sc_hub_temp; struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; - struct usb2_config_td sc_config_td; struct usb2_hw_ep_profile sc_hw_ep_profile[16]; struct usb2_device *sc_devices[MUSB2_MAX_DEVICES]; Modified: head/sys/dev/usb2/controller/musb2_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg_atmelarm.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/musb2_otg_atmelarm.c Tue Jan 13 19:03:01 2009 (r187172) @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -136,12 +135,6 @@ musbotg_attach(device_t dev) } device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus); - err = usb2_config_td_setup(&sc->sc_otg.sc_config_td, sc, - &sc->sc_otg.sc_bus.bus_mtx, NULL, 0, 4); - if (err) { - device_printf(dev, "could not setup config thread!\n"); - goto error; - } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)musbotg_interrupt, sc, &sc->sc_otg.sc_intr_hdl); @@ -207,8 +200,6 @@ musbotg_detach(device_t dev) sc->sc_otg.sc_io_res); sc->sc_otg.sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_otg.sc_config_td); - usb2_bus_mem_free_all(&sc->sc_otg.sc_bus, NULL); return (0); Modified: head/sys/dev/usb2/controller/ohci2.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/ohci2.c Tue Jan 13 19:03:01 2009 (r187172) @@ -41,14 +41,11 @@ __FBSDID("$FreeBSD$"); #include #define USB_DEBUG_VAR ohcidebug -#define usb2_config_td_cc ohci_config_copy -#define usb2_config_td_softc ohci_softc #include #include #include #include -#include #include #include #include @@ -99,7 +96,6 @@ extern struct usb2_pipe_methods ohci_dev extern struct usb2_pipe_methods ohci_root_ctrl_methods; extern struct usb2_pipe_methods ohci_root_intr_methods; -static usb2_config_td_command_t ohci_root_ctrl_task; static void ohci_root_ctrl_poll(struct ohci_softc *sc); static void ohci_do_poll(struct usb2_bus *bus); static void ohci_device_done(struct usb2_xfer *xfer, usb2_error_t error); @@ -2135,15 +2131,13 @@ ohci_root_ctrl_start(struct usb2_xfer *x sc->sc_root_ctrl.xfer = xfer; - usb2_config_td_queue_command - (&sc->sc_config_td, NULL, &ohci_root_ctrl_task, 0, 0); + usb2_bus_roothub_exec(xfer->udev->bus); } static void -ohci_root_ctrl_task(struct ohci_softc *sc, - struct ohci_config_copy *cc, uint16_t refcount) +ohci_root_ctrl_task(struct usb2_bus *bus) { - ohci_root_ctrl_poll(sc); + ohci_root_ctrl_poll(OHCI_BUS2SC(bus)); } static void @@ -2864,4 +2858,5 @@ struct usb2_bus_methods ohci_bus_methods .device_resume = ohci_device_resume, .device_suspend = ohci_device_suspend, .set_hw_power = ohci_set_hw_power, + .roothub_exec = ohci_root_ctrl_task, }; Modified: head/sys/dev/usb2/controller/ohci2.h ============================================================================== --- head/sys/dev/usb2/controller/ohci2.h Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/ohci2.h Tue Jan 13 19:03:01 2009 (r187172) @@ -320,7 +320,6 @@ union ohci_hub_desc { typedef struct ohci_softc { struct ohci_hw_softc sc_hw; struct usb2_bus sc_bus; /* base device */ - struct usb2_config_td sc_config_td; struct usb2_callout sc_tmo_rhsc; union ohci_hub_desc sc_hub_desc; struct usb2_sw_transfer sc_root_ctrl; Modified: head/sys/dev/usb2/controller/ohci2_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2_atmelarm.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/ohci2_atmelarm.c Tue Jan 13 19:03:01 2009 (r187172) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -114,12 +113,6 @@ ohci_atmelarm_attach(device_t dev) strlcpy(sc->sc_ohci.sc_vendor, "Atmel", sizeof(sc->sc_ohci.sc_vendor)); - err = usb2_config_td_setup(&sc->sc_ohci.sc_config_td, sc, - &sc->sc_ohci.sc_bus.bus_mtx, NULL, 0, 4); - if (err) { - device_printf(dev, "could not setup config thread!\n"); - goto error; - } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); @@ -203,8 +196,6 @@ ohci_atmelarm_detach(device_t dev) sc->sc_ohci.sc_io_res); sc->sc_ohci.sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_ohci.sc_config_td); - usb2_bus_mem_free_all(&sc->sc_ohci.sc_bus, &ohci_iterate_hw_softc); return (0); Modified: head/sys/dev/usb2/controller/ohci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2_pci.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/ohci2_pci.c Tue Jan 13 19:03:01 2009 (r187172) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -291,12 +290,6 @@ ohci_pci_attach(device_t self) sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } - err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.bus_mtx, - NULL, 0, 4); - if (err) { - device_printf(self, "could not setup config thread!\n"); - goto error; - } /* sc->sc_bus.usbrev; set by ohci_init() */ #if (__FreeBSD_version >= 700031) @@ -332,8 +325,6 @@ ohci_pci_detach(device_t self) ohci_softc_t *sc = device_get_softc(self); device_t bdev; - usb2_config_td_drain(&sc->sc_config_td); - if (sc->sc_bus.bdev) { bdev = sc->sc_bus.bdev; device_detach(bdev); @@ -368,8 +359,6 @@ ohci_pci_detach(device_t self) sc->sc_io_res); sc->sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_config_td); - usb2_bus_mem_free_all(&sc->sc_bus, &ohci_iterate_hw_softc); return (0); Modified: head/sys/dev/usb2/controller/uhci2.c ============================================================================== --- head/sys/dev/usb2/controller/uhci2.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/uhci2.c Tue Jan 13 19:03:01 2009 (r187172) @@ -44,14 +44,11 @@ __FBSDID("$FreeBSD$"); #include #define USB_DEBUG_VAR uhcidebug -#define usb2_config_td_cc uhci_config_copy -#define usb2_config_td_softc uhci_softc #include #include #include #include -#include #include #include #include @@ -138,7 +135,6 @@ extern struct usb2_pipe_methods uhci_dev extern struct usb2_pipe_methods uhci_root_ctrl_methods; extern struct usb2_pipe_methods uhci_root_intr_methods; -static usb2_config_td_command_t uhci_root_ctrl_task; static void uhci_root_ctrl_poll(struct uhci_softc *); static void uhci_do_poll(struct usb2_bus *); static void uhci_device_done(struct usb2_xfer *, usb2_error_t); @@ -2502,15 +2498,13 @@ uhci_root_ctrl_start(struct usb2_xfer *x sc->sc_root_ctrl.xfer = xfer; - usb2_config_td_queue_command - (&sc->sc_config_td, NULL, &uhci_root_ctrl_task, 0, 0); + usb2_bus_roothub_exec(xfer->udev->bus); } static void -uhci_root_ctrl_task(struct uhci_softc *sc, - struct uhci_config_copy *cc, uint16_t refcount) +uhci_root_ctrl_task(struct usb2_bus *bus) { - uhci_root_ctrl_poll(sc); + uhci_root_ctrl_poll(UHCI_BUS2SC(bus)); } static void @@ -3361,4 +3355,5 @@ struct usb2_bus_methods uhci_bus_methods .device_resume = uhci_device_resume, .device_suspend = uhci_device_suspend, .set_hw_power = uhci_set_hw_power, + .roothub_exec = uhci_root_ctrl_task, }; Modified: head/sys/dev/usb2/controller/uhci2.h ============================================================================== --- head/sys/dev/usb2/controller/uhci2.h Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/uhci2.h Tue Jan 13 19:03:01 2009 (r187172) @@ -270,7 +270,6 @@ struct uhci_hw_softc { typedef struct uhci_softc { struct uhci_hw_softc sc_hw; struct usb2_bus sc_bus; /* base device */ - struct usb2_config_td sc_config_td; union uhci_hub_desc sc_hub_desc; struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; Modified: head/sys/dev/usb2/controller/uhci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/uhci2_pci.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/uhci2_pci.c Tue Jan 13 19:03:01 2009 (r187172) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -325,12 +324,6 @@ uhci_pci_attach(device_t self) break; } - err = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_bus.bus_mtx, - NULL, 0, 4); - if (err) { - device_printf(self, "could not setup config thread!\n"); - goto error; - } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)(void *)uhci_interrupt, sc, &sc->sc_intr_hdl); @@ -379,8 +372,6 @@ uhci_pci_detach(device_t self) uhci_softc_t *sc = device_get_softc(self); device_t bdev; - usb2_config_td_drain(&sc->sc_config_td); - if (sc->sc_bus.bdev) { bdev = sc->sc_bus.bdev; device_detach(bdev); @@ -422,8 +413,6 @@ uhci_pci_detach(device_t self) sc->sc_io_res); sc->sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_config_td); - usb2_bus_mem_free_all(&sc->sc_bus, &uhci_iterate_hw_softc); return (0); Modified: head/sys/dev/usb2/controller/usb2_bus.h ============================================================================== --- head/sys/dev/usb2/controller/usb2_bus.h Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/usb2_bus.h Tue Jan 13 19:03:01 2009 (r187172) @@ -52,9 +52,11 @@ struct usb2_bus { struct usb2_bus_stat stats_err; struct usb2_bus_stat stats_ok; struct usb2_process explore_proc; + struct usb2_process roothub_proc; struct usb2_bus_msg explore_msg[2]; struct usb2_bus_msg detach_msg[2]; struct usb2_bus_msg attach_msg[2]; + struct usb2_bus_msg roothub_msg[2]; /* * This mutex protects the USB hardware: */ Modified: head/sys/dev/usb2/controller/usb2_controller.c ============================================================================== --- head/sys/dev/usb2/controller/usb2_controller.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/usb2_controller.c Tue Jan 13 19:03:01 2009 (r187172) @@ -59,6 +59,7 @@ static void usb2_bus_mem_alloc_all_cb(st static void usb2_bus_mem_free_all_cb(struct usb2_bus *, struct usb2_page_cache *, struct usb2_page *, uint32_t, uint32_t); +static void usb2_bus_roothub(struct usb2_proc_msg *pm); /* static variables */ @@ -165,6 +166,10 @@ usb2_detach(device_t dev) USB_BUS_UNLOCK(bus); + /* Get rid of USB roothub process */ + + usb2_proc_unsetup(&bus->roothub_proc); + /* Get rid of USB explore process */ usb2_proc_unsetup(&bus->explore_proc); @@ -381,10 +386,20 @@ usb2_attach_sub(device_t dev, struct usb bus->attach_msg[1].hdr.pm_callback = &usb2_bus_attach; bus->attach_msg[1].bus = bus; - /* Create a new USB process */ - if (usb2_proc_setup(&bus->explore_proc, + bus->roothub_msg[0].hdr.pm_callback = &usb2_bus_roothub; + bus->roothub_msg[0].bus = bus; + bus->roothub_msg[1].hdr.pm_callback = &usb2_bus_roothub; + bus->roothub_msg[1].bus = bus; + + /* Create USB explore and roothub processes */ + if (usb2_proc_setup(&bus->roothub_proc, + &bus->bus_mtx, USB_PRI_HIGH)) { + printf("WARNING: Creation of USB roothub " + "process failed.\n"); + } else if (usb2_proc_setup(&bus->explore_proc, &bus->bus_mtx, USB_PRI_MED)) { - printf("WARNING: Creation of USB explore process failed.\n"); + printf("WARNING: Creation of USB explore " + "process failed.\n"); } else { /* Get final attach going */ USB_BUS_LOCK(bus); @@ -543,3 +558,38 @@ usb2_bus_mem_free_all(struct usb2_bus *b mtx_destroy(&bus->bus_mtx); } + +/*------------------------------------------------------------------------* + * usb2_bus_roothub + * + * This function is used to execute roothub control requests on the + * roothub and is called from the roothub process. + *------------------------------------------------------------------------*/ +static void +usb2_bus_roothub(struct usb2_proc_msg *pm) +{ + struct usb2_bus *bus; + + bus = ((struct usb2_bus_msg *)pm)->bus; + + USB_BUS_LOCK_ASSERT(bus, MA_OWNED); + + (bus->methods->roothub_exec) (bus); +} + +/*------------------------------------------------------------------------* + * usb2_bus_roothub_exec + * + * This function is used to schedule the "roothub_done" bus callback + * method. The bus lock must be locked when calling this function. + *------------------------------------------------------------------------*/ +void +usb2_bus_roothub_exec(struct usb2_bus *bus) +{ + USB_BUS_LOCK_ASSERT(bus, MA_OWNED); + + if (usb2_proc_msignal(&bus->roothub_proc, + &bus->roothub_msg[0], &bus->roothub_msg[1])) { + /* ignore */ + } +} Modified: head/sys/dev/usb2/controller/usb2_controller.h ============================================================================== --- head/sys/dev/usb2/controller/usb2_controller.h Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/usb2_controller.h Tue Jan 13 19:03:01 2009 (r187172) @@ -94,6 +94,10 @@ struct usb2_bus_methods { /* USB Device mode only - Optional */ void (*vbus_interrupt) (struct usb2_bus *, uint8_t is_on); + + /* USB Device and Host mode - Optional */ + + void (*roothub_exec) (struct usb2_bus *); }; /* @@ -186,6 +190,7 @@ struct usb2_temp_setup { void usb2_bus_mem_flush_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb); uint8_t usb2_bus_mem_alloc_all(struct usb2_bus *bus, bus_dma_tag_t dmat, usb2_bus_mem_cb_t *cb); void usb2_bus_mem_free_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb); +void usb2_bus_roothub_exec(struct usb2_bus *bus); uint16_t usb2_isoc_time_expand(struct usb2_bus *bus, uint16_t isoc_time_curr); uint16_t usb2_fs_isoc_schedule_isoc_time_expand(struct usb2_device *udev, struct usb2_fs_isoc_schedule **pp_start, struct usb2_fs_isoc_schedule **pp_end, uint16_t isoc_time); uint8_t usb2_fs_isoc_schedule_alloc(struct usb2_fs_isoc_schedule *fss, uint8_t *pstart, uint16_t len); Modified: head/sys/dev/usb2/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb2/controller/uss820dci.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/uss820dci.c Tue Jan 13 19:03:01 2009 (r187172) @@ -39,14 +39,11 @@ #include #define USB_DEBUG_VAR uss820dcidebug -#define usb2_config_td_cc uss820dci_config_copy -#define usb2_config_td_softc uss820dci_softc #include #include #include #include -#include #include #include #include @@ -98,7 +95,6 @@ static void uss820dci_update_shared_1(st static usb2_sw_transfer_func_t uss820dci_root_intr_done; static usb2_sw_transfer_func_t uss820dci_root_ctrl_done; -static usb2_config_td_command_t uss820dci_root_ctrl_task; /* * Here is a list of what the USS820D chip can support. The main @@ -1832,15 +1828,13 @@ uss820dci_root_ctrl_start(struct usb2_xf sc->sc_root_ctrl.xfer = xfer; - usb2_config_td_queue_command( - &sc->sc_config_td, NULL, &uss820dci_root_ctrl_task, 0, 0); + usb2_bus_roothub_exec(xfer->udev->bus); } static void -uss820dci_root_ctrl_task(struct uss820dci_softc *sc, - struct uss820dci_config_copy *cc, uint16_t refcount) +uss820dci_root_ctrl_task(struct usb2_bus *bus) { - uss820dci_root_ctrl_poll(sc); + uss820dci_root_ctrl_poll(USS820_DCI_BUS2SC(bus)); } static void @@ -2496,4 +2490,5 @@ struct usb2_bus_methods uss820dci_bus_me .get_hw_ep_profile = &uss820dci_get_hw_ep_profile, .set_stall = &uss820dci_set_stall, .clear_stall = &uss820dci_clear_stall, + .roothub_exec = &uss820dci_root_ctrl_task, }; Modified: head/sys/dev/usb2/controller/uss820dci.h ============================================================================== --- head/sys/dev/usb2/controller/uss820dci.h Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/uss820dci.h Tue Jan 13 19:03:01 2009 (r187172) @@ -347,7 +347,6 @@ struct uss820dci_softc { LIST_HEAD(, usb2_xfer) sc_interrupt_list_head; struct usb2_sw_transfer sc_root_ctrl; struct usb2_sw_transfer sc_root_intr; - struct usb2_config_td sc_config_td; struct usb2_device *sc_devices[USS820_MAX_DEVICES]; struct resource *sc_io_res; Modified: head/sys/dev/usb2/controller/uss820dci_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/uss820dci_atmelarm.c Tue Jan 13 19:02:50 2009 (r187171) +++ head/sys/dev/usb2/controller/uss820dci_atmelarm.c Tue Jan 13 19:03:01 2009 (r187172) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -175,12 +174,6 @@ uss820_atmelarm_attach(device_t dev) } device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); - err = usb2_config_td_setup(&sc->sc_config_td, sc, - &sc->sc_bus.bus_mtx, NULL, 0, 4); - if (err) { - device_printf(dev, "could not setup config thread!\n"); - goto error; - } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (void *)uss820dci_interrupt, sc, &sc->sc_intr_hdl); @@ -244,8 +237,6 @@ uss820_atmelarm_detach(device_t dev) sc->sc_io_res); sc->sc_io_res = NULL; } - usb2_config_td_unsetup(&sc->sc_config_td); - usb2_bus_mem_free_all(&sc->sc_bus, NULL); return (0); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:03:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC75510656DA; Tue, 13 Jan 2009 19:03:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87AD28FC27; Tue, 13 Jan 2009 19:03:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ3CAM012479; Tue, 13 Jan 2009 19:03:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ3CT2012473; Tue, 13 Jan 2009 19:03:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131903.n0DJ3CT2012473@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19: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: r187173 - in head/sys/dev/usb2: controller core serial storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:03:17 -0000 Author: thompsa Date: Tue Jan 13 19:03:12 2009 New Revision: 187173 URL: http://svn.freebsd.org/changeset/base/187173 Log: MFp4: //depot/projects/usb@155839 This change is about removing three fields from "struct usb2_xfer" which can be reached from "struct usb2_xfer_root" instead and cleaning up the code after this change. The fields are "xfer->udev", "xfer->xfer_mtx" and "xfer->usb2_sc". In this process the following changes were also made: Rename "usb2_root" to "xroot" which is short for "xfer root". Rename "priv_mtx" to "xfer_mtx" in USB core. The USB_XFER_LOCK and USB_XFER_UNLOCK macros should only be used in the USB core due to dependency towards "xroot". Substitute macros for the real lock in two USB device drivers. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/controller/ehci2.c head/sys/dev/usb2/controller/musb2_otg.c head/sys/dev/usb2/controller/ohci2.c head/sys/dev/usb2/controller/uhci2.c head/sys/dev/usb2/controller/uss820dci.c head/sys/dev/usb2/core/usb2_busdma.c head/sys/dev/usb2/core/usb2_core.h head/sys/dev/usb2/core/usb2_debug.c head/sys/dev/usb2/core/usb2_handle_request.c head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb2/core/usb2_request.c head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/core/usb2_transfer.h head/sys/dev/usb2/serial/uvscom2.c head/sys/dev/usb2/storage/ata-usb2.c Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:03:01 2009 (r187172) +++ head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:03:12 2009 (r187173) @@ -259,13 +259,13 @@ at91dci_pull_down(struct at91dci_softc * static void at91dci_wakeup_peer(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t use_polling; if (!(sc->sc_flags.status_suspend)) { return; } - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, AT91_UDP_GSTATE_ESR); @@ -698,7 +698,7 @@ at91dci_xfer_do_fifo(struct usb2_xfer *x return (1); /* not complete */ done: - sc = xfer->usb2_sc; + sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); temp = (xfer->endpoint & UE_ADDR); /* update FIFO bank flag and multi buffer */ @@ -886,7 +886,7 @@ at91dci_setup_standard_chain(struct usb2 DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpoint), - xfer->sumlen, usb2_get_speed(xfer->udev)); + xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.max_frame_size = xfer->max_frame_size; @@ -901,7 +901,7 @@ at91dci_setup_standard_chain(struct usb2 temp.setup_alt_next = xfer->flags_int.short_frames_ok; temp.offset = 0; - sc = xfer->usb2_sc; + sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpoint & UE_ADDR); /* check if we should prepend a setup message */ @@ -1042,7 +1042,7 @@ at91dci_start_standard_chain(struct usb2 /* poll one time */ if (at91dci_xfer_do_fifo(xfer)) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no = xfer->endpoint & UE_ADDR; /* @@ -1055,7 +1055,7 @@ at91dci_start_standard_chain(struct usb2 DPRINTFN(15, "enable interrupts on endpoint %d\n", ep_no); /* put transfer on interrupt queue */ - usb2_transfer_enqueue(&xfer->udev->bus->intr_q, xfer); + usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); /* start timeout, if any */ if (xfer->timeout != 0) { @@ -1069,7 +1069,7 @@ static void at91dci_root_intr_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); DPRINTFN(9, "\n"); @@ -1209,7 +1209,7 @@ done: static void at91dci_device_done(struct usb2_xfer *xfer, usb2_error_t error) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1623,7 +1623,7 @@ at91dci_device_isoc_fs_close(struct usb2 static void at91dci_device_isoc_fs_enter(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint32_t temp; uint32_t nframes; @@ -1705,7 +1705,7 @@ at91dci_root_ctrl_open(struct usb2_xfer static void at91dci_root_ctrl_close(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_ctrl.xfer == xfer) { sc->sc_root_ctrl.xfer = NULL; @@ -1809,11 +1809,11 @@ at91dci_root_ctrl_enter(struct usb2_xfer static void at91dci_root_ctrl_start(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); sc->sc_root_ctrl.xfer = xfer; - usb2_bus_roothub_exec(xfer->udev->bus); + usb2_bus_roothub_exec(xfer->xroot->bus); } static void @@ -1826,7 +1826,7 @@ static void at91dci_root_ctrl_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; uint8_t use_polling; @@ -1847,7 +1847,7 @@ at91dci_root_ctrl_done(struct usb2_xfer value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; /* demultiplex the control request */ @@ -2252,7 +2252,7 @@ at91dci_root_intr_open(struct usb2_xfer static void at91dci_root_intr_close(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_intr.xfer == xfer) { sc->sc_root_intr.xfer = NULL; @@ -2269,7 +2269,7 @@ at91dci_root_intr_enter(struct usb2_xfer static void at91dci_root_intr_start(struct usb2_xfer *xfer) { - struct at91dci_softc *sc = xfer->usb2_sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); sc->sc_root_intr.xfer = xfer; } @@ -2299,11 +2299,6 @@ at91dci_xfer_setup(struct usb2_setup_par xfer = parm->curr_xfer; /* - * setup xfer - */ - xfer->usb2_sc = sc; - - /* * NOTE: This driver does not use any of the parameters that * are computed from the following values. Just set some * reasonable dummies: Modified: head/sys/dev/usb2/controller/ehci2.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2.c Tue Jan 13 19:03:01 2009 (r187172) +++ head/sys/dev/usb2/controller/ehci2.c Tue Jan 13 19:03:12 2009 (r187173) @@ -971,7 +971,7 @@ ehci_transfer_intr_enqueue(struct usb2_x return; } /* put transfer on interrupt queue */ - usb2_transfer_enqueue(&xfer->udev->bus->intr_q, xfer); + usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); /* start timeout, if any */ if (xfer->timeout != 0) { @@ -1135,7 +1135,7 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_ static usb2_error_t ehci_non_isoc_done_sub(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); ehci_qtd_t *td; ehci_qtd_t *td_alt_next; uint32_t status; @@ -1239,7 +1239,7 @@ ehci_non_isoc_done(struct usb2_xfer *xfe #if USB_DEBUG if (ehcidebug > 10) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); ehci_dump_sqtds(sc, xfer->td_transfer_first); } @@ -1291,7 +1291,7 @@ static uint8_t ehci_check_transfer(struct usb2_xfer *xfer) { struct usb2_pipe_methods *methods = xfer->pipe->methods; - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); uint32_t status; @@ -1521,7 +1521,7 @@ ehci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* transfer is transferred */ ehci_device_done(xfer, USB_ERR_TIMEOUT); @@ -1731,11 +1731,11 @@ ehci_setup_standard_chain(struct usb2_xf DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpoint), - xfer->sumlen, usb2_get_speed(xfer->udev)); + xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.average = xfer->max_usb2_frame_size; temp.max_frame_size = xfer->max_frame_size; - temp.sc = xfer->usb2_sc; + temp.sc = EHCI_BUS2SC(xfer->xroot->bus); /* toggle the DMA set we are using */ xfer->flags_int.curr_dma_set ^= 1; @@ -1763,7 +1763,7 @@ ehci_setup_standard_chain(struct usb2_xf temp.auto_data_toggle = 1; } - if (usb2_get_speed(xfer->udev) != USB_SPEED_HIGH) { + if (usb2_get_speed(xfer->xroot->udev) != USB_SPEED_HIGH) { /* max 3 retries */ temp.qtd_status |= htoehci32(temp.sc, EHCI_QTD_SET_CERR(3)); @@ -1894,12 +1894,12 @@ ehci_setup_standard_chain(struct usb2_xf EHCI_QH_SET_ENDPT(UE_GET_ADDR(xfer->endpoint)) | EHCI_QH_SET_MPL(xfer->max_packet_size)); - if (usb2_get_speed(xfer->udev) == USB_SPEED_HIGH) { + if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | EHCI_QH_DTC | EHCI_QH_SET_NRL(8)); } else { - if (usb2_get_speed(xfer->udev) == USB_SPEED_FULL) { + if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) { qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_FULL) | EHCI_QH_DTC); } else { @@ -1922,8 +1922,8 @@ ehci_setup_standard_chain(struct usb2_xf (EHCI_QH_SET_MULT(xfer->max_packet_count & 3) | EHCI_QH_SET_CMASK(xfer->usb2_cmask) | EHCI_QH_SET_SMASK(xfer->usb2_smask) | - EHCI_QH_SET_HUBA(xfer->udev->hs_hub_addr) | - EHCI_QH_SET_PORT(xfer->udev->hs_port_no)); + EHCI_QH_SET_HUBA(xfer->xroot->udev->hs_hub_addr) | + EHCI_QH_SET_PORT(xfer->xroot->udev->hs_port_no)); qh->qh_endphub = htoehci32(temp.sc, qh_endphub); qh->qh_curqtd = htoehci32(temp.sc, 0); @@ -1951,7 +1951,7 @@ ehci_setup_standard_chain(struct usb2_xf usb2_pc_cpu_flush(qh->page_cache); - if (xfer->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->pwr_save.suspended == 0) { EHCI_APPEND_QH(qh, *qh_last); } } @@ -1960,7 +1960,7 @@ static void ehci_root_intr_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); uint16_t i; uint16_t m; @@ -2117,7 +2117,7 @@ static void ehci_device_done(struct usb2_xfer *xfer, usb2_error_t error) { struct usb2_pipe_methods *methods = xfer->pipe->methods; - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -2130,7 +2130,7 @@ ehci_device_done(struct usb2_xfer *xfer, if (ehcidebug > 8) { DPRINTF("nexttog=%d; data after transfer:\n", xfer->pipe->toggle_next); - ehci_dump_sqtds(xfer->usb2_sc, + ehci_dump_sqtds(sc, xfer->td_transfer_first); } #endif @@ -2185,7 +2185,7 @@ ehci_device_bulk_enter(struct usb2_xfer static void ehci_device_bulk_start(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); /* setup TD's and QH */ ehci_setup_standard_chain(xfer, &sc->sc_async_p_last); @@ -2228,7 +2228,7 @@ ehci_device_ctrl_enter(struct usb2_xfer static void ehci_device_ctrl_start(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); /* setup TD's and QH */ ehci_setup_standard_chain(xfer, &sc->sc_async_p_last); @@ -2253,7 +2253,7 @@ struct usb2_pipe_methods ehci_device_ctr static void ehci_device_intr_open(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); uint16_t best; uint16_t bit; uint16_t x; @@ -2262,9 +2262,9 @@ ehci_device_intr_open(struct usb2_xfer * /* Allocate a microframe slot first: */ slot = usb2_intr_schedule_adjust - (xfer->udev, xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX); + (xfer->xroot->udev, xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX); - if (usb2_get_speed(xfer->udev) == USB_SPEED_HIGH) { + if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { xfer->usb2_uframe = slot; xfer->usb2_smask = (1 << slot) & 0xFF; xfer->usb2_cmask = 0; @@ -2306,11 +2306,11 @@ ehci_device_intr_open(struct usb2_xfer * static void ehci_device_intr_close(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); uint8_t slot; slot = usb2_intr_schedule_adjust - (xfer->udev, -(xfer->max_frame_size), xfer->usb2_uframe); + (xfer->xroot->udev, -(xfer->max_frame_size), xfer->usb2_uframe); sc->sc_intr_stat[xfer->qh_pos]--; @@ -2326,7 +2326,7 @@ ehci_device_intr_enter(struct usb2_xfer static void ehci_device_intr_start(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); /* setup TD's and QH */ ehci_setup_standard_chain(xfer, &sc->sc_intr_p_last[xfer->qh_pos]); @@ -2351,7 +2351,7 @@ struct usb2_pipe_methods ehci_device_int static void ehci_device_isoc_fs_open(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); ehci_sitd_t *td; uint32_t sitd_portaddr; uint8_t ds; @@ -2359,8 +2359,8 @@ ehci_device_isoc_fs_open(struct usb2_xfe sitd_portaddr = EHCI_SITD_SET_ADDR(xfer->address) | EHCI_SITD_SET_ENDPT(UE_GET_ADDR(xfer->endpoint)) | - EHCI_SITD_SET_HUBA(xfer->udev->hs_hub_addr) | - EHCI_SITD_SET_PORT(xfer->udev->hs_port_no); + EHCI_SITD_SET_HUBA(xfer->xroot->udev->hs_hub_addr) | + EHCI_SITD_SET_PORT(xfer->xroot->udev->hs_port_no); if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) { sitd_portaddr |= EHCI_SITD_SET_DIR_IN; @@ -2399,7 +2399,7 @@ static void ehci_device_isoc_fs_enter(struct usb2_xfer *xfer) { struct usb2_page_search buf_res; - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); struct usb2_fs_isoc_schedule *fss_start; struct usb2_fs_isoc_schedule *fss_end; struct usb2_fs_isoc_schedule *fss; @@ -2460,7 +2460,7 @@ ehci_device_isoc_fs_enter(struct usb2_xf */ xfer->isoc_time_complete = usb2_fs_isoc_schedule_isoc_time_expand - (xfer->udev, &fss_start, &fss_end, nframes) + buf_offset + + (xfer->xroot->udev, &fss_start, &fss_end, nframes) + buf_offset + xfer->nframes; /* get the real number of frames */ @@ -2636,7 +2636,7 @@ struct usb2_pipe_methods ehci_device_iso static void ehci_device_isoc_hs_open(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); ehci_itd_t *td; uint32_t temp; uint8_t ds; @@ -2690,7 +2690,7 @@ static void ehci_device_isoc_hs_enter(struct usb2_xfer *xfer) { struct usb2_page_search buf_res; - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); ehci_itd_t *td; ehci_itd_t *td_last = NULL; ehci_itd_t **pp_last; @@ -2914,7 +2914,7 @@ ehci_root_ctrl_open(struct usb2_xfer *xf static void ehci_root_ctrl_close(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_ctrl.xfer == xfer) { sc->sc_root_ctrl.xfer = NULL; @@ -3021,13 +3021,13 @@ ehci_root_ctrl_enter(struct usb2_xfer *x static void ehci_root_ctrl_start(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); DPRINTF("\n"); sc->sc_root_ctrl.xfer = xfer; - usb2_bus_roothub_exec(xfer->udev->bus); + usb2_bus_roothub_exec(xfer->xroot->bus); } static void @@ -3040,7 +3040,7 @@ static void ehci_root_ctrl_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); char *ptr; uint32_t port; uint32_t v; @@ -3066,7 +3066,7 @@ ehci_root_ctrl_done(struct usb2_xfer *xf value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", @@ -3483,7 +3483,7 @@ ehci_root_intr_open(struct usb2_xfer *xf static void ehci_root_intr_close(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_intr.xfer == xfer) { sc->sc_root_intr.xfer = NULL; @@ -3500,7 +3500,7 @@ ehci_root_intr_enter(struct usb2_xfer *x static void ehci_root_intr_start(struct usb2_xfer *xfer) { - ehci_softc_t *sc = xfer->usb2_sc; + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); sc->sc_root_intr.xfer = xfer; } @@ -3538,11 +3538,6 @@ ehci_xfer_setup(struct usb2_setup_params nitd = 0; /* - * setup xfer - */ - xfer->usb2_sc = sc; - - /* * compute maximum number of some structures */ if (parm->methods == &ehci_device_ctrl_methods) { @@ -3864,7 +3859,7 @@ ehci_device_resume(struct usb2_device *u TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (xfer->udev == udev) { + if (xfer->xroot->udev == udev) { methods = xfer->pipe->methods; @@ -3898,7 +3893,7 @@ ehci_device_suspend(struct usb2_device * TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (xfer->udev == udev) { + if (xfer->xroot->udev == udev) { methods = xfer->pipe->methods; Modified: head/sys/dev/usb2/controller/musb2_otg.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.c Tue Jan 13 19:03:01 2009 (r187172) +++ head/sys/dev/usb2/controller/musb2_otg.c Tue Jan 13 19:03:12 2009 (r187173) @@ -204,14 +204,14 @@ musbotg_pull_down(struct musbotg_softc * static void musbotg_wakeup_peer(struct usb2_xfer *xfer) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint8_t temp; uint8_t use_polling; if (!(sc->sc_flags.status_suspend)) { return; } - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); temp |= MUSB2_MASK_RESUME; @@ -931,7 +931,7 @@ musbotg_xfer_do_fifo(struct usb2_xfer *x return (1); /* not complete */ done: - sc = xfer->usb2_sc; + sc = MUSBOTG_BUS2SC(xfer->xroot->bus); /* compute all actual lengths */ @@ -1130,7 +1130,7 @@ musbotg_setup_standard_chain(struct usb2 DPRINTFN(8, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpoint), - xfer->sumlen, usb2_get_speed(xfer->udev)); + xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.max_frame_size = xfer->max_frame_size; @@ -1145,7 +1145,7 @@ musbotg_setup_standard_chain(struct usb2 temp.setup_alt_next = xfer->flags_int.short_frames_ok; temp.offset = 0; - sc = xfer->usb2_sc; + sc = MUSBOTG_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpoint & UE_ADDR); /* check if we should prepend a setup message */ @@ -1245,7 +1245,7 @@ musbotg_timeout(void *arg) DPRINTFN(1, "xfer=%p\n", xfer); - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* transfer is transferred */ musbotg_device_done(xfer, USB_ERR_TIMEOUT); @@ -1254,7 +1254,7 @@ musbotg_timeout(void *arg) static void musbotg_ep_int_set(struct usb2_xfer *xfer, uint8_t on) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint16_t temp; uint8_t ep_no = xfer->endpoint & UE_ADDR; @@ -1304,7 +1304,7 @@ musbotg_start_standard_chain(struct usb2 DPRINTFN(14, "enabled interrupts on endpoint\n"); /* put transfer on interrupt queue */ - usb2_transfer_enqueue(&xfer->udev->bus->intr_q, xfer); + usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); /* start timeout, if any */ if (xfer->timeout != 0) { @@ -1318,7 +1318,7 @@ static void musbotg_root_intr_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); DPRINTFN(8, "\n"); @@ -1458,7 +1458,7 @@ done: static void musbotg_device_done(struct usb2_xfer *xfer, usb2_error_t error) { - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n", xfer, xfer->pipe, error); @@ -2021,7 +2021,7 @@ musbotg_device_isoc_close(struct usb2_xf static void musbotg_device_isoc_enter(struct usb2_xfer *xfer) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint32_t temp; uint32_t nframes; uint32_t fs_frames; @@ -2039,7 +2039,7 @@ musbotg_device_isoc_enter(struct usb2_xf */ temp = (nframes - xfer->pipe->isoc_next) & MUSB2_MASK_FRAME; - if (usb2_get_speed(xfer->udev) == USB_SPEED_HIGH) { + if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { fs_frames = (xfer->nframes + 7) / 8; } else { fs_frames = xfer->nframes; @@ -2109,7 +2109,7 @@ musbotg_root_ctrl_open(struct usb2_xfer static void musbotg_root_ctrl_close(struct usb2_xfer *xfer) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); if (sc->sc_root_ctrl.xfer == xfer) { sc->sc_root_ctrl.xfer = NULL; @@ -2214,11 +2214,11 @@ musbotg_root_ctrl_enter(struct usb2_xfer static void musbotg_root_ctrl_start(struct usb2_xfer *xfer) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); sc->sc_root_ctrl.xfer = xfer; - usb2_bus_roothub_exec(xfer->udev->bus); + usb2_bus_roothub_exec(xfer->xroot->bus); } static void @@ -2231,7 +2231,7 @@ static void musbotg_root_ctrl_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; uint8_t use_polling; @@ -2252,7 +2252,7 @@ musbotg_root_ctrl_done(struct usb2_xfer value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; /* demultiplex the control request */ @@ -2660,7 +2660,7 @@ musbotg_root_intr_open(struct usb2_xfer static void musbotg_root_intr_close(struct usb2_xfer *xfer) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); if (sc->sc_root_intr.xfer == xfer) { sc->sc_root_intr.xfer = NULL; @@ -2677,7 +2677,7 @@ musbotg_root_intr_enter(struct usb2_xfer static void musbotg_root_intr_start(struct usb2_xfer *xfer) { - struct musbotg_softc *sc = xfer->usb2_sc; + struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); sc->sc_root_intr.xfer = xfer; } @@ -2707,11 +2707,6 @@ musbotg_xfer_setup(struct usb2_setup_par xfer = parm->curr_xfer; /* - * setup xfer - */ - xfer->usb2_sc = sc; - - /* * NOTE: This driver does not use any of the parameters that * are computed from the following values. Just set some * reasonable dummies: Modified: head/sys/dev/usb2/controller/ohci2.c ============================================================================== --- head/sys/dev/usb2/controller/ohci2.c Tue Jan 13 19:03:01 2009 (r187172) +++ head/sys/dev/usb2/controller/ohci2.c Tue Jan 13 19:03:12 2009 (r187173) @@ -669,7 +669,7 @@ ohci_transfer_intr_enqueue(struct usb2_x return; } /* put transfer on interrupt queue */ - usb2_transfer_enqueue(&xfer->udev->bus->intr_q, xfer); + usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); /* start timeout, if any */ if (xfer->timeout != 0) { @@ -1233,7 +1233,7 @@ ohci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* transfer is transferred */ ohci_device_done(xfer, USB_ERR_TIMEOUT); @@ -1404,7 +1404,7 @@ ohci_setup_standard_chain(struct usb2_xf DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpoint), - xfer->sumlen, usb2_get_speed(xfer->udev)); + xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.average = xfer->max_usb2_frame_size; temp.max_frame_size = xfer->max_frame_size; @@ -1549,7 +1549,7 @@ ohci_setup_standard_chain(struct usb2_xf ed_flags |= (OHCI_ED_FORMAT_GEN | OHCI_ED_DIR_TD); - if (xfer->udev->speed == USB_SPEED_LOW) { + if (xfer->xroot->udev->speed == USB_SPEED_LOW) { ed_flags |= OHCI_ED_SPEED; } ed->ed_flags = htole32(ed_flags); @@ -1558,17 +1558,17 @@ ohci_setup_standard_chain(struct usb2_xf ed->ed_headp = td->td_self; - if (xfer->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->pwr_save.suspended == 0) { /* the append function will flush the endpoint descriptor */ OHCI_APPEND_QH(ed, *ed_last); if (methods == &ohci_device_bulk_methods) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF); } if (methods == &ohci_device_ctrl_methods) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_CLF); } @@ -1581,7 +1581,7 @@ static void ohci_root_intr_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); uint32_t hstatus; uint16_t i; uint16_t m; @@ -1629,7 +1629,7 @@ static void ohci_device_done(struct usb2_xfer *xfer, usb2_error_t error) { struct usb2_pipe_methods *methods = xfer->pipe->methods; - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); ohci_ed_t *ed; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1685,7 +1685,7 @@ ohci_device_bulk_enter(struct usb2_xfer static void ohci_device_bulk_start(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); /* setup TD's and QH */ ohci_setup_standard_chain(xfer, &sc->sc_bulk_p_last); @@ -1728,7 +1728,7 @@ ohci_device_ctrl_enter(struct usb2_xfer static void ohci_device_ctrl_start(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); /* setup TD's and QH */ ohci_setup_standard_chain(xfer, &sc->sc_ctrl_p_last); @@ -1753,7 +1753,7 @@ struct usb2_pipe_methods ohci_device_ctr static void ohci_device_intr_open(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); uint16_t best; uint16_t bit; uint16_t x; @@ -1786,7 +1786,7 @@ ohci_device_intr_open(struct usb2_xfer * static void ohci_device_intr_close(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); sc->sc_intr_stat[xfer->qh_pos]--; @@ -1802,7 +1802,7 @@ ohci_device_intr_enter(struct usb2_xfer static void ohci_device_intr_start(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); /* setup TD's and QH */ ohci_setup_standard_chain(xfer, &sc->sc_intr_p_last[xfer->qh_pos]); @@ -1841,7 +1841,7 @@ static void ohci_device_isoc_enter(struct usb2_xfer *xfer) { struct usb2_page_search buf_res; - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); struct ohci_hcca *hcca; uint32_t buf_offset; uint32_t nframes; @@ -1999,7 +1999,7 @@ ohci_device_isoc_enter(struct usb2_xfer OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpoint)) | OHCI_ED_SET_MAXP(xfer->max_frame_size)); - if (xfer->udev->speed == USB_SPEED_LOW) { + if (xfer->xroot->udev->speed == USB_SPEED_LOW) { ed_flags |= OHCI_ED_SPEED; } ed->ed_flags = htole32(ed_flags); @@ -2047,7 +2047,7 @@ ohci_root_ctrl_open(struct usb2_xfer *xf static void ohci_root_ctrl_close(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_ctrl.xfer == xfer) { sc->sc_root_ctrl.xfer = NULL; @@ -2127,11 +2127,11 @@ ohci_root_ctrl_enter(struct usb2_xfer *x static void ohci_root_ctrl_start(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); sc->sc_root_ctrl.xfer = xfer; - usb2_bus_roothub_exec(xfer->udev->bus); + usb2_bus_roothub_exec(xfer->xroot->bus); } static void @@ -2144,7 +2144,7 @@ static void ohci_root_ctrl_done(struct usb2_xfer *xfer, struct usb2_sw_transfer *std) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); char *ptr; uint32_t port; uint32_t v; @@ -2169,7 +2169,7 @@ ohci_root_ctrl_done(struct usb2_xfer *xf value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xfer_mtx) ? 1 : 0; + use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", @@ -2470,7 +2470,7 @@ ohci_root_intr_open(struct usb2_xfer *xf static void ohci_root_intr_close(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); if (sc->sc_root_intr.xfer == xfer) { sc->sc_root_intr.xfer = NULL; @@ -2487,7 +2487,7 @@ ohci_root_intr_enter(struct usb2_xfer *x static void ohci_root_intr_start(struct usb2_xfer *xfer) { - ohci_softc_t *sc = xfer->usb2_sc; + ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); sc->sc_root_intr.xfer = xfer; } @@ -2518,11 +2518,6 @@ ohci_xfer_setup(struct usb2_setup_params sc = OHCI_BUS2SC(parm->udev->bus); xfer = parm->curr_xfer; - /* - * setup xfer - */ - xfer->usb2_sc = sc; - parm->hc_max_packet_size = 0x500; parm->hc_max_packet_count = 1; parm->hc_max_frame_size = OHCI_PAGE_SIZE; @@ -2753,7 +2748,7 @@ ohci_device_resume(struct usb2_device *u TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (xfer->udev == udev) { + if (xfer->xroot->udev == udev) { methods = xfer->pipe->methods; ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; @@ -2791,7 +2786,7 @@ ohci_device_suspend(struct usb2_device * TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (xfer->udev == udev) { + if (xfer->xroot->udev == udev) { methods = xfer->pipe->methods; ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; Modified: head/sys/dev/usb2/controller/uhci2.c ============================================================================== --- head/sys/dev/usb2/controller/uhci2.c Tue Jan 13 19:03:01 2009 (r187172) +++ head/sys/dev/usb2/controller/uhci2.c Tue Jan 13 19:03:12 2009 (r187173) @@ -878,7 +878,7 @@ uhci_transfer_intr_enqueue(struct usb2_x return; } /* put transfer on interrupt queue */ - usb2_transfer_enqueue(&xfer->udev->bus->intr_q, xfer); + usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); /* start timeout, if any */ if (xfer->timeout != 0) { @@ -1490,7 +1490,7 @@ uhci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* transfer is transferred */ uhci_device_done(xfer, USB_ERR_TIMEOUT); @@ -1659,7 +1659,7 @@ uhci_setup_standard_chain(struct usb2_xf DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpoint), - xfer->sumlen, usb2_get_speed(xfer->udev)); + xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.average = xfer->max_frame_size; temp.max_frame_size = xfer->max_frame_size; @@ -1683,7 +1683,7 @@ uhci_setup_standard_chain(struct usb2_xf htole32(UHCI_TD_ZERO_ACTLEN(UHCI_TD_SET_ERRCNT(3) | UHCI_TD_ACTIVE)); - if (xfer->udev->speed == USB_SPEED_LOW) { + if (xfer->xroot->udev->speed == USB_SPEED_LOW) { temp.td_status |= htole32(UHCI_TD_LS); } temp.td_token = @@ -1816,7 +1816,7 @@ static void uhci_device_done(struct usb2_xfer *xfer, usb2_error_t error) { struct usb2_pipe_methods *methods = xfer->pipe->methods; - uhci_softc_t *sc = xfer->usb2_sc; + uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus); uhci_qh_t *qh; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1836,7 +1836,7 @@ uhci_device_done(struct usb2_xfer *xfer, UHCI_REMOVE_QH(qh, sc->sc_bulk_p_last); } if (methods == &uhci_device_ctrl_methods) { - if (xfer->udev->speed == USB_SPEED_LOW) { + if (xfer->xroot->udev->speed == USB_SPEED_LOW) { UHCI_REMOVE_QH(qh, sc->sc_ls_ctl_p_last); } else { UHCI_REMOVE_QH(qh, sc->sc_fs_ctl_p_last); @@ -1885,7 +1885,7 @@ uhci_device_bulk_enter(struct usb2_xfer static void uhci_device_bulk_start(struct usb2_xfer *xfer) { - uhci_softc_t *sc = xfer->usb2_sc; + uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus); uhci_td_t *td; uhci_qh_t *qh; @@ -1898,7 +1898,7 @@ uhci_device_bulk_start(struct usb2_xfer qh->e_next = td; qh->qh_e_next = td->td_self; - if (xfer->udev->pwr_save.suspended == 0) { + if (xfer->xroot->udev->pwr_save.suspended == 0) { UHCI_APPEND_QH(qh, sc->sc_bulk_p_last); uhci_add_loop(sc); xfer->flags_int.bandwidth_reclaimed = 1; @@ -1944,7 +1944,7 @@ uhci_device_ctrl_enter(struct usb2_xfer static void uhci_device_ctrl_start(struct usb2_xfer *xfer) { - uhci_softc_t *sc = xfer->usb2_sc; + uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus); uhci_qh_t *qh; uhci_td_t *td; @@ -1961,8 +1961,8 @@ uhci_device_ctrl_start(struct usb2_xfer * NOTE: some devices choke on bandwidth- reclamation for control * transfers */ - if (xfer->udev->pwr_save.suspended == 0) { - if (xfer->udev->speed == USB_SPEED_LOW) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:03:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4214F1065942; Tue, 13 Jan 2009 19:03:24 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B611F8FC2F; Tue, 13 Jan 2009 19:03:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ3NAM012529; Tue, 13 Jan 2009 19:03:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ3NaH012524; Tue, 13 Jan 2009 19:03:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131903.n0DJ3NaH012524@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:03: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: r187174 - in head/sys/dev/usb2: controller core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:03:28 -0000 Author: thompsa Date: Tue Jan 13 19:03:23 2009 New Revision: 187174 URL: http://svn.freebsd.org/changeset/base/187174 Log: MFp4: //depot/projects/usb@155842 Reduce the number of callback processes to 4 per USB controller. There are two rough categories: 1) Giant locked USB transfers. 2) Non-Giant locked USB transfers. On a real system with many USB devices plugged in the number of processes reported by "ps auxw | grep USBPROC" was reduced from 40 to 18. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/usb2_bus.h head/sys/dev/usb2/controller/usb2_controller.c head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/core/usb2_transfer.h Modified: head/sys/dev/usb2/controller/usb2_bus.h ============================================================================== --- head/sys/dev/usb2/controller/usb2_bus.h Tue Jan 13 19:03:12 2009 (r187173) +++ head/sys/dev/usb2/controller/usb2_bus.h Tue Jan 13 19:03:23 2009 (r187174) @@ -53,6 +53,13 @@ struct usb2_bus { struct usb2_bus_stat stats_ok; struct usb2_process explore_proc; struct usb2_process roothub_proc; + /* + * There are two callback processes. One for Giant locked + * callbacks. One for non-Giant locked callbacks. This should + * avoid congestion and reduce response time in most cases. + */ + struct usb2_process giant_callback_proc; + struct usb2_process non_giant_callback_proc; struct usb2_bus_msg explore_msg[2]; struct usb2_bus_msg detach_msg[2]; struct usb2_bus_msg attach_msg[2]; Modified: head/sys/dev/usb2/controller/usb2_controller.c ============================================================================== --- head/sys/dev/usb2/controller/usb2_controller.c Tue Jan 13 19:03:12 2009 (r187173) +++ head/sys/dev/usb2/controller/usb2_controller.c Tue Jan 13 19:03:23 2009 (r187174) @@ -166,6 +166,11 @@ usb2_detach(device_t dev) USB_BUS_UNLOCK(bus); + /* Get rid of USB callback processes */ + + usb2_proc_unsetup(&bus->giant_callback_proc); + usb2_proc_unsetup(&bus->non_giant_callback_proc); + /* Get rid of USB roothub process */ usb2_proc_unsetup(&bus->roothub_proc); @@ -391,8 +396,17 @@ usb2_attach_sub(device_t dev, struct usb bus->roothub_msg[1].hdr.pm_callback = &usb2_bus_roothub; bus->roothub_msg[1].bus = bus; - /* Create USB explore and roothub processes */ - if (usb2_proc_setup(&bus->roothub_proc, + /* Create USB explore, roothub and callback processes */ + + if (usb2_proc_setup(&bus->giant_callback_proc, + &bus->bus_mtx, USB_PRI_MED)) { + printf("WARNING: Creation of USB Giant " + "callback process failed.\n"); + } else if (usb2_proc_setup(&bus->non_giant_callback_proc, + &bus->bus_mtx, USB_PRI_HIGH)) { + printf("WARNING: Creation of USB non-Giant " + "callback process failed.\n"); + } else if (usb2_proc_setup(&bus->roothub_proc, &bus->bus_mtx, USB_PRI_HIGH)) { printf("WARNING: Creation of USB roothub " "process failed.\n"); Modified: head/sys/dev/usb2/core/usb2_device.c ============================================================================== --- head/sys/dev/usb2/core/usb2_device.c Tue Jan 13 19:03:12 2009 (r187173) +++ head/sys/dev/usb2/core/usb2_device.c Tue Jan 13 19:03:23 2009 (r187174) @@ -1742,8 +1742,18 @@ usb2_free_device(struct usb2_device *ude /* unsetup any leftover default USB transfers */ usb2_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX); + /* template unsetup, if any */ (usb2_temp_unsetup_p) (udev); + /* + * Make sure that our clear-stall messages are not queued + * anywhere: + */ + USB_BUS_LOCK(udev->bus); + usb2_proc_mwait(&udev->bus->non_giant_callback_proc, + &udev->cs_msg[0], &udev->cs_msg[1]); + USB_BUS_UNLOCK(udev->bus); + sx_destroy(udev->default_sx); sx_destroy(udev->default_sx + 1); Modified: head/sys/dev/usb2/core/usb2_transfer.c ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.c Tue Jan 13 19:03:12 2009 (r187173) +++ head/sys/dev/usb2/core/usb2_transfer.c Tue Jan 13 19:03:23 2009 (r187174) @@ -819,13 +819,12 @@ usb2_transfer_setup(struct usb2_device * info->done_m[1].hdr.pm_callback = &usb2_callback_proc; info->done_m[1].xroot = info; - /* create a callback thread */ - - if (usb2_proc_setup(&info->done_p, - &udev->bus->bus_mtx, USB_PRI_HIGH)) { - parm.err = USB_ERR_NO_INTR_THREAD; - goto done; - } + if (xfer_mtx == &Giant) + info->done_p = + &udev->bus->giant_callback_proc; + else + info->done_p = + &udev->bus->non_giant_callback_proc; } /* reset sizes */ @@ -1045,10 +1044,11 @@ usb2_transfer_unsetup_sub(struct usb2_xf temp = usb2_get_dma_delay(info->bus); usb2_pause_mtx(&info->bus->bus_mtx, temp); } - USB_BUS_UNLOCK(info->bus); - /* wait for interrupt thread to exit */ - usb2_proc_unsetup(&info->done_p); + /* make sure that our done messages are not queued anywhere */ + usb2_proc_mwait(info->done_p, &info->done_m[0], &info->done_m[1]); + + USB_BUS_UNLOCK(info->bus); /* free DMA'able memory, if any */ pc = info->dma_page_cache_start; @@ -1811,7 +1811,7 @@ usb2_callback_ss_done_defer(struct usb2_ * will have a Lock Order Reversal, LOR, if we try to * proceed ! */ - if (usb2_proc_msignal(&info->done_p, + if (usb2_proc_msignal(info->done_p, &info->done_m[0], &info->done_m[1])) { /* ignore */ } @@ -1851,7 +1851,7 @@ usb2_callback_wrapper(struct usb2_xfer_q * will have a Lock Order Reversal, LOR, if we try to * proceed ! */ - if (usb2_proc_msignal(&info->done_p, + if (usb2_proc_msignal(info->done_p, &info->done_m[0], &info->done_m[1])) { /* ignore */ } @@ -2195,7 +2195,8 @@ usb2_pipe_start(struct usb2_xfer_queue * udev, NULL, pipe); } else if (udev->default_xfer[1]) { info = udev->default_xfer[1]->xroot; - if (usb2_proc_msignal(&info->done_p, + if (usb2_proc_msignal( + &info->bus->non_giant_callback_proc, &udev->cs_msg[0], &udev->cs_msg[1])) { /* ignore */ } Modified: head/sys/dev/usb2/core/usb2_transfer.h ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.h Tue Jan 13 19:03:12 2009 (r187173) +++ head/sys/dev/usb2/core/usb2_transfer.h Tue Jan 13 19:03:23 2009 (r187174) @@ -47,8 +47,8 @@ struct usb2_xfer_root { struct usb2_done_msg done_m[2]; struct cv cv_drain; struct usb2_dma_parent_tag dma_parent_tag; - struct usb2_process done_p; + struct usb2_process *done_p; /* pointer to callback process */ void *memory_base; struct mtx *xfer_mtx; /* cannot be changed during operation */ struct usb2_page_cache *dma_page_cache_start; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:03:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F16801065705; Tue, 13 Jan 2009 19:03:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAF0D8FC13; Tue, 13 Jan 2009 19:03:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ3XdE012578; Tue, 13 Jan 2009 19:03:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ3XHF012571; Tue, 13 Jan 2009 19:03:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131903.n0DJ3XHF012571@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:03: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: r187175 - head/sys/dev/usb2/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:03:36 -0000 Author: thompsa Date: Tue Jan 13 19:03:33 2009 New Revision: 187175 URL: http://svn.freebsd.org/changeset/base/187175 Log: MFp4: //depot/projects/usb@155906 Remove "vbus_interrupt" method from bus methods and use a global function instead for the various drivers using it. The reason for the removal is to simplify the code. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/controller/at91dci.h head/sys/dev/usb2/controller/at91dci_atmelarm.c head/sys/dev/usb2/controller/musb2_otg.c head/sys/dev/usb2/controller/musb2_otg.h head/sys/dev/usb2/controller/musb2_otg_atmelarm.c head/sys/dev/usb2/controller/usb2_controller.h Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:03:23 2009 (r187174) +++ head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:03:33 2009 (r187175) @@ -729,11 +729,9 @@ repeat: } } -static void -at91dci_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on) +void +at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); - DPRINTFN(5, "vbus = %u\n", is_on); USB_BUS_LOCK(&sc->sc_bus); @@ -760,7 +758,6 @@ at91dci_vbus_interrupt(struct usb2_bus * &at91dci_root_intr_done); } } - USB_BUS_UNLOCK(&sc->sc_bus); } @@ -2466,6 +2463,5 @@ struct usb2_bus_methods at91dci_bus_meth .get_hw_ep_profile = &at91dci_get_hw_ep_profile, .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, - .vbus_interrupt = &at91dci_vbus_interrupt, .roothub_exec = &at91dci_root_ctrl_task, }; Modified: head/sys/dev/usb2/controller/at91dci.h ============================================================================== --- head/sys/dev/usb2/controller/at91dci.h Tue Jan 13 19:03:23 2009 (r187174) +++ head/sys/dev/usb2/controller/at91dci.h Tue Jan 13 19:03:33 2009 (r187175) @@ -240,5 +240,6 @@ void at91dci_uninit(struct at91dci_softc void at91dci_suspend(struct at91dci_softc *sc); void at91dci_resume(struct at91dci_softc *sc); void at91dci_interrupt(struct at91dci_softc *sc); +void at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on); #endif /* _AT9100_DCI_H_ */ Modified: head/sys/dev/usb2/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 19:03:23 2009 (r187174) +++ head/sys/dev/usb2/controller/at91dci_atmelarm.c Tue Jan 13 19:03:33 2009 (r187175) @@ -72,7 +72,7 @@ struct at91_udp_softc { }; static void -at91_vbus_interrupt(struct at91_udp_softc *sc) +at91_vbus_poll(struct at91_udp_softc *sc) { uint32_t temp; uint8_t vbus_val; @@ -84,8 +84,7 @@ at91_vbus_interrupt(struct at91_udp_soft /* just forward it */ vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK); - (sc->sc_dci.sc_bus.methods->vbus_interrupt) - (&sc->sc_dci.sc_bus, vbus_val); + at91dci_vbus_interrupt(&sc->sc_dci, vbus_val); } static void @@ -220,10 +219,10 @@ at91_udp_attach(device_t dev) } #if (__FreeBSD_version >= 700031) err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl); + NULL, (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); #else err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl); + (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); #endif if (err) { sc->sc_vbus_intr_hdl = NULL; @@ -237,7 +236,7 @@ at91_udp_attach(device_t dev) goto error; } else { /* poll VBUS one time */ - at91_vbus_interrupt(sc); + at91_vbus_poll(sc); } return (0); Modified: head/sys/dev/usb2/controller/musb2_otg.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.c Tue Jan 13 19:03:23 2009 (r187174) +++ head/sys/dev/usb2/controller/musb2_otg.c Tue Jan 13 19:03:33 2009 (r187175) @@ -954,11 +954,9 @@ repeat: } } -static void -musbotg_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on) +void +musbotg_vbus_interrupt(struct musbotg_softc *sc, uint8_t is_on) { - struct musbotg_softc *sc = MUSBOTG_BUS2SC(bus); - DPRINTFN(4, "vbus = %u\n", is_on); USB_BUS_LOCK(&sc->sc_bus); @@ -2873,6 +2871,5 @@ struct usb2_bus_methods musbotg_bus_meth .get_hw_ep_profile = &musbotg_get_hw_ep_profile, .set_stall = &musbotg_set_stall, .clear_stall = &musbotg_clear_stall, - .vbus_interrupt = &musbotg_vbus_interrupt, .roothub_exec = &musbotg_root_ctrl_task, }; Modified: head/sys/dev/usb2/controller/musb2_otg.h ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg.h Tue Jan 13 19:03:23 2009 (r187174) +++ head/sys/dev/usb2/controller/musb2_otg.h Tue Jan 13 19:03:33 2009 (r187175) @@ -402,5 +402,6 @@ void musbotg_uninit(struct musbotg_softc void musbotg_suspend(struct musbotg_softc *sc); void musbotg_resume(struct musbotg_softc *sc); void musbotg_interrupt(struct musbotg_softc *sc); +void musbotg_vbus_interrupt(struct musbotg_softc *sc, uint8_t is_on); #endif /* _MUSB2_OTG_H_ */ Modified: head/sys/dev/usb2/controller/musb2_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb2/controller/musb2_otg_atmelarm.c Tue Jan 13 19:03:23 2009 (r187174) +++ head/sys/dev/usb2/controller/musb2_otg_atmelarm.c Tue Jan 13 19:03:33 2009 (r187175) @@ -50,14 +50,12 @@ struct musbotg_super_softc { }; static void -musbotg_vbus_interrupt(struct musbotg_super_softc *sc) +musbotg_vbus_poll(struct musbotg_super_softc *sc) { uint8_t vbus_val = 1; /* fake VBUS on - TODO */ /* just forward it */ - - (sc->sc_otg.sc_bus.methods->vbus_interrupt) - (&sc->sc_otg.sc_bus, vbus_val); + musbotg_vbus_interrupt(&sc->sc_otg, vbus_val); } static void @@ -154,7 +152,7 @@ musbotg_attach(device_t dev) goto error; } else { /* poll VBUS one time */ - musbotg_vbus_interrupt(sc); + musbotg_vbus_poll(sc); } return (0); Modified: head/sys/dev/usb2/controller/usb2_controller.h ============================================================================== --- head/sys/dev/usb2/controller/usb2_controller.h Tue Jan 13 19:03:23 2009 (r187174) +++ head/sys/dev/usb2/controller/usb2_controller.h Tue Jan 13 19:03:33 2009 (r187175) @@ -91,10 +91,6 @@ struct usb2_bus_methods { void (*set_stall) (struct usb2_device *udev, struct usb2_xfer *xfer, struct usb2_pipe *pipe); void (*clear_stall) (struct usb2_device *udev, struct usb2_pipe *pipe); - /* USB Device mode only - Optional */ - - void (*vbus_interrupt) (struct usb2_bus *, uint8_t is_on); - /* USB Device and Host mode - Optional */ void (*roothub_exec) (struct usb2_bus *); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:03:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 144C7106573B; Tue, 13 Jan 2009 19:03:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 009558FC23; Tue, 13 Jan 2009 19:03:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ3maf012640; Tue, 13 Jan 2009 19:03:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ3mP4012621; Tue, 13 Jan 2009 19:03:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131903.n0DJ3mP4012621@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:03: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: r187176 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:03:49 -0000 Author: thompsa Date: Tue Jan 13 19:03:47 2009 New Revision: 187176 URL: http://svn.freebsd.org/changeset/base/187176 Log: MFp4: //depot/projects/usb@155917 Remove dependancy towards the USB config thread in the USB serial core. Use USB process msignalling instead. Saves a little memory and hopefully makes the code more understandable. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/serial/u3g2.c head/sys/dev/usb2/serial/uark2.c head/sys/dev/usb2/serial/ubsa2.c head/sys/dev/usb2/serial/ubser2.c head/sys/dev/usb2/serial/uchcom2.c head/sys/dev/usb2/serial/ucycom2.c head/sys/dev/usb2/serial/ufoma2.c head/sys/dev/usb2/serial/uftdi2.c head/sys/dev/usb2/serial/ugensa2.c head/sys/dev/usb2/serial/uipaq2.c head/sys/dev/usb2/serial/ulpt2.c head/sys/dev/usb2/serial/umct2.c head/sys/dev/usb2/serial/umodem2.c head/sys/dev/usb2/serial/umoscom2.c head/sys/dev/usb2/serial/uplcom2.c head/sys/dev/usb2/serial/usb2_serial.c head/sys/dev/usb2/serial/usb2_serial.h head/sys/dev/usb2/serial/uvisor2.c head/sys/dev/usb2/serial/uvscom2.c Modified: head/sys/dev/usb2/serial/u3g2.c ============================================================================== --- head/sys/dev/usb2/serial/u3g2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/u3g2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/uark2.c ============================================================================== --- head/sys/dev/usb2/serial/uark2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/uark2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/ubsa2.c ============================================================================== --- head/sys/dev/usb2/serial/ubsa2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/ubsa2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/ubser2.c ============================================================================== --- head/sys/dev/usb2/serial/ubser2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/ubser2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -87,7 +87,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/uchcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uchcom2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/uchcom2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -81,7 +81,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/ucycom2.c ============================================================================== --- head/sys/dev/usb2/serial/ucycom2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/ucycom2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/ufoma2.c ============================================================================== --- head/sys/dev/usb2/serial/ufoma2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/ufoma2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/uftdi2.c ============================================================================== --- head/sys/dev/usb2/serial/uftdi2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/uftdi2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/ugensa2.c ============================================================================== --- head/sys/dev/usb2/serial/ugensa2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/ugensa2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/uipaq2.c ============================================================================== --- head/sys/dev/usb2/serial/uipaq2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/uipaq2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/ulpt2.c ============================================================================== --- head/sys/dev/usb2/serial/ulpt2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/ulpt2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/umct2.c ============================================================================== --- head/sys/dev/usb2/serial/umct2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/umct2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/umodem2.c ============================================================================== --- head/sys/dev/usb2/serial/umodem2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/umodem2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -92,7 +92,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/umoscom2.c ============================================================================== --- head/sys/dev/usb2/serial/umoscom2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/umoscom2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/uplcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uplcom2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/uplcom2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -95,7 +95,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/usb2_serial.c ============================================================================== --- head/sys/dev/usb2/serial/usb2_serial.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/usb2_serial.c Tue Jan 13 19:03:47 2009 (r187176) @@ -78,13 +78,10 @@ __FBSDID("$FreeBSD$"); #include #define USB_DEBUG_VAR usb2_com_debug -#define usb2_config_td_cc usb2_com_config_copy -#define usb2_config_td_softc usb2_com_softc #include #include #include -#include #include #include #include @@ -99,30 +96,26 @@ SYSCTL_INT(_hw_usb2_ucom, OID_AUTO, debu &usb2_com_debug, 0, "ucom debug level"); #endif -struct usb2_com_config_copy { - struct usb2_com_softc *cc_softc; - uint8_t cc_flag0; - uint8_t cc_flag1; - uint8_t cc_flag2; - uint8_t cc_flag3; -}; - -static usb2_config_td_command_t usb2_com_config_copy; -static usb2_config_td_command_t usb2_com_cfg_start_transfers; -static usb2_config_td_command_t usb2_com_cfg_open; -static usb2_config_td_command_t usb2_com_cfg_close; -static usb2_config_td_command_t usb2_com_cfg_break; -static usb2_config_td_command_t usb2_com_cfg_dtr; -static usb2_config_td_command_t usb2_com_cfg_rts; -static usb2_config_td_command_t usb2_com_cfg_status_change; -static usb2_config_td_command_t usb2_com_cfg_param; +static usb2_proc_callback_t usb2_com_cfg_start_transfers; +static usb2_proc_callback_t usb2_com_cfg_open; +static usb2_proc_callback_t usb2_com_cfg_close; +static usb2_proc_callback_t usb2_com_cfg_break_on; +static usb2_proc_callback_t usb2_com_cfg_break_off; +static usb2_proc_callback_t usb2_com_cfg_dtr_on; +static usb2_proc_callback_t usb2_com_cfg_dtr_off; +static usb2_proc_callback_t usb2_com_cfg_rts_on; +static usb2_proc_callback_t usb2_com_cfg_rts_off; +static usb2_proc_callback_t usb2_com_cfg_status_change; +static usb2_proc_callback_t usb2_com_cfg_param; static uint8_t usb2_com_units_alloc(uint32_t, uint32_t *); static void usb2_com_units_free(uint32_t, uint32_t); static int usb2_com_attach_sub(struct usb2_com_softc *); static void usb2_com_detach_sub(struct usb2_com_softc *); -static void usb2_com_queue_command(struct usb2_com_softc *, - usb2_config_td_command_t *, int); +static void usb2_com_queue_command(struct usb2_com_softc *sc, + uint8_t cmd); +static void usb2_com_wait_command(struct usb2_com_softc *sc, + uint8_t cmd); static void usb2_com_shutdown(struct usb2_com_softc *); static void usb2_com_start_transfers(struct usb2_com_softc *); static void usb2_com_break(struct usb2_com_softc *, uint8_t); @@ -251,9 +244,7 @@ usb2_com_attach(struct usb2_com_super_so if (usb2_com_units_alloc(sub_units, &root_unit)) { return (ENOMEM); } - if (usb2_config_td_setup - (&ssc->sc_config_td, sc, p_mtx, NULL, - sizeof(struct usb2_com_config_copy), 24 * sub_units)) { + if (usb2_proc_setup(&ssc->sc_config_td, p_mtx, USB_PRI_MED)) { usb2_com_units_free(root_unit, sub_units); return (ENOMEM); } @@ -285,7 +276,7 @@ usb2_com_detach(struct usb2_com_super_so { uint32_t n; - usb2_config_td_drain(&ssc->sc_config_td); + usb2_proc_drain(&ssc->sc_config_td); for (n = 0; n < sub_units; n++, sc++) { if (sc->sc_flag & UCOM_FLAG_ATTACHED) { @@ -298,8 +289,7 @@ usb2_com_detach(struct usb2_com_super_so sc->sc_flag &= ~UCOM_FLAG_ATTACHED; } } - - usb2_config_td_unsetup(&ssc->sc_config_td); + usb2_proc_unsetup(&ssc->sc_config_td); } static int @@ -307,6 +297,7 @@ usb2_com_attach_sub(struct usb2_com_soft { struct tty *tp; int error = 0; + uint8_t n; char buf[32]; /* temporary TTY device name buffer */ tp = tty_alloc(&usb2_com_class, sc, sc->sc_parent_mtx); @@ -336,6 +327,39 @@ usb2_com_attach_sub(struct usb2_com_soft DPRINTF("ttycreate: %s\n", buf); usb2_cv_init(&sc->sc_cv, "usb2_com"); + /* + * Set all function callback pointers for deferred COM + * operations: + */ + for (n = 0; n != 2; n++) { + sc->sc_cmds[(2*USB_COM_CFG_START_TRANSFERS) + n].hdr.pm_callback = + &usb2_com_cfg_start_transfers; + sc->sc_cmds[(2*USB_COM_CFG_OPEN) + n].hdr.pm_callback = + &usb2_com_cfg_open; + sc->sc_cmds[(2*USB_COM_CFG_CLOSE) + n].hdr.pm_callback = + &usb2_com_cfg_close; + sc->sc_cmds[(2*USB_COM_CFG_BREAK_ON) + n].hdr.pm_callback = + &usb2_com_cfg_break_on; + sc->sc_cmds[(2*USB_COM_CFG_BREAK_OFF) + n].hdr.pm_callback = + &usb2_com_cfg_break_off; + sc->sc_cmds[(2*USB_COM_CFG_DTR_ON) + n].hdr.pm_callback = + &usb2_com_cfg_dtr_on; + sc->sc_cmds[(2*USB_COM_CFG_DTR_OFF) + n].hdr.pm_callback = + &usb2_com_cfg_dtr_off; + sc->sc_cmds[(2*USB_COM_CFG_RTS_ON) + n].hdr.pm_callback = + &usb2_com_cfg_rts_on; + sc->sc_cmds[(2*USB_COM_CFG_RTS_OFF) + n].hdr.pm_callback = + &usb2_com_cfg_rts_off; + sc->sc_cmds[(2*USB_COM_CFG_STATUS_CHANGE) + n].hdr.pm_callback = + &usb2_com_cfg_status_change; + sc->sc_cmds[(2*USB_COM_CFG_PARAM) + n].hdr.pm_callback = + &usb2_com_cfg_param; + } + + /* initialise all callback pointer arguments */ + for (n = 0; n != (2*USB_COM_CFG_MAX); n++) { + sc->sc_cmds[n].cc_softc = sc; + } done: return (error); } @@ -379,27 +403,41 @@ usb2_com_detach_sub(struct usb2_com_soft usb2_cv_destroy(&sc->sc_cv); } +/* + * The following function queues a command for deferred execution. + * The following function must be called locked. + */ static void -usb2_com_config_copy(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc, - uint16_t refcount) +usb2_com_queue_command(struct usb2_com_softc *sc, uint8_t cmd) { - cc->cc_softc = sc + (refcount % UCOM_SUB_UNIT_MAX); - cc->cc_flag0 = (refcount / (1 * UCOM_SUB_UNIT_MAX)) % 2; - cc->cc_flag1 = (refcount / (2 * UCOM_SUB_UNIT_MAX)) % 2; - cc->cc_flag2 = (refcount / (4 * UCOM_SUB_UNIT_MAX)) % 2; - cc->cc_flag3 = (refcount / (8 * UCOM_SUB_UNIT_MAX)) % 2; + struct usb2_com_super_softc *ssc = sc->sc_super; + + if (usb2_proc_is_gone(&ssc->sc_config_td)) { + DPRINTF("proc is gone\n"); + return; /* nothing to do */ + } + + if (usb2_proc_msignal(&ssc->sc_config_td, + &sc->sc_cmds[2*cmd], &sc->sc_cmds[(2*cmd)+1])) { + /* ignore */ + } } +/* + * The following function waits until a command has been executed. + * The following function must be called locked. + */ static void -usb2_com_queue_command(struct usb2_com_softc *sc, usb2_config_td_command_t *cmd, int flag) +usb2_com_wait_command(struct usb2_com_softc *sc, uint8_t cmd) { struct usb2_com_super_softc *ssc = sc->sc_super; - usb2_config_td_queue_command - (&ssc->sc_config_td, &usb2_com_config_copy, - cmd, (cmd == &usb2_com_cfg_status_change) ? 1 : 0, - ((sc->sc_local_unit % UCOM_SUB_UNIT_MAX) + - (flag ? UCOM_SUB_UNIT_MAX : 0))); + if (usb2_proc_is_gone(&ssc->sc_config_td)) { + DPRINTF("proc is gone\n"); + return; /* nothing to do */ + } + usb2_proc_mwait(&ssc->sc_config_td, + &sc->sc_cmds[2*cmd], &sc->sc_cmds[(2*cmd)+1]); } static void @@ -420,6 +458,8 @@ usb2_com_shutdown(struct usb2_com_softc } /* + * This function will sleep "timeout" system ticks. + * * Return values: * 0: normal delay * else: config thread is gone @@ -428,8 +468,26 @@ uint8_t usb2_com_cfg_sleep(struct usb2_com_softc *sc, uint32_t timeout) { struct usb2_com_super_softc *ssc = sc->sc_super; + uint8_t is_gone; + + is_gone = usb2_proc_is_gone(&ssc->sc_config_td); + if (is_gone) + goto done; /* we are detaching */ + if (timeout == 0) + timeout = 1; /* one tick is the least timeout */ + + mtx_unlock(sc->sc_parent_mtx); + + if (pause("UCOMWAIT", timeout)) { + /* ignore */ + } - return (usb2_config_td_sleep(&ssc->sc_config_td, timeout)); + mtx_lock(sc->sc_parent_mtx); + + /* refresh gone status */ + is_gone = usb2_proc_is_gone(&ssc->sc_config_td); +done: + return (is_gone); } /* @@ -442,13 +500,15 @@ usb2_com_cfg_is_gone(struct usb2_com_sof { struct usb2_com_super_softc *ssc = sc->sc_super; - return (usb2_config_td_is_gone(&ssc->sc_config_td)); + return (usb2_proc_is_gone(&ssc->sc_config_td)); } static void -usb2_com_cfg_start_transfers(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc, - uint16_t refcount) +usb2_com_cfg_start_transfers(struct usb2_proc_msg *_cc) { + struct usb2_com_command_msg *cc = (void *)_cc; + struct usb2_com_softc *sc; + sc = cc->cc_softc; if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) { @@ -485,14 +545,16 @@ usb2_com_start_transfers(struct usb2_com (sc->sc_callback->usb2_com_start_write) (sc); } if (!(sc->sc_flag & UCOM_FLAG_GP_DATA)) { - usb2_com_queue_command(sc, &usb2_com_cfg_start_transfers, 0); + usb2_com_queue_command(sc, USB_COM_CFG_START_TRANSFERS); } } static void -usb2_com_cfg_open(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc, - uint16_t refcount) +usb2_com_cfg_open(struct usb2_proc_msg *_cc) { + struct usb2_com_command_msg *cc = (void *)_cc; + struct usb2_com_softc *sc; + sc = cc->cc_softc; DPRINTF("\n"); @@ -550,7 +612,7 @@ usb2_com_open(struct tty *tp) sc->sc_msr = 0; sc->sc_mcr = 0; - usb2_com_queue_command(sc, &usb2_com_cfg_open, 0); + usb2_com_queue_command(sc, USB_COM_CFG_OPEN); usb2_com_start_transfers(sc); @@ -564,9 +626,11 @@ usb2_com_open(struct tty *tp) } static void -usb2_com_cfg_close(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc, - uint16_t refcount) +usb2_com_cfg_close(struct usb2_proc_msg *_cc) { + struct usb2_com_command_msg *cc = (void *)_cc; + struct usb2_com_softc *sc; + sc = cc->cc_softc; DPRINTF("\n"); @@ -588,7 +652,6 @@ static void usb2_com_close(struct tty *tp) { struct usb2_com_softc *sc = tty_softc(tp); - struct usb2_com_super_softc *ssc = sc->sc_super; mtx_assert(sc->sc_parent_mtx, MA_OWNED); @@ -600,8 +663,9 @@ usb2_com_close(struct tty *tp) } usb2_com_shutdown(sc); - usb2_com_queue_command(sc, &usb2_com_cfg_close, 0); - usb2_config_td_sync(&ssc->sc_config_td); + /* Queue and wait for close command to complete */ + usb2_com_queue_command(sc, USB_COM_CFG_CLOSE); + usb2_com_wait_command(sc, USB_COM_CFG_CLOSE); sc->sc_flag &= ~(UCOM_FLAG_HL_READY | UCOM_FLAG_WR_START | @@ -704,22 +768,35 @@ usb2_com_modem(struct tty *tp, int sigon } static void -usb2_com_cfg_break(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc, - uint16_t refcount) +usb2_com_cfg_break(struct usb2_com_command_msg *cc, uint8_t onoff) { + struct usb2_com_softc *sc; + sc = cc->cc_softc; if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) { return; } - DPRINTF("onoff=%d\n", cc->cc_flag0); + DPRINTF("onoff=%d\n", onoff); if (sc->sc_callback->usb2_com_cfg_set_break) { - (sc->sc_callback->usb2_com_cfg_set_break) (sc, cc->cc_flag0); + (sc->sc_callback->usb2_com_cfg_set_break) (sc, onoff); } } static void +usb2_com_cfg_break_on(struct usb2_proc_msg *_cc) +{ + usb2_com_cfg_break((void *)_cc, 1); +} + +static void +usb2_com_cfg_break_off(struct usb2_proc_msg *_cc) +{ + usb2_com_cfg_break((void *)_cc, 0); +} + +static void usb2_com_break(struct usb2_com_softc *sc, uint8_t onoff) { mtx_assert(sc->sc_parent_mtx, MA_OWNED); @@ -729,26 +806,40 @@ usb2_com_break(struct usb2_com_softc *sc } DPRINTF("onoff = %d\n", onoff); - usb2_com_queue_command(sc, &usb2_com_cfg_break, onoff); + usb2_com_queue_command(sc, onoff ? + USB_COM_CFG_BREAK_ON : USB_COM_CFG_BREAK_OFF); } static void -usb2_com_cfg_dtr(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc, - uint16_t refcount) +usb2_com_cfg_dtr(struct usb2_com_command_msg *cc, uint8_t onoff) { + struct usb2_com_softc *sc; + sc = cc->cc_softc; if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) { return; } - DPRINTF("onoff=%d\n", cc->cc_flag0); + DPRINTF("onoff=%d\n", onoff); if (sc->sc_callback->usb2_com_cfg_set_dtr) { - (sc->sc_callback->usb2_com_cfg_set_dtr) (sc, cc->cc_flag0); + (sc->sc_callback->usb2_com_cfg_set_dtr) (sc, onoff); } } static void +usb2_com_cfg_dtr_on(struct usb2_proc_msg *_cc) +{ + usb2_com_cfg_dtr((void *)_cc, 1); +} + +static void +usb2_com_cfg_dtr_off(struct usb2_proc_msg *_cc) +{ + usb2_com_cfg_dtr((void *)_cc, 0); +} + +static void usb2_com_dtr(struct usb2_com_softc *sc, uint8_t onoff) { mtx_assert(sc->sc_parent_mtx, MA_OWNED); @@ -758,26 +849,40 @@ usb2_com_dtr(struct usb2_com_softc *sc, } DPRINTF("onoff = %d\n", onoff); - usb2_com_queue_command(sc, &usb2_com_cfg_dtr, onoff); + usb2_com_queue_command(sc, onoff ? + USB_COM_CFG_DTR_ON : USB_COM_CFG_DTR_OFF); } static void -usb2_com_cfg_rts(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc, - uint16_t refcount) +usb2_com_cfg_rts(struct usb2_com_command_msg *cc, uint8_t onoff) { + struct usb2_com_softc *sc; + sc = cc->cc_softc; - DPRINTF("onoff=%d\n", cc->cc_flag0); + DPRINTF("onoff=%d\n", onoff); if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) { return; } if (sc->sc_callback->usb2_com_cfg_set_rts) { - (sc->sc_callback->usb2_com_cfg_set_rts) (sc, cc->cc_flag0); + (sc->sc_callback->usb2_com_cfg_set_rts) (sc, onoff); } } static void +usb2_com_cfg_rts_on(struct usb2_proc_msg *_cc) +{ + usb2_com_cfg_rts((void *)_cc, 1); +} + +static void +usb2_com_cfg_rts_off(struct usb2_proc_msg *_cc) +{ + usb2_com_cfg_rts((void *)_cc, 0); +} + +static void usb2_com_rts(struct usb2_com_softc *sc, uint8_t onoff) { mtx_assert(sc->sc_parent_mtx, MA_OWNED); @@ -787,13 +892,15 @@ usb2_com_rts(struct usb2_com_softc *sc, } DPRINTF("onoff = %d\n", onoff); - usb2_com_queue_command(sc, &usb2_com_cfg_rts, onoff); + usb2_com_queue_command(sc, onoff ? + USB_COM_CFG_RTS_ON : USB_COM_CFG_RTS_OFF); } static void -usb2_com_cfg_status_change(struct usb2_com_softc *sc, - struct usb2_com_config_copy *cc, uint16_t refcount) +usb2_com_cfg_status_change(struct usb2_proc_msg *_cc) { + struct usb2_com_command_msg *cc = (void *)_cc; + struct usb2_com_softc *sc; struct tty *tp; uint8_t new_msr; @@ -847,13 +954,14 @@ usb2_com_status_change(struct usb2_com_s } DPRINTF("\n"); - usb2_com_queue_command(sc, &usb2_com_cfg_status_change, 0); + usb2_com_queue_command(sc, USB_COM_CFG_STATUS_CHANGE); } static void -usb2_com_cfg_param(struct usb2_com_softc *sc, struct usb2_com_config_copy *cc, - uint16_t refcount) +usb2_com_cfg_param(struct usb2_proc_msg *_cc) { + struct usb2_com_command_msg *cc = (void *)_cc; + struct usb2_com_softc *sc; struct termios t_copy; sc = cc->cc_softc; @@ -924,7 +1032,7 @@ usb2_com_param(struct tty *tp, struct te sc->sc_flag &= ~UCOM_FLAG_GP_DATA; /* Queue baud rate programming command first */ - usb2_com_queue_command(sc, &usb2_com_cfg_param, 0); + usb2_com_queue_command(sc, USB_COM_CFG_PARAM); /* Queue transfer enable command last */ usb2_com_start_transfers(sc); Modified: head/sys/dev/usb2/serial/usb2_serial.h ============================================================================== --- head/sys/dev/usb2/serial/usb2_serial.h Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/usb2_serial.h Tue Jan 13 19:03:47 2009 (r187176) @@ -119,11 +119,35 @@ struct usb2_com_callback { #define ULSR_RXRDY 0x01 /* Byte ready in Receive Buffer */ #define ULSR_RCV_MASK 0x1f /* Mask for incoming data or error */ +/* + * List of serial adapter commands or deferred function calls: + */ +enum { + USB_COM_CFG_START_TRANSFERS, + USB_COM_CFG_OPEN, + USB_COM_CFG_CLOSE, + USB_COM_CFG_BREAK_ON, + USB_COM_CFG_BREAK_OFF, + USB_COM_CFG_DTR_ON, + USB_COM_CFG_DTR_OFF, + USB_COM_CFG_RTS_ON, + USB_COM_CFG_RTS_OFF, + USB_COM_CFG_STATUS_CHANGE, + USB_COM_CFG_PARAM, + USB_COM_CFG_MAX, +}; + +struct usb2_com_command_msg { + struct usb2_proc_msg hdr; /* must be first */ + struct usb2_com_softc *cc_softc; +}; + struct usb2_com_super_softc { - struct usb2_config_td sc_config_td; + struct usb2_process sc_config_td; }; struct usb2_com_softc { + struct usb2_com_command_msg sc_cmds[2*USB_COM_CFG_MAX]; struct termios sc_termios_copy; struct cv sc_cv; const struct usb2_com_callback *sc_callback; @@ -146,6 +170,7 @@ struct usb2_com_softc { uint8_t sc_msr; uint8_t sc_mcr; uint8_t sc_ttyfreed; /* set when TTY has been freed */ + uint8_t sc_last_cmd_flag[USB_COM_CFG_MAX]; }; int usb2_com_attach(struct usb2_com_super_softc *ssc, Modified: head/sys/dev/usb2/serial/uvisor2.c ============================================================================== --- head/sys/dev/usb2/serial/uvisor2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/uvisor2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -66,7 +66,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/dev/usb2/serial/uvscom2.c ============================================================================== --- head/sys/dev/usb2/serial/uvscom2.c Tue Jan 13 19:03:33 2009 (r187175) +++ head/sys/dev/usb2/serial/uvscom2.c Tue Jan 13 19:03:47 2009 (r187176) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:04:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71A181065692; Tue, 13 Jan 2009 19:04:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7058FC20; Tue, 13 Jan 2009 19:04:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ4CmK012687; Tue, 13 Jan 2009 19:04:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ4CJD012685; Tue, 13 Jan 2009 19:04:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131904.n0DJ4CJD012685@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:04: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: r187177 - in head/sys/dev/usb2: controller core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:04:13 -0000 Author: thompsa Date: Tue Jan 13 19:04:12 2009 New Revision: 187177 URL: http://svn.freebsd.org/changeset/base/187177 Log: MFp4: //depot/projects/usb@155923 Fix remaining xfer->udev variable changes. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/core/usb2_sw_transfer.c Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:03:47 2009 (r187176) +++ head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:04:12 2009 (r187177) @@ -1025,7 +1025,7 @@ at91dci_timeout(void *arg) DPRINTF("xfer=%p\n", xfer); - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* transfer is transferred */ at91dci_device_done(xfer, USB_ERR_TIMEOUT); Modified: head/sys/dev/usb2/core/usb2_sw_transfer.c ============================================================================== --- head/sys/dev/usb2/core/usb2_sw_transfer.c Tue Jan 13 19:03:47 2009 (r187176) +++ head/sys/dev/usb2/core/usb2_sw_transfer.c Tue Jan 13 19:04:12 2009 (r187177) @@ -72,7 +72,7 @@ usb2_sw_transfer(struct usb2_sw_transfer DPRINTF("xfer gone\n"); return; } - USB_BUS_LOCK_ASSERT(xfer->udev->bus, MA_OWNED); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); std->xfer = NULL; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:04:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B180D10656CB; Tue, 13 Jan 2009 19:04:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AFD38FC2F; Tue, 13 Jan 2009 19:04:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ4bWY012741; Tue, 13 Jan 2009 19:04:37 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ4bdK012739; Tue, 13 Jan 2009 19:04:37 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131904.n0DJ4bdK012739@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:04:37 +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: r187178 - head/sys/dev/usb2/core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:04:41 -0000 Author: thompsa Date: Tue Jan 13 19:04:37 2009 New Revision: 187178 URL: http://svn.freebsd.org/changeset/base/187178 Log: MFp4: //depot/projects/usb@155936 Save an USB transfer in UHUB driver by using the builtin clear-stall mechanism. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb2/core/usb2_parse.c Modified: head/sys/dev/usb2/core/usb2_hub.c ============================================================================== --- head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:04:12 2009 (r187177) +++ head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:04:37 2009 (r187178) @@ -53,6 +53,7 @@ #include #define UHUB_INTR_INTERVAL 250 /* ms */ +#define UHUB_N_TRANSFER 1 #if USB_DEBUG static int uhub_debug = 0; @@ -76,10 +77,9 @@ struct uhub_softc { struct uhub_current_state sc_st;/* current state */ device_t sc_dev; /* base device */ struct usb2_device *sc_udev; /* USB device */ - struct usb2_xfer *sc_xfer[2]; /* interrupt xfer */ + struct usb2_xfer *sc_xfer[UHUB_N_TRANSFER]; /* interrupt xfer */ uint8_t sc_flags; #define UHUB_FLAG_DID_EXPLORE 0x01 -#define UHUB_FLAG_INTR_STALL 0x02 char sc_name[32]; }; @@ -100,12 +100,11 @@ static bus_child_location_str_t uhub_chi static bus_child_pnpinfo_str_t uhub_child_pnpinfo_string; static usb2_callback_t uhub_intr_callback; -static usb2_callback_t uhub_intr_clear_stall_callback; static void usb2_dev_resume_peer(struct usb2_device *udev); static void usb2_dev_suspend_peer(struct usb2_device *udev); -static const struct usb2_config uhub_config[2] = { +static const struct usb2_config uhub_config[UHUB_N_TRANSFER] = { [0] = { .type = UE_INTERRUPT, @@ -117,17 +116,6 @@ static const struct usb2_config uhub_con .mh.callback = &uhub_intr_callback, .mh.interval = UHUB_INTR_INTERVAL, }, - - [1] = { - .type = UE_CONTROL, - .endpoint = 0, - .direction = UE_DIR_ANY, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - .mh.flags = {}, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &uhub_intr_clear_stall_callback, - }, }; /* @@ -160,19 +148,6 @@ DRIVER_MODULE(ushub, usbus, uhub_driver, DRIVER_MODULE(ushub, ushub, uhub_driver, uhub_devclass, NULL, 0); static void -uhub_intr_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct uhub_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[0]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flags &= ~UHUB_FLAG_INTR_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void uhub_intr_callback(struct usb2_xfer *xfer) { struct uhub_softc *sc = xfer->priv_sc; @@ -189,21 +164,22 @@ uhub_intr_callback(struct usb2_xfer *xfe usb2_needs_explore(sc->sc_udev->bus, 0); case USB_ST_SETUP: - if (sc->sc_flags & UHUB_FLAG_INTR_STALL) { - usb2_transfer_start(sc->sc_xfer[1]); - } else { - xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); - } - return; + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); + break; default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - /* start clear stall */ - sc->sc_flags |= UHUB_FLAG_INTR_STALL; - usb2_transfer_start(sc->sc_xfer[1]); + /* + * Do a clear-stall. The "stall_pipe" flag + * will get cleared before next callback by + * the USB stack. + */ + xfer->flags.stall_pipe = 1; + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); } - return; + break; } } @@ -736,7 +712,7 @@ uhub_attach(device_t dev) /* set up interrupt pipe */ iface_index = 0; err = usb2_transfer_setup(udev, &iface_index, sc->sc_xfer, - uhub_config, 2, sc, &Giant); + uhub_config, UHUB_N_TRANSFER, sc, &Giant); if (err) { DPRINTFN(0, "cannot setup interrupt transfer, " "errstr=%s!\n", usb2_errstr(err)); @@ -821,7 +797,7 @@ uhub_attach(device_t dev) return (0); error: - usb2_transfer_unsetup(sc->sc_xfer, 2); + usb2_transfer_unsetup(sc->sc_xfer, UHUB_N_TRANSFER); if (udev->hub) { free(udev->hub, M_USBDEV); @@ -864,7 +840,7 @@ uhub_detach(device_t dev) child = NULL; } - usb2_transfer_unsetup(sc->sc_xfer, 2); + usb2_transfer_unsetup(sc->sc_xfer, UHUB_N_TRANSFER); free(hub, M_USBDEV); sc->sc_udev->hub = NULL; Modified: head/sys/dev/usb2/core/usb2_parse.c ============================================================================== --- head/sys/dev/usb2/core/usb2_parse.c Tue Jan 13 19:04:12 2009 (r187177) +++ head/sys/dev/usb2/core/usb2_parse.c Tue Jan 13 19:04:37 2009 (r187178) @@ -43,25 +43,44 @@ * Else: Next descriptor after "desc" *------------------------------------------------------------------------*/ struct usb2_descriptor * -usb2_desc_foreach(struct usb2_config_descriptor *cd, struct usb2_descriptor *desc) +usb2_desc_foreach(struct usb2_config_descriptor *cd, + struct usb2_descriptor *_desc) { - void *end; + uint8_t *desc_next; + uint8_t *start; + uint8_t *end; + uint8_t *desc; - if (cd == NULL) { + /* be NULL safe */ + if (cd == NULL) return (NULL); - } - end = USB_ADD_BYTES(cd, UGETW(cd->wTotalLength)); - if (desc == NULL) { - desc = USB_ADD_BYTES(cd, 0); - } else { - desc = USB_ADD_BYTES(desc, desc->bLength); - } - return (((((void *)desc) >= ((void *)cd)) && - (((void *)desc) < end) && - (USB_ADD_BYTES(desc, desc->bLength) >= ((void *)cd)) && - (USB_ADD_BYTES(desc, desc->bLength) <= end) && - (desc->bLength >= sizeof(*desc))) ? desc : NULL); + /* We assume that the "wTotalLength" has been checked. */ + start = (uint8_t *)cd; + end = start + UGETW(cd->wTotalLength); + desc = (uint8_t *)_desc; + + /* Get start of next USB descriptor. */ + if (desc == NULL) + desc = start; + else + desc = desc + desc[0]; + + /* Check that the next USB descriptor is within the range. */ + if ((desc < start) || (desc >= end)) + return (NULL); /* out of range, or EOD */ + + /* Check that the second next USB descriptor is within range. */ + desc_next = desc + desc[0]; + if ((desc_next < start) || (desc_next > end)) + return (NULL); /* out of range */ + + /* Check minimum descriptor length. */ + if (desc[0] < 3) + return (NULL); /* too short descriptor */ + + /* Return start of next descriptor. */ + return ((struct usb2_descriptor *)desc); } /*------------------------------------------------------------------------* @@ -140,7 +159,6 @@ usb2_find_edesc(struct usb2_config_descr desc = ((void *)d); while ((desc = usb2_desc_foreach(cd, desc))) { - if (desc->bDescriptorType == UDESC_INTERFACE) { break; } @@ -195,7 +213,6 @@ usb2_get_no_alts(struct usb2_config_desc uint16_t n = 0; while ((desc = usb2_desc_foreach(cd, desc))) { - if ((desc->bDescriptorType == UDESC_INTERFACE) && (desc->bLength >= sizeof(*id))) { id = (void *)desc; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:04:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2EDF1065799; Tue, 13 Jan 2009 19:04:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF9FA8FC25; Tue, 13 Jan 2009 19:04:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ4mxK012780; Tue, 13 Jan 2009 19:04:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ4mRn012779; Tue, 13 Jan 2009 19:04:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131904.n0DJ4mRn012779@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:04: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: r187179 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:04:50 -0000 Author: thompsa Date: Tue Jan 13 19:04:48 2009 New Revision: 187179 URL: http://svn.freebsd.org/changeset/base/187179 Log: MFp4: //depot/projects/usb@155948 Remove duplicate USB device ID's. These ID's are already present in the U3G driver. Reported by: Paul-Henning Kamp. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/serial/ugensa2.c Modified: head/sys/dev/usb2/serial/ugensa2.c ============================================================================== --- head/sys/dev/usb2/serial/ugensa2.c Tue Jan 13 19:04:37 2009 (r187178) +++ head/sys/dev/usb2/serial/ugensa2.c Tue Jan 13 19:04:48 2009 (r187179) @@ -177,9 +177,6 @@ static const struct usb2_device_id ugens {USB_VPI(USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CDMA_MODEM1, 0)}, {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 0)}, {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 0)}, -/* {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E270, 0)}, */ - {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE, 0)}, - {USB_VPI(USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620, 0)}, {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 0)}, }; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:04:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B65F01065849; Tue, 13 Jan 2009 19:04:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DF288FC0C; Tue, 13 Jan 2009 19:04:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ4x2d012826; Tue, 13 Jan 2009 19:04:59 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ4xbg012820; Tue, 13 Jan 2009 19:04:59 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131904.n0DJ4xbg012820@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:04: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: r187180 - in head/sys/dev/usb2: core include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:05:03 -0000 Author: thompsa Date: Tue Jan 13 19:04:58 2009 New Revision: 187180 URL: http://svn.freebsd.org/changeset/base/187180 Log: MFp4: //depot/projects/usb@155957 Make code more compliant with SuperSpeed USB and Wireless USB. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/core/usb2_compat_linux.c head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/core/usb2_generic.c head/sys/dev/usb2/core/usb2_hub.c head/sys/dev/usb2/core/usb2_transfer.c head/sys/dev/usb2/include/usb2_standard.h Modified: head/sys/dev/usb2/core/usb2_compat_linux.c ============================================================================== --- head/sys/dev/usb2/core/usb2_compat_linux.c Tue Jan 13 19:04:48 2009 (r187179) +++ head/sys/dev/usb2/core/usb2_compat_linux.c Tue Jan 13 19:04:58 2009 (r187180) @@ -393,8 +393,14 @@ usb_linux_shutdown(device_t dev) static uint16_t usb_max_isoc_frames(struct usb_device *dev) { - return ((usb2_get_speed(dev->bsd_udev) == USB_SPEED_HIGH) ? - USB_MAX_HIGH_SPEED_ISOC_FRAMES : USB_MAX_FULL_SPEED_ISOC_FRAMES); + ; /* indent fix */ + switch (usb2_get_speed(dev->bsd_udev)) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: + return (USB_MAX_FULL_SPEED_ISOC_FRAMES); + default: + return (USB_MAX_HIGH_SPEED_ISOC_FRAMES); + } } /*------------------------------------------------------------------------* Modified: head/sys/dev/usb2/core/usb2_device.c ============================================================================== --- head/sys/dev/usb2/core/usb2_device.c Tue Jan 13 19:04:48 2009 (r187179) +++ head/sys/dev/usb2/core/usb2_device.c Tue Jan 13 19:04:58 2009 (r187180) @@ -75,18 +75,6 @@ static usb2_error_t usb2_fill_iface_data static void usb2_notify_addq(const char *type, struct usb2_device *); static void usb2_fifo_free_wrap(struct usb2_device *, uint8_t, uint8_t); -/* static structures */ - -static const uint8_t usb2_hub_speed_combs[USB_SPEED_MAX][USB_SPEED_MAX] = { - /* HUB *//* subdevice */ - [USB_SPEED_HIGH][USB_SPEED_HIGH] = 1, - [USB_SPEED_HIGH][USB_SPEED_FULL] = 1, - [USB_SPEED_HIGH][USB_SPEED_LOW] = 1, - [USB_SPEED_FULL][USB_SPEED_FULL] = 1, - [USB_SPEED_FULL][USB_SPEED_LOW] = 1, - [USB_SPEED_LOW][USB_SPEED_LOW] = 1, -}; - /* This variable is global to allow easy access to it: */ int usb2_template = 0; @@ -1364,21 +1352,10 @@ usb2_alloc_device(device_t parent_dev, s udev->speed = speed; udev->flags.usb2_mode = usb2_mode; - /* check speed combination */ + /* speed combination should be checked by the parent HUB */ hub = udev->parent_hub; - if (hub) { - if (usb2_hub_speed_combs[hub->speed][speed] == 0) { -#if USB_DEBUG - printf("%s: the selected subdevice and HUB speed " - "combination is not supported %d/%d.\n", - __FUNCTION__, speed, hub->speed); -#endif - /* reject this combination */ - err = USB_ERR_INVAL; - goto done; - } - } + /* search for our High Speed USB HUB, if any */ adev = udev; Modified: head/sys/dev/usb2/core/usb2_generic.c ============================================================================== --- head/sys/dev/usb2/core/usb2_generic.c Tue Jan 13 19:04:48 2009 (r187179) +++ head/sys/dev/usb2/core/usb2_generic.c Tue Jan 13 19:04:58 2009 (r187180) @@ -157,12 +157,16 @@ ugen_open(struct usb2_fifo *f, int fflag DPRINTFN(6, "flag=0x%x\n", fflags); mtx_lock(f->priv_mtx); - if (usb2_get_speed(f->udev) == USB_SPEED_HIGH) { - f->nframes = UGEN_HW_FRAMES * 8; - f->bufsize = UGEN_BULK_HS_BUFFER_SIZE; - } else { + switch (usb2_get_speed(f->udev)) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: f->nframes = UGEN_HW_FRAMES; f->bufsize = UGEN_BULK_FS_BUFFER_SIZE; + break; + default: + f->nframes = UGEN_HW_FRAMES * 8; + f->bufsize = UGEN_BULK_HS_BUFFER_SIZE; + break; } type = ed->bmAttributes & UE_XFERTYPE; Modified: head/sys/dev/usb2/core/usb2_hub.c ============================================================================== --- head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:04:48 2009 (r187179) +++ head/sys/dev/usb2/core/usb2_hub.c Tue Jan 13 19:04:58 2009 (r187180) @@ -372,18 +372,38 @@ repeat: /* * Figure out the device speed */ - speed = - (sc->sc_st.port_status & UPS_HIGH_SPEED) ? USB_SPEED_HIGH : - (sc->sc_st.port_status & UPS_LOW_SPEED) ? USB_SPEED_LOW : USB_SPEED_FULL; - + switch (udev->speed) { + case USB_SPEED_HIGH: + if (sc->sc_st.port_status & UPS_HIGH_SPEED) + speed = USB_SPEED_HIGH; + else if (sc->sc_st.port_status & UPS_LOW_SPEED) + speed = USB_SPEED_LOW; + else + speed = USB_SPEED_FULL; + break; + case USB_SPEED_FULL: + if (sc->sc_st.port_status & UPS_LOW_SPEED) + speed = USB_SPEED_LOW; + else + speed = USB_SPEED_FULL; + break; + case USB_SPEED_LOW: + speed = USB_SPEED_LOW; + break; + default: + /* same speed like parent */ + speed = udev->speed; + break; + } /* * Figure out the device mode * * NOTE: This part is currently FreeBSD specific. */ - usb2_mode = - (sc->sc_st.port_status & UPS_PORT_MODE_DEVICE) ? - USB_MODE_DEVICE : USB_MODE_HOST; + if (sc->sc_st.port_status & UPS_PORT_MODE_DEVICE) + usb2_mode = USB_MODE_DEVICE; + else + usb2_mode = USB_MODE_HOST; /* need to create a new child */ @@ -1049,17 +1069,16 @@ usb2_intr_schedule_adjust(struct usb2_de { struct usb2_bus *bus = udev->bus; struct usb2_hub *hub; + uint8_t speed; USB_BUS_LOCK_ASSERT(bus, MA_OWNED); - if (usb2_get_speed(udev) == USB_SPEED_HIGH) { - if (slot >= USB_HS_MICRO_FRAMES_MAX) { - slot = usb2_intr_find_best_slot(bus->uframe_usage, 0, - USB_HS_MICRO_FRAMES_MAX); - } - bus->uframe_usage[slot] += len; - } else { - if (usb2_get_speed(udev) == USB_SPEED_LOW) { + speed = usb2_get_speed(udev); + + switch (speed) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: + if (speed == USB_SPEED_LOW) { len *= 8; } /* @@ -1076,6 +1095,14 @@ usb2_intr_schedule_adjust(struct usb2_de } hub->uframe_usage[slot] += len; bus->uframe_usage[slot] += len; + break; + default: + if (slot >= USB_HS_MICRO_FRAMES_MAX) { + slot = usb2_intr_find_best_slot(bus->uframe_usage, 0, + USB_HS_MICRO_FRAMES_MAX); + } + bus->uframe_usage[slot] += len; + break; } return (slot); } Modified: head/sys/dev/usb2/core/usb2_transfer.c ============================================================================== --- head/sys/dev/usb2/core/usb2_transfer.c Tue Jan 13 19:04:48 2009 (r187179) +++ head/sys/dev/usb2/core/usb2_transfer.c Tue Jan 13 19:04:58 2009 (r187180) @@ -63,6 +63,7 @@ static const struct usb2_std_packet_size [USB_SPEED_FULL] = {.range = {0, 64}}, [USB_SPEED_HIGH] = {.range = {0, 1024}}, [USB_SPEED_VARIABLE] = {.range = {0, 1024}}, + [USB_SPEED_SUPER] = {.range = {0, 1024}}, }, [UE_CONTROL] = { @@ -70,6 +71,7 @@ static const struct usb2_std_packet_size [USB_SPEED_FULL] = {.fixed = {8, 16, 32, 64}}, [USB_SPEED_HIGH] = {.fixed = {64, 64, 64, 64}}, [USB_SPEED_VARIABLE] = {.fixed = {512, 512, 512, 512}}, + [USB_SPEED_SUPER] = {.fixed = {512, 512, 512, 512}}, }, [UE_BULK] = { @@ -77,6 +79,7 @@ static const struct usb2_std_packet_size [USB_SPEED_FULL] = {.fixed = {8, 16, 32, 64}}, [USB_SPEED_HIGH] = {.fixed = {512, 512, 512, 512}}, [USB_SPEED_VARIABLE] = {.fixed = {512, 512, 1024, 1536}}, + [USB_SPEED_SUPER] = {.fixed = {1024, 1024, 1024, 1024}}, }, [UE_ISOCHRONOUS] = { @@ -84,6 +87,7 @@ static const struct usb2_std_packet_size [USB_SPEED_FULL] = {.range = {0, 1023}}, [USB_SPEED_HIGH] = {.range = {0, 1024}}, [USB_SPEED_VARIABLE] = {.range = {0, 3584}}, + [USB_SPEED_SUPER] = {.range = {0, 1024}}, }, }; @@ -413,10 +417,14 @@ usb2_transfer_setup_sub(struct usb2_setu */ xfer->timeout = 1000 / 4; } - if (parm->speed == USB_SPEED_HIGH) { - frame_limit = USB_MAX_HS_ISOC_FRAMES_PER_XFER; - } else { + switch (parm->speed) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: frame_limit = USB_MAX_FS_ISOC_FRAMES_PER_XFER; + break; + default: + frame_limit = USB_MAX_HS_ISOC_FRAMES_PER_XFER; + break; } if (xfer->nframes > frame_limit) { @@ -446,13 +454,29 @@ usb2_transfer_setup_sub(struct usb2_setu xfer->interval = edesc->bInterval; - if (parm->speed == USB_SPEED_HIGH) { - xfer->interval /= 8; /* 125us -> 1ms */ + switch (parm->speed) { + case USB_SPEED_SUPER: + case USB_SPEED_VARIABLE: + /* 125us -> 1ms */ + if (xfer->interval < 4) + xfer->interval = 1; + else if (xfer->interval > 16) + xfer->interval = (1<<(16-4)); + else + xfer->interval = + (1 << (xfer->interval-4)); + break; + case USB_SPEED_HIGH: + /* 125us -> 1ms */ + xfer->interval /= 8; + break; + default: + break; } if (xfer->interval == 0) { /* - * one millisecond is the smallest - * interval + * One millisecond is the smallest + * interval we support: */ xfer->interval = 1; } Modified: head/sys/dev/usb2/include/usb2_standard.h ============================================================================== --- head/sys/dev/usb2/include/usb2_standard.h Tue Jan 13 19:04:48 2009 (r187179) +++ head/sys/dev/usb2/include/usb2_standard.h Tue Jan 13 19:04:58 2009 (r187180) @@ -602,12 +602,12 @@ struct usb2_port_status { #define UPS_SUSPEND 0x0004 #define UPS_OVERCURRENT_INDICATOR 0x0008 #define UPS_RESET 0x0010 -#define UPS_PORT_MODE_DEVICE 0x0020 /* currently FreeBSD specific */ #define UPS_PORT_POWER 0x0100 #define UPS_LOW_SPEED 0x0200 #define UPS_HIGH_SPEED 0x0400 #define UPS_PORT_TEST 0x0800 #define UPS_PORT_INDICATOR 0x1000 +#define UPS_PORT_MODE_DEVICE 0x8000 /* currently FreeBSD specific */ uWord wPortChange; #define UPS_C_CONNECT_STATUS 0x0001 #define UPS_C_PORT_ENABLED 0x0002 From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:05:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E354010658F0; Tue, 13 Jan 2009 19:05:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D05008FC27; Tue, 13 Jan 2009 19:05:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ5AH8012874; Tue, 13 Jan 2009 19:05:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ5ARl012872; Tue, 13 Jan 2009 19:05:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131905.n0DJ5ARl012872@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:05: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: r187181 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:05:12 -0000 Author: thompsa Date: Tue Jan 13 19:05:10 2009 New Revision: 187181 URL: http://svn.freebsd.org/changeset/base/187181 Log: MFp4: //depot/projects/usb@155990 Add USB scanner support to USB2 config files. Submitted by: Hans Petter Selasky Modified: head/sys/amd64/conf/USB2 head/sys/i386/conf/USB2 Modified: head/sys/amd64/conf/USB2 ============================================================================== --- head/sys/amd64/conf/USB2 Tue Jan 13 19:04:58 2009 (r187180) +++ head/sys/amd64/conf/USB2 Tue Jan 13 19:05:10 2009 (r187181) @@ -108,3 +108,7 @@ device usb2_input_ms # USB sound and MIDI device support #device usb2_sound + +# USB scanner support +device usb2_image +device usb2_scanner Modified: head/sys/i386/conf/USB2 ============================================================================== --- head/sys/i386/conf/USB2 Tue Jan 13 19:04:58 2009 (r187180) +++ head/sys/i386/conf/USB2 Tue Jan 13 19:05:10 2009 (r187181) @@ -108,3 +108,7 @@ device usb2_input_ms # USB sound and MIDI device support #device usb2_sound + +# USB scanner support +device usb2_image +device usb2_scanner From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:05:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 745F9106591D; Tue, 13 Jan 2009 19:05:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60FC58FC21; Tue, 13 Jan 2009 19:05:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ5Kid012917; Tue, 13 Jan 2009 19:05:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ5Kq0012916; Tue, 13 Jan 2009 19:05:20 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131905.n0DJ5Kq0012916@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:05: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: r187182 - head/sys/dev/usb2/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:05:21 -0000 Author: thompsa Date: Tue Jan 13 19:05:20 2009 New Revision: 187182 URL: http://svn.freebsd.org/changeset/base/187182 Log: MFp4: //depot/projects/usb@156005 Add missing set frame data pointer call. The function call was missed when zero copy was introduced in UMASS. Reported by: WATANABE Kazuhiro. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/storage/umass2.c Modified: head/sys/dev/usb2/storage/umass2.c ============================================================================== --- head/sys/dev/usb2/storage/umass2.c Tue Jan 13 19:05:10 2009 (r187181) +++ head/sys/dev/usb2/storage/umass2.c Tue Jan 13 19:05:20 2009 (r187182) @@ -2414,6 +2414,9 @@ umass_t_cbi_data_read_callback(struct us } xfer->timeout = sc->sc_transfer.data_timeout; + if (xfer->flags.ext_buffer) { + usb2_set_frame_data(xfer, sc->sc_transfer.data_ptr, 0); + } xfer->frlengths[0] = max_bulk; usb2_start_hardware(xfer); return; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:05:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D10BC10657C1; Tue, 13 Jan 2009 19:05:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE4D48FC14; Tue, 13 Jan 2009 19:05:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ5pvF012963; Tue, 13 Jan 2009 19:05:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ5pHh012960; Tue, 13 Jan 2009 19:05:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131905.n0DJ5pHh012960@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:05: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: r187183 - in head/sys/dev/usb2: controller core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:05:54 -0000 Author: thompsa Date: Tue Jan 13 19:05:51 2009 New Revision: 187183 URL: http://svn.freebsd.org/changeset/base/187183 Log: MFp4: //depot/projects/usb@156055 Compile fix for AVR-GCC Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb2/controller/at91dci.c head/sys/dev/usb2/controller/uss820dci.c head/sys/dev/usb2/core/usb2_mbuf.h Modified: head/sys/dev/usb2/controller/at91dci.c ============================================================================== --- head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:05:20 2009 (r187182) +++ head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:05:51 2009 (r187183) @@ -1776,7 +1776,7 @@ static const struct usb2_hub_descriptor_ .wHubCharacteristics[0] = (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, + (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ Modified: head/sys/dev/usb2/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb2/controller/uss820dci.c Tue Jan 13 19:05:20 2009 (r187182) +++ head/sys/dev/usb2/controller/uss820dci.c Tue Jan 13 19:05:51 2009 (r187183) @@ -1794,7 +1794,7 @@ static const struct usb2_hub_descriptor_ .wHubCharacteristics[0] = (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, .wHubCharacteristics[1] = - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, + (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, .DeviceRemovable = {0}, /* port is removable */ Modified: head/sys/dev/usb2/core/usb2_mbuf.h ============================================================================== --- head/sys/dev/usb2/core/usb2_mbuf.h Tue Jan 13 19:05:20 2009 (r187182) +++ head/sys/dev/usb2/core/usb2_mbuf.h Tue Jan 13 19:05:51 2009 (r187183) @@ -38,8 +38,9 @@ struct usb2_mbuf { struct usb2_mbuf *usb2_next; uint32_t cur_data_len; - uint32_t max_data_len:31; - uint32_t last_packet:1; + uint32_t max_data_len; + uint8_t last_packet:1; + uint8_t unused:7; }; /* From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:06:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FC481065956; Tue, 13 Jan 2009 19:06:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DD788FC14; Tue, 13 Jan 2009 19:06:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ62X0013002; Tue, 13 Jan 2009 19:06:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ62Hx013001; Tue, 13 Jan 2009 19:06:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131906.n0DJ62Hx013001@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19: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: r187184 - head/lib/libusb20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:06:04 -0000 Author: thompsa Date: Tue Jan 13 19:06:02 2009 New Revision: 187184 URL: http://svn.freebsd.org/changeset/base/187184 Log: MFp4: //depot/projects/usb@156092 Make sure all claimed interfaces gets released at close. Submitted by: Hans Petter Selasky Modified: head/lib/libusb20/libusb20.c Modified: head/lib/libusb20/libusb20.c ============================================================================== --- head/lib/libusb20/libusb20.c Tue Jan 13 19:05:51 2009 (r187183) +++ head/lib/libusb20/libusb20.c Tue Jan 13 19:06:02 2009 (r187184) @@ -486,6 +486,8 @@ libusb20_dev_close(struct libusb20_devic pdev->is_opened = 0; + pdev->claimed_interfaces = 0; + return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:07:09 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AE86106581A; Tue, 13 Jan 2009 19:07:09 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from pittgoth.com (pittgoth.com [205.134.163.206]) by mx1.freebsd.org (Postfix) with ESMTP id EC60B8FC18; Tue, 13 Jan 2009 19:07:08 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from localhost.fbsdsecure.org (c-68-83-213-214.hsd1.va.comcast.net [68.83.213.214]) (authenticated bits=0) by pittgoth.com (8.14.3/8.14.3) with ESMTP id n0DJ77sf007542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Jan 2009 14:07:08 -0500 (EST) (envelope-from trhodes@FreeBSD.org) Date: Tue, 13 Jan 2009 14:07:02 -0500 From: Tom Rhodes To: Maxim Konovalov Message-Id: <20090113140702.6fee5a4f.trhodes@FreeBSD.org> In-Reply-To: <20090113215048.R31786@mp2.macomnet.net> References: <200901131825.n0DIPuAO011141@svn.freebsd.org> <20090113184328.GD185@onelab2.iet.unipi.it> <20090113215048.R31786@mp2.macomnet.net> X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; amd64-portbld-freebsd8.0) 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, rizzo@iet.unipi.it Subject: Re: svn commit: r187159 - head/bin/kenv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:07:10 -0000 On Tue, 13 Jan 2009 21:55:31 +0300 (MSK) Maxim Konovalov wrote: > On Tue, 13 Jan 2009, 19:43+0100, Luigi Rizzo wrote: > > > On Tue, Jan 13, 2009 at 06:25:56PM +0000, Maxim Konovalov wrote: > > > Author: maxim > > > Date: Tue Jan 13 18:25:56 2009 > > > New Revision: 187159 > > > URL: http://svn.freebsd.org/changeset/base/187159 > > > > > > Log: > > > o Fix a typo. Bump .Dd for the previous delta. > > > > thanks for the fix. > > > > BTW what's the policy for dates in the manpages ? My change was only > > a clarification of existing content, not documenting new features or > > a change of behaviour, that's why I felt it was not necessary to > > modify the date. But even for other cases I am never too sure on > > what to do... > > > just intuition :-) Content changes, bump doc date. -- Tom Rhodes From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:07:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E80A21065805; Tue, 13 Jan 2009 19:07:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAF918FC0A; Tue, 13 Jan 2009 19:07:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJ7NX6013072; Tue, 13 Jan 2009 19:07:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJ7NZM013070; Tue, 13 Jan 2009 19:07:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131907.n0DJ7NZM013070@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19: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: r187185 - head/sys/dev/usb2/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:07:24 -0000 Author: thompsa Date: Tue Jan 13 19:07:23 2009 New Revision: 187185 URL: http://svn.freebsd.org/changeset/base/187185 Log: Regen. Modified: head/sys/dev/usb2/include/usb2_devid.h head/sys/dev/usb2/include/usb2_devtable.h Modified: head/sys/dev/usb2/include/usb2_devid.h ============================================================================== --- head/sys/dev/usb2/include/usb2_devid.h Tue Jan 13 19:06:02 2009 (r187184) +++ head/sys/dev/usb2/include/usb2_devid.h Tue Jan 13 19:07:23 2009 (r187185) @@ -4,7 +4,7 @@ * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: head/sys/dev/usb/usbdevs 186651 2008-12-31 14:25:14Z luigi + * FreeBSD: head/sys/dev/usb/usbdevs 187163 2009-01-13 19:01:25Z thompsa */ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ @@ -158,6 +158,7 @@ #define USB_VENDOR_KYOCERA 0x0482 /* Kyocera Wireless Corp. */ #define USB_VENDOR_STMICRO 0x0483 /* STMicroelectronics */ #define USB_VENDOR_FOXCONN 0x0489 /* Foxconn */ +#define USB_VENDOR_MEIZU 0x0492 /* Meizu Electronics */ #define USB_VENDOR_YAMAHA 0x0499 /* YAMAHA */ #define USB_VENDOR_COMPAQ 0x049f /* Compaq */ #define USB_VENDOR_HITACHI 0x04a4 /* Hitachi */ @@ -1664,6 +1665,9 @@ #define USB_PRODUCT_MCT_USB232 0x0210 /* USB-232 Interface */ #define USB_PRODUCT_MCT_SITECOM_USB232 0x0230 /* Sitecom USB-232 Products */ +/* Meizu Electronics */ +#define USB_PRODUCT_MEIZU_M6_SL 0x0140 /* MiniPlayer M6 (SL) */ + /* Melco, Inc products */ #define USB_PRODUCT_MELCO_LUATX1 0x0001 /* LUA-TX Ethernet */ #define USB_PRODUCT_MELCO_LUATX5 0x0005 /* LUA-TX Ethernet */ Modified: head/sys/dev/usb2/include/usb2_devtable.h ============================================================================== --- head/sys/dev/usb2/include/usb2_devtable.h Tue Jan 13 19:06:02 2009 (r187184) +++ head/sys/dev/usb2/include/usb2_devtable.h Tue Jan 13 19:07:23 2009 (r187185) @@ -4,7 +4,7 @@ * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: head/sys/dev/usb/usbdevs 186651 2008-12-31 14:25:14Z luigi + * FreeBSD: head/sys/dev/usb/usbdevs 187163 2009-01-13 19:01:25Z thompsa */ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ @@ -4031,6 +4031,12 @@ const struct usb_knowndev usb_knowndevs[ "Sitecom USB-232 Products", }, { + USB_VENDOR_MEIZU, USB_PRODUCT_MEIZU_M6_SL, + 0, + "Meizu Electronics", + "MiniPlayer M6 (SL)", + }, + { USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX1, 0, "Melco", @@ -7871,6 +7877,12 @@ const struct usb_knowndev usb_knowndevs[ NULL, }, { + USB_VENDOR_MEIZU, 0, + USB_KNOWNDEV_NOPROD, + "Meizu Electronics", + NULL, + }, + { USB_VENDOR_YAMAHA, 0, USB_KNOWNDEV_NOPROD, "YAMAHA", From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:14:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E5B5106582D; Tue, 13 Jan 2009 19:14:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A0FB8FC29; Tue, 13 Jan 2009 19:14:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJEphE013287; Tue, 13 Jan 2009 19:14:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJEp6E013285; Tue, 13 Jan 2009 19:14:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131914.n0DJEp6E013285@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:14: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: r187186 - head/sys/dev/usb2/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:14:54 -0000 Author: thompsa Date: Tue Jan 13 19:14:51 2009 New Revision: 187186 URL: http://svn.freebsd.org/changeset/base/187186 Log: Sync to p4 156093 - Add quirks for Parallels These snuck in as part of a perforce IFC. Modified: head/sys/dev/usb2/controller/ehci2_pci.c head/sys/dev/usb2/controller/uhci2_pci.c Modified: head/sys/dev/usb2/controller/ehci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/ehci2_pci.c Tue Jan 13 19:07:23 2009 (r187185) +++ head/sys/dev/usb2/controller/ehci2_pci.c Tue Jan 13 19:14:51 2009 (r187186) @@ -261,8 +261,10 @@ ehci_pci_attach(device_t self) sc->sc_bus.usbrev = USB_REV_2_0; break; default: - sc->sc_bus.usbrev = USB_REV_UNKNOWN; - break; + /* Quirk for Parallels Desktop 4.0 */ + device_printf(self, "USB revision is unknown. Assuming v2.0.\n"); + sc->sc_bus.usbrev = USB_REV_2_0; + break; } rid = PCI_CBMEM; Modified: head/sys/dev/usb2/controller/uhci2_pci.c ============================================================================== --- head/sys/dev/usb2/controller/uhci2_pci.c Tue Jan 13 19:07:23 2009 (r187185) +++ head/sys/dev/usb2/controller/uhci2_pci.c Tue Jan 13 19:14:51 2009 (r187186) @@ -320,7 +320,9 @@ uhci_pci_attach(device_t self) sc->sc_bus.usbrev = USB_REV_1_0; break; default: - sc->sc_bus.usbrev = USB_REV_UNKNOWN; + /* Quirk for Parallels Desktop 4.0 */ + device_printf(self, "USB revision is unknown. Assuming v1.1.\n"); + sc->sc_bus.usbrev = USB_REV_1_1; break; } From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:16:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FB581065CE3; Tue, 13 Jan 2009 19:16:53 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 9EB5A8FC18; Tue, 13 Jan 2009 19:16:52 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 899402C2AEB; Tue, 13 Jan 2009 12:47:59 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id t2DAZKcCfzDU; Tue, 13 Jan 2009 12:47:51 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 0C4352C2A8E; Tue, 13 Jan 2009 12:47:50 -0600 (CST) Message-ID: <496CE1D6.6000101@cs.rice.edu> Date: Tue, 13 Jan 2009 12:47:50 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.17 (X11/20080926) MIME-Version: 1.0 To: Rafal Jaworowski References: <200901131615.n0DGFnuC008182@svn.freebsd.org> In-Reply-To: <200901131615.n0DGFnuC008182@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187151 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:16:55 -0000 Both the BookE and MIPS pmap modules need to have their get_pv_entry() functions updated. Their implementations of get_pv_entry() look like what I would expect to find in FreeBSD 4. For example, the modern equivalent of pmap_collect() is performed synchronously from get_pv_entry() rather than asynchronously as a side-effect of waking the page daemon. As a result of this mismatch, there is no pmap_collect()-like support in HEAD for either BookE or MIPS. This could cause either to crash under memory pressure. The simplest correct implementation of get_pv_entry() can be found in the IA64 pmap module. You could cut-and-paste all but the body of the inner loop. (amd64 and i386 are complicated by their efforts to save memory.) Regards, Alan Rafal Jaworowski wrote: > Author: raj > Date: Tue Jan 13 16:15:49 2009 > New Revision: 187151 > URL: http://svn.freebsd.org/changeset/base/187151 > > Log: > Clean up BookE pmap. > > Improve comments, eliminate redundant debug output, fix style(9) and other > minor tweaks for code readability. > > Obtained from: Freescale, Semihalf > > Modified: > head/sys/powerpc/booke/pmap.c > > Modified: head/sys/powerpc/booke/pmap.c > ============================================================================== > --- head/sys/powerpc/booke/pmap.c Tue Jan 13 15:56:53 2009 (r187150) > +++ head/sys/powerpc/booke/pmap.c Tue Jan 13 16:15:49 2009 (r187151) > @@ -11,8 +11,6 @@ > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in the > * documentation and/or other materials provided with the distribution. > - * 3. The name of the author may not be used to endorse or promote products > - * derived from this software without specific prior written permission. > * > * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > @@ -38,15 +36,16 @@ > * > * Virtual address space layout: > * ----------------------------- > - * 0x0000_0000 - 0xbfff_efff : user process > - * 0xc000_0000 - 0xc1ff_ffff : kernel reserved > - * 0xc000_0000 - kernelend : kernel code &data > - * 0xc1ff_c000 - 0xc200_0000 : kstack0 > - * 0xc200_0000 - 0xffef_ffff : KVA > - * 0xc200_0000 - 0xc200_3fff : reserved for page zero/copy > - * 0xc200_4000 - ptbl buf end: reserved for ptbl bufs > - * ptbl buf end- 0xffef_ffff : actual free KVA space > - * 0xfff0_0000 - 0xffff_ffff : I/O devices region > + * 0x0000_0000 - 0xafff_ffff : user process > + * 0xb000_0000 - 0xbfff_ffff : pmap_mapdev()-ed area (PCI/PCIE etc.) > + * 0xc000_0000 - 0xc0ff_ffff : kernel reserved > + * 0xc000_0000 - kernelend : kernel code+data, env, metadata etc. > + * 0xc100_0000 - 0xfeef_ffff : KVA > + * 0xc100_0000 - 0xc100_3fff : reserved for page zero/copy > + * 0xc100_4000 - 0xc200_3fff : reserved for ptbl bufs > + * 0xc200_4000 - 0xc200_8fff : guard page + kstack0 > + * 0xc200_9000 - 0xfeef_ffff : actual free KVA space > + * 0xfef0_0000 - 0xffff_ffff : I/O devices region > */ > > #include > @@ -382,10 +381,10 @@ ptbl_init(void) > { > int i; > > - //debugf("ptbl_init: s (ptbl_bufs = 0x%08x size 0x%08x)\n", > - // (u_int32_t)ptbl_bufs, sizeof(struct ptbl_buf) * PTBL_BUFS); > - //debugf("ptbl_init: s (ptbl_buf_pool_vabase = 0x%08x size = 0x%08x)\n", > - // ptbl_buf_pool_vabase, PTBL_BUFS * PTBL_PAGES * PAGE_SIZE); > + CTR3(KTR_PMAP, "%s: s (ptbl_bufs = 0x%08x size 0x%08x)", __func__, > + (uint32_t)ptbl_bufs, sizeof(struct ptbl_buf) * PTBL_BUFS); > + CTR3(KTR_PMAP, "%s: s (ptbl_buf_pool_vabase = 0x%08x size = 0x%08x)", > + __func__, ptbl_buf_pool_vabase, PTBL_BUFS * PTBL_PAGES * PAGE_SIZE); > > mtx_init(&ptbl_buf_freelist_lock, "ptbl bufs lock", NULL, MTX_DEF); > TAILQ_INIT(&ptbl_buf_freelist); > @@ -394,8 +393,6 @@ ptbl_init(void) > ptbl_bufs[i].kva = ptbl_buf_pool_vabase + i * PTBL_PAGES * PAGE_SIZE; > TAILQ_INSERT_TAIL(&ptbl_buf_freelist, &ptbl_bufs[i], link); > } > - > - //debugf("ptbl_init: e\n"); > } > > /* Get a ptbl_buf from the freelist. */ > @@ -404,15 +401,14 @@ ptbl_buf_alloc(void) > { > struct ptbl_buf *buf; > > - //debugf("ptbl_buf_alloc: s\n"); > - > mtx_lock(&ptbl_buf_freelist_lock); > buf = TAILQ_FIRST(&ptbl_buf_freelist); > if (buf != NULL) > TAILQ_REMOVE(&ptbl_buf_freelist, buf, link); > mtx_unlock(&ptbl_buf_freelist_lock); > > - //debugf("ptbl_buf_alloc: e (buf = 0x%08x)\n", (u_int32_t)buf); > + CTR2(KTR_PMAP, "%s: buf = %p", __func__, buf); > + > return (buf); > } > > @@ -563,9 +559,8 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, unsi > vm_page_t m; > int i; > > - //int su = (pmap == kernel_pmap); > - //debugf("ptbl_unhold: s (pmap = %08x su = %d pdir_idx = %d)\n", > - // (u_int32_t)pmap, su, pdir_idx); > + CTR4(KTR_PMAP, "%s: pmap = %p su = %d pdir_idx = %d", __func__, pmap, > + (pmap == kernel_pmap), pdir_idx); > > KASSERT((pdir_idx <= (VM_MAXUSER_ADDRESS / PDIR_SIZE)), > ("ptbl_unhold: invalid pdir_idx")); > @@ -580,15 +575,16 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, unsi > > /* decrement hold count */ > for (i = 0; i < PTBL_PAGES; i++) { > - pa = pte_vatopa(mmu, kernel_pmap, (vm_offset_t)ptbl + (i * PAGE_SIZE)); > + pa = pte_vatopa(mmu, kernel_pmap, > + (vm_offset_t)ptbl + (i * PAGE_SIZE)); > m = PHYS_TO_VM_PAGE(pa); > m->wire_count--; > } > > /* > * Free ptbl pages if there are no pte etries in this ptbl. > - * wire_count has the same value for all ptbl pages, so check > - * the last page. > + * wire_count has the same value for all ptbl pages, so check the last > + * page. > */ > if (m->wire_count == 0) { > ptbl_free(mmu, pmap, pdir_idx); > @@ -597,13 +593,12 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, unsi > return (1); > } > > - //debugf("ptbl_unhold: e\n"); > return (0); > } > > /* > - * Increment hold count for ptbl pages. This routine is used when > - * new pte entry is being inserted into ptbl. > + * Increment hold count for ptbl pages. This routine is used when a new pte > + * entry is being inserted into the ptbl. > */ > static void > ptbl_hold(mmu_t mmu, pmap_t pmap, unsigned int pdir_idx) > @@ -613,7 +608,8 @@ ptbl_hold(mmu_t mmu, pmap_t pmap, unsign > vm_page_t m; > int i; > > - //debugf("ptbl_hold: s (pmap = 0x%08x pdir_idx = %d)\n", (u_int32_t)pmap, pdir_idx); > + CTR3(KTR_PMAP, "%s: pmap = %p pdir_idx = %d", __func__, pmap, > + pdir_idx); > > KASSERT((pdir_idx <= (VM_MAXUSER_ADDRESS / PDIR_SIZE)), > ("ptbl_hold: invalid pdir_idx")); > @@ -625,12 +621,11 @@ ptbl_hold(mmu_t mmu, pmap_t pmap, unsign > KASSERT((ptbl != NULL), ("ptbl_hold: null ptbl")); > > for (i = 0; i < PTBL_PAGES; i++) { > - pa = pte_vatopa(mmu, kernel_pmap, (vm_offset_t)ptbl + (i * PAGE_SIZE)); > + pa = pte_vatopa(mmu, kernel_pmap, > + (vm_offset_t)ptbl + (i * PAGE_SIZE)); > m = PHYS_TO_VM_PAGE(pa); > m->wire_count++; > } > - > - //debugf("ptbl_hold: e\n"); > } > > /* Allocate pv_entry structure. */ > @@ -639,16 +634,14 @@ pv_alloc(void) > { > pv_entry_t pv; > > - debugf("pv_alloc: s\n"); > - > pv_entry_count++; > - if ((pv_entry_count > pv_entry_high_water) && (pagedaemon_waken == 0)) { > + if ((pv_entry_count > pv_entry_high_water) && > + (pagedaemon_waken == 0)) { > pagedaemon_waken = 1; > - wakeup (&vm_pages_needed); > + wakeup(&vm_pages_needed); > } > pv = uma_zalloc(pvzone, M_NOWAIT); > > - debugf("pv_alloc: e\n"); > return (pv); > } > > @@ -656,12 +649,9 @@ pv_alloc(void) > static __inline void > pv_free(pv_entry_t pve) > { > - //debugf("pv_free: s\n"); > > pv_entry_count--; > uma_zfree(pvzone, pve); > - > - //debugf("pv_free: e\n"); > } > > > @@ -713,7 +703,6 @@ pv_remove(pmap_t pmap, vm_offset_t va, v > > /* free pv entry struct */ > pv_free(pve); > - > break; > } > } > @@ -727,7 +716,7 @@ pv_remove(pmap_t pmap, vm_offset_t va, v > * Return 1 if ptbl pages were freed, otherwise return 0. > */ > static int > -pte_remove(mmu_t mmu, pmap_t pmap, vm_offset_t va, u_int8_t flags) > +pte_remove(mmu_t mmu, pmap_t pmap, vm_offset_t va, uint8_t flags) > { > unsigned int pdir_idx = PDIR_IDX(va); > unsigned int ptbl_idx = PTBL_IDX(va); > @@ -1003,10 +992,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset > panic("mmu_booke_bootstrap: phys_avail too small"); > > /* > - * Removed kernel physical address range from avail > - * regions list. Page align all regions. > - * Non-page aligned memory isn't very interesting to us. > - * Also, sort the entries for ascending addresses. > + * Remove kernel physical address range from avail regions list. Page > + * align all regions. Non-page aligned memory isn't very interesting > + * to us. Also, sort the entries for ascending addresses. > */ > sz = 0; > cnt = availmem_regions_sz; > @@ -1089,7 +1077,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset > > debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", > availmem_regions[i].mr_start, > - availmem_regions[i].mr_start + availmem_regions[i].mr_size, > + availmem_regions[i].mr_start + > + availmem_regions[i].mr_size, > availmem_regions[i].mr_size); > > if (hwphyssz != 0 && > @@ -1121,7 +1110,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset > > debugf("Maxmem = 0x%08lx\n", Maxmem); > debugf("phys_avail_count = %d\n", phys_avail_count); > - debugf("physsz = 0x%08x physmem = %ld (0x%08lx)\n", physsz, physmem, physmem); > + debugf("physsz = 0x%08x physmem = %ld (0x%08lx)\n", physsz, physmem, > + physmem); > > /*******************************************************/ > /* Initialize (statically allocated) kernel pmap. */ > @@ -1211,8 +1201,6 @@ mmu_booke_init(mmu_t mmu) > { > int shpgperproc = PMAP_SHPGPERPROC; > > - //debugf("mmu_booke_init: s\n"); > - > /* > * Initialize the address space (zone) for the pv entries. Set a > * high water mark so that the system can recover from excessive > @@ -1234,8 +1222,6 @@ mmu_booke_init(mmu_t mmu) > > /* Initialize ptbl allocation. */ > ptbl_init(); > - > - //debugf("mmu_booke_init: e\n"); > } > > /* > @@ -1248,16 +1234,12 @@ mmu_booke_qenter(mmu_t mmu, vm_offset_t > { > vm_offset_t va; > > - //debugf("mmu_booke_qenter: s (sva = 0x%08x count = %d)\n", sva, count); > - > va = sva; > while (count-- > 0) { > mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(*m)); > va += PAGE_SIZE; > m++; > } > - > - //debugf("mmu_booke_qenter: e\n"); > } > > /* > @@ -1269,15 +1251,11 @@ mmu_booke_qremove(mmu_t mmu, vm_offset_t > { > vm_offset_t va; > > - //debugf("mmu_booke_qremove: s (sva = 0x%08x count = %d)\n", sva, count); > - > va = sva; > while (count-- > 0) { > mmu_booke_kremove(mmu, va); > va += PAGE_SIZE; > } > - > - //debugf("mmu_booke_qremove: e\n"); > } > > /* > @@ -1288,14 +1266,11 @@ mmu_booke_kenter(mmu_t mmu, vm_offset_t > { > unsigned int pdir_idx = PDIR_IDX(va); > unsigned int ptbl_idx = PTBL_IDX(va); > - u_int32_t flags; > + uint32_t flags; > pte_t *pte; > > - //debugf("mmu_booke_kenter: s (pdir_idx = %d ptbl_idx = %d va=0x%08x pa=0x%08x)\n", > - // pdir_idx, ptbl_idx, va, pa); > - > - KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)), > - ("mmu_booke_kenter: invalid va")); > + KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && > + (va <= VM_MAX_KERNEL_ADDRESS)), ("mmu_booke_kenter: invalid va")); > > #if 0 > /* assume IO mapping, set I, G bits */ > @@ -1385,10 +1360,9 @@ mmu_booke_kremove(mmu_t mmu, vm_offset_t > static void > mmu_booke_pinit0(mmu_t mmu, pmap_t pmap) > { > - //debugf("mmu_booke_pinit0: s (pmap = 0x%08x)\n", (u_int32_t)pmap); > + > mmu_booke_pinit(mmu, pmap); > PCPU_SET(curpmap, pmap); > - //debugf("mmu_booke_pinit0: e\n"); > } > > /* > @@ -1423,11 +1397,13 @@ static void > mmu_booke_release(mmu_t mmu, pmap_t pmap) > { > > - //debugf("mmu_booke_release: s\n"); > + printf("mmu_booke_release: s\n"); > > - PMAP_LOCK_DESTROY(pmap); > + KASSERT(pmap->pm_stats.resident_count == 0, > + ("pmap_release: pmap resident count %ld != 0", > + pmap->pm_stats.resident_count)); > > - //debugf("mmu_booke_release: e\n"); > + PMAP_LOCK_DESTROY(pmap); > } > > #if 0 > @@ -1447,6 +1423,7 @@ static void > mmu_booke_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, > vm_prot_t prot, boolean_t wired) > { > + > vm_page_lock_queues(); > PMAP_LOCK(pmap); > mmu_booke_enter_locked(mmu, pmap, va, m, prot, wired); > @@ -1460,7 +1437,7 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t > { > pte_t *pte; > vm_paddr_t pa; > - u_int32_t flags; > + uint32_t flags; > int su, sync; > > pa = VM_PAGE_TO_PHYS(m); > @@ -1473,11 +1450,12 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t > // (u_int32_t)m, va, pa, prot, wired); > > if (su) { > - KASSERT(((va >= virtual_avail) && (va <= VM_MAX_KERNEL_ADDRESS)), > - ("mmu_booke_enter_locked: kernel pmap, non kernel va")); > + KASSERT(((va >= virtual_avail) && > + (va <= VM_MAX_KERNEL_ADDRESS)), > + ("mmu_booke_enter_locked: kernel pmap, non kernel va")); > } else { > KASSERT((va <= VM_MAXUSER_ADDRESS), > - ("mmu_booke_enter_locked: user pmap, non user va")); > + ("mmu_booke_enter_locked: user pmap, non user va")); > } > > PMAP_LOCK_ASSERT(pmap, MA_OWNED); > @@ -1616,8 +1594,6 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t > __syncicache((void *)va, PAGE_SIZE); > pte_remove(mmu, pmap, va, PTBL_UNHOLD); > } > - > - //debugf("mmu_booke_enter_locked: e\n"); > } > > /* > @@ -1643,8 +1619,8 @@ mmu_booke_enter_object(mmu_t mmu, pmap_t > m = m_start; > PMAP_LOCK(pmap); > while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { > - mmu_booke_enter_locked(mmu, pmap, start + ptoa(diff), m, prot & > - (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); > + mmu_booke_enter_locked(mmu, pmap, start + ptoa(diff), m, > + prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); > m = TAILQ_NEXT(m, listq); > } > PMAP_UNLOCK(pmap); > @@ -1655,14 +1631,10 @@ mmu_booke_enter_quick(mmu_t mmu, pmap_t > vm_prot_t prot) > { > > - //debugf("mmu_booke_enter_quick: s\n"); > - > PMAP_LOCK(pmap); > mmu_booke_enter_locked(mmu, pmap, va, m, > prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); > PMAP_UNLOCK(pmap); > - > - //debugf("mmu_booke_enter_quick e\n"); > } > > /* > @@ -1674,7 +1646,7 @@ static void > mmu_booke_remove(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_offset_t endva) > { > pte_t *pte; > - u_int8_t hold_flag; > + uint8_t hold_flag; > > int su = (pmap == kernel_pmap); > > @@ -1682,11 +1654,12 @@ mmu_booke_remove(mmu_t mmu, pmap_t pmap, > // su, (u_int32_t)pmap, pmap->pm_tid, va, endva); > > if (su) { > - KASSERT(((va >= virtual_avail) && (va <= VM_MAX_KERNEL_ADDRESS)), > - ("mmu_booke_enter: kernel pmap, non kernel va")); > + KASSERT(((va >= virtual_avail) && > + (va <= VM_MAX_KERNEL_ADDRESS)), > + ("mmu_booke_remove: kernel pmap, non kernel va")); > } else { > KASSERT((va <= VM_MAXUSER_ADDRESS), > - ("mmu_booke_enter: user pmap, non user va")); > + ("mmu_booke_remove: user pmap, non user va")); > } > > if (PMAP_REMOVE_DONE(pmap)) { > @@ -1717,9 +1690,7 @@ static void > mmu_booke_remove_all(mmu_t mmu, vm_page_t m) > { > pv_entry_t pv, pvn; > - u_int8_t hold_flag; > - > - //debugf("mmu_booke_remove_all: s\n"); > + uint8_t hold_flag; > > mtx_assert(&vm_page_queue_mtx, MA_OWNED); > > @@ -1732,18 +1703,10 @@ mmu_booke_remove_all(mmu_t mmu, vm_page_ > PMAP_UNLOCK(pv->pv_pmap); > } > vm_page_flag_clear(m, PG_WRITEABLE); > - > - //debugf("mmu_booke_remove_all: e\n"); > } > > /* > * Map a range of physical addresses into kernel virtual address space. > - * > - * The value passed in *virt is a suggested virtual address for the mapping. > - * Architectures which can support a direct-mapped physical to virtual region > - * can return the appropriate address within that region, leaving '*virt' > - * unchanged. We cannot and therefore do not; *virt is updated with the > - * first usable address after the mapped region. > */ > static vm_offset_t > mmu_booke_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, > @@ -1953,13 +1916,13 @@ mmu_booke_extract_and_hold(mmu_t mmu, pm > { > pte_t *pte; > vm_page_t m; > - u_int32_t pte_wbit; > + uint32_t pte_wbit; > > m = NULL; > vm_page_lock_queues(); > PMAP_LOCK(pmap); > - pte = pte_find(mmu, pmap, va); > > + pte = pte_find(mmu, pmap, va); > if ((pte != NULL) && PTE_ISVALID(pte)) { > if (pmap == kernel_pmap) > pte_wbit = PTE_SW; > @@ -1999,7 +1962,7 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_p > { > vm_offset_t va; > > - //debugf("mmu_booke_zero_page_area: s\n"); > + /* XXX KASSERT off and size are within a single page? */ > > mtx_lock(&zero_page_mutex); > va = zero_page_va; > @@ -2009,8 +1972,6 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_p > mmu_booke_kremove(mmu, va); > > mtx_unlock(&zero_page_mutex); > - > - //debugf("mmu_booke_zero_page_area: e\n"); > } > > /* > @@ -2020,9 +1981,7 @@ static void > mmu_booke_zero_page(mmu_t mmu, vm_page_t m) > { > > - //debugf("mmu_booke_zero_page: s\n"); > mmu_booke_zero_page_area(mmu, m, 0, PAGE_SIZE); > - //debugf("mmu_booke_zero_page: e\n"); > } > > /* > @@ -2070,14 +2029,10 @@ mmu_booke_zero_page_idle(mmu_t mmu, vm_p > { > vm_offset_t va; > > - //debugf("mmu_booke_zero_page_idle: s\n"); > - > va = zero_page_idle_va; > mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); > bzero((caddr_t)va, PAGE_SIZE); > mmu_booke_kremove(mmu, va); > - > - //debugf("mmu_booke_zero_page_idle: e\n"); > } > > /* > @@ -2112,7 +2067,7 @@ make_sure_to_unlock: > } > > /* > - * Return whether or not the specified virtual address is elgible > + * Return whether or not the specified virtual address is eligible > * for prefault. > */ > static boolean_t > @@ -2280,7 +2235,6 @@ mmu_booke_page_exists_quick(mmu_t mmu, p > > loops = 0; > TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { > - > if (pv->pv_pmap == pmap) > return (TRUE); > > @@ -2371,8 +2325,6 @@ mmu_booke_unmapdev(mmu_t mmu, vm_offset_ > { > vm_offset_t base, offset; > > - //debugf("mmu_booke_unmapdev: s (va = 0x%08x)\n", va); > - > /* > * Unmap only if this is inside kernel virtual space. > */ > @@ -2382,19 +2334,18 @@ mmu_booke_unmapdev(mmu_t mmu, vm_offset_ > size = roundup(offset + size, PAGE_SIZE); > kmem_free(kernel_map, base, size); > } > - > - //debugf("mmu_booke_unmapdev: e\n"); > } > > /* > - * mmu_booke_object_init_pt preloads the ptes for a given object > - * into the specified pmap. This eliminates the blast of soft > - * faults on process startup and immediately after an mmap. > + * mmu_booke_object_init_pt preloads the ptes for a given object into the > + * specified pmap. This eliminates the blast of soft faults on process startup > + * and immediately after an mmap. > */ > static void > mmu_booke_object_init_pt(mmu_t mmu, pmap_t pmap, vm_offset_t addr, > vm_object_t object, vm_pindex_t pindex, vm_size_t size) > { > + > VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); > KASSERT(object->type == OBJT_DEVICE, > ("mmu_booke_object_init_pt: non-device object")); > @@ -2575,7 +2526,7 @@ tlb0_print_tlbentries(void) > static void > tlb1_write_entry(unsigned int idx) > { > - u_int32_t mas0, mas7; > + uint32_t mas0, mas7; > > //debugf("tlb1_write_entry: s\n"); > > @@ -2587,15 +2538,15 @@ tlb1_write_entry(unsigned int idx) > //debugf("tlb1_write_entry: mas0 = 0x%08x\n", mas0); > > mtspr(SPR_MAS0, mas0); > - __asm volatile("isync"); > + __asm __volatile("isync"); > mtspr(SPR_MAS1, tlb1[idx].mas1); > - __asm volatile("isync"); > + __asm __volatile("isync"); > mtspr(SPR_MAS2, tlb1[idx].mas2); > - __asm volatile("isync"); > + __asm __volatile("isync"); > mtspr(SPR_MAS3, tlb1[idx].mas3); > - __asm volatile("isync"); > + __asm __volatile("isync"); > mtspr(SPR_MAS7, mas7); > - __asm volatile("isync; tlbwe; isync; msync"); > + __asm __volatile("isync; tlbwe; isync; msync"); > > //debugf("tlb1_write_entry: e\n");; > } > @@ -2700,10 +2651,10 @@ tlb1_entry_size_cmp(const void *a, const > } > > /* > - * Mapin contiguous RAM region into the TLB1 using maximum of > + * Map in contiguous RAM region into the TLB1 using maximum of > * KERNEL_REGION_MAX_TLB_ENTRIES entries. > * > - * If necessarry round up last entry size and return total size > + * If necessary round up last entry size and return total size > * used by all allocated entries. > */ > vm_size_t > @@ -2714,8 +2665,8 @@ tlb1_mapin_region(vm_offset_t va, vm_off > unsigned int log; > int i; > > - debugf("tlb1_mapin_region:\n"); > - debugf(" region size = 0x%08x va = 0x%08x pa = 0x%08x\n", size, va, pa); > + CTR4(KTR_PMAP, "%s: region size = 0x%08x va = 0x%08x pa = 0x%08x", > + __func__, size, va, pa); > > mapped_size = 0; > sz = size; > @@ -2751,16 +2702,18 @@ tlb1_mapin_region(vm_offset_t va, vm_off > esz = entry_size[i]; > if (!esz) > break; > - debugf(" entry %d: sz = 0x%08x (va = 0x%08x pa = 0x%08x)\n", > - tlb1_idx, esz, va, pa); > + > + CTR5(KTR_PMAP, "%s: entry %d: sz = 0x%08x (va = 0x%08x " > + "pa = 0x%08x)", __func__, tlb1_idx, esz, va, pa); > + > tlb1_set_entry(va, pa, esz, _TLB_ENTRY_MEM); > > va += esz; > pa += esz; > } > > - debugf(" mapped size 0x%08x (wasted space 0x%08x)\n", > - mapped_size, mapped_size - size); > + CTR3(KTR_PMAP, "%s: mapped size 0x%08x (wasted space 0x%08x)", > + __func__, mapped_size, mapped_size - size); > > return (mapped_size); > } > @@ -2774,7 +2727,7 @@ tlb1_init(vm_offset_t ccsrbar) > { > uint32_t mas0; > > - /* TBL1[1] is used to map the kernel. Save that entry. */ > + /* TLB1[1] is used to map the kernel. Save that entry. */ > mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(1); > mtspr(SPR_MAS0, mas0); > __asm __volatile("isync; tlbre"); > @@ -2804,14 +2757,14 @@ tlb1_init(vm_offset_t ccsrbar) > static void > set_mas4_defaults(void) > { > - u_int32_t mas4; > + uint32_t mas4; > > /* Defaults: TLB0, PID0, TSIZED=4K */ > mas4 = MAS4_TLBSELD0; > mas4 |= (TLB_SIZE_4K << MAS4_TSIZED_SHIFT) & MAS4_TSIZED_MASK; > > mtspr(SPR_MAS4, mas4); > - __asm volatile("isync"); > + __asm __volatile("isync"); > } > > /* > @@ -2860,7 +2813,7 @@ tlb1_print_entries(void) > static int > tlb1_iomapped(int i, vm_paddr_t pa, vm_size_t size, vm_offset_t *va) > { > - u_int32_t prot; > + uint32_t prot; > vm_paddr_t pa_start; > vm_paddr_t pa_end; > unsigned int entry_tsize; > From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 19:18:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04D441065878; Tue, 13 Jan 2009 19:18:44 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5B548FC14; Tue, 13 Jan 2009 19:18:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DJIhgK013436; Tue, 13 Jan 2009 19:18:43 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DJIhHb013435; Tue, 13 Jan 2009 19:18:43 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901131918.n0DJIhHb013435@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 19:18: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: r187188 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 19:18:45 -0000 Author: thompsa Date: Tue Jan 13 19:18:43 2009 New Revision: 187188 URL: http://svn.freebsd.org/changeset/base/187188 Log: Hook up the u3g2 driver. Submitted by: Hans Petter Selasky Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jan 13 19:17:11 2009 (r187187) +++ head/sys/conf/files Tue Jan 13 19:18:43 2009 (r187188) @@ -1609,6 +1609,7 @@ dev/usb2/wlan/usb2_wlan.c optional usb2_ # # USB2 serial and parallel port drivers # +dev/usb2/serial/u3g2.c optional usb2_core usb2_serial usb2_serial_3g dev/usb2/serial/uark2.c optional usb2_core usb2_serial usb2_serial_ark dev/usb2/serial/ubsa2.c optional usb2_core usb2_serial usb2_serial_bsa dev/usb2/serial/ubser2.c optional usb2_core usb2_serial usb2_serial_bser From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 20:51:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B468106564A; Tue, 13 Jan 2009 20:51:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5198FC12; Tue, 13 Jan 2009 20:51:19 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0DKnuVm032562; Tue, 13 Jan 2009 13:49:56 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 13 Jan 2009 13:50:20 -0700 (MST) Message-Id: <20090113.135020.-1625820918.imp@bsdimp.com> To: thompsa@freebsd.org From: "M. Warner Losh" In-Reply-To: <200901131907.n0DJ7NZM013070@svn.freebsd.org> References: <200901131907.n0DJ7NZM013070@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) 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 Subject: Re: svn commit: r187185 - head/sys/dev/usb2/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 20:51:20 -0000 In message: <200901131907.n0DJ7NZM013070@svn.freebsd.org> Andrew Thompson writes: : Author: thompsa : Date: Tue Jan 13 19:07:23 2009 : New Revision: 187185 : URL: http://svn.freebsd.org/changeset/base/187185 : : Log: : Regen. : : Modified: : head/sys/dev/usb2/include/usb2_devid.h : head/sys/dev/usb2/include/usb2_devtable.h We need to start generating this at run-time. Warner From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 20:51:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B49D106566B; Tue, 13 Jan 2009 20:51:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id ABD9A8FC08; Tue, 13 Jan 2009 20:51:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0DKnRti032559; Tue, 13 Jan 2009 13:49:27 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 13 Jan 2009 13:49:51 -0700 (MST) Message-Id: <20090113.134951.-1540452302.imp@bsdimp.com> To: thompsa@freebsd.org From: "M. Warner Losh" In-Reply-To: <200901131905.n0DJ5pHh012960@svn.freebsd.org> References: <200901131905.n0DJ5pHh012960@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) 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 Subject: Re: svn commit: r187183 - in head/sys/dev/usb2: controller core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 20:51:21 -0000 In message: <200901131905.n0DJ5pHh012960@svn.freebsd.org> Andrew Thompson writes: : Author: thompsa : Date: Tue Jan 13 19:05:51 2009 : New Revision: 187183 : URL: http://svn.freebsd.org/changeset/base/187183 : : Log: : MFp4: //depot/projects/usb@156055 : : Compile fix for AVR-GCC : : Submitted by: Hans Petter Selasky : : Modified: : head/sys/dev/usb2/controller/at91dci.c : head/sys/dev/usb2/controller/uss820dci.c : head/sys/dev/usb2/core/usb2_mbuf.h : : Modified: head/sys/dev/usb2/controller/at91dci.c : ============================================================================== : --- head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:05:20 2009 (r187182) : +++ head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:05:51 2009 (r187183) : @@ -1776,7 +1776,7 @@ static const struct usb2_hub_descriptor_ : .wHubCharacteristics[0] = : (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, : .wHubCharacteristics[1] = : - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, : + (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, : .bPwrOn2PwrGood = 50, : .bHubContrCurrent = 0, : .DeviceRemovable = {0}, /* port is removable */ : : Modified: head/sys/dev/usb2/controller/uss820dci.c : ============================================================================== : --- head/sys/dev/usb2/controller/uss820dci.c Tue Jan 13 19:05:20 2009 (r187182) : +++ head/sys/dev/usb2/controller/uss820dci.c Tue Jan 13 19:05:51 2009 (r187183) : @@ -1794,7 +1794,7 @@ static const struct usb2_hub_descriptor_ : .wHubCharacteristics[0] = : (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, : .wHubCharacteristics[1] = : - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, : + (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, : .bPwrOn2PwrGood = 50, : .bHubContrCurrent = 0, : .DeviceRemovable = {0}, /* port is removable */ These changes look to be unrelated to the description above... : Modified: head/sys/dev/usb2/core/usb2_mbuf.h : ============================================================================== : --- head/sys/dev/usb2/core/usb2_mbuf.h Tue Jan 13 19:05:20 2009 (r187182) : +++ head/sys/dev/usb2/core/usb2_mbuf.h Tue Jan 13 19:05:51 2009 (r187183) : @@ -38,8 +38,9 @@ struct usb2_mbuf { : struct usb2_mbuf *usb2_next; : : uint32_t cur_data_len; : - uint32_t max_data_len:31; : - uint32_t last_packet:1; : + uint32_t max_data_len; : + uint8_t last_packet:1; : + uint8_t unused:7; This looks like the avr gcc tweak... Warner From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:12:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98FA41065674; Tue, 13 Jan 2009 21:12:42 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 31EC48FC17; Tue, 13 Jan 2009 21:12:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 5887CFEF3; Wed, 14 Jan 2009 10:12:41 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x1xkB0oI59Fc; Wed, 14 Jan 2009 10:12:37 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Wed, 14 Jan 2009 10:12:37 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 0E08111432; Wed, 14 Jan 2009 10:12:37 +1300 (NZDT) Date: Tue, 13 Jan 2009 13:12:36 -0800 From: Andrew Thompson To: "M. Warner Losh" Message-ID: <20090113211236.GA24988@citylink.fud.org.nz> References: <200901131905.n0DJ5pHh012960@svn.freebsd.org> <20090113.134951.-1540452302.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090113.134951.-1540452302.imp@bsdimp.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187183 - in head/sys/dev/usb2: controller core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:12:43 -0000 On Tue, Jan 13, 2009 at 01:49:51PM -0700, M. Warner Losh wrote: > In message: <200901131905.n0DJ5pHh012960@svn.freebsd.org> > Andrew Thompson writes: > : Author: thompsa > : Date: Tue Jan 13 19:05:51 2009 > : New Revision: 187183 > : URL: http://svn.freebsd.org/changeset/base/187183 > : > : Log: > : MFp4: //depot/projects/usb@156055 > : > : Compile fix for AVR-GCC > : > : Submitted by: Hans Petter Selasky > : > : Modified: > : head/sys/dev/usb2/controller/at91dci.c > : head/sys/dev/usb2/controller/uss820dci.c > : head/sys/dev/usb2/core/usb2_mbuf.h > : > : Modified: head/sys/dev/usb2/controller/at91dci.c > : ============================================================================== > : --- head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:05:20 2009 (r187182) > : +++ head/sys/dev/usb2/controller/at91dci.c Tue Jan 13 19:05:51 2009 (r187183) > : @@ -1776,7 +1776,7 @@ static const struct usb2_hub_descriptor_ > : .wHubCharacteristics[0] = > : (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, > : .wHubCharacteristics[1] = > : - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, > : + (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, > : .bPwrOn2PwrGood = 50, > : .bHubContrCurrent = 0, > : .DeviceRemovable = {0}, /* port is removable */ > : > : Modified: head/sys/dev/usb2/controller/uss820dci.c > : ============================================================================== > : --- head/sys/dev/usb2/controller/uss820dci.c Tue Jan 13 19:05:20 2009 (r187182) > : +++ head/sys/dev/usb2/controller/uss820dci.c Tue Jan 13 19:05:51 2009 (r187183) > : @@ -1794,7 +1794,7 @@ static const struct usb2_hub_descriptor_ > : .wHubCharacteristics[0] = > : (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF, > : .wHubCharacteristics[1] = > : - (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16, > : + (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8, > : .bPwrOn2PwrGood = 50, > : .bHubContrCurrent = 0, > : .DeviceRemovable = {0}, /* port is removable */ > > These changes look to be unrelated to the description above... Correct. > : Modified: head/sys/dev/usb2/core/usb2_mbuf.h > : ============================================================================== > : --- head/sys/dev/usb2/core/usb2_mbuf.h Tue Jan 13 19:05:20 2009 (r187182) > : +++ head/sys/dev/usb2/core/usb2_mbuf.h Tue Jan 13 19:05:51 2009 (r187183) > : @@ -38,8 +38,9 @@ struct usb2_mbuf { > : struct usb2_mbuf *usb2_next; > : > : uint32_t cur_data_len; > : - uint32_t max_data_len:31; > : - uint32_t last_packet:1; > : + uint32_t max_data_len; > : + uint8_t last_packet:1; > : + uint8_t unused:7; > > This looks like the avr gcc tweak... This is how the change was in p4, I havnt modified anything. I forgot to fix it when syncing everything up. http://p4web.freebsd.org/@md=d&cd=//&c=Rct@/156055?ac=10 Andrew From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:13:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6C561065687; Tue, 13 Jan 2009 21:13:35 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3B7D8FC2D; Tue, 13 Jan 2009 21:13:35 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLDZwl016180; Tue, 13 Jan 2009 21:13:35 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLDZad016179; Tue, 13 Jan 2009 21:13:35 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200901132113.n0DLDZad016179@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 13 Jan 2009 21:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187191 - in stable/7/sys: . conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:13:37 -0000 Author: gnn Date: Tue Jan 13 21:13:35 2009 New Revision: 187191 URL: http://svn.freebsd.org/changeset/base/187191 Log: MFC of code to fix debug builds with CTF/DTrace Fix CTF based builds to that if the debug build is being used we get debug symbols. Modified: stable/7/sys/ (props changed) stable/7/sys/conf/kern.pre.mk Modified: stable/7/sys/conf/kern.pre.mk ============================================================================== --- stable/7/sys/conf/kern.pre.mk Tue Jan 13 21:08:43 2009 (r187190) +++ stable/7/sys/conf/kern.pre.mk Tue Jan 13 21:13:35 2009 (r187191) @@ -26,6 +26,7 @@ COPTFLAGS?= -O .else . if defined(DEBUG) _MINUS_O= -O +CTFFLAGS+= -g . else _MINUS_O= -O2 . endif From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:18:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F5C51065679; Tue, 13 Jan 2009 21:18:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79E408FC22; Tue, 13 Jan 2009 21:18:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLIFRj016337; Tue, 13 Jan 2009 21:18:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLIF4F016326; Tue, 13 Jan 2009 21:18:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901132118.n0DLIF4F016326@svn.freebsd.org> From: Andrew Thompson Date: Tue, 13 Jan 2009 21:18: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: r187192 - in head/sys: . arm/arm contrib/pf dev/usb dev/usb2/ethernet dev/usb2/wlan mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:18:16 -0000 Author: thompsa Date: Tue Jan 13 21:18:14 2009 New Revision: 187192 URL: http://svn.freebsd.org/changeset/base/187192 Log: Restore the if_*var.h and if_*reg.h to their original names, they dont need to be different. Added: head/sys/dev/usb2/ethernet/if_auereg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_auereg.h head/sys/dev/usb2/ethernet/if_axereg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_axereg.h head/sys/dev/usb2/ethernet/if_cdcereg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_cdcereg.h head/sys/dev/usb2/ethernet/if_cuereg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_cuereg.h head/sys/dev/usb2/ethernet/if_kuefw.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_kuefw.h head/sys/dev/usb2/ethernet/if_kuereg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_kuereg.h head/sys/dev/usb2/ethernet/if_ruereg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_ruereg.h head/sys/dev/usb2/ethernet/if_udavreg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_udavreg.h head/sys/dev/usb2/wlan/if_rumfw.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/wlan/if_rumfw.h head/sys/dev/usb2/wlan/if_rumreg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/wlan/if_rumreg.h head/sys/dev/usb2/wlan/if_rumvar.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/wlan/if_rumvar.h head/sys/dev/usb2/wlan/if_uralreg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/wlan/if_uralreg.h head/sys/dev/usb2/wlan/if_uralvar.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/wlan/if_uralvar.h head/sys/dev/usb2/wlan/if_zydfw.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/wlan/if_zydfw.h head/sys/dev/usb2/wlan/if_zydreg.h - copied unchanged from r187190, user/thompsa/usb/sys/dev/usb2/wlan/if_zydreg.h Deleted: head/sys/dev/usb2/ethernet/if_aue2_reg.h head/sys/dev/usb2/ethernet/if_axe2_reg.h head/sys/dev/usb2/ethernet/if_cdce2_reg.h head/sys/dev/usb2/ethernet/if_cue2_reg.h head/sys/dev/usb2/ethernet/if_kue2_fw.h head/sys/dev/usb2/ethernet/if_kue2_reg.h head/sys/dev/usb2/ethernet/if_rue2_reg.h head/sys/dev/usb2/ethernet/if_udav2_reg.h head/sys/dev/usb2/wlan/if_rum2_fw.h head/sys/dev/usb2/wlan/if_rum2_reg.h head/sys/dev/usb2/wlan/if_rum2_var.h head/sys/dev/usb2/wlan/if_ural2_reg.h head/sys/dev/usb2/wlan/if_ural2_var.h head/sys/dev/usb2/wlan/if_zyd2_fw.h head/sys/dev/usb2/wlan/if_zyd2_reg.h Modified: head/sys/ (props changed) head/sys/arm/arm/cpufunc_asm_sheeva.S (props changed) head/sys/contrib/pf/ (props changed) head/sys/dev/usb/ehci_ixp4xx.c (props changed) head/sys/dev/usb2/ethernet/if_aue2.c head/sys/dev/usb2/ethernet/if_axe2.c head/sys/dev/usb2/ethernet/if_cdce2.c head/sys/dev/usb2/ethernet/if_cue2.c head/sys/dev/usb2/ethernet/if_kue2.c head/sys/dev/usb2/ethernet/if_rue2.c head/sys/dev/usb2/ethernet/if_udav2.c head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_zyd2.c head/sys/mips/mips/elf64_machdep.c (props changed) Modified: head/sys/dev/usb2/ethernet/if_aue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_aue2.c Tue Jan 13 21:13:35 2009 (r187191) +++ head/sys/dev/usb2/ethernet/if_aue2.c Tue Jan 13 21:18:14 2009 (r187192) @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include MODULE_DEPEND(aue, usb2_ethernet, 1, 1, 1); MODULE_DEPEND(aue, usb2_core, 1, 1, 1); Copied: head/sys/dev/usb2/ethernet/if_auereg.h (from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_auereg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb2/ethernet/if_auereg.h Tue Jan 13 21:18:14 2009 (r187192, copy of r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_auereg.h) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 1997, 1998, 1999 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD + * 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. + * + * $FreeBSD$ + */ + +/* + * Register definitions for ADMtek Pegasus AN986 USB to Ethernet + * chip. The Pegasus uses a total of four USB endpoints: the control + * endpoint (0), a bulk read endpoint for receiving packets (1), + * a bulk write endpoint for sending packets (2) and an interrupt + * endpoint for passing RX and TX status (3). Endpoint 0 is used + * to read and write the ethernet module's registers. All registers + * are 8 bits wide. + * + * Packet transfer is done in 64 byte chunks. The last chunk in a + * transfer is denoted by having a length less that 64 bytes. For + * the RX case, the data includes an optional RX status word. + */ + +#define AUE_UR_READREG 0xF0 +#define AUE_UR_WRITEREG 0xF1 + +#define AUE_CONFIG_INDEX 0 /* config number 1 */ +#define AUE_IFACE_IDX 0 + +/* + * Note that while the ADMtek technically has four endpoints, the control + * endpoint (endpoint 0) is regarded as special by the USB code and drivers + * don't have direct access to it (we access it using usb2_do_request() + * when reading/writing registers. Consequently, our endpoint indexes + * don't match those in the ADMtek Pegasus manual: we consider the RX data + * endpoint to be index 0 and work up from there. + */ +#define AUE_ENDPT_MAX 6 + +#define AUE_INTR_PKTLEN 0x8 + +#define AUE_CTL0 0x00 +#define AUE_CTL1 0x01 +#define AUE_CTL2 0x02 +#define AUE_MAR0 0x08 +#define AUE_MAR1 0x09 +#define AUE_MAR2 0x0A +#define AUE_MAR3 0x0B +#define AUE_MAR4 0x0C +#define AUE_MAR5 0x0D +#define AUE_MAR6 0x0E +#define AUE_MAR7 0x0F +#define AUE_MAR AUE_MAR0 +#define AUE_PAR0 0x10 +#define AUE_PAR1 0x11 +#define AUE_PAR2 0x12 +#define AUE_PAR3 0x13 +#define AUE_PAR4 0x14 +#define AUE_PAR5 0x15 +#define AUE_PAR AUE_PAR0 +#define AUE_PAUSE0 0x18 +#define AUE_PAUSE1 0x19 +#define AUE_PAUSE AUE_PAUSE0 +#define AUE_RX_FLOWCTL_CNT 0x1A +#define AUE_RX_FLOWCTL_FIFO 0x1B +#define AUE_REG_1D 0x1D +#define AUE_EE_REG 0x20 +#define AUE_EE_DATA0 0x21 +#define AUE_EE_DATA1 0x22 +#define AUE_EE_DATA AUE_EE_DATA0 +#define AUE_EE_CTL 0x23 +#define AUE_PHY_ADDR 0x25 +#define AUE_PHY_DATA0 0x26 +#define AUE_PHY_DATA1 0x27 +#define AUE_PHY_DATA AUE_PHY_DATA0 +#define AUE_PHY_CTL 0x28 +#define AUE_USB_STS 0x2A +#define AUE_TXSTAT0 0x2B +#define AUE_TXSTAT1 0x2C +#define AUE_TXSTAT AUE_TXSTAT0 +#define AUE_RXSTAT 0x2D +#define AUE_PKTLOST0 0x2E +#define AUE_PKTLOST1 0x2F +#define AUE_PKTLOST AUE_PKTLOST0 + +#define AUE_REG_7B 0x7B +#define AUE_GPIO0 0x7E +#define AUE_GPIO1 0x7F +#define AUE_REG_81 0x81 + +#define AUE_CTL0_INCLUDE_RXCRC 0x01 +#define AUE_CTL0_ALLMULTI 0x02 +#define AUE_CTL0_STOP_BACKOFF 0x04 +#define AUE_CTL0_RXSTAT_APPEND 0x08 +#define AUE_CTL0_WAKEON_ENB 0x10 +#define AUE_CTL0_RXPAUSE_ENB 0x20 +#define AUE_CTL0_RX_ENB 0x40 +#define AUE_CTL0_TX_ENB 0x80 + +#define AUE_CTL1_HOMELAN 0x04 +#define AUE_CTL1_RESETMAC 0x08 +#define AUE_CTL1_SPEEDSEL 0x10 /* 0 = 10mbps, 1 = 100mbps */ +#define AUE_CTL1_DUPLEX 0x20 /* 0 = half, 1 = full */ +#define AUE_CTL1_DELAYHOME 0x40 + +#define AUE_CTL2_EP3_CLR 0x01 /* reading EP3 clrs status regs */ +#define AUE_CTL2_RX_BADFRAMES 0x02 +#define AUE_CTL2_RX_PROMISC 0x04 +#define AUE_CTL2_LOOPBACK 0x08 +#define AUE_CTL2_EEPROMWR_ENB 0x10 +#define AUE_CTL2_EEPROM_LOAD 0x20 + +#define AUE_EECTL_WRITE 0x01 +#define AUE_EECTL_READ 0x02 +#define AUE_EECTL_DONE 0x04 + +#define AUE_PHYCTL_PHYREG 0x1F +#define AUE_PHYCTL_WRITE 0x20 +#define AUE_PHYCTL_READ 0x40 +#define AUE_PHYCTL_DONE 0x80 + +#define AUE_USBSTS_SUSPEND 0x01 +#define AUE_USBSTS_RESUME 0x02 + +#define AUE_TXSTAT0_JABTIMO 0x04 +#define AUE_TXSTAT0_CARLOSS 0x08 +#define AUE_TXSTAT0_NOCARRIER 0x10 +#define AUE_TXSTAT0_LATECOLL 0x20 +#define AUE_TXSTAT0_EXCESSCOLL 0x40 +#define AUE_TXSTAT0_UNDERRUN 0x80 + +#define AUE_TXSTAT1_PKTCNT 0x0F +#define AUE_TXSTAT1_FIFO_EMPTY 0x40 +#define AUE_TXSTAT1_FIFO_FULL 0x80 + +#define AUE_RXSTAT_OVERRUN 0x01 +#define AUE_RXSTAT_PAUSE 0x02 + +#define AUE_GPIO_IN0 0x01 +#define AUE_GPIO_OUT0 0x02 +#define AUE_GPIO_SEL0 0x04 +#define AUE_GPIO_IN1 0x08 +#define AUE_GPIO_OUT1 0x10 +#define AUE_GPIO_SEL1 0x20 + +#define AUE_TIMEOUT 100 /* 10*ms */ +#define AUE_MIN_FRAMELEN 60 + +#define AUE_RXSTAT_MCAST 0x01 +#define AUE_RXSTAT_GIANT 0x02 +#define AUE_RXSTAT_RUNT 0x04 +#define AUE_RXSTAT_CRCERR 0x08 +#define AUE_RXSTAT_DRIBBLE 0x10 +#define AUE_RXSTAT_MASK 0x1E + +#define GET_MII(sc) ((sc)->sc_miibus ? \ + device_get_softc((sc)->sc_miibus) : NULL) + +struct aue_intrpkt { + uint8_t aue_txstat0; + uint8_t aue_txstat1; + uint8_t aue_rxstat; + uint8_t aue_rxlostpkt0; + uint8_t aue_rxlostpkt1; + uint8_t aue_wakeupstat; + uint8_t aue_rsvd; +} __packed; + +struct aue_rxpkt { + uint16_t aue_pktlen; + uint8_t aue_rxstat; +} __packed; + + +struct aue_softc { + void *sc_evilhack; /* XXX this pointer must be first */ + + struct usb2_config_td sc_config_td; + struct usb2_callout sc_watchdog; + struct mtx sc_mtx; + struct aue_rxpkt sc_rxpkt; + + struct ifnet *sc_ifp; + struct usb2_device *sc_udev; + struct usb2_xfer *sc_xfer[AUE_ENDPT_MAX]; + device_t sc_miibus; + device_t sc_dev; + + uint32_t sc_unit; + uint32_t sc_media_active; + uint32_t sc_media_status; + + uint16_t sc_flags; +#define AUE_FLAG_LSYS 0x0001 /* use Linksys reset */ +#define AUE_FLAG_PNA 0x0002 /* has Home PNA */ +#define AUE_FLAG_PII 0x0004 /* Pegasus II chip */ +#define AUE_FLAG_WAIT_LINK 0x0008 /* wait for link to come up */ +#define AUE_FLAG_READ_STALL 0x0010 /* wait for clearing of stall */ +#define AUE_FLAG_WRITE_STALL 0x0020 /* wait for clearing of stall */ +#define AUE_FLAG_LL_READY 0x0040 /* Lower Layer Ready */ +#define AUE_FLAG_HL_READY 0x0080 /* Higher Layer Ready */ +#define AUE_FLAG_INTR_STALL 0x0100 /* wait for clearing of stall */ +#define AUE_FLAG_VER_2 0x0200 /* chip is version 2 */ +#define AUE_FLAG_DUAL_PHY 0x0400 /* chip has two transcivers */ + + uint8_t sc_name[16]; +}; Modified: head/sys/dev/usb2/ethernet/if_axe2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_axe2.c Tue Jan 13 21:13:35 2009 (r187191) +++ head/sys/dev/usb2/ethernet/if_axe2.c Tue Jan 13 21:18:14 2009 (r187192) @@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include MODULE_DEPEND(axe, usb2_ethernet, 1, 1, 1); MODULE_DEPEND(axe, usb2_core, 1, 1, 1); Copied: head/sys/dev/usb2/ethernet/if_axereg.h (from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_axereg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb2/ethernet/if_axereg.h Tue Jan 13 21:18:14 2009 (r187192, copy of r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_axereg.h) @@ -0,0 +1,208 @@ +/*- + * Copyright (c) 1997, 1998, 1999, 2000-2003 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD + * 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. + * + * $FreeBSD$ + */ + +/* + * Definitions for the ASIX Electronics AX88172, AX88178 + * and AX88772 to ethernet controllers. + */ + +/* + * Vendor specific commands. ASIX conveniently doesn't document the 'set + * NODEID' command in their datasheet (thanks a lot guys). + * To make handling these commands easier, I added some extra data which is + * decided by the axe_cmd() routine. Commands are encoded in 16 bits, with + * the format: LDCC. L and D are both nibbles in the high byte. L represents + * the data length (0 to 15) and D represents the direction (0 for vendor read, + * 1 for vendor write). CC is the command byte, as specified in the manual. + */ + +#define AXE_CMD_IS_WRITE(x) (((x) & 0x0F00) >> 8) +#define AXE_CMD_LEN(x) (((x) & 0xF000) >> 12) +#define AXE_CMD_CMD(x) ((x) & 0x00FF) + +#define AXE_172_CMD_READ_RXTX_SRAM 0x2002 +#define AXE_182_CMD_READ_RXTX_SRAM 0x8002 +#define AXE_172_CMD_WRITE_RX_SRAM 0x0103 +#define AXE_182_CMD_WRITE_RXTX_SRAM 0x8103 +#define AXE_172_CMD_WRITE_TX_SRAM 0x0104 +#define AXE_CMD_MII_OPMODE_SW 0x0106 +#define AXE_CMD_MII_READ_REG 0x2007 +#define AXE_CMD_MII_WRITE_REG 0x2108 +#define AXE_CMD_MII_READ_OPMODE 0x1009 +#define AXE_CMD_MII_OPMODE_HW 0x010A +#define AXE_CMD_SROM_READ 0x200B +#define AXE_CMD_SROM_WRITE 0x010C +#define AXE_CMD_SROM_WR_ENABLE 0x010D +#define AXE_CMD_SROM_WR_DISABLE 0x010E +#define AXE_CMD_RXCTL_READ 0x200F +#define AXE_CMD_RXCTL_WRITE 0x0110 +#define AXE_CMD_READ_IPG012 0x3011 +#define AXE_172_CMD_WRITE_IPG0 0x0112 +#define AXE_178_CMD_WRITE_IPG012 0x0112 +#define AXE_172_CMD_WRITE_IPG1 0x0113 +#define AXE_178_CMD_READ_NODEID 0x6013 +#define AXE_172_CMD_WRITE_IPG2 0x0114 +#define AXE_178_CMD_WRITE_NODEID 0x6114 +#define AXE_CMD_READ_MCAST 0x8015 +#define AXE_CMD_WRITE_MCAST 0x8116 +#define AXE_172_CMD_READ_NODEID 0x6017 +#define AXE_172_CMD_WRITE_NODEID 0x6118 + +#define AXE_CMD_READ_PHYID 0x2019 +#define AXE_172_CMD_READ_MEDIA 0x101A +#define AXE_178_CMD_READ_MEDIA 0x201A +#define AXE_CMD_WRITE_MEDIA 0x011B +#define AXE_CMD_READ_MONITOR_MODE 0x101C +#define AXE_CMD_WRITE_MONITOR_MODE 0x011D +#define AXE_CMD_READ_GPIO 0x101E +#define AXE_CMD_WRITE_GPIO 0x011F + +#define AXE_CMD_SW_RESET_REG 0x0120 +#define AXE_CMD_SW_PHY_STATUS 0x0021 +#define AXE_CMD_SW_PHY_SELECT 0x0122 + +#define AXE_SW_RESET_CLEAR 0x00 +#define AXE_SW_RESET_RR 0x01 +#define AXE_SW_RESET_RT 0x02 +#define AXE_SW_RESET_PRTE 0x04 +#define AXE_SW_RESET_PRL 0x08 +#define AXE_SW_RESET_BZ 0x10 +#define AXE_SW_RESET_IPRL 0x20 +#define AXE_SW_RESET_IPPD 0x40 + +/* AX88178 documentation says to always write this bit... */ +#define AXE_178_RESET_MAGIC 0x40 + +#define AXE_178_MEDIA_GMII 0x0001 +#define AXE_MEDIA_FULL_DUPLEX 0x0002 +#define AXE_172_MEDIA_TX_ABORT_ALLOW 0x0004 + +/* AX88178/88772 documentation says to always write 1 to bit 2 */ +#define AXE_178_MEDIA_MAGIC 0x0004 +/* AX88772 documentation says to always write 0 to bit 3 */ +#define AXE_178_MEDIA_ENCK 0x0008 +#define AXE_172_MEDIA_FLOW_CONTROL_EN 0x0010 +#define AXE_178_MEDIA_RXFLOW_CONTROL_EN 0x0010 +#define AXE_178_MEDIA_TXFLOW_CONTROL_EN 0x0020 +#define AXE_178_MEDIA_JUMBO_EN 0x0040 +#define AXE_178_MEDIA_LTPF_ONLY 0x0080 +#define AXE_178_MEDIA_RX_EN 0x0100 +#define AXE_178_MEDIA_100TX 0x0200 +#define AXE_178_MEDIA_SBP 0x0800 +#define AXE_178_MEDIA_SUPERMAC 0x1000 + +#define AXE_RXCMD_PROMISC 0x0001 +#define AXE_RXCMD_ALLMULTI 0x0002 +#define AXE_172_RXCMD_UNICAST 0x0004 +#define AXE_178_RXCMD_KEEP_INVALID_CRC 0x0004 +#define AXE_RXCMD_BROADCAST 0x0008 +#define AXE_RXCMD_MULTICAST 0x0010 +#define AXE_RXCMD_ENABLE 0x0080 +#define AXE_178_RXCMD_MFB_MASK 0x0300 +#define AXE_178_RXCMD_MFB_2048 0x0000 +#define AXE_178_RXCMD_MFB_4096 0x0100 +#define AXE_178_RXCMD_MFB_8192 0x0200 +#define AXE_178_RXCMD_MFB_16384 0x0300 + +#define AXE_PHY_SEL_PRI 1 +#define AXE_PHY_SEL_SEC 0 +#define AXE_PHY_TYPE_MASK 0xE0 +#define AXE_PHY_TYPE_SHIFT 5 +#define AXE_PHY_TYPE(x) \ + (((x) & AXE_PHY_TYPE_MASK) >> AXE_PHY_TYPE_SHIFT) + +#define PHY_TYPE_100_HOME 0 /* 10/100 or 1M HOME PHY */ +#define PHY_TYPE_GIG 1 /* Gigabit PHY */ +#define PHY_TYPE_SPECIAL 4 /* Special case */ +#define PHY_TYPE_RSVD 5 /* Reserved */ +#define PHY_TYPE_NON_SUP 7 /* Non-supported PHY */ + +#define AXE_PHY_NO_MASK 0x1F +#define AXE_PHY_NO(x) ((x) & AXE_PHY_NO_MASK) + +#define AXE_772_PHY_NO_EPHY 0x10 /* Embedded 10/100 PHY of AX88772 */ + +#define AXE_BULK_BUF_SIZE 16384 /* bytes */ + +#define AXE_CTL_READ 0x01 +#define AXE_CTL_WRITE 0x02 + +#define AXE_CONFIG_IDX 0 /* config number 1 */ +#define AXE_IFACE_IDX 0 + +/* The interrupt endpoint is currently unused by the ASIX part. */ +#define AXE_ENDPT_MAX 6 + +struct axe_sframe_hdr { + uint16_t len; + uint16_t ilen; +} __packed; + +#define GET_MII(sc) ((sc)->sc_miibus ? \ + device_get_softc((sc)->sc_miibus) : NULL) + +struct axe_softc { + void *sc_evilhack; /* XXX this pointer must be first */ + + struct usb2_config_td sc_config_td; + struct usb2_callout sc_watchdog; + struct mtx sc_mtx; + + struct ifnet *sc_ifp; + struct usb2_device *sc_udev; + struct usb2_xfer *sc_xfer[AXE_ENDPT_MAX]; + device_t sc_miibus; + device_t sc_dev; + + int sc_phyno; + + uint32_t sc_unit; + uint32_t sc_media_active; + uint32_t sc_media_status; + + uint16_t sc_flags; +#define AXE_FLAG_LINK 0x0001 +#define AXE_FLAG_INTR_STALL 0x0002 +#define AXE_FLAG_READ_STALL 0x0004 +#define AXE_FLAG_WRITE_STALL 0x0008 +#define AXE_FLAG_LL_READY 0x0010 +#define AXE_FLAG_HL_READY 0x0020 +#define AXE_FLAG_772 0x0040 /* AX88772 */ +#define AXE_FLAG_178 0x0080 /* AX88178 */ + + uint8_t sc_ipgs[3]; + uint8_t sc_phyaddrs[2]; + + uint8_t sc_name[16]; +}; Modified: head/sys/dev/usb2/ethernet/if_cdce2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cdce2.c Tue Jan 13 21:13:35 2009 (r187191) +++ head/sys/dev/usb2/ethernet/if_cdce2.c Tue Jan 13 21:18:14 2009 (r187192) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include static device_probe_t cdce_probe; static device_attach_t cdce_attach; Copied: head/sys/dev/usb2/ethernet/if_cdcereg.h (from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_cdcereg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb2/ethernet/if_cdcereg.h Tue Jan 13 21:18:14 2009 (r187192, copy of r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_cdcereg.h) @@ -0,0 +1,87 @@ +/*- + * Copyright (c) 2003-2005 Craig Boston + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul, THE VOICES IN HIS HEAD OR + * THE 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. + * + * $FreeBSD$ + */ + +#ifndef _USB_IF_CDCEREG_H_ +#define _USB_IF_CDCEREG_H_ + +#define CDCE_N_TRANSFER 3 /* units */ +#define CDCE_IND_SIZE_MAX 32 /* bytes */ +#define CDCE_512X4_IFQ_MAXLEN MAX((2*CDCE_512X4_FRAMES_MAX), IFQ_MAXLEN) + +union cdce_eth_rx { /* multiframe header */ + struct usb2_cdc_mf_eth_512x4_header hdr; + uint8_t data[MCLBYTES]; +} __aligned(USB_HOST_ALIGN); + +union cdce_eth_tx { /* multiframe header */ + struct usb2_cdc_mf_eth_512x4_header hdr; +} __aligned(USB_HOST_ALIGN); + +struct cdce_mq { /* mini-queue */ + struct mbuf *ifq_head; + struct mbuf *ifq_tail; + uint16_t ifq_len; +}; + +struct cdce_softc { + void *sc_evilhack; /* XXX this pointer must be first */ + + union cdce_eth_tx sc_tx; + union cdce_eth_rx sc_rx; + struct ifmedia sc_ifmedia; + struct mtx sc_mtx; + struct cdce_mq sc_rx_mq; + struct cdce_mq sc_tx_mq; + + struct ifnet *sc_ifp; + struct usb2_xfer *sc_xfer[CDCE_N_TRANSFER]; + struct usb2_device *sc_udev; + device_t sc_dev; + + uint32_t sc_unit; + + uint16_t sc_flags; +#define CDCE_FLAG_ZAURUS 0x0001 +#define CDCE_FLAG_NO_UNION 0x0002 +#define CDCE_FLAG_LL_READY 0x0004 +#define CDCE_FLAG_HL_READY 0x0008 +#define CDCE_FLAG_RX_DATA 0x0010 + + uint8_t sc_name[16]; + uint8_t sc_data_iface_no; + uint8_t sc_ifaces_index[2]; + uint8_t sc_iface_protocol; +}; + +#endif /* _USB_IF_CDCEREG_H_ */ Modified: head/sys/dev/usb2/ethernet/if_cue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cue2.c Tue Jan 13 21:13:35 2009 (r187191) +++ head/sys/dev/usb2/ethernet/if_cue2.c Tue Jan 13 21:18:14 2009 (r187192) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* * Various supported device vendors/products. Copied: head/sys/dev/usb2/ethernet/if_cuereg.h (from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_cuereg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb2/ethernet/if_cuereg.h Tue Jan 13 21:18:14 2009 (r187192, copy of r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_cuereg.h) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 1997, 1998, 1999, 2000 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD + * 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. + * + * $FreeBSD$ + */ + +/* + * Definitions for the CATC Netmate II USB to ethernet controller. + */ + +/* Vendor specific control commands. */ +#define CUE_CMD_RESET 0xF4 +#define CUE_CMD_GET_MACADDR 0xF2 +#define CUE_CMD_WRITEREG 0xFA +#define CUE_CMD_READREG 0xFB +#define CUE_CMD_READSRAM 0xF1 +#define CUE_CMD_WRITESRAM 0xFC +/* Internal registers. */ +#define CUE_TX_BUFCNT 0x20 +#define CUE_RX_BUFCNT 0x21 +#define CUE_ADVANCED_OPMODES 0x22 +#define CUE_TX_BUFPKTS 0x23 +#define CUE_RX_BUFPKTS 0x24 +#define CUE_RX_MAXCHAIN 0x25 +#define CUE_ETHCTL 0x60 +#define CUE_ETHSTS 0x61 +#define CUE_PAR5 0x62 +#define CUE_PAR4 0x63 +#define CUE_PAR3 0x64 +#define CUE_PAR2 0x65 +#define CUE_PAR1 0x66 +#define CUE_PAR0 0x67 +/* Error counters, all 16 bits wide. */ +#define CUE_TX_SINGLECOLL 0x69 +#define CUE_TX_MULTICOLL 0x6B +#define CUE_TX_EXCESSCOLL 0x6D +#define CUE_RX_FRAMEERR 0x6F +#define CUE_LEDCTL 0x81 +/* Advenced operating mode register. */ +#define CUE_AOP_SRAMWAITS 0x03 +#define CUE_AOP_EMBED_RXLEN 0x08 +#define CUE_AOP_RXCOMBINE 0x10 +#define CUE_AOP_TXCOMBINE 0x20 +#define CUE_AOP_EVEN_PKT_READS 0x40 +#define CUE_AOP_LOOPBK 0x80 +/* Ethernet control register. */ +#define CUE_ETHCTL_RX_ON 0x01 +#define CUE_ETHCTL_LINK_POLARITY 0x02 +#define CUE_ETHCTL_LINK_FORCE_OK 0x04 +#define CUE_ETHCTL_MCAST_ON 0x08 +#define CUE_ETHCTL_PROMISC 0x10 +/* Ethernet status register. */ +#define CUE_ETHSTS_NO_CARRIER 0x01 +#define CUE_ETHSTS_LATECOLL 0x02 +#define CUE_ETHSTS_EXCESSCOLL 0x04 +#define CUE_ETHSTS_TXBUF_AVAIL 0x08 +#define CUE_ETHSTS_BAD_POLARITY 0x10 +#define CUE_ETHSTS_LINK_OK 0x20 +/* LED control register. */ +#define CUE_LEDCTL_BLINK_1X 0x00 +#define CUE_LEDCTL_BLINK_2X 0x01 +#define CUE_LEDCTL_BLINK_QUARTER_ON 0x02 +#define CUE_LEDCTL_BLINK_QUARTER_OFF 0x03 +#define CUE_LEDCTL_OFF 0x04 +#define CUE_LEDCTL_FOLLOW_LINK 0x08 + +/* + * Address in ASIC's internal SRAM where the multicast hash table lives. + * The table is 64 bytes long, giving us a 512-bit table. We have to set + * the bit that corresponds to the broadcast address in order to enable + * reception of broadcast frames. + */ +#define CUE_MCAST_TABLE_ADDR 0xFA80 +#define CUE_MCAST_TABLE_LEN 64 + +#define CUE_TIMEOUT 1000 +#define CUE_MIN_FRAMELEN 60 +#define CUE_RX_FRAMES 1 +#define CUE_TX_FRAMES 1 + +#define CUE_CTL_READ 0x01 +#define CUE_CTL_WRITE 0x02 + +#define CUE_CONFIG_IDX 0 /* config number 1 */ +#define CUE_IFACE_IDX 0 + +/* The interrupt endpoint is currently unused by the KLSI part. */ +#define CUE_ENDPT_MAX 4 + +struct cue_softc { + void *sc_evilhack; /* XXX this pointer must be first */ + + struct usb2_config_td sc_config_td; + struct usb2_callout sc_watchdog; + struct mtx sc_mtx; + + struct ifnet *sc_ifp; + device_t sc_dev; + struct usb2_device *sc_udev; + struct usb2_xfer *sc_xfer[CUE_ENDPT_MAX]; + + uint32_t sc_unit; + + uint16_t sc_flags; +#define CUE_FLAG_READ_STALL 0x0010 /* wait for clearing of stall */ +#define CUE_FLAG_WRITE_STALL 0x0020 /* wait for clearing of stall */ +#define CUE_FLAG_LL_READY 0x0040 /* Lower Layer Ready */ +#define CUE_FLAG_HL_READY 0x0080 /* Higher Layer Ready */ +#define CUE_FLAG_INTR_STALL 0x0100 /* wait for clearing of stall */ +}; Modified: head/sys/dev/usb2/ethernet/if_kue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_kue2.c Tue Jan 13 21:13:35 2009 (r187191) +++ head/sys/dev/usb2/ethernet/if_kue2.c Tue Jan 13 21:18:14 2009 (r187192) @@ -90,8 +90,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include /* * Various supported device vendors/products. Copied: head/sys/dev/usb2/ethernet/if_kuefw.h (from r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_kuefw.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb2/ethernet/if_kuefw.h Tue Jan 13 21:18:14 2009 (r187192, copy of r187190, user/thompsa/usb/sys/dev/usb2/ethernet/if_kuefw.h) @@ -0,0 +1,685 @@ +/*- + * Copyright (c) 1997, 1998, 1999, 2000 + * Bill Paul . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD + * 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. + * + * $FreeBSD$ + */ + +/* + * This file contains the firmware needed to make the KLSI chip work, + * along with a few constants related to the QT Engine microcontroller + * embedded in the KLSI part. + * + * Firmware is loaded using the vendor-specific 'send scan data' + * command (0xFF). The basic operation is that we must load the + * firmware, then issue some trigger commands to fix it up and start + * it running. There are three transfers: load the binary code, + * load the 'fixup' (data segment?), then issue a command to + * start the code firmware running. The data itself is prefixed by + * a 16-bit signature word, a 16-bit length value, a type byte + * and an interrupt (command) byte. The code segment is of type + * 0x02 (replacement interrupt vector data) and the fixup segment + * is of type 0x03 (replacement interrupt fixup data). The interrupt + * code is 0x64 (load new code). The length word is the total length + * of the segment minus 7. I precomputed the values and stuck them + * into the appropriate locations within the segments to save some + * work in the driver. + */ + +/* QT controller data block types. */ +/* Write data into specific memory location. */ +#define KUE_QTBTYPE_WRITE_DATA 0x00 +/* Write data into interrupt vector location */ +#define KUE_QTBTYPE_WRITE_INTVEC 0x01 +/* Replace interrupt vector with this data */ +#define KUE_QTBTYPE_REPL_INTVEC 0x02 +/* Fixup interrupt vector code with this data */ +#define KUE_QTBTYPE_FIXUP_INTVEC 0x03 +/* Force jump to location */ +#define KUE_QTBTYPE_JUMP 0x04 +/* Force call to location */ +#define KUE_QTBTYPE_CALL 0x05 +/* Force interrupt call */ +#define KUE_QTBTYPE_CALLINTR 0x06 +/* + * Cause data to be written using the specified QT engine + * interrupt, from starting location in memory for a specified + * number of bytes. + */ +#define KUE_QTBTYPE_WRITE_WITH_INTR 0x07 +/* Cause data from stream to be written using specified QT interrupt. */ +#define KUE_QTBTYPE_WRITE_STR_WITH_INTR 0x08 +/* Cause data to be written to config locations. */ +/* Addresses assume 0xc000 offset. */ +#define KUE_QTBTYPE_WRITE_CONFIG 0x09 + +#define KUE_QTINTR_LOAD_CODE 0x64 +#define KUE_QTINTR_TRIGGER_CODE 0x3B +#define KUE_QTINTR_LOAD_CODE_HIGH 0x9C + +/* Firmware code segment */ +static unsigned char kue_code_seg[] = +{ + /******************************************/ + /* NOTE: B6/C3 is data header signature */ + /* 0xAA/0xBB is data length = total */ + /* bytes - 7, 0xCC is type, 0xDD is */ + /* interrupt to use. */ + /******************************************/ + 0xB6, 0xC3, 0xf7, 0x0e, 0x02, 0x64, + 0x9f, 0xcf, 0xbc, 0x08, 0xe7, 0x57, 0x00, 0x00, + 0x9a, 0x08, 0x97, 0xc1, 0xe7, 0x67, 0xff, 0x1f, + 0x28, 0xc0, 0xe7, 0x87, 0x00, 0x04, 0x24, 0xc0, + 0xe7, 0x67, 0xff, 0xf9, 0x22, 0xc0, 0x97, 0xcf, + 0xe7, 0x09, 0xa2, 0xc0, 0x94, 0x08, 0xd7, 0x09, + 0x00, 0xc0, 0xe7, 0x59, 0xba, 0x08, 0x94, 0x08, + 0x03, 0xc1, 0xe7, 0x67, 0xff, 0xf7, 0x24, 0xc0, + 0xe7, 0x05, 0x00, 0xc0, 0xa7, 0xcf, 0x92, 0x08, + 0xe7, 0x57, 0x00, 0x00, 0x8e, 0x08, 0xa7, 0xa1, + 0x8e, 0x08, 0x97, 0xcf, 0xe7, 0x57, 0x00, 0x00, + 0xf2, 0x09, 0x0a, 0xc0, 0xe7, 0x57, 0x00, 0x00, + 0xa4, 0xc0, 0xa7, 0xc0, 0x56, 0x08, 0x9f, 0xaf, + 0x70, 0x09, 0xe7, 0x07, 0x00, 0x00, 0xf2, 0x09, + 0xe7, 0x57, 0xff, 0xff, 0x90, 0x08, 0x9f, 0xa0, + 0x40, 0x00, 0xe7, 0x59, 0x90, 0x08, 0x94, 0x08, + 0x9f, 0xa0, 0x40, 0x00, 0xc8, 0x09, 0xa2, 0x08, + 0x08, 0x62, 0x9f, 0xa1, 0x14, 0x0a, 0xe7, 0x57, + 0x00, 0x00, 0x52, 0x08, 0xa7, 0xc0, 0x56, 0x08, + 0x9f, 0xaf, 0x04, 0x00, 0xe7, 0x57, 0x00, 0x00, + 0x8e, 0x08, 0xa7, 0xc1, 0x56, 0x08, 0xc0, 0x09, + 0xa8, 0x08, 0x00, 0x60, 0x05, 0xc4, 0xc0, 0x59, + 0x94, 0x08, 0x02, 0xc0, 0x9f, 0xaf, 0xee, 0x00, + 0xe7, 0x59, 0xae, 0x08, 0x94, 0x08, 0x02, 0xc1, + 0x9f, 0xaf, 0xf6, 0x00, 0x9f, 0xaf, 0x9e, 0x03, + 0xef, 0x57, 0x00, 0x00, 0xf0, 0x09, 0x9f, 0xa1, + 0xde, 0x01, 0xe7, 0x57, 0x00, 0x00, 0x78, 0x08, + 0x9f, 0xa0, 0xe4, 0x03, 0x9f, 0xaf, 0x2c, 0x04, + 0xa7, 0xcf, 0x56, 0x08, 0x48, 0x02, 0xe7, 0x09, + 0x94, 0x08, 0xa8, 0x08, 0xc8, 0x37, 0x04, 0x00, + 0x9f, 0xaf, 0x68, 0x04, 0x97, 0xcf, 0xe7, 0x57, + 0x00, 0x00, 0xa6, 0x08, 0x97, 0xc0, 0xd7, 0x09, + 0x00, 0xc0, 0xc1, 0xdf, 0xc8, 0x09, 0x9c, 0x08, + 0x08, 0x62, 0x1d, 0xc0, 0x27, 0x04, 0x9c, 0x08, + 0x10, 0x94, 0xf0, 0x07, 0xee, 0x09, 0x02, 0x00, + 0xc1, 0x07, 0x01, 0x00, 0x70, 0x00, 0x04, 0x00, + 0xf0, 0x07, 0x44, 0x01, 0x06, 0x00, 0x50, 0xaf, + 0xe7, 0x09, 0x94, 0x08, 0xae, 0x08, 0xe7, 0x17, + 0x14, 0x00, 0xae, 0x08, 0xe7, 0x67, 0xff, 0x07, + 0xae, 0x08, 0xe7, 0x07, 0xff, 0xff, 0xa8, 0x08, + 0xe7, 0x07, 0x00, 0x00, 0xa6, 0x08, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0xd7, 0x09, 0x00, 0xc0, + 0xc1, 0xdf, 0x48, 0x02, 0xd0, 0x09, 0x9c, 0x08, + 0x27, 0x02, 0x9c, 0x08, 0xe7, 0x09, 0x20, 0xc0, + 0xee, 0x09, 0xe7, 0xd0, 0xee, 0x09, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0x48, 0x02, 0xc8, 0x37, + 0x04, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x60, + 0x21, 0xc0, 0xc0, 0x37, 0x3e, 0x00, 0x23, 0xc9, + 0xc0, 0x57, 0xb4, 0x05, 0x1b, 0xc8, 0xc0, 0x17, + 0x3f, 0x00, 0xc0, 0x67, 0xc0, 0xff, 0x30, 0x00, + 0x08, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x02, 0xc0, 0x17, 0x4c, 0x00, 0x30, 0x00, + 0x06, 0x00, 0xf0, 0x07, 0xbe, 0x01, 0x0a, 0x00, + 0x48, 0x02, 0xc1, 0x07, 0x02, 0x00, 0xd7, 0x09, + 0x00, 0xc0, 0xc1, 0xdf, 0x51, 0xaf, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0x9f, 0xaf, 0x68, 0x04, + 0x9f, 0xaf, 0xe4, 0x03, 0x97, 0xcf, 0x9f, 0xaf, + 0xe4, 0x03, 0xc9, 0x37, 0x04, 0x00, 0xc1, 0xdf, + 0xc8, 0x09, 0x70, 0x08, 0x50, 0x02, 0x67, 0x02, + 0x70, 0x08, 0xd1, 0x07, 0x00, 0x00, 0xc0, 0xdf, + 0x9f, 0xaf, 0xde, 0x01, 0x97, 0xcf, 0xe7, 0x57, + 0x00, 0x00, 0xaa, 0x08, 0x97, 0xc1, 0xe7, 0x57, + 0x01, 0x00, 0x7a, 0x08, 0x97, 0xc0, 0xc8, 0x09, + 0x6e, 0x08, 0x08, 0x62, 0x97, 0xc0, 0x00, 0x02, + 0xc0, 0x17, 0x0e, 0x00, 0x27, 0x00, 0x34, 0x01, + 0x27, 0x0c, 0x0c, 0x00, 0x36, 0x01, 0xef, 0x57, + 0x00, 0x00, 0xf0, 0x09, 0x9f, 0xc0, 0xbe, 0x02, + 0xe7, 0x57, 0x00, 0x00, 0xb0, 0x08, 0x97, 0xc1, + 0xe7, 0x07, 0x09, 0x00, 0x12, 0xc0, 0xe7, 0x77, + 0x00, 0x08, 0x20, 0xc0, 0x9f, 0xc1, 0xb6, 0x02, + 0xe7, 0x57, 0x09, 0x00, 0x12, 0xc0, 0x77, 0xc9, + 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0xe7, 0x77, + 0x00, 0x08, 0x20, 0xc0, 0x2f, 0xc1, 0xe7, 0x07, + 0x00, 0x00, 0x42, 0xc0, 0xe7, 0x07, 0x05, 0x00, + 0x90, 0xc0, 0xc8, 0x07, 0x0a, 0x00, 0xe7, 0x77, + 0x04, 0x00, 0x20, 0xc0, 0x09, 0xc1, 0x08, 0xda, + 0x7a, 0xc1, 0xe7, 0x07, 0x00, 0x01, 0x42, 0xc0, + 0xe7, 0x07, 0x04, 0x00, 0x90, 0xc0, 0x1a, 0xcf, + 0xe7, 0x07, 0x01, 0x00, 0x7a, 0x08, 0x00, 0xd8, + 0x27, 0x50, 0x34, 0x01, 0x17, 0xc1, 0xe7, 0x77, + 0x02, 0x00, 0x20, 0xc0, 0x79, 0xc1, 0x27, 0x50, + 0x34, 0x01, 0x10, 0xc1, 0xe7, 0x77, 0x02, 0x00, + 0x20, 0xc0, 0x79, 0xc0, 0x9f, 0xaf, 0xd8, 0x02, + 0xe7, 0x05, 0x00, 0xc0, 0x00, 0x60, 0x9f, 0xc0, + 0xde, 0x01, 0x97, 0xcf, 0xe7, 0x07, 0x01, 0x00, + 0xb8, 0x08, 0x06, 0xcf, 0xe7, 0x07, 0x30, 0x0e, + 0x02, 0x00, 0xe7, 0x07, 0x50, 0xc3, 0x12, 0xc0, + 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf, 0xe7, 0x07, + 0x01, 0x00, 0xb8, 0x08, 0x97, 0xcf, 0xe7, 0x07, + 0x50, 0xc3, 0x12, 0xc0, 0xe7, 0x07, 0x30, 0x0e, + 0x02, 0x00, 0xe7, 0x07, 0x01, 0x00, 0x7a, 0x08, + 0xe7, 0x07, 0x05, 0x00, 0x90, 0xc0, 0x97, 0xcf, + 0xe7, 0x07, 0x00, 0x01, 0x42, 0xc0, 0xe7, 0x07, + 0x04, 0x00, 0x90, 0xc0, 0xe7, 0x07, 0x00, 0x00, + 0x7a, 0x08, 0xe7, 0x57, 0x0f, 0x00, 0xb2, 0x08, + 0x13, 0xc1, 0x9f, 0xaf, 0x2e, 0x08, 0xca, 0x09, + 0xac, 0x08, 0xf2, 0x17, 0x01, 0x00, 0x5c, 0x00, + 0xf2, 0x27, 0x00, 0x00, 0x5e, 0x00, 0xe7, 0x07, + 0x00, 0x00, 0xb2, 0x08, 0xe7, 0x07, 0x01, 0x00, + 0xb4, 0x08, 0xc0, 0x07, 0xff, 0xff, 0x97, 0xcf, + 0x9f, 0xaf, 0x4c, 0x03, 0xc0, 0x69, 0xb4, 0x08, + 0x57, 0x00, 0x9f, 0xde, 0x33, 0x00, 0xc1, 0x05, + 0x27, 0xd8, 0xb2, 0x08, 0x27, 0xd2, 0xb4, 0x08, + 0xe7, 0x87, 0x01, 0x00, 0xb4, 0x08, 0xe7, 0x67, + 0xff, 0x03, 0xb4, 0x08, 0x00, 0x60, 0x97, 0xc0, + 0xe7, 0x07, 0x01, 0x00, 0xb0, 0x08, 0x27, 0x00, + 0x12, 0xc0, 0x97, 0xcf, 0xc0, 0x09, 0xb6, 0x08, + 0x00, 0xd2, 0x02, 0xc3, 0xc0, 0x97, 0x05, 0x80, + 0x27, 0x00, 0xb6, 0x08, 0xc0, 0x99, 0x82, 0x08, + 0xc0, 0x99, 0xa2, 0xc0, 0x97, 0xcf, 0xe7, 0x07, + 0x00, 0x00, 0xb0, 0x08, 0xc0, 0xdf, 0x97, 0xcf, + 0xc8, 0x09, 0x72, 0x08, 0x08, 0x62, 0x02, 0xc0, + 0x10, 0x64, 0x07, 0xc1, 0xe7, 0x07, 0x00, 0x00, + 0x64, 0x08, 0xe7, 0x07, 0xc8, 0x05, 0x24, 0x00, + 0x97, 0xcf, 0x27, 0x04, 0x72, 0x08, 0xc8, 0x17, + 0x0e, 0x00, 0x27, 0x02, 0x64, 0x08, 0xe7, 0x07, + 0xd6, 0x05, 0x24, 0x00, 0x97, 0xcf, 0xd7, 0x09, + 0x00, 0xc0, 0xc1, 0xdf, 0xe7, 0x57, 0x00, 0x00, + 0x62, 0x08, 0x13, 0xc1, 0x9f, 0xaf, 0x70, 0x03, + 0xe7, 0x57, 0x00, 0x00, 0x64, 0x08, 0x13, 0xc0, + 0xe7, 0x09, 0x64, 0x08, 0x30, 0x01, 0xe7, 0x07, + 0xf2, 0x05, 0x32, 0x01, 0xe7, 0x07, 0x10, 0x00, + 0x96, 0xc0, 0xe7, 0x09, 0x64, 0x08, 0x62, 0x08, + 0x04, 0xcf, 0xe7, 0x57, 0x00, 0x00, 0x64, 0x08, + 0x02, 0xc1, 0x9f, 0xaf, 0x70, 0x03, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0xd7, 0x09, 0x00, 0xc0, + 0xc1, 0xdf, 0xc8, 0x09, 0x72, 0x08, 0x27, 0x02, + 0x78, 0x08, 0x08, 0x62, 0x03, 0xc1, 0xe7, 0x05, + 0x00, 0xc0, 0x97, 0xcf, 0x27, 0x04, 0x72, 0x08, + 0xe7, 0x05, 0x00, 0xc0, 0xf0, 0x07, 0x40, 0x00, + 0x08, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x02, 0xc0, 0x17, 0x0c, 0x00, 0x30, 0x00, + 0x06, 0x00, 0xf0, 0x07, 0x64, 0x01, 0x0a, 0x00, + 0xc8, 0x17, 0x04, 0x00, 0xc1, 0x07, 0x02, 0x00, + 0x51, 0xaf, 0x97, 0xcf, 0xe7, 0x57, 0x00, 0x00, + 0x6a, 0x08, 0x97, 0xc0, 0xc1, 0xdf, 0xc8, 0x09, + 0x6a, 0x08, 0x27, 0x04, 0x6a, 0x08, 0x27, 0x52, + 0x6c, 0x08, 0x03, 0xc1, 0xe7, 0x07, 0x6a, 0x08, + 0x6c, 0x08, 0xc0, 0xdf, 0x17, 0x02, 0xc8, 0x17, + 0x0e, 0x00, 0x9f, 0xaf, 0x16, 0x05, 0xc8, 0x05, + 0x00, 0x60, 0x03, 0xc0, 0x9f, 0xaf, 0x80, 0x04, + 0x97, 0xcf, 0x9f, 0xaf, 0x68, 0x04, 0x97, 0xcf, + 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0x08, 0x62, + 0x1c, 0xc0, 0xd0, 0x09, 0x72, 0x08, 0x27, 0x02, + 0x72, 0x08, 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf, + 0x97, 0x02, 0xca, 0x09, 0xac, 0x08, 0xf2, 0x17, + 0x01, 0x00, 0x04, 0x00, 0xf2, 0x27, 0x00, 0x00, + 0x06, 0x00, 0xca, 0x17, 0x2c, 0x00, 0xf8, 0x77, + 0x01, 0x00, 0x0e, 0x00, 0x06, 0xc0, 0xca, 0xd9, + 0xf8, 0x57, 0xff, 0x00, 0x0e, 0x00, 0x01, 0xc1, + 0xca, 0xd9, 0x22, 0x1c, 0x0c, 0x00, 0xe2, 0x27, + 0x00, 0x00, 0xe2, 0x17, 0x01, 0x00, 0xe2, 0x27, + 0x00, 0x00, 0xca, 0x05, 0x00, 0x0c, 0x0c, 0x00, + 0xc0, 0x17, 0x41, 0x00, 0xc0, 0x67, 0xc0, 0xff, + 0x30, 0x00, 0x08, 0x00, 0x00, 0x02, 0xc0, 0x17, + 0x0c, 0x00, 0x30, 0x00, 0x06, 0x00, 0xf0, 0x07, + 0xdc, 0x00, 0x0a, 0x00, 0xf0, 0x07, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x0c, 0x08, 0x00, 0x40, 0xd1, + 0x01, 0x00, 0xc0, 0x19, 0xa6, 0x08, 0xc0, 0x59, + 0x98, 0x08, 0x04, 0xc9, 0x49, 0xaf, 0x9f, 0xaf, + 0xee, 0x00, 0x4a, 0xaf, 0x67, 0x10, 0xa6, 0x08, + 0xc8, 0x17, 0x04, 0x00, 0xc1, 0x07, 0x01, 0x00, + 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0x50, 0xaf, + 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf, 0xc0, 0x07, + 0x01, 0x00, 0xc1, 0x09, 0x7c, 0x08, 0xc1, 0x77, + 0x01, 0x00, 0x97, 0xc1, 0xd8, 0x77, 0x01, 0x00, + 0x12, 0xc0, 0xc9, 0x07, 0x4c, 0x08, 0x9f, 0xaf, + 0x64, 0x05, 0x04, 0xc1, 0xc1, 0x77, 0x08, 0x00, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:19:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B57E51065675; Tue, 13 Jan 2009 21:19:02 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A12BF8FC18; Tue, 13 Jan 2009 21:19:02 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLJ2rg016394; Tue, 13 Jan 2009 21:19:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLJ2Bj016393; Tue, 13 Jan 2009 21:19:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200901132119.n0DLJ2Bj016393@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 13 Jan 2009 21:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187193 - in stable/7/sys: . dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:19:04 -0000 Author: gnn Date: Tue Jan 13 21:19:02 2009 New Revision: 187193 URL: http://svn.freebsd.org/changeset/base/187193 Log: MFC of average latency bug fix Fix a cut/paste bug which prevents us from setting the average latency tunable. Modified: stable/7/sys/ (props changed) stable/7/sys/dev/e1000/if_igb.c Modified: stable/7/sys/dev/e1000/if_igb.c ============================================================================== --- stable/7/sys/dev/e1000/if_igb.c Tue Jan 13 21:18:14 2009 (r187192) +++ stable/7/sys/dev/e1000/if_igb.c Tue Jan 13 21:19:02 2009 (r187193) @@ -281,7 +281,7 @@ TUNABLE_INT("hw.igb.enable_aim", &igb_en static int igb_low_latency = IGB_LOW_LATENCY; TUNABLE_INT("hw.igb.low_latency", &igb_low_latency); static int igb_ave_latency = IGB_AVE_LATENCY; -TUNABLE_INT("hw.igb.ave_latency", &igb_low_latency); +TUNABLE_INT("hw.igb.ave_latency", &igb_ave_latency); static int igb_bulk_latency = IGB_BULK_LATENCY; TUNABLE_INT("hw.igb.bulk_latency", &igb_bulk_latency); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:19:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5169D1065680; Tue, 13 Jan 2009 21:19:28 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 216D48FC1C; Tue, 13 Jan 2009 21:19:28 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLJSMx016436; Tue, 13 Jan 2009 21:19:28 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLJSN6016435; Tue, 13 Jan 2009 21:19:28 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200901132119.n0DLJSN6016435@svn.freebsd.org> From: "Simon L. Nielsen" Date: Tue, 13 Jan 2009 21:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187194 - head/contrib/ntp/ntpd releng/6.3 releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf releng/6.4 releng/6.4/contrib/bind9/lib/dns releng/6.4/contri... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:19:29 -0000 Author: simon Date: Tue Jan 13 21:19:27 2009 New Revision: 187194 URL: http://svn.freebsd.org/changeset/base/187194 Log: Correct ntpd(8) cryptographic signature bypass [SA-09:04]. Correct BIND DNSSEC incorrect checks for malformed signatures [SA-09:04]. Security: FreeBSD-SA-09:03.ntpd Security: FreeBSD-SA-09:04.bind Obtained from: ISC [SA-09:04] Approved by: so (simon) Modified: stable/7/contrib/ntp/ntpd/ntp_crypto.c Changes in other areas also in this revision: Modified: head/contrib/ntp/ntpd/ntp_crypto.c releng/6.3/UPDATING releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.3/contrib/ntp/ntpd/ntp_crypto.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.4/contrib/ntp/ntpd/ntp_crypto.c releng/6.4/sys/conf/newvers.sh releng/7.0/UPDATING releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.0/contrib/ntp/ntpd/ntp_crypto.c releng/7.0/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.1/contrib/ntp/ntpd/ntp_crypto.c releng/7.1/sys/conf/newvers.sh stable/6/contrib/ntp/ntpd/ntp_crypto.c Modified: stable/7/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- stable/7/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193) +++ stable/7/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194) @@ -1612,7 +1612,7 @@ crypto_verify( */ EVP_VerifyInit(&ctx, peer->digest); EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); - if (!EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey)) + if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey) <= 0) return (XEVNT_SIG); if (peer->crypto & CRYPTO_FLAG_VRFY) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:19:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81513106568E; Tue, 13 Jan 2009 21:19:28 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F76A8FC20; Tue, 13 Jan 2009 21:19:28 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLJSB9016442; Tue, 13 Jan 2009 21:19:28 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLJSa2016441; Tue, 13 Jan 2009 21:19:28 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200901132119.n0DLJSa2016441@svn.freebsd.org> From: "Simon L. Nielsen" Date: Tue, 13 Jan 2009 21:19: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: r187194 - head/contrib/ntp/ntpd releng/6.3 releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf releng/6.4 releng/6.4/contrib/bind9/lib/dns releng/6.4/contri... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:19:30 -0000 Author: simon Date: Tue Jan 13 21:19:27 2009 New Revision: 187194 URL: http://svn.freebsd.org/changeset/base/187194 Log: Correct ntpd(8) cryptographic signature bypass [SA-09:04]. Correct BIND DNSSEC incorrect checks for malformed signatures [SA-09:04]. Security: FreeBSD-SA-09:03.ntpd Security: FreeBSD-SA-09:04.bind Obtained from: ISC [SA-09:04] Approved by: so (simon) Modified: head/contrib/ntp/ntpd/ntp_crypto.c Changes in other areas also in this revision: Modified: releng/6.3/UPDATING releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.3/contrib/ntp/ntpd/ntp_crypto.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.4/contrib/ntp/ntpd/ntp_crypto.c releng/6.4/sys/conf/newvers.sh releng/7.0/UPDATING releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.0/contrib/ntp/ntpd/ntp_crypto.c releng/7.0/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.1/contrib/ntp/ntpd/ntp_crypto.c releng/7.1/sys/conf/newvers.sh stable/6/contrib/ntp/ntpd/ntp_crypto.c stable/7/contrib/ntp/ntpd/ntp_crypto.c Modified: head/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- head/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193) +++ head/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194) @@ -1612,7 +1612,7 @@ crypto_verify( */ EVP_VerifyInit(&ctx, peer->digest); EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); - if (!EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey)) + if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey) <= 0) return (XEVNT_SIG); if (peer->crypto & CRYPTO_FLAG_VRFY) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:19:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FF741065686; Tue, 13 Jan 2009 21:19:29 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37B468FC16; Tue, 13 Jan 2009 21:19:29 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLJTLD016467; Tue, 13 Jan 2009 21:19:29 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLJSnW016447; Tue, 13 Jan 2009 21:19:28 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200901132119.n0DLJSnW016447@svn.freebsd.org> From: "Simon L. Nielsen" Date: Tue, 13 Jan 2009 21:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187194 - head/contrib/ntp/ntpd releng/6.3 releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf releng/6.4 releng/6.4/contrib/bind9/lib/dns releng/6.4/contri... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:19:31 -0000 Author: simon Date: Tue Jan 13 21:19:27 2009 New Revision: 187194 URL: http://svn.freebsd.org/changeset/base/187194 Log: Correct ntpd(8) cryptographic signature bypass [SA-09:04]. Correct BIND DNSSEC incorrect checks for malformed signatures [SA-09:04]. Security: FreeBSD-SA-09:03.ntpd Security: FreeBSD-SA-09:04.bind Obtained from: ISC [SA-09:04] Approved by: so (simon) Modified: releng/6.3/UPDATING releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.3/contrib/ntp/ntpd/ntp_crypto.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.4/contrib/ntp/ntpd/ntp_crypto.c releng/6.4/sys/conf/newvers.sh releng/7.0/UPDATING releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.0/contrib/ntp/ntpd/ntp_crypto.c releng/7.0/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.1/contrib/ntp/ntpd/ntp_crypto.c releng/7.1/sys/conf/newvers.sh Changes in other areas also in this revision: Modified: head/contrib/ntp/ntpd/ntp_crypto.c stable/6/contrib/ntp/ntpd/ntp_crypto.c stable/7/contrib/ntp/ntpd/ntp_crypto.c Modified: releng/6.3/UPDATING ============================================================================== --- releng/6.3/UPDATING Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.3/UPDATING Tue Jan 13 21:19:27 2009 (r187194) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090113: p9 FreeBSD-SA-09:03.ntpd, FreeBSD-SA-09:04.bind + Correct ntpd cryptographic signature bypass. [09:03] + + Correct BIND DNSSEC incorrect checks for malformed + signatures. [09:04] + 20090107: p8 FreeBSD-SA-09:01.lukemftpd, FreeBSD-SA-09:02.openssl Prevent cross-site forgery attacks on lukemftpd(8) due to splitting long commands into multiple requests. [09:01] Modified: releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c ============================================================================== --- releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c Tue Jan 13 21:19:27 2009 (r187194) @@ -133,7 +133,7 @@ openssldsa_verify(dst_context_t *dctx, c status = DSA_do_verify(digest, ISC_SHA1_DIGESTLENGTH, dsasig, dsa); DSA_SIG_free(dsasig); - if (status == 0) + if (status != 1) return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); return (ISC_R_SUCCESS); Modified: releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c ============================================================================== --- releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c Tue Jan 13 21:19:27 2009 (r187194) @@ -246,7 +246,7 @@ opensslrsa_verify(dst_context_t *dctx, c status = RSA_verify(type, digest, digestlen, sig->base, RSA_size(rsa), rsa); - if (status == 0) + if (status != 1) return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); return (ISC_R_SUCCESS); Modified: releng/6.3/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- releng/6.3/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.3/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194) @@ -1536,7 +1536,7 @@ crypto_verify( EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, - pkey)) { + pkey) == 1) { if (peer->crypto & CRYPTO_FLAG_VRFY) peer->crypto |= CRYPTO_FLAG_PROV; } else { Modified: releng/6.3/sys/conf/newvers.sh ============================================================================== --- releng/6.3/sys/conf/newvers.sh Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.3/sys/conf/newvers.sh Tue Jan 13 21:19:27 2009 (r187194) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.3" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/6.4/UPDATING ============================================================================== --- releng/6.4/UPDATING Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.4/UPDATING Tue Jan 13 21:19:27 2009 (r187194) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090113: p9 FreeBSD-SA-09:03.ntpd, FreeBSD-SA-09:04.bind + Correct ntpd cryptographic signature bypass. [09:03] + + Correct BIND DNSSEC incorrect checks for malformed + signatures. [09:04] + 20090107: p2 FreeBSD-SA-09:01.lukemftpd, FreeBSD-SA-09:02.openssl Prevent cross-site forgery attacks on lukemftpd(8) due to splitting long commands into multiple requests. [09:01] Modified: releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c ============================================================================== --- releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c Tue Jan 13 21:19:27 2009 (r187194) @@ -133,7 +133,7 @@ openssldsa_verify(dst_context_t *dctx, c status = DSA_do_verify(digest, ISC_SHA1_DIGESTLENGTH, dsasig, dsa); DSA_SIG_free(dsasig); - if (status == 0) + if (status != 1) return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); return (ISC_R_SUCCESS); Modified: releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c ============================================================================== --- releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c Tue Jan 13 21:19:27 2009 (r187194) @@ -246,7 +246,7 @@ opensslrsa_verify(dst_context_t *dctx, c status = RSA_verify(type, digest, digestlen, sig->base, RSA_size(rsa), rsa); - if (status == 0) + if (status != 1) return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); return (ISC_R_SUCCESS); Modified: releng/6.4/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- releng/6.4/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.4/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194) @@ -1612,7 +1612,7 @@ crypto_verify( */ EVP_VerifyInit(&ctx, peer->digest); EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); - if (!EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey)) + if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey) <= 0) return (XEVNT_SIG); if (peer->crypto & CRYPTO_FLAG_VRFY) { Modified: releng/6.4/sys/conf/newvers.sh ============================================================================== --- releng/6.4/sys/conf/newvers.sh Tue Jan 13 21:19:02 2009 (r187193) +++ releng/6.4/sys/conf/newvers.sh Tue Jan 13 21:19:27 2009 (r187194) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.4" -BRANCH="RELEASE-p2" +BRANCH="RELEASE-p3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.0/UPDATING ============================================================================== --- releng/7.0/UPDATING Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.0/UPDATING Tue Jan 13 21:19:27 2009 (r187194) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090113: p9 FreeBSD-SA-09:03.ntpd, FreeBSD-SA-09:04.bind + Correct ntpd cryptographic signature bypass. [09:03] + + Correct BIND DNSSEC incorrect checks for malformed + signatures. [09:04] + 20090107: p8 FreeBSD-SA-09:01.lukemftpd, FreeBSD-SA-09:02.openssl Prevent cross-site forgery attacks on lukemftpd(8) due to splitting long commands into multiple requests. [09:01] Modified: releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c ============================================================================== --- releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c Tue Jan 13 21:19:27 2009 (r187194) @@ -133,7 +133,7 @@ openssldsa_verify(dst_context_t *dctx, c status = DSA_do_verify(digest, ISC_SHA1_DIGESTLENGTH, dsasig, dsa); DSA_SIG_free(dsasig); - if (status == 0) + if (status != 1) return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); return (ISC_R_SUCCESS); Modified: releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c ============================================================================== --- releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c Tue Jan 13 21:19:27 2009 (r187194) @@ -246,7 +246,7 @@ opensslrsa_verify(dst_context_t *dctx, c status = RSA_verify(type, digest, digestlen, sig->base, RSA_size(rsa), rsa); - if (status == 0) + if (status != 1) return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); return (ISC_R_SUCCESS); Modified: releng/7.0/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- releng/7.0/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.0/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194) @@ -1536,7 +1536,7 @@ crypto_verify( EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, - pkey)) { + pkey) == 1) { if (peer->crypto & CRYPTO_FLAG_VRFY) peer->crypto |= CRYPTO_FLAG_PROV; } else { Modified: releng/7.0/sys/conf/newvers.sh ============================================================================== --- releng/7.0/sys/conf/newvers.sh Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.0/sys/conf/newvers.sh Tue Jan 13 21:19:27 2009 (r187194) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.0" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.1/UPDATING ============================================================================== --- releng/7.1/UPDATING Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.1/UPDATING Tue Jan 13 21:19:27 2009 (r187194) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090113: p2 FreeBSD-SA-09:03.ntpd, FreeBSD-SA-09:04.bind + Correct ntpd cryptographic signature bypass. [09:03] + + Correct BIND DNSSEC incorrect checks for malformed + signatures. [09:04] + 20090107: p1 FreeBSD-SA-09:01.lukemftpd, FreeBSD-SA-09:02.openssl Prevent cross-site forgery attacks on lukemftpd(8) due to splitting long commands into multiple requests. [09:01] Modified: releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c ============================================================================== --- releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c Tue Jan 13 21:19:27 2009 (r187194) @@ -133,7 +133,7 @@ openssldsa_verify(dst_context_t *dctx, c status = DSA_do_verify(digest, ISC_SHA1_DIGESTLENGTH, dsasig, dsa); DSA_SIG_free(dsasig); - if (status == 0) + if (status != 1) return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); return (ISC_R_SUCCESS); Modified: releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c ============================================================================== --- releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c Tue Jan 13 21:19:27 2009 (r187194) @@ -246,7 +246,7 @@ opensslrsa_verify(dst_context_t *dctx, c status = RSA_verify(type, digest, digestlen, sig->base, RSA_size(rsa), rsa); - if (status == 0) + if (status != 1) return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); return (ISC_R_SUCCESS); Modified: releng/7.1/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- releng/7.1/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.1/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194) @@ -1612,7 +1612,7 @@ crypto_verify( */ EVP_VerifyInit(&ctx, peer->digest); EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); - if (!EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey)) + if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey) <= 0) return (XEVNT_SIG); if (peer->crypto & CRYPTO_FLAG_VRFY) { Modified: releng/7.1/sys/conf/newvers.sh ============================================================================== --- releng/7.1/sys/conf/newvers.sh Tue Jan 13 21:19:02 2009 (r187193) +++ releng/7.1/sys/conf/newvers.sh Tue Jan 13 21:19:27 2009 (r187194) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.1" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:19:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90A8D106568A; Tue, 13 Jan 2009 21:19:29 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF268FC17; Tue, 13 Jan 2009 21:19:29 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLJTfN016473; Tue, 13 Jan 2009 21:19:29 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLJTMW016472; Tue, 13 Jan 2009 21:19:29 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200901132119.n0DLJTMW016472@svn.freebsd.org> From: "Simon L. Nielsen" Date: Tue, 13 Jan 2009 21:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187194 - head/contrib/ntp/ntpd releng/6.3 releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf releng/6.4 releng/6.4/contrib/bind9/lib/dns releng/6.4/contri... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:19:31 -0000 Author: simon Date: Tue Jan 13 21:19:27 2009 New Revision: 187194 URL: http://svn.freebsd.org/changeset/base/187194 Log: Correct ntpd(8) cryptographic signature bypass [SA-09:04]. Correct BIND DNSSEC incorrect checks for malformed signatures [SA-09:04]. Security: FreeBSD-SA-09:03.ntpd Security: FreeBSD-SA-09:04.bind Obtained from: ISC [SA-09:04] Approved by: so (simon) Modified: stable/6/contrib/ntp/ntpd/ntp_crypto.c Changes in other areas also in this revision: Modified: head/contrib/ntp/ntpd/ntp_crypto.c releng/6.3/UPDATING releng/6.3/contrib/bind9/lib/dns/openssldsa_link.c releng/6.3/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.3/contrib/ntp/ntpd/ntp_crypto.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/lib/dns/openssldsa_link.c releng/6.4/contrib/bind9/lib/dns/opensslrsa_link.c releng/6.4/contrib/ntp/ntpd/ntp_crypto.c releng/6.4/sys/conf/newvers.sh releng/7.0/UPDATING releng/7.0/contrib/bind9/lib/dns/openssldsa_link.c releng/7.0/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.0/contrib/ntp/ntpd/ntp_crypto.c releng/7.0/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/lib/dns/openssldsa_link.c releng/7.1/contrib/bind9/lib/dns/opensslrsa_link.c releng/7.1/contrib/ntp/ntpd/ntp_crypto.c releng/7.1/sys/conf/newvers.sh stable/7/contrib/ntp/ntpd/ntp_crypto.c Modified: stable/6/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- stable/6/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:02 2009 (r187193) +++ stable/6/contrib/ntp/ntpd/ntp_crypto.c Tue Jan 13 21:19:27 2009 (r187194) @@ -1612,7 +1612,7 @@ crypto_verify( */ EVP_VerifyInit(&ctx, peer->digest); EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12); - if (!EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey)) + if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen, pkey) <= 0) return (XEVNT_SIG); if (peer->crypto & CRYPTO_FLAG_VRFY) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:30:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A92571065670; Tue, 13 Jan 2009 21:30:09 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from semihalf.com (semihalf.com [206.130.101.55]) by mx1.freebsd.org (Postfix) with ESMTP id 609A78FC08; Tue, 13 Jan 2009 21:30:09 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by semihalf.com (8.13.1/8.13.1) with ESMTP id n0DKvZiD023976; Tue, 13 Jan 2009 13:57:37 -0700 Received: from [95.41.73.8] (apn-95-41-73-8.gprs.plus.pl [95.41.73.8]) by mail.semihalf.com (Postfix) with ESMTP id 654FA151DC; Tue, 13 Jan 2009 22:17:55 +0100 (CET) Message-ID: <496D0028.7080302@semihalf.com> Date: Tue, 13 Jan 2009 21:57:12 +0100 From: Rafal Jaworowski Organization: Semihalf MIME-Version: 1.0 To: Alan Cox References: <200901131615.n0DGFnuC008182@svn.freebsd.org> <496CE1D6.6000101@cs.rice.edu> In-Reply-To: <496CE1D6.6000101@cs.rice.edu> 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: r187151 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:30:10 -0000 Alan Cox wrote: > Both the BookE and MIPS pmap modules need to have their get_pv_entry() > functions updated. Their implementations of get_pv_entry() look like > what I would expect to find in FreeBSD 4. For example, the modern > equivalent of pmap_collect() is performed synchronously from > get_pv_entry() rather than asynchronously as a side-effect of waking the > page daemon. As a result of this mismatch, there is no > pmap_collect()-like support in HEAD for either BookE or MIPS. This > could cause either to crash under memory pressure. > > The simplest correct implementation of get_pv_entry() can be found in > the IA64 pmap module. You could cut-and-paste all but the body of the > inner loop. (amd64 and i386 are complicated by their efforts to save > memory.) Alan, Thanks for bringing it out and the hints. I'll take a look and try to improve this for the BookE. Rafal From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 21:55:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE5D0106564A; Tue, 13 Jan 2009 21:55:39 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8207E8FC13; Tue, 13 Jan 2009 21:55:39 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DLtd1N017396; Tue, 13 Jan 2009 21:55:39 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DLtdIe017395; Tue, 13 Jan 2009 21:55:39 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132155.n0DLtdIe017395@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 21:55: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: r187195 - head/usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 21:55:40 -0000 Author: luigi Date: Tue Jan 13 21:55:39 2009 New Revision: 187195 URL: http://svn.freebsd.org/changeset/base/187195 Log: Extend the geom-related info and put in the NOTE section, not in BUGS, as this is a feature. Bump the date, as it was forgotten in previous commits and the page has had significant changes recently Modified: head/usr.sbin/boot0cfg/boot0cfg.8 Modified: head/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.8 Tue Jan 13 21:19:27 2009 (r187194) +++ head/usr.sbin/boot0cfg/boot0cfg.8 Tue Jan 13 21:55:39 2009 (r187195) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2007 +.Dd January 13, 2009 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -153,6 +153,21 @@ Set the timeout value to .It Fl v Verbose: display information about the slices defined, etc. .El +.Sh NOTE +Protection mechanisms in the +.Xr geom 4 +subsystem might prevent +.Nm +from being able to update the MBR on a mounted disk. +Instructions for temporarily disabling these protection mechanisms +can be found in the +.Xr geom 4 +manpage. Specifically, do a +.Pp +.Dl sysctl kern.geom.debugflags=0x10 +.Pp +to allow writing to the MBR, and restore it to 0 afterwards. +.Pp .Sh FILES .Bl -tag -width /boot/boot0sio -compact .It Pa /boot/boot0 @@ -186,16 +201,6 @@ to install the default MBR: .Sh AUTHORS .An Robert Nordier Aq rnordier@FreeBSD.org . .Sh BUGS -Protection mechanisms in the -.Xr geom 4 -subsystem might prevent -.Nm -from being able to update the MBR on a mounted disk. -Instructions for temporarily disabling these protection mechanisms -can be found in the -.Xr geom 4 -manpage. -.Pp Use of the .Sq packet option may cause @@ -204,6 +209,6 @@ to fail, depending on the nature of BIOS .Pp Use of the .Sq setdrv -option with an incorrect -d operand may cause the MBR to be written -to the wrong disk. -Be careful! +option with an incorrect -d operand may cause the boot0 code +to write the MBR to the wrong disk, thus trashing its previous +content. Be careful. From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 22:10:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23CF21065670; Tue, 13 Jan 2009 22:10:02 +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 112098FC14; Tue, 13 Jan 2009 22:10:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DMA1D5017739; Tue, 13 Jan 2009 22:10:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DMA1gj017738; Tue, 13 Jan 2009 22:10:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901132210.n0DMA1gj017738@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Jan 2009 22:10:01 +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: r187196 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:10:02 -0000 Author: mav Date: Tue Jan 13 22:10:01 2009 New Revision: 187196 URL: http://svn.freebsd.org/changeset/base/187196 Log: Improve AD1983 codec support: - force playback via mixer to get PCM volume control, - make cleanup on recoring source selection. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 21:55:39 2009 (r187195) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 22:10:01 2009 (r187196) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090113_0124" +#define HDA_DRV_TEST_REV "20090113_0125" SND_DECLARE_FILE("$FreeBSD$"); @@ -4649,6 +4649,33 @@ hdac_vendor_patch_parse(struct hdac_devi * nid: 26 = Line-in, leave it alone. */ break; + case HDA_CODEC_AD1983: + /* + * This codec has several posisble usages, but none + * fit parser best. Help parser to choose better. + */ + /* Disable direct unmixed playback to get pcm volume. */ + w = hdac_widget_get(devinfo, 5); + if (w != NULL) + w->connsenable[0] = 0; + w = hdac_widget_get(devinfo, 6); + if (w != NULL) + w->connsenable[0] = 0; + w = hdac_widget_get(devinfo, 11); + if (w != NULL) + w->connsenable[0] = 0; + /* Disable mic and line selectors. */ + w = hdac_widget_get(devinfo, 12); + if (w != NULL) + w->connsenable[1] = 0; + w = hdac_widget_get(devinfo, 13); + if (w != NULL) + w->connsenable[1] = 0; + /* Disable recording from mono playback mix. */ + w = hdac_widget_get(devinfo, 20); + if (w != NULL) + w->connsenable[3] = 0; + break; case HDA_CODEC_AD1986A: /* * This codec has overcomplicated input mixing. From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 22:15:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A2CA106566B; Tue, 13 Jan 2009 22:15:48 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D7C18FC12; Tue, 13 Jan 2009 22:15:48 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DMFlI8017893; Tue, 13 Jan 2009 22:15:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DMFlfA017892; Tue, 13 Jan 2009 22:15:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132215.n0DMFlfA017892@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 22:15: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: r187197 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:15:48 -0000 Author: luigi Date: Tue Jan 13 22:15:47 2009 New Revision: 187197 URL: http://svn.freebsd.org/changeset/base/187197 Log: remove a file which is, as far as I can tell, totally unused. Deleted: head/sys/boot/common/load.c From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 22:27:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0378B1065675 for ; Tue, 13 Jan 2009 22:27:30 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 67D0B8FC12 for ; Tue, 13 Jan 2009 22:27:29 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 095EB8FC4F for ; Wed, 14 Jan 2009 01:27:27 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id 565548FC18; Wed, 14 Jan 2009 01:27:26 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id C6FD4398F3; Wed, 14 Jan 2009 01:27:24 +0300 (MSK) Date: Wed, 14 Jan 2009 01:27:19 +0300 From: Stanislav Sedov To: Andrew Thompson , Hans Petter Selasky Message-Id: <20090114012719.6145076a.stas@FreeBSD.org> In-Reply-To: <200901131901.n0DJ1EF1011980@svn.freebsd.org> References: <200901131901.n0DJ1EF1011980@svn.freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Wed Jan 14 01:27:27 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 496d154f967001871221309 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187162 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:27:30 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi! Would it make sense to rename usbconfig to something like "usbcontrol" to follow the *control tradition (cdcontrol, pmccontrol, vidcontrol, and so on)? Thanks! - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkltFUwACgkQK/VZk+smlYEp6wCeNwFkdF7WpW7n0GZzDVM6t/9T +UgAn1ccQk92RMVfwGpVUultzLStccOY =NLs1 -----END PGP SIGNATURE----- !DSPAM:496d154f967001871221309! From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 22:28:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 378E01065714; Tue, 13 Jan 2009 22:28:49 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1508FC1E; Tue, 13 Jan 2009 22:28:49 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DMSnIL018187; Tue, 13 Jan 2009 22:28:49 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DMSnai018184; Tue, 13 Jan 2009 22:28:49 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132228.n0DMSnai018184@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 22:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187198 - in stable/7: sys/boot/i386/boot0 usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:28:51 -0000 Author: luigi Date: Tue Jan 13 22:28:48 2009 New Revision: 187198 URL: http://svn.freebsd.org/changeset/base/187198 Log: MFC: a number of small fixes and enhancements to the boot0 code, and matching modifications to boot0cfg. The most noticeable features are preserving the 4-byte volume ID that certain Windows versions put in the MBR, and an option (F6) to boot through INT18 that on some modern BIOSes invokes PXE. Modified: stable/7/sys/boot/i386/boot0/boot0.S stable/7/usr.sbin/boot0cfg/boot0cfg.8 stable/7/usr.sbin/boot0cfg/boot0cfg.c Modified: stable/7/sys/boot/i386/boot0/boot0.S ============================================================================== --- stable/7/sys/boot/i386/boot0/boot0.S Tue Jan 13 22:15:47 2009 (r187197) +++ stable/7/sys/boot/i386/boot0/boot0.S Tue Jan 13 22:28:48 2009 (r187198) @@ -1,4 +1,5 @@ /* + * Copyright (c) 2008 Luigi Rizzo (mostly documentation) * Copyright (c) 2002 Bruce M. Simpson * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -16,50 +17,166 @@ * $FreeBSD$ */ -/* A 512-byte boot manager. */ -#ifdef SIO -/* ... using a serial console on COM1. */ +/* build options: */ +#ifdef SIO /* use serial console on COM1. */ #endif +#ifdef PXE /* enable PXE/INT18 booting with F6 */ +#define SAVE_MORE_MEMORY +#endif + +#ifdef CHECK_DRIVE /* make sure we boot from a HD. */ +#endif + +#ifdef ONLY_F_KEYS /* Only F1..F6, no digits on console */ +#endif + +#ifdef VOLUME_SERIAL /* support Volume serial number */ +#define B0_BASE 0x1ae /* move the internal data area */ +#define SAVE_MEMORY +#else +#define B0_BASE 0x1b2 +#endif + +#ifdef TEST /* enable some test code */ +#define SAVE_MEMORY +#define SAVE_MORE_MEMORY +#endif + +/* + * Note - this code uses many tricks to save space and fit in one sector. + * This includes using side effects of certain instructions, reusing + * register values from previous operations, etc. + * Be extremely careful when changing the code, even for simple things. + */ + +/* + * BOOT BLOCK STRUCTURE + * + * This code implements a Master Boot Record (MBR) for an Intel/PC disk. + * It is 512 bytes long and it is normally loaded by the BIOS (or another + * bootloader) at 0:0x7c00. This code depends on %cs:%ip being 0:0x7c00 + * + * The initial chunk of instructions is used as a signature by external + * tools (e.g. boot0cfg) which can manipulate the block itself. + * + * The area at offset 0x1b2 contains a magic string ('Drive '), also + * used as a signature to detect the block, and some variables that can + * be updated by boot0cfg (and optionally written back to the disk). + * These variables control the operation of the bootloader itself, + * e.g. which partitions to enable, the timeout, the use of LBA + * (called 'packet') or CHS mode, whether to force a drive number, + * and whether to write back the user's selection back to disk. + * + * As in every Master Boot Record, the partition table is at 0x1be, + * made of four 16-byte entries each containing: + * + * OFF SIZE DESCRIPTION + * 0 1 status (0x80: bootable, 0: non bootable) + * 1 3 start sector CHS + * 8:head, 6:sector, 2:cyl bit 9..8, 8:cyl bit 7..0 + * 4 1 partition type + * 5 3 end sector CHS + * 8 4 LBA of first sector + * 12 4 partition size in sectors + * + * and followed by the two bytes 0x55, 0xAA (MBR signature). + */ + + +/* + * BOOT BLOCK OPERATION + * + * On entry, the registers contain the following values: + * + * %cs:%ip 0:0x7c00 + * %dl drive number (0x80, 0x81, ... ) + * %si pointer to the partition table from which we were loaded. + * Some boot code (e.g. syslinux) use this info to relocate + * themselves, so we want to pass a valid one to the next stage. + * NOTE: the use of %si is not a standard. + * + * This boot block first relocates itself at a different address (0:0x600), + * to free the space at 0:0x7c00 for the next stage boot block. + * + * It then initializes some memory at 0:0x800 and above (pointed by %bp) + * to store the original drive number (%dl) passed to us, and to construct a + * fake partition entry. The latter is used by the disk I/O routine and, + * in some cases, passed in %si to the next stage boot code. + * + * The variables at 0x1b2 are accessed as negative offsets from %bp. + * + * After the relocation, the code scans the partition table printing + * out enabled partition or disks, and waits for user input. + * + * When a partition is selected, or a timeout expires, the currently + * selected partition is used to load the next stage boot code, + * %dl and %si are set appropriately as when we were called, and + * control is transferred to the newly loaded code at 0:0x7c00. + */ + +/* + * CONSTANTS + * + * NHRDRV is the address in segment 0 where the BIOS writes the + * total number of hard disks in the system. + * LOAD is the original load address and cannot be changed. + * ORIGIN is the relocation address. If you change it, you also need + * to change the value passed to the linker in the Makefile + * PRT_OFF is the location of the partition table (from the MBR standard). + * B0_OFF is the location of the data area, known to boot0cfg so + * it cannot be changed. Computed as a negative offset from 0x200 + * MAGIC is the signature of a boot block. + */ + .set NHRDRV,0x475 # Number of hard drives .set ORIGIN,0x600 # Execution address - .set FAKE,0x800 # Partition entry .set LOAD,0x7c00 # Load address .set PRT_OFF,0x1be # Partition table - - .set TBL0SZ,0x3 # Table 0 size - .set TBL1SZ,0xa # Table 1 size + .set B0_OFF,(B0_BASE-0x200) # Offset of boot0 data .set MAGIC,0xaa55 # Magic: bootable - .set B0MAGIC,0xbb66 # Identification .set KEY_ENTER,0x1c # Enter key scan code .set KEY_F1,0x3b # F1 key scan code .set KEY_1,0x02 # #1 key scan code - .set ASCII_BEL,0x07 # ASCII code for + .set ASCII_BEL,'#' # ASCII code for .set ASCII_CR,0x0D # ASCII code for /* - * Addresses in the sector of embedded data values. - * Accessed with negative offsets from the end of the relocated sector (%ebp). - */ - .set _NXTDRV,-0x48 # Next drive - .set _OPT,-0x47 # Default option - .set _SETDRV,-0x46 # Drive to force - .set _FLAGS,-0x45 # Flags - .set _TICKS,-0x44 # Timeout ticks - .set _FAKE,0x0 # Fake partition entry - .set _MNUOPT,0xc # Menu options + * Offsets of variables in the block at B0_OFF, and in the volatile + * data area, computed as displacement from %bp. + * We need to define them as constant as the assembler cannot + * compute them in its single pass. + */ + .set _NXTDRV, B0_OFF+6 # Next drive + .set _OPT, B0_OFF+7 # Default option + .set _SETDRV, B0_OFF+8 # Drive to force + .set _FLAGS, B0_OFF+9 # Flags + .set SETDRV, 0x20 # the 'setdrv' flag + .set NOUPDATE, 0x40 # the 'noupdate' flag + .set USEPACKET, 0x80 # the 'packet' flag + + /* ticks is at a fixed position */ + .set _TICKS, (PRT_OFF - 0x200 - 2) # Timeout ticks + .set _MNUOPT, 0x10 # Saved menu entries + .set TLEN, (desc_ofs - bootable_ids) # size of bootable ids .globl start # Entry point .code16 # This runs in real mode /* + * MAIN ENTRY POINT * Initialise segments and registers to known values. * segments start at 0. * The stack is immediately below the address we were loaded to. + * NOTE: the initial section of the code (up to movw $LOAD,%sp) + * is used by boot0cfg, together with the 'Drive ' string and + * the 0x55, 0xaa at the end, as an identifier for version 1.0 + * of the boot code. Do not change it. + * In version 1.0 the parameter table (_NEXTDRV etc) is at 0x1b9 */ start: cld # String ops inc xorw %ax,%ax # Zero @@ -69,7 +186,7 @@ start: cld # String ops inc movw $LOAD,%sp # stack /* - * Copy this code to the address it was linked for + * Copy this code to the address it was linked for, 0x600 by default. */ movw %sp,%si # Source movw $start,%di # Destination @@ -77,248 +194,301 @@ start: cld # String ops inc rep # Relocate movsw # code /* - * Set address for variable space beyond code, and clear it. - * Notice that this is also used to point to the values embedded in the block, - * by using negative offsets. + * After the code, (i.e. at %di+0, 0x800) create a partition entry, + * initialized to LBA 0 / CHS 0:0:1. + * Set %bp to point to the partition and also, with negative offsets, + * to the variables embedded in the bootblock (nextdrv and so on). */ movw %di,%bp # Address variables movb $0x8,%cl # Words to clear rep # Zero stosw # them -/* - * Relocate to the new copy of the code. - */ - incb -0xe(%di) # Sector number - jmp main-LOAD+ORIGIN # To relocated code + incb -0xe(%di) # Set the S field to 1 + + jmp main-LOAD+ORIGIN # Jump to relocated code main: #if defined(SIO) && COMSPEED != 0 /* - * Initialize the serial port. bioscom preserves the driver number in DX. + * Init the serial port. bioscom preserves the driver number in DX. */ movw $COMSPEED,%ax # defined by Makefile callw bioscom #endif + /* - * Check what flags were loaded with us, specifically if a predefined drive - * number should be used. If what the bios gives us is bad, use the '0' in - * the block instead. - */ - testb $0x20,_FLAGS(%bp) # Set drive number? - jnz main.1 # Yes + * If the 'setdrv' flag is set in the boot sector, use the drive + * number from the boot sector at 'setdrv_num'. + * Optionally, do the same if the BIOS gives us an invalid number + * (note though that the override prevents booting from a floppy + * or a ZIP/flash drive in floppy emulation). + * The test costs 4 bytes of code so it is disabled by default. + */ + testb $SETDRV,_FLAGS(%bp) # Set drive number? +#ifndef CHECK_DRIVE /* disable drive checks */ + jz save_curdrive # no, use the default +#else + jnz disable_update # Yes testb %dl,%dl # Drive number valid? - js main.2 # Possibly (0x80 set) + js save_curdrive # Possibly (0x80 set) +#endif /* - * Only update the boot-sector when there is a valid drive number or - * the drive number is set manually. + * Disable updates if the drive number is forced. */ - orb $0x40,_FLAGS(%bp) # Disable updates -main.1: movb _SETDRV(%bp),%dl # Drive number to use +disable_update: orb $NOUPDATE,_FLAGS(%bp) # Disable updates + movb _SETDRV(%bp),%dl # Use stored drive number + /* - * Whatever we decided to use, now store it into the fake - * partition entry that lives in the data space above us. - */ -main.2: movb %dl,_FAKE(%bp) # Save drive number - callw putn # To new line - pushw %dx # Save drive number + * Whatever drive we decided to use, store it at (%bp). The byte + * is normally used for the state of the partition (0x80 or 0x00), + * but we abuse it as it is very convenient to access at offset 0. + * The value is read back after 'check_selection' + */ +save_curdrive: movb %dl, (%bp) # Save drive number + pushw %dx # Also in the stack +#ifdef TEST /* test code, print internal bios drive */ + rolb $1, %dl + movw $drive, %si + call putkey +#endif + callw putn # Print a newline /* * Start out with a pointer to the 4th byte of the first table entry * so that after 4 iterations it's beyond the end of the sector - * and beyond a 256 byte boundary and has overflowed 8 bits (see next comment). - * Remember that the table starts 2 bytes earlier than you would expect - * as the bootable flag is after it in the block. + * and beyond a 256 byte boundary. We use the latter trick to check for + * end of the loop without using an extra register (see start.5). */ movw $(partbl+0x4),%bx # Partition table (+4) xorw %dx,%dx # Item number + /* * Loop around on the partition table, printing values until we - * pass a 256 byte boundary. The end of loop test is at main.5. + * pass a 256 byte boundary. */ -main.3: movb %ch,-0x4(%bx) # Zero active flag (ch == 0) +read_entry: movb %ch,-0x4(%bx) # Zero active flag (ch == 0) btw %dx,_FLAGS(%bp) # Entry enabled? - jnc main.5 # No -/* - * If any of the entries in the table are the same as the 'type' in the slice - * table entry, then this is an empty or non bootable partition. Skip it. - */ + jnc next_entry # No movb (%bx),%al # Load type - movw $tables,%di # Lookup tables - movb $TBL0SZ,%cl # Number of entries - repne # Exclude - scasb # partition? - je main.5 # Yes + test %al, %al # skip empty partition + jz next_entry /* - * Now scan the table of known types + * Scan the table of bootable ids, which starts at %di and has + * length TLEN. On a match, %di points to the element following the + * match; the corresponding offset to the description is $(TLEN-1) + * bytes ahead. We use a count of TLEN+1 so if we don't find a match + * within the first TLEN entries, we hit the 'unknown' entry. */ - movb $TBL1SZ+1,%cl # Number of entries + movw $bootable_ids,%di # Lookup tables + movb $(TLEN+1),%cl # Number of entries repne # Locate scasb # type /* * Get the matching element in the next array. + * The byte at $(TLEN-1)(%di) contains the offset of the description + * string from %di, so we add the number and print the string. */ - addw $TBL1SZ-1, %di # Adjust + addw $(TLEN-1), %di # Adjust movb (%di),%cl # Partition addw %cx,%di # description callw putx # Display it -main.5: incw %dx # Next item + +next_entry: incw %dx # Next item addb $0x10,%bl # Next entry - jnc main.3 # Till done + jnc read_entry # Till done /* - * Passed a 256 byte boundary; the table is finished. + * We are past a 256 byte boundary: the partition table is finished. * Add one to the drive number and check it is valid. + * Note that if we started from a floppy, %dl was 0 so we still + * get an entry for the next drive, which is the first Hard Disk. */ popw %ax # Drive number subb $0x80-0x1,%al # Does next cmpb NHRDRV,%al # drive exist? (from BIOS?) - jb main.6 # Yes + jb print_drive # Yes /* * If this is the only drive, don't display it as an option. */ decw %ax # Already drive 0? - jz main.7 # Yes + jz print_prompt # Yes /* * If it was illegal or we cycled through them, go back to drive 0. */ xorb %al,%al # Drive 0 /* - * Whatever drive we selected, make it an ascii digit and save it back to the - * "next drive" location in the loaded block in case we want to save it later - * for next time. This also is part of the printed drive string so add 0x80 + * Whatever drive we selected, make it an ascii digit and save it + * back to the "nxtdrv" location in case we want to save it to disk. + * This digit is also part of the printed drive string, so add 0x80 * to indicate end of string. */ -main.6: addb $'0'|0x80,%al # Save next +print_drive: addb $'0'|0x80,%al # Save next movb %al,_NXTDRV(%bp) # drive number movw $drive,%di # Display callw putx # item /* - * Now that we've printed the drive (if we needed to), display a prompt. + * Menu is complete, display a prompt followed by current selection. + * 'decw %si' makes the register point to the space after 'Boot: ' + * so we do not see an extra CRLF on the screen. */ -main.7: movw $prompt,%si # Display +print_prompt: movw $prompt,%si # Display callw putstr # prompt movb _OPT(%bp),%dl # Display decw %si # default callw putkey # key - jmp main.7_1 # Skip beep + jmp start_input # Skip beep + /* - * Users's last try was bad, beep in displeasure. + * Here we have the code waiting for user input or a timeout. */ -main.10: movb $ASCII_BEL,%al # Signal - callw putchr # beep! +beep: movb $ASCII_BEL,%al # Input error, print or beep + callw putchr + +start_input: /* - * Start of input loop. Take note of time + * Actual Start of input loop. Take note of time */ -main.7_1: xorb %ah,%ah # BIOS: Get + xorb %ah,%ah # BIOS: Get int $0x1a # system time movw %dx,%di # Ticks when addw _TICKS(%bp),%di # timeout +read_key: /* * Busy loop, looking for keystrokes but keeping one eye on the time. */ -main.8: #ifndef SIO movb $0x1,%ah # BIOS: Check int $0x16 # for keypress - jnz main.11 # Have one #else /* SIO */ movb $0x03,%ah # BIOS: Read COM call bioscom testb $0x01,%ah # Check line status - jnz main.11 # (bit 1 indicates input) + # (bit 1 indicates input) #endif /* SIO */ - xorb %ah,%ah # BIOS: Get - int $0x1a # system time + jnz got_key # Have input + xorb %ah,%ah # BIOS: int 0x1a, 00 + int $0x1a # get system time cmpw %di,%dx # Timeout? - jb main.8 # No + jb read_key # No + /* - * If timed out or defaulting, come here. + * Timed out or default selection */ -main.9: movb _OPT(%bp),%al # Load default - jmp main.12 # Join common code +use_default: movb _OPT(%bp),%al # Load default + orb $NOUPDATE,_FLAGS(%bp) # Disable updates + jmp check_selection # Join common code + /* * Get the keystroke. + * ENTER or CR confirm the current selection (same as a timeout). + * Otherwise convert F1..F6 (or '1'..'6') to 0..5 and check if the + * selection is valid. + * The SIO code uses ascii chars, the console code uses scancodes. */ -main.11: +got_key: #ifndef SIO - xorb %ah,%ah # BIOS: Get - int $0x16 # keypress - movb %ah,%al # Scan code + xorb %ah,%ah # BIOS: int 0x16, 00 + int $0x16 # get keypress + movb %ah,%al # move scan code to %al + cmpb $KEY_ENTER,%al #else movb $0x02,%ah # BIOS: Receive call bioscom + cmpb $ASCII_CR,%al #endif + je use_default # enter -> default /* - * If it's CR act as if timed out. - */ -#ifndef SIO - cmpb $KEY_ENTER,%al # Enter pressed? -#else - cmpb $ASCII_CR,%al # Enter pressed? -#endif - je main.9 # Yes -/* - * Otherwise check if legal. If not ask again. - */ -#ifndef SIO - subb $KEY_F1,%al # Less F1 scan code - cmpb $0x4,%al # F1..F5? - jna main.12 # Yes + * Check if the key is acceptable, and loop back if not. + * The console (non-SIO) code looks at scancodes and accepts + * both F1..F6 and 1..6 (the latter costs 6 bytes of code), + * relying on the fact that F1..F6 have higher scancodes than 1..6 + * The SIO code only takes 1..6 + */ +#ifdef SIO /* SIO mode, use ascii values */ + subb $'1',%al # Subtract '1' ascii code +#else /* console mode -- use scancodes */ + subb $KEY_F1,%al /* Subtract F1 scan code */ +#if !defined(ONLY_F_KEYS) + cmpb $0x5,%al # F1..F6 + jna 3f # Yes subb $(KEY_1 - KEY_F1),%al # Less #1 scan code -#else - subb $'1',%al # Less '1' ascii character -#endif - cmpb $0x4,%al # #1..#5? - ja main.10 # No + 3: +#endif /* ONLY_F_KEYS */ +#endif /* SIO */ + cmpb $0x5,%al # F1..F6 or 1..6 ? +#ifdef PXE /* enable PXE/INT18 using F6 */ + jne 1f; + int $0x18 # found F6, try INT18 + 1: +#endif /* PXE */ + jae beep # Not in F1..F5, beep + +check_selection: /* * We have a selection. If it's a bad selection go back to complain. * The bits in MNUOPT were set when the options were printed. * Anything not printed is not an option. */ -main.12: cbtw # Option - btw %ax,_MNUOPT(%bp) # enabled? - jnc main.10 # No + cbtw # Extend (%ah=0 used later) + btw %ax,_MNUOPT(%bp) # Option enabled? + jnc beep # No /* * Save the info in the original tables * for rewriting to the disk. */ movb %al,_OPT(%bp) # Save option - movw $FAKE,%si # Partition for write - movb (%si),%dl # Drive number + + /* + * Make %si and %bx point to the fake partition at LBA 0 (CHS 0:0:1). + * Because the correct address is already in %bp, just use it. + * Set %dl with the drive number saved in byte 0. + * If we have pressed F5 or 5, then this is a good, fake value + * to present to the next stage boot code. + */ + movw %bp,%si # Partition for write + movb (%si),%dl # Drive number, saved above movw %si,%bx # Partition for read cmpb $0x4,%al # F5/#5 pressed? - pushf # Save - je main.13 # Yes + pushf # Save results for later + je 1f # Yes, F5 + + /* + * F1..F4 was pressed, so make %bx point to the currently + * selected partition, and leave the drive number unchanged. + */ shlb $0x4,%al # Point to addw $partbl,%ax # selected xchgw %bx,%ax # partition movb $0x80,(%bx) # Flag active /* * If not asked to do a write-back (flags 0x40) don't do one. + * Around the call, save the partition pointer to %bx and + * restore to %si which is where the next stage expects it. */ -main.13: pushw %bx # Save - testb $0x40,_FLAGS(%bp) # No updates? - jnz main.14 # Yes + 1: pushw %bx # Save + testb $NOUPDATE,_FLAGS(%bp) # No updates? + jnz 2f # skip update movw $start,%bx # Data to write movb $0x3,%ah # Write sector callw intx13 # to disk -main.14: popw %si # Restore - popf # Restore + 2: popw %si # Restore + /* * If going to next drive, replace drive with selected one. * Remember to un-ascii it. Hey 0x80 is already set, cool! */ - jne main.15 # If not F5/#5 + popf # Restore %al test results + jne 3f # If not F5/#5 movb _NXTDRV(%bp),%dl # Next drive subb $'0',%dl # number /* - * Load selected bootsector to the LOAD location in RAM. - * If it fails to read or isn't marked bootable, treat it as a bad selection. + * Load selected bootsector to the LOAD location in RAM. If read + * fails or there is no 0x55aa marker, treat it as a bad selection. */ -main.15: movw $LOAD,%bx # Address for read + 3: movw $LOAD,%bx # Address for read movb $0x2,%ah # Read sector callw intx13 # from disk - jc main.10 # If error + jc beep # If error cmpw $MAGIC,0x1fe(%bx) # Bootable? - jne main.10 # No + jne beep # No pushw %si # Save ptr to selected part. callw putn # Leave some space popw %si # Restore, next stage uses it @@ -326,64 +496,80 @@ main.15: movw $LOAD,%bx # Address for /* * Display routines + * putkey prints the option selected in %dl (F1..F5 or 1..5) followed by + * the string at %si + * putx: print the option in %dl followed by the string at %di + * also record the drive as valid. + * putn: print a crlf + * putstr: print the string at %si + * putchr: print the char in al */ -putkey: -#ifndef SIO - movb $'F',%al # Display - callw putchr # 'F' -#endif - movb $'1',%al # Prepare - addb %dl,%al # digit - jmp putstr.1 # Display the rest /* - * Display the option and note that it is a valid option. - * That last point is a bit tricky.. + * Display the option and record the drive as valid in the options. + * That last point is done using the btsw instruction which does + * a test and set. We don't care for the test part. */ putx: btsw %dx,_MNUOPT(%bp) # Enable menu option movw $item,%si # Display callw putkey # key movw %di,%si # Display the rest - -puts: callw putstr # Display string + callw putstr # Display string putn: movw $crlf,%si # To next line + jmp putstr + +putkey: +#ifndef SIO + movb $'F',%al # Display + callw putchr # 'F' +#endif + movb $'1',%al # Prepare + addb %dl,%al # digit +putstr.1: callw putchr # Display char putstr: lodsb # Get byte testb $0x80,%al # End of string? - jnz putstr.2 # Yes -putstr.1: callw putchr # Display char - jmp putstr # Continue -putstr.2: andb $~0x80,%al # Clear MSB + jz putstr.1 # No + andb $~0x80,%al # Clear MSB then print last -#ifndef SIO putchr: +#ifndef SIO pushw %bx # Save movw $0x7,%bx # Page:attribute movb $0xe,%ah # BIOS: Display int $0x10 # character popw %bx # Restore - retw # To caller #else /* SIO */ -putchr: movb $0x01,%ah # BIOS: Send bioscom: pushw %dx # Save xorw %dx,%dx # Use COM1 int $0x14 # Character popw %dx # Restore - retw # To caller #endif /* SIO */ + retw # To caller /* One-sector disk I/O routine */ -intx13: movb 0x1(%si),%dh # Load head +/* + * %dl: drive, %si partition entry, %es:%bx transfer buffer. + * Load the CHS values and possibly the LBA address from the block + * at %si, and use the appropriate method to load the sector. + * Don't use packet mode for a floppy. + */ +intx13: # Prepare CHS parameters + movb 0x1(%si),%dh # Load head movw 0x2(%si),%cx # Load cylinder:sector movb $0x1,%al # Sector count pushw %si # Save movw %sp,%di # Save - testb $0x80,_FLAGS(%bp) # Use packet interface? - jz intx13.1 # No +#ifndef CHECK_DRIVE /* floppy support */ + testb %dl, %dl # is this a floppy ? + jz 1f # Yes, use CHS mode +#endif + testb $USEPACKET,_FLAGS(%bp) # Use packet interface? + jz 1f # No pushl $0x0 # Set the pushl 0x8(%si) # LBA address pushw %es # Set the transfer @@ -393,73 +579,104 @@ intx13: movb 0x1(%si),%dh # Load head movw %sp,%si # Packet pointer decw %ax # Verify off orb $0x40,%ah # Use disk packet -intx13.1: int $0x13 # BIOS: Disk I/O + 1: int $0x13 # BIOS: Disk I/O movw %di,%sp # Restore popw %si # Restore retw # To caller -/* Menu strings */ - +/* + * Various menu strings. 'item' goes after 'prompt' to save space. + * Also use shorter versions to make room for the PXE/INT18 code. + */ +prompt: +#ifdef PXE + .ascii "\nF6 PXE\r" +#endif + .ascii "\nBoot:" item: .ascii " "; .byte ' '|0x80 -prompt: .ascii "\nDefault:"; .byte ' '|0x80 crlf: .ascii "\r"; .byte '\n'|0x80 /* Partition type tables */ -tables: +bootable_ids: /* - * These entries identify invalid or NON BOOT types and partitions. - */ - .byte 0x0, 0x5, 0xf + * These values indicate bootable types we know about. + * Corresponding descriptions are at desc_ofs: + * Entries don't need to be sorted. + */ + .byte 0x83, 0xa5, 0xa6, 0xa9, 0x06, 0x07, 0x0b +#ifndef SAVE_MORE_MEMORY + .byte 0x05 # extended partition +#endif +#ifndef SAVE_MEMORY /* other DOS partitions */ + .byte 0x01 # FAT12 + .byte 0x04 # FAT16 < 32M +#endif + +desc_ofs: /* - * These values indicate bootable types we know the names of. - */ - .byte 0x1, 0x6, 0x7, 0xb, 0xc, 0xe, 0x83 - .byte 0xa5, 0xa6, 0xa9 -/* - * These are offsets that match the known names above and point to the strings - * that will be printed. os_misc will be used if the search of the above table - * runs over. - */ - .byte os_dos-. # DOS - .byte os_dos-. # DOS - .byte os_dos-. # Windows - .byte os_dos-. # Windows - .byte os_dos-. # Windows - .byte os_dos-. # Windows - .byte os_linux-. # Linux - .byte os_freebsd-. # FreeBSD - .byte os_bsd-. # OpenBSD - .byte os_bsd-. # NetBSD + * Offsets that match the known types above, used to point to the + * actual partition name. The last entry must point to os_misc, + * which is used for non-matching names. + */ + .byte os_linux-. # 131, Linux + .byte os_freebsd-. # 165, FreeBSD + .byte os_bsd-. # 166, OpenBSD + .byte os_bsd-. # 169, NetBSD + .byte os_dos-. # 6, FAT16 >= 32M + .byte os_win-. # 7, NTFS + .byte os_win-. # 11, FAT32 + +#ifndef SAVE_MORE_MEMORY + .byte os_ext-. # 5, DOS Ext +#endif +#ifndef SAVE_MEMORY + .byte os_dos-. # 1, FAT12 DOS + .byte os_dos-. # 4, FAT16 <32M +#endif .byte os_misc-. # Unknown + /* - * And here are the strings themselves. 0x80 or'd into a byte indicates - * the end of the string. (not so great for Russians but...) + * And here are the strings themselves. The last byte of + * the string has bit 7 set. */ -os_misc: .ascii "?"; .byte '?'|0x80 -os_dos: .ascii "DO"; .byte 'S'|0x80 +os_misc: .byte '?'|0x80 +os_dos: +#ifndef SAVE_MORE_MEMORY /* 'DOS' remapped to 'WIN' if no room */ + .ascii "DO"; .byte 'S'|0x80 +#endif +os_win: .ascii "Wi"; .byte 'n'|0x80 os_linux: .ascii "Linu"; .byte 'x'|0x80 os_freebsd: .ascii "Free" os_bsd: .ascii "BS"; .byte 'D'|0x80 +#ifndef SAVE_MORE_MEMORY +os_ext: .ascii "EX"; .byte 'T'|0x80 +#endif - .org PRT_OFF-0xe,0x90 - - .word B0MAGIC # Magic number - + .org (0x200 + B0_OFF),0x90 /* - * These values are sometimes changed before writing back to the drive + * The boot0 version 1.0 parameter table. + * Do not move it nor change the "Drive " string, boot0cfg + * uses its offset and content to identify the boot sector. + * The other fields are sometimes changed before writing back to the drive * Be especially careful that nxtdrv: must come after drive:, as it * is part of the same string. */ drive: .ascii "Drive " nxtdrv: .byte 0x0 # Next drive number opt: .byte 0x0 # Option -setdrv: .byte 0x80 # Drive to force +setdrv_num: .byte 0x80 # Drive to force flags: .byte FLAGS # Flags +#ifdef VOLUME_SERIAL + .byte 0xa8,0xa8,0xa8,0xa8 # Volume Serial Number +#endif ticks: .word TICKS # Delay + .org PRT_OFF /* * Here is the 64 byte partition table that fdisk would fiddle with. */ partbl: .fill 0x40,0x1,0x0 # Partition table .word MAGIC # Magic number + .org 0x200 # again, safety check +endblock: Modified: stable/7/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/7/usr.sbin/boot0cfg/boot0cfg.8 Tue Jan 13 22:15:47 2009 (r187197) +++ stable/7/usr.sbin/boot0cfg/boot0cfg.8 Tue Jan 13 22:28:48 2009 (r187198) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2007 +.Dd January 13, 2009 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -35,7 +35,9 @@ .Op Fl Bv .Op Fl b Ar boot0 .Op Fl d Ar drive +.Op Fl e Ar bell character .Op Fl f Ar file +.Op Fl i Ar volume-id .Op Fl m Ar mask .Op Fl o Ar options .Op Fl s Ar slice @@ -96,10 +98,17 @@ which contains the specified Typically this will be 0x80 for the first hard drive, 0x81 for the second hard drive, and so on; however any integer between 0 and 0xff is acceptable here. +.It Fl e Ar bell character +Set the character to be printed in case of input error. .It Fl f Ar file Specify that a backup copy of the preexisting MBR should be written to .Ar file . This file is created if it does not exist, and replaced if it does. +.It Fl i Ar volume-id +Specifies a volume-id (in the form XXXX-XXXX) to be saved at location +0x1b8 in the MBR. This information is sometimes used by NT, XP and Vista +to identify the disk drive. The option is only compatible with version 2.00 +of the 512-byte boot block. .It Fl m Ar mask Specify slices to be enabled/disabled, where .Ar mask @@ -144,6 +153,21 @@ Set the timeout value to .It Fl v Verbose: display information about the slices defined, etc. .El +.Sh NOTE +Protection mechanisms in the +.Xr geom 4 +subsystem might prevent +.Nm +from being able to update the MBR on a mounted disk. +Instructions for temporarily disabling these protection mechanisms +can be found in the +.Xr geom 4 +manpage. Specifically, do a +.Pp +.Dl sysctl kern.geom.debugflags=0x10 +.Pp +to allow writing to the MBR, and restore it to 0 afterwards. +.Pp .Sh FILES .Bl -tag -width /boot/boot0sio -compact .It Pa /boot/boot0 @@ -177,16 +201,6 @@ to install the default MBR: .Sh AUTHORS .An Robert Nordier Aq rnordier@FreeBSD.org . .Sh BUGS -Protection mechanisms in the -.Xr geom 4 -subsystem might prevent -.Nm -from being able to update the MBR on a mounted disk. -Instructions for temporarily disabling these protection mechanisms -can be found in the -.Xr geom 4 -manpage. -.Pp Use of the .Sq packet option may cause @@ -195,6 +209,6 @@ to fail, depending on the nature of BIOS .Pp Use of the .Sq setdrv -option with an incorrect -d operand may cause the MBR to be written -to the wrong disk. -Be careful! +option with an incorrect -d operand may cause the boot0 code +to write the MBR to the wrong disk, thus trashing its previous +content. Be careful. Modified: stable/7/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- stable/7/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 13 22:15:47 2009 (r187197) +++ stable/7/usr.sbin/boot0cfg/boot0cfg.c Tue Jan 13 22:28:48 2009 (r187198) @@ -1,4 +1,5 @@ /* + * Copyright (c) 2008 Luigi Rizzo * Copyright (c) 1999 Robert Nordier * All rights reserved. * @@ -44,13 +45,34 @@ __FBSDID("$FreeBSD$"); #define MBRSIZE 512 /* master boot record size */ -#define OFF_VERSION 0x1b0 /* offset: version number */ -#define OFF_OPT 0x1b9 /* offset: default boot option */ -#define OFF_DRIVE 0x1ba /* offset: setdrv drive */ -#define OFF_FLAGS 0x1bb /* offset: option flags */ -#define OFF_TICKS 0x1bc /* offset: clock ticks */ +#define OFF_VERSION 0x1b0 /* offset: version number, only boot0version */ +#define OFF_SERIAL 0x1b8 /* offset: volume serial number */ #define OFF_PTBL 0x1be /* offset: partition table */ #define OFF_MAGIC 0x1fe /* offset: magic number */ +/* + * Offsets to the parameters of the 512-byte boot block. + * For historical reasons they are set as macros + */ +struct opt_offsets { + int opt; + int drive; + int flags; + int ticks; +}; + +struct opt_offsets b0_ofs[] = { + { 0x0, 0x0, 0x0, 0x0 }, /* no boot block */ + { 0x1b9, 0x1ba, 0x1bb, 0x1bc }, /* original block */ + { 0x1b5, 0x1b6, 0x1b7, 0x1bc }, /* NT_SERIAL block */ +}; + +int b0_ver; /* boot block version set by boot0bs */ + +#define OFF_OPT (b0_ofs[b0_ver].opt) /* default boot option */ +#define OFF_DRIVE (b0_ofs[b0_ver].drive) /* setdrv drive */ +#define OFF_FLAGS (b0_ofs[b0_ver].flags) /* option flags */ +#define OFF_TICKS (b0_ofs[b0_ver].ticks) /* clock ticks */ + #define cv2(p) ((p)[0] | (p)[1] << 010) @@ -82,8 +104,12 @@ static int boot0bs(const u_int8_t *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 22:35:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F4DB10656F9; Tue, 13 Jan 2009 22:35:27 +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 EC70F8FC1D; Tue, 13 Jan 2009 22:35:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DMZQKn018363; Tue, 13 Jan 2009 22:35:26 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DMZQ3J018362; Tue, 13 Jan 2009 22:35:26 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901132235.n0DMZQ3J018362@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 13 Jan 2009 22:35: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: r187199 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:35:36 -0000 Author: trasz Date: Tue Jan 13 22:35:26 2009 New Revision: 187199 URL: http://svn.freebsd.org/changeset/base/187199 Log: Turn a "panic: non-decreasing id" into an error printf. This seems to be caused by a metadata corruption that occurs quite often after unplugging a pendrive during write activity. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/fs/msdosfs/msdosfs_conv.c Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Tue Jan 13 22:28:48 2009 (r187198) +++ head/sys/fs/msdosfs/msdosfs_conv.c Tue Jan 13 22:35:26 2009 (r187199) @@ -1060,8 +1060,11 @@ mbnambuf_write(struct mbnambuf *nbp, cha char *slot; size_t count, newlen; - KASSERT(nbp->nb_len == 0 || id == nbp->nb_last_id - 1, - ("non-decreasing id: id %d, last id %d", id, nbp->nb_last_id)); + if (nbp->nb_len != 0 && id != nbp->nb_last_id - 1) { + printf("msdosfs: non-decreasing id: id %d, last id %d\n", + id, nbp->nb_last_id); + return; + } /* Will store this substring in a WIN_CHARS-aligned slot. */ slot = &nbp->nb_buf[id * WIN_CHARS]; From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 22:46:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6DF510659AB; Tue, 13 Jan 2009 22:46:24 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1C218FC29; Tue, 13 Jan 2009 22:46:24 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DMkORU018606; Tue, 13 Jan 2009 22:46:24 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DMkOUw018605; Tue, 13 Jan 2009 22:46:24 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132246.n0DMkOUw018605@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 22:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187200 - stable/7/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:46:26 -0000 Author: luigi Date: Tue Jan 13 22:46:24 2009 New Revision: 187200 URL: http://svn.freebsd.org/changeset/base/187200 Log: MFC from rev.185643 and 186799 Some libstand/bootp.c extension (written by Danny Braniss, slightly revised/modified by me) to store dhcp options into kenv variables, so the information is available to the boot loader and can be used to customize the boot process. Modified: stable/7/lib/libstand/bootp.c Modified: stable/7/lib/libstand/bootp.c ============================================================================== --- stable/7/lib/libstand/bootp.c Tue Jan 13 22:35:26 2009 (r187199) +++ stable/7/lib/libstand/bootp.c Tue Jan 13 22:46:24 2009 (r187200) @@ -47,6 +47,12 @@ __FBSDID("$FreeBSD$"); #define BOOTP_DEBUGxx #define SUPPORT_DHCP +#define DHCP_ENV_NOVENDOR 1 /* do not parse vendor options */ +#define DHCP_ENV_PXE 10 /* assume pxe vendor options */ +#define DHCP_ENV_FREEBSD 11 /* assume freebsd vendor options +/* set DHCP_ENV to one of the values above to export dhcp options to kenv */ +#define DHCP_ENV DHCP_ENV_NO_VENDOR + #include "stand.h" #include "net.h" #include "netif.h" @@ -72,6 +78,13 @@ static int vend_rfc1048(u_char *, u_int) static void vend_cmu(u_char *); #endif +#ifdef DHCP_ENV /* export the dhcp response to kenv */ +struct dhcp_opt; +static void setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts); +#else +#define setenv_(a, b, c) +#endif + #ifdef SUPPORT_DHCP static char expected_dhcpmsgtype = -1, dhcp_ok; struct in_addr dhcp_serverip; @@ -351,6 +364,8 @@ vend_rfc1048(cp, len) /* Step over magic cookie */ cp += sizeof(int); + setenv_(cp, ep, NULL); + while (cp < ep) { tag = *cp++; size = *cp++; @@ -412,3 +427,316 @@ vend_cmu(cp) } } #endif + +#ifdef DHCP_ENV +/* + * Parse DHCP options and store them into kenv variables. + * Original code from Danny Braniss, modifications by Luigi Rizzo. + * + * The parser is driven by tables which specify the type and name of + * each dhcp option and how it appears in kenv. + * The first entry in the list contains the prefix used to set the kenv + * name (including the . if needed), the last entry must have a 0 tag. + * Entries do not need to be sorted though it helps for readability. + * + * Certain vendor-specific tables can be enabled according to DHCP_ENV. + * Set it to 0 if you don't want any. + */ +enum opt_fmt { __NONE = 0, + __8 = 1, __16 = 2, __32 = 4, /* Unsigned fields, value=size */ + __IP, /* IPv4 address */ + __TXT, /* C string */ + __BYTES, /* byte sequence, printed %02x */ + __INDIR, /* name=value */ + __ILIST, /* name=value;name=value ... */ + __VE, /* vendor specific, recurse */ +}; + +struct dhcp_opt { + uint8_t tag; + uint8_t fmt; + const char *desc; +}; + +static struct dhcp_opt vndr_opt[] = { /* Vendor Specific Options */ +#if DHCP_ENV == DHCP_ENV_FREEBSD /* FreeBSD table in the original code */ + {0, 0, "FreeBSD"}, /* prefix */ + {1, __TXT, "kernel"}, + {2, __TXT, "kernelname"}, + {3, __TXT, "kernel_options"}, + {4, __IP, "usr-ip"}, + {5, __TXT, "conf-path"}, + {6, __TXT, "rc.conf0"}, + {7, __TXT, "rc.conf1"}, + {8, __TXT, "rc.conf2"}, + {9, __TXT, "rc.conf3"}, + {10, __TXT, "rc.conf4"}, + {11, __TXT, "rc.conf5"}, + {12, __TXT, "rc.conf6"}, + {13, __TXT, "rc.conf7"}, + {14, __TXT, "rc.conf8"}, + {15, __TXT, "rc.conf9"}, + + {20, __TXT, "boot.nfsroot.options"}, + + {245, __INDIR, ""}, + {246, __INDIR, ""}, + {247, __INDIR, ""}, + {248, __INDIR, ""}, + {249, __INDIR, ""}, + {250, __INDIR, ""}, + {251, __INDIR, ""}, + {252, __INDIR, ""}, + {253, __INDIR, ""}, + {254, __INDIR, ""}, + +#elif DHCP_ENV == DHCP_ENV_PXE /* some pxe options, RFC4578 */ + {0, 0, "pxe"}, /* prefix */ + {93, __16, "system-architecture"}, + {94, __BYTES, "network-interface"}, + {97, __BYTES, "machine-identifier"}, +#else /* default (empty) table */ + {0, 0, "dhcp.vendor."}, /* prefix */ +#endif + {0, __TXT, "%soption-%d"} +}; + +static struct dhcp_opt dhcp_opt[] = { + /* DHCP Option names, formats and codes, from RFC2132. */ + {0, 0, "dhcp."}, // prefix + {1, __IP, "subnet-mask"}, + {2, __32, "time-offset"}, /* this is signed */ + {3, __IP, "routers"}, + {4, __IP, "time-servers"}, + {5, __IP, "ien116-name-servers"}, + {6, __IP, "domain-name-servers"}, + {7, __IP, "log-servers"}, + {8, __IP, "cookie-servers"}, + {9, __IP, "lpr-servers"}, + {10, __IP, "impress-servers"}, + {11, __IP, "resource-location-servers"}, + {12, __TXT, "host-name"}, + {13, __16, "boot-size"}, + {14, __TXT, "merit-dump"}, + {15, __TXT, "domain-name"}, + {16, __IP, "swap-server"}, + {17, __TXT, "root-path"}, + {18, __TXT, "extensions-path"}, + {19, __8, "ip-forwarding"}, + {20, __8, "non-local-source-routing"}, + {21, __IP, "policy-filter"}, + {22, __16, "max-dgram-reassembly"}, + {23, __8, "default-ip-ttl"}, + {24, __32, "path-mtu-aging-timeout"}, + {25, __16, "path-mtu-plateau-table"}, + {26, __16, "interface-mtu"}, + {27, __8, "all-subnets-local"}, + {28, __IP, "broadcast-address"}, + {29, __8, "perform-mask-discovery"}, + {30, __8, "mask-supplier"}, + {31, __8, "perform-router-discovery"}, + {32, __IP, "router-solicitation-address"}, + {33, __IP, "static-routes"}, + {34, __8, "trailer-encapsulation"}, + {35, __32, "arp-cache-timeout"}, + {36, __8, "ieee802-3-encapsulation"}, + {37, __8, "default-tcp-ttl"}, + {38, __32, "tcp-keepalive-interval"}, + {39, __8, "tcp-keepalive-garbage"}, + {40, __TXT, "nis-domain"}, + {41, __IP, "nis-servers"}, + {42, __IP, "ntp-servers"}, + {43, __VE, "vendor-encapsulated-options"}, + {44, __IP, "netbios-name-servers"}, + {45, __IP, "netbios-dd-server"}, + {46, __8, "netbios-node-type"}, + {47, __TXT, "netbios-scope"}, + {48, __IP, "x-font-servers"}, + {49, __IP, "x-display-managers"}, + {50, __IP, "dhcp-requested-address"}, + {51, __32, "dhcp-lease-time"}, + {52, __8, "dhcp-option-overload"}, + {53, __8, "dhcp-message-type"}, + {54, __IP, "dhcp-server-identifier"}, + {55, __8, "dhcp-parameter-request-list"}, + {56, __TXT, "dhcp-message"}, + {57, __16, "dhcp-max-message-size"}, + {58, __32, "dhcp-renewal-time"}, + {59, __32, "dhcp-rebinding-time"}, + {60, __TXT, "vendor-class-identifier"}, + {61, __TXT, "dhcp-client-identifier"}, + {64, __TXT, "nisplus-domain"}, + {65, __IP, "nisplus-servers"}, + {66, __TXT, "tftp-server-name"}, + {67, __TXT, "bootfile-name"}, + {68, __IP, "mobile-ip-home-agent"}, + {69, __IP, "smtp-server"}, + {70, __IP, "pop-server"}, + {71, __IP, "nntp-server"}, + {72, __IP, "www-server"}, + {73, __IP, "finger-server"}, + {74, __IP, "irc-server"}, + {75, __IP, "streettalk-server"}, + {76, __IP, "streettalk-directory-assistance-server"}, + {77, __TXT, "user-class"}, + {85, __IP, "nds-servers"}, + {86, __TXT, "nds-tree-name"}, + {87, __TXT, "nds-context"}, + {210, __TXT, "authenticate"}, + + /* use the following entries for arbitrary variables */ + {246, __ILIST, ""}, + {247, __ILIST, ""}, + {248, __ILIST, ""}, + {249, __ILIST, ""}, + {250, __INDIR, ""}, + {251, __INDIR, ""}, + {252, __INDIR, ""}, + {253, __INDIR, ""}, + {254, __INDIR, ""}, + {0, __TXT, "%soption-%d"} +}; + +/* + * parse a dhcp response, set environment variables translating options + * names and values according to the tables above. Also set dhcp.tags + * to the list of selected tags. + */ +static void +setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts) +{ + u_char *ncp; + u_char tag; + char tags[512], *tp; /* the list of tags */ + +#define FLD_SEP ',' /* separator in list of elements */ + ncp = cp; + tp = tags; + if (opts == NULL) + opts = dhcp_opt; + + while (ncp < ep) { + unsigned int size; /* option size */ + char *vp, *endv, buf[256]; /* the value buffer */ + struct dhcp_opt *op; + + tag = *ncp++; /* extract tag and size */ + size = *ncp++; + cp = ncp; /* current payload */ + ncp += size; /* point to the next option */ + + if (tag == TAG_END) + break; + if (tag == 0) + continue; + + for (op = opts+1; op->tag && op->tag != tag; op++) + ; + /* if not found we end up on the default entry */ + + /* + * Copy data into the buffer. libstand does not have snprintf so we + * need to be careful with sprintf(). With strings, the source is + * always <256 char so shorter than the buffer so we are safe; with + * other arguments, the longest string is inet_ntoa which is 16 bytes + * so we make sure to have always enough room in the string before + * trying an sprint. + */ + vp = buf; + *vp = '\0'; + endv = buf + sizeof(buf) - 1 - 16; /* last valid write position */ + + switch(op->fmt) { + case __NONE: + break; /* should not happen */ + + case __VE: /* recurse, vendor specific */ + setenv_(cp, cp+size, vndr_opt); + break; + + case __IP: /* ip address */ + for (; size > 0 && vp < endv; size -= 4, cp += 4) { + struct in_addr in_ip; /* ip addresses */ + if (vp != buf) + *vp++ = FLD_SEP; + bcopy(cp, &in_ip.s_addr, sizeof(in_ip.s_addr)); + sprintf(vp, "%s", inet_ntoa(in_ip)); + vp += strlen(vp); + } + break; + + case __BYTES: /* opaque byte string */ + for (; size > 0 && vp < endv; size -= 1, cp += 1) { + sprintf(vp, "%02x", *cp); + vp += strlen(vp); + } + break; + + case __TXT: + bcopy(cp, buf, size); /* cannot overflow */ + buf[size] = 0; + break; + + case __32: + case __16: + case __8: /* op->fmt is also the length of each field */ + for (; size > 0 && vp < endv; size -= op->fmt, cp += op->fmt) { + uint32_t v; + if (op->fmt == __32) + v = (cp[0]<<24) + (cp[1]<<16) + (cp[2]<<8) + cp[3]; + else if (op->fmt == __16) + v = (cp[0]<<8) + cp[1]; + else + v = cp[0]; + if (vp != buf) + *vp++ = FLD_SEP; + sprintf(vp, "%u", v); + vp += strlen(vp); + } + break; + + case __INDIR: /* name=value */ + case __ILIST: /* name=value;name=value... */ + bcopy(cp, buf, size); /* cannot overflow */ + buf[size] = '\0'; + for (endv = buf; endv; endv = vp) { + u_char *s = NULL; /* semicolon ? */ + + /* skip leading whitespace */ + while (*endv && index(" \t\n\r", *endv)) + endv++; + vp = index(endv, '='); /* find name=value separator */ + if (!vp) + break; + *vp++ = 0; + if (op->fmt == __ILIST && (s = index(vp, ';'))) + *s++ = '\0'; + setenv(endv, vp, 1); + vp = s; /* prepare for next round */ + } + buf[0] = '\0'; /* option already done */ + } + + if (tp - tags < sizeof(tags) - 5) { /* add tag to the list */ + if (tp != tags) + *tp++ = FLD_SEP; + sprintf(tp, "%d", tag); + tp += strlen(tp); + } + if (buf[0]) { + char env[128]; /* the string name */ + + if (op->tag == 0) + sprintf(env, op->desc, opts[0].desc, tag); + else + sprintf(env, "%s%s", opts[0].desc, op->desc); + setenv(env, buf, 1); + } + } + if (tp != tags) { + char env[128]; /* the string name */ + sprintf(env, "%stags", opts[0].desc); + setenv(env, tags, 1); + } +} +#endif /* additional dhcp */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 22:59:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D52AF106645D; Tue, 13 Jan 2009 22:59:47 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id A434C8FC16; Tue, 13 Jan 2009 22:59:47 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n0DMxiio014392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Jan 2009 14:59:45 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <496D1CE0.40401@freebsd.org> Date: Tue, 13 Jan 2009 14:59:44 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Stanislav Sedov References: <200901131901.n0DJ1EF1011980@svn.freebsd.org> <20090114012719.6145076a.stas@FreeBSD.org> In-Reply-To: <20090114012719.6145076a.stas@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrew Thompson , Hans Petter Selasky Subject: Re: svn commit: r187162 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 22:59:51 -0000 Stanislav Sedov wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi! > > Would it make sense to rename usbconfig to something like "usbcontrol" > to follow the *control tradition (cdcontrol, pmccontrol, vidcontrol, and so on)? > I don't care what it's called but I think it is important that a (sym)link to it named usbdevs w/ provide output that is compatible w/ the old tool. Sam From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 23:02:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B99F10657D2; Tue, 13 Jan 2009 23:02:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 012488FC16; Tue, 13 Jan 2009 23:02:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DN2sEZ019019; Tue, 13 Jan 2009 23:02:54 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DN2sUX019014; Tue, 13 Jan 2009 23:02:54 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132302.n0DN2sUX019014@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 23:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187201 - stable/7/usr.sbin/kldxref X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 23:02:59 -0000 Author: luigi Date: Tue Jan 13 23:02:54 2009 New Revision: 187201 URL: http://svn.freebsd.org/changeset/base/187201 Log: MFC: rev. 185475, 186824, 186826, 186827 various cleanups including: + check a possible buffer overflow when creating a temp file, submitted by Christoph Mallon + remove stale struct definitions + clarify the use of dflag and remove useless checks + Make the linker.hints file have mode 644 instead of 600. + fix a couple of innocuous compiler warnings + correct description of how a string is stored, fix a few typos and reference the kernel file which processes this info. Modified: stable/7/usr.sbin/kldxref/Makefile stable/7/usr.sbin/kldxref/ef_i386.c stable/7/usr.sbin/kldxref/ef_obj.c stable/7/usr.sbin/kldxref/fileformat stable/7/usr.sbin/kldxref/kldxref.c Modified: stable/7/usr.sbin/kldxref/Makefile ============================================================================== --- stable/7/usr.sbin/kldxref/Makefile Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/Makefile Tue Jan 13 23:02:54 2009 (r187201) @@ -5,6 +5,7 @@ MAN= kldxref.8 SRCS= kldxref.c ef.c ef_obj.c WARNS?= 2 +CFLAGS+=-fno-strict-aliasing .if exists(ef_${MACHINE_ARCH}.c) SRCS+= ef_${MACHINE_ARCH}.c Modified: stable/7/usr.sbin/kldxref/ef_i386.c ============================================================================== --- stable/7/usr.sbin/kldxref/ef_i386.c Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/ef_i386.c Tue Jan 13 23:02:54 2009 (r187201) @@ -43,12 +43,13 @@ */ int ef_reloc(struct elf_file *ef, const void *reldata, int reltype, Elf_Off relbase, - Elf_Off dataoff, size_t len, void *dest) + Elf_Off dataoff, size_t len, void *_dest) { Elf_Addr *where, addr, addend; Elf_Size rtype, symidx; const Elf_Rel *rel; const Elf_Rela *rela; + char *dest = _dest; switch (reltype) { case EF_RELOC_REL: Modified: stable/7/usr.sbin/kldxref/ef_obj.c ============================================================================== --- stable/7/usr.sbin/kldxref/ef_obj.c Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/ef_obj.c Tue Jan 13 23:02:54 2009 (r187201) @@ -133,7 +133,7 @@ static struct elf_file_ops ef_obj_file_o }; static int -ef_obj_get_type(elf_file_t ef) +ef_obj_get_type(elf_file_t __unused ef) { return (EFT_KLD); @@ -180,7 +180,7 @@ ef_obj_symaddr(elf_file_t ef, Elf_Size s { const Elf_Sym *sym; - if (symidx >= ef->ddbsymcnt) + if (symidx >= (size_t) ef->ddbsymcnt) return (0); sym = ef->ddbsymtab + symidx; Modified: stable/7/usr.sbin/kldxref/fileformat ============================================================================== --- stable/7/usr.sbin/kldxref/fileformat Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/fileformat Tue Jan 13 23:02:54 2009 (r187201) @@ -1,7 +1,9 @@ $FreeBSD$ - linker.hints file consists from the one or more records. First record of -file is special and determines its version: +linker.hints file consists from the one or more records, +and is processed by sys/kern/kern_linker.c::linker_hints_lookup() + +First record of file is special and determines its version: int version; @@ -16,25 +18,28 @@ struct record { 'data' determines its type: struct data { - int type; /* type of data. currently MTD_* values */ + int type; /* type of data. currently MDT_* values */ }; The rest of record depends on the type. struct string { - int length; /* length of string */ + uint8_t length; /* length of string */ char val[]; /* string itself (no terminating zero) */ }; struct data_mdt_version { int type = MDT_VERSION; struct string modname; + /* padding */ int version; struct string kldname; + /* padding */ }; struct data_mdt_module { - int type = MDT_VERSION; + int type = MDT_MODULE; struct string modname; struct string kldname; + /* padding */ }; Modified: stable/7/usr.sbin/kldxref/kldxref.c ============================================================================== --- stable/7/usr.sbin/kldxref/kldxref.c Tue Jan 13 22:46:24 2009 (r187200) +++ stable/7/usr.sbin/kldxref/kldxref.c Tue Jan 13 23:02:54 2009 (r187201) @@ -57,37 +57,19 @@ #define MAXRECSIZE 1024 #define check(val) if ((error = (val)) != 0) break -#ifndef min -#define min(a,b) (((a)<(b)) ? (a) : (b)) -#endif - -struct mod_info { - char* mi_name; - int mi_ver; - SLIST_ENTRY(mod_info) mi_next; -}; - -#ifdef notnow -struct kld_info { - char* k_filename; - SLIST_HEAD(mod_list_head, mod_info) k_modules; - SLIST_ENTRY(kld_info) k_next; -}; +static int dflag; /* do not create a hint file, only write on stdout */ +static int verbose; -SLIST_HEAD(kld_list_head, kld_info) kldlist; -#endif - -static int dflag, verbose; - -FILE *fxref; +static FILE *fxref; /* current hints file */ static const char *xref_file = "linker.hints"; +/* + * A record is stored in the static buffer recbuf before going to disk. + */ static char recbuf[MAXRECSIZE]; -static int recpos, reccnt; - -FILE *maketempfile(char *, const char *); -static void usage(void); +static int recpos; /* current write position */ +static int reccnt; /* total record written to this file so far */ static void intalign(void) @@ -105,7 +87,7 @@ record_start(void) static int record_end(void) { - if (dflag || recpos == 0) + if (recpos == 0) return 0; reccnt++; intalign(); @@ -123,6 +105,9 @@ record_buf(const void *buf, int size) return 0; } +/* + * An int is stored in host order and aligned + */ static int record_int(int val) { @@ -130,21 +115,21 @@ record_int(int val) return record_buf(&val, sizeof(val)); } -static int -record_byte(u_char val) -{ - return record_buf(&val, sizeof(val)); -} - +/* + * A string is stored as 1-byte length plus data, no padding + */ static int record_string(const char *str) { - int len = strlen(str); - int error; - + int len, error; + u_char val; + if (dflag) return 0; - error = record_byte(len); + val = len = strlen(str); + if (len > 255) + errx(1, "string %s too long", str); + error = record_buf(&val, sizeof(val)); if (error) return error; return record_buf(str, len); @@ -170,21 +155,23 @@ parse_entry(struct mod_metadata *md, con break; case MDT_VERSION: check(EF_SEG_READ(ef, data, sizeof(mdv), &mdv)); - record_int(MDT_VERSION); - record_string(cval); - record_int(mdv.mv_version); - record_string(kldname); - if (!dflag) - break; - printf(" interface %s.%d\n", cval, mdv.mv_version); + if (dflag) { + printf(" interface %s.%d\n", cval, mdv.mv_version); + } else { + record_int(MDT_VERSION); + record_string(cval); + record_int(mdv.mv_version); + record_string(kldname); + } break; case MDT_MODULE: - record_int(MDT_MODULE); - record_string(cval); - record_string(kldname); - if (!dflag) - break; - printf(" module %s\n", cval); + if (dflag) { + printf(" module %s\n", cval); + } else { + record_int(MDT_MODULE); + record_string(cval); + record_string(kldname); + } break; default: warnx("unknown metadata record %d in file %s", md->md_type, kldname); @@ -199,8 +186,6 @@ read_kld(char *filename, char *kldname) { struct mod_metadata md; struct elf_file ef; -/* struct kld_info *kip; - struct mod_info *mip;*/ void **p, **orgp; int error, eftype, nmlen; long start, finish, entries; @@ -224,8 +209,9 @@ read_kld(char *filename, char *kldname) } if (!dflag) { cp = strrchr(kldname, '.'); - nmlen = cp ? min(MAXMODNAME, cp - kldname) : - min(MAXMODNAME, strlen(kldname)); + nmlen = (cp != NULL) ? cp - kldname : (int)strlen(kldname); + if (nmlen > MAXMODNAME) + nmlen = MAXMODNAME; strlcpy(kldmodname, kldname, nmlen); /* fprintf(fxref, "%s:%s:%d\n", kldmodname, kldname, 0);*/ } @@ -252,25 +238,43 @@ read_kld(char *filename, char *kldname) return error; } -FILE * +/* + * Create a temp file in directory root, make sure we don't + * overflow the buffer for the destination name + */ +static FILE * maketempfile(char *dest, const char *root) { char *p; - int fd; + int n, fd; - strlcpy(dest, root, MAXPATHLEN); + p = strrchr(root, '/'); + n = p != NULL ? p - root + 1 : 0; + if (snprintf(dest, MAXPATHLEN, "%.*slhint.XXXXXX", n, root) >= + MAXPATHLEN) { + errno = ENAMETOOLONG; + return NULL; + } - if ((p = strrchr(dest, '/')) != 0) - p++; - else - p = dest; - strcpy(p, "lhint.XXXXXX"); fd = mkstemp(dest); - return ((fd == -1) ? NULL : fdopen(fd, "w+")); + if (fd < 0) + return NULL; + fchmod(fd, 0644); /* nothing secret in the file */ + return fdopen(fd, "w+"); } static char xrefname[MAXPATHLEN], tempname[MAXPATHLEN]; +static void +usage(void) +{ + + fprintf(stderr, "%s\n", + "usage: kldxref [-Rdv] [-f hintsfile] path ..." + ); + exit(1); +} + int main(int argc, char *argv[]) { @@ -280,20 +284,19 @@ main(int argc, char *argv[]) struct stat sb; fts_options = FTS_PHYSICAL; -/* SLIST_INIT(&kldlist);*/ while ((opt = getopt(argc, argv, "Rdf:v")) != -1) { switch (opt) { - case 'd': + case 'd': /* no hint file, only print on stdout */ dflag = 1; break; - case 'f': + case 'f': /* use this name instead of linker.hints */ xref_file = optarg; break; case 'v': verbose++; break; - case 'R': + case 'R': /* recurse on directories */ fts_options |= FTS_COMFOLLOW; break; default: @@ -319,19 +322,22 @@ main(int argc, char *argv[]) for (;;) { p = fts_read(ftsp); - if ((p == NULL || p->fts_info == FTS_D) && !dflag && fxref) { + if ((p == NULL || p->fts_info == FTS_D) && fxref) { + /* close and rename the current hint file */ fclose(fxref); fxref = NULL; if (reccnt) { rename(tempname, xrefname); } else { + /* didn't find any entry, ignore this file */ unlink(tempname); unlink(xrefname); } } if (p == NULL) break; - if (p && p->fts_info == FTS_D && !dflag) { + if (p->fts_info == FTS_D && !dflag) { + /* visiting a new directory, create a new hint file */ snprintf(xrefname, sizeof(xrefname), "%s/%s", ftsp->fts_path, xref_file); fxref = maketempfile(tempname, ftsp->fts_path); @@ -341,6 +347,7 @@ main(int argc, char *argv[]) fwrite(&ival, sizeof(ival), 1, fxref); reccnt = 0; } + /* skip non-files or .symbols entries */ if (p->fts_info != FTS_F) continue; if (p->fts_namelen >= 8 && @@ -351,13 +358,3 @@ main(int argc, char *argv[]) fts_close(ftsp); return 0; } - -static void -usage(void) -{ - - fprintf(stderr, "%s\n", - "usage: kldxref [-Rdv] [-f hintsfile] path ..." - ); - exit(1); -} From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 23:03:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38CBE1065BAE; Tue, 13 Jan 2009 23:03:08 +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 1F37B8FC1E; Tue, 13 Jan 2009 23:03:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DN38VB019063; Tue, 13 Jan 2009 23:03:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DN37LY019062; Tue, 13 Jan 2009 23:03:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901132303.n0DN37LY019062@svn.freebsd.org> From: Alexander Motin Date: Tue, 13 Jan 2009 23:03:07 +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: r187202 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 23:03:12 -0000 Author: mav Date: Tue Jan 13 23:03:07 2009 New Revision: 187202 URL: http://svn.freebsd.org/changeset/base/187202 Log: Correct spelling in comment. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 23:02:54 2009 (r187201) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Jan 13 23:03:07 2009 (r187202) @@ -4651,8 +4651,8 @@ hdac_vendor_patch_parse(struct hdac_devi break; case HDA_CODEC_AD1983: /* - * This codec has several posisble usages, but none - * fit parser best. Help parser to choose better. + * This codec has several possible usages, but none + * fit the parser best. Help parser to choose better. */ /* Disable direct unmixed playback to get pcm volume. */ w = hdac_widget_get(devinfo, 5); From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 23:22:58 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C9D61065A23; Tue, 13 Jan 2009 23:22:58 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.freebsd.org (Postfix) with ESMTP id 271048FC1E; Tue, 13 Jan 2009 23:22:57 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (HPooka@thor.farley.org [192.168.1.5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id n0DMqDlJ033286; Tue, 13 Jan 2009 16:52:13 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Tue, 13 Jan 2009 16:52:13 -0600 (CST) From: "Sean C. Farley" To: Alexander Motin In-Reply-To: <200901132210.n0DMA1gj017738@svn.freebsd.org> Message-ID: References: <200901132210.n0DMA1gj017738@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.4 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187196 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 23:23:01 -0000 On Tue, 13 Jan 2009, Alexander Motin wrote: > Author: mav > Date: Tue Jan 13 22:10:01 2009 > New Revision: 187196 > URL: http://svn.freebsd.org/changeset/base/187196 > > Log: > Improve AD1983 codec support: > - force playback via mixer to get PCM volume control, > - make cleanup on recoring source selection. *snip* Thank you. This fixes my problem listening to my headphones on my Dell OptiPlex 745. Sean -- scf@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 23:36:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 485051065780; Tue, 13 Jan 2009 23:36:39 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34E9B8FC0C; Tue, 13 Jan 2009 23:36:39 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DNadqa019683; Tue, 13 Jan 2009 23:36:39 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DNadXU019682; Tue, 13 Jan 2009 23:36:39 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901132336.n0DNadXU019682@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 13 Jan 2009 23:36: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: r187203 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 23:36:40 -0000 Author: luigi Date: Tue Jan 13 23:36:38 2009 New Revision: 187203 URL: http://svn.freebsd.org/changeset/base/187203 Log: Some small fixes submitted by Christoph Mallon, specifically: + Remove a dead field of a struct. It serves no purpose anymore. + Remove a \n at the end of the format string of err(); the err() function already adds a \n ; + remove many unnecessary casts which obfuscate the code. This file has a huge number of indentation bugs, but I'd rather fix them when/if we happen to modify the relevant parts of the code. Submitted by: Christoph Mallon MFC after: 3 days Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Tue Jan 13 23:03:07 2009 (r187202) +++ head/sbin/fdisk/fdisk.c Tue Jan 13 23:36:38 2009 (r187203) @@ -74,7 +74,6 @@ static char *disk; static int cyls, sectors, heads, cylsecs, disksecs; struct mboot { - unsigned char padding[2]; /* force the longs to be long aligned */ unsigned char *bootinst; /* boot code */ off_t bootinst_size; struct dos_partition parts[NDOSPART]; @@ -308,7 +307,7 @@ main(int argc, char *argv[]) } else { disk = g_device_path(argv[0]); if (disk == NULL) - err(1, "unable to get correct path for %s\n", argv[0]); + err(1, "unable to get correct path for %s", argv[0]); } if (open_disk(u_flag) < 0) err(1, "cannot open disk %s", disk); @@ -329,7 +328,7 @@ main(int argc, char *argv[]) printf("g c%d h%d s%d\n", dos_cyls, dos_heads, dos_sectors); for (i = 0; i < NDOSPART; i++) { - partp = ((struct dos_partition *)&mboot.parts) + i; + partp = &mboot.parts[i]; if (partp->dp_start == 0 && partp->dp_size == 0) continue; @@ -350,7 +349,7 @@ main(int argc, char *argv[]) dos_sectors); printf("Part %11s %11s Type Flags\n", "Start", "Size"); for (i = 0; i < NDOSPART; i++) { - partp = ((struct dos_partition *) &mboot.parts) + i; + partp = &mboot.parts[i]; if (partp->dp_start == 0 && partp->dp_size == 0) continue; printf("%4d: %11lu %11lu 0x%02x 0x%02x\n", i + 1, @@ -366,7 +365,7 @@ main(int argc, char *argv[]) if (I_flag) { read_s0(); reset_boot(); - partp = (struct dos_partition *) (&mboot.parts[0]); + partp = &mboot.parts[0]; partp->dp_typ = DOSPTYP_386BSD; partp->dp_flag = ACTIVE; partp->dp_start = dos_sectors; @@ -461,7 +460,7 @@ print_part(int i) struct dos_partition *partp; u_int64_t part_mb; - partp = ((struct dos_partition *) &mboot.parts) + i - 1; + partp = &mboot.parts[i - 1]; if (!bcmp(partp, &mtpart, sizeof (struct dos_partition))) { printf("\n"); @@ -529,7 +528,7 @@ init_boot(void) static void init_sector0(unsigned long start) { - struct dos_partition *partp = (struct dos_partition *) (&mboot.parts[0]); + struct dos_partition *partp = &mboot.parts[0]; init_boot(); @@ -547,7 +546,7 @@ init_sector0(unsigned long start) static void change_part(int i) { - struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i - 1; + struct dos_partition *partp = &mboot.parts[i - 1]; printf("The data for partition %d is:\n", i); print_part(i); @@ -556,7 +555,7 @@ change_part(int i) int tmp; if (i_flag) { - bzero((char *)partp, sizeof (struct dos_partition)); + bzero(partp, sizeof (*partp)); if (i == 1) { init_sector0(1); printf("\nThe static data for the slice 1 has been reinitialized to:\n"); @@ -1112,21 +1111,21 @@ process_partition(CMD *command) current_line_number, partition); break; } - partp = ((struct dos_partition *) &mboot.parts) + partition - 1; - bzero((char *)partp, sizeof (struct dos_partition)); + partp = &mboot.parts[partition - 1]; + bzero(partp, sizeof (*partp)); partp->dp_typ = command->args[1].arg_val; partp->dp_start = command->args[2].arg_val; partp->dp_size = command->args[3].arg_val; max_end = partp->dp_start + partp->dp_size; - if (partp->dp_typ == 0) { + if (partp->dp_typ == 0) { /* * Get out, the partition is marked as unused. */ /* * Insure that it's unused. */ - bzero((char *)partp, sizeof (struct dos_partition)); + bzero(partp, sizeof(*partp)); status = 1; break; } @@ -1213,7 +1212,7 @@ process_active(CMD *command) /* * Reset active partition */ - partp = ((struct dos_partition *) &mboot.parts); + partp = mboot.parts; for (i = 0; i < NDOSPART; i++) partp[i].dp_flag = 0; partp[partition-1].dp_flag = ACTIVE; @@ -1308,9 +1307,9 @@ reset_boot(void) struct dos_partition *partp; init_boot(); - for (i = 0; i < 4; ++i) { - partp = ((struct dos_partition *) &mboot.parts) + i; - bzero((char *)partp, sizeof (struct dos_partition)); + for (i = 0; i < 4; ++i) { + partp = &mboot.parts[i]; + bzero(partp, sizeof(*partp)); } } From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 23:46:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A30E21065676; Tue, 13 Jan 2009 23:46:45 +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 8F2C98FC12; Tue, 13 Jan 2009 23:46:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DNkjpG019899; Tue, 13 Jan 2009 23:46:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DNkj7Q019898; Tue, 13 Jan 2009 23:46:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901132346.n0DNkj7Q019898@svn.freebsd.org> From: Xin LI Date: Tue, 13 Jan 2009 23:46: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: r187204 - head/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 23:46:46 -0000 Author: delphij Date: Tue Jan 13 23:46:45 2009 New Revision: 187204 URL: http://svn.freebsd.org/changeset/base/187204 Log: Remove intermediate variable busaddr and have bus_* operate directly on softc members upon initialization. Reviewed by: davidch MFC after: 1 month Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Tue Jan 13 23:36:38 2009 (r187203) +++ head/sys/dev/bce/if_bce.c Tue Jan 13 23:46:45 2009 (r187204) @@ -2908,7 +2908,6 @@ bce_dma_alloc(device_t dev) { struct bce_softc *sc; int i, error, rc = 0; - bus_addr_t busaddr; bus_size_t max_size, max_seg_size; int max_segments; @@ -2977,7 +2976,7 @@ bce_dma_alloc(device_t dev) sc->status_block, BCE_STATUS_BLK_SZ, bce_dma_map_addr, - &busaddr, + &sc->status_block_paddr, BUS_DMA_NOWAIT); if (error) { @@ -2987,7 +2986,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->status_block_paddr = busaddr; DBPRINT(sc, BCE_INFO, "%s(): status_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->status_block_paddr); @@ -3031,7 +3029,7 @@ bce_dma_alloc(device_t dev) sc->stats_block, BCE_STATS_BLK_SZ, bce_dma_map_addr, - &busaddr, + &sc->stats_block_paddr, BUS_DMA_NOWAIT); if(error) { @@ -3041,7 +3039,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->stats_block_paddr = busaddr; DBPRINT(sc, BCE_INFO, "%s(): stats_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->stats_block_paddr); @@ -3099,7 +3096,7 @@ bce_dma_alloc(device_t dev) sc->ctx_block[i], BCM_PAGE_SIZE, bce_dma_map_addr, - &busaddr, + &sc->ctx_paddr[i], BUS_DMA_NOWAIT); if (error) { @@ -3109,7 +3106,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->ctx_paddr[i] = busaddr; DBPRINT(sc, BCE_INFO, "%s(): ctx_paddr[%d] = 0x%jX\n", __FUNCTION__, i, (uintmax_t) sc->ctx_paddr[i]); } @@ -3155,7 +3151,7 @@ bce_dma_alloc(device_t dev) sc->tx_bd_chain[i], BCE_TX_CHAIN_PAGE_SZ, bce_dma_map_addr, - &busaddr, + &sc->tx_bd_chain_paddr[i], BUS_DMA_NOWAIT); if (error) { @@ -3165,7 +3161,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->tx_bd_chain_paddr[i] = busaddr; DBPRINT(sc, BCE_INFO, "%s(): tx_bd_chain_paddr[%d] = 0x%jX\n", __FUNCTION__, i, (uintmax_t) sc->tx_bd_chain_paddr[i]); } @@ -3253,7 +3248,7 @@ bce_dma_alloc(device_t dev) sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ, bce_dma_map_addr, - &busaddr, + &sc->rx_bd_chain_paddr[i], BUS_DMA_NOWAIT); if (error) { @@ -3263,7 +3258,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->rx_bd_chain_paddr[i] = busaddr; DBPRINT(sc, BCE_INFO, "%s(): rx_bd_chain_paddr[%d] = 0x%jX\n", __FUNCTION__, i, (uintmax_t) sc->rx_bd_chain_paddr[i]); } @@ -3350,7 +3344,7 @@ bce_dma_alloc(device_t dev) sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, - &busaddr, + &sc->pg_bd_chain_paddr[i], BUS_DMA_NOWAIT); if (error) { @@ -3360,7 +3354,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - sc->pg_bd_chain_paddr[i] = busaddr; DBPRINT(sc, BCE_INFO, "%s(): pg_bd_chain_paddr[%d] = 0x%jX\n", __FUNCTION__, i, (uintmax_t) sc->pg_bd_chain_paddr[i]); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 23:57:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A0E71065687; Tue, 13 Jan 2009 23:57:15 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7716F8FC0A; Tue, 13 Jan 2009 23:57:15 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0DNvF5N020107; Tue, 13 Jan 2009 23:57:15 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0DNvF51020106; Tue, 13 Jan 2009 23:57:15 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901132357.n0DNvF51020106@svn.freebsd.org> From: Sam Leffler Date: Tue, 13 Jan 2009 23:57: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: r187205 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 23:57:15 -0000 Author: sam Date: Tue Jan 13 23:57:15 2009 New Revision: 187205 URL: http://svn.freebsd.org/changeset/base/187205 Log: o note need for options AH_SUPPORT_5416 o mention 5416-class parts o mention tdma support Modified: head/share/man/man4/ath.4 Modified: head/share/man/man4/ath.4 ============================================================================== --- head/share/man/man4/ath.4 Tue Jan 13 23:46:45 2009 (r187204) +++ head/share/man/man4/ath.4 Tue Jan 13 23:57:15 2009 (r187205) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2002-2008 Sam Leffler, Errno Consulting +.\" Copyright (c) 2002-2009 Sam Leffler, Errno Consulting .\" All rights reserved. .\"" .\" Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 13, 2008 +.Dd January 13, 2009 .Dt ATH 4 .Os .Sh NAME @@ -41,6 +41,7 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "device ath" .Cd "device ath_hal" +.Cd "options AH_SUPPORT_AR5416" .Cd "device ath_rate_sample" .Cd "device wlan" .Ed @@ -55,14 +56,14 @@ if_ath_load="YES" The .Nm driver provides support for wireless network adapters based on -the Atheros AR5210, AR5211, and AR5212 programming APIs. +the Atheros AR5210, AR5211, AR5212, and AR5416 programming APIs. These APIs are used by a wide variety of chips; most all chips with a PCI and/or CardBus interface are supported. Chip-specific support is provided by the Atheros Hardware Access Layer -(HAL), that is packaged separately. +(HAL). .Pp Supported features include 802.11 and 802.3 frames, power management, BSS, -IBSS, and host-based access point operation modes. +IBSS, TDMA, and host-based access point operation modes. All host/device interaction is via DMA. .Pp The @@ -78,17 +79,21 @@ speeds as above for 802.11a operation an 1Mbps, 2Mbps, 5.5 Mbps and 11Mbps for 802.11b operation. AR5212-based devices support 802.11a, 802.11b, and 802.11g operation with transmit speeds appropriate to each. +AR5416-class devices are capable of 802.11n operation +but are supported only in legacy modes (802.11a, 11b, 11g). Most chips also support an Atheros Turbo Mode (TM) that operates in the 5Ghz frequency range with 2x the transmit speeds. Some chips also support Turbo mode in the 2.4Ghz range with 802.11g though this support is not presently available due to regulatory requirements. (Note that Turbo modes are, however, only interoperable with other Atheros-based devices.) +AR5212-based devices also support half- (10MHz) and quarter-width (5MHz) channels. The actual transmit speed used is dependent on signal quality and the .Dq "rate control" algorithm employed by the driver. All chips support WEP encryption. -The AR5212 has hardware support for the AES-CCM, TKIP, and Michael cryptographic +AR5212 and AR5416 parts have hardware support for the +AES-CCM, TKIP, and Michael cryptographic operations required for WPA. To enable encryption, use .Xr ifconfig 8 @@ -120,6 +125,13 @@ Multiple interfaces may be operated together with .Cm hostap interfaces to construct a wireless repeater device. +The driver also support +.Cm tdma +operation when compiled with +.Cd "options AH_SUPPORT_TDMA" +(and the wlan module is build with +.Cd "options IEEE80211_SUPPORT_TDMA" +to enable the associated 802.11 support). For more information on configuring this device, see .Xr ifconfig 8 . .Pp @@ -180,6 +192,14 @@ ifconfig wlan1 create wlandev ath0 wlanm ssid freeloaders up ifconfig bridge0 create addm wlan0 addm wlan1 addm fxp0 up .Ed +.Pp +Create a master node in a two slot TDMA BSS configured to use +2.5 millisecond slots. +.Bd -literal -offset indent +ifconfig wlan0 create wlandev ath0 wlanmode tdma \e + ssid tdma-test tmdaslot 0 tdmaslotlen 2500 \e + channel 36 up +.Ed .Sh DIAGNOSTICS .Bl -diag .It "ath%d: unable to attach hardware; HAL status %u" From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 04:47:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06E4310656DF; Wed, 14 Jan 2009 04:47:05 +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 EAB348FC24; Wed, 14 Jan 2009 04:47:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0E4l4SB025784; Wed, 14 Jan 2009 04:47:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0E4l4Qj025783; Wed, 14 Jan 2009 04:47:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901140447.n0E4l4Qj025783@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 14 Jan 2009 04:47: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: r187207 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 04:47:05 -0000 Author: yongari Date: Wed Jan 14 04:47:04 2009 New Revision: 187207 URL: http://svn.freebsd.org/changeset/base/187207 Log: Correct frame length argument of in_cksum_skip. While I'm here remove intermediate variable csum. Reported by: Kim Culhan < w8hdkim <> gmail DOT com > Tested by: Kim Culhan < w8hdkim <> gmail DOT com > Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Wed Jan 14 01:35:08 2009 (r187206) +++ head/sys/dev/msk/if_msk.c Wed Jan 14 04:47:04 2009 (r187207) @@ -2608,17 +2608,14 @@ msk_encap(struct msk_if_softc *sc_if, st */ if (m->m_pkthdr.len < MSK_MIN_FRAMELEN && (m->m_pkthdr.csum_flags & CSUM_TCP) != 0) { - uint16_t csum; - m = m_pullup(m, offset + sizeof(struct tcphdr)); if (m == NULL) { *m_head = NULL; return (ENOBUFS); } - csum = in_cksum_skip(m, ntohs(ip->ip_len) + offset - - (ip->ip_hl << 2), offset); *(uint16_t *)(m->m_data + offset + - m->m_pkthdr.csum_data) = csum; + m->m_pkthdr.csum_data) = in_cksum_skip(m, + m->m_pkthdr.len, offset); m->m_pkthdr.csum_flags &= ~CSUM_TCP; } if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 05:08:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E3BB106564A; Wed, 14 Jan 2009 05:08:53 +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 F0E7A8FC18; Wed, 14 Jan 2009 05:08:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0E58qL8026230; Wed, 14 Jan 2009 05:08:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0E58qUE026228; Wed, 14 Jan 2009 05:08:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901140508.n0E58qUE026228@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 14 Jan 2009 05:08: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: r187208 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 05:08:53 -0000 Author: yongari Date: Wed Jan 14 05:08:52 2009 New Revision: 187208 URL: http://svn.freebsd.org/changeset/base/187208 Log: Remove local jumbo locator and switch to UMA backed page allocator for jumbo frame. o Nuke unneeded jlist lock which was used to protect jumbo buffer management in local allocator. o Added a new tunable hw.mskc.jumbo_disable to disable jumbo frame support for the driver. The tunable could be set for systems that do not need to use jumbo frames and it would save (9K * number of Rx descriptors) bytes kernel memory. o Jumbo buffer allocation failure is no longer critical error for the operation of msk(4). If msk(4) encounter the allocation failure it just disables jumbo frame support and continues to work without your intervention. Using local allocator had several drawbacks such as requirement of large amount of continuous kernel memory and fixed (small) number of available buffers. The need for large continuous memory resulted in failure of loading driver with kldload on running systems. Also small number of buffer used in local allocator showed poor performance for some applications. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Wed Jan 14 04:47:04 2009 (r187207) +++ head/sys/dev/msk/if_msk.c Wed Jan 14 05:08:52 2009 (r187208) @@ -156,6 +156,8 @@ static int msi_disable = 0; TUNABLE_INT("hw.msk.msi_disable", &msi_disable); static int legacy_intr = 0; TUNABLE_INT("hw.msk.legacy_intr", &legacy_intr); +static int jumbo_disable = 0; +TUNABLE_INT("hw.msk.jumbo_disable", &jumbo_disable); #define MSK_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) @@ -267,9 +269,9 @@ static void msk_dmamap_cb(void *, bus_dm static int msk_status_dma_alloc(struct msk_softc *); static void msk_status_dma_free(struct msk_softc *); static int msk_txrx_dma_alloc(struct msk_if_softc *); +static int msk_rx_dma_jalloc(struct msk_if_softc *); static void msk_txrx_dma_free(struct msk_if_softc *); -static void *msk_jalloc(struct msk_if_softc *); -static void msk_jfree(void *, void *); +static void msk_rx_dma_jfree(struct msk_if_softc *); static int msk_init_rx_ring(struct msk_if_softc *); static int msk_init_jumbo_rx_ring(struct msk_if_softc *); static void msk_init_tx_ring(struct msk_if_softc *); @@ -830,24 +832,15 @@ msk_jumbo_newbuf(struct msk_if_softc *sc bus_dma_segment_t segs[1]; bus_dmamap_t map; int nsegs; - void *buf; - MGETHDR(m, M_DONTWAIT, MT_DATA); + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); - buf = msk_jalloc(sc_if); - if (buf == NULL) { - m_freem(m); - return (ENOBUFS); - } - /* Attach the buffer to the mbuf. */ - MEXTADD(m, buf, MSK_JLEN, msk_jfree, buf, - (struct msk_if_softc *)sc_if, 0, EXT_NET_DRV); if ((m->m_flags & M_EXT) == 0) { m_freem(m); return (ENOBUFS); } - m->m_pkthdr.len = m->m_len = MSK_JLEN; + m->m_len = m->m_pkthdr.len = MJUM9BYTES; if ((sc_if->msk_flags & MSK_FLAG_RAMBUF) == 0) m_adj(m, ETHER_ALIGN); #ifndef __NO_STRICT_ALIGNMENT @@ -936,20 +929,20 @@ msk_ioctl(struct ifnet *ifp, u_long comm switch(command) { case SIOCSIFMTU: - if (ifr->ifr_mtu > MSK_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN) { - error = EINVAL; - break; - } - if (sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_FE && - ifr->ifr_mtu > MSK_MAX_FRAMELEN) { + if (ifr->ifr_mtu > MSK_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN) error = EINVAL; - break; + else if (ifp->if_mtu != ifr->ifr_mtu) { + if ((sc_if->msk_flags & MSK_FLAG_NOJUMBO) != 0 && + ifr->ifr_mtu > ETHERMTU) + error = EINVAL; + else { + MSK_IF_LOCK(sc_if); + ifp->if_mtu = ifr->ifr_mtu; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + msk_init_locked(sc_if); + MSK_IF_UNLOCK(sc_if); + } } - MSK_IF_LOCK(sc_if); - ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) - msk_init_locked(sc_if); - MSK_IF_UNLOCK(sc_if); break; case SIOCSIFFLAGS: MSK_IF_LOCK(sc_if); @@ -1007,7 +1000,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm else ifp->if_hwassist &= ~CSUM_TSO; } - if (sc_if->msk_framesize > MSK_MAX_FRAMELEN && + if (ifp->if_mtu > ETHERMTU && sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_EC_U) { /* * In Yukon EC Ultra, TSO & checksum offload is not @@ -1443,8 +1436,13 @@ msk_attach(device_t dev) callout_init_mtx(&sc_if->msk_tick_ch, &sc_if->msk_softc->msk_mtx, 0); TASK_INIT(&sc_if->msk_link_task, 0, msk_link_task, sc_if); + /* Disable jumbo frame for Yukon FE. */ + if (sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_FE) + sc_if->msk_flags |= MSK_FLAG_NOJUMBO; + if ((error = msk_txrx_dma_alloc(sc_if) != 0)) goto fail; + msk_rx_dma_jalloc(sc_if); ifp = sc_if->msk_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1519,9 +1517,6 @@ msk_attach(device_t dev) */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - sc_if->msk_framesize = ifp->if_mtu + ETHER_HDR_LEN + - ETHER_VLAN_ENCAP_LEN; - /* * Do miibus setup. */ @@ -1829,6 +1824,7 @@ msk_detach(device_t dev) * } */ + msk_rx_dma_jfree(sc_if); msk_txrx_dma_free(sc_if); bus_generic_detach(dev); @@ -1989,16 +1985,9 @@ msk_txrx_dma_alloc(struct msk_if_softc * struct msk_dmamap_arg ctx; struct msk_txdesc *txd; struct msk_rxdesc *rxd; - struct msk_rxdesc *jrxd; - struct msk_jpool_entry *entry; - uint8_t *ptr; bus_size_t rxalign; int error, i; - mtx_init(&sc_if->msk_jlist_mtx, "msk_jlist_mtx", NULL, MTX_DEF); - SLIST_INIT(&sc_if->msk_jfree_listhead); - SLIST_INIT(&sc_if->msk_jinuse_listhead); - /* Create parent DMA tag. */ /* * XXX @@ -2070,42 +2059,6 @@ msk_txrx_dma_alloc(struct msk_if_softc * goto fail; } - /* Create tag for jumbo Rx ring. */ - error = bus_dma_tag_create(sc_if->msk_cdata.msk_parent_tag,/* parent */ - MSK_RING_ALIGN, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MSK_JUMBO_RX_RING_SZ, /* maxsize */ - 1, /* nsegments */ - MSK_JUMBO_RX_RING_SZ, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc_if->msk_cdata.msk_jumbo_rx_ring_tag); - if (error != 0) { - device_printf(sc_if->msk_if_dev, - "failed to create jumbo Rx ring DMA tag\n"); - goto fail; - } - - /* Create tag for jumbo buffer blocks. */ - error = bus_dma_tag_create(sc_if->msk_cdata.msk_parent_tag,/* parent */ - PAGE_SIZE, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MSK_JMEM, /* maxsize */ - 1, /* nsegments */ - MSK_JMEM, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc_if->msk_cdata.msk_jumbo_tag); - if (error != 0) { - device_printf(sc_if->msk_if_dev, - "failed to create jumbo Rx buffer block DMA tag\n"); - goto fail; - } - /* Create tag for Tx buffers. */ error = bus_dma_tag_create(sc_if->msk_cdata.msk_parent_tag,/* parent */ 1, 0, /* alignment, boundary */ @@ -2149,24 +2102,6 @@ msk_txrx_dma_alloc(struct msk_if_softc * goto fail; } - /* Create tag for jumbo Rx buffers. */ - error = bus_dma_tag_create(sc_if->msk_cdata.msk_parent_tag,/* parent */ - PAGE_SIZE, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MCLBYTES * MSK_MAXRXSEGS, /* maxsize */ - MSK_MAXRXSEGS, /* nsegments */ - MSK_JLEN, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc_if->msk_cdata.msk_jumbo_rx_tag); - if (error != 0) { - device_printf(sc_if->msk_if_dev, - "failed to create jumbo Rx DMA tag\n"); - goto fail; - } - /* Allocate DMA'able memory and load the DMA map for Tx ring. */ error = bus_dmamem_alloc(sc_if->msk_cdata.msk_tx_ring_tag, (void **)&sc_if->msk_rdata.msk_tx_ring, BUS_DMA_WAITOK | @@ -2209,29 +2144,6 @@ msk_txrx_dma_alloc(struct msk_if_softc * } sc_if->msk_rdata.msk_rx_ring_paddr = ctx.msk_busaddr; - /* Allocate DMA'able memory and load the DMA map for jumbo Rx ring. */ - error = bus_dmamem_alloc(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, - (void **)&sc_if->msk_rdata.msk_jumbo_rx_ring, - BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, - &sc_if->msk_cdata.msk_jumbo_rx_ring_map); - if (error != 0) { - device_printf(sc_if->msk_if_dev, - "failed to allocate DMA'able memory for jumbo Rx ring\n"); - goto fail; - } - - ctx.msk_busaddr = 0; - error = bus_dmamap_load(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, - sc_if->msk_cdata.msk_jumbo_rx_ring_map, - sc_if->msk_rdata.msk_jumbo_rx_ring, MSK_JUMBO_RX_RING_SZ, - msk_dmamap_cb, &ctx, 0); - if (error != 0) { - device_printf(sc_if->msk_if_dev, - "failed to load DMA'able memory for jumbo Rx ring\n"); - goto fail; - } - sc_if->msk_rdata.msk_jumbo_rx_ring_paddr = ctx.msk_busaddr; - /* Create DMA maps for Tx buffers. */ for (i = 0; i < MSK_TX_RING_CNT; i++) { txd = &sc_if->msk_cdata.msk_txdesc[i]; @@ -2264,12 +2176,98 @@ msk_txrx_dma_alloc(struct msk_if_softc * goto fail; } } + +fail: + return (error); +} + +static int +msk_rx_dma_jalloc(struct msk_if_softc *sc_if) +{ + struct msk_dmamap_arg ctx; + struct msk_rxdesc *jrxd; + bus_size_t rxalign; + int error, i; + + if (jumbo_disable != 0 || (sc_if->msk_flags & MSK_FLAG_NOJUMBO) != 0) { + sc_if->msk_flags |= MSK_FLAG_NOJUMBO; + device_printf(sc_if->msk_if_dev, + "disabling jumbo frame support\n"); + sc_if->msk_flags |= MSK_FLAG_NOJUMBO; + return (0); + } + /* Create tag for jumbo Rx ring. */ + error = bus_dma_tag_create(sc_if->msk_cdata.msk_parent_tag,/* parent */ + MSK_RING_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MSK_JUMBO_RX_RING_SZ, /* maxsize */ + 1, /* nsegments */ + MSK_JUMBO_RX_RING_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc_if->msk_cdata.msk_jumbo_rx_ring_tag); + if (error != 0) { + device_printf(sc_if->msk_if_dev, + "failed to create jumbo Rx ring DMA tag\n"); + goto jumbo_fail; + } + + rxalign = 1; + /* + * Workaround hardware hang which seems to happen when Rx buffer + * is not aligned on multiple of FIFO word(8 bytes). + */ + if ((sc_if->msk_flags & MSK_FLAG_RAMBUF) != 0) + rxalign = MSK_RX_BUF_ALIGN; + /* Create tag for jumbo Rx buffers. */ + error = bus_dma_tag_create(sc_if->msk_cdata.msk_parent_tag,/* parent */ + rxalign, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MJUM9BYTES, /* maxsize */ + 1, /* nsegments */ + MJUM9BYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc_if->msk_cdata.msk_jumbo_rx_tag); + if (error != 0) { + device_printf(sc_if->msk_if_dev, + "failed to create jumbo Rx DMA tag\n"); + goto jumbo_fail; + } + + /* Allocate DMA'able memory and load the DMA map for jumbo Rx ring. */ + error = bus_dmamem_alloc(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, + (void **)&sc_if->msk_rdata.msk_jumbo_rx_ring, + BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, + &sc_if->msk_cdata.msk_jumbo_rx_ring_map); + if (error != 0) { + device_printf(sc_if->msk_if_dev, + "failed to allocate DMA'able memory for jumbo Rx ring\n"); + goto jumbo_fail; + } + + ctx.msk_busaddr = 0; + error = bus_dmamap_load(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, + sc_if->msk_cdata.msk_jumbo_rx_ring_map, + sc_if->msk_rdata.msk_jumbo_rx_ring, MSK_JUMBO_RX_RING_SZ, + msk_dmamap_cb, &ctx, 0); + if (error != 0) { + device_printf(sc_if->msk_if_dev, + "failed to load DMA'able memory for jumbo Rx ring\n"); + goto jumbo_fail; + } + sc_if->msk_rdata.msk_jumbo_rx_ring_paddr = ctx.msk_busaddr; + /* Create DMA maps for jumbo Rx buffers. */ if ((error = bus_dmamap_create(sc_if->msk_cdata.msk_jumbo_rx_tag, 0, &sc_if->msk_cdata.msk_jumbo_rx_sparemap)) != 0) { device_printf(sc_if->msk_if_dev, "failed to create spare jumbo Rx dmamap\n"); - goto fail; + goto jumbo_fail; } for (i = 0; i < MSK_JUMBO_RX_RING_CNT; i++) { jrxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[i]; @@ -2280,54 +2278,17 @@ msk_txrx_dma_alloc(struct msk_if_softc * if (error != 0) { device_printf(sc_if->msk_if_dev, "failed to create jumbo Rx dmamap\n"); - goto fail; + goto jumbo_fail; } } - /* Allocate DMA'able memory and load the DMA map for jumbo buf. */ - error = bus_dmamem_alloc(sc_if->msk_cdata.msk_jumbo_tag, - (void **)&sc_if->msk_rdata.msk_jumbo_buf, - BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, - &sc_if->msk_cdata.msk_jumbo_map); - if (error != 0) { - device_printf(sc_if->msk_if_dev, - "failed to allocate DMA'able memory for jumbo buf\n"); - goto fail; - } - - ctx.msk_busaddr = 0; - error = bus_dmamap_load(sc_if->msk_cdata.msk_jumbo_tag, - sc_if->msk_cdata.msk_jumbo_map, sc_if->msk_rdata.msk_jumbo_buf, - MSK_JMEM, msk_dmamap_cb, &ctx, 0); - if (error != 0) { - device_printf(sc_if->msk_if_dev, - "failed to load DMA'able memory for jumbobuf\n"); - goto fail; - } - sc_if->msk_rdata.msk_jumbo_buf_paddr = ctx.msk_busaddr; - - /* - * Now divide it up into 9K pieces and save the addresses - * in an array. - */ - ptr = sc_if->msk_rdata.msk_jumbo_buf; - for (i = 0; i < MSK_JSLOTS; i++) { - sc_if->msk_cdata.msk_jslots[i] = ptr; - ptr += MSK_JLEN; - entry = malloc(sizeof(struct msk_jpool_entry), - M_DEVBUF, M_WAITOK); - if (entry == NULL) { - device_printf(sc_if->msk_if_dev, - "no memory for jumbo buffers!\n"); - error = ENOMEM; - goto fail; - } - entry->slot = i; - SLIST_INSERT_HEAD(&sc_if->msk_jfree_listhead, entry, - jpool_entries); - } + return (0); -fail: +jumbo_fail: + msk_rx_dma_jfree(sc_if); + device_printf(sc_if->msk_if_dev, "disabling jumbo frame support " + "due to resource shortage\n"); + sc_if->msk_flags |= MSK_FLAG_NOJUMBO; return (error); } @@ -2336,39 +2297,8 @@ msk_txrx_dma_free(struct msk_if_softc *s { struct msk_txdesc *txd; struct msk_rxdesc *rxd; - struct msk_rxdesc *jrxd; - struct msk_jpool_entry *entry; int i; - MSK_JLIST_LOCK(sc_if); - while ((entry = SLIST_FIRST(&sc_if->msk_jinuse_listhead))) { - device_printf(sc_if->msk_if_dev, - "asked to free buffer that is in use!\n"); - SLIST_REMOVE_HEAD(&sc_if->msk_jinuse_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc_if->msk_jfree_listhead, entry, - jpool_entries); - } - - while (!SLIST_EMPTY(&sc_if->msk_jfree_listhead)) { - entry = SLIST_FIRST(&sc_if->msk_jfree_listhead); - SLIST_REMOVE_HEAD(&sc_if->msk_jfree_listhead, jpool_entries); - free(entry, M_DEVBUF); - } - MSK_JLIST_UNLOCK(sc_if); - - /* Destroy jumbo buffer block. */ - if (sc_if->msk_cdata.msk_jumbo_map) - bus_dmamap_unload(sc_if->msk_cdata.msk_jumbo_tag, - sc_if->msk_cdata.msk_jumbo_map); - - if (sc_if->msk_rdata.msk_jumbo_buf) { - bus_dmamem_free(sc_if->msk_cdata.msk_jumbo_tag, - sc_if->msk_rdata.msk_jumbo_buf, - sc_if->msk_cdata.msk_jumbo_map); - sc_if->msk_rdata.msk_jumbo_buf = NULL; - sc_if->msk_cdata.msk_jumbo_map = NULL; - } - /* Tx ring. */ if (sc_if->msk_cdata.msk_tx_ring_tag) { if (sc_if->msk_cdata.msk_tx_ring_map) @@ -2399,21 +2329,6 @@ msk_txrx_dma_free(struct msk_if_softc *s bus_dma_tag_destroy(sc_if->msk_cdata.msk_rx_ring_tag); sc_if->msk_cdata.msk_rx_ring_tag = NULL; } - /* Jumbo Rx ring. */ - if (sc_if->msk_cdata.msk_jumbo_rx_ring_tag) { - if (sc_if->msk_cdata.msk_jumbo_rx_ring_map) - bus_dmamap_unload(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, - sc_if->msk_cdata.msk_jumbo_rx_ring_map); - if (sc_if->msk_cdata.msk_jumbo_rx_ring_map && - sc_if->msk_rdata.msk_jumbo_rx_ring) - bus_dmamem_free(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, - sc_if->msk_rdata.msk_jumbo_rx_ring, - sc_if->msk_cdata.msk_jumbo_rx_ring_map); - sc_if->msk_rdata.msk_jumbo_rx_ring = NULL; - sc_if->msk_cdata.msk_jumbo_rx_ring_map = NULL; - bus_dma_tag_destroy(sc_if->msk_cdata.msk_jumbo_rx_ring_tag); - sc_if->msk_cdata.msk_jumbo_rx_ring_tag = NULL; - } /* Tx buffers. */ if (sc_if->msk_cdata.msk_tx_tag) { for (i = 0; i < MSK_TX_RING_CNT; i++) { @@ -2445,6 +2360,33 @@ msk_txrx_dma_free(struct msk_if_softc *s bus_dma_tag_destroy(sc_if->msk_cdata.msk_rx_tag); sc_if->msk_cdata.msk_rx_tag = NULL; } + if (sc_if->msk_cdata.msk_parent_tag) { + bus_dma_tag_destroy(sc_if->msk_cdata.msk_parent_tag); + sc_if->msk_cdata.msk_parent_tag = NULL; + } +} + +static void +msk_rx_dma_jfree(struct msk_if_softc *sc_if) +{ + struct msk_rxdesc *jrxd; + int i; + + /* Jumbo Rx ring. */ + if (sc_if->msk_cdata.msk_jumbo_rx_ring_tag) { + if (sc_if->msk_cdata.msk_jumbo_rx_ring_map) + bus_dmamap_unload(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, + sc_if->msk_cdata.msk_jumbo_rx_ring_map); + if (sc_if->msk_cdata.msk_jumbo_rx_ring_map && + sc_if->msk_rdata.msk_jumbo_rx_ring) + bus_dmamem_free(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, + sc_if->msk_rdata.msk_jumbo_rx_ring, + sc_if->msk_cdata.msk_jumbo_rx_ring_map); + sc_if->msk_rdata.msk_jumbo_rx_ring = NULL; + sc_if->msk_cdata.msk_jumbo_rx_ring_map = NULL; + bus_dma_tag_destroy(sc_if->msk_cdata.msk_jumbo_rx_ring_tag); + sc_if->msk_cdata.msk_jumbo_rx_ring_tag = NULL; + } /* Jumbo Rx buffers. */ if (sc_if->msk_cdata.msk_jumbo_rx_tag) { for (i = 0; i < MSK_JUMBO_RX_RING_CNT; i++) { @@ -2464,69 +2406,6 @@ msk_txrx_dma_free(struct msk_if_softc *s bus_dma_tag_destroy(sc_if->msk_cdata.msk_jumbo_rx_tag); sc_if->msk_cdata.msk_jumbo_rx_tag = NULL; } - - if (sc_if->msk_cdata.msk_parent_tag) { - bus_dma_tag_destroy(sc_if->msk_cdata.msk_parent_tag); - sc_if->msk_cdata.msk_parent_tag = NULL; - } - mtx_destroy(&sc_if->msk_jlist_mtx); -} - -/* - * Allocate a jumbo buffer. - */ -static void * -msk_jalloc(struct msk_if_softc *sc_if) -{ - struct msk_jpool_entry *entry; - - MSK_JLIST_LOCK(sc_if); - - entry = SLIST_FIRST(&sc_if->msk_jfree_listhead); - - if (entry == NULL) { - MSK_JLIST_UNLOCK(sc_if); - return (NULL); - } - - SLIST_REMOVE_HEAD(&sc_if->msk_jfree_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc_if->msk_jinuse_listhead, entry, jpool_entries); - - MSK_JLIST_UNLOCK(sc_if); - - return (sc_if->msk_cdata.msk_jslots[entry->slot]); -} - -/* - * Release a jumbo buffer. - */ -static void -msk_jfree(void *buf, void *args) -{ - struct msk_if_softc *sc_if; - struct msk_jpool_entry *entry; - int i; - - /* Extract the softc struct pointer. */ - sc_if = (struct msk_if_softc *)args; - KASSERT(sc_if != NULL, ("%s: can't find softc pointer!", __func__)); - - MSK_JLIST_LOCK(sc_if); - /* Calculate the slot this buffer belongs to. */ - i = ((vm_offset_t)buf - - (vm_offset_t)sc_if->msk_rdata.msk_jumbo_buf) / MSK_JLEN; - KASSERT(i >= 0 && i < MSK_JSLOTS, - ("%s: asked to free buffer that we don't manage!", __func__)); - - entry = SLIST_FIRST(&sc_if->msk_jinuse_listhead); - KASSERT(entry != NULL, ("%s: buffer not in use!", __func__)); - entry->slot = i; - SLIST_REMOVE_HEAD(&sc_if->msk_jinuse_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc_if->msk_jfree_listhead, entry, jpool_entries); - if (SLIST_EMPTY(&sc_if->msk_jinuse_listhead)) - wakeup(sc_if); - - MSK_JLIST_UNLOCK(sc_if); } static int @@ -3328,7 +3207,7 @@ msk_rxput(struct msk_if_softc *sc_if) struct msk_softc *sc; sc = sc_if->msk_softc; - if (sc_if->msk_framesize >(MCLBYTES - ETHER_HDR_LEN)) + if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) bus_dmamap_sync( sc_if->msk_cdata.msk_jumbo_rx_ring_tag, sc_if->msk_cdata.msk_jumbo_rx_ring_map, @@ -3395,7 +3274,8 @@ msk_handle_events(struct msk_softc *sc) sc_if->msk_vtag = ntohs(len); break; case OP_RXSTAT: - if (sc_if->msk_framesize > (MCLBYTES - ETHER_HDR_LEN)) + if (sc_if->msk_framesize > + (MCLBYTES - MSK_RX_BUF_ALIGN)) msk_jumbo_rxeof(sc_if, status, len); else msk_rxeof(sc_if, status, len); @@ -3633,9 +3513,12 @@ msk_init_locked(struct msk_if_softc *sc_ /* Cancel pending I/O and free all Rx/Tx buffers. */ msk_stop(sc_if); - sc_if->msk_framesize = ifp->if_mtu + ETHER_HDR_LEN + - ETHER_VLAN_ENCAP_LEN; - if (sc_if->msk_framesize > MSK_MAX_FRAMELEN && + if (ifp->if_mtu < ETHERMTU) + sc_if->msk_framesize = ETHERMTU; + else + sc_if->msk_framesize = ifp->if_mtu; + sc_if->msk_framesize += ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + if (ifp->if_mtu > ETHERMTU && sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_EC_U) { /* * In Yukon EC Ultra, TSO & checksum offload is not @@ -3688,7 +3571,7 @@ msk_init_locked(struct msk_if_softc *sc_ gmac = DATA_BLIND_VAL(DATA_BLIND_DEF) | GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); - if (sc_if->msk_framesize > MSK_MAX_FRAMELEN) + if (ifp->if_mtu > ETHERMTU) gmac |= GM_SMOD_JUMBO_ENA; GMAC_WRITE_2(sc, sc_if->msk_port, GM_SERIAL_MODE, gmac); @@ -3743,7 +3626,7 @@ msk_init_locked(struct msk_if_softc *sc_ MSK_ECU_LLPP); CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, RX_GMF_UP_THR), MSK_ECU_ULPP); - if (sc_if->msk_framesize > MSK_MAX_FRAMELEN) { + if (ifp->if_mtu > ETHERMTU) { /* * Set Tx GMAC FIFO Almost Empty Threshold. */ @@ -3803,7 +3686,7 @@ msk_init_locked(struct msk_if_softc *sc_ /* Disable Rx checksum offload and RSS hash. */ CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_rxq, Q_CSR), BMU_DIS_RX_CHKSUM | BMU_DIS_RX_RSS_HASH); - if (sc_if->msk_framesize > (MCLBYTES - ETHER_HDR_LEN)) { + if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) { msk_set_prefetch(sc, sc_if->msk_rxq, sc_if->msk_rdata.msk_jumbo_rx_ring_paddr, MSK_JUMBO_RX_RING_CNT - 1); Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Wed Jan 14 04:47:04 2009 (r187207) +++ head/sys/dev/msk/if_mskreg.h Wed Jan 14 05:08:52 2009 (r187208) @@ -2164,7 +2164,6 @@ struct msk_stat_desc { #define MSK_MAXTXSEGS 32 #define MSK_TSO_MAXSGSIZE 4096 #define MSK_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define MSK_MAXRXSEGS 32 /* * It seems that the hardware requires extra decriptors(LEs) to offload @@ -2191,20 +2190,6 @@ struct msk_stat_desc { #define MSK_MAX_FRAMELEN \ (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - ETHER_CRC_LEN) #define MSK_MIN_FRAMELEN (ETHER_MIN_LEN - ETHER_CRC_LEN) -#define MSK_JSLOTS ((MSK_RX_RING_CNT * 3) / 2) - -#define MSK_JRAWLEN (MSK_JUMBO_FRAMELEN + ETHER_ALIGN) -#define MSK_JLEN (MSK_JRAWLEN + (sizeof(uint64_t) - \ - (MSK_JRAWLEN % sizeof(uint64_t)))) -#define MSK_JPAGESZ PAGE_SIZE -#define MSK_RESID \ - (MSK_JPAGESZ - (MSK_JLEN * MSK_JSLOTS) % MSK_JPAGESZ) -#define MSK_JMEM ((MSK_JLEN * MSK_JSLOTS) + MSK_RESID) - -struct msk_jpool_entry { - int slot; - SLIST_ENTRY(msk_jpool_entry) jpool_entries; -}; struct msk_txdesc { struct mbuf *tx_m; @@ -2230,10 +2215,6 @@ struct msk_chain_data { bus_dmamap_t msk_rx_ring_map; bus_dmamap_t msk_rx_sparemap; bus_dma_tag_t msk_jumbo_rx_tag; - bus_dma_tag_t msk_jumbo_tag; - bus_dmamap_t msk_jumbo_map; - bus_dma_tag_t msk_jumbo_mtag; - caddr_t msk_jslots[MSK_JSLOTS]; struct msk_rxdesc msk_jumbo_rxdesc[MSK_JUMBO_RX_RING_CNT]; bus_dma_tag_t msk_jumbo_rx_ring_tag; bus_dmamap_t msk_jumbo_rx_ring_map; @@ -2255,8 +2236,6 @@ struct msk_ring_data { bus_addr_t msk_rx_ring_paddr; struct msk_rx_desc *msk_jumbo_rx_ring; bus_addr_t msk_jumbo_rx_ring_paddr; - void *msk_jumbo_buf; - bus_addr_t msk_jumbo_buf_paddr; }; #define MSK_TX_RING_ADDR(sc, i) \ @@ -2352,6 +2331,7 @@ struct msk_if_softc { int msk_link; uint32_t msk_flags; #define MSK_FLAG_RAMBUF 0x0010 +#define MSK_FLAG_NOJUMBO 0x0020 struct callout msk_tick_ch; int msk_watchdog_timer; uint32_t msk_txq; /* Tx. Async Queue offset */ @@ -2365,14 +2345,8 @@ struct msk_if_softc { int msk_if_flags; int msk_detach; uint16_t msk_vtag; /* VLAN tag id. */ - SLIST_HEAD(__msk_jfreehead, msk_jpool_entry) msk_jfree_listhead; - SLIST_HEAD(__msk_jinusehead, msk_jpool_entry) msk_jinuse_listhead; - struct mtx msk_jlist_mtx; }; -#define MSK_JLIST_LOCK(_sc) mtx_lock(&(_sc)->msk_jlist_mtx) -#define MSK_JLIST_UNLOCK(_sc) mtx_unlock(&(_sc)->msk_jlist_mtx) - #define MSK_TIMEOUT 1000 #define MSK_PHY_POWERUP 1 #define MSK_PHY_POWERDOWN 0 From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 06:50:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 176AD10656C7; Wed, 14 Jan 2009 06:50:29 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFCEF8FC12; Wed, 14 Jan 2009 06:50:28 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0E6oS5I028191; Wed, 14 Jan 2009 06:50:28 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0E6oSuV028189; Wed, 14 Jan 2009 06:50:28 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200901140650.n0E6oSuV028189@svn.freebsd.org> From: Rong-En Fan Date: Wed, 14 Jan 2009 06:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187209 - in stable/7/sys: . conf contrib/pf dev/cxgb dev/sound/pci modules/sound/driver/au88x0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 06:50:30 -0000 Author: rafan Date: Wed Jan 14 06:50:28 2009 New Revision: 187209 URL: http://svn.freebsd.org/changeset/base/187209 Log: MFC r186851 - Remove snd_au88x0 which seems never got compiled into kernel nor as a kernel module. These files cause manual interaction when building ports/audio/aureal-kmod which provides a usable i386-only driver (it requires linking against some linux object files distributed by vendor which bankrupted back in 2000). MFC after: 1 week PR: 124343 Deleted: stable/7/sys/dev/sound/pci/au88x0.c stable/7/sys/dev/sound/pci/au88x0.h stable/7/sys/modules/sound/driver/au88x0/ Modified: stable/7/sys/ (props changed) stable/7/sys/conf/NOTES stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Wed Jan 14 05:08:52 2009 (r187208) +++ stable/7/sys/conf/NOTES Wed Jan 14 06:50:28 2009 (r187209) @@ -1990,8 +1990,6 @@ device sound # snd_ad1816: Analog Devices AD1816 ISA PnP/non-PnP. # snd_als4000: Avance Logic ALS4000 PCI. # snd_atiixp: ATI IXP 200/300/400 PCI. -# snd_au88x0 Aureal Vortex 1/2/Advantage PCI. This driver -# lacks support for playback and recording. # snd_audiocs: Crystal Semiconductor CS4231 SBus/EBus. Only # for sparc64. # snd_cmi: CMedia CMI8338/CMI8738 PCI. @@ -2035,7 +2033,6 @@ device sound device snd_ad1816 device snd_als4000 device snd_atiixp -#device snd_au88x0 #device snd_audiocs device snd_cmi device snd_cs4281 Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Wed Jan 14 05:08:52 2009 (r187208) +++ stable/7/sys/conf/files Wed Jan 14 06:50:28 2009 (r187209) @@ -965,7 +965,6 @@ dev/sound/isa/sbc.c optional snd_sbc is dev/sound/isa/sndbuf_dma.c optional sound isa dev/sound/pci/als4000.c optional snd_als4000 pci dev/sound/pci/atiixp.c optional snd_atiixp pci -#dev/sound/pci/au88x0.c optional snd_au88x0 pci dev/sound/pci/cmi.c optional snd_cmi pci dev/sound/pci/cs4281.c optional snd_cs4281 pci dev/sound/pci/csa.c optional snd_csa pci \ From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 09:00:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24A251065673; Wed, 14 Jan 2009 09:00:31 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14F038FC0A; Wed, 14 Jan 2009 09:00:31 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0E90U1B030709; Wed, 14 Jan 2009 09:00:30 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0E90UHH030708; Wed, 14 Jan 2009 09:00:30 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200901140900.n0E90UHH030708@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 14 Jan 2009 09:00:30 +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: r187210 - head/etc/periodic/weekly X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 09:00:31 -0000 Author: ume Date: Wed Jan 14 09:00:30 2009 New Revision: 187210 URL: http://svn.freebsd.org/changeset/base/187210 Log: Fix typo to install 400.status-pkg, again. Modified: head/etc/periodic/weekly/Makefile Modified: head/etc/periodic/weekly/Makefile ============================================================================== --- head/etc/periodic/weekly/Makefile Wed Jan 14 06:50:28 2009 (r187209) +++ head/etc/periodic/weekly/Makefile Wed Jan 14 09:00:30 2009 (r187210) @@ -16,7 +16,7 @@ FILES+= 320.whatis 330.catman .endif .if ${MK_PKGTOOLS} != "no" -FLES+= 400.status-pkg +FILES+= 400.status-pkg .endif .include From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 09:06:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 525EC106566B for ; Wed, 14 Jan 2009 09:06:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 02EA68FC1A for ; Wed, 14 Jan 2009 09:06:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 0754C8FC52 for ; Wed, 14 Jan 2009 12:06:03 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id E6EED8FC18; Wed, 14 Jan 2009 12:06:00 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 039453996C; Wed, 14 Jan 2009 12:06:00 +0300 (MSK) Date: Wed, 14 Jan 2009 12:05:59 +0300 From: Stanislav Sedov To: Sam Leffler Message-Id: <20090114120559.4d21d9f4.stas@FreeBSD.org> In-Reply-To: <496D1CE0.40401@freebsd.org> References: <200901131901.n0DJ1EF1011980@svn.freebsd.org> <20090114012719.6145076a.stas@FreeBSD.org> <496D1CE0.40401@freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Wed Jan 14 12:06:03 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 496daafb967001124787222 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Hans Petter Selasky , Stanislav Sedov , Andrew Thompson , svn-src-head@freebsd.org Subject: Re: svn commit: r187162 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 09:06:05 -0000 On Tue, 13 Jan 2009 14:59:44 -0800 Sam Leffler mentioned: > Stanislav Sedov wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > Hi! > > > > Would it make sense to rename usbconfig to something like "usbcontrol" > > to follow the *control tradition (cdcontrol, pmccontrol, vidcontrol, and so on)? > > > > I don't care what it's called but I think it is important that a > (sym)link to it named usbdevs w/ provide output that is compatible w/ > the old tool. > I agree. This could be done later, however, when current will be close to becoming stable. -- Stanislav Sedov ST4096-RIPE !DSPAM:496daafb967001124787222! From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 09:11:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83EC61065679; Wed, 14 Jan 2009 09:11:13 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 734668FC08; Wed, 14 Jan 2009 09:11:13 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0E9BDsE030984; Wed, 14 Jan 2009 09:11:13 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0E9BDX1030983; Wed, 14 Jan 2009 09:11:13 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200901140911.n0E9BDX1030983@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 14 Jan 2009 09:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187211 - stable/7/etc/periodic/weekly X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 09:11:14 -0000 Author: ume Date: Wed Jan 14 09:11:13 2009 New Revision: 187211 URL: http://svn.freebsd.org/changeset/base/187211 Log: MFC r187210: Fix typo to install 400.status-pkg, again. Modified: stable/7/etc/periodic/weekly/ (props changed) stable/7/etc/periodic/weekly/Makefile Modified: stable/7/etc/periodic/weekly/Makefile ============================================================================== --- stable/7/etc/periodic/weekly/Makefile Wed Jan 14 09:00:30 2009 (r187210) +++ stable/7/etc/periodic/weekly/Makefile Wed Jan 14 09:11:13 2009 (r187211) @@ -16,7 +16,7 @@ FILES+= 320.whatis 330.catman .endif .if ${MK_PKGTOOLS} != "no" -FLES+= 400.status-pkg +FILES+= 400.status-pkg .endif .include From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 09:56:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58DE71065676; Wed, 14 Jan 2009 09:56:59 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe16.swip.net [212.247.155.225]) by mx1.freebsd.org (Postfix) with ESMTP id EFAA48FC24; Wed, 14 Jan 2009 09:56:57 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=uO-fJlEQ75AA:10 a=TwVEjGppj24A:10 a=nklthdr5v5AUSfVrlghuJA==:17 a=NuI3yZxbIiSzRKyK918A:9 a=5H80wKAvC_C6jmYRhwDOWg1PsykA:4 a=LY0hPdMaydYA:10 Received: from [62.113.132.62] (account mc467741@c2i.net [62.113.132.62] verified) by mailfe16.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 436826457; Wed, 14 Jan 2009 10:56:55 +0100 From: Hans Petter Selasky To: Sam Leffler Date: Wed, 14 Jan 2009 10:59:19 +0100 User-Agent: KMail/1.9.7 References: <200901131901.n0DJ1EF1011980@svn.freebsd.org> <20090114012719.6145076a.stas@FreeBSD.org> <496D1CE0.40401@freebsd.org> In-Reply-To: <496D1CE0.40401@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901141059.20295.hselasky@c2i.net> Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrew Thompson Subject: Re: svn commit: r187162 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 09:57:00 -0000 On Tuesday 13 January 2009, Sam Leffler wrote: > Stanislav Sedov wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > Hi! > > > > Would it make sense to rename usbconfig to something like "usbcontrol" > > to follow the *control tradition (cdcontrol, pmccontrol, vidcontrol, and > > so on)? > > I don't care what it's called but I think it is important that a > (sym)link to it named usbdevs w/ provide output that is compatible w/ > the old tool. > > Sam I tried to make it similar to "ifconfig". --HPS From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 10:02:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B9E71065675; Wed, 14 Jan 2009 10:02:47 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DCDA8FC21; Wed, 14 Jan 2009 10:02:47 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EA2lYO032115; Wed, 14 Jan 2009 10:02:47 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EA2lmJ032114; Wed, 14 Jan 2009 10:02:47 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200901141002.n0EA2lmJ032114@svn.freebsd.org> From: Daniel Gerzo Date: Wed, 14 Jan 2009 10:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187212 - in stable/7/sbin: . atacontrol ddb devfs dhclient fdisk fsck_ffs geom geom/class/part geom/misc ifconfig init ipfw md5 mdconfig mksnap_ffs mount natd ping ping6 sconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 10:02:48 -0000 Author: danger (doc committer) Date: Wed Jan 14 10:02:47 2009 New Revision: 187212 URL: http://svn.freebsd.org/changeset/base/187212 Log: MFC r187067: Reviewed by: trhodes, keramida Modified: stable/7/sbin/ (props changed) stable/7/sbin/atacontrol/ (props changed) stable/7/sbin/ddb/ (props changed) stable/7/sbin/devfs/ (props changed) stable/7/sbin/dhclient/ (props changed) stable/7/sbin/fdisk/ (props changed) stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/misc/ (props changed) stable/7/sbin/ifconfig/ (props changed) stable/7/sbin/init/ (props changed) stable/7/sbin/ipfw/ (props changed) stable/7/sbin/md5/ (props changed) stable/7/sbin/mdconfig/ (props changed) stable/7/sbin/mksnap_ffs/ (props changed) stable/7/sbin/mount/ (props changed) stable/7/sbin/natd/ (props changed) stable/7/sbin/ping/ping.8 stable/7/sbin/ping6/ (props changed) stable/7/sbin/sconfig/ (props changed) Modified: stable/7/sbin/ping/ping.8 ============================================================================== --- stable/7/sbin/ping/ping.8 Wed Jan 14 09:11:13 2009 (r187211) +++ stable/7/sbin/ping/ping.8 Wed Jan 14 10:02:47 2009 (r187212) @@ -506,14 +506,18 @@ Others may use completely wild values. .Sh EXIT STATUS The .Nm -utility returns an exit status of zero if at least one response was -heard from the specified -.Ar host ; -a status of two if the transmission was successful but no responses -were received; or another value -(from -.In sysexits.h ) -if an error occurred. +utility exits with one of the following values: +.Bl -tag -width indent +.It 0 +At least one response was heard from the specified +.Ar host . +.It 2 +The transmission was successful but no responses were received. +.It any other value +An error occurred. +These values are defined in +.In sysexits.h . +.El .Sh SEE ALSO .Xr netstat 1 , .Xr ifconfig 8 , From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 10:17:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74C3F1065675; Wed, 14 Jan 2009 10:17:35 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 626A28FC1B; Wed, 14 Jan 2009 10:17:35 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EAHZh9032451; Wed, 14 Jan 2009 10:17:35 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EAHZWF032449; Wed, 14 Jan 2009 10:17:35 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200901141017.n0EAHZWF032449@svn.freebsd.org> From: Rong-En Fan Date: Wed, 14 Jan 2009 10:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187213 - in stable/6/sys: . conf dev/sound/pci modules/sound/driver/au88x0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 10:17:36 -0000 Author: rafan Date: Wed Jan 14 10:17:35 2009 New Revision: 187213 URL: http://svn.freebsd.org/changeset/base/187213 Log: MFC r186851 - Remove snd_au88x0 which seems never got compiled into kernel nor as a kernel module. These files cause manual interaction when building ports/audio/aureal-kmod which provides a usable i386-only driver (it requires linking against some linux object files distributed by vendor which bankrupted back in 2000). MFC after: 1 week PR: 124343 Deleted: stable/6/sys/dev/sound/pci/au88x0.c stable/6/sys/dev/sound/pci/au88x0.h stable/6/sys/modules/sound/driver/au88x0/ Modified: stable/6/sys/ (props changed) stable/6/sys/conf/NOTES stable/6/sys/conf/files Modified: stable/6/sys/conf/NOTES ============================================================================== --- stable/6/sys/conf/NOTES Wed Jan 14 10:02:47 2009 (r187212) +++ stable/6/sys/conf/NOTES Wed Jan 14 10:17:35 2009 (r187213) @@ -1996,8 +1996,6 @@ device sound # snd_ad1816: Analog Devices AD1816 ISA PnP/non-PnP. # snd_als4000: Avance Logic ALS4000 PCI. # snd_atiixp: ATI IXP 200/300/400 PCI. -# snd_au88x0 Aureal Vortex 1/2/Advantage PCI. This driver -# lacks support for playback and recording. # snd_audiocs: Crystal Semiconductor CS4231 SBus/EBus. Only # for sparc64. # snd_cmi: CMedia CMI8338/CMI8738 PCI. @@ -2039,7 +2037,6 @@ device sound device snd_ad1816 device snd_als4000 device snd_atiixp -#device snd_au88x0 #device snd_audiocs device snd_cmi device snd_cs4281 Modified: stable/6/sys/conf/files ============================================================================== --- stable/6/sys/conf/files Wed Jan 14 10:02:47 2009 (r187212) +++ stable/6/sys/conf/files Wed Jan 14 10:17:35 2009 (r187213) @@ -918,7 +918,6 @@ dev/sound/isa/sbc.c optional snd_sbc is dev/sound/isa/sndbuf_dma.c optional sound isa dev/sound/pci/als4000.c optional snd_als4000 pci dev/sound/pci/atiixp.c optional snd_atiixp pci -#dev/sound/pci/au88x0.c optional snd_au88x0 pci dev/sound/pci/cmi.c optional snd_cmi pci dev/sound/pci/cs4281.c optional snd_cs4281 pci dev/sound/pci/csa.c optional snd_csa pci \ From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 10:23:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68BA1106564A; Wed, 14 Jan 2009 10:23:44 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from services.rulez.sk (services.rulez.sk [92.240.234.125]) by mx1.freebsd.org (Postfix) with ESMTP id 1EABD8FC0C; Wed, 14 Jan 2009 10:23:43 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from localhost (services.rulez.sk [92.240.234.125]) by services.rulez.sk (Postfix) with ESMTP id BC519133450E; Wed, 14 Jan 2009 11:06:21 +0100 (CET) X-Virus-Scanned: amavisd-new at rulez.sk Received: from services.rulez.sk ([92.240.234.125]) by localhost (services.rulez.sk [92.240.234.125]) (amavisd-new, port 10024) with ESMTP id 93wdYVa8sevU; Wed, 14 Jan 2009 11:06:21 +0100 (CET) Received: from DANGER-PC (danger.mcrn.sk [84.16.37.254]) (Authenticated sender: danger@rulez.sk) by services.rulez.sk (Postfix) with ESMTPA id 170D71334439; Wed, 14 Jan 2009 11:06:21 +0100 (CET) Date: Wed, 14 Jan 2009 11:06:14 +0100 From: Daniel Gerzo Organization: The FreeBSD Project X-Priority: 3 (Normal) Message-ID: <08225540.20090114110614@rulez.sk> To: Daniel Gerzo In-Reply-To: <200901141002.n0EA2lmJ032114@svn.freebsd.org> References: <200901141002.n0EA2lmJ032114@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r187212 - in stable/7/sbin: . atacontrol ddb devfs dhclient fdisk fsck_ffs geom geom/class/part geom/misc ifconfig init ipfw md5 mdconfig mksnap_ffs mount natd ping ping6 sconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 10:23:45 -0000 Hello, Wednesday, January 14, 2009, 11:02:47 AM, you wrote: > Author: danger (doc committer) > Date: Wed Jan 14 10:02:47 2009 > New Revision: 187212 > URL: http://svn.freebsd.org/changeset/base/187212 > Log: > MFC r187067: This should also include: - improve readability Sorry for omitting it :( --=20 Best regards, Daniel mailto:danger@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 10:44:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1EC5106564A; Wed, 14 Jan 2009 10:44:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D30A8FC0A; Wed, 14 Jan 2009 10:44:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EAiHTf039991; Wed, 14 Jan 2009 10:44:17 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EAiG2g039967; Wed, 14 Jan 2009 10:44:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200901141044.n0EAiG2g039967@svn.freebsd.org> From: Robert Watson Date: Wed, 14 Jan 2009 10:44: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: r187214 - in head: contrib/openbsm contrib/openbsm/bin/auditd contrib/openbsm/bin/auditreduce contrib/openbsm/bsm contrib/openbsm/libauditd contrib/openbsm/libbsm contrib/openbsm/man co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 10:44:18 -0000 Author: rwatson Date: Wed Jan 14 10:44:16 2009 New Revision: 187214 URL: http://svn.freebsd.org/changeset/base/187214 Log: Merge OpenBSM alpha 5 from OpenBSM vendor branch to head, both contrib/openbsm (svn merge) and src/sys/{bsm,security/audit} (manual merge). Hook up bsm_domain.c and bsm_socket_type.c to the libbsm build along with man pages, add audit_bsm_domain.c and audit_bsm_socket_type.c to the kernel environment. OpenBSM history for imported revisions below for reference. MFC after: 1 month Sponsored by: Apple Inc. Obtained from: TrustedBSD Project OpenBSM 1.1 alpha 5 - Stub libauditd(3) man page added. - All BSM error number constants with BSM_ERRNO_. - Interfaces to convert between local and BSM socket types and protocol families have been added: au_bsm_to_domain(3), au_bsm_to_socket_type(3), au_domain_to_bsm(3), and au_socket_type_to_bsm(3), along with definitions of constants in audit_domain.h and audit_socket_type.h. This improves interoperability by converting local constant spaces, which vary by OS, to and from Solaris constants (where available) or OpenBSM constants for protocol domains not present in Solaris (a fair number). These routines should be used when generating and interpreting extended socket tokens. - Fix build warnings with full gcc warnings enabled on most supported platforms. - Don't compile error strings into bsm_errno.c when building it in the kernel environment. - When started by launchd, use the label com.apple.auditd rather than org.trustedbsd.auditd. Added: head/contrib/openbsm/libauditd/libauditd.3 - copied unchanged from r187065, vendor/openbsm/dist/libauditd/libauditd.3 head/contrib/openbsm/libbsm/au_domain.3 - copied unchanged from r187065, vendor/openbsm/dist/libbsm/au_domain.3 head/contrib/openbsm/libbsm/au_socket_type.3 - copied unchanged from r187065, vendor/openbsm/dist/libbsm/au_socket_type.3 head/contrib/openbsm/libbsm/bsm_domain.c - copied unchanged from r187065, vendor/openbsm/dist/libbsm/bsm_domain.c head/contrib/openbsm/libbsm/bsm_socket_type.c - copied unchanged from r187065, vendor/openbsm/dist/libbsm/bsm_socket_type.c head/contrib/openbsm/sys/bsm/audit_domain.h - copied unchanged from r187065, vendor/openbsm/dist/sys/bsm/audit_domain.h head/contrib/openbsm/sys/bsm/audit_socket_type.h - copied unchanged from r187065, vendor/openbsm/dist/sys/bsm/audit_socket_type.h head/sys/bsm/audit_domain.h (contents, props changed) head/sys/bsm/audit_socket_type.h (contents, props changed) head/sys/security/audit/audit_bsm_domain.c (contents, props changed) head/sys/security/audit/audit_bsm_socket_type.c (contents, props changed) Modified: head/contrib/openbsm/ (props changed) head/contrib/openbsm/INSTALL head/contrib/openbsm/NEWS head/contrib/openbsm/VERSION head/contrib/openbsm/bin/auditd/auditd.8 head/contrib/openbsm/bin/auditd/auditd.c head/contrib/openbsm/bin/auditd/auditd_darwin.c head/contrib/openbsm/bin/auditd/auditd_fbsd.c head/contrib/openbsm/bin/auditreduce/auditreduce.c head/contrib/openbsm/bsm/auditd_lib.h head/contrib/openbsm/bsm/libbsm.h head/contrib/openbsm/configure head/contrib/openbsm/configure.ac head/contrib/openbsm/libauditd/Makefile.am head/contrib/openbsm/libauditd/Makefile.in head/contrib/openbsm/libauditd/auditd_lib.c head/contrib/openbsm/libbsm/Makefile.am head/contrib/openbsm/libbsm/Makefile.in head/contrib/openbsm/libbsm/au_token.3 head/contrib/openbsm/libbsm/bsm_audit.c head/contrib/openbsm/libbsm/bsm_errno.c head/contrib/openbsm/libbsm/bsm_io.c head/contrib/openbsm/libbsm/bsm_token.c head/contrib/openbsm/libbsm/libbsm.3 head/contrib/openbsm/man/audit_user.5 head/contrib/openbsm/sys/bsm/Makefile.am head/contrib/openbsm/sys/bsm/Makefile.in head/contrib/openbsm/sys/bsm/audit.h head/contrib/openbsm/sys/bsm/audit_errno.h head/contrib/openbsm/sys/bsm/audit_record.h head/contrib/openbsm/test/bsm/generate.c head/contrib/openbsm/test/reference/E2BIG_record head/contrib/openbsm/test/reference/EACCES_record head/contrib/openbsm/test/reference/EBADF_record head/contrib/openbsm/test/reference/EBUSY_record head/contrib/openbsm/test/reference/ECHILD_record head/contrib/openbsm/test/reference/EDEADLK_record head/contrib/openbsm/test/reference/EEXIST_record head/contrib/openbsm/test/reference/EFAULT_record head/contrib/openbsm/test/reference/EFBIG_record head/contrib/openbsm/test/reference/EINTR_record head/contrib/openbsm/test/reference/EINVAL_record head/contrib/openbsm/test/reference/EIO_record head/contrib/openbsm/test/reference/EISDIR_record head/contrib/openbsm/test/reference/EMFILE_record head/contrib/openbsm/test/reference/EMLINK_record head/contrib/openbsm/test/reference/ENFILE_record head/contrib/openbsm/test/reference/ENODEV_record head/contrib/openbsm/test/reference/ENOENT_record head/contrib/openbsm/test/reference/ENOEXEC_record head/contrib/openbsm/test/reference/ENOMEM_record head/contrib/openbsm/test/reference/ENOSPC_record head/contrib/openbsm/test/reference/ENOTBLK_record head/contrib/openbsm/test/reference/ENOTDIR_record head/contrib/openbsm/test/reference/ENOTTY_record head/contrib/openbsm/test/reference/ENXIO_record head/contrib/openbsm/test/reference/EPERM_record head/contrib/openbsm/test/reference/EPIPE_record head/contrib/openbsm/test/reference/EROFS_record head/contrib/openbsm/test/reference/ESPIPE_record head/contrib/openbsm/test/reference/ESRCH_record head/contrib/openbsm/test/reference/ETXTBSY_record head/contrib/openbsm/test/reference/EXDEV_record head/contrib/openbsm/test/reference/arg32_record head/contrib/openbsm/test/reference/data_record head/contrib/openbsm/test/reference/data_token head/contrib/openbsm/test/reference/file_record head/contrib/openbsm/test/reference/in_addr_record head/contrib/openbsm/test/reference/ip_record head/contrib/openbsm/test/reference/ipc_record head/contrib/openbsm/test/reference/iport_record head/contrib/openbsm/test/reference/opaque_record head/contrib/openbsm/test/reference/path_record head/contrib/openbsm/test/reference/process32_record head/contrib/openbsm/test/reference/process32ex_record-IPv4 head/contrib/openbsm/test/reference/process32ex_record-IPv6 head/contrib/openbsm/test/reference/process64_record head/contrib/openbsm/test/reference/process64ex_record-IPv4 head/contrib/openbsm/test/reference/process64ex_record-IPv6 head/contrib/openbsm/test/reference/return32_record head/contrib/openbsm/test/reference/seq_record head/contrib/openbsm/test/reference/socketex_record head/contrib/openbsm/test/reference/socketex_token head/contrib/openbsm/test/reference/subject32_record head/contrib/openbsm/test/reference/subject32ex_record head/contrib/openbsm/test/reference/text_record head/contrib/openbsm/test/reference/zonename_record head/lib/libbsm/Makefile head/sys/bsm/audit.h head/sys/bsm/audit_errno.h head/sys/bsm/audit_internal.h head/sys/bsm/audit_kevents.h head/sys/bsm/audit_record.h head/sys/conf/files head/sys/security/audit/audit_bsm_errno.c head/sys/security/audit/audit_bsm_token.c Modified: head/contrib/openbsm/INSTALL ============================================================================== --- head/contrib/openbsm/INSTALL Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/INSTALL Wed Jan 14 10:44:16 2009 (r187214) @@ -9,6 +9,12 @@ support are built conditionally. Typica ./configure make +If doing development work on OpenBSM with gcc, the following invocation of +configure may be preferred in order to generate full compiler warnings and +force the compile to fail if a warning is found: + + CFLAGS="-Wall -Werror" ./configure + To install, use: make install Modified: head/contrib/openbsm/NEWS ============================================================================== --- head/contrib/openbsm/NEWS Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/NEWS Wed Jan 14 10:44:16 2009 (r187214) @@ -1,5 +1,24 @@ OpenBSM Version History +OpenBSM 1.1 alpha 5 + +- Stub libauditd(3) man page added. +- All BSM error number constants with BSM_ERRNO_. +- Interfaces to convert between local and BSM socket types and protocol + families have been added: au_bsm_to_domain(3), au_bsm_to_socket_type(3), + au_domain_to_bsm(3), and au_socket_type_to_bsm(3), along with definitions + of constants in audit_domain.h and audit_socket_type.h. This improves + interoperability by converting local constant spaces, which vary by OS, to + and from Solaris constants (where available) or OpenBSM constants for + protocol domains not present in Solaris (a fair number). These routines + should be used when generating and interpreting extended socket tokens. +- Fix build warnings with full gcc warnings enabled on most supported + platforms. +- Don't compile error strings into bsm_errno.c when building it in the kernel + environment. +- When started by launchd, use the label com.apple.auditd rather than + org.trustedbsd.auditd. + OpenBSM 1.1 alpha 4 - With the addition of BSM error number mapping, we also need to map the @@ -393,4 +412,4 @@ OpenBSM 1.0 alpha 1 to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#21 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#27 $ Modified: head/contrib/openbsm/VERSION ============================================================================== --- head/contrib/openbsm/VERSION Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/VERSION Wed Jan 14 10:44:16 2009 (r187214) @@ -1 +1 @@ -OPENBSM_1_1_ALPHA_4 +OPENBSM_1_1_ALPHA_5 Modified: head/contrib/openbsm/bin/auditd/auditd.8 ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd.8 Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/bin/auditd/auditd.8 Wed Jan 14 10:44:16 2009 (r187214) @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#16 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#17 $ .\" .Dd December 11, 2008 .Dt AUDITD 8 @@ -115,6 +115,7 @@ and are no longer available as arguments .Nm . .Sh SEE ALSO .Xr asl 3 , +.Xr libauditd 3 , .Xr audit 4 , .Xr audit_class 5 , .Xr audit_control 5 , Modified: head/contrib/openbsm/bin/auditd/auditd.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd.c Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/bin/auditd/auditd.c Wed Jan 14 10:44:16 2009 (r187214) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#40 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#41 $ */ #include @@ -252,7 +252,7 @@ do_trail_file(void) */ err = auditd_read_dirs(audit_warn_soft, audit_warn_hard); if (err) { - auditd_log_err("auditd_read_dirs() %s: %m", + auditd_log_err("auditd_read_dirs(): %s", auditd_strerror(err)); if (err == ADE_HARDLIM) audit_warn_allhard(); Modified: head/contrib/openbsm/bin/auditd/auditd_darwin.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd_darwin.c Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/bin/auditd/auditd_darwin.c Wed Jan 14 10:44:16 2009 (r187214) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#2 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#3 $ */ #include @@ -83,7 +83,7 @@ static int max_idletime = 0; #endif /* __BSM_INTERNAL_NOTIFY_KEY */ #ifndef __AUDIT_LAUNCHD_LABEL -#define __AUDIT_LAUNCHD_LABEL "org.trustedbsd.auditd" +#define __AUDIT_LAUNCHD_LABEL "com.apple.auditd" #endif /* __AUDIT_LAUNCHD_LABEL */ #define MAX_MSG_SIZE 4096 @@ -100,7 +100,7 @@ auditd_openlog(int debug, gid_t gid) if (debug) opt = ASL_OPT_STDERR; - au_aslclient = asl_open("auditd", "org.trustedbsd.auditd", opt); + au_aslclient = asl_open("auditd", "com.apple.auditd", opt); au_aslmsg = asl_new(ASL_TYPE_MSG); #ifdef ASL_KEY_READ_UID Modified: head/contrib/openbsm/bin/auditd/auditd_fbsd.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd_fbsd.c Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/bin/auditd/auditd_fbsd.c Wed Jan 14 10:44:16 2009 (r187214) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#2 $ */ #include @@ -35,9 +35,11 @@ #include #include +#include #include +#include #include -#include +#include #include #include Modified: head/contrib/openbsm/bin/auditreduce/auditreduce.c ============================================================================== --- head/contrib/openbsm/bin/auditreduce/auditreduce.c Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/bin/auditreduce/auditreduce.c Wed Jan 14 10:44:16 2009 (r187214) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#29 $ + * $P4: //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#31 $ */ /* @@ -41,6 +41,9 @@ */ #include + +#define _GNU_SOURCE /* Required for strptime() on glibc2. */ + #ifdef HAVE_FULL_QUEUE_H #include #else Modified: head/contrib/openbsm/bsm/auditd_lib.h ============================================================================== --- head/contrib/openbsm/bsm/auditd_lib.h Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/bsm/auditd_lib.h Wed Jan 14 10:44:16 2009 (r187214) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bsm/auditd_lib.h#2 $ + * $P4: //depot/projects/trustedbsd/openbsm/bsm/auditd_lib.h#3 $ */ #ifndef _BSM_AUDITD_LIB_H_ @@ -57,7 +57,7 @@ * Path of auditd plist file for launchd. */ #define AUDITD_PLIST_FILE \ - "/System/Library/LaunchDaemons/org.trustedbsd.auditd.plist" + "/System/Library/LaunchDaemons/com.apple.auditd.plist" /* * Error return codes for auditd_lib functions. Modified: head/contrib/openbsm/bsm/libbsm.h ============================================================================== --- head/contrib/openbsm/bsm/libbsm.h Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/bsm/libbsm.h Wed Jan 14 10:44:16 2009 (r187214) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#40 $ + * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#41 $ */ #ifndef _LIBBSM_H_ @@ -821,14 +821,22 @@ void au_print_tok_xml(FILE *outfp, to */ void au_print_xml_header(FILE *outfp); void au_print_xml_footer(FILE *outfp); -__END_DECLS /* - * Functions relating to BSM<->errno conversion. - */ -int au_bsm_to_errno(u_char bsm_error, int *errorp); -u_char au_errno_to_bsm(int error); -const char *au_strerror(u_char bsm_error); + * BSM library routines for converting between local and BSM constant spaces. + * (Note: some of these are replicated in audit_record.h for the benefit of + * the FreeBSD and Mac OS X kernels) + */ +int au_bsm_to_domain(u_short bsm_domain, int *local_domainp); +int au_bsm_to_errno(u_char bsm_error, int *errorp); +int au_bsm_to_socket_type(u_short bsm_socket_type, + int *local_socket_typep); +u_short au_domain_to_bsm(int local_domain); +u_char au_errno_to_bsm(int local_errno); +u_short au_socket_type_to_bsm(int local_socket_type); + +const char *au_strerror(u_char bsm_error); +__END_DECLS /* * The remaining APIs are associated with Apple's BSM implementation, in Modified: head/contrib/openbsm/configure ============================================================================== --- head/contrib/openbsm/configure Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/configure Wed Jan 14 10:44:16 2009 (r187214) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#47 . +# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#49 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for OpenBSM 1.1alpha4. +# Generated by GNU Autoconf 2.61 for OpenBSM 1.1alpha5. # # Report bugs to . # @@ -729,8 +729,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='OpenBSM' PACKAGE_TARNAME='openbsm' -PACKAGE_VERSION='1.1alpha4' -PACKAGE_STRING='OpenBSM 1.1alpha4' +PACKAGE_VERSION='1.1alpha5' +PACKAGE_STRING='OpenBSM 1.1alpha5' PACKAGE_BUGREPORT='trustedbsd-audit@TrustesdBSD.org' ac_unique_file="bin/auditreduce/auditreduce.c" @@ -1404,7 +1404,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenBSM 1.1alpha4 to adapt to many kinds of systems. +\`configure' configures OpenBSM 1.1alpha5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1474,7 +1474,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenBSM 1.1alpha4:";; + short | recursive ) echo "Configuration of OpenBSM 1.1alpha5:";; esac cat <<\_ACEOF @@ -1580,7 +1580,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenBSM configure 1.1alpha4 +OpenBSM configure 1.1alpha5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1594,7 +1594,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenBSM $as_me 1.1alpha4, which was +It was created by OpenBSM $as_me 1.1alpha5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -19076,7 +19076,7 @@ fi # Define the identity of the package. PACKAGE=OpenBSM - VERSION=1.1alpha4 + VERSION=1.1alpha5 cat >>confdefs.h <<_ACEOF @@ -23584,7 +23584,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenBSM $as_me 1.1alpha4, which was +This file was extended by OpenBSM $as_me 1.1alpha5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23637,7 +23637,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -OpenBSM config.status 1.1alpha4 +OpenBSM config.status 1.1alpha5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: head/contrib/openbsm/configure.ac ============================================================================== --- head/contrib/openbsm/configure.ac Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/configure.ac Wed Jan 14 10:44:16 2009 (r187214) @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([OpenBSM], [1.1alpha4], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) -AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#48 $]) +AC_INIT([OpenBSM], [1.1alpha5], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) +AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#49 $]) AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config/config.h]) Modified: head/contrib/openbsm/libauditd/Makefile.am ============================================================================== --- head/contrib/openbsm/libauditd/Makefile.am Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/libauditd/Makefile.am Wed Jan 14 10:44:16 2009 (r187214) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.am#1 $ +# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.am#2 $ # if USE_NATIVE_INCLUDES @@ -13,5 +13,5 @@ lib_LTLIBRARIES = libauditd.la libauditd_la_SOURCES = \ auditd_lib.c -#man3_MANS = \ -# libauditd.3 +man3_MANS = \ + libauditd.3 Modified: head/contrib/openbsm/libauditd/Makefile.in ============================================================================== --- head/contrib/openbsm/libauditd/Makefile.in Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/libauditd/Makefile.in Wed Jan 14 10:44:16 2009 (r187214) @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.in#1 $ +# $P4: //depot/projects/trustedbsd/openbsm/libauditd/Makefile.in#2 $ # VPATH = @srcdir@ @@ -51,7 +51,7 @@ am__vpath_adj = case $$p in \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libauditd_la_LIBADD = @@ -71,6 +71,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLF $(LDFLAGS) -o $@ SOURCES = $(libauditd_la_SOURCES) DIST_SOURCES = $(libauditd_la_SOURCES) +man3dir = $(mandir)/man3 +NROFF = nroff +MANS = $(man3_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -188,6 +191,9 @@ lib_LTLIBRARIES = libauditd.la libauditd_la_SOURCES = \ auditd_lib.c +man3_MANS = \ + libauditd.3 + all: all-am .SUFFIXES: @@ -285,6 +291,51 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-man3: $(man3_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.3*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ + *) ext='3' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ + done +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.3*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 3*) ;; \ + *) ext='3' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -362,9 +413,9 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) +all-am: Makefile $(LTLIBRARIES) $(MANS) installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -412,7 +463,7 @@ info: info-am info-am: -install-data-am: +install-data-am: install-man install-dvi: install-dvi-am @@ -422,7 +473,7 @@ install-html: install-html-am install-info: install-info-am -install-man: +install-man: install-man3 install-pdf: install-pdf-am @@ -448,7 +499,9 @@ ps: ps-am ps-am: -uninstall-am: uninstall-libLTLIBRARIES +uninstall-am: uninstall-libLTLIBRARIES uninstall-man + +uninstall-man: uninstall-man3 .MAKE: install-am install-strip @@ -459,16 +512,14 @@ uninstall-am: uninstall-libLTLIBRARIES install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install-libLTLIBRARIES install-man install-man3 install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-libLTLIBRARIES - + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-man uninstall-man3 -#man3_MANS = \ -# libauditd.3 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Modified: head/contrib/openbsm/libauditd/auditd_lib.c ============================================================================== --- head/contrib/openbsm/libauditd/auditd_lib.c Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/libauditd/auditd_lib.c Wed Jan 14 10:44:16 2009 (r187214) @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#1 $ + * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#2 $ */ #include @@ -823,7 +823,7 @@ audit_quick_stop(void) */ if (auditon(A_GETCOND, &cond, sizeof(cond)) < 0) return (-1); - if (cond == AUC_DISABLED) + if (cond == AUC_NOAUDIT) return (0); /* Copied: head/contrib/openbsm/libauditd/libauditd.3 (from r187065, vendor/openbsm/dist/libauditd/libauditd.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openbsm/libauditd/libauditd.3 Wed Jan 14 10:44:16 2009 (r187214, copy of r187065, vendor/openbsm/dist/libauditd/libauditd.3) @@ -0,0 +1,60 @@ +.\"- +.\" Copyright (c) 2008 Apple Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Inc. ("Apple") nor the names of +.\" its contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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. +.\" +.\" $P4: //depot/projects/trustedbsd/openbsm/libauditd/libauditd.3#1 $ +.\" +.Dd December 27, 2008 +.Dt LIBAUDITD 3 +.Os +.Sh NAME +.Nm libauditd +.Nd "auditd support library" +.Sh LIBRARY +.Lb libauditd +.Sh DESCRIPTION +The +.Nm +library provides the internal implementation of +.Xr auditd 8 . +.Sh INTERFACES +There are no public interfaces in +.Nm . +.Sh SEE ALSO +.Xr auditd 8 . +.Sh HISTORY +The OpenBSM implementation was created by McAfee Research, the security +division of McAfee Inc., under contract to Apple Computer, Inc., in 2004. +It was subsequently adopted by the TrustedBSD Project as the foundation for +the OpenBSM distribution. +.Sh AUTHORS +.An -nosplit +This software was created by +.An Stacey Son . +.Pp +The Basic Security Module (BSM) interface to audit records and audit event +stream format were defined by Sun Microsystems. Modified: head/contrib/openbsm/libbsm/Makefile.am ============================================================================== --- head/contrib/openbsm/libbsm/Makefile.am Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/libbsm/Makefile.am Wed Jan 14 10:44:16 2009 (r187214) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#7 $ +# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#8 $ # if USE_NATIVE_INCLUDES @@ -14,11 +14,13 @@ libbsm_la_SOURCES = \ bsm_audit.c \ bsm_class.c \ bsm_control.c \ + bsm_domain.c \ bsm_errno.c \ bsm_event.c \ bsm_flags.c \ bsm_io.c \ bsm_mask.c \ + bsm_socket_type.c \ bsm_token.c \ bsm_user.c @@ -31,12 +33,14 @@ endif man3_MANS = \ au_class.3 \ au_control.3 \ + au_domain.3 \ au_errno.3 \ au_event.3 \ au_free_token.3 \ au_io.3 \ au_mask.3 \ au_open.3 \ + au_socket_type.3 \ au_token.3 \ au_user.3 \ libbsm.3 Modified: head/contrib/openbsm/libbsm/Makefile.in ============================================================================== --- head/contrib/openbsm/libbsm/Makefile.in Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/libbsm/Makefile.in Wed Jan 14 10:44:16 2009 (r187214) @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#12 $ +# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#13 $ # VPATH = @srcdir@ @@ -60,13 +60,15 @@ libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libbsm_la_LIBADD = am__libbsm_la_SOURCES_DIST = bsm_audit.c bsm_class.c bsm_control.c \ - bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c \ - bsm_token.c bsm_user.c bsm_notify.c bsm_wrappers.c + bsm_domain.c bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c \ + bsm_mask.c bsm_socket_type.c bsm_token.c bsm_user.c \ + bsm_notify.c bsm_wrappers.c @HAVE_AUDIT_SYSCALLS_TRUE@am__objects_1 = bsm_notify.lo \ @HAVE_AUDIT_SYSCALLS_TRUE@ bsm_wrappers.lo am_libbsm_la_OBJECTS = bsm_audit.lo bsm_class.lo bsm_control.lo \ - bsm_errno.lo bsm_event.lo bsm_flags.lo bsm_io.lo bsm_mask.lo \ - bsm_token.lo bsm_user.lo $(am__objects_1) + bsm_domain.lo bsm_errno.lo bsm_event.lo bsm_flags.lo bsm_io.lo \ + bsm_mask.lo bsm_socket_type.lo bsm_token.lo bsm_user.lo \ + $(am__objects_1) libbsm_la_OBJECTS = $(am_libbsm_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp @@ -199,18 +201,20 @@ top_srcdir = @top_srcdir@ @USE_NATIVE_INCLUDES_FALSE@INCLUDES = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/sys @USE_NATIVE_INCLUDES_TRUE@INCLUDES = -I$(top_builddir) -I$(top_srcdir) lib_LTLIBRARIES = libbsm.la -libbsm_la_SOURCES = bsm_audit.c bsm_class.c bsm_control.c bsm_errno.c \ - bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c bsm_token.c \ - bsm_user.c $(am__append_1) +libbsm_la_SOURCES = bsm_audit.c bsm_class.c bsm_control.c bsm_domain.c \ + bsm_errno.c bsm_event.c bsm_flags.c bsm_io.c bsm_mask.c \ + bsm_socket_type.c bsm_token.c bsm_user.c $(am__append_1) man3_MANS = \ au_class.3 \ au_control.3 \ + au_domain.3 \ au_errno.3 \ au_event.3 \ au_free_token.3 \ au_io.3 \ au_mask.3 \ au_open.3 \ + au_socket_type.3 \ au_token.3 \ au_user.3 \ libbsm.3 @@ -287,12 +291,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_audit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_class.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_control.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_domain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_errno.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_flags.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_mask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_notify.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_socket_type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_token.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_user.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsm_wrappers.Plo@am__quote@ Copied: head/contrib/openbsm/libbsm/au_domain.3 (from r187065, vendor/openbsm/dist/libbsm/au_domain.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openbsm/libbsm/au_domain.3 Wed Jan 14 10:44:16 2009 (r187214, copy of r187065, vendor/openbsm/dist/libbsm/au_domain.3) @@ -0,0 +1,87 @@ +.\"- +.\" Copyright (c) 2008 Apple Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Inc. ("Apple") nor the names of +.\" its contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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. +.\" +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_domain.3#1 $ +.\" +.Dd December 28, 2008 +.Dt AU_BSM_TO_DOMAIN 3 +.Os +.Sh NAME +.Nm au_bsm_to_domain , +.Nm au_domain_to_bsm +.Nd "convert between BSM and local protocol domains" +.Sh LIBRARY +.Lb libbsm +.Sh SYNOPSIS +.In bsm/libbsm.h +.Ft int +.Fn au_bsm_to_domain "u_short bsm_domain" "int *local_domainp" +.Ft u_short +.Fn au_domain_to_bsm "int local_domain" +.Sh DESCRIPTION +These interfaces may be used to convert between the local and BSM protocol +domains. +The +.Fn au_bsm_to_domain +function accepts a BSM domain, +.Fa bsm_domain , +and converts it to a local domain, such as those passed to +.Xr socket 2 , +that will be stored in the integer pointed to by +.Fa local_domainp +if successful. +This call will fail if the BSM domain cannot be mapped into a local domain, +which may occur if the socket token was generated on another operating +system. +.Pp +.Fn au_domain_to_bsm +function accepts a local domain, and returns the BSM domain for it. +This call cannot fail, and instead returns a BSM domain indicating to a later +decoder that the domain could not be encoded. +.Sh RETURN VALULES +On success, +.Fn au_bsm_to_domain +returns 0 and a converted domain; on failure, it returns -1 but does not set +.Xr errno 2 . +.Sh SEE ALSO +.Xr au_bsm_to_socket_type 3 , +.Xr au_socket_type_to_bsm 3 , +.Xr au_to_socket_ex 3 , +.Xr libbsm 3 +.Sh HISTORY +.Fn au_bsm_to_domain +and +.Fn au_domain_to_bsm +were introduced in OpenBSM 1.1. +.Sh AUTHORS +These functions were implemented by +.An Robert Watson +under contract to Apple Inc. +.Pp +The Basic Security Module (BSM) interface to audit records and audit event +stream format were defined by Sun Microsystems. Copied: head/contrib/openbsm/libbsm/au_socket_type.3 (from r187065, vendor/openbsm/dist/libbsm/au_socket_type.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openbsm/libbsm/au_socket_type.3 Wed Jan 14 10:44:16 2009 (r187214, copy of r187065, vendor/openbsm/dist/libbsm/au_socket_type.3) @@ -0,0 +1,93 @@ +.\"- +.\" Copyright (c) 2008 Apple Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Inc. ("Apple") nor the names of +.\" its contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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. +.\" +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_socket_type.3#1 $ +.\" +.Dd December 28, 2008 +.Dt AU_BSM_TO_SOCKET_TYPE 3 +.Os +.Sh NAME +.Nm au_bsm_to_socket_type , +.Nm au_socket_type_to_bsm +.Nd "convert between BSM and local socket types" +.Sh LIBRARY +.Lb libbsm +.Sh SYNOPSIS +.In bsm/libbsm.h +.Ft int +.Fn au_bsm_to_socket_type "u_short bsm_socket_type" "int *local_socket_typep" +.Ft u_short +.Fn au_socket_type_to_bsm "int local_socket_type" +.Sh DESCRIPTION +These interfaces may be used to convert between the local and BSM socket +types. +The +.Fn au_bsm_to_socket_type +function accepts a BSM socket type, +.Fa bsm_socket_type , +and converts it to a local socket type, such as those passed to +.Xr socket 2 , +that will be stored in the integer pointed to by +.Fa local_socket_typep +if successful. +This call will fail if the BSM socket type cannot be mapped into a local +socket type, which may occur if the socket token was generated on another +operating system. +.Pp +.Fn au_socket_type_to_bsm +function accepts a local socket type, and returns the BSM socket type for it. +This call cannot fail, and instead returns a BSM socket type indicating to a +later decoder that the socket type could not be encoded. +.Sh RETURN VALULES +On success, +.Fn au_bsm_to_socket_type +returns 0 and a converted socket type; on failure, it returns -1 but does not +set +.Xr errno 2 . +.Pp +On success, +.Fn au_strerror +returns a pointer to an error string; on failure it will return +.Dv NULL . +.Sh SEE ALSO +.Xr au_bsm_to_domain 3 , +.Xr au_domain_to_bsm 3 , +.Xr au_to_socket_ex 3 , +.Xr libbsm 3 +.Sh HISTORY +.Fn au_bsm_to_socket_type +and +.Fn au_socket_type_to_bsm +were introduced in OpenBSM 1.1. +.Sh AUTHORS +These functions were implemented by +.An Robert Watson +under contract to Apple Inc. +.Pp +The Basic Security Module (BSM) interface to audit records and audit event +stream format were defined by Sun Microsystems. Modified: head/contrib/openbsm/libbsm/au_token.3 ============================================================================== --- head/contrib/openbsm/libbsm/au_token.3 Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/libbsm/au_token.3 Wed Jan 14 10:44:16 2009 (r187214) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#16 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#17 $ .\" .Dd April 19, 2005 .Dt AU_TOKEN 3 @@ -60,6 +60,7 @@ .Nm au_to_sock_inet32 , .Nm au_to_sock_inet128 , .Nm au_to_sock_inet , +.Nm au_to_socket_ex , .Nm au_to_subject32 , .Nm au_to_subject64 , .Nm au_to_subject , @@ -156,6 +157,8 @@ .Ft "token_t *" .Fn au_to_sock_int "struct sockaddr_in *so" .Ft "token_t *" +.Fn au_to_socket_ex "u_short so_domain" "u_short so_type" "struct sockaddr *sa_local" "struct sockaddr *sa_remote" +.Ft "token_t *" .Fo au_to_subject32 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid" .Fa "gid_t rgid" "pid_t pid" "au_asid_t sid" "au_tid_t *tid" Modified: head/contrib/openbsm/libbsm/bsm_audit.c ============================================================================== --- head/contrib/openbsm/libbsm/bsm_audit.c Wed Jan 14 10:17:35 2009 (r187213) +++ head/contrib/openbsm/libbsm/bsm_audit.c Wed Jan 14 10:44:16 2009 (r187214) @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#34 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#35 $ */ #include @@ -219,13 +219,16 @@ au_write(int d, token_t *tok) static int au_assemble(au_record_t *rec, short event) { - token_t *header, *tok, *trailer; - size_t tot_rec_size, hdrsize; - u_char *dptr; +#ifdef HAVE_AUDIT_SYSCALLS struct in6_addr *aptr; - int error; struct auditinfo_addr aia; struct timeval tm; + size_t hdrsize; +#endif /* HAVE_AUDIT_SYSCALLS */ + token_t *header, *tok, *trailer; + size_t tot_rec_size; + u_char *dptr; + int error; #ifdef HAVE_AUDIT_SYSCALLS /* Copied: head/contrib/openbsm/libbsm/bsm_domain.c (from r187065, vendor/openbsm/dist/libbsm/bsm_domain.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openbsm/libbsm/bsm_domain.c Wed Jan 14 10:44:16 2009 (r187214, copy of r187065, vendor/openbsm/dist/libbsm/bsm_domain.c) @@ -0,0 +1,499 @@ +/*- + * Copyright (c) 2008 Apple Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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. + * + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_domain.c#2 $ + */ + +#include +#include + +#include + +#include +#include + +struct bsm_domain { + u_short bd_bsm_domain; + int bd_local_domain; +}; + +#define PF_NO_LOCAL_MAPPING -600 + +static const struct bsm_domain bsm_domains[] = { + { BSM_PF_UNSPEC, PF_UNSPEC }, + { BSM_PF_LOCAL, PF_LOCAL }, + { BSM_PF_INET, PF_INET }, + { BSM_PF_IMPLINK, +#ifdef PF_IMPLINK + PF_IMPLINK +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PUP, +#ifdef PF_PUP + PF_PUP +#else + PF_NO_LOCAL_MAPPING +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 12:16:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1BA1065695; Wed, 14 Jan 2009 12:16:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BEF68FC14; Wed, 14 Jan 2009 12:16:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ECGFLx043036; Wed, 14 Jan 2009 12:16:15 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ECGFvJ043035; Wed, 14 Jan 2009 12:16:15 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200901141216.n0ECGFvJ043035@svn.freebsd.org> From: Robert Watson Date: Wed, 14 Jan 2009 12:16: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: r187215 - head/sys/security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 12:16:16 -0000 Author: rwatson Date: Wed Jan 14 12:16:14 2009 New Revision: 187215 URL: http://svn.freebsd.org/changeset/base/187215 Log: Update copyright, P4 version number as audit_bsm_token.c reflects changes in bsm_token.c through #86 from OpenBSM. MFC after: 1 month Sponsored by: Apple, Inc. Obtained from: TrustedBSD Project Modified: head/sys/security/audit/audit_bsm_token.c Modified: head/sys/security/audit/audit_bsm_token.c ============================================================================== --- head/sys/security/audit/audit_bsm_token.c Wed Jan 14 10:44:16 2009 (r187214) +++ head/sys/security/audit/audit_bsm_token.c Wed Jan 14 12:16:14 2009 (r187215) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2008 Apple Inc. + * Copyright (c) 2004-2009 Apple Inc. * Copyright (c) 2005 SPARTA, Inc. * All rights reserved. * @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#72 + * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#86 */ #include From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 14:20:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B5A01065687; Wed, 14 Jan 2009 14:20:10 +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 092A28FC16; Wed, 14 Jan 2009 14:20:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EEK98c045403; Wed, 14 Jan 2009 14:20:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EEK8B6045402; Wed, 14 Jan 2009 14:20:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901141420.n0EEK8B6045402@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 14 Jan 2009 14:20: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: r187221 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 14:20:11 -0000 Author: kib Date: Wed Jan 14 14:20:08 2009 New Revision: 187221 URL: http://svn.freebsd.org/changeset/base/187221 Log: Disable interrupts, if they were enabled, before doing swapgs. Otherwise, interrupt may happen while we run with kernel CS and usermode gsbase. Reviewed by: jeff MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Wed Jan 14 13:46:01 2009 (r187220) +++ head/sys/amd64/amd64/exception.S Wed Jan 14 14:20:08 2009 (r187221) @@ -494,6 +494,7 @@ outofnmi: movq %rsp,%rdx /* frame */ sti call *%rax + cli nocallchain: #endif testl %ebx,%ebx From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 14:55:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02969106567B; Wed, 14 Jan 2009 14:55:11 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E28288FC27; Wed, 14 Jan 2009 14:55:10 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EEtABS046151; Wed, 14 Jan 2009 14:55:10 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EEtAjf046147; Wed, 14 Jan 2009 14:55:10 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141455.n0EEtAjf046147@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 14:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187222 - in stable/7/sys/boot: common forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 14:55:12 -0000 Author: luigi Date: Wed Jan 14 14:55:10 2009 New Revision: 187222 URL: http://svn.freebsd.org/changeset/base/187222 Log: MFC: 185746 186789 187143 misc fixes and cleanup of the Forth scripts used by the loader, see the original commits for details. The only visible change is that now setting loader_conf_files="foo bar ${some.var}" works as expected, and expands variables correctly. Also, ${variables} can be used consistently in all assignments in *.conf files managed by the loader. NOTE: this commit has nothing to do with the pxeboot and /boot/loader problems that people are seeing on 6.4 and 7.2 -- those are related to issues with the loader code, not with the scripts that the loader processes. Modified: stable/7/sys/boot/common/interp.c stable/7/sys/boot/forth/loader.4th stable/7/sys/boot/forth/pnp.4th stable/7/sys/boot/forth/support.4th Modified: stable/7/sys/boot/common/interp.c ============================================================================== --- stable/7/sys/boot/common/interp.c Wed Jan 14 14:20:08 2009 (r187221) +++ stable/7/sys/boot/common/interp.c Wed Jan 14 14:55:10 2009 (r187222) @@ -92,7 +92,7 @@ perform(int argc, char *argv[]) void interact(void) { - char input[256]; /* big enough? */ + static char input[256]; /* big enough? */ #ifndef BOOT_FORTH int argc; char **argv; @@ -178,14 +178,21 @@ command_include(int argc, char *argv[]) return(res); } +/* + * Header prepended to each line. The text immediately follows the header. + * We try to make this short in order to save memory -- the loader has + * limited memory available, and some of the forth files are very long. + */ struct includeline { - char *text; + struct includeline *next; +#ifndef BOOT_FORTH int flags; int line; #define SL_QUIET (1<<0) #define SL_IGNOREERR (1<<1) - struct includeline *next; +#endif + char text[0]; }; int @@ -236,13 +243,14 @@ include(const char *filename) } #endif /* Allocate script line structure and copy line, flags */ + if (*cp == '\0') + continue; /* ignore empty line, save memory */ sp = malloc(sizeof(struct includeline) + strlen(cp) + 1); - sp->text = (char *)sp + sizeof(struct includeline); strcpy(sp->text, cp); #ifndef BOOT_FORTH sp->flags = flags; -#endif sp->line = line; +#endif sp->next = NULL; if (script == NULL) { Modified: stable/7/sys/boot/forth/loader.4th ============================================================================== --- stable/7/sys/boot/forth/loader.4th Wed Jan 14 14:20:08 2009 (r187221) +++ stable/7/sys/boot/forth/loader.4th Wed Jan 14 14:55:10 2009 (r187222) @@ -93,6 +93,7 @@ only forth definitions also support-func \ \ If a password was defined, execute autoboot and ask for \ password if autoboot returns. +\ Do not exit unless the right password is given. : check-password password .addr @ if @@ -150,8 +151,7 @@ only forth definitions also support-func \ line, if interpreted, or given on the stack, if compiled in. : (read-conf) ( addr len -- ) - conf_files .addr @ ?dup if free abort" Fatal error freeing memory" then - strdup conf_files .len ! conf_files .addr ! + conf_files string= include_conf_files \ Will recurse on new loader_conf_files definitions ; @@ -165,110 +165,26 @@ only forth definitions also support-func then ; immediate -\ ***** enable-module -\ -\ Turn a module loading on. +\ show, enable, disable, toggle module loading. They all take module from +\ the next word -: enable-module ( -- ) - bl parse module_options @ >r - begin - r@ - while - 2dup - r@ module.name dup .addr @ swap .len @ - compare 0= if - 2drop - r@ module.name dup .addr @ swap .len @ type - true r> module.flag ! - ." will be loaded." cr - exit - then - r> module.next @ >r - repeat - r> drop - type ." wasn't found." cr +: set-module-flag ( module_addr val -- ) \ set and print flag + over module.flag ! + dup module.name strtype + module.flag @ if ." will be loaded" else ." will not be loaded" then cr ; -\ ***** disable-module -\ -\ Turn a module loading off. - -: disable-module ( -- ) - bl parse module_options @ >r - begin - r@ - while - 2dup - r@ module.name dup .addr @ swap .len @ - compare 0= if - 2drop - r@ module.name dup .addr @ swap .len @ type - false r> module.flag ! - ." will not be loaded." cr - exit - then - r> module.next @ >r - repeat - r> drop - type ." wasn't found." cr -; +: enable-module find-module ?dup if true set-module-flag then ; -\ ***** toggle-module -\ -\ Turn a module loading on/off. +: disable-module find-module ?dup if false set-module-flag then ; -: toggle-module ( -- ) - bl parse module_options @ >r - begin - r@ - while - 2dup - r@ module.name dup .addr @ swap .len @ - compare 0= if - 2drop - r@ module.name dup .addr @ swap .len @ type - r@ module.flag @ 0= dup r> module.flag ! - if - ." will be loaded." cr - else - ." will not be loaded." cr - then - exit - then - r> module.next @ >r - repeat - r> drop - type ." wasn't found." cr -; +: toggle-module find-module ?dup if dup module.flag @ 0= set-module-flag then ; \ ***** show-module \ \ Show loading information about a module. -: show-module ( -- ) - bl parse module_options @ >r - begin - r@ - while - 2dup - r@ module.name dup .addr @ swap .len @ - compare 0= if - 2drop - ." Name: " r@ module.name dup .addr @ swap .len @ type cr - ." Path: " r@ module.loadname dup .addr @ swap .len @ type cr - ." Type: " r@ module.type dup .addr @ swap .len @ type cr - ." Flags: " r@ module.args dup .addr @ swap .len @ type cr - ." Before load: " r@ module.beforeload dup .addr @ swap .len @ type cr - ." After load: " r@ module.afterload dup .addr @ swap .len @ type cr - ." Error: " r@ module.loaderror dup .addr @ swap .len @ type cr - ." Status: " r> module.flag @ if ." Load" else ." Don't load" then cr - exit - then - r> module.next @ >r - repeat - r> drop - type ." wasn't found." cr -; +: show-module ( -- ) find-module ?dup if show-one-module then ; \ Words to be used inside configuration files Modified: stable/7/sys/boot/forth/pnp.4th ============================================================================== --- stable/7/sys/boot/forth/pnp.4th Wed Jan 14 14:20:08 2009 (r187221) +++ stable/7/sys/boot/forth/pnp.4th Wed Jan 14 14:55:10 2009 (r187222) @@ -24,6 +24,39 @@ \ \ $FreeBSD$ + +\ The following pnp code is used in pnp.4th and pnp.c +structure: STAILQ_HEAD + ptr stqh_first \ type* + ptr stqh_last \ type** +;structure + +structure: STAILQ_ENTRY + ptr stqe_next \ type* +;structure + +structure: pnphandler + ptr pnph.name + ptr pnph.enumerate +;structure + +structure: pnpident + ptr pnpid.ident \ char* + sizeof STAILQ_ENTRY cells member: pnpid.link \ pnpident +;structure + +structure: pnpinfo \ sync with sys/boot/config/bootstrap.h + ptr pnpi.desc + int pnpi.revision + ptr pnpi.module \ (char*) module args + int pnpi.argc + ptr pnpi.argv + ptr pnpi.handler \ pnphandler + sizeof STAILQ_HEAD member: pnpi.ident \ pnpident + sizeof STAILQ_ENTRY member: pnpi.link \ pnpinfo +;structure +\ end of pnp support + pnpdevices drop : enumerate Modified: stable/7/sys/boot/forth/support.4th ============================================================================== --- stable/7/sys/boot/forth/support.4th Wed Jan 14 14:20:08 2009 (r187221) +++ stable/7/sys/boot/forth/support.4th Wed Jan 14 14:55:10 2009 (r187222) @@ -26,7 +26,6 @@ \ Loader.rc support functions: \ -\ initialize_support ( -- ) initialize global variables \ initialize ( addr len -- ) as above, plus load_conf_files \ load_conf ( addr len -- ) load conf file given \ include_conf_files ( -- ) load all conf files in load_conf_files @@ -61,24 +60,23 @@ \ value any_conf_read? indicates if a conf file was succesfully read \ \ Other exported words: -\ +\ note, strlen is internal \ strdup ( addr len -- addr' len) similar to strdup(3) \ strcat ( addr len addr' len' -- addr len+len' ) similar to strcat(3) -\ strlen ( addr -- len ) similar to strlen(3) \ s' ( | string' -- addr len | ) similar to s" \ rudimentary structure support \ Exception values -1 constant syntax_error -2 constant out_of_memory -3 constant free_error -4 constant set_error -5 constant read_error -6 constant open_error -7 constant exec_error -8 constant before_load_error -9 constant after_load_error +1 constant ESYNTAX +2 constant ENOMEM +3 constant EFREE +4 constant ESETERROR \ error setting environment variable +5 constant EREAD \ error reading +6 constant EOPEN +7 constant EEXEC \ XXX never catched +8 constant EBEFORELOAD +9 constant EAFTERLOAD \ I/O constants @@ -132,7 +130,8 @@ structure: module ptr module.next ;structure -\ Internal loader structures +\ Internal loader structures (preloaded_file, kernel_module, file_metadata) +\ must be in sync with the C struct in sys/boot/common/bootstrap.h structure: preloaded_file ptr pf.name ptr pf.type @@ -159,51 +158,7 @@ structure: file_metadata 0 member: md.data \ variable size ;structure -structure: config_resource - ptr cf.name - int cf.type -0 constant RES_INT -1 constant RES_STRING -2 constant RES_LONG - 2 cells member: u -;structure - -structure: config_device - ptr cd.name - int cd.unit - int cd.resource_count - ptr cd.resources \ config_resource -;structure - -structure: STAILQ_HEAD - ptr stqh_first \ type* - ptr stqh_last \ type** -;structure - -structure: STAILQ_ENTRY - ptr stqe_next \ type* -;structure - -structure: pnphandler - ptr pnph.name - ptr pnph.enumerate -;structure - -structure: pnpident - ptr pnpid.ident \ char* - sizeof STAILQ_ENTRY cells member: pnpid.link \ pnpident -;structure - -structure: pnpinfo - ptr pnpi.desc - int pnpi.revision - ptr pnpi.module \ (char*) module args - int pnpi.argc - ptr pnpi.argv - ptr pnpi.handler \ pnphandler - sizeof STAILQ_HEAD member: pnpi.ident \ pnpident - sizeof STAILQ_ENTRY member: pnpi.link \ pnpinfo -;structure +\ end of structures \ Global variables @@ -216,11 +171,9 @@ create last_module_option sizeof module. 0 value nextboot? \ Support string functions - -: strdup ( addr len -- addr' len ) - >r r@ allocate if out_of_memory throw then - tuck r@ move - r> +: strdup { addr len -- addr' len' } + len allocate if ENOMEM throw then + addr over len move len ; : strcat { addr len addr' len' -- addr len+len' } @@ -228,29 +181,27 @@ create last_module_option sizeof module. addr len len' + ; -: strlen ( addr -- len ) - 0 >r +: strchr { addr len c -- addr' len' } begin - dup c@ while - 1+ r> 1+ >r repeat - drop r> + len + while + addr c@ c = if addr len exit then + addr 1 + to addr + len 1 - to len + repeat + 0 0 ; -: s' +: s' \ same as s", allows " in the string [char] ' parse - state @ if - postpone sliteral - then + state @ if postpone sliteral then ; immediate : 2>r postpone >r postpone >r ; immediate : 2r> postpone r> postpone r> ; immediate : 2r@ postpone 2r> postpone 2dup postpone 2>r ; immediate -: getenv? - getenv - -1 = if false else drop true then -; +: getenv? getenv -1 = if false else drop true then ; \ Private definitions @@ -271,22 +222,45 @@ only forth also support-functions defini \ Standard suffixes -: load_module_suffix s" _load" ; -: module_loadname_suffix s" _name" ; -: module_type_suffix s" _type" ; -: module_args_suffix s" _flags" ; -: module_beforeload_suffix s" _before" ; -: module_afterload_suffix s" _after" ; -: module_loaderror_suffix s" _error" ; +: load_module_suffix s" _load" ; +: module_loadname_suffix s" _name" ; +: module_type_suffix s" _type" ; +: module_args_suffix s" _flags" ; +: module_beforeload_suffix s" _before" ; +: module_afterload_suffix s" _after" ; +: module_loaderror_suffix s" _error" ; \ Support operators : >= < 0= ; : <= > 0= ; -\ Assorted support funcitons +\ Assorted support functions + +: free-memory free if EFREE throw then ; + +: strget { var -- addr len } var .addr @ var .len @ ; + +\ assign addr len to variable. +: strset { addr len var -- } addr var .addr ! len var .len ! ; -: free-memory free if free_error throw then ; +\ free memory and reset fields +: strfree { var -- } var .addr @ ?dup if free-memory 0 0 var strset then ; + +\ free old content, make a copy of the string and assign to variable +: string= { addr len var -- } var strfree addr len strdup var strset ; + +: strtype ( str -- ) strget type ; + +\ assign a reference to what is on the stack +: strref { addr len var -- addr len } + addr var .addr ! len var .len ! addr len +; + +\ unquote a string +: unquote ( addr len -- addr len ) + over c@ [char] " = if 2 chars - swap char+ swap then +; \ Assignment data temporary storage @@ -355,16 +329,16 @@ line-reading definitions line_buffer .len @ if line_buffer .addr @ line_buffer .len @ r@ + - resize if out_of_memory throw then + resize if ENOMEM throw then else - r@ allocate if out_of_memory throw then + r@ allocate if ENOMEM throw then then line_buffer .addr ! r> ; : append_to_line_buffer ( addr len -- ) - line_buffer .addr @ line_buffer .len @ + line_buffer strget 2swap strcat line_buffer .len ! drop @@ -384,23 +358,15 @@ line-reading definitions : refill_buffer 0 to read_buffer_ptr read_buffer .addr @ 0= if - read_buffer_size allocate if out_of_memory throw then + read_buffer_size allocate if ENOMEM throw then read_buffer .addr ! then fd @ read_buffer .addr @ read_buffer_size fread - dup -1 = if read_error throw then + dup -1 = if EREAD throw then dup 0= if true to end_of_file? then read_buffer .len ! ; -: reset_line_buffer - line_buffer .addr @ ?dup if - free-memory - then - 0 line_buffer .addr ! - 0 line_buffer .len ! -; - support-functions definitions : reset_line_reading @@ -408,7 +374,7 @@ support-functions definitions ; : read_line - reset_line_buffer + line_buffer strfree skip_newlines begin read_from_buffer @@ -448,9 +414,9 @@ also parser definitions also 0 value parsing_function 0 value end_of_line -: end_of_line? - line_pointer end_of_line = -; +: end_of_line? line_pointer end_of_line = ; + +\ classifiers for various character classes in the input line : letter? line_pointer c@ >r @@ -469,70 +435,46 @@ also parser definitions also or ; -: quote? - line_pointer c@ [char] " = -; +: quote? line_pointer c@ [char] " = ; -: assignment_sign? - line_pointer c@ [char] = = -; +: assignment_sign? line_pointer c@ [char] = = ; -: comment? - line_pointer c@ [char] # = -; +: comment? line_pointer c@ [char] # = ; -: space? - line_pointer c@ bl = - line_pointer c@ tab = or -; +: space? line_pointer c@ bl = line_pointer c@ tab = or ; -: backslash? - line_pointer c@ [char] \ = -; +: backslash? line_pointer c@ [char] \ = ; -: underscore? - line_pointer c@ [char] _ = -; +: underscore? line_pointer c@ [char] _ = ; -: dot? - line_pointer c@ [char] . = -; +: dot? line_pointer c@ [char] . = ; -: skip_character - line_pointer char+ to line_pointer -; +\ manipulation of input line +: skip_character line_pointer char+ to line_pointer ; -: skip_to_end_of_line - end_of_line to line_pointer -; +: skip_to_end_of_line end_of_line to line_pointer ; : eat_space begin - space? + end_of_line? if 0 else space? then while skip_character - end_of_line? if exit then repeat ; : parse_name ( -- addr len ) line_pointer begin - letter? digit? underscore? dot? or or or + end_of_line? if 0 else letter? digit? underscore? dot? or or or then while skip_character - end_of_line? if - line_pointer over - - strdup - exit - then repeat line_pointer over - strdup ; : remove_backslashes { addr len | addr' len' -- addr' len' } - len allocate if out_of_memory throw then + len allocate if ENOMEM throw then to addr' addr >r begin @@ -550,16 +492,16 @@ also parser definitions also : parse_quote ( -- addr len ) line_pointer skip_character - end_of_line? if syntax_error throw then + end_of_line? if ESYNTAX throw then begin quote? 0= while backslash? if skip_character - end_of_line? if syntax_error throw then + end_of_line? if ESYNTAX throw then then skip_character - end_of_line? if syntax_error throw then + end_of_line? if ESYNTAX throw then repeat skip_character line_pointer over - @@ -568,8 +510,7 @@ also parser definitions also : read_name parse_name ( -- addr len ) - name_buffer .len ! - name_buffer .addr ! + name_buffer strset ; : read_value @@ -578,8 +519,7 @@ also parser definitions also else parse_name ( -- addr len ) then - value_buffer .len ! - value_buffer .addr ! + value_buffer strset ; : comment @@ -589,7 +529,7 @@ also parser definitions also : white_space_4 eat_space comment? if ['] comment to parsing_function exit then - end_of_line? 0= if syntax_error throw then + end_of_line? 0= if ESYNTAX throw then ; : variable_value @@ -602,7 +542,7 @@ also parser definitions also letter? digit? quote? or or if ['] variable_value to parsing_function exit then - syntax_error throw + ESYNTAX throw ; : assignment_sign @@ -613,7 +553,7 @@ also parser definitions also : white_space_2 eat_space assignment_sign? if ['] assignment_sign to parsing_function exit then - syntax_error throw + ESYNTAX throw ; : variable_name @@ -625,13 +565,13 @@ also parser definitions also eat_space letter? if ['] variable_name to parsing_function exit then comment? if ['] comment to parsing_function exit then - end_of_line? 0= if syntax_error throw then + end_of_line? 0= if ESYNTAX throw then ; file-processing definitions : get_assignment - line_buffer .addr @ line_buffer .len @ + to end_of_line + line_buffer strget + to end_of_line line_buffer .addr @ to line_pointer ['] white_space_1 to parsing_function begin @@ -642,7 +582,7 @@ file-processing definitions parsing_function ['] comment = parsing_function ['] white_space_1 = parsing_function ['] white_space_4 = - or or 0= if syntax_error throw then + or or 0= if ESYNTAX throw then ; only forth also support-functions also file-processing definitions also @@ -650,7 +590,7 @@ only forth also support-functions also f \ Process line : assignment_type? ( addr len -- flag ) - name_buffer .addr @ name_buffer .len @ + name_buffer strget compare 0= ; @@ -660,82 +600,56 @@ only forth also support-functions also f over compare 0= ; -: loader_conf_files? - s" loader_conf_files" assignment_type? -; +: loader_conf_files? s" loader_conf_files" assignment_type? ; -: nextboot_flag? - s" nextboot_enable" assignment_type? -; +: nextboot_flag? s" nextboot_enable" assignment_type? ; -: nextboot_conf? - s" nextboot_conf" assignment_type? -; +: nextboot_conf? s" nextboot_conf" assignment_type? ; -: verbose_flag? - s" verbose_loading" assignment_type? -; +: verbose_flag? s" verbose_loading" assignment_type? ; -: execute? - s" exec" assignment_type? -; +: execute? s" exec" assignment_type? ; -: password? - s" password" assignment_type? -; +: password? s" password" assignment_type? ; -: module_load? - load_module_suffix suffix_type? -; +: module_load? load_module_suffix suffix_type? ; -: module_loadname? - module_loadname_suffix suffix_type? -; +: module_loadname? module_loadname_suffix suffix_type? ; -: module_type? - module_type_suffix suffix_type? -; +: module_type? module_type_suffix suffix_type? ; -: module_args? - module_args_suffix suffix_type? -; +: module_args? module_args_suffix suffix_type? ; -: module_beforeload? - module_beforeload_suffix suffix_type? -; +: module_beforeload? module_beforeload_suffix suffix_type? ; -: module_afterload? - module_afterload_suffix suffix_type? -; +: module_afterload? module_afterload_suffix suffix_type? ; -: module_loaderror? - module_loaderror_suffix suffix_type? -; +: module_loaderror? module_loaderror_suffix suffix_type? ; -: set_conf_files - conf_files .addr @ ?dup if - free-memory - then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 chars - +\ build a 'set' statement and execute it +: set_environment_variable + name_buffer .len @ value_buffer .len @ + 5 chars + \ size of result string + allocate if ENOMEM throw then + dup 0 \ start with an empty string and append the pieces + s" set " strcat + name_buffer strget strcat + s" =" strcat + value_buffer strget strcat + ['] evaluate catch if + 2drop free drop + ESETERROR throw else - value_buffer .addr @ value_buffer .len @ + free-memory then - strdup - conf_files .len ! conf_files .addr ! ; -: set_nextboot_conf - nextboot_conf_file .addr @ ?dup if - free-memory - then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 chars - - else - value_buffer .addr @ value_buffer .len @ - then - strdup - nextboot_conf_file .len ! nextboot_conf_file .addr ! +: set_conf_files + set_environment_variable + s" loader_conf_files" getenv conf_files string= +; + +: set_nextboot_conf \ XXX maybe do as set_conf_files ? + value_buffer strget unquote nextboot_conf_file string= ; : append_to_module_options_list ( addr -- ) @@ -748,35 +662,32 @@ only forth also support-functions also f then ; -: set_module_name ( addr -- ) - name_buffer .addr @ name_buffer .len @ - strdup - >r over module.name .addr ! - r> swap module.name .len ! +: set_module_name { addr -- } \ check leaks + name_buffer strget addr module.name string= ; : yes_value? - value_buffer .addr @ value_buffer .len @ + value_buffer strget \ XXX could use unquote 2dup s' "YES"' compare >r 2dup s' "yes"' compare >r 2dup s" YES" compare >r s" yes" compare r> r> r> and and and 0= ; -: find_module_option ( -- addr | 0 ) +: find_module_option ( -- addr | 0 ) \ return ptr to entry matching name_buffer module_options @ begin dup while - dup module.name dup .addr @ swap .len @ - name_buffer .addr @ name_buffer .len @ + dup module.name strget + name_buffer strget compare 0= if exit then module.next @ repeat ; : new_module_option ( -- addr ) - sizeof module allocate if out_of_memory throw then + sizeof module allocate if ENOMEM throw then dup sizeof module erase dup append_to_module_options_list dup set_module_name @@ -794,98 +705,38 @@ only forth also support-functions also f : set_module_args name_buffer .len @ module_args_suffix nip - name_buffer .len ! - get_module_option module.args - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.args string= ; : set_module_loadname name_buffer .len @ module_loadname_suffix nip - name_buffer .len ! - get_module_option module.loadname - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.loadname string= ; : set_module_type name_buffer .len @ module_type_suffix nip - name_buffer .len ! - get_module_option module.type - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.type string= ; : set_module_beforeload name_buffer .len @ module_beforeload_suffix nip - name_buffer .len ! - get_module_option module.beforeload - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.beforeload string= ; : set_module_afterload name_buffer .len @ module_afterload_suffix nip - name_buffer .len ! - get_module_option module.afterload - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! + value_buffer strget unquote + get_module_option module.afterload string= ; : set_module_loaderror name_buffer .len @ module_loaderror_suffix nip - name_buffer .len ! - get_module_option module.loaderror - dup .addr @ ?dup if free-memory then - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 chars - swap char+ swap - then - strdup - >r over .addr ! - r> swap .len ! -; - -: set_environment_variable - name_buffer .len @ - value_buffer .len @ + - 5 chars + - allocate if out_of_memory throw then - dup 0 ( addr -- addr addr len ) - s" set " strcat - name_buffer .addr @ name_buffer .len @ strcat - s" =" strcat - value_buffer .addr @ value_buffer .len @ strcat - ['] evaluate catch if - 2drop free drop - set_error throw - else - free-memory - then + value_buffer strget unquote + get_module_option module.loaderror string= ; : set_nextboot_flag @@ -897,23 +748,12 @@ only forth also support-functions also f ; : execute_command - value_buffer .addr @ value_buffer .len @ - over c@ [char] " = if - 2 - swap char+ swap - then - ['] evaluate catch if exec_error throw then + value_buffer strget unquote + ['] evaluate catch if EEXEC throw then ; : set_password - password .addr @ ?dup if free if free_error throw then then - value_buffer .addr @ c@ [char] " = if - value_buffer .addr @ char+ value_buffer .len @ 2 - strdup - value_buffer .addr @ free if free_error throw then - else - value_buffer .addr @ value_buffer .len @ - then - password .len ! password .addr ! - 0 value_buffer .addr ! *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 15:20:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C8CD106584E; Wed, 14 Jan 2009 15:20:13 +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 88AC38FC14; Wed, 14 Jan 2009 15:20:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EFKDfh046658; Wed, 14 Jan 2009 15:20:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EFKDab046657; Wed, 14 Jan 2009 15:20:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901141520.n0EFKDab046657@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 14 Jan 2009 15:20: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: r187223 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 15:20:15 -0000 Author: kib Date: Wed Jan 14 15:20:13 2009 New Revision: 187223 URL: http://svn.freebsd.org/changeset/base/187223 Log: It seems that there are at least three issues with IPC_RMID operation on SysV semaphores. The squeeze of the semaphore array in the kern_semctl() modifies sem_base for the semaphores with sem_base greater then sem_base of the removed semaphore, as well as the values of the semaphores, without locking their mutex. This can lead to (killable) hangs or unexpected behaviour of the processes performing any sem operations while other process does IPC_RMID. The semexit_myhook() eventhandler unlocks SEMUNDO_LOCK() while accessing *suptr. This allows for IPC_RMID for the sem id to be performed in parallel with undo hook referenced by the current undo structure. This leads to the panic("semexit - semid not allocated") [1]. The semaphore creation is protected by Giant, while IPC_RMID is done while only semaphore mutex is held. This seems to result in invalid values for semtot, causing random ENOSPC error returns [2]. Redo the locking of the semaphores lifetime cycle. Delegate the sem_mtx to the sole purpose of protecting semget() and semctl(IPC_RMID). Introduce new sem_undo_mtx to protect SEM_UNDO handling. Remove the Giant remnants from the code. Note that mac_sysvsem_check_semget() and mac_sysvsem_create() are now called while sem_mtx is held, as well as mac_sysvsem_cleanup() [3]. When semaphore is removed, acquire semaphore locks for all semaphores with sem_base that is going to be changed by squeeze of the sema array. The lock order is not important there, because the region is protected by sem_mtx. Organize both used and free sem_undo structures into the lists, protected by sem_undo_mtx. In semexit_myhook(), remove sem_undo structure that is being processed, from used list, without putting it onto the free to prevent modifications by other threads. This allows for sem_undo_lock to be dropped to acquire individial semaphore locks without violating lock order. Since IPC_RMID may no longer find this sem_undo, do tolerate references to unallocated semaphores in undo structure, and check sequential number to not undo unrelated semaphore with the same id. While there, convert functions definitions to ANSI C and fix small style(9) glitches. Reported by: Omer Faruk Sen [1], pho [2] Reviewed by: rwatson [3] Tested by: pho MFC after: 1 month Modified: head/sys/kern/sysv_sem.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Wed Jan 14 14:55:10 2009 (r187222) +++ head/sys/kern/sysv_sem.c Wed Jan 14 15:20:13 2009 (r187223) @@ -88,7 +88,7 @@ int semop(struct thread *td, struct semo static struct sem_undo *semu_alloc(struct thread *td); static int semundo_adjust(struct thread *td, struct sem_undo **supptr, - int semid, int semnum, int adjval); + int semid, int semseq, int semnum, int adjval); static void semundo_clear(int semid, int semnum); /* XXX casting to (sy_call_t *) is bogus, as usual. */ @@ -98,15 +98,17 @@ static sy_call_t *semcalls[] = { }; static struct mtx sem_mtx; /* semaphore global lock */ +static struct mtx sem_undo_mtx; static int semtot = 0; static struct semid_kernel *sema; /* semaphore id pool */ static struct mtx *sema_mtx; /* semaphore id pool mutexes*/ static struct sem *sem; /* semaphore pool */ -SLIST_HEAD(, sem_undo) semu_list; /* list of active undo structures */ +LIST_HEAD(, sem_undo) semu_list; /* list of active undo structures */ +LIST_HEAD(, sem_undo) semu_free_list; /* list of free undo structures */ static int *semu; /* undo structure pool */ static eventhandler_tag semexit_tag; -#define SEMUNDO_MTX sem_mtx +#define SEMUNDO_MTX sem_undo_mtx #define SEMUNDO_LOCK() mtx_lock(&SEMUNDO_MTX); #define SEMUNDO_UNLOCK() mtx_unlock(&SEMUNDO_MTX); #define SEMUNDO_LOCKASSERT(how) mtx_assert(&SEMUNDO_MTX, (how)); @@ -122,13 +124,14 @@ struct sem { * Undo structure (one per process) */ struct sem_undo { - SLIST_ENTRY(sem_undo) un_next; /* ptr to next active undo structure */ + LIST_ENTRY(sem_undo) un_next; /* ptr to next active undo structure */ struct proc *un_proc; /* owner of this structure */ short un_cnt; /* # of active entries */ struct undo { short un_adjval; /* adjust on exit values */ short un_num; /* semaphore # */ int un_id; /* semid */ + unsigned short un_seq; } un_ent[1]; /* undo entries */ }; @@ -250,12 +253,15 @@ seminit(void) } for (i = 0; i < seminfo.semmni; i++) mtx_init(&sema_mtx[i], "semid", NULL, MTX_DEF); + LIST_INIT(&semu_free_list); for (i = 0; i < seminfo.semmnu; i++) { struct sem_undo *suptr = SEMU(i); suptr->un_proc = NULL; + LIST_INSERT_HEAD(&semu_free_list, suptr, un_next); } - SLIST_INIT(&semu_list); + LIST_INIT(&semu_list); mtx_init(&sem_mtx, "sem", NULL, MTX_DEF); + mtx_init(&sem_undo_mtx, "semu", NULL, MTX_DEF); semexit_tag = EVENTHANDLER_REGISTER(process_exit, semexit_myhook, NULL, EVENTHANDLER_PRI_ANY); } @@ -265,6 +271,7 @@ semunload(void) { int i; + /* XXXKIB */ if (semtot != 0) return (EBUSY); @@ -279,6 +286,7 @@ semunload(void) for (i = 0; i < seminfo.semmni; i++) mtx_destroy(&sema_mtx[i]); mtx_destroy(&sem_mtx); + mtx_destroy(&sem_undo_mtx); return (0); } @@ -350,69 +358,31 @@ semsys(td, uap) */ static struct sem_undo * -semu_alloc(td) - struct thread *td; +semu_alloc(struct thread *td) { - int i; struct sem_undo *suptr; - struct sem_undo **supptr; - int attempt; SEMUNDO_LOCKASSERT(MA_OWNED); - /* - * Try twice to allocate something. - * (we'll purge an empty structure after the first pass so - * two passes are always enough) - */ - - for (attempt = 0; attempt < 2; attempt++) { - /* - * Look for a free structure. - * Fill it in and return it if we find one. - */ - - for (i = 0; i < seminfo.semmnu; i++) { - suptr = SEMU(i); - if (suptr->un_proc == NULL) { - SLIST_INSERT_HEAD(&semu_list, suptr, un_next); - suptr->un_cnt = 0; - suptr->un_proc = td->td_proc; - return(suptr); - } - } + if ((suptr = LIST_FIRST(&semu_free_list)) == NULL) + return (NULL); + LIST_REMOVE(suptr, un_next); + LIST_INSERT_HEAD(&semu_list, suptr, un_next); + suptr->un_cnt = 0; + suptr->un_proc = td->td_proc; + return (suptr); +} - /* - * We didn't find a free one, if this is the first attempt - * then try to free a structure. - */ +static int +semu_try_free(struct sem_undo *suptr) +{ - if (attempt == 0) { - /* All the structures are in use - try to free one */ - int did_something = 0; - - SLIST_FOREACH_PREVPTR(suptr, supptr, &semu_list, - un_next) { - if (suptr->un_cnt == 0) { - suptr->un_proc = NULL; - did_something = 1; - *supptr = SLIST_NEXT(suptr, un_next); - break; - } - } + SEMUNDO_LOCKASSERT(MA_OWNED); - /* If we didn't free anything then just give-up */ - if (!did_something) - return(NULL); - } else { - /* - * The second pass failed even though we freed - * something after the first pass! - * This is IMPOSSIBLE! - */ - panic("semu_alloc - second attempt failed"); - } - } - return (NULL); + if (suptr->un_cnt != 0) + return (0); + LIST_REMOVE(suptr, un_next); + LIST_INSERT_HEAD(&semu_free_list, suptr, un_next); + return (1); } /* @@ -420,11 +390,8 @@ semu_alloc(td) */ static int -semundo_adjust(td, supptr, semid, semnum, adjval) - struct thread *td; - struct sem_undo **supptr; - int semid, semnum; - int adjval; +semundo_adjust(struct thread *td, struct sem_undo **supptr, int semid, + int semseq, int semnum, int adjval) { struct proc *p = td->td_proc; struct sem_undo *suptr; @@ -437,7 +404,7 @@ semundo_adjust(td, supptr, semid, semnum suptr = *supptr; if (suptr == NULL) { - SLIST_FOREACH(suptr, &semu_list, un_next) { + LIST_FOREACH(suptr, &semu_list, un_next) { if (suptr->un_proc == p) { *supptr = suptr; break; @@ -448,7 +415,7 @@ semundo_adjust(td, supptr, semid, semnum return(0); suptr = semu_alloc(td); if (suptr == NULL) - return(ENOSPC); + return (ENOSPC); *supptr = suptr; } } @@ -472,58 +439,59 @@ semundo_adjust(td, supptr, semid, semnum if (i < suptr->un_cnt) suptr->un_ent[i] = suptr->un_ent[suptr->un_cnt]; + if (suptr->un_cnt == 0) + semu_try_free(suptr); } - return(0); + return (0); } /* Didn't find the right entry - create it */ if (adjval == 0) - return(0); + return (0); if (adjval > seminfo.semaem || adjval < -seminfo.semaem) return (ERANGE); if (suptr->un_cnt != seminfo.semume) { sunptr = &suptr->un_ent[suptr->un_cnt]; suptr->un_cnt++; sunptr->un_adjval = adjval; - sunptr->un_id = semid; sunptr->un_num = semnum; + sunptr->un_id = semid; + sunptr->un_num = semnum; + sunptr->un_seq = semseq; } else - return(EINVAL); - return(0); + return (EINVAL); + return (0); } static void -semundo_clear(semid, semnum) - int semid, semnum; +semundo_clear(int semid, int semnum) { - struct sem_undo *suptr; + struct sem_undo *suptr, *suptr1; + struct undo *sunptr; + int i; SEMUNDO_LOCKASSERT(MA_OWNED); - SLIST_FOREACH(suptr, &semu_list, un_next) { - struct undo *sunptr = &suptr->un_ent[0]; - int i = 0; - - while (i < suptr->un_cnt) { - if (sunptr->un_id == semid) { - if (semnum == -1 || sunptr->un_num == semnum) { - suptr->un_cnt--; - if (i < suptr->un_cnt) { - suptr->un_ent[i] = - suptr->un_ent[suptr->un_cnt]; - continue; - } + LIST_FOREACH_SAFE(suptr, &semu_list, un_next, suptr1) { + sunptr = &suptr->un_ent[0]; + for (i = 0; i < suptr->un_cnt; i++, sunptr++) { + if (sunptr->un_id != semid) + continue; + if (semnum == -1 || sunptr->un_num == semnum) { + suptr->un_cnt--; + if (i < suptr->un_cnt) { + suptr->un_ent[i] = + suptr->un_ent[suptr->un_cnt]; + continue; } - if (semnum != -1) - break; + semu_try_free(suptr); } - i++, sunptr++; + if (semnum != -1) + break; } } } static int -semvalid(semid, semakptr) - int semid; - struct semid_kernel *semakptr; +semvalid(int semid, struct semid_kernel *semakptr) { return ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || @@ -542,9 +510,7 @@ struct __semctl_args { }; #endif int -__semctl(td, uap) - struct thread *td; - struct __semctl_args *uap; +__semctl(struct thread *td, struct __semctl_args *uap) { struct semid_ds dsbuf; union semun arg, semun; @@ -655,6 +621,8 @@ kern_semctl(struct thread *td, int semid semakptr = &sema[semidx]; sema_mtxp = &sema_mtx[semidx]; + if (cmd == IPC_RMID) + mtx_lock(&sem_mtx); mtx_lock(sema_mtxp); #ifdef MAC error = mac_sysvsem_check_semctl(cred, semakptr, cmd); @@ -673,22 +641,29 @@ kern_semctl(struct thread *td, int semid goto done2; semakptr->u.sem_perm.cuid = cred->cr_uid; semakptr->u.sem_perm.uid = cred->cr_uid; - semtot -= semakptr->u.sem_nsems; + semakptr->u.sem_perm.mode = 0; + SEMUNDO_LOCK(); + semundo_clear(semidx, -1); + SEMUNDO_UNLOCK(); +#ifdef MAC + mac_sysvsem_cleanup(semakptr); +#endif + wakeup(semakptr); + for (i = 0; i < seminfo.semmni; i++) { + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && + sema[i].u.sem_base > semakptr->u.sem_base) + mtx_lock_flags(&sema_mtx[i], LOP_DUPOK); + } for (i = semakptr->u.sem_base - sem; i < semtot; i++) sem[i] = sem[i + semakptr->u.sem_nsems]; for (i = 0; i < seminfo.semmni; i++) { if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && - sema[i].u.sem_base > semakptr->u.sem_base) + sema[i].u.sem_base > semakptr->u.sem_base) { sema[i].u.sem_base -= semakptr->u.sem_nsems; + mtx_unlock(&sema_mtx[i]); + } } - semakptr->u.sem_perm.mode = 0; -#ifdef MAC - mac_sysvsem_cleanup(semakptr); -#endif - SEMUNDO_LOCK(); - semundo_clear(semidx, -1); - SEMUNDO_UNLOCK(); - wakeup(semakptr); + semtot -= semakptr->u.sem_nsems; break; case IPC_SET: @@ -855,6 +830,8 @@ kern_semctl(struct thread *td, int semid done2: mtx_unlock(sema_mtxp); + if (cmd == IPC_RMID) + mtx_unlock(&sem_mtx); if (array != NULL) free(array, M_TEMP); return(error); @@ -868,9 +845,7 @@ struct semget_args { }; #endif int -semget(td, uap) - struct thread *td; - struct semget_args *uap; +semget(struct thread *td, struct semget_args *uap) { int semid, error = 0; int key = uap->key; @@ -882,7 +857,7 @@ semget(td, uap) if (!jail_sysvipc_allowed && jailed(td->td_ucred)) return (ENOSYS); - mtx_lock(&Giant); + mtx_lock(&sem_mtx); if (key != IPC_PRIVATE) { for (semid = 0; semid < seminfo.semmni; semid++) { if ((sema[semid].u.sem_perm.mode & SEM_ALLOC) && @@ -968,7 +943,7 @@ semget(td, uap) found: td->td_retval[0] = IXSEQ_TO_IPCID(semid, sema[semid].u.sem_perm); done2: - mtx_unlock(&Giant); + mtx_unlock(&sem_mtx); return (error); } @@ -980,9 +955,7 @@ struct semop_args { }; #endif int -semop(td, uap) - struct thread *td; - struct semop_args *uap; +semop(struct thread *td, struct semop_args *uap) { #define SMALL_SOPS 8 struct sembuf small_sops[SMALL_SOPS]; @@ -997,6 +970,7 @@ semop(td, uap) size_t i, j, k; int error; int do_wakeup, do_undos; + unsigned short seq; #ifdef SEM_DEBUG sops = NULL; @@ -1036,7 +1010,8 @@ semop(td, uap) error = EINVAL; goto done2; } - if (semakptr->u.sem_perm.seq != IPCID_TO_SEQ(uap->semid)) { + seq = semakptr->u.sem_perm.seq; + if (seq != IPCID_TO_SEQ(uap->semid)) { error = EINVAL; goto done2; } @@ -1160,8 +1135,9 @@ semop(td, uap) /* * Make sure that the semaphore still exists */ + seq = semakptr->u.sem_perm.seq; if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || - semakptr->u.sem_perm.seq != IPCID_TO_SEQ(uap->semid)) { + seq != IPCID_TO_SEQ(uap->semid)) { error = EIDRM; goto done2; } @@ -1213,7 +1189,7 @@ done: adjval = sops[i].sem_op; if (adjval == 0) continue; - error = semundo_adjust(td, &suptr, semid, + error = semundo_adjust(td, &suptr, semid, seq, sops[i].sem_num, -adjval); if (error == 0) continue; @@ -1234,7 +1210,7 @@ done: adjval = sops[k].sem_op; if (adjval == 0) continue; - if (semundo_adjust(td, &suptr, semid, + if (semundo_adjust(td, &suptr, semid, seq, sops[k].sem_num, adjval) != 0) panic("semop - can't undo undos"); } @@ -1281,28 +1257,28 @@ done2: * semaphores. */ static void -semexit_myhook(arg, p) - void *arg; - struct proc *p; +semexit_myhook(void *arg, struct proc *p) { struct sem_undo *suptr; - struct sem_undo **supptr; + struct semid_kernel *semakptr; + struct mtx *sema_mtxp; + int semid, semnum, adjval, ix; + unsigned short seq; /* * Go through the chain of undo vectors looking for one * associated with this process. */ SEMUNDO_LOCK(); - SLIST_FOREACH_PREVPTR(suptr, supptr, &semu_list, un_next) { - if (suptr->un_proc == p) { - *supptr = SLIST_NEXT(suptr, un_next); + LIST_FOREACH(suptr, &semu_list, un_next) { + if (suptr->un_proc == p) break; - } } - SEMUNDO_UNLOCK(); - - if (suptr == NULL) + if (suptr == NULL) { + SEMUNDO_UNLOCK(); return; + } + LIST_REMOVE(suptr, un_next); DPRINTF(("proc @%p has undo structure with %d entries\n", p, suptr->un_cnt)); @@ -1311,21 +1287,21 @@ semexit_myhook(arg, p) * If there are any active undo elements then process them. */ if (suptr->un_cnt > 0) { - int ix; - + SEMUNDO_UNLOCK(); for (ix = 0; ix < suptr->un_cnt; ix++) { - int semid = suptr->un_ent[ix].un_id; - int semnum = suptr->un_ent[ix].un_num; - int adjval = suptr->un_ent[ix].un_adjval; - struct semid_kernel *semakptr; - struct mtx *sema_mtxp; - + semid = suptr->un_ent[ix].un_id; + semnum = suptr->un_ent[ix].un_num; + adjval = suptr->un_ent[ix].un_adjval; + seq = suptr->un_ent[ix].un_seq; semakptr = &sema[semid]; sema_mtxp = &sema_mtx[semid]; + mtx_lock(sema_mtxp); - SEMUNDO_LOCK(); - if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0) - panic("semexit - semid not allocated"); + if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || + (semakptr->u.sem_perm.seq != seq)) { + mtx_unlock(sema_mtxp); + continue; + } if (semnum >= semakptr->u.sem_nsems) panic("semexit - semnum out of range"); @@ -1336,29 +1312,26 @@ semexit_myhook(arg, p) suptr->un_ent[ix].un_adjval, semakptr->u.sem_base[semnum].semval)); - if (adjval < 0) { - if (semakptr->u.sem_base[semnum].semval < - -adjval) - semakptr->u.sem_base[semnum].semval = 0; - else - semakptr->u.sem_base[semnum].semval += - adjval; - } else + if (adjval < 0 && semakptr->u.sem_base[semnum].semval < + -adjval) + semakptr->u.sem_base[semnum].semval = 0; + else semakptr->u.sem_base[semnum].semval += adjval; wakeup(semakptr); DPRINTF(("semexit: back from wakeup\n")); mtx_unlock(sema_mtxp); - SEMUNDO_UNLOCK(); } + SEMUNDO_LOCK(); } /* * Deallocate the undo vector. */ DPRINTF(("removing vector\n")); - SEMUNDO_LOCK(); suptr->un_proc = NULL; + suptr->un_cnt = 0; + LIST_INSERT_HEAD(&semu_free_list, suptr, un_next); SEMUNDO_UNLOCK(); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 15:43:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B0C9106581D; Wed, 14 Jan 2009 15:43:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BF25F8FC1B; Wed, 14 Jan 2009 15:43:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6317F46B03; Wed, 14 Jan 2009 10:43:31 -0500 (EST) Date: Wed, 14 Jan 2009 15:43:31 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Julian Elischer In-Reply-To: <49697140.30205@elischer.org> Message-ID: References: <200901091602.n09G2Jj1061164@svn.freebsd.org> <4967A500.30205@fsn.hu> <4967B6D9.90001@elischer.org> <4967C539.2060803@fsn.hu> <49686A30.4000205@fsn.hu> <49697140.30205@elischer.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Attila Nagy , Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r186955 - in head/sys: conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 15:43:34 -0000 On Sat, 10 Jan 2009, Julian Elischer wrote: >>> I'm happy to (eventually) also implement the BSDI API once I actually >>> spend time looking at what the difference in behaviours are. If we're >>> lucky, the only difference is where the socket option hooks in and the >>> actual network behaviour is the same. >>> >>> (Meanwhile, I think I have to go off and implement this particular >>> behaviour in Squid, and see if the OpenBSD support indeed does function as >>> advertised.) >> >> If the API turns out to be effectly semantically the same, or better, then >> I think the suggestion is to entirely replace, rather than supplement, the >> socket option you just added with it. There's no point in having >> pointlessly divergent APIs where it can be avoided. > > I think just making the name the same should be enough.. Well, I think that depends. If it's a SOL_SOCKET-layer option, we still need some way for the protocol layer to either accept or veto setting the option, depending on whether it supports it. For example, I think SPX sockets should reject the option being set if they don't support it, so we'll need to figure out something there to either pass down the SOL_SOCKET option explicitly, or check with the protocol somehow as to whether or not to accept it. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 16:13:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1BC810656CA; Wed, 14 Jan 2009 16:13:51 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9B58FC08; Wed, 14 Jan 2009 16:13:51 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EGDpFS047743; Wed, 14 Jan 2009 16:13:51 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EGDp6o047742; Wed, 14 Jan 2009 16:13:51 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901141613.n0EGDp6o047742@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 16:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187225 - stable/7/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 16:13:54 -0000 Author: luigi Date: Wed Jan 14 16:13:51 2009 New Revision: 187225 URL: http://svn.freebsd.org/changeset/base/187225 Log: forced commit to remind that the previous commit also merged the change in rev.185132 to reduce the amount of memory used when loading a script. Modified: stable/7/sys/boot/common/interp.c Modified: stable/7/sys/boot/common/interp.c ============================================================================== --- stable/7/sys/boot/common/interp.c Wed Jan 14 16:03:10 2009 (r187224) +++ stable/7/sys/boot/common/interp.c Wed Jan 14 16:13:51 2009 (r187225) @@ -46,7 +46,7 @@ extern FICL_VM *bf_vm; #define RETURN(x) return(x) #endif -#define MAXARGS 20 /* maximum number of arguments allowed */ +#define MAXARGS 20 /* maximum number of arguments allowed */ static void prompt(void); From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 16:27:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64854106567D; Wed, 14 Jan 2009 16:27:04 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5294C8FC16; Wed, 14 Jan 2009 16:27:04 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EGR4ju048041; Wed, 14 Jan 2009 16:27:04 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EGR4Jj048040; Wed, 14 Jan 2009 16:27:04 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200901141627.n0EGR4Jj048040@svn.freebsd.org> From: Ken Smith Date: Wed, 14 Jan 2009 16:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187226 - stable/7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 16:27:05 -0000 Author: kensmith Date: Wed Jan 14 16:27:04 2009 New Revision: 187226 URL: http://svn.freebsd.org/changeset/base/187226 Log: Oops, forgot to mention 7.1-RELEASE in stable/7... Submitted by: Florian Smeets Modified: stable/7/UPDATING Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Wed Jan 14 16:13:51 2009 (r187225) +++ stable/7/UPDATING Wed Jan 14 16:27:04 2009 (r187226) @@ -23,6 +23,9 @@ portupgrade. hw.snd.default_unit sysctl according to sound(4) and snd_hda(4) man pages. +20090106: + FreeBSD 7.1-RELEASE + 20080903: ntpd has been upgraded to 4.2.4p5. From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 16:54:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E95DB1065678; Wed, 14 Jan 2009 16:54:12 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id B7CA48FC20; Wed, 14 Jan 2009 16:54:12 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n0EGs91L020593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Jan 2009 08:54:10 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <496E18B1.5020501@freebsd.org> Date: Wed, 14 Jan 2009 08:54:09 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Hans Petter Selasky References: <200901131901.n0DJ1EF1011980@svn.freebsd.org> <20090114012719.6145076a.stas@FreeBSD.org> <496D1CE0.40401@freebsd.org> <200901141059.20295.hselasky@c2i.net> In-Reply-To: <200901141059.20295.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187162 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 16:54:14 -0000 Hans Petter Selasky wrote: > On Tuesday 13 January 2009, Sam Leffler wrote: > >> Stanislav Sedov wrote: >> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> Hi! >>> >>> Would it make sense to rename usbconfig to something like "usbcontrol" >>> to follow the *control tradition (cdcontrol, pmccontrol, vidcontrol, and >>> so on)? >>> >> I don't care what it's called but I think it is important that a >> (sym)link to it named usbdevs w/ provide output that is compatible w/ >> the old tool. >> >> Sam >> > > I tried to make it similar to "ifconfig". > > That's fine. My point was that when running the new usb stack usbdevs does this: trouble% usbdevs trouble% usbdevs -v usbdevs: no USB controllers found while usbconfig does this: trouble% usbconfig ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen2.1: at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen2.2: at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE ugen2.3: at usbus2, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON ugen2.4: at usbus2, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON ugen2.5: at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON None of these match the existing behaviour of usbdevs w/ the current stack and we will need that when we switch the default stack to avoid breaking 3rd party scripts that parse the output. Sam From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 17:04:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D6AD10657B0; Wed, 14 Jan 2009 17:04:40 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 3D9EB8FC1D; Wed, 14 Jan 2009 17:04:40 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 9E80C3F129; Wed, 14 Jan 2009 17:04:38 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id n0EH4baj047326; Wed, 14 Jan 2009 17:04:38 GMT (envelope-from phk@critter.freebsd.dk) To: Sam Leffler From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 14 Jan 2009 08:54:09 PST." <496E18B1.5020501@freebsd.org> Date: Wed, 14 Jan 2009 17:04:37 +0000 Message-ID: <47325.1231952677@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky Subject: Re: svn commit: r187162 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 17:04:41 -0000 In message <496E18B1.5020501@freebsd.org>, Sam Leffler writes: >That's fine. My point was that when running the new usb stack usbdevs >does this: > >trouble% usbdevs >trouble% usbdevs -v >usbdevs: no USB controllers found Couldn't it just say: New USB stack found, check usbconfig(8) man-page. Adding backwards command line compatibility sounds silly... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 17:07:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45EF410657A0; Wed, 14 Jan 2009 17:07:47 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 88ECF8FC23; Wed, 14 Jan 2009 17:07:46 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n0EH7hIV020729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Jan 2009 09:07:44 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <496E1BDF.5060106@freebsd.org> Date: Wed, 14 Jan 2009 09:07:43 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Poul-Henning Kamp References: <47325.1231952677@critter.freebsd.dk> In-Reply-To: <47325.1231952677@critter.freebsd.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky Subject: Re: svn commit: r187162 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 17:07:50 -0000 Poul-Henning Kamp wrote: > In message <496E18B1.5020501@freebsd.org>, Sam Leffler writes: > > >> That's fine. My point was that when running the new usb stack usbdevs >> does this: >> >> trouble% usbdevs >> trouble% usbdevs -v >> usbdevs: no USB controllers found >> > > Couldn't it just say: > > New USB stack found, check usbconfig(8) man-page. > > Adding backwards command line compatibility sounds silly... > > I don't agree. I'll look into it. Sam From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 17:27:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 956261065723; Wed, 14 Jan 2009 17:27:52 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 4AA248FC0A; Wed, 14 Jan 2009 17:27:52 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 9A0AC210FF1; Wed, 14 Jan 2009 12:27:51 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Wed, 14 Jan 2009 12:27:51 -0500 X-Sasl-enc: iRyBtFV0vxz5RjtkEGhgW7i6YY5fu6hlILbXW6OT2qAr 1231954071 Received: from empiric.lon.incunabulum.net (radius-82-150-131-239.dsdeurne.nl [82.150.131.239]) by mail.messagingengine.com (Postfix) with ESMTPSA id D46B22B7E6; Wed, 14 Jan 2009 12:27:50 -0500 (EST) Message-ID: <496E2095.3080705@FreeBSD.org> Date: Wed, 14 Jan 2009 17:27:49 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.19 (X11/20090107) MIME-Version: 1.0 To: Alexander Motin References: <200901131627.n0DGR4Xu008500@svn.freebsd.org> In-Reply-To: <200901131627.n0DGR4Xu008500@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187154 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 17:27:53 -0000 Alexander Motin wrote: > Log: > Change configuration order to enable output only after codec is configured. > Mute all mixer controllable amplifiers initially to let mixer to unmute > only some of them later. This should reduce clicks and noises during boot. > This change, uh, sounds cool... From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 18:13:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C80410657B3; Wed, 14 Jan 2009 18:13:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id B3A478FC1C; Wed, 14 Jan 2009 18:13:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 231633243; Wed, 14 Jan 2009 20:13:45 +0200 Message-ID: <496E2B5E.3010703@FreeBSD.org> Date: Wed, 14 Jan 2009 20:13:50 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.17 (X11/20081029) MIME-Version: 1.0 To: "Bruce M. Simpson" References: <200901131627.n0DGR4Xu008500@svn.freebsd.org> <496E2095.3080705@FreeBSD.org> In-Reply-To: <496E2095.3080705@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187154 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 18:13:49 -0000 Bruce M. Simpson wrote: > Alexander Motin wrote: >> Log: >> Change configuration order to enable output only after codec is >> configured. >> Mute all mixer controllable amplifiers initially to let mixer to unmute >> only some of them later. This should reduce clicks and noises during >> boot. > > This change, uh, sounds cool... Change iself or the result? :) -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 18:23:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA35710656CE; Wed, 14 Jan 2009 18:23:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89888FC0A; Wed, 14 Jan 2009 18:23:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EIND0V050412; Wed, 14 Jan 2009 18:23:13 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EINDgS050409; Wed, 14 Jan 2009 18:23:13 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901141823.n0EINDgS050409@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 18:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187229 - in stable/7/usr.bin: calendar cksum comm cpuset fetch file gzip ipcrm ipcs kdump ktrace ldd lockf logger make netstat nsupdate procstat sed shar su tar top truncate truss unit... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 18:23:17 -0000 Author: sam Date: Wed Jan 14 18:23:13 2009 New Revision: 187229 URL: http://svn.freebsd.org/changeset/base/187229 Log: bring in bits missed in r187106: sync build infrastructure changes with HEAD Noticed by: attilio Modified: stable/7/usr.bin/calendar/ (props changed) stable/7/usr.bin/cksum/ (props changed) stable/7/usr.bin/comm/ (props changed) stable/7/usr.bin/cpuset/ (props changed) stable/7/usr.bin/fetch/ (props changed) stable/7/usr.bin/file/ (props changed) stable/7/usr.bin/gzip/ (props changed) stable/7/usr.bin/ipcrm/ (props changed) stable/7/usr.bin/ipcs/ (props changed) stable/7/usr.bin/kdump/ (props changed) stable/7/usr.bin/ktrace/ (props changed) stable/7/usr.bin/ldd/ (props changed) stable/7/usr.bin/lockf/ (props changed) stable/7/usr.bin/logger/ (props changed) stable/7/usr.bin/make/ (props changed) stable/7/usr.bin/netstat/ (props changed) stable/7/usr.bin/netstat/Makefile stable/7/usr.bin/netstat/main.c stable/7/usr.bin/netstat/netstat.h stable/7/usr.bin/nsupdate/ (props changed) stable/7/usr.bin/procstat/ (props changed) stable/7/usr.bin/sed/ (props changed) stable/7/usr.bin/shar/ (props changed) stable/7/usr.bin/su/ (props changed) stable/7/usr.bin/tar/ (props changed) stable/7/usr.bin/top/ (props changed) stable/7/usr.bin/truncate/ (props changed) stable/7/usr.bin/truss/ (props changed) stable/7/usr.bin/units/ (props changed) stable/7/usr.bin/vmstat/ (props changed) stable/7/usr.bin/whereis/ (props changed) stable/7/usr.bin/window/ (props changed) stable/7/usr.bin/xargs/ (props changed) Modified: stable/7/usr.bin/netstat/Makefile ============================================================================== --- stable/7/usr.bin/netstat/Makefile Wed Jan 14 18:19:06 2009 (r187228) +++ stable/7/usr.bin/netstat/Makefile Wed Jan 14 18:23:13 2009 (r187229) @@ -5,7 +5,7 @@ PROG= netstat SRCS= if.c inet.c main.c mbuf.c mcast.c mroute.c route.c \ - unix.c atalk.c netgraph.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c + unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 CFLAGS+=-fno-strict-aliasing @@ -20,8 +20,15 @@ CFLAGS+=-DINET6 BINGRP= kmem BINMODE=2555 -DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBNETGRAPH} ${LIBUTIL} -LDADD= -lkvm -lmemstat -lnetgraph -lutil +DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL} +LDADD= -lkvm -lmemstat -lutil + +.if ${MK_NETGRAPH_SUPPORT} != "no" +SRCS+= netgraph.c +DPADD+= ${LIBNETGRAPH} +LDADD+= -lnetgraph +CFLAGS+=-DNETGRAPH +.endif .if ${MK_IPX_SUPPORT} != "no" SRCS+= ipx.c Modified: stable/7/usr.bin/netstat/main.c ============================================================================== --- stable/7/usr.bin/netstat/main.c Wed Jan 14 18:19:06 2009 (r187228) +++ stable/7/usr.bin/netstat/main.c Wed Jan 14 18:23:13 2009 (r187229) @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include +#ifdef NETGRAPH #include +#endif #include #include @@ -272,7 +274,7 @@ struct protox atalkprotox[] = { { -1, -1, 0, NULL, NULL, NULL, NULL, 0, 0 } }; - +#ifdef NETGRAPH struct protox netgraphprotox[] = { { N_NGSOCKS, -1, 1, netgraphprotopr, NULL, NULL, "ctrl", 0, 0 }, @@ -281,7 +283,7 @@ struct protox netgraphprotox[] = { { -1, -1, 0, NULL, NULL, NULL, NULL, 0, 0 } }; - +#endif #ifdef IPX struct protox ipxprotox[] = { { N_IPX, N_IPXSTAT, 1, ipxprotopr, @@ -383,9 +385,11 @@ main(int argc, char *argv[]) af = AF_UNIX; else if (strcmp(optarg, "atalk") == 0) af = AF_APPLETALK; +#ifdef NETGRAPH else if (strcmp(optarg, "ng") == 0 || strcmp(optarg, "netgraph") == 0) af = AF_NETGRAPH; +#endif else if (strcmp(optarg, "link") == 0) af = AF_LINK; else { @@ -580,9 +584,11 @@ main(int argc, char *argv[]) if (af == AF_APPLETALK || af == AF_UNSPEC) for (tp = atalkprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); +#ifdef NETGRAPH if (af == AF_NETGRAPH || af == AF_UNSPEC) for (tp = netgraphprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); +#endif /* NETGRAPH */ if ((af == AF_UNIX || af == AF_UNSPEC) && !Lflag && !sflag) unixpr(nl[N_UNP_COUNT].n_value, nl[N_UNP_GENCNT].n_value, nl[N_UNP_DHEAD].n_value, nl[N_UNP_SHEAD].n_value); Modified: stable/7/usr.bin/netstat/netstat.h ============================================================================== --- stable/7/usr.bin/netstat/netstat.h Wed Jan 14 18:19:06 2009 (r187228) +++ stable/7/usr.bin/netstat/netstat.h Wed Jan 14 18:23:13 2009 (r187229) @@ -144,7 +144,9 @@ void nserr_stats(u_long, const char *, i void atalkprotopr(u_long, const char *, int, int); void ddp_stats(u_long, const char *, int, int); +#ifdef NETGRAPH void netgraphprotopr(u_long, const char *, int, int); +#endif void unixpr(u_long, u_long, u_long, u_long); From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 19:21:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5ACA1065680; Wed, 14 Jan 2009 19:21:05 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from people.fsn.hu (people.fsn.hu [195.228.252.137]) by mx1.freebsd.org (Postfix) with ESMTP id 0B3818FC22; Wed, 14 Jan 2009 19:20:57 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from [172.27.51.4] (fw.axelero.hu [195.228.243.120]) by people.fsn.hu (Postfix) with ESMTP id 0F8EFAAB2A; Wed, 14 Jan 2009 20:20:56 +0100 (CET) Message-ID: <496E3B17.1030403@fsn.hu> Date: Wed, 14 Jan 2009 20:20:55 +0100 From: Attila Nagy User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Sam Leffler References: <200901141823.n0EINDgS050409@svn.freebsd.org> In-Reply-To: <200901141823.n0EINDgS050409@svn.freebsd.org> X-Stationery: 0.4.8.12 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (people.fsn.hu [0.0.0.0]); Wed, 14 Jan 2009 20:20:56 +0100 (CET) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r187229 - in stable/7/usr.bin: calendar cksum comm cpuset fetch file gzip ipcrm ipcs kdump ktrace ldd lockf logger make netstat nsupdate procstat sed shar su tar top truncate truss unit... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 19:21:06 -0000 Hello, Sam Leffler wrote: > Author: sam > Date: Wed Jan 14 18:23:13 2009 > New Revision: 187229 > URL: http://svn.freebsd.org/changeset/base/187229 > > Log: > bring in bits missed in r187106: sync build infrastructure changes with HEAD > > Noticed by: attilio > Cool nick, thanks, but I think it's already taken. ;) From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 20:16:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54A71106564A; Wed, 14 Jan 2009 20:16:45 +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 43AE58FC20; Wed, 14 Jan 2009 20:16:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EKGjD2052772; Wed, 14 Jan 2009 20:16:45 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EKGjmK052771; Wed, 14 Jan 2009 20:16:45 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200901142016.n0EKGjmK052771@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 14 Jan 2009 20:16: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: r187236 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 20:16:45 -0000 Author: gonzo Date: Wed Jan 14 20:16:44 2009 New Revision: 187236 URL: http://svn.freebsd.org/changeset/base/187236 Log: o Move $FreeBSD$ from comment to __FBSDID macro o Be a bit more verbose about CPU type during boot process (print manufacturer, chip info, MMU and cache parameters) Modified: head/sys/mips/mips/cpu.c Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Wed Jan 14 20:03:50 2009 (r187235) +++ head/sys/mips/mips/cpu.c Wed Jan 14 20:16:44 2009 (r187236) @@ -22,9 +22,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -132,6 +134,8 @@ mips_cpu_init(void) mips_icache_sync_all(); mips_dcache_wbinv_all(); + /* Print some info about CPU */ + cpu_identify(); } void From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 20:27:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97A1410656E9; Wed, 14 Jan 2009 20:27:49 +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 83E888FC17; Wed, 14 Jan 2009 20:27:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EKRn0g053011; Wed, 14 Jan 2009 20:27:49 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EKRnYS053010; Wed, 14 Jan 2009 20:27:49 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200901142027.n0EKRnYS053010@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 14 Jan 2009 20:27: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: r187237 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 20:27:51 -0000 Author: gonzo Date: Wed Jan 14 20:27:49 2009 New Revision: 187237 URL: http://svn.freebsd.org/changeset/base/187237 Log: o NO_DMA is no longer required as bug with PIIX4 emulation has been fixed in GXEmul Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Wed Jan 14 20:16:44 2009 (r187236) +++ head/sys/mips/mips/busdma_machdep.c Wed Jan 14 20:27:49 2009 (r187237) @@ -25,8 +25,6 @@ * */ -#define NO_DMA - /*- * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. * All rights reserved. From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 20:36:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE2E910656BB; Wed, 14 Jan 2009 20:36:58 +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 B23428FC1E; Wed, 14 Jan 2009 20:36:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EKawZH053225; Wed, 14 Jan 2009 20:36:58 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EKawM6053224; Wed, 14 Jan 2009 20:36:58 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200901142036.n0EKawM6053224@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 14 Jan 2009 20:36: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: r187238 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 20:37:00 -0000 Author: gonzo Date: Wed Jan 14 20:36:58 2009 New Revision: 187238 URL: http://svn.freebsd.org/changeset/base/187238 Log: o Make debug output conditional Modified: head/sys/mips/mips/nexus.c Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Wed Jan 14 20:27:49 2009 (r187237) +++ head/sys/mips/mips/nexus.c Wed Jan 14 20:36:58 2009 (r187238) @@ -58,6 +58,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef NEXUS_DEBUG +#define dprintf printf +#else +#define dprintf(x, arg...) +#endif /* NEXUS_DEBUG */ + static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -253,7 +259,7 @@ nexus_hinted_child(device_t bus, const c resource_long_value(dname, dunit, "maddr", &maddr); resource_int_value(dname, dunit, "msize", &msize); - printf("%s: discovered hinted child %s at maddr %p(%d)\n", + dprintf("%s: discovered hinted child %s at maddr %p(%d)\n", __func__, device_get_nameunit(child), (void *)(intptr_t)maddr, msize); @@ -298,10 +304,10 @@ nexus_alloc_resource(device_t bus, devic struct rman *rm; int isdefault, needactivate, passthrough; - printf("%s: entry (%p, %p, %d, %p, %p, %p, %ld, %d)\n", + dprintf("%s: entry (%p, %p, %d, %p, %p, %p, %ld, %d)\n", __func__, bus, child, type, rid, (void *)(intptr_t)start, (void *)(intptr_t)end, count, flags); - printf("%s: requested rid is %d\n", __func__, *rid); + dprintf("%s: requested rid is %d\n", __func__, *rid); isdefault = (start == 0UL && end == ~0UL && count == 1); needactivate = flags & RF_ACTIVE; @@ -408,7 +414,7 @@ nexus_set_resource(device_t dev, device_ struct resource_list *rl = &ndev->nx_resources; struct resource_list_entry *rle; - printf("%s: entry (%p, %p, %d, %d, %p, %ld)\n", + dprintf("%s: entry (%p, %p, %d, %d, %p, %ld)\n", __func__, dev, child, type, rid, (void *)(intptr_t)start, count); rle = resource_list_add(rl, type, rid, start, start + count - 1, @@ -443,7 +449,7 @@ nexus_delete_resource(device_t dev, devi struct nexus_device *ndev = DEVTONX(child); struct resource_list *rl = &ndev->nx_resources; - printf("%s: entry\n", __func__); + dprintf("%s: entry\n", __func__); resource_list_delete(rl, type, rid); } @@ -452,7 +458,7 @@ static int nexus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - printf("%s: entry\n", __func__); + dprintf("%s: entry\n", __func__); if (rman_get_flags(r) & RF_ACTIVE) { int error = bus_deactivate_resource(child, type, rid, r); From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 20:53:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 954421065670; Wed, 14 Jan 2009 20:53:46 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8482B8FC0C; Wed, 14 Jan 2009 20:53:46 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EKrk4C053607; Wed, 14 Jan 2009 20:53:46 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EKrkXm053606; Wed, 14 Jan 2009 20:53:46 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901142053.n0EKrkXm053606@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 20:53: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: r187239 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 20:53:47 -0000 Author: luigi Date: Wed Jan 14 20:53:46 2009 New Revision: 187239 URL: http://svn.freebsd.org/changeset/base/187239 Log: remove unused argument to print_s0() Submitted by: Christoph Mallon MFC after: 3 days Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Wed Jan 14 20:36:58 2009 (r187238) +++ head/sbin/fdisk/fdisk.c Wed Jan 14 20:53:46 2009 (r187239) @@ -216,7 +216,7 @@ static struct part_type ,{0xFF, "Xenix bad blocks table"} }; -static void print_s0(int which); +static void print_s0(void); static void print_part(int i); static void init_sector0(unsigned long start); static void init_boot(void); @@ -373,7 +373,7 @@ main(int argc, char *argv[]) dos_sectors; dos(partp); if (v_flag) - print_s0(-1); + print_s0(); if (!t_flag) write_s0(); exit(0); @@ -384,7 +384,7 @@ main(int argc, char *argv[]) if (!read_config(f_flag)) exit(1); if (v_flag) - print_s0(-1); + print_s0(); if (!t_flag) write_s0(); } else { @@ -416,7 +416,7 @@ main(int argc, char *argv[]) printf("\nWe haven't changed the partition table yet. "); printf("This is your last chance.\n"); } - print_s0(-1); + print_s0(); if (!t_flag) { if (ok("Should we write new partition table?")) write_s0(); @@ -439,17 +439,14 @@ usage() } static void -print_s0(int which) +print_s0(void) { int i; print_params(); printf("Information from DOS bootblock is:\n"); - if (which == -1) - for (i = 1; i <= NDOSPART; i++) - printf("%d: ", i), print_part(i); - else - print_part(which); + for (i = 1; i <= NDOSPART; i++) + printf("%d: ", i), print_part(i); } static struct dos_partition mtpart; @@ -872,7 +869,7 @@ write_s0() int sector, i; if (iotest) { - print_s0(-1); + print_s0(); return 0; } for(i = 0; i < NDOSPART; i++) From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 21:04:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF3681065680; Wed, 14 Jan 2009 21:04:23 +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 9D2848FC1E; Wed, 14 Jan 2009 21:04:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EL4N1r053848; Wed, 14 Jan 2009 21:04:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EL4NFm053847; Wed, 14 Jan 2009 21:04:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901142104.n0EL4NFm053847@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Jan 2009 21:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187240 - in stable/7/sys: . contrib/pf dev/cxgb dev/dcons X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:04:24 -0000 Author: marius Date: Wed Jan 14 21:04:23 2009 New Revision: 187240 URL: http://svn.freebsd.org/changeset/base/187240 Log: MFC: r185108 Given that the buffer dcons_crom(4) exposes is used for both input and output, set BUS_DMA_COHERENT when creating the DMA map used for loading the buffer. As a side-effect this solves locking issues on sparc64 when dcons(4) calls bus_dmamap_sync(9) while in an interrupt filter, which are executed in a critical section, and iommu(4) has to use a sleep lock when taking advantage of the streaming buffer. Reported and tested by: kensmith Approved by: simokawa Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/dcons/dcons_crom.c Modified: stable/7/sys/dev/dcons/dcons_crom.c ============================================================================== --- stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 20:53:46 2009 (r187239) +++ stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 21:04:23 2009 (r187240) @@ -229,7 +229,7 @@ dcons_crom_attach(device_t dev) /*lockarg*/&Giant, #endif &sc->dma_tag); - bus_dmamap_create(sc->dma_tag, 0, &sc->dma_map); + bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)dcons_conf->buf, dcons_conf->size, dmamap_cb, sc, 0); From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 21:08:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B2EA106564A; Wed, 14 Jan 2009 21:08:20 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5BD8FC08; Wed, 14 Jan 2009 21:08:20 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EL8JTV053968; Wed, 14 Jan 2009 21:08:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EL8JYF053967; Wed, 14 Jan 2009 21:08:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901142108.n0EL8JYF053967@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 21:08: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: r187241 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:08:20 -0000 Author: luigi Date: Wed Jan 14 21:08:19 2009 New Revision: 187241 URL: http://svn.freebsd.org/changeset/base/187241 Log: more changes from Christoph: pass a pointer instead of an index to print_part() so it does not depend on a static variable. Submitted by: Christoph Mallon MFC after: 3 days Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Wed Jan 14 21:04:23 2009 (r187240) +++ head/sbin/fdisk/fdisk.c Wed Jan 14 21:08:19 2009 (r187241) @@ -217,7 +217,7 @@ static struct part_type }; static void print_s0(void); -static void print_part(int i); +static void print_part(const struct dos_partition *); static void init_sector0(unsigned long start); static void init_boot(void); static void change_part(int i); @@ -445,20 +445,19 @@ print_s0(void) print_params(); printf("Information from DOS bootblock is:\n"); - for (i = 1; i <= NDOSPART; i++) - printf("%d: ", i), print_part(i); + for (i = 1; i <= NDOSPART; i++) { + printf("%d: ", i); + print_part(&mboot.parts[i - 1]); + } } static struct dos_partition mtpart; static void -print_part(int i) +print_part(const struct dos_partition *partp) { - struct dos_partition *partp; u_int64_t part_mb; - partp = &mboot.parts[i - 1]; - if (!bcmp(partp, &mtpart, sizeof (struct dos_partition))) { printf("\n"); return; @@ -546,18 +545,18 @@ change_part(int i) struct dos_partition *partp = &mboot.parts[i - 1]; printf("The data for partition %d is:\n", i); - print_part(i); + print_part(partp); if (u_flag && ok("Do you want to change it?")) { int tmp; if (i_flag) { - bzero(partp, sizeof (*partp)); - if (i == 1) { - init_sector0(1); - printf("\nThe static data for the slice 1 has been reinitialized to:\n"); - print_part(i); - } + bzero(partp, sizeof (*partp)); + if (i == 1) { + init_sector0(1); + printf("\nThe static data for the slice 1 has been reinitialized to:\n"); + print_part(partp); + } } do { @@ -594,7 +593,7 @@ change_part(int i) } else dos(partp); - print_part(i); + print_part(partp); } while (!ok("Are we happy with this entry?")); } } From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 21:08:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAEF51065754; Wed, 14 Jan 2009 21:08:43 +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 B8CB98FC2E; Wed, 14 Jan 2009 21:08:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EL8hOS054013; Wed, 14 Jan 2009 21:08:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EL8hZj054012; Wed, 14 Jan 2009 21:08:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901142108.n0EL8hZj054012@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Jan 2009 21:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187242 - in stable/6/sys: . dev/dcons X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:08:45 -0000 Author: marius Date: Wed Jan 14 21:08:43 2009 New Revision: 187242 URL: http://svn.freebsd.org/changeset/base/187242 Log: MFC: r185108 Given that the buffer dcons_crom(4) exposes is used for both input and output, set BUS_DMA_COHERENT when creating the DMA map used for loading the buffer. As a side-effect this solves locking issues on sparc64 when dcons(4) calls bus_dmamap_sync(9) while in an interrupt filter, which are executed in a critical section, and iommu(4) has to use a sleep lock when taking advantage of the streaming buffer. Reported and tested by: kensmith Approved by: simokawa Modified: stable/6/sys/ (props changed) stable/6/sys/dev/dcons/dcons_crom.c Modified: stable/6/sys/dev/dcons/dcons_crom.c ============================================================================== --- stable/6/sys/dev/dcons/dcons_crom.c Wed Jan 14 21:08:19 2009 (r187241) +++ stable/6/sys/dev/dcons/dcons_crom.c Wed Jan 14 21:08:43 2009 (r187242) @@ -196,7 +196,7 @@ dcons_crom_attach(device_t dev) /*lockarg*/&Giant, #endif &sc->dma_tag); - bus_dmamap_create(sc->dma_tag, 0, &sc->dma_map); + bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)dcons_conf->buf, dcons_conf->size, dmamap_cb, sc, 0); From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 21:25:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D412D1065694; Wed, 14 Jan 2009 21:25:17 +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 C307C8FC2A; Wed, 14 Jan 2009 21:25:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ELPHUs054347; Wed, 14 Jan 2009 21:25:17 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ELPHIR054346; Wed, 14 Jan 2009 21:25:17 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901142125.n0ELPHIR054346@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 14 Jan 2009 21:25:17 +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: r187243 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:25:18 -0000 Author: trasz Date: Wed Jan 14 21:25:17 2009 New Revision: 187243 URL: http://svn.freebsd.org/changeset/base/187243 Log: Add missing 'break' statement. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 3927 Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Jan 14 21:08:43 2009 (r187242) +++ head/sys/cam/scsi/scsi_all.c Wed Jan 14 21:25:17 2009 (r187243) @@ -3432,6 +3432,7 @@ scsi_print_inquiry(struct scsi_inquiry_d break; case T_NODEVICE: dtype = "Uninstalled"; + break; default: dtype = "unknown"; break; From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 21:27:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBFFD10657EE; Wed, 14 Jan 2009 21:27:30 +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 DA04B8FC17; Wed, 14 Jan 2009 21:27:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ELRUpw054415; Wed, 14 Jan 2009 21:27:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ELRUMe054414; Wed, 14 Jan 2009 21:27:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901142127.n0ELRUMe054414@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 14 Jan 2009 21:27:30 +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: r187244 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:27:32 -0000 Author: trasz Date: Wed Jan 14 21:27:30 2009 New Revision: 187244 URL: http://svn.freebsd.org/changeset/base/187244 Log: Remove unused variable. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 3665 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Jan 14 21:25:17 2009 (r187243) +++ head/sys/cam/scsi/scsi_da.c Wed Jan 14 21:27:30 2009 (r187244) @@ -1021,7 +1021,6 @@ daasync(void *callback_arg, u_int32_t co case AC_FOUND_DEVICE: { struct ccb_getdev *cgd; - struct cam_sim *sim; cam_status status; cgd = (struct ccb_getdev *)arg; @@ -1038,7 +1037,6 @@ daasync(void *callback_arg, u_int32_t co * this device and start the probe * process. */ - sim = xpt_path_sim(cgd->ccb_h.path); status = cam_periph_alloc(daregister, daoninvalidate, dacleanup, dastart, "da", CAM_PERIPH_BIO, From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 21:29:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E223D1065936; Wed, 14 Jan 2009 21:29:20 +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 CE2148FC4D; Wed, 14 Jan 2009 21:29:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ELTKe2054507; Wed, 14 Jan 2009 21:29:20 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ELTKd4054506; Wed, 14 Jan 2009 21:29:20 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901142129.n0ELTKd4054506@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 14 Jan 2009 21:29: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: r187245 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:29:24 -0000 Author: trasz Date: Wed Jan 14 21:29:20 2009 New Revision: 187245 URL: http://svn.freebsd.org/changeset/base/187245 Log: Fix use after free. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 3712 Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Jan 14 21:27:30 2009 (r187244) +++ head/sys/cam/cam_xpt.c Wed Jan 14 21:29:20 2009 (r187245) @@ -6137,7 +6137,7 @@ probedone(struct cam_periph *periph, uni } xpt_release_ccb(done_ccb); softc->action = PROBE_TUR_FOR_NEGOTIATION; - xpt_schedule(periph, done_ccb->ccb_h.pinfo.priority); + xpt_schedule(periph, priority); return; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 21:31:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A270106592A; Wed, 14 Jan 2009 21:31:09 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53F658FC0A; Wed, 14 Jan 2009 21:31:09 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ELV9qr054581; Wed, 14 Jan 2009 21:31:09 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ELV9m3054580; Wed, 14 Jan 2009 21:31:09 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901142131.n0ELV9m3054580@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 21:31: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: r187246 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:31:12 -0000 Author: luigi Date: Wed Jan 14 21:31:09 2009 New Revision: 187246 URL: http://svn.freebsd.org/changeset/base/187246 Log: Another change from Christoph: replace the table of partition with a simpler and faster array of strings. The change in the array is done mechanically, using vi commands. Most entries in the table are probably 15+ years old and largely outdated, so the next step is to remove stale entries with more current values. Submitted by: Christoph Mallon, with small changes from me MFC after: 3 days Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Wed Jan 14 21:29:20 2009 (r187245) +++ head/sbin/fdisk/fdisk.c Wed Jan 14 21:31:09 2009 (r187246) @@ -122,100 +122,109 @@ static char *f_flag = NULL; /* Read conf static int v_flag = 0; /* Be verbose */ static int print_config_flag = 0; -static struct part_type -{ - unsigned char type; - const char *name; -} part_types[] = { - {0x00, "unused"} - ,{0x01, "Primary DOS with 12 bit FAT"} - ,{0x02, "XENIX / file system"} - ,{0x03, "XENIX /usr file system"} - ,{0x04, "Primary DOS with 16 bit FAT (< 32MB)"} - ,{0x05, "Extended DOS"} - ,{0x06, "Primary 'big' DOS (>= 32MB)"} - ,{0x07, "OS/2 HPFS, NTFS, QNX-2 (16 bit) or Advanced UNIX"} - ,{0x08, "AIX file system or SplitDrive"} - ,{0x09, "AIX boot partition or Coherent"} - ,{0x0A, "OS/2 Boot Manager, OPUS or Coherent swap"} - ,{0x0B, "DOS or Windows 95 with 32 bit FAT"} - ,{0x0C, "DOS or Windows 95 with 32 bit FAT (LBA)"} - ,{0x0E, "Primary 'big' DOS (>= 32MB, LBA)"} - ,{0x0F, "Extended DOS (LBA)"} - ,{0x10, "OPUS"} - ,{0x11, "OS/2 BM: hidden DOS with 12-bit FAT"} - ,{0x12, "Compaq diagnostics"} - ,{0x14, "OS/2 BM: hidden DOS with 16-bit FAT (< 32MB)"} - ,{0x16, "OS/2 BM: hidden DOS with 16-bit FAT (>= 32MB)"} - ,{0x17, "OS/2 BM: hidden IFS (e.g. HPFS)"} - ,{0x18, "AST Windows swapfile"} - ,{0x24, "NEC DOS"} - ,{0x3C, "PartitionMagic recovery"} - ,{0x39, "plan9"} - ,{0x40, "VENIX 286"} - ,{0x41, "Linux/MINIX (sharing disk with DRDOS)"} - ,{0x42, "SFS or Linux swap (sharing disk with DRDOS)"} - ,{0x43, "Linux native (sharing disk with DRDOS)"} - ,{0x4D, "QNX 4.2 Primary"} - ,{0x4E, "QNX 4.2 Secondary"} - ,{0x4F, "QNX 4.2 Tertiary"} - ,{0x50, "DM (disk manager)"} - ,{0x51, "DM6 Aux1 (or Novell)"} - ,{0x52, "CP/M or Microport SysV/AT"} - ,{0x53, "DM6 Aux3"} - ,{0x54, "DM6"} - ,{0x55, "EZ-Drive (disk manager)"} - ,{0x56, "Golden Bow (disk manager)"} - ,{0x5c, "Priam Edisk (disk manager)"} /* according to S. Widlake */ - ,{0x61, "SpeedStor"} - ,{0x63, "System V/386 (such as ISC UNIX), GNU HURD or Mach"} - ,{0x64, "Novell Netware/286 2.xx"} - ,{0x65, "Novell Netware/386 3.xx"} - ,{0x70, "DiskSecure Multi-Boot"} - ,{0x75, "PCIX"} - ,{0x77, "QNX4.x"} - ,{0x78, "QNX4.x 2nd part"} - ,{0x79, "QNX4.x 3rd part"} - ,{0x80, "Minix until 1.4a"} - ,{0x81, "Minix since 1.4b, early Linux partition or Mitac disk manager"} - ,{0x82, "Linux swap or Solaris x86"} - ,{0x83, "Linux native"} - ,{0x84, "OS/2 hidden C: drive"} - ,{0x85, "Linux extended"} - ,{0x86, "NTFS volume set??"} - ,{0x87, "NTFS volume set??"} - ,{0x93, "Amoeba file system"} - ,{0x94, "Amoeba bad block table"} - ,{0x9F, "BSD/OS"} - ,{0xA0, "Suspend to Disk"} - ,{0xA5, "FreeBSD/NetBSD/386BSD"} - ,{0xA6, "OpenBSD"} - ,{0xA7, "NeXTSTEP"} - ,{0xA9, "NetBSD"} - ,{0xAC, "IBM JFS"} - ,{0xAF, "HFS+"} - ,{0xB7, "BSDI BSD/386 file system"} - ,{0xB8, "BSDI BSD/386 swap"} - ,{0xBE, "Solaris x86 boot"} - ,{0xBF, "Solaris x86 (new)"} - ,{0xC1, "DRDOS/sec with 12-bit FAT"} - ,{0xC4, "DRDOS/sec with 16-bit FAT (< 32MB)"} - ,{0xC6, "DRDOS/sec with 16-bit FAT (>= 32MB)"} - ,{0xC7, "Syrinx"} - ,{0xDB, "CP/M, Concurrent CP/M, Concurrent DOS or CTOS"} - ,{0xE1, "DOS access or SpeedStor with 12-bit FAT extended partition"} - ,{0xE3, "DOS R/O or SpeedStor"} - ,{0xE4, "SpeedStor with 16-bit FAT extended partition < 1024 cyl."} - ,{0xEB, "BeOS file system"} - ,{0xEE, "EFI GPT"} - ,{0xEF, "EFI System Partition"} - ,{0xF1, "SpeedStor"} - ,{0xF2, "DOS 3.3+ Secondary"} - ,{0xF4, "SpeedStor large partition"} - ,{0xFE, "SpeedStor >1024 cyl. or LANstep"} - ,{0xFF, "Xenix bad blocks table"} +/* + * A list of partition types, probably outdated. + */ +static const char *const part_types[256] = { + [0x00] = "unused", + [0x01] = "Primary DOS with 12 bit FAT", + [0x02] = "XENIX / file system", + [0x03] = "XENIX /usr file system", + [0x04] = "Primary DOS with 16 bit FAT (< 32MB)", + [0x05] = "Extended DOS", + [0x06] = "Primary 'big' DOS (>= 32MB)", + [0x07] = "OS/2 HPFS, NTFS, QNX-2 (16 bit) or Advanced UNIX", + [0x08] = "AIX file system or SplitDrive", + [0x09] = "AIX boot partition or Coherent", + [0x0A] = "OS/2 Boot Manager, OPUS or Coherent swap", + [0x0B] = "DOS or Windows 95 with 32 bit FAT", + [0x0C] = "DOS or Windows 95 with 32 bit FAT (LBA)", + [0x0E] = "Primary 'big' DOS (>= 32MB, LBA)", + [0x0F] = "Extended DOS (LBA)", + [0x10] = "OPUS", + [0x11] = "OS/2 BM: hidden DOS with 12-bit FAT", + [0x12] = "Compaq diagnostics", + [0x14] = "OS/2 BM: hidden DOS with 16-bit FAT (< 32MB)", + [0x16] = "OS/2 BM: hidden DOS with 16-bit FAT (>= 32MB)", + [0x17] = "OS/2 BM: hidden IFS (e.g. HPFS)", + [0x18] = "AST Windows swapfile", + [0x24] = "NEC DOS", + [0x3C] = "PartitionMagic recovery", + [0x39] = "plan9", + [0x40] = "VENIX 286", + [0x41] = "Linux/MINIX (sharing disk with DRDOS)", + [0x42] = "SFS or Linux swap (sharing disk with DRDOS)", + [0x43] = "Linux native (sharing disk with DRDOS)", + [0x4D] = "QNX 4.2 Primary", + [0x4E] = "QNX 4.2 Secondary", + [0x4F] = "QNX 4.2 Tertiary", + [0x50] = "DM (disk manager)", + [0x51] = "DM6 Aux1 (or Novell)", + [0x52] = "CP/M or Microport SysV/AT", + [0x53] = "DM6 Aux3", + [0x54] = "DM6", + [0x55] = "EZ-Drive (disk manager)", + [0x56] = "Golden Bow (disk manager)", + [0x5c] = "Priam Edisk (disk manager)", /* according to S. Widlake */ + [0x61] = "SpeedStor", + [0x63] = "System V/386 (such as ISC UNIX), GNU HURD or Mach", + [0x64] = "Novell Netware/286 2.xx", + [0x65] = "Novell Netware/386 3.xx", + [0x70] = "DiskSecure Multi-Boot", + [0x75] = "PCIX", + [0x77] = "QNX4.x", + [0x78] = "QNX4.x 2nd part", + [0x79] = "QNX4.x 3rd part", + [0x80] = "Minix until 1.4a", + [0x81] = "Minix since 1.4b, early Linux partition or Mitac disk manager", + [0x82] = "Linux swap or Solaris x86", + [0x83] = "Linux native", + [0x84] = "OS/2 hidden C: drive", + [0x85] = "Linux extended", + [0x86] = "NTFS volume set??", + [0x87] = "NTFS volume set??", + [0x93] = "Amoeba file system", + [0x94] = "Amoeba bad block table", + [0x9F] = "BSD/OS", + [0xA0] = "Suspend to Disk", + [0xA5] = "FreeBSD/NetBSD/386BSD", + [0xA6] = "OpenBSD", + [0xA7] = "NeXTSTEP", + [0xA9] = "NetBSD", + [0xAC] = "IBM JFS", + [0xAF] = "HFS+", + [0xB7] = "BSDI BSD/386 file system", + [0xB8] = "BSDI BSD/386 swap", + [0xBE] = "Solaris x86 boot", + [0xBF] = "Solaris x86 (new)", + [0xC1] = "DRDOS/sec with 12-bit FAT", + [0xC4] = "DRDOS/sec with 16-bit FAT (< 32MB)", + [0xC6] = "DRDOS/sec with 16-bit FAT (>= 32MB)", + [0xC7] = "Syrinx", + [0xDB] = "CP/M, Concurrent CP/M, Concurrent DOS or CTOS", + [0xE1] = "DOS access or SpeedStor with 12-bit FAT extended partition", + [0xE3] = "DOS R/O or SpeedStor", + [0xE4] = "SpeedStor with 16-bit FAT extended partition < 1024 cyl.", + [0xEB] = "BeOS file system", + [0xEE] = "EFI GPT", + [0xEF] = "EFI System Partition", + [0xF1] = "SpeedStor", + [0xF2] = "DOS 3.3+ Secondary", + [0xF4] = "SpeedStor large partition", + [0xFE] = "SpeedStor >1024 cyl. or LANstep", + [0xFF] = "Xenix bad blocks table", }; +static const char * +get_type(int t) +{ + const char *ret; + + ret = (t >= 0 && t <= 255) ? part_types[t] : NULL; + return ret ? ret : "unknown"; +} + + static void print_s0(void); static void print_part(const struct dos_partition *); static void init_sector0(unsigned long start); @@ -235,7 +244,6 @@ static int read_s0(void); static int write_s0(void); static int ok(const char *str); static int decimal(const char *str, int *num, int deflt); -static const char *get_type(int type); static int read_config(char *config_file); static void reset_boot(void); static int sanitize_partition(struct dos_partition *); @@ -940,23 +948,6 @@ decimal(const char *str, int *num, int d } -static const char * -get_type(int type) -{ - int numentries = (sizeof(part_types)/sizeof(struct part_type)); - int counter = 0; - struct part_type *ptr = part_types; - - - while(counter < numentries) { - if(ptr->type == type) - return(ptr->name); - ptr++; - counter++; - } - return("unknown"); -} - static void parse_config_line(char *line, CMD *command) From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 21:31:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FC6C1065A6B; Wed, 14 Jan 2009 21:31:22 +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 4C5338FC20; Wed, 14 Jan 2009 21:31:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ELVMx3054620; Wed, 14 Jan 2009 21:31:22 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ELVMed054619; Wed, 14 Jan 2009 21:31:22 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901142131.n0ELVMed054619@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 14 Jan 2009 21:31:22 +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: r187247 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 21:31:25 -0000 Author: trasz Date: Wed Jan 14 21:31:22 2009 New Revision: 187247 URL: http://svn.freebsd.org/changeset/base/187247 Log: Add missing 'break' statement. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 3667 Modified: head/sys/cam/scsi/scsi_sg.c Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Wed Jan 14 21:31:09 2009 (r187246) +++ head/sys/cam/scsi/scsi_sg.c Wed Jan 14 21:31:22 2009 (r187247) @@ -941,6 +941,7 @@ sg_scsiio_status(struct ccb_scsiio *csio case CAM_DEV_NOT_THERE: *hoststat = DID_BAD_TARGET; *drvstat = 0; + break; case CAM_SEL_TIMEOUT: *hoststat = DID_NO_CONNECT; *drvstat = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 22:05:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665AB10656ED; Wed, 14 Jan 2009 22:05:51 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50DAB8FC1F; Wed, 14 Jan 2009 22:05:51 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EM5pNL055271; Wed, 14 Jan 2009 22:05:51 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EM5pFC055270; Wed, 14 Jan 2009 22:05:51 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200901142205.n0EM5pFC055270@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 14 Jan 2009 22:05: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: r187248 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 22:05:54 -0000 Author: luigi Date: Wed Jan 14 22:05:51 2009 New Revision: 187248 URL: http://svn.freebsd.org/changeset/base/187248 Log: Reword some entries for NTFS and DOS. Add entries for DELL and ASUS recovery partitions. MFC after: 3 days Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Wed Jan 14 21:31:22 2009 (r187247) +++ head/sbin/fdisk/fdisk.c Wed Jan 14 22:05:51 2009 (r187248) @@ -132,8 +132,8 @@ static const char *const part_types[256] [0x03] = "XENIX /usr file system", [0x04] = "Primary DOS with 16 bit FAT (< 32MB)", [0x05] = "Extended DOS", - [0x06] = "Primary 'big' DOS (>= 32MB)", - [0x07] = "OS/2 HPFS, NTFS, QNX-2 (16 bit) or Advanced UNIX", + [0x06] = "Primary DOS, 16 bit FAT (>= 32MB)", + [0x07] = "NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX", [0x08] = "AIX file system or SplitDrive", [0x09] = "AIX boot partition or Coherent", [0x0A] = "OS/2 Boot Manager, OPUS or Coherent swap", @@ -148,6 +148,7 @@ static const char *const part_types[256] [0x16] = "OS/2 BM: hidden DOS with 16-bit FAT (>= 32MB)", [0x17] = "OS/2 BM: hidden IFS (e.g. HPFS)", [0x18] = "AST Windows swapfile", + [0x1b] = "ASUS Recovery partition (NTFS)", [0x24] = "NEC DOS", [0x3C] = "PartitionMagic recovery", [0x39] = "plan9", @@ -202,6 +203,7 @@ static const char *const part_types[256] [0xC6] = "DRDOS/sec with 16-bit FAT (>= 32MB)", [0xC7] = "Syrinx", [0xDB] = "CP/M, Concurrent CP/M, Concurrent DOS or CTOS", + [0xDE] = "DELL Utilities - FAT filesystem", [0xE1] = "DOS access or SpeedStor with 12-bit FAT extended partition", [0xE3] = "DOS R/O or SpeedStor", [0xE4] = "SpeedStor with 16-bit FAT extended partition < 1024 cyl.", From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 22:10:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66F3106567A; Wed, 14 Jan 2009 22:10:51 +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 A39A58FC16; Wed, 14 Jan 2009 22:10:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EMApeJ055450; Wed, 14 Jan 2009 22:10:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EMAptA055448; Wed, 14 Jan 2009 22:10:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901142210.n0EMAptA055448@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Jan 2009 22:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187249 - in stable/7/sys: . contrib/pf dev/cxgb dev/dcons X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 22:10:53 -0000 Author: marius Date: Wed Jan 14 22:10:51 2009 New Revision: 187249 URL: http://svn.freebsd.org/changeset/base/187249 Log: MFC: r186876 Check the return values of contigmalloc(9) as well as bus_dma(9) functions and stop attaching of dcons(4) and dcons_crom(4) if they indicate failure. This fixes a panic seen on sparc64 machines with no free physical memory in the requested 32-bit region but still doesn't make dcons(4)/dcons_crom(4) these work. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/dcons/dcons_crom.c stable/7/sys/dev/dcons/dcons_os.c Modified: stable/7/sys/dev/dcons/dcons_crom.c ============================================================================== --- stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 22:05:51 2009 (r187248) +++ stable/7/sys/dev/dcons/dcons_crom.c Wed Jan 14 22:10:51 2009 (r187249) @@ -205,7 +205,10 @@ dcons_crom_attach(device_t dev) return (-1); #else struct dcons_crom_softc *sc; + int error; + if (dcons_conf->buf == NULL) + return (ENXIO); sc = (struct dcons_crom_softc *) device_get_softc(dev); sc->fd.fc = device_get_ivars(dev); sc->fd.dev = dev; @@ -213,7 +216,7 @@ dcons_crom_attach(device_t dev) sc->fd.post_busreset = (void *) dcons_crom_post_busreset; /* map dcons buffer */ - bus_dma_tag_create( + error = bus_dma_tag_create( /*parent*/ sc->fd.fc->dmat, /*alignment*/ sizeof(u_int32_t), /*boundary*/ 0, @@ -229,10 +232,16 @@ dcons_crom_attach(device_t dev) /*lockarg*/&Giant, #endif &sc->dma_tag); - bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); - bus_dmamap_load(sc->dma_tag, sc->dma_map, + if (error != 0) + return (error); + error = bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); + if (error != 0) + return (error); + error = bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)dcons_conf->buf, dcons_conf->size, dmamap_cb, sc, 0); + if (error != 0) + return (error); sc->ehand = EVENTHANDLER_REGISTER(dcons_poll, dcons_crom_poll, (void *)sc, 0); return (0); Modified: stable/7/sys/dev/dcons/dcons_os.c ============================================================================== --- stable/7/sys/dev/dcons/dcons_os.c Wed Jan 14 22:05:51 2009 (r187248) +++ stable/7/sys/dev/dcons/dcons_os.c Wed Jan 14 22:10:51 2009 (r187249) @@ -557,6 +557,8 @@ dcons_drv_init(int stage) */ dg.buf = (struct dcons_buf *) contigmalloc(dg.size, M_DEVBUF, 0, 0x10000, 0xffffffff, PAGE_SIZE, 0ul); + if (dg.buf == NULL) + return (-1); dcons_init(dg.buf, dg.size, sc); } @@ -680,9 +682,9 @@ dcons_modevent(module_t mode, int type, switch (type) { case MOD_LOAD: ret = dcons_drv_init(1); - dcons_attach(); #if __FreeBSD_version >= 500000 if (ret == 0) { + dcons_attach(); dcons_cnprobe(&dcons_consdev); dcons_cninit(&dcons_consdev); cnadd(&dcons_consdev); @@ -691,24 +693,26 @@ dcons_modevent(module_t mode, int type, break; case MOD_UNLOAD: printf("dcons: unload\n"); - callout_stop(&dcons_callout); + if (drv_init == 1) { + callout_stop(&dcons_callout); #if __FreeBSD_version < 502122 #if defined(DDB) && DCONS_FORCE_GDB #if CONS_NODEV - gdb_arg = NULL; + gdb_arg = NULL; #else - gdbdev = NULL; + gdbdev = NULL; #endif #endif #endif #if __FreeBSD_version >= 500000 - cnremove(&dcons_consdev); + cnremove(&dcons_consdev); #endif - dcons_detach(DCONS_CON); - dcons_detach(DCONS_GDB); - dg.buf->magic = 0; + dcons_detach(DCONS_CON); + dcons_detach(DCONS_GDB); + dg.buf->magic = 0; - contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); + contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); + } break; case MOD_SHUTDOWN: From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 22:11:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E89510656FA; Wed, 14 Jan 2009 22:11:02 +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 376368FC0C; Wed, 14 Jan 2009 22:11:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EMB2T8055505; Wed, 14 Jan 2009 22:11:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EMB2f1055503; Wed, 14 Jan 2009 22:11:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901142211.n0EMB2f1055503@svn.freebsd.org> From: Marius Strobl Date: Wed, 14 Jan 2009 22:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187250 - in stable/6/sys: . dev/dcons X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 22:11:07 -0000 Author: marius Date: Wed Jan 14 22:11:01 2009 New Revision: 187250 URL: http://svn.freebsd.org/changeset/base/187250 Log: MFC: r186876 Check the return values of contigmalloc(9) as well as bus_dma(9) functions and stop attaching of dcons(4) and dcons_crom(4) if they indicate failure. This fixes a panic seen on sparc64 machines with no free physical memory in the requested 32-bit region but still doesn't make dcons(4)/dcons_crom(4) these work. Modified: stable/6/sys/ (props changed) stable/6/sys/dev/dcons/dcons_crom.c stable/6/sys/dev/dcons/dcons_os.c Modified: stable/6/sys/dev/dcons/dcons_crom.c ============================================================================== --- stable/6/sys/dev/dcons/dcons_crom.c Wed Jan 14 22:10:51 2009 (r187249) +++ stable/6/sys/dev/dcons/dcons_crom.c Wed Jan 14 22:11:01 2009 (r187250) @@ -172,7 +172,10 @@ dcons_crom_attach(device_t dev) return (-1); #else struct dcons_crom_softc *sc; + int error; + if (dcons_conf->buf == NULL) + return (ENXIO); sc = (struct dcons_crom_softc *) device_get_softc(dev); sc->fd.fc = device_get_ivars(dev); sc->fd.dev = dev; @@ -180,7 +183,7 @@ dcons_crom_attach(device_t dev) sc->fd.post_busreset = (void *) dcons_crom_post_busreset; /* map dcons buffer */ - bus_dma_tag_create( + error = bus_dma_tag_create( /*parent*/ sc->fd.fc->dmat, /*alignment*/ sizeof(u_int32_t), /*boundary*/ 0, @@ -196,10 +199,16 @@ dcons_crom_attach(device_t dev) /*lockarg*/&Giant, #endif &sc->dma_tag); - bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); - bus_dmamap_load(sc->dma_tag, sc->dma_map, + if (error != 0) + return (error); + error = bus_dmamap_create(sc->dma_tag, BUS_DMA_COHERENT, &sc->dma_map); + if (error != 0) + return (error); + error = bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)dcons_conf->buf, dcons_conf->size, dmamap_cb, sc, 0); + if (error != 0) + return (error); return (0); #endif } Modified: stable/6/sys/dev/dcons/dcons_os.c ============================================================================== --- stable/6/sys/dev/dcons/dcons_os.c Wed Jan 14 22:10:51 2009 (r187249) +++ stable/6/sys/dev/dcons/dcons_os.c Wed Jan 14 22:11:01 2009 (r187250) @@ -548,6 +548,8 @@ dcons_drv_init(int stage) */ dg.buf = (struct dcons_buf *) contigmalloc(dg.size, M_DEVBUF, 0, 0x10000, 0xffffffff, PAGE_SIZE, 0ul); + if (dg.buf == NULL) + return (-1); dcons_init(dg.buf, dg.size, sc); } @@ -671,9 +673,9 @@ dcons_modevent(module_t mode, int type, switch (type) { case MOD_LOAD: ret = dcons_drv_init(1); - dcons_attach(); #if __FreeBSD_version >= 500000 if (ret == 0) { + dcons_attach(); dcons_cnprobe(&dcons_consdev); dcons_cninit(&dcons_consdev); cnadd(&dcons_consdev); @@ -682,7 +684,8 @@ dcons_modevent(module_t mode, int type, break; case MOD_UNLOAD: printf("dcons: unload\n"); - callout_stop(&dcons_callout); + if (drv_init == 1) { + callout_stop(&dcons_callout); #if __FreeBSD_version < 502122 #if DDB && DCONS_FORCE_GDB #if CONS_NODEV @@ -693,13 +696,14 @@ dcons_modevent(module_t mode, int type, #endif #endif #if __FreeBSD_version >= 500000 - cnremove(&dcons_consdev); + cnremove(&dcons_consdev); #endif - dcons_detach(DCONS_CON); - dcons_detach(DCONS_GDB); - dg.buf->magic = 0; + dcons_detach(DCONS_CON); + dcons_detach(DCONS_GDB); + dg.buf->magic = 0; - contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); + contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); + } break; case MOD_SHUTDOWN: From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 22:32:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE8E510657F7; Wed, 14 Jan 2009 22:32:43 +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 DC7288FC0C; Wed, 14 Jan 2009 22:32:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EMWhHn055896; Wed, 14 Jan 2009 22:32:43 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EMWhGw055895; Wed, 14 Jan 2009 22:32:43 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200901142232.n0EMWhGw055895@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 14 Jan 2009 22:32: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: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 22:32:46 -0000 Author: gonzo Date: Wed Jan 14 22:32:43 2009 New Revision: 187251 URL: http://svn.freebsd.org/changeset/base/187251 Log: o Simplify code: trade 15 lines of case for one multiplication Modified: head/sys/mips/malta/gt_pci.c Modified: head/sys/mips/malta/gt_pci.c ============================================================================== --- head/sys/mips/malta/gt_pci.c Wed Jan 14 22:11:01 2009 (r187250) +++ head/sys/mips/malta/gt_pci.c Wed Jan 14 22:32:43 2009 (r187251) @@ -457,21 +457,7 @@ gt_pci_write_config(device_t dev, int bu * Should we set the mode explicitly during chip * Initialization? */ - switch(reg % 4) - { - case 3: - shift = 24; - break; - case 2: - shift = 16; - break; - case 1: - shift = 8; - break; - default: - shift = 0; - break; - } + shift = 8 * (reg & 3); switch(bytes) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 22:46:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C369510656D3; Wed, 14 Jan 2009 22:46:13 +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 B2C758FC1C; Wed, 14 Jan 2009 22:46:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EMkDmv056178; Wed, 14 Jan 2009 22:46:13 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EMkDh7056177; Wed, 14 Jan 2009 22:46:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200901142246.n0EMkDh7056177@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 14 Jan 2009 22:46: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: r187252 - head/sys/mips/idt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 22:46:14 -0000 Author: gonzo Date: Wed Jan 14 22:46:13 2009 New Revision: 187252 URL: http://svn.freebsd.org/changeset/base/187252 Log: o Code cleanup, remove unused fields of idtpci_softc Modified: head/sys/mips/idt/idtpci.c Modified: head/sys/mips/idt/idtpci.c ============================================================================== --- head/sys/mips/idt/idtpci.c Wed Jan 14 22:32:43 2009 (r187251) +++ head/sys/mips/idt/idtpci.c Wed Jan 14 22:46:13 2009 (r187252) @@ -125,8 +125,6 @@ struct idtpci_softc { struct rman sc_mem_rman[2]; struct rman sc_io_rman[2]; struct rman sc_irq_rman; - uint32_t sc_mem; - uint32_t sc_io; }; static uint32_t @@ -155,9 +153,6 @@ idtpci_attach(device_t dev) sc->sc_dev = dev; sc->sc_busno = busno; - sc->sc_io = 0; - sc->sc_mem = 0; - /* TODO: Check for host mode */ /* Enabled PCI, IG mode, EAP mode */ @@ -240,7 +235,6 @@ idtpci_attach(device_t dev) } /* Use KSEG1 to access IO ports for it is uncached */ - sc->sc_io = 0; sc->sc_io_rman[0].rm_type = RMAN_ARRAY; sc->sc_io_rman[0].rm_descr = "IDTPCI I/O Ports window 1"; if (rman_init(&sc->sc_io_rman[0]) != 0 || @@ -258,7 +252,6 @@ idtpci_attach(device_t dev) } /* Use KSEG1 to access PCI memory for it is uncached */ - sc->sc_mem = 0; sc->sc_mem_rman[0].rm_type = RMAN_ARRAY; sc->sc_mem_rman[0].rm_descr = "IDTPCI PCI Memory window 1"; if (rman_init(&sc->sc_mem_rman[0]) != 0 || From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 22:55:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 885BF1065670; Wed, 14 Jan 2009 22:55:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77C678FC17; Wed, 14 Jan 2009 22:55:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0EMtnQS056374; Wed, 14 Jan 2009 22:55:49 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0EMtnpt056373; Wed, 14 Jan 2009 22:55:49 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901142255.n0EMtnpt056373@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 22:55: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: r187253 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 22:55:50 -0000 Author: sam Date: Wed Jan 14 22:55:49 2009 New Revision: 187253 URL: http://svn.freebsd.org/changeset/base/187253 Log: use correct interface name when setting flags; fixes ifconfig ... create ... up Noticed by: Chris Anderson Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Wed Jan 14 22:46:13 2009 (r187252) +++ head/sbin/ifconfig/ifconfig.c Wed Jan 14 22:55:49 2009 (r187253) @@ -697,13 +697,13 @@ setifflags(const char *vname, int value, struct ifreq my_ifr; int flags; - bcopy((char *)&ifr, (char *)&my_ifr, sizeof(struct ifreq)); + memset(&my_ifr, 0, sizeof(my_ifr)); + (void) strlcpy(my_ifr.ifr_name, name, sizeof(my_ifr.ifr_name)); if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&my_ifr) < 0) { Perror("ioctl (SIOCGIFFLAGS)"); exit(1); } - strncpy(my_ifr.ifr_name, name, sizeof (my_ifr.ifr_name)); flags = (my_ifr.ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16); if (value < 0) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 23:19:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BB4F1065670 for ; Wed, 14 Jan 2009 23:19:06 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4918FC1E for ; Wed, 14 Jan 2009 23:19:06 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 3A9B08FC4F for ; Thu, 15 Jan 2009 02:08:02 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id 7F0718FC18; Thu, 15 Jan 2009 02:08:00 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 0433A398F3; Thu, 15 Jan 2009 02:08:01 +0300 (MSK) Date: Thu, 15 Jan 2009 02:07:52 +0300 From: Stanislav Sedov To: Oleksandr Tymoshenko Message-Id: <20090115020752.52566769.stas@FreeBSD.org> In-Reply-To: <200901142232.n0EMWhGw055895@svn.freebsd.org> References: <200901142232.n0EMWhGw055895@svn.freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Thu Jan 15 02:08:01 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 496e7051967003867013891 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 23:19:06 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 14 Jan 2009 22:32:43 +0000 (UTC) Oleksandr Tymoshenko mentioned: > Author: gonzo > Date: Wed Jan 14 22:32:43 2009 > New Revision: 187251 > URL: http://svn.freebsd.org/changeset/base/187251 > > Log: > o Simplify code: trade 15 lines of case for one multiplication > > Modified: > head/sys/mips/malta/gt_pci.c > > Modified: head/sys/mips/malta/gt_pci.c > ============================================================================== > --- head/sys/mips/malta/gt_pci.c Wed Jan 14 22:11:01 2009 (r187250) > +++ head/sys/mips/malta/gt_pci.c Wed Jan 14 22:32:43 2009 (r187251) > @@ -457,21 +457,7 @@ gt_pci_write_config(device_t dev, int bu > * Should we set the mode explicitly during chip > * Initialization? > */ > - switch(reg % 4) > - { > - case 3: > - shift = 24; > - break; > - case 2: > - shift = 16; > - break; > - case 1: > - shift = 8; > - break; > - default: > - shift = 0; > - break; > - } > + shift = 8 * (reg & 3); > Would it make sense to replace this with > + shift = (reg & 3) << 3; to not rely on possible compiler optimizations? - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAklucFAACgkQK/VZk+smlYHvawCdFWtJKfuX3xBOkQ66BURedB8I hy0AmgMGQKaqzVS3gIUeOFOLwYB67L93 =BTIx -----END PGP SIGNATURE----- !DSPAM:496e7051967003867013891! From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 23:53:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD8C41065686; Wed, 14 Jan 2009 23:53:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC16D8FC14; Wed, 14 Jan 2009 23:53:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0ENr6Af057408; Wed, 14 Jan 2009 23:53:06 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0ENr6IK057406; Wed, 14 Jan 2009 23:53:06 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901142353.n0ENr6IK057406@svn.freebsd.org> From: Sam Leffler Date: Wed, 14 Jan 2009 23:53:06 +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: r187255 - head/tools/tools/net80211/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2009 23:53:07 -0000 Author: sam Date: Wed Jan 14 23:53:06 2009 New Revision: 187255 URL: http://svn.freebsd.org/changeset/base/187255 Log: simple scripts to demonstrate tdma setup Added: head/tools/tools/net80211/scripts/setup.tdma-master (contents, props changed) head/tools/tools/net80211/scripts/setup.tdma-slave (contents, props changed) Added: head/tools/tools/net80211/scripts/setup.tdma-master ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/net80211/scripts/setup.tdma-master Wed Jan 14 23:53:06 2009 (r187255) @@ -0,0 +1,20 @@ +#! /bin/sh +# +# Setup a TDMA master and bridge it to a wired NIC. +# +# $FreeBSD$ +# +PATH=.:$PATH +. config + +SSID='freebsd+tdma' + +WLAN=`ifconfig wlan create wlanmode tdma wlandev $WIRELESS` +ifconfig $WLAN ssid "$SSID" tdmaslot 0 channel $CHANNEL +wlandebug -i $WLAN state+scan+tdma + +BRIDGE=`ifconfig bridge create` +ifconfig $BRIDGE addm $WLAN addm $WIRED 192.168.2.1/24 + +ifconfig $WIRED up +ifconfig $WLAN up Added: head/tools/tools/net80211/scripts/setup.tdma-slave ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/net80211/scripts/setup.tdma-slave Wed Jan 14 23:53:06 2009 (r187255) @@ -0,0 +1,19 @@ +#! /bin/sh +# +# Setup a TDMA slave and hook it into a bridge. +# +# $FreeBSD$ +# +PATH=.:$PATH +. config + +SSID='freebsd+tdma' + +WLAN=`ifconfig wlan create wlanmode tdma wlandev $WIRELESS` +ifconfig $WLAN ssid "$SSID" 0 +wlandebug -i $WLAN state+scan+tdma + +BRIDGE=`ifconfig bridge create` +ifconfig $BRIDGE addm $WLAN 192.168.2.2/24 + +ifconfig $WLAN up From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 00:33:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F73A1065675; Thu, 15 Jan 2009 00:33:18 +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 1D4FC8FC1D; Thu, 15 Jan 2009 00:33:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F0XIRm058292; Thu, 15 Jan 2009 00:33:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F0XIt3058291; Thu, 15 Jan 2009 00:33:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901150033.n0F0XIt3058291@svn.freebsd.org> From: Xin LI Date: Thu, 15 Jan 2009 00:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187256 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 00:33:19 -0000 Author: delphij Date: Thu Jan 15 00:33:17 2009 New Revision: 187256 URL: http://svn.freebsd.org/changeset/base/187256 Log: MFC r187079: Fix typo. Submitted by: Ben Kaduk Modified: stable/7/sbin/fsck_ffs/ (props changed) stable/7/sbin/fsck_ffs/fsck_ffs.8 Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Wed Jan 14 23:53:06 2009 (r187255) +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Thu Jan 15 00:33:17 2009 (r187256) @@ -187,7 +187,7 @@ and causes .Nm to crash otherwise. Be .Em very careful -using this flag, is dangerous if there are data transmission hazards +using this flag, it is dangerous if there are data transmission hazards because a false positive cylinder group magic number mismatch could cause .Em irrevertible data loss! From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:05:42 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 621131065670; Thu, 15 Jan 2009 02:05:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 081668FC0A; Thu, 15 Jan 2009 02:05:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0F251aB058011; Wed, 14 Jan 2009 19:05:01 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 14 Jan 2009 19:05:27 -0700 (MST) Message-Id: <20090114.190527.1058804377.imp@bsdimp.com> To: stas@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20090115020752.52566769.stas@FreeBSD.org> References: <200901142232.n0EMWhGw055895@svn.freebsd.org> <20090115020752.52566769.stas@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, gonzo@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:05:42 -0000 In message: <20090115020752.52566769.stas@FreeBSD.org> Stanislav Sedov writes: : > + shift = 8 * (reg & 3); : > : : Would it make sense to replace this with : > + shift = (reg & 3) << 3; : : to not rely on possible compiler optimizations? I don't think that it matters all that much these days... Warner From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:11:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83062106567B; Thu, 15 Jan 2009 02:11:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56DDC8FC0A; Thu, 15 Jan 2009 02:11:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2BKjS060161; Thu, 15 Jan 2009 02:11:20 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2BKj6060160; Thu, 15 Jan 2009 02:11:20 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901150211.n0F2BKj6060160@svn.freebsd.org> From: Sam Leffler Date: Thu, 15 Jan 2009 02:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187257 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:11:21 -0000 Author: sam Date: Thu Jan 15 02:11:19 2009 New Revision: 187257 URL: http://svn.freebsd.org/changeset/base/187257 Log: add wpa_supplicant Modified: svnadmin/conf/paths Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Thu Jan 15 00:33:17 2009 (r187256) +++ svnadmin/conf/paths Thu Jan 15 02:11:19 2009 (r187257) @@ -62,6 +62,7 @@ ^vendor/top ^vendor/tzcode ^vendor/tzdata +^vendor/wpa_supplicant ^vendor-crypto/openssh ^vendor-crypto/openssl ^vendor-sys/pf From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:11:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00124106564A; Thu, 15 Jan 2009 02:11:44 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5F78FC1B; Thu, 15 Jan 2009 02:11:44 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2Bid6060203; Thu, 15 Jan 2009 02:11:44 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2BiVx060200; Thu, 15 Jan 2009 02:11:44 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901150211.n0F2BiVx060200@svn.freebsd.org> From: Sam Leffler Date: Thu, 15 Jan 2009 02:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187258 - in vendor/wpa_supplicant: 0.3-latest 0.3-latest/contrib 0.3.8 0.3.8/contrib 0.3.8/doc 0.3.9 0.3.9/contrib 0.3.9/doc 0.4.8 0.4.8/contrib 0.4.8/doc 0.4.8/examples 0.4.8/wpa_gui ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:11:45 -0000 Author: sam Date: Thu Jan 15 02:11:43 2009 New Revision: 187258 URL: http://svn.freebsd.org/changeset/base/187258 Log: flatten vendor branch Added: vendor/wpa_supplicant/0.3-latest/driver_ndis.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3-latest/contrib/wpa_supplicant/driver_ndis.c vendor/wpa_supplicant/0.3.8/COPYING (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/COPYING vendor/wpa_supplicant/0.3.8/ChangeLog (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/ChangeLog vendor/wpa_supplicant/0.3.8/Makefile (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/Makefile vendor/wpa_supplicant/0.3.8/README (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/README vendor/wpa_supplicant/0.3.8/aes.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/aes.c vendor/wpa_supplicant/0.3.8/aes_wrap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/aes_wrap.c vendor/wpa_supplicant/0.3.8/aes_wrap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/aes_wrap.h vendor/wpa_supplicant/0.3.8/common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/common.c vendor/wpa_supplicant/0.3.8/common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/common.h vendor/wpa_supplicant/0.3.8/config.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/config.c vendor/wpa_supplicant/0.3.8/config.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/config.h vendor/wpa_supplicant/0.3.8/config_ssid.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/config_ssid.h vendor/wpa_supplicant/0.3.8/crypto.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/crypto.c vendor/wpa_supplicant/0.3.8/crypto.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/crypto.h vendor/wpa_supplicant/0.3.8/ctrl_iface.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/ctrl_iface.c vendor/wpa_supplicant/0.3.8/ctrl_iface.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/ctrl_iface.h vendor/wpa_supplicant/0.3.8/defconfig (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/defconfig vendor/wpa_supplicant/0.3.8/defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/defs.h vendor/wpa_supplicant/0.3.8/developer.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/developer.txt vendor/wpa_supplicant/0.3.8/doc/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/doc/ vendor/wpa_supplicant/0.3.8/driver.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/driver.h vendor/wpa_supplicant/0.3.8/drivers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/drivers.c vendor/wpa_supplicant/0.3.8/eap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap.c vendor/wpa_supplicant/0.3.8/eap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap.h vendor/wpa_supplicant/0.3.8/eap_aka.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_aka.c vendor/wpa_supplicant/0.3.8/eap_defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_defs.h vendor/wpa_supplicant/0.3.8/eap_fast.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_fast.c vendor/wpa_supplicant/0.3.8/eap_gtc.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_gtc.c vendor/wpa_supplicant/0.3.8/eap_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_i.h vendor/wpa_supplicant/0.3.8/eap_leap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_leap.c vendor/wpa_supplicant/0.3.8/eap_md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_md5.c vendor/wpa_supplicant/0.3.8/eap_mschapv2.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_mschapv2.c vendor/wpa_supplicant/0.3.8/eap_otp.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_otp.c vendor/wpa_supplicant/0.3.8/eap_peap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_peap.c vendor/wpa_supplicant/0.3.8/eap_psk.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_psk.c vendor/wpa_supplicant/0.3.8/eap_sim.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_sim.c vendor/wpa_supplicant/0.3.8/eap_sim_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_sim_common.c vendor/wpa_supplicant/0.3.8/eap_sim_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_sim_common.h vendor/wpa_supplicant/0.3.8/eap_testing.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_testing.txt vendor/wpa_supplicant/0.3.8/eap_tls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_tls.c vendor/wpa_supplicant/0.3.8/eap_tls_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_tls_common.c vendor/wpa_supplicant/0.3.8/eap_tls_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_tls_common.h vendor/wpa_supplicant/0.3.8/eap_tlv.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_tlv.c vendor/wpa_supplicant/0.3.8/eap_tlv.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_tlv.h vendor/wpa_supplicant/0.3.8/eap_ttls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_ttls.c vendor/wpa_supplicant/0.3.8/eap_ttls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eap_ttls.h vendor/wpa_supplicant/0.3.8/eapol_sm.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eapol_sm.c vendor/wpa_supplicant/0.3.8/eapol_sm.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eapol_sm.h vendor/wpa_supplicant/0.3.8/eapol_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eapol_test.c vendor/wpa_supplicant/0.3.8/eloop.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eloop.c vendor/wpa_supplicant/0.3.8/eloop.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/eloop.h vendor/wpa_supplicant/0.3.8/hostap_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/hostap_common.h vendor/wpa_supplicant/0.3.8/l2_packet.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/l2_packet.h vendor/wpa_supplicant/0.3.8/md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/md5.c vendor/wpa_supplicant/0.3.8/md5.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/md5.h vendor/wpa_supplicant/0.3.8/ms_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/ms_funcs.c vendor/wpa_supplicant/0.3.8/ms_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/ms_funcs.h vendor/wpa_supplicant/0.3.8/openssl-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/openssl-tls-extensions.patch vendor/wpa_supplicant/0.3.8/pcsc_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/pcsc_funcs.c vendor/wpa_supplicant/0.3.8/pcsc_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/pcsc_funcs.h vendor/wpa_supplicant/0.3.8/preauth_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/preauth_test.c vendor/wpa_supplicant/0.3.8/radius_client.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/radius_client.c vendor/wpa_supplicant/0.3.8/radius_client.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/radius_client.h vendor/wpa_supplicant/0.3.8/rc4.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/rc4.c vendor/wpa_supplicant/0.3.8/rc4.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/rc4.h vendor/wpa_supplicant/0.3.8/sha1.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/sha1.c vendor/wpa_supplicant/0.3.8/sha1.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/sha1.h vendor/wpa_supplicant/0.3.8/tls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/tls.h vendor/wpa_supplicant/0.3.8/tls_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/tls_none.c vendor/wpa_supplicant/0.3.8/tls_openssl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/tls_openssl.c vendor/wpa_supplicant/0.3.8/todo.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/todo.txt vendor/wpa_supplicant/0.3.8/version.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/version.h vendor/wpa_supplicant/0.3.8/wpa.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa.c vendor/wpa_supplicant/0.3.8/wpa.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa.h vendor/wpa_supplicant/0.3.8/wpa_cli.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa_cli.c vendor/wpa_supplicant/0.3.8/wpa_ctrl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa_ctrl.c vendor/wpa_supplicant/0.3.8/wpa_ctrl.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa_ctrl.h vendor/wpa_supplicant/0.3.8/wpa_passphrase.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa_passphrase.c vendor/wpa_supplicant/0.3.8/wpa_supplicant.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa_supplicant.c vendor/wpa_supplicant/0.3.8/wpa_supplicant.conf (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa_supplicant.conf vendor/wpa_supplicant/0.3.8/wpa_supplicant.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa_supplicant.h vendor/wpa_supplicant/0.3.8/wpa_supplicant_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.8/contrib/wpa_supplicant/wpa_supplicant_i.h vendor/wpa_supplicant/0.3.9/COPYING (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/COPYING vendor/wpa_supplicant/0.3.9/ChangeLog (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/ChangeLog vendor/wpa_supplicant/0.3.9/Makefile (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/Makefile vendor/wpa_supplicant/0.3.9/README (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/README vendor/wpa_supplicant/0.3.9/aes.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/aes.c vendor/wpa_supplicant/0.3.9/aes_wrap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/aes_wrap.c vendor/wpa_supplicant/0.3.9/aes_wrap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/aes_wrap.h vendor/wpa_supplicant/0.3.9/common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/common.c vendor/wpa_supplicant/0.3.9/common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/common.h vendor/wpa_supplicant/0.3.9/config.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/config.c vendor/wpa_supplicant/0.3.9/config.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/config.h vendor/wpa_supplicant/0.3.9/config_ssid.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/config_ssid.h vendor/wpa_supplicant/0.3.9/crypto.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/crypto.c vendor/wpa_supplicant/0.3.9/crypto.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/crypto.h vendor/wpa_supplicant/0.3.9/ctrl_iface.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/ctrl_iface.c vendor/wpa_supplicant/0.3.9/ctrl_iface.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/ctrl_iface.h vendor/wpa_supplicant/0.3.9/defconfig (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/defconfig vendor/wpa_supplicant/0.3.9/defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/defs.h vendor/wpa_supplicant/0.3.9/developer.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/developer.txt vendor/wpa_supplicant/0.3.9/doc/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/doc/ vendor/wpa_supplicant/0.3.9/driver.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/driver.h vendor/wpa_supplicant/0.3.9/driver_ndis.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/driver_ndis.c vendor/wpa_supplicant/0.3.9/driver_ndis.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/driver_ndis.h vendor/wpa_supplicant/0.3.9/driver_ndis_.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/driver_ndis_.c vendor/wpa_supplicant/0.3.9/drivers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/drivers.c vendor/wpa_supplicant/0.3.9/eap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap.c vendor/wpa_supplicant/0.3.9/eap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap.h vendor/wpa_supplicant/0.3.9/eap_aka.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_aka.c vendor/wpa_supplicant/0.3.9/eap_defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_defs.h vendor/wpa_supplicant/0.3.9/eap_fast.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_fast.c vendor/wpa_supplicant/0.3.9/eap_gtc.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_gtc.c vendor/wpa_supplicant/0.3.9/eap_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_i.h vendor/wpa_supplicant/0.3.9/eap_leap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_leap.c vendor/wpa_supplicant/0.3.9/eap_md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_md5.c vendor/wpa_supplicant/0.3.9/eap_mschapv2.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_mschapv2.c vendor/wpa_supplicant/0.3.9/eap_otp.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_otp.c vendor/wpa_supplicant/0.3.9/eap_peap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_peap.c vendor/wpa_supplicant/0.3.9/eap_psk.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_psk.c vendor/wpa_supplicant/0.3.9/eap_sim.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_sim.c vendor/wpa_supplicant/0.3.9/eap_sim_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_sim_common.c vendor/wpa_supplicant/0.3.9/eap_sim_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_sim_common.h vendor/wpa_supplicant/0.3.9/eap_testing.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_testing.txt vendor/wpa_supplicant/0.3.9/eap_tls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_tls.c vendor/wpa_supplicant/0.3.9/eap_tls_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_tls_common.c vendor/wpa_supplicant/0.3.9/eap_tls_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_tls_common.h vendor/wpa_supplicant/0.3.9/eap_tlv.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_tlv.c vendor/wpa_supplicant/0.3.9/eap_tlv.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_tlv.h vendor/wpa_supplicant/0.3.9/eap_ttls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_ttls.c vendor/wpa_supplicant/0.3.9/eap_ttls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eap_ttls.h vendor/wpa_supplicant/0.3.9/eapol_sm.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eapol_sm.c vendor/wpa_supplicant/0.3.9/eapol_sm.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eapol_sm.h vendor/wpa_supplicant/0.3.9/eapol_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eapol_test.c vendor/wpa_supplicant/0.3.9/eloop.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eloop.c vendor/wpa_supplicant/0.3.9/eloop.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/eloop.h vendor/wpa_supplicant/0.3.9/hostap_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/hostap_common.h vendor/wpa_supplicant/0.3.9/l2_packet.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/l2_packet.h vendor/wpa_supplicant/0.3.9/md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/md5.c vendor/wpa_supplicant/0.3.9/md5.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/md5.h vendor/wpa_supplicant/0.3.9/ms_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/ms_funcs.c vendor/wpa_supplicant/0.3.9/ms_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/ms_funcs.h vendor/wpa_supplicant/0.3.9/openssl-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/openssl-tls-extensions.patch vendor/wpa_supplicant/0.3.9/pcsc_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/pcsc_funcs.c vendor/wpa_supplicant/0.3.9/pcsc_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/pcsc_funcs.h vendor/wpa_supplicant/0.3.9/preauth_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/preauth_test.c vendor/wpa_supplicant/0.3.9/radius.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/radius.c vendor/wpa_supplicant/0.3.9/radius.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/radius.h vendor/wpa_supplicant/0.3.9/radius_client.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/radius_client.c vendor/wpa_supplicant/0.3.9/radius_client.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/radius_client.h vendor/wpa_supplicant/0.3.9/rc4.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/rc4.c vendor/wpa_supplicant/0.3.9/rc4.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/rc4.h vendor/wpa_supplicant/0.3.9/sha1.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/sha1.c vendor/wpa_supplicant/0.3.9/sha1.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/sha1.h vendor/wpa_supplicant/0.3.9/tls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/tls.h vendor/wpa_supplicant/0.3.9/tls_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/tls_none.c vendor/wpa_supplicant/0.3.9/tls_openssl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/tls_openssl.c vendor/wpa_supplicant/0.3.9/todo.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/todo.txt vendor/wpa_supplicant/0.3.9/version.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/version.h vendor/wpa_supplicant/0.3.9/wpa.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa.c vendor/wpa_supplicant/0.3.9/wpa.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa.h vendor/wpa_supplicant/0.3.9/wpa_cli.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa_cli.c vendor/wpa_supplicant/0.3.9/wpa_ctrl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa_ctrl.c vendor/wpa_supplicant/0.3.9/wpa_ctrl.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa_ctrl.h vendor/wpa_supplicant/0.3.9/wpa_passphrase.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa_passphrase.c vendor/wpa_supplicant/0.3.9/wpa_supplicant.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa_supplicant.c vendor/wpa_supplicant/0.3.9/wpa_supplicant.conf (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa_supplicant.conf vendor/wpa_supplicant/0.3.9/wpa_supplicant.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa_supplicant.h vendor/wpa_supplicant/0.3.9/wpa_supplicant_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.3.9/contrib/wpa_supplicant/wpa_supplicant_i.h vendor/wpa_supplicant/0.4.8/COPYING (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/COPYING vendor/wpa_supplicant/0.4.8/ChangeLog (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/ChangeLog vendor/wpa_supplicant/0.4.8/Makefile (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/Makefile vendor/wpa_supplicant/0.4.8/README (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/README vendor/wpa_supplicant/0.4.8/aes.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/aes.c vendor/wpa_supplicant/0.4.8/aes_wrap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/aes_wrap.c vendor/wpa_supplicant/0.4.8/aes_wrap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/aes_wrap.h vendor/wpa_supplicant/0.4.8/base64.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/base64.c vendor/wpa_supplicant/0.4.8/base64.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/base64.h vendor/wpa_supplicant/0.4.8/common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/common.c vendor/wpa_supplicant/0.4.8/common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/common.h vendor/wpa_supplicant/0.4.8/config.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/config.c vendor/wpa_supplicant/0.4.8/config.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/config.h vendor/wpa_supplicant/0.4.8/config_file.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/config_file.c vendor/wpa_supplicant/0.4.8/config_ssid.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/config_ssid.h vendor/wpa_supplicant/0.4.8/config_types.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/config_types.h vendor/wpa_supplicant/0.4.8/crypto.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/crypto.c vendor/wpa_supplicant/0.4.8/crypto.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/crypto.h vendor/wpa_supplicant/0.4.8/crypto_gnutls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/crypto_gnutls.c vendor/wpa_supplicant/0.4.8/ctrl_iface.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/ctrl_iface.c vendor/wpa_supplicant/0.4.8/ctrl_iface.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/ctrl_iface.h vendor/wpa_supplicant/0.4.8/defconfig (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/defconfig vendor/wpa_supplicant/0.4.8/defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/defs.h vendor/wpa_supplicant/0.4.8/doc/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/doc/ vendor/wpa_supplicant/0.4.8/driver.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/driver.h vendor/wpa_supplicant/0.4.8/driver_hostap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/driver_hostap.h vendor/wpa_supplicant/0.4.8/driver_ndis.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/driver_ndis.c vendor/wpa_supplicant/0.4.8/driver_ndis.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/driver_ndis.h vendor/wpa_supplicant/0.4.8/driver_ndis_.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/driver_ndis_.c vendor/wpa_supplicant/0.4.8/driver_wired.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/driver_wired.c vendor/wpa_supplicant/0.4.8/drivers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/drivers.c vendor/wpa_supplicant/0.4.8/eap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap.c vendor/wpa_supplicant/0.4.8/eap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap.h vendor/wpa_supplicant/0.4.8/eap_aka.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_aka.c vendor/wpa_supplicant/0.4.8/eap_defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_defs.h vendor/wpa_supplicant/0.4.8/eap_fast.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_fast.c vendor/wpa_supplicant/0.4.8/eap_gtc.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_gtc.c vendor/wpa_supplicant/0.4.8/eap_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_i.h vendor/wpa_supplicant/0.4.8/eap_leap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_leap.c vendor/wpa_supplicant/0.4.8/eap_md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_md5.c vendor/wpa_supplicant/0.4.8/eap_mschapv2.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_mschapv2.c vendor/wpa_supplicant/0.4.8/eap_otp.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_otp.c vendor/wpa_supplicant/0.4.8/eap_pax.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_pax.c vendor/wpa_supplicant/0.4.8/eap_pax_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_pax_common.c vendor/wpa_supplicant/0.4.8/eap_pax_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_pax_common.h vendor/wpa_supplicant/0.4.8/eap_peap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_peap.c vendor/wpa_supplicant/0.4.8/eap_psk.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_psk.c vendor/wpa_supplicant/0.4.8/eap_psk_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_psk_common.c vendor/wpa_supplicant/0.4.8/eap_psk_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_psk_common.h vendor/wpa_supplicant/0.4.8/eap_sim.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_sim.c vendor/wpa_supplicant/0.4.8/eap_sim_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_sim_common.c vendor/wpa_supplicant/0.4.8/eap_sim_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_sim_common.h vendor/wpa_supplicant/0.4.8/eap_testing.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_testing.txt vendor/wpa_supplicant/0.4.8/eap_tls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_tls.c vendor/wpa_supplicant/0.4.8/eap_tls_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_tls_common.c vendor/wpa_supplicant/0.4.8/eap_tls_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_tls_common.h vendor/wpa_supplicant/0.4.8/eap_tlv.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_tlv.c vendor/wpa_supplicant/0.4.8/eap_tlv.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_tlv.h vendor/wpa_supplicant/0.4.8/eap_ttls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_ttls.c vendor/wpa_supplicant/0.4.8/eap_ttls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eap_ttls.h vendor/wpa_supplicant/0.4.8/eapol_sm.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eapol_sm.c vendor/wpa_supplicant/0.4.8/eapol_sm.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eapol_sm.h vendor/wpa_supplicant/0.4.8/eapol_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eapol_test.c vendor/wpa_supplicant/0.4.8/eloop.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eloop.c vendor/wpa_supplicant/0.4.8/eloop.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/eloop.h vendor/wpa_supplicant/0.4.8/events.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/events.c vendor/wpa_supplicant/0.4.8/examples/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/examples/ vendor/wpa_supplicant/0.4.8/hostapd.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/hostapd.h vendor/wpa_supplicant/0.4.8/l2_packet.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/l2_packet.h vendor/wpa_supplicant/0.4.8/main.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/main.c vendor/wpa_supplicant/0.4.8/md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/md5.c vendor/wpa_supplicant/0.4.8/md5.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/md5.h vendor/wpa_supplicant/0.4.8/ms_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/ms_funcs.c vendor/wpa_supplicant/0.4.8/ms_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/ms_funcs.h vendor/wpa_supplicant/0.4.8/openssl-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/openssl-tls-extensions.patch vendor/wpa_supplicant/0.4.8/pcsc_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/pcsc_funcs.c vendor/wpa_supplicant/0.4.8/pcsc_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/pcsc_funcs.h vendor/wpa_supplicant/0.4.8/preauth.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/preauth.c vendor/wpa_supplicant/0.4.8/preauth.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/preauth.h vendor/wpa_supplicant/0.4.8/preauth_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/preauth_test.c vendor/wpa_supplicant/0.4.8/radius.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/radius.c vendor/wpa_supplicant/0.4.8/radius.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/radius.h vendor/wpa_supplicant/0.4.8/radius_client.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/radius_client.c vendor/wpa_supplicant/0.4.8/radius_client.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/radius_client.h vendor/wpa_supplicant/0.4.8/rc4.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/rc4.c vendor/wpa_supplicant/0.4.8/rc4.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/rc4.h vendor/wpa_supplicant/0.4.8/sha1.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/sha1.c vendor/wpa_supplicant/0.4.8/sha1.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/sha1.h vendor/wpa_supplicant/0.4.8/tls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/tls.h vendor/wpa_supplicant/0.4.8/tls_gnutls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/tls_gnutls.c vendor/wpa_supplicant/0.4.8/tls_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/tls_none.c vendor/wpa_supplicant/0.4.8/tls_openssl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/tls_openssl.c vendor/wpa_supplicant/0.4.8/tls_schannel.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/tls_schannel.c vendor/wpa_supplicant/0.4.8/todo.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/todo.txt vendor/wpa_supplicant/0.4.8/version.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/version.h vendor/wpa_supplicant/0.4.8/wpa.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa.c vendor/wpa_supplicant/0.4.8/wpa.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa.h vendor/wpa_supplicant/0.4.8/wpa_cli.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_cli.c vendor/wpa_supplicant/0.4.8/wpa_ctrl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_ctrl.c vendor/wpa_supplicant/0.4.8/wpa_ctrl.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_ctrl.h vendor/wpa_supplicant/0.4.8/wpa_gui/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_gui/ vendor/wpa_supplicant/0.4.8/wpa_gui-qt4/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_gui-qt4/ vendor/wpa_supplicant/0.4.8/wpa_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_i.h vendor/wpa_supplicant/0.4.8/wpa_passphrase.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_passphrase.c vendor/wpa_supplicant/0.4.8/wpa_supplicant.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_supplicant.c vendor/wpa_supplicant/0.4.8/wpa_supplicant.conf (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_supplicant.conf vendor/wpa_supplicant/0.4.8/wpa_supplicant.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_supplicant.h vendor/wpa_supplicant/0.4.8/wpa_supplicant_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.4.8/contrib/wpa_supplicant/wpa_supplicant_i.h vendor/wpa_supplicant/0.5.8/COPYING (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/COPYING vendor/wpa_supplicant/0.5.8/ChangeLog (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ChangeLog vendor/wpa_supplicant/0.5.8/FREEBSD-Xlist (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/FREEBSD-Xlist vendor/wpa_supplicant/0.5.8/FREEBSD-upgrade (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/FREEBSD-upgrade vendor/wpa_supplicant/0.5.8/Makefile (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/Makefile vendor/wpa_supplicant/0.5.8/README (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/README vendor/wpa_supplicant/0.5.8/aes.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/aes.c vendor/wpa_supplicant/0.5.8/aes.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/aes.h vendor/wpa_supplicant/0.5.8/aes_wrap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/aes_wrap.c vendor/wpa_supplicant/0.5.8/aes_wrap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/aes_wrap.h vendor/wpa_supplicant/0.5.8/asn1.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/asn1.c vendor/wpa_supplicant/0.5.8/asn1.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/asn1.h vendor/wpa_supplicant/0.5.8/asn1_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/asn1_test.c vendor/wpa_supplicant/0.5.8/base64.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/base64.c vendor/wpa_supplicant/0.5.8/base64.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/base64.h vendor/wpa_supplicant/0.5.8/bignum.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/bignum.c vendor/wpa_supplicant/0.5.8/bignum.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/bignum.h vendor/wpa_supplicant/0.5.8/build_config.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/build_config.h vendor/wpa_supplicant/0.5.8/common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/common.c vendor/wpa_supplicant/0.5.8/common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/common.h vendor/wpa_supplicant/0.5.8/config.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/config.c vendor/wpa_supplicant/0.5.8/config.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/config.h vendor/wpa_supplicant/0.5.8/config_file.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/config_file.c vendor/wpa_supplicant/0.5.8/config_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/config_none.c vendor/wpa_supplicant/0.5.8/config_ssid.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/config_ssid.h vendor/wpa_supplicant/0.5.8/config_types.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/config_types.h vendor/wpa_supplicant/0.5.8/config_winreg.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/config_winreg.c vendor/wpa_supplicant/0.5.8/crypto.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/crypto.c vendor/wpa_supplicant/0.5.8/crypto.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/crypto.h vendor/wpa_supplicant/0.5.8/crypto_cryptoapi.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/crypto_cryptoapi.c vendor/wpa_supplicant/0.5.8/crypto_gnutls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/crypto_gnutls.c vendor/wpa_supplicant/0.5.8/crypto_internal.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/crypto_internal.c vendor/wpa_supplicant/0.5.8/crypto_libtomcrypt.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/crypto_libtomcrypt.c vendor/wpa_supplicant/0.5.8/crypto_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/crypto_none.c vendor/wpa_supplicant/0.5.8/ctrl_iface.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface.c vendor/wpa_supplicant/0.5.8/ctrl_iface.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface.h vendor/wpa_supplicant/0.5.8/ctrl_iface_dbus.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface_dbus.c vendor/wpa_supplicant/0.5.8/ctrl_iface_dbus.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface_dbus.h vendor/wpa_supplicant/0.5.8/ctrl_iface_dbus_handlers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface_dbus_handlers.c vendor/wpa_supplicant/0.5.8/ctrl_iface_dbus_handlers.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface_dbus_handlers.h vendor/wpa_supplicant/0.5.8/ctrl_iface_named_pipe.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface_named_pipe.c vendor/wpa_supplicant/0.5.8/ctrl_iface_udp.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface_udp.c vendor/wpa_supplicant/0.5.8/ctrl_iface_unix.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ctrl_iface_unix.c vendor/wpa_supplicant/0.5.8/dbus-wpa_supplicant.conf (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/dbus-wpa_supplicant.conf vendor/wpa_supplicant/0.5.8/dbus_dict_helpers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/dbus_dict_helpers.c vendor/wpa_supplicant/0.5.8/dbus_dict_helpers.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/dbus_dict_helpers.h vendor/wpa_supplicant/0.5.8/defconfig (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/defconfig vendor/wpa_supplicant/0.5.8/defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/defs.h vendor/wpa_supplicant/0.5.8/des.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/des.c vendor/wpa_supplicant/0.5.8/doc/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/doc/ vendor/wpa_supplicant/0.5.8/driver.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/driver.h vendor/wpa_supplicant/0.5.8/driver_hostap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/driver_hostap.h vendor/wpa_supplicant/0.5.8/driver_ndis.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/driver_ndis.c vendor/wpa_supplicant/0.5.8/driver_ndis.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/driver_ndis.h vendor/wpa_supplicant/0.5.8/driver_wired.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/driver_wired.c vendor/wpa_supplicant/0.5.8/drivers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/drivers.c vendor/wpa_supplicant/0.5.8/eap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap.c vendor/wpa_supplicant/0.5.8/eap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap.h vendor/wpa_supplicant/0.5.8/eap_aka.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_aka.c vendor/wpa_supplicant/0.5.8/eap_defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_defs.h vendor/wpa_supplicant/0.5.8/eap_fast.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_fast.c vendor/wpa_supplicant/0.5.8/eap_gpsk.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_gpsk.c vendor/wpa_supplicant/0.5.8/eap_gpsk_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_gpsk_common.c vendor/wpa_supplicant/0.5.8/eap_gpsk_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_gpsk_common.h vendor/wpa_supplicant/0.5.8/eap_gtc.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_gtc.c vendor/wpa_supplicant/0.5.8/eap_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_i.h vendor/wpa_supplicant/0.5.8/eap_leap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_leap.c vendor/wpa_supplicant/0.5.8/eap_md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_md5.c vendor/wpa_supplicant/0.5.8/eap_methods.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_methods.c vendor/wpa_supplicant/0.5.8/eap_methods.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_methods.h vendor/wpa_supplicant/0.5.8/eap_mschapv2.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_mschapv2.c vendor/wpa_supplicant/0.5.8/eap_otp.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_otp.c vendor/wpa_supplicant/0.5.8/eap_pax.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_pax.c vendor/wpa_supplicant/0.5.8/eap_pax_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_pax_common.c vendor/wpa_supplicant/0.5.8/eap_pax_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_pax_common.h vendor/wpa_supplicant/0.5.8/eap_peap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_peap.c vendor/wpa_supplicant/0.5.8/eap_psk.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_psk.c vendor/wpa_supplicant/0.5.8/eap_psk_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_psk_common.c vendor/wpa_supplicant/0.5.8/eap_psk_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_psk_common.h vendor/wpa_supplicant/0.5.8/eap_sake.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_sake.c vendor/wpa_supplicant/0.5.8/eap_sake_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_sake_common.c vendor/wpa_supplicant/0.5.8/eap_sake_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_sake_common.h vendor/wpa_supplicant/0.5.8/eap_sim.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_sim.c vendor/wpa_supplicant/0.5.8/eap_sim_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_sim_common.c vendor/wpa_supplicant/0.5.8/eap_sim_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_sim_common.h vendor/wpa_supplicant/0.5.8/eap_testing.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_testing.txt vendor/wpa_supplicant/0.5.8/eap_tls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_tls.c vendor/wpa_supplicant/0.5.8/eap_tls_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_tls_common.c vendor/wpa_supplicant/0.5.8/eap_tls_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_tls_common.h vendor/wpa_supplicant/0.5.8/eap_tlv.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_tlv.c vendor/wpa_supplicant/0.5.8/eap_tlv.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_tlv.h vendor/wpa_supplicant/0.5.8/eap_ttls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_ttls.c vendor/wpa_supplicant/0.5.8/eap_ttls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_ttls.h vendor/wpa_supplicant/0.5.8/eap_vendor_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eap_vendor_test.c vendor/wpa_supplicant/0.5.8/eapol_sm.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eapol_sm.c vendor/wpa_supplicant/0.5.8/eapol_sm.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eapol_sm.h vendor/wpa_supplicant/0.5.8/eapol_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eapol_test.c vendor/wpa_supplicant/0.5.8/eloop.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eloop.c vendor/wpa_supplicant/0.5.8/eloop.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eloop.h vendor/wpa_supplicant/0.5.8/eloop_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eloop_none.c vendor/wpa_supplicant/0.5.8/eloop_win.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/eloop_win.c vendor/wpa_supplicant/0.5.8/events.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/events.c vendor/wpa_supplicant/0.5.8/examples/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/examples/ vendor/wpa_supplicant/0.5.8/hostapd.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/hostapd.h vendor/wpa_supplicant/0.5.8/includes.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/includes.h vendor/wpa_supplicant/0.5.8/l2_packet.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/l2_packet.h vendor/wpa_supplicant/0.5.8/libtommath.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/libtommath.c vendor/wpa_supplicant/0.5.8/main.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/main.c vendor/wpa_supplicant/0.5.8/md4.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/md4.c vendor/wpa_supplicant/0.5.8/md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/md5.c vendor/wpa_supplicant/0.5.8/md5.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/md5.h vendor/wpa_supplicant/0.5.8/mlme.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/mlme.c vendor/wpa_supplicant/0.5.8/mlme.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/mlme.h vendor/wpa_supplicant/0.5.8/ms_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ms_funcs.c vendor/wpa_supplicant/0.5.8/ms_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/ms_funcs.h vendor/wpa_supplicant/0.5.8/nmake.mak (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/nmake.mak vendor/wpa_supplicant/0.5.8/openssl-0.9.8d-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/openssl-0.9.8d-tls-extensions.patch vendor/wpa_supplicant/0.5.8/openssl-0.9.8e-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/openssl-0.9.8e-tls-extensions.patch vendor/wpa_supplicant/0.5.8/openssl-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/openssl-tls-extensions.patch vendor/wpa_supplicant/0.5.8/os.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/os.h vendor/wpa_supplicant/0.5.8/os_internal.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/os_internal.c vendor/wpa_supplicant/0.5.8/os_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/os_none.c vendor/wpa_supplicant/0.5.8/os_unix.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/os_unix.c vendor/wpa_supplicant/0.5.8/pcsc_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/pcsc_funcs.c vendor/wpa_supplicant/0.5.8/pcsc_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/pcsc_funcs.h vendor/wpa_supplicant/0.5.8/pmksa_cache.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/pmksa_cache.c vendor/wpa_supplicant/0.5.8/pmksa_cache.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/pmksa_cache.h vendor/wpa_supplicant/0.5.8/preauth.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/preauth.c vendor/wpa_supplicant/0.5.8/preauth.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/preauth.h vendor/wpa_supplicant/0.5.8/preauth_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/preauth_test.c vendor/wpa_supplicant/0.5.8/radius.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/radius.c vendor/wpa_supplicant/0.5.8/radius.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/radius.h vendor/wpa_supplicant/0.5.8/radius_client.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/radius_client.c vendor/wpa_supplicant/0.5.8/radius_client.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/radius_client.h vendor/wpa_supplicant/0.5.8/rc4.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/rc4.c vendor/wpa_supplicant/0.5.8/rc4.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/rc4.h vendor/wpa_supplicant/0.5.8/rsa.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/rsa.c vendor/wpa_supplicant/0.5.8/rsa.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/rsa.h vendor/wpa_supplicant/0.5.8/sha1.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/sha1.c vendor/wpa_supplicant/0.5.8/sha1.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/sha1.h vendor/wpa_supplicant/0.5.8/sha256.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/sha256.c vendor/wpa_supplicant/0.5.8/sha256.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/sha256.h vendor/wpa_supplicant/0.5.8/state_machine.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/state_machine.h vendor/wpa_supplicant/0.5.8/tls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tls.h vendor/wpa_supplicant/0.5.8/tls_gnutls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tls_gnutls.c vendor/wpa_supplicant/0.5.8/tls_internal.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tls_internal.c vendor/wpa_supplicant/0.5.8/tls_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tls_none.c vendor/wpa_supplicant/0.5.8/tls_openssl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tls_openssl.c vendor/wpa_supplicant/0.5.8/tls_schannel.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tls_schannel.c vendor/wpa_supplicant/0.5.8/tlsv1_client.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tlsv1_client.c vendor/wpa_supplicant/0.5.8/tlsv1_client.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tlsv1_client.h vendor/wpa_supplicant/0.5.8/tlsv1_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tlsv1_common.c vendor/wpa_supplicant/0.5.8/tlsv1_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/tlsv1_common.h vendor/wpa_supplicant/0.5.8/todo.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/todo.txt vendor/wpa_supplicant/0.5.8/version.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/version.h vendor/wpa_supplicant/0.5.8/wpa.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa.c vendor/wpa_supplicant/0.5.8/wpa.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa.h vendor/wpa_supplicant/0.5.8/wpa_cli.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_cli.c vendor/wpa_supplicant/0.5.8/wpa_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_common.h vendor/wpa_supplicant/0.5.8/wpa_ctrl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_ctrl.c vendor/wpa_supplicant/0.5.8/wpa_ctrl.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_ctrl.h vendor/wpa_supplicant/0.5.8/wpa_gui/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_gui/ vendor/wpa_supplicant/0.5.8/wpa_gui-qt4/ (props changed) - copied from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_gui-qt4/ vendor/wpa_supplicant/0.5.8/wpa_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_i.h vendor/wpa_supplicant/0.5.8/wpa_passphrase.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_passphrase.c vendor/wpa_supplicant/0.5.8/wpa_supplicant.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_supplicant.c vendor/wpa_supplicant/0.5.8/wpa_supplicant.conf (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_supplicant.conf vendor/wpa_supplicant/0.5.8/wpa_supplicant.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_supplicant.h vendor/wpa_supplicant/0.5.8/wpa_supplicant_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/wpa_supplicant_i.h vendor/wpa_supplicant/0.5.8/x509v3.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/x509v3.c vendor/wpa_supplicant/0.5.8/x509v3.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/0.5.8/contrib/wpa_supplicant/x509v3.h vendor/wpa_supplicant/dist/COPYING (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/COPYING vendor/wpa_supplicant/dist/ChangeLog (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ChangeLog vendor/wpa_supplicant/dist/FREEBSD-Xlist (contents, props changed) - copied, changed from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/FREEBSD-Xlist vendor/wpa_supplicant/dist/FREEBSD-upgrade (contents, props changed) - copied, changed from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/FREEBSD-upgrade vendor/wpa_supplicant/dist/Makefile (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/Makefile vendor/wpa_supplicant/dist/README (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/README vendor/wpa_supplicant/dist/aes.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/aes.c vendor/wpa_supplicant/dist/aes.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/aes.h vendor/wpa_supplicant/dist/aes_wrap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/aes_wrap.c vendor/wpa_supplicant/dist/aes_wrap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/aes_wrap.h vendor/wpa_supplicant/dist/asn1.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/asn1.c vendor/wpa_supplicant/dist/asn1.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/asn1.h vendor/wpa_supplicant/dist/asn1_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/asn1_test.c vendor/wpa_supplicant/dist/base64.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/base64.c vendor/wpa_supplicant/dist/base64.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/base64.h vendor/wpa_supplicant/dist/bignum.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/bignum.c vendor/wpa_supplicant/dist/bignum.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/bignum.h vendor/wpa_supplicant/dist/build_config.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/build_config.h vendor/wpa_supplicant/dist/common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/common.c vendor/wpa_supplicant/dist/common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/common.h vendor/wpa_supplicant/dist/config.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/config.c vendor/wpa_supplicant/dist/config.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/config.h vendor/wpa_supplicant/dist/config_file.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/config_file.c vendor/wpa_supplicant/dist/config_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/config_none.c vendor/wpa_supplicant/dist/config_ssid.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/config_ssid.h vendor/wpa_supplicant/dist/config_types.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/config_types.h vendor/wpa_supplicant/dist/config_winreg.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/config_winreg.c vendor/wpa_supplicant/dist/crypto.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/crypto.c vendor/wpa_supplicant/dist/crypto.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/crypto.h vendor/wpa_supplicant/dist/crypto_cryptoapi.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/crypto_cryptoapi.c vendor/wpa_supplicant/dist/crypto_gnutls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/crypto_gnutls.c vendor/wpa_supplicant/dist/crypto_internal.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/crypto_internal.c vendor/wpa_supplicant/dist/crypto_libtomcrypt.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/crypto_libtomcrypt.c vendor/wpa_supplicant/dist/crypto_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/crypto_none.c vendor/wpa_supplicant/dist/ctrl_iface.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface.c vendor/wpa_supplicant/dist/ctrl_iface.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface.h vendor/wpa_supplicant/dist/ctrl_iface_dbus.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface_dbus.c vendor/wpa_supplicant/dist/ctrl_iface_dbus.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface_dbus.h vendor/wpa_supplicant/dist/ctrl_iface_dbus_handlers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface_dbus_handlers.c vendor/wpa_supplicant/dist/ctrl_iface_dbus_handlers.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface_dbus_handlers.h vendor/wpa_supplicant/dist/ctrl_iface_named_pipe.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface_named_pipe.c vendor/wpa_supplicant/dist/ctrl_iface_udp.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface_udp.c vendor/wpa_supplicant/dist/ctrl_iface_unix.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ctrl_iface_unix.c vendor/wpa_supplicant/dist/dbus-wpa_supplicant.conf (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/dbus-wpa_supplicant.conf vendor/wpa_supplicant/dist/dbus-wpa_supplicant.service (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/dbus-wpa_supplicant.service vendor/wpa_supplicant/dist/dbus_dict_helpers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/dbus_dict_helpers.c vendor/wpa_supplicant/dist/dbus_dict_helpers.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/dbus_dict_helpers.h vendor/wpa_supplicant/dist/defconfig (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/defconfig vendor/wpa_supplicant/dist/defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/defs.h vendor/wpa_supplicant/dist/des.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/des.c vendor/wpa_supplicant/dist/developer.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/developer.txt vendor/wpa_supplicant/dist/doc/ (props changed) - copied from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/doc/ vendor/wpa_supplicant/dist/driver.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/driver.h vendor/wpa_supplicant/dist/driver_hostap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/driver_hostap.h vendor/wpa_supplicant/dist/driver_ndis.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/driver_ndis.c vendor/wpa_supplicant/dist/driver_ndis.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/driver_ndis.h vendor/wpa_supplicant/dist/driver_ndis_.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/driver_ndis_.c vendor/wpa_supplicant/dist/driver_wired.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/driver_wired.c vendor/wpa_supplicant/dist/drivers.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/drivers.c vendor/wpa_supplicant/dist/eap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap.c vendor/wpa_supplicant/dist/eap.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap.h vendor/wpa_supplicant/dist/eap_aka.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_aka.c vendor/wpa_supplicant/dist/eap_defs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_defs.h vendor/wpa_supplicant/dist/eap_fast.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_fast.c vendor/wpa_supplicant/dist/eap_gpsk.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_gpsk.c vendor/wpa_supplicant/dist/eap_gpsk_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_gpsk_common.c vendor/wpa_supplicant/dist/eap_gpsk_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_gpsk_common.h vendor/wpa_supplicant/dist/eap_gtc.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_gtc.c vendor/wpa_supplicant/dist/eap_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_i.h vendor/wpa_supplicant/dist/eap_leap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_leap.c vendor/wpa_supplicant/dist/eap_md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_md5.c vendor/wpa_supplicant/dist/eap_methods.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_methods.c vendor/wpa_supplicant/dist/eap_methods.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_methods.h vendor/wpa_supplicant/dist/eap_mschapv2.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_mschapv2.c vendor/wpa_supplicant/dist/eap_otp.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_otp.c vendor/wpa_supplicant/dist/eap_pax.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_pax.c vendor/wpa_supplicant/dist/eap_pax_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_pax_common.c vendor/wpa_supplicant/dist/eap_pax_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_pax_common.h vendor/wpa_supplicant/dist/eap_peap.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_peap.c vendor/wpa_supplicant/dist/eap_psk.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_psk.c vendor/wpa_supplicant/dist/eap_psk_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_psk_common.c vendor/wpa_supplicant/dist/eap_psk_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_psk_common.h vendor/wpa_supplicant/dist/eap_sake.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_sake.c vendor/wpa_supplicant/dist/eap_sake_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_sake_common.c vendor/wpa_supplicant/dist/eap_sake_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_sake_common.h vendor/wpa_supplicant/dist/eap_sim.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_sim.c vendor/wpa_supplicant/dist/eap_sim_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_sim_common.c vendor/wpa_supplicant/dist/eap_sim_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_sim_common.h vendor/wpa_supplicant/dist/eap_testing.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_testing.txt vendor/wpa_supplicant/dist/eap_tls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_tls.c vendor/wpa_supplicant/dist/eap_tls_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_tls_common.c vendor/wpa_supplicant/dist/eap_tls_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_tls_common.h vendor/wpa_supplicant/dist/eap_tlv.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_tlv.c vendor/wpa_supplicant/dist/eap_tlv.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_tlv.h vendor/wpa_supplicant/dist/eap_ttls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_ttls.c vendor/wpa_supplicant/dist/eap_ttls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_ttls.h vendor/wpa_supplicant/dist/eap_vendor_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eap_vendor_test.c vendor/wpa_supplicant/dist/eapol_sm.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eapol_sm.c vendor/wpa_supplicant/dist/eapol_sm.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eapol_sm.h vendor/wpa_supplicant/dist/eapol_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eapol_test.c vendor/wpa_supplicant/dist/eloop.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eloop.c vendor/wpa_supplicant/dist/eloop.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eloop.h vendor/wpa_supplicant/dist/eloop_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eloop_none.c vendor/wpa_supplicant/dist/eloop_win.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/eloop_win.c vendor/wpa_supplicant/dist/events.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/events.c vendor/wpa_supplicant/dist/examples/ (props changed) - copied from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/examples/ vendor/wpa_supplicant/dist/hostap_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/hostap_common.h vendor/wpa_supplicant/dist/hostapd.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/hostapd.h vendor/wpa_supplicant/dist/includes.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/includes.h vendor/wpa_supplicant/dist/l2_packet.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/l2_packet.h vendor/wpa_supplicant/dist/libtommath.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/libtommath.c vendor/wpa_supplicant/dist/main.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/main.c vendor/wpa_supplicant/dist/md4.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/md4.c vendor/wpa_supplicant/dist/md5.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/md5.c vendor/wpa_supplicant/dist/md5.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/md5.h vendor/wpa_supplicant/dist/mlme.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/mlme.c vendor/wpa_supplicant/dist/mlme.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/mlme.h vendor/wpa_supplicant/dist/ms_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ms_funcs.c vendor/wpa_supplicant/dist/ms_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/ms_funcs.h vendor/wpa_supplicant/dist/nmake.mak (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/nmake.mak vendor/wpa_supplicant/dist/openssl-0.9.8d-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/openssl-0.9.8d-tls-extensions.patch vendor/wpa_supplicant/dist/openssl-0.9.8e-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/openssl-0.9.8e-tls-extensions.patch vendor/wpa_supplicant/dist/openssl-tls-extensions.patch (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/openssl-tls-extensions.patch vendor/wpa_supplicant/dist/os.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/os.h vendor/wpa_supplicant/dist/os_internal.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/os_internal.c vendor/wpa_supplicant/dist/os_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/os_none.c vendor/wpa_supplicant/dist/os_unix.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/os_unix.c vendor/wpa_supplicant/dist/pcsc_funcs.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/pcsc_funcs.c vendor/wpa_supplicant/dist/pcsc_funcs.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/pcsc_funcs.h vendor/wpa_supplicant/dist/pmksa_cache.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/pmksa_cache.c vendor/wpa_supplicant/dist/pmksa_cache.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/pmksa_cache.h vendor/wpa_supplicant/dist/preauth.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/preauth.c vendor/wpa_supplicant/dist/preauth.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/preauth.h vendor/wpa_supplicant/dist/preauth_test.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/preauth_test.c vendor/wpa_supplicant/dist/radius.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/radius.c vendor/wpa_supplicant/dist/radius.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/radius.h vendor/wpa_supplicant/dist/radius_client.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/radius_client.c vendor/wpa_supplicant/dist/radius_client.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/radius_client.h vendor/wpa_supplicant/dist/rc4.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/rc4.c vendor/wpa_supplicant/dist/rc4.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/rc4.h vendor/wpa_supplicant/dist/rsa.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/rsa.c vendor/wpa_supplicant/dist/rsa.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/rsa.h vendor/wpa_supplicant/dist/sha1.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/sha1.c vendor/wpa_supplicant/dist/sha1.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/sha1.h vendor/wpa_supplicant/dist/sha256.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/sha256.c vendor/wpa_supplicant/dist/sha256.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/sha256.h vendor/wpa_supplicant/dist/state_machine.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/state_machine.h vendor/wpa_supplicant/dist/tests/ (props changed) - copied from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tests/ vendor/wpa_supplicant/dist/tls.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tls.h vendor/wpa_supplicant/dist/tls_gnutls.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tls_gnutls.c vendor/wpa_supplicant/dist/tls_internal.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tls_internal.c vendor/wpa_supplicant/dist/tls_none.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tls_none.c vendor/wpa_supplicant/dist/tls_openssl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tls_openssl.c vendor/wpa_supplicant/dist/tls_schannel.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tls_schannel.c vendor/wpa_supplicant/dist/tlsv1_client.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tlsv1_client.c vendor/wpa_supplicant/dist/tlsv1_client.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tlsv1_client.h vendor/wpa_supplicant/dist/tlsv1_common.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tlsv1_common.c vendor/wpa_supplicant/dist/tlsv1_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/tlsv1_common.h vendor/wpa_supplicant/dist/todo.txt (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/todo.txt vendor/wpa_supplicant/dist/version.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/version.h vendor/wpa_supplicant/dist/wpa.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa.c vendor/wpa_supplicant/dist/wpa.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa.h vendor/wpa_supplicant/dist/wpa_cli.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_cli.c vendor/wpa_supplicant/dist/wpa_common.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_common.h vendor/wpa_supplicant/dist/wpa_ctrl.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_ctrl.c vendor/wpa_supplicant/dist/wpa_ctrl.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_ctrl.h vendor/wpa_supplicant/dist/wpa_gui/ (props changed) - copied from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_gui/ vendor/wpa_supplicant/dist/wpa_gui-qt4/ (props changed) - copied from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_gui-qt4/ vendor/wpa_supplicant/dist/wpa_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_i.h vendor/wpa_supplicant/dist/wpa_passphrase.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_passphrase.c vendor/wpa_supplicant/dist/wpa_supplicant.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_supplicant.c vendor/wpa_supplicant/dist/wpa_supplicant.conf (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_supplicant.conf vendor/wpa_supplicant/dist/wpa_supplicant.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_supplicant.h vendor/wpa_supplicant/dist/wpa_supplicant_i.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/wpa_supplicant_i.h vendor/wpa_supplicant/dist/x509v3.c (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/x509v3.c vendor/wpa_supplicant/dist/x509v3.h (props changed) - copied unchanged from r187255, vendor/wpa_supplicant/dist/contrib/wpa_supplicant/x509v3.h Deleted: vendor/wpa_supplicant/0.3-latest/contrib/ vendor/wpa_supplicant/0.3.8/contrib/ vendor/wpa_supplicant/0.3.9/contrib/ vendor/wpa_supplicant/0.4.8/contrib/ vendor/wpa_supplicant/0.5.8/contrib/ vendor/wpa_supplicant/dist/contrib/ Modified: vendor/wpa_supplicant/dist/doc/code_structure.doxygen (props changed) vendor/wpa_supplicant/dist/doc/ctrl_iface.doxygen (props changed) vendor/wpa_supplicant/dist/doc/docbook/Makefile (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_background.8 (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_background.sgml (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.8 (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.sgml (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_passphrase.8 (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_passphrase.sgml (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.8 (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.5 (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.sgml (props changed) vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.sgml (props changed) vendor/wpa_supplicant/dist/doc/doxygen.fast (props changed) vendor/wpa_supplicant/dist/doc/doxygen.full (props changed) vendor/wpa_supplicant/dist/doc/driver_wrapper.doxygen (props changed) vendor/wpa_supplicant/dist/doc/eap.doxygen (props changed) vendor/wpa_supplicant/dist/doc/kerneldoc2doxygen.pl (props changed) vendor/wpa_supplicant/dist/doc/mainpage.doxygen (props changed) vendor/wpa_supplicant/dist/doc/porting.doxygen (props changed) vendor/wpa_supplicant/dist/doc/testing_tools.doxygen (props changed) vendor/wpa_supplicant/dist/doc/wpa_supplicant.fig (props changed) vendor/wpa_supplicant/dist/examples/ieee8021x.conf (props changed) vendor/wpa_supplicant/dist/examples/plaintext.conf (props changed) vendor/wpa_supplicant/dist/examples/wep.conf (props changed) vendor/wpa_supplicant/dist/examples/wpa-psk-tkip.conf (props changed) vendor/wpa_supplicant/dist/examples/wpa2-eap-ccmp.conf (props changed) vendor/wpa_supplicant/dist/tests/test_aes.c (props changed) vendor/wpa_supplicant/dist/tests/test_eap_sim_common.c (props changed) vendor/wpa_supplicant/dist/tests/test_md4.c (props changed) vendor/wpa_supplicant/dist/tests/test_md5.c (props changed) vendor/wpa_supplicant/dist/tests/test_ms_funcs.c (props changed) vendor/wpa_supplicant/dist/tests/test_sha1.c (props changed) vendor/wpa_supplicant/dist/tests/test_sha256.c (props changed) vendor/wpa_supplicant/dist/tests/test_x509v3.c (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/eventhistory.cpp (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/eventhistory.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/eventhistory.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/eventhistory.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/main.cpp (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/networkconfig.cpp (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/networkconfig.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/networkconfig.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/networkconfig.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/scanresults.cpp (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/scanresults.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/scanresults.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/scanresults.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/setup-mingw-cross-compiling (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/userdatarequest.cpp (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/userdatarequest.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/userdatarequest.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/userdatarequest.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/wpa_gui.pro (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/wpagui.cpp (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/wpagui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/wpagui.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/wpagui.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui-qt4/wpamsg.h (props changed) vendor/wpa_supplicant/dist/wpa_gui/eventhistory.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui/eventhistory.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui/main.cpp (props changed) vendor/wpa_supplicant/dist/wpa_gui/networkconfig.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui/networkconfig.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui/scanresults.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui/scanresults.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui/setup-mingw-cross-compiling (props changed) vendor/wpa_supplicant/dist/wpa_gui/userdatarequest.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui/userdatarequest.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui/wpa_gui.pro (props changed) vendor/wpa_supplicant/dist/wpa_gui/wpagui.ui (props changed) vendor/wpa_supplicant/dist/wpa_gui/wpagui.ui.h (props changed) vendor/wpa_supplicant/dist/wpa_gui/wpamsg.h (props changed) Copied: vendor/wpa_supplicant/0.3-latest/driver_ndis.c (from r187255, vendor/wpa_supplicant/0.3-latest/contrib/wpa_supplicant/driver_ndis.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/wpa_supplicant/0.3-latest/driver_ndis.c Thu Jan 15 02:11:43 2009 (r187258, copy of r187255, vendor/wpa_supplicant/0.3-latest/contrib/wpa_supplicant/driver_ndis.c) @@ -0,0 +1,1589 @@ +/* + * WPA Supplicant - Windows/NDIS driver interface + * Copyright (c) 2004-2005, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "driver.h" +#include "wpa_supplicant.h" +#include "l2_packet.h" +#include "eloop.h" +#include "wpa.h" +#include "driver_ndis.h" + +int wpa_driver_register_event_cb(struct wpa_driver_ndis_data *drv); + +static void wpa_driver_ndis_poll(void *drv); + + +/* FIX: to be removed once this can be compiled with the complete NDIS + * header files */ +#ifndef OID_802_11_BSSID +#define OID_802_11_BSSID 0x0d010101 +#define OID_802_11_SSID 0x0d010102 +#define OID_802_11_INFRASTRUCTURE_MODE 0x0d010108 +#define OID_802_11_ADD_WEP 0x0D010113 +#define OID_802_11_REMOVE_WEP 0x0D010114 +#define OID_802_11_DISASSOCIATE 0x0D010115 +#define OID_802_11_BSSID_LIST 0x0d010217 +#define OID_802_11_AUTHENTICATION_MODE 0x0d010118 +#define OID_802_11_PRIVACY_FILTER 0x0d010119 +#define OID_802_11_BSSID_LIST_SCAN 0x0d01011A +#define OID_802_11_WEP_STATUS 0x0d01011B +#define OID_802_11_ENCRYPTION_STATUS OID_802_11_WEP_STATUS +#define OID_802_11_ADD_KEY 0x0d01011D +#define OID_802_11_REMOVE_KEY 0x0d01011E +#define OID_802_11_ASSOCIATION_INFORMATION 0x0d01011F +#define OID_802_11_TEST 0x0d010120 +#define OID_802_11_CAPABILITY 0x0d010122 +#define OID_802_11_PMKID 0x0d010123 + +#define NDIS_802_11_LENGTH_SSID 32 +#define NDIS_802_11_LENGTH_RATES 8 +#define NDIS_802_11_LENGTH_RATES_EX 16 + +typedef UCHAR NDIS_802_11_MAC_ADDRESS[6]; + +typedef struct NDIS_802_11_SSID { + ULONG SsidLength; + UCHAR Ssid[NDIS_802_11_LENGTH_SSID]; +} NDIS_802_11_SSID; + +typedef LONG NDIS_802_11_RSSI; + +typedef enum NDIS_802_11_NETWORK_TYPE { + Ndis802_11FH, + Ndis802_11DS, + Ndis802_11OFDM5, + Ndis802_11OFDM24, + Ndis802_11NetworkTypeMax +} NDIS_802_11_NETWORK_TYPE; + +typedef struct NDIS_802_11_CONFIGURATION_FH { + ULONG Length; + ULONG HopPattern; + ULONG HopSet; + ULONG DwellTime; +} NDIS_802_11_CONFIGURATION_FH; + +typedef struct NDIS_802_11_CONFIGURATION { + ULONG Length; + ULONG BeaconPeriod; + ULONG ATIMWindow; + ULONG DSConfig; + NDIS_802_11_CONFIGURATION_FH FHConfig; +} NDIS_802_11_CONFIGURATION; + +typedef enum NDIS_802_11_NETWORK_INFRASTRUCTURE { + Ndis802_11IBSS, + Ndis802_11Infrastructure, + Ndis802_11AutoUnknown, + Ndis802_11InfrastructureMax +} NDIS_802_11_NETWORK_INFRASTRUCTURE; + +typedef enum NDIS_802_11_AUTHENTICATION_MODE { + Ndis802_11AuthModeOpen, + Ndis802_11AuthModeShared, + Ndis802_11AuthModeAutoSwitch, + Ndis802_11AuthModeWPA, + Ndis802_11AuthModeWPAPSK, + Ndis802_11AuthModeWPANone, + Ndis802_11AuthModeWPA2, + Ndis802_11AuthModeWPA2PSK, + Ndis802_11AuthModeMax +} NDIS_802_11_AUTHENTICATION_MODE; + +typedef enum NDIS_802_11_WEP_STATUS { + Ndis802_11WEPEnabled, + Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled, + Ndis802_11WEPDisabled, + Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled, + Ndis802_11WEPKeyAbsent, + Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent, + Ndis802_11WEPNotSupported, + Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported, + Ndis802_11Encryption2Enabled, + Ndis802_11Encryption2KeyAbsent, + Ndis802_11Encryption3Enabled, + Ndis802_11Encryption3KeyAbsent +} NDIS_802_11_WEP_STATUS, NDIS_802_11_ENCRYPTION_STATUS; + +typedef enum NDIS_802_11_PRIVACY_FILTER { + Ndis802_11PrivFilterAcceptAll, + Ndis802_11PrivFilter8021xWEP +} NDIS_802_11_PRIVACY_FILTER; + +typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; +typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; + +typedef struct NDIS_WLAN_BSSID_EX { + ULONG Length; + NDIS_802_11_MAC_ADDRESS MacAddress; /* BSSID */ + UCHAR Reserved[2]; + NDIS_802_11_SSID Ssid; + ULONG Privacy; + NDIS_802_11_RSSI Rssi; + NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; + NDIS_802_11_CONFIGURATION Configuration; + NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; + NDIS_802_11_RATES_EX SupportedRates; + ULONG IELength; + UCHAR IEs[1]; +} NDIS_WLAN_BSSID_EX; + +typedef struct NDIS_802_11_BSSID_LIST_EX { + ULONG NumberOfItems; + NDIS_WLAN_BSSID_EX Bssid[1]; +} NDIS_802_11_BSSID_LIST_EX; + +typedef struct NDIS_802_11_FIXED_IEs { + UCHAR Timestamp[8]; + USHORT BeaconInterval; + USHORT Capabilities; +} NDIS_802_11_FIXED_IEs; + +typedef struct NDIS_802_11_WEP { + ULONG Length; + ULONG KeyIndex; + ULONG KeyLength; + UCHAR KeyMaterial[1]; +} NDIS_802_11_WEP; + +typedef ULONG NDIS_802_11_KEY_INDEX; +typedef ULONGLONG NDIS_802_11_KEY_RSC; + +typedef struct NDIS_802_11_KEY { + ULONG Length; + ULONG KeyIndex; + ULONG KeyLength; + NDIS_802_11_MAC_ADDRESS BSSID; + NDIS_802_11_KEY_RSC KeyRSC; + UCHAR KeyMaterial[1]; +} NDIS_802_11_KEY; + +typedef struct NDIS_802_11_REMOVE_KEY { + ULONG Length; + ULONG KeyIndex; + NDIS_802_11_MAC_ADDRESS BSSID; +} NDIS_802_11_REMOVE_KEY; + +typedef struct NDIS_802_11_AI_REQFI { + USHORT Capabilities; + USHORT ListenInterval; + NDIS_802_11_MAC_ADDRESS CurrentAPAddress; +} NDIS_802_11_AI_REQFI; + +typedef struct NDIS_802_11_AI_RESFI { + USHORT Capabilities; + USHORT StatusCode; + USHORT AssociationId; +} NDIS_802_11_AI_RESFI; + +typedef struct NDIS_802_11_ASSOCIATION_INFORMATION { + ULONG Length; + USHORT AvailableRequestFixedIEs; + NDIS_802_11_AI_REQFI RequestFixedIEs; + ULONG RequestIELength; + ULONG OffsetRequestIEs; + USHORT AvailableResponseFixedIEs; + NDIS_802_11_AI_RESFI ResponseFixedIEs; + ULONG ResponseIELength; + ULONG OffsetResponseIEs; +} NDIS_802_11_ASSOCIATION_INFORMATION; + +typedef struct NDIS_802_11_AUTHENTICATION_ENCRYPTION { + NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported; + NDIS_802_11_ENCRYPTION_STATUS EncryptStatusSupported; +} NDIS_802_11_AUTHENTICATION_ENCRYPTION; + +typedef struct NDIS_802_11_CAPABILITY { + ULONG Length; + ULONG Version; + ULONG NoOfPMKIDs; + ULONG NoOfAuthEncryptPairSupported; + NDIS_802_11_AUTHENTICATION_ENCRYPTION + AuthenticationEncryptionSupported[1]; +} NDIS_802_11_CAPABILITY; + +typedef UCHAR NDIS_802_11_PMKID_VALUE[16]; + +typedef struct BSSID_INFO { + NDIS_802_11_MAC_ADDRESS BSSID; + NDIS_802_11_PMKID_VALUE PMKID; +} BSSID_INFO; + +typedef struct NDIS_802_11_PMKID { + ULONG Length; + ULONG BSSIDInfoCount; + BSSID_INFO BSSIDInfo[1]; +} NDIS_802_11_PMKID; + +typedef enum NDIS_802_11_STATUS_TYPE { + Ndis802_11StatusType_Authentication, + Ndis802_11StatusType_PMKID_CandidateList = 2, + Ndis802_11StatusTypeMax +} NDIS_802_11_STATUS_TYPE; + +typedef struct NDIS_802_11_STATUS_INDICATION { + NDIS_802_11_STATUS_TYPE StatusType; +} NDIS_802_11_STATUS_INDICATION; + +typedef struct PMKID_CANDIDATE { + NDIS_802_11_MAC_ADDRESS BSSID; + ULONG Flags; +} PMKID_CANDIDATE; + +#define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01 + +typedef struct NDIS_802_11_PMKID_CANDIDATE_LIST { + ULONG Version; + ULONG NumCandidates; + PMKID_CANDIDATE CandidateList[1]; +} NDIS_802_11_PMKID_CANDIDATE_LIST; + +typedef struct NDIS_802_11_AUTHENTICATION_REQUEST { + ULONG Length; + NDIS_802_11_MAC_ADDRESS Bssid; + ULONG Flags; +} NDIS_802_11_AUTHENTICATION_REQUEST; + +#define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01 +#define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02 +#define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06 +#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E + +#endif + + +static int ndis_get_oid(struct wpa_driver_ndis_data *drv, unsigned int oid, + char *data, int len) +{ + char *buf; + PACKET_OID_DATA *o; + int ret; + + buf = malloc(sizeof(*o) + len); + if (buf == NULL) + return -1; + memset(buf, 0, sizeof(*o) + len); + o = (PACKET_OID_DATA *) buf; + o->Oid = oid; + o->Length = len; + + if (!PacketRequest(drv->adapter, FALSE, o)) { + wpa_printf(MSG_DEBUG, "%s: oid=0x%x len (%d) failed", + __func__, oid, len); + free(buf); + return -1; + } + if (o->Length > len) { + wpa_printf(MSG_DEBUG, "%s: oid=0x%x Length (%d) > len (%d)", + __func__, oid, (unsigned int) o->Length, len); + free(buf); + return -1; + } + memcpy(data, o->Data, o->Length); + ret = o->Length; + free(buf); + return ret; +} + + +static int ndis_set_oid(struct wpa_driver_ndis_data *drv, unsigned int oid, + char *data, int len) +{ + char *buf; + PACKET_OID_DATA *o; + + buf = malloc(sizeof(*o) + len); + if (buf == NULL) + return -1; + memset(buf, 0, sizeof(*o) + len); + o = (PACKET_OID_DATA *) buf; + o->Oid = oid; + o->Length = len; + if (data) + memcpy(o->Data, data, len); + + if (!PacketRequest(drv->adapter, TRUE, o)) { + wpa_printf(MSG_DEBUG, "%s: oid=0x%x len (%d) failed", + __func__, oid, len); + free(buf); + return -1; + } + free(buf); + return 0; +} + + +static int ndis_set_auth_mode(struct wpa_driver_ndis_data *drv, int mode) +{ + u32 auth_mode = mode; + if (ndis_set_oid(drv, OID_802_11_AUTHENTICATION_MODE, + (char *) &auth_mode, sizeof(auth_mode)) < 0) { + wpa_printf(MSG_DEBUG, "NDIS: Failed to set " + "OID_802_11_AUTHENTICATION_MODE (%d)", + (int) auth_mode); + return -1; + } + return 0; +} + + +static int ndis_get_auth_mode(struct wpa_driver_ndis_data *drv) +{ + u32 auth_mode; + int res; + res = ndis_get_oid(drv, OID_802_11_AUTHENTICATION_MODE, + (char *) &auth_mode, sizeof(auth_mode)); + if (res != sizeof(auth_mode)) { + wpa_printf(MSG_DEBUG, "NDIS: Failed to get " + "OID_802_11_AUTHENTICATION_MODE"); + return -1; + } + return auth_mode; +} + + +static int ndis_set_encr_status(struct wpa_driver_ndis_data *drv, int encr) +{ + u32 encr_status = encr; + if (ndis_set_oid(drv, OID_802_11_ENCRYPTION_STATUS, + (char *) &encr_status, sizeof(encr_status)) < 0) { + wpa_printf(MSG_DEBUG, "NDIS: Failed to set " + "OID_802_11_ENCRYPTION_STATUS (%d)", encr); + return -1; + } + return 0; +} + + +static int ndis_get_encr_status(struct wpa_driver_ndis_data *drv) +{ + u32 encr; + int res; + res = ndis_get_oid(drv, OID_802_11_ENCRYPTION_STATUS, + (char *) &encr, sizeof(encr)); + if (res != sizeof(encr)) { + wpa_printf(MSG_DEBUG, "NDIS: Failed to get " + "OID_802_11_ENCRYPTION_STATUS"); + return -1; + } + return encr; +} + + +static int wpa_driver_ndis_get_bssid(void *priv, u8 *bssid) +{ + struct wpa_driver_ndis_data *drv = priv; + + return ndis_get_oid(drv, OID_802_11_BSSID, bssid, ETH_ALEN) < 0 ? + -1 : 0; +} + + + +static int wpa_driver_ndis_get_ssid(void *priv, u8 *ssid) +{ + struct wpa_driver_ndis_data *drv = priv; + NDIS_802_11_SSID buf; + int res; + + res = ndis_get_oid(drv, OID_802_11_SSID, (char *) &buf, sizeof(buf)); + if (!res) { + wpa_printf(MSG_DEBUG, "NDIS: Failed to get SSID"); + return -1; + } + memcpy(ssid, buf.Ssid, buf.SsidLength); + return buf.SsidLength; +} + + +static int wpa_driver_ndis_set_ssid(struct wpa_driver_ndis_data *drv, + const u8 *ssid, size_t ssid_len) +{ + NDIS_802_11_SSID buf; + + memset(&buf, 0, sizeof(buf)); + buf.SsidLength = ssid_len; + memcpy(buf.Ssid, ssid, ssid_len); + return ndis_set_oid(drv, OID_802_11_SSID, (char *) &buf, sizeof(buf)); +} + + +/* Disconnect using OID_802_11_DISASSOCIATE. This will also turn the radio off. + */ +static int wpa_driver_ndis_radio_off(struct wpa_driver_ndis_data *drv) +{ + drv->radio_enabled = 0; + return ndis_set_oid(drv, OID_802_11_DISASSOCIATE, " ", 4); +} + + +/* Disconnect by setting SSID to random (i.e., likely not used). */ +static int wpa_driver_ndis_disconnect(struct wpa_driver_ndis_data *drv) +{ + char ssid[32]; + int i; + for (i = 0; i < 32; i++) + ssid[i] = rand() & 0xff; + return wpa_driver_ndis_set_ssid(drv, ssid, 32); +} + + +static int wpa_driver_ndis_deauthenticate(void *priv, const u8 *addr, + int reason_code) +{ + struct wpa_driver_ndis_data *drv = priv; + return wpa_driver_ndis_disconnect(drv); +} + + +static int wpa_driver_ndis_disassociate(void *priv, const u8 *addr, + int reason_code) +{ + struct wpa_driver_ndis_data *drv = priv; + return wpa_driver_ndis_disconnect(drv); +} + + +static int wpa_driver_ndis_set_wpa(void *priv, int enabled) +{ + wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, enabled); + return 0; +} + + +static void wpa_driver_ndis_scan_timeout(void *eloop_ctx, void *timeout_ctx) +{ + wpa_printf(MSG_DEBUG, "Scan timeout - try to get results"); + wpa_supplicant_event(timeout_ctx, EVENT_SCAN_RESULTS, NULL); +} + + +static int wpa_driver_ndis_scan(void *priv, const u8 *ssid, size_t ssid_len) +{ + struct wpa_driver_ndis_data *drv = priv; + int res; + + if (!drv->radio_enabled) { + wpa_printf(MSG_DEBUG, "NDIS: turning radio on before the first" + " scan"); + if (wpa_driver_ndis_disconnect(drv) < 0) { + wpa_printf(MSG_DEBUG, "NDIS: failed to enable radio"); + } + drv->radio_enabled = 1; + } + + res = ndis_set_oid(drv, OID_802_11_BSSID_LIST_SCAN, " ", 4); + eloop_register_timeout(3, 0, wpa_driver_ndis_scan_timeout, drv, + drv->ctx); + return res; +} + + +static void wpa_driver_ndis_get_ies(struct wpa_scan_result *res, u8 *ie, + size_t ie_len) +{ + u8 *pos = ie; + u8 *end = ie + ie_len; + + if (ie_len < sizeof(NDIS_802_11_FIXED_IEs)) + return; + + pos += sizeof(NDIS_802_11_FIXED_IEs); + /* wpa_hexdump(MSG_MSGDUMP, "IEs", pos, end - pos); */ + while (pos + 1 < end && pos + 2 + pos[1] <= end) { + u8 ielen = 2 + pos[1]; + if (ielen > SSID_MAX_WPA_IE_LEN) { + pos += ielen; + continue; + } + if (pos[0] == GENERIC_INFO_ELEM && pos[1] >= 4 && + memcmp(pos + 2, "\x00\x50\xf2\x01", 4) == 0) { + memcpy(res->wpa_ie, pos, ielen); + res->wpa_ie_len = ielen; + } else if (pos[0] == RSN_INFO_ELEM) { + memcpy(res->rsn_ie, pos, ielen); + res->rsn_ie_len = ielen; + } + pos += ielen; + } +} + + +static int wpa_driver_ndis_get_scan_results(void *priv, + struct wpa_scan_result *results, + size_t max_size) +{ + struct wpa_driver_ndis_data *drv = priv; + NDIS_802_11_BSSID_LIST_EX *b; + size_t blen; + int len, count, i, j; + char *pos; + + blen = 65535; + b = malloc(blen); + if (b == NULL) + return -1; + memset(b, 0, blen); + len = ndis_get_oid(drv, OID_802_11_BSSID_LIST, (char *) b, blen); + if (len < 0) { + wpa_printf(MSG_DEBUG, "NDIS: failed to get scan results"); + free(b); + return -1; + } + count = b->NumberOfItems; + + if (count > max_size) + count = max_size; + + memset(results, 0, max_size * sizeof(struct wpa_scan_result)); + pos = (char *) &b->Bssid[0]; + for (i = 0; i < count; i++) { + NDIS_WLAN_BSSID_EX *bss = (NDIS_WLAN_BSSID_EX *) pos; + memcpy(results[i].bssid, bss->MacAddress, ETH_ALEN); + memcpy(results[i].ssid, bss->Ssid.Ssid, bss->Ssid.SsidLength); + results[i].ssid_len = bss->Ssid.SsidLength; + if (bss->Privacy) + results[i].caps = 1; /* FIX? */ + results[i].level = (int) bss->Rssi; + results[i].freq = bss->Configuration.DSConfig / 1000; + for (j = 0; j < sizeof(bss->SupportedRates); j++) { + if ((bss->SupportedRates[j] & 0x7f) > + results[i].maxrate) { + results[i].maxrate = + bss->SupportedRates[j] & 0x7f; + } + } + wpa_driver_ndis_get_ies(&results[i], bss->IEs, bss->IELength); + pos += bss->Length; + } + + free(b); + return count; +} + + +static int wpa_driver_ndis_remove_key(struct wpa_driver_ndis_data *drv, + int key_idx, const u8 *addr, + const u8 *bssid, int pairwise) +{ + NDIS_802_11_REMOVE_KEY rkey; + NDIS_802_11_KEY_INDEX index; + int res, res2; + + memset(&rkey, 0, sizeof(rkey)); + + rkey.Length = sizeof(rkey); + rkey.KeyIndex = key_idx; + if (pairwise) + rkey.KeyIndex |= 1 << 30; + memcpy(rkey.BSSID, bssid, ETH_ALEN); + + res = ndis_set_oid(drv, OID_802_11_REMOVE_KEY, (char *) &rkey, + sizeof(rkey)); + if (!pairwise) { + res2 = ndis_set_oid(drv, OID_802_11_REMOVE_WEP, + (char *) &index, sizeof(index)); + } else + res2 = 0; + + if (res < 0 && res2 < 0) + return res; + return 0; +} + + +static int wpa_driver_ndis_add_wep(struct wpa_driver_ndis_data *drv, + int pairwise, int key_idx, int set_tx, + const u8 *key, size_t key_len) +{ + NDIS_802_11_WEP *wep; + size_t len; + int res; + + len = 12 + key_len; + wep = malloc(len); + if (wep == NULL) + return -1; + memset(wep, 0, len); + wep->Length = len; + wep->KeyIndex = key_idx; + if (set_tx) + wep->KeyIndex |= 1 << 31; +#if 0 /* Setting bit30 does not seem to work with some NDIS drivers */ + if (pairwise) + wep->KeyIndex |= 1 << 30; +#endif + wep->KeyLength = key_len; + memcpy(wep->KeyMaterial, key, key_len); + + wpa_hexdump_key(MSG_MSGDUMP, "NDIS: OIS_802_11_ADD_WEP", + (char *) wep, len); + res = ndis_set_oid(drv, OID_802_11_ADD_WEP, (char *) wep, len); + + free(wep); + + return res; +} + +static int wpa_driver_ndis_set_key(void *priv, wpa_alg alg, const u8 *addr, + int key_idx, int set_tx, + const u8 *seq, size_t seq_len, + const u8 *key, size_t key_len) +{ + struct wpa_driver_ndis_data *drv = priv; + size_t len; + NDIS_802_11_KEY *nkey; + int i, res, pairwise; + u8 bssid[ETH_ALEN]; + + if (addr == NULL || memcmp(addr, "\xff\xff\xff\xff\xff\xff", + ETH_ALEN) == 0) { + /* Group Key */ + pairwise = 0; + wpa_driver_ndis_get_bssid(drv, bssid); + } else { + /* Pairwise Key */ + pairwise = 1; + memcpy(bssid, addr, ETH_ALEN); + } + + if (alg == WPA_ALG_NONE || key_len == 0) { + return wpa_driver_ndis_remove_key(drv, key_idx, addr, bssid, + pairwise); + } + + if (alg == WPA_ALG_WEP) { + return wpa_driver_ndis_add_wep(drv, pairwise, key_idx, set_tx, + key, key_len); + } + + len = 12 + 6 + 6 + 8 + key_len; + + nkey = malloc(len); + if (nkey == NULL) + return -1; + memset(nkey, 0, len); + + nkey->Length = len; + nkey->KeyIndex = key_idx; + if (set_tx) + nkey->KeyIndex |= 1 << 31; + if (pairwise) + nkey->KeyIndex |= 1 << 30; + if (seq && seq_len) + nkey->KeyIndex |= 1 << 29; + nkey->KeyLength = key_len; + memcpy(nkey->BSSID, bssid, ETH_ALEN); + if (seq && seq_len) { + for (i = 0; i < seq_len; i++) + nkey->KeyRSC |= seq[i] << (i * 8); + } + if (alg == WPA_ALG_TKIP && key_len == 32) { + memcpy(nkey->KeyMaterial, key, 16); + memcpy(nkey->KeyMaterial + 16, key + 24, 8); + memcpy(nkey->KeyMaterial + 24, key + 16, 8); + } else { + memcpy(nkey->KeyMaterial, key, key_len); + } + + wpa_hexdump_key(MSG_MSGDUMP, "NDIS: OIS_802_11_ADD_KEY", + (char *) nkey, len); + res = ndis_set_oid(drv, OID_802_11_ADD_KEY, (char *) nkey, len); + free(nkey); + + return res; +} + + +static int +wpa_driver_ndis_associate(void *priv, + struct wpa_driver_associate_params *params) +{ + struct wpa_driver_ndis_data *drv = priv; + u32 auth_mode, encr, priv_mode, mode; + + /* Note: Setting OID_802_11_INFRASTRUCTURE_MODE clears current keys, + * so static WEP keys needs to be set again after this. */ + if (params->mode == IEEE80211_MODE_IBSS) + mode = Ndis802_11IBSS; + else + mode = Ndis802_11Infrastructure; + if (ndis_set_oid(drv, OID_802_11_INFRASTRUCTURE_MODE, + (char *) &mode, sizeof(mode)) < 0) { + wpa_printf(MSG_DEBUG, "NDIS: Failed to set " + "OID_802_11_INFRASTRUCTURE_MODE (%d)", + (int) mode); + /* Try to continue anyway */ + } + + if (params->wpa_ie == NULL || params->wpa_ie_len == 0) { + if (params->auth_alg & AUTH_ALG_SHARED_KEY) { + if (params->auth_alg & AUTH_ALG_OPEN_SYSTEM) + auth_mode = Ndis802_11AuthModeAutoSwitch; + else + auth_mode = Ndis802_11AuthModeShared; + } else + auth_mode = Ndis802_11AuthModeOpen; + priv_mode = Ndis802_11PrivFilterAcceptAll; + } else if (params->wpa_ie[0] == RSN_INFO_ELEM) { + priv_mode = Ndis802_11PrivFilter8021xWEP; + if (params->key_mgmt_suite == KEY_MGMT_PSK) + auth_mode = Ndis802_11AuthModeWPA2PSK; + else + auth_mode = Ndis802_11AuthModeWPA2; + } else { + priv_mode = Ndis802_11PrivFilter8021xWEP; + if (params->key_mgmt_suite == KEY_MGMT_WPA_NONE) + auth_mode = Ndis802_11AuthModeWPANone; + else if (params->key_mgmt_suite == KEY_MGMT_PSK) + auth_mode = Ndis802_11AuthModeWPAPSK; + else + auth_mode = Ndis802_11AuthModeWPA; + } + + switch (params->pairwise_suite) { + case CIPHER_CCMP: + encr = Ndis802_11Encryption3Enabled; + break; + case CIPHER_TKIP: + encr = Ndis802_11Encryption2Enabled; + break; + case CIPHER_WEP40: + case CIPHER_WEP104: + encr = Ndis802_11Encryption1Enabled; + break; + case CIPHER_NONE: + if (params->group_suite == CIPHER_CCMP) + encr = Ndis802_11Encryption3Enabled; + else + encr = Ndis802_11Encryption2Enabled; + break; + default: + encr = Ndis802_11EncryptionDisabled; + }; + + if (ndis_set_oid(drv, OID_802_11_PRIVACY_FILTER, + (char *) &priv_mode, sizeof(priv_mode)) < 0) { + wpa_printf(MSG_DEBUG, "NDIS: Failed to set " + "OID_802_11_PRIVACY_FILTER (%d)", + (int) priv_mode); + /* Try to continue anyway */ + } + + ndis_set_auth_mode(drv, auth_mode); + ndis_set_encr_status(drv, encr); + + return wpa_driver_ndis_set_ssid(drv, params->ssid, params->ssid_len); +} + + +static int wpa_driver_ndis_set_pmkid(struct wpa_driver_ndis_data *drv) +{ + int len, count, i, ret; + struct ndis_pmkid_entry *entry; + NDIS_802_11_PMKID *p; + + count = 0; + entry = drv->pmkid; + while (entry) { + count++; + if (count >= drv->no_of_pmkid) + break; + entry = entry->next; + } + len = 8 + count * sizeof(BSSID_INFO); + p = malloc(len); + if (p == NULL) + return -1; + memset(p, 0, len); + p->Length = len; + p->BSSIDInfoCount = count; + entry = drv->pmkid; + for (i = 0; i < count; i++) { + memcpy(&p->BSSIDInfo[i].BSSID, entry->bssid, ETH_ALEN); + memcpy(&p->BSSIDInfo[i].PMKID, entry->pmkid, 16); + entry = entry->next; + } + wpa_hexdump(MSG_MSGDUMP, "NDIS: OID_802_11_PMKID", (char *) p, len); + ret = ndis_set_oid(drv, OID_802_11_PMKID, (char *) p, len); + free(p); + return ret; +} + + +static int wpa_driver_ndis_add_pmkid(void *priv, const u8 *bssid, + const u8 *pmkid) +{ + struct wpa_driver_ndis_data *drv = priv; + struct ndis_pmkid_entry *entry, *prev; + + if (drv->no_of_pmkid == 0) + return 0; + + prev = NULL; + entry = drv->pmkid; + while (entry) { + if (memcmp(entry->bssid, bssid, ETH_ALEN) == 0) + break; + prev = entry; + entry = entry->next; + } + + if (entry) { + /* Replace existing entry for this BSSID and move it into the + * beginning of the list. */ + memcpy(entry->pmkid, pmkid, 16); + if (prev) { + prev->next = entry->next; + entry->next = drv->pmkid; + drv->pmkid = entry; + } + } else { + entry = malloc(sizeof(*entry)); + if (entry) { + memcpy(entry->bssid, bssid, ETH_ALEN); + memcpy(entry->pmkid, pmkid, 16); + entry->next = drv->pmkid; + drv->pmkid = entry; + } + } + + return wpa_driver_ndis_set_pmkid(drv); +} + + +static int wpa_driver_ndis_remove_pmkid(void *priv, const u8 *bssid, + const u8 *pmkid) +{ + struct wpa_driver_ndis_data *drv = priv; + struct ndis_pmkid_entry *entry, *prev; + + if (drv->no_of_pmkid == 0) + return 0; + + entry = drv->pmkid; + prev = NULL; + drv->pmkid = NULL; + while (entry) { + if (memcmp(entry->bssid, bssid, ETH_ALEN) == 0 && + memcmp(entry->pmkid, pmkid, 16) == 0) { + if (prev) + prev->next = entry->next; + else + drv->pmkid = entry->next; + free(entry); + break; + } + prev = entry; + entry = entry->next; + } + return wpa_driver_ndis_set_pmkid(drv); +} + + +static int wpa_driver_ndis_flush_pmkid(void *priv) +{ + struct wpa_driver_ndis_data *drv = priv; + NDIS_802_11_PMKID p; + struct ndis_pmkid_entry *pmkid, *prev; + + if (drv->no_of_pmkid == 0) + return 0; + + pmkid = drv->pmkid; + drv->pmkid = NULL; + while (pmkid) { + prev = pmkid; + pmkid = pmkid->next; + free(prev); + } + + memset(&p, 0, sizeof(p)); + p.Length = 8; + p.BSSIDInfoCount = 0; + wpa_hexdump(MSG_MSGDUMP, "NDIS: OID_802_11_PMKID (flush)", + (char *) &p, 8); + return ndis_set_oid(drv, OID_802_11_PMKID, (char *) &p, 8); +} + + +static int wpa_driver_ndis_get_associnfo(struct wpa_driver_ndis_data *drv) +{ + char buf[512]; + NDIS_802_11_ASSOCIATION_INFORMATION *ai; + int len; + union wpa_event_data data; + + len = ndis_get_oid(drv, OID_802_11_ASSOCIATION_INFORMATION, buf, + sizeof(buf)); + if (len < 0) { + wpa_printf(MSG_DEBUG, "NDIS: failed to get association " + "information"); + return -1; + } + if (len > sizeof(buf)) { + /* Some drivers seem to be producing incorrect length for this + * data. Limit the length to the current buffer size to avoid + * crashing in hexdump. The data seems to be otherwise valid, + * so better try to use it. */ + wpa_printf(MSG_DEBUG, "NDIS: ignored bogus association " + "information length %d", len); + len = ndis_get_oid(drv, OID_802_11_ASSOCIATION_INFORMATION, + buf, sizeof(buf)); + if (len < -1) { + wpa_printf(MSG_DEBUG, "NDIS: re-reading association " + "information failed"); + return -1; + } + if (len > sizeof(buf)) { + wpa_printf(MSG_DEBUG, "NDIS: ignored bogus association" + " information length %d (re-read)", len); + len = sizeof(buf); + } + } + wpa_hexdump(MSG_MSGDUMP, "NDIS: association information", buf, len); + if (len < sizeof(*ai)) { + wpa_printf(MSG_DEBUG, "NDIS: too short association " + "information"); + return -1; + } + ai = (NDIS_802_11_ASSOCIATION_INFORMATION *) buf; + wpa_printf(MSG_DEBUG, "NDIS: ReqFixed=0x%x RespFixed=0x%x off_req=%d " + "off_resp=%d len_req=%d len_resp=%d", + ai->AvailableRequestFixedIEs, ai->AvailableResponseFixedIEs, + (int) ai->OffsetRequestIEs, (int) ai->OffsetResponseIEs, + (int) ai->RequestIELength, (int) ai->ResponseIELength); + + if (ai->OffsetRequestIEs + ai->RequestIELength > len || + ai->OffsetResponseIEs + ai->ResponseIELength > len) { + wpa_printf(MSG_DEBUG, "NDIS: association information - " + "IE overflow"); + return -1; + } + + wpa_hexdump(MSG_MSGDUMP, "NDIS: Request IEs", + buf + ai->OffsetRequestIEs, ai->RequestIELength); + wpa_hexdump(MSG_MSGDUMP, "NDIS: Response IEs", + buf + ai->OffsetResponseIEs, ai->ResponseIELength); + + memset(&data, 0, sizeof(data)); + data.assoc_info.req_ies = buf + ai->OffsetRequestIEs; + data.assoc_info.req_ies_len = ai->RequestIELength; + data.assoc_info.resp_ies = buf + ai->OffsetResponseIEs; + data.assoc_info.resp_ies_len = ai->ResponseIELength; + wpa_supplicant_event(drv->ctx, EVENT_ASSOCINFO, &data); + + return 0; +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:35:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F40F106566B; Thu, 15 Jan 2009 02:35:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE138FC17; Thu, 15 Jan 2009 02:35:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2Zfud060690; Thu, 15 Jan 2009 02:35:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2Zevx060679; Thu, 15 Jan 2009 02:35:40 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200901150235.n0F2Zevx060679@svn.freebsd.org> From: Andrew Thompson Date: Thu, 15 Jan 2009 02:35:40 +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: r187259 - in head/sys/dev/usb2: bluetooth ethernet image input serial wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:35:42 -0000 Author: thompsa Date: Thu Jan 15 02:35:40 2009 New Revision: 187259 URL: http://svn.freebsd.org/changeset/base/187259 Log: Name the items in the xfer arrays so they can be identified throughout the code. Modified: head/sys/dev/usb2/bluetooth/ubtbcmfw2.c head/sys/dev/usb2/ethernet/if_aue2.c head/sys/dev/usb2/ethernet/if_auereg.h head/sys/dev/usb2/ethernet/if_axe2.c head/sys/dev/usb2/ethernet/if_axereg.h head/sys/dev/usb2/ethernet/if_cdce2.c head/sys/dev/usb2/ethernet/if_cdcereg.h head/sys/dev/usb2/ethernet/if_cue2.c head/sys/dev/usb2/ethernet/if_cuereg.h head/sys/dev/usb2/ethernet/if_kue2.c head/sys/dev/usb2/ethernet/if_kuereg.h head/sys/dev/usb2/ethernet/if_rue2.c head/sys/dev/usb2/ethernet/if_ruereg.h head/sys/dev/usb2/ethernet/if_udav2.c head/sys/dev/usb2/ethernet/if_udavreg.h head/sys/dev/usb2/image/uscanner2.c head/sys/dev/usb2/input/uhid2.c head/sys/dev/usb2/input/ukbd2.c head/sys/dev/usb2/input/ums2.c head/sys/dev/usb2/serial/u3g2.c head/sys/dev/usb2/serial/uark2.c head/sys/dev/usb2/serial/ubsa2.c head/sys/dev/usb2/serial/ubser2.c head/sys/dev/usb2/serial/uchcom2.c head/sys/dev/usb2/serial/ucycom2.c head/sys/dev/usb2/serial/uftdi2.c head/sys/dev/usb2/serial/ugensa2.c head/sys/dev/usb2/serial/uipaq2.c head/sys/dev/usb2/serial/ulpt2.c head/sys/dev/usb2/serial/umct2.c head/sys/dev/usb2/serial/umoscom2.c head/sys/dev/usb2/serial/uplcom2.c head/sys/dev/usb2/serial/uvisor2.c head/sys/dev/usb2/serial/uvscom2.c head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_rumvar.h head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_uralvar.h head/sys/dev/usb2/wlan/if_zyd2.c head/sys/dev/usb2/wlan/if_zydreg.h Modified: head/sys/dev/usb2/bluetooth/ubtbcmfw2.c ============================================================================== --- head/sys/dev/usb2/bluetooth/ubtbcmfw2.c Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/bluetooth/ubtbcmfw2.c Thu Jan 15 02:35:40 2009 (r187259) @@ -56,13 +56,21 @@ #define UBTBCMFW_IFACE_IDX 0 /* Control interface */ #define UBTBCMFW_T_MAX 4 /* units */ +enum { + UBTBCMFW_BULK_DT_WR, + UBTBCMFW_BULK_DT_RD, + UBTBCMFW_BULK_CS_WR, + UBTBCMFW_BULK_CS_RD, + UBTBCMFW_N_TRANSFER = 4, +}; + struct ubtbcmfw_softc { struct usb2_fifo_sc sc_fifo; struct mtx sc_mtx; device_t sc_dev; struct usb2_device *sc_udev; - struct usb2_xfer *sc_xfer[UBTBCMFW_T_MAX]; + struct usb2_xfer *sc_xfer[UBTBCMFW_N_TRANSFER]; uint8_t sc_flags; #define UBTBCMFW_FLAG_WRITE_STALL 0x01 @@ -109,7 +117,7 @@ static struct usb2_fifo_methods ubtbcmfw static const struct usb2_config ubtbcmfw_config[UBTBCMFW_T_MAX] = { - [0] = { + [UBTBCMFW_BULK_DT_WR] = { .type = UE_BULK, .endpoint = 0x02, /* fixed */ .direction = UE_DIR_OUT, @@ -118,7 +126,7 @@ static const struct usb2_config ubtbcmfw .mh.callback = &ubtbcmfw_write_callback, }, - [1] = { + [UBTBCMFW_BULK_DT_RD] = { .type = UE_INTERRUPT, .endpoint = 0x01, /* fixed */ .direction = UE_DIR_IN, @@ -127,7 +135,7 @@ static const struct usb2_config ubtbcmfw .mh.callback = &ubtbcmfw_read_callback, }, - [2] = { + [UBTBCMFW_BULK_CS_WR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -138,7 +146,7 @@ static const struct usb2_config ubtbcmfw .mh.interval = 50, /* 50ms */ }, - [3] = { + [UBTBCMFW_BULK_CS_RD] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -273,7 +281,7 @@ ubtbcmfw_write_callback(struct usb2_xfer case USB_ST_TRANSFERRED: case USB_ST_SETUP: if (sc->sc_flags & UBTBCMFW_FLAG_WRITE_STALL) { - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[UBTBCMFW_BULK_CS_WR]); return; } if (usb2_fifo_get_data(f, xfer->frbuffers, 0, @@ -288,7 +296,7 @@ ubtbcmfw_write_callback(struct usb2_xfer if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= UBTBCMFW_FLAG_WRITE_STALL; - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[UBTBCMFW_BULK_CS_WR]); } return; } @@ -298,7 +306,7 @@ static void ubtbcmfw_write_clear_stall_callback(struct usb2_xfer *xfer) { struct ubtbcmfw_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[0]; + struct usb2_xfer *xfer_other = sc->sc_xfer[UBTBCMFW_BULK_DT_WR]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -320,7 +328,7 @@ ubtbcmfw_read_callback(struct usb2_xfer case USB_ST_SETUP: if (sc->sc_flags & UBTBCMFW_FLAG_READ_STALL) { - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[UBTBCMFW_BULK_CS_RD]); return; } if (usb2_fifo_put_bytes_max(f) != 0) { @@ -333,7 +341,7 @@ ubtbcmfw_read_callback(struct usb2_xfer if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= UBTBCMFW_FLAG_READ_STALL; - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[UBTBCMFW_BULK_CS_RD]); } return; } @@ -343,7 +351,7 @@ static void ubtbcmfw_read_clear_stall_callback(struct usb2_xfer *xfer) { struct ubtbcmfw_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[1]; + struct usb2_xfer *xfer_other = sc->sc_xfer[UBTBCMFW_BULK_DT_RD]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -357,7 +365,7 @@ ubtbcmfw_start_read(struct usb2_fifo *fi { struct ubtbcmfw_softc *sc = fifo->priv_sc0; - usb2_transfer_start(sc->sc_xfer[1]); + usb2_transfer_start(sc->sc_xfer[UBTBCMFW_BULK_DT_RD]); } static void @@ -365,8 +373,8 @@ ubtbcmfw_stop_read(struct usb2_fifo *fif { struct ubtbcmfw_softc *sc = fifo->priv_sc0; - usb2_transfer_stop(sc->sc_xfer[3]); - usb2_transfer_stop(sc->sc_xfer[1]); + usb2_transfer_stop(sc->sc_xfer[UBTBCMFW_BULK_CS_RD]); + usb2_transfer_stop(sc->sc_xfer[UBTBCMFW_BULK_DT_RD]); } static void @@ -374,7 +382,7 @@ ubtbcmfw_start_write(struct usb2_fifo *f { struct ubtbcmfw_softc *sc = fifo->priv_sc0; - usb2_transfer_start(sc->sc_xfer[0]); + usb2_transfer_start(sc->sc_xfer[UBTBCMFW_BULK_DT_WR]); } static void @@ -382,8 +390,8 @@ ubtbcmfw_stop_write(struct usb2_fifo *fi { struct ubtbcmfw_softc *sc = fifo->priv_sc0; - usb2_transfer_stop(sc->sc_xfer[2]); - usb2_transfer_stop(sc->sc_xfer[0]); + usb2_transfer_stop(sc->sc_xfer[UBTBCMFW_BULK_CS_WR]); + usb2_transfer_stop(sc->sc_xfer[UBTBCMFW_BULK_DT_WR]); } static int @@ -393,7 +401,7 @@ ubtbcmfw_open(struct usb2_fifo *fifo, in if (fflags & FREAD) { if (usb2_fifo_alloc_buffer(fifo, - sc->sc_xfer[1]->max_data_length, + sc->sc_xfer[UBTBCMFW_BULK_DT_RD]->max_data_length, UBTBCMFW_IFQ_MAXLEN)) { return (ENOMEM); } @@ -404,7 +412,7 @@ ubtbcmfw_open(struct usb2_fifo *fifo, in sc->sc_flags |= UBTBCMFW_FLAG_WRITE_STALL; mtx_unlock(&sc->sc_mtx); if (usb2_fifo_alloc_buffer(fifo, - sc->sc_xfer[0]->max_data_length, + sc->sc_xfer[UBTBCMFW_BULK_DT_WR]->max_data_length, UBTBCMFW_IFQ_MAXLEN)) { return (ENOMEM); } Modified: head/sys/dev/usb2/ethernet/if_aue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_aue2.c Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_aue2.c Thu Jan 15 02:35:40 2009 (r187259) @@ -225,9 +225,9 @@ static void aue_ifmedia_sts_cb(struct if static int aue_ioctl_cb(struct ifnet *, u_long, caddr_t); static void aue_watchdog(void *); -static const struct usb2_config aue_config[AUE_ENDPT_MAX] = { +static const struct usb2_config aue_config[AUE_N_TRANSFER] = { - [0] = { + [AUE_BULK_DT_WR] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, @@ -237,7 +237,7 @@ static const struct usb2_config aue_conf .mh.timeout = 10000, /* 10 seconds */ }, - [1] = { + [AUE_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -246,7 +246,7 @@ static const struct usb2_config aue_conf .mh.callback = &aue_bulk_read_callback, }, - [2] = { + [AUE_BULK_CS_WR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -257,7 +257,7 @@ static const struct usb2_config aue_conf .mh.interval = 50, /* 50ms */ }, - [3] = { + [AUE_BULK_CS_RD] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -268,7 +268,7 @@ static const struct usb2_config aue_conf .mh.interval = 50, /* 50ms */ }, - [4] = { + [AUE_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -277,7 +277,7 @@ static const struct usb2_config aue_conf .mh.callback = &aue_intr_callback, }, - [5] = { + [AUE_INTR_CS_RD] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -774,7 +774,7 @@ aue_attach(device_t dev) iface_index = AUE_IFACE_IDX; error = usb2_transfer_setup(uaa->device, &iface_index, - sc->sc_xfer, aue_config, AUE_ENDPT_MAX, + sc->sc_xfer, aue_config, AUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB " @@ -917,7 +917,7 @@ aue_detach(device_t dev) mtx_unlock(&sc->sc_mtx); /* stop all USB transfers first */ - usb2_transfer_unsetup(sc->sc_xfer, AUE_ENDPT_MAX); + usb2_transfer_unsetup(sc->sc_xfer, AUE_N_TRANSFER); /* get rid of any late children */ bus_generic_detach(dev); @@ -939,7 +939,7 @@ static void aue_intr_clear_stall_callback(struct usb2_xfer *xfer) { struct aue_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[4]; + struct usb2_xfer *xfer_other = sc->sc_xfer[AUE_INTR_DT_RD]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -973,7 +973,7 @@ aue_intr_callback(struct usb2_xfer *xfer } case USB_ST_SETUP: if (sc->sc_flags & AUE_FLAG_INTR_STALL) { - usb2_transfer_start(sc->sc_xfer[5]); + usb2_transfer_start(sc->sc_xfer[AUE_INTR_CS_RD]); } else { xfer->frlengths[0] = xfer->max_data_length; usb2_start_hardware(xfer); @@ -984,7 +984,7 @@ aue_intr_callback(struct usb2_xfer *xfer if (xfer->error != USB_ERR_CANCELLED) { /* start clear stall */ sc->sc_flags |= AUE_FLAG_INTR_STALL; - usb2_transfer_start(sc->sc_xfer[5]); + usb2_transfer_start(sc->sc_xfer[AUE_INTR_CS_RD]); } return; } @@ -994,7 +994,7 @@ static void aue_bulk_read_clear_stall_callback(struct usb2_xfer *xfer) { struct aue_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[1]; + struct usb2_xfer *xfer_other = sc->sc_xfer[AUE_BULK_DT_RD]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -1061,7 +1061,7 @@ aue_bulk_read_callback(struct usb2_xfer tr_setup: if (sc->sc_flags & AUE_FLAG_READ_STALL) { - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[AUE_BULK_CS_RD]); } else { xfer->frlengths[0] = xfer->max_data_length; usb2_start_hardware(xfer); @@ -1083,7 +1083,7 @@ tr_setup: if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= AUE_FLAG_READ_STALL; - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[AUE_BULK_CS_RD]); } DPRINTF("bulk read error, %s\n", usb2_errstr(xfer->error)); @@ -1096,7 +1096,7 @@ static void aue_bulk_write_clear_stall_callback(struct usb2_xfer *xfer) { struct aue_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[0]; + struct usb2_xfer *xfer_other = sc->sc_xfer[AUE_BULK_DT_WR]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -1122,7 +1122,7 @@ aue_bulk_write_callback(struct usb2_xfer case USB_ST_SETUP: if (sc->sc_flags & AUE_FLAG_WRITE_STALL) { - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[AUE_BULK_CS_WR]); goto done; } if (sc->sc_flags & AUE_FLAG_WAIT_LINK) { @@ -1185,7 +1185,7 @@ done: if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= AUE_FLAG_WRITE_STALL; - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[AUE_BULK_CS_WR]); } ifp->if_oerrors++; return; @@ -1274,9 +1274,9 @@ aue_start_transfers(struct aue_softc *sc /* * start the USB transfers, if not already started: */ - usb2_transfer_start(sc->sc_xfer[4]); - usb2_transfer_start(sc->sc_xfer[1]); - usb2_transfer_start(sc->sc_xfer[0]); + usb2_transfer_start(sc->sc_xfer[AUE_INTR_DT_RD]); + usb2_transfer_start(sc->sc_xfer[AUE_BULK_DT_RD]); + usb2_transfer_start(sc->sc_xfer[AUE_BULK_DT_WR]); } } @@ -1504,12 +1504,12 @@ aue_cfg_pre_stop(struct aue_softc *sc, /* * stop all the transfers, if not already stopped: */ - usb2_transfer_stop(sc->sc_xfer[0]); - usb2_transfer_stop(sc->sc_xfer[1]); - usb2_transfer_stop(sc->sc_xfer[2]); - usb2_transfer_stop(sc->sc_xfer[3]); - usb2_transfer_stop(sc->sc_xfer[4]); - usb2_transfer_stop(sc->sc_xfer[5]); + usb2_transfer_stop(sc->sc_xfer[AUE_BULK_DT_WR]); + usb2_transfer_stop(sc->sc_xfer[AUE_BULK_DT_RD]); + usb2_transfer_stop(sc->sc_xfer[AUE_BULK_CS_WR]); + usb2_transfer_stop(sc->sc_xfer[AUE_BULK_CS_RD]); + usb2_transfer_stop(sc->sc_xfer[AUE_INTR_DT_RD]); + usb2_transfer_stop(sc->sc_xfer[AUE_INTR_CS_RD]); } static void Modified: head/sys/dev/usb2/ethernet/if_auereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_auereg.h Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_auereg.h Thu Jan 15 02:35:40 2009 (r187259) @@ -60,7 +60,15 @@ * don't match those in the ADMtek Pegasus manual: we consider the RX data * endpoint to be index 0 and work up from there. */ -#define AUE_ENDPT_MAX 6 +enum { + AUE_BULK_DT_WR, + AUE_BULK_DT_RD, + AUE_BULK_CS_WR, + AUE_BULK_CS_RD, + AUE_INTR_DT_RD, + AUE_INTR_CS_RD, + AUE_N_TRANSFER = 6, +}; #define AUE_INTR_PKTLEN 0x8 @@ -196,7 +204,6 @@ struct aue_rxpkt { uint8_t aue_rxstat; } __packed; - struct aue_softc { void *sc_evilhack; /* XXX this pointer must be first */ @@ -207,7 +214,7 @@ struct aue_softc { struct ifnet *sc_ifp; struct usb2_device *sc_udev; - struct usb2_xfer *sc_xfer[AUE_ENDPT_MAX]; + struct usb2_xfer *sc_xfer[AUE_N_TRANSFER]; device_t sc_miibus; device_t sc_dev; Modified: head/sys/dev/usb2/ethernet/if_axe2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_axe2.c Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_axe2.c Thu Jan 15 02:35:40 2009 (r187259) @@ -188,9 +188,9 @@ static void axe_cfg_ax88178_init(struct static void axe_cfg_ax88772_init(struct axe_softc *); static int axe_get_phyno(struct axe_softc *, int); -static const struct usb2_config axe_config[AXE_ENDPT_MAX] = { +static const struct usb2_config axe_config[AXE_N_TRANSFER] = { - [0] = { + [AXE_BULK_DT_WR] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, @@ -200,7 +200,7 @@ static const struct usb2_config axe_conf .mh.timeout = 10000, /* 10 seconds */ }, - [1] = { + [AXE_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -213,7 +213,7 @@ static const struct usb2_config axe_conf .mh.timeout = 0, /* no timeout */ }, - [2] = { + [AXE_BULK_CS_WR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -224,7 +224,7 @@ static const struct usb2_config axe_conf .mh.interval = 50, /* 50ms */ }, - [3] = { + [AXE_BULK_CS_RD] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -235,7 +235,7 @@ static const struct usb2_config axe_conf .mh.interval = 50, /* 50ms */ }, - [4] = { + [AXE_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -244,7 +244,7 @@ static const struct usb2_config axe_conf .mh.callback = &axe_intr_callback, }, - [5] = { + [AXE_INTR_CS_RD] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -648,7 +648,7 @@ axe_attach(device_t dev) iface_index = AXE_IFACE_IDX; error = usb2_transfer_setup(uaa->device, &iface_index, - sc->sc_xfer, axe_config, AXE_ENDPT_MAX, + sc->sc_xfer, axe_config, AXE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB " @@ -913,7 +913,7 @@ axe_detach(device_t dev) mtx_unlock(&sc->sc_mtx); /* stop all USB transfers first */ - usb2_transfer_unsetup(sc->sc_xfer, AXE_ENDPT_MAX); + usb2_transfer_unsetup(sc->sc_xfer, AXE_N_TRANSFER); /* get rid of any late children */ bus_generic_detach(dev); @@ -935,7 +935,7 @@ static void axe_intr_clear_stall_callback(struct usb2_xfer *xfer) { struct axe_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[4]; + struct usb2_xfer *xfer_other = sc->sc_xfer[AXE_INTR_DT_RD]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -956,7 +956,7 @@ axe_intr_callback(struct usb2_xfer *xfer case USB_ST_SETUP: if (sc->sc_flags & AXE_FLAG_INTR_STALL) { - usb2_transfer_start(sc->sc_xfer[5]); + usb2_transfer_start(sc->sc_xfer[AXE_INTR_CS_RD]); } else { xfer->frlengths[0] = xfer->max_data_length; usb2_start_hardware(xfer); @@ -967,7 +967,7 @@ axe_intr_callback(struct usb2_xfer *xfer if (xfer->error != USB_ERR_CANCELLED) { /* start clear stall */ sc->sc_flags |= AXE_FLAG_INTR_STALL; - usb2_transfer_start(sc->sc_xfer[5]); + usb2_transfer_start(sc->sc_xfer[AXE_INTR_CS_RD]); } return; } @@ -977,7 +977,7 @@ static void axe_bulk_read_clear_stall_callback(struct usb2_xfer *xfer) { struct axe_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[1]; + struct usb2_xfer *xfer_other = sc->sc_xfer[AXE_BULK_DT_RD]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -1083,7 +1083,7 @@ axe_bulk_read_callback(struct usb2_xfer tr_setup: if (sc->sc_flags & AXE_FLAG_READ_STALL) { - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[AXE_BULK_CS_RD]); } else { xfer->frlengths[0] = xfer->max_data_length; usb2_start_hardware(xfer); @@ -1116,7 +1116,7 @@ tr_setup: if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= AXE_FLAG_READ_STALL; - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[AXE_BULK_CS_RD]); } DPRINTF("bulk read error, %s\n", usb2_errstr(xfer->error)); @@ -1129,7 +1129,7 @@ static void axe_bulk_write_clear_stall_callback(struct usb2_xfer *xfer) { struct axe_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[0]; + struct usb2_xfer *xfer_other = sc->sc_xfer[AXE_BULK_DT_WR]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -1160,7 +1160,7 @@ axe_bulk_write_callback(struct usb2_xfer case USB_ST_SETUP: if (sc->sc_flags & AXE_FLAG_WRITE_STALL) { - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[AXE_BULK_CS_WR]); goto done; } if ((sc->sc_flags & AXE_FLAG_LINK) == 0) { @@ -1238,7 +1238,7 @@ done: if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= AXE_FLAG_WRITE_STALL; - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[AXE_BULK_CS_WR]); } ifp->if_oerrors++; return; @@ -1294,9 +1294,9 @@ axe_start_transfers(struct axe_softc *sc /* * start the USB transfers, if not already started: */ - usb2_transfer_start(sc->sc_xfer[4]); - usb2_transfer_start(sc->sc_xfer[1]); - usb2_transfer_start(sc->sc_xfer[0]); + usb2_transfer_start(sc->sc_xfer[AXE_INTR_DT_RD]); + usb2_transfer_start(sc->sc_xfer[AXE_BULK_DT_RD]); + usb2_transfer_start(sc->sc_xfer[AXE_BULK_DT_WR]); } } @@ -1502,12 +1502,12 @@ axe_cfg_pre_stop(struct axe_softc *sc, /* * stop all the transfers, if not already stopped: */ - usb2_transfer_stop(sc->sc_xfer[0]); - usb2_transfer_stop(sc->sc_xfer[1]); - usb2_transfer_stop(sc->sc_xfer[2]); - usb2_transfer_stop(sc->sc_xfer[3]); - usb2_transfer_stop(sc->sc_xfer[4]); - usb2_transfer_stop(sc->sc_xfer[5]); + usb2_transfer_stop(sc->sc_xfer[AXE_BULK_DT_WR]); + usb2_transfer_stop(sc->sc_xfer[AXE_BULK_DT_RD]); + usb2_transfer_stop(sc->sc_xfer[AXE_BULK_CS_WR]); + usb2_transfer_stop(sc->sc_xfer[AXE_BULK_CS_RD]); + usb2_transfer_stop(sc->sc_xfer[AXE_INTR_DT_RD]); + usb2_transfer_stop(sc->sc_xfer[AXE_INTR_CS_RD]); } static void Modified: head/sys/dev/usb2/ethernet/if_axereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_axereg.h Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_axereg.h Thu Jan 15 02:35:40 2009 (r187259) @@ -161,9 +161,6 @@ #define AXE_CONFIG_IDX 0 /* config number 1 */ #define AXE_IFACE_IDX 0 -/* The interrupt endpoint is currently unused by the ASIX part. */ -#define AXE_ENDPT_MAX 6 - struct axe_sframe_hdr { uint16_t len; uint16_t ilen; @@ -172,6 +169,17 @@ struct axe_sframe_hdr { #define GET_MII(sc) ((sc)->sc_miibus ? \ device_get_softc((sc)->sc_miibus) : NULL) +/* The interrupt endpoint is currently unused by the ASIX part. */ +enum { + AXE_BULK_DT_WR, + AXE_BULK_DT_RD, + AXE_BULK_CS_WR, + AXE_BULK_CS_RD, + AXE_INTR_DT_RD, + AXE_INTR_CS_RD, + AXE_N_TRANSFER = 6, +}; + struct axe_softc { void *sc_evilhack; /* XXX this pointer must be first */ @@ -181,7 +189,7 @@ struct axe_softc { struct ifnet *sc_ifp; struct usb2_device *sc_udev; - struct usb2_xfer *sc_xfer[AXE_ENDPT_MAX]; + struct usb2_xfer *sc_xfer[AXE_N_TRANSFER]; device_t sc_miibus; device_t sc_dev; Modified: head/sys/dev/usb2/ethernet/if_cdce2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cdce2.c Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_cdce2.c Thu Jan 15 02:35:40 2009 (r187259) @@ -103,7 +103,7 @@ SYSCTL_INT(_hw_usb2_cdce, OID_AUTO, forc static const struct usb2_config cdce_config[CDCE_N_TRANSFER] = { - [0] = { + [CDCE_BULK_A] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, @@ -122,7 +122,7 @@ static const struct usb2_config cdce_con .md.timeout = 0, /* no timeout */ }, - [1] = { + [CDCE_BULK_B] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -141,7 +141,7 @@ static const struct usb2_config cdce_con .md.timeout = 10000, /* 10 seconds */ }, - [2] = { + [CDCE_INTR] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -474,7 +474,7 @@ alloc_transfers: /* start the interrupt transfer, if any */ mtx_lock(&sc->sc_mtx); - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[CDCE_INTR]); mtx_unlock(&sc->sc_mtx); return (0); /* success */ @@ -535,8 +535,8 @@ cdce_start_transfers(struct cdce_softc * /* * start the USB transfers, if not already started: */ - usb2_transfer_start(sc->sc_xfer[1]); - usb2_transfer_start(sc->sc_xfer[0]); + usb2_transfer_start(sc->sc_xfer[CDCE_BULK_B]); + usb2_transfer_start(sc->sc_xfer[CDCE_BULK_A]); } } @@ -853,8 +853,8 @@ cdce_stop(struct cdce_softc *sc) /* * stop all the transfers, if not already stopped: */ - usb2_transfer_stop(sc->sc_xfer[0]); - usb2_transfer_stop(sc->sc_xfer[1]); + usb2_transfer_stop(sc->sc_xfer[CDCE_BULK_A]); + usb2_transfer_stop(sc->sc_xfer[CDCE_BULK_B]); } static int @@ -939,8 +939,8 @@ cdce_init_cb(void *arg) CDCE_FLAG_LL_READY | CDCE_FLAG_HL_READY); - usb2_transfer_set_stall(sc->sc_xfer[0]); - usb2_transfer_set_stall(sc->sc_xfer[1]); + usb2_transfer_set_stall(sc->sc_xfer[CDCE_BULK_A]); + usb2_transfer_set_stall(sc->sc_xfer[CDCE_BULK_B]); cdce_start_transfers(sc); Modified: head/sys/dev/usb2/ethernet/if_cdcereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_cdcereg.h Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_cdcereg.h Thu Jan 15 02:35:40 2009 (r187259) @@ -35,7 +35,6 @@ #ifndef _USB_IF_CDCEREG_H_ #define _USB_IF_CDCEREG_H_ -#define CDCE_N_TRANSFER 3 /* units */ #define CDCE_IND_SIZE_MAX 32 /* bytes */ #define CDCE_512X4_IFQ_MAXLEN MAX((2*CDCE_512X4_FRAMES_MAX), IFQ_MAXLEN) @@ -54,6 +53,13 @@ struct cdce_mq { /* mini-queue */ uint16_t ifq_len; }; +enum { + CDCE_BULK_A, + CDCE_BULK_B, + CDCE_INTR, + CDCE_N_TRANSFER = 3, +}; + struct cdce_softc { void *sc_evilhack; /* XXX this pointer must be first */ Modified: head/sys/dev/usb2/ethernet/if_cue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cue2.c Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_cue2.c Thu Jan 15 02:35:40 2009 (r187259) @@ -135,9 +135,9 @@ SYSCTL_INT(_hw_usb2_cue, OID_AUTO, debug "Debug level"); #endif -static const struct usb2_config cue_config[CUE_ENDPT_MAX] = { +static const struct usb2_config cue_config[CUE_N_TRANSFER] = { - [0] = { + [CUE_BULK_DT_WR] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, @@ -147,7 +147,7 @@ static const struct usb2_config cue_conf .mh.timeout = 10000, /* 10 seconds */ }, - [1] = { + [CUE_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -156,7 +156,7 @@ static const struct usb2_config cue_conf .mh.callback = &cue_bulk_read_callback, }, - [2] = { + [CUE_BULK_CS_WR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -167,7 +167,7 @@ static const struct usb2_config cue_conf .mh.interval = 50, /* 50ms */ }, - [3] = { + [CUE_BULK_CS_RD] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -412,7 +412,7 @@ cue_attach(device_t dev) iface_index = CUE_IFACE_IDX; error = usb2_transfer_setup(uaa->device, &iface_index, - sc->sc_xfer, cue_config, CUE_ENDPT_MAX, sc, &sc->sc_mtx); + sc->sc_xfer, cue_config, CUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB " "transfers failed!\n"); @@ -514,7 +514,7 @@ cue_detach(device_t dev) mtx_unlock(&sc->sc_mtx); /* stop all USB transfers first */ - usb2_transfer_unsetup(sc->sc_xfer, CUE_ENDPT_MAX); + usb2_transfer_unsetup(sc->sc_xfer, CUE_N_TRANSFER); /* get rid of any late children */ bus_generic_detach(dev); @@ -536,7 +536,7 @@ static void cue_bulk_read_clear_stall_callback(struct usb2_xfer *xfer) { struct cue_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[1]; + struct usb2_xfer *xfer_other = sc->sc_xfer[CUE_BULK_DT_RD]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -586,7 +586,7 @@ cue_bulk_read_callback(struct usb2_xfer tr_setup: if (sc->sc_flags & CUE_FLAG_READ_STALL) { - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[CUE_BULK_CS_RD]); } else { xfer->frlengths[0] = xfer->max_data_length; usb2_start_hardware(xfer); @@ -608,7 +608,7 @@ tr_setup: if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= CUE_FLAG_READ_STALL; - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[CUE_BULK_CS_RD]); } DPRINTF("bulk read error, %s\n", usb2_errstr(xfer->error)); @@ -660,8 +660,8 @@ cue_start_transfers(struct cue_softc *sc /* * start the USB transfers, if not already started: */ - usb2_transfer_start(sc->sc_xfer[1]); - usb2_transfer_start(sc->sc_xfer[0]); + usb2_transfer_start(sc->sc_xfer[CUE_BULK_DT_RD]); + usb2_transfer_start(sc->sc_xfer[CUE_BULK_DT_WR]); } } @@ -669,7 +669,7 @@ static void cue_bulk_write_clear_stall_callback(struct usb2_xfer *xfer) { struct cue_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[0]; + struct usb2_xfer *xfer_other = sc->sc_xfer[CUE_BULK_DT_WR]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -695,7 +695,7 @@ cue_bulk_write_callback(struct usb2_xfer case USB_ST_SETUP: if (sc->sc_flags & CUE_FLAG_WRITE_STALL) { - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[CUE_BULK_CS_WR]); goto done; } IFQ_DRV_DEQUEUE(&ifp->if_snd, m); @@ -738,7 +738,7 @@ done: if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= CUE_FLAG_WRITE_STALL; - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[CUE_BULK_CS_WR]); } ifp->if_oerrors++; return; @@ -904,10 +904,10 @@ cue_cfg_pre_stop(struct cue_softc *sc, /* * stop all the transfers, if not already stopped: */ - usb2_transfer_stop(sc->sc_xfer[0]); - usb2_transfer_stop(sc->sc_xfer[1]); - usb2_transfer_stop(sc->sc_xfer[2]); - usb2_transfer_stop(sc->sc_xfer[3]); + usb2_transfer_stop(sc->sc_xfer[CUE_BULK_DT_WR]); + usb2_transfer_stop(sc->sc_xfer[CUE_BULK_DT_RD]); + usb2_transfer_stop(sc->sc_xfer[CUE_BULK_CS_WR]); + usb2_transfer_stop(sc->sc_xfer[CUE_BULK_CS_RD]); } static void Modified: head/sys/dev/usb2/ethernet/if_cuereg.h ============================================================================== --- head/sys/dev/usb2/ethernet/if_cuereg.h Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_cuereg.h Thu Jan 15 02:35:40 2009 (r187259) @@ -113,7 +113,13 @@ #define CUE_IFACE_IDX 0 /* The interrupt endpoint is currently unused by the KLSI part. */ -#define CUE_ENDPT_MAX 4 +enum { + CUE_BULK_DT_WR, + CUE_BULK_DT_RD, + CUE_BULK_CS_WR, + CUE_BULK_CS_RD, + CUE_N_TRANSFER = 4, +}; struct cue_softc { void *sc_evilhack; /* XXX this pointer must be first */ @@ -125,7 +131,7 @@ struct cue_softc { struct ifnet *sc_ifp; device_t sc_dev; struct usb2_device *sc_udev; - struct usb2_xfer *sc_xfer[CUE_ENDPT_MAX]; + struct usb2_xfer *sc_xfer[CUE_N_TRANSFER]; uint32_t sc_unit; Modified: head/sys/dev/usb2/ethernet/if_kue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_kue2.c Thu Jan 15 02:11:43 2009 (r187258) +++ head/sys/dev/usb2/ethernet/if_kue2.c Thu Jan 15 02:35:40 2009 (r187259) @@ -175,9 +175,9 @@ SYSCTL_INT(_hw_usb2_kue, OID_AUTO, debug "Debug level"); #endif -static const struct usb2_config kue_config[KUE_ENDPT_MAX] = { +static const struct usb2_config kue_config[KUE_N_TRANSFER] = { - [0] = { + [KUE_BULK_DT_WR] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, @@ -187,7 +187,7 @@ static const struct usb2_config kue_conf .mh.timeout = 10000, /* 10 seconds */ }, - [1] = { + [KUE_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -197,7 +197,7 @@ static const struct usb2_config kue_conf .mh.timeout = 0, /* no timeout */ }, - [2] = { + [KUE_BULK_CS_WR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -208,7 +208,7 @@ static const struct usb2_config kue_conf .mh.interval = 50, /* 50ms */ }, - [3] = { + [KUE_BULK_CS_RD] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -474,7 +474,7 @@ kue_attach(device_t dev) iface_index = KUE_IFACE_IDX; error = usb2_transfer_setup(uaa->device, &iface_index, - sc->sc_xfer, kue_config, KUE_ENDPT_MAX, sc, &sc->sc_mtx); + sc->sc_xfer, kue_config, KUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB " "transfers failed!\n"); @@ -581,7 +581,7 @@ kue_detach(device_t dev) mtx_unlock(&sc->sc_mtx); /* stop all USB transfers first */ - usb2_transfer_unsetup(sc->sc_xfer, KUE_ENDPT_MAX); + usb2_transfer_unsetup(sc->sc_xfer, KUE_N_TRANSFER); /* get rid of any late children */ bus_generic_detach(dev); @@ -607,7 +607,7 @@ static void kue_bulk_read_clear_stall_callback(struct usb2_xfer *xfer) { struct kue_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[1]; + struct usb2_xfer *xfer_other = sc->sc_xfer[KUE_BULK_DT_RD]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -657,7 +657,7 @@ kue_bulk_read_callback(struct usb2_xfer tr_setup: if (sc->sc_flags & KUE_FLAG_READ_STALL) { - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[KUE_BULK_CS_RD]); } else { xfer->frlengths[0] = xfer->max_data_length; usb2_start_hardware(xfer); @@ -679,7 +679,7 @@ tr_setup: if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= KUE_FLAG_READ_STALL; - usb2_transfer_start(sc->sc_xfer[3]); + usb2_transfer_start(sc->sc_xfer[KUE_BULK_CS_RD]); } DPRINTF("bulk read error, %s\n", usb2_errstr(xfer->error)); @@ -692,7 +692,7 @@ static void kue_bulk_write_clear_stall_callback(struct usb2_xfer *xfer) { struct kue_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[0]; + struct usb2_xfer *xfer_other = sc->sc_xfer[KUE_BULK_DT_WR]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -720,7 +720,7 @@ kue_bulk_write_callback(struct usb2_xfer case USB_ST_SETUP: if (sc->sc_flags & KUE_FLAG_WRITE_STALL) { - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[KUE_BULK_CS_WR]); goto done; } IFQ_DRV_DEQUEUE(&ifp->if_snd, m); @@ -769,7 +769,7 @@ done: if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ sc->sc_flags |= KUE_FLAG_WRITE_STALL; - usb2_transfer_start(sc->sc_xfer[2]); + usb2_transfer_start(sc->sc_xfer[KUE_BULK_CS_WR]); } ifp->if_oerrors++; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:41:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC0F91065676; Thu, 15 Jan 2009 02:41:26 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A99F78FC0A; Thu, 15 Jan 2009 02:41:26 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2fQVp060824; Thu, 15 Jan 2009 02:41:26 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2fQ7B060823; Thu, 15 Jan 2009 02:41:26 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200901150241.n0F2fQ7B060823@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 15 Jan 2009 02:41: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: r187260 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:41:27 -0000 Author: rodrigc Date: Thu Jan 15 02:41:26 2009 New Revision: 187260 URL: http://svn.freebsd.org/changeset/base/187260 Log: When building up the command-line for the DTrace ctfmerge and ctfconvert utilities, add the ${DEBUG} variable from the kernel config. Otherwise, if we build a kernel with WITH_CTF=1 set, ctfmerge will not have the -g flag set. In this case, the cc has -g specified, so the .o files will have debug information generated, but since ctfmerge does not have -g set, it will strip out the ELF sections containing the DWARF debugging info, leading to a kernel without debugging symbols. Reviewed by: jb Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Jan 15 02:35:40 2009 (r187259) +++ head/sys/conf/kern.pre.mk Thu Jan 15 02:41:26 2009 (r187260) @@ -129,7 +129,7 @@ NORMAL_M= ${AWK} -f $S/tools/makeobjops. ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c .if defined(CTFCONVERT) -NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +NORMAL_CTFCONVERT= ${CTFCONVERT} ${DEBUG} ${CTFFLAGS} ${.TARGET} .else NORMAL_CTFCONVERT= .endif @@ -143,7 +143,7 @@ SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} SYSTEM_OBJS+= hack.So .if defined(CTFMERGE) -SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o +SYSTEM_CTFMERGE= ${CTFMERGE} ${DEBUG} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o LD+= -g .endif SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \ From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:46:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24750106564A; Thu, 15 Jan 2009 02:46:44 +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 10ADF8FC0A; Thu, 15 Jan 2009 02:46:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2khOY061047; Thu, 15 Jan 2009 02:46:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2kh3x061044; Thu, 15 Jan 2009 02:46:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901150246.n0F2kh3x061044@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 15 Jan 2009 02:46: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: r187261 - in head/sys: conf dev/iicbus dev/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:46:44 -0000 Author: nwhitehorn Date: Thu Jan 15 02:46:43 2009 New Revision: 187261 URL: http://svn.freebsd.org/changeset/base/187261 Log: Import an Open Firmware I2C bus module. This attaches firmware device tree indicated I2C devices, and provides an ofw_bus interface for driver probing. This should be MI, but is currently provided only on PowerPC due to lack of sparc64 hardware with an I2C controller. Discussed on: freebsd-arch Added: head/sys/dev/ofw/ofw_iicbus.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/dev/iicbus/iicbus.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Jan 15 02:41:26 2009 (r187260) +++ head/sys/conf/files.powerpc Thu Jan 15 02:46:43 2009 (r187261) @@ -34,6 +34,7 @@ dev/ofw/ofw_if.m optional aim dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim +dev/ofw/ofw_iicbus.c optional iicbus aim dev/ofw/ofw_standard.c optional aim dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_ocp.c optional quicc mpc85xx Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Thu Jan 15 02:41:26 2009 (r187260) +++ head/sys/dev/iicbus/iicbus.c Thu Jan 15 02:46:43 2009 (r187261) @@ -268,3 +268,5 @@ driver_t iicbus_driver = { devclass_t iicbus_devclass; MODULE_VERSION(iicbus, IICBUS_MODVER); +DRIVER_MODULE(iicbus, iichb, iicbus_driver, iicbus_devclass, 0, 0); + Added: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_iicbus.c Thu Jan 15 02:46:43 2009 (r187261) @@ -0,0 +1,183 @@ +/*- + * Copyright (c) 2009, 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 unmodified, 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "iicbus_if.h" + +/* Methods */ +static device_probe_t ofw_iicbus_probe; +static device_attach_t ofw_iicbus_attach; +static device_t ofw_iicbus_add_child(device_t dev, int order, const char *name, + int unit); +static const struct ofw_bus_devinfo *ofw_iicbus_get_devinfo(device_t bus, + device_t dev); + +static device_method_t ofw_iicbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_iicbus_probe), + DEVMETHOD(device_attach, ofw_iicbus_attach), + + /* Bus interface */ + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_add_child, ofw_iicbus_add_child), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, ofw_iicbus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + { 0, 0 } +}; + +struct ofw_iicbus_devinfo { + struct iicbus_ivar opd_dinfo; + struct ofw_bus_devinfo opd_obdinfo; +}; + +static devclass_t ofwiicbus_devclass; + +DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods, 1 /* no softc */, + iicbus_driver); +DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0); +MODULE_VERSION(ofw_iicbus, 1); +MODULE_DEPEND(ofw_iicbus, iicbus, 1, 1, 1); + +static int +ofw_iicbus_probe(device_t dev) +{ + + if (ofw_bus_get_node(dev) == 0) + return (ENXIO); + device_set_desc(dev, "OFW I2C bus"); + + return (0); +} + +static int +ofw_iicbus_attach(device_t dev) +{ + struct iicbus_softc *sc = IICBUS_SOFTC(dev); + struct ofw_iicbus_devinfo *dinfo; + phandle_t node, child; + device_t childdev; + uint32_t addr; + + sc->dev = dev; + mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF); + iicbus_reset(dev, IIC_FASTEST, 0, NULL); + + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + + /* + * Attach those children represented in the device tree. + */ + + node = ofw_bus_get_node(dev); + + for (child = OF_child(node); child != 0; child = OF_peer(child)) { + if (OF_getprop(child, "reg", &addr, sizeof(addr)) == -1) + continue; + + /* + * Now set up the I2C and OFW bus layer devinfo and add it + * to the bus. + */ + + dinfo = malloc(sizeof(struct ofw_iicbus_devinfo), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (dinfo == NULL) + continue; + dinfo->opd_dinfo.addr = addr; + if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != + 0) { + free(dinfo, M_DEVBUF); + continue; + } + childdev = device_add_child(dev, NULL, -1); + device_set_ivars(childdev, dinfo); + } + + return (bus_generic_attach(dev)); +} + +static device_t +ofw_iicbus_add_child(device_t dev, int order, const char *name, int unit) +{ + device_t child; + struct ofw_iicbus_devinfo *devi; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (child); + devi = malloc(sizeof(struct ofw_iicbus_devinfo), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (devi == NULL) { + device_delete_child(dev, child); + return (0); + } + + /* NULL all the OFW-related parts of the ivars for non-OFW children */ + + devi->opd_obdinfo.obd_node = -1; + devi->opd_obdinfo.obd_name = NULL; + devi->opd_obdinfo.obd_compat = NULL; + devi->opd_obdinfo.obd_type = NULL; + devi->opd_obdinfo.obd_model = NULL; + + device_set_ivars(child, devi); + + return (child); +} + +static const struct ofw_bus_devinfo * +ofw_iicbus_get_devinfo(device_t bus, device_t dev) +{ + struct ofw_iicbus_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + return (&dinfo->opd_obdinfo); +} + From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:52:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68F0A106564A; Thu, 15 Jan 2009 02:52:32 +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 54C708FC16; Thu, 15 Jan 2009 02:52:32 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2qWI7061197; Thu, 15 Jan 2009 02:52:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2qWKJ061194; Thu, 15 Jan 2009 02:52:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901150252.n0F2qWKJ061194@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 15 Jan 2009 02:52: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: r187262 - in head/sys: conf powerpc/conf powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:52:33 -0000 Author: nwhitehorn Date: Thu Jan 15 02:52:31 2009 New Revision: 187262 URL: http://svn.freebsd.org/changeset/base/187262 Log: Driver for Apple Keywest I2C controllers found in MacIO ASICs. Used for power and thermal control, as well as GPIOs on Xserves and controlling sound codecs for Apple built-in audio. Submitted by: Marco Trillo Obtained from: NetBSD Added: head/sys/powerpc/powermac/kiic.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/NOTES Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Jan 15 02:46:43 2009 (r187261) +++ head/sys/conf/files.powerpc Thu Jan 15 02:52:31 2009 (r187262) @@ -113,6 +113,7 @@ powerpc/powermac/ata_dbdma.c optional po powerpc/powermac/dbdma.c optional powermac pci powerpc/powermac/grackle.c optional powermac pci powerpc/powermac/hrowpic.c optional powermac pci +powerpc/powermac/kiic.c optional powermac kiic powerpc/powermac/macio.c optional powermac pci powerpc/powermac/openpic_macio.c optional powermac pci powerpc/powermac/pswitch.c optional powermac pswitch Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Thu Jan 15 02:46:43 2009 (r187261) +++ head/sys/powerpc/conf/NOTES Thu Jan 15 02:52:31 2009 (r187262) @@ -25,6 +25,7 @@ options SC_OFWFB # OFW frame buffer device pci device bm # Apple BMAC (Big Mac Ethernet) +device kiic # Apple Keywest I2C Controller device ofwd # Open Firmware disks device adb # Apple Desktop Bus device cuda # VIA-CUDA ADB interface Added: head/sys/powerpc/powermac/kiic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powermac/kiic.c Thu Jan 15 02:52:31 2009 (r187262) @@ -0,0 +1,391 @@ +/*- + * Copyright (c) 2001 Tsubai Masanari. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + * NetBSD: ki2c.c,v 1.11 2007/12/06 17:00:33 ad Exp + * Id: ki2c.c,v 1.7 2002/10/05 09:56:05 tsubai Exp + */ + +/* + * Support routines for the Keywest I2C controller. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "iicbus_if.h" + +/* Keywest I2C Register offsets */ +#define MODE 0 +#define CONTROL 1 +#define STATUS 2 +#define ISR 3 +#define IER 4 +#define ADDR 5 +#define SUBADDR 6 +#define DATA 7 + +/* MODE */ +#define I2C_SPEED 0x03 /* Speed mask */ +#define I2C_100kHz 0x00 +#define I2C_50kHz 0x01 +#define I2C_25kHz 0x02 +#define I2C_MODE 0x0c /* Mode mask */ +#define I2C_DUMBMODE 0x00 /* Dumb mode */ +#define I2C_STDMODE 0x04 /* Standard mode */ +#define I2C_STDSUBMODE 0x08 /* Standard mode + sub address */ +#define I2C_COMBMODE 0x0c /* Combined mode */ +#define I2C_PORT 0xf0 /* Port mask */ + +/* CONTROL */ +#define I2C_CT_AAK 0x01 /* Send AAK */ +#define I2C_CT_ADDR 0x02 /* Send address(es) */ +#define I2C_CT_STOP 0x04 /* Send STOP */ +#define I2C_CT_START 0x08 /* Send START */ + +/* STATUS */ +#define I2C_ST_BUSY 0x01 /* Busy */ +#define I2C_ST_LASTAAK 0x02 /* Last AAK */ +#define I2C_ST_LASTRW 0x04 /* Last R/W */ +#define I2C_ST_SDA 0x08 /* SDA */ +#define I2C_ST_SCL 0x10 /* SCL */ + +/* ISR/IER */ +#define I2C_INT_DATA 0x01 /* Data byte sent/received */ +#define I2C_INT_ADDR 0x02 /* Address sent */ +#define I2C_INT_STOP 0x04 /* STOP condition sent */ +#define I2C_INT_START 0x08 /* START condition sent */ + +/* I2C flags */ +#define I2C_BUSY 0x01 +#define I2C_READING 0x02 +#define I2C_ERROR 0x04 +#define I2C_SELECTED 0x08 + +struct kiic_softc { + device_t sc_dev; + phandle_t sc_node; + struct mtx sc_mutex; + struct resource *sc_reg; + int sc_irqrid; + struct resource *sc_irq; + void *sc_ih; + u_int sc_regstep; + u_int sc_flags; + u_char *sc_data; + int sc_resid; + device_t sc_iicbus; +}; + +static int kiic_probe(device_t dev); +static int kiic_attach(device_t dev); +static void kiic_writereg(struct kiic_softc *sc, u_int, u_int); +static u_int kiic_readreg(struct kiic_softc *, u_int); +static void kiic_setmode(struct kiic_softc *, u_int); +static void kiic_setspeed(struct kiic_softc *, u_int); +static void kiic_intr(void *xsc); +static int kiic_transfer(device_t dev, struct iic_msg *msgs, + uint32_t nmsgs); +static phandle_t kiic_get_node(device_t bus, device_t dev); + +static device_method_t kiic_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, kiic_probe), + DEVMETHOD(device_attach, kiic_attach), + + /* iicbus interface */ + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_transfer, kiic_transfer), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, kiic_get_node), + + { 0, 0 } +}; + +static driver_t kiic_driver = { + "iichb", + kiic_methods, + sizeof(struct kiic_softc) +}; +static devclass_t kiic_devclass; + +DRIVER_MODULE(kiic, macio, kiic_driver, kiic_devclass, 0, 0); + +static int +kiic_probe(device_t self) +{ + const char *name; + + name = ofw_bus_get_name(self); + if (name && strcmp(name, "i2c") == 0) { + device_set_desc(self, "Keywest I2C controller"); + return (0); + } + + return (ENXIO); +} + +static int +kiic_attach(device_t self) +{ + struct kiic_softc *sc = device_get_softc(self); + int rid, rate; + phandle_t node; + char name[64]; + + bzero(sc, sizeof(*sc)); + sc->sc_dev = self; + + node = ofw_bus_get_node(self); + if (node == 0 || node == -1) { + return (EINVAL); + } + + rid = 0; + sc->sc_reg = bus_alloc_resource_any(self, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->sc_reg == NULL) { + return (ENOMEM); + } + + if (OF_getprop(node, "AAPL,i2c-rate", &rate, 4) != 4) { + device_printf(self, "cannot get i2c-rate\n"); + return (ENXIO); + } + if (OF_getprop(node, "AAPL,address-step", &sc->sc_regstep, 4) != 4) { + device_printf(self, "unable to find i2c address step\n"); + return (ENXIO); + } + + /* + * Some Keywest I2C devices have their children attached directly + * underneath them. Some have a single 'iicbus' child with the + * devices underneath that. Sort this out, and make sure that the + * OFW I2C layer has the correct node. + */ + + sc->sc_node = OF_child(node); + if (OF_getprop(sc->sc_node,"name",name,sizeof(name)) > 0) { + if (strcmp(name,"i2c-bus") != 0) + sc->sc_node = node; + } + + mtx_init(&sc->sc_mutex, "kiic", NULL, MTX_DEF); + + sc->sc_irq = bus_alloc_resource_any(self, SYS_RES_IRQ, &sc->sc_irqrid, + RF_ACTIVE); + bus_setup_intr(self, sc->sc_irq, INTR_TYPE_MISC | INTR_MPSAFE, NULL, + kiic_intr, sc, &sc->sc_ih); + + kiic_writereg(sc, STATUS, 0); + kiic_writereg(sc, ISR, 0); + kiic_writereg(sc, IER, 0); + + kiic_setmode(sc, I2C_STDMODE); + kiic_setspeed(sc, I2C_100kHz); /* XXX rate */ + + kiic_writereg(sc, IER, I2C_INT_DATA | I2C_INT_ADDR | I2C_INT_STOP); + + /* Add the IIC bus layer */ + sc->sc_iicbus = device_add_child(self, "iicbus", -1); + + return (bus_generic_attach(self)); +} + +static void +kiic_writereg(struct kiic_softc *sc, u_int reg, u_int val) +{ + bus_write_1(sc->sc_reg, sc->sc_regstep * reg, val); + DELAY(10); /* XXX why? */ +} + +static u_int +kiic_readreg(struct kiic_softc *sc, u_int reg) +{ + return bus_read_1(sc->sc_reg, sc->sc_regstep * reg); +} + +static void +kiic_setmode(struct kiic_softc *sc, u_int mode) +{ + u_int x; + + KASSERT((mode & ~I2C_MODE) == 0, ("bad mode")); + x = kiic_readreg(sc, MODE); + x &= ~I2C_MODE; + x |= mode; + kiic_writereg(sc, MODE, x); +} + +static void +kiic_setspeed(struct kiic_softc *sc, u_int speed) +{ + u_int x; + + KASSERT((speed & ~I2C_SPEED) == 0, ("bad speed")); + x = kiic_readreg(sc, MODE); + x &= ~I2C_SPEED; + x |= speed; + kiic_writereg(sc, MODE, x); +} + +static void +kiic_intr(void *xsc) +{ + struct kiic_softc *sc = xsc; + u_int isr; + uint32_t x; + + mtx_lock(&sc->sc_mutex); + isr = kiic_readreg(sc, ISR); + + if (isr & I2C_INT_ADDR) { + sc->sc_flags |= I2C_SELECTED; + + if (sc->sc_flags & I2C_READING) { + if (sc->sc_resid > 1) { + x = kiic_readreg(sc, CONTROL); + x |= I2C_CT_AAK; + kiic_writereg(sc, CONTROL, x); + } + } else { + kiic_writereg(sc, DATA, *sc->sc_data++); + sc->sc_resid--; + } + } + + if (isr & I2C_INT_DATA) { + if (sc->sc_resid > 0) { + if (sc->sc_flags & I2C_READING) { + *sc->sc_data++ = kiic_readreg(sc, DATA); + sc->sc_resid--; + } else { + kiic_writereg(sc, DATA, *sc->sc_data++); + sc->sc_resid--; + } + } + + if (sc->sc_resid == 0) + wakeup(sc->sc_dev); + } + + if (isr & I2C_INT_STOP) { + kiic_writereg(sc, CONTROL, 0); + sc->sc_flags &= ~I2C_SELECTED; + wakeup(sc->sc_dev); + } + + kiic_writereg(sc, ISR, isr); + mtx_unlock(&sc->sc_mutex); +} + +static int +kiic_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + struct kiic_softc *sc; + int i, x, timo; + uint8_t addr; + + sc = device_get_softc(dev); + timo = 100; + + mtx_lock(&sc->sc_mutex); + + if (sc->sc_flags & I2C_BUSY) + mtx_sleep(dev, &sc->sc_mutex, 0, "kiic", timo); + + if (sc->sc_flags & I2C_BUSY) { + mtx_unlock(&sc->sc_mutex); + return (ETIMEDOUT); + } + + sc->sc_flags = I2C_BUSY; + + for (i = 0; i < nmsgs; i++) { + sc->sc_data = msgs[i].buf; + sc->sc_resid = msgs[i].len; + sc->sc_flags = I2C_BUSY; + addr = msgs[i].slave; + timo = 1000 + sc->sc_resid * 200; + + if (msgs[i].flags & IIC_M_RD) { + sc->sc_flags |= I2C_READING; + addr |= 1; + } + + kiic_writereg(sc, ADDR, addr); + kiic_writereg(sc, SUBADDR, 0x04); + + x = kiic_readreg(sc, CONTROL) | I2C_CT_ADDR; + kiic_writereg(sc, CONTROL, x); + + mtx_sleep(dev, &sc->sc_mutex, 0, "kiic", timo); + + if (!(sc->sc_flags & I2C_READING)) { + x = kiic_readreg(sc, CONTROL) | I2C_CT_STOP; + kiic_writereg(sc, CONTROL, x); + } + + mtx_sleep(dev, &sc->sc_mutex, 0, "kiic", timo); + + msgs[i].len -= sc->sc_resid; + + if (sc->sc_flags & I2C_ERROR) { + device_printf(sc->sc_dev, "I2C_ERROR\n"); + mtx_unlock(&sc->sc_mutex); + return (-1); + } + } + + sc->sc_flags = 0; + + mtx_unlock(&sc->sc_mutex); + + return (0); +} + +static phandle_t +kiic_get_node(device_t bus, device_t dev) +{ + struct kiic_softc *sc; + + sc = device_get_softc(bus); + /* We only have one child, the I2C bus, which needs our own node. */ + + return sc->sc_node; +} + From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:54:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92D9E1065670; Thu, 15 Jan 2009 02:54:40 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F69A8FC08; Thu, 15 Jan 2009 02:54:40 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2se9U061283; Thu, 15 Jan 2009 02:54:40 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2seon061282; Thu, 15 Jan 2009 02:54:40 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150254.n0F2seon061282@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 02:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187263 - stable/7/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:54:41 -0000 Author: keramida (doc committer) Date: Thu Jan 15 02:54:40 2009 New Revision: 187263 URL: http://svn.freebsd.org/changeset/base/187263 Log: MFC 173507 from /head. Instead of hardcoding md10 as the device node in the cd9660 example, use a trick submitted by Ruslan. Modified: stable/7/sbin/mdconfig/ (props changed) stable/7/sbin/mdconfig/mdconfig.8 Modified: stable/7/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:52:31 2009 (r187262) +++ stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:54:40 2009 (r187263) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2008 +.Dd November 9, 2007 .Dt MDCONFIG 8 .Os .Sh NAME @@ -230,8 +230,7 @@ mount /dev/md0c /mnt .Pp To mount an ISO 9660 CD image file: .Bd -literal -offset indent -mdconfig -a -t vnode -u 10 -f cdimage.iso -mount_cd9660 /dev/md10 /mnt +mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt .Ed .Sh SEE ALSO .Xr md 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 02:57:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092B2106564A; Thu, 15 Jan 2009 02:57:08 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D041F8FC14; Thu, 15 Jan 2009 02:57:07 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F2v7TY061384; Thu, 15 Jan 2009 02:57:07 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F2v77w061383; Thu, 15 Jan 2009 02:57:07 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150257.n0F2v77w061383@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 02:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187264 - stable/7/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 02:57:08 -0000 Author: keramida (doc committer) Date: Thu Jan 15 02:57:07 2009 New Revision: 187264 URL: http://svn.freebsd.org/changeset/base/187264 Log: MFC 173539 from /head * Expand the example descriptions, fix mdoc-bugs in "(-a and -t vnode are implied)" and reuse it near the cd9660 example. * Spell 'backing store' as two words. Modified: stable/7/sbin/mdconfig/ (props changed) stable/7/sbin/mdconfig/mdconfig.8 Modified: stable/7/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:54:40 2009 (r187263) +++ stable/7/sbin/mdconfig/mdconfig.8 Thu Jan 15 02:57:07 2009 (r187264) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2007 +.Dd November 11, 2007 .Dt MDCONFIG 8 .Os .Sh NAME @@ -97,7 +97,7 @@ panic a system. .It Cm vnode A file specified with .Fl f Ar file -becomes the backingstore for this memory disk. +becomes the backing store for this memory disk. .It Cm swap Storage for this type of memory disk is allocated from buffer memory. @@ -197,7 +197,7 @@ To create a disk named .Pa /dev/md4 with .Pa /tmp/boot.flp -as backing: +as backing storage: .Pp .Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4 .Pp @@ -206,7 +206,9 @@ To detach and free all resources used by .Pp .Dl mdconfig -d -u 4 .Pp -To create and mount a 128MByte swap backed file system on +To create a 128MByte swap backed disk, initialize an +.Xr ffs 7 +file system on it, and mount it on .Pa /tmp : .Bd -literal -offset indent mdconfig -a -t swap -s 128M -u 10 @@ -215,10 +217,10 @@ mount /dev/md10 /tmp chmod 1777 /tmp .Ed .Pp -To create a 5MB file-backed disk ( -.Fl -a +To create a 5MB file-backed disk +.Ns ( Fl a and -.Fl -t Ar vnode +.Fl t Ar vnode are implied): .Bd -literal -offset indent dd if=/dev/zero of=somebackingfile bs=1k count=5k @@ -228,12 +230,21 @@ newfs md0c mount /dev/md0c /mnt .Ed .Pp -To mount an ISO 9660 CD image file: +To create an +.Xr md 4 +device out of an ISO 9660 CD image file +.Ns ( Fl a +and +.Fl t Ar vnode +are implied), using the first available +.Xr md 4 +device, and then mount the new memory disk: .Bd -literal -offset indent -mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt +mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt .Ed .Sh SEE ALSO .Xr md 4 , +.Xr ffs 7 , .Xr bsdlabel 8 , .Xr fdisk 8 , .Xr mdmfs 8 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:12:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10D2E1065674; Thu, 15 Jan 2009 03:12:46 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F14AB8FC18; Thu, 15 Jan 2009 03:12:45 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3CjST062007; Thu, 15 Jan 2009 03:12:45 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3Cj9F062006; Thu, 15 Jan 2009 03:12:45 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150312.n0F3Cj9F062006@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 03:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187265 - stable/7/usr.sbin/iostat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:12:46 -0000 Author: keramida (doc committer) Date: Thu Jan 15 03:12:45 2009 New Revision: 187265 URL: http://svn.freebsd.org/changeset/base/187265 Log: MFC 175562 from /head Repeat iostat header after rows-3 instead of a hardcoded 20. Use ioctl() to get the window size in iostat(8), and force a new header to be prepended to the output every time the current window size changes. Change the number of lines before each header to `rows - 3' when the terminal is resized, so that the full terminal length can be used for output lines. Modified: stable/7/usr.sbin/iostat/ (props changed) stable/7/usr.sbin/iostat/iostat.c Modified: stable/7/usr.sbin/iostat/iostat.c ============================================================================== --- stable/7/usr.sbin/iostat/iostat.c Thu Jan 15 02:57:07 2009 (r187264) +++ stable/7/usr.sbin/iostat/iostat.c Thu Jan 15 03:12:45 2009 (r187265) @@ -113,6 +113,7 @@ #include #include #include +#include #include #include #include @@ -129,17 +130,23 @@ struct nlist namelist[] = { { NULL }, }; +#define IOSTAT_DEFAULT_ROWS 20 /* Traditional default `wrows' */ + struct statinfo cur, last; int num_devices; struct device_selection *dev_select; int maxshowdevs; volatile sig_atomic_t headercount; +volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +unsigned short wrows; /* Current number of tty rows. */ int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; int xflag = 0, zflag = 0; /* local function declarations */ static void usage(void); static void needhdr(int signo); +static void needresize(int signo); +static void doresize(void); static void phdr(void); static void devstats(int perf_select, long double etime, int havelast); static void cpustats(void); @@ -424,6 +431,20 @@ main(int argc, char **argv) */ (void)signal(SIGCONT, needhdr); + /* + * If our standard output is a tty, then install a SIGWINCH handler + * and set wresized so that our first iteration through the main + * iostat loop will peek at the terminal's current rows to find out + * how many lines can fit in a screenful of output. + */ + if (isatty(fileno(stdout)) != 0) { + wresized = 1; + (void)signal(SIGWINCH, needresize); + } else { + wresized = 0; + wrows = IOSTAT_DEFAULT_ROWS; + } + for (headercount = 1;;) { struct devinfo *tmp_dinfo; long tmp; @@ -457,7 +478,9 @@ main(int argc, char **argv) if (!--headercount) { phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; } tmp_dinfo = last.dinfo; @@ -499,7 +522,9 @@ main(int argc, char **argv) break; case 1: phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; break; default: break; @@ -534,7 +559,9 @@ main(int argc, char **argv) break; case 1: phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; break; default: break; @@ -595,6 +622,47 @@ needhdr(int signo) headercount = 1; } +/* + * When the terminal is resized, force an update of the maximum number of rows + * printed between each header repetition. Then force a new header to be + * prepended to the next output. + */ +void +needresize(int signo) +{ + + wresized = 1; + headercount = 1; +} + +/* + * Update the global `wrows' count of terminal rows. + */ +void +doresize(void) +{ + int status; + struct winsize w; + + for (;;) { + status = ioctl(fileno(stdout), TIOCGWINSZ, &w); + if (status == -1 && errno == EINTR) + continue; + else if (status == -1) + err(1, "ioctl"); + if (w.ws_row > 3) + wrows = w.ws_row - 3; + else + wrows = IOSTAT_DEFAULT_ROWS; + break; + } + + /* + * Inhibit doresize() calls until we are rescheduled by SIGWINCH. + */ + wresized = 0; +} + static void phdr(void) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:23:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A959D106564A; Thu, 15 Jan 2009 03:23:07 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 52A978FC13; Thu, 15 Jan 2009 03:23:07 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 78EDFFEF2; Thu, 15 Jan 2009 16:23:06 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NpJ8tLC-Q+HZ; Thu, 15 Jan 2009 16:23:02 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 15 Jan 2009 16:23:02 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 169281142C; Thu, 15 Jan 2009 16:23:02 +1300 (NZDT) Date: Wed, 14 Jan 2009 19:23:01 -0800 From: Andrew Thompson To: Craig Rodrigues Message-ID: <20090115032301.GA78451@citylink.fud.org.nz> References: <200901150241.n0F2fQ7B060823@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901150241.n0F2fQ7B060823@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187260 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:23:08 -0000 On Thu, Jan 15, 2009 at 02:41:26AM +0000, Craig Rodrigues wrote: > Author: rodrigc > Date: Thu Jan 15 02:41:26 2009 > New Revision: 187260 > URL: http://svn.freebsd.org/changeset/base/187260 > > Log: > When building up the command-line for the DTrace ctfmerge and ctfconvert > utilities, add the ${DEBUG} variable from the kernel config. Otherwise, > if we build a kernel with WITH_CTF=1 set, ctfmerge will not have > the -g flag set. In this case, the cc has -g specified, so the > .o files will have debug information generated, but since ctfmerge > does not have -g set, it will strip out the ELF sections containing > the DWARF debugging info, leading to a kernel without debugging symbols. > > Reviewed by: jb > > Modified: > head/sys/conf/kern.pre.mk > > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > --- head/sys/conf/kern.pre.mk Thu Jan 15 02:35:40 2009 (r187259) > +++ head/sys/conf/kern.pre.mk Thu Jan 15 02:41:26 2009 (r187260) > @@ -129,7 +129,7 @@ NORMAL_M= ${AWK} -f $S/tools/makeobjops. > ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c > > .if defined(CTFCONVERT) > -NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} > +NORMAL_CTFCONVERT= ${CTFCONVERT} ${DEBUG} ${CTFFLAGS} ${.TARGET} It seems this was also a few days ago fixed by http://svn.freebsd.org/changeset/base/187103 One of which is now redundant? Andrew From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:23:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC21D1065676; Thu, 15 Jan 2009 03:23:36 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B25C98FC1E; Thu, 15 Jan 2009 03:23:36 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3NapJ062259; Thu, 15 Jan 2009 03:23:36 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3NajS062258; Thu, 15 Jan 2009 03:23:36 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901150323.n0F3NajS062258@svn.freebsd.org> From: Sam Leffler Date: Thu, 15 Jan 2009 03:23: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: r187266 - head/contrib/wpa_supplicant X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:23:37 -0000 Author: sam Date: Thu Jan 15 03:23:36 2009 New Revision: 187266 URL: http://svn.freebsd.org/changeset/base/187266 Log: bootstrap merge history Modified: head/contrib/wpa_supplicant/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:27:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD0721065670; Thu, 15 Jan 2009 03:27:28 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A10708FC1A; Thu, 15 Jan 2009 03:27:28 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3RSwu062366; Thu, 15 Jan 2009 03:27:28 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3RSIu062365; Thu, 15 Jan 2009 03:27:28 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901150327.n0F3RSIu062365@svn.freebsd.org> From: Sam Leffler Date: Thu, 15 Jan 2009 03:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187267 - vendor/wpa_supplicant/0.5.10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:27:29 -0000 Author: sam Date: Thu Jan 15 03:27:28 2009 New Revision: 187267 URL: http://svn.freebsd.org/changeset/base/187267 Log: tag 0.5.10 Added: vendor/wpa_supplicant/0.5.10/ - copied from r187266, vendor/wpa_supplicant/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:28:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F8BE1065680; Thu, 15 Jan 2009 03:28:18 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 337428FC1F; Thu, 15 Jan 2009 03:28:18 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3SIIX062427; Thu, 15 Jan 2009 03:28:18 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3SIX7062426; Thu, 15 Jan 2009 03:28:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901150328.n0F3SIX7062426@svn.freebsd.org> From: Sam Leffler Date: Thu, 15 Jan 2009 03:28: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: r187268 - head/contrib/wpa_supplicant X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:28:19 -0000 Author: sam Date: Thu Jan 15 03:28:17 2009 New Revision: 187268 URL: http://svn.freebsd.org/changeset/base/187268 Log: re-merge after tag Modified: head/contrib/wpa_supplicant/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:35:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 895EA1065670; Thu, 15 Jan 2009 03:35:51 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76B1A8FC08; Thu, 15 Jan 2009 03:35:51 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3Zpd5062643; Thu, 15 Jan 2009 03:35:51 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3ZpNX062642; Thu, 15 Jan 2009 03:35:51 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150335.n0F3ZpNX062642@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 03:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187269 - stable/6/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:35:52 -0000 Author: keramida (doc committer) Date: Thu Jan 15 03:35:51 2009 New Revision: 187269 URL: http://svn.freebsd.org/changeset/base/187269 Log: MFC 173507 from /head Instead of hardcoding md10 as the device node in the cd9660 example, use a trick submitted by Ruslan. Modified: stable/6/sbin/mdconfig/ (props changed) stable/6/sbin/mdconfig/mdconfig.8 Modified: stable/6/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/6/sbin/mdconfig/mdconfig.8 Thu Jan 15 03:28:17 2009 (r187268) +++ stable/6/sbin/mdconfig/mdconfig.8 Thu Jan 15 03:35:51 2009 (r187269) @@ -226,8 +226,7 @@ mount /dev/md0c /mnt .Pp To mount an ISO 9660 CD image file: .Bd -literal -offset indent -mdconfig -a -t vnode -u 10 -f cdimage.iso -mount_cd9660 /dev/md10 /mnt +mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt .Ed .Sh SEE ALSO .Xr md 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:42:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2129C1065673; Thu, 15 Jan 2009 03:42:44 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6DC38FC19; Thu, 15 Jan 2009 03:42:43 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3ghEJ062804; Thu, 15 Jan 2009 03:42:43 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3ghmw062803; Thu, 15 Jan 2009 03:42:43 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150342.n0F3ghmw062803@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 03:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187270 - stable/6/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:42:45 -0000 Author: keramida (doc committer) Date: Thu Jan 15 03:42:43 2009 New Revision: 187270 URL: http://svn.freebsd.org/changeset/base/187270 Log: MFC 173539-173540 * Expand the example descriptions, fix mdoc-bugs in "(-a and -t vnode are implied)" and reuse it near the cd9660 example. * Spell 'backing store' as two words. Modified: stable/6/sbin/mdconfig/ (props changed) stable/6/sbin/mdconfig/mdconfig.8 Modified: stable/6/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/6/sbin/mdconfig/mdconfig.8 Thu Jan 15 03:35:51 2009 (r187269) +++ stable/6/sbin/mdconfig/mdconfig.8 Thu Jan 15 03:42:43 2009 (r187270) @@ -96,7 +96,7 @@ panic a system. .It Cm vnode A file specified with .Fl f Ar file -becomes the backingstore for this memory disk. +becomes the backing store for this memory disk. .It Cm swap Storage for this type of memory disk is allocated from buffer memory. @@ -193,7 +193,7 @@ To create a disk named .Pa /dev/md4 with .Pa /tmp/boot.flp -as backing: +as backing storage: .Pp .Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4 .Pp @@ -202,7 +202,9 @@ To detach and free all resources used by .Pp .Dl mdconfig -d -u 4 .Pp -To create and mount a 128MByte swap backed file system on +To create a 128MByte swap backed disk, initialize an +.Xr ffs 7 +file system on it, and mount it on .Pa /tmp : .Bd -literal -offset indent mdconfig -a -t swap -s 128M -u 10 @@ -211,10 +213,10 @@ mount /dev/md10 /tmp chmod 1777 /tmp .Ed .Pp -To create a 5MB file-backed disk ( -.Fl -a +To create a 5MB file-backed disk +.Ns ( Fl a and -.Fl -t Ar vnode +.Fl t Ar vnode are implied): .Bd -literal -offset indent dd if=/dev/zero of=somebackingfile bs=1k count=5k @@ -224,12 +226,21 @@ newfs md0c mount /dev/md0c /mnt .Ed .Pp -To mount an ISO 9660 CD image file: +To create an +.Xr md 4 +device out of an ISO 9660 CD image file +.Ns ( Fl a +and +.Fl t Ar vnode +are implied), using the first available +.Xr md 4 +device, and then mount the new memory disk: .Bd -literal -offset indent -mount -t cd9660 /dev/`mdconfig -a -t vnode -f cdimage.iso` /mnt +mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt .Ed .Sh SEE ALSO .Xr md 4 , +.Xr ffs 7 , .Xr bsdlabel 8 , .Xr fdisk 8 , .Xr mdmfs 8 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:46:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD6C71065672; Thu, 15 Jan 2009 03:46:14 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA5CC8FC0A; Thu, 15 Jan 2009 03:46:14 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3kESs062937; Thu, 15 Jan 2009 03:46:14 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3kENX062936; Thu, 15 Jan 2009 03:46:14 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150346.n0F3kENX062936@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 03:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187271 - stable/6/usr.sbin/iostat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:46:15 -0000 Author: keramida (doc committer) Date: Thu Jan 15 03:46:14 2009 New Revision: 187271 URL: http://svn.freebsd.org/changeset/base/187271 Log: MFC 175562 Repeat iostat header after rows-3 instead of a hardcoded 20. Use ioctl() to get the window size in iostat(8), and force a new header to be prepended to the output every time the current window size changes. Change the number of lines before each header to `rows - 3' when the terminal is resized, so that the full terminal length can be used for output lines. Modified: stable/6/usr.sbin/iostat/ (props changed) stable/6/usr.sbin/iostat/iostat.c Modified: stable/6/usr.sbin/iostat/iostat.c ============================================================================== --- stable/6/usr.sbin/iostat/iostat.c Thu Jan 15 03:42:43 2009 (r187270) +++ stable/6/usr.sbin/iostat/iostat.c Thu Jan 15 03:46:14 2009 (r187271) @@ -113,6 +113,7 @@ #include #include #include +#include #include #include #include @@ -131,17 +132,23 @@ struct nlist namelist[] = { { NULL }, }; +#define IOSTAT_DEFAULT_ROWS 20 /* Traditional default `wrows' */ + struct statinfo cur, last; int num_devices; struct device_selection *dev_select; int maxshowdevs; volatile sig_atomic_t headercount; +volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +unsigned short wrows; /* Current number of tty rows. */ int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; int xflag = 0, zflag = 0; /* local function declarations */ static void usage(void); static void needhdr(int signo); +static void needresize(int signo); +static void doresize(void); static void phdr(void); static void devstats(int perf_select, long double etime, int havelast); static void cpustats(void); @@ -426,6 +433,20 @@ main(int argc, char **argv) */ (void)signal(SIGCONT, needhdr); + /* + * If our standard output is a tty, then install a SIGWINCH handler + * and set wresized so that our first iteration through the main + * iostat loop will peek at the terminal's current rows to find out + * how many lines can fit in a screenful of output. + */ + if (isatty(fileno(stdout)) != 0) { + wresized = 1; + (void)signal(SIGWINCH, needresize); + } else { + wresized = 0; + wrows = IOSTAT_DEFAULT_ROWS; + } + for (headercount = 1;;) { struct devinfo *tmp_dinfo; long tmp; @@ -451,7 +472,9 @@ main(int argc, char **argv) if (!--headercount) { phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; } tmp_dinfo = last.dinfo; @@ -493,7 +516,9 @@ main(int argc, char **argv) break; case 1: phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; break; default: break; @@ -528,7 +553,9 @@ main(int argc, char **argv) break; case 1: phdr(); - headercount = 20; + if (wresized != 0) + doresize(); + headercount = wrows; break; default: break; @@ -589,6 +616,47 @@ needhdr(int signo) headercount = 1; } +/* + * When the terminal is resized, force an update of the maximum number of rows + * printed between each header repetition. Then force a new header to be + * prepended to the next output. + */ +void +needresize(int signo) +{ + + wresized = 1; + headercount = 1; +} + +/* + * Update the global `wrows' count of terminal rows. + */ +void +doresize(void) +{ + int status; + struct winsize w; + + for (;;) { + status = ioctl(fileno(stdout), TIOCGWINSZ, &w); + if (status == -1 && errno == EINTR) + continue; + else if (status == -1) + err(1, "ioctl"); + if (w.ws_row > 3) + wrows = w.ws_row - 3; + else + wrows = IOSTAT_DEFAULT_ROWS; + break; + } + + /* + * Inhibit doresize() calls until we are rescheduled by SIGWINCH. + */ + wresized = 0; +} + static void phdr(void) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 03:48:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C510106564A; Thu, 15 Jan 2009 03:48:49 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 893F78FC08; Thu, 15 Jan 2009 03:48:49 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F3mn9x063033; Thu, 15 Jan 2009 03:48:49 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F3mnsH063031; Thu, 15 Jan 2009 03:48:49 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150348.n0F3mnsH063031@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 03:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187272 - stable/7/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 03:48:50 -0000 Author: keramida (doc committer) Date: Thu Jan 15 03:48:49 2009 New Revision: 187272 URL: http://svn.freebsd.org/changeset/base/187272 Log: 176561 | keramida | 2008-02-25 21:06:43 +0200 (Mon, 25 Feb 2008) | 11 lines Implement from scratch a -l option for du(1), to match the same option of the GNU utility. The default behavior of our original `du' is to count hardlinked files only once for each invocation of the utility. With the new -l option they count towards the final size every time they are found. Modified: stable/7/usr.bin/du/ (props changed) stable/7/usr.bin/du/du.1 stable/7/usr.bin/du/du.c Modified: stable/7/usr.bin/du/du.1 ============================================================================== --- stable/7/usr.bin/du/du.1 Thu Jan 15 03:46:14 2009 (r187271) +++ stable/7/usr.bin/du/du.1 Thu Jan 15 03:48:49 2009 (r187272) @@ -32,7 +32,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd May 6, 2006 +.Dd February 25, 2008 .Dt DU 1 .Os .Sh NAME @@ -43,6 +43,7 @@ .Op Fl H | L | P .Op Fl a | s | d Ar depth .Op Fl c +.Op Fl l .Op Fl h | k | m .Op Fl n .Op Fl x @@ -94,6 +95,15 @@ directories deep. Display a grand total. .It Fl k Display block counts in 1024-byte (1-Kbyte) blocks. +.It Fl l +If a file has multiple hard links, count its size many times. +The default behavior of +.Nm +is to count files with multiple hard links only once. +When the +.Fl l +option is specified, the hard link checks are disabled, and these files +are counted (and displayed) as many times as they are found. .It Fl m Display block counts in 1048576-byte (1-Mbyte) blocks. .It Fl n @@ -120,11 +130,6 @@ or .Fl L options are specified, storage used by any symbolic links which are followed is not counted or displayed. -.Pp -Files having multiple hard links are counted (and displayed) a single -time per -.Nm -execution. .Sh ENVIRONMENT .Bl -tag -width BLOCKSIZE .It Ev BLOCKSIZE Modified: stable/7/usr.bin/du/du.c ============================================================================== --- stable/7/usr.bin/du/du.c Thu Jan 15 03:46:14 2009 (r187271) +++ stable/7/usr.bin/du/du.c Thu Jan 15 03:48:49 2009 (r187272) @@ -90,20 +90,22 @@ main(int argc, char *argv[]) int ftsoptions; int listall; int depth; - int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag, ch, notused, rval; + int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; + int hflag, lflag, ch, notused, rval; char **save; static char dot[] = "."; setlocale(LC_ALL, ""); - Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = 0; + Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = + lflag = 0; save = argv; ftsoptions = 0; depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "HI:LPasd:chkmnrx")) != -1) + while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -147,6 +149,9 @@ main(int argc, char *argv[]) hflag = 0; setenv("BLOCKSIZE", "1024", 1); break; + case 'l': + lflag = 1; + break; case 'm': hflag = 0; setenv("BLOCKSIZE", "1048576", 1); @@ -257,7 +262,8 @@ main(int argc, char *argv[]) if (ignorep(p)) break; - if (p->fts_statp->st_nlink > 1 && linkchk(p)) + if (lflag == 0 && + p->fts_statp->st_nlink > 1 && linkchk(p)) break; if (listall || p->fts_level == 0) { @@ -443,7 +449,8 @@ static void usage(void) { (void)fprintf(stderr, - "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n"); + "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] " + "[-l] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n"); exit(EX_USAGE); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:19:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDFDB106564A; Thu, 15 Jan 2009 04:19:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0D18FC08; Thu, 15 Jan 2009 04:19:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4J36H063661; Thu, 15 Jan 2009 04:19:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4J3PU063660; Thu, 15 Jan 2009 04:19:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901150419.n0F4J3PU063660@svn.freebsd.org> From: Warner Losh Date: Thu, 15 Jan 2009 04:19:03 +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: r187273 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:19:04 -0000 Author: imp Date: Thu Jan 15 04:19:03 2009 New Revision: 187273 URL: http://svn.freebsd.org/changeset/base/187273 Log: Add KERNFAST define. When defined, it skips all the config, depends and clean steps. KERNFAST was selected to complement KERNCONF which is typically used in these scenarios (especially with cross building). Reviewed by: arch@ Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jan 15 03:48:49 2009 (r187272) +++ head/Makefile.inc1 Thu Jan 15 04:19:03 2009 (r187273) @@ -5,6 +5,7 @@ # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir # -DNO_CLEAN do not clean at all # -DNO_SHARE do not go into share subdir +# -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELCONFIG # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel @@ -697,6 +698,11 @@ distrib-dirs distribution: # be set to cross-build, we have to make sure TARGET is set # properly. +.if defined(KERNFAST) +NO_KERNELCLEAN= t +NO_KERNELCONFIG= t +NO_KERNELDEPEND= t +.endif .if !defined(KERNCONF) && defined(KERNEL) KERNCONF= ${KERNEL} KERNWARN= From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:25:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33A56106564A; Thu, 15 Jan 2009 04:25:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2076D8FC12; Thu, 15 Jan 2009 04:25:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4PN8u063889; Thu, 15 Jan 2009 04:25:23 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4PMAD063862; Thu, 15 Jan 2009 04:25:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901150425.n0F4PMAD063862@svn.freebsd.org> From: Sam Leffler Date: Thu, 15 Jan 2009 04:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187274 - in vendor/wpa_supplicant/dist: . doc/docbook wpa_gui wpa_gui-qt4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:25:23 -0000 Author: sam Date: Thu Jan 15 04:25:21 2009 New Revision: 187274 URL: http://svn.freebsd.org/changeset/base/187274 Log: vendor import of 0.5.11 Modified: vendor/wpa_supplicant/dist/ChangeLog vendor/wpa_supplicant/dist/Makefile vendor/wpa_supplicant/dist/base64.c vendor/wpa_supplicant/dist/common.c vendor/wpa_supplicant/dist/ctrl_iface.c vendor/wpa_supplicant/dist/ctrl_iface_dbus.c vendor/wpa_supplicant/dist/ctrl_iface_unix.c vendor/wpa_supplicant/dist/dbus_dict_helpers.c vendor/wpa_supplicant/dist/defconfig vendor/wpa_supplicant/dist/doc/docbook/wpa_background.8 vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.8 vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.sgml vendor/wpa_supplicant/dist/doc/docbook/wpa_passphrase.8 vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.8 vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.5 vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.sgml vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.sgml vendor/wpa_supplicant/dist/driver_hostap.h vendor/wpa_supplicant/dist/driver_ndis.c vendor/wpa_supplicant/dist/eap.c vendor/wpa_supplicant/dist/eap_aka.c vendor/wpa_supplicant/dist/eap_gpsk.c vendor/wpa_supplicant/dist/eap_gpsk_common.c vendor/wpa_supplicant/dist/eap_ttls.c vendor/wpa_supplicant/dist/eloop.c vendor/wpa_supplicant/dist/eloop.h vendor/wpa_supplicant/dist/eloop_none.c vendor/wpa_supplicant/dist/eloop_win.c vendor/wpa_supplicant/dist/main.c vendor/wpa_supplicant/dist/mlme.c vendor/wpa_supplicant/dist/os_unix.c vendor/wpa_supplicant/dist/preauth_test.c vendor/wpa_supplicant/dist/radius.c vendor/wpa_supplicant/dist/sha1.c vendor/wpa_supplicant/dist/tls_openssl.c vendor/wpa_supplicant/dist/version.h vendor/wpa_supplicant/dist/wpa.c vendor/wpa_supplicant/dist/wpa.h vendor/wpa_supplicant/dist/wpa_cli.c vendor/wpa_supplicant/dist/wpa_gui-qt4/networkconfig.cpp vendor/wpa_supplicant/dist/wpa_gui-qt4/scanresults.cpp vendor/wpa_supplicant/dist/wpa_gui-qt4/wpagui.cpp vendor/wpa_supplicant/dist/wpa_gui/networkconfig.ui.h vendor/wpa_supplicant/dist/wpa_gui/userdatarequest.ui.h vendor/wpa_supplicant/dist/wpa_gui/wpagui.ui.h vendor/wpa_supplicant/dist/wpa_i.h vendor/wpa_supplicant/dist/wpa_supplicant.c vendor/wpa_supplicant/dist/wpa_supplicant_i.h Modified: vendor/wpa_supplicant/dist/ChangeLog ============================================================================== --- vendor/wpa_supplicant/dist/ChangeLog Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/ChangeLog Thu Jan 15 04:25:21 2009 (r187274) @@ -1,5 +1,31 @@ ChangeLog for wpa_supplicant +2008-11-28 - v0.5.11 + * fixed race condition between disassociation event and group key + handshake to avoid getting stuck in incorrect state [Bug 261] + * updated D-Bus usage to avoid deprecated functions + * silence SIOCSIWAUTH ioctl failure message (these can be ignored in + most cases and are now only shown in debug output) + * increase timeout for IBSS connection + * driver_wext: do not overwrite BSS frequency if channel was already + received + * driver_wext: set interface down for mode switches, if needed (e.g., + for mac80211) + * driver_wext: fixed re-initialization of a removed and re-inserted + interface (e.g., USB dongle or on resume if driver was unloaded for + suspend) + * improve per-SSID scanning for drivers that report background scan + results frequently + * fixed scanning behavior after a failed initial association + * driver_wext: fixed processing of invalid event messages from kernel + not to crash wpa_supplicant (this could happen when using 64-bit + kernel with 32-bit userspace) + * fixed EAP-AKA to use RES Length field in AT_RES as length in bits, + not bytes + * fixed canceling of PMKSA caching when using drivers that generate + RSN IE and refuse to drop PMKIDs that wpa_supplicant does not know + about + 2008-02-19 - v0.5.10 * added support for Makefile builds to include debug-log-to-a-file functionality (CONFIG_DEBUG_FILE=y and -f on command line) Modified: vendor/wpa_supplicant/dist/Makefile ============================================================================== --- vendor/wpa_supplicant/dist/Makefile Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/Makefile Thu Jan 15 04:25:21 2009 (r187274) @@ -149,7 +149,10 @@ endif ifdef CONFIG_DRIVER_NDIS CFLAGS += -DCONFIG_DRIVER_NDIS -OBJS_d += driver_ndis.o driver_ndis_.o +OBJS_d += driver_ndis.o +ifdef CONFIG_NDIS_EVENTS_INTEGRATED +OBJS_d += driver_ndis_.o +endif ifndef CONFIG_L2_PACKET CONFIG_L2_PACKET=pcap endif @@ -745,10 +748,6 @@ ifdef CONFIG_DEBUG_FILE CFLAGS += -DCONFIG_DEBUG_FILE endif -ifdef CONFIG_DEBUG_SYSLOG -CFLAGS += -DCONFIG_DEBUG_SYSLOG -endif - OBJS += wpa_supplicant.o events.o OBJS_t := $(OBJS) eapol_test.o radius.o radius_client.o OBJS_t2 := $(OBJS) preauth_test.o Modified: vendor/wpa_supplicant/dist/base64.c ============================================================================== --- vendor/wpa_supplicant/dist/base64.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/base64.c Thu Jan 15 04:25:21 2009 (r187274) @@ -115,7 +115,7 @@ unsigned char * base64_decode(const unsi count++; } - if (count % 4) + if (count == 0 || count % 4) return NULL; olen = count / 4 * 3; Modified: vendor/wpa_supplicant/dist/common.c ============================================================================== --- vendor/wpa_supplicant/dist/common.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/common.c Thu Jan 15 04:25:21 2009 (r187274) @@ -16,10 +16,6 @@ #include "common.h" -#ifdef CONFIG_DEBUG_SYSLOG -#include -#endif /* CONFIG_DEBUG_SYSLOG */ - #ifdef CONFIG_DEBUG_FILE static FILE *out_file = NULL; @@ -27,7 +23,6 @@ static FILE *out_file = NULL; int wpa_debug_level = MSG_INFO; int wpa_debug_show_keys = 0; int wpa_debug_timestamp = 0; -int wpa_debug_syslog = 0; static int hex2num(char c) @@ -166,40 +161,6 @@ void wpa_debug_print_timestamp(void) printf("%ld.%06u: ", (long) tv.sec, (unsigned int) tv.usec); } -void wpa_debug_open_syslog(void) -{ -#ifdef CONFIG_DEBUG_SYSLOG - openlog("wpa_supplicant", LOG_PID | LOG_NDELAY, LOG_DAEMON); - wpa_debug_syslog++; -#endif -} - -void wpa_debug_close_syslog(void) -{ -#ifdef CONFIG_DEBUG_SYSLOG - if (wpa_debug_syslog) - closelog(); -#endif -} - -#ifdef CONFIG_DEBUG_SYSLOG -static int syslog_priority(int level) -{ - switch (level) { - case MSG_MSGDUMP: - case MSG_DEBUG: - return LOG_DEBUG; - case MSG_INFO: - return LOG_NOTICE; - case MSG_WARNING: - return LOG_WARNING; - case MSG_ERROR: - return LOG_ERR; - } - return LOG_INFO; -} -#endif /* CONFIG_DEBUG_SYSLOG */ - /** * wpa_printf - conditional printf @@ -218,11 +179,6 @@ void wpa_printf(int level, char *fmt, .. va_start(ap, fmt); if (level >= wpa_debug_level) { -#ifdef CONFIG_DEBUG_SYSLOG - if (wpa_debug_syslog) { - vsyslog(syslog_priority(level), fmt, ap); - } else { -#endif /* CONFIG_DEBUG_SYSLOG */ wpa_debug_print_timestamp(); #ifdef CONFIG_DEBUG_FILE if (out_file) { @@ -235,9 +191,6 @@ void wpa_printf(int level, char *fmt, .. #ifdef CONFIG_DEBUG_FILE } #endif /* CONFIG_DEBUG_FILE */ -#ifdef CONFIG_DEBUG_SYSLOG - } -#endif /* CONFIG_DEBUG_SYSLOG */ } va_end(ap); } Modified: vendor/wpa_supplicant/dist/ctrl_iface.c ============================================================================== --- vendor/wpa_supplicant/dist/ctrl_iface.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/ctrl_iface.c Thu Jan 15 04:25:21 2009 (r187274) @@ -76,6 +76,7 @@ static int wpa_supplicant_ctrl_iface_set } +#ifdef IEEE8021X_EAPOL static int wpa_supplicant_ctrl_iface_preauth(struct wpa_supplicant *wpa_s, char *addr) { @@ -94,6 +95,7 @@ static int wpa_supplicant_ctrl_iface_pre return 0; } +#endif /* IEEE8021X_EAPOL */ #ifdef CONFIG_PEERKEY @@ -1126,9 +1128,11 @@ char * wpa_supplicant_ctrl_iface_process wpa_s->reassociate = 1; wpa_supplicant_req_scan(wpa_s, 0, 0); } +#ifdef IEEE8021X_EAPOL } else if (os_strncmp(buf, "PREAUTH ", 8) == 0) { if (wpa_supplicant_ctrl_iface_preauth(wpa_s, buf + 8)) reply_len = -1; +#endif /* IEEE8021X_EAPOL */ #ifdef CONFIG_PEERKEY } else if (os_strncmp(buf, "STKSTART ", 9) == 0) { if (wpa_supplicant_ctrl_iface_stkstart(wpa_s, buf + 9)) Modified: vendor/wpa_supplicant/dist/ctrl_iface_dbus.c ============================================================================== --- vendor/wpa_supplicant/dist/ctrl_iface_dbus.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/ctrl_iface_dbus.c Thu Jan 15 04:25:21 2009 (r187274) @@ -30,10 +30,10 @@ #include "wpa_ctrl.h" #include "eap.h" -#define DBUS_VERSION (DBUS_VERSION_MAJOR << 8 | DBUS_VERSION_MINOR) +#define _DBUS_VERSION (DBUS_VERSION_MAJOR << 8 | DBUS_VERSION_MINOR) #define DBUS_VER(major, minor) ((major) << 8 | (minor)) -#if DBUS_VERSION < DBUS_VER(1,1) +#if _DBUS_VERSION < DBUS_VER(1,1) #define dbus_watch_get_unix_fd dbus_watch_get_fd #endif Modified: vendor/wpa_supplicant/dist/ctrl_iface_unix.c ============================================================================== --- vendor/wpa_supplicant/dist/ctrl_iface_unix.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/ctrl_iface_unix.c Thu Jan 15 04:25:21 2009 (r187274) @@ -305,7 +305,7 @@ wpa_supplicant_ctrl_iface_init(struct wp /* Group name not found - try to parse this as gid */ gid = strtol(gid_str, &endp, 10); if (*gid_str == '\0' || *endp != '\0') { - wpa_printf(MSG_DEBUG, "CTRL: Invalid group " + wpa_printf(MSG_ERROR, "CTRL: Invalid group " "'%s'", gid_str); goto fail; } Modified: vendor/wpa_supplicant/dist/dbus_dict_helpers.c ============================================================================== --- vendor/wpa_supplicant/dist/dbus_dict_helpers.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/dbus_dict_helpers.c Thu Jan 15 04:25:21 2009 (r187274) @@ -629,36 +629,56 @@ dbus_bool_t wpa_dbus_dict_open_read(DBus } +#define BYTE_ARRAY_CHUNK_SIZE 34 +#define BYTE_ARRAY_ITEM_SIZE (sizeof (char)) + static dbus_bool_t _wpa_dbus_dict_entry_get_byte_array( - DBusMessageIter *iter, int array_len, int array_type, + DBusMessageIter *iter, int array_type, struct wpa_dbus_dict_entry *entry) { - dbus_uint32_t i = 0; + dbus_uint32_t count = 0; dbus_bool_t success = FALSE; - char byte; + char *buffer; - /* Zero-length arrays are valid. */ - if (array_len == 0) { - entry->bytearray_value = NULL; - entry->array_type = DBUS_TYPE_BYTE; - success = TRUE; - goto done; - } + entry->bytearray_value = NULL; + entry->array_type = DBUS_TYPE_BYTE; - entry->bytearray_value = wpa_zalloc(array_len * sizeof(char)); - if (!entry->bytearray_value) { + buffer = wpa_zalloc(BYTE_ARRAY_ITEM_SIZE * BYTE_ARRAY_CHUNK_SIZE); + if (!buffer) { perror("_wpa_dbus_dict_entry_get_byte_array[dbus]: out of " "memory"); goto done; } - entry->array_type = DBUS_TYPE_BYTE; - entry->array_len = array_len; + entry->bytearray_value = buffer; + entry->array_len = 0; while (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_BYTE) { + char byte; + + if ((count % BYTE_ARRAY_CHUNK_SIZE) == 0 && count != 0) { + buffer = realloc(buffer, BYTE_ARRAY_ITEM_SIZE * + (count + BYTE_ARRAY_CHUNK_SIZE)); + if (buffer == NULL) { + perror("_wpa_dbus_dict_entry_get_byte_array[" + "dbus] out of memory trying to " + "retrieve the string array"); + goto done; + } + } + entry->bytearray_value = buffer; + dbus_message_iter_get_basic(iter, &byte); - entry->bytearray_value[i++] = byte; + entry->bytearray_value[count] = byte; + entry->array_len = ++count; dbus_message_iter_next(iter); } + + /* Zero-length arrays are valid. */ + if (entry->array_len == 0) { + free(entry->bytearray_value); + entry->bytearray_value = NULL; + } + success = TRUE; done: @@ -666,8 +686,11 @@ done: } +#define STR_ARRAY_CHUNK_SIZE 8 +#define STR_ARRAY_ITEM_SIZE (sizeof (char *)) + static dbus_bool_t _wpa_dbus_dict_entry_get_string_array( - DBusMessageIter *iter, int array_len, int array_type, + DBusMessageIter *iter, int array_type, struct wpa_dbus_dict_entry *entry) { dbus_uint32_t count = 0; @@ -677,13 +700,7 @@ static dbus_bool_t _wpa_dbus_dict_entry_ entry->strarray_value = NULL; entry->array_type = DBUS_TYPE_STRING; - /* Zero-length arrays are valid. */ - if (array_len == 0) { - success = TRUE; - goto done; - } - - buffer = wpa_zalloc(sizeof (char *) * 8); + buffer = wpa_zalloc(STR_ARRAY_ITEM_SIZE * STR_ARRAY_CHUNK_SIZE); if (buffer == NULL) { perror("_wpa_dbus_dict_entry_get_string_array[dbus] out of " "memory trying to retrieve a string array"); @@ -696,18 +713,15 @@ static dbus_bool_t _wpa_dbus_dict_entry_ const char *value; char *str; - if ((count % 8) == 0 && count != 0) { - char **tmp; - tmp = realloc(buffer, sizeof(char *) * (count + 8)); - if (tmp == NULL) { + if ((count % STR_ARRAY_CHUNK_SIZE) == 0 && count != 0) { + buffer = realloc(buffer, STR_ARRAY_ITEM_SIZE * + (count + STR_ARRAY_CHUNK_SIZE)); + if (buffer == NULL) { perror("_wpa_dbus_dict_entry_get_string_array[" "dbus] out of memory trying to " "retrieve the string array"); - free(buffer); - buffer = NULL; goto done; } - buffer = tmp; } entry->strarray_value = buffer; @@ -723,6 +737,13 @@ static dbus_bool_t _wpa_dbus_dict_entry_ entry->array_len = ++count; dbus_message_iter_next(iter); } + + /* Zero-length arrays are valid. */ + if (entry->array_len == 0) { + free(entry->strarray_value); + entry->strarray_value = NULL; + } + success = TRUE; done: @@ -734,7 +755,6 @@ static dbus_bool_t _wpa_dbus_dict_entry_ DBusMessageIter *iter_dict_val, struct wpa_dbus_dict_entry *entry) { int array_type = dbus_message_iter_get_element_type(iter_dict_val); - int array_len; dbus_bool_t success = FALSE; DBusMessageIter iter_array; @@ -743,20 +763,14 @@ static dbus_bool_t _wpa_dbus_dict_entry_ dbus_message_iter_recurse(iter_dict_val, &iter_array); - array_len = dbus_message_iter_get_array_len(&iter_array); - if (array_len < 0) - return FALSE; - switch (array_type) { case DBUS_TYPE_BYTE: success = _wpa_dbus_dict_entry_get_byte_array(&iter_array, - array_len, array_type, entry); break; case DBUS_TYPE_STRING: success = _wpa_dbus_dict_entry_get_string_array(&iter_array, - array_len, array_type, entry); break; @@ -946,9 +960,17 @@ void wpa_dbus_dict_entry_clear(struct wp break; case DBUS_TYPE_ARRAY: switch (entry->array_type) { - case DBUS_TYPE_BYTE: - free(entry->bytearray_value); - break; + case DBUS_TYPE_BYTE: { + free(entry->bytearray_value); + break; + } + case DBUS_TYPE_STRING: { + unsigned int i; + for (i = 0; i < entry->array_len; i++) + free(entry->strarray_value[i]); + free(entry->strarray_value); + break; + } } break; } Modified: vendor/wpa_supplicant/dist/defconfig ============================================================================== --- vendor/wpa_supplicant/dist/defconfig Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/defconfig Thu Jan 15 04:25:21 2009 (r187274) @@ -321,6 +321,3 @@ CONFIG_PEERKEY=y # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y - -# Add support for logging via syslog -#CONFIG_DEBUG_SYSLOG=y Modified: vendor/wpa_supplicant/dist/doc/docbook/wpa_background.8 ============================================================================== --- vendor/wpa_supplicant/dist/doc/docbook/wpa_background.8 Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/doc/docbook/wpa_background.8 Thu Jan 15 04:25:21 2009 (r187274) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_BACKGROUND" "8" "19 February 2008" "" "" +.TH "WPA_BACKGROUND" "8" "28 November 2008" "" "" .SH NAME wpa_background \- Background information on Wi-Fi Protected Access and IEEE 802.11i Modified: vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.8 ============================================================================== --- vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.8 Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.8 Thu Jan 15 04:25:21 2009 (r187274) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_CLI" "8" "19 February 2008" "" "" +.TH "WPA_CLI" "8" "28 November 2008" "" "" .SH NAME wpa_cli \- WPA command line client @@ -57,17 +57,18 @@ current network. is description o case of OTP request, it includes the challenge from the authentication server. .PP -The reply to these requests can be given with 'identity', -'password', and 'otp' commands. needs to be copied from the -the matching request. 'password' and 'otp' commands can be used -regardless of whether the request was for PASSWORD or OTP. The -main difference between these two commands is that values given -with 'password' are remembered as long as wpa_supplicant is -running whereas values given with 'otp' are used only once and -then forgotten, i.e., wpa_supplicant will ask frontend for a new -value for every use. This can be used to implement -one-time-password lists and generic token card -based -authentication. +The reply to these requests can be given with +\fBidentity\fR, \fBpassword\fR, and +\fBotp\fR commands. needs to be copied from +the matching request. \fBpassword\fR and +\fBotp\fR commands can be used regardless of whether +the request was for PASSWORD or OTP. The main difference between these +two commands is that values given with \fBpassword\fR are +remembered as long as wpa_supplicant is running whereas values given +with \fBotp\fR are used only once and then forgotten, +i.e., wpa_supplicant will ask frontend for a new value for every use. +This can be used to implement one-time-password lists and generic token +card -based authentication. .PP Example request for password and a matching reply: .sp Modified: vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.sgml ============================================================================== --- vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.sgml Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/doc/docbook/wpa_cli.sgml Thu Jan 15 04:25:21 2009 (r187274) @@ -72,17 +72,18 @@ case of OTP request, it includes the challenge from the authentication server. - The reply to these requests can be given with 'identity', - 'password', and 'otp' commands. <id> needs to be copied from the - the matching request. 'password' and 'otp' commands can be used - regardless of whether the request was for PASSWORD or OTP. The - main difference between these two commands is that values given - with 'password' are remembered as long as wpa_supplicant is - running whereas values given with 'otp' are used only once and - then forgotten, i.e., wpa_supplicant will ask frontend for a new - value for every use. This can be used to implement - one-time-password lists and generic token card -based - authentication. + The reply to these requests can be given with + identity, password, and + otp commands. <id> needs to be copied from + the matching request. password and + otp commands can be used regardless of whether + the request was for PASSWORD or OTP. The main difference between these + two commands is that values given with password are + remembered as long as wpa_supplicant is running whereas values given + with otp are used only once and then forgotten, + i.e., wpa_supplicant will ask frontend for a new value for every use. + This can be used to implement one-time-password lists and generic token + card -based authentication. Example request for password and a matching reply: Modified: vendor/wpa_supplicant/dist/doc/docbook/wpa_passphrase.8 ============================================================================== --- vendor/wpa_supplicant/dist/doc/docbook/wpa_passphrase.8 Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/doc/docbook/wpa_passphrase.8 Thu Jan 15 04:25:21 2009 (r187274) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_PASSPHRASE" "8" "19 February 2008" "" "" +.TH "WPA_PASSPHRASE" "8" "28 November 2008" "" "" .SH NAME wpa_passphrase \- Generate a WPA PSK from an ASCII passphrase for a SSID Modified: vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.8 ============================================================================== --- vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.8 Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.8 Thu Jan 15 04:25:21 2009 (r187274) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_SUPPLICANT" "8" "19 February 2008" "" "" +.TH "WPA_SUPPLICANT" "8" "28 November 2008" "" "" .SH NAME wpa_supplicant \- Wi-Fi Protected Access client and IEEE 802.1X supplicant @@ -214,7 +214,11 @@ PMKSA caching .RE .SH "AVAILABLE DRIVERS" .PP -The available drivers to specify with the -D option are: +A summary of available driver backends is below. Support for each +of the driver backends is chosen at wpa_supplicant compile time. For a +list of supported driver backends that may be used with the -D option on +your system, refer to the help output of wpa_supplicant +(\fBwpa_supplicant -h\fR). .TP \fBhostap\fR (default) Host AP driver (Intersil Prism2/2.5/3). @@ -250,33 +254,47 @@ BSD 802.11 support (Atheros, etc.). \fBndis\fR Windows NDIS driver. .SH "COMMAND LINE OPTIONS" +.PP +Most command line options have global scope. Some are given per +interface, and are only valid if at least one \fB-i\fR option +is specified, otherwise they're ignored. Option groups for different +interfaces must be separated by \fB-N\fR option. +.TP +\fB-b br_ifname\fR +Optional bridge interface name. (Per interface) .TP \fB-B\fR Run daemon in the background. .TP \fB-i ifname\fR -Interface to listen on. +Interface to listen on. Multiple instances of this option can +be present, one per interface, separated by \fB-N\fR +option (see below). .TP \fB-c filename\fR -Path to configuration file. +Path to configuration file. (Per interface) .TP \fB-P PID_file\fR Path to PID file. .TP \fB-C ctrl_interface\fR -Path to ctrl_interface socket (only used if -c is not). +Path to ctrl_interface socket (Per interface. Only used if +\fB-c\fR is not). .TP \fB-g global ctrl_interface\fR -Path to global ctrl_interface socket. +Path to global ctrl_interface socket. If specified, interface +definitions may be omitted. .TP \fB-D driver\fR -Driver to use. See the available options below. +Driver to use. (Per interface, see the available options +below.) .TP \fB-f output file\fR Log output to specified file instead of stdout. .TP \fB-d\fR -Increase debugging verbosity (-dd even more). +Increase debugging verbosity (\fB-dd\fR even +more). .TP \fB-K\fR Include keys (passwords, etc.) in debug output. @@ -296,7 +314,12 @@ Help. Show a usage message. Show license (GPL and BSD). .TP \fB-q\fR -Decrease debugging verbosity (-qq even less). +Decrease debugging verbosity (\fB-qq\fR even +less). +.TP +\fB-u\fR +Enabled DBus control interface. If enabled, interface +definitions may be omitted. .TP \fB-v\fR Show version. @@ -367,9 +390,9 @@ with other versions) .TP \fBHost AP driver for Prism2/2.5/3 (development snapshot/v0.2.x)\fR (http://hostap.epitest.fi/) Driver needs to be set in -Managed mode ('iwconfig wlan0 mode managed'). Please note -that station firmware version needs to be 1.7.0 or newer to -work in WPA mode. +Managed mode (\fBiwconfig wlan0 mode managed\fR). +Please note that station firmware version needs to be 1.7.0 or +newer to work in WPA mode. .TP \fBLinuxant DriverLoader\fR (http://www.linuxant.com/driverloader/) @@ -506,8 +529,8 @@ can be used to enable WPA support: Add MODE="Managed" and WPA="y" to the network scheme in \fI/etc/pcmcia/wireless.opts\fR\&. .PP -Add the following block to the end of 'start' action handler -in \fI/etc/pcmcia/wireless\fR: +Add the following block to the end of \fBstart\fR +action handler in \fI/etc/pcmcia/wireless\fR: .sp .RS @@ -519,8 +542,8 @@ fi .fi .RE .PP -Add the following block to the end of 'stop' action handler -(may need to be separated from other actions) in +Add the following block to the end of \fBstop\fR +action handler (may need to be separated from other actions) in \fI/etc/pcmcia/wireless\fR: .sp .RS Modified: vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.5 ============================================================================== --- vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.5 Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.5 Thu Jan 15 04:25:21 2009 (r187274) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_SUPPLICANT.CONF" "5" "19 February 2008" "" "" +.TH "WPA_SUPPLICANT.CONF" "5" "28 November 2008" "" "" .SH NAME wpa_supplicant.conf \- configuration file for wpa_supplicant @@ -24,7 +24,7 @@ run in the background. Changes to configuration file can be reloaded be sending SIGHUP signal to \fBwpa_supplicant\fR ('killall -HUP wpa_supplicant'). Similarly, reloading can be triggered with -the 'wpa_cli reconfigure' command. +the \fBwpa_cli reconfigure\fR command. .PP Configuration file can include one or more network blocks, e.g., one for each used SSID. wpa_supplicant will automatically @@ -179,7 +179,7 @@ network={ .TP 3 6. Authentication for wired Ethernet. This can be used with -'wired' interface (-Dwired on command line). +\fBwired\fR interface (-Dwired on command line). .sp .RS Modified: vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.sgml ============================================================================== --- vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.sgml Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.conf.sgml Thu Jan 15 04:25:21 2009 (r187274) @@ -26,7 +26,7 @@ Changes to configuration file can be reloaded be sending SIGHUP signal to wpa_supplicant ('killall -HUP wpa_supplicant'). Similarly, reloading can be triggered with - the 'wpa_cli reconfigure' command. + the wpa_cli reconfigure command. Configuration file can include one or more network blocks, e.g., one for each used SSID. wpa_supplicant will automatically @@ -179,7 +179,7 @@ network={ Authentication for wired Ethernet. This can be used with - 'wired' interface (-Dwired on command line). + wired interface (-Dwired on command line).
ctrl_interface=/var/run/wpa_supplicant Modified: vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.sgml ============================================================================== --- vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.sgml Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/doc/docbook/wpa_supplicant.sgml Thu Jan 15 04:25:21 2009 (r187274) @@ -241,7 +241,11 @@ Available Drivers - The available drivers to specify with the -D option are: + A summary of available driver backends is below. Support for each + of the driver backends is chosen at wpa_supplicant compile time. For a + list of supported driver backends that may be used with the -D option on + your system, refer to the help output of wpa_supplicant + (wpa_supplicant -h). @@ -326,8 +330,19 @@ Command Line Options + Most command line options have global scope. Some are given per + interface, and are only valid if at least one option + is specified, otherwise they're ignored. Option groups for different + interfaces must be separated by option. + -b br_ifname + + Optional bridge interface name. (Per interface) + + + + -B Run daemon in the background. @@ -337,14 +352,16 @@ -i ifname - Interface to listen on. + Interface to listen on. Multiple instances of this option can + be present, one per interface, separated by + option (see below). -c filename - Path to configuration file. + Path to configuration file. (Per interface) @@ -358,21 +375,24 @@ -C ctrl_interface - Path to ctrl_interface socket (only used if -c is not). + Path to ctrl_interface socket (Per interface. Only used if + is not). -g global ctrl_interface - Path to global ctrl_interface socket. + Path to global ctrl_interface socket. If specified, interface + definitions may be omitted. -D driver - Driver to use. See the available options below. + Driver to use. (Per interface, see the available options + below.) @@ -386,7 +406,8 @@ -d - Increase debugging verbosity (-dd even more). + Increase debugging verbosity ( even + more). @@ -430,9 +451,19 @@ -q - Decrease debugging verbosity (-qq even less). + Decrease debugging verbosity ( even + less). + + + -u + + Enabled DBus control interface. If enabled, interface + definitions may be omitted. + + + -v @@ -523,9 +554,9 @@ wpa_supplicant \ snapshot/v0.2.x) (http://hostap.epitest.fi/) Driver needs to be set in - Managed mode ('iwconfig wlan0 mode managed'). Please note - that station firmware version needs to be 1.7.0 or newer to - work in WPA mode. + Managed mode (iwconfig wlan0 mode managed). + Please note that station firmware version needs to be 1.7.0 or + newer to work in WPA mode. @@ -729,8 +760,8 @@ wpa_supplicant -iwlan0 -c/etc/wpa_suppli Add MODE="Managed" and WPA="y" to the network scheme in /etc/pcmcia/wireless.opts. - Add the following block to the end of 'start' action handler - in /etc/pcmcia/wireless: + Add the following block to the end of start + action handler in /etc/pcmcia/wireless:
if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then @@ -739,8 +770,8 @@ fi
- Add the following block to the end of 'stop' action handler - (may need to be separated from other actions) in + Add the following block to the end of stop + action handler (may need to be separated from other actions) in /etc/pcmcia/wireless:
Modified: vendor/wpa_supplicant/dist/driver_hostap.h ============================================================================== --- vendor/wpa_supplicant/dist/driver_hostap.h Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/driver_hostap.h Thu Jan 15 04:25:21 2009 (r187274) @@ -84,9 +84,9 @@ enum { #define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024 #define PRISM2_HOSTAPD_RID_HDR_LEN \ -((int) (&((struct prism2_hostapd_param *) 0)->u.rid.data)) +((size_t) (&((struct prism2_hostapd_param *) 0)->u.rid.data)) #define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \ -((int) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data)) +((size_t) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data)) /* Maximum length for algorithm names (-1 for nul termination) used in ioctl() */ Modified: vendor/wpa_supplicant/dist/driver_ndis.c ============================================================================== --- vendor/wpa_supplicant/dist/driver_ndis.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/driver_ndis.c Thu Jan 15 04:25:21 2009 (r187274) @@ -42,7 +42,9 @@ int close(int fd); #include "driver_ndis.h" int wpa_driver_register_event_cb(struct wpa_driver_ndis_data *drv); +#ifdef CONFIG_NDIS_EVENTS_INTEGRATED void wpa_driver_ndis_event_pipe_cb(void *eloop_data, void *user_data); +#endif /* CONFIG_NDIS_EVENTS_INTEGRATED */ static void wpa_driver_ndis_deinit(void *priv); static void wpa_driver_ndis_poll(void *drv); Modified: vendor/wpa_supplicant/dist/eap.c ============================================================================== --- vendor/wpa_supplicant/dist/eap.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/eap.c Thu Jan 15 04:25:21 2009 (r187274) @@ -892,7 +892,7 @@ static int eap_sm_imsi_identity(struct e #endif /* PCSC_FUNCS */ -static int eap_sm_get_scard_identity(struct eap_sm *sm, struct wpa_ssid *ssid) +static int eap_sm_set_scard_pin(struct eap_sm *sm, struct wpa_ssid *ssid) { #ifdef PCSC_FUNCS if (scard_set_pin(sm->scard_ctx, ssid->pin)) { @@ -907,6 +907,17 @@ static int eap_sm_get_scard_identity(str eap_sm_request_pin(sm); return -1; } + return 0; +#else /* PCSC_FUNCS */ + return -1; +#endif /* PCSC_FUNCS */ +} + +static int eap_sm_get_scard_identity(struct eap_sm *sm, struct wpa_ssid *ssid) +{ +#ifdef PCSC_FUNCS + if (eap_sm_set_scard_pin(sm, ssid)) + return -1; return eap_sm_imsi_identity(sm, ssid); #else /* PCSC_FUNCS */ @@ -973,6 +984,9 @@ u8 * eap_sm_buildIdentity(struct eap_sm eap_sm_request_identity(sm); return NULL; } + } else if (config->pcsc) { + if (eap_sm_set_scard_pin(sm, config) < 0) + return NULL; } *len = sizeof(struct eap_hdr) + 1 + identity_len; Modified: vendor/wpa_supplicant/dist/eap_aka.c ============================================================================== --- vendor/wpa_supplicant/dist/eap_aka.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/eap_aka.c Thu Jan 15 04:25:21 2009 (r187274) @@ -292,7 +292,7 @@ static u8 * eap_aka_response_challenge(s msg = eap_sim_msg_init(EAP_CODE_RESPONSE, req->identifier, EAP_TYPE_AKA, EAP_AKA_SUBTYPE_CHALLENGE); wpa_printf(MSG_DEBUG, " AT_RES"); - eap_sim_msg_add(msg, EAP_SIM_AT_RES, data->res_len, + eap_sim_msg_add(msg, EAP_SIM_AT_RES, data->res_len * 8, data->res, data->res_len); wpa_printf(MSG_DEBUG, " AT_MAC"); eap_sim_msg_add_mac(msg, EAP_SIM_AT_MAC); Modified: vendor/wpa_supplicant/dist/eap_gpsk.c ============================================================================== --- vendor/wpa_supplicant/dist/eap_gpsk.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/eap_gpsk.c Thu Jan 15 04:25:21 2009 (r187274) @@ -240,8 +240,8 @@ const u8 * eap_gpsk_process_csuite_list( return NULL; } if (*list_len == 0 || (*list_len % sizeof(struct eap_gpsk_csuite))) { - wpa_printf(MSG_DEBUG, "EAP-GPSK: Invalid CSuite_List len %d", - *list_len); + wpa_printf(MSG_DEBUG, "EAP-GPSK: Invalid CSuite_List len %lu", + (unsigned long) *list_len); return NULL; } *list = pos; @@ -460,6 +460,7 @@ const u8 * eap_gpsk_validate_id_server(s data->id_server, data->id_server_len); wpa_hexdump_ascii(MSG_DEBUG, "EAP-GPSK: ID_Server in GPSK-3", pos, len); + return NULL; } pos += len; @@ -537,7 +538,9 @@ const u8 * eap_gpsk_validate_gpsk_3_mic( miclen = eap_gpsk_mic_len(data->vendor, data->specifier); if (end - pos < (int) miclen) { wpa_printf(MSG_DEBUG, "EAP-GPSK: Message too short for MIC " - "(left=%d miclen=%d)", end - pos, miclen); + "(left=%lu miclen=%lu)", + (unsigned long) (end - pos), + (unsigned long) miclen); return NULL; } if (eap_gpsk_compute_mic(data->sk, data->sk_len, data->vendor, @@ -589,8 +592,9 @@ static u8 * eap_gpsk_process_gpsk_3(stru return NULL; } if (pos != end) { - wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %d bytes of extra " - "data in the end of GPSK-2", end - pos); + wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %lu bytes of extra " + "data in the end of GPSK-2", + (unsigned long) (end - pos)); } req = (const struct eap_hdr *) reqData; Modified: vendor/wpa_supplicant/dist/eap_gpsk_common.c ============================================================================== --- vendor/wpa_supplicant/dist/eap_gpsk_common.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/eap_gpsk_common.c Thu Jan 15 04:25:21 2009 (r187274) @@ -376,8 +376,8 @@ static int eap_gpsk_compute_mic_aes(cons const u8 *data, size_t len, u8 *mic) { if (sk_len != 16) { - wpa_printf(MSG_DEBUG, "EAP-GPSK: Invalid SK length %d for " - "AES-CMAC MIC", sk_len); + wpa_printf(MSG_DEBUG, "EAP-GPSK: Invalid SK length %lu for " + "AES-CMAC MIC", (unsigned long) sk_len); return -1; } Modified: vendor/wpa_supplicant/dist/eap_ttls.c ============================================================================== --- vendor/wpa_supplicant/dist/eap_ttls.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/eap_ttls.c Thu Jan 15 04:25:21 2009 (r187274) @@ -673,7 +673,7 @@ static int eap_ttls_phase2_request_mscha /* MS-CHAP-Challenge */ challenge = eap_ttls_implicit_challenge( - sm, data, EAP_TTLS_MSCHAPV2_CHALLENGE_LEN * 2 + 1); + sm, data, EAP_TTLS_MSCHAPV2_CHALLENGE_LEN + 1); if (challenge == NULL) { os_free(buf); wpa_printf(MSG_ERROR, "EAP-TTLS/MSCHAPV2: Failed to derive " @@ -777,7 +777,8 @@ static int eap_ttls_phase2_request_mscha config->identity, config->identity_len); /* MS-CHAP-Challenge */ - challenge = eap_ttls_implicit_challenge(sm, data, EAP_TLS_KEY_LEN); + challenge = eap_ttls_implicit_challenge( + sm, data, EAP_TTLS_MSCHAP_CHALLENGE_LEN + 1); if (challenge == NULL) { os_free(buf); wpa_printf(MSG_ERROR, "EAP-TTLS/MSCHAP: Failed to derive " @@ -907,7 +908,8 @@ static int eap_ttls_phase2_request_chap( config->identity, config->identity_len); /* CHAP-Challenge */ - challenge = eap_ttls_implicit_challenge(sm, data, EAP_TLS_KEY_LEN); + challenge = eap_ttls_implicit_challenge( + sm, data, EAP_TTLS_CHAP_CHALLENGE_LEN + 1); if (challenge == NULL) { os_free(buf); wpa_printf(MSG_ERROR, "EAP-TTLS/CHAP: Failed to derive " Modified: vendor/wpa_supplicant/dist/eloop.c ============================================================================== --- vendor/wpa_supplicant/dist/eloop.c Thu Jan 15 04:19:03 2009 (r187273) +++ vendor/wpa_supplicant/dist/eloop.c Thu Jan 15 04:25:21 2009 (r187274) @@ -232,7 +232,10 @@ int eloop_register_timeout(unsigned int timeout = os_malloc(sizeof(*timeout)); if (timeout == NULL) return -1; - os_get_time(&timeout->time); + if (os_get_time(&timeout->time) < 0) { + os_free(timeout); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:26:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1921065680; Thu, 15 Jan 2009 04:26:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83A718FC13; Thu, 15 Jan 2009 04:26:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4Qdmj063954; Thu, 15 Jan 2009 04:26:39 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4QdPt063953; Thu, 15 Jan 2009 04:26:39 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901150426.n0F4QdPt063953@svn.freebsd.org> From: Sam Leffler Date: Thu, 15 Jan 2009 04:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187275 - vendor/wpa_supplicant/0.5.11 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:26:40 -0000 Author: sam Date: Thu Jan 15 04:26:39 2009 New Revision: 187275 URL: http://svn.freebsd.org/changeset/base/187275 Log: tag 0.5.11 release Added: vendor/wpa_supplicant/0.5.11/ - copied from r187274, vendor/wpa_supplicant/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:26:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AE5910656CF; Thu, 15 Jan 2009 04:26:46 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4A18FC1D; Thu, 15 Jan 2009 04:26:46 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4Qk5L063995; Thu, 15 Jan 2009 04:26:46 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4QkPW063993; Thu, 15 Jan 2009 04:26:46 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150426.n0F4QkPW063993@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187276 - stable/6/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:26:49 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:26:45 2009 New Revision: 187276 URL: http://svn.freebsd.org/changeset/base/187276 Log: MFC 176561 Implement from scratch a -l option for du(1), to match the same option of the GNU utility. The default behavior of our original `du' is to count hardlinked files only once for each invocation of the utility. With the new -l option they count towards the final size every time they are found. Modified: stable/6/usr.bin/du/ (props changed) stable/6/usr.bin/du/du.1 stable/6/usr.bin/du/du.c Modified: stable/6/usr.bin/du/du.1 ============================================================================== --- stable/6/usr.bin/du/du.1 Thu Jan 15 04:26:39 2009 (r187275) +++ stable/6/usr.bin/du/du.1 Thu Jan 15 04:26:45 2009 (r187276) @@ -32,7 +32,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd May 6, 2006 +.Dd February 25, 2008 .Dt DU 1 .Os .Sh NAME @@ -43,6 +43,7 @@ .Op Fl H | L | P .Op Fl a | s | d Ar depth .Op Fl c +.Op Fl l .Op Fl h | k | m .Op Fl n .Op Fl x @@ -94,6 +95,15 @@ directories deep. Display a grand total. .It Fl k Display block counts in 1024-byte (1-Kbyte) blocks. +.It Fl l +If a file has multiple hard links, count its size many times. +The default behavior of +.Nm +is to count files with multiple hard links only once. +When the +.Fl l +option is specified, the hard link checks are disabled, and these files +are counted (and displayed) as many times as they are found. .It Fl m Display block counts in 1048576-byte (1-Mbyte) blocks. .It Fl n @@ -116,11 +126,6 @@ or .Fl L options are specified, storage used by any symbolic links which are followed is not counted or displayed. -.Pp -Files having multiple hard links are counted (and displayed) a single -time per -.Nm -execution. .Sh ENVIRONMENT .Bl -tag -width BLOCKSIZE .It Ev BLOCKSIZE Modified: stable/6/usr.bin/du/du.c ============================================================================== --- stable/6/usr.bin/du/du.c Thu Jan 15 04:26:39 2009 (r187275) +++ stable/6/usr.bin/du/du.c Thu Jan 15 04:26:45 2009 (r187276) @@ -90,20 +90,22 @@ main(int argc, char *argv[]) int ftsoptions; int listall; int depth; - int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag, ch, notused, rval; + int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; + int hflag, lflag, ch, notused, rval; char **save; static char dot[] = "."; setlocale(LC_ALL, ""); - Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = 0; + Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = + lflag = 0; save = argv; ftsoptions = 0; depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "HI:LPasd:chkmnrx")) != -1) + while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -147,6 +149,9 @@ main(int argc, char *argv[]) hflag = 0; putenv("BLOCKSIZE=1024"); break; + case 'l': + lflag = 1; + break; case 'm': hflag = 0; putenv("BLOCKSIZE=1048576"); @@ -257,7 +262,8 @@ main(int argc, char *argv[]) if (ignorep(p)) break; - if (p->fts_statp->st_nlink > 1 && linkchk(p)) + if (lflag == 0 && + p->fts_statp->st_nlink > 1 && linkchk(p)) break; if (listall || p->fts_level == 0) { @@ -443,7 +449,8 @@ static void usage(void) { (void)fprintf(stderr, - "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n"); + "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] " + "[-l] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n"); exit(EX_USAGE); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:29:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74887106566B; Thu, 15 Jan 2009 04:29:02 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 621248FC29; Thu, 15 Jan 2009 04:29:02 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4T2WH064081; Thu, 15 Jan 2009 04:29:02 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4T2WQ064078; Thu, 15 Jan 2009 04:29:02 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901150429.n0F4T2WQ064078@svn.freebsd.org> From: David Schultz Date: Thu, 15 Jan 2009 04:29: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: r187277 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:29:02 -0000 Author: das Date: Thu Jan 15 04:29:02 2009 New Revision: 187277 URL: http://svn.freebsd.org/changeset/base/187277 Log: Convert the insidious macros that handle printf()'s buffering into slightly less evil inline functions, and move the buffering state into a struct. This will make it possible for helper routines to produce output for printf() directly, making it possible to untangle the code somewhat. In wprintf(), use the same buffering mechanism to reduce diffs to printf(). This has the side-effect of causing wprintf() to catch write errors that it previously ignored. Added: head/lib/libc/stdio/printfcommon.h (contents, props changed) Modified: head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c Added: head/lib/libc/stdio/printfcommon.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdio/printfcommon.h Thu Jan 15 04:29:02 2009 (r187277) @@ -0,0 +1,130 @@ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This file defines common routines used by both printf and wprintf. + * You must define CHAR to either char or wchar_t prior to including this. + */ + +#define NIOV 8 +struct io_state { + FILE *fp; + struct __suio uio; /* output information: summary */ + struct __siov iov[NIOV];/* ... and individual io vectors */ + struct __siov *iovp; /* pointer to next free slot in iov */ +}; + +static inline void +io_init(struct io_state *iop, FILE *fp) +{ + + iop->uio.uio_iov = iop->iovp = iop->iov; + iop->uio.uio_resid = 0; + iop->uio.uio_iovcnt = 0; + iop->fp = fp; +} + +/* + * WARNING: The buffer passed to io_print() is not copied immediately; it must + * remain valid until io_flush() is called. + */ +static inline int +io_print(struct io_state *iop, const CHAR * __restrict ptr, int len) +{ + + iop->iovp->iov_base = (char *)ptr; + iop->iovp->iov_len = len; + iop->uio.uio_resid += len; + iop->iovp++; + if (++iop->uio.uio_iovcnt >= NIOV) { + iop->iovp = iop->iov; + return (__sprint(iop->fp, &iop->uio)); + } + return (0); +} + +/* + * Choose PADSIZE to trade efficiency vs. size. If larger printf + * fields occur frequently, increase PADSIZE and make the initialisers + * below longer. + */ +#define PADSIZE 16 /* pad chunk size */ +static const CHAR blanks[PADSIZE] = +{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; +static const CHAR zeroes[PADSIZE] = +{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + +/* + * Pad with blanks or zeroes. 'with' should point to either the blanks array + * or the zeroes array. + */ +static inline int +io_pad(struct io_state *iop, int howmany, const CHAR * __restrict with) +{ + + while (howmany > PADSIZE) { + if (io_print(iop, with, PADSIZE)) + return (-1); + howmany -= PADSIZE; + } + if (howmany > 0 && io_print(iop, with, howmany)) + return (-1); + return (0); +} + +/* + * Print exactly len characters of the string spanning p to ep, truncating + * or padding with 'with' as necessary. + */ +static inline int +io_printandpad(struct io_state *iop, const CHAR *p, const CHAR *ep, + int len, const CHAR * __restrict with) +{ + int p_len; + + p_len = ep - p; + if (p_len > len) + p_len = len; + if (p_len > 0 && io_print(iop, p, p_len)) + return (-1); + return (io_pad(iop, len - (p_len > 0 ? p_len : 0), with)); +} + +static inline int +io_flush(struct io_state *iop) +{ + + iop->iovp = iop->iov; + return (__sprint(iop->fp, &iop->uio)); +} Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Thu Jan 15 04:26:45 2009 (r187276) +++ head/lib/libc/stdio/vfprintf.c Thu Jan 15 04:29:02 2009 (r187277) @@ -72,6 +72,9 @@ static char *__ultoa(u_long, char *, int const char *); static char *__wcsconv(wchar_t *, int); +#define CHAR char +#include "printfcommon.h" + /* * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. @@ -388,7 +391,6 @@ __vfprintf(FILE *fp, const char *fmt0, v int ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ char *cp; /* handy char pointer (short term usage) */ - struct __siov *iovp; /* for PRINT macro */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ @@ -396,6 +398,7 @@ __vfprintf(FILE *fp, const char *fmt0, v char sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ + #ifndef NO_FLOATING_POINT /* * We can decompose the printed representation of floating @@ -436,9 +439,7 @@ __vfprintf(FILE *fp, const char *fmt0, v int size; /* size of converted field or string */ int prsize; /* max size of printed field */ const char *xdigs; /* digits for %[xX] conversion */ -#define NIOV 8 - struct __suio uio; /* output information: summary */ - struct __siov iov[NIOV];/* ... and individual io vectors */ + struct io_state io; /* I/O buffering state */ char buf[BUF]; /* buffer with space for digits of uintmax_t */ char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ union arg *argtable; /* args, built due to positional arg */ @@ -447,56 +448,25 @@ __vfprintf(FILE *fp, const char *fmt0, v va_list orgap; /* original argument pointer */ char *convbuf; /* wide to multibyte conversion result */ - /* - * Choose PADSIZE to trade efficiency vs. size. If larger printf - * fields occur frequently, increase PADSIZE and make the initialisers - * below longer. - */ -#define PADSIZE 16 /* pad chunk size */ - static char blanks[PADSIZE] = - {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; - static char zeroes[PADSIZE] = - {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; - static const char xdigs_lower[16] = "0123456789abcdef"; static const char xdigs_upper[16] = "0123456789ABCDEF"; - /* - * BEWARE, these `goto error' on error, and PAD uses `n'. - */ + /* BEWARE, these `goto error' on error. */ #define PRINT(ptr, len) { \ - iovp->iov_base = (ptr); \ - iovp->iov_len = (len); \ - uio.uio_resid += (len); \ - iovp++; \ - if (++uio.uio_iovcnt >= NIOV) { \ - if (__sprint(fp, &uio)) \ - goto error; \ - iovp = iov; \ - } \ + if (io_print(&io, (ptr), (len))) \ + goto error; \ } #define PAD(howmany, with) { \ - if ((n = (howmany)) > 0) { \ - while (n > PADSIZE) { \ - PRINT(with, PADSIZE); \ - n -= PADSIZE; \ - } \ - PRINT(with, n); \ - } \ + if (io_pad(&io, (howmany), (with))) \ + goto error; \ +} +#define PRINTANDPAD(p, ep, len, with) { \ + if (io_printandpad(&io, (p), (ep), (len), (with))) \ + goto error; \ } -#define PRINTANDPAD(p, ep, len, with) do { \ - n2 = (ep) - (p); \ - if (n2 > (len)) \ - n2 = (len); \ - if (n2 > 0) \ - PRINT((p), n2); \ - PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ -} while(0) #define FLUSH() { \ - if (uio.uio_resid && __sprint(fp, &uio)) \ + if (io_flush(&io)) \ goto error; \ - uio.uio_iovcnt = 0; \ - iovp = iov; \ } /* @@ -583,9 +553,7 @@ __vfprintf(FILE *fp, const char *fmt0, v argtable = NULL; nextarg = 1; va_copy(orgap, ap); - uio.uio_iov = iovp = iov; - uio.uio_resid = 0; - uio.uio_iovcnt = 0; + io_init(&io, fp); ret = 0; #ifndef NO_FLOATING_POINT dtoaresult = NULL; Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Thu Jan 15 04:26:45 2009 (r187276) +++ head/lib/libc/stdio/vfwprintf.c Thu Jan 15 04:29:02 2009 (r187277) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "fvwrite.h" #include "printflocal.h" +static int __sprint(FILE *, struct __suio *); static int __sbprintf(FILE *, const wchar_t *, va_list); static wint_t __xfputwc(wchar_t, FILE *); static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, const char *, int, @@ -74,6 +75,37 @@ static wchar_t *__ultoa(u_long, wchar_t char, const char *); static wchar_t *__mbsconv(char *, int); +#define CHAR wchar_t +#include "printfcommon.h" + +/* + * Flush out all the vectors defined by the given uio, + * then reset it so that it can be reused. + * + * XXX The fact that we do this a character at a time and convert to a + * multibyte character sequence even if the destination is a wide + * string eclipses the benefits of buffering. + */ +static int +__sprint(FILE *fp, struct __suio *uio) +{ + struct __siov *iov; + wchar_t *p; + int i, len; + + iov = uio->uio_iov; + for (; uio->uio_resid != 0; uio->uio_resid -= len, iov++) { + p = (wchar_t *)iov->iov_base; + len = iov->iov_len; + for (i = 0; i < len; i++) { + if (__xfputwc(p[i], fp) == WEOF) + return (-1); + } + } + uio->uio_iovcnt = 0; + return (0); +} + /* * Helper function for `fprintf to unbuffered unix file': creates a * temporary buffer. We only work on write-only files; this avoids @@ -414,14 +446,14 @@ __vfwprintf(FILE *fp, const wchar_t *fmt { wchar_t *fmt; /* format string */ wchar_t ch; /* character from fmt */ - int n, n2, n3; /* handy integer (short term usage) */ + int n, n2; /* handy integer (short term usage) */ wchar_t *cp; /* handy char pointer (short term usage) */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ - char thousands_sep; /* locale specific thousands separator */ + wchar_t thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ #ifndef NO_FLOATING_POINT /* @@ -463,6 +495,7 @@ __vfwprintf(FILE *fp, const wchar_t *fmt int size; /* size of converted field or string */ int prsize; /* max size of printed field */ const char *xdigs; /* digits for [xX] conversion */ + struct io_state io; /* I/O buffering state */ wchar_t buf[BUF]; /* buffer with space for digits of uintmax_t */ wchar_t ox[2]; /* space for 0x hex-prefix */ union arg *argtable; /* args, built due to positional arg */ @@ -471,45 +504,26 @@ __vfwprintf(FILE *fp, const wchar_t *fmt va_list orgap; /* original argument pointer */ wchar_t *convbuf; /* multibyte to wide conversion result */ - /* - * Choose PADSIZE to trade efficiency vs. size. If larger printf - * fields occur frequently, increase PADSIZE and make the initialisers - * below longer. - */ -#define PADSIZE 16 /* pad chunk size */ - static wchar_t blanks[PADSIZE] = - {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; - static wchar_t zeroes[PADSIZE] = - {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; - static const char xdigs_lower[16] = "0123456789abcdef"; static const char xdigs_upper[16] = "0123456789ABCDEF"; - /* - * BEWARE, these `goto error' on error, PRINT uses `n2' and - * PAD uses `n'. - */ + /* BEWARE, these `goto error' on error. */ #define PRINT(ptr, len) do { \ - for (n3 = 0; n3 < (len); n3++) \ - __xfputwc((ptr)[n3], fp); \ -} while (0) -#define PAD(howmany, with) do { \ - if ((n = (howmany)) > 0) { \ - while (n > PADSIZE) { \ - PRINT(with, PADSIZE); \ - n -= PADSIZE; \ - } \ - PRINT(with, n); \ - } \ + if (io_print(&io, (ptr), (len))) \ + goto error; \ } while (0) -#define PRINTANDPAD(p, ep, len, with) do { \ - n2 = (ep) - (p); \ - if (n2 > (len)) \ - n2 = (len); \ - if (n2 > 0) \ - PRINT((p), n2); \ - PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ -} while(0) +#define PAD(howmany, with) { \ + if (io_pad(&io, (howmany), (with))) \ + goto error; \ +} +#define PRINTANDPAD(p, ep, len, with) { \ + if (io_printandpad(&io, (p), (ep), (len), (with))) \ + goto error; \ +} +#define FLUSH() { \ + if (io_flush(&io)) \ + goto error; \ +} /* * Get the argument indexed by nextarg. If the argument table is @@ -591,6 +605,7 @@ __vfwprintf(FILE *fp, const wchar_t *fmt argtable = NULL; nextarg = 1; va_copy(orgap, ap); + io_init(&io, fp); ret = 0; #ifndef NO_FLOATING_POINT decimal_point = localeconv()->decimal_point; @@ -1120,8 +1135,10 @@ number: if ((dprec = prec) >= 0) if (!expchar) { /* %[fF] or sufficiently short %[gG] */ if (expt <= 0) { PRINT(zeroes, 1); - if (prec || flags & ALT) - PRINT(decimal_point, 1); + if (prec || flags & ALT) { + buf[0] = *decimal_point; + PRINT(buf, 1); + } PAD(-expt, zeroes); /* already handled initial 0's */ prec += expt; @@ -1173,8 +1190,11 @@ number: if ((dprec = prec) >= 0) /* finally, adjust ret */ ret += prsize; + + FLUSH(); /* copy out the I/O vectors */ } done: + FLUSH(); error: va_end(orgap); if (convbuf != NULL) From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:31:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69086106566B; Thu, 15 Jan 2009 04:31:55 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5661B8FC12; Thu, 15 Jan 2009 04:31:55 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4VtT4064273; Thu, 15 Jan 2009 04:31:55 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4Vtvq064272; Thu, 15 Jan 2009 04:31:55 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150431.n0F4Vtvq064272@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187278 - in stable/7/lib/libc: . regex string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:31:56 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:31:55 2009 New Revision: 187278 URL: http://svn.freebsd.org/changeset/base/187278 Log: MFC 182795 from /head Add two example regexps: (1) one for matching all the characters that belong in a character class, and (2) one for matching all the characters *not* in a character class. Submitted by: Mark B, mkbucc at gmail.com Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/regex/re_format.7 stable/7/lib/libc/string/ffsll.c (props changed) stable/7/lib/libc/string/flsll.c (props changed) Modified: stable/7/lib/libc/regex/re_format.7 ============================================================================== --- stable/7/lib/libc/regex/re_format.7 Thu Jan 15 04:29:02 2009 (r187277) +++ stable/7/lib/libc/regex/re_format.7 Thu Jan 15 04:31:55 2009 (r187278) @@ -288,6 +288,14 @@ These stand for the character classes de A locale may provide others. A character class may not be used as an endpoint of a range. .Pp +A bracketed expression like +.Ql [[:class:]] +can be used to match a single character that belongs to a character +class. +The reverse, matching any character that does not belong to a specific +class, the negation operator of bracket expressions may be used: +.Ql [^[:class:]] . +.Pp There are two special cases\(dd of bracket expressions: the bracket expressions .Ql [[:<:]] From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:32:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC4E106567A; Thu, 15 Jan 2009 04:32:54 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 188ED8FC14; Thu, 15 Jan 2009 04:32:54 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4WrKL064338; Thu, 15 Jan 2009 04:32:54 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4WrTJ064337; Thu, 15 Jan 2009 04:32:53 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150432.n0F4WrTJ064337@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187279 - in stable/6/lib/libc: . inet regex sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:32:55 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:32:53 2009 New Revision: 187279 URL: http://svn.freebsd.org/changeset/base/187279 Log: MFC 182795 from /head Add two example regexps: (1) one for matching all the characters that belong in a character class, and (2) one for matching all the characters *not* in a character class. Submitted by: Mark B, mkbucc at gmail.com Modified: stable/6/lib/libc/ (props changed) stable/6/lib/libc/inet/inet_net_pton.c (props changed) stable/6/lib/libc/regex/re_format.7 stable/6/lib/libc/sys/ (props changed) Modified: stable/6/lib/libc/regex/re_format.7 ============================================================================== --- stable/6/lib/libc/regex/re_format.7 Thu Jan 15 04:31:55 2009 (r187278) +++ stable/6/lib/libc/regex/re_format.7 Thu Jan 15 04:32:53 2009 (r187279) @@ -288,6 +288,14 @@ These stand for the character classes de A locale may provide others. A character class may not be used as an endpoint of a range. .Pp +A bracketed expression like +.Ql [[:class:]] +can be used to match a single character that belongs to a character +class. +The reverse, matching any character that does not belong to a specific +class, the negation operator of bracket expressions may be used: +.Ql [^[:class:]] . +.Pp There are two special cases\(dd of bracket expressions: the bracket expressions .Ql [[:<:]] From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:39:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BC97106564A; Thu, 15 Jan 2009 04:39:44 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7957D8FC20; Thu, 15 Jan 2009 04:39:44 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4dio6064507; Thu, 15 Jan 2009 04:39:44 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4diG7064506; Thu, 15 Jan 2009 04:39:44 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150439.n0F4diG7064506@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187280 - stable/7/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:39:45 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:39:44 2009 New Revision: 187280 URL: http://svn.freebsd.org/changeset/base/187280 Log: MFC 184057 from /head Modified: stable/7/sbin/ifconfig/ifconfig.8 Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Thu Jan 15 04:32:53 2009 (r187279) +++ stable/7/sbin/ifconfig/ifconfig.8 Thu Jan 15 04:39:44 2009 (r187280) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 20, 2008 +.Dd October 19, 2008 .Dt IFCONFIG 8 .Os .Sh NAME @@ -106,7 +106,7 @@ slash notation) to include the netmask. That is, one can specify an address like .Li 192.168.0.1/16 . .Pp -For +For the .Dq inet6 family, it is also possible to specify the prefix length using the slash notation, like @@ -906,8 +906,9 @@ This information may be updated automati and/or with a .Cm scan request or through background scanning. +The .Cm list ap -is another way of requesting this information. +command is another way of requesting this information. .It Cm list sta When operating as an access point display the stations that are currently associated. From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:43:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F4711065701; Thu, 15 Jan 2009 04:43:09 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D4348FC13; Thu, 15 Jan 2009 04:43:09 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4h93r064602; Thu, 15 Jan 2009 04:43:09 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4h9uU064601; Thu, 15 Jan 2009 04:43:09 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150443.n0F4h9uU064601@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:43:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187281 - stable/6/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:43:10 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:43:09 2009 New Revision: 187281 URL: http://svn.freebsd.org/changeset/base/187281 Log: MFC 184057 from /head: Tiny wording nits. Modified: stable/6/sbin/ifconfig/ifconfig.8 Modified: stable/6/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/6/sbin/ifconfig/ifconfig.8 Thu Jan 15 04:39:44 2009 (r187280) +++ stable/6/sbin/ifconfig/ifconfig.8 Thu Jan 15 04:43:09 2009 (r187281) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 16, 2007 +.Dd October 19, 2008 .Dt IFCONFIG 8 .Os .Sh NAME @@ -104,7 +104,7 @@ slash notation) to include the netmask. That is, one can specify an address like .Li 192.168.0.1/16 . .Pp -For +For the .Dq inet6 family, it is also possible to specify the prefix length using the slash notation, like @@ -714,8 +714,9 @@ This information may be updated automati and/or with a .Cm scan request. +The .Cm list ap -is another way of requesting this information. +command is another way of requesting this information. .It Cm list sta When operating as an access point display the stations that are currently associated. From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:48:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B142810656C3; Thu, 15 Jan 2009 04:48:06 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 787888FC3A; Thu, 15 Jan 2009 04:48:06 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4m6Wf064733; Thu, 15 Jan 2009 04:48:06 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4m6xl064732; Thu, 15 Jan 2009 04:48:06 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150448.n0F4m6xl064732@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187282 - stable/7/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:48:14 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:48:06 2009 New Revision: 187282 URL: http://svn.freebsd.org/changeset/base/187282 Log: MFC 184645 from /head Repeat vmstat header after window.rows instead of a hardcoded 20. Use ioctl() to get the window size in vmstat(8), and force a new header to be prepended to the output every time the current window size changes. Change the number of lines before each header to the current lines of the terminal when the terminal is resized, so that the full terminal length can be used for output lines. Modified: stable/7/usr.bin/vmstat/vmstat.c Modified: stable/7/usr.bin/vmstat/vmstat.c ============================================================================== --- stable/7/usr.bin/vmstat/vmstat.c Thu Jan 15 04:43:09 2009 (r187281) +++ stable/7/usr.bin/vmstat/vmstat.c Thu Jan 15 04:48:06 2009 (r187282) @@ -133,7 +133,10 @@ static devstat_select_mode select_mode; static struct vmmeter sum, osum; -static int winlines = 20; +#define VMSTAT_DEFAULT_LINES 20 /* Default number of `winlines'. */ +volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +static int winlines = VMSTAT_DEFAULT_LINES; /* Current number of tty rows. */ + static int aflag; static int nflag; static int Pflag; @@ -162,6 +165,8 @@ static void kread(int, void *, size_t); static void kreado(int, void *, size_t, size_t); static char *kgetstr(const char *); static void needhdr(int); +static void needresize(int); +static void doresize(void); static void printhdr(int, u_long); static void usage(void); @@ -277,8 +282,6 @@ main(int argc, char *argv[]) errx(1, "Cannot use -P with crash dumps"); if (todo & VMSTAT) { - struct winsize winsize; - /* * Make sure that the userland devstat version matches the * kernel devstat version. If not, exit and print a @@ -289,11 +292,6 @@ main(int argc, char *argv[]) argv = getdrivedata(argv); - winsize.ws_row = 0; - (void) ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&winsize); - if (winsize.ws_row > 0) - winlines = winsize.ws_row; - } #define BACKWARD_COMPATIBILITY @@ -578,8 +576,27 @@ dovmstat(unsigned int interval, int reps uptime = getuptime(); halfuptime = uptime / 2; + + /* + * If the user stops the program (control-Z) and then resumes it, + * print out the header again. + */ (void)signal(SIGCONT, needhdr); + /* + * If our standard output is a tty, then install a SIGWINCH handler + * and set wresized so that our first iteration through the main + * iostat loop will peek at the terminal's current rows to find out + * how many lines can fit in a screenful of output. + */ + if (isatty(fileno(stdout)) != 0) { + wresized = 1; + (void)signal(SIGWINCH, needresize); + } else { + wresized = 0; + winlines = VMSTAT_DEFAULT_LINES; + } + if (kd != NULL) { if (namelist[X_STATHZ].n_type != 0 && namelist[X_STATHZ].n_value != 0) @@ -758,7 +775,9 @@ printhdr(int ncpus, u_long cpumask) printf("\n"); } else printf(" us sy id\n"); - hdrcnt = winlines - 2; + if (wresized != 0) + doresize(); + hdrcnt = winlines; } /* @@ -771,6 +790,47 @@ needhdr(int dummy __unused) hdrcnt = 1; } +/* + * When the terminal is resized, force an update of the maximum number of rows + * printed between each header repetition. Then force a new header to be + * prepended to the next output. + */ +void +needresize(int signo) +{ + + wresized = 1; + hdrcnt = 1; +} + +/* + * Update the global `winlines' count of terminal rows. + */ +void +doresize(void) +{ + int status; + struct winsize w; + + for (;;) { + status = ioctl(fileno(stdout), TIOCGWINSZ, &w); + if (status == -1 && errno == EINTR) + continue; + else if (status == -1) + err(1, "ioctl"); + if (w.ws_row > 3) + winlines = w.ws_row - 3; + else + winlines = VMSTAT_DEFAULT_LINES; + break; + } + + /* + * Inhibit doresize() calls until we are rescheduled by SIGWINCH. + */ + wresized = 0; +} + #ifdef notyet static void dotimes(void) From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:49:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22D1A1065672; Thu, 15 Jan 2009 04:49:41 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 100898FC1A; Thu, 15 Jan 2009 04:49:41 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4neZU064797; Thu, 15 Jan 2009 04:49:40 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4neYd064796; Thu, 15 Jan 2009 04:49:40 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150449.n0F4neYd064796@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187283 - stable/6/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:49:41 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:49:40 2009 New Revision: 187283 URL: http://svn.freebsd.org/changeset/base/187283 Log: MFC 184645 from /head Repeat vmstat header after window.rows instead of a hardcoded 20. Use ioctl() to get the window size in vmstat(8), and force a new header to be prepended to the output every time the current window size changes. Change the number of lines before each header to the current lines of the terminal when the terminal is resized, so that the full terminal length can be used for output lines. Modified: stable/6/usr.bin/vmstat/vmstat.c Modified: stable/6/usr.bin/vmstat/vmstat.c ============================================================================== --- stable/6/usr.bin/vmstat/vmstat.c Thu Jan 15 04:48:06 2009 (r187282) +++ stable/6/usr.bin/vmstat/vmstat.c Thu Jan 15 04:49:40 2009 (r187283) @@ -135,7 +135,10 @@ static devstat_select_mode select_mode; static struct vmmeter sum, osum; -static int winlines = 20; +#define VMSTAT_DEFAULT_LINES 20 /* Default number of `winlines'. */ +volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +static int winlines = VMSTAT_DEFAULT_LINES; /* Current number of tty rows. */ + static int aflag; static int nflag; static int Pflag; @@ -164,6 +167,8 @@ static void kread(int, void *, size_t); static void kreado(int, void *, size_t, size_t); static char *kgetstr(const char *); static void needhdr(int); +static void needresize(int); +static void doresize(void); static void printhdr(int, u_long); static void usage(void); @@ -279,8 +284,6 @@ main(int argc, char *argv[]) errx(1, "Cannot use -P with crash dumps"); if (todo & VMSTAT) { - struct winsize winsize; - /* * Make sure that the userland devstat version matches the * kernel devstat version. If not, exit and print a @@ -291,11 +294,6 @@ main(int argc, char *argv[]) argv = getdrivedata(argv); - winsize.ws_row = 0; - (void) ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&winsize); - if (winsize.ws_row > 0) - winlines = winsize.ws_row; - } #define BACKWARD_COMPATIBILITY @@ -591,8 +589,27 @@ dovmstat(unsigned int interval, int reps uptime = getuptime(); halfuptime = uptime / 2; + + /* + * If the user stops the program (control-Z) and then resumes it, + * print out the header again. + */ (void)signal(SIGCONT, needhdr); + /* + * If our standard output is a tty, then install a SIGWINCH handler + * and set wresized so that our first iteration through the main + * iostat loop will peek at the terminal's current rows to find out + * how many lines can fit in a screenful of output. + */ + if (isatty(fileno(stdout)) != 0) { + wresized = 1; + (void)signal(SIGWINCH, needresize); + } else { + wresized = 0; + winlines = VMSTAT_DEFAULT_LINES; + } + if (kd != NULL) { if (namelist[X_STATHZ].n_type != 0 && namelist[X_STATHZ].n_value != 0) @@ -770,7 +787,9 @@ printhdr(int ncpus, u_long cpumask) printf("\n"); } else printf(" us sy id\n"); - hdrcnt = winlines - 2; + if (wresized != 0) + doresize(); + hdrcnt = winlines; } /* @@ -783,6 +802,47 @@ needhdr(int dummy __unused) hdrcnt = 1; } +/* + * When the terminal is resized, force an update of the maximum number of rows + * printed between each header repetition. Then force a new header to be + * prepended to the next output. + */ +void +needresize(int signo) +{ + + wresized = 1; + hdrcnt = 1; +} + +/* + * Update the global `winlines' count of terminal rows. + */ +void +doresize(void) +{ + int status; + struct winsize w; + + for (;;) { + status = ioctl(fileno(stdout), TIOCGWINSZ, &w); + if (status == -1 && errno == EINTR) + continue; + else if (status == -1) + err(1, "ioctl"); + if (w.ws_row > 3) + winlines = w.ws_row - 3; + else + winlines = VMSTAT_DEFAULT_LINES; + break; + } + + /* + * Inhibit doresize() calls until we are rescheduled by SIGWINCH. + */ + wresized = 0; +} + #ifdef notyet static void dotimes(void) From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:49:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 227F01065675; Thu, 15 Jan 2009 04:49:44 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1043A8FC17; Thu, 15 Jan 2009 04:49:44 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4ni0Q064837; Thu, 15 Jan 2009 04:49:44 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4nhlF064834; Thu, 15 Jan 2009 04:49:43 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901150449.n0F4nhlF064834@svn.freebsd.org> From: David Schultz Date: Thu, 15 Jan 2009 04:49: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: r187284 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:49:44 -0000 Author: das Date: Thu Jan 15 04:49:43 2009 New Revision: 187284 URL: http://svn.freebsd.org/changeset/base/187284 Log: Reduce code duplication by moving functions that are identical in both vfprintf.c and vfwprintf.c (except for char/wchar_t differences) to a common header file. Modified: head/lib/libc/stdio/printfcommon.h head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c Modified: head/lib/libc/stdio/printfcommon.h ============================================================================== --- head/lib/libc/stdio/printfcommon.h Thu Jan 15 04:49:40 2009 (r187283) +++ head/lib/libc/stdio/printfcommon.h Thu Jan 15 04:49:43 2009 (r187284) @@ -37,6 +37,28 @@ * You must define CHAR to either char or wchar_t prior to including this. */ + +#ifndef NO_FLOATING_POINT + +#define dtoa __dtoa +#define freedtoa __freedtoa + +#include +#include +#include "floatio.h" +#include "gdtoa.h" + +#define DEFPREC 6 + +static int exponent(CHAR *, int, CHAR); + +#endif /* !NO_FLOATING_POINT */ + +static CHAR *__ujtoa(uintmax_t, CHAR *, int, int, const char *, int, char, + const char *); +static CHAR *__ultoa(u_long, CHAR *, int, int, const char *, int, char, + const char *); + #define NIOV 8 struct io_state { FILE *fp; @@ -128,3 +150,197 @@ io_flush(struct io_state *iop) iop->iovp = iop->iov; return (__sprint(iop->fp, &iop->uio)); } + +/* + * Convert an unsigned long to ASCII for printf purposes, returning + * a pointer to the first character of the string representation. + * Octal numbers can be forced to have a leading zero; hex numbers + * use the given digits. + */ +static CHAR * +__ultoa(u_long val, CHAR *endp, int base, int octzero, const char *xdigs, + int needgrp, char thousep, const char *grp) +{ + CHAR *cp = endp; + long sval; + int ndig; + + /* + * Handle the three cases separately, in the hope of getting + * better/faster code. + */ + switch (base) { + case 10: + if (val < 10) { /* many numbers are 1 digit */ + *--cp = to_char(val); + return (cp); + } + ndig = 0; + /* + * On many machines, unsigned arithmetic is harder than + * signed arithmetic, so we do at most one unsigned mod and + * divide; this is sufficient to reduce the range of + * the incoming value to where signed arithmetic works. + */ + if (val > LONG_MAX) { + *--cp = to_char(val % 10); + ndig++; + sval = val / 10; + } else + sval = val; + do { + *--cp = to_char(sval % 10); + ndig++; + /* + * If (*grp == CHAR_MAX) then no more grouping + * should be performed. + */ + if (needgrp && ndig == *grp && *grp != CHAR_MAX + && sval > 9) { + *--cp = thousep; + ndig = 0; + /* + * If (*(grp+1) == '\0') then we have to + * use *grp character (last grouping rule) + * for all next cases + */ + if (*(grp+1) != '\0') + grp++; + } + sval /= 10; + } while (sval != 0); + break; + + case 8: + do { + *--cp = to_char(val & 7); + val >>= 3; + } while (val); + if (octzero && *cp != '0') + *--cp = '0'; + break; + + case 16: + do { + *--cp = xdigs[val & 15]; + val >>= 4; + } while (val); + break; + + default: /* oops */ + abort(); + } + return (cp); +} + +/* Identical to __ultoa, but for intmax_t. */ +static CHAR * +__ujtoa(uintmax_t val, CHAR *endp, int base, int octzero, const char *xdigs, + int needgrp, char thousep, const char *grp) +{ + CHAR *cp = endp; + intmax_t sval; + int ndig; + + /* quick test for small values; __ultoa is typically much faster */ + /* (perhaps instead we should run until small, then call __ultoa?) */ + if (val <= ULONG_MAX) + return (__ultoa((u_long)val, endp, base, octzero, xdigs, + needgrp, thousep, grp)); + switch (base) { + case 10: + if (val < 10) { + *--cp = to_char(val % 10); + return (cp); + } + ndig = 0; + if (val > INTMAX_MAX) { + *--cp = to_char(val % 10); + ndig++; + sval = val / 10; + } else + sval = val; + do { + *--cp = to_char(sval % 10); + ndig++; + /* + * If (*grp == CHAR_MAX) then no more grouping + * should be performed. + */ + if (needgrp && *grp != CHAR_MAX && ndig == *grp + && sval > 9) { + *--cp = thousep; + ndig = 0; + /* + * If (*(grp+1) == '\0') then we have to + * use *grp character (last grouping rule) + * for all next cases + */ + if (*(grp+1) != '\0') + grp++; + } + sval /= 10; + } while (sval != 0); + break; + + case 8: + do { + *--cp = to_char(val & 7); + val >>= 3; + } while (val); + if (octzero && *cp != '0') + *--cp = '0'; + break; + + case 16: + do { + *--cp = xdigs[val & 15]; + val >>= 4; + } while (val); + break; + + default: + abort(); + } + return (cp); +} + +#ifndef NO_FLOATING_POINT + +static int +exponent(CHAR *p0, int exp, CHAR fmtch) +{ + CHAR *p, *t; + CHAR expbuf[MAXEXPDIG]; + + p = p0; + *p++ = fmtch; + if (exp < 0) { + exp = -exp; + *p++ = '-'; + } + else + *p++ = '+'; + t = expbuf + MAXEXPDIG; + if (exp > 9) { + do { + *--t = to_char(exp % 10); + } while ((exp /= 10) > 9); + *--t = to_char(exp); + for (; t < expbuf + MAXEXPDIG; *p++ = *t++); + } + else { + /* + * Exponents for decimal floating point conversions + * (%[eEgG]) must be at least two characters long, + * whereas exponents for hexadecimal conversions can + * be only one character long. + */ + if (fmtch == 'e' || fmtch == 'E') + *p++ = '0'; + *p++ = to_char(exp); + } + return (p - p0); +} + +#endif /* !NO_FLOATING_POINT */ Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Thu Jan 15 04:49:40 2009 (r187283) +++ head/lib/libc/stdio/vfprintf.c Thu Jan 15 04:49:43 2009 (r187284) @@ -66,10 +66,6 @@ __FBSDID("$FreeBSD$"); static int __sprint(FILE *, struct __suio *); static int __sbprintf(FILE *, const char *, va_list) __printflike(2, 0); -static char *__ujtoa(uintmax_t, char *, int, int, const char *, int, char, - const char *); -static char *__ultoa(u_long, char *, int, int, const char *, int, char, - const char *); static char *__wcsconv(wchar_t *, int); #define CHAR char @@ -129,160 +125,6 @@ __sbprintf(FILE *fp, const char *fmt, va } /* - * Convert an unsigned long to ASCII for printf purposes, returning - * a pointer to the first character of the string representation. - * Octal numbers can be forced to have a leading zero; hex numbers - * use the given digits. - */ -static char * -__ultoa(u_long val, char *endp, int base, int octzero, const char *xdigs, - int needgrp, char thousep, const char *grp) -{ - char *cp = endp; - long sval; - int ndig; - - /* - * Handle the three cases separately, in the hope of getting - * better/faster code. - */ - switch (base) { - case 10: - if (val < 10) { /* many numbers are 1 digit */ - *--cp = to_char(val); - return (cp); - } - ndig = 0; - /* - * On many machines, unsigned arithmetic is harder than - * signed arithmetic, so we do at most one unsigned mod and - * divide; this is sufficient to reduce the range of - * the incoming value to where signed arithmetic works. - */ - if (val > LONG_MAX) { - *--cp = to_char(val % 10); - ndig++; - sval = val / 10; - } else - sval = val; - do { - *--cp = to_char(sval % 10); - ndig++; - /* - * If (*grp == CHAR_MAX) then no more grouping - * should be performed. - */ - if (needgrp && ndig == *grp && *grp != CHAR_MAX - && sval > 9) { - *--cp = thousep; - ndig = 0; - /* - * If (*(grp+1) == '\0') then we have to - * use *grp character (last grouping rule) - * for all next cases - */ - if (*(grp+1) != '\0') - grp++; - } - sval /= 10; - } while (sval != 0); - break; - - case 8: - do { - *--cp = to_char(val & 7); - val >>= 3; - } while (val); - if (octzero && *cp != '0') - *--cp = '0'; - break; - - case 16: - do { - *--cp = xdigs[val & 15]; - val >>= 4; - } while (val); - break; - - default: /* oops */ - abort(); - } - return (cp); -} - -/* Identical to __ultoa, but for intmax_t. */ -static char * -__ujtoa(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, - int needgrp, char thousep, const char *grp) -{ - char *cp = endp; - intmax_t sval; - int ndig; - - /* quick test for small values; __ultoa is typically much faster */ - /* (perhaps instead we should run until small, then call __ultoa?) */ - if (val <= ULONG_MAX) - return (__ultoa((u_long)val, endp, base, octzero, xdigs, - needgrp, thousep, grp)); - switch (base) { - case 10: - if (val < 10) { - *--cp = to_char(val % 10); - return (cp); - } - ndig = 0; - if (val > INTMAX_MAX) { - *--cp = to_char(val % 10); - ndig++; - sval = val / 10; - } else - sval = val; - do { - *--cp = to_char(sval % 10); - ndig++; - /* - * If (*grp == CHAR_MAX) then no more grouping - * should be performed. - */ - if (needgrp && *grp != CHAR_MAX && ndig == *grp - && sval > 9) { - *--cp = thousep; - ndig = 0; - /* - * If (*(grp+1) == '\0') then we have to - * use *grp character (last grouping rule) - * for all next cases - */ - if (*(grp+1) != '\0') - grp++; - } - sval /= 10; - } while (sval != 0); - break; - - case 8: - do { - *--cp = to_char(val & 7); - val >>= 3; - } while (val); - if (octzero && *cp != '0') - *--cp = '0'; - break; - - case 16: - do { - *--cp = xdigs[val & 15]; - val >>= 4; - } while (val); - break; - - default: - abort(); - } - return (cp); -} - -/* * Convert a wide character string argument for the %ls format to a multibyte * string representation. If not -1, prec specifies the maximum number of * bytes to output, and also means that we can't assume that the wide char. @@ -356,22 +198,6 @@ vfprintf(FILE * __restrict fp, const cha return (ret); } -#ifndef NO_FLOATING_POINT - -#define dtoa __dtoa -#define freedtoa __freedtoa - -#include -#include -#include "floatio.h" -#include "gdtoa.h" - -#define DEFPREC 6 - -static int exponent(char *, int, int); - -#endif /* !NO_FLOATING_POINT */ - /* * The size of the buffer we use as scratch space for integer * conversions, among other things. Technically, we would need the @@ -1159,42 +985,3 @@ error: /* NOTREACHED */ } - -#ifndef NO_FLOATING_POINT - -static int -exponent(char *p0, int exp, int fmtch) -{ - char *p, *t; - char expbuf[MAXEXPDIG]; - - p = p0; - *p++ = fmtch; - if (exp < 0) { - exp = -exp; - *p++ = '-'; - } - else - *p++ = '+'; - t = expbuf + MAXEXPDIG; - if (exp > 9) { - do { - *--t = to_char(exp % 10); - } while ((exp /= 10) > 9); - *--t = to_char(exp); - for (; t < expbuf + MAXEXPDIG; *p++ = *t++); - } - else { - /* - * Exponents for decimal floating point conversions - * (%[eEgG]) must be at least two characters long, - * whereas exponents for hexadecimal conversions can - * be only one character long. - */ - if (fmtch == 'e' || fmtch == 'E') - *p++ = '0'; - *p++ = to_char(exp); - } - return (p - p0); -} -#endif /* !NO_FLOATING_POINT */ Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Thu Jan 15 04:49:40 2009 (r187283) +++ head/lib/libc/stdio/vfwprintf.c Thu Jan 15 04:49:43 2009 (r187284) @@ -69,10 +69,6 @@ __FBSDID("$FreeBSD$"); static int __sprint(FILE *, struct __suio *); static int __sbprintf(FILE *, const wchar_t *, va_list); static wint_t __xfputwc(wchar_t, FILE *); -static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, const char *, int, - char, const char *); -static wchar_t *__ultoa(u_long, wchar_t *, int, int, const char *, int, - char, const char *); static wchar_t *__mbsconv(char *, int); #define CHAR wchar_t @@ -171,160 +167,6 @@ __xfputwc(wchar_t wc, FILE *fp) } /* - * Convert an unsigned long to ASCII for printf purposes, returning - * a pointer to the first character of the string representation. - * Octal numbers can be forced to have a leading zero; hex numbers - * use the given digits. - */ -static wchar_t * -__ultoa(u_long val, wchar_t *endp, int base, int octzero, const char *xdigs, - int needgrp, char thousep, const char *grp) -{ - wchar_t *cp = endp; - long sval; - int ndig; - - /* - * Handle the three cases separately, in the hope of getting - * better/faster code. - */ - switch (base) { - case 10: - if (val < 10) { /* many numbers are 1 digit */ - *--cp = to_char(val); - return (cp); - } - ndig = 0; - /* - * On many machines, unsigned arithmetic is harder than - * signed arithmetic, so we do at most one unsigned mod and - * divide; this is sufficient to reduce the range of - * the incoming value to where signed arithmetic works. - */ - if (val > LONG_MAX) { - *--cp = to_char(val % 10); - ndig++; - sval = val / 10; - } else - sval = val; - do { - *--cp = to_char(sval % 10); - ndig++; - /* - * If (*grp == CHAR_MAX) then no more grouping - * should be performed. - */ - if (needgrp && ndig == *grp && *grp != CHAR_MAX - && sval > 9) { - *--cp = thousep; - ndig = 0; - /* - * If (*(grp+1) == '\0') then we have to - * use *grp character (last grouping rule) - * for all next cases - */ - if (*(grp+1) != '\0') - grp++; - } - sval /= 10; - } while (sval != 0); - break; - - case 8: - do { - *--cp = to_char(val & 7); - val >>= 3; - } while (val); - if (octzero && *cp != '0') - *--cp = '0'; - break; - - case 16: - do { - *--cp = xdigs[val & 15]; - val >>= 4; - } while (val); - break; - - default: /* oops */ - abort(); - } - return (cp); -} - -/* Identical to __ultoa, but for intmax_t. */ -static wchar_t * -__ujtoa(uintmax_t val, wchar_t *endp, int base, int octzero, - const char *xdigs, int needgrp, char thousep, const char *grp) -{ - wchar_t *cp = endp; - intmax_t sval; - int ndig; - - /* quick test for small values; __ultoa is typically much faster */ - /* (perhaps instead we should run until small, then call __ultoa?) */ - if (val <= ULONG_MAX) - return (__ultoa((u_long)val, endp, base, octzero, xdigs, - needgrp, thousep, grp)); - switch (base) { - case 10: - if (val < 10) { - *--cp = to_char(val % 10); - return (cp); - } - ndig = 0; - if (val > INTMAX_MAX) { - *--cp = to_char(val % 10); - ndig++; - sval = val / 10; - } else - sval = val; - do { - *--cp = to_char(sval % 10); - ndig++; - /* - * If (*grp == CHAR_MAX) then no more grouping - * should be performed. - */ - if (needgrp && *grp != CHAR_MAX && ndig == *grp - && sval > 9) { - *--cp = thousep; - ndig = 0; - /* - * If (*(grp+1) == '\0') then we have to - * use *grp character (last grouping rule) - * for all next cases - */ - if (*(grp+1) != '\0') - grp++; - } - sval /= 10; - } while (sval != 0); - break; - - case 8: - do { - *--cp = to_char(val & 7); - val >>= 3; - } while (val); - if (octzero && *cp != '0') - *--cp = '0'; - break; - - case 16: - do { - *--cp = xdigs[val & 15]; - val >>= 4; - } while (val); - break; - - default: - abort(); - } - return (cp); -} - -/* * Convert a multibyte character string argument for the %s format to a wide * string representation. ``prec'' specifies the maximum number of bytes * to output. If ``prec'' is greater than or equal to zero, we can't assume @@ -413,22 +255,6 @@ vfwprintf(FILE * __restrict fp, const wc return (ret); } -#ifndef NO_FLOATING_POINT - -#define dtoa __dtoa -#define freedtoa __freedtoa - -#include -#include -#include "floatio.h" -#include "gdtoa.h" - -#define DEFPREC 6 - -static int exponent(wchar_t *, int, wchar_t); - -#endif /* !NO_FLOATING_POINT */ - /* * The size of the buffer we use as scratch space for integer * conversions, among other things. Technically, we would need the @@ -1206,43 +1032,3 @@ error: return (ret); /* NOTREACHED */ } - - -#ifndef NO_FLOATING_POINT - -static int -exponent(wchar_t *p0, int exp, wchar_t fmtch) -{ - wchar_t *p, *t; - wchar_t expbuf[MAXEXPDIG]; - - p = p0; - *p++ = fmtch; - if (exp < 0) { - exp = -exp; - *p++ = '-'; - } - else - *p++ = '+'; - t = expbuf + MAXEXPDIG; - if (exp > 9) { - do { - *--t = to_char(exp % 10); - } while ((exp /= 10) > 9); - *--t = to_char(exp); - for (; t < expbuf + MAXEXPDIG; *p++ = *t++); - } - else { - /* - * Exponents for decimal floating point conversions - * (%[eEgG]) must be at least two characters long, - * whereas exponents for hexadecimal conversions can - * be only one character long. - */ - if (fmtch == 'e' || fmtch == 'E') - *p++ = '0'; - *p++ = to_char(exp); - } - return (p - p0); -} -#endif /* !NO_FLOATING_POINT */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:54:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F9E1065672; Thu, 15 Jan 2009 04:54:43 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A24F98FC08; Thu, 15 Jan 2009 04:54:43 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4sh0T064978; Thu, 15 Jan 2009 04:54:43 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4shcA064976; Thu, 15 Jan 2009 04:54:43 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150454.n0F4shcA064976@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187285 - stable/7/usr.bin/wc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:54:44 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:54:43 2009 New Revision: 187285 URL: http://svn.freebsd.org/changeset/base/187285 Log: MFC 185714 from /head Add a -L option to wc(1), for finger compatibility with the GNU wc utility. The -L option can be used to report the length of the longest line wc has seen in one or more files. It is disabled by default, and wc uses the standard `-lwc'. Submitted by: Sheldon Givens, sheldon at sigsegv.ca Modified: stable/7/usr.bin/wc/ (props changed) stable/7/usr.bin/wc/wc.1 stable/7/usr.bin/wc/wc.c Modified: stable/7/usr.bin/wc/wc.1 ============================================================================== --- stable/7/usr.bin/wc/wc.1 Thu Jan 15 04:49:43 2009 (r187284) +++ stable/7/usr.bin/wc/wc.1 Thu Jan 15 04:54:43 2009 (r187285) @@ -35,7 +35,7 @@ .\" @(#)wc.1 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 23, 2005 +.Dd December 6, 2008 .Dt WC 1 .Os .Sh NAME @@ -43,7 +43,7 @@ .Nd word, line, character, and byte count .Sh SYNOPSIS .Nm -.Op Fl clmw +.Op Fl Lclmw .Op Ar .Sh DESCRIPTION The @@ -71,6 +71,15 @@ the last file. .Pp The following options are available: .Bl -tag -width indent +.It Fl L +The number of characters in the longest input line +is written to the standard output. +When more then one +.Ar file +argument is specified, the longest input line of +.Em all +files is reported as the value of the final +.Dq total . .It Fl c The number of bytes in each input file is written to the standard output. @@ -129,6 +138,10 @@ and as well as the totals for both: .Pp .Dl "wc -mlw report1 report2" +.Pp +Find the longest line in a list of files: +.Pp +.Dl "wc -L file1 file2 file3 | fgrep total" .Sh COMPATIBILITY Historically, the .Nm @@ -154,6 +167,16 @@ in terms of the .Xr iswspace 3 function, as required by .St -p1003.2 . +.Pp +The +.Fl L +option is a non-standard +.Fx +extension, compatible with the +.Fl L +option of the GNU +.Nm +utility. .Sh SEE ALSO .Xr iswspace 3 .Sh STANDARDS Modified: stable/7/usr.bin/wc/wc.c ============================================================================== --- stable/7/usr.bin/wc/wc.c Thu Jan 15 04:49:43 2009 (r187284) +++ stable/7/usr.bin/wc/wc.c Thu Jan 15 04:54:43 2009 (r187285) @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include -uintmax_t tlinect, twordct, tcharct; -int doline, doword, dochar, domulti; +uintmax_t tlinect, twordct, tcharct, tlongline; +int doline, doword, dochar, domulti, dolongline; static int cnt(const char *); static void usage(void); @@ -75,7 +75,7 @@ main(int argc, char *argv[]) (void) setlocale(LC_CTYPE, ""); - while ((ch = getopt(argc, argv, "clmw")) != -1) + while ((ch = getopt(argc, argv, "clmwL")) != -1) switch((char)ch) { case 'l': doline = 1; @@ -87,6 +87,9 @@ main(int argc, char *argv[]) dochar = 1; domulti = 0; break; + case 'L': + dolongline = 1; + break; case 'm': domulti = 1; dochar = 0; @@ -99,7 +102,7 @@ main(int argc, char *argv[]) argc -= optind; /* Wc's flags are on by default. */ - if (doline + doword + dochar + domulti == 0) + if (doline + doword + dochar + domulti + dolongline == 0) doline = doword = dochar = 1; errors = 0; @@ -125,6 +128,8 @@ main(int argc, char *argv[]) (void)printf(" %7ju", twordct); if (dochar || domulti) (void)printf(" %7ju", tcharct); + if (dolongline) + (void)printf(" %7ju", tlongline); (void)printf(" total\n"); } exit(errors == 0 ? 0 : 1); @@ -134,7 +139,7 @@ static int cnt(const char *file) { struct stat sb; - uintmax_t linect, wordct, charct; + uintmax_t linect, wordct, charct, llct, tmpll; int fd, len, warned; size_t clen; short gotsp; @@ -143,7 +148,7 @@ cnt(const char *file) wchar_t wch; mbstate_t mbs; - linect = wordct = charct = 0; + linect = wordct = charct = llct = tmpll = 0; if (file == NULL) { file = "stdin"; fd = STDIN_FILENO; @@ -168,8 +173,13 @@ cnt(const char *file) } charct += len; for (p = buf; len--; ++p) - if (*p == '\n') + if (*p == '\n') { + if (tmpll > llct) + llct = tmpll; + tmpll = 0; ++linect; + } else + tmpll++; } tlinect += linect; (void)printf(" %7ju", linect); @@ -177,6 +187,11 @@ cnt(const char *file) tcharct += charct; (void)printf(" %7ju", charct); } + if (dolongline) { + if (llct > tlongline) + tlongline = llct; + (void)printf(" %7ju", tlongline); + } (void)close(fd); return (0); } @@ -229,10 +244,16 @@ word: gotsp = 1; else if (clen == 0) clen = 1; charct++; + if (wch != L'\n') + tmpll++; len -= clen; p += clen; - if (wch == L'\n') + if (wch == L'\n') { + if (tmpll > llct) + llct = tmpll; + tmpll = 0; ++linect; + } if (iswspace(wch)) gotsp = 1; else if (gotsp) { @@ -256,6 +277,11 @@ word: gotsp = 1; tcharct += charct; (void)printf(" %7ju", charct); } + if (dolongline) { + if (llct > tlongline) + tlongline = llct; + (void)printf(" %7ju", llct); + } (void)close(fd); return (0); } @@ -263,6 +289,6 @@ word: gotsp = 1; static void usage() { - (void)fprintf(stderr, "usage: wc [-clmw] [file ...]\n"); + (void)fprintf(stderr, "usage: wc [-Lclmw] [file ...]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 04:57:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05F621065674; Thu, 15 Jan 2009 04:57:22 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E768B8FC1C; Thu, 15 Jan 2009 04:57:21 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F4vL6o065094; Thu, 15 Jan 2009 04:57:21 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F4vLO3065092; Thu, 15 Jan 2009 04:57:21 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150457.n0F4vLO3065092@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 04:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187286 - stable/6/usr.bin/wc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 04:57:22 -0000 Author: keramida (doc committer) Date: Thu Jan 15 04:57:21 2009 New Revision: 187286 URL: http://svn.freebsd.org/changeset/base/187286 Log: MFC 185714 from /head Add a -L option to wc(1), for finger compatibility with the GNU wc utility. The -L option can be used to report the length of the longest line wc has seen in one or more files. It is disabled by default, and wc uses the standard `-lwc'. Submitted by: Sheldon Givens, sheldon at sigsegv.ca Modified: stable/6/usr.bin/wc/ (props changed) stable/6/usr.bin/wc/wc.1 stable/6/usr.bin/wc/wc.c Modified: stable/6/usr.bin/wc/wc.1 ============================================================================== --- stable/6/usr.bin/wc/wc.1 Thu Jan 15 04:54:43 2009 (r187285) +++ stable/6/usr.bin/wc/wc.1 Thu Jan 15 04:57:21 2009 (r187286) @@ -35,7 +35,7 @@ .\" @(#)wc.1 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 23, 2005 +.Dd December 6, 2008 .Dt WC 1 .Os .Sh NAME @@ -43,7 +43,7 @@ .Nd word, line, character, and byte count .Sh SYNOPSIS .Nm -.Op Fl clmw +.Op Fl Lclmw .Op Ar .Sh DESCRIPTION The @@ -71,6 +71,15 @@ the last file. .Pp The following options are available: .Bl -tag -width Ds +.It Fl L +The number of characters in the longest input line +is written to the standard output. +When more then one +.Ar file +argument is specified, the longest input line of +.Em all +files is reported as the value of the final +.Dq total . .It Fl c The number of bytes in each input file is written to the standard output. @@ -129,6 +138,10 @@ and as well as the totals for both: .Pp .Dl "wc -mlw report1 report2" +.Pp +Find the longest line in a list of files: +.Pp +.Dl "wc -L file1 file2 file3 | fgrep total" .Sh COMPATIBILITY Historically, the .Nm @@ -149,6 +162,16 @@ This implementation defines a ``word'' i .Xr iswspace 3 function, as required by .St -p1003.2 . +.Pp +The +.Fl L +option is a non-standard +.Fx +extension, compatible with the +.Fl L +option of the GNU +.Nm +utility. .Sh SEE ALSO .Xr iswspace 3 .Sh STANDARDS Modified: stable/6/usr.bin/wc/wc.c ============================================================================== --- stable/6/usr.bin/wc/wc.c Thu Jan 15 04:54:43 2009 (r187285) +++ stable/6/usr.bin/wc/wc.c Thu Jan 15 04:57:21 2009 (r187286) @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include -uintmax_t tlinect, twordct, tcharct; -int doline, doword, dochar, domulti; +uintmax_t tlinect, twordct, tcharct, tlongline; +int doline, doword, dochar, domulti, dolongline; static int cnt(const char *); static void usage(void); @@ -75,7 +75,7 @@ main(int argc, char *argv[]) (void) setlocale(LC_CTYPE, ""); - while ((ch = getopt(argc, argv, "clmw")) != -1) + while ((ch = getopt(argc, argv, "clmwL")) != -1) switch((char)ch) { case 'l': doline = 1; @@ -87,6 +87,9 @@ main(int argc, char *argv[]) dochar = 1; domulti = 0; break; + case 'L': + dolongline = 1; + break; case 'm': domulti = 1; dochar = 0; @@ -99,7 +102,7 @@ main(int argc, char *argv[]) argc -= optind; /* Wc's flags are on by default. */ - if (doline + doword + dochar + domulti == 0) + if (doline + doword + dochar + domulti + dolongline == 0) doline = doword = dochar = 1; errors = 0; @@ -125,6 +128,8 @@ main(int argc, char *argv[]) (void)printf(" %7ju", twordct); if (dochar || domulti) (void)printf(" %7ju", tcharct); + if (dolongline) + (void)printf(" %7ju", tlongline); (void)printf(" total\n"); } exit(errors == 0 ? 0 : 1); @@ -134,7 +139,7 @@ static int cnt(const char *file) { struct stat sb; - uintmax_t linect, wordct, charct; + uintmax_t linect, wordct, charct, llct, tmpll; int fd, len, warned; size_t clen; short gotsp; @@ -143,7 +148,7 @@ cnt(const char *file) wchar_t wch; mbstate_t mbs; - linect = wordct = charct = 0; + linect = wordct = charct = llct = tmpll = 0; if (file == NULL) { file = "stdin"; fd = STDIN_FILENO; @@ -168,8 +173,13 @@ cnt(const char *file) } charct += len; for (p = buf; len--; ++p) - if (*p == '\n') + if (*p == '\n') { + if (tmpll > llct) + llct = tmpll; + tmpll = 0; ++linect; + } else + tmpll++; } tlinect += linect; (void)printf(" %7ju", linect); @@ -177,6 +187,11 @@ cnt(const char *file) tcharct += charct; (void)printf(" %7ju", charct); } + if (dolongline) { + if (llct > tlongline) + tlongline = llct; + (void)printf(" %7ju", tlongline); + } (void)close(fd); return (0); } @@ -229,10 +244,16 @@ word: gotsp = 1; else if (clen == 0) clen = 1; charct++; + if (wch != L'\n') + tmpll++; len -= clen; p += clen; - if (wch == L'\n') + if (wch == L'\n') { + if (tmpll > llct) + llct = tmpll; + tmpll = 0; ++linect; + } if (iswspace(wch)) gotsp = 1; else if (gotsp) { @@ -256,6 +277,11 @@ word: gotsp = 1; tcharct += charct; (void)printf(" %7ju", charct); } + if (dolongline) { + if (llct > tlongline) + tlongline = llct; + (void)printf(" %7ju", llct); + } (void)close(fd); return (0); } @@ -263,6 +289,6 @@ word: gotsp = 1; static void usage() { - (void)fprintf(stderr, "usage: wc [-clmw] [file ...]\n"); + (void)fprintf(stderr, "usage: wc [-Lclmw] [file ...]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 05:01:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB4F106566B; Thu, 15 Jan 2009 05:01:29 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6738FC0A; Thu, 15 Jan 2009 05:01:29 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F51TPO065236; Thu, 15 Jan 2009 05:01:29 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F51To4065235; Thu, 15 Jan 2009 05:01:29 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150501.n0F51To4065235@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 05:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187287 - in stable/7/etc: . defaults periodic/weekly X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 05:01:30 -0000 Author: keramida (doc committer) Date: Thu Jan 15 05:01:29 2009 New Revision: 187287 URL: http://svn.freebsd.org/changeset/base/187287 Log: MFC 186916 from /head/etc The description of the various securelevels has moved to the security.7 manpage a while ago. Modified: stable/7/etc/ (props changed) stable/7/etc/defaults/rc.conf stable/7/etc/periodic/weekly/ (props changed) Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Thu Jan 15 04:57:21 2009 (r187286) +++ stable/7/etc/defaults/rc.conf Thu Jan 15 05:01:29 2009 (r187287) @@ -568,7 +568,7 @@ ldconfig_local_dirs="/usr/local/libdata/ ldconfig_local32_dirs="/usr/local/libdata/ldconfig32" # Local directories with 32-bit compatibility ldconfig # configuration files. -kern_securelevel_enable="NO" # kernel security level (see init(8)), +kern_securelevel_enable="NO" # kernel security level (see security(7)) kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure # Note that setting securelevel to 0 will result # in the system booting with securelevel set to 1, as From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 05:04:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CAA41065675; Thu, 15 Jan 2009 05:04:32 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5AF8FC23; Thu, 15 Jan 2009 05:04:32 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F54Wv9065334; Thu, 15 Jan 2009 05:04:32 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F54WiN065333; Thu, 15 Jan 2009 05:04:32 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200901150504.n0F54WiN065333@svn.freebsd.org> From: Giorgos Keramidas Date: Thu, 15 Jan 2009 05:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187288 - stable/7/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 05:04:33 -0000 Author: keramida (doc committer) Date: Thu Jan 15 05:04:31 2009 New Revision: 187288 URL: http://svn.freebsd.org/changeset/base/187288 Log: The description of the various securelevels has moved to the security.7 manpage a while ago. Noticed by: simon Modified: stable/7/share/man/man5/ (props changed) stable/7/share/man/man5/rc.conf.5 Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Thu Jan 15 05:01:29 2009 (r187287) +++ stable/7/share/man/man5/rc.conf.5 Thu Jan 15 05:04:31 2009 (r187288) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2008 +.Dd January 9, 2009 .Dt RC.CONF 5 .Os .Sh NAME @@ -3160,7 +3160,7 @@ The allowed range of ranges from \-1 (the compile time default) to 3 (the most secure). See -.Xr init 8 +.Xr security 7 for the list of possible security levels and their effect on system operation. .It Va sshd_program @@ -4021,6 +4021,7 @@ Default .Xr motd 5 , .Xr newsyslog.conf 5 , .Xr pf.conf 5 , +.Xr security 7 , .Xr accton 8 , .Xr amd 8 , .Xr apm 8 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 06:44:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9538F106566B; Thu, 15 Jan 2009 06:44:23 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82DA78FC19; Thu, 15 Jan 2009 06:44:23 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F6iNcf067264; Thu, 15 Jan 2009 06:44:23 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F6iMk9067257; Thu, 15 Jan 2009 06:44:22 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <200901150644.n0F6iMk9067257@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 15 Jan 2009 06:44:22 +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: r187289 - in head: . sys/netinet sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 06:44:24 -0000 Author: lstewart Date: Thu Jan 15 06:44:22 2009 New Revision: 187289 URL: http://svn.freebsd.org/changeset/base/187289 Log: Add TCP Appropriate Byte Counting (RFC 3465) support to kernel. The new behaviour is on by default, and can be disabled by setting the net.inet.tcp.rfc3465 sysctl to 0 to obtain previous behaviour. The patch changes struct tcpcb in sys/netinet/tcp_var.h which breaks the ABI. Bump __FreeBSD_version to 800061 accordingly. User space tools that rely on the size of struct tcpcb (e.g. sockstat) need to be recompiled. Reviewed by: rpaulo, gnn Approved by: gnn, kmacy (mentors) Sponsored by: FreeBSD Foundation Modified: head/UPDATING head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_var.h head/sys/netinet/vinet.h head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jan 15 05:04:31 2009 (r187288) +++ head/UPDATING Thu Jan 15 06:44:22 2009 (r187289) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090115: + TCP Appropriate Byte Counting (RFC 3465) support added to kernel. + New field in struct tcpcb breaks ABI, so bump __FreeBSD_version to + 800061. User space tools that rely on the size of struct tcpcb in + tcp_var.h (e.g. sockstat) need to be recompiled. + 20081225: ng_tty(4) module updated to match the new TTY subsystem. Due to API change, user-level applications must be updated. Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Jan 15 05:04:31 2009 (r187288) +++ head/sys/netinet/tcp_input.c Thu Jan 15 06:44:22 2009 (r187289) @@ -117,6 +117,8 @@ int tcp_insecure_rst; int tcp_do_autorcvbuf; int tcp_autorcvbuf_inc; int tcp_autorcvbuf_max; +int tcp_do_rfc3465; +int tcp_abc_l_var; #endif SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_tcp, TCPCTL_STATS, stats, @@ -144,6 +146,13 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet tcp_do_rfc3390, 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); +SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, + tcp_do_rfc3465, 0, + "Enable RFC 3465 (Appropriate Byte Counting)"); +SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_RW, + tcp_abc_l_var, 2, + "Cap the max cwnd increment during slow-start to this number of segments"); + SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN"); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_RW, tcp_do_ecn, 0, "TCP ECN support"); @@ -2293,20 +2302,59 @@ process_ACK: /* * When new data is acked, open the congestion window. - * If the window gives us less than ssthresh packets - * in flight, open exponentially (maxseg per packet). - * Otherwise open linearly: maxseg per window - * (maxseg^2 / cwnd per packet). - * If cwnd > maxseg^2, fix the cwnd increment at 1 byte - * to avoid capping cwnd (as suggested in RFC2581). + * Method depends on which congestion control state we're + * in (slow start or cong avoid) and if ABC (RFC 3465) is + * enabled. + * + * slow start: cwnd <= ssthresh + * cong avoid: cwnd > ssthresh + * + * slow start and ABC (RFC 3465): + * Grow cwnd exponentially by the amount of data + * ACKed capping the max increment per ACK to + * (abc_l_var * maxseg) bytes. + * + * slow start without ABC (RFC 2581): + * Grow cwnd exponentially by maxseg per ACK. + * + * cong avoid and ABC (RFC 3465): + * Grow cwnd linearly by maxseg per RTT for each + * cwnd worth of ACKed data. + * + * cong avoid without ABC (RFC 2581): + * Grow cwnd linearly by approximately maxseg per RTT using + * maxseg^2 / cwnd per ACK as the increment. + * If cwnd > maxseg^2, fix the cwnd increment at 1 byte to + * avoid capping cwnd. */ if ((!V_tcp_do_newreno && !(tp->t_flags & TF_SACK_PERMIT)) || !IN_FASTRECOVERY(tp)) { u_int cw = tp->snd_cwnd; u_int incr = tp->t_maxseg; - if (cw > tp->snd_ssthresh) - incr = max((incr * incr / cw), 1); - tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<snd_scale); + /* In congestion avoidance? */ + if (cw > tp->snd_ssthresh) { + if (V_tcp_do_rfc3465) { + tp->t_bytes_acked += acked; + if (tp->t_bytes_acked >= tp->snd_cwnd) + tp->t_bytes_acked -= cw; + else + incr = 0; + } + else + incr = max((incr * incr / cw), 1); + /* + * In slow-start with ABC enabled and no RTO in sight? + * (Must not use abc_l_var > 1 if slow starting after an + * RTO. On RTO, snd_nxt = snd_una, so the snd_nxt == + * snd_max check is sufficient to handle this). + */ + } else if (V_tcp_do_rfc3465 && + tp->snd_nxt == tp->snd_max) + incr = min(acked, + V_tcp_abc_l_var * tp->t_maxseg); + /* ABC is on by default, so (incr == 0) frequently. */ + if (incr > 0) + tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<snd_scale); } SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { @@ -2328,8 +2376,10 @@ process_ACK: tp->snd_recover = th->th_ack - 1; if ((V_tcp_do_newreno || (tp->t_flags & TF_SACK_PERMIT)) && IN_FASTRECOVERY(tp) && - SEQ_GEQ(th->th_ack, tp->snd_recover)) + SEQ_GEQ(th->th_ack, tp->snd_recover)) { EXIT_FASTRECOVERY(tp); + tp->t_bytes_acked = 0; + } tp->snd_una = th->th_ack; if (tp->t_flags & TF_SACK_PERMIT) { if (SEQ_GT(tp->snd_una, tp->snd_recover)) Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Jan 15 05:04:31 2009 (r187288) +++ head/sys/netinet/tcp_subr.c Thu Jan 15 06:44:22 2009 (r187289) @@ -316,6 +316,8 @@ tcp_init(void) V_tcp_do_autorcvbuf = 1; V_tcp_autorcvbuf_inc = 16*1024; V_tcp_autorcvbuf_max = 256*1024; + V_tcp_do_rfc3465 = 1; + V_tcp_abc_l_var = 2; V_tcp_mssdflt = TCP_MSS; #ifdef INET6 Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Thu Jan 15 05:04:31 2009 (r187288) +++ head/sys/netinet/tcp_timer.c Thu Jan 15 06:44:22 2009 (r187289) @@ -587,6 +587,7 @@ tcp_timer_rexmt(void * xtp) tp->t_dupacks = 0; } EXIT_FASTRECOVERY(tp); + tp->t_bytes_acked = 0; (void) tcp_output(tp); out: Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Jan 15 05:04:31 2009 (r187288) +++ head/sys/netinet/tcp_var.h Thu Jan 15 06:44:22 2009 (r187289) @@ -189,6 +189,7 @@ struct tcpcb { void *t_pspare[3]; /* toe usrreqs / toepcb * / congestion algo / vimage / 1 general use */ struct toe_usrreqs *t_tu; /* offload operations vector */ void *t_toe; /* TOE pcb pointer */ + int t_bytes_acked; /* # bytes acked during current RTT */ }; /* Modified: head/sys/netinet/vinet.h ============================================================================== --- head/sys/netinet/vinet.h Thu Jan 15 05:04:31 2009 (r187288) +++ head/sys/netinet/vinet.h Thu Jan 15 06:44:22 2009 (r187289) @@ -127,6 +127,8 @@ struct vnet_inet { int _drop_synfin; int _tcp_do_rfc3042; int _tcp_do_rfc3390; + int _tcp_do_rfc3465; + int _tcp_abc_l_var; int _tcp_do_ecn; int _tcp_ecn_maxretries; int _tcp_insecure_rst; @@ -291,6 +293,7 @@ extern struct vnet_inet vnet_inet_0; #define V_subnetsarelocal VNET_INET(subnetsarelocal) #define V_tcb VNET_INET(tcb) #define V_tcbinfo VNET_INET(tcbinfo) +#define V_tcp_abc_l_var VNET_INET(tcp_abc_l_var) #define V_tcp_autorcvbuf_inc VNET_INET(tcp_autorcvbuf_inc) #define V_tcp_autorcvbuf_max VNET_INET(tcp_autorcvbuf_max) #define V_tcp_autosndbuf_inc VNET_INET(tcp_autosndbuf_inc) @@ -303,6 +306,7 @@ extern struct vnet_inet vnet_inet_0; #define V_tcp_do_rfc1323 VNET_INET(tcp_do_rfc1323) #define V_tcp_do_rfc3042 VNET_INET(tcp_do_rfc3042) #define V_tcp_do_rfc3390 VNET_INET(tcp_do_rfc3390) +#define V_tcp_do_rfc3465 VNET_INET(tcp_do_rfc3465) #define V_tcp_do_sack VNET_INET(tcp_do_sack) #define V_tcp_do_tso VNET_INET(tcp_do_tso) #define V_tcp_ecn_maxretries VNET_INET(tcp_ecn_maxretries) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Jan 15 05:04:31 2009 (r187288) +++ head/sys/sys/param.h Thu Jan 15 06:44:22 2009 (r187289) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800060 /* Master, propagated to newvers */ +#define __FreeBSD_version 800061 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 06:55:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A909106564A; Thu, 15 Jan 2009 06:55:00 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDB868FC16; Thu, 15 Jan 2009 06:54:59 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F6sxnx067468; Thu, 15 Jan 2009 06:54:59 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F6sxv6067467; Thu, 15 Jan 2009 06:54:59 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200901150654.n0F6sxv6067467@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 15 Jan 2009 06:54: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: r187290 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 06:55:00 -0000 Author: rodrigc Date: Thu Jan 15 06:54:59 2009 New Revision: 187290 URL: http://svn.freebsd.org/changeset/base/187290 Log: Revert previous change, since revision 187103 fixed the problem. So now, if you: - specify "makeoptions DEBUG=-g" in your kernel config - make buildkernel WITH_CTF=1, then "-g" will be added to CTFFLAGS. However, "-g" will still not be added to CTFFLAGS when building kernel modules, if the above steps are performed. This needs to be fixed. Noticed by: thompsa Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Jan 15 06:44:22 2009 (r187289) +++ head/sys/conf/kern.pre.mk Thu Jan 15 06:54:59 2009 (r187290) @@ -129,7 +129,7 @@ NORMAL_M= ${AWK} -f $S/tools/makeobjops. ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c .if defined(CTFCONVERT) -NORMAL_CTFCONVERT= ${CTFCONVERT} ${DEBUG} ${CTFFLAGS} ${.TARGET} +NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .else NORMAL_CTFCONVERT= .endif @@ -143,7 +143,7 @@ SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} SYSTEM_OBJS+= hack.So .if defined(CTFMERGE) -SYSTEM_CTFMERGE= ${CTFMERGE} ${DEBUG} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o +SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o LD+= -g .endif SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \ From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 07:11:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95D751065672; Thu, 15 Jan 2009 07:11:14 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 851BF8FC13; Thu, 15 Jan 2009 07:11:14 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F7BEFG067810; Thu, 15 Jan 2009 07:11:14 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F7BEQn067808; Thu, 15 Jan 2009 07:11:14 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200901150711.n0F7BEQn067808@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 15 Jan 2009 07:11: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: r187291 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 07:11:15 -0000 Author: weongyo Date: Thu Jan 15 07:11:14 2009 New Revision: 187291 URL: http://svn.freebsd.org/changeset/base/187291 Log: fix a ehci's bug that it's occurred when the xfers are aborted under heavy loads or working. It looks this bug exists since r158869 so needs to revert a part of the previous. Reviewed by: imp Tested by: sam MFC after: 3 weeks Modified: head/sys/dev/usb/ehci.c Modified: head/sys/dev/usb/ehci.c ============================================================================== --- head/sys/dev/usb/ehci.c Thu Jan 15 06:54:59 2009 (r187290) +++ head/sys/dev/usb/ehci.c Thu Jan 15 07:11:14 2009 (r187291) @@ -2769,7 +2769,7 @@ ehci_abort_xfer(usbd_xfer_handle xfer, u /* We will change them to point here */ snext = exfer->sqtdend->nextqtd; - next = htohc32(sc, snext->physaddr); + next = (snext != NULL) ? htohc32(sc, snext->physaddr) : EHCI_NULL(sc); /* * Now loop through any qTDs before us and keep track of the pointer From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 07:45:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72DE7106564A; Thu, 15 Jan 2009 07:45:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6215B8FC14; Thu, 15 Jan 2009 07:45:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F7jeY3068425; Thu, 15 Jan 2009 07:45:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F7jeEe068424; Thu, 15 Jan 2009 07:45:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901150745.n0F7jeEe068424@svn.freebsd.org> From: Warner Losh Date: Thu, 15 Jan 2009 07:45:40 +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: r187292 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 07:45:40 -0000 Author: imp Date: Thu Jan 15 07:45:40 2009 New Revision: 187292 URL: http://svn.freebsd.org/changeset/base/187292 Log: MFp4: Remove #if'd 0 code. It is interfering with other diffs. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Thu Jan 15 07:11:14 2009 (r187291) +++ head/sys/mips/mips/machdep.c Thu Jan 15 07:45:40 2009 (r187292) @@ -82,9 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if 0 -#include -#endif #include #include #include @@ -104,10 +101,6 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, static char cpu_model[30]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); -#if 0 /* see comment below */ -static void getmemsize(void); -#endif - int cold = 1; int Maxmem; long realmem = 0; @@ -294,116 +287,6 @@ mips_proc0_init(void) struct msgbuf *msgbufp=0; -#if 0 -/* - * This code has been moved to the platform_init code. The only - * thing that's beign done here that hasn't been moved is the wired tlb - * pool stuff. I'm still trying to understand that feature..., since - * it maps from the end the kernel to 0x08000000 somehow. But the stuff - * was stripped out, so it is hard to say what's going on.... - */ -u_int32_t freemem_start; - -static void -getmemsize() -{ - vm_offset_t kern_start, kern_end; - vm_offset_t AllowMem, memsize; - const char *cp; - size_t sz; - int phys_avail_cnt; - - /* Determine memory layout */ - phys_avail_cnt = 0; - kern_start = mips_trunc_page(MIPS_CACHED_TO_PHYS(btext)); - if (kern_start < freemem_start) -panic("kernel load address too low, overlapping with memory reserved for FPC IPC\n"); - - if (kern_start > freemem_start) { - phys_avail[phys_avail_cnt++] = freemem_start; - /* - * Since the stack is setup just before kern_start, - * leave some space for stack to grow - */ - phys_avail[phys_avail_cnt++] = kern_start - PAGE_SIZE * 3; - MIPS_DEBUG_PRINT("phys_avail : %p - %p", \ - phys_avail[phys_avail_cnt-2], phys_avail[phys_avail_cnt-1]); - } - - kern_end = (vm_offset_t) end; - kern_end = (vm_offset_t) mips_round_page(kern_end); - MIPS_DEBUG_PRINT("kern_start : 0x%x, kern_end : 0x%x", btext, kern_end); - phys_avail[phys_avail_cnt++] = MIPS_CACHED_TO_PHYS(kern_end); - - if (need_wired_tlb_page_pool) { - mips_wired_tlb_physmem_start = MIPS_CACHED_TO_PHYS(kern_end); - mips_wired_tlb_physmem_end = 0x08000000; - MIPS_DEBUG_PRINT("%s: unmapped page start [0x%x] end[0x%x]\n",\ - __FUNCTION__, mips_wired_tlb_physmem_start, \ - mips_wired_tlb_physmem_end); - if (mips_wired_tlb_physmem_start > mips_wired_tlb_physmem_end) - panic("Error in Page table page physical address assignment\n"); - } - - if (bootinfo.bi_memsizes_valid) - memsize = bootinfo.bi_basemem * 1024; - else { - memsize = SDRAM_MEM_SIZE; - } - - /* - * hw.physmem is a size in bytes; we also allow k, m, and g suffixes - * for the appropriate modifiers. - */ - if ((cp = getenv("hw.physmem")) != NULL) { - vm_offset_t sanity; - char *ep; - - sanity = AllowMem = strtouq(cp, &ep, 0); - if ((ep != cp) && (*ep != 0)) { - switch(*ep) { - case 'g': - case 'G': - AllowMem <<= 10; - case 'm': - case 'M': - AllowMem <<= 10; - case 'k': - case 'K': - AllowMem <<= 10; - break; - default: - AllowMem = sanity = 0; - } - if (AllowMem < sanity) - AllowMem = 0; - } - if (!AllowMem || (AllowMem < (kern_end - KERNBASE))) - printf("Ignoring invalid hw.physmem size of '%s'\n", cp); - } else - AllowMem = 0; - - if (AllowMem) - memsize = (memsize > AllowMem) ? AllowMem : memsize; - - phys_avail[phys_avail_cnt++] = SDRAM_ADDR_START + memsize; - MIPS_DEBUG_PRINT("phys_avail : 0x%x - 0x%x", \ - phys_avail[phys_avail_cnt-2], phys_avail[phys_avail_cnt-1]); - phys_avail[phys_avail_cnt] = 0; - - physmem = btoc(memsize); - Maxmem = physmem; - - /* - * Initialize error message buffer (at high end of memory). - */ - sz = round_page(MSGBUF_SIZE); - msgbufp = (struct msgbuf *) pmap_steal_memory(sz); - msgbufinit(msgbufp, sz); - printf("%s: msgbufp[size=%d] = 0x%p\n", __FUNCTION__, sz, msgbufp); -} -#endif - /* * Initialize the hardware exception vectors, and the jump table used to * call locore cache and TLB management functions, based on the kind From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 07:48:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49B86106564A; Thu, 15 Jan 2009 07:48:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3916A8FC19; Thu, 15 Jan 2009 07:48:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F7mbJX068509; Thu, 15 Jan 2009 07:48:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F7mbAY068508; Thu, 15 Jan 2009 07:48:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901150748.n0F7mbAY068508@svn.freebsd.org> From: Warner Losh Date: Thu, 15 Jan 2009 07:48:37 +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: r187293 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 07:48:39 -0000 Author: imp Date: Thu Jan 15 07:48:37 2009 New Revision: 187293 URL: http://svn.freebsd.org/changeset/base/187293 Log: Reverse order of dumpsys and cpu_idle_wakeup to reduce diffs to p4. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Thu Jan 15 07:45:40 2009 (r187292) +++ head/sys/mips/mips/machdep.c Thu Jan 15 07:48:37 2009 (r187293) @@ -418,16 +418,16 @@ cpu_idle(int busy) panic("ints disabled in idleproc!"); } -int -cpu_idle_wakeup(int cpu) +void +dumpsys(struct dumperinfo *di __unused) { - return (0); + printf("Kernel dumps not implemented on this architecture\n"); } -void -dumpsys(struct dumperinfo *di __unused) +int +cpu_idle_wakeup(int cpu) { - printf("Kernel dumps not implemented on this architecture\n"); + return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 07:51:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65671065672; Thu, 15 Jan 2009 07:51:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D62F18FC0C; Thu, 15 Jan 2009 07:51:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F7pHpj068594; Thu, 15 Jan 2009 07:51:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F7pHC0068593; Thu, 15 Jan 2009 07:51:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901150751.n0F7pHC0068593@svn.freebsd.org> From: Warner Losh Date: Thu, 15 Jan 2009 07:51:17 +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: r187294 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 07:51:18 -0000 Author: imp Date: Thu Jan 15 07:51:17 2009 New Revision: 187294 URL: http://svn.freebsd.org/changeset/base/187294 Log: Call platform_reset() instead of looping forever on reboot. # We likely need to have a default one of these that jumps to the rom boot # address that's defined in the MIPS ISA. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Thu Jan 15 07:48:37 2009 (r187293) +++ head/sys/mips/mips/machdep.c Thu Jan 15 07:51:17 2009 (r187294) @@ -198,8 +198,8 @@ cpu_startup(void *dummy) void cpu_reset(void) { - for (;;) - ; + + platform_reset(); } /* Get current clock frequency for the given cpu id. */ @@ -207,7 +207,7 @@ int cpu_est_clockrate(int cpu_id, uint64_t *rate) { - return (ENXIO); + return (ENXIO); } /* From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 08:01:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D5DE1065670; Thu, 15 Jan 2009 08:01:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CF268FC08; Thu, 15 Jan 2009 08:01:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F81ovg068843; Thu, 15 Jan 2009 08:01:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F81o2e068842; Thu, 15 Jan 2009 08:01:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901150801.n0F81o2e068842@svn.freebsd.org> From: Warner Losh Date: Thu, 15 Jan 2009 08:01: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: r187295 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 08:01:51 -0000 Author: imp Date: Thu Jan 15 08:01:50 2009 New Revision: 187295 URL: http://svn.freebsd.org/changeset/base/187295 Log: MFp4: Remove Maxmem. It isn't used elsewhere in the system at this point... realmem is used instead. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Thu Jan 15 07:51:17 2009 (r187294) +++ head/sys/mips/mips/machdep.c Thu Jan 15 08:01:50 2009 (r187295) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef DDB #include #include @@ -102,7 +103,6 @@ static char cpu_model[30]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); int cold = 1; -int Maxmem; long realmem = 0; int cpu_clock = MIPS_DEFAULT_HZ; SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, @@ -157,14 +157,9 @@ cpu_startup(void *dummy) if (boothowto & RB_VERBOSE) bootverbose++; + printf("real memory = %lu (%luK bytes)\n", ptoa(realmem), ptoa(realmem) / 1024); /* - * Good {morning,afternoon,evening,night}. - */ - printf("real memory = %lu (%luK bytes)\n", ptoa(Maxmem), - ptoa(Maxmem) / 1024); - realmem = Maxmem; - /* * Display any holes after the first chunk of extended memory. */ if (bootverbose) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 09:12:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81311106572F; Thu, 15 Jan 2009 09:12:42 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55D498FC1D; Thu, 15 Jan 2009 09:12:42 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0F9CgXs070259; Thu, 15 Jan 2009 09:12:42 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0F9Cg7e070258; Thu, 15 Jan 2009 09:12:42 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200901150912.n0F9Cg7e070258@svn.freebsd.org> From: Philip Paeps Date: Thu, 15 Jan 2009 09:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187296 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 09:12:43 -0000 Author: philip Date: Thu Jan 15 09:12:41 2009 New Revision: 187296 URL: http://svn.freebsd.org/changeset/base/187296 Log: Restore Martin Cracauer's src commit bit per his request to core. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Jan 15 08:01:50 2009 (r187295) +++ svnadmin/conf/access Thu Jan 15 09:12:41 2009 (r187296) @@ -43,6 +43,7 @@ charnier cognet cokane cperciva +cracauer csjp daichi darrenr From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 09:20:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A71A106566B; Thu, 15 Jan 2009 09:20:14 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail.asahi-net.or.jp (mail2.asahi-net.or.jp [202.224.39.198]) by mx1.freebsd.org (Postfix) with ESMTP id 0BDB38FC17; Thu, 15 Jan 2009 09:20:13 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from localhost (pool-70-20-243-115.phil.east.verizon.net [70.20.243.115]) by mail.asahi-net.or.jp (Postfix) with ESMTP id 17F3C67FB7; Thu, 15 Jan 2009 18:01:36 +0900 (JST) Date: Thu, 15 Jan 2009 04:00:04 -0500 From: Yoshihiro Ota To: "David E. O'Brien" Message-Id: <20090115040004.65e9f36e.ota@j.email.ne.jp> In-Reply-To: <200901130608.n0D68blf091810@svn.freebsd.org> References: <200901130608.n0D68blf091810@svn.freebsd.org> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.12.11; i386-portbld-freebsd7.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ota@j.email.ne.jp, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187130 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 09:20:14 -0000 While you are working on mount, can you take a look at this patch? http://lists.freebsd.org/pipermail/freebsd-current/2007-February/068980.html The problem is that all mount_XXX programs that are not in the base system fail; i.e. everything from the ports or all mount_XXX programs anyone creates out side of the base system. I am not sure what is happening with nmount(2) and mount(1) programs or if these file-system list are temporary or permanent. It will be nice if someone can give me a pointer or short summary on the plan for nmount(). Thanks, Hiro On Tue, 13 Jan 2009 06:08:37 +0000 (UTC) "David E. O'Brien" wrote: > Author: obrien > Date: Tue Jan 13 06:08:37 2009 > New Revision: 187130 > URL: http://svn.freebsd.org/changeset/base/187130 > > Log: > r187093 failed to keep the lifetime of the pointer suitable for reentrancy. > Fix that. Also move the current buffer size into the 'cpa' structure. > > Modified: > head/sbin/mount/mount.c From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 11:44:08 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 0E6031065673; Thu, 15 Jan 2009 11:44:08 +0000 (UTC) Date: Thu, 15 Jan 2009 11:44:08 +0000 From: Alexey Dokuchaev To: "M. Warner Losh" Message-ID: <20090115114407.GA67726@FreeBSD.org> References: <200901142232.n0EMWhGw055895@svn.freebsd.org> <20090115020752.52566769.stas@FreeBSD.org> <20090114.190527.1058804377.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20090114.190527.1058804377.imp@bsdimp.com> User-Agent: Mutt/1.4.2.1i Cc: stas@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, gonzo@FreeBSD.org Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 11:44:08 -0000 On Wed, Jan 14, 2009 at 07:05:27PM -0700, M. Warner Losh wrote: > In message: <20090115020752.52566769.stas@FreeBSD.org> > Stanislav Sedov writes: > : > + shift = 8 * (reg & 3); > : > > : > : Would it make sense to replace this with > : > + shift = (reg & 3) << 3; > : > : to not rely on possible compiler optimizations? > > I don't think that it matters all that much these days... But the name "shift" kinda suggests << instead of *, no? ./danfe From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 11:54:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E50241065676; Thu, 15 Jan 2009 11:54:31 +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 D22FE8FC19; Thu, 15 Jan 2009 11:54:31 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FBsVuc076356; Thu, 15 Jan 2009 11:54:31 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FBsV8Z076355; Thu, 15 Jan 2009 11:54:31 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200901151154.n0FBsV8Z076355@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 15 Jan 2009 11:54: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: r187297 - head/sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 11:54:34 -0000 Author: nyan Date: Thu Jan 15 11:54:31 2009 New Revision: 187297 URL: http://svn.freebsd.org/changeset/base/187297 Log: MFi386: 187144 Documentation-only change: - add a reference to the config(5) manpage; - hopefully clarify the format of the 'env FILENAME' directive. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Thu Jan 15 09:12:41 2009 (r187296) +++ head/sys/pc98/conf/GENERIC Thu Jan 15 11:54:31 2009 (r187297) @@ -1,8 +1,8 @@ # # GENERIC -- Generic kernel configuration file for FreeBSD/pc98 # -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # @@ -26,6 +26,12 @@ ident GENERIC # To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. +# Use the following to compile in values accessible to the kernel +# through getenv() (or kenv(1) in userland). The format of the file +# is 'variable=value', see kenv(1) +# +# env "GENERIC.env" + makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options SCHED_4BSD # 4BSD scheduler From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 11:58:19 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA65106570B for ; Thu, 15 Jan 2009 11:58:19 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 9C1038FC19 for ; Thu, 15 Jan 2009 11:58:18 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 15 Jan 2009 11:58:17 -0000 Received: from p54A3E43A.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.228.58] by mail.gmx.net (mp035) with SMTP; 15 Jan 2009 12:58:17 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+duycmTJGdrxeCrUrbNhF1W0hu4mDXJ0Bp3k3Wzy dxAE9i3gFKhiue Message-ID: <496F24D8.2040104@gmx.de> Date: Thu, 15 Jan 2009 12:58:16 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Alexey Dokuchaev References: <200901142232.n0EMWhGw055895@svn.freebsd.org> <20090115020752.52566769.stas@FreeBSD.org> <20090114.190527.1058804377.imp@bsdimp.com> <20090115114407.GA67726@FreeBSD.org> In-Reply-To: <20090115114407.GA67726@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.58 Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, stas@FreeBSD.org, gonzo@FreeBSD.org, svn-src-head@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 11:58:20 -0000 Alexey Dokuchaev schrieb: > On Wed, Jan 14, 2009 at 07:05:27PM -0700, M. Warner Losh wrote: >> In message: <20090115020752.52566769.stas@FreeBSD.org> >> Stanislav Sedov writes: >> : > + shift = 8 * (reg & 3); >> : > >> : >> : Would it make sense to replace this with >> : > + shift = (reg & 3) << 3; >> : >> : to not rely on possible compiler optimizations? >> >> I don't think that it matters all that much these days... > > But the name "shift" kinda suggests << instead of *, no? The value *is* a shift amount (see its uses a few lines down). Its name does not imply the way it is calculated, but what it is used for. BTW: Even the most cheap compilers emit shift instructions for multiplication by a power of two. The new code also is clearly faster then the old - quite some code gets generated for switches. From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 12:15:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92A80106591A; Thu, 15 Jan 2009 12:15:46 +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 80AC18FC1D; Thu, 15 Jan 2009 12:15:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FCFkqS076788; Thu, 15 Jan 2009 12:15:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FCFkrh076787; Thu, 15 Jan 2009 12:15:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901151215.n0FCFkrh076787@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 15 Jan 2009 12:15: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: r187298 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 12:15:47 -0000 Author: kib Date: Thu Jan 15 12:15:46 2009 New Revision: 187298 URL: http://svn.freebsd.org/changeset/base/187298 Log: Lock the semaphore identifier lock during semaphore initialization to guarantee atomicity of the operation for other semaphore consumers. In particular, this should guard against access to the semaphore with not done or partially done MAC label assignment. Reviewed by: rwatson MFC after: 1 month Modified: head/sys/kern/sysv_sem.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Thu Jan 15 11:54:31 2009 (r187297) +++ head/sys/kern/sysv_sem.c Thu Jan 15 12:15:46 2009 (r187298) @@ -914,6 +914,9 @@ semget(struct thread *td, struct semget_ goto done2; } DPRINTF(("semid %d is available\n", semid)); + mtx_lock(&sema_mtx[semid]); + KASSERT((sema[semid].u.sem_perm.mode & SEM_ALLOC) == 0, + ("Lost semaphore %d", semid)); sema[semid].u.sem_perm.key = key; sema[semid].u.sem_perm.cuid = cred->cr_uid; sema[semid].u.sem_perm.uid = cred->cr_uid; @@ -932,6 +935,7 @@ semget(struct thread *td, struct semget_ #ifdef MAC mac_sysvsem_create(cred, &sema[semid]); #endif + mtx_unlock(&sema_mtx[semid]); DPRINTF(("sembase = %p, next = %p\n", sema[semid].u.sem_base, &sem[semtot])); } else { From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 15:46:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C4E4106566B; Thu, 15 Jan 2009 15:46:12 +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 3B8928FC0C; Thu, 15 Jan 2009 15:46:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id AE57746B06; Thu, 15 Jan 2009 10:46:11 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FFk56v001666; Thu, 15 Jan 2009 10:46:05 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ken Smith Date: Thu, 15 Jan 2009 09:21:11 -0500 User-Agent: KMail/1.9.7 References: <200901011055.n01AtQaN052763@svn.freebsd.org> <495DB7DF.5020603@FreeBSD.org> <1230879509.12517.7.camel@neo.cse.buffalo.edu> In-Reply-To: <1230879509.12517.7.camel@neo.cse.buffalo.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901150921.12531.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 10:46:05 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn: head/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 15:46:12 -0000 On Friday 02 January 2009 1:58:29 am Ken Smith wrote: > On Thu, 2009-01-01 at 22:44 -0800, Maxim Sobolev wrote: > > Doug Barton wrote: > > > Given that this is a situation that comes up very infrequently > > > (usually only for a major version upgrade) and can usually be handled > > > simply enough on a one-off basis, I will once again point out that I > > > think this is a Bad Idea. I would be willing to consider a better > > > implementation as an option that is off by default. > > > > You are very wrong on this. This situation happens very *frequently* > > even for updates between minor releases (such as 6.3 to 6.4 and so on). > > As somebody doing lot of source upgrades frequently I can tell you this > > for sure. > > > > -Maxim > > Just FWIW... > > What triggers it is creating a new branch tag. At the point we create a > new releng/ in svn I need to have created the corresponding > branch tag in the CVS repository first (e.g. RELENG_7_1 for releng/7.1). > But then the svn2cvs exporter proceeds to check every file from > releng/7.1 in to RELENG_7_1. > > So, you notice it the first time you try to upgrade into a new branch. > Once you're in the branch updates get handled as you'd expect, just > updating any of the files that have changed since the branch got > created. And it doesn't happen with for example the tags that get > created for the release (e.g. RELENG_7_1_0_RELEASE) which are "normal > tags" as opposed to "branch tags". The exporter ignores the release/ > tree in svn. It would be really nice if we could fix the CVS importer to not work this way somehow. Maybe it could just ignore the 'cp' instead of doing a checkin somehow? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 15:46:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 639AB10657C7; Thu, 15 Jan 2009 15:46:34 +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 352068FC19; Thu, 15 Jan 2009 15:46:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id D85E046B06; Thu, 15 Jan 2009 10:46:33 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FFk571001666; Thu, 15 Jan 2009 10:46:28 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Konstantin Belousov Date: Thu, 15 Jan 2009 10:13:37 -0500 User-Agent: KMail/1.9.7 References: <200812301251.mBUCpFr9093818@svn.freebsd.org> In-Reply-To: <200812301251.mBUCpFr9093818@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901151013.37934.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 10:46:28 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186600 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 15:46:35 -0000 On Tuesday 30 December 2008 7:51:15 am Konstantin Belousov wrote: > Author: kib > Date: Tue Dec 30 12:51:14 2008 > New Revision: 186600 > URL: http://svn.freebsd.org/changeset/base/186600 > > Log: > In r185557, the check for existing negative entry for the given name > did not compared nc_dvp with supplied parent directory vnode pointer. > Add the check and note that now branches for vp != NULL and vp == NULL > are the same, thus can be merged. The only thing I would worry about here is that the hash list may be longer than v_cache_dst in the common case. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 15:46:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 641CC106594A; Thu, 15 Jan 2009 15:46:40 +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 E320C8FC20; Thu, 15 Jan 2009 15:46:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 91C5046B23; Thu, 15 Jan 2009 10:46:39 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FFk572001666; Thu, 15 Jan 2009 10:46:33 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Konstantin Belousov Date: Thu, 15 Jan 2009 10:14:50 -0500 User-Agent: KMail/1.9.7 References: <200812301251.mBUCpuUk093863@svn.freebsd.org> In-Reply-To: <200812301251.mBUCpuUk093863@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901151014.51241.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 10:46:33 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186601 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 15:46:43 -0000 On Tuesday 30 December 2008 7:51:56 am Konstantin Belousov wrote: > Author: kib > Date: Tue Dec 30 12:51:56 2008 > New Revision: 186601 > URL: http://svn.freebsd.org/changeset/base/186601 > > Log: > Clear the pointers to the file in the struct filedesc before file is > closed in fdfree. Otherwise, sysctl_kern_proc_filedesc may dereference > stale struct file * values. Good catch! This may fix many panics I saw at Yahoo. The fact that this code didn't clear the file pointers to NULL used to bother me, but I could never put my finger on exactly why. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 15:46:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4CB10656DB; Thu, 15 Jan 2009 15:46:45 +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 ADF048FC1B; Thu, 15 Jan 2009 15:46:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 5BDA146B59; Thu, 15 Jan 2009 10:46:45 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FFk573001666; Thu, 15 Jan 2009 10:46:39 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Nathan Whitehorn Date: Thu, 15 Jan 2009 10:29:26 -0500 User-Agent: KMail/1.9.7 References: <200901061723.n06HNbgY037287@svn.freebsd.org> In-Reply-To: <200901061723.n06HNbgY037287@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901151029.27357.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 10:46:39 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186833 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 15:46:48 -0000 On Tuesday 06 January 2009 12:23:37 pm Nathan Whitehorn wrote: > Modified: head/sys/dev/iicbus/iic.c > =========================================================================== >=== --- head/sys/dev/iicbus/iic.c Tue Jan 6 17:05:44 2009 (r186832) > +++ head/sys/dev/iicbus/iic.c Tue Jan 6 17:23:37 2009 (r186833) > @@ -110,14 +110,14 @@ iic_identify(driver_t *driver, device_t > { > > if (device_find_child(parent, "iic", -1) == NULL) > - BUS_ADD_CHILD(parent, 0, "iic", -1); > + BUS_ADD_CHILD(parent, 0, "iic", 0); > } This change is wrong, it always tries to add iic0 instead of letting new-bus pick the unit number. Basically, if you have a system with iicbus0 and iicbus1, this will try to add a second iic0 child to iicbus1 instead of iic1. Please revert. > Modified: head/sys/dev/iicbus/iicbus.c > =========================================================================== >=== --- head/sys/dev/iicbus/iicbus.c Tue Jan 6 17:05:44 2009 (r186832) +++ > head/sys/dev/iicbus/iicbus.c Tue Jan 6 17:23:37 2009 (r186833) @@ -53,7 > +53,9 @@ iicbus_probe(device_t dev) > { > > device_set_desc(dev, "Philips I2C bus"); > - return (0); > + > + /* Allow other subclasses to override this driver. */ > + return (-1000); I think BUS_PROBE_GENERIC is what you want here. pci(4) probably needs to be updated to use BUS_PROBE_GENERIC as well (which is what you copied this from I'm guessing). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 15:46:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3171B1065889; Thu, 15 Jan 2009 15:46:51 +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 8BBBD8FC13; Thu, 15 Jan 2009 15:46:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 38B1746B23; Thu, 15 Jan 2009 10:46:51 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FFk574001666; Thu, 15 Jan 2009 10:46:45 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marius Strobl Date: Thu, 15 Jan 2009 10:31:42 -0500 User-Agent: KMail/1.9.7 References: <200901072152.n07Lql7h000807@svn.freebsd.org> In-Reply-To: <200901072152.n07Lql7h000807@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901151031.42725.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 10:46:45 -0500 (EST) X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186878 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 15:46:54 -0000 On Wednesday 07 January 2009 4:52:47 pm Marius Strobl wrote: > Author: marius > Date: Wed Jan 7 21:52:47 2009 > New Revision: 186878 > URL: http://svn.freebsd.org/changeset/base/186878 > > Log: > Make the whole initiator mode part of mpt(4) endian-clean, > specifically SPI controllers now also work in big-endian > machines and some conversions relevant for FC and SAS > controllers as well as support for ILP32 machines which all > were omitted in previous attempts are now also implemented. > The IOCTL-interface is intentionally left (and where needed > actually changed) to be completely little-endian as otherwise > we would have to add conversion code for every possible > configuration page to mpt(4), which didn't seem the right > thing to do, neither did converting only half of the user- > interface to the native byte order. > This change was tested on amd64 (SAS+SPI), i386 (SAS) and > sparc64 (SAS+SPI). Due to lack of the necessary hardware > the target mode code is still left to be made endian-clean. > > Reviewed by: scottl > MFC after: 1 month If you wish to test the mpt_user interface on a big-endian machine you may use //depot/jhb/raid/usr.sbin/mptutil/... It is likely going to need a lot of sprinkled htole*() and letoh*() though. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 16:04:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3BD310656CE; Thu, 15 Jan 2009 16:04:11 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B141A8FC12; Thu, 15 Jan 2009 16:04:11 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FG4BMA081031; Thu, 15 Jan 2009 16:04:11 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FG4Bof081030; Thu, 15 Jan 2009 16:04:11 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <200901151604.n0FG4Bof081030@svn.freebsd.org> From: Takanori Watanabe Date: Thu, 15 Jan 2009 16:04:11 +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: r187299 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 16:04:12 -0000 Author: takawata Date: Thu Jan 15 16:04:11 2009 New Revision: 187299 URL: http://svn.freebsd.org/changeset/base/187299 Log: Name the items of xfer array. Modified: head/sys/dev/usb2/serial/ufoma2.c Modified: head/sys/dev/usb2/serial/ufoma2.c ============================================================================== --- head/sys/dev/usb2/serial/ufoma2.c Thu Jan 15 12:15:46 2009 (r187298) +++ head/sys/dev/usb2/serial/ufoma2.c Thu Jan 15 16:04:11 2009 (r187299) @@ -143,8 +143,21 @@ typedef struct ufoma_mobile_acm_descript #define UFOMA_BULK_BUF_SIZE 1024 /* bytes */ -#define UFOMA_CTRL_ENDPT_MAX 4 /* units */ -#define UFOMA_BULK_ENDPT_MAX 4 /* units */ +enum { + UFOMA_CTRL_ENDPT_INTR, + UFOMA_CTRL_ENDPT_INTR_CLEAR, + UFOMA_CTRL_ENDPT_READ, + UFOMA_CTRL_ENDPT_WRITE, + UFOMA_CTRL_ENDPT_MAX = 4, +}; + +enum { + UFOMA_BULK_ENDPT_WRITE, + UFOMA_BULK_ENDPT_READ, + UFOMA_BULK_ENDPT_WRITE_CLEAR, + UFOMA_BULK_ENDPT_READ_CLEAR, + UFOMA_BULK_ENDPT_MAX = 4, +}; struct ufoma_softc { struct usb2_com_super_softc sc_super_ucom; @@ -227,7 +240,7 @@ static int ufoma_sysctl_open(SYSCTL_HAND static const struct usb2_config ufoma_ctrl_config[UFOMA_CTRL_ENDPT_MAX] = { - [0] = { + [UFOMA_CTRL_ENDPT_INTR] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -236,7 +249,7 @@ static const struct usb2_config .mh.callback = &ufoma_intr_callback, }, - [1] = { + [UFOMA_CTRL_ENDPT_INTR_CLEAR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -247,7 +260,7 @@ static const struct usb2_config .mh.interval = 50, /* 50ms */ }, - [2] = { + [UFOMA_CTRL_ENDPT_READ] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -257,7 +270,7 @@ static const struct usb2_config .mh.timeout = 1000, /* 1 second */ }, - [3] = { + [UFOMA_CTRL_ENDPT_WRITE] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -271,7 +284,7 @@ static const struct usb2_config static const struct usb2_config ufoma_bulk_config[UFOMA_BULK_ENDPT_MAX] = { - [0] = { + [UFOMA_BULK_ENDPT_WRITE] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, @@ -280,7 +293,7 @@ static const struct usb2_config .mh.callback = &ufoma_bulk_write_callback, }, - [1] = { + [UFOMA_BULK_ENDPT_READ] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -289,7 +302,7 @@ static const struct usb2_config .mh.callback = &ufoma_bulk_read_callback, }, - [2] = { + [UFOMA_BULK_ENDPT_WRITE_CLEAR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -300,7 +313,7 @@ static const struct usb2_config .mh.interval = 50, /* 50ms */ }, - [3] = { + [UFOMA_BULK_ENDPT_READ_CLEAR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, @@ -701,7 +714,7 @@ static void ufoma_intr_clear_stall_callback(struct usb2_xfer *xfer) { struct ufoma_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_ctrl_xfer[0]; + struct usb2_xfer *xfer_other = sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -758,7 +771,7 @@ ufoma_intr_callback(struct usb2_xfer *xf if (sc->sc_num_msg != 0xFF) { sc->sc_num_msg++; } - usb2_transfer_start(sc->sc_ctrl_xfer[2]); + usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_READ]); break; case UCDC_N_SERIAL_STATE: @@ -803,7 +816,7 @@ ufoma_intr_callback(struct usb2_xfer *xf case USB_ST_SETUP: tr_setup: if (sc->sc_flags & UFOMA_FLAG_INTR_STALL) { - usb2_transfer_start(sc->sc_ctrl_xfer[1]); + usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR_CLEAR]); } else { xfer->frlengths[0] = xfer->max_data_length; usb2_start_hardware(xfer); @@ -814,7 +827,7 @@ tr_setup: if (xfer->error != USB_ERR_CANCELLED) { /* start clear stall */ sc->sc_flags |= UFOMA_FLAG_INTR_STALL; - usb2_transfer_start(sc->sc_ctrl_xfer[1]); + usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR_CLEAR]); } return; @@ -831,7 +844,7 @@ ufoma_bulk_write_callback(struct usb2_xf case USB_ST_SETUP: case USB_ST_TRANSFERRED: if (sc->sc_flags & UFOMA_FLAG_BULK_WRITE_STALL) { - usb2_transfer_start(sc->sc_bulk_xfer[2]); + usb2_transfer_start(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE_CLEAR]); return; } if (usb2_com_get_data(&sc->sc_ucom, xfer->frbuffers, 0, @@ -844,7 +857,7 @@ ufoma_bulk_write_callback(struct usb2_xf default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { sc->sc_flags |= UFOMA_FLAG_BULK_WRITE_STALL; - usb2_transfer_start(sc->sc_bulk_xfer[2]); + usb2_transfer_start(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE_CLEAR]); } return; @@ -855,7 +868,7 @@ static void ufoma_bulk_write_clear_stall_callback(struct usb2_xfer *xfer) { struct ufoma_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_bulk_xfer[0]; + struct usb2_xfer *xfer_other = sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -876,7 +889,7 @@ ufoma_bulk_read_callback(struct usb2_xfe case USB_ST_SETUP: if (sc->sc_flags & UFOMA_FLAG_BULK_READ_STALL) { - usb2_transfer_start(sc->sc_bulk_xfer[3]); + usb2_transfer_start(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ_CLEAR]); } else { xfer->frlengths[0] = xfer->max_data_length; usb2_start_hardware(xfer); @@ -886,7 +899,7 @@ ufoma_bulk_read_callback(struct usb2_xfe default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { sc->sc_flags |= UFOMA_FLAG_BULK_READ_STALL; - usb2_transfer_start(sc->sc_bulk_xfer[3]); + usb2_transfer_start(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ_CLEAR]); } return; @@ -897,7 +910,7 @@ static void ufoma_bulk_read_clear_stall_callback(struct usb2_xfer *xfer) { struct ufoma_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_bulk_xfer[1]; + struct usb2_xfer *xfer_other = sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ]; if (usb2_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); @@ -1159,13 +1172,13 @@ ufoma_start_read(struct usb2_com_softc * struct ufoma_softc *sc = ucom->sc_parent; /* start interrupt transfer */ - usb2_transfer_start(sc->sc_ctrl_xfer[0]); + usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR]); /* start data transfer */ if (sc->sc_is_pseudo) { - usb2_transfer_start(sc->sc_ctrl_xfer[2]); + usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_READ]); } else { - usb2_transfer_start(sc->sc_bulk_xfer[1]); + usb2_transfer_start(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ]); } } @@ -1175,15 +1188,15 @@ ufoma_stop_read(struct usb2_com_softc *u struct ufoma_softc *sc = ucom->sc_parent; /* stop interrupt transfer */ - usb2_transfer_stop(sc->sc_ctrl_xfer[1]); - usb2_transfer_stop(sc->sc_ctrl_xfer[0]); + usb2_transfer_stop(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR]); + usb2_transfer_stop(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR_CLEAR]); /* stop data transfer */ if (sc->sc_is_pseudo) { - usb2_transfer_stop(sc->sc_ctrl_xfer[2]); + usb2_transfer_stop(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_READ]); } else { - usb2_transfer_stop(sc->sc_bulk_xfer[3]); - usb2_transfer_stop(sc->sc_bulk_xfer[1]); + usb2_transfer_stop(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ_CLEAR]); + usb2_transfer_stop(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_READ]); } } @@ -1193,9 +1206,9 @@ ufoma_start_write(struct usb2_com_softc struct ufoma_softc *sc = ucom->sc_parent; if (sc->sc_is_pseudo) { - usb2_transfer_start(sc->sc_ctrl_xfer[3]); + usb2_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_WRITE]); } else { - usb2_transfer_start(sc->sc_bulk_xfer[0]); + usb2_transfer_start(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE]); } } @@ -1205,10 +1218,10 @@ ufoma_stop_write(struct usb2_com_softc * struct ufoma_softc *sc = ucom->sc_parent; if (sc->sc_is_pseudo) { - usb2_transfer_stop(sc->sc_ctrl_xfer[3]); + usb2_transfer_stop(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_WRITE]); } else { - usb2_transfer_stop(sc->sc_bulk_xfer[2]); - usb2_transfer_stop(sc->sc_bulk_xfer[0]); + usb2_transfer_stop(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE_CLEAR]); + usb2_transfer_stop(sc->sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE]); } } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 16:05:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F6831065727; Thu, 15 Jan 2009 16:05:58 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 56A638FC19; Thu, 15 Jan 2009 16:05:58 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 9F24458241; Thu, 15 Jan 2009 10:05:57 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id uwAw8j518SQn; Thu, 15 Jan 2009 10:05:57 -0600 (CST) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-223-165.icecube.wisc.edu [172.16.223.165]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 7FC055823A; Thu, 15 Jan 2009 10:05:57 -0600 (CST) Message-ID: <496F5ED6.6070608@freebsd.org> Date: Thu, 15 Jan 2009 10:05:42 -0600 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.19 (X11/20090112) MIME-Version: 1.0 To: John Baldwin References: <200901061723.n06HNbgY037287@svn.freebsd.org> <200901151029.27357.jhb@freebsd.org> In-Reply-To: <200901151029.27357.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186833 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 16:05:59 -0000 John Baldwin wrote: > On Tuesday 06 January 2009 12:23:37 pm Nathan Whitehorn wrote: > >> Modified: head/sys/dev/iicbus/iic.c >> =========================================================================== >> === --- head/sys/dev/iicbus/iic.c Tue Jan 6 17:05:44 2009 (r186832) >> +++ head/sys/dev/iicbus/iic.c Tue Jan 6 17:23:37 2009 (r186833) >> @@ -110,14 +110,14 @@ iic_identify(driver_t *driver, device_t >> { >> >> if (device_find_child(parent, "iic", -1) == NULL) >> - BUS_ADD_CHILD(parent, 0, "iic", -1); >> + BUS_ADD_CHILD(parent, 0, "iic", 0); >> } >> > > This change is wrong, it always tries to add iic0 instead of letting new-bus > pick the unit number. Basically, if you have a system with iicbus0 and > iicbus1, this will try to add a second iic0 child to iicbus1 instead of iic1. > Please revert. > This is done to allow use of BUS_PROBE_NOWILDCARD, since this device is fake and has no actual probe logic. Setting -1 instead of 0 causes the device's wildcard bit to be set, and will make it not attach at all. Changing the probe method's return value to something else will make iicbus/iic attach to every unknown device on the bus on I2C buses that attach children like the OFW I2C bus layer. Since the people using the OFW I2C layer are mostly me for now, I'll happily revert the change to this file in its entirety. But this breaks other things, and I don't know of a good solution here. >> Modified: head/sys/dev/iicbus/iicbus.c >> =========================================================================== >> === --- head/sys/dev/iicbus/iicbus.c Tue Jan 6 17:05:44 2009 (r186832) +++ >> head/sys/dev/iicbus/iicbus.c Tue Jan 6 17:23:37 2009 (r186833) @@ -53,7 >> +53,9 @@ iicbus_probe(device_t dev) >> { >> >> device_set_desc(dev, "Philips I2C bus"); >> - return (0); >> + >> + /* Allow other subclasses to override this driver. */ >> + return (-1000); >> > > I think BUS_PROBE_GENERIC is what you want here. pci(4) probably needs to be > updated to use BUS_PROBE_GENERIC as well (which is what you copied this from > I'm guessing). > Yes, exactly. I'll update them both today. Thanks for pointing this out. -Nathan From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 17:15:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD321106564A; Thu, 15 Jan 2009 17:15:03 +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 CB02A8FC1D; Thu, 15 Jan 2009 17:15:03 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FHF3uo082403; Thu, 15 Jan 2009 17:15:03 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FHF3go082402; Thu, 15 Jan 2009 17:15:03 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200901151715.n0FHF3go082402@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 15 Jan 2009 17:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187300 - stable/7/usr.sbin/fifolog/fifolog_create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 17:15:04 -0000 Author: obrien Date: Thu Jan 15 17:15:03 2009 New Revision: 187300 URL: http://svn.freebsd.org/changeset/base/187300 Log: Don't claim to be FreeBSD 8.0 when installed on FreeBSD 7.1. Modified: stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Modified: stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 ============================================================================== --- stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Thu Jan 15 16:04:11 2009 (r187299) +++ stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Thu Jan 15 17:15:03 2009 (r187300) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd Feb 9, 2008 -.Os FreeBSD 8.0 +.Os .Dt FIFOLOG 1 .Sh NAME .Nm fifolog_create From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 18:31:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F5B7106566B; Thu, 15 Jan 2009 18:31:37 +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 1D8E58FC14; Thu, 15 Jan 2009 18:31:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FIVbLM083962; Thu, 15 Jan 2009 18:31:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FIVaJv083960; Thu, 15 Jan 2009 18:31:36 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200901151831.n0FIVaJv083960@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 15 Jan 2009 18:31: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: r187301 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 18:31:37 -0000 Author: gonzo Date: Thu Jan 15 18:31:36 2009 New Revision: 187301 URL: http://svn.freebsd.org/changeset/base/187301 Log: MFp4: - Add debug output - Fix pmap_zero_page and related places: use uncached segments and invalidate cache after zeroing memory. - Do not test for modified bit if it's not neccessary (merged from mips-juniper p4 branch) - Some #includes reorganization Modified: head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Thu Jan 15 17:15:03 2009 (r187300) +++ head/sys/mips/include/pmap.h Thu Jan 15 18:31:36 2009 (r187301) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * @@ -47,10 +47,8 @@ #define _MACHINE_PMAP_H_ #include +#include -/* - * Pte related macros - */ #define VADDR(pdi, pti) ((vm_offset_t)(((pdi)< -#include #include #include - /* * Pmap stuff */ @@ -104,10 +100,7 @@ struct pmap { typedef struct pmap *pmap_t; -#ifdef _KERNEL -#include -#include -#include +#ifdef _KERNEL pt_entry_t *pmap_pte(pmap_t, vm_offset_t); pd_entry_t pmap_segmap(pmap_t pmap, vm_offset_t va); @@ -132,8 +125,6 @@ extern pmap_t kernel_pmap; #define PMAP_LGMEM_UNLOCK(sysmap) mtx_unlock(&(sysmap)->lock) #define PMAP_LGMEM_DESTROY(sysmap) mtx_destroy(&(sysmap)->lock) -#endif /* _KERNEL */ - /* * For each vm_page_t, there is a list of all currently valid virtual * mappings of that page. An entry is a pv_entry_t, the list is pv_table. @@ -148,8 +139,6 @@ typedef struct pv_entry { } *pv_entry_t; -#ifdef _KERNEL - #if defined(DIAGNOSTIC) #define PMAP_DIAGNOSTIC #endif @@ -182,7 +171,6 @@ vm_offset_t pmap_steal_memory(vm_size_t void pmap_set_modified(vm_offset_t pa); int page_is_managed(vm_offset_t pa); void pmap_page_is_free(vm_page_t m); -void pmap_kushmem_reattach(struct proc *); /* PMAP_INLINE */ void pmap_kenter(vm_offset_t va, vm_paddr_t pa); /* PMAP_INLINE */ void pmap_kremove(vm_offset_t va); void *pmap_kenter_temporary(vm_paddr_t pa, int i); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Jan 15 17:15:03 2009 (r187300) +++ head/sys/mips/mips/pmap.c Thu Jan 15 18:31:36 2009 (r187301) @@ -103,6 +103,8 @@ __FBSDID("$FreeBSD$"); #define PMAP_DIAGNOSTIC #endif +#undef PMAP_DEBUG + #ifndef PMAP_SHPGPERPROC #define PMAP_SHPGPERPROC 200 #endif @@ -489,6 +491,24 @@ pmap_nw_modified(pt_entry_t pte) #endif +/* + * this routine defines the region(s) of memory that should + * not be tested for the modified bit. + */ +static PMAP_INLINE int +pmap_track_modified(vm_offset_t va) +{ + /* + * Kernel submap initialization has been moved for MD to MI code. ie + * from cpu_startup() to vm_ksubmap_init(). clean_sva and clean_eva + * are part of the kmi structure. + */ + if ((va < kmi.clean_sva) || (va >= kmi.clean_eva)) + return (1); + else + return (0); +} + static void pmap_invalidate_all(pmap_t pmap) { @@ -672,6 +692,9 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p register pt_entry_t *pte; pt_entry_t npte, opte; +#ifdef PMAP_DEBUG + printf("pmap_kenter: va: 0x%08x -> pa: 0x%08x\n", va, pa); +#endif npte = mips_paddr_to_tlbpfn(pa) | PTE_RW | PTE_V | PTE_G | PTE_W; if (is_cacheable_mem(pa)) @@ -1421,7 +1444,8 @@ pmap_remove_pte(struct pmap *pmap, pt_en va, oldpte); } #endif - vm_page_dirty(m); + if (pmap_track_modified(va)) + vm_page_dirty(m); } if (m->md.pv_flags & PV_TABLE_REF) vm_page_flag_set(m, PG_REFERENCED); @@ -1778,6 +1802,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, validate: rw = init_pte_prot(va, m, prot); +#ifdef PMAP_DEBUG + printf("pmap_enter: va: 0x%08x -> pa: 0x%08x\n", va, pa); +#endif /* * Now validate mapping with desired protection/wiring. */ @@ -2147,9 +2174,10 @@ pmap_zero_page(vm_page_t m) #endif if (phys < MIPS_KSEG0_LARGEST_PHYS) { - va = MIPS_PHYS_TO_CACHED(phys); + va = MIPS_PHYS_TO_UNCACHED(phys); bzero((caddr_t)va, PAGE_SIZE); + mips_dcache_wbinv_range(va, PAGE_SIZE); } else { int cpu; struct local_sysmaps *sysm; @@ -2202,8 +2230,9 @@ pmap_zero_page_area(vm_page_t m, int off } else #endif if (phys < MIPS_KSEG0_LARGEST_PHYS) { - va = MIPS_PHYS_TO_CACHED(phys); + va = MIPS_PHYS_TO_UNCACHED(phys); bzero((char *)(caddr_t)va + off, size); + mips_dcache_wbinv_range(va + off, size); } else { int cpu; struct local_sysmaps *sysm; @@ -2240,8 +2269,9 @@ pmap_zero_page_idle(vm_page_t m) } else #endif if (phys < MIPS_KSEG0_LARGEST_PHYS) { - va = MIPS_PHYS_TO_CACHED(phys); + va = MIPS_PHYS_TO_UNCACHED(phys); bzero((caddr_t)va, PAGE_SIZE); + mips_dcache_wbinv_range(va, PAGE_SIZE); } else { int cpu; struct local_sysmaps *sysm; From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 18:53:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 909741065713; Thu, 15 Jan 2009 18:53:52 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4CC8FC1A; Thu, 15 Jan 2009 18:53:52 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FIrqI1084394; Thu, 15 Jan 2009 18:53:52 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FIrqjN084389; Thu, 15 Jan 2009 18:53:52 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200901151853.n0FIrqjN084389@svn.freebsd.org> From: Roman Divacky Date: Thu, 15 Jan 2009 18:53: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: r187302 - in head/lib/libc: locale stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 18:53:53 -0000 Author: rdivacky Date: Thu Jan 15 18:53:52 2009 New Revision: 187302 URL: http://svn.freebsd.org/changeset/base/187302 Log: Introduce a local variable and use it instead of passed in parameter to get rid of restrict qualifier discarding. This lets libc compile cleanly in gnu99 mode. Suggested by: kib, christoph.mallon at gmx.de Approved by: kib (mentor) Modified: head/lib/libc/locale/mbstowcs.c head/lib/libc/locale/wcsftime.c head/lib/libc/locale/wcstombs.c head/lib/libc/stdio/fputws.c head/lib/libc/stdio/vswscanf.c Modified: head/lib/libc/locale/mbstowcs.c ============================================================================== --- head/lib/libc/locale/mbstowcs.c Thu Jan 15 18:31:36 2009 (r187301) +++ head/lib/libc/locale/mbstowcs.c Thu Jan 15 18:53:52 2009 (r187302) @@ -37,7 +37,9 @@ mbstowcs(wchar_t * __restrict pwcs, cons { static const mbstate_t initial; mbstate_t mbs; + const char *sp; mbs = initial; - return (__mbsnrtowcs(pwcs, &s, SIZE_T_MAX, n, &mbs)); + sp = s; + return (__mbsnrtowcs(pwcs, &sp, SIZE_T_MAX, n, &mbs)); } Modified: head/lib/libc/locale/wcsftime.c ============================================================================== --- head/lib/libc/locale/wcsftime.c Thu Jan 15 18:31:36 2009 (r187301) +++ head/lib/libc/locale/wcsftime.c Thu Jan 15 18:53:52 2009 (r187302) @@ -53,6 +53,7 @@ wcsftime(wchar_t * __restrict wcs, size_ static const mbstate_t initial; mbstate_t mbs; char *dst, *dstp, *sformat; + const wchar_t *formatp; size_t n, sflen; int sverrno; @@ -63,13 +64,14 @@ wcsftime(wchar_t * __restrict wcs, size_ * for strftime(), which only handles single-byte characters. */ mbs = initial; - sflen = wcsrtombs(NULL, &format, 0, &mbs); + formatp = format; + sflen = wcsrtombs(NULL, &formatp, 0, &mbs); if (sflen == (size_t)-1) goto error; if ((sformat = malloc(sflen + 1)) == NULL) goto error; mbs = initial; - wcsrtombs(sformat, &format, sflen + 1, &mbs); + wcsrtombs(sformat, &formatp, sflen + 1, &mbs); /* * Allocate memory for longest multibyte sequence that will fit Modified: head/lib/libc/locale/wcstombs.c ============================================================================== --- head/lib/libc/locale/wcstombs.c Thu Jan 15 18:31:36 2009 (r187301) +++ head/lib/libc/locale/wcstombs.c Thu Jan 15 18:53:52 2009 (r187302) @@ -37,7 +37,9 @@ wcstombs(char * __restrict s, const wcha { static const mbstate_t initial; mbstate_t mbs; + const wchar_t *pwcsp; mbs = initial; - return (__wcsnrtombs(s, &pwcs, SIZE_T_MAX, n, &mbs)); + pwcsp = pwcs; + return (__wcsnrtombs(s, &pwcsp, SIZE_T_MAX, n, &mbs)); } Modified: head/lib/libc/stdio/fputws.c ============================================================================== --- head/lib/libc/stdio/fputws.c Thu Jan 15 18:31:36 2009 (r187301) +++ head/lib/libc/stdio/fputws.c Thu Jan 15 18:53:52 2009 (r187302) @@ -45,6 +45,7 @@ fputws(const wchar_t * __restrict ws, FI char buf[BUFSIZ]; struct __suio uio; struct __siov iov; + const wchar_t *wsp; FLOCKFILE(fp); ORIENT(fp, 1); @@ -54,7 +55,8 @@ fputws(const wchar_t * __restrict ws, FI uio.uio_iovcnt = 1; iov.iov_base = buf; do { - nbytes = __wcsnrtombs(buf, &ws, SIZE_T_MAX, sizeof(buf), + wsp = ws; + nbytes = __wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf), &fp->_mbstate); if (nbytes == (size_t)-1) goto error; Modified: head/lib/libc/stdio/vswscanf.c ============================================================================== --- head/lib/libc/stdio/vswscanf.c Thu Jan 15 18:31:36 2009 (r187301) +++ head/lib/libc/stdio/vswscanf.c Thu Jan 15 18:53:52 2009 (r187302) @@ -66,6 +66,7 @@ vswscanf(const wchar_t * __restrict str, char *mbstr; size_t mlen; int r; + const wchar_t *strp; /* * XXX Convert the wide character string to multibyte, which @@ -74,7 +75,8 @@ vswscanf(const wchar_t * __restrict str, if ((mbstr = malloc(wcslen(str) * MB_CUR_MAX + 1)) == NULL) return (EOF); mbs = initial; - if ((mlen = wcsrtombs(mbstr, &str, SIZE_T_MAX, &mbs)) == (size_t)-1) { + strp = str; + if ((mlen = wcsrtombs(mbstr, &strp, SIZE_T_MAX, &mbs)) == (size_t)-1) { free(mbstr); return (EOF); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 19:35:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5A6A106564A; Thu, 15 Jan 2009 19:35:23 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D463F8FC21; Thu, 15 Jan 2009 19:35:23 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FJZNGA085347; Thu, 15 Jan 2009 19:35:23 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FJZNZ2085344; Thu, 15 Jan 2009 19:35:23 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200901151935.n0FJZNZ2085344@svn.freebsd.org> From: Paolo Pisati Date: Thu, 15 Jan 2009 19:35: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: r187304 - head/sys/netinet/libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 19:35:24 -0000 Author: piso Date: Thu Jan 15 19:35:23 2009 New Revision: 187304 URL: http://svn.freebsd.org/changeset/base/187304 Log: Silent userland warnings about missing prototypes. Submitted by: Roman Divacky Modified: head/sys/netinet/libalias/alias_ftp.c head/sys/netinet/libalias/alias_irc.c head/sys/netinet/libalias/alias_nbt.c Modified: head/sys/netinet/libalias/alias_ftp.c ============================================================================== --- head/sys/netinet/libalias/alias_ftp.c Thu Jan 15 19:26:21 2009 (r187303) +++ head/sys/netinet/libalias/alias_ftp.c Thu Jan 15 19:35:23 2009 (r187304) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #else +#include #include #include #include Modified: head/sys/netinet/libalias/alias_irc.c ============================================================================== --- head/sys/netinet/libalias/alias_irc.c Thu Jan 15 19:26:21 2009 (r187303) +++ head/sys/netinet/libalias/alias_irc.c Thu Jan 15 19:35:23 2009 (r187304) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #else +#include #include #include #include Modified: head/sys/netinet/libalias/alias_nbt.c ============================================================================== --- head/sys/netinet/libalias/alias_nbt.c Thu Jan 15 19:26:21 2009 (r187303) +++ head/sys/netinet/libalias/alias_nbt.c Thu Jan 15 19:35:23 2009 (r187304) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif #include From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 19:57:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5089D10657DD; Thu, 15 Jan 2009 19:57:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9068FC13; Thu, 15 Jan 2009 19:57:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FJvk6k085768; Thu, 15 Jan 2009 19:57:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FJvk0e085767; Thu, 15 Jan 2009 19:57:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901151957.n0FJvk0e085767@svn.freebsd.org> From: Warner Losh Date: Thu, 15 Jan 2009 19:57: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: r187305 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 19:57:47 -0000 Author: imp Date: Thu Jan 15 19:57:45 2009 New Revision: 187305 URL: http://svn.freebsd.org/changeset/base/187305 Log: Reduce diffs to p4 that were the result of a mismerge on my part. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Thu Jan 15 19:35:23 2009 (r187304) +++ head/sys/mips/mips/machdep.c Thu Jan 15 19:57:45 2009 (r187305) @@ -36,7 +36,7 @@ * * from: @(#)machdep.c 8.3 (Berkeley) 1/12/94 * Id: machdep.c,v 1.33 1998/09/15 10:58:54 pefo Exp - * JNPR: machdep.c,v 1.11.2.3 2007/08/29 12:24:49 girish + * JNPR: machdep.c,v 1.11.2.3 2007/08/29 12:24:49 */ #include @@ -157,7 +157,10 @@ cpu_startup(void *dummy) if (boothowto & RB_VERBOSE) bootverbose++; - printf("real memory = %lu (%luK bytes)\n", ptoa(realmem), ptoa(realmem) / 1024); + + bootverbose++; + printf("real memory = %lu (%luK bytes)\n", ptoa(realmem), + ptoa(realmem) / 1024); /* * Display any holes after the first chunk of extended memory. From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:07:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA8CE1065670; Thu, 15 Jan 2009 20:07:56 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 7B1298FC12; Thu, 15 Jan 2009 20:07:56 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id n0FJmHHP078759; Thu, 15 Jan 2009 20:48:17 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id n0FJmHFG078758; Thu, 15 Jan 2009 20:48:17 +0100 (CET) (envelope-from marius) Date: Thu, 15 Jan 2009 20:48:17 +0100 From: Marius Strobl To: John Baldwin Message-ID: <20090115194816.GA14477@alchemy.franken.de> References: <200901072152.n07Lql7h000807@svn.freebsd.org> <200901151031.42725.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200901151031.42725.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186878 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:07:57 -0000 On Thu, Jan 15, 2009 at 10:31:42AM -0500, John Baldwin wrote: > On Wednesday 07 January 2009 4:52:47 pm Marius Strobl wrote: > > Author: marius > > Date: Wed Jan 7 21:52:47 2009 > > New Revision: 186878 > > URL: http://svn.freebsd.org/changeset/base/186878 > > > > Log: > > Make the whole initiator mode part of mpt(4) endian-clean, > > specifically SPI controllers now also work in big-endian > > machines and some conversions relevant for FC and SAS > > controllers as well as support for ILP32 machines which all > > were omitted in previous attempts are now also implemented. > > The IOCTL-interface is intentionally left (and where needed > > actually changed) to be completely little-endian as otherwise > > we would have to add conversion code for every possible > > configuration page to mpt(4), which didn't seem the right > > thing to do, neither did converting only half of the user- > > interface to the native byte order. > > This change was tested on amd64 (SAS+SPI), i386 (SAS) and > > sparc64 (SAS+SPI). Due to lack of the necessary hardware > > the target mode code is still left to be made endian-clean. > > > > Reviewed by: scottl > > MFC after: 1 month > > If you wish to test the mpt_user interface on a big-endian machine you may > use //depot/jhb/raid/usr.sbin/mptutil/... > > It is likely going to need a lot of sprinkled htole*() and letoh*() though. > Thanks for the pointer! I already had looked for it but didn't manage to find it. Marius From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:13:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCCF1065678; Thu, 15 Jan 2009 20:13:22 +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 CA62E8FC18; Thu, 15 Jan 2009 20:13:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKDMeC086113; Thu, 15 Jan 2009 20:13:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKDMiC086112; Thu, 15 Jan 2009 20:13:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152013.n0FKDMiC086112@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187306 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:13:23 -0000 Author: marius Date: Thu Jan 15 20:13:22 2009 New Revision: 187306 URL: http://svn.freebsd.org/changeset/base/187306 Log: MFC: r183281 - Don't read the identifier string from the VPD if there's no chip containing an Ethernet address fitted as this is yet another thing that fails in that case in order to avoid the one second delay until pci_read_vpd_reg() times out. - Const'ify the bge_devs array. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 19:57:45 2009 (r187305) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:13:22 2009 (r187306) @@ -134,7 +134,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); * ID burned into it, though it will always be overriden by the vendor * ID in the EEPROM. Just to be safe, we cover all possibilities. */ -static struct bge_type { +static const struct bge_type { uint16_t bge_vid; uint16_t bge_did; } bge_devs[] = { @@ -1861,7 +1861,7 @@ bge_lookup_vendor(uint16_t vid) static int bge_probe(device_t dev) { - struct bge_type *t = bge_devs; + const struct bge_type *t = bge_devs; struct bge_softc *sc = device_get_softc(dev); uint16_t vid, did; @@ -1883,7 +1883,8 @@ bge_probe(device_t dev) #if __FreeBSD_version > 700024 const char *pname; - if (pci_get_vpd_ident(dev, &pname) == 0) + if (bge_has_eaddr(sc) && + pci_get_vpd_ident(dev, &pname) == 0) snprintf(model, 64, "%s", pname); else #endif From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:13:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B2F106581B; Thu, 15 Jan 2009 20:13: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 BDFA78FC2D; Thu, 15 Jan 2009 20:13:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKDomR086160; Thu, 15 Jan 2009 20:13:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKDoIi086159; Thu, 15 Jan 2009 20:13:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152013.n0FKDoIi086159@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187307 - in stable/6/sys: . dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:13:52 -0000 Author: marius Date: Thu Jan 15 20:13:50 2009 New Revision: 187307 URL: http://svn.freebsd.org/changeset/base/187307 Log: MFC: r183281 - Don't read the identifier string from the VPD if there's no chip containing an Ethernet address fitted as this is yet another thing that fails in that case in order to avoid the one second delay until pci_read_vpd_reg() times out. - Const'ify the bge_devs array. Modified: stable/6/sys/ (props changed) stable/6/sys/dev/bge/if_bge.c Modified: stable/6/sys/dev/bge/if_bge.c ============================================================================== --- stable/6/sys/dev/bge/if_bge.c Thu Jan 15 20:13:22 2009 (r187306) +++ stable/6/sys/dev/bge/if_bge.c Thu Jan 15 20:13:50 2009 (r187307) @@ -134,7 +134,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); * ID burned into it, though it will always be overriden by the vendor * ID in the EEPROM. Just to be safe, we cover all possibilities. */ -static struct bge_type { +static const struct bge_type { uint16_t bge_vid; uint16_t bge_did; } bge_devs[] = { @@ -1855,7 +1855,7 @@ bge_lookup_vendor(uint16_t vid) static int bge_probe(device_t dev) { - struct bge_type *t = bge_devs; + const struct bge_type *t = bge_devs; struct bge_softc *sc = device_get_softc(dev); uint16_t vid, did; @@ -1877,7 +1877,8 @@ bge_probe(device_t dev) #if __FreeBSD_version > 700024 const char *pname; - if (pci_get_vpd_ident(dev, &pname) == 0) + if (bge_has_eaddr(sc) && + pci_get_vpd_ident(dev, &pname) == 0) snprintf(model, 64, "%s", pname); else #endif From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:19:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF883106564A; Thu, 15 Jan 2009 20:19:53 +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 C24D58FC12; Thu, 15 Jan 2009 20:19:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKJrLg086329; Thu, 15 Jan 2009 20:19:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKJrae086327; Thu, 15 Jan 2009 20:19:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152019.n0FKJrae086327@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187308 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:19:54 -0000 Author: marius Date: Thu Jan 15 20:19:53 2009 New Revision: 187308 URL: http://svn.freebsd.org/changeset/base/187308 Log: MFC: r183896 Use bus_{read,write}_4(9) instead of bus_space_{read,write}_4(9) in order to get rid of the bus space handle and tag in the softc. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:13:50 2009 (r187307) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:19:53 2009 (r187308) @@ -2387,11 +2387,7 @@ bge_attach(device_t dev) goto fail; } - sc->bge_btag = rman_get_bustag(sc->bge_res); - sc->bge_bhandle = rman_get_bushandle(sc->bge_res); - /* Save ASIC rev. */ - sc->bge_chipid = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & BGE_PCIMISCCTL_ASICREV; Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Thu Jan 15 20:13:50 2009 (r187307) +++ stable/7/sys/dev/bge/if_bgereg.h Thu Jan 15 20:19:53 2009 (r187308) @@ -1896,8 +1896,7 @@ struct bge_rcb { }; #define RCB_WRITE_4(sc, rcb, offset, val) \ - bus_space_write_4(sc->bge_btag, sc->bge_bhandle, \ - rcb + offsetof(struct bge_rcb, offset), val) + bus_write_4(sc->bge_res, rcb + offsetof(struct bge_rcb, offset), val) #define BGE_RCB_MAXLEN_FLAGS(maxlen, flags) ((maxlen) << 16 | (flags)) #define BGE_RCB_FLAG_USE_EXT_RX_BD 0x0001 @@ -2394,10 +2393,10 @@ struct bge_gib { */ #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->bge_btag, sc->bge_bhandle, reg, val) + bus_write_4(sc->bge_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->bge_btag, sc->bge_bhandle, reg) + bus_read_4(sc->bge_res, reg) #define BGE_SETBIT(sc, reg, x) \ CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) | (x))) @@ -2522,8 +2521,6 @@ struct bge_softc { device_t bge_dev; struct mtx bge_mtx; device_t bge_miibus; - bus_space_handle_t bge_bhandle; - bus_space_tag_t bge_btag; void *bge_intrhand; struct resource *bge_irq; struct resource *bge_res; From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:23:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2FE71065677; Thu, 15 Jan 2009 20:23:38 +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 C03778FC08; Thu, 15 Jan 2009 20:23:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKNc0X086453; Thu, 15 Jan 2009 20:23:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKNcG7086452; Thu, 15 Jan 2009 20:23:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152023.n0FKNcG7086452@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187309 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:23:39 -0000 Author: marius Date: Thu Jan 15 20:23:38 2009 New Revision: 187309 URL: http://svn.freebsd.org/changeset/base/187309 Log: MFC: r184380 Do as the Linux tg3 driver does and enable MSI support also for the BCM5714 revision A0 when in a multi-port configuration and unconditionally for the remainder of the class of BCM575X and beyond chips. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:19:53 2009 (r187308) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 15 20:23:38 2009 (r187309) @@ -2338,10 +2338,11 @@ bge_can_use_msi(struct bge_softc *sc) int can_use_msi = 0; switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5714_A0: case BGE_ASICREV_BCM5714: /* - * Apparently, MSI doesn't work when this chip is configured - * in single-port mode. + * Apparently, MSI doesn't work when these chips are + * configured in single-port mode. */ if (bge_has_multiple_ports(sc)) can_use_msi = 1; @@ -2351,10 +2352,9 @@ bge_can_use_msi(struct bge_softc *sc) sc->bge_chiprev != BGE_CHIPREV_5750_BX) can_use_msi = 1; break; - case BGE_ASICREV_BCM5752: - case BGE_ASICREV_BCM5780: - can_use_msi = 1; - break; + default: + if (BGE_IS_575X_PLUS(sc)) + can_use_msi = 1; } return (can_use_msi); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:23:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7C89106577E; Thu, 15 Jan 2009 20:23:45 +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 E84B98FC1B; Thu, 15 Jan 2009 20:23:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKNiOP086492; Thu, 15 Jan 2009 20:23:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKNiJJ086491; Thu, 15 Jan 2009 20:23:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152023.n0FKNiJJ086491@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187310 - in stable/6/sys: . dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:23:51 -0000 Author: marius Date: Thu Jan 15 20:23:44 2009 New Revision: 187310 URL: http://svn.freebsd.org/changeset/base/187310 Log: MFC: r184380 Do as the Linux tg3 driver does and enable MSI support also for the BCM5714 revision A0 when in a multi-port configuration and unconditionally for the remainder of the class of BCM575X and beyond chips. Modified: stable/6/sys/ (props changed) stable/6/sys/dev/bge/if_bge.c Modified: stable/6/sys/dev/bge/if_bge.c ============================================================================== --- stable/6/sys/dev/bge/if_bge.c Thu Jan 15 20:23:38 2009 (r187309) +++ stable/6/sys/dev/bge/if_bge.c Thu Jan 15 20:23:44 2009 (r187310) @@ -2331,10 +2331,11 @@ bge_can_use_msi(struct bge_softc *sc) int can_use_msi = 0; switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5714_A0: case BGE_ASICREV_BCM5714: /* - * Apparently, MSI doesn't work when this chip is configured - * in single-port mode. + * Apparently, MSI doesn't work when these chips are + * configured in single-port mode. */ if (bge_has_multiple_ports(sc)) can_use_msi = 1; @@ -2344,10 +2345,9 @@ bge_can_use_msi(struct bge_softc *sc) sc->bge_chiprev != BGE_CHIPREV_5750_BX) can_use_msi = 1; break; - case BGE_ASICREV_BCM5752: - case BGE_ASICREV_BCM5780: - can_use_msi = 1; - break; + default: + if (BGE_IS_575X_PLUS(sc)) + can_use_msi = 1; } return (can_use_msi); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:30:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2DE21065686; Thu, 15 Jan 2009 20:30:38 +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 9F4738FC18; Thu, 15 Jan 2009 20:30:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKUcBS086657; Thu, 15 Jan 2009 20:30:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKUcYZ086656; Thu, 15 Jan 2009 20:30:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152030.n0FKUcYZ086656@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187311 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:30:40 -0000 Author: marius Date: Thu Jan 15 20:30:38 2009 New Revision: 187311 URL: http://svn.freebsd.org/changeset/base/187311 Log: MFC: r183895 Use xpt_register_async() in order to remove code duplication. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sym/sym_hipd.c Modified: stable/7/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/7/sys/dev/sym/sym_hipd.c Thu Jan 15 20:23:44 2009 (r187310) +++ stable/7/sys/dev/sym/sym_hipd.c Thu Jan 15 20:30:38 2009 (r187311) @@ -8974,7 +8974,6 @@ static int sym_cam_attach(hcb_p np) struct cam_devq *devq = NULL; struct cam_sim *sim = NULL; struct cam_path *path = NULL; - struct ccb_setasync csa; int err; /* @@ -9021,12 +9020,9 @@ static int sym_cam_attach(hcb_p np) /* * Establish our async notification handler. */ - xpt_setup_ccb(&csa.ccb_h, np->path, 5); - csa.ccb_h.func_code = XPT_SASYNC_CB; - csa.event_enable = AC_LOST_DEVICE; - csa.callback = sym_async; - csa.callback_arg = np->sim; - xpt_action((union ccb *)&csa); + if (xpt_register_async(AC_LOST_DEVICE, sym_async, sim, path) != + CAM_REQ_CMP) + goto fail; /* * Start the chip now, without resetting the BUS, since From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:45:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3738106564A; Thu, 15 Jan 2009 20:45:59 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1F348FC0C; Thu, 15 Jan 2009 20:45:59 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKjxJ6086985; Thu, 15 Jan 2009 20:45:59 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKjx0I086984; Thu, 15 Jan 2009 20:45:59 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200901152045.n0FKjx0I086984@svn.freebsd.org> From: Roman Divacky Date: Thu, 15 Jan 2009 20:45: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: r187312 - head/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:46:00 -0000 Author: rdivacky Date: Thu Jan 15 20:45:59 2009 New Revision: 187312 URL: http://svn.freebsd.org/changeset/base/187312 Log: Change dstp to be const and remove bogus cast. Submitted by: christoph.mallon at gmx.de Approved by: kib (mentor) Modified: head/lib/libc/locale/wcsftime.c Modified: head/lib/libc/locale/wcsftime.c ============================================================================== --- head/lib/libc/locale/wcsftime.c Thu Jan 15 20:30:38 2009 (r187311) +++ head/lib/libc/locale/wcsftime.c Thu Jan 15 20:45:59 2009 (r187312) @@ -52,7 +52,8 @@ wcsftime(wchar_t * __restrict wcs, size_ { static const mbstate_t initial; mbstate_t mbs; - char *dst, *dstp, *sformat; + char *dst, *sformat; + const char *dstp; const wchar_t *formatp; size_t n, sflen; int sverrno; @@ -90,7 +91,7 @@ wcsftime(wchar_t * __restrict wcs, size_ goto error; dstp = dst; mbs = initial; - n = mbsrtowcs(wcs, (const char **)&dstp, maxsize, &mbs); + n = mbsrtowcs(wcs, &dstp, maxsize, &mbs); if (n == (size_t)-2 || n == (size_t)-1 || dstp != NULL) goto error; From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 20:49:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70D71065672; Thu, 15 Jan 2009 20:49:17 +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 A226F8FC14; Thu, 15 Jan 2009 20:49:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FKnHjl087077; Thu, 15 Jan 2009 20:49:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FKnHpA087072; Thu, 15 Jan 2009 20:49:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152049.n0FKnHpA087072@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 20:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187313 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/le X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 20:49:18 -0000 Author: marius Date: Thu Jan 15 20:49:17 2009 New Revision: 187313 URL: http://svn.freebsd.org/changeset/base/187313 Log: MFC: r183337 - Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) etc and take advantage of rman_get_rid(9) in order to save some softc members. - Provide and consume module dependency information for lebuffer(4). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/le/if_le_cbus.c stable/7/sys/dev/le/if_le_isa.c stable/7/sys/dev/le/if_le_lebuffer.c stable/7/sys/dev/le/if_le_pci.c stable/7/sys/dev/le/lebuffer_sbus.c Modified: stable/7/sys/dev/le/if_le_cbus.c ============================================================================== --- stable/7/sys/dev/le/if_le_cbus.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/if_le_cbus.c Thu Jan 15 20:49:17 2009 (r187313) @@ -70,12 +70,8 @@ __FBSDID("$FreeBSD$"); struct le_cbus_softc { struct am7990_softc sc_am7990; /* glue to MI code */ - int sc_rrid; struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - int sc_irid; struct resource *sc_ires; void *sc_ih; @@ -128,10 +124,9 @@ le_cbus_wrbcr(struct lance_softc *sc, ui { struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_BDP, val); + bus_write_2(lesc->sc_rres, CNET98S_RAP, port); + bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, CNET98S_BDP, val); } #ifdef LEDEBUG @@ -140,10 +135,9 @@ le_cbus_rdbcr(struct lance_softc *sc, ui { struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_BDP)); + bus_write_2(lesc->sc_rres, CNET98S_RAP, port); + bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, CNET98S_BDP)); } #endif @@ -152,10 +146,9 @@ le_cbus_wrcsr(struct lance_softc *sc, ui { struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RDP, val); + bus_write_2(lesc->sc_rres, CNET98S_RAP, port); + bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, CNET98S_RDP, val); } static uint16_t @@ -163,10 +156,9 @@ le_cbus_rdcsr(struct lance_softc *sc, ui { struct le_cbus_softc *lesc = (struct le_cbus_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, CNET98S_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RDP)); + bus_write_2(lesc->sc_rres, CNET98S_RAP, port); + bus_barrier(lesc->sc_rres, CNET98S_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, CNET98S_RDP)); } static void @@ -179,16 +171,16 @@ le_cbus_hwreset(struct lance_softc *sc) */ /* Reset the chip. */ - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET, - bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET)); + bus_write_2(lesc->sc_rres, CNET98S_RESET, + bus_read_2(lesc->sc_rres, CNET98S_RESET)); DELAY(500); /* ISA bus configuration */ /* ISACSR0 - set Master Mode Read Active time to 300ns. */ - le_cbus_wrbcr(sc, LE_BCR0, 0x0006); + le_cbus_wrbcr(sc, LE_BCR0, 0x0006); /* ISACSR1 - set Master Mode Write Active time to 300ns. */ - le_cbus_wrbcr(sc, LE_BCR1, 0x0006); -#ifdef LEDEBUG + le_cbus_wrbcr(sc, LE_BCR1, 0x0006); +#ifdef LEDEBUG device_printf(dev, "ISACSR2=0x%x\n", le_cbus_rdbcr(sc, LE_BCR2)); #endif /* ISACSR5 - LED1 */ @@ -215,7 +207,7 @@ le_cbus_probe(device_t dev) { struct le_cbus_softc *lesc; struct lance_softc *sc; - int error; + int error, i; /* * Skip PnP devices as some wedge when trying to probe them as @@ -227,18 +219,16 @@ le_cbus_probe(device_t dev) lesc = device_get_softc(dev); sc = &lesc->sc_am7990.lsc; - lesc->sc_rrid = 0; - lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &lesc->sc_rrid, + i = 0; + lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &i, le_ioaddr_cnet98s, CNET98S_IOSIZE, RF_ACTIVE); if (lesc->sc_rres == NULL) return (ENXIO); isa_load_resourcev(lesc->sc_rres, le_ioaddr_cnet98s, CNET98S_IOSIZE); - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); /* Reset the chip. */ - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET, - bus_space_read_2(lesc->sc_regt, lesc->sc_regh, CNET98S_RESET)); + bus_write_2(lesc->sc_rres, CNET98S_RESET, + bus_read_2(lesc->sc_rres, CNET98S_RESET)); DELAY(500); /* Stop the chip and put it in a known state. */ @@ -253,7 +243,8 @@ le_cbus_probe(device_t dev) error = BUS_PROBE_DEFAULT; fail: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); return (error); } @@ -269,8 +260,8 @@ le_cbus_attach(device_t dev) LE_LOCK_INIT(sc, device_get_nameunit(dev)); - lesc->sc_rrid = 0; - lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &lesc->sc_rrid, + i = 0; + lesc->sc_rres = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &i, le_ioaddr_cnet98s, CNET98S_IOSIZE, RF_ACTIVE); if (lesc->sc_rres == NULL) { device_printf(dev, "cannot allocate registers\n"); @@ -278,12 +269,10 @@ le_cbus_attach(device_t dev) goto fail_mtx; } isa_load_resourcev(lesc->sc_rres, le_ioaddr_cnet98s, CNET98S_IOSIZE); - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); - lesc->sc_irid = 0; + i = 0; if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate interrupt\n"); error = ENXIO; goto fail_rres; @@ -339,7 +328,7 @@ le_cbus_attach(device_t dev) error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem, sc->sc_memsize, le_cbus_dma_callback, sc, 0); if (error != 0 || sc->sc_addr == 0) { - device_printf(dev, "cannot load DMA buffer map\n"); + device_printf(dev, "cannot load DMA buffer map\n"); goto fail_dmem; } @@ -350,8 +339,7 @@ le_cbus_attach(device_t dev) * Extract the physical MAC address from the ROM. */ for (i = 0; i < sizeof(sc->sc_enaddr); i++) - sc->sc_enaddr[i] = bus_space_read_1(lesc->sc_regt, - lesc->sc_regh, i * 2); + sc->sc_enaddr[i] = bus_read_1(lesc->sc_rres, i * 2); sc->sc_copytodesc = lance_copytobuf_contig; sc->sc_copyfromdesc = lance_copyfrombuf_contig; @@ -396,9 +384,11 @@ le_cbus_attach(device_t dev) fail_pdtag: bus_dma_tag_destroy(lesc->sc_pdmat); fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); fail_rres: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); fail_mtx: LE_LOCK_DESTROY(sc); return (error); @@ -419,8 +409,10 @@ le_cbus_detach(device_t dev) bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); bus_dma_tag_destroy(lesc->sc_dmat); bus_dma_tag_destroy(lesc->sc_pdmat); - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); LE_LOCK_DESTROY(sc); return (0); Modified: stable/7/sys/dev/le/if_le_isa.c ============================================================================== --- stable/7/sys/dev/le/if_le_isa.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/if_le_isa.c Thu Jan 15 20:49:17 2009 (r187313) @@ -109,15 +109,10 @@ struct le_isa_softc { bus_size_t sc_rap; /* offsets to LANCE... */ bus_size_t sc_rdp; /* ...registers */ - int sc_rrid; struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - int sc_drid; struct resource *sc_dres; - int sc_irid; struct resource *sc_ires; void *sc_ih; @@ -184,10 +179,9 @@ le_isa_wrcsr(struct lance_softc *sc, uin { struct le_isa_softc *lesc = (struct le_isa_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rdp, val); + bus_write_2(lesc->sc_rres, lesc->sc_rap, port); + bus_barrier(lesc->sc_rres, lesc->sc_rap, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, lesc->sc_rdp, val); } static uint16_t @@ -195,10 +189,9 @@ le_isa_rdcsr(struct lance_softc *sc, uin { struct le_isa_softc *lesc = (struct le_isa_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, lesc->sc_rap, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, lesc->sc_rdp)); + bus_write_2(lesc->sc_rres, lesc->sc_rap, port); + bus_barrier(lesc->sc_rres, lesc->sc_rap, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, lesc->sc_rdp)); } static void @@ -217,18 +210,16 @@ le_isa_probe_legacy(device_t dev, const { struct le_isa_softc *lesc; struct lance_softc *sc; - int error; + int error, i; lesc = device_get_softc(dev); sc = &lesc->sc_am7990.lsc; - lesc->sc_rrid = 0; - lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &lesc->sc_rrid, - 0, ~0, leip->iosize, RF_ACTIVE); + i = 0; + lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &i, 0, ~0, + leip->iosize, RF_ACTIVE); if (lesc->sc_rres == NULL) return (ENXIO); - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); lesc->sc_rap = leip->rap; lesc->sc_rdp = leip->rdp; @@ -243,7 +234,8 @@ le_isa_probe_legacy(device_t dev, const error = 0; fail: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); return (error); } @@ -276,18 +268,18 @@ le_isa_attach(device_t dev) struct le_isa_softc *lesc; struct lance_softc *sc; bus_size_t macstart, rap, rdp; - int error, i, macstride; + int error, i, j, macstride; lesc = device_get_softc(dev); sc = &lesc->sc_am7990.lsc; LE_LOCK_INIT(sc, device_get_nameunit(dev)); - lesc->sc_rrid = 0; + j = 0; switch (ISA_PNP_PROBE(device_get_parent(dev), dev, le_isa_ids)) { case 0: lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, - &lesc->sc_rrid, RF_ACTIVE); + &j, RF_ACTIVE); rap = PCNET_RAP; rdp = PCNET_RDP; macstart = 0; @@ -298,7 +290,7 @@ le_isa_attach(device_t dev) sizeof(le_isa_params[0]); i++) { if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { lesc->sc_rres = bus_alloc_resource(dev, - SYS_RES_IOPORT, &lesc->sc_rrid, 0, ~0, + SYS_RES_IOPORT, &j, 0, ~0, le_isa_params[i].iosize, RF_ACTIVE); rap = le_isa_params[i].rap; rdp = le_isa_params[i].rdp; @@ -321,22 +313,20 @@ le_isa_attach(device_t dev) error = ENXIO; goto fail_mtx; } - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); lesc->sc_rap = rap; lesc->sc_rdp = rdp; - lesc->sc_drid = 0; + i = 0; if ((lesc->sc_dres = bus_alloc_resource_any(dev, SYS_RES_DRQ, - &lesc->sc_drid, RF_ACTIVE)) == NULL) { + &i, RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate DMA channel\n"); error = ENXIO; goto fail_rres; } - lesc->sc_irid = 0; + i = 0; if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate interrupt\n"); error = ENXIO; goto fail_dres; @@ -392,7 +382,7 @@ le_isa_attach(device_t dev) error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem, sc->sc_memsize, le_isa_dma_callback, sc, 0); if (error != 0 || sc->sc_addr == 0) { - device_printf(dev, "cannot load DMA buffer map\n"); + device_printf(dev, "cannot load DMA buffer map\n"); goto fail_dmem; } @@ -405,8 +395,8 @@ le_isa_attach(device_t dev) * Extract the physical MAC address from the ROM. */ for (i = 0; i < sizeof(sc->sc_enaddr); i++) - sc->sc_enaddr[i] = bus_space_read_1(lesc->sc_regt, - lesc->sc_regh, macstart + i * macstride); + sc->sc_enaddr[i] = bus_read_1(lesc->sc_rres, + macstart + i * macstride); sc->sc_copytodesc = lance_copytobuf_contig; sc->sc_copyfromdesc = lance_copyfrombuf_contig; @@ -451,11 +441,14 @@ le_isa_attach(device_t dev) fail_pdtag: bus_dma_tag_destroy(lesc->sc_pdmat); fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); fail_dres: - bus_release_resource(dev, SYS_RES_DRQ, lesc->sc_drid, lesc->sc_dres); + bus_release_resource(dev, SYS_RES_DRQ, + rman_get_rid(lesc->sc_dres), lesc->sc_dres); fail_rres: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); fail_mtx: LE_LOCK_DESTROY(sc); return (error); @@ -476,9 +469,12 @@ le_isa_detach(device_t dev) bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); bus_dma_tag_destroy(lesc->sc_dmat); bus_dma_tag_destroy(lesc->sc_pdmat); - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - bus_release_resource(dev, SYS_RES_DRQ, lesc->sc_drid, lesc->sc_dres); - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); + bus_release_resource(dev, SYS_RES_DRQ, + rman_get_rid(lesc->sc_dres), lesc->sc_dres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); LE_LOCK_DESTROY(sc); return (0); Modified: stable/7/sys/dev/le/if_le_lebuffer.c ============================================================================== --- stable/7/sys/dev/le/if_le_lebuffer.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/if_le_lebuffer.c Thu Jan 15 20:49:17 2009 (r187313) @@ -63,17 +63,10 @@ __FBSDID("$FreeBSD$"); struct le_lebuffer_softc { struct am7990_softc sc_am7990; /* glue to MI code */ - int sc_brid; struct resource *sc_bres; - bus_space_tag_t sc_buft; - bus_space_handle_t sc_bufh; - int sc_rrid; struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - int sc_irid; struct resource *sc_ires; void *sc_ih; }; @@ -103,6 +96,7 @@ DEFINE_CLASS_0(le, le_lebuffer_driver, l sizeof(struct le_lebuffer_softc)); DRIVER_MODULE(le, lebuffer, le_lebuffer_driver, le_lebuffer_devclass, 0, 0); MODULE_DEPEND(le, ether, 1, 1, 1); +MODULE_DEPEND(le, lebuffer, 1, 1, 1); /* * Media types supported @@ -126,10 +120,9 @@ le_lebuffer_wrcsr(struct lance_softc *sc { struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RDP, val); + bus_write_2(lesc->sc_rres, LEREG1_RAP, port); + bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, LEREG1_RDP, val); } static uint16_t @@ -137,10 +130,9 @@ le_lebuffer_rdcsr(struct lance_softc *sc { struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, LEREG1_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, LEREG1_RDP)); + bus_write_2(lesc->sc_rres, LEREG1_RAP, port); + bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, LEREG1_RDP)); } /* @@ -163,17 +155,13 @@ le_lebuffer_copytodesc(struct lance_soft caddr_t from = fromv; for (; len >= 8; len -= 8, off += 8, from += 8) - bus_space_write_8(lesc->sc_buft, lesc->sc_bufh, off, - be64dec(from)); + bus_write_8(lesc->sc_bres, off, be64dec(from)); for (; len >= 4; len -= 4, off += 4, from += 4) - bus_space_write_4(lesc->sc_buft, lesc->sc_bufh, off, - be32dec(from)); + bus_write_4(lesc->sc_bres, off, be32dec(from)); for (; len >= 2; len -= 2, off += 2, from += 2) - bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off, - be16dec(from)); + bus_write_2(lesc->sc_bres, off, be16dec(from)); if (len == 1) - bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off, - *from); + bus_write_1(lesc->sc_bres, off, *from); } static void @@ -184,16 +172,15 @@ le_lebuffer_copyfromdesc(struct lance_so for (; len >= 8; len -= 8, off += 8, to += 8) be64enc(to, - bus_space_read_8(lesc->sc_buft, lesc->sc_bufh, off)); + bus_read_8(lesc->sc_bres, off)); for (; len >= 4; len -= 4, off += 4, to += 4) be32enc(to, - bus_space_read_4(lesc->sc_buft, lesc->sc_bufh, off)); + bus_read_4(lesc->sc_bres, off)); for (; len >= 2; len -= 2, off += 2, to += 2) be16enc(to, - bus_space_read_2(lesc->sc_buft, lesc->sc_bufh, off)); + bus_read_2(lesc->sc_bres, off)); if (len == 1) - *to = - bus_space_read_1(lesc->sc_buft, lesc->sc_bufh, off); + *to = bus_read_1(lesc->sc_bres, off); } static void @@ -203,11 +190,9 @@ le_lebuffer_copytobuf(struct lance_softc caddr_t from = fromv; for (; len >= 2; len -= 2, off += 2, from += 2) - bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off, - le16dec(from)); + bus_write_2(lesc->sc_bres, off, le16dec(from)); if (len == 1) - bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off + 1, - *from); + bus_write_1(lesc->sc_bres, off + 1, *from); } static void @@ -218,10 +203,9 @@ le_lebuffer_copyfrombuf(struct lance_sof for (; len >= 2; len -= 2, off += 2, to += 2) le16enc(to, - bus_space_read_2(lesc->sc_buft, lesc->sc_bufh, off)); + bus_read_2(lesc->sc_bres, off)); if (len == 1) - *to = - bus_space_read_1(lesc->sc_buft, lesc->sc_bufh, off + 1); + *to = bus_read_1(lesc->sc_bres, off + 1); } static void @@ -230,9 +214,9 @@ le_lebuffer_zerobuf(struct lance_softc * struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; for (; len >= 2; len -= 2, off += 2) - bus_space_write_2(lesc->sc_buft, lesc->sc_bufh, off, 0); + bus_write_2(lesc->sc_bres, off, 0); if (len == 1) - bus_space_write_1(lesc->sc_buft, lesc->sc_bufh, off + 1, 0); + bus_write_1(lesc->sc_bres, off + 1, 0); } static int @@ -251,7 +235,7 @@ le_lebuffer_attach(device_t dev) { struct le_lebuffer_softc *lesc; struct lance_softc *sc; - int error; + int error, i; lesc = device_get_softc(dev); sc = &lesc->sc_am7990.lsc; @@ -262,33 +246,29 @@ le_lebuffer_attach(device_t dev) * The "register space" of the parent is just a buffer where the * the LANCE descriptor rings and the RX/TX buffers can be stored. */ - lesc->sc_brid = 0; + i = 0; lesc->sc_bres = bus_alloc_resource_any(device_get_parent(dev), - SYS_RES_MEMORY, &lesc->sc_brid, RF_ACTIVE); + SYS_RES_MEMORY, &i, RF_ACTIVE); if (lesc->sc_bres == NULL) { device_printf(dev, "cannot allocate LANCE buffer\n"); error = ENXIO; goto fail_mtx; } - lesc->sc_buft = rman_get_bustag(lesc->sc_bres); - lesc->sc_bufh = rman_get_bushandle(lesc->sc_bres); /* Allocate LANCE registers. */ - lesc->sc_rrid = 0; + i = 0; lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &lesc->sc_rrid, RF_ACTIVE); + &i, RF_ACTIVE); if (lesc->sc_rres == NULL) { device_printf(dev, "cannot allocate LANCE registers\n"); error = ENXIO; goto fail_bres; } - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); /* Allocate LANCE interrupt. */ - lesc->sc_irid = 0; + i = 0; if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate interrupt\n"); error = ENXIO; goto fail_rres; @@ -352,12 +332,14 @@ le_lebuffer_attach(device_t dev) fail_am7990: am7990_detach(&lesc->sc_am7990); fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); fail_rres: - bus_release_resource(dev, SYS_RES_MEMORY, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); fail_bres: bus_release_resource(device_get_parent(dev), SYS_RES_MEMORY, - lesc->sc_brid, lesc->sc_bres); + rman_get_rid(lesc->sc_bres), lesc->sc_bres); fail_mtx: LE_LOCK_DESTROY(sc); return (error); @@ -374,10 +356,12 @@ le_lebuffer_detach(device_t dev) bus_teardown_intr(dev, lesc->sc_ires, lesc->sc_ih); am7990_detach(&lesc->sc_am7990); - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - bus_release_resource(dev, SYS_RES_MEMORY, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); bus_release_resource(device_get_parent(dev), SYS_RES_MEMORY, - lesc->sc_brid, lesc->sc_bres); + rman_get_rid(lesc->sc_bres), lesc->sc_bres); LE_LOCK_DESTROY(sc); return (0); Modified: stable/7/sys/dev/le/if_le_pci.c ============================================================================== --- stable/7/sys/dev/le/if_le_pci.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/if_le_pci.c Thu Jan 15 20:49:17 2009 (r187313) @@ -111,12 +111,8 @@ __FBSDID("$FreeBSD$"); struct le_pci_softc { struct am79900_softc sc_am79900; /* glue to MI code */ - int sc_rrid; struct resource *sc_rres; - bus_space_tag_t sc_regt; - bus_space_handle_t sc_regh; - int sc_irid; struct resource *sc_ires; void *sc_ih; @@ -174,10 +170,9 @@ le_pci_wrbcr(struct lance_softc *sc, uin { struct le_pci_softc *lesc = (struct le_pci_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_BDP, val); + bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port); + bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, PCNET_PCI_BDP, val); } static uint16_t @@ -185,10 +180,9 @@ le_pci_rdbcr(struct lance_softc *sc, uin { struct le_pci_softc *lesc = (struct le_pci_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_BDP)); + bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port); + bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, PCNET_PCI_BDP)); } static void @@ -196,10 +190,9 @@ le_pci_wrcsr(struct lance_softc *sc, uin { struct le_pci_softc *lesc = (struct le_pci_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RDP, val); + bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port); + bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE); + bus_write_2(lesc->sc_rres, PCNET_PCI_RDP, val); } static uint16_t @@ -207,10 +200,9 @@ le_pci_rdcsr(struct lance_softc *sc, uin { struct le_pci_softc *lesc = (struct le_pci_softc *)sc; - bus_space_write_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, port); - bus_space_barrier(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RAP, 2, - BUS_SPACE_BARRIER_WRITE); - return (bus_space_read_2(lesc->sc_regt, lesc->sc_regh, PCNET_PCI_RDP)); + bus_write_2(lesc->sc_rres, PCNET_PCI_RAP, port); + bus_barrier(lesc->sc_rres, PCNET_PCI_RAP, 2, BUS_SPACE_BARRIER_WRITE); + return (bus_read_2(lesc->sc_rres, PCNET_PCI_RDP)); } static int @@ -322,20 +314,18 @@ le_pci_attach(device_t dev) pci_enable_busmaster(dev); pci_enable_io(dev, PCIM_CMD_PORTEN); - lesc->sc_rrid = PCIR_BAR(0); + i = PCIR_BAR(0); lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, - &lesc->sc_rrid, RF_ACTIVE); + &i, RF_ACTIVE); if (lesc->sc_rres == NULL) { device_printf(dev, "cannot allocate registers\n"); error = ENXIO; goto fail_mtx; } - lesc->sc_regt = rman_get_bustag(lesc->sc_rres); - lesc->sc_regh = rman_get_bushandle(lesc->sc_rres); - lesc->sc_irid = 0; + i = 0; if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &lesc->sc_irid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate interrupt\n"); error = ENXIO; goto fail_rres; @@ -392,7 +382,7 @@ le_pci_attach(device_t dev) error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem, sc->sc_memsize, le_pci_dma_callback, sc, 0); if (error != 0 || sc->sc_addr == 0) { - device_printf(dev, "cannot load DMA buffer map\n"); + device_printf(dev, "cannot load DMA buffer map\n"); goto fail_dmem; } @@ -417,9 +407,8 @@ le_pci_attach(device_t dev) /* * Extract the physical MAC address from the ROM. */ - for (i = 0; i < sizeof(sc->sc_enaddr); i++) - sc->sc_enaddr[i] = - bus_space_read_1(lesc->sc_regt, lesc->sc_regh, i); + bus_read_region_1(lesc->sc_rres, 0, sc->sc_enaddr, + sizeof(sc->sc_enaddr)); sc->sc_copytodesc = lance_copytobuf_contig; sc->sc_copyfromdesc = lance_copyfrombuf_contig; @@ -461,9 +450,11 @@ le_pci_attach(device_t dev) fail_pdtag: bus_dma_tag_destroy(lesc->sc_pdmat); fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); fail_rres: - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); fail_mtx: LE_LOCK_DESTROY(sc); return (error); @@ -484,8 +475,10 @@ le_pci_detach(device_t dev) bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); bus_dma_tag_destroy(lesc->sc_dmat); bus_dma_tag_destroy(lesc->sc_pdmat); - bus_release_resource(dev, SYS_RES_IRQ, lesc->sc_irid, lesc->sc_ires); - bus_release_resource(dev, SYS_RES_IOPORT, lesc->sc_rrid, lesc->sc_rres); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(lesc->sc_ires), lesc->sc_ires); + bus_release_resource(dev, SYS_RES_IOPORT, + rman_get_rid(lesc->sc_rres), lesc->sc_rres); LE_LOCK_DESTROY(sc); return (0); Modified: stable/7/sys/dev/le/lebuffer_sbus.c ============================================================================== --- stable/7/sys/dev/le/lebuffer_sbus.c Thu Jan 15 20:45:59 2009 (r187312) +++ stable/7/sys/dev/le/lebuffer_sbus.c Thu Jan 15 20:49:17 2009 (r187313) @@ -100,6 +100,8 @@ static device_method_t lebuffer_methods[ DEFINE_CLASS_0(lebuffer, lebuffer_driver, lebuffer_methods, 1); DRIVER_MODULE(lebuffer, sbus, lebuffer_driver, lebuffer_devclass, 0, 0); +MODULE_DEPEND(lebuffer, sbus, 1, 1, 1); +MODULE_VERSION(lebuffer, 1); static int lebuffer_probe(device_t dev) From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 21:23:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71A6C1065678; Thu, 15 Jan 2009 21:23:45 +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 5DDF78FC13; Thu, 15 Jan 2009 21:23:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FLNjBs087846; Thu, 15 Jan 2009 21:23:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FLNjH8087843; Thu, 15 Jan 2009 21:23:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152123.n0FLNjH8087843@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 21:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187314 - in stable/6/sys: . dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 21:23:47 -0000 Author: marius Date: Thu Jan 15 21:23:44 2009 New Revision: 187314 URL: http://svn.freebsd.org/changeset/base/187314 Log: MFC: r180692 o Fix style(9) bugs and similar nits. o Merge ncr53c9x.c from NetBSD: 1.115: fix variable shadowing 1.118: __inline -> inline 1.121: fix empty if Modified: stable/6/sys/ (props changed) stable/6/sys/dev/esp/esp_sbus.c stable/6/sys/dev/esp/ncr53c9x.c stable/6/sys/dev/esp/ncr53c9xvar.h Modified: stable/6/sys/dev/esp/esp_sbus.c ============================================================================== --- stable/6/sys/dev/esp/esp_sbus.c Thu Jan 15 20:49:17 2009 (r187313) +++ stable/6/sys/dev/esp/esp_sbus.c Thu Jan 15 21:23:44 2009 (r187314) @@ -158,19 +158,19 @@ MODULE_DEPEND(esp, sbus, 1, 1, 1); MODULE_DEPEND(esp, cam, 1, 1, 1); /* - * Functions and the switch for the MI code. + * Functions and the switch for the MI code */ -static u_char esp_read_reg(struct ncr53c9x_softc *, int); -static void esp_write_reg(struct ncr53c9x_softc *, int, u_char); -static int esp_dma_isintr(struct ncr53c9x_softc *); -static void esp_dma_reset(struct ncr53c9x_softc *); -static int esp_dma_intr(struct ncr53c9x_softc *); -static int esp_dma_setup(struct ncr53c9x_softc *, caddr_t *, size_t *, - int, size_t *); -static void esp_dma_go(struct ncr53c9x_softc *); -static void esp_dma_stop(struct ncr53c9x_softc *); -static int esp_dma_isactive(struct ncr53c9x_softc *); -static int espattach(struct esp_softc *, struct ncr53c9x_glue *); +static u_char esp_read_reg(struct ncr53c9x_softc *sc, int reg); +static void esp_write_reg(struct ncr53c9x_softc *sc, int reg, u_char v); +static int esp_dma_isintr(struct ncr53c9x_softc *sc); +static void esp_dma_reset(struct ncr53c9x_softc *sc); +static int esp_dma_intr(struct ncr53c9x_softc *sc); +static int esp_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, + size_t *len, int datain, size_t *dmasize); +static void esp_dma_go(struct ncr53c9x_softc *sc); +static void esp_dma_stop(struct ncr53c9x_softc *sc); +static int esp_dma_isactive(struct ncr53c9x_softc *sc); +static int espattach(struct esp_softc *esc, struct ncr53c9x_glue *gluep); static struct ncr53c9x_glue esp_sbus_glue = { esp_read_reg, @@ -311,7 +311,7 @@ esp_sbus_attach(device_t dev) esc->sc_regh = rman_get_bushandle(esc->sc_res); } else { /* - * Search accompanying DMA engine. It should have been + * Search accompanying DMA engine. It should have been * already attached otherwise there isn't much we can do. */ if (device_get_children(device_get_parent(dev), &children, @@ -498,9 +498,6 @@ esp_resume(device_t dev) return (ENXIO); } -/* - * Attach this instance, and then all the sub-devices - */ static int espattach(struct esp_softc *esc, struct ncr53c9x_glue *gluep) { @@ -530,7 +527,7 @@ espattach(struct esp_softc *esc, struct */ /* - * Read the part-unique ID code of the SCSI chip. The contained + * Read the part-unique ID code of the SCSI chip. The contained * value is only valid if all of the following conditions are met: * - After power-up or chip reset. * - Before any value is written to this register. @@ -570,7 +567,7 @@ espattach(struct esp_softc *esc, struct (NCRCFG3_CDB | NCRCFG3_FCLK)) { sc->sc_rev = NCR_VARIANT_ESP100A; } else { - /* NCRCFG2_FE enables > 64K transfers */ + /* NCRCFG2_FE enables > 64K transfers. */ sc->sc_cfg2 |= NCRCFG2_FE; sc->sc_cfg3 = 0; NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3); @@ -581,15 +578,18 @@ espattach(struct esp_softc *esc, struct case 0x00: sc->sc_rev = NCR_VARIANT_FAS100A; break; + case 0x02: if ((uid & 0x07) == 0x02) sc->sc_rev = NCR_VARIANT_FAS216; else sc->sc_rev = NCR_VARIANT_FAS236; break; + case 0x0a: sc->sc_rev = NCR_VARIANT_FAS366; break; + default: /* * We could just treat unknown chips @@ -660,10 +660,10 @@ espattach(struct esp_softc *esc, struct /* * The onboard SCSI chips in Sun Ultra 1 are actually * documented to be NCR53C9X which use NCRCFG3_FCLK and - * NCRCFG3_FSCSI. BSD/OS however probes these chips as + * NCRCFG3_FSCSI. BSD/OS however probes these chips as * FAS100A and uses NCRF9XCFG3_FCLK and NCRF9XCFG3_FSCSI * instead which seems to be correct as otherwise sync - * negotiation just doesn't work. Using NCRF9XCFG3_FCLK + * negotiation just doesn't work. Using NCRF9XCFG3_FCLK * and NCRF9XCFG3_FSCSI with these chips in fact also * yields Fast-SCSI speed. */ @@ -683,7 +683,7 @@ espattach(struct esp_softc *esc, struct /* Limit minsync due to unsolved performance issues. */ sc->sc_maxsync = sc->sc_minsync; - /* Establish interrupt channel */ + /* Establish interrupt channel. */ esc->sc_irqrid = 0; if ((esc->sc_irqres = bus_alloc_resource_any(esc->sc_dev, SYS_RES_IRQ, &esc->sc_irqrid, RF_SHAREABLE|RF_ACTIVE)) == NULL) { @@ -697,7 +697,7 @@ espattach(struct esp_softc *esc, struct goto fail_ires; } - /* Turn on target selection using the `DMA' method */ + /* Turn on target selection using the `DMA' method. */ if (sc->sc_rev != NCR_VARIANT_FAS366) sc->sc_features |= NCR_F_DMASELECT; @@ -720,7 +720,7 @@ espattach(struct esp_softc *esc, struct } /* - * Glue functions. + * Glue functions */ #ifdef ESP_SBUS_DEBUG @@ -844,11 +844,8 @@ static void esp_dma_stop(struct ncr53c9x_softc *sc) { struct esp_softc *esc = (struct esp_softc *)sc; - uint32_t csr; - csr = L64854_GCSR(esc->sc_dma); - csr &= ~D_EN_DMA; - L64854_SCSR(esc->sc_dma, csr); + L64854_SCSR(esc->sc_dma, L64854_GCSR(esc->sc_dma) & ~D_EN_DMA); } static int Modified: stable/6/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/6/sys/dev/esp/ncr53c9x.c Thu Jan 15 20:49:17 2009 (r187313) +++ stable/6/sys/dev/esp/ncr53c9x.c Thu Jan 15 21:23:44 2009 (r187314) @@ -129,46 +129,54 @@ __FBSDID("$FreeBSD$"); #include #include -int ncr53c9x_debug = NCR_SHOWMISC /*|NCR_SHOWPHASE|NCR_SHOWTRAC|NCR_SHOWCMDS*/; +int ncr53c9x_debug = + NCR_SHOWMISC /* | NCR_SHOWPHASE | NCR_SHOWTRAC | NCR_SHOWCMDS */; #ifdef DEBUG int ncr53c9x_notag = 0; #endif -static void ncr53c9x_select(struct ncr53c9x_softc *, struct ncr53c9x_ecb *); -static int ncr53c9x_reselect(struct ncr53c9x_softc *, int, int, int); -static void ncr53c9x_scsi_reset(struct ncr53c9x_softc *); -static void ncr53c9x_poll(struct cam_sim *); -static void ncr53c9x_sched(struct ncr53c9x_softc *); -static void ncr53c9x_done(struct ncr53c9x_softc *, struct ncr53c9x_ecb *); -static void ncr53c9x_msgin(struct ncr53c9x_softc *); -static void ncr53c9x_msgout(struct ncr53c9x_softc *); +static void ncr53c9x_abort(struct ncr53c9x_softc *sc, + struct ncr53c9x_ecb *ecb); +static void ncr53c9x_dequeue(struct ncr53c9x_softc *sc, + struct ncr53c9x_ecb *ecb); +static void ncr53c9x_done(struct ncr53c9x_softc *sc, + struct ncr53c9x_ecb *ecb); +static void ncr53c9x_free_ecb(struct ncr53c9x_softc *sc, + struct ncr53c9x_ecb *ecb); +static void ncr53c9x_msgin(struct ncr53c9x_softc *sc); +static void ncr53c9x_msgout(struct ncr53c9x_softc *sc); +static void ncr53c9x_poll(struct cam_sim *sim); +static int ncr53c9x_rdfifo(struct ncr53c9x_softc *sc, int how); +static int ncr53c9x_reselect(struct ncr53c9x_softc *sc, int message, + int tagtype, int tagid); +static void ncr53c9x_sense(struct ncr53c9x_softc *sc, + struct ncr53c9x_ecb *ecb); +static void ncr53c9x_scsi_reset(struct ncr53c9x_softc *sc); +static void ncr53c9x_sched(struct ncr53c9x_softc *sc); +static void ncr53c9x_select(struct ncr53c9x_softc *sc, + struct ncr53c9x_ecb *ecb); static void ncr53c9x_timeout(void *arg); static void ncr53c9x_watch(void *arg); -static void ncr53c9x_abort(struct ncr53c9x_softc *, struct ncr53c9x_ecb *); -static void ncr53c9x_dequeue(struct ncr53c9x_softc *, - struct ncr53c9x_ecb *); -static void ncr53c9x_sense(struct ncr53c9x_softc *, struct ncr53c9x_ecb *); -static void ncr53c9x_free_ecb(struct ncr53c9x_softc *, - struct ncr53c9x_ecb *); -static void ncr53c9x_wrfifo(struct ncr53c9x_softc *, u_char *, int); -static int ncr53c9x_rdfifo(struct ncr53c9x_softc *, int); - -static struct ncr53c9x_ecb *ncr53c9x_get_ecb(struct ncr53c9x_softc *); -static struct ncr53c9x_linfo *ncr53c9x_lunsearch(struct ncr53c9x_tinfo *, - int64_t lun); - -static __inline void ncr53c9x_readregs(struct ncr53c9x_softc *); -static __inline int ncr53c9x_stp2cpb(struct ncr53c9x_softc *, int); -static __inline void ncr53c9x_setsync(struct ncr53c9x_softc *, - struct ncr53c9x_tinfo *); +static void ncr53c9x_wrfifo(struct ncr53c9x_softc *sc, u_char *p, + int len); -#define NCR_RDFIFO_START 0 -#define NCR_RDFIFO_CONTINUE 1 +static struct ncr53c9x_ecb *ncr53c9x_get_ecb(struct ncr53c9x_softc *sc); +static struct ncr53c9x_linfo *ncr53c9x_lunsearch(struct ncr53c9x_tinfo *sc, + int64_t lun); + +static inline void ncr53c9x_readregs(struct ncr53c9x_softc *sc); +static inline void ncr53c9x_setsync(struct ncr53c9x_softc *sc, + struct ncr53c9x_tinfo *ti); +static inline int ncr53c9x_stp2cpb(struct ncr53c9x_softc *sc, + int period); -#define NCR_SET_COUNT(sc, size) do { \ - NCR_WRITE_REG((sc), NCR_TCL, (size)); \ +#define NCR_RDFIFO_START 0 +#define NCR_RDFIFO_CONTINUE 1 + +#define NCR_SET_COUNT(sc, size) do { \ + NCR_WRITE_REG((sc), NCR_TCL, (size)); \ NCR_WRITE_REG((sc), NCR_TCM, (size) >> 8); \ - if ((sc->sc_cfg2 & NCRCFG2_FE) || \ + if ((sc->sc_cfg2 & NCRCFG2_FE) || \ (sc->sc_rev == NCR_VARIANT_FAS366)) { \ NCR_WRITE_REG((sc), NCR_TCH, (size) >> 16); \ } \ @@ -178,8 +186,8 @@ static __inline void ncr53c9x_setsync(st } while (0) #ifndef mstohz -#define mstohz(ms) \ - (((ms) < 0x20000) ? \ +#define mstohz(ms) \ + (((ms) < 0x20000) ? \ ((ms +0u) / 1000u) * hz : \ ((ms +0u) * hz) /1000u) #endif @@ -211,6 +219,7 @@ static struct ncr53c9x_linfo * ncr53c9x_lunsearch(struct ncr53c9x_tinfo *ti, int64_t lun) { struct ncr53c9x_linfo *li; + LIST_FOREACH(li, &ti->luns, link) if (li->lun == lun) return (li); @@ -248,7 +257,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s /* * Allocate SCSI message buffers. * Front-ends can override allocation to avoid alignment - * handling in the DMA engines. Note that that ncr53c9x_msgout() + * handling in the DMA engines. Note that ncr53c9x_msgout() * can request a 1 byte DMA transfer. */ if (sc->sc_omess == NULL) { @@ -294,12 +303,12 @@ ncr53c9x_attach(struct ncr53c9x_softc *s sc->sc_ccf = FREQTOCCF(sc->sc_freq); - /* The value *must not* be == 1. Make it 2 */ + /* The value *must not* be == 1. Make it 2. */ if (sc->sc_ccf == 1) sc->sc_ccf = 2; /* - * The recommended timeout is 250ms. This register is loaded + * The recommended timeout is 250ms. This register is loaded * with a value calculated as follows, from the docs: * * (timout period) x (CLK frequency) @@ -311,11 +320,11 @@ ncr53c9x_attach(struct ncr53c9x_softc *s */ sc->sc_timeout = ((250 * 1000) * sc->sc_freq) / (8192 * sc->sc_ccf); - /* CCF register only has 3 bits; 0 is actually 8 */ + /* The CCF register only has 3 bits; 0 is actually 8. */ sc->sc_ccf &= 7; /* - * Register with CAM + * Register with CAM. */ devq = cam_simq_alloc(sc->sc_ntarg); if (devq == NULL) { @@ -325,8 +334,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s } sim = cam_sim_alloc(ncr53c9x_action, ncr53c9x_poll, "esp", sc, - device_get_unit(sc->sc_dev), 1, - NCR_TAG_DEPTH, devq); + device_get_unit(sc->sc_dev), 1, NCR_TAG_DEPTH, devq); if (sim == NULL) { device_printf(sc->sc_dev, "cannot allocate SIM entry\n"); error = ENOMEM; @@ -339,8 +347,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s } if (xpt_create_path(&path, NULL, cam_sim_path(sim), - CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) - != CAM_REQ_CMP) { + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { device_printf(sc->sc_dev, "cannot create path\n"); error = EIO; goto fail_bus; @@ -349,16 +356,19 @@ ncr53c9x_attach(struct ncr53c9x_softc *s sc->sc_sim = sim; sc->sc_path = path; - /* Reset state & bus */ + /* Reset state and bus. */ #if 0 sc->sc_cfflags = sc->sc_dev.dv_cfdata->cf_flags; +#else + sc->sc_cfflags = 0; #endif sc->sc_state = 0; ncr53c9x_init(sc, 1); TAILQ_INIT(&sc->free_list); - if ((sc->ecb_array = malloc(sizeof(struct ncr53c9x_ecb) * NCR_TAG_DEPTH, - M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) { + if ((sc->ecb_array = + malloc(sizeof(struct ncr53c9x_ecb) * NCR_TAG_DEPTH, M_DEVBUF, + M_NOWAIT | M_ZERO)) == NULL) { device_printf(sc->sc_dev, "cannot allocate ECB array\n"); error = ENOMEM; goto fail_path; @@ -416,8 +426,8 @@ ncr53c9x_detach(struct ncr53c9x_softc *s } /* - * This is the generic ncr53c9x reset function. It does not reset the SCSI bus, - * only this controller, but kills any on-going commands, and also stops + * This is the generic ncr53c9x reset function. It does not reset the SCSI + * bus, only this controller, but kills any on-going commands, and also stops * and resets the DMA. * * After reset, registers are loaded with the defaults from the attach @@ -427,20 +437,21 @@ void ncr53c9x_reset(struct ncr53c9x_softc *sc) { - /* reset DMA first */ + /* Reset DMA first. */ NCRDMA_RESET(sc); - /* reset SCSI chip */ + /* Reset SCSI chip. */ NCRCMD(sc, NCRCMD_RSTCHIP); NCRCMD(sc, NCRCMD_NOP); DELAY(500); - /* do these backwards, and fall through */ + /* Do these backwards, and fall through. */ switch (sc->sc_rev) { case NCR_VARIANT_ESP406: case NCR_VARIANT_FAS408: NCR_WRITE_REG(sc, NCR_CFG5, sc->sc_cfg5 | NCRCFG5_SINT); NCR_WRITE_REG(sc, NCR_CFG4, sc->sc_cfg4); + /* FALLTHROUGH */ case NCR_VARIANT_AM53C974: case NCR_VARIANT_FAS100A: case NCR_VARIANT_FAS216: @@ -450,9 +461,11 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc case NCR_VARIANT_ESP200: sc->sc_features |= NCR_F_HASCFG3; NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3); + /* FALLTHROUGH */ case NCR_VARIANT_ESP100A: sc->sc_features |= NCR_F_SELATN3; NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); + /* FALLTHROUGH */ case NCR_VARIANT_ESP100: NCR_WRITE_REG(sc, NCR_CFG1, sc->sc_cfg1); NCR_WRITE_REG(sc, NCR_CCF, sc->sc_ccf); @@ -466,7 +479,7 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc sc->sc_cfg3 = NCRFASCFG3_FASTCLK | NCRFASCFG3_OBAUTO; sc->sc_cfg3_fscsi = NCRFASCFG3_FASTSCSI; NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3); - sc->sc_cfg2 = 0; /* NCRCFG2_HMEFE| NCRCFG2_HME32 */ + sc->sc_cfg2 = 0; /* NCRCFG2_HMEFE | NCRCFG2_HME32 */ NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); NCR_WRITE_REG(sc, NCR_CFG1, sc->sc_cfg1); NCR_WRITE_REG(sc, NCR_CCF, sc->sc_ccf); @@ -475,8 +488,8 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc break; default: - device_printf(sc->sc_dev, "unknown revision code, " - "assuming ESP100\n"); + device_printf(sc->sc_dev, + "unknown revision code, assuming ESP100\n"); NCR_WRITE_REG(sc, NCR_CFG1, sc->sc_cfg1); NCR_WRITE_REG(sc, NCR_CCF, sc->sc_ccf); NCR_WRITE_REG(sc, NCR_SYNCOFF, 0); @@ -488,7 +501,7 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc #if 0 device_printf(sc->sc_dev, "ncr53c9x_reset: revision %d\n", - sc->sc_rev); + sc->sc_rev); device_printf(sc->sc_dev, "ncr53c9x_reset: cfg1 0x%x, cfg2 0x%x, " "cfg3 0x%x, ccf 0x%x, timeout 0x%x\n", sc->sc_cfg1, sc->sc_cfg2, sc->sc_cfg3, sc->sc_ccf, sc->sc_timeout); @@ -496,7 +509,7 @@ ncr53c9x_reset(struct ncr53c9x_softc *sc } /* - * Reset the SCSI bus, but not the chip + * Reset the SCSI bus, but not the chip. */ static void ncr53c9x_scsi_reset(struct ncr53c9x_softc *sc) @@ -510,13 +523,14 @@ ncr53c9x_scsi_reset(struct ncr53c9x_soft } /* - * Initialize ncr53c9x state machine + * Initialize ncr53c9x state machine. */ void ncr53c9x_init(struct ncr53c9x_softc *sc, int doreset) { struct ncr53c9x_ecb *ecb; struct ncr53c9x_linfo *li; + struct ncr53c9x_tinfo *ti; int i, r; NCR_MISC(("[NCR_INIT(%d) %d] ", doreset, sc->sc_state)); @@ -538,13 +552,13 @@ ncr53c9x_init(struct ncr53c9x_softc *sc, ecb->ccb->ccb_h.status = CAM_CMD_TIMEOUT; ncr53c9x_done(sc, ecb); } - /* Cancel outstanding disconnected commands on each LUN */ + /* Cancel outstanding disconnected commands on each LUN. */ for (r = 0; r < sc->sc_ntarg; r++) { LIST_FOREACH(li, &sc->sc_tinfo[r].luns, link) { if ((ecb = li->untagged) != NULL) { li->untagged = NULL; /* - * XXXXXXX + * XXX * * Should we terminate a command * that never reached the disk? @@ -567,7 +581,7 @@ ncr53c9x_init(struct ncr53c9x_softc *sc, } /* - * reset the chip to a known state + * Reset the chip to a known state. */ ncr53c9x_reset(sc); @@ -576,12 +590,14 @@ ncr53c9x_init(struct ncr53c9x_softc *sc, sc->sc_phase = sc->sc_prevphase = INVALID_PHASE; for (r = 0; r < sc->sc_ntarg; r++) { - struct ncr53c9x_tinfo *ti = &sc->sc_tinfo[r]; + ti = &sc->sc_tinfo[r]; /* XXX - config flags per target: low bits: no reselect; high bits: no synch */ + ti->flags = ((sc->sc_minsync != 0 && + (sc->sc_cfflags & (1 << ((r & 7) + 8))) == 0) ? + 0 : T_SYNCHOFF) | + ((sc->sc_cfflags & (1 << (r & 7))) == 0 ? + 0 : T_RSELECTOFF); - ti->flags = ((sc->sc_minsync && !(sc->sc_cfflags & (1<<((r&7)+8)))) - ? 0 : T_SYNCHOFF) | - ((sc->sc_cfflags & (1<<(r&7))) ? T_RSELECTOFF : 0); #ifdef DEBUG if (ncr53c9x_notag) ti->flags &= ~T_TAG; @@ -606,15 +622,15 @@ ncr53c9x_init(struct ncr53c9x_softc *sc, * NCR_INTR - so make sure it is the last read. * * I think that (from reading the docs) most bits in these registers - * only make sense when he DMA CSR has an interrupt showing. Call only + * only make sense when the DMA CSR has an interrupt showing. Call only * if an interrupt is pending. */ -static __inline void +static inline void ncr53c9x_readregs(struct ncr53c9x_softc *sc) { sc->sc_espstat = NCR_READ_REG(sc, NCR_STAT); - /* Only the stepo bits are of interest */ + /* Only the step bits are of interest. */ sc->sc_espstep = NCR_READ_REG(sc, NCR_STEP) & NCRSTEP_MASK; if (sc->sc_rev == NCR_VARIANT_FAS366) @@ -629,9 +645,8 @@ ncr53c9x_readregs(struct ncr53c9x_softc * Determine the SCSI bus phase, return either a real SCSI bus phase * or some pseudo phase we use to detect certain exceptions. */ - sc->sc_phase = (sc->sc_espintr & NCRINTR_DIS) ? - /* Disconnected */ BUSFREE_PHASE : sc->sc_espstat & NCRSTAT_PHASE; + BUSFREE_PHASE : sc->sc_espstat & NCRSTAT_PHASE; NCR_INTS(("regs[intr=%02x,stat=%02x,step=%02x,stat2=%02x] ", sc->sc_espintr, sc->sc_espstat, sc->sc_espstep, sc->sc_espstat2)); @@ -640,18 +655,18 @@ ncr53c9x_readregs(struct ncr53c9x_softc /* * Convert Synchronous Transfer Period to chip register Clock Per Byte value. */ -static __inline int +static inline int ncr53c9x_stp2cpb(struct ncr53c9x_softc *sc, int period) { int v; v = (sc->sc_freq * period) / 250; if (ncr53c9x_cpb2stp(sc, v) < period) - /* Correct round-down error */ + /* Correct round-down error. */ v++; return (v); } -static __inline void +static inline void ncr53c9x_setsync(struct ncr53c9x_softc *sc, struct ncr53c9x_tinfo *ti) { u_char syncoff, synctp; @@ -705,20 +720,17 @@ ncr53c9x_setsync(struct ncr53c9x_softc * static void ncr53c9x_select(struct ncr53c9x_softc *sc, struct ncr53c9x_ecb *ecb) { - int target = ecb->ccb->ccb_h.target_id; - int lun = ecb->ccb->ccb_h.target_lun; struct ncr53c9x_tinfo *ti; - int tiflags; u_char *cmd; - int clen; - int selatn3, selatns; size_t dmasize; + int clen, selatn3, selatns; + int lun = ecb->ccb->ccb_h.target_lun; + int target = ecb->ccb->ccb_h.target_id; NCR_TRACE(("[ncr53c9x_select(t%d,l%d,cmd:%x,tag:%x,%x)] ", target, lun, ecb->cmd.cmd.opcode, ecb->tag[0], ecb->tag[1])); ti = &sc->sc_tinfo[target]; - tiflags = ti->flags; sc->sc_state = NCR_SELECTING; /* * Schedule the timeout now, the first time we will go away @@ -730,7 +742,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s /* * The docs say the target register is never reset, and I - * can't think of a better place to set it + * can't think of a better place to set it. */ if (sc->sc_rev == NCR_VARIANT_FAS366) { NCRCMD(sc, NCRCMD_FLUSH); @@ -756,9 +768,9 @@ ncr53c9x_select(struct ncr53c9x_softc *s NCR_SET_COUNT(sc, dmasize); if (sc->sc_rev != NCR_VARIANT_FAS366) - NCRCMD(sc, NCRCMD_NOP|NCRCMD_DMA); + NCRCMD(sc, NCRCMD_NOP | NCRCMD_DMA); - /* And get the targets attention */ + /* And get the target's attention */ NCRCMD(sc, NCRCMD_SELNATN | NCRCMD_DMA); NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &dmasize); @@ -773,15 +785,15 @@ ncr53c9x_select(struct ncr53c9x_softc *s selatn3 = selatns = 0; if (ecb->tag[0] != 0) { if (sc->sc_features & NCR_F_SELATN3) - /* use SELATN3 to send tag messages */ + /* Use SELATN3 to send tag messages. */ selatn3 = 1; else - /* We don't have SELATN3; use SELATNS to send tags */ + /* We don't have SELATN3; use SELATNS to send tags. */ selatns = 1; } if (ti->flags & T_NEGOTIATE) { - /* We have to use SELATNS to send sync/wide messages */ + /* We have to use SELATNS to send sync/wide messages. */ selatn3 = 0; selatns = 1; } @@ -789,34 +801,33 @@ ncr53c9x_select(struct ncr53c9x_softc *s cmd = (u_char *)&ecb->cmd.cmd; if (selatn3) { - /* We'll use tags with SELATN3 */ + /* We'll use tags with SELATN3. */ clen = ecb->clen + 3; cmd -= 3; cmd[0] = MSG_IDENTIFY(lun, 1); /* msg[0] */ cmd[1] = ecb->tag[0]; /* msg[1] */ cmd[2] = ecb->tag[1]; /* msg[2] */ } else { - /* We don't have tags, or will send messages with SELATNS */ + /* We don't have tags, or will send messages with SELATNS. */ clen = ecb->clen + 1; cmd -= 1; - cmd[0] = MSG_IDENTIFY(lun, (tiflags & T_RSELECTOFF) == 0); + cmd[0] = MSG_IDENTIFY(lun, (ti->flags & T_RSELECTOFF) == 0); } if ((sc->sc_features & NCR_F_DMASELECT) && !selatns) { - - /* setup DMA transfer for command */ + /* Setup DMA transfer for command. */ dmasize = clen; sc->sc_cmdlen = clen; sc->sc_cmdp = cmd; - /* Program the SCSI counter */ + /* Program the SCSI counter. */ NCR_SET_COUNT(sc, dmasize); - /* load the count in */ + /* Load the count in. */ /* if (sc->sc_rev != NCR_VARIANT_FAS366) */ - NCRCMD(sc, NCRCMD_NOP|NCRCMD_DMA); + NCRCMD(sc, NCRCMD_NOP | NCRCMD_DMA); - /* And get the targets attention */ + /* And get the target's attention. */ if (selatn3) { sc->sc_msgout = SEND_TAG; sc->sc_flags |= NCR_ATN; @@ -833,13 +844,13 @@ ncr53c9x_select(struct ncr53c9x_softc *s * happy for it to disconnect etc. */ - /* Now get the command into the FIFO */ + /* Now get the command into the FIFO. */ ncr53c9x_wrfifo(sc, cmd, clen); - /* And get the targets attention */ + /* And get the target's attention. */ if (selatns) { NCR_MSGS(("SELATNS \n")); - /* Arbitrate, select and stop after IDENTIFY message */ + /* Arbitrate, select and stop after IDENTIFY message. */ NCRCMD(sc, NCRCMD_SELATNS); } else if (selatn3) { sc->sc_msgout = SEND_TAG; @@ -855,7 +866,6 @@ ncr53c9x_free_ecb(struct ncr53c9x_softc ecb->flags = 0; TAILQ_INSERT_TAIL(&sc->free_list, ecb, free_links); - return; } static struct ncr53c9x_ecb * @@ -870,7 +880,7 @@ ncr53c9x_get_ecb(struct ncr53c9x_softc * TAILQ_REMOVE(&sc->free_list, ecb, free_links); ecb->flags = ECB_ALLOC; bzero(&ecb->ccb, sizeof(struct ncr53c9x_ecb) - - offsetof(struct ncr53c9x_ecb, ccb)); + offsetof(struct ncr53c9x_ecb, ccb)); } return (ecb); } @@ -880,7 +890,7 @@ ncr53c9x_get_ecb(struct ncr53c9x_softc * */ /* - * Start a SCSI-command + * Start a SCSI-command. * This function is called by the higher level SCSI-driver to queue/run * SCSI-commands. */ @@ -888,8 +898,13 @@ ncr53c9x_get_ecb(struct ncr53c9x_softc * void ncr53c9x_action(struct cam_sim *sim, union ccb *ccb) { - struct ncr53c9x_softc *sc; + struct ccb_pathinq *cpi; + struct ccb_scsiio *csio; + struct ccb_trans_settings *cts; struct ncr53c9x_ecb *ecb; + struct ncr53c9x_softc *sc; + struct ncr53c9x_tinfo *ti; + int target; NCR_TRACE(("[ncr53c9x_action %d]", ccb->ccb_h.func_code)); @@ -903,17 +918,17 @@ ncr53c9x_action(struct cam_sim *sim, uni mtx_unlock(&sc->sc_lock); xpt_done(ccb); return; + case XPT_CALC_GEOMETRY: mtx_unlock(&sc->sc_lock); cam_calc_geometry(&ccb->ccg, sc->sc_extended_geom); xpt_done(ccb); return; - case XPT_PATH_INQ: - { - struct ccb_pathinq *cpi = &ccb->cpi; + case XPT_PATH_INQ: + cpi = &ccb->cpi; cpi->version_num = 1; - cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE; + cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE; cpi->hba_inquiry |= (sc->sc_rev == NCR_VARIANT_FAS366) ? PI_WIDE_16 : 0; cpi->target_sprt = 0; @@ -932,11 +947,10 @@ ncr53c9x_action(struct cam_sim *sim, uni mtx_unlock(&sc->sc_lock); xpt_done(ccb); return; - } + case XPT_GET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts = &ccb->cts; - struct ncr53c9x_tinfo *ti; + cts = &ccb->cts; + ti = &sc->sc_tinfo[ccb->ccb_h.target_id]; ti = &sc->sc_tinfo[ccb->ccb_h.target_id]; @@ -965,25 +979,24 @@ ncr53c9x_action(struct cam_sim *sim, uni mtx_unlock(&sc->sc_lock); xpt_done(ccb); return; - } + case XPT_ABORT: printf("XPT_ABORT called\n"); ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; mtx_unlock(&sc->sc_lock); xpt_done(ccb); return; + case XPT_TERM_IO: printf("XPT_TERM_IO called\n"); ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; mtx_unlock(&sc->sc_lock); xpt_done(ccb); return; + case XPT_RESET_DEV: printf("XPT_RESET_DEV called\n"); case XPT_SCSI_IO: - { - struct ccb_scsiio *csio; - if (ccb->ccb_h.target_id < 0 || ccb->ccb_h.target_id >= sc->sc_ntarg) { ccb->ccb_h.status = CAM_PATH_INVALID; @@ -1006,7 +1019,7 @@ ncr53c9x_action(struct cam_sim *sim, uni return; } - /* Initialize ecb */ + /* Initialize ecb. */ ecb->ccb = ccb; ecb->timeout = ccb->ccb_h.timeout; @@ -1018,10 +1031,10 @@ ncr53c9x_action(struct cam_sim *sim, uni csio = &ccb->csio; if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0) bcopy(csio->cdb_io.cdb_ptr, &ecb->cmd.cmd, - csio->cdb_len); + csio->cdb_len); else bcopy(csio->cdb_io.cdb_bytes, &ecb->cmd.cmd, - csio->cdb_len); + csio->cdb_len); ecb->clen = csio->cdb_len; ecb->daddr = csio->data_ptr; ecb->dleft = csio->dxfer_len; @@ -1032,15 +1045,12 @@ ncr53c9x_action(struct cam_sim *sim, uni ecb->flags |= ECB_READY; if (sc->sc_state == NCR_IDLE) ncr53c9x_sched(sc); - break; - } case XPT_SET_TRAN_SETTINGS: - { - struct ncr53c9x_tinfo *ti; - struct ccb_trans_settings *cts = &ccb->cts; - int target = ccb->ccb_h.target_id; + cts = &ccb->cts; + target = ccb->ccb_h.target_id; + ti = &sc->sc_tinfo[target]; ti = &sc->sc_tinfo[target]; @@ -1087,11 +1097,10 @@ ncr53c9x_action(struct cam_sim *sim, uni ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); return; - } default: device_printf(sc->sc_dev, "Unhandled function code %d\n", - ccb->ccb_h.func_code); + ccb->ccb_h.func_code); ccb->ccb_h.status = CAM_PROVIDE_FAIL; mtx_unlock(&sc->sc_lock); xpt_done(ccb); @@ -1121,7 +1130,7 @@ ncr53c9x_poll(struct cam_sim *sim) */ /* - * Schedule a scsi operation. This has now been pulled out of the interrupt + * Schedule a SCSI operation. This has now been pulled out of the interrupt * handler so that we may call it from ncr53c9x_scsipi_request and * ncr53c9x_done. This may save us an unnecessary interrupt just to get * things going. Should only be called when state == NCR_IDLE and at bio pl. @@ -1130,12 +1139,12 @@ static void ncr53c9x_sched(struct ncr53c9x_softc *sc) { struct ncr53c9x_ecb *ecb; - struct ncr53c9x_tinfo *ti; struct ncr53c9x_linfo *li; - int lun; - int tag; + struct ncr53c9x_tinfo *ti; + int lun, tag; NCR_TRACE(("[ncr53c9x_sched] ")); + if (sc->sc_state != NCR_IDLE) panic("ncr53c9x_sched: not IDLE (state=%d)", sc->sc_state); @@ -1166,7 +1175,7 @@ ncr53c9x_sched(struct ncr53c9x_softc *sc if (li == NULL) { /* Initialize LUN info and add to list. */ if ((li = malloc(sizeof(*li), - M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) { + M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { continue; } li->lun = lun; @@ -1177,17 +1186,20 @@ ncr53c9x_sched(struct ncr53c9x_softc *sc } li->last_used = time_second; if (tag == 0) { - /* Try to issue this as an un-tagged command */ + /* Try to issue this as an untagged command. */ if (li->untagged == NULL) li->untagged = ecb; } if (li->untagged != NULL) { tag = 0; if ((li->busy != 1) && li->used == 0) { - /* We need to issue this untagged command now */ + /* + * We need to issue this untagged command + * now. + */ ecb = li->untagged; } else { - /* Not ready yet */ + /* not ready, yet */ continue; } } @@ -1211,10 +1223,11 @@ ncr53c9x_sched(struct ncr53c9x_softc *sc sc->sc_nexus = ecb; ncr53c9x_select(sc, ecb); break; - } else + } else { NCR_TRACE(("%d:%d busy\n", ecb->ccb->ccb_h.target_id, ecb->ccb->ccb_h.target_lun)); + } } } @@ -1222,9 +1235,9 @@ static void ncr53c9x_sense(struct ncr53c9x_softc *sc, struct ncr53c9x_ecb *ecb) { union ccb *ccb = ecb->ccb; + struct ncr53c9x_linfo *li; struct ncr53c9x_tinfo *ti; struct scsi_request_sense *ss = (void *)&ecb->cmd.cmd; - struct ncr53c9x_linfo *li; int lun; NCR_TRACE(("requesting sense ")); @@ -1232,7 +1245,7 @@ ncr53c9x_sense(struct ncr53c9x_softc *sc lun = ccb->ccb_h.target_lun; ti = &sc->sc_tinfo[ccb->ccb_h.target_id]; - /* Next, setup a request sense command block */ + /* Next, setup a REQUEST SENSE command block. */ memset(ss, 0, sizeof(*ss)); ss->opcode = REQUEST_SENSE; ss->byte2 = ccb->ccb_h.target_lun << SCSI_CMD_LUN_SHIFT; @@ -1247,7 +1260,7 @@ ncr53c9x_sense(struct ncr53c9x_softc *sc if (li->busy) li->busy = 0; ncr53c9x_dequeue(sc, ecb); - li->untagged = ecb; /* must be executed first to fix C/A */ + li->untagged = ecb; /* Must be executed first to fix C/A. */ li->busy = 2; if (ecb == sc->sc_nexus) { ncr53c9x_select(sc, ecb); @@ -1266,15 +1279,15 @@ static void ncr53c9x_done(struct ncr53c9x_softc *sc, struct ncr53c9x_ecb *ecb) { union ccb *ccb = ecb->ccb; - struct ncr53c9x_tinfo *ti; struct ncr53c9x_linfo *li; + struct ncr53c9x_tinfo *ti; int lun; NCR_TRACE(("[ncr53c9x_done(status:%x)] ", ccb->ccb_h.status)); ti = &sc->sc_tinfo[ccb->ccb_h.target_id]; lun = ccb->ccb_h.target_lun; - li = TINFO_LUN(ti, lun); + li = TINFO_LUN(ti, lun); untimeout(ncr53c9x_timeout, ecb, ccb->ccb_h.timeout_ch); @@ -1296,7 +1309,7 @@ ncr53c9x_done(struct ncr53c9x_softc *sc, if ((ecb->flags & ECB_SENSE) != 0) ccb->ccb_h.status = CAM_AUTOSENSE_FAIL; else { - /* First, save the return values */ + /* First, save the return values. */ ccb->csio.resid = ecb->dleft; ncr53c9x_sense(sc, ecb); return; @@ -1337,7 +1350,7 @@ ncr53c9x_done(struct ncr53c9x_softc *sc, } if (ccb->ccb_h.status == CAM_SEL_TIMEOUT) { - /* Selection timeout -- discard this LUN if empty */ + /* Selection timeout -- discard this LUN if empty. */ if (li->untagged == NULL && li->used == 0) { if (lun < NCR_NLUN) ti->lun[lun] = NULL; @@ -1354,8 +1367,8 @@ ncr53c9x_done(struct ncr53c9x_softc *sc, static void ncr53c9x_dequeue(struct ncr53c9x_softc *sc, struct ncr53c9x_ecb *ecb) { - struct ncr53c9x_tinfo *ti; struct ncr53c9x_linfo *li; + struct ncr53c9x_tinfo *ti; int64_t lun; ti = &sc->sc_tinfo[ecb->ccb->ccb_h.target_id]; @@ -1364,7 +1377,7 @@ ncr53c9x_dequeue(struct ncr53c9x_softc * #ifdef DIAGNOSTIC if (li == NULL || li->lun != lun) panic("ncr53c9x_dequeue: lun %qx for ecb %p does not exist", - (long long) lun, ecb); + (long long)lun, ecb); #endif if (li->untagged == ecb) { li->busy = 0; @@ -1376,8 +1389,7 @@ ncr53c9x_dequeue(struct ncr53c9x_softc * (li->queued[ecb->tag[1]] != ecb)) panic("ncr53c9x_dequeue: slot %d for lun %qx has %p " "instead of ecb %p\n", ecb->tag[1], - (long long) lun, - li->queued[ecb->tag[1]], ecb); + (long long)lun, li->queued[ecb->tag[1]], ecb); #endif li->queued[ecb->tag[1]] = NULL; li->used--; @@ -1395,16 +1407,15 @@ ncr53c9x_dequeue(struct ncr53c9x_softc * /* * Schedule an outgoing message by prioritizing it, and asserting - * attention on the bus. We can only do this when we are the initiator + * attention on the bus. We can only do this when we are the initiator * else there will be an illegal command interrupt. */ -#define ncr53c9x_sched_msgout(m) \ - do { \ - NCR_MSGS(("ncr53c9x_sched_msgout %x %d", m, __LINE__)); \ - NCRCMD(sc, NCRCMD_SETATN); \ - sc->sc_flags |= NCR_ATN; \ - sc->sc_msgpriq |= (m); \ - } while (0) +#define ncr53c9x_sched_msgout(m) do { \ + NCR_MSGS(("ncr53c9x_sched_msgout %x %d", m, __LINE__)); \ + NCRCMD(sc, NCRCMD_SETATN); \ + sc->sc_flags |= NCR_ATN; \ + sc->sc_msgpriq |= (m); \ +} while (0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 22:00:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B359D1065670; Thu, 15 Jan 2009 22:00:22 +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 A15AB8FC0C; Thu, 15 Jan 2009 22:00:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FM0MJa088566; Thu, 15 Jan 2009 22:00:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FM0MQL088565; Thu, 15 Jan 2009 22:00:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152200.n0FM0MQL088565@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 22:00:22 +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: r187315 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 22:00:23 -0000 Author: marius Date: Thu Jan 15 22:00:22 2009 New Revision: 187315 URL: http://svn.freebsd.org/changeset/base/187315 Log: Sync the description of jumbo frame support with reality as of r185812; it's also supported with BCM5702 (matched by BGE_ASICREV_BCM5703) but bge(4) currently doesn't with neither BCM5714 nor BCM5780. Prodded by: scf MFC after: 3 days Modified: head/share/man/man4/bge.4 Modified: head/share/man/man4/bge.4 ============================================================================== --- head/share/man/man4/bge.4 Thu Jan 15 21:23:44 2009 (r187314) +++ head/share/man/man4/bge.4 Thu Jan 15 22:00:22 2009 (r187315) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2007 +.Dd January 15, 2009 .Dt BGE 4 .Os .Sh NAME @@ -82,7 +82,7 @@ copper gigabit transceivers, which support autonegotiation of 10, 100 and 1000Mbps modes in full or half duplex. .Pp -The BCM5700, BCM5701, BCM5703, BCM5704, BCM5714 and BCM5780 also support +The BCM5700, BCM5701, BCM5702, BCM5703 and BCM5704 also support jumbo frames, which can be configured via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 22:06:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77C171065675; Thu, 15 Jan 2009 22:06:53 +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 65D6B8FC16; Thu, 15 Jan 2009 22:06:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FM6rqb088715; Thu, 15 Jan 2009 22:06:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FM6rxO088713; Thu, 15 Jan 2009 22:06:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901152206.n0FM6rxO088713@svn.freebsd.org> From: Marius Strobl Date: Thu, 15 Jan 2009 22:06: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: r187316 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 22:06:54 -0000 Author: marius Date: Thu Jan 15 22:06:53 2009 New Revision: 187316 URL: http://svn.freebsd.org/changeset/base/187316 Log: Don't cross-reference gem(4) and hme(4); maybe this made some sense back when these two were the only two NIC drivers working on sparc64 but it no longer does nowadays. MFC after: 3 days Modified: head/share/man/man4/gem.4 head/share/man/man4/hme.4 Modified: head/share/man/man4/gem.4 ============================================================================== --- head/share/man/man4/gem.4 Thu Jan 15 22:00:22 2009 (r187315) +++ head/share/man/man4/gem.4 Thu Jan 15 22:06:53 2009 (r187316) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2007 +.Dd January 15, 2009 .Dt GEM 4 .Os .Sh NAME @@ -115,7 +115,6 @@ driver fails to attach to Sun Gigabit Et as no SBus front-end has been written so far. .Sh SEE ALSO .Xr altq 4 , -.Xr hme 4 , .Xr miibus 4 , .Xr netintro 4 , .Xr eeprom 8 , Modified: head/share/man/man4/hme.4 ============================================================================== --- head/share/man/man4/hme.4 Thu Jan 15 22:00:22 2009 (r187315) +++ head/share/man/man4/hme.4 Thu Jan 15 22:06:53 2009 (r187316) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd January 15, 2009 .Dt HME 4 .Os .Sh NAME @@ -120,7 +120,6 @@ on boards equipped with more than one Et except the single-port SBus versions. .Sh SEE ALSO .Xr altq 4 , -.Xr gem 4 , .Xr intro 4 , .Xr miibus 4 , .Xr netintro 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 22:28:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F24C106572C; Thu, 15 Jan 2009 22:28:06 +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 732C28FC12; Thu, 15 Jan 2009 22:28:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FMS6bJ089126; Thu, 15 Jan 2009 22:28:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FMS6p2089124; Thu, 15 Jan 2009 22:28:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901152228.n0FMS6p2089124@svn.freebsd.org> From: Xin LI Date: Thu, 15 Jan 2009 22:28:06 +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: r187317 - head/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 22:28:08 -0000 Author: delphij Date: Thu Jan 15 22:28:05 2009 New Revision: 187317 URL: http://svn.freebsd.org/changeset/base/187317 Log: Changes to match "Marketing Description" from Broadcom for HP servers. Submitted by: davidch MFC after: 2 months Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu Jan 15 22:06:53 2009 (r187316) +++ head/sys/dev/bce/if_bce.c Thu Jan 15 22:28:05 2009 (r187317) @@ -107,7 +107,9 @@ static struct bce_type bce_devs[] = { { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3106, "HP NC370i Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x3070, - "HP NC380T PCI Express Dual Port Multifunction Gigabit Server Adapter" }, + "HP NC380T PCIe DP Multifunc Gig Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x1709, + "HP NC371i Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5706 1000Base-T" }, @@ -119,37 +121,37 @@ static struct bce_type bce_devs[] = { /* BCM5708C controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7037, - "HP NC373T PCI Express Multifunction Gigabit Server Adapter" }, + "HP NC373T PCIe Multifunction Gig Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7038, - "HP NC373i Integrated Multifunction Gigabit Server Adapter" }, + "HP NC373i Multifunction Gigabit Server Adapter" }, + { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7045, + "HP NC374m PCIe Multifunction Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-T" }, /* BCM5708S controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x1706, - "HP NC373m Multifunction Gigabit Server Adapter" }, - { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x7038, - "HP NC373i PCI Express Multifunction Gigabit Server Adapter" }, + "HP NC373m Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703b, - "HP NC373i Integrated Multifunction Gigabit Server Adapter" }, + "HP NC373i Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703d, - "HP NC373F PCI Express Multifunction Gigabit Server Adapter" }, + "HP NC373F PCIe Multifunc Giga Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5708 1000Base-SX" }, /* BCM5709C controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7055, - "HP NC382i Integrated Quad Port PCI Express Gigabit Server Adapter" }, + "HP NC382i DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7059, - "HP NC382T PCI Express Dual Port Multifunction Gigabit Server Adapter" }, + "HP NC382T PCIe DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-T" }, /* BCM5709S controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x171d, - "HP NC382m Dual Port 1GbE Multifunction BL-c Adapter" }, + "HP NC382m DP 1GbE Multifunction BL-c Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x7056, - "HP NC382i Integrated Quad Port PCI Express Gigabit Server Adapter" }, + "HP NC382i DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, PCI_ANY_ID, PCI_ANY_ID, "Broadcom NetXtreme II BCM5709 1000Base-SX" }, From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 22:31:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 733FA1065672; Thu, 15 Jan 2009 22:31:55 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 3A84A8FC1C; Thu, 15 Jan 2009 22:31:55 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id D0C1E2C2AAC; Thu, 15 Jan 2009 16:31:54 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2nE38bTT8lLM; Thu, 15 Jan 2009 16:31:47 -0600 (CST) Received: from [10.195.94.71] (unknown [10.195.94.71]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 03B532C2A81; Thu, 15 Jan 2009 16:31:46 -0600 (CST) Message-ID: <496FB94A.6070308@cs.rice.edu> Date: Thu, 15 Jan 2009 16:31:38 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Oleksandr Tymoshenko References: <200901151831.n0FIVaJv083960@svn.freebsd.org> In-Reply-To: <200901151831.n0FIVaJv083960@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187301 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 22:31:56 -0000 You should not be reintroducing pmap_track_modified(). See revision 1.2 of this file. Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Thu Jan 15 18:31:36 2009 > New Revision: 187301 > URL: http://svn.freebsd.org/changeset/base/187301 > > Log: > MFp4: > > - Add debug output > - Fix pmap_zero_page and related places: use uncached segments and invalidate > cache after zeroing memory. > - Do not test for modified bit if it's not neccessary > (merged from mips-juniper p4 branch) > - Some #includes reorganization > > Modified: > head/sys/mips/include/pmap.h > head/sys/mips/mips/pmap.c > > Modified: head/sys/mips/include/pmap.h > ============================================================================== > --- head/sys/mips/include/pmap.h Thu Jan 15 17:15:03 2009 (r187300) > +++ head/sys/mips/include/pmap.h Thu Jan 15 18:31:36 2009 (r187301) > @@ -1,4 +1,4 @@ > -/* > +/*- > * Copyright (c) 1991 Regents of the University of California. > * All rights reserved. > * > @@ -47,10 +47,8 @@ > #define _MACHINE_PMAP_H_ > > #include > +#include > > -/* > - * Pte related macros > - */ > #define VADDR(pdi, pti) ((vm_offset_t)(((pdi)< > #define NKPT 120 /* actual number of kernel page tables */ > @@ -65,11 +63,9 @@ > #ifndef LOCORE > > #include > -#include > #include > #include > > - > /* > * Pmap stuff > */ > @@ -104,10 +100,7 @@ struct pmap { > > typedef struct pmap *pmap_t; > > -#ifdef _KERNEL > -#include > -#include > -#include > +#ifdef _KERNEL > > pt_entry_t *pmap_pte(pmap_t, vm_offset_t); > pd_entry_t pmap_segmap(pmap_t pmap, vm_offset_t va); > @@ -132,8 +125,6 @@ extern pmap_t kernel_pmap; > #define PMAP_LGMEM_UNLOCK(sysmap) mtx_unlock(&(sysmap)->lock) > #define PMAP_LGMEM_DESTROY(sysmap) mtx_destroy(&(sysmap)->lock) > > -#endif /* _KERNEL */ > - > /* > * For each vm_page_t, there is a list of all currently valid virtual > * mappings of that page. An entry is a pv_entry_t, the list is pv_table. > @@ -148,8 +139,6 @@ typedef struct pv_entry { > } *pv_entry_t; > > > -#ifdef _KERNEL > - > #if defined(DIAGNOSTIC) > #define PMAP_DIAGNOSTIC > #endif > @@ -182,7 +171,6 @@ vm_offset_t pmap_steal_memory(vm_size_t > void pmap_set_modified(vm_offset_t pa); > int page_is_managed(vm_offset_t pa); > void pmap_page_is_free(vm_page_t m); > -void pmap_kushmem_reattach(struct proc *); > /* PMAP_INLINE */ void pmap_kenter(vm_offset_t va, vm_paddr_t pa); > /* PMAP_INLINE */ void pmap_kremove(vm_offset_t va); > void *pmap_kenter_temporary(vm_paddr_t pa, int i); > > Modified: head/sys/mips/mips/pmap.c > ============================================================================== > --- head/sys/mips/mips/pmap.c Thu Jan 15 17:15:03 2009 (r187300) > +++ head/sys/mips/mips/pmap.c Thu Jan 15 18:31:36 2009 (r187301) > @@ -103,6 +103,8 @@ __FBSDID("$FreeBSD$"); > #define PMAP_DIAGNOSTIC > #endif > > +#undef PMAP_DEBUG > + > #ifndef PMAP_SHPGPERPROC > #define PMAP_SHPGPERPROC 200 > #endif > @@ -489,6 +491,24 @@ pmap_nw_modified(pt_entry_t pte) > #endif > > > +/* > + * this routine defines the region(s) of memory that should > + * not be tested for the modified bit. > + */ > +static PMAP_INLINE int > +pmap_track_modified(vm_offset_t va) > +{ > + /* > + * Kernel submap initialization has been moved for MD to MI code. ie > + * from cpu_startup() to vm_ksubmap_init(). clean_sva and clean_eva > + * are part of the kmi structure. > + */ > + if ((va < kmi.clean_sva) || (va >= kmi.clean_eva)) > + return (1); > + else > + return (0); > +} > + > static void > pmap_invalidate_all(pmap_t pmap) > { > @@ -672,6 +692,9 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p > register pt_entry_t *pte; > pt_entry_t npte, opte; > > +#ifdef PMAP_DEBUG > + printf("pmap_kenter: va: 0x%08x -> pa: 0x%08x\n", va, pa); > +#endif > npte = mips_paddr_to_tlbpfn(pa) | PTE_RW | PTE_V | PTE_G | PTE_W; > > if (is_cacheable_mem(pa)) > @@ -1421,7 +1444,8 @@ pmap_remove_pte(struct pmap *pmap, pt_en > va, oldpte); > } > #endif > - vm_page_dirty(m); > + if (pmap_track_modified(va)) > + vm_page_dirty(m); > } > if (m->md.pv_flags & PV_TABLE_REF) > vm_page_flag_set(m, PG_REFERENCED); > @@ -1778,6 +1802,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, > validate: > rw = init_pte_prot(va, m, prot); > > +#ifdef PMAP_DEBUG > + printf("pmap_enter: va: 0x%08x -> pa: 0x%08x\n", va, pa); > +#endif > /* > * Now validate mapping with desired protection/wiring. > */ > @@ -2147,9 +2174,10 @@ pmap_zero_page(vm_page_t m) > #endif > if (phys < MIPS_KSEG0_LARGEST_PHYS) { > > - va = MIPS_PHYS_TO_CACHED(phys); > + va = MIPS_PHYS_TO_UNCACHED(phys); > > bzero((caddr_t)va, PAGE_SIZE); > + mips_dcache_wbinv_range(va, PAGE_SIZE); > } else { > int cpu; > struct local_sysmaps *sysm; > @@ -2202,8 +2230,9 @@ pmap_zero_page_area(vm_page_t m, int off > } else > #endif > if (phys < MIPS_KSEG0_LARGEST_PHYS) { > - va = MIPS_PHYS_TO_CACHED(phys); > + va = MIPS_PHYS_TO_UNCACHED(phys); > bzero((char *)(caddr_t)va + off, size); > + mips_dcache_wbinv_range(va + off, size); > } else { > int cpu; > struct local_sysmaps *sysm; > @@ -2240,8 +2269,9 @@ pmap_zero_page_idle(vm_page_t m) > } else > #endif > if (phys < MIPS_KSEG0_LARGEST_PHYS) { > - va = MIPS_PHYS_TO_CACHED(phys); > + va = MIPS_PHYS_TO_UNCACHED(phys); > bzero((caddr_t)va, PAGE_SIZE); > + mips_dcache_wbinv_range(va, PAGE_SIZE); > } else { > int cpu; > struct local_sysmaps *sysm; > From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 22:41:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2292A10656C0; Thu, 15 Jan 2009 22:41:49 +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 10FED8FC14; Thu, 15 Jan 2009 22:41:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FMfm2b089447; Thu, 15 Jan 2009 22:41:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FMfmem089446; Thu, 15 Jan 2009 22:41:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901152241.n0FMfmem089446@svn.freebsd.org> From: Xin LI Date: Thu, 15 Jan 2009 22:41: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: r187318 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 22:41:49 -0000 Author: delphij Date: Thu Jan 15 22:41:48 2009 New Revision: 187318 URL: http://svn.freebsd.org/changeset/base/187318 Log: Reflect newly added PCI IDs to bce(4). MFC after: 2 months Modified: head/share/man/man4/bce.4 Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Thu Jan 15 22:28:05 2009 (r187317) +++ head/share/man/man4/bce.4 Thu Jan 15 22:41:48 2009 (r187318) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2008 +.Dd January 15, 2009 .Dt BCE 4 .Os .Sh NAME @@ -160,6 +160,26 @@ HP NC370F Multifunction Gigabit Server A HP NC370T Multifunction Gigabit Server Adapter .It HP NC370i Multifunction Gigabit Server Adapter +.It +HP NC371i Multifunction Gigabit Server Adapter +.It +HP NC373F PCIe Multifunc Giga Server Adapter +.It +HP NC373T PCIe Multifunction Gig Server Adapter +.It +HP NC373i Multifunction Gigabit Server Adapter +.It +HP NC373m Multifunction Gigabit Server Adapter +.It +HP NC374m PCIe Multifunction Adapter +.It +HP NC380T PCIe DP Multifunc Gig Server Adapter +.It +HP NC382T PCIe DP Multifunction Gigabit Server Adapter +.It +HP NC382i DP Multifunction Gigabit Server Adapter +.It +HP NC382m DP 1GbE Multifunction BL-c Adapter .El .Sh SYSCTL VARIABLES The following variables are available as both From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 22:47:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFDCF106564A; Thu, 15 Jan 2009 22:47:07 +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 B11DC8FC1C; Thu, 15 Jan 2009 22:47:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 3F36546B2D; Thu, 15 Jan 2009 17:47:07 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FMkttG004922; Thu, 15 Jan 2009 17:47:01 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: src-committers@freebsd.org Date: Thu, 15 Jan 2009 15:18:33 -0500 User-Agent: KMail/1.9.7 References: <200901131644.n0DGiI9L009063@svn.freebsd.org> In-Reply-To: <200901131644.n0DGiI9L009063@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901151518.34220.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 17:47:01 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8870/Thu Jan 15 15:57:00 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r187156 - head/tools/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 22:47:08 -0000 On Tuesday 13 January 2009 11:44:18 am John Baldwin wrote: > Author: jhb > Date: Tue Jan 13 16:44:18 2009 > New Revision: 187156 > URL: http://svn.freebsd.org/changeset/base/187156 > > Log: > Add support for two new event source types: > - Callwheels traced via KTR_CALLOUT. Each CPU is assigned a callwheel > source. The events on this source are the execution of individual callout > routines. Each routine shows up as a green rectangle while it is executed > and the event details include the function pointer and argument. > - Locks traced via KTR_LOCK. Currently, each lock name is assigned an event > source (since the existing KTR_LOCK traces only include lock names and > not pointers). This does mean that if multiple locks of the same name are > manipulated, the source line for that name may be confusing. However, for > many cases this can be useful. Locks are blue when they are held and > purple when contested. The contention support is a bit weak due to > limitations in the rw_rlock() and mtx_lock_spin() logging messages > currently. I also have not added support for contention on lockmgr, > sx, or rmlocks yet. What is there now can be profitably used to examine > activity on Giant however. > - Expand the width of the event source names column a bit to allow for some > of the longer names of these new source types. For some examples, check out www.freebsd.org/~jhb/sysctl_before.png and sysctl_after.png. Those are screenshots of 'sysctl -a' showing lock activity. In particular, in 'after' I removed (via #if 0) the debug.hashstat sysctls (from sys/kern/vfs_cache.c). In the 'before' graph one of those two sysctls (the raw dump of the hash table depths) took 7 milliseconds to run on my test machine (2 x 3.4 GHz Intel dual-core) holding Giant the entire time which caused softclock to block on Giant for a couple of milliseconds. (These traces were performed on 7-stable.) Once I get more caught up I plan on sticking those sysctl's under some sort of #ifdef that isn't on by default. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 22:47:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 492D61065747; Thu, 15 Jan 2009 22:47:22 +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 05EEC8FC38; Thu, 15 Jan 2009 22:47:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id E3A5446B2D; Thu, 15 Jan 2009 17:47:18 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0FMkttI004922; Thu, 15 Jan 2009 17:47:13 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Max Laier Date: Thu, 15 Jan 2009 16:59:35 -0500 User-Agent: KMail/1.9.7 References: <200812161703.mBGH3M7m042955@svn.freebsd.org> <200812172109.55724.max@love2party.net> In-Reply-To: <200812172109.55724.max@love2party.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200901151659.35735.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 15 Jan 2009 17:47:13 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8870/Thu Jan 15 15:57:00 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: src-committers@freebsd.org, Kip Macy , svn-src-all@freebsd.org, Attilio Rao , Robert Watson , svn-src-head@freebsd.org Subject: Re: svn commit: r186187 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 22:47:23 -0000 On Wednesday 17 December 2008 3:09:55 pm Max Laier wrote: > As the upper half of this thread has turned into a style(9) bikeshed, let= me=20 > replay the lower half and add more locking folks. >=20 > The change in question is here:=20 > http://svn.freebsd.org/viewvc/base/head/sys/net/pfil.c?r1=3D173904&r2=3D1= 86187=20 >=20 > On Tuesday 16 December 2008 19:20:40 Robert Watson wrote: > > On Tue, 16 Dec 2008, Max Laier wrote: > ... > > >> - Don't lock the hook during registration, since it's not yet in u= se. > > > > > > Shouldn't the WLOCK be obtained regardless in order to obtain a memory > > > barrier for the reading threads? pfil_run_hooks doesn't interact with > > > the LIST_LOCK so it's unclear in what state the hook head will be when > > > the hook head is first read. > > > > Hmm. Interesting observation. However, that approach is not consistent > > with lots of other code, so possibly that other code needs to change as > > well. For example, ip_init() initializes lots of other global data > > structures, including the fragment reassembly queue and protocol switch, > > without acquiring locks in such a way as to force visibility on other=20 CPUs. > > > > I've CC'd John Baldwin, who might be able to comment on this issue more > > generally. Should we be, for example, calling { IPQ_LOCK(); IPQ_UNLOCK= (); > > } after initializing the IP reassembly queues to make sure that > > initialization is visible to other CPUs that will be calling IPQ_LOCK() > > before using it? So the usual model would be to do something like this: LIST(foo, ) foo_list; foo_add(foo *p) { /* Construct foo, but don't lock it. */ WLOCK(foo_list); LIST_INSERT(foo_list, foo); WUNLOCK(foo_list); } foo * foo_find(int key) { foo *p; RLOCK(foo_list); LIST_FOREACH(p, foo_list) { if (p->key =3D=3D key) { LOCK(p); RUNLOCK(foo_list); return (p); } } RUNLOCK(foo_list); return (NULL); } =09 something_else() { foo *p; RLOCK(foo_list); LIST_FOREACH(p, foo_list) { LOCK(p); bar(p); UNLOCK(p); } RUNLOCK(foo_list); } =46rom your description it would appear that you are doing something_else()= but=20 without actually locking foo_list. Unless you can demonstrate a clear win = in=20 benchmarks from not having the lock there, I would suggest just going with= =20 the simpler and more common approach. Depending on the mtx of the individu= al=20 head doesn't do anything to solve races with removing the head from the lis= t. So, reading a bit further, I think the real fix is that the pfil API is a b= it=20 busted. What you really want to do is have pfil_get_head() operate like=20 foo_find() and lock the head before dropping the list lock. That is the on= ly=20 race I see in the current code. However, because you malloc() after callin= g=20 pfil_get_head() that is problematic. That is, the current consumer code=20 looks like this: ph =3D pfil_get_head(x, y); pfil_add_hook(..., ph); /* calls malloc() */ I think you should change the API to be this instead: pfil_add_hook(..., x, y); and have pfil_get_head() do the lookup internally: pfil_add_hook() { malloc(...); ph =3D pfil_get_head(x, y); /* locks the 'ph' like foo_find() */ } =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 23:03:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7616B1065687; Thu, 15 Jan 2009 23:03:27 +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 614798FC08; Thu, 15 Jan 2009 23:03:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FN3RHA089893; Thu, 15 Jan 2009 23:03:27 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FN3R3n089892; Thu, 15 Jan 2009 23:03:27 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200901152303.n0FN3R3n089892@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 15 Jan 2009 23:03:27 +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: r187319 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 23:03:29 -0000 Author: gonzo Date: Thu Jan 15 23:03:27 2009 New Revision: 187319 URL: http://svn.freebsd.org/changeset/base/187319 Log: - pmap_track_modified was retired in r178606. Reintroducing it was a mistake. Spotted by: alc@ Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Jan 15 22:41:48 2009 (r187318) +++ head/sys/mips/mips/pmap.c Thu Jan 15 23:03:27 2009 (r187319) @@ -490,25 +490,6 @@ pmap_nw_modified(pt_entry_t pte) #endif - -/* - * this routine defines the region(s) of memory that should - * not be tested for the modified bit. - */ -static PMAP_INLINE int -pmap_track_modified(vm_offset_t va) -{ - /* - * Kernel submap initialization has been moved for MD to MI code. ie - * from cpu_startup() to vm_ksubmap_init(). clean_sva and clean_eva - * are part of the kmi structure. - */ - if ((va < kmi.clean_sva) || (va >= kmi.clean_eva)) - return (1); - else - return (0); -} - static void pmap_invalidate_all(pmap_t pmap) { @@ -1444,8 +1425,7 @@ pmap_remove_pte(struct pmap *pmap, pt_en va, oldpte); } #endif - if (pmap_track_modified(va)) - vm_page_dirty(m); + vm_page_dirty(m); } if (m->md.pv_flags & PV_TABLE_REF) vm_page_flag_set(m, PG_REFERENCED); From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 23:03:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D5391065689; Thu, 15 Jan 2009 23:03:48 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from core.tav.kiev.ua (tavex.colocall.com [62.149.10.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6D9C48FC16; Thu, 15 Jan 2009 23:03:46 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from 204-174-83-31.static569.dsl.ucc-net.ca ([204.174.83.31] helo=[10.80.5.156]) by core.tav.kiev.ua with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52 (FreeBSD)) id 1LNbFs-000D8v-TV; Fri, 16 Jan 2009 01:04:06 +0200 Message-ID: <496FC0B6.60004@bluezbox.com> Date: Thu, 15 Jan 2009 15:03:18 -0800 From: Oleksandr Tymoshenko User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Alan Cox References: <200901151831.n0FIVaJv083960@svn.freebsd.org> <496FB94A.6070308@cs.rice.edu> In-Reply-To: <496FB94A.6070308@cs.rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Core-Spam-Level: ---- X-Core-Spam-Report: Spam detection software, running on the system "core.tav.kiev.ua", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Alan Cox wrote: > You should not be reintroducing pmap_track_modified(). See revision 1.2 > of this file. My bad :(. Should have checked history. Thanks for pointing out. Fixed > > Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Thu Jan 15 18:31:36 2009 >> New Revision: 187301 >> URL: http://svn.freebsd.org/changeset/base/187301 [...] Content analysis details: (-4.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187301 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 23:03:50 -0000 Alan Cox wrote: > You should not be reintroducing pmap_track_modified(). See revision 1.2 > of this file. My bad :(. Should have checked history. Thanks for pointing out. Fixed > > Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Thu Jan 15 18:31:36 2009 >> New Revision: 187301 >> URL: http://svn.freebsd.org/changeset/base/187301 From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 23:14:22 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71B6106567B; Thu, 15 Jan 2009 23:14:22 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id A8AED8FC1D; Thu, 15 Jan 2009 23:14:22 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id n0FNEISH022696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Jan 2009 15:14:19 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <496FC32F.3040104@FreeBSD.org> Date: Thu, 15 Jan 2009 15:13:51 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Christoph Mallon References: <200901142232.n0EMWhGw055895@svn.freebsd.org> <20090115020752.52566769.stas@FreeBSD.org> <20090114.190527.1058804377.imp@bsdimp.com> <20090115114407.GA67726@FreeBSD.org> <496F24D8.2040104@gmx.de> In-Reply-To: <496F24D8.2040104@gmx.de> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexey Dokuchaev , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, stas@FreeBSD.org, gonzo@FreeBSD.org, svn-src-head@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 23:14:23 -0000 Christoph Mallon wrote: > Alexey Dokuchaev schrieb: >> On Wed, Jan 14, 2009 at 07:05:27PM -0700, M. Warner Losh wrote: >>> In message: <20090115020752.52566769.stas@FreeBSD.org> >>> Stanislav Sedov writes: >>> : > + shift = 8 * (reg & 3); >>> : > : : Would it make sense to replace this with >>> : > + shift = (reg & 3) << 3; >>> : : to not rely on possible compiler optimizations? >>> >>> I don't think that it matters all that much these days... >> >> But the name "shift" kinda suggests << instead of *, no? > > The value *is* a shift amount (see its uses a few lines down). Its name > does not imply the way it is calculated, but what it is used for. > > BTW: Even the most cheap compilers emit shift instructions for > multiplication by a power of two. The new code also is clearly faster > then the old - quite some code gets generated for switches. I believe Warner's point is that the code is not in the hot path, so that it should not really matter either way. -Maxim From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 23:14:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63BEB106566B; Thu, 15 Jan 2009 23:14:59 +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 51BF18FC0A; Thu, 15 Jan 2009 23:14:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FNEx3j090164; Thu, 15 Jan 2009 23:14:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FNExe5090163; Thu, 15 Jan 2009 23:14:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200901152314.n0FNExe5090163@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 15 Jan 2009 23:14: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: r187321 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 23:15:00 -0000 Author: nwhitehorn Date: Thu Jan 15 23:14:59 2009 New Revision: 187321 URL: http://svn.freebsd.org/changeset/base/187321 Log: Revert revision 186833 and try a different strategy to allow this device to work when the bus attaches its own children. Instead of hardcoding a unit number and returning BUS_PROBE_NOWILDCARD, which will break multiple iicbus systems, check in the probe routine whether the device address is 0. Real I2C devices will never have this address, but devices added with BUS_ADD_CHILD() will. Requested by: jhb Reviewed by: jhb Modified: head/sys/dev/iicbus/iic.c Modified: head/sys/dev/iicbus/iic.c ============================================================================== --- head/sys/dev/iicbus/iic.c Thu Jan 15 23:11:02 2009 (r187320) +++ head/sys/dev/iicbus/iic.c Thu Jan 15 23:14:59 2009 (r187321) @@ -110,14 +110,18 @@ iic_identify(driver_t *driver, device_t { if (device_find_child(parent, "iic", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "iic", 0); + BUS_ADD_CHILD(parent, 0, "iic", -1); } static int iic_probe(device_t dev) { + if (iicbus_get_addr(dev) > 0) + return (ENXIO); + device_set_desc(dev, "I2C generic I/O"); - return (BUS_PROBE_NOWILDCARD); + + return (0); } static int From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 23:28:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F4B4106564A; Thu, 15 Jan 2009 23:28:20 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id EC0FF8FC18; Thu, 15 Jan 2009 23:28:19 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 581772C2A8E; Thu, 15 Jan 2009 17:28:19 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id i9fg6FnkKL18; Thu, 15 Jan 2009 17:28:11 -0600 (CST) Received: from [10.195.94.71] (unknown [10.195.94.71]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 549462C2AAC; Thu, 15 Jan 2009 17:28:11 -0600 (CST) Message-ID: <496FC680.20402@cs.rice.edu> Date: Thu, 15 Jan 2009 17:28:00 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Oleksandr Tymoshenko References: <200901151831.n0FIVaJv083960@svn.freebsd.org> <496FB94A.6070308@cs.rice.edu> <496FC0B6.60004@bluezbox.com> In-Reply-To: <496FC0B6.60004@bluezbox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187301 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 23:28:20 -0000 Oleksandr Tymoshenko wrote: > Alan Cox wrote: >> You should not be reintroducing pmap_track_modified(). See revision >> 1.2 of this file. > My bad :(. Should have checked history. Thanks for pointing out. > Fixed You are welcome. Did you see the e-mail that I send a couple days ago about get_pv_entry() in both the BookE and MIPS pmaps? Alan From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 23:38:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A72C71065670; Thu, 15 Jan 2009 23:38:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 933058FC16; Thu, 15 Jan 2009 23:38:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FNcLpD090620; Thu, 15 Jan 2009 23:38:21 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0FNcLf6090614; Thu, 15 Jan 2009 23:38:21 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901152338.n0FNcLf6090614@svn.freebsd.org> From: Sam Leffler Date: Thu, 15 Jan 2009 23:38: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: r187322 - in head/tools/tools/ath: . athrd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 23:38:22 -0000 Author: sam Date: Thu Jan 15 23:38:21 2009 New Revision: 187322 URL: http://svn.freebsd.org/changeset/base/187322 Log: add athrd tool that dumps ath hal regulatory info; note this is soon to obsolete but commit now so it's available for anyone that's interested Added: head/tools/tools/ath/athrd/ head/tools/tools/ath/athrd/Makefile (contents, props changed) head/tools/tools/ath/athrd/athrd.1 (contents, props changed) head/tools/tools/ath/athrd/athrd.c (contents, props changed) head/tools/tools/ath/athrd/run.sh (contents, props changed) Modified: head/tools/tools/ath/Makefile head/tools/tools/ath/Makefile.inc Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Thu Jan 15 23:14:59 2009 (r187321) +++ head/tools/tools/ath/Makefile Thu Jan 15 23:38:21 2009 (r187322) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= athdebug athkey athprom athregs athstats +SUBDIR= athdebug athkey athprom athrd athregs athstats .include Modified: head/tools/tools/ath/Makefile.inc ============================================================================== --- head/tools/tools/ath/Makefile.inc Thu Jan 15 23:14:59 2009 (r187321) +++ head/tools/tools/ath/Makefile.inc Thu Jan 15 23:38:21 2009 (r187322) @@ -6,6 +6,7 @@ NO_MAN= ATH_DEFAULT= ath0 CFLAGS+=-DATH_DEFAULT='"${ATH_DEFAULT}"' -CFLAGS+=-I../common -CFLAGS+=-I../../../../sys/dev/ath -CFLAGS+=-I../../../../sys/dev/ath/ath_hal +CFLAGS+=-I${.CURDIR} +CFLAGS+=-I${.CURDIR}/../common +CFLAGS+=-I${.CURDIR}/../../../../sys/dev/ath +CFLAGS+=-I${.CURDIR}/../../../../sys/dev/ath/ath_hal Added: head/tools/tools/ath/athrd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athrd/Makefile Thu Jan 15 23:38:21 2009 (r187322) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal + +PROG= athrd + +SRCS= athrd.c ah_regdomain.c opt_ah.h + +CLEANFILES+= opt_ah.h + +CFLAGS+= -fno-inline + +.include <../Makefile.inc> + +MAN= athrd.1 + +opt_ah.h: + echo "#define AH_DEBUG 1" > opt_ah.h + echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h + +.include Added: head/tools/tools/ath/athrd/athrd.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athrd/athrd.1 Thu Jan 15 23:38:21 2009 (r187322) @@ -0,0 +1,176 @@ +.\"- +.\" Copyright (c) 2002-2009 Sam Leffler, Errno Consulting +.\" 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, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +.\" redistribution must be conditioned upon including a substantially +.\" similar Disclaimer requirement for further binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY +.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +.\" +.\" $FreeBSD$ +.\"/ +.Dd January 15, 2009 +.Dt ATHRD 1 +.Os +.Sh NAME +.Nm athrd +.Nd list channels and transmit power for a country/regulatory domain +.Sh SYNOPSIS +.Nm +.Op Fl aioedlpcfr4ABGT +.Op Fl m Ar mode +.Bk +.Op Ar country +.Ek +.Sh DESCRIPTION +.Nm +displays the list of frequencies and the associated maximum transmit +power permitted within a regulatory domain and/or country. +.Pp +If no command line options are given, a default country (\c +.Ql US ) +is used. +Country and regulatory names are case insensitive. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl a +By default +.Nm +will display B channels only if they are not also marked as available for +use as G channels and similary for A and T channels. +With this option +.Nm +will list all channels. +.It Fl i +Calculate channels based on indoor use. +.It Fl o +Calculate channels based on outdoor use (default). +.It Fl e +Calculate channels not assuming extended channel mode. +.It Fl d +Enabling debugging in the HAL code that calculates the available channels +and transmit power values. +.It Fl l +Provide a list of all known country and regulatory domain names. +.It Fl m Ar mode +Calculate channels and transmit power for operation in +.Ql mode ; +one of +.Ql station , +.Ql ibss , +.Ql monitor , +and +.Ql ap +(or the first two letters). +.It Fl p +Mark passive scan channels with lower case letters and active +scan channels with upper case letters. +.It Fl r +Mark channels that require DFS with a +.Ql * . +.It Fl 4 +Mark channels that have a 4ms packet limit with a +.Ql 4 . +.It Fl c +Display IEEE channel numbers instead of frequencies. +.It Fl f +Display frequencies (default). +.It Fl A +Display only 11A channels. +.It Fl B +Display only 11B channels. +.It Fl G +Display only 11G channels. +.It Fl T +Display only Turbo channels. +.El +.Sh EXAMPLES +The following demonstrates how to list the permissible frequencies +and maximum transport power per channel for use in Spain: +.Pp +.nf +tubby% athrd es +\& +SPAIN (ES, 0x2d4, 724) NULL1_WORLD (0x3, 3) +2412G 14.0 2417G 14.0 2422G 14.0 2427G 17.0 2432G 14.0 2437G 17.0 +2442G 14.0 2447G 17.0 2452G 17.0 2457G 14.0 2462G 17.0 +.fi +.Pp +Each frequency has a suffix that is one of: +.Ql G , +.Ql B , +.Ql A , +or +.Ql T +according to whether the channel is usable with 802.11g, 802.11b, +802.11a, or Atheros Turbo mode. +All channels listed as +.Ql G +are also usable in +.Ql B . +Likewise, all channels listed as +.Ql A +are usable in +.Ql T . +Channels listed as +.Ql B +or +.Ql T +are only usable in those modes. +(Note that when the +.Fl p +option is specified passive scan channels are marked with a lower case +.Ql g , +.Ql b , +.Ql a , +or +.Ql t .) +The transmit power is given in units of dbM. +.Sh DIAGNOSTICS +Various diagnostics about unknown regulatory domains and/or country +codes may be encountered. +Use the +.Fl l +option for a list of valid names. +.Sh SEE ALSO +.Xr ath 4 , +.Xr ath_hal 4 +.Sh STANDARDS +Lots belong here. +.Sh NOTES +.Nm +use the HAL to calculate the set of channels. +The transmit power calculations are done by emulating +how the HAL works. +Because +.Nm +does not +read the actual EEPROM contents from a device this emulation may lag +behind current practice. +.Sh BUGS +The HAL reset logic should be used to calculate the transmit power +for each channel instead of using a separate copy of the code. +The data presented by +.Nm +are the expected values; for compliance testing one must measure the actual +operation of the driver and the HAL. Added: head/tools/tools/ath/athrd/athrd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athrd/athrd.c Thu Jan 15 23:38:21 2009 (r187322) @@ -0,0 +1,1887 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_eeprom_v3.h" /* XXX */ + +#include +#include +#include +#include +#include + +#define IEEE80211_CHAN_MAX 255 +#define IEEE80211_REGCLASSIDS_MAX 10 + +int ath_hal_debug = 0; +HAL_CTRY_CODE cc = CTRY_DEFAULT; +HAL_REG_DOMAIN rd = 169; /* FCC */ +HAL_BOOL outdoor = AH_TRUE; +HAL_BOOL Amode = 1; +HAL_BOOL Bmode = 1; +HAL_BOOL Gmode = 1; +HAL_BOOL HT20mode = 1; +HAL_BOOL HT40mode = 1; +HAL_BOOL turbo5Disable = AH_FALSE; +HAL_BOOL turbo2Disable = AH_FALSE; + +u_int16_t _numCtls = 8; +u_int16_t _ctl[32] = + { 0x10, 0x13, 0x40, 0x30, 0x11, 0x31, 0x12, 0x32 }; +RD_EDGES_POWER _rdEdgesPower[NUM_EDGES*NUM_CTLS] = { + { 5180, 28, 0 }, /* 0x10 */ + { 5240, 60, 0 }, + { 5260, 36, 0 }, + { 5320, 27, 0 }, + { 5745, 36, 0 }, + { 5765, 36, 0 }, + { 5805, 36, 0 }, + { 5825, 36, 0 }, + + { 5210, 28, 0 }, /* 0x13 */ + { 5250, 28, 0 }, + { 5290, 30, 0 }, + { 5760, 36, 0 }, + { 5800, 36, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + + { 5170, 60, 0 }, /* 0x40 */ + { 5230, 60, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 }, + + { 5180, 33, 0 }, /* 0x30 */ + { 5320, 33, 0 }, + { 5500, 34, 0 }, + { 5700, 34, 0 }, + { 5745, 35, 0 }, + { 5765, 35, 0 }, + { 5785, 35, 0 }, + { 5825, 35, 0 }, + + { 2412, 36, 0 }, /* 0x11 */ + { 2417, 36, 0 }, + { 2422, 36, 0 }, + { 2432, 36, 0 }, + { 2442, 36, 0 }, + { 2457, 36, 0 }, + { 2467, 36, 0 }, + { 2472, 36, 0 }, + + { 2412, 36, 0 }, /* 0x31 */ + { 2417, 36, 0 }, + { 2422, 36, 0 }, + { 2432, 36, 0 }, + { 2442, 36, 0 }, + { 2457, 36, 0 }, + { 2467, 36, 0 }, + { 2472, 36, 0 }, + + { 2412, 36, 0 }, /* 0x12 */ + { 2417, 36, 0 }, + { 2422, 36, 0 }, + { 2432, 36, 0 }, + { 2442, 36, 0 }, + { 2457, 36, 0 }, + { 2467, 36, 0 }, + { 2472, 36, 0 }, + + { 2412, 28, 0 }, /* 0x32 */ + { 2417, 28, 0 }, + { 2422, 28, 0 }, + { 2432, 28, 0 }, + { 2442, 28, 0 }, + { 2457, 28, 0 }, + { 2467, 28, 0 }, + { 2472, 28, 0 }, +}; + +u_int16_t turbo2WMaxPower5 = 32; +u_int16_t turbo2WMaxPower2; +int8_t antennaGainMax[2] = { 0, 0 }; /* XXX */ +int eeversion = AR_EEPROM_VER3_1; +TRGT_POWER_ALL_MODES tpow = { + 8, { + { 22, 24, 28, 32, 5180 }, + { 22, 24, 28, 32, 5200 }, + { 22, 24, 28, 32, 5320 }, + { 26, 30, 34, 34, 5500 }, + { 26, 30, 34, 34, 5700 }, + { 20, 30, 34, 36, 5745 }, + { 20, 30, 34, 36, 5825 }, + { 20, 30, 34, 36, 5850 }, + }, + 2, { + { 23, 27, 31, 34, 2412 }, + { 23, 27, 31, 34, 2447 }, + }, + 2, { + { 36, 36, 36, 36, 2412 }, + { 36, 36, 36, 36, 2484 }, + } +}; +#define numTargetPwr_11a tpow.numTargetPwr_11a +#define trgtPwr_11a tpow.trgtPwr_11a +#define numTargetPwr_11g tpow.numTargetPwr_11g +#define trgtPwr_11g tpow.trgtPwr_11g +#define numTargetPwr_11b tpow.numTargetPwr_11b +#define trgtPwr_11b tpow.trgtPwr_11b + +static HAL_BOOL +getChannelEdges(struct ath_hal *ah, u_int16_t flags, u_int16_t *low, u_int16_t *high) +{ + struct ath_hal_private *ahp = AH_PRIVATE(ah); + HAL_CAPABILITIES *pCap = &ahp->ah_caps; + + if (flags & CHANNEL_5GHZ) { + *low = pCap->halLow5GhzChan; + *high = pCap->halHigh5GhzChan; + return AH_TRUE; + } + if (flags & CHANNEL_2GHZ) { + *low = pCap->halLow2GhzChan; + *high = pCap->halHigh2GhzChan; + return AH_TRUE; + } + return AH_FALSE; +} + +static u_int +getWirelessModes(struct ath_hal *ah) +{ + u_int mode = 0; + + if (Amode) { + mode = HAL_MODE_11A; + if (!turbo5Disable) + mode |= HAL_MODE_TURBO; + } + if (Bmode) + mode |= HAL_MODE_11B; + if (Gmode) { + mode |= HAL_MODE_11G; + if (!turbo2Disable) + mode |= HAL_MODE_108G; + } + if (HT20mode) + mode |= HAL_MODE_11NG_HT20|HAL_MODE_11NA_HT20; + if (HT40mode) + mode |= HAL_MODE_11NG_HT40PLUS|HAL_MODE_11NA_HT40PLUS + | HAL_MODE_11NG_HT40MINUS|HAL_MODE_11NA_HT40MINUS + ; + return mode; +} + +/* + * Country/Region Codes from MS WINNLS.H + * Numbering from ISO 3166 + */ +enum CountryCode { + CTRY_ALBANIA = 8, /* Albania */ + CTRY_ALGERIA = 12, /* Algeria */ + CTRY_ARGENTINA = 32, /* Argentina */ + CTRY_ARMENIA = 51, /* Armenia */ + CTRY_AUSTRALIA = 36, /* Australia */ + CTRY_AUSTRIA = 40, /* Austria */ + CTRY_AZERBAIJAN = 31, /* Azerbaijan */ + CTRY_BAHRAIN = 48, /* Bahrain */ + CTRY_BELARUS = 112, /* Belarus */ + CTRY_BELGIUM = 56, /* Belgium */ + CTRY_BELIZE = 84, /* Belize */ + CTRY_BOLIVIA = 68, /* Bolivia */ + CTRY_BRAZIL = 76, /* Brazil */ + CTRY_BRUNEI_DARUSSALAM = 96, /* Brunei Darussalam */ + CTRY_BULGARIA = 100, /* Bulgaria */ + CTRY_CANADA = 124, /* Canada */ + CTRY_CHILE = 152, /* Chile */ + CTRY_CHINA = 156, /* People's Republic of China */ + CTRY_COLOMBIA = 170, /* Colombia */ + CTRY_COSTA_RICA = 188, /* Costa Rica */ + CTRY_CROATIA = 191, /* Croatia */ + CTRY_CYPRUS = 196, + CTRY_CZECH = 203, /* Czech Republic */ + CTRY_DENMARK = 208, /* Denmark */ + CTRY_DOMINICAN_REPUBLIC = 214, /* Dominican Republic */ + CTRY_ECUADOR = 218, /* Ecuador */ + CTRY_EGYPT = 818, /* Egypt */ + CTRY_EL_SALVADOR = 222, /* El Salvador */ + CTRY_ESTONIA = 233, /* Estonia */ + CTRY_FAEROE_ISLANDS = 234, /* Faeroe Islands */ + CTRY_FINLAND = 246, /* Finland */ + CTRY_FRANCE = 250, /* France */ + CTRY_FRANCE2 = 255, /* France2 */ + CTRY_GEORGIA = 268, /* Georgia */ + CTRY_GERMANY = 276, /* Germany */ + CTRY_GREECE = 300, /* Greece */ + CTRY_GSM = 843, /* 900MHz/GSM */ + CTRY_GUATEMALA = 320, /* Guatemala */ + CTRY_HONDURAS = 340, /* Honduras */ + CTRY_HONG_KONG = 344, /* Hong Kong S.A.R., P.R.C. */ + CTRY_HUNGARY = 348, /* Hungary */ + CTRY_ICELAND = 352, /* Iceland */ + CTRY_INDIA = 356, /* India */ + CTRY_INDONESIA = 360, /* Indonesia */ + CTRY_IRAN = 364, /* Iran */ + CTRY_IRAQ = 368, /* Iraq */ + CTRY_IRELAND = 372, /* Ireland */ + CTRY_ISRAEL = 376, /* Israel */ + CTRY_ITALY = 380, /* Italy */ + CTRY_JAMAICA = 388, /* Jamaica */ + CTRY_JAPAN = 392, /* Japan */ + CTRY_JAPAN1 = 393, /* Japan (JP1) */ + CTRY_JAPAN2 = 394, /* Japan (JP0) */ + CTRY_JAPAN3 = 395, /* Japan (JP1-1) */ + CTRY_JAPAN4 = 396, /* Japan (JE1) */ + CTRY_JAPAN5 = 397, /* Japan (JE2) */ + CTRY_JAPAN6 = 399, /* Japan (JP6) */ + + CTRY_JAPAN7 = 4007, /* Japan (J7) */ + CTRY_JAPAN8 = 4008, /* Japan (J8) */ + CTRY_JAPAN9 = 4009, /* Japan (J9) */ + + CTRY_JAPAN10 = 4010, /* Japan (J10) */ + CTRY_JAPAN11 = 4011, /* Japan (J11) */ + CTRY_JAPAN12 = 4012, /* Japan (J12) */ + + CTRY_JAPAN13 = 4013, /* Japan (J13) */ + CTRY_JAPAN14 = 4014, /* Japan (J14) */ + CTRY_JAPAN15 = 4015, /* Japan (J15) */ + + CTRY_JAPAN16 = 4016, /* Japan (J16) */ + CTRY_JAPAN17 = 4017, /* Japan (J17) */ + CTRY_JAPAN18 = 4018, /* Japan (J18) */ + + CTRY_JAPAN19 = 4019, /* Japan (J19) */ + CTRY_JAPAN20 = 4020, /* Japan (J20) */ + CTRY_JAPAN21 = 4021, /* Japan (J21) */ + + CTRY_JAPAN22 = 4022, /* Japan (J22) */ + CTRY_JAPAN23 = 4023, /* Japan (J23) */ + CTRY_JAPAN24 = 4024, /* Japan (J24) */ + + CTRY_JORDAN = 400, /* Jordan */ + CTRY_KAZAKHSTAN = 398, /* Kazakhstan */ + CTRY_KENYA = 404, /* Kenya */ + CTRY_KOREA_NORTH = 408, /* North Korea */ + CTRY_KOREA_ROC = 410, /* South Korea */ + CTRY_KOREA_ROC2 = 411, /* South Korea */ + CTRY_KOREA_ROC3 = 412, /* South Korea */ + CTRY_KUWAIT = 414, /* Kuwait */ + CTRY_LATVIA = 428, /* Latvia */ + CTRY_LEBANON = 422, /* Lebanon */ + CTRY_LIBYA = 434, /* Libya */ + CTRY_LIECHTENSTEIN = 438, /* Liechtenstein */ + CTRY_LITHUANIA = 440, /* Lithuania */ + CTRY_LUXEMBOURG = 442, /* Luxembourg */ + CTRY_MACAU = 446, /* Macau */ + CTRY_MACEDONIA = 807, /* the Former Yugoslav Republic of Macedonia */ + CTRY_MALAYSIA = 458, /* Malaysia */ + CTRY_MALTA = 470, /* Malta */ + CTRY_MEXICO = 484, /* Mexico */ + CTRY_MONACO = 492, /* Principality of Monaco */ + CTRY_MOROCCO = 504, /* Morocco */ + CTRY_NETHERLANDS = 528, /* Netherlands */ + CTRY_NEW_ZEALAND = 554, /* New Zealand */ + CTRY_NICARAGUA = 558, /* Nicaragua */ + CTRY_NORWAY = 578, /* Norway */ + CTRY_OMAN = 512, /* Oman */ + CTRY_PAKISTAN = 586, /* Islamic Republic of Pakistan */ + CTRY_PANAMA = 591, /* Panama */ + CTRY_PARAGUAY = 600, /* Paraguay */ + CTRY_PERU = 604, /* Peru */ + CTRY_PHILIPPINES = 608, /* Republic of the Philippines */ + CTRY_POLAND = 616, /* Poland */ + CTRY_PORTUGAL = 620, /* Portugal */ + CTRY_PUERTO_RICO = 630, /* Puerto Rico */ + CTRY_QATAR = 634, /* Qatar */ + CTRY_ROMANIA = 642, /* Romania */ + CTRY_RUSSIA = 643, /* Russia */ + CTRY_SAUDI_ARABIA = 682, /* Saudi Arabia */ + CTRY_SINGAPORE = 702, /* Singapore */ + CTRY_SLOVAKIA = 703, /* Slovak Republic */ + CTRY_SLOVENIA = 705, /* Slovenia */ + CTRY_SOUTH_AFRICA = 710, /* South Africa */ + CTRY_SPAIN = 724, /* Spain */ + CTRY_SWEDEN = 752, /* Sweden */ + CTRY_SWITZERLAND = 756, /* Switzerland */ + CTRY_SYRIA = 760, /* Syria */ + CTRY_TAIWAN = 158, /* Taiwan */ + CTRY_THAILAND = 764, /* Thailand */ + CTRY_TRINIDAD_Y_TOBAGO = 780, /* Trinidad y Tobago */ + CTRY_TUNISIA = 788, /* Tunisia */ + CTRY_TURKEY = 792, /* Turkey */ + CTRY_UAE = 784, /* U.A.E. */ + CTRY_UKRAINE = 804, /* Ukraine */ + CTRY_UNITED_KINGDOM = 826, /* United Kingdom */ + CTRY_UNITED_STATES = 840, /* United States */ + CTRY_UNITED_STATES_FCC49 = 842, /* United States (Public Safety)*/ + CTRY_URUGUAY = 858, /* Uruguay */ + CTRY_UZBEKISTAN = 860, /* Uzbekistan */ + CTRY_VENEZUELA = 862, /* Venezuela */ + CTRY_VIET_NAM = 704, /* Viet Nam */ + CTRY_YEMEN = 887, /* Yemen */ + CTRY_ZIMBABWE = 716 /* Zimbabwe */ +}; + + +/* Enumerated Regulatory Domain Information 8 bit values indicate that + * the regdomain is really a pair of unitary regdomains. 12 bit values + * are the real unitary regdomains and are the only ones which have the + * frequency bitmasks and flags set. + */ + +enum EnumRd { + /* + * The following regulatory domain definitions are + * found in the EEPROM. Each regulatory domain + * can operate in either a 5GHz or 2.4GHz wireless mode or + * both 5GHz and 2.4GHz wireless modes. + * In general, the value holds no special + * meaning and is used to decode into either specific + * 2.4GHz or 5GHz wireless mode for that particular + * regulatory domain. + */ + NO_ENUMRD = 0x00, + NULL1_WORLD = 0x03, /* For 11b-only countries (no 11a allowed) */ + NULL1_ETSIB = 0x07, /* Israel */ + NULL1_ETSIC = 0x08, + NULL1_GSM = 0x09, /* GSM-only operation */ + FCC1_FCCA = 0x10, /* USA */ + FCC1_WORLD = 0x11, /* Hong Kong */ + FCC4_FCCA = 0x12, /* USA - Public Safety */ + + FCC2_FCCA = 0x20, /* Canada */ + FCC2_WORLD = 0x21, /* Australia & HK */ + FCC2_ETSIC = 0x22, + FRANCE_RES = 0x31, /* Legacy France for OEM */ + FCC3_FCCA = 0x3A, /* USA & Canada w/5470 band, 11h, DFS enabled */ + FCC3_WORLD = 0x3B, /* USA & Canada w/5470 band, 11h, DFS enabled */ + + ETSI1_WORLD = 0x37, + ETSI3_ETSIA = 0x32, /* France (optional) */ + ETSI2_WORLD = 0x35, /* Hungary & others */ + ETSI3_WORLD = 0x36, /* France & others */ + ETSI4_WORLD = 0x30, + ETSI4_ETSIC = 0x38, + ETSI5_WORLD = 0x39, + ETSI6_WORLD = 0x34, /* Bulgaria */ + ETSI_RESERVED = 0x33, /* Reserved (Do not used) */ + + MKK1_MKKA = 0x40, /* Japan (JP1) */ + MKK1_MKKB = 0x41, /* Japan (JP0) */ + APL4_WORLD = 0x42, /* Singapore */ + MKK2_MKKA = 0x43, /* Japan with 4.9G channels */ + APL_RESERVED = 0x44, /* Reserved (Do not used) */ + APL2_WORLD = 0x45, /* Korea */ + APL2_APLC = 0x46, + APL3_WORLD = 0x47, + MKK1_FCCA = 0x48, /* Japan (JP1-1) */ + APL2_APLD = 0x49, /* Korea with 2.3G channels */ + MKK1_MKKA1 = 0x4A, /* Japan (JE1) */ + MKK1_MKKA2 = 0x4B, /* Japan (JE2) */ + MKK1_MKKC = 0x4C, /* Japan (MKK1_MKKA,except Ch14) */ + + APL3_FCCA = 0x50, + APL1_WORLD = 0x52, /* Latin America */ + APL1_FCCA = 0x53, + APL1_APLA = 0x54, + APL1_ETSIC = 0x55, + APL2_ETSIC = 0x56, /* Venezuela */ + APL5_WORLD = 0x58, /* Chile */ + APL6_WORLD = 0x5B, /* Singapore */ + APL7_FCCA = 0x5C, /* Taiwan 5.47 Band */ + APL8_WORLD = 0x5D, /* Malaysia 5GHz */ + APL9_WORLD = 0x5E, /* Korea 5GHz */ + + /* + * World mode SKUs + */ + WOR0_WORLD = 0x60, /* World0 (WO0 SKU) */ + WOR1_WORLD = 0x61, /* World1 (WO1 SKU) */ + WOR2_WORLD = 0x62, /* World2 (WO2 SKU) */ + WOR3_WORLD = 0x63, /* World3 (WO3 SKU) */ + WOR4_WORLD = 0x64, /* World4 (WO4 SKU) */ + WOR5_ETSIC = 0x65, /* World5 (WO5 SKU) */ + + WOR01_WORLD = 0x66, /* World0-1 (WW0-1 SKU) */ + WOR02_WORLD = 0x67, /* World0-2 (WW0-2 SKU) */ + EU1_WORLD = 0x68, /* Same as World0-2 (WW0-2 SKU), except active scan ch1-13. No ch14 */ + + WOR9_WORLD = 0x69, /* World9 (WO9 SKU) */ + WORA_WORLD = 0x6A, /* WorldA (WOA SKU) */ + + MKK3_MKKB = 0x80, /* Japan UNI-1 even + MKKB */ + MKK3_MKKA2 = 0x81, /* Japan UNI-1 even + MKKA2 */ + MKK3_MKKC = 0x82, /* Japan UNI-1 even + MKKC */ + + MKK4_MKKB = 0x83, /* Japan UNI-1 even + UNI-2 + MKKB */ + MKK4_MKKA2 = 0x84, /* Japan UNI-1 even + UNI-2 + MKKA2 */ + MKK4_MKKC = 0x85, /* Japan UNI-1 even + UNI-2 + MKKC */ + + MKK5_MKKB = 0x86, /* Japan UNI-1 even + UNI-2 + mid-band + MKKB */ + MKK5_MKKA2 = 0x87, /* Japan UNI-1 even + UNI-2 + mid-band + MKKA2 */ + MKK5_MKKC = 0x88, /* Japan UNI-1 even + UNI-2 + mid-band + MKKC */ + + MKK6_MKKB = 0x89, /* Japan UNI-1 even + UNI-1 odd MKKB */ + MKK6_MKKA2 = 0x8A, /* Japan UNI-1 even + UNI-1 odd + MKKA2 */ + MKK6_MKKC = 0x8B, /* Japan UNI-1 even + UNI-1 odd + MKKC */ + + MKK7_MKKB = 0x8C, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKB */ + MKK7_MKKA2 = 0x8D, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKA2 */ + MKK7_MKKC = 0x8E, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKC */ + + MKK8_MKKB = 0x8F, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKB */ + MKK8_MKKA2 = 0x90, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKA2 */ + MKK8_MKKC = 0x91, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKC */ + + /* Following definitions are used only by s/w to map old + * Japan SKUs. + */ + MKK3_MKKA = 0xF0, /* Japan UNI-1 even + MKKA */ + MKK3_MKKA1 = 0xF1, /* Japan UNI-1 even + MKKA1 */ + MKK3_FCCA = 0xF2, /* Japan UNI-1 even + FCCA */ + MKK4_MKKA = 0xF3, /* Japan UNI-1 even + UNI-2 + MKKA */ + MKK4_MKKA1 = 0xF4, /* Japan UNI-1 even + UNI-2 + MKKA1 */ + MKK4_FCCA = 0xF5, /* Japan UNI-1 even + UNI-2 + FCCA */ + MKK9_MKKA = 0xF6, /* Japan UNI-1 even + 4.9GHz */ + MKK10_MKKA = 0xF7, /* Japan UNI-1 even + UNI-2 + 4.9GHz */ + + /* + * Regulator domains ending in a number (e.g. APL1, + * MK1, ETSI4, etc) apply to 5GHz channel and power + * information. Regulator domains ending in a letter + * (e.g. APLA, FCCA, etc) apply to 2.4GHz channel and + * power information. + */ + APL1 = 0x0150, /* LAT & Asia */ + APL2 = 0x0250, /* LAT & Asia */ + APL3 = 0x0350, /* Taiwan */ + APL4 = 0x0450, /* Jordan */ + APL5 = 0x0550, /* Chile */ + APL6 = 0x0650, /* Singapore */ + APL8 = 0x0850, /* Malaysia */ + APL9 = 0x0950, /* Korea (South) ROC 3 */ + + ETSI1 = 0x0130, /* Europe & others */ + ETSI2 = 0x0230, /* Europe & others */ + ETSI3 = 0x0330, /* Europe & others */ + ETSI4 = 0x0430, /* Europe & others */ + ETSI5 = 0x0530, /* Europe & others */ + ETSI6 = 0x0630, /* Europe & others */ + ETSIA = 0x0A30, /* France */ + ETSIB = 0x0B30, /* Israel */ + ETSIC = 0x0C30, /* Latin America */ + + FCC1 = 0x0110, /* US & others */ + FCC2 = 0x0120, /* Canada, Australia & New Zealand */ + FCC3 = 0x0160, /* US w/new middle band & DFS */ + FCC4 = 0x0165, /* US Public Safety */ + FCCA = 0x0A10, + + APLD = 0x0D50, /* South Korea */ + + MKK1 = 0x0140, /* Japan (UNI-1 odd)*/ + MKK2 = 0x0240, /* Japan (4.9 GHz + UNI-1 odd) */ + MKK3 = 0x0340, /* Japan (UNI-1 even) */ + MKK4 = 0x0440, /* Japan (UNI-1 even + UNI-2) */ + MKK5 = 0x0540, /* Japan (UNI-1 even + UNI-2 + mid-band) */ + MKK6 = 0x0640, /* Japan (UNI-1 odd + UNI-1 even) */ + MKK7 = 0x0740, /* Japan (UNI-1 odd + UNI-1 even + UNI-2 */ + MKK8 = 0x0840, /* Japan (UNI-1 odd + UNI-1 even + UNI-2 + mid-band) */ + MKK9 = 0x0940, /* Japan (UNI-1 even + 4.9 GHZ) */ + MKK10 = 0x0B40, /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */ + MKKA = 0x0A40, /* Japan */ + MKKC = 0x0A50, + + NULL1 = 0x0198, + WORLD = 0x0199, + GSM = 0x019a, + DEBUG_REG_DMN = 0x01ff, +}; +#define DEF_REGDMN FCC1_FCCA + +static struct { + const char *name; + HAL_REG_DOMAIN rd; +} domains[] = { +#define D(_x) { #_x, _x } + D(NO_ENUMRD), + D(NULL1_WORLD), /* For 11b-only countries (no 11a allowed) */ + D(NULL1_ETSIB), /* Israel */ + D(NULL1_ETSIC), + D(NULL1_GSM), /* GSM-only operation */ + D(FCC1_FCCA), /* USA */ + D(FCC1_WORLD), /* Hong Kong */ + D(FCC4_FCCA), /* USA - Public Safety */ + + D(FCC2_FCCA), /* Canada */ + D(FCC2_WORLD), /* Australia & HK */ + D(FCC2_ETSIC), + D(FRANCE_RES), /* Legacy France for OEM */ + D(FCC3_FCCA), + D(FCC3_WORLD), + + D(ETSI1_WORLD), + D(ETSI3_ETSIA), /* France (optional) */ + D(ETSI2_WORLD), /* Hungary & others */ + D(ETSI3_WORLD), /* France & others */ + D(ETSI4_WORLD), + D(ETSI4_ETSIC), + D(ETSI5_WORLD), + D(ETSI6_WORLD), /* Bulgaria */ + D(ETSI_RESERVED), /* Reserved (Do not used) */ + + D(MKK1_MKKA), /* Japan (JP1) */ + D(MKK1_MKKB), /* Japan (JP0) */ + D(APL4_WORLD), /* Singapore */ + D(MKK2_MKKA), /* Japan with 4.9G channels */ + D(APL_RESERVED), /* Reserved (Do not used) */ + D(APL2_WORLD), /* Korea */ + D(APL2_APLC), + D(APL3_WORLD), + D(MKK1_FCCA), /* Japan (JP1-1) */ + D(APL2_APLD), /* Korea with 2.3G channels */ + D(MKK1_MKKA1), /* Japan (JE1) */ + D(MKK1_MKKA2), /* Japan (JE2) */ + D(MKK1_MKKC), + + D(APL3_FCCA), + D(APL1_WORLD), /* Latin America */ + D(APL1_FCCA), + D(APL1_APLA), + D(APL1_ETSIC), + D(APL2_ETSIC), /* Venezuela */ + D(APL5_WORLD), /* Chile */ + D(APL6_WORLD), /* Singapore */ + D(APL7_FCCA), /* Taiwan 5.47 Band */ + D(APL8_WORLD), /* Malaysia 5GHz */ + D(APL9_WORLD), /* Korea 5GHz */ + + D(WOR0_WORLD), /* World0 (WO0 SKU) */ + D(WOR1_WORLD), /* World1 (WO1 SKU) */ + D(WOR2_WORLD), /* World2 (WO2 SKU) */ + D(WOR3_WORLD), /* World3 (WO3 SKU) */ + D(WOR4_WORLD), /* World4 (WO4 SKU) */ + D(WOR5_ETSIC), /* World5 (WO5 SKU) */ + + D(WOR01_WORLD), /* World0-1 (WW0-1 SKU) */ + D(WOR02_WORLD), /* World0-2 (WW0-2 SKU) */ + D(EU1_WORLD), + + D(WOR9_WORLD), /* World9 (WO9 SKU) */ + D(WORA_WORLD), /* WorldA (WOA SKU) */ + + D(MKK3_MKKB), /* Japan UNI-1 even + MKKB */ + D(MKK3_MKKA2), /* Japan UNI-1 even + MKKA2 */ + D(MKK3_MKKC), /* Japan UNI-1 even + MKKC */ + + D(MKK4_MKKB), /* Japan UNI-1 even + UNI-2 + MKKB */ + D(MKK4_MKKA2), /* Japan UNI-1 even + UNI-2 + MKKA2 */ + D(MKK4_MKKC), /* Japan UNI-1 even + UNI-2 + MKKC */ + + D(MKK5_MKKB), /* Japan UNI-1 even + UNI-2 + mid-band + MKKB */ + D(MKK5_MKKA2), /* Japan UNI-1 even + UNI-2 + mid-band + MKKA2 */ + D(MKK5_MKKC), /* Japan UNI-1 even + UNI-2 + mid-band + MKKC */ + + D(MKK6_MKKB), /* Japan UNI-1 even + UNI-1 odd MKKB */ + D(MKK6_MKKA2), /* Japan UNI-1 even + UNI-1 odd + MKKA2 */ + D(MKK6_MKKC), /* Japan UNI-1 even + UNI-1 odd + MKKC */ + + D(MKK7_MKKB), /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKB */ + D(MKK7_MKKA2), /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKA2 */ + D(MKK7_MKKC), /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKC */ + + D(MKK8_MKKB), /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKB */ + D(MKK8_MKKA2), /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKA2 */ + D(MKK8_MKKC), /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKC */ + + D(MKK3_MKKA), /* Japan UNI-1 even + MKKA */ + D(MKK3_MKKA1), /* Japan UNI-1 even + MKKA1 */ + D(MKK3_FCCA), /* Japan UNI-1 even + FCCA */ + D(MKK4_MKKA), /* Japan UNI-1 even + UNI-2 + MKKA */ + D(MKK4_MKKA1), /* Japan UNI-1 even + UNI-2 + MKKA1 */ + D(MKK4_FCCA), /* Japan UNI-1 even + UNI-2 + FCCA */ + D(MKK9_MKKA), /* Japan UNI-1 even + 4.9GHz */ + D(MKK10_MKKA), /* Japan UNI-1 even + UNI-2 + 4.9GHz */ + + D(APL1), /* LAT & Asia */ + D(APL2), /* LAT & Asia */ + D(APL3), /* Taiwan */ + D(APL4), /* Jordan */ + D(APL5), /* Chile */ + D(APL6), /* Singapore */ + D(APL8), /* Malaysia */ + D(APL9), /* Korea (South) ROC 3 */ + + D(ETSI1), /* Europe & others */ + D(ETSI2), /* Europe & others */ + D(ETSI3), /* Europe & others */ + D(ETSI4), /* Europe & others */ + D(ETSI5), /* Europe & others */ + D(ETSI6), /* Europe & others */ + D(ETSIA), /* France */ + D(ETSIB), /* Israel */ + D(ETSIC), /* Latin America */ + + D(FCC1), /* US & others */ + D(FCC2), + D(FCC3), /* US w/new middle band & DFS */ + D(FCC4), /* US Public Safety */ + D(FCCA), + + D(APLD), /* South Korea */ + + D(MKK1), /* Japan (UNI-1 odd)*/ + D(MKK2), /* Japan (4.9 GHz + UNI-1 odd) */ + D(MKK3), /* Japan (UNI-1 even) */ + D(MKK4), /* Japan (UNI-1 even + UNI-2) */ + D(MKK5), /* Japan (UNI-1 even + UNI-2 + mid-band) */ + D(MKK6), /* Japan (UNI-1 odd + UNI-1 even) */ + D(MKK7), /* Japan (UNI-1 odd + UNI-1 even + UNI-2 */ + D(MKK8), /* Japan (UNI-1 odd + UNI-1 even + UNI-2 + mid-band) */ + D(MKK9), /* Japan (UNI-1 even + 4.9 GHZ) */ + D(MKK10), /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */ + D(MKKA), /* Japan */ + D(MKKC), + + D(NULL1), + D(WORLD), + D(GSM), + D(DEBUG_REG_DMN), +#undef D +}; + +static HAL_BOOL +rdlookup(const char *name, HAL_REG_DOMAIN *rd) +{ +#define N(a) (sizeof(a)/sizeof(a[0])) + int i; + + for (i = 0; i < N(domains); i++) + if (strcasecmp(domains[i].name, name) == 0) { + *rd = domains[i].rd; + return AH_TRUE; + } + return AH_FALSE; +#undef N +} + +static const char * +getrdname(HAL_REG_DOMAIN rd) +{ +#define N(a) (sizeof(a)/sizeof(a[0])) + int i; + + for (i = 0; i < N(domains); i++) + if (domains[i].rd == rd) + return domains[i].name; + return NULL; +#undef N +} + +static void +rdlist() +{ +#define N(a) (sizeof(a)/sizeof(a[0])) + int i; + + printf("\nRegulatory domains:\n\n"); + for (i = 0; i < N(domains); i++) + printf("%-15s%s", domains[i].name, + ((i+1)%5) == 0 ? "\n" : ""); + printf("\n"); +#undef N +} + +typedef struct { + HAL_CTRY_CODE countryCode; + HAL_REG_DOMAIN regDmnEnum; + const char* isoName; + const char* name; + HAL_BOOL allow11g; + HAL_BOOL allow11aTurbo; + HAL_BOOL allow11gTurbo; + u_int16_t outdoorChanStart; +} COUNTRY_CODE_TO_ENUM_RD; + +#define YES AH_TRUE +#define NO AH_FALSE +/* Index into table to avoid DEBUG and NO COUNTRY SET entries */ +#define CTRY_ONLY_INDEX 2 +/* + * Country Code Table to Enumerated RD + */ + +static COUNTRY_CODE_TO_ENUM_RD allCountries[] = { + {CTRY_DEBUG, NO_ENUMRD, "DB", "DEBUG", YES, YES, YES, 7000 }, + {CTRY_DEFAULT, DEF_REGDMN, "NA", "NO_COUNTRY_SET", YES, YES, YES, 7000 }, + {CTRY_ALBANIA, NULL1_WORLD, "AL", "ALBANIA", YES, NO, YES, 7000 }, + {CTRY_ALGERIA, NULL1_WORLD, "DZ", "ALGERIA", YES, NO, YES, 7000 }, + {CTRY_ARGENTINA, APL3_WORLD, "AR", "ARGENTINA", NO, NO, NO, 7000 }, + {CTRY_ARMENIA, ETSI4_WORLD, "AM", "ARMENIA", YES, NO, YES, 7000 }, + {CTRY_AUSTRALIA, FCC2_WORLD, "AU", "AUSTRALIA", YES, YES, YES, 7000 }, + {CTRY_AUSTRIA, ETSI1_WORLD, "AT", "AUSTRIA", YES, NO, YES, 7000 }, + {CTRY_AZERBAIJAN, ETSI4_WORLD, "AZ", "AZERBAIJAN", YES, YES, YES, 7000 }, + {CTRY_BAHRAIN, APL6_WORLD, "BH", "BAHRAIN", YES, NO, YES, 7000 }, + {CTRY_BELARUS, NULL1_WORLD, "BY", "BELARUS", YES, NO, YES, 7000 }, + {CTRY_BELGIUM, ETSI1_WORLD, "BE", "BELGIUM", YES, NO, YES, 7000 }, + {CTRY_BELIZE, APL1_ETSIC, "BZ", "BELIZE", YES, YES, YES, 7000 }, + {CTRY_BOLIVIA, APL1_ETSIC, "BO", "BOLVIA", YES, YES, YES, 7000 }, + {CTRY_BRAZIL, FCC3_WORLD, "BR", "BRAZIL", YES, NO, NO, 7000 }, + {CTRY_BRUNEI_DARUSSALAM,APL1_WORLD,"BN", "BRUNEI DARUSSALAM", YES, YES, YES, 7000 }, + {CTRY_BULGARIA, ETSI6_WORLD, "BG", "BULGARIA", YES, NO, YES, 7000 }, + {CTRY_CANADA, FCC2_FCCA, "CA", "CANADA", YES, YES, YES, 7000 }, + {CTRY_CHILE, APL6_WORLD, "CL", "CHILE", YES, YES, YES, 7000 }, + {CTRY_CHINA, APL1_WORLD, "CN", "CHINA", YES, YES, YES, 7000 }, + {CTRY_COLOMBIA, FCC1_FCCA, "CO", "COLOMBIA", YES, NO, YES, 7000 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 23:44:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82FAF1065676 for ; Thu, 15 Jan 2009 23:44:20 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.freebsd.org (Postfix) with ESMTP id B69198FC14 for ; Thu, 15 Jan 2009 23:44:19 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-066-043-041.pools.arcor-ip.net [88.66.43.41]) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis) id 0ML21M-1LNbso26f9-0007mM; Fri, 16 Jan 2009 00:44:18 +0100 Received: (qmail 45440 invoked from network); 15 Jan 2009 23:44:18 -0000 Received: from fbsd8.laiers.local (192.168.4.151) by router.laiers.local with SMTP; 15 Jan 2009 23:44:18 -0000 From: Max Laier Organization: FreeBSD To: John Baldwin Date: Fri, 16 Jan 2009 00:44:17 +0100 User-Agent: KMail/1.10.4 (FreeBSD/8.0-CURRENT; KDE/4.1.4; i386; ; ) References: <200812161703.mBGH3M7m042955@svn.freebsd.org> <200812172109.55724.max@love2party.net> <200901151659.35735.jhb@freebsd.org> In-Reply-To: <200901151659.35735.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901160044.18044.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1/miOsifbHE/WzLD02cOWxmwx/MKu9QLzNgGU1 h+m75L0Rp5WMBPQRm/DMRWNpF2LzjNkJx7gzvXiboPAQCNgH/9 cjXYxamaVBu+pAg+XlztA== Cc: src-committers@freebsd.org, Kip Macy , svn-src-all@freebsd.org, Attilio Rao , Robert Watson , svn-src-head@freebsd.org Subject: Re: svn commit: r186187 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 23:44:20 -0000 Thank you for getting back to this ... On Thursday 15 January 2009 22:59:35 John Baldwin wrote: > So the usual model would be to do something like this: > > LIST(foo, ) foo_list; > > foo_add(foo *p) > { > > /* Construct foo, but don't lock it. */ > WLOCK(foo_list); > LIST_INSERT(foo_list, foo); > WUNLOCK(foo_list); > } > > foo * > foo_find(int key) > { > foo *p; > > RLOCK(foo_list); > LIST_FOREACH(p, foo_list) { > if (p->key == key) { > LOCK(p); > RUNLOCK(foo_list); Is this allowed now? I was under the impression that it was bad for some reason to interchange locks/unlocks like this. Something about WITNESS getting confused and/or real lock order problems? I'm more than happy if that's not the case. > return (p); > } > } > RUNLOCK(foo_list); > return (NULL); > } > > something_else() > { > foo *p; > > RLOCK(foo_list); > LIST_FOREACH(p, foo_list) { > LOCK(p); > bar(p); > UNLOCK(p); > } > RUNLOCK(foo_list); > } > > From your description it would appear that you are doing something_else() > but without actually locking foo_list. Unless you can demonstrate a clear > win in benchmarks from not having the lock there, I would suggest just > going with the simpler and more common approach. Depending on the mtx of > the individual head doesn't do anything to solve races with removing the > head from the list. The thing is that the list of pfil_heads is just a "configuration time" construct. We really don't want to look at it in the hot path. Hence we allow the caller of pfil_head_register() (foo_add) to hold on to its reference of the pfil_head and work with it without requiring any interaction with the lookup list. This, however, is not the problem at all. It's the responsibility of the caller to ensure that it won't fiddle with the cached reference after calling pfil_head_unregister(). > So, reading a bit further, I think the real fix is that the pfil API is a > bit busted. What you really want to do is have pfil_get_head() operate > like foo_find() and lock the head before dropping the list lock. That is > the only race I see in the current code. However, because you malloc() > after calling pfil_get_head() that is problematic. That is, the current > consumer code looks like this: > > ph = pfil_get_head(x, y); > > pfil_add_hook(..., ph); /* calls malloc() */ > > I think you should change the API to be this instead: > > pfil_add_hook(..., x, y); > > and have pfil_get_head() do the lookup internally: > > pfil_add_hook() > { > > malloc(...); > > ph = pfil_get_head(x, y); /* locks the 'ph' like foo_find() */ > } This is a good idea/catch, but still not my initial problem. My real problem is what foo_remove() should look like in the scenario above. I assume that it should look something like this: foo_remove(int key) { WLOCK(foo_list); LIST_FOREACH(p, foo_list) if (p->key == key) { LIST_REMOVE(p, entries); LOCK(p); /* <--- HERE */ WUNLOCK(foo_list); /* free resources inside p */ /* uninit lock */ free(p); return; } WUNLOCK(foo_list); } I assume that locking the element's lock above is necessary as a pfil_add_hook as you describe above will only hold the element's lock while adding resources to it and not the list lock (as foo_find drops that before returning) and as such we might not see all changes done by pfil_add_hook in the thread that is doing the foo_remove(), right? Something similar is true for the the foo_add() above. Is there a reason why we don't want to lock the element's lock while we initialize? While it is safe if we always go through foo_find() before altering the element and thus synchronize on the list lock, it seems bogus to rely on this (even though it does make sense to go through foo_find() every time as I wrote earlier). -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 00:57:27 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B97CE1065674; Fri, 16 Jan 2009 00:57:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6B7D58FC1E; Fri, 16 Jan 2009 00:57:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0G0sWBH079693; Thu, 15 Jan 2009 17:54:32 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 15 Jan 2009 17:55:00 -0700 (MST) Message-Id: <20090115.175500.692488694.imp@bsdimp.com> To: sobomax@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <496FC32F.3040104@FreeBSD.org> References: <20090115114407.GA67726@FreeBSD.org> <496F24D8.2040104@gmx.de> <496FC32F.3040104@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: danfe@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, stas@FreeBSD.org, gonzo@FreeBSD.org, svn-src-head@FreeBSD.org, christoph.mallon@gmx.de Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 00:57:28 -0000 In message: <496FC32F.3040104@FreeBSD.org> Maxim Sobolev writes: : Christoph Mallon wrote: : > Alexey Dokuchaev schrieb: : >> On Wed, Jan 14, 2009 at 07:05:27PM -0700, M. Warner Losh wrote: : >>> In message: <20090115020752.52566769.stas@FreeBSD.org> : >>> Stanislav Sedov writes: : >>> : > + shift = 8 * (reg & 3); : >>> : > : : Would it make sense to replace this with : >>> : > + shift = (reg & 3) << 3; : >>> : : to not rely on possible compiler optimizations? : >>> : >>> I don't think that it matters all that much these days... : >> : >> But the name "shift" kinda suggests << instead of *, no? : > : > The value *is* a shift amount (see its uses a few lines down). Its name : > does not imply the way it is calculated, but what it is used for. : > : > BTW: Even the most cheap compilers emit shift instructions for : > multiplication by a power of two. The new code also is clearly faster : > then the old - quite some code gets generated for switches. : : I believe Warner's point is that the code is not in the hot path, so : that it should not really matter either way. The code is clear the way it is, there's little reason to hyper-optimize this path in the face of bogus compiler optimizations or not, and the effort to optimize the hot-path should be aided by dtrace or kernel profiling rather than reading the code. Warner From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 08:06:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F91C106564A; Fri, 16 Jan 2009 08:06: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 7CB398FC19; Fri, 16 Jan 2009 08:06:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0G86tcZ000259; Fri, 16 Jan 2009 08:06:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0G86tvo000257; Fri, 16 Jan 2009 08:06:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200901160806.n0G86tvo000257@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 16 Jan 2009 08:06: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: r187325 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 08:06:56 -0000 Author: yongari Date: Fri Jan 16 08:06:55 2009 New Revision: 187325 URL: http://svn.freebsd.org/changeset/base/187325 Log: Add hardware MAC statistics support. Also added some reserved statistics register definition. Users can get current MAC statistics from dev.msk.%d.stats sysctl node(%d is unit number of a device). Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Jan 16 05:32:56 2009 (r187324) +++ head/sys/dev/msk/if_msk.c Fri Jan 16 08:06:55 2009 (r187325) @@ -291,6 +291,11 @@ static void msk_setmulti(struct msk_if_s static void msk_setvlan(struct msk_if_softc *, struct ifnet *); static void msk_setpromisc(struct msk_if_softc *); +static void msk_stats_clear(struct msk_if_softc *); +static void msk_stats_update(struct msk_if_softc *); +static int msk_sysctl_stat32(SYSCTL_HANDLER_ARGS); +static int msk_sysctl_stat64(SYSCTL_HANDLER_ARGS); +static void msk_sysctl_node(struct msk_if_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_msk_proc_limit(SYSCTL_HANDLER_ARGS); @@ -1435,6 +1440,7 @@ msk_attach(device_t dev) callout_init_mtx(&sc_if->msk_tick_ch, &sc_if->msk_softc->msk_mtx, 0); TASK_INIT(&sc_if->msk_link_task, 0, msk_link_task, sc_if); + msk_sysctl_node(sc_if); /* Disable jumbo frame for Yukon FE. */ if (sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_FE) @@ -3544,15 +3550,8 @@ msk_init_locked(struct msk_if_softc *sc_ /* Dummy read the Interrupt Source Register. */ CSR_READ_1(sc, MR_ADDR(sc_if->msk_port, GMAC_IRQ_SRC)); - /* Set MIB Clear Counter Mode. */ - gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); - GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); - /* Read all MIB Counters with Clear Mode set. */ - for (i = 0; i < GM_MIB_CNT_SIZE; i++) - GMAC_READ_2(sc, sc_if->msk_port, GM_MIB_CNT_BASE + 8 * i); - /* Clear MIB Clear Counter Mode. */ - gmac &= ~GM_PAR_MIB_CLR; - GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac); + /* Clear MIB stats. */ + msk_stats_clear(sc_if); /* Disable FCS. */ GMAC_WRITE_2(sc, sc_if->msk_port, GM_RX_CTRL, GM_RXCR_CRC_DIS); @@ -3838,6 +3837,8 @@ msk_stop(struct msk_if_softc *sc_if) GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, val); /* Read again to ensure writing. */ GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); + /* Update stats and clear counters. */ + msk_stats_update(sc_if); /* Stop Tx BMU. */ CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_CSR), BMU_STOP); @@ -3953,6 +3954,295 @@ msk_stop(struct msk_if_softc *sc_if) sc_if->msk_link = 0; } +/* + * When GM_PAR_MIB_CLR bit of GM_PHY_ADDR is set, reading lower + * counter clears high 16 bits of the counter such that accessing + * lower 16 bits should be the last operation. + */ +#define MSK_READ_MIB32(x, y) \ + (((uint32_t)GMAC_READ_2(sc, x, (y) + 4)) << 16) + \ + (uint32_t)GMAC_READ_2(sc, x, y) +#define MSK_READ_MIB64(x, y) \ + (((uint64_t)MSK_READ_MIB32(x, (y) + 8)) << 32) + \ + (uint64_t)MSK_READ_MIB32(x, y) + +static void +msk_stats_clear(struct msk_if_softc *sc_if) +{ + struct msk_softc *sc; + uint32_t reg; + uint16_t gmac; + int i; + + MSK_IF_LOCK_ASSERT(sc_if); + + sc = sc_if->msk_softc; + /* Set MIB Clear Counter Mode. */ + gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); + /* Read all MIB Counters with Clear Mode set. */ + for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i++) + reg = MSK_READ_MIB32(sc_if->msk_port, i); + /* Clear MIB Clear Counter Mode. */ + gmac &= ~GM_PAR_MIB_CLR; + GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac); +} + +static void +msk_stats_update(struct msk_if_softc *sc_if) +{ + struct msk_softc *sc; + struct ifnet *ifp; + struct msk_hw_stats *stats; + uint16_t gmac; + uint32_t reg; + + MSK_IF_LOCK_ASSERT(sc_if); + + ifp = sc_if->msk_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + sc = sc_if->msk_softc; + stats = &sc_if->msk_stats; + /* Set MIB Clear Counter Mode. */ + gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); + + /* Rx stats. */ + stats->rx_ucast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_UC_OK); + stats->rx_bcast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_BC_OK); + stats->rx_pause_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_MPAUSE); + stats->rx_mcast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_MC_OK); + stats->rx_crc_errs += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_FCS_ERR); + reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE1); + stats->rx_good_octets += + MSK_READ_MIB64(sc_if->msk_port, GM_RXO_OK_LO); + stats->rx_bad_octets += + MSK_READ_MIB64(sc_if->msk_port, GM_RXO_ERR_LO); + stats->rx_runts += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SHT); + stats->rx_runt_errs += + MSK_READ_MIB32(sc_if->msk_port, GM_RXE_FRAG); + stats->rx_pkts_64 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_64B); + stats->rx_pkts_65_127 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_127B); + stats->rx_pkts_128_255 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_255B); + stats->rx_pkts_256_511 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_511B); + stats->rx_pkts_512_1023 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_1023B); + stats->rx_pkts_1024_1518 += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_1518B); + stats->rx_pkts_1519_max += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_MAX_SZ); + stats->rx_pkts_too_long += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_LNG_ERR); + stats->rx_pkts_jabbers += + MSK_READ_MIB32(sc_if->msk_port, GM_RXF_JAB_PKT); + reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE2); + stats->rx_fifo_oflows += + MSK_READ_MIB32(sc_if->msk_port, GM_RXE_FIFO_OV); + reg = MSK_READ_MIB32(sc_if->msk_port, GM_RXF_SPARE3); + + /* Tx stats. */ + stats->tx_ucast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_UC_OK); + stats->tx_bcast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_BC_OK); + stats->tx_pause_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MPAUSE); + stats->tx_mcast_frames += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MC_OK); + stats->tx_octets += + MSK_READ_MIB64(sc_if->msk_port, GM_TXO_OK_LO); + stats->tx_pkts_64 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_64B); + stats->tx_pkts_65_127 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_127B); + stats->tx_pkts_128_255 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_255B); + stats->tx_pkts_256_511 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_511B); + stats->tx_pkts_512_1023 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_1023B); + stats->tx_pkts_1024_1518 += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_1518B); + stats->tx_pkts_1519_max += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MAX_SZ); + reg = MSK_READ_MIB32(sc_if->msk_port, GM_TXF_SPARE1); + stats->tx_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_COL); + stats->tx_late_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_LAT_COL); + stats->tx_excess_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_ABO_COL); + stats->tx_multi_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_MUL_COL); + stats->tx_single_colls += + MSK_READ_MIB32(sc_if->msk_port, GM_TXF_SNG_COL); + stats->tx_underflows += + MSK_READ_MIB32(sc_if->msk_port, GM_TXE_FIFO_UR); + /* Clear MIB Clear Counter Mode. */ + gmac &= ~GM_PAR_MIB_CLR; + GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac); +} + +static int +msk_sysctl_stat32(SYSCTL_HANDLER_ARGS) +{ + struct msk_softc *sc; + struct msk_if_softc *sc_if; + uint32_t result, *stat; + int off; + + sc_if = (struct msk_if_softc *)arg1; + sc = sc_if->msk_softc; + off = arg2; + stat = (uint32_t *)((uint8_t *)&sc_if->msk_stats + off); + + MSK_IF_LOCK(sc_if); + result = MSK_READ_MIB32(sc_if->msk_port, GM_MIB_CNT_BASE + off * 2); + result += *stat; + MSK_IF_UNLOCK(sc_if); + + return (sysctl_handle_int(oidp, &result, 0, req)); +} + +static int +msk_sysctl_stat64(SYSCTL_HANDLER_ARGS) +{ + struct msk_softc *sc; + struct msk_if_softc *sc_if; + uint64_t result, *stat; + int off; + + sc_if = (struct msk_if_softc *)arg1; + sc = sc_if->msk_softc; + off = arg2; + stat = (uint64_t *)((uint8_t *)&sc_if->msk_stats + off); + + MSK_IF_LOCK(sc_if); + result = MSK_READ_MIB64(sc_if->msk_port, GM_MIB_CNT_BASE + off * 2); + result += *stat; + MSK_IF_UNLOCK(sc_if); + + return (sysctl_handle_quad(oidp, &result, 0, req)); +} + +#undef MSK_READ_MIB32 +#undef MSK_READ_MIB64 + +#define MSK_SYSCTL_STAT32(sc, c, o, p, n, d) \ + SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_UINT | CTLFLAG_RD, \ + sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat32, \ + "IU", d) +#define MSK_SYSCTL_STAT64(sc, c, o, p, n, d) \ + SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_UINT | CTLFLAG_RD, \ + sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat64, \ + "Q", d) + +static void +msk_sysctl_node(struct msk_if_softc *sc_if) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *schild; + struct sysctl_oid *tree; + + ctx = device_get_sysctl_ctx(sc_if->msk_if_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc_if->msk_if_dev)); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "MSK Statistics"); + schild = child = SYSCTL_CHILDREN(tree); + tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "MSK RX Statistics"); + child = SYSCTL_CHILDREN(tree); + MSK_SYSCTL_STAT32(sc_if, ctx, "ucast_frames", + child, rx_ucast_frames, "Good unicast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "bcast_frames", + child, rx_bcast_frames, "Good broadcast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "pause_frames", + child, rx_pause_frames, "Pause frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "mcast_frames", + child, rx_mcast_frames, "Multicast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "crc_errs", + child, rx_crc_errs, "CRC errors"); + MSK_SYSCTL_STAT64(sc_if, ctx, "good_octets", + child, rx_good_octets, "Good octets"); + MSK_SYSCTL_STAT64(sc_if, ctx, "bad_octets", + child, rx_bad_octets, "Bad octets"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_64", + child, rx_pkts_64, "64 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_65_127", + child, rx_pkts_65_127, "65 to 127 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_128_255", + child, rx_pkts_128_255, "128 to 255 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_256_511", + child, rx_pkts_256_511, "256 to 511 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_512_1023", + child, rx_pkts_512_1023, "512 to 1023 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_1024_1518", + child, rx_pkts_1024_1518, "1024 to 1518 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_1519_max", + child, rx_pkts_1519_max, "1519 to max frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_too_long", + child, rx_pkts_too_long, "frames too long"); + MSK_SYSCTL_STAT32(sc_if, ctx, "jabbers", + child, rx_pkts_jabbers, "Jabber errors"); + MSK_SYSCTL_STAT32(sc_if, ctx, "jabbers", + child, rx_fifo_oflows, "FIFO overflows"); + + tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "MSK TX Statistics"); + child = SYSCTL_CHILDREN(tree); + MSK_SYSCTL_STAT32(sc_if, ctx, "ucast_frames", + child, tx_ucast_frames, "Unicast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "bcast_frames", + child, tx_bcast_frames, "Broadcast frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "pause_frames", + child, tx_pause_frames, "Pause frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "mcast_frames", + child, tx_mcast_frames, "Multicast frames"); + MSK_SYSCTL_STAT64(sc_if, ctx, "octets", + child, tx_octets, "Octets"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_64", + child, tx_pkts_64, "64 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_65_127", + child, tx_pkts_65_127, "65 to 127 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_128_255", + child, tx_pkts_128_255, "128 to 255 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_256_511", + child, tx_pkts_256_511, "256 to 511 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_512_1023", + child, tx_pkts_512_1023, "512 to 1023 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_1024_1518", + child, tx_pkts_1024_1518, "1024 to 1518 bytes frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "frames_1519_max", + child, tx_pkts_1519_max, "1519 to max frames"); + MSK_SYSCTL_STAT32(sc_if, ctx, "colls", + child, tx_colls, "Collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "late_colls", + child, tx_late_colls, "Late collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "excess_colls", + child, tx_excess_colls, "Excessive collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "multi_colls", + child, tx_multi_colls, "Multiple collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "single_colls", + child, tx_single_colls, "Single collisions"); + MSK_SYSCTL_STAT32(sc_if, ctx, "underflows", + child, tx_underflows, "FIFO underflows"); +} + +#undef MSK_SYSCTL_STAT32 +#undef MSK_SYSCTL_STAT64 + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Fri Jan 16 05:32:56 2009 (r187324) +++ head/sys/dev/msk/if_mskreg.h Fri Jan 16 08:06:55 2009 (r187325) @@ -1614,6 +1614,8 @@ (GM_MIB_CNT_BASE + 24) /* Multicast Frames Received OK */ #define GM_RXF_FCS_ERR \ (GM_MIB_CNT_BASE + 32) /* Rx Frame Check Seq. Error */ +#define GM_RXF_SPARE1 \ + (GM_MIB_CNT_BASE + 40) /* Rx spare 1 */ #define GM_RXO_OK_LO \ (GM_MIB_CNT_BASE + 48) /* Octets Received OK Low */ #define GM_RXO_OK_HI \ @@ -1644,8 +1646,12 @@ (GM_MIB_CNT_BASE + 152) /* Rx Frame too Long Error */ #define GM_RXF_JAB_PKT \ (GM_MIB_CNT_BASE + 160) /* Rx Jabber Packet Frame */ +#define GM_RXF_SPARE2 \ + (GM_MIB_CNT_BASE + 168) /* Rx spare 2 */ #define GM_RXE_FIFO_OV \ (GM_MIB_CNT_BASE + 176) /* Rx FIFO overflow Event */ +#define GM_RXF_SPARE3 \ + (GM_MIB_CNT_BASE + 184) /* Rx spare 3 */ #define GM_TXF_UC_OK \ (GM_MIB_CNT_BASE + 192) /* Unicast Frames Xmitted OK */ #define GM_TXF_BC_OK \ @@ -1672,6 +1678,8 @@ (GM_MIB_CNT_BASE + 280) /* 1024-1518 Byte Tx Frame */ #define GM_TXF_MAX_SZ \ (GM_MIB_CNT_BASE + 288) /* 1519-MaxSize Byte Tx Frame */ +#define GM_TXF_SPARE1 \ + (GM_MIB_CNT_BASE + 296) /* Tx spare 1 */ #define GM_TXF_COL \ (GM_MIB_CNT_BASE + 304) /* Tx Collision */ #define GM_TXF_LAT_COL \ @@ -2270,6 +2278,52 @@ struct msk_ring_data { /* Forward decl. */ struct msk_if_softc; +struct msk_hw_stats { + /* Rx stats. */ + uint32_t rx_ucast_frames; + uint32_t rx_bcast_frames; + uint32_t rx_pause_frames; + uint32_t rx_mcast_frames; + uint32_t rx_crc_errs; + uint32_t rx_spare1; + uint64_t rx_good_octets; + uint64_t rx_bad_octets; + uint32_t rx_runts; + uint32_t rx_runt_errs; + uint32_t rx_pkts_64; + uint32_t rx_pkts_65_127; + uint32_t rx_pkts_128_255; + uint32_t rx_pkts_256_511; + uint32_t rx_pkts_512_1023; + uint32_t rx_pkts_1024_1518; + uint32_t rx_pkts_1519_max; + uint32_t rx_pkts_too_long; + uint32_t rx_pkts_jabbers; + uint32_t rx_spare2; + uint32_t rx_fifo_oflows; + uint32_t rx_spare3; + /* Tx stats. */ + uint32_t tx_ucast_frames; + uint32_t tx_bcast_frames; + uint32_t tx_pause_frames; + uint32_t tx_mcast_frames; + uint64_t tx_octets; + uint32_t tx_pkts_64; + uint32_t tx_pkts_65_127; + uint32_t tx_pkts_128_255; + uint32_t tx_pkts_256_511; + uint32_t tx_pkts_512_1023; + uint32_t tx_pkts_1024_1518; + uint32_t tx_pkts_1519_max; + uint32_t tx_spare1; + uint32_t tx_colls; + uint32_t tx_late_colls; + uint32_t tx_excess_colls; + uint32_t tx_multi_colls; + uint32_t tx_single_colls; + uint32_t tx_underflows; +}; + /* Softc for the Marvell Yukon II controller. */ struct msk_softc { struct resource *msk_res[1]; /* I/O resource */ @@ -2340,6 +2394,7 @@ struct msk_if_softc { struct msk_chain_data msk_cdata; struct msk_ring_data msk_rdata; struct msk_softc *msk_softc; /* parent controller */ + struct msk_hw_stats msk_stats; struct task msk_link_task; struct task msk_tx_task; int msk_if_flags; From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 08:21:47 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA521065670 for ; Fri, 16 Jan 2009 08:21:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8328FC1A for ; Fri, 16 Jan 2009 08:21:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 1EBAE8FC53 for ; Fri, 16 Jan 2009 11:21:46 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id 3790E8FC18; Fri, 16 Jan 2009 11:21:42 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id E8DF63996C; Fri, 16 Jan 2009 11:21:43 +0300 (MSK) Date: Fri, 16 Jan 2009 11:21:39 +0300 From: Stanislav Sedov To: "M. Warner Losh" Message-Id: <20090116112139.fd8f0c4a.stas@FreeBSD.org> In-Reply-To: <20090115.175500.692488694.imp@bsdimp.com> References: <20090115114407.GA67726@FreeBSD.org> <496F24D8.2040104@gmx.de> <496FC32F.3040104@FreeBSD.org> <20090115.175500.692488694.imp@bsdimp.com> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Fri Jan 16 11:21:45 2009 X-DSPAM-Confidence: 1.0000 X-DSPAM-Improbability: 1 in 98689409 chance of being spam X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 49704399967005350815758 Cc: sobomax@FreeBSD.org, danfe@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, gonzo@FreeBSD.org, svn-src-head@FreeBSD.org, christoph.mallon@gmx.de Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 08:21:47 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 15 Jan 2009 17:55:00 -0700 (MST) "M. Warner Losh" mentioned: > In message: <496FC32F.3040104@FreeBSD.org> > Maxim Sobolev writes: > : Christoph Mallon wrote: > : > Alexey Dokuchaev schrieb: > : >> On Wed, Jan 14, 2009 at 07:05:27PM -0700, M. Warner Losh wrote: > : >>> In message: <20090115020752.52566769.stas@FreeBSD.org> > : >>> Stanislav Sedov writes: > : >>> : > + shift = 8 * (reg & 3); > : >>> : > : : Would it make sense to replace this with > : >>> : > + shift = (reg & 3) << 3; > : >>> : : to not rely on possible compiler optimizations? > : >>> > : >>> I don't think that it matters all that much these days... > : >> > : >> But the name "shift" kinda suggests << instead of *, no? > : > > : > The value *is* a shift amount (see its uses a few lines down). Its name > : > does not imply the way it is calculated, but what it is used for. > : > > : > BTW: Even the most cheap compilers emit shift instructions for > : > multiplication by a power of two. The new code also is clearly faster > : > then the old - quite some code gets generated for switches. > : > : I believe Warner's point is that the code is not in the hot path, so > : that it should not really matter either way. > > The code is clear the way it is, there's little reason to > hyper-optimize this path in the face of bogus compiler optimizations > or not, and the effort to optimize the hot-path should be aided by > dtrace or kernel profiling rather than reading the code. > Heh, that was just a suggestion, as the author decided to optimize the code anyway.:-) Of course, this optimization doesn't matter here much. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAklwQ5cACgkQK/VZk+smlYH9xQCffKoCymcGgyBUKBT2HHi4jLiM L3IAn2QNrh3FsdQGMdD1H6rKMmc7YhzE =qfKk -----END PGP SIGNATURE----- !DSPAM:49704399967005350815758! From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 08:30:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9687F1065693; Fri, 16 Jan 2009 08:30:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84D268FC25; Fri, 16 Jan 2009 08:30:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0G8UMVQ000781; Fri, 16 Jan 2009 08:30:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0G8UMBp000779; Fri, 16 Jan 2009 08:30:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901160830.n0G8UMBp000779@svn.freebsd.org> From: Warner Losh Date: Fri, 16 Jan 2009 08:30:22 +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: r187326 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 08:30:23 -0000 Author: imp Date: Fri Jan 16 08:30:22 2009 New Revision: 187326 URL: http://svn.freebsd.org/changeset/base/187326 Log: Remove unused variable. Minor style nits. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Fri Jan 16 08:06:55 2009 (r187325) +++ head/sys/mips/mips/machdep.c Fri Jan 16 08:30:22 2009 (r187326) @@ -218,8 +218,10 @@ cpu_halt(void) ; } -#ifdef PORT_TO_JMIPS +SYSCTL_STRUCT(_machdep, CPU_BOOTINFO, bootinfo, CTLFLAG_RD, &bootinfo, + bootinfo, "Bootinfo struct: kernel filename, BIOS harddisk geometry, etc"); +#ifdef PORT_TO_JMIPS static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS) { @@ -228,19 +230,8 @@ sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ SYSCTL_PROC(_machdep, CPU_ADJKERNTZ, adjkerntz, CTLTYPE_INT | CTLFLAG_RW, &adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "Local offset from GMT in seconds"); -#endif /* PORT_TO_JMIPS */ - -#ifdef PORT_TO_JMIPS -/* art */ SYSCTL_INT(_machdep, CPU_DISRTCSET, disable_rtc_set, CTLFLAG_RW, &disable_rtc_set, 0, "Disable setting the real time clock to system time"); -#endif /* PORT_TO_JMIPS */ - -SYSCTL_STRUCT(_machdep, CPU_BOOTINFO, bootinfo, CTLFLAG_RD, &bootinfo, - bootinfo, "Bootinfo struct: kernel filename, BIOS harddisk geometry, etc"); - -#ifdef PORT_TO_JMIPS -/* dchu */ SYSCTL_INT(_machdep, CPU_WALLCLOCK, wall_cmos_clock, CTLFLAG_RW, &wall_cmos_clock, 0, "Wall CMOS clock assumed"); #endif /* PORT_TO_JMIPS */ @@ -248,7 +239,6 @@ SYSCTL_INT(_machdep, CPU_WALLCLOCK, wall /* * Initialize mips and configure to run kernel */ - void mips_proc0_init(void) { @@ -273,6 +263,7 @@ mips_proc0_init(void) thread0.td_pcb = (struct pcb *)(thread0.td_md.md_realstack + (thread0.td_kstack_pages - 1) * PAGE_SIZE) - 1; thread0.td_frame = &thread0.td_pcb->pcb_regs; + /* * There is no need to initialize md_upte array for thread0 as it's * located in .bss section and should be explicitly zeroed during @@ -370,7 +361,6 @@ set_dbregs(struct thread *td, struct dbr return (ENOSYS); } -int spinco; void spinlock_enter(void) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 08:38:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02FA61065674; Fri, 16 Jan 2009 08:38:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5FC78FC21; Fri, 16 Jan 2009 08:38:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0G8c3iw000970; Fri, 16 Jan 2009 08:38:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0G8c3si000969; Fri, 16 Jan 2009 08:38:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200901160838.n0G8c3si000969@svn.freebsd.org> From: Warner Losh Date: Fri, 16 Jan 2009 08:38:03 +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: r187327 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 08:38:04 -0000 Author: imp Date: Fri Jan 16 08:38:03 2009 New Revision: 187327 URL: http://svn.freebsd.org/changeset/base/187327 Log: Eliminate the PMAP_INLINE macro. It isn't really used here. If we need to bring it back, we can. Modified: head/sys/mips/include/pmap.h Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Fri Jan 16 08:30:22 2009 (r187326) +++ head/sys/mips/include/pmap.h Fri Jan 16 08:38:03 2009 (r187327) @@ -143,12 +143,6 @@ typedef struct pv_entry { #define PMAP_DIAGNOSTIC #endif -#if !defined(PMAP_DIAGNOSTIC) -#define PMAP_INLINE __inline -#else -#define PMAP_INLINE -#endif - extern vm_offset_t avail_end; extern vm_offset_t avail_start; extern vm_offset_t phys_avail[]; @@ -171,8 +165,8 @@ vm_offset_t pmap_steal_memory(vm_size_t void pmap_set_modified(vm_offset_t pa); int page_is_managed(vm_offset_t pa); void pmap_page_is_free(vm_page_t m); - /* PMAP_INLINE */ void pmap_kenter(vm_offset_t va, vm_paddr_t pa); - /* PMAP_INLINE */ void pmap_kremove(vm_offset_t va); +void pmap_kenter(vm_offset_t va, vm_paddr_t pa); +void pmap_kremove(vm_offset_t va); void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_temporary_free(vm_paddr_t pa); int pmap_compute_pages_to_dump(void); From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 09:01:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6D60106567B; Fri, 16 Jan 2009 09:01:45 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 953548FC16; Fri, 16 Jan 2009 09:01:45 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0G91jkb001432; Fri, 16 Jan 2009 09:01:45 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0G91j1T001431; Fri, 16 Jan 2009 09:01:45 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200901160901.n0G91j1T001431@svn.freebsd.org> From: Qing Li Date: Fri, 16 Jan 2009 09:01: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: r187328 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 09:01:46 -0000 Author: qingli Date: Fri Jan 16 09:01:45 2009 New Revision: 187328 URL: http://svn.freebsd.org/changeset/base/187328 Log: The RTF_LLINFO was revived unconditionally, but within the kernel the check on the sysctl argument value being RTF_LLINFO is conditioned on the COMPAT_ROUTE_FLAGS kernel option. This mismatch caused the L2 table retrieval failure, and the arp/ndp -an command displays empty L2 tables. Reviewed by: pjd Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Fri Jan 16 08:38:03 2009 (r187327) +++ head/sys/net/rtsock.c Fri Jan 16 09:01:45 2009 (r187328) @@ -1448,11 +1448,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) * specify an AF */ if (w.w_op == NET_RT_FLAGS && -#if defined(COMPAT_ROUTE_FLAGS) - (w.w_arg & RTF_LLINFO)) { -#else - w.w_arg == 0) { -#endif + (w.w_arg == 0 || w.w_arg & RTF_LLINFO)) { if (af != 0) error = lltable_sysctl_dumparp(af, w.w_req); else From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 10:08:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C5EE106566B; Fri, 16 Jan 2009 10:08:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id A38218FC0A; Fri, 16 Jan 2009 10:08:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LNlcb-0008Np-Dy; Fri, 16 Jan 2009 12:08:13 +0200 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 n0GA7xnd082145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Jan 2009 12:08:00 +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.3/8.14.3) with ESMTP id n0GA7x3M049954; Fri, 16 Jan 2009 12:07:59 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n0GA7x3k049953; Fri, 16 Jan 2009 12:07:59 +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: Fri, 16 Jan 2009 12:07:59 +0200 From: Kostik Belousov To: Xin LI Message-ID: <20090116100759.GI48057@deviant.kiev.zoral.com.ua> References: <200901152241.n0FMfmem089446@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CNK/L7dwKXQ4Ub8J" Content-Disposition: inline In-Reply-To: <200901152241.n0FMfmem089446@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LNlcb-0008Np-Dy 017b58f1351dfad92b7b1369e301649d X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187318 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 10:08:15 -0000 --CNK/L7dwKXQ4Ub8J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 15, 2009 at 10:41:48PM +0000, Xin LI wrote: > Author: delphij > Date: Thu Jan 15 22:41:48 2009 > New Revision: 187318 > URL: http://svn.freebsd.org/changeset/base/187318 >=20 > Log: > Reflect newly added PCI IDs to bce(4). We still experience the packet corruption with the latest bce driver from stable/7, usually manifesting itself in ssh session breaking. Reverting the driver to releng/7.1 helps. Are there any plans to fix the driver ? bce0@pci0:3:0:0: class=3D0x020000 card=3D0x01b21028 chip=3D0x164c14e4 rev= =3D0x12 hdr=3D0x00 bce1@pci0:7:0:0: class=3D0x020000 card=3D0x01b21028 chip=3D0x164c14e4 rev= =3D0x12 hdr=3D0x00 These are Dell PE 2950. --CNK/L7dwKXQ4Ub8J Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAklwXH8ACgkQC3+MBN1Mb4hergCdF3s2bv6dxbVrIFu3pmf0m1ZV P74AoIJ5DBzN9Je6fsLZ01WNquHQ7/ns =cGVT -----END PGP SIGNATURE----- --CNK/L7dwKXQ4Ub8J-- From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 11:14:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A80A91065670; Fri, 16 Jan 2009 11:14:29 +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 95D358FC29; Fri, 16 Jan 2009 11:14:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GBETqC006817; Fri, 16 Jan 2009 11:14:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GBETin006816; Fri, 16 Jan 2009 11:14:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901161114.n0GBETin006816@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 16 Jan 2009 11:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187329 - in stable/7/lib/libc: . string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 11:14:30 -0000 Author: kib Date: Fri Jan 16 11:14:29 2009 New Revision: 187329 URL: http://svn.freebsd.org/changeset/base/187329 Log: MFC r187147: Document that ffsll(3) and flsll(3) functions first appeared in FreeBSD 7.1. Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/string/ffs.3 stable/7/lib/libc/string/ffsll.c (props changed) stable/7/lib/libc/string/flsll.c (props changed) Modified: stable/7/lib/libc/string/ffs.3 ============================================================================== --- stable/7/lib/libc/string/ffs.3 Fri Jan 16 09:01:45 2009 (r187328) +++ stable/7/lib/libc/string/ffs.3 Fri Jan 16 11:14:29 2009 (r187329) @@ -108,4 +108,4 @@ The and .Fn flsll functions appeared in -.Fx 8.0 . +.Fx 7.1 . From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 14:45:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15EED106564A; Fri, 16 Jan 2009 14:45:49 +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 DED8C8FC19; Fri, 16 Jan 2009 14:45:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GEjm4d010882; Fri, 16 Jan 2009 14:45:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GEjmC6010881; Fri, 16 Jan 2009 14:45:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901161445.n0GEjmC6010881@svn.freebsd.org> From: Ed Schouten Date: Fri, 16 Jan 2009 14:45: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: r187330 - head/sys/dev/digi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 14:45:49 -0000 Author: ed Date: Fri Jan 16 14:45:48 2009 New Revision: 187330 URL: http://svn.freebsd.org/changeset/base/187330 Log: Remove unused files from the digi(4) driver. The digi(4) driver directory contains some files that cannot be checked out on Windows filesystems. This isn't a big deal, but the files aren't used anyway. There are still some other places where checkouts on Windows don't work, such as VFS_MOUNT.9/vfs_mount.9. This should already be a small improvement. MFC after: 1 month Deleted: head/sys/dev/digi/con.CX-IBM.h head/sys/dev/digi/con.CX.h head/sys/dev/digi/con.EPCX.h head/sys/dev/digi/con.MBank.h From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 15:00:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB91810656BF; Fri, 16 Jan 2009 15:00:30 +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 993618FC16; Fri, 16 Jan 2009 15:00:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GF0U38011173; Fri, 16 Jan 2009 15:00:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GF0UD8011171; Fri, 16 Jan 2009 15:00:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901161500.n0GF0UD8011171@svn.freebsd.org> From: Ed Schouten Date: Fri, 16 Jan 2009 15:00:30 +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: r187331 - head/usr.bin/mail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 15:00:31 -0000 Author: ed Date: Fri Jan 16 15:00:30 2009 New Revision: 187331 URL: http://svn.freebsd.org/changeset/base/187331 Log: Rename mail(1)'s aux.c to util.c. The name `aux' is reserved on Windows file systems. aux.c in the mail(1) directory contains some random utility functions. I'm renaming this file to util.c to make it possible to check out this directory on Windows. MFC after: 1 month Added: head/usr.bin/mail/util.c - copied unchanged from r187330, head/usr.bin/mail/aux.c Deleted: head/usr.bin/mail/aux.c Modified: head/usr.bin/mail/Makefile Modified: head/usr.bin/mail/Makefile ============================================================================== --- head/usr.bin/mail/Makefile Fri Jan 16 14:45:48 2009 (r187330) +++ head/usr.bin/mail/Makefile Fri Jan 16 15:00:30 2009 (r187331) @@ -2,9 +2,9 @@ # $FreeBSD$ PROG= mail -SRCS= version.c aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \ +SRCS= version.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \ getname.c head.c v7.local.c lex.c list.c main.c names.c popen.c \ - quit.c send.c strings.c temp.c tty.c vars.c + quit.c send.c strings.c temp.c tty.c util.c vars.c FILES= mail.help mail.tildehelp FILESDIR= ${SHAREDIR}/misc EFILES= mail.rc Copied: head/usr.bin/mail/util.c (from r187330, head/usr.bin/mail/aux.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mail/util.c Fri Jan 16 15:00:30 2009 (r187331, copy of r187330, head/usr.bin/mail/aux.c) @@ -0,0 +1,632 @@ +/* + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef lint +#if 0 +static char sccsid[] = "@(#)aux.c 8.1 (Berkeley) 6/6/93"; +#endif +#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "rcv.h" +#include "extern.h" + +/* + * Mail -- a mail program + * + * Auxiliary functions. + */ + +static char *save2str(char *, char *); + +/* + * Return a pointer to a dynamic copy of the argument. + */ +char * +savestr(str) + char *str; +{ + char *new; + int size = strlen(str) + 1; + + if ((new = salloc(size)) != NULL) + bcopy(str, new, size); + return (new); +} + +/* + * Make a copy of new argument incorporating old one. + */ +static char * +save2str(str, old) + char *str, *old; +{ + char *new; + int newsize = strlen(str) + 1; + int oldsize = old ? strlen(old) + 1 : 0; + + if ((new = salloc(newsize + oldsize)) != NULL) { + if (oldsize) { + bcopy(old, new, oldsize); + new[oldsize - 1] = ' '; + } + bcopy(str, new + oldsize, newsize); + } + return (new); +} + +/* + * Touch the named message by setting its MTOUCH flag. + * Touched messages have the effect of not being sent + * back to the system mailbox on exit. + */ +void +touch(mp) + struct message *mp; +{ + + mp->m_flag |= MTOUCH; + if ((mp->m_flag & MREAD) == 0) + mp->m_flag |= MREAD|MSTATUS; +} + +/* + * Test to see if the passed file name is a directory. + * Return true if it is. + */ +int +isdir(name) + char name[]; +{ + struct stat sbuf; + + if (stat(name, &sbuf) < 0) + return (0); + return (S_ISDIR(sbuf.st_mode)); +} + +/* + * Count the number of arguments in the given string raw list. + */ +int +argcount(argv) + char **argv; +{ + char **ap; + + for (ap = argv; *ap++ != NULL;) + ; + return (ap - argv - 1); +} + +/* + * Return the desired header line from the passed message + * pointer (or NULL if the desired header field is not available). + */ +char * +hfield(field, mp) + const char *field; + struct message *mp; +{ + FILE *ibuf; + char linebuf[LINESIZE]; + int lc; + char *hfield; + char *colon, *oldhfield = NULL; + + ibuf = setinput(mp); + if ((lc = mp->m_lines - 1) < 0) + return (NULL); + if (readline(ibuf, linebuf, LINESIZE) < 0) + return (NULL); + while (lc > 0) { + if ((lc = gethfield(ibuf, linebuf, lc, &colon)) < 0) + return (oldhfield); + if ((hfield = ishfield(linebuf, colon, field)) != NULL) + oldhfield = save2str(hfield, oldhfield); + } + return (oldhfield); +} + +/* + * Return the next header field found in the given message. + * Return >= 0 if something found, < 0 elsewise. + * "colon" is set to point to the colon in the header. + * Must deal with \ continuations & other such fraud. + */ +int +gethfield(f, linebuf, rem, colon) + FILE *f; + char linebuf[]; + int rem; + char **colon; +{ + char line2[LINESIZE]; + char *cp, *cp2; + int c; + + for (;;) { + if (--rem < 0) + return (-1); + if ((c = readline(f, linebuf, LINESIZE)) <= 0) + return (-1); + for (cp = linebuf; isprint((unsigned char)*cp) && *cp != ' ' && *cp != ':'; + cp++) + ; + if (*cp != ':' || cp == linebuf) + continue; + /* + * I guess we got a headline. + * Handle wraparounding + */ + *colon = cp; + cp = linebuf + c; + for (;;) { + while (--cp >= linebuf && (*cp == ' ' || *cp == '\t')) + ; + cp++; + if (rem <= 0) + break; + ungetc(c = getc(f), f); + if (c != ' ' && c != '\t') + break; + if ((c = readline(f, line2, LINESIZE)) < 0) + break; + rem--; + for (cp2 = line2; *cp2 == ' ' || *cp2 == '\t'; cp2++) + ; + c -= cp2 - line2; + if (cp + c >= linebuf + LINESIZE - 2) + break; + *cp++ = ' '; + bcopy(cp2, cp, c); + cp += c; + } + *cp = 0; + return (rem); + } + /* NOTREACHED */ +} + +/* + * Check whether the passed line is a header line of + * the desired breed. Return the field body, or 0. + */ + +char* +ishfield(linebuf, colon, field) + char linebuf[]; + char *colon; + const char *field; +{ + char *cp = colon; + + *cp = 0; + if (strcasecmp(linebuf, field) != 0) { + *cp = ':'; + return (0); + } + *cp = ':'; + for (cp++; *cp == ' ' || *cp == '\t'; cp++) + ; + return (cp); +} + +/* + * Copy a string and lowercase the result. + * dsize: space left in buffer (including space for NULL) + */ +void +istrncpy(dest, src, dsize) + char *dest; + const char *src; + size_t dsize; +{ + + strlcpy(dest, src, dsize); + while (*dest) + *dest++ = tolower((unsigned char)*dest); +} + +/* + * The following code deals with input stacking to do source + * commands. All but the current file pointer are saved on + * the stack. + */ + +static int ssp; /* Top of file stack */ +struct sstack { + FILE *s_file; /* File we were in. */ + int s_cond; /* Saved state of conditionals */ + int s_loading; /* Loading .mailrc, etc. */ +}; +#define SSTACK_SIZE 64 /* XXX was NOFILE. */ +static struct sstack sstack[SSTACK_SIZE]; + +/* + * Pushdown current input file and switch to a new one. + * Set the global flag "sourcing" so that others will realize + * that they are no longer reading from a tty (in all probability). + */ +int +source(arglist) + char **arglist; +{ + FILE *fi; + char *cp; + + if ((cp = expand(*arglist)) == NULL) + return (1); + if ((fi = Fopen(cp, "r")) == NULL) { + warn("%s", cp); + return (1); + } + if (ssp >= SSTACK_SIZE - 1) { + printf("Too much \"sourcing\" going on.\n"); + (void)Fclose(fi); + return (1); + } + sstack[ssp].s_file = input; + sstack[ssp].s_cond = cond; + sstack[ssp].s_loading = loading; + ssp++; + loading = 0; + cond = CANY; + input = fi; + sourcing++; + return (0); +} + +/* + * Pop the current input back to the previous level. + * Update the "sourcing" flag as appropriate. + */ +int +unstack() +{ + if (ssp <= 0) { + printf("\"Source\" stack over-pop.\n"); + sourcing = 0; + return (1); + } + (void)Fclose(input); + if (cond != CANY) + printf("Unmatched \"if\"\n"); + ssp--; + cond = sstack[ssp].s_cond; + loading = sstack[ssp].s_loading; + input = sstack[ssp].s_file; + if (ssp == 0) + sourcing = loading; + return (0); +} + +/* + * Touch the indicated file. + * This is nifty for the shell. + */ +void +alter(name) + char *name; +{ + struct stat sb; + struct timeval tv[2]; + + if (stat(name, &sb)) + return; + (void)gettimeofday(&tv[0], (struct timezone *)NULL); + tv[0].tv_sec++; + TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtimespec); + (void)utimes(name, tv); +} + +/* + * Get sender's name from this message. If the message has + * a bunch of arpanet stuff in it, we may have to skin the name + * before returning it. + */ +char * +nameof(mp, reptype) + struct message *mp; + int reptype; +{ + char *cp, *cp2; + + cp = skin(name1(mp, reptype)); + if (reptype != 0 || charcount(cp, '!') < 2) + return (cp); + cp2 = strrchr(cp, '!'); + cp2--; + while (cp2 > cp && *cp2 != '!') + cp2--; + if (*cp2 == '!') + return (cp2 + 1); + return (cp); +} + +/* + * Start of a "comment". + * Ignore it. + */ +char * +skip_comment(cp) + char *cp; +{ + int nesting = 1; + + for (; nesting > 0 && *cp; cp++) { + switch (*cp) { + case '\\': + if (cp[1]) + cp++; + break; + case '(': + nesting++; + break; + case ')': + nesting--; + break; + } + } + return (cp); +} + +/* + * Skin an arpa net address according to the RFC 822 interpretation + * of "host-phrase." + */ +char * +skin(name) + char *name; +{ + char *nbuf, *bufend, *cp, *cp2; + int c, gotlt, lastsp; + + if (name == NULL) + return (NULL); + if (strchr(name, '(') == NULL && strchr(name, '<') == NULL + && strchr(name, ' ') == NULL) + return (name); + + /* We assume that length(input) <= length(output) */ + if ((nbuf = malloc(strlen(name) + 1)) == NULL) + err(1, "Out of memory"); + gotlt = 0; + lastsp = 0; + bufend = nbuf; + for (cp = name, cp2 = bufend; (c = *cp++) != '\0'; ) { + switch (c) { + case '(': + cp = skip_comment(cp); + lastsp = 0; + break; + + case '"': + /* + * Start of a "quoted-string". + * Copy it in its entirety. + */ + while ((c = *cp) != '\0') { + cp++; + if (c == '"') + break; + if (c != '\\') + *cp2++ = c; + else if ((c = *cp) != '\0') { + *cp2++ = c; + cp++; + } + } + lastsp = 0; + break; + + case ' ': + if (cp[0] == 'a' && cp[1] == 't' && cp[2] == ' ') + cp += 3, *cp2++ = '@'; + else + if (cp[0] == '@' && cp[1] == ' ') + cp += 2, *cp2++ = '@'; + else + lastsp = 1; + break; + + case '<': + cp2 = bufend; + gotlt++; + lastsp = 0; + break; + + case '>': + if (gotlt) { + gotlt = 0; + while ((c = *cp) != '\0' && c != ',') { + cp++; + if (c == '(') + cp = skip_comment(cp); + else if (c == '"') + while ((c = *cp) != '\0') { + cp++; + if (c == '"') + break; + if (c == '\\' && *cp != '\0') + cp++; + } + } + lastsp = 0; + break; + } + /* FALLTHROUGH */ + + default: + if (lastsp) { + lastsp = 0; + *cp2++ = ' '; + } + *cp2++ = c; + if (c == ',' && *cp == ' ' && !gotlt) { + *cp2++ = ' '; + while (*++cp == ' ') + ; + lastsp = 0; + bufend = cp2; + } + } + } + *cp2 = '\0'; + + if ((cp = realloc(nbuf, strlen(nbuf) + 1)) != NULL) + nbuf = cp; + return (nbuf); +} + +/* + * Fetch the sender's name from the passed message. + * Reptype can be + * 0 -- get sender's name for display purposes + * 1 -- get sender's name for reply + * 2 -- get sender's name for Reply + */ +char * +name1(mp, reptype) + struct message *mp; + int reptype; +{ + char namebuf[LINESIZE]; + char linebuf[LINESIZE]; + char *cp, *cp2; + FILE *ibuf; + int first = 1; + + if ((cp = hfield("from", mp)) != NULL) + return (cp); + if (reptype == 0 && (cp = hfield("sender", mp)) != NULL) + return (cp); + ibuf = setinput(mp); + namebuf[0] = '\0'; + if (readline(ibuf, linebuf, LINESIZE) < 0) + return (savestr(namebuf)); +newname: + for (cp = linebuf; *cp != '\0' && *cp != ' '; cp++) + ; + for (; *cp == ' ' || *cp == '\t'; cp++) + ; + for (cp2 = &namebuf[strlen(namebuf)]; + *cp != '\0' && *cp != ' ' && *cp != '\t' && + cp2 < namebuf + LINESIZE - 1;) + *cp2++ = *cp++; + *cp2 = '\0'; + if (readline(ibuf, linebuf, LINESIZE) < 0) + return (savestr(namebuf)); + if ((cp = strchr(linebuf, 'F')) == NULL) + return (savestr(namebuf)); + if (strncmp(cp, "From", 4) != 0) + return (savestr(namebuf)); + while ((cp = strchr(cp, 'r')) != NULL) { + if (strncmp(cp, "remote", 6) == 0) { + if ((cp = strchr(cp, 'f')) == NULL) + break; + if (strncmp(cp, "from", 4) != 0) + break; + if ((cp = strchr(cp, ' ')) == NULL) + break; + cp++; + if (first) { + cp2 = namebuf; + first = 0; + } else + cp2 = strrchr(namebuf, '!') + 1; + strlcpy(cp2, cp, sizeof(namebuf) - (cp2 - namebuf) - 1); + strcat(namebuf, "!"); + goto newname; + } + cp++; + } + return (savestr(namebuf)); +} + +/* + * Count the occurances of c in str + */ +int +charcount(str, c) + char *str; + int c; +{ + char *cp; + int i; + + for (i = 0, cp = str; *cp != '\0'; cp++) + if (*cp == c) + i++; + return (i); +} + +/* + * See if the given header field is supposed to be ignored. + */ +int +isign(field, ignore) + const char *field; + struct ignoretab ignore[2]; +{ + char realfld[LINESIZE]; + + if (ignore == ignoreall) + return (1); + /* + * Lower-case the string, so that "Status" and "status" + * will hash to the same place. + */ + istrncpy(realfld, field, sizeof(realfld)); + if (ignore[1].i_count > 0) + return (!member(realfld, ignore + 1)); + else + return (member(realfld, ignore)); +} + +int +member(realfield, table) + char *realfield; + struct ignoretab *table; +{ + struct ignore *igp; + + for (igp = table->i_head[hash(realfield)]; igp != NULL; igp = igp->i_link) + if (*igp->i_field == *realfield && + equal(igp->i_field, realfield)) + return (1); + return (0); +} From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 15:28:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F0A7106567A; Fri, 16 Jan 2009 15:28:40 +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 3CEA78FC1C; Fri, 16 Jan 2009 15:28:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 9F68146BB3; Fri, 16 Jan 2009 10:28:39 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0GFS4KM011368; Fri, 16 Jan 2009 10:28:33 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Max Laier Date: Fri, 16 Jan 2009 10:13:33 -0500 User-Agent: KMail/1.9.7 References: <200812161703.mBGH3M7m042955@svn.freebsd.org> <200901151659.35735.jhb@freebsd.org> <200901160044.18044.max@love2party.net> In-Reply-To: <200901160044.18044.max@love2party.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901161013.33898.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 16 Jan 2009 10:28:33 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8871/Thu Jan 15 23:16:59 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: src-committers@freebsd.org, Kip Macy , svn-src-all@freebsd.org, Attilio Rao , Robert Watson , svn-src-head@freebsd.org Subject: Re: svn commit: r186187 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 15:28:43 -0000 On Thursday 15 January 2009 6:44:17 pm Max Laier wrote: > Thank you for getting back to this ... > > On Thursday 15 January 2009 22:59:35 John Baldwin wrote: > > So the usual model would be to do something like this: > > > > LIST(foo, ) foo_list; > > > > foo_add(foo *p) > > { > > > > /* Construct foo, but don't lock it. */ > > WLOCK(foo_list); > > LIST_INSERT(foo_list, foo); > > WUNLOCK(foo_list); > > } > > > > foo * > > foo_find(int key) > > { > > foo *p; > > > > RLOCK(foo_list); > > LIST_FOREACH(p, foo_list) { > > if (p->key == key) { > > LOCK(p); > > RUNLOCK(foo_list); > > Is this allowed now? I was under the impression that it was bad for some > reason to interchange locks/unlocks like this. Something about WITNESS > getting confused and/or real lock order problems? I'm more than happy if > that's not the case. No, lock ordering only matters for obtaining a lock where you can block. It has always been safe to unlock in any order (well, before critical_enter/exit when the interrupt state was stored in spin mutexes (i.e. original BSD/OS code) you could not interlock spin mutex unlocks, but that was fixed long before 5.0). pfind() uses this model, for example. > > return (p); > > } > > } > > RUNLOCK(foo_list); > > return (NULL); > > } > > > > something_else() > > { > > foo *p; > > > > RLOCK(foo_list); > > LIST_FOREACH(p, foo_list) { > > LOCK(p); > > bar(p); > > UNLOCK(p); > > } > > RUNLOCK(foo_list); > > } > > > > From your description it would appear that you are doing something_else() > > but without actually locking foo_list. Unless you can demonstrate a clear > > win in benchmarks from not having the lock there, I would suggest just > > going with the simpler and more common approach. Depending on the mtx of > > the individual head doesn't do anything to solve races with removing the > > head from the list. > > The thing is that the list of pfil_heads is just a "configuration time" > construct. We really don't want to look at it in the hot path. Hence we > allow the caller of pfil_head_register() (foo_add) to hold on to its reference > of the pfil_head and work with it without requiring any interaction with the > lookup list. This, however, is not the problem at all. It's the > responsibility of the caller to ensure that it won't fiddle with the cached > reference after calling pfil_head_unregister(). I've read some more code now, I had thought pfil_head_register() == pfil_add_hook() for some reason. However, the locking is still not needed assuming you follow some simple rules. 1) Everyone uses pfil_head_get() to find a pfil head. In that case, the memory barries in the LIST_UNLOCK() are sufficient so long as the pfil head is fully constructed when the LIST_UNLOCK() is done. 2) The caller of pfil_head_register() may use it as well w/o using get. This is allowed because 'curthread' always has an up-to-date view of anything it has written. Put another way, the current CPU's cache is never stale with respect to any writes it has performed. The only thing I see missing in the pfil stuff is that there is no refcount or some such to drain hooks from a pfil_head during unregister. But it also seems that nothing actually calls pfil_head_unregister() currently, so that isn't but so worrisome. Does that answer your question? > > So, reading a bit further, I think the real fix is that the pfil API is a > > bit busted. What you really want to do is have pfil_get_head() operate > > like foo_find() and lock the head before dropping the list lock. That is > > the only race I see in the current code. However, because you malloc() > > after calling pfil_get_head() that is problematic. That is, the current > > consumer code looks like this: > > > > ph = pfil_get_head(x, y); > > > > pfil_add_hook(..., ph); /* calls malloc() */ > > > > I think you should change the API to be this instead: > > > > pfil_add_hook(..., x, y); > > > > and have pfil_get_head() do the lookup internally: > > > > pfil_add_hook() > > { > > > > malloc(...); > > > > ph = pfil_get_head(x, y); /* locks the 'ph' like foo_find() */ > > } > > This is a good idea/catch, but still not my initial problem. > > My real problem is what foo_remove() should look like in the scenario above. > > I assume that it should look something like this: > > foo_remove(int key) { > > WLOCK(foo_list); > LIST_FOREACH(p, foo_list) > if (p->key == key) { > LIST_REMOVE(p, entries); > > LOCK(p); /* <--- HERE */ > > WUNLOCK(foo_list); > /* free resources inside p */ > /* uninit lock */ > free(p); > return; > } > WUNLOCK(foo_list); So part of the key with this is the issue I mentioned above with pfil_head_unregister(). You have to solve the issue of outstanding references to 'p'. This may involve a refcount. Sometimes you do need the lock. When removing processes from zombproc in wait() we use the proc lock to block on p_lock until it goes to zero since other things that hold references to a process (ptrace, procfs, etc.) use PLOCK/PRELE. They are also required to do something like this: p = pfind(pid); /* returns locked */ if (p == NULL) return (ESRCH); if (p->p_state == PRS_ZOMBIE) { PROC_UNLOCK(p); return (ESRCH); } _PHOLD(p); PROC_UNLOCK(p); /* do stuff */ PRELE(p); However, whether or not you need the lock depends on your strategy for managing outside references to a device. Some items just use a simpler refcount model where foo_find() bumps the item's refcount, and removing the item from the list just drops a refcount. The item is only free'd when the last refcount goes away. If you did this for pfil_heads then each hook would hold a reference on the item as well. However, the current API does not lend itself well to this since you have to do another lookup to remove a pfil hook. If you returned a cookie (like bus_setup_intr()) then you could do something like this: pfil_register_head() { head = malloc(...); refcount_init(head->ref, 1); LIST_LOCK(); if (already_in_list) { free(head); head = existing; } else { insert(head); } pfil_ref_head(head); LIST_UNLOCK(); return (head); } pfil_get_hook() { LIST_LOCK(); LIST_FOREACH(...) if (found) { pfil_ref_head(p); LIST_UNLOCK(); return (p); } LIST_UNLOCK(); return (NULL); } /* caller must hold reference to hook */ pfil_add_hook(..., pfh, void **cookiep) { hook = malloc(...); PFH_LOCK(pfh); if (already_in_list or other error) { PFH_UNLOCK(pfh); free(hook); return (error); } hook->head = pfh; pfh_ref_head(pfh); /* hook has a ref */ /* insert in list */ PFH_UNLOCK(pfh); *cookiep = hook; } pfil_remove_hook(void *cookie) { hook = cookie; pfh = hook->pfh; PFH_LOCK(pfh); LIST_REMOVE(...); PFH_UNLOCK(pfh); free(hook); pfh_drop_head(pfh); } pfil_unregister_hook() { LIST_LOCK(); LIST_FOREACH() { if (found) { LIST_REMOVE(pfh); pfh_drop_head(pfh); } } } pfil_ref_head(pfh) { refcount_acquire(&pfh->ref); } pfil_ref_drop(pfh) { if (refcount_release(&pfh->ref)) { /* tear down state, destroy lock, etc. */ free(pfh); } } Then your code flow might look something like this (this doesn't change the pfil_add_hook API as I mentioned earlier btw): head owner: pfh = pfil_register_head(x, y); head owner wants to remove hook: pfil_unregister_head(pfh); /* * if there are active hooks, pfh still exists, but pfil_get_head() * won't find it anymore, so no new hooks, just in a zombie state * until all the old hooks go away. */ client module load: void *input_hook, *output_hook; pfh = pfil_get_head(x, y); /* holds a reference on pfh now */ pfil_add_hook(my_input_hook, IN, ..., pfh, &input_hook); pfil_add_hook(my_output_hook, OUT, ..., pfh, &output_hook); pfh_drop_head(pfh); /* release our reference */ client module unload: /* * note, pfil_get_head(x, y) may not work at this point if the head * has been unregistered. In that case, if these are the last two * hooks, then the second remove_hook will actually free the head * internally when it calls pfil_head_drop() */ pfil_remove_hook(input_hook); pfil_remove_hook(output_hook); In all of this you don't need to lock the pfil head in pfil_register_head() or pfil_unregister_head(). > Is there a reason why > we don't want to lock the element's lock while we initialize? While it is > safe if we always go through foo_find() before altering the element and thus > synchronize on the list lock, it seems bogus to rely on this (even though it > does make sense to go through foo_find() every time as I wrote earlier). Actually, for a true refcounting scheme to work correctly you _have_ to rely on this. The idea being that you can only gain a new reference while you hold an existing one. Specifically, holding the list lock guarantees that you can use the list's reference while you acquire your own private reference (e.g. for a new hook) without worrying about the 'guaranteeing' reference (the list's) being removed out from under you. file descriptors use this model for 'struct file', for example, where each file descriptor table holds a reference on the file and individual system calls hold a reference for the duration of their system call. For them the normal sequence is something like: error = fget(fdp, fd, &fp); if (error) return (error); /* 'fp' now holds a private reference */ /* use the file. */ fdrop(fp, td); -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 15:47:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7942F1065696; Fri, 16 Jan 2009 15:47:36 +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 672DD8FC2C; Fri, 16 Jan 2009 15:47:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GFlZ8M012010; Fri, 16 Jan 2009 15:47:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GFlZ4C012008; Fri, 16 Jan 2009 15:47:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901161547.n0GFlZ4C012008@svn.freebsd.org> From: Ed Schouten Date: Fri, 16 Jan 2009 15:47: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: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 15:47:37 -0000 Author: ed Date: Fri Jan 16 15:47:35 2009 New Revision: 187332 URL: http://svn.freebsd.org/changeset/base/187332 Log: Allow jot(1) regression tests to be checked out on Windows filesystems. The jot(1) regression tests directory contained two tests named `wx' and `wX', which doesn't work on case insensitive filesystems. Rename `wX' to `wX1'. MFC after: 1 month Added: head/tools/regression/usr.bin/jot/regress.wX1.out - copied unchanged from r187330, head/tools/regression/usr.bin/jot/regress.wX.out Deleted: head/tools/regression/usr.bin/jot/regress.wX.out Modified: head/tools/regression/usr.bin/jot/regress.sh Modified: head/tools/regression/usr.bin/jot/regress.sh ============================================================================== --- head/tools/regression/usr.bin/jot/regress.sh Fri Jan 16 15:00:30 2009 (r187331) +++ head/tools/regression/usr.bin/jot/regress.sh Fri Jan 16 15:47:35 2009 (r187332) @@ -49,7 +49,7 @@ REGRESSION_TEST(`wgd', `jot -w "a%gb" 10 REGRESSION_TEST(`wu', `jot -w "a%ub" 10') REGRESSION_TEST(`wo', `jot -w "a%ob" 10') REGRESSION_TEST(`wx', `jot -w "a%xb" 10') -REGRESSION_TEST(`wX', `jot -w "a%Xb" 10') +REGRESSION_TEST(`wX1', `jot -w "a%Xb" 10') REGRESSION_TEST(`wXl', `jot -w "a%Xb" 10 2147483648') REGRESSION_TEST(`wdl', `jot -w "a%db" 10 2147483648') REGRESSION_TEST(`wxn', `jot -w "a%xb" 10 -5') Copied: head/tools/regression/usr.bin/jot/regress.wX1.out (from r187330, head/tools/regression/usr.bin/jot/regress.wX.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/jot/regress.wX1.out Fri Jan 16 15:47:35 2009 (r187332, copy of r187330, head/tools/regression/usr.bin/jot/regress.wX.out) @@ -0,0 +1,10 @@ +a1b +a2b +a3b +a4b +a5b +a6b +a7b +a8b +a9b +aAb From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 18:00:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8935106564A; Fri, 16 Jan 2009 18:00:25 +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 D50498FC1B; Fri, 16 Jan 2009 18:00:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GI0PvH014547; Fri, 16 Jan 2009 18:00:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GI0Pvm014546; Fri, 16 Jan 2009 18:00:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901161800.n0GI0Pvm014546@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Jan 2009 18:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187333 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 18:00:26 -0000 Author: mav Date: Fri Jan 16 18:00:25 2009 New Revision: 187333 URL: http://svn.freebsd.org/changeset/base/187333 Log: MFC rev. 187154, 187196, 187202 Change configuration order to enable output only after codec is configured. Mute all mixer controllable amplifiers initially to let mixer to unmute only some of them later. This should reduce clicks and noises during boot. Improve AD1983 codec support: - force playback via mixer to get PCM volume control, - make cleanup on recoring source selection. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/sound/pci/hda/hdac.c Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Fri Jan 16 15:47:35 2009 (r187332) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Fri Jan 16 18:00:25 2009 (r187333) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090110_0123" +#define HDA_DRV_TEST_REV "20090113_0125" SND_DECLARE_FILE("$FreeBSD$"); @@ -4649,6 +4649,33 @@ hdac_vendor_patch_parse(struct hdac_devi * nid: 26 = Line-in, leave it alone. */ break; + case HDA_CODEC_AD1983: + /* + * This codec has several possible usages, but none + * fit the parser best. Help parser to choose better. + */ + /* Disable direct unmixed playback to get pcm volume. */ + w = hdac_widget_get(devinfo, 5); + if (w != NULL) + w->connsenable[0] = 0; + w = hdac_widget_get(devinfo, 6); + if (w != NULL) + w->connsenable[0] = 0; + w = hdac_widget_get(devinfo, 11); + if (w != NULL) + w->connsenable[0] = 0; + /* Disable mic and line selectors. */ + w = hdac_widget_get(devinfo, 12); + if (w != NULL) + w->connsenable[1] = 0; + w = hdac_widget_get(devinfo, 13); + if (w != NULL) + w->connsenable[1] = 0; + /* Disable recording from mono playback mix. */ + w = hdac_widget_get(devinfo, 20); + if (w != NULL) + w->connsenable[3] = 0; + break; case HDA_CODEC_AD1986A: /* * This codec has overcomplicated input mixing. @@ -6111,6 +6138,29 @@ hdac_audio_prepare_pin_ctrl(struct hdac_ } static void +hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) +{ + struct hdac_audio_ctl *ctl; + int i, z; + + i = 0; + while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { + if (ctl->enable == 0 || ctl->ossmask != 0) { + /* Mute disabled and mixer controllable controls. + * Last will be initialized by mixer_init(). + * This expected to reduce click on startup. */ + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); + continue; + } + /* Init fixed controls to 0dB amplification. */ + z = ctl->offset; + if (z > ctl->step) + z = ctl->step; + hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); + } +} + +static void hdac_audio_commit(struct hdac_devinfo *devinfo) { struct hdac_softc *sc = devinfo->codec->sc; @@ -6126,11 +6176,41 @@ hdac_audio_commit(struct hdac_devinfo *d hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, 0x7e7, 0), cad); + /* Commit controls. */ + hdac_audio_ctl_commit(devinfo); + + /* Commit selectors, pins and EAPD. */ + for (i = 0; i < devinfo->nodecnt; i++) { + w = &devinfo->widget[i]; + if (w == NULL) + continue; + if (w->selconn == -1) + w->selconn = 0; + if (w->nconns > 0) + hdac_widget_connection_select(w, w->selconn); + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + hdac_command(sc, + HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, + w->wclass.pin.ctrl), cad); + } + if (w->param.eapdbtl != HDAC_INVALID) { + uint32_t val; + + val = w->param.eapdbtl; + if (devinfo->function.audio.quirks & + HDA_QUIRK_EAPDINV) + val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; + hdac_command(sc, + HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, + val), cad); + } + } + + /* Commit GPIOs. */ gdata = 0; gmask = 0; gdir = 0; commitgpio = 0; - numgpio = HDA_PARAM_GPIO_COUNT_NUM_GPIO( devinfo->function.audio.gpio); @@ -6185,54 +6265,6 @@ hdac_audio_commit(struct hdac_devinfo *d HDA_CMD_SET_GPIO_DATA(cad, devinfo->nid, gdata), cad); } - - for (i = 0; i < devinfo->nodecnt; i++) { - w = &devinfo->widget[i]; - if (w == NULL) - continue; - if (w->selconn == -1) - w->selconn = 0; - if (w->nconns > 0) - hdac_widget_connection_select(w, w->selconn); - if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - hdac_command(sc, - HDA_CMD_SET_PIN_WIDGET_CTRL(cad, w->nid, - w->wclass.pin.ctrl), cad); - } - if (w->param.eapdbtl != HDAC_INVALID) { - uint32_t val; - - val = w->param.eapdbtl; - if (devinfo->function.audio.quirks & - HDA_QUIRK_EAPDINV) - val ^= HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD; - hdac_command(sc, - HDA_CMD_SET_EAPD_BTL_ENABLE(cad, w->nid, - val), cad); - - } - } -} - -static void -hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) -{ - struct hdac_audio_ctl *ctl; - int i, z; - - i = 0; - while ((ctl = hdac_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->enable == 0) { - /* Mute disabled controls. */ - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_ALL, 0, 0); - continue; - } - /* Init controls to 0dB amplification. */ - z = ctl->offset; - if (z > ctl->step) - z = ctl->step; - hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_NONE, z, z); - } } static void @@ -7477,10 +7509,6 @@ hdac_attach2(void *arg) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(sc->dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(sc->dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); @@ -7730,10 +7758,6 @@ hdac_resume(device_t dev) ); hdac_audio_commit(devinfo); HDA_BOOTHVERBOSE( - device_printf(dev, "Ctls commit...\n"); - ); - hdac_audio_ctl_commit(devinfo); - HDA_BOOTHVERBOSE( device_printf(dev, "HP switch init...\n"); ); hdac_hp_switch_init(devinfo); From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 18:09:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE95E1065688; Fri, 16 Jan 2009 18:09:49 +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 DC9398FC12; Fri, 16 Jan 2009 18:09:49 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GI9nhK014803; Fri, 16 Jan 2009 18:09:49 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GI9nkh014801; Fri, 16 Jan 2009 18:09:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200901161809.n0GI9nkh014801@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 16 Jan 2009 18:09: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: r187334 - head/tools/regression/fstest/tests X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 18:09:50 -0000 Author: pjd Date: Fri Jan 16 18:09:49 2009 New Revision: 187334 URL: http://svn.freebsd.org/changeset/base/187334 Log: Be more Solaris-friendly. Submitted by: Milan Cermak Modified: head/tools/regression/fstest/tests/conf head/tools/regression/fstest/tests/misc.sh Modified: head/tools/regression/fstest/tests/conf ============================================================================== --- head/tools/regression/fstest/tests/conf Fri Jan 16 18:00:25 2009 (r187333) +++ head/tools/regression/fstest/tests/conf Fri Jan 16 18:09:49 2009 (r187334) @@ -6,15 +6,19 @@ os=`uname` case "${os}" in FreeBSD|Darwin) + GREP=grep #fs=`df -T . | tail -1 | awk '{print $2}'` pattern="`df . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`" fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print $2}'` ;; -Solaris) - pattern="`df -k . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`" - fs=`mount -v | egrep "^${pattern}" | awk '{print $5}'` +Solaris|SunOS) + GREP=ggrep + pattern=`df -k . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'` + fs=`mount -v | egrep "^${pattern}" | awk '{print $5}' | \ + tr -s '[:lower:]' '[:upper:]'` ;; Linux) + GREP=grep fs=`df -PT . | tail -1 | awk '{print $2}'` ;; *) Modified: head/tools/regression/fstest/tests/misc.sh ============================================================================== --- head/tools/regression/fstest/tests/misc.sh Fri Jan 16 18:00:25 2009 (r187333) +++ head/tools/regression/fstest/tests/misc.sh Fri Jan 16 18:09:49 2009 (r187334) @@ -87,7 +87,7 @@ test_check() todo() { - echo "${os}" | grep -iq "${1}" + echo "${os}" | $GREP -iq "${1}" if [ $? -eq 0 ]; then todomsg="${2}" fi From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 19:28:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E90AB1065670; Fri, 16 Jan 2009 19:28:25 +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 BD4308FC19; Fri, 16 Jan 2009 19:28:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GJSPGK016435; Fri, 16 Jan 2009 19:28:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GJSP1F016434; Fri, 16 Jan 2009 19:28:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901161928.n0GJSP1F016434@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Jan 2009 19:28: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: r187339 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 19:28:26 -0000 Author: mav Date: Fri Jan 16 19:28:25 2009 New Revision: 187339 URL: http://svn.freebsd.org/changeset/base/187339 Log: Add some information in SYNOPSIS, HARDWARE and BUGS sections. Modified: head/share/man/man4/sdhci.4 Modified: head/share/man/man4/sdhci.4 ============================================================================== --- head/share/man/man4/sdhci.4 Fri Jan 16 19:02:08 2009 (r187338) +++ head/share/man/man4/sdhci.4 Fri Jan 16 19:28:25 2009 (r187339) @@ -24,16 +24,29 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2008 +.Dd January 14, 2009 .Dt SDHCI 4 .Os .Sh NAME .Nm sdhci .Nd PCI SD Host Controller bridge driver .Sh SYNOPSIS -.Cd device mmc -.Cd device mmcsd -.Cd device sdhci +To compile this driver into the kernel, place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device mmc" +.Cd "device mmcsd" +.Cd "device sdhci" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the +following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mmc_load="YES" +mmcsd_load="YES" +sdhci_load="YES" +.Ed .Sh DESCRIPTION The .Nm @@ -42,6 +55,22 @@ SD Host Controller Specification. Driver supports up to six high speed 4bit MMC/SD slots per controller. Driver attaches mmc bus to the respective slot on card insertion and detaches it on card removing. +.Sh HARDWARE +The +.Nm +driver supports different specification compatible chips. The following +chips have been verified to work: +.Pp +.Bl -bullet -compact +.It +ENE CB712 +.It +ENE CB714 +.It +RICOH R5C822 +.It +TI PCIXX21/XX11 +.El .Sh SEE ALSO .Xr mmc 4 , .Xr mmcsd 4 @@ -50,3 +79,8 @@ detaches it on card removing. .Re .Sh AUTHORS .An Alexander Motin Aq mav@FreeBSD.org . +.Sh BUGS +Many of existing SD controller chips have some nonstandard requirements, +proprietary registers and hardware bugs, requiring additional handling. +ENE chips are handled to work fine, while some revisions of RICOH and TI +controllers still don't see cards without some additional initialization. From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 19:31:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8626B1065672; Fri, 16 Jan 2009 19:31:28 +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 746538FC16; Fri, 16 Jan 2009 19:31:28 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GJVSmq016527; Fri, 16 Jan 2009 19:31:28 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GJVSU9016526; Fri, 16 Jan 2009 19:31:28 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200901161931.n0GJVSU9016526@svn.freebsd.org> From: Olivier Houchard Date: Fri, 16 Jan 2009 19:31: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: r187340 - head/sys/arm/xscale/i8134x X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 19:31:29 -0000 Author: cognet Date: Fri Jan 16 19:31:27 2009 New Revision: 187340 URL: http://svn.freebsd.org/changeset/base/187340 Log: Remove a duplicate #include. Modified: head/sys/arm/xscale/i8134x/i81342_mcu.c Modified: head/sys/arm/xscale/i8134x/i81342_mcu.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_mcu.c Fri Jan 16 19:28:25 2009 (r187339) +++ head/sys/arm/xscale/i8134x/i81342_mcu.c Fri Jan 16 19:31:27 2009 (r187340) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 19:43:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99A541065673; Fri, 16 Jan 2009 19:43:21 +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 87AF78FC1B; Fri, 16 Jan 2009 19:43:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GJhLcj016788; Fri, 16 Jan 2009 19:43:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GJhLZe016787; Fri, 16 Jan 2009 19:43:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200901161943.n0GJhLZe016787@svn.freebsd.org> From: Marius Strobl Date: Fri, 16 Jan 2009 19:43: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: r187341 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 19:43:22 -0000 Author: marius Date: Fri Jan 16 19:43:21 2009 New Revision: 187341 URL: http://svn.freebsd.org/changeset/base/187341 Log: Update URL. Modified: head/share/man/man4/hme.4 Modified: head/share/man/man4/hme.4 ============================================================================== --- head/share/man/man4/hme.4 Fri Jan 16 19:31:27 2009 (r187340) +++ head/share/man/man4/hme.4 Fri Jan 16 19:43:21 2009 (r187341) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2009 +.Dd January 16, 2009 .Dt HME 4 .Os .Sh NAME @@ -129,7 +129,7 @@ except the single-port SBus versions. .%T "STP2002QFP Fast Ethernet, Parallel Port, SCSI (FEPS) User's Guide" .%D April 1996 .%A Sun Microelectronics -.%O http://www.sun.com/oem/products/manuals/STP2002QFP-UG.pdf +.%O http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf .Re .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 20:38:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28A8A1065670; Fri, 16 Jan 2009 20:38:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F12338FC20; Fri, 16 Jan 2009 20:38:42 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GKcgE6017879; Fri, 16 Jan 2009 20:38:42 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GKcgx1017878; Fri, 16 Jan 2009 20:38:42 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901162038.n0GKcgx1017878@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 20:38:42 +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: r187342 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 20:38:43 -0000 Author: sam Date: Fri Jan 16 20:38:42 2009 New Revision: 187342 URL: http://svn.freebsd.org/changeset/base/187342 Log: Fix 1/2 and 1/4 width channel handling for non-GSM operation: o correct typo that caused random channel selection o explicitly add 1/2 and 1/4 width channels because channel lookups match flags that include IEEE80211_CHANNEL_HALF and IEEE80211_CHANNEL_QUARTER Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Jan 16 19:43:21 2009 (r187341) +++ head/sbin/ifconfig/ifieee80211.c Fri Jan 16 20:38:42 2009 (r187342) @@ -1806,7 +1806,7 @@ regdomain_addchans(struct ieee80211req_c continue; } if ((flags & IEEE80211_CHAN_QUARTER) && - ((chanFlags & IEEE80211_CHAN_HALF) == 0 && + ((chanFlags & IEEE80211_CHAN_QUARTER) == 0 && (flags & IEEE80211_CHAN_GSM) == 0)) { if (verbose) printf("%u: skip, device does not support quarter-rate channels\n", freq); @@ -1900,12 +1900,26 @@ regdomain_makechannels( if (!LIST_EMPTY(&rd->bands_11b)) regdomain_addchans(ci, &rd->bands_11b, reg, IEEE80211_CHAN_B, &dc->dc_chaninfo); - if (!LIST_EMPTY(&rd->bands_11g)) + if (!LIST_EMPTY(&rd->bands_11g)) { regdomain_addchans(ci, &rd->bands_11g, reg, IEEE80211_CHAN_G, &dc->dc_chaninfo); - if (!LIST_EMPTY(&rd->bands_11a)) + regdomain_addchans(ci, &rd->bands_11g, reg, + IEEE80211_CHAN_G | IEEE80211_CHAN_HALF, + &dc->dc_chaninfo); + regdomain_addchans(ci, &rd->bands_11g, reg, + IEEE80211_CHAN_G | IEEE80211_CHAN_QUARTER, + &dc->dc_chaninfo); + } + if (!LIST_EMPTY(&rd->bands_11a)) { regdomain_addchans(ci, &rd->bands_11a, reg, IEEE80211_CHAN_A, &dc->dc_chaninfo); + regdomain_addchans(ci, &rd->bands_11a, reg, + IEEE80211_CHAN_A | IEEE80211_CHAN_HALF, + &dc->dc_chaninfo); + regdomain_addchans(ci, &rd->bands_11a, reg, + IEEE80211_CHAN_A | IEEE80211_CHAN_QUARTER, + &dc->dc_chaninfo); + } if (!LIST_EMPTY(&rd->bands_11na)) { regdomain_addchans(ci, &rd->bands_11na, reg, IEEE80211_CHAN_A | IEEE80211_CHAN_HT20, From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 20:40:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D6971065674; Fri, 16 Jan 2009 20:40:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71EB78FC24; Fri, 16 Jan 2009 20:40:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GKeosK017955; Fri, 16 Jan 2009 20:40:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GKeo12017953; Fri, 16 Jan 2009 20:40:50 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901162040.n0GKeo12017953@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 20:40: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: r187343 - in head/etc: . devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 20:40:51 -0000 Author: sam Date: Fri Jan 16 20:40:50 2009 New Revision: 187343 URL: http://svn.freebsd.org/changeset/base/187343 Log: add FCC4 SKU to expose Public Safety Band (PSB) frequencies; this is modeled after the Atheros SKU of the same name Modified: head/etc/devd/Makefile head/etc/regdomain.xml Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Fri Jan 16 20:38:42 2009 (r187342) +++ head/etc/devd/Makefile Fri Jan 16 20:40:50 2009 (r187343) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= asus.conf +FILES= asus.conf uath.conf NO_OBJ= FILESDIR= /etc/devd Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jan 16 20:38:42 2009 (r187342) +++ head/etc/regdomain.xml Fri Jan 16 20:40:50 2009 (r187343) @@ -190,6 +190,55 @@ + + + + FCC4 + 0x12 + + + + 30 + IEEE80211_CHAN_B + + + + + + 30 + IEEE80211_CHAN_G + + + + + + 23 + + + + 27 + + + + 30 + + + + + + 30 + IEEE80211_CHAN_G + IEEE80211_CHAN_HT20 + + + + 30 + IEEE80211_CHAN_G + IEEE80211_CHAN_HT40 + + + + JAPAN 0x40 @@ -1515,6 +1564,23 @@ NB: keep sorted by starting frequency, legacy before HT --> + + 4942 4987 + 5 5 + IEEE80211_CHAN_A + IEEE80211_CHAN_QUARTER + + + 4945 4985 + 10 5 + IEEE80211_CHAN_A + IEEE80211_CHAN_HALF + + + 4950 4980 + 20 5 + IEEE80211_CHAN_A + 5120 5240 20 20 From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 20:42:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB9B9106567A; Fri, 16 Jan 2009 20:42:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B01DA8FC1A; Fri, 16 Jan 2009 20:42:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GKghHE018049; Fri, 16 Jan 2009 20:42:43 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GKghmX018048; Fri, 16 Jan 2009 20:42:43 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901162042.n0GKghmX018048@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 20:42: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: r187344 - head/etc/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 20:42:45 -0000 Author: sam Date: Fri Jan 16 20:42:43 2009 New Revision: 187344 URL: http://svn.freebsd.org/changeset/base/187344 Log: revert r187343 Modified: head/etc/devd/Makefile Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Fri Jan 16 20:40:50 2009 (r187343) +++ head/etc/devd/Makefile Fri Jan 16 20:42:43 2009 (r187344) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= asus.conf uath.conf +FILES= asus.conf NO_OBJ= FILESDIR= /etc/devd From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 20:44:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 417D9106564A; Fri, 16 Jan 2009 20:44:46 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 301B18FC12; Fri, 16 Jan 2009 20:44:46 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GKikbH018158; Fri, 16 Jan 2009 20:44:46 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GKikHx018157; Fri, 16 Jan 2009 20:44:46 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901162044.n0GKikHx018157@svn.freebsd.org> From: Sam Leffler Date: Fri, 16 Jan 2009 20:44: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: r187345 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 20:44:46 -0000 Author: sam Date: Fri Jan 16 20:44:45 2009 New Revision: 187345 URL: http://svn.freebsd.org/changeset/base/187345 Log: export PSB frequencies Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 20:42:43 2009 (r187344) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Fri Jan 16 20:44:45 2009 (r187345) @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_regdomain.c,v 1.24 2008/11/27 22:29:27 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -1231,9 +1231,18 @@ static REG_DOMAIN regDomains[] = { {.regDmnEnum = DEBUG_REG_DMN, .conformanceTestLimit = FCC, .dfsMask = DFS_FCC3, - .chan11a = BM3(F1_5120_5240, F1_5260_5700, F1_5745_5825), - .chan11a_half = BM3(F2_5120_5240, F2_5260_5700, F7_5745_5825), - .chan11a_quarter = BM3(F3_5120_5240, F3_5260_5700, F8_5745_5825), + .chan11a = BM4(F1_4950_4980, + F1_5120_5240, + F1_5260_5700, + F1_5745_5825), + .chan11a_half = BM4(F1_4945_4985, + F2_5120_5240, + F2_5260_5700, + F7_5745_5825), + .chan11a_quarter = BM4(F1_4942_4987, + F3_5120_5240, + F3_5260_5700, + F8_5745_5825), .chan11a_turbo = BM8(T1_5130_5210, T1_5250_5330, T1_5370_5490, From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 22:16:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A91410656FF; Fri, 16 Jan 2009 22:16:54 +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 795FC8FC0C; Fri, 16 Jan 2009 22:16:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GMGsYO020060; Fri, 16 Jan 2009 22:16:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GMGsWW020059; Fri, 16 Jan 2009 22:16:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901162216.n0GMGsWW020059@svn.freebsd.org> From: John Baldwin Date: Fri, 16 Jan 2009 22: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: r187347 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 22:16:55 -0000 Author: jhb Date: Fri Jan 16 22:16:54 2009 New Revision: 187347 URL: http://svn.freebsd.org/changeset/base/187347 Log: Correct the sense of the "use32" terenary operator so that it uses 'lib32' for 32-bit binaries on amd64 and 'lib' for 64-bit binaries. Remove an #ifdef __i386__ that defined use32 to the wrong value on i386 to workaround the bug in the terenary operator. MFC after: 1 month Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Fri Jan 16 20:51:03 2009 (r187346) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Fri Jan 16 22:16:54 2009 (r187347) @@ -1739,15 +1739,11 @@ dtrace_program_link(dtrace_hdl_t *dtp, d * Arches which are 32-bit only just use the normal * library path. */ -#if defined(__i386__) - int use_32 = 1; /* use /usr/lib/... -sson */ -#else int use_32 = 0; #endif -#endif (void) snprintf(drti, sizeof (drti), "/usr/lib%s/dtrace/drti.o", - use_32 ? "":"32"); + use_32 ? "32":""); len = snprintf(&tmp, 1, fmt, dtp->dt_ld_path, file, tfile, drti) + 1; From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 22:22:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B929106566B; Fri, 16 Jan 2009 22:22:30 +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 8B2048FC0C; Fri, 16 Jan 2009 22:22:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0GMMUoR020196; Fri, 16 Jan 2009 22:22:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0GMMUs1020195; Fri, 16 Jan 2009 22:22:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200901162222.n0GMMUs1020195@svn.freebsd.org> From: John Baldwin Date: Fri, 16 Jan 2009 22:22:30 +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: r187348 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 22:22:31 -0000 Author: jhb Date: Fri Jan 16 22:22:30 2009 New Revision: 187348 URL: http://svn.freebsd.org/changeset/base/187348 Log: Disable decoding of BARs by devices before we trash the value in the BAR by writing all 1's to it to determine its length. This fixes issues with MCFG on at least some machines where a trashed BAR claimed subsequent attempts at PCI config transactions because the addresses in the MCFG window fell in the decoding range of the BAR. In general it is a bad idea to leave the BARs enabled while we are frobbing with them in this manner. Sleuthing by: tegge MFC after: 1 week Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Jan 16 22:16:54 2009 (r187347) +++ head/sys/dev/pci/pci.c Fri Jan 16 22:22:30 2009 (r187348) @@ -2291,9 +2291,27 @@ pci_add_map(device_t pcib, device_t bus, struct resource *res; map = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4); + + /* + * Disable decoding via the command register before + * determining the BARs length since we will be placing them + * in a weird state. + */ + cmd = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_COMMAND, 2); + PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND, + cmd & ~(PCI_BAR_MEM(map) ? PCIM_CMD_MEMEN : PCIM_CMD_PORTEN), 2); + + /* + * Determine the BAR's length by writing all 1's. The bottom + * log_2(size) bits of the BAR will stick as 0 when we read + * the value back. + */ PCIB_WRITE_CONFIG(pcib, b, s, f, reg, 0xffffffff, 4); testval = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4); + + /* Restore the BAR and command register. */ PCIB_WRITE_CONFIG(pcib, b, s, f, reg, map, 4); + PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND, cmd, 2); if (PCI_BAR_MEM(map)) type = SYS_RES_MEMORY; From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 05:38:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AAB01065674; Sat, 17 Jan 2009 05:38:15 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F283A8FC18; Sat, 17 Jan 2009 05:38:14 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0H5cEWN028552; Sat, 17 Jan 2009 05:38:14 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0H5cEJZ028551; Sat, 17 Jan 2009 05:38:14 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901170538.n0H5cEJZ028551@svn.freebsd.org> From: David Schultz Date: Sat, 17 Jan 2009 05:38: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: r187354 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 05:38:15 -0000 Author: das Date: Sat Jan 17 05:38:14 2009 New Revision: 187354 URL: http://svn.freebsd.org/changeset/base/187354 Log: Simplify printf's inlined output buffering routines. On amd64, this reduces the code size by about 10% and improves performance slightly. Modified: head/lib/libc/stdio/printfcommon.h Modified: head/lib/libc/stdio/printfcommon.h ============================================================================== --- head/lib/libc/stdio/printfcommon.h Sat Jan 17 02:54:27 2009 (r187353) +++ head/lib/libc/stdio/printfcommon.h Sat Jan 17 05:38:14 2009 (r187354) @@ -64,14 +64,13 @@ struct io_state { FILE *fp; struct __suio uio; /* output information: summary */ struct __siov iov[NIOV];/* ... and individual io vectors */ - struct __siov *iovp; /* pointer to next free slot in iov */ }; static inline void io_init(struct io_state *iop, FILE *fp) { - iop->uio.uio_iov = iop->iovp = iop->iov; + iop->uio.uio_iov = iop->iov; iop->uio.uio_resid = 0; iop->uio.uio_iovcnt = 0; iop->fp = fp; @@ -85,15 +84,13 @@ static inline int io_print(struct io_state *iop, const CHAR * __restrict ptr, int len) { - iop->iovp->iov_base = (char *)ptr; - iop->iovp->iov_len = len; + iop->iov[iop->uio.uio_iovcnt].iov_base = (char *)ptr; + iop->iov[iop->uio.uio_iovcnt].iov_len = len; iop->uio.uio_resid += len; - iop->iovp++; - if (++iop->uio.uio_iovcnt >= NIOV) { - iop->iovp = iop->iov; + if (++iop->uio.uio_iovcnt >= NIOV) return (__sprint(iop->fp, &iop->uio)); - } - return (0); + else + return (0); } /* @@ -114,14 +111,14 @@ static const CHAR zeroes[PADSIZE] = static inline int io_pad(struct io_state *iop, int howmany, const CHAR * __restrict with) { + int n; - while (howmany > PADSIZE) { - if (io_print(iop, with, PADSIZE)) + while (howmany > 0) { + n = (howmany >= PADSIZE) ? PADSIZE : howmany; + if (io_print(iop, with, n)) return (-1); - howmany -= PADSIZE; + howmany -= n; } - if (howmany > 0 && io_print(iop, with, howmany)) - return (-1); return (0); } @@ -138,16 +135,19 @@ io_printandpad(struct io_state *iop, con p_len = ep - p; if (p_len > len) p_len = len; - if (p_len > 0 && io_print(iop, p, p_len)) - return (-1); - return (io_pad(iop, len - (p_len > 0 ? p_len : 0), with)); + if (p_len > 0) { + if (io_print(iop, p, p_len)) + return (-1); + } else { + p_len = 0; + } + return (io_pad(iop, len - p_len, with)); } static inline int io_flush(struct io_state *iop) { - iop->iovp = iop->iov; return (__sprint(iop->fp, &iop->uio)); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 06:53:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 599E7106564A; Sat, 17 Jan 2009 06:53:58 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BD1D8FC1C; Sat, 17 Jan 2009 06:53:58 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0H6rw7I029971; Sat, 17 Jan 2009 06:53:58 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0H6rw6k029970; Sat, 17 Jan 2009 06:53:58 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200901170653.n0H6rw6k029970@svn.freebsd.org> From: Mike Silbersack Date: Sat, 17 Jan 2009 06:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187355 - in stable/7/sys: . contrib/pf dev/acpica dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 06:53:59 -0000 Author: silby Date: Sat Jan 17 06:53:57 2009 New Revision: 187355 URL: http://svn.freebsd.org/changeset/base/187355 Log: Merge r186026 - add the debug.batt.batt_sleep_ms sysctl. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpica/acpi_smbat.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_smbat.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 05:38:14 2009 (r187354) +++ stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:53:57 2009 (r187355) @@ -61,6 +61,23 @@ static int acpi_smbat_get_bst(device_t d ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); +SYSCTL_DECL(_debug_acpi); +SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); + +/* On some laptops with smart batteries, enabling battery monitoring + * software causes keystrokes from atkbd to be lost. This has also been + * reported on Linux, and is apparently due to the keyboard and I2C line + * for the battery being routed through the same chip. Whether that's + * accurate or not, adding extra sleeps to the status checking code + * causes the problem to go away. + * + * If you experience that problem, try a value of 10ms and move up + * from there. + */ +static int batt_sleep_ms; +SYSCTL_INT(_debug_acpi_batt, OID_AUTO, batt_sleep_ms, CTLFLAG_RW, &batt_sleep_ms, 0, + "Sleep during battery status updates to prevent keystroke loss."); + static device_method_t acpi_smbat_methods[] = { /* device interface */ DEVMETHOD(device_probe, acpi_smbat_probe), @@ -176,6 +193,9 @@ acpi_smbus_read_2(struct acpi_smbat_soft ACPI_SERIAL_ASSERT(smbat); + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + val = addr; error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR, val, 1); @@ -194,6 +214,9 @@ acpi_smbus_read_2(struct acpi_smbat_soft if (error) goto out; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + for (to = SMBUS_TIMEOUT; to != 0; to--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL, &val, 1); @@ -239,6 +262,9 @@ acpi_smbus_read_multi_1(struct acpi_smba ACPI_SERIAL_ASSERT(smbat); + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + val = addr; error = ACPI_EC_WRITE(sc->ec_dev, sc->sb_base_addr + SMBUS_ADDR, val, 1); @@ -257,6 +283,9 @@ acpi_smbus_read_multi_1(struct acpi_smba if (error) goto out; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + for (to = SMBUS_TIMEOUT; to != 0; to--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_PRTCL, &val, 1); @@ -292,6 +321,9 @@ acpi_smbus_read_multi_1(struct acpi_smba if (len > val) len = val; + if (batt_sleep_ms) + AcpiOsSleep(batt_sleep_ms); + while (len--) { error = ACPI_EC_READ(sc->ec_dev, sc->sb_base_addr + SMBUS_DATA + len, &val, 1); @@ -299,6 +331,8 @@ acpi_smbus_read_multi_1(struct acpi_smba goto out; ptr[len] = val; + if (batt_sleep_ms) + AcpiOsSleep(1); } out: From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 06:55:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6954C106566B; Sat, 17 Jan 2009 06:55:28 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5664E8FC16; Sat, 17 Jan 2009 06:55:28 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0H6tSHi030079; Sat, 17 Jan 2009 06:55:28 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0H6tSAt030078; Sat, 17 Jan 2009 06:55:28 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <200901170655.n0H6tSAt030078@svn.freebsd.org> From: Mike Silbersack Date: Sat, 17 Jan 2009 06:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187356 - in stable/7/sys: . contrib/pf dev/acpica dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 06:55:29 -0000 Author: silby Date: Sat Jan 17 06:55:28 2009 New Revision: 187356 URL: http://svn.freebsd.org/changeset/base/187356 Log: Merge r186031 - quick change to r186026 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpica/acpi_smbat.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_smbat.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:53:57 2009 (r187355) +++ stable/7/sys/dev/acpica/acpi_smbat.c Sat Jan 17 06:55:28 2009 (r187356) @@ -332,7 +332,7 @@ acpi_smbus_read_multi_1(struct acpi_smba ptr[len] = val; if (batt_sleep_ms) - AcpiOsSleep(1); + AcpiOsSleep(batt_sleep_ms); } out: From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 07:17:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEFDD106564A; Sat, 17 Jan 2009 07:17:57 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB5B18FC18; Sat, 17 Jan 2009 07:17:57 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0H7HvOZ030553; Sat, 17 Jan 2009 07:17:57 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0H7HvX2030545; Sat, 17 Jan 2009 07:17:57 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200901170717.n0H7HvX2030545@svn.freebsd.org> From: Jeff Roberson Date: Sat, 17 Jan 2009 07:17: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: r187357 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 07:17:58 -0000 Author: jeff Date: Sat Jan 17 07:17:57 2009 New Revision: 187357 URL: http://svn.freebsd.org/changeset/base/187357 Log: - Implement generic macros for producing KTR records that are compatible with src/tools/sched/schedgraph.py. This allows developers to quickly create a graphical view of ktr data for any resource in the system. - Add sched_tdname() and the pcpu field 'name' for quickly and uniformly identifying records associated with a thread or cpu. - Reimplement the KTR_SCHED traces using the new generic facility. Obtained from: attilio Discussed with: jhb Sponsored by: Nokia Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_synch.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_pcpu.c head/sys/sys/ktr.h head/sys/sys/pcpu.h head/sys/sys/sched.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sat Jan 17 06:55:28 2009 (r187356) +++ head/sys/kern/kern_clock.c Sat Jan 17 07:17:57 2009 (r187357) @@ -498,8 +498,8 @@ statclock(int usermode) rss = pgtok(vmspace_resident_count(vm)); if (ru->ru_maxrss < rss) ru->ru_maxrss = rss; - CTR4(KTR_SCHED, "statclock: %p(%s) prio %d stathz %d", - td, td->td_name, td->td_priority, (stathz)?stathz:hz); + KTR_POINT2(KTR_SCHED, "thread", sched_tdname(td), "statclock", + "prio:%d", td->td_priority, "stathz:%d", (stathz)?stathz:hz); thread_lock_flags(td, MTX_QUIET); sched_clock(td); thread_unlock(td); Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sat Jan 17 06:55:28 2009 (r187356) +++ head/sys/kern/kern_synch.c Sat Jan 17 07:17:57 2009 (r187357) @@ -71,6 +71,13 @@ __FBSDID("$FreeBSD$"); #include #endif +#define KTDSTATE(td) \ + (((td)->td_inhibitors & TDI_SLEEPING) != 0 ? "sleep" : \ + ((td)->td_inhibitors & TDI_SUSPENDED) != 0 ? "suspended" : \ + ((td)->td_inhibitors & TDI_SWAPPED) != 0 ? "swapped" : \ + ((td)->td_inhibitors & TDI_LOCK) != 0 ? "blocked" : \ + ((td)->td_inhibitors & TDI_IWAIT) != 0 ? "iwait" : "yielding") + static void synch_setup(void *dummy); SYSINIT(synch_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, synch_setup, NULL); @@ -425,25 +432,19 @@ mi_switch(int flags, struct thread *newt td->td_tid, td->td_sched, p->p_pid, td->td_name); #if (KTR_COMPILE & KTR_SCHED) != 0 if (TD_IS_IDLETHREAD(td)) - CTR3(KTR_SCHED, "mi_switch: %p(%s) prio %d idle", - td, td->td_name, td->td_priority); - else if (newtd != NULL) - CTR5(KTR_SCHED, - "mi_switch: %p(%s) prio %d preempted by %p(%s)", - td, td->td_name, td->td_priority, newtd, - newtd->td_name); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", + "prio:%d", td->td_priority); else - CTR6(KTR_SCHED, - "mi_switch: %p(%s) prio %d inhibit %d wmesg %s lock %s", - td, td->td_name, td->td_priority, - td->td_inhibitors, td->td_wmesg, td->td_lockname); + KTR_STATE3(KTR_SCHED, "thread", sched_tdname(td), KTDSTATE(td), + "prio:%d", td->td_priority, "wmesg:\"%s\"", td->td_wmesg, + "lockname:\"%s\"", td->td_lockname); #endif #ifdef XEN PT_UPDATES_FLUSH(); #endif sched_switch(td, newtd, flags); - CTR3(KTR_SCHED, "mi_switch: running %p(%s) prio %d", - td, td->td_name, td->td_priority); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", + "prio:%d", td->td_priority); CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td->td_sched, p->p_pid, td->td_name); Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Sat Jan 17 06:55:28 2009 (r187356) +++ head/sys/kern/sched_4bsd.c Sat Jan 17 07:17:57 2009 (r187357) @@ -82,6 +82,8 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #endif #define NICE_WEIGHT 1 /* Priorities per nice level. */ +#define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__STRING(UINT_MAX))) + /* * The schedulable entity that runs a context. * This is an extension to the thread structure and is tailored to @@ -93,6 +95,9 @@ struct td_sched { int ts_slptime; /* (j) Seconds !RUNNING. */ int ts_flags; struct runq *ts_runq; /* runq the thread is currently on */ +#ifdef KTR + char ts_name[TS_NAME_LEN]; +#endif }; /* flags kept in td_flags */ @@ -243,15 +248,17 @@ SYSCTL_INT(_kern_sched, OID_AUTO, follow static __inline void sched_load_add(void) { + sched_tdcnt++; - CTR1(KTR_SCHED, "global load: %d", sched_tdcnt); + KTR_COUNTER0(KTR_SCHED, "load", "global load", sched_tdcnt); } static __inline void sched_load_rem(void) { + sched_tdcnt--; - CTR1(KTR_SCHED, "global load: %d", sched_tdcnt); + KTR_COUNTER0(KTR_SCHED, "load", "global load", sched_tdcnt); } /* * Arrange to reschedule if necessary, taking the priorities and @@ -705,8 +712,9 @@ void sched_exit(struct proc *p, struct thread *td) { - CTR3(KTR_SCHED, "sched_exit: %p(%s) prio %d", - td, td->td_name, td->td_priority); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "proc exit", + "prio:td", td->td_priority); + PROC_LOCK_ASSERT(p, MA_OWNED); sched_exit_thread(FIRST_THREAD_IN_PROC(p), td); } @@ -715,8 +723,8 @@ void sched_exit_thread(struct thread *td, struct thread *child) { - CTR3(KTR_SCHED, "sched_exit_thread: %p(%s) prio %d", - child, child->td_name, child->td_priority); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "exit", + "prio:td", child->td_priority); thread_lock(td); td->td_estcpu = ESTCPULIM(td->td_estcpu + child->td_estcpu); thread_unlock(td); @@ -773,10 +781,16 @@ sched_class(struct thread *td, int class static void sched_priority(struct thread *td, u_char prio) { - CTR6(KTR_SCHED, "sched_prio: %p(%s) prio %d newprio %d by %p(%s)", - td, td->td_name, td->td_priority, prio, curthread, - curthread->td_name); + + KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", + "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, + sched_tdname(curthread)); + if (td != curthread && prio > td->td_priority) { + KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), + "lend prio", "prio:%d", td->td_priority, "new prio:%d", + prio, KTR_ATTR_LINKED, sched_tdname(td)); + } THREAD_LOCK_ASSERT(td, MA_OWNED); if (td->td_priority == prio) return; @@ -1205,9 +1219,13 @@ sched_add(struct thread *td, int flags) ("sched_add: bad thread state")); KASSERT(td->td_flags & TDF_INMEM, ("sched_add: thread swapped out")); - CTR5(KTR_SCHED, "sched_add: %p(%s) prio %d by %p(%s)", - td, td->td_name, td->td_priority, curthread, - curthread->td_name); + + KTR_STATE2(KTR_SCHED, "thread", sched_tdname(td), "runq add", + "prio:%d", td->td_priority, KTR_ATTR_LINKED, + sched_tdname(curthread)); + KTR_POINT1(KTR_SCHED, "thread", sched_tdname(curthread), "wokeup", + KTR_ATTR_LINKED, sched_tdname(td)); + /* * Now that the thread is moving to the run-queue, set the lock @@ -1289,9 +1307,11 @@ sched_add(struct thread *td, int flags) ("sched_add: bad thread state")); KASSERT(td->td_flags & TDF_INMEM, ("sched_add: thread swapped out")); - CTR5(KTR_SCHED, "sched_add: %p(%s) prio %d by %p(%s)", - td, td->td_name, td->td_priority, curthread, - curthread->td_name); + KTR_STATE2(KTR_SCHED, "thread", sched_tdname(td), "runq add", + "prio:%d", td->td_priority, KTR_ATTR_LINKED, + sched_tdname(curthread)); + KTR_POINT1(KTR_SCHED, "thread", sched_tdname(curthread), "wokeup", + KTR_ATTR_LINKED, sched_tdname(td)); /* * Now that the thread is moving to the run-queue, set the lock @@ -1336,9 +1356,9 @@ sched_rem(struct thread *td) KASSERT(TD_ON_RUNQ(td), ("sched_rem: thread not on run queue")); mtx_assert(&sched_lock, MA_OWNED); - CTR5(KTR_SCHED, "sched_rem: %p(%s) prio %d by %p(%s)", - td, td->td_name, td->td_priority, curthread, - curthread->td_name); + KTR_STATE2(KTR_SCHED, "thread", sched_tdname(td), "runq rem", + "prio:%d", td->td_priority, KTR_ATTR_LINKED, + sched_tdname(curthread)); if ((td->td_proc->p_flag & P_NOLOAD) == 0) sched_load_rem(); @@ -1570,6 +1590,22 @@ sched_fork_exit(struct thread *td) THREAD_LOCK_ASSERT(td, MA_OWNED | MA_NOTRECURSED); } +char * +sched_tdname(struct thread *td) +{ +#ifdef KTR + struct td_sched *ts; + + ts = td->td_sched; + if (ts->ts_name[0] == '\0') + snprintf(ts->ts_name, sizeof(ts->ts_name), + "%s tid %d", td->td_name, td->td_tid); + return (ts->ts_name); +#else + return (td->td_name); +#endif +} + void sched_affinity(struct thread *td) { Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sat Jan 17 06:55:28 2009 (r187356) +++ head/sys/kern/sched_ule.c Sat Jan 17 07:17:57 2009 (r187357) @@ -86,6 +86,10 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #define KTR_ULE 0 +#define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__STRING(UINT_MAX))) +#define TDQ_NAME_LEN (sizeof("sched lock ") + sizeof(__STRING(MAXCPU))) +#define TDQ_LOADNAME_LEN (PCPU_NAME_LEN + sizeof(" load")) + /* * Thread scheduler specific section. All fields are protected * by the thread lock. @@ -101,6 +105,9 @@ struct td_sched { int ts_ltick; /* Last tick that we were running on */ int ts_ftick; /* First tick that we were running on */ int ts_ticks; /* Tick count */ +#ifdef KTR + char ts_name[TS_NAME_LEN]; +#endif }; /* flags kept in ts_flags */ #define TSF_BOUND 0x0001 /* Thread can not migrate. */ @@ -216,7 +223,10 @@ struct tdq { struct runq tdq_realtime; /* real-time run queue. */ struct runq tdq_timeshare; /* timeshare run queue. */ struct runq tdq_idle; /* Queue of IDLE threads. */ - char tdq_name[sizeof("sched lock") + 6]; + char tdq_name[TDQ_NAME_LEN]; +#ifdef KTR + char tdq_loadname[TDQ_LOADNAME_LEN]; +#endif } __aligned(64); /* Idle thread states and config. */ @@ -489,7 +499,7 @@ tdq_load_add(struct tdq *tdq, struct thr tdq->tdq_load++; if ((td->td_proc->p_flag & P_NOLOAD) == 0) tdq->tdq_sysload++; - CTR2(KTR_SCHED, "cpu %d load: %d", TDQ_ID(tdq), tdq->tdq_load); + KTR_COUNTER0(KTR_SCHED, "load", tdq->tdq_loadname, tdq->tdq_load); } /* @@ -508,7 +518,7 @@ tdq_load_rem(struct tdq *tdq, struct thr tdq->tdq_load--; if ((td->td_proc->p_flag & P_NOLOAD) == 0) tdq->tdq_sysload--; - CTR1(KTR_SCHED, "load: %d", tdq->tdq_load); + KTR_COUNTER0(KTR_SCHED, "load", tdq->tdq_loadname, tdq->tdq_load); } /* @@ -1237,6 +1247,10 @@ tdq_setup(struct tdq *tdq) "sched lock %d", (int)TDQ_ID(tdq)); mtx_init(&tdq->tdq_lock, tdq->tdq_name, "sched lock", MTX_SPIN | MTX_RECURSE); +#ifdef KTR + snprintf(tdq->tdq_loadname, sizeof(tdq->tdq_loadname), + "CPU %d load", (int)TDQ_ID(tdq)); +#endif } #ifdef SMP @@ -1559,9 +1573,14 @@ sched_thread_priority(struct thread *td, struct tdq *tdq; int oldpri; - CTR6(KTR_SCHED, "sched_prio: %p(%s) prio %d newprio %d by %p(%s)", - td, td->td_name, td->td_priority, prio, curthread, - curthread->td_name); + KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "prio", + "prio:%d", td->td_priority, "new prio:%d", prio, + KTR_ATTR_LINKED, sched_tdname(curthread)); + if (td != curthread && prio > td->td_priority) { + KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), + "lend prio", "prio:%d", td->td_priority, "new prio:%d", + prio, KTR_ATTR_LINKED, sched_tdname(td)); + } ts = td->td_sched; THREAD_LOCK_ASSERT(td, MA_OWNED); if (td->td_priority == prio) @@ -1990,6 +2009,9 @@ sched_fork_thread(struct thread *td, str ts2->ts_slptime = ts->ts_slptime; ts2->ts_runtime = ts->ts_runtime; ts2->ts_slice = 1; /* Attempt to quickly learn interactivity. */ +#ifdef KTR + bzero(ts2->ts_name, sizeof(ts2->ts_name)); +#endif } /* @@ -2012,10 +2034,9 @@ void sched_exit(struct proc *p, struct thread *child) { struct thread *td; - - CTR3(KTR_SCHED, "sched_exit: %p(%s) prio %d", - child, child->td_name, child->td_priority); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "proc exit", + "prio:td", child->td_priority); PROC_LOCK_ASSERT(p, MA_OWNED); td = FIRST_THREAD_IN_PROC(p); sched_exit_thread(td, child); @@ -2031,9 +2052,8 @@ void sched_exit_thread(struct thread *td, struct thread *child) { - CTR3(KTR_SCHED, "sched_exit_thread: %p(%s) prio %d", - child, child->td_name, child->td_priority); - + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "thread exit", + "prio:td", child->td_priority); /* * Give the child's runtime to the parent without returning the * sleep time as a penalty to the parent. This causes shells that @@ -2291,9 +2311,12 @@ sched_add(struct thread *td, int flags) #ifdef SMP int cpu; #endif - CTR5(KTR_SCHED, "sched_add: %p(%s) prio %d by %p(%s)", - td, td->td_name, td->td_priority, curthread, - curthread->td_name); + + KTR_STATE2(KTR_SCHED, "thread", sched_tdname(td), "runq add", + "prio:%d", td->td_priority, KTR_ATTR_LINKED, + sched_tdname(curthread)); + KTR_POINT1(KTR_SCHED, "thread", sched_tdname(curthread), "wokeup", + KTR_ATTR_LINKED, sched_tdname(td)); THREAD_LOCK_ASSERT(td, MA_OWNED); /* * Recalculate the priority before we select the target cpu or @@ -2337,9 +2360,8 @@ sched_rem(struct thread *td) { struct tdq *tdq; - CTR5(KTR_SCHED, "sched_rem: %p(%s) prio %d by %p(%s)", - td, td->td_name, td->td_priority, curthread, - curthread->td_name); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "runq rem", + "prio:%d", td->td_priority); tdq = TDQ_CPU(td->td_sched->ts_cpu); TDQ_LOCK_ASSERT(tdq, MA_OWNED); MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); @@ -2605,6 +2627,25 @@ sched_fork_exit(struct thread *td) &TDQ_LOCKPTR(tdq)->lock_object, 0, 0, __FILE__, __LINE__); } +/* + * Create on first use to catch odd startup conditons. + */ +char * +sched_tdname(struct thread *td) +{ +#ifdef KTR + struct td_sched *ts; + + ts = td->td_sched; + if (ts->ts_name[0] == '\0') + snprintf(ts->ts_name, sizeof(ts->ts_name), + "%s tid %d", td->td_name, td->td_tid); + return (ts->ts_name); +#else + return (td->td_name); +#endif +} + #ifdef SMP /* Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Sat Jan 17 06:55:28 2009 (r187356) +++ head/sys/kern/subr_pcpu.c Sat Jan 17 07:17:57 2009 (r187357) @@ -76,6 +76,9 @@ pcpu_init(struct pcpu *pcpu, int cpuid, cpu_pcpu_init(pcpu, cpuid, size); pcpu->pc_rm_queue.rmq_next = &pcpu->pc_rm_queue; pcpu->pc_rm_queue.rmq_prev = &pcpu->pc_rm_queue; +#ifdef KTR + snprintf(pcpu->pc_name, sizeof(pcpu->pc_name), "CPU %d", cpuid); +#endif } Modified: head/sys/sys/ktr.h ============================================================================== --- head/sys/sys/ktr.h Sat Jan 17 06:55:28 2009 (r187356) +++ head/sys/sys/ktr.h Sat Jan 17 07:17:57 2009 (r187357) @@ -165,6 +165,95 @@ void ktr_tracepoint(u_int mask, const ch #define TR6(d, p1, p2, p3, p4, p5, p6) CTR6(KTR_GEN, d, p1, p2, p3, p4, p5, p6) /* + * The event macros implement KTR graphic plotting facilities provided + * by src/tools/sched/schedgraph.py. Three generic types of events are + * supported: states, counters, and points. + * + * m is the ktr class for ktr_mask. + * ident is the string identifier that owns the event (ie: "thread 10001") + * etype is the type of event to plot (state, counter, point) + * edat is the event specific data (state name, counter value, point name) + * up to four attributes may be supplied as a name, value pair of arguments. + * + * etype and attribute names must be string constants. This minimizes the + * number of ktr slots required by construction the final format strings + * at compile time. Both must also include a colon and format specifier + * (ie. "prio:%d", prio). It is recommended that string arguments be + * contained within escaped quotes if they may contain ',' or ':' characters. + * + * The special attribute (KTR_ATTR_LINKED, ident) creates a reference to another + * id on the graph for easy traversal of related graph elements. + */ + +#define KTR_ATTR_LINKED "linkedto:\"%s\"" +#define KTR_EFMT(egroup, ident, etype) \ + "KTRGRAPH group:\"" egroup "\", id:\"%s\", " etype ", attributes: " + +#define KTR_EVENT0(m, egroup, ident, etype, edat) \ + CTR2(m, KTR_EFMT(egroup, ident, etype) "none", ident, edat) +#define KTR_EVENT1(m, egroup, ident, etype, edat, a0, v0) \ + CTR3(m, KTR_EFMT(egroup, ident, etype) a0, ident, edat, (v0)) +#define KTR_EVENT2(m, egroup, ident, etype, edat, a0, v0, a1, v1) \ + CTR4(m, KTR_EFMT(egroup, ident, etype) a0 ", " a1, \ + ident, edat, (v0), (v1)) +#define KTR_EVENT3(m, egroup, ident, etype, edat, a0, v0, a1, v1, a2, v2)\ + CTR5(m,KTR_EFMT(egroup, ident, etype) a0 ", " a1 ", " a2, \ + ident, edat, (v0), (v1), (v2)) +#define KTR_EVENT4(m, egroup, ident, etype, edat, \ + a0, v0, a1, v1, a2, v2, a3, v3) \ + CTR6(m,KTR_EFMT(egroup, ident, etype) a0 ", " a1 ", " a2, ", ", a3,\ + ident, edat, (v0), (v1), (v2), (v3)) + +/* + * State functions graph state changes on an ident. + */ +#define KTR_STATE0(m, egroup, ident, state) \ + KTR_EVENT0(m, egroup, ident, "state:\"%s\"", state) +#define KTR_STATE1(m, egroup, ident, state, a0, v0) \ + KTR_EVENT1(m, egroup, ident, "state:\"%s\"", state, a0, (v0)) +#define KTR_STATE2(m, egroup, ident, state, a0, v0, a1, v1) \ + KTR_EVENT2(m, egroup, ident, "state:\"%s\"", state, a0, (v0), a1, (v1)) +#define KTR_STATE3(m, egroup, ident, state, a0, v0, a1, v1, a2, v2) \ + KTR_EVENT3(m, egroup, ident, "state:\"%s\"", \ + state, a0, (v0), a1, (v1), a2, (v2)) +#define KTR_STATE4(m, egroup, ident, state, a0, v0, a1, v1, a2, v2, a3, v3)\ + KTR_EVENT4(m, egroup, ident, "state:\"%s\"", \ + state, a0, (v0), a1, (v1), a2, (v2), a3, (v3)) + +/* + * Counter functions graph counter values. The counter id + * must not be intermixed with a state id. + */ +#define KTR_COUNTER0(m, egroup, ident, counter) \ + KTR_EVENT0(m, egroup, ident, "counter:%d", counter) +#define KTR_COUNTER1(m, egroup, ident, edat, a0, v0) \ + KTR_EVENT1(m, egroup, ident, "counter:%d", counter, a0, (v0)) +#define KTR_COUNTER2(m, egroup, ident, counter, a0, v0, a1, v1) \ + KTR_EVENT2(m, egroup, ident, "counter:%d", counter, a0, (v0), a1, (v1)) +#define KTR_COUNTER3(m, egroup, ident, counter, a0, v0, a1, v1, a2, v2) \ + KTR_EVENT3(m, egroup, ident, "counter:%d", \ + counter, a0, (v0), a1, (v1), a2, (v2)) +#define KTR_COUNTER4(m, egroup, ident, counter, a0, v0, a1, v1, a2, v2, a3, v3)\ + KTR_EVENT4(m, egroup, ident, "counter:%d", \ + counter, a0, (v0), a1, (v1), a2, (v2), a3, (v3)) + +/* + * Point functions plot points of interest on counter or state graphs. + */ +#define KTR_POINT0(m, egroup, ident, point) \ + KTR_EVENT0(m, egroup, ident, "point:\"%s\"", point) +#define KTR_POINT1(m, egroup, ident, point, a0, v0) \ + KTR_EVENT1(m, egroup, ident, "point:\"%s\"", point, a0, (v0)) +#define KTR_POINT2(m, egroup, ident, point, a0, v0, a1, v1) \ + KTR_EVENT2(m, egroup, ident, "point:\"%s\"", point, a0, (v0), a1, (v1)) +#define KTR_POINT3(m, egroup, ident, point, a0, v0, a1, v1, a2, v2) \ + KTR_EVENT3(m, egroup, ident, "point:\"%s\"", point, \ + a0, (v0), a1, (v1), a2, (v2)) +#define KTR_POINT4(m, egroup, ident, point, a0, v0, a1, v1, a2, v2, a3, v3)\ + KTR_EVENT4(m, egroup, ident, "point:\"%s\"", \ + point, a0, (v0), a1, (v1), a2, (v2), a3, (v3)) + +/* * Trace initialization events, similar to CTR with KTR_INIT, but * completely ifdef'ed out if KTR_INIT isn't in KTR_COMPILE (to * save string space, the compiler doesn't optimize out strings Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Sat Jan 17 06:55:28 2009 (r187356) +++ head/sys/sys/pcpu.h Sat Jan 17 07:17:57 2009 (r187357) @@ -54,6 +54,9 @@ struct rm_queue { struct rm_queue* volatile rmq_prev; }; +#define PCPU_NAME_LEN (sizeof("CPU ") + sizeof(__STRING(MAXCPU) + 1)) + + /* * This structure maps out the global data that needs to be kept on a * per-cpu basis. The members are accessed via the PCPU_GET/SET/PTR @@ -77,6 +80,9 @@ struct pcpu { int pc_ktr_idx; /* Index into trace table */ char *pc_ktr_buf; #endif +#ifdef KTR + char pc_name[PCPU_NAME_LEN]; /* String name for KTR. */ +#endif struct vmmeter pc_cnt; /* VM stats counters */ long pc_cp_time[CPUSTATES]; /* statclock ticks */ struct device *pc_device; Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Sat Jan 17 06:55:28 2009 (r187356) +++ head/sys/sys/sched.h Sat Jan 17 07:17:57 2009 (r187357) @@ -134,6 +134,12 @@ void sched_affinity(struct thread *td); int sched_sizeof_proc(void); int sched_sizeof_thread(void); +/* + * This routine provides a consistent thread name for use with KTR graphing + * functions. + */ +char *sched_tdname(struct thread *td); + static __inline void sched_pin(void) { From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 07:24:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DBF2106564A; Sat, 17 Jan 2009 07:24:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 497E38FC0A; Sat, 17 Jan 2009 07:24:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0H7OPBv030714; Sat, 17 Jan 2009 07:24:25 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0H7OP7h030713; Sat, 17 Jan 2009 07:24:25 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200901170724.n0H7OP7h030713@svn.freebsd.org> From: Jeff Roberson Date: Sat, 17 Jan 2009 07:24: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: r187358 - head/tools/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 07:24:25 -0000 Author: jeff Date: Sat Jan 17 07:24:25 2009 New Revision: 187358 URL: http://svn.freebsd.org/changeset/base/187358 Log: - Rewrite the parser to support the new generic schedgraph interface. This no longer requires any custom classes or parsers to support new event types. - Add an optional command line argument for specifying the clock frequency in ghz. This is useful for traces that do not include KTR_SCHED. Sponsored by: Nokia - Add support for sorting rows by clicking and dragging them to their new position. - Add support for configuring the cpu background colors. - Improve the scaling so a better center is maintained as you zoom. This is not perfect due to precision loss with floats used in the window views. - Add new colors and a random assignment for unknown event types. A table is used for known event types. This is the only event specific information. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Sat Jan 17 07:17:57 2009 (r187357) +++ head/tools/sched/schedgraph.py Sat Jan 17 07:24:25 2009 (r187358) @@ -28,6 +28,7 @@ import sys import re +import random from Tkinter import * # To use: @@ -53,30 +54,96 @@ from Tkinter import * # while the workload is still running is to avoid wasting log entries on # "idle" time at the end. # - Dump the trace to a file: 'ktrdump -ct > ktr.out' -# - Run the python script: 'python schedgraph.py ktr.out' +# - Run the python script: 'python schedgraph.py ktr.out' optionally provide +# your cpu frequency in ghz: 'python schedgraph.py ktr.out 2.4' # # To do: -# 1) Add a per-thread summary display -# 2) Add bounding box style zoom. -# 3) Click to center. -# 4) Implement some sorting mechanism. -# 5) Widget to display variable-range data (e.g. q length) -# 6) Reorder rows, hide rows, etc. -# 7) "Vertical rule" to help relate data in different rows -# 8) Mouse-over popup of full thread/event/row lable (currently truncated) -# 9) More visible anchors for popup event windows +# Add a per-source summary display +# Click to move. +# Hide rows +# "Vertical rule" to help relate data in different rows +# Mouse-over popup of full thread/event/row label (currently truncated) +# More visible anchors for popup event windows # # BUGS: 1) Only 8 CPUs are supported, more CPUs require more choices of # colours to represent them ;-) -# 2) Extremely short traces may cause a crash because the code -# assumes there is always at least one stathz entry logged, and -# the number of such events is used as a denominator + +eventcolors = [ + ("count", "red"), + ("running", "green"), + ("idle", "grey"), + ("yielding", "yellow"), + ("swapped", "violet"), + ("suspended", "purple"), + ("iwait", "grey"), + ("sleep", "blue"), + ("blocked", "dark red"), + ("runq add", "yellow"), + ("runq rem", "yellow"), + ("thread exit", "grey"), + ("proc exit", "grey"), + ("callwheel idle", "grey"), + ("callout running", "green"), + ("lock acquire", "blue"), + ("lock contest", "purple"), + ("failed lock try", "red"), + ("lock release", "grey"), + ("tick", "black"), + ("prio", "black"), + ("lend prio", "black"), + ("wokeup", "black") +] + +cpucolors = [ + ("CPU 0", "light grey"), + ("CPU 1", "dark grey"), + ("CPU 2", "light blue"), + ("CPU 3", "light pink"), + ("CPU 4", "blanched almond"), + ("CPU 5", "slate grey"), + ("CPU 6", "tan"), + ("CPU 7", "thistle"), + ("CPU 8", "white") +] + +colors = [ + "white", "thistle", "blanched almond", "tan", "chartreuse", + "dark red", "red", "pale violet red", "pink", "light pink", + "dark orange", "orange", "coral", "light coral", + "goldenrod", "gold", "yellow", "light yellow", + "dark green", "green", "light green", "light sea green", + "dark blue", "blue", "light blue", "steel blue", "light slate blue", + "dark violet", "violet", "purple", "blue violet", + "dark grey", "slate grey", "light grey", + "black", +] +colors.sort() ticksps = None status = None -configtypes = [] +colormap = None +ktrfile = None +clockfreq = None +sources = [] lineno = -1 +class Colormap: + def __init__(self, table): + self.table = table + self.map = {} + for entry in table: + self.map[entry[0]] = entry[1] + + def lookup(self, name): + try: + color = self.map[name] + except: + color = colors[random.randrange(0, len(colors))] + print "Picking random color", color, "for", name + self.map[name] = color + self.table.append((name, color)) + return (color) + def ticks2sec(ticks): us = ticksps / 1000000 ticks /= us @@ -124,9 +191,13 @@ class Status(Frame): self.set(str) root.update() -class EventConf(Frame): - def __init__(self, master, name, color, enabled): +class ColorConf(Frame): + def __init__(self, master, name, color): Frame.__init__(self, master) + if (graph.getstate(name) == "hidden"): + enabled = 0 + else: + enabled = 1 self.name = name self.color = StringVar() self.color_default = color @@ -144,16 +215,8 @@ class EventConf(Frame): bg='grey') self.rect = self.sample.create_rectangle(0, 0, 24, 24, fill=self.color.get()) - self.list = OptionMenu(self, self.color, - "dark red", "red", "pink", - "dark orange", "orange", - "yellow", "light yellow", - "dark green", "green", "light green", - "dark blue", "blue", "light blue", - "dark violet", "violet", "purple", - "dark grey", "light grey", - "white", "black", - command=self.setcolor) + self.list = OptionMenu(self, self.color, command=self.setcolor, + *colors) self.checkbox = Checkbutton(self, text="enabled", variable=self.enabled) self.label.grid(row=0, column=0, sticky=E+W) @@ -161,7 +224,7 @@ class EventConf(Frame): self.list.grid(row=0, column=2, sticky=E+W) self.checkbox.grid(row=0, column=3) self.columnconfigure(0, weight=1) - self.columnconfigure(2, minsize=110) + self.columnconfigure(2, minsize=150) def setcolor(self, color): self.color.set(color) @@ -186,19 +249,15 @@ class EventConf(Frame): graph.setcolor(self.name, self.color_current) def revert(self): - self.setcolor(self.color_current) - self.enabled.set(self.enabled_current) - - def default(self): self.setcolor(self.color_default) self.enabled.set(self.enabled_default) -class EventConfigure(Toplevel): - def __init__(self): +class ColorConfigure(Toplevel): + def __init__(self, table, name): Toplevel.__init__(self) self.resizable(0, 0) - self.title("Event Configuration") - self.items = LabelFrame(self, text="Event Type") + self.title(name) + self.items = LabelFrame(self, text="Item Type") self.buttons = Frame(self) self.drawbuttons() self.items.grid(row=0, column=0, sticky=E+W) @@ -206,11 +265,13 @@ class EventConfigure(Toplevel): self.buttons.grid(row=1, column=0, sticky=E+W) self.types = [] self.irow = 0 - for type in configtypes: - self.additem(type.name, type.color, type.enabled) + for type in table: + color = graph.getcolor(type[0]) + if (color != ""): + self.additem(type[0], color) - def additem(self, name, color, enabled=1): - item = EventConf(self.items, name, color, enabled) + def additem(self, name, color): + item = ColorConf(self.items, name, color) self.types.append(item) item.grid(row=self.irow, column=0, sticky=E+W) self.irow += 1 @@ -218,16 +279,12 @@ class EventConfigure(Toplevel): def drawbuttons(self): self.apply = Button(self.buttons, text="Apply", command=self.apress) - self.revert = Button(self.buttons, text="Revert", + self.default = Button(self.buttons, text="Revert", command=self.rpress) - self.default = Button(self.buttons, text="Default", - command=self.dpress) self.apply.grid(row=0, column=0, sticky=E+W) - self.revert.grid(row=0, column=1, sticky=E+W) - self.default.grid(row=0, column=2, sticky=E+W) + self.default.grid(row=0, column=1, sticky=E+W) self.buttons.columnconfigure(0, weight=1) self.buttons.columnconfigure(1, weight=1) - self.buttons.columnconfigure(2, weight=1) def apress(self): for item in self.types: @@ -237,20 +294,16 @@ class EventConfigure(Toplevel): for item in self.types: item.revert() - def dpress(self): - for item in self.types: - item.default() - class EventView(Toplevel): def __init__(self, event, canvas): Toplevel.__init__(self) self.resizable(0, 0) self.title("Event") self.event = event - self.frame = Frame(self) - self.frame.grid(row=0, column=0, sticky=N+S+E+W) self.buttons = Frame(self) - self.buttons.grid(row=1, column=0, sticky=E+W) + self.buttons.grid(row=0, column=0, sticky=E+W) + self.frame = Frame(self) + self.frame.grid(row=1, column=0, sticky=N+S+E+W) self.canvas = canvas self.drawlabels() self.drawbuttons() @@ -272,9 +325,12 @@ class EventView(Toplevel): ypos = 0 labels = self.event.labels() while (len(labels) < 7): - labels.append(("", "", 0)) + labels.append(("", "")) for label in labels: - name, value, linked = label + name, value = label + linked = 0 + if (name == "linkedto"): + linked = 1 l = Label(self.frame, text=name, bd=1, width=15, relief=SUNKEN, anchor=W) if (linked): @@ -313,7 +369,7 @@ class EventView(Toplevel): prev = self.event.prev() if (prev == None): return - while (prev.real == 0): + while (prev.type == "pad"): prev = prev.prev() if (prev == None): return @@ -323,7 +379,7 @@ class EventView(Toplevel): next = self.event.next() if (next == None): return - while (next.real == 0): + while (next.type == "pad"): next = next.next() if (next == None): return @@ -335,60 +391,67 @@ class EventView(Toplevel): self.newevent(event) class Event: - name = "none" - color = "grey" - def __init__(self, source, cpu, timestamp, last=0): + def __init__(self, source, name, cpu, timestamp, attrs): self.source = source + self.name = name self.cpu = cpu self.timestamp = int(timestamp) - self.entries = [] - self.real = 1 + self.attrs = attrs self.idx = None - self.state = 0 self.item = None self.dispcnt = 0 - self.linked = None self.recno = lineno - if (last): - source.lastevent(self) - else: - source.event(self) def status(self): statstr = self.name + " " + self.source.name statstr += " on: cpu" + str(self.cpu) statstr += " at: " + str(self.timestamp) - statstr += self.stattxt() + statstr += " attributes: " + for i in range(0, len(self.attrs)): + attr = self.attrs[i] + statstr += attr[0] + ": " + str(attr[1]) + if (i != len(self.attrs) - 1): + statstr += ", " status.set(statstr) - def stattxt(self): - return "" - - def textadd(self, tuple): - pass - self.entries.append(tuple) - def labels(self): - return [("Source:", self.source.name, 0), - ("Event:", self.name, 0), - ("CPU:", self.cpu, 0), - ("Timestamp:", self.timestamp, 0), - ("Record: ", self.recno, 0) - ] + self.entries - def mouseenter(self, canvas, item): + return [("Source", self.source.name), + ("Event", self.name), + ("CPU", self.cpu), + ("Timestamp", self.timestamp), + ("KTR Line ", self.recno) + ] + self.attrs + + def mouseenter(self, canvas): self.displayref(canvas) self.status() - def mouseexit(self, canvas, item): + def mouseexit(self, canvas): self.displayunref(canvas) status.clear() - def mousepress(self, canvas, item): + def mousepress(self, canvas): EventView(self, canvas) + def draw(self, canvas, xpos, ypos, item): + self.item = item + if (item != None): + canvas.items[item] = self + + def move(self, canvas, x, y): + if (self.item == None): + return; + canvas.move(self.item, x, y); + def next(self): return self.source.eventat(self.idx + 1) + def nexttype(self, type): + next = self.next() + while (next != None and next.type != type): + next = next.next() + return (next) + def prev(self): return self.source.eventat(self.idx - 1) @@ -404,435 +467,106 @@ class Event: canvas.tag_raise("point", "state") def getlinked(self): - return self.linked.findevent(self.timestamp) + for attr in self.attrs: + if (attr[0] != "linkedto"): + continue + source = ktrfile.findid(attr[1]) + return source.findevent(self.timestamp) + return None class PointEvent(Event): - def __init__(self, thread, cpu, timestamp, last=0): - Event.__init__(self, thread, cpu, timestamp, last) + type = "point" + def __init__(self, source, name, cpu, timestamp, attrs): + Event.__init__(self, source, name, cpu, timestamp, attrs) def draw(self, canvas, xpos, ypos): + color = colormap.lookup(self.name) l = canvas.create_oval(xpos - 6, ypos + 1, xpos + 6, ypos - 11, - fill=self.color, tags=("all", "point", "event") - + (self.name,), width=0) - canvas.events[l] = self - self.item = l - if (self.enabled == 0): - canvas.itemconfigure(l, state="hidden") + fill=color, tags=("all", "point", "event", self.name), + width=0) + Event.draw(self, canvas, xpos, ypos, l) - return (xpos) + return xpos class StateEvent(Event): - def __init__(self, thread, cpu, timestamp, last=0): - Event.__init__(self, thread, cpu, timestamp, last) - self.duration = 0 - self.skipnext = 0 - self.skipself = 0 - self.state = 1 + type = "state" + def __init__(self, source, name, cpu, timestamp, attrs): + Event.__init__(self, source, name, cpu, timestamp, attrs) def draw(self, canvas, xpos, ypos): - next = self.nextstate() - if (self.skipself == 1 or next == None): + next = self.nexttype("state") + if (next == None): return (xpos) - while (self.skipnext): - skipped = next - next.skipself = 1 - next.real = 0 - next = next.nextstate() - if (next == None): - next = skipped - self.skipnext -= 1 - self.duration = next.timestamp - self.timestamp - if (self.duration < 0): - self.duration = 0 + duration = next.timestamp - self.timestamp + self.attrs.insert(0, ("duration", ticks2sec(duration))) + color = colormap.lookup(self.name) + if (duration < 0): + duration = 0 print "Unsynchronized timestamp" print self.cpu, self.timestamp print next.cpu, next.timestamp - delta = self.duration / canvas.ratio + delta = duration / canvas.ratio l = canvas.create_rectangle(xpos, ypos, - xpos + delta, ypos - 10, fill=self.color, width=0, - tags=("all", "state", "event") + (self.name,)) - canvas.events[l] = self - self.item = l - if (self.enabled == 0): - canvas.itemconfigure(l, state="hidden") + xpos + delta, ypos - 10, fill=color, width=0, + tags=("all", "state", "event", self.name)) + Event.draw(self, canvas, xpos, ypos, l) return (xpos + delta) - def stattxt(self): - return " duration: " + ticks2sec(self.duration) - - def nextstate(self): - next = self.next() - while (next != None and next.state == 0): - next = next.next() - return (next) - - def labels(self): - return [("Source:", self.source.name, 0), - ("Event:", self.name, 0), - ("Timestamp:", self.timestamp, 0), - ("CPU:", self.cpu, 0), - ("Record:", self.recno, 0), - ("Duration:", ticks2sec(self.duration), 0) - ] + self.entries - -class Count(Event): - name = "Count" - color = "red" - enabled = 1 - def __init__(self, source, cpu, timestamp, count): - self.count = int(count) - Event.__init__(self, source, cpu, timestamp) - self.duration = 0 - self.textadd(("count:", self.count, 0)) +class CountEvent(Event): + type = "count" + def __init__(self, source, count, cpu, timestamp, attrs): + count = int(count) + self.count = count + Event.__init__(self, source, "count", cpu, timestamp, attrs) def draw(self, canvas, xpos, ypos): - next = self.next() - self.duration = next.timestamp - self.timestamp - delta = self.duration / canvas.ratio + next = self.nexttype("count") + if (next == None): + return (xpos) + color = colormap.lookup("count") + duration = next.timestamp - self.timestamp + self.attrs.insert(0, ("count", self.count)) + self.attrs.insert(1, ("duration", ticks2sec(duration))) + delta = duration / canvas.ratio yhight = self.source.yscale() * self.count l = canvas.create_rectangle(xpos, ypos - yhight, - xpos + delta, ypos, fill=self.color, width=0, - tags=("all", "count", "event") + (self.name,)) - canvas.events[l] = self - self.item = l - if (self.enabled == 0): - canvas.itemconfigure(l, state="hidden") + xpos + delta, ypos, fill=color, width=0, + tags=("all", "count", "event", self.name)) + Event.draw(self, canvas, xpos, ypos, l) return (xpos + delta) - def stattxt(self): - return " count: " + str(self.count) - -configtypes.append(Count) - -class Running(StateEvent): - name = "running" - color = "green" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Running) - -class Idle(StateEvent): - name = "idle" - color = "grey" - enabled = 0 - def __init__(self, thread, cpu, timestamp, prio): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Idle) - -class Yielding(StateEvent): - name = "yielding" - color = "yellow" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio): - StateEvent.__init__(self, thread, cpu, timestamp) - self.skipnext = 0 - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Yielding) - -class Swapped(StateEvent): - name = "swapped" - color = "violet" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Swapped) - -class Suspended(StateEvent): - name = "suspended" - color = "purple" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Suspended) - -class Iwait(StateEvent): - name = "iwait" - color = "grey" - enabled = 0 - def __init__(self, thread, cpu, timestamp, prio): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Iwait) - -class Preempted(StateEvent): - name = "preempted" - color = "red" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio, bythread): - StateEvent.__init__(self, thread, cpu, timestamp) - self.skipnext = 1 - self.prio = prio - self.linked = bythread - self.textadd(("prio:", self.prio, 0)) - self.textadd(("by thread:", self.linked.name, 1)) - -configtypes.append(Preempted) - -class Sleep(StateEvent): - name = "sleep" - color = "blue" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio, wmesg): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.wmesg = wmesg - self.textadd(("prio:", self.prio, 0)) - self.textadd(("wmesg:", self.wmesg, 0)) - - def stattxt(self): - statstr = StateEvent.stattxt(self) - statstr += " sleeping on: " + self.wmesg - return (statstr) - -configtypes.append(Sleep) - -class Blocked(StateEvent): - name = "blocked" - color = "dark red" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio, lock): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.lock = lock - self.textadd(("prio:", self.prio, 0)) - self.textadd(("lock:", self.lock, 0)) - - def stattxt(self): - statstr = StateEvent.stattxt(self) - statstr += " blocked on: " + self.lock - return (statstr) - -configtypes.append(Blocked) - -class KsegrpRunq(StateEvent): - name = "KsegrpRunq" - color = "orange" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio, bythread): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.linked = bythread - self.textadd(("prio:", self.prio, 0)) - self.textadd(("by thread:", self.linked.name, 1)) - -configtypes.append(KsegrpRunq) - -class Runq(StateEvent): - name = "Runq" - color = "yellow" - enabled = 1 - def __init__(self, thread, cpu, timestamp, prio, bythread): - StateEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.linked = bythread - self.textadd(("prio:", self.prio, 0)) - self.textadd(("by thread:", self.linked.name, 1)) - -configtypes.append(Runq) - -class Sched_exit_thread(StateEvent): - name = "exit_thread" - color = "grey" - enabled = 0 - def __init__(self, thread, cpu, timestamp, prio): - StateEvent.__init__(self, thread, cpu, timestamp) - self.name = "sched_exit_thread" - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Sched_exit_thread) - -class Sched_exit(StateEvent): - name = "exit" - color = "grey" - enabled = 0 - def __init__(self, thread, cpu, timestamp, prio): - StateEvent.__init__(self, thread, cpu, timestamp) - self.name = "sched_exit" - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Sched_exit) - -# Events for running callout routines - -class CalloutIdle(StateEvent): - name = "callwheel idle" - color = "grey" - enabled = 0 - def __init__(self, wheel, cpu, timestamp): - StateEvent.__init__(self, wheel, cpu, timestamp) - -configtypes.append(CalloutIdle) - -class CalloutRunning(StateEvent): - name = "callout running" - color = "green" - enabled = 1 - def __init__(self, wheel, cpu, timestamp, func, arg): - StateEvent.__init__(self, wheel, cpu, timestamp) - self.textadd(("function:", func, 0)) - self.textadd(("argument:", arg, 0)) - self.arg = arg - self.func = func - - def stattxt(self): - statstr = StateEvent.stattxt(self) - statstr += " executing %s(%s)" % (self.func, self.arg) - return (statstr) - -configtypes.append(CalloutRunning) - -# Events on locks -# -# XXX: No support for upgrade/downgrade currently or differentiating -# between read/write in general. -# -# XXX: Point events for recursion perhaps? - -class LockAcquire(StateEvent): - name = "lock acquire" - color = "blue" - enabled = 1 - def __init__(self, lock, cpu, timestamp, file, line): - StateEvent.__init__(self, lock, cpu, timestamp) - self.textadd(("file:", file, 0)) - self.textadd(("line:", line, 0)) - -configtypes.append(LockAcquire) - -class LockContest(StateEvent): - name = "lock contest" - color = "purple" - enabled = 1 - def __init__(self, lock, cpu, timestamp, file, line): - StateEvent.__init__(self, lock, cpu, timestamp) - self.textadd(("file:", file, 0)) - self.textadd(("line:", line, 0)) - -configtypes.append(LockContest) - -class LockFailedTry(PointEvent): - name = "failed lock try" - color = "red" - enabled = 1 - def __init__(self, lock, cpu, timestamp, file, line): - PointEvent.__init__(self, lock, cpu, timestamp) - self.textadd(("file:", file, 0)) - self.textadd(("line:", line, 0)) - -configtypes.append(LockFailedTry) - -class LockRelease(StateEvent): - name = "lock release" - color = "grey" - enabled = 0 - def __init__(self, lock, cpu, timestamp, file, line): - StateEvent.__init__(self, lock, cpu, timestamp) - self.textadd(("file:", file, 0)) - self.textadd(("line:", line, 0)) - -configtypes.append(LockRelease) - -class Padevent(StateEvent): - def __init__(self, thread, cpu, timestamp, last=0): - StateEvent.__init__(self, thread, cpu, timestamp, last) - self.name = "pad" - self.real = 0 - +class PadEvent(StateEvent): + type = "pad" + def __init__(self, source, cpu, timestamp, last=0): + if (last): + cpu = source.events[len(source.events) -1].cpu + else: + cpu = source.events[0].cpu + StateEvent.__init__(self, source, "pad", cpu, timestamp, []) def draw(self, canvas, xpos, ypos): next = self.next() if (next == None): return (xpos) - self.duration = next.timestamp - self.timestamp - delta = self.duration / canvas.ratio + duration = next.timestamp - self.timestamp + delta = duration / canvas.ratio + Event.draw(self, canvas, xpos, ypos, None) return (xpos + delta) -class Tick(PointEvent): - name = "tick" - color = "black" - enabled = 0 - def __init__(self, thread, cpu, timestamp, prio, stathz): - PointEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.textadd(("prio:", self.prio, 0)) - -configtypes.append(Tick) - -class Prio(PointEvent): - name = "prio" - color = "black" - enabled = 0 - def __init__(self, thread, cpu, timestamp, prio, newprio, bythread): - PointEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.newprio = newprio - self.linked = bythread - self.textadd(("new prio:", self.newprio, 0)) - self.textadd(("prio:", self.prio, 0)) - if (self.linked != self.source): - self.textadd(("by thread:", self.linked.name, 1)) - else: - self.textadd(("by thread:", self.linked.name, 0)) - -configtypes.append(Prio) - -class Lend(PointEvent): - name = "lend" - color = "black" - enabled = 0 - def __init__(self, thread, cpu, timestamp, prio, tothread): - PointEvent.__init__(self, thread, cpu, timestamp) - self.prio = prio - self.linked = tothread - self.textadd(("prio:", self.prio, 0)) - self.textadd(("to thread:", self.linked.name, 1)) - -configtypes.append(Lend) - -class Wokeup(PointEvent): - name = "wokeup" - color = "black" - enabled = 0 - def __init__(self, thread, cpu, timestamp, ranthread): - PointEvent.__init__(self, thread, cpu, timestamp) - self.linked = ranthread - self.textadd(("ran thread:", self.linked.name, 1)) - -configtypes.append(Wokeup) - -(DEFAULT, LOAD, COUNT, CALLWHEEL, LOCK, THREAD) = range(6) - class EventSource: - def __init__(self, name, group=DEFAULT, order=0): - self.name = name + def __init__(self, group, id): + self.name = id self.events = [] - self.cpu = 0 - self.cpux = 0 + self.cpuitems = [] self.group = group - self.order = order + self.y = 0 + self.item = None def __cmp__(self, other): + if (other == None): + return -1 if (self.group == other.group): - return cmp(self.order, other.order) + return cmp(self.name, other.name) return cmp(self.group, other.group) # It is much faster to append items to a list then to insert them @@ -841,60 +575,54 @@ class EventSource: def fixup(self): self.events.reverse() - def event(self, event): + def addevent(self, event): self.events.append(event) - def remove(self, event): - self.events.remove(event) - - def lastevent(self, event): + def addlastevent(self, event): self.events.insert(0, event) def draw(self, canvas, ypos): xpos = 10 - self.cpux = 10 - self.cpu = self.events[1].cpu + cpux = 10 + cpu = self.events[1].cpu for i in range(0, len(self.events)): self.events[i].idx = i for event in self.events: - if (event.cpu != self.cpu and event.cpu != -1): - self.drawcpu(canvas, xpos, ypos) - self.cpux = xpos - self.cpu = event.cpu + if (event.cpu != cpu and event.cpu != -1): + self.drawcpu(canvas, cpu, cpux, xpos, ypos) + cpux = xpos + cpu = event.cpu xpos = event.draw(canvas, xpos, ypos) - self.drawcpu(canvas, xpos, ypos) + self.drawcpu(canvas, cpu, cpux, xpos, ypos) def drawname(self, canvas, ypos): + self.y = ypos ypos = ypos - (self.ysize() / 2) - canvas.create_text(10, ypos, anchor="w", text=self.name) + self.item = canvas.create_text(10, ypos, anchor="w", text=self.name) + return (self.item) - def drawcpu(self, canvas, xpos, ypos): - cpu = int(self.cpu) - if (cpu == 0): - color = 'light grey' - elif (cpu == 1): - color = 'dark grey' - elif (cpu == 2): - color = 'light blue' - elif (cpu == 3): - color = 'light green' - elif (cpu == 4): - color = 'blanched almond' - elif (cpu == 5): - color = 'slate grey' - elif (cpu == 6): - color = 'light slate blue' - elif (cpu == 7): - color = 'thistle' - else: - color = "white" - l = canvas.create_rectangle(self.cpux, + def drawcpu(self, canvas, cpu, fromx, tox, ypos): + cpu = "CPU " + str(cpu) + color = cpucolormap.lookup(cpu) + # Create the cpu background colors default to hidden + l = canvas.create_rectangle(fromx, ypos - self.ysize() - canvas.bdheight, - xpos, ypos + canvas.bdheight, fill=color, width=0, - tags=("all", "cpuinfo")) + tox, ypos + canvas.bdheight, fill=color, width=0, + tags=("all", "cpuinfo", cpu), state="hidden") + self.cpuitems.append(l) + + def move(self, canvas, xpos, ypos): + for event in self.events: + event.move(canvas, xpos, ypos) + for item in self.cpuitems: + canvas.move(item, xpos, ypos) + + def movename(self, canvas, xpos, ypos): + self.y += ypos + canvas.move(self.item, xpos, ypos) def ysize(self): - return (None) + return (10) def eventat(self, i): if (i >= len(self.events)): @@ -904,93 +632,45 @@ class EventSource: def findevent(self, timestamp): for event in self.events: - if (event.timestamp >= timestamp and event.real): + if (event.timestamp >= timestamp and event.type != "pad"): return (event) return (None) -class Thread(EventSource): - names = {} - def __init__(self, td, pcomm): - EventSource.__init__(self, pcomm, THREAD) - self.str = td +class Counter(EventSource): + # + # Store a hash of counter groups that keeps the max value + # for a counter in this group for scaling purposes. + # + groups = {} + def __init__(self, group, id): try: - cnt = Thread.names[pcomm] + Counter.cnt = Counter.groups[group] except: - Thread.names[pcomm] = 0 - return - Thread.names[pcomm] = cnt + 1 - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 10:08:57 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 333161065672; Sat, 17 Jan 2009 10:08:57 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id CA2318FC17; Sat, 17 Jan 2009 10:08:56 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 9F05C28449; Sat, 17 Jan 2009 18:08:55 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 702B7EC42A3; Sat, 17 Jan 2009 18:08:54 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id 5lgfoS3mPeoq; Sat, 17 Jan 2009 18:08:46 +0800 (CST) Received: from charlie.delphij.net (c-67-188-86-134.hsd1.ca.comcast.net [67.188.86.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id AB0A8EC418A; Sat, 17 Jan 2009 18:08:43 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=FlGXYuOSEqxbT20/gvuqsSF0AB8M46pT4dQPXQC/Eq6rSVAnp1ytZzMJKEE2m1NXO UIGjmfz8r/N1h58m6USZA== Message-ID: <4971AE26.70406@delphij.net> Date: Sat, 17 Jan 2009 02:08:38 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.19 (X11/20090112) MIME-Version: 1.0 To: obrien@FreeBSD.ORG References: <200901120039.n0C0dMKX043214@svn.freebsd.org> <20090112083144.GA69408@dragon.NUXI.org> In-Reply-To: <20090112083144.GA69408@dragon.NUXI.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r187069 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 10:08:58 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, David, David O'Brien wrote: > On Mon, Jan 12, 2009 at 12:39:22AM +0000, Xin LI wrote: >> Author: delphij >> Date: Mon Jan 12 00:39:22 2009 >> New Revision: 187069 >> URL: http://svn.freebsd.org/changeset/base/187069 >> >> Log: >> MFC revisions 178088 and 179656: Catastrophic recovery mode. > > Hi Xin, > I guess you missed my email to you about this. I was hoping to get an > answer to this before it was MFC'ed. Oops, sorry about that, I think I must have missed the e-mail... > The use of 'C' conflicts with a Juniper Networks change Juniper wants to > push back to FreeBSD. > > For Juniper the -C flag is the "clean" flag. Meaning don't do anything > if the FS is clean, other wise do as full a fsck as possible (vs. just > a "preen" fsck). It is useful as 'fsck -C -y /var' (for instance). > > Do you think your functionality could live under the "-D" (damaged) > option? fsck_ffs already had a "-c" option, or Juniper would have > used that letter. I'm fine with a rename of the option, 'D' sounds a reasonable for my functionality. I have used uppercase to imply that the option is potentially dangerous. One bikeshed candidate: For non-native English speakers, flag 'p' sounds somewhat vague, and 'C' is not quite straightforward either, at the first glance, 'preen' seems to be stronger than 'clean'. Perhaps, 'P' would be a better candidate (a stronger 'preen') for the proposed functionality, just my $0.02 :) Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAklxriYACgkQi+vbBBjt66DwqACfWbN4XfBUcuMalw5MtuxtoeI5 V0gAoLOT/nOy6t5Vy9cP7qqv3VmZtDx9 =0lpr -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 11:19:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BEA11065672; Sat, 17 Jan 2009 11:19:16 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19C478FC1B; Sat, 17 Jan 2009 11:19:16 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HBJFIn041490; Sat, 17 Jan 2009 11:19:15 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HBJFvP041489; Sat, 17 Jan 2009 11:19:15 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200901171119.n0HBJFvP041489@svn.freebsd.org> From: Jeff Roberson Date: Sat, 17 Jan 2009 11:19: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: r187359 - head/tools/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 11:19:16 -0000 Author: jeff Date: Sat Jan 17 11:19:15 2009 New Revision: 187359 URL: http://svn.freebsd.org/changeset/base/187359 Log: - Add a new source configuration menu option that allows hiding and displaying sources. - Add functions to the main SchedGraph to facilitate source hiding. The source is simply moved off screen and all other sources are moved to compensate. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Sat Jan 17 07:24:25 2009 (r187358) +++ head/tools/sched/schedgraph.py Sat Jan 17 11:19:15 2009 (r187359) @@ -59,8 +59,6 @@ from Tkinter import * # # To do: # Add a per-source summary display -# Click to move. -# Hide rows # "Vertical rule" to help relate data in different rows # Mouse-over popup of full thread/event/row label (currently truncated) # More visible anchors for popup event windows @@ -294,6 +292,118 @@ class ColorConfigure(Toplevel): for item in self.types: item.revert() +class SourceConf(Frame): + def __init__(self, master, source): + Frame.__init__(self, master) + if (source.hidden == 1): + enabled = 0 + else: + enabled = 1 + self.source = source + self.name = source.name + self.enabled = IntVar() + self.enabled_default = enabled + self.enabled_current = enabled + self.enabled.set(enabled) + self.draw() + + def draw(self): + self.label = Label(self, text=self.name, anchor=W) + self.checkbox = Checkbutton(self, text="enabled", + variable=self.enabled) + self.label.grid(row=0, column=0, sticky=E+W) + self.checkbox.grid(row=0, column=1) + self.columnconfigure(0, weight=1) + + def apply(self): + echange = 0 + if (self.enabled_current != self.enabled.get()): + echange = 1 + self.enabled_current = self.enabled.get() + if (echange != 0): + if (self.enabled_current): + graph.sourceshow(self.source) + else: + graph.sourcehide(self.source) + return + + def revert(self): + self.enabled.set(self.enabled_default) + + def check(self): + self.enabled.set(1) + + def uncheck(self): + self.enabled.set(0) + +class SourceConfigure(Toplevel): + def __init__(self): + Toplevel.__init__(self) + self.resizable(0, 0) + self.title("Source Configuration") + self.items = [] + self.iframe = Frame(self) + self.iframe.grid(row=0, column=0, sticky=E+W) + f = LabelFrame(self.iframe, bd=4, text="Sources") + self.items.append(f) + self.buttons = Frame(self) + self.items[0].grid(row=0, column=0, sticky=E+W) + self.columnconfigure(0, weight=1) + self.sconfig = [] + self.irow = 0 + self.icol = 0 + for source in sources: + self.addsource(source) + self.drawbuttons() + self.buttons.grid(row=1, column=0, sticky=W) + + def addsource(self, source): + if (self.irow > 30): + self.icol += 1 + self.irow = 0 + c = self.icol + f = LabelFrame(self.iframe, bd=4, text="Sources") + f.grid(row=0, column=c, sticky=N+E+W) + self.items.append(f) + item = SourceConf(self.items[self.icol], source) + self.sconfig.append(item) + item.grid(row=self.irow, column=0, sticky=E+W) + self.irow += 1 + + def drawbuttons(self): + self.apply = Button(self.buttons, text="Apply", + command=self.apress) + self.default = Button(self.buttons, text="Revert", + command=self.rpress) + self.checkall = Button(self.buttons, text="Check All", + command=self.cpress) + self.uncheckall = Button(self.buttons, text="Uncheck All", + command=self.upress) + self.checkall.grid(row=0, column=0, sticky=W) + self.uncheckall.grid(row=0, column=1, sticky=W) + self.apply.grid(row=0, column=2, sticky=W) + self.default.grid(row=0, column=3, sticky=W) + self.buttons.columnconfigure(0, weight=1) + self.buttons.columnconfigure(1, weight=1) + self.buttons.columnconfigure(2, weight=1) + self.buttons.columnconfigure(3, weight=1) + + def apress(self): + for item in self.sconfig: + item.apply() + + def rpress(self): + for item in self.sconfig: + item.revert() + + def cpress(self): + for item in self.sconfig: + item.check() + + def upress(self): + for item in self.sconfig: + item.uncheck() + class EventView(Toplevel): def __init__(self, event, canvas): Toplevel.__init__(self) @@ -561,6 +671,7 @@ class EventSource: self.group = group self.y = 0 self.item = None + self.hidden = 0 def __cmp__(self, other): if (other == None): @@ -900,6 +1011,10 @@ class SchedNames(Canvas): self.bind("", self.master.mouserelease); self.bind("", self.master.mousemotion); + def updatescroll(self): + self.configure(scrollregion=(0, 0, + self["width"], self.display.ysize())) + class SchedDisplay(Canvas): def __init__(self, master): @@ -990,7 +1105,9 @@ class SchedDisplay(Canvas): def ysize(self): ysize = 0 for source in sources: - ysize += source.ysize() + (self.bdheight * 2) + if (source.hidden == 1): + continue + ysize += self.parent.sourcesize(source) return ysize def scaleset(self, ratio): @@ -1001,13 +1118,16 @@ class SchedDisplay(Canvas): midpoint = xstart + ((xend - xstart) / 2) self.ratio = ratio - self.configure(scrollregion=(0, 0, self.xsize(), self.ysize())) + self.updatescroll() self.scale("all", 0, 0, float(oldratio) / ratio, 1) xstart, xend = self.xview() xsize = (xend - xstart) / 2 self.xview_moveto(midpoint - xsize) + def updatescroll(self): + self.configure(scrollregion=(0, 0, self.xsize(), self.ysize())) + def scaleget(self): return self.ratio @@ -1032,6 +1152,8 @@ class GraphMenu(Frame): command=self.econf) self.viewmenu.add_command(label="CPU Colors", command=self.cconf) + self.viewmenu.add_command(label="Source Configure", + command=self.sconf) self.view["menu"] = self.viewmenu self.view.pack(side=LEFT) @@ -1041,6 +1163,9 @@ class GraphMenu(Frame): def cconf(self): ColorConfigure(cpucolors, "CPU Background Colors") + def sconf(self): + SourceConfigure() + class SchedGraph(Frame): def __init__(self, master): @@ -1162,11 +1287,55 @@ class SchedGraph(Frame): source1.movename(self.names, 0, y1targ - y1) source2.movename(self.names, 0, y2targ - y2) + def sourceshow(self, source): + if (source.hidden == 0): + return; + prev = None + for s in sources: + if (s == source): + break + if (s.hidden == 0): + prev = s + if (prev == None): + newy = 0 + else: + newy = self.sourcestart(prev) + self.sourcesize(prev) + self.sourceshiftall(newy-1, self.sourcesize(source)) + off = newy - self.sourcestart(source) + self.sourceshift(source, off) + source.hidden = 0 + + def sourcehide(self, source): + # Move it out of the visible area + off = len(sources) * 100 + start = self.sourcestart(source) + self.sourceshift(source, off) + self.sourceshiftall(start, -self.sourcesize(source)) + source.hidden = 1 + + def sourceshift(self, source, off): + start = self.sourcestart(source) + source.move(self.display, 0, off) + source.movename(self.names, 0, off) + self.names.moveline(start, off); + self.display.moveline(start, off) + + def sourceshiftall(self, start, off): + for source in sources: + nstart = self.sourcestart(source) + if (nstart < start): + continue; + self.sourceshift(source, off) + self.names.updatescroll() + self.display.updatescroll() + def sourceat(self, ypos): (start, end) = self.names.yview() starty = start * float(self.names.ysize) ypos += starty for source in sources: + if (source.hidden == 1): + continue; yend = self.sourceend(source) ystart = self.sourcestart(source) if (ypos >= ystart and ypos <= yend): From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 11:28:20 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AFBC1065673; Sat, 17 Jan 2009 11:28:20 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 49E3E8FC16; Sat, 17 Jan 2009 11:28:19 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id BD52B9CB07F; Sat, 17 Jan 2009 12:27:56 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2upusQmet2j0; Sat, 17 Jan 2009 12:27:45 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 063579CB08D; Sat, 17 Jan 2009 12:27:45 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id n0HBRil0061928; Sat, 17 Jan 2009 12:27:44 +0100 (CET) (envelope-from rdivacky) Date: Sat, 17 Jan 2009 12:27:44 +0100 From: Roman Divacky To: Stanislav Sedov Message-ID: <20090117112744.GA60849@freebsd.org> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090117142021.92d5a40b.stas@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 11:28:21 -0000 On Sat, Jan 17, 2009 at 02:20:21PM +0300, Stanislav Sedov wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Fri, 16 Jan 2009 15:47:35 +0000 (UTC) > Ed Schouten mentioned: > > > Author: ed > > Date: Fri Jan 16 15:47:35 2009 > > New Revision: 187332 > > URL: http://svn.freebsd.org/changeset/base/187332 > > > > Log: > > Allow jot(1) regression tests to be checked out on Windows filesystems. > > > > The jot(1) regression tests directory contained two tests named `wx' and > > `wX', which doesn't work on case insensitive filesystems. Rename `wX' to > > `wX1'. > > > > MFC after: 1 month > > > > Was this discussed somewhere? I don't understand why we should restrict our > filesystem naming because of limitation of auxilary filesystems. There're > even more restrictive filesystems available, we couldn't support them all. > While previous modifications looked harmless this one seems questionable to me. > > I understand, this is a bikesched, but I really don't see a reason. You can't > build FreeBSD on windows anyway. otoh I can easily imagine that someone wants to read the code on a windows machine... From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 11:35:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 446181065672 for ; Sat, 17 Jan 2009 11:35:44 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id EAA278FC13 for ; Sat, 17 Jan 2009 11:35:43 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id A616D8FC4F for ; Sat, 17 Jan 2009 14:20:26 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id E03368FC18; Sat, 17 Jan 2009 14:20:24 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 511AB398F3; Sat, 17 Jan 2009 14:20:26 +0300 (MSK) Date: Sat, 17 Jan 2009 14:20:21 +0300 From: Stanislav Sedov To: Ed Schouten Message-Id: <20090117142021.92d5a40b.stas@FreeBSD.org> In-Reply-To: <200901161547.n0GFlZ4C012008@svn.freebsd.org> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Sat Jan 17 14:20:26 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4971befa967004489172415 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 11:35:44 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, 16 Jan 2009 15:47:35 +0000 (UTC) Ed Schouten mentioned: > Author: ed > Date: Fri Jan 16 15:47:35 2009 > New Revision: 187332 > URL: http://svn.freebsd.org/changeset/base/187332 > > Log: > Allow jot(1) regression tests to be checked out on Windows filesystems. > > The jot(1) regression tests directory contained two tests named `wx' and > `wX', which doesn't work on case insensitive filesystems. Rename `wX' to > `wX1'. > > MFC after: 1 month > Was this discussed somewhere? I don't understand why we should restrict our filesystem naming because of limitation of auxilary filesystems. There're even more restrictive filesystems available, we couldn't support them all. While previous modifications looked harmless this one seems questionable to me. I understand, this is a bikesched, but I really don't see a reason. You can't build FreeBSD on windows anyway. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAklxvvoACgkQK/VZk+smlYGqywCcDmGbwCrgncro/6Rd515cmS/8 mw0An2HdXLIpeVOiLRCKC+Z1X3K7OrmL =zkij -----END PGP SIGNATURE----- !DSPAM:4971befa967004489172415! From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 11:57:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC692106564A; Sat, 17 Jan 2009 11:57:32 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB8178FC25; Sat, 17 Jan 2009 11:57:32 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HBvWt6042179; Sat, 17 Jan 2009 11:57:32 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HBvW4K042178; Sat, 17 Jan 2009 11:57:32 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200901171157.n0HBvW4K042178@svn.freebsd.org> From: Poul-Henning Kamp Date: Sat, 17 Jan 2009 11:57: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: r187360 - head/sbin/recoverdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 11:57:33 -0000 Author: phk Date: Sat Jan 17 11:57:32 2009 New Revision: 187360 URL: http://svn.freebsd.org/changeset/base/187360 Log: Bail on ENXIO, you won't get any further any way. Submitted by: tobez Modified: head/sbin/recoverdisk/recoverdisk.c Modified: head/sbin/recoverdisk/recoverdisk.c ============================================================================== --- head/sbin/recoverdisk/recoverdisk.c Sat Jan 17 11:19:15 2009 (r187359) +++ head/sbin/recoverdisk/recoverdisk.c Sat Jan 17 11:57:32 2009 (r187360) @@ -276,7 +276,10 @@ main(int argc, char * const argv[]) lp->len -= i; continue; } - printf("\n%jd %zu failed %d\n", lp->start, i, errno); + printf("\n%jd %zu failed (%s)\n", + lp->start, i, strerror(errno)); + if (errno == ENXIO) + aborting = 1; new_lump(lp->start, i, lp->state + 1); lp->start += i; lp->len -= i; From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 12:52:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BDF61065670; Sat, 17 Jan 2009 12:52:40 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id CA53A8FC2C; Sat, 17 Jan 2009 12:52:39 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 525CC6D43F; Sat, 17 Jan 2009 12:52:38 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 2A2FB844C6; Sat, 17 Jan 2009 13:52:38 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Stanislav Sedov References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> Date: Sat, 17 Jan 2009 13:52:38 +0100 In-Reply-To: <20090117142021.92d5a40b.stas@FreeBSD.org> (Stanislav Sedov's message of "Sat, 17 Jan 2009 14:20:21 +0300") Message-ID: <86ab9q14dl.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 12:52:40 -0000 Stanislav Sedov writes: > Was this discussed somewhere? I don't understand why we should > restrict our filesystem naming because of limitation of auxilary > filesystems. Yes. We've already renamed files that had : in their names. This is not just for Windows's sake, BTW: Apple's HFS and MacOS Extended file systems are case retentive but not case sensitive. We should restrict filenames in the source tree (and in the installed system) to the POSIX portable filename character set ([A-Za-z0-9._-] in the C/POSIX locale) and avoid gratuitously long names. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 13:34:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F466106564A; Sat, 17 Jan 2009 13:34:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E0B88FC08; Sat, 17 Jan 2009 13:34:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HDYu4D043945; Sat, 17 Jan 2009 13:34:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HDYueW043944; Sat, 17 Jan 2009 13:34:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200901171334.n0HDYueW043944@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 17 Jan 2009 13:34: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: r187361 - head/usr.bin/fetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 13:34:57 -0000 Author: des Date: Sat Jan 17 13:34:56 2009 New Revision: 187361 URL: http://svn.freebsd.org/changeset/base/187361 Log: The FTP_TIMEOUT and HTTP_TIMEOUT environment variables were ignored because T_secs already had a non-zero default. Unbreak by moving the default to ftp_timeout / http_timeout. Submitted by: Christoph Mallon MFC after: 2 weeks Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Sat Jan 17 11:57:32 2009 (r187360) +++ head/usr.bin/fetch/fetch.c Sat Jan 17 13:34:56 2009 (r187361) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #define MINBUFSIZE 4096 +#define TIMEOUT 120 /* Option flags */ int A_flag; /* -A: do not follow 302 redirects */ @@ -75,7 +76,7 @@ int R_flag; /* -R: don't delete part int r_flag; /* -r: restart previously interrupted transfer */ off_t S_size; /* -S: require size to match */ int s_flag; /* -s: show size, don't fetch */ -long T_secs = 120; /* -T: transfer timeout in seconds */ +long T_secs; /* -T: transfer timeout in seconds */ int t_flag; /*! -t: workaround TCP bug */ int U_flag; /* -U: do not use high ports */ int v_level = 1; /* -v: verbosity level */ @@ -88,8 +89,8 @@ int sigalrm; /* SIGALRM received */ int siginfo; /* SIGINFO received */ int sigint; /* SIGINT received */ -long ftp_timeout; /* default timeout for FTP transfers */ -long http_timeout; /* default timeout for HTTP transfers */ +long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ +long http_timeout = TIMEOUT; /* default timeout for HTTP transfers */ char *buf; /* transfer buffer */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 14:00:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CD0F106564A; Sat, 17 Jan 2009 14:00:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 070718FC1A; Sat, 17 Jan 2009 14:00:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6D22046B45; Sat, 17 Jan 2009 09:00:55 -0500 (EST) Date: Sat, 17 Jan 2009 14:00:55 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Stanislav Sedov In-Reply-To: <20090117142021.92d5a40b.stas@FreeBSD.org> Message-ID: References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) 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, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 14:00:56 -0000 On Sat, 17 Jan 2009, Stanislav Sedov wrote: > Was this discussed somewhere? I don't understand why we should restrict our > filesystem naming because of limitation of auxilary filesystems. There're > even more restrictive filesystems available, we couldn't support them all. > While previous modifications looked harmless this one seems questionable to > me. > > I understand, this is a bikesched, but I really don't see a reason. You > can't build FreeBSD on windows anyway. Many of us would *very* much like to be able to cross-build FreeBSD from both Windows and Mac OS X, which would be highly desirable for embedded systems and appliance shops. The first obstacle to making that work is that you can't even check out our source code correctly on those platforms, so fixing that is an important priority so that the remainder can be worked on. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 14:31:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D40A1065670; Sat, 17 Jan 2009 14:31:42 +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 3A6538FC0A; Sat, 17 Jan 2009 14:31:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HEVflM044972; Sat, 17 Jan 2009 14:31:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HEVfcI044971; Sat, 17 Jan 2009 14:31:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901171431.n0HEVfcI044971@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Jan 2009 14:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187362 - in stable/7/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 14:31:43 -0000 Author: kib Date: Sat Jan 17 14:31:41 2009 New Revision: 187362 URL: http://svn.freebsd.org/changeset/base/187362 Log: MFC r186276: Do not return success and doomed vnode from lookup. LK_UPGRADE allows the vnode to be reclaimed. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/vfs_lookup.c Modified: stable/7/sys/kern/vfs_lookup.c ============================================================================== --- stable/7/sys/kern/vfs_lookup.c Sat Jan 17 13:34:56 2009 (r187361) +++ stable/7/sys/kern/vfs_lookup.c Sat Jan 17 14:31:41 2009 (r187362) @@ -779,6 +779,10 @@ success: if ((cnp->cn_flags & (ISLASTCN | LOCKSHARED | LOCKLEAF)) == (ISLASTCN | LOCKLEAF) && VOP_ISLOCKED(dp, td) != LK_EXCLUSIVE) { vn_lock(dp, LK_UPGRADE | LK_RETRY, td); + if (dp->v_iflag & VI_DOOMED) { + error = ENOENT; + goto bad2; + } } if (vfslocked && dvfslocked) VFS_UNLOCK_GIANT(dvfslocked); /* Only need one */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 14:37:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E2AB106566B; Sat, 17 Jan 2009 14:37:55 +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 2B38F8FC0C; Sat, 17 Jan 2009 14:37:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HEbtxw045192; Sat, 17 Jan 2009 14:37:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HEbtXM045191; Sat, 17 Jan 2009 14:37:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901171437.n0HEbtXM045191@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Jan 2009 14:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187363 - in stable/7/sys: . contrib/pf dev/cxgb ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 14:37:56 -0000 Author: kib Date: Sat Jan 17 14:37:54 2009 New Revision: 187363 URL: http://svn.freebsd.org/changeset/base/187363 Log: MFC r186278: Do not busy twice the mount point where a quota operation is performed. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/ufs/ufs/ufs_vfsops.c Modified: stable/7/sys/ufs/ufs/ufs_vfsops.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_vfsops.c Sat Jan 17 14:31:41 2009 (r187362) +++ stable/7/sys/ufs/ufs/ufs_vfsops.c Sat Jan 17 14:37:54 2009 (r187363) @@ -118,9 +118,6 @@ ufs_quotactl(mp, cmds, id, arg, td) if ((u_int)type >= MAXQUOTAS) return (EINVAL); - if (vfs_busy(mp, LK_NOWAIT, 0, td)) - return (0); - switch (cmd) { case Q_QUOTAON: error = quotaon(td, mp, type, arg); @@ -150,7 +147,6 @@ ufs_quotactl(mp, cmds, id, arg, td) error = EINVAL; break; } - vfs_unbusy(mp, td); return (error); #endif } From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 14:45:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF1B81065676; Sat, 17 Jan 2009 14:45:07 +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 C20E68FC1C; Sat, 17 Jan 2009 14:45:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HEj7Xx045373; Sat, 17 Jan 2009 14:45:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HEj7pa045370; Sat, 17 Jan 2009 14:45:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901171445.n0HEj7pa045370@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 17 Jan 2009 14:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187364 - in stable/7/sys: . contrib/pf dev/cxgb kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 14:45:08 -0000 Author: kib Date: Sat Jan 17 14:45:07 2009 New Revision: 187364 URL: http://svn.freebsd.org/changeset/base/187364 Log: MFC r186719: Extend the struct vm_page wire_count to u_int to avoid the overflow of the counter, that may happen when too many sendfile(2) calls are being executed with this vnode. To keep the size of the struct vm_page and offsets of the fields accessed by out-of-tree modules, swap the types and locations of the wire_count and cow fields. Add safety checks to detect cow overflow and force fallback to the normal copy code for zero-copy sockets. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/uipc_cow.c stable/7/sys/vm/vm_page.c stable/7/sys/vm/vm_page.h Modified: stable/7/sys/kern/uipc_cow.c ============================================================================== --- stable/7/sys/kern/uipc_cow.c Sat Jan 17 14:37:54 2009 (r187363) +++ stable/7/sys/kern/uipc_cow.c Sat Jan 17 14:45:07 2009 (r187364) @@ -129,7 +129,11 @@ socow_setup(struct mbuf *m0, struct uio * set up COW */ vm_page_lock_queues(); - vm_page_cowsetup(pp); + if (vm_page_cowsetup(pp) != 0) { + vm_page_unhold(pp); + vm_page_unlock_queues(); + return (0); + } /* * wire the page for I/O Modified: stable/7/sys/vm/vm_page.c ============================================================================== --- stable/7/sys/vm/vm_page.c Sat Jan 17 14:37:54 2009 (r187363) +++ stable/7/sys/vm/vm_page.c Sat Jan 17 14:45:07 2009 (r187364) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2003,13 +2004,16 @@ vm_page_cowclear(vm_page_t m) */ } -void +int vm_page_cowsetup(vm_page_t m) { mtx_assert(&vm_page_queue_mtx, MA_OWNED); + if (m->cow == USHRT_MAX - 1) + return (EBUSY); m->cow++; pmap_remove_write(m); + return (0); } #include "opt_ddb.h" Modified: stable/7/sys/vm/vm_page.h ============================================================================== --- stable/7/sys/vm/vm_page.h Sat Jan 17 14:37:54 2009 (r187363) +++ stable/7/sys/vm/vm_page.h Sat Jan 17 14:45:07 2009 (r187364) @@ -111,12 +111,12 @@ struct vm_page { vm_paddr_t phys_addr; /* physical address of page */ struct md_page md; /* machine dependant stuff */ uint8_t queue; /* page queue index */ - int8_t segind; + int8_t segind; u_short flags; /* see below */ uint8_t order; /* index of the buddy queue */ uint8_t pool; - u_short wire_count; /* wired down maps refs (P) */ - u_int cow; /* page cow mapping count */ + u_short cow; /* page cow mapping count */ + u_int wire_count; /* wired down maps refs (P) */ short hold_count; /* page hold count */ u_short oflags; /* page flags (O) */ u_char act_count; /* page usage count */ @@ -346,7 +346,7 @@ void vm_page_zero_invalid(vm_page_t m, b void vm_page_free_toq(vm_page_t m); void vm_page_zero_idle_wakeup(void); void vm_page_cowfault (vm_page_t); -void vm_page_cowsetup (vm_page_t); +int vm_page_cowsetup(vm_page_t); void vm_page_cowclear (vm_page_t); /* From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 14:52:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34E561065670; Sat, 17 Jan 2009 14:52:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E37D58FC14; Sat, 17 Jan 2009 14:52:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HEqQQC045547; Sat, 17 Jan 2009 14:52:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HEqQv0045546; Sat, 17 Jan 2009 14:52:26 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200901171452.n0HEqQv0045546@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 17 Jan 2009 14:52: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: r187365 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 14:52:27 -0000 Author: bz Date: Sat Jan 17 14:52:26 2009 New Revision: 187365 URL: http://svn.freebsd.org/changeset/base/187365 Log: s,unmount 8,umount 8, it is unmount(2) which I did not mean. Submitted by: pluknet@gmail.com MFC after: 1 week Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sat Jan 17 14:45:07 2009 (r187364) +++ head/usr.sbin/jail/jail.8 Sat Jan 17 14:52:26 2009 (r187365) @@ -484,7 +484,7 @@ or: It is not possible to .Xr mount 8 or -.Xr unmount 8 +.Xr umount 8 any file system inside a jail unless the file system is marked jail-friendly. See @@ -657,7 +657,7 @@ and .Xr shutdown 8 , .Xr sysctl 8 , .Xr syslogd 8 , -.Xr unmount 8 +.Xr umount 8 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 15:56:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AB5E106566B; Sat, 17 Jan 2009 15:56:39 +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 3E1C68FC0A; Sat, 17 Jan 2009 15:56:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HFud2A046719; Sat, 17 Jan 2009 15:56:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HFudKj046718; Sat, 17 Jan 2009 15:56:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901171556.n0HFudKj046718@svn.freebsd.org> From: Ed Schouten Date: Sat, 17 Jan 2009 15:56: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: r187366 - head/libexec/comsat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 15:56:39 -0000 Author: ed Date: Sat Jan 17 15:56:38 2009 New Revision: 187366 URL: http://svn.freebsd.org/changeset/base/187366 Log: Fix handling of pts(4) device names in comsat(8). Also catch fork() errors. Pseudo-terminals allocated with posix_openpt(2) will have more slashes in their path names than comsat(8) allows, so allow slashes when the character device name starts with "pts/". This patch is loosely based on NetBSD's changes, revision 1.33. Because it also included the changes to fork(), I imported them here as well. Maybe we could import even more fixes from the other BSD's? Original commit message from the NetBSD folks: PR/30170: Markus W Kilbinger: src/libexec/comsat complains about: '/' in "/dev/pts/1" Reported by: Robert Huff Modified: head/libexec/comsat/comsat.c Modified: head/libexec/comsat/comsat.c ============================================================================== --- head/libexec/comsat/comsat.c Sat Jan 17 14:52:26 2009 (r187365) +++ head/libexec/comsat/comsat.c Sat Jan 17 15:56:38 2009 (r187366) @@ -203,21 +203,32 @@ notify(struct utmp *utp, char file[], of struct stat stb; struct termios tio; char tty[20], name[sizeof(utmp[0].ut_name) + 1]; + const char *cr = utp->ut_line; - (void)snprintf(tty, sizeof(tty), "%s%.*s", - _PATH_DEV, (int)sizeof(utp->ut_line), utp->ut_line); - if (strchr(tty + sizeof(_PATH_DEV) - 1, '/')) { + if (strncmp(cr, "pts/", 4) == 0) + cr += 4; + if (strchr(cr, '/')) { /* A slash is an attempt to break security... */ - syslog(LOG_AUTH | LOG_NOTICE, "'/' in \"%s\"", tty); + syslog(LOG_AUTH | LOG_NOTICE, "Unexpected `/' in `%s'", + utp->ut_line); return; } - if (stat(tty, &stb) || !(stb.st_mode & (S_IXUSR | S_IXGRP))) { + (void)snprintf(tty, sizeof(tty), "%s%.*s", + _PATH_DEV, (int)sizeof(utp->ut_line), utp->ut_line); + if (stat(tty, &stb) == -1 || !(stb.st_mode & (S_IXUSR | S_IXGRP))) { dsyslog(LOG_DEBUG, "%s: wrong mode on %s", utp->ut_name, tty); return; } dsyslog(LOG_DEBUG, "notify %s on %s\n", utp->ut_name, tty); - if (fork()) + switch (fork()) { + case -1: + syslog(LOG_NOTICE, "fork failed (%m)"); return; + case 0: + break; + default: + return; + } (void)signal(SIGALRM, SIG_DFL); (void)alarm((u_int)30); if ((tp = fopen(tty, "w")) == NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 15:58:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68818106566B for ; Sat, 17 Jan 2009 15:58:21 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [78.110.53.255]) by mx1.freebsd.org (Postfix) with ESMTP id 134D88FC1A for ; Sat, 17 Jan 2009 15:58:21 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 4F0118FC51 for ; Sat, 17 Jan 2009 18:58:07 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id D30688FC18; Sat, 17 Jan 2009 18:58:04 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 2A4B03996C; Sat, 17 Jan 2009 18:58:06 +0300 (MSK) Date: Sat, 17 Jan 2009 18:58:01 +0300 From: Stanislav Sedov To: Robert Watson Message-Id: <20090117185801.fcce79e9.stas@FreeBSD.org> In-Reply-To: References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Sat Jan 17 18:58:07 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4972000f967001470720348 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 15:58:21 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 17 Jan 2009 14:00:55 +0000 (GMT) Robert Watson mentioned: > > On Sat, 17 Jan 2009, Stanislav Sedov wrote: > > > Was this discussed somewhere? I don't understand why we should restrict our > > filesystem naming because of limitation of auxilary filesystems. There're > > even more restrictive filesystems available, we couldn't support them all. > > While previous modifications looked harmless this one seems questionable to > > me. > > > > I understand, this is a bikesched, but I really don't see a reason. You > > can't build FreeBSD on windows anyway. > > Many of us would *very* much like to be able to cross-build FreeBSD from both > Windows and Mac OS X, which would be highly desirable for embedded systems and > appliance shops. The first obstacle to making that work is that you can't > even check out our source code correctly on those platforms, so fixing that is > an important priority so that the remainder can be worked on. > I think this should be rather worked out in these platforms themselves (e.g. by renaming files in the checkout files, and so on) withouth trashing our tree. While some changes could be understandable, the one I've replied completely broked heirarchy of jot regressions tests: before the names of files were coreesponding to the options used in the test, now you can't say exactly what options used by looking at the filename. This looks like a gratitous change and regression to me. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAklyAA4ACgkQK/VZk+smlYEY+gCdH99dsZT2acDJl6jgdp16ht2J 94wAn1sMkHUbi+oglF2wlVhoPnCbsuuA =LWcn -----END PGP SIGNATURE----- !DSPAM:4972000f967001470720348! From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 16:00:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47226106566B for ; Sat, 17 Jan 2009 16:00:33 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [78.110.53.255]) by mx1.freebsd.org (Postfix) with ESMTP id E69A68FC13 for ; Sat, 17 Jan 2009 16:00:32 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 2A3E98FC58 for ; Sat, 17 Jan 2009 19:00:19 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id BE42D8FC18; Sat, 17 Jan 2009 19:00:14 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id E9F9F3996C; Sat, 17 Jan 2009 19:00:15 +0300 (MSK) Date: Sat, 17 Jan 2009 19:00:15 +0300 From: Stanislav Sedov To: Dag-Erling =?UTF-8?B?U23DuHJncmF2?= Message-Id: <20090117190015.8209032d.stas@FreeBSD.org> In-Reply-To: <86ab9q14dl.fsf@ds4.des.no> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <86ab9q14dl.fsf@ds4.des.no> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Sat Jan 17 19:00:18 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 49720092967001229610785 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 16:00:33 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 17 Jan 2009 13:52:38 +0100 Dag-Erling Smørgrav mentioned: > Stanislav Sedov writes: > > Was this discussed somewhere? I don't understand why we should > > restrict our filesystem naming because of limitation of auxilary > > filesystems. > > Yes. We've already renamed files that had : in their names. > > This is not just for Windows's sake, BTW: Apple's HFS and MacOS Extended > file systems are case retentive but not case sensitive. > > We should restrict filenames in the source tree (and in the installed > system) to the POSIX portable filename character set ([A-Za-z0-9._-] in > the C/POSIX locale) and avoid gratuitously long names. > A agree that names should be reasonable, that's exactly my point here. Renaming wX to wx1 doesn't look reasonable to me, given the names of files corresponds to the options used in the test. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAklyAI8ACgkQK/VZk+smlYHTWACeKBnfvdJ8wbgWwj5oUQMBxQcc 9LEAnjxE2fILzl/nvsMfIys+82PL5owV =NOf1 -----END PGP SIGNATURE----- !DSPAM:49720092967001229610785! From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 16:37:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8F0F106564A; Sat, 17 Jan 2009 16:37:14 +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 A62318FC19; Sat, 17 Jan 2009 16:37:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HGbE8h047475; Sat, 17 Jan 2009 16:37:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HGbEGv047470; Sat, 17 Jan 2009 16:37:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901171637.n0HGbEGv047470@svn.freebsd.org> From: Ed Schouten Date: Sat, 17 Jan 2009 16:37: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: r187367 - in head/sys: conf dev/syscons/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 16:37:15 -0000 Author: ed Date: Sat Jan 17 16:37:13 2009 New Revision: 187367 URL: http://svn.freebsd.org/changeset/base/187367 Log: Allow experimental libteken features to be tested without changing code. The teken library already supports UTF-8 handling and xterm emulation, but we have reasons to disable this right now. Because we should make it easy and interesting for people to experiment with these features, allow them to be set in kernel configuration files. Before this commit we had a flag called `TEKEN_CONS25' to enable cons25-style emulation. I'm calling it the opposite now, `TEKEN_XTERM', because we want to enable it in kernel configuration files explicitly. Requested by: kib Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/syscons/teken/teken.c head/sys/dev/syscons/teken/teken.h head/sys/dev/syscons/teken/teken_demo.c head/sys/dev/syscons/teken/teken_subr.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Jan 17 15:56:38 2009 (r187366) +++ head/sys/conf/NOTES Sat Jan 17 16:37:13 2009 (r187367) @@ -1370,6 +1370,10 @@ options SC_NO_SUSPEND_VTYSWITCH # 0x80 Put the video card in the VESA 800x600 dots, 16 color mode # 0x100 Probe for a keyboard device periodically if one is not present +# Enable experimental features of the syscons terminal emulator (teken). +options TEKEN_UTF8 # UTF-8 output handling +options TEKEN_XTERM # xterm-style terminal emulation + # # Optional devices: # Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Jan 17 15:56:38 2009 (r187366) +++ head/sys/conf/options Sat Jan 17 16:37:13 2009 (r187367) @@ -726,6 +726,10 @@ SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_TWOBUTTON_MOUSE opt_syscons.h +# teken terminal emulator options +TEKEN_UTF8 opt_teken.h +TEKEN_XTERM opt_teken.h + # options for printf PRINTF_BUFR_SIZE opt_printf.h Modified: head/sys/dev/syscons/teken/teken.c ============================================================================== --- head/sys/dev/syscons/teken/teken.c Sat Jan 17 15:56:38 2009 (r187366) +++ head/sys/dev/syscons/teken/teken.c Sat Jan 17 16:37:13 2009 (r187367) @@ -56,11 +56,11 @@ static inline int teken_wcwidth(teken_char_t c __unused) { -#ifdef TEKEN_CONS25 - return (1); -#else /* !TEKEN_CONS25 */ +#ifdef TEKEN_XTERM return (c <= 0x1B) ? -1 : 1; -#endif /* TEKEN_CONS25 */ +#else /* !TEKEN_XTERM */ + return (1); +#endif /* TEKEN_XTERM */ } #endif /* TEKEN_UTF8 */ @@ -72,11 +72,11 @@ teken_wcwidth(teken_char_t c __unused) #define TS_INSERT 0x02 /* Insert mode. */ #define TS_AUTOWRAP 0x04 /* Autowrap. */ #define TS_ORIGIN 0x08 /* Origin mode. */ -#ifdef TEKEN_CONS25 -#define TS_WRAPPED 0x00 /* Simple line wrapping. */ -#else /* !TEKEN_CONS25 */ +#ifdef TEKEN_XTERM #define TS_WRAPPED 0x10 /* Next character should be printed on col 0. */ -#endif /* TEKEN_CONS25 */ +#else /* !TEKEN_XTERM */ +#define TS_WRAPPED 0x00 /* Simple line wrapping. */ +#endif /* TEKEN_XTERM */ /* Character that blanks a cell. */ #define BLANK ' ' Modified: head/sys/dev/syscons/teken/teken.h ============================================================================== --- head/sys/dev/syscons/teken/teken.h Sat Jan 17 15:56:38 2009 (r187366) +++ head/sys/dev/syscons/teken/teken.h Sat Jan 17 16:37:13 2009 (r187367) @@ -33,18 +33,16 @@ * libteken: terminal emulation library. * * This library converts an UTF-8 stream of bytes to terminal drawing - * commands. It implements commands similar to xterm-color. + * commands. + * + * Configuration switches: + * - TEKEN_UTF8: Enable/disable UTF-8 handling. + * - TEKEN_XTERM: Enable xterm-style emulation, instead of cons25. */ -#if 0 -/* - * XXX: Disable UTF-8 support for now. It requires UTF-8 keyboard input - * and rendering, which we do not yet support. - */ -#define TEKEN_UTF8 -#endif -/* Emulate cons25-like behaviour. */ -#define TEKEN_CONS25 +#if defined(__FreeBSD__) && defined(_KERNEL) +#include "opt_teken.h" +#endif /* __FreeBSD__ && _KERNEL */ #ifdef TEKEN_UTF8 typedef uint32_t teken_char_t; Modified: head/sys/dev/syscons/teken/teken_demo.c ============================================================================== --- head/sys/dev/syscons/teken/teken_demo.c Sat Jan 17 15:56:38 2009 (r187366) +++ head/sys/dev/syscons/teken/teken_demo.c Sat Jan 17 16:37:13 2009 (r187367) @@ -279,11 +279,11 @@ main(int argc __unused, char *argv[] __u perror("forkpty"); exit(1); case 0: -#ifdef TEKEN_CONS25 - setenv("TERM", "cons25", 1); -#else /* !TEKEN_CONS25 */ +#ifdef TEKEN_XTERM setenv("TERM", "xterm", 1); -#endif /* TEKEN_CONS25 */ +#else /* !TEKEN_XTERM */ + setenv("TERM", "cons25", 1); +#endif /* TEKEN_XTERM */ #ifdef TEKEN_UTF8 setenv("LC_CTYPE", "UTF-8", 0); #endif /* TEKEN_UTF8 */ Modified: head/sys/dev/syscons/teken/teken_subr.h ============================================================================== --- head/sys/dev/syscons/teken/teken_subr.h Sat Jan 17 15:56:38 2009 (r187366) +++ head/sys/dev/syscons/teken/teken_subr.h Sat Jan 17 16:37:13 2009 (r187367) @@ -198,7 +198,13 @@ static void teken_subr_backspace(teken_t *t) { -#ifdef TEKEN_CONS25 +#ifdef TEKEN_XTERM + if (t->t_cursor.tp_col == 0) + return; + + t->t_cursor.tp_col--; + t->t_stateflags &= ~TS_WRAPPED; +#else /* !TEKEN_XTERM */ if (t->t_cursor.tp_col == 0) { if (t->t_cursor.tp_row == t->t_originreg.ts_begin) return; @@ -207,13 +213,7 @@ teken_subr_backspace(teken_t *t) } else { t->t_cursor.tp_col--; } -#else /* !TEKEN_CONS25 */ - if (t->t_cursor.tp_col == 0) - return; - - t->t_cursor.tp_col--; - t->t_stateflags &= ~TS_WRAPPED; -#endif /* TEKEN_CONS25 */ +#endif /* TEKEN_XTERM */ teken_funcs_cursor(t); } @@ -542,10 +542,7 @@ teken_subr_horizontal_position_absolute( static void teken_subr_horizontal_tab(teken_t *t) { -#ifdef TEKEN_CONS25 - - teken_subr_cursor_forward_tabulation(t, 1); -#else /* !TEKEN_CONS25 */ +#ifdef TEKEN_XTERM teken_rect_t tr; tr.tr_begin = t->t_cursor; @@ -556,7 +553,10 @@ teken_subr_horizontal_tab(teken_t *t) /* Blank region that we skipped. */ if (tr.tr_end.tp_col > tr.tr_begin.tp_col) teken_funcs_fill(t, &tr, BLANK, &t->t_curattr); -#endif /* TEKEN_CONS25 */ +#else /* !TEKEN_XTERM */ + + teken_subr_cursor_forward_tabulation(t, 1); +#endif /* TEKEN_XTERM */ } static void @@ -664,7 +664,10 @@ teken_subr_newline(teken_t *t) static void teken_subr_newpage(teken_t *t) { -#ifdef TEKEN_CONS25 +#ifdef TEKEN_XTERM + + teken_subr_newline(t); +#else /* !TEKEN_XTERM */ teken_rect_t tr; tr.tr_begin.tp_row = tr.tr_begin.tp_col = 0; @@ -673,10 +676,7 @@ teken_subr_newpage(teken_t *t) t->t_cursor.tp_row = t->t_cursor.tp_col = 0; teken_funcs_cursor(t); -#else /* !TEKEN_CONS25 */ - - teken_subr_newline(t); -#endif /* TEKEN_CONS25 */ +#endif /* TEKEN_XTERM */ } static void @@ -746,22 +746,7 @@ teken_subr_regular_character(teken_t *t, if (width <= 0) return; -#ifdef TEKEN_CONS25 - teken_subr_do_putchar(t, &t->t_cursor, c, width); - t->t_cursor.tp_col += width; - - if (t->t_cursor.tp_col >= t->t_winsize.tp_col) { - if (t->t_cursor.tp_row == t->t_scrollreg.ts_end - 1) { - /* Perform scrolling. */ - teken_subr_do_scroll(t, 1); - } else { - /* No scrolling needed. */ - if (t->t_cursor.tp_row < t->t_winsize.tp_row - 1) - t->t_cursor.tp_row++; - } - t->t_cursor.tp_col = 0; - } -#else /* !TEKEN_CONS25 */ +#ifdef TEKEN_XTERM if (t->t_cursor.tp_col == t->t_winsize.tp_col - 1 && (t->t_stateflags & (TS_WRAPPED|TS_AUTOWRAP)) == (TS_WRAPPED|TS_AUTOWRAP)) { @@ -806,7 +791,22 @@ teken_subr_regular_character(teken_t *t, t->t_stateflags &= ~TS_WRAPPED; } } -#endif /* TEKEN_CONS25 */ +#else /* !TEKEN_XTERM */ + teken_subr_do_putchar(t, &t->t_cursor, c, width); + t->t_cursor.tp_col += width; + + if (t->t_cursor.tp_col >= t->t_winsize.tp_col) { + if (t->t_cursor.tp_row == t->t_scrollreg.ts_end - 1) { + /* Perform scrolling. */ + teken_subr_do_scroll(t, 1); + } else { + /* No scrolling needed. */ + if (t->t_cursor.tp_row < t->t_winsize.tp_row - 1) + t->t_cursor.tp_row++; + } + t->t_cursor.tp_col = 0; + } +#endif /* TEKEN_XTERM */ teken_funcs_cursor(t); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 17:37:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62FAB106564A; Sat, 17 Jan 2009 17:37:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC598FC08; Sat, 17 Jan 2009 17:37:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id EA47C46B45; Sat, 17 Jan 2009 12:37:48 -0500 (EST) Date: Sat, 17 Jan 2009 17:37:48 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Stanislav Sedov In-Reply-To: <20090117185801.fcce79e9.stas@FreeBSD.org> Message-ID: References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <20090117185801.fcce79e9.stas@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) 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, Ed Schouten Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 17:37:49 -0000 On Sat, 17 Jan 2009, Stanislav Sedov wrote: >>> I understand, this is a bikesched, but I really don't see a reason. You >>> can't build FreeBSD on windows anyway. >> >> Many of us would *very* much like to be able to cross-build FreeBSD from >> both Windows and Mac OS X, which would be highly desirable for embedded >> systems and appliance shops. The first obstacle to making that work is >> that you can't even check out our source code correctly on those platforms, >> so fixing that is an important priority so that the remainder can be worked >> on. > > I think this should be rather worked out in these platforms themselves (e.g. > by renaming files in the checkout files, and so on) withouth trashing our > tree. While some changes could be understandable, the one I've replied > completely broked heirarchy of jot regressions tests: before the names of > files were coreesponding to the options used in the test, now you can't say > exactly what options used by looking at the filename. This looks like a > gratitous change and regression to me. I agree that breaking regression tests is bad. However, I think that requiring files to be renamed on checkout, and then presumably modifying the build infrastructure to use the modified names, etc, is much worse than changing the regression test not to rely on case-sensitive file systems. I think a reasonable goal should include allowing our source code to be distributed to and (in the long term) built on both Windows (with cygwin) and Mac OS X in an unmodified form. There are lots of obstacles between us and having that happen, but few of those will be as easy to address as tweaking filenames and regresion tests. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 17:40:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55C02106564A; Sat, 17 Jan 2009 17:40:45 +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 4405B8FC18; Sat, 17 Jan 2009 17:40:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HHej4v048676; Sat, 17 Jan 2009 17:40:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HHejIS048675; Sat, 17 Jan 2009 17:40:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901171740.n0HHejIS048675@svn.freebsd.org> From: Alexander Motin Date: Sat, 17 Jan 2009 17:40: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: r187368 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 17:40:45 -0000 Author: mav Date: Sat Jan 17 17:40:44 2009 New Revision: 187368 URL: http://svn.freebsd.org/changeset/base/187368 Log: Convert battery capacity/rate from mA to mW only when summary is requested. Unconditional conversion causes incorrect rate units reported by acpiconf. MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Sat Jan 17 16:37:13 2009 (r187367) +++ head/sys/dev/acpica/acpi_battery.c Sat Jan 17 17:40:44 2009 (r187368) @@ -197,7 +197,7 @@ acpi_battery_get_battinfo(device_t dev, * is 0 (due to some error reading the battery), skip this * conversion. */ - if (bif->units == ACPI_BIF_UNITS_MA && bif->dvol != 0) { + if (bif->units == ACPI_BIF_UNITS_MA && bif->dvol != 0 && dev == NULL) { bst[i].rate = (bst[i].rate * bif->dvol) / 1000; bst[i].cap = (bst[i].cap * bif->dvol) / 1000; bif->lfcap = (bif->lfcap * bif->dvol) / 1000; From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 18:57:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 998111065676; Sat, 17 Jan 2009 18:57:12 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 876328FC17; Sat, 17 Jan 2009 18:57:12 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HIvCGH050090; Sat, 17 Jan 2009 18:57:12 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HIvCfC050088; Sat, 17 Jan 2009 18:57:12 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901171857.n0HIvCfC050088@svn.freebsd.org> From: David Schultz Date: Sat, 17 Jan 2009 18:57: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: r187369 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 18:57:13 -0000 Author: das Date: Sat Jan 17 18:57:12 2009 New Revision: 187369 URL: http://svn.freebsd.org/changeset/base/187369 Log: When f[w]printf() is called on an unbuffered file like stdout, it sets up a fake buffered FILE and then effectively calls itself recursively. Unfortunately, gcc doesn't know how to do tail call elimination in this case, and actually makes things worse by inlining __sbprintf(). This means that f[w]printf() to stderr was allocating about 5k of stack on 64-bit platforms, much of which was never used. I've reorganized things to eliminate the waste. In addition to saving some stack space, this improves performance in my tests by anywhere from 5% to 17% (depending on the test) when -fstack-protector is enabled. I found no statistically significant performance difference when stack protection is turned off. (The tests redirected stderr to /dev/null.) Modified: head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Sat Jan 17 17:40:44 2009 (r187368) +++ head/lib/libc/stdio/vfprintf.c Sat Jan 17 18:57:12 2009 (r187369) @@ -65,7 +65,8 @@ __FBSDID("$FreeBSD$"); #include "printflocal.h" static int __sprint(FILE *, struct __suio *); -static int __sbprintf(FILE *, const char *, va_list) __printflike(2, 0); +static int __sbprintf(FILE *, const char *, va_list) __printflike(2, 0) + __noinline; static char *__wcsconv(wchar_t *, int); #define CHAR char @@ -102,6 +103,10 @@ __sbprintf(FILE *fp, const char *fmt, va FILE fake; unsigned char buf[BUFSIZ]; + /* XXX This is probably not needed. */ + if (prepwrite(fp) != 0) + return (EOF); + /* copy the important variables */ fake._flags = fp->_flags & ~__SNBF; fake._file = fp->_file; @@ -193,7 +198,12 @@ vfprintf(FILE * __restrict fp, const cha int ret; FLOCKFILE(fp); - ret = __vfprintf(fp, fmt0, ap); + /* optimise fprintf(stderr) (and other unbuffered Unix files) */ + if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && + fp->_file >= 0) + ret = __sbprintf(fp, fmt0, ap); + else + ret = __vfprintf(fp, fmt0, ap); FUNLOCKFILE(fp); return (ret); } @@ -367,11 +377,6 @@ __vfprintf(FILE *fp, const char *fmt0, v if (prepwrite(fp) != 0) return (EOF); - /* optimise fprintf(stderr) (and other unbuffered Unix files) */ - if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && - fp->_file >= 0) - return (__sbprintf(fp, fmt0, ap)); - thousands_sep = '\0'; grouping = NULL; convbuf = NULL; Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Sat Jan 17 17:40:44 2009 (r187368) +++ head/lib/libc/stdio/vfwprintf.c Sat Jan 17 18:57:12 2009 (r187369) @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); #include "printflocal.h" static int __sprint(FILE *, struct __suio *); -static int __sbprintf(FILE *, const wchar_t *, va_list); +static int __sbprintf(FILE *, const wchar_t *, va_list) __noinline; static wint_t __xfputwc(wchar_t, FILE *); static wchar_t *__mbsconv(char *, int); @@ -114,6 +114,10 @@ __sbprintf(FILE *fp, const wchar_t *fmt, FILE fake; unsigned char buf[BUFSIZ]; + /* XXX This is probably not needed. */ + if (prepwrite(fp) != 0) + return (EOF); + /* copy the important variables */ fake._flags = fp->_flags & ~__SNBF; fake._file = fp->_file; @@ -250,7 +254,12 @@ vfwprintf(FILE * __restrict fp, const wc int ret; FLOCKFILE(fp); - ret = __vfwprintf(fp, fmt0, ap); + /* optimise fprintf(stderr) (and other unbuffered Unix files) */ + if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && + fp->_file >= 0) + ret = __sbprintf(fp, fmt0, ap); + else + ret = __vfwprintf(fp, fmt0, ap); FUNLOCKFILE(fp); return (ret); } @@ -419,11 +428,6 @@ __vfwprintf(FILE *fp, const wchar_t *fmt if (prepwrite(fp) != 0) return (EOF); - /* optimise fprintf(stderr) (and other unbuffered Unix files) */ - if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && - fp->_file >= 0) - return (__sbprintf(fp, fmt0, ap)); - thousands_sep = '\0'; grouping = NULL; convbuf = NULL; From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 19:52:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12E45106564A; Sat, 17 Jan 2009 19:52:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00E398FC08; Sat, 17 Jan 2009 19:52:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HJq934051083; Sat, 17 Jan 2009 19:52:09 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HJq9Pk051082; Sat, 17 Jan 2009 19:52:09 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200901171952.n0HJq9Pk051082@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 17 Jan 2009 19:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187370 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 19:52:10 -0000 Author: stas Date: Sat Jan 17 19:52:09 2009 New Revision: 187370 URL: http://svn.freebsd.org/changeset/base/187370 Log: - Bump __FreeBSD_version after cpuctl MFC. Modified: stable/7/sys/sys/param.h Modified: stable/7/sys/sys/param.h ============================================================================== --- stable/7/sys/sys/param.h Sat Jan 17 18:57:12 2009 (r187369) +++ stable/7/sys/sys/param.h Sat Jan 17 19:52:09 2009 (r187370) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 701101 /* Master, propagated to newvers */ +#define __FreeBSD_version 701102 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 20:30:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27DEE10656DD; Sat, 17 Jan 2009 20:30:07 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14FB58FC16; Sat, 17 Jan 2009 20:30:07 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HKU783051828; Sat, 17 Jan 2009 20:30:07 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HKU7sO051826; Sat, 17 Jan 2009 20:30:07 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200901172030.n0HKU7sO051826@svn.freebsd.org> From: Poul-Henning Kamp Date: Sat, 17 Jan 2009 20:30:07 +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: r187371 - head/tools/tools/sysbuild X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 20:30:08 -0000 Author: phk Date: Sat Jan 17 20:30:06 2009 New Revision: 187371 URL: http://svn.freebsd.org/changeset/base/187371 Log: Release the evil twin of nanobsd.sh: sysbuild.sh quoth the README: I have been running -current on my laptop since before FreeBSD 2.0 was released and along the way developed this little trick to making the task easier. sysbuild.sh is a way to build a new FreeBSD system on a computer from a specification, while leaving the current installation intact. sysbuild.sh assume you have two partitions that can hold your rootfs and can be booted, and roughly speaking, all it does is build a new system into the one you don't use, from the one you do use. A partition named /freebsd is assumed to be part of your layout, and that is where the sources and ports will be found. If you know how nanobsd works, you will find a lot of similarity. Added: head/tools/tools/sysbuild/ head/tools/tools/sysbuild/README (contents, props changed) head/tools/tools/sysbuild/sysbuild.sh (contents, props changed) Added: head/tools/tools/sysbuild/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/sysbuild/README Sat Jan 17 20:30:06 2009 (r187371) @@ -0,0 +1,153 @@ +$FreeBSD$ + +About sysbuild.sh +================= + +I have been running -current on my laptop since before FreeBSD 2.0 was +released and along the way developed this little trick to making the +task easier. + +sysbuild.sh is a way to build a new FreeBSD system on a computer from +a specification, while leaving the current installation intact. + +sysbuild.sh assume you have two partitions that can hold your rootfs +and can be booted, and roughly speaking, all it does is build a new +system into the one you don't use, from the one you do use. + +A partition named /freebsd is assumed to be part of your layout, and +that is where the sources and ports will be found. + +If you know how nanobsd works, you will find a lot of similarity. + +HOWTO +===== + +In all likelyhood, it is easier if we imagine you start with a blank +computer. + +Grab a FreeBSD install ISO and boot it. + +Create four disk slices: + + ad0s1 = 5GB + ad0s2 = 5GB + ad0s3 = 5GB + ad0s4 = the rest + +Create a root filesystem in s1a filling the entire ad0s1 slice. + +Create a swap partition, if you want one, in ad0s4b. + +Install the boot0 bootmanager. + +Install the "Minimal" FreeBSD system into ad0s1a. + +Reboot from the newly installed system. + +Run these commands to set up the other partitions sysbuild.sh cares about: + + # /freebsd filesystem + newfs -b 4096 -f 512 -O2 -U /dev/ad0s3 + echo "/dev/ad0s3 /freebsd ufs rw 2 2" >> /etc/fstab + mkdir /freebsd + mount /freebsd + + # deputy rootfilesystem + bsdlabel -B -w /dev/ad0s2 + newfs -O2 -U /dev/ad0s2a + +Next, install ports and sources: + + cd /usr + rm -rf ports src + ln -s /freebsd/src + ln -s /freebsd/ports + cd /freebsd + mkdir ports src packages + + # Or use svn if you prefer + csup -h cvsup.???.freebsd.org /usr/share/examples/cvsup/ports-supfile + csup -h cvsup.???.freebsd.org /usr/share/examples/cvsup/stable-supfile + +And we should be ready to try a shot: + + cd /root + cp /usr/src/tools/tools/sysbuild/sysbuild.sh + sh sysbuild.sh |& tee _.sb + +If it succeeds, you should be able to: + + boot0cfg -s 2 -v /dev/ad0 + reboot + +And come up with your newly built system. + + Next time you want a new system, you just run sysbuild.sh again + and boot slice 1 when it's done. + +TWEAKS +====== + +The sysbuild.sh script takes various parameters: + + -c specfile # configure stuff, see below. + -w # skip buildworld, assume it was done earlier. + -k # skip buildkernel, ---//--- + -b # skip both buildworld & buildkernel + -p # install cached packacges if found. + +The specfile is a shellscript where you can override or set a number of +shell variables and functions. + +A partial example: + + # use a kernel different from GENERIC + KERNCONF=SMP + + # Cache built packages, so we can use -p + PKG_DIR=/freebsd/packages + + # Mount ports distfiles from another machine + REMOTEDISTFILES=fs:/rdonly/distfiles + + # Fetch distfiles through a proxy + FTP_PROXY=http://127.0.0.1:3128/ + HTTP_PROXY=http://127.0.0.1:3128/ + export FTP_PROXY HTTP_PROXY + + # We want these ports + PORTS_WE_WANT=' + /usr/ports/archivers/unzip + /usr/ports/archivers/zip + /usr/ports/cad/linux-eagle + /usr/ports/comms/lrzsz + /usr/ports/databases/rrdtool + /usr/ports/devel/subversion-freebsd + ' + + # Files to move over + CONFIGFILES=' + /root/.ssh + /etc/X11/xorg.conf + /etc/ssh/ssh_host* + /etc/rc.conf + /etc/rc.local + ' + + # Shell functions to tweak things + # (This makes commits to /etc mostly painless) + final_chroot() ( + chpass -p "\$1\$IgMjWs2L\$Nu12OCsjfiwHHj0I7TmUN1" root + + pw useradd phk -u 488 -d /home/phk -c "Poul-Henning Kamp" \ + -G "wheel,operator,dialer" -s /bin/csh -w none + + chpass -p "\$1\$VcM.9Ow8\$IcXHs0h9jsk27b8N64lOm/" phk + + sed -i "" -e 's/^DS/DSorigo.freebsd.dk/' /etc/mail/sendmail.cf + sed -i "" -e '/console/s/^/#/' /etc/syslog.conf + echo "beastie_disable=YES" >> /boot/loader.conf + touch /root/.hushlogin + ) + + Added: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/sysbuild/sysbuild.sh Sat Jan 17 20:30:06 2009 (r187371) @@ -0,0 +1,528 @@ +#!/bin/sh +# +# Copyright (c) 1994-2009 Poul-Henning Kamp. +# 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. +# +# $FreeBSD$ +# + +set -e + +exec < /dev/null + +if [ `uname -m` = "i386" ] ; then + TARGET_PART=`df / | sed ' + 1d + s/[ ].*// + s,/dev/,, + s,s1a,s3a, + s,s2a,s1a, + s,s3a,s2a, + '` + + # Where our build-bits are to be found + FREEBSD_PART=`echo $TARGET_PART | sed 's/s[12]a/s3/'` +else + TARGET_PART=unknown + FREEBSD_PART=unknown +fi + +# Relative to /freebsd +PORTS_PATH=ports +SRC_PATH=src +# OBJ_PATH=obj + +# Name of kernel +KERNCONF=GENERIC + +# srcconf +#SRCCONF="SRCCONF=/usr/src/src.conf" + +# -j arg to make(1) + +ncpu=`sysctl -n kern.smp.cpus` +if [ $ncpu -gt 1 ] ; then + JARG="-j $ncpu" +fi + +# serial console ? +SERCONS=false + +# Remotely mounted distfiles +# REMOTEDISTFILES=fs:/rdonly/distfiles + +# Proxy +#FTP_PROXY=http://127.0.0.1:3128/ +#HTTP_PROXY=http://127.0.0.1:3128/ +#export FTP_PROXY HTTP_PROXY + +PORTS_WE_WANT=' +' + +PORTS_OPTS="BATCH=YES MAKE_IDEA=YES A4=yes" + +CONFIGFILES=' +' + +cleanup() ( +) + +before_ports() ( +) + +before_ports_chroot() ( +) + +final_root() ( +) + +final_chroot() ( +) + +####################################################################### +####################################################################### + +usage () { + ( + echo "Usage: $0 [-b/-k/-w] [-c config_file]" + echo " -b suppress builds (both kernel and world)" + echo " -k suppress buildkernel" + echo " -w suppress buildworld" + echo " -p used cached packages" + echo " -c specify config file" + ) 1>&2 + exit 2 +} + +####################################################################### +####################################################################### + +if [ ! -f $0 ] ; then + echo "Must be able to access self ($0)" 1>&2 + exit 1 +fi + +if grep -q 'Magic String: 0`0nQT40W%l,CX&' $0 ; then + true +else + echo "self ($0) does not contain magic string" 1>&2 + exit 1 +fi + +####################################################################### + +set -e + +log_it() ( + set +x + a="$*" + set `cat /tmp/_sb_log` + TX=`date +%s` + echo "$1 $TX" > /tmp/_sb_log + DT=`expr $TX - $1 || true` + DL=`expr $TX - $2 || true` + echo -n "### `date +%H:%M:%S`" + printf " ### %5d ### %5d ### %s\n" $DT $DL "$a" +) + +####################################################################### + + +ports_recurse() ( + set +x + for d + do + if [ ! -d $d ] ; then + echo "Missing port $d" 1>&2 + exit 2 + fi + if grep -q "^$d\$" /tmp/_.plist ; then + true + else + ( + cd $d + ports_recurse `make -V _DEPEND_DIRS` + ) + echo $d >> /tmp/_.plist + fi + done +) + +ports_build() ( + set +x + + true > /tmp/_.plist + ports_recurse $PORTS_WE_WANT + + # Now build & install them + for p in `cat /tmp/_.plist` + do + t=`echo $p | sed 's,/usr/ports/,,'` + pn=`cd $p && make package-name` + if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.tbz ] ; then + if [ "x$use_pkg" = "x-p" ] ; then + log_it "install $p from ${PKG_DIR}/$pn.tbz" + pkg_add ${PKG_DIR}/$pn.tbz + fi + fi + i=`pkg_info -qO $t` + if [ -z "$i" ] ; then + log_it "build $p" + b=`echo $p | tr / _` + ( + set -x + cd /usr/ports + cd $p + set +e + make clean + if make install ${PORTS_OPTS} ; then + if [ "x${PKG_DIR}" != "x" ] ; then + make package ${PORTS_OPTS} + mv *.tbz ${PKG_DIR} + fi + else + log_it FAIL build $p + fi + make clean + ) > _.$b 2>&1 < /dev/null + date + fi + done +) + +ports_prefetch() ( + ( + set +x + ports_recurse $PORTS_WE_WANT + + # Now checksump/fetch them + for p in `cat /tmp/_.plist` + do + b=`echo $p | tr / _` + ( + cd $p + if make checksum $PORTS_OPTS ; then + true + else + make distclean + make checksum $PORTS_OPTS || true + fi + ) > /mnt/_.prefetch.$b 2>&1 + done + ) +) + +####################################################################### + +do_world=true +do_kernel=true +use_pkg="" +c_arg="" + +set +e +args=`getopt bc:hkpw $*` +if [ $? -ne 0 ] ; then + usage +fi +set -e + +set -- $args +for i +do + case "$i" + in + -b) + shift; + do_world=false + do_kernel=false + ;; + -c) + c_arg=$2 + if [ ! -f "$c_arg" ] ; then + echo "Cannot read $c_arg" 1>&2 + usage + fi + . "$2" + shift + shift + ;; + -h) + usage + ;; + -k) + shift; + do_kernel=false + ;; + -p) + shift; + use_pkg="-p" + ;; + -w) + shift; + do_world=false + ;; + --) + shift + break; + ;; + esac +done + +####################################################################### + +if [ "x$1" = "xchroot_script" ] ; then + set +x + set -e + + shift + + before_ports_chroot + + ports_build + + exit 0 +fi + +if [ "x$1" = "xfinal_chroot" ] ; then + final_chroot + exit 0 +fi + +if [ $# -gt 0 ] ; then + echo "$0: Extraneous arguments supplied" + usage +fi + +####################################################################### + +T0=`date +%s` +echo $T0 $T0 > /tmp/_sb_log + +log_it Unmount everything +( + ( cleanup ) + umount /freebsd/distfiles || true + umount /mnt/freebsd/distfiles || true + umount /dev/${FREEBSD_PART} || true + umount /mnt/freebsd || true + umount /mnt/dev || true + umount /mnt || true + umount /dev/${TARGET_PART} || true +) # > /dev/null 2>&1 + +log_it Prepare running image +mkdir -p /freebsd +mount /dev/${FREEBSD_PART} /freebsd + +####################################################################### + +if [ ! -d /freebsd/${PORTS_PATH} ] ; then + echo PORTS_PATH does not exist 1>&2 + exit 1 +fi + +if [ ! -d /freebsd/${SRC_PATH} ] ; then + echo SRC_PATH does not exist 1>&2 + exit 1 +fi + +log_it TARGET_PART $TARGET_PART +sleep 5 + +rm -rf /usr/ports +ln -s /freebsd/${PORTS_PATH} /usr/ports + +rm -rf /usr/src +ln -s /freebsd/${SRC_PATH} /usr/src + +if $do_world ; then + if [ "x${OBJ_PATH}" != "x" ] ; then + rm -rf /usr/obj + mkdir -p /freebsd/${OBJ_PATH} + ln -s /freebsd/${OBJ_PATH} /usr/obj + else + rm -rf /usr/obj + mkdir -p /usr/obj + fi +fi + +####################################################################### + +for i in ${PORTS_WE_WANT} +do + if [ ! -d $i ] ; then + echo "Port $i not found" 1>&2 + exit 2 + fi +done + +export PORTS_WE_WANT +export PORTS_OPTS + +####################################################################### + +log_it Prepare destination partition +newfs -O2 -U /dev/${TARGET_PART} > /dev/null +mount /dev/${TARGET_PART} /mnt +mkdir -p /mnt/dev +mount -t devfs devfs /mnt/dev + +if [ "x${REMOTEDISTFILES}" != "x" ] ; then + rm -rf /freebsd/${PORTS_PATH}/distfiles + ln -s /freebsd/distfiles /freebsd/${PORTS_PATH}/distfiles + mkdir -p /freebsd/distfiles + mount ${REMOTEDISTFILES} /freebsd/distfiles +fi + +log_it "Start prefetch of ports distfiles" +ports_prefetch & + +if $do_world ; then + ( + cd /usr/src + log_it "Buildworld" + make ${JARG} -s buildworld ${SRCCONF} > /mnt/_.bw 2>&1 + ) +fi + +if $do_kernel ; then + ( + cd /usr/src + log_it "Buildkernel" + make ${JARG} -s buildkernel KERNCONF=$KERNCONF > /mnt/_.bk 2>&1 + ) +fi + + +log_it Installworld +(cd /usr/src && make ${JARG} installworld DESTDIR=/mnt ${SRCCONF} ) \ + > /mnt/_.iw 2>&1 + +log_it distribution +(cd /usr/src/etc && make distribution DESTDIR=/mnt ${SRCCONF} ) \ + > /mnt/_.dist 2>&1 + +log_it Installkernel +(cd /usr/src && make ${JARG} installkernel DESTDIR=/mnt KERNCONF=$KERNCONF ) \ + > /mnt/_.ik 2>&1 + +if [ "x${OBJ_PATH}" != "x" ] ; then + rmdir /mnt/usr/obj + ln -s /freebsd/${OBJ_PATH} /mnt/usr/obj +fi + +log_it Wait for ports prefetch +wait + +log_it Move filesystems + +if [ "x${REMOTEDISTFILES}" != "x" ] ; then + umount /freebsd/distfiles +fi +umount /dev/${FREEBSD_PART} || true +mkdir -p /mnt/freebsd +mount /dev/${FREEBSD_PART} /mnt/freebsd +if [ "x${REMOTEDISTFILES}" != "x" ] ; then + mount ${REMOTEDISTFILES} /mnt/freebsd/distfiles +fi + +rm -rf /mnt/usr/ports || true +ln -s /freebsd/${PORTS_PATH} /mnt/usr/ports + +rm -rf /mnt/usr/src || true +ln -s /freebsd/${SRC_PATH} /mnt/usr/src + +log_it Build and install ports + +# Make sure fetching will work in the chroot +if [ -f /etc/resolv.conf ] ; then + log_it copy resolv.conf + cp /etc/resolv.conf /mnt/etc + chflags schg /mnt/etc/resolv.conf +fi + +if [ -f /etc/localtime ] ; then + log_it copy localtime + cp /etc/localtime /mnt/etc +fi + +log_it copy ports config files +(cd / ; find var/db/ports -print | cpio -dumpv /mnt ) + +log_it ldconfig in chroot +chroot /mnt sh /etc/rc.d/ldconfig start + +log_it before_ports +( + before_ports +) + +log_it build ports +pwd +cp $0 /mnt/root +cp /tmp/_sb_log /mnt/tmp +b=`basename $0` +if [ "x$c_arg" != "x" ] ; then + cp $c_arg /mnt/root + chroot /mnt sh /root/$0 -c /root/`basename $c_arg` $use_pkg chroot_script +else + chroot /mnt sh /root/$0 $use_pkg chroot_script +fi +cp /mnt/tmp/_sb_log /tmp + +log_it fixing fstab +sed "/[ ]\/[ ]/s;^[^ ]*[ ];/dev/${TARGET_PART} ;" \ + /etc/fstab > /mnt/etc/fstab + +log_it create all mountpoints +grep -v '^[ ]*#' /mnt/etc/fstab | +while read a b c +do + mkdir -p /mnt/$b +done + +if [ "x$SERCONS" != "xfalse" ] ; then + log_it serial console + echo " -h" > /mnt/boot.config + sed -i "" -e /ttyd0/s/off/on/ /mnt/etc/ttys + sed -i "" -e /ttyu0/s/off/on/ /mnt/etc/ttys + sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' /mnt/etc/ttys +fi + +log_it move config files +(cd / && find ${CONFIGFILES} -print | cpio -dumpv /mnt) + +log_it final_root +( final_root ) +log_it final_chroot +cp /tmp/_sb_log /mnt/tmp +if [ "x$c_arg" != "x" ] ; then + chroot /mnt sh /root/$0 -c /root/`basename $c_arg` final_chroot +else + chroot /mnt sh /root/$0 final_chroot +fi +cp /mnt/tmp/_sb_log /tmp +log_it "Check these messages (if any):" +grep '^Stop' /mnt/_* || true +log_it DONE From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 21:31:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF1FB1065676; Sat, 17 Jan 2009 21:31:47 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDE1A8FC1A; Sat, 17 Jan 2009 21:31:47 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HLVldQ053025; Sat, 17 Jan 2009 21:31:47 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HLVlap053024; Sat, 17 Jan 2009 21:31:47 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200901172131.n0HLVlap053024@svn.freebsd.org> From: Poul-Henning Kamp Date: Sat, 17 Jan 2009 21:31: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: r187372 - head/tools/tools/sysbuild X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 21:31:48 -0000 Author: phk Date: Sat Jan 17 21:31:47 2009 New Revision: 187372 URL: http://svn.freebsd.org/changeset/base/187372 Log: Fix typo Spotted by: juli Modified: head/tools/tools/sysbuild/README Modified: head/tools/tools/sysbuild/README ============================================================================== --- head/tools/tools/sysbuild/README Sat Jan 17 20:30:06 2009 (r187371) +++ head/tools/tools/sysbuild/README Sat Jan 17 21:31:47 2009 (r187372) @@ -72,7 +72,7 @@ Next, install ports and sources: And we should be ready to try a shot: cd /root - cp /usr/src/tools/tools/sysbuild/sysbuild.sh + cp /usr/src/tools/tools/sysbuild/sysbuild.sh . sh sysbuild.sh |& tee _.sb If it succeeds, you should be able to: From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 22:50:58 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2699410656C4; Sat, 17 Jan 2009 22:50:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D6B6C8FC13; Sat, 17 Jan 2009 22:50:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0HMoDRQ021421; Sat, 17 Jan 2009 15:50:14 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 17 Jan 2009 15:50:44 -0700 (MST) Message-Id: <20090117.155044.43037614.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <86ab9q14dl.fsf@ds4.des.no> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <86ab9q14dl.fsf@ds4.des.no> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: stas@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, ed@FreeBSD.org Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 22:50:58 -0000 In message: <86ab9q14dl.fsf@ds4.des.no> Dag-Erling_Sm=F8rgrav writes: : Stanislav Sedov writes: : > Was this discussed somewhere? I don't understand why we should : > restrict our filesystem naming because of limitation of auxilary : > filesystems. : = : Yes. We've already renamed files that had : in their names. : = : This is not just for Windows's sake, BTW: Apple's HFS and MacOS Exten= ded : file systems are case retentive but not case sensitive. : = : We should restrict filenames in the source tree (and in the installed= : system) to the POSIX portable filename character set ([A-Za-z0-9._-] = in : the C/POSIX locale) and avoid gratuitously long names. Yea, this is settled ground. With the move from cvs -> svn, it is now possible to checkout a tree on the Mac again. Before, contrib/files had a file names 'cvs'... Warner From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 22:53:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9133E106566B; Sat, 17 Jan 2009 22:53:53 +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 6613A8FC1C; Sat, 17 Jan 2009 22:53:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HMrr01054518; Sat, 17 Jan 2009 22:53:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HMrrMI054516; Sat, 17 Jan 2009 22:53:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901172253.n0HMrrMI054516@svn.freebsd.org> From: Ed Schouten Date: Sat, 17 Jan 2009 22:53: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: r187373 - head/sys/dev/syscons/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 22:53:54 -0000 Author: ed Date: Sat Jan 17 22:53:53 2009 New Revision: 187373 URL: http://svn.freebsd.org/changeset/base/187373 Log: Make vidcontrol's color setting work again. It turns out I forgot to implement two escape sequences that allows the user to change the default foreground and background colors. I thought they were implemented by syscons itself, but vidcontrol just generates some escape sequences, which get interpreted by the terminal emulator. Reported by: mgp (forums) Modified: head/sys/dev/syscons/teken/sequences head/sys/dev/syscons/teken/teken_subr_compat.h Modified: head/sys/dev/syscons/teken/sequences ============================================================================== --- head/sys/dev/syscons/teken/sequences Sat Jan 17 21:31:47 2009 (r187372) +++ head/sys/dev/syscons/teken/sequences Sat Jan 17 22:53:53 2009 (r187373) @@ -100,6 +100,8 @@ TBC Tab Clear ^[ [ g r VPA Vertical Position Absolute ^[ [ d n # Cons25 compatibility sequences +C25ADBG Cons25 set adapter background ^[ [ = G r +C25ADFG Cons25 set adapter foreground ^[ [ = F r C25CURS Cons25 set cursor type ^[ [ = S r C25VTSW Cons25 switch virtual terminal ^[ [ z r Modified: head/sys/dev/syscons/teken/teken_subr_compat.h ============================================================================== --- head/sys/dev/syscons/teken/teken_subr_compat.h Sat Jan 17 21:31:47 2009 (r187372) +++ head/sys/dev/syscons/teken/teken_subr_compat.h Sat Jan 17 22:53:53 2009 (r187373) @@ -34,6 +34,29 @@ teken_subr_cons25_set_cursor_type(teken_ } static void +teken_subr_cons25_set_adapter_background(teken_t *t, unsigned int c) +{ + + t->t_defattr.ta_bgcolor = c % 8; + t->t_curattr.ta_bgcolor = c % 8; +} + +static void +teken_subr_cons25_set_adapter_foreground(teken_t *t, unsigned int c) +{ + + t->t_defattr.ta_fgcolor = c % 8; + t->t_curattr.ta_fgcolor = c % 8; + if (c >= 8) { + t->t_defattr.ta_format |= TF_BOLD; + t->t_curattr.ta_format |= TF_BOLD; + } else { + t->t_defattr.ta_format &= ~TF_BOLD; + t->t_curattr.ta_format &= ~TF_BOLD; + } +} + +static void teken_subr_cons25_switch_virtual_terminal(teken_t *t, unsigned int vt) { From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 22:54:06 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4083A1065756; Sat, 17 Jan 2009 22:54:06 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D14268FC0A; Sat, 17 Jan 2009 22:54:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0HMqMJY021442; Sat, 17 Jan 2009 15:52:22 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 17 Jan 2009 15:52:53 -0700 (MST) Message-Id: <20090117.155253.63023175.imp@bsdimp.com> To: stas@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20090117185801.fcce79e9.stas@FreeBSD.org> References: <20090117142021.92d5a40b.stas@FreeBSD.org> <20090117185801.fcce79e9.stas@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, ed@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rwatson@FreeBSD.org Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 22:54:06 -0000 In message: <20090117185801.fcce79e9.stas@FreeBSD.org> Stanislav Sedov writes: : -----BEGIN PGP SIGNED MESSAGE----- : Hash: SHA1 : : On Sat, 17 Jan 2009 14:00:55 +0000 (GMT) : Robert Watson mentioned: : : > : > On Sat, 17 Jan 2009, Stanislav Sedov wrote: : > : > > Was this discussed somewhere? I don't understand why we should restrict our : > > filesystem naming because of limitation of auxilary filesystems. There're : > > even more restrictive filesystems available, we couldn't support them all. : > > While previous modifications looked harmless this one seems questionable to : > > me. : > > : > > I understand, this is a bikesched, but I really don't see a reason. You : > > can't build FreeBSD on windows anyway. : > : > Many of us would *very* much like to be able to cross-build FreeBSD from both : > Windows and Mac OS X, which would be highly desirable for embedded systems and : > appliance shops. The first obstacle to making that work is that you can't : > even check out our source code correctly on those platforms, so fixing that is : > an important priority so that the remainder can be worked on. : > : : I think this should be rather worked out in these platforms themselves (e.g. : by renaming files in the checkout files, and so on) withouth trashing our : tree. While some changes could be understandable, the one I've replied : completely broked heirarchy of jot regressions tests: before the names : of files were coreesponding to the options used in the test, now you can't : say exactly what options used by looking at the filename. This looks like : a gratitous change and regression to me. It isn't worth fussing about. It is a trivial change and a heck of a lot easier to deal with than trying to arrange for the files to wind up in the right places after the fact. While one might fuss over the names here, there's nothing to prevent you from changing it to a more proper name if you don't like the new name... Warner From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 23:01:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6881410656F0; Sat, 17 Jan 2009 23:01:40 +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 56E368FC27; Sat, 17 Jan 2009 23:01:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HN1eSJ054708; Sat, 17 Jan 2009 23:01:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0HN1ePm054707; Sat, 17 Jan 2009 23:01:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200901172301.n0HN1ePm054707@svn.freebsd.org> From: Ed Schouten Date: Sat, 17 Jan 2009 23:01:40 +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: r187374 - head/sys/dev/syscons/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 23:01:41 -0000 Author: ed Date: Sat Jan 17 23:01:40 2009 New Revision: 187374 URL: http://svn.freebsd.org/changeset/base/187374 Log: Fix for my previous commit: color mapping is not 1:1. Cons25 doesn't seem to use a straight 1:1 mapping to the ANSI colors, but uses the same color numbers as at least used by syscons on i386. I suspect if you change the definitions on a different architecture, things may break? Not sure. Add a small array to convert syscons-style color codes to ANSI equivalents, which are used by libteken internally. I didn't notice this bug, because I only tested my code with black, white and green, all of them shared the same numbers. Modified: head/sys/dev/syscons/teken/teken_subr_compat.h Modified: head/sys/dev/syscons/teken/teken_subr_compat.h ============================================================================== --- head/sys/dev/syscons/teken/teken_subr_compat.h Sat Jan 17 22:53:53 2009 (r187373) +++ head/sys/dev/syscons/teken/teken_subr_compat.h Sat Jan 17 23:01:40 2009 (r187374) @@ -33,20 +33,23 @@ teken_subr_cons25_set_cursor_type(teken_ teken_funcs_param(t, TP_SHOWCURSOR, type != 1); } +static teken_color_t cons25_colors[8] = { TC_BLACK, TC_BLUE, TC_GREEN, + TC_CYAN, TC_RED, TC_MAGENTA, TC_BROWN, TC_WHITE }; + static void teken_subr_cons25_set_adapter_background(teken_t *t, unsigned int c) { - t->t_defattr.ta_bgcolor = c % 8; - t->t_curattr.ta_bgcolor = c % 8; + t->t_defattr.ta_bgcolor = cons25_colors[c % 8]; + t->t_curattr.ta_bgcolor = cons25_colors[c % 8]; } static void teken_subr_cons25_set_adapter_foreground(teken_t *t, unsigned int c) { - t->t_defattr.ta_fgcolor = c % 8; - t->t_curattr.ta_fgcolor = c % 8; + t->t_defattr.ta_fgcolor = cons25_colors[c % 8]; + t->t_curattr.ta_fgcolor = cons25_colors[c % 8]; if (c >= 8) { t->t_defattr.ta_format |= TF_BOLD; t->t_curattr.ta_format |= TF_BOLD; From owner-svn-src-all@FreeBSD.ORG Sat Jan 17 23:36:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D22F106566B; Sat, 17 Jan 2009 23:36:54 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 25A738FC17; Sat, 17 Jan 2009 23:36:54 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 0B6B71CC46; Sun, 18 Jan 2009 00:36:53 +0100 (CET) Date: Sun, 18 Jan 2009 00:36:53 +0100 From: Ed Schouten To: Stanislav Sedov Message-ID: <20090117233653.GP1247@hoeg.nl> References: <200901161547.n0GFlZ4C012008@svn.freebsd.org> <20090117142021.92d5a40b.stas@FreeBSD.org> <20090117185801.fcce79e9.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MT9SxUWSsctiw0kG" Content-Disposition: inline In-Reply-To: <20090117185801.fcce79e9.stas@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 Subject: Re: svn commit: r187332 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 23:36:55 -0000 --MT9SxUWSsctiw0kG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello all, First time I'm replying to this thread. I thought I'd better wait to see other people's reactions first. * Stanislav Sedov wrote: > On Sat, 17 Jan 2009 14:00:55 +0000 (GMT) > Robert Watson mentioned: > > Many of us would *very* much like to be able to cross-build FreeBSD fro= m both=20 > > Windows and Mac OS X, which would be highly desirable for embedded syst= ems and=20 > > appliance shops. The first obstacle to making that work is that you ca= n't=20 > > even check out our source code correctly on those platforms, so fixing = that is=20 > > an important priority so that the remainder can be worked on. > >=20 >=20 > I think this should be rather worked out in these platforms themselves (e= =2Eg. > by renaming files in the checkout files, and so on) withouth trashing our > tree. While some changes could be understandable, the one I've replied > completely broked heirarchy of jot regressions tests: before the names > of files were coreesponding to the options used in the test, now you can't > say exactly what options used by looking at the filename. This looks like > a gratitous change and regression to me. But this is not how things go in reality. Even if you visit a FreeBSD Developer Summit, you will see a lot of FreeBSD developers using Apple MacBooks. We have vendors that try to check in the source code into ClearCase, etc. We could make very long lists of scenario's where people want to use the source code on non-FreeBSD systems. I think being able to check out our source code virtually anywhere is a good thing. Almost any Open Source project out there can be checked out on multiple operating systems. Imagine what happened if the Mozilla people wouldn't be able to check out their sources on different platforms. Because we develop an operating system ourselves, doesn't mean the rule doesn't apply to us at all. If you think there are multiple solutions; - Just leave it as it is right now. - Change the name to something you like. - Revert the change. I don't really have a strong opinion on the subject. Do whatever you like. --=20 Ed Schouten WWW: http://80386.nl/ --MT9SxUWSsctiw0kG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAklya5QACgkQ52SDGA2eCwWg7ACfS2zL204TSsHBBksBdGPStroR 3c8Anjv21RJumDE2Vin/0al+Qh4UK4Zm =hj61 -----END PGP SIGNATURE----- --MT9SxUWSsctiw0kG--