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) R