From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 01:06:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96B70106564A; Sun, 7 Jun 2009 01:06:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84A568FC0A; Sun, 7 Jun 2009 01:06:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5716vnh077203; Sun, 7 Jun 2009 01:06:57 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5716v1N077202; Sun, 7 Jun 2009 01:06:57 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906070106.n5716v1N077202@svn.freebsd.org> From: Rick Macklem Date: Sun, 7 Jun 2009 01:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193603 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 01:06:59 -0000 Author: rmacklem Date: Sun Jun 7 01:06:56 2009 New Revision: 193603 URL: http://svn.freebsd.org/changeset/base/193603 Log: Fix a lockorder reversal I introduced in r193436 when I moved the mtx_destroy() of the pool mutex to after SVC_RELEASE(), because the pool mutex was still locked when soclose() was called by svc_dg_destroy(). To fix this, an mtx_unlock() was added where mtx_destroy() was before r193436. Reviewed by: jhb Tested by: pho Approved by: rwatson (mentor) Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Sun Jun 7 01:02:33 2009 (r193602) +++ head/sys/rpc/svc.c Sun Jun 7 01:06:56 2009 (r193603) @@ -174,6 +174,7 @@ svcpool_destroy(SVCPOOL *pool) svc_unreg(pool, s->sc_prog, s->sc_vers); mtx_lock(&pool->sp_lock); } + mtx_unlock(&pool->sp_lock); TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { SVC_RELEASE(xprt); From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 02:42:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BBEF106566B; Sun, 7 Jun 2009 02:42:32 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout018.mac.com (asmtpout018.mac.com [17.148.16.93]) by mx1.freebsd.org (Postfix) with ESMTP id 542F28FC15; Sun, 7 Jun 2009 02:42:32 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from MacBook-Pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp018.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KKU007HWKUVYT60@asmtp018.mac.com>; Sat, 06 Jun 2009 19:42:32 -0700 (PDT) Message-id: <27E90488-75EB-49DB-900D-CE0B1C5D034C@mac.com> From: Marcel Moolenaar To: Rafal Jaworowski In-reply-to: <200906060933.n569XWEu054745@svn.freebsd.org> Date: Sat, 06 Jun 2009 19:42:31 -0700 References: <200906060933.n569XWEu054745@svn.freebsd.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193578 - in head/sys/powerpc: include powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 02:42:32 -0000 On Jun 6, 2009, at 2:33 AM, Rafal Jaworowski wrote: > Author: raj > Date: Sat Jun 6 09:33:32 2009 > New Revision: 193578 > URL: http://svn.freebsd.org/changeset/base/193578 > > Log: > Provide 64-bit big endian bus space operations for PowerPC. They > are required > for the upcoming sec(4) driver. BTW: We should probably obsolete pio.h and implement the various I/O functions inline in bus_machdep.c. No driver should use out* or in* functions directly if they want to be portable anyway... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 04:45:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D68E106564A; Sun, 7 Jun 2009 04:45:51 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DA9F8FC0C; Sun, 7 Jun 2009 04:45:51 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n574jp8V081785; Sun, 7 Jun 2009 04:45:51 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n574jptO081783; Sun, 7 Jun 2009 04:45:51 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906070445.n574jptO081783@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 7 Jun 2009 04:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193609 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 04:45:52 -0000 Author: edwin Date: Sun Jun 7 04:45:50 2009 New Revision: 193609 URL: http://svn.freebsd.org/changeset/base/193609 Log: Remove cruft at 0E11-0002. Informed upstream. Submitted by: Pawel Worach MFC after: 6 days. Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Sun Jun 7 04:39:58 2009 (r193608) +++ head/share/misc/pci_vendors Sun Jun 7 04:45:50 2009 (r193609) @@ -146,7 +146,7 @@ 064F Trance Vibrator 0E11 Compaq Computer Corp (Now owned by Hewlett-Packard) 0001 PCI to EISA Bridge - 0002 [URL=http://bjlsgpvs.com]zyqdruqt[/URL] pkooxpbn http://khmycdty.com znrqsyvm syeowswq Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3170106566B; Sun, 7 Jun 2009 05:52:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C108F8FC18; Sun, 7 Jun 2009 05:52:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n575qMiX083554; Sun, 7 Jun 2009 05:52:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n575qM6o083553; Sun, 7 Jun 2009 05:52:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <200906070552.n575qM6o083553@svn.freebsd.org> From: Adrian Chadd Date: Sun, 7 Jun 2009 05:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193618 - head/sys/dev/xen/netfront X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 05:52:23 -0000 Author: adrian Date: Sun Jun 7 05:52:22 2009 New Revision: 193618 URL: http://svn.freebsd.org/changeset/base/193618 Log: Fix compilation when compiled w/out WITNESS. Submitted by: Edwin Shao Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Sun Jun 7 05:49:37 2009 (r193617) +++ head/sys/dev/xen/netfront/netfront.c Sun Jun 7 05:52:22 2009 (r193618) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 07:45:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A9501065672; Sun, 7 Jun 2009 07:45:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 792718FC16; Sun, 7 Jun 2009 07:45:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n577jPGI086107; Sun, 7 Jun 2009 07:45:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n577jPwV086106; Sun, 7 Jun 2009 07:45:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906070745.n577jPwV086106@svn.freebsd.org> From: Warner Losh Date: Sun, 7 Jun 2009 07:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193625 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 07:45:26 -0000 Author: imp Date: Sun Jun 7 07:45:25 2009 New Revision: 193625 URL: http://svn.freebsd.org/changeset/base/193625 Log: I don't know why fstab doesn't document that the fifth field specifies the number of days between backups. All it says is frequency, with no units given. It likely should say "the interval in days between backups" instead, but not today. Modified: head/share/man/man5/fstab.5 Modified: head/share/man/man5/fstab.5 ============================================================================== --- head/share/man/man5/fstab.5 Sun Jun 7 07:01:21 2009 (r193624) +++ head/share/man/man5/fstab.5 Sun Jun 7 07:45:25 2009 (r193625) @@ -198,6 +198,8 @@ command to determine which file systems If the fifth field is not present, a value of zero is returned and .Nm dump will assume that the file system does not need to be dumped. +If the fifth field is greater than 0, then it specifies the number of days +between dumps for this file system. .Pp The sixth field, .Pq Fa fs_passno , From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 08:42:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59DA0106566B; Sun, 7 Jun 2009 08:42:26 +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 485D58FC2C; Sun, 7 Jun 2009 08:42:26 +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 n578gQ9P087474; Sun, 7 Jun 2009 08:42:26 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n578gQJV087473; Sun, 7 Jun 2009 08:42:26 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200906070842.n578gQJV087473@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 7 Jun 2009 08:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193628 - head/sys/gnu/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 08:42:26 -0000 Author: stas Date: Sun Jun 7 08:42:26 2009 New Revision: 193628 URL: http://svn.freebsd.org/changeset/base/193628 Log: - Outindent long printf lines instead of splitting them in the middle of senetences. This also makes the code more consistent with the corresponding FFS code. - Use 2-space sentences breaks consistently. Suggested by: bde Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jun 7 08:21:06 2009 (r193627) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Jun 7 08:42:26 2009 (r193628) @@ -218,12 +218,12 @@ ext2_mount(struct mount *mp) if ((fs->s_es->s_state & EXT2_VALID_FS) == 0 || (fs->s_es->s_state & EXT2_ERROR_FS)) { if (mp->mnt_flag & MNT_FORCE) { - printf("WARNING: %s was not properly " - "dismounted\n", fs->fs_fsmnt); + printf( +"WARNING: %s was not properly dismounted\n", fs->fs_fsmnt); } else { - printf("WARNING: R/W mount of %s " - "denied. Filesystem is not clean" - " - run fsck\n", fs->fs_fsmnt); + printf( +"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", + fs->fs_fsmnt); return (EPERM); } } @@ -359,8 +359,9 @@ ext2_check_sb_compat(struct ext2_super_b } if (es->s_rev_level > EXT2_GOOD_OLD_REV) { if (es->s_feature_incompat & ~EXT2_FEATURE_INCOMPAT_SUPP) { - printf("WARNING: mount of %s denied due to unsupported " - "optional features\n", devtoname(dev)); + printf( +"WARNING: mount of %s denied due to unsupported optional features\n", + devtoname(dev)); return (1); } if (!ronly && @@ -629,11 +630,11 @@ ext2_mountfs(struct vnode *devvp, struct if ((es->s_state & EXT2_VALID_FS) == 0 || (es->s_state & EXT2_ERROR_FS)) { if (ronly || (mp->mnt_flag & MNT_FORCE)) { - printf("WARNING: Filesystem was not properly " - "dismounted\n"); + printf( +"WARNING: Filesystem was not properly dismounted\n"); } else { - printf("WARNING: R/W mount denied. Filesystem " - "is not clean - run fsck\n"); + printf( +"WARNING: R/W mount denied. Filesystem is not clean - run fsck\n"); error = EPERM; goto out; } From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 09:06:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FC94106564A; Sun, 7 Jun 2009 09:06:22 +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 E73C88FC08; Sun, 7 Jun 2009 09:06:21 +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 n5796L37088023; Sun, 7 Jun 2009 09:06:21 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5796Luv088021; Sun, 7 Jun 2009 09:06:21 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200906070906.n5796Luv088021@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 7 Jun 2009 09:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193629 - head/bin/df X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 09:06:22 -0000 Author: simon Date: Sun Jun 7 09:06:21 2009 New Revision: 193629 URL: http://svn.freebsd.org/changeset/base/193629 Log: Make "human-readable" (-H/-h) output also "humanize" inode counts. Base 10 is always used for the inode counts as I could not think of any reason base 2 inode counts would be useful. Minor mdoc markup fix to df(1) while here anyway. MFC after: 3 weeks Modified: head/bin/df/df.1 head/bin/df/df.c Modified: head/bin/df/df.1 ============================================================================== --- head/bin/df/df.1 Sun Jun 7 08:42:26 2009 (r193628) +++ head/bin/df/df.1 Sun Jun 7 09:06:21 2009 (r193629) @@ -78,15 +78,20 @@ this overrides the .Ev BLOCKSIZE specification from the environment. .It Fl H -"Human-readable" output. +.Dq Human-readable +output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 10 for sizes. .It Fl h -"Human-readable" output. +.Dq Human-readable +output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 2 for sizes. +Inodes statistics, if enabled with +.Fl i , +are always printed in base 10. .It Fl i Include statistics on the number of free inodes. .It Fl k Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Sun Jun 7 08:42:26 2009 (r193628) +++ head/bin/df/df.c Sun Jun 7 09:06:21 2009 (r193629) @@ -369,6 +369,23 @@ prthumanval(int64_t bytes) } /* + * Print an inode count in "human-readable" format. + */ +static void +prthumanvalinode(int64_t bytes) +{ + char buf[6]; + int flags; + + flags = HN_NOSPACE | HN_DECIMAL | HN_DIVISOR_1000; + + humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), + bytes, "", HN_AUTOSCALE, flags); + + (void)printf(" %5s", buf); +} + +/* * Convert statfs returned file system size into BLOCKSIZE units. * Attempts to avoid overflow for large file systems. */ @@ -413,8 +430,10 @@ prtstat(struct statfs *sfsp, struct maxw (void)printf(" %-*s %*s %*s Capacity", mwp->total, header, mwp->used, "Used", mwp->avail, "Avail"); if (iflag) { - mwp->iused = imax(mwp->iused, (int)strlen(" iused")); - mwp->ifree = imax(mwp->ifree, (int)strlen("ifree")); + mwp->iused = imax(hflag ? 0 : mwp->iused, + (int)strlen(" iused")); + mwp->ifree = imax(hflag ? 0 : mwp->ifree, + (int)strlen("ifree")); (void)printf(" %*s %*s %%iused", mwp->iused - 2, "iused", mwp->ifree, "ifree"); } @@ -440,8 +459,15 @@ prtstat(struct statfs *sfsp, struct maxw if (iflag) { inodes = sfsp->f_files; used = inodes - sfsp->f_ffree; - (void)printf(" %*jd %*jd %4.0f%% ", mwp->iused, (intmax_t)used, - mwp->ifree, (intmax_t)sfsp->f_ffree, inodes == 0 ? 100.0 : + if (hflag) { + (void)printf(" "); + prthumanvalinode(used); + prthumanvalinode(sfsp->f_ffree); + } else { + (void)printf(" %*jd %*jd", mwp->iused, (intmax_t)used, + mwp->ifree, (intmax_t)sfsp->f_ffree); + } + (void)printf(" %4.0f%% ", inodes == 0 ? 100.0 : (double)used / (double)inodes * 100.0); } else (void)printf(" "); From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 13:26:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCBB51065672; Sun, 7 Jun 2009 13:26:57 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB10E8FC1C; Sun, 7 Jun 2009 13:26:57 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57DQvb6095106; Sun, 7 Jun 2009 13:26:57 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57DQvSG095104; Sun, 7 Jun 2009 13:26:57 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906071326.n57DQvSG095104@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 7 Jun 2009 13:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193635 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 13:26:58 -0000 Author: edwin Date: Sun Jun 7 13:26:57 2009 New Revision: 193635 URL: http://svn.freebsd.org/changeset/base/193635 Log: Welcome to a default installed /etc/ntp.conf This NTP configuration file points to the [012].pool.ntp.org servers, which will return a list of geographical local NTP servers. It uses the best-practice options of "iburst" and "maxpoll 9". It gives examples on how to use the "restrict" commands, which are unfortunately not working when you use the pool.ntp.org servers. It sets up a fudge server so any clients syncing against this server will always be synced even if we lose the master. The idea of this file was briefly discussed on -net. PR: conf/58595 Submitted by: Chris Stenton MFC after: 1 week Added: head/etc/ntp.conf (contents, props changed) Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Jun 7 10:00:35 2009 (r193634) +++ head/etc/Makefile Sun Jun 7 13:26:57 2009 (r193635) @@ -63,6 +63,10 @@ BIN1+= ${.CURDIR}/../usr.bin/mail/misc/m BIN1+= ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config .endif +.if ${MK_NTP} != "no" +BIN1+= ntp.conf +.endif + .if ${MK_OPENSSH} != "no" SSH= ${.CURDIR}/../crypto/openssh/ssh_config \ ${.CURDIR}/../crypto/openssh/sshd_config \ Added: head/etc/ntp.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/ntp.conf Sun Jun 7 13:26:57 2009 (r193635) @@ -0,0 +1,59 @@ +# +# $FreeBSD$ +# +# Default NTP servers for the FreeBSD operating system. +# +# Don't forget to enable ntpd in /etc/rc.conf with: +# ntpd_enable="YES" +# +# The driftfile is by default /var/db/ntpd.drift, check +# /etc/defaults/rc.conf on how to change the location. +# + +# +# The following three servers will give you a random set of three +# NTP servers geographically close to you. +# See http://en.wikipedia.org/wiki/NTP_pool for details. +# +# The option `iburst' is used for faster initial synchronisation. +# The option `maxpoll 9' is used to prevent PLL/FLL flipping on FreeBSD. +# +server 0.pool.ntp.org iburst maxpoll 9 +server 1.pool.ntp.org iburst maxpoll 9 +server 2.pool.ntp.org iburst maxpoll 9 + +# +# If you want to pick yourself which country's public NTP server +# you want sync against, comment out the above servers, uncomment +# the next ones and replace CC with the country's abbrevation. +# Make sure that the hostnames resolve to a proper IP address! +# +# server 0.CC.pool.ntp.org iburst maxpoll 9 +# server 1.CC.pool.ntp.org iburst maxpoll 9 +# server 2.CC.pool.ntp.org iburst maxpoll 9 + +# +# Security: Only accept NTP traffic from the following hosts. +# The following configuration example only accepts traffic from the +# above defined servers. +# +# Please note that this example doesn't work for the servers in +# the pool.ntp.org domain since they return multiple A records. +# (This is the reason that by default they are commented out) +# +#restrict default ignore +#restrict 0.pool.ntp.org nomodify nopeer noquery notrap +#restrict 1.pool.ntp.org nomodify nopeer noquery notrap +#restrict 2.pool.ntp.org nomodify nopeer noquery notrap +#restrict 127.0.0.1 +#restrict -6 ::1 +#restrict 127.127.1.0 + +# +# If we lose sync against all configured servers, the NTP clients +# syncing against this server will lose sync too. To overcome this, +# we will act as a stratum 10 server with our own internal clock +# so that everybody at least will have the same time as we have. +# +server 127.127.1.0 +fudge 127.127.1.0 stratum 10 From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 15:04:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 421E9106566C; Sun, 7 Jun 2009 15:04:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3098A8FC12; Sun, 7 Jun 2009 15:04:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57F4iJL097094; Sun, 7 Jun 2009 15:04:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57F4iUK097093; Sun, 7 Jun 2009 15:04:44 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906071504.n57F4iUK097093@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 7 Jun 2009 15:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193636 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 15:04:44 -0000 Author: jilles Date: Sun Jun 7 15:04:43 2009 New Revision: 193636 URL: http://svn.freebsd.org/changeset/base/193636 Log: Mention the range for the exit status for the exit special builtin. The exit status may exceed 255 in some cases (return); even though it seems unwise to rely on this, it is also unwise to assume that $? is always between 0 and 255. This resolves bin/124748 by documenting that 'exit -1' is not valid. PR: bin/124748 Approved by: ed (mentor) Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Jun 7 13:26:57 2009 (r193635) +++ head/bin/sh/sh.1 Sun Jun 7 15:04:43 2009 (r193636) @@ -1682,6 +1682,7 @@ If is given it is used as the exit status of the shell; otherwise the exit status of the preceding command is used. +The exit status should be an integer between 0 and 255. .It Ic export Ar name ... .It Ic export Op Fl p The specified names are exported so that they will From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 18:19:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44ECE106566B; Sun, 7 Jun 2009 18:19:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 338A08FC16; Sun, 7 Jun 2009 18:19:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57IJ5Mo001074; Sun, 7 Jun 2009 18:19:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57IJ5pv001073; Sun, 7 Jun 2009 18:19:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906071819.n57IJ5pv001073@svn.freebsd.org> From: Alan Cox Date: Sun, 7 Jun 2009 18:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193637 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 18:19:05 -0000 Author: alc Date: Sun Jun 7 18:19:04 2009 New Revision: 193637 URL: http://svn.freebsd.org/changeset/base/193637 Log: Eliminate an unused variable from allocbuf(). Eliminate the unnecessary setting of page valid bits from a non-VMIO buffer in vm_hold_load_pages(). Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Jun 7 15:04:43 2009 (r193636) +++ head/sys/kern/vfs_bio.c Sun Jun 7 18:19:04 2009 (r193637) @@ -2946,7 +2946,6 @@ allocbuf(struct buf *bp, int size) * We are growing the buffer, possibly in a * byte-granular fashion. */ - struct vnode *vp; vm_object_t obj; vm_offset_t toff; vm_offset_t tinc; @@ -2958,7 +2957,6 @@ allocbuf(struct buf *bp, int size) * range covered by the buffer. */ - vp = bp->b_vp; obj = bp->b_bufobj->bo_object; VM_OBJECT_LOCK(obj); @@ -3762,7 +3760,6 @@ tryagain: VM_WAIT; goto tryagain; } - p->valid = VM_PAGE_BITS_ALL; pmap_qenter(pg, &p, 1); bp->b_pages[index] = p; } From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 19:12:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F168E1065673; Sun, 7 Jun 2009 19:12:09 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA8898FC1A; Sun, 7 Jun 2009 19:12:09 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57JC9lM002437; Sun, 7 Jun 2009 19:12:09 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57JC9GZ002423; Sun, 7 Jun 2009 19:12:09 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906071912.n57JC9GZ002423@svn.freebsd.org> From: Ariff Abdullah Date: Sun, 7 Jun 2009 19:12: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: r193640 - in head/sys: conf dev/sound dev/sound/isa dev/sound/macio dev/sound/midi dev/sound/pci dev/sound/pci/hda dev/sound/pcm dev/sound/sbus dev/sound/usb modules/sound/sound sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 19:12:10 -0000 Author: ariff Date: Sun Jun 7 19:12:08 2009 New Revision: 193640 URL: http://svn.freebsd.org/changeset/base/193640 Log: Sound Mega-commit. Expect further cleanup until code freeze. For a slightly thorough explaination, please refer to [1] http://people.freebsd.org/~ariff/SOUND_4.TXT.html . Summary of changes includes: 1 Volume Per-Channel (vpc). Provides private / standalone volume control unique per-stream pcm channel without touching master volume / pcm. Applications can directly use SNDCTL_DSP_[GET|SET][PLAY|REC]VOL, or for backwards compatibility, SOUND_MIXER_PCM through the opened dsp device instead of /dev/mixer. Special "bypass" mode is enabled through /dev/mixer which will automatically detect if the adjustment is made through /dev/mixer and forward its request to this private volume controller. Changes to this volume object will not interfere with other channels. Requirements: - SNDCTL_DSP_[GET|SET][PLAY|REC]_VOL are newer ioctls (OSSv4) which require specific application modifications (preferred). - No modifications required for using bypass mode, so applications like mplayer or xmms should work out of the box. Kernel hints: - hint.pcm.%d.vpc (0 = disable vpc). Kernel sysctls: - hw.snd.vpc_mixer_bypass (default: 1). Enable or disable /dev/mixer bypass mode. - hw.snd.vpc_autoreset (default: 1). By default, closing/opening /dev/dsp will reset the volume back to 0 db gain/attenuation. Setting this to 0 will preserve its settings across device closing/opening. - hw.snd.vpc_reset (default: 0). Panic/reset button to reset all volume settings back to 0 db. - hw.snd.vpc_0db (default: 45). 0 db relative to linear mixer value. 2 High quality fixed-point Bandlimited SINC sampling rate converter, based on Julius O'Smith's Digital Audio Resampling - http://ccrma.stanford.edu/~jos/resample/. It includes a filter design script written in awk (the clumsiest joke I've ever written) - 100% 32bit fixed-point, 64bit accumulator. - Possibly among the fastest (if not fastest) of its kind. - Resampling quality is tunable, either runtime or during kernel compilation (FEEDER_RATE_PRESETS). - Quality can be further customized during kernel compilation by defining FEEDER_RATE_PRESETS in /etc/make.conf. Kernel sysctls: - hw.snd.feeder_rate_quality. 0 - Zero-order Hold (ZOH). Fastest, bad quality. 1 - Linear Interpolation (LINEAR). Slightly slower than ZOH, better quality but still does not eliminate aliasing. 2 - (and above) - Sinc Interpolation(SINC). Best quality. SINC quality always start from 2 and above. Rough quality comparisons: - http://people.freebsd.org/~ariff/z_comparison/ 3 Bit-perfect mode. Bypasses all feeder/dsp effects. Pure sound will be directly fed into the hardware. 4 Parametric (compile time) Software Equalizer (Bass/Treble mixer). Can be customized by defining FEEDER_EQ_PRESETS in /etc/make.conf. 5 Transparent/Adaptive Virtual Channel. Now you don't have to disable vchans in order to make digital format pass through. It also makes vchans more dynamic by choosing a better format/rate among all the concurrent streams, which means that dev.pcm.X.play.vchanformat/rate becomes sort of optional. 6 Exclusive Stream, with special open() mode O_EXCL. This will "mute" other concurrent vchan streams and only allow a single channel with O_EXCL set to keep producing sound. Other Changes: * most feeder_* stuffs are compilable in userland. Let's not speculate whether we should go all out for it (save that for FreeBSD 16.0-RELEASE). * kobj signature fixups, thanks to Andriy Gapon * pull out channel mixing logic out of vchan.c and create its own feeder_mixer for world justice. * various refactoring here and there, for good or bad. * activation of few more OSSv4 ioctls() (see [1] above). * opt_snd.h for possible compile time configuration: (mostly for debugging purposes, don't try these at home) SND_DEBUG SND_DIAGNOSTIC SND_FEEDER_MULTIFORMAT SND_FEEDER_FULL_MULTIFORMAT SND_FEEDER_RATE_HP SND_PCM_64 SND_OLDSTEREO Manual page updates are on the way. Tested by: joel, Olivier SMEDTS , too many unsung / unnamed heroes. Added: head/sys/dev/sound/pcm/feeder_chain.c (contents, props changed) head/sys/dev/sound/pcm/feeder_eq.c (contents, props changed) head/sys/dev/sound/pcm/feeder_format.c (contents, props changed) head/sys/dev/sound/pcm/feeder_matrix.c (contents, props changed) head/sys/dev/sound/pcm/feeder_mixer.c (contents, props changed) head/sys/dev/sound/pcm/g711.h (contents, props changed) head/sys/dev/sound/pcm/intpcm.h (contents, props changed) head/sys/dev/sound/pcm/matrix.h (contents, props changed) head/sys/dev/sound/pcm/matrix_map.h (contents, props changed) head/sys/dev/sound/pcm/pcm.h (contents, props changed) head/sys/dev/sound/pcm/sndstat.h (contents, props changed) head/sys/tools/feeder_eq_mkfilter.awk (contents, props changed) head/sys/tools/feeder_rate_mkfilter.awk (contents, props changed) head/sys/tools/snd_fxdiv_gen.awk (contents, props changed) Deleted: head/sys/dev/sound/pcm/fake.c head/sys/dev/sound/pcm/feeder_fmt.c Modified: head/sys/conf/files head/sys/conf/options head/sys/dev/sound/clone.c head/sys/dev/sound/driver.c head/sys/dev/sound/isa/ad1816.c head/sys/dev/sound/isa/ess.c head/sys/dev/sound/isa/gusc.c head/sys/dev/sound/isa/mss.c head/sys/dev/sound/isa/sb16.c head/sys/dev/sound/isa/sb8.c head/sys/dev/sound/isa/sbc.c head/sys/dev/sound/isa/sndbuf_dma.c head/sys/dev/sound/macio/aoa.c head/sys/dev/sound/macio/davbus.c head/sys/dev/sound/macio/i2s.c head/sys/dev/sound/macio/snapper.c head/sys/dev/sound/macio/tumbler.c head/sys/dev/sound/midi/midi.c head/sys/dev/sound/midi/mpu401.c head/sys/dev/sound/midi/sequencer.c head/sys/dev/sound/midi/sequencer.h head/sys/dev/sound/pci/als4000.c head/sys/dev/sound/pci/atiixp.c head/sys/dev/sound/pci/aureal.c head/sys/dev/sound/pci/cmi.c head/sys/dev/sound/pci/cs4281.c head/sys/dev/sound/pci/csa.c head/sys/dev/sound/pci/csapcm.c head/sys/dev/sound/pci/ds1.c head/sys/dev/sound/pci/emu10k1.c head/sys/dev/sound/pci/emu10kx-midi.c head/sys/dev/sound/pci/emu10kx-pcm.c head/sys/dev/sound/pci/emu10kx.c head/sys/dev/sound/pci/envy24.c head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/es137x.c head/sys/dev/sound/pci/fm801.c head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/ich.c head/sys/dev/sound/pci/maestro.c head/sys/dev/sound/pci/maestro3.c head/sys/dev/sound/pci/neomagic.c head/sys/dev/sound/pci/solo.c head/sys/dev/sound/pci/spicds.c head/sys/dev/sound/pci/t4dwave.c head/sys/dev/sound/pci/via8233.c head/sys/dev/sound/pci/via82c686.c head/sys/dev/sound/pci/vibes.c head/sys/dev/sound/pcm/ac97.c head/sys/dev/sound/pcm/ac97_patch.c head/sys/dev/sound/pcm/buffer.c head/sys/dev/sound/pcm/buffer.h head/sys/dev/sound/pcm/channel.c head/sys/dev/sound/pcm/channel.h head/sys/dev/sound/pcm/channel_if.m head/sys/dev/sound/pcm/dsp.c head/sys/dev/sound/pcm/dsp.h head/sys/dev/sound/pcm/feeder.c head/sys/dev/sound/pcm/feeder.h head/sys/dev/sound/pcm/feeder_rate.c head/sys/dev/sound/pcm/feeder_volume.c head/sys/dev/sound/pcm/mixer.c head/sys/dev/sound/pcm/mixer.h head/sys/dev/sound/pcm/sndstat.c head/sys/dev/sound/pcm/sound.c head/sys/dev/sound/pcm/sound.h head/sys/dev/sound/pcm/vchan.c head/sys/dev/sound/pcm/vchan.h head/sys/dev/sound/sbus/cs4231.c head/sys/dev/sound/unit.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/sound/usb/uaudio.h head/sys/dev/sound/usb/uaudio_pcm.c head/sys/dev/sound/version.h head/sys/modules/sound/sound/Makefile head/sys/sys/soundcard.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/conf/files Sun Jun 7 19:12:08 2009 (r193640) @@ -65,6 +65,21 @@ p17v-alsa%diked.h optional snd_emu10kx compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h p17v-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ clean "p17v-alsa%diked.h" +feeder_eq_gen.h optional sound \ + dependency "$S/tools/feeder_eq_mkfilter.awk" \ + compile-with "${AWK} -f $S/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > feeder_eq_gen.h" \ + no-obj no-implicit-rule before-depend \ + clean "feeder_eq_gen.h" +feeder_rate_gen.h optional sound \ + dependency "$S/tools/feeder_rate_mkfilter.awk" \ + compile-with "${AWK} -f $S/tools/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > feeder_rate_gen.h" \ + no-obj no-implicit-rule before-depend \ + clean "feeder_rate_gen.h" +snd_fxdiv_gen.h optional sound \ + dependency "$S/tools/snd_fxdiv_gen.awk" \ + compile-with "${AWK} -f $S/tools/snd_fxdiv_gen.awk -- > snd_fxdiv_gen.h" \ + no-obj no-implicit-rule before-depend \ + clean "snd_fxdiv_gen.h" miidevs.h optional miibus | mii \ dependency "$S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ compile-with "${AWK} -f $S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ @@ -1433,16 +1448,28 @@ dev/sound/pci/hda/hdac.c optional snd_hd dev/sound/pcm/ac97.c optional sound dev/sound/pcm/ac97_if.m optional sound dev/sound/pcm/ac97_patch.c optional sound -dev/sound/pcm/buffer.c optional sound +dev/sound/pcm/buffer.c optional sound \ + dependency "snd_fxdiv_gen.h" dev/sound/pcm/channel.c optional sound dev/sound/pcm/channel_if.m optional sound dev/sound/pcm/dsp.c optional sound -dev/sound/pcm/fake.c optional sound dev/sound/pcm/feeder.c optional sound -dev/sound/pcm/feeder_fmt.c optional sound +dev/sound/pcm/feeder_chain.c optional sound +dev/sound/pcm/feeder_eq.c optional sound \ + dependency "feeder_eq_gen.h" \ + dependency "snd_fxdiv_gen.h" dev/sound/pcm/feeder_if.m optional sound -dev/sound/pcm/feeder_rate.c optional sound -dev/sound/pcm/feeder_volume.c optional sound +dev/sound/pcm/feeder_format.c optional sound \ + dependency "snd_fxdiv_gen.h" +dev/sound/pcm/feeder_matrix.c optional sound \ + dependency "snd_fxdiv_gen.h" +dev/sound/pcm/feeder_mixer.c optional sound \ + dependency "snd_fxdiv_gen.h" +dev/sound/pcm/feeder_rate.c optional sound \ + dependency "feeder_rate_gen.h" \ + dependency "snd_fxdiv_gen.h" +dev/sound/pcm/feeder_volume.c optional sound \ + dependency "snd_fxdiv_gen.h" dev/sound/pcm/mixer.c optional sound dev/sound/pcm/mixer_if.m optional sound dev/sound/pcm/sndstat.c optional sound Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/conf/options Sun Jun 7 19:12:08 2009 (r193640) @@ -830,3 +830,12 @@ VIMAGE_GLOBALS opt_global.h # Common Flash Interface (CFI) options CFI_SUPPORT_STRATAFLASH opt_cfi.h CFI_ARMEDANDDANGEROUS opt_cfi.h + +# Sound options +SND_DEBUG opt_snd.h +SND_DIAGNOSTIC opt_snd.h +SND_FEEDER_MULTIFORMAT opt_snd.h +SND_FEEDER_FULL_MULTIFORMAT opt_snd.h +SND_FEEDER_RATE_HP opt_snd.h +SND_PCM_64 opt_snd.h +SND_OLDSTEREO opt_snd.h Modified: head/sys/dev/sound/clone.c ============================================================================== --- head/sys/dev/sound/clone.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/clone.c Sun Jun 7 19:12:08 2009 (r193640) @@ -33,6 +33,10 @@ #include #include +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #if defined(SND_DIAGNOSTIC) || defined(SND_DEBUG) #include #endif @@ -88,9 +92,9 @@ struct snd_clone { #define SND_CLONE_ASSERT(x, y) do { \ if (!(x)) \ panic y; \ -} while(0) +} while (0) #else -#define SND_CLONE_ASSERT(x...) KASSERT(x) +#define SND_CLONE_ASSERT(...) KASSERT(__VA_ARGS__) #endif /* Modified: head/sys/dev/sound/driver.c ============================================================================== --- head/sys/dev/sound/driver.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/driver.c Sun Jun 7 19:12:08 2009 (r193640) @@ -26,6 +26,10 @@ * $FreeBSD$ */ +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include static int @@ -38,7 +42,7 @@ snd_modevent(module_t mod, int type, voi case MOD_UNLOAD: break; default: - return (EOPNOTSUPP); + return (ENOTSUP); break; } return 0; Modified: head/sys/dev/sound/isa/ad1816.c ============================================================================== --- head/sys/dev/sound/isa/ad1816.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/isa/ad1816.c Sun Jun 7 19:12:08 2009 (r193640) @@ -26,6 +26,10 @@ * SUCH DAMAGE. */ +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include #include @@ -62,14 +66,14 @@ struct ad1816_info { }; static u_int32_t ad1816_fmt[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, - AFMT_MU_LAW, - AFMT_STEREO | AFMT_MU_LAW, - AFMT_A_LAW, - AFMT_STEREO | AFMT_A_LAW, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), + SND_FORMAT(AFMT_MU_LAW, 1, 0), + SND_FORMAT(AFMT_MU_LAW, 2, 0), + SND_FORMAT(AFMT_A_LAW, 1, 0), + SND_FORMAT(AFMT_A_LAW, 2, 0), 0 }; @@ -269,7 +273,7 @@ ad1816mix_set(struct snd_mixer *m, unsig return left | (right << 8); } -static int +static u_int32_t ad1816mix_setrecsrc(struct snd_mixer *m, u_int32_t src) { struct ad1816_info *ad1816 = mix_getdevinfo(m); @@ -303,7 +307,7 @@ static kobj_method_t ad1816mixer_methods KOBJMETHOD(mixer_init, ad1816mix_init), KOBJMETHOD(mixer_set, ad1816mix_set), KOBJMETHOD(mixer_setrecsrc, ad1816mix_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; MIXER_DECLARE(ad1816mixer); @@ -315,23 +319,19 @@ ad1816chan_init(kobj_t obj, void *devinf struct ad1816_info *ad1816 = devinfo; struct ad1816_chinfo *ch = (dir == PCMDIR_PLAY)? &ad1816->pch : &ad1816->rch; + ch->dir = dir; ch->parent = ad1816; ch->channel = c; ch->buffer = b; if (sndbuf_alloc(ch->buffer, ad1816->parent_dmat, 0, ad1816->bufsize) != 0) return NULL; - return ch; -} -static int -ad1816chan_setdir(kobj_t obj, void *data, int dir) -{ - struct ad1816_chinfo *ch = data; - struct ad1816_info *ad1816 = ch->parent; + sndbuf_dmasetup(ch->buffer, (dir == PCMDIR_PLAY) ? ad1816->drq1 : + ad1816->drq2); + if (SND_DMA(ch->buffer)) + sndbuf_dmasetdir(ch->buffer, dir); - sndbuf_dmasetup(ch->buffer, (dir == PCMDIR_PLAY)? ad1816->drq1 : ad1816->drq2); - ch->dir = dir; - return 0; + return ch; } static int @@ -351,7 +351,7 @@ ad1816chan_setformat(kobj_t obj, void *d ad1816_write(ad1816, 10, 0x0000); ad1816_write(ad1816, 11, 0x0000); } - switch (format & ~AFMT_STEREO) { + switch (AFMT_ENCODING(format)) { case AFMT_A_LAW: fmt = AD1816_ALAW; break; @@ -372,7 +372,7 @@ ad1816chan_setformat(kobj_t obj, void *d fmt = AD1816_U8; break; } - if (format & AFMT_STEREO) fmt |= AD1816_STEREO; + if (AFMT_CHANNEL(format) > 1) fmt |= AD1816_STEREO; io_wr(ad1816, reg, fmt); ad1816_unlock(ad1816); #if 0 @@ -382,7 +382,7 @@ ad1816chan_setformat(kobj_t obj, void *d #endif } -static int +static u_int32_t ad1816chan_setspeed(kobj_t obj, void *data, u_int32_t speed) { struct ad1816_chinfo *ch = data; @@ -395,7 +395,7 @@ ad1816chan_setspeed(kobj_t obj, void *da return speed; } -static int +static u_int32_t ad1816chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) { struct ad1816_chinfo *ch = data; @@ -456,7 +456,7 @@ ad1816chan_trigger(kobj_t obj, void *dat return 0; } -static int +static u_int32_t ad1816chan_getptr(kobj_t obj, void *data) { struct ad1816_chinfo *ch = data; @@ -471,14 +471,13 @@ ad1816chan_getcaps(kobj_t obj, void *dat static kobj_method_t ad1816chan_methods[] = { KOBJMETHOD(channel_init, ad1816chan_init), - KOBJMETHOD(channel_setdir, ad1816chan_setdir), KOBJMETHOD(channel_setformat, ad1816chan_setformat), KOBJMETHOD(channel_setspeed, ad1816chan_setspeed), KOBJMETHOD(channel_setblocksize, ad1816chan_setblocksize), KOBJMETHOD(channel_trigger, ad1816chan_trigger), KOBJMETHOD(channel_getptr, ad1816chan_getptr), KOBJMETHOD(channel_getcaps, ad1816chan_getcaps), - { 0, 0 } + KOBJMETHOD_END }; CHANNEL_DECLARE(ad1816chan); Modified: head/sys/dev/sound/isa/ess.c ============================================================================== --- head/sys/dev/sound/isa/ess.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/isa/ess.c Sun Jun 7 19:12:08 2009 (r193640) @@ -29,6 +29,10 @@ * SUCH DAMAGE. */ +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include #include @@ -50,28 +54,28 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ESS18XX_NEWSPEED static u_int32_t ess_pfmt[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, - AFMT_S8, - AFMT_STEREO | AFMT_S8, - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, - AFMT_U16_LE, - AFMT_STEREO | AFMT_U16_LE, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), + SND_FORMAT(AFMT_S8, 1, 0), + SND_FORMAT(AFMT_S8, 2, 0), + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), + SND_FORMAT(AFMT_U16_LE, 1, 0), + SND_FORMAT(AFMT_U16_LE, 2, 0), 0 }; static struct pcmchan_caps ess_playcaps = {6000, 48000, ess_pfmt, 0}; static u_int32_t ess_rfmt[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, - AFMT_S8, - AFMT_STEREO | AFMT_S8, - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, - AFMT_U16_LE, - AFMT_STEREO | AFMT_U16_LE, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), + SND_FORMAT(AFMT_S8, 1, 0), + SND_FORMAT(AFMT_S8, 2, 0), + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), + SND_FORMAT(AFMT_U16_LE, 1, 0), + SND_FORMAT(AFMT_U16_LE, 2, 0), 0 }; @@ -458,7 +462,7 @@ ess_setupch(struct ess_info *sc, int ch, { int play = (dir == PCMDIR_PLAY)? 1 : 0; int b16 = (fmt & AFMT_16BIT)? 1 : 0; - int stereo = (fmt & AFMT_STEREO)? 1 : 0; + int stereo = (AFMT_CHANNEL(fmt) > 1)? 1 : 0; int unsign = (fmt == AFMT_U8 || fmt == AFMT_U16_LE)? 1 : 0; u_int8_t spdval, fmtval; @@ -583,7 +587,7 @@ esschan_setformat(kobj_t obj, void *data return 0; } -static int +static u_int32_t esschan_setspeed(kobj_t obj, void *data, u_int32_t speed) { struct ess_chinfo *ch = data; @@ -597,7 +601,7 @@ esschan_setspeed(kobj_t obj, void *data, return ch->spd; } -static int +static u_int32_t esschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) { struct ess_chinfo *ch = data; @@ -630,7 +634,7 @@ esschan_trigger(kobj_t obj, void *data, return 0; } -static int +static u_int32_t esschan_getptr(kobj_t obj, void *data) { struct ess_chinfo *ch = data; @@ -654,7 +658,7 @@ static kobj_method_t esschan_methods[] = KOBJMETHOD(channel_trigger, esschan_trigger), KOBJMETHOD(channel_getptr, esschan_getptr), KOBJMETHOD(channel_getcaps, esschan_getcaps), - { 0, 0 } + KOBJMETHOD_END }; CHANNEL_DECLARE(esschan); @@ -741,7 +745,7 @@ essmix_set(struct snd_mixer *m, unsigned return left | (right << 8); } -static int +static u_int32_t essmix_setrecsrc(struct snd_mixer *m, u_int32_t src) { struct ess_info *sc = mix_getdevinfo(m); @@ -776,7 +780,7 @@ static kobj_method_t essmixer_methods[] KOBJMETHOD(mixer_init, essmix_init), KOBJMETHOD(mixer_set, essmix_set), KOBJMETHOD(mixer_setrecsrc, essmix_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; MIXER_DECLARE(essmixer); Modified: head/sys/dev/sound/isa/gusc.c ============================================================================== --- head/sys/dev/sound/isa/gusc.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/isa/gusc.c Sun Jun 7 19:12:08 2009 (r193640) @@ -34,7 +34,11 @@ #include #include #include -#include + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include #include #include "bus_if.h" @@ -301,11 +305,9 @@ static int gusc_attach(device_t dev) { sc_p scp; - int unit; void *ih; scp = device_get_softc(dev); - unit = device_get_unit(dev); bzero(scp, sizeof(*scp)); @@ -580,16 +582,14 @@ alloc_resource(sc_p scp) static int release_resource(sc_p scp) { - int i, lid, flags; + int i, lid; device_t dev; - flags = 0; if (isa_get_vendorid(scp->dev)) lid = isa_get_logicalid(scp->dev); - else { + else lid = LOGICALID_NOPNP; - flags = device_get_flags(scp->dev); - } + switch(lid) { case LOGICALID_PCM: case LOGICALID_NOPNP: /* XXX Non-PnP */ Modified: head/sys/dev/sound/isa/mss.c ============================================================================== --- head/sys/dev/sound/isa/mss.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/isa/mss.c Sun Jun 7 19:12:08 2009 (r193640) @@ -27,6 +27,10 @@ * SUCH DAMAGE. */ +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include SND_DECLARE_FILE("$FreeBSD$"); @@ -128,34 +132,34 @@ static int pnpmss_attach(device_t dev) static driver_intr_t opti931_intr; static u_int32_t mss_fmt[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, - AFMT_MU_LAW, - AFMT_STEREO | AFMT_MU_LAW, - AFMT_A_LAW, - AFMT_STEREO | AFMT_A_LAW, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), + SND_FORMAT(AFMT_MU_LAW, 1, 0), + SND_FORMAT(AFMT_MU_LAW, 2, 0), + SND_FORMAT(AFMT_A_LAW, 1, 0), + SND_FORMAT(AFMT_A_LAW, 2, 0), 0 }; static struct pcmchan_caps mss_caps = {4000, 48000, mss_fmt, 0}; static u_int32_t guspnp_fmt[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, - AFMT_A_LAW, - AFMT_STEREO | AFMT_A_LAW, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), + SND_FORMAT(AFMT_A_LAW, 1, 0), + SND_FORMAT(AFMT_A_LAW, 2, 0), 0 }; static struct pcmchan_caps guspnp_caps = {4000, 48000, guspnp_fmt, 0}; static u_int32_t opti931_fmt[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), 0 }; static struct pcmchan_caps opti931_caps = {4000, 48000, opti931_fmt, 0}; @@ -520,7 +524,7 @@ mssmix_set(struct snd_mixer *m, unsigned return left | (right << 8); } -static int +static u_int32_t mssmix_setrecsrc(struct snd_mixer *m, u_int32_t src) { struct mss_info *mss = mix_getdevinfo(m); @@ -535,7 +539,7 @@ static kobj_method_t mssmix_mixer_method KOBJMETHOD(mixer_init, mssmix_init), KOBJMETHOD(mixer_set, mssmix_set), KOBJMETHOD(mixer_setrecsrc, mssmix_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; MIXER_DECLARE(mssmix_mixer); @@ -604,7 +608,7 @@ ymmix_set(struct snd_mixer *m, unsigned return left | (right << 8); } -static int +static u_int32_t ymmix_setrecsrc(struct snd_mixer *m, u_int32_t src) { struct mss_info *mss = mix_getdevinfo(m); @@ -618,7 +622,7 @@ static kobj_method_t ymmix_mixer_methods KOBJMETHOD(mixer_init, ymmix_init), KOBJMETHOD(mixer_set, ymmix_set), KOBJMETHOD(mixer_setrecsrc, ymmix_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; MIXER_DECLARE(ymmix_mixer); @@ -997,7 +1001,7 @@ static int mss_format(struct mss_chinfo *ch, u_int32_t format) { struct mss_info *mss = ch->parent; - int i, arg = format & ~AFMT_STEREO; + int i, arg = AFMT_ENCODING(format); /* * The data format uses 3 bits (just 2 on the 1848). For each @@ -1014,7 +1018,7 @@ mss_format(struct mss_chinfo *ch, u_int3 ch->fmt = format; for (i = 0; i < 8; i++) if (arg == fmts[i]) break; arg = i << 1; - if (format & AFMT_STEREO) arg |= 1; + if (AFMT_CHANNEL(format) > 1) arg |= 1; arg <<= 4; ad_enter_MCE(mss); ad_write(mss, 8, (ad_read(mss, 8) & 0x0f) | arg); @@ -1035,7 +1039,7 @@ mss_trigger(struct mss_chinfo *ch, int g int retry, wr, cnt, ss; ss = 1; - ss <<= (ch->fmt & AFMT_STEREO)? 1 : 0; + ss <<= (AFMT_CHANNEL(ch->fmt) > 1)? 1 : 0; ss <<= (ch->fmt & AFMT_16BIT)? 1 : 0; wr = (ch->dir == PCMDIR_PLAY)? 1 : 0; @@ -1170,12 +1174,12 @@ msschan_setformat(kobj_t obj, void *data return 0; } -static int +static u_int32_t msschan_setspeed(kobj_t obj, void *data, u_int32_t speed) { struct mss_chinfo *ch = data; struct mss_info *mss = ch->parent; - int r; + u_int32_t r; mss_lock(mss); r = mss_speed(ch, speed); @@ -1184,7 +1188,7 @@ msschan_setspeed(kobj_t obj, void *data, return r; } -static int +static u_int32_t msschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) { struct mss_chinfo *ch = data; @@ -1211,7 +1215,7 @@ msschan_trigger(kobj_t obj, void *data, return 0; } -static int +static u_int32_t msschan_getptr(kobj_t obj, void *data) { struct mss_chinfo *ch = data; @@ -1247,7 +1251,7 @@ static kobj_method_t msschan_methods[] = KOBJMETHOD(channel_trigger, msschan_trigger), KOBJMETHOD(channel_getptr, msschan_getptr), KOBJMETHOD(channel_getcaps, msschan_getcaps), - { 0, 0 } + KOBJMETHOD_END }; CHANNEL_DECLARE(msschan); Modified: head/sys/dev/sound/isa/sb16.c ============================================================================== --- head/sys/dev/sound/isa/sb16.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/isa/sb16.c Sun Jun 7 19:12:08 2009 (r193640) @@ -29,6 +29,10 @@ * SUCH DAMAGE. */ +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include #include @@ -44,24 +48,24 @@ SND_DECLARE_FILE("$FreeBSD$"); #define PLAIN_SB16(x) ((((x)->bd_flags) & (BD_F_SB16|BD_F_SB16X)) == BD_F_SB16) static u_int32_t sb16_fmt8[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), 0 }; static struct pcmchan_caps sb16_caps8 = {5000, 45000, sb16_fmt8, 0}; static u_int32_t sb16_fmt16[] = { - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), 0 }; static struct pcmchan_caps sb16_caps16 = {5000, 45000, sb16_fmt16, 0}; static u_int32_t sb16x_fmt[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, - AFMT_S16_LE, - AFMT_STEREO | AFMT_S16_LE, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), + SND_FORMAT(AFMT_S16_LE, 1, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), 0 }; static struct pcmchan_caps sb16x_caps = {5000, 49000, sb16x_fmt, 0}; @@ -366,7 +370,7 @@ sb16mix_set(struct snd_mixer *m, unsigne return left | (right << 8); } -static int +static u_int32_t sb16mix_setrecsrc(struct snd_mixer *m, u_int32_t src) { struct sb_info *sb = mix_getdevinfo(m); @@ -420,7 +424,7 @@ static kobj_method_t sb16mix_mixer_metho KOBJMETHOD(mixer_init, sb16mix_init), KOBJMETHOD(mixer_set, sb16mix_set), KOBJMETHOD(mixer_setrecsrc, sb16mix_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; MIXER_DECLARE(sb16mix_mixer); @@ -633,7 +637,7 @@ sb_setup(struct sb_info *sb) v |= (ch->fmt & AFMT_16BIT)? DSP_DMA16 : DSP_DMA8; sb_cmd(sb, v); - v = (ch->fmt & AFMT_STEREO)? DSP_F16_STEREO : 0; + v = (AFMT_CHANNEL(ch->fmt) > 1)? DSP_F16_STEREO : 0; v |= (ch->fmt & AFMT_SIGNED)? DSP_F16_SIGNED : 0; sb_cmd2(sb, v, l); sndbuf_dma(ch->buffer, PCMTRIG_START); @@ -658,7 +662,7 @@ sb_setup(struct sb_info *sb) v |= (ch->fmt & AFMT_16BIT)? DSP_DMA16 : DSP_DMA8; sb_cmd(sb, v); - v = (ch->fmt & AFMT_STEREO)? DSP_F16_STEREO : 0; + v = (AFMT_CHANNEL(ch->fmt) > 1)? DSP_F16_STEREO : 0; v |= (ch->fmt & AFMT_SIGNED)? DSP_F16_SIGNED : 0; sb_cmd2(sb, v, l); sndbuf_dma(ch->buffer, PCMTRIG_START); @@ -700,7 +704,7 @@ sb16chan_setformat(kobj_t obj, void *dat return 0; } -static int +static u_int32_t sb16chan_setspeed(kobj_t obj, void *data, u_int32_t speed) { struct sb_chinfo *ch = data; @@ -709,7 +713,7 @@ sb16chan_setspeed(kobj_t obj, void *data return speed; } -static int +static u_int32_t sb16chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) { struct sb_chinfo *ch = data; @@ -737,7 +741,7 @@ sb16chan_trigger(kobj_t obj, void *data, return 0; } -static int +static u_int32_t sb16chan_getptr(kobj_t obj, void *data) { struct sb_chinfo *ch = data; @@ -777,7 +781,7 @@ static kobj_method_t sb16chan_methods[] KOBJMETHOD(channel_trigger, sb16chan_trigger), KOBJMETHOD(channel_getptr, sb16chan_getptr), KOBJMETHOD(channel_getcaps, sb16chan_getcaps), - { 0, 0 } + KOBJMETHOD_END }; CHANNEL_DECLARE(sb16chan); Modified: head/sys/dev/sound/isa/sb8.c ============================================================================== --- head/sys/dev/sound/isa/sb8.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/isa/sb8.c Sun Jun 7 19:12:08 2009 (r193640) @@ -29,6 +29,10 @@ * SUCH DAMAGE. */ +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include #include @@ -43,7 +47,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define SB_DEFAULT_BUFSZ 4096 static u_int32_t sb_fmt[] = { - AFMT_U8, + SND_FORMAT(AFMT_U8, 1, 0), 0 }; static struct pcmchan_caps sb200_playcaps = {4000, 23000, sb_fmt, 0}; @@ -52,8 +56,8 @@ static struct pcmchan_caps sb201_playcap static struct pcmchan_caps sb201_reccaps = {4000, 15000, sb_fmt, 0}; static u_int32_t sbpro_fmt[] = { - AFMT_U8, - AFMT_STEREO | AFMT_U8, + SND_FORMAT(AFMT_U8, 1, 0), + SND_FORMAT(AFMT_U8, 2, 0), 0 }; static struct pcmchan_caps sbpro_playcaps = {4000, 44100, sbpro_fmt, 0}; @@ -372,7 +376,7 @@ sbpromix_set(struct snd_mixer *m, unsign return left | (right << 8); } -static int +static u_int32_t sbpromix_setrecsrc(struct snd_mixer *m, u_int32_t src) { struct sb_info *sb = mix_getdevinfo(m); @@ -395,7 +399,7 @@ static kobj_method_t sbpromix_mixer_meth KOBJMETHOD(mixer_init, sbpromix_init), KOBJMETHOD(mixer_set, sbpromix_set), KOBJMETHOD(mixer_setrecsrc, sbpromix_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; MIXER_DECLARE(sbpromix_mixer); @@ -453,7 +457,7 @@ sbmix_set(struct snd_mixer *m, unsigned return left | (left << 8); } -static int +static u_int32_t sbmix_setrecsrc(struct snd_mixer *m, u_int32_t src) { return 0; @@ -463,7 +467,7 @@ static kobj_method_t sbmix_mixer_methods KOBJMETHOD(mixer_init, sbmix_init), KOBJMETHOD(mixer_set, sbmix_set), KOBJMETHOD(mixer_setrecsrc, sbmix_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; MIXER_DECLARE(sbmix_mixer); @@ -496,7 +500,7 @@ sb_speed(struct sb_chinfo *ch) { struct sb_info *sb = ch->parent; int play = (ch->dir == PCMDIR_PLAY)? 1 : 0; - int stereo = (ch->fmt & AFMT_STEREO)? 1 : 0; + int stereo = (AFMT_CHANNEL(ch->fmt) > 1)? 1 : 0; int speed, tmp, thresh, max; u_char tconst; @@ -537,7 +541,7 @@ sb_start(struct sb_chinfo *ch) { struct sb_info *sb = ch->parent; int play = (ch->dir == PCMDIR_PLAY)? 1 : 0; - int stereo = (ch->fmt & AFMT_STEREO)? 1 : 0; + int stereo = (AFMT_CHANNEL(ch->fmt) > 1)? 1 : 0; int l = ch->blksz; u_char i; @@ -614,7 +618,7 @@ sbchan_setformat(kobj_t obj, void *data, return 0; } -static int +static u_int32_t sbchan_setspeed(kobj_t obj, void *data, u_int32_t speed) { struct sb_chinfo *ch = data; @@ -623,7 +627,7 @@ sbchan_setspeed(kobj_t obj, void *data, return sb_speed(ch); } -static int +static u_int32_t sbchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) { struct sb_chinfo *ch = data; @@ -648,7 +652,7 @@ sbchan_trigger(kobj_t obj, void *data, i return 0; } -static int +static u_int32_t sbchan_getptr(kobj_t obj, void *data) { struct sb_chinfo *ch = data; @@ -677,7 +681,7 @@ static kobj_method_t sbchan_methods[] = KOBJMETHOD(channel_trigger, sbchan_trigger), KOBJMETHOD(channel_getptr, sbchan_getptr), KOBJMETHOD(channel_getcaps, sbchan_getcaps), - { 0, 0 } + KOBJMETHOD_END }; CHANNEL_DECLARE(sbchan); Modified: head/sys/dev/sound/isa/sbc.c ============================================================================== --- head/sys/dev/sound/isa/sbc.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/isa/sbc.c Sun Jun 7 19:12:08 2009 (r193640) @@ -24,6 +24,10 @@ * SUCH DAMAGE. */ +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include #include #include Modified: head/sys/dev/sound/isa/sndbuf_dma.c ============================================================================== --- head/sys/dev/sound/isa/sndbuf_dma.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/isa/sndbuf_dma.c Sun Jun 7 19:12:08 2009 (r193640) @@ -24,6 +24,10 @@ * SUCH DAMAGE. */ +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include #include Modified: head/sys/dev/sound/macio/aoa.c ============================================================================== --- head/sys/dev/sound/macio/aoa.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/macio/aoa.c Sun Jun 7 19:12:08 2009 (r193640) @@ -43,8 +43,14 @@ #include #include #include + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include #include + #include "mixer_if.h" struct aoa_dma { @@ -138,7 +144,7 @@ aoa_dma_delete(struct aoa_dma *dma) free(dma, M_DEVBUF); } -static int +static u_int32_t aoa_chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksz) { struct aoa_dma *dma = data; @@ -186,13 +192,13 @@ aoa_chan_setformat(kobj_t obj, void *dat { DPRINTF(("aoa_chan_setformat: format = %u\n", format)); - if (format != (AFMT_STEREO | AFMT_S16_BE)) + if (format != SND_FORMAT(AFMT_S16_BE, 2, 0)) return (EINVAL); return (0); } -static int +static u_int32_t aoa_chan_setspeed(kobj_t obj, void *data, u_int32_t speed) { DPRINTF(("aoa_chan_setspeed: speed = %u\n", speed)); @@ -200,7 +206,7 @@ aoa_chan_setspeed(kobj_t obj, void *data return (44100); } -static int +static u_int32_t aoa_chan_getptr(kobj_t obj, void *data) { struct aoa_dma *dma = data; @@ -332,7 +338,7 @@ aoa_interrupt(void *xsc) } static u_int32_t sc_fmt[] = { - AFMT_S16_BE | AFMT_STEREO, + SND_FORMAT(AFMT_S16_BE, 2, 0), 0 }; static struct pcmchan_caps aoa_caps = {44100, 44100, sc_fmt, 0}; @@ -352,7 +358,7 @@ static kobj_method_t aoa_chan_methods[] KOBJMETHOD(channel_trigger, aoa_chan_trigger), KOBJMETHOD(channel_getptr, aoa_chan_getptr), KOBJMETHOD(channel_getcaps, aoa_chan_getcaps), - { 0, 0 } + KOBJMETHOD_END }; CHANNEL_DECLARE(aoa_chan); Modified: head/sys/dev/sound/macio/davbus.c ============================================================================== --- head/sys/dev/sound/macio/davbus.c Sun Jun 7 18:53:25 2009 (r193639) +++ head/sys/dev/sound/macio/davbus.c Sun Jun 7 19:12:08 2009 (r193640) @@ -40,7 +40,13 @@ #include #include + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + #include + #include #include @@ -115,7 +121,7 @@ static void burgundy_set_outputs(struct static u_int burgundy_read_status(struct davbus_softc *d, u_int status); static int burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right); -static int burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src); +static u_int32_t burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src); static kobj_method_t burgundy_mixer_methods[] = { KOBJMETHOD(mixer_init, burgundy_init), @@ -123,7 +129,7 @@ static kobj_method_t burgundy_mixer_meth KOBJMETHOD(mixer_reinit, burgundy_reinit), KOBJMETHOD(mixer_set, burgundy_set), KOBJMETHOD(mixer_setrecsrc, burgundy_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; MIXER_DECLARE(burgundy_mixer); @@ -293,7 +299,7 @@ burgundy_set(struct snd_mixer *m, unsign return (0); } -static int +static u_int32_t burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src) { return (0); @@ -311,7 +317,7 @@ static void screamer_set_outputs(struct static u_int screamer_read_status(struct davbus_softc *d, u_int status); static int screamer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right); -static int screamer_setrecsrc(struct snd_mixer *m, u_int32_t src); +static u_int32_t screamer_setrecsrc(struct snd_mixer *m, u_int32_t src); static kobj_method_t screamer_mixer_methods[] = { KOBJMETHOD(mixer_init, screamer_init), @@ -319,7 +325,7 @@ static kobj_method_t screamer_mixer_meth KOBJMETHOD(mixer_reinit, screamer_reinit), KOBJMETHOD(mixer_set, screamer_set), KOBJMETHOD(mixer_setrecsrc, screamer_setrecsrc), - { 0, 0 } + KOBJMETHOD_END }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 19:25:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from miki (localhost [IPv6:::1]) by hub.freebsd.org (Postfix) with SMTP id 6986F1065672; Sun, 7 Jun 2009 19:25:28 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Date: Mon, 8 Jun 2009 03:25:00 +0800 From: Ariff Abdullah To: Ariff Abdullah Message-Id: <20090608032500.438668ae.ariff@FreeBSD.org> In-Reply-To: <200906071912.n57JC9GZ002423@svn.freebsd.org> References: <200906071912.n57JC9GZ002423@svn.freebsd.org> Organization: FreeBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Mon__8_Jun_2009_03_25_00_+0800_3Pr.XhbEDWji9dhE" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193640 - in head/sys: conf dev/sound dev/sound/isa dev/sound/macio dev/sound/midi dev/sound/pci dev/sound/pci/hda dev/sound/pcm dev/sound/sbus dev/sound/usb modules/sound/sound sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 19:25:30 -0000 --Signature=_Mon__8_Jun_2009_03_25_00_+0800_3Pr.XhbEDWji9dhE Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, 7 Jun 2009 19:12:09 +0000 (UTC) Ariff Abdullah wrote: [..] I forgot to mention about the completion of multichannel support. All that left is to visit specific driver, and make few trivial changes. Love it or hate it, have fun. -- Ariff Abdullah FreeBSD ... Recording in stereo is obviously too advanced and confusing for us idiot ***** users :P ........ ... Going with the standard and orthodox is the death of intellect .............. --Signature=_Mon__8_Jun_2009_03_25_00_+0800_3Pr.XhbEDWji9dhE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkosFAwACgkQlr+deMUwTNoE4ACfaQ5W1SYRBHI1V+lnGtGiIWQy O7cAnR7S3vlB1lyyooaLdgX4eKcBA5Aq =KSST -----END PGP SIGNATURE----- --Signature=_Mon__8_Jun_2009_03_25_00_+0800_3Pr.XhbEDWji9dhE-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 19:36:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 125E6106568D; Sun, 7 Jun 2009 19:36:26 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F34F68FC23; Sun, 7 Jun 2009 19:36:25 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57JaPBn002997; Sun, 7 Jun 2009 19:36:25 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57JaPcW002996; Sun, 7 Jun 2009 19:36:25 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906071936.n57JaPcW002996@svn.freebsd.org> From: Ariff Abdullah Date: Sun, 7 Jun 2009 19:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193642 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 19:36:28 -0000 Author: ariff Date: Sun Jun 7 19:36:25 2009 New Revision: 193642 URL: http://svn.freebsd.org/changeset/base/193642 Log: Bump driver revision (should have bumped it earlier). 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 Jun 7 19:12:40 2009 (r193641) +++ head/sys/dev/sound/pci/hda/hdac.c Sun Jun 7 19:36:25 2009 (r193642) @@ -87,7 +87,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090601_0133" +#define HDA_DRV_TEST_REV "20090608_0134" SND_DECLARE_FILE("$FreeBSD$"); From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 19:38:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F422106567C; Sun, 7 Jun 2009 19:38:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8CD8FC12; Sun, 7 Jun 2009 19:38:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57JcRSO003069; Sun, 7 Jun 2009 19:38:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57JcQgE003064; Sun, 7 Jun 2009 19:38:26 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906071938.n57JcQgE003064@svn.freebsd.org> From: Alan Cox Date: Sun, 7 Jun 2009 19:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193643 - in head/sys: kern vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 19:38:27 -0000 Author: alc Date: Sun Jun 7 19:38:26 2009 New Revision: 193643 URL: http://svn.freebsd.org/changeset/base/193643 Log: Eliminate unnecessary obfuscation when testing a page's valid bits. Modified: head/sys/kern/kern_exec.c head/sys/kern/vfs_cluster.c head/sys/vm/vm_fault.c head/sys/vm/vm_glue.c head/sys/vm/vm_map.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Jun 7 19:36:25 2009 (r193642) +++ head/sys/kern/kern_exec.c Sun Jun 7 19:38:26 2009 (r193643) @@ -927,7 +927,7 @@ exec_map_first_page(imgp) } #endif ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - if ((ma[0]->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) { + if (ma[0]->valid != VM_PAGE_BITS_ALL) { initial_pagein = VM_INITIAL_PAGEIN; if (initial_pagein > object->size) initial_pagein = object->size; Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Sun Jun 7 19:36:25 2009 (r193642) +++ head/sys/kern/vfs_cluster.c Sun Jun 7 19:38:26 2009 (r193643) @@ -455,7 +455,7 @@ cluster_rbuild(vp, filesize, lbn, blkno, bp->b_pages[bp->b_npages] = m; bp->b_npages++; } - if ((m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) + if (m->valid == VM_PAGE_BITS_ALL) tbp->b_pages[j] = bogus_page; } VM_OBJECT_UNLOCK(tbp->b_bufobj->bo_object); @@ -482,10 +482,8 @@ cluster_rbuild(vp, filesize, lbn, blkno, VM_OBJECT_LOCK(bp->b_bufobj->bo_object); for (j = 0; j < bp->b_npages; j++) { VM_OBJECT_LOCK_ASSERT(bp->b_pages[j]->object, MA_OWNED); - if ((bp->b_pages[j]->valid & VM_PAGE_BITS_ALL) == - VM_PAGE_BITS_ALL) { + if (bp->b_pages[j]->valid == VM_PAGE_BITS_ALL) bp->b_pages[j] = bogus_page; - } } VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); if (bp->b_bufsize > bp->b_kvasize) Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Jun 7 19:36:25 2009 (r193642) +++ head/sys/vm/vm_fault.c Sun Jun 7 19:38:26 2009 (r193643) @@ -394,7 +394,7 @@ RetryFault:; * found the page ). */ vm_page_busy(fs.m); - if (((fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) && + if (fs.m->valid != VM_PAGE_BITS_ALL && fs.m->object != kernel_object && fs.m->object != kmem_object) { goto readrest; } @@ -433,7 +433,7 @@ RetryFault:; unlock_and_deallocate(&fs); VM_WAITPFAULT; goto RetryFault; - } else if ((fs.m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) + } else if (fs.m->valid == VM_PAGE_BITS_ALL) break; } @@ -1024,9 +1024,8 @@ vm_fault_prefault(pmap_t pmap, vm_offset VM_OBJECT_UNLOCK(lobject); break; } - if (((m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && + if (m->valid == VM_PAGE_BITS_ALL && (m->flags & PG_FICTITIOUS) == 0) { - vm_page_lock_queues(); pmap_enter_quick(pmap, addr, m, entry->protection); vm_page_unlock_queues(); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sun Jun 7 19:36:25 2009 (r193642) +++ head/sys/vm/vm_glue.c Sun Jun 7 19:38:26 2009 (r193643) @@ -253,7 +253,7 @@ vm_imgact_hold_page(vm_object_t object, VM_OBJECT_LOCK(object); pindex = OFF_TO_IDX(offset); m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - if ((m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) { + if (m->valid != VM_PAGE_BITS_ALL) { ma[0] = m; rv = vm_pager_get_pages(object, ma, 1, 0); m = vm_page_lookup(object, pindex); Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Jun 7 19:36:25 2009 (r193642) +++ head/sys/vm/vm_map.c Sun Jun 7 19:38:26 2009 (r193643) @@ -1683,7 +1683,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse psize = tmpidx; break; } - if ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) { + if (p->valid == VM_PAGE_BITS_ALL) { if (p_start == NULL) { start = addr + ptoa(tmpidx); p_start = p; From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 19:41:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8500810656A5; Sun, 7 Jun 2009 19:41:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70D5E8FC12; Sun, 7 Jun 2009 19:41:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57JfC0p003171; Sun, 7 Jun 2009 19:41:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57JfC52003163; Sun, 7 Jun 2009 19:41:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906071941.n57JfC52003163@svn.freebsd.org> From: Andrew Thompson Date: Sun, 7 Jun 2009 19:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193644 - in head/sys: compat/ndis dev/usb dev/usb/controller dev/usb/serial dev/usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 19:41:13 -0000 Author: thompsa Date: Sun Jun 7 19:41:11 2009 New Revision: 193644 URL: http://svn.freebsd.org/changeset/base/193644 Log: Rename usb pipes to endpoints as it better represents what they are, and struct usb_pipe may be used for a different purpose later on. Modified: head/sys/compat/ndis/subr_usbd.c head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb.h head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_compat_linux.h head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_debug.c head/sys/dev/usb/usb_debug.h head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_handle_request.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usb_transfer.h Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Sun Jun 7 19:38:26 2009 (r193643) +++ head/sys/compat/ndis/subr_usbd.c Sun Jun 7 19:41:11 2009 (r193644) @@ -520,7 +520,7 @@ usbd_func_selconf(ip) int i, j; struct ndis_softc *sc = device_get_softc(dev); struct usb_device *udev = sc->ndisusb_dev; - struct usb_pipe *p = NULL; + struct usb_endpoint *ep = NULL; struct usbd_interface_information *intf; struct usbd_pipe_information *pipe; struct usbd_urb_select_configuration *selconf; @@ -549,14 +549,14 @@ usbd_func_selconf(ip) return usbd_usb2urb(ret); } - for (j = 0; (p = usb2_pipe_foreach(udev, p)); j++) { + for (j = 0; (ep = usb2_endpoint_foreach(udev, ep)); j++) { if (j >= intf->uii_numeps) { device_printf(dev, "endpoint %d and above are ignored", intf->uii_numeps); break; } - edesc = p->edesc; + edesc = ep->edesc; pipe = &intf->uii_pipes[j]; pipe->upi_handle = edesc; pipe->upi_epaddr = edesc->bEndpointAddress; Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Sun Jun 7 19:38:26 2009 (r193643) +++ head/sys/dev/usb/controller/at91dci.c Sun Jun 7 19:41:11 2009 (r193644) @@ -687,7 +687,7 @@ at91dci_xfer_do_fifo(struct usb_xfer *xf done: sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - temp = (xfer->endpoint & UE_ADDR); + temp = (xfer->endpointno & UE_ADDR); /* update FIFO bank flag and multi buffer */ if (td->fifo_bank) { @@ -864,7 +864,7 @@ at91dci_setup_standard_chain(struct usb_ uint8_t need_sync; DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", - xfer->address, UE_GET_ADDR(xfer->endpoint), + xfer->address, UE_GET_ADDR(xfer->endpointno), xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.max_frame_size = xfer->max_frame_size; @@ -882,7 +882,7 @@ at91dci_setup_standard_chain(struct usb_ temp.did_stall = !xfer->flags_int.control_stall; sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - ep_no = (xfer->endpoint & UE_ADDR); + ep_no = (xfer->endpointno & UE_ADDR); /* check if we should prepend a setup message */ @@ -908,7 +908,7 @@ at91dci_setup_standard_chain(struct usb_ } if (x != xfer->nframes) { - if (xfer->endpoint & UE_DIR_IN) { + if (xfer->endpointno & UE_DIR_IN) { temp.func = &at91dci_data_tx; need_sync = 1; } else { @@ -984,7 +984,7 @@ at91dci_setup_standard_chain(struct usb_ * Send a DATA1 message and invert the current * endpoint direction. */ - if (xfer->endpoint & UE_DIR_IN) { + if (xfer->endpointno & UE_DIR_IN) { temp.func = &at91dci_data_rx; need_sync = 0; } else { @@ -1034,7 +1034,7 @@ at91dci_start_standard_chain(struct usb_ if (at91dci_xfer_do_fifo(xfer)) { struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - uint8_t ep_no = xfer->endpoint & UE_ADDR; + uint8_t ep_no = xfer->endpointno & UE_ADDR; /* * Only enable the endpoint interrupt when we are actually @@ -1139,8 +1139,8 @@ at91dci_standard_done(struct usb_xfer *x { usb_error_t err = 0; - DPRINTFN(13, "xfer=%p pipe=%p transfer done\n", - xfer, xfer->pipe); + DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", + xfer, xfer->endpoint); /* reset scanner */ @@ -1191,11 +1191,11 @@ at91dci_device_done(struct usb_xfer *xfe USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n", - xfer, xfer->pipe, error); + DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", + xfer, xfer->endpoint, error); if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { - ep_no = (xfer->endpoint & UE_ADDR); + ep_no = (xfer->endpointno & UE_ADDR); /* disable endpoint interrupt */ AT91_UDP_WRITE_4(sc, AT91_UDP_IDR, AT91_UDP_INT_EP(ep_no)); @@ -1208,7 +1208,7 @@ at91dci_device_done(struct usb_xfer *xfe static void at91dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer, - struct usb_pipe *pipe) + struct usb_endpoint *ep) { struct at91dci_softc *sc; uint32_t csr_val; @@ -1216,7 +1216,7 @@ at91dci_set_stall(struct usb_device *ude USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); - DPRINTFN(5, "pipe=%p\n", pipe); + DPRINTFN(5, "endpoint=%p\n", ep); if (xfer) { /* cancel any ongoing transfers */ @@ -1224,7 +1224,7 @@ at91dci_set_stall(struct usb_device *ude } /* set FORCESTALL */ sc = AT9100_DCI_BUS2SC(udev->bus); - csr_reg = (pipe->edesc->bEndpointAddress & UE_ADDR); + csr_reg = (ep->edesc->bEndpointAddress & UE_ADDR); csr_reg = AT91_UDP_CSR(csr_reg); csr_val = AT91_UDP_READ_4(sc, csr_reg); AT91_CSR_ACK(csr_val, AT91_UDP_CSR_FORCESTALL); @@ -1328,12 +1328,12 @@ at91dci_clear_stall_sub(struct at91dci_s } static void -at91dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe) +at91dci_clear_stall(struct usb_device *udev, struct usb_endpoint *ep) { struct at91dci_softc *sc; struct usb_endpoint_descriptor *ed; - DPRINTFN(5, "pipe=%p\n", pipe); + DPRINTFN(5, "endpoint=%p\n", ep); USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); @@ -1346,7 +1346,7 @@ at91dci_clear_stall(struct usb_device *u sc = AT9100_DCI_BUS2SC(udev->bus); /* get endpoint descriptor */ - ed = pipe->edesc; + ed = ep->edesc; /* reset endpoint */ at91dci_clear_stall_sub(sc, @@ -1598,7 +1598,7 @@ at91dci_device_isoc_fs_enter(struct usb_ uint32_t nframes; DPRINTFN(6, "xfer=%p next=%d nframes=%d\n", - xfer, xfer->pipe->isoc_next, xfer->nframes); + xfer, xfer->endpoint->isoc_next, xfer->nframes); /* get the current frame index */ @@ -1608,25 +1608,25 @@ at91dci_device_isoc_fs_enter(struct usb_ * check if the frame index is within the window where the frames * will be inserted */ - temp = (nframes - xfer->pipe->isoc_next) & AT91_UDP_FRM_MASK; + temp = (nframes - xfer->endpoint->isoc_next) & AT91_UDP_FRM_MASK; - if ((xfer->pipe->is_synced == 0) || + if ((xfer->endpoint->is_synced == 0) || (temp < xfer->nframes)) { /* - * If there is data underflow or the pipe queue is + * If there is data underflow or the endpoint queue is * empty we schedule the transfer a few frames ahead * of the current frame position. Else two isochronous * transfers might overlap. */ - xfer->pipe->isoc_next = (nframes + 3) & AT91_UDP_FRM_MASK; - xfer->pipe->is_synced = 1; - DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next); + xfer->endpoint->isoc_next = (nframes + 3) & AT91_UDP_FRM_MASK; + xfer->endpoint->is_synced = 1; + DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next); } /* * compute how many milliseconds the insertion is ahead of the * current frame position: */ - temp = (xfer->pipe->isoc_next - nframes) & AT91_UDP_FRM_MASK; + temp = (xfer->endpoint->isoc_next - nframes) & AT91_UDP_FRM_MASK; /* * pre-compute when the isochronous transfer will be finished: @@ -1636,7 +1636,7 @@ at91dci_device_isoc_fs_enter(struct usb_ xfer->nframes; /* compute frame number for next insertion */ - xfer->pipe->isoc_next += xfer->nframes; + xfer->endpoint->isoc_next += xfer->nframes; /* setup TDs */ at91dci_setup_standard_chain(xfer); @@ -2208,7 +2208,7 @@ at91dci_xfer_setup(struct usb_setup_para */ if (ntd) { - ep_no = xfer->endpoint & UE_ADDR; + ep_no = xfer->endpointno & UE_ADDR; at91dci_get_hw_ep_profile(parm->udev, &pf, ep_no); if (pf == NULL) { @@ -2258,13 +2258,13 @@ at91dci_xfer_unsetup(struct usb_xfer *xf } static void -at91dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, - struct usb_pipe *pipe) +at91dci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, + struct usb_endpoint *ep) { struct at91dci_softc *sc = AT9100_DCI_BUS2SC(udev->bus); - DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n", - pipe, udev->address, + DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n", + ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode, sc->sc_rt_addr); @@ -2280,16 +2280,16 @@ at91dci_pipe_init(struct usb_device *ude } switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_CONTROL: - pipe->methods = &at91dci_device_ctrl_methods; + ep->methods = &at91dci_device_ctrl_methods; break; case UE_INTERRUPT: - pipe->methods = &at91dci_device_intr_methods; + ep->methods = &at91dci_device_intr_methods; break; case UE_ISOCHRONOUS: - pipe->methods = &at91dci_device_isoc_fs_methods; + ep->methods = &at91dci_device_isoc_fs_methods; break; case UE_BULK: - pipe->methods = &at91dci_device_bulk_methods; + ep->methods = &at91dci_device_bulk_methods; break; default: /* do nothing */ @@ -2300,7 +2300,7 @@ at91dci_pipe_init(struct usb_device *ude struct usb_bus_methods at91dci_bus_methods = { - .pipe_init = &at91dci_pipe_init, + .endpoint_init = &at91dci_ep_init, .xfer_setup = &at91dci_xfer_setup, .xfer_unsetup = &at91dci_xfer_unsetup, .get_hw_ep_profile = &at91dci_get_hw_ep_profile, Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Jun 7 19:38:26 2009 (r193643) +++ head/sys/dev/usb/controller/atmegadci.c Sun Jun 7 19:41:11 2009 (r193644) @@ -767,7 +767,7 @@ atmegadci_setup_standard_chain(struct us uint8_t need_sync; DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", - xfer->address, UE_GET_ADDR(xfer->endpoint), + xfer->address, UE_GET_ADDR(xfer->endpointno), xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.max_frame_size = xfer->max_frame_size; @@ -785,7 +785,7 @@ atmegadci_setup_standard_chain(struct us temp.did_stall = !xfer->flags_int.control_stall; sc = ATMEGA_BUS2SC(xfer->xroot->bus); - ep_no = (xfer->endpoint & UE_ADDR); + ep_no = (xfer->endpointno & UE_ADDR); /* check if we should prepend a setup message */ @@ -811,7 +811,7 @@ atmegadci_setup_standard_chain(struct us } if (x != xfer->nframes) { - if (xfer->endpoint & UE_DIR_IN) { + if (xfer->endpointno & UE_DIR_IN) { temp.func = &atmegadci_data_tx; need_sync = 1; } else { @@ -886,7 +886,7 @@ atmegadci_setup_standard_chain(struct us * Send a DATA1 message and invert the current * endpoint direction. */ - if (xfer->endpoint & UE_DIR_IN) { + if (xfer->endpointno & UE_DIR_IN) { temp.func = &atmegadci_data_rx; need_sync = 0; } else { @@ -1022,8 +1022,8 @@ atmegadci_standard_done(struct usb_xfer { usb_error_t err = 0; - DPRINTFN(13, "xfer=%p pipe=%p transfer done\n", - xfer, xfer->pipe); + DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", + xfer, xfer->endpoint); /* reset scanner */ @@ -1074,11 +1074,11 @@ atmegadci_device_done(struct usb_xfer *x USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - DPRINTFN(9, "xfer=%p, pipe=%p, error=%d\n", - xfer, xfer->pipe, error); + DPRINTFN(9, "xfer=%p, endpoint=%p, error=%d\n", + xfer, xfer->endpoint, error); if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { - ep_no = (xfer->endpoint & UE_ADDR); + ep_no = (xfer->endpointno & UE_ADDR); /* select endpoint number */ ATMEGA_WRITE_1(sc, ATMEGA_UENUM, ep_no); @@ -1094,14 +1094,14 @@ atmegadci_device_done(struct usb_xfer *x static void atmegadci_set_stall(struct usb_device *udev, struct usb_xfer *xfer, - struct usb_pipe *pipe) + struct usb_endpoint *ep) { struct atmegadci_softc *sc; uint8_t ep_no; USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); - DPRINTFN(5, "pipe=%p\n", pipe); + DPRINTFN(5, "endpoint=%p\n", ep); if (xfer) { /* cancel any ongoing transfers */ @@ -1109,7 +1109,7 @@ atmegadci_set_stall(struct usb_device *u } sc = ATMEGA_BUS2SC(udev->bus); /* get endpoint number */ - ep_no = (pipe->edesc->bEndpointAddress & UE_ADDR); + ep_no = (ep->edesc->bEndpointAddress & UE_ADDR); /* select endpoint number */ ATMEGA_WRITE_1(sc, ATMEGA_UENUM, ep_no); /* set stall */ @@ -1178,12 +1178,12 @@ atmegadci_clear_stall_sub(struct atmegad } static void -atmegadci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe) +atmegadci_clear_stall(struct usb_device *udev, struct usb_endpoint *ep) { struct atmegadci_softc *sc; struct usb_endpoint_descriptor *ed; - DPRINTFN(5, "pipe=%p\n", pipe); + DPRINTFN(5, "endpoint=%p\n", ep); USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); @@ -1196,7 +1196,7 @@ atmegadci_clear_stall(struct usb_device sc = ATMEGA_BUS2SC(udev->bus); /* get endpoint descriptor */ - ed = pipe->edesc; + ed = ep->edesc; /* reset endpoint */ atmegadci_clear_stall_sub(sc, @@ -1415,7 +1415,7 @@ atmegadci_device_isoc_fs_enter(struct us uint32_t nframes; DPRINTFN(6, "xfer=%p next=%d nframes=%d\n", - xfer, xfer->pipe->isoc_next, xfer->nframes); + xfer, xfer->endpoint->isoc_next, xfer->nframes); /* get the current frame index */ @@ -1429,9 +1429,9 @@ atmegadci_device_isoc_fs_enter(struct us * check if the frame index is within the window where the frames * will be inserted */ - temp = (nframes - xfer->pipe->isoc_next) & ATMEGA_FRAME_MASK; + temp = (nframes - xfer->endpoint->isoc_next) & ATMEGA_FRAME_MASK; - if ((xfer->pipe->is_synced == 0) || + if ((xfer->endpoint->is_synced == 0) || (temp < xfer->nframes)) { /* * If there is data underflow or the pipe queue is @@ -1439,15 +1439,15 @@ atmegadci_device_isoc_fs_enter(struct us * of the current frame position. Else two isochronous * transfers might overlap. */ - xfer->pipe->isoc_next = (nframes + 3) & ATMEGA_FRAME_MASK; - xfer->pipe->is_synced = 1; - DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next); + xfer->endpoint->isoc_next = (nframes + 3) & ATMEGA_FRAME_MASK; + xfer->endpoint->is_synced = 1; + DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next); } /* * compute how many milliseconds the insertion is ahead of the * current frame position: */ - temp = (xfer->pipe->isoc_next - nframes) & ATMEGA_FRAME_MASK; + temp = (xfer->endpoint->isoc_next - nframes) & ATMEGA_FRAME_MASK; /* * pre-compute when the isochronous transfer will be finished: @@ -1457,7 +1457,7 @@ atmegadci_device_isoc_fs_enter(struct us xfer->nframes; /* compute frame number for next insertion */ - xfer->pipe->isoc_next += xfer->nframes; + xfer->endpoint->isoc_next += xfer->nframes; /* setup TDs */ atmegadci_setup_standard_chain(xfer); @@ -2022,7 +2022,7 @@ atmegadci_xfer_setup(struct usb_setup_pa /* * compute maximum number of TDs */ - if ((xfer->pipe->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL) { + if ((xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL) { ntd = xfer->nframes + 1 /* STATUS */ + 1 /* SYNC 1 */ + 1 /* SYNC 2 */ ; @@ -2045,7 +2045,7 @@ atmegadci_xfer_setup(struct usb_setup_pa /* * get profile stuff */ - ep_no = xfer->endpoint & UE_ADDR; + ep_no = xfer->endpointno & UE_ADDR; atmegadci_get_hw_ep_profile(parm->udev, &pf, ep_no); if (pf == NULL) { @@ -2088,13 +2088,13 @@ atmegadci_xfer_unsetup(struct usb_xfer * } static void -atmegadci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, - struct usb_pipe *pipe) +atmegadci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, + struct usb_endpoint *ep) { struct atmegadci_softc *sc = ATMEGA_BUS2SC(udev->bus); - DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d,%d)\n", - pipe, udev->address, + DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d,%d)\n", + ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode, sc->sc_rt_addr, udev->device_index); @@ -2109,15 +2109,15 @@ atmegadci_pipe_init(struct usb_device *u return; } if ((edesc->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS) - pipe->methods = &atmegadci_device_isoc_fs_methods; + ep->methods = &atmegadci_device_isoc_fs_methods; else - pipe->methods = &atmegadci_device_non_isoc_methods; + ep->methods = &atmegadci_device_non_isoc_methods; } } struct usb_bus_methods atmegadci_bus_methods = { - .pipe_init = &atmegadci_pipe_init, + .endpoint_init = &atmegadci_ep_init, .xfer_setup = &atmegadci_xfer_setup, .xfer_unsetup = &atmegadci_xfer_unsetup, .get_hw_ep_profile = &atmegadci_get_hw_ep_profile, Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Sun Jun 7 19:38:26 2009 (r193643) +++ head/sys/dev/usb/controller/avr32dci.c Sun Jun 7 19:41:11 2009 (r193644) @@ -1062,7 +1062,7 @@ avr32dci_device_done(struct usb_xfer *xf static void avr32dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer, - struct usb_pipe *pipe) + struct usb_endpoint *ep) { struct avr32dci_softc *sc; uint8_t ep_no; @@ -1148,7 +1148,7 @@ avr32dci_clear_stall_sub(struct avr32dci } static void -avr32dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe) +avr32dci_clear_stall(struct usb_device *udev, struct usb_endpoint *ep) { struct avr32dci_softc *sc; struct usb_endpoint_descriptor *ed; @@ -2025,8 +2025,8 @@ avr32dci_xfer_unsetup(struct usb_xfer *x } static void -avr32dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, - struct usb_pipe *pipe) +avr32dci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, + struct usb_endpoint *ep) { struct avr32dci_softc *sc = AVR32_BUS2SC(udev->bus); @@ -2055,7 +2055,7 @@ avr32dci_pipe_init(struct usb_device *ud struct usb_bus_methods avr32dci_bus_methods = { - .pipe_init = &avr32dci_pipe_init, + .endpoint_init = &avr32dci_ep_init, .xfer_setup = &avr32dci_xfer_setup, .xfer_unsetup = &avr32dci_xfer_unsetup, .get_hw_ep_profile = &avr32dci_get_hw_ep_profile, Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sun Jun 7 19:38:26 2009 (r193643) +++ head/sys/dev/usb/controller/ehci.c Sun Jun 7 19:41:11 2009 (r193644) @@ -1190,14 +1190,14 @@ ehci_non_isoc_done_sub(struct usb_xfer * /* update data toggle */ - xfer->pipe->toggle_next = + xfer->endpoint->toggle_next = (status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0; #if USB_DEBUG if (status & EHCI_QTD_STATERRS) { DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x" "status=%s%s%s%s%s%s%s%s\n", - xfer->address, xfer->endpoint, xfer->aframes, + xfer->address, xfer->endpointno, xfer->aframes, (status & EHCI_QTD_ACTIVE) ? "[ACTIVE]" : "[NOT_ACTIVE]", (status & EHCI_QTD_HALTED) ? "[HALTED]" : "", (status & EHCI_QTD_BUFERR) ? "[BUFERR]" : "", @@ -1218,8 +1218,8 @@ ehci_non_isoc_done(struct usb_xfer *xfer { usb_error_t err = 0; - DPRINTFN(13, "xfer=%p pipe=%p transfer done\n", - xfer, xfer->pipe); + DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", + xfer, xfer->endpoint); #if USB_DEBUG if (ehcidebug > 10) { @@ -1274,7 +1274,7 @@ done: static uint8_t ehci_check_transfer(struct usb_xfer *xfer) { - struct usb_pipe_methods *methods = xfer->pipe->methods; + struct usb_pipe_methods *methods = xfer->endpoint->methods; ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); uint32_t status; @@ -1716,7 +1716,7 @@ ehci_setup_standard_chain(struct usb_xfe uint32_t x; DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", - xfer->address, UE_GET_ADDR(xfer->endpoint), + xfer->address, UE_GET_ADDR(xfer->endpointno), xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.average = xfer->max_hc_frame_size; @@ -1739,7 +1739,7 @@ ehci_setup_standard_chain(struct usb_xfe temp.setup_alt_next = xfer->flags_int.short_frames_ok; if (xfer->flags_int.control_xfr) { - if (xfer->pipe->toggle_next) { + if (xfer->endpoint->toggle_next) { /* DATA1 is next */ temp.qtd_status |= htohc32(temp.sc, EHCI_QTD_SET_TOGGLE(1)); @@ -1827,7 +1827,7 @@ ehci_setup_standard_chain(struct usb_xfe /* set endpoint direction */ temp.qtd_status |= - (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) ? + (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) ? htohc32(temp.sc, EHCI_QTD_ACTIVE | EHCI_QTD_SET_PID(EHCI_QTD_PID_IN)) : htohc32(temp.sc, EHCI_QTD_ACTIVE | @@ -1849,7 +1849,7 @@ ehci_setup_standard_chain(struct usb_xfe temp.qtd_status &= htohc32(temp.sc, EHCI_QTD_SET_CERR(3) | EHCI_QTD_SET_TOGGLE(1)); temp.qtd_status |= - (UE_GET_DIR(xfer->endpoint) == UE_DIR_OUT) ? + (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT) ? htohc32(temp.sc, EHCI_QTD_ACTIVE | EHCI_QTD_SET_PID(EHCI_QTD_PID_IN) | EHCI_QTD_SET_TOGGLE(1)) : @@ -1881,13 +1881,13 @@ ehci_setup_standard_chain(struct usb_xfe #if USB_DEBUG if (ehcidebug > 8) { DPRINTF("nexttog=%d; data before transfer:\n", - xfer->pipe->toggle_next); + xfer->endpoint->toggle_next); ehci_dump_sqtds(temp.sc, xfer->td_transfer_first); } #endif - methods = xfer->pipe->methods; + methods = xfer->endpoint->methods; qh = xfer->qh_start[xfer->flags_int.curr_dma_set]; @@ -1895,7 +1895,7 @@ ehci_setup_standard_chain(struct usb_xfe qh_endp = (EHCI_QH_SET_ADDR(xfer->address) | - EHCI_QH_SET_ENDPT(UE_GET_ADDR(xfer->endpoint)) | + EHCI_QH_SET_ENDPT(UE_GET_ADDR(xfer->endpointno)) | EHCI_QH_SET_MPL(xfer->max_packet_size)); if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { @@ -1943,7 +1943,7 @@ ehci_setup_standard_chain(struct usb_xfe qh->qh_endp &= htohc32(temp.sc, ~EHCI_QH_DTC); - if (xfer->pipe->toggle_next) { + if (xfer->endpoint->toggle_next) { /* DATA1 is next */ qh->qh_qtd.qtd_status |= htohc32(temp.sc, EHCI_QTD_SET_TOGGLE(1)); @@ -1999,8 +1999,8 @@ ehci_isoc_fs_done(ehci_softc_t *sc, stru ehci_sitd_t *td = xfer->td_transfer_first; ehci_sitd_t **pp_last = &sc->sc_isoc_fs_p_last[xfer->qh_pos]; - DPRINTFN(13, "xfer=%p pipe=%p transfer done\n", - xfer, xfer->pipe); + DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", + xfer, xfer->endpoint); while (nframes--) { if (td == NULL) { @@ -2053,8 +2053,8 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru ehci_itd_t *td = xfer->td_transfer_first; ehci_itd_t **pp_last = &sc->sc_isoc_hs_p_last[xfer->qh_pos]; - DPRINTFN(13, "xfer=%p pipe=%p transfer done\n", - xfer, xfer->pipe); + DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", + xfer, xfer->endpoint); while (nframes--) { if (td == NULL) { @@ -2113,20 +2113,20 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru static void ehci_device_done(struct usb_xfer *xfer, usb_error_t error) { - struct usb_pipe_methods *methods = xfer->pipe->methods; + struct usb_pipe_methods *methods = xfer->endpoint->methods; ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n", - xfer, xfer->pipe, error); + DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", + xfer, xfer->endpoint, error); if ((methods == &ehci_device_bulk_methods) || (methods == &ehci_device_ctrl_methods)) { #if USB_DEBUG if (ehcidebug > 8) { DPRINTF("nexttog=%d; data after transfer:\n", - xfer->pipe->toggle_next); + xfer->endpoint->toggle_next); ehci_dump_sqtds(sc, xfer->td_transfer_first); } @@ -2358,11 +2358,11 @@ ehci_device_isoc_fs_open(struct usb_xfer sitd_portaddr = EHCI_SITD_SET_ADDR(xfer->address) | - EHCI_SITD_SET_ENDPT(UE_GET_ADDR(xfer->endpoint)) | + EHCI_SITD_SET_ENDPT(UE_GET_ADDR(xfer->endpointno)) | EHCI_SITD_SET_HUBA(xfer->xroot->udev->hs_hub_addr) | EHCI_SITD_SET_PORT(xfer->xroot->udev->hs_port_no); - if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) { + if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) { sitd_portaddr |= EHCI_SITD_SET_DIR_IN; } sitd_portaddr = htohc32(sc, sitd_portaddr); @@ -2422,7 +2422,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe #endif DPRINTFN(6, "xfer=%p next=%d nframes=%d\n", - xfer, xfer->pipe->isoc_next, xfer->nframes); + xfer, xfer->endpoint->isoc_next, xfer->nframes); /* get the current frame index */ @@ -2432,10 +2432,10 @@ ehci_device_isoc_fs_enter(struct usb_xfe * check if the frame index is within the window where the frames * will be inserted */ - buf_offset = (nframes - xfer->pipe->isoc_next) & + buf_offset = (nframes - xfer->endpoint->isoc_next) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); - if ((xfer->pipe->is_synced == 0) || + if ((xfer->endpoint->is_synced == 0) || (buf_offset < xfer->nframes)) { /* * If there is data underflow or the pipe queue is empty we @@ -2443,16 +2443,16 @@ ehci_device_isoc_fs_enter(struct usb_xfe * frame position. Else two isochronous transfers might * overlap. */ - xfer->pipe->isoc_next = (nframes + 3) & + xfer->endpoint->isoc_next = (nframes + 3) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); - xfer->pipe->is_synced = 1; - DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next); + xfer->endpoint->is_synced = 1; + DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next); } /* * compute how many milliseconds the insertion is ahead of the * current frame position: */ - buf_offset = (xfer->pipe->isoc_next - nframes) & + buf_offset = (xfer->endpoint->isoc_next - nframes) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); /* @@ -2478,11 +2478,11 @@ ehci_device_isoc_fs_enter(struct usb_xfe td = xfer->td_start[xfer->flags_int.curr_dma_set]; xfer->td_transfer_first = td; - pp_last = &sc->sc_isoc_fs_p_last[xfer->pipe->isoc_next]; + pp_last = &sc->sc_isoc_fs_p_last[xfer->endpoint->isoc_next]; /* store starting position */ - xfer->qh_pos = xfer->pipe->isoc_next; + xfer->qh_pos = xfer->endpoint->isoc_next; fss = fss_start + (xfer->qh_pos % USB_ISOC_TIME_MAX); @@ -2543,7 +2543,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe temp = 0; } - if (UE_GET_DIR(xfer->endpoint) == UE_DIR_OUT) { + if (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT) { tlen = *plen; if (tlen <= 188) { temp |= 1; /* T-count = 1, TP = ALL */ @@ -2609,7 +2609,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe xfer->td_transfer_last = td_last; /* update isoc_next */ - xfer->pipe->isoc_next = (pp_last - &sc->sc_isoc_fs_p_last[0]) & + xfer->endpoint->isoc_next = (pp_last - &sc->sc_isoc_fs_p_last[0]) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); } @@ -2658,13 +2658,13 @@ ehci_device_isoc_hs_open(struct usb_xfer /* set endpoint and address */ td->itd_bp[0] = htohc32(sc, EHCI_ITD_SET_ADDR(xfer->address) | - EHCI_ITD_SET_ENDPT(UE_GET_ADDR(xfer->endpoint))); + EHCI_ITD_SET_ENDPT(UE_GET_ADDR(xfer->endpointno))); temp = EHCI_ITD_SET_MPL(xfer->max_packet_size & 0x7FF); /* set direction */ - if (UE_GET_DIR(xfer->endpoint) == UE_DIR_IN) { + if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) { temp |= EHCI_ITD_SET_DIR_IN; } /* set maximum packet size */ @@ -2708,7 +2708,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe #endif DPRINTFN(6, "xfer=%p next=%d nframes=%d\n", - xfer, xfer->pipe->isoc_next, xfer->nframes); + xfer, xfer->endpoint->isoc_next, xfer->nframes); /* get the current frame index */ @@ -2718,10 +2718,10 @@ ehci_device_isoc_hs_enter(struct usb_xfe * check if the frame index is within the window where the frames * will be inserted */ - buf_offset = (nframes - xfer->pipe->isoc_next) & + buf_offset = (nframes - xfer->endpoint->isoc_next) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); - if ((xfer->pipe->is_synced == 0) || + if ((xfer->endpoint->is_synced == 0) || (buf_offset < ((xfer->nframes + 7) / 8))) { /* * If there is data underflow or the pipe queue is empty we @@ -2729,16 +2729,16 @@ ehci_device_isoc_hs_enter(struct usb_xfe * frame position. Else two isochronous transfers might * overlap. */ - xfer->pipe->isoc_next = (nframes + 3) & + xfer->endpoint->isoc_next = (nframes + 3) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); - xfer->pipe->is_synced = 1; - DPRINTFN(3, "start next=%d\n", xfer->pipe->isoc_next); + xfer->endpoint->is_synced = 1; + DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next); } /* * compute how many milliseconds the insertion is ahead of the * current frame position: */ - buf_offset = (xfer->pipe->isoc_next - nframes) & + buf_offset = (xfer->endpoint->isoc_next - nframes) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); /* @@ -2764,11 +2764,11 @@ ehci_device_isoc_hs_enter(struct usb_xfe td = xfer->td_start[xfer->flags_int.curr_dma_set]; xfer->td_transfer_first = td; - pp_last = &sc->sc_isoc_hs_p_last[xfer->pipe->isoc_next]; + pp_last = &sc->sc_isoc_hs_p_last[xfer->endpoint->isoc_next]; /* store starting position */ - xfer->qh_pos = xfer->pipe->isoc_next; + xfer->qh_pos = xfer->endpoint->isoc_next; while (nframes--) { if (td == NULL) { @@ -2875,7 +2875,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe xfer->td_transfer_last = td_last; /* update isoc_next */ - xfer->pipe->isoc_next = (pp_last - &sc->sc_isoc_hs_p_last[0]) & + xfer->endpoint->isoc_next = (pp_last - &sc->sc_isoc_hs_p_last[0]) & (EHCI_VIRTUAL_FRAMELIST_COUNT - 1); } @@ -3635,13 +3635,13 @@ ehci_xfer_unsetup(struct usb_xfer *xfer) } static void -ehci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, - struct usb_pipe *pipe) +ehci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, + struct usb_endpoint *ep) { ehci_softc_t *sc = EHCI_BUS2SC(udev->bus); - DPRINTFN(2, "pipe=%p, addr=%d, endpt=%d, mode=%d (%d)\n", - pipe, udev->address, + DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n", + ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode, sc->sc_addr); @@ -3661,21 +3661,21 @@ ehci_pipe_init(struct usb_device *udev, } switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_CONTROL: - pipe->methods = &ehci_device_ctrl_methods; + ep->methods = &ehci_device_ctrl_methods; break; case UE_INTERRUPT: - pipe->methods = &ehci_device_intr_methods; + ep->methods = &ehci_device_intr_methods; break; case UE_ISOCHRONOUS: if (udev->speed == USB_SPEED_HIGH) { - pipe->methods = &ehci_device_isoc_hs_methods; + ep->methods = &ehci_device_isoc_hs_methods; } else if (udev->speed == USB_SPEED_FULL) { - pipe->methods = &ehci_device_isoc_fs_methods; + ep->methods = &ehci_device_isoc_fs_methods; } break; case UE_BULK: if (udev->speed != USB_SPEED_LOW) { - pipe->methods = &ehci_device_bulk_methods; + ep->methods = &ehci_device_bulk_methods; } break; default: @@ -3712,7 +3712,7 @@ ehci_device_resume(struct usb_device *ud if (xfer->xroot->udev == udev) { - methods = xfer->pipe->methods; + methods = xfer->endpoint->methods; if ((methods == &ehci_device_bulk_methods) || (methods == &ehci_device_ctrl_methods)) { @@ -3746,7 +3746,7 @@ ehci_device_suspend(struct usb_device *u if (xfer->xroot->udev == udev) { - methods = xfer->pipe->methods; + methods = xfer->endpoint->methods; if ((methods == &ehci_device_bulk_methods) || (methods == &ehci_device_ctrl_methods)) { @@ -3801,7 +3801,7 @@ ehci_set_hw_power(struct usb_bus *bus) struct usb_bus_methods ehci_bus_methods = { - .pipe_init = ehci_pipe_init, + .endpoint_init = ehci_ep_init, .xfer_setup = ehci_xfer_setup, .xfer_unsetup = ehci_xfer_unsetup, .get_dma_delay = ehci_get_dma_delay, Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Jun 7 19:38:26 2009 (r193643) +++ head/sys/dev/usb/controller/musb_otg.c Sun Jun 7 19:41:11 2009 (r193644) @@ -1114,7 +1114,7 @@ musbotg_setup_standard_chain(struct usb_ uint8_t ep_no; DPRINTFN(8, "addr=%d endpt=%d sumlen=%d speed=%d\n", - xfer->address, UE_GET_ADDR(xfer->endpoint), + xfer->address, UE_GET_ADDR(xfer->endpointno), xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); temp.max_frame_size = xfer->max_frame_size; @@ -1132,7 +1132,7 @@ musbotg_setup_standard_chain(struct usb_ temp.did_stall = !xfer->flags_int.control_stall; sc = MUSBOTG_BUS2SC(xfer->xroot->bus); - ep_no = (xfer->endpoint & UE_ADDR); + ep_no = (xfer->endpointno & UE_ADDR); /* check if we should prepend a setup message */ @@ -1152,7 +1152,7 @@ musbotg_setup_standard_chain(struct usb_ } if (x != xfer->nframes) { - if (xfer->endpoint & UE_DIR_IN) { + if (xfer->endpointno & UE_DIR_IN) { if (xfer->flags_int.control_xfr) temp.func = &musbotg_setup_data_tx; else @@ -1249,7 +1249,7 @@ musbotg_ep_int_set(struct usb_xfer *xfer { struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint16_t temp; - uint8_t ep_no = xfer->endpoint & UE_ADDR; + uint8_t ep_no = xfer->endpointno & UE_ADDR; /* * Only enable the endpoint interrupt when we are @@ -1390,8 +1390,8 @@ musbotg_standard_done(struct usb_xfer *x { usb_error_t err = 0; - DPRINTFN(12, "xfer=%p pipe=%p transfer done\n", - xfer, xfer->pipe); + DPRINTFN(12, "xfer=%p endpoint=%p transfer done\n", + xfer, xfer->endpoint); /* reset scanner */ @@ -1439,8 +1439,8 @@ musbotg_device_done(struct usb_xfer *xfe { USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); - DPRINTFN(2, "xfer=%p, pipe=%p, error=%d\n", - xfer, xfer->pipe, error); + DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", + xfer, xfer->endpoint, error); if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { @@ -1454,14 +1454,14 @@ musbotg_device_done(struct usb_xfer *xfe static void musbotg_set_stall(struct usb_device *udev, struct usb_xfer *xfer, - struct usb_pipe *pipe) + struct usb_endpoint *ep) { struct musbotg_softc *sc; uint8_t ep_no; USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); - DPRINTFN(4, "pipe=%p\n", pipe); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 19:45:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F44106567F; Sun, 7 Jun 2009 19:45:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 457778FC08; Sun, 7 Jun 2009 19:45:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 245132823; Sun, 07 Jun 2009 22:45:07 +0300 Message-ID: <4A2C18BC.20802@FreeBSD.org> Date: Sun, 07 Jun 2009 22:45:00 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.21 (X11/20090405) MIME-Version: 1.0 To: Ariff Abdullah References: <200906071912.n57JC9GZ002423@svn.freebsd.org> <20090608032500.438668ae.ariff@FreeBSD.org> In-Reply-To: <20090608032500.438668ae.ariff@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193640 - in head/sys: conf dev/sound dev/sound/isa dev/sound/macio dev/sound/midi dev/sound/pci dev/sound/pci/hda dev/sound/pcm dev/sound/sbus dev/sound/usb modules/sound/sound sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 19:45:12 -0000 Ariff Abdullah wrote: > [..] > > I forgot to mention about the completion of multichannel support. > All that left is to visit specific driver, and make few trivial > changes. Wow, I can't believe! You've got out from nowhere and put so much at one time. You should really take more care about users hearts. :) Thanks! -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 20:12:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A20C9106566C; Sun, 7 Jun 2009 20:12:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB808FC13; Sun, 7 Jun 2009 20:12:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57KCExu004217; Sun, 7 Jun 2009 20:12:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57KCEC7004214; Sun, 7 Jun 2009 20:12:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200906072012.n57KCEC7004214@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 7 Jun 2009 20:12: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: r193648 - in head/sbin/geom: class/part core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 20:12:15 -0000 Author: marcel Date: Sun Jun 7 20:12:14 2009 New Revision: 193648 URL: http://svn.freebsd.org/changeset/base/193648 Log: Allow humanized numbers for LBAs, as well as partition indices for gpart(8). LBAs in particular are ugly. The ganularity is a sector, but users expect byte granularity when specifying the size or offset with a SI unit. Handle LBAs specially to deal with this. Modified: head/sbin/geom/class/part/geom_part.c head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Sun Jun 7 20:02:32 2009 (r193647) +++ head/sbin/geom/class/part/geom_part.c Sun Jun 7 20:12:14 2009 (r193648) @@ -68,10 +68,10 @@ static void gpart_show(struct gctl_req * struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { - { 'b', "start", NULL, G_TYPE_STRING }, - { 's', "size", NULL, G_TYPE_STRING }, + { 'b', "start", NULL, G_TYPE_ASCLBA }, + { 's', "size", NULL, G_TYPE_ASCLBA }, { 't', "type", NULL, G_TYPE_STRING }, - { 'i', index_param, optional, G_TYPE_STRING }, + { 'i', index_param, optional, G_TYPE_ASCNUM }, { 'l', "label", optional, G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, @@ -80,7 +80,7 @@ struct g_command PUBSYM(class_commands)[ { "bootcode", 0, gpart_bootcode, { { 'b', bootcode_param, optional, G_TYPE_STRING }, { 'p', partcode_param, optional, G_TYPE_STRING }, - { 'i', index_param, optional, G_TYPE_STRING }, + { 'i', index_param, optional, G_TYPE_ASCNUM }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL @@ -88,13 +88,13 @@ struct g_command PUBSYM(class_commands)[ { "commit", 0, gpart_issue, G_NULL_OPTS, "geom", NULL }, { "create", 0, gpart_issue, { { 's', "scheme", NULL, G_TYPE_STRING }, - { 'n', "entries", optional, G_TYPE_STRING }, + { 'n', "entries", optional, G_TYPE_ASCNUM }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "provider", NULL }, { "delete", 0, gpart_issue, { - { 'i', index_param, NULL, G_TYPE_STRING }, + { 'i', index_param, NULL, G_TYPE_ASCNUM }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL @@ -104,7 +104,7 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, { "modify", 0, gpart_issue, { - { 'i', index_param, NULL, G_TYPE_STRING }, + { 'i', index_param, NULL, G_TYPE_ASCNUM }, { 'l', "label", optional, G_TYPE_STRING }, { 't', "type", optional, G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, @@ -113,7 +113,7 @@ struct g_command PUBSYM(class_commands)[ }, { "set", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', index_param, NULL, G_TYPE_STRING }, + { 'i', index_param, NULL, G_TYPE_ASCNUM }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL @@ -127,7 +127,7 @@ struct g_command PUBSYM(class_commands)[ { "undo", 0, gpart_issue, G_NULL_OPTS, "geom", NULL }, { "unset", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', index_param, NULL, G_TYPE_STRING }, + { 'i', index_param, NULL, G_TYPE_ASCNUM }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Sun Jun 7 20:02:32 2009 (r193647) +++ head/sbin/geom/core/geom.c Sun Jun 7 20:12:14 2009 (r193648) @@ -226,20 +226,117 @@ find_option(struct g_command *cmd, char static void set_option(struct gctl_req *req, struct g_option *opt, const char *val) { + char *s; + intmax_t number; - if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { - intmax_t number; - + if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || + G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { if (expand_number(val, &number) == -1) { err(EXIT_FAILURE, "Invalid value for '%c' argument.", opt->go_char); } - opt->go_val = malloc(sizeof(intmax_t)); + if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) + opt->go_val = malloc(sizeof(intmax_t)); + else { + asprintf(&s, "%jd", number); + opt->go_val = s; + } if (opt->go_val == NULL) errx(EXIT_FAILURE, "No memory."); - *(intmax_t *)opt->go_val = number; + if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { + *(intmax_t *)opt->go_val = number; + gctl_ro_param(req, opt->go_name, sizeof(intmax_t), + opt->go_val); + } else + gctl_ro_param(req, opt->go_name, -1, opt->go_val); + } else if (G_OPT_TYPE(opt) == G_TYPE_ASCLBA) { + /* + * LBAs are ugly. The argument is a sector. The size of a + * sector is context specific (i.e. determined by the media), + * which we don't know here. But when users enter a value + * with a SI unit, they really mean the byte-size or byte- + * offset and not the size or offset in sectors. + * So how can we map the byte-oriented value into a sector- + * oriented value if we don't know the sector size in bytes? + * The approach taken here is: + * o Sectors are 512 bytes in size. Mostly the case anyway. + * o When no SI unit is specified the value is in sectors. + * o With an SI unit the value is in bytes. + * o The 'b' suffix forces byte interpretation and the 's' + * suffix forces sector interpretation. + * + * Thus: + * o 2 and 2s mean 2 sectors, and 2b means 2 bytes. + * o 4k and 4kb mean 4096 bytes, and 4ks means 4096 sectors. + * + * "This seemed like a good idea at the time" + */ + intmax_t mult, unit; - gctl_ro_param(req, opt->go_name, sizeof(intmax_t), opt->go_val); + number = strtoimax(val, &s, 0); + if (s == val) + errc(EXIT_FAILURE, EINVAL, "argument '%c'", + opt->go_char); + mult = 1; + unit = 512; /* sector */ + if (*s == '\0') + goto done; + switch (*s) { + case 'e': case 'E': + mult *= 1024; + /*FALLTHROUGH*/ + case 'p': case 'P': + mult *= 1024; + /*FALLTHROUGH*/ + case 't': case 'T': + mult *= 1024; + /*FALLTHROUGH*/ + case 'g': case 'G': + mult *= 1024; + /*FALLTHROUGH*/ + case 'm': case 'M': + mult *= 1024; + /*FALLTHROUGH*/ + case 'k': case 'K': + mult *= 1024; + break; + default: + goto sfx; + } + unit = 1; /* bytes */ + s++; + if (*s == '\0') + goto done; +sfx: + switch (*s) { + case 's': case 'S': + unit = 512; /* sector */ + break; + case 'b': case 'B': + unit = 1; /* bytes */ + break; + default: + errc(EXIT_FAILURE, EINVAL, "argument '%c': suffix '%c'", + opt->go_char, *s); + } + s++; + if (*s != '\0') + errx(EXIT_FAILURE, "argument '%c': junk at end (%s)", + opt->go_char, s); +done: + if (mult * unit < mult || number * mult * unit < number) + errc(EXIT_FAILURE, ERANGE, "argument '%c'", + opt->go_char); + number *= mult * unit; + if (number % 512) + errx(EXIT_FAILURE, "argument '%c': " + "not a valid block address", opt->go_char); + number /= 512; + asprintf(&s, "%jd", number); + if (s == NULL) + err(EXIT_FAILURE, NULL); + opt->go_val = s; + gctl_ro_param(req, opt->go_name, -1, s); } else if (G_OPT_TYPE(opt) == G_TYPE_STRING) { gctl_ro_param(req, opt->go_name, -1, val); } else if (G_OPT_TYPE(opt) == G_TYPE_BOOL) { @@ -247,9 +344,7 @@ set_option(struct gctl_req *req, struct if (opt->go_val == NULL) errx(EXIT_FAILURE, "No memory."); *(int *)opt->go_val = *val - '0'; - - gctl_ro_param(req, opt->go_name, sizeof(int), - opt->go_val); + gctl_ro_param(req, opt->go_name, sizeof(int), opt->go_val); } else { assert(!"Invalid type"); } @@ -333,7 +428,9 @@ parse_arguments(struct g_command *cmd, s if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { gctl_ro_param(req, opt->go_name, sizeof(intmax_t), opt->go_val); - } else if (G_OPT_TYPE(opt) == G_TYPE_STRING) { + } else if (G_OPT_TYPE(opt) == G_TYPE_STRING || + G_OPT_TYPE(opt) == G_TYPE_ASCNUM || + G_OPT_TYPE(opt) == G_TYPE_ASCLBA) { if (cmd->gc_argname == NULL || opt->go_val == NULL || *(char *)opt->go_val != '\0') Modified: head/sbin/geom/core/geom.h ============================================================================== --- head/sbin/geom/core/geom.h Sun Jun 7 20:02:32 2009 (r193647) +++ head/sbin/geom/core/geom.h Sun Jun 7 20:12:14 2009 (r193648) @@ -28,7 +28,7 @@ #ifndef _GEOM_H_ #define _GEOM_H_ -#define G_LIB_VERSION 3 +#define G_LIB_VERSION 4 #define G_FLAG_NONE 0x0000 #define G_FLAG_VERBOSE 0x0001 @@ -38,7 +38,9 @@ #define G_TYPE_BOOL 0x01 #define G_TYPE_STRING 0x02 #define G_TYPE_NUMBER 0x03 -#define G_TYPE_MASK 0x03 +#define G_TYPE_ASCNUM 0x04 +#define G_TYPE_ASCLBA 0x05 +#define G_TYPE_MASK 0x0f #define G_TYPE_DONE 0x10 #define G_OPT_MAX 16 From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 20:38:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87CC6106566C; Sun, 7 Jun 2009 20:38:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 760068FC15; Sun, 7 Jun 2009 20:38:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57KcgYV004765; Sun, 7 Jun 2009 20:38:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57KcgwH004764; Sun, 7 Jun 2009 20:38:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906072038.n57KcgwH004764@svn.freebsd.org> From: Rick Macklem Date: Sun, 7 Jun 2009 20:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193649 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 20:38:43 -0000 Author: rmacklem Date: Sun Jun 7 20:38:41 2009 New Revision: 193649 URL: http://svn.freebsd.org/changeset/base/193649 Log: Add a check to xprt_unregister() to catch the case where another thread has already unregistered the structure. Also add a KASSERT() to xprt_unregister_locked() to check that the structure hasn't already been unregistered. Reviewed by: jhb Tested by: pho Approved by: kib (mentor) Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Sun Jun 7 20:12:14 2009 (r193648) +++ head/sys/rpc/svc.c Sun Jun 7 20:38:41 2009 (r193649) @@ -293,6 +293,8 @@ xprt_unregister_locked(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + KASSERT(xprt->xp_registered == TRUE, + ("xprt_unregister_locked: not registered")); if (xprt->xp_active) { TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); xprt->xp_active = FALSE; @@ -307,6 +309,11 @@ xprt_unregister(SVCXPRT *xprt) SVCPOOL *pool = xprt->xp_pool; mtx_lock(&pool->sp_lock); + if (xprt->xp_registered == FALSE) { + /* Already unregistered by another thread */ + mtx_unlock(&pool->sp_lock); + return; + } xprt_unregister_locked(xprt); mtx_unlock(&pool->sp_lock); From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 20:51:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19B5C1065672; Sun, 7 Jun 2009 20:51:32 +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 07E838FC1B; Sun, 7 Jun 2009 20:51:32 +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 n57KpVAC005146; Sun, 7 Jun 2009 20:51:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57KpVtF005145; Sun, 7 Jun 2009 20:51:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906072051.n57KpVtF005145@svn.freebsd.org> From: Robert Watson Date: Sun, 7 Jun 2009 20:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193650 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 20:51:33 -0000 Author: rwatson Date: Sun Jun 7 20:51:31 2009 New Revision: 193650 URL: http://svn.freebsd.org/changeset/base/193650 Log: Add a temporary workaround for panics being seen on NFS servers with ZFS, where an improperly initialized prison field could lead to a panic. This is not the correct solution, since it fails to address similar problems for both AUDIT and MAC, which also rely on properly initialized credentials, but should reduce panic reports while we work that out. Reported by: ps, kan, others Modified: head/sys/rpc/svc_auth.c Modified: head/sys/rpc/svc_auth.c ============================================================================== --- head/sys/rpc/svc_auth.c Sun Jun 7 20:38:41 2009 (r193649) +++ head/sys/rpc/svc_auth.c Sun Jun 7 20:51:31 2009 (r193650) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -181,6 +182,8 @@ svc_getcred(struct svc_req *rqst, struct for (i = 0; i < xcr->cr_ngroups; i++) cr->cr_groups[i] = xcr->cr_groups[i]; cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0]; + cr->cr_prison = &prison0; + prison_hold(cr->cr_prison); *crp = cr; return (TRUE); From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 21:31:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F8341065675; Sun, 7 Jun 2009 21:31:07 +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 033528FC1E; Sun, 7 Jun 2009 21:31:07 +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 n57LV6on006043; Sun, 7 Jun 2009 21:31:06 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57LV6WW006042; Sun, 7 Jun 2009 21:31:06 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906072131.n57LV6WW006042@svn.freebsd.org> From: Robert Watson Date: Sun, 7 Jun 2009 21:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193652 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 21:31:07 -0000 Author: rwatson Date: Sun Jun 7 21:31:06 2009 New Revision: 193652 URL: http://svn.freebsd.org/changeset/base/193652 Log: Add beginnings of a netisr(9) man page. Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Jun 7 21:11:22 2009 (r193651) +++ head/share/man/man9/Makefile Sun Jun 7 21:31:06 2009 (r193652) @@ -162,6 +162,7 @@ MAN= accept_filter.9 \ mtx_pool.9 \ mutex.9 \ namei.9 \ + netisr.9 \ panic.9 \ pbuf.9 \ p_candebug.9 \ From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 21:32:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63DCE1065686; Sun, 7 Jun 2009 21:32:01 +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 509D68FC08; Sun, 7 Jun 2009 21:32:01 +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 n57LW1mA006090; Sun, 7 Jun 2009 21:32:01 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57LW1dq006089; Sun, 7 Jun 2009 21:32:01 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906072132.n57LW1dq006089@svn.freebsd.org> From: Robert Watson Date: Sun, 7 Jun 2009 21:32: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: r193653 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 21:32:02 -0000 Author: rwatson Date: Sun Jun 7 21:32:01 2009 New Revision: 193653 URL: http://svn.freebsd.org/changeset/base/193653 Log: Try again to add beginnings of netisr(8) man page: this time add netisr.9. Added: head/share/man/man9/netisr.9 (contents, props changed) Added: head/share/man/man9/netisr.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/netisr.9 Sun Jun 7 21:32:01 2009 (r193653) @@ -0,0 +1,210 @@ +.\" +.\" Copyright (c) 2009 Robert N. M. Watson +.\" 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(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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$ +.\" +.Dd June 7, 2009 +.Dt NETISR 9 +.Os +.Sh NAME +.Nm netisr +.Nd Kernel network dispatch service +.Sh SYNOPSIS +.In net/netisr.h +.Ft void +.Fn netisr_register "const struct netisr_handler *nhp" +.Ft void +.Fn netisr_unregister "const struct netisr_handler *nhp" +.Ft int +.Fn netisr_dispatch "u_int proto" "struct mbuf *m" +.Ft int +.Fn netisr_dispatch_src "u_int proto" "uintptr_t source" "struct mbuf *m" +.Ft int +.Fn netisr_queue "u_int proto" "struct mbuf *m" +.Ft int +.Fn netisr_queue_src "u_int proto" "uintptr_t source" "struct mbuf *m" +.Ft void +.Fn netisr_clearqdrops "const struct netisr_handler *nhp" +.Ft void +.Fn netisr_getqdrops "const struct netisr_handler *nhp" "u_int64_t *qdropsp" +.Ft +void +.Fn netisr_getqlimit "const struct netisr_handler *nhp" "u_int *qlimitp" +.Ft int +.Fn netisr_setqlimit "const struct netisr_handler *nhp" "u_int qlimit" +.Ft u_int +.Fn netisr_default_flow2cpu "u_int flowid" +.Ft u_int +.Fn netisr_get_cpucount "void" +.Ft u_int +.Fn netisr_get_cpuid "u_int cpunumber" +.Sh DESCRIPTION +The +.Nm +kernel interface suite allows device drivers (and other packet sources) to +direct packets to protocols for directly dispatched or deferred processing. +.Ss Protocol registration +Protocols register and unregister handlers using +.Fn netisr_register +and +.Fn netisr_unregister , +and may also manage queue limits and statistics using the +.Fn netisr_clearqdrops , +.Fn netisr_getqdrops , +.Fn netisr_getqlimit , +and +.Fn netisr_setqlimit. +.Pp +.Nm +supports multi-processor execution of handlers, and relies on a combination +of source ordering and protocol-specific ordering and work-placement +policies to decide how do distribute work across one or more worker +threads. +Registering protocols will declare one of three policies: +.Bl -tag -width NETISR_POLICY_SOURCE +.It Dv NETISR_POLICY_SOURCE +.Nm +should maintain source ordering without advice from the protocol. +.Nm +will ignore any flow IDs present on +.Vt mbuf +headers for the purposes of work placement. +.It Dv NETISR_POLICY_FLOW +.Nm +should maintain flow ordering as defined by the +.Vt mbuf +header flow ID field. +If the protocol implements +.Va nh_m2flow , +then +.Nm +will query the protocol in the evet that the +.Vt mbuf +doesn't have a flow ID, falling back on source ordering. +.It NETISR_POLICY_CPU +.Nm +will entirely delegate all work placement decisions to the protocol, +querying +.Va nh_m2cpuid +for each packet. +.El +.Pp +Registration is declared using +.Vt "struct netisr_handler" , +whose fields are defined as follows: +.Bl -tag -width "netisr_handler_t nh_handler" +.It Vt "const char *" Va nh_name +Unique character string name of the protocol, which may be included in +.Xr 2 sysctl +MIB names, so should not contain whitespace. +.It Vt netisr_handler_t Va nh_handler +Protocol handler function that will be invoked on each packet received for +the protocol. +.It Vt netisr_m2flow_t Va nh_m2flow +Optional protocol function to generate a flow ID and set +.Dv M_FLOWID +for packets that do not enter +.Nm +with +.Dv M_FLOWID +defined. +Will be used only with +.Dv NETISR_POLICY_FLOW . +.It Vt netisr_m2cpuid_t Va nh_m2cpuid +Protocol function to determine what CPU a packet should be processed on. +Will be used only with +.Dv NETISR_POLICY_CPU . +.It Vt u_int Va nh_proto +Protocol number used by both protocols to identify themselves to +.Nm , +and by packet sources to select what handler will be used to process +packets. +A table of supported protocol numbers appears below. +For implementation reasons, protocol numbers great than 15 are currently +unsupported. +.It Vt u_int Va nh_qlimit +The maximum per-CPU queue depth for the protocol; due to internal +implementation details, the effective queue depth may be as much as twice +this number. +.It Vt u_int Va nh_policy +The ordering and work placement policy for the protocol, as described +earlier. +.El +.Ss Packet source interface +Packet sources, such as network interfaces, may request protocol processing +using the +.Fn netisr_dispatch +and +.Fn netisr_queue +interfaces. +Both accept a protocol number and +.Vt mbuf +argument, but while +.Fn netisr_queue +will always execute the protocol handler asynchonously in a deferred +context, +.Fn netisr_dispatch +will optionally direct dispatch if permitted by global and per-protocol +policy. +.Pp +In order to provide additional load balancing and flow information, +packet sources may also specify an opaque source identifier, which in +practice might be a network interface number or socket pointer, using +the +.Fn netisr_dispatch_src +and +.Fn netisr_queue_src +variants. +.Ss Protocol number constants +The follow protocol numbers are currently defined: +.Bl -tag -width NETISR_ATALK1 +.It Dv NETISR_IP +IPv4 +.It Dv NETISR_IGMP +IGMPv3 loopback +.It Dv NETISR_ROUTE +Routing socket loopback +.It Dv NETISR_AARP +Appletalk AARP +.It Dv NETISR_ATALK1 +Appletalk phase 1 +.It Dv NETISR_ATALK2 +Appletalk phase 2 +.It Dv NETISR_ARP +ARP +.It Dv NETISR_IPX +IPX/SPX +.It Dv NETISR_IPV6 +IPv6 +.It Dv NETISR_NATM +ATM +.El +.Sh AUTHORS +This manual page and the +.Nm +implementation were written by +.An Robert N. M. Watson . From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 22:00:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24F4610656DF; Sun, 7 Jun 2009 22:00: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 87A188FC32; Sun, 7 Jun 2009 22:00:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57M0N0E006772; Sun, 7 Jun 2009 22:00:23 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57M0NlB006760; Sun, 7 Jun 2009 22:00:23 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906072200.n57M0NlB006760@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Jun 2009 22:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193655 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 22:00:25 -0000 Author: sam Date: Sun Jun 7 22:00:22 2009 New Revision: 193655 URL: http://svn.freebsd.org/changeset/base/193655 Log: iv_flags_ext is full, make room by moving HT-related flags to a new iv_flags_ht word Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211.c Sun Jun 7 22:00:22 2009 (r193655) @@ -80,6 +80,7 @@ static const uint8_t ieee80211broadcasta { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; static void ieee80211_syncflag_locked(struct ieee80211com *ic, int flag); +static void ieee80211_syncflag_ht_locked(struct ieee80211com *ic, int flag); static void ieee80211_syncflag_ext_locked(struct ieee80211com *ic, int flag); static int ieee80211_media_setup(struct ieee80211com *ic, struct ifmedia *media, int caps, int addsta, @@ -520,8 +521,8 @@ ieee80211_vap_attach(struct ieee80211vap #endif ieee80211_syncflag_locked(ic, IEEE80211_F_PCF); ieee80211_syncflag_locked(ic, IEEE80211_F_BURST); - ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_HT); - ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_USEHT40); + ieee80211_syncflag_ht_locked(ic, IEEE80211_FHT_HT); + ieee80211_syncflag_ht_locked(ic, IEEE80211_FHT_USEHT40); ieee80211_syncifflag_locked(ic, IFF_PROMISC); ieee80211_syncifflag_locked(ic, IFF_ALLMULTI); IEEE80211_UNLOCK(ic); @@ -566,8 +567,8 @@ ieee80211_vap_detach(struct ieee80211vap #endif ieee80211_syncflag_locked(ic, IEEE80211_F_PCF); ieee80211_syncflag_locked(ic, IEEE80211_F_BURST); - ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_HT); - ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_USEHT40); + ieee80211_syncflag_ht_locked(ic, IEEE80211_FHT_HT); + ieee80211_syncflag_ht_locked(ic, IEEE80211_FHT_USEHT40); /* NB: this handles the bpfdetach done below */ ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_BPF); ieee80211_syncifflag_locked(ic, IFF_PROMISC); @@ -678,7 +679,47 @@ ieee80211_syncflag(struct ieee80211vap * } /* - * Synchronize flag bit state in the com structure + * Synchronize flags_ht bit state in the com structure + * according to the state of all vap's. This is used, + * for example, to handle state changes via ioctls. + */ +static void +ieee80211_syncflag_ht_locked(struct ieee80211com *ic, int flag) +{ + struct ieee80211vap *vap; + int bit; + + IEEE80211_LOCK_ASSERT(ic); + + bit = 0; + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + if (vap->iv_flags_ht & flag) { + bit = 1; + break; + } + if (bit) + ic->ic_flags_ht |= flag; + else + ic->ic_flags_ht &= ~flag; +} + +void +ieee80211_syncflag_ht(struct ieee80211vap *vap, int flag) +{ + struct ieee80211com *ic = vap->iv_ic; + + IEEE80211_LOCK(ic); + if (flag < 0) { + flag = -flag; + vap->iv_flags_ht &= ~flag; + } else + vap->iv_flags_ht |= flag; + ieee80211_syncflag_ht_locked(ic, flag); + IEEE80211_UNLOCK(ic); +} + +/* + * Synchronize flags_ext bit state in the com structure * according to the state of all vap's. This is used, * for example, to handle state changes via ioctls. */ Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_hostap.c Sun Jun 7 22:00:22 2009 (r193655) @@ -201,7 +201,7 @@ hostap_newstate(struct ieee80211vap *vap * is set before doing anything so this is sufficient. */ ic->ic_flags_ext &= ~IEEE80211_FEXT_NONERP_PR; - ic->ic_flags_ext &= ~IEEE80211_FEXT_NONHT_PR; + ic->ic_flags_ht &= ~IEEE80211_FHT_NONHT_PR; /* fall thru... */ case IEEE80211_S_CAC: /* @@ -272,7 +272,7 @@ hostap_newstate(struct ieee80211vap *vap */ ieee80211_create_ibss(vap, ieee80211_ht_adjust_channel(ic, - ic->ic_curchan, vap->iv_flags_ext)); + ic->ic_curchan, vap->iv_flags_ht)); /* NB: iv_bss is changed on return */ break; case IEEE80211_S_CAC: @@ -1995,7 +1995,7 @@ hostap_recv_mgmt(struct ieee80211_node * else if (isatherosoui(frm)) ath = frm; #endif - else if (vap->iv_flags_ext & IEEE80211_FEXT_HTCOMPAT) { + else if (vap->iv_flags_ht & IEEE80211_FHT_HTCOMPAT) { if (ishtcapoui(frm) && htcap == NULL) htcap = frm; } @@ -2103,7 +2103,7 @@ hostap_recv_mgmt(struct ieee80211_node * /* * If constrained to 11n-only stations reject legacy stations. */ - if ((vap->iv_flags_ext & IEEE80211_FEXT_PUREN) && + if ((vap->iv_flags_ht & IEEE80211_FHT_PUREN) && (ni->ni_flags & IEEE80211_NODE_HT) == 0) { htcapmismatch(ni, wh, reassoc, resp); vap->iv_stats.is_ht_assoc_nohtcap++; Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_ht.c Sun Jun 7 22:00:22 2009 (r193655) @@ -183,32 +183,32 @@ ieee80211_ht_vattach(struct ieee80211vap * facilities by default. * XXX these choices may be too aggressive. */ - vap->iv_flags_ext |= IEEE80211_FEXT_HT - | IEEE80211_FEXT_HTCOMPAT - ; + vap->iv_flags_ht |= IEEE80211_FHT_HT + | IEEE80211_FHT_HTCOMPAT + ; if (vap->iv_htcaps & IEEE80211_HTCAP_SHORTGI20) - vap->iv_flags_ext |= IEEE80211_FEXT_SHORTGI20; + vap->iv_flags_ht |= IEEE80211_FHT_SHORTGI20; /* XXX infer from channel list? */ if (vap->iv_htcaps & IEEE80211_HTCAP_CHWIDTH40) { - vap->iv_flags_ext |= IEEE80211_FEXT_USEHT40; + vap->iv_flags_ht |= IEEE80211_FHT_USEHT40; if (vap->iv_htcaps & IEEE80211_HTCAP_SHORTGI40) - vap->iv_flags_ext |= IEEE80211_FEXT_SHORTGI40; + vap->iv_flags_ht |= IEEE80211_FHT_SHORTGI40; } /* enable RIFS if capable */ if (vap->iv_htcaps & IEEE80211_HTC_RIFS) - vap->iv_flags_ext |= IEEE80211_FEXT_RIFS; + vap->iv_flags_ht |= IEEE80211_FHT_RIFS; /* NB: A-MPDU and A-MSDU rx are mandated, these are tx only */ - vap->iv_flags_ext |= IEEE80211_FEXT_AMPDU_RX; + vap->iv_flags_ht |= IEEE80211_FHT_AMPDU_RX; if (vap->iv_htcaps & IEEE80211_HTC_AMPDU) - vap->iv_flags_ext |= IEEE80211_FEXT_AMPDU_TX; - vap->iv_flags_ext |= IEEE80211_FEXT_AMSDU_RX; + vap->iv_flags_ht |= IEEE80211_FHT_AMPDU_TX; + vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_RX; if (vap->iv_htcaps & IEEE80211_HTC_AMSDU) - vap->iv_flags_ext |= IEEE80211_FEXT_AMSDU_TX; + vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_TX; } /* NB: disable default legacy WDS, too many issues right now */ if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) - vap->iv_flags_ext &= ~IEEE80211_FEXT_HT; + vap->iv_flags_ht &= ~IEEE80211_FHT_HT; } void @@ -921,9 +921,9 @@ ieee80211_ht_adjust_channel(struct ieee8 { struct ieee80211_channel *c; - if (flags & IEEE80211_FEXT_HT) { + if (flags & IEEE80211_FHT_HT) { /* promote to HT if possible */ - if (flags & IEEE80211_FEXT_USEHT40) { + if (flags & IEEE80211_FHT_USEHT40) { if (!IEEE80211_IS_CHAN_HT40(chan)) { /* NB: arbitrarily pick ht40+ over ht40- */ c = findhtchan(ic, chan, IEEE80211_CHAN_HT40U); @@ -961,7 +961,7 @@ ieee80211_ht_wds_init(struct ieee80211_n struct ieee80211_tx_ampdu *tap; int ac; - KASSERT(vap->iv_flags_ext & IEEE80211_FEXT_HT, ("no HT requested")); + KASSERT(vap->iv_flags_ht & IEEE80211_FHT_HT, ("no HT requested")); /* XXX check scan cache in case peer has an ap and we have info */ /* @@ -974,7 +974,7 @@ ieee80211_ht_wds_init(struct ieee80211_n ni->ni_chan, ieee80211_htchanflags(ni->ni_chan)); ni->ni_htcap = 0; - if (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI20) + if (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) ni->ni_htcap |= IEEE80211_HTCAP_SHORTGI20; if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { ni->ni_htcap |= IEEE80211_HTCAP_CHWIDTH40; @@ -983,14 +983,14 @@ ieee80211_ht_wds_init(struct ieee80211_n ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_ABOVE; else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_BELOW; - if (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI40) + if (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) ni->ni_htcap |= IEEE80211_HTCAP_SHORTGI40; } else { ni->ni_chw = 20; ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_NONE; } ni->ni_htctlchan = ni->ni_chan->ic_ieee; - if (vap->iv_flags_ext & IEEE80211_FEXT_RIFS) + if (vap->iv_flags_ht & IEEE80211_FHT_RIFS) ni->ni_flags |= IEEE80211_NODE_RIFS; /* XXX does it make sense to enable SMPS? */ @@ -1001,7 +1001,7 @@ ieee80211_ht_wds_init(struct ieee80211_n tap = &ni->ni_tx_ampdu[ac]; tap->txa_ac = ac; } - /* NB: AMPDU tx/rx governed by IEEE80211_FEXT_AMPDU_{TX,RX} */ + /* NB: AMPDU tx/rx governed by IEEE80211_FHT_AMPDU_{TX,RX} */ ni->ni_flags |= IEEE80211_NODE_HT | IEEE80211_NODE_AMPDU; } @@ -1031,7 +1031,7 @@ htinfo_notify(struct ieee80211com *ic) , ic->ic_sta_assoc , ic->ic_ht_sta_assoc , ic->ic_ht40_sta_assoc - , (ic->ic_flags_ext & IEEE80211_FEXT_NONHT_PR) ? + , (ic->ic_flags_ht & IEEE80211_FHT_NONHT_PR) ? ", non-HT sta present" : "" , ic->ic_curhtprotmode); first = 0; @@ -1052,7 +1052,7 @@ htinfo_update(struct ieee80211com *ic) if (ic->ic_sta_assoc != ic->ic_ht_sta_assoc) { protmode = IEEE80211_HTINFO_OPMODE_MIXED | IEEE80211_HTINFO_NONHT_PRESENT; - } else if (ic->ic_flags_ext & IEEE80211_FEXT_NONHT_PR) { + } else if (ic->ic_flags_ht & IEEE80211_FHT_NONHT_PR) { protmode = IEEE80211_HTINFO_OPMODE_PROTOPT | IEEE80211_HTINFO_NONHT_PRESENT; } else if (ic->ic_bsschan != IEEE80211_CHAN_ANYC && @@ -1125,7 +1125,7 @@ ieee80211_htprot_update(struct ieee80211 /* track non-HT station presence */ KASSERT(protmode & IEEE80211_HTINFO_NONHT_PRESENT, ("protmode 0x%x", protmode)); - ic->ic_flags_ext |= IEEE80211_FEXT_NONHT_PR; + ic->ic_flags_ht |= IEEE80211_FHT_NONHT_PR; ic->ic_lastnonht = ticks; if (protmode != ic->ic_curhtprotmode && @@ -1152,13 +1152,13 @@ ieee80211_ht_timeout(struct ieee80211com { IEEE80211_LOCK_ASSERT(ic); - if ((ic->ic_flags_ext & IEEE80211_FEXT_NONHT_PR) && + if ((ic->ic_flags_ht & IEEE80211_FHT_NONHT_PR) && time_after(ticks, ic->ic_lastnonht + IEEE80211_NONHT_PRESENT_AGE)) { #if 0 IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni, "%s", "time out non-HT STA present on channel"); #endif - ic->ic_flags_ext &= ~IEEE80211_FEXT_NONHT_PR; + ic->ic_flags_ht &= ~IEEE80211_FHT_NONHT_PR; htinfo_update(ic); } } @@ -1303,10 +1303,10 @@ htcap_update_shortgi(struct ieee80211_no ni->ni_flags &= ~(IEEE80211_NODE_SGI20|IEEE80211_NODE_SGI40); if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) && - (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI20)) + (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20)) ni->ni_flags |= IEEE80211_NODE_SGI20; if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) && - (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI40)) + (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40)) ni->ni_flags |= IEEE80211_NODE_SGI40; } @@ -1332,11 +1332,11 @@ ieee80211_ht_updateparams(struct ieee802 htinfo = (const struct ieee80211_ie_htinfo *) htinfoie; htinfo_parse(ni, htinfo); - htflags = (vap->iv_flags_ext & IEEE80211_FEXT_HT) ? + htflags = (vap->iv_flags_ht & IEEE80211_FHT_HT) ? IEEE80211_CHAN_HT20 : 0; /* NB: honor operating mode constraint */ if ((htinfo->hi_byte1 & IEEE80211_HTINFO_TXWIDTH_2040) && - (vap->iv_flags_ext & IEEE80211_FEXT_USEHT40)) { + (vap->iv_flags_ht & IEEE80211_FHT_USEHT40)) { if (ni->ni_ht2ndchan == IEEE80211_HTINFO_2NDCHAN_ABOVE) htflags = IEEE80211_CHAN_HT40U; else if (ni->ni_ht2ndchan == IEEE80211_HTINFO_2NDCHAN_BELOW) @@ -1345,7 +1345,7 @@ ieee80211_ht_updateparams(struct ieee802 htinfo_update_chw(ni, htflags); if ((htinfo->hi_byte1 & IEEE80211_HTINFO_RIFSMODE_PERM) && - (vap->iv_flags_ext & IEEE80211_FEXT_RIFS)) + (vap->iv_flags_ht & IEEE80211_FHT_RIFS)) ni->ni_flags |= IEEE80211_NODE_RIFS; else ni->ni_flags &= ~IEEE80211_NODE_RIFS; @@ -1368,10 +1368,10 @@ ieee80211_ht_updatehtcap(struct ieee8021 /* NB: honor operating mode constraint */ /* XXX 40 MHZ intolerant */ - htflags = (vap->iv_flags_ext & IEEE80211_FEXT_HT) ? + htflags = (vap->iv_flags_ht & IEEE80211_FHT_HT) ? IEEE80211_CHAN_HT20 : 0; if ((ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) && - (vap->iv_flags_ext & IEEE80211_FEXT_USEHT40)) { + (vap->iv_flags_ht & IEEE80211_FHT_USEHT40)) { if (IEEE80211_IS_CHAN_HT40U(vap->iv_bss->ni_chan)) htflags = IEEE80211_CHAN_HT40U; else if (IEEE80211_IS_CHAN_HT40D(vap->iv_bss->ni_chan)) @@ -1627,7 +1627,7 @@ ieee80211_aggr_recv_action(struct ieee80 * violates the 11n spec and is mostly for testing). */ if ((ni->ni_flags & IEEE80211_NODE_AMPDU_RX) && - (vap->iv_flags_ext & IEEE80211_FEXT_AMPDU_RX)) { + (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_RX)) { /* XXX handle ampdu_rx_start failure */ ic->ic_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl); @@ -2298,7 +2298,7 @@ ieee80211_add_htcap_body(uint8_t *frm, s */ if (vap->iv_opmode == IEEE80211_M_STA) { /* override 20/40 use based on config */ - if (vap->iv_flags_ext & IEEE80211_FEXT_USEHT40) + if (vap->iv_flags_ht & IEEE80211_FHT_USEHT40) caps |= IEEE80211_HTCAP_CHWIDTH40; else caps &= ~IEEE80211_HTCAP_CHWIDTH40; @@ -2315,9 +2315,9 @@ ieee80211_add_htcap_body(uint8_t *frm, s density = vap->iv_ampdu_density; } /* adjust short GI based on channel and config */ - if ((vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI20) == 0) + if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) == 0) caps &= ~IEEE80211_HTCAP_SHORTGI20; - if ((vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI40) == 0 || + if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 || (caps & IEEE80211_HTCAP_CHWIDTH40) == 0) caps &= ~IEEE80211_HTCAP_SHORTGI40; ADDSHORT(frm, caps); @@ -2408,7 +2408,7 @@ ieee80211_ht_update_beacon(struct ieee80 /* XXX only update on channel change */ ht->hi_ctrlchannel = ieee80211_chan2ieee(ic, bsschan); - if (vap->iv_flags_ext & IEEE80211_FEXT_RIFS) + if (vap->iv_flags_ht & IEEE80211_FHT_RIFS) ht->hi_byte1 = IEEE80211_HTINFO_RIFSMODE_PERM; else ht->hi_byte1 = IEEE80211_HTINFO_RIFSMODE_PROH; @@ -2447,7 +2447,7 @@ ieee80211_add_htinfo_body(uint8_t *frm, /* primary/control channel center */ *frm++ = ieee80211_chan2ieee(ic, ni->ni_chan); - if (vap->iv_flags_ext & IEEE80211_FEXT_RIFS) + if (vap->iv_flags_ht & IEEE80211_FHT_RIFS) frm[0] = IEEE80211_HTINFO_RIFSMODE_PERM; else frm[0] = IEEE80211_HTINFO_RIFSMODE_PROH; Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_input.c Sun Jun 7 22:00:22 2009 (r193655) @@ -572,7 +572,7 @@ ieee80211_parse_beacon(struct ieee80211_ else if (istdmaoui(frm)) scan->tdma = frm; #endif - else if (vap->iv_flags_ext & IEEE80211_FEXT_HTCOMPAT) { + else if (vap->iv_flags_ht & IEEE80211_FHT_HTCOMPAT) { /* * Accept pre-draft HT ie's if the * standard ones have not been seen. Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_ioctl.c Sun Jun 7 22:00:22 2009 (r193655) @@ -990,16 +990,16 @@ ieee80211_ioctl_get80211(struct ieee8021 break; case IEEE80211_IOC_SHORTGI: ireq->i_val = 0; - if (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI20) + if (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) ireq->i_val |= IEEE80211_HTCAP_SHORTGI20; - if (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI40) + if (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) ireq->i_val |= IEEE80211_HTCAP_SHORTGI40; break; case IEEE80211_IOC_AMPDU: ireq->i_val = 0; - if (vap->iv_flags_ext & IEEE80211_FEXT_AMPDU_TX) + if (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX) ireq->i_val |= 1; - if (vap->iv_flags_ext & IEEE80211_FEXT_AMPDU_RX) + if (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_RX) ireq->i_val |= 2; break; case IEEE80211_IOC_AMPDU_LIMIT: @@ -1021,16 +1021,16 @@ ieee80211_ioctl_get80211(struct ieee8021 break; case IEEE80211_IOC_AMSDU: ireq->i_val = 0; - if (vap->iv_flags_ext & IEEE80211_FEXT_AMSDU_TX) + if (vap->iv_flags_ht & IEEE80211_FHT_AMSDU_TX) ireq->i_val |= 1; - if (vap->iv_flags_ext & IEEE80211_FEXT_AMSDU_RX) + if (vap->iv_flags_ht & IEEE80211_FHT_AMSDU_RX) ireq->i_val |= 2; break; case IEEE80211_IOC_AMSDU_LIMIT: ireq->i_val = vap->iv_amsdu_limit; /* XXX truncation? */ break; case IEEE80211_IOC_PUREN: - ireq->i_val = (vap->iv_flags_ext & IEEE80211_FEXT_PUREN) != 0; + ireq->i_val = (vap->iv_flags_ht & IEEE80211_FHT_PUREN) != 0; break; case IEEE80211_IOC_DOTH: ireq->i_val = (vap->iv_flags & IEEE80211_F_DOTH) != 0; @@ -1045,7 +1045,7 @@ ieee80211_ioctl_get80211(struct ieee8021 error = ieee80211_ioctl_gettxparams(vap, ireq); break; case IEEE80211_IOC_HTCOMPAT: - ireq->i_val = (vap->iv_flags_ext & IEEE80211_FEXT_HTCOMPAT) != 0; + ireq->i_val = (vap->iv_flags_ht & IEEE80211_FHT_HTCOMPAT) != 0; break; case IEEE80211_IOC_DWDS: ireq->i_val = (vap->iv_flags & IEEE80211_F_DWDS) != 0; @@ -1075,9 +1075,9 @@ ieee80211_ioctl_get80211(struct ieee8021 ireq->i_val = ic->ic_htprotmode; break; case IEEE80211_IOC_HTCONF: - if (vap->iv_flags_ext & IEEE80211_FEXT_HT) { + if (vap->iv_flags_ht & IEEE80211_FHT_HT) { ireq->i_val = 1; - if (vap->iv_flags_ext & IEEE80211_FEXT_USEHT40) + if (vap->iv_flags_ht & IEEE80211_FHT_USEHT40) ireq->i_val |= 2; } else ireq->i_val = 0; @@ -1104,7 +1104,7 @@ ieee80211_ioctl_get80211(struct ieee8021 (vap->iv_bss->ni_flags & IEEE80211_NODE_RIFS) != 0; else ireq->i_val = - (vap->iv_flags_ext & IEEE80211_FEXT_RIFS) != 0; + (vap->iv_flags_ht & IEEE80211_FHT_RIFS) != 0; break; default: error = ieee80211_ioctl_getdefault(vap, ireq); @@ -2815,13 +2815,13 @@ ieee80211_ioctl_set80211(struct ieee8021 break; case IEEE80211_IOC_HTCONF: if (ireq->i_val & 1) - ieee80211_syncflag_ext(vap, IEEE80211_FEXT_HT); + ieee80211_syncflag_ht(vap, IEEE80211_FHT_HT); else - ieee80211_syncflag_ext(vap, -IEEE80211_FEXT_HT); + ieee80211_syncflag_ht(vap, -IEEE80211_FHT_HT); if (ireq->i_val & 2) - ieee80211_syncflag_ext(vap, IEEE80211_FEXT_USEHT40); + ieee80211_syncflag_ht(vap, IEEE80211_FHT_USEHT40); else - ieee80211_syncflag_ext(vap, -IEEE80211_FEXT_USEHT40); + ieee80211_syncflag_ht(vap, -IEEE80211_FHT_USEHT40); error = ENETRESET; break; case IEEE80211_IOC_ADDMAC: @@ -2938,26 +2938,26 @@ ieee80211_ioctl_set80211(struct ieee8021 if (((ireq->i_val ^ vap->iv_htcaps) & IEEE80211_HTCAP_SHORTGI) != 0) return EINVAL; if (ireq->i_val & IEEE80211_HTCAP_SHORTGI20) - vap->iv_flags_ext |= IEEE80211_FEXT_SHORTGI20; + vap->iv_flags_ht |= IEEE80211_FHT_SHORTGI20; if (ireq->i_val & IEEE80211_HTCAP_SHORTGI40) - vap->iv_flags_ext |= IEEE80211_FEXT_SHORTGI40; + vap->iv_flags_ht |= IEEE80211_FHT_SHORTGI40; #undef IEEE80211_HTCAP_SHORTGI } else - vap->iv_flags_ext &= - ~(IEEE80211_FEXT_SHORTGI20 | IEEE80211_FEXT_SHORTGI40); + vap->iv_flags_ht &= + ~(IEEE80211_FHT_SHORTGI20 | IEEE80211_FHT_SHORTGI40); error = ERESTART; break; case IEEE80211_IOC_AMPDU: if (ireq->i_val && (vap->iv_htcaps & IEEE80211_HTC_AMPDU) == 0) return EINVAL; if (ireq->i_val & 1) - vap->iv_flags_ext |= IEEE80211_FEXT_AMPDU_TX; + vap->iv_flags_ht |= IEEE80211_FHT_AMPDU_TX; else - vap->iv_flags_ext &= ~IEEE80211_FEXT_AMPDU_TX; + vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_TX; if (ireq->i_val & 2) - vap->iv_flags_ext |= IEEE80211_FEXT_AMPDU_RX; + vap->iv_flags_ht |= IEEE80211_FHT_AMPDU_RX; else - vap->iv_flags_ext &= ~IEEE80211_FEXT_AMPDU_RX; + vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_RX; /* NB: reset only if we're operating on an 11n channel */ if (isvapht(vap)) error = ERESTART; @@ -2983,13 +2983,13 @@ ieee80211_ioctl_set80211(struct ieee8021 if (ireq->i_val && (vap->iv_htcaps & IEEE80211_HTC_AMSDU) == 0) return EINVAL; if (ireq->i_val & 1) - vap->iv_flags_ext |= IEEE80211_FEXT_AMSDU_TX; + vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_TX; else - vap->iv_flags_ext &= ~IEEE80211_FEXT_AMSDU_TX; + vap->iv_flags_ht &= ~IEEE80211_FHT_AMSDU_TX; if (ireq->i_val & 2) - vap->iv_flags_ext |= IEEE80211_FEXT_AMSDU_RX; + vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_RX; else - vap->iv_flags_ext &= ~IEEE80211_FEXT_AMSDU_RX; + vap->iv_flags_ht &= ~IEEE80211_FHT_AMSDU_RX; /* NB: reset only if we're operating on an 11n channel */ if (isvapht(vap)) error = ERESTART; @@ -3000,11 +3000,11 @@ ieee80211_ioctl_set80211(struct ieee8021 break; case IEEE80211_IOC_PUREN: if (ireq->i_val) { - if ((vap->iv_flags_ext & IEEE80211_FEXT_HT) == 0) + if ((vap->iv_flags_ht & IEEE80211_FHT_HT) == 0) return EINVAL; - vap->iv_flags_ext |= IEEE80211_FEXT_PUREN; + vap->iv_flags_ht |= IEEE80211_FHT_PUREN; } else - vap->iv_flags_ext &= ~IEEE80211_FEXT_PUREN; + vap->iv_flags_ht &= ~IEEE80211_FHT_PUREN; /* NB: reset only if we're operating on an 11n channel */ if (isvapht(vap)) error = ERESTART; @@ -3032,11 +3032,11 @@ ieee80211_ioctl_set80211(struct ieee8021 break; case IEEE80211_IOC_HTCOMPAT: if (ireq->i_val) { - if ((vap->iv_flags_ext & IEEE80211_FEXT_HT) == 0) + if ((vap->iv_flags_ht & IEEE80211_FHT_HT) == 0) return EOPNOTSUPP; - vap->iv_flags_ext |= IEEE80211_FEXT_HTCOMPAT; + vap->iv_flags_ht |= IEEE80211_FHT_HTCOMPAT; } else - vap->iv_flags_ext &= ~IEEE80211_FEXT_HTCOMPAT; + vap->iv_flags_ht &= ~IEEE80211_FHT_HTCOMPAT; /* NB: reset only if we're operating on an 11n channel */ if (isvapht(vap)) error = ERESTART; @@ -3135,9 +3135,9 @@ ieee80211_ioctl_set80211(struct ieee8021 if (ireq->i_val != 0) { if ((vap->iv_htcaps & IEEE80211_HTC_RIFS) == 0) return EOPNOTSUPP; - vap->iv_flags_ext |= IEEE80211_FEXT_RIFS; + vap->iv_flags_ht |= IEEE80211_FHT_RIFS; } else - vap->iv_flags_ext &= ~IEEE80211_FEXT_RIFS; + vap->iv_flags_ht &= ~IEEE80211_FHT_RIFS; /* NB: if not operating in 11n this can wait */ if (isvapht(vap)) error = ERESTART; Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_node.c Sun Jun 7 22:00:22 2009 (r193655) @@ -287,10 +287,10 @@ ieee80211_node_set_chan(struct ieee80211 * and non-ERP rates in 11g for mixed ERP+non-ERP bss. */ if (mode == IEEE80211_MODE_11NA && - (vap->iv_flags_ext & IEEE80211_FEXT_PUREN) == 0) + (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0) mode = IEEE80211_MODE_11A; else if (mode == IEEE80211_MODE_11NG && - (vap->iv_flags_ext & IEEE80211_FEXT_PUREN) == 0) + (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0) mode = IEEE80211_MODE_11G; if (mode == IEEE80211_MODE_11G && (vap->iv_flags & IEEE80211_F_PUREG) == 0) @@ -650,7 +650,7 @@ ieee80211_setupcurchan(struct ieee80211c * set of running vap's. This assumes we are called * after ni_chan is setup for each vap. */ - /* NB: this assumes IEEE80211_FEXT_USEHT40 > IEEE80211_FEXT_HT */ + /* NB: this assumes IEEE80211_FHT_USEHT40 > IEEE80211_FHT_HT */ if (flags > ieee80211_htchanflags(c)) c = ieee80211_ht_adjust_channel(ic, c, flags); } @@ -1204,7 +1204,7 @@ ieee80211_node_create_wds(struct ieee802 ni->ni_flags |= IEEE80211_NODE_FF; #endif if ((ic->ic_htcaps & IEEE80211_HTC_HT) && - (vap->iv_flags_ext & IEEE80211_FEXT_HT)) { + (vap->iv_flags_ht & IEEE80211_FHT_HT)) { /* * Device is HT-capable and HT is enabled for * the vap; setup HT operation. On return Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_output.c Sun Jun 7 22:00:22 2009 (r193655) @@ -266,7 +266,7 @@ ieee80211_start(struct ifnet *ifp) * otherwise unable to establish a BA stream. */ if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && - (vap->iv_flags_ext & IEEE80211_FEXT_AMPDU_TX) && + (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX) && (m->m_flags & M_EAPOL) == 0) { const int ac = M_WME_GETAC(m); struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; @@ -1853,7 +1853,7 @@ ieee80211_send_mgmt(struct ieee80211_nod ic->ic_curchan); frm = ieee80211_add_supportedchannels(frm, ic); } - if ((vap->iv_flags_ext & IEEE80211_FEXT_HT) && + if ((vap->iv_flags_ht & IEEE80211_FHT_HT) && ni->ni_ies.htcap_ie != NULL && ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_HTCAP) frm = ieee80211_add_htcap(frm, ni); @@ -1865,7 +1865,7 @@ ieee80211_send_mgmt(struct ieee80211_nod if ((ic->ic_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) frm = ieee80211_add_wme_info(frm, &ic->ic_wme); - if ((vap->iv_flags_ext & IEEE80211_FEXT_HT) && + if ((vap->iv_flags_ht & IEEE80211_FHT_HT) && ni->ni_ies.htcap_ie != NULL && ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_VENDOR) frm = ieee80211_add_htcap_vendor(frm, ni); @@ -2138,7 +2138,7 @@ ieee80211_alloc_proberesp(struct ieee802 if (vap->iv_flags & IEEE80211_F_WME) frm = ieee80211_add_wme_param(frm, &ic->ic_wme); if (IEEE80211_IS_CHAN_HT(bss->ni_chan) && - (vap->iv_flags_ext & IEEE80211_FEXT_HTCOMPAT) && + (vap->iv_flags_ht & IEEE80211_FHT_HTCOMPAT) && legacy != IEEE80211_SEND_LEGACY_11B) { frm = ieee80211_add_htcap_vendor(frm, bss); frm = ieee80211_add_htinfo_vendor(frm, bss); @@ -2427,7 +2427,7 @@ ieee80211_beacon_construct(struct mbuf * frm = ieee80211_add_wme_param(frm, &ic->ic_wme); } if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && - (vap->iv_flags_ext & IEEE80211_FEXT_HTCOMPAT)) { + (vap->iv_flags_ht & IEEE80211_FHT_HTCOMPAT)) { frm = ieee80211_add_htcap_vendor(frm, ni); frm = ieee80211_add_htinfo_vendor(frm, ni); } Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_proto.h Sun Jun 7 22:00:22 2009 (r193655) @@ -58,6 +58,7 @@ void ieee80211_proto_vdetach(struct ieee void ieee80211_syncifflag_locked(struct ieee80211com *, int flag); void ieee80211_syncflag(struct ieee80211vap *, int flag); +void ieee80211_syncflag_ht(struct ieee80211vap *, int flag); void ieee80211_syncflag_ext(struct ieee80211vap *, int flag); #define ieee80211_input(ni, m, rssi, nf) \ Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_scan_sta.c Sun Jun 7 22:00:22 2009 (r193655) @@ -1561,7 +1561,7 @@ notfound: chan = adhoc_pick_channel(ss, 0); if (chan != NULL) chan = ieee80211_ht_adjust_channel(ic, - chan, vap->iv_flags_ext); + chan, vap->iv_flags_ht); } else chan = vap->iv_des_chan; if (chan != NULL) { @@ -1761,7 +1761,7 @@ ap_end(struct ieee80211_scan_state *ss, return 1; } ieee80211_create_ibss(vap, - ieee80211_ht_adjust_channel(ic, bestchan, vap->iv_flags_ext)); + ieee80211_ht_adjust_channel(ic, bestchan, vap->iv_flags_ht)); return 1; } Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_sta.c Sun Jun 7 22:00:22 2009 (r193655) @@ -1342,7 +1342,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, ieee80211_parse_athparams(ni, scan.ath, wh); #endif if (scan.htcap != NULL && scan.htinfo != NULL && - (vap->iv_flags_ext & IEEE80211_FEXT_HT)) { + (vap->iv_flags_ht & IEEE80211_FHT_HT)) { ieee80211_ht_updateparams(ni, scan.htcap, scan.htinfo); /* XXX state changes? */ @@ -1532,7 +1532,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, case IEEE80211_ELEMID_VENDOR: if (iswmeoui(frm)) wme = frm; - else if (vap->iv_flags_ext & IEEE80211_FEXT_HTCOMPAT) { + else if (vap->iv_flags_ht & IEEE80211_FHT_HTCOMPAT) { /* * Accept pre-draft HT ie's if the * standard ones have not been seen. @@ -1588,7 +1588,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, * are HT capable in our AssocReq. */ if (htcap != NULL && htinfo != NULL && - (vap->iv_flags_ext & IEEE80211_FEXT_HT)) { + (vap->iv_flags_ht & IEEE80211_FHT_HT)) { ieee80211_ht_node_init(ni); ieee80211_ht_updateparams(ni, htcap, htinfo); ieee80211_setup_htrates(ni, htcap, Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sun Jun 7 21:50:42 2009 (r193654) +++ head/sys/net80211/ieee80211_var.h Sun Jun 7 22:00:22 2009 (r193655) @@ -131,6 +131,7 @@ struct ieee80211com { uint32_t ic_flags; /* state flags */ uint32_t ic_flags_ext; /* extended state flags */ + uint32_t ic_flags_ht; /* HT state flags */ uint32_t ic_flags_ven; /* vendor state flags */ uint32_t ic_caps; /* capabilities */ uint32_t ic_htcaps; /* HT capabilities */ @@ -329,6 +330,7 @@ struct ieee80211vap { uint8_t iv_myaddr[IEEE80211_ADDR_LEN]; uint32_t iv_flags; /* state flags */ uint32_t iv_flags_ext; /* extended state flags */ + uint32_t iv_flags_ht; /* HT state flags */ uint32_t iv_flags_ven; /* vendor state flags */ uint32_t iv_caps; /* capabilities */ uint32_t iv_htcaps; /* HT capabilities */ @@ -516,7 +518,6 @@ MALLOC_DECLARE(M_80211_VAP); ((vap)->iv_flags & (ni)->ni_ath_flags & (bit)) /* ic_flags_ext/iv_flags_ext */ -#define IEEE80211_FEXT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */ #define IEEE80211_FEXT_INACT 0x00000002 /* CONF: sta inact handling */ #define IEEE80211_FEXT_SCANWAIT 0x00000004 /* STATUS: awaiting scan */ /* 0x00000006 reserved */ @@ -536,25 +537,32 @@ MALLOC_DECLARE(M_80211_VAP); /* NB: immutable: should be set only when creating a vap */ #define IEEE80211_FEXT_WDSLEGACY 0x00010000 /* CONF: legacy WDS operation */ #define IEEE80211_FEXT_PROBECHAN 0x00020000 /* CONF: probe passive channel*/ -#define IEEE80211_FEXT_GF 0x00040000 /* CONF: Greenfield enabled */ -#define IEEE80211_FEXT_HT 0x00080000 /* CONF: HT supported */ -#define IEEE80211_FEXT_AMPDU_TX 0x00100000 /* CONF: A-MPDU tx supported */ -#define IEEE80211_FEXT_AMPDU_RX 0x00200000 /* CONF: A-MPDU rx supported */ -#define IEEE80211_FEXT_AMSDU_TX 0x00400000 /* CONF: A-MSDU tx supported */ -#define IEEE80211_FEXT_AMSDU_RX 0x00800000 /* CONF: A-MSDU rx supported */ -#define IEEE80211_FEXT_USEHT40 0x01000000 /* CONF: 20/40 use enabled */ -#define IEEE80211_FEXT_PUREN 0x02000000 /* CONF: 11n w/o legacy sta's */ -#define IEEE80211_FEXT_SHORTGI20 0x04000000 /* CONF: short GI in HT20 */ -#define IEEE80211_FEXT_SHORTGI40 0x08000000 /* CONF: short GI in HT40 */ -#define IEEE80211_FEXT_HTCOMPAT 0x10000000 /* CONF: HT vendor OUI's */ -#define IEEE80211_FEXT_RIFS 0x20000000 /* CONF: RIFS enabled */ -#define IEEE80211_FEXT_STBC_TX 0x40000000 /* CONF: STBC tx enabled */ -#define IEEE80211_FEXT_STBC_RX 0x80000000 /* CONF: STBC rx enabled */ #define IEEE80211_FEXT_BITS \ - "\20\1NONHT_PR\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \ + "\20\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \ "\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT" \ - "\20BPF\21WDSLEGACY\22PROBECHAN\23GF\24HT\25AMDPU_TX\26AMPDU_TX" \ + "\20BPF\21WDSLEGACY\22PROBECHAN" + +/* ic_flags_ht/iv_flags_ht */ +#define IEEE80211_FHT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */ +#define IEEE80211_FHT_GF 0x00040000 /* CONF: Greenfield enabled */ +#define IEEE80211_FHT_HT 0x00080000 /* CONF: HT supported */ +#define IEEE80211_FHT_AMPDU_TX 0x00100000 /* CONF: A-MPDU tx supported */ +#define IEEE80211_FHT_AMPDU_RX 0x00200000 /* CONF: A-MPDU rx supported */ +#define IEEE80211_FHT_AMSDU_TX 0x00400000 /* CONF: A-MSDU tx supported */ +#define IEEE80211_FHT_AMSDU_RX 0x00800000 /* CONF: A-MSDU rx supported */ +#define IEEE80211_FHT_USEHT40 0x01000000 /* CONF: 20/40 use enabled */ +#define IEEE80211_FHT_PUREN 0x02000000 /* CONF: 11n w/o legacy sta's */ +#define IEEE80211_FHT_SHORTGI20 0x04000000 /* CONF: short GI in HT20 */ +#define IEEE80211_FHT_SHORTGI40 0x08000000 /* CONF: short GI in HT40 */ +#define IEEE80211_FHT_HTCOMPAT 0x10000000 /* CONF: HT vendor OUI's */ +#define IEEE80211_FHT_RIFS 0x20000000 /* CONF: RIFS enabled */ +#define IEEE80211_FHT_STBC_TX 0x40000000 /* CONF: STBC tx enabled */ +#define IEEE80211_FHT_STBC_RX 0x80000000 /* CONF: STBC rx enabled */ + +#define IEEE80211_FHT_BITS \ + "\20\1NONHT_PR" \ + "\23GF\24HT\25AMDPU_TX\26AMPDU_TX" \ "\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN\33SHORTGI20\34SHORTGI40" \ "\35HTCOMPAT\36RIFS\37STBC_TX\40STBC_RX" @@ -751,14 +759,14 @@ ieee80211_beacon_notify(struct ieee80211 /* * Calculate HT channel promotion flags for a channel. - * XXX belongs in ieee80211_ht.h but needs IEEE80211_FEXT_* + * XXX belongs in ieee80211_ht.h but needs IEEE80211_FHT_* */ static __inline int ieee80211_htchanflags(const struct ieee80211_channel *c) { return IEEE80211_IS_CHAN_HT40(c) ? - IEEE80211_FEXT_HT | IEEE80211_FEXT_USEHT40 : - IEEE80211_IS_CHAN_HT(c) ? IEEE80211_FEXT_HT : 0; + IEEE80211_FHT_HT | IEEE80211_FHT_USEHT40 : + IEEE80211_IS_CHAN_HT(c) ? IEEE80211_FHT_HT : 0; } /* From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 22:03:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D08106566B; Sun, 7 Jun 2009 22:03:08 +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 6EAB88FC08; Sun, 7 Jun 2009 22:03:08 +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 n57M38pH006858; Sun, 7 Jun 2009 22:03:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57M38Mn006857; Sun, 7 Jun 2009 22:03:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906072203.n57M38Mn006857@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Jun 2009 22:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193656 - head/sys/dev/mwl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 22:03:08 -0000 Author: sam Date: Sun Jun 7 22:03:07 2009 New Revision: 193656 URL: http://svn.freebsd.org/changeset/base/193656 Log: track HT flags move to iv_flags_ht Modified: head/sys/dev/mwl/if_mwl.c Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Sun Jun 7 22:00:22 2009 (r193655) +++ head/sys/dev/mwl/if_mwl.c Sun Jun 7 22:03:07 2009 (r193656) @@ -1079,10 +1079,10 @@ mwl_seteapolformat(struct ieee80211vap * * NB: this may violate POLA for sta and wds vap's. */ if (mode == IEEE80211_MODE_11NA && - (vap->iv_flags_ext & IEEE80211_FEXT_PUREN) == 0) + (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0) rate = vap->iv_txparms[IEEE80211_MODE_11A].mgmtrate; else if (mode == IEEE80211_MODE_11NG && - (vap->iv_flags_ext & IEEE80211_FEXT_PUREN) == 0) + (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0) rate = vap->iv_txparms[IEEE80211_MODE_11G].mgmtrate; else rate = vap->iv_txparms[mode].mgmtrate; @@ -1263,8 +1263,8 @@ mwl_reset_vap(struct ieee80211vap *vap, /* XXX off by 1? */ mwl_hal_setrtsthreshold(hvap, vap->iv_rtsthreshold); /* XXX auto? 20/40 split? */ - mwl_hal_sethtgi(hvap, (vap->iv_flags_ext & - (IEEE80211_FEXT_SHORTGI20|IEEE80211_FEXT_SHORTGI40)) ? 1 : 0); + mwl_hal_sethtgi(hvap, (vap->iv_flags_ht & + (IEEE80211_FHT_SHORTGI20|IEEE80211_FHT_SHORTGI40)) ? 1 : 0); mwl_hal_setnprot(hvap, ic->ic_htprotmode == IEEE80211_PROT_NONE ? HTPROTECT_NONE : HTPROTECT_AUTO); /* XXX txpower cap */ @@ -3865,7 +3865,7 @@ mwl_getapmode(const struct ieee80211vap MWL_HAL_APMODE mode; if (IEEE80211_IS_CHAN_HT(chan)) { - if (vap->iv_flags_ext & IEEE80211_FEXT_PUREN) + if (vap->iv_flags_ht & IEEE80211_FHT_PUREN) mode = AP_MODE_N_ONLY; else if (IEEE80211_IS_CHAN_5GHZ(chan)) mode = AP_MODE_AandN; @@ -4366,9 +4366,9 @@ mwl_newassoc(struct ieee80211_node *ni, pi.AddHtInfo.stbc = ni->ni_htstbc; /* constrain according to local configuration */ - if ((vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI40) == 0) + if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0) pi.HTCapabilitiesInfo &= ~IEEE80211_HTCAP_SHORTGI40; - if ((vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI20) == 0) + if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) == 0) pi.HTCapabilitiesInfo &= ~IEEE80211_HTCAP_SHORTGI20; if (ni->ni_chw != 40) pi.HTCapabilitiesInfo &= ~IEEE80211_HTCAP_CHWIDTH40; From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 22:03:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD0CA106568B; Sun, 7 Jun 2009 22:03:25 +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 AAEC58FC08; Sun, 7 Jun 2009 22:03:25 +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 n57M3PVH006898; Sun, 7 Jun 2009 22:03:25 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57M3PUL006897; Sun, 7 Jun 2009 22:03:25 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906072203.n57M3PUL006897@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Jun 2009 22:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193657 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 22:03:26 -0000 Author: sam Date: Sun Jun 7 22:03:25 2009 New Revision: 193657 URL: http://svn.freebsd.org/changeset/base/193657 Log: add iv_flags_ht and ic_flags_ht Modified: head/sys/net80211/ieee80211_ddb.c Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Sun Jun 7 22:03:07 2009 (r193656) +++ head/sys/net80211/ieee80211_ddb.c Sun Jun 7 22:03:25 2009 (r193657) @@ -335,6 +335,7 @@ _db_show_vap(const struct ieee80211vap * db_printf("\tflags=%b\n", vap->iv_flags, IEEE80211_F_BITS); db_printf("\tflags_ext=%b\n", vap->iv_flags_ext, IEEE80211_FEXT_BITS); + db_printf("\tflags_ht=%b\n", vap->iv_flags_ht, IEEE80211_FHT_BITS); db_printf("\tflags_ven=%b\n", vap->iv_flags_ven, IEEE80211_FVEN_BITS); db_printf("\tcaps=%b\n", vap->iv_caps, IEEE80211_C_BITS); db_printf("\thtcaps=%b\n", vap->iv_htcaps, IEEE80211_C_HTCAP_BITS); @@ -493,6 +494,7 @@ _db_show_com(const struct ieee80211com * db_printf("\tflags=%b\n", ic->ic_flags, IEEE80211_F_BITS); db_printf("\tflags_ext=%b\n", ic->ic_flags_ext, IEEE80211_FEXT_BITS); + db_printf("\tflags_ht=%b\n", ic->ic_flags_ht, IEEE80211_FHT_BITS); db_printf("\tflags_ven=%b\n", ic->ic_flags_ven, IEEE80211_FVEN_BITS); db_printf("\tcaps=%b\n", ic->ic_caps, IEEE80211_C_BITS); db_printf("\tcryptocaps=%b\n", From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 22:05:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F38CF106566C; Sun, 7 Jun 2009 22:05:23 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.82]) by mx1.freebsd.org (Postfix) with ESMTP id A845F8FC14; Sun, 7 Jun 2009 22:05:23 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from iMac.local (pgw.vnode.se [77.110.37.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id BC2A0E9F42B; Mon, 8 Jun 2009 00:05:21 +0200 (CEST) Message-ID: <4A2C39A1.8060702@FreeBSD.org> Date: Mon, 08 Jun 2009 00:05:21 +0200 From: Joel Dahl User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Ariff Abdullah References: <200906071912.n57JC9GZ002423@svn.freebsd.org> In-Reply-To: <200906071912.n57JC9GZ002423@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193640 - in head/sys: conf dev/sound dev/sound/isa dev/sound/macio dev/sound/midi dev/sound/pci dev/sound/pci/hda dev/sound/pcm dev/sound/sbus dev/sound/usb modules/sound/sound sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 22:05:24 -0000 Ariff Abdullah skrev: > Author: ariff > Date: Sun Jun 7 19:12:08 2009 > New Revision: 193640 > URL: http://svn.freebsd.org/changeset/base/193640 > > Log: > Sound Mega-commit. Expect further cleanup until code freeze. This is really good news. Thank you! -- Joel From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 22:06:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 567811065670; Sun, 7 Jun 2009 22:06:16 +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 2A4C78FC0C; Sun, 7 Jun 2009 22:06:16 +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 n57M6GUD006999; Sun, 7 Jun 2009 22:06:16 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57M6GVS006998; Sun, 7 Jun 2009 22:06:16 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906072206.n57M6GVS006998@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Jun 2009 22:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193658 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 22:06:16 -0000 Author: sam Date: Sun Jun 7 22:06:15 2009 New Revision: 193658 URL: http://svn.freebsd.org/changeset/base/193658 Log: teach ieee80211_classify about ipv6 packets Reviewed by: bz, rrs Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Jun 7 22:03:25 2009 (r193657) +++ head/sys/net80211/ieee80211_output.c Sun Jun 7 22:06:15 2009 (r193658) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_wlan.h" #include @@ -61,6 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#ifdef INET6 +#include +#endif #include @@ -730,13 +734,13 @@ ieee80211_classify(struct ieee80211_node v_wme_ac = TID_TO_WME_AC(EVL_PRIOFTAG(ni->ni_vlan)); } + /* XXX m_copydata may be too slow for fast path */ #ifdef INET if (eh->ether_type == htons(ETHERTYPE_IP)) { uint8_t tos; /* * IP frame, map the DSCP bits from the TOS field. */ - /* XXX m_copydata may be too slow for fast path */ /* NB: ip header may not be in first mbuf */ m_copydata(m, sizeof(struct ether_header) + offsetof(struct ip, ip_tos), sizeof(tos), &tos); @@ -744,7 +748,25 @@ ieee80211_classify(struct ieee80211_node d_wme_ac = TID_TO_WME_AC(tos); } else { #endif /* INET */ +#ifdef INET6 + if (eh->ether_type == htons(ETHERTYPE_IPV6)) { + uint32_t flow; + uint8_t tos; + /* + * IPv6 frame, map the DSCP bits from the TOS field. + */ + m_copydata(m, sizeof(struct ether_header) + + offsetof(struct ip6_hdr, ip6_flow), sizeof(flow), + (caddr_t) &flow); + tos = (uint8_t)(ntohl(flow) >> 20); + tos >>= 5; /* NB: ECN + low 3 bits of DSCP */ + d_wme_ac = TID_TO_WME_AC(tos); + } else { +#endif /* INET6 */ d_wme_ac = WME_AC_BE; +#ifdef INET6 + } +#endif #ifdef INET } #endif From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 22:52:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D962106564A; Sun, 7 Jun 2009 22:52:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 310D18FC0C; Sun, 7 Jun 2009 22:52:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57Mqn4R008025; Sun, 7 Jun 2009 22:52:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57Mqn9d008024; Sun, 7 Jun 2009 22:52:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <200906072252.n57Mqn9d008024@svn.freebsd.org> From: Adrian Chadd Date: Sun, 7 Jun 2009 22:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193662 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 22:52:49 -0000 Author: adrian Date: Sun Jun 7 22:52:48 2009 New Revision: 193662 URL: http://svn.freebsd.org/changeset/base/193662 Log: Decouple the i386 native and i386 Xen APIC definitions a little further. I'm experimenting locally with xen APIC emulation a bit and this makes it easier to migrate APIC entries between being bitmapped and not being bitmapped. Modified: head/sys/i386/include/apicvar.h Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Sun Jun 7 22:52:19 2009 (r193661) +++ head/sys/i386/include/apicvar.h Sun Jun 7 22:52:48 2009 (r193662) @@ -108,12 +108,13 @@ */ /* Interrupts for local APIC LVT entries other than the timer. */ +#ifdef XEN +/* These are the Xen i386 APIC definitions */ #define APIC_LOCAL_INTS 240 #define APIC_ERROR_INT APIC_LOCAL_INTS #define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1) - #define APIC_IPI_INTS (APIC_LOCAL_INTS + 2) -#ifdef XEN + #define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ #define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */ #define IPI_INVLPG (APIC_IPI_INTS + 2) @@ -123,7 +124,24 @@ /* Vector to handle bitmap based IPIs */ #define IPI_BITMAP_VECTOR (APIC_IPI_INTS + 6) -#else +/* IPIs handled by IPI_BITMAPED_VECTOR (XXX ups is there a better place?) */ +#define IPI_AST 0 /* Generate software trap. */ +#define IPI_PREEMPT 1 +#define IPI_HARDCLOCK 2 +#define IPI_STATCLOCK 3 +#define IPI_PROFCLOCK 4 +#define IPI_BITMAP_LAST IPI_PROFCLOCK +#define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) + +#define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ + +#else /* XEN */ +/* These are the normal i386 APIC definitions */ +#define APIC_LOCAL_INTS 240 +#define APIC_ERROR_INT APIC_LOCAL_INTS +#define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1) +#define APIC_IPI_INTS (APIC_LOCAL_INTS + 2) + #define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ #define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */ #define IPI_INVLPG (APIC_IPI_INTS + 2) @@ -132,7 +150,6 @@ #define IPI_LAZYPMAP (APIC_IPI_INTS + 5) /* Lazy pmap release. */ /* Vector to handle bitmap based IPIs */ #define IPI_BITMAP_VECTOR (APIC_IPI_INTS + 6) -#endif /* IPIs handled by IPI_BITMAPED_VECTOR (XXX ups is there a better place?) */ #define IPI_AST 0 /* Generate software trap. */ @@ -144,6 +161,7 @@ #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ +#endif /* XEN */ /* * The spurious interrupt can share the priority class with the IPIs since From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 23:00:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C4881065672; Sun, 7 Jun 2009 23:00:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27E378FC1F; Sun, 7 Jun 2009 23:00:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57N0fdY008331; Sun, 7 Jun 2009 23:00:41 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57N0ems008322; Sun, 7 Jun 2009 23:00:40 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200906072300.n57N0ems008322@svn.freebsd.org> From: Hiroki Sato Date: Sun, 7 Jun 2009 23:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193664 - in head: sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 23:00:41 -0000 Author: hrs Date: Sun Jun 7 23:00:40 2009 New Revision: 193664 URL: http://svn.freebsd.org/changeset/base/193664 Log: Fix and add a workaround on an issue of EtherIP packet with reversed version field sent via gif(4)+if_bridge(4). The EtherIP implementation found on FreeBSD 6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 had an interoperability issue because it sent the incorrect EtherIP packets and discarded the correct ones. This change introduces the following two flags to gif(4): accept_rev_ethip_ver: accepts both correct EtherIP packets and ones with reversed version field, if enabled. If disabled, the gif accepts the correct packets only. This flag is enabled by default. send_rev_ethip_ver: sends EtherIP packets with reversed version field intentionally, if enabled. If disabled, the gif sends the correct packets only. This flag is disabled by default. These flags are stored in struct gif_softc and can be set by ifconfig(8) on per-interface basis. Note that this is an incompatible change of EtherIP with the older FreeBSD releases. If you need to interoperate older FreeBSD boxes and new versions after this commit, setting "send_rev_ethip_ver" is needed. Reviewed by: thompsa and rwatson Spotted by: Shunsuke SHINOMIYA PR: kern/125003 MFC after: 2 weeks Added: head/sbin/ifconfig/ifgif.c (contents, props changed) Modified: head/sbin/ifconfig/Makefile head/share/man/man4/gif.4 head/share/man/man4/if_bridge.4 head/sys/net/if_gif.c head/sys/net/if_gif.h head/sys/netinet/in_gif.c head/sys/netinet6/in6_gif.c head/sys/sys/priv.h Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Sun Jun 7 22:55:48 2009 (r193663) +++ head/sbin/ifconfig/Makefile Sun Jun 7 23:00:40 2009 (r193664) @@ -24,6 +24,7 @@ SRCS+= ifmac.c # MAC support SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support SRCS+= ifvlan.c # SIOC[GS]ETVLAN support SRCS+= ifgre.c # GRE keys etc +SRCS+= ifgif.c # GIF reversed header workaround SRCS+= ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support DPADD+= ${LIBBSDXML} ${LIBSBUF} Added: head/sbin/ifconfig/ifgif.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ifconfig/ifgif.c Sun Jun 7 23:00:40 2009 (r193664) @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2009 Hiroki Sato. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES 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 MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "ifconfig.h" + +static void gif_status(int); + +static struct { + const char *label; + u_int mask; +} gif_opts[] = { + { "ACCEPT_REV_ETHIP_VER", GIF_ACCEPT_REVETHIP }, + { "SEND_REV_ETHIP_VER", GIF_SEND_REVETHIP }, +}; + +static void +gif_status(int s) +{ + int opts; + int nopts = 0; + int i; + + ifr.ifr_data = (caddr_t)&opts; + if (ioctl(s, GIFGOPTS, &ifr) == -1) + return; + + printf("\toptions=%d<", opts); + for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) { + if (opts & gif_opts[i].mask) { + if (nopts++) + printf(","); + printf("%s", gif_opts[i].label); + } + } + printf(">\n"); +} + +static void +setgifopts(const char *val, + int d, int s, const struct afswtch *afp) +{ + int opts; + + ifr.ifr_data = (caddr_t)&opts; + if (ioctl(s, GIFGOPTS, &ifr) == -1) { + warn("ioctl(GIFGOPTS)"); + return; + } + + if (d < 0) + opts &= ~(-d); + else + opts |= d; + + if (ioctl(s, GIFSOPTS, &ifr) == -1) { + warn("ioctl(GIFSOPTS)"); + return; + } +} + +static struct cmd gif_cmds[] = { + DEF_CMD("accept_rev_ethip_ver", GIF_ACCEPT_REVETHIP, setgifopts), + DEF_CMD("-accept_rev_ethip_ver",-GIF_ACCEPT_REVETHIP, setgifopts), + DEF_CMD("send_rev_ethip_ver", GIF_SEND_REVETHIP, setgifopts), + DEF_CMD("-send_rev_ethip_ver", -GIF_SEND_REVETHIP, setgifopts), +}; + +static struct afswtch af_gif = { + .af_name = "af_gif", + .af_af = AF_UNSPEC, + .af_other_status = gif_status, +}; + +static __constructor void +gif_ctor(void) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + int i; + + for (i = 0; i < N(gif_cmds); i++) + cmd_register(&gif_cmds[i]); + af_register(&af_gif); +#undef N +} Modified: head/share/man/man4/gif.4 ============================================================================== --- head/share/man/man4/gif.4 Sun Jun 7 22:55:48 2009 (r193663) +++ head/share/man/man4/gif.4 Sun Jun 7 23:00:40 2009 (r193664) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 1999 +.Dd June 8, 2009 .Dt GIF 4 .Os .Sh NAME @@ -256,3 +256,32 @@ had a multi-destination behavior, config .Dv IFF_LINK0 flag. The behavior is obsolete and is no longer supported. +.Pp +On +.Fx +6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 +the +.Nm +sends and receives incorrect EtherIP packets with reversed version +field when +.Xr if_bridge 4 +is used together. As a workaround on this interoperability issue, the +following two +.Xr ifconfig 8 +flags can be used: +.Bl -tag -width "accept_rev_ethip_ver" -offset indent +.It accept_rev_ethip_ver +accepts both correct EtherIP packets and ones with reversed version +field, if enabled. If disabled, the +.Nm +accepts the correct packets only. This flag is enabled by default. +.It send_rev_ethip_ver +sends EtherIP packets with reversed version field intentionally, if +enabled. If disabled, the +.Nm +sends the correct packets only. This flag is disabled by default. +.El +.Pp +If interoperability with the older +.Fx +machines is needed, both of these two flags must be enabled. Modified: head/share/man/man4/if_bridge.4 ============================================================================== --- head/share/man/man4/if_bridge.4 Sun Jun 7 22:55:48 2009 (r193663) +++ head/share/man/man4/if_bridge.4 Sun Jun 7 23:00:40 2009 (r193664) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2007 +.Dd June 8, 2009 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -406,6 +406,12 @@ ifconfig gif0 tunnel 1.2.3.4 5.6.7.8 up ifconfig bridge0 create ifconfig bridge0 addm fxp0 addm gif0 up .Ed +.Pp +Note that +.Fx +6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 have a bug in the EtherIP protocol. +For more details and workaround, see +.Xr gif 4 manual page. .Sh SEE ALSO .Xr gif 4 , .Xr ipf 4 , Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Sun Jun 7 22:55:48 2009 (r193663) +++ head/sys/net/if_gif.c Sun Jun 7 23:00:40 2009 (r193664) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -198,6 +199,7 @@ gif_clone_create(ifc, unit, params) if_initname(GIF2IFP(sc), ifc->ifc_name, unit); sc->encap_cookie4 = sc->encap_cookie6 = NULL; + sc->gif_options = GIF_ACCEPT_REVETHIP; GIF2IFP(sc)->if_addrlen = 0; GIF2IFP(sc)->if_mtu = GIF_MTU; @@ -534,6 +536,7 @@ gif_input(m, af, ifp) struct ifnet *ifp; { int isr, n; + struct gif_softc *sc = ifp->if_softc; struct etherip_header *eip; struct ether_header *eh; struct ifnet *oldifp; @@ -594,11 +597,25 @@ gif_input(m, af, ifp) } eip = mtod(m, struct etherip_header *); - if (eip->eip_ver != - (ETHERIP_VERSION & ETHERIP_VER_VERS_MASK)) { - /* discard unknown versions */ - m_freem(m); - return; + /* + * GIF_ACCEPT_REVETHIP (enabled by default) intentionally + * accepts an EtherIP packet with revered version field in + * the header. This is a knob for backward compatibility + * with FreeBSD 7.2R or prior. + */ + if (sc->gif_options & GIF_ACCEPT_REVETHIP) { + if (eip->eip_resvl != ETHERIP_VERSION + && eip->eip_ver != ETHERIP_VERSION) { + /* discard unknown versions */ + m_freem(m); + return; + } + } else { + if (eip->eip_ver != ETHERIP_VERSION) { + /* discard unknown versions */ + m_freem(m); + return; + } } m_adj(m, sizeof(struct etherip_header)); @@ -653,6 +670,7 @@ gif_ioctl(ifp, cmd, data) struct gif_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq*)data; int error = 0, size; + u_int options; struct sockaddr *dst, *src; #ifdef SIOCSIFMTU /* xxx */ u_long mtu; @@ -887,6 +905,24 @@ gif_ioctl(ifp, cmd, data) /* if_ioctl() takes care of it */ break; + case GIFGOPTS: + options = sc->gif_options; + error = copyout(&options, ifr->ifr_data, + sizeof(options)); + break; + + case GIFSOPTS: + if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0) + break; + if ((error = copyin(&options, &sc->gif_options, + sizeof(sc->gif_options)))) { + if ((options | GIF_FULLOPTS) == GIF_FULLOPTS) + ifr->ifr_data = (caddr_t)options; + else + error = EINVAL; + } + break; + default: error = EINVAL; break; Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Sun Jun 7 22:55:48 2009 (r193663) +++ head/sys/net/if_gif.h Sun Jun 7 23:00:40 2009 (r193664) @@ -71,6 +71,7 @@ struct gif_softc { const struct encaptab *encap_cookie4; const struct encaptab *encap_cookie6; void *gif_netgraph; /* ng_gif(4) netgraph node info */ + u_int gif_options; LIST_ENTRY(gif_softc) gif_list; /* all gif's are linked */ }; #define GIF2IFP(sc) ((sc)->gif_ifp) @@ -94,12 +95,18 @@ struct gif_softc { #define MTAG_GIF_CALLED 0 struct etherip_header { - u_int8_t eip_ver; /* version/reserved */ - u_int8_t eip_pad; /* required padding byte */ -}; -#define ETHERIP_VER_VERS_MASK 0x0f -#define ETHERIP_VER_RSVD_MASK 0xf0 -#define ETHERIP_VERSION 0x03 +#if BYTE_ORDER == LITTLE_ENDIAN + u_int eip_resvl:4, /* reserved */ + eip_ver:4; /* version */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int eip_ver:4, /* version */ + eip_resvl:4; /* reserved */ +#endif + u_int8_t eip_resvh; /* reserved */ +} __packed; + +#define ETHERIP_VERSION 0x3 /* mbuf adjust factor to force 32-bit alignment of IP header */ #define ETHERIP_ALIGN 2 @@ -143,4 +150,11 @@ extern struct vnet_gif vnet_gif_0; #endif /* _KERNEL */ +#define GIFGOPTS _IOR('i', 150, struct ifreq) +#define GIFSOPTS _IOW('i', 151, struct ifreq) + +#define GIF_ACCEPT_REVETHIP 0x0001 +#define GIF_SEND_REVETHIP 0x0010 +#define GIF_FULLOPTS (GIF_ACCEPT_REVETHIP|GIF_SEND_REVETHIP) + #endif /* _NET_IF_GIF_H_ */ Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Sun Jun 7 22:55:48 2009 (r193663) +++ head/sys/netinet/in_gif.c Sun Jun 7 23:00:40 2009 (r193664) @@ -148,8 +148,22 @@ in_gif_output(struct ifnet *ifp, int fam #endif /* INET6 */ case AF_LINK: proto = IPPROTO_ETHERIP; - eiphdr.eip_ver = ETHERIP_VERSION & ETHERIP_VER_VERS_MASK; - eiphdr.eip_pad = 0; + + /* + * GIF_SEND_REVETHIP (disabled by default) intentionally + * sends an EtherIP packet with revered version field in + * the header. This is a knob for backward compatibility + * with FreeBSD 7.2R or prior. + */ + if ((sc->gif_options & GIF_SEND_REVETHIP)) { + eiphdr.eip_ver = 0; + eiphdr.eip_resvl = ETHERIP_VERSION; + eiphdr.eip_resvh = 0; + } else { + eiphdr.eip_ver = ETHERIP_VERSION; + eiphdr.eip_resvl = 0; + eiphdr.eip_resvh = 0; + } /* prepend Ethernet-in-IP header */ M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); if (m && m->m_len < sizeof(struct etherip_header)) Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Sun Jun 7 22:55:48 2009 (r193663) +++ head/sys/netinet6/in6_gif.c Sun Jun 7 23:00:40 2009 (r193664) @@ -144,8 +144,22 @@ in6_gif_output(struct ifnet *ifp, #endif case AF_LINK: proto = IPPROTO_ETHERIP; - eiphdr.eip_ver = ETHERIP_VERSION & ETHERIP_VER_VERS_MASK; - eiphdr.eip_pad = 0; + + /* + * GIF_SEND_REVETHIP (disabled by default) intentionally + * sends an EtherIP packet with revered version field in + * the header. This is a knob for backward compatibility + * with FreeBSD 7.2R or prior. + */ + if ((sc->gif_options & GIF_SEND_REVETHIP)) { + eiphdr.eip_ver = 0; + eiphdr.eip_resvl = ETHERIP_VERSION; + eiphdr.eip_resvh = 0; + } else { + eiphdr.eip_ver = ETHERIP_VERSION; + eiphdr.eip_resvl = 0; + eiphdr.eip_resvh = 0; + } /* prepend Ethernet-in-IP header */ M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); if (m && m->m_len < sizeof(struct etherip_header)) Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Sun Jun 7 22:55:48 2009 (r193663) +++ head/sys/sys/priv.h Sun Jun 7 23:00:40 2009 (r193664) @@ -324,6 +324,7 @@ #define PRIV_NET_ADDIFADDR 413 /* Add protocol addr to interface. */ #define PRIV_NET_DELIFADDR 414 /* Delete protocol addr on interface. */ #define PRIV_NET_LAGG 415 /* Administer lagg interface. */ +#define PRIV_NET_GIF 416 /* Administer gif interface. */ /* * 802.11-related privileges. From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 23:16:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D62D3106564A; Sun, 7 Jun 2009 23:16:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 568CE8FC12; Sun, 7 Jun 2009 23:16:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57NGADA008636; Sun, 7 Jun 2009 23:16:10 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57NGAuS008635; Sun, 7 Jun 2009 23:16:10 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906072316.n57NGAuS008635@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Jun 2009 23:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193665 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 23:16:12 -0000 Author: sam Date: Sun Jun 7 23:16:10 2009 New Revision: 193665 URL: http://svn.freebsd.org/changeset/base/193665 Log: use c99-style initializers Modified: head/sys/net80211/ieee80211_crypto.c Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Sun Jun 7 23:00:40 2009 (r193664) +++ head/sys/net80211/ieee80211_crypto.c Sun Jun 7 23:16:10 2009 (r193665) @@ -235,13 +235,13 @@ ieee80211_crypto_available(u_int cipher) /* XXX well-known names! */ static const char *cipher_modnames[IEEE80211_CIPHER_MAX] = { - "wlan_wep", /* IEEE80211_CIPHER_WEP */ - "wlan_tkip", /* IEEE80211_CIPHER_TKIP */ - "wlan_aes_ocb", /* IEEE80211_CIPHER_AES_OCB */ - "wlan_ccmp", /* IEEE80211_CIPHER_AES_CCM */ - "#4", /* reserved */ - "wlan_ckip", /* IEEE80211_CIPHER_CKIP */ - "wlan_none", /* IEEE80211_CIPHER_NONE */ + [IEEE80211_CIPHER_WEP] = "wlan_wep", + [IEEE80211_CIPHER_TKIP] = "wlan_tkip", + [IEEE80211_CIPHER_AES_OCB] = "wlan_aes_ocb", + [IEEE80211_CIPHER_AES_CCM] = "wlan_ccmp", + [IEEE80211_CIPHER_TKIPMIC] = "#4", /* NB: reserved */ + [IEEE80211_CIPHER_CKIP] = "wlan_ckip", + [IEEE80211_CIPHER_NONE] = "wlan_none", }; /* From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 23:16:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F10EF106566B; Sun, 7 Jun 2009 23:16:59 +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 DFA048FC17; Sun, 7 Jun 2009 23:16:59 +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 n57NGxpM008683; Sun, 7 Jun 2009 23:16:59 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57NGxR2008682; Sun, 7 Jun 2009 23:16:59 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906072316.n57NGxR2008682@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Jun 2009 23:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193666 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 23:17:00 -0000 Author: sam Date: Sun Jun 7 23:16:59 2009 New Revision: 193666 URL: http://svn.freebsd.org/changeset/base/193666 Log: prefer callout_schedule Modified: head/sys/net80211/ieee80211_dfs.c Modified: head/sys/net80211/ieee80211_dfs.c ============================================================================== --- head/sys/net80211/ieee80211_dfs.c Sun Jun 7 23:16:10 2009 (r193665) +++ head/sys/net80211/ieee80211_dfs.c Sun Jun 7 23:16:59 2009 (r193666) @@ -232,8 +232,7 @@ dfs_timeout(void *arg) } if (oldest != now) { /* arrange to process next channel up for a status change */ - callout_reset(&dfs->nol_timer, oldest + NOL_TIMEOUT, - dfs_timeout, ic); + callout_schedule(&dfs->nol_timer, oldest + NOL_TIMEOUT); } IEEE80211_UNLOCK(ic); } From owner-svn-src-head@FreeBSD.ORG Sun Jun 7 23:38:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1B1B1065673; Sun, 7 Jun 2009 23:38:16 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF3E48FC0A; Sun, 7 Jun 2009 23:38:16 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57NcGrI009270; Sun, 7 Jun 2009 23:38:16 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57NcGgu009269; Sun, 7 Jun 2009 23:38:16 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906072338.n57NcGgu009269@svn.freebsd.org> From: Ariff Abdullah Date: Sun, 7 Jun 2009 23:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193667 - head/sys/dev/sound/sbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 23:38:17 -0000 Author: ariff Date: Sun Jun 7 23:38:16 2009 New Revision: 193667 URL: http://svn.freebsd.org/changeset/base/193667 Log: Fix build on sparc64. Pointy hat: ariff@ Modified: head/sys/dev/sound/sbus/cs4231.c Modified: head/sys/dev/sound/sbus/cs4231.c ============================================================================== --- head/sys/dev/sound/sbus/cs4231.c Sun Jun 7 23:16:59 2009 (r193666) +++ head/sys/dev/sound/sbus/cs4231.c Sun Jun 7 23:38:16 2009 (r193667) @@ -273,7 +273,7 @@ static u_int32_t cs4231_fmt[] = { SND_FORMAT(AFMT_IMA_ADPCM, 1, 0), SND_FORMAT(AFMT_IMA_ADPCM, 2, 0), SND_FORMAT(AFMT_S16_LE, 1, 0), - SND_FORMAT(S16_LE, 2, 0), + SND_FORMAT(AFMT_S16_LE, 2, 0), SND_FORMAT(AFMT_S16_BE, 1, 0), SND_FORMAT(AFMT_S16_BE, 2, 0), 0 From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 02:13:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 474EA106564A; Mon, 8 Jun 2009 02:13:25 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 355998FC08; Mon, 8 Jun 2009 02:13:25 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n582DOhH012543; Mon, 8 Jun 2009 02:13:24 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n582DOwD012542; Mon, 8 Jun 2009 02:13:24 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200906080213.n582DOwD012542@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 8 Jun 2009 02:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193673 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 02:13:25 -0000 Author: marcel Date: Mon Jun 8 02:13:24 2009 New Revision: 193673 URL: http://svn.freebsd.org/changeset/base/193673 Log: Make the size (-s) and start (-b) parameters of the add verb optional. The missing parameter(s) are automatically filled-in. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Jun 8 01:28:37 2009 (r193672) +++ head/sbin/geom/class/part/geom_part.c Mon Jun 8 02:13:24 2009 (r193673) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); uint32_t PUBSYM(lib_version) = G_LIB_VERSION; uint32_t PUBSYM(version) = 0; +static char autofill[] = "*"; static char optional[] = ""; static char flags[] = "C"; @@ -68,8 +69,8 @@ static void gpart_show(struct gctl_req * struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { - { 'b', "start", NULL, G_TYPE_ASCLBA }, - { 's', "size", NULL, G_TYPE_ASCLBA }, + { 'b', "start", autofill, G_TYPE_ASCLBA }, + { 's', "size", autofill, G_TYPE_ASCLBA }, { 't', "type", NULL, G_TYPE_STRING }, { 'i', index_param, optional, G_TYPE_ASCNUM }, { 'l', "label", optional, G_TYPE_STRING }, @@ -240,6 +241,121 @@ fmtattrib(struct gprovider *pp) return (buf); } +static int +gpart_autofill(struct gctl_req *req) +{ + struct gmesh mesh; + struct gclass *cp; + struct ggeom *gp; + struct gprovider *pp; + unsigned long long first, last; + unsigned long long size, start; + unsigned long long lba, len, grade; + const char *s; + char *val; + int error, has_size, has_start; + + s = gctl_get_ascii(req, "verb"); + if (strcmp(s, "add") != 0) + return (0); + + s = gctl_get_ascii(req, "size"); + has_size = (*s == '*') ? 0 : 1; + size = (has_size) ? (unsigned long long)atoll(s) : 0ULL; + + s = gctl_get_ascii(req, "start"); + has_start = (*s == '*') ? 0 : 1; + start = (has_start) ? (unsigned long long)atoll(s) : ~0ULL; + + /* No autofill necessary. */ + if (has_size && has_start) + return (0); + + error = geom_gettree(&mesh); + if (error) + return (error); + cp = find_class(&mesh, gctl_get_ascii(req, "class")); + gp = find_geom(cp, gctl_get_ascii(req, "geom")); + first = atoll(find_geomcfg(gp, "first")); + last = atoll(find_geomcfg(gp, "last")); + grade = ~0ULL; + while ((pp = find_provider(gp, first)) != NULL) { + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + lba = atoll(s) / pp->lg_sectorsize; + } else + lba = atoll(s); + + if (first < lba) { + /* Free space [first, lba> */ + len = lba - first; + if (has_size) { + if (len >= size && len - size < grade) { + start = first; + grade = len - size; + } + } else if (has_start) { + if (start >= first && start < lba) { + size = lba - start; + grade = start - first; + } + } else { + if (grade == ~0ULL || len > size) { + start = first; + size = len; + grade = 0; + } + } + } + + s = find_provcfg(pp, "end"); + if (s == NULL) { + s = find_provcfg(pp, "length"); + first = lba + atoll(s) / pp->lg_sectorsize; + } else + first = atoll(s) + 1; + } + if (first <= last) { + /* Free space [first-last] */ + len = last - first + 1; + if (has_size) { + if (len >= size && len - size < grade) { + start = first; + grade = len - size; + } + } else if (has_start) { + if (start >= first && start <= last) { + size = last - start + 1; + grade = start - first; + } + } else { + if (grade == ~0ULL || len > size) { + start = first; + size = len; + grade = 0; + } + } + } + + if (grade == ~0ULL) + return (ENOSPC); + + if (!has_size) { + asprintf(&val, "%jd", size); + if (val == NULL) + return (ENOMEM); + gctl_change_param(req, "size", -1, val); + } + if (!has_start) { + asprintf(&val, "%jd", start); + if (val == NULL) + return (ENOMEM); + gctl_change_param(req, "start", -1, val); + } + return (0); +} + static void gpart_show_geom(struct ggeom *gp, const char *element) { @@ -531,6 +647,14 @@ gpart_issue(struct gctl_req *req, unsign const char *errstr; int error, status; + /* autofill parameters (if applicable). */ + error = gpart_autofill(req); + if (error) { + warnc(error, "autofill"); + status = EXIT_FAILURE; + goto done; + } + bzero(buf, sizeof(buf)); gctl_rw_param(req, "output", sizeof(buf), buf); errstr = gctl_issue(req); From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 03:15:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84758106566C; Mon, 8 Jun 2009 03:15:27 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 729A28FC19; Mon, 8 Jun 2009 03:15:27 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n583FRK7014056; Mon, 8 Jun 2009 03:15:27 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n583FRSG014055; Mon, 8 Jun 2009 03:15:27 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200906080315.n583FRSG014055@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 8 Jun 2009 03:15: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: r193674 - head/usr.sbin/mountd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 03:15:28 -0000 Author: kan Date: Mon Jun 8 03:15:27 2009 New Revision: 193674 URL: http://svn.freebsd.org/changeset/base/193674 Log: The change r192913 has added dependency on IP_RECVDSTADDR being set for RPC UDP sockets. Mountd uses internal libc fuctions directly and bypasses generic socket initialization completely, so we need to set IP_RECVDSTADDR here to match the libc behavior. Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon Jun 8 02:13:24 2009 (r193673) +++ head/usr.sbin/mountd/mountd.c Mon Jun 8 03:15:27 2009 (r193674) @@ -568,6 +568,13 @@ create_service(struct netconfig *nconf) continue; } } + if (si.si_socktype == SOCK_DGRAM && + setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, &one, + sizeof one) < 0) { + syslog(LOG_ERR, + "can't disable v4-in-v6 on IPv6 socket"); + exit(1); + } break; case AF_INET6: if (inet_pton(AF_INET6, hosts[nhostsbak], From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 03:18:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75144106564A; Mon, 8 Jun 2009 03:18:45 +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 63D478FC18; Mon, 8 Jun 2009 03:18:45 +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 n583IjVe014143; Mon, 8 Jun 2009 03:18:45 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n583Ijsm014142; Mon, 8 Jun 2009 03:18:45 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906080318.n583Ijsm014142@svn.freebsd.org> From: Sam Leffler Date: Mon, 8 Jun 2009 03:18: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: r193675 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 03:18:45 -0000 Author: sam Date: Mon Jun 8 03:18:45 2009 New Revision: 193675 URL: http://svn.freebsd.org/changeset/base/193675 Log: do not strip M_MORE_DATA on packets coming through ieee80211_start; frames coming out of the ps q may have this set and removing it causes the 802.11 header to not indicate more frames follow which can result in the sta going to sleep and missing them Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Mon Jun 8 03:15:27 2009 (r193674) +++ head/sys/net80211/ieee80211_output.c Mon Jun 8 03:18:45 2009 (r193675) @@ -153,13 +153,14 @@ ieee80211_start(struct ifnet *ifp) break; /* * Sanitize mbuf flags for net80211 use. We cannot - * clear M_PWR_SAV because this may be set for frames - * that are re-submitted from the power save queue. + * clear M_PWR_SAV or M_MORE_DATA because these may + * be set for frames that are re-submitted from the + * power save queue. * * NB: This must be done before ieee80211_classify as * it marks EAPOL in frames with M_EAPOL. */ - m->m_flags &= ~(M_80211_TX - M_PWR_SAV); + m->m_flags &= ~(M_80211_TX - M_PWR_SAV - M_MORE_DATA); /* * Cancel any background scan. */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 03:37:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E6910656AD; Mon, 8 Jun 2009 03:37:26 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC198FC1A; Mon, 8 Jun 2009 03:37:26 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n583bP4t014534; Mon, 8 Jun 2009 03:37:25 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n583bPG1014533; Mon, 8 Jun 2009 03:37:25 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200906080337.n583bPG1014533@svn.freebsd.org> From: Joseph Koshy Date: Mon, 8 Jun 2009 03:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193676 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 03:37:26 -0000 Author: jkoshy Date: Mon Jun 8 03:37:25 2009 New Revision: 193676 URL: http://svn.freebsd.org/changeset/base/193676 Log: Fix grammar. Submitted by: richardtoohey at paradise dot net dot nz on -doc Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Mon Jun 8 03:18:45 2009 (r193675) +++ head/usr.sbin/jail/jail.8 Mon Jun 8 03:37:25 2009 (r193676) @@ -732,7 +732,7 @@ to prevent this will not work either as 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. +One would need to use one file system per jail to make this work. .Ss "Sysctl MIB Entries" The read-only entry .Va security.jail.jailed From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 03:39:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F6AB106564A; Mon, 8 Jun 2009 03:39:16 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DA9E8FC12; Mon, 8 Jun 2009 03:39:16 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n583dGK4014600; Mon, 8 Jun 2009 03:39:16 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n583dGCF014599; Mon, 8 Jun 2009 03:39:16 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200906080339.n583dGCF014599@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 8 Jun 2009 03:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193677 - head/lib/libc/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 03:39:16 -0000 Author: kan Date: Mon Jun 8 03:39:15 2009 New Revision: 193677 URL: http://svn.freebsd.org/changeset/base/193677 Log: Do not attempt to set source address on outgoing messages on UDP socket if we do not have a valid IP address. Modified: head/lib/libc/rpc/svc_dg.c Modified: head/lib/libc/rpc/svc_dg.c ============================================================================== --- head/lib/libc/rpc/svc_dg.c Mon Jun 8 03:37:25 2009 (r193676) +++ head/lib/libc/rpc/svc_dg.c Mon Jun 8 03:39:15 2009 (r193677) @@ -209,7 +209,7 @@ svc_dg_recvfrom(int fd, char *buf, int b return rlen; for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)){ + cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_RECVDSTADDR) { have_lin = TRUE; @@ -300,7 +300,7 @@ svc_dg_sendto(int fd, char *buf, int buf msg.msg_namelen = raddrlen; msg.msg_name = (char *)raddr; - if (laddr->sa_family == AF_INET) { + if (laddr->sa_family == AF_INET && lin->s_addr != INADDR_ANY) { msg.msg_control = (caddr_t)tmp; msg.msg_controllen = CMSG_LEN(sizeof(*lin)); cmsg = CMSG_FIRSTHDR(&msg); From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 04:39:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940AA106566B; Mon, 8 Jun 2009 04:39:47 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6797A8FC15; Mon, 8 Jun 2009 04:39:47 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n584dlSv015990; Mon, 8 Jun 2009 04:39:47 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n584dllO015989; Mon, 8 Jun 2009 04:39:47 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906080439.n584dllO015989@svn.freebsd.org> From: Ariff Abdullah Date: Mon, 8 Jun 2009 04:39: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: r193683 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 04:39:48 -0000 Author: ariff Date: Mon Jun 8 04:39:47 2009 New Revision: 193683 URL: http://svn.freebsd.org/changeset/base/193683 Log: Add notes on various SND_* options. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jun 8 04:34:51 2009 (r193682) +++ head/sys/conf/NOTES Mon Jun 8 04:39:47 2009 (r193683) @@ -2110,6 +2110,42 @@ hint.gusc.0.drq="1" hint.gusc.0.flags="0x13" # +# Following options are intended for debugging/testing purposes: +# +# SND_DEBUG Enable extra debugging code that includes +# sanity checking and possible increase of +# verbosity. +# +# SND_DIAGNOSTIC Simmilar in a spirit of INVARIANTS/DIAGNOSTIC, +# zero tolerance against inconsistencies. +# +# SND_FEEDER_MULTIFORMAT By default, only 16/32 bit feeders are compiled +# in. This options enable most feeder converters +# except for 8bit. WARNING: May bloat the kernel. +# +# SND_FEEDER_FULL_MULTIFORMAT Ditto, but includes 8bit feeders as well. +# +# SND_FEEDER_RATE_HP (feeder_rate) High precision 64bit arithmetic +# as much as possible (the default trying to +# avoid it). Possible slowdown. +# +# SND_PCM_64 (Only applicable for i386/32bit arch) +# Process 32bit samples through 64bit +# integer/arithmetic. Slight increase of dynamic +# range at a cost of possible slowdown. +# +# SND_OLDSTEREO Only 2 channels are allowed, effectively +# disabling multichannel processing. +# +options SND_DEBUG +options SND_DIAGNOSTIC +options SND_FEEDER_MULTIFORMAT +options SND_FEEDER_FULL_MULTIFORMAT +options SND_FEEDER_RATE_HP +options SND_PCM_64 +options SND_OLDSTEREO + +# # IEEE-488 hardware: # pcii: PCIIA cards (uPD7210 based isa cards) # tnt4882: National Instruments PCI-GPIB card. From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 05:33:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5720E1065678; Mon, 8 Jun 2009 05:33:09 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44AC28FC0A; Mon, 8 Jun 2009 05:33:09 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n585X9AR017210; Mon, 8 Jun 2009 05:33:09 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n585X9ao017209; Mon, 8 Jun 2009 05:33:09 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906080533.n585X9ao017209@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 8 Jun 2009 05:33: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: r193688 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 05:33:09 -0000 Author: edwin Date: Mon Jun 8 05:33:08 2009 New Revision: 193688 URL: http://svn.freebsd.org/changeset/base/193688 Log: [patch] [locale] German locales use old %d.%m.%y date format instead of newer ISO date From the submitter: DIN 5008 (German norm for text processing) defines the old date format (%d.%m.%Y) to be obsolete and to be used only, if unambigous. In international communications the new format (%Y-%m-%d) is now required and FreeBSD should respect this. References: - DIN 5008 - EN 28 601 - ISO 8601 Thanks to Oliver Lietz for bringing this to my attention. PR: conf/72076 Submitted by: Peter Wullinger MFC after: 1 week Modified: head/share/timedef/de_DE.ISO8859-1.src head/share/timedef/de_DE.UTF-8.src Modified: head/share/timedef/de_DE.ISO8859-1.src ============================================================================== --- head/share/timedef/de_DE.ISO8859-1.src Mon Jun 8 05:11:35 2009 (r193687) +++ head/share/timedef/de_DE.ISO8859-1.src Mon Jun 8 05:33:08 2009 (r193688) @@ -59,7 +59,7 @@ Samstag # # x_fmt # -%d.%m.%Y +%Y-%m-%d # # c_fmt # Modified: head/share/timedef/de_DE.UTF-8.src ============================================================================== --- head/share/timedef/de_DE.UTF-8.src Mon Jun 8 05:11:35 2009 (r193687) +++ head/share/timedef/de_DE.UTF-8.src Mon Jun 8 05:33:08 2009 (r193688) @@ -59,7 +59,7 @@ Samstag # # x_fmt # -%d.%m.%Y +%Y-%m-%d # # c_fmt # From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 08:10:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82EC41065670; Mon, 8 Jun 2009 08:10:52 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 710F48FC12; Mon, 8 Jun 2009 08:10:52 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n588AqDu020533; Mon, 8 Jun 2009 08:10:52 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n588AqXh020531; Mon, 8 Jun 2009 08:10:52 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906080810.n588AqXh020531@svn.freebsd.org> From: Ariff Abdullah Date: Mon, 8 Jun 2009 08:10: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: r193694 - head/sys/dev/sound/macio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 08:10:53 -0000 Author: ariff Date: Mon Jun 8 08:10:52 2009 New Revision: 193694 URL: http://svn.freebsd.org/changeset/base/193694 Log: Fix powerpc build failure due to strict kobj signatures checking. Modified: head/sys/dev/sound/macio/snapper.c head/sys/dev/sound/macio/tumbler.c Modified: head/sys/dev/sound/macio/snapper.c ============================================================================== --- head/sys/dev/sound/macio/snapper.c Mon Jun 8 07:44:28 2009 (r193693) +++ head/sys/dev/sound/macio/snapper.c Mon Jun 8 08:10:52 2009 (r193694) @@ -96,7 +96,7 @@ struct snapper_softc static int snapper_probe(device_t); static int snapper_attach(device_t); static int snapper_init(struct snd_mixer *m); -static void snapper_uninit(struct snd_mixer *m); +static int snapper_uninit(struct snd_mixer *m); static int snapper_reinit(struct snd_mixer *m); static int snapper_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right); @@ -423,10 +423,10 @@ snapper_init(struct snd_mixer *m) return (0); } -static void +static int snapper_uninit(struct snd_mixer *m) { - return; + return (0); } static int Modified: head/sys/dev/sound/macio/tumbler.c ============================================================================== --- head/sys/dev/sound/macio/tumbler.c Mon Jun 8 07:44:28 2009 (r193693) +++ head/sys/dev/sound/macio/tumbler.c Mon Jun 8 08:10:52 2009 (r193694) @@ -96,7 +96,7 @@ struct tumbler_softc static int tumbler_probe(device_t); static int tumbler_attach(device_t); static int tumbler_init(struct snd_mixer *m); -static void tumbler_uninit(struct snd_mixer *m); +static int tumbler_uninit(struct snd_mixer *m); static int tumbler_reinit(struct snd_mixer *m); static int tumbler_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right); @@ -369,10 +369,10 @@ tumbler_init(struct snd_mixer *m) return (0); } -static void +static int tumbler_uninit(struct snd_mixer *m) { - return; + return (0); } static int From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 10:53:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0BD4106566C; Mon, 8 Jun 2009 10:53:18 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFBF28FC0C; Mon, 8 Jun 2009 10:53:18 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58ArIK7027180; Mon, 8 Jun 2009 10:53:18 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58ArILB027179; Mon, 8 Jun 2009 10:53:18 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906081053.n58ArILB027179@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 8 Jun 2009 10:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193702 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 10:53:19 -0000 Author: luigi Date: Mon Jun 8 10:53:18 2009 New Revision: 193702 URL: http://svn.freebsd.org/changeset/base/193702 Log: add a missing format in a printf Detected building with gcc 4.3.3 MFC after: 3 days Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Jun 8 10:43:20 2009 (r193701) +++ head/sbin/ipfw/ipfw2.c Mon Jun 8 10:53:18 2009 (r193702) @@ -508,7 +508,7 @@ print_newports(ipfw_insn_u16 *cmd, int p } sep = " "; for (i = F_LEN((ipfw_insn *)cmd) - 1; i > 0; i--, p += 2) { - printf(sep); + printf("%s", sep); print_port(proto, p[0]); if (p[0] != p[1]) { printf("-"); From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 10:55:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B96A106566C; Mon, 8 Jun 2009 10:55:32 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0CEFC8FC0C; Mon, 8 Jun 2009 10:55:32 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2E3AC.dip.t-dialin.net [217.226.227.172]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 3EEFA844024; Mon, 8 Jun 2009 12:39:00 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 2E75429B5A5; Mon, 8 Jun 2009 12:38:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1244457537; bh=hEfTnDwv25ZyPW65ANUgaJC1xoMdCcUiJ+UNBzKlYgA=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=nWVwBgeLlpRYoJEafMBQCX/86DRY6IIwIMJjkij13/3J5uQ5fcT2zpeNa3Y7wSt6w 14+ExfdA9zvXVZY/F8yIxaMIFfw3oy9QR3PZaeBxM/T+FYV3+ulQEVW7eeT8UrGicZ itB+ofSomF3QbXvO7sBOj+L+kvDVNWBgaKvDNfJfoFjrf2x4xH81UawJu/ItqOLOqv U9PIM0lSKvd1xJcIF4sDfqQu6vOccFSSiyqbAIoO2AGQgmDs/jCoZzwV6a/nzvctIM M38DAB+Pqg0gjaajihVkpWQdWvdRqVCLdMa/K7Yn+4sL9Wp9WiCo649r8xwkupQ6I1 ab/FwPEEempVQ== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id n58Acu13025894; Mon, 8 Jun 2009 12:38:56 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 08 Jun 2009 12:38:56 +0200 Message-ID: <20090608123856.570933oz30orz0w0@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Mon, 08 Jun 2009 12:38:56 +0200 From: Alexander Leidinger To: Edwin Groothuis References: <200906080533.n585X9ao017209@svn.freebsd.org> In-Reply-To: <200906080533.n585X9ao017209@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.3.3 / FreeBSD-8.0 X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 3EEFA844024.4BC2D X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=0.637, required 6, autolearn=disabled, ALL_TRUSTED -1.44, BR_SPAMMER_URI 2.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1245062346.11012@3XJeMDVRHufkqCI1HfO2xg X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, docs@FreeBSD.org Subject: Re: svn commit: r193688 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 10:55:33 -0000 Quoting Edwin Groothuis (from Mon, 8 Jun 2009 05:33:09 +0000 (UTC)): > Author: edwin > Date: Mon Jun 8 05:33:08 2009 > New Revision: 193688 > URL: http://svn.freebsd.org/changeset/base/193688 > > Log: > [patch] [locale] German locales use old %d.%m.%y date format > instead of newer ISO date > > From the submitter: > > DIN 5008 (German norm for text processing) defines the old date > format (%d.%m.%Y) to be obsolete and to be used only, if unambigous. > In international communications the new format (%Y-%m-%d) is now > required and FreeBSD should respect this. What does this mean? Does 'date' with the de_DE locate print out Y-m-d instead of d.m.Y now? This would look strange to me, as this is not used in normal daily communications. The government sends letters with dates in d.m.Y, newspapers have d.m.Y, and the daily news in the TV also display d.m.Y. The text above specifies that this seems to be intended for international communications. When I set de_DE in my locale for my user, this is not international communication, it's more like "I want to see text/dates in my local language/conventions". As the PR is from 2004, and we have 2009 now, I'm not sure if this change is correct. I haven't read the corresponding standards/documents. > PR: conf/72076 > Submitted by: Peter Wullinger > MFC after: 1 week I think you should not MFC this so fast. It may be better to discuss this with our German doc people (docs@ CCed), maybe this needs to be backed out. Bye, Alexander. -- "I don't care how many eyes a man has... as long as it's less than five." -Leela http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 12:15:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3383106566B; Mon, 8 Jun 2009 12:15:39 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A20758FC1C; Mon, 8 Jun 2009 12:15:39 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58CFdCm029050; Mon, 8 Jun 2009 12:15:39 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58CFdOl029049; Mon, 8 Jun 2009 12:15:39 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200906081215.n58CFdOl029049@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 8 Jun 2009 12:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193712 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 12:15:40 -0000 Author: raj Date: Mon Jun 8 12:15:39 2009 New Revision: 193712 URL: http://svn.freebsd.org/changeset/base/193712 Log: Invalidate cache in pmap_remove_all() on ARM. When pages are removed from virtual address space by calling pmap_remove_all() CPU caches were not invalidated, which led to read corruption when another page got mapped at this same virtual address at later time (the CPU was retrieving stale contents). Submitted by: Piotr Ziecik Obtained from: Semihalf Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Mon Jun 8 12:10:42 2009 (r193711) +++ head/sys/arm/arm/pmap.c Mon Jun 8 12:15:39 2009 (r193712) @@ -3124,7 +3124,19 @@ pmap_remove_all(vm_page_t m) if (flush == FALSE && (pv->pv_pmap == curpm || pv->pv_pmap == pmap_kernel())) flush = TRUE; + PMAP_LOCK(pv->pv_pmap); + /* + * Cached contents were written-back in pmap_remove_write(), + * but we still have to invalidate the cache entry to make + * sure stale data are not retrieved when another page will be + * mapped under this virtual address. + */ + if (pmap_is_current(pv->pv_pmap)) { + cpu_dcache_inv_range(pv->pv_va, PAGE_SIZE); + cpu_l2cache_inv_range(pv->pv_va, PAGE_SIZE); + } + l2b = pmap_get_l2_bucket(pv->pv_pmap, pv->pv_va); KASSERT(l2b != NULL, ("No l2 bucket")); ptep = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 12:56:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76A3E10656C5; Mon, 8 Jun 2009 12:56:53 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 2DFDF8FC25; Mon, 8 Jun 2009 12:56:53 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227]) by mx0.deglitch.com (Postfix) with ESMTPSA id 6AD058FC27; Mon, 8 Jun 2009 16:56:51 +0400 (MSD) Date: Mon, 8 Jun 2009 16:56:46 +0400 From: Stanislav Sedov To: Rafal Jaworowski Message-Id: <20090608165646.95bb577e.stas@FreeBSD.org> In-Reply-To: <200906081215.n58CFdOl029049@svn.freebsd.org> References: <200906081215.n58CFdOl029049@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Mon__8_Jun_2009_16_56_46_+0400_63+6TJOT9B58s=SZ" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193712 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 12:56:54 -0000 --Signature=_Mon__8_Jun_2009_16_56_46_+0400_63+6TJOT9B58s=SZ Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, 8 Jun 2009 12:15:39 +0000 (UTC) Rafal Jaworowski mentioned: > Author: raj > Date: Mon Jun 8 12:15:39 2009 > New Revision: 193712 > URL: http://svn.freebsd.org/changeset/base/193712 >=20 > Log: > Invalidate cache in pmap_remove_all() on ARM. > =20 > When pages are removed from virtual address space by calling pmap_remov= e_all() > CPU caches were not invalidated, which led to read corruption when anot= her > page got mapped at this same virtual address at later time (the CPU was > retrieving stale contents). > =20 > Submitted by: Piotr Ziecik > Obtained from: Semihalf >=20 > Modified: > head/sys/arm/arm/pmap.c >=20 > Modified: head/sys/arm/arm/pmap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/arm/arm/pmap.c Mon Jun 8 12:10:42 2009 (r193711) > +++ head/sys/arm/arm/pmap.c Mon Jun 8 12:15:39 2009 (r193712) > @@ -3124,7 +3124,19 @@ pmap_remove_all(vm_page_t m) > if (flush =3D=3D FALSE && (pv->pv_pmap =3D=3D curpm || > pv->pv_pmap =3D=3D pmap_kernel())) > flush =3D TRUE; > + > PMAP_LOCK(pv->pv_pmap); > + /* > + * Cached contents were written-back in pmap_remove_write(), > + * but we still have to invalidate the cache entry to make > + * sure stale data are not retrieved when another page will be > + * mapped under this virtual address. > + */ > + if (pmap_is_current(pv->pv_pmap)) { > + cpu_dcache_inv_range(pv->pv_va, PAGE_SIZE); > + cpu_l2cache_inv_range(pv->pv_va, PAGE_SIZE); > + } > + Hi, Rafal! What about calling the pmap_dcache_wb_range function for each mapping in the cycle instead of calling cpu_XXX_inv_range functions directly? I think something like this would do the trick: % pmap_dcache_wb_range(pv->pv_pmap, pv->pv_va, PAGE_SIZE, FALSE, % (pv->pv_flags & PVF_WRITE) =3D=3D 0) This will also take care of the writeback cache. I don't know if it is rea= lly needed, though. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Mon__8_Jun_2009_16_56_46_+0400_63+6TJOT9B58s=SZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKLQqTAAoJEKN82nOYvCd01lgP+wTnTAivy40PR/53O7dOtThv BOnvAKhJ+mLZbTiCdcBBMvXlSZ7CK6+wjGcvEEb2cSwz1unEhvf7aB9FL+J6zo3z lCF6jKJukA8gQUei2nRr7UfBuqiAiRr6zcQAajKMmQsfBKR4LUZaL55iXBrsR7Tu 33a9pGbAenSiQs+kSt/5dKaTb6zlWCbSx5EznNMQYsYNUl1mY6c4vvYF8UXDQACC WHQQgxQVNWWNzwKOqSQzXyeVZu6hD3CLuxnKeJy6USbfBa+gMIjrgQDdgGsl06W3 oK9NzdqVgTtOReWga/y8/tRzM1nZbQHEXXYSS6Iwd9Uf8Jf8tlHoMUP/1ja8vB5o qkF0tuEkEae5Og4sHuODDnB9TpXxRSUiiBQ+8glRQsGc6gTnuktudhcnqszUHSYn h/aDkx2waGuOgVmpLcvyfQVpU52HEw1ZxbMo0+fR/T9qkeJxRs746qYBGDuTwdER ZGNlr90gbjdv4YJuwSCxBhhK30Az4RPPdNGeIta6Y/tlU7X4M5ShLw6/Sf/QnwCI 2290bPza9V6z3en97g02YVRhnNe2ziILSIr8jxGTeqI97DAuvnQCGCdKpTsoIvHt AG1HsP845CWnNBK6b+8emXZb+NolgcmNkveGJtUICu9tT3cL6g/Zbx+B7fGmo/jO L1E2UiuyM/pv3d5JVXjM =bmU6 -----END PGP SIGNATURE----- --Signature=_Mon__8_Jun_2009_16_56_46_+0400_63+6TJOT9B58s=SZ-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 13:34:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13BF71065670; Mon, 8 Jun 2009 13:34:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 024FD8FC1E; Mon, 8 Jun 2009 13:34:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58DYjtg030727; Mon, 8 Jun 2009 13:34:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58DYjKs030726; Mon, 8 Jun 2009 13:34:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906081334.n58DYjKs030726@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Jun 2009 13:34: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: r193714 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 13:34:46 -0000 Author: kib Date: Mon Jun 8 13:34:45 2009 New Revision: 193714 URL: http://svn.freebsd.org/changeset/base/193714 Log: Do not dereference vp->v_rdev without holding any of dev_mtx or vnode lock. Use code similar to devfs_fp_check(), but inlined to feet other checks performed by ttyhook_register(). Reviewed by: ed Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Jun 8 13:31:27 2009 (r193713) +++ head/sys/kern/tty.c Mon Jun 8 13:34:45 2009 (r193714) @@ -1742,19 +1742,31 @@ ttyhook_register(struct tty **rtp, struc goto done1; } - /* Make sure the vnode is bound to a character device. */ - error = EINVAL; - if (fp->f_type != DTYPE_VNODE || fp->f_vnode->v_type != VCHR || - fp->f_vnode->v_rdev == NULL) + /* + * Make sure the vnode is bound to a character device. + * Unlocked check for the vnode type is ok there, because we + * only shall prevent calling devvn_refthread on the file that + * never has been opened over a character device. + */ + if (fp->f_type != DTYPE_VNODE || fp->f_vnode->v_type != VCHR) { + error = EINVAL; goto done1; - dev = fp->f_vnode->v_rdev; + } /* Make sure it is a TTY. */ - cdp = dev_refthread(dev); - if (cdp == NULL) + cdp = devvn_refthread(fp->f_vnode, &dev); + if (cdp == NULL) { + error = ENXIO; goto done1; - if (cdp != &ttydev_cdevsw) + } + if (dev != fp->f_data) { + error = ENXIO; goto done2; + } + if (cdp != &ttydev_cdevsw) { + error = ENOTTY; + goto done2; + } tp = dev->si_drv1; /* Try to attach the hook to the TTY. */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 14:32:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30BA1065695; Mon, 8 Jun 2009 14:32:29 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A020A8FC1E; Mon, 8 Jun 2009 14:32:29 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58EWTd7032015; Mon, 8 Jun 2009 14:32:29 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58EWTs8032013; Mon, 8 Jun 2009 14:32:29 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906081432.n58EWTs8032013@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 8 Jun 2009 14:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193715 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 14:32:30 -0000 Author: luigi Date: Mon Jun 8 14:32:29 2009 New Revision: 193715 URL: http://svn.freebsd.org/changeset/base/193715 Log: Permit the specification of bandwidth values within "profile" files (bandwidth is mandatory when using a profile, so it makes sense to have everything in one place). Update the manpage accordingly. Submitted by: Marta Carbone Modified: head/sbin/ipfw/dummynet.c head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Mon Jun 8 13:34:45 2009 (r193714) +++ head/sbin/ipfw/dummynet.c Mon Jun 8 14:32:29 2009 (r193715) @@ -452,6 +452,7 @@ ipfw_delete_pipe(int pipe_or_queue, int #define ED_TOK_NAME "name" #define ED_TOK_DELAY "delay" #define ED_TOK_PROB "prob" +#define ED_TOK_BW "bw" #define ED_SEPARATORS " \t\n" #define ED_MIN_SAMPLES_NO 2 @@ -470,6 +471,50 @@ is_valid_number(const char *s) return 1; } +/* + * Take as input a string describing a bandwidth value + * and return the numeric bandwidth value. + * set clocking interface or bandwidth value + */ +void +read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen) +{ + if (*bandwidth != -1) + warn("duplicate token, override bandwidth value!"); + + if (arg[0] >= 'a' && arg[0] <= 'z') { + if (namelen >= IFNAMSIZ) + warn("interface name truncated"); + namelen--; + /* interface name */ + strncpy(if_name, arg, namelen); + if_name[namelen] = '\0'; + *bandwidth = 0; + } else { /* read bandwidth value */ + int bw; + char *end = NULL; + + bw = strtoul(arg, &end, 0); + if (*end == 'K' || *end == 'k') { + end++; + bw *= 1000; + } else if (*end == 'M') { + end++; + bw *= 1000000; + } + if ((*end == 'B' && + _substrcmp2(end, "Bi", "Bit/s") != 0) || + _substrcmp2(end, "by", "bytes") == 0) + bw *= 8; + + if (bw < 0) + errx(EX_DATAERR, "bandwidth too large"); + + *bandwidth = bw; + if_name[0] = '\0'; + } +} + struct point { double prob; double delay; @@ -550,6 +595,8 @@ load_extra_delays(const char *filename, errx(ED_EFMT("too many samples, maximum is %d"), ED_MAX_SAMPLES_NO); do_points = 0; + } else if (!strcasecmp(name, ED_TOK_BW)) { + read_bandwidth(arg, &p->bandwidth, p->if_name, sizeof(p->if_name)); } else if (!strcasecmp(name, ED_TOK_LOSS)) { if (loss != -1.0) errx(ED_EFMT("duplicated token: %s"), name); @@ -645,6 +692,7 @@ ipfw_config_pipe(int ac, char **av) void *par = NULL; memset(&p, 0, sizeof p); + p.bandwidth = -1; av++; ac--; /* Pipe number */ @@ -848,32 +896,7 @@ end_mask: NEED1("bw needs bandwidth or interface\n"); if (co.do_pipe != 1) errx(EX_DATAERR, "bandwidth only valid for pipes"); - /* - * set clocking interface or bandwidth value - */ - if (av[0][0] >= 'a' && av[0][0] <= 'z') { - int l = sizeof(p.if_name)-1; - /* interface name */ - strncpy(p.if_name, av[0], l); - p.if_name[l] = '\0'; - p.bandwidth = 0; - } else { - p.if_name[0] = '\0'; - p.bandwidth = strtoul(av[0], &end, 0); - if (*end == 'K' || *end == 'k') { - end++; - p.bandwidth *= 1000; - } else if (*end == 'M') { - end++; - p.bandwidth *= 1000000; - } - if ((*end == 'B' && - _substrcmp2(end, "Bi", "Bit/s") != 0) || - _substrcmp2(end, "by", "bytes") == 0) - p.bandwidth *= 8; - if (p.bandwidth < 0) - errx(EX_DATAERR, "bandwidth too large"); - } + read_bandwidth(av[0], &p.bandwidth, p.if_name, sizeof(p.if_name)); ac--; av++; break; @@ -919,15 +942,20 @@ end_mask: errx(EX_DATAERR, "pipe_nr must be > 0"); if (p.delay > 10000) errx(EX_DATAERR, "delay must be < 10000"); - if (p.samples_no > 0 && p.bandwidth == 0) - errx(EX_DATAERR, - "profile requires a bandwidth limit"); } else { /* co.do_pipe == 2, queue */ if (p.fs.parent_nr == 0) errx(EX_DATAERR, "pipe must be > 0"); if (p.fs.weight >100) errx(EX_DATAERR, "weight must be <= 100"); } + + /* check for bandwidth value */ + if (p.bandwidth == -1) { + p.bandwidth = 0; + if (p.samples_no > 0) + errx(EX_DATAERR, "profile requires a bandwidth limit"); + } + if (p.fs.flags_fs & DN_QSIZE_IS_BYTES) { size_t len; long limit; Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Jun 8 13:34:45 2009 (r193714) +++ head/sbin/ipfw/ipfw.8 Mon Jun 8 14:32:29 2009 (r193715) @@ -1973,22 +1973,26 @@ that represents its distribution. The empirical curve may have both vertical and horizontal lines. Vertical lines represent constant delay for a range of probabilities. -Horizontal lines correspond to a discontinuty in the delay +Horizontal lines correspond to a discontinuity in the delay distribution: the pipe will use the largest delay for a given probability. .Pp The file format is the following, with whitespace acting as a separator and '#' indicating the beginning a comment: .Bl -tag -width indent -.It Cm samples Ar N -the number of samples used in the internal -representation (2..1024; default 100); +.It Cm name Ar identifier +optional name (listed by "ipfw pipe show") +to identify the delay distribution; +.It Cm bw Ar value +the bandwidth used for the pipe. +If not specified here, it must be present +explicitly as a configuration parameter for the pipe; .It Cm loss-level Ar L -The probability above which packets are lost. +the probability above which packets are lost. (0.0 <= L <= 1.0, default 1.0 i.e. no loss); -.It Cm name Ar identifier -Optional a name (listed by "ipfw pipe show") -to identify the distribution; +.It Cm samples Ar N +the number of samples used in the internal +representation of the curve (2..1024; default 100); .It Cm "delay prob" | "prob delay" One of these two lines is mandatory and defines the format of the following lines with data points. @@ -1997,9 +2001,9 @@ the format of the following lines with d with either delay or probability first, according to the chosen format. The unit for delay is milliseconds. -Data points do not need to be ordered or equal to the number -specified in the "samples" line. -The +Data points do not need to be sorted. +Also, tne number of actual lines can be different +from the value of the "samples" parameter: .Nm utility will sort and interpolate the curve as needed. From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 14:37:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC7C10656CC; Mon, 8 Jun 2009 14:37:48 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 199278FC16; Mon, 8 Jun 2009 14:37:48 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58EblsM032159; Mon, 8 Jun 2009 14:37:47 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58Ebl9X032157; Mon, 8 Jun 2009 14:37:47 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906081437.n58Ebl9X032157@svn.freebsd.org> From: Ariff Abdullah Date: Mon, 8 Jun 2009 14:37: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: r193716 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 14:37:48 -0000 Author: ariff Date: Mon Jun 8 14:37:47 2009 New Revision: 193716 URL: http://svn.freebsd.org/changeset/base/193716 Log: Add another PCI id for Nvidia nForce MCP67, found in several Acer laptops. Modified: head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-nvidia.c Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Mon Jun 8 14:32:29 2009 (r193715) +++ head/sys/dev/ata/ata-pci.h Mon Jun 8 14:37:47 2009 (r193716) @@ -269,6 +269,7 @@ struct ata_pci_controller { #define ATA_NFORCE_MCP67_A9 0x055910de #define ATA_NFORCE_MCP67_AA 0x055A10de #define ATA_NFORCE_MCP67_AB 0x055B10de +#define ATA_NFORCE_MCP67_AC 0x058410de #define ATA_NFORCE_MCP67 0x056010de #define ATA_NFORCE_MCP73 0x056c10de #define ATA_NFORCE_MCP73_A0 0x07f010de Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Mon Jun 8 14:32:29 2009 (r193715) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Mon Jun 8 14:37:47 2009 (r193716) @@ -110,6 +110,7 @@ ata_nvidia_probe(device_t dev) { ATA_NFORCE_MCP67_A9, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, { ATA_NFORCE_MCP67_AA, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, { ATA_NFORCE_MCP67_AB, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_AC, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, { ATA_NFORCE_MCP73, 0, 0, 0, ATA_UDMA6, "nForce MCP73" }, { ATA_NFORCE_MCP73_A0, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, { ATA_NFORCE_MCP73_A1, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 14:43:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 320E61065670; Mon, 8 Jun 2009 14:43:56 +0000 (UTC) Date: Mon, 8 Jun 2009 14:43:56 +0000 From: Alexey Dokuchaev To: Luigi Rizzo Message-ID: <20090608144355.GA3555@FreeBSD.org> References: <200906081432.n58EWTs8032013@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200906081432.n58EWTs8032013@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193715 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 14:43:56 -0000 Luigi Rizzo wrote: > Author: luigi > Date: Mon Jun 8 14:32:29 2009 > New Revision: 193715 > URL: http://svn.freebsd.org/changeset/base/193715 > > Log: > Permit the specification of bandwidth values within > "profile" files (bandwidth is mandatory when using a > profile, so it makes sense to have everything in one place). > > Update the manpage accordingly. > > +/* > + * Take as input a string describing a bandwidth value > + * and return the numeric bandwidth value. > + * set clocking interface or bandwidth value > + */ > +void > +read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen) > +{ > + if (*bandwidth != -1) > + warn("duplicate token, override bandwidth value!"); > + > + if (arg[0] >= 'a' && arg[0] <= 'z') { > + if (namelen >= IFNAMSIZ) > + warn("interface name truncated"); > + namelen--; > + /* interface name */ > + strncpy(if_name, arg, namelen); > + if_name[namelen] = '\0'; > + *bandwidth = 0; > + } else { /* read bandwidth value */ > + int bw; > + char *end = NULL; > + > + bw = strtoul(arg, &end, 0); > + if (*end == 'K' || *end == 'k') { > + end++; > + bw *= 1000; > + } else if (*end == 'M') { > + end++; > + bw *= 1000000; > + } Couldn't expand_number(3) be used for that? ./danfe From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 15:02:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 385E81065748; Mon, 8 Jun 2009 15:02:31 +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 1BEFC8FC0A; Mon, 8 Jun 2009 15:02:31 +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 n58F2VnY032755; Mon, 8 Jun 2009 15:02:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58F2UVk032754; Mon, 8 Jun 2009 15:02:30 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906081502.n58F2UVk032754@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 8 Jun 2009 15:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193718 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 15:02:32 -0000 Author: bz Date: Mon Jun 8 15:02:30 2009 New Revision: 193718 URL: http://svn.freebsd.org/changeset/base/193718 Log: Update vimage size guard values but do not yet re-enable them. Now that rt_tables does no longer change depending on kernel option we do no longer need any special values for LINT. The updated values will be used to make sure that an upcoming opt_route.h cleanup will not again show any side effects. Modified: head/sys/sys/vimage.h Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Mon Jun 8 14:52:17 2009 (r193717) +++ head/sys/sys/vimage.h Mon Jun 8 15:02:30 2009 (r193718) @@ -358,60 +358,48 @@ extern struct vprocg_list_head vprocg_he * See description further down to see how to get the new values. */ #ifdef __amd64__ -#define SIZEOF_vnet_net 464 -#define SIZEOF_vnet_net_LINT 5144 -#define SIZEOF_vnet_inet 4352 -#define SIZEOF_vnet_inet6 8800 +#define SIZEOF_vnet_net 176 +#define SIZEOF_vnet_inet 4424 +#define SIZEOF_vnet_inet6 8808 #define SIZEOF_vnet_ipsec 31160 #endif #ifdef __arm__ -#define SIZEOF_vnet_net 236 -#define SIZEOF_vnet_net_LINT 1 /* No LINT kernel yet. */ -#define SIZEOF_vnet_inet 2580 -#define SIZEOF_vnet_inet6 8536 +#define SIZEOF_vnet_net 96 +#define SIZEOF_vnet_inet 2616 +#define SIZEOF_vnet_inet6 8524 #define SIZEOF_vnet_ipsec 1 #endif #ifdef __i386__ /* incl. pc98 */ -#define SIZEOF_vnet_net 236 -#define SIZEOF_vnet_net_LINT 2576 -#define SIZEOF_vnet_inet 2576 -#define SIZEOF_vnet_inet6 8528 -#define SIZEOF_vnet_ipsec 31016 +#define SIZEOF_vnet_net 96 +#define SIZEOF_vnet_inet 2612 +#define SIZEOF_vnet_inet6 8512 +#define SIZEOF_vnet_ipsec 31024 #endif #ifdef __ia64__ -#define SIZEOF_vnet_net 464 -#define SIZEOF_vnet_net_LINT 5144 -#define SIZEOF_vnet_inet 4352 -#define SIZEOF_vnet_inet6 8800 +#define SIZEOF_vnet_net 176 +#define SIZEOF_vnet_inet 4424 +#define SIZEOF_vnet_inet6 8808 #define SIZEOF_vnet_ipsec 31160 #endif #ifdef __mips__ -#define SIZEOF_vnet_net 236 -#define SIZEOF_vnet_net_LINT 1 /* No LINT kernel yet. */ -#define SIZEOF_vnet_inet 2624 -#define SIZEOF_vnet_inet6 8552 +#define SIZEOF_vnet_net 96 +#define SIZEOF_vnet_inet 2648 +#define SIZEOF_vnet_inet6 8544 #define SIZEOF_vnet_ipsec 1 #endif #ifdef __powerpc__ -#define SIZEOF_vnet_net 236 -#define SIZEOF_vnet_net_LINT 2576 -#define SIZEOF_vnet_inet 2616 -#define SIZEOF_vnet_inet6 8536 +#define SIZEOF_vnet_net 96 +#define SIZEOF_vnet_inet 2640 +#define SIZEOF_vnet_inet6 8520 #define SIZEOF_vnet_ipsec 31048 #endif #ifdef __sparc64__ /* incl. sun4v */ -#define SIZEOF_vnet_net 464 -#define SIZEOF_vnet_net_LINT 5144 -#define SIZEOF_vnet_inet 4352 -#define SIZEOF_vnet_inet6 8800 +#define SIZEOF_vnet_net 176 +#define SIZEOF_vnet_inet 4424 +#define SIZEOF_vnet_inet6 8808 #define SIZEOF_vnet_ipsec 31160 #endif -#ifdef COMPILING_LINT -#undef SIZEOF_vnet_net -#define SIZEOF_vnet_net SIZEOF_vnet_net_LINT -#endif - #ifndef SIZEOF_vnet_net #error "SIZEOF_vnet_net no defined for this architecture." #endif From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 15:07:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34416106564A; Mon, 8 Jun 2009 15:07:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 222078FC08; Mon, 8 Jun 2009 15:07:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58F7abJ032964; Mon, 8 Jun 2009 15:07:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58F7a60032963; Mon, 8 Jun 2009 15:07:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906081507.n58F7a60032963@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Jun 2009 15:07: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: r193719 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 15:07:36 -0000 Author: jhb Date: Mon Jun 8 15:07:35 2009 New Revision: 193719 URL: http://svn.freebsd.org/changeset/base/193719 Log: Don't attempt to free the GPT partition list for a disk with an empty GPT. Submitted by: Yuri Pankov yuri.pankov of gmail MFC after: 3 days Modified: head/sys/boot/i386/libi386/biosdisk.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Mon Jun 8 15:02:30 2009 (r193718) +++ head/sys/boot/i386/libi386/biosdisk.c Mon Jun 8 15:07:35 2009 (r193719) @@ -990,7 +990,8 @@ bd_open_gpt(struct open_disk *od, struct out: if (error) { - free(od->od_partitions); + if (od->od_nparts > 0) + free(od->od_partitions); od->od_flags &= ~BD_GPTOK; } return (error); @@ -1044,7 +1045,7 @@ bd_closedisk(struct open_disk *od) delay(3000000); #endif #ifdef LOADER_GPT_SUPPORT - if (od->od_flags & BD_GPTOK) + if (od->od_flags & BD_GPTOK && od->od_nparts > 0) free(od->od_partitions); #endif free(od); From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 15:09:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33587106566B; Mon, 8 Jun 2009 15:09:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 070278FC13; Mon, 8 Jun 2009 15:09:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58F9MEJ033039; Mon, 8 Jun 2009 15:09:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58F9Mxx033038; Mon, 8 Jun 2009 15:09:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906081509.n58F9Mxx033038@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Jun 2009 15:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193720 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 15:09:23 -0000 Author: jhb Date: Mon Jun 8 15:09:22 2009 New Revision: 193720 URL: http://svn.freebsd.org/changeset/base/193720 Log: Instead of packing the individual fields in the PnP structures, pack the entire structures. This trims some warnings. Verified by: md5(1) MFC after: 1 week Modified: head/sys/boot/i386/libi386/biospnp.c Modified: head/sys/boot/i386/libi386/biospnp.c ============================================================================== --- head/sys/boot/i386/libi386/biospnp.c Mon Jun 8 15:07:35 2009 (r193719) +++ head/sys/boot/i386/libi386/biospnp.c Mon Jun 8 15:09:22 2009 (r193720) @@ -49,38 +49,38 @@ struct pnphandler biospnphandler = struct pnp_ICstructure { - u_int8_t pnp_signature[4] __packed; - u_int8_t pnp_version __packed; - u_int8_t pnp_length __packed; - u_int16_t pnp_BIOScontrol __packed; - u_int8_t pnp_checksum __packed; - u_int32_t pnp_eventflag __packed; - u_int16_t pnp_rmip __packed; - u_int16_t pnp_rmcs __packed; - u_int16_t pnp_pmip __packed; - u_int32_t pnp_pmcs __packed; - u_int8_t pnp_OEMdev[4] __packed; - u_int16_t pnp_rmds __packed; - u_int32_t pnp_pmds __packed; -}; + u_int8_t pnp_signature[4]; + u_int8_t pnp_version; + u_int8_t pnp_length; + u_int16_t pnp_BIOScontrol; + u_int8_t pnp_checksum; + u_int32_t pnp_eventflag; + u_int16_t pnp_rmip; + u_int16_t pnp_rmcs; + u_int16_t pnp_pmip; + u_int32_t pnp_pmcs; + u_int8_t pnp_OEMdev[4]; + u_int16_t pnp_rmds; + u_int32_t pnp_pmds; +} __packed; struct pnp_devNode { - u_int16_t dn_size __packed; - u_int8_t dn_handle __packed; - u_int8_t dn_id[4] __packed; - u_int8_t dn_type[3] __packed; - u_int16_t dn_attrib __packed; - u_int8_t dn_data[1] __packed; -}; + u_int16_t dn_size; + u_int8_t dn_handle; + u_int8_t dn_id[4]; + u_int8_t dn_type[3]; + u_int16_t dn_attrib; + u_int8_t dn_data[1]; +} __packed; struct pnp_isaConfiguration { - u_int8_t ic_revision __packed; - u_int8_t ic_nCSN __packed; - u_int16_t ic_rdport __packed; - u_int16_t ic_reserved __packed; -}; + u_int8_t ic_revision; + u_int8_t ic_nCSN; + u_int16_t ic_rdport; + u_int16_t ic_reserved; +} __packed; static struct pnp_ICstructure *pnp_Icheck = NULL; static u_int16_t pnp_NumNodes; From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 15:13:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81308106567A; Mon, 8 Jun 2009 15:13:20 +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 6F0F68FC1D; Mon, 8 Jun 2009 15:13:20 +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 n58FDKoK033171; Mon, 8 Jun 2009 15:13:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58FDK7K033170; Mon, 8 Jun 2009 15:13:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906081513.n58FDK7K033170@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 8 Jun 2009 15:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193721 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 15:13:21 -0000 Author: bz Date: Mon Jun 8 15:13:20 2009 New Revision: 193721 URL: http://svn.freebsd.org/changeset/base/193721 Log: Code using COMPAT_ROUTE_FLAGS option, introduced with r187094, was changed again in r187328, removing any use of the option from the kernel. The option was never in NOTES. Garbage collect. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jun 8 15:09:22 2009 (r193720) +++ head/sys/conf/options Mon Jun 8 15:13:20 2009 (r193721) @@ -415,7 +415,6 @@ NETATALK opt_atalk.h NFSLOCKD 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 From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 15:26:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69523106566B; Mon, 8 Jun 2009 15:26:10 +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 13FDE8FC0C; Mon, 8 Jun 2009 15:26:10 +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 n58FQ9xB033574; Mon, 8 Jun 2009 15:26:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58FQ9F8033573; Mon, 8 Jun 2009 15:26:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906081526.n58FQ9F8033573@svn.freebsd.org> From: Robert Watson Date: Mon, 8 Jun 2009 15:26: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: r193723 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 15:26:11 -0000 Author: rwatson Date: Mon Jun 8 15:26:09 2009 New Revision: 193723 URL: http://svn.freebsd.org/changeset/base/193723 Log: Move zombie-reaping code out of kern_wait() and into its own function, proc_reap(). Reviewed by: jhb MFC after: 3 days Sponsored by: Google, Inc. Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Jun 8 15:17:36 2009 (r193722) +++ head/sys/kern/kern_exit.c Mon Jun 8 15:26:09 2009 (r193723) @@ -682,11 +682,130 @@ wait4(struct thread *td, struct wait_arg return (error); } +/* + * Reap the remains of a zombie process and optionally return status and + * rusage. Asserts and will release both the proctree_lock and the process + * lock as part of its work. + */ +static void +proc_reap(struct thread *td, struct proc *p, int *status, int options, + struct rusage *rusage) +{ + INIT_VPROCG(P_TO_VPROCG(p)); + struct proc *q, *t; + + sx_assert(&proctree_lock, SA_XLOCKED); + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); + KASSERT(p->p_state == PRS_ZOMBIE, ("proc_reap: !PRS_ZOMBIE")); + + q = td->td_proc; + if (rusage) { + *rusage = p->p_ru; + calcru(p, &rusage->ru_utime, &rusage->ru_stime); + } + PROC_SUNLOCK(p); + td->td_retval[0] = p->p_pid; + if (status) + *status = p->p_xstat; /* convert to int */ + if (options & WNOWAIT) { + /* + * Only poll, returning the status. Caller does not wish to + * release the proc struct just yet. + */ + PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); + return; + } + + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); + PROC_UNLOCK(p); + + /* + * If we got the child via a ptrace 'attach', we need to give it back + * to the old parent. + */ + if (p->p_oppid && (t = pfind(p->p_oppid)) != NULL) { + PROC_LOCK(p); + p->p_oppid = 0; + proc_reparent(p, t); + PROC_UNLOCK(p); + tdsignal(t, NULL, SIGCHLD, p->p_ksi); + wakeup(t); + cv_broadcast(&p->p_pwait); + PROC_UNLOCK(t); + sx_xunlock(&proctree_lock); + return; + } + + /* + * Remove other references to this process to ensure we have an + * exclusive reference. + */ + sx_xlock(&allproc_lock); + LIST_REMOVE(p, p_list); /* off zombproc */ + sx_xunlock(&allproc_lock); + LIST_REMOVE(p, p_sibling); + leavepgrp(p); + sx_xunlock(&proctree_lock); + + /* + * As a side effect of this lock, we know that all other writes to + * this proc are visible now, so no more locking is needed for p. + */ + PROC_LOCK(p); + p->p_xstat = 0; /* XXX: why? */ + PROC_UNLOCK(p); + PROC_LOCK(q); + ruadd(&q->p_stats->p_cru, &q->p_crux, &p->p_ru, &p->p_rux); + PROC_UNLOCK(q); + + /* + * Decrement the count of procs running with this uid. + */ + (void)chgproccnt(p->p_ucred->cr_ruidinfo, -1, 0); + + /* + * Free credentials, arguments, and sigacts. + */ + crfree(p->p_ucred); + p->p_ucred = NULL; + pargs_drop(p->p_args); + p->p_args = NULL; + sigacts_free(p->p_sigacts); + p->p_sigacts = NULL; + + /* + * Do any thread-system specific cleanups. + */ + thread_wait(p); + + /* + * Give vm and machine-dependent layer a chance to free anything that + * cpu_exit couldn't release while still running in process context. + */ + vm_waitproc(p); +#ifdef MAC + mac_proc_destroy(p); +#endif + KASSERT(FIRST_THREAD_IN_PROC(p), + ("proc_reap: no residual thread!")); + uma_zfree(proc_zone, p); + sx_xlock(&allproc_lock); + nprocs--; +#ifdef VIMAGE + vprocg->nprocs--; +#endif + sx_xunlock(&allproc_lock); +} + int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rusage) { - struct proc *p, *q, *t; + struct proc *p, *q; int error, nfound; AUDIT_ARG(pid, pid); @@ -736,111 +855,7 @@ loop: nfound++; PROC_SLOCK(p); if (p->p_state == PRS_ZOMBIE) { - INIT_VPROCG(P_TO_VPROCG(p)); - if (rusage) { - *rusage = p->p_ru; - calcru(p, &rusage->ru_utime, &rusage->ru_stime); - } - PROC_SUNLOCK(p); - td->td_retval[0] = p->p_pid; - if (status) - *status = p->p_xstat; /* convert to int */ - if (options & WNOWAIT) { - - /* - * Only poll, returning the status. - * Caller does not wish to release the proc - * struct just yet. - */ - PROC_UNLOCK(p); - sx_xunlock(&proctree_lock); - return (0); - } - - PROC_LOCK(q); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(q); - PROC_UNLOCK(p); - - /* - * If we got the child via a ptrace 'attach', - * we need to give it back to the old parent. - */ - if (p->p_oppid && (t = pfind(p->p_oppid)) != NULL) { - PROC_LOCK(p); - p->p_oppid = 0; - proc_reparent(p, t); - PROC_UNLOCK(p); - tdsignal(t, NULL, SIGCHLD, p->p_ksi); - wakeup(t); - cv_broadcast(&p->p_pwait); - PROC_UNLOCK(t); - sx_xunlock(&proctree_lock); - return (0); - } - - /* - * Remove other references to this process to ensure - * we have an exclusive reference. - */ - sx_xlock(&allproc_lock); - LIST_REMOVE(p, p_list); /* off zombproc */ - sx_xunlock(&allproc_lock); - LIST_REMOVE(p, p_sibling); - leavepgrp(p); - sx_xunlock(&proctree_lock); - - /* - * As a side effect of this lock, we know that - * all other writes to this proc are visible now, so - * no more locking is needed for p. - */ - PROC_LOCK(p); - p->p_xstat = 0; /* XXX: why? */ - PROC_UNLOCK(p); - PROC_LOCK(q); - ruadd(&q->p_stats->p_cru, &q->p_crux, &p->p_ru, - &p->p_rux); - PROC_UNLOCK(q); - - /* - * Decrement the count of procs running with this uid. - */ - (void)chgproccnt(p->p_ucred->cr_ruidinfo, -1, 0); - - /* - * Free credentials, arguments, and sigacts. - */ - crfree(p->p_ucred); - p->p_ucred = NULL; - pargs_drop(p->p_args); - p->p_args = NULL; - sigacts_free(p->p_sigacts); - p->p_sigacts = NULL; - - /* - * Do any thread-system specific cleanups. - */ - thread_wait(p); - - /* - * Give vm and machine-dependent layer a chance - * to free anything that cpu_exit couldn't - * release while still running in process context. - */ - vm_waitproc(p); -#ifdef MAC - mac_proc_destroy(p); -#endif - KASSERT(FIRST_THREAD_IN_PROC(p), - ("kern_wait: no residual thread!")); - uma_zfree(proc_zone, p); - sx_xlock(&allproc_lock); - nprocs--; -#ifdef VIMAGE - vprocg->nprocs--; -#endif - sx_xunlock(&allproc_lock); + proc_reap(td, p, status, options, rusage); return (0); } if ((p->p_flag & P_STOPPED_SIG) && From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 15:33:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E31AA1065674; Mon, 8 Jun 2009 15:33:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B22698FC17; Mon, 8 Jun 2009 15:33:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4FA9846B3B; Mon, 8 Jun 2009 11:33:47 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 175CF8A069; Mon, 8 Jun 2009 11:33:46 -0400 (EDT) From: John Baldwin To: Jaakko Heinonen Date: Mon, 8 Jun 2009 10:17:53 -0400 User-Agent: KMail/1.9.7 References: <200906041618.n54GI851097005@svn.freebsd.org> <20090606090141.GA805@a91-153-125-115.elisa-laajakaista.fi> In-Reply-To: <20090606090141.GA805@a91-153-125-115.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906081017.54171.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 08 Jun 2009 11:33:46 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Paul Saab Subject: Re: svn commit: r193440 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 15:33:48 -0000 On Saturday 06 June 2009 5:01:41 am Jaakko Heinonen wrote: > > Hi, > > On 2009-06-04, Paul Saab wrote: > > Support shared vnode locks for write operations when the offset is > > provided on filesystems that support it. This really improves mysql > > + innodb performance on ZFS. > > The panic below looks related to this commit. I think the assert is only > enabled when DEBUG_VFS_LOCKS is defined. Yes, vnode_if.src needs to be changed: %% write vp E E E %! write pre VOP_WRITE_PRE %! write post VOP_WRITE_POST vop_write { IN struct vnode *vp; INOUT struct uio *uio; IN int ioflag; IN struct ucred *cred; }; The 'E E E' should be 'L L L'. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 15:54:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A73DB106564A; Mon, 8 Jun 2009 15:54:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 953B98FC20; Mon, 8 Jun 2009 15:54:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58Fs7Yl034346; Mon, 8 Jun 2009 15:54:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58Fs79X034345; Mon, 8 Jun 2009 15:54:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906081554.n58Fs79X034345@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Jun 2009 15:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193728 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 15:54:08 -0000 Author: jhb Date: Mon Jun 8 15:54:07 2009 New Revision: 193728 URL: http://svn.freebsd.org/changeset/base/193728 Log: Change the printf format string to match the variable type to quiet warnings. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Jun 8 15:38:03 2009 (r193727) +++ head/sbin/geom/class/part/geom_part.c Mon Jun 8 15:54:07 2009 (r193728) @@ -342,13 +342,13 @@ gpart_autofill(struct gctl_req *req) return (ENOSPC); if (!has_size) { - asprintf(&val, "%jd", size); + asprintf(&val, "%llu", size); if (val == NULL) return (ENOMEM); gctl_change_param(req, "size", -1, val); } if (!has_start) { - asprintf(&val, "%jd", start); + asprintf(&val, "%llu", start); if (val == NULL) return (ENOMEM); gctl_change_param(req, "start", -1, val); From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 16:13:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D479D1065670; Mon, 8 Jun 2009 16:13:24 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 77A9A8FC16; Mon, 8 Jun 2009 16:13:24 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from [10.0.0.34] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id C4F61C3AB7; Mon, 8 Jun 2009 17:54:57 +0200 (CEST) Message-Id: <9CB8E78B-BED8-4995-9823-5CEE75A4F52F@semihalf.com> From: Rafal Jaworowski To: Stanislav Sedov In-Reply-To: <20090608165646.95bb577e.stas@FreeBSD.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 8 Jun 2009 17:56:51 +0200 References: <200906081215.n58CFdOl029049@svn.freebsd.org> <20090608165646.95bb577e.stas@FreeBSD.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?ISO-8859-2?Q?Piotr_Zi=EAcik?= Subject: Re: svn commit: r193712 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 16:13:25 -0000 On 2009-06-08, at 14:56, Stanislav Sedov wrote: > On Mon, 8 Jun 2009 12:15:39 +0000 (UTC) > Rafal Jaworowski mentioned: > >> Author: raj >> Date: Mon Jun 8 12:15:39 2009 >> New Revision: 193712 >> URL: http://svn.freebsd.org/changeset/base/193712 >> >> Log: >> Invalidate cache in pmap_remove_all() on ARM. >> >> When pages are removed from virtual address space by calling >> pmap_remove_all() >> CPU caches were not invalidated, which led to read corruption when >> another >> page got mapped at this same virtual address at later time (the >> CPU was >> retrieving stale contents). >> >> Submitted by: Piotr Ziecik >> Obtained from: Semihalf >> >> Modified: >> head/sys/arm/arm/pmap.c >> >> Modified: head/sys/arm/arm/pmap.c >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sys/arm/arm/pmap.c Mon Jun 8 12:10:42 2009 (r193711) >> +++ head/sys/arm/arm/pmap.c Mon Jun 8 12:15:39 2009 (r193712) >> @@ -3124,7 +3124,19 @@ pmap_remove_all(vm_page_t m) >> if (flush == FALSE && (pv->pv_pmap == curpm || >> pv->pv_pmap == pmap_kernel())) >> flush = TRUE; >> + >> PMAP_LOCK(pv->pv_pmap); >> + /* >> + * Cached contents were written-back in pmap_remove_write(), >> + * but we still have to invalidate the cache entry to make >> + * sure stale data are not retrieved when another page will be >> + * mapped under this virtual address. >> + */ >> + if (pmap_is_current(pv->pv_pmap)) { >> + cpu_dcache_inv_range(pv->pv_va, PAGE_SIZE); >> + cpu_l2cache_inv_range(pv->pv_va, PAGE_SIZE); >> + } >> + > > Hi, Rafal! > > What about calling the pmap_dcache_wb_range function for each > mapping in > the cycle instead of calling cpu_XXX_inv_range functions directly? > I think > something like this would do the trick: > % pmap_dcache_wb_range(pv->pv_pmap, pv->pv_va, PAGE_SIZE, FALSE, > % (pv->pv_flags & PVF_WRITE) == 0) > > This will also take care of the writeback cache. I don't know if it > is really > needed, though. Do you see anything wrong with calling cpu_xxx_inv_range directly? Writing back (if required) was already performed by pmap_remove_write(), and what we only need at this point is invalidation. pmap_dcache_wb_range would also eventually call cpu_XXX_inv_range if given a proper combination of flags (BTW: the do_inv flag in your example should be TRUE for our context to work), so it wouldn't be any simpler. I'd rather prefer doing explicitly what is needed without extra wrapping. Rafal From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 16:20:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76A14106566B; Mon, 8 Jun 2009 16:20:19 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 2BD908FC17; Mon, 8 Jun 2009 16:20:19 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227]) by mx0.deglitch.com (Postfix) with ESMTPSA id EEF698FC2E; Mon, 8 Jun 2009 20:20:16 +0400 (MSD) Date: Mon, 8 Jun 2009 20:20:11 +0400 From: Stanislav Sedov To: Rafal Jaworowski Message-Id: <20090608202011.d3230356.stas@FreeBSD.org> In-Reply-To: <9CB8E78B-BED8-4995-9823-5CEE75A4F52F@semihalf.com> References: <200906081215.n58CFdOl029049@svn.freebsd.org> <20090608165646.95bb577e.stas@FreeBSD.org> <9CB8E78B-BED8-4995-9823-5CEE75A4F52F@semihalf.com> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Mon__8_Jun_2009_20_20_11_+0400_4UBYF.vq=ykwyqxC" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Piotr =?UTF-8?Q?Zi=C4=99cik?= Subject: Re: svn commit: r193712 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 16:20:19 -0000 --Signature=_Mon__8_Jun_2009_20_20_11_+0400_4UBYF.vq=ykwyqxC Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, 8 Jun 2009 17:56:51 +0200 Rafal Jaworowski mentioned: >=20 > Do you see anything wrong with calling cpu_xxx_inv_range directly? =20 > Writing back (if required) was already performed by =20 > pmap_remove_write(), and what we only need at this point is =20 > invalidation. pmap_dcache_wb_range would also eventually call =20 > cpu_XXX_inv_range if given a proper combination of flags (BTW: the =20 > do_inv flag in your example should be TRUE for our context to work), =20 > so it wouldn't be any simpler. I'd rather prefer doing explicitly what =20 > is needed without extra wrapping. >=20 I don't see anything particulary wrong with your approach. On the other hand, using pmap_dcache_wb_range will help to reduce the code duplication, so if one day we'll think that something else is needed to properly invalidate the PTE range, we'll be able to modify the pmap_dcache_wb_range accordingly without looking for other parts of code that does the same. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Mon__8_Jun_2009_20_20_11_+0400_4UBYF.vq=ykwyqxC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKLTo/AAoJEKN82nOYvCd0RB4P/j7Wi18Fnnu90XyQvmKvnOyc G2G8Fb7qfWGJFJxdGBZRThOi8+yM8mEHEUlXMIITjY4Ff1aLHc6xiPD6SZTcawtT fd4juAdWJC6pc/kRtrSQh3v/Tb/VernZCyNjq4SViQ16x4vRMhLpQt7eOpze1IZz gpD6zMpjB0HKaj0TSuyLbm2ybQiTOR7yaQmbd00N7FUt8YteCDn8eNHjEvnKht3H EYclCxKxSG5VUFPdbL+2lUidjUGd8g4VL2/Ja/L2CU/L5sfar+Xk+qB/1HN1J4lT H9MThWXnu0ymEvlyROPX7KuqFjjN0ZgNYRG/KBeMMdymj2pbeGK15Ljdp7HbdpaY lS7mI8iNj/Ot7WReAqyPMXjIZf1WWVytH0QVZTdRzg29Drs3uo2DwM6fA9HCvndD tOjL2lYQEktaWxzdA2sr8R1r4or5KDWDNuDl6uNxmFnXVY2MvCkmzRjUg0xG/jTQ UN/8WnZOruiOjVyvfadVKpQSd+UMXpfDVa3l2+EC/kxp9SruvLRjR6zUhzpELno4 F/VemM39anSn1uB7pDXyPKCn0ADWLxb8tVKD30W3fbPV1Eq/T5KheSkY7PKrcLpv UhXVRqmISpWObqnE5cIjEKsWgdxnfmieU3M6s94xbHm4Pr5n94Ms03qWEPPkxsnj zQzYwHK6cB0MCstcAEPd =0k2S -----END PGP SIGNATURE----- --Signature=_Mon__8_Jun_2009_20_20_11_+0400_4UBYF.vq=ykwyqxC-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 16:29:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF2821065670; Mon, 8 Jun 2009 16:29:42 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout015.mac.com (asmtpout015.mac.com [17.148.16.90]) by mx1.freebsd.org (Postfix) with ESMTP id B78628FC1B; Mon, 8 Jun 2009 16:29:42 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp015.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KKX00K9HHTEXO80@asmtp015.mac.com>; Mon, 08 Jun 2009 09:29:42 -0700 (PDT) Message-id: From: Marcel Moolenaar To: John Baldwin In-reply-to: <200906081554.n58Fs79X034345@svn.freebsd.org> Date: Mon, 08 Jun 2009 09:29:38 -0700 References: <200906081554.n58Fs79X034345@svn.freebsd.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193728 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 16:29:43 -0000 On Jun 8, 2009, at 8:54 AM, John Baldwin wrote: > Author: jhb > Date: Mon Jun 8 15:54:07 2009 > New Revision: 193728 > URL: http://svn.freebsd.org/changeset/base/193728 > > Log: > Change the printf format string to match the variable type to quiet > warnings. Oops.. Thanks John! -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 16:43:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF2E1065672; Mon, 8 Jun 2009 16:43:41 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18E108FC27; Mon, 8 Jun 2009 16:43:41 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58GheKe035415; Mon, 8 Jun 2009 16:43:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58Gheuv035414; Mon, 8 Jun 2009 16:43:40 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906081643.n58Gheuv035414@svn.freebsd.org> From: Alan Cox Date: Mon, 8 Jun 2009 16:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193729 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 16:43:41 -0000 Author: alc Date: Mon Jun 8 16:43:40 2009 New Revision: 193729 URL: http://svn.freebsd.org/changeset/base/193729 Log: Now that amd64's kernel map is 512GB (SVN rev 192216), there is no reason to cap its buffer map at 1GB. MFC after: 6 weeks Modified: head/sys/amd64/include/param.h Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Mon Jun 8 15:54:07 2009 (r193728) +++ head/sys/amd64/include/param.h Mon Jun 8 16:43:40 2009 (r193729) @@ -137,15 +137,6 @@ #endif /* - * Ceiling on size of buffer cache (really only effects write queueing, - * the VM page cache is not effected), can be changed via - * the kern.maxbcache /boot/loader.conf variable. - */ -#ifndef VM_BCACHE_SIZE_MAX -#define VM_BCACHE_SIZE_MAX (1024 * 1024 * 1024) -#endif - -/* * Mach derived conversion macros */ #define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK)) From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 17:11:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C27D8106566B; Mon, 8 Jun 2009 17:11: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 7950D8FC16; Mon, 8 Jun 2009 17:11: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 n58HBlbM036210; Mon, 8 Jun 2009 17:11:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58HBlmt036209; Mon, 8 Jun 2009 17:11:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906081711.n58HBlmt036209@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 8 Jun 2009 17:11: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: r193730 - head/sys/contrib/dev/acpica/include/platform X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 17:11:48 -0000 Author: jkim Date: Mon Jun 8 17:11:47 2009 New Revision: 193730 URL: http://svn.freebsd.org/changeset/base/193730 Log: Clean up FreeBSD-specific header file: - Define ACPI_USE_DO_WHILE_0 to add do while(0) around return_*() macros. - Define __cdecl only for user land. It will never be used in kernel. - Remove __cli() and __sti(). They were deprecated long ago. Modified: head/sys/contrib/dev/acpica/include/platform/acfreebsd.h Modified: head/sys/contrib/dev/acpica/include/platform/acfreebsd.h ============================================================================== --- head/sys/contrib/dev/acpica/include/platform/acfreebsd.h Mon Jun 8 16:43:40 2009 (r193729) +++ head/sys/contrib/dev/acpica/include/platform/acfreebsd.h Mon Jun 8 17:11:47 2009 (r193730) @@ -125,11 +125,10 @@ #define ACPI_UINTPTR_T uintptr_t +#define ACPI_USE_DO_WHILE_0 #define ACPI_USE_LOCAL_CACHE #define ACPI_USE_SYSTEM_CLIBRARY -#define __cdecl - #ifdef _KERNEL #include @@ -168,12 +167,10 @@ #define ACPI_THREAD_ID pthread_t -/* Not building kernel code, so use libc */ #define ACPI_USE_STANDARD_HEADERS -#define ACPI_FLUSH_CPU_CACHE() -#define __cli() -#define __sti() +#define ACPI_FLUSH_CPU_CACHE() +#define __cdecl #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 17:15:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E61991065670; Mon, 8 Jun 2009 17:15:41 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1D798FC18; Mon, 8 Jun 2009 17:15:41 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58HFfgd036352; Mon, 8 Jun 2009 17:15:41 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58HFeDZ036321; Mon, 8 Jun 2009 17:15:40 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906081715.n58HFeDZ036321@svn.freebsd.org> From: Marko Zec Date: Mon, 8 Jun 2009 17:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193731 - in head: . sys/kern sys/net sys/netgraph sys/netinet sys/netinet6 sys/netipsec sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 17:15:42 -0000 Author: zec Date: Mon Jun 8 17:15:40 2009 New Revision: 193731 URL: http://svn.freebsd.org/changeset/base/193731 Log: Introduce an infrastructure for dismantling vnet instances. Vnet modules and protocol domains may now register destructor functions to clean up and release per-module state. The destructor mechanisms can be triggered by invoking "vimage -d", or a future equivalent command which will be provided via the new jail framework. While this patch introduces numerous placeholder destructor functions, many of those are currently incomplete, thus leaking memory or (even worse) failing to stop all running timers. Many of such issues are already known and will be incrementaly fixed over the next weeks in smaller incremental commits. Apart from introducing new fields in structs ifnet, domain, protosw and vnet_net, which requires the kernel and modules to be rebuilt, this change should have no impact on nooptions VIMAGE builds, since vnet destructors can only be called in VIMAGE kernels. Moreover, destructor functions should be in general compiled in only in options VIMAGE builds, except for kernel modules which can be safely kldunloaded at run time. Bump __FreeBSD_version to 800097. Reviewed by: bz, julian Approved by: rwatson, kib (re), julian (mentor) Modified: head/UPDATING head/sys/kern/kern_vimage.c head/sys/kern/uipc_domain.c head/sys/net/if.c head/sys/net/if_gif.c head/sys/net/if_loop.c head/sys/net/if_var.h head/sys/net/route.c head/sys/net/vnet.h head/sys/netgraph/ng_base.c head/sys/netinet/in_proto.c head/sys/netinet/in_rmx.c head/sys/netinet/ip_var.h head/sys/netinet/raw_ip.c head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_var.h head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h head/sys/netinet6/ip6protosw.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netipsec/ipsec.c head/sys/netipsec/key.c head/sys/netipsec/key.h head/sys/netipsec/keysock.c head/sys/sys/domain.h head/sys/sys/param.h head/sys/sys/protosw.h head/sys/sys/vimage.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jun 8 17:11:47 2009 (r193730) +++ head/UPDATING Mon Jun 8 17:15:40 2009 (r193731) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090608: + The layout of structs ifnet, domain, protosw and vnet_net has + changed. Kernel modules need to be rebuilt. + Bump __FreeBSD_version to 800097. + 20090602: window(1) has been removed from the base system. It can now be installed from ports. The port is called misc/window. Modified: head/sys/kern/kern_vimage.c ============================================================================== --- head/sys/kern/kern_vimage.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/kern/kern_vimage.c Mon Jun 8 17:15:40 2009 (r193731) @@ -65,8 +65,8 @@ static int vnet_mod_constructor(struct v static int vnet_mod_destructor(struct vnet_modlink *); #ifdef VIMAGE -static struct vimage *vimage_by_name(struct vimage *, char *); static struct vimage *vi_alloc(struct vimage *, char *); +static int vi_destroy(struct vimage *); static struct vimage *vimage_get_next(struct vimage *, struct vimage *, int); static void vimage_relative_name(struct vimage *, struct vimage *, char *, int); @@ -122,7 +122,7 @@ vi_if_move(struct vi_req *vi_req, struct struct vnet *new_vnet = NULL; /* Check for API / ABI version mismatch. */ - if (vi_req->vi_api_cookie != VI_API_COOKIE) + if (vi_req != NULL && vi_req->vi_api_cookie != VI_API_COOKIE) return (EDOOFUS); /* Find the target vnet. */ @@ -216,11 +216,7 @@ vi_td_ioctl(u_long cmd, struct vi_req *v case SIOCSPVIMAGE: if (vi_req->vi_req_action == VI_DESTROY) { -#ifdef NOTYET error = vi_destroy(vip_r); -#else - error = EOPNOTSUPP; -#endif break; } @@ -283,7 +279,7 @@ vi_child_of(struct vimage *parent, struc return (0); } -static struct vimage * +struct vimage * vimage_by_name(struct vimage *top, char *name) { struct vimage *vip; @@ -541,7 +537,6 @@ vnet_mod_constructor(struct vnet_modlink return (0); } - static int vnet_mod_destructor(struct vnet_modlink *vml) { @@ -663,6 +658,68 @@ vi_alloc(struct vimage *parent, char *na return (vip); } + +/* + * Destroy a vnet - unlink all linked lists, hashtables etc., free all + * the memory, stop all the timers... + */ +static int +vi_destroy(struct vimage *vip) +{ + struct vnet *vnet = vip->v_net; + struct vprocg *vprocg = vip->v_procg; + struct ifnet *ifp, *nifp; + struct vnet_modlink *vml; + + /* XXX Beware of races -> more locking to be done... */ + if (!LIST_EMPTY(&vip->vi_child_head)) + return (EBUSY); + + if (vprocg->nprocs != 0) + return (EBUSY); + + if (vnet->sockcnt != 0) + return (EBUSY); + +#ifdef INVARIANTS + if (vip->vi_ucredrefc != 0) + printf("vi_destroy: %s ucredrefc %d\n", + vip->vi_name, vip->vi_ucredrefc); +#endif + + /* Point with no return - cleanup MUST succeed! */ + LIST_REMOVE(vip, vi_le); + LIST_REMOVE(vip, vi_sibling); + LIST_REMOVE(vprocg, vprocg_le); + + VNET_LIST_WLOCK(); + LIST_REMOVE(vnet, vnet_le); + VNET_LIST_WUNLOCK(); + + CURVNET_SET_QUIET(vnet); + INIT_VNET_NET(vnet); + + /* Return all inherited interfaces to their parent vnets. */ + TAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { + if (ifp->if_home_vnet != ifp->if_vnet) + vi_if_move(NULL, ifp, vip); + } + + /* Detach / free per-module state instances. */ + TAILQ_FOREACH_REVERSE(vml, &vnet_modlink_head, + vnet_modlink_head, vml_mod_le) + vnet_mod_destructor(vml); + + CURVNET_RESTORE(); + + /* Hopefully, we are OK to free the vnet container itself. */ + vnet->vnet_magic_n = 0xdeadbeef; + free(vnet, M_VNET); + free(vprocg, M_VPROCG); + free(vip, M_VIMAGE); + + return (0); +} #endif /* VIMAGE */ static void Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/kern/uipc_domain.c Mon Jun 8 17:15:40 2009 (r193731) @@ -66,6 +66,9 @@ SYSINIT(domainfin, SI_SUB_PROTO_IFATTACH NULL); static vnet_attach_fn net_init_domain; +#ifdef VIMAGE +static vnet_detach_fn net_detach_domain; +#endif static struct callout pffast_callout; static struct callout pfslow_callout; @@ -107,7 +110,10 @@ struct pr_usrreqs nousrreqs = { vnet_modinfo_t vnet_domain_modinfo = { .vmi_id = VNET_MOD_DOMAIN, .vmi_name = "domain", - .vmi_iattach = net_init_domain + .vmi_iattach = net_init_domain, +#ifdef VIMAGE + .vmi_idetach = net_detach_domain, +#endif }; #endif @@ -190,6 +196,26 @@ net_init_domain(const void *arg) return (0); } +#ifdef VIMAGE +/* + * Detach / free a domain instance. + */ +static int +net_detach_domain(const void *arg) +{ + const struct domain *dp = arg; + struct protosw *pr; + + for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) + if (pr->pr_destroy) + (*pr->pr_destroy)(); + if (dp->dom_destroy) + (*dp->dom_destroy)(); + + return (0); +} +#endif + /* * Add a new protocol domain to the list of supported domains * Note: you cant unload it again because a socket may be using it. Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/net/if.c Mon Jun 8 17:15:40 2009 (r193731) @@ -153,6 +153,9 @@ extern void nd6_setmtu(struct ifnet *); #endif static int vnet_net_iattach(const void *); +#ifdef VIMAGE +static int vnet_net_idetach(const void *); +#endif #ifdef VIMAGE_GLOBALS struct ifnethead ifnet; /* depend on static init XXX */ @@ -189,7 +192,10 @@ static const vnet_modinfo_t vnet_net_mod .vmi_name = "net", .vmi_size = sizeof(struct vnet_net), .vmi_symmap = vnet_net_symmap, - .vmi_iattach = vnet_net_iattach + .vmi_iattach = vnet_net_iattach, +#ifdef VIMAGE + .vmi_idetach = vnet_net_idetach +#endif }; #endif /* !VIMAGE_GLOBALS */ @@ -446,6 +452,22 @@ vnet_net_iattach(const void *unused __un return (0); } +#ifdef VIMAGE +static int +vnet_net_idetach(const void *unused __unused) +{ + INIT_VNET_NET(curvnet); + + VNET_ASSERT(TAILQ_EMPTY(&V_ifnet)); + VNET_ASSERT(TAILQ_EMPTY(&V_ifg_head)); + VNET_ASSERT(SLIST_EMPTY(&V_ifklist.kl_list)); + + free((caddr_t)V_ifindex_table, M_IFNET); + + return (0); +} +#endif + void if_grow(void) { @@ -688,6 +710,8 @@ if_attach_internal(struct ifnet *ifp, in #ifdef VIMAGE ifp->if_vnet = curvnet; + if (ifp->if_home_vnet == NULL) + ifp->if_home_vnet = curvnet; #endif if_addgroup(ifp, IFG_ALL); Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/net/if_gif.c Mon Jun 8 17:15:40 2009 (r193731) @@ -303,12 +303,10 @@ gifmodevent(mod, type, data) break; case MOD_UNLOAD: if_clone_detach(&gif_cloner); - mtx_destroy(&gif_mtx); -#ifdef INET6 -#ifndef VIMAGE - V_ip6_gif_hlim = 0; /* XXX -> vnet_gif_idetach() */ -#endif +#ifdef VIMAGE + vnet_mod_deregister(&vnet_gif_modinfo); #endif + mtx_destroy(&gif_mtx); break; default: return EOPNOTSUPP; Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/net/if_loop.c Mon Jun 8 17:15:40 2009 (r193731) @@ -105,6 +105,9 @@ int looutput(struct ifnet *ifp, struct static int lo_clone_create(struct if_clone *, int, caddr_t); static void lo_clone_destroy(struct ifnet *); static int vnet_loif_iattach(const void *); +#ifdef VIMAGE +static int vnet_loif_idetach(const void *); +#endif #ifdef VIMAGE_GLOBALS struct ifnet *loif; /* Used externally */ @@ -119,7 +122,10 @@ static const vnet_modinfo_t vnet_loif_mo .vmi_id = VNET_MOD_LOIF, .vmi_dependson = VNET_MOD_IF_CLONE, .vmi_name = "loif", - .vmi_iattach = vnet_loif_iattach + .vmi_iattach = vnet_loif_iattach, +#ifdef VIMAGE + .vmi_idetach = vnet_loif_idetach +#endif }; #endif /* !VIMAGE_GLOBALS */ @@ -128,12 +134,11 @@ IFC_SIMPLE_DECLARE(lo, 1); static void lo_clone_destroy(struct ifnet *ifp) { -#ifdef INVARIANTS - INIT_VNET_NET(ifp->if_vnet); -#endif +#ifndef VIMAGE /* XXX: destroying lo0 will lead to panics. */ KASSERT(V_loif != ifp, ("%s: destroying lo0", __func__)); +#endif bpfdetach(ifp); if_detach(ifp); @@ -166,7 +171,8 @@ lo_clone_create(struct if_clone *ifc, in return (0); } -static int vnet_loif_iattach(const void *unused __unused) +static int +vnet_loif_iattach(const void *unused __unused) { INIT_VNET_NET(curvnet); @@ -175,7 +181,11 @@ static int vnet_loif_iattach(const void #ifdef VIMAGE V_lo_cloner = malloc(sizeof(*V_lo_cloner), M_LO_CLONER, M_WAITOK | M_ZERO); + V_lo_cloner_data = malloc(sizeof(*V_lo_cloner_data), M_LO_CLONER, + M_WAITOK | M_ZERO); bcopy(&lo_cloner, V_lo_cloner, sizeof(*V_lo_cloner)); + bcopy(lo_cloner.ifc_data, V_lo_cloner_data, sizeof(*V_lo_cloner_data)); + V_lo_cloner->ifc_data = V_lo_cloner_data; if_clone_attach(V_lo_cloner); #else if_clone_attach(&lo_cloner); @@ -183,6 +193,21 @@ static int vnet_loif_iattach(const void return (0); } +#ifdef VIMAGE +static int +vnet_loif_idetach(const void *unused __unused) +{ + INIT_VNET_NET(curvnet); + + if_clone_detach(V_lo_cloner); + free(V_lo_cloner, M_LO_CLONER); + free(V_lo_cloner_data, M_LO_CLONER); + V_loif = NULL; + + return (0); +} +#endif + static int loop_modevent(module_t mod, int type, void *data) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/net/if_var.h Mon Jun 8 17:15:40 2009 (r193731) @@ -71,6 +71,7 @@ struct ether_header; struct carp_if; struct ifvlantrunk; struct route; +struct vnet; #endif #include /* get TAILQ macros */ @@ -169,6 +170,9 @@ struct ifnet { (struct ifnet *); int (*if_transmit) /* initiate output routine */ (struct ifnet *, struct mbuf *); + void (*if_reassign) /* reassign to vnet routine */ + (struct ifnet *, struct vnet *, char *); + struct vnet *if_home_vnet; /* where this ifnet originates from */ struct ifaddr *if_addr; /* pointer to link-level address */ void *if_llsoftc; /* link layer softc */ int if_drv_flags; /* driver-managed status flags */ Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/net/route.c Mon Jun 8 17:15:40 2009 (r193731) @@ -99,12 +99,18 @@ static int rttrash; /* routes not in ta static void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); static int vnet_route_iattach(const void *); +#ifdef VIMAGE +static int vnet_route_idetach(const void *); +#endif #ifndef VIMAGE_GLOBALS static const vnet_modinfo_t vnet_rtable_modinfo = { .vmi_id = VNET_MOD_RTABLE, .vmi_name = "rtable", - .vmi_iattach = vnet_route_iattach + .vmi_iattach = vnet_route_iattach, +#ifdef VIMAGE + .vmi_idetach = vnet_route_idetach +#endif }; #endif /* !VIMAGE_GLOBALS */ @@ -194,7 +200,8 @@ route_init(void) #endif } -static int vnet_route_iattach(const void *unused __unused) +static int +vnet_route_iattach(const void *unused __unused) { INIT_VNET_NET(curvnet); struct domain *dom; @@ -235,6 +242,36 @@ static int vnet_route_iattach(const void return (0); } +#ifdef VIMAGE +static int +vnet_route_idetach(const void *unused __unused) +{ + int table; + int fam; + struct domain *dom; + struct radix_node_head **rnh; + + for (dom = domains; dom; dom = dom->dom_next) { + if (dom->dom_rtdetach) { + for (table = 0; table < rt_numfibs; table++) { + if ( (fam = dom->dom_family) == AF_INET || + table == 0) { + /* For now only AF_INET has > 1 tbl. */ + rnh = rt_tables_get_rnh_ptr(table, fam); + if (rnh == NULL) + panic("%s: rnh NULL", __func__); + dom->dom_rtdetach((void **)rnh, + dom->dom_rtoffset); + } else { + break; + } + } + } + } + return (0); +} +#endif + #ifndef _SYS_SYSPROTO_H_ struct setfib_args { int fibnum; Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/net/vnet.h Mon Jun 8 17:15:40 2009 (r193731) @@ -51,6 +51,7 @@ struct vnet_net { struct ifnet * _loif; struct if_clone * _lo_cloner; + struct ifc_simple_data *_lo_cloner_data; LIST_HEAD(, rawcb) _rawcb_list; @@ -87,6 +88,7 @@ extern struct vnet_net vnet_net_0; #define V_ifklist VNET_NET(ifklist) #define V_ifnet VNET_NET(ifnet) #define V_lo_cloner VNET_NET(lo_cloner) +#define V_lo_cloner_data VNET_NET(lo_cloner_data) #define V_loif VNET_NET(loif) #define V_rawcb_list VNET_NET(rawcb_list) #define V_rt_tables VNET_NET(rt_tables) Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netgraph/ng_base.c Mon Jun 8 17:15:40 2009 (r193731) @@ -85,6 +85,9 @@ struct vnet_netgraph vnet_netgraph_0; static struct mtx ng_topo_mtx; static vnet_attach_fn vnet_netgraph_iattach; +#ifdef VIMAGE +static vnet_detach_fn vnet_netgraph_idetach; +#endif #ifdef NETGRAPH_DEBUG static struct mtx ng_nodelist_mtx; /* protects global node/hook lists */ @@ -647,6 +650,9 @@ ng_make_node_common(struct ng_type *type return (ENOMEM); } node->nd_type = type; +#ifdef VIMAGE + node->nd_vnet = curvnet; +#endif NG_NODE_REF(node); /* note reference */ type->refs++; @@ -3074,15 +3080,17 @@ ng_mod_event(module_t mod, int event, vo static const vnet_modinfo_t vnet_netgraph_modinfo = { .vmi_id = VNET_MOD_NETGRAPH, .vmi_name = "netgraph", -#ifdef VIMAGE .vmi_size = sizeof(struct vnet_netgraph), + .vmi_dependson = VNET_MOD_LOIF, + .vmi_iattach = vnet_netgraph_iattach, +#ifdef VIMAGE + .vmi_idetach = vnet_netgraph_idetach #endif - .vmi_iattach = vnet_netgraph_iattach }; #endif static int -vnet_netgraph_iattach(const void *arg __unused) +vnet_netgraph_iattach(const void *unused __unused) { INIT_VNET_NETGRAPH(curvnet); @@ -3091,6 +3099,33 @@ vnet_netgraph_iattach(const void *arg __ return (0); } +#ifdef VIMAGE +static int +vnet_netgraph_idetach(const void *unused __unused) +{ + INIT_VNET_NETGRAPH(curvnet); + node_p node, last_killed = NULL; + + while ((node = LIST_FIRST(&V_ng_nodelist)) != NULL) { + if (node == last_killed) { + /* This should never happen */ + node->nd_flags |= NGF_REALLY_DIE; + printf("netgraph node %s needs NGF_REALLY_DIE\n", + node->nd_name); + ng_rmnode(node, NULL, NULL, 0); + /* This must never happen */ + if (node == LIST_FIRST(&V_ng_nodelist)) + panic("netgraph node %s won't die", + node->nd_name); + } + ng_rmnode(node, NULL, NULL, 0); + last_killed = node; + } + + return (0); +} +#endif /* VIMAGE */ + /* * Handle loading and unloading for this code. * The only thing we need to link into is the NETISR strucure. @@ -3313,6 +3348,7 @@ ngthread(void *arg) NG_WORKLIST_SLEEP(); STAILQ_REMOVE_HEAD(&ng_worklist, nd_input_queue.q_work); NG_WORKLIST_UNLOCK(); + CURVNET_SET(node->nd_vnet); CTR3(KTR_NET, "%20s: node [%x] (%p) taken off worklist", __func__, node->nd_ID, node); /* @@ -3342,6 +3378,7 @@ ngthread(void *arg) } } NG_NODE_UNREF(node); + CURVNET_RESTORE(); } } @@ -3675,7 +3712,9 @@ ng_callout_trampoline(void *arg) { item_p item = arg; + CURVNET_SET(NGI_NODE(item)->nd_vnet); ng_snd_item(item, 0); + CURVNET_RESTORE(); } Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/in_proto.c Mon Jun 8 17:15:40 2009 (r193731) @@ -127,6 +127,9 @@ struct protosw inetsw[] = { .pr_ctlinput = udp_ctlinput, .pr_ctloutput = ip_ctloutput, .pr_init = udp_init, +#ifdef VIMAGE + .pr_destroy = udp_destroy, +#endif .pr_usrreqs = &udp_usrreqs }, { @@ -138,6 +141,9 @@ struct protosw inetsw[] = { .pr_ctlinput = tcp_ctlinput, .pr_ctloutput = tcp_ctloutput, .pr_init = tcp_init, +#ifdef VIMAGE + .pr_destroy = tcp_destroy, +#endif .pr_slowtimo = tcp_slowtimo, .pr_drain = tcp_drain, .pr_usrreqs = &tcp_usrreqs @@ -348,11 +354,15 @@ IPPROTOSPACER, .pr_input = rip_input, .pr_ctloutput = rip_ctloutput, .pr_init = rip_init, +#ifdef VIMAGE + .pr_destroy = rip_destroy, +#endif .pr_usrreqs = &rip_usrreqs }, }; extern int in_inithead(void **, int); +extern int in_detachhead(void **, int); struct domain inetdomain = { .dom_family = AF_INET, @@ -364,6 +374,9 @@ struct domain inetdomain = { #else .dom_rtattach = in_inithead, #endif +#ifdef VIMAGE + .dom_rtdetach = in_detachhead, +#endif .dom_rtoffset = 32, .dom_maxrtkey = sizeof(struct sockaddr_in), .dom_ifattach = in_domifattach, Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/in_rmx.c Mon Jun 8 17:15:40 2009 (r193731) @@ -65,6 +65,9 @@ __FBSDID("$FreeBSD$"); #include extern int in_inithead(void **head, int off); +#ifdef VIMAGE +extern int in_detachhead(void **head, int off); +#endif #define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ @@ -382,6 +385,17 @@ in_inithead(void **head, int off) return 1; } +#ifdef VIMAGE +int +in_detachhead(void **head, int off) +{ + INIT_VNET_INET(curvnet); + + callout_drain(&V_rtq_timer); + return (1); +} +#endif + /* * This zaps old routes when the interface goes down or interface * address is deleted. In the latter case, it deletes static routes Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/ip_var.h Mon Jun 8 17:15:40 2009 (r193731) @@ -210,6 +210,9 @@ u_int16_t ip_randomid(void); int rip_ctloutput(struct socket *, struct sockopt *); void rip_ctlinput(int, struct sockaddr *, void *); void rip_init(void); +#ifdef VIMAGE +void rip_destroy(void); +#endif void rip_input(struct mbuf *, int); int rip_output(struct mbuf *, struct socket *, u_long); void ipip_input(struct mbuf *, int); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/raw_ip.c Mon Jun 8 17:15:40 2009 (r193731) @@ -205,6 +205,19 @@ rip_init(void) EVENTHANDLER_PRI_ANY); } +#ifdef VIMAGE +void +rip_destroy(void) +{ + INIT_VNET_INET(curvnet); + + hashdestroy(V_ripcbinfo.ipi_hashbase, M_PCB, + V_ripcbinfo.ipi_hashmask); + hashdestroy(V_ripcbinfo.ipi_porthashbase, M_PCB, + V_ripcbinfo.ipi_porthashmask); +} +#endif + static int rip_append(struct inpcb *last, struct ip *ip, struct mbuf *n, struct sockaddr_in *ripsrc) Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/tcp_hostcache.c Mon Jun 8 17:15:40 2009 (r193731) @@ -230,6 +230,18 @@ tcp_hc_init(void) tcp_hc_purge, curvnet); } +#ifdef VIMAGE +void +tcp_hc_destroy(void) +{ + INIT_VNET_INET(curvnet); + + /* XXX TODO walk the hashtable and free all entries */ + + callout_drain(&V_tcp_hc_callout); +} +#endif + /* * Internal function: look up an entry in the hostcache or return NULL. * Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/tcp_subr.c Mon Jun 8 17:15:40 2009 (r193731) @@ -426,6 +426,25 @@ tcp_init(void) EVENTHANDLER_PRI_ANY); } +#ifdef VIMAGE +void +tcp_destroy(void) +{ + INIT_VNET_INET(curvnet); + + tcp_tw_destroy(); + tcp_hc_destroy(); + syncache_destroy(); + + /* XXX check that hashes are empty! */ + hashdestroy(V_tcbinfo.ipi_hashbase, M_PCB, + V_tcbinfo.ipi_hashmask); + hashdestroy(V_tcbinfo.ipi_porthashbase, M_PCB, + V_tcbinfo.ipi_porthashmask); + INP_INFO_LOCK_DESTROY(&V_tcbinfo); +} +#endif + void tcp_fini(void *xtp) { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/tcp_syncache.c Mon Jun 8 17:15:40 2009 (r193731) @@ -275,6 +275,19 @@ syncache_init(void) uma_zone_set_max(V_tcp_syncache.zone, V_tcp_syncache.cache_limit); } +#ifdef VIMAGE +void +syncache_destroy(void) +{ + INIT_VNET_INET(curvnet); + + /* XXX walk the cache, free remaining objects, stop timers */ + + uma_zdestroy(V_tcp_syncache.zone); + FREE(V_tcp_syncache.hashbase, M_SYNCACHE); +} +#endif + /* * Inserts a syncache entry into the specified bucket row. * Locks and unlocks the syncache_head autonomously. Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/tcp_syncache.h Mon Jun 8 17:15:40 2009 (r193731) @@ -35,6 +35,9 @@ #ifdef _KERNEL void syncache_init(void); +#ifdef VIMAGE +void syncache_destroy(void); +#endif void syncache_unreach(struct in_conninfo *, struct tcphdr *); int syncache_expand(struct in_conninfo *, struct tcpopt *, struct tcphdr *, struct socket **, struct mbuf *); Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/tcp_timewait.c Mon Jun 8 17:15:40 2009 (r193731) @@ -179,6 +179,20 @@ tcp_tw_init(void) TAILQ_INIT(&V_twq_2msl); } +#ifdef VIMAGE +void +tcp_tw_destroy(void) +{ + INIT_VNET_INET(curvnet); + struct tcptw *tw; + + INP_INFO_WLOCK(&V_tcbinfo); + while((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL) + tcp_twclose(tw, 0); + INP_INFO_WUNLOCK(&V_tcbinfo); +} +#endif + /* * Move a TCP connection into TIME_WAIT state. * tcbinfo is locked. Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/tcp_var.h Mon Jun 8 17:15:40 2009 (r193731) @@ -584,6 +584,9 @@ struct tcpcb * void tcp_drain(void); void tcp_fasttimo(void); void tcp_init(void); +#ifdef VIMAGE +void tcp_destroy(void); +#endif void tcp_fini(void *); char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, const void *); @@ -605,6 +608,9 @@ int tcp_output(struct tcpcb *); void tcp_respond(struct tcpcb *, void *, struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, int); void tcp_tw_init(void); +#ifdef VIMAGE +void tcp_tw_destroy(void); +#endif void tcp_tw_zone_change(void); int tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, struct mbuf *, int); @@ -625,6 +631,9 @@ void tcp_xmit_bandwidth_limit(struct tc * All tcp_hc_* functions are IPv4 and IPv6 (via in_conninfo) */ void tcp_hc_init(void); +#ifdef VIMAGE +void tcp_hc_destroy(void); +#endif void tcp_hc_get(struct in_conninfo *, struct hc_metrics_lite *); u_long tcp_hc_getmtu(struct in_conninfo *); void tcp_hc_updatemtu(struct in_conninfo *, u_long); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/udp_usrreq.c Mon Jun 8 17:15:40 2009 (r193731) @@ -221,6 +221,20 @@ udp_discardcb(struct udpcb *up) uma_zfree(V_udpcb_zone, up); } +#ifdef VIMAGE +void +udp_destroy(void) +{ + INIT_VNET_INET(curvnet); + + hashdestroy(V_udbinfo.ipi_hashbase, M_PCB, + V_udbinfo.ipi_hashmask); + hashdestroy(V_udbinfo.ipi_porthashbase, M_PCB, + V_udbinfo.ipi_porthashmask); + INP_INFO_LOCK_DESTROY(&V_udbinfo); +} +#endif + /* * Subroutine of udp_input(), which appends the provided mbuf chain to the * passed pcb/socket. The caller must provide a sockaddr_in via udp_in that Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet/udp_var.h Mon Jun 8 17:15:40 2009 (r193731) @@ -128,6 +128,9 @@ void udp_discardcb(struct udpcb *); void udp_ctlinput(int, struct sockaddr *, void *); void udp_init(void); +#ifdef VIMAGE +void udp_destroy(void); +#endif void udp_input(struct mbuf *, int); struct inpcb *udp_notify(struct inpcb *inp, int errno); int udp_shutdown(struct socket *so); Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet6/in6_proto.c Mon Jun 8 17:15:40 2009 (r193731) @@ -148,6 +148,9 @@ struct ip6protosw inet6sw[] = { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, +#ifdef VIMAGE + .pr_destroy = ip6_destroy, +#endif .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drain, .pr_usrreqs = &nousrreqs, @@ -349,6 +352,9 @@ struct ip6protosw inet6sw[] = { }; extern int in6_inithead(void **, int); +#ifdef VIMAGE +extern int in6_detachhead(void **, int); +#endif struct domain inet6domain = { .dom_family = AF_INET6, @@ -361,6 +367,9 @@ struct domain inet6domain = { #else .dom_rtattach = in6_inithead, #endif +#ifdef VIMAGE + .dom_rtdetach = in6_detachhead, +#endif .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, .dom_maxrtkey = sizeof(struct sockaddr_in6), .dom_ifattach = in6_domifattach, Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet6/in6_rmx.c Mon Jun 8 17:15:40 2009 (r193731) @@ -112,6 +112,9 @@ __FBSDID("$FreeBSD$"); #include extern int in6_inithead(void **head, int off); +#ifdef VIMAGE +extern int in6_detachhead(void **head, int off); +#endif #define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ @@ -464,3 +467,15 @@ in6_inithead(void **head, int off) in6_mtutimo(curvnet); /* kick off timeout first time */ return 1; } + +#ifdef VIMAGE +int +in6_detachhead(void **head, int off) +{ + INIT_VNET_INET6(curvnet); + + callout_drain(&V_rtq_timer6); + callout_drain(&V_rtq_mtutimer); + return (1); +} +#endif Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet6/ip6_input.c Mon Jun 8 17:15:40 2009 (r193731) @@ -303,6 +303,17 @@ ip6_init(void) netisr_register(&ip6_nh); } +#ifdef VIMAGE +void +ip6_destroy() +{ + INIT_VNET_INET6(curvnet); + + nd6_destroy(); + callout_drain(&V_in6_tmpaddrtimer_ch); +} +#endif + static int ip6_init2_vnet(const void *unused __unused) { Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet6/ip6_var.h Mon Jun 8 17:15:40 2009 (r193731) @@ -339,6 +339,9 @@ int icmp6_ctloutput __P((struct socket * struct in6_ifaddr; void ip6_init __P((void)); +#ifdef VIMAGE +void ip6_destroy __P((void)); +#endif void ip6_input __P((struct mbuf *)); struct in6_ifaddr *ip6_getdstifaddr __P((struct mbuf *)); void ip6_freepcbopts __P((struct ip6_pktopts *)); Modified: head/sys/netinet6/ip6protosw.h ============================================================================== --- head/sys/netinet6/ip6protosw.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet6/ip6protosw.h Mon Jun 8 17:15:40 2009 (r193731) @@ -129,6 +129,8 @@ struct ip6protosw { /* utility hooks */ void (*pr_init) /* initialization hook */ __P((void)); + void (*pr_destroy) /* cleanup hook */ + __P((void)); void (*pr_fasttimo) /* fast timeout (200ms) */ __P((void)); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet6/nd6.c Mon Jun 8 17:15:40 2009 (r193731) @@ -134,14 +134,8 @@ void nd6_init(void) { INIT_VNET_INET6(curvnet); - static int nd6_init_done = 0; int i; - if (nd6_init_done) { - log(LOG_NOTICE, "nd6_init called more than once(ignored)\n"); - return; - } - V_nd6_prune = 1; /* walk list every 1 seconds */ V_nd6_delay = 5; /* delay first probe time 5 second */ V_nd6_umaxtries = 3; /* maximum unicast query */ @@ -180,6 +174,8 @@ nd6_init(void) V_ip6_temp_valid_lifetime = DEF_TEMP_VALID_LIFETIME; V_ip6_temp_regen_advance = TEMPADDR_REGEN_ADVANCE; + V_ip6_desync_factor = 0; + all1_sa.sin6_family = AF_INET6; all1_sa.sin6_len = sizeof(struct sockaddr_in6); for (i = 0; i < sizeof(all1_sa.sin6_addr); i++) @@ -191,10 +187,19 @@ nd6_init(void) callout_init(&V_nd6_slowtimo_ch, 0); callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, curvnet); +} - nd6_init_done = 1; +#ifdef VIMAGE +void +nd6_destroy() +{ + INIT_VNET_INET6(curvnet); + + callout_drain(&V_nd6_slowtimo_ch); + callout_drain(&V_nd6_timer_ch); } +#endif struct nd_ifinfo * nd6_ifattach(struct ifnet *ifp) Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netinet6/nd6.h Mon Jun 8 17:15:40 2009 (r193731) @@ -371,6 +371,9 @@ union nd_opts { /* XXX: need nd6_var.h?? */ /* nd6.c */ void nd6_init __P((void)); +#ifdef VIMAGE +void nd6_destroy __P((void)); +#endif struct nd_ifinfo *nd6_ifattach __P((struct ifnet *)); void nd6_ifdetach __P((struct nd_ifinfo *)); int nd6_is_addr_neighbor __P((struct sockaddr_in6 *, struct ifnet *)); Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Mon Jun 8 17:11:47 2009 (r193730) +++ head/sys/netipsec/ipsec.c Mon Jun 8 17:15:40 2009 (r193731) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 17:27:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C8E8106566C; Mon, 8 Jun 2009 17:27:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 400798FC14; Mon, 8 Jun 2009 17:27:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58HRQX7036650; Mon, 8 Jun 2009 17:27:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58HRP3U036646; Mon, 8 Jun 2009 17:27:25 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906081727.n58HRP3U036646@svn.freebsd.org> From: Ed Schouten Date: Mon, 8 Jun 2009 17:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193732 - in head/sys: amd64/amd64 i386/i386 i386/xen sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 17:27:26 -0000 Author: ed Date: Mon Jun 8 17:27:25 2009 New Revision: 193732 URL: http://svn.freebsd.org/changeset/base/193732 Log: Remove __gnu89_inline. Now that we use C99 almost everywhere, just use C99-style in the pmap code. Since the pmap code is the only consumer of __gnu89_inline, remove it from cdefs.h as well. Because the flag was only introduced 17 months ago, I don't expect any problems. Reviewed by: alc Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/sys/cdefs.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Jun 8 17:15:40 2009 (r193731) +++ head/sys/amd64/amd64/pmap.c Mon Jun 8 17:27:25 2009 (r193732) @@ -153,7 +153,7 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(DIAGNOSTIC) -#define PMAP_INLINE __gnu89_inline +#define PMAP_INLINE extern inline #else #define PMAP_INLINE #endif Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Jun 8 17:15:40 2009 (r193731) +++ head/sys/i386/i386/pmap.c Mon Jun 8 17:27:25 2009 (r193732) @@ -161,7 +161,7 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(DIAGNOSTIC) -#define PMAP_INLINE __gnu89_inline +#define PMAP_INLINE extern inline #else #define PMAP_INLINE #endif Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Mon Jun 8 17:15:40 2009 (r193731) +++ head/sys/i386/xen/pmap.c Mon Jun 8 17:27:25 2009 (r193732) @@ -172,7 +172,7 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(PMAP_DIAGNOSTIC) -#define PMAP_INLINE __gnu89_inline +#define PMAP_INLINE extern inline #else #define PMAP_INLINE #endif Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Mon Jun 8 17:15:40 2009 (r193731) +++ head/sys/sys/cdefs.h Mon Jun 8 17:27:25 2009 (r193732) @@ -234,12 +234,6 @@ #define __always_inline #endif -#if __GNUC_PREREQ__(4, 2) /* actually 4.1.3 */ -#define __gnu89_inline __attribute__((__gnu_inline__)) __inline -#else -#define __gnu89_inline -#endif - #if __GNUC_PREREQ__(3, 1) #define __noinline __attribute__ ((__noinline__)) #else From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 18:09:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8394E10656E3; Mon, 8 Jun 2009 18:09:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57C648FC3E; Mon, 8 Jun 2009 18:09:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58I9pvT037734; Mon, 8 Jun 2009 18:09:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58I9pMe037732; Mon, 8 Jun 2009 18:09:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906081809.n58I9pMe037732@svn.freebsd.org> From: Andrew Thompson Date: Mon, 8 Jun 2009 18:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193733 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 18:09:53 -0000 Author: thompsa Date: Mon Jun 8 18:09:51 2009 New Revision: 193733 URL: http://svn.freebsd.org/changeset/base/193733 Log: Change driver_info to a ulong as it always stores a number and remove the only diff of the usb_device_id struct to Linux. Reviewed by: HPS Modified: head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_lookup.h Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Mon Jun 8 17:27:25 2009 (r193732) +++ head/sys/dev/usb/usb_core.h Mon Jun 8 18:09:51 2009 (r193733) @@ -485,7 +485,8 @@ struct usb_lookup_info { struct usb_attach_arg { struct usb_lookup_info info; device_t temp_dev; /* for internal use */ - const void *driver_info; /* for internal use */ + unsigned long driver_info; /* for internal use */ + void *driver_ivar; struct usb_device *device; /* current device */ struct usb_interface *iface; /* current interface */ enum usb_hc_mode usb_mode; /* host or device mode */ Modified: head/sys/dev/usb/usb_lookup.h ============================================================================== --- head/sys/dev/usb/usb_lookup.h Mon Jun 8 17:27:25 2009 (r193732) +++ head/sys/dev/usb/usb_lookup.h Mon Jun 8 18:09:51 2009 (r193733) @@ -37,7 +37,7 @@ struct usb_attach_arg; struct usb_device_id { /* Hook for driver specific information */ - const void *driver_info; + unsigned long driver_info; /* Used for product specific matches; the BCD range is inclusive */ uint16_t idVendor; @@ -107,11 +107,11 @@ struct usb_device_id { #define USB_IF_CSI(class,subclass,info) \ USB_IFACE_CLASS(class), USB_IFACE_SUBCLASS(subclass), USB_DRIVER_INFO(info) -#define USB_DRIVER_INFO(ptr) \ - .driver_info = ((const void *)(ptr)) +#define USB_DRIVER_INFO(n) \ + .driver_info = (n) #define USB_GET_DRIVER_INFO(did) \ - (((const uint8_t *)((did)->driver_info)) - ((const uint8_t *)0)) + (did)->driver_info const struct usb_device_id *usb2_lookup_id_by_info( const struct usb_device_id *id, usb_size_t sizeof_id, From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 18:16:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8BFC1065673; Mon, 8 Jun 2009 18:16:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8AC708FC15; Mon, 8 Jun 2009 18:16:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id BD35446B06; Mon, 8 Jun 2009 14:16:01 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id C85AE8A049; Mon, 8 Jun 2009 14:16:00 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Date: Mon, 8 Jun 2009 12:58:52 -0400 User-Agent: KMail/1.9.7 References: <200906081554.n58Fs79X034345@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906081258.52863.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 08 Jun 2009 14:16:00 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193728 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 18:16:03 -0000 On Monday 08 June 2009 12:29:38 pm Marcel Moolenaar wrote: > > On Jun 8, 2009, at 8:54 AM, John Baldwin wrote: > > > Author: jhb > > Date: Mon Jun 8 15:54:07 2009 > > New Revision: 193728 > > URL: http://svn.freebsd.org/changeset/base/193728 > > > > Log: > > Change the printf format string to match the variable type to quiet > > warnings. > > Oops.. > > Thanks John! No problem. It actually compiled ok on my desktop (which runs 7) since 7 has NO_WERROR= set in /usr/share/mk/bsd.sys.mk since there was no -Werror to force a failure. It might be nice to have the NO_WERROR= thing take out of 7 if possible. I know that I would likely be burned by it myself as I tend to test 8 kernels on boxes that otherwise run 7 a lot. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 18:23:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B874F106566B; Mon, 8 Jun 2009 18:23:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9538FC13; Mon, 8 Jun 2009 18:23:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58INh0O038129; Mon, 8 Jun 2009 18:23:43 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58INhX8038125; Mon, 8 Jun 2009 18:23:43 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906081823.n58INhX8038125@svn.freebsd.org> From: Ed Schouten Date: Mon, 8 Jun 2009 18:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193734 - in head: lib/libusb sys/amd64/amd64 sys/i386/i386 sys/i386/xen sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 18:23:44 -0000 Author: ed Date: Mon Jun 8 18:23:43 2009 New Revision: 193734 URL: http://svn.freebsd.org/changeset/base/193734 Log: Revert my change; reintroduce __gnu89_inline. It turns out our compiler in stable/7 can't build this code anymore. Even though my opinion is that those people should just run `make kernel-toolchain' before building a kernel, I am willing to wait and commit this after we've branched stable/8. Requested by: rwatson Modified: head/lib/libusb/libusb.3 (props changed) head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/sys/cdefs.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Jun 8 18:09:51 2009 (r193733) +++ head/sys/amd64/amd64/pmap.c Mon Jun 8 18:23:43 2009 (r193734) @@ -153,7 +153,7 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(DIAGNOSTIC) -#define PMAP_INLINE extern inline +#define PMAP_INLINE __gnu89_inline #else #define PMAP_INLINE #endif Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Jun 8 18:09:51 2009 (r193733) +++ head/sys/i386/i386/pmap.c Mon Jun 8 18:23:43 2009 (r193734) @@ -161,7 +161,7 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(DIAGNOSTIC) -#define PMAP_INLINE extern inline +#define PMAP_INLINE __gnu89_inline #else #define PMAP_INLINE #endif Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Mon Jun 8 18:09:51 2009 (r193733) +++ head/sys/i386/xen/pmap.c Mon Jun 8 18:23:43 2009 (r193734) @@ -172,7 +172,7 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(PMAP_DIAGNOSTIC) -#define PMAP_INLINE extern inline +#define PMAP_INLINE __gnu89_inline #else #define PMAP_INLINE #endif Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Mon Jun 8 18:09:51 2009 (r193733) +++ head/sys/sys/cdefs.h Mon Jun 8 18:23:43 2009 (r193734) @@ -234,6 +234,12 @@ #define __always_inline #endif +#if __GNUC_PREREQ__(4, 2) /* actually 4.1.3 */ +#define __gnu89_inline __attribute__((__gnu_inline__)) __inline +#else +#define __gnu89_inline +#endif + #if __GNUC_PREREQ__(3, 1) #define __noinline __attribute__ ((__noinline__)) #else From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 18:41:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03329106564A; Mon, 8 Jun 2009 18:41:24 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E528F8FC12; Mon, 8 Jun 2009 18:41:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58IfNpX038599; Mon, 8 Jun 2009 18:41:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58IfNtb038598; Mon, 8 Jun 2009 18:41:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906081841.n58IfNtb038598@svn.freebsd.org> From: Rick Macklem Date: Mon, 8 Jun 2009 18:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193735 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 18:41:24 -0000 Author: rmacklem Date: Mon Jun 8 18:41:23 2009 New Revision: 193735 URL: http://svn.freebsd.org/changeset/base/193735 Log: Fix nfscl_getcl() so that it doesn't crash when it is called to do an NFSv4 Close operation with the cred argument NULL. Also, clarify what NULL arguments mean in the function's comment. Approved by: kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Mon Jun 8 18:23:43 2009 (r193734) +++ head/sys/fs/nfsclient/nfs_clstate.c Mon Jun 8 18:41:23 2009 (r193735) @@ -663,8 +663,9 @@ nfscl_openrelease(struct nfsclopen *op, * client data structures to do the SetClientId/SetClientId_confirm, * but will release that lock and return the clientid with a refernce * count on it. - * If the p argument is NULL, it will not do the SetClientId/Confirm - * and the cred argument is not used, so it can be NULL too. + * If the "cred" argument is NULL, a new clientid should not be created. + * If the "p" argument is NULL, a SetClientID/SetClientIDConfirm cannot + * be done. * It always clpp with a reference count on it, unless returning an error. */ APPLESTATIC int @@ -672,28 +673,35 @@ nfscl_getcl(vnode_t vp, struct ucred *cr struct nfsclclient **clpp) { struct nfsclclient *clp; - struct nfsclclient *newclp; + struct nfsclclient *newclp = NULL; struct nfscllockowner *lp, *nlp; struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct prison *pr; char uuid[HOSTUUIDLEN]; int igotlock = 0, error, trystalecnt, clidinusedelay, i; - u_int16_t idlen; + u_int16_t idlen = 0; - pr = cred->cr_prison; - mtx_lock(&pr->pr_mtx); - strlcpy(uuid, pr->pr_uuid, sizeof uuid); - mtx_unlock(&pr->pr_mtx); - idlen = strlen(uuid); - if (idlen > 0) - idlen += sizeof (u_int64_t); - else - idlen += sizeof (u_int64_t) + 16; /* 16 random bytes */ - MALLOC(newclp, struct nfsclclient *, sizeof (struct nfsclclient) + - idlen - 1, M_NFSCLCLIENT, M_WAITOK); + if (cred != NULL) { + pr = cred->cr_prison; + mtx_lock(&pr->pr_mtx); + strlcpy(uuid, pr->pr_uuid, sizeof uuid); + mtx_unlock(&pr->pr_mtx); + idlen = strlen(uuid); + if (idlen > 0) + idlen += sizeof (u_int64_t); + else + idlen += sizeof (u_int64_t) + 16; /* 16 random bytes */ + MALLOC(newclp, struct nfsclclient *, + sizeof (struct nfsclclient) + idlen - 1, M_NFSCLCLIENT, + M_WAITOK); + } NFSLOCKCLSTATE(); clp = nmp->nm_clp; if (clp == NULL) { + if (newclp == NULL) { + NFSUNLOCKCLSTATE(); + return (EACCES); + } clp = newclp; NFSBZERO((caddr_t)clp, sizeof(struct nfsclclient) + idlen - 1); clp->nfsc_idlen = idlen; @@ -714,7 +722,8 @@ nfscl_getcl(vnode_t vp, struct ucred *cr nfscl_start_renewthread(clp); } else { NFSUNLOCKCLSTATE(); - FREE((caddr_t)newclp, M_NFSCLCLIENT); + if (newclp != NULL) + FREE((caddr_t)newclp, M_NFSCLCLIENT); } NFSLOCKCLSTATE(); while ((clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID) == 0 && !igotlock) @@ -730,7 +739,7 @@ nfscl_getcl(vnode_t vp, struct ucred *cr if ((clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID) == 0) { if (!igotlock) panic("nfscl_clget"); - if (p == NULL) { + if (p == NULL || cred == NULL) { NFSLOCKCLSTATE(); nfsv4_unlock(&clp->nfsc_lock, 0); NFSUNLOCKCLSTATE(); @@ -762,8 +771,8 @@ nfscl_getcl(vnode_t vp, struct ucred *cr clidinusedelay = 120; trystalecnt = 3; do { - error = nfsrpc_setclient(VFSTONFS(vnode_mount(vp)), clp, - cred, p); + error = nfsrpc_setclient(VFSTONFS(vnode_mount(vp)), + clp, cred, p); if (error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_CLIDINUSE) { From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 19:56:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAF6C10656B5; Mon, 8 Jun 2009 19:56:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99B6A8FC08; Mon, 8 Jun 2009 19:56:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58JuNVZ041114; Mon, 8 Jun 2009 19:56:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58JuNd2041113; Mon, 8 Jun 2009 19:56:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906081956.n58JuNd2041113@svn.freebsd.org> From: Andrew Thompson Date: Mon, 8 Jun 2009 19:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193742 - head/sys/dev/if_ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 19:56:24 -0000 Author: thompsa Date: Mon Jun 8 19:56:23 2009 New Revision: 193742 URL: http://svn.freebsd.org/changeset/base/193742 Log: Commit missed driver_info to driver_ivar change in usb_attach_args. Pointed out by: kib Modified: head/sys/dev/if_ndis/if_ndis_usb.c Modified: head/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_usb.c Mon Jun 8 19:52:12 2009 (r193741) +++ head/sys/dev/if_ndis/if_ndis_usb.c Mon Jun 8 19:56:23 2009 (r193742) @@ -149,7 +149,7 @@ ndisusb_match(device_t self) db = windrv_match((matchfuncptr)ndisusb_devcompare, self); if (db == NULL) return (ENXIO); - uaa->driver_info = db; + uaa->driver_ivar = db; return (0); } @@ -165,7 +165,7 @@ ndisusb_attach(device_t self) driver_object *drv; int devidx = 0; - db = uaa->driver_info; + db = uaa->driver_ivar; sc = (struct ndis_softc *)dummy; sc->ndis_dev = self; mtx_init(&sc->ndisusb_mtx, "NDIS USB", MTX_NETWORK_LOCK, MTX_DEF); From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 19:57:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5890B10656FC; Mon, 8 Jun 2009 19:57:39 +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 438608FC27; Mon, 8 Jun 2009 19:57:39 +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 n58JvdHa041285; Mon, 8 Jun 2009 19:57:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58JvaVj041219; Mon, 8 Jun 2009 19:57:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906081957.n58JvaVj041219@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 8 Jun 2009 19:57: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: r193744 - in head/sys: compat/linprocfs compat/linux compat/svr4 contrib/altq/altq contrib/pf/net dev/cxgb/ulp/iw_cxgb kern modules/bridgestp modules/cxgb/iw_cxgb modules/if_ef modules/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 19:57:40 -0000 Author: bz Date: Mon Jun 8 19:57:35 2009 New Revision: 193744 URL: http://svn.freebsd.org/changeset/base/193744 Log: After r193232 rt_tables in vnet.h are no longer indirectly dependent on the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c. Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/svr4/svr4_sockio.c head/sys/contrib/altq/altq/altq_subr.c head/sys/contrib/pf/net/pf_if.c head/sys/contrib/pf/net/pf_ioctl.c head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c head/sys/kern/kern_poll.c head/sys/kern/kern_uuid.c head/sys/modules/bridgestp/Makefile head/sys/modules/cxgb/iw_cxgb/Makefile head/sys/modules/if_ef/Makefile head/sys/modules/if_vlan/Makefile head/sys/modules/ip_mroute_mod/Makefile head/sys/modules/ipfw/Makefile head/sys/modules/linprocfs/Makefile head/sys/modules/linux/Makefile head/sys/modules/netgraph/atm/atm/Makefile head/sys/modules/netgraph/ether/Makefile head/sys/modules/netgraph/gif/Makefile head/sys/modules/nfsclient/Makefile head/sys/modules/pf/Makefile head/sys/modules/svr4/Makefile head/sys/modules/wlan/Makefile head/sys/net/bridgestp.c head/sys/net/flowtable.h head/sys/net/if.c head/sys/net/if_ef.c head/sys/net/if_ethersubr.c head/sys/net/if_loop.c head/sys/net/if_mib.c head/sys/net/if_vlan.c head/sys/net/raw_cb.c head/sys/net/raw_usrreq.c head/sys/net/rtsock.c head/sys/net80211/ieee80211_ddb.c head/sys/netgraph/atm/ng_atm.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_gif.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_mcast.c head/sys/netinet/in_proto.c head/sys/netinet/in_rmx.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/raw_ip.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_output.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/scope6.c head/sys/netipsec/keysock.c head/sys/netipsec/xform_ipip.c head/sys/nfsclient/bootp_subr.c head/sys/nfsclient/nfs_diskless.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/compat/linprocfs/linprocfs.c Mon Jun 8 19:57:35 2009 (r193744) @@ -39,7 +39,6 @@ * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 */ -#include "opt_route.h" #include "opt_compat.h" #include Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/compat/linux/linux_ioctl.c Mon Jun 8 19:57:35 2009 (r193744) @@ -26,7 +26,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_route.h" #include "opt_compat.h" #include Modified: head/sys/compat/svr4/svr4_sockio.c ============================================================================== --- head/sys/compat/svr4/svr4_sockio.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/compat/svr4/svr4_sockio.c Mon Jun 8 19:57:35 2009 (r193744) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/contrib/altq/altq/altq_subr.c Mon Jun 8 19:57:35 2009 (r193744) @@ -32,7 +32,6 @@ #include "opt_inet.h" #ifdef __FreeBSD__ #include "opt_inet6.h" -#include "opt_route.h" #endif #endif /* __FreeBSD__ || __NetBSD__ */ Modified: head/sys/contrib/pf/net/pf_if.c ============================================================================== --- head/sys/contrib/pf/net/pf_if.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/contrib/pf/net/pf_if.c Mon Jun 8 19:57:35 2009 (r193744) @@ -35,7 +35,6 @@ #if defined(__FreeBSD__) #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_route.h" #include __FBSDID("$FreeBSD$"); Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/contrib/pf/net/pf_ioctl.c Mon Jun 8 19:57:35 2009 (r193744) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_route.h" #include "opt_bpf.h" #include "opt_pf.h" Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Mon Jun 8 19:57:35 2009 (r193744) @@ -29,8 +29,6 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/kern/kern_poll.c Mon Jun 8 19:57:35 2009 (r193744) @@ -28,7 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" #include "opt_device_polling.h" #include Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/kern/kern_uuid.c Mon Jun 8 19:57:35 2009 (r193744) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/modules/bridgestp/Makefile ============================================================================== --- head/sys/modules/bridgestp/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/bridgestp/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../net KMOD= bridgestp -SRCS= bridgestp.c opt_route.h +SRCS= bridgestp.c .include Modified: head/sys/modules/cxgb/iw_cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/iw_cxgb/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/cxgb/iw_cxgb/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -8,7 +8,7 @@ SRCS= iw_cxgb.c iw_cxgb_cm.c iw_cxgb_h SRCS+= iw_cxgb_provider.c iw_cxgb_qp.c iw_cxgb_resource.c SRCS+= iw_cxgb_ev.c iw_cxgb_mem.c iw_cxgb_dbg.c iw_cxgb_cq.c SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h -SRCS+= opt_inet.h opt_route.h +SRCS+= opt_inet.h CFLAGS+= -g -I${CXGB} #CFLAGS+= -DDEBUG Modified: head/sys/modules/if_ef/Makefile ============================================================================== --- head/sys/modules/if_ef/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/if_ef/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../net KMOD= if_ef -SRCS= if_ef.c opt_ipx.h opt_inet.h opt_ef.h opt_route.h +SRCS= if_ef.c opt_ipx.h opt_inet.h opt_ef.h .if defined(EFDEBUG) CFLAGS+= -DEF_DEBUG Modified: head/sys/modules/if_vlan/Makefile ============================================================================== --- head/sys/modules/if_vlan/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/if_vlan/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -4,6 +4,6 @@ KMOD= if_vlan SRCS= if_vlan.c -SRCS+= opt_inet.h opt_vlan.h opt_route.h +SRCS+= opt_inet.h opt_vlan.h .include Modified: head/sys/modules/ip_mroute_mod/Makefile ============================================================================== --- head/sys/modules/ip_mroute_mod/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/ip_mroute_mod/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -7,7 +7,7 @@ KMOD= ip_mroute SRCS= ip_mroute.c -SRCS+= opt_inet.h opt_mrouting.h opt_route.h +SRCS+= opt_inet.h opt_mrouting.h .if !defined(KERNBUILDDIR) opt_inet.h: Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/ipfw/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -6,7 +6,7 @@ KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c -SRCS+= opt_inet6.h opt_ipsec.h opt_route.h +SRCS+= opt_inet6.h opt_ipsec.h CFLAGS+= -DIPFIREWALL CFLAGS+= -I${.CURDIR}/../../contrib/pf Modified: head/sys/modules/linprocfs/Makefile ============================================================================== --- head/sys/modules/linprocfs/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/linprocfs/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -6,8 +6,7 @@ KMOD= linprocfs SRCS= vnode_if.h \ device_if.h bus_if.h \ linprocfs.c \ - opt_compat.h \ - opt_route.h + opt_compat.h .if ${MACHINE_ARCH} == "amd64" CFLAGS+=-DCOMPAT_LINUX32 Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/linux/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -13,7 +13,7 @@ SRCS= linux${SFX}_dummy.c linux_emul.c l linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ - opt_inet6.h opt_route.h opt_compat.h opt_posix.h vnode_if.h \ + opt_inet6.h opt_compat.h opt_posix.h vnode_if.h \ device_if.h bus_if.h assym.s # XXX: for assym.s Modified: head/sys/modules/netgraph/atm/atm/Makefile ============================================================================== --- head/sys/modules/netgraph/atm/atm/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/netgraph/atm/atm/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../../../../netgraph/atm KMOD= ng_atm -SRCS= ng_atm.c opt_route.h +SRCS= ng_atm.c # CFLAGS+= -DNGATM_DEBUG .include Modified: head/sys/modules/netgraph/ether/Makefile ============================================================================== --- head/sys/modules/netgraph/ether/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/netgraph/ether/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -1,6 +1,6 @@ # $FreeBSD$ KMOD= ng_ether -SRCS= ng_ether.c opt_route.h +SRCS= ng_ether.c .include Modified: head/sys/modules/netgraph/gif/Makefile ============================================================================== --- head/sys/modules/netgraph/gif/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/netgraph/gif/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -1,7 +1,7 @@ # $FreeBSD$ KMOD= ng_gif -SRCS= ng_gif.c opt_inet.h opt_inet6.h opt_route.h +SRCS= ng_gif.c opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) opt_inet.h: Modified: head/sys/modules/nfsclient/Makefile ============================================================================== --- head/sys/modules/nfsclient/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/nfsclient/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -7,7 +7,7 @@ SRCS= vnode_if.h \ nfs_bio.c nfs_lock.c nfs_node.c nfs_socket.c nfs_subs.c nfs_nfsiod.c \ nfs_vfsops.c nfs_vnops.c nfs_common.c nfs_krpc.c \ opt_inet.h opt_nfs.h opt_bootp.h opt_nfsroot.h -SRCS+= opt_inet6.h opt_kdtrace.h opt_kgssapi.h opt_route.h +SRCS+= opt_inet6.h opt_kdtrace.h opt_kgssapi.h .if !defined(KERNBUILDDIR) NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel Modified: head/sys/modules/pf/Makefile ============================================================================== --- head/sys/modules/pf/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/pf/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -9,7 +9,7 @@ KMOD= pf SRCS = pf.c pf_if.c pf_subr.c pf_osfp.c pf_ioctl.c pf_norm.c pf_table.c \ pf_ruleset.c \ in4_cksum.c \ - opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_route.h + opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h CFLAGS+= -I${.CURDIR}/../../contrib/pf Modified: head/sys/modules/svr4/Makefile ============================================================================== --- head/sys/modules/svr4/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/svr4/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -9,7 +9,7 @@ SRCS= svr4_sysent.c svr4_sysvec.c opt_co svr4_machdep.c svr4_resource.c svr4_ipc.c OBJS= svr4_locore.o -SRCS+= opt_ktrace.h opt_sysvipc.h opt_route.h +SRCS+= opt_ktrace.h opt_sysvipc.h CLEANFILES= svr4_assym.h svr4_genassym.o Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/modules/wlan/Makefile Mon Jun 8 19:57:35 2009 (r193744) @@ -10,8 +10,7 @@ SRCS= ieee80211.c ieee80211_crypto.c iee ieee80211_radiotap.c ieee80211_regdomain.c ieee80211_ht.c \ ieee80211_adhoc.c ieee80211_hostap.c ieee80211_monitor.c \ ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c -SRCS+= bus_if.h device_if.h opt_inet.h opt_ipx.h opt_wlan.h opt_ddb.h \ - opt_route.h +SRCS+= bus_if.h device_if.h opt_inet.h opt_ipx.h opt_wlan.h opt_ddb.h .if !defined(KERNBUILDDIR) opt_wlan.h: Modified: head/sys/net/bridgestp.c ============================================================================== --- head/sys/net/bridgestp.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/bridgestp.c Mon Jun 8 19:57:35 2009 (r193744) @@ -37,8 +37,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/net/flowtable.h ============================================================================== --- head/sys/net/flowtable.h Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/flowtable.h Mon Jun 8 19:57:35 2009 (r193744) @@ -33,8 +33,6 @@ $FreeBSD$ #define _NET_FLOWTABLE_H_ #ifdef _KERNEL -#include "opt_route.h" - #include #include Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/if.c Mon Jun 8 19:57:35 2009 (r193744) @@ -33,7 +33,6 @@ #include "opt_compat.h" #include "opt_inet6.h" #include "opt_inet.h" -#include "opt_route.h" #include "opt_carp.h" #include Modified: head/sys/net/if_ef.c ============================================================================== --- head/sys/net/if_ef.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/if_ef.c Mon Jun 8 19:57:35 2009 (r193744) @@ -29,7 +29,6 @@ #include "opt_inet.h" #include "opt_ipx.h" #include "opt_ef.h" -#include "opt_route.h" #include #include Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/if_ethersubr.c Mon Jun 8 19:57:35 2009 (r193744) @@ -34,7 +34,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#include "opt_route.h" #include "opt_netgraph.h" #include "opt_carp.h" #include "opt_mbuf_profiling.h" Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/if_loop.c Mon Jun 8 19:57:35 2009 (r193744) @@ -38,7 +38,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#include "opt_route.h" #include #include Modified: head/sys/net/if_mib.c ============================================================================== --- head/sys/net/if_mib.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/if_mib.c Mon Jun 8 19:57:35 2009 (r193744) @@ -29,8 +29,6 @@ * $FreeBSD$ */ -#include "opt_route.h" - #include #include #include Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/if_vlan.c Mon Jun 8 19:57:35 2009 (r193744) @@ -41,7 +41,6 @@ * and ask it to send them. */ -#include "opt_route.h" #include "opt_vlan.h" #include Modified: head/sys/net/raw_cb.c ============================================================================== --- head/sys/net/raw_cb.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/raw_cb.c Mon Jun 8 19:57:35 2009 (r193744) @@ -31,8 +31,6 @@ * $FreeBSD$ */ -#include "opt_route.h" - #include #include #include Modified: head/sys/net/raw_usrreq.c ============================================================================== --- head/sys/net/raw_usrreq.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/raw_usrreq.c Mon Jun 8 19:57:35 2009 (r193744) @@ -31,8 +31,6 @@ * $FreeBSD$ */ -#include "opt_route.h" - #include #include #include Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net/rtsock.c Mon Jun 8 19:57:35 2009 (r193744) @@ -31,7 +31,6 @@ */ #include "opt_sctp.h" #include "opt_mpath.h" -#include "opt_route.h" #include "opt_inet.h" #include "opt_inet6.h" Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/net80211/ieee80211_ddb.c Mon Jun 8 19:57:35 2009 (r193744) @@ -27,7 +27,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_route.h" #include "opt_wlan.h" #ifdef DDB Modified: head/sys/netgraph/atm/ng_atm.c ============================================================================== --- head/sys/netgraph/atm/ng_atm.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netgraph/atm/ng_atm.c Mon Jun 8 19:57:35 2009 (r193744) @@ -34,8 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netgraph/ng_ether.c Mon Jun 8 19:57:35 2009 (r193744) @@ -46,8 +46,6 @@ * ng_ether(4) netgraph node type */ -#include "opt_route.h" - #include #include #include Modified: head/sys/netgraph/ng_gif.c ============================================================================== --- head/sys/netgraph/ng_gif.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netgraph/ng_gif.c Mon Jun 8 19:57:35 2009 (r193744) @@ -68,8 +68,6 @@ /* * ng_gif(4) netgraph node type */ -#include "opt_route.h" - #include #include #include Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/if_ether.c Mon Jun 8 19:57:35 2009 (r193744) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_route.h" #include "opt_carp.h" #include Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/igmp.c Mon Jun 8 19:57:35 2009 (r193744) @@ -50,8 +50,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/in.c Mon Jun 8 19:57:35 2009 (r193744) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_carp.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/in_mcast.c Mon Jun 8 19:57:35 2009 (r193744) @@ -35,8 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/in_proto.c Mon Jun 8 19:57:35 2009 (r193744) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_mrouting.h" #include "opt_ipsec.h" #include "opt_inet6.h" -#include "opt_route.h" #include "opt_pf.h" #include "opt_carp.h" #include "opt_sctp.h" Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/in_rmx.c Mon Jun 8 19:57:35 2009 (r193744) @@ -43,8 +43,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/ipfw/ip_fw2.c Mon Jun 8 19:57:35 2009 (r193744) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #endif #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/raw_ip.c Mon Jun 8 19:57:35 2009 (r193744) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet/sctp_os_bsd.h Mon Jun 8 19:57:35 2009 (r193744) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_inet6.h" #include "opt_inet.h" -#include "opt_route.h" #include "opt_sctp.h" #include Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/icmp6.c Mon Jun 8 19:57:35 2009 (r193744) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/in6.c Mon Jun 8 19:57:35 2009 (r193744) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/in6_ifattach.c Mon Jun 8 19:57:35 2009 (r193744) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/in6_mcast.c Mon Jun 8 19:57:35 2009 (r193744) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/in6_proto.c Mon Jun 8 19:57:35 2009 (r193744) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_ipsec.h" #include "opt_ipstealth.h" -#include "opt_route.h" #include "opt_carp.h" #include "opt_sctp.h" #include "opt_mpath.h" Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/in6_rmx.c Mon Jun 8 19:57:35 2009 (r193744) @@ -75,8 +75,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/ip6_input.c Mon Jun 8 19:57:35 2009 (r193744) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/ip6_mroute.c Mon Jun 8 19:57:35 2009 (r193744) @@ -83,7 +83,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/ip6_output.c Mon Jun 8 19:57:35 2009 (r193744) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/nd6.c Mon Jun 8 19:57:35 2009 (r193744) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/nd6_rtr.c Mon Jun 8 19:57:35 2009 (r193744) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/raw_ip6.c Mon Jun 8 19:57:35 2009 (r193744) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" #include "opt_inet6.h" -#include "opt_route.h" #include #include Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netinet6/scope6.c Mon Jun 8 19:57:35 2009 (r193744) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" - #include #include #include Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netipsec/keysock.c Mon Jun 8 19:57:35 2009 (r193744) @@ -31,7 +31,6 @@ */ #include "opt_ipsec.h" -#include "opt_route.h" /* This code has derived from sys/net/rtsock.c on FreeBSD2.2.5 */ Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/netipsec/xform_ipip.c Mon Jun 8 19:57:35 2009 (r193744) @@ -41,7 +41,6 @@ */ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_route.h" #include "opt_enc.h" #include Modified: head/sys/nfsclient/bootp_subr.c ============================================================================== --- head/sys/nfsclient/bootp_subr.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/nfsclient/bootp_subr.c Mon Jun 8 19:57:35 2009 (r193744) @@ -43,7 +43,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" #include "opt_bootp.h" #include Modified: head/sys/nfsclient/nfs_diskless.c ============================================================================== --- head/sys/nfsclient/nfs_diskless.c Mon Jun 8 19:56:50 2009 (r193743) +++ head/sys/nfsclient/nfs_diskless.c Mon Jun 8 19:57:35 2009 (r193744) @@ -35,7 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_route.h" #include "opt_bootp.h" #include From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 20:04:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7321E106564A; Mon, 8 Jun 2009 20:04:46 +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 627A78FC12; Mon, 8 Jun 2009 20:04:46 +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 n58K4krt041783; Mon, 8 Jun 2009 20:04:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58K4kT1041782; Mon, 8 Jun 2009 20:04:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906082004.n58K4kT1041782@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 8 Jun 2009 20:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193748 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 20:04:46 -0000 Author: bz Date: Mon Jun 8 20:04:46 2009 New Revision: 193748 URL: http://svn.freebsd.org/changeset/base/193748 Log: Remove two unneeded, hidden includes. Modified: head/sys/net/flowtable.h Modified: head/sys/net/flowtable.h ============================================================================== --- head/sys/net/flowtable.h Mon Jun 8 20:04:36 2009 (r193747) +++ head/sys/net/flowtable.h Mon Jun 8 20:04:46 2009 (r193748) @@ -33,8 +33,6 @@ $FreeBSD$ #define _NET_FLOWTABLE_H_ #ifdef _KERNEL -#include -#include #define FL_HASH_PORTS (1<<0) /* hash 4-tuple + protocol */ #define FL_PCPU (1<<1) /* pcpu cache */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 20:07:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DC301065675; Mon, 8 Jun 2009 20:07:17 +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 1A6BE8FC08; Mon, 8 Jun 2009 20:07:17 +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 n58K7HL1041948; Mon, 8 Jun 2009 20:07:17 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58K7GX5041943; Mon, 8 Jun 2009 20:07:16 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906082007.n58K7GX5041943@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 8 Jun 2009 20:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193750 - in head/sys: amd64/conf conf contrib/dev/acpica/include/platform dev/acpica/Osd i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 20:07:17 -0000 Author: jkim Date: Mon Jun 8 20:07:16 2009 New Revision: 193750 URL: http://svn.freebsd.org/changeset/base/193750 Log: Rewrite OsdSynch.c to reflect the latest ACPICA more closely: - Implement ACPI semaphore (ACPI_SEMAPHORE) with condvar(9) and mutex(9). - Implement ACPI mutex (ACPI_MUTEX) with mutex(9). - Implement ACPI lock (ACPI_SPINLOCK) with spin mutex(9). Modified: head/sys/amd64/conf/NOTES head/sys/conf/options head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/dev/acpica/Osd/OsdSynch.c head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Jun 8 20:07:12 2009 (r193749) +++ head/sys/amd64/conf/NOTES Mon Jun 8 20:07:16 2009 (r193750) @@ -237,12 +237,9 @@ device tdfx # Enable 3Dfx Voodoo supp # kernel environment variables to select initial debugging levels for the # Intel ACPICA code. (Note that the Intel code must also have USE_DEBUGGER # defined when it is built). -# -# ACPI_NO_SEMAPHORES makes the AcpiOs*Semaphore routines a no-op. device acpi options ACPI_DEBUG -#!options ACPI_NO_SEMAPHORES # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jun 8 20:07:12 2009 (r193749) +++ head/sys/conf/options Mon Jun 8 20:07:16 2009 (r193750) @@ -664,7 +664,6 @@ WITNESS_SKIPSPIN opt_witness.h # options for ACPI support ACPI_DEBUG opt_acpi.h ACPI_MAX_THREADS opt_acpi.h -ACPI_NO_SEMAPHORES opt_acpi.h # ISA support DEV_ISA opt_isa.h Modified: head/sys/contrib/dev/acpica/include/platform/acfreebsd.h ============================================================================== --- head/sys/contrib/dev/acpica/include/platform/acfreebsd.h Mon Jun 8 20:07:12 2009 (r193749) +++ head/sys/contrib/dev/acpica/include/platform/acfreebsd.h Mon Jun 8 20:07:16 2009 (r193750) @@ -140,6 +140,7 @@ #include "opt_acpi.h" #define ACPI_THREAD_ID lwpid_t +#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX #ifdef ACPI_DEBUG #define ACPI_DEBUG_OUTPUT /* for backward compatibility */ Modified: head/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSynch.c Mon Jun 8 20:07:12 2009 (r193749) +++ head/sys/dev/acpica/Osd/OsdSynch.c Mon Jun 8 20:07:16 2009 (r193750) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2000 Michael Smith * Copyright (c) 2000 BSDi + * Copyright (c) 2007-2009 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,366 +36,543 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_acpi.h" +#include #include -#include -#include #include +#include #include -#define _COMPONENT ACPI_OS_SERVICES +#define _COMPONENT ACPI_OS_SERVICES ACPI_MODULE_NAME("SYNCH") MALLOC_DEFINE(M_ACPISEM, "acpisem", "ACPI semaphore"); -#define AS_LOCK(as) mtx_lock(&(as)->as_mtx) -#define AS_UNLOCK(as) mtx_unlock(&(as)->as_mtx) - /* - * Simple counting semaphore implemented using a mutex. (Subsequently used - * in the OSI code to implement a mutex. Go figure.) + * Convert milliseconds to ticks. */ -struct acpi_semaphore { - struct mtx as_mtx; - UINT32 as_units; - UINT32 as_maxunits; - UINT32 as_pendings; - UINT32 as_resetting; - UINT32 as_timeouts; -}; +static int +timeout2hz(UINT16 Timeout) +{ + struct timeval tv; -/* Default number of maximum pending threads. */ -#ifndef ACPI_NO_SEMAPHORES -#ifndef ACPI_SEMAPHORES_MAX_PENDING -#define ACPI_SEMAPHORES_MAX_PENDING 4 -#endif + tv.tv_sec = (time_t)(Timeout / 1000); + tv.tv_usec = (suseconds_t)(Timeout % 1000) * 1000; -static int acpi_semaphore_debug = 0; -TUNABLE_INT("debug.acpi_semaphore_debug", &acpi_semaphore_debug); -SYSCTL_DECL(_debug_acpi); -SYSCTL_INT(_debug_acpi, OID_AUTO, semaphore_debug, CTLFLAG_RW, - &acpi_semaphore_debug, 0, "Enable ACPI semaphore debug messages"); -#endif /* !ACPI_NO_SEMAPHORES */ + return (tvtohz(&tv)); +} + +/* + * ACPI_SEMAPHORE + */ +struct acpi_sema { + struct mtx as_lock; + char as_name[32]; + struct cv as_cv; + UINT32 as_maxunits; + UINT32 as_units; + int as_waiters; + int as_reset; +}; ACPI_STATUS AcpiOsCreateSemaphore(UINT32 MaxUnits, UINT32 InitialUnits, ACPI_SEMAPHORE *OutHandle) { -#ifndef ACPI_NO_SEMAPHORES - struct acpi_semaphore *as; + struct acpi_sema *as; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + if (OutHandle == NULL || MaxUnits == 0 || InitialUnits > MaxUnits) + return_ACPI_STATUS (AE_BAD_PARAMETER); - if (OutHandle == NULL) - return_ACPI_STATUS (AE_BAD_PARAMETER); - if (InitialUnits > MaxUnits) - return_ACPI_STATUS (AE_BAD_PARAMETER); - - if ((as = malloc(sizeof(*as), M_ACPISEM, M_NOWAIT | M_ZERO)) == NULL) - return_ACPI_STATUS (AE_NO_MEMORY); - - mtx_init(&as->as_mtx, "ACPI semaphore", NULL, MTX_DEF); - as->as_units = InitialUnits; - as->as_maxunits = MaxUnits; - as->as_pendings = as->as_resetting = as->as_timeouts = 0; - - ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, - "created semaphore %p max %d, initial %d\n", - as, InitialUnits, MaxUnits)); - - *OutHandle = (ACPI_HANDLE)as; -#else - *OutHandle = (ACPI_HANDLE)OutHandle; -#endif /* !ACPI_NO_SEMAPHORES */ + if ((as = malloc(sizeof(*as), M_ACPISEM, M_NOWAIT | M_ZERO)) == NULL) + return_ACPI_STATUS (AE_NO_MEMORY); - return_ACPI_STATUS (AE_OK); + snprintf(as->as_name, sizeof(as->as_name), "ACPI sema (%p)", as); + mtx_init(&as->as_lock, as->as_name, NULL, MTX_DEF); + cv_init(&as->as_cv, as->as_name); + as->as_maxunits = MaxUnits; + as->as_units = InitialUnits; + + *OutHandle = (ACPI_SEMAPHORE)as; + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "created %s, max %u, initial %u\n", + as->as_name, MaxUnits, InitialUnits)); + + return_ACPI_STATUS (AE_OK); } ACPI_STATUS AcpiOsDeleteSemaphore(ACPI_SEMAPHORE Handle) { -#ifndef ACPI_NO_SEMAPHORES - struct acpi_semaphore *as = (struct acpi_semaphore *)Handle; + struct acpi_sema *as = (struct acpi_sema *)Handle; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + if (as == NULL) + return_ACPI_STATUS (AE_BAD_PARAMETER); - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + mtx_lock(&as->as_lock); - ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "destroyed semaphore %p\n", as)); - mtx_destroy(&as->as_mtx); - free(Handle, M_ACPISEM); -#endif /* !ACPI_NO_SEMAPHORES */ + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "delete %s\n", as->as_name)); + + if (as->as_waiters > 0) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "reset %s, units %u, waiters %d\n", + as->as_name, as->as_units, as->as_waiters)); + as->as_reset = 1; + cv_broadcast(&as->as_cv); + while (as->as_waiters > 0) { + if (mtx_sleep(&as->as_reset, &as->as_lock, + PCATCH, "acsrst", hz) == EINTR) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "failed to reset %s, waiters %d\n", + as->as_name, as->as_waiters)); + mtx_unlock(&as->as_lock); + return_ACPI_STATUS (AE_ERROR); + } + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "wait %s, units %u, waiters %d\n", + as->as_name, as->as_units, as->as_waiters)); + } + } + + mtx_unlock(&as->as_lock); + + mtx_destroy(&as->as_lock); + cv_destroy(&as->as_cv); + free(as, M_ACPISEM); - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (AE_OK); } -/* - * This implementation has a bug, in that it has to stall for the entire - * timeout before it will return AE_TIME. A better implementation would - * use getmicrotime() to correctly adjust the timeout after being woken up. - */ +#define ACPISEM_AVAIL(s, u) ((s)->as_units >= (u)) + ACPI_STATUS AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handle, UINT32 Units, UINT16 Timeout) { -#ifndef ACPI_NO_SEMAPHORES - ACPI_STATUS result; - struct acpi_semaphore *as = (struct acpi_semaphore *)Handle; - int rv, tmo; - struct timeval timeouttv, currenttv, timelefttv; - - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + struct acpi_sema *as = (struct acpi_sema *)Handle; + int error, prevtick, slptick, tmo; + ACPI_STATUS status = AE_OK; - if (as == NULL) - return_ACPI_STATUS (AE_BAD_PARAMETER); + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - if (cold) - return_ACPI_STATUS (AE_OK); + if (as == NULL || Units == 0) + return_ACPI_STATUS (AE_BAD_PARAMETER); -#if 0 - if (as->as_units < Units && as->as_timeouts > 10) { - printf("%s: semaphore %p too many timeouts, resetting\n", __func__, as); - AS_LOCK(as); - as->as_units = as->as_maxunits; - if (as->as_pendings) - as->as_resetting = 1; - as->as_timeouts = 0; - wakeup(as); - AS_UNLOCK(as); - return_ACPI_STATUS (AE_TIME); - } + mtx_lock(&as->as_lock); - if (as->as_resetting) - return_ACPI_STATUS (AE_TIME); -#endif + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "get %u unit(s) from %s, units %u, waiters %d, timeout %u\n", + Units, as->as_name, as->as_units, as->as_waiters, Timeout)); - /* a timeout of ACPI_WAIT_FOREVER means "forever" */ - if (Timeout == ACPI_WAIT_FOREVER) { - tmo = 0; - timeouttv.tv_sec = ((0xffff/1000) + 1); /* cf. ACPI spec */ - timeouttv.tv_usec = 0; - } else { - /* compute timeout using microseconds per tick */ - tmo = (Timeout * 1000) / (1000000 / hz); - if (tmo <= 0) - tmo = 1; - timeouttv.tv_sec = Timeout / 1000; - timeouttv.tv_usec = (Timeout % 1000) * 1000; - } - - /* calculate timeout value in timeval */ - getmicrotime(¤ttv); - timevaladd(&timeouttv, ¤ttv); - - AS_LOCK(as); - ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, - "get %d units from semaphore %p (has %d), timeout %d\n", - Units, as, as->as_units, Timeout)); - for (;;) { - if (as->as_maxunits == ACPI_NO_UNIT_LIMIT) { - result = AE_OK; - break; - } - if (as->as_units >= Units) { - as->as_units -= Units; - result = AE_OK; - break; - } - - /* limit number of pending threads */ - if (as->as_pendings >= ACPI_SEMAPHORES_MAX_PENDING) { - result = AE_TIME; - break; - } - - /* if timeout values of zero is specified, return immediately */ - if (Timeout == 0) { - result = AE_TIME; - break; + if (as->as_maxunits != ACPI_NO_UNIT_LIMIT && as->as_maxunits < Units) { + mtx_unlock(&as->as_lock); + return_ACPI_STATUS (AE_LIMIT); + } + + switch (Timeout) { + case ACPI_DO_NOT_WAIT: + if (!ACPISEM_AVAIL(as, Units)) + status = AE_TIME; + break; + case ACPI_WAIT_FOREVER: + while (!ACPISEM_AVAIL(as, Units)) { + as->as_waiters++; + error = cv_wait_sig(&as->as_cv, &as->as_lock); + as->as_waiters--; + if (error == EINTR || as->as_reset) { + status = AE_ERROR; + break; + } + if (ACPISEM_AVAIL(as, Units)) + break; + } + break; + default: + tmo = timeout2hz(Timeout); + while (!ACPISEM_AVAIL(as, Units)) { + prevtick = ticks; + as->as_waiters++; + error = cv_timedwait_sig(&as->as_cv, &as->as_lock, tmo); + as->as_waiters--; + if (error == EINTR || as->as_reset) { + status = AE_ERROR; + break; + } + if (ACPISEM_AVAIL(as, Units)) + break; + slptick = ticks - prevtick; + if (slptick >= tmo || slptick < 0) { + status = AE_TIME; + break; + } + tmo -= slptick; + } } + if (status == AE_OK) + as->as_units -= Units; - ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, - "semaphore blocked, calling msleep(%p, %p, %d, \"acsem\", %d)\n", - as, &as->as_mtx, PCATCH, tmo)); + mtx_unlock(&as->as_lock); + + return_ACPI_STATUS (status); +} + +ACPI_STATUS +AcpiOsSignalSemaphore(ACPI_SEMAPHORE Handle, UINT32 Units) +{ + struct acpi_sema *as = (struct acpi_sema *)Handle; + UINT32 i; - as->as_pendings++; + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - if (acpi_semaphore_debug) { - printf("%s: Sleep %d, pending %d, semaphore %p, thread %d\n", - __func__, Timeout, as->as_pendings, as, AcpiOsGetThreadId()); + if (as == NULL || Units == 0) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + mtx_lock(&as->as_lock); + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "return %u units to %s, units %u, waiters %d\n", + Units, as->as_name, as->as_units, as->as_waiters)); + + if (as->as_maxunits != ACPI_NO_UNIT_LIMIT && + (as->as_maxunits < Units || + as->as_maxunits - Units < as->as_units)) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "exceeded max units %u\n", as->as_maxunits)); + mtx_unlock(&as->as_lock); + return_ACPI_STATUS (AE_LIMIT); } - rv = msleep(as, &as->as_mtx, PCATCH, "acsem", tmo); + as->as_units += Units; + if (as->as_waiters > 0 && ACPISEM_AVAIL(as, Units)) + for (i = 0; i < Units; i++) + cv_signal(&as->as_cv); + + mtx_unlock(&as->as_lock); + + return_ACPI_STATUS (AE_OK); +} + +#undef ACPISEM_AVAIL + +/* + * ACPI_MUTEX + */ +struct acpi_mutex { + struct mtx am_lock; + char am_name[32]; + struct thread *am_owner; + int am_nested; + int am_waiters; + int am_reset; +}; + +ACPI_STATUS +AcpiOsCreateMutex(ACPI_MUTEX *OutHandle) +{ + struct acpi_mutex *am; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + if (OutHandle == NULL) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + if ((am = malloc(sizeof(*am), M_ACPISEM, M_NOWAIT | M_ZERO)) == NULL) + return_ACPI_STATUS (AE_NO_MEMORY); + + snprintf(am->am_name, sizeof(am->am_name), "ACPI mutex (%p)", am); + mtx_init(&am->am_lock, am->am_name, NULL, MTX_DEF); + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "created %s\n", am->am_name)); + + *OutHandle = (ACPI_MUTEX)am; + + return_ACPI_STATUS (AE_OK); +} + +#define ACPIMTX_AVAIL(m) ((m)->am_owner == NULL) +#define ACPIMTX_OWNED(m) ((m)->am_owner == curthread) + +void +AcpiOsDeleteMutex(ACPI_MUTEX Handle) +{ + struct acpi_mutex *am = (struct acpi_mutex *)Handle; - as->as_pendings--; + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); -#if 0 - if (as->as_resetting) { - /* semaphore reset, return immediately */ - if (as->as_pendings == 0) { - as->as_resetting = 0; - } - result = AE_TIME; - break; + if (am == NULL) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "cannot delete null mutex\n")); + return_VOID; + } + + mtx_lock(&am->am_lock); + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "delete %s\n", am->am_name)); + + if (am->am_waiters > 0) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "reset %s, owner %p\n", am->am_name, am->am_owner)); + am->am_reset = 1; + wakeup(am); + while (am->am_waiters > 0) { + if (mtx_sleep(&am->am_reset, &am->am_lock, + PCATCH, "acmrst", hz) == EINTR) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "failed to reset %s, waiters %d\n", + am->am_name, am->am_waiters)); + mtx_unlock(&am->am_lock); + return_VOID; + } + if (ACPIMTX_AVAIL(am)) + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "wait %s, waiters %d\n", + am->am_name, am->am_waiters)); + else + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "wait %s, owner %p, waiters %d\n", + am->am_name, am->am_owner, am->am_waiters)); + } } -#endif - ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "msleep(%d) returned %d\n", tmo, rv)); - if (rv == EWOULDBLOCK) { - result = AE_TIME; - break; - } - - /* check if we already awaited enough */ - timelefttv = timeouttv; - getmicrotime(¤ttv); - timevalsub(&timelefttv, ¤ttv); - if (timelefttv.tv_sec < 0) { - ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "await semaphore %p timeout\n", - as)); - result = AE_TIME; - break; - } - - /* adjust timeout for the next sleep */ - tmo = (timelefttv.tv_sec * 1000000 + timelefttv.tv_usec) / - (1000000 / hz); - if (tmo <= 0) - tmo = 1; - - if (acpi_semaphore_debug) { - printf("%s: Wakeup timeleft(%jd, %lu), tmo %u, sem %p, thread %d\n", - __func__, (intmax_t)timelefttv.tv_sec, timelefttv.tv_usec, tmo, as, - AcpiOsGetThreadId()); - } - } - - if (acpi_semaphore_debug) { - if (result == AE_TIME && Timeout > 0) { - printf("%s: Timeout %d, pending %d, semaphore %p\n", - __func__, Timeout, as->as_pendings, as); - } - if (result == AE_OK && (as->as_timeouts > 0 || as->as_pendings > 0)) { - printf("%s: Acquire %d, units %d, pending %d, sem %p, thread %d\n", - __func__, Units, as->as_units, as->as_pendings, as, - AcpiOsGetThreadId()); - } - } - - if (result == AE_TIME) - as->as_timeouts++; - else - as->as_timeouts = 0; - - AS_UNLOCK(as); - return_ACPI_STATUS (result); -#else - return_ACPI_STATUS (AE_OK); -#endif /* !ACPI_NO_SEMAPHORES */ + mtx_unlock(&am->am_lock); + + mtx_destroy(&am->am_lock); + free(am, M_ACPISEM); } ACPI_STATUS -AcpiOsSignalSemaphore(ACPI_SEMAPHORE Handle, UINT32 Units) +AcpiOsAcquireMutex(ACPI_MUTEX Handle, UINT16 Timeout) { -#ifndef ACPI_NO_SEMAPHORES - struct acpi_semaphore *as = (struct acpi_semaphore *)Handle; + struct acpi_mutex *am = (struct acpi_mutex *)Handle; + int error, prevtick, slptick, tmo; + ACPI_STATUS status = AE_OK; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + if (am == NULL) + return_ACPI_STATUS (AE_BAD_PARAMETER); + + mtx_lock(&am->am_lock); + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "acquire %s\n", am->am_name)); + + if (ACPIMTX_OWNED(am)) { + am->am_nested++; + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "acquire nested %s, depth %d\n", + am->am_name, am->am_nested)); + mtx_unlock(&am->am_lock); + return_ACPI_STATUS (AE_OK); + } + + switch (Timeout) { + case ACPI_DO_NOT_WAIT: + if (!ACPIMTX_AVAIL(am)) + status = AE_TIME; + break; + case ACPI_WAIT_FOREVER: + while (!ACPIMTX_AVAIL(am)) { + am->am_waiters++; + error = mtx_sleep(am, &am->am_lock, PCATCH, "acmtx", 0); + am->am_waiters--; + if (error == EINTR || am->am_reset) { + status = AE_ERROR; + break; + } + if (ACPIMTX_AVAIL(am)) + break; + } + break; + default: + tmo = timeout2hz(Timeout); + while (!ACPIMTX_AVAIL(am)) { + prevtick = ticks; + am->am_waiters++; + error = mtx_sleep(am, &am->am_lock, PCATCH, + "acmtx", tmo); + am->am_waiters--; + if (error == EINTR || am->am_reset) { + status = AE_ERROR; + break; + } + if (ACPIMTX_AVAIL(am)) + break; + slptick = ticks - prevtick; + if (slptick >= tmo || slptick < 0) { + status = AE_TIME; + break; + } + tmo -= slptick; + } + } + if (status == AE_OK) + am->am_owner = curthread; - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + mtx_unlock(&am->am_lock); - if (as == NULL) - return_ACPI_STATUS(AE_BAD_PARAMETER); + return_ACPI_STATUS (status); +} - AS_LOCK(as); - ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, - "return %d units to semaphore %p (has %d)\n", - Units, as, as->as_units)); - if (as->as_maxunits != ACPI_NO_UNIT_LIMIT) { - as->as_units += Units; - if (as->as_units > as->as_maxunits) - as->as_units = as->as_maxunits; - } +void +AcpiOsReleaseMutex(ACPI_MUTEX Handle) +{ + struct acpi_mutex *am = (struct acpi_mutex *)Handle; - if (acpi_semaphore_debug && (as->as_timeouts > 0 || as->as_pendings > 0)) { - printf("%s: Release %d, units %d, pending %d, semaphore %p, thread %d\n", - __func__, Units, as->as_units, as->as_pendings, as, AcpiOsGetThreadId()); - } + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - wakeup(as); - AS_UNLOCK(as); -#endif /* !ACPI_NO_SEMAPHORES */ + if (am == NULL) + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "cannot release null mutex\n")); + + mtx_lock(&am->am_lock); + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "release %s\n", am->am_name)); + + if (ACPIMTX_OWNED(am)) { + if (am->am_nested > 0) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "release nested %s, depth %d\n", + am->am_name, am->am_nested)); + am->am_nested--; + } else + am->am_owner = NULL; + } else { + if (ACPIMTX_AVAIL(am)) + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "release already available %s\n", am->am_name)); + else + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "release unowned %s from %p, depth %d\n", + am->am_name, am->am_owner, am->am_nested)); + } + if (am->am_waiters > 0 && ACPIMTX_AVAIL(am)) + wakeup_one(am); - return_ACPI_STATUS (AE_OK); + mtx_unlock(&am->am_lock); } -/* Combined mutex + mutex name storage since the latter must persist. */ +#undef ACPIMTX_AVAIL +#undef ACPIMTX_OWNED + +/* + * ACPI_SPINLOCK + */ struct acpi_spinlock { - struct mtx lock; - char name[32]; + struct mtx al_lock; + char al_name[32]; + int al_nested; }; ACPI_STATUS -AcpiOsCreateLock (ACPI_SPINLOCK *OutHandle) +AcpiOsCreateLock(ACPI_SPINLOCK *OutHandle) { - struct acpi_spinlock *h; + struct acpi_spinlock *al; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + if (OutHandle == NULL) + return_ACPI_STATUS (AE_BAD_PARAMETER); - if (OutHandle == NULL) - return (AE_BAD_PARAMETER); - h = malloc(sizeof(*h), M_ACPISEM, M_NOWAIT | M_ZERO); - if (h == NULL) - return (AE_NO_MEMORY); - - /* Build a unique name based on the address of the handle. */ - if (OutHandle == &AcpiGbl_GpeLock) - snprintf(h->name, sizeof(h->name), "acpi subsystem GPE lock"); - else if (OutHandle == &AcpiGbl_HardwareLock) - snprintf(h->name, sizeof(h->name), "acpi subsystem HW lock"); - else - snprintf(h->name, sizeof(h->name), "acpi subsys %p", OutHandle); - mtx_init(&h->lock, h->name, NULL, MTX_DEF|MTX_RECURSE); - *OutHandle = (ACPI_SPINLOCK)h; - return (AE_OK); + if ((al = malloc(sizeof(*al), M_ACPISEM, M_NOWAIT | M_ZERO)) == NULL) + return_ACPI_STATUS (AE_NO_MEMORY); + +#ifdef ACPI_DEBUG + if (OutHandle == &AcpiGbl_GpeLock) + snprintf(al->al_name, sizeof(al->al_name), "ACPI lock (GPE)"); + else if (OutHandle == &AcpiGbl_HardwareLock) + snprintf(al->al_name, sizeof(al->al_name), "ACPI lock (HW)"); + else +#endif + snprintf(al->al_name, sizeof(al->al_name), "ACPI lock (%p)", al); + mtx_init(&al->al_lock, al->al_name, NULL, MTX_SPIN); + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "created %s\n", al->al_name)); + + *OutHandle = (ACPI_SPINLOCK)al; + + return_ACPI_STATUS (AE_OK); } void -AcpiOsDeleteLock (ACPI_SPINLOCK Handle) +AcpiOsDeleteLock(ACPI_SPINLOCK Handle) { - struct acpi_spinlock *h = (struct acpi_spinlock *)Handle; + struct acpi_spinlock *al = (struct acpi_spinlock *)Handle; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - if (Handle == NULL) - return; - mtx_destroy(&h->lock); - free(h, M_ACPISEM); + if (al == NULL) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "cannot delete null spinlock\n")); + return_VOID; + } + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "delete %s\n", al->al_name)); + + mtx_destroy(&al->al_lock); + free(al, M_ACPISEM); } -/* - * The Flags parameter seems to state whether or not caller is an ISR - * (and thus can't block) but since we have ithreads, we don't worry - * about potentially blocking. - */ ACPI_CPU_FLAGS -AcpiOsAcquireLock (ACPI_SPINLOCK Handle) +AcpiOsAcquireLock(ACPI_SPINLOCK Handle) { - struct acpi_spinlock *h = (struct acpi_spinlock *)Handle; + struct acpi_spinlock *al = (struct acpi_spinlock *)Handle; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + if (al == NULL) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "cannot acquire null spinlock\n")); + return (0); + } + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "acquire %s\n", al->al_name)); + + if (mtx_owned(&al->al_lock)) { + al->al_nested++; + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "acquire nested %s, depth %d\n", + al->al_name, al->al_nested)); + } else + mtx_lock_spin(&al->al_lock); - if (Handle == NULL) return (0); - mtx_lock(&h->lock); - return (0); } void -AcpiOsReleaseLock (ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags) +AcpiOsReleaseLock(ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags) { - struct acpi_spinlock *h = (struct acpi_spinlock *)Handle; + struct acpi_spinlock *al = (struct acpi_spinlock *)Handle; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - if (Handle == NULL) - return; - mtx_unlock(&h->lock); + if (al == NULL) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "cannot release null spinlock\n")); + return_VOID; + } + + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "release %s\n", al->al_name)); + + if (mtx_owned(&al->al_lock)) { + if (al->al_nested > 0) { + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "release nested %s, depth %d\n", + al->al_name, al->al_nested)); + al->al_nested--; + } else + mtx_unlock_spin(&al->al_lock); + } else + ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, + "cannot release unowned %s\n", al->al_name)); } -/* Section 5.2.9.1: global lock acquire/release functions */ -#define GL_ACQUIRED (-1) -#define GL_BUSY 0 -#define GL_BIT_PENDING 0x1 -#define GL_BIT_OWNED 0x2 -#define GL_BIT_MASK (GL_BIT_PENDING | GL_BIT_OWNED) +/* Section 5.2.10.1: global lock acquire/release functions */ +#define GL_ACQUIRED (-1) +#define GL_BUSY 0 +#define GL_BIT_PENDING 0x01 +#define GL_BIT_OWNED 0x02 +#define GL_BIT_MASK (GL_BIT_PENDING | GL_BIT_OWNED) /* * Acquire the global lock. If busy, set the pending bit. The caller @@ -404,7 +582,7 @@ AcpiOsReleaseLock (ACPI_SPINLOCK Handle, int acpi_acquire_global_lock(uint32_t *lock) { - uint32_t new, old; + uint32_t new, old; do { old = *lock; @@ -423,7 +601,7 @@ acpi_acquire_global_lock(uint32_t *lock) int acpi_release_global_lock(uint32_t *lock) { - uint32_t new, old; + uint32_t new, old; do { old = *lock; Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Jun 8 20:07:12 2009 (r193749) +++ head/sys/i386/conf/NOTES Mon Jun 8 20:07:16 2009 (r193750) @@ -465,14 +465,11 @@ device tdfx_linux # Enable Linuxulator # Intel ACPICA code. (Note that the Intel code must also have USE_DEBUGGER # defined when it is built). # -# ACPI_NO_SEMAPHORES makes the AcpiOs*Semaphore routines a no-op. -# # Note that building ACPI into the kernel is deprecated; the module is # normally loaded automatically by the loader. device acpi options ACPI_DEBUG -#!options ACPI_NO_SEMAPHORES # ACPI Asus Desktop Extras. (voltage, temp, fan) device acpi_aiboost From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 20:24:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA0F1065672; Mon, 8 Jun 2009 20:24:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBB3B8FC18; Mon, 8 Jun 2009 20:24:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58KOTa7042430; Mon, 8 Jun 2009 20:24:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58KOTXU042429; Mon, 8 Jun 2009 20:24:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906082024.n58KOTXU042429@svn.freebsd.org> From: Ed Schouten Date: Mon, 8 Jun 2009 20:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193752 - head/sys/dev/kbdmux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 20:24:30 -0000 Author: ed Date: Mon Jun 8 20:24:29 2009 New Revision: 193752 URL: http://svn.freebsd.org/changeset/base/193752 Log: Use proper types in kbdmux_kbd_getc(): - The return value should be a signed integer, because -1 means failure. - The c variable should be unsigned, to force it to be zero-extended when returned. Reported by: Andreas Tobler Modified: head/sys/dev/kbdmux/kbdmux.c Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Mon Jun 8 20:08:20 2009 (r193751) +++ head/sys/dev/kbdmux/kbdmux.c Mon Jun 8 20:24:29 2009 (r193752) @@ -181,10 +181,10 @@ kbdmux_kbd_putc(kbdmux_state_t *state, c state->ks_inq_length++; } -static char +static int kbdmux_kbd_getc(kbdmux_state_t *state) { - char c; + unsigned char c; if (state->ks_inq_length == 0) return (-1); From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 20:42:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31565106564A; Mon, 8 Jun 2009 20:42:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id A645F8FC13; Mon, 8 Jun 2009 20:42:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n58Kg55t008471 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Jun 2009 06:42:07 +1000 Date: Tue, 9 Jun 2009 06:42:05 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <200906081823.n58INhX8038125@svn.freebsd.org> Message-ID: <20090609061758.P2952@besplex.bde.org> References: <200906081823.n58INhX8038125@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193734 - in head: lib/libusb sys/amd64/amd64 sys/i386/i386 sys/i386/xen sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 20:42:10 -0000 On Mon, 8 Jun 2009, Ed Schouten wrote: > Log: > Revert my change; reintroduce __gnu89_inline. > > It turns out our compiler in stable/7 can't build this code anymore. > Even though my opinion is that those people should just run `make > kernel-toolchain' before building a kernel, I am willing to wait and > commit this after we've branched stable/8. > > Requested by: rwatson Similar changes in msun broke backwards compatibily there. The last one that I noticed was that a current msun fails to build on pluto1.freebsd.org since pluto1 runs 7.2-STABLE and thus has a gcc-4.2.1 not patched to support C99 inline. On other machines I want to build it with old compilers starting with gcc-3 to run regression tests. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 20:50:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3511F106566C; Mon, 8 Jun 2009 20:50:39 +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 23D6B8FC16; Mon, 8 Jun 2009 20:50:39 +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 n58Kodkw043024; Mon, 8 Jun 2009 20:50:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58Kodch043023; Mon, 8 Jun 2009 20:50:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906082050.n58Kodch043023@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 8 Jun 2009 20:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193753 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 20:50:39 -0000 Author: jkim Date: Mon Jun 8 20:50:38 2009 New Revision: 193753 URL: http://svn.freebsd.org/changeset/base/193753 Log: Remove redundant checks for ACPI_WAIT_FOREVER cases. Modified: head/sys/dev/acpica/Osd/OsdSynch.c Modified: head/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSynch.c Mon Jun 8 20:24:29 2009 (r193752) +++ head/sys/dev/acpica/Osd/OsdSynch.c Mon Jun 8 20:50:38 2009 (r193753) @@ -185,8 +185,6 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handl status = AE_ERROR; break; } - if (ACPISEM_AVAIL(as, Units)) - break; } break; default: @@ -380,8 +378,6 @@ AcpiOsAcquireMutex(ACPI_MUTEX Handle, UI status = AE_ERROR; break; } - if (ACPIMTX_AVAIL(am)) - break; } break; default: From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 21:00:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 645961065672; Mon, 8 Jun 2009 21:00:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id D7EC48FC08; Mon, 8 Jun 2009 21:00:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id D128941C751; Mon, 8 Jun 2009 23:00:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id Hl-rHr0+ucrR; Mon, 8 Jun 2009 23:00:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 1F58341C75C; Mon, 8 Jun 2009 23:00:06 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id E6F254448E6; Mon, 8 Jun 2009 20:55:30 +0000 (UTC) Date: Mon, 8 Jun 2009 20:55:30 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Hiroki Sato In-Reply-To: <200906072300.n57N0ems008322@svn.freebsd.org> Message-ID: <20090608205308.N22887@maildrop.int.zabbadoz.net> References: <200906072300.n57N0ems008322@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193664 - in head: sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:00:08 -0000 On Sun, 7 Jun 2009, Hiroki Sato wrote: Hi, > Author: hrs > Date: Sun Jun 7 23:00:40 2009 > New Revision: 193664 > URL: http://svn.freebsd.org/changeset/base/193664 > > Log: > Fix and add a workaround on an issue of EtherIP packet with reversed > version field sent via gif(4)+if_bridge(4). The EtherIP > implementation found on FreeBSD 6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 had > an interoperability issue because it sent the incorrect EtherIP > packets and discarded the correct ones. > > This change introduces the following two flags to gif(4): > > accept_rev_ethip_ver: accepts both correct EtherIP packets and ones > with reversed version field, if enabled. If disabled, the gif > accepts the correct packets only. This flag is enabled by > default. > > send_rev_ethip_ver: sends EtherIP packets with reversed version field > intentionally, if enabled. If disabled, the gif sends the correct > packets only. This flag is disabled by default. > > These flags are stored in struct gif_softc and can be set by > ifconfig(8) on per-interface basis. > > Note that this is an incompatible change of EtherIP with the older > FreeBSD releases. If you need to interoperate older FreeBSD boxes and > new versions after this commit, setting "send_rev_ethip_ver" is > needed. > > Reviewed by: thompsa and rwatson > Spotted by: Shunsuke SHINOMIYA > PR: kern/125003 > MFC after: 2 weeks > > Added: > head/sbin/ifconfig/ifgif.c (contents, props changed) > Modified: > head/sbin/ifconfig/Makefile > head/share/man/man4/gif.4 > head/share/man/man4/if_bridge.4 > head/sys/net/if_gif.c > head/sys/net/if_gif.h > head/sys/netinet/in_gif.c > head/sys/netinet6/in6_gif.c > head/sys/sys/priv.h > .... > Modified: head/sys/net/if_gif.c > ============================================================================== > --- head/sys/net/if_gif.c Sun Jun 7 22:55:48 2009 (r193663) > +++ head/sys/net/if_gif.c Sun Jun 7 23:00:40 2009 (r193664) > @@ -653,6 +670,7 @@ gif_ioctl(ifp, cmd, data) > struct gif_softc *sc = ifp->if_softc; > struct ifreq *ifr = (struct ifreq*)data; > int error = 0, size; > + u_int options; > struct sockaddr *dst, *src; > #ifdef SIOCSIFMTU /* xxx */ > u_long mtu; > @@ -887,6 +905,24 @@ gif_ioctl(ifp, cmd, data) > /* if_ioctl() takes care of it */ > break; > > + case GIFGOPTS: > + options = sc->gif_options; > + error = copyout(&options, ifr->ifr_data, > + sizeof(options)); > + break; > + > + case GIFSOPTS: > + if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0) > + break; > + if ((error = copyin(&options, &sc->gif_options, > + sizeof(sc->gif_options)))) { > + if ((options | GIF_FULLOPTS) == GIF_FULLOPTS) > + ifr->ifr_data = (caddr_t)options; > + else > + error = EINVAL; > + } > + break; > + > default: > error = EINVAL; > break; As noticed by ps there is a build problem here. It seems it is the result of some reversed logic. Does this patch look ok? http://people.freebsd.org/~bz/20090608-03-if_gif.c.diff -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 21:14:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27FF1106571D; Mon, 8 Jun 2009 21:14:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 135258FC0C; Mon, 8 Jun 2009 21:14:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58LELRf043816; Mon, 8 Jun 2009 21:14:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58LELnD043815; Mon, 8 Jun 2009 21:14:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200906082114.n58LELnD043815@svn.freebsd.org> From: Michael Tuexen Date: Mon, 8 Jun 2009 21:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193759 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:14:25 -0000 Author: tuexen Date: Mon Jun 8 21:14:21 2009 New Revision: 193759 URL: http://svn.freebsd.org/changeset/base/193759 Log: Add myself. Approved by: rrs (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Mon Jun 8 21:13:20 2009 (r193758) +++ head/share/misc/committers-src.dot Mon Jun 8 21:14:21 2009 (r193759) @@ -179,6 +179,7 @@ thompsa [label="Andrew Thompson\nthompsa ticso [label="Bernd Walter\nticso@FreeBSD.org\n2002/01/31"] trasz [label="Edward Tomasz Napierala\ntrasz@FreeBSD.org\n2008/08/22"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2002/05/28"] +tuexen [label="Michael Tuexen\ntuexen@FreeBSD.org\n2009/06/06"] ume [label="Hajimu UMEMOTO\nume@FreeBSD.org\n2000/02/26"] vanhu [label="Yvan Vanhullebus\nvanhu@FreeBSD.org\n2008/07/21"] versus [label="Konrad Jankowski\nversus@FreeBSD.org\n2008/10/27"] @@ -385,6 +386,8 @@ rgrimes -> markm rpaulo -> avg +rrs -> tuexen + ru -> ceri ru -> cjc ru -> eik From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 21:15:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 383F1106566B; Mon, 8 Jun 2009 21:15:41 +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 273168FC24; Mon, 8 Jun 2009 21:15:41 +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 n58LFfpK043896; Mon, 8 Jun 2009 21:15:41 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58LFfqk043895; Mon, 8 Jun 2009 21:15:41 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906082115.n58LFfqk043895@svn.freebsd.org> From: Sam Leffler Date: Mon, 8 Jun 2009 21:15: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: r193760 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:15:41 -0000 Author: sam Date: Mon Jun 8 21:15:40 2009 New Revision: 193760 URL: http://svn.freebsd.org/changeset/base/193760 Log: fix big-endian machines Modified: head/sys/net80211/ieee80211_radiotap.c Modified: head/sys/net80211/ieee80211_radiotap.c ============================================================================== --- head/sys/net80211/ieee80211_radiotap.c Mon Jun 8 21:14:21 2009 (r193759) +++ head/sys/net80211/ieee80211_radiotap.c Mon Jun 8 21:15:40 2009 (r193760) @@ -153,17 +153,17 @@ ieee80211_radiotap_chan_change(struct ie if (ic->ic_rxchan != NULL) { struct ieee80211_radiotap_header *rh = ic->ic_rh; - if (rh->it_present & (1<it_present & htole32(1<ic_rxchan, ic->ic_curchan); - else if (rh->it_present & (1<it_present & htole32(1<ic_rxchan, ic->ic_curchan); } if (ic->ic_txchan != NULL) { struct ieee80211_radiotap_header *th = ic->ic_th; - if (th->it_present & (1<it_present & htole32(1<ic_txchan, ic->ic_curchan); - else if (th->it_present & (1<it_present & htole32(1<ic_txchan, ic->ic_curchan); } } From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 21:16:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D8991065675; Mon, 8 Jun 2009 21:16:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C7508FC17; Mon, 8 Jun 2009 21:16:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58LG6Pq043945; Mon, 8 Jun 2009 21:16:06 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58LG6jH043944; Mon, 8 Jun 2009 21:16:06 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906082116.n58LG6jH043944@svn.freebsd.org> From: Sam Leffler Date: Mon, 8 Jun 2009 21:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193761 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:16:07 -0000 Author: sam Date: Mon Jun 8 21:16:06 2009 New Revision: 193761 URL: http://svn.freebsd.org/changeset/base/193761 Log: purge dead code Modified: head/sys/net80211/ieee80211_radiotap.c Modified: head/sys/net80211/ieee80211_radiotap.c ============================================================================== --- head/sys/net80211/ieee80211_radiotap.c Mon Jun 8 21:15:40 2009 (r193760) +++ head/sys/net80211/ieee80211_radiotap.c Mon Jun 8 21:16:06 2009 (r193761) @@ -168,35 +168,6 @@ ieee80211_radiotap_chan_change(struct ie } } -#if 0 -static void -dispatch_radiotap(struct ieee80211vap *vap0, struct mbuf *m, - struct ieee80211_radiotap_header *rh) -{ - struct ieee80211com *ic = vap0->iv_ic; - int len = le16toh(rh->it_len); - - if (vap0->iv_flags_ext & IEEE80211_FEXT_BPF) - bpf_mtap2(vap0->iv_rawbpf, rh, len, m); - /* - * Spam monitor mode vaps with unicast frames. Multicast - * frames are handled by passing through ieee80211_input_all - * which distributes copies to the monitor mode vaps to be - * processed above. - */ - if (ic->ic_montaps != 0 && (m->m_flags & M_BCAST) == 0) { - struct ieee80211vap *vap; - TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - if (vap != vap0 && - vap->iv_opmode == IEEE80211_M_MONITOR && - (vap->iv_flags_ext & IEEE80211_FEXT_BPF) && - vap->iv_state != IEEE80211_S_INIT) - bpf_mtap2(vap->iv_rawbpf, rh, len, m); - } - } -} -#endif - /* * Distribute radiotap data (+packet) to all monitor mode * vaps with an active tap other than vap0. From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 21:23:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC83D1065670; Mon, 8 Jun 2009 21:23:54 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D11978FC1B; Mon, 8 Jun 2009 21:23:54 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58LNsuD044151; Mon, 8 Jun 2009 21:23:54 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58LNsdd044147; Mon, 8 Jun 2009 21:23:54 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200906082123.n58LNsdd044147@svn.freebsd.org> From: Paul Saab Date: Mon, 8 Jun 2009 21:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193762 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:23:55 -0000 Author: ps Date: Mon Jun 8 21:23:54 2009 New Revision: 193762 URL: http://svn.freebsd.org/changeset/base/193762 Log: Simply shared vnode locking and extend it to also include fsync. Also, in vop_write, no longer assert for exclusive locks on the vnode. Reviewed by: jhb, kmacy, jeffr Modified: head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src head/sys/sys/mount.h Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Jun 8 21:16:06 2009 (r193761) +++ head/sys/kern/vfs_syscalls.c Mon Jun 8 21:23:54 2009 (r193762) @@ -3476,7 +3476,7 @@ fsync(td, uap) struct mount *mp; struct file *fp; int vfslocked; - int error; + int error, lock_flags; AUDIT_ARG(fd, uap->fd); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) @@ -3485,7 +3485,13 @@ fsync(td, uap) vfslocked = VFS_LOCK_GIANT(vp->v_mount); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto drop; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if (MNT_SHARED_WRITES(mp) || + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) { + lock_flags = LK_SHARED; + } else { + lock_flags = LK_EXCLUSIVE; + } + vn_lock(vp, lock_flags | LK_RETRY); AUDIT_ARG(vnode, vp, ARG_VNODE1); if (vp->v_object != NULL) { VM_OBJECT_LOCK(vp->v_object); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Jun 8 21:16:06 2009 (r193761) +++ head/sys/kern/vfs_vnops.c Mon Jun 8 21:23:54 2009 (r193762) @@ -376,8 +376,8 @@ vn_rdwr(rw, vp, base, len, offset, segfl (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - if (mp != NULL && - (mp->mnt_kern_flag & MNTK_SHARED_WRITES)) { + if (MNT_SHARED_WRITES(mp) || + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) { lock_flags = LK_SHARED; } else { lock_flags = LK_EXCLUSIVE; @@ -592,7 +592,8 @@ vn_write(fp, uio, active_cred, flags, td (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; - if (mp != NULL && (mp->mnt_kern_flag & MNTK_SHARED_WRITES) && + if ((MNT_SHARED_WRITES(mp) || + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) && (flags & FOF_OFFSET) != 0) { lock_flags = LK_SHARED; } else { Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Mon Jun 8 21:16:06 2009 (r193761) +++ head/sys/kern/vnode_if.src Mon Jun 8 21:23:54 2009 (r193762) @@ -197,7 +197,7 @@ vop_read { }; -%% write vp E E E +%% write vp L L L %! write pre VOP_WRITE_PRE %! write post VOP_WRITE_POST Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Mon Jun 8 21:16:06 2009 (r193761) +++ head/sys/sys/mount.h Mon Jun 8 21:23:54 2009 (r193762) @@ -336,6 +336,9 @@ void __mnt_vnode_markerfree(str #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ +#define MNT_SHARED_WRITES(mp) (((mp) != NULL) && \ + ((mp)->mnt_kern_flag & MNTK_SHARED_WRITES)) + /* * Sysctl CTL_VFS definitions. * From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 21:40:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 146C91065689; Mon, 8 Jun 2009 21:40:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id BD4FD8FC26; Mon, 8 Jun 2009 21:40:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id E414141C72F; Mon, 8 Jun 2009 23:40:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id wrLnRnjOs+0P; Mon, 8 Jun 2009 23:40:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 8C6FD41C712; Mon, 8 Jun 2009 23:40:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id EA8844448E6; Mon, 8 Jun 2009 21:39:14 +0000 (UTC) Date: Mon, 8 Jun 2009 21:39:14 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Ariff Abdullah In-Reply-To: <200906072338.n57NcGgu009269@svn.freebsd.org> Message-ID: <20090608213828.O22887@maildrop.int.zabbadoz.net> References: <200906072338.n57NcGgu009269@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193667 - head/sys/dev/sound/sbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:40:07 -0000 On Sun, 7 Jun 2009, Ariff Abdullah wrote: Hey, > Author: ariff > Date: Sun Jun 7 23:38:16 2009 > New Revision: 193667 > URL: http://svn.freebsd.org/changeset/base/193667 > > Log: > Fix build on sparc64. I am still seeing: /sys/modules/sound/driver/audiocs/../../../../dev/sound/sbus/cs4231.c:290: warning: comparison of distinct pointer types lacks a cast /sys/modules/sound/driver/audiocs/../../../../dev/sound/sbus/cs4231.c:291: warning: comparison of distinct pointer types lacks a cast /sys/modules/sound/driver/audiocs/../../../../dev/sound/sbus/cs4231.c:293: warning: comparison of distinct pointer types lacks a cast /sys/modules/sound/driver/audiocs/../../../../dev/sound/sbus/cs4231.c:305: warning: comparison of distinct pointer types lacks a cast > > Modified: > head/sys/dev/sound/sbus/cs4231.c > > Modified: head/sys/dev/sound/sbus/cs4231.c > ============================================================================== > --- head/sys/dev/sound/sbus/cs4231.c Sun Jun 7 23:16:59 2009 (r193666) > +++ head/sys/dev/sound/sbus/cs4231.c Sun Jun 7 23:38:16 2009 (r193667) > @@ -273,7 +273,7 @@ static u_int32_t cs4231_fmt[] = { > SND_FORMAT(AFMT_IMA_ADPCM, 1, 0), > SND_FORMAT(AFMT_IMA_ADPCM, 2, 0), > SND_FORMAT(AFMT_S16_LE, 1, 0), > - SND_FORMAT(S16_LE, 2, 0), > + SND_FORMAT(AFMT_S16_LE, 2, 0), > SND_FORMAT(AFMT_S16_BE, 1, 0), > SND_FORMAT(AFMT_S16_BE, 2, 0), > 0 > -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 21:42:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6F92106568D; Mon, 8 Jun 2009 21:42:30 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAC378FC0A; Mon, 8 Jun 2009 21:42:30 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58LgU1r044665; Mon, 8 Jun 2009 21:42:30 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58LgUKV044664; Mon, 8 Jun 2009 21:42:30 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906082142.n58LgUKV044664@svn.freebsd.org> From: Brian Somers Date: Mon, 8 Jun 2009 21:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193765 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:42:31 -0000 Author: brian Date: Mon Jun 8 21:42:30 2009 New Revision: 193765 URL: http://svn.freebsd.org/changeset/base/193765 Log: Fix an off by one error when we limit append/prepend text sizes based on our internal buffer sizes. When we 'append', assume we're appending to text. Some MS dhcp servers will give us a string with the length including the trailing NUL. when we 'append domain-name', we get something like "search x.y\000 z" in resolv.conf :( MFC after: 1 week Security: A buffer overflow (by one NUL byte) was possible. Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Mon Jun 8 21:42:15 2009 (r193764) +++ head/sbin/dhclient/dhclient.c Mon Jun 8 21:42:30 2009 (r193765) @@ -1977,7 +1977,7 @@ supersede: len = ip->client-> config->defaults[i].len + lease->options[i].len; - if (len > sizeof(dbuf)) { + if (len >= sizeof(dbuf)) { warning("no space to %s %s", "prepend option", dhcp_options[i].name); @@ -1996,24 +1996,34 @@ supersede: dp[len] = '\0'; break; case ACTION_APPEND: + /* + * When we append, we assume that we're + * appending to text. Some MS servers + * include a NUL byte at the end of + * the search string provided. + */ len = ip->client-> config->defaults[i].len + lease->options[i].len; - if (len > sizeof(dbuf)) { + if (len >= sizeof(dbuf)) { warning("no space to %s %s", "append option", dhcp_options[i].name); goto supersede; } - dp = dbuf; - memcpy(dp, + memcpy(dbuf, lease->options[i].data, lease->options[i].len); - memcpy(dp + lease->options[i].len, + for (dp = dbuf + lease->options[i].len; + dp > dbuf; dp--, len--) + if (dp[-1] != '\0') + break; + memcpy(dp, ip->client-> config->defaults[i].data, ip->client-> config->defaults[i].len); + dp = dbuf; dp[len] = '\0'; } } else { From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 21:48:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0BDB1065693; Mon, 8 Jun 2009 21:48:13 +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 D9C978FC16; Mon, 8 Jun 2009 21:48:13 +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 n58LmDVv044944; Mon, 8 Jun 2009 21:48:13 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58LmDSS044943; Mon, 8 Jun 2009 21:48:13 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906082148.n58LmDSS044943@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 8 Jun 2009 21:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193768 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 21:48:15 -0000 Author: jkim Date: Mon Jun 8 21:48:13 2009 New Revision: 193768 URL: http://svn.freebsd.org/changeset/base/193768 Log: Reflect debug level changes from the recent ACPICA import. Modified: head/share/man/man4/acpi.4 Modified: head/share/man/man4/acpi.4 ============================================================================== --- head/share/man/man4/acpi.4 Mon Jun 8 21:47:55 2009 (r193767) +++ head/share/man/man4/acpi.4 Mon Jun 8 21:48:13 2009 (r193768) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2006 +.Dd June 8, 2009 .Dt ACPI 4 .Os .Sh NAME @@ -451,10 +451,6 @@ ACPI drivers The supported levels are: .Pp .Bl -tag -compact -width ".Li ACPI_LV_AML_DISASSEMBLE" -.It Li ACPI_LV_ERROR -Fatal error conditions -.It Li ACPI_LV_WARN -Warnings and potential problems .It Li ACPI_LV_INIT Initialization progress .It Li ACPI_LV_DEBUG_OBJECT @@ -463,9 +459,7 @@ Stores to objects General information and progress .It Li ACPI_LV_ALL_EXCEPTIONS All the previous levels -.It Li ACPI_LV_INIT_NAMES .It Li ACPI_LV_PARSE -.It Li ACPI_LV_LOAD .It Li ACPI_LV_DISPATCH .It Li ACPI_LV_EXEC .It Li ACPI_LV_NAMES @@ -483,7 +477,10 @@ All the previous levels .It Li ACPI_LV_FUNCTIONS .It Li ACPI_LV_OPTIMIZATIONS .It Li ACPI_LV_VERBOSITY2 +All the previous levels .It Li ACPI_LV_ALL +Synonym for +.Qq Li ACPI_LV_VERBOSITY2 .It Li ACPI_LV_MUTEX .It Li ACPI_LV_THREADS .It Li ACPI_LV_IO @@ -497,6 +494,8 @@ All the previous levels .It Li ACPI_LV_VERBOSE All levels after .Qq Li ACPI_LV_VERBOSITY3 +.It Li ACPI_LV_INIT_NAMES +.It Li ACPI_LV_LOAD .El .Pp Selection of the appropriate layer and level values is important From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 22:02:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 318E51065670; Mon, 8 Jun 2009 22:02:31 +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 2011F8FC13; Mon, 8 Jun 2009 22:02:31 +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 n58M2Vil045571; Mon, 8 Jun 2009 22:02:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58M2V5i045570; Mon, 8 Jun 2009 22:02:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906082202.n58M2V5i045570@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 8 Jun 2009 22:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193773 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 22:02:31 -0000 Author: bz Date: Mon Jun 8 22:02:30 2009 New Revision: 193773 URL: http://svn.freebsd.org/changeset/base/193773 Log: Update vnet_net size guard information after r193731. Modified: head/sys/sys/vimage.h Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Mon Jun 8 21:58:34 2009 (r193772) +++ head/sys/sys/vimage.h Mon Jun 8 22:02:30 2009 (r193773) @@ -359,43 +359,43 @@ extern struct vprocg_list_head vprocg_he * See description further down to see how to get the new values. */ #ifdef __amd64__ -#define SIZEOF_vnet_net 176 +#define SIZEOF_vnet_net 184 #define SIZEOF_vnet_inet 4424 #define SIZEOF_vnet_inet6 8808 #define SIZEOF_vnet_ipsec 31160 #endif #ifdef __arm__ -#define SIZEOF_vnet_net 96 +#define SIZEOF_vnet_net 100 #define SIZEOF_vnet_inet 2616 #define SIZEOF_vnet_inet6 8524 #define SIZEOF_vnet_ipsec 1 #endif #ifdef __i386__ /* incl. pc98 */ -#define SIZEOF_vnet_net 96 +#define SIZEOF_vnet_net 100 #define SIZEOF_vnet_inet 2612 #define SIZEOF_vnet_inet6 8512 #define SIZEOF_vnet_ipsec 31024 #endif #ifdef __ia64__ -#define SIZEOF_vnet_net 176 +#define SIZEOF_vnet_net 184 #define SIZEOF_vnet_inet 4424 #define SIZEOF_vnet_inet6 8808 #define SIZEOF_vnet_ipsec 31160 #endif #ifdef __mips__ -#define SIZEOF_vnet_net 96 +#define SIZEOF_vnet_net 100 #define SIZEOF_vnet_inet 2648 #define SIZEOF_vnet_inet6 8544 #define SIZEOF_vnet_ipsec 1 #endif #ifdef __powerpc__ -#define SIZEOF_vnet_net 96 +#define SIZEOF_vnet_net 100 #define SIZEOF_vnet_inet 2640 #define SIZEOF_vnet_inet6 8520 #define SIZEOF_vnet_ipsec 31048 #endif #ifdef __sparc64__ /* incl. sun4v */ -#define SIZEOF_vnet_net 176 +#define SIZEOF_vnet_net 184 #define SIZEOF_vnet_inet 4424 #define SIZEOF_vnet_inet6 8808 #define SIZEOF_vnet_ipsec 31160 From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 22:03:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2632F1065673; Mon, 8 Jun 2009 22:03:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14C438FC23; Mon, 8 Jun 2009 22:03:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58M3bXn045674; Mon, 8 Jun 2009 22:03:37 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58M3bcd045673; Mon, 8 Jun 2009 22:03:37 GMT (envelope-from np@svn.freebsd.org) Message-Id: <200906082203.n58M3bcd045673@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 8 Jun 2009 22:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193775 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 22:03:38 -0000 Author: np Date: Mon Jun 8 22:03:37 2009 New Revision: 193775 URL: http://svn.freebsd.org/changeset/base/193775 Log: Add self, list mentor in committers-src.dot Approved by: gnn (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Mon Jun 8 22:02:57 2009 (r193774) +++ head/share/misc/committers-src.dot Mon Jun 8 22:03:37 2009 (r193775) @@ -139,6 +139,7 @@ mr [label="Michael Reifenberger\nmr@Free murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2005/03/31"] njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07"] +np [label="Navdeep Parhar\nnp@FreeBSD.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] @@ -269,6 +270,7 @@ gnn -> rrs gnn -> ivoras gnn -> vanhu gnn -> lstewart +gnn -> np grog -> edwin grog -> le From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 22:46:35 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E91F01065673; Mon, 8 Jun 2009 22:46:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id A60F28FC28; Mon, 8 Jun 2009 22:46:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n58Mj1BO035619; Mon, 8 Jun 2009 16:45:01 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 08 Jun 2009 16:45:18 -0600 (MDT) Message-Id: <20090608.164518.-1264106964.imp@bsdimp.com> To: ed@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200906081823.n58INhX8038125@svn.freebsd.org> References: <200906081823.n58INhX8038125@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193734 - in head: lib/libusb sys/amd64/amd64 sys/i386/i386 sys/i386/xen sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 22:46:36 -0000 In message: <200906081823.n58INhX8038125@svn.freebsd.org> Ed Schouten writes: : It turns out our compiler in stable/7 can't build this code anymore. : Even though my opinion is that those people should just run `make : kernel-toolchain' before building a kernel, I am willing to wait and : commit this after we've branched stable/8. As a matter of policy, the project has always supported a RELENG_X -> CURRENT upgrade with a simple buildworld. The issue of building a kernel by hand across releases has been targeted as one of those areas that can break, but only if there's a really good reason to do so. Just FYI to everybody.. Warner From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 23:24:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 732EE106566B; Mon, 8 Jun 2009 23:24:02 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 462F38FC15; Mon, 8 Jun 2009 23:24:02 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n58NO13d047606; Mon, 8 Jun 2009 23:24:01 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n58NO1O1047605; Mon, 8 Jun 2009 23:24:01 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906082324.n58NO1O1047605@svn.freebsd.org> From: Ariff Abdullah Date: Mon, 8 Jun 2009 23:24: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: r193779 - head/sys/dev/sound/sbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 23:24:03 -0000 Author: ariff Date: Mon Jun 8 23:24:01 2009 New Revision: 193779 URL: http://svn.freebsd.org/changeset/base/193779 Log: Fix compile time warning on sparc64, thanks to strict kobj signatures checking. Noticed by: bz Modified: head/sys/dev/sound/sbus/cs4231.c Modified: head/sys/dev/sound/sbus/cs4231.c ============================================================================== --- head/sys/dev/sound/sbus/cs4231.c Mon Jun 8 23:03:37 2009 (r193778) +++ head/sys/dev/sound/sbus/cs4231.c Mon Jun 8 23:24:01 2009 (r193779) @@ -173,15 +173,15 @@ static void cs4231_mixer_set_value(struc const struct mix_table *, u_int8_t); static int cs4231_mixer_set(struct snd_mixer *, u_int32_t, u_int32_t, u_int32_t); -static int cs4231_mixer_setrecsrc(struct snd_mixer *, u_int32_t); +static u_int32_t cs4231_mixer_setrecsrc(struct snd_mixer *, u_int32_t); static void *cs4231_chan_init(kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int); static int cs4231_chan_setformat(kobj_t, void *, u_int32_t); -static int cs4231_chan_setspeed(kobj_t, void *, u_int32_t); +static u_int32_t cs4231_chan_setspeed(kobj_t, void *, u_int32_t); static void cs4231_chan_fs(struct cs4231_softc *, int, u_int8_t); -static int cs4231_chan_setblocksize(kobj_t, void *, u_int32_t); +static u_int32_t cs4231_chan_setblocksize(kobj_t, void *, u_int32_t); static int cs4231_chan_trigger(kobj_t, void *, int); -static int cs4231_chan_getptr(kobj_t, void *); +static u_int32_t cs4231_chan_getptr(kobj_t, void *); static struct pcmchan_caps * cs4231_chan_getcaps(kobj_t, void *); static void cs4231_trigger(struct cs4231_channel *); @@ -982,7 +982,7 @@ cs4231_mixer_set(struct snd_mixer *m, u_ return (left | (right << 8)); } -static int +static u_int32_t cs4231_mixer_setrecsrc(struct snd_mixer *m, u_int32_t src) { struct cs4231_softc *sc; @@ -1103,7 +1103,7 @@ cs4231_chan_setformat(kobj_t obj, void * return (0); } -static int +static u_int32_t cs4231_chan_setspeed(kobj_t obj, void *data, u_int32_t speed) { typedef struct { @@ -1253,7 +1253,7 @@ cs4231_chan_fs(struct cs4231_softc *sc, } } -static int +static u_int32_t cs4231_chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) { struct cs4231_softc *sc; @@ -1299,13 +1299,12 @@ cs4231_chan_trigger(kobj_t obj, void *da return (0); } -static int +static u_int32_t cs4231_chan_getptr(kobj_t obj, void *data) { struct cs4231_softc *sc; struct cs4231_channel *ch; - u_int32_t cur; - int ptr, sz; + u_int32_t cur, ptr, sz; ch = data; sc = ch->parent; From owner-svn-src-head@FreeBSD.ORG Mon Jun 8 23:27:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from miki (localhost [IPv6:::1]) by hub.freebsd.org (Postfix) with SMTP id 736FF106566B; Mon, 8 Jun 2009 23:26:59 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Date: Tue, 9 Jun 2009 07:26:55 +0800 From: Ariff Abdullah To: "Bjoern A. Zeeb" Message-Id: <20090609072655.5e6062c5.ariff@FreeBSD.org> In-Reply-To: <20090608213828.O22887@maildrop.int.zabbadoz.net> References: <200906072338.n57NcGgu009269@svn.freebsd.org> <20090608213828.O22887@maildrop.int.zabbadoz.net> Organization: FreeBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Tue__9_Jun_2009_07_26_55_+0800_8Y2NBcuHnlMMWjoN" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193667 - head/sys/dev/sound/sbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 23:27:01 -0000 --Signature=_Tue__9_Jun_2009_07_26_55_+0800_8Y2NBcuHnlMMWjoN Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, 8 Jun 2009 21:39:14 +0000 (UTC) "Bjoern A. Zeeb" wrote: > On Sun, 7 Jun 2009, Ariff Abdullah wrote: >=20 > Hey, >=20 > > Author: ariff > > Date: Sun Jun 7 23:38:16 2009 > > New Revision: 193667 > > URL: http://svn.freebsd.org/changeset/base/193667 > > > > Log: > > Fix build on sparc64. >=20 > I am still seeing: >=20 > /sys/modules/sound/driver/audiocs/../../../../dev/sound/sbus/cs4231 > .c:290: warning: comparison of distinct pointer types lacks a cast > /sys/modules/sound/driver/audiocs/../../../../dev/sound/sbus/cs4231 > .c:291: warning: comparison of distinct pointer types lacks a cast > /sys/modules/sound/driver/audiocs/../../../../dev/sound/sbus/cs4231 > .c:293: warning: comparison of distinct pointer types lacks a cast > /sys/modules/sound/driver/audiocs/../../../../dev/sound/sbus/cs4231 > .c:305: warning: comparison of distinct pointer types lacks a cast >=20 >=20 Fixed. Thanks :) -- Ariff Abdullah FreeBSD ... Recording in stereo is obviously too advanced and confusing for us idiot ***** users :P ........ ... Going with the standard and orthodox is the death of intellect .............. --Signature=_Tue__9_Jun_2009_07_26_55_+0800_8Y2NBcuHnlMMWjoN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkotnj8ACgkQlr+deMUwTNrBDACdHAk4MDQYmHtV4+gxF1oZmM35 j5oAoMN2V9OEyfKBHlZQw+3b9EdxTJ7p =mPTS -----END PGP SIGNATURE----- --Signature=_Tue__9_Jun_2009_07_26_55_+0800_8Y2NBcuHnlMMWjoN-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 9 00:09:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5BB106564A; Tue, 9 Jun 2009 00:09:36 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DEFE8FC1A; Tue, 9 Jun 2009 00:09:36 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5909ahV048946; Tue, 9 Jun 2009 00:09:36 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5909ahQ048945; Tue, 9 Jun 2009 00:09:36 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906090009.n5909ahQ048945@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 9 Jun 2009 00:09: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: r193785 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2009 00:09:37 -0000 Author: edwin Date: Tue Jun 9 00:09:36 2009 New Revision: 193785 URL: http://svn.freebsd.org/changeset/base/193785 Log: MFV of tzdata2009i: Bangladesh will go into DST on 20 June. MFC after: 2 days Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/asia Modified: head/share/zoneinfo/asia ============================================================================== --- head/share/zoneinfo/asia Tue Jun 9 00:06:10 2009 (r193784) +++ head/share/zoneinfo/asia Tue Jun 9 00:09:36 2009 (r193785) @@ -1,5 +1,5 @@ #
-# @(#)asia	8.32
+# @(#)asia	8.34
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -127,6 +127,48 @@ Zone	Asia/Bahrain	3:22:20 -	LMT	1920		# 
 			3:00	-	AST
 
 # Bangladesh
+# From Alexander Krivenyshev (2009-05-13):
+# According to newspaper Asian Tribune (May 6, 2009) Bangladesh may introduce
+# Daylight Saving Time from June 16 to Sept 30
+#
+# Bangladesh to introduce daylight saving time likely from June 16
+# 
+# http://www.asiantribune.com/?q=node/17288
+# 
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh02.html
+# 
+#
+# "... Bangladesh government has decided to switch daylight saving time from
+# June
+# 16 till September 30 in a bid to ensure maximum use of daylight to cope with
+# crippling power crisis. "
+#
+# The switch will remain in effect from June 16 to Sept 30 (2009) but if
+# implemented the next year, it will come in force from April 1, 2010
+
+# From Steffen Thorsen (2009-06-02):
+# They have finally decided now, but changed the start date to midnight between
+# the 19th and 20th, and they have not set the end date yet.
+#
+# Some sources:
+# 
+# http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
+# 
+# 
+# http://bdnews24.com/details.php?id=85889&cid=2
+# 
+#
+# Our wrap-up:
+# 
+# http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
+# 
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Bang	2009	only	-	Jan	1	0:00	0	-
+Rule	Bang	2009	only	-	Jun	20	0:00	1:00	S
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
@@ -134,7 +176,8 @@ Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:30	-	IST	1942 Sep
 			6:30	-	BURT	1951 Sep 30
 			6:00	-	DACT	1971 Mar 26 # Dacca Time
-			6:00	-	BDT	# Bangladesh Time
+			6:00	-	BDT	2009 # Bangladesh Time
+			6:00	Bang	BD%sT
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 00:54:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 972B6106566C;
	Tue,  9 Jun 2009 00:54:57 +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 84EB08FC0A;
	Tue,  9 Jun 2009 00:54:57 +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 n590svrx050372;
	Tue, 9 Jun 2009 00:54:57 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n590sv8L050370;
	Tue, 9 Jun 2009 00:54:57 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200906090054.n590sv8L050370@svn.freebsd.org>
From: Xin LI 
Date: Tue, 9 Jun 2009 00:54:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193790 - head/sys/i386/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 00:54:58 -0000

Author: delphij
Date: Tue Jun  9 00:54:57 2009
New Revision: 193790
URL: http://svn.freebsd.org/changeset/base/193790

Log:
  Add line width calculations for 15/16 and 24/32 bit modes in case
  the "Get Scan Line Length" function fails, as it does in Parallels
  (in Version 2.2, Build 2112 at least).
  
  PR:		i386/127367
  Obtained from:	DragonFly
  Submitted by:	Pedro Giffuni
  MFC after:	1 month

Modified:
  head/sys/i386/isa/vesa.c

Modified: head/sys/i386/isa/vesa.c
==============================================================================
--- head/sys/i386/isa/vesa.c	Tue Jun  9 00:47:54 2009	(r193789)
+++ head/sys/i386/isa/vesa.c	Tue Jun  9 00:54:57 2009	(r193790)
@@ -1111,6 +1111,14 @@ vesa_set_mode(video_adapter_t *adp, int 
 		default: /* shouldn't happen */
 			vesa_adp->va_line_width = info.vi_width;
 			break;
+		case 15:
+		case 16:
+			vesa_adp->va_line_width = info.vi_width*2;
+			break;
+		case 24:
+		case 32:
+			vesa_adp->va_line_width = info.vi_width*4;
+			break;
 		}
 	} else {
 		vesa_adp->va_line_width = info.vi_width;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 02:27:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9EF6C106566C;
	Tue,  9 Jun 2009 02:27:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D5F98FC0A;
	Tue,  9 Jun 2009 02:27:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n592RxXS052708;
	Tue, 9 Jun 2009 02:27:59 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n592RxDs052706;
	Tue, 9 Jun 2009 02:27:59 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200906090227.n592RxDs052706@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jun 2009 02:27:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193796 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 02:28:00 -0000

Author: hrs
Date: Tue Jun  9 02:27:59 2009
New Revision: 193796
URL: http://svn.freebsd.org/changeset/base/193796

Log:
  - Fix sanity check of GIFSOPTS ioctl.
  - Rename option mask s/GIF_FULLOPTS/GIF_OPTMASK/
  
  Spotted by:	Eygene Ryabinkin, delphij

Modified:
  head/sys/net/if_gif.c
  head/sys/net/if_gif.h

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Tue Jun  9 01:43:58 2009	(r193795)
+++ head/sys/net/if_gif.c	Tue Jun  9 02:27:59 2009	(r193796)
@@ -912,10 +912,10 @@ gif_ioctl(ifp, cmd, data)
 	case GIFSOPTS:
 		if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0)
 			break;
-		if ((error = copyin(&options, &sc->gif_options,
-				sizeof(sc->gif_options)))) {
-			if ((options | GIF_FULLOPTS) == GIF_FULLOPTS)
-				ifr->ifr_data = (caddr_t)options;
+		if (!(error = copyin(ifr->ifr_data, &options,
+				sizeof(options)))) {
+			if ((options | GIF_OPTMASK) == GIF_OPTMASK)
+				sc->gif_options = options;
 			else
 				error = EINVAL;
 		}

Modified: head/sys/net/if_gif.h
==============================================================================
--- head/sys/net/if_gif.h	Tue Jun  9 01:43:58 2009	(r193795)
+++ head/sys/net/if_gif.h	Tue Jun  9 02:27:59 2009	(r193796)
@@ -150,11 +150,11 @@ extern struct vnet_gif vnet_gif_0;
 
 #endif /* _KERNEL */
 
-#define GIFGOPTS	_IOR('i', 150, struct ifreq)
+#define GIFGOPTS	_IOWR('i', 150, struct ifreq)
 #define GIFSOPTS	_IOW('i', 151, struct ifreq)
 
 #define	GIF_ACCEPT_REVETHIP	0x0001
 #define	GIF_SEND_REVETHIP	0x0010
-#define	GIF_FULLOPTS		(GIF_ACCEPT_REVETHIP|GIF_SEND_REVETHIP)
+#define	GIF_OPTMASK		(GIF_ACCEPT_REVETHIP|GIF_SEND_REVETHIP)
 
 #endif /* _NET_IF_GIF_H_ */

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 03:35:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 54F401065674;
	Tue,  9 Jun 2009 03:35:43 +0000 (UTC)
	(envelope-from bland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 433FA8FC08;
	Tue,  9 Jun 2009 03:35:43 +0000 (UTC)
	(envelope-from bland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n593ZhqA054387;
	Tue, 9 Jun 2009 03:35:43 GMT (envelope-from bland@svn.freebsd.org)
Received: (from bland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n593Zh39054386;
	Tue, 9 Jun 2009 03:35:43 GMT (envelope-from bland@svn.freebsd.org)
Message-Id: <200906090335.n593Zh39054386@svn.freebsd.org>
From: Alexander Nedotsukov 
Date: Tue, 9 Jun 2009 03:35: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: r193799 - head/usr.bin/fstat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 03:35:43 -0000

Author: bland (ports committer)
Date: Tue Jun  9 03:35:42 2009
New Revision: 193799
URL: http://svn.freebsd.org/changeset/base/193799

Log:
  Chase ZFS v13 import changes.
  This is a temporary fix until we find a way to avoid fstat
  to be broken each time we change the znode.
  
  Approved by:	lulf

Modified:
  head/usr.bin/fstat/zfs.c

Modified: head/usr.bin/fstat/zfs.c
==============================================================================
--- head/usr.bin/fstat/zfs.c	Tue Jun  9 03:27:08 2009	(r193798)
+++ head/usr.bin/fstat/zfs.c	Tue Jun  9 03:35:42 2009	(r193799)
@@ -29,6 +29,7 @@
 #include 
 #define _KERNEL
 #include 
+#include 
 #undef _KERNEL
 #include 
 
@@ -57,7 +58,7 @@
  * definition.
  */
 #define LOCATION_ZID (2 * sizeof(void *))
-#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *)))
+#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *) - sizeof(struct task)))
 
 int
 zfs_filestat(struct vnode *vp, struct filestat *fsp)

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 04:09:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02AE4106564A;
	Tue,  9 Jun 2009 04:09:32 +0000 (UTC)
	(envelope-from bland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E55778FC17;
	Tue,  9 Jun 2009 04:09:31 +0000 (UTC)
	(envelope-from bland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5949Vav055091;
	Tue, 9 Jun 2009 04:09:31 GMT (envelope-from bland@svn.freebsd.org)
Received: (from bland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5949Vp9055090;
	Tue, 9 Jun 2009 04:09:31 GMT (envelope-from bland@svn.freebsd.org)
Message-Id: <200906090409.n5949Vp9055090@svn.freebsd.org>
From: Alexander Nedotsukov 
Date: Tue, 9 Jun 2009 04:09:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193802 - head/usr.bin/fstat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 04:09:32 -0000

Author: bland (ports committer)
Date: Tue Jun  9 04:09:31 2009
New Revision: 193802
URL: http://svn.freebsd.org/changeset/base/193802

Log:
  Fix bug in zphys offset calculation I introduced while retyping
  original patch.

Modified:
  head/usr.bin/fstat/zfs.c

Modified: head/usr.bin/fstat/zfs.c
==============================================================================
--- head/usr.bin/fstat/zfs.c	Tue Jun  9 04:03:04 2009	(r193801)
+++ head/usr.bin/fstat/zfs.c	Tue Jun  9 04:09:31 2009	(r193802)
@@ -58,7 +58,7 @@
  * definition.
  */
 #define LOCATION_ZID (2 * sizeof(void *))
-#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *) - sizeof(struct task)))
+#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *) + sizeof(struct task)))
 
 int
 zfs_filestat(struct vnode *vp, struct filestat *fsp)

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 04:17:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C0741065676;
	Tue,  9 Jun 2009 04:17:09 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CD3758FC20;
	Tue,  9 Jun 2009 04:17:08 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n594H8Z9055342;
	Tue, 9 Jun 2009 04:17:08 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n594H8V9055340;
	Tue, 9 Jun 2009 04:17:08 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200906090417.n594H8V9055340@svn.freebsd.org>
From: Weongyo Jeong 
Date: Tue, 9 Jun 2009 04:17:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193803 - head/sys/dev/usb/wlan
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 04:17:09 -0000

Author: weongyo
Date: Tue Jun  9 04:17:08 2009
New Revision: 193803
URL: http://svn.freebsd.org/changeset/base/193803

Log:
  unify zyd_tx_mgt() and zyd_tx_data() to simplify TX path and sorts
  setting TX descritor.
  
  While I'm here fixes a bug that the management frames only sent at 2
  Mbits/s.

Modified:
  head/sys/dev/usb/wlan/if_zyd.c
  head/sys/dev/usb/wlan/if_zydreg.h

Modified: head/sys/dev/usb/wlan/if_zyd.c
==============================================================================
--- head/sys/dev/usb/wlan/if_zyd.c	Tue Jun  9 04:09:31 2009	(r193802)
+++ head/sys/dev/usb/wlan/if_zyd.c	Tue Jun  9 04:17:08 2009	(r193803)
@@ -157,9 +157,7 @@ static int	zyd_set_rxfilter(struct zyd_s
 static void	zyd_set_chan(struct zyd_softc *, struct ieee80211_channel *);
 static int	zyd_set_beacon_interval(struct zyd_softc *, int);
 static void	zyd_rx_data(struct usb_xfer *, int, uint16_t);
-static int	zyd_tx_mgt(struct zyd_softc *, struct mbuf *,
-		    struct ieee80211_node *);
-static int	zyd_tx_data(struct zyd_softc *, struct mbuf *,
+static int	zyd_tx_start(struct zyd_softc *, struct mbuf *,
 		    struct ieee80211_node *);
 static void	zyd_start(struct ifnet *);
 static int	zyd_raw_xmit(struct ieee80211_node *, struct mbuf *,
@@ -2329,7 +2327,7 @@ tr_setup:
 }
 
 static uint8_t
-zyd_plcp_signal(int rate)
+zyd_plcp_signal(struct zyd_softc *sc, int rate)
 {
 	switch (rate) {
 	/* OFDM rates (cf IEEE Std 802.11a-1999, pp. 14 Table 80) */
@@ -2359,109 +2357,9 @@ zyd_plcp_signal(int rate)
 	case 22:
 		return (0x3);
 	}
-	return (0xff);		/* XXX unsupported/unknown rate */
-}
-
-static int
-zyd_tx_mgt(struct zyd_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
-{
-	struct ieee80211vap *vap = ni->ni_vap;
-	struct ieee80211com *ic = ni->ni_ic;
-	struct zyd_tx_desc *desc;
-	struct zyd_tx_data *data;
-	struct ieee80211_frame *wh;
-	struct ieee80211_key *k;
-	int rate, totlen;
-	uint16_t pktlen;
-
-	data = STAILQ_FIRST(&sc->tx_free);
-	STAILQ_REMOVE_HEAD(&sc->tx_free, next);
-	sc->tx_nfree--;
-	desc = &data->desc;
-
-	rate = IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan) ? 12 : 2;
-
-	wh = mtod(m0, struct ieee80211_frame *);
-
-	if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
-		k = ieee80211_crypto_encap(ni, m0);
-		if (k == NULL) {
-			m_freem(m0);
-			return (ENOBUFS);
-		}
-	}
-
-	data->ni = ni;
-	data->m = m0;
-	data->rate = rate;
-
-	wh = mtod(m0, struct ieee80211_frame *);
-
-	totlen = m0->m_pkthdr.len + IEEE80211_CRC_LEN;
-
-	/* fill Tx descriptor */
-	desc->len = htole16(totlen);
-
-	desc->flags = ZYD_TX_FLAG_BACKOFF;
-	if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
-		/* multicast frames are not sent at OFDM rates in 802.11b/g */
-		if (totlen > vap->iv_rtsthreshold) {
-			desc->flags |= ZYD_TX_FLAG_RTS;
-		} else if (ZYD_RATE_IS_OFDM(rate) &&
-		    (ic->ic_flags & IEEE80211_F_USEPROT)) {
-			if (ic->ic_protmode == IEEE80211_PROT_CTSONLY)
-				desc->flags |= ZYD_TX_FLAG_CTS_TO_SELF;
-			else if (ic->ic_protmode == IEEE80211_PROT_RTSCTS)
-				desc->flags |= ZYD_TX_FLAG_RTS;
-		}
-	} else
-		desc->flags |= ZYD_TX_FLAG_MULTICAST;
-
-	if ((wh->i_fc[0] &
-	    (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) ==
-	    (IEEE80211_FC0_TYPE_CTL | IEEE80211_FC0_SUBTYPE_PS_POLL))
-		desc->flags |= ZYD_TX_FLAG_TYPE(ZYD_TX_TYPE_PS_POLL);
-
-	desc->phy = zyd_plcp_signal(rate);
-	if (ZYD_RATE_IS_OFDM(rate)) {
-		desc->phy |= ZYD_TX_PHY_OFDM;
-		if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan))
-			desc->phy |= ZYD_TX_PHY_5GHZ;
-	} else if (rate != 2 && (ic->ic_flags & IEEE80211_F_SHPREAMBLE))
-		desc->phy |= ZYD_TX_PHY_SHPREAMBLE;
-
-	/* actual transmit length (XXX why +10?) */
-	pktlen = ZYD_TX_DESC_SIZE + 10;
-	if (sc->sc_macrev == ZYD_ZD1211)
-		pktlen += totlen;
-	desc->pktlen = htole16(pktlen);
-
-	desc->plcp_length = (16 * totlen + rate - 1) / rate;
-	desc->plcp_service = 0;
-	if (rate == 22) {
-		const int remainder = (16 * totlen) % 22;
-		if (remainder != 0 && remainder < 7)
-			desc->plcp_service |= ZYD_PLCP_LENGEXT;
-	}
-
-	if (ieee80211_radiotap_active_vap(vap)) {
-		struct zyd_tx_radiotap_header *tap = &sc->sc_txtap;
-
-		tap->wt_flags = 0;
-		tap->wt_rate = rate;
 
-		ieee80211_radiotap_tx(vap, m0);
-	}
-
-	DPRINTF(sc, ZYD_DEBUG_XMIT,
-	    "%s: sending mgt frame len=%zu rate=%u\n",
-	    device_get_nameunit(sc->sc_dev), (size_t)m0->m_pkthdr.len,
-		rate);
-
-	STAILQ_INSERT_TAIL(&sc->tx_q, data, next);
-	usb2_transfer_start(sc->sc_xfer[ZYD_BULK_WR]);
-
-	return (0);
+	device_printf(sc->sc_dev, "unsupported rate %d\n", rate);
+	return (0x0);
 }
 
 static void
@@ -2542,7 +2440,7 @@ tr_setup:
 }
 
 static int
-zyd_tx_data(struct zyd_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
+zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
 	struct ieee80211com *ic = ni->ni_ic;
@@ -2552,24 +2450,31 @@ zyd_tx_data(struct zyd_softc *sc, struct
 	const struct ieee80211_txparam *tp;
 	struct ieee80211_key *k;
 	int rate, totlen;
+	static uint8_t ratediv[] = ZYD_TX_RATEDIV;
+	uint8_t phy;
 	uint16_t pktlen;
+	uint32_t bits;
 
 	wh = mtod(m0, struct ieee80211_frame *);
 	data = STAILQ_FIRST(&sc->tx_free);
 	STAILQ_REMOVE_HEAD(&sc->tx_free, next);
 	sc->tx_nfree--;
-	desc = &data->desc;
 
-	desc->flags = ZYD_TX_FLAG_BACKOFF;
-	tp = &vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)];
-	if (IEEE80211_IS_MULTICAST(wh->i_addr1)) {
-		rate = tp->mcastrate;
-		desc->flags |= ZYD_TX_FLAG_MULTICAST;
-	} else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
-		rate = tp->ucastrate;
+	if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT ||
+	    (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) {
+		tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
+		rate = tp->mgmtrate;
 	} else {
-		(void) ieee80211_amrr_choose(ni, &ZYD_NODE(ni)->amn);
-		rate = ni->ni_txrate;
+		tp = &vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)];
+		/* for data frames */
+		if (IEEE80211_IS_MULTICAST(wh->i_addr1))
+			rate = tp->mcastrate;
+		else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
+			rate = tp->ucastrate;
+		else {
+			(void) ieee80211_amrr_choose(ni, &ZYD_NODE(ni)->amn);
+			rate = ni->ni_txrate;
+		}
 	}
 
 	if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
@@ -2584,12 +2489,23 @@ zyd_tx_data(struct zyd_softc *sc, struct
 
 	data->ni = ni;
 	data->m = m0;
-
-	totlen = m0->m_pkthdr.len + IEEE80211_CRC_LEN;
+	data->rate = rate;
 
 	/* fill Tx descriptor */
+	desc = &data->desc;
+	phy = zyd_plcp_signal(sc, rate);
+	desc->phy = phy;
+	if (ZYD_RATE_IS_OFDM(rate)) {
+		desc->phy |= ZYD_TX_PHY_OFDM;
+		if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan))
+			desc->phy |= ZYD_TX_PHY_5GHZ;
+	} else if (rate != 2 && (ic->ic_flags & IEEE80211_F_SHPREAMBLE))
+		desc->phy |= ZYD_TX_PHY_SHPREAMBLE;
+
+	totlen = m0->m_pkthdr.len + IEEE80211_CRC_LEN;
 	desc->len = htole16(totlen);
 
+	desc->flags = ZYD_TX_FLAG_BACKOFF;
 	if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
 		/* multicast frames are not sent at OFDM rates in 802.11b/g */
 		if (totlen > vap->iv_rtsthreshold) {
@@ -2601,33 +2517,34 @@ zyd_tx_data(struct zyd_softc *sc, struct
 			else if (ic->ic_protmode == IEEE80211_PROT_RTSCTS)
 				desc->flags |= ZYD_TX_FLAG_RTS;
 		}
-	}
-
+	} else
+		desc->flags |= ZYD_TX_FLAG_MULTICAST;
 	if ((wh->i_fc[0] &
 	    (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) ==
 	    (IEEE80211_FC0_TYPE_CTL | IEEE80211_FC0_SUBTYPE_PS_POLL))
 		desc->flags |= ZYD_TX_FLAG_TYPE(ZYD_TX_TYPE_PS_POLL);
 
-	desc->phy = zyd_plcp_signal(rate);
-	if (ZYD_RATE_IS_OFDM(rate)) {
-		desc->phy |= ZYD_TX_PHY_OFDM;
-		if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan))
-			desc->phy |= ZYD_TX_PHY_5GHZ;
-	} else if (rate != 2 && (ic->ic_flags & IEEE80211_F_SHPREAMBLE))
-		desc->phy |= ZYD_TX_PHY_SHPREAMBLE;
-
 	/* actual transmit length (XXX why +10?) */
-	pktlen = sizeof(struct zyd_tx_desc) + 10;
+	pktlen = ZYD_TX_DESC_SIZE + 10;
 	if (sc->sc_macrev == ZYD_ZD1211)
 		pktlen += totlen;
 	desc->pktlen = htole16(pktlen);
 
-	desc->plcp_length = (16 * totlen + rate - 1) / rate;
+	bits = (rate == 11) ? (totlen * 16) + 10 :
+	    ((rate == 22) ? (totlen * 8) + 10 : (totlen * 8));
+	desc->plcp_length = bits / ratediv[phy];
 	desc->plcp_service = 0;
-	if (rate == 22) {
-		const int remainder = (16 * totlen) % 22;
-		if (remainder != 0 && remainder < 7)
-			desc->plcp_service |= ZYD_PLCP_LENGEXT;
+	if (rate == 22 && (bits % 11) > 0 && (bits % 11) <= 3)
+		desc->plcp_service |= ZYD_PLCP_LENGEXT;
+	desc->nextlen = 0;
+
+	if (ieee80211_radiotap_active_vap(vap)) {
+		struct zyd_tx_radiotap_header *tap = &sc->sc_txtap;
+
+		tap->wt_flags = 0;
+		tap->wt_rate = rate;
+
+		ieee80211_radiotap_tx(vap, m0);
 	}
 
 	DPRINTF(sc, ZYD_DEBUG_XMIT,
@@ -2659,7 +2576,7 @@ zyd_start(struct ifnet *ifp)
 			break;
 		}
 		ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
-		if (zyd_tx_data(sc, m, ni) != 0) {
+		if (zyd_tx_start(sc, m, ni) != 0) {
 			ieee80211_free_node(ni);
 			ifp->if_oerrors++;
 			break;
@@ -2697,7 +2614,7 @@ zyd_raw_xmit(struct ieee80211_node *ni, 
 	 * precisely how to send the frame.
 	 * XXX raw path
 	 */
-	if (zyd_tx_mgt(sc, m, ni) != 0) {
+	if (zyd_tx_start(sc, m, ni) != 0) {
 		ZYD_UNLOCK(sc);
 		ifp->if_oerrors++;
 		ieee80211_free_node(ni);

Modified: head/sys/dev/usb/wlan/if_zydreg.h
==============================================================================
--- head/sys/dev/usb/wlan/if_zydreg.h	Tue Jun  9 04:09:31 2009	(r193802)
+++ head/sys/dev/usb/wlan/if_zydreg.h	Tue Jun  9 04:17:08 2009	(r193803)
@@ -968,6 +968,12 @@
 	{ 0x26664, 0x20a53 }	\
 }
 
+#define	ZYD_TX_RATEDIV							\
+{									\
+	0x1, 0x2, 0xb, 0xb, 0x0, 0x0, 0x0, 0x0, 0x30, 0x18, 0xc, 0x6,	\
+	0x36, 0x24, 0x12, 0x9						\
+}
+
 /*
  * Control pipe requests.
  */

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 04:17:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F20ED1065688;
	Tue,  9 Jun 2009 04:17:36 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DF8198FC25;
	Tue,  9 Jun 2009 04:17:36 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n594Ha2a055388;
	Tue, 9 Jun 2009 04:17:36 GMT (envelope-from ariff@svn.freebsd.org)
Received: (from ariff@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n594Ham6055384;
	Tue, 9 Jun 2009 04:17:36 GMT (envelope-from ariff@svn.freebsd.org)
Message-Id: <200906090417.n594Ham6055384@svn.freebsd.org>
From: Ariff Abdullah 
Date: Tue, 9 Jun 2009 04: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: r193804 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 04:17:37 -0000

Author: ariff
Date: Tue Jun  9 04:17:36 2009
New Revision: 193804
URL: http://svn.freebsd.org/changeset/base/193804

Log:
  Move C1E workaround into its own idle function. Previous workaround works
  only during initial booting process, while there are laptops/BIOSes that
  tend to act 'smarter' by force enabling C1E if the main power adapter
  being pulled out, rendering previous workaround ineffective. Given the
  fact that we still rely on local APIC to drive timer interrupt, this
  workaround should keep all Turion (probably Phenom too) X\d+ alive whether
  its on battery power or not.
  
  URL:		http://lists.freebsd.org/pipermail/freebsd-acpi/2008-April/004858.html
      		http://lists.freebsd.org/pipermail/freebsd-acpi/2008-May/004888.html
  
  Tested by:	Peter Jeremy 

Modified:
  head/sys/amd64/amd64/local_apic.c
  head/sys/amd64/amd64/machdep.c
  head/sys/i386/i386/local_apic.c
  head/sys/i386/i386/machdep.c

Modified: head/sys/amd64/amd64/local_apic.c
==============================================================================
--- head/sys/amd64/amd64/local_apic.c	Tue Jun  9 04:17:08 2009	(r193803)
+++ head/sys/amd64/amd64/local_apic.c	Tue Jun  9 04:17:36 2009	(r193804)
@@ -329,29 +329,6 @@ lapic_setup(int boot)
 
 	/* XXX: Error and thermal LVTs */
 
-	if (cpu_vendor_id == CPU_VENDOR_AMD) {
-		/*
-		 * Detect the presence of C1E capability mostly on latest
-		 * dual-cores (or future) k8 family.  This feature renders
-		 * the local APIC timer dead, so we disable it by reading
-		 * the Interrupt Pending Message register and clearing both
-		 * C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27).
-		 * 
-		 * Reference:
-		 *   "BIOS and Kernel Developer's Guide for AMD NPT
-		 *    Family 0Fh Processors"
-		 *   #32559 revision 3.00
-		 */
-		if ((cpu_id & 0x00000f00) == 0x00000f00 &&
-		    (cpu_id & 0x0fff0000) >=  0x00040000) {
-			uint64_t msr;
-
-			msr = rdmsr(0xc0010055);
-			if (msr & 0x18000000)
-				wrmsr(0xc0010055, msr & ~0x18000000ULL);
-		}
-	}
-
 	intr_restore(eflags);
 }
 

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Tue Jun  9 04:17:08 2009	(r193803)
+++ head/sys/amd64/amd64/machdep.c	Tue Jun  9 04:17:36 2009	(r193804)
@@ -600,6 +600,69 @@ cpu_idle_acpi(int busy)
 		__asm __volatile("sti; hlt");
 }
 
+static int cpu_ident_amdc1e = 0;
+
+static int
+cpu_probe_amdc1e(void)
+{
+	int i;
+
+	/*
+	 * Forget it, if we're not using local APIC timer.
+	 */
+	if (resource_disabled("apic", 0) ||
+	    (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0))
+		return (0);
+
+	/*
+	 * Detect the presence of C1E capability mostly on latest
+	 * dual-cores (or future) k8 family.
+	 */
+	if (cpu_vendor_id == CPU_VENDOR_AMD &&
+	    (cpu_id & 0x00000f00) == 0x00000f00 &&
+	    (cpu_id & 0x0fff0000) >=  0x00040000) {
+		cpu_ident_amdc1e = 1;
+		return (1);
+	}
+
+	return (0);
+}
+
+/*
+ * C1E renders the local APIC timer dead, so we disable it by
+ * reading the Interrupt Pending Message register and clearing
+ * both C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27).
+ * 
+ * Reference:
+ *   "BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh Processors"
+ *   #32559 revision 3.00+
+ */
+#define	MSR_AMDK8_IPM		0xc0010055
+#define	AMDK8_SMIONCMPHALT	(1ULL << 27)
+#define	AMDK8_C1EONCMPHALT	(1ULL << 28)
+#define	AMDK8_CMPHALT		(AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT)
+
+static void
+cpu_idle_amdc1e(int busy)
+{
+
+	disable_intr();
+	if (sched_runnable())
+		enable_intr();
+	else {
+		uint64_t msr;
+
+		msr = rdmsr(MSR_AMDK8_IPM);
+		if (msr & AMDK8_CMPHALT)
+			wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT);
+
+		if (cpu_idle_hook)
+			cpu_idle_hook();
+		else
+			__asm __volatile("sti; hlt");
+	}
+}
+
 static void
 cpu_idle_spin(int busy)
 {
@@ -697,6 +760,7 @@ struct {
 	{ cpu_idle_spin, "spin" },
 	{ cpu_idle_mwait, "mwait" },
 	{ cpu_idle_mwait_hlt, "mwait_hlt" },
+	{ cpu_idle_amdc1e, "amdc1e" },
 	{ cpu_idle_hlt, "hlt" },
 	{ cpu_idle_acpi, "acpi" },
 	{ NULL, NULL }
@@ -715,6 +779,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG
 		if (strstr(idle_tbl[i].id_name, "mwait") &&
 		    (cpu_feature2 & CPUID2_MON) == 0)
 			continue;
+		if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 &&
+		    cpu_ident_amdc1e == 0)
+			continue;
 		p += sprintf(p, "%s, ", idle_tbl[i].id_name);
 	}
 	error = sysctl_handle_string(oidp, avail, 0, req);
@@ -745,6 +812,9 @@ idle_sysctl(SYSCTL_HANDLER_ARGS)
 		if (strstr(idle_tbl[i].id_name, "mwait") &&
 		    (cpu_feature2 & CPUID2_MON) == 0)
 			continue;
+		if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 &&
+		    cpu_ident_amdc1e == 0)
+			continue;
 		if (strcmp(idle_tbl[i].id_name, buf))
 			continue;
 		cpu_idle_fn = idle_tbl[i].id_fn;
@@ -1593,6 +1663,9 @@ hammer_time(u_int64_t modulep, u_int64_t
 	}
 #endif
 
+	if (cpu_probe_amdc1e())
+		cpu_idle_fn = cpu_idle_amdc1e;
+
 	/* Location of kernel stack for locore */
 	return ((u_int64_t)thread0.td_pcb);
 }

Modified: head/sys/i386/i386/local_apic.c
==============================================================================
--- head/sys/i386/i386/local_apic.c	Tue Jun  9 04:17:08 2009	(r193803)
+++ head/sys/i386/i386/local_apic.c	Tue Jun  9 04:17:36 2009	(r193804)
@@ -331,29 +331,6 @@ lapic_setup(int boot)
 
 	/* XXX: Error and thermal LVTs */
 
-	if (cpu_vendor_id == CPU_VENDOR_AMD) {
-		/*
-		 * Detect the presence of C1E capability mostly on latest
-		 * dual-cores (or future) k8 family.  This feature renders
-		 * the local APIC timer dead, so we disable it by reading
-		 * the Interrupt Pending Message register and clearing both
-		 * C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27).
-		 * 
-		 * Reference:
-		 *   "BIOS and Kernel Developer's Guide for AMD NPT
-		 *    Family 0Fh Processors"
-		 *   #32559 revision 3.00
-		 */
-		if ((cpu_id & 0x00000f00) == 0x00000f00 &&
-		    (cpu_id & 0x0fff0000) >=  0x00040000) {
-			uint64_t msr;
-
-			msr = rdmsr(0xc0010055);
-			if (msr & 0x18000000)
-				wrmsr(0xc0010055, msr & ~0x18000000ULL);
-		}
-	}
-
 	intr_restore(eflags);
 }
 

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Tue Jun  9 04:17:08 2009	(r193803)
+++ head/sys/i386/i386/machdep.c	Tue Jun  9 04:17:36 2009	(r193804)
@@ -1231,6 +1231,70 @@ cpu_idle_acpi(int busy)
 		__asm __volatile("sti; hlt");
 }
 
+static int cpu_ident_amdc1e = 0;
+
+static int
+cpu_probe_amdc1e(void)
+{ 
+#ifdef DEV_APIC
+	int i;
+
+	/*
+	 * Forget it, if we're not using local APIC timer.
+	 */
+	if (resource_disabled("apic", 0) ||
+	    (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0))
+		return (0);
+
+	/*
+	 * Detect the presence of C1E capability mostly on latest
+	 * dual-cores (or future) k8 family.
+	 */
+	if (cpu_vendor_id == CPU_VENDOR_AMD &&
+	    (cpu_id & 0x00000f00) == 0x00000f00 &&
+	    (cpu_id & 0x0fff0000) >=  0x00040000) {
+		cpu_ident_amdc1e = 1;
+		return (1);
+	}
+#endif
+	return (0);
+}
+
+/*
+ * C1E renders the local APIC timer dead, so we disable it by
+ * reading the Interrupt Pending Message register and clearing
+ * both C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27).
+ * 
+ * Reference:
+ *   "BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh Processors"
+ *   #32559 revision 3.00+
+ */
+#define	MSR_AMDK8_IPM		0xc0010055
+#define	AMDK8_SMIONCMPHALT	(1ULL << 27)
+#define	AMDK8_C1EONCMPHALT	(1ULL << 28)
+#define	AMDK8_CMPHALT		(AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT)
+
+static void
+cpu_idle_amdc1e(int busy)
+{
+
+	disable_intr();
+	if (sched_runnable())
+		enable_intr();
+	else {
+		uint64_t msr;
+
+		msr = rdmsr(MSR_AMDK8_IPM);
+		if (msr & AMDK8_CMPHALT)
+			wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT);
+
+		if (cpu_idle_hook)
+			cpu_idle_hook();
+		else
+			__asm __volatile("sti; hlt");
+	}
+}
+
 static void
 cpu_idle_spin(int busy)
 {
@@ -1332,6 +1396,7 @@ struct {
 	{ cpu_idle_spin, "spin" },
 	{ cpu_idle_mwait, "mwait" },
 	{ cpu_idle_mwait_hlt, "mwait_hlt" },
+	{ cpu_idle_amdc1e, "amdc1e" },
 	{ cpu_idle_hlt, "hlt" },
 	{ cpu_idle_acpi, "acpi" },
 	{ NULL, NULL }
@@ -1350,6 +1415,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG
 		if (strstr(idle_tbl[i].id_name, "mwait") &&
 		    (cpu_feature2 & CPUID2_MON) == 0)
 			continue;
+		if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 &&
+		    cpu_ident_amdc1e == 0)
+			continue;
 		p += sprintf(p, "%s, ", idle_tbl[i].id_name);
 	}
 	error = sysctl_handle_string(oidp, avail, 0, req);
@@ -1380,6 +1448,9 @@ idle_sysctl(SYSCTL_HANDLER_ARGS)
 		if (strstr(idle_tbl[i].id_name, "mwait") &&
 		    (cpu_feature2 & CPUID2_MON) == 0)
 			continue;
+		if (strcmp(idle_tbl[i].id_name, "amdc1e") == 0 &&
+		    cpu_ident_amdc1e == 0)
+			continue;
 		if (strcmp(idle_tbl[i].id_name, buf))
 			continue;
 		cpu_idle_fn = idle_tbl[i].id_fn;
@@ -2583,6 +2654,9 @@ init386(first)
 	thread0.td_frame = &proc0_tf;
 	thread0.td_pcb->pcb_fsd = PCPU_GET(fsgs_gdt)[0];
 	thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1];
+
+	if (cpu_probe_amdc1e())
+		cpu_idle_fn = cpu_idle_amdc1e;
 }
 
 #else
@@ -2847,6 +2921,9 @@ init386(first)
 #endif
 	thread0.td_pcb->pcb_ext = 0;
 	thread0.td_frame = &proc0_tf;
+
+	if (cpu_probe_amdc1e())
+		cpu_idle_fn = cpu_idle_amdc1e;
 }
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 05:18:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7CAE1065674;
	Tue,  9 Jun 2009 05:18:14 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C65F48FC0C;
	Tue,  9 Jun 2009 05:18:14 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n595IE84056671;
	Tue, 9 Jun 2009 05:18:14 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n595IEdc056670;
	Tue, 9 Jun 2009 05:18:14 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906090518.n595IEdc056670@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 9 Jun 2009 05:18: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: r193807 - head/usr.sbin/flowctl
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 05:18:15 -0000

Author: imp
Date: Tue Jun  9 05:18:14 2009
New Revision: 193807
URL: http://svn.freebsd.org/changeset/base/193807

Log:
  Use NG_PATHSIZ instead of NG_PATHLEN + 1.

Modified:
  head/usr.sbin/flowctl/flowctl.c

Modified: head/usr.sbin/flowctl/flowctl.c
==============================================================================
--- head/usr.sbin/flowctl/flowctl.c	Tue Jun  9 04:58:15 2009	(r193806)
+++ head/usr.sbin/flowctl/flowctl.c	Tue Jun  9 05:18:14 2009	(r193807)
@@ -150,7 +150,7 @@ ctl_show(int argc, char **argv)
 {
 	struct ng_mesg *ng_mesg;
 	struct ngnf_flows *data;
-	char path[NG_PATHLEN + 1];
+	char path[NG_PATHSIZ];
 	int token, nread, last = 0;
 	int verbose = 0;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 05:24:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF574106566C;
	Tue,  9 Jun 2009 05:24:06 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A445B8FC0A;
	Tue,  9 Jun 2009 05:24:06 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n595O695056993;
	Tue, 9 Jun 2009 05:24:06 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n595O61p056992;
	Tue, 9 Jun 2009 05:24:06 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906090524.n595O61p056992@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 9 Jun 2009 05:24:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193808 - head/usr.sbin/flowctl
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 05:24:07 -0000

Author: imp
Date: Tue Jun  9 05:24:06 2009
New Revision: 193808
URL: http://svn.freebsd.org/changeset/base/193808

Log:
  Get the other NG_PATHLEN while I'm here too :(.

Modified:
  head/usr.sbin/flowctl/flowctl.c

Modified: head/usr.sbin/flowctl/flowctl.c
==============================================================================
--- head/usr.sbin/flowctl/flowctl.c	Tue Jun  9 05:18:14 2009	(r193807)
+++ head/usr.sbin/flowctl/flowctl.c	Tue Jun  9 05:24:06 2009	(r193808)
@@ -77,7 +77,7 @@ struct ip_ctl_cmd cmds[] = {
 };
 
 int	cs;
-char	ng_nodename[NG_PATHLEN + 1];
+char	ng_nodename[NG_PATHSIZ];
 
 int
 main(int argc, char **argv)

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 06:34:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AFCD9106566C;
	Tue,  9 Jun 2009 06:34:48 +0000 (UTC)
	(envelope-from jkoshy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 842F38FC13;
	Tue,  9 Jun 2009 06:34:48 +0000 (UTC)
	(envelope-from jkoshy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n596YmSZ059075;
	Tue, 9 Jun 2009 06:34:48 GMT (envelope-from jkoshy@svn.freebsd.org)
Received: (from jkoshy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n596YmTi059074;
	Tue, 9 Jun 2009 06:34:48 GMT (envelope-from jkoshy@svn.freebsd.org)
Message-Id: <200906090634.n596YmTi059074@svn.freebsd.org>
From: Joseph Koshy 
Date: Tue, 9 Jun 2009 06:34: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: r193809 - head/lib/libpmc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 06:34:49 -0000

Author: jkoshy
Date: Tue Jun  9 06:34:48 2009
New Revision: 193809
URL: http://svn.freebsd.org/changeset/base/193809

Log:
  Fix parsing of Core2 event qualifiers.
  
  Submitted by:	Nikola K 

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==============================================================================
--- head/lib/libpmc/libpmc.c	Tue Jun  9 05:24:06 2009	(r193808)
+++ head/lib/libpmc/libpmc.c	Tue Jun  9 06:34:48 2009	(r193809)
@@ -591,22 +591,22 @@ iap_allocate_pmc(enum pmc_event pe, char
 			pmc_config->pm_caps |= PMC_CAP_USER;
 		} else if (KWMATCH(p, IAP_KW_ANYTHREAD)) {
 			pmc_config->pm_md.pm_iap.pm_iap_config |= IAP_ANY;
-		} else if (KWMATCH(p, IAP_KW_CORE)) {
+		} else if (KWPREFIXMATCH(p, IAP_KW_CORE "=")) {
 			n = pmc_parse_mask(iap_core_mask, p, &evmask);
 			if (n != 1)
 				return (-1);
-		} else if (KWMATCH(p, IAP_KW_AGENT)) {
+		} else if (KWPREFIXMATCH(p, IAP_KW_AGENT "=")) {
 			n = pmc_parse_mask(iap_agent_mask, p, &evmask);
 			if (n != 1)
 				return (-1);
-		} else if (KWMATCH(p, IAP_KW_PREFETCH)) {
+		} else if (KWPREFIXMATCH(p, IAP_KW_PREFETCH "=")) {
 			n = pmc_parse_mask(iap_prefetch_mask, p, &evmask);
 			if (n != 1)
 				return (-1);
-		} else if (KWMATCH(p, IAP_KW_CACHESTATE)) {
+		} else if (KWPREFIXMATCH(p, IAP_KW_CACHESTATE "=")) {
 			n = pmc_parse_mask(iap_cachestate_mask, p, &cachestate);
 		} else if (cpu_info.pm_cputype == PMC_CPU_INTEL_CORE &&
-		    KWMATCH(p, IAP_KW_TRANSITION)) {
+		    KWPREFIXMATCH(p, IAP_KW_TRANSITION "=")) {
 			n = pmc_parse_mask(iap_transition_mask, p, &evmask);
 			if (n != 1)
 				return (-1);
@@ -614,10 +614,10 @@ iap_allocate_pmc(enum pmc_event pe, char
 		    cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2 ||
 		    cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2EXTREME ||
 		    cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7) {
-			if (KWMATCH(p, IAP_KW_SNOOPRESPONSE)) {
+			if (KWPREFIXMATCH(p, IAP_KW_SNOOPRESPONSE "=")) {
 				n = pmc_parse_mask(iap_snoopresponse_mask, p,
 				    &evmask);
-			} else if (KWMATCH(p, IAP_KW_SNOOPTYPE)) {
+			} else if (KWPREFIXMATCH(p, IAP_KW_SNOOPTYPE "=")) {
 				n = pmc_parse_mask(iap_snooptype_mask, p,
 				    &evmask);
 			} else

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 06:36:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27341106566C;
	Tue,  9 Jun 2009 06:36:30 +0000 (UTC)
	(envelope-from jkoshy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 163938FC1A;
	Tue,  9 Jun 2009 06:36:30 +0000 (UTC)
	(envelope-from jkoshy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n596aTne059148;
	Tue, 9 Jun 2009 06:36:29 GMT (envelope-from jkoshy@svn.freebsd.org)
Received: (from jkoshy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n596aT61059147;
	Tue, 9 Jun 2009 06:36:29 GMT (envelope-from jkoshy@svn.freebsd.org)
Message-Id: <200906090636.n596aT61059147@svn.freebsd.org>
From: Joseph Koshy 
Date: Tue, 9 Jun 2009 06:36:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193810 - head/lib/libpmc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 06:36:30 -0000

Author: jkoshy
Date: Tue Jun  9 06:36:29 2009
New Revision: 193810
URL: http://svn.freebsd.org/changeset/base/193810

Log:
  Document the fact that some Core2 family CPUs lack fixed-function counters.

Modified:
  head/lib/libpmc/pmc.core2.3

Modified: head/lib/libpmc/pmc.core2.3
==============================================================================
--- head/lib/libpmc/pmc.core2.3	Tue Jun  9 06:34:48 2009	(r193809)
+++ head/lib/libpmc/pmc.core2.3	Tue Jun  9 06:36:29 2009	(r193810)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2008 Joseph Koshy.  All rights reserved.
+.\" Copyright (c) 2008,2009 Joseph Koshy.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 12, 2008
+.Dd June 8, 2009
 .Os
 .Dt PMC.CORE2 3
 .Sh NAME
@@ -42,7 +42,7 @@ family CPUs
 CPUs contain PMCs conforming to version 2 of the
 .Tn Intel
 performance measurement architecture.
-These CPUs contains two classes of PMCs:
+These CPUs may contain upto two classes of PMCs:
 .Bl -tag -width "Li PMC_CLASS_IAP"
 .It Li PMC_CLASS_IAF
 Fixed-function counters that count only one hardware event per counter.
@@ -66,6 +66,7 @@ Intel Core2 PMCs are documented in
 .Ss CORE2 FIXED FUNCTION PMCS
 These PMCs and their supported events are documented in
 .Xr pmc.iaf 3 .
+Not all CPUs in this family implement fixed-function counters.
 .Ss CORE2 PROGRAMMABLE PMCS
 The programmable PMCs support the following capabilities:
 .Bl -column "PMC_CAP_INTERRUPT" "Support"

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 07:07:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B93941065673;
	Tue,  9 Jun 2009 07:07:22 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 09D418FC27;
	Tue,  9 Jun 2009 07:07:21 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5977KFe059853;
	Tue, 9 Jun 2009 07:07:20 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5977K7b059852;
	Tue, 9 Jun 2009 07:07:20 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906090707.n5977K7b059852@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 9 Jun 2009 07:07:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193812 - head/sys/netgraph
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 07:07:23 -0000

Author: imp
Date: Tue Jun  9 07:07:20 2009
New Revision: 193812
URL: http://svn.freebsd.org/changeset/base/193812

Log:
  World now builds without these defines, so eliminate them.
  
  Approved by:	julian@

Modified:
  head/sys/netgraph/ng_message.h

Modified: head/sys/netgraph/ng_message.h
==============================================================================
--- head/sys/netgraph/ng_message.h	Tue Jun  9 06:50:11 2009	(r193811)
+++ head/sys/netgraph/ng_message.h	Tue Jun  9 07:07:20 2009	(r193812)
@@ -51,15 +51,6 @@
 #define	NG_PATHSIZ	512	/* max path len (including null) */
 #define	NG_CMDSTRSIZ	32	/* max command string (including null) */
 
-#ifndef BURN_BRIDGES
-/* don't use these - they will go away */
-#define NG_TYPELEN	(NG_TYPESIZ - 1)
-#define NG_HOOKLEN	(NG_HOOKSIZ - 1)
-#define NG_NODELEN	(NG_NODESIZ - 1)
-#define NG_PATHLEN	(NG_PATHSIZ - 1)
-#define NG_CMDSTRLEN	(NG_CMDSTRSIZ - 1)
-#endif
-
 #define NG_TEXTRESPONSE 1024	/* allow this length for a text response */
 
 /* A netgraph message */

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 07:14:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A3081065673;
	Tue,  9 Jun 2009 07:14:33 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E2A58FC19;
	Tue,  9 Jun 2009 07:14:33 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n597EXhP060042;
	Tue, 9 Jun 2009 07:14:33 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n597EWe0060038;
	Tue, 9 Jun 2009 07:14:32 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906090714.n597EWe0060038@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 9 Jun 2009 07:14: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: r193813 - in head/sys/dev: ce cp ctau cx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 07:14:33 -0000

Author: imp
Date: Tue Jun  9 07:14:32 2009
New Revision: 193813
URL: http://svn.freebsd.org/changeset/base/193813

Log:
  Use new spelling of the NG_*LEN constants.

Modified:
  head/sys/dev/ce/if_ce.c
  head/sys/dev/cp/if_cp.c
  head/sys/dev/ctau/if_ct.c
  head/sys/dev/cx/if_cx.c

Modified: head/sys/dev/ce/if_ce.c
==============================================================================
--- head/sys/dev/ce/if_ce.c	Tue Jun  9 07:07:20 2009	(r193812)
+++ head/sys/dev/ce/if_ce.c	Tue Jun  9 07:14:32 2009	(r193813)
@@ -165,7 +165,7 @@ typedef struct _drv_t {
 	ce_chan_t	*chan;
 	struct ifqueue	rqueue;
 #ifdef NETGRAPH
-	char	nodename [NG_NODELEN+1];
+	char	nodename [NG_NODESIZE];
 	hook_p	hook;
 	hook_p	debug_hook;
 	node_p	node;
@@ -2358,7 +2358,7 @@ static int ng_ce_rcvmsg (node_p node, st
 			(resp)->header.typecookie = NGM_CE_COOKIE;
 			(resp)->header.cmd = msg->header.cmd;
 #endif
-			strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRLEN);
+			strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRSIZ);
 			}
 			break;
 		}

Modified: head/sys/dev/cp/if_cp.c
==============================================================================
--- head/sys/dev/cp/if_cp.c	Tue Jun  9 07:07:20 2009	(r193812)
+++ head/sys/dev/cp/if_cp.c	Tue Jun  9 07:14:32 2009	(r193813)
@@ -111,7 +111,7 @@ typedef struct _drv_t {
 	cp_board_t	*board;
 	cp_dma_mem_t	dmamem;
 #ifdef NETGRAPH
-	char	nodename [NG_NODELEN+1];
+	char	nodename [NG_NODESIZE];
 	hook_p	hook;
 	hook_p	debug_hook;
 	node_p	node;
@@ -2121,7 +2121,7 @@ static int ng_cp_rcvmsg (node_p node, it
 			l += print_e1_stats (s + l, d->chan);
 			} else
 				l += sprintf (s + l, "Error: node not connect to channel");
-			strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRLEN);
+			strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRSIZ);
 			}
 			break;
 		}

Modified: head/sys/dev/ctau/if_ct.c
==============================================================================
--- head/sys/dev/ctau/if_ct.c	Tue Jun  9 07:07:20 2009	(r193812)
+++ head/sys/dev/ctau/if_ct.c	Tue Jun  9 07:14:32 2009	(r193813)
@@ -112,7 +112,7 @@ typedef struct _drv_t {
 	ct_dma_mem_t dmamem;
 	int running;
 #ifdef NETGRAPH
-	char	nodename [NG_NODELEN+1];
+	char	nodename [NG_NODESIZ];
 	hook_p	hook;
 	hook_p	debug_hook;
 	node_p	node;
@@ -2061,7 +2061,7 @@ static int ng_ct_rcvmsg (node_p node, it
 			l += print_stats (s + l, d->chan, 1);
 			l += print_modems (s + l, d->chan, 1);
 			l += print_e1_stats (s + l, d->chan);
-			strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRLEN);
+			strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRSIZ);
 			}
 			break;
 		}

Modified: head/sys/dev/cx/if_cx.c
==============================================================================
--- head/sys/dev/cx/if_cx.c	Tue Jun  9 07:07:20 2009	(r193812)
+++ head/sys/dev/cx/if_cx.c	Tue Jun  9 07:14:32 2009	(r193813)
@@ -137,7 +137,7 @@ typedef struct _drv_t {
 	int cd;
 	int running;
 #ifdef NETGRAPH
-	char	nodename [NG_NODELEN+1];
+	char	nodename [NG_NODESIZ];
 	hook_p	hook;
 	hook_p	debug_hook;
 	node_p	node;
@@ -2399,7 +2399,7 @@ static int ng_cx_rcvmsg (node_p node, it
 			l += print_chan (s + l, d->chan);
 			l += print_stats (s + l, d->chan, 1);
 			l += print_modems (s + l, d->chan, 1);
-			strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRLEN);
+			strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRSIZ);
 			}
 			break;
 		}

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 07:26:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA9A410656C8;
	Tue,  9 Jun 2009 07:26:52 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A927E8FC1B;
	Tue,  9 Jun 2009 07:26:52 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n597QqEw060308;
	Tue, 9 Jun 2009 07:26:52 GMT (envelope-from ariff@svn.freebsd.org)
Received: (from ariff@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n597QqEk060306;
	Tue, 9 Jun 2009 07:26:52 GMT (envelope-from ariff@svn.freebsd.org)
Message-Id: <200906090726.n597QqEk060306@svn.freebsd.org>
From: Ariff Abdullah 
Date: Tue, 9 Jun 2009 07: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: r193814 - in head/sys: amd64/isa i386/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 07:26:53 -0000

Author: ariff
Date: Tue Jun  9 07:26:52 2009
New Revision: 193814
URL: http://svn.freebsd.org/changeset/base/193814

Log:
  When using i8254 as the only kernel timer source:
  
  - Interpolate stat/prof clock using clkintr() in a similar fashion to
    local APIC timer, since statclock usually run slower.
  
  - Liberate hardclockintr() from taking the burden of handling both stat
    and prof clock interrupt. Instead, send IPIs within clkintr() to handle
    those.

Modified:
  head/sys/amd64/isa/clock.c
  head/sys/i386/isa/clock.c

Modified: head/sys/amd64/isa/clock.c
==============================================================================
--- head/sys/amd64/isa/clock.c	Tue Jun  9 07:14:32 2009	(r193813)
+++ head/sys/amd64/isa/clock.c	Tue Jun  9 07:26:52 2009	(r193814)
@@ -93,6 +93,9 @@ static	int	i8254_ticked;
 static	int	using_atrtc_timer;
 static	int	using_lapic_timer;
 
+static	u_int	stat_ticks = 0;
+static	u_int	prof_ticks = 0;
+
 /* Values for timerX_state: */
 #define	RELEASED	0
 #define	RELEASE_PENDING	1
@@ -122,8 +125,6 @@ hardclockintr(struct trapframe *frame)
 		hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
 	else
 		hardclock_cpu(TRAPF_USERMODE(frame));
-	if (!using_atrtc_timer)
-		statclockintr(frame);
 	return (FILTER_HANDLED);
 }
 
@@ -131,8 +132,6 @@ int
 statclockintr(struct trapframe *frame)
 {
 
-	if (profprocs != 0)
-		profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
 	statclock(TRAPF_USERMODE(frame));
 	return (FILTER_HANDLED);
 }
@@ -166,6 +165,30 @@ clkintr(struct trapframe *frame)
 		ipi_all_but_self(IPI_HARDCLOCK);
 #endif
 	hardclockintr(frame);
+
+	if (!using_atrtc_timer) {
+		prof_ticks += profhz;
+		if (prof_ticks >= hz) {
+			prof_ticks -= hz;
+			if (profprocs != 0) {
+#ifdef SMP
+				if (smp_started)
+					ipi_all_but_self(IPI_PROFCLOCK);
+#endif
+				profclockintr(frame);
+			}
+		}
+		stat_ticks += stathz;
+		if (stat_ticks >= hz) {
+			stat_ticks -= hz;
+#ifdef SMP
+			if (smp_started)
+				ipi_all_but_self(IPI_STATCLOCK);
+#endif
+			statclockintr(frame);
+		}
+	}
+
 	return (FILTER_HANDLED);
 }
 
@@ -500,7 +523,8 @@ cpu_initclocks()
 			    INTR_TYPE_CLK, NULL);
 			atrtc_enable_intr();
 		} else {
-			profhz = stathz = hz;
+			profhz = min(RTC_PROFRATE, hz);
+			stathz = min(RTC_NOPROFRATE, hz);
 		}
 	}
 
@@ -511,7 +535,7 @@ void
 cpu_startprofclock(void)
 {
 
-	if (using_lapic_timer)
+	if (using_lapic_timer || !using_atrtc_clock)
 		return;
 	atrtc_rate(RTCSA_PROF);
 	psdiv = pscnt = psratio;
@@ -521,7 +545,7 @@ void
 cpu_stopprofclock(void)
 {
 
-	if (using_lapic_timer)
+	if (using_lapic_timer || !using_atrtc_clock)
 		return;
 	atrtc_rate(RTCSA_NOPROF);
 	psdiv = pscnt = 1;

Modified: head/sys/i386/isa/clock.c
==============================================================================
--- head/sys/i386/isa/clock.c	Tue Jun  9 07:14:32 2009	(r193813)
+++ head/sys/i386/isa/clock.c	Tue Jun  9 07:26:52 2009	(r193814)
@@ -108,6 +108,9 @@ static	int	i8254_ticked;
 static	int	using_atrtc_timer;
 static	int	using_lapic_timer;
 
+static	u_int	stat_ticks = 0;
+static	u_int	prof_ticks = 0;
+
 /* Values for timerX_state: */
 #define	RELEASED	0
 #define	RELEASE_PENDING	1
@@ -137,8 +140,6 @@ hardclockintr(struct trapframe *frame)
 		hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
 	else
 		hardclock_cpu(TRAPF_USERMODE(frame));
-	if (!using_atrtc_timer)
-		statclockintr(frame);
 	return (FILTER_HANDLED);
 }
 
@@ -146,8 +147,6 @@ int
 statclockintr(struct trapframe *frame)
 {
 
-	if (profprocs != 0)
-		profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
 	statclock(TRAPF_USERMODE(frame));
 	return (FILTER_HANDLED);
 }
@@ -193,6 +192,30 @@ clkintr(struct trapframe *frame)
 		ipi_all_but_self(IPI_HARDCLOCK);
 #endif 
 	hardclockintr(frame);
+
+	if (!using_atrtc_timer) {
+		prof_ticks += profhz;
+		if (prof_ticks >= hz) {
+			prof_ticks -= hz;
+			if (profprocs != 0) {
+#ifdef SMP
+				if (smp_started)
+					ipi_all_but_self(IPI_PROFCLOCK);
+#endif
+				profclockintr(frame);
+			}
+		}
+		stat_ticks += stathz;
+		if (stat_ticks >= hz) {
+			stat_ticks -= hz;
+#ifdef SMP
+			if (smp_started)
+				ipi_all_but_self(IPI_STATCLOCK);
+#endif
+			statclockintr(frame);
+		}
+	}
+
 #ifdef DEV_MCA
 	/* Reset clock interrupt by asserting bit 7 of port 0x61 */
 	if (MCA_system)
@@ -549,7 +572,8 @@ cpu_initclocks()
 			    INTR_TYPE_CLK, NULL);
 			atrtc_enable_intr();
 		} else {
-			profhz = stathz = hz;
+			profhz = min(RTC_PROFRATE, hz);
+			stathz = min(RTC_NOPROFRATE, hz);
 		}
 	}
 
@@ -560,7 +584,7 @@ void
 cpu_startprofclock(void)
 {
 
-	if (using_lapic_timer)
+	if (using_lapic_timer || !using_atrtc_timer)
 		return;
 	atrtc_rate(RTCSA_PROF);
 	psdiv = pscnt = psratio;
@@ -570,7 +594,7 @@ void
 cpu_stopprofclock(void)
 {
 
-	if (using_lapic_timer)
+	if (using_lapic_timer || !using_atrtc_timer)
 		return;
 	atrtc_rate(RTCSA_NOPROF);
 	psdiv = pscnt = 1;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 08:09:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9C40A106566B;
	Tue,  9 Jun 2009 08:09:30 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B5018FC12;
	Tue,  9 Jun 2009 08:09:30 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5989UJI061385;
	Tue, 9 Jun 2009 08:09:30 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5989Ue9061384;
	Tue, 9 Jun 2009 08:09:30 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200906090809.n5989Ue9061384@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jun 2009 08:09:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193815 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 08:09:31 -0000

Author: hrs
Date: Tue Jun  9 08:09:30 2009
New Revision: 193815
URL: http://svn.freebsd.org/changeset/base/193815

Log:
  Style fix.
  
  Submitted by:	bz

Modified:
  head/sys/net/if_gif.c

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Tue Jun  9 07:26:52 2009	(r193814)
+++ head/sys/net/if_gif.c	Tue Jun  9 08:09:30 2009	(r193815)
@@ -912,13 +912,13 @@ gif_ioctl(ifp, cmd, data)
 	case GIFSOPTS:
 		if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0)
 			break;
-		if (!(error = copyin(ifr->ifr_data, &options,
-				sizeof(options)))) {
-			if ((options | GIF_OPTMASK) == GIF_OPTMASK)
-				sc->gif_options = options;
-			else
-				error = EINVAL;
-		}
+		error = copyin(ifr->ifr_data, &options, sizeof(options));
+		if (error)
+			break;
+		if (options & ~GIF_OPTMASK)
+			error = EINVAL;
+		else
+			sc->gif_options = options;
 		break;
 
 	default:

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 09:02:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C0EA9106566C;
	Tue,  9 Jun 2009 09:02:58 +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 AF8958FC0A;
	Tue,  9 Jun 2009 09:02:58 +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 n5992wvt062535;
	Tue, 9 Jun 2009 09:02:58 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5992w1R062534;
	Tue, 9 Jun 2009 09:02:58 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200906090902.n5992w1R062534@svn.freebsd.org>
From: Xin LI 
Date: Tue, 9 Jun 2009 09:02: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: r193817 - head/lib/libc/stdtime
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 09:02:59 -0000

Author: delphij
Date: Tue Jun  9 09:02:58 2009
New Revision: 193817
URL: http://svn.freebsd.org/changeset/base/193817

Log:
  Spacing fixes.  No actual change.

Modified:
  head/lib/libc/stdtime/strftime.c

Modified: head/lib/libc/stdtime/strftime.c
==============================================================================
--- head/lib/libc/stdtime/strftime.c	Tue Jun  9 08:13:43 2009	(r193816)
+++ head/lib/libc/stdtime/strftime.c	Tue Jun  9 09:02:58 2009	(r193817)
@@ -57,7 +57,7 @@ extern char *	tzname[];
 #define IN_THIS	2
 #define IN_ALL	3
 
-#define PAD_DEFAULT 0
+#define PAD_DEFAULT	0
 #define PAD_LESS	1
 #define PAD_SPACE	2
 #define PAD_ZERO	3
@@ -65,7 +65,7 @@ extern char *	tzname[];
 static const char* fmt_padding[][4] = {
 	/* DEFAULT,	LESS,	SPACE,	ZERO */
 #define PAD_FMT_MONTHDAY	0
-#define PAD_FMT_HMS			0
+#define PAD_FMT_HMS		0
 #define PAD_FMT_CENTURY		0
 #define PAD_FMT_SHORTYEAR	0
 #define PAD_FMT_MONTH		0

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 09:03:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5F273106566B;
	Tue,  9 Jun 2009 09:03:13 +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 4E0E08FC16;
	Tue,  9 Jun 2009 09:03:13 +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 n5993D08062580;
	Tue, 9 Jun 2009 09:03:13 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5993D3E062579;
	Tue, 9 Jun 2009 09:03:13 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906090903.n5993D3E062579@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Tue, 9 Jun 2009 09:03:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193818 - head/sys/modules/sound/sound
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 09:03:13 -0000

Author: bz
Date: Tue Jun  9 09:03:13 2009
New Revision: 193818
URL: http://svn.freebsd.org/changeset/base/193818

Log:
  Depend on @ machine (_ILINKS) as we do with other modules so that @
  is there for parallel (-jN) builds.  Ideally beforedepends in kmod.mk
  should do the right thing but it seems it does not.

Modified:
  head/sys/modules/sound/sound/Makefile

Modified: head/sys/modules/sound/sound/Makefile
==============================================================================
--- head/sys/modules/sound/sound/Makefile	Tue Jun  9 09:02:58 2009	(r193817)
+++ head/sys/modules/sound/sound/Makefile	Tue Jun  9 09:03:13 2009	(r193818)
@@ -19,13 +19,13 @@ SRCS+=	ac97.c ac97_patch.c buffer.c chan
 SRCS+=	mixer.c sndstat.c sound.c unit.c vchan.c
 SRCS+=	midi.c mpu401.c sequencer.c
 
-feeder_eq_gen.h:
+feeder_eq_gen.h:	@ machine
 	${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
 
-feeder_rate_gen.h:
+feeder_rate_gen.h:	@ machine
 	${AWK} -f @/tools/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
 
-snd_fxdiv_gen.h:
+snd_fxdiv_gen.h:	@ machine
 	${AWK} -f @/tools/snd_fxdiv_gen.awk -- > ${.TARGET}
 
 CLEANFILES+=	feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 09:10:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3AC3A106564A;
	Tue,  9 Jun 2009 09:10:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3])
	by mx1.freebsd.org (Postfix) with ESMTP id E6CC08FC15;
	Tue,  9 Jun 2009 09:10:06 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id E048F41C732;
	Tue,  9 Jun 2009 11:10:05 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([195.88.108.3])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id wHeSYkcP+nSu; Tue,  9 Jun 2009 11:10:05 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id 77AFB41C729; Tue,  9 Jun 2009 11:10:05 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id AD1A34448E6;
	Tue,  9 Jun 2009 09:07:38 +0000 (UTC)
Date: Tue, 9 Jun 2009 09:07:38 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-head@freebsd.org
In-Reply-To: <200906090903.n5993D3E062579@svn.freebsd.org>
Message-ID: <20090609090541.D22887@maildrop.int.zabbadoz.net>
References: <200906090903.n5993D3E062579@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: 
Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 -
 head/sys/modules/sound/sound]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 09:10:07 -0000

On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:

> Author: bz
> Date: Tue Jun  9 09:03:13 2009
> New Revision: 193818
> URL: http://svn.freebsd.org/changeset/base/193818
>
> Log:
>  Depend on @ machine (_ILINKS) as we do with other modules so that @
>  is there for parallel (-jN) builds.  Ideally beforedepends in kmod.mk
>  should do the right thing but it seems it does not.


Anyone with lots of build framework know how may want to look at this.

/bz


PS: In case you do I'd have another request to be able to have an
option similar to COPTFLAGS that will actually be passed down to
module builds - at least for make buildkernel/universe/..



> Modified:
>  head/sys/modules/sound/sound/Makefile
>
> Modified: head/sys/modules/sound/sound/Makefile
> ==============================================================================
> --- head/sys/modules/sound/sound/Makefile	Tue Jun  9 09:02:58 2009	(r193817)
> +++ head/sys/modules/sound/sound/Makefile	Tue Jun  9 09:03:13 2009	(r193818)
> @@ -19,13 +19,13 @@ SRCS+=	ac97.c ac97_patch.c buffer.c chan
> SRCS+=	mixer.c sndstat.c sound.c unit.c vchan.c
> SRCS+=	midi.c mpu401.c sequencer.c
>
> -feeder_eq_gen.h:
> +feeder_eq_gen.h:	@ machine
> 	${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
>
> -feeder_rate_gen.h:
> +feeder_rate_gen.h:	@ machine
> 	${AWK} -f @/tools/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
>
> -snd_fxdiv_gen.h:
> +snd_fxdiv_gen.h:	@ machine
> 	${AWK} -f @/tools/snd_fxdiv_gen.awk -- > ${.TARGET}
>
> CLEANFILES+=	feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h
>

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 09:47:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB134106568B;
	Tue,  9 Jun 2009 09:47:02 +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 998F08FC28;
	Tue,  9 Jun 2009 09:47:02 +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 n599l2Jc063459;
	Tue, 9 Jun 2009 09:47:02 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n599l22x063458;
	Tue, 9 Jun 2009 09:47:02 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906090947.n599l22x063458@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Tue, 9 Jun 2009 09:47: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: r193819 - head/sys/amd64/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 09:47:03 -0000

Author: bz
Date: Tue Jun  9 09:47:02 2009
New Revision: 193819
URL: http://svn.freebsd.org/changeset/base/193819

Log:
  Unbreak the build for amd64 after r193814 using correct variable names.

Modified:
  head/sys/amd64/isa/clock.c

Modified: head/sys/amd64/isa/clock.c
==============================================================================
--- head/sys/amd64/isa/clock.c	Tue Jun  9 09:03:13 2009	(r193818)
+++ head/sys/amd64/isa/clock.c	Tue Jun  9 09:47:02 2009	(r193819)
@@ -535,7 +535,7 @@ void
 cpu_startprofclock(void)
 {
 
-	if (using_lapic_timer || !using_atrtc_clock)
+	if (using_lapic_timer || !using_atrtc_timer)
 		return;
 	atrtc_rate(RTCSA_PROF);
 	psdiv = pscnt = psratio;
@@ -545,7 +545,7 @@ void
 cpu_stopprofclock(void)
 {
 
-	if (using_lapic_timer || !using_atrtc_clock)
+	if (using_lapic_timer || !using_atrtc_timer)
 		return;
 	atrtc_rate(RTCSA_NOPROF);
 	psdiv = pscnt = 1;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 09:50:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 33096106566B;
	Tue,  9 Jun 2009 09:50:44 +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 219378FC27;
	Tue,  9 Jun 2009 09:50:44 +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 n599oipD063583;
	Tue, 9 Jun 2009 09:50:44 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n599oiX2063582;
	Tue, 9 Jun 2009 09:50:44 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906090950.n599oiX2063582@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Tue, 9 Jun 2009 09:50:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193820 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 09:50:44 -0000

Author: bz
Date: Tue Jun  9 09:50:43 2009
New Revision: 193820
URL: http://svn.freebsd.org/changeset/base/193820

Log:
  Remove one INET dependency by calling the general
  AF agnostic version for doing the routing lookup.
  
  Reviewed by:	kmacy

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Tue Jun  9 09:47:02 2009	(r193819)
+++ head/sys/net/flowtable.c	Tue Jun  9 09:50:43 2009	(r193820)
@@ -407,7 +407,7 @@ static void
 in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fib)
 {
 
-	in_rtalloc_ign(ro, 0, fib);
+	rtalloc_ign_fib(ro, 0, fib);
 }
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 09:54:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from miki (localhost [IPv6:::1])
	by hub.freebsd.org (Postfix) with SMTP id E244E1065675;
	Tue,  9 Jun 2009 09:54:50 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Date: Tue, 9 Jun 2009 17:54:47 +0800
From: Ariff Abdullah 
To: "Bjoern A. Zeeb" 
Message-Id: <20090609175447.3c36cd5d.ariff@FreeBSD.org>
In-Reply-To: <200906090947.n599l22x063458@svn.freebsd.org>
References: <200906090947.n599l22x063458@svn.freebsd.org>
Organization: FreeBSD
X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature";
	micalg="PGP-SHA1";
	boundary="Signature=_Tue__9_Jun_2009_17_54_47_+0800_9n_KLNxncLzKyMAZ"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193819 - head/sys/amd64/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 09:54:52 -0000

--Signature=_Tue__9_Jun_2009_17_54_47_+0800_9n_KLNxncLzKyMAZ
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, 9 Jun 2009 09:47:02 +0000 (UTC)
"Bjoern A. Zeeb"  wrote:
> Author: bz
> Date: Tue Jun  9 09:47:02 2009
> New Revision: 193819
> URL: http://svn.freebsd.org/changeset/base/193819
>=20
> Log:
>   Unbreak the build for amd64 after r193814 using correct variable
>   names.
>=20

My bad. Sorry :(

--
Ariff Abdullah
FreeBSD

... Recording in stereo is obviously too advanced
    and confusing for us idiot ***** users :P ........

... Going with the standard and orthodox
    is the death of intellect ..............

--Signature=_Tue__9_Jun_2009_17_54_47_+0800_9n_KLNxncLzKyMAZ
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkouMWcACgkQlr+deMUwTNrEYACfRyWEKn/0Iu/5xUtp6jjigslY
lFEAoKgmNmAlkU254FGYkG0jduyEOie3
=v95u
-----END PGP SIGNATURE-----

--Signature=_Tue__9_Jun_2009_17_54_47_+0800_9n_KLNxncLzKyMAZ--

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 10:05:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EC551065679;
	Tue,  9 Jun 2009 10:05:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3])
	by mx1.freebsd.org (Postfix) with ESMTP id E9BB78FC1C;
	Tue,  9 Jun 2009 10:05:06 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 3192741C750;
	Tue,  9 Jun 2009 12:05:06 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([195.88.108.3])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id VPL342Ha8BhJ; Tue,  9 Jun 2009 12:05:05 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id CC28641C75A; Tue,  9 Jun 2009 12:05:05 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id 412D84448E6;
	Tue,  9 Jun 2009 10:01:45 +0000 (UTC)
Date: Tue, 9 Jun 2009 10:01:45 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Ariff Abdullah 
In-Reply-To: <20090609175447.3c36cd5d.ariff@FreeBSD.org>
Message-ID: <20090609095938.Q22887@maildrop.int.zabbadoz.net>
References: <200906090947.n599l22x063458@svn.freebsd.org>
	<20090609175447.3c36cd5d.ariff@FreeBSD.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193819 - head/sys/amd64/isa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 10:05:07 -0000

On Tue, 9 Jun 2009, Ariff Abdullah wrote:

> On Tue, 9 Jun 2009 09:47:02 +0000 (UTC)
> "Bjoern A. Zeeb"  wrote:
>> Author: bz
>> Date: Tue Jun  9 09:47:02 2009
>> New Revision: 193819
>> URL: http://svn.freebsd.org/changeset/base/193819
>>
>> Log:
>>   Unbreak the build for amd64 after r193814 using correct variable
>>   names.
>>
>
> My bad. Sorry :(

Oh you are still awake; if I had known that;-)

No problem; It was easily fixable and as I am doing continues builds
anyway at the moment...

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 10:17:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6C5B1065674;
	Tue,  9 Jun 2009 10:17:22 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9538D8FC12;
	Tue,  9 Jun 2009 10:17:22 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59AHMpH064326;
	Tue, 9 Jun 2009 10:17:22 GMT (envelope-from ariff@svn.freebsd.org)
Received: (from ariff@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59AHMZT064325;
	Tue, 9 Jun 2009 10:17:22 GMT (envelope-from ariff@svn.freebsd.org)
Message-Id: <200906091017.n59AHMZT064325@svn.freebsd.org>
From: Ariff Abdullah 
Date: Tue, 9 Jun 2009 10:17:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193821 - head/sys/modules/sound/sound
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 10:17:23 -0000

Author: ariff
Date: Tue Jun  9 10:17:22 2009
New Revision: 193821
URL: http://svn.freebsd.org/changeset/base/193821

Log:
  Each generated file should depend its own generator as well.

Modified:
  head/sys/modules/sound/sound/Makefile

Modified: head/sys/modules/sound/sound/Makefile
==============================================================================
--- head/sys/modules/sound/sound/Makefile	Tue Jun  9 09:50:43 2009	(r193820)
+++ head/sys/modules/sound/sound/Makefile	Tue Jun  9 10:17:22 2009	(r193821)
@@ -19,13 +19,13 @@ SRCS+=	ac97.c ac97_patch.c buffer.c chan
 SRCS+=	mixer.c sndstat.c sound.c unit.c vchan.c
 SRCS+=	midi.c mpu401.c sequencer.c
 
-feeder_eq_gen.h:	@ machine
+feeder_eq_gen.h:	@ @/tools/feeder_eq_mkfilter.awk machine
 	${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
 
-feeder_rate_gen.h:	@ machine
+feeder_rate_gen.h:	@ @/tools/feeder_rate_mkfilter.awk machine
 	${AWK} -f @/tools/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
 
-snd_fxdiv_gen.h:	@ machine
+snd_fxdiv_gen.h:	@ @/tools/snd_fxdiv_gen.awk machine
 	${AWK} -f @/tools/snd_fxdiv_gen.awk -- > ${.TARGET}
 
 CLEANFILES+=	feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 11:06:14 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F38B1065670;
	Tue,  9 Jun 2009 11:06:14 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 685C08FC13;
	Tue,  9 Jun 2009 11:06:14 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 0A64646B2E;
	Tue,  9 Jun 2009 07:06:14 -0400 (EDT)
Date: Tue, 9 Jun 2009 12:06:13 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: "M. Warner Losh" 
In-Reply-To: <20090608.164518.-1264106964.imp@bsdimp.com>
Message-ID: 
References: <200906081823.n58INhX8038125@svn.freebsd.org>
	<20090608.164518.-1264106964.imp@bsdimp.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, ed@FreeBSD.org
Subject: Re: svn commit: r193734 - in head: lib/libusb sys/amd64/amd64
 sys/i386/i386 sys/i386/xen sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 11:06:15 -0000


On Mon, 8 Jun 2009, M. Warner Losh wrote:

> In message: <200906081823.n58INhX8038125@svn.freebsd.org>
>            Ed Schouten  writes:
> :   It turns out our compiler in stable/7 can't build this code anymore.
> :   Even though my opinion is that those people should just run `make
> :   kernel-toolchain' before building a kernel, I am willing to wait and
> :   commit this after we've branched stable/8.
>
> As a matter of policy, the project has always supported a RELENG_X -> 
> CURRENT upgrade with a simple buildworld.  The issue of building a kernel by 
> hand across releases has been targeted as one of those areas that can break, 
> but only if there's a really good reason to do so.
>
> Just FYI to everybody..

As compared to building 7.x kernels on 6.x, we got significantly farther 
through the release process before bumping into a problem, FWIW.  I certainly 
appreciate the ability to short-cut builds by doing them incrementally with 
existing toolchains, and while there are good reasons to break that (such as 
taking advantage of new syntax to improve the kernel -- for example, C99 
structure initialization) my hope is generally to avoid breaking it unless 
such a good reason turns up.  Usually, in the past, it's been share/mk 
incompatibility that's broken the build rather than C syntax, though.

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 11:31:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B2C4106564A;
	Tue,  9 Jun 2009 11:31:47 +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 49CD68FC14;
	Tue,  9 Jun 2009 11:31:47 +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 n59BVlgB069148;
	Tue, 9 Jun 2009 11:31:47 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59BVlv0069147;
	Tue, 9 Jun 2009 11:31:47 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906091131.n59BVlv0069147@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Tue, 9 Jun 2009 11:31:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193824 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 11:31:47 -0000

Author: bz
Date: Tue Jun  9 11:31:47 2009
New Revision: 193824
URL: http://svn.freebsd.org/changeset/base/193824

Log:
  For now only compile flowtable.c if both options FLOWTABLE and INET
  are given.  This will also work when we add IPv6 support as for now
  INET6 depends on INET.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Jun  9 11:21:36 2009	(r193823)
+++ head/sys/conf/files	Tue Jun  9 11:31:47 2009	(r193824)
@@ -2180,7 +2180,7 @@ net/bpf_jitter.c		optional bpf_jitter
 net/bpf_filter.c		optional bpf | netgraph_bpf
 net/bpf_zerocopy.c		optional bpf
 net/bridgestp.c			optional bridge | if_bridge
-net/flowtable.c			optional flowtable
+net/flowtable.c			optional flowtable inet
 net/ieee8023ad_lacp.c		optional lagg
 net/if.c			standard
 net/if_arcsubr.c		optional arcnet

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 12:32:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ADFB71065670;
	Tue,  9 Jun 2009 12:32:10 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9348C8FC1F;
	Tue,  9 Jun 2009 12:32:10 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59CWAf3071177;
	Tue, 9 Jun 2009 12:32:10 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59CWA7J071175;
	Tue, 9 Jun 2009 12:32:10 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200906091232.n59CWA7J071175@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Tue, 9 Jun 2009 12:32:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193826 - head/lib/libthread_db
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 12:32:14 -0000

Author: des
Date: Tue Jun  9 12:32:10 2009
New Revision: 193826
URL: http://svn.freebsd.org/changeset/base/193826

Log:
  Revert r181651, which changed the ABI, and use a temp variable instead.
  
  Suggested by:	attilio

Modified:
  head/lib/libthread_db/libthr_db.c
  head/lib/libthread_db/thread_db.h

Modified: head/lib/libthread_db/libthr_db.c
==============================================================================
--- head/lib/libthread_db/libthr_db.c	Tue Jun  9 11:39:23 2009	(r193825)
+++ head/lib/libthread_db/libthr_db.c	Tue Jun  9 12:32:10 2009	(r193826)
@@ -457,6 +457,7 @@ pt_thr_get_info(const td_thrhandle_t *th
 {
 	const td_thragent_t *ta = th->th_ta;
 	struct ptrace_lwpinfo linfo;
+	int traceme;
 	int state;
 	int ret;
 
@@ -470,7 +471,8 @@ pt_thr_get_info(const td_thrhandle_t *th
 	if (ret != 0)
 		return (TD_ERR);
 	ret = thr_pread_int(ta, th->th_thread + ta->thread_off_report_events,
-	    &info->ti_traceme);
+	    &traceme);
+	info->ti_traceme = traceme;
 	if (ret != 0)
 		return (TD_ERR);
 	ret = ps_pread(ta->ph, th->th_thread + ta->thread_off_event_mask,

Modified: head/lib/libthread_db/thread_db.h
==============================================================================
--- head/lib/libthread_db/thread_db.h	Tue Jun  9 11:39:23 2009	(r193825)
+++ head/lib/libthread_db/thread_db.h	Tue Jun  9 12:32:10 2009	(r193826)
@@ -184,7 +184,7 @@ typedef struct {
 	int		ti_pri;
 	lwpid_t		ti_lid;
 	char		ti_db_suspended;
-	int		ti_traceme;
+	char		ti_traceme;
 	sigset_t	ti_sigmask;
 	sigset_t	ti_pending;
 	psaddr_t	ti_tls;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 12:33:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EEC8C106566B;
	Tue,  9 Jun 2009 12:33:38 +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 B12628FC0C;
	Tue,  9 Jun 2009 12:33:38 +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 C4DA76D41C;
	Tue,  9 Jun 2009 14:33:37 +0200 (CEST)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 976CB844CC; Tue,  9 Jun 2009 14:33:37 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: src-committers@freebsd.org
References: <200906091232.n59CWA7J071175@svn.freebsd.org>
Date: Tue, 09 Jun 2009 14:33:37 +0200
In-Reply-To: <200906091232.n59CWA7J071175@svn.freebsd.org> (Dag-Erling
	Smorgrav's message of "Tue, 9 Jun 2009 12:32:10 +0000 (UTC)")
Message-ID: <86hbypio2m.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r193826 - head/lib/libthread_db
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 12:33:39 -0000

Dag-Erling Smorgrav  writes:
> Log:
>   Revert r181651, which changed the ABI, and use a temp variable instead.
>=20=20=20
>   Suggested by:	attilio

This is actually a reverse-merge of an uncommitted 7 patch, so I'm
effectively going to insta-MFC it.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 13:33:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA3B71065675;
	Tue,  9 Jun 2009 13:33:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C84AE8FC08;
	Tue,  9 Jun 2009 13:33:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59DX3fr072525;
	Tue, 9 Jun 2009 13:33:03 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59DX3Iw072524;
	Tue, 9 Jun 2009 13:33:03 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200906091333.n59DX3Iw072524@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 9 Jun 2009 13:33: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: r193828 - head/sys/dev/nmdm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 13:33:04 -0000

Author: jhb
Date: Tue Jun  9 13:33:03 2009
New Revision: 193828
URL: http://svn.freebsd.org/changeset/base/193828

Log:
  - Remove an unnecessary memory barrier from an atomic op.
  - Use the per-softc mutex to protect the softc data in the callout routine
    rather than letting it run without any locks whatsoever.

Modified:
  head/sys/dev/nmdm/nmdm.c

Modified: head/sys/dev/nmdm/nmdm.c
==============================================================================
--- head/sys/dev/nmdm/nmdm.c	Tue Jun  9 12:39:17 2009	(r193827)
+++ head/sys/dev/nmdm/nmdm.c	Tue Jun  9 13:33:03 2009	(r193828)
@@ -100,7 +100,7 @@ nmdm_alloc(unsigned long unit)
 	struct nmdmsoftc *ns;
 	struct tty *tp;
 
-	atomic_add_acq_int(&nmdm_count, 1);
+	atomic_add_int(&nmdm_count, 1);
 
 	ns = malloc(sizeof(*ns), M_NMDM, M_WAITOK|M_ZERO);
 	mtx_init(&ns->ns_mtx, "nmdm", NULL, MTX_DEF);
@@ -109,12 +109,12 @@ nmdm_alloc(unsigned long unit)
 	ns->ns_part1.np_pair = ns;
 	ns->ns_part1.np_other = &ns->ns_part2;
 	TASK_INIT(&ns->ns_part1.np_task, 0, nmdm_task_tty, &ns->ns_part1);
-	callout_init(&ns->ns_part1.np_callout, CALLOUT_MPSAFE);
+	callout_init_mtx(&ns->ns_part1.np_callout, &ns->ns_mtx, 0);
 
 	ns->ns_part2.np_pair = ns;
 	ns->ns_part2.np_other = &ns->ns_part1;
 	TASK_INIT(&ns->ns_part2.np_task, 0, nmdm_task_tty, &ns->ns_part2);
-	callout_init(&ns->ns_part2.np_callout, CALLOUT_MPSAFE);
+	callout_init_mtx(&ns->ns_part2.np_callout, &ns->ns_mtx, 0);
 
 	/* Create device nodes. */
 	tp = ns->ns_part1.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part1,

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 13:44:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F25B5106566B;
	Tue,  9 Jun 2009 13:44:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DFC7B8FC14;
	Tue,  9 Jun 2009 13:44:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59DiHJ5072790;
	Tue, 9 Jun 2009 13:44:17 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59DiHu9072789;
	Tue, 9 Jun 2009 13:44:17 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200906091344.n59DiHu9072789@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 9 Jun 2009 13:44:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193829 - head/sys/dev/acpica
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 13:44:18 -0000

Author: jhb
Date: Tue Jun  9 13:44:17 2009
New Revision: 193829
URL: http://svn.freebsd.org/changeset/base/193829

Log:
  Rework the _BBN handling for Host-PCI bridges.  Previously we only trusted
  a _BBN value of 0 if it was for the first bridge encountered since some
  older systems returned _BBN of 0 for all bridges.  However, some newer
  systems enumerate bridges with non-zero _BBN before bus 0 which is
  perfectly valid.  Handle both cases by trusting the first bridge that has
  a _BBN of 0 and falling back to reading from non-standard config registers
  only for subsequent bridges with a _BBN of 0.  We also only perform this
  check for segment (domain) 0.  We assume that _BBN is always correct
  for segments other than 0.
  
  Tested by:	Josef Moellers  josef.moellers at fujitsu
  MFC after:	1 week

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

Modified: head/sys/dev/acpica/acpi_pcib_acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi_pcib_acpi.c	Tue Jun  9 13:33:03 2009	(r193828)
+++ head/sys/dev/acpica/acpi_pcib_acpi.c	Tue Jun  9 13:44:17 2009	(r193829)
@@ -148,6 +148,7 @@ acpi_pcib_acpi_attach(device_t dev)
 {
     struct acpi_hpcib_softc	*sc;
     ACPI_STATUS			status;
+    static int bus0_seen = 0;
     u_int addr, slot, func, busok;
     uint8_t busno;
 
@@ -158,6 +159,21 @@ acpi_pcib_acpi_attach(device_t dev)
     sc->ap_handle = acpi_get_handle(dev);
 
     /*
+     * Get our segment number by evaluating _SEG
+     * It's OK for this to not exist.
+     */
+    status = acpi_GetInteger(sc->ap_handle, "_SEG", &sc->ap_segment);
+    if (ACPI_FAILURE(status)) {
+	if (status != AE_NOT_FOUND) {
+	    device_printf(dev, "could not evaluate _SEG - %s\n",
+		AcpiFormatException(status));
+	    return_VALUE (ENXIO);
+	}
+	/* If it's not found, assume 0. */
+	sc->ap_segment = 0;
+    }
+
+    /*
      * Get our base bus number by evaluating _BBN.
      * If this doesn't work, we assume we're bus number 0.
      *
@@ -171,8 +187,10 @@ acpi_pcib_acpi_attach(device_t dev)
      * XXX invoke _REG on this for the PCI config space address space?
      * XXX It seems many BIOS's with multiple Host-PCI bridges do not set
      *     _BBN correctly.  They set _BBN to zero for all bridges.  Thus,
-     *     if _BBN is zero and pcib0 already exists, we try to read our
+     *     if _BBN is zero and PCI bus 0 already exists, we try to read our
      *     bus number from the configuration registers at address _ADR.
+     *     We only do this for domain/segment 0 in the hopes that this is
+     *     only needed for old single-domain machines.
      */
     status = acpi_GetInteger(sc->ap_handle, "_BBN", &sc->ap_bus);
     if (ACPI_FAILURE(status)) {
@@ -187,11 +205,11 @@ acpi_pcib_acpi_attach(device_t dev)
     }
 
     /*
-     * If the bus is zero and pcib0 already exists, read the bus number
-     * via PCI config space.
+     * If this is segment 0, the bus is zero, and PCI bus 0 already
+     * exists, read the bus number via PCI config space.
      */
     busok = 1;
-    if (sc->ap_bus == 0 && devclass_get_device(pcib_devclass, 0) != dev) {
+    if (sc->ap_segment == 0 && sc->ap_bus == 0 && bus0_seen) {
 	busok = 0;
 	status = acpi_GetInteger(sc->ap_handle, "_ADR", &addr);
 	if (ACPI_FAILURE(status)) {
@@ -228,20 +246,9 @@ acpi_pcib_acpi_attach(device_t dev)
 	device_printf(dev, "trying bus number %d\n", sc->ap_bus);
     }
 
-    /*
-     * Get our segment number by evaluating _SEG
-     * It's OK for this to not exist.
-     */
-    status = acpi_GetInteger(sc->ap_handle, "_SEG", &sc->ap_segment);
-    if (ACPI_FAILURE(status)) {
-	if (status != AE_NOT_FOUND) {
-	    device_printf(dev, "could not evaluate _SEG - %s\n",
-		AcpiFormatException(status));
-	    return_VALUE (ENXIO);
-	}
-	/* If it's not found, assume 0. */
-	sc->ap_segment = 0;
-    }
+    /* If this is bus 0 on segment 0, note that it has been seen already. */
+    if (sc->ap_segment == 0 && sc->ap_bus == 0)
+	    bus0_seen = 1;
 
     return (acpi_pcib_attach(dev, &sc->ap_prt, sc->ap_bus));
 }

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 14:26:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A62C5106564A;
	Tue,  9 Jun 2009 14:26:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 910EF8FC3E;
	Tue,  9 Jun 2009 14:26:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59EQNR5074053;
	Tue, 9 Jun 2009 14:26:23 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59EQNRC074046;
	Tue, 9 Jun 2009 14:26:23 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200906091426.n59EQNRC074046@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 9 Jun 2009 14:26:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193833 - in head: share/man/man9 sys/kern sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 14:26:24 -0000

Author: jhb
Date: Tue Jun  9 14:26:23 2009
New Revision: 193833
URL: http://svn.freebsd.org/changeset/base/193833

Log:
  Add support for multiple passes of the device tree during the boot-time
  probe.  The current device order is unchanged.  This commit just adds the
  infrastructure and ABI changes so that it is easier to merge later changes
  into 8.x.
  - Driver attachments now have an associated pass level.  Attachments are
    not allowed to probe or attach to drivers until the system-wide pass level
    is >= the attachment's pass level.  By default driver attachments use the
    "last" pass level (BUS_PASS_DEFAULT).  Driver's that wish to probe during
    an earlier pass use EARLY_DRIVER_MODULE() instead of DRIVER_MODULE() which
    accepts the pass level as an additional parameter.
  - A new method BUS_NEW_PASS has been added to the bus interface.  This
    method is invoked when the system-wide pass level is changed to kick off
    a rescan of the device tree so that drivers that have just been made
    "eligible" can probe and attach.
  - The bus_generic_new_pass() function provides a default implementation of
    BUS_NEW_PASS().  It first allows drivers that were just made eligible for
    this pass to identify new child devices.  Then it propogates the rescan to
    child devices that already have an attached driver by invoking their
    BUS_NEW_PASS() method.  It also reprobes devices without a driver.
  - BUS_PROBE_NOMATCH() is only invoked for devices that do not have
    an attached driver after being scanned during the final pass.
  - The bus_set_pass() function is used during boot to raise the pass level.
    Currently it is only called once during root_bus_configure() to raise
    the pass level to BUS_PASS_DEFAULT.  This has the effect of probing all
    devices in a single pass identical to previous behavior.
  
  Reviewed by:	imp
  Approved by:	re (kib)

Added:
  head/share/man/man9/BUS_NEW_PASS.9   (contents, props changed)
  head/share/man/man9/bus_generic_new_pass.9   (contents, props changed)
  head/share/man/man9/bus_set_pass.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile
  head/sys/kern/bus_if.m
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Added: head/share/man/man9/BUS_NEW_PASS.9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man9/BUS_NEW_PASS.9	Tue Jun  9 14:26:23 2009	(r193833)
@@ -0,0 +1,56 @@
+.\" -*- nroff -*-
+.\"
+.\" Copyright (c) 2009 Advanced Computing Technologies LLC
+.\" Written by: John H. Baldwin 
+.\" 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$
+.\"
+.Dd June 8, 2009
+.Dt BUS_NEW_PASS 9
+.Os
+.Sh NAME
+.Nm BUS_NEW_PASS
+.Nd "notify a bus that the pass level has been changed"
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/bus.h
+.Ft void
+.Fn BUS_NEW_PASS "device_t dev"
+.Sh DESCRIPTION
+The
+.Fn BUS_NEW_PASS
+method is called on each bus device to rescan the device tree when the pass
+level has been changed.
+This method is responsible for invoking
+.Xr BUS_NEW_PASS 9
+on child bus devices to propogate the rescan to child devices.
+It is also responsible for reprobing any unattached child devices and
+allowing drivers for the current pass to identify new children.
+A default implementation is provided by
+.Xr bus_generic_new_pass 9 .
+.Sh SEE ALSO
+.Xr bus_generic_new_pass 9 ,
+.Xr bus_set_pass 9 ,
+.Xr device 9

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Tue Jun  9 14:18:16 2009	(r193832)
+++ head/share/man/man9/Makefile	Tue Jun  9 14:26:23 2009	(r193833)
@@ -28,12 +28,15 @@ MAN=	accept_filter.9 \
 	bus_dma.9 \
 	bus_generic_attach.9 \
 	bus_generic_detach.9 \
+	bus_generic_new_pass.9 \
 	bus_generic_print_child.9 \
 	bus_generic_read_ivar.9 \
 	bus_generic_shutdown.9 \
+	BUS_NEW_PASS.9 \
 	BUS_PRINT_CHILD.9 \
 	BUS_READ_IVAR.9 \
 	bus_release_resource.9 \
+	bus_set_pass.9 \
 	bus_set_resource.9 \
 	BUS_SETUP_INTR.9 \
 	bus_space.9 \

Added: head/share/man/man9/bus_generic_new_pass.9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man9/bus_generic_new_pass.9	Tue Jun  9 14:26:23 2009	(r193833)
@@ -0,0 +1,57 @@
+.\" -*- nroff -*-
+.\"
+.\" Copyright (c) 2009 Advanced Computing Technologies LLC
+.\" Written by: John H. Baldwin 
+.\" 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$
+.\"
+.Dd June 8, 2009
+.Dt bus_generic_new_pass 9
+.Os
+.Sh NAME
+.Nm bus_generic_new_pass
+.Nd "generic implementation of BUS_NEW_PASS for bus devices"
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/bus.h
+.Ft void
+.Fn bus_generic_new_pass "device_t dev"
+.Sh DESCRIPTION
+This function provides an implementation of the
+.Xr BUS_NEW_PASS 9
+method which can be used by bus drivers.
+It first invokes the
+.Xr DEVICE_IDENTIFY 9
+method for any drivers whose pass level is equal to the new pass level.
+Then, for each attached child device it calls
+.Xr BUS_NEW_PASS 9
+to rescan child busses,
+and for each unattached child device it calls
+.Xr device_probe_and_attach 9 .
+.Sh SEE ALSO
+.Xr BUS_NEW_PASS 9 ,
+.Xr bus_set_pass 9 ,
+.Xr device 9 ,
+.Xr DEVICE_IDENTIFY 9

Added: head/share/man/man9/bus_set_pass.9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man9/bus_set_pass.9	Tue Jun  9 14:26:23 2009	(r193833)
@@ -0,0 +1,54 @@
+.\" -*- nroff -*-
+.\"
+.\" Copyright (c) 2009 Advanced Computing Technologies LLC
+.\" Written by: John H. Baldwin 
+.\" 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$
+.\"
+.Dd June 8, 2009
+.Dt bus_set_pass 9
+.Os
+.Sh NAME
+.Nm bus_set_pass
+.Nd "raise the bus pass level"
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/bus.h
+.Ft void
+.Fn bus_set_pass "int pass"
+.Sh DESCRIPTION
+The
+.Nm
+function is called during boot to raise the bus pass level to
+.Fa pass .
+The function will rescan the device tree for each pass level between the
+current pass level and the new level that has at least one associated
+driver.
+The device tree rescans are implemented by invoking the
+.Xr BUS_NEW_PASS 9
+method on the root bus device.
+.Sh SEE ALSO
+.Xr BUS_NEW_PASS 9 ,
+.Xr device 9

Modified: head/sys/kern/bus_if.m
==============================================================================
--- head/sys/kern/bus_if.m	Tue Jun  9 14:18:16 2009	(r193832)
+++ head/sys/kern/bus_if.m	Tue Jun  9 14:26:23 2009	(r193833)
@@ -574,3 +574,11 @@ METHOD void hint_device_unit {
 	int		*_unitp;
 };
 
+/**
+ * @brief Notify a bus that the bus pass level has been changed
+ *
+ * @param _dev		the bus device
+ */
+METHOD void new_pass {
+	device_t	_dev;
+} DEFAULT bus_generic_new_pass;

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Tue Jun  9 14:18:16 2009	(r193832)
+++ head/sys/kern/subr_bus.c	Tue Jun  9 14:26:23 2009	(r193833)
@@ -66,6 +66,8 @@ typedef struct driverlink *driverlink_t;
 struct driverlink {
 	kobj_class_t	driver;
 	TAILQ_ENTRY(driverlink) link;	/* list of drivers in devclass */
+	int		pass;
+	TAILQ_ENTRY(driverlink) passlink;
 };
 
 /*
@@ -759,12 +761,98 @@ static kobj_method_t null_methods[] = {
 DEFINE_CLASS(null, null_methods, 0);
 
 /*
+ * Bus pass implementation
+ */
+
+static driver_list_t passes = TAILQ_HEAD_INITIALIZER(passes);
+int bus_current_pass = BUS_PASS_ROOT;
+
+/**
+ * @internal
+ * @brief Register the pass level of a new driver attachment
+ *
+ * Register a new driver attachment's pass level.  If no driver
+ * attachment with the same pass level has been added, then @p new
+ * will be added to the global passes list.
+ *
+ * @param new		the new driver attachment
+ */
+static void
+driver_register_pass(struct driverlink *new)
+{
+	struct driverlink *dl;
+
+	/* We only consider pass numbers during boot. */
+	if (bus_current_pass == BUS_PASS_DEFAULT)
+		return;
+
+	/*
+	 * Walk the passes list.  If we already know about this pass
+	 * then there is nothing to do.  If we don't, then insert this
+	 * driver link into the list.
+	 */
+	TAILQ_FOREACH(dl, &passes, passlink) {
+		if (dl->pass < new->pass)
+			continue;
+		if (dl->pass == new->pass)
+			return;
+		TAILQ_INSERT_BEFORE(dl, new, passlink);
+		return;
+	}
+	TAILQ_INSERT_TAIL(&passes, new, passlink);
+}
+
+/**
+ * @brief Raise the current bus pass
+ *
+ * Raise the current bus pass level to @p pass.  Call the BUS_NEW_PASS()
+ * method on the root bus to kick off a new device tree scan for each
+ * new pass level that has at least one driver.
+ */
+void
+bus_set_pass(int pass)
+{
+	struct driverlink *dl;
+
+	if (bus_current_pass > pass)
+		panic("Attempt to lower bus pass level");
+
+	TAILQ_FOREACH(dl, &passes, passlink) {
+		/* Skip pass values below the current pass level. */
+		if (dl->pass <= bus_current_pass)
+			continue;
+
+		/*
+		 * Bail once we hit a driver with a pass level that is
+		 * too high.
+		 */
+		if (dl->pass > pass)
+			break;
+
+		/*
+		 * Raise the pass level to the next level and rescan
+		 * the tree.
+		 */
+		bus_current_pass = dl->pass;
+		BUS_NEW_PASS(root_bus);
+	}
+
+	/*
+	 * If there isn't a driver registered for the requested pass,
+	 * then bus_current_pass might still be less than 'pass'.  Set
+	 * it to 'pass' in that case.
+	 */
+	if (bus_current_pass < pass)
+		bus_current_pass = pass;
+	KASSERT(bus_current_pass == pass, ("Failed to update bus pass level"));
+}
+
+/*
  * Devclass implementation
  */
 
 static devclass_list_t devclasses = TAILQ_HEAD_INITIALIZER(devclasses);
 
-
 /**
  * @internal
  * @brief Find or create a device class
@@ -912,12 +1000,16 @@ devclass_driver_added(devclass_t dc, dri
  * @param driver	the driver to register
  */
 int
-devclass_add_driver(devclass_t dc, driver_t *driver)
+devclass_add_driver(devclass_t dc, driver_t *driver, int pass)
 {
 	driverlink_t dl;
 
 	PDEBUG(("%s", DRIVERNAME(driver)));
 
+	/* Don't allow invalid pass values. */
+	if (pass <= BUS_PASS_ROOT)
+		return (EINVAL);
+
 	dl = malloc(sizeof *dl, M_BUS, M_NOWAIT|M_ZERO);
 	if (!dl)
 		return (ENOMEM);
@@ -938,6 +1030,8 @@ devclass_add_driver(devclass_t dc, drive
 	dl->driver = driver;
 	TAILQ_INSERT_TAIL(&dc->drivers, dl, link);
 	driver->refs++;		/* XXX: kobj_mtx */
+	dl->pass = pass;
+	driver_register_pass(dl);
 
 	devclass_driver_added(dc, driver);
 	bus_data_generation_update();
@@ -1801,6 +1895,11 @@ device_probe_child(device_t dev, device_
 		for (dl = first_matching_driver(dc, child);
 		     dl;
 		     dl = next_matching_driver(dc, child, dl)) {
+
+			/* If this driver's pass is too high, then ignore it. */
+			if (dl->pass > bus_current_pass)
+				continue;
+
 			PDEBUG(("Trying %s", DRIVERNAME(dl->driver)));
 			device_set_driver(child, dl->driver);
 			if (!hasclass) {
@@ -2442,8 +2541,9 @@ device_probe(device_t dev)
 		}
 		return (-1);
 	}
-	if ((error = device_probe_child(dev->parent, dev)) != 0) {
-		if (!(dev->flags & DF_DONENOMATCH)) {
+	if ((error = device_probe_child(dev->parent, dev)) != 0) {		
+		if (bus_current_pass == BUS_PASS_DEFAULT &&
+		    !(dev->flags & DF_DONENOMATCH)) {
 			BUS_PROBE_NOMATCH(dev->parent, dev);
 			devnomatch(dev);
 			dev->flags |= DF_DONENOMATCH;
@@ -2988,6 +3088,17 @@ bus_generic_probe(device_t dev)
 	driverlink_t dl;
 
 	TAILQ_FOREACH(dl, &dc->drivers, link) {
+		/*
+		 * If this driver's pass is too high, then ignore it.
+		 * For most drivers in the default pass, this will
+		 * never be true.  For early-pass drivers they will
+		 * only call the identify routines of eligible drivers
+		 * when this routine is called.  Drivers for later
+		 * passes should have their identify routines called
+		 * on early-pass busses during BUS_NEW_PASS().
+		 */
+		if (dl->pass > bus_current_pass)
+				continue;
 		DEVICE_IDENTIFY(dl->driver, dev);
 	}
 
@@ -3215,6 +3326,36 @@ bus_generic_driver_added(device_t dev, d
 }
 
 /**
+ * @brief Helper function for implementing BUS_NEW_PASS().
+ *
+ * This implementing of BUS_NEW_PASS() first calls the identify
+ * routines for any drivers that probe at the current pass.  Then it
+ * walks the list of devices for this bus.  If a device is already
+ * attached, then it calls BUS_NEW_PASS() on that device.  If the
+ * device is not already attached, it attempts to attach a driver to
+ * it.
+ */
+void
+bus_generic_new_pass(device_t dev)
+{
+	driverlink_t dl;
+	devclass_t dc;
+	device_t child;
+
+	dc = dev->devclass;
+	TAILQ_FOREACH(dl, &dc->drivers, link) {
+		if (dl->pass == bus_current_pass)
+			DEVICE_IDENTIFY(dl->driver, dev);
+	}
+	TAILQ_FOREACH(child, &dev->children, link) {
+		if (child->state >= DS_ATTACHED)
+			BUS_NEW_PASS(child);
+		else if (child->state == DS_NOTPRESENT)
+			device_probe_and_attach(child);
+	}
+}
+
+/**
  * @brief Helper function for implementing BUS_SETUP_INTR().
  *
  * This simple implementation of BUS_SETUP_INTR() simply calls the
@@ -3912,13 +4053,11 @@ DECLARE_MODULE(rootbus, root_bus_mod, SI
 void
 root_bus_configure(void)
 {
-	device_t dev;
 
 	PDEBUG(("."));
 
-	TAILQ_FOREACH(dev, &root_bus->children, link) {
-		device_probe_and_attach(dev);
-	}
+	/* Eventually this will be split up, but this is sufficient for now. */
+	bus_set_pass(BUS_PASS_DEFAULT);
 }
 
 /**
@@ -3932,10 +4071,10 @@ root_bus_configure(void)
 int
 driver_module_handler(module_t mod, int what, void *arg)
 {
-	int error;
 	struct driver_module_data *dmd;
 	devclass_t bus_devclass;
 	kobj_class_t driver;
+	int error, pass;
 
 	dmd = (struct driver_module_data *)arg;
 	bus_devclass = devclass_find_internal(dmd->dmd_busname, NULL, TRUE);
@@ -3946,10 +4085,11 @@ driver_module_handler(module_t mod, int 
 		if (dmd->dmd_chainevh)
 			error = dmd->dmd_chainevh(mod,what,dmd->dmd_chainarg);
 
+		pass = dmd->dmd_pass;
 		driver = dmd->dmd_driver;
-		PDEBUG(("Loading module: driver %s on bus %s",
-		    DRIVERNAME(driver), dmd->dmd_busname));
-		error = devclass_add_driver(bus_devclass, driver);
+		PDEBUG(("Loading module: driver %s on bus %s (pass %d)",
+		    DRIVERNAME(driver), dmd->dmd_busname, pass));
+		error = devclass_add_driver(bus_devclass, driver, pass);
 		if (error)
 			break;
 

Modified: head/sys/sys/bus.h
==============================================================================
--- head/sys/sys/bus.h	Tue Jun  9 14:18:16 2009	(r193832)
+++ head/sys/sys/bus.h	Tue Jun  9 14:26:23 2009	(r193833)
@@ -29,6 +29,7 @@
 #ifndef _SYS_BUS_H_
 #define _SYS_BUS_H_
 
+#include 
 #include 
 
 /**
@@ -299,6 +300,7 @@ bus_dma_tag_t
 	bus_generic_get_dma_tag(device_t dev, device_t child);
 struct resource_list *
 	bus_generic_get_resource_list (device_t, device_t);
+void	bus_generic_new_pass(device_t dev);
 int	bus_print_child_header(device_t dev, device_t child);
 int	bus_print_child_footer(device_t dev, device_t child);
 int	bus_generic_print_child(device_t dev, device_t child);
@@ -433,7 +435,7 @@ void	device_verbose(device_t dev);
 /*
  * Access functions for devclass.
  */
-int	devclass_add_driver(devclass_t dc, kobj_class_t driver);
+int	devclass_add_driver(devclass_t dc, kobj_class_t driver, int pass);
 int	devclass_delete_driver(devclass_t dc, kobj_class_t driver);
 devclass_t	devclass_create(const char *classname);
 devclass_t	devclass_find(const char *classname);
@@ -512,6 +514,28 @@ void	bus_data_generation_update(void);
 #define BUS_PROBE_NOWILDCARD	(-2000000000) /* No wildcard device matches */
 
 /**
+ * During boot, the device tree is scanned multiple times.  Each scan,
+ * or pass, drivers may be attached to devices.  Each driver
+ * attachment is assigned a pass number.  Drivers may only probe and
+ * attach to devices if their pass number is less than or equal to the
+ * current system-wide pass number.  The default pass is the last pass
+ * and is used by most drivers.  Drivers needed by the scheduler are
+ * probed in earlier passes.
+ */
+#define	BUS_PASS_ROOT		0	/* Used to attach root0. */
+#define	BUS_PASS_BUS		10	/* Busses and bridges. */
+#define	BUS_PASS_CPU		20	/* CPU devices. */
+#define	BUS_PASS_RESOURCE	30	/* Resource discovery. */
+#define	BUS_PASS_INTERRUPT	40	/* Interrupt controllers. */
+#define	BUS_PASS_TIMER		50	/* Timers and clocks. */
+#define	BUS_PASS_SCHEDULER	60	/* Start scheduler. */
+#define	BUS_PASS_DEFAULT	__INT_MAX /* Everything else. */
+
+extern int bus_current_pass;
+
+void	bus_set_pass(int pass);
+
+/**
  * Shorthand for constructing method tables.
  */
 #define	DEVMETHOD	KOBJMETHOD
@@ -535,15 +559,17 @@ struct driver_module_data {
 	const char	*dmd_busname;
 	kobj_class_t	dmd_driver;
 	devclass_t	*dmd_devclass;
+	int		dmd_pass;
 };
 
-#define	DRIVER_MODULE(name, busname, driver, devclass, evh, arg)	\
+#define	EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, pass) \
 									\
 static struct driver_module_data name##_##busname##_driver_mod = {	\
 	evh, arg,							\
 	#busname,							\
 	(kobj_class_t) &driver,						\
-	&devclass							\
+	&devclass,							\
+	pass								\
 };									\
 									\
 static moduledata_t name##_##busname##_mod = {				\
@@ -554,6 +580,10 @@ static moduledata_t name##_##busname##_m
 DECLARE_MODULE(name##_##busname, name##_##busname##_mod,		\
 	       SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
 
+#define	DRIVER_MODULE(name, busname, driver, devclass, evh, arg)	\
+	EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg,	\
+	    BUS_PASS_DEFAULT)
+
 /**
  * Generic ivar accessor generation macros for bus drivers
  */

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 15:01:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD8CF10656C7;
	Tue,  9 Jun 2009 15:01:50 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3])
	by mx1.freebsd.org (Postfix) with ESMTP id 926788FC23;
	Tue,  9 Jun 2009 15:01:50 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 5EE2641C70A;
	Tue,  9 Jun 2009 17:01:49 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([195.88.108.3])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id Rsk2f1jRsC2d; Tue,  9 Jun 2009 17:01:48 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id E926541C6FC; Tue,  9 Jun 2009 17:01:48 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id 8F82E4448E6;
	Tue,  9 Jun 2009 15:01:40 +0000 (UTC)
Date: Tue, 9 Jun 2009 15:01:40 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Kip Macy 
In-Reply-To: <200904190016.n3J0G4rA090911@svn.freebsd.org>
Message-ID: <20090609143729.R22887@maildrop.int.zabbadoz.net>
References: <200904190016.n3J0G4rA090911@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191255 - in head/sys: amd64/conf conf i386/conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 15:01:51 -0000

On Sun, 19 Apr 2009, Kip Macy wrote:

> Author: kmacy
> Date: Sun Apr 19 00:16:04 2009
> New Revision: 191255
> URL: http://svn.freebsd.org/changeset/base/191255
>
> Log:
>  - Import infrastructure for caching flows as a means of accelerating L3 and L2 lookups
>    as well as providing stateful load balancing when used with RADIX_MPATH.
>  - Currently compiled in to i386 and amd64 but disabled by default, it can be enabled at
>    runtime with 'sysctl net.inet.flowtable.enable=1'.
>
>  - Embedded users can remove it entirely from the kernel by adding 'nooption FLOWTABLE' to
>    their kernel config files.
>
>  - A minimal hookup will be added to ip_output in a subsequent commit. I would like to see
>    more review before bringing in changes that require more churn.
>
>  Supported by: Bitgravity Inc.
>
> Added:
>  head/sys/net/flowtable.c   (contents, props changed)
>  head/sys/net/flowtable.h   (contents, props changed)
> Modified:
>  head/sys/amd64/conf/DEFAULTS
   ...
>  head/sys/i386/conf/DEFAULTS
   ...
>
> Modified: head/sys/amd64/conf/DEFAULTS
> ==============================================================================
> --- head/sys/amd64/conf/DEFAULTS	Sat Apr 18 22:16:46 2009	(r191254)
> +++ head/sys/amd64/conf/DEFAULTS	Sun Apr 19 00:16:04 2009	(r191255)
> @@ -20,3 +20,5 @@ options 	GEOM_PART_BSD
> options 	GEOM_PART_EBR
> options 	GEOM_PART_EBR_COMPAT
> options 	GEOM_PART_MBR
> +
> +options		FLOWTABLE
>
> Modified: head/sys/i386/conf/DEFAULTS
> ==============================================================================
> --- head/sys/i386/conf/DEFAULTS	Sat Apr 18 22:16:46 2009	(r191254)
> +++ head/sys/i386/conf/DEFAULTS	Sun Apr 19 00:16:04 2009	(r191255)
> @@ -28,3 +28,5 @@ options 	GEOM_PART_MBR
> # enable support for native hardware
> options 	NATIVE
> device		atpic
> +
> +options		FLOWTABLE
...



I think FLOWTABLE does nto belong into DEFAULTS.  Really DEFAULTS was
meant for "You cannot boot without this" and if people start to weaken
it, DEFAULTS will soon be the new GENERIC.  That said I am not sure it
belongs to GENERIC either.

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 15:18:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A64E106566C;
	Tue,  9 Jun 2009 15:18:02 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1757D8FC14;
	Tue,  9 Jun 2009 15:18:02 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59FI1r4075700;
	Tue, 9 Jun 2009 15:18:02 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59FI1Np075699;
	Tue, 9 Jun 2009 15:18:01 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <200906091518.n59FI1Np075699@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 9 Jun 2009 15:18: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: r193837 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 15:18:02 -0000

Author: rmacklem
Date: Tue Jun  9 15:18:01 2009
New Revision: 193837
URL: http://svn.freebsd.org/changeset/base/193837

Log:
  Since vn_lock() with the LK_RETRY flag never returns an error
  for FreeBSD-CURRENT, the code that checked for and returned the
  error was broken. Change it to check for VI_DOOMED set after
  vn_lock() and return an error for that case. I believe this
  should only happen for forced dismounts.
  
  Approved by:	kib (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Tue Jun  9 15:10:00 2009	(r193836)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Tue Jun  9 15:18:01 2009	(r193837)
@@ -2726,14 +2726,16 @@ nfs_advlock(struct vop_advlock_args *ap)
 	struct proc *p = (struct proc *)ap->a_id;
 	struct thread *td = curthread;	/* XXX */
 	struct vattr va;
-	int ret, error = EOPNOTSUPP, vlret;
+	int ret, error = EOPNOTSUPP;
 	u_quad_t size;
 	
 	if (NFS_ISV4(vp) && (ap->a_flags & F_POSIX)) {
 		cred = p->p_ucred;
-		vlret = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-		if (vlret)
-			return (vlret);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+		if (vp->v_iflag & VI_DOOMED) {
+			VOP_UNLOCK(vp, 0);
+			return (EBADF);
+		}
 
 		/*
 		 * If this is unlocking a write locked region, flush and
@@ -2757,9 +2759,11 @@ nfs_advlock(struct vop_advlock_args *ap)
 				error = nfs_catnap(PZERO | PCATCH, "ncladvl");
 				if (error)
 					return (EINTR);
-				vlret = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-				if (vlret)
-					return (vlret);
+				vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+				if (vp->v_iflag & VI_DOOMED) {
+					VOP_UNLOCK(vp, 0);
+					return (EBADF);
+				}
 			}
 		} while (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) &&
 		     ap->a_op == F_SETLK);

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 16:32:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4FBC1065673;
	Tue,  9 Jun 2009 16:32:07 +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 D27608FC0A;
	Tue,  9 Jun 2009 16:32:07 +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 n59GW7gj077324;
	Tue, 9 Jun 2009 16:32:07 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59GW7qs077320;
	Tue, 9 Jun 2009 16:32:07 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200906091632.n59GW7qs077320@svn.freebsd.org>
From: Sam Leffler 
Date: Tue, 9 Jun 2009 16:32:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193840 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 16:32:08 -0000

Author: sam
Date: Tue Jun  9 16:32:07 2009
New Revision: 193840
URL: http://svn.freebsd.org/changeset/base/193840

Log:
  Correct ieee80211_gettid:
  o don't increment extracted tid, this was a vestige of IEEE80211_NONQOS_TID
    being defined as 0 (w/ real tid's +1)
  o handle 4-address frames (add IEEE80211_IS_DSTODS to check if an 802.11
    header is DSTODS)
  
  Submitted by:	cbzimmer
  Reviewed by:	avatar

Modified:
  head/sys/net80211/ieee80211.h
  head/sys/net80211/ieee80211_crypto_ccmp.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_proto.h

Modified: head/sys/net80211/ieee80211.h
==============================================================================
--- head/sys/net80211/ieee80211.h	Tue Jun  9 15:50:33 2009	(r193839)
+++ head/sys/net80211/ieee80211.h	Tue Jun  9 16:32:07 2009	(r193840)
@@ -158,6 +158,9 @@ struct ieee80211_qosframe_addr4 {
 #define	IEEE80211_FC1_DIR_FROMDS		0x02	/* AP ->STA */
 #define	IEEE80211_FC1_DIR_DSTODS		0x03	/* AP ->AP  */
 
+#define	IEEE80211_IS_DSTODS(wh) \
+	(((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS)
+
 #define	IEEE80211_FC1_MORE_FRAG			0x04
 #define	IEEE80211_FC1_RETRY			0x08
 #define	IEEE80211_FC1_PWR_MGT			0x10

Modified: head/sys/net80211/ieee80211_crypto_ccmp.c
==============================================================================
--- head/sys/net80211/ieee80211_crypto_ccmp.c	Tue Jun  9 15:50:33 2009	(r193839)
+++ head/sys/net80211/ieee80211_crypto_ccmp.c	Tue Jun  9 16:32:07 2009	(r193840)
@@ -298,8 +298,6 @@ ccmp_init_blocks(rijndael_ctx *ctx, stru
 	uint8_t b0[AES_BLOCK_LEN], uint8_t aad[2 * AES_BLOCK_LEN],
 	uint8_t auth[AES_BLOCK_LEN], uint8_t s0[AES_BLOCK_LEN])
 {
-#define	IS_4ADDRESS(wh) \
-	((wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS)
 #define	IS_QOS_DATA(wh)	IEEE80211_QOS_HAS_SEQ(wh)
 
 	/* CCM Initial Block:
@@ -344,7 +342,7 @@ ccmp_init_blocks(rijndael_ctx *ctx, stru
 	 * initial block as we know whether or not we have
 	 * a QOS frame.
 	 */
-	if (IS_4ADDRESS(wh)) {
+	if (IEEE80211_IS_DSTODS(wh)) {
 		IEEE80211_ADDR_COPY(aad + 24,
 			((struct ieee80211_frame_addr4 *)wh)->i_addr4);
 		if (IS_QOS_DATA(wh)) {
@@ -386,7 +384,6 @@ ccmp_init_blocks(rijndael_ctx *ctx, stru
 	b0[14] = b0[15] = 0;
 	rijndael_encrypt(ctx, b0, s0);
 #undef	IS_QOS_DATA
-#undef	IS_4ADDRESS
 }
 
 #define	CCMP_ENCRYPT(_i, _b, _b0, _pos, _e, _len) do {	\

Modified: head/sys/net80211/ieee80211_ht.c
==============================================================================
--- head/sys/net80211/ieee80211_ht.c	Tue Jun  9 15:50:33 2009	(r193839)
+++ head/sys/net80211/ieee80211_ht.c	Tue Jun  9 16:32:07 2009	(r193840)
@@ -567,7 +567,7 @@ ieee80211_ampdu_reorder(struct ieee80211
 		 */
 		return PROCESS;
 	}
-	if ((wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS)
+	if (IEEE80211_IS_DSTODS(wh))
 		tid = ((struct ieee80211_qosframe_addr4 *)wh)->i_qos[0];
 	else
 		tid = wh->i_qos[0];

Modified: head/sys/net80211/ieee80211_proto.h
==============================================================================
--- head/sys/net80211/ieee80211_proto.h	Tue Jun  9 15:50:33 2009	(r193839)
+++ head/sys/net80211/ieee80211_proto.h	Tue Jun  9 16:32:07 2009	(r193840)
@@ -122,7 +122,7 @@ ieee80211_hdrsize(const void *data)
 	/* NB: we don't handle control frames */
 	KASSERT((wh->i_fc[0]&IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_CTL,
 		("%s: control frame", __func__));
-	if ((wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS)
+	if (IEEE80211_IS_DSTODS(wh))
 		size += IEEE80211_ADDR_LEN;
 	if (IEEE80211_QOS_HAS_SEQ(wh))
 		size += sizeof(uint16_t);
@@ -255,9 +255,12 @@ ieee80211_gettid(const struct ieee80211_
 	uint8_t tid;
 
 	if (IEEE80211_QOS_HAS_SEQ(wh)) {
-		tid = ((const struct ieee80211_qosframe *)wh)->
-			i_qos[0] & IEEE80211_QOS_TID;
-		tid++;
+		if (IEEE80211_IS_DSTODS(wh))
+			tid = ((const struct ieee80211_qosframe_addr4 *)wh)->
+				i_qos[0];
+		else
+			tid = ((const struct ieee80211_qosframe *)wh)->i_qos[0];
+		tid &= IEEE80211_QOS_TID;
 	} else
 		tid = IEEE80211_NONQOS_TID;
 	return tid;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 17:04:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9070A1065677;
	Tue,  9 Jun 2009 17:04:39 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E99C8FC1A;
	Tue,  9 Jun 2009 17:04:39 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59H4dW2078076;
	Tue, 9 Jun 2009 17:04:39 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59H4dMt078075;
	Tue, 9 Jun 2009 17:04:39 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <200906091704.n59H4dMt078075@svn.freebsd.org>
From: Alan Cox 
Date: Tue, 9 Jun 2009 17:04:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193842 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 17:04:40 -0000

Author: alc
Date: Tue Jun  9 17:04:39 2009
New Revision: 193842
URL: http://svn.freebsd.org/changeset/base/193842

Log:
  Eliminate an unnecessary restriction on the vm object type from
  vm_map_pmap_enter().  The immediate effect of this change is that automatic
  prefaulting by mmap() for small mappings is performed on POSIX shared memory
  objects just the same as it is on ordinary files.

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Tue Jun  9 16:32:29 2009	(r193841)
+++ head/sys/vm/vm_map.c	Tue Jun  9 17:04:39 2009	(r193842)
@@ -1643,11 +1643,9 @@ vm_map_pmap_enter(vm_map_t map, vm_offse
 
 	psize = atop(size);
 
-	if (object->type != OBJT_VNODE ||
-	    ((flags & MAP_PREFAULT_PARTIAL) && (psize > MAX_INIT_PT) &&
-	     (object->resident_page_count > MAX_INIT_PT))) {
+	if ((flags & MAP_PREFAULT_PARTIAL) && psize > MAX_INIT_PT &&
+	    object->resident_page_count > MAX_INIT_PT)
 		goto unlock_return;
-	}
 
 	if (psize + pindex > object->size) {
 		if (object->size < pindex)

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 17:11:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 703D210656C5;
	Tue,  9 Jun 2009 17:11:41 +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 5DD6B8FC20;
	Tue,  9 Jun 2009 17:11:41 +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 n59HBfC2078252;
	Tue, 9 Jun 2009 17:11:41 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59HBfO6078251;
	Tue, 9 Jun 2009 17:11:41 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200906091711.n59HBfO6078251@svn.freebsd.org>
From: Sam Leffler 
Date: Tue, 9 Jun 2009 17:11: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: r193843 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 17:11:42 -0000

Author: sam
Date: Tue Jun  9 17:11:41 2009
New Revision: 193843
URL: http://svn.freebsd.org/changeset/base/193843

Log:
  add missing calls to ieee80211_dfs_attach/detach

Modified:
  head/sys/net80211/ieee80211.c

Modified: head/sys/net80211/ieee80211.c
==============================================================================
--- head/sys/net80211/ieee80211.c	Tue Jun  9 17:04:39 2009	(r193842)
+++ head/sys/net80211/ieee80211.c	Tue Jun  9 17:11:41 2009	(r193843)
@@ -282,6 +282,7 @@ ieee80211_ifattach(struct ieee80211com *
 	ieee80211_ht_attach(ic);
 	ieee80211_scan_attach(ic);
 	ieee80211_regdomain_attach(ic);
+	ieee80211_dfs_attach(ic);
 
 	ieee80211_sysctl_attach(ic);
 
@@ -321,6 +322,7 @@ ieee80211_ifdetach(struct ieee80211com *
 	ieee80211_waitfor_parent(ic);
 
 	ieee80211_sysctl_detach(ic);
+	ieee80211_dfs_detach(ic);
 	ieee80211_regdomain_detach(ic);
 	ieee80211_scan_detach(ic);
 #ifdef IEEE80211_SUPPORT_SUPERG

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 17:12:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 188011065679;
	Tue,  9 Jun 2009 17:12:20 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E01B78FC1C;
	Tue,  9 Jun 2009 17:12: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 n59HCJEZ078301;
	Tue, 9 Jun 2009 17:12:19 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59HCJOJ078300;
	Tue, 9 Jun 2009 17:12:19 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200906091712.n59HCJOJ078300@svn.freebsd.org>
From: Sam Leffler 
Date: Tue, 9 Jun 2009 17:12: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: r193844 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 17:12:20 -0000

Author: sam
Date: Tue Jun  9 17:12:19 2009
New Revision: 193844
URL: http://svn.freebsd.org/changeset/base/193844

Log:
  protect callouts with the com lock
  
  Prodded by:	jhb

Modified:
  head/sys/net80211/ieee80211_dfs.c

Modified: head/sys/net80211/ieee80211_dfs.c
==============================================================================
--- head/sys/net80211/ieee80211_dfs.c	Tue Jun  9 17:11:41 2009	(r193843)
+++ head/sys/net80211/ieee80211_dfs.c	Tue Jun  9 17:12:19 2009	(r193844)
@@ -69,8 +69,8 @@ ieee80211_dfs_attach(struct ieee80211com
 {
 	struct ieee80211_dfs_state *dfs = &ic->ic_dfs;
 
-	callout_init(&dfs->nol_timer, CALLOUT_MPSAFE);
-	callout_init(&dfs->cac_timer, CALLOUT_MPSAFE);
+	callout_init_mtx(&dfs->nol_timer, IEEE80211_LOCK_OBJ(ic), 0);
+	callout_init_mtx(&dfs->cac_timer, IEEE80211_LOCK_OBJ(ic), 0);
 }
 
 void
@@ -102,6 +102,8 @@ cac_timeout(void *arg)
 	struct ieee80211_dfs_state *dfs = &ic->ic_dfs;
 	int i;
 
+	IEEE80211_LOCK_ASSERT(ic);
+
 	if (vap->iv_state != IEEE80211_S_CAC)	/* NB: just in case */
 		return;
 	/*
@@ -120,6 +122,7 @@ cac_timeout(void *arg)
 		/* XXX clobbers any existing desired channel */
 		/* NB: dfs->newchan may be NULL, that's ok */
 		vap->iv_des_chan = dfs->newchan;
+		/* XXX recursive lock need ieee80211_new_state_locked */
 		ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
 	} else {
 		if_printf(vap->iv_ifp,
@@ -180,7 +183,6 @@ ieee80211_dfs_cac_stop(struct ieee80211v
 		ieee80211_notify_cac(ic, ic->ic_curchan,
 		    IEEE80211_NOTIFY_CAC_STOP);
 	}
-	/* XXX cannot use drain 'cuz holding a lock */
 	callout_stop(&dfs->cac_timer);
 }
 
@@ -205,7 +207,8 @@ dfs_timeout(void *arg)
 	struct ieee80211_channel *c;
 	int i, oldest, now;
 
-	IEEE80211_LOCK(ic);
+	IEEE80211_LOCK_ASSERT(ic);
+
 	now = oldest = ticks;
 	for (i = 0; i < ic->ic_nchans; i++) {
 		c = &ic->ic_channels[i];
@@ -234,7 +237,6 @@ dfs_timeout(void *arg)
 		/* arrange to process next channel up for a status change */
 		callout_schedule(&dfs->nol_timer, oldest + NOL_TIMEOUT);
 	}
-	IEEE80211_UNLOCK(ic);
 }
 
 static void

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 17:12:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA229106564A;
	Tue,  9 Jun 2009 17:12:55 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249])
	by mx1.freebsd.org (Postfix) with ESMTP id 59E378FC29;
	Tue,  9 Jun 2009 17:12:55 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: by an-out-0708.google.com with SMTP id c3so57986ana.13
	for ; Tue, 09 Jun 2009 10:12:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=FT+haR9Y8FsbTZl74TNP2QlbB2frXpf5I0RghcnsuDQ=;
	b=fDy62wj7Cd7HR41qQruIWGXpoAbcdttTCYCereqr6tRMbhzBEyczu2ph980ndD6Dih
	NfsX/rqISRwetgPnqlQZWsUHrRAdcTLT5SI2q0gQlB/SorhRGLEPW6pGwtiJpL8Pm8q4
	sRgfLUHlI+UOc69GytPPDQshCm7OraGdno3T4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=HgnwftNtWfImODlmwDn0Os3KogzqPt2RffRXFmWsLLjJoCMW/ejYuFD52wwy8F3yyt
	vXiQmhC/cFrXhL5i+pj3miRmg27osg7guPI8avpQHiRRBodLlYNnnsfTbVHrA8/7RC87
	GuJFk5OhdLVJtMlgAcSrJk8eXrXvN5o9f9iXY=
MIME-Version: 1.0
Sender: mat.macy@gmail.com
Received: by 10.100.38.5 with SMTP id l5mr240823anl.183.1244567574084; Tue, 09 
	Jun 2009 10:12:54 -0700 (PDT)
In-Reply-To: <20090609143729.R22887@maildrop.int.zabbadoz.net>
References: <200904190016.n3J0G4rA090911@svn.freebsd.org>
	<20090609143729.R22887@maildrop.int.zabbadoz.net>
Date: Tue, 9 Jun 2009 10:12:54 -0700
X-Google-Sender-Auth: 796914a7004dbc0c
Message-ID: <3c1674c90906091012u26b0e823q57a7ea1f42eef22d@mail.gmail.com>
From: Kip Macy 
To: "Bjoern A. Zeeb" 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191255 - in head/sys: amd64/conf conf i386/conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 17:12:56 -0000

> I think FLOWTABLE does nto belong into DEFAULTS. =A0Really DEFAULTS was
> meant for "You cannot boot without this" and if people start to weaken
> it, DEFAULTS will soon be the new GENERIC. =A0That said I am not sure it
> belongs to GENERIC either.

I can either push it in to GENERIC or I can change it to NOFLOWTABLE.
If you want to remove it from GENERIC then we're going to have to have
a lengthy discussion about what most FreeBSD users actually use and
gut GENERIC as it stands now. The fact is, most FreeBSD users have
sufficiently few peers that flowtable is a win over using the routing
table on every lookup.

Thanks,
Kip

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 17:18:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D052010656C3;
	Tue,  9 Jun 2009 17:18:41 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE6C28FC0C;
	Tue,  9 Jun 2009 17:18:41 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59HIfbC078462;
	Tue, 9 Jun 2009 17:18:41 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59HIfOe078461;
	Tue, 9 Jun 2009 17:18:41 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <200906091718.n59HIfOe078461@svn.freebsd.org>
From: Alan Cox 
Date: Tue, 9 Jun 2009 17:18: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: r193845 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 17:18:42 -0000

Author: alc
Date: Tue Jun  9 17:18:41 2009
New Revision: 193845
URL: http://svn.freebsd.org/changeset/base/193845

Log:
  Eliminate an instance of VM_PROT_READ_IS_EXEC that I overlooked in r190705.

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c	Tue Jun  9 17:12:19 2009	(r193844)
+++ head/sys/kern/sysv_shm.c	Tue Jun  9 17:18:41 2009	(r193845)
@@ -391,11 +391,7 @@ kern_shmat(td, shmid, shmaddr, shmflg)
 		goto done2;
 	}
 	size = round_page(shmseg->shm_bsegsz);
-#ifdef VM_PROT_READ_IS_EXEC
-	prot = VM_PROT_READ | VM_PROT_EXECUTE;
-#else
 	prot = VM_PROT_READ;
-#endif
 	if ((shmflg & SHM_RDONLY) == 0)
 		prot |= VM_PROT_WRITE;
 	flags = MAP_ANON | MAP_SHARED;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 17:19:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76AE11065686;
	Tue,  9 Jun 2009 17:19:17 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from ebb.errno.com (ebb.errno.com [69.12.149.25])
	by mx1.freebsd.org (Postfix) with ESMTP id 46EEF8FC23;
	Tue,  9 Jun 2009 17:19:17 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from trouble.errno.com (trouble.errno.com [10.0.0.248])
	(authenticated bits=0)
	by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n59HJGCB017383
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 9 Jun 2009 10:19:16 -0700 (PDT) (envelope-from sam@freebsd.org)
Message-ID: <4A2E9994.7070907@freebsd.org>
Date: Tue, 09 Jun 2009 10:19:16 -0700
From: Sam Leffler 
Organization: FreeBSD Project
User-Agent: Thunderbird 2.0.0.21 (X11/20090411)
MIME-Version: 1.0
To: Kip Macy 
References: <200904190016.n3J0G4rA090911@svn.freebsd.org>	
	<20090609143729.R22887@maildrop.int.zabbadoz.net>
	<3c1674c90906091012u26b0e823q57a7ea1f42eef22d@mail.gmail.com>
In-Reply-To: <3c1674c90906091012u26b0e823q57a7ea1f42eef22d@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	"Bjoern A. Zeeb" , src-committers@freebsd.org
Subject: Re: svn commit: r191255 - in head/sys: amd64/conf conf i386/conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 17:19:18 -0000

Kip Macy wrote:
>> I think FLOWTABLE does nto belong into DEFAULTS.  Really DEFAULTS was
>> meant for "You cannot boot without this" and if people start to weaken
>> it, DEFAULTS will soon be the new GENERIC.  That said I am not sure it
>> belongs to GENERIC either.
>>     
>
> I can either push it in to GENERIC or I can change it to NOFLOWTABLE.
> If you want to remove it from GENERIC then we're going to have to have
> a lengthy discussion about what most FreeBSD users actually use and
> gut GENERIC as it stands now. The fact is, most FreeBSD users have
> sufficiently few peers that flowtable is a win over using the routing
> table on every lookup.
>   

I believe the question was mainly about mechanics,  FLOWTABLE doesn't 
belong in DEFAULTS but it may well belong in GENERIC.

    Sam


From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 17:21:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CC174106566C;
	Tue,  9 Jun 2009 17:21:47 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B9FFC8FC12;
	Tue,  9 Jun 2009 17:21:47 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59HLlbf078557;
	Tue, 9 Jun 2009 17:21:47 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59HLlaL078556;
	Tue, 9 Jun 2009 17:21:47 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200906091721.n59HLlaL078556@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Tue, 9 Jun 2009 17:21:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193846 - head/sys/arm/arm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 17:21:48 -0000

Author: marcel
Date: Tue Jun  9 17:21:47 2009
New Revision: 193846
URL: http://svn.freebsd.org/changeset/base/193846

Log:
  Disable interrupts to allow booting on firmware (e.g. U-Boot) that
  has interrupts enabled and active.
  
  Obtained from:	Juniper Networks, Inc.

Modified:
  head/sys/arm/arm/locore.S

Modified: head/sys/arm/arm/locore.S
==============================================================================
--- head/sys/arm/arm/locore.S	Tue Jun  9 17:18:41 2009	(r193845)
+++ head/sys/arm/arm/locore.S	Tue Jun  9 17:21:47 2009	(r193846)
@@ -73,6 +73,11 @@ ASENTRY_NP(_start)
 
 	mov	ip, r0
 
+	/* Make sure interrupts are disabled. */
+	mrs	r7, cpsr
+	orr	r7, r7, #(I32_bit|F32_bit)
+	msr	cpsr_c, r7
+
 #if defined (FLASHADDR) && defined(LOADERRAMADDR)
 	/* Check if we're running from flash. */
 	ldr	r7, =FLASHADDR

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 17:55:36 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B2CB51065673;
	Tue,  9 Jun 2009 17:55:36 +0000 (UTC) (envelope-from das@FreeBSD.ORG)
Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F9B98FC1B;
	Tue,  9 Jun 2009 17:55:36 +0000 (UTC) (envelope-from das@FreeBSD.ORG)
Received: from zim.MIT.EDU (localhost [127.0.0.1])
	by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n59HxC7W075548;
	Tue, 9 Jun 2009 13:59:12 -0400 (EDT) (envelope-from das@FreeBSD.ORG)
Received: (from das@localhost)
	by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n59HxCgL075547;
	Tue, 9 Jun 2009 13:59:12 -0400 (EDT) (envelope-from das@FreeBSD.ORG)
Date: Tue, 9 Jun 2009 13:59:12 -0400
From: David Schultz 
To: Ed Schouten 
Message-ID: <20090609175912.GA75336@zim.MIT.EDU>
Mail-Followup-To: Ed Schouten , src-committers@FreeBSD.ORG,
	svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG
References: <200906030816.n538GZ6T043054@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200906030816.n538GZ6T043054@svn.freebsd.org>
Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG,
	src-committers@FreeBSD.ORG
Subject: Re: svn commit: r193368 - head/lib/msun/src
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 17:55:37 -0000

On Wed, Jun 03, 2009, Ed Schouten wrote:
> Author: ed
> Date: Wed Jun  3 08:16:34 2009
> New Revision: 193368
> URL: http://svn.freebsd.org/changeset/base/193368
> 
> Log:
>   Use ISO C99 style inline semantics in msun.
>   
>   Because we use ISO C99 nowadays, we can just get rid of enforcing
>   GNU89-style inlining.

Thanks.  I was holding off on this until the 8.0 branch because
C99 inlines require patches to gcc (available in HEAD sources
after 3/14/2009).  IIRC, msun gets compiled before gcc, so this
might break things for people upgrading from 7.X or earlier
8-CURRENT sources.

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 18:18:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0FB501065670;
	Tue,  9 Jun 2009 18:18:42 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F041F8FC1D;
	Tue,  9 Jun 2009 18:18:41 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59IIfCU079697;
	Tue, 9 Jun 2009 18:18:41 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59IIfD5079688;
	Tue, 9 Jun 2009 18:18:41 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200906091818.n59IIfD5079688@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Tue, 9 Jun 2009 18:18: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: r193847 - in head/sys/arm: arm at91 include mv sa11x0
	xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 18:18:42 -0000

Author: marcel
Date: Tue Jun  9 18:18:41 2009
New Revision: 193847
URL: http://svn.freebsd.org/changeset/base/193847

Log:
  Pass the previously returned IRQ back to arm_get_next_irq() so that
  the implementation can guarantee forward progress in the event of
  a stuck interrupt or interrupt storm. This is especially critical
  for fast interrupt handlers, as they can cause a hard hang in that
  case. When first called, arm_get_next_irq() is passed -1.
  
  Obtained from:	Juniper Networks, Inc.

Modified:
  head/sys/arm/arm/intr.c
  head/sys/arm/at91/at91.c
  head/sys/arm/include/intr.h
  head/sys/arm/mv/ic.c
  head/sys/arm/sa11x0/sa11x0_irqhandler.c
  head/sys/arm/xscale/i80321/i80321.c
  head/sys/arm/xscale/i8134x/i81342.c
  head/sys/arm/xscale/ixp425/ixp425.c
  head/sys/arm/xscale/pxa/pxa_icu.c

Modified: head/sys/arm/arm/intr.c
==============================================================================
--- head/sys/arm/arm/intr.c	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/arm/intr.c	Tue Jun  9 18:18:41 2009	(r193847)
@@ -120,7 +120,8 @@ arm_handler_execute(struct trapframe *fr
 	int i;
 
 	PCPU_INC(cnt.v_intr);
-	while ((i = arm_get_next_irq()) != -1) {
+	i = -1;
+	while ((i = arm_get_next_irq(i)) != -1) {
 		intrcnt[intrcnt_tab[i]]++;
 		event = intr_events[i];
 		if (intr_event_handle(event, frame) != 0) {

Modified: head/sys/arm/at91/at91.c
==============================================================================
--- head/sys/arm/at91/at91.c	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/at91/at91.c	Tue Jun  9 18:18:41 2009	(r193847)
@@ -702,9 +702,8 @@ arm_mask_irq(uintptr_t nb)
 }
 
 int
-arm_get_next_irq()
+arm_get_next_irq(int last __unused)
 {
-
 	int status;
 	int irq;
 	

Modified: head/sys/arm/include/intr.h
==============================================================================
--- head/sys/arm/include/intr.h	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/include/intr.h	Tue Jun  9 18:18:41 2009	(r193847)
@@ -56,7 +56,7 @@
 
 #include 
 
-int arm_get_next_irq(void);
+int arm_get_next_irq(int);
 void arm_mask_irq(uintptr_t);
 void arm_unmask_irq(uintptr_t);
 void arm_setup_irqhandler(const char *, int (*)(void*), void (*)(void*), 

Modified: head/sys/arm/mv/ic.c
==============================================================================
--- head/sys/arm/mv/ic.c	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/mv/ic.c	Tue Jun  9 18:18:41 2009	(r193847)
@@ -137,7 +137,7 @@ static devclass_t mv_ic_devclass;
 DRIVER_MODULE(ic, mbus, mv_ic_driver, mv_ic_devclass, 0, 0);
 
 int
-arm_get_next_irq(void)
+arm_get_next_irq(int last __unused)
 {
 	int irq;
 

Modified: head/sys/arm/sa11x0/sa11x0_irqhandler.c
==============================================================================
--- head/sys/arm/sa11x0/sa11x0_irqhandler.c	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/sa11x0/sa11x0_irqhandler.c	Tue Jun  9 18:18:41 2009	(r193847)
@@ -108,7 +108,7 @@ static uint32_t sa11x0_irq_mask = 0xffff
 extern vm_offset_t saipic_base;
 
 int
-arm_get_next_irq()
+arm_get_next_irq(int last __unused)
 {
 	int irq;
 

Modified: head/sys/arm/xscale/i80321/i80321.c
==============================================================================
--- head/sys/arm/xscale/i80321/i80321.c	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/xscale/i80321/i80321.c	Tue Jun  9 18:18:41 2009	(r193847)
@@ -240,7 +240,7 @@ i80321_iintsrc_read(void)
 }
 
 int
-arm_get_next_irq()
+arm_get_next_irq(int last __unused)
 {
 	int irq;
 

Modified: head/sys/arm/xscale/i8134x/i81342.c
==============================================================================
--- head/sys/arm/xscale/i8134x/i81342.c	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/xscale/i8134x/i81342.c	Tue Jun  9 18:18:41 2009	(r193847)
@@ -295,7 +295,7 @@ arm_unmask_irq(uintptr_t nb)
 }
 
 int
-arm_get_next_irq(void)
+arm_get_next_irq(int last __unused)
 {
 	uint32_t val;
 	val = intpnd0_read() & intr_enabled0;

Modified: head/sys/arm/xscale/ixp425/ixp425.c
==============================================================================
--- head/sys/arm/xscale/ixp425/ixp425.c	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/xscale/ixp425/ixp425.c	Tue Jun  9 18:18:41 2009	(r193847)
@@ -202,7 +202,7 @@ ixp435_irq_read(void)
 }
 
 int
-arm_get_next_irq(void)
+arm_get_next_irq(int last __unused)
 {
 	uint32_t irq;
 

Modified: head/sys/arm/xscale/pxa/pxa_icu.c
==============================================================================
--- head/sys/arm/xscale/pxa/pxa_icu.c	Tue Jun  9 17:21:47 2009	(r193846)
+++ head/sys/arm/xscale/pxa/pxa_icu.c	Tue Jun  9 18:18:41 2009	(r193847)
@@ -128,7 +128,7 @@ static devclass_t pxa_icu_devclass;
 DRIVER_MODULE(pxaicu, pxa, pxa_icu_driver, pxa_icu_devclass, 0, 0);
 
 int
-arm_get_next_irq()
+arm_get_next_irq(int last __unused)
 {
 	int	irq;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 18:19:58 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 69A991065673;
	Tue,  9 Jun 2009 18:19:58 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E67F8FC1C;
	Tue,  9 Jun 2009 18:19:58 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 953A91CC8D; Tue,  9 Jun 2009 20:19:57 +0200 (CEST)
Date: Tue, 9 Jun 2009 20:19:57 +0200
From: Ed Schouten 
To: src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG,
	svn-src-head@FreeBSD.ORG
Message-ID: <20090609181957.GJ48776@hoeg.nl>
References: <200906030816.n538GZ6T043054@svn.freebsd.org>
	<20090609175912.GA75336@zim.MIT.EDU>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="vnSC+wKlQbGVr9qh"
Content-Disposition: inline
In-Reply-To: <20090609175912.GA75336@zim.MIT.EDU>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: 
Subject: Re: svn commit: r193368 - head/lib/msun/src
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 18:19:59 -0000


--vnSC+wKlQbGVr9qh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* David Schultz  wrote:
> Thanks.  I was holding off on this until the 8.0 branch because
> C99 inlines require patches to gcc (available in HEAD sources
> after 3/14/2009).  IIRC, msun gets compiled before gcc, so this
> might break things for people upgrading from 7.X or earlier
> 8-CURRENT sources.

We build GCC twice. When you run `make buildworld', it will first build
all sorts of tools we need later on (GCC, Binutils, some DTrace tools,
etc). msun will never be compiled with the C compiler of the build host.

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--vnSC+wKlQbGVr9qh
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkoup80ACgkQ52SDGA2eCwU8rgCeNn+X2PU6bD3giCBB06NHhSRo
BDIAn3dIQuwSGatlcP5+ocAPg3Gynai6
=bvaA
-----END PGP SIGNATURE-----

--vnSC+wKlQbGVr9qh--

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 18:24:34 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CFF7C10656BA;
	Tue,  9 Jun 2009 18:24:34 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57])
	by mx1.freebsd.org (Postfix) with ESMTP id 79B9F8FC2C;
	Tue,  9 Jun 2009 18:24:34 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from phobos.local (pooker.samsco.org [168.103.85.57])
	by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n59IOVNj097645;
	Tue, 9 Jun 2009 12:24:31 -0600 (MDT)
	(envelope-from scottl@samsco.org)
Message-ID: <4A2EA8DE.2080105@samsco.org>
Date: Tue, 09 Jun 2009 12:24:30 -0600
From: Scott Long 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US;
	rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9
MIME-Version: 1.0
To: Sam Leffler 
References: <200904190016.n3J0G4rA090911@svn.freebsd.org>	
	<20090609143729.R22887@maildrop.int.zabbadoz.net>
	<3c1674c90906091012u26b0e823q57a7ea1f42eef22d@mail.gmail.com>
	<4A2E9994.7070907@freebsd.org>
In-Reply-To: <4A2E9994.7070907@freebsd.org>
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-4.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.1.8
X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	"Bjoern A. Zeeb" , Kip Macy ,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r191255 - in head/sys: amd64/conf conf i386/conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 18:24:35 -0000

Sam Leffler wrote:
> Kip Macy wrote:
>>> I think FLOWTABLE does nto belong into DEFAULTS.  Really DEFAULTS was
>>> meant for "You cannot boot without this" and if people start to weaken
>>> it, DEFAULTS will soon be the new GENERIC.  That said I am not sure it
>>> belongs to GENERIC either.
>>>     
>>
>> I can either push it in to GENERIC or I can change it to NOFLOWTABLE.
>> If you want to remove it from GENERIC then we're going to have to have
>> a lengthy discussion about what most FreeBSD users actually use and
>> gut GENERIC as it stands now. The fact is, most FreeBSD users have
>> sufficiently few peers that flowtable is a win over using the routing
>> table on every lookup.
>>   
> 
> I believe the question was mainly about mechanics,  FLOWTABLE doesn't 
> belong in DEFAULTS but it may well belong in GENERIC.
> 
>    Sam
> 

If you want it to be an opt-out feature, wrap the code in #ifndef 
DISABLE_FLOWTABLE.  I agree that what was put into DEFAULTS is
inappropriate for what DEFAULTS was meant to do.

Scott


From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 19:19:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F487106566B;
	Tue,  9 Jun 2009 19:19:17 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D64F8FC1C;
	Tue,  9 Jun 2009 19:19:17 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59JJHNC081123;
	Tue, 9 Jun 2009 19:19:17 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59JJGge081119;
	Tue, 9 Jun 2009 19:19:16 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906091919.n59JJGge081119@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 9 Jun 2009 19:19:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193848 - in head/sys: dev/cxgb net sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 19:19:17 -0000

Author: kmacy
Date: Tue Jun  9 19:19:16 2009
New Revision: 193848
URL: http://svn.freebsd.org/changeset/base/193848

Log:
  - add drbr routines for accessing #qentries and conditionally dequeueing
  - track bytes enqueued in buf_ring

Modified:
  head/sys/dev/cxgb/cxgb_multiq.c
  head/sys/net/if_var.h
  head/sys/sys/buf_ring.h

Modified: head/sys/dev/cxgb/cxgb_multiq.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_multiq.c	Tue Jun  9 18:18:41 2009	(r193847)
+++ head/sys/dev/cxgb/cxgb_multiq.c	Tue Jun  9 19:19:16 2009	(r193848)
@@ -123,7 +123,7 @@ cxgb_pcpu_enqueue_packet_(struct sge_qse
 		return (ENETDOWN);
 	}
 	txq = &qs->txq[TXQ_ETH];
-	err = buf_ring_enqueue(txq->txq_mr, m);
+	err = drbr_enqueue(qs->port->ifp, txq->txq_mr, m);
 	if (err) {
 		txq->txq_drops++;
 		m_freem(m);

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Tue Jun  9 18:18:41 2009	(r193847)
+++ head/sys/net/if_var.h	Tue Jun  9 19:19:16 2009	(r193848)
@@ -556,10 +556,11 @@ do {									\
 static __inline void
 drbr_stats_update(struct ifnet *ifp, int len, int mflags)
 {
-
+#ifndef NO_SLOW_STATS
 	ifp->if_obytes += len;
 	if (mflags & M_MCAST)
 		ifp->if_omcasts++;
+#endif
 }
 
 static __inline int
@@ -575,9 +576,8 @@ drbr_enqueue(struct ifnet *ifp, struct b
 		return (error);
 	}
 #endif
-	if ((error = buf_ring_enqueue(br, m)) == ENOBUFS) {
+	if ((error = buf_ring_enqueue_bytes(br, m, len)) == ENOBUFS) {
 		br->br_drops++;
-		_IF_DROP(&ifp->if_snd);
 		m_freem(m);
 	} else
 		drbr_stats_update(ifp, len, mflags);
@@ -610,6 +610,27 @@ drbr_dequeue(struct ifnet *ifp, struct b
 	return (buf_ring_dequeue_sc(br));
 }
 
+static __inline struct mbuf *
+drbr_dequeue_cond(struct ifnet *ifp, struct buf_ring *br,
+    int (*func) (struct mbuf *, void *), void *arg) 
+{
+	struct mbuf *m;
+#ifdef ALTQ
+	/*
+	 * XXX need to evaluate / requeue 
+	 */
+	if (ALTQ_IS_ENABLED(&ifp->if_snd)) {	
+		IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
+		return (m);
+	}
+#endif
+	m = buf_ring_peek(br);
+	if (m == NULL || func(m, arg) == 0)
+		return (NULL);
+
+	return (buf_ring_dequeue_sc(br));
+}
+
 static __inline int
 drbr_empty(struct ifnet *ifp, struct buf_ring *br)
 {
@@ -619,6 +640,16 @@ drbr_empty(struct ifnet *ifp, struct buf
 #endif
 	return (buf_ring_empty(br));
 }
+
+static __inline int
+drbr_inuse(struct ifnet *ifp, struct buf_ring *br)
+{
+#ifdef ALTQ
+	if (ALTQ_IS_ENABLED(&ifp->if_snd))
+		return (ifp->if_snd.ifq_len);
+#endif
+	return (buf_ring_count(br));
+}
 #endif
 /*
  * 72 was chosen below because it is the size of a TCP/IP

Modified: head/sys/sys/buf_ring.h
==============================================================================
--- head/sys/sys/buf_ring.h	Tue Jun  9 18:18:41 2009	(r193847)
+++ head/sys/sys/buf_ring.h	Tue Jun  9 19:19:16 2009	(r193848)
@@ -49,10 +49,12 @@ struct buf_ring {
 	int              	br_prod_size;
 	int              	br_prod_mask;
 	uint64_t		br_drops;
+	uint64_t		br_prod_bufs;
+	uint64_t		br_prod_bytes;
 	/*
 	 * Pad out to next L2 cache line
 	 */
-	uint64_t	  	_pad0[13];
+	uint64_t	  	_pad0[11];
 
 	volatile uint32_t	br_cons_head;
 	volatile uint32_t	br_cons_tail;
@@ -74,7 +76,7 @@ struct buf_ring {
  *
  */
 static __inline int
-buf_ring_enqueue(struct buf_ring *br, void *buf)
+buf_ring_enqueue_bytes(struct buf_ring *br, void *buf, int nbytes)
 {
 	uint32_t prod_head, prod_next;
 	uint32_t cons_tail;
@@ -116,12 +118,20 @@ buf_ring_enqueue(struct buf_ring *br, vo
 	 */   
 	while (br->br_prod_tail != prod_head)
 		cpu_spinwait();
+	br->br_prod_bufs++;
+	br->br_prod_bytes += nbytes;
 	br->br_prod_tail = prod_next;
-	mb();
 	critical_exit();
 	return (0);
 }
 
+static __inline int
+buf_ring_enqueue(struct buf_ring *br, void *buf)
+{
+
+	return (buf_ring_enqueue_bytes(br, buf, 0));
+}
+
 /*
  * multi-consumer safe dequeue 
  *
@@ -154,7 +164,7 @@ buf_ring_dequeue_mc(struct buf_ring *br)
 #ifdef DEBUG_BUFRING
 	br->br_ring[cons_head] = NULL;
 #endif
-	mb();
+	rmb();
 	
 	/*
 	 * If there are other dequeues in progress
@@ -165,7 +175,6 @@ buf_ring_dequeue_mc(struct buf_ring *br)
 		cpu_spinwait();
 
 	br->br_cons_tail = cons_next;
-	mb();
 	critical_exit();
 
 	return (buf);
@@ -179,25 +188,29 @@ buf_ring_dequeue_mc(struct buf_ring *br)
 static __inline void *
 buf_ring_dequeue_sc(struct buf_ring *br)
 {
-	uint32_t cons_head, cons_next;
+	uint32_t cons_head, cons_next, cons_next_next;
 	uint32_t prod_tail;
 	void *buf;
 	
-	critical_enter();
 	cons_head = br->br_cons_head;
 	prod_tail = br->br_prod_tail;
 	
 	cons_next = (cons_head + 1) & br->br_cons_mask;
-		
-	if (cons_head == prod_tail) {
-		critical_exit();
+	cons_next_next = (cons_head + 2) & br->br_cons_mask;
+	
+	if (cons_head == prod_tail) 
 		return (NULL);
+
+#ifdef PREFETCH_DEFINED	
+	if (cons_next != prod_tail) {		
+		prefetch(br->br_ring[cons_next]);
+		if (cons_next_next != prod_tail) 
+			prefetch(br->br_ring[cons_next_next]);
 	}
-	
+#endif
 	br->br_cons_head = cons_next;
 	buf = br->br_ring[cons_head];
-	mb();
-	
+
 #ifdef DEBUG_BUFRING
 	br->br_ring[cons_head] = NULL;
 	if (!mtx_owned(br->br_lock))
@@ -207,8 +220,6 @@ buf_ring_dequeue_sc(struct buf_ring *br)
 		    br->br_cons_tail, cons_head);
 #endif
 	br->br_cons_tail = cons_next;
-	mb();
-	critical_exit();
 	return (buf);
 }
 
@@ -225,7 +236,12 @@ buf_ring_peek(struct buf_ring *br)
 	if ((br->br_lock != NULL) && !mtx_owned(br->br_lock))
 		panic("lock not held on single consumer dequeue");
 #endif	
-	mb();
+	/*
+	 * I believe it is safe to not have a memory barrier
+	 * here because we control cons and tail is worst case
+	 * a lagging indicator so we worst case we might
+	 * return NULL immediately after a buffer has been enqueued
+	 */
 	if (br->br_cons_head == br->br_prod_tail)
 		return (NULL);
 	

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 19:51:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77E481065670;
	Tue,  9 Jun 2009 19:51:22 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 650E48FC14;
	Tue,  9 Jun 2009 19:51:22 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59JpM3h081798;
	Tue, 9 Jun 2009 19:51:22 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59JpMSx081797;
	Tue, 9 Jun 2009 19:51:22 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200906091951.n59JpMSx081797@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Tue, 9 Jun 2009 19:51:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193850 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 19:51:23 -0000

Author: trasz
Date: Tue Jun  9 19:51:22 2009
New Revision: 193850
URL: http://svn.freebsd.org/changeset/base/193850

Log:
  Add part of NFSv4 ACL kernel support code that is required for the upcoming
  libc changes to work.  Not connected to the kernel build yet; for now,
  it will be compiled into libc.
  
  Reviewed by:	rwatson

Added:
  head/sys/kern/subr_acl_nfs4.c   (contents, props changed)

Added: head/sys/kern/subr_acl_nfs4.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/kern/subr_acl_nfs4.c	Tue Jun  9 19:51:22 2009	(r193850)
@@ -0,0 +1,579 @@
+/*-
+ * Copyright (c) 2008 Edward Tomasz Napierała 
+ * 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.
+ */
+
+/*
+ * ACL support routines specific to NFSv4 access control lists.  These are
+ * utility routines for code common across file systems implementing NFSv4
+ * ACLs.
+ */
+
+#ifdef _KERNEL
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#else
+#include 
+#include 
+#include 
+#include 
+#define KASSERT(a, b) assert(a)
+#define CTASSERT(a)
+#endif
+
+static int
+_acl_entry_matches(struct acl_entry *entry, acl_tag_t tag, acl_perm_t perm,
+    acl_entry_type_t entry_type)
+{
+	if (entry->ae_tag != tag)
+		return (0);
+
+	if (entry->ae_id != ACL_UNDEFINED_ID)
+		return (0);
+
+	if (entry->ae_perm != perm)
+		return (0);
+
+	if (entry->ae_entry_type != entry_type)
+		return (0);
+
+	if (entry->ae_flags != 0)
+		return (0);
+
+	return (1);
+}
+
+static struct acl_entry *
+_acl_append(struct acl *aclp, acl_tag_t tag, acl_perm_t perm,
+    acl_entry_type_t entry_type)
+{
+	struct acl_entry *entry;
+
+	KASSERT(aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES,
+	    ("aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES"));
+
+	entry = &(aclp->acl_entry[aclp->acl_cnt]);
+	aclp->acl_cnt++;
+
+	entry->ae_tag = tag;
+	entry->ae_id = ACL_UNDEFINED_ID;
+	entry->ae_perm = perm;
+	entry->ae_entry_type = entry_type;
+	entry->ae_flags = 0;
+
+	return (entry);
+}
+
+static struct acl_entry *
+_acl_duplicate_entry(struct acl *aclp, int entry_index)
+{
+	int i;
+
+	KASSERT(aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES,
+	    ("aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES"));
+
+	for (i = aclp->acl_cnt; i > entry_index; i--)
+		aclp->acl_entry[i] = aclp->acl_entry[i - 1];
+
+	aclp->acl_cnt++;
+
+	return (&(aclp->acl_entry[entry_index + 1]));
+}
+
+void
+acl_nfs4_sync_acl_from_mode(struct acl *aclp, mode_t mode, int file_owner_id)
+{
+	int i, meets, must_append;
+	struct acl_entry *entry, *copy, *previous,
+	    *a1, *a2, *a3, *a4, *a5, *a6;
+	mode_t amode;
+	const int READ = 04;
+	const int WRITE = 02;
+	const int EXEC = 01;
+
+	KASSERT(aclp->acl_cnt >= 0, ("aclp->acl_cnt >= 0"));
+	KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES,
+	    ("aclp->acl_cnt <= ACL_MAX_ENTRIES"));
+
+	/*
+	 * NFSv4 Minor Version 1, draft-ietf-nfsv4-minorversion1-03.txt
+	 *
+	 * 3.16.6.3. Applying a Mode to an Existing ACL
+	 */
+
+	/*
+	 * 1. For each ACE:
+	 */
+	for (i = 0; i < aclp->acl_cnt; i++) {
+		entry = &(aclp->acl_entry[i]);
+
+		/*
+		 * 1.1. If the type is neither ALLOW or DENY - skip.
+		 */
+		if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW &&
+		    entry->ae_entry_type != ACL_ENTRY_TYPE_DENY)
+			continue;
+
+		/*
+		 * 1.2. If ACL_ENTRY_INHERIT_ONLY is set - skip.
+		 */
+		if (entry->ae_flags & ACL_ENTRY_INHERIT_ONLY)
+			continue;
+
+		/*
+		 * 1.3. If ACL_ENTRY_FILE_INHERIT or ACL_ENTRY_DIRECTORY_INHERIT
+		 *      are set:
+		 */
+		if (entry->ae_flags &
+		    (ACL_ENTRY_FILE_INHERIT | ACL_ENTRY_DIRECTORY_INHERIT)) {
+			/*
+			 * 1.3.1. A copy of the current ACE is made, and placed
+			 *        in the ACL immediately following the current
+			 *        ACE.
+			 */
+			copy = _acl_duplicate_entry(aclp, i);
+
+			/*
+			 * 1.3.2. In the first ACE, the flag
+			 *        ACL_ENTRY_INHERIT_ONLY is set.
+			 */
+			entry->ae_flags |= ACL_ENTRY_INHERIT_ONLY;
+
+			/*
+			 * 1.3.3. In the second ACE, the following flags
+			 *        are cleared:
+			 *        ACL_ENTRY_FILE_INHERIT,
+			 *        ACL_ENTRY_DIRECTORY_INHERIT,
+			 *        ACL_ENTRY_NO_PROPAGATE_INHERIT.
+			 */
+			copy->ae_flags &= ~(ACL_ENTRY_FILE_INHERIT |
+			    ACL_ENTRY_DIRECTORY_INHERIT |
+			    ACL_ENTRY_NO_PROPAGATE_INHERIT);
+
+			/*
+			 * The algorithm continues on with the second ACE.
+			 */
+			i++;
+			entry = copy;
+		}
+
+		/*
+		 * 1.4. If it's owner@, group@ or everyone@ entry, clear
+		 *      ACL_READ_DATA, ACL_WRITE_DATA, ACL_APPEND_DATA
+		 *      and ACL_EXECUTE.  Continue to the next entry.
+		 */
+		if (entry->ae_tag == ACL_USER_OBJ ||
+		    entry->ae_tag == ACL_GROUP_OBJ ||
+		    entry->ae_tag == ACL_EVERYONE) {
+			entry->ae_perm &= ~(ACL_READ_DATA | ACL_WRITE_DATA |
+			    ACL_APPEND_DATA | ACL_EXECUTE);
+			continue;
+		}
+
+		/*
+		 * 1.5. Otherwise, if the "who" field did not match one
+		 *      of OWNER@, GROUP@, EVERYONE@:
+		 *
+		 * 1.5.1. If the type is ALLOW, check the preceding ACE.
+		 *        If it does not meet all of the following criteria:
+		 */
+		if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW)
+			continue;
+
+		meets = 0;
+		if (i > 0) {
+			meets = 1;
+			previous = &(aclp->acl_entry[i - 1]);
+
+			/*
+			 * 1.5.1.1. The type field is DENY,
+			 */
+			if (previous->ae_entry_type != ACL_ENTRY_TYPE_DENY)
+				meets = 0;
+
+			/*
+			 * 1.5.1.2. The "who" field is the same as the current
+			 *          ACE,
+			 *
+			 * 1.5.1.3. The flag bit ACE4_IDENTIFIER_GROUP
+			 *          is the same as it is in the current ACE,
+			 *          and no other flag bits are set,
+			 */
+			if (previous->ae_id != entry->ae_id ||
+			    previous->ae_tag != entry->ae_tag)
+				meets = 0;
+
+			if (previous->ae_flags)
+				meets = 0;
+
+			/*
+			 * 1.5.1.4. The mask bits are a subset of the mask bits
+			 *          of the current ACE, and are also subset of
+			 *          the following: ACL_READ_DATA,
+			 *          ACL_WRITE_DATA, ACL_APPEND_DATA, ACL_EXECUTE
+			 */
+			if (previous->ae_perm & ~(entry->ae_perm))
+				meets = 0;
+
+			if (previous->ae_perm & ~(ACL_READ_DATA |
+			    ACL_WRITE_DATA | ACL_APPEND_DATA | ACL_EXECUTE))
+				meets = 0;
+		}
+
+		if (!meets) {
+			/*
+		 	 * Then the ACE of type DENY, with a who equal
+			 * to the current ACE, flag bits equal to
+			 * ( & )
+			 * and no mask bits, is prepended.
+			 */
+			previous = entry;
+			entry = _acl_duplicate_entry(aclp, i);
+
+			/* Adjust counter, as we've just added an entry. */
+			i++;
+
+			previous->ae_tag = entry->ae_tag;
+			previous->ae_id = entry->ae_id;
+			previous->ae_flags = entry->ae_flags;
+			previous->ae_perm = 0;
+			previous->ae_entry_type = ACL_ENTRY_TYPE_DENY;
+		}
+
+		/*
+		 * 1.5.2. The following modifications are made to the prepended
+		 *        ACE.  The intent is to mask the following ACE
+		 *        to disallow ACL_READ_DATA, ACL_WRITE_DATA,
+		 *        ACL_APPEND_DATA, or ACL_EXECUTE, based upon the group
+		 *        permissions of the new mode.  As a special case,
+		 *        if the ACE matches the current owner of the file,
+		 *        the owner bits are used, rather than the group bits.
+		 *        This is reflected in the algorithm below.
+		 */
+		amode = mode >> 3;
+
+		/*
+		 * If ACE4_IDENTIFIER_GROUP is not set, and the "who" field
+		 * in ACE matches the owner of the file, we shift amode three
+		 * more bits, in order to have the owner permission bits
+		 * placed in the three low order bits of amode.
+		 */
+		if (entry->ae_tag == ACL_USER && entry->ae_id == file_owner_id)
+			amode = amode >> 3;
+
+		if (entry->ae_perm & ACL_READ_DATA) {
+			if (amode & READ)
+				previous->ae_perm &= ~ACL_READ_DATA;
+			else
+				previous->ae_perm |= ACL_READ_DATA;
+		}
+
+		if (entry->ae_perm & ACL_WRITE_DATA) {
+			if (amode & WRITE)
+				previous->ae_perm &= ~ACL_WRITE_DATA;
+			else
+				previous->ae_perm |= ACL_WRITE_DATA;
+		}
+
+		if (entry->ae_perm & ACL_APPEND_DATA) {
+			if (amode & WRITE)
+				previous->ae_perm &= ~ACL_APPEND_DATA;
+			else
+				previous->ae_perm |= ACL_APPEND_DATA;
+		}
+
+		if (entry->ae_perm & ACL_EXECUTE) {
+			if (amode & EXEC)
+				previous->ae_perm &= ~ACL_EXECUTE;
+			else
+				previous->ae_perm |= ACL_EXECUTE;
+		}
+
+		/*
+		 * 1.5.3. If ACE4_IDENTIFIER_GROUP is set in the flags
+		 *        of the ALLOW ace:
+		 *
+		 * XXX: This point is not there in the Falkner's draft.
+		 */
+		if (entry->ae_tag == ACL_GROUP &&
+		    entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW) {
+			mode_t extramode, ownermode;
+			extramode = (mode >> 3) & 07;
+			ownermode = mode >> 6;
+			extramode &= ~ownermode;
+
+			if (extramode) {
+				if (extramode & READ) {
+					entry->ae_perm &= ~ACL_READ_DATA;
+					previous->ae_perm &= ~ACL_READ_DATA;
+				}
+
+				if (extramode & WRITE) {
+					entry->ae_perm &=
+					    ~(ACL_WRITE_DATA | ACL_APPEND_DATA);
+					previous->ae_perm &=
+					    ~(ACL_WRITE_DATA | ACL_APPEND_DATA);
+				}
+
+				if (extramode & EXEC) {
+					entry->ae_perm &= ~ACL_EXECUTE;
+					previous->ae_perm &= ~ACL_EXECUTE;
+				}
+			}
+		}
+	}
+
+	/*
+	 * 2. If there at least six ACEs, the final six ACEs are examined.
+	 *    If they are not equal to what we want, append six ACEs.
+	 */
+	must_append = 0;
+	if (aclp->acl_cnt < 6) {
+		must_append = 1;
+	} else {
+		a6 = &(aclp->acl_entry[aclp->acl_cnt - 1]);
+		a5 = &(aclp->acl_entry[aclp->acl_cnt - 2]);
+		a4 = &(aclp->acl_entry[aclp->acl_cnt - 3]);
+		a3 = &(aclp->acl_entry[aclp->acl_cnt - 4]);
+		a2 = &(aclp->acl_entry[aclp->acl_cnt - 5]);
+		a1 = &(aclp->acl_entry[aclp->acl_cnt - 6]);
+
+		if (!_acl_entry_matches(a1, ACL_USER_OBJ, 0,
+		    ACL_ENTRY_TYPE_DENY))
+			must_append = 1;
+		if (!_acl_entry_matches(a2, ACL_USER_OBJ, ACL_WRITE_ACL |
+		    ACL_WRITE_OWNER | ACL_WRITE_ATTRIBUTES |
+		    ACL_WRITE_NAMED_ATTRS, ACL_ENTRY_TYPE_ALLOW))
+			must_append = 1;
+		if (!_acl_entry_matches(a3, ACL_GROUP_OBJ, 0,
+		    ACL_ENTRY_TYPE_DENY))
+			must_append = 1;
+		if (!_acl_entry_matches(a4, ACL_GROUP_OBJ, 0,
+		    ACL_ENTRY_TYPE_ALLOW))
+			must_append = 1;
+		if (!_acl_entry_matches(a5, ACL_EVERYONE, ACL_WRITE_ACL |
+		    ACL_WRITE_OWNER | ACL_WRITE_ATTRIBUTES |
+		    ACL_WRITE_NAMED_ATTRS, ACL_ENTRY_TYPE_DENY))
+			must_append = 1;
+		if (!_acl_entry_matches(a6, ACL_EVERYONE, ACL_READ_ACL |
+		    ACL_READ_ATTRIBUTES | ACL_READ_NAMED_ATTRS |
+		    ACL_SYNCHRONIZE, ACL_ENTRY_TYPE_ALLOW))
+			must_append = 1;
+	}
+
+	if (must_append) {
+		KASSERT(aclp->acl_cnt + 6 <= ACL_MAX_ENTRIES,
+		    ("aclp->acl_cnt <= ACL_MAX_ENTRIES"));
+
+		a1 = _acl_append(aclp, ACL_USER_OBJ, 0, ACL_ENTRY_TYPE_DENY);
+		a2 = _acl_append(aclp, ACL_USER_OBJ, ACL_WRITE_ACL |
+		    ACL_WRITE_OWNER | ACL_WRITE_ATTRIBUTES |
+		    ACL_WRITE_NAMED_ATTRS, ACL_ENTRY_TYPE_ALLOW);
+		a3 = _acl_append(aclp, ACL_GROUP_OBJ, 0, ACL_ENTRY_TYPE_DENY);
+		a4 = _acl_append(aclp, ACL_GROUP_OBJ, 0, ACL_ENTRY_TYPE_ALLOW);
+		a5 = _acl_append(aclp, ACL_EVERYONE, ACL_WRITE_ACL |
+		    ACL_WRITE_OWNER | ACL_WRITE_ATTRIBUTES |
+		    ACL_WRITE_NAMED_ATTRS, ACL_ENTRY_TYPE_DENY);
+		a6 = _acl_append(aclp, ACL_EVERYONE, ACL_READ_ACL |
+		    ACL_READ_ATTRIBUTES | ACL_READ_NAMED_ATTRS |
+		    ACL_SYNCHRONIZE, ACL_ENTRY_TYPE_ALLOW);
+
+		KASSERT(a1 != NULL && a2 != NULL && a3 != NULL && a4 != NULL &&
+		    a5 != NULL && a6 != NULL, ("couldn't append to ACL."));
+	}
+
+	/*
+	 * 3. The final six ACEs are adjusted according to the incoming mode.
+	 */
+	if (mode & S_IRUSR)
+		a2->ae_perm |= ACL_READ_DATA;
+	else
+		a1->ae_perm |= ACL_READ_DATA;
+	if (mode & S_IWUSR)
+		a2->ae_perm |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
+	else
+		a1->ae_perm |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
+	if (mode & S_IXUSR)
+		a2->ae_perm |= ACL_EXECUTE;
+	else
+		a1->ae_perm |= ACL_EXECUTE;
+
+	if (mode & S_IRGRP)
+		a4->ae_perm |= ACL_READ_DATA;
+	else
+		a3->ae_perm |= ACL_READ_DATA;
+	if (mode & S_IWGRP)
+		a4->ae_perm |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
+	else
+		a3->ae_perm |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
+	if (mode & S_IXGRP)
+		a4->ae_perm |= ACL_EXECUTE;
+	else
+		a3->ae_perm |= ACL_EXECUTE;
+
+	if (mode & S_IROTH)
+		a6->ae_perm |= ACL_READ_DATA;
+	else
+		a5->ae_perm |= ACL_READ_DATA;
+	if (mode & S_IWOTH)
+		a6->ae_perm |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
+	else
+		a5->ae_perm |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
+	if (mode & S_IXOTH)
+		a6->ae_perm |= ACL_EXECUTE;
+	else
+		a5->ae_perm |= ACL_EXECUTE;
+}
+
+void
+acl_nfs4_sync_mode_from_acl(mode_t *_mode, const struct acl *aclp)
+{
+	int i;
+	mode_t old_mode = *_mode, mode = 0, seen = 0;
+	const struct acl_entry *entry;
+
+	KASSERT(aclp->acl_cnt > 0, ("aclp->acl_cnt > 0"));
+	KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES,
+	    ("aclp->acl_cnt <= ACL_MAX_ENTRIES"));
+
+	/*
+	 * NFSv4 Minor Version 1, draft-ietf-nfsv4-minorversion1-03.txt
+	 *
+	 * 3.16.6.1. Recomputing mode upon SETATTR of ACL
+	 */
+
+	for (i = 0; i < aclp->acl_cnt; i++) {
+		entry = &(aclp->acl_entry[i]);
+
+		if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW &&
+		    entry->ae_entry_type != ACL_ENTRY_TYPE_DENY)
+			continue;
+
+		if (entry->ae_flags & ACL_ENTRY_INHERIT_ONLY)
+			continue;
+
+		if (entry->ae_tag == ACL_USER_OBJ) {
+			if ((entry->ae_perm & ACL_READ_DATA) &&
+			    ((seen & S_IRUSR) == 0)) {
+				seen |= S_IRUSR;
+				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+					mode |= S_IRUSR;
+			}
+			if ((entry->ae_perm & ACL_WRITE_DATA) &&
+			     ((seen & S_IWUSR) == 0)) {
+				seen |= S_IWUSR;
+				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+					mode |= S_IWUSR;
+			}
+			if ((entry->ae_perm & ACL_EXECUTE) &&
+			    ((seen & S_IXUSR) == 0)) {
+				seen |= S_IXUSR;
+				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+					mode |= S_IXUSR;
+			}
+		} else if (entry->ae_tag == ACL_GROUP_OBJ) {
+			if ((entry->ae_perm & ACL_READ_DATA) &&
+			    ((seen & S_IRGRP) == 0)) {
+				seen |= S_IRGRP;
+				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+					mode |= S_IRGRP;
+			}
+			if ((entry->ae_perm & ACL_WRITE_DATA) &&
+			    ((seen & S_IWGRP) == 0)) {
+				seen |= S_IWGRP;
+				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+					mode |= S_IWGRP;
+			}
+			if ((entry->ae_perm & ACL_EXECUTE) &&
+			    ((seen & S_IXGRP) == 0)) {
+				seen |= S_IXGRP;
+				if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+					mode |= S_IXGRP;
+			}
+		} else if (entry->ae_tag == ACL_EVERYONE) {
+			if (entry->ae_perm & ACL_READ_DATA) {
+				if ((seen & S_IRUSR) == 0) {
+					seen |= S_IRUSR;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IRUSR;
+				}
+				if ((seen & S_IRGRP) == 0) {
+					seen |= S_IRGRP;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IRGRP;
+				}
+				if ((seen & S_IROTH) == 0) {
+					seen |= S_IROTH;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IROTH;
+				}
+			}
+			if (entry->ae_perm & ACL_WRITE_DATA) {
+				if ((seen & S_IWUSR) == 0) {
+					seen |= S_IWUSR;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IWUSR;
+				}
+				if ((seen & S_IWGRP) == 0) {
+					seen |= S_IWGRP;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IWGRP;
+				}
+				if ((seen & S_IWOTH) == 0) {
+					seen |= S_IWOTH;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IWOTH;
+				}
+			}
+			if (entry->ae_perm & ACL_EXECUTE) {
+				if ((seen & S_IXUSR) == 0) {
+					seen |= S_IXUSR;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IXUSR;
+				}
+				if ((seen & S_IXGRP) == 0) {
+					seen |= S_IXGRP;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IXGRP;
+				}
+				if ((seen & S_IXOTH) == 0) {
+					seen |= S_IXOTH;
+					if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW)
+						mode |= S_IXOTH;
+				}
+			}
+		}
+	}
+
+	*_mode = mode | (old_mode & ACL_PRESERVE_MASK);
+}

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 20:20:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6EFD210656A8;
	Tue,  9 Jun 2009 20:20:09 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 42EA28FC0A;
	Tue,  9 Jun 2009 20:20:09 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59KK9Uh082593;
	Tue, 9 Jun 2009 20:20:09 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59KK98o082592;
	Tue, 9 Jun 2009 20:20:09 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200906092020.n59KK98o082592@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 9 Jun 2009 20:20: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: r193853 - head/usr.sbin/mergemaster
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 20:20:10 -0000

Author: dougb
Date: Tue Jun  9 20:20:08 2009
New Revision: 193853
URL: http://svn.freebsd.org/changeset/base/193853

Log:
  1. Update the message that prints out for -U when the mtree database does
  not exist to let the user know that it will be created for the next run.
  
  2. Delete more stuff we're not going to use from the temproot prior to
  creating the mtree database to dramatically reduce its size (162K -> 37K).
  
  3. We've been deleting the zero-size files from temproot for a long time
  now, so remove the spurious "-size +0" from the find command in the
  comparison loop, and remove what is now a really stale comment.

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.sh	Tue Jun  9 20:16:22 2009	(r193852)
+++ head/usr.sbin/mergemaster/mergemaster.sh	Tue Jun  9 20:20:08 2009	(r193853)
@@ -353,7 +353,8 @@ case "${AUTO_UPGRADE}" in
 *)
   if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then
     echo ''
-    echo "*** Unable to find mtree database. Skipping auto-upgrade."
+    echo "*** Unable to find mtree database. Skipping auto-upgrade on this run."
+    echo "    It will be created for the next run when this one is complete."
     echo ''
     press_to_continue
     unset AUTO_UPGRADE
@@ -674,8 +675,11 @@ rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/e
 # We only need to compare things like freebsd.cf once
 find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null
 
-# Delete 0 length files to make the mtree database as small as possible.
+# Delete stuff we do not need to keep the mtree database small,
+# and to make the actual comparison faster.
+find ${TEMPROOT}/usr -type l -delete 2>/dev/null
 find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null
+find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null
 
 # Build the mtree database in a temporary location.
 MTREENEW=`mktemp -t mergemaster.mtree`
@@ -963,11 +967,7 @@ if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; th
   . "${MM_PRE_COMPARE_SCRIPT}"
 fi
 
-# Using -size +0 avoids uselessly checking the empty log files created
-# by ${SOURCEDIR}/etc/Makefile and the device entries in ./dev, but does
-# check the scripts in ./dev, as we'd like (assuming no devfs of course).
-#
-for COMPFILE in `find . -type f -size +0`; do
+for COMPFILE in `find . -type f`; do
 
   # First, check to see if the file exists in DESTDIR.  If not, the
   # diff_loop function knows how to handle it.

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 20:21:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F8EC10656A6;
	Tue,  9 Jun 2009 20:21:40 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7C6DD8FC0A;
	Tue,  9 Jun 2009 20:21:40 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59KLeUY082675;
	Tue, 9 Jun 2009 20:21:40 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59KLe2J082673;
	Tue, 9 Jun 2009 20:21:40 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906092021.n59KLe2J082673@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 9 Jun 2009 20:21:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193854 - in head/sys: libkern net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 20:21:41 -0000

Author: kmacy
Date: Tue Jun  9 20:21:40 2009
New Revision: 193854
URL: http://svn.freebsd.org/changeset/base/193854

Log:
  move jenkins hash to its own header in libkern

Added:
  head/sys/libkern/jenkins.h   (contents, props changed)
Modified:
  head/sys/net/flowtable.c

Added: head/sys/libkern/jenkins.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/libkern/jenkins.h	Tue Jun  9 20:21:40 2009	(r193854)
@@ -0,0 +1,149 @@
+#ifndef __LIBKERN_JENKINS_H__
+#define __LIBKERN_JENKINS_H__
+/*
+ * Taken from http://burtleburtle.net/bob/c/lookup3.c
+ * $FreeBSD$
+ */
+
+#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
+
+/*
+-------------------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly.
+
+This is reversible, so any information in (a,b,c) before mix() is
+still in (a,b,c) after mix().
+
+If four pairs of (a,b,c) inputs are run through mix(), or through
+mix() in reverse, there are at least 32 bits of the output that
+are sometimes the same for one pair and different for another pair.
+This was tested for:
+* pairs that differed by one bit, by two bits, in any combination
+  of top bits of (a,b,c), or in any combination of bottom bits of
+  (a,b,c).
+* "differ" is defined as +, -, ^, or ~^.  For + and -, I transformed
+  the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
+  is commonly produced by subtraction) look like a single 1-bit
+  difference.
+* the base values were pseudorandom, all zero but one bit set, or 
+  all zero plus a counter that starts at zero.
+
+Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
+satisfy this are
+    4  6  8 16 19  4
+    9 15  3 18 27 15
+   14  9  3  7 17  3
+Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
+for "differ" defined as + with a one-bit base and a two-bit delta.  I
+used http://burtleburtle.net/bob/hash/avalanche.html to choose 
+the operations, constants, and arrangements of the variables.
+
+This does not achieve avalanche.  There are input bits of (a,b,c)
+that fail to affect some output bits of (a,b,c), especially of a.  The
+most thoroughly mixed value is c, but it doesn't really even achieve
+avalanche in c.
+
+This allows some parallelism.  Read-after-writes are good at doubling
+the number of bits affected, so the goal of mixing pulls in the opposite
+direction as the goal of parallelism.  I did what I could.  Rotates
+seem to cost as much as shifts on every machine I could lay my hands
+on, and rotates are much kinder to the top and bottom bits, so I used
+rotates.
+-------------------------------------------------------------------------------
+*/
+#define mix(a,b,c) \
+{ \
+  a -= c;  a ^= rot(c, 4);  c += b; \
+  b -= a;  b ^= rot(a, 6);  a += c; \
+  c -= b;  c ^= rot(b, 8);  b += a; \
+  a -= c;  a ^= rot(c,16);  c += b; \
+  b -= a;  b ^= rot(a,19);  a += c; \
+  c -= b;  c ^= rot(b, 4);  b += a; \
+}
+
+/*
+-------------------------------------------------------------------------------
+final -- final mixing of 3 32-bit values (a,b,c) into c
+
+Pairs of (a,b,c) values differing in only a few bits will usually
+produce values of c that look totally different.  This was tested for
+* pairs that differed by one bit, by two bits, in any combination
+  of top bits of (a,b,c), or in any combination of bottom bits of
+  (a,b,c).
+* "differ" is defined as +, -, ^, or ~^.  For + and -, I transformed
+  the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
+  is commonly produced by subtraction) look like a single 1-bit
+  difference.
+* the base values were pseudorandom, all zero but one bit set, or 
+  all zero plus a counter that starts at zero.
+
+These constants passed:
+ 14 11 25 16 4 14 24
+ 12 14 25 16 4 14 24
+and these came close:
+  4  8 15 26 3 22 24
+ 10  8 15 26 3 22 24
+ 11  8 15 26 3 22 24
+-------------------------------------------------------------------------------
+*/
+#define final(a,b,c) \
+{ \
+  c ^= b; c -= rot(b,14); \
+  a ^= c; a -= rot(c,11); \
+  b ^= a; b -= rot(a,25); \
+  c ^= b; c -= rot(b,16); \
+  a ^= c; a -= rot(c,4);  \
+  b ^= a; b -= rot(a,14); \
+  c ^= b; c -= rot(b,24); \
+}
+
+/*
+--------------------------------------------------------------------
+ This works on all machines.  To be useful, it requires
+ -- that the key be an array of uint32_t's, and
+ -- that the length be the number of uint32_t's in the key
+
+ The function hashword() is identical to hashlittle() on little-endian
+ machines, and identical to hashbig() on big-endian machines,
+ except that the length has to be measured in uint32_ts rather than in
+ bytes.  hashlittle() is more complicated than hashword() only because
+ hashlittle() has to dance around fitting the key bytes into registers.
+--------------------------------------------------------------------
+*/
+static uint32_t
+jenkins_hashword(
+                const uint32_t *k,  /* the key, an array of uint32_t values */
+                size_t length,      /* the length of the key, in uint32_ts */
+                uint32_t initval    /* the previous hash, or an arbitrary value */
+)
+{
+  uint32_t a,b,c;
+
+  /* Set up the internal state */
+  a = b = c = 0xdeadbeef + (((uint32_t)length)<<2) + initval;
+
+  /*------------------------------------------------- handle most of the key */
+  while (length > 3)
+  {
+    a += k[0];
+    b += k[1];
+    c += k[2];
+    mix(a,b,c);
+    length -= 3;
+    k += 3;
+  }
+
+  /*------------------------------------------- handle the last 3 uint32_t's */
+  switch(length)                     /* all the case statements fall through */
+  { 
+  case 3 : c+=k[2];
+  case 2 : b+=k[1];
+  case 1 : a+=k[0];
+    final(a,b,c);
+  case 0:     /* case 0: nothing left to add */
+    break;
+  }
+  /*------------------------------------------------------ report the result */
+  return c;
+}
+#endif 

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Tue Jun  9 20:20:08 2009	(r193853)
+++ head/sys/net/flowtable.c	Tue Jun  9 20:21:40 2009	(r193854)
@@ -67,150 +67,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-/*
- * Taken from http://burtleburtle.net/bob/c/lookup3.c
- */
-
-#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
-
-/*
--------------------------------------------------------------------------------
-mix -- mix 3 32-bit values reversibly.
-
-This is reversible, so any information in (a,b,c) before mix() is
-still in (a,b,c) after mix().
-
-If four pairs of (a,b,c) inputs are run through mix(), or through
-mix() in reverse, there are at least 32 bits of the output that
-are sometimes the same for one pair and different for another pair.
-This was tested for:
-* pairs that differed by one bit, by two bits, in any combination
-  of top bits of (a,b,c), or in any combination of bottom bits of
-  (a,b,c).
-* "differ" is defined as +, -, ^, or ~^.  For + and -, I transformed
-  the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
-  is commonly produced by subtraction) look like a single 1-bit
-  difference.
-* the base values were pseudorandom, all zero but one bit set, or 
-  all zero plus a counter that starts at zero.
-
-Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
-satisfy this are
-    4  6  8 16 19  4
-    9 15  3 18 27 15
-   14  9  3  7 17  3
-Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
-for "differ" defined as + with a one-bit base and a two-bit delta.  I
-used http://burtleburtle.net/bob/hash/avalanche.html to choose 
-the operations, constants, and arrangements of the variables.
-
-This does not achieve avalanche.  There are input bits of (a,b,c)
-that fail to affect some output bits of (a,b,c), especially of a.  The
-most thoroughly mixed value is c, but it doesn't really even achieve
-avalanche in c.
-
-This allows some parallelism.  Read-after-writes are good at doubling
-the number of bits affected, so the goal of mixing pulls in the opposite
-direction as the goal of parallelism.  I did what I could.  Rotates
-seem to cost as much as shifts on every machine I could lay my hands
-on, and rotates are much kinder to the top and bottom bits, so I used
-rotates.
--------------------------------------------------------------------------------
-*/
-#define mix(a,b,c) \
-{ \
-  a -= c;  a ^= rot(c, 4);  c += b; \
-  b -= a;  b ^= rot(a, 6);  a += c; \
-  c -= b;  c ^= rot(b, 8);  b += a; \
-  a -= c;  a ^= rot(c,16);  c += b; \
-  b -= a;  b ^= rot(a,19);  a += c; \
-  c -= b;  c ^= rot(b, 4);  b += a; \
-}
-
-/*
--------------------------------------------------------------------------------
-final -- final mixing of 3 32-bit values (a,b,c) into c
-
-Pairs of (a,b,c) values differing in only a few bits will usually
-produce values of c that look totally different.  This was tested for
-* pairs that differed by one bit, by two bits, in any combination
-  of top bits of (a,b,c), or in any combination of bottom bits of
-  (a,b,c).
-* "differ" is defined as +, -, ^, or ~^.  For + and -, I transformed
-  the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
-  is commonly produced by subtraction) look like a single 1-bit
-  difference.
-* the base values were pseudorandom, all zero but one bit set, or 
-  all zero plus a counter that starts at zero.
-
-These constants passed:
- 14 11 25 16 4 14 24
- 12 14 25 16 4 14 24
-and these came close:
-  4  8 15 26 3 22 24
- 10  8 15 26 3 22 24
- 11  8 15 26 3 22 24
--------------------------------------------------------------------------------
-*/
-#define final(a,b,c) \
-{ \
-  c ^= b; c -= rot(b,14); \
-  a ^= c; a -= rot(c,11); \
-  b ^= a; b -= rot(a,25); \
-  c ^= b; c -= rot(b,16); \
-  a ^= c; a -= rot(c,4);  \
-  b ^= a; b -= rot(a,14); \
-  c ^= b; c -= rot(b,24); \
-}
-
-/*
---------------------------------------------------------------------
- This works on all machines.  To be useful, it requires
- -- that the key be an array of uint32_t's, and
- -- that the length be the number of uint32_t's in the key
-
- The function hashword() is identical to hashlittle() on little-endian
- machines, and identical to hashbig() on big-endian machines,
- except that the length has to be measured in uint32_ts rather than in
- bytes.  hashlittle() is more complicated than hashword() only because
- hashlittle() has to dance around fitting the key bytes into registers.
---------------------------------------------------------------------
-*/
-static uint32_t hashword(
-const uint32_t *k,                   /* the key, an array of uint32_t values */
-size_t          length,               /* the length of the key, in uint32_ts */
-uint32_t        initval)         /* the previous hash, or an arbitrary value */
-{
-  uint32_t a,b,c;
-
-  /* Set up the internal state */
-  a = b = c = 0xdeadbeef + (((uint32_t)length)<<2) + initval;
-
-  /*------------------------------------------------- handle most of the key */
-  while (length > 3)
-  {
-    a += k[0];
-    b += k[1];
-    c += k[2];
-    mix(a,b,c);
-    length -= 3;
-    k += 3;
-  }
-
-  /*------------------------------------------- handle the last 3 uint32_t's */
-  switch(length)                     /* all the case statements fall through */
-  { 
-  case 3 : c+=k[2];
-  case 2 : b+=k[1];
-  case 1 : a+=k[0];
-    final(a,b,c);
-  case 0:     /* case 0: nothing left to add */
-    break;
-  }
-  /*------------------------------------------------------ report the result */
-  return c;
-}
-
+#include 
 
 struct ipv4_tuple {
 	uint16_t 	ip_sport;	/* source port */
@@ -525,7 +382,7 @@ ipv4_flow_lookup_hash_internal(struct mb
 	((uint16_t *)key)[1] = dport; 
 
 skipports:
-	hash = hashword(key, 3, hashjitter + proto);
+	hash = jenkins_hashword(key, 3, hashjitter + proto);
 	if (m != NULL && (m->m_flags & M_FLOWID) == 0) {
 		m->m_flags |= M_FLOWID;
 		m->m_pkthdr.flowid = hash;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 20:26:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7FF741065676;
	Tue,  9 Jun 2009 20:26:52 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6EA548FC1C;
	Tue,  9 Jun 2009 20:26:52 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59KQqJx082820;
	Tue, 9 Jun 2009 20:26:52 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59KQqRM082818;
	Tue, 9 Jun 2009 20:26:52 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906092026.n59KQqRM082818@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 9 Jun 2009 20: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: r193855 - in head/sys: amd64/conf i386/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 20:26:53 -0000

Author: kmacy
Date: Tue Jun  9 20:26:52 2009
New Revision: 193855
URL: http://svn.freebsd.org/changeset/base/193855

Log:
  remove flowtable from DEFAULTS

Modified:
  head/sys/amd64/conf/DEFAULTS
  head/sys/i386/conf/DEFAULTS

Modified: head/sys/amd64/conf/DEFAULTS
==============================================================================
--- head/sys/amd64/conf/DEFAULTS	Tue Jun  9 20:21:40 2009	(r193854)
+++ head/sys/amd64/conf/DEFAULTS	Tue Jun  9 20:26:52 2009	(r193855)
@@ -21,4 +21,3 @@ options 	GEOM_PART_EBR
 options 	GEOM_PART_EBR_COMPAT
 options 	GEOM_PART_MBR
 
-options 	FLOWTABLE

Modified: head/sys/i386/conf/DEFAULTS
==============================================================================
--- head/sys/i386/conf/DEFAULTS	Tue Jun  9 20:21:40 2009	(r193854)
+++ head/sys/i386/conf/DEFAULTS	Tue Jun  9 20:26:52 2009	(r193855)
@@ -28,5 +28,3 @@ options 	GEOM_PART_MBR
 # enable support for native hardware
 options 	NATIVE
 device		atpic
-
-options 	FLOWTABLE

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 20:27:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E98B8106567C;
	Tue,  9 Jun 2009 20:27:30 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D877D8FC19;
	Tue,  9 Jun 2009 20:27:30 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59KRUd2082872;
	Tue, 9 Jun 2009 20:27:30 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59KRUvF082868;
	Tue, 9 Jun 2009 20:27:30 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906092027.n59KRUvF082868@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 9 Jun 2009 20:27:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193856 - in head/sys: conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 20:27:31 -0000

Author: kmacy
Date: Tue Jun  9 20:27:30 2009
New Revision: 193856
URL: http://svn.freebsd.org/changeset/base/193856

Log:
  make flowtable opt-out

Modified:
  head/sys/conf/files
  head/sys/conf/options
  head/sys/net/flowtable.c
  head/sys/net/flowtable.h

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Jun  9 20:26:52 2009	(r193855)
+++ head/sys/conf/files	Tue Jun  9 20:27:30 2009	(r193856)
@@ -2180,7 +2180,7 @@ net/bpf_jitter.c		optional bpf_jitter
 net/bpf_filter.c		optional bpf | netgraph_bpf
 net/bpf_zerocopy.c		optional bpf
 net/bridgestp.c			optional bridge | if_bridge
-net/flowtable.c			optional flowtable inet
+net/flowtable.c			optional inet
 net/ieee8023ad_lacp.c		optional lagg
 net/if.c			standard
 net/if_arcsubr.c		optional arcnet

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Tue Jun  9 20:26:52 2009	(r193855)
+++ head/sys/conf/options	Tue Jun  9 20:27:30 2009	(r193856)
@@ -421,7 +421,7 @@ TCP_OFFLOAD_DISABLE	opt_inet.h #Disable 
 TCP_SIGNATURE		opt_inet.h
 VLAN_ARRAY		opt_vlan.h
 XBONEHACK
-FLOWTABLE		opt_route.h
+NO_FLOWTABLE		opt_route.h
 
 #
 # SCTP

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Tue Jun  9 20:26:52 2009	(r193855)
+++ head/sys/net/flowtable.c	Tue Jun  9 20:27:30 2009	(r193856)
@@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include 
 __FBSDID("$FreeBSD$");
 
+#ifndef NO_FLOWTABLE
 #include   
 #include 
 #include 
@@ -929,4 +930,4 @@ static struct kproc_desc flow_kp = {
 	&flowcleanerproc
 };
 SYSINIT(flowcleaner, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, kproc_start, &flow_kp);
-
+#endif /* NO_FLOWTABLE */

Modified: head/sys/net/flowtable.h
==============================================================================
--- head/sys/net/flowtable.h	Tue Jun  9 20:26:52 2009	(r193855)
+++ head/sys/net/flowtable.h	Tue Jun  9 20:27:30 2009	(r193856)
@@ -41,7 +41,7 @@ struct flowtable;
 extern struct flowtable *ip_ft;
 extern struct flowtable *ip_forward_ft;
 
-#ifdef FLOWTABLE
+#ifndef NO_FLOWTABLE
 struct flowtable *flowtable_alloc(int nentry, int flags);
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 20:31:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B8EAE106564A;
	Tue,  9 Jun 2009 20:31:01 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.28])
	by mx1.freebsd.org (Postfix) with ESMTP id 317948FC1C;
	Tue,  9 Jun 2009 20:31:01 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: by yw-out-2324.google.com with SMTP id 9so124064ywe.13
	for ; Tue, 09 Jun 2009 13:31:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=xU69INnybC4nAG/VKVdBVYSo+eZUSEUoj8vY2f7uZp4=;
	b=TFg98hQGSz0FLdDWySvFr6pWPk3sd0v+0JUpGlkvB8vr9fwaxERP+/VSiurMinxhTn
	VUSfOHXvn7vqUuTlHy69r93uj+p/AsFUbU+7tDWRfJv9sp+hcch1/ns4nKgoV3poeuD/
	hMKTDGM+dsEBcIKq0q5nzY+kQjwcHCfsfbDHs=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=TskWOBxmSnkPQgnxoXlJzpYwZDiuwOdj/lx9uYqCLXz67LTkKAuOTWZfWdi5Yj7yAe
	dar1jRbq+3FVzR4skc9iKGmUChYQfXTe3rUsu+qZ4Y1l8oQMzM7Bj4pkLYYYGn1mGjWw
	QIDBkUKP1oJy9cwK33H/ou6ts6MMalG0ty1Qk=
MIME-Version: 1.0
Sender: mat.macy@gmail.com
Received: by 10.100.46.3 with SMTP id t3mr565926ant.94.1244579460458; Tue, 09 
	Jun 2009 13:31:00 -0700 (PDT)
In-Reply-To: <20090609143729.R22887@maildrop.int.zabbadoz.net>
References: <200904190016.n3J0G4rA090911@svn.freebsd.org>
	<20090609143729.R22887@maildrop.int.zabbadoz.net>
Date: Tue, 9 Jun 2009 13:30:59 -0700
X-Google-Sender-Auth: 7849c6423454a75f
Message-ID: <3c1674c90906091330g3c1ed56es62223d8f8657b8f1@mail.gmail.com>
From: Kip Macy 
To: "Bjoern A. Zeeb" 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191255 - in head/sys: amd64/conf conf i386/conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 20:31:02 -0000

its opt-out now

On Tue, Jun 9, 2009 at 8:01 AM, Bjoern A. Zeeb wrote:
> On Sun, 19 Apr 2009, Kip Macy wrote:
>
>> Author: kmacy
>> Date: Sun Apr 19 00:16:04 2009
>> New Revision: 191255
>> URL: http://svn.freebsd.org/changeset/base/191255
>>
>> Log:
>> =A0- Import infrastructure for caching flows as a means of accelerating =
L3
>> and L2 lookups
>> =A0 as well as providing stateful load balancing when used with RADIX_MP=
ATH.
>> =A0- Currently compiled in to i386 and amd64 but disabled by default, it=
 can
>> be enabled at
>> =A0 runtime with 'sysctl net.inet.flowtable.enable=3D1'.
>>
>> =A0- Embedded users can remove it entirely from the kernel by adding
>> 'nooption FLOWTABLE' to
>> =A0 their kernel config files.
>>
>> =A0- A minimal hookup will be added to ip_output in a subsequent commit.=
 I
>> would like to see
>> =A0 more review before bringing in changes that require more churn.
>>
>> =A0Supported by: Bitgravity Inc.
>>
>> Added:
>> =A0head/sys/net/flowtable.c =A0 (contents, props changed)
>> =A0head/sys/net/flowtable.h =A0 (contents, props changed)
>> Modified:
>> =A0head/sys/amd64/conf/DEFAULTS
>
> =A0...
>>
>> =A0head/sys/i386/conf/DEFAULTS
>
> =A0...
>>
>> Modified: head/sys/amd64/conf/DEFAULTS
>>
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/amd64/conf/DEFAULTS =A0 =A0 =A0 =A0Sat Apr 18 22:16:46 2009
>> =A0(r191254)
>> +++ head/sys/amd64/conf/DEFAULTS =A0 =A0 =A0 =A0Sun Apr 19 00:16:04 2009
>> =A0(r191255)
>> @@ -20,3 +20,5 @@ options =A0 =A0 =A0 GEOM_PART_BSD
>> options =A0 =A0 =A0 =A0 GEOM_PART_EBR
>> options =A0 =A0 =A0 =A0 GEOM_PART_EBR_COMPAT
>> options =A0 =A0 =A0 =A0 GEOM_PART_MBR
>> +
>> +options =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FLOWTABLE
>>
>> Modified: head/sys/i386/conf/DEFAULTS
>>
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/i386/conf/DEFAULTS Sat Apr 18 22:16:46 2009 =A0 =A0 =A0 =A0=
(r191254)
>> +++ head/sys/i386/conf/DEFAULTS Sun Apr 19 00:16:04 2009 =A0 =A0 =A0 =A0=
(r191255)
>> @@ -28,3 +28,5 @@ options =A0 =A0 =A0 GEOM_PART_MBR
>> # enable support for native hardware
>> options =A0 =A0 =A0 =A0 NATIVE
>> device =A0 =A0 =A0 =A0 =A0atpic
>> +
>> +options =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FLOWTABLE
>
> ...
>
>
>
> I think FLOWTABLE does nto belong into DEFAULTS. =A0Really DEFAULTS was
> meant for "You cannot boot without this" and if people start to weaken
> it, DEFAULTS will soon be the new GENERIC. =A0That said I am not sure it
> belongs to GENERIC either.
>
> --
> Bjoern A. Zeeb =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0The greatest ri=
sk is not taking one.
>



--=20
When bad men combine, the good must associate; else they will fall one
by one, an unpitied sacrifice in a contemptible struggle.

    Edmund Burke

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:20:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 74FF5106568F;
	Tue,  9 Jun 2009 21:20:39 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 4805D8FC24;
	Tue,  9 Jun 2009 21:20:39 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id F13ED46B39;
	Tue,  9 Jun 2009 17:20:38 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id F216C8A06B;
	Tue,  9 Jun 2009 17:20:37 -0400 (EDT)
From: John Baldwin 
To: Kip Macy 
Date: Tue, 9 Jun 2009 17:15:16 -0400
User-Agent: KMail/1.9.7
References: <200906092021.n59KLe2J082673@svn.freebsd.org>
In-Reply-To: <200906092021.n59KLe2J082673@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200906091715.17197.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Tue, 09 Jun 2009 17:20:38 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193854 - in head/sys: libkern net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:20:40 -0000

On Tuesday 09 June 2009 4:21:40 pm Kip Macy wrote:
> Author: kmacy
> Date: Tue Jun  9 20:21:40 2009
> New Revision: 193854
> URL: http://svn.freebsd.org/changeset/base/193854
> 
> Log:
>   move jenkins hash to its own header in libkern
> 
> Added:
>   head/sys/libkern/jenkins.h   (contents, props changed)
> Modified:
>   head/sys/net/flowtable.c
> 
> Added: head/sys/libkern/jenkins.h

Should this include the paragraph of license blurb from lookup3.c at the top 
perhaps?

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:27:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A39761065672;
	Tue,  9 Jun 2009 21:27:11 +0000 (UTC)
	(envelope-from oleg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 90CE08FC18;
	Tue,  9 Jun 2009 21:27:11 +0000 (UTC)
	(envelope-from oleg@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59LRB6m084338;
	Tue, 9 Jun 2009 21:27:11 GMT (envelope-from oleg@svn.freebsd.org)
Received: (from oleg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59LRBxT084329;
	Tue, 9 Jun 2009 21:27:11 GMT (envelope-from oleg@svn.freebsd.org)
Message-Id: <200906092127.n59LRBxT084329@svn.freebsd.org>
From: Oleg Bulyzhin 
Date: Tue, 9 Jun 2009 21:27:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193859 - in head/sys: net netgraph netinet netinet/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:27:12 -0000

Author: oleg
Date: Tue Jun  9 21:27:11 2009
New Revision: 193859
URL: http://svn.freebsd.org/changeset/base/193859

Log:
  Close long existed race with net.inet.ip.fw.one_pass = 0:
  If packet leaves ipfw to other kernel subsystem (dummynet, netgraph, etc)
  it carries pointer to matching ipfw rule. If this packet then reinjected back
  to ipfw, ruleset processing starts from that rule. If rule was deleted
  meanwhile, due to existed race condition panic was possible (as well as
  other odd effects like parsing rules in 'reap list').
  
  P.S. this commit changes ABI so userland ipfw related binaries should be
  recompiled.
  
  MFC after:	1 month
  Tested by:	Mikolaj Golub

Modified:
  head/sys/net/if_bridge.c
  head/sys/net/if_ethersubr.c
  head/sys/netgraph/ng_ipfw.c
  head/sys/netgraph/ng_ipfw.h
  head/sys/netinet/ip_dummynet.h
  head/sys/netinet/ip_fw.h
  head/sys/netinet/ipfw/ip_dummynet.c
  head/sys/netinet/ipfw/ip_fw2.c
  head/sys/netinet/ipfw/ip_fw_pfil.c

Modified: head/sys/net/if_bridge.c
==============================================================================
--- head/sys/net/if_bridge.c	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/net/if_bridge.c	Tue Jun  9 21:27:11 2009	(r193859)
@@ -3041,11 +3041,19 @@ bridge_pfil(struct mbuf **mp, struct ifn
 
 	if (ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) {
 		INIT_VNET_INET(curvnet);
+		struct dn_pkt_tag *dn_tag;
 
 		error = -1;
-		args.rule = ip_dn_claim_rule(*mp);
-		if (args.rule != NULL && V_fw_one_pass)
-			goto ipfwpass; /* packet already partially processed */
+		dn_tag = ip_dn_claim_tag(*mp);
+		if (dn_tag != NULL) {
+			if (dn_tag->rule != NULL && V_fw_one_pass)
+				/* packet already partially processed */
+				goto ipfwpass;
+			args.rule = dn_tag->rule; /* matching rule to restart */
+			args.rule_id = dn_tag->rule_id;
+			args.chain_id = dn_tag->chain_id;
+		} else
+			args.rule = NULL;
 
 		args.m = *mp;
 		args.oif = ifp;

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/net/if_ethersubr.c	Tue Jun  9 21:27:11 2009	(r193859)
@@ -145,8 +145,7 @@ MALLOC_DEFINE(M_ARPCOM, "arpcom", "802.*
 
 #if defined(INET) || defined(INET6)
 int
-ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst,
-	struct ip_fw **rule, int shared);
+ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared);
 #ifdef VIMAGE_GLOBALS
 static int ether_ipfw;
 #endif
@@ -428,10 +427,9 @@ ether_output_frame(struct ifnet *ifp, st
 {
 #if defined(INET) || defined(INET6)
 	INIT_VNET_NET(ifp->if_vnet);
-	struct ip_fw *rule = ip_dn_claim_rule(m);
 
 	if (ip_fw_chk_ptr && V_ether_ipfw != 0) {
-		if (ether_ipfw_chk(&m, ifp, &rule, 0) == 0) {
+		if (ether_ipfw_chk(&m, ifp, 0) == 0) {
 			if (m) {
 				m_freem(m);
 				return EACCES;	/* pkt dropped */
@@ -455,8 +453,7 @@ ether_output_frame(struct ifnet *ifp, st
  * ether_output_frame.
  */
 int
-ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst,
-	struct ip_fw **rule, int shared)
+ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared)
 {
 	INIT_VNET_INET(dst->if_vnet);
 	struct ether_header *eh;
@@ -464,9 +461,19 @@ ether_ipfw_chk(struct mbuf **m0, struct 
 	struct mbuf *m;
 	int i;
 	struct ip_fw_args args;
+	struct dn_pkt_tag *dn_tag;
 
-	if (*rule != NULL && V_fw_one_pass)
-		return 1; /* dummynet packet, already partially processed */
+	dn_tag = ip_dn_claim_tag(*m0);
+
+	if (dn_tag != NULL) {
+		if (dn_tag->rule != NULL && V_fw_one_pass)
+			/* dummynet packet, already partially processed */
+			return (1);
+		args.rule = dn_tag->rule;	/* matching rule to restart */
+		args.rule_id = dn_tag->rule_id;
+		args.chain_id = dn_tag->chain_id;
+	} else
+		args.rule = NULL;
 
 	/*
 	 * I need some amt of data to be contiguous, and in case others need
@@ -487,7 +494,6 @@ ether_ipfw_chk(struct mbuf **m0, struct 
 
 	args.m = m;		/* the packet we are looking at		*/
 	args.oif = dst;		/* destination, if any			*/
-	args.rule = *rule;	/* matching rule to restart		*/
 	args.next_hop = NULL;	/* we do not support forward yet	*/
 	args.eh = &save_eh;	/* MAC header for bridged/MAC packets	*/
 	args.inp = NULL;	/* used by ipfw uid/gid/jail rules	*/
@@ -508,7 +514,6 @@ ether_ipfw_chk(struct mbuf **m0, struct 
 				ETHER_HDR_LEN);
 	}
 	*m0 = m;
-	*rule = args.rule;
 
 	if (i == IP_FW_DENY) /* drop */
 		return 0;
@@ -765,9 +770,7 @@ ether_demux(struct ifnet *ifp, struct mb
 	 * Do not do this for PROMISC frames in case we are re-entered.
 	 */
 	if (ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) {
-		struct ip_fw *rule = ip_dn_claim_rule(m);
-
-		if (ether_ipfw_chk(&m, NULL, &rule, 0) == 0) {
+		if (ether_ipfw_chk(&m, NULL, 0) == 0) {
 			if (m)
 				m_freem(m);	/* dropped; free mbuf chain */
 			return;			/* consumed */

Modified: head/sys/netgraph/ng_ipfw.c
==============================================================================
--- head/sys/netgraph/ng_ipfw.c	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/netgraph/ng_ipfw.c	Tue Jun  9 21:27:11 2009	(r193859)
@@ -293,6 +293,8 @@ ng_ipfw_input(struct mbuf **m0, int dir,
 			return (ENOMEM);
 		}
 		ngit->rule = fwa->rule;
+		ngit->rule_id = fwa->rule_id;
+		ngit->chain_id = fwa->chain_id;
 		ngit->dir = dir;
 		ngit->ifp = fwa->oif;
 		m_tag_prepend(m, &ngit->mt);

Modified: head/sys/netgraph/ng_ipfw.h
==============================================================================
--- head/sys/netgraph/ng_ipfw.h	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/netgraph/ng_ipfw.h	Tue Jun  9 21:27:11 2009	(r193859)
@@ -38,6 +38,8 @@ extern	ng_ipfw_input_t	*ng_ipfw_input_p;
 struct ng_ipfw_tag {
 	struct m_tag	mt;		/* tag header */
 	struct ip_fw	*rule;		/* matching rule */
+	uint32_t	rule_id;	/* matching rule id */
+	uint32_t	chain_id;	/* ruleset id */
 	struct ifnet	*ifp;		/* interface, for ip_output */
 	int		dir;
 #define	NG_IPFW_OUT	0

Modified: head/sys/netinet/ip_dummynet.h
==============================================================================
--- head/sys/netinet/ip_dummynet.h	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/netinet/ip_dummynet.h	Tue Jun  9 21:27:11 2009	(r193859)
@@ -113,6 +113,8 @@ struct dn_heap {
  */
 struct dn_pkt_tag {
     struct ip_fw *rule;		/* matching rule */
+    uint32_t rule_id;		/* matching rule id */
+    uint32_t chain_id;		/* ruleset id */
     int dn_dir;			/* action when packet comes out. */
 #define DN_TO_IP_OUT	1
 #define DN_TO_IP_IN	2
@@ -375,16 +377,16 @@ SLIST_HEAD(dn_pipe_head, dn_pipe);
 #ifdef _KERNEL
 
 /*
- * Return the IPFW rule associated with the dummynet tag; if any.
+ * Return the dummynet tag; if any.
  * Make sure that the dummynet tag is not reused by lower layers.
  */
-static __inline struct ip_fw *
-ip_dn_claim_rule(struct mbuf *m)
+static __inline struct dn_pkt_tag *
+ip_dn_claim_tag(struct mbuf *m)
 {
 	struct m_tag *mtag = m_tag_find(m, PACKET_TAG_DUMMYNET, NULL);
 	if (mtag != NULL) {
 		mtag->m_tag_id = PACKET_TAG_NONE;
-		return (((struct dn_pkt_tag *)(mtag+1))->rule);
+		return ((struct dn_pkt_tag *)(mtag + 1));
 	} else
 		return (NULL);
 }

Modified: head/sys/netinet/ip_fw.h
==============================================================================
--- head/sys/netinet/ip_fw.h	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/netinet/ip_fw.h	Tue Jun  9 21:27:11 2009	(r193859)
@@ -465,17 +465,18 @@ struct ip_fw {
 	struct ip_fw	*next_rule;	/* ptr to next [skipto] rule	*/
 	/* 'next_rule' is used to pass up 'set_disable' status		*/
 
-	u_int16_t	act_ofs;	/* offset of action in 32-bit units */
-	u_int16_t	cmd_len;	/* # of 32-bit words in cmd	*/
-	u_int16_t	rulenum;	/* rule number			*/
-	u_int8_t	set;		/* rule set (0..31)		*/
+	uint16_t	act_ofs;	/* offset of action in 32-bit units */
+	uint16_t	cmd_len;	/* # of 32-bit words in cmd	*/
+	uint16_t	rulenum;	/* rule number			*/
+	uint8_t	set;		/* rule set (0..31)		*/
 #define	RESVD_SET	31	/* set for default and persistent rules */
-	u_int8_t	_pad;		/* padding			*/
+	uint8_t		_pad;		/* padding			*/
+	uint32_t	id;		/* rule id */
 
 	/* These fields are present in all rules.			*/
-	u_int64_t	pcnt;		/* Packet counter		*/
-	u_int64_t	bcnt;		/* Byte counter			*/
-	u_int32_t	timestamp;	/* tv_sec of last match		*/
+	uint64_t	pcnt;		/* Packet counter		*/
+	uint64_t	bcnt;		/* Byte counter			*/
+	uint32_t	timestamp;	/* tv_sec of last match		*/
 
 	ipfw_insn	cmd[1];		/* storage for commands		*/
 };
@@ -619,10 +620,12 @@ struct ip_fw_args {
 	struct ifnet	*oif;		/* output interface		*/
 	struct sockaddr_in *next_hop;	/* forward address		*/
 	struct ip_fw	*rule;		/* matching rule		*/
+	uint32_t	rule_id;	/* matching rule id */
+	uint32_t	chain_id;	/* ruleset id */
 	struct ether_header *eh;	/* for bridged packets		*/
 
 	struct ipfw_flow_id f_id;	/* grabbed from IP header	*/
-	u_int32_t	cookie;		/* a cookie depending on rule action */
+	uint32_t	cookie;		/* a cookie depending on rule action */
 	struct inpcb	*inp;
 
 	struct _ip6dn_args	dummypar; /* dummynet->ip6_output */
@@ -662,6 +665,7 @@ struct ip_fw_chain {
 	LIST_HEAD(, cfg_nat) nat;       /* list of nat entries */
 	struct radix_node_head *tables[IPFW_TABLES_MAX];
 	struct rwlock	rwmtx;
+	uint32_t	id;		/* ruleset id */
 };
 
 #ifdef IPFW_INTERNAL

Modified: head/sys/netinet/ipfw/ip_dummynet.c
==============================================================================
--- head/sys/netinet/ipfw/ip_dummynet.c	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/netinet/ipfw/ip_dummynet.c	Tue Jun  9 21:27:11 2009	(r193859)
@@ -243,7 +243,6 @@ static void	dummynet_flush(void);
 static void	dummynet_send(struct mbuf *);
 void		dummynet_drain(void);
 static int	dummynet_io(struct mbuf **, int , struct ip_fw_args *);
-static void	dn_rule_delete(void *);
 
 /*
  * Heap management functions.
@@ -1399,6 +1398,8 @@ dummynet_io(struct mbuf **m0, int dir, s
 	 * Build and enqueue packet + parameters.
 	 */
 	pkt->rule = fwa->rule;
+	pkt->rule_id = fwa->rule_id;
+	pkt->chain_id = fwa->chain_id;
 	pkt->dn_dir = dir;
 
 	pkt->ifp = fwa->oif;
@@ -1622,60 +1623,6 @@ dummynet_flush(void)
 	DUMMYNET_UNLOCK();
 }
 
-extern struct ip_fw *ip_fw_default_rule ;
-static void
-dn_rule_delete_fs(struct dn_flow_set *fs, void *r)
-{
-    int i ;
-    struct dn_flow_queue *q ;
-    struct mbuf *m ;
-
-    for (i = 0 ; i <= fs->rq_size ; i++) /* last one is ovflow */
-	for (q = fs->rq[i] ; q ; q = q->next )
-	    for (m = q->head ; m ; m = m->m_nextpkt ) {
-		struct dn_pkt_tag *pkt = dn_tag_get(m) ;
-		if (pkt->rule == r)
-		    pkt->rule = ip_fw_default_rule ;
-	    }
-}
-
-/*
- * When a firewall rule is deleted, scan all queues and remove the pointer
- * to the rule from matching packets, making them point to the default rule.
- * The pointer is used to reinject packets in case one_pass = 0.
- */
-void
-dn_rule_delete(void *r)
-{
-    struct dn_pipe *pipe;
-    struct dn_flow_set *fs;
-    struct dn_pkt_tag *pkt;
-    struct mbuf *m;
-    int i;
-
-    DUMMYNET_LOCK();
-    /*
-     * If the rule references a queue (dn_flow_set), then scan
-     * the flow set, otherwise scan pipes. Should do either, but doing
-     * both does not harm.
-     */
-    for (i = 0; i < HASHSIZE; i++)
-	SLIST_FOREACH(fs, &flowsethash[i], next)
-		dn_rule_delete_fs(fs, r);
-
-    for (i = 0; i < HASHSIZE; i++)
-	SLIST_FOREACH(pipe, &pipehash[i], next) {
-		fs = &(pipe->fs);
-		dn_rule_delete_fs(fs, r);
-		for (m = pipe->head ; m ; m = m->m_nextpkt ) {
-			pkt = dn_tag_get(m);
-			if (pkt->rule == r)
-				pkt->rule = ip_fw_default_rule;
-		}
-	}
-    DUMMYNET_UNLOCK();
-}
-
 /*
  * setup RED parameters
  */
@@ -2299,7 +2246,6 @@ ip_dn_init(void)
 
 	ip_dn_ctl_ptr = ip_dn_ctl;
 	ip_dn_io_ptr = dummynet_io;
-	ip_dn_ruledel_ptr = dn_rule_delete;
 
 	TASK_INIT(&dn_task, 0, dummynet_task, NULL);
 	dn_tq = taskqueue_create_fast("dummynet", M_NOWAIT,
@@ -2319,7 +2265,6 @@ ip_dn_destroy(void)
 {
 	ip_dn_ctl_ptr = NULL;
 	ip_dn_io_ptr = NULL;
-	ip_dn_ruledel_ptr = NULL;
 
 	DUMMYNET_LOCK();
 	callout_stop(&dn_timeout);

Modified: head/sys/netinet/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw2.c	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/netinet/ipfw/ip_fw2.c	Tue Jun  9 21:27:11 2009	(r193859)
@@ -132,6 +132,8 @@ static int default_to_accept;
 #endif
 static uma_zone_t ipfw_dyn_rule_zone;
 
+struct ip_fw *ip_fw_default_rule;
+
 /*
  * Data structure to cache our ucred related
  * information. This structure only gets used if
@@ -2520,9 +2522,21 @@ do {									\
 	if (args->rule) {
 		/*
 		 * Packet has already been tagged. Look for the next rule
-		 * to restart processing.
+		 * to restart processing. Make sure that args->rule still
+		 * exists and not changed.
 		 */
-		f = args->rule->next_rule;
+		if (chain->id != args->chain_id) {
+			for (f = chain->rules; f != NULL; f = f->next)
+				if (f == args->rule && f->id == args->rule_id)
+					break;
+
+			if (f != NULL)
+				f = f->next_rule;
+			else
+				f = ip_fw_default_rule;
+		} else 
+			f = args->rule->next_rule;
+
 		if (f == NULL)
 			f = lookup_next_rule(args->rule, 0);
 	} else {
@@ -3234,6 +3248,8 @@ check_body:
 			case O_PIPE:
 			case O_QUEUE:
 				args->rule = f; /* report matching rule */
+				args->rule_id = f->id;
+				args->chain_id = chain->id;
 				if (cmd->arg1 == IP_FW_TABLEARG)
 					args->cookie = tablearg;
 				else
@@ -3342,6 +3358,8 @@ check_body:
 			case O_NETGRAPH:
 			case O_NGTEE:
 				args->rule = f;	/* report matching rule */
+				args->rule_id = f->id;
+				args->chain_id = chain->id;
 				if (cmd->arg1 == IP_FW_TABLEARG)
 					args->cookie = tablearg;
 				else
@@ -3364,6 +3382,8 @@ check_body:
 
  				if (IPFW_NAT_LOADED) {
 					args->rule = f; /* Report matching rule. */
+					args->rule_id = f->id;
+					args->chain_id = chain->id;
 					t = ((ipfw_insn_nat *)cmd)->nat;
 					if (t == NULL) {
 						nat_id = (cmd->arg1 == IP_FW_TABLEARG) ?
@@ -3422,6 +3442,8 @@ check_body:
 							ip->ip_sum = in_cksum(m, hlen);
 						retval = IP_FW_REASS;
 						args->rule = f;
+						args->rule_id = f->id;
+						args->chain_id = chain->id;
 						goto done;
 					} else {
 						retval = IP_FW_DENY;
@@ -3480,6 +3502,8 @@ flush_rule_ptrs(struct ip_fw_chain *chai
 
 	IPFW_WLOCK_ASSERT(chain);
 
+	chain->id++;
+
 	for (rule = chain->rules; rule; rule = rule->next)
 		rule->next_rule = NULL;
 }
@@ -3516,6 +3540,7 @@ add_rule(struct ip_fw_chain *chain, stru
 
 	if (chain->rules == NULL) {	/* default rule */
 		chain->rules = rule;
+		rule->id = ++chain->id;
 		goto done;
         }
 
@@ -3557,6 +3582,8 @@ add_rule(struct ip_fw_chain *chain, stru
 		}
 	}
 	flush_rule_ptrs(chain);
+	/* chain->id incremented inside flush_rule_ptrs() */
+	rule->id = chain->id;
 done:
 	V_static_count++;
 	V_static_len += l;
@@ -3602,12 +3629,6 @@ remove_rule(struct ip_fw_chain *chain, s
 }
 
 /*
- * Hook for cleaning up dummynet when an ipfw rule is deleted.
- * Set/cleared when dummynet module is loaded/unloaded.
- */
-void   (*ip_dn_ruledel_ptr)(void *) = NULL;
-
-/**
  * Reclaim storage associated with a list of rules.  This is
  * typically the list created using remove_rule.
  */
@@ -3618,8 +3639,6 @@ reap_rules(struct ip_fw *head)
 
 	while ((rule = head) != NULL) {
 		head = head->next;
-		if (ip_dn_ruledel_ptr)
-			ip_dn_ruledel_ptr(rule);
 		free(rule, M_IPFW);
 	}
 }
@@ -4521,15 +4540,6 @@ ipfw_ctl(struct sockopt *sopt)
 #undef RULE_MAXSIZE
 }
 
-/**
- * dummynet needs a reference to the default rule, because rules can be
- * deleted while packets hold a reference to them. When this happens,
- * dummynet changes the reference to the default rule (it could well be a
- * NULL pointer, but this way we do not need to check for the special
- * case, plus here he have info on the default behaviour).
- */
-struct ip_fw *ip_fw_default_rule;
-
 /*
  * This procedure is only used to handle keepalives. It is invoked
  * every dyn_keepalive_period

Modified: head/sys/netinet/ipfw/ip_fw_pfil.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_pfil.c	Tue Jun  9 21:17:57 2009	(r193858)
+++ head/sys/netinet/ipfw/ip_fw_pfil.c	Tue Jun  9 21:27:11 2009	(r193859)
@@ -113,6 +113,8 @@ ipfw_check_in(void *arg, struct mbuf **m
 		KASSERT(ng_tag->dir == NG_IPFW_IN,
 		    ("ng_ipfw tag with wrong direction"));
 		args.rule = ng_tag->rule;
+		args.rule_id = ng_tag->rule_id;
+		args.chain_id = ng_tag->chain_id;
 		m_tag_delete(*m0, (struct m_tag *)ng_tag);
 	}
 
@@ -123,6 +125,8 @@ again:
 
 		dt = (struct dn_pkt_tag *)(dn_tag+1);
 		args.rule = dt->rule;
+		args.rule_id = dt->rule_id;
+		args.chain_id = dt->chain_id;
 
 		m_tag_delete(*m0, dn_tag);
 	}
@@ -243,6 +247,8 @@ ipfw_check_out(void *arg, struct mbuf **
 		KASSERT(ng_tag->dir == NG_IPFW_OUT,
 		    ("ng_ipfw tag with wrong direction"));
 		args.rule = ng_tag->rule;
+		args.rule_id = ng_tag->rule_id;
+		args.chain_id = ng_tag->chain_id;
 		m_tag_delete(*m0, (struct m_tag *)ng_tag);
 	}
 
@@ -253,6 +259,8 @@ again:
 
 		dt = (struct dn_pkt_tag *)(dn_tag+1);
 		args.rule = dt->rule;
+		args.rule_id = dt->rule_id;
+		args.chain_id = dt->chain_id;
 
 		m_tag_delete(*m0, dn_tag);
 	}

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:29:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1AC0E1065673;
	Tue,  9 Jun 2009 21:29:17 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D47DA8FC14;
	Tue,  9 Jun 2009 21:29:16 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59LTGGZ084415;
	Tue, 9 Jun 2009 21:29:16 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59LTGYo084414;
	Tue, 9 Jun 2009 21:29:16 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906092129.n59LTGYo084414@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 9 Jun 2009 21:29:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193860 - head/sys/libkern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:29:17 -0000

Author: kmacy
Date: Tue Jun  9 21:29:16 2009
New Revision: 193860
URL: http://svn.freebsd.org/changeset/base/193860

Log:
  add explanatory header license

Modified:
  head/sys/libkern/jenkins.h

Modified: head/sys/libkern/jenkins.h
==============================================================================
--- head/sys/libkern/jenkins.h	Tue Jun  9 21:27:11 2009	(r193859)
+++ head/sys/libkern/jenkins.h	Tue Jun  9 21:29:16 2009	(r193860)
@@ -5,6 +5,42 @@
  * $FreeBSD$
  */
 
+/*
+-------------------------------------------------------------------------------
+  lookup3.c, by Bob Jenkins, May 2006, Public Domain.
+
+  These are functions for producing 32-bit hashes for hash table lookup.
+  hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
+  are externally useful functions.  Routines to test the hash are included
+  if SELF_TEST is defined.  You can use this free for any purpose.  It's in
+  the public domain.  It has no warranty.
+
+  You probably want to use hashlittle().  hashlittle() and hashbig()
+  hash byte arrays.  hashlittle() is is faster than hashbig() on
+  little-endian machines.  Intel and AMD are little-endian machines.
+  On second thought, you probably want hashlittle2(), which is identical to
+  hashlittle() except it returns two 32-bit hashes for the price of one.
+  You could implement hashbig2() if you wanted but I haven't bothered here.
+
+  If you want to find a hash of, say, exactly 7 integers, do
+    a = i1;  b = i2;  c = i3;
+    mix(a,b,c);
+    a += i4; b += i5; c += i6;
+    mix(a,b,c);
+    a += i7;
+    final(a,b,c);
+  then use c as the hash value.  If you have a variable length array of
+  4-byte integers to hash, use hashword().  If you have a byte array (like
+  a character string), use hashlittle().  If you have several byte arrays, or
+  a mix of things, see the comments above hashlittle().
+  
+  Why is this so big?  I read 12 bytes at a time into 3 4-byte integers,
+  then mix those integers.  This is fast (you can do a lot more thorough
+  mixing with 12*3 instructions on 3 integers than you can with 3 instructions
+  on 1 byte), but shoehorning those bytes into integers efficiently is messy.
+-------------------------------------------------------------------------------
+*/
+
 #define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:29:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93CFB1065745;
	Tue,  9 Jun 2009 21:29:59 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 668668FC16;
	Tue,  9 Jun 2009 21:29:59 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 1A6B946B37;
	Tue,  9 Jun 2009 17:29:59 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 220228A049;
	Tue,  9 Jun 2009 17:29:58 -0400 (EDT)
From: John Baldwin 
To: Kip Macy 
Date: Tue, 9 Jun 2009 17:29:28 -0400
User-Agent: KMail/1.9.7
References: <200906092027.n59KRUvF082868@svn.freebsd.org>
In-Reply-To: <200906092027.n59KRUvF082868@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200906091729.28953.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Tue, 09 Jun 2009 17:29:58 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193856 - in head/sys: conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:30:00 -0000

On Tuesday 09 June 2009 4:27:30 pm Kip Macy wrote:
> Author: kmacy
> Date: Tue Jun  9 20:27:30 2009
> New Revision: 193856
> URL: http://svn.freebsd.org/changeset/base/193856
> 
> Log:
>   make flowtable opt-out

Hmm, I think it would probably be better to leave it as opt-in.  If we want to 
enable it by default, then we would add 'options FLOWTABLE' to GENERIC.  
However, that is probably a separate discussion.  We should not have NO_FOO 
options in general though.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:33:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85BF51065686;
	Tue,  9 Jun 2009 21:33:56 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250])
	by mx1.freebsd.org (Postfix) with ESMTP id 02E5F8FC2D;
	Tue,  9 Jun 2009 21:33:55 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: by an-out-0708.google.com with SMTP id c3so142425ana.13
	for ; Tue, 09 Jun 2009 14:33:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=LDYkH0FGWj30sDdF0ibM+g1+Y2qPU/MlC77ekvOCDQs=;
	b=tJWzWelGZIde2O2IO8NKde1ykDpoDHHsNM4NNLe4VI/qWSFIbSOGlfShy9GhtDKNH+
	BKJgMeJxEUyyeXq/KyU+Q9FsXvpUV5UD9YZrxlEOfaoZdICd9grZOWR0emewLXmOfk+E
	cpXyb0zPr5WHT5g1uwFhmKoPOC2P04yHf5rK0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=I1ocLDj3IkalkazJRpj3T9r+mV/8530OKFThfD96us/UUrolsRab//LvGdh709eBp2
	MjMK2VQPREF8qFZ/vPmN052A3ndJz+hMHOIDyNMvaKu8dx2asAX6SiDCFP2WmLCbh60c
	wy3jggSL8EmBqBYq2EZoMYR+ftpsamtf3YOzw=
MIME-Version: 1.0
Sender: mat.macy@gmail.com
Received: by 10.100.38.5 with SMTP id l5mr600573anl.183.1244583235191; Tue, 09 
	Jun 2009 14:33:55 -0700 (PDT)
In-Reply-To: <200906091729.28953.jhb@freebsd.org>
References: <200906092027.n59KRUvF082868@svn.freebsd.org>
	<200906091729.28953.jhb@freebsd.org>
Date: Tue, 9 Jun 2009 14:33:55 -0700
X-Google-Sender-Auth: 2f71192b69825edb
Message-ID: <3c1674c90906091433i2f789345j70731a98baf13cbc@mail.gmail.com>
From: Kip Macy 
To: John Baldwin 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193856 - in head/sys: conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:33:57 -0000

On Tue, Jun 9, 2009 at 2:29 PM, John Baldwin wrote:
> On Tuesday 09 June 2009 4:27:30 pm Kip Macy wrote:
>> Author: kmacy
>> Date: Tue Jun =A09 20:27:30 2009
>> New Revision: 193856
>> URL: http://svn.freebsd.org/changeset/base/193856
>>
>> Log:
>> =A0 make flowtable opt-out
>
> Hmm, I think it would probably be better to leave it as opt-in. =A0If we =
want to
> enable it by default, then we would add 'options FLOWTABLE' to GENERIC.
> However, that is probably a separate discussion. =A0We should not have NO=
_FOO
> options in general though.

Given that it benefits the majority of users I strongly disagree. You
are of course welcome to change it.

-Kip

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:35:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB315106566B;
	Tue,  9 Jun 2009 21:35:32 +0000 (UTC)
	(envelope-from oleg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BA6588FC14;
	Tue,  9 Jun 2009 21:35:32 +0000 (UTC)
	(envelope-from oleg@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59LZW2f084615;
	Tue, 9 Jun 2009 21:35:32 GMT (envelope-from oleg@svn.freebsd.org)
Received: (from oleg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59LZWE0084614;
	Tue, 9 Jun 2009 21:35:32 GMT (envelope-from oleg@svn.freebsd.org)
Message-Id: <200906092135.n59LZWE0084614@svn.freebsd.org>
From: Oleg Bulyzhin 
Date: Tue, 9 Jun 2009 21:35: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: r193861 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:35:33 -0000

Author: oleg
Date: Tue Jun  9 21:35:32 2009
New Revision: 193861
URL: http://svn.freebsd.org/changeset/base/193861

Log:
  Sync struct ng_ipfw_tag description with sources.
  
  Submitted by:	Mikolaj Golub

Modified:
  head/share/man/man4/ng_ipfw.4

Modified: head/share/man/man4/ng_ipfw.4
==============================================================================
--- head/share/man/man4/ng_ipfw.4	Tue Jun  9 21:29:16 2009	(r193860)
+++ head/share/man/man4/ng_ipfw.4	Tue Jun  9 21:35:32 2009	(r193861)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 5, 2005
+.Dd June 10, 2009
 .Dt NG_IPFW 4
 .Os
 .Sh NAME
@@ -84,11 +84,12 @@ to
 struct ng_ipfw_tag {
 	struct m_tag	mt;		/* tag header */
 	struct ip_fw	*rule;		/* matching rule */
+	uint32_t	rule_id;	/* matching rule id */
+	uint32_t	chain_id;	/* ruleset id */
         struct ifnet	*ifp;		/* interface, for ip_output */
 	int		dir;		/* packet direction */
 #define	NG_IPFW_OUT	0
 #define	NG_IPFW_IN	1
-	int		flags;		/* flags, for ip_output() */
 };
 .Ed
 .Pp

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:38:24 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A3B56106564A;
	Tue,  9 Jun 2009 21:38:24 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 54EB48FC18;
	Tue,  9 Jun 2009 21:38:24 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n59LYeL8051158;
	Tue, 9 Jun 2009 15:34:40 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 09 Jun 2009 15:34:59 -0600 (MDT)
Message-Id: <20090609.153459.1820400761.imp@bsdimp.com>
To: kmacy@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <3c1674c90906091012u26b0e823q57a7ea1f42eef22d@mail.gmail.com>
References: <200904190016.n3J0G4rA090911@svn.freebsd.org>
	<20090609143729.R22887@maildrop.int.zabbadoz.net>
	<3c1674c90906091012u26b0e823q57a7ea1f42eef22d@mail.gmail.com>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, bz@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r191255 - in head/sys: amd64/conf conf i386/conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:38:25 -0000

In message: <3c1674c90906091012u26b0e823q57a7ea1f42eef22d@mail.gmail.co=
m>
            Kip Macy  writes:
: > I think FLOWTABLE does nto belong into DEFAULTS. =A0Really DEFAULTS=
 was
: > meant for "You cannot boot without this" and if people start to wea=
ken
: > it, DEFAULTS will soon be the new GENERIC. =A0That said I am not su=
re it
: > belongs to GENERIC either.
: =

: I can either push it in to GENERIC or I can change it to NOFLOWTABLE.=

: If you want to remove it from GENERIC then we're going to have to hav=
e
: a lengthy discussion about what most FreeBSD users actually use and
: gut GENERIC as it stands now. The fact is, most FreeBSD users have
: sufficiently few peers that flowtable is a win over using the routing=

: table on every lookup.

NO.

NOFLOWTABLE is bogus.  Negative options are lame.  We need to have
fewer of them rather than more.

Also, we do *NOT* want it to be default on *ALL* platforms, which is
what NOFLOWTABLE does.

It should be in GENERIC, on a per-platform basis, if it is really
ready for prime time.  Embedded targets don't want this kind of stuff
at all.  People do mix/match generic, and having all the options there
is the right way to do this.  It is what people expect and having some
odd-ball options like this makes it harder.  In fact, it makes it
harder to transition between releases because some options are
'magically on' and others need to be updated.  It is a big pain.  The
project has decided in the past to have the options be normal,
opt-in.

Please, make this a normal option, and we can have the discussion
about which config files it belongs in.

Warner

P.S.  I see that you've made it a negative option later in the day
from this message.  I'm formally requesting that you back that out and
make it a normal option.

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:41:43 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5FA5A106566B;
	Tue,  9 Jun 2009 21:41:43 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id EECFF8FC14;
	Tue,  9 Jun 2009 21:41:42 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n59Lbla9051211;
	Tue, 9 Jun 2009 15:37:47 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 09 Jun 2009 15:38:05 -0600 (MDT)
Message-Id: <20090609.153805.-862244084.imp@bsdimp.com>
To: kmacy@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <200906092027.n59KRUvF082868@svn.freebsd.org>
References: <200906092027.n59KRUvF082868@svn.freebsd.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r193856 - in head/sys: conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:41:43 -0000

In message: <200906092027.n59KRUvF082868@svn.freebsd.org>
            Kip Macy  writes:
: Author: kmacy
: Date: Tue Jun  9 20:27:30 2009
: New Revision: 193856
: URL: http://svn.freebsd.org/changeset/base/193856
: 
: Log:
:   make flowtable opt-out

Per my earlier email, please back this out.  It is lame for the
reasons I explained there, and has no general consensus for this
change.

Warner


: Modified:
:   head/sys/conf/files
:   head/sys/conf/options
:   head/sys/net/flowtable.c
:   head/sys/net/flowtable.h
: 
: Modified: head/sys/conf/files
: ==============================================================================
: --- head/sys/conf/files	Tue Jun  9 20:26:52 2009	(r193855)
: +++ head/sys/conf/files	Tue Jun  9 20:27:30 2009	(r193856)
: @@ -2180,7 +2180,7 @@ net/bpf_jitter.c		optional bpf_jitter
:  net/bpf_filter.c		optional bpf | netgraph_bpf
:  net/bpf_zerocopy.c		optional bpf
:  net/bridgestp.c			optional bridge | if_bridge
: -net/flowtable.c			optional flowtable inet
: +net/flowtable.c			optional inet
:  net/ieee8023ad_lacp.c		optional lagg
:  net/if.c			standard
:  net/if_arcsubr.c		optional arcnet
: 
: Modified: head/sys/conf/options
: ==============================================================================
: --- head/sys/conf/options	Tue Jun  9 20:26:52 2009	(r193855)
: +++ head/sys/conf/options	Tue Jun  9 20:27:30 2009	(r193856)
: @@ -421,7 +421,7 @@ TCP_OFFLOAD_DISABLE	opt_inet.h #Disable 
:  TCP_SIGNATURE		opt_inet.h
:  VLAN_ARRAY		opt_vlan.h
:  XBONEHACK
: -FLOWTABLE		opt_route.h
: +NO_FLOWTABLE		opt_route.h
:  
:  #
:  # SCTP
: 
: Modified: head/sys/net/flowtable.c
: ==============================================================================
: --- head/sys/net/flowtable.c	Tue Jun  9 20:26:52 2009	(r193855)
: +++ head/sys/net/flowtable.c	Tue Jun  9 20:27:30 2009	(r193856)
: @@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
:  #include 
:  __FBSDID("$FreeBSD$");
:  
: +#ifndef NO_FLOWTABLE
:  #include   
:  #include 
:  #include 
: @@ -929,4 +930,4 @@ static struct kproc_desc flow_kp = {
:  	&flowcleanerproc
:  };
:  SYSINIT(flowcleaner, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, kproc_start, &flow_kp);
: -
: +#endif /* NO_FLOWTABLE */
: 
: Modified: head/sys/net/flowtable.h
: ==============================================================================
: --- head/sys/net/flowtable.h	Tue Jun  9 20:26:52 2009	(r193855)
: +++ head/sys/net/flowtable.h	Tue Jun  9 20:27:30 2009	(r193856)
: @@ -41,7 +41,7 @@ struct flowtable;
:  extern struct flowtable *ip_ft;
:  extern struct flowtable *ip_forward_ft;
:  
: -#ifdef FLOWTABLE
: +#ifndef NO_FLOWTABLE
:  struct flowtable *flowtable_alloc(int nentry, int flags);
:  
:  /*
: 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:43:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E811106568D;
	Tue,  9 Jun 2009 21:43:05 +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 3D4238FC26;
	Tue,  9 Jun 2009 21:43:05 +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 n59Lh53K084785;
	Tue, 9 Jun 2009 21:43:05 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59Lh5kk084784;
	Tue, 9 Jun 2009 21:43:05 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906092143.n59Lh5kk084784@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Tue, 9 Jun 2009 21:43:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193862 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:43:06 -0000

Author: bz
Date: Tue Jun  9 21:43:04 2009
New Revision: 193862
URL: http://svn.freebsd.org/changeset/base/193862

Log:
  Add opt_inet.h back lost with r190872.
  This will bring back improved IPv4 SIOCSIFADDR ioctl handling
  not re-initializing the interface if avoidable.

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Tue Jun  9 21:35:32 2009	(r193861)
+++ head/sys/dev/e1000/if_igb.c	Tue Jun  9 21:43:04 2009	(r193862)
@@ -34,6 +34,7 @@
 
 #ifdef HAVE_KERNEL_OPTION_HEADERS
 #include "opt_device_polling.h"
+#include "opt_inet.h"
 #endif
 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:55:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5DDE61065674;
	Tue,  9 Jun 2009 21:55:29 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 322E68FC13;
	Tue,  9 Jun 2009 21:55:29 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59LtTiL085084;
	Tue, 9 Jun 2009 21:55:29 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59LtS7f085080;
	Tue, 9 Jun 2009 21:55:28 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906092155.n59LtS7f085080@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 9 Jun 2009 21:55:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193863 - in head/sys: conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:55:29 -0000

Author: kmacy
Date: Tue Jun  9 21:55:28 2009
New Revision: 193863
URL: http://svn.freebsd.org/changeset/base/193863

Log:
  revert to opt-in flowtable

Modified:
  head/sys/conf/files
  head/sys/conf/options
  head/sys/net/flowtable.c
  head/sys/net/flowtable.h

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Jun  9 21:43:04 2009	(r193862)
+++ head/sys/conf/files	Tue Jun  9 21:55:28 2009	(r193863)
@@ -2180,7 +2180,7 @@ net/bpf_jitter.c		optional bpf_jitter
 net/bpf_filter.c		optional bpf | netgraph_bpf
 net/bpf_zerocopy.c		optional bpf
 net/bridgestp.c			optional bridge | if_bridge
-net/flowtable.c			optional inet
+net/flowtable.c			optional flowtable inet
 net/ieee8023ad_lacp.c		optional lagg
 net/if.c			standard
 net/if_arcsubr.c		optional arcnet

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Tue Jun  9 21:43:04 2009	(r193862)
+++ head/sys/conf/options	Tue Jun  9 21:55:28 2009	(r193863)
@@ -421,7 +421,7 @@ TCP_OFFLOAD_DISABLE	opt_inet.h #Disable 
 TCP_SIGNATURE		opt_inet.h
 VLAN_ARRAY		opt_vlan.h
 XBONEHACK
-NO_FLOWTABLE		opt_route.h
+FLOWTABLE		opt_route.h
 
 #
 # SCTP

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Tue Jun  9 21:43:04 2009	(r193862)
+++ head/sys/net/flowtable.c	Tue Jun  9 21:55:28 2009	(r193863)
@@ -33,7 +33,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #include 
 __FBSDID("$FreeBSD$");
 
-#ifndef NO_FLOWTABLE
 #include   
 #include 
 #include 
@@ -188,7 +187,7 @@ static uma_zone_t ipv6_zone;
  * - support explicit connection state (currently only ad-hoc for DSR)
  */
 SYSCTL_NODE(_net_inet, OID_AUTO, flowtable, CTLFLAG_RD, NULL, "flowtable");
-int	flowtable_enable = 0;
+int	flowtable_enable = 1;
 SYSCTL_INT(_net_inet_flowtable, OID_AUTO, enable, CTLFLAG_RW,
     &flowtable_enable, 0, "enable flowtable caching.");
 static int flowtable_hits = 0;
@@ -930,4 +929,4 @@ static struct kproc_desc flow_kp = {
 	&flowcleanerproc
 };
 SYSINIT(flowcleaner, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, kproc_start, &flow_kp);
-#endif /* NO_FLOWTABLE */
+

Modified: head/sys/net/flowtable.h
==============================================================================
--- head/sys/net/flowtable.h	Tue Jun  9 21:43:04 2009	(r193862)
+++ head/sys/net/flowtable.h	Tue Jun  9 21:55:28 2009	(r193863)
@@ -41,7 +41,7 @@ struct flowtable;
 extern struct flowtable *ip_ft;
 extern struct flowtable *ip_forward_ft;
 
-#ifndef NO_FLOWTABLE
+#ifdef FLOWTABLE
 struct flowtable *flowtable_alloc(int nentry, int flags);
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 21:58:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67979106564A;
	Tue,  9 Jun 2009 21:58:14 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5679B8FC0A;
	Tue,  9 Jun 2009 21:58:14 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59LwETl085171;
	Tue, 9 Jun 2009 21:58:14 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59LwEOm085169;
	Tue, 9 Jun 2009 21:58:14 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906092158.n59LwEOm085169@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 9 Jun 2009 21:58: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: r193864 - in head/sys: amd64/conf i386/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 21:58:14 -0000

Author: kmacy
Date: Tue Jun  9 21:58:14 2009
New Revision: 193864
URL: http://svn.freebsd.org/changeset/base/193864

Log:
  opt in to flowtable on i386/amd64

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Tue Jun  9 21:55:28 2009	(r193863)
+++ head/sys/amd64/conf/GENERIC	Tue Jun  9 21:58:14 2009	(r193864)
@@ -71,6 +71,7 @@ options 	STOP_NMI		# Stop CPUS using NMI
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework
+options		FLOWTABLE		# per-cpu routing cache
 #options 	KDTRACE_FRAME		# Ensure frames are compiled in
 #options 	KDTRACE_HOOKS		# Kernel DTrace hooks
 

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Tue Jun  9 21:55:28 2009	(r193863)
+++ head/sys/i386/conf/GENERIC	Tue Jun  9 21:58:14 2009	(r193864)
@@ -72,6 +72,7 @@ options 	STOP_NMI		# Stop CPUS using NMI
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework
+options		FLOWTABLE		# per-cpu routing cache
 #options 	KDTRACE_HOOKS		# Kernel DTrace hooks
 
 # Debugging for use in -current

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 22:09:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA9031065690;
	Tue,  9 Jun 2009 22:09:29 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C971A8FC1A;
	Tue,  9 Jun 2009 22:09:29 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59M9TmK085429;
	Tue, 9 Jun 2009 22:09:29 GMT (envelope-from jamie@svn.freebsd.org)
Received: (from jamie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59M9T5U085428;
	Tue, 9 Jun 2009 22:09:29 GMT (envelope-from jamie@svn.freebsd.org)
Message-Id: <200906092209.n59M9T5U085428@svn.freebsd.org>
From: Jamie Gritton 
Date: Tue, 9 Jun 2009 22:09:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193865 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 22:09:30 -0000

Author: jamie
Date: Tue Jun  9 22:09:29 2009
New Revision: 193865
URL: http://svn.freebsd.org/changeset/base/193865

Log:
  Fix some overflow errors: a signed allocation and an insufficiant
  array size.
  
  Reported by:	pho
  Tested by:	pho
  Approved by:	bz (mentor)

Modified:
  head/sys/kern/kern_jail.c

Modified: head/sys/kern/kern_jail.c
==============================================================================
--- head/sys/kern/kern_jail.c	Tue Jun  9 21:58:14 2009	(r193864)
+++ head/sys/kern/kern_jail.c	Tue Jun  9 22:09:29 2009	(r193865)
@@ -165,7 +165,7 @@ static char *pr_allow_nonames[] = {
 static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW;
 static int jail_default_enforce_statfs = 2;
 #if defined(INET) || defined(INET6)
-static int jail_max_af_ips = 255;
+static unsigned jail_max_af_ips = 255;
 #endif
 
 #ifdef INET
@@ -273,11 +273,19 @@ jail(struct thread *td, struct jail_args
 int
 kern_jail(struct thread *td, struct jail *j)
 {
-	struct iovec optiov[24];
+	struct iovec optiov[2 * (4
+			    + sizeof(pr_allow_names) / sizeof(pr_allow_names[0])
+#ifdef INET
+			    + 1
+#endif
+#ifdef INET6
+			    + 1
+#endif
+			    )];
 	struct uio opt;
 	char *u_path, *u_hostname, *u_name;
 #ifdef INET
-	int ip4s;
+	uint32_t ip4s;
 	struct in_addr *u_ip4;
 #endif
 #ifdef INET6
@@ -3671,7 +3679,7 @@ SYSCTL_PROC(_security_jail, OID_AUTO, ja
     sysctl_jail_jailed, "I", "Process in jail?");
 
 #if defined(INET) || defined(INET6)
-SYSCTL_INT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW,
+SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW,
     &jail_max_af_ips, 0,
     "Number of IP addresses a jail may have at most per address family");
 #endif

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 22:22:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B20DE106564A;
	Tue,  9 Jun 2009 22:22:04 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A07B48FC14;
	Tue,  9 Jun 2009 22:22:04 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59MM4Vf085807;
	Tue, 9 Jun 2009 22:22:04 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59MM4F8085804;
	Tue, 9 Jun 2009 22:22:04 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200906092222.n59MM4F8085804@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 9 Jun 2009 22:22: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: r193867 - in head/share: monetdef numericdef
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 22:22:05 -0000

Author: edwin
Date: Tue Jun  9 22:22:04 2009
New Revision: 193867
URL: http://svn.freebsd.org/changeset/base/193867

Log:
  Fix LC_NUMERIC and LC_MONETARY for de_CH locale
  
  With the de_CH (swiss german) locale, numbers should look like this:
  
      numbers: 1'234.45
      monetary values: Fr. 1'234.45
  
  Previously, the thousands separator was missing for numbers, and
  "." for monetary values, and "," was incorrectly used as decimal
  point.
  
  PR:		conf/75502
  Submitted by:	Benjamin Lutz 
  MFC after:	1 week

Added:
  head/share/numericdef/de_CH.ISO8859-1.src   (contents, props changed)
Modified:
  head/share/monetdef/de_CH.ISO8859-1.src
  head/share/numericdef/Makefile

Modified: head/share/monetdef/de_CH.ISO8859-1.src
==============================================================================
--- head/share/monetdef/de_CH.ISO8859-1.src	Tue Jun  9 22:12:13 2009	(r193866)
+++ head/share/monetdef/de_CH.ISO8859-1.src	Tue Jun  9 22:22:04 2009	(r193867)
@@ -8,9 +8,9 @@ CHF 
 # currency_symbol
 Fr.
 # mon_decimal_point
-,
-# mon_thousands_sep
 .
+# mon_thousands_sep
+'
 # mon_grouping, separated by ;
 3;3
 # positive_sign

Modified: head/share/numericdef/Makefile
==============================================================================
--- head/share/numericdef/Makefile	Tue Jun  9 22:12:13 2009	(r193866)
+++ head/share/numericdef/Makefile	Tue Jun  9 22:22:04 2009	(r193867)
@@ -7,6 +7,7 @@ LOCALES=	af_ZA.ISO8859-1 \
 		ca_ES.ISO8859-1 \
 		cs_CZ.ISO8859-2 \
 		da_DK.ISO8859-1 \
+		de_CH.ISO8859-1 \
 		de_DE.ISO8859-1 \
 		el_GR.ISO8859-7 \
 		en_US.ISO8859-1 \
@@ -67,7 +68,7 @@ ENCODINGS=	ARMSCII-8 Big5 Big5HKSCS \
 		KOI8-R KOI8-U PT154 SJIS US-ASCII UTF-8
 
 BE_LINKS=	fr_BE:nl_BE
-DE_LINKS=	de_DE:de_AT de_DE:de_CH
+DE_LINKS=	de_DE:de_AT
 FR_LINKS=	fr_FR:fr_CA fr_FR:fr_CH
 GB_LINKS=	en_GB:en_AU en_GB:en_NZ
 IT_LINKS=	it_IT:it_CH
@@ -90,15 +91,15 @@ eucJP_SJIS=	ja_JP
 eucJP_UTF-8=	ja_JP
 eucKR_CP949=	ko_KR
 eucKR_UTF-8=	ko_KR
-ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_DE en_US es_ES eu_ES fi_FI \
-		fr_BE fr_FR is_IS it_CH it_IT nl_NL no_NO pt_PT sv_SE \
-		${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
+ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES \
+		fi_FI fr_BE fr_FR is_IS it_CH it_IT nl_NL no_NO pt_PT \
+		sv_SE ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
 		${IT_LINKS} ${NO_LINKS} ${US_LINKS}
 ISO8859-1_ISO8859-1= ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
 		${IT_LINKS} ${NO_LINKS} ${US_LINKS}
 ISO8859-1_US-ASCII= en_US ${GB_LINKS} ${US_LINKS}
-ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_DE en_US es_ES eu_ES fi_FI fr_BE \
-		fr_FR is_IS it_IT nl_NL no_NO pt_BR pt_PT sv_SE
+ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES fi_FI \
+		fr_BE fr_FR is_IS it_IT nl_NL no_NO pt_BR pt_PT sv_SE
 ISO8859-2_UTF-8= cs_CZ hr_HR hu_HU pl_PL ro_RO sk_SK sl_SI
 ISO8859-5_UTF-8= sr_YU uk_UA
 ISO8859-5_CP1251= uk_UA

Added: head/share/numericdef/de_CH.ISO8859-1.src
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/numericdef/de_CH.ISO8859-1.src	Tue Jun  9 22:22:04 2009	(r193867)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+#
+# WARNING: spaces may be essential at the end of lines
+# WARNING: empty lines are essential too
+#
+# decimal_point
+.
+# thousands_sep
+'
+# grouping, separated by ;
+3;3
+# EOF

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 22:33:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2A9F106566C;
	Tue,  9 Jun 2009 22:33:34 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E1A908FC17;
	Tue,  9 Jun 2009 22:33:34 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59MXYxr086108;
	Tue, 9 Jun 2009 22:33:34 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59MXY2d086106;
	Tue, 9 Jun 2009 22:33:34 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200906092233.n59MXY2d086106@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 9 Jun 2009 22:33:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193869 - head/share/timedef
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 22:33:35 -0000

Author: edwin
Date: Tue Jun  9 22:33:34 2009
New Revision: 193869
URL: http://svn.freebsd.org/changeset/base/193869

Log:
  ja_JP: AM/PM date format should be localized.
  
  	ja_JP.eucJP and ja_JP.SJIS fixes.
  
  PR:		conf/63527
  Submitted by:	Yukihiro Nakai 
  MFC after:	1 week

Modified:
  head/share/timedef/ja_JP.SJIS.src
  head/share/timedef/ja_JP.eucJP.src

Modified: head/share/timedef/ja_JP.SJIS.src
==============================================================================
--- head/share/timedef/ja_JP.SJIS.src	Tue Jun  9 22:27:20 2009	(r193868)
+++ head/share/timedef/ja_JP.SJIS.src	Tue Jun  9 22:33:34 2009	(r193869)
@@ -69,13 +69,11 @@
 #
 # am
 #
-#Œß‘O
-AM
+Œß‘O
 #
 # pm
 #
-#Χ΋
-PM
+Χ΋
 #
 # date_fmt
 #

Modified: head/share/timedef/ja_JP.eucJP.src
==============================================================================
--- head/share/timedef/ja_JP.eucJP.src	Tue Jun  9 22:27:20 2009	(r193868)
+++ head/share/timedef/ja_JP.eucJP.src	Tue Jun  9 22:33:34 2009	(r193869)
@@ -68,13 +68,11 @@
 #
 # am
 #
-#¸áÁ°
-AM
+¸áÁ°
 #
 # pm
 #
-#¸á¸å
-PM
+¸á¸å
 #
 # date_fmt
 #

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 23:24:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 654D9106566C;
	Tue,  9 Jun 2009 23:24:05 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3980F8FC1A;
	Tue,  9 Jun 2009 23:24:05 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59NO4A1087165;
	Tue, 9 Jun 2009 23:24:04 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59NO4Lt087163;
	Tue, 9 Jun 2009 23:24:04 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906092324.n59NO4Lt087163@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 9 Jun 2009 23:24: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: r193871 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 23:24:05 -0000

Author: imp
Date: Tue Jun  9 23:24:04 2009
New Revision: 193871
URL: http://svn.freebsd.org/changeset/base/193871

Log:
  As discussed on arch@, restire
  devclass_{add,delete,find,quiesce}_driver.  They aren't needed or used
  and complicate locking newbus.

Modified:
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Tue Jun  9 23:04:43 2009	(r193870)
+++ head/sys/kern/subr_bus.c	Tue Jun  9 23:24:04 2009	(r193871)
@@ -999,7 +999,7 @@ devclass_driver_added(devclass_t dc, dri
  * @param dc		the devclass to edit
  * @param driver	the driver to register
  */
-int
+static int
 devclass_add_driver(devclass_t dc, driver_t *driver, int pass)
 {
 	driverlink_t dl;
@@ -1052,7 +1052,7 @@ devclass_add_driver(devclass_t dc, drive
  * @param dc		the devclass to edit
  * @param driver	the driver to unregister
  */
-int
+static int
 devclass_delete_driver(devclass_t busclass, driver_t *driver)
 {
 	devclass_t dc = devclass_find(driver->name);
@@ -1127,7 +1127,7 @@ devclass_delete_driver(devclass_t buscla
  * @param dc		the devclass to edit
  * @param driver	the driver to unregister
  */
-int
+static int
 devclass_quiesce_driver(devclass_t busclass, driver_t *driver)
 {
 	devclass_t dc = devclass_find(driver->name);
@@ -1208,7 +1208,7 @@ devclass_find_driver_internal(devclass_t
  * @param dc		the devclass to search
  * @param classname	the driver name to search for
  */
-kobj_class_t
+static kobj_class_t
 devclass_find_driver(devclass_t dc, const char *classname)
 {
 	driverlink_t dl;

Modified: head/sys/sys/bus.h
==============================================================================
--- head/sys/sys/bus.h	Tue Jun  9 23:04:43 2009	(r193870)
+++ head/sys/sys/bus.h	Tue Jun  9 23:24:04 2009	(r193871)
@@ -435,11 +435,8 @@ void	device_verbose(device_t dev);
 /*
  * Access functions for devclass.
  */
-int	devclass_add_driver(devclass_t dc, kobj_class_t driver, int pass);
-int	devclass_delete_driver(devclass_t dc, kobj_class_t driver);
 devclass_t	devclass_create(const char *classname);
 devclass_t	devclass_find(const char *classname);
-kobj_class_t	devclass_find_driver(devclass_t dc, const char *classname);
 const char	*devclass_get_name(devclass_t dc);
 device_t	devclass_get_device(devclass_t dc, int unit);
 void	*devclass_get_softc(devclass_t dc, int unit);
@@ -452,7 +449,6 @@ void	devclass_set_parent(devclass_t dc, 
 devclass_t	devclass_get_parent(devclass_t dc);
 struct sysctl_ctx_list *devclass_get_sysctl_ctx(devclass_t dc);
 struct sysctl_oid *devclass_get_sysctl_tree(devclass_t dc);
-int	devclass_quiesce_driver(devclass_t dc, kobj_class_t driver);
 
 /*
  * Access functions for device resources.

From owner-svn-src-head@FreeBSD.ORG  Tue Jun  9 23:38:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11681106564A;
	Tue,  9 Jun 2009 23:38:20 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F40558FC16;
	Tue,  9 Jun 2009 23:38:19 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n59NcJ5w087492;
	Tue, 9 Jun 2009 23:38:19 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n59NcJw3087491;
	Tue, 9 Jun 2009 23:38:19 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906092338.n59NcJw3087491@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 9 Jun 2009 23:38: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: r193873 - head/share/man/man9
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 09 Jun 2009 23:38:20 -0000

Author: imp
Date: Tue Jun  9 23:38:19 2009
New Revision: 193873
URL: http://svn.freebsd.org/changeset/base/193873

Log:
  These are no longer public, so remove the man page.

Deleted:
  head/share/man/man9/devclass_add_driver.9
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Tue Jun  9 23:30:18 2009	(r193872)
+++ head/share/man/man9/Makefile	Tue Jun  9 23:38:19 2009	(r193873)
@@ -57,7 +57,6 @@ MAN=	accept_filter.9 \
 	DECLARE_MODULE.9 \
 	DELAY.9 \
 	devclass.9 \
-	devclass_add_driver.9 \
 	devclass_find.9 \
 	devclass_get_device.9 \
 	devclass_get_devices.9 \
@@ -555,8 +554,6 @@ MLINKS+=crypto.9 crypto_dispatch.9 \
 	crypto.9 crypto_unregister_all.9
 MLINKS+=DB_COMMAND.9 DB_SHOW_COMMAND.9 \
 	DB_COMMAND.9 DB_SHOW_ALL_COMMAND.9
-MLINKS+=devclass_add_driver.9 devclass_delete_driver.9 \
-	devclass_add_driver.9 devclass_find_driver.9
 MLINKS+=dev_clone.9 drain_dev_clone_events.9
 MLINKS+=devfs_set_cdevpriv.9 devfs_get_cdevpriv.9 \
 	devfs_set_cdevpriv.9 devfs_clear_cdevpriv.9

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 01:02:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5C61106566B;
	Wed, 10 Jun 2009 01:02:00 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 758408FC14;
	Wed, 10 Jun 2009 01:02:00 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n5A0xedW053621;
	Tue, 9 Jun 2009 18:59:40 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 09 Jun 2009 18:59:59 -0600 (MDT)
Message-Id: <20090609.185959.437126584.imp@bsdimp.com>
To: kmacy@freebsd.org
From: "M. Warner Losh" 
In-Reply-To: <200906092155.n59LtS7f085080@svn.freebsd.org>
References: <200906092155.n59LtS7f085080@svn.freebsd.org>
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193863 - in head/sys: conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 01:02:01 -0000

In message: <200906092155.n59LtS7f085080@svn.freebsd.org>
            Kip Macy  writes:
: Author: kmacy
: Date: Tue Jun  9 21:55:28 2009
: New Revision: 193863
: URL: http://svn.freebsd.org/changeset/base/193863
: 
: Log:
:   revert to opt-in flowtable

Thanks Kip.

Warner

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 01:02:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3EAA1065670;
	Wed, 10 Jun 2009 01:02:38 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A28D78FC15;
	Wed, 10 Jun 2009 01:02:38 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5A12cM3089236;
	Wed, 10 Jun 2009 01:02:38 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A12cQW089235;
	Wed, 10 Jun 2009 01:02:38 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906100102.n5A12cQW089235@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 10 Jun 2009 01:02: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: r193874 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 01:02:39 -0000

Author: imp
Date: Wed Jun 10 01:02:38 2009
New Revision: 193874
URL: http://svn.freebsd.org/changeset/base/193874

Log:
  We can actually remove devclass_find_driver.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Tue Jun  9 23:38:19 2009	(r193873)
+++ head/sys/kern/subr_bus.c	Wed Jun 10 01:02:38 2009	(r193874)
@@ -1199,27 +1199,6 @@ devclass_find_driver_internal(devclass_t
 }
 
 /**
- * @brief Search a devclass for a driver
- *
- * This function searches the devclass's list of drivers and returns
- * the first driver whose name is @p classname or @c NULL if there is
- * no driver of that name.
- *
- * @param dc		the devclass to search
- * @param classname	the driver name to search for
- */
-static kobj_class_t
-devclass_find_driver(devclass_t dc, const char *classname)
-{
-	driverlink_t dl;
-
-	dl = devclass_find_driver_internal(dc, classname);
-	if (dl)
-		return (dl->driver);
-	return (NULL);
-}
-
-/**
  * @brief Return the name of the devclass
  */
 const char *

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 01:15:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90E5E1065670;
	Wed, 10 Jun 2009 01:15:30 +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 7EDD28FC16;
	Wed, 10 Jun 2009 01:15:30 +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 n5A1FUE5089498;
	Wed, 10 Jun 2009 01:15:30 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A1FUvM089497;
	Wed, 10 Jun 2009 01:15:30 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200906100115.n5A1FUvM089497@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jun 2009 01:15:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193875 - head/sys/dev/fxp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 01:15:31 -0000

Author: yongari
Date: Wed Jun 10 01:15:30 2009
New Revision: 193875
URL: http://svn.freebsd.org/changeset/base/193875

Log:
  Controller will dma SCB command status for a given command and
  driver should read updated status back after issuing a SCB command.
  To send a command to controller and read updated status back,
  driver should synchronize both memory read and write operations
  with device. Fix bus_dmamap_sync operation specifier used in
  fxp_dma_wait() by adding both memory read and memory write
  operations.

Modified:
  head/sys/dev/fxp/if_fxp.c

Modified: head/sys/dev/fxp/if_fxp.c
==============================================================================
--- head/sys/dev/fxp/if_fxp.c	Wed Jun 10 01:02:38 2009	(r193874)
+++ head/sys/dev/fxp/if_fxp.c	Wed Jun 10 01:15:30 2009	(r193875)
@@ -347,12 +347,14 @@ static void
 fxp_dma_wait(struct fxp_softc *sc, volatile uint16_t *status,
     bus_dma_tag_t dmat, bus_dmamap_t map)
 {
-	int i = 10000;
+	int i;
 
-	bus_dmamap_sync(dmat, map, BUS_DMASYNC_POSTREAD);
-	while (!(le16toh(*status) & FXP_CB_STATUS_C) && --i) {
+	for (i = 10000; i > 0; i--) {
 		DELAY(2);
-		bus_dmamap_sync(dmat, map, BUS_DMASYNC_POSTREAD);
+		bus_dmamap_sync(dmat, map,
+		    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+		if ((le16toh(*status) & FXP_CB_STATUS_C) != 0)
+			break;
 	}
 	if (i == 0)
 		device_printf(sc->dev, "DMA timeout\n");
@@ -2228,13 +2230,12 @@ fxp_init_body(struct fxp_softc *sc)
 	 	 * Start the multicast setup command.
 		 */
 		fxp_scb_wait(sc);
-		bus_dmamap_sync(sc->mcs_tag, sc->mcs_map, BUS_DMASYNC_PREWRITE);
+		bus_dmamap_sync(sc->mcs_tag, sc->mcs_map,
+		    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 		CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->mcs_addr);
 		fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START);
 		/* ...and wait for it to complete. */
 		fxp_dma_wait(sc, &mcsp->cb_status, sc->mcs_tag, sc->mcs_map);
-		bus_dmamap_sync(sc->mcs_tag, sc->mcs_map,
-		    BUS_DMASYNC_POSTWRITE);
 	}
 
 	/*
@@ -2342,12 +2343,12 @@ fxp_init_body(struct fxp_softc *sc)
 	 * Start the config command/DMA.
 	 */
 	fxp_scb_wait(sc);
-	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_PREWRITE);
+	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map,
+	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 	CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.cbl_addr);
 	fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START);
 	/* ...and wait for it to complete. */
 	fxp_dma_wait(sc, &cbp->cb_status, sc->cbl_tag, sc->cbl_map);
-	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE);
 
 	/*
 	 * Now initialize the station address. Temporarily use the TxCB
@@ -2363,11 +2364,11 @@ fxp_init_body(struct fxp_softc *sc)
 	 * Start the IAS (Individual Address Setup) command/DMA.
 	 */
 	fxp_scb_wait(sc);
-	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_PREWRITE);
+	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map,
+	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 	fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START);
 	/* ...and wait for it to complete. */
 	fxp_dma_wait(sc, &cb_ias->cb_status, sc->cbl_tag, sc->cbl_map);
-	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE);
 
 	/*
 	 * Initialize transmit control block (TxCB) list.
@@ -3013,12 +3014,12 @@ fxp_load_ucode(struct fxp_softc *sc)
 	 * Download the ucode to the chip.
 	 */
 	fxp_scb_wait(sc);
-	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_PREWRITE);
+	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map,
+	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 	CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.cbl_addr);
 	fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START);
 	/* ...and wait for it to complete. */
 	fxp_dma_wait(sc, &cbp->cb_status, sc->cbl_tag, sc->cbl_map);
-	bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE);
 	device_printf(sc->dev,
 	    "Microcode loaded, int_delay: %d usec  bundle_max: %d\n",
 	    sc->tunable_int_delay,

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 01:21:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C24AA106566C;
	Wed, 10 Jun 2009 01:21:32 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A6F8E8FC20;
	Wed, 10 Jun 2009 01:21:32 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5A1LWQZ089721;
	Wed, 10 Jun 2009 01:21:32 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A1LWVO089719;
	Wed, 10 Jun 2009 01:21:32 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906100121.n5A1LWVO089719@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 10 Jun 2009 01:21: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: r193878 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 01:21:33 -0000

Author: kmacy
Date: Wed Jun 10 01:21:32 2009
New Revision: 193878
URL: http://svn.freebsd.org/changeset/base/193878

Log:
  As far as I can tell systems that have less than 4GB are more often hurt
  by prefetched than helped.  On i386 systems and systems with less than 4GB,
  prefetch is now disabled by default. I've added a prefetch enable tunable, to
  enable prefetching for those systems. The prefetch disable tunable will continue
  to unconditionally disable prefetching.

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Jun 10 01:20:46 2009	(r193877)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Jun 10 01:21:32 2009	(r193878)
@@ -158,6 +158,8 @@ static int		arc_grow_retry = 60;
  */
 static int		arc_min_prefetch_lifespan;
 
+extern int zfs_prefetch_disable;
+extern int zfs_prefetch_enable;
 static int arc_dead;
 
 /*
@@ -3549,6 +3551,19 @@ arc_init(void)
 	mutex_init(&zfs_write_limit_lock, NULL, MUTEX_DEFAULT, NULL);
 
 #ifdef _KERNEL
+#ifdef __i386__
+	if (zfs_prefetch_enable != 1) {
+		printf("ZFS NOTICE: prefetch is disabled by default on i386"
+		    " - add enable to tunable to change.\n" );
+		zfs_prefetch_disable=1;
+	}
+#endif	
+	if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) &&
+	    (zfs_prefetch_enable != 1) && (zfs_prefetch_disable != 1)) {
+		printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set"
+		    "... disabling.\n");
+		zfs_prefetch_disable=1;
+	}
 	/* Warn about ZFS memory and address space requirements. */
 	if (((uint64_t)physmem * PAGESIZE) < (256 + 128 + 64) * (1 << 20)) {
 		printf("ZFS WARNING: Recommended minimum RAM size is 512MB; "

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Wed Jun 10 01:20:46 2009	(r193877)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Wed Jun 10 01:21:32 2009	(r193878)
@@ -38,6 +38,7 @@
  */
 
 int zfs_prefetch_disable = 0;
+int zfs_prefetch_enable = 0;
 
 /* max # of streams per zfetch */
 uint32_t	zfetch_max_streams = 8;
@@ -52,6 +53,9 @@ SYSCTL_DECL(_vfs_zfs);
 TUNABLE_INT("vfs.zfs.prefetch_disable", &zfs_prefetch_disable);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN,
     &zfs_prefetch_disable, 0, "Disable prefetch");
+TUNABLE_INT("vfs.zfs.prefetch_enable", &zfs_prefetch_enable);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_enable, CTLFLAG_RDTUN,
+    &zfs_prefetch_enable, 0, "Enable prefetch for systems with less than 4GB");
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");
 TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams);
 SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RDTUN,

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 02:07:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7FEE7106566B;
	Wed, 10 Jun 2009 02:07:58 +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 6BA9D8FC12;
	Wed, 10 Jun 2009 02:07:58 +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 n5A27wEf090697;
	Wed, 10 Jun 2009 02:07:58 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A27wBQ090691;
	Wed, 10 Jun 2009 02:07:58 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200906100207.n5A27wBQ090691@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jun 2009 02:07: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: r193880 - in head/sys: amd64/conf boot/forth conf
	dev/alc i386/conf modules modules/alc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 02:07:58 -0000

Author: yongari
Date: Wed Jun 10 02:07:58 2009
New Revision: 193880
URL: http://svn.freebsd.org/changeset/base/193880

Log:
  Add alc(4), a driver for Atheros AR8131/AR8132 PCIe ethernet
  controller. These controllers are also known as L1C(AR8131) and
  L2C(AR8132) respectively. These controllers resembles the first
  generation controller L1 but usage of different descriptor format
  and new register mappings over L1 register space requires a new
  driver. There are a couple of registers I still don't understand
  but the driver seems to have no critical issues for performance and
  stability. Currently alc(4) supports the following hardware
  features.
    o MSI
    o TCP Segmentation offload
    o Hardware VLAN tag insertion/stripping
    o Tx/Rx interrupt moderation
    o Hardware statistics counters(dev.alc.%d.stats)
    o Jumbo frame
    o WOL
  AR8131/AR8132 also supports Tx checksum offloading but I disabled
  it due to stability issues. I'm not sure this comes from broken
  sample boards or hardware bugs. If you know your controller works
  without problems you can still enable it. The controller has a
  silicon bug for Rx checksum offloading, so the feature was not
  implemented.
  I'd like to say big thanks to Atheros. Atheros kindly sent sample
  boards to me and answered several questions I had.
  
  HW donated by:	Atheros Communications, Inc.

Added:
  head/sys/dev/alc/
  head/sys/dev/alc/if_alc.c   (contents, props changed)
  head/sys/dev/alc/if_alcreg.h   (contents, props changed)
  head/sys/dev/alc/if_alcvar.h   (contents, props changed)
  head/sys/modules/alc/
  head/sys/modules/alc/Makefile   (contents, props changed)
Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/boot/forth/loader.conf
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/i386/conf/GENERIC
  head/sys/modules/Makefile

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Wed Jun 10 01:26:25 2009	(r193879)
+++ head/sys/amd64/conf/GENERIC	Wed Jun 10 02:07:58 2009	(r193880)
@@ -213,6 +213,7 @@ device		vx		# 3Com 3c590, 3c595 (``Vorte
 device		miibus		# MII bus support
 device		ae		# Attansic/Atheros L2 FastEthernet
 device		age		# Attansic/Atheros L1 Gigabit Ethernet
+device		alc		# Atheros AR8131/AR8132 Ethernet
 device		ale		# Atheros AR8121/AR8113/AR8114 Ethernet
 device		bce		# Broadcom BCM5706/BCM5708 Gigabit Ethernet
 device		bfe		# Broadcom BCM440x 10/100 Ethernet

Modified: head/sys/boot/forth/loader.conf
==============================================================================
--- head/sys/boot/forth/loader.conf	Wed Jun 10 01:26:25 2009	(r193879)
+++ head/sys/boot/forth/loader.conf	Wed Jun 10 02:07:58 2009	(r193880)
@@ -210,6 +210,7 @@ pf_load="NO"			# packet filter
 miibus_load="NO"		# miibus support, needed for some drivers
 if_ae_load="NO"			# Attansic/Atheros L2 FastEthernet
 if_age_load="NO"		# Attansic/Atheros L1 Gigabit Ethernet
+if_alc_load="NO"		# Atheros AR8131/AR8132 Ethernet
 if_ale_load="NO"		# Atheros AR8121/AR8113/AR8114 Ethernet
 if_an_load="NO"			# Aironet 4500/4800 802.11 wireless NICs
 if_ar_load="NO"			# Digi SYNC/570i

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Wed Jun 10 01:26:25 2009	(r193879)
+++ head/sys/conf/NOTES	Wed Jun 10 02:07:58 2009	(r193880)
@@ -1754,6 +1754,7 @@ device		miibus
 #       L2 PCI-Express FastEthernet controllers.
 # age:  Support for gigabit ethernet adapters based on the Attansic/Atheros
 #       L1 PCI express gigabit ethernet controllers.
+# alc:  Support for Atheros AR8131/AR8132 PCIe ethernet controllers.
 # ale:  Support for Atheros AR8121/AR8113/AR8114 PCIe ethernet controllers.
 # bce:	Broadcom NetXtreme II (BCM5706/BCM5708) PCI/PCIe Gigabit Ethernet
 #       adapters.
@@ -1896,6 +1897,7 @@ device		xe
 # PCI Ethernet NICs that use the common MII bus controller code.
 device		ae		# Attansic/Atheros L2 FastEthernet
 device		age		# Attansic/Atheros L1 Gigabit Ethernet
+device		alc		# Atheros AR8131/AR8132 Ethernet
 device		ale		# Atheros AR8121/AR8113/AR8114 Ethernet
 device		bce		# Broadcom BCM5706/BCM5708 Gigabit Ethernet
 device		bfe		# Broadcom BCM440x 10/100 Ethernet

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 01:26:25 2009	(r193879)
+++ head/sys/conf/files	Wed Jun 10 02:07:58 2009	(r193880)
@@ -471,6 +471,7 @@ dev/aic7xxx/aic7xxx.c		optional ahc
 dev/aic7xxx/aic7xxx_93cx6.c	optional ahc
 dev/aic7xxx/aic7xxx_osm.c	optional ahc
 dev/aic7xxx/aic7xxx_pci.c	optional ahc pci
+dev/ale/if_alc.c		optional alc pci
 dev/ale/if_ale.c		optional ale pci
 dev/amd/amd.c			optional amd
 dev/amr/amr.c			optional amr

Added: head/sys/dev/alc/if_alc.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/alc/if_alc.c	Wed Jun 10 02:07:58 2009	(r193880)
@@ -0,0 +1,3496 @@
+/*-
+ * Copyright (c) 2009, Pyun YongHyeon 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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.
+ */
+
+/* Driver for Atheros AR8131/AR8132 PCIe Ethernet. */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+/* "device miibus" required.  See GENERIC if you get errors here. */
+#include "miibus_if.h"
+#undef ALC_USE_CUSTOM_CSUM
+
+#ifdef ALC_USE_CUSTOM_CSUM
+#define	ALC_CSUM_FEATURES	(CSUM_TCP | CSUM_UDP)
+#else
+#define	ALC_CSUM_FEATURES	(CSUM_IP | CSUM_TCP | CSUM_UDP)
+#endif
+#ifndef	IFCAP_VLAN_HWTSO
+#define	IFCAP_VLAN_HWTSO	0
+#endif
+
+MODULE_DEPEND(alc, pci, 1, 1, 1);
+MODULE_DEPEND(alc, ether, 1, 1, 1);
+MODULE_DEPEND(alc, miibus, 1, 1, 1);
+
+/* Tunables. */
+static int msi_disable = 0;
+static int msix_disable = 0;
+TUNABLE_INT("hw.alc.msi_disable", &msi_disable);
+TUNABLE_INT("hw.alc.msix_disable", &msix_disable);
+
+/*
+ * Devices supported by this driver.
+ */
+static struct alc_dev {
+	uint16_t	alc_vendorid;
+	uint16_t	alc_deviceid;
+	const char	*alc_name;
+} alc_devs[] = {
+	{ VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8131,
+		"Atheros AR8131 PCIe Gigabit Ethernet" },
+	{ VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8132,
+		"Atheros AR8132 PCIe Fast Ethernet" }
+};
+
+static void	alc_aspm(struct alc_softc *);
+static int	alc_attach(device_t);
+static int	alc_check_boundary(struct alc_softc *);
+static int	alc_detach(device_t);
+static void	alc_disable_l0s_l1(struct alc_softc *);
+static int	alc_dma_alloc(struct alc_softc *);
+static void	alc_dma_free(struct alc_softc *);
+static void	alc_dmamap_cb(void *, bus_dma_segment_t *, int, int);
+static int	alc_encap(struct alc_softc *, struct mbuf **);
+#ifndef __NO_STRICT_ALIGNMENT
+static struct mbuf *
+		alc_fixup_rx(struct ifnet *, struct mbuf *);
+#endif
+static void	alc_get_macaddr(struct alc_softc *);
+static void	alc_init(void *);
+static void	alc_init_cmb(struct alc_softc *);
+static void	alc_init_locked(struct alc_softc *);
+static void	alc_init_rr_ring(struct alc_softc *);
+static int	alc_init_rx_ring(struct alc_softc *);
+static void	alc_init_smb(struct alc_softc *);
+static void	alc_init_tx_ring(struct alc_softc *);
+static void	alc_int_task(void *, int);
+static int	alc_intr(void *);
+static int	alc_ioctl(struct ifnet *, u_long, caddr_t);
+static void	alc_mac_config(struct alc_softc *);
+static int	alc_miibus_readreg(device_t, int, int);
+static void	alc_miibus_statchg(device_t);
+static int	alc_miibus_writereg(device_t, int, int, int);
+static int	alc_mediachange(struct ifnet *);
+static void	alc_mediastatus(struct ifnet *, struct ifmediareq *);
+static int	alc_newbuf(struct alc_softc *, struct alc_rxdesc *);
+static void	alc_phy_down(struct alc_softc *);
+static void	alc_phy_reset(struct alc_softc *);
+static int	alc_probe(device_t);
+static void	alc_reset(struct alc_softc *);
+static int	alc_resume(device_t);
+static void	alc_rxeof(struct alc_softc *, struct rx_rdesc *);
+static int	alc_rxintr(struct alc_softc *, int);
+static void	alc_rxfilter(struct alc_softc *);
+static void	alc_rxvlan(struct alc_softc *);
+static void	alc_setlinkspeed(struct alc_softc *);
+static void	alc_setwol(struct alc_softc *);
+static int	alc_shutdown(device_t);
+static void	alc_start(struct ifnet *);
+static void	alc_start_queue(struct alc_softc *);
+static void	alc_stats_clear(struct alc_softc *);
+static void	alc_stats_update(struct alc_softc *);
+static void	alc_stop(struct alc_softc *);
+static void	alc_stop_mac(struct alc_softc *);
+static void	alc_stop_queue(struct alc_softc *);
+static int	alc_suspend(device_t);
+static void	alc_sysctl_node(struct alc_softc *);
+static void	alc_tick(void *);
+static void	alc_tx_task(void *, int);
+static void	alc_txeof(struct alc_softc *);
+static void	alc_watchdog(struct alc_softc *);
+static int	sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int);
+static int	sysctl_hw_alc_proc_limit(SYSCTL_HANDLER_ARGS);
+static int	sysctl_hw_alc_int_mod(SYSCTL_HANDLER_ARGS);
+
+static device_method_t alc_methods[] = {
+	/* Device interface. */
+	DEVMETHOD(device_probe,		alc_probe),
+	DEVMETHOD(device_attach,	alc_attach),
+	DEVMETHOD(device_detach,	alc_detach),
+	DEVMETHOD(device_shutdown,	alc_shutdown),
+	DEVMETHOD(device_suspend,	alc_suspend),
+	DEVMETHOD(device_resume,	alc_resume),
+
+	/* MII interface. */
+	DEVMETHOD(miibus_readreg,	alc_miibus_readreg),
+	DEVMETHOD(miibus_writereg,	alc_miibus_writereg),
+	DEVMETHOD(miibus_statchg,	alc_miibus_statchg),
+
+	{ NULL, NULL }
+};
+
+static driver_t alc_driver = {
+	"alc",
+	alc_methods,
+	sizeof(struct alc_softc)
+};
+
+static devclass_t alc_devclass;
+
+DRIVER_MODULE(alc, pci, alc_driver, alc_devclass, 0, 0);
+DRIVER_MODULE(miibus, alc, miibus_driver, miibus_devclass, 0, 0);
+
+static struct resource_spec alc_res_spec_mem[] = {
+	{ SYS_RES_MEMORY,	PCIR_BAR(0),	RF_ACTIVE },
+	{ -1,			0,		0 }
+};
+
+static struct resource_spec alc_irq_spec_legacy[] = {
+	{ SYS_RES_IRQ,		0,		RF_ACTIVE | RF_SHAREABLE },
+	{ -1,			0,		0 }
+};
+
+static struct resource_spec alc_irq_spec_msi[] = {
+	{ SYS_RES_IRQ,		1,		RF_ACTIVE },
+	{ -1,			0,		0 }
+};
+
+static struct resource_spec alc_irq_spec_msix[] = {
+	{ SYS_RES_IRQ,		1,		RF_ACTIVE },
+	{ -1,			0,		0 }
+};
+
+static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0 };
+
+static int
+alc_miibus_readreg(device_t dev, int phy, int reg)
+{
+	struct alc_softc *sc;
+	uint32_t v;
+	int i;
+
+	sc = device_get_softc(dev);
+
+	if (phy != sc->alc_phyaddr)
+		return (0);
+
+	CSR_WRITE_4(sc, ALC_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ |
+	    MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg));
+	for (i = ALC_PHY_TIMEOUT; i > 0; i--) {
+		DELAY(5);
+		v = CSR_READ_4(sc, ALC_MDIO);
+		if ((v & (MDIO_OP_EXECUTE | MDIO_OP_BUSY)) == 0)
+			break;
+	}
+
+	if (i == 0) {
+		device_printf(sc->alc_dev, "phy read timeout : %d\n", reg);
+		return (0);
+	}
+
+	return ((v & MDIO_DATA_MASK) >> MDIO_DATA_SHIFT);
+}
+
+static int
+alc_miibus_writereg(device_t dev, int phy, int reg, int val)
+{
+	struct alc_softc *sc;
+	uint32_t v;
+	int i;
+
+	sc = device_get_softc(dev);
+
+	if (phy != sc->alc_phyaddr)
+		return (0);
+
+	CSR_WRITE_4(sc, ALC_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE |
+	    (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT |
+	    MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg));
+	for (i = ALC_PHY_TIMEOUT; i > 0; i--) {
+		DELAY(5);
+		v = CSR_READ_4(sc, ALC_MDIO);
+		if ((v & (MDIO_OP_EXECUTE | MDIO_OP_BUSY)) == 0)
+			break;
+	}
+
+	if (i == 0)
+		device_printf(sc->alc_dev, "phy write timeout : %d\n", reg);
+
+	return (0);
+}
+
+static void
+alc_miibus_statchg(device_t dev)
+{
+	struct alc_softc *sc;
+	struct mii_data *mii;
+	struct ifnet *ifp;
+	uint32_t reg;
+
+	sc = device_get_softc(dev);
+
+	mii = device_get_softc(sc->alc_miibus);
+	ifp = sc->alc_ifp;
+	if (mii == NULL || ifp == NULL ||
+	    (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+		return;
+
+	sc->alc_flags &= ~ALC_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->alc_flags |= ALC_FLAG_LINK;
+			break;
+		case IFM_1000_T:
+			if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0)
+				sc->alc_flags |= ALC_FLAG_LINK;
+			break;
+		default:
+			break;
+		}
+	}
+	alc_stop_queue(sc);
+	/* Stop Rx/Tx MACs. */
+	alc_stop_mac(sc);
+
+	/* Program MACs with resolved speed/duplex/flow-control. */
+	if ((sc->alc_flags & ALC_FLAG_LINK) != 0) {
+		alc_start_queue(sc);
+		alc_mac_config(sc);
+		/* Re-enable Tx/Rx MACs. */
+		reg = CSR_READ_4(sc, ALC_MAC_CFG);
+		reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB;
+		CSR_WRITE_4(sc, ALC_MAC_CFG, reg);
+	}
+	alc_aspm(sc);
+}
+
+static void
+alc_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
+{
+	struct alc_softc *sc;
+	struct mii_data *mii;
+
+	sc = ifp->if_softc;
+	ALC_LOCK(sc);
+	if ((ifp->if_flags & IFF_UP) == 0) {
+		ALC_UNLOCK(sc);
+		return;
+	}
+	mii = device_get_softc(sc->alc_miibus);
+
+	mii_pollstat(mii);
+	ALC_UNLOCK(sc);
+	ifmr->ifm_status = mii->mii_media_status;
+	ifmr->ifm_active = mii->mii_media_active;
+}
+
+static int
+alc_mediachange(struct ifnet *ifp)
+{
+	struct alc_softc *sc;
+	struct mii_data *mii;
+	struct mii_softc *miisc;
+	int error;
+
+	sc = ifp->if_softc;
+	ALC_LOCK(sc);
+	mii = device_get_softc(sc->alc_miibus);
+	if (mii->mii_instance != 0) {
+		LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
+			mii_phy_reset(miisc);
+	}
+	error = mii_mediachg(mii);
+	ALC_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+alc_probe(device_t dev)
+{
+	struct alc_dev *sp;
+	int i;
+	uint16_t vendor, devid;
+
+	vendor = pci_get_vendor(dev);
+	devid = pci_get_device(dev);
+	sp = alc_devs;
+	for (i = 0; i < sizeof(alc_devs) / sizeof(alc_devs[0]); i++) {
+		if (vendor == sp->alc_vendorid &&
+		    devid == sp->alc_deviceid) {
+			device_set_desc(dev, sp->alc_name);
+			return (BUS_PROBE_DEFAULT);
+		}
+		sp++;
+	}
+
+	return (ENXIO);
+}
+
+static void
+alc_get_macaddr(struct alc_softc *sc)
+{
+	uint32_t ea[2], opt;
+	int i;
+
+	opt = CSR_READ_4(sc, ALC_OPT_CFG);
+	if ((CSR_READ_4(sc, ALC_TWSI_DEBUG) & TWSI_DEBUG_DEV_EXIST) != 0) {
+		/*
+		 * EEPROM found, let TWSI reload EEPROM configuration.
+		 * This will set ethernet address of controller.
+		 */
+		if ((opt & OPT_CFG_CLK_ENB) == 0) {
+			opt |= OPT_CFG_CLK_ENB;
+			CSR_WRITE_4(sc, ALC_OPT_CFG, opt);
+			CSR_READ_4(sc, ALC_OPT_CFG);
+			DELAY(1000);
+		}
+		CSR_WRITE_4(sc, ALC_TWSI_CFG, CSR_READ_4(sc, ALC_TWSI_CFG) |
+		    TWSI_CFG_SW_LD_START);
+		for (i = 100; i > 0; i--) {
+			DELAY(1000);
+			if ((CSR_READ_4(sc, ALC_TWSI_CFG) &
+			    TWSI_CFG_SW_LD_START) == 0)
+				break;
+		}
+		if (i == 0)
+			device_printf(sc->alc_dev,
+			    "reloading EEPROM timeout!\n");
+	} else {
+		if (bootverbose)
+			device_printf(sc->alc_dev, "EEPROM not found!\n");
+	}
+	if ((opt & OPT_CFG_CLK_ENB) != 0) {
+		opt &= ~OPT_CFG_CLK_ENB;
+		CSR_WRITE_4(sc, ALC_OPT_CFG, opt);
+		CSR_READ_4(sc, ALC_OPT_CFG);
+		DELAY(1000);
+	}
+
+	ea[0] = CSR_READ_4(sc, ALC_PAR0);
+	ea[1] = CSR_READ_4(sc, ALC_PAR1);
+	sc->alc_eaddr[0] = (ea[1] >> 8) & 0xFF;
+	sc->alc_eaddr[1] = (ea[1] >> 0) & 0xFF;
+	sc->alc_eaddr[2] = (ea[0] >> 24) & 0xFF;
+	sc->alc_eaddr[3] = (ea[0] >> 16) & 0xFF;
+	sc->alc_eaddr[4] = (ea[0] >> 8) & 0xFF;
+	sc->alc_eaddr[5] = (ea[0] >> 0) & 0xFF;
+}
+
+static void
+alc_disable_l0s_l1(struct alc_softc *sc)
+{
+	uint32_t pmcfg;
+
+	/* Another magic from vendor. */
+	pmcfg = CSR_READ_4(sc, ALC_PM_CFG);
+	pmcfg &= ~(PM_CFG_L1_ENTRY_TIMER_MASK | PM_CFG_CLK_SWH_L1 |
+	    PM_CFG_ASPM_L0S_ENB | PM_CFG_ASPM_L1_ENB | PM_CFG_MAC_ASPM_CHK |
+	    PM_CFG_SERDES_PD_EX_L1);
+	pmcfg |= PM_CFG_SERDES_BUDS_RX_L1_ENB | PM_CFG_SERDES_PLL_L1_ENB |
+	    PM_CFG_SERDES_L1_ENB;
+	CSR_WRITE_4(sc, ALC_PM_CFG, pmcfg);
+}
+
+static void
+alc_phy_reset(struct alc_softc *sc)
+{
+	uint16_t data;
+
+	/* Reset magic from Linux. */
+	CSR_WRITE_2(sc, ALC_GPHY_CFG,
+	    GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | GPHY_CFG_SEL_ANA_RESET);
+	CSR_READ_2(sc, ALC_GPHY_CFG);
+	DELAY(10 * 1000);
+
+	CSR_WRITE_2(sc, ALC_GPHY_CFG,
+	    GPHY_CFG_EXT_RESET | GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE |
+	    GPHY_CFG_SEL_ANA_RESET);
+	CSR_READ_2(sc, ALC_GPHY_CFG);
+	DELAY(10 * 1000);
+
+	/* Load DSP codes, vendor magic. */
+	data = ANA_LOOP_SEL_10BT | ANA_EN_MASK_TB | ANA_EN_10BT_IDLE |
+	    ((1 << ANA_INTERVAL_SEL_TIMER_SHIFT) & ANA_INTERVAL_SEL_TIMER_MASK);
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_ADDR, MII_ANA_CFG18);
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_DATA, data);
+
+	data = ((2 << ANA_SERDES_CDR_BW_SHIFT) & ANA_SERDES_CDR_BW_MASK) |
+	    ANA_SERDES_EN_DEEM | ANA_SERDES_SEL_HSP | ANA_SERDES_EN_PLL |
+	    ANA_SERDES_EN_LCKDT;
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_ADDR, MII_ANA_CFG5);
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_DATA, data);
+
+	data = ((44 << ANA_LONG_CABLE_TH_100_SHIFT) &
+	    ANA_LONG_CABLE_TH_100_MASK) |
+	    ((33 << ANA_SHORT_CABLE_TH_100_SHIFT) &
+	    ANA_SHORT_CABLE_TH_100_SHIFT) |
+	    ANA_BP_BAD_LINK_ACCUM | ANA_BP_SMALL_BW;
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_ADDR, MII_ANA_CFG54);
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_DATA, data);
+
+	data = ((11 << ANA_IECHO_ADJ_3_SHIFT) & ANA_IECHO_ADJ_3_MASK) |
+	    ((11 << ANA_IECHO_ADJ_2_SHIFT) & ANA_IECHO_ADJ_2_MASK) |
+	    ((8 << ANA_IECHO_ADJ_1_SHIFT) & ANA_IECHO_ADJ_1_MASK) |
+	    ((8 << ANA_IECHO_ADJ_0_SHIFT) & ANA_IECHO_ADJ_0_MASK);
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_ADDR, MII_ANA_CFG4);
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_DATA, data);
+
+	data = ((7 & ANA_MANUL_SWICH_ON_SHIFT) & ANA_MANUL_SWICH_ON_MASK) |
+	    ANA_RESTART_CAL | ANA_MAN_ENABLE | ANA_SEL_HSP | ANA_EN_HB |
+	    ANA_OEN_125M;
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_ADDR, MII_ANA_CFG0);
+	alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr,
+	    ALC_MII_DBG_DATA, data);
+	DELAY(1000);
+}
+
+static void
+alc_phy_down(struct alc_softc *sc)
+{
+
+	/* Force PHY down. */
+	CSR_WRITE_2(sc, ALC_GPHY_CFG,
+	    GPHY_CFG_EXT_RESET | GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE |
+	    GPHY_CFG_SEL_ANA_RESET | GPHY_CFG_PHY_IDDQ | GPHY_CFG_PWDOWN_HW);
+	DELAY(1000);
+}
+
+static void
+alc_aspm(struct alc_softc *sc)
+{
+	uint32_t pmcfg;
+
+	ALC_LOCK_ASSERT(sc);
+
+	pmcfg = CSR_READ_4(sc, ALC_PM_CFG);
+	pmcfg &= ~PM_CFG_SERDES_PD_EX_L1;
+	pmcfg |= PM_CFG_SERDES_BUDS_RX_L1_ENB;
+	pmcfg |= PM_CFG_SERDES_L1_ENB;
+	pmcfg &= ~PM_CFG_L1_ENTRY_TIMER_MASK;
+	pmcfg |= PM_CFG_MAC_ASPM_CHK;
+	if ((sc->alc_flags & ALC_FLAG_LINK) != 0) {
+		pmcfg |= PM_CFG_SERDES_PLL_L1_ENB;
+		pmcfg &= ~PM_CFG_CLK_SWH_L1;
+		pmcfg &= ~PM_CFG_ASPM_L1_ENB;
+		pmcfg &= ~PM_CFG_ASPM_L0S_ENB;
+	} else {
+		pmcfg &= ~PM_CFG_SERDES_PLL_L1_ENB;
+		pmcfg |= PM_CFG_CLK_SWH_L1;
+		pmcfg &= ~PM_CFG_ASPM_L1_ENB;
+		pmcfg &= ~PM_CFG_ASPM_L0S_ENB;
+	}
+	CSR_WRITE_4(sc, ALC_PM_CFG, pmcfg);
+}
+
+static int
+alc_attach(device_t dev)
+{
+	struct alc_softc *sc;
+	struct ifnet *ifp;
+	char *aspm_state[] = { "L0s/L1", "L0s", "L1", "L0s/l1" };
+	uint16_t burst;
+	int base, error, i, msic, msixc, pmc, state;
+	uint32_t cap, ctl, val;
+
+	error = 0;
+	sc = device_get_softc(dev);
+	sc->alc_dev = dev;
+
+	mtx_init(&sc->alc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
+	    MTX_DEF);
+	callout_init_mtx(&sc->alc_tick_ch, &sc->alc_mtx, 0);
+	TASK_INIT(&sc->alc_int_task, 0, alc_int_task, sc);
+
+	/* Map the device. */
+	pci_enable_busmaster(dev);
+	sc->alc_res_spec = alc_res_spec_mem;
+	sc->alc_irq_spec = alc_irq_spec_legacy;
+	error = bus_alloc_resources(dev, sc->alc_res_spec, sc->alc_res);
+	if (error != 0) {
+		device_printf(dev, "cannot allocate memory resources.\n");
+		goto fail;
+	}
+
+	/* Set PHY address. */
+	sc->alc_phyaddr = ALC_PHY_ADDR;
+
+	/* Initialize DMA parameters. */
+	sc->alc_dma_rd_burst = 0;
+	sc->alc_dma_wr_burst = 0;
+	sc->alc_rcb = DMA_CFG_RCB_64;
+	if (pci_find_extcap(dev, PCIY_EXPRESS, &base) == 0) {
+		sc->alc_flags |= ALC_FLAG_PCIE;
+		burst = CSR_READ_2(sc, base + PCIR_EXPRESS_DEVICE_CTL);
+		sc->alc_dma_rd_burst =
+		    (burst & PCIM_EXP_CTL_MAX_READ_REQUEST) >> 12;
+		sc->alc_dma_wr_burst = (burst & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5;
+		if (bootverbose) {
+			device_printf(dev, "Read request size : %u bytes.\n",
+			    alc_dma_burst[sc->alc_dma_rd_burst]);
+			device_printf(dev, "TLP payload size : %u bytes.\n",
+			    alc_dma_burst[sc->alc_dma_wr_burst]);
+		}
+		/* Clear data link and flow-control protocol error. */
+		val = CSR_READ_4(sc, ALC_PEX_UNC_ERR_SEV);
+		val &= ~(PEX_UNC_ERR_SEV_DLP | PEX_UNC_ERR_SEV_FCP);
+		CSR_WRITE_4(sc, ALC_PEX_UNC_ERR_SEV, val);
+		/* Disable ASPM L0S and L1. */
+		cap = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CAP);
+		if ((cap & PCIM_LINK_CAP_ASPM) != 0) {
+			ctl = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CTL);
+			if ((ctl & 0x08) != 0)
+				sc->alc_rcb = DMA_CFG_RCB_128;
+			if (bootverbose)
+				device_printf(dev, "RCB %u bytes\n",
+				    sc->alc_rcb == DMA_CFG_RCB_64 ? 64 : 128);
+			state = ctl & 0x03;
+			if (bootverbose)
+				device_printf(sc->alc_dev, "ASPM %s %s\n",
+				    aspm_state[state],
+				    state == 0 ? "disabled" : "enabled");
+			if (state != 0)
+				alc_disable_l0s_l1(sc);
+		}
+	}
+
+	/* Reset PHY. */
+	alc_phy_reset(sc);
+
+	/* Reset the ethernet controller. */
+	alc_reset(sc);
+
+	/*
+	 * One odd thing is AR8132 uses the same PHY hardware(F1
+	 * gigabit PHY) of AR8131. So atphy(4) of AR8132 reports
+	 * the PHY supports 1000Mbps but that's not true. The PHY
+	 * used in AR8132 can't establish gigabit link even if it
+	 * shows the same PHY model/revision number of AR8131.
+	 */
+	if (pci_get_device(dev) == DEVICEID_ATHEROS_AR8132)
+		sc->alc_flags |= ALC_FLAG_FASTETHER | ALC_FLAG_JUMBO;
+	else
+		sc->alc_flags |= ALC_FLAG_JUMBO | ALC_FLAG_ASPM_MON;
+	/*
+	 * It seems that AR8131/AR8132 has silicon bug for SMB. In
+	 * addition, Atheros said that enabling SMB wouldn't improve
+	 * performance. However I think it's bad to access lots of
+	 * registers to extract MAC statistics.
+	 */
+	sc->alc_flags |= ALC_FLAG_SMB_BUG;
+	/*
+	 * Don't use Tx CMB. It is known to have silicon bug.
+	 */
+	sc->alc_flags |= ALC_FLAG_CMB_BUG;
+	sc->alc_rev = pci_get_revid(dev);
+	sc->alc_chip_rev = CSR_READ_4(sc, ALC_MASTER_CFG) >>
+	    MASTER_CHIP_REV_SHIFT;
+	if (bootverbose) {
+		device_printf(dev, "PCI device revision : 0x%04x\n",
+		    sc->alc_rev);
+		device_printf(dev, "Chip id/revision : 0x%04x\n",
+		    sc->alc_chip_rev);
+	}
+	device_printf(dev, "%u Tx FIFO, %u Rx FIFO\n",
+	    CSR_READ_4(sc, ALC_SRAM_TX_FIFO_LEN) * 8,
+	    CSR_READ_4(sc, ALC_SRAM_RX_FIFO_LEN) * 8);
+
+	/* Allocate IRQ resources. */
+	msixc = pci_msix_count(dev);
+	msic = pci_msi_count(dev);
+	if (bootverbose) {
+		device_printf(dev, "MSIX count : %d\n", msixc);
+		device_printf(dev, "MSI count : %d\n", msic);
+	}
+	/* Prefer MSIX over MSI. */
+	if (msix_disable == 0 || msi_disable == 0) {
+		if (msix_disable == 0 && msixc == ALC_MSIX_MESSAGES &&
+		    pci_alloc_msix(dev, &msixc) == 0) {
+			if (msic == ALC_MSIX_MESSAGES) {
+				device_printf(dev,
+				    "Using %d MSIX message(s).\n", msixc);
+				sc->alc_flags |= ALC_FLAG_MSIX;
+				sc->alc_irq_spec = alc_irq_spec_msix;
+			} else
+				pci_release_msi(dev);
+		}
+		if (msi_disable == 0 && (sc->alc_flags & ALC_FLAG_MSIX) == 0 &&
+		    msic == ALC_MSI_MESSAGES &&
+		    pci_alloc_msi(dev, &msic) == 0) {
+			if (msic == ALC_MSI_MESSAGES) {
+				device_printf(dev,
+				    "Using %d MSI message(s).\n", msic);
+				sc->alc_flags |= ALC_FLAG_MSI;
+				sc->alc_irq_spec = alc_irq_spec_msi;
+			} else
+				pci_release_msi(dev);
+		}
+	}
+
+	error = bus_alloc_resources(dev, sc->alc_irq_spec, sc->alc_irq);
+	if (error != 0) {
+		device_printf(dev, "cannot allocate IRQ resources.\n");
+		goto fail;
+	}
+
+	/* Create device sysctl node. */
+	alc_sysctl_node(sc);
+
+	if ((error = alc_dma_alloc(sc) != 0))
+		goto fail;
+
+	/* Load station address. */
+	alc_get_macaddr(sc);
+
+	ifp = sc->alc_ifp = if_alloc(IFT_ETHER);
+	if (ifp == NULL) {
+		device_printf(dev, "cannot allocate ifnet structure.\n");
+		error = ENXIO;
+		goto fail;
+	}
+
+	ifp->if_softc = sc;
+	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
+	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+	ifp->if_ioctl = alc_ioctl;
+	ifp->if_start = alc_start;
+	ifp->if_init = alc_init;
+	ifp->if_snd.ifq_drv_maxlen = ALC_TX_RING_CNT - 1;
+	IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
+	IFQ_SET_READY(&ifp->if_snd);
+	ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4;
+	ifp->if_hwassist = ALC_CSUM_FEATURES | CSUM_TSO;
+	if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0)
+		ifp->if_capabilities |= IFCAP_WOL_MAGIC | IFCAP_WOL_MCAST;
+	ifp->if_capenable = ifp->if_capabilities;
+
+	/* Set up MII bus. */
+	if ((error = mii_phy_probe(dev, &sc->alc_miibus, alc_mediachange,
+	    alc_mediastatus)) != 0) {
+		device_printf(dev, "no PHY found!\n");
+		goto fail;
+	}
+
+	ether_ifattach(ifp, sc->alc_eaddr);
+
+	/* VLAN capability setup. */
+	ifp->if_capabilities |= IFCAP_VLAN_MTU;
+	ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM;
+	ifp->if_capenable = ifp->if_capabilities;
+	/*
+	 * XXX
+	 * It seems enabling Tx checksum offloading makes more trouble.
+	 * Sometimes the controller does not receive any frames when
+	 * Tx checksum offloading is enabled. I'm not sure whether this
+	 * is a bug in Tx checksum offloading logic or I got broken
+	 * sample boards. To safety, don't enable Tx checksum offloading
+	 * by default but give chance to users to toggle it if they know
+	 * their controllers work without problems.
+	 */
+	ifp->if_capenable &= ~IFCAP_TXCSUM;
+	ifp->if_hwassist &= ~ALC_CSUM_FEATURES;
+
+	/* Tell the upper layer(s) we support long frames. */
+	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+
+	/* Create local taskq. */
+	TASK_INIT(&sc->alc_tx_task, 1, alc_tx_task, ifp);
+	sc->alc_tq = taskqueue_create_fast("alc_taskq", M_WAITOK,
+	    taskqueue_thread_enqueue, &sc->alc_tq);
+	if (sc->alc_tq == NULL) {
+		device_printf(dev, "could not create taskqueue.\n");
+		ether_ifdetach(ifp);
+		error = ENXIO;
+		goto fail;
+	}
+	taskqueue_start_threads(&sc->alc_tq, 1, PI_NET, "%s taskq",
+	    device_get_nameunit(sc->alc_dev));
+
+	if ((sc->alc_flags & ALC_FLAG_MSIX) != 0)
+		msic = ALC_MSIX_MESSAGES;
+	else if ((sc->alc_flags & ALC_FLAG_MSI) != 0)
+		msic = ALC_MSI_MESSAGES;
+	else
+		msic = 1;
+	for (i = 0; i < msic; i++) {
+		error = bus_setup_intr(dev, sc->alc_irq[i],
+		    INTR_TYPE_NET | INTR_MPSAFE, alc_intr, NULL, sc,
+		    &sc->alc_intrhand[i]);
+		if (error != 0)
+			break;
+	}
+	if (error != 0) {
+		device_printf(dev, "could not set up interrupt handler.\n");
+		taskqueue_free(sc->alc_tq);
+		sc->alc_tq = NULL;
+		ether_ifdetach(ifp);
+		goto fail;
+	}
+
+fail:
+	if (error != 0)
+		alc_detach(dev);
+
+	return (error);
+}
+
+static int
+alc_detach(device_t dev)
+{
+	struct alc_softc *sc;
+	struct ifnet *ifp;
+	int i, msic;
+
+	sc = device_get_softc(dev);
+
+	ifp = sc->alc_ifp;
+	if (device_is_attached(dev)) {
+		ALC_LOCK(sc);
+		sc->alc_flags |= ALC_FLAG_DETACH;
+		alc_stop(sc);
+		ALC_UNLOCK(sc);
+		callout_drain(&sc->alc_tick_ch);
+		taskqueue_drain(sc->alc_tq, &sc->alc_int_task);
+		taskqueue_drain(sc->alc_tq, &sc->alc_tx_task);
+		ether_ifdetach(ifp);
+	}
+
+	if (sc->alc_tq != NULL) {
+		taskqueue_drain(sc->alc_tq, &sc->alc_int_task);
+		taskqueue_free(sc->alc_tq);
+		sc->alc_tq = NULL;
+	}
+
+	if (sc->alc_miibus != NULL) {
+		device_delete_child(dev, sc->alc_miibus);
+		sc->alc_miibus = NULL;
+	}
+	bus_generic_detach(dev);
+	alc_dma_free(sc);
+
+	if (ifp != NULL) {
+		if_free(ifp);
+		sc->alc_ifp = NULL;
+	}
+
+	if ((sc->alc_flags & ALC_FLAG_MSIX) != 0)
+		msic = ALC_MSIX_MESSAGES;
+	else if ((sc->alc_flags & ALC_FLAG_MSI) != 0)
+		msic = ALC_MSI_MESSAGES;
+	else
+		msic = 1;
+	for (i = 0; i < msic; i++) {
+		if (sc->alc_intrhand[i] != NULL) {
+			bus_teardown_intr(dev, sc->alc_irq[i],
+			    sc->alc_intrhand[i]);
+			sc->alc_intrhand[i] = NULL;
+		}
+	}
+	alc_phy_down(sc);
+	bus_release_resources(dev, sc->alc_irq_spec, sc->alc_irq);
+	if ((sc->alc_flags & (ALC_FLAG_MSI | ALC_FLAG_MSIX)) != 0)
+		pci_release_msi(dev);
+	bus_release_resources(dev, sc->alc_res_spec, sc->alc_res);
+	mtx_destroy(&sc->alc_mtx);
+
+	return (0);
+}
+
+#define	ALC_SYSCTL_STAT_ADD32(c, h, n, p, d)	\
+	    SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d)
+#define	ALC_SYSCTL_STAT_ADD64(c, h, n, p, d)	\
+	    SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d)
+
+static void
+alc_sysctl_node(struct alc_softc *sc)
+{
+	struct sysctl_ctx_list *ctx;
+	struct sysctl_oid_list *child, *parent;
+	struct sysctl_oid *tree;
+	struct alc_hw_stats *stats;
+	int error;
+
+	stats = &sc->alc_stats;
+	ctx = device_get_sysctl_ctx(sc->alc_dev);
+	child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->alc_dev));
+
+	SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod",
+	    CTLTYPE_INT | CTLFLAG_RW, &sc->alc_int_rx_mod, 0,
+	    sysctl_hw_alc_int_mod, "I", "alc Rx interrupt moderation");
+	SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod",
+	    CTLTYPE_INT | CTLFLAG_RW, &sc->alc_int_tx_mod, 0,
+	    sysctl_hw_alc_int_mod, "I", "alc Tx interrupt moderation");
+	/* Pull in device tunables. */
+	sc->alc_int_rx_mod = ALC_IM_RX_TIMER_DEFAULT;
+	error = resource_int_value(device_get_name(sc->alc_dev),
+	    device_get_unit(sc->alc_dev), "int_rx_mod", &sc->alc_int_rx_mod);
+	if (error == 0) {
+		if (sc->alc_int_rx_mod < ALC_IM_TIMER_MIN ||
+		    sc->alc_int_rx_mod > ALC_IM_TIMER_MAX) {
+			device_printf(sc->alc_dev, "int_rx_mod value out of "
+			    "range; using default: %d\n",
+			    ALC_IM_RX_TIMER_DEFAULT);
+			sc->alc_int_rx_mod = ALC_IM_RX_TIMER_DEFAULT;
+		}
+	}
+	sc->alc_int_tx_mod = ALC_IM_TX_TIMER_DEFAULT;
+	error = resource_int_value(device_get_name(sc->alc_dev),
+	    device_get_unit(sc->alc_dev), "int_tx_mod", &sc->alc_int_tx_mod);
+	if (error == 0) {
+		if (sc->alc_int_tx_mod < ALC_IM_TIMER_MIN ||
+		    sc->alc_int_tx_mod > ALC_IM_TIMER_MAX) {
+			device_printf(sc->alc_dev, "int_tx_mod value out of "
+			    "range; using default: %d\n",
+			    ALC_IM_TX_TIMER_DEFAULT);
+			sc->alc_int_tx_mod = ALC_IM_TX_TIMER_DEFAULT;
+		}
+	}
+	SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit",
+	    CTLTYPE_INT | CTLFLAG_RW, &sc->alc_process_limit, 0,
+	    sysctl_hw_alc_proc_limit, "I",
+	    "max number of Rx events to process");
+	/* Pull in device tunables. */
+	sc->alc_process_limit = ALC_PROC_DEFAULT;
+	error = resource_int_value(device_get_name(sc->alc_dev),
+	    device_get_unit(sc->alc_dev), "process_limit",
+	    &sc->alc_process_limit);
+	if (error == 0) {
+		if (sc->alc_process_limit < ALC_PROC_MIN ||
+		    sc->alc_process_limit > ALC_PROC_MAX) {
+			device_printf(sc->alc_dev,
+			    "process_limit value out of range; "
+			    "using default: %d\n", ALC_PROC_DEFAULT);
+			sc->alc_process_limit = ALC_PROC_DEFAULT;
+		}
+	}
+
+	tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD,
+	    NULL, "ALC 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);
+	ALC_SYSCTL_STAT_ADD32(ctx, child, "good_frames",
+	    &stats->rx_frames, "Good frames");
+	ALC_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames",

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

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 02:10:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F311C106566C;
	Wed, 10 Jun 2009 02:10:35 +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 E12638FC13;
	Wed, 10 Jun 2009 02:10:35 +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 n5A2AZGA090779;
	Wed, 10 Jun 2009 02:10:35 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A2AZVL090778;
	Wed, 10 Jun 2009 02:10:35 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200906100210.n5A2AZVL090778@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jun 2009 02:10: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: r193881 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 02:10:36 -0000

Author: yongari
Date: Wed Jun 10 02:10:35 2009
New Revision: 193881
URL: http://svn.freebsd.org/changeset/base/193881

Log:
  Add alc(4) to the list of supported network interface.

Modified:
  head/usr.sbin/sysinstall/devices.c

Modified: head/usr.sbin/sysinstall/devices.c
==============================================================================
--- head/usr.sbin/sysinstall/devices.c	Wed Jun 10 02:07:58 2009	(r193880)
+++ head/usr.sbin/sysinstall/devices.c	Wed Jun 10 02:10:35 2009	(r193881)
@@ -91,6 +91,7 @@ static struct _devname {
     SERIAL("cuad%d",	"%s on device %s (COM%d)",		16),
     NETWORK("ae",	"Attansic/Atheros L2 Fast Ethernet"),
     NETWORK("age",	"Attansic/Atheros L1 Gigabit Ethernet"),
+    NETWORK("alc",	"Atheros AR8111/AR8132 PCIe Ethernet"),
     NETWORK("ale",	"Atheros AR8121/AR8113/AR8114 PCIe Ethernet"),
     NETWORK("an",	"Aironet 4500/4800 802.11 wireless adapter"),
     NETWORK("ath",	"Atheros IEEE 802.11 wireless adapter"),

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 02:19:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17445106566B;
	Wed, 10 Jun 2009 02:19:55 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 042748FC18;
	Wed, 10 Jun 2009 02:19: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 n5A2Jsqb090984;
	Wed, 10 Jun 2009 02:19:54 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A2JshD090979;
	Wed, 10 Jun 2009 02:19:54 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200906100219.n5A2JshD090979@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jun 2009 02:19:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193882 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 02:19:55 -0000

Author: yongari
Date: Wed Jun 10 02:19:54 2009
New Revision: 193882
URL: http://svn.freebsd.org/changeset/base/193882

Log:
  Add alc(4) man page and hook up ale(4) to the build.
  Also add Xr to appropriate man pages.

Added:
  head/share/man/man4/alc.4   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/share/man/man4/altq.4
  head/share/man/man4/miibus.4
  head/share/man/man4/vlan.4

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/Makefile	Wed Jun 10 02:10:35 2009	(r193881)
+++ head/share/man/man4/Makefile	Wed Jun 10 02:19:54 2009	(r193882)
@@ -23,6 +23,7 @@ MAN=	aac.4 \
 	ahc.4 \
 	ahd.4 \
 	aio.4 \
+	alc.4 \
 	ale.4 \
 	altq.4 \
 	amd.4 \

Added: head/share/man/man4/alc.4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man4/alc.4	Wed Jun 10 02:19:54 2009	(r193882)
@@ -0,0 +1,160 @@
+.\" Copyright (c) 2009 Pyun YongHyeon
+.\" 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$
+.\"
+.Dd June 10, 2009
+.Dt ALC 4
+.Os
+.Sh NAME
+.Nm alc
+.Nd Atheros AR8131/AR8132 Gigabit/Fast Ethernet driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device miibus"
+.Cd "device alc"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_alc_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+device driver provides support for Atheros AR8131 PCI Express
+Gigabit Ethernet controllers and Atheros AR8132 PCI Express
+Fast Ethernet controllers.
+.Pp
+All LOMs supported by the
+.Nm
+driver have TCP/UDP/IP checksum offload for transmit, TCP
+segmentation offload (TSO), hardware VLAN tag stripping/insertion
+features, Wake On Lan (WOL) and an interrupt moderation mechanism
+as well as a 64-bit multicast hash filter.
+.Pp
+The AR8131/AR8132 supports Jumbo Frames (up to 9216 bytes), which can
+be configured via the interface MTU setting.
+Selecting an MTU larger than 1500 bytes with the
+.Xr ifconfig 8
+utility configures the adapter to receive and transmit Jumbo Frames.
+.Pp
+The
+.Nm
+driver supports the following media types:
+.Bl -tag -width ".Cm 10baseT/UTP"
+.It Cm autoselect
+Enable autoselection of the media type and options.
+The user can manually override
+the autoselected mode by adding media options to
+.Xr rc.conf 5 .
+.It Cm 10baseT/UTP
+Set 10Mbps operation.
+.It Cm 100baseTX
+Set 100Mbps (Fast Ethernet) operation.
+.It Cm 1000baseTX
+Set 1000baseTX operation over twisted pair.
+.El
+.Pp
+The
+.Nm
+driver supports the following media options:
+.Bl -tag -width ".Cm full-duplex"
+.It Cm full-duplex
+Force full duplex operation.
+.It Cm half-duplex
+Force half duplex operation.
+.El
+.Pp
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Sh HARDWARE
+The
+.Nm
+device driver provides support for the following Ethernet controllers:
+.Pp
+.Bl -bullet -compact
+.It
+Atheros AR8131 PCI Express Gigabit Ethernet controller
+.It
+Atheros AR8132 PCI Express Fast Ethernet controller
+.El
+.Sh LOADER TUNABLES
+Tunables can be set at the
+.Xr loader 8
+prompt before booting the kernel or stored in
+.Xr loader.conf 5 .
+.Bl -tag -width "xxxxxx"
+.It Va hw.alc.msi_disable
+This tunable disables MSI support on the Ethernet hardware.
+The default value is 0.
+.It Va hw.alc.msix_disable
+This tunable disables MSI-X support on the Ethernet hardware.
+The default value is 0.
+.El
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width "xxxxxx"
+.It Va dev.alc.%d.int_rx_mod
+Maximum amount of time to delay receive interrupt processing in
+units of 1us.
+The accepted range is 0 to 130000, the default is 100(100us).
+Value 0 completely disables the interrupt moderation.
+.It Va dev.alc.%d.int_tx_mod
+Maximum amount of time to delay transmit interrupt processing in
+units of 1us.
+The accepted range is 0 to 130000, the default is 50000(50ms).
+Value 0 completely disables the interrupt moderation.
+.It Va dev.alc.%d.process_limit
+Maximum amount of Rx frames to be processed in the event loop before
+rescheduling a taskqueue.
+The accepted range is 32 to 255, the default value is 64 events.
+The interface does not need to be brought down and up again before
+a change takes effect.
+.El
+.Sh SEE ALSO
+.Xr altq 4 ,
+.Xr arp 4 ,
+.Xr miibus 4 ,
+.Xr netintro 4 ,
+.Xr ng_ether 4 ,
+.Xr vlan 4 ,
+.Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+driver was written by
+.An Pyun YongHyeon
+.Aq yongari@FreeBSD.org .
+It first appeared in
+.Fx 8.0 .

Modified: head/share/man/man4/altq.4
==============================================================================
--- head/share/man/man4/altq.4	Wed Jun 10 02:10:35 2009	(r193881)
+++ head/share/man/man4/altq.4	Wed Jun 10 02:19:54 2009	(r193882)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 21, 2009
+.Dd June 10, 2009
 .Dt ALTQ 4
 .Os
 .Sh NAME
@@ -116,6 +116,7 @@ are required to use a certain network ca
 .Nm .
 They have been applied to the following hardware drivers:
 .Xr age 4 ,
+.Xr alc 4 ,
 .Xr ale 4 ,
 .Xr an 4 ,
 .Xr ath 4 ,

Modified: head/share/man/man4/miibus.4
==============================================================================
--- head/share/man/man4/miibus.4	Wed Jun 10 02:10:35 2009	(r193881)
+++ head/share/man/man4/miibus.4	Wed Jun 10 02:19:54 2009	(r193882)
@@ -8,7 +8,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 12, 2008
+.Dd June 10, 2009
 .Dt MIIBUS 4
 .Os
 .Sh NAME
@@ -47,6 +47,8 @@ interface:
 .Bl -tag -compact -width ".Xr fxp 4"
 .It Xr age 4
 Attansic/Atheros L1 Gigabit Ethernet
+.It Xr alc 4
+Atheros AR8131/AR8132 PCIe Ethernet
 .It Xr ale 4
 Atheros AR8121/AR8113/AR8114 PCIe Ethernet
 .It Xr aue 4
@@ -127,6 +129,7 @@ and
 but as a result are not well behaved newbus device drivers.
 .Sh SEE ALSO
 .Xr age 4 ,
+.Xr alc 4 ,
 .Xr ale 4 ,
 .Xr arp 4 ,
 .Xr aue 4 ,

Modified: head/share/man/man4/vlan.4
==============================================================================
--- head/share/man/man4/vlan.4	Wed Jun 10 02:10:35 2009	(r193881)
+++ head/share/man/man4/vlan.4	Wed Jun 10 02:19:54 2009	(r193882)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 12, 2008
+.Dd June 10, 2009
 .Dt VLAN 4
 .Os
 .Sh NAME
@@ -123,6 +123,7 @@ By now, the list of physical interfaces 
 in the hardware is limited to the following devices:
 .Xr ae 4 ,
 .Xr age 4 ,
+.Xr alc 4 ,
 .Xr ale 4 ,
 .Xr bce 4 ,
 .Xr bge 4 ,

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 02:25:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6397106564A;
	Wed, 10 Jun 2009 02:25:54 +0000 (UTC)
	(envelope-from pyunyh@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 8ED208FC0A;
	Wed, 10 Jun 2009 02:25:54 +0000 (UTC)
	(envelope-from pyunyh@gmail.com)
Received: by rv-out-0506.google.com with SMTP id k40so170867rvb.43
	for ; Tue, 09 Jun 2009 19:25:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:received:from:date:to:cc
	:subject:message-id:reply-to:references:mime-version:content-type
	:content-disposition:in-reply-to:user-agent;
	bh=z9HXfdg+63XzxJtnUBDNjy4aQJPJZ+Gaec2HzpG2Iik=;
	b=wezJDFmnaNJitLwd8grq5OAtbOQTsrGTjFNIytVfgsxHqJqvQ0q/t1RixqdX8+LIgD
	fUaloBG8zDyhPHEBJUGkxDBkYDm7J8n0xSAxNrsZRcZBrFXeZJlsgc7f3pNX1mINtmEN
	EUUNwAuvx1ued883o6ouTyrfUSRLdKTc0mFJ0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:date:to:cc:subject:message-id:reply-to:references:mime-version
	:content-type:content-disposition:in-reply-to:user-agent;
	b=TRQesL/VI1vzmSXE2EASy15+EUvAAcvoOLK7MPbZaFYXDKz6cOc1S0VDprjvRvgBOf
	O7Et9feuqLv+hzilhKN6IqxCLtpRC9kcMvMVZnOzC2JTYOfup78iUj9MlA7aFLexBlrR
	Dkpb0ES/02mp6dxV71KDP6jO9rmK31N8ID6Lg=
Received: by 10.141.43.19 with SMTP id v19mr694196rvj.226.1244600754177;
	Tue, 09 Jun 2009 19:25:54 -0700 (PDT)
Received: from michelle.cdnetworks.co.kr ([114.111.62.249])
	by mx.google.com with ESMTPS id g22sm18056907rvb.56.2009.06.09.19.25.51
	(version=SSLv3 cipher=RC4-MD5); Tue, 09 Jun 2009 19:25:53 -0700 (PDT)
Received: by michelle.cdnetworks.co.kr (sSMTP sendmail emulation);
	Wed, 10 Jun 2009 11:28:09 +0900
From: Pyun YongHyeon 
Date: Wed, 10 Jun 2009 11:28:09 +0900
To: Pyun YongHyeon 
Message-ID: <20090610022809.GC63941@michelle.cdnetworks.co.kr>
References: <200906100219.n5A2JshD090979@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200906100219.n5A2JshD090979@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193882 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: pyunyh@gmail.com
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 02:25:55 -0000

On Wed, Jun 10, 2009 at 02:19:54AM +0000, Pyun YongHyeon wrote:
> Author: yongari
> Date: Wed Jun 10 02:19:54 2009
> New Revision: 193882
> URL: http://svn.freebsd.org/changeset/base/193882
> 
> Log:
>   Add alc(4) man page and hook up ale(4) to the build.
                                    ^^^^^^
Of course it should be read as alc(4). Sorry.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 03:26:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A84E7106564A;
	Wed, 10 Jun 2009 03:26:21 +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 966948FC14;
	Wed, 10 Jun 2009 03:26:21 +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 n5A3QLNB092538;
	Wed, 10 Jun 2009 03:26:21 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A3QL4N092537;
	Wed, 10 Jun 2009 03:26:21 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200906100326.n5A3QL4N092537@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jun 2009 03:26:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193883 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 03:26:22 -0000

Author: yongari
Date: Wed Jun 10 03:26:21 2009
New Revision: 193883
URL: http://svn.freebsd.org/changeset/base/193883

Log:
  Fix typo.

Modified:
  head/usr.sbin/sysinstall/devices.c

Modified: head/usr.sbin/sysinstall/devices.c
==============================================================================
--- head/usr.sbin/sysinstall/devices.c	Wed Jun 10 02:19:54 2009	(r193882)
+++ head/usr.sbin/sysinstall/devices.c	Wed Jun 10 03:26:21 2009	(r193883)
@@ -91,7 +91,7 @@ static struct _devname {
     SERIAL("cuad%d",	"%s on device %s (COM%d)",		16),
     NETWORK("ae",	"Attansic/Atheros L2 Fast Ethernet"),
     NETWORK("age",	"Attansic/Atheros L1 Gigabit Ethernet"),
-    NETWORK("alc",	"Atheros AR8111/AR8132 PCIe Ethernet"),
+    NETWORK("alc",	"Atheros AR8131/AR8132 PCIe Ethernet"),
     NETWORK("ale",	"Atheros AR8121/AR8113/AR8114 PCIe Ethernet"),
     NETWORK("an",	"Aironet 4500/4800 802.11 wireless adapter"),
     NETWORK("ath",	"Atheros IEEE 802.11 wireless adapter"),

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 03:28:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60508106566C;
	Wed, 10 Jun 2009 03:28:34 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4ECC98FC12;
	Wed, 10 Jun 2009 03:28:34 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5A3SYCR092607;
	Wed, 10 Jun 2009 03:28:34 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A3SYnD092606;
	Wed, 10 Jun 2009 03:28:34 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200906100328.n5A3SYnD092606@svn.freebsd.org>
From: Sam Leffler 
Date: Wed, 10 Jun 2009 03:28:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193884 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 03:28:34 -0000

Author: sam
Date: Wed Jun 10 03:28:34 2009
New Revision: 193884
URL: http://svn.freebsd.org/changeset/base/193884

Log:
  iwn does not require a license ack

Modified:
  head/share/man/man4/iwn.4

Modified: head/share/man/man4/iwn.4
==============================================================================
--- head/share/man/man4/iwn.4	Wed Jun 10 03:26:21 2009	(r193883)
+++ head/share/man/man4/iwn.4	Wed Jun 10 03:28:34 2009	(r193884)
@@ -49,13 +49,6 @@ module at boot time, place the following
 .Bd -literal -offset indent
 if_iwn_load="YES"
 .Ed
-.Pp
-In both cases, place the following line in
-.Xr loader.conf 5
-to acknowledge the firmware license (see below):
-.Bd -literal -offset indent
-legal.intel_iwn.license_ack=1
-.Ed
 .Sh DESCRIPTION
 The
 .Nm
@@ -76,18 +69,6 @@ For more information on configuring this
 This driver requires the firmware built with the
 .Nm iwnfw
 module to work.
-For the loaded firmware to be enabled for use the license at
-.Pa /usr/share/doc/legal/intel_iwn/LICENSE
-must be agreed by adding the following line to
-.Xr loader.conf 5 :
-.Pp
-.Dl "legal.intel_iwn.license_ack=1"
-.Sh FILES
-.Bl -tag -width ".Pa /usr/share/doc/legal/intel_iwn/LICENSE" -compact
-.It Pa /usr/share/doc/legal/intel_iwn/LICENSE
-.Nm
-firmware license
-.El
 .Sh EXAMPLES
 Join an existing BSS network (i.e., connect to an access point):
 .Pp
@@ -130,9 +111,7 @@ The driver failed to load the firmware i
 subsystem.
 Verify the 
 .Xr iwnfw 4
-firmware module is installed and the license agreement
-.Xr loader 8
-tunable has been set.
+firmware module is present.
 .It "iwn%d: could not load boot firmware"
 An attempt to upload the boot firmware image to the onboard microcontroller
 failed.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 03:35:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 75B33106564A;
	Wed, 10 Jun 2009 03:35:40 +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 626358FC12;
	Wed, 10 Jun 2009 03:35:40 +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 n5A3ZeBl092792;
	Wed, 10 Jun 2009 03:35:40 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A3Ze0s092789;
	Wed, 10 Jun 2009 03:35:40 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200906100335.n5A3Ze0s092789@svn.freebsd.org>
From: Sam Leffler 
Date: Wed, 10 Jun 2009 03:35:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193885 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 03:35:40 -0000

Author: sam
Date: Wed Jun 10 03:35:40 2009
New Revision: 193885
URL: http://svn.freebsd.org/changeset/base/193885

Log:
  Marvell 88W8363 driver and associated firmware

Added:
  head/share/man/man4/mwl.4   (contents, props changed)
  head/share/man/man4/mwlfw.4   (contents, props changed)
Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/Makefile	Wed Jun 10 03:28:34 2009	(r193884)
+++ head/share/man/man4/Makefile	Wed Jun 10 03:35:40 2009	(r193885)
@@ -203,6 +203,8 @@ MAN=	aac.4 \
 	msk.4 \
 	mtio.4 \
 	multicast.4 \
+	mwl.4 \
+	mwlfw.4 \
 	mxge.4 \
 	my.4 \
 	natm.4 \

Added: head/share/man/man4/mwl.4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man4/mwl.4	Wed Jun 10 03:35:40 2009	(r193885)
@@ -0,0 +1,188 @@
+.\"-
+.\" Copyright (c) 2009 Sam Leffler, Errno Consulting
+.\" All rights reserved.
+.\""
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer,
+.\"    without modification.
+.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
+.\"    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+.\"    redistribution must be conditioned upon including a substantially
+.\"    similar Disclaimer requirement for further binary redistribution.
+.\"
+.\" NO WARRANTY
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+.\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+.\" THE POSSIBILITY OF SUCH DAMAGES.
+.\"
+.\" $FreeBSD$
+.\"/
+.Dd June 9, 2009
+.Dt MWL 4
+.Os
+.Sh NAME
+.Nm mwl
+.Nd "Marvell 88W8363 IEEE 802.11n wireless network driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device mwl"
+.Cd "device mwlfw"
+.Cd "device wlan"
+.Cd "device firmware"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_mwl_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for IEEE 802.11n wireless network adapters based on
+Marvell 88W8363 parts.
+PCI and/or CardBus interfaces are supported.
+.Pp
+This driver requires the firmware built with the
+.Nm mwlfw
+module to work.
+Normally this module is loaded on demand by the driver but it may
+also be compiled into the kernel.
+.Pp
+Supported features include 802.11n, power management, BSS,
+and host-based access point operation modes.
+All host/device interaction is via DMA.
+.Pp
+The
+.Nm
+driver encapsulates IP and ARP traffic as 802.11 frames, however
+it can receive either 802.11 or 802.3 frames.
+Devices support 802.11n, 802.11a, 802.11g, and 802.11b operation with
+transmit speeds appropriate to each.
+The actual transmit speed used is dependent on signal quality and the
+.Dq "rate control"
+algorithm implemented in the firmware.
+All chips have hardware support for WEP,
+AES-CCM, TKIP, and Michael cryptographic operations.
+.Pp
+The driver supports
+.Cm station ,
+.Cm hostap ,
+and
+.Cm wds
+mode operation.
+Multiple
+.Cm hostap
+virtual interfaces may be configured for simultaneous use.
+When multiple interfaces are configured each may have a separate
+mac address that is formed by setting the U/L bits in the mac
+address assigned to the underlying device.
+Any number of 
+.Cm wds
+virtual interfaces may be configured together with
+.Cm hostap
+interfaces.
+Multiple
+.Cm station
+interfaces may be operated together with 
+.Cm hostap
+interfaces to construct a wireless repeater device.
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Pp
+Devices supported by the
+.Nm
+driver come in either Cardbus or mini-PCI packages.
+Wireless cards in Cardbus slots may be inserted and ejected on the fly.
+.Sh EXAMPLES
+Join an existing BSS network (ie: connect to an access point):
+.Pp
+.Bd -literal -offset indent
+ifconfig wlan create wlandev mwl0 inet 192.168.0.20 \e
+	netmask 0xffffff00"
+.Ed
+.Pp
+Join a specific BSS network with network name
+.Dq Li my_net :
+.Pp
+.Bd -literal -offset indent
+ifconfig wlan create wlandev mwl0 inet 192.168.0.20 \e
+	netmask 0xffffff00 ssid my_net"
+.Ed
+.Pp
+Join a specific BSS network with WEP encryption:
+.Bd -literal -offset indent
+ifconfig wlan0 create wlandev mwl0
+ifconfig wlan0 inet 192.168.0.20 netmask 0xffffff00 ssid my_net \e
+	wepmode on wepkey 0x8736639624
+.Ed
+.Pp
+Create an 802.11g host-based access point:
+.Bd -literal -offset indent
+ifconfig wlan0 create wlandev mwl0 wlanmode hostap
+ifconfig wlan0 inet 192.168.0.10 netmask 0xffffff00 ssid my_ap \e
+	mode 11g
+.Ed
+.Pp
+Create two virtual 802.11a host-based access points, one with
+with WEP enabled and one with no security, and bridge them to
+the fxp0 (wired) device:
+.Bd -literal -offset indent
+ifconfig wlan0 create wlandev mwl0 wlanmode hostap \e
+	ssid paying-customers wepmode on wepkey 0x1234567890 \e
+	mode 11a up 
+ifconfig wlan1 create wlandev mwl0 wlanmode hostap bssid \e
+	ssid freeloaders up
+ifconfig bridge0 create addm wlan0 addm wlan1 addm fxp0 up
+.Ed
+.Sh DIAGNOSTICS
+.Bl -diag
+.It "mwl%d: unable to setup builtin firmware"
+There was a problem downloading and/or setting up the firmware.
+The device is not usable.
+.It "mwl%d: failed to setup descriptors: %d"
+There was a problem setting up the DMA data structures.
+This typically is caused by not being able to allocate contiguous memory.
+.It "mwl%d: transmit timeout"
+A frame dispatched to the hardware for transmission did not complete in time.
+This should not happen.
+.It "mwl%d: device not present"
+A cardbus device was ejected while active; the request to the firmware
+was not completed.
+.El
+.Sh SEE ALSO
+.Xr cardbus 4 ,
+.Xr intro 4 ,
+.Xr mwlfw 4 ,
+.Xr pci 4 ,
+.Xr wlan 4 ,
+.Xr wlan_ccmp 4 ,
+.Xr wlan_tkip 4 ,
+.Xr wlan_wep 4 ,
+.Xr wlan_xauth 4 ,
+.Xr hostapd 8 ,
+.Xr ifconfig 8 ,
+.Xr wpa_supplicant 8
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Fx 8.0 .
+.Sh BUGS
+The driver does not support power-save operation in station mode;
+consequently power use is suboptimal (e.g. on a laptop).

Added: head/share/man/man4/mwlfw.4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man4/mwlfw.4	Wed Jun 10 03:35:40 2009	(r193885)
@@ -0,0 +1,52 @@
+.\" Copyright (c) 2009 Sam Leffler, Errno Consulting
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. The name of the author may not be used to endorse or promote products
+.\"    derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 9, 2009
+.Dt MWLFW 4
+.Os
+.Sh NAME
+.Nm mwlfw
+.Nd "Firmware Module for Marvell 88W8363 Wireless driver"
+.Sh SYNOPSIS
+To compile this module into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device mwlfw"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+mwlfw_load="YES"
+.Ed
+.Sh DESCRIPTION
+This module provides access to firmware sets for the
+Marvell 88W8363 IEEE 802.11n wireless adapters.
+It may be
+statically linked into the kernel, or loaded as a module.
+.Sh SEE ALSO
+.Xr mwl 4 ,
+.Xr firmware 8

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 03:56:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9BB1A106567B;
	Wed, 10 Jun 2009 03:56:24 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8945E8FC18;
	Wed, 10 Jun 2009 03:56:24 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5A3uOKe093187;
	Wed, 10 Jun 2009 03:56:24 GMT (envelope-from ariff@svn.freebsd.org)
Received: (from ariff@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A3uOWj093185;
	Wed, 10 Jun 2009 03:56:24 GMT (envelope-from ariff@svn.freebsd.org)
Message-Id: <200906100356.n5A3uOWj093185@svn.freebsd.org>
From: Ariff Abdullah 
Date: Wed, 10 Jun 2009 03:56:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193886 - in head/sys: dev/sound/pcm sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 03:56:25 -0000

Author: ariff
Date: Wed Jun 10 03:56:24 2009
New Revision: 193886
URL: http://svn.freebsd.org/changeset/base/193886

Log:
  Move machine dependant AFMT_* definition from sound.h
  to global soundcard.h .

Modified:
  head/sys/dev/sound/pcm/sound.h
  head/sys/sys/soundcard.h

Modified: head/sys/dev/sound/pcm/sound.h
==============================================================================
--- head/sys/dev/sound/pcm/sound.h	Wed Jun 10 03:35:40 2009	(r193885)
+++ head/sys/dev/sound/pcm/sound.h	Wed Jun 10 03:56:24 2009	(r193886)
@@ -257,36 +257,6 @@ struct snd_mixer;
 #define AFMT_U8_NE	AFMT_U8
 #define AFMT_S8_NE	AFMT_S8
 
-#undef AFMT_S16_NE
-
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define AFMT_S16_NE	AFMT_S16_LE
-#define AFMT_S24_NE	AFMT_S24_LE
-#define AFMT_S32_NE	AFMT_S32_LE
-#define AFMT_U16_NE	AFMT_U16_LE
-#define AFMT_U24_NE	AFMT_U24_LE
-#define AFMT_U32_NE	AFMT_U32_LE
-#define AFMT_S16_OE	AFMT_S16_BE
-#define AFMT_S24_OE	AFMT_S24_BE
-#define AFMT_S32_OE	AFMT_S32_BE
-#define AFMT_U16_OE	AFMT_U16_BE
-#define AFMT_U24_OE	AFMT_U24_BE
-#define AFMT_U32_OE	AFMT_U32_BE
-#else
-#define AFMT_S16_OE	AFMT_S16_LE
-#define AFMT_S24_OE	AFMT_S24_LE
-#define AFMT_S32_OE	AFMT_S32_LE
-#define AFMT_U16_OE	AFMT_U16_LE
-#define AFMT_U24_OE	AFMT_U24_LE
-#define AFMT_U32_OE	AFMT_U32_LE
-#define AFMT_S16_NE	AFMT_S16_BE
-#define AFMT_S24_NE	AFMT_S24_BE
-#define AFMT_S32_NE	AFMT_S32_BE
-#define AFMT_U16_NE	AFMT_U16_BE
-#define AFMT_U24_NE	AFMT_U24_BE
-#define AFMT_U32_NE	AFMT_U32_BE
-#endif
-
 #define AFMT_SIGNED_NE	(AFMT_S8_NE | AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE)
 
 #define AFMT_NE		(AFMT_SIGNED_NE | AFMT_U8_NE | AFMT_U16_NE |	\

Modified: head/sys/sys/soundcard.h
==============================================================================
--- head/sys/sys/soundcard.h	Wed Jun 10 03:35:40 2009	(r193885)
+++ head/sys/sys/soundcard.h	Wed Jun 10 03:56:24 2009	(r193886)
@@ -171,12 +171,6 @@ struct snd_size {
 #define AFMT_MPEG	0x00000200	/* MPEG MP2/MP3 audio */
 #define AFMT_AC3	0x00000400	/* Dolby Digital AC3 */
 
-#if _BYTE_ORDER == _LITTLE_ENDIAN
-#define AFMT_S16_NE	AFMT_S16_LE	/* native endian signed 16 */
-#else
-#define AFMT_S16_NE	AFMT_S16_BE
-#endif
-
 /*
  * 32-bit formats below used for 24-bit audio data where the data is stored
  * in the 24 most significant bits and the least significant bits are not used
@@ -191,6 +185,35 @@ struct snd_size {
 #define AFMT_U24_LE	0x00040000	/* Little endian unsigned 24-bit */
 #define AFMT_U24_BE	0x00080000	/* Big endian unsigned 24-bit */
 
+/* Machine dependant AFMT_* definitions. */
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define AFMT_S16_NE	AFMT_S16_LE
+#define AFMT_S24_NE	AFMT_S24_LE
+#define AFMT_S32_NE	AFMT_S32_LE
+#define AFMT_U16_NE	AFMT_U16_LE
+#define AFMT_U24_NE	AFMT_U24_LE
+#define AFMT_U32_NE	AFMT_U32_LE
+#define AFMT_S16_OE	AFMT_S16_BE
+#define AFMT_S24_OE	AFMT_S24_BE
+#define AFMT_S32_OE	AFMT_S32_BE
+#define AFMT_U16_OE	AFMT_U16_BE
+#define AFMT_U24_OE	AFMT_U24_BE
+#define AFMT_U32_OE	AFMT_U32_BE
+#else
+#define AFMT_S16_OE	AFMT_S16_LE
+#define AFMT_S24_OE	AFMT_S24_LE
+#define AFMT_S32_OE	AFMT_S32_LE
+#define AFMT_U16_OE	AFMT_U16_LE
+#define AFMT_U24_OE	AFMT_U24_LE
+#define AFMT_U32_OE	AFMT_U32_LE
+#define AFMT_S16_NE	AFMT_S16_BE
+#define AFMT_S24_NE	AFMT_S24_BE
+#define AFMT_S32_NE	AFMT_S32_BE
+#define AFMT_U16_NE	AFMT_U16_BE
+#define AFMT_U24_NE	AFMT_U24_BE
+#define AFMT_U32_NE	AFMT_U32_BE
+#endif
+
 #define AFMT_STEREO	0x10000000	/* can do/want stereo	*/
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 04:18:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93FEE106564A;
	Wed, 10 Jun 2009 04:18:11 +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 8264C8FC17;
	Wed, 10 Jun 2009 04:18:11 +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 n5A4IB95093693;
	Wed, 10 Jun 2009 04:18:11 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A4IBOJ093692;
	Wed, 10 Jun 2009 04:18:11 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200906100418.n5A4IBOJ093692@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jun 2009 04:18:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193887 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 04:18:12 -0000

Author: yongari
Date: Wed Jun 10 04:18:11 2009
New Revision: 193887
URL: http://svn.freebsd.org/changeset/base/193887

Log:
  Oops, fix directory name.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 03:56:24 2009	(r193886)
+++ head/sys/conf/files	Wed Jun 10 04:18:11 2009	(r193887)
@@ -471,7 +471,7 @@ dev/aic7xxx/aic7xxx.c		optional ahc
 dev/aic7xxx/aic7xxx_93cx6.c	optional ahc
 dev/aic7xxx/aic7xxx_osm.c	optional ahc
 dev/aic7xxx/aic7xxx_pci.c	optional ahc pci
-dev/ale/if_alc.c		optional alc pci
+dev/alc/if_alc.c		optional alc pci
 dev/ale/if_ale.c		optional ale pci
 dev/amd/amd.c			optional amd
 dev/amr/amr.c			optional amr

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 06:16:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D23F7106564A;
	Wed, 10 Jun 2009 06:16:03 +0000 (UTC) (envelope-from marck@rinet.ru)
Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68])
	by mx1.freebsd.org (Postfix) with ESMTP id 523128FC15;
	Wed, 10 Jun 2009 06:15:58 +0000 (UTC) (envelope-from marck@rinet.ru)
Received: from localhost (localhost [127.0.0.1])
	by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id n5A6FvdJ050090;
	Wed, 10 Jun 2009 10:15:57 +0400 (MSD) (envelope-from marck@rinet.ru)
Date: Wed, 10 Jun 2009 10:15:57 +0400 (MSD)
From: Dmitry Morozovsky 
To: Kip Macy 
In-Reply-To: <200906100121.n5A1LWVO089719@svn.freebsd.org>
Message-ID: 
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
X-NCC-RegID: ru.rinet
X-OpenPGP-Key-ID: 6B691B03
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
	(woozle.rinet.ru [0.0.0.0]); Wed, 10 Jun 2009 10:15:57 +0400 (MSD)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193878 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 06:16:04 -0000

Kip,

On Wed, 10 Jun 2009, Kip Macy wrote:

KM> Author: kmacy
KM> Date: Wed Jun 10 01:21:32 2009
KM> New Revision: 193878
KM> URL: http://svn.freebsd.org/changeset/base/193878
KM> 
KM> Log:
KM>   As far as I can tell systems that have less than 4GB are more often hurt
KM>   by prefetched than helped.  On i386 systems and systems with less than 4GB,
KM>   prefetch is now disabled by default. I've added a prefetch enable tunable, to
KM>   enable prefetching for those systems. The prefetch disable tunable will continue
KM>   to unconditionally disable prefetching.
KM> 

[snip]

KM> +extern int zfs_prefetch_disable;
KM> +extern int zfs_prefetch_enable;

[snip]

Before the interface is not settled in stone, don't you think simple bool
zfs_prefetch tunable (defauled to what looks more reasonable to partucilar 
arch/memsize) is more clean and straightforward?


-- 
Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck@FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 06:24:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC4291065673;
	Wed, 10 Jun 2009 06:24:51 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247])
	by mx1.freebsd.org (Postfix) with ESMTP id 36CE28FC08;
	Wed, 10 Jun 2009 06:24:51 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: by an-out-0708.google.com with SMTP id c3so310142ana.13
	for ; Tue, 09 Jun 2009 23:24:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=5HfGBWZa9aqoSXv8WGQ8ovazVayoS7VrDIMyN9r3SaM=;
	b=YKRm4xUSs8Mhyw6z+o0tUPORTt3PdCKHhqNqMq7WGRQIXEhP5AnYtqxXBdJ8fWb0mT
	B4j5ctpuJiUstFkZUW4XJtfLsdOMbNddk1dUua1EJTFJY8xxNXpISRugN0Vnejx1KFYi
	FHqrisNxLUK4YtddTkp4XnTK7hn8hWh5mDsEY=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=e9MZh8coibP64vwb1aSrIKsU8/aB3Pcnzgv8CMA+ux2q4HI3IDMKF7z+Gwzpqt4VNv
	3JvOCP6HjdE3/MV8A3+IKnig65Jw6csU6MAYi9OyIivSrIzGsUl0pBVlzLdJFmKetZIF
	+1+vCd6/ENlmgU1ZqILoaJGJxi2d4+bGCKLO4=
MIME-Version: 1.0
Sender: mat.macy@gmail.com
Received: by 10.100.249.5 with SMTP id w5mr895789anh.28.1244615090406; Tue, 09 
	Jun 2009 23:24:50 -0700 (PDT)
In-Reply-To: 
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
	
Date: Tue, 9 Jun 2009 23:24:50 -0700
X-Google-Sender-Auth: 7e12a32e9ec42d11
Message-ID: <3c1674c90906092324n58e16154s6800e61752282e42@mail.gmail.com>
From: Kip Macy 
To: Dmitry Morozovsky 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193878 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 06:24:52 -0000

On Tue, Jun 9, 2009 at 11:15 PM, Dmitry Morozovsky wrote:
> Kip,
>
> On Wed, 10 Jun 2009, Kip Macy wrote:
>
> KM> Author: kmacy
> KM> Date: Wed Jun 10 01:21:32 2009
> KM> New Revision: 193878
> KM> URL: http://svn.freebsd.org/changeset/base/193878
> KM>
> KM> Log:
> KM> =A0 As far as I can tell systems that have less than 4GB are more oft=
en hurt
> KM> =A0 by prefetched than helped. =A0On i386 systems and systems with le=
ss than 4GB,
> KM> =A0 prefetch is now disabled by default. I've added a prefetch enable=
 tunable, to
> KM> =A0 enable prefetching for those systems. The prefetch disable tunabl=
e will continue
> KM> =A0 to unconditionally disable prefetching.
> KM>
>
> [snip]
>
> KM> +extern int zfs_prefetch_disable;
> KM> +extern int zfs_prefetch_enable;
>
> [snip]
>
> Before the interface is not settled in stone, don't you think simple bool
> zfs_prefetch tunable (defauled to what looks more reasonable to partucila=
r
> arch/memsize) is more clean and straightforward?
>

Yes. But the semantics I want don't lend themselves well to a boolean.
I want it to default to off for i386 and amd64 w/ < 4GB and on for
amd64 > 4GB. However, I want it to be possible for users with larger
memory systems to disable it and users with smaller memory systems to
enable it. The only way a simple boolean would work would be if it
were zfs_prefetch_non_default_behavior, which I think is even more
confusing than what I have now.


Cheers,
Kip

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 06:49:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B900106564A;
	Wed, 10 Jun 2009 06:49:46 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 26F548FC13;
	Wed, 10 Jun 2009 06:49:46 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5A6nkN7096558;
	Wed, 10 Jun 2009 06:49:46 GMT (envelope-from ariff@svn.freebsd.org)
Received: (from ariff@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A6njrZ096552;
	Wed, 10 Jun 2009 06:49:45 GMT (envelope-from ariff@svn.freebsd.org)
Message-Id: <200906100649.n5A6njrZ096552@svn.freebsd.org>
From: Ariff Abdullah 
Date: Wed, 10 Jun 2009 06:49: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: r193889 - in head/sys: conf modules/sound/sound tools
	tools/sound
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 06:49:46 -0000

Author: ariff
Date: Wed Jun 10 06:49:45 2009
New Revision: 193889
URL: http://svn.freebsd.org/changeset/base/193889

Log:
  Move all sound related scripts to its own 'sound' subdir.
  
  Suggested by:	jmallett

Added:
  head/sys/tools/sound/
  head/sys/tools/sound/emu10k1-mkalsa.sh
     - copied unchanged from r193887, head/sys/tools/emu10k1-mkalsa.sh
  head/sys/tools/sound/feeder_eq_mkfilter.awk
     - copied unchanged from r193887, head/sys/tools/feeder_eq_mkfilter.awk
  head/sys/tools/sound/feeder_rate_mkfilter.awk
     - copied unchanged from r193887, head/sys/tools/feeder_rate_mkfilter.awk
  head/sys/tools/sound/snd_fxdiv_gen.awk
     - copied unchanged from r193887, head/sys/tools/snd_fxdiv_gen.awk
Deleted:
  head/sys/tools/emu10k1-mkalsa.sh
  head/sys/tools/feeder_eq_mkfilter.awk
  head/sys/tools/feeder_rate_mkfilter.awk
  head/sys/tools/snd_fxdiv_gen.awk
Modified:
  head/sys/conf/files
  head/sys/modules/sound/sound/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 05:26:21 2009	(r193888)
+++ head/sys/conf/files	Wed Jun 10 06:49:45 2009	(r193889)
@@ -51,33 +51,33 @@ aic79xx_reg_print.o		optional ahd pci ah
 	compile-with	"${NORMAL_C}"					   \
 	no-implicit-rule local
 emu10k1-alsa%diked.h		optional snd_emu10k1 | snd_emu10kx	   \
-	dependency	"$S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \
-	compile-with	"CC='${CC}' AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \
+	dependency	"$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \
+	compile-with	"CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"emu10k1-alsa%diked.h"
 p16v-alsa%diked.h		optional snd_emu10kx pci			   \
-	dependency	"$S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h" \
-	compile-with	"CC='${CC}' AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h p16v-alsa%diked.h" \
+	dependency	"$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h" \
+	compile-with	"CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h p16v-alsa%diked.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"p16v-alsa%diked.h"
 p17v-alsa%diked.h		optional snd_emu10kx pci			   \
-	dependency	"$S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h" \
-	compile-with	"CC='${CC}' AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h p17v-alsa%diked.h" \
+	dependency	"$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h" \
+	compile-with	"CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h p17v-alsa%diked.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"p17v-alsa%diked.h"
 feeder_eq_gen.h			optional sound				   \
-	dependency	"$S/tools/feeder_eq_mkfilter.awk"		   \
-	compile-with	"${AWK} -f $S/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > feeder_eq_gen.h" \
+	dependency	"$S/tools/sound/feeder_eq_mkfilter.awk"		   \
+	compile-with	"${AWK} -f $S/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > feeder_eq_gen.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"feeder_eq_gen.h"
 feeder_rate_gen.h		optional sound				   \
-	dependency	"$S/tools/feeder_rate_mkfilter.awk"		   \
-	compile-with	"${AWK} -f $S/tools/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > feeder_rate_gen.h" \
+	dependency	"$S/tools/sound/feeder_rate_mkfilter.awk"		   \
+	compile-with	"${AWK} -f $S/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > feeder_rate_gen.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"feeder_rate_gen.h"
 snd_fxdiv_gen.h			optional sound				   \
-	dependency	"$S/tools/snd_fxdiv_gen.awk"			   \
-	compile-with	"${AWK} -f $S/tools/snd_fxdiv_gen.awk -- > snd_fxdiv_gen.h" \
+	dependency	"$S/tools/sound/snd_fxdiv_gen.awk"			   \
+	compile-with	"${AWK} -f $S/tools/sound/snd_fxdiv_gen.awk -- > snd_fxdiv_gen.h" \
 	no-obj no-implicit-rule before-depend				   \
 	clean		"snd_fxdiv_gen.h"
 miidevs.h			optional miibus | mii			   \

Modified: head/sys/modules/sound/sound/Makefile
==============================================================================
--- head/sys/modules/sound/sound/Makefile	Wed Jun 10 05:26:21 2009	(r193888)
+++ head/sys/modules/sound/sound/Makefile	Wed Jun 10 06:49:45 2009	(r193889)
@@ -19,14 +19,14 @@ SRCS+=	ac97.c ac97_patch.c buffer.c chan
 SRCS+=	mixer.c sndstat.c sound.c unit.c vchan.c
 SRCS+=	midi.c mpu401.c sequencer.c
 
-feeder_eq_gen.h:	@ @/tools/feeder_eq_mkfilter.awk machine
-	${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
+feeder_eq_gen.h:	@ @/tools/sound/feeder_eq_mkfilter.awk machine
+	${AWK} -f @/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
 
-feeder_rate_gen.h:	@ @/tools/feeder_rate_mkfilter.awk machine
-	${AWK} -f @/tools/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
+feeder_rate_gen.h:	@ @/tools/sound/feeder_rate_mkfilter.awk machine
+	${AWK} -f @/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
 
-snd_fxdiv_gen.h:	@ @/tools/snd_fxdiv_gen.awk machine
-	${AWK} -f @/tools/snd_fxdiv_gen.awk -- > ${.TARGET}
+snd_fxdiv_gen.h:	@ @/tools/sound/snd_fxdiv_gen.awk machine
+	${AWK} -f @/tools/sound/snd_fxdiv_gen.awk -- > ${.TARGET}
 
 CLEANFILES+=	feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h
 

Copied: head/sys/tools/sound/emu10k1-mkalsa.sh (from r193887, head/sys/tools/emu10k1-mkalsa.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/tools/sound/emu10k1-mkalsa.sh	Wed Jun 10 06:49:45 2009	(r193889, copy of r193887, head/sys/tools/emu10k1-mkalsa.sh)
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+GREP=${GREP:-grep}
+CC=${CC:-cc}
+AWK=${AWK:-awk}
+MV=${MV:=mv}
+RM=${RM:=rm}
+IN=$1
+OUT=$2
+
+trap "${RM} -f $OUT.tmp" EXIT
+
+$GREP -v '#include' $IN | \
+$CC -E -D__KERNEL__ -dM -  | \
+$AWK -F"[     (]" '
+/define/  {
+	print "#ifndef " $2;
+	print;
+	print "#endif";
+}' > $OUT.tmp
+${MV} -f $OUT.tmp $OUT

Copied: head/sys/tools/sound/feeder_eq_mkfilter.awk (from r193887, head/sys/tools/feeder_eq_mkfilter.awk)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/tools/sound/feeder_eq_mkfilter.awk	Wed Jun 10 06:49:45 2009	(r193889, copy of r193887, head/sys/tools/feeder_eq_mkfilter.awk)
@@ -0,0 +1,467 @@
+#!/usr/bin/awk -f
+#
+# Copyright (c) 2008-2009 Ariff Abdullah 
+# 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$
+#
+
+#
+# Biquad coefficients generator for Parametric Software Equalizer. Not as ugly
+# as 'feeder_rate_mkfilter.awk'
+#
+# Based on:
+#
+#  "Cookbook formulae for audio EQ biquad filter coefficients"
+#    by Robert Bristow-Johnson  
+#
+#    -  http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
+#
+
+
+
+#
+# Some basic Math functions.
+#
+function abs(x)
+{
+	return (((x < 0) ? -x : x) + 0);
+}
+
+function fabs(x)
+{
+	return (((x < 0.0) ? -x : x) + 0.0);
+}
+
+function floor(x, r)
+{
+	r = int(x);
+	if (r > x)
+		r--;
+	return (r + 0);
+}
+
+function pow(x, y)
+{
+	return (exp(1.0 * y * log(1.0 * x)));
+}
+
+#
+# What the hell...
+#
+function shl(x, y)
+{
+	while (y > 0) {
+		x *= 2;
+		y--;
+	}
+	return (x);
+}
+
+function feedeq_w0(fc, rate)
+{
+	return ((2.0 * M_PI * fc) / (1.0 * rate));
+}
+
+function feedeq_A(gain, A)
+{
+	if (FEEDEQ_TYPE == FEEDEQ_TYPE_PEQ || FEEDEQ_TYPE == FEEDEQ_TYPE_SHELF)
+		A = pow(10, gain / 40.0);
+	else
+		A = sqrt(pow(10, gain / 20.0));
+
+	return (A);
+}
+
+function feedeq_alpha(w0, A, QS)
+{
+	if (FEEDEQ_TYPE == FEEDEQ_TYPE_PEQ)
+		alpha = sin(w0) / (2.0 * QS);
+	else if (FEEDEQ_TYPE == FEEDEQ_TYPE_SHELF)
+		alpha = sin(w0) * 0.5 * sqrt(A + ((1.0 / A) *		\
+		    ((1.0 / QS) - 1.0)) + 2.0);
+	else
+		alpha = 0.0;
+
+	return (alpha);
+}
+
+function feedeq_fx_floor(v, r)
+{
+	if (fabs(v) < fabs(smallest))
+		smallest = v;
+	if (fabs(v) > fabs(largest))
+		largest = v;
+
+	r = floor((v * FEEDEQ_COEFF_ONE) + 0.5);
+
+	if (r < INT32_MIN || r > INT32_MAX)
+		printf("\n#error overflow v=%f, "			\
+		    "please reduce FEEDEQ_COEFF_SHIFT\n", v);
+
+	return (r);
+}
+
+function feedeq_gen_biquad_coeffs(coeffs, rate, gain,			\
+    w0, A, alpha, a0, a1, a2, b0, b1, b2)
+{
+	w0    = feedeq_w0(FEEDEQ_TREBLE_SFREQ, 1.0 * rate);
+	A     = feedeq_A(1.0 * gain);
+	alpha = feedeq_alpha(w0, A, FEEDEQ_TREBLE_SLOPE);
+
+	if (FEEDEQ_TYPE == FEEDEQ_TYPE_PEQ) {
+		b0 =  1.0 + (alpha * A);
+		b1 = -2.0 * cos(w0);
+		b2 =  1.0 - (alpha * A);
+		a0 =  1.0 + (alpha / A);
+		a1 = -2.0 * cos(w0);
+		a2 =  1.0 - (alpha / A);
+	} else if (FEEDEQ_TYPE == FEEDEQ_TYPE_SHELF) {
+		b0 =      A*((A+1.0)+((A-1.0)*cos(w0))+(2.0*sqrt(A)*alpha));
+		b1 = -2.0*A*((A-1.0)+((A+1.0)*cos(w0))                    );
+		b2 =      A*((A+1.0)+((A-1.0)*cos(w0))-(2.0*sqrt(A)*alpha));
+		a0 =         (A+1.0)-((A-1.0)*cos(w0))+(2.0*sqrt(A)*alpha );
+		a1 =  2.0 * ((A-1.0)-((A+1.0)*cos(w0))                    );
+		a2 =         (A+1.0)-((A-1.0)*cos(w0))-(2.0*sqrt(A)*alpha );
+	} else
+		b0 = b1 = b2 = a0 = a1 = a2 = 0.0;
+
+	b0 /= a0;
+	b1 /= a0;
+	b2 /= a0;
+	a1 /= a0;
+	a2 /= a0;
+
+	coeffs["treble", gain, 0] = feedeq_fx_floor(a0);
+	coeffs["treble", gain, 1] = feedeq_fx_floor(a1);
+	coeffs["treble", gain, 2] = feedeq_fx_floor(a2);
+	coeffs["treble", gain, 3] = feedeq_fx_floor(b0);
+	coeffs["treble", gain, 4] = feedeq_fx_floor(b1);
+	coeffs["treble", gain, 5] = feedeq_fx_floor(b2);
+
+	w0    = feedeq_w0(FEEDEQ_BASS_SFREQ, 1.0 * rate);
+	A     = feedeq_A(1.0 * gain);
+	alpha = feedeq_alpha(w0, A, FEEDEQ_BASS_SLOPE);
+
+	if (FEEDEQ_TYPE == FEEDEQ_TYPE_PEQ) {
+		b0 =  1.0 + (alpha * A);
+		b1 = -2.0 * cos(w0);
+		b2 =  1.0 - (alpha * A);
+		a0 =  1.0 + (alpha / A);
+		a1 = -2.0 * cos(w0);
+		a2 =  1.0 - (alpha / A);
+	} else if (FEEDEQ_TYPE == FEEDEQ_TYPE_SHELF) {
+		b0 =      A*((A+1.0)-((A-1.0)*cos(w0))+(2.0*sqrt(A)*alpha));
+		b1 =  2.0*A*((A-1.0)-((A+1.0)*cos(w0))                    );
+		b2 =      A*((A+1.0)-((A-1.0)*cos(w0))-(2.0*sqrt(A)*alpha));
+		a0 =         (A+1.0)+((A-1.0)*cos(w0))+(2.0*sqrt(A)*alpha );
+		a1 = -2.0 * ((A-1.0)+((A+1.0)*cos(w0))                    );
+		a2 =         (A+1.0)+((A-1.0)*cos(w0))-(2.0*sqrt(A)*alpha );
+	} else
+		b0 = b1 = b2 = a0 = a1 = a2 = 0.0;
+
+	b0 /= a0;
+	b1 /= a0;
+	b2 /= a0;
+	a1 /= a0;
+	a2 /= a0;
+
+	coeffs["bass", gain, 0] = feedeq_fx_floor(a0);
+	coeffs["bass", gain, 1] = feedeq_fx_floor(a1);
+	coeffs["bass", gain, 2] = feedeq_fx_floor(a2);
+	coeffs["bass", gain, 3] = feedeq_fx_floor(b0);
+	coeffs["bass", gain, 4] = feedeq_fx_floor(b1);
+	coeffs["bass", gain, 5] = feedeq_fx_floor(b2);
+}
+
+function feedeq_gen_freq_coeffs(frq, g, i, v)
+{
+	coeffs[0] = 0;
+
+	for (g = (FEEDEQ_GAIN_MIN * FEEDEQ_GAIN_DIV);			\
+	    g <= (FEEDEQ_GAIN_MAX * FEEDEQ_GAIN_DIV);			\
+	    g += FEEDEQ_GAIN_STEP) {
+		feedeq_gen_biquad_coeffs(coeffs, frq,			\
+		    g * FEEDEQ_GAIN_RECIPROCAL);
+	}
+
+	printf("\nstatic struct feed_eq_coeff eq_%d[%d] "		\
+	    "= {\n", frq, FEEDEQ_LEVELS);
+	for (g = (FEEDEQ_GAIN_MIN * FEEDEQ_GAIN_DIV);			\
+	    g <= (FEEDEQ_GAIN_MAX * FEEDEQ_GAIN_DIV);			\
+	    g += FEEDEQ_GAIN_STEP) {
+		printf("     {{ ");
+		for (i = 1; i < 6; i++) {
+			v = coeffs["treble", g * FEEDEQ_GAIN_RECIPROCAL, i];
+			printf("%s0x%08x%s",				\
+			    (v < 0) ? "-" : " ", abs(v),		\
+			    (i == 5) ? " " : ", ");
+		}
+		printf("},\n      { ");
+		for (i = 1; i < 6; i++) {
+			v = coeffs["bass", g * FEEDEQ_GAIN_RECIPROCAL, i];
+			printf("%s0x%08x%s",				\
+			    (v < 0) ? "-" : " ", abs(v),		\
+			    (i == 5) ? " " : ", ");
+		}
+		printf("}}%s\n",					\
+		    (g < (FEEDEQ_GAIN_MAX * FEEDEQ_GAIN_DIV)) ? "," : "");
+	}
+	printf("};\n");
+}
+
+function feedeq_calc_preamp(norm, gain, shift, mul, bit, attn)
+{
+	shift = FEEDEQ_PREAMP_SHIFT;
+
+	if (floor(FEEDEQ_PREAMP_BITDB) == 6 &&				\
+	    (1.0 * floor(gain)) == gain && (floor(gain) % 6) == 0) {
+		mul = 1;
+		shift = floor(floor(gain) / 6);
+	} else {
+		bit = 32.0 - ((1.0 * gain) / (1.0 * FEEDEQ_PREAMP_BITDB));
+		attn = pow(2.0, bit) / pow(2.0, 32.0);
+		mul = floor((attn * FEEDEQ_PREAMP_ONE) + 0.5);
+	}
+
+	while ((mul % 2) == 0 && shift > 0) {
+		mul = floor(mul / 2);
+		shift--;
+	}
+
+	norm["mul"] = mul;
+	norm["shift"] = shift;
+}
+
+BEGIN {
+	M_PI = atan2(0.0, -1.0);
+
+	INT32_MAX = 1 + ((shl(1, 30) - 1) * 2);
+	INT32_MIN = -1 - INT32_MAX;
+
+	FEEDEQ_TYPE_PEQ   = 0;
+	FEEDEQ_TYPE_SHELF = 1;
+
+	FEEDEQ_TYPE       = FEEDEQ_TYPE_PEQ;
+
+	FEEDEQ_COEFF_SHIFT = 24;
+	FEEDEQ_COEFF_ONE   = shl(1, FEEDEQ_COEFF_SHIFT);
+
+	FEEDEQ_PREAMP_SHIFT = 31;
+	FEEDEQ_PREAMP_ONE   = shl(1, FEEDEQ_PREAMP_SHIFT);
+	FEEDEQ_PREAMP_BITDB = 6; # 20.0 * (log(2.0) / log(10.0));
+
+	FEEDEQ_GAIN_DIV   = 10;
+	i = 0;
+	j = 1;
+	while (j < FEEDEQ_GAIN_DIV) {
+		j *= 2;
+		i++;
+	}
+	FEEDEQ_GAIN_SHIFT = i;
+	FEEDEQ_GAIN_FMASK = shl(1, FEEDEQ_GAIN_SHIFT) - 1;
+
+	FEEDEQ_GAIN_RECIPROCAL = 1.0 / FEEDEQ_GAIN_DIV;
+
+	if (ARGC == 2) {
+		i = 1;
+		split(ARGV[1], arg, ":");
+		while (match(arg[i], "^[^0-9]*$")) {
+			if (arg[i] == "PEQ") {
+				FEEDEQ_TYPE = FEEDEQ_TYPE_PEQ;
+			} else if (arg[i] == "SHELF") {
+				FEEDEQ_TYPE = FEEDEQ_TYPE_SHELF;
+			}
+			i++;
+		}
+		split(arg[i++], subarg, ",");
+		FEEDEQ_TREBLE_SFREQ = 1.0 * subarg[1];
+		FEEDEQ_TREBLE_SLOPE = 1.0 * subarg[2];
+		split(arg[i++], subarg, ",");
+		FEEDEQ_BASS_SFREQ = 1.0 * subarg[1];
+		FEEDEQ_BASS_SLOPE = 1.0 * subarg[2];
+		split(arg[i++], subarg, ",");
+		FEEDEQ_GAIN_MIN = floor(1.0 * subarg[1]);
+		FEEDEQ_GAIN_MAX = floor(1.0 * subarg[2]);
+		if (length(subarg) > 2) {
+			j = floor(1.0 * FEEDEQ_GAIN_DIV * subarg[3]);
+			if (j < 2)
+				j = 1;
+			else if (j < 5)
+				j = 2;
+			else if (j < 10)
+				j = 5;
+			else
+				j = 10;
+			if (j > FEEDEQ_GAIN_DIV || (FEEDEQ_GAIN_DIV % j) != 0)
+				j = FEEDEQ_GAIN_DIV;
+			FEEDEQ_GAIN_STEP = j;
+		} else
+			FEEDEQ_GAIN_STEP = FEEDEQ_GAIN_DIV;
+		split(arg[i], subarg, ",");
+		for (i = 1; i <= length(subarg); i++)
+			allfreq[i - 1] = floor(1.0 * subarg[i]);
+	} else {
+		FEEDEQ_TREBLE_SFREQ  = 16000.0;
+		FEEDEQ_TREBLE_SLOPE  = 0.25;
+		FEEDEQ_BASS_SFREQ    = 62.0;
+		FEEDEQ_BASS_SLOPE    = 0.25;
+
+		FEEDEQ_GAIN_MIN  = -9;
+		FEEDEQ_GAIN_MAX  = 9;
+
+		FEEDEQ_GAIN_STEP = FEEDEQ_GAIN_DIV;
+
+
+		allfreq[0] = 44100;
+		allfreq[1] = 48000;
+		allfreq[2] = 88200;
+		allfreq[3] = 96000;
+		allfreq[4] = 176400;
+		allfreq[5] = 192000;
+	}
+
+	FEEDEQ_LEVELS = ((FEEDEQ_GAIN_MAX - FEEDEQ_GAIN_MIN) *		\
+	    floor(FEEDEQ_GAIN_DIV / FEEDEQ_GAIN_STEP)) + 1;
+
+	FEEDEQ_ERR_CLIP = 0;
+
+	smallest = 10.000000;
+	largest  =  0.000010;
+
+	printf("#ifndef _FEEDER_EQ_GEN_H_\n");
+	printf("#define _FEEDER_EQ_GEN_H_\n\n");
+	printf("/*\n");
+	printf(" * Generated using feeder_eq_mkfilter.awk, heaven, wind and awesome.\n");
+	printf(" *\n");
+	printf(" * DO NOT EDIT!\n");
+	printf(" */\n\n");
+	printf("/*\n");
+	printf(" * EQ: %s\n", (FEEDEQ_TYPE == FEEDEQ_TYPE_SHELF) ?	\
+	    "Shelving" : "Peaking EQ");
+	printf(" */\n");
+	printf("#define FEEDER_EQ_PRESETS\t\"");
+	printf("%s:%d,%.4f,%d,%.4f:%d,%d,%.1f:",			\
+	    (FEEDEQ_TYPE == FEEDEQ_TYPE_SHELF) ? "SHELF" : "PEQ",	\
+	    FEEDEQ_TREBLE_SFREQ, FEEDEQ_TREBLE_SLOPE,			\
+	    FEEDEQ_BASS_SFREQ, FEEDEQ_BASS_SLOPE,			\
+	    FEEDEQ_GAIN_MIN, FEEDEQ_GAIN_MAX,				\
+	    FEEDEQ_GAIN_STEP * FEEDEQ_GAIN_RECIPROCAL);
+	for (i = 0; i < length(allfreq); i++) {
+		if (i != 0)
+			printf(",");
+		printf("%d", allfreq[i]);
+	}
+	printf("\"\n\n");
+	printf("struct feed_eq_coeff_tone {\n");
+	printf("\tint32_t a1, a2;\n");
+	printf("\tint32_t b0, b1, b2;\n");
+	printf("};\n\n");
+	printf("struct feed_eq_coeff {\n");
+	#printf("\tstruct {\n");
+	#printf("\t\tint32_t a1, a2;\n");
+	#printf("\t\tint32_t b0, b1, b2;\n");
+	#printf("\t} treble, bass;\n");
+	printf("\tstruct feed_eq_coeff_tone treble;\n");
+	printf("\tstruct feed_eq_coeff_tone bass;\n");
+	#printf("\tstruct {\n");
+	#printf("\t\tint32_t a1, a2;\n");
+	#printf("\t\tint32_t b0, b1, b2;\n");
+	#printf("\t} bass;\n");
+	printf("};\n");
+	for (i = 0; i < length(allfreq); i++)
+		feedeq_gen_freq_coeffs(allfreq[i]);
+	printf("\n");
+	printf("static const struct {\n");
+	printf("\tuint32_t rate;\n");
+	printf("\tstruct feed_eq_coeff *coeff;\n");
+	printf("} feed_eq_tab[] = {\n");
+	for (i = 0; i < length(allfreq); i++) {
+		printf("\t{ %6d, eq_%-6d },\n", allfreq[i], allfreq[i]);
+	}
+	printf("};\n");
+
+	printf("\n#define FEEDEQ_RATE_MIN\t\t%d\n", allfreq[0]);
+	printf("#define FEEDEQ_RATE_MAX\t\t%d\n", allfreq[length(allfreq) - 1]);
+	printf("\n#define FEEDEQ_TAB_SIZE\t\t\t\t\t\t\t\\\n");
+	printf("\t((int32_t)(sizeof(feed_eq_tab) / sizeof(feed_eq_tab[0])))\n");
+
+	printf("\nstatic const struct {\n");
+	printf("\tint32_t mul, shift;\n");
+	printf("} feed_eq_preamp[] = {\n");
+	for (i = (FEEDEQ_GAIN_MAX * 2 * FEEDEQ_GAIN_DIV); i >= 0;	\
+	    i -= FEEDEQ_GAIN_STEP) {
+		feedeq_calc_preamp(norm, i * FEEDEQ_GAIN_RECIPROCAL);
+		dbgain = ((FEEDEQ_GAIN_MAX * FEEDEQ_GAIN_DIV) - i) *	\
+		    FEEDEQ_GAIN_RECIPROCAL;
+		printf("\t{ 0x%08x, 0x%08x },\t/* %+5.1f dB */\n",	\
+		    norm["mul"], norm["shift"], dbgain);
+	}
+	printf("};\n");
+
+	printf("\n#define FEEDEQ_GAIN_MIN\t\t%d", FEEDEQ_GAIN_MIN);
+	printf("\n#define FEEDEQ_GAIN_MAX\t\t%d\n", FEEDEQ_GAIN_MAX);
+
+	printf("\n#define FEEDEQ_GAIN_SHIFT\t%d\n", FEEDEQ_GAIN_SHIFT);
+	printf("#define FEEDEQ_GAIN_DIV\t\t%d\n", FEEDEQ_GAIN_DIV);
+	printf("#define FEEDEQ_GAIN_FMASK\t0x%08x\n", FEEDEQ_GAIN_FMASK);
+	printf("#define FEEDEQ_GAIN_STEP\t%d\n", FEEDEQ_GAIN_STEP);
+
+	#printf("\n#define FEEDEQ_PREAMP_MIN\t-%d\n",			\
+	#    shl(FEEDEQ_GAIN_MAX, FEEDEQ_GAIN_SHIFT));
+	#printf("#define FEEDEQ_PREAMP_MAX\t%d\n",			\
+	#    shl(FEEDEQ_GAIN_MAX, FEEDEQ_GAIN_SHIFT));
+
+	printf("\n#define FEEDEQ_COEFF_SHIFT\t%d\n", FEEDEQ_COEFF_SHIFT);
+
+	#feedeq_calc_preamp(norm, FEEDEQ_GAIN_MAX);
+
+	#printf("#define FEEDEQ_COEFF_NORM(v)\t(");
+	#if (norm["mul"] == 1)
+	#	printf("(v) >> %d", norm["shift"]);
+	#else
+	#	printf("(0x%xLL * (v)) >> %d", norm["mul"], norm["shift"]);
+	#printf(")\n");
+
+	#printf("\n#define FEEDEQ_LEVELS\t\t%d\n", FEEDEQ_LEVELS);
+	if (FEEDEQ_ERR_CLIP != 0)
+		printf("\n#define FEEDEQ_ERR_CLIP\t\t%d\n", FEEDEQ_ERR_CLIP);
+	printf("\n/*\n");
+	printf(" * volume level mapping (0 - 100):\n");
+	printf(" *\n");
+
+	for (i = 0; i <= 100; i++) {
+		ind = floor((i * FEEDEQ_LEVELS) / 100);
+		if (ind >= FEEDEQ_LEVELS)
+			ind = FEEDEQ_LEVELS - 1;
+		printf(" *\t%3d  ->  %3d (%+5.1f dB)\n",		\
+		    i, ind, FEEDEQ_GAIN_MIN +				\
+		    (ind * (FEEDEQ_GAIN_RECIPROCAL * FEEDEQ_GAIN_STEP)));
+	}
+
+	printf(" */\n");
+	printf("\n/*\n * smallest: %.32f\n *  largest: %.32f\n */\n",	\
+	    smallest, largest);
+	printf("\n#endif\t/* !_FEEDER_EQ_GEN_H_ */\n");
+}

Copied: head/sys/tools/sound/feeder_rate_mkfilter.awk (from r193887, head/sys/tools/feeder_rate_mkfilter.awk)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/tools/sound/feeder_rate_mkfilter.awk	Wed Jun 10 06:49:45 2009	(r193889, copy of r193887, head/sys/tools/feeder_rate_mkfilter.awk)
@@ -0,0 +1,767 @@
+#!/usr/bin/awk -f
+#
+# Copyright (c) 2007-2009 Ariff Abdullah 
+# 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$
+#
+
+#
+# FIR filter design by windowing method. This might become one of the
+# funniest joke I've ever written due to too many tricks being applied to
+# ensure maximum precision (well, in fact this is already have the same
+# precision granularity compared to its C counterpart). Nevertheless, it's
+# working, precise, dynamically tunable based on "presets".
+#
+# XXX EXPECT TOTAL REWRITE! DON'T ARGUE!
+#
+# TODO: Using ultraspherical window might be a good idea.
+#
+# Based on:
+#
+# "Digital Audio Resampling" by Julius O. Smith III
+#
+#  - http://ccrma.stanford.edu/~jos/resample/
+#
+
+#
+# Some basic Math functions.
+#
+function abs(x)
+{
+	return (((x < 0) ? -x : x) + 0);
+}
+
+function fabs(x)
+{
+	return (((x < 0.0) ? -x : x) + 0.0);
+}
+
+function ceil(x, r)
+{
+	r = int(x);
+	if (r < x)
+		r++;
+	return (r + 0);
+}
+
+function floor(x, r)
+{
+	r = int(x);
+	if (r > x)
+		r--;
+	return (r + 0);
+}
+
+function pow(x, y)
+{
+	return (exp(1.0 * y * log(1.0 * x)));
+}
+
+#
+# What the hell...
+#
+function shl(x, y)
+{
+	while (y > 0) {
+		x *= 2;
+		y--;
+	}
+	return (x);
+}
+
+function shr(x, y)
+{
+	while (y > 0 && x != 0) {
+		x = floor(x / 2);
+		y--;
+	}
+	return (x);
+}
+
+function fx_floor(v, o, r)
+{
+	if (fabs(v) < fabs(smallest))
+		smallest = v;
+	if (fabs(v) > fabs(largest))
+		largest = v;
+
+	r = floor((v * o) + 0.5);
+	if (r < INT32_MIN || r > INT32_MAX)
+		printf("\n#error overflow v=%f, please reduce %d\n", v, o);
+
+	return (r);
+}
+
+#
+# Kaiser linear piecewise functions.
+#
+function kaiserAttn2Beta(attn, beta)
+{
+	if (attn < 0.0)
+		return (Z_KAISER_BETA_DEFAULT);
+
+	if (attn > 50.0)
+		beta = 0.1102 * ((1.0 * attn) - 8.7);
+	else if (attn > 21.0)
+		beta = (0.5842 * pow((1.0 * attn) - 21.0, 0.4)) +	\
+		    (0.07886 * ((1.0 * attn) - 21.0));
+	else
+		beta = 0.0;
+
+	return (beta);
+}
+
+function kaiserBeta2Attn(beta, x, y, i, attn, xbeta)
+{
+	if (beta < Z_WINDOW_KAISER)
+		return (Z_KAISER_ATTN_DEFAULT);
+	
+	if (beta > kaiserAttn2Beta(50.0))
+		attn = ((1.0 * beta) / 0.1102) + 8.7;
+	else {
+		x = 21.0;
+		y = 50.0;
+		attn = 0.5 * (x + y);
+		for (i = 0; i < 128; i++) {
+			xbeta = kaiserAttn2Beta(attn)
+			if (beta == xbeta ||				\
+			    (i > 63 &&					\
+			    fabs(beta - xbeta) < Z_KAISER_EPSILON))
+				break;
+			if (beta > xbeta)
+				x = attn;
+			else
+				y = attn;
+			attn = 0.5 * (x + y);
+		}
+	}
+
+	return (attn);
+}
+
+function kaiserRolloff(len, attn)
+{
+	return (1.0 - (((1.0 * attn) - 7.95) / (((1.0 * len) - 1.0) * 14.36)));
+}
+
+#
+# 0th order modified Bessel function of the first kind.
+#
+function I0(x, s, u, n, h, t)
+{
+	s = n = u = 1.0;
+	h = x * 0.5;
+
+	do {
+		t = h / n;
+		n += 1.0;
+		t *= t;
+		u *= t;
+		s += u;
+	} while (u >= (I0_EPSILON * s));
+
+	return (s);
+}
+
+function wname(beta)
+{
+	if (beta >= Z_WINDOW_KAISER)
+		return ("Kaiser");
+	else if (beta == Z_WINDOW_BLACKMAN_NUTTALL)
+		return ("Blackman - Nuttall");
+	else if (beta == Z_WINDOW_NUTTALL)
+		return ("Nuttall");
+	else if (beta == Z_WINDOW_BLACKMAN_HARRIS)
+		return ("Blackman - Harris");
+	else if (beta == Z_WINDOW_BLACKMAN)
+		return ("Blackman");
+	else if (beta == Z_WINDOW_HAMMING)
+		return ("Hamming");
+	else if (beta == Z_WINDOW_HANN)
+		return ("Hann");
+	else
+		return ("What The Hell !?!?");
+}
+
+function rolloff_round(x)
+{
+	if (x < 0.67)
+		x = 0.67;
+	else if (x > 1.0)
+		x = 1.0;
+	
+	return (x);
+}
+
+function tap_round(x, y)
+{
+	y = floor(x + 3);
+	y -= y % 4;
+	return (y);
+}
+
+function lpf(imp, n, rolloff, beta, num, i, j, x, nm, ibeta, w)
+{
+	rolloff = rolloff_round(rolloff + (Z_NYQUIST_HOVER * (1.0 - rolloff)));
+	imp[0] = rolloff;
+
+	#
+	# Generate ideal sinc impulses, locate the last zero-crossing and pad
+	# the remaining with 0.
+	#
+	# Note that there are other (faster) ways of calculating this without
+	# the misery of traversing the entire sinc given the fact that the
+	# distance between each zero crossings is actually the bandwidth of
+	# the impulses, but it seems having 0.0001% chances of failure due to
+	# limited precision.
+	#
+	j = n;
+	for (i = 1; i < n; i++) {
+		x = (M_PI * i) / (1.0 * num);
+		imp[i] = sin(x * rolloff) / x;
+		if (i != 1 && (imp[i] * imp[i - 1]) <= 0.0)
+			j = i;
+	}
+
+	for (i = j; i < n; i++)
+		imp[i] = 0.0;
+
+	nm = 1.0 * (j - 1);
+
+	if (beta >= Z_WINDOW_KAISER)
+		ibeta = I0(beta);
+
+	for (i = 1; i < j; i++) {
+		if (beta >= Z_WINDOW_KAISER) {
+			# Kaiser window...
+			x = (1.0 * i) / nm;
+			w = I0(beta * sqrt(1.0 - (x * x))) / ibeta;
+		} else {
+			# Cosined windows...
+			x = (M_PI * i) / nm;
+			if (beta == Z_WINDOW_BLACKMAN_NUTTALL) {
+				# Blackman - Nuttall
+				w = 0.36335819 + (0.4891775 * cos(x)) +	\
+				    (0.1365995 * cos(2 * x)) +		\
+				    (0.0106411 * cos(3 * x));
+			} else if (beta == Z_WINDOW_NUTTALL) {
+				# Nuttall
+		        	w = 0.355768 + (0.487396 * cos(x)) +	\
+				    (0.144232 * cos(2 * x)) +		\
+				    (0.012604 * cos(3 * x));
+			} else if (beta == Z_WINDOW_BLACKMAN_HARRIS) {
+				# Blackman - Harris
+				w = 0.422323 + (0.49755 * cos(x)) +	\
+				    (0.07922 * cos(2 * x));
+			} else if (beta == Z_WINDOW_BLACKMAN) {
+				# Blackman
+				w = 0.42 + (0.50 * cos(x)) +		\
+				    (0.08 * cos(2 * x));
+			} else if (beta == Z_WINDOW_HAMMING) {
+				# Hamming
+				w = 0.54 + (0.46 * cos(x));
+			} else if (beta == Z_WINDOW_HANN) {
+				# Hann
+				w = 0.50 + (0.50 * cos(x));
+			} else {
+				# What The Hell !?!?
+				w = 0.0;
+			}
+		}
+		imp[i] *= w;
+	}
+
+	imp["impulse_length"] = j;
+	imp["rolloff"] = rolloff;
+}
+
+function mkfilter(imp, nmult, rolloff, beta, num,			\
+    nwing, mwing, nrolloff, i, dcgain, v, quality)
+{
+	nwing = floor((nmult * num) / 2) + 1;
+
+	lpf(imp, nwing, rolloff, beta, num);
+
+	mwing = imp["impulse_length"];
+	nrolloff = imp["rolloff"];
+	quality = imp["quality"];
+
+	dcgain = 0.0;
+	for (i = num; i < mwing; i += num)
+		dcgain += imp[i];
+	dcgain *= 2.0;
+	dcgain += imp[0];
+
+	for (i = 0; i < nwing; i++)
+		imp[i] /= dcgain;
+
+	if (quality > 2)
+		printf("\n");
+	printf("/*\n");
+	printf(" *   quality = %d\n", quality);
+	printf(" *    window = %s\n", wname(beta));
+	if (beta >= Z_WINDOW_KAISER) {
+		printf(" *             beta: %.2f\n", beta);
+		printf(" *             stop: -%.2f dB\n",		\
+		    kaiserBeta2Attn(beta));
+	}
+	printf(" *    length = %d\n", nmult);
+	printf(" * bandwidth = %.2f%%", rolloff * 100.0);
+	if (rolloff != nrolloff) {
+		printf(" + %.2f%% = %.2f%% (nyquist hover: %.2f%%)",	\
+		    (nrolloff - rolloff) * 100.0, nrolloff * 100.0,	\
+		    Z_NYQUIST_HOVER * 100.0);
+	}
+	printf("\n");
+	printf(" *     drift = %d\n", num);
+	printf(" *     width = %d\n", mwing);
+	printf(" */\n");
+	printf("static int32_t z_coeff_q%d[%d] = {",			\
+	    quality, nwing + (Z_COEFF_OFFSET * 2));
+	for (i = 0; i < (nwing + (Z_COEFF_OFFSET * 2)); i++) {
+		if ((i % 5) == 0)
+			printf("\n      ");
+		if (i < Z_COEFF_OFFSET)
+			v = fx_floor(imp[Z_COEFF_OFFSET - i], Z_COEFF_ONE);
+		else if ((i - Z_COEFF_OFFSET) >= nwing)
+			v = fx_floor(					\
+			    imp[nwing + nwing - i + Z_COEFF_OFFSET - 1],\
+			    Z_COEFF_ONE);
+		else
+			v = fx_floor(imp[i - Z_COEFF_OFFSET], Z_COEFF_ONE);
+		printf(" %s0x%08x,", (v < 0) ? "-" : " ", abs(v));
+	}
+	printf("\n};\n\n");
+	printf("/*\n");
+	printf(" * interpolated q%d differences.\n", quality);
+	printf(" */\n");
+	printf("static int32_t z_dcoeff_q%d[%d] = {", quality, nwing);
+	for (i = 1; i <= nwing; i++) {
+		if ((i % 5) == 1)
+			printf("\n      ");
+		v = -imp[i - 1];
+		if (i != nwing)
+			v += imp[i];
+		v = fx_floor(v, Z_INTERP_COEFF_ONE);
+		if (abs(v) > abs(largest_interp))
+			largest_interp = v;
+		printf(" %s0x%08x,", (v < 0) ? "-" : " ", abs(v));
+	}
+	printf("\n};\n");
+
+	return (nwing);
+}
+
+function filter_parse(s, a, i, attn, alen)
+{
+	split(s, a, ":");
+	alen = length(a);
+
+	if (alen == 1 || alen == 2) {
+		if (a[1] == "nyquist_hover") {
+			i = 1.0 * a[2];
+			Z_NYQUIST_HOVER = (i > 0.0 && i < 1.0) ? i : 0.0;
+			return (-1);
+		}
+		i = 1;
+		if (alen == 1) {
+			attn = Z_KAISER_ATTN_DEFAULT;
+			Popts["beta"] = Z_KAISER_BETA_DEFAULT;
+		} else if (Z_WINDOWS[a[1]] < Z_WINDOW_KAISER) {
+			Popts["beta"] = Z_WINDOWS[a[1]];
+			i = tap_round(a[2]);
+			Popts["nmult"] = i;
+			if (i < 28)
+				i = 28;
+			i = 1.0 - (6.44 / i);
+			Popts["rolloff"] = rolloff_round(i);
+			return (0);
+		} else {
+			attn = 1.0 * a[i++];
+			Popts["beta"] = kaiserAttn2Beta(attn);
+		}
+		i = tap_round(a[i]);
+		Popts["nmult"] = i;
+		if (i > 7 && i < 28)
+			i = 27;
+		i = kaiserRolloff(i, attn);
+		Popts["rolloff"] = rolloff_round(i);
+
+		return (0);
+	}
+
+	if (!(alen == 3 || alen == 4))
+		return (-1);
+
+	i = 2;
+
+	if (a[1] == "kaiser") {
+		if (alen > 2)
+			Popts["beta"] = 1.0 * a[i++];
+		else
+			Popts["beta"] = Z_KAISER_BETA_DEFAULT;
+	} else if (Z_WINDOWS[a[1]] < Z_WINDOW_KAISER)
+		Popts["beta"] = Z_WINDOWS[a[1]];
+	else if (1.0 * a[1] < Z_WINDOW_KAISER)
+		return (-1);
+	else
+		Popts["beta"] = kaiserAttn2Beta(1.0 * a[1]);
+	Popts["nmult"] = tap_round(a[i++]);
+	if (a[1] == "kaiser" && alen == 3)

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

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 07:00:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0EAAD10656CA;
	Wed, 10 Jun 2009 07:00:02 +0000 (UTC) (envelope-from marck@rinet.ru)
Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68])
	by mx1.freebsd.org (Postfix) with ESMTP id 602A28FC12;
	Wed, 10 Jun 2009 07:00:01 +0000 (UTC) (envelope-from marck@rinet.ru)
Received: from localhost (localhost [127.0.0.1])
	by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id n5A7000G050789;
	Wed, 10 Jun 2009 11:00:00 +0400 (MSD) (envelope-from marck@rinet.ru)
Date: Wed, 10 Jun 2009 11:00:00 +0400 (MSD)
From: Dmitry Morozovsky 
To: Kip Macy 
In-Reply-To: <3c1674c90906092324n58e16154s6800e61752282e42@mail.gmail.com>
Message-ID: 
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
	
	<3c1674c90906092324n58e16154s6800e61752282e42@mail.gmail.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
X-NCC-RegID: ru.rinet
X-OpenPGP-Key-ID: 6B691B03
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
	(woozle.rinet.ru [0.0.0.0]); Wed, 10 Jun 2009 11:00:00 +0400 (MSD)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193878 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 07:00:03 -0000

On Tue, 9 Jun 2009, Kip Macy wrote:

KM> > KM>   As far as I can tell systems that have less than 4GB are more often hurt
KM> > KM>   by prefetched than helped.  On i386 systems and systems with less than 4GB,
KM> > KM>   prefetch is now disabled by default. I've added a prefetch enable tunable, to
KM> > KM>   enable prefetching for those systems. The prefetch disable tunable will continue
KM> > KM>   to unconditionally disable prefetching.
KM> > KM>
KM> >
KM> > [snip]
KM> >
KM> > KM> +extern int zfs_prefetch_disable;
KM> > KM> +extern int zfs_prefetch_enable;
KM> >
KM> > [snip]
KM> >
KM> > Before the interface is not settled in stone, don't you think simple bool
KM> > zfs_prefetch tunable (defauled to what looks more reasonable to partucilar
KM> > arch/memsize) is more clean and straightforward?
KM> >
KM> 
KM> Yes. But the semantics I want don't lend themselves well to a boolean.
KM> I want it to default to off for i386 and amd64 w/ < 4GB and on for
KM> amd64 > 4GB. However, I want it to be possible for users with larger
KM> memory systems to disable it and users with smaller memory systems to
KM> enable it. The only way a simple boolean would work would be if it
KM> were zfs_prefetch_non_default_behavior, which I think is even more
KM> confusing than what I have now.

Hmm, I failed to see how boolean prevent the usage:

if arch==i386 || memsize < 4G
	zfs_prefetch=0
else
	zfs_prefetch=1

and admin can flip the switch to non-default position.

Or, do you think it's not clean for the user?

-- 
Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck@FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 07:08:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1266C1065674;
	Wed, 10 Jun 2009 07:08:45 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.240])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D7CC8FC0C;
	Wed, 10 Jun 2009 07:08:44 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: by an-out-0708.google.com with SMTP id c3so323156ana.13
	for ; Wed, 10 Jun 2009 00:08:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=HyQYo1dpW2kjase9LbbWIbwRvib4cKsFtpAoY2OlU5c=;
	b=wdMMz2CaN84m4tq1AyhumuTAiQSfnV+zAtXp8gxpXCyxZ2n5wCStQgpNPV6rGL0N4y
	NP3fGk6cpftc1H8GYqF+5m+arorF6OLcoDMwrWCoC9ErulnDISOQdSuj8kFf8WK3b+GY
	9yiyN6pJVm7qITbYd2Z+mgrr8x9DwxbV/J+fA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=llobfdk2qvwLJa5qW/+zGzH2aqApy/1A3gB8B+K1LIUFN4pFf/tJSeKbnNqGXahXOM
	qyZaZAmFA+DhdTk4dKzVyLDNJSsv+QER4emuG0+LD4QZZRNdxI680fwwXRTzzCjvV23K
	hn5IN9JZyQQd/0DzS1GRxdAq0qkAIjmdDzcnM=
MIME-Version: 1.0
Sender: mat.macy@gmail.com
Received: by 10.100.14.2 with SMTP id 2mr907050ann.68.1244617723761; Wed, 10 
	Jun 2009 00:08:43 -0700 (PDT)
In-Reply-To: 
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
	
	<3c1674c90906092324n58e16154s6800e61752282e42@mail.gmail.com>
	
Date: Wed, 10 Jun 2009 00:08:43 -0700
X-Google-Sender-Auth: 297f05ea4874ef27
Message-ID: <3c1674c90906100008i4c632312j32f223b8aca14934@mail.gmail.com>
From: Kip Macy 
To: Dmitry Morozovsky 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193878 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 07:08:45 -0000

On Wed, Jun 10, 2009 at 12:00 AM, Dmitry Morozovsky wrote:
> On Tue, 9 Jun 2009, Kip Macy wrote:
>
> KM> > KM> =A0 As far as I can tell systems that have less than 4GB are mo=
re often hurt
> KM> > KM> =A0 by prefetched than helped. =A0On i386 systems and systems w=
ith less than 4GB,
> KM> > KM> =A0 prefetch is now disabled by default. I've added a prefetch =
enable tunable, to
> KM> > KM> =A0 enable prefetching for those systems. The prefetch disable =
tunable will continue
> KM> > KM> =A0 to unconditionally disable prefetching.
> KM> > KM>
> KM> >
> KM> > [snip]
> KM> >
> KM> > KM> +extern int zfs_prefetch_disable;
> KM> > KM> +extern int zfs_prefetch_enable;
> KM> >
> KM> > [snip]
> KM> >
> KM> > Before the interface is not settled in stone, don't you think simpl=
e bool
> KM> > zfs_prefetch tunable (defauled to what looks more reasonable to par=
tucilar
> KM> > arch/memsize) is more clean and straightforward?
> KM> >
> KM>
> KM> Yes. But the semantics I want don't lend themselves well to a boolean=
.
> KM> I want it to default to off for i386 and amd64 w/ < 4GB and on for
> KM> amd64 > 4GB. However, I want it to be possible for users with larger
> KM> memory systems to disable it and users with smaller memory systems to
> KM> enable it. The only way a simple boolean would work would be if it
> KM> were zfs_prefetch_non_default_behavior, which I think is even more
> KM> confusing than what I have now.
>
> Hmm, I failed to see how boolean prevent the usage:
>
> if arch=3D=3Di386 || memsize < 4G
> =A0 =A0 =A0 =A0zfs_prefetch=3D0
> else
> =A0 =A0 =A0 =A0zfs_prefetch=3D1
>
> and admin can flip the switch to non-default position.
>

Right, what you're advocating is zfs_prefetch_non_default. Which is
simpler, but still rather weird.

I'll ask around.

Cheers,
Kip

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 08:34:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 31FCB106566C; Wed, 10 Jun 2009 08:34:01 +0000 (UTC)
Date: Wed, 10 Jun 2009 08:34:01 +0000
From: Alexey Dokuchaev 
To: Kip Macy 
Message-ID: <20090610083400.GA70060@FreeBSD.org>
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
	
	<3c1674c90906092324n58e16154s6800e61752282e42@mail.gmail.com>
	
	<3c1674c90906100008i4c632312j32f223b8aca14934@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <3c1674c90906100008i4c632312j32f223b8aca14934@mail.gmail.com>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Dmitry Morozovsky 
Subject: Re: svn commit: r193878 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 08:34:01 -0000

On Wed, Jun 10, 2009 at 12:08:43AM -0700, Kip Macy wrote:
> On Wed, Jun 10, 2009 at 12:00 AM, Dmitry Morozovsky wrote:
> > On Tue, 9 Jun 2009, Kip Macy wrote:
> >
> > KM> > KM> š As far as I can tell systems that have less than 4GB are more often hurt
> > KM> > KM> š by prefetched than helped. šOn i386 systems and systems with less than 4GB,
> > KM> > KM> š prefetch is now disabled by default. I've added a prefetch enable tunable, to
> > KM> > KM> š enable prefetching for those systems. The prefetch disable tunable will continue
> > KM> > KM> š to unconditionally disable prefetching.
> > KM> > KM>
> > KM> >
> > KM> > [snip]
> > KM> >
> > KM> > KM> +extern int zfs_prefetch_disable;
> > KM> > KM> +extern int zfs_prefetch_enable;
> > KM> >
> > KM> > [snip]
> > KM> >
> > KM> > Before the interface is not settled in stone, don't you think simple bool
> > KM> > zfs_prefetch tunable (defauled to what looks more reasonable to partucilar
> > KM> > arch/memsize) is more clean and straightforward?
> > KM> >
> > KM>
> > KM> Yes. But the semantics I want don't lend themselves well to a boolean.
> > KM> I want it to default to off for i386 and amd64 w/ < 4GB and on for
> > KM> amd64 > 4GB. However, I want it to be possible for users with larger
> > KM> memory systems to disable it and users with smaller memory systems to
> > KM> enable it. The only way a simple boolean would work would be if it
> > KM> were zfs_prefetch_non_default_behavior, which I think is even more
> > KM> confusing than what I have now.
> >
> > Hmm, I failed to see how boolean prevent the usage:
> >
> > if arch==i386 || memsize < 4G
> > š š š šzfs_prefetch=0
> > else
> > š š š šzfs_prefetch=1
> >
> > and admin can flip the switch to non-default position.
> >
> 
> Right, what you're advocating is zfs_prefetch_non_default. Which is
> simpler, but still rather weird.

Having special zfs_prefetch_non_default tunable implies that
zfs_prefetch can be only set once (i.e. at boot time), and cannot be
flipped later.  Is that true?  If not, I fail to see the need for
zfs_prefetch_non_default or original two-sysctl implementation.

./danfe

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 09:07:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D337D1065791;
	Wed, 10 Jun 2009 09:07:05 +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 A73878FC0A;
	Wed, 10 Jun 2009 09:07:05 +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 n5A9757l099469;
	Wed, 10 Jun 2009 09:07:05 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A975uQ099464;
	Wed, 10 Jun 2009 09:07:05 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906100907.n5A975uQ099464@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 09:07:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193891 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 09:07:06 -0000

Author: bz
Date: Wed Jun 10 09:07:05 2009
New Revision: 193891
URL: http://svn.freebsd.org/changeset/base/193891

Log:
  The llentry *lle is only used in cases of INET or INET6.
  Put the variable declaration under proper #ifdefs.
  
  In case variables are only needed for one of the two AFs
  more them into proper scope.

Modified:
  head/sys/net/if_arcsubr.c
  head/sys/net/if_fddisubr.c
  head/sys/net/if_fwsubr.c
  head/sys/net/if_iso88025subr.c

Modified: head/sys/net/if_arcsubr.c
==============================================================================
--- head/sys/net/if_arcsubr.c	Wed Jun 10 09:06:42 2009	(r193890)
+++ head/sys/net/if_arcsubr.c	Wed Jun 10 09:07:05 2009	(r193891)
@@ -109,7 +109,9 @@ arc_output(struct ifnet *ifp, struct mbu
 	u_int8_t		atype, adst;
 	int			loop_copy = 0;
 	int			isphds;
+#if defined(INET) || defined(INET6)
 	struct llentry		*lle;
+#endif
 
 	if (!((ifp->if_flags & IFF_UP) &&
 	    (ifp->if_drv_flags & IFF_DRV_RUNNING)))

Modified: head/sys/net/if_fddisubr.c
==============================================================================
--- head/sys/net/if_fddisubr.c	Wed Jun 10 09:06:42 2009	(r193890)
+++ head/sys/net/if_fddisubr.c	Wed Jun 10 09:07:05 2009	(r193891)
@@ -120,11 +120,10 @@ fddi_output(ifp, m, dst, ro)
 	int loop_copy = 0, error = 0, hdrcmplt = 0;
  	u_char esrc[FDDI_ADDR_LEN], edst[FDDI_ADDR_LEN];
 	struct fddi_header *fh;
+#if defined(INET) || defined(INET6)
 	struct llentry *lle;
-	struct rtentry *rt0 = NULL;
+#endif
 
-	if (ro != NULL)
-		rt0 = ro->ro_rt;
 #ifdef MAC
 	error = mac_ifnet_check_transmit(ifp, m);
 	if (error)
@@ -141,6 +140,10 @@ fddi_output(ifp, m, dst, ro)
 	switch (dst->sa_family) {
 #ifdef INET
 	case AF_INET: {
+		struct rtentry *rt0 = NULL;
+
+		if (ro != NULL)
+			rt0 = ro->ro_rt;
 		error = arpresolve(ifp, rt0, m, dst, edst, &lle);
 		if (error)
 			return (error == EWOULDBLOCK ? 0 : error);

Modified: head/sys/net/if_fwsubr.c
==============================================================================
--- head/sys/net/if_fwsubr.c	Wed Jun 10 09:06:42 2009	(r193890)
+++ head/sys/net/if_fwsubr.c	Wed Jun 10 09:07:05 2009	(r193891)
@@ -88,7 +88,9 @@ firewire_output(struct ifnet *ifp, struc
 	struct mbuf *mtail;
 	int unicast, dgl, foff;
 	static int next_dgl;
+#if defined(INET) || defined(INET6)
 	struct llentry *lle;
+#endif
 
 #ifdef MAC
 	error = mac_ifnet_check_transmit(ifp, m);

Modified: head/sys/net/if_iso88025subr.c
==============================================================================
--- head/sys/net/if_iso88025subr.c	Wed Jun 10 09:06:42 2009	(r193890)
+++ head/sys/net/if_iso88025subr.c	Wed Jun 10 09:07:05 2009	(r193891)
@@ -243,8 +243,10 @@ iso88025_output(ifp, m, dst, ro)
 	struct iso88025_header *th;
 	struct iso88025_header gen_th;
 	struct sockaddr_dl *sdl = NULL;
-	struct llentry *lle;
 	struct rtentry *rt0 = NULL;
+#if defined(INET) || defined(INET6)
+	struct llentry *lle;
+#endif
 
 	if (ro != NULL)
 		rt0 = ro->ro_rt;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 09:17:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA46A106564A;
	Wed, 10 Jun 2009 09:17:16 +0000 (UTC) (envelope-from marck@rinet.ru)
Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68])
	by mx1.freebsd.org (Postfix) with ESMTP id 70F6C8FC08;
	Wed, 10 Jun 2009 09:17:16 +0000 (UTC) (envelope-from marck@rinet.ru)
Received: from localhost (localhost [127.0.0.1])
	by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id n5A9HF2Z004994;
	Wed, 10 Jun 2009 13:17:15 +0400 (MSD) (envelope-from marck@rinet.ru)
Date: Wed, 10 Jun 2009 13:17:15 +0400 (MSD)
From: Dmitry Morozovsky 
To: Kip Macy 
In-Reply-To: <200906100121.n5A1LWVO089719@svn.freebsd.org>
Message-ID: 
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
X-NCC-RegID: ru.rinet
X-OpenPGP-Key-ID: 6B691B03
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
	(woozle.rinet.ru [0.0.0.0]); Wed, 10 Jun 2009 13:17:15 +0400 (MSD)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193878 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 09:17:17 -0000

On Wed, 10 Jun 2009, Kip Macy wrote:

KM> +	if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) &&
KM> +	    (zfs_prefetch_enable != 1) && (zfs_prefetch_disable != 1)) {
KM> +		printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set"
KM> +		    "... disabling.\n");
KM> +		zfs_prefetch_disable=1;
KM> +	}

Also: this will disable prefetch on a system with exact 4G of memory *and* 
some subsystem which allocates memory from system (e.g., integrated video)

Don't you think the threshold like 3G would be more appropriate?


-- 
Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck@FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 09:28:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 52DA01065672;
	Wed, 10 Jun 2009 09:28:51 +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 419D38FC08;
	Wed, 10 Jun 2009 09:28:51 +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 n5A9Sp7T099934;
	Wed, 10 Jun 2009 09:28:51 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5A9Spe7099933;
	Wed, 10 Jun 2009 09:28:51 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906100928.n5A9Spe7099933@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 09:28:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193892 - head/sys/netipx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 09:28:51 -0000

Author: bz
Date: Wed Jun 10 09:28:50 2009
New Revision: 193892
URL: http://svn.freebsd.org/changeset/base/193892

Log:
  Put the variable declarations for TCPDEBUG under #ifdef INET as well.
  The implementation already has this right.
  
  Reviewed by:	rwatson

Modified:
  head/sys/netipx/spx_debug.c

Modified: head/sys/netipx/spx_debug.c
==============================================================================
--- head/sys/netipx/spx_debug.c	Wed Jun 10 09:07:05 2009	(r193891)
+++ head/sys/netipx/spx_debug.c	Wed Jun 10 09:28:50 2009	(r193892)
@@ -82,11 +82,13 @@ __FBSDID("$FreeBSD$");
 #define	SANAMES
 #include 
 
+#ifdef INET
 #ifdef TCPDEBUG
 static	int spxconsdebug = 0;
 static	struct spx_debug spx_debug[SPX_NDEBUG];
 static	int spx_debx;
 #endif
+#endif
 
 /*
  * spx debug routines

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 09:37:09 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 674FF1065670;
	Wed, 10 Jun 2009 09:37:09 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au
	[211.29.132.186])
	by mx1.freebsd.org (Postfix) with ESMTP id BE1A08FC17;
	Wed, 10 Jun 2009 09:37:08 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au
	(c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184])
	by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n5A8TDS1015152
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 10 Jun 2009 18:30:00 +1000
Date: Wed, 10 Jun 2009 18:29:13 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: "Bjoern A. Zeeb" 
In-Reply-To: <20090609090541.D22887@maildrop.int.zabbadoz.net>
Message-ID: <20090610175011.E20224@delplex.bde.org>
References: <200906090903.n5993D3E062579@svn.freebsd.org>
	<20090609090541.D22887@maildrop.int.zabbadoz.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 -
 head/sys/modules/sound/sound]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 09:37:09 -0000

On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:

> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
>> Log:
>>  Depend on @ machine (_ILINKS) as we do with other modules so that @
>>  is there for parallel (-jN) builds.  Ideally beforedepends in kmod.mk
>>  should do the right thing but it seems it does not.
>
> Anyone with lots of build framework know how may want to look at this.

Failures only for parallel builds normally mean missing dependencies.

>> -feeder_eq_gen.h:
>> +feeder_eq_gen.h:	@ machine
>> 	${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > 
>> ${.TARGET}

Here there is still a missing dependency on the
@/tools/feeder_eq_mkfilter.awk (fixed in the next commit).  This dependency
is not very important, but since the utility has "@" in its pathname,
running it certainly depends on "@".

This missing dependency seems to be a general bug.  There is an ordering
requirement that beforedepend is before built before ${DEPENDFILE},
but this apparently doesn't extend to ${DEPENDFILE}'s prerequisites,
and I don't know of any general way to make it do so and it probably
shouldn't do so in general (some of the prerequisites might be needed
before beforedepend).  In kmod.mk, all generated sources should depend
on each link, like all objects do, but modules makefiles have no way
of distinguishing generated sources from ordinary ones.

> PS: In case you do I'd have another request to be able to have an
> option similar to COPTFLAGS that will actually be passed down to
> module builds - at least for make buildkernel/universe/..

COPTFLAGS is a mistake, as is setting CFLAGS using "=" in kern.pre.mk.
Since kmod.mk doesn't have these mistakes, there is a chance that ordinary
setting of CFLAGS works right.  It does seem to work right for single
module builds.  I don't know what happens when modules are built as
part of a kernel (maybe kern.pre.mk has already clobbered CFLAGS?), and
there is always the problem that it is difficult to control the order
of CFLAGS when individual makefiles add to the end of it.  kern.pre.mk
uses:

 	CFLAGS=	${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}

where ${DEBUG} provides good control since it is almost at the end
(${COPTS} only has include paths and some other things that wouldn't
be useful to override).  Since ${DEBUG} is also passed to modules
makefiles (as DEBUG_FLAGS in the environment), it might help.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 10:02:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3953106564A;
	Wed, 10 Jun 2009 10:02:14 +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 AEF908FC19;
	Wed, 10 Jun 2009 10:02:14 +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 32B936D418;
	Wed, 10 Jun 2009 12:02:13 +0200 (CEST)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 0A138844DC; Wed, 10 Jun 2009 12:02:13 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Kip Macy 
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
	
	<3c1674c90906092324n58e16154s6800e61752282e42@mail.gmail.com>
	
	<3c1674c90906100008i4c632312j32f223b8aca14934@mail.gmail.com>
Date: Wed, 10 Jun 2009 12:02:12 +0200
In-Reply-To: <3c1674c90906100008i4c632312j32f223b8aca14934@mail.gmail.com>
	(Kip Macy's message of "Wed, 10 Jun 2009 00:08:43 -0700")
Message-ID: <86ljo0wgnv.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Dmitry Morozovsky 
Subject: Re: svn commit: r193878 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 10:02:15 -0000

Kip Macy  writes:
> Dmitry Morozovsky  writes:
> > Hmm, I failed to see how boolean prevent the usage:
> >
> > if arch=3D=3Di386 || memsize < 4G
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0zfs_prefetch=3D0
> > else
> > =C2=A0 =C2=A0 =C2=A0 =C2=A0zfs_prefetch=3D1
> >
> > and admin can flip the switch to non-default position.
> >
> Right, what you're advocating is zfs_prefetch_non_default. Which is
> simpler, but still rather weird.

No, he's advocating zfs_prefetch_enable which is initialized to either 0
or 1 at boot time and can be administratively set to either 0 and 1
regardless of its initial value.  I don't see the problem...

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 10:20:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E9243106566B;
	Wed, 10 Jun 2009 10:20:09 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3])
	by mx1.freebsd.org (Postfix) with ESMTP id 9EA978FC08;
	Wed, 10 Jun 2009 10:20:09 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 5396541C758;
	Wed, 10 Jun 2009 12:20:08 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([195.88.108.3])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id dQxeH+V1U3fV; Wed, 10 Jun 2009 12:20:05 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id A30EF41C72F; Wed, 10 Jun 2009 12:20:05 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id ED6374448E6;
	Wed, 10 Jun 2009 10:16:45 +0000 (UTC)
Date: Wed, 10 Jun 2009 10:16:45 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Bruce Evans 
In-Reply-To: <20090610175011.E20224@delplex.bde.org>
Message-ID: <20090610101009.N22887@maildrop.int.zabbadoz.net>
References: <200906090903.n5993D3E062579@svn.freebsd.org>
	<20090609090541.D22887@maildrop.int.zabbadoz.net>
	<20090610175011.E20224@delplex.bde.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 -
 head/sys/modules/sound/sound]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 10:20:10 -0000

On Wed, 10 Jun 2009, Bruce Evans wrote:

> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
>
>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
>>> Log:
>>>  Depend on @ machine (_ILINKS) as we do with other modules so that @
>>>  is there for parallel (-jN) builds.  Ideally beforedepends in kmod.mk
>>>  should do the right thing but it seems it does not.
>> 
>> Anyone with lots of build framework know how may want to look at this.
>
> Failures only for parallel builds normally mean missing dependencies.
>
>>> -feeder_eq_gen.h:
>>> +feeder_eq_gen.h:	@ machine
>>> 	${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > 
>>> ${.TARGET}
>
> Here there is still a missing dependency on the
> @/tools/feeder_eq_mkfilter.awk (fixed in the next commit).  This dependency
> is not very important, but since the utility has "@" in its pathname,
> running it certainly depends on "@".

And adding it again messes with @ not being there for parallel
builds:(

Or in other words:

===> sound (depend)
===> sound/sound (depend)
make: don't know how to make @/tools/sound/feeder_eq_mkfilter.awk. Stop
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2



> This missing dependency seems to be a general bug.  There is an ordering
> requirement that beforedepend is before built before ${DEPENDFILE},
> but this apparently doesn't extend to ${DEPENDFILE}'s prerequisites,
> and I don't know of any general way to make it do so and it probably
> shouldn't do so in general (some of the prerequisites might be needed
> before beforedepend).

Well no; that should not be the case. I would say that would be a bug
as beforedepnd only adds the @ and machine symlinks to my memory from
reading the other day.


All after all that's why I said this needs someone with the devotion
to sort all this out, know what the right way to do things is, have
the time, ..

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 10:25:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 50CA0106564A;
	Wed, 10 Jun 2009 10:25:12 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3])
	by mx1.freebsd.org (Postfix) with ESMTP id 052F18FC12;
	Wed, 10 Jun 2009 10:25:06 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 3507D41C712;
	Wed, 10 Jun 2009 12:25:06 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([195.88.108.3])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id wqcdvCXgJk2P; Wed, 10 Jun 2009 12:25:05 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id BC0FD41C730; Wed, 10 Jun 2009 12:25:05 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id 646E44448E6;
	Wed, 10 Jun 2009 10:24:46 +0000 (UTC)
Date: Wed, 10 Jun 2009 10:24:46 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Bruce Evans 
In-Reply-To: <20090610101009.N22887@maildrop.int.zabbadoz.net>
Message-ID: <20090610102419.Q22887@maildrop.int.zabbadoz.net>
References: <200906090903.n5993D3E062579@svn.freebsd.org>
	<20090609090541.D22887@maildrop.int.zabbadoz.net>
	<20090610175011.E20224@delplex.bde.org>
	<20090610101009.N22887@maildrop.int.zabbadoz.net>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 -
 head/sys/modules/sound/sound]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 10:25:12 -0000

On Wed, 10 Jun 2009, Bjoern A. Zeeb wrote:

> On Wed, 10 Jun 2009, Bruce Evans wrote:
>
>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
>> 
>>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
>>>> Log:
>>>>  Depend on @ machine (_ILINKS) as we do with other modules so that @
>>>>  is there for parallel (-jN) builds.  Ideally beforedepends in kmod.mk
>>>>  should do the right thing but it seems it does not.
>>> 
>>> Anyone with lots of build framework know how may want to look at this.
>> 
>> Failures only for parallel builds normally mean missing dependencies.
>> 
>>>> -feeder_eq_gen.h:
>>>> +feeder_eq_gen.h:	@ machine
>>>> 	${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > 
>>>> ${.TARGET}
>> 
>> Here there is still a missing dependency on the
>> @/tools/feeder_eq_mkfilter.awk (fixed in the next commit).  This dependency
>> is not very important, but since the utility has "@" in its pathname,
>> running it certainly depends on "@".
>
> And adding it again messes with @ not being there for parallel
> builds:(
>
> Or in other words:
>
> ===> sound (depend)
> ===> sound/sound (depend)
> make: don't know how to make @/tools/sound/feeder_eq_mkfilter.awk. Stop
> *** Error code 2
> 1 error
> *** Error code 2
> 1 error
> *** Error code 2

I forgot to mention that the way we currently seem to handle this is:

http://people.freebsd.org/~bz/20090610-02-sound-Makefile.diff


>
>
>> This missing dependency seems to be a general bug.  There is an ordering
>> requirement that beforedepend is before built before ${DEPENDFILE},
>> but this apparently doesn't extend to ${DEPENDFILE}'s prerequisites,
>> and I don't know of any general way to make it do so and it probably
>> shouldn't do so in general (some of the prerequisites might be needed
>> before beforedepend).
>
> Well no; that should not be the case. I would say that would be a bug
> as beforedepnd only adds the @ and machine symlinks to my memory from
> reading the other day.
>
>
> All after all that's why I said this needs someone with the devotion
> to sort all this out, know what the right way to do things is, have
> the time, ..
>
>

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 10:31:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C18E1065670;
	Wed, 10 Jun 2009 10:31:12 +0000 (UTC)
	(envelope-from cperciva@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 75C568FC1A;
	Wed, 10 Jun 2009 10:31:12 +0000 (UTC)
	(envelope-from cperciva@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AAVCP3010125;
	Wed, 10 Jun 2009 10:31:12 GMT
	(envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AAVC7I010122;
	Wed, 10 Jun 2009 10:31:12 GMT
	(envelope-from cperciva@svn.freebsd.org)
Message-Id: <200906101031.n5AAVC7I010122@svn.freebsd.org>
From: Colin Percival 
Date: Wed, 10 Jun 2009 10:31:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193893 - head/contrib/ntp/ntpd head/sys/kern
	head/sys/netinet6 releng/6.3 releng/6.3/contrib/ntp/ntpd
	releng/6.3/sys/conf releng/6.3/sys/kern
	releng/6.3/sys/netinet6 releng/6.4 releng/...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 10:31:13 -0000

Author: cperciva
Date: Wed Jun 10 10:31:11 2009
New Revision: 193893
URL: http://svn.freebsd.org/changeset/base/193893

Log:
  Prevent integer overflow in direct pipe write code from circumventing
  virtual-to-physical page lookups. [09:09]
  
  Add missing permissions check for SIOCSIFINFO_IN6 ioctl. [09:10]
  
  Fix buffer overflow in "autokey" negotiation in ntpd(8). [09:11]
  
  Approved by:	so (cperciva)
  Approved by:	re (not really, but SVN wants this...)
  Security:	FreeBSD-SA-09:09.pipe
  Security:	FreeBSD-SA-09:10.ipv6
  Security:	FreeBSD-SA-09:11.ntpd

Modified:
  head/contrib/ntp/ntpd/ntp_crypto.c
  head/sys/kern/sys_pipe.c
  head/sys/netinet6/in6.c

Changes in other areas also in this revision:
Modified:
  releng/6.3/UPDATING
  releng/6.3/contrib/ntp/ntpd/ntp_crypto.c
  releng/6.3/sys/conf/newvers.sh
  releng/6.3/sys/kern/sys_pipe.c
  releng/6.3/sys/netinet6/in6.c
  releng/6.4/UPDATING
  releng/6.4/contrib/ntp/ntpd/ntp_crypto.c
  releng/6.4/sys/conf/newvers.sh
  releng/6.4/sys/kern/sys_pipe.c
  releng/6.4/sys/netinet6/in6.c
  releng/7.1/UPDATING
  releng/7.1/contrib/ntp/ntpd/ntp_crypto.c
  releng/7.1/sys/conf/newvers.sh
  releng/7.1/sys/kern/sys_pipe.c
  releng/7.1/sys/netinet6/in6.c
  releng/7.2/UPDATING
  releng/7.2/contrib/ntp/ntpd/ntp_crypto.c
  releng/7.2/sys/conf/newvers.sh
  releng/7.2/sys/kern/sys_pipe.c
  releng/7.2/sys/netinet6/in6.c
  stable/6/contrib/ntp/ntpd/ntp_crypto.c
  stable/6/sys/kern/sys_pipe.c
  stable/6/sys/netinet6/in6.c
  stable/7/contrib/ntp/ntpd/ntp_crypto.c
  stable/7/sys/kern/sys_pipe.c
  stable/7/sys/netinet6/in6.c

Modified: head/contrib/ntp/ntpd/ntp_crypto.c
==============================================================================
--- head/contrib/ntp/ntpd/ntp_crypto.c	Wed Jun 10 09:28:50 2009	(r193892)
+++ head/contrib/ntp/ntpd/ntp_crypto.c	Wed Jun 10 10:31:11 2009	(r193893)
@@ -570,7 +570,7 @@ crypto_recv(
 			peer->issuer = emalloc(vallen + 1);
 			strcpy(peer->issuer, peer->subject);
 			temp32 = (fstamp >> 16) & 0xffff;
-			sprintf(statstr,
+			snprintf(statstr, NTP_MAXSTRLEN,
 			    "flags 0x%x host %s signature %s", fstamp,
 			    peer->subject, OBJ_nid2ln(temp32));
 			record_crypto_stats(&peer->srcadr, statstr);
@@ -636,7 +636,8 @@ crypto_recv(
 			}
 			peer->flash &= ~TEST8;
 			temp32 = cinfo->nid;
-			sprintf(statstr, "cert %s 0x%x %s (%u) fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN,
+			    "cert %s 0x%x %s (%u) fs %u",
 			    cinfo->subject, cinfo->flags,
 			    OBJ_nid2ln(temp32), temp32,
 			    ntohl(ep->fstamp));
@@ -685,7 +686,7 @@ crypto_recv(
 			peer->crypto |= CRYPTO_FLAG_VRFY |
 			    CRYPTO_FLAG_PROV;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "iff fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "iff fs %u",
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
 #ifdef DEBUG
@@ -733,7 +734,7 @@ crypto_recv(
 			peer->crypto |= CRYPTO_FLAG_VRFY |
 			    CRYPTO_FLAG_PROV;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "gq fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "gq fs %u",
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
 #ifdef DEBUG
@@ -774,7 +775,7 @@ crypto_recv(
 			peer->crypto |= CRYPTO_FLAG_VRFY |
 			    CRYPTO_FLAG_PROV;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "mv fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "mv fs %u",
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
 #ifdef DEBUG
@@ -828,7 +829,7 @@ crypto_recv(
 			peer->crypto &= ~CRYPTO_FLAG_AUTO;
 			peer->crypto |= CRYPTO_FLAG_AGREE;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "cook %x ts %u fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "cook %x ts %u fs %u",
 			    peer->pcookie, ntohl(ep->tstamp),
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
@@ -893,7 +894,7 @@ crypto_recv(
 				peer->crypto &= ~CRYPTO_FLAG_AUTO;
 			peer->crypto |= CRYPTO_FLAG_AGREE;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "cook %x ts %u fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "cook %x ts %u fs %u",
 			    peer->pcookie, ntohl(ep->tstamp),
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
@@ -944,7 +945,7 @@ crypto_recv(
 			peer->pkeyid = bp->key;
 			peer->crypto |= CRYPTO_FLAG_AUTO;
 			peer->flash &= ~TEST8;
-			sprintf(statstr,
+			snprintf(statstr, NTP_MAXSTRLEN,
 			    "auto seq %d key %x ts %u fs %u", bp->seq,
 			    bp->key, ntohl(ep->tstamp),
 			    ntohl(ep->fstamp));
@@ -987,7 +988,8 @@ crypto_recv(
 			peer->crypto |= CRYPTO_FLAG_SIGN;
 			peer->flash &= ~TEST8;
 			temp32 = cinfo->nid;
-			sprintf(statstr, "sign %s 0x%x %s (%u) fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN,
+			    "sign %s 0x%x %s (%u) fs %u",
 			    cinfo->issuer, cinfo->flags,
 			    OBJ_nid2ln(temp32), temp32,
 			    ntohl(ep->fstamp));
@@ -1071,7 +1073,8 @@ crypto_recv(
 			crypto_flags |= CRYPTO_FLAG_TAI;
 			peer->crypto |= CRYPTO_FLAG_LEAP;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "leap %u ts %u fs %u", vallen,
+			snprintf(statstr, NTP_MAXSTRLEN,
+			    "leap %u ts %u fs %u", vallen,
 			    ntohl(ep->tstamp), ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
 #ifdef DEBUG
@@ -1127,7 +1130,7 @@ crypto_recv(
 		 * cheerfully ignored, as the message is not sent.
 		 */
 		if (rval > XEVNT_TSP) {
-			sprintf(statstr,
+			snprintf(statstr, NTP_MAXSTRLEN,
 			    "error %x opcode %x ts %u fs %u", rval,
 			    code, tstamp, fstamp);
 			record_crypto_stats(&peer->srcadr, statstr);
@@ -1453,7 +1456,8 @@ crypto_xmit(
 	 */
 	if (rval != XEVNT_OK) {
 		opcode |= CRYPTO_ERROR;
-		sprintf(statstr, "error %x opcode %x", rval, opcode);
+		snprintf(statstr, NTP_MAXSTRLEN,
+		    "error %x opcode %x", rval, opcode);
 		record_crypto_stats(srcadr_sin, statstr);
 		report_event(rval, NULL);
 #ifdef DEBUG
@@ -1952,7 +1956,8 @@ crypto_update(void)
 		if (EVP_SignFinal(&ctx, tai_leap.sig, &len, sign_pkey))
 			tai_leap.siglen = htonl(len);
 	}
-	sprintf(statstr, "update ts %u", ntohl(hostval.tstamp)); 
+	snprintf(statstr, NTP_MAXSTRLEN,
+	    "update ts %u", ntohl(hostval.tstamp)); 
 	record_crypto_stats(NULL, statstr);
 #ifdef DEBUG
 	if (debug)
@@ -3606,7 +3611,7 @@ crypto_key(
 	 */
 	if ((ptr = strrchr(linkname, '\n')) != NULL)
 		*ptr = '\0'; 
-	sprintf(statstr, "%s mod %d", &linkname[2],
+	snprintf(statstr, NTP_MAXSTRLEN, "%s mod %d", &linkname[2],
 	    EVP_PKEY_size(pkey) * 8);
 	record_crypto_stats(NULL, statstr);
 #ifdef DEBUG
@@ -3715,8 +3720,8 @@ crypto_cert(
 
 	if ((ptr = strrchr(linkname, '\n')) != NULL)
 		*ptr = '\0'; 
-	sprintf(statstr, "%s 0x%x len %lu", &linkname[2], ret->flags,
-	    len);
+	snprintf(statstr, NTP_MAXSTRLEN,
+	    "%s 0x%x len %lu", &linkname[2], ret->flags, len);
 	record_crypto_stats(NULL, statstr);
 #ifdef DEBUG
 	if (debug)
@@ -3832,7 +3837,7 @@ crypto_tai(
 	for (j = 0; j < i; j++)
 		*ptr++ = htonl(leapsec[j]);
 	crypto_flags |= CRYPTO_FLAG_TAI;
-	sprintf(statstr, "%s fs %u leap %u len %u", cp, fstamp,
+	snprintf(statstr, NTP_MAXSTRLEN, "%s fs %u leap %u len %u", cp, fstamp,
 	   leapsec[--j], len);
 	record_crypto_stats(NULL, statstr);
 #ifdef DEBUG

Modified: head/sys/kern/sys_pipe.c
==============================================================================
--- head/sys/kern/sys_pipe.c	Wed Jun 10 09:28:50 2009	(r193892)
+++ head/sys/kern/sys_pipe.c	Wed Jun 10 10:31:11 2009	(r193893)
@@ -759,6 +759,8 @@ pipe_build_write_buffer(wpipe, uio)
 	pmap = vmspace_pmap(curproc->p_vmspace);
 	endaddr = round_page((vm_offset_t)uio->uio_iov->iov_base + size);
 	addr = trunc_page((vm_offset_t)uio->uio_iov->iov_base);
+	if (endaddr < addr)
+		return (EFAULT);
 	for (i = 0; addr < endaddr; addr += PAGE_SIZE, i++) {
 		/*
 		 * vm_fault_quick() can sleep.  Consequently,

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Wed Jun 10 09:28:50 2009	(r193892)
+++ head/sys/netinet6/in6.c	Wed Jun 10 10:31:11 2009	(r193893)
@@ -214,6 +214,7 @@ in6_control(struct socket *so, u_long cm
 	case SIOCSRTRFLUSH_IN6:
 	case SIOCSDEFIFACE_IN6:
 	case SIOCSIFINFO_FLAGS:
+	case SIOCSIFINFO_IN6:
 		if (td != NULL) {
 			error = priv_check(td, PRIV_NETINET_ND6);
 			if (error)
@@ -222,7 +223,6 @@ in6_control(struct socket *so, u_long cm
 		/* FALLTHROUGH */
 	case OSIOCGIFINFO_IN6:
 	case SIOCGIFINFO_IN6:
-	case SIOCSIFINFO_IN6:
 	case SIOCGDRLST_IN6:
 	case SIOCGPRLST_IN6:
 	case SIOCGNBRINFO_IN6:

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 10:34:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A43FA106567E;
	Wed, 10 Jun 2009 10:34:59 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 917268FC14;
	Wed, 10 Jun 2009 10:34:59 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AAYxOu010266;
	Wed, 10 Jun 2009 10:34:59 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AAYxmm010265;
	Wed, 10 Jun 2009 10:34:59 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200906101034.n5AAYxmm010265@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 10 Jun 2009 10:34:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193894 - head/sys/netinet/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 10:35:00 -0000

Author: luigi
Date: Wed Jun 10 10:34:59 2009
New Revision: 193894
URL: http://svn.freebsd.org/changeset/base/193894

Log:
  small simplifications to the code in charge of reaping deleted rules:
  - clear the head pointer immediately before using it, so there is
    no chance of mistakes;
  - call reap_rules() unconditionally. The function can handle a NULL
    argument just fine, and the cost of the extra call is hardly
    significant given that we do it rarely and outside the lock.
  
  MFC after:	3 days

Modified:
  head/sys/netinet/ipfw/ip_fw2.c

Modified: head/sys/netinet/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw2.c	Wed Jun 10 10:31:11 2009	(r193893)
+++ head/sys/netinet/ipfw/ip_fw2.c	Wed Jun 10 10:34:59 2009	(r193894)
@@ -3631,6 +3631,7 @@ remove_rule(struct ip_fw_chain *chain, s
 /*
  * Reclaim storage associated with a list of rules.  This is
  * typically the list created using remove_rule.
+ * A NULL pointer on input is handled correctly.
  */
 static void
 reap_rules(struct ip_fw *head)
@@ -3655,6 +3656,7 @@ free_chain(struct ip_fw_chain *chain, in
 
 	IPFW_WLOCK_ASSERT(chain);
 
+	chain->reap = NULL;
 	flush_rule_ptrs(chain); /* more efficient to do outside the loop */
 	for (prev = NULL, rule = chain->rules; rule ; )
 		if (kill_default || rule->set != RESVD_SET)
@@ -3701,8 +3703,8 @@ del_entry(struct ip_fw_chain *chain, u_i
 	}
 
 	IPFW_WLOCK(chain);
-	rule = chain->rules;
-	chain->reap = NULL;
+	rule = chain->rules;	/* common starting point */
+	chain->reap = NULL;	/* prepare for deletions */
 	switch (cmd) {
 	case 0:	/* delete rules with given number */
 		/*
@@ -3726,18 +3728,17 @@ del_entry(struct ip_fw_chain *chain, u_i
 
 	case 1:	/* delete all rules with given set number */
 		flush_rule_ptrs(chain);
-		rule = chain->rules;
-		while (rule->rulenum < IPFW_DEFAULT_RULE)
+		while (rule->rulenum < IPFW_DEFAULT_RULE) {
 			if (rule->set == rulenum)
 				rule = remove_rule(chain, rule, prev);
 			else {
 				prev = rule;
 				rule = rule->next;
 			}
+		}
 		break;
 
 	case 2:	/* move rules with given number to new set */
-		rule = chain->rules;
 		for (; rule->rulenum < IPFW_DEFAULT_RULE; rule = rule->next)
 			if (rule->rulenum == rulenum)
 				rule->set = new_set;
@@ -3756,6 +3757,7 @@ del_entry(struct ip_fw_chain *chain, u_i
 			else if (rule->set == new_set)
 				rule->set = rulenum;
 		break;
+
 	case 5: /* delete rules with given number and with given set number.
 		 * rulenum - given rule number;
 		 * new_set - given set number.
@@ -3782,10 +3784,8 @@ del_entry(struct ip_fw_chain *chain, u_i
 	 * avoid a LOR with dummynet.
 	 */
 	rule = chain->reap;
-	chain->reap = NULL;
 	IPFW_WUNLOCK(chain);
-	if (rule)
-		reap_rules(rule);
+	reap_rules(rule);
 	return 0;
 }
 
@@ -4315,6 +4315,8 @@ ipfw_ctl(struct sockopt *sopt)
 		if (V_ipfw_dyn_v)		/* add size of dyn.rules */
 			size += (V_dyn_count * sizeof(ipfw_dyn_rule));
 
+		if (size >= sopt->sopt_valsize)
+			break;
 		/*
 		 * XXX todo: if the user passes a short length just to know
 		 * how much room is needed, do not bother filling up the
@@ -4341,13 +4343,10 @@ ipfw_ctl(struct sockopt *sopt)
 		 */
 
 		IPFW_WLOCK(&V_layer3_chain);
-		V_layer3_chain.reap = NULL;
 		free_chain(&V_layer3_chain, 0 /* keep default rule */);
 		rule = V_layer3_chain.reap;
-		V_layer3_chain.reap = NULL;
 		IPFW_WUNLOCK(&V_layer3_chain);
-		if (rule != NULL)
-			reap_rules(rule);
+		reap_rules(rule);
 		break;
 
 	case IP_FW_ADD:
@@ -4735,12 +4734,10 @@ ipfw_destroy(void)
 	callout_drain(&V_ipfw_timeout);
 	IPFW_WLOCK(&V_layer3_chain);
 	flush_tables(&V_layer3_chain);
-	V_layer3_chain.reap = NULL;
 	free_chain(&V_layer3_chain, 1 /* kill default rule */);
-	reap = V_layer3_chain.reap, V_layer3_chain.reap = NULL;
+	reap = V_layer3_chain.reap;
 	IPFW_WUNLOCK(&V_layer3_chain);
-	if (reap != NULL)
-		reap_rules(reap);
+	reap_rules(reap);
 	IPFW_DYN_LOCK_DESTROY();
 	uma_zdestroy(ipfw_dyn_rule_zone);
 	if (V_ipfw_dyn_v != NULL)

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 10:39:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 289BF106564A;
	Wed, 10 Jun 2009 10:39:42 +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 176088FC12;
	Wed, 10 Jun 2009 10:39:42 +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 n5AAdfIs010391;
	Wed, 10 Jun 2009 10:39:41 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AAdfFQ010390;
	Wed, 10 Jun 2009 10:39:41 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906101039.n5AAdfFQ010390@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 10:39: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: r193895 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 10:39:42 -0000

Author: bz
Date: Wed Jun 10 10:39:41 2009
New Revision: 193895
URL: http://svn.freebsd.org/changeset/base/193895

Log:
  Remove the "The option TCPDEBUG requires option INET." requirement.
  In case of !INET we will not have a timestamp on the trace for now
  but that might only affect spx debugging as long as INET6 requires
  INET.
  
  Reviewed by:	rwatson (earlier version)

Modified:
  head/sys/netinet/tcp_debug.c

Modified: head/sys/netinet/tcp_debug.c
==============================================================================
--- head/sys/netinet/tcp_debug.c	Wed Jun 10 10:34:59 2009	(r193894)
+++ head/sys/netinet/tcp_debug.c	Wed Jun 10 10:39:41 2009	(r193895)
@@ -37,10 +37,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet6.h"
 #include "opt_tcpdebug.h"
 
-#ifndef INET
-#error The option TCPDEBUG requires option INET.
-#endif
-
 #ifdef TCPDEBUG
 /* load symbolic names */
 #define PRUREQUESTS
@@ -121,7 +117,9 @@ tcp_trace(short act, short ostate, struc
 	    (isipv6 != 0) ? AF_INET6 :
 #endif
 	    AF_INET;
+#ifdef INET
 	td->td_time = iptime();
+#endif
 	td->td_act = act;
 	td->td_ostate = ostate;
 	td->td_tcb = (caddr_t)tp;
@@ -129,9 +127,11 @@ tcp_trace(short act, short ostate, struc
 		td->td_cb = *tp;
 	if (ipgen != NULL) {
 		switch (td->td_family) {
+#ifdef INET
 		case AF_INET:
 			bcopy(ipgen, &td->td_ti.ti_i, sizeof(td->td_ti.ti_i));
 			break;
+#endif
 #ifdef INET6
 		case AF_INET6:
 			bcopy(ipgen, td->td_ip6buf, sizeof(td->td_ip6buf));
@@ -141,9 +141,11 @@ tcp_trace(short act, short ostate, struc
 	}
 	if (th != NULL) {
 		switch (td->td_family) {
+#ifdef INET
 		case AF_INET:
 			td->td_ti.ti_t = *th;
 			break;
+#endif
 #ifdef INET6
 		case AF_INET6:
 			td->td_ti6.th = *th;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 10:45:27 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from miki (localhost [IPv6:::1])
	by hub.freebsd.org (Postfix) with SMTP id 007A910656EB;
	Wed, 10 Jun 2009 10:45:24 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Date: Wed, 10 Jun 2009 18:45:21 +0800
From: Ariff Abdullah 
To: "Bjoern A. Zeeb" 
Message-Id: <20090610184521.56b24c2f.ariff@FreeBSD.org>
In-Reply-To: <20090610102419.Q22887@maildrop.int.zabbadoz.net>
References: <200906090903.n5993D3E062579@svn.freebsd.org>
	<20090609090541.D22887@maildrop.int.zabbadoz.net>
	<20090610175011.E20224@delplex.bde.org>
	<20090610101009.N22887@maildrop.int.zabbadoz.net>
	<20090610102419.Q22887@maildrop.int.zabbadoz.net>
Organization: FreeBSD
X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature";
	micalg="PGP-SHA1";
	boundary="Signature=_Wed__10_Jun_2009_18_45_21_+0800_kMsZ2mBORA57zPOZ"
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, brde@optusnet.com.au
Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 -
 head/sys/modules/sound/sound]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 10:45:27 -0000

--Signature=_Wed__10_Jun_2009_18_45_21_+0800_kMsZ2mBORA57zPOZ
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, 10 Jun 2009 10:24:46 +0000 (UTC)
"Bjoern A. Zeeb"  wrote:
> On Wed, 10 Jun 2009, Bjoern A. Zeeb wrote:
>=20
> > On Wed, 10 Jun 2009, Bruce Evans wrote:
> >
> >> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
> >>=20
> >>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
> >>>> Log:
> >>>>  Depend on @ machine (_ILINKS) as we do with other modules so
> >that @ >>>  is there for parallel (-jN) builds.  Ideally
> >beforedepends in kmod.mk >>>  should do the right thing but it
> >seems it does not. >>=20
> >>> Anyone with lots of build framework know how may want to look at
> >this. >=20
> >> Failures only for parallel builds normally mean missing
> >dependencies. >=20
> >>>> -feeder_eq_gen.h:
> >>>> +feeder_eq_gen.h:	@ machine
> >>>> 	${AWK} -f @/tools/feeder_eq_mkfilter.awk --
> >${FEEDER_EQ_PRESETS} >  >>> ${.TARGET}
> >>=20
> >> Here there is still a missing dependency on the
> >> @/tools/feeder_eq_mkfilter.awk (fixed in the next commit).  This
> >dependency > is not very important, but since the utility has "@"
> >in its pathname, > running it certainly depends on "@".
> >
> > And adding it again messes with @ not being there for parallel
> > builds:(
> >
> > Or in other words:
> >
> > =3D=3D=3D> sound (depend)
> > =3D=3D=3D> sound/sound (depend)
> > make: don't know how to make @/tools/sound/feeder_eq_mkfilter.awk.
> > Stop *** Error code 2
> > 1 error
> > *** Error code 2
> > 1 error
> > *** Error code 2
>=20
> I forgot to mention that the way we currently seem to handle this
> is:
>=20
> http://people.freebsd.org/~bz/20090610-02-sound-Makefile.diff
>=20

More or less like:

http://people.freebsd.org/~ariff/sound_Makefile.diff

Please test it.



--
Ariff Abdullah
FreeBSD

... Recording in stereo is obviously too advanced
    and confusing for us idiot ***** users :P ........

... Going with the standard and orthodox
    is the death of intellect ..............

--Signature=_Wed__10_Jun_2009_18_45_21_+0800_kMsZ2mBORA57zPOZ
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkovjsEACgkQlr+deMUwTNrP9wCeJgLDjhYodniPbtUpGJtW6mbN
sxEAoLIZe2MjLj65WGqlcWKUuGxZRXwm
=aWT/
-----END PGP SIGNATURE-----

--Signature=_Wed__10_Jun_2009_18_45_21_+0800_kMsZ2mBORA57zPOZ--

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 10:47:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D04C8106568C;
	Wed, 10 Jun 2009 10:47:31 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BEBF78FC25;
	Wed, 10 Jun 2009 10:47:31 +0000 (UTC)
	(envelope-from luigi@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AAlVJH010589;
	Wed, 10 Jun 2009 10:47:31 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AAlV0o010588;
	Wed, 10 Jun 2009 10:47:31 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <200906101047.n5AAlV0o010588@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 10 Jun 2009 10:47:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193896 - head/sys/netinet/ipfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 10:47:32 -0000

Author: luigi
Date: Wed Jun 10 10:47:31 2009
New Revision: 193896
URL: http://svn.freebsd.org/changeset/base/193896

Log:
  in ip_dn_ctl(), do not allocate a large structure on the stack,
  and use malloc() instead if/when it is necessary.
  
  The problem is less relevant in previous versions because
  the variable involved (tmp_pipe) is much smaller there.
  Still worth fixing though.
  
  Submitted by:	Marta Carbone (GSOC)
  MFC after:	3 days

Modified:
  head/sys/netinet/ipfw/ip_dummynet.c

Modified: head/sys/netinet/ipfw/ip_dummynet.c
==============================================================================
--- head/sys/netinet/ipfw/ip_dummynet.c	Wed Jun 10 10:39:41 2009	(r193895)
+++ head/sys/netinet/ipfw/ip_dummynet.c	Wed Jun 10 10:47:31 2009	(r193896)
@@ -2165,9 +2165,8 @@ dummynet_get(struct sockopt *sopt)
 static int
 ip_dn_ctl(struct sockopt *sopt)
 {
-    int error = 0 ;
-    struct dn_pipe *p;
-    struct dn_pipe_max tmp_pipe;	/* pipe + large buffer */
+    int error;
+    struct dn_pipe *p = NULL;
 
     error = priv_check(sopt->sopt_td, PRIV_NETINET_DUMMYNET);
     if (error)
@@ -2188,7 +2187,8 @@ ip_dn_ctl(struct sockopt *sopt)
     switch (sopt->sopt_name) {
     default :
 	printf("dummynet: -- unknown option %d", sopt->sopt_name);
-	return EINVAL ;
+	error = EINVAL ;
+	break;
 
     case IP_DUMMYNET_GET :
 	error = dummynet_get(sopt);
@@ -2199,25 +2199,27 @@ ip_dn_ctl(struct sockopt *sopt)
 	break ;
 
     case IP_DUMMYNET_CONFIGURE :
-	p = (struct dn_pipe *)&tmp_pipe ;
-	error = sooptcopyin(sopt, p, sizeof(tmp_pipe), sizeof *p);
+	p = malloc(sizeof(struct dn_pipe_max), M_TEMP, M_WAITOK);
+	error = sooptcopyin(sopt, p, sizeof(struct dn_pipe_max), sizeof *p);
 	if (error)
 	    break ;
 	if (p->samples_no > 0)
-	    p->samples = &tmp_pipe.samples[0];
+	    p->samples = &(((struct dn_pipe_max *)p)->samples[0]);
 
 	error = config_pipe(p);
 	break ;
 
     case IP_DUMMYNET_DEL :	/* remove a pipe or queue */
-	p = (struct dn_pipe *)&tmp_pipe ;
-	error = sooptcopyin(sopt, p, sizeof *p, sizeof *p);
+	p = malloc(sizeof(struct dn_pipe), M_TEMP, M_WAITOK);
+	error = sooptcopyin(sopt, p, sizeof(struct dn_pipe), sizeof *p);
 	if (error)
 	    break ;
 
 	error = delete_pipe(p);
 	break ;
     }
+    if (p != NULL)
+	free(p, M_TEMP);
     return error ;
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 11:19:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25145106571D;
	Wed, 10 Jun 2009 11:19:35 +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 1282E8FC17;
	Wed, 10 Jun 2009 11:19:35 +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 n5ABJYON011375;
	Wed, 10 Jun 2009 11:19:34 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ABJY5P011374;
	Wed, 10 Jun 2009 11:19:34 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906101119.n5ABJY5P011374@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 11:19:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193900 - head/sys/contrib/pf/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 11:19:36 -0000

Author: bz
Date: Wed Jun 10 11:19:34 2009
New Revision: 193900
URL: http://svn.freebsd.org/changeset/base/193900

Log:
  All consumers of in_cksum.h have been properly #ifdefed already,
  so do not include the file either as it would give as an extra
  dependency on INET.

Modified:
  head/sys/contrib/pf/net/if_pflog.c

Modified: head/sys/contrib/pf/net/if_pflog.c
==============================================================================
--- head/sys/contrib/pf/net/if_pflog.c	Wed Jun 10 10:59:25 2009	(r193899)
+++ head/sys/contrib/pf/net/if_pflog.c	Wed Jun 10 11:19:34 2009	(r193900)
@@ -99,9 +99,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef INET
 #ifdef __FreeBSD__
 #include 
 #endif
+#endif
 
 #define PFLOGMTU	(32768 + MHLEN + MLEN)
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 11:30:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB82810656BD;
	Wed, 10 Jun 2009 11:30:09 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FBDB8FC1D;
	Wed, 10 Jun 2009 11:30:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 58D4441C6A7;
	Wed, 10 Jun 2009 13:30:06 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([195.88.108.3])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id 3DIVE5XC2gdU; Wed, 10 Jun 2009 13:30:05 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id A2A1941C6A3; Wed, 10 Jun 2009 13:30:05 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id E78574448E6;
	Wed, 10 Jun 2009 11:25:50 +0000 (UTC)
Date: Wed, 10 Jun 2009 11:25:50 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Ariff Abdullah 
In-Reply-To: <20090610184521.56b24c2f.ariff@FreeBSD.org>
Message-ID: <20090610112430.X22887@maildrop.int.zabbadoz.net>
References: <200906090903.n5993D3E062579@svn.freebsd.org>
	<20090609090541.D22887@maildrop.int.zabbadoz.net>
	<20090610175011.E20224@delplex.bde.org>
	<20090610101009.N22887@maildrop.int.zabbadoz.net>
	<20090610102419.Q22887@maildrop.int.zabbadoz.net>
	<20090610184521.56b24c2f.ariff@FreeBSD.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, brde@optusnet.com.au
Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 -
 head/sys/modules/sound/sound]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 11:30:12 -0000

On Wed, 10 Jun 2009, Ariff Abdullah wrote:

> On Wed, 10 Jun 2009 10:24:46 +0000 (UTC)
> "Bjoern A. Zeeb"  wrote:
>> On Wed, 10 Jun 2009, Bjoern A. Zeeb wrote:
>>
>>> On Wed, 10 Jun 2009, Bruce Evans wrote:
>>>
>>>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
>>>>
>>>>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote:
>>>>>> Log:
>>>>>>  Depend on @ machine (_ILINKS) as we do with other modules so
>>> that @ >>>  is there for parallel (-jN) builds.  Ideally
>>> beforedepends in kmod.mk >>>  should do the right thing but it
>>> seems it does not. >>
>>>>> Anyone with lots of build framework know how may want to look at
>>> this. >
>>>> Failures only for parallel builds normally mean missing
>>> dependencies. >
>>>>>> -feeder_eq_gen.h:
>>>>>> +feeder_eq_gen.h:	@ machine
>>>>>> 	${AWK} -f @/tools/feeder_eq_mkfilter.awk --
>>> ${FEEDER_EQ_PRESETS} >  >>> ${.TARGET}
>>>>
>>>> Here there is still a missing dependency on the
>>>> @/tools/feeder_eq_mkfilter.awk (fixed in the next commit).  This
>>> dependency > is not very important, but since the utility has "@"
>>> in its pathname, > running it certainly depends on "@".
>>>
>>> And adding it again messes with @ not being there for parallel
>>> builds:(
>>>
>>> Or in other words:
>>>
>>> ===> sound (depend)
>>> ===> sound/sound (depend)
>>> make: don't know how to make @/tools/sound/feeder_eq_mkfilter.awk.
>>> Stop *** Error code 2
>>> 1 error
>>> *** Error code 2
>>> 1 error
>>> *** Error code 2
>>
>> I forgot to mention that the way we currently seem to handle this
>> is:
>>
>> http://people.freebsd.org/~bz/20090610-02-sound-Makefile.diff
>>
>
> More or less like:
>
> http://people.freebsd.org/~ariff/sound_Makefile.diff

just seen it on current@.


> Please test it.

Mine worked for me and that's consistent with what we do in
sys/modules/svr4/Makefile and sys/modules/linux/Makefile .

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 11:33:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED77B1065680;
	Wed, 10 Jun 2009 11:33:47 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DB50F8FC1E;
	Wed, 10 Jun 2009 11:33:47 +0000 (UTC)
	(envelope-from ariff@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ABXlCo011731;
	Wed, 10 Jun 2009 11:33:47 GMT (envelope-from ariff@svn.freebsd.org)
Received: (from ariff@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ABXlLG011730;
	Wed, 10 Jun 2009 11:33:47 GMT (envelope-from ariff@svn.freebsd.org)
Message-Id: <200906101133.n5ABXlLG011730@svn.freebsd.org>
From: Ariff Abdullah 
Date: Wed, 10 Jun 2009 11:33: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: r193902 - head/sys/modules/sound/sound
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 11:33:49 -0000

Author: ariff
Date: Wed Jun 10 11:33:47 2009
New Revision: 193902
URL: http://svn.freebsd.org/changeset/base/193902

Log:
  Attempt to fix parallel build.

Modified:
  head/sys/modules/sound/sound/Makefile

Modified: head/sys/modules/sound/sound/Makefile
==============================================================================
--- head/sys/modules/sound/sound/Makefile	Wed Jun 10 11:33:01 2009	(r193901)
+++ head/sys/modules/sound/sound/Makefile	Wed Jun 10 11:33:47 2009	(r193902)
@@ -19,13 +19,19 @@ SRCS+=	ac97.c ac97_patch.c buffer.c chan
 SRCS+=	mixer.c sndstat.c sound.c unit.c vchan.c
 SRCS+=	midi.c mpu401.c sequencer.c
 
-feeder_eq_gen.h:	@ @/tools/sound/feeder_eq_mkfilter.awk machine
+@/tools/sound/feeder_eq_mkfilter.awk:	@
+
+@/tools/sound/feeder_rate_mkfilter.awk:	@
+
+@/tools/sound/snd_fxdiv_gen.awk:	@
+
+feeder_eq_gen.h:	@/tools/sound/feeder_eq_mkfilter.awk machine
 	${AWK} -f @/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
 
-feeder_rate_gen.h:	@ @/tools/sound/feeder_rate_mkfilter.awk machine
+feeder_rate_gen.h:	@/tools/sound/feeder_rate_mkfilter.awk machine
 	${AWK} -f @/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
 
-snd_fxdiv_gen.h:	@ @/tools/sound/snd_fxdiv_gen.awk machine
+snd_fxdiv_gen.h:	@/tools/sound/snd_fxdiv_gen.awk machine
 	${AWK} -f @/tools/sound/snd_fxdiv_gen.awk -- > ${.TARGET}
 
 CLEANFILES+=	feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 12:20:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 524651065673;
	Wed, 10 Jun 2009 12:20:12 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E51E8FC13;
	Wed, 10 Jun 2009 12:20:12 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ACKCJx012885;
	Wed, 10 Jun 2009 12:20:12 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ACKBY6012877;
	Wed, 10 Jun 2009 12:20:11 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200906101220.n5ACKBY6012877@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 10 Jun 2009 12:20:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193908 - in head: etc/mtree share/colldef
	share/mklocale share/monetdef share/msgdef share/numericdef
	share/timedef
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 12:20:13 -0000

Author: edwin
Date: Wed Jun 10 12:20:11 2009
New Revision: 193908
URL: http://svn.freebsd.org/changeset/base/193908

Log:
  add ca_AD, ca_FR and ca_IT locales
  
      Catalan language is not only spoken in Spain (ca_ES), but also
      in Andorra, France and Italy. In Andorra it is the official
      language.
  
      (see http://en.wikipedia.org/wiki/Catalan_language#Geographic_distribution)
  
  Add a bunch of symlinks to between ca_ES and ca_AD, ca_FR and ca_IT.
  
  PR:		conf/92541
  Submitted by:	
  MFC after:	1 week

Modified:
  head/etc/mtree/BSD.local.dist
  head/etc/mtree/BSD.usr.dist
  head/share/colldef/Makefile
  head/share/mklocale/Makefile
  head/share/monetdef/Makefile
  head/share/msgdef/Makefile
  head/share/numericdef/Makefile
  head/share/timedef/Makefile

Modified: head/etc/mtree/BSD.local.dist
==============================================================================
--- head/etc/mtree/BSD.local.dist	Wed Jun 10 12:07:55 2009	(r193907)
+++ head/etc/mtree/BSD.local.dist	Wed Jun 10 12:20:11 2009	(r193908)
@@ -541,12 +541,30 @@
             ..
             bg_BG.UTF-8
             ..
+            ca_AD.ISO8859-1
+            ..
             ca_ES.ISO8859-1
             ..
+            ca_FR.ISO8859-1
+            ..
+            ca_IT.ISO8859-1
+            ..
+            ca_AD.ISO8859-15
+            ..
             ca_ES.ISO8859-15
             ..
+            ca_FR.ISO8859-15
+            ..
+            ca_IT.ISO8859-15
+            ..
+            ca_AD.UTF-8
+            ..
             ca_ES.UTF-8
             ..
+            ca_FR.UTF-8
+            ..
+            ca_IT.UTF-8
+            ..
             cs_CZ.ISO8859-2
             ..
             cs_CZ.UTF-8

Modified: head/etc/mtree/BSD.usr.dist
==============================================================================
--- head/etc/mtree/BSD.usr.dist	Wed Jun 10 12:07:55 2009	(r193907)
+++ head/etc/mtree/BSD.usr.dist	Wed Jun 10 12:20:11 2009	(r193908)
@@ -357,12 +357,30 @@
             ..
             bg_BG.UTF-8
             ..
+            ca_AD.ISO8859-1
+            ..
             ca_ES.ISO8859-1
             ..
+            ca_FR.ISO8859-1
+            ..
+            ca_IT.ISO8859-1
+            ..
+            ca_AD.ISO8859-15
+            ..
             ca_ES.ISO8859-15
             ..
+            ca_FR.ISO8859-15
+            ..
+            ca_IT.ISO8859-15
+            ..
+            ca_AD.UTF-8
+            ..
             ca_ES.UTF-8
             ..
+            ca_FR.UTF-8
+            ..
+            ca_IT.UTF-8
+            ..
             cs_CZ.ISO8859-2
             ..
             cs_CZ.UTF-8

Modified: head/share/colldef/Makefile
==============================================================================
--- head/share/colldef/Makefile	Wed Jun 10 12:07:55 2009	(r193907)
+++ head/share/colldef/Makefile	Wed Jun 10 12:20:11 2009	(r193908)
@@ -69,6 +69,7 @@ ISO8859-1_ISO8859-1= ${ISO8859-15_ISO885
 LATIN1LINKS=	af_ZA da_DK en_AU en_CA en_GB en_NZ en_US eu_ES fi_FI \
 		fr_BE fr_CA fr_CH fr_FR it_CH it_IT nl_BE nl_NL pt_PT
 ISO8859-15_ISO8859-15= \
+	ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT \
 	de_DE:de_AT de_DE:de_CH \
 	no_NO:nb_NO no_NO:nn_NO \
 	${LATIN1LINKS:C/^/la_LN:/}
@@ -89,11 +90,11 @@ US-ASCII_SJIS=	la_LN:ja_JP
 ASCIILINKS=	en_AU en_CA en_GB en_NZ en_US
 US-ASCII_US-ASCII= ${ASCIILINKS:C/^/la_LN:/}
 
-UTF8LINKS=	af_ZA am_ET be_BY bg_BG ca_ES cs_CZ da_DK de_AT de_CH \
-		de_DE el_GR en_AU en_CA en_GB en_IE en_NZ en_US es_ES \
-		et_EE eu_ES fi_FI fr_BE \
-		fr_CA fr_CH fr_FR he_IL hr_HR hu_HU hy_AM is_IS it_CH it_IT \
-		ja_JP kk_KZ ko_KR lt_LT mn_MN \
+UTF8LINKS=	af_ZA am_ET be_BY bg_BG ca_AD ca_ES ca_FR ca_IT cs_CZ \
+		da_DK de_AT de_CH de_DE \
+		el_GR en_AU en_CA en_GB en_IE en_NZ en_US es_ES et_EE eu_ES \
+		fi_FI fr_BE fr_CA fr_CH fr_FR he_IL hr_HR hu_HU hy_AM \
+		is_IS it_CH it_IT ja_JP kk_KZ ko_KR lt_LT mn_MN \
 		nb_NO nl_BE nl_NL nn_NO no_NO pl_PL pt_BR pt_PT \
 		ro_RO ru_RU sk_SK sl_SI sr_YU sv_SE tr_TR uk_UA zh_CN zh_HK \
 		zh_TW

Modified: head/share/mklocale/Makefile
==============================================================================
--- head/share/mklocale/Makefile	Wed Jun 10 12:07:55 2009	(r193907)
+++ head/share/mklocale/Makefile	Wed Jun 10 12:20:11 2009	(r193908)
@@ -52,8 +52,9 @@ ENCODINGS=      CP1251 ISO8859-1 ISO8859
 ASCIILINKS=	en_AU en_CA en_GB en_NZ en_US
 US-ASCII_US-ASCII= ${ASCIILINKS:C/^/la_LN:/}
 
-LATIN1XLINKS=   af_ZA ca_ES da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_NZ \
-		en_US es_ES eu_ES fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH \
+LATIN1XLINKS=	af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \
+		en_AU en_CA en_GB en_NZ en_US es_ES eu_ES \
+		fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH \
 		it_IT nb_NO nl_BE nl_NL nn_NO no_NO pt_PT sv_SE
 LATIN1LINKS=	${LATIN1XLINKS} pt_BR
 ISO8859-1_ISO8859-1= ${LATIN1LINKS:C/^/la_LN:/}
@@ -73,7 +74,8 @@ ISO8859-5_ISO8859-5= ${LATIN5LINKS:C/^/r
 CP1251LINKS=    ru_RU be_BY uk_UA
 CP1251_CP1251=	${CP1251LINKS:C/^/bg_BG:/}
 
-UTF8LINKS=	af_ZA be_BY bg_BG ca_ES cs_CZ da_DK de_AT de_CH de_DE el_GR \
+UTF8LINKS=	af_ZA be_BY bg_BG ca_AD ca_ES ca_FR ca_IT cs_CZ \
+		da_DK de_AT de_CH de_DE el_GR \
 		en_AU en_CA en_GB en_IE en_NZ en_US es_ES et_EE eu_ES fi_FI \
 		fr_BE \
 		fr_CA fr_CH fr_FR he_IL hr_HR hu_HU hy_AM is_IS it_CH it_IT \

Modified: head/share/monetdef/Makefile
==============================================================================
--- head/share/monetdef/Makefile	Wed Jun 10 12:07:55 2009	(r193907)
+++ head/share/monetdef/Makefile	Wed Jun 10 12:20:11 2009	(r193908)
@@ -100,13 +100,16 @@ Big5_UTF-8=	zh_TW
 eucJP_SJIS=	ja_JP
 eucKR_CP949=	ko_KR
 GB2312_GBK=	zh_CN
-ISO8859-1_ISO8859-1= es_ES:eu_ES de_CH:fr_CH de_CH:it_CH no_NO:nb_NO no_NO:nn_NO
-ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_AT de_CH de_DE en_AU en_CA \
-		en_GB en_NZ en_US es_ES fi_FI fr_BE fr_CA fr_CH fr_FR \
+ISO8859-1_ISO8859-1= ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT es_ES:eu_ES \
+		de_CH:fr_CH de_CH:it_CH no_NO:nb_NO no_NO:nn_NO
+ISO8859-1_ISO8859-15= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \
+		en_AU en_CA en_GB en_NZ en_US es_ES \
+		fi_FI fr_BE fr_CA fr_CH fr_FR \
 		is_IS it_IT it_CH nl_BE nl_NL nb_NO nn_NO no_NO pt_PT sv_SE
 ISO8859-1_US-ASCII= en_AU en_CA en_GB en_NZ en_US
-ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_AT de_CH de_DE en_AU en_CA en_NZ \
-		en_US es_ES fi_FI fr_BE fr_CA fr_FR is_IS it_IT nl_BE \
+ISO8859-1_UTF-8= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \
+		en_AU en_CA en_NZ en_US es_ES \
+		fi_FI fr_BE fr_CA fr_FR is_IS it_IT nl_BE \
 		nl_NL nb_NO nn_NO no_NO pt_BR pt_PT sv_SE
 ISO8859-2_UTF-8= hr_HR hu_HU ro_RO sk_SK sl_SI sr_YU
 ISO8859-7_UTF-8= el_GR
@@ -116,7 +119,8 @@ ISO8859-13_UTF-8= lt_LT
 ISO8859-15_ISO8859-15= es_ES:eu_ES
 ISO8859-15_UTF-8= et_EE
 UTF-8_Big5HKSCS= zh_HK
-UTF-8_UTF-8=	es_ES:eu_ES de_CH:fr_CH de_CH:it_CH
+UTF-8_UTF-8=	ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT \
+		es_ES:eu_ES de_CH:fr_CH de_CH:it_CH
 
 SYMLINKS=
 .for enc1 in ${ENCODINGS}

Modified: head/share/msgdef/Makefile
==============================================================================
--- head/share/msgdef/Makefile	Wed Jun 10 12:07:55 2009	(r193907)
+++ head/share/msgdef/Makefile	Wed Jun 10 12:20:11 2009	(r193908)
@@ -84,6 +84,7 @@ FILESDIR_${locale}.out= ${LOCALEDIR}/${l
 
 CLEANFILES=	${FILES}
 
+CA_LINKS=	ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT
 CZ_LINKS=	cs_CZ:sk_SK
 DE_LINKS=	de_DE:de_AT de_DE:de_CH
 FR_LINKS=	fr_FR:fr_CA
@@ -100,12 +101,12 @@ ENCODINGS=	Big5 Big5HKSCS CP949 eucKR GB
 Big5_Big5HKSCS=	zh_TW:zh_HK
 eucKR_CP949=	ko_KR
 GB2312_GBK=	zh_CN
-ISO8859-1_ISO8859-1= ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \
-		${NL_LINKS} ${NO_LINKS} ${PT_LINKS}
+ISO8859-1_ISO8859-1= ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
+		${IT_LINKS} ${NL_LINKS} ${NO_LINKS} ${PT_LINKS}
 ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_DE en_CA en_GB en_US es_ES \
 		eu_ES fi_FI fr_BE fr_CH fr_FR is_IS it_IT nl_NL no_NO \
 		pt_PT sv_SE \
-		${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \
+		${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \
 		${NL_LINKS} ${NO_LINKS}
 ISO8859-1_US-ASCII= ${GB_LINKS} en_CA en_GB en_US
 ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_DE en_CA en_GB en_US es_ES eu_ES \
@@ -117,7 +118,8 @@ ISO8859-9_UTF-8= tr_TR
 ISO8859-13_ISO8859-4= lt_LT
 ISO8859-13_UTF-8= lt_LT
 ISO8859-15_UTF-8= et_EE
-UTF-8_UTF-8=	${CZ_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} en_GB:en_IE \
+UTF-8_UTF-8=	${CA_LINKS} ${CZ_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
+		en_GB:en_IE \
 		${IT_LINKS} ${NL_LINKS} ${NO_LINKS} ${PT_LINKS} zh_TW:zh_HK
 
 SYMLINKS=

Modified: head/share/numericdef/Makefile
==============================================================================
--- head/share/numericdef/Makefile	Wed Jun 10 12:07:55 2009	(r193907)
+++ head/share/numericdef/Makefile	Wed Jun 10 12:20:11 2009	(r193908)
@@ -68,6 +68,7 @@ ENCODINGS=	ARMSCII-8 Big5 Big5HKSCS \
 		KOI8-R KOI8-U PT154 SJIS US-ASCII UTF-8
 
 BE_LINKS=	fr_BE:nl_BE
+CA_LINKS=	ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT
 DE_LINKS=	de_DE:de_AT
 FR_LINKS=	fr_FR:fr_CA fr_FR:fr_CH
 GB_LINKS=	en_GB:en_AU en_GB:en_NZ
@@ -92,11 +93,11 @@ eucJP_UTF-8=	ja_JP
 eucKR_CP949=	ko_KR
 eucKR_UTF-8=	ko_KR
 ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES \
-		fi_FI fr_BE fr_FR is_IS it_CH it_IT nl_NL no_NO pt_PT \
-		sv_SE ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
-		${IT_LINKS} ${NO_LINKS} ${US_LINKS}
-ISO8859-1_ISO8859-1= ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
+		fi_FI fr_BE fr_FR is_IS it_CH it_IT nl_NL no_NO pt_PT sv_SE \
+		${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
 		${IT_LINKS} ${NO_LINKS} ${US_LINKS}
+ISO8859-1_ISO8859-1= ${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} \
+		${GB_LINKS} ${IT_LINKS} ${NO_LINKS} ${US_LINKS}
 ISO8859-1_US-ASCII= en_US ${GB_LINKS} ${US_LINKS}
 ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES fi_FI \
 		fr_BE fr_FR is_IS it_IT nl_NL no_NO pt_BR pt_PT sv_SE
@@ -114,8 +115,8 @@ KOI8-R_ISO8859-5= ru_RU
 KOI8-U_ISO8859-5= uk_UA
 PT154_UTF-8=	kk_KZ
 US-ASCII_UTF-8=	en_US:he_IL
-UTF-8_UTF-8=	${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} en_GB:en_IE \
-		${IT_LINKS} ${NO_LINKS} ${US_LINKS}
+UTF-8_UTF-8=	${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
+		en_GB:en_IE ${IT_LINKS} ${NO_LINKS} ${US_LINKS}
 
 SYMLINKS=
 .for enc1 in ${ENCODINGS}

Modified: head/share/timedef/Makefile
==============================================================================
--- head/share/timedef/Makefile	Wed Jun 10 12:07:55 2009	(r193907)
+++ head/share/timedef/Makefile	Wed Jun 10 12:20:11 2009	(r193908)
@@ -114,6 +114,7 @@ ENCODINGS=	Big5HKSCS CP949 eucKR GB2312 
 		ISO8859-1 ISO8859-2 ISO8859-4 ISO8859-15 \
 		US-ASCII UTF-8
 
+CA_LINKS=	ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT
 DE_LINKS=	de_DE:de_CH
 FR_LINKS=	fr_FR:fr_BE fr_FR:fr_CA fr_FR:fr_CH
 IT_LINKS=	it_IT:it_CH
@@ -123,20 +124,21 @@ GB_LINKS=	en_GB:en_AU en_GB:en_CA en_GB:
 
 eucKR_CP949=	ko_KR
 GB2312_GBK=	zh_CN
-ISO8859-1_ISO8859-1= ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \
-		${NL_LINKS} ${NO_LINKS} en_US:af_ZA
+ISO8859-1_ISO8859-1= ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
+		${IT_LINKS} ${NL_LINKS} ${NO_LINKS} en_US:af_ZA
 ISO8859-1_ISO8859-15= ca_ES da_DK de_AT de_DE en_GB en_US es_ES eu_ES \
 		fi_FI fr_FR is_IS it_IT la_LN nb_NO nl_NL nn_NO no_NO pt_PT \
 		sv_SE \
-		${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS}
+		${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \
+		${NL_LINKS}
 ISO8859-1_US-ASCII= ${GB_LINKS} en_GB en_US la_LN
 ISO8859-1_ISO8859-2= la_LN
 ISO8859-1_ISO8859-4= la_LN
 ISO8859-1_UTF-8= en_GB en_US eu_ES nl_NL
 ISO8859-15_ISO8859-15= en_US:af_ZA
 UTF-8_Big5HKSCS= zh_TW:zh_HK
-UTF-8_UTF-8=	${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS} \
-		${NO_LINKS} \
+UTF-8_UTF-8=	${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \
+		${NL_LINKS} ${NO_LINKS} \
 		en_GB:en_IE en_US:af_ZA zh_TW:zh_HK
 
 SYMLINKS=

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 12:47:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67E9A1065672;
	Wed, 10 Jun 2009 12:47:55 +0000 (UTC)
	(envelope-from grehan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5629C8FC0A;
	Wed, 10 Jun 2009 12:47:55 +0000 (UTC)
	(envelope-from grehan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ACltBb013491;
	Wed, 10 Jun 2009 12:47:55 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ACltKW013488;
	Wed, 10 Jun 2009 12:47:55 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <200906101247.n5ACltKW013488@svn.freebsd.org>
From: Peter Grehan 
Date: Wed, 10 Jun 2009 12:47: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: r193909 - in head/sys/powerpc: aim powerpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 12:47:55 -0000

Author: grehan
Date: Wed Jun 10 12:47:54 2009
New Revision: 193909
URL: http://svn.freebsd.org/changeset/base/193909

Log:
  Get the gdb/psim emulator functioning again.
  
  aim/machdep.c:
    - the	RI status register bit needs to be set when	doing the mtmsrd 64-bit
      instruction	test
    - psim doesn't implement the dcbz instruction	so the run-time	cacheline
      test fails.	Set the	cachline size to 32 to avoid infinite loops in
      future calls to __syncicache()
  
  aim/platform_chrp.c:
    - if after iterating through / and a name property of "cpus" still isn't
      found, just	search directly	for '/cpus'.
    - psim doesn't put a "reg" property on it's cpu nodes, so assume 0
      since it is	uniprocessor-only at this point
  
  powerpc/openpic.c
    - the	number of CPUs reported	is 1 too many on psim's	openpic
  
  Reviewed by:	nwhitehorn
  MFC after:	1 week (openpic part)

Modified:
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/aim/platform_chrp.c
  head/sys/powerpc/powerpc/openpic.c

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Wed Jun 10 12:20:11 2009	(r193908)
+++ head/sys/powerpc/aim/machdep.c	Wed Jun 10 12:47:54 2009	(r193909)
@@ -359,7 +359,7 @@ powerpc_init(u_int startkernel, u_int en
 	 */
 
 	msr = mfmsr();
-	mtmsr(msr & ~(PSL_IR | PSL_DR));
+	mtmsr((msr & ~(PSL_IR | PSL_DR)) | PSL_RI);
 	isync();
 
 	/*
@@ -380,6 +380,12 @@ powerpc_init(u_int startkernel, u_int en
 	for (cacheline_size = 0; cacheline_size < 0x100 &&
 	    cache_check[cacheline_size] == 0; cacheline_size++);
 
+	/* Work around psim bug */
+	if (cacheline_size == 0) {
+		printf("WARNING: cacheline size undetermined, setting to 32\n");
+		cacheline_size = 32;
+	}
+
 	/*
 	 * Figure out whether we need to use the 64 bit PMAP. This works by
 	 * executing an instruction that is only legal on 64-bit PPC (mtmsrd),

Modified: head/sys/powerpc/aim/platform_chrp.c
==============================================================================
--- head/sys/powerpc/aim/platform_chrp.c	Wed Jun 10 12:20:11 2009	(r193908)
+++ head/sys/powerpc/aim/platform_chrp.c	Wed Jun 10 12:47:54 2009	(r193909)
@@ -102,7 +102,7 @@ static u_long
 chrp_timebase_freq(platform_t plat, struct cpuref *cpuref)
 {
 	phandle_t phandle;
-	u_long ticks = -1;
+	long ticks = -1;
 
 	phandle = cpuref->cr_hwref;
 
@@ -122,8 +122,14 @@ chrp_smp_fill_cpuref(struct cpuref *cpur
 
 	cpuref->cr_hwref = cpu;
 	res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid));
-	if (res < 0)
-		return (ENOENT);
+
+	/*
+	 * psim doesn't have a reg property, so assume 0 as for the
+	 * uniprocessor case in the CHRP spec. 
+	 */
+	if (res < 0) {
+		cpuid = 0;
+	}
 
 	cpuref->cr_cpuid = cpuid & 0xff;
 	return (0);
@@ -145,10 +151,18 @@ chrp_smp_first_cpu(platform_t plat, stru
 			break;
 		dev = OF_peer(dev);
 	}
-	if (dev == 0)
-		return (ENOENT);
+	if (dev == 0) {
+		/*
+		 * psim doesn't have a name property on the /cpus node,
+		 * but it can be found directly
+		 */
+		dev = OF_finddevice("/cpus");
+		if (dev == 0)
+			return (ENOENT);
+	}
 
 	cpu = OF_child(dev);
+
 	while (cpu != 0) {
 		res = OF_getprop(cpu, "device_type", buf, sizeof(buf));
 		if (res > 0 && strcmp(buf, "cpu") == 0)

Modified: head/sys/powerpc/powerpc/openpic.c
==============================================================================
--- head/sys/powerpc/powerpc/openpic.c	Wed Jun 10 12:20:11 2009	(r193908)
+++ head/sys/powerpc/powerpc/openpic.c	Wed Jun 10 12:47:54 2009	(r193909)
@@ -122,10 +122,12 @@ openpic_attach(device_t dev)
 	    OPENPIC_FEATURE_LAST_IRQ_SHIFT) + 1;
 
 	/*
-	 * PSIM seems to report 1 too many IRQs
+	 * PSIM seems to report 1 too many IRQs and CPUs
 	 */
-	if (sc->sc_psim)
+	if (sc->sc_psim) {
 		sc->sc_nirq--;
+		sc->sc_ncpu--;
+	}
 
 	if (bootverbose)
 		device_printf(dev,

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 13:39:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8A29E1065670;
	Wed, 10 Jun 2009 13:39:51 +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 78D958FC22;
	Wed, 10 Jun 2009 13:39:51 +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 n5ADdpQ6014804;
	Wed, 10 Jun 2009 13:39:51 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ADdph6014803;
	Wed, 10 Jun 2009 13:39:51 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906101339.n5ADdph6014803@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 13:39:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193913 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 13:39:52 -0000

Author: bz
Date: Wed Jun 10 13:39:51 2009
New Revision: 193913
URL: http://svn.freebsd.org/changeset/base/193913

Log:
  ip_gif_ttl/GIF_TTL are only used by the inet part in in_gif.c,
  so put the initialization under #ifdef INET.

Modified:
  head/sys/net/if_gif.c

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Wed Jun 10 13:04:07 2009	(r193912)
+++ head/sys/net/if_gif.c	Wed Jun 10 13:39:51 2009	(r193913)
@@ -274,7 +274,9 @@ vnet_gif_iattach(const void *unused __un
 #else
 	V_parallel_tunnels = 0;
 #endif
+#ifdef INET
 	V_ip_gif_ttl = GIF_TTL;
+#endif
 #ifdef INET6
 	V_ip6_gif_hlim = GIF_HLIM;
 #endif

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 13:48:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 07AA8106564A;
	Wed, 10 Jun 2009 13:48:14 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E9F9E8FC19;
	Wed, 10 Jun 2009 13:48:13 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ADmDnE015105;
	Wed, 10 Jun 2009 13:48:13 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ADmDGH015104;
	Wed, 10 Jun 2009 13:48:13 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906101348.n5ADmDGH015104@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 13:48:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193916 - head/sys/compat/freebsd32
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 13:48:14 -0000

Author: kib
Date: Wed Jun 10 13:48:13 2009
New Revision: 193916
URL: http://svn.freebsd.org/changeset/base/193916

Log:
  Add several syscall compat32 entries for extattr manipulation syscalls,
  that do not require translation of the arguments.
  
  Requested by:	kientzle
  Reviewed by:	jhb (previous wrong version)
  MFC after:	1 week

Modified:
  head/sys/compat/freebsd32/syscalls.master

Modified: head/sys/compat/freebsd32/syscalls.master
==============================================================================
--- head/sys/compat/freebsd32/syscalls.master	Wed Jun 10 13:44:49 2009	(r193915)
+++ head/sys/compat/freebsd32/syscalls.master	Wed Jun 10 13:48:13 2009	(r193916)
@@ -708,9 +708,17 @@
 409	AUE_NULL	UNIMPL	__mac_get_pid
 410	AUE_NULL	UNIMPL	__mac_get_link
 411	AUE_NULL	UNIMPL	__mac_set_link
-412	AUE_EXTATTR_SET_LINK	UNIMPL	extattr_set_link
-413	AUE_EXTATTR_GET_LINK	UNIMPL	extattr_get_link
-414	AUE_EXTATTR_DELETE_LINK	UNIMPL	extattr_delete_link
+412	AUE_EXTATTR_SET_LINK	NOPROTO	{ int extattr_set_link( \
+				    const char *path, int attrnamespace, \
+				    const char *attrname, void *data, \
+				    size_t nbytes); }
+413	AUE_EXTATTR_GET_LINK	NOPROTO	{ ssize_t extattr_get_link( \
+				    const char *path, int attrnamespace, \
+				    const char *attrname, void *data, \
+				    size_t nbytes); }
+414	AUE_EXTATTR_DELETE_LINK	NOPROTO	{ int extattr_delete_link( \
+				    const char *path, int attrnamespace, \
+				    const char *attrname); }
 415	AUE_NULL	UNIMPL	__mac_execve
 416	AUE_SIGACTION	STD	{ int freebsd32_sigaction(int sig, \
 				    struct sigaction32 *act, \
@@ -741,9 +749,15 @@
 434	AUE_NULL	STD	{ int freebsd32_umtx_lock(struct umtx *umtx); }
 435	AUE_NULL	STD	{ int freebsd32_umtx_unlock(struct umtx *umtx); }
 436	AUE_NULL	NOPROTO	{ int jail_attach(int jid); }
-437	AUE_EXTATTR_LIST_FD	UNIMPL	extattr_list_fd
-438	AUE_EXTATTR_LIST_FILE	UNIMPL	extattr_list_file
-439	AUE_EXTATTR_LIST_LINK	UNIMPL	extattr_list_link
+437	AUE_EXTATTR_LIST_FD	NOPROTO	{ ssize_t extattr_list_fd(int fd, \
+				    int attrnamespace, void *data, \
+				    size_t nbytes); }
+438	AUE_EXTATTR_LIST_FILE	NOPROTO	{ ssize_t extattr_list_file( \
+				    const char *path, int attrnamespace, \
+				    void *data, size_t nbytes); }
+439	AUE_EXTATTR_LIST_LINK	NOPROTO	{ ssize_t extattr_list_link( \
+				    const char *path, int attrnamespace, \
+				    void *data, size_t nbytes); }
 440	AUE_NULL	UNIMPL	kse_switchin
 441	AUE_NULL	UNIMPL	ksem_timedwait
 442	AUE_NULL	STD	{ int freebsd32_thr_suspend( \

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 13:48:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 741001065674;
	Wed, 10 Jun 2009 13:48:44 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 58BF28FC2A;
	Wed, 10 Jun 2009 13:48:44 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ADmiP2015159;
	Wed, 10 Jun 2009 13:48:44 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ADmiIV015155;
	Wed, 10 Jun 2009 13:48:44 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906101348.n5ADmiIV015155@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 13:48:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193917 - head/sys/compat/freebsd32
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 13:48:45 -0000

Author: kib
Date: Wed Jun 10 13:48:43 2009
New Revision: 193917
URL: http://svn.freebsd.org/changeset/base/193917

Log:
  Regenerate

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_proto.h	Wed Jun 10 13:48:13 2009	(r193916)
+++ head/sys/compat/freebsd32/freebsd32_proto.h	Wed Jun 10 13:48:43 2009	(r193917)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 191673 2009-04-29 21:14:15Z jamie 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 193916 2009-06-10 13:48:13Z kib 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscall.h	Wed Jun 10 13:48:13 2009	(r193916)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h	Wed Jun 10 13:48:43 2009	(r193917)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 191673 2009-04-29 21:14:15Z jamie 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 193916 2009-06-10 13:48:13Z kib 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -303,6 +303,9 @@
 #define	FREEBSD32_SYS_statfs	396
 #define	FREEBSD32_SYS_fstatfs	397
 #define	FREEBSD32_SYS_fhstatfs	398
+#define	FREEBSD32_SYS_extattr_set_link	412
+#define	FREEBSD32_SYS_extattr_get_link	413
+#define	FREEBSD32_SYS_extattr_delete_link	414
 #define	FREEBSD32_SYS_freebsd32_sigaction	416
 #define	FREEBSD32_SYS_freebsd32_sigreturn	417
 #define	FREEBSD32_SYS_freebsd32_getcontext	421
@@ -315,6 +318,9 @@
 #define	FREEBSD32_SYS_freebsd32_umtx_lock	434
 #define	FREEBSD32_SYS_freebsd32_umtx_unlock	435
 #define	FREEBSD32_SYS_jail_attach	436
+#define	FREEBSD32_SYS_extattr_list_fd	437
+#define	FREEBSD32_SYS_extattr_list_file	438
+#define	FREEBSD32_SYS_extattr_list_link	439
 #define	FREEBSD32_SYS_freebsd32_thr_suspend	442
 #define	FREEBSD32_SYS_thr_wake	443
 #define	FREEBSD32_SYS_kldunloadf	444

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Jun 10 13:48:13 2009	(r193916)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Jun 10 13:48:43 2009	(r193917)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 191673 2009-04-29 21:14:15Z jamie 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 193916 2009-06-10 13:48:13Z kib 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -419,9 +419,9 @@ const char *freebsd32_syscallnames[] = {
 	"#409",			/* 409 = __mac_get_pid */
 	"#410",			/* 410 = __mac_get_link */
 	"#411",			/* 411 = __mac_set_link */
-	"#412",			/* 412 = extattr_set_link */
-	"#413",			/* 413 = extattr_get_link */
-	"#414",			/* 414 = extattr_delete_link */
+	"extattr_set_link",			/* 412 = extattr_set_link */
+	"extattr_get_link",			/* 413 = extattr_get_link */
+	"extattr_delete_link",			/* 414 = extattr_delete_link */
 	"#415",			/* 415 = __mac_execve */
 	"freebsd32_sigaction",			/* 416 = freebsd32_sigaction */
 	"freebsd32_sigreturn",			/* 417 = freebsd32_sigreturn */
@@ -444,9 +444,9 @@ const char *freebsd32_syscallnames[] = {
 	"freebsd32_umtx_lock",			/* 434 = freebsd32_umtx_lock */
 	"freebsd32_umtx_unlock",			/* 435 = freebsd32_umtx_unlock */
 	"jail_attach",			/* 436 = jail_attach */
-	"#437",			/* 437 = extattr_list_fd */
-	"#438",			/* 438 = extattr_list_file */
-	"#439",			/* 439 = extattr_list_link */
+	"extattr_list_fd",			/* 437 = extattr_list_fd */
+	"extattr_list_file",			/* 438 = extattr_list_file */
+	"extattr_list_link",			/* 439 = extattr_list_link */
 	"#440",			/* 440 = kse_switchin */
 	"#441",			/* 441 = ksem_timedwait */
 	"freebsd32_thr_suspend",			/* 442 = freebsd32_thr_suspend */

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_sysent.c	Wed Jun 10 13:48:13 2009	(r193916)
+++ head/sys/compat/freebsd32/freebsd32_sysent.c	Wed Jun 10 13:48:43 2009	(r193917)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 191673 2009-04-29 21:14:15Z jamie 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 193916 2009-06-10 13:48:13Z kib 
  */
 
 #include "opt_compat.h"
@@ -450,9 +450,9 @@ struct sysent freebsd32_sysent[] = {
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 409 = __mac_get_pid */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 410 = __mac_get_link */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 411 = __mac_set_link */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 412 = extattr_set_link */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 413 = extattr_get_link */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 414 = extattr_delete_link */
+	{ AS(extattr_set_link_args), (sy_call_t *)extattr_set_link, AUE_EXTATTR_SET_LINK, NULL, 0, 0, 0 },	/* 412 = extattr_set_link */
+	{ AS(extattr_get_link_args), (sy_call_t *)extattr_get_link, AUE_EXTATTR_GET_LINK, NULL, 0, 0, 0 },	/* 413 = extattr_get_link */
+	{ AS(extattr_delete_link_args), (sy_call_t *)extattr_delete_link, AUE_EXTATTR_DELETE_LINK, NULL, 0, 0, 0 },	/* 414 = extattr_delete_link */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 415 = __mac_execve */
 	{ AS(freebsd32_sigaction_args), (sy_call_t *)freebsd32_sigaction, AUE_SIGACTION, NULL, 0, 0, 0 },	/* 416 = freebsd32_sigaction */
 	{ AS(freebsd32_sigreturn_args), (sy_call_t *)freebsd32_sigreturn, AUE_SIGRETURN, NULL, 0, 0, 0 },	/* 417 = freebsd32_sigreturn */
@@ -475,9 +475,9 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(freebsd32_umtx_lock_args), (sy_call_t *)freebsd32_umtx_lock, AUE_NULL, NULL, 0, 0, 0 },	/* 434 = freebsd32_umtx_lock */
 	{ AS(freebsd32_umtx_unlock_args), (sy_call_t *)freebsd32_umtx_unlock, AUE_NULL, NULL, 0, 0, 0 },	/* 435 = freebsd32_umtx_unlock */
 	{ AS(jail_attach_args), (sy_call_t *)jail_attach, AUE_NULL, NULL, 0, 0, 0 },	/* 436 = jail_attach */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 437 = extattr_list_fd */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 438 = extattr_list_file */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 439 = extattr_list_link */
+	{ AS(extattr_list_fd_args), (sy_call_t *)extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, 0 },	/* 437 = extattr_list_fd */
+	{ AS(extattr_list_file_args), (sy_call_t *)extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0, 0 },	/* 438 = extattr_list_file */
+	{ AS(extattr_list_link_args), (sy_call_t *)extattr_list_link, AUE_EXTATTR_LIST_LINK, NULL, 0, 0, 0 },	/* 439 = extattr_list_link */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 440 = kse_switchin */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 441 = ksem_timedwait */
 	{ AS(freebsd32_thr_suspend_args), (sy_call_t *)freebsd32_thr_suspend, AUE_NULL, NULL, 0, 0, 0 },	/* 442 = freebsd32_thr_suspend */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 13:56:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3F4621065670;
	Wed, 10 Jun 2009 13:56:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 12A918FC14;
	Wed, 10 Jun 2009 13:56:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ADug7O015411;
	Wed, 10 Jun 2009 13:56:42 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ADugHA015410;
	Wed, 10 Jun 2009 13:56:42 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200906101356.n5ADugHA015410@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 10 Jun 2009 13:56: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: r193918 - head/sys/dev/ata/chipsets
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 13:56:43 -0000

Author: jhb
Date: Wed Jun 10 13:56:42 2009
New Revision: 193918
URL: http://svn.freebsd.org/changeset/base/193918

Log:
  Preallocate the four BARs in ALI SATA controllers during the chipinit
  routine and save the resources using a chipset-data structure.  Use these
  preallocated resources to setup resources for the SATA channels to avoid
  asking the PCI bus to allocate the same BAR multiple times.
  
  Tested by:	bms
  MFC after:	1 week

Modified:
  head/sys/dev/ata/chipsets/ata-acerlabs.c

Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-acerlabs.c	Wed Jun 10 13:48:43 2009	(r193917)
+++ head/sys/dev/ata/chipsets/ata-acerlabs.c	Wed Jun 10 13:56:42 2009	(r193918)
@@ -63,6 +63,9 @@ static void ata_ali_setmode(device_t dev
 #define ALI_NEW		0x02
 #define ALI_SATA	0x04
 
+struct ali_sata_resources {
+	struct resource *bars[4];
+};
 
 /*
  * Acer Labs Inc (ALI) chipset support functions
@@ -98,6 +101,8 @@ static int
 ata_ali_chipinit(device_t dev)
 {
     struct ata_pci_controller *ctlr = device_get_softc(dev);
+    struct ali_sata_resources *res;
+    int i, rid;
 
     if (ata_setup_interrupt(dev, ata_generic_intr))
 	return ENXIO;
@@ -113,6 +118,22 @@ ata_ali_chipinit(device_t dev)
 	if ((ctlr->chip->chipid == ATA_ALI_5288) &&
 	    (ata_ahci_chipinit(dev) != ENXIO))
             return 0;
+
+	/* Allocate resources for later use by channel attach routines. */
+	res = malloc(sizeof(struct ali_sata_resources), M_TEMP, M_WAITOK);
+	for (i = 0; i < 4; i++) {
+		rid = PCIR_BAR(i);
+		res->bars[i] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
+		    RF_ACTIVE);
+		if (res->bars[i] == NULL) {
+			device_printf(dev, "Failed to allocate BAR %d\n", i);
+			for (i--; i >=0; i--)
+				bus_release_resource(dev, SYS_RES_IOPORT,
+				    PCIR_BAR(i), res->bars[i]);
+			free(res, M_TEMP);
+		}
+	}
+	ctlr->chipset_data = res;
 	break;
 
     case ALI_NEW:
@@ -168,20 +189,18 @@ ata_ali_sata_ch_attach(device_t dev)
     device_t parent = device_get_parent(dev);
     struct ata_pci_controller *ctlr = device_get_softc(parent);
     struct ata_channel *ch = device_get_softc(dev);
+    struct ali_sata_resources *res;
     struct resource *io = NULL, *ctlio = NULL;
     int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2);
-    int i, rid;
-		
-    rid = PCIR_BAR(0) + (unit01 ? 8 : 0);
-    io = bus_alloc_resource_any(parent, SYS_RES_IOPORT, &rid, RF_ACTIVE);
-    if (!io)
-	return ENXIO;
+    int i;
 
-    rid = PCIR_BAR(1) + (unit01 ? 8 : 0);
-    ctlio = bus_alloc_resource_any(parent, SYS_RES_IOPORT, &rid, RF_ACTIVE);
-    if (!ctlio) {
-	bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io);
-	return ENXIO;
+    res = ctlr->chipset_data;
+    if (unit01) {
+	    io = res->bars[2];
+	    ctlio = res->bars[3];
+    } else {
+	    io = res->bars[0];
+	    ctlio = res->bars[1];
     }
 		
     for (i = ATA_DATA; i <= ATA_COMMAND; i ++) {

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 13:56:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D66261065675;
	Wed, 10 Jun 2009 13:56:58 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id A8FFD8FC32;
	Wed, 10 Jun 2009 13:56:58 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 46A5C46B1A;
	Wed, 10 Jun 2009 09:56:58 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 528EA8A06E;
	Wed, 10 Jun 2009 09:56:57 -0400 (EDT)
From: John Baldwin 
To: Kip Macy 
Date: Wed, 10 Jun 2009 09:15:52 -0400
User-Agent: KMail/1.9.7
References: <200906092155.n59LtS7f085080@svn.freebsd.org>
In-Reply-To: <200906092155.n59LtS7f085080@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200906100915.52883.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Wed, 10 Jun 2009 09:56:57 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193863 - in head/sys: conf net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 13:56:59 -0000

On Tuesday 09 June 2009 5:55:28 pm Kip Macy wrote:
> Author: kmacy
> Date: Tue Jun  9 21:55:28 2009
> New Revision: 193863
> URL: http://svn.freebsd.org/changeset/base/193863
> 
> Log:
>   revert to opt-in flowtable

Thanks.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 13:57:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 379DE106567F;
	Wed, 10 Jun 2009 13:57:00 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 03F0D8FC19;
	Wed, 10 Jun 2009 13:57:00 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id A5FCB46B37;
	Wed, 10 Jun 2009 09:56:59 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 84E3A8A06A;
	Wed, 10 Jun 2009 09:56:58 -0400 (EDT)
From: John Baldwin 
To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= 
Date: Wed, 10 Jun 2009 09:23:41 -0400
User-Agent: KMail/1.9.7
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
	<3c1674c90906100008i4c632312j32f223b8aca14934@mail.gmail.com>
	<86ljo0wgnv.fsf@ds4.des.no>
In-Reply-To: <86ljo0wgnv.fsf@ds4.des.no>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Message-Id: <200906100923.42093.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Wed, 10 Jun 2009 09:56:58 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Kip Macy ,
	Dmitry Morozovsky 
Subject: Re: svn commit: r193878 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 13:57:00 -0000

On Wednesday 10 June 2009 6:02:12 am Dag-Erling Sm=C3=B8rgrav wrote:
> Kip Macy  writes:
> > Dmitry Morozovsky  writes:
> > > Hmm, I failed to see how boolean prevent the usage:
> > >
> > > if arch=3D=3Di386 || memsize < 4G
> > > =C2=A0 =C2=A0 =C2=A0 =C2=A0zfs_prefetch=3D0
> > > else
> > > =C2=A0 =C2=A0 =C2=A0 =C2=A0zfs_prefetch=3D1
> > >
> > > and admin can flip the switch to non-default position.
> > >
> > Right, what you're advocating is zfs_prefetch_non_default. Which is
> > simpler, but still rather weird.
>=20
> No, he's advocating zfs_prefetch_enable which is initialized to either 0
> or 1 at boot time and can be administratively set to either 0 and 1
> regardless of its initial value.  I don't see the problem...

Yes, you can simply do a TUNABLE_INT_FETCH() after the initial calculation =
to=20
honor any user override.  Many existing settings already work this way wher=
e=20
the user can override the auto-tuned value (e.g. all the buffer-cache tunin=
g=20
settings).

=2D-=20
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 13:57:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4958D106588A;
	Wed, 10 Jun 2009 13:57:37 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3731D8FC2C;
	Wed, 10 Jun 2009 13:57:37 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ADvbuh015468;
	Wed, 10 Jun 2009 13:57:37 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ADvbGU015465;
	Wed, 10 Jun 2009 13:57:37 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906101357.n5ADvbGU015465@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 13:57:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193919 - in head/sys/fs: cd9660 devfs pseudofs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 13:57:38 -0000

Author: kib
Date: Wed Jun 10 13:57:36 2009
New Revision: 193919
URL: http://svn.freebsd.org/changeset/base/193919

Log:
  VOP_IOCTL takes unlocked vnode as an argument. Due to this, v_data may
  be NULL or derefenced memory may become free at arbitrary moment.
  
  Lock the vnode in cd9660, devfs and pseudofs implementation of VOP_IOCTL
  to prevent reclaim; check whether the vnode was already reclaimed after
  the lock is granted.
  
  Reported by:	georg at dts su
  Reviewed by:	des (pseudofs)
  MFC after:	2 weeks

Modified:
  head/sys/fs/cd9660/cd9660_vnops.c
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/fs/pseudofs/pseudofs_vnops.c

Modified: head/sys/fs/cd9660/cd9660_vnops.c
==============================================================================
--- head/sys/fs/cd9660/cd9660_vnops.c	Wed Jun 10 13:56:42 2009	(r193918)
+++ head/sys/fs/cd9660/cd9660_vnops.c	Wed Jun 10 13:57:36 2009	(r193919)
@@ -251,20 +251,31 @@ cd9660_ioctl(ap)
 		struct thread *a_td;
 	} */ *ap;
 {
-	struct vnode *vp = ap->a_vp;
-	struct iso_node *ip = VTOI(vp);
+	struct vnode *vp;
+	struct iso_node *ip;
+	int error;
 
-	if (vp->v_type == VCHR || vp->v_type == VBLK)
+	vp = ap->a_vp;
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	if (vp->v_type == VCHR || vp->v_type == VBLK) {
+		VOP_UNLOCK(vp, 0);
 		return (EOPNOTSUPP);
+	}
 
-	switch (ap->a_command) {
+	ip = VTOI(vp);
+	error = 0;
 
+	switch (ap->a_command) {
 	case FIOGETLBA:
 		*(int *)(ap->a_data) = ip->iso_start;
-		return 0;
+		break;
 	default:
-		return (ENOTTY);
+		error = ENOTTY;
+		break;
 	}
+
+	VOP_UNLOCK(vp, 0);
+	return (error);
 }
 
 /*

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Wed Jun 10 13:56:42 2009	(r193918)
+++ head/sys/fs/devfs/devfs_vnops.c	Wed Jun 10 13:57:36 2009	(r193919)
@@ -1276,11 +1276,19 @@ devfs_revoke(struct vop_revoke_args *ap)
 static int
 devfs_rioctl(struct vop_ioctl_args *ap)
 {
-	int error;
+	struct vnode *vp;
 	struct devfs_mount *dmp;
+	int error;
 
-	dmp = VFSTODEVFS(ap->a_vp->v_mount);
+	vp = ap->a_vp;
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	if (vp->v_iflag & VI_DOOMED) {
+		VOP_UNLOCK(vp, 0);
+		return (EBADF);
+	}
+	dmp = VFSTODEVFS(vp->v_mount);
 	sx_xlock(&dmp->dm_lock);
+	VOP_UNLOCK(vp, 0);
 	DEVFS_DMP_HOLD(dmp);
 	devfs_populate(dmp);
 	if (DEVFS_DMP_DROP(dmp)) {

Modified: head/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- head/sys/fs/pseudofs/pseudofs_vnops.c	Wed Jun 10 13:56:42 2009	(r193918)
+++ head/sys/fs/pseudofs/pseudofs_vnops.c	Wed Jun 10 13:57:36 2009	(r193919)
@@ -260,34 +260,50 @@ pfs_getattr(struct vop_getattr_args *va)
 static int
 pfs_ioctl(struct vop_ioctl_args *va)
 {
-	struct vnode *vn = va->a_vp;
-	struct pfs_vdata *pvd = vn->v_data;
-	struct pfs_node *pn = pvd->pvd_pn;
+	struct vnode *vn;
+	struct pfs_vdata *pvd;
+	struct pfs_node *pn;
 	struct proc *proc;
 	int error;
 
+	vn = va->a_vp;
+	vn_lock(vn, LK_SHARED | LK_RETRY);
+	if (vn->v_iflag & VI_DOOMED) {
+		VOP_UNLOCK(vn, 0);
+		return (EBADF);
+	}
+	pvd = vn->v_data;
+	pn = pvd->pvd_pn;
+
 	PFS_TRACE(("%s: %lx", pn->pn_name, va->a_command));
 	pfs_assert_not_owned(pn);
 
-	if (vn->v_type != VREG)
+	if (vn->v_type != VREG) {
+		VOP_UNLOCK(vn, 0);
 		PFS_RETURN (EINVAL);
+	}
 	KASSERT_PN_IS_FILE(pn);
 
-	if (pn->pn_ioctl == NULL)
+	if (pn->pn_ioctl == NULL) {
+		VOP_UNLOCK(vn, 0);
 		PFS_RETURN (ENOTTY);
+	}
 
 	/*
 	 * This is necessary because process' privileges may
 	 * have changed since the open() call.
 	 */
-	if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc))
+	if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) {
+		VOP_UNLOCK(vn, 0);
 		PFS_RETURN (EIO);
+	}
 
 	error = pn_ioctl(curthread, proc, pn, va->a_command, va->a_data);
 
 	if (proc != NULL)
 		PROC_UNLOCK(proc);
 
+	VOP_UNLOCK(vn, 0);
 	PFS_RETURN (error);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 14:02:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B0D91065670;
	Wed, 10 Jun 2009 14:02:22 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 798D88FC13;
	Wed, 10 Jun 2009 14:02:22 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AE2M7c015750;
	Wed, 10 Jun 2009 14:02:22 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AE2Mx3015749;
	Wed, 10 Jun 2009 14:02:22 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906101402.n5AE2Mx3015749@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 14:02:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193922 - head/sys/fs/fifofs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 14:02:23 -0000

Author: kib
Date: Wed Jun 10 14:02:22 2009
New Revision: 193922
URL: http://svn.freebsd.org/changeset/base/193922

Log:
  Remove unused VOP_IOCTL and VOP_KQFILTER implementations for fifofs.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/fifofs/fifo_vnops.c

Modified: head/sys/fs/fifofs/fifo_vnops.c
==============================================================================
--- head/sys/fs/fifofs/fifo_vnops.c	Wed Jun 10 14:01:23 2009	(r193921)
+++ head/sys/fs/fifofs/fifo_vnops.c	Wed Jun 10 14:02:22 2009	(r193922)
@@ -89,8 +89,6 @@ struct fifoinfo {
 static vop_print_t	fifo_print;
 static vop_open_t	fifo_open;
 static vop_close_t	fifo_close;
-static vop_ioctl_t	fifo_ioctl;
-static vop_kqfilter_t	fifo_kqfilter;
 static vop_pathconf_t	fifo_pathconf;
 static vop_advlock_t	fifo_advlock;
 
@@ -116,8 +114,8 @@ struct vop_vector fifo_specops = {
 	.vop_close =		fifo_close,
 	.vop_create =		VOP_PANIC,
 	.vop_getattr =		VOP_EBADF,
-	.vop_ioctl =		fifo_ioctl,
-	.vop_kqfilter =		fifo_kqfilter,
+	.vop_ioctl =		VOP_PANIC,
+	.vop_kqfilter =		VOP_PANIC,
 	.vop_link =		VOP_PANIC,
 	.vop_mkdir =		VOP_PANIC,
 	.vop_mknod =		VOP_PANIC,
@@ -300,42 +298,6 @@ fail1:
 	return (0);
 }
 
-/*
- * Now unused vnode ioctl routine.
- */
-/* ARGSUSED */
-static int
-fifo_ioctl(ap)
-	struct vop_ioctl_args /* {
-		struct vnode *a_vp;
-		u_long  a_command;
-		caddr_t  a_data;
-		int  a_fflag;
-		struct ucred *a_cred;
-		struct thread *a_td;
-	} */ *ap;
-{
-
-	printf("WARNING: fifo_ioctl called unexpectedly\n");
-	return (ENOTTY);
-}
-
-/*
- * Now unused vnode kqfilter routine.
- */
-/* ARGSUSED */
-static int
-fifo_kqfilter(ap)
-	struct vop_kqfilter_args /* {
-		struct vnode *a_vp;
-		struct knote *a_kn;
-	} */ *ap;
-{
-
-	printf("WARNING: fifo_kqfilter called unexpectedly\n");
-	return (EINVAL);
-}
-
 static void
 filt_fifordetach(struct knote *kn)
 {

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 14:09:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C38831065670;
	Wed, 10 Jun 2009 14:09:06 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 96C468FC13;
	Wed, 10 Jun 2009 14:09:06 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AE96NJ015917;
	Wed, 10 Jun 2009 14:09:06 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AE96gV015912;
	Wed, 10 Jun 2009 14:09:06 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906101409.n5AE96gV015912@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 14:09:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193923 - in head/sys: fs/cd9660 fs/fifofs fs/msdosfs
	gnu/fs/xfs/FreeBSD kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 14:09:07 -0000

Author: kib
Date: Wed Jun 10 14:09:05 2009
New Revision: 193923
URL: http://svn.freebsd.org/changeset/base/193923

Log:
  s/a_fdidx/a_fp/ for VOP_OPEN comments that inline struct vop_open_args
  definition.
  
  Discussed with:	bde
  MFC after:	2 weeks

Modified:
  head/sys/fs/cd9660/cd9660_vnops.c
  head/sys/fs/fifofs/fifo_vnops.c
  head/sys/fs/msdosfs/msdosfs_vnops.c
  head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
  head/sys/kern/uipc_mqueue.c

Modified: head/sys/fs/cd9660/cd9660_vnops.c
==============================================================================
--- head/sys/fs/cd9660/cd9660_vnops.c	Wed Jun 10 14:02:22 2009	(r193922)
+++ head/sys/fs/cd9660/cd9660_vnops.c	Wed Jun 10 14:09:05 2009	(r193923)
@@ -165,7 +165,7 @@ cd9660_open(ap)
 		int a_mode;
 		struct ucred *a_cred;
 		struct thread *a_td;
-		int a_fdidx;
+		int a_fp;
 	} */ *ap;
 {
 	struct vnode *vp = ap->a_vp;

Modified: head/sys/fs/fifofs/fifo_vnops.c
==============================================================================
--- head/sys/fs/fifofs/fifo_vnops.c	Wed Jun 10 14:02:22 2009	(r193922)
+++ head/sys/fs/fifofs/fifo_vnops.c	Wed Jun 10 14:09:05 2009	(r193923)
@@ -167,7 +167,7 @@ fifo_open(ap)
 		int  a_mode;
 		struct ucred *a_cred;
 		struct thread *a_td;
-		int a_fdidx;
+		struct file *a_fp;
 	} */ *ap;
 {
 	struct vnode *vp = ap->a_vp;

Modified: head/sys/fs/msdosfs/msdosfs_vnops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vnops.c	Wed Jun 10 14:02:22 2009	(r193922)
+++ head/sys/fs/msdosfs/msdosfs_vnops.c	Wed Jun 10 14:09:05 2009	(r193923)
@@ -214,7 +214,7 @@ msdosfs_open(ap)
 		int a_mode;
 		struct ucred *a_cred;
 		struct thread *a_td;
-		int a_fdidx;
+		int a_fp;
 	} */ *ap;
 {
 	struct denode *dep = VTODE(ap->a_vp);

Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
==============================================================================
--- head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c	Wed Jun 10 14:02:22 2009	(r193922)
+++ head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c	Wed Jun 10 14:09:05 2009	(r193923)
@@ -198,7 +198,7 @@ _xfs_open(
 		int  a_mode;
 		struct ucred *a_cred;
 		struct thread *a_td;
-		int  a_fdidx;
+		int  a_fp;
 	} */ *ap)
 {
 	int error;

Modified: head/sys/kern/uipc_mqueue.c
==============================================================================
--- head/sys/kern/uipc_mqueue.c	Wed Jun 10 14:02:22 2009	(r193922)
+++ head/sys/kern/uipc_mqueue.c	Wed Jun 10 14:09:05 2009	(r193923)
@@ -1092,7 +1092,7 @@ struct vop_open_args {
 	int a_mode;
 	struct ucred *a_cred;
 	struct thread *a_td;
-	int a_fdidx;
+	int a_fp;
 };
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 14:24:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86FF51065674;
	Wed, 10 Jun 2009 14:24:32 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5A72F8FC13;
	Wed, 10 Jun 2009 14:24:32 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AEOWwd016289;
	Wed, 10 Jun 2009 14:24:32 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AEOWoN016285;
	Wed, 10 Jun 2009 14:24:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906101424.n5AEOWoN016285@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 14: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: r193924 - in head/sys: fs/cd9660 fs/msdosfs
	gnu/fs/xfs/FreeBSD kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 14:24:33 -0000

Author: kib
Date: Wed Jun 10 14:24:31 2009
New Revision: 193924
URL: http://svn.freebsd.org/changeset/base/193924

Log:
  Fix r193923 by noting that type of a_fp is struct file *, not int.
  It was assumed that r193923 was trivial change that cannot be done
  wrong.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/cd9660/cd9660_vnops.c
  head/sys/fs/msdosfs/msdosfs_vnops.c
  head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
  head/sys/kern/uipc_mqueue.c

Modified: head/sys/fs/cd9660/cd9660_vnops.c
==============================================================================
--- head/sys/fs/cd9660/cd9660_vnops.c	Wed Jun 10 14:09:05 2009	(r193923)
+++ head/sys/fs/cd9660/cd9660_vnops.c	Wed Jun 10 14:24:31 2009	(r193924)
@@ -165,7 +165,7 @@ cd9660_open(ap)
 		int a_mode;
 		struct ucred *a_cred;
 		struct thread *a_td;
-		int a_fp;
+		struct file *a_fp;
 	} */ *ap;
 {
 	struct vnode *vp = ap->a_vp;

Modified: head/sys/fs/msdosfs/msdosfs_vnops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vnops.c	Wed Jun 10 14:09:05 2009	(r193923)
+++ head/sys/fs/msdosfs/msdosfs_vnops.c	Wed Jun 10 14:24:31 2009	(r193924)
@@ -214,7 +214,7 @@ msdosfs_open(ap)
 		int a_mode;
 		struct ucred *a_cred;
 		struct thread *a_td;
-		int a_fp;
+		struct file *a_fp;
 	} */ *ap;
 {
 	struct denode *dep = VTODE(ap->a_vp);

Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
==============================================================================
--- head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c	Wed Jun 10 14:09:05 2009	(r193923)
+++ head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c	Wed Jun 10 14:24:31 2009	(r193924)
@@ -198,7 +198,7 @@ _xfs_open(
 		int  a_mode;
 		struct ucred *a_cred;
 		struct thread *a_td;
-		int  a_fp;
+		struct file *a_fp;
 	} */ *ap)
 {
 	int error;

Modified: head/sys/kern/uipc_mqueue.c
==============================================================================
--- head/sys/kern/uipc_mqueue.c	Wed Jun 10 14:09:05 2009	(r193923)
+++ head/sys/kern/uipc_mqueue.c	Wed Jun 10 14:24:31 2009	(r193924)
@@ -1092,7 +1092,7 @@ struct vop_open_args {
 	int a_mode;
 	struct ucred *a_cred;
 	struct thread *a_td;
-	int a_fp;
+	struct file *a_fp;
 };
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 14:34:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4568C106566B;
	Wed, 10 Jun 2009 14:34:57 +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 33D588FC13;
	Wed, 10 Jun 2009 14:34:57 +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 n5AEYvIR016527;
	Wed, 10 Jun 2009 14:34:57 GMT (envelope-from gnn@svn.freebsd.org)
Received: (from gnn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AEYvtL016526;
	Wed, 10 Jun 2009 14:34:57 GMT (envelope-from gnn@svn.freebsd.org)
Message-Id: <200906101434.n5AEYvtL016526@svn.freebsd.org>
From: "George V. Neville-Neil" 
Date: Wed, 10 Jun 2009 14:34:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193925 - head/sys/dev/cxgb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 14:34:57 -0000

Author: gnn
Date: Wed Jun 10 14:34:56 2009
New Revision: 193925
URL: http://svn.freebsd.org/changeset/base/193925

Log:
  Add a missing error statistic, the number of FCS errors on receive.
  
  Reviewed by:	jhb
  MFC after:	1 day

Modified:
  head/sys/dev/cxgb/cxgb_sge.c

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c	Wed Jun 10 14:24:31 2009	(r193924)
+++ head/sys/dev/cxgb/cxgb_sge.c	Wed Jun 10 14:34:56 2009	(r193925)
@@ -3654,6 +3654,7 @@ t3_add_configured_sysctls(adapter_t *sc)
 		CXGB_SYSCTL_ADD_QUAD(rx_mcast_frames);
 		CXGB_SYSCTL_ADD_QUAD(rx_bcast_frames);
 		CXGB_SYSCTL_ADD_QUAD(rx_pause);
+		CXGB_SYSCTL_ADD_QUAD(rx_fcs_errs);
 		CXGB_SYSCTL_ADD_QUAD(rx_align_errs);
 		CXGB_SYSCTL_ADD_QUAD(rx_symbol_errs);
 		CXGB_SYSCTL_ADD_QUAD(rx_data_errs);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 14:36:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B09DA10656ED;
	Wed, 10 Jun 2009 14:36:59 +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 939318FC1F;
	Wed, 10 Jun 2009 14:36:59 +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 n5AEaxgD016610;
	Wed, 10 Jun 2009 14:36:59 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AEaxGc016608;
	Wed, 10 Jun 2009 14:36:59 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906101436.n5AEaxGc016608@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 14:36:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193926 - in head/sys: kern net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 14:37:00 -0000

Author: bz
Date: Wed Jun 10 14:36:59 2009
New Revision: 193926
URL: http://svn.freebsd.org/changeset/base/193926

Log:
  SCTP needs either IPv4 or IPv6 as lower layer[1].
  So properly hide the already #ifdef SCTP code with
  #if defined(INET) || defined(INET6) as well to get us
  closer to a non-INET/INET6 kernel.
  
  Discussed with:	tuexen [1]

Modified:
  head/sys/kern/uipc_syscalls.c
  head/sys/net/rtsock.c

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Wed Jun 10 14:34:56 2009	(r193925)
+++ head/sys/kern/uipc_syscalls.c	Wed Jun 10 14:36:59 2009	(r193926)
@@ -35,6 +35,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_inet.h"
+#include "opt_inet6.h"
 #include "opt_sctp.h"
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -77,10 +79,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(INET) || defined(INET6)
 #ifdef SCTP
 #include 
 #include 
 #endif /* SCTP */
+#endif /* INET || INET6 */
 
 static int sendit(struct thread *td, int s, struct msghdr *mp, int flags);
 static int recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp);
@@ -2269,7 +2273,7 @@ sctp_peeloff(td, uap)
 		caddr_t	name;
 	} */ *uap;
 {
-#ifdef SCTP
+#if (defined(INET) || defined(INET6)) && defined(SCTP)
 	struct filedesc *fdp;
 	struct file *nfp = NULL;
 	int error;
@@ -2358,7 +2362,7 @@ sctp_generic_sendmsg (td, uap)
 		int flags
 	} */ *uap;
 {
-#ifdef SCTP
+#if (defined(INET) || defined(INET6)) && defined(SCTP)
 	struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL;
 	struct socket *so;
 	struct file *fp = NULL;
@@ -2459,7 +2463,7 @@ sctp_generic_sendmsg_iov(td, uap)
 		int flags
 	} */ *uap;
 {
-#ifdef SCTP
+#if (defined(INET) || defined(INET6)) && defined(SCTP)
 	struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL;
 	struct socket *so;
 	struct file *fp = NULL;
@@ -2570,7 +2574,7 @@ sctp_generic_recvmsg(td, uap)
 		int *msg_flags
 	} */ *uap;
 {
-#ifdef SCTP
+#if (defined(INET) || defined(INET6)) && defined(SCTP)
 	u_int8_t sockbufstore[256];
 	struct uio auio;
 	struct iovec *iov, *tiov;

Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c	Wed Jun 10 14:34:56 2009	(r193925)
+++ head/sys/net/rtsock.c	Wed Jun 10 14:36:59 2009	(r193926)
@@ -65,9 +65,11 @@
 #include 
 #endif
 
+#if defined(INET) || defined(INET6)
 #ifdef SCTP
 extern void sctp_addr_change(struct ifaddr *ifa, int cmd);
 #endif /* SCTP */
+#endif
 
 MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables");
 
@@ -1063,6 +1065,7 @@ rt_newaddrmsg(int cmd, struct ifaddr *if
 
 	KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE,
 		("unexpected cmd %u", cmd));
+#if defined(INET) || defined(INET6)
 #ifdef SCTP
 	/*
 	 * notify the SCTP stack
@@ -1071,6 +1074,7 @@ rt_newaddrmsg(int cmd, struct ifaddr *if
 	 */
 	sctp_addr_change(ifa, cmd);
 #endif /* SCTP */
+#endif
 	if (route_cb.any_count == 0)
 		return;
 	for (pass = 1; pass < 3; pass++) {

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 15:26:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0B9931065674;
	Wed, 10 Jun 2009 15:26:36 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D344C8FC19;
	Wed, 10 Jun 2009 15:26:35 +0000 (UTC)
	(envelope-from jamie@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AFQZco017809;
	Wed, 10 Jun 2009 15:26:35 GMT (envelope-from jamie@svn.freebsd.org)
Received: (from jamie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AFQZS4017808;
	Wed, 10 Jun 2009 15:26:35 GMT (envelope-from jamie@svn.freebsd.org)
Message-Id: <200906101526.n5AFQZS4017808@svn.freebsd.org>
From: Jamie Gritton 
Date: Wed, 10 Jun 2009 15:26: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: r193929 - head/usr.sbin/jail
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 15:26:36 -0000

Author: jamie
Date: Wed Jun 10 15:26:35 2009
New Revision: 193929
URL: http://svn.freebsd.org/changeset/base/193929

Log:
  In the old-style jail command line, explicitly set parameters from the
  security.jail.* sysctls since jail_set(2) doesn't do it implicitly.
  
  Approved by:	bz (mentor)

Modified:
  head/usr.sbin/jail/jail.c

Modified: head/usr.sbin/jail/jail.c
==============================================================================
--- head/usr.sbin/jail/jail.c	Wed Jun 10 14:52:34 2009	(r193928)
+++ head/usr.sbin/jail/jail.c	Wed Jun 10 15:26:35 2009	(r193929)
@@ -76,6 +76,21 @@ static void quoted_print(FILE *fp, char 
 static void set_param(const char *name, char *value);
 static void usage(void);
 
+static const char *perm_sysctl[][3] = {
+	{ "security.jail.set_hostname_allowed",
+	  "allow.noset_hostname", "allow.set_hostname" },
+	{ "security.jail.sysvipc_allowed",
+	  "allow.nosysvipc", "allow.sysvipc" },
+	{ "security.jail.allow_raw_sockets",
+	  "allow.noraw_sockets", "allow.raw_sockets" },
+	{ "security.jail.chflags_allowed",
+	  "allow.nochflags", "allow.chflags" },
+	{ "security.jail.mount_allowed",
+	  "allow.nomount", "allow.mount" },
+	{ "security.jail.socket_unixiproute_only",
+	  "allow.socket_af", "allow.nosocket_af" },
+};
+
 extern char **environ;
 
 #define GET_USER_INFO do {						\
@@ -101,10 +116,12 @@ main(int argc, char **argv)
 	struct iovec rparams[2];
 	struct passwd *pwd = NULL;
 	gid_t groups[NGROUPS];
-	int ch, cmdarg, i, jail_set_flags, jid, ngroups;
+	size_t sysvallen;
+	int ch, cmdarg, i, jail_set_flags, jid, ngroups, sysval;
 	int hflag, iflag, Jflag, lflag, rflag, uflag, Uflag;
+	unsigned pi;
 	char *ep, *jailname, *securelevel, *username, *JidFile;
-	char errmsg[ERRMSG_SIZE];
+	char errmsg[ERRMSG_SIZE], enforce_statfs[4];
 	static char *cleanenv;
 	const char *shell, *p = NULL;
 	FILE *fp;
@@ -236,6 +253,26 @@ main(int argc, char **argv)
 		add_ip_addr(&ip4_addr, argv[2]);
 #endif
 		cmdarg = 3;
+		/* Emulate the defaults from security.jail.* sysctls */
+		sysvallen = sizeof(sysval);
+		if (sysctlbyname("security.jail.jailed", &sysval, &sysvallen,
+		    NULL, 0) == 0 && sysval == 0) {
+			for (pi = 0; pi < sizeof(perm_sysctl) /
+			     sizeof(perm_sysctl[0]); pi++) {
+				sysvallen = sizeof(sysval);
+				if (sysctlbyname(perm_sysctl[pi][0],
+				    &sysval, &sysvallen, NULL, 0) == 0)
+					set_param(perm_sysctl[pi]
+					    [sysval ? 2 : 1], NULL);
+			}
+			sysvallen = sizeof(sysval);
+			if (sysctlbyname("security.jail.enforce_statfs",
+			    &sysval, &sysvallen, NULL, 0) == 0) {
+				snprintf(enforce_statfs,
+				    sizeof(enforce_statfs), "%d", sysval);
+				set_param("enforce_statfs", enforce_statfs);
+			}
+		}
 	}
 	if (ip4_addr != NULL)
 		set_param("ip4.addr", ip4_addr);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 15:48:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A240106566C;
	Wed, 10 Jun 2009 15:48:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8867B8FC12;
	Wed, 10 Jun 2009 15:48:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AFmYjA018389;
	Wed, 10 Jun 2009 15:48:34 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AFmYjp018388;
	Wed, 10 Jun 2009 15:48:34 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906101548.n5AFmYjp018388@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 15:48:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193930 - head/sys/fs/cd9660
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 15:48:35 -0000

Author: kib
Date: Wed Jun 10 15:48:34 2009
New Revision: 193930
URL: http://svn.freebsd.org/changeset/base/193930

Log:
  For cd9660_ioctl, check for recycled vnode after locking it.
  
  Noted by:	Jaakko Heinonen 
  MFC after:	2 weeks

Modified:
  head/sys/fs/cd9660/cd9660_vnops.c

Modified: head/sys/fs/cd9660/cd9660_vnops.c
==============================================================================
--- head/sys/fs/cd9660/cd9660_vnops.c	Wed Jun 10 15:26:35 2009	(r193929)
+++ head/sys/fs/cd9660/cd9660_vnops.c	Wed Jun 10 15:48:34 2009	(r193930)
@@ -257,6 +257,10 @@ cd9660_ioctl(ap)
 
 	vp = ap->a_vp;
 	vn_lock(vp, LK_SHARED | LK_RETRY);
+	if (vp->v_iflag & VI_DOOMED) {
+		VOP_UNLOCK(vp, 0);
+		return (EBADF);
+	}
 	if (vp->v_type == VCHR || vp->v_type == VBLK) {
 		VOP_UNLOCK(vp, 0);
 		return (EOPNOTSUPP);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 16:00:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA6291065672;
	Wed, 10 Jun 2009 16:00:09 +0000 (UTC)
	(envelope-from bakul@bitblocks.com)
Received: from mail.bitblocks.com (mail.bitblocks.com [64.142.15.60])
	by mx1.freebsd.org (Postfix) with ESMTP id 787BF8FC1C;
	Wed, 10 Jun 2009 16:00:09 +0000 (UTC)
	(envelope-from bakul@bitblocks.com)
Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1])
	by mail.bitblocks.com (Postfix) with ESMTP id C0B015B24;
	Wed, 10 Jun 2009 08:54:37 -0700 (PDT)
To: Kip Macy 
In-reply-to: Your message of "Wed, 10 Jun 2009 01:21:32 -0000."
	<200906100121.n5A1LWVO089719@svn.freebsd.org> 
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
Comments: In-reply-to Kip Macy 
	message dated "Wed, 10 Jun 2009 01:21:32 -0000."
Date: Wed, 10 Jun 2009 08:54:37 -0700
From: Bakul Shah 
Message-Id: <20090610155437.C0B015B24@mail.bitblocks.com>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193878 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 16:00:10 -0000

For some reason this revision does not show up in the CVS repository.
Some bug in the svn->cvs conversion script?

Here is an edited snippet from commitlogs/sys:
====================================================
imp         2009-06-10 01:02:38 UTC
  Modified files:
    sys/kern             subr_bus.c 
  Log:
  SVN rev 193874 on 2009-06-10 01:02:38Z by imp
  
yongari     2009-06-10 01:15:30 UTC
  Modified files:
    sys/dev/fxp          if_fxp.c 
  Log:
  SVN rev 193875 on 2009-06-10 01:15:30Z by yongari
  
kmacy       2009-06-10 01:18:07 UTC
  Modified files:        (Branch: RELENG_7)
    sys/boot/i386        Makefile 
    sys/boot/i386/loader Makefile 
  Log:
  SVN rev 193876 on 2009-06-10 01:18:07Z by kmacy

kmacy       2009-06-10 01:20:46 UTC
  Modified files:        (Branch: RELENG_7)
    sys/boot/i386        Makefile 
  Log:
  SVN rev 193877 on 2009-06-10 01:20:46Z by kmacy
  
yongari     2009-06-10 02:07:58 UTC
  FreeBSD src repository
  src/sys/modules/alc - New directory

yongari     2009-06-10 02:07:58 UTC
  FreeBSD src repository
  src/sys/dev/alc - New directory

yongari     2009-06-10 02:07:58 UTC
  Modified files:
    sys/amd64/conf       GENERIC 
    sys/boot/forth       loader.conf 
    sys/conf             NOTES files 
    sys/i386/conf        GENERIC 
    sys/modules          Makefile 
  Added files:
    sys/dev/alc          if_alc.c if_alcreg.h if_alcvar.h 
    sys/modules/alc      Makefile 
  Log:
  SVN rev 193880 on 2009-06-10 02:07:58Z by yongari
====================================================

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 16:17:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAC48106564A;
	Wed, 10 Jun 2009 16:17:38 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C933C8FC1C;
	Wed, 10 Jun 2009 16:17:38 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AGHcd1019031;
	Wed, 10 Jun 2009 16:17:38 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AGHc2N019030;
	Wed, 10 Jun 2009 16:17:38 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906101617.n5AGHc2N019030@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 16:17: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: r193931 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 16:17:39 -0000

Author: kib
Date: Wed Jun 10 16:17:38 2009
New Revision: 193931
URL: http://svn.freebsd.org/changeset/base/193931

Log:
  Do not leak the state->ls_lock after VI_DOOMED check introduced
  in the r192683.
  
  Reported by:	pho
  Submitted by:	jhb

Modified:
  head/sys/kern/kern_lockf.c

Modified: head/sys/kern/kern_lockf.c
==============================================================================
--- head/sys/kern/kern_lockf.c	Wed Jun 10 15:48:34 2009	(r193930)
+++ head/sys/kern/kern_lockf.c	Wed Jun 10 16:17:38 2009	(r193931)
@@ -647,6 +647,7 @@ lf_advlockasync(struct vop_advlockasync_
 	VI_LOCK(vp);
 	if (vp->v_iflag & VI_DOOMED) {
 		VI_UNLOCK(vp);
+		sx_xunlock(&state->ls_lock);
 		lf_free_lock(lock);
 		return (ENOENT);
 	}

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 17:39:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B81911065675;
	Wed, 10 Jun 2009 17:39:19 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A66278FC22;
	Wed, 10 Jun 2009 17:39:19 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AHdJFp020816;
	Wed, 10 Jun 2009 17:39:19 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AHdJ4x020815;
	Wed, 10 Jun 2009 17:39:19 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906101739.n5AHdJ4x020815@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 10 Jun 2009 17:39: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: r193934 - head/sys/arm/at91
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 17:39:20 -0000

Author: imp
Date: Wed Jun 10 17:39:19 2009
New Revision: 193934
URL: http://svn.freebsd.org/changeset/base/193934

Log:
  Eliminate devclass_find_free_unit call here, since -1 gives the same
  net behavior.

Modified:
  head/sys/arm/at91/at91_cfata.c

Modified: head/sys/arm/at91/at91_cfata.c
==============================================================================
--- head/sys/arm/at91/at91_cfata.c	Wed Jun 10 17:30:12 2009	(r193933)
+++ head/sys/arm/at91/at91_cfata.c	Wed Jun 10 17:39:19 2009	(r193934)
@@ -94,7 +94,7 @@ at91_cfata_attach(device_t dev)
 	/* XXX: init CF controller? */
 
 	callout_init(&sc->tick, 1);	/* Callout to poll the device. */
-	device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 0));
+	device_add_child(dev, "ata", -1);
 	bus_generic_attach(dev);
 	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 17:40:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2711B1065670;
	Wed, 10 Jun 2009 17:40:19 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 155028FC18;
	Wed, 10 Jun 2009 17:40:19 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AHeIMN020877;
	Wed, 10 Jun 2009 17:40:18 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AHeICh020876;
	Wed, 10 Jun 2009 17:40:18 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906101740.n5AHeICh020876@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 10 Jun 2009 17:40:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193935 - head/sys/powerpc/psim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 17:40:19 -0000

Author: imp
Date: Wed Jun 10 17:40:18 2009
New Revision: 193935
URL: http://svn.freebsd.org/changeset/base/193935

Log:
  Move from using devclass_find_free_unit(ata_devclass, 0) to -1 for the
  unit number.  Basically they are the same...

Modified:
  head/sys/powerpc/psim/ata_iobus.c

Modified: head/sys/powerpc/psim/ata_iobus.c
==============================================================================
--- head/sys/powerpc/psim/ata_iobus.c	Wed Jun 10 17:39:19 2009	(r193934)
+++ head/sys/powerpc/psim/ata_iobus.c	Wed Jun 10 17:40:18 2009	(r193935)
@@ -114,9 +114,7 @@ ata_iobus_attach(device_t dev)
 	 * Add a single child per controller. Should be able
 	 * to add two
 	 */
-	device_add_child(dev, "ata",
-			 devclass_find_free_unit(ata_devclass, 0));
-
+	device_add_child(dev, "ata", -1);
 	return (bus_generic_attach(dev));
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 17:41:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 449B91065673;
	Wed, 10 Jun 2009 17:41:25 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 330BF8FC14;
	Wed, 10 Jun 2009 17:41:25 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AHfPBN020935;
	Wed, 10 Jun 2009 17:41:25 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AHfPkO020934;
	Wed, 10 Jun 2009 17:41:25 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906101741.n5AHfPkO020934@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 10 Jun 2009 17:41:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193936 - head/sys/dev/cfi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 17:41:25 -0000

Author: imp
Date: Wed Jun 10 17:41:24 2009
New Revision: 193936
URL: http://svn.freebsd.org/changeset/base/193936

Log:
  Move from using devclass_find_free_unit(cfi_diskclass, 0) to -1, since
  they have the same basic behavior.

Modified:
  head/sys/dev/cfi/cfi_core.c

Modified: head/sys/dev/cfi/cfi_core.c
==============================================================================
--- head/sys/dev/cfi/cfi_core.c	Wed Jun 10 17:40:18 2009	(r193935)
+++ head/sys/dev/cfi/cfi_core.c	Wed Jun 10 17:41:24 2009	(r193936)
@@ -285,8 +285,7 @@ cfi_attach(device_t dev) 
 	    "%s%u", cfi_driver_name, u);
 	sc->sc_nod->si_drv1 = sc;
 
-	device_add_child(dev, "cfid",
-	    devclass_find_free_unit(cfi_diskclass, 0));
+	device_add_child(dev, "cfid", -1);
 	bus_generic_attach(dev);
 
 	return (0);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 17:48:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E63F51065672;
	Wed, 10 Jun 2009 17:48:03 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 79C748FC12;
	Wed, 10 Jun 2009 17:48:02 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id ED2E1A446D;
	Wed, 10 Jun 2009 21:48:00 +0400 (MSD)
X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9
Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru)
	by corbina.ru (CommuniGate Pro SMTP 5.1.14)
	with ESMTPS id 1826837836; Wed, 10 Jun 2009 21:48:00 +0400
Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1])
	by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id
	n5AHm0nX002030; Wed, 10 Jun 2009 21:48:00 +0400 (MSD)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: (from dchagin@localhost)
	by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n5AHlt8v002029; 
	Wed, 10 Jun 2009 21:47:55 +0400 (MSD) (envelope-from dchagin)
Date: Wed, 10 Jun 2009 21:47:55 +0400
From: Chagin Dmitry 
To: Paul Saab 
Message-ID: <20090610174755.GA1927@dchagin.static.corbina.ru>
References: <200906082123.n58LNsdd044147@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4"
Content-Disposition: inline
In-Reply-To: <200906082123.n58LNsdd044147@svn.freebsd.org>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193762 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 17:48:04 -0000


--YiEDa0DAkWCtVeE4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 08, 2009 at 09:23:54PM +0000, Paul Saab wrote:
> Author: ps
> Date: Mon Jun  8 21:23:54 2009
> New Revision: 193762
> URL: http://svn.freebsd.org/changeset/base/193762
>=20
> Log:
>   Simply shared vnode locking and extend it to also include fsync.
>   Also, in vop_write, no longer assert for exclusive locks on the
>   vnode.
>  =20
>   Reviewed by:	jhb, kmacy, jeffr
>=20
> Modified:
>   head/sys/kern/vfs_syscalls.c
>   head/sys/kern/vfs_vnops.c
>   head/sys/kern/vnode_if.src
>   head/sys/sys/mount.h
>=20
> Modified: head/sys/kern/vfs_syscalls.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/kern/vfs_syscalls.c	Mon Jun  8 21:16:06 2009	(r193761)
> +++ head/sys/kern/vfs_syscalls.c	Mon Jun  8 21:23:54 2009	(r193762)
> @@ -3476,7 +3476,7 @@ fsync(td, uap)
>  	struct mount *mp;
>  	struct file *fp;
>  	int vfslocked;
> -	int error;
> +	int error, lock_flags;
> =20
>  	AUDIT_ARG(fd, uap->fd);
>  	if ((error =3D getvnode(td->td_proc->p_fd, uap->fd, &fp)) !=3D 0)
> @@ -3485,7 +3485,13 @@ fsync(td, uap)
>  	vfslocked =3D VFS_LOCK_GIANT(vp->v_mount);
>  	if ((error =3D vn_start_write(vp, &mp, V_WAIT | PCATCH)) !=3D 0)
>  		goto drop;
> -	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
> +	if (MNT_SHARED_WRITES(mp) ||
> +	    ((mp =3D=3D NULL) && MNT_SHARED_WRITES(vp->v_mount))) {
> +		lock_flags =3D LK_SHARED;
> +	} else {
> +		lock_flags =3D LK_EXCLUSIVE;
> +	}
> +	vn_lock(vp, lock_flags | LK_RETRY);
>  	AUDIT_ARG(vnode, vp, ARG_VNODE1);
>  	if (vp->v_object !=3D NULL) {
>  		VM_OBJECT_LOCK(vp->v_object);
>=20


vnode_if.src needs to be changed:

diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src
index f54d046..49cc782 100644
--- a/sys/kern/vnode_if.src
+++ b/sys/kern/vnode_if.src
@@ -247,7 +247,7 @@ vop_revoke {
 };


-%% fsync       vp      E E E
+%% fsync       vp      L L L

 vop_fsync {
        IN struct vnode *vp;






> Modified: head/sys/kern/vfs_vnops.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/kern/vfs_vnops.c	Mon Jun  8 21:16:06 2009	(r193761)
> +++ head/sys/kern/vfs_vnops.c	Mon Jun  8 21:23:54 2009	(r193762)
> @@ -376,8 +376,8 @@ vn_rdwr(rw, vp, base, len, offset, segfl
>  			    (error =3D vn_start_write(vp, &mp, V_WAIT | PCATCH))
>  			    !=3D 0)
>  				return (error);
> -			if (mp !=3D NULL &&
> -			    (mp->mnt_kern_flag & MNTK_SHARED_WRITES)) {
> +			if (MNT_SHARED_WRITES(mp) ||
> +			    ((mp =3D=3D NULL) && MNT_SHARED_WRITES(vp->v_mount))) {
>  				lock_flags =3D LK_SHARED;
>  			} else {
>  				lock_flags =3D LK_EXCLUSIVE;
> @@ -592,7 +592,8 @@ vn_write(fp, uio, active_cred, flags, td
>  	    (error =3D vn_start_write(vp, &mp, V_WAIT | PCATCH)) !=3D 0)
>  		goto unlock;
>  =20
> -	if (mp !=3D NULL && (mp->mnt_kern_flag & MNTK_SHARED_WRITES) &&
> +	if ((MNT_SHARED_WRITES(mp) ||
> +	    ((mp =3D=3D NULL) && MNT_SHARED_WRITES(vp->v_mount))) &&
>  	    (flags & FOF_OFFSET) !=3D 0) {
>  		lock_flags =3D LK_SHARED;
>  	} else {
>=20
> Modified: head/sys/kern/vnode_if.src
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/kern/vnode_if.src	Mon Jun  8 21:16:06 2009	(r193761)
> +++ head/sys/kern/vnode_if.src	Mon Jun  8 21:23:54 2009	(r193762)
> @@ -197,7 +197,7 @@ vop_read {
>  };
> =20
> =20
> -%% write	vp	E E E
> +%% write	vp	L L L
>  %! write	pre	VOP_WRITE_PRE
>  %! write	post	VOP_WRITE_POST
> =20
>=20
> Modified: head/sys/sys/mount.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/sys/mount.h	Mon Jun  8 21:16:06 2009	(r193761)
> +++ head/sys/sys/mount.h	Mon Jun  8 21:23:54 2009	(r193762)
> @@ -336,6 +336,9 @@ void          __mnt_vnode_markerfree(str
>  #define MNTK_LOOKUP_SHARED	0x40000000 /* FS supports shared lock lookups=
 */
>  #define	MNTK_NOKNOTE	0x80000000	/* Don't send KNOTEs from VOP hooks */
> =20
> +#define	MNT_SHARED_WRITES(mp) (((mp) !=3D NULL) && 	\
> +				((mp)->mnt_kern_flag & MNTK_SHARED_WRITES))
> +
>  /*
>   * Sysctl CTL_VFS definitions.
>   *

--=20
Have fun!
chd

--YiEDa0DAkWCtVeE4
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (FreeBSD)

iEYEARECAAYFAkov8coACgkQ0t2Tb3OO/O2tiQCg0T7p4lkPUwihE2YeixY/6hnz
1MsAoKv0De92PFd6N/a+93lI8wY5b2CQ
=df3j
-----END PGP SIGNATURE-----

--YiEDa0DAkWCtVeE4--

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 18:00:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20DD5106566B;
	Wed, 10 Jun 2009 18:00:11 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0C43B8FC15;
	Wed, 10 Jun 2009 18:00:11 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AI0Asi021378;
	Wed, 10 Jun 2009 18:00:10 GMT (envelope-from cokane@svn.freebsd.org)
Received: (from cokane@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AI0AsJ021377;
	Wed, 10 Jun 2009 18:00:10 GMT (envelope-from cokane@svn.freebsd.org)
Message-Id: <200906101800.n5AI0AsJ021377@svn.freebsd.org>
From: Coleman Kane 
Date: Wed, 10 Jun 2009 18:00:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193937 - head/sys/dev/if_ndis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 18:00:11 -0000

Author: cokane
Date: Wed Jun 10 18:00:10 2009
New Revision: 193937
URL: http://svn.freebsd.org/changeset/base/193937

Log:
  Fix an LOR
  
  Submitted by:	Paul B. Mahol 
  MFC after:	1 week

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	Wed Jun 10 17:41:24 2009	(r193936)
+++ head/sys/dev/if_ndis/if_ndis.c	Wed Jun 10 18:00:10 2009	(r193937)
@@ -3264,9 +3264,7 @@ ndis_scan(void *arg)
 	ic = sc->ifp->if_l2com;
 	vap = TAILQ_FIRST(&ic->ic_vaps);
 
-	NDIS_LOCK(sc);
 	ndis_scan_results(sc);
-	NDIS_UNLOCK(sc);
 	ieee80211_scan_done(vap);
 }
 
@@ -3403,10 +3401,8 @@ ndis_scan_start(struct ieee80211com *ic)
 	ss = ic->ic_scan;
 	vap = TAILQ_FIRST(&ic->ic_vaps);
 
-	NDIS_LOCK(sc);
 	if (!NDIS_INITIALIZED(sc)) {
 		DPRINTF(("%s: scan aborted\n", __func__));
-		NDIS_UNLOCK(sc);
 		ieee80211_cancel_scan(vap);
 		return;
 	}
@@ -3430,11 +3426,9 @@ ndis_scan_start(struct ieee80211com *ic)
 	    NULL, &len);
 	if (error) {
 		DPRINTF(("%s: scan command failed\n", __func__));
-		NDIS_UNLOCK(sc);
 		ieee80211_cancel_scan(vap);
 		return;
 	}
-	NDIS_UNLOCK(sc);
 	/* Set a timer to collect the results */
 	callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, sc);
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 18:12:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 308DA1065675;
	Wed, 10 Jun 2009 18:12:16 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E7098FC22;
	Wed, 10 Jun 2009 18:12:16 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AICGIk021708;
	Wed, 10 Jun 2009 18:12:16 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AICGvI021707;
	Wed, 10 Jun 2009 18:12:16 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200906101812.n5AICGvI021707@svn.freebsd.org>
From: Warner Losh 
Date: Wed, 10 Jun 2009 18:12:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193938 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 18:12:16 -0000

Author: imp
Date: Wed Jun 10 18:12:15 2009
New Revision: 193938
URL: http://svn.freebsd.org/changeset/base/193938

Log:
  These are no longer referenced in the tree, so can be safely removed.
  
  Reviewed by:	bms@

Modified:
  head/sys/netinet/igmp.h

Modified: head/sys/netinet/igmp.h
==============================================================================
--- head/sys/netinet/igmp.h	Wed Jun 10 18:00:10 2009	(r193937)
+++ head/sys/netinet/igmp.h	Wed Jun 10 18:12:15 2009	(r193938)
@@ -115,19 +115,6 @@ struct igmp_report {
 #define IGMP_MTRACE_QUERY		0x1f	/* mtrace(8) probe */
 #define IGMP_v3_HOST_MEMBERSHIP_REPORT	0x22	/* Ver. 3 membership report */
 
-#ifndef BURN_BRIDGES
-/*
- * Legacy FreeBSD definitions for the above message types.
- */
-#define IGMP_MEMBERSHIP_QUERY		IGMP_HOST_MEMBERSHIP_QUERY
-#define IGMP_V1_MEMBERSHIP_REPORT	IGMP_v1_HOST_MEMBERSHIP_REPORT
-#define IGMP_V2_MEMBERSHIP_REPORT	IGMP_v2_HOST_MEMBERSHIP_REPORT
-#define IGMP_MTRACE_RESP		IGMP_MTRACE_REPLY
-#define IGMP_MTRACE			IGMP_MTRACE_QUERY
-#define IGMP_V2_LEAVE_GROUP		IGMP_HOST_LEAVE_MESSAGE
-#define IGMP_V3_MEMBERSHIP_REPORT	IGMP_v3_HOST_MEMBERSHIP_REPORT
-#endif /* BURN_BRIDGES */
-
 /*
  * IGMPv3 report modes.
  */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 18:18:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DECEE10656C3;
	Wed, 10 Jun 2009 18:18:14 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C7E2A8FC15;
	Wed, 10 Jun 2009 18:18:14 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AIIEVM021859;
	Wed, 10 Jun 2009 18:18:14 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AIIE6K021858;
	Wed, 10 Jun 2009 18:18:14 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200906101818.n5AIIE6K021858@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 10 Jun 2009 18:18: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: r193939 - head/etc/rc.d
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 18:18:15 -0000

Author: ed
Date: Wed Jun 10 18:18:14 2009
New Revision: 193939
URL: http://svn.freebsd.org/changeset/base/193939

Log:
  Small cleanups to the jail script:
  
  - Remove redundant debugging of consolelog.
  - Use `while :', instead of `while [ true ]'. This is done in other
    places as well.
  
  Submitted by:	Jille Timmermans  (not jilles)
  Reviewed by:	jilles

Modified:
  head/etc/rc.d/jail

Modified: head/etc/rc.d/jail
==============================================================================
--- head/etc/rc.d/jail	Wed Jun 10 18:12:15 2009	(r193938)
+++ head/etc/rc.d/jail	Wed Jun 10 18:18:14 2009	(r193939)
@@ -52,7 +52,7 @@ init_variables()
 	eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\"
 
 	i=1
-	while [ true ]; do
+	while : ; do
 		eval _exec_afterstart${i}=\"\${jail_${_j}_exec_afterstart${i}:-\${jail_exec_afterstart${i}}}\"
 		[ -z "$(eval echo \"\$_exec_afterstart${i}\")" ] &&  break
 		i=$((i + 1))
@@ -132,7 +132,6 @@ init_variables()
 	debug "$_j procdir: $_procdir"
 	debug "$_j ruleset: $_ruleset"
 	debug "$_j fstab: $_fstab"
-	debug "$_j consolelog: $_consolelog"
 
 	i=0
 	while : ; do
@@ -147,7 +146,7 @@ init_variables()
 	debug "$_j exec start: $_exec_start"
 
 	i=1
-	while [ true ]; do
+	while : ; do
 		eval out=\"\${_exec_afterstart${i}:-''}\"
 
 		if [ -z "$out" ]; then
@@ -642,7 +641,7 @@ jail_start()
 		if [ "$?" -eq 0 ] ; then
 			_jail_id=$(head -1 ${_tmp_jail})
 			i=1
-			while [ true ]; do
+			while : ; do
 				eval out=\"\${_exec_afterstart${i}:-''}\"
 
 				if [ -z "$out" ]; then

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 18:26:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 491C91065686;
	Wed, 10 Jun 2009 18:26:03 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 36B3C8FC13;
	Wed, 10 Jun 2009 18:26:03 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AIQ3qD022057;
	Wed, 10 Jun 2009 18:26:03 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AIQ3ew022055;
	Wed, 10 Jun 2009 18:26:03 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200906101826.n5AIQ3ew022055@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 10 Jun 2009 18:26: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: r193940 - head/sys/dev/syscons/teken
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 18:26:03 -0000

Author: ed
Date: Wed Jun 10 18:26:02 2009
New Revision: 193940
URL: http://svn.freebsd.org/changeset/base/193940

Log:
  Make the demo/stress tools build again, after my changes to param().

Modified:
  head/sys/dev/syscons/teken/teken_demo.c
  head/sys/dev/syscons/teken/teken_stress.c

Modified: head/sys/dev/syscons/teken/teken_demo.c
==============================================================================
--- head/sys/dev/syscons/teken/teken_demo.c	Wed Jun 10 18:18:14 2009	(r193939)
+++ head/sys/dev/syscons/teken/teken_demo.c	Wed Jun 10 18:26:02 2009	(r193940)
@@ -232,7 +232,7 @@ test_copy(void *s __unused, const teken_
 }
 
 static void
-test_param(void *s __unused, int cmd, int value)
+test_param(void *s __unused, int cmd, unsigned int value)
 {
 
 	switch (cmd) {

Modified: head/sys/dev/syscons/teken/teken_stress.c
==============================================================================
--- head/sys/dev/syscons/teken/teken_stress.c	Wed Jun 10 18:18:14 2009	(r193939)
+++ head/sys/dev/syscons/teken/teken_stress.c	Wed Jun 10 18:26:02 2009	(r193940)
@@ -83,7 +83,7 @@ stress_copy(void *s __unused, const teke
 }
 
 static void
-stress_param(void *s __unused, int cmd __unused, int value __unused)
+stress_param(void *s __unused, int cmd __unused, unsigned int value __unused)
 {
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 18:27:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7BE410656BE;
	Wed, 10 Jun 2009 18:27:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C5A708FC16;
	Wed, 10 Jun 2009 18:27:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AIRFOC022118;
	Wed, 10 Jun 2009 18:27:15 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AIRFoR022115;
	Wed, 10 Jun 2009 18:27:15 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200906101827.n5AIRFoR022115@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 10 Jun 2009 18:27:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193941 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 18:27:16 -0000

Author: jhb
Date: Wed Jun 10 18:27:15 2009
New Revision: 193941
URL: http://svn.freebsd.org/changeset/base/193941

Log:
  Change a few members of tcpcb that store cached copies of ticks to be ints
  instead of unsigned longs.  This fixes a few overflow edge cases on 64-bit
  platforms.  Specifically, if an idle connection receives a packet shortly
  before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep
  alive timer fires after 2^31 clock ticks, the keep alive timer will think
  that the connection has been idle for a very long time and will immediately
  drop the connection instead of sending a keep alive probe.
  
  Reviewed by:	silby, gnn, lstewart
  MFC after:	1 week

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_usrreq.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Wed Jun 10 18:26:02 2009	(r193940)
+++ head/sys/netinet/tcp_input.c	Wed Jun 10 18:27:15 2009	(r193941)
@@ -1778,7 +1778,7 @@ tcp_do_segment(struct mbuf *m, struct tc
 	    TSTMP_LT(to.to_tsval, tp->ts_recent)) {
 
 		/* Check to see if ts_recent is over 24 days old.  */
-		if ((int)(ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) {
+		if ((ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) {
 			/*
 			 * Invalidate ts_recent.  If this segment updates
 			 * ts_recent, the age will be reset later and ts_recent

Modified: head/sys/netinet/tcp_usrreq.c
==============================================================================
--- head/sys/netinet/tcp_usrreq.c	Wed Jun 10 18:26:02 2009	(r193940)
+++ head/sys/netinet/tcp_usrreq.c	Wed Jun 10 18:27:15 2009	(r193941)
@@ -1823,7 +1823,7 @@ db_print_tcpcb(struct tcpcb *tp, const c
 	    tp->snd_recover);
 
 	db_print_indent(indent);
-	db_printf("t_maxopd: %u   t_rcvtime: %lu   t_startime: %lu\n",
+	db_printf("t_maxopd: %u   t_rcvtime: %u   t_startime: %u\n",
 	    tp->t_maxopd, tp->t_rcvtime, tp->t_starttime);
 
 	db_print_indent(indent);
@@ -1854,7 +1854,7 @@ db_print_tcpcb(struct tcpcb *tp, const c
 	    tp->snd_scale, tp->rcv_scale, tp->request_r_scale);
 
 	db_print_indent(indent);
-	db_printf("ts_recent: %u   ts_recent_age: %lu\n",
+	db_printf("ts_recent: %u   ts_recent_age: %u\n",
 	    tp->ts_recent, tp->ts_recent_age);
 
 	db_print_indent(indent);
@@ -1863,7 +1863,7 @@ db_print_tcpcb(struct tcpcb *tp, const c
 
 	db_print_indent(indent);
 	db_printf("snd_ssthresh_prev: %lu   snd_recover_prev: 0x%08x   "
-	    "t_badrxtwin: %lu\n", tp->snd_ssthresh_prev,
+	    "t_badrxtwin: %u\n", tp->snd_ssthresh_prev,
 	    tp->snd_recover_prev, tp->t_badrxtwin);
 
 	db_print_indent(indent);

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Wed Jun 10 18:26:02 2009	(r193940)
+++ head/sys/netinet/tcp_var.h	Wed Jun 10 18:27:15 2009	(r193941)
@@ -139,8 +139,8 @@ struct tcpcb {
 
 	u_int	t_maxopd;		/* mss plus options */
 
-	u_long	t_rcvtime;		/* inactivity time */
-	u_long	t_starttime;		/* time connection was established */
+	int	t_rcvtime;		/* inactivity time */
+	int	t_starttime;		/* time connection was established */
 	int	t_rtttime;		/* round trip time */
 	tcp_seq	t_rtseq;		/* sequence number being timed */
 
@@ -167,7 +167,7 @@ struct tcpcb {
 	u_char	rcv_scale;		/* window scaling for recv window */
 	u_char	request_r_scale;	/* pending window scaling */
 	u_int32_t  ts_recent;		/* timestamp echo data */
-	u_long	ts_recent_age;		/* when last updated */
+	int	ts_recent_age;		/* when last updated */
 	u_int32_t  ts_offset;		/* our timestamp offset */
 
 	tcp_seq	last_ack_sent;
@@ -175,7 +175,7 @@ struct tcpcb {
 	u_long	snd_cwnd_prev;		/* cwnd prior to retransmit */
 	u_long	snd_ssthresh_prev;	/* ssthresh prior to retransmit */
 	tcp_seq	snd_recover_prev;	/* snd_recover prior to retransmit */
-	u_long	t_badrxtwin;		/* window for retransmit recovery */
+	int	t_badrxtwin;		/* window for retransmit recovery */
 	u_char	snd_limited;		/* segments limited transmitted */
 /* SACK related state */
 	int	snd_numholes;		/* number of holes seen by sender */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 18:43:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A600C1065674;
	Wed, 10 Jun 2009 18:43:57 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 785C88FC0A;
	Wed, 10 Jun 2009 18:43:57 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 268BC46B2C;
	Wed, 10 Jun 2009 14:43:57 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 0124A8A06A;
	Wed, 10 Jun 2009 14:43:56 -0400 (EDT)
From: John Baldwin 
To: src-committers@freebsd.org
Date: Wed, 10 Jun 2009 14:42:20 -0400
User-Agent: KMail/1.9.7
References: <200906101827.n5AIRFoR022115@svn.freebsd.org>
In-Reply-To: <200906101827.n5AIRFoR022115@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200906101442.20988.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Wed, 10 Jun 2009 14:43:56 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r193941 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 18:43:58 -0000

On Wednesday 10 June 2009 2:27:15 pm John Baldwin wrote:
> Author: jhb
> Date: Wed Jun 10 18:27:15 2009
> New Revision: 193941
> URL: http://svn.freebsd.org/changeset/base/193941
> 
> Log:
>   Change a few members of tcpcb that store cached copies of ticks to be ints
>   instead of unsigned longs.  This fixes a few overflow edge cases on 64-bit
>   platforms.  Specifically, if an idle connection receives a packet shortly
>   before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep
>   alive timer fires after 2^31 clock ticks, the keep alive timer will think
>   that the connection has been idle for a very long time and will immediately
>   drop the connection instead of sending a keep alive probe.
>   
>   Reviewed by:	silby, gnn, lstewart
>   MFC after:	1 week

Note that the MFC patch for 7 is very different.  I can't change the members
to int in 7 since tcpcb is part of the ABI (for netstat, etc.).  So, for 7 I
added explicit casts in the math operations using t_rcvtime and ticks.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 19:02:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D35901065672;
	Wed, 10 Jun 2009 19:02:09 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C1BAF8FC14;
	Wed, 10 Jun 2009 19:02:09 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AJ29nf022961;
	Wed, 10 Jun 2009 19:02:09 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AJ29fe022960;
	Wed, 10 Jun 2009 19:02:09 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <200906101902.n5AJ29fe022960@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 10 Jun 2009 19:02: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: r193942 - head/sys/rpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 19:02:10 -0000

Author: rmacklem
Date: Wed Jun 10 19:02:09 2009
New Revision: 193942
URL: http://svn.freebsd.org/changeset/base/193942

Log:
  For the case where another thread was doing a connect and that
  connect failed, the thread would be left stuck in msleep()
  indefinitely, since it would call msleep() again for the case
  where rc_client == NULL. Change the loop criteria and the if just
  after the loop, so that this case is handled correctly.
  
  Reviewed by:	dfr
  Approved by:	kib (mentor)

Modified:
  head/sys/rpc/clnt_rc.c

Modified: head/sys/rpc/clnt_rc.c
==============================================================================
--- head/sys/rpc/clnt_rc.c	Wed Jun 10 18:27:15 2009	(r193941)
+++ head/sys/rpc/clnt_rc.c	Wed Jun 10 19:02:09 2009	(r193942)
@@ -154,7 +154,7 @@ again:
 		return (RPC_CANTSEND);
 	}
 	if (rc->rc_connecting) {
-		while (!rc->rc_closed && !rc->rc_client) {
+		while (!rc->rc_closed && !rc->rc_client && rc->rc_connecting) {
 			error = msleep(rc, &rc->rc_lock,
 			    rc->rc_intr ? PCATCH : 0, "rpcrecon", 0);
 			if (error) {
@@ -166,7 +166,7 @@ again:
 		 * If the other guy failed to connect, we might as
 		 * well have another go.
 		 */
-		if (!rc->rc_client && !rc->rc_connecting)
+		if (!rc->rc_client || rc->rc_closed)
 			goto again;
 		mtx_unlock(&rc->rc_lock);
 		return (RPC_SUCCESS);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 19:02:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE4091065687;
	Wed, 10 Jun 2009 19:02:54 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D1368FC22;
	Wed, 10 Jun 2009 19:02:54 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AJ2s1U023011;
	Wed, 10 Jun 2009 19:02:54 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AJ2sbv023009;
	Wed, 10 Jun 2009 19:02:54 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200906101902.n5AJ2sbv023009@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 10 Jun 2009 19:02:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193943 - head/sbin/fsck_msdosfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 19:02:55 -0000

Author: avg
Date: Wed Jun 10 19:02:54 2009
New Revision: 193943
URL: http://svn.freebsd.org/changeset/base/193943

Log:
  fsck_msdosfs: accept no-op -C option for compatibilty with fsck
  
  Submitted by:	marck
  Reviewed by:	current@
  Approved by:	jhb (mentor)
  MFC after:	1 week

Modified:
  head/sbin/fsck_msdosfs/fsck_msdosfs.8
  head/sbin/fsck_msdosfs/main.c

Modified: head/sbin/fsck_msdosfs/fsck_msdosfs.8
==============================================================================
--- head/sbin/fsck_msdosfs/fsck_msdosfs.8	Wed Jun 10 19:02:09 2009	(r193942)
+++ head/sbin/fsck_msdosfs/fsck_msdosfs.8	Wed Jun 10 19:02:54 2009	(r193943)
@@ -32,7 +32,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 13, 1995
+.Dd June 4, 2009
 .Dt FSCK_MSDOSFS 8
 .Os
 .Sh NAME
@@ -41,10 +41,10 @@
 .Sh SYNOPSIS
 .Nm
 .Fl p
-.Op Fl f
+.Op Fl Cf
 .Ar filesystem ...
 .Nm
-.Op Fl ny
+.Op Fl Cny
 .Ar filesystem ...
 .Sh DESCRIPTION
 The
@@ -80,6 +80,10 @@ making any changes.
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl C
+Compatibility with the corresponding
+.Xr fsck 8
+option (skip check if clean), defined to no-op.
 .It Fl F
 Compatibility with the wrapper
 .Xr fsck 8

Modified: head/sbin/fsck_msdosfs/main.c
==============================================================================
--- head/sbin/fsck_msdosfs/main.c	Wed Jun 10 19:02:09 2009	(r193942)
+++ head/sbin/fsck_msdosfs/main.c	Wed Jun 10 19:02:54 2009	(r193943)
@@ -74,8 +74,10 @@ main(int argc, char **argv)
 	int ch;
 
 	skipclean = 1;
-	while ((ch = getopt(argc, argv, "fFnpy")) != -1) {
+	while ((ch = getopt(argc, argv, "CfFnpy")) != -1) {
 		switch (ch) {
+		case 'C': /* for fsck_ffs compatibility */
+			break;
 		case 'f':
 			skipclean = 0;
 			break;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 19:03:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC0BD1065789;
	Wed, 10 Jun 2009 19:03:23 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A8878FC29;
	Wed, 10 Jun 2009 19:03:23 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AJ3NoI023066;
	Wed, 10 Jun 2009 19:03:23 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AJ3Nt6023064;
	Wed, 10 Jun 2009 19:03:23 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200906101903.n5AJ3Nt6023064@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 10 Jun 2009 19:03:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193944 - in head/etc: defaults rc.d
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 19:03:24 -0000

Author: avg
Date: Wed Jun 10 19:03:23 2009
New Revision: 193944
URL: http://svn.freebsd.org/changeset/base/193944

Log:
  rc.d/fsck: allow additional options for fsck_y_enable via fsck_y_flags
  
  Primary intention is to allow to pass -C option to avoid (re-)checking
  clean filesystems when preening fails and fsck -y kicks in.
  
  Submitted by:	marck
  Reviewed by:	current@
  Approved by:	jhb (mentor)
  MFC after:	1 week

Modified:
  head/etc/defaults/rc.conf
  head/etc/rc.d/fsck

Modified: head/etc/defaults/rc.conf
==============================================================================
--- head/etc/defaults/rc.conf	Wed Jun 10 19:02:54 2009	(r193943)
+++ head/etc/defaults/rc.conf	Wed Jun 10 19:03:23 2009	(r193944)
@@ -83,6 +83,7 @@ geli_swap_flags="-e aes -l 256 -s 4096 -
 
 root_rw_mount="YES"	# Set to NO to inhibit remounting root read-write.
 fsck_y_enable="NO"	# Set to YES to do fsck -y if the initial preen fails.
+fsck_y_flags=""		# Additional flags for fsck -y
 background_fsck="YES"	# Attempt to run fsck in the background where possible.
 background_fsck_delay="60" # Time to wait (seconds) before starting the fsck.
 netfs_types="nfs:NFS nfs4:NFS4 smbfs:SMB portalfs:PORTAL nwfs:NWFS" # Net filesystems.

Modified: head/etc/rc.d/fsck
==============================================================================
--- head/etc/rc.d/fsck	Wed Jun 10 19:02:54 2009	(r193943)
+++ head/etc/rc.d/fsck	Wed Jun 10 19:03:23 2009	(r193944)
@@ -44,8 +44,8 @@ fsck_start()
 			;;
 		8)
 			if checkyesno fsck_y_enable; then
-				echo "File system preen failed, trying fsck -y."
-				fsck -y
+				echo "File system preen failed, trying fsck -y ${fsck_y_flags}"
+				fsck -y ${fsck_y_flags}
 				case $? in
 				0)
 					;;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 19:25:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 973DF1065672;
	Wed, 10 Jun 2009 19:25:46 +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 862418FC24;
	Wed, 10 Jun 2009 19:25:46 +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 n5AJPkdW023660;
	Wed, 10 Jun 2009 19:25:46 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AJPkIV023656;
	Wed, 10 Jun 2009 19:25:46 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906101925.n5AJPkIV023656@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 19:25:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193947 - head/sys/netipsec
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 19:25:47 -0000

Author: bz
Date: Wed Jun 10 19:25:46 2009
New Revision: 193947
URL: http://svn.freebsd.org/changeset/base/193947

Log:
  Properly hide IPv4 only variables and functions under #ifdef INET.

Modified:
  head/sys/netipsec/ipsec.c
  head/sys/netipsec/ipsec_input.c
  head/sys/netipsec/xform_ipip.c

Modified: head/sys/netipsec/ipsec.c
==============================================================================
--- head/sys/netipsec/ipsec.c	Wed Jun 10 19:25:21 2009	(r193946)
+++ head/sys/netipsec/ipsec.c	Wed Jun 10 19:25:46 2009	(r193947)
@@ -1702,6 +1702,7 @@ vshiftl(unsigned char *bitmap, int nbit,
 	}
 }
 
+#ifdef INET
 /* Return a printable string for the IPv4 address. */
 static char *
 inet_ntoa4(struct in_addr ina)
@@ -1716,6 +1717,7 @@ inet_ntoa4(struct in_addr ina)
 	    ucp[2] & 0xff, ucp[3] & 0xff);
 	return (buf[i]);
 }
+#endif
 
 /* Return a printable string for the address. */
 char *

Modified: head/sys/netipsec/ipsec_input.c
==============================================================================
--- head/sys/netipsec/ipsec_input.c	Wed Jun 10 19:25:21 2009	(r193946)
+++ head/sys/netipsec/ipsec_input.c	Wed Jun 10 19:25:46 2009	(r193947)
@@ -103,7 +103,9 @@
 #define IPSEC_ISTAT(p,x,y,z) ((p) == IPPROTO_ESP ? (x)++ : \
 			    (p) == IPPROTO_AH ? (y)++ : (z)++)
 
+#ifdef INET
 static void ipsec4_common_ctlinput(int, struct sockaddr *, void *, int);
+#endif
 
 /*
  * ipsec_common_input gets called when an IPsec-protected packet

Modified: head/sys/netipsec/xform_ipip.c
==============================================================================
--- head/sys/netipsec/xform_ipip.c	Wed Jun 10 19:25:21 2009	(r193946)
+++ head/sys/netipsec/xform_ipip.c	Wed Jun 10 19:25:46 2009	(r193947)
@@ -171,7 +171,9 @@ _ipip_input(struct mbuf *m, int iphlen, 
 {
 	INIT_VNET_NET(curvnet);
 	INIT_VNET_IPSEC(curvnet);
+#ifdef INET
 	register struct sockaddr_in *sin;
+#endif
 	register struct ifnet *ifp;
 	register struct ifaddr *ifa;
 	struct ip *ipo;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 19:52:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A008F106564A;
	Wed, 10 Jun 2009 19:52:31 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 5FBC98FC0A;
	Wed, 10 Jun 2009 19:52:31 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 1B0C946B06;
	Wed, 10 Jun 2009 15:52:31 -0400 (EDT)
Date: Wed, 10 Jun 2009 20:52:31 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: John Baldwin 
In-Reply-To: <200906101827.n5AIRFoR022115@svn.freebsd.org>
Message-ID: 
References: <200906101827.n5AIRFoR022115@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193941 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 19:52:32 -0000


On Wed, 10 Jun 2009, John Baldwin wrote:

>  Change a few members of tcpcb that store cached copies of ticks to be ints
>  instead of unsigned longs.  This fixes a few overflow edge cases on 64-bit
>  platforms.  Specifically, if an idle connection receives a packet shortly
>  before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep
>  alive timer fires after 2^31 clock ticks, the keep alive timer will think
>  that the connection has been idle for a very long time and will immediately
>  drop the connection instead of sending a keep alive probe.
>
>  Reviewed by:	silby, gnn, lstewart
>  MFC after:	1 week

That's pretty subtle even as TCP bugs go, nice work :-).

Robert N M Watson
Computer Laboratory
University of Cambridge

>
> Modified:
>  head/sys/netinet/tcp_input.c
>  head/sys/netinet/tcp_usrreq.c
>  head/sys/netinet/tcp_var.h
>
> Modified: head/sys/netinet/tcp_input.c
> ==============================================================================
> --- head/sys/netinet/tcp_input.c	Wed Jun 10 18:26:02 2009	(r193940)
> +++ head/sys/netinet/tcp_input.c	Wed Jun 10 18:27:15 2009	(r193941)
> @@ -1778,7 +1778,7 @@ tcp_do_segment(struct mbuf *m, struct tc
> 	    TSTMP_LT(to.to_tsval, tp->ts_recent)) {
>
> 		/* Check to see if ts_recent is over 24 days old.  */
> -		if ((int)(ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) {
> +		if ((ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) {
> 			/*
> 			 * Invalidate ts_recent.  If this segment updates
> 			 * ts_recent, the age will be reset later and ts_recent
>
> Modified: head/sys/netinet/tcp_usrreq.c
> ==============================================================================
> --- head/sys/netinet/tcp_usrreq.c	Wed Jun 10 18:26:02 2009	(r193940)
> +++ head/sys/netinet/tcp_usrreq.c	Wed Jun 10 18:27:15 2009	(r193941)
> @@ -1823,7 +1823,7 @@ db_print_tcpcb(struct tcpcb *tp, const c
> 	    tp->snd_recover);
>
> 	db_print_indent(indent);
> -	db_printf("t_maxopd: %u   t_rcvtime: %lu   t_startime: %lu\n",
> +	db_printf("t_maxopd: %u   t_rcvtime: %u   t_startime: %u\n",
> 	    tp->t_maxopd, tp->t_rcvtime, tp->t_starttime);
>
> 	db_print_indent(indent);
> @@ -1854,7 +1854,7 @@ db_print_tcpcb(struct tcpcb *tp, const c
> 	    tp->snd_scale, tp->rcv_scale, tp->request_r_scale);
>
> 	db_print_indent(indent);
> -	db_printf("ts_recent: %u   ts_recent_age: %lu\n",
> +	db_printf("ts_recent: %u   ts_recent_age: %u\n",
> 	    tp->ts_recent, tp->ts_recent_age);
>
> 	db_print_indent(indent);
> @@ -1863,7 +1863,7 @@ db_print_tcpcb(struct tcpcb *tp, const c
>
> 	db_print_indent(indent);
> 	db_printf("snd_ssthresh_prev: %lu   snd_recover_prev: 0x%08x   "
> -	    "t_badrxtwin: %lu\n", tp->snd_ssthresh_prev,
> +	    "t_badrxtwin: %u\n", tp->snd_ssthresh_prev,
> 	    tp->snd_recover_prev, tp->t_badrxtwin);
>
> 	db_print_indent(indent);
>
> Modified: head/sys/netinet/tcp_var.h
> ==============================================================================
> --- head/sys/netinet/tcp_var.h	Wed Jun 10 18:26:02 2009	(r193940)
> +++ head/sys/netinet/tcp_var.h	Wed Jun 10 18:27:15 2009	(r193941)
> @@ -139,8 +139,8 @@ struct tcpcb {
>
> 	u_int	t_maxopd;		/* mss plus options */
>
> -	u_long	t_rcvtime;		/* inactivity time */
> -	u_long	t_starttime;		/* time connection was established */
> +	int	t_rcvtime;		/* inactivity time */
> +	int	t_starttime;		/* time connection was established */
> 	int	t_rtttime;		/* round trip time */
> 	tcp_seq	t_rtseq;		/* sequence number being timed */
>
> @@ -167,7 +167,7 @@ struct tcpcb {
> 	u_char	rcv_scale;		/* window scaling for recv window */
> 	u_char	request_r_scale;	/* pending window scaling */
> 	u_int32_t  ts_recent;		/* timestamp echo data */
> -	u_long	ts_recent_age;		/* when last updated */
> +	int	ts_recent_age;		/* when last updated */
> 	u_int32_t  ts_offset;		/* our timestamp offset */
>
> 	tcp_seq	last_ack_sent;
> @@ -175,7 +175,7 @@ struct tcpcb {
> 	u_long	snd_cwnd_prev;		/* cwnd prior to retransmit */
> 	u_long	snd_ssthresh_prev;	/* ssthresh prior to retransmit */
> 	tcp_seq	snd_recover_prev;	/* snd_recover prior to retransmit */
> -	u_long	t_badrxtwin;		/* window for retransmit recovery */
> +	int	t_badrxtwin;		/* window for retransmit recovery */
> 	u_char	snd_limited;		/* segments limited transmitted */
> /* SACK related state */
> 	int	snd_numholes;		/* number of holes seen by sender */
>

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 20:44:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7542B1065673;
	Wed, 10 Jun 2009 20:44:13 +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 49AE28FC12;
	Wed, 10 Jun 2009 20:44:13 +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 n5AKiD8V025320;
	Wed, 10 Jun 2009 20:44:13 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AKiDR8025319;
	Wed, 10 Jun 2009 20:44:13 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906102044.n5AKiDR8025319@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 20:44:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193949 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 20:44:13 -0000

Author: bz
Date: Wed Jun 10 20:44:13 2009
New Revision: 193949
URL: http://svn.freebsd.org/changeset/base/193949

Log:
  IPsec depends on either IPv4 (inet) or IPv6 (inet6) so properly
  track dependencies and automatically disable building ipsec if
  neither of the two is in the kernel config.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 19:57:54 2009	(r193948)
+++ head/sys/conf/files	Wed Jun 10 20:44:13 2009	(r193949)
@@ -2372,7 +2372,7 @@ netinet/ipfw/ip_fw_pfil.c	optional ipfir
 netinet/ipfw/ip_fw_nat.c	optional ipfirewall_nat
 netinet/ip_icmp.c		optional inet
 netinet/ip_input.c		optional inet
-netinet/ip_ipsec.c		optional ipsec
+netinet/ip_ipsec.c		optional inet ipsec
 netinet/ip_mroute.c		optional mrouting inet | mrouting inet6
 netinet/ip_options.c		optional inet
 netinet/ip_output.c		optional inet
@@ -2438,18 +2438,19 @@ netinet6/route6.c		optional inet6
 netinet6/scope6.c		optional inet6
 netinet6/sctp6_usrreq.c		optional inet6 sctp
 netinet6/udp6_usrreq.c		optional inet6
-netipsec/ipsec.c		optional ipsec
-netipsec/ipsec_input.c		optional ipsec
-netipsec/ipsec_mbuf.c		optional ipsec
-netipsec/ipsec_output.c		optional ipsec
-netipsec/key.c			optional ipsec
-netipsec/key_debug.c		optional ipsec
-netipsec/keysock.c		optional ipsec
-netipsec/xform_ah.c		optional ipsec
-netipsec/xform_esp.c		optional ipsec
-netipsec/xform_ipcomp.c		optional ipsec
-netipsec/xform_ipip.c		optional ipsec
-netipsec/xform_tcp.c		optional ipsec tcp_signature
+netipsec/ipsec.c		optional ipsec inet | ipsec inet6
+netipsec/ipsec_input.c		optional ipsec inet | ipsec inet6
+netipsec/ipsec_mbuf.c		optional ipsec inet | ipsec inet6
+netipsec/ipsec_output.c		optional ipsec inet | ipsec inet6
+netipsec/key.c			optional ipsec inet | ipsec inet6
+netipsec/key_debug.c		optional ipsec inet | ipsec inet6
+netipsec/keysock.c		optional ipsec inet | ipsec inet6
+netipsec/xform_ah.c		optional ipsec inet | ipsec inet6
+netipsec/xform_esp.c		optional ipsec inet | ipsec inet6
+netipsec/xform_ipcomp.c		optional ipsec inet | ipsec inet6
+netipsec/xform_ipip.c		optional ipsec inet | ipsec inet6
+netipsec/xform_tcp.c		optional ipsec inet tcp_signature | \
+					 ipsec inet6 tcp_signature
 netipx/ipx.c			optional ipx
 netipx/ipx_cksum.c		optional ipx
 netipx/ipx_input.c		optional ipx

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 20:56:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E0C23106566B;
	Wed, 10 Jun 2009 20:56:14 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com
	[66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id B44498FC19;
	Wed, 10 Jun 2009 20:56:14 +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 4D67935FBD9;
	Wed, 10 Jun 2009 16:39:30 -0400 (EDT)
Received: from heartbeat1.messagingengine.com ([10.202.2.160])
	by compute1.internal (MEProxy); Wed, 10 Jun 2009 16:39:30 -0400
X-Sasl-enc: Wwn/gK+kjEPKbz/sudYFwZS6cLi6PO5sU5mMLOMAYXT1 1244666369
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 941C71E2A7;
	Wed, 10 Jun 2009 16:39:29 -0400 (EDT)
Message-ID: <4A301A00.4090003@FreeBSD.org>
Date: Wed, 10 Jun 2009 21:39:28 +0100
From: Bruce Simpson 
User-Agent: Thunderbird 2.0.0.21 (X11/20090412)
MIME-Version: 1.0
To: Warner Losh 
References: <200906101812.n5AICGvI021707@svn.freebsd.org>
In-Reply-To: <200906101812.n5AICGvI021707@svn.freebsd.org>
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193938 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 20:56:15 -0000

Warner Losh wrote:
> Author: imp
> Date: Wed Jun 10 18:12:15 2009
> New Revision: 193938
> URL: http://svn.freebsd.org/changeset/base/193938
>
> Log:
>   These are no longer referenced in the tree, so can be safely removed.
>   

Thanks! Death to the Pixies says Frank Black! :-)

Frank Zappa meanwhile remains a major influence in our work.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 20:57:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5193106566C;
	Wed, 10 Jun 2009 20:57:06 +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 C3C678FC12;
	Wed, 10 Jun 2009 20:57:06 +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 n5AKv6M7025670;
	Wed, 10 Jun 2009 20:57:06 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AKv69B025669;
	Wed, 10 Jun 2009 20:57:06 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906102057.n5AKv69B025669@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 20:57:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193950 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 20:57:07 -0000

Author: bz
Date: Wed Jun 10 20:57:06 2009
New Revision: 193950
URL: http://svn.freebsd.org/changeset/base/193950

Log:
  ip_divert.c requires both INET and IPFIREWALL to be present:
  	#error "IPDIVERT requires INET."
  	#error "IPDIVERT requires IPFIREWALL"
  so properly track those depencies here.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 20:44:13 2009	(r193949)
+++ head/sys/conf/files	Wed Jun 10 20:57:06 2009	(r193950)
@@ -2361,7 +2361,7 @@ netinet/in_pcb.c		optional inet
 netinet/in_proto.c		optional inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
 netinet/in_rmx.c		optional inet
-netinet/ip_divert.c		optional ipdivert
+netinet/ip_divert.c		optional inet ipdivert ipfirewall
 netinet/ipfw/ip_dummynet.c	optional dummynet
 netinet/ip_ecn.c		optional inet | inet6
 netinet/ip_encap.c		optional inet | inet6

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 20:59:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22DD6106564A;
	Wed, 10 Jun 2009 20:59:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0F19D8FC13;
	Wed, 10 Jun 2009 20:59:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AKxYqC025776;
	Wed, 10 Jun 2009 20:59:34 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AKxXx0025758;
	Wed, 10 Jun 2009 20:59:33 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200906102059.n5AKxXx0025758@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jun 2009 20:59:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193951 - in head/sys: cam/scsi i386/acpica kern net
	security/audit sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 20:59:34 -0000

Author: kib
Date: Wed Jun 10 20:59:32 2009
New Revision: 193951
URL: http://svn.freebsd.org/changeset/base/193951

Log:
  Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use
  vnode interlock to protect the knote fields [1]. The locking assumes
  that shared vnode lock is held, thus we get exclusive access to knote
  either by exclusive vnode lock protection, or by shared vnode lock +
  vnode interlock.
  
  Do not use kl_locked() method to assert either lock ownership or the
  fact that curthread does not own the lock. For shared locks, ownership
  is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared
  lock not owned by curthread, causing false positives in kqueue subsystem
  assertions about knlist lock.
  
  Remove kl_locked method from knlist lock vector, and add two separate
  assertion methods kl_assert_locked and kl_assert_unlocked, that are
  supposed to use proper asserts. Change knlist_init accordingly.
  
  Add convenience function knlist_init_mtx to reduce number of arguments
  for typical knlist initialization.
  
  Submitted by:	jhb [1]
  Noted by:	jhb [2]
  Reviewed by:	jhb
  Tested by:	rnoland

Modified:
  head/sys/cam/scsi/scsi_target.c
  head/sys/i386/acpica/acpi_machdep.c
  head/sys/kern/init_main.c
  head/sys/kern/kern_event.c
  head/sys/kern/kern_fork.c
  head/sys/kern/sys_pipe.c
  head/sys/kern/tty.c
  head/sys/kern/tty_pts.c
  head/sys/kern/uipc_mqueue.c
  head/sys/kern/uipc_socket.c
  head/sys/kern/vfs_aio.c
  head/sys/kern/vfs_subr.c
  head/sys/net/bpf.c
  head/sys/net/if.c
  head/sys/net/if_tap.c
  head/sys/net/if_tun.c
  head/sys/security/audit/audit_pipe.c
  head/sys/sys/event.h

Modified: head/sys/cam/scsi/scsi_target.c
==============================================================================
--- head/sys/cam/scsi/scsi_target.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/cam/scsi/scsi_target.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -194,7 +194,7 @@ targopen(struct cdev *dev, int flags, in
 	TAILQ_INIT(&softc->work_queue);
 	TAILQ_INIT(&softc->abort_queue);
 	TAILQ_INIT(&softc->user_ccb_queue);
-	knlist_init(&softc->read_select.si_note, NULL, NULL, NULL, NULL);
+	knlist_init_mtx(&softc->read_select.si_note, NULL);
 
 	return (0);
 }

Modified: head/sys/i386/acpica/acpi_machdep.c
==============================================================================
--- head/sys/i386/acpica/acpi_machdep.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/i386/acpica/acpi_machdep.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -260,7 +260,7 @@ apm_create_clone(struct cdev *dev, struc
 	clone->acpi_sc = acpi_sc;
 	clone->notify_status = APM_EV_NONE;
 	bzero(&clone->sel_read, sizeof(clone->sel_read));
-	knlist_init(&clone->sel_read.si_note, &acpi_mutex, NULL, NULL, NULL);
+	knlist_init_mtx(&clone->sel_read.si_note, &acpi_mutex);
 
 	/*
 	 * The acpi device is always managed by devd(8) and is considered

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/init_main.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -423,7 +423,7 @@ proc0_init(void *dummy __unused)
 	p->p_sysent = &null_sysvec;
 	p->p_flag = P_SYSTEM | P_INMEM;
 	p->p_state = PRS_NORMAL;
-	knlist_init(&p->p_klist, &p->p_mtx, NULL, NULL, NULL);
+	knlist_init_mtx(&p->p_klist, &p->p_mtx);
 	STAILQ_INIT(&p->p_ktr);
 	p->p_nice = NZERO;
 	td->td_tid = PID_MAX + 1;

Modified: head/sys/kern/kern_event.c
==============================================================================
--- head/sys/kern/kern_event.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/kern_event.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -208,12 +208,10 @@ SYSCTL_INT(_kern, OID_AUTO, kq_calloutma
 } while (0)
 #ifdef INVARIANTS
 #define	KNL_ASSERT_LOCKED(knl) do {					\
-	if (!knl->kl_locked((knl)->kl_lockarg))				\
-			panic("knlist not locked, but should be");	\
+	knl->kl_assert_locked((knl)->kl_lockarg);			\
 } while (0)
-#define	KNL_ASSERT_UNLOCKED(knl) do {				\
-	if (knl->kl_locked((knl)->kl_lockarg))				\
-		panic("knlist locked, but should not be");		\
+#define	KNL_ASSERT_UNLOCKED(knl) do {					\
+	knl->kl_assert_unlocked((knl)->kl_lockarg);			\
 } while (0)
 #else /* !INVARIANTS */
 #define	KNL_ASSERT_LOCKED(knl) do {} while(0)
@@ -577,7 +575,7 @@ kqueue(struct thread *td, struct kqueue_
 	mtx_init(&kq->kq_lock, "kqueue", NULL, MTX_DEF|MTX_DUPOK);
 	TAILQ_INIT(&kq->kq_head);
 	kq->kq_fdp = fdp;
-	knlist_init(&kq->kq_sel.si_note, &kq->kq_lock, NULL, NULL, NULL);
+	knlist_init_mtx(&kq->kq_sel.si_note, &kq->kq_lock);
 	TASK_INIT(&kq->kq_task, 0, kqueue_task, kq);
 
 	FILEDESC_XLOCK(fdp);
@@ -1723,7 +1721,6 @@ MTX_SYSINIT(knlist_lock, &knlist_lock, "
 	MTX_DEF);
 static void knlist_mtx_lock(void *arg);
 static void knlist_mtx_unlock(void *arg);
-static int knlist_mtx_locked(void *arg);
 
 static void
 knlist_mtx_lock(void *arg)
@@ -1737,15 +1734,22 @@ knlist_mtx_unlock(void *arg)
 	mtx_unlock((struct mtx *)arg);
 }
 
-static int
-knlist_mtx_locked(void *arg)
+static void
+knlist_mtx_assert_locked(void *arg)
+{
+	mtx_assert((struct mtx *)arg, MA_OWNED);
+}
+
+static void
+knlist_mtx_assert_unlocked(void *arg)
 {
-	return (mtx_owned((struct mtx *)arg));
+	mtx_assert((struct mtx *)arg, MA_NOTOWNED);
 }
 
 void
 knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *),
-    void (*kl_unlock)(void *), int (*kl_locked)(void *))
+    void (*kl_unlock)(void *),
+    void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *))
 {
 
 	if (lock == NULL)
@@ -1761,15 +1765,26 @@ knlist_init(struct knlist *knl, void *lo
 		knl->kl_unlock = knlist_mtx_unlock;
 	else
 		knl->kl_unlock = kl_unlock;
-	if (kl_locked == NULL)
-		knl->kl_locked = knlist_mtx_locked;
+	if (kl_assert_locked == NULL)
+		knl->kl_assert_locked = knlist_mtx_assert_locked;
 	else
-		knl->kl_locked = kl_locked;
+		knl->kl_assert_locked = kl_assert_locked;
+	if (kl_assert_unlocked == NULL)
+		knl->kl_assert_unlocked = knlist_mtx_assert_unlocked;
+	else
+		knl->kl_assert_unlocked = kl_assert_unlocked;
 
 	SLIST_INIT(&knl->kl_list);
 }
 
 void
+knlist_init_mtx(struct knlist *knl, struct mtx *lock)
+{
+
+	knlist_init(knl, lock, NULL, NULL, NULL, NULL);
+}
+
+void
 knlist_destroy(struct knlist *knl)
 {
 

Modified: head/sys/kern/kern_fork.c
==============================================================================
--- head/sys/kern/kern_fork.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/kern_fork.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -304,7 +304,7 @@ norfproc_fail:
 #ifdef MAC
 	mac_proc_init(newproc);
 #endif
-	knlist_init(&newproc->p_klist, &newproc->p_mtx, NULL, NULL, NULL);
+	knlist_init_mtx(&newproc->p_klist, &newproc->p_mtx);
 	STAILQ_INIT(&newproc->p_ktr);
 
 	/* We have to lock the process tree while we look for a pid. */

Modified: head/sys/kern/sys_pipe.c
==============================================================================
--- head/sys/kern/sys_pipe.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/sys_pipe.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -328,10 +328,8 @@ kern_pipe(struct thread *td, int fildes[
 	rpipe = &pp->pp_rpipe;
 	wpipe = &pp->pp_wpipe;
 
-	knlist_init(&rpipe->pipe_sel.si_note, PIPE_MTX(rpipe), NULL, NULL,
-	    NULL);
-	knlist_init(&wpipe->pipe_sel.si_note, PIPE_MTX(wpipe), NULL, NULL,
-	    NULL);
+	knlist_init_mtx(&rpipe->pipe_sel.si_note, PIPE_MTX(rpipe));
+	knlist_init_mtx(&wpipe->pipe_sel.si_note, PIPE_MTX(wpipe));
 
 	/* Only the forward direction pipe is backed by default */
 	if ((error = pipe_create(rpipe, 1)) != 0 ||

Modified: head/sys/kern/tty.c
==============================================================================
--- head/sys/kern/tty.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/tty.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -933,8 +933,8 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo
 		mtx_init(&tp->t_mtxobj, "ttymtx", NULL, MTX_DEF);
 	}
 
-	knlist_init(&tp->t_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
-	knlist_init(&tp->t_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
+	knlist_init_mtx(&tp->t_inpoll.si_note, tp->t_mtx);
+	knlist_init_mtx(&tp->t_outpoll.si_note, tp->t_mtx);
 
 	sx_xlock(&tty_list_sx);
 	TAILQ_INSERT_TAIL(&tty_list, tp, t_list);

Modified: head/sys/kern/tty_pts.c
==============================================================================
--- head/sys/kern/tty_pts.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/tty_pts.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -742,8 +742,8 @@ pts_alloc(int fflags, struct thread *td,
 	uihold(uid);
 
 	tp = tty_alloc(&pts_class, psc);
-	knlist_init(&psc->pts_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
-	knlist_init(&psc->pts_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
+	knlist_init_mtx(&psc->pts_inpoll.si_note, tp->t_mtx);
+	knlist_init_mtx(&psc->pts_outpoll.si_note, tp->t_mtx);
 
 	/* Expose the slave device as well. */
 	tty_makedev(tp, td->td_ucred, "pts/%u", psc->pts_unit);
@@ -782,8 +782,8 @@ pts_alloc_external(int fflags, struct th
 	uihold(uid);
 
 	tp = tty_alloc(&pts_class, psc);
-	knlist_init(&psc->pts_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
-	knlist_init(&psc->pts_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
+	knlist_init_mtx(&psc->pts_inpoll.si_note, tp->t_mtx);
+	knlist_init_mtx(&psc->pts_outpoll.si_note, tp->t_mtx);
 
 	/* Expose the slave device as well. */
 	tty_makedev(tp, td->td_ucred, "%s", name);

Modified: head/sys/kern/uipc_mqueue.c
==============================================================================
--- head/sys/kern/uipc_mqueue.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/uipc_mqueue.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -1531,8 +1531,8 @@ mqueue_alloc(const struct mq_attr *attr)
 		mq->mq_msgsize = default_msgsize;
 	}
 	mtx_init(&mq->mq_mutex, "mqueue lock", NULL, MTX_DEF);
-	knlist_init(&mq->mq_rsel.si_note, &mq->mq_mutex, NULL, NULL, NULL);
-	knlist_init(&mq->mq_wsel.si_note, &mq->mq_mutex, NULL, NULL, NULL);
+	knlist_init_mtx(&mq->mq_rsel.si_note, &mq->mq_mutex);
+	knlist_init_mtx(&mq->mq_wsel.si_note, &mq->mq_mutex);
 	atomic_add_int(&curmq, 1);
 	return (mq);
 }

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/uipc_socket.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -376,10 +376,8 @@ socreate(int dom, struct socket **aso, i
 #ifdef MAC
 	mac_socket_create(cred, so);
 #endif
-	knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv),
-	    NULL, NULL, NULL);
-	knlist_init(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd),
-	    NULL, NULL, NULL);
+	knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv));
+	knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd));
 	so->so_count = 1;
 	/*
 	 * Auto-sizing of socket buffers is managed by the protocols and
@@ -445,10 +443,8 @@ sonewconn(struct socket *head, int conns
 #ifdef MAC
 	mac_socket_newconn(head, so);
 #endif
-	knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv),
-	    NULL, NULL, NULL);
-	knlist_init(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd),
-	    NULL, NULL, NULL);
+	knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv));
+	knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd));
 	if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) ||
 	    (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) {
 		sodealloc(so);

Modified: head/sys/kern/vfs_aio.c
==============================================================================
--- head/sys/kern/vfs_aio.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/vfs_aio.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -1485,7 +1485,7 @@ aio_aqueue(struct thread *td, struct aio
 	aiocbe = uma_zalloc(aiocb_zone, M_WAITOK | M_ZERO);
 	aiocbe->inputcharge = 0;
 	aiocbe->outputcharge = 0;
-	knlist_init(&aiocbe->klist, AIO_MTX(ki), NULL, NULL, NULL);
+	knlist_init_mtx(&aiocbe->klist, AIO_MTX(ki));
 
 	error = ops->copyin(job, &aiocbe->uaiocb);
 	if (error) {
@@ -2107,7 +2107,7 @@ kern_lio_listio(struct thread *td, int m
 	lj->lioj_flags = 0;
 	lj->lioj_count = 0;
 	lj->lioj_finished_count = 0;
-	knlist_init(&lj->klist, AIO_MTX(ki), NULL, NULL, NULL);
+	knlist_init_mtx(&lj->klist, AIO_MTX(ki));
 	ksiginfo_init(&lj->lioj_ksi);
 
 	/*

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/kern/vfs_subr.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -110,7 +110,8 @@ static void	vnlru_free(int);
 static void	vgonel(struct vnode *);
 static void	vfs_knllock(void *arg);
 static void	vfs_knlunlock(void *arg);
-static int	vfs_knllocked(void *arg);
+static void	vfs_knl_assert_locked(void *arg);
+static void	vfs_knl_assert_unlocked(void *arg);
 static void	destroy_vpollinfo(struct vpollinfo *vi);
 
 /*
@@ -3271,7 +3272,7 @@ v_addpollinfo(struct vnode *vp)
 	vi = uma_zalloc(vnodepoll_zone, M_WAITOK);
 	mtx_init(&vi->vpi_lock, "vnode pollinfo", NULL, MTX_DEF);
 	knlist_init(&vi->vpi_selinfo.si_note, vp, vfs_knllock,
-	    vfs_knlunlock, vfs_knllocked);
+	    vfs_knlunlock, vfs_knl_assert_locked, vfs_knl_assert_unlocked);
 	VI_LOCK(vp);
 	if (vp->v_pollinfo != NULL) {
 		VI_UNLOCK(vp);
@@ -3986,7 +3987,7 @@ static struct knlist fs_knlist;
 static void
 vfs_event_init(void *arg)
 {
-	knlist_init(&fs_knlist, NULL, NULL, NULL, NULL);
+	knlist_init_mtx(&fs_knlist, NULL);
 }
 /* XXX - correct order? */
 SYSINIT(vfs_knlist, SI_SUB_VFS, SI_ORDER_ANY, vfs_event_init, NULL);
@@ -4099,12 +4100,24 @@ vfs_knlunlock(void *arg)
 	VOP_UNLOCK(vp, 0);
 }
 
-static int
-vfs_knllocked(void *arg)
+static void
+vfs_knl_assert_locked(void *arg)
+{
+#ifdef DEBUG_VFS_LOCKS
+	struct vnode *vp = arg;
+
+	ASSERT_VOP_LOCKED(vp, "vfs_knl_assert_locked");
+#endif
+}
+
+static void
+vfs_knl_assert_unlocked(void *arg)
 {
+#ifdef DEBUG_VFS_LOCKS
 	struct vnode *vp = arg;
 
-	return (VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
+	ASSERT_VOP_UNLOCKED(vp, "vfs_knl_assert_unlocked");
+#endif
 }
 
 int
@@ -4157,27 +4170,37 @@ filt_vfsread(struct knote *kn, long hint
 {
 	struct vnode *vp = (struct vnode *)kn->kn_hook;
 	struct vattr va;
+	int res;
 
 	/*
 	 * filesystem is gone, so set the EOF flag and schedule
 	 * the knote for deletion.
 	 */
 	if (hint == NOTE_REVOKE) {
+		VI_LOCK(vp);
 		kn->kn_flags |= (EV_EOF | EV_ONESHOT);
+		VI_UNLOCK(vp);
 		return (1);
 	}
 
 	if (VOP_GETATTR(vp, &va, curthread->td_ucred))
 		return (0);
 
+	VI_LOCK(vp);
 	kn->kn_data = va.va_size - kn->kn_fp->f_offset;
-	return (kn->kn_data != 0);
+	res = (kn->kn_data != 0);
+	VI_UNLOCK(vp);
+	return (res);
 }
 
 /*ARGSUSED*/
 static int
 filt_vfswrite(struct knote *kn, long hint)
 {
+	struct vnode *vp = (struct vnode *)kn->kn_hook;
+
+	VI_LOCK(vp);
+
 	/*
 	 * filesystem is gone, so set the EOF flag and schedule
 	 * the knote for deletion.
@@ -4186,19 +4209,27 @@ filt_vfswrite(struct knote *kn, long hin
 		kn->kn_flags |= (EV_EOF | EV_ONESHOT);
 
 	kn->kn_data = 0;
+	VI_UNLOCK(vp);
 	return (1);
 }
 
 static int
 filt_vfsvnode(struct knote *kn, long hint)
 {
+	struct vnode *vp = (struct vnode *)kn->kn_hook;
+	int res;
+
+	VI_LOCK(vp);
 	if (kn->kn_sfflags & hint)
 		kn->kn_fflags |= hint;
 	if (hint == NOTE_REVOKE) {
 		kn->kn_flags |= EV_EOF;
+		VI_UNLOCK(vp);
 		return (1);
 	}
-	return (kn->kn_fflags != 0);
+	res = (kn->kn_fflags != 0);
+	VI_UNLOCK(vp);
+	return (res);
 }
 
 int

Modified: head/sys/net/bpf.c
==============================================================================
--- head/sys/net/bpf.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/net/bpf.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -648,7 +648,7 @@ bpfopen(struct cdev *dev, int flags, int
 #endif
 	mtx_init(&d->bd_mtx, devtoname(dev), "bpf cdev lock", MTX_DEF);
 	callout_init(&d->bd_callout, CALLOUT_MPSAFE);
-	knlist_init(&d->bd_sel.si_note, &d->bd_mtx, NULL, NULL, NULL);
+	knlist_init_mtx(&d->bd_sel.si_note, &d->bd_mtx);
 
 	return (0);
 }

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/net/if.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -445,7 +445,7 @@ vnet_net_iattach(const void *unused __un
 
 	TAILQ_INIT(&V_ifnet);
 	TAILQ_INIT(&V_ifg_head);
-	knlist_init(&V_ifklist, NULL, NULL, NULL, NULL);
+	knlist_init_mtx(&V_ifklist, NULL);
 	if_grow();				/* create initial table */
 
 	return (0);
@@ -548,7 +548,7 @@ if_alloc(u_char type)
 	TAILQ_INIT(&ifp->if_prefixhead);
 	TAILQ_INIT(&ifp->if_multiaddrs);
 	TAILQ_INIT(&ifp->if_groups);
-	knlist_init(&ifp->if_klist, NULL, NULL, NULL, NULL);
+	knlist_init_mtx(&ifp->if_klist, NULL);
 #ifdef MAC
 	mac_ifnet_init(ifp);
 #endif

Modified: head/sys/net/if_tap.c
==============================================================================
--- head/sys/net/if_tap.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/net/if_tap.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -462,7 +462,7 @@ tapcreate(struct cdev *dev)
 	tp->tap_flags |= TAP_INITED;
 	mtx_unlock(&tp->tap_mtx);
 
-	knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL);
+	knlist_init_mtx(&tp->tap_rsel.si_note, NULL);
 
 	TAPDEBUG("interface %s is created. minor = %#x\n", 
 		ifp->if_xname, dev2unit(dev));

Modified: head/sys/net/if_tun.c
==============================================================================
--- head/sys/net/if_tun.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/net/if_tun.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -391,7 +391,7 @@ tuncreate(const char *name, struct cdev 
 	IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
 	ifp->if_snd.ifq_drv_maxlen = 0;
 	IFQ_SET_READY(&ifp->if_snd);
-	knlist_init(&sc->tun_rsel.si_note, NULL, NULL, NULL, NULL);
+	knlist_init_mtx(&sc->tun_rsel.si_note, NULL);
 
 	if_attach(ifp);
 	bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));

Modified: head/sys/security/audit/audit_pipe.c
==============================================================================
--- head/sys/security/audit/audit_pipe.c	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/security/audit/audit_pipe.c	Wed Jun 10 20:59:32 2009	(r193951)
@@ -579,8 +579,7 @@ audit_pipe_alloc(void)
 		return (NULL);
 	ap->ap_qlimit = AUDIT_PIPE_QLIMIT_DEFAULT;
 	TAILQ_INIT(&ap->ap_queue);
-	knlist_init(&ap->ap_selinfo.si_note, AUDIT_PIPE_MTX(ap), NULL, NULL,
-	    NULL);
+	knlist_init_mtx(&ap->ap_selinfo.si_note, AUDIT_PIPE_MTX(ap));
 	AUDIT_PIPE_LOCK_INIT(ap);
 	AUDIT_PIPE_SX_LOCK_INIT(ap);
 	cv_init(&ap->ap_cv, "audit_pipe");

Modified: head/sys/sys/event.h
==============================================================================
--- head/sys/sys/event.h	Wed Jun 10 20:57:06 2009	(r193950)
+++ head/sys/sys/event.h	Wed Jun 10 20:59:32 2009	(r193951)
@@ -124,7 +124,8 @@ struct knlist {
 	struct	klist	kl_list;
 	void    (*kl_lock)(void *);	/* lock function */
 	void    (*kl_unlock)(void *);
-	int    (*kl_locked)(void *);
+	void	(*kl_assert_locked)(void *);
+	void	(*kl_assert_unlocked)(void *);
 	void *kl_lockarg;		/* argument passed to kl_lockf() */
 };
 
@@ -203,6 +204,7 @@ struct kevent_copyops {
 struct thread;
 struct proc;
 struct knlist;
+struct mtx;
 
 extern void	knote(struct knlist *list, long hint, int islocked);
 extern void	knote_fork(struct knlist *list, int pid);
@@ -212,7 +214,8 @@ extern void	knlist_remove_inevent(struct
 extern int	knlist_empty(struct knlist *knl);
 extern void	knlist_init(struct knlist *knl, void *lock,
     void (*kl_lock)(void *), void (*kl_unlock)(void *),
-    int (*kl_locked)(void *));
+    void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *));
+extern void	knlist_init_mtx(struct knlist *knl, struct mtx *lock);
 extern void	knlist_destroy(struct knlist *knl);
 extern void	knlist_cleardel(struct knlist *knl, struct thread *td,
 	int islocked, int killkn);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:03:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B78210656A8;
	Wed, 10 Jun 2009 21:03:58 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 693EF8FC25;
	Wed, 10 Jun 2009 21:03:58 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AL3whk025925;
	Wed, 10 Jun 2009 21:03:58 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AL3w9V025924;
	Wed, 10 Jun 2009 21:03:58 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <200906102103.n5AL3w9V025924@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 10 Jun 2009 21:03: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: r193952 - head/sys/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:03:59 -0000

Author: rmacklem
Date: Wed Jun 10 21:03:57 2009
New Revision: 193952
URL: http://svn.freebsd.org/changeset/base/193952

Log:
  Add a test for VI_DOOMED just after nfs_upgrade_vnlock() in
  nfs_bioread_check_cons(). This is required since it is possible
  for the vnode to be vgonel()'d while in nfs_upgrade_vnlock() when
  a forced dismount is in progress. Also, move the check for VI_DOOMED
  in nfs_vinvalbuf() down to after nfs_upgrade_vnlock() and replace the
  out of date comment for it.
  
  Submitted by:	jhb
  Tested by:	pho
  Approved by:	kib (mentor)
  MFC after:	1 month

Modified:
  head/sys/nfsclient/nfs_bio.c

Modified: head/sys/nfsclient/nfs_bio.c
==============================================================================
--- head/sys/nfsclient/nfs_bio.c	Wed Jun 10 20:59:32 2009	(r193951)
+++ head/sys/nfsclient/nfs_bio.c	Wed Jun 10 21:03:57 2009	(r193952)
@@ -389,6 +389,11 @@ nfs_bioread_check_cons(struct vnode *vp,
 	 * But for now, this suffices.
 	 */
 	old_lock = nfs_upgrade_vnlock(vp);
+	if (vp->v_iflag & VI_DOOMED) {
+		nfs_downgrade_vnlock(vp, old_lock);
+		return (EBADF);
+	}
+		
 	mtx_lock(&np->n_mtx);
 	if (np->n_flag & NMODIFIED) {
 		mtx_unlock(&np->n_mtx);
@@ -1289,14 +1294,6 @@ nfs_vinvalbuf(struct vnode *vp, int flag
 
 	ASSERT_VOP_LOCKED(vp, "nfs_vinvalbuf");
 
-	/*
-	 * XXX This check stops us from needlessly doing a vinvalbuf when
-	 * being called through vclean().  It is not clear that this is
-	 * unsafe.
-	 */
-	if (vp->v_iflag & VI_DOOMED)
-		return (0);
-
 	if ((nmp->nm_flag & NFSMNT_INT) == 0)
 		intrflg = 0;
 	if (intrflg) {
@@ -1308,6 +1305,16 @@ nfs_vinvalbuf(struct vnode *vp, int flag
 	}
 
 	old_lock = nfs_upgrade_vnlock(vp);
+	if (vp->v_iflag & VI_DOOMED) {
+		/*
+		 * Since vgonel() uses the generic vinvalbuf() to flush
+		 * dirty buffers and it does not call this function, it
+		 * is safe to just return OK when VI_DOOMED is set.
+		 */
+		nfs_downgrade_vnlock(vp, old_lock);
+		return (0);
+	}
+
 	/*
 	 * Now, flush as required.
 	 */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:05:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD2BD10656C2;
	Wed, 10 Jun 2009 21:05:37 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C12F68FC27;
	Wed, 10 Jun 2009 21:05:37 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AL5bTk026003;
	Wed, 10 Jun 2009 21:05:37 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AL5bPH026001;
	Wed, 10 Jun 2009 21:05:37 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906102105.n5AL5bPH026001@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 10 Jun 2009 21:05:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193953 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:05:38 -0000

Author: kmacy
Date: Wed Jun 10 21:05:37 2009
New Revision: 193953
URL: http://svn.freebsd.org/changeset/base/193953

Log:
  use default policy for enabling prefetching unless the TUNABLE is set

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Jun 10 21:03:57 2009	(r193952)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Jun 10 21:05:37 2009	(r193953)
@@ -158,7 +158,6 @@ static int		arc_grow_retry = 60;
  */
 static int		arc_min_prefetch_lifespan;
 
-extern int zfs_prefetch_disable;
 extern int zfs_prefetch_enable;
 static int arc_dead;
 
@@ -3423,6 +3422,8 @@ arc_lowmem(void *arg __unused, int howto
 void
 arc_init(void)
 {
+	int prefetch_tunable_set = 0;
+	
 	mutex_init(&arc_reclaim_thr_lock, NULL, MUTEX_DEFAULT, NULL);
 	cv_init(&arc_reclaim_thr_cv, NULL, CV_DEFAULT, NULL);
 	mutex_init(&arc_lowmem_lock, NULL, MUTEX_DEFAULT, NULL);
@@ -3551,19 +3552,23 @@ arc_init(void)
 	mutex_init(&zfs_write_limit_lock, NULL, MUTEX_DEFAULT, NULL);
 
 #ifdef _KERNEL
+	if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_enable", &zfs_prefetch_enable))
+		prefetch_tunable_set = 1;
+	
 #ifdef __i386__
-	if (zfs_prefetch_enable != 1) {
+	if (prefetch_tunable_set == 0) {
 		printf("ZFS NOTICE: prefetch is disabled by default on i386"
 		    " - add enable to tunable to change.\n" );
-		zfs_prefetch_disable=1;
+		zfs_prefetch_enable=0;
 	}
-#endif	
+#else	
 	if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) &&
-	    (zfs_prefetch_enable != 1) && (zfs_prefetch_disable != 1)) {
+	    prefetch_tunable_set == 0) {
 		printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set"
 		    "... disabling.\n");
-		zfs_prefetch_disable=1;
+		zfs_prefetch_enable=0;
 	}
+#endif	
 	/* Warn about ZFS memory and address space requirements. */
 	if (((uint64_t)physmem * PAGESIZE) < (256 + 128 + 64) * (1 << 20)) {
 		printf("ZFS WARNING: Recommended minimum RAM size is 512MB; "

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Wed Jun 10 21:03:57 2009	(r193952)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Wed Jun 10 21:05:37 2009	(r193953)
@@ -37,8 +37,7 @@
  * until we can get this working the way we want it to.
  */
 
-int zfs_prefetch_disable = 0;
-int zfs_prefetch_enable = 0;
+int zfs_prefetch_enable = 1;
 
 /* max # of streams per zfetch */
 uint32_t	zfetch_max_streams = 8;
@@ -50,10 +49,6 @@ uint32_t	zfetch_block_cap = 256;
 uint64_t	zfetch_array_rd_sz = 1024 * 1024;
 
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.prefetch_disable", &zfs_prefetch_disable);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN,
-    &zfs_prefetch_disable, 0, "Disable prefetch");
-TUNABLE_INT("vfs.zfs.prefetch_enable", &zfs_prefetch_enable);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_enable, CTLFLAG_RDTUN,
     &zfs_prefetch_enable, 0, "Enable prefetch for systems with less than 4GB");
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:06:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A922810656E2;
	Wed, 10 Jun 2009 21:06:07 +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 977FE8FC33;
	Wed, 10 Jun 2009 21:06:07 +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 n5AL67FV026055;
	Wed, 10 Jun 2009 21:06:07 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AL67ml026054;
	Wed, 10 Jun 2009 21:06:07 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906102106.n5AL67ml026054@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 21:06:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193954 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:06:08 -0000

Author: bz
Date: Wed Jun 10 21:06:07 2009
New Revision: 193954
URL: http://svn.freebsd.org/changeset/base/193954

Log:
  ipfirewall insists on INET:
  	#error IPFIREWALL requires INET.
  Track it here to not build ipfirewall with no INET in the kernel.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 21:05:37 2009	(r193953)
+++ head/sys/conf/files	Wed Jun 10 21:06:07 2009	(r193954)
@@ -2366,10 +2366,10 @@ netinet/ipfw/ip_dummynet.c	optional dumm
 netinet/ip_ecn.c		optional inet | inet6
 netinet/ip_encap.c		optional inet | inet6
 netinet/ip_fastfwd.c		optional inet
-netinet/ipfw/ip_fw2.c		optional ipfirewall \
+netinet/ipfw/ip_fw2.c		optional inet ipfirewall \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-netinet/ipfw/ip_fw_pfil.c	optional ipfirewall
-netinet/ipfw/ip_fw_nat.c	optional ipfirewall_nat
+netinet/ipfw/ip_fw_pfil.c	optional inet ipfirewall
+netinet/ipfw/ip_fw_nat.c	optional inet ipfirewall_nat
 netinet/ip_icmp.c		optional inet
 netinet/ip_input.c		optional inet
 netinet/ip_ipsec.c		optional inet ipsec

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:07:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2FDA1065672;
	Wed, 10 Jun 2009 21:07:57 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.248])
	by mx1.freebsd.org (Postfix) with ESMTP id 680CF8FC28;
	Wed, 10 Jun 2009 21:07:57 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: by an-out-0708.google.com with SMTP id c3so565954ana.13
	for ; Wed, 10 Jun 2009 14:07:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=IK0jIMbu2wvffxCK5BCROB4+08YDLCHo5BzWxaKs+AM=;
	b=Zh9OhF4U55B4AJjXyha5u1HNhgN45UzJFT5MDQ+Nm2fNrhen9PKUhmAEiVpDhVLl3G
	ZeTP1+iwttQCCTSrobJ3IcoGgM2UgiFqc+W8pOQAQdwQIPtT/8q12A/e693tvnR/mSUV
	M3ADlSzMbV7jeoY73zbFZAbowsqRy5Oj9Ye+M=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=UPRJGrsRBoI9Ngj/Id2L/9IacnMh6I4L2kTNlA8/t3PuXo3ZBPQn5CFWn1IlSVaOTG
	qEG0DwcVQqdpGJUKmepLhb8hMtOxRDqE0B28JvQ6AkvEuodic2VaUhJf4aT1iGhOR45x
	S5r5IHiv3m5cVhckIR4l6x3w986iNjNmL6hTA=
MIME-Version: 1.0
Sender: mat.macy@gmail.com
Received: by 10.100.205.15 with SMTP id c15mr1953187ang.5.1244668076221; Wed, 
	10 Jun 2009 14:07:56 -0700 (PDT)
In-Reply-To: <200906100923.42093.jhb@freebsd.org>
References: <200906100121.n5A1LWVO089719@svn.freebsd.org>
	<3c1674c90906100008i4c632312j32f223b8aca14934@mail.gmail.com>
	<86ljo0wgnv.fsf@ds4.des.no> <200906100923.42093.jhb@freebsd.org>
Date: Wed, 10 Jun 2009 14:07:56 -0700
X-Google-Sender-Auth: 20744c0e9fe480eb
Message-ID: <3c1674c90906101407o7a0470f6gdd9e323dd34ca19b@mail.gmail.com>
From: Kip Macy 
To: John Baldwin 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org,
	=?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= ,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Dmitry Morozovsky 
Subject: Re: svn commit: r193878 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:07:58 -0000

> Yes, you can simply do a TUNABLE_INT_FETCH() after the initial calculatio=
n to
> honor any user override. =A0Many existing settings already work this way =
where
> the user can override the auto-tuned value (e.g. all the buffer-cache tun=
ing
> settings).

Forgot about - thanks.

-Kip

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:16:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C50B9106564A;
	Wed, 10 Jun 2009 21:16:39 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B398A8FC18;
	Wed, 10 Jun 2009 21:16:39 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ALGdSI026319;
	Wed, 10 Jun 2009 21:16:39 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ALGdbK026318;
	Wed, 10 Jun 2009 21:16:39 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <200906102116.n5ALGdbK026318@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 10 Jun 2009 21:16:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193955 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:16:40 -0000

Author: rmacklem
Date: Wed Jun 10 21:16:39 2009
New Revision: 193955
URL: http://svn.freebsd.org/changeset/base/193955

Log:
  This commit is analagous to r193952, but for the experimental nfs
  subsystem. Add a test for VI_DOOMED just after ncl_upgrade_vnlock() in
  ncl_bioread_check_cons(). This is required since it is possible
  for the vnode to be vgonel()'d while in ncl_upgrade_vnlock() when
  a forced dismount is in progress. Also, move the check for VI_DOOMED
  in ncl_vinvalbuf() down to after ncl_upgrade_vnlock() and replace the
  out of date comment for it.
  
  Approved by:	kib (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clbio.c

Modified: head/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clbio.c	Wed Jun 10 21:06:07 2009	(r193954)
+++ head/sys/fs/nfsclient/nfs_clbio.c	Wed Jun 10 21:16:39 2009	(r193955)
@@ -485,6 +485,11 @@ nfs_bioread_check_cons(struct vnode *vp,
 	 * But for now, this suffices.
 	 */
 	old_lock = ncl_upgrade_vnlock(vp);
+	if (vp->v_iflag & VI_DOOMED) {
+		ncl_downgrade_vnlock(vp, old_lock);
+		return (EBADF);
+	}
+
 	mtx_lock(&np->n_mtx);
 	if (np->n_flag & NMODIFIED) {
 		mtx_unlock(&np->n_mtx);
@@ -1391,14 +1396,6 @@ ncl_vinvalbuf(struct vnode *vp, int flag
 
 	ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf");
 
-	/*
-	 * XXX This check stops us from needlessly doing a vinvalbuf when
-	 * being called through vclean().  It is not clear that this is
-	 * unsafe.
-	 */
-	if (vp->v_iflag & VI_DOOMED)
-		return (0);
-
 	if ((nmp->nm_flag & NFSMNT_INT) == 0)
 		intrflg = 0;
 	if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF))
@@ -1412,6 +1409,16 @@ ncl_vinvalbuf(struct vnode *vp, int flag
 	}
 
 	old_lock = ncl_upgrade_vnlock(vp);
+	if (vp->v_iflag & VI_DOOMED) {
+		/*
+		 * Since vgonel() uses the generic vinvalbuf() to flush
+		 * dirty buffers and it does not call this function, it
+		 * is safe to just return OK when VI_DOOMED is set.
+		 */
+		ncl_downgrade_vnlock(vp, old_lock);
+		return (0);
+	}
+
 	/*
 	 * Now, flush as required.
 	 */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:18:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2AB501065670;
	Wed, 10 Jun 2009 21:18:22 +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 1951E8FC08;
	Wed, 10 Jun 2009 21:18:22 +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 n5ALILmD026385;
	Wed, 10 Jun 2009 21:18:21 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ALILM8026384;
	Wed, 10 Jun 2009 21:18:21 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906102118.n5ALILM8026384@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 21:18:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193956 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:18:22 -0000

Author: bz
Date: Wed Jun 10 21:18:21 2009
New Revision: 193956
URL: http://svn.freebsd.org/changeset/base/193956

Log:
  if_gre.c insists on INET:
  	#error "Huh? if_gre without inet?"
  According to my reading we still only support encapsulating datagrams
  into IPv4 and not IPv6 so there is no optional | gre inet6 yet.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 21:16:39 2009	(r193955)
+++ head/sys/conf/files	Wed Jun 10 21:18:21 2009	(r193956)
@@ -2199,7 +2199,7 @@ net/if_faith.c			optional faith
 net/if_fddisubr.c		optional fddi
 net/if_fwsubr.c			optional fwip
 net/if_gif.c			optional gif
-net/if_gre.c			optional gre
+net/if_gre.c			optional gre inet
 net/if_iso88025subr.c		optional token
 net/if_lagg.c			optional lagg
 net/if_loop.c			optional loop

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:31:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 729E31065670;
	Wed, 10 Jun 2009 21:31: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 6189E8FC08;
	Wed, 10 Jun 2009 21:31:57 +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 n5ALVvha026711;
	Wed, 10 Jun 2009 21:31:57 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ALVvDd026710;
	Wed, 10 Jun 2009 21:31:57 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906102131.n5ALVvDd026710@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 21:31:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193957 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:31:58 -0000

Author: bz
Date: Wed Jun 10 21:31:57 2009
New Revision: 193957
URL: http://svn.freebsd.org/changeset/base/193957

Log:
  Unfortunately fs/nfsserver depends on INET at the moment. It seems to
  be nfs_nfsdport.c and nfs_nfsdcache.c are the problem only but we need
  to mark all or we will run into problems at link time.
  One is because of calling an INET specific function, the other is
  because of VIMAGE putting all tcp* into struct vnet_inet.
  
  Both are general problems throughout the entire stack and not a fault
  of the NFS implementation and will need to be addressed in the future.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 21:18:21 2009	(r193956)
+++ head/sys/conf/files	Wed Jun 10 21:31:57 2009	(r193957)
@@ -1746,13 +1746,13 @@ fs/nfsclient/nfs_cllock.c	optional nfscl
 fs/nfsclient/nfs_clport.c	optional nfscl
 fs/nfsclient/nfs_clbio.c	optional nfscl
 fs/nfsclient/nfs_clnfsiod.c	optional nfscl
-fs/nfsserver/nfs_nfsdsocket.c	optional nfsd
-fs/nfsserver/nfs_nfsdsubs.c	optional nfsd
-fs/nfsserver/nfs_nfsdstate.c	optional nfsd
-fs/nfsserver/nfs_nfsdkrpc.c	optional nfsd
-fs/nfsserver/nfs_nfsdserv.c	optional nfsd
-fs/nfsserver/nfs_nfsdport.c	optional nfsd
-fs/nfsserver/nfs_nfsdcache.c	optional nfsd
+fs/nfsserver/nfs_nfsdsocket.c	optional nfsd inet
+fs/nfsserver/nfs_nfsdsubs.c	optional nfsd inet
+fs/nfsserver/nfs_nfsdstate.c	optional nfsd inet
+fs/nfsserver/nfs_nfsdkrpc.c	optional nfsd inet
+fs/nfsserver/nfs_nfsdserv.c	optional nfsd inet
+fs/nfsserver/nfs_nfsdport.c	optional nfsd inet
+fs/nfsserver/nfs_nfsdcache.c	optional nfsd inet
 fs/ntfs/ntfs_compr.c		optional ntfs
 fs/ntfs/ntfs_iconv.c		optional ntfs_iconv
 fs/ntfs/ntfs_ihash.c		optional ntfs

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:45:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CF001065670;
	Wed, 10 Jun 2009 21:45:08 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3])
	by mx1.freebsd.org (Postfix) with ESMTP id AF19A8FC1E;
	Wed, 10 Jun 2009 21:45:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id D6C4341C730;
	Wed, 10 Jun 2009 23:45:06 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([195.88.108.3])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id ZEsW15nE9rxG; Wed, 10 Jun 2009 23:45:06 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id 086B641C6EA; Wed, 10 Jun 2009 23:45:06 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id 920954448E6;
	Wed, 10 Jun 2009 21:42:19 +0000 (UTC)
Date: Wed, 10 Jun 2009 21:42:19 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Konstantin Belousov 
In-Reply-To: <200906102059.n5AKxXx0025758@svn.freebsd.org>
Message-ID: <20090610214134.R22887@maildrop.int.zabbadoz.net>
References: <200906102059.n5AKxXx0025758@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r193951 - in head/sys: cam/scsi i386/acpica kern
 net security/audit sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:45:08 -0000

On Wed, 10 Jun 2009, Konstantin Belousov wrote:

> Author: kib
> Date: Wed Jun 10 20:59:32 2009
> New Revision: 193951
> URL: http://svn.freebsd.org/changeset/base/193951
>
> Log:
>  Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use
>  vnode interlock to protect the knote fields [1]. The locking assumes
>  that shared vnode lock is held, thus we get exclusive access to knote
>  either by exclusive vnode lock protection, or by shared vnode lock +
>  vnode interlock.
>
>  Do not use kl_locked() method to assert either lock ownership or the
>  fact that curthread does not own the lock. For shared locks, ownership
>  is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared
>  lock not owned by curthread, causing false positives in kqueue subsystem
>  assertions about knlist lock.
>
>  Remove kl_locked method from knlist lock vector, and add two separate
>  assertion methods kl_assert_locked and kl_assert_unlocked, that are
>  supposed to use proper asserts. Change knlist_init accordingly.
>
>  Add convenience function knlist_init_mtx to reduce number of arguments
>  for typical knlist initialization.
>
>  Submitted by:	jhb [1]
>  Noted by:	jhb [2]
>  Reviewed by:	jhb
>  Tested by:	rnoland
>
> Modified:
>  head/sys/cam/scsi/scsi_target.c
>  head/sys/i386/acpica/acpi_machdep.c
>  head/sys/kern/init_main.c
>  head/sys/kern/kern_event.c
>  head/sys/kern/kern_fork.c
>  head/sys/kern/sys_pipe.c
>  head/sys/kern/tty.c
>  head/sys/kern/tty_pts.c
>  head/sys/kern/uipc_mqueue.c
>  head/sys/kern/uipc_socket.c
>  head/sys/kern/vfs_aio.c
>  head/sys/kern/vfs_subr.c
>  head/sys/net/bpf.c
>  head/sys/net/if.c
>  head/sys/net/if_tap.c
>  head/sys/net/if_tun.c
>  head/sys/security/audit/audit_pipe.c
>  head/sys/sys/event.h


This change, changes the size of struct vnet; all (network) modules need
to be recompiled.


> Modified: head/sys/sys/event.h
> ==============================================================================
> --- head/sys/sys/event.h	Wed Jun 10 20:57:06 2009	(r193950)
> +++ head/sys/sys/event.h	Wed Jun 10 20:59:32 2009	(r193951)
> @@ -124,7 +124,8 @@ struct knlist {
> 	struct	klist	kl_list;
> 	void    (*kl_lock)(void *);	/* lock function */
> 	void    (*kl_unlock)(void *);
> -	int    (*kl_locked)(void *);
> +	void	(*kl_assert_locked)(void *);
> +	void	(*kl_assert_unlocked)(void *);
> 	void *kl_lockarg;		/* argument passed to kl_lockf() */
> };
>
> @@ -203,6 +204,7 @@ struct kevent_copyops {
> struct thread;
> struct proc;
> struct knlist;
> +struct mtx;
>
> extern void	knote(struct knlist *list, long hint, int islocked);
> extern void	knote_fork(struct knlist *list, int pid);
> @@ -212,7 +214,8 @@ extern void	knlist_remove_inevent(struct
> extern int	knlist_empty(struct knlist *knl);
> extern void	knlist_init(struct knlist *knl, void *lock,
>     void (*kl_lock)(void *), void (*kl_unlock)(void *),
> -    int (*kl_locked)(void *));
> +    void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *));
> +extern void	knlist_init_mtx(struct knlist *knl, struct mtx *lock);
> extern void	knlist_destroy(struct knlist *knl);
> extern void	knlist_cleardel(struct knlist *knl, struct thread *td,
> 	int islocked, int killkn);
>

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:45:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A7CCA1065755;
	Wed, 10 Jun 2009 21:45:18 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 969868FC13;
	Wed, 10 Jun 2009 21:45:18 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ALjIW7027008;
	Wed, 10 Jun 2009 21:45:18 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ALjIn7027006;
	Wed, 10 Jun 2009 21:45:18 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200906102145.n5ALjIn7027006@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 10 Jun 2009 21:45:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193958 - head/share/timedef
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:45:19 -0000

Author: edwin
Date: Wed Jun 10 21:45:18 2009
New Revision: 193958
URL: http://svn.freebsd.org/changeset/base/193958

Log:
  Invalid (long) date format in pl_PL.ISO8859-2.src
  
      Date format is %a %e %b %X %Y %Z (e.g "sob 19 sty 15:46:50 2008 CET")
      but should be "%a %e %b %Y %X %Z" (e.g. "sob 19 sty 2008 15:46:50 CET").
  
  PR:		conf/119804
  Submitted by:	Bodek 
  MFC after:	1 week

Modified:
  head/share/timedef/pl_PL.ISO8859-2.src
  head/share/timedef/pl_PL.UTF-8.src

Modified: head/share/timedef/pl_PL.ISO8859-2.src
==============================================================================
--- head/share/timedef/pl_PL.ISO8859-2.src	Wed Jun 10 21:31:57 2009	(r193957)
+++ head/share/timedef/pl_PL.ISO8859-2.src	Wed Jun 10 21:45:18 2009	(r193958)
@@ -72,7 +72,7 @@ sobota
 #
 # date_fmt
 #
-%a %e %b %X %Y %Z
+%a %e %b %Y %X %Z
 #
 # Long month names (without case ending)
 #

Modified: head/share/timedef/pl_PL.UTF-8.src
==============================================================================
--- head/share/timedef/pl_PL.UTF-8.src	Wed Jun 10 21:31:57 2009	(r193957)
+++ head/share/timedef/pl_PL.UTF-8.src	Wed Jun 10 21:45:18 2009	(r193958)
@@ -72,7 +72,7 @@ sobota
 #
 # date_fmt
 #
-%a %e %b %X %Y %Z
+%a %e %b %Y %X %Z
 #
 # Long month names (without case ending)
 #

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:48:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76EA7106564A;
	Wed, 10 Jun 2009 21:48:14 +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 6618C8FC16;
	Wed, 10 Jun 2009 21:48:14 +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 n5ALmEGw027089;
	Wed, 10 Jun 2009 21:48:14 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ALmEhk027088;
	Wed, 10 Jun 2009 21:48:14 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906102148.n5ALmEhk027088@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 21:48: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: r193959 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:48:14 -0000

Author: bz
Date: Wed Jun 10 21:48:13 2009
New Revision: 193959
URL: http://svn.freebsd.org/changeset/base/193959

Log:
  Update vnet_net size guard values after r193951.

Modified:
  head/sys/sys/vimage.h

Modified: head/sys/sys/vimage.h
==============================================================================
--- head/sys/sys/vimage.h	Wed Jun 10 21:45:18 2009	(r193958)
+++ head/sys/sys/vimage.h	Wed Jun 10 21:48:13 2009	(r193959)
@@ -359,43 +359,43 @@ extern struct vprocg_list_head vprocg_he
  * See description further down to see how to get the new values.
  */
 #ifdef __amd64__
-#define	SIZEOF_vnet_net		184
+#define	SIZEOF_vnet_net		192
 #define	SIZEOF_vnet_inet	4424
 #define	SIZEOF_vnet_inet6	8808
 #define	SIZEOF_vnet_ipsec	31160
 #endif
 #ifdef __arm__
-#define	SIZEOF_vnet_net		100
+#define	SIZEOF_vnet_net		104
 #define	SIZEOF_vnet_inet	2616
 #define	SIZEOF_vnet_inet6	8524
 #define	SIZEOF_vnet_ipsec	1
 #endif
 #ifdef __i386__ /* incl. pc98 */
-#define	SIZEOF_vnet_net		100
+#define	SIZEOF_vnet_net		104
 #define	SIZEOF_vnet_inet	2612
 #define	SIZEOF_vnet_inet6	8512
 #define	SIZEOF_vnet_ipsec	31024
 #endif
 #ifdef __ia64__
-#define	SIZEOF_vnet_net		184
+#define	SIZEOF_vnet_net		192
 #define	SIZEOF_vnet_inet	4424
 #define	SIZEOF_vnet_inet6	8808
 #define	SIZEOF_vnet_ipsec	31160
 #endif
 #ifdef __mips__
-#define	SIZEOF_vnet_net		100
+#define	SIZEOF_vnet_net		104
 #define	SIZEOF_vnet_inet	2648
 #define	SIZEOF_vnet_inet6	8544
 #define	SIZEOF_vnet_ipsec	1
 #endif
 #ifdef __powerpc__
-#define	SIZEOF_vnet_net		100
+#define	SIZEOF_vnet_net		104
 #define	SIZEOF_vnet_inet	2640
 #define	SIZEOF_vnet_inet6	8520
 #define	SIZEOF_vnet_ipsec	31048
 #endif
 #ifdef __sparc64__ /* incl. sun4v */
-#define	SIZEOF_vnet_net		184
+#define	SIZEOF_vnet_net		192
 #define	SIZEOF_vnet_inet	4424
 #define	SIZEOF_vnet_inet6	8808
 #define	SIZEOF_vnet_ipsec	31160

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:51:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B76BE106566C;
	Wed, 10 Jun 2009 21:51:05 +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 8C35A8FC2D;
	Wed, 10 Jun 2009 21:51:05 +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 n5ALp5MQ027184;
	Wed, 10 Jun 2009 21:51:05 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ALp5Np027183;
	Wed, 10 Jun 2009 21:51:05 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906102151.n5ALp5Np027183@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 10 Jun 2009 21:51:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r193960 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:51:06 -0000

Author: bz
Date: Wed Jun 10 21:51:05 2009
New Revision: 193960
URL: http://svn.freebsd.org/changeset/base/193960

Log:
  pflog, pfsync depend on pf and pf depends on inet.
  Actually it could/should be inet|inet6 but the code is not there
  and as long as our inet6 depends on inet this is fine.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 10 21:48:13 2009	(r193959)
+++ head/sys/conf/files	Wed Jun 10 21:51:05 2009	(r193960)
@@ -335,25 +335,25 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \
 	compile-with "${NORMAL_C} -I$S/contrib/ngatm"
-contrib/pf/net/if_pflog.c	optional pflog \
+contrib/pf/net/if_pflog.c	optional pflog pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/if_pfsync.c	optional pfsync \
+contrib/pf/net/if_pfsync.c	optional pfsync pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/pf.c		optional pf \
+contrib/pf/net/pf.c		optional pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/pf_if.c		optional pf \
+contrib/pf/net/pf_if.c		optional pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/pf_ioctl.c	optional pf \
+contrib/pf/net/pf_ioctl.c	optional pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/pf_norm.c	optional pf \
+contrib/pf/net/pf_norm.c	optional pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/pf_osfp.c	optional pf \
+contrib/pf/net/pf_osfp.c	optional pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/pf_ruleset.c	optional pf \
+contrib/pf/net/pf_ruleset.c	optional pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/pf_subr.c	optional pf \
+contrib/pf/net/pf_subr.c	optional pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
-contrib/pf/net/pf_table.c	optional pf \
+contrib/pf/net/pf_table.c	optional pf inet \
 	compile-with "${NORMAL_C} -I$S/contrib/pf"
 contrib/pf/netinet/in4_cksum.c	optional pf inet
 crypto/blowfish/bf_ecb.c	optional ipsec 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 10 21:55:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5F5F106566B;
	Wed, 10 Jun 2009 21:55:38 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AA84B8FC19;
	Wed, 10 Jun 2009 21:55:38 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ALtcHH027333;
	Wed, 10 Jun 2009 21:55:38 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ALtcYM027331;
	Wed, 10 Jun 2009 21:55:38 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200906102155.n5ALtcYM027331@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 10 Jun 2009 21:55: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: r193961 - head/share/colldef
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 10 Jun 2009 21:55:39 -0000

Author: edwin
Date: Wed Jun 10 21:55:38 2009
New Revision: 193961
URL: http://svn.freebsd.org/changeset/base/193961

Log:
  Croatian locale support for hr_HR.ISO8859-2
  
  	Without this patch /usr/share/locale/hr_HR.ISO8859-2/LC_COLLATE
  	is a link to the ../la_LN.ISO8859-2/LC_COLLATE. It means
  	that there is no support for Croatian locale.
  
  PR:		conf/120113
  Submitted by:	Simun Mikecin 
  MFC after:	1 week

Added:
  head/share/colldef/hr_HR.ISO8859-2.src   (contents, props changed)
Modified:
  head/share/colldef/Makefile

Modified: head/share/colldef/Makefile
==============================================================================
--- head/share/colldef/Makefile	Wed Jun 10 21:51:05 2009	(r193960)
+++ head/share/colldef/Makefile	Wed Jun 10 21:55:38 2009	(r193961)
@@ -14,6 +14,7 @@ LOCALES=	bg_BG.CP1251 \
 		es_ES.ISO8859-15 \
 		et_EE.ISO8859-15 \
 		hi_IN.ISCII-DEV \
+		hr_HR.ISO8859-2 \
 		hy_AM.ARMSCII-8 \
 		is_IS.ISO8859-1 \
 		is_IS.ISO8859-15 \
@@ -74,7 +75,7 @@ ISO8859-15_ISO8859-15= \
 	no_NO:nb_NO no_NO:nn_NO \
 	${LATIN1LINKS:C/^/la_LN:/}
 
-LATIN2LINKS=    hr_HR hu_HU ro_RO sr_YU
+LATIN2LINKS=    hu_HU ro_RO sr_YU
 ISO8859-2_ISO8859-2= ${LATIN2LINKS:C/^/la_LN:/} cs_CZ:sk_SK
 
 US-ASCII_Big5HKSCS= la_LN:zh_HK

Added: head/share/colldef/hr_HR.ISO8859-2.src
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/colldef/hr_HR.ISO8859-2.src	Wed Jun 10 21:55:38 2009	(r193961)
@@ -0,0 +1,39 @@
+#
+# Croatian collation sequence
+# 2007-01-29 numisemis at yahoo dot com
+#
+# $FreeBSD$
+#
+
+charmap map.ISO8859-2
+order \
+# controls
+        ;...;;;...;;\
+#
+        ;;!;\";;\
+        ;;\
+        %;&;<',>;<';>;';\(;\);*;+;<-:>;<*X>;\,;<-->;-;.;<'.>;/;\
+# digits
+        0;...;9;\
+#
+        :;\;;\<;=;>;?;;;\
+# capital
+        (A,,>,,,);\
+        B;(C,);;;(D,);;(E,,,,);\
+        F;G;H;(I,,>);\
+        J;K;(L,,,);M;(N,,);(O,,>,,);\
+        P;Q;(R,,);(S,,);;(T,,);\
+        (U,,,,);\
+        V;W;X;(Y,);(Z,,);;\
+#
+        [;\\;];^;<':>;<'">;<'<>;<'(>;_;<''>;`;\
+# small
+        (a,,>,,,);\
+        b;(c,);;;(d,);;(e,,,,);\
+        f;g;h;(i,,>);\
+        j;k;(l,,,);m;(n,,);(o,,>,,);\
+        p;q;(r,,);(s,,,);;(t,,);\
+        (u,,,,);\
+        v;w;x;(y,);(z,,);;\
+#
+        \{;|;\};~;;
From owner-svn-src-head@FreeBSD.ORG Wed Jun 10 22:09:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDB6F1065675; Wed, 10 Jun 2009 22:09:40 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0A828FC1C; Wed, 10 Jun 2009 22:09:40 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AM9etx027626; Wed, 10 Jun 2009 22:09:40 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AM9ea2027623; Wed, 10 Jun 2009 22:09:40 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906102209.n5AM9ea2027623@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 10 Jun 2009 22:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193962 - head/share/monetdef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2009 22:09:41 -0000 Author: edwin Date: Wed Jun 10 22:09:40 2009 New Revision: 193962 URL: http://svn.freebsd.org/changeset/base/193962 Log: Add euro symbol to pt_PT locale using other encodings PR: conf/98815 Submitted by: Rui Lopes MFC after: 1 week Added: head/share/monetdef/pt_PT.ISO8859-15.src (contents, props changed) head/share/monetdef/pt_PT.UTF-8.src (contents, props changed) Modified: head/share/monetdef/Makefile Modified: head/share/monetdef/Makefile ============================================================================== --- head/share/monetdef/Makefile Wed Jun 10 21:55:38 2009 (r193961) +++ head/share/monetdef/Makefile Wed Jun 10 22:09:40 2009 (r193962) @@ -52,6 +52,8 @@ LOCALES= af_ZA.ISO8859-1 \ pl_PL.UTF-8 \ pt_BR.ISO8859-1 \ pt_PT.ISO8859-1 \ + pt_PT.ISO8859-15 \ + pt_PT.UTF-8 \ ro_RO.ISO8859-2 \ ru_RU.CP1251 \ ru_RU.CP866 \ @@ -105,12 +107,12 @@ ISO8859-1_ISO8859-1= ca_ES:ca_AD ca_ES:c ISO8859-1_ISO8859-15= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \ en_AU en_CA en_GB en_NZ en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR \ - is_IS it_IT it_CH nl_BE nl_NL nb_NO nn_NO no_NO pt_PT sv_SE + is_IS it_IT it_CH nl_BE nl_NL nb_NO nn_NO no_NO sv_SE ISO8859-1_US-ASCII= en_AU en_CA en_GB en_NZ en_US ISO8859-1_UTF-8= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \ en_AU en_CA en_NZ en_US es_ES \ fi_FI fr_BE fr_CA fr_FR is_IS it_IT nl_BE \ - nl_NL nb_NO nn_NO no_NO pt_BR pt_PT sv_SE + nl_NL nb_NO nn_NO no_NO pt_BR sv_SE ISO8859-2_UTF-8= hr_HR hu_HU ro_RO sk_SK sl_SI sr_YU ISO8859-7_UTF-8= el_GR ISO8859-9_UTF-8= tr_TR Added: head/share/monetdef/pt_PT.ISO8859-15.src ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/monetdef/pt_PT.ISO8859-15.src Wed Jun 10 22:09:40 2009 (r193962) @@ -0,0 +1,36 @@ +# $FreeBSD$ +# +# WARNING: spaces may be essential at the end of lines +# WARNING: empty lines are essential too +# +# int_curr_symbol (last character always SPACE) +EUR +# currency_symbol +¤ +# mon_decimal_point +, +# mon_thousands_sep +. +# mon_grouping, separated by ; +3;3 +# positive_sign + +# negative_sign +- +# int_frac_digits +2 +# frac_digits +2 +# p_cs_precedes +0 +# p_sep_by_space +1 +# n_cs_precedes +0 +# n_sep_by_space +1 +# p_sign_posn +1 +# n_sign_posn +1 +# EOF Added: head/share/monetdef/pt_PT.UTF-8.src ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/monetdef/pt_PT.UTF-8.src Wed Jun 10 22:09:40 2009 (r193962) @@ -0,0 +1,36 @@ +# $FreeBSD$ +# +# WARNING: spaces may be essential at the end of lines +# WARNING: empty lines are essential too +# +# int_curr_symbol (last character always SPACE) +EUR +# currency_symbol +€ +# mon_decimal_point +, +# mon_thousands_sep +. +# mon_grouping, separated by ; +3;3 +# positive_sign + +# negative_sign +- +# int_frac_digits +2 +# frac_digits +2 +# p_cs_precedes +0 +# p_sep_by_space +1 +# n_cs_precedes +0 +# n_sep_by_space +1 +# p_sign_posn +1 +# n_sign_posn +1 +# EOF From owner-svn-src-head@FreeBSD.ORG Wed Jun 10 22:54:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88FBA1065672; Wed, 10 Jun 2009 22:54:20 +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 6C3898FC1A; Wed, 10 Jun 2009 22:54:20 +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 n5AMsKQt028500; Wed, 10 Jun 2009 22:54:20 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AMsK1b028497; Wed, 10 Jun 2009 22:54:20 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906102254.n5AMsK1b028497@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 10 Jun 2009 22:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193963 - in head/sys: conf dev/acpica dev/acpica/Osd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2009 22:54:21 -0000 Author: jkim Date: Wed Jun 10 22:54:20 2009 New Revision: 193963 URL: http://svn.freebsd.org/changeset/base/193963 Log: Catch up with r193750 (OsdSynch.c locking changes): - Preallocate some memory for ACPI tasks early enough. We cannot use malloc(9) any more because spin mutex may be held here. The reserved memory can be tuned via debug.acpi.max_tasks tunable or ACPI_MAX_TASKS in kernel configuration. The default is 32 tasks. - Implement a custom taskqueue_fast to wrap the new memory allocation. This implementation is not the fastest in the world but we are being conservative here. Modified: head/sys/conf/options head/sys/dev/acpica/Osd/OsdSchedule.c head/sys/dev/acpica/acpivar.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jun 10 22:09:40 2009 (r193962) +++ head/sys/conf/options Wed Jun 10 22:54:20 2009 (r193963) @@ -663,6 +663,7 @@ WITNESS_SKIPSPIN opt_witness.h # options for ACPI support ACPI_DEBUG opt_acpi.h +ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h # ISA support Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Wed Jun 10 22:09:40 2009 (r193962) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Wed Jun 10 22:54:20 2009 (r193963) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2000 Michael Smith * Copyright (c) 2000 BSDi + * Copyright (c) 2007-2009 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$"); ACPI_MODULE_NAME("SCHEDULE") /* + * Allow the user to tune the maximum number of tasks we may enqueue. + */ +static int acpi_max_tasks = ACPI_MAX_TASKS; +TUNABLE_INT("debug.acpi.max_tasks", &acpi_max_tasks); + +/* * Allow the user to tune the number of task threads we start. It seems * some systems have problems with increased parallelism. */ @@ -64,11 +71,54 @@ struct acpi_task_ctx { struct task at_task; ACPI_OSD_EXEC_CALLBACK at_function; void *at_context; + int at_flag; +#define ACPI_TASK_USED 1 +#define ACPI_TASK_ENQUEUED 2 }; -TASKQUEUE_DEFINE(acpi, taskqueue_thread_enqueue, &taskqueue_acpi, - taskqueue_start_threads(&taskqueue_acpi, acpi_max_threads, PWAIT, - "acpi_task")); +struct taskqueue *acpi_taskq; +static struct acpi_task_ctx *acpi_tasks; +static int acpi_task_count; +static int acpi_taskq_started; + +/* + * Preallocate some memory for tasks early enough. + * malloc(9) cannot be used with spin lock held. + */ +static void +acpi_task_init(void *arg) +{ + + acpi_tasks = malloc(sizeof(*acpi_tasks) * acpi_max_tasks, M_ACPITASK, + M_WAITOK | M_ZERO); +} + +SYSINIT(acpi_tasks, SI_SUB_DRIVERS, SI_ORDER_FIRST, acpi_task_init, NULL); + +/* + * Initialize ACPI task queue. + */ +static void +acpi_taskq_init(void *arg) +{ + int i; + + acpi_taskq = taskqueue_create_fast("acpi_task", M_NOWAIT, + &taskqueue_thread_enqueue, &acpi_taskq); + taskqueue_start_threads(&acpi_taskq, acpi_max_threads, PWAIT, "acpi_task"); + if (acpi_task_count > 0) { + if (bootverbose) + printf("AcpiOsExecute: enqueue %d pending tasks\n", + acpi_task_count); + for (i = 0; i < acpi_max_tasks; i++) + if (atomic_cmpset_acq_int(&acpi_tasks[i].at_flag, ACPI_TASK_USED, + ACPI_TASK_USED | ACPI_TASK_ENQUEUED)) + taskqueue_enqueue(acpi_taskq, &acpi_tasks[i].at_task); + } + acpi_taskq_started = 1; +} + +SYSINIT(acpi_taskq, SI_SUB_CONFIGURE, SI_ORDER_SECOND, acpi_taskq_init, NULL); /* * Bounce through this wrapper function since ACPI-CA doesn't understand @@ -81,7 +131,44 @@ acpi_task_execute(void *context, int pen at = (struct acpi_task_ctx *)context; at->at_function(at->at_context); - free(at, M_ACPITASK); + atomic_clear_int(&at->at_flag, ACPI_TASK_USED | ACPI_TASK_ENQUEUED); + acpi_task_count--; +} + +static ACPI_STATUS +acpi_task_enqueue(int priority, ACPI_OSD_EXEC_CALLBACK Function, void *Context) +{ + struct acpi_task_ctx *at; + int i; + + for (at = NULL, i = 0; i < acpi_max_tasks; i++) + if (atomic_cmpset_acq_int(&acpi_tasks[i].at_flag, 0, ACPI_TASK_USED)) { + at = &acpi_tasks[i]; + acpi_task_count++; + break; + } + if (at == NULL) { + printf("AcpiOsExecute: failed to enqueue task, consider increasing " + "the debug.acpi.max_tasks tunable\n"); + return (AE_NO_MEMORY); + } + + TASK_INIT(&at->at_task, priority, acpi_task_execute, at); + at->at_function = Function; + at->at_context = Context; + + /* + * If the task queue is ready, enqueue it now. + */ + if (acpi_taskq_started) { + atomic_set_int(&at->at_flag, ACPI_TASK_ENQUEUED); + taskqueue_enqueue(acpi_taskq, &at->at_task); + return (AE_OK); + } + if (bootverbose) + printf("AcpiOsExecute: task queue not started\n"); + + return (AE_OK); } /* @@ -92,7 +179,6 @@ ACPI_STATUS AcpiOsExecute(ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, void *Context) { - struct acpi_task_ctx *at; int pri; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -100,12 +186,6 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE Type, AC if (Function == NULL) return_ACPI_STATUS (AE_BAD_PARAMETER); - at = malloc(sizeof(*at), M_ACPITASK, M_NOWAIT); - if (at == NULL) - return_ACPI_STATUS (AE_NO_MEMORY); - - at->at_function = Function; - at->at_context = Context; switch (Type) { case OSL_GPE_HANDLER: case OSL_NOTIFY_HANDLER: @@ -126,14 +206,10 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE Type, AC pri = 0; break; default: - free(at, M_ACPITASK); return_ACPI_STATUS (AE_BAD_PARAMETER); } - TASK_INIT(&at->at_task, pri, acpi_task_execute, at); - taskqueue_enqueue(taskqueue_acpi, &at->at_task); - - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (acpi_task_enqueue(pri, Function, Context)); } void Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Jun 10 22:09:40 2009 (r193962) +++ head/sys/dev/acpica/acpivar.h Wed Jun 10 22:54:20 2009 (r193963) @@ -457,6 +457,11 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL */ #define ACPI_DEV_BASE_ORDER 10 +/* Default maximum number of tasks to enqueue. */ +#ifndef ACPI_MAX_TASKS +#define ACPI_MAX_TASKS 32 +#endif + /* Default number of task queue threads to start. */ #ifndef ACPI_MAX_THREADS #define ACPI_MAX_THREADS 3 From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 00:19:48 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2968106566B; Thu, 11 Jun 2009 00:19:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2898FC0A; Thu, 11 Jun 2009 00:19:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5B0Jhib021442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Jun 2009 10:19:45 +1000 Date: Thu, 11 Jun 2009 10:19:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: "Bjoern A. Zeeb" In-Reply-To: <20090610101009.N22887@maildrop.int.zabbadoz.net> Message-ID: <20090611101544.H20959@delplex.bde.org> References: <200906090903.n5993D3E062579@svn.freebsd.org> <20090609090541.D22887@maildrop.int.zabbadoz.net> <20090610175011.E20224@delplex.bde.org> <20090610101009.N22887@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 - head/sys/modules/sound/sound] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 00:19:48 -0000 On Wed, 10 Jun 2009, Bjoern A. Zeeb wrote: > On Wed, 10 Jun 2009, Bruce Evans wrote: > >> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote: >> >>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote: >>>> Log: >>>> Depend on @ machine (_ILINKS) as we do with other modules so that @ >>>> is there for parallel (-jN) builds. Ideally beforedepends in kmod.mk >>>> should do the right thing but it seems it does not. >>> >>> Anyone with lots of build framework know how may want to look at this. >> >> Failures only for parallel builds normally mean missing dependencies. >> >>>> -feeder_eq_gen.h: >>>> +feeder_eq_gen.h: @ machine >>>> ${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > >>>> ${.TARGET} >> >> Here there is still a missing dependency on the >> @/tools/feeder_eq_mkfilter.awk (fixed in the next commit). This dependency >> is not very important, but since the utility has "@" in its pathname, >> running it certainly depends on "@". > > And adding it again messes with @ not being there for parallel > builds:( > >> This missing dependency seems to be a general bug. There is an ordering >> requirement that beforedepend is before built before ${DEPENDFILE}, >> but this apparently doesn't extend to ${DEPENDFILE}'s prerequisites, >> and I don't know of any general way to make it do so and it probably >> shouldn't do so in general (some of the prerequisites might be needed >> before beforedepend). > > Well no; that should not be the case. I would say that would be a bug > as beforedepnd only adds the @ and machine symlinks to my memory from > reading the other day. > > All after all that's why I said this needs someone with the devotion > to sort all this out, know what the right way to do things is, have > the time, .. See my private reply to the next commit message. It says to copy the handling of this problem for vnode_if.awk in kmod.mk, where it took 3 commits between 1999 and 2001 to get the subtleties right! Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 00:29:10 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77618106564A; Thu, 11 Jun 2009 00:29:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF308FC1F; Thu, 11 Jun 2009 00:29:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5B0T6Bm029557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Jun 2009 10:29:07 +1000 Date: Thu, 11 Jun 2009 10:29:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: "Bjoern A. Zeeb" In-Reply-To: <20090610112430.X22887@maildrop.int.zabbadoz.net> Message-ID: <20090611102156.E20959@delplex.bde.org> References: <200906090903.n5993D3E062579@svn.freebsd.org> <20090609090541.D22887@maildrop.int.zabbadoz.net> <20090610175011.E20224@delplex.bde.org> <20090610101009.N22887@maildrop.int.zabbadoz.net> <20090610102419.Q22887@maildrop.int.zabbadoz.net> <20090610184521.56b24c2f.ariff@FreeBSD.org> <20090610112430.X22887@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, brde@optusnet.com.au, Ariff Abdullah Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 - head/sys/modules/sound/sound] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 00:29:11 -0000 On Wed, 10 Jun 2009, Bjoern A. Zeeb wrote: > On Wed, 10 Jun 2009, Ariff Abdullah wrote: > >> On Wed, 10 Jun 2009 10:24:46 +0000 (UTC) >> "Bjoern A. Zeeb" wrote: >>> On Wed, 10 Jun 2009, Bjoern A. Zeeb wrote: >>> >>>> On Wed, 10 Jun 2009, Bruce Evans wrote: >>>> >>>>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote: >>>>> >>>>>> On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote: Too hard to untangle these quotes so I left them all. >>>>>>> Log: >>>>>>> Depend on @ machine (_ILINKS) as we do with other modules so >>>> that @ >>> is there for parallel (-jN) builds. Ideally >>>> beforedepends in kmod.mk >>> should do the right thing but it >>>> seems it does not. >> >>>>>> Anyone with lots of build framework know how may want to look at >>>> this. > >>>>> Failures only for parallel builds normally mean missing >>>> dependencies. > >>>>>>> -feeder_eq_gen.h: >>>>>>> +feeder_eq_gen.h: @ machine >>>>>>> ${AWK} -f @/tools/feeder_eq_mkfilter.awk -- >>>> ${FEEDER_EQ_PRESETS} > >>> ${.TARGET} >>>>> >>>>> Here there is still a missing dependency on the >>>>> @/tools/feeder_eq_mkfilter.awk (fixed in the next commit). This >>>> dependency > is not very important, but since the utility has "@" >>>> in its pathname, > running it certainly depends on "@". >>>> >>>> And adding it again messes with @ not being there for parallel >>>> builds:( >>>> >>>> Or in other words: >>>> >>>> ===> sound (depend) >>>> ===> sound/sound (depend) >>>> make: don't know how to make @/tools/sound/feeder_eq_mkfilter.awk. >>>> Stop *** Error code 2 >>>> 1 error >>>> *** Error code 2 >>>> 1 error >>>> *** Error code 2 >>> >>> I forgot to mention that the way we currently seem to handle this >>> is: >>> >>> http://people.freebsd.org/~bz/20090610-02-sound-Makefile.diff >>> >> >> More or less like: >> >> http://people.freebsd.org/~ariff/sound_Makefile.diff > > just seen it on current@. > >> Please test it. I only looked at the committed version. > Mine worked for me and that's consistent with what we do in > sys/modules/svr4/Makefile and sys/modules/linux/Makefile . These (and your patch) are more similar to what kmod.mk does for vnode_if.awk -- probably equivalent as my first attempt for vnode_if.awk in kmod.mk 1.67 -- but they are missing the subtleties in kmod.mk 1.95 and 1.176. Perhaps all versions for the sound files can be made more consise using for loops. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 03:53:26 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1593A106566C; Thu, 11 Jun 2009 03:53:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB4F8FC0A; Thu, 11 Jun 2009 03:53:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5B3rFBX012716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Jun 2009 13:53:18 +1000 Date: Thu, 11 Jun 2009 13:53:16 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200906101827.n5AIRFoR022115@svn.freebsd.org> Message-ID: <20090611124334.A21109@delplex.bde.org> References: <200906101827.n5AIRFoR022115@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 03:53:26 -0000 On Wed, 10 Jun 2009, John Baldwin wrote: > Log: > Change a few members of tcpcb that store cached copies of ticks to be ints > instead of unsigned longs. This fixes a few overflow edge cases on 64-bit > platforms. Specifically, if an idle connection receives a packet shortly I think the variables should still be unsigned (ints now). Otherwise there is at best benign undefined behaviour when the variables overflow at INT_MAX, while the code is apparently designed to work with unsigned values (it casts to int to look at differences between the unsigned values). > before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep > alive timer fires after 2^31 clock ticks, the keep alive timer will think > that the connection has been idle for a very long time and will immediately > drop the connection instead of sending a keep alive probe. > > Reviewed by: silby, gnn, lstewart > MFC after: 1 week > > Modified: > head/sys/netinet/tcp_input.c > head/sys/netinet/tcp_usrreq.c > head/sys/netinet/tcp_var.h > > Modified: head/sys/netinet/tcp_input.c > ============================================================================== > --- head/sys/netinet/tcp_input.c Wed Jun 10 18:26:02 2009 (r193940) > +++ head/sys/netinet/tcp_input.c Wed Jun 10 18:27:15 2009 (r193941) > @@ -1778,7 +1778,7 @@ tcp_do_segment(struct mbuf *m, struct tc > TSTMP_LT(to.to_tsval, tp->ts_recent)) { > > /* Check to see if ts_recent is over 24 days old. */ > - if ((int)(ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) { > + if ((ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) { The variables are now ints, and there is now also overflow in the subtraction. E.g., INT_MAX - INT_MIN now overflows. On 2's complement machines it normally overflows to -2, which is probably the wrong value (the large unsigned value 0xFFF...FEU is probably correct), but it is the same value as is given by casting the difference of unsigned values to int ((int)0xFFF...FEU = -2). This is because, when representing times mod UINT_MAX+1, all time differences up to UINT_MAX can be represented, but only if we keep track of which operand is older (here we probably do know that ts_recent_age is older); if we don't keep track then we normally assume that (unsigned) differences smaller than INT_MAX mean that the difference is nonnegative while differences larger than INT_MAX mean that the difference is negative. The signed interpreatation works well if we know that the nonnegative differences never exceed INT_MAX. Style bug: without the cast, the above has excessive parentheses. > /* > * Invalidate ts_recent. If this segment updates > * ts_recent, the age will be reset later and ts_recent > > Modified: head/sys/netinet/tcp_usrreq.c > ============================================================================== > --- head/sys/netinet/tcp_usrreq.c Wed Jun 10 18:26:02 2009 (r193940) > +++ head/sys/netinet/tcp_usrreq.c Wed Jun 10 18:27:15 2009 (r193941) > @@ -1823,7 +1823,7 @@ db_print_tcpcb(struct tcpcb *tp, const c > tp->snd_recover); > > db_print_indent(indent); > - db_printf("t_maxopd: %u t_rcvtime: %lu t_startime: %lu\n", > + db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", > tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); > > db_print_indent(indent); You still print all the times as unsigned. Since the variables are now signed, this is now a printf format error, which gcc still doesn't detect but I usually do. > Modified: head/sys/netinet/tcp_var.h > ============================================================================== > --- head/sys/netinet/tcp_var.h Wed Jun 10 18:26:02 2009 (r193940) > +++ head/sys/netinet/tcp_var.h Wed Jun 10 18:27:15 2009 (r193941) > @@ -139,8 +139,8 @@ struct tcpcb { > > u_int t_maxopd; /* mss plus options */ > > - u_long t_rcvtime; /* inactivity time */ > - u_long t_starttime; /* time connection was established */ > + int t_rcvtime; /* inactivity time */ > + int t_starttime; /* time connection was established */ > int t_rtttime; /* round trip time */ > tcp_seq t_rtseq; /* sequence number being timed */ > > @@ -167,7 +167,7 @@ struct tcpcb { > u_char rcv_scale; /* window scaling for recv window */ > u_char request_r_scale; /* pending window scaling */ > u_int32_t ts_recent; /* timestamp echo data */ > - u_long ts_recent_age; /* when last updated */ > + int ts_recent_age; /* when last updated */ > u_int32_t ts_offset; /* our timestamp offset */ > > tcp_seq last_ack_sent; > @@ -175,7 +175,7 @@ struct tcpcb { > u_long snd_cwnd_prev; /* cwnd prior to retransmit */ > u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ > tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ > - u_long t_badrxtwin; /* window for retransmit recovery */ > + int t_badrxtwin; /* window for retransmit recovery */ > u_char snd_limited; /* segments limited transmitted */ > /* SACK related state */ > int snd_numholes; /* number of holes seen by sender */ > Should all be changed to u_int? There still seem to be some very nice sign extension/overflow bugs. E.g., `ticks' is (bogusly) signed. After changing the above variables to int to be bug for bug compatible with `ticks', the semantics of expressions not directly touched in this commit is changed too. E.g., there is the expression `ticks < tp->t_badrxtwin'. Changing the signedness of the type of tp_t_badrxtwin stops promotion of `ticks' to unsigned in this expression. However, this expression seems to have been just broken before, and the change only moves the bug slightly (from times near where `ticks' wraps around at to to times near where `ticks' overflows at INT_MAX). To handle wraparound and avoid overflow, such expressions should be written as (int)(ticks - tp->t_badrxtwin) < 0 where the variables have unsigned type. This seems to have already been done for all the other variables changed in this commit, except the cast to int is missing in some cases. Wrapararound used to occur after 497 days when HZ was 100 and variables were unsigned 32 bits. Now overflow occurs after 24 days when HZ is 1000 and variables are signed 32 bits. Larger misconfigurations of HZ for polling can make the bugs occur after only a week of uptime. It might be a practical exercise to change the type of the time variables to uint16_t so that the wraparound bugs are seen after only a few seconds of uptime and type size mismatches with ints through u_longs affect all machines. The type size mismatches shouldn't matter if times are always clamped compatibly. E.g., expressions like `tp->t_badrxtwin = ticks + adj' depend on t_badrxtwin wrapping around in the same way as `ticks'. This could be written as something like `tp->t_badrxtwin = (ticks + adj) & 0xFFFF' to get compatible wrapping with 16-bit values. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 04:04:37 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F0C106564A; Thu, 11 Jun 2009 04:04:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 2A0C58FC08; Thu, 11 Jun 2009 04:04:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5B44WNa024845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Jun 2009 14:04:34 +1000 Date: Thu, 11 Jun 2009 14:04:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200906101442.20988.jhb@freebsd.org> Message-ID: <20090611135433.K21177@delplex.bde.org> References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <200906101442.20988.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 04:04:38 -0000 On Wed, 10 Jun 2009, John Baldwin wrote: > On Wednesday 10 June 2009 2:27:15 pm John Baldwin wrote: >> Author: jhb >> Date: Wed Jun 10 18:27:15 2009 >> New Revision: 193941 >> URL: http://svn.freebsd.org/changeset/base/193941 >> >> Log: >> Change a few members of tcpcb that store cached copies of ticks to be ints >> instead of unsigned longs. This fixes a few overflow edge cases on 64-bit >> platforms. Specifically, if an idle connection receives a packet shortly >> before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep >> alive timer fires after 2^31 clock ticks, the keep alive timer will think >> that the connection has been idle for a very long time and will immediately >> drop the connection instead of sending a keep alive probe. >> >> Reviewed by: silby, gnn, lstewart >> MFC after: 1 week > > Note that the MFC patch for 7 is very different. I can't change the members > to int in 7 since tcpcb is part of the ABI (for netstat, etc.). So, for 7 I > added explicit casts in the math operations using t_rcvtime and ticks. That has a better chance of working too. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 04:43:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82FBF1065670; Thu, 11 Jun 2009 04:43:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 711A48FC23; Thu, 11 Jun 2009 04:43:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5B4hhqR035519; Thu, 11 Jun 2009 04:43:43 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5B4hhvD035516; Thu, 11 Jun 2009 04:43:43 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906110443.n5B4hhvD035516@svn.freebsd.org> From: Sam Leffler Date: Thu, 11 Jun 2009 04:43: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: r193966 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 04:43:43 -0000 Author: sam Date: Thu Jun 11 04:43:42 2009 New Revision: 193966 URL: http://svn.freebsd.org/changeset/base/193966 Log: When associating to an AP we don't know if HT is negotiated until we receive the AssocResp, so we can only set ni_txparms properly at that point. To make this possible make node_setuptxparms public as ieee80211_node_setuptxparms. Modified: head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_node.h head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Thu Jun 11 00:42:53 2009 (r193965) +++ head/sys/net80211/ieee80211_node.c Thu Jun 11 04:43:42 2009 (r193966) @@ -225,8 +225,8 @@ ieee80211_node_unauthorize(struct ieee80 /* * Fix tx parameters for a node according to ``association state''. */ -static void -node_setuptxparms(struct ieee80211_node *ni) +void +ieee80211_node_setuptxparms(struct ieee80211_node *ni) { struct ieee80211vap *vap = ni->ni_vap; enum ieee80211_phymode mode; @@ -794,7 +794,7 @@ ieee80211_sta_join(struct ieee80211vap * IEEE80211_F_DOSORT); if (ieee80211_iserp_rateset(&ni->ni_rates)) ni->ni_flags |= IEEE80211_NODE_ERP; - node_setuptxparms(ni); + ieee80211_node_setuptxparms(ni); return ieee80211_sta_join1(ieee80211_ref_node(ni)); } @@ -1364,7 +1364,7 @@ ieee80211_fakeup_adhoc_node(struct ieee8 ni->ni_flags |= IEEE80211_NODE_FF; #endif } - node_setuptxparms(ni); + ieee80211_node_setuptxparms(ni); if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 1); /* XXX not right for 802.1x/WPA */ @@ -1430,7 +1430,7 @@ ieee80211_add_neighbor(struct ieee80211v ieee80211_init_neighbor(ni, wh, sp); if (ieee80211_iserp_rateset(&ni->ni_rates)) ni->ni_flags |= IEEE80211_NODE_ERP; - node_setuptxparms(ni); + ieee80211_node_setuptxparms(ni); if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 1); /* XXX not right for 802.1x/WPA */ @@ -2297,7 +2297,7 @@ ieee80211_node_join(struct ieee80211_nod ", turbo" : "" ); - node_setuptxparms(ni); + ieee80211_node_setuptxparms(ni); /* give driver a chance to setup state like ni_txrate */ if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, newassoc); Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Thu Jun 11 00:42:53 2009 (r193965) +++ head/sys/net80211/ieee80211_node.h Thu Jun 11 04:43:42 2009 (r193966) @@ -286,6 +286,7 @@ ieee80211_node_is_authorized(const struc void ieee80211_node_authorize(struct ieee80211_node *); void ieee80211_node_unauthorize(struct ieee80211_node *); +void ieee80211_node_setuptxparms(struct ieee80211_node *); void ieee80211_node_set_chan(struct ieee80211_node *, struct ieee80211_channel *); void ieee80211_create_ibss(struct ieee80211vap*, struct ieee80211_channel *); Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Jun 11 00:42:53 2009 (r193965) +++ head/sys/net80211/ieee80211_sta.c Thu Jun 11 04:43:42 2009 (r193966) @@ -1594,6 +1594,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, ieee80211_setup_htrates(ni, htcap, IEEE80211_F_JOIN | IEEE80211_F_DOBRS); ieee80211_setup_basic_htrates(ni, htinfo); + ieee80211_node_setuptxparms(ni); } else { #ifdef IEEE80211_SUPPORT_SUPERG if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_ATH)) From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 06:51:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 1C7661065673; Thu, 11 Jun 2009 06:51:53 +0000 (UTC) Date: Thu, 11 Jun 2009 06:51:53 +0000 From: Alexey Dokuchaev To: Kip Macy Message-ID: <20090611065152.GA52569@FreeBSD.org> References: <200906102105.n5AL5bPH026001@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200906102105.n5AL5bPH026001@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193953 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 06:51:53 -0000 Kip Macy wrote: > printf("ZFS NOTICE: prefetch is disabled by default on i386" > " - add enable to tunable to change.\n" ); Looks like above text should be tweaked. Also, `--' is more common ASCII representation of n/mdash, but it is generally better to avoid it at all: comma is more readable and takes less space. ./danfe From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 07:50:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D03101065672; Thu, 11 Jun 2009 07:50:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE4738FC1A; Thu, 11 Jun 2009 07:50:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5B7oaXp039575; Thu, 11 Jun 2009 07:50:36 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5B7oaah039573; Thu, 11 Jun 2009 07:50:36 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906110750.n5B7oaah039573@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 11 Jun 2009 07:50: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: r193976 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 07:50:37 -0000 Author: des Date: Thu Jun 11 07:50:36 2009 New Revision: 193976 URL: http://svn.freebsd.org/changeset/base/193976 Log: As of sam's r175206, arp builds cleanly at WARNS level 6, but the Makefile was never updated. Also, clean up the macro that caused the warning in the first place (no functional changes, just wrapped and reindented). Modified: head/usr.sbin/arp/Makefile head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/Makefile ============================================================================== --- head/usr.sbin/arp/Makefile Thu Jun 11 07:40:36 2009 (r193975) +++ head/usr.sbin/arp/Makefile Thu Jun 11 07:50:36 2009 (r193976) @@ -4,6 +4,6 @@ PROG= arp MAN= arp.4 arp.8 -WARNS?= 1 +WARNS?= 6 .include Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Thu Jun 11 07:40:36 2009 (r193975) +++ head/usr.sbin/arp/arp.c Thu Jun 11 07:50:36 2009 (r193976) @@ -721,9 +721,13 @@ rtmsg(int cmd, struct sockaddr_inarp *ds case RTM_GET: rtm->rtm_addrs |= RTA_DST; } -#define NEXTADDR(w, s) \ - if ((s) != NULL && rtm->rtm_addrs & (w)) { \ - bcopy((s), cp, sizeof(*(s))); cp += SA_SIZE(s);} +#define NEXTADDR(w, s) \ + do { \ + if ((s) != NULL && rtm->rtm_addrs & (w)) { \ + bcopy((s), cp, sizeof(*(s))); \ + cp += SA_SIZE(s); \ + } \ + } while (0) NEXTADDR(RTA_DST, dst); NEXTADDR(RTA_GATEWAY, sdl); From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 09:02:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 972071065679; Thu, 11 Jun 2009 09:02:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 851CB8FC1C; Thu, 11 Jun 2009 09:02:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5B92MRX041207; Thu, 11 Jun 2009 09:02:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5B92MoH041206; Thu, 11 Jun 2009 09:02:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906110902.n5B92MoH041206@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Jun 2009 09:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193978 - head/usr.sbin/pstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 09:02:23 -0000 Author: ed Date: Thu Jun 11 09:02:22 2009 New Revision: 193978 URL: http://svn.freebsd.org/changeset/base/193978 Log: Make most of pstat(8) build with WARNS=6. There is still an issue with the nlists, which I'm not quite sure how to solve, so I'm leaving WARNS set to 3 right now. Modified: head/usr.sbin/pstat/pstat.c Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Thu Jun 11 07:52:35 2009 (r193977) +++ head/usr.sbin/pstat/pstat.c Thu Jun 11 09:02:22 2009 (r193978) @@ -95,7 +95,7 @@ static char *nlistf; static char *memf; static kvm_t *kd; -static char *usagestr; +static const char *usagestr; static void filemode(void); static int getfiles(char **, size_t *); @@ -109,7 +109,8 @@ main(int argc, char *argv[]) { int ch, i, quit, ret; int fileflag, ttyflag; - char buf[_POSIX2_LINE_MAX],*opts; + char buf[_POSIX2_LINE_MAX]; + const char *opts; fileflag = swapflag = ttyflag = 0; @@ -358,8 +359,8 @@ filemode(void) char *buf, flagbuf[16], *fbp; int maxf, openf; size_t len; - static char *dtypes[] = { "???", "inode", "socket", "pipe", - "fifo", "kqueue", "crypto" }; + static const char *dtypes[] = { "???", "inode", "socket", + "pipe", "fifo", "kqueue", "crypto" }; int i; int wid; @@ -466,7 +467,7 @@ print_swap_header(void) } static void -print_swap_line(const char *devname, intmax_t nblks, intmax_t bused, +print_swap_line(const char *swdevname, intmax_t nblks, intmax_t bused, intmax_t bavail, float bpercent) { char usedbuf[5]; @@ -477,7 +478,7 @@ print_swap_line(const char *devname, int pagesize = getpagesize(); getbsize(&hlen, &blocksize); - printf("%-15s %*jd ", devname, hlen, CONVERT(nblks)); + printf("%-15s %*jd ", swdevname, hlen, CONVERT(nblks)); if (humanflag) { humanize_number(usedbuf, sizeof(usedbuf), CONVERT(blocksize * bused), "", From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 09:06:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF9E7106568B; Thu, 11 Jun 2009 09:06:09 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0188FC0A; Thu, 11 Jun 2009 09:06:09 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5B969tx041316; Thu, 11 Jun 2009 09:06:09 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5B9694m041311; Thu, 11 Jun 2009 09:06:09 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906110906.n5B9694m041311@svn.freebsd.org> From: Ariff Abdullah Date: Thu, 11 Jun 2009 09:06: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: r193979 - in head/sys/dev/sound: midi pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 09:06:10 -0000 Author: ariff Date: Thu Jun 11 09:06:09 2009 New Revision: 193979 URL: http://svn.freebsd.org/changeset/base/193979 Log: Remove custom KOBJMETHOD(), CHANNEL_DECLARE() and MIXER_DECLARE() (enabled with SND_DEBUG) that was intended to provoke build failure due to inconsistencies. Modified: head/sys/dev/sound/midi/midi.c head/sys/dev/sound/midi/mpu401.c head/sys/dev/sound/pcm/channel.h head/sys/dev/sound/pcm/mixer.h head/sys/dev/sound/pcm/sound.h Modified: head/sys/dev/sound/midi/midi.c ============================================================================== --- head/sys/dev/sound/midi/midi.c Thu Jun 11 09:02:22 2009 (r193978) +++ head/sys/dev/sound/midi/midi.c Thu Jun 11 09:06:09 2009 (r193979) @@ -58,17 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SND_DEBUG -#undef KOBJMETHOD -#define KOBJMETHOD(NAME, FUNC) \ - { \ - &NAME##_desc, \ - (kobjop_t) ((FUNC != (NAME##_t *)NULL) ? FUNC : NULL) \ - } -#endif -#ifndef KOBJMETHOD_END -#define KOBJMETHOD_END { NULL, NULL } -#endif #include #ifdef HAVE_KERNEL_OPTION_HEADERS @@ -82,6 +71,9 @@ __FBSDID("$FreeBSD$"); #include "synth_if.h" MALLOC_DEFINE(M_MIDI, "midi buffers", "Midi data allocation area"); +#ifndef KOBJMETHOD_END +#define KOBJMETHOD_END { NULL, NULL } +#endif #define PCMMKMINOR(u, d, c) ((((c) & 0xff) << 16) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) #define MIDIMKMINOR(u, d, c) PCMMKMINOR(u, d, c) Modified: head/sys/dev/sound/midi/mpu401.c ============================================================================== --- head/sys/dev/sound/midi/mpu401.c Thu Jun 11 09:02:22 2009 (r193978) +++ head/sys/dev/sound/midi/mpu401.c Thu Jun 11 09:06:09 2009 (r193979) @@ -37,17 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SND_DEBUG -#undef KOBJMETHOD -#define KOBJMETHOD(NAME, FUNC) \ - { \ - &NAME##_desc, \ - (kobjop_t) ((FUNC != (NAME##_t *)NULL) ? FUNC : NULL) \ - } -#endif -#ifndef KOBJMETHOD_END -#define KOBJMETHOD_END { NULL, NULL } -#endif #include #include /* to get driver_intr_t */ @@ -61,6 +50,10 @@ __FBSDID("$FreeBSD$"); #include "mpu_if.h" #include "mpufoi_if.h" +#ifndef KOBJMETHOD_END +#define KOBJMETHOD_END { NULL, NULL } +#endif + #define MPU_DATAPORT 0 #define MPU_CMDPORT 1 #define MPU_STATPORT 1 Modified: head/sys/dev/sound/pcm/channel.h ============================================================================== --- head/sys/dev/sound/pcm/channel.h Thu Jun 11 09:02:22 2009 (r193978) +++ head/sys/dev/sound/pcm/channel.h Thu Jun 11 09:06:09 2009 (r193979) @@ -441,15 +441,4 @@ extern int report_soft_matrix; /* The size of a whole secondary bufhard. */ #define CHN_2NDBUFMAXSIZE (131072) -#ifdef SND_DEBUG -#define CHANNEL_DECLARE(channel) \ - static struct kobj_class channel##_class = { \ - .name = #channel, \ - .methods = channel##_methods, \ - .size = sizeof(struct kobj), \ - .baseclasses = NULL, \ - .refs = 0 \ - } -#else #define CHANNEL_DECLARE(name) static DEFINE_CLASS(name, name ## _methods, sizeof(struct kobj)) -#endif Modified: head/sys/dev/sound/pcm/mixer.h ============================================================================== --- head/sys/dev/sound/pcm/mixer.h Thu Jun 11 09:02:22 2009 (r193978) +++ head/sys/dev/sound/pcm/mixer.h Thu Jun 11 09:06:09 2009 (r193979) @@ -74,15 +74,4 @@ extern int mixer_count; #define MIXER_SIZE (512 + sizeof(struct kobj) + \ sizeof(oss_mixer_enuminfo)) -#ifdef SND_DEBUG -#define MIXER_DECLARE(mixer) \ - static struct kobj_class mixer##_class = { \ - .name = #mixer, \ - .methods = mixer##_methods, \ - .size = MIXER_SIZE, \ - .baseclasses = NULL, \ - .refs = 0 \ - } -#else #define MIXER_DECLARE(name) static DEFINE_CLASS(name, name ## _methods, MIXER_SIZE) -#endif Modified: head/sys/dev/sound/pcm/sound.h ============================================================================== --- head/sys/dev/sound/pcm/sound.h Thu Jun 11 09:02:22 2009 (r193978) +++ head/sys/dev/sound/pcm/sound.h Thu Jun 11 09:06:09 2009 (r193979) @@ -66,17 +66,6 @@ #include #include #include -#ifdef SND_DEBUG -#undef KOBJMETHOD -#define KOBJMETHOD(NAME, FUNC) \ - { \ - &NAME##_desc, \ - (kobjop_t) ((FUNC != (NAME##_t *)NULL) ? FUNC : NULL) \ - } -#endif -#ifndef KOBJMETHOD_END -#define KOBJMETHOD_END { NULL, NULL } -#endif #include #include @@ -84,6 +73,10 @@ #include #include +#ifndef KOBJMETHOD_END +#define KOBJMETHOD_END { NULL, NULL } +#endif + struct pcm_channel; struct pcm_feeder; struct snd_dbuf; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 09:51:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC22B106566C; Thu, 11 Jun 2009 09:51:21 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3EB8FC13; Thu, 11 Jun 2009 09:51:21 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5B9pL0D042165; Thu, 11 Jun 2009 09:51:21 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5B9pLCQ042162; Thu, 11 Jun 2009 09:51:21 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906110951.n5B9pLCQ042162@svn.freebsd.org> From: Kip Macy Date: Thu, 11 Jun 2009 09:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193980 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 09:51:22 -0000 Author: kmacy Date: Thu Jun 11 09:51:21 2009 New Revision: 193980 URL: http://svn.freebsd.org/changeset/base/193980 Log: check against prefetch_enable Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Jun 11 09:06:09 2009 (r193979) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Jun 11 09:51:21 2009 (r193980) @@ -326,7 +326,7 @@ dmu_prefetch(objset_t *os, uint64_t obje uint64_t blkid; int nblks, i, err; - if (zfs_prefetch_disable) + if (zfs_prefetch_enable == 0) return; if (len == 0) { /* they're interested in the bonus buffer */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Thu Jun 11 09:06:09 2009 (r193979) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Thu Jun 11 09:51:21 2009 (r193980) @@ -598,7 +598,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset unsigned int blkshft; uint64_t blksz; - if (zfs_prefetch_disable) + if (zfs_prefetch_enable == 0) return; /* files that aren't ln2 blocksz are only one block -- nothing to do */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jun 11 09:06:09 2009 (r193979) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jun 11 09:51:21 2009 (r193980) @@ -457,7 +457,7 @@ int dmu_write_uio(objset_t *os, uint64_t int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, struct page *pp, dmu_tx_t *tx); -extern int zfs_prefetch_disable; +extern int zfs_prefetch_enable; /* * Asynchronously try to read in the data. From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 09:55:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C6FB106566C; Thu, 11 Jun 2009 09:55:27 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39F578FC14; Thu, 11 Jun 2009 09:55:27 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5B9tRBJ042287; Thu, 11 Jun 2009 09:55:27 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5B9tR6T042284; Thu, 11 Jun 2009 09:55:27 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200906110955.n5B9tR6T042284@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 11 Jun 2009 09:55: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: r193981 - in head/sys: geom sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 09:55:27 -0000 Author: luigi Date: Thu Jun 11 09:55:26 2009 New Revision: 193981 URL: http://svn.freebsd.org/changeset/base/193981 Log: As discussed in the devsummit, introduce two fields in the struct bio to store classification information, and a hook for classifier functions that can be called by g_io_request(). This code is from Fabio Checconi as part of his GSOC work. Modified: head/sys/geom/geom.h head/sys/geom/geom_io.c head/sys/sys/bio.h Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Thu Jun 11 09:51:21 2009 (r193980) +++ head/sys/geom/geom.h Thu Jun 11 09:55:26 2009 (r193981) @@ -195,6 +195,17 @@ struct g_provider { u_int index; }; +/* + * Descriptor of a classifier. We can register a function and + * an argument, which is called by g_io_request() on bio's + * that are not previously classified. + */ +struct g_classifier_hook { + TAILQ_ENTRY(g_classifier_hook) link; + int (*func)(void *arg, struct bio *bp); + void *arg; +}; + /* geom_dev.c */ struct cdev; void g_dev_print(void); @@ -272,6 +283,8 @@ void g_destroy_bio(struct bio *); void g_io_deliver(struct bio *bp, int error); int g_io_getattr(const char *attr, struct g_consumer *cp, int *len, void *ptr); int g_io_flush(struct g_consumer *cp); +int g_register_classifier(struct g_classifier_hook *hook); +void g_unregister_classifier(struct g_classifier_hook *hook); void g_io_request(struct bio *bp, struct g_consumer *cp); struct bio *g_new_bio(void); struct bio *g_alloc_bio(void); Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Thu Jun 11 09:51:21 2009 (r193980) +++ head/sys/geom/geom_io.c Thu Jun 11 09:55:26 2009 (r193981) @@ -59,6 +59,15 @@ static struct g_bioq g_bio_run_task; static u_int pace; static uma_zone_t biozone; +/* + * The head of the list of classifiers used in g_io_request. + * Use g_register_classifier() and g_unregister_classifier() + * to add/remove entries to the list. + * Classifiers are invoked in registration order. + */ +static TAILQ_HEAD(g_classifier_tailq, g_classifier_hook) + g_classifier_tailq = TAILQ_HEAD_INITIALIZER(g_classifier_tailq); + #include static void @@ -172,6 +181,9 @@ g_clone_bio(struct bio *bp) bp2->bio_offset = bp->bio_offset; bp2->bio_data = bp->bio_data; bp2->bio_attribute = bp->bio_attribute; + /* Inherit classification info from the parent */ + bp2->bio_classifier1 = bp->bio_classifier1; + bp2->bio_classifier2 = bp->bio_classifier2; bp->bio_children++; } #ifdef KTR @@ -318,6 +330,63 @@ g_io_check(struct bio *bp) return (0); } +/* + * bio classification support. + * + * g_register_classifier() and g_unregister_classifier() + * are used to add/remove a classifier from the list. + * The list is protected using the g_bio_run_down lock, + * because the classifiers are called in this path. + * + * g_io_request() passes bio's that are not already classified + * (i.e. those with bio_classifier1 == NULL) to g_run_classifiers(). + * Classifiers can store their result in the two fields + * bio_classifier1 and bio_classifier2. + * A classifier that updates one of the fields should + * return a non-zero value. + * If no classifier updates the field, g_run_classifiers() sets + * bio_classifier1 = BIO_NOTCLASSIFIED to avoid further calls. + */ + +int +g_register_classifier(struct g_classifier_hook *hook) +{ + + g_bioq_lock(&g_bio_run_down); + TAILQ_INSERT_TAIL(&g_classifier_tailq, hook, link); + g_bioq_unlock(&g_bio_run_down); + + return (0); +} + +void +g_unregister_classifier(struct g_classifier_hook *hook) +{ + struct g_classifier_hook *entry; + + g_bioq_lock(&g_bio_run_down); + TAILQ_FOREACH(entry, &g_classifier_tailq, link) { + if (entry == hook) { + TAILQ_REMOVE(&g_classifier_tailq, hook, link); + break; + } + } + g_bioq_unlock(&g_bio_run_down); +} + +static void +g_run_classifiers(struct bio *bp) +{ + struct g_classifier_hook *hook; + int classified = 0; + + TAILQ_FOREACH(hook, &g_classifier_tailq, link) + classified |= hook->func(hook->arg, bp); + + if (!classified) + bp->bio_classifier1 = BIO_NOTCLASSIFIED; +} + void g_io_request(struct bio *bp, struct g_consumer *cp) { @@ -379,8 +448,14 @@ g_io_request(struct bio *bp, struct g_co * The statistics collection is lockless, as such, but we * can not update one instance of the statistics from more * than one thread at a time, so grab the lock first. + * + * We also use the lock to protect the list of classifiers. */ g_bioq_lock(&g_bio_run_down); + + if (!TAILQ_EMPTY(&g_classifier_tailq) && !bp->bio_classifier1) + g_run_classifiers(bp); + if (g_collectstats & 1) devstat_start_transaction(pp->stat, &bp->bio_t0); if (g_collectstats & 2) Modified: head/sys/sys/bio.h ============================================================================== --- head/sys/sys/bio.h Thu Jun 11 09:51:21 2009 (r193980) +++ head/sys/sys/bio.h Thu Jun 11 09:55:26 2009 (r193981) @@ -43,6 +43,9 @@ struct disk; struct bio; +/* Empty classifier tag, to prevent further classification. */ +#define BIO_NOTCLASSIFIED (void *)(~0UL) + typedef void bio_task_t(void *); /* @@ -78,6 +81,10 @@ struct bio { bio_task_t *bio_task; /* Task_queue handler */ void *bio_task_arg; /* Argument to above */ + + void *bio_classifier1; /* Classifier tag. */ + void *bio_classifier2; /* Classifier tag. */ + #ifdef DIAGNOSTIC void *_bio_caller1; void *_bio_caller2; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 09:59:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E0CF1065742; Thu, 11 Jun 2009 09:59:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C9368FC12; Thu, 11 Jun 2009 09:59:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5B9xlPj042399; Thu, 11 Jun 2009 09:59:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5B9xl3A042398; Thu, 11 Jun 2009 09:59:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906110959.n5B9xl3A042398@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Jun 2009 09:59: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: r193982 - head/usr.sbin/pstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 09:59:48 -0000 Author: ed Date: Thu Jun 11 09:59:47 2009 New Revision: 193982 URL: http://svn.freebsd.org/changeset/base/193982 Log: Correct my previous commit to pstat(8). Not only mark the strings inside the array as const, but do the same for the elements of the array itself. Submitted by: Christoph Mallon Modified: head/usr.sbin/pstat/pstat.c Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Thu Jun 11 09:55:26 2009 (r193981) +++ head/usr.sbin/pstat/pstat.c Thu Jun 11 09:59:47 2009 (r193982) @@ -359,7 +359,7 @@ filemode(void) char *buf, flagbuf[16], *fbp; int maxf, openf; size_t len; - static const char *dtypes[] = { "???", "inode", "socket", + static char const * const dtypes[] = { "???", "inode", "socket", "pipe", "fifo", "kqueue", "crypto" }; int i; int wid; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 10:06:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 779FE106564A; Thu, 11 Jun 2009 10:06:56 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id A4D9F8FC0A; Thu, 11 Jun 2009 10:06:50 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 35F0545E11; Thu, 11 Jun 2009 12:06:49 +0200 (CEST) Received: from localhost (chello087206192061.chello.pl [87.206.192.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 0F1024569A; Thu, 11 Jun 2009 12:06:43 +0200 (CEST) Date: Thu, 11 Jun 2009 12:06:47 +0200 From: Pawel Jakub Dawidek To: Luigi Rizzo Message-ID: <20090611100647.GB2642@garage.freebsd.pl> References: <200906110955.n5B9tR6T042284@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H1spWtNR+x+ondvy" Content-Disposition: inline In-Reply-To: <200906110955.n5B9tR6T042284@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193981 - in head/sys: geom sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 10:06:56 -0000 --H1spWtNR+x+ondvy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 11, 2009 at 09:55:27AM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Thu Jun 11 09:55:26 2009 > New Revision: 193981 > URL: http://svn.freebsd.org/changeset/base/193981 >=20 > Log: > As discussed in the devsummit, introduce two fields in the > struct bio to store classification information, and a hook > for classifier functions that can be called by g_io_request(). > =20 > This code is from Fabio Checconi as part of his GSOC work. [...] > +int > +g_register_classifier(struct g_classifier_hook *hook) > +{ > + > + g_bioq_lock(&g_bio_run_down); > + TAILQ_INSERT_TAIL(&g_classifier_tailq, hook, link); > + g_bioq_unlock(&g_bio_run_down); > + > + return (0); > +} Why not to make it void, just like g_unregister_classifier()? > +void > +g_unregister_classifier(struct g_classifier_hook *hook) > +{ > + struct g_classifier_hook *entry; > + > + g_bioq_lock(&g_bio_run_down); > + TAILQ_FOREACH(entry, &g_classifier_tailq, link) { > + if (entry =3D=3D hook) { > + TAILQ_REMOVE(&g_classifier_tailq, hook, link); > + break; > + } > + } > + g_bioq_unlock(&g_bio_run_down); > +} --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --H1spWtNR+x+ondvy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKMNc3ForvXbEpPzQRAvSdAKDeg3eA/zHupSlKjUy7hvVcqqa/0QCeKpBp PBy2YMJMfIkZx9x+eObHhH0= =adym -----END PGP SIGNATURE----- --H1spWtNR+x+ondvy-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 10:26:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 624B9106566C; Thu, 11 Jun 2009 10:26:39 +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 503228FC15; Thu, 11 Jun 2009 10:26:39 +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 n5BAQdPT044319; Thu, 11 Jun 2009 10:26:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BAQdOi044315; Thu, 11 Jun 2009 10:26:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111026.n5BAQdOi044315@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 10:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193983 - in head/sys: conf net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 10:26:39 -0000 Author: bz Date: Thu Jun 11 10:26:38 2009 New Revision: 193983 URL: http://svn.freebsd.org/changeset/base/193983 Log: carp(4) allows people to share a set of IP addresses and can only use IPv4/v6 for inter-node communication (according to my reading). Properly wrap the carp callouts in INET || INET6 and refelect this in sys/conf/files as well. While in theory this should be ok, it might be a bit optimistic to think that carp could build with inet6 only[1]. Discussed with: mlaier [1] Modified: head/sys/conf/files head/sys/net/if.c head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 09:59:47 2009 (r193982) +++ head/sys/conf/files Thu Jun 11 10:26:38 2009 (r193983) @@ -2352,7 +2352,7 @@ netinet/if_atm.c optional atm netinet/if_ether.c optional ether netinet/igmp.c optional inet netinet/in.c optional inet -netinet/ip_carp.c optional carp +netinet/ip_carp.c optional inet carp | inet6 carp netinet/in_gif.c optional gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Jun 11 09:59:47 2009 (r193982) +++ head/sys/net/if.c Thu Jun 11 10:26:38 2009 (r193983) @@ -86,9 +86,11 @@ #include #include #endif +#if defined(INET) || defined(INET6) #ifdef DEV_CARP #include #endif +#endif #include @@ -1738,10 +1740,12 @@ if_unroute(struct ifnet *ifp, int flag, pfctlinput(PRC_IFDOWN, ifa->ifa_addr); ifp->if_qflush(ifp); +#if defined(INET) || defined(INET6) #ifdef DEV_CARP if (ifp->if_carp) carp_carpdev_state(ifp->if_carp); #endif +#endif rt_ifmsg(ifp); } @@ -1762,10 +1766,12 @@ if_route(struct ifnet *ifp, int flag, in TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family)) pfctlinput(PRC_IFUP, ifa->ifa_addr); +#if defined(INET) || defined(INET6) #ifdef DEV_CARP if (ifp->if_carp) carp_carpdev_state(ifp->if_carp); #endif +#endif rt_ifmsg(ifp); #ifdef INET6 in6_if_up(ifp); @@ -1816,10 +1822,12 @@ do_link_state_change(void *arg, int pend if ((ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) && IFP2AC(ifp)->ac_netgraph != NULL) (*ng_ether_link_state_p)(ifp, link_state); +#if defined(INET) || defined(INET6) #ifdef DEV_CARP if (ifp->if_carp) carp_carpdev_state(ifp->if_carp); #endif +#endif if (ifp->if_bridge) { KASSERT(bstp_linkstate_p != NULL,("if_bridge bstp not loaded!")); (*bstp_linkstate_p)(ifp, link_state); Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Thu Jun 11 09:59:47 2009 (r193982) +++ head/sys/net/if_bridge.c Thu Jun 11 10:26:38 2009 (r193983) @@ -122,9 +122,11 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#if defined(INET) || defined(INET6) #ifdef DEV_CARP #include #endif +#endif #include #include /* for struct arpcom */ #include @@ -2231,7 +2233,7 @@ bridge_input(struct ifnet *ifp, struct m return (m); } -#ifdef DEV_CARP +#if (defined(INET) || defined(INET6)) && defined(DEV_CARP) # define OR_CARP_CHECK_WE_ARE_DST(iface) \ || ((iface)->if_carp \ && carp_forus((iface)->if_carp, eh->ether_dhost)) Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Thu Jun 11 09:59:47 2009 (r193982) +++ head/sys/net/if_ethersubr.c Thu Jun 11 10:26:38 2009 (r193983) @@ -79,9 +79,11 @@ #include #endif +#if defined(INET) || defined(INET6) #ifdef DEV_CARP #include #endif +#endif #ifdef IPX #include @@ -393,11 +395,13 @@ ether_output(struct ifnet *ifp, struct m return (error); } +#if defined(INET) || defined(INET6) #ifdef DEV_CARP if (ifp->if_carp && (error = carp_output(ifp, m, dst, NULL))) goto bad; #endif +#endif /* Handle ng_ether(4) processing, if any */ if (IFP2AC(ifp)->ac_netgraph != NULL) { @@ -712,6 +716,7 @@ ether_input(struct ifnet *ifp, struct mb } } +#if defined(INET) || defined(INET6) #ifdef DEV_CARP /* * Clear M_PROMISC on frame so that carp(4) will see it when the @@ -727,6 +732,7 @@ ether_input(struct ifnet *ifp, struct mb m->m_flags &= ~M_PROMISC; } else #endif +#endif { /* * If the frame received was not for our MAC address, set the From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 10:30:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1DC61065675; Thu, 11 Jun 2009 10:30:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A615E8FC1A; Thu, 11 Jun 2009 10:30:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BAUUxo044437; Thu, 11 Jun 2009 10:30:30 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BAUU38044436; Thu, 11 Jun 2009 10:30:30 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906111030.n5BAUU38044436@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 11 Jun 2009 10:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193984 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 10:30:31 -0000 Author: des Date: Thu Jun 11 10:30:30 2009 New Revision: 193984 URL: http://svn.freebsd.org/changeset/base/193984 Log: Lower WARNS due to alignment issues on sparc64. Modified: head/usr.sbin/arp/Makefile Modified: head/usr.sbin/arp/Makefile ============================================================================== --- head/usr.sbin/arp/Makefile Thu Jun 11 10:26:38 2009 (r193983) +++ head/usr.sbin/arp/Makefile Thu Jun 11 10:30:30 2009 (r193984) @@ -4,6 +4,6 @@ PROG= arp MAN= arp.4 arp.8 -WARNS?= 6 +WARNS?= 3 .include From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 10:40:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75F711065675; Thu, 11 Jun 2009 10:40:43 +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 644248FC18; Thu, 11 Jun 2009 10:40:43 +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 n5BAehva044717; Thu, 11 Jun 2009 10:40:43 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BAehur044716; Thu, 11 Jun 2009 10:40:43 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111040.n5BAehur044716@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 10:40: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: r193986 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 10:40:44 -0000 Author: bz Date: Thu Jun 11 10:40:43 2009 New Revision: 193986 URL: http://svn.freebsd.org/changeset/base/193986 Log: if_bridge(4) unfortunately is missing a lot of #ifdef INETs and thus INET is a mandatory dependency at the moment. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 10:32:13 2009 (r193985) +++ head/sys/conf/files Thu Jun 11 10:40:43 2009 (r193986) @@ -2186,7 +2186,7 @@ net/ieee8023ad_lacp.c optional lagg net/if.c standard net/if_arcsubr.c optional arcnet net/if_atmsubr.c optional atm -net/if_bridge.c optional bridge | if_bridge +net/if_bridge.c optional bridge inet | if_bridge inet net/if_clone.c standard net/if_dead.c standard net/if_disc.c optional disc From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 11:13:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D165C1065670; Thu, 11 Jun 2009 11:13:35 +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 BFA968FC13; Thu, 11 Jun 2009 11:13:35 +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 n5BBDZGm045381; Thu, 11 Jun 2009 11:13:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BBDZrd045380; Thu, 11 Jun 2009 11:13:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111113.n5BBDZrd045380@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 11:13: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: r193987 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 11:13:36 -0000 Author: bz Date: Thu Jun 11 11:13:35 2009 New Revision: 193987 URL: http://svn.freebsd.org/changeset/base/193987 Log: stf(4) supports `6to4' IPv6 in IPv4 encapsulation accroding to RFC3056. It thus needs both INET and INET6 to do its duty. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 10:40:43 2009 (r193986) +++ head/sys/conf/files Thu Jun 11 11:13:35 2009 (r193987) @@ -2208,7 +2208,7 @@ net/if_media.c standard net/if_mib.c standard net/if_spppfr.c optional sppp | netgraph_sppp net/if_spppsubr.c optional sppp | netgraph_sppp -net/if_stf.c optional stf +net/if_stf.c optional stf inet inet6 net/if_tun.c optional tun net/if_tap.c optional tap net/if_vlan.c optional vlan From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 11:17:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68FED106566C; Thu, 11 Jun 2009 11:17:17 +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 570C68FC14; Thu, 11 Jun 2009 11:17:17 +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 n5BBHHrV045508; Thu, 11 Jun 2009 11:17:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BBHH2S045507; Thu, 11 Jun 2009 11:17:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111117.n5BBHH2S045507@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 11:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193988 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 11:17:17 -0000 Author: bz Date: Thu Jun 11 11:17:16 2009 New Revision: 193988 URL: http://svn.freebsd.org/changeset/base/193988 Log: if_enc(4) is only useful with ipsec and either inet or inet6. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 11:13:35 2009 (r193987) +++ head/sys/conf/files Thu Jun 11 11:17:16 2009 (r193988) @@ -2192,7 +2192,7 @@ net/if_dead.c standard net/if_disc.c optional disc net/if_edsc.c optional edsc net/if_ef.c optional ef -net/if_enc.c optional enc +net/if_enc.c optional enc ipsec inet | enc ipsec inet6 net/if_ethersubr.c optional ether \ compile-with "${NORMAL_C} -I$S/contrib/pf" net/if_faith.c optional faith From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 12:01:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BC0F106568F; Thu, 11 Jun 2009 12:01:21 +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 1C2148FC3C; Thu, 11 Jun 2009 12:01:15 +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 n5BC1Fwe046490; Thu, 11 Jun 2009 12:01:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BC1EgX046489; Thu, 11 Jun 2009 12:01:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111201.n5BC1EgX046489@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 12:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193990 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 12:01:33 -0000 Author: bz Date: Thu Jun 11 12:01:14 2009 New Revision: 193990 URL: http://svn.freebsd.org/changeset/base/193990 Log: netinet/if_ether.c (doing ARP) depends on INET as well. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 11:59:53 2009 (r193989) +++ head/sys/conf/files Thu Jun 11 12:01:14 2009 (r193990) @@ -2349,7 +2349,7 @@ netinet/accf_data.c optional accept_fil netinet/accf_dns.c optional accept_filter_dns netinet/accf_http.c optional accept_filter_http netinet/if_atm.c optional atm -netinet/if_ether.c optional ether +netinet/if_ether.c optional inet ether netinet/igmp.c optional inet netinet/in.c optional inet netinet/ip_carp.c optional inet carp | inet6 carp From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 12:06:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF5DC10657A5; Thu, 11 Jun 2009 12:06:37 +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 AA0AE8FC28; Thu, 11 Jun 2009 12:06:37 +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 n5BC6b6J046654; Thu, 11 Jun 2009 12:06:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BC6bcP046653; Thu, 11 Jun 2009 12:06:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111206.n5BC6bcP046653@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 12:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193991 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 12:06:41 -0000 Author: bz Date: Thu Jun 11 12:06:37 2009 New Revision: 193991 URL: http://svn.freebsd.org/changeset/base/193991 Log: ip_dummynet.c depends on INET. Note: this may be more because of improper #ifdefs these days. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 12:01:14 2009 (r193990) +++ head/sys/conf/files Thu Jun 11 12:06:37 2009 (r193991) @@ -2362,7 +2362,7 @@ netinet/in_proto.c optional inet \ compile-with "${NORMAL_C} -I$S/contrib/pf" netinet/in_rmx.c optional inet netinet/ip_divert.c optional inet ipdivert ipfirewall -netinet/ipfw/ip_dummynet.c optional dummynet +netinet/ipfw/ip_dummynet.c optional inet dummynet netinet/ip_ecn.c optional inet | inet6 netinet/ip_encap.c optional inet | inet6 netinet/ip_fastfwd.c optional inet From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 12:17:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B6CE1065676; Thu, 11 Jun 2009 12:17:58 +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 1F08E8FC2C; Thu, 11 Jun 2009 12:17:58 +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 n5BCHwuN046947; Thu, 11 Jun 2009 12:17:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BCHvdL046946; Thu, 11 Jun 2009 12:17:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111217.n5BCHvdL046946@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 12:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193993 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 12:17:59 -0000 Author: bz Date: Thu Jun 11 12:17:57 2009 New Revision: 193993 URL: http://svn.freebsd.org/changeset/base/193993 Log: ng_ipfw depends on inet and ipfirewall as well. ng_nat depends on inet and libalias and most of libalias depends on inet. Update dependencies to porperly reflect this. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 12:09:13 2009 (r193992) +++ head/sys/conf/files Thu Jun 11 12:17:57 2009 (r193993) @@ -2323,13 +2323,13 @@ netgraph/ng_gif_demux.c optional netgra netgraph/ng_hole.c optional netgraph_hole netgraph/ng_iface.c optional netgraph_iface netgraph/ng_ip_input.c optional netgraph_ip_input -netgraph/ng_ipfw.c optional netgraph_ipfw +netgraph/ng_ipfw.c optional netgraph_ipfw inet ipfirewall netgraph/ng_ksocket.c optional netgraph_ksocket netgraph/ng_l2tp.c optional netgraph_l2tp netgraph/ng_lmi.c optional netgraph_lmi netgraph/ng_mppc.c optional netgraph_mppc_compression | \ netgraph_mppc_encryption -netgraph/ng_nat.c optional netgraph_nat +netgraph/ng_nat.c optional netgraph_nat inet libalias netgraph/ng_one2many.c optional netgraph_one2many netgraph/ng_parse.c optional netgraph netgraph/ng_ppp.c optional netgraph_ppp @@ -2405,12 +2405,12 @@ netinet/tcp_timer.c optional inet netinet/tcp_timewait.c optional inet netinet/tcp_usrreq.c optional inet netinet/udp_usrreq.c optional inet -netinet/libalias/alias.c optional libalias | netgraph_nat -netinet/libalias/alias_db.c optional libalias | netgraph_nat +netinet/libalias/alias.c optional libalias inet | netgraph_nat inet +netinet/libalias/alias_db.c optional libalias inet | netgraph_nat inet netinet/libalias/alias_mod.c optional libalias | netgraph_nat -netinet/libalias/alias_proxy.c optional libalias | netgraph_nat -netinet/libalias/alias_util.c optional libalias | netgraph_nat -netinet/libalias/alias_sctp.c optional libalias | netgraph_nat +netinet/libalias/alias_proxy.c optional libalias inet | netgraph_nat inet +netinet/libalias/alias_util.c optional libalias inet | netgraph_nat inet +netinet/libalias/alias_sctp.c optional libalias inet | netgraph_nat inet netinet6/dest6.c optional inet6 netinet6/frag6.c optional inet6 netinet6/icmp6.c optional inet6 From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 12:21:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3CFF106566B; Thu, 11 Jun 2009 12:21:41 +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 924218FC1A; Thu, 11 Jun 2009 12:21:41 +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 n5BCLffT047066; Thu, 11 Jun 2009 12:21:41 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BCLfSW047065; Thu, 11 Jun 2009 12:21:41 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111221.n5BCLfSW047065@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 12:21: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: r193994 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 12:21:42 -0000 Author: bz Date: Thu Jun 11 12:21:41 2009 New Revision: 193994 URL: http://svn.freebsd.org/changeset/base/193994 Log: As sys/kern/uipc_accf.c depends on inet, all three accf_* implementations do as well for accept_filt_generic_mod_event(). In addition accf_http also needs inet for the sysctl mib path. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 12:17:57 2009 (r193993) +++ head/sys/conf/files Thu Jun 11 12:21:41 2009 (r193994) @@ -2345,9 +2345,9 @@ netgraph/ng_tcpmss.c optional netgraph_ netgraph/ng_tee.c optional netgraph_tee netgraph/ng_tty.c optional netgraph_tty netgraph/ng_vjc.c optional netgraph_vjc -netinet/accf_data.c optional accept_filter_data -netinet/accf_dns.c optional accept_filter_dns -netinet/accf_http.c optional accept_filter_http +netinet/accf_data.c optional accept_filter_data inet +netinet/accf_dns.c optional accept_filter_dns inet +netinet/accf_http.c optional accept_filter_http inet netinet/if_atm.c optional atm netinet/if_ether.c optional inet ether netinet/igmp.c optional inet From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 12:44:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EC6E1065698; Thu, 11 Jun 2009 12:44:14 +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 5CF8C8FC12; Thu, 11 Jun 2009 12:44:14 +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 n5BCiEYg047600; Thu, 11 Jun 2009 12:44:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BCiEq5047599; Thu, 11 Jun 2009 12:44:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111244.n5BCiEq5047599@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 12:44: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: r193996 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 12:44:14 -0000 Author: bz Date: Thu Jun 11 12:44:13 2009 New Revision: 193996 URL: http://svn.freebsd.org/changeset/base/193996 Log: if_igb.c as well as ixgbe.c uncondtionally depend on INET specific functions, especially but not solely tcp_lro_*. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 12:40:04 2009 (r193995) +++ head/sys/conf/files Thu Jun 11 12:44:13 2009 (r193996) @@ -862,7 +862,7 @@ dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa dev/e1000/if_em.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/if_igb.c optional igb \ +dev/e1000/if_igb.c optional igb inet \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_80003es2lan.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" @@ -1086,17 +1086,17 @@ iwn.fw optional iwnfw \ dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb -dev/ixgbe/ixgbe.c optional ixgbe \ +dev/ixgbe/ixgbe.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_phy.c optional ixgbe \ +dev/ixgbe/ixgbe_phy.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_api.c optional ixgbe \ +dev/ixgbe/ixgbe_api.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_common.c optional ixgbe \ +dev/ixgbe/ixgbe_common.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_82598.c optional ixgbe \ +dev/ixgbe/ixgbe_82598.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_82599.c optional ixgbe \ +dev/ixgbe/ixgbe_82599.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 12:56:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A6A6106564A; Thu, 11 Jun 2009 12:56:15 +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 3CF958FC0C; Thu, 11 Jun 2009 12:56:15 +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 n5BCuFLI047982; Thu, 11 Jun 2009 12:56:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BCuFUs047981; Thu, 11 Jun 2009 12:56:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111256.n5BCuFUs047981@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 12:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193997 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 12:56:15 -0000 Author: bz Date: Thu Jun 11 12:56:14 2009 New Revision: 193997 URL: http://svn.freebsd.org/changeset/base/193997 Log: All these Ethernet NICs depend on INET, mostly for unconditional cksum related function calls, sometimes related to offload features from what I could see.xi It would be good if the offload functionality would be properly #ifdefed but the other calls to cksum related functions are a more general problem also elswhere in the network stack. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 12:44:13 2009 (r193996) +++ head/sys/conf/files Thu Jun 11 12:56:14 2009 (r193997) @@ -450,7 +450,7 @@ dev/advansys/adwcam.c optional adw dev/advansys/adwlib.c optional adw dev/advansys/adwmcode.c optional adw dev/ae/if_ae.c optional ae pci -dev/age/if_age.c optional age pci +dev/age/if_age.c optional age pci inet dev/agp/agp.c optional agp pci dev/agp/agp_if.m optional agp pci dev/aha/aha.c optional aha @@ -471,8 +471,8 @@ dev/aic7xxx/aic7xxx.c optional ahc dev/aic7xxx/aic7xxx_93cx6.c optional ahc dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci -dev/alc/if_alc.c optional alc pci -dev/ale/if_ale.c optional ale pci +dev/alc/if_alc.c optional alc pci inet +dev/ale/if_ale.c optional ale pci inet dev/amd/amd.c optional amd dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr @@ -860,7 +860,7 @@ dev/ed/if_ed_pccard.c optional ed pccar dev/ed/if_ed_pci.c optional ed pci dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa -dev/e1000/if_em.c optional em \ +dev/e1000/if_em.c optional em inet \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/if_igb.c optional igb inet \ compile-with "${NORMAL_C} -I$S/dev/e1000" @@ -921,7 +921,7 @@ dev/firewire/if_fwip.c optional fwip dev/firewire/sbp.c optional sbp dev/firewire/sbp_targ.c optional sbp_targ dev/flash/at45d.c optional at45d -dev/fxp/if_fxp.c optional fxp +dev/fxp/if_fxp.c optional fxp inet dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci dev/hatm/if_hatm.c optional hatm pci @@ -1098,7 +1098,7 @@ dev/ixgbe/ixgbe_82598.c optional ixgbe compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_82599.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/jme/if_jme.c optional jme pci +dev/jme/if_jme.c optional jme pci inet dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa dev/joy/joy_pccard.c optional joy pccard @@ -1180,7 +1180,7 @@ dev/mpt/mpt_debug.c optional mpt dev/mpt/mpt_pci.c optional mpt pci dev/mpt/mpt_raid.c optional mpt dev/mpt/mpt_user.c optional mpt -dev/msk/if_msk.c optional msk +dev/msk/if_msk.c optional msk inet dev/mwl/if_mwl.c optional mwl dev/mwl/if_mwl_pci.c optional mwl pci dev/mwl/mwlhal.c optional mwl @@ -1208,12 +1208,12 @@ mwlboot.fw optional mwlfw \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu" \ no-obj no-implicit-rule \ clean "mwlboot.fw" -dev/mxge/if_mxge.c optional mxge pci -dev/mxge/mxge_lro.c optional mxge pci -dev/mxge/mxge_eth_z8e.c optional mxge pci -dev/mxge/mxge_ethp_z8e.c optional mxge pci -dev/mxge/mxge_rss_eth_z8e.c optional mxge pci -dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci +dev/mxge/if_mxge.c optional mxge pci inet +dev/mxge/mxge_lro.c optional mxge pci inet +dev/mxge/mxge_eth_z8e.c optional mxge pci inet +dev/mxge/mxge_ethp_z8e.c optional mxge pci inet +dev/mxge/mxge_rss_eth_z8e.c optional mxge pci inet +dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci inet dev/my/if_my.c optional my dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard @@ -1386,7 +1386,7 @@ dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci dev/sis/if_sis.c optional sis pci -dev/sk/if_sk.c optional sk pci +dev/sk/if_sk.c optional sk pci inet dev/smbus/smb.c optional smb dev/smbus/smbconf.c optional smbus dev/smbus/smbus.c optional smbus @@ -1535,7 +1535,7 @@ dev/twa/tw_osl_freebsd.c optional twa \ dev/twe/twe.c optional twe dev/twe/twe_freebsd.c optional twe dev/tx/if_tx.c optional tx -dev/txp/if_txp.c optional txp +dev/txp/if_txp.c optional txp inet dev/uart/uart_bus_acpi.c optional uart acpi #dev/uart/uart_bus_cbus.c optional uart cbus dev/uart/uart_bus_ebus.c optional uart ebus From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 13:59:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A9C106564A; Thu, 11 Jun 2009 13:59:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F15E8FC13; Thu, 11 Jun 2009 13:59:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BDxpdQ049370; Thu, 11 Jun 2009 13:59:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BDxpG0049369; Thu, 11 Jun 2009 13:59:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906111359.n5BDxpG0049369@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Jun 2009 13:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194000 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 13:59:52 -0000 Author: ed Date: Thu Jun 11 13:59:51 2009 New Revision: 194000 URL: http://svn.freebsd.org/changeset/base/194000 Log: Use the documented machine constraint for SSE registers. The amd64-specific bits of msun use an undocumented constraint, which is less likely to be supported by other compilers (such as Clang). Change the code to use a more common machine constraint. Obtained from: /projects/clangbsd/ Modified: head/lib/msun/src/math_private.h Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Thu Jun 11 13:07:42 2009 (r193999) +++ head/lib/msun/src/math_private.h Thu Jun 11 13:59:51 2009 (r194000) @@ -262,7 +262,7 @@ irint(double x) { int n; - asm("cvtsd2si %1,%0" : "=r" (n) : "Y" (x)); + asm("cvtsd2si %1,%0" : "=r" (n) : "x" (x)); return (n); } #define HAVE_EFFICIENT_IRINT From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 14:22:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 131BE106566B; Thu, 11 Jun 2009 14:22:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D7DBB8FC0A; Thu, 11 Jun 2009 14:22:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 74AA146B32; Thu, 11 Jun 2009 10:22:25 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 5046A8A06C; Thu, 11 Jun 2009 10:22:24 -0400 (EDT) From: John Baldwin To: Robert Watson Date: Wed, 10 Jun 2009 17:52:10 -0400 User-Agent: KMail/1.9.7 References: <200906101827.n5AIRFoR022115@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906101752.11336.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 11 Jun 2009 10:22:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_12_24,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 14:22:26 -0000 On Wednesday 10 June 2009 3:52:31 pm Robert Watson wrote: > > On Wed, 10 Jun 2009, John Baldwin wrote: > > > Change a few members of tcpcb that store cached copies of ticks to be ints > > instead of unsigned longs. This fixes a few overflow edge cases on 64-bit > > platforms. Specifically, if an idle connection receives a packet shortly > > before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep > > alive timer fires after 2^31 clock ticks, the keep alive timer will think > > that the connection has been idle for a very long time and will immediately > > drop the connection instead of sending a keep alive probe. > > > > Reviewed by: silby, gnn, lstewart > > MFC after: 1 week > > That's pretty subtle even as TCP bugs go, nice work :-). More of the credit goes to gnn@ and my co-workers. I had told gnn@ to not worry about overflow about a week ago because I had just assumed (incorrectly) that 'ticks' and 't_rcvtime' were the same size. :-/ -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 14:22:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A3CB1065672; Thu, 11 Jun 2009 14:22:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CFA7D8FC0C; Thu, 11 Jun 2009 14:22:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8123646B35; Thu, 11 Jun 2009 10:22:26 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 73FBA8A070; Thu, 11 Jun 2009 10:22:25 -0400 (EDT) From: John Baldwin To: Jung-uk Kim Date: Thu, 11 Jun 2009 08:24:14 -0400 User-Agent: KMail/1.9.7 References: <200906102254.n5AMsK1b028497@svn.freebsd.org> In-Reply-To: <200906102254.n5AMsK1b028497@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906110824.14659.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 11 Jun 2009 10:22:25 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193963 - in head/sys: conf dev/acpica dev/acpica/Osd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 14:22:27 -0000 On Wednesday 10 June 2009 6:54:20 pm Jung-uk Kim wrote: > Author: jkim > Date: Wed Jun 10 22:54:20 2009 > New Revision: 193963 > URL: http://svn.freebsd.org/changeset/base/193963 > > Log: > Catch up with r193750 (OsdSynch.c locking changes): > > - Preallocate some memory for ACPI tasks early enough. We cannot use > malloc(9) any more because spin mutex may be held here. The reserved > memory can be tuned via debug.acpi.max_tasks tunable or ACPI_MAX_TASKS > in kernel configuration. The default is 32 tasks. > - Implement a custom taskqueue_fast to wrap the new memory allocation. > This implementation is not the fastest in the world but we are being > conservative here. I don't think you need the _acq barriers on your atomics here btw. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 14:22:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62F08106564A; Thu, 11 Jun 2009 14:22:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 33A598FC12; Thu, 11 Jun 2009 14:22:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id DAF7E46B37; Thu, 11 Jun 2009 10:22:27 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id A4EE88A071; Thu, 11 Jun 2009 10:22:26 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Thu, 11 Jun 2009 09:07:02 -0400 User-Agent: KMail/1.9.7 References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <200906101442.20988.jhb@freebsd.org> <20090611135433.K21177@delplex.bde.org> In-Reply-To: <20090611135433.K21177@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906110907.02874.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 11 Jun 2009 10:22:26 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 14:22:28 -0000 On Thursday 11 June 2009 12:04:32 am Bruce Evans wrote: > On Wed, 10 Jun 2009, John Baldwin wrote: > > > On Wednesday 10 June 2009 2:27:15 pm John Baldwin wrote: > >> Author: jhb > >> Date: Wed Jun 10 18:27:15 2009 > >> New Revision: 193941 > >> URL: http://svn.freebsd.org/changeset/base/193941 > >> > >> Log: > >> Change a few members of tcpcb that store cached copies of ticks to be ints > >> instead of unsigned longs. This fixes a few overflow edge cases on 64-bit > >> platforms. Specifically, if an idle connection receives a packet shortly > >> before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep > >> alive timer fires after 2^31 clock ticks, the keep alive timer will think > >> that the connection has been idle for a very long time and will immediately > >> drop the connection instead of sending a keep alive probe. > >> > >> Reviewed by: silby, gnn, lstewart > >> MFC after: 1 week > > > > Note that the MFC patch for 7 is very different. I can't change the members > > to int in 7 since tcpcb is part of the ABI (for netstat, etc.). So, for 7 I > > added explicit casts in the math operations using t_rcvtime and ticks. > > That has a better chance of working too. I tested both patches by cranking the keep alive timers to 5 seconds and manually adjusting ticks to INT_MAX - 15000. Then I letting a TCP connection sit idle while ticks wrapped around to -ve. Without either patch the connection always died with ETIMEDOUT. With each patch (including what was committed above), the connection survived and the keepalive timer sent a probe instead of dropping the connection. Thus, both patches "work". -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 14:22:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F947106566C; Thu, 11 Jun 2009 14:22:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 652838FC13; Thu, 11 Jun 2009 14:22:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 153D746B2C; Thu, 11 Jun 2009 10:22:29 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id B11668A06A; Thu, 11 Jun 2009 10:22:27 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Thu, 11 Jun 2009 10:18:20 -0400 User-Agent: KMail/1.9.7 References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <20090611124334.A21109@delplex.bde.org> In-Reply-To: <20090611124334.A21109@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906111018.20703.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 11 Jun 2009 10:22:27 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 14:22:30 -0000 On Wednesday 10 June 2009 11:53:16 pm Bruce Evans wrote: > On Wed, 10 Jun 2009, John Baldwin wrote: > > > Log: > > Change a few members of tcpcb that store cached copies of ticks to be ints > > instead of unsigned longs. This fixes a few overflow edge cases on 64-bit > > platforms. Specifically, if an idle connection receives a packet shortly > > I think the variables should still be unsigned (ints now). Otherwise there > is at best benign undefined behaviour when the variables overflow at > INT_MAX, while the code is apparently designed to work with unsigned > values (it casts to int to look at differences between the unsigned values). I wanted to match 'ticks' and figured changing 'ticks' was a far larger headache. > > Modified: head/sys/netinet/tcp_input.c > > ============================================================================== > > --- head/sys/netinet/tcp_input.c Wed Jun 10 18:26:02 2009 (r193940) > > +++ head/sys/netinet/tcp_input.c Wed Jun 10 18:27:15 2009 (r193941) > > @@ -1778,7 +1778,7 @@ tcp_do_segment(struct mbuf *m, struct tc > > TSTMP_LT(to.to_tsval, tp->ts_recent)) { > > > > /* Check to see if ts_recent is over 24 days old. */ > > - if ((int)(ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) { > > + if ((ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) { > > The variables are now ints, and there is now also overflow in the > subtraction. E.g., INT_MAX - INT_MIN now overflows. On 2's complement > machines it normally overflows to -2, which is probably the wrong value > (the large unsigned value 0xFFF...FEU is probably correct), but it is > the same value as is given by casting the difference of unsigned values > to int ((int)0xFFF...FEU = -2). This is because, when representing times > mod UINT_MAX+1, all time differences up to UINT_MAX can be represented, > but only if we keep track of which operand is older (here we probably do > know that ts_recent_age is older); if we don't keep track then we normally > assume that (unsigned) differences smaller than INT_MAX mean that the > difference is nonnegative while differences larger than INT_MAX mean > that the difference is negative. The signed interpreatation works well > if we know that the nonnegative differences never exceed INT_MAX. I believe in these cases that 1) the differences should never exceed INT_MAX, and 2) we do know which value should be older. > Style bug: without the cast, the above has excessive parentheses. Ok. > > Modified: head/sys/netinet/tcp_usrreq.c > > ============================================================================== > > --- head/sys/netinet/tcp_usrreq.c Wed Jun 10 18:26:02 2009 (r193940) > > +++ head/sys/netinet/tcp_usrreq.c Wed Jun 10 18:27:15 2009 (r193941) > > @@ -1823,7 +1823,7 @@ db_print_tcpcb(struct tcpcb *tp, const c > > tp->snd_recover); > > > > db_print_indent(indent); > > - db_printf("t_maxopd: %u t_rcvtime: %lu t_startime: %lu\n", > > + db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", > > tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); > > > > db_print_indent(indent); > > You still print all the times as unsigned. Since the variables are now > signed, this is now a printf format error, which gcc still doesn't detect > but I usually do. Ok. > > Modified: head/sys/netinet/tcp_var.h > > ============================================================================== > > --- head/sys/netinet/tcp_var.h Wed Jun 10 18:26:02 2009 (r193940) > > +++ head/sys/netinet/tcp_var.h Wed Jun 10 18:27:15 2009 (r193941) > > @@ -139,8 +139,8 @@ struct tcpcb { > > > > u_int t_maxopd; /* mss plus options */ > > > > - u_long t_rcvtime; /* inactivity time */ > > - u_long t_starttime; /* time connection was established */ > > + int t_rcvtime; /* inactivity time */ > > + int t_starttime; /* time connection was established */ > > int t_rtttime; /* round trip time */ > > tcp_seq t_rtseq; /* sequence number being timed */ > > > > @@ -167,7 +167,7 @@ struct tcpcb { > > u_char rcv_scale; /* window scaling for recv window */ > > u_char request_r_scale; /* pending window scaling */ > > u_int32_t ts_recent; /* timestamp echo data */ > > - u_long ts_recent_age; /* when last updated */ > > + int ts_recent_age; /* when last updated */ > > u_int32_t ts_offset; /* our timestamp offset */ > > > > tcp_seq last_ack_sent; > > @@ -175,7 +175,7 @@ struct tcpcb { > > u_long snd_cwnd_prev; /* cwnd prior to retransmit */ > > u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ > > tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ > > - u_long t_badrxtwin; /* window for retransmit recovery */ > > + int t_badrxtwin; /* window for retransmit recovery */ > > u_char snd_limited; /* segments limited transmitted */ > > /* SACK related state */ > > int snd_numholes; /* number of holes seen by sender */ > > > > Should all be changed to u_int? > > There still seem to be some very nice sign extension/overflow bugs. > E.g., `ticks' is (bogusly) signed. After changing the above variables > to int to be bug for bug compatible with `ticks', the semantics of > expressions not directly touched in this commit is changed too. E.g., > there is the expression `ticks < tp->t_badrxtwin'. Changing the signedness > of the type of tp_t_badrxtwin stops promotion of `ticks' to unsigned in > this expression. However, this expression seems to have been just broken > before, and the change only moves the bug slightly (from times near where > `ticks' wraps around at to to times near where `ticks' overflows at > INT_MAX). To handle wraparound and avoid overflow, such expressions should > be written as (int)(ticks - tp->t_badrxtwin) < 0 where the variables have > unsigned type. This seems to have already been done for all the other > variables changed in this commit, except the cast to int is missing in > some cases. Yes, I noticed the t_badrxtwin breakage but wasn't sure how best to fix it (or at least thought that it should be a separate followup since it was already broken with wraparound). I considered making it work more like the other variables such as t_rcvtime that merely store a cached value of 'ticks' and then use 'ticks - foo' and compare it with the given interval. This would entail renaming 't_badrxtwin' to 't_badrxttime' or some such. That seems clearer to me than '(int)(ticks - t_badrxtwin) < 0'. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 14:36:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813311065672; Thu, 11 Jun 2009 14:36:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F9C98FC22; Thu, 11 Jun 2009 14:36:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BEaEbH050249; Thu, 11 Jun 2009 14:36:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BEaEgN050248; Thu, 11 Jun 2009 14:36:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906111436.n5BEaEgN050248@svn.freebsd.org> From: John Baldwin Date: Thu, 11 Jun 2009 14:36: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: r194002 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 14:36:16 -0000 Author: jhb Date: Thu Jun 11 14:36:13 2009 New Revision: 194002 URL: http://svn.freebsd.org/changeset/base/194002 Log: Trim extra ()'s. Submitted by: bde Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Jun 11 14:18:33 2009 (r194001) +++ head/sys/netinet/tcp_input.c Thu Jun 11 14:36:13 2009 (r194002) @@ -1778,7 +1778,7 @@ tcp_do_segment(struct mbuf *m, struct tc TSTMP_LT(to.to_tsval, tp->ts_recent)) { /* Check to see if ts_recent is over 24 days old. */ - if ((ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) { + if (ticks - tp->ts_recent_age > TCP_PAWS_IDLE) { /* * Invalidate ts_recent. If this segment updates * ts_recent, the age will be reset later and ts_recent From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 14:37:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8BA10656D0; Thu, 11 Jun 2009 14:37:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8048FC27; Thu, 11 Jun 2009 14:37:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BEbJXj050304; Thu, 11 Jun 2009 14:37:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BEbJdC050303; Thu, 11 Jun 2009 14:37:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906111437.n5BEbJdC050303@svn.freebsd.org> From: John Baldwin Date: Thu, 11 Jun 2009 14:37: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: r194003 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 14:37:20 -0000 Author: jhb Date: Thu Jun 11 14:37:18 2009 New Revision: 194003 URL: http://svn.freebsd.org/changeset/base/194003 Log: Correct printf format type mismatches. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Thu Jun 11 14:36:13 2009 (r194002) +++ head/sys/netinet/tcp_usrreq.c Thu Jun 11 14:37:18 2009 (r194003) @@ -1823,7 +1823,7 @@ db_print_tcpcb(struct tcpcb *tp, const c tp->snd_recover); db_print_indent(indent); - db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", + db_printf("t_maxopd: %u t_rcvtime: %d t_startime: %d\n", tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); db_print_indent(indent); @@ -1854,7 +1854,7 @@ db_print_tcpcb(struct tcpcb *tp, const c tp->snd_scale, tp->rcv_scale, tp->request_r_scale); db_print_indent(indent); - db_printf("ts_recent: %u ts_recent_age: %u\n", + db_printf("ts_recent: %u ts_recent_age: %d\n", tp->ts_recent, tp->ts_recent_age); db_print_indent(indent); @@ -1863,7 +1863,7 @@ db_print_tcpcb(struct tcpcb *tp, const c db_print_indent(indent); db_printf("snd_ssthresh_prev: %lu snd_recover_prev: 0x%08x " - "t_badrxtwin: %u\n", tp->snd_ssthresh_prev, + "t_badrxtwin: %d\n", tp->snd_ssthresh_prev, tp->snd_recover_prev, tp->t_badrxtwin); db_print_indent(indent); From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 15:07:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2024106564A; Thu, 11 Jun 2009 15:07:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0B5B8FC18; Thu, 11 Jun 2009 15:07:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BF72uJ050956; Thu, 11 Jun 2009 15:07:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BF72IH050955; Thu, 11 Jun 2009 15:07:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111507.n5BF72IH050955@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 15:07: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: r194005 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 15:07:03 -0000 Author: avg Date: Thu Jun 11 15:07:02 2009 New Revision: 194005 URL: http://svn.freebsd.org/changeset/base/194005 Log: syslog.conf: pop up from logging only ppp messages at the end of file This allows to append custom rules at the end of the file without risk of confusion that can result when one misses default !ppp line and doesn't add another program specification and thus subsequent selector(s) would belong to ppp program block. Requested by: marck Submitted by: marck Approved by: jhb (mentor) Modified: head/etc/syslog.conf Modified: head/etc/syslog.conf ============================================================================== --- head/etc/syslog.conf Thu Jun 11 14:44:10 2009 (r194004) +++ head/etc/syslog.conf Thu Jun 11 15:07:02 2009 (r194005) @@ -28,3 +28,4 @@ cron.* /var/log/cron # news.notice /var/log/news/news.notice !ppp *.* /var/log/ppp.log +!* From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 15:15:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0DA11065672; Thu, 11 Jun 2009 15:15:33 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 501658FC21; Thu, 11 Jun 2009 15:15:32 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA25139; Thu, 11 Jun 2009 18:15:29 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4A311F91.6040601@freebsd.org> Date: Thu, 11 Jun 2009 18:15:29 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.21 (X11/20090406) MIME-Version: 1.0 To: Andriy Gapon References: <200906111507.n5BF72IH050955@svn.freebsd.org> In-Reply-To: <200906111507.n5BF72IH050955@svn.freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky , John Baldwin Subject: Re: svn commit: r194005 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 15:15:34 -0000 on 11/06/2009 18:07 Andriy Gapon said the following: > Author: avg > Date: Thu Jun 11 15:07:02 2009 > New Revision: 194005 > URL: http://svn.freebsd.org/changeset/base/194005 > > Log: > syslog.conf: pop up from logging only ppp messages at the end of file > > This allows to append custom rules at the end of the file without > risk of confusion that can result when one misses default !ppp line > and doesn't add another program specification and thus subsequent > selector(s) would belong to ppp program block. > > Requested by: marck > Submitted by: marck > Approved by: jhb (mentor) > > Modified: > head/etc/syslog.conf > > Modified: head/etc/syslog.conf > ============================================================================== > --- head/etc/syslog.conf Thu Jun 11 14:44:10 2009 (r194004) > +++ head/etc/syslog.conf Thu Jun 11 15:07:02 2009 (r194005) > @@ -28,3 +28,4 @@ cron.* /var/log/cron > # news.notice /var/log/news/news.notice > !ppp > *.* /var/log/ppp.log > +!* I forgot to add "MFC after", but I think 2 weeks should be sufficient. Another thing - it seems that the example in syslog.conf(5) is incorrect. First, the manual says: Each block of lines is separated from the previous block by a program or hostname specification. A block will only log messages corresponding to the most recent program and hostname specifications given. Thus, with a block which selects ‘ppp’ as the program, directly followed by a block that selects messages from the hostname ‘dialhost’, the second block will only log messages from the ppp(8) program on dialhost. But then: # Save ftpd transactions along with mail and news !ftpd *.* /var/log/spoolerr # Log all security messages to a separate file. security.* /var/log/security # Log all writes to /dev/console to a separate file. console.* /var/log/console.log If I am not mistaken, this is a classic example of the confusion that this commit tries to prevent - the last two rules would apply only to messages from 'ftp', but not to all messages as the comments say. Unfortunately I am not very fluent with man page syntax (*roff), so if anybody could provide a patch then I could commit it - I am sure that jhb would approve :-) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 16:49:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7774B10656B9; Thu, 11 Jun 2009 16:49:00 +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 655608FC12; Thu, 11 Jun 2009 16:49:00 +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 n5BGn0L4053372; Thu, 11 Jun 2009 16:49:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BGn00K053371; Thu, 11 Jun 2009 16:49:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906111649.n5BGn00K053371@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 11 Jun 2009 16:49: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: r194011 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 16:49:01 -0000 Author: jkim Date: Thu Jun 11 16:48:59 2009 New Revision: 194011 URL: http://svn.freebsd.org/changeset/base/194011 Log: - Remove unnecessary read memory barriers from atomic operations[1]. - Define a macro to make my intention more clearer. Submitted by: jhb [1] Modified: head/sys/dev/acpica/Osd/OsdSchedule.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Thu Jun 11 15:51:14 2009 (r194010) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Thu Jun 11 16:48:59 2009 (r194011) @@ -72,6 +72,7 @@ struct acpi_task_ctx { ACPI_OSD_EXEC_CALLBACK at_function; void *at_context; int at_flag; +#define ACPI_TASK_FREE 0 #define ACPI_TASK_USED 1 #define ACPI_TASK_ENQUEUED 2 }; @@ -111,7 +112,7 @@ acpi_taskq_init(void *arg) printf("AcpiOsExecute: enqueue %d pending tasks\n", acpi_task_count); for (i = 0; i < acpi_max_tasks; i++) - if (atomic_cmpset_acq_int(&acpi_tasks[i].at_flag, ACPI_TASK_USED, + if (atomic_cmpset_int(&acpi_tasks[i].at_flag, ACPI_TASK_USED, ACPI_TASK_USED | ACPI_TASK_ENQUEUED)) taskqueue_enqueue(acpi_taskq, &acpi_tasks[i].at_task); } @@ -142,7 +143,8 @@ acpi_task_enqueue(int priority, ACPI_OSD int i; for (at = NULL, i = 0; i < acpi_max_tasks; i++) - if (atomic_cmpset_acq_int(&acpi_tasks[i].at_flag, 0, ACPI_TASK_USED)) { + if (atomic_cmpset_int(&acpi_tasks[i].at_flag, ACPI_TASK_FREE, + ACPI_TASK_USED)) { at = &acpi_tasks[i]; acpi_task_count++; break; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 16:50:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 724651065696; Thu, 11 Jun 2009 16:50:50 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F05A8FC08; Thu, 11 Jun 2009 16:50:50 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BGookv053454; Thu, 11 Jun 2009 16:50:50 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BGonnn053446; Thu, 11 Jun 2009 16:50:49 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906111650.n5BGonnn053446@svn.freebsd.org> From: Marko Zec Date: Thu, 11 Jun 2009 16:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 16:50:51 -0000 Author: zec Date: Thu Jun 11 16:50:49 2009 New Revision: 194012 URL: http://svn.freebsd.org/changeset/base/194012 Log: Introduce a mechanism for detecting calls from outbound path of the network stack when reentering the inbound path from netgraph, and force queueing of mbufs at the outbound netgraph node. The mechanism relies on two components. First, in netgraph nodes where outbound path of the network stack calls into netgraph, the current thread has to be appropriately marked using the new NG_OUTBOUND_THREAD_REF() macro before proceeding to call further into the netgraph topology, and unmarked using the NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. Second, netgraph nodes which can potentially reenter the network stack in the inbound path have to mark their inbound hooks using NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will then detect when there is a danger of a call graph looping back from outbound to inbound path via netgraph, and defer handing off the mbufs to the "inbound" node to a worker thread with a clean stack. In this first pass only the most obvious netgraph nodes have been updated to ensure no outbound to inbound calls can occur. Nodes such as ng_ipfw, ng_gif etc. should be further examined whether a potential for outbound to inbound call looping exists. This commit changes the layout of struct thread, but due to __FreeBSD_version number shortage a version bump has been omitted at this time, nevertheless kernel and modules have to be rebuilt. Reviewed by: julian, rwatson, bz Approved by: julian (mentor) Modified: head/UPDATING head/sys/netgraph/netgraph.h head/sys/netgraph/ng_base.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_ip_input.c head/sys/sys/proc.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jun 11 16:48:59 2009 (r194011) +++ head/UPDATING Thu Jun 11 16:50:49 2009 (r194012) @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090611: + The layout of struct thread has changed. Kernel and modules + need to be rebuilt. + 20090608: The layout of structs ifnet, domain, protosw and vnet_net has changed. Kernel modules need to be rebuilt. Modified: head/sys/netgraph/netgraph.h ============================================================================== --- head/sys/netgraph/netgraph.h Thu Jun 11 16:48:59 2009 (r194011) +++ head/sys/netgraph/netgraph.h Thu Jun 11 16:50:49 2009 (r194012) @@ -130,6 +130,7 @@ struct ng_hook { #define HK_FORCE_WRITER 0x0004 /* Incoming data queued as a writer */ #define HK_DEAD 0x0008 /* This is the dead hook.. don't free */ #define HK_HI_STACK 0x0010 /* Hook has hi stack usage */ +#define HK_TO_INBOUND 0x0020 /* Hook on ntw. stack inbound path. */ /* * Public Methods for hook @@ -150,6 +151,8 @@ void ng_unref_hook(hook_p hook); /* don' #define _NG_HOOK_FORCE_WRITER(hook) \ do { hook->hk_flags |= HK_FORCE_WRITER; } while (0) #define _NG_HOOK_FORCE_QUEUE(hook) do { hook->hk_flags |= HK_QUEUE; } while (0) +#define _NG_HOOK_SET_TO_INBOUND(hook) \ + do { hook->hk_flags |= HK_TO_INBOUND; } while (0) #define _NG_HOOK_HI_STACK(hook) do { hook->hk_flags |= HK_HI_STACK; } while (0) /* Some shortcuts */ @@ -176,8 +179,11 @@ static __inline int _ng_hook_is_valid(ho static __inline node_p _ng_hook_node(hook_p hook, char * file, int line); static __inline hook_p _ng_hook_peer(hook_p hook, char * file, int line); static __inline void _ng_hook_force_writer(hook_p hook, char * file, - int line); -static __inline void _ng_hook_force_queue(hook_p hook, char * file, int line); + int line); +static __inline void _ng_hook_force_queue(hook_p hook, char * file, + int line); +static __inline void _ng_hook_set_to_inbound(hook_p hook, char * file, + int line); static __inline void _chkhook(hook_p hook, char *file, int line) @@ -282,6 +288,13 @@ _ng_hook_force_queue(hook_p hook, char * } static __inline void +_ng_hook_set_to_inbound(hook_p hook, char * file, int line) +{ + _chkhook(hook, file, line); + _NG_HOOK_SET_TO_INBOUND(hook); +} + +static __inline void _ng_hook_hi_stack(hook_p hook, char * file, int line) { _chkhook(hook, file, line); @@ -302,6 +315,7 @@ _ng_hook_hi_stack(hook_p hook, char * fi #define NG_HOOK_PEER(hook) _ng_hook_peer(hook, _NN_) #define NG_HOOK_FORCE_WRITER(hook) _ng_hook_force_writer(hook, _NN_) #define NG_HOOK_FORCE_QUEUE(hook) _ng_hook_force_queue(hook, _NN_) +#define NG_HOOK_SET_TO_INBOUND(hook) _ng_hook_set_to_inbound(hook, _NN_) #define NG_HOOK_HI_STACK(hook) _ng_hook_hi_stack(hook, _NN_) #else /* NETGRAPH_DEBUG */ /*----------------------------------------------*/ @@ -319,6 +333,7 @@ _ng_hook_hi_stack(hook_p hook, char * fi #define NG_HOOK_PEER(hook) _NG_HOOK_PEER(hook) #define NG_HOOK_FORCE_WRITER(hook) _NG_HOOK_FORCE_WRITER(hook) #define NG_HOOK_FORCE_QUEUE(hook) _NG_HOOK_FORCE_QUEUE(hook) +#define NG_HOOK_SET_TO_INBOUND(hook) _NG_HOOK_SET_TO_INBOUND(hook) #define NG_HOOK_HI_STACK(hook) _NG_HOOK_HI_STACK(hook) #endif /* NETGRAPH_DEBUG */ /*----------------------------------------------*/ @@ -1189,6 +1204,20 @@ typedef void *meta_p; #define NG_ID_HASH_SIZE 128 /* most systems wont need even this many */ #define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */ +/* + * Mark the current thread when called from the outbound path of the + * network stack, in order to enforce queuing on ng nodes calling into + * the inbound network stack path. + */ +#define NG_OUTBOUND_THREAD_REF() \ + curthread->td_ng_outbound++ +#define NG_OUTBOUND_THREAD_UNREF() \ + do { \ + curthread->td_ng_outbound--; \ + KASSERT(curthread->td_ng_outbound >= 0, \ + ("%s: negative td_ng_outbound", __func__)); \ + } while (0) + /* Virtualization macros */ #define INIT_VNET_NETGRAPH(vnet) \ INIT_FROM_VNET(vnet, VNET_MOD_NETGRAPH, \ Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Thu Jun 11 16:48:59 2009 (r194011) +++ head/sys/netgraph/ng_base.c Thu Jun 11 16:50:49 2009 (r194012) @@ -2213,11 +2213,15 @@ ng_snd_item(item_p item, int flags) } /* - * If sender or receiver requests queued delivery or stack usage + * If sender or receiver requests queued delivery, or call graph + * loops back from outbound to inbound path, or stack usage * level is dangerous - enqueue message. */ if ((flags & NG_QUEUE) || (hook && (hook->hk_flags & HK_QUEUE))) { queue = 1; + } else if (hook && (hook->hk_flags & HK_TO_INBOUND) && + curthread->td_ng_outbound) { + queue = 1; } else { queue = 0; #ifdef GET_STACK_USAGE Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Thu Jun 11 16:48:59 2009 (r194011) +++ head/sys/netgraph/ng_eiface.c Thu Jun 11 16:50:49 2009 (r194012) @@ -261,7 +261,9 @@ ng_eiface_start2(node_p node, hook_p hoo * Send packet; if hook is not connected, mbuf will get * freed. */ + NG_OUTBOUND_THREAD_REF(); NG_SEND_DATA_ONLY(error, priv->ether, m); + NG_OUTBOUND_THREAD_UNREF(); /* Update stats */ if (error == 0) @@ -414,6 +416,7 @@ ng_eiface_newhook(node_p node, hook_p ho return (EISCONN); priv->ether = hook; NG_HOOK_SET_PRIVATE(hook, &priv->ether); + NG_HOOK_SET_TO_INBOUND(hook); if_link_state_change(ifp, LINK_STATE_UP); Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Thu Jun 11 16:48:59 2009 (r194011) +++ head/sys/netgraph/ng_ether.c Thu Jun 11 16:50:49 2009 (r194012) @@ -282,7 +282,9 @@ ng_ether_output(struct ifnet *ifp, struc return (0); /* Send it out "upper" hook */ + NG_OUTBOUND_THREAD_REF(); NG_SEND_DATA_ONLY(error, priv->upper, *mp); + NG_OUTBOUND_THREAD_UNREF(); return (error); } @@ -416,6 +418,7 @@ ng_ether_newhook(node_p node, hook_p hoo if (strcmp(name, NG_ETHER_HOOK_UPPER) == 0) { hookptr = &priv->upper; NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_upper); + NG_HOOK_SET_TO_INBOUND(hook); } else if (strcmp(name, NG_ETHER_HOOK_LOWER) == 0) { hookptr = &priv->lower; NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower); Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Thu Jun 11 16:48:59 2009 (r194011) +++ head/sys/netgraph/ng_iface.c Thu Jun 11 16:50:49 2009 (r194012) @@ -482,9 +482,10 @@ ng_iface_send(struct ifnet *ifp, struct /* Copy length before the mbuf gets invalidated. */ len = m->m_pkthdr.len; - /* Send packet. If hook is not connected, - mbuf will get freed. */ + /* Send packet. If hook is not connected, mbuf will get freed. */ + NG_OUTBOUND_THREAD_REF(); NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m); + NG_OUTBOUND_THREAD_UNREF(); /* Update stats. */ if (error == 0) { @@ -610,6 +611,7 @@ ng_iface_newhook(node_p node, hook_p hoo return (EISCONN); *hookptr = hook; NG_HOOK_HI_STACK(hook); + NG_HOOK_SET_TO_INBOUND(hook); return (0); } Modified: head/sys/netgraph/ng_ip_input.c ============================================================================== --- head/sys/netgraph/ng_ip_input.c Thu Jun 11 16:48:59 2009 (r194011) +++ head/sys/netgraph/ng_ip_input.c Thu Jun 11 16:50:49 2009 (r194012) @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -120,7 +121,10 @@ ngipi_rcvdata(hook_p hook, item_p item) NGI_GET_M(item, m); NG_FREE_ITEM(item); - netisr_dispatch(NETISR_IP, m); + if (curthread->td_ng_outbound) + netisr_queue(NETISR_IP, m); + else + netisr_dispatch(NETISR_IP, m); return 0; } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jun 11 16:48:59 2009 (r194011) +++ head/sys/sys/proc.h Thu Jun 11 16:50:49 2009 (r194012) @@ -235,6 +235,7 @@ struct thread { char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ struct file *td_fpop; /* (k) file referencing cdev under op */ int td_dbgflags; /* (c) Userland debugger flags */ + int td_ng_outbound; /* (k) Thread entered ng from above. */ struct osd td_osd; /* (k) Object specific data. */ #define td_endzero td_base_pri From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 16:56:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D7C5106566B; Thu, 11 Jun 2009 16:56:42 +0000 (UTC) (envelope-from zec@freebsd.org) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id 944AA8FC0A; Thu, 11 Jun 2009 16:56:41 +0000 (UTC) (envelope-from zec@freebsd.org) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id 2CADE9B647; Thu, 11 Jun 2009 18:56:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL autolearn=unavailable version=3.1.7 Received: from localhost (imunes.tel.fer.hr [161.53.19.8]) by xaqua.tel.fer.hr (Postfix) with ESMTP id A63149B645; Thu, 11 Jun 2009 18:56:16 +0200 (CEST) From: Marko Zec To: src-committers@freebsd.org Date: Thu, 11 Jun 2009 18:56:07 +0200 User-Agent: KMail/1.9.10 References: <200906111650.n5BGonnn053446@svn.freebsd.org> In-Reply-To: <200906111650.n5BGonnn053446@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906111856.07618.zec@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 16:56:42 -0000 On Thursday 11 June 2009 18:50:49 Marko Zec wrote: > Author: zec > Date: Thu Jun 11 16:50:49 2009 > New Revision: 194012 > URL: http://svn.freebsd.org/changeset/base/194012 > > Log: > Introduce a mechanism for detecting calls from outbound path of the > network stack when reentering the inbound path from netgraph, and > force queueing of mbufs at the outbound netgraph node. ^^^^^^^^ s/outbound/inbound/ -> the framework prevents direct call dispatching at the egress netgraph node, i.e. the one reentering the network stack from below, not on the output path. Sorry for the typo... Marko > > The mechanism relies on two components. First, in netgraph nodes > where outbound path of the network stack calls into netgraph, the > current thread has to be appropriately marked using the new > NG_OUTBOUND_THREAD_REF() macro before proceeding to call further > into the netgraph topology, and unmarked using the > NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. > Second, netgraph nodes which can potentially reenter the network > stack in the inbound path have to mark their inbound hooks using > NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will then > detect when there is a danger of a call graph looping back from > outbound to inbound path via netgraph, and defer handing off the > mbufs to the "inbound" node to a worker thread with a clean stack. > > In this first pass only the most obvious netgraph nodes have been > updated to ensure no outbound to inbound calls can occur. Nodes > such as ng_ipfw, ng_gif etc. should be further examined whether a > potential for outbound to inbound call looping exists. > > This commit changes the layout of struct thread, but due to > __FreeBSD_version number shortage a version bump has been omitted > at this time, nevertheless kernel and modules have to be rebuilt. > > Reviewed by: julian, rwatson, bz > Approved by: julian (mentor) > > Modified: > head/UPDATING > head/sys/netgraph/netgraph.h > head/sys/netgraph/ng_base.c > head/sys/netgraph/ng_eiface.c > head/sys/netgraph/ng_ether.c > head/sys/netgraph/ng_iface.c > head/sys/netgraph/ng_ip_input.c > head/sys/sys/proc.h > > Modified: head/UPDATING > =========================================================================== >=== --- head/UPDATING Thu Jun 11 16:48:59 2009 (r194011) > +++ head/UPDATING Thu Jun 11 16:50:49 2009 (r194012) > @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. > to maximize performance. (To disable malloc debugging, run > ln -s aj /etc/malloc.conf.) > > +20090611: > + The layout of struct thread has changed. Kernel and modules > + need to be rebuilt. > + > 20090608: > The layout of structs ifnet, domain, protosw and vnet_net has > changed. Kernel modules need to be rebuilt. > > Modified: head/sys/netgraph/netgraph.h > =========================================================================== >=== --- head/sys/netgraph/netgraph.h Thu Jun 11 16:48:59 2009 (r194011) +++ > head/sys/netgraph/netgraph.h Thu Jun 11 16:50:49 2009 (r194012) @@ -130,6 > +130,7 @@ struct ng_hook { > #define HK_FORCE_WRITER 0x0004 /* Incoming data queued as a writer */ > #define HK_DEAD 0x0008 /* This is the dead hook.. don't free */ > #define HK_HI_STACK 0x0010 /* Hook has hi stack usage */ > +#define HK_TO_INBOUND 0x0020 /* Hook on ntw. stack inbound path. */ > > /* > * Public Methods for hook > @@ -150,6 +151,8 @@ void ng_unref_hook(hook_p hook); /* don' > #define _NG_HOOK_FORCE_WRITER(hook) \ > do { hook->hk_flags |= HK_FORCE_WRITER; } while (0) > #define _NG_HOOK_FORCE_QUEUE(hook) do { hook->hk_flags |= HK_QUEUE; } > while (0) +#define _NG_HOOK_SET_TO_INBOUND(hook) \ > + do { hook->hk_flags |= HK_TO_INBOUND; } while (0) > #define _NG_HOOK_HI_STACK(hook) do { hook->hk_flags |= HK_HI_STACK; } > while (0) > > /* Some shortcuts */ > @@ -176,8 +179,11 @@ static __inline int _ng_hook_is_valid(ho > static __inline node_p _ng_hook_node(hook_p hook, char * file, int line); > static __inline hook_p _ng_hook_peer(hook_p hook, char * file, int line); > static __inline void _ng_hook_force_writer(hook_p hook, char * file, > - int line); > -static __inline void _ng_hook_force_queue(hook_p hook, char * file, int > line); + int line); > +static __inline void _ng_hook_force_queue(hook_p hook, char * file, > + int line); > +static __inline void _ng_hook_set_to_inbound(hook_p hook, char * file, > + int line); > > static __inline void > _chkhook(hook_p hook, char *file, int line) > @@ -282,6 +288,13 @@ _ng_hook_force_queue(hook_p hook, char * > } > > static __inline void > +_ng_hook_set_to_inbound(hook_p hook, char * file, int line) > +{ > + _chkhook(hook, file, line); > + _NG_HOOK_SET_TO_INBOUND(hook); > +} > + > +static __inline void > _ng_hook_hi_stack(hook_p hook, char * file, int line) > { > _chkhook(hook, file, line); > @@ -302,6 +315,7 @@ _ng_hook_hi_stack(hook_p hook, char * fi > #define NG_HOOK_PEER(hook) _ng_hook_peer(hook, _NN_) > #define NG_HOOK_FORCE_WRITER(hook) _ng_hook_force_writer(hook, _NN_) > #define NG_HOOK_FORCE_QUEUE(hook) _ng_hook_force_queue(hook, _NN_) > +#define NG_HOOK_SET_TO_INBOUND(hook) _ng_hook_set_to_inbound(hook, _NN_) > #define NG_HOOK_HI_STACK(hook) _ng_hook_hi_stack(hook, _NN_) > > #else /* NETGRAPH_DEBUG */ > /*----------------------------------------------*/ @@ -319,6 +333,7 @@ > _ng_hook_hi_stack(hook_p hook, char * fi > #define NG_HOOK_PEER(hook) _NG_HOOK_PEER(hook) > #define NG_HOOK_FORCE_WRITER(hook) _NG_HOOK_FORCE_WRITER(hook) > #define NG_HOOK_FORCE_QUEUE(hook) _NG_HOOK_FORCE_QUEUE(hook) > +#define NG_HOOK_SET_TO_INBOUND(hook) _NG_HOOK_SET_TO_INBOUND(hook) > #define NG_HOOK_HI_STACK(hook) _NG_HOOK_HI_STACK(hook) > > #endif /* NETGRAPH_DEBUG */ > /*----------------------------------------------*/ @@ -1189,6 +1204,20 @@ > typedef void *meta_p; > #define NG_ID_HASH_SIZE 128 /* most systems wont need even this many */ > #define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */ > > +/* > + * Mark the current thread when called from the outbound path of the > + * network stack, in order to enforce queuing on ng nodes calling into > + * the inbound network stack path. > + */ > +#define NG_OUTBOUND_THREAD_REF() \ > + curthread->td_ng_outbound++ > +#define NG_OUTBOUND_THREAD_UNREF() \ > + do { \ > + curthread->td_ng_outbound--; \ > + KASSERT(curthread->td_ng_outbound >= 0, \ > + ("%s: negative td_ng_outbound", __func__)); \ > + } while (0) > + > /* Virtualization macros */ > #define INIT_VNET_NETGRAPH(vnet) \ > INIT_FROM_VNET(vnet, VNET_MOD_NETGRAPH, \ > > Modified: head/sys/netgraph/ng_base.c > =========================================================================== >=== --- head/sys/netgraph/ng_base.c Thu Jun 11 16:48:59 2009 (r194011) +++ > head/sys/netgraph/ng_base.c Thu Jun 11 16:50:49 2009 (r194012) @@ -2213,11 > +2213,15 @@ ng_snd_item(item_p item, int flags) > } > > /* > - * If sender or receiver requests queued delivery or stack usage > + * If sender or receiver requests queued delivery, or call graph > + * loops back from outbound to inbound path, or stack usage > * level is dangerous - enqueue message. > */ > if ((flags & NG_QUEUE) || (hook && (hook->hk_flags & HK_QUEUE))) { > queue = 1; > + } else if (hook && (hook->hk_flags & HK_TO_INBOUND) && > + curthread->td_ng_outbound) { > + queue = 1; > } else { > queue = 0; > #ifdef GET_STACK_USAGE > > Modified: head/sys/netgraph/ng_eiface.c > =========================================================================== >=== --- head/sys/netgraph/ng_eiface.c Thu Jun 11 16:48:59 2009 (r194011) +++ > head/sys/netgraph/ng_eiface.c Thu Jun 11 16:50:49 2009 (r194012) @@ -261,7 > +261,9 @@ ng_eiface_start2(node_p node, hook_p hoo > * Send packet; if hook is not connected, mbuf will get > * freed. > */ > + NG_OUTBOUND_THREAD_REF(); > NG_SEND_DATA_ONLY(error, priv->ether, m); > + NG_OUTBOUND_THREAD_UNREF(); > > /* Update stats */ > if (error == 0) > @@ -414,6 +416,7 @@ ng_eiface_newhook(node_p node, hook_p ho > return (EISCONN); > priv->ether = hook; > NG_HOOK_SET_PRIVATE(hook, &priv->ether); > + NG_HOOK_SET_TO_INBOUND(hook); > > if_link_state_change(ifp, LINK_STATE_UP); > > > Modified: head/sys/netgraph/ng_ether.c > =========================================================================== >=== --- head/sys/netgraph/ng_ether.c Thu Jun 11 16:48:59 2009 (r194011) +++ > head/sys/netgraph/ng_ether.c Thu Jun 11 16:50:49 2009 (r194012) @@ -282,7 > +282,9 @@ ng_ether_output(struct ifnet *ifp, struc > return (0); > > /* Send it out "upper" hook */ > + NG_OUTBOUND_THREAD_REF(); > NG_SEND_DATA_ONLY(error, priv->upper, *mp); > + NG_OUTBOUND_THREAD_UNREF(); > return (error); > } > > @@ -416,6 +418,7 @@ ng_ether_newhook(node_p node, hook_p hoo > if (strcmp(name, NG_ETHER_HOOK_UPPER) == 0) { > hookptr = &priv->upper; > NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_upper); > + NG_HOOK_SET_TO_INBOUND(hook); > } else if (strcmp(name, NG_ETHER_HOOK_LOWER) == 0) { > hookptr = &priv->lower; > NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower); > > Modified: head/sys/netgraph/ng_iface.c > =========================================================================== >=== --- head/sys/netgraph/ng_iface.c Thu Jun 11 16:48:59 2009 (r194011) +++ > head/sys/netgraph/ng_iface.c Thu Jun 11 16:50:49 2009 (r194012) @@ -482,9 > +482,10 @@ ng_iface_send(struct ifnet *ifp, struct > /* Copy length before the mbuf gets invalidated. */ > len = m->m_pkthdr.len; > > - /* Send packet. If hook is not connected, > - mbuf will get freed. */ > + /* Send packet. If hook is not connected, mbuf will get freed. */ > + NG_OUTBOUND_THREAD_REF(); > NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m); > + NG_OUTBOUND_THREAD_UNREF(); > > /* Update stats. */ > if (error == 0) { > @@ -610,6 +611,7 @@ ng_iface_newhook(node_p node, hook_p hoo > return (EISCONN); > *hookptr = hook; > NG_HOOK_HI_STACK(hook); > + NG_HOOK_SET_TO_INBOUND(hook); > return (0); > } > > > Modified: head/sys/netgraph/ng_ip_input.c > =========================================================================== >=== --- head/sys/netgraph/ng_ip_input.c Thu Jun 11 16:48:59 2009 (r194011) > +++ head/sys/netgraph/ng_ip_input.c Thu Jun 11 16:50:49 2009 (r194012) @@ > -77,6 +77,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -120,7 +121,10 @@ ngipi_rcvdata(hook_p hook, item_p item) > > NGI_GET_M(item, m); > NG_FREE_ITEM(item); > - netisr_dispatch(NETISR_IP, m); > + if (curthread->td_ng_outbound) > + netisr_queue(NETISR_IP, m); > + else > + netisr_dispatch(NETISR_IP, m); > return 0; > } > > > Modified: head/sys/sys/proc.h > =========================================================================== >=== --- head/sys/sys/proc.h Thu Jun 11 16:48:59 2009 (r194011) > +++ head/sys/sys/proc.h Thu Jun 11 16:50:49 2009 (r194012) > @@ -235,6 +235,7 @@ struct thread { > char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ > struct file *td_fpop; /* (k) file referencing cdev under op */ > int td_dbgflags; /* (c) Userland debugger flags */ > + int td_ng_outbound; /* (k) Thread entered ng from above. */ > struct osd td_osd; /* (k) Object specific data. */ > #define td_endzero td_base_pri From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:03:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31FE5106566B; Thu, 11 Jun 2009 17:03:16 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20C678FC13; Thu, 11 Jun 2009 17:03:16 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BH3FBA053769; Thu, 11 Jun 2009 17:03:15 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH3F3i053768; Thu, 11 Jun 2009 17:03:15 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906111703.n5BH3F3i053768@svn.freebsd.org> From: Marko Zec Date: Thu, 11 Jun 2009 17:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194013 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:03:16 -0000 Author: zec Date: Thu Jun 11 17:03:15 2009 New Revision: 194013 URL: http://svn.freebsd.org/changeset/base/194013 Log: In struct thread, fields td_vnet and td_vnet_lpush may only be accessed via curthread (via appropriate macros), so update the comment indicating the protection model for those two fields. Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jun 11 16:50:49 2009 (r194012) +++ head/sys/sys/proc.h Thu Jun 11 17:03:15 2009 (r194013) @@ -278,8 +278,8 @@ struct thread { struct lpohead td_lprof[2]; /* (a) lock profiling objects. */ struct kdtrace_thread *td_dtrace; /* (*) DTrace-specific data. */ int td_errno; /* Error returned by last syscall. */ - struct vnet *td_vnet; /* (*) Effective vnet. */ - const char *td_vnet_lpush; /* (*) Debugging vnet push / pop. */ + struct vnet *td_vnet; /* (k) Effective vnet. */ + const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ }; struct mtx *thread_lock_block(struct thread *); From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:03:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6766510657EE; Thu, 11 Jun 2009 17:03:29 +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 B015D8FC12; Thu, 11 Jun 2009 17:03:28 +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 n5BH3SkX053810; Thu, 11 Jun 2009 17:03:28 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH3Sb1053808; Thu, 11 Jun 2009 17:03:28 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200906111703.n5BH3Sb1053808@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 11 Jun 2009 17:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194014 - head/usr.sbin/pstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:03:30 -0000 Author: stas Date: Thu Jun 11 17:03:28 2009 New Revision: 194014 URL: http://svn.freebsd.org/changeset/base/194014 Log: - Make pstat(8) WARNS=6 safe. - While here, eliminate the check for len > 0 in ttymode_sysctl as the code is able to handle this case well. Reviewed by: ed (initial version) Modified: head/usr.sbin/pstat/Makefile head/usr.sbin/pstat/pstat.c Modified: head/usr.sbin/pstat/Makefile ============================================================================== --- head/usr.sbin/pstat/Makefile Thu Jun 11 17:03:15 2009 (r194013) +++ head/usr.sbin/pstat/Makefile Thu Jun 11 17:03:28 2009 (r194014) @@ -6,7 +6,7 @@ LINKS= ${BINDIR}/pstat ${BINDIR}/swapinf MAN= pstat.8 MLINKS= pstat.8 swapinfo.8 -WARNS?= 3 +WARNS?= 6 DPADD= ${LIBKVM} ${LIBUTIL} LDADD= -lkvm -lutil Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Thu Jun 11 17:03:15 2009 (r194013) +++ head/usr.sbin/pstat/pstat.c Thu Jun 11 17:03:28 2009 (r194014) @@ -76,16 +76,22 @@ enum { NL_CONSTTY, NL_MAXFILES, NL_NFILES, - NL_TTY_LIST + NL_TTY_LIST, + NL_MARKER }; -static struct nlist nl[] = { - { .n_name = "_constty" }, - { .n_name = "_maxfiles" }, - { .n_name = "_openfiles" }, - { .n_name = "_tty_list" }, - { .n_name = "" } +static struct { + int order; + const char *name; +} namelist[] = { + { NL_CONSTTY, "_constty" }, + { NL_MAXFILES, "_maxfiles" }, + { NL_NFILES, "_openfiles" }, + { NL_TTY_LIST, "_tty_list" }, + { NL_MARKER, "" }, }; +#define NNAMES (sizeof(namelist) / sizeof(*namelist)) +static struct nlist nl[NNAMES]; static int humanflag; static int usenumflag; @@ -98,7 +104,7 @@ static kvm_t *kd; static const char *usagestr; static void filemode(void); -static int getfiles(char **, size_t *); +static int getfiles(struct xfile **, size_t *); static void swapmode(void); static void ttymode(void); static void ttyprt(struct xtty *); @@ -107,8 +113,9 @@ static void usage(void); int main(int argc, char *argv[]) { - int ch, i, quit, ret; + int ch, quit, ret; int fileflag, ttyflag; + unsigned int i; char buf[_POSIX2_LINE_MAX]; const char *opts; @@ -170,6 +177,12 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + /* + * Initialize symbol names list. + */ + for (i = 0; i < NNAMES; i++) + nl[namelist[i].order].n_name = strdup(namelist[i].name); + if (memf != NULL) { kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf); if (kd == NULL) @@ -253,12 +266,12 @@ ttymode_kvm(void) static void ttymode_sysctl(void) { - struct xtty *xt, *end; - void *xttys; + struct xtty *xttys; size_t len; + unsigned int i, n; (void)printf("%s", hdr); - if ((xttys = malloc(len = sizeof *xt)) == NULL) + if ((xttys = malloc(len = sizeof(*xttys))) == NULL) err(1, "malloc()"); while (sysctlbyname("kern.ttys", xttys, &len, 0, 0) == -1) { if (errno != ENOMEM) @@ -267,11 +280,9 @@ ttymode_sysctl(void) if ((xttys = realloc(xttys, len)) == NULL) err(1, "realloc()"); } - if (len > 0) { - end = (struct xtty *)((char *)xttys + len); - for (xt = xttys; xt < end; xt++) - ttyprt(xt); - } + n = len / sizeof(*xttys); + for (i = 0; i < n; i++) + ttyprt(&xttys[i]); } static void @@ -355,8 +366,8 @@ ttyprt(struct xtty *xt) static void filemode(void) { - struct xfile *fp; - char *buf, flagbuf[16], *fbp; + struct xfile *fp, *buf; + char flagbuf[16], *fbp; int maxf, openf; size_t len; static char const * const dtypes[] = { "???", "inode", "socket", @@ -413,11 +424,11 @@ filemode(void) } static int -getfiles(char **abuf, size_t *alen) +getfiles(struct xfile **abuf, size_t *alen) { + struct xfile *buf; size_t len; int mib[2]; - char *buf; /* * XXX From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:05:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9534B106566C; Thu, 11 Jun 2009 17:05:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82BF98FC23; Thu, 11 Jun 2009 17:05:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BH5Ekl053904; Thu, 11 Jun 2009 17:05:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH5EX5053894; Thu, 11 Jun 2009 17:05:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111705.n5BH5EX5053894@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:05: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: r194015 - in head/sys/arm: at91 mv xscale/i80321 xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:05:15 -0000 Author: avg Date: Thu Jun 11 17:05:13 2009 New Revision: 194015 URL: http://svn.freebsd.org/changeset/base/194015 Log: strict kobj signatures: number of fixes for arm architecture no functional changes should result Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_twi.c head/sys/arm/at91/if_ate.c head/sys/arm/mv/twsi.c head/sys/arm/xscale/i80321/i80321_pci.c head/sys/arm/xscale/ixp425/avila_led.c head/sys/arm/xscale/ixp425/cambria_led.c head/sys/arm/xscale/ixp425/if_npe.c head/sys/arm/xscale/ixp425/ixp425.c head/sys/arm/xscale/ixp425/ixp425_iic.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/at91/at91_mci.c Thu Jun 11 17:05:13 2009 (r194015) @@ -612,7 +612,7 @@ at91_mci_intr(void *arg) } static int -at91_mci_read_ivar(device_t bus, device_t child, int which, u_char *result) +at91_mci_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { struct at91_mci_softc *sc = device_get_softc(bus); Modified: head/sys/arm/at91/at91_twi.c ============================================================================== --- head/sys/arm/at91/at91_twi.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/at91/at91_twi.c Thu Jun 11 17:05:13 2009 (r194015) @@ -289,7 +289,7 @@ at91_twi_rst_card(device_t dev, u_char s } static int -at91_twi_callback(device_t dev, int index, caddr_t *data) +at91_twi_callback(device_t dev, int index, caddr_t data) { int error = 0; Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/at91/if_ate.c Thu Jun 11 17:05:13 2009 (r194015) @@ -1190,7 +1190,7 @@ ate_miibus_readreg(device_t dev, int phy return (val); } -static void +static int ate_miibus_writereg(device_t dev, int phy, int reg, int data) { struct ate_softc *sc; @@ -1204,7 +1204,7 @@ ate_miibus_writereg(device_t dev, int ph WR4(sc, ETH_MAN, ETH_MAN_REG_WR(phy, reg, data)); while ((RD4(sc, ETH_SR) & ETH_SR_IDLE) == 0) continue; - return; + return (0); } static device_method_t ate_methods[] = { Modified: head/sys/arm/mv/twsi.c ============================================================================== --- head/sys/arm/mv/twsi.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/mv/twsi.c Thu Jun 11 17:05:13 2009 (r194015) @@ -117,7 +117,7 @@ static int mv_twsi_start(device_t dev, u static int mv_twsi_stop(device_t dev); static int mv_twsi_read(device_t dev, char *buf, int len, int *read, int last, int delay); -static int mv_twsi_write(device_t dev, char *buf, int len, int *sent, +static int mv_twsi_write(device_t dev, const char *buf, int len, int *sent, int timeout); static struct resource_spec res_spec[] = { @@ -488,7 +488,7 @@ out: } static int -mv_twsi_write(device_t dev, char *buf, int len, int *sent, int timeout) +mv_twsi_write(device_t dev, const char *buf, int len, int *sent, int timeout) { struct mv_twsi_softc *sc; uint32_t status; Modified: head/sys/arm/xscale/i80321/i80321_pci.c ============================================================================== --- head/sys/arm/xscale/i80321/i80321_pci.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/xscale/i80321/i80321_pci.c Thu Jun 11 17:05:13 2009 (r194015) @@ -174,8 +174,8 @@ i80321_pci_conf_setup(struct i80321_pci_ } static u_int32_t -i80321_pci_read_config(device_t dev, int bus, int slot, int func, int reg, - int bytes) +i80321_pci_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) { struct i80321_pci_softc *sc = device_get_softc(dev); uint32_t isr; @@ -215,8 +215,8 @@ i80321_pci_read_config(device_t dev, int } static void -i80321_pci_write_config(device_t dev, int bus, int slot, int func, int reg, - u_int32_t data, int bytes) +i80321_pci_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, u_int32_t data, int bytes) { struct i80321_pci_softc *sc = device_get_softc(dev); uint32_t addr; Modified: head/sys/arm/xscale/ixp425/avila_led.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_led.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/xscale/ixp425/avila_led.c Thu Jun 11 17:05:13 2009 (r194015) @@ -88,13 +88,14 @@ led_avila_attach(device_t dev) return (0); } -static void +static int led_avila_detach(device_t dev) { struct led_avila_softc *sc = device_get_softc(dev); if (sc->sc_led != NULL) led_destroy(sc->sc_led); + return (0); } static device_method_t led_avila_methods[] = { Modified: head/sys/arm/xscale/ixp425/cambria_led.c ============================================================================== --- head/sys/arm/xscale/ixp425/cambria_led.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/xscale/ixp425/cambria_led.c Thu Jun 11 17:05:13 2009 (r194015) @@ -102,7 +102,7 @@ led_attach(device_t dev) return 0; } -static void +static int led_detach(device_t dev) { struct led_softc *sc = device_get_softc(dev); @@ -113,12 +113,13 @@ led_detach(device_t dev) if (led != NULL) led_destroy(led); } + return (0); } static device_method_t led_methods[] = { DEVMETHOD(device_probe, led_probe), DEVMETHOD(device_attach, led_attach), - DEVMETHOD(device_attach, led_detach), + DEVMETHOD(device_detach, led_detach), {0, 0}, }; Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/xscale/ixp425/if_npe.c Thu Jun 11 17:05:13 2009 (r194015) @@ -1691,20 +1691,21 @@ npe_miibus_readreg(device_t dev, int phy return (v & NPE_MII_READ_FAIL) ? 0xffff : (v & 0xffff); } -static void +static int npe_miibus_writereg(device_t dev, int phy, int reg, int data) { struct npe_softc *sc = device_get_softc(dev); uint32_t v; if (phy != sc->sc_phy) /* XXX */ - return; + return (0); v = (phy << NPE_MII_ADDR_SHL) | (reg << NPE_MII_REG_SHL) | data | NPE_MII_WRITE | NPE_MII_GO; npe_mii_mdio_write(sc, NPE_MAC_MDIO_CMD, v); /* XXX complain about timeout */ (void) npe_mii_mdio_wait(sc); + return (0); } static void Modified: head/sys/arm/xscale/ixp425/ixp425.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/xscale/ixp425/ixp425.c Thu Jun 11 17:05:13 2009 (r194015) @@ -334,7 +334,7 @@ ixp425_add_child(device_t dev, int order } static int -ixp425_read_ivar(device_t bus, device_t child, int which, u_char *result) +ixp425_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { struct ixp425_ivar *ivar = IXP425_IVAR(child); Modified: head/sys/arm/xscale/ixp425/ixp425_iic.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_iic.c Thu Jun 11 17:03:28 2009 (r194014) +++ head/sys/arm/xscale/ixp425/ixp425_iic.c Thu Jun 11 17:05:13 2009 (r194015) @@ -95,7 +95,7 @@ ixpiic_attach(device_t dev) } static int -ixpiic_callback(device_t dev, int index, caddr_t *data) +ixpiic_callback(device_t dev, int index, caddr_t data) { return (0); } @@ -129,7 +129,7 @@ ixpiic_getsda(device_t dev) } static void -ixpiic_setsda(device_t dev, char val) +ixpiic_setsda(device_t dev, int val) { struct ixpiic_softc *sc = ixpiic_sc; @@ -144,7 +144,7 @@ ixpiic_setsda(device_t dev, char val) } static void -ixpiic_setscl(device_t dev, char val) +ixpiic_setscl(device_t dev, int val) { struct ixpiic_softc *sc = ixpiic_sc; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:05:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E24A61065680; Thu, 11 Jun 2009 17:05:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6CB28FC2B; Thu, 11 Jun 2009 17:05:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BH5juN053963; Thu, 11 Jun 2009 17:05:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH5j28053960; Thu, 11 Jun 2009 17:05:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111705.n5BH5j28053960@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:05: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: r194016 - in head/sys: dev/ksyms kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:05:46 -0000 Author: avg Date: Thu Jun 11 17:05:45 2009 New Revision: 194016 URL: http://svn.freebsd.org/changeset/base/194016 Log: strict kobj signatures: linker_if fixes in symtab_get method symtab parameter is made constant as this reflects actual intention and usage of the method Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/dev/ksyms/ksyms.c head/sys/kern/link_elf_obj.c head/sys/kern/linker_if.m Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Thu Jun 11 17:05:13 2009 (r194015) +++ head/sys/dev/ksyms/ksyms.c Thu Jun 11 17:05:45 2009 (r194016) @@ -129,7 +129,7 @@ static int ksyms_size_permod(linker_file_t lf, void *arg) { struct tsizes *ts; - Elf_Sym *symtab; + const Elf_Sym *symtab; caddr_t strtab; long syms; @@ -170,7 +170,8 @@ static int ksyms_add(linker_file_t lf, void *arg) { struct toffsets *to; - Elf_Sym *symtab, *symp; + const Elf_Sym *symtab; + Elf_Sym *symp; caddr_t strtab; long symsz; size_t strsz, numsyms; Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Thu Jun 11 17:05:13 2009 (r194015) +++ head/sys/kern/link_elf_obj.c Thu Jun 11 17:05:45 2009 (r194016) @@ -139,7 +139,7 @@ static int link_elf_each_function_nameva linker_function_nameval_callback_t, void *); static void link_elf_reloc_local(linker_file_t); -static long link_elf_symtab_get(linker_file_t, Elf_Sym **); +static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); static Elf_Addr elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int deps); @@ -1291,7 +1291,7 @@ link_elf_reloc_local(linker_file_t lf) } static long -link_elf_symtab_get(linker_file_t lf, Elf_Sym **symtab) +link_elf_symtab_get(linker_file_t lf, const Elf_Sym **symtab) { elf_file_t ef = (elf_file_t)lf; Modified: head/sys/kern/linker_if.m ============================================================================== --- head/sys/kern/linker_if.m Thu Jun 11 17:05:13 2009 (r194015) +++ head/sys/kern/linker_if.m Thu Jun 11 17:05:45 2009 (r194016) @@ -110,7 +110,7 @@ METHOD int ctf_get { # METHOD long symtab_get { linker_file_t file; - Elf_Sym **symtab; + const Elf_Sym **symtab; }; # From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:06:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F16E81065670; Thu, 11 Jun 2009 17:06:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF8F98FC27; Thu, 11 Jun 2009 17:06:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BH68iA054020; Thu, 11 Jun 2009 17:06:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH68sn054015; Thu, 11 Jun 2009 17:06:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111706.n5BH68sn054015@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194017 - head/sys/dev/agp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:06:09 -0000 Author: avg Date: Thu Jun 11 17:06:07 2009 New Revision: 194017 URL: http://svn.freebsd.org/changeset/base/194017 Log: strict kobj signatures: fixes in agp driver offset parameter has vm_offset_t type in calling code and in kobj method Reviewed by: imp, rnoland, lulf, current@ Approved by: jhb (mentor) Modified: head/sys/dev/agp/agp_ali.c head/sys/dev/agp/agp_amd.c head/sys/dev/agp/agp_ati.c head/sys/dev/agp/agp_nvidia.c head/sys/dev/agp/agp_sis.c Modified: head/sys/dev/agp/agp_ali.c ============================================================================== --- head/sys/dev/agp/agp_ali.c Thu Jun 11 17:05:45 2009 (r194016) +++ head/sys/dev/agp/agp_ali.c Thu Jun 11 17:06:07 2009 (r194017) @@ -206,11 +206,11 @@ agp_ali_set_aperture(device_t dev, u_int } static int -agp_ali_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_ali_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_ali_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; @@ -218,11 +218,11 @@ agp_ali_bind_page(device_t dev, int offs } static int -agp_ali_unbind_page(device_t dev, int offset) +agp_ali_unbind_page(device_t dev, vm_offset_t offset) { struct agp_ali_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; Modified: head/sys/dev/agp/agp_amd.c ============================================================================== --- head/sys/dev/agp/agp_amd.c Thu Jun 11 17:05:45 2009 (r194016) +++ head/sys/dev/agp/agp_amd.c Thu Jun 11 17:06:07 2009 (r194017) @@ -342,11 +342,11 @@ agp_amd_set_aperture(device_t dev, u_int } static int -agp_amd_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_amd_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_amd_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1; @@ -357,11 +357,11 @@ agp_amd_bind_page(device_t dev, int offs } static int -agp_amd_unbind_page(device_t dev, int offset) +agp_amd_unbind_page(device_t dev, vm_offset_t offset) { struct agp_amd_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; Modified: head/sys/dev/agp/agp_ati.c ============================================================================== --- head/sys/dev/agp/agp_ati.c Thu Jun 11 17:05:45 2009 (r194016) +++ head/sys/dev/agp/agp_ati.c Thu Jun 11 17:06:07 2009 (r194017) @@ -315,11 +315,11 @@ agp_ati_set_aperture(device_t dev, u_int } static int -agp_ati_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_ati_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_ati_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1; @@ -328,11 +328,11 @@ agp_ati_bind_page(device_t dev, int offs } static int -agp_ati_unbind_page(device_t dev, int offset) +agp_ati_unbind_page(device_t dev, vm_offset_t offset) { struct agp_ati_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; Modified: head/sys/dev/agp/agp_nvidia.c ============================================================================== --- head/sys/dev/agp/agp_nvidia.c Thu Jun 11 17:05:45 2009 (r194016) +++ head/sys/dev/agp/agp_nvidia.c Thu Jun 11 17:06:07 2009 (r194017) @@ -90,8 +90,8 @@ static int agp_nvidia_attach(device_t); static int agp_nvidia_detach(device_t); static u_int32_t agp_nvidia_get_aperture(device_t); static int agp_nvidia_set_aperture(device_t, u_int32_t); -static int agp_nvidia_bind_page(device_t, int, vm_offset_t); -static int agp_nvidia_unbind_page(device_t, int); +static int agp_nvidia_bind_page(device_t, vm_offset_t, vm_offset_t); +static int agp_nvidia_unbind_page(device_t, vm_offset_t); static int nvidia_init_iorr(u_int32_t, u_int32_t); @@ -312,12 +312,12 @@ agp_nvidia_set_aperture(device_t dev, u_ } static int -agp_nvidia_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_nvidia_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_nvidia_softc *sc = device_get_softc(dev); u_int32_t index; - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return (EINVAL); index = (sc->pg_offset + offset) >> AGP_PAGE_SHIFT; @@ -327,12 +327,12 @@ agp_nvidia_bind_page(device_t dev, int o } static int -agp_nvidia_unbind_page(device_t dev, int offset) +agp_nvidia_unbind_page(device_t dev, vm_offset_t offset) { struct agp_nvidia_softc *sc = device_get_softc(dev); u_int32_t index; - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return (EINVAL); index = (sc->pg_offset + offset) >> AGP_PAGE_SHIFT; @@ -341,8 +341,8 @@ agp_nvidia_unbind_page(device_t dev, int return (0); } -static int -agp_nvidia_flush_tlb (device_t dev, int offset) +static void +agp_nvidia_flush_tlb (device_t dev) { struct agp_nvidia_softc *sc; u_int32_t wbc_reg, temp; @@ -378,8 +378,6 @@ agp_nvidia_flush_tlb (device_t dev, int temp = ag_virtual[i * PAGE_SIZE / sizeof(u_int32_t)]; for(i = 0; i < pages; i++) temp = ag_virtual[i * PAGE_SIZE / sizeof(u_int32_t)]; - - return (0); } #define SYSCFG 0xC0010010 Modified: head/sys/dev/agp/agp_sis.c ============================================================================== --- head/sys/dev/agp/agp_sis.c Thu Jun 11 17:05:45 2009 (r194016) +++ head/sys/dev/agp/agp_sis.c Thu Jun 11 17:06:07 2009 (r194017) @@ -227,11 +227,11 @@ agp_sis_set_aperture(device_t dev, u_int } static int -agp_sis_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_sis_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_sis_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; @@ -239,11 +239,11 @@ agp_sis_bind_page(device_t dev, int offs } static int -agp_sis_unbind_page(device_t dev, int offset) +agp_sis_unbind_page(device_t dev, vm_offset_t offset) { struct agp_sis_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:06:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 526041065673; Thu, 11 Jun 2009 17:06:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28A6F8FC0C; Thu, 11 Jun 2009 17:06:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BH6WnR054069; Thu, 11 Jun 2009 17:06:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH6W0P054067; Thu, 11 Jun 2009 17:06:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111706.n5BH6W0P054067@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:06: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: r194018 - in head/sys/i386: include pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:06:33 -0000 Author: avg Date: Thu Jun 11 17:06:31 2009 New Revision: 194018 URL: http://svn.freebsd.org/changeset/base/194018 Log: strict kobj signatures: fix legacy i386 pcib_write_config impl Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/i386/include/legacyvar.h head/sys/i386/pci/pci_bus.c Modified: head/sys/i386/include/legacyvar.h ============================================================================== --- head/sys/i386/include/legacyvar.h Thu Jun 11 17:06:07 2009 (r194017) +++ head/sys/i386/include/legacyvar.h Thu Jun 11 17:06:31 2009 (r194018) @@ -43,12 +43,12 @@ LEGACY_ACCESSOR(pcibus, PCIBUS, uint3 #undef LEGACY_ACCESSOR int legacy_pcib_maxslots(device_t dev); -uint32_t legacy_pcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes); +uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes); int legacy_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); -void legacy_pcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes); +void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, u_int32_t data, int bytes); int legacy_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child, Modified: head/sys/i386/pci/pci_bus.c ============================================================================== --- head/sys/i386/pci/pci_bus.c Thu Jun 11 17:06:07 2009 (r194017) +++ head/sys/i386/pci/pci_bus.c Thu Jun 11 17:06:31 2009 (r194018) @@ -62,8 +62,8 @@ legacy_pcib_maxslots(device_t dev) /* read configuration space register */ u_int32_t -legacy_pcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes) +legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) { return(pci_cfgregread(bus, slot, func, reg, bytes)); } @@ -71,8 +71,8 @@ legacy_pcib_read_config(device_t dev, in /* write configuration space register */ void -legacy_pcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes) +legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, u_int32_t data, int bytes) { pci_cfgregwrite(bus, slot, func, reg, data, bytes); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:06:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70963106574E; Thu, 11 Jun 2009 17:06:45 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45D758FC17; Thu, 11 Jun 2009 17:06:45 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BH6jZk054112; Thu, 11 Jun 2009 17:06:45 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH6jq3054111; Thu, 11 Jun 2009 17:06:45 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200906111706.n5BH6jq3054111@svn.freebsd.org> From: Paul Saab Date: Thu, 11 Jun 2009 17:06: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: r194019 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:06:46 -0000 Author: ps Date: Thu Jun 11 17:06:45 2009 New Revision: 194019 URL: http://svn.freebsd.org/changeset/base/194019 Log: Stop asserting on exclusive locks in fsync since it can now support shared vnode locking on ZFS. Reviewed by: jhb Modified: head/sys/kern/vnode_if.src Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Thu Jun 11 17:06:31 2009 (r194018) +++ head/sys/kern/vnode_if.src Thu Jun 11 17:06:45 2009 (r194019) @@ -247,7 +247,7 @@ vop_revoke { }; -%% fsync vp E E E +%% fsync vp L L L vop_fsync { IN struct vnode *vp; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:06:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2440B1065755; Thu, 11 Jun 2009 17:06:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12D748FC22; Thu, 11 Jun 2009 17:06:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BH6wUl054156; Thu, 11 Jun 2009 17:06:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH6wk5054153; Thu, 11 Jun 2009 17:06:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111706.n5BH6wk5054153@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:06: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: r194020 - in head/sys/dev: eisa mca spibus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:06:59 -0000 Author: avg Date: Thu Jun 11 17:06:58 2009 New Revision: 194020 URL: http://svn.freebsd.org/changeset/base/194020 Log: strict kobj signatures: fix assortment of bus_read_ivar impls Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/dev/eisa/eisaconf.c head/sys/dev/mca/mca_bus.c head/sys/dev/spibus/spibus.c Modified: head/sys/dev/eisa/eisaconf.c ============================================================================== --- head/sys/dev/eisa/eisaconf.c Thu Jun 11 17:06:45 2009 (r194019) +++ head/sys/dev/eisa/eisaconf.c Thu Jun 11 17:06:58 2009 (r194020) @@ -315,7 +315,7 @@ eisa_find_ioaddr(struct eisa_device *e_d } static int -eisa_read_ivar(device_t dev, device_t child, int which, u_long *result) +eisa_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct eisa_device *e_dev = device_get_ivars(child); struct irq_node *irq; Modified: head/sys/dev/mca/mca_bus.c ============================================================================== --- head/sys/dev/mca/mca_bus.c Thu Jun 11 17:06:45 2009 (r194019) +++ head/sys/dev/mca/mca_bus.c Thu Jun 11 17:06:58 2009 (r194020) @@ -432,7 +432,7 @@ mca_probe_nomatch (device_t dev, device_ } static int -mca_read_ivar (device_t dev, device_t child, int which, u_long * result) +mca_read_ivar (device_t dev, device_t child, int which, uintptr_t * result) { struct mca_device * m_dev = device_get_ivars(child); Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Thu Jun 11 17:06:45 2009 (r194019) +++ head/sys/dev/spibus/spibus.c Thu Jun 11 17:06:58 2009 (r194020) @@ -112,7 +112,7 @@ spibus_child_pnpinfo_str(device_t bus, d } static int -spibus_read_ivar(device_t bus, device_t child, int which, u_char *result) +spibus_read_ivar(device_t bus, device_t child, int which, u_int *result) { struct spibus_ivar *devi = SPIBUS_IVAR(child); From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:09:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCBCE1065739; Thu, 11 Jun 2009 17:09:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBB788FC15; Thu, 11 Jun 2009 17:09:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BH9dm7054275; Thu, 11 Jun 2009 17:09:39 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BH9dA9054274; Thu, 11 Jun 2009 17:09:39 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906111709.n5BH9dA9054274@svn.freebsd.org> From: Sam Leffler Date: Thu, 11 Jun 2009 17:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194021 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:09:40 -0000 Author: sam Date: Thu Jun 11 17:09:39 2009 New Revision: 194021 URL: http://svn.freebsd.org/changeset/base/194021 Log: use negotiated short gi to calculate the tx rate; using the htcaps does not take into account local state (e.g. manual disable of sgi) Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Jun 11 17:06:58 2009 (r194020) +++ head/sys/net80211/ieee80211_ioctl.c Thu Jun 11 17:09:39 2009 (r194021) @@ -403,12 +403,12 @@ get_sta_info(void *arg, struct ieee80211 const struct ieee80211_mcs_rates *mcs = &ieee80211_htrates[ni->ni_txrate &~ IEEE80211_RATE_MCS]; if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { - if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) + if (ni->ni_flags & IEEE80211_NODE_SGI40) si->isi_txmbps = mcs->ht40_rate_800ns; else si->isi_txmbps = mcs->ht40_rate_400ns; } else { - if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) + if (ni->ni_flags & IEEE80211_NODE_SGI20) si->isi_txmbps = mcs->ht20_rate_800ns; else si->isi_txmbps = mcs->ht20_rate_400ns; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:10:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9514B106564A; Thu, 11 Jun 2009 17:10:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 846858FC12; Thu, 11 Jun 2009 17:10:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BHALg5054346; Thu, 11 Jun 2009 17:10:21 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHALgK054345; Thu, 11 Jun 2009 17:10:21 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906111710.n5BHALgK054345@svn.freebsd.org> From: Sam Leffler Date: Thu, 11 Jun 2009 17:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194022 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:10:22 -0000 Author: sam Date: Thu Jun 11 17:10:21 2009 New Revision: 194022 URL: http://svn.freebsd.org/changeset/base/194022 Log: make implicit pad visible Modified: head/sys/net80211/_ieee80211.h Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Thu Jun 11 17:09:39 2009 (r194021) +++ head/sys/net80211/_ieee80211.h Thu Jun 11 17:10:21 2009 (r194022) @@ -389,6 +389,7 @@ struct ieee80211_regdomain { struct ieee80211_mimo_info { int8_t rssi[3]; /* per-antenna rssi */ int8_t noise[3]; /* per-antenna noise floor */ + uint8_t pad[2]; uint32_t evm[3]; /* EVM data */ }; #endif /* _NET80211__IEEE80211_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:14:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6867910656C0; Thu, 11 Jun 2009 17:14:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5606A8FC16; Thu, 11 Jun 2009 17:14:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BHETWg054514; Thu, 11 Jun 2009 17:14:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHESUV054502; Thu, 11 Jun 2009 17:14:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111714.n5BHESUV054502@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194023 - in head/sys/dev: ncv nsp pdq snc stg ubsec wb wi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:14:30 -0000 Author: avg Date: Thu Jun 11 17:14:28 2009 New Revision: 194023 URL: http://svn.freebsd.org/changeset/base/194023 Log: strict kobj sigs: fix assortment of device_detach and device_shutdown impls with common issue of having void return type instead of int Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/dev/ncv/ncr53c500_pccard.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/pdq/if_fpa.c head/sys/dev/snc/if_snc.c head/sys/dev/snc/if_sncvar.h head/sys/dev/stg/tmc18c30.h head/sys/dev/stg/tmc18c30_subr.c head/sys/dev/ubsec/ubsec.c head/sys/dev/wb/if_wb.c head/sys/dev/wi/if_wi.c head/sys/dev/wi/if_wivar.h Modified: head/sys/dev/ncv/ncr53c500_pccard.c ============================================================================== --- head/sys/dev/ncv/ncr53c500_pccard.c Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/ncv/ncr53c500_pccard.c Thu Jun 11 17:14:28 2009 (r194023) @@ -260,11 +260,13 @@ ncv_pccard_attach(device_t dev) return(0); } -static void +static int ncv_pccard_detach(device_t dev) { ncv_card_unload(dev); ncv_release_resource(dev); + + return (0); } static device_method_t ncv_pccard_methods[] = { Modified: head/sys/dev/nsp/nsp_pccard.c ============================================================================== --- head/sys/dev/nsp/nsp_pccard.c Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/nsp/nsp_pccard.c Thu Jun 11 17:14:28 2009 (r194023) @@ -200,11 +200,13 @@ nsp_pccard_attach(device_t dev) return(0); } -static void +static int nsp_pccard_detach(device_t dev) { nsp_card_unload(dev); nsp_release_resource(dev); + + return (0); } static device_method_t nsp_pccard_methods[] = { Modified: head/sys/dev/pdq/if_fpa.c ============================================================================== --- head/sys/dev/pdq/if_fpa.c Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/pdq/if_fpa.c Thu Jun 11 17:14:28 2009 (r194023) @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); static int pdq_pci_probe (device_t); static int pdq_pci_attach (device_t); static int pdq_pci_detach (device_t); -static void pdq_pci_shutdown (device_t); +static int pdq_pci_shutdown (device_t); static void pdq_pci_ifintr (void *); static void @@ -185,7 +185,7 @@ pdq_pci_detach (dev) return (0); } -static void +static int pdq_pci_shutdown(device_t dev) { pdq_softc_t *sc; @@ -193,7 +193,7 @@ pdq_pci_shutdown(device_t dev) sc = device_get_softc(dev); pdq_hwreset(sc->sc_pdq); - return; + return (0); } static device_method_t pdq_pci_methods[] = { Modified: head/sys/dev/snc/if_snc.c ============================================================================== --- head/sys/dev/snc/if_snc.c Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/snc/if_snc.c Thu Jun 11 17:14:28 2009 (r194023) @@ -252,7 +252,7 @@ snc_attach(dev) Shutdown routine ****************************************************************/ -void +int snc_shutdown(dev) device_t dev; { @@ -261,4 +261,6 @@ snc_shutdown(dev) SNC_LOCK(sc); sncshutdown(sc); SNC_UNLOCK(sc); + + return (0); } Modified: head/sys/dev/snc/if_sncvar.h ============================================================================== --- head/sys/dev/snc/if_sncvar.h Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/snc/if_sncvar.h Thu Jun 11 17:14:28 2009 (r194023) @@ -44,4 +44,4 @@ int snc_alloc_irq (device_t, int, int); int snc_probe (device_t, int); int snc_attach (device_t); -void snc_shutdown (device_t); +int snc_shutdown (device_t); Modified: head/sys/dev/stg/tmc18c30.h ============================================================================== --- head/sys/dev/stg/tmc18c30.h Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/stg/tmc18c30.h Thu Jun 11 17:14:28 2009 (r194023) @@ -8,5 +8,5 @@ int stg_alloc_resource (device_t); void stg_release_resource (device_t); int stg_probe (device_t); int stg_attach (device_t); -void stg_detach (device_t); +int stg_detach (device_t); void stg_intr (void *); Modified: head/sys/dev/stg/tmc18c30_subr.c ============================================================================== --- head/sys/dev/stg/tmc18c30_subr.c Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/stg/tmc18c30_subr.c Thu Jun 11 17:14:28 2009 (r194023) @@ -162,7 +162,7 @@ stg_attach(device_t dev) return(STGIOSZ); } -void +int stg_detach (device_t dev) { struct stg_softc *sc = device_get_softc(dev); @@ -173,7 +173,7 @@ stg_detach (device_t dev) scsi_low_dettach(&sc->sc_sclow); splx(s); stg_release_resource(dev); - return; + return (0); } void Modified: head/sys/dev/ubsec/ubsec.c ============================================================================== --- head/sys/dev/ubsec/ubsec.c Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/ubsec/ubsec.c Thu Jun 11 17:14:28 2009 (r194023) @@ -107,7 +107,7 @@ static int ubsec_attach(device_t); static int ubsec_detach(device_t); static int ubsec_suspend(device_t); static int ubsec_resume(device_t); -static void ubsec_shutdown(device_t); +static int ubsec_shutdown(device_t); static int ubsec_newsession(device_t, u_int32_t *, struct cryptoini *); static int ubsec_freesession(device_t, u_int64_t); @@ -558,12 +558,13 @@ ubsec_detach(device_t dev) * Stop all chip i/o so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int ubsec_shutdown(device_t dev) { #ifdef notyet ubsec_stop(device_get_softc(dev)); #endif + return (0); } /* Modified: head/sys/dev/wb/if_wb.c ============================================================================== --- head/sys/dev/wb/if_wb.c Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/wb/if_wb.c Thu Jun 11 17:14:28 2009 (r194023) @@ -159,7 +159,7 @@ static void wb_init(void *); static void wb_init_locked(struct wb_softc *); static void wb_stop(struct wb_softc *); static void wb_watchdog(struct ifnet *); -static void wb_shutdown(device_t); +static int wb_shutdown(device_t); static int wb_ifmedia_upd(struct ifnet *); static void wb_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -1832,7 +1832,7 @@ wb_stop(sc) * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int wb_shutdown(dev) device_t dev; { @@ -1844,5 +1844,5 @@ wb_shutdown(dev) wb_stop(sc); WB_UNLOCK(sc); - return; + return (0); } Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/wi/if_wi.c Thu Jun 11 17:14:28 2009 (r194023) @@ -571,12 +571,13 @@ wi_vap_delete(struct ieee80211vap *vap) free(wvp, M_80211_VAP); } -void +int wi_shutdown(device_t dev) { struct wi_softc *sc = device_get_softc(dev); wi_stop(sc, 1); + return (0); } void Modified: head/sys/dev/wi/if_wivar.h ============================================================================== --- head/sys/dev/wi/if_wivar.h Thu Jun 11 17:10:21 2009 (r194022) +++ head/sys/dev/wi/if_wivar.h Thu Jun 11 17:14:28 2009 (r194023) @@ -176,7 +176,7 @@ struct wi_card_ident { int wi_attach(device_t); int wi_detach(device_t); -void wi_shutdown(device_t); +int wi_shutdown(device_t); int wi_alloc(device_t, int); void wi_free(device_t); extern devclass_t wi_devclass; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:14:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FB8E10656CC; Thu, 11 Jun 2009 17:14:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4419D8FC15; Thu, 11 Jun 2009 17:14:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BHEtiU054566; Thu, 11 Jun 2009 17:14:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHEtEQ054563; Thu, 11 Jun 2009 17:14:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111714.n5BHEtEQ054563@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:14: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: r194024 - in head/sys/dev: mge smc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:14:55 -0000 Author: avg Date: Thu Jun 11 17:14:54 2009 New Revision: 194024 URL: http://svn.freebsd.org/changeset/base/194024 Log: strict kobj signatures: fix assortment of miibus_writereg impls return type should be int, not void Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/dev/mge/if_mge.c head/sys/dev/smc/if_smc.c head/sys/dev/smc/if_smcvar.h Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Thu Jun 11 17:14:28 2009 (r194023) +++ head/sys/dev/mge/if_mge.c Thu Jun 11 17:14:54 2009 (r194024) @@ -88,7 +88,7 @@ static int mge_suspend(device_t dev); static int mge_resume(device_t dev); static int mge_miibus_readreg(device_t dev, int phy, int reg); -static void mge_miibus_writereg(device_t dev, int phy, int reg, int value); +static int mge_miibus_writereg(device_t dev, int phy, int reg, int value); static int mge_ifmedia_upd(struct ifnet *ifp); static void mge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); @@ -1287,13 +1287,13 @@ mge_miibus_readreg(device_t dev, int phy return (MGE_READ(sc_mge0, MGE_REG_SMI) & 0xffff); } -static void +static int mge_miibus_writereg(device_t dev, int phy, int reg, int value) { uint32_t retries; if ((MV_PHY_ADDR_BASE + device_get_unit(dev)) != phy) - return; + return (0); MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_WRITE | (reg << 21) | (phy << 16) | (value & 0xffff))); @@ -1304,6 +1304,7 @@ mge_miibus_writereg(device_t dev, int ph if (retries == 0) device_printf(dev, "Timeout while writing to PHY\n"); + return (0); } static int Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Thu Jun 11 17:14:28 2009 (r194023) +++ head/sys/dev/smc/if_smc.c Thu Jun 11 17:14:54 2009 (r194024) @@ -999,7 +999,7 @@ smc_miibus_readreg(device_t dev, int phy return (val); } -void +int smc_miibus_writereg(device_t dev, int phy, int reg, int data) { struct smc_softc *sc; @@ -1029,6 +1029,7 @@ smc_miibus_writereg(device_t dev, int ph smc_read_2(sc, MGMT) & ~(MGMT_MCLK | MGMT_MDOE | MGMT_MDO)); SMC_UNLOCK(sc); + return (0); } void Modified: head/sys/dev/smc/if_smcvar.h ============================================================================== --- head/sys/dev/smc/if_smcvar.h Thu Jun 11 17:14:28 2009 (r194023) +++ head/sys/dev/smc/if_smcvar.h Thu Jun 11 17:14:54 2009 (r194024) @@ -71,7 +71,7 @@ int smc_attach(device_t); int smc_detach(device_t); int smc_miibus_readreg(device_t, int, int); -void smc_miibus_writereg(device_t, int, int, int); +int smc_miibus_writereg(device_t, int, int, int); void smc_miibus_statchg(device_t); #endif /* _IF_SMCVAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:15:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4A311065670; Thu, 11 Jun 2009 17:15:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 787048FC20; Thu, 11 Jun 2009 17:15:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BHFK9R054632; Thu, 11 Jun 2009 17:15:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHFKHH054630; Thu, 11 Jun 2009 17:15:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111715.n5BHFKHH054630@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194025 - in head/sys: dev/ofw powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:15:21 -0000 Author: avg Date: Thu Jun 11 17:15:20 2009 New Revision: 194025 URL: http://svn.freebsd.org/changeset/base/194025 Log: strict kobj signatures: some ofw_setprop fixes propname parameter is const Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/dev/ofw/ofw_standard.c head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/dev/ofw/ofw_standard.c ============================================================================== --- head/sys/dev/ofw/ofw_standard.c Thu Jun 11 17:14:54 2009 (r194024) +++ head/sys/dev/ofw/ofw_standard.c Thu Jun 11 17:15:20 2009 (r194025) @@ -83,8 +83,8 @@ static ssize_t ofw_std_getprop(ofw_t ofw const char *propname, void *buf, size_t buflen); static int ofw_std_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, size_t); -static int ofw_std_setprop(ofw_t ofw, phandle_t package, char *propname, - void *buf, size_t len); +static int ofw_std_setprop(ofw_t ofw, phandle_t package, const char *propname, + const void *buf, size_t len); static ssize_t ofw_std_canon(ofw_t ofw, const char *device, char *buf, size_t len); static phandle_t ofw_std_finddevice(ofw_t ofw, const char *device); @@ -383,8 +383,8 @@ ofw_std_nextprop(ofw_t ofw, phandle_t pa /* Set the value of a property of a package. */ /* XXX Has a bug on FirePower */ static int -ofw_std_setprop(ofw_t ofw, phandle_t package, char *propname, void *buf, - size_t len) +ofw_std_setprop(ofw_t ofw, phandle_t package, const char *propname, + const void *buf, size_t len) { static struct { cell_t name; Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Thu Jun 11 17:14:54 2009 (r194024) +++ head/sys/powerpc/ofw/ofw_real.c Thu Jun 11 17:15:20 2009 (r194025) @@ -88,8 +88,8 @@ static ssize_t ofw_real_getprop(ofw_t, p void *buf, size_t buflen); static int ofw_real_nextprop(ofw_t, phandle_t package, const char *previous, char *buf, size_t); -static int ofw_real_setprop(ofw_t, phandle_t package, char *propname, - void *buf, size_t len); +static int ofw_real_setprop(ofw_t, phandle_t package, const char *propname, + const void *buf, size_t len); static ssize_t ofw_real_canon(ofw_t, const char *device, char *buf, size_t len); static phandle_t ofw_real_finddevice(ofw_t, const char *device); static ssize_t ofw_real_instance_to_path(ofw_t, ihandle_t instance, char *buf, @@ -490,8 +490,8 @@ ofw_real_nextprop(ofw_t ofw, phandle_t p /* Set the value of a property of a package. */ /* XXX Has a bug on FirePower */ static int -ofw_real_setprop(ofw_t ofw, phandle_t package, char *propname, void *buf, - size_t len) +ofw_real_setprop(ofw_t ofw, phandle_t package, const char *propname, + const void *buf, size_t len) { static struct { cell_t name; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:15:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B38F1065672; Thu, 11 Jun 2009 17:15:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFA568FC19; Thu, 11 Jun 2009 17:15:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BHFiIq054682; Thu, 11 Jun 2009 17:15:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHFiPE054680; Thu, 11 Jun 2009 17:15:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111715.n5BHFiPE054680@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194026 - head/sys/dev/pcf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:15:46 -0000 Author: avg Date: Thu Jun 11 17:15:44 2009 New Revision: 194026 URL: http://svn.freebsd.org/changeset/base/194026 Log: strict kobj signatures: fix iicbus_write impl in dev/pcf input buf is const Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/dev/pcf/pcf.c head/sys/dev/pcf/pcfvar.h Modified: head/sys/dev/pcf/pcf.c ============================================================================== --- head/sys/dev/pcf/pcf.c Thu Jun 11 17:15:20 2009 (r194025) +++ head/sys/dev/pcf/pcf.c Thu Jun 11 17:15:44 2009 (r194026) @@ -378,7 +378,7 @@ pcf_rst_card(device_t dev, u_char speed, } int -pcf_write(device_t dev, char *buf, int len, int *sent, int timeout /* us */) +pcf_write(device_t dev, const char *buf, int len, int *sent, int timeout /* us */) { struct pcf_softc *sc = DEVTOSOFTC(dev); int bytes, error = 0; Modified: head/sys/dev/pcf/pcfvar.h ============================================================================== --- head/sys/dev/pcf/pcfvar.h Thu Jun 11 17:15:20 2009 (r194025) +++ head/sys/dev/pcf/pcfvar.h Thu Jun 11 17:15:44 2009 (r194026) @@ -135,7 +135,7 @@ pcf_get_S1(struct pcf_softc *sc) extern int pcf_repeated_start(device_t, u_char, int); extern int pcf_start(device_t, u_char, int); extern int pcf_stop(device_t); -extern int pcf_write(device_t, char *, int, int *, int); +extern int pcf_write(device_t, const char *, int, int *, int); extern int pcf_read(device_t, char *, int, int *, int, int); extern int pcf_rst_card(device_t, u_char, u_char, u_char *); extern driver_intr_t pcf_intr; From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:16:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A28661065705; Thu, 11 Jun 2009 17:16:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76DCF8FC25; Thu, 11 Jun 2009 17:16:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BHG454054735; Thu, 11 Jun 2009 17:16:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHG4NG054733; Thu, 11 Jun 2009 17:16:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111716.n5BHG4NG054733@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:16: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: r194027 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:16:05 -0000 Author: avg Date: Thu Jun 11 17:16:04 2009 New Revision: 194027 URL: http://svn.freebsd.org/changeset/base/194027 Log: strict kobj signatures: fix adb_hb_controller_poll impl in powermac the method return u_int, not void Reviewed by: imp, current@ Approved by: jhb (mentor) Modified: head/sys/powerpc/powermac/cuda.c head/sys/powerpc/powermac/pmu.c Modified: head/sys/powerpc/powermac/cuda.c ============================================================================== --- head/sys/powerpc/powermac/cuda.c Thu Jun 11 17:15:44 2009 (r194026) +++ head/sys/powerpc/powermac/cuda.c Thu Jun 11 17:16:04 2009 (r194027) @@ -68,7 +68,7 @@ static int cuda_detach(device_t); static u_int cuda_adb_send(device_t dev, u_char command_byte, int len, u_char *data, u_char poll); static u_int cuda_adb_autopoll(device_t dev, uint16_t mask); -static void cuda_poll(device_t dev); +static u_int cuda_poll(device_t dev); static void cuda_send_inbound(struct cuda_softc *sc); static void cuda_send_outbound(struct cuda_softc *sc); @@ -471,16 +471,17 @@ cuda_send_inbound(struct cuda_softc *sc) mtx_unlock(&sc->sc_mutex); } -static void +static u_int cuda_poll(device_t dev) { struct cuda_softc *sc = device_get_softc(dev); if (sc->sc_state == CUDA_IDLE && !cuda_intr_state(sc) && !sc->sc_waiting) - return; + return (0); cuda_intr(dev); + return (0); } static void Modified: head/sys/powerpc/powermac/pmu.c ============================================================================== --- head/sys/powerpc/powermac/pmu.c Thu Jun 11 17:15:44 2009 (r194026) +++ head/sys/powerpc/powermac/pmu.c Thu Jun 11 17:16:04 2009 (r194027) @@ -68,7 +68,7 @@ static int pmu_detach(device_t); static u_int pmu_adb_send(device_t dev, u_char command_byte, int len, u_char *data, u_char poll); static u_int pmu_adb_autopoll(device_t dev, uint16_t mask); -static void pmu_poll(device_t dev); +static u_int pmu_poll(device_t dev); static void pmu_set_sleepled(void *xsc, int onoff); static int pmu_server_mode(SYSCTL_HANDLER_ARGS); @@ -575,10 +575,11 @@ done: } -static void +static u_int pmu_poll(device_t dev) { pmu_intr(dev); + return (0); } static void From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:21:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C81B0106564A; Thu, 11 Jun 2009 17:21:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6A328FC1A; Thu, 11 Jun 2009 17:21:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BHLEUj054928; Thu, 11 Jun 2009 17:21:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHLEv8054927; Thu, 11 Jun 2009 17:21:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111721.n5BHLEv8054927@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 17:21: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: r194028 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:21:15 -0000 Author: avg Date: Thu Jun 11 17:21:14 2009 New Revision: 194028 URL: http://svn.freebsd.org/changeset/base/194028 Log: KOBJMETHOD: use better construct in the checking version of the macro Big thanks to Christoph Mallon for the idea/code! This construct has benefit of sticking much stricter to C standard and thus keeping more compilers happy as Clang doesn't like the current construct because it doesn't treat FUNC != NULL as a compile-time constant. The checking version is still under 'notyet'. Pointed out by: ed Submitted by: Christoph Mallon Clang help by: rdivacky Reviewed by: imp Approved by: jhb Modified: head/sys/sys/kobj.h Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Thu Jun 11 17:16:04 2009 (r194027) +++ head/sys/sys/kobj.h Thu Jun 11 17:21:14 2009 (r194028) @@ -96,7 +96,7 @@ struct kobjop_desc { #define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC } #else /* notyet */ #define KOBJMETHOD(NAME, FUNC) \ -{ &NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) } + { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } #endif /* From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 17:42:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DC8D106564A; Thu, 11 Jun 2009 17:42:02 +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 5CA428FC13; Thu, 11 Jun 2009 17:42:02 +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 n5BHg2mv055479; Thu, 11 Jun 2009 17:42:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BHg28U055477; Thu, 11 Jun 2009 17:42:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906111742.n5BHg28U055477@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 11 Jun 2009 17:42: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: r194029 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 17:42:02 -0000 Author: jkim Date: Thu Jun 11 17:42:02 2009 New Revision: 194029 URL: http://svn.freebsd.org/changeset/base/194029 Log: ko_KR: AM/PM date format should be localized. Inspired by: r193869 Modified: head/share/timedef/ko_KR.UTF-8.src head/share/timedef/ko_KR.eucKR.src Modified: head/share/timedef/ko_KR.UTF-8.src ============================================================================== --- head/share/timedef/ko_KR.UTF-8.src Thu Jun 11 17:21:14 2009 (r194028) +++ head/share/timedef/ko_KR.UTF-8.src Thu Jun 11 17:42:02 2009 (r194029) @@ -71,13 +71,11 @@ # # am # -#오전 -AM +오전 # # pm # -#오후 -PM +오후 # # date_fmt # Modified: head/share/timedef/ko_KR.eucKR.src ============================================================================== --- head/share/timedef/ko_KR.eucKR.src Thu Jun 11 17:21:14 2009 (r194028) +++ head/share/timedef/ko_KR.eucKR.src Thu Jun 11 17:42:02 2009 (r194029) @@ -71,13 +71,11 @@ # # am # -#¿ÀÀü -AM +¿ÀÀü # # pm # -#¿ÀÈÄ -PM +¿ÀÈÄ # # date_fmt # From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 18:04:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A6571065673; Thu, 11 Jun 2009 18:04:58 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02E128FC18; Thu, 11 Jun 2009 18:04:58 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BI4vAJ056002; Thu, 11 Jun 2009 18:04:57 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BI4v7c056000; Thu, 11 Jun 2009 18:04:57 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <200906111804.n5BI4v7c056000@svn.freebsd.org> From: Juli Mallett Date: Thu, 11 Jun 2009 18:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194030 - head/lib/libufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 18:04:58 -0000 Author: jmallett Date: Thu Jun 11 18:04:57 2009 New Revision: 194030 URL: http://svn.freebsd.org/changeset/base/194030 Log: Allow libufs(3) functions to operate on a regular file. This makes it possible to use almost anything that uses libufs(3) against a file as an unprivileged user, e.g. tunefs(8) and dumpfs(8) against a makefs(8)-created image. Prodded by: kensmith Modified: head/lib/libufs/type.c head/lib/libufs/ufs_disk_close.3 Modified: head/lib/libufs/type.c ============================================================================== --- head/lib/libufs/type.c Thu Jun 11 17:42:02 2009 (r194029) +++ head/lib/libufs/type.c Thu Jun 11 18:04:57 2009 (r194030) @@ -108,7 +108,10 @@ again: if ((ret = stat(name, &st)) < 0) */ name = oname; } - if (ret >= 0 && S_ISCHR(st.st_mode)) { + if (ret >= 0 && S_ISREG(st.st_mode)) { + /* Possibly a disk image, give it a try. */ + ; + } else if (ret >= 0 && S_ISCHR(st.st_mode)) { /* This is what we need, do nothing. */ ; } else if ((fs = getfsfile(name)) != NULL) { Modified: head/lib/libufs/ufs_disk_close.3 ============================================================================== --- head/lib/libufs/ufs_disk_close.3 Thu Jun 11 17:42:02 2009 (r194029) +++ head/lib/libufs/ufs_disk_close.3 Thu Jun 11 18:04:57 2009 (r194030) @@ -53,7 +53,7 @@ and populate the structure pointed to by The disk is opened read-only. The specified .Fa name -may be either a mountpoint, or a device name. +may be either a mountpoint, a device name or a filesystem image. The .Fn ufs_disk_fillout function assumes there is a valid superblock and will fail if not, From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 18:42:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5C61106566C; Thu, 11 Jun 2009 18:42:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C49648FC19; Thu, 11 Jun 2009 18:42:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BIgV9A057182; Thu, 11 Jun 2009 18:42:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BIgVvQ057181; Thu, 11 Jun 2009 18:42:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906111842.n5BIgVvQ057181@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Jun 2009 18:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194037 - head/usr.sbin/syslogd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 18:42:32 -0000 Author: avg Date: Thu Jun 11 18:42:31 2009 New Revision: 194037 URL: http://svn.freebsd.org/changeset/base/194037 Log: syslog.conf(5): correct example security.* and console.* are moved out of ftpd program block Approved by: jhb (mentor) MFC after: 2 weeks Modified: head/usr.sbin/syslogd/syslog.conf.5 Modified: head/usr.sbin/syslogd/syslog.conf.5 ============================================================================== --- head/usr.sbin/syslogd/syslog.conf.5 Thu Jun 11 18:39:31 2009 (r194036) +++ head/usr.sbin/syslogd/syslog.conf.5 Thu Jun 11 18:42:31 2009 (r194037) @@ -476,16 +476,16 @@ uucp,news.crit /var/log/spoolerr # Pipe all authentication messages to a filter. auth.* |exec /usr/local/sbin/authfilter -# Save ftpd transactions along with mail and news -!ftpd -*.* /var/log/spoolerr - # Log all security messages to a separate file. security.* /var/log/security # Log all writes to /dev/console to a separate file. console.* /var/log/console.log +# Save ftpd transactions along with mail and news +!ftpd +*.* /var/log/spoolerr + # Log ipfw messages without syncing after every message. !ipfw *.* -/var/log/ipfw From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 19:01:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 230971065676; Thu, 11 Jun 2009 19:01:46 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206192061.chello.pl [87.206.192.61]) by mx1.freebsd.org (Postfix) with ESMTP id 588378FC1A; Thu, 11 Jun 2009 19:01:45 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id E47B845DF4; Thu, 11 Jun 2009 21:01:43 +0200 (CEST) Received: from localhost (chello087206192061.chello.pl [87.206.192.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 2FC9845683; Thu, 11 Jun 2009 21:01:38 +0200 (CEST) Date: Thu, 11 Jun 2009 21:01:40 +0200 From: Pawel Jakub Dawidek To: Marko Zec Message-ID: <20090611190140.GE2642@garage.freebsd.pl> References: <200906111650.n5BGonnn053446@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Oiv9uiLrevHtW1RS" Content-Disposition: inline In-Reply-To: <200906111650.n5BGonnn053446@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 19:01:46 -0000 --Oiv9uiLrevHtW1RS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 11, 2009 at 04:50:49PM +0000, Marko Zec wrote: > Author: zec > Date: Thu Jun 11 16:50:49 2009 > New Revision: 194012 > URL: http://svn.freebsd.org/changeset/base/194012 >=20 > Log: > Introduce a mechanism for detecting calls from outbound path of the > network stack when reentering the inbound path from netgraph, and > force queueing of mbufs at the outbound netgraph node. > =20 > The mechanism relies on two components. First, in netgraph nodes > where outbound path of the network stack calls into netgraph, the > current thread has to be appropriately marked using the new > NG_OUTBOUND_THREAD_REF() macro before proceeding to call further > into the netgraph topology, and unmarked using the > NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. > Second, netgraph nodes which can potentially reenter the network > stack in the inbound path have to mark their inbound hooks using > NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will then > detect when there is a danger of a call graph looping back from > outbound to inbound path via netgraph, and defer handing off the > mbufs to the "inbound" node to a worker thread with a clean stack. > =20 > In this first pass only the most obvious netgraph nodes have been > updated to ensure no outbound to inbound calls can occur. Nodes > such as ng_ipfw, ng_gif etc. should be further examined whether a > potential for outbound to inbound call looping exists. > =20 > This commit changes the layout of struct thread, but due to > __FreeBSD_version number shortage a version bump has been omitted > at this time, nevertheless kernel and modules have to be rebuilt. Are you sure Marko that you can't use sys/sys/osd.h instead of adding yet another field to the thread structure? Netgraph is optional component and optional components could take advantage of allocating stuff they need dynamically. The OSD (Object-Specific Data) KPI is designed for use by optional components - you can add your data to a thread, you can get it when you want and OSD will call your callback when thread dies, so you can clean up. Maybe you can't, but it's worth checking. PS. Currently OSD works for threads and jails, but it is ready to be extended to work with other object types, eg. vnodes, ifnets, etc. Even if you can't use it in this particular case, keep it in mind, as it might be useful for other vimage-related stuff. > Modified: head/sys/sys/proc.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/proc.h Thu Jun 11 16:48:59 2009 (r194011) > +++ head/sys/sys/proc.h Thu Jun 11 16:50:49 2009 (r194012) > @@ -235,6 +235,7 @@ struct thread { > char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ > struct file *td_fpop; /* (k) file referencing cdev under op */ > int td_dbgflags; /* (c) Userland debugger flags */ > + int td_ng_outbound; /* (k) Thread entered ng from above. */ > struct osd td_osd; /* (k) Object specific data. */ > #define td_endzero td_base_pri --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --Oiv9uiLrevHtW1RS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKMVSUForvXbEpPzQRAsMjAKCbEhGZb8oJQW8pnH+7SeIdvxIMHgCdFMJk 7vPmgM/FftsNB4x1xL8yXHE= =kIBG -----END PGP SIGNATURE----- --Oiv9uiLrevHtW1RS-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 19:11:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3869E106566B; Thu, 11 Jun 2009 19:11:58 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id D245E8FC0A; Thu, 11 Jun 2009 19:11:56 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id C0AC1EB5714; Thu, 11 Jun 2009 22:11:55 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id AF05D4C8005; Thu, 11 Jun 2009 22:11:55 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wXErSIBhrhq8; Thu, 11 Jun 2009 22:11:55 +0300 (EEST) Received: from kobe.laptop (adsl16-200.kln.forthnet.gr [77.49.143.200]) by mail.ceid.upatras.gr (Postfix) with ESMTP id BA0714C8002; Thu, 11 Jun 2009 22:11:54 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n5BJBstM002855; Thu, 11 Jun 2009 22:11:54 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n5BJBsNd002854; Thu, 11 Jun 2009 22:11:54 +0300 (EEST) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Ariff Abdullah References: <200906071912.n57JC9GZ002423@svn.freebsd.org> Date: Thu, 11 Jun 2009 22:11:53 +0300 In-Reply-To: <200906071912.n57JC9GZ002423@svn.freebsd.org> (Ariff Abdullah's message of "Sun, 7 Jun 2009 19:12:09 +0000 (UTC)") Message-ID: <878wjya8li.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193640 - in head/sys: conf dev/sound dev/sound/isa dev/sound/macio dev/sound/midi dev/sound/pci dev/sound/pci/hda dev/sound/pcm dev/sound/sbus dev/sound/usb modules/sound/sound sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 19:11:58 -0000 On Sun, 7 Jun 2009 19:12:09 +0000 (UTC), Ariff Abdullah wrote: > Author: ariff > Date: Sun Jun 7 19:12:08 2009 > New Revision: 193640 > URL: http://svn.freebsd.org/changeset/base/193640 > > Log: > Sound Mega-commit. Expect further cleanup until code freeze. > > For a slightly thorough explaination, please refer to > [1] http://people.freebsd.org/~ariff/SOUND_4.TXT.html . > > Summary of changes includes: > > 1 Volume Per-Channel (vpc). Provides private / standalone volume control Hi Ariff, This seems to have broken sound on my Thinkpad X61s. I just build a userland and kernel from /head at rev 193984 and I have no sound at all, even though /dev/sndstat shows my sound card: $ cat /dev/sndstat FreeBSD Audio Driver (newpcm: 32bit 2009060800/i386) Installed devices: pcm0: at cad 0 nid 1 on hdac0 kld snd_hda [MPSAFE] (1p:1v/1r:1v channels duplex default) > Kernel hints: > - hint.pcm.%d.vpc (0 = disable vpc). Setting hint.pcm.0.vpc=0 didn't seem to bring back sound: > fgrep vpc /boot/loader.conf hint.pcm.0.vpc=0 I am trying to build a userland+kernel from svn rev 193639 to see if I can get back sound, but attached is a verbose dmesg from a recent kernel (rev 193984). Any ideas why the pcm0 device would show up in sndstat and mixer(1) but produce no sound at all? Copyright (c) 1992-2009 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.0-CURRENT #0 hg@7bf01b6b74e0: Thu Jun 11 16:02:37 EEST 2009 build@kobe:/usr/obj/usr/src/sys/KOBE WARNING: WITNESS option enabled, expect reduced performance. Preloaded elf kernel "/boot/kernel/kernel" at 0xc0e2b000. Preloaded elf module "/boot/kernel/geom_eli.ko" at 0xc0e2b248. Preloaded elf module "/boot/kernel/crypto.ko" at 0xc0e2b2f8. Preloaded elf module "/boot/kernel/zlib.ko" at 0xc0e2b3a4. Preloaded elf module "/boot/kernel/snd_hda.ko" at 0xc0e2b450. Preloaded elf module "/boot/kernel/sound.ko" at 0xc0e2b4fc. Preloaded elf module "/boot/kernel/acpi_ibm.ko" at 0xc0e2b5a8. Preloaded elf module "/boot/kernel/if_iwn.ko" at 0xc0e2b658. Timecounter "i8254" frequency 1193182 Hz quality 0 Calibrating TSC clock ... TSC clock: 1795515768 Hz CPU: Intel(R) Core(TM)2 Duo CPU L7700 @ 1.80GHz (1795.52-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x6fb Stepping = 11 Features=0xbfebfbff Features2=0xe3bd AMD Features=0x20100000 AMD Features2=0x1 TSC: P-state invariant Instruction TLB: 4 KB Pages, 4-way set associative, 128 entries 1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size 1st-level data cache: 32 KB, 8-way set associative, 64 byte line size L2 cache: 4096 kbytes, 16-way associative, 64 bytes/line real memory = 3221225472 (3072 MB) Physical memory chunk(s): 0x0000000000001000 - 0x000000000009cfff, 638976 bytes (156 pages) 0x0000000000100000 - 0x00000000003fffff, 3145728 bytes (768 pages) 0x0000000001025000 - 0x00000000bb3bafff, 3124322304 bytes (762774 pages) avail memory = 3122966528 (2978 MB) Table 'FACP' at 0xbe6bd600 Table 'SSDT' at 0xbe6bd7b4 Table 'ECDT' at 0xbe6cbbf3 Table 'TCPA' at 0xbe6cbc45 Table 'APIC' at 0xbe6cbc77 MADT: Found table at 0xbe6cbc77 MP Configuration Table version 1.4 found at 0xc009dca1 APIC: Using the MADT enumerator. MADT: Found CPU APIC ID 0 ACPI ID 0: enabled SMP: Added CPU 0 (AP) MADT: Found CPU APIC ID 1 ACPI ID 1: enabled SMP: Added CPU 1 (AP) ACPI APIC Table: INTR: Adding local APIC 1 as a target FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs FreeBSD/SMP: 1 package(s) x 2 core(s) cpu0 (BSP): APIC ID: 0 cpu1 (AP): APIC ID: 1 APIC: CPU 0 has ACPI ID 0 APIC: CPU 1 has ACPI ID 1 bios32: Found BIOS32 Service Directory header at 0xc00f6900 bios32: Entry = 0xfdc80 (c00fdc80) Rev = 0 Len = 1 pcibios: PCI BIOS entry at 0xfdc10+0x1b7 pnpbios: Found PnP BIOS data at 0xc00f69a0 pnpbios: Entry = f0000:b83b Rev = 1.0 Other BIOS signatures found: ULE: setup cpu 0 ULE: setup cpu 1 ACPI: RSDP 0xf6950 00024 (v2 LENOVO) ACPI: XSDT 0xbe6bd47a 0009C (v1 LENOVO TP-7N 00002140 LTP 00000000) ACPI: FACP 0xbe6bd600 000F4 (v3 LENOVO TP-7N 00002140 LNVO 00000001) ACPI Warning: 32/64X length mismatch in Gpe1Block: 0/32 20090521 tbfadt-625 ACPI Warning: Optional field Gpe1Block has zero address or length: 0 102C/0 20090521 tbfadt-655 ACPI: DSDT 0xbe6bd9db 0E218 (v1 LENOVO TP-7N 00002140 MSFT 03000000) ACPI: FACS 0xbe6e4000 00040 ACPI: SSDT 0xbe6bd7b4 00227 (v1 LENOVO TP-7N 00002140 MSFT 03000000) ACPI: ECDT 0xbe6cbbf3 00052 (v1 LENOVO TP-7N 00002140 LNVO 00000001) ACPI: TCPA 0xbe6cbc45 00032 (v2 LENOVO TP-7N 00002140 LNVO 00000001) ACPI: APIC 0xbe6cbc77 00068 (v1 LENOVO TP-7N 00002140 LNVO 00000001) ACPI: MCFG 0xbe6cbcdf 0003C (v1 LENOVO TP-7N 00002140 LNVO 00000001) ACPI: HPET 0xbe6cbd1b 00038 (v1 LENOVO TP-7N 00002140 LNVO 00000001) ACPI: SLIC 0xbe6cbdf0 00176 (v1 LENOVO TP-7N 00002140 LTP 00000000) ACPI: BOOT 0xbe6cbf66 00028 (v1 LENOVO TP-7N 00002140 LTP 00000001) ACPI: ASF! 0xbe6cbf8e 00072 (v16 LENOVO TP-7N 00002140 PTL 00000001) ACPI: SSDT 0xbe6e2697 0025F (v1 LENOVO TP-7N 00002140 INTL 20050513) ACPI: SSDT 0xbe6e28f6 000A6 (v1 LENOVO TP-7N 00002140 INTL 20050513) ACPI: SSDT 0xbe6e299c 004F7 (v1 LENOVO TP-7N 00002140 INTL 20050513) ACPI: SSDT 0xbe6e2e93 008BD (v1 LENOVO TP-7N 00002140 INTL 20050513) ACPI: SSDT 0xbe6e3750 0069C (v1 LENOVO TP-7N 00002140 INTL 20050513) MADT: Found IO APIC ID 1, Interrupt 0 at 0xfec00000 ioapic0: Changing APIC ID to 1 ioapic0: Routing external 8259A's -> intpin 0 MADT: Interrupt override: source 0, irq 2 ioapic0: Routing IRQ 0 -> intpin 2 MADT: Interrupt override: source 9, irq 9 ioapic0: intpin 9 trigger: level lapic0: Routing NMI -> LINT1 lapic0: LINT1 trigger: edge lapic0: LINT1 polarity: high lapic1: Routing NMI -> LINT1 lapic1: LINT1 trigger: edge lapic1: LINT1 polarity: high ioapic0 irqs 0-23 on motherboard cpu0 BSP: ID: 0x00000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000100ef therm: 0x00010000 err: 0x00010000 pcm: 0x00000400 snd_unit_init() u=0x00ff8000 [512] d=0x00007c00 [32] c=0x000003ff [1024] feeder_register: snd_unit=-1 snd_maxautovchans=16 latency=5 feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25 wlan: <802.11 Link Layer> null: nfslock: pseudo-device random: io: kbd: new array size 4 kbd1 at kbdmux0 mem: Pentium Pro MTRR support enabled crypto: npx0: INT 16 interface cryptosoft0: on motherboard crypto: assign cryptosoft0 driver id 0, flags 100663296 crypto: cryptosoft0 registers alg 1 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 2 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 3 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 4 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 5 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 16 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 6 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 7 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 18 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 19 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 20 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 8 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 15 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 9 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 10 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 13 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 14 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 11 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 21 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 17 flags 0 maxoplen 0 acpi0: on motherboard PCIe: Memory Mapped configuration base @ 0xf0000000 pcibios: BIOS version 3.00 ioapic0: routing intpin 9 (ISA IRQ 9) to lapic 0 vector 48 acpi0: [MPSAFE] acpi0: [ITHREAD] acpi_ec0: port 0x62,0x66 on acpi0 AcpiOsDerivePciId: \\_SB_.PCI0.MHCS -> bus 0 dev 0 func 0 AcpiOsDerivePciId: \\_SB_.PCI0.EHC0.U7CS -> bus 0 dev 29 func 7 AcpiOsDerivePciId: \\_SB_.PCI0.EHC1.U8CS -> bus 0 dev 26 func 7 acpi0: Power Button (fixed) acpi0: wakeup code va 0xc5f61000 pa 0x1000 AcpiOsDerivePciId: \\_SB_.PCI0.LPC_.LPCS -> bus 0 dev 31 func 0 acpi0: reservation of 0, a0000 (3) failed acpi0: reservation of 100000, bef00000 (3) failed ACPI timer: 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 -> 10 Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 pci_link0: Index IRQ Rtd Ref IRQs Initial Probe 0 10 N 0 3 4 5 6 7 9 10 11 Validation 0 10 N 0 3 4 5 6 7 9 10 11 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 pci_link1: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 Validation 0 11 N 0 3 4 5 6 7 9 10 11 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 pci_link2: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 Validation 0 11 N 0 3 4 5 6 7 9 10 11 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 pci_link3: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 Validation 0 11 N 0 3 4 5 6 7 9 10 11 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 pci_link4: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 Validation 0 11 N 0 3 4 5 6 7 9 10 11 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 pci_link5: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 Validation 0 11 N 0 3 4 5 6 7 9 10 11 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 pci_link6: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 Validation 0 11 N 0 3 4 5 6 7 9 10 11 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 pci_link7: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 Validation 0 11 N 0 3 4 5 6 7 9 10 11 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 acpi_hpet0: iomem 0xfed00000-0xfed003ff on acpi0 acpi_hpet0: vend: 0x8086 rev: 0x1 num: 2 hz: 14318180 opts: legacy_route 64-bit Timecounter "HPET" frequency 14318180 Hz quality 900 acpi_lid0: on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pci0: domain=0, physical bus=0 found-> vendor=0x8086, dev=0x2a00, revid=0x0c domain=0, bus=0, slot=0, func=0 class=06-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0106, statreg=0x2090, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x8086, dev=0x2a02, revid=0x0c domain=0, bus=0, slot=2, func=0 class=03-00-00, hdrtype=0x00, mfdev=1 cmdreg=0x0007, statreg=0x0090, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=10 powerspec 3 supports D0 D3 current D0 MSI supports 1 message map[10]: type Memory, range 64, base 0xf8100000, size 20, enabled map[18]: type Prefetchable Memory, range 64, base 0xe0000000, size 28, enabled map[20]: type I/O Port, range 32, base 0x1800, size 3, enabled pcib0: matched entry for 0.2.INTA pcib0: slot 2 INTA hardwired to IRQ 16 found-> vendor=0x8086, dev=0x2a03, revid=0x0c domain=0, bus=0, slot=2, func=1 class=03-80-00, hdrtype=0x00, mfdev=1 cmdreg=0x0007, statreg=0x0090, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) powerspec 3 supports D0 D3 current D0 map[10]: type Memory, range 64, base 0xf8200000, size 20, enabled found-> vendor=0x8086, dev=0x1049, revid=0x03 domain=0, bus=0, slot=25, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0107, statreg=0x0010, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 powerspec 2 supports D0 D3 current D0 MSI supports 1 message, 64 bit map[10]: type Memory, range 32, base 0xfe000000, size 17, enabled map[14]: type Memory, range 32, base 0xfe225000, size 12, enabled map[18]: type I/O Port, range 32, base 0x1840, size 5, enabled pcib0: matched entry for 0.25.INTA pcib0: slot 25 INTA hardwired to IRQ 20 found-> vendor=0x8086, dev=0x2834, revid=0x03 domain=0, bus=0, slot=26, func=0 class=0c-03-00, hdrtype=0x00, mfdev=1 cmdreg=0x0005, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 map[20]: type I/O Port, range 32, base 0x1860, size 5, enabled pcib0: matched entry for 0.26.INTA pcib0: slot 26 INTA hardwired to IRQ 20 found-> vendor=0x8086, dev=0x2835, revid=0x03 domain=0, bus=0, slot=26, func=1 class=0c-03-00, hdrtype=0x00, mfdev=0 cmdreg=0x0005, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=b, irq=11 map[20]: type I/O Port, range 32, base 0x1880, size 5, enabled pcib0: matched entry for 0.26.INTB pcib0: slot 26 INTB hardwired to IRQ 21 found-> vendor=0x8086, dev=0x283a, revid=0x03 domain=0, bus=0, slot=26, func=7 class=0c-03-20, hdrtype=0x00, mfdev=0 cmdreg=0x0106, statreg=0x0290, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=c, irq=11 powerspec 2 supports D0 D3 current D0 map[10]: type Memory, range 32, base 0xfe226400, size 10, enabled pcib0: matched entry for 0.26.INTC pcib0: slot 26 INTC hardwired to IRQ 22 found-> vendor=0x8086, dev=0x284b, revid=0x03 domain=0, bus=0, slot=27, func=0 class=04-03-00, hdrtype=0x00, mfdev=0 cmdreg=0x0106, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=b, irq=11 powerspec 2 supports D0 D3 current D0 MSI supports 1 message, 64 bit map[10]: type Memory, range 64, base 0xfe220000, size 14, enabled pcib0: matched entry for 0.27.INTB pcib0: slot 27 INTB hardwired to IRQ 17 found-> vendor=0x8086, dev=0x283f, revid=0x03 domain=0, bus=0, slot=28, func=0 class=06-04-00, hdrtype=0x01, mfdev=1 cmdreg=0x0107, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x04 (1000 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 powerspec 2 supports D0 D3 current D0 MSI supports 1 message pcib0: matched entry for 0.28.INTA pcib0: slot 28 INTA hardwired to IRQ 20 found-> vendor=0x8086, dev=0x2841, revid=0x03 domain=0, bus=0, slot=28, func=1 class=06-04-00, hdrtype=0x01, mfdev=1 cmdreg=0x0107, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x04 (1000 ns), maxlat=0x00 (0 ns) intpin=b, irq=11 powerspec 2 supports D0 D3 current D0 MSI supports 1 message pcib0: matched entry for 0.28.INTB pcib0: slot 28 INTB hardwired to IRQ 21 found-> vendor=0x8086, dev=0x2830, revid=0x03 domain=0, bus=0, slot=29, func=0 class=0c-03-00, hdrtype=0x00, mfdev=1 cmdreg=0x0005, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=10 map[20]: type I/O Port, range 32, base 0x18a0, size 5, enabled pcib0: matched entry for 0.29.INTA pcib0: slot 29 INTA hardwired to IRQ 16 found-> vendor=0x8086, dev=0x2831, revid=0x03 domain=0, bus=0, slot=29, func=1 class=0c-03-00, hdrtype=0x00, mfdev=0 cmdreg=0x0005, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=b, irq=11 map[20]: type I/O Port, range 32, base 0x18c0, size 5, enabled pcib0: matched entry for 0.29.INTB pcib0: slot 29 INTB hardwired to IRQ 17 found-> vendor=0x8086, dev=0x2836, revid=0x03 domain=0, bus=0, slot=29, func=7 class=0c-03-20, hdrtype=0x00, mfdev=0 cmdreg=0x0106, statreg=0x0290, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=d, irq=11 powerspec 2 supports D0 D3 current D0 map[10]: type Memory, range 32, base 0xfe226800, size 10, enabled pcib0: matched entry for 0.29.INTD pcib0: slot 29 INTD hardwired to IRQ 19 found-> vendor=0x8086, dev=0x2448, revid=0xf3 domain=0, bus=0, slot=30, func=0 class=06-04-01, hdrtype=0x01, mfdev=0 cmdreg=0x0005, statreg=0x0010, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x8086, dev=0x2811, revid=0x03 domain=0, bus=0, slot=31, func=0 class=06-01-00, hdrtype=0x00, mfdev=1 cmdreg=0x0007, statreg=0x0210, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x8086, dev=0x2828, revid=0x03 domain=0, bus=0, slot=31, func=2 class=01-01-80, hdrtype=0x00, mfdev=0 cmdreg=0x0005, statreg=0x02b8, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=b, irq=255 powerspec 3 supports D0 D3 current D0 map[20]: type I/O Port, range 32, base 0x1c10, size 4, enabled map[24]: type I/O Port, range 32, base 0x1c00, size 4, enabled found-> vendor=0x8086, dev=0x283e, revid=0x03 domain=0, bus=0, slot=31, func=3 class=0c-05-00, hdrtype=0x00, mfdev=0 cmdreg=0x0103, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 map[10]: type Memory, range 32, base 0xfe226c00, size 8, enabled map[20]: type I/O Port, range 32, base 0x1c20, size 5, enabled pcib0: matched entry for 0.31.INTA pcib0: slot 31 INTA hardwired to IRQ 23 vgapci0: port 0x1800-0x1807 mem 0xf8100000-0xf81fffff,0xe0000000-0xefffffff irq 16 at device 2.0 on pci0 agp0: on vgapci0 vgapci0: Reserved 0x10000000 bytes for rid 0x18 type 3 at 0xe0000000 vgapci0: Reserved 0x100000 bytes for rid 0x10 type 3 at 0xf8100000 agp0: detected 7676k stolen memory agp0: aperture size is 256M vgapci1: mem 0xf8200000-0xf82fffff at device 2.1 on pci0 em0: port 0x1840-0x185f mem 0xfe000000-0xfe01ffff,0xfe225000-0xfe225fff irq 20 at device 25.0 on pci0 em0: Reserved 0x20000 bytes for rid 0x10 type 3 at 0xfe000000 em0: Reserved 0x1000 bytes for rid 0x14 type 3 at 0xfe225000 ioapic0: routing intpin 20 (PCI IRQ 20) to lapic 0 vector 49 em0: [FILTER] em0: bpf attached em0: Ethernet address: 00:1d:72:80:92:e7 uhci0: port 0x1860-0x187f irq 20 at device 26.0 on pci0 uhci0: Reserved 0x20 bytes for rid 0x20 type 4 at 0x1860 uhci0: [MPSAFE] uhci0: [ITHREAD] uhci0: LegSup = 0x0000 usbus0: on uhci0 uhci1: port 0x1880-0x189f irq 21 at device 26.1 on pci0 uhci1: Reserved 0x20 bytes for rid 0x20 type 4 at 0x1880 ioapic0: routing intpin 21 (PCI IRQ 21) to lapic 0 vector 50 uhci1: [MPSAFE] uhci1: [ITHREAD] uhci1: LegSup = 0x0000 usbus1: on uhci1 ehci0: mem 0xfe226400-0xfe2267ff irq 22 at device 26.7 on pci0 ehci0: Reserved 0x400 bytes for rid 0x10 type 3 at 0xfe226400 ioapic0: routing intpin 22 (PCI IRQ 22) to lapic 0 vector 51 ehci0: [MPSAFE] ehci0: [ITHREAD] usbus2: EHCI version 1.0 usbus2: on ehci0 hdac0: mem 0xfe220000-0xfe223fff irq 17 at device 27.0 on pci0 hdac0: HDA Driver Revision: 20090608_0134 hdac0: Reserved 0x4000 bytes for rid 0x10 type 3 at 0xfe220000 ioapic0: routing intpin 17 (PCI IRQ 17) to lapic 0 vector 52 hdac0: [MPSAFE] hdac0: [ITHREAD] pcib1: irq 20 at device 28.0 on pci0 pcib1: domain 0 pcib1: secondary bus 2 pcib1: subordinate bus 2 pcib1: I/O decode 0x2000-0x2fff pcib1: memory decode 0xdc100000-0xdfcfffff pcib1: prefetched decode 0xdfe00000-0xdfefffff pci2: on pcib1 pci2: domain=0, physical bus=2 found-> vendor=0x8086, dev=0x444e, revid=0x01 domain=0, bus=2, slot=0, func=0 class=05-80-00, hdrtype=0x00, mfdev=0 cmdreg=0x0107, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 powerspec 2 supports D0 D3 current D0 MSI supports 1 message map[10]: type Memory, range 32, base 0xdfcffc00, size 10, enabled pcib1: requested memory range 0xdfcffc00-0xdfcfffff: good map[18]: type I/O Port, range 32, base 0x2000, size 7, enabled pcib1: requested I/O range 0x2000-0x207f: in range pcib1: matched entry for 2.0.INTA pcib1: slot 0 INTA hardwired to IRQ 16 pci2: at device 0.0 (no driver attached) pcib2: irq 21 at device 28.1 on pci0 pcib2: domain 0 pcib2: secondary bus 3 pcib2: subordinate bus 3 pcib2: I/O decode 0x3000-0x3fff pcib2: memory decode 0xfc000000-0xfdffffff pcib2: prefetched decode 0xf8000000-0xf80fffff pci3: on pcib2 pci3: domain=0, physical bus=3 found-> vendor=0x8086, dev=0x4230, revid=0x61 domain=0, bus=3, slot=0, func=0 class=02-80-00, hdrtype=0x00, mfdev=0 cmdreg=0x0106, statreg=0x4010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 powerspec 3 supports D0 D3 current D0 MSI supports 1 message, 64 bit map[10]: type Memory, range 64, base 0xfdf00000, size 13, enabled pcib2: requested memory range 0xfdf00000-0xfdf01fff: good pcib2: matched entry for 3.0.INTA pcib2: slot 0 INTA hardwired to IRQ 17 iwn0: mem 0xfdf00000-0xfdf01fff irq 17 at device 0.0 on pci3 iwn0: Reserved 0x2000 bytes for rid 0x10 type 3 at 0xfdf00000 iwn0: Reg Domain: MoW1, address 00:1d:e0:6d:b8:27 iwn0: [MPSAFE] iwn0: [ITHREAD] iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps iwn0: 11na MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps iwn0: 11ng MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps uhci2: port 0x18a0-0x18bf irq 16 at device 29.0 on pci0 uhci2: Reserved 0x20 bytes for rid 0x20 type 4 at 0x18a0 ioapic0: routing intpin 16 (PCI IRQ 16) to lapic 0 vector 53 uhci2: [MPSAFE] uhci2: [ITHREAD] uhci2: LegSup = 0x0000 usbus3: on uhci2 uhci3: port 0x18c0-0x18df irq 17 at device 29.1 on pci0 uhci3: Reserved 0x20 bytes for rid 0x20 type 4 at 0x18c0 uhci3: [MPSAFE] uhci3: [ITHREAD] uhci3: LegSup = 0x0000 usbus4: on uhci3 ehci1: mem 0xfe226800-0xfe226bff irq 19 at device 29.7 on pci0 ehci1: Reserved 0x400 bytes for rid 0x10 type 3 at 0xfe226800 ioapic0: routing intpin 19 (PCI IRQ 19) to lapic 0 vector 54 ehci1: [MPSAFE] ehci1: [ITHREAD] usbus5: EHCI version 1.0 usbus5: on ehci1 pcib3: at device 30.0 on pci0 pcib3: domain 0 pcib3: secondary bus 5 pcib3: subordinate bus 8 pcib3: I/O decode 0x4000-0x7fff pcib3: no prefetched decode pcib3: Subtractively decoded bridge. pci5: on pcib3 pci5: domain=0, physical bus=5 found-> vendor=0x1180, dev=0x0476, revid=0xba domain=0, bus=5, slot=0, func=0 class=06-07-00, hdrtype=0x02, mfdev=1 cmdreg=0x0007, statreg=0x0210, cachelnsz=0 (dwords) lattimer=0x20 (960 ns), mingnt=0x80 (32000 ns), maxlat=0x07 (1750 ns) intpin=a, irq=10 powerspec 2 supports D0 D1 D2 D3 current D0 map[10]: type Memory, range 32, base 0xf8300000, size 12, enabled pcib3: requested memory range 0xf8300000-0xf8300fff: good pcib3: matched entry for 5.0.INTA pcib3: slot 0 INTA hardwired to IRQ 16 found-> vendor=0x1180, dev=0x0832, revid=0x04 domain=0, bus=5, slot=0, func=1 class=0c-00-10, hdrtype=0x00, mfdev=1 cmdreg=0x0006, statreg=0x0210, cachelnsz=0 (dwords) lattimer=0x20 (960 ns), mingnt=0x02 (500 ns), maxlat=0x04 (1000 ns) intpin=b, irq=11 powerspec 2 supports D0 D1 D2 D3 current D0 map[10]: type Memory, range 32, base 0xf8301000, size 11, enabled pcib3: requested memory range 0xf8301000-0xf83017ff: good pcib3: matched entry for 5.0.INTB pcib3: slot 0 INTB hardwired to IRQ 17 found-> vendor=0x1180, dev=0x0822, revid=0x21 domain=0, bus=5, slot=0, func=2 class=08-05-00, hdrtype=0x00, mfdev=1 cmdreg=0x0006, statreg=0x0210, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=c, irq=11 powerspec 2 supports D0 D1 D2 D3 current D0 map[10]: type Memory, range 32, base 0xf8301800, size 8, enabled pcib3: requested memory range 0xf8301800-0xf83018ff: good pcib3: matched entry for 5.0.INTC pcib3: slot 0 INTC hardwired to IRQ 18 cbb0: mem 0xf8300000-0xf8300fff irq 16 at device 0.0 on pci5 cbb0: Reserved 0x1000 bytes for rid 0x10 type 3 at 0xf8300000 cardbus0: on cbb0 pccard0: <16-bit PCCard bus> on cbb0 cbb0: [MPSAFE] cbb0: [FILTER] cbb0: PCI Configuration space: 0x00: 0x04761180 0x02100007 0x060700ba 0x00822000 0x10: 0xf8300000 0x020000dc 0xb0080605 0xfffff000 0x20: 0x00000000 0xfffff000 0x00000000 0xfffffffc 0x30: 0x00000000 0xfffffffc 0x00000000 0x07000110 0x40: 0x20c617aa 0x00000001 0x00000000 0x00000000 0x50: 0x00000000 0x00000000 0x00000000 0x00000000 0x60: 0x00000000 0x00000000 0x00000000 0x00000000 0x70: 0x00000000 0x00000000 0x00000000 0x00000000 0x80: 0x04a00001 0x00000000 0x04630463 0x00000000 0x90: 0x00000000 0x00000000 0x00000000 0x00000000 0xa0: 0x00000000 0x01000000 0x00f00000 0x00000003 0xb0: 0x00000000 0xb2000000 0x00003000 0x00000000 0xc0: 0x20c617aa 0x00000000 0x00000000 0x00000000 0xd0: 0x00000000 0x00000000 0x00000000 0xfe0a0001 0xe0: 0x24c04000 0x00000000 0x00000000 0x00000000 0xf0: 0x00000000 0x00000000 0x00000000 0x00000000 pci5: at device 0.1 (no driver attached) pci5: at device 0.2 (no driver attached) isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1c10-0x1c1f,0x1c00-0x1c0f at device 31.2 on pci0 atapci0: Reserved 0x10 bytes for rid 0x20 type 4 at 0x1c10 atapci0: Reserved 0x10 bytes for rid 0x24 type 4 at 0x1c00 ata0: on atapci0 atapci0: Reserved 0x8 bytes for rid 0x10 type 4 at 0x1f0 atapci0: Reserved 0x1 bytes for rid 0x14 type 4 at 0x3f6 ata0: reset tp1 mask=03 ostat0=50 ostat1=00 ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 ata0: stat1=0x00 err=0x01 lsb=0x00 msb=0x00 ata0: reset tp2 stat0=50 stat1=00 devices=0x1 ioapic0: routing intpin 14 (ISA IRQ 14) to lapic 0 vector 55 ata0: [MPSAFE] ata0: [ITHREAD] ata1: on atapci0 atapci0: Reserved 0x8 bytes for rid 0x18 type 4 at 0x170 atapci0: Reserved 0x1 bytes for rid 0x1c type 4 at 0x376 ata1: reset tp1 mask=03 ostat0=7f ostat1=7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat0=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: stat1=0x7f err=0x7f lsb=0x7f msb=0x7f ata1: reset tp2 stat0=ff stat1=ff devices=0x0 ioapic0: routing intpin 15 (ISA IRQ 15) to lapic 0 vector 56 ata1: [MPSAFE] ata1: [ITHREAD] pci0: at device 31.3 (no driver attached) acpi_tz0: on acpi0 acpi_tz1: on acpi0 atrtc0: port 0x70-0x71 irq 8 on acpi0 atrtc0: registered as a time-of-day clock (resolution 1000000us) atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 atkbd: the current kbd controller command byte 0047 atkbd: keyboard ID 0x54ab (2) kbd0 at atkbd0 kbd0: atkbd0, AT 101/102 (2), config:0x0, flags:0x3d0000 ioapic0: routing intpin 1 (ISA IRQ 1) to lapic 0 vector 57 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: unable to allocate IRQ psmcpnp0: irq 12 on acpi0 psm0: current command byte:0047 psm0: irq 12 on atkbdc0 ioapic0: routing intpin 12 (ISA IRQ 12) to lapic 0 vector 58 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model Generic PS/2 mouse, device ID 0-00, 2 buttons psm0: config:00000000, flags:00000008, packet size:3 psm0: syncmask:c0, syncbits:00 battery0: on acpi0 acpi_acad0: on acpi0 acpi_ibm0: on acpi0 cpu0: on acpi0 ACPI: SSDT 0xbe6e1b32 00282 (v1 PmRef Cpu0Ist 00000100 INTL 20050513) ACPI: SSDT 0xbe6e1e39 0085E (v1 PmRef Cpu0Cst 00000100 INTL 20050513) coretemp0: on cpu0 est0: on cpu0 est0: Invalid id16 (set, cur) = (2596, 2329) est0: Invalid freq 1801, ignored. p4tcc0: on cpu0 cpu1: on acpi0 ACPI: SSDT 0xbe6e1a6a 000C8 (v1 PmRef Cpu1Ist 00000100 INTL 20050513) ACPI: SSDT 0xbe6e1db4 00085 (v1 PmRef Cpu1Cst 00000100 INTL 20050513) coretemp1: on cpu1 est1: on cpu1 est1: Invalid id16 (set, cur) = (2596, 2329) est1: Invalid freq 1801, ignored. p4tcc1: on cpu1 pnp_identify: Trying Read_Port at 203 pnp_identify: Trying Read_Port at 243 pnp_identify: Trying Read_Port at 283 pnp_identify: Trying Read_Port at 2c3 pnp_identify: Trying Read_Port at 303 pnp_identify: Trying Read_Port at 343 pnp_identify: Trying Read_Port at 383 pnp_identify: Trying Read_Port at 3c3 PNP Identify complete isa_probe_children: disabling PnP devices pmtimer0 on isa0 ata: ata0 already exists; skipping it ata: ata1 already exists; skipping it atkbdc: atkbdc0 already exists; skipping it atrtc: atrtc0 already exists; skipping it sc: sc0 already exists; skipping it isa_probe_children: probing non-PnP devices orm0: at iomem 0xc0000-0xcffff,0xe0000-0xeffff pnpid ORM0000 on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sc0: fb0, kbd1, terminal emulator: scteken (teken terminal) vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 fdc0 failed to probe at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0 ppc0 failed to probe at irq 7 on isa0 uart0: failed to probe at port 0x3f8-0x3ff irq 4 on isa0 uart1: failed to probe at port 0x2f8-0x2ff irq 3 on isa0 isa_probe_children: probing PnP devices Device configuration finished. Reducing kern.maxvnodes 197088 -> 100000 procfs registered lapic: Divisor 2, Frequency 99750886 hz Timecounter "TSC" frequency 1795515768 Hz quality -100 Timecounters tick every 1.000 msec lo0: bpf attached pflog0: bpf attached pfsync0: bpf attached ata0: Identifying devices: 00000001 ata0: New devices: 00000001 usbus0: 12Mbps Full Speed USB v1.0 usbus1: 12Mbps Full Speed USB v1.0 usbus2: 480Mbps High Speed USB v2.0 usbus3: 12Mbps Full Speed USB v1.0 usbus4: 12Mbps Full Speed USB v1.0 usbus5: 480Mbps High Speed USB v2.0 battery0: battery initialization start acpi_acad0: acline initialization start ata0-master: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire ad0: 305245MB at ata0-master SATA150 ad0: 625142448 sectors [620181C/16H/63S] 16 sectors/interrupt 1 depth queue GEOM: new disk ad0 ata1: Identifying devices: 00000000 ata1: New devices: 00000000 hdac0: Probing codec #0... hdac0: HDA Codec #0: Analog Devices AD1984 hdac0: HDA Codec ID: 0x11d41984 hdac0: Vendor: 0x11d4 hdac0: Device: 0x1984 hdac0: Revision: 0x04 hdac0: Stepping: 0x00 hdac0: PCI Subvendor: 0x20ac17aa hdac0: Found audio FG nid=1 startnode=2 endnode=39 total=37 hdac0: Probing codec #1... hdac0: HDA Codec #1: Conexant (Unknown) hdac0: HDA Codec ID: 0x14f12bfa hdac0: Vendor: 0x14f1 hdac0: Device: 0x2bfa hdac0: Revision: 0x00 hdac0: Stepping: 0x00 hdac0: PCI Subvendor: 0x20ac17aa hdac0: Found modem FG nid=2 startnode=112 endnode=116 total=4 hdac0: hdac0: Processing audio FG cad=0 nid=1... hdac0: GPIO: 0x40000003 NumGPIO=3 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1 hdac0: GHOST: nid=2 j=0 entnum=4 index=0 res=0x00090801 hdac0: nid 17 0x0421401f as 1 seq 15 Headphones Jack jack 1 loc 4 color Green misc 0 hdac0: nid 18 0x90170110 as 1 seq 0 Speaker Fixed jack 7 loc 16 color Unknown misc 1 hdac0: nid 19 0x511301f0 as 15 seq 0 Speaker None jack 3 loc 17 color Unknown misc 1 hdac0: nid 20 0x04a15021 as 2 seq 1 Mic Jack jack 1 loc 4 color Red misc 0 hdac0: nid 21 0x90a7012e as 2 seq 14 Mic Fixed jack 7 loc 16 color Unknown misc 1 hdac0: nid 22 0x593301f0 as 15 seq 0 CD None jack 3 loc 25 color Unknown misc 1 hdac0: nid 23 0x55a601f0 as 15 seq 0 Mic None jack 6 loc 21 color Unknown misc 1 hdac0: nid 24 0x55a601f0 as 15 seq 0 Mic None jack 6 loc 21 color Unknown misc 1 hdac0: Patching widget caps nid=26 0x00400000 -> 0x00700000 hdac0: nid 27 0x614411f0 as 15 seq 0 SPDIF-out None jack 4 loc 33 color Black misc 1 hdac0: nid 28 0x21a15020 as 2 seq 0 Mic Jack jack 1 loc 33 color Red misc 0 hdac0: Patched pins configuration: hdac0: nid 17 0x0421401f as 1 seq 15 Headphones Jack jack 1 loc 4 color Green misc 0 hdac0: nid 18 0x90170110 as 1 seq 0 Speaker Fixed jack 7 loc 16 color Unknown misc 1 hdac0: nid 19 0x511301f0 as 15 seq 0 Speaker None jack 3 loc 17 color Unknown misc 1 [DISABLED] hdac0: nid 20 0x04a15021 as 2 seq 1 Mic Jack jack 1 loc 4 color Red misc 0 hdac0: nid 21 0x90a7012e as 2 seq 14 Mic Fixed jack 7 loc 16 color Unknown misc 1 hdac0: nid 22 0x593301f0 as 15 seq 0 CD None jack 3 loc 25 color Unknown misc 1 [DISABLED] hdac0: nid 23 0x55a601f0 as 15 seq 0 Mic None jack 6 loc 21 color Unknown misc 1 [DISABLED] hdac0: nid 24 0x55a601f0 as 15 seq 0 Mic None jack 6 loc 21 color Unknown misc 1 [DISABLED] hdac0: nid 27 0x614411f0 as 15 seq 0 SPDIF-out None jack 4 loc 33 color Black misc 1 [DISABLED] hdac0: nid 28 0x21a15020 as 2 seq 0 Mic Jack jack 1 loc 33 color Red misc 0 hdac0: 2 associations found: hdac0: Association 0 (1) out: hdac0: Pin nid=18 seq=0 hdac0: Pin nid=17 seq=15 hdac0: Association 1 (2) in: hdac0: Pin nid=28 seq=0 hdac0: Pin nid=20 seq=1 hdac0: Pin nid=21 seq=14 hdac0: Tracing association 0 (1) hdac0: Pin 18 traced to DAC 4 hdac0: Pin 17 traced to DAC 4 and hpredir 0 hdac0: Association 0 (1) trace succeeded hdac0: Tracing association 1 (2) hdac0: Unable to trace pin 28 to ADC 5, undo traces hdac0: Unable to trace pin 28 to ADC 6, undo traces hdac0: Pin 28 traced to ADC 8 hdac0: Pin 20 traced to ADC 8 hdac0: Pin 21 traced to ADC 8 hdac0: Association 1 (2) trace succeeded hdac0: Tracing input monitor hdac0: Tracing nid 32 to out hdac0: nid 32 is input monitor hdac0: Tracing beeper hdac0: nid 26 traced to out hdac0: Enabling headphone/speaker audio routing switching: hdac0: as=0 sense nid=17 [UNSOL] hdac0: Pin sense: nid=17 res=0x7fffffff hdac0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref hdac0: hdac0: +-------------------+ hdac0: | DUMPING HDA NODES | hdac0: +-------------------+ hdac0: hdac0: Default Parameter hdac0: ----------------- hdac0: Stream cap: 0x00000001 hdac0: PCM hdac0: PCM cap: 0x000e07ff hdac0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz hdac0: IN amp: 0x80000000 hdac0: OUT amp: 0x00052727 hdac0: hdac0: nid: 2 [DISABLED] hdac0: Name: audio output hdac0: Widget cap: 0x00030311 hdac0: DIGITAL STEREO hdac0: Stream cap: 0x00000005 hdac0: AC3 PCM hdac0: PCM cap: 0x000e07e0 hdac0: 16 20 24 bits, 44 48 88 96 176 192 KHz hdac0: connections: 3 hdac0: | hdac0: + [DISABLED] <- nid=1 [GHOST!] [UNKNOWN] (selected) hdac0: + <- nid=8 [audio input] hdac0: + <- nid=9 [audio input] [DISABLED] hdac0: hdac0: nid: 3 [DISABLED] hdac0: Name: audio output hdac0: Widget cap: 0x00000405 hdac0: PWR STEREO hdac0: Stream cap: 0x00000001 hdac0: PCM hdac0: PCM cap: 0x000e07ff hdac0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz hdac0: Output amp: 0x00052727 hdac0: mute=0 step=39 size=5 offset=39 hdac0: hdac0: nid: 4 hdac0: Name: audio output hdac0: Widget cap: 0x00000405 hdac0: PWR STEREO hdac0: Association: 0 (0x00008001) hdac0: OSS: pcm (pcm) hdac0: Stream cap: 0x00000001 hdac0: PCM hdac0: PCM cap: 0x000e07ff hdac0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz hdac0: Output amp: 0x00052727 hdac0: mute=0 step=39 size=5 offset=39 hdac0: hdac0: nid: 5 [DISABLED] hdac0: Name: audio input hdac0: Widget cap: 0x0010050b hdac0: PWR STEREO hdac0: Stream cap: 0x00000001 hdac0: PCM hdac0: PCM cap: 0x000e07ff hdac0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz hdac0: Input amp: 0x80053627 hdac0: mute=1 step=54 size=5 offset=39 hdac0: connections: 1 hdac0: | hdac0: + [DISABLED] <- nid=23 [pin: Mic (None)] [DISABLED] hdac0: hdac0: nid: 6 [DISABLED] hdac0: Name: audio input hdac0: Widget cap: 0x0010050b hdac0: PWR STEREO hdac0: Stream cap: 0x00000001 hdac0: PCM hdac0: PCM cap: 0x000e07ff hdac0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz hdac0: Input amp: 0x80053627 hdac0: mute=1 step=54 size=5 offset=39 hdac0: connections: 1 hdac0: | hdac0: + [DISABLED] <- nid=24 [pin: Mic (None)] [DISABLED] hdac0: hdac0: nid: 7 hdac0: Name: audio mixer hdac0: Widget cap: 0x00200103 hdac0: STEREO hdac0: Association: 0 (0x00008000) hdac0: OSS: pcm, mix hdac0: Input amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 2 hdac0: | hdac0: + <- nid=34 [audio selector] hdac0: + <- nid=33 [audio selector] hdac0: hdac0: nid: 8 hdac0: Name: audio input hdac0: Widget cap: 0x00100501 hdac0: PWR STEREO hdac0: Association: 1 (0x00004003) hdac0: Stream cap: 0x00000001 hdac0: PCM hdac0: PCM cap: 0x000e07ff hdac0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz hdac0: connections: 1 hdac0: | hdac0: + <- nid=12 [audio selector] hdac0: hdac0: nid: 9 [DISABLED] hdac0: Name: audio input hdac0: Widget cap: 0x00100501 hdac0: PWR STEREO hdac0: Stream cap: 0x00000001 hdac0: PCM hdac0: PCM cap: 0x000e07ff hdac0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz hdac0: connections: 1 hdac0: | hdac0: + <- nid=13 [audio selector] [DISABLED] hdac0: hdac0: nid: 10 hdac0: Name: audio mixer hdac0: Widget cap: 0x00200103 hdac0: STEREO hdac0: Association: 0 (0x00000001) hdac0: OSS: pcm, mix hdac0: Input amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 2 hdac0: | hdac0: + <- nid=4 [audio output] hdac0: + <- nid=33 [audio selector] hdac0: hdac0: nid: 11 [DISABLED] hdac0: Name: audio mixer hdac0: Widget cap: 0x00200103 hdac0: STEREO hdac0: Input amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 2 hdac0: | hdac0: + [DISABLED] <- nid=15 [audio selector] [DISABLED] hdac0: + [DISABLED] <- nid=33 [audio selector] hdac0: hdac0: nid: 12 hdac0: Name: audio selector hdac0: Widget cap: 0x0030010d hdac0: STEREO hdac0: Association: 1 (0x00004003) hdac0: OSS: line, mic, mix, monitor hdac0: Output amp: 0x80053627 hdac0: mute=1 step=54 size=5 offset=39 hdac0: connections: 5 hdac0: | hdac0: + <- nid=20 [pin: Mic (Red Jack)] hdac0: + <- nid=21 [pin: Mic (Fixed)] hdac0: + [DISABLED] <- nid=22 [pin: CD (None)] [DISABLED] hdac0: + <- nid=32 [audio mixer] hdac0: + <- nid=37 [audio selector] (selected) hdac0: hdac0: nid: 13 [DISABLED] hdac0: Name: audio selector hdac0: Widget cap: 0x0030010d hdac0: STEREO hdac0: Output amp: 0x80053627 hdac0: mute=1 step=54 size=5 offset=39 hdac0: connections: 5 hdac0: | hdac0: + <- nid=20 [pin: Mic (Red Jack)] (selected) hdac0: + <- nid=21 [pin: Mic (Fixed)] hdac0: + [DISABLED] <- nid=22 [pin: CD (None)] [DISABLED] hdac0: + <- nid=32 [audio mixer] hdac0: + <- nid=37 [audio selector] hdac0: hdac0: nid: 14 [DISABLED] hdac0: Name: audio selector hdac0: Widget cap: 0x00300101 hdac0: STEREO hdac0: connections: 2 hdac0: | hdac0: + <- nid=3 [audio output] [DISABLED] (selected) hdac0: + <- nid=4 [audio output] hdac0: hdac0: nid: 15 [DISABLED] hdac0: Name: audio selector hdac0: Widget cap: 0x00300101 hdac0: STEREO hdac0: connections: 2 hdac0: | hdac0: + <- nid=3 [audio output] [DISABLED] (selected) hdac0: + <- nid=4 [audio output] hdac0: hdac0: nid: 16 hdac0: Name: beep widget hdac0: Widget cap: 0x0070000c hdac0: Association: -2 (0x00000000) hdac0: OSS: speaker (speaker) hdac0: Output amp: 0x800b0f0f hdac0: mute=1 step=15 size=11 offset=15 hdac0: hdac0: nid: 17 hdac0: Name: pin: Headphones (Green Jack) hdac0: Widget cap: 0x0040018d hdac0: UNSOL STEREO hdac0: Association: 0 (0x00008000) hdac0: Pin cap: 0x0000001f hdac0: ISC TRQD PDC HP OUT hdac0: Pin config: 0x0421401f hdac0: Pin control: 0x000000c0 HP OUT hdac0: Output amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 1 hdac0: | hdac0: + <- nid=7 [audio mixer] hdac0: hdac0: nid: 18 hdac0: Name: pin: Speaker (Fixed) hdac0: Widget cap: 0x0040058d hdac0: PWR UNSOL STEREO hdac0: Association: 0 (0x00000001) hdac0: Pin cap: 0x0001001f hdac0: ISC TRQD PDC HP OUT EAPD hdac0: Pin config: 0x90170110 hdac0: Pin control: 0x00000040 OUT hdac0: EAPD: 0x00000002 hdac0: Output amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 1 hdac0: | hdac0: + <- nid=10 [audio mixer] hdac0: hdac0: nid: 19 [DISABLED] hdac0: Name: pin: Speaker (None) hdac0: Widget cap: 0x0040050c hdac0: PWR hdac0: Pin cap: 0x00010010 hdac0: OUT EAPD hdac0: Pin config: 0x511301f0 hdac0: Pin control: 0x00000000 hdac0: EAPD: 0x00000002 hdac0: Output amp: 0x80051f1f hdac0: mute=1 step=31 size=5 offset=31 hdac0: connections: 1 hdac0: | hdac0: + [DISABLED] <- nid=31 [audio mixer] [DISABLED] hdac0: hdac0: nid: 20 hdac0: Name: pin: Mic (Red Jack) hdac0: Widget cap: 0x0040008b hdac0: UNSOL STEREO hdac0: Association: 1 (0x00000002) hdac0: OSS: mic (mic) hdac0: Pin cap: 0x00003727 hdac0: ISC TRQD PDC IN VREF[ 50 80 100 GROUND HIZ ] hdac0: Pin config: 0x04a15021 hdac0: Pin control: 0x00000025 IN VREFs hdac0: Input amp: 0x00270300 hdac0: mute=0 step=3 size=39 offset=0 hdac0: hdac0: nid: 21 hdac0: Name: pin: Mic (Fixed) hdac0: Widget cap: 0x0040008b hdac0: UNSOL STEREO hdac0: Association: 1 (0x00004000) hdac0: OSS: monitor (monitor) hdac0: Pin cap: 0x00003727 hdac0: ISC TRQD PDC IN VREF[ 50 80 100 GROUND HIZ ] hdac0: Pin config: 0x90a7012e hdac0: Pin control: 0x00000025 IN VREFs hdac0: Input amp: 0x00270300 hdac0: mute=0 step=3 size=39 offset=0 hdac0: hdac0: nid: 22 [DISABLED] hdac0: Name: pin: CD (None) hdac0: Widget cap: 0x0040018d hdac0: UNSOL STEREO hdac0: Pin cap: 0x00000037 hdac0: ISC TRQD PDC OUT IN hdac0: Pin config: 0x593301f0 hdac0: Pin control: 0x00000000 hdac0: Output amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 1 hdac0: | hdac0: + [DISABLED] <- nid=11 [audio mixer] [DISABLED] hdac0: hdac0: nid: 23 [DISABLED] hdac0: Name: pin: Mic (None) hdac0: Widget cap: 0x00400001 hdac0: STEREO hdac0: Pin cap: 0x00000020 hdac0: IN hdac0: Pin config: 0x55a601f0 hdac0: Pin control: 0x00000000 hdac0: hdac0: nid: 24 [DISABLED] hdac0: Name: pin: Mic (None) hdac0: Widget cap: 0x00400001 hdac0: STEREO hdac0: Pin cap: 0x00000020 hdac0: IN hdac0: Pin config: 0x55a601f0 hdac0: Pin control: 0x00000000 hdac0: hdac0: nid: 25 [DISABLED] hdac0: Name: power widget hdac0: Widget cap: 0x00500500 hdac0: PWR hdac0: connections: 2 hdac0: | hdac0: + <- nid=32 [audio mixer] (selected) hdac0: + <- nid=33 [audio selector] hdac0: hdac0: nid: 26 hdac0: Name: beep widget hdac0: Widget cap: 0x00700000 hdac0: Association: -2 (0x00000000) hdac0: OSS: speaker (speaker) hdac0: hdac0: nid: 27 [DISABLED] hdac0: Name: pin: SPDIF-out (None) hdac0: Widget cap: 0x0040030d hdac0: DIGITAL STEREO hdac0: Pin cap: 0x00000010 hdac0: OUT hdac0: Pin config: 0x614411f0 hdac0: Pin control: 0x00000000 hdac0: Output amp: 0x80052727 hdac0: mute=1 step=39 size=5 offset=39 hdac0: connections: 1 hdac0: | hdac0: + [DISABLED] <- nid=2 [audio output] [DISABLED] hdac0: hdac0: nid: 28 hdac0: Name: pin: Mic (Red Jack) hdac0: Widget cap: 0x0040018d hdac0: UNSOL STEREO hdac0: Association: 1 (0x00000001) hdac0: OSS: line (line) hdac0: Pin cap: 0x00003737 hdac0: ISC TRQD PDC OUT IN VREF[ 50 80 100 GROUND HIZ ] hdac0: Pin config: 0x21a15020 hdac0: Pin control: 0x00000025 IN VREFs hdac0: Output amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 1 hdac0: | hdac0: + [DISABLED] <- nid=36 [audio mixer] [DISABLED] hdac0: hdac0: nid: 29 [DISABLED] hdac0: Name: vendor widget hdac0: Widget cap: 0x00f00100 hdac0: connections: 25 hdac0: | hdac0: + <- nid=7 [audio mixer] (selected) hdac0: + [DISABLED] <- nid=25 [power widget] [DISABLED] hdac0: + <- nid=10 [audio mixer] hdac0: + <- nid=11 [audio mixer] [DISABLED] hdac0: + <- nid=12 [audio selector] hdac0: + <- nid=13 [audio selector] [DISABLED] hdac0: + <- nid=14 [audio selector] [DISABLED] hdac0: + <- nid=15 [audio selector] [DISABLED] hdac0: + <- nid=26 [beep widget] hdac0: + <- nid=28 [pin: Mic (Red Jack)] hdac0: + <- nid=17 [pin: Headphones (Green Jack)] hdac0: + <- nid=18 [pin: Speaker (Fixed)] hdac0: + [DISABLED] <- nid=19 [pin: Speaker (None)] [DISABLED] hdac0: + <- nid=20 [pin: Mic (Red Jack)] hdac0: + <- nid=21 [pin: Mic (Fixed)] hdac0: + [DISABLED] <- nid=22 [pin: CD (None)] [DISABLED] hdac0: + <- nid=30 [audio mixer] [DISABLED] hdac0: + <- nid=31 [audio mixer] [DISABLED] hdac0: + <- nid=32 [audio mixer] hdac0: + <- nid=33 [audio selector] hdac0: + <- nid=34 [audio selector] hdac0: + <- nid=35 [audio selector] [DISABLED] hdac0: + <- nid=36 [audio mixer] [DISABLED] hdac0: + <- nid=37 [audio selector] hdac0: + <- nid=38 [vendor widget] [DISABLED] hdac0: hdac0: nid: 30 [DISABLED] hdac0: Name: audio mixer hdac0: Widget cap: 0x00200103 hdac0: STEREO hdac0: Input amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 2 hdac0: | hdac0: + [DISABLED] <- nid=14 [audio selector] [DISABLED] hdac0: + [DISABLED] <- nid=33 [audio selector] hdac0: hdac0: nid: 31 [DISABLED] hdac0: Name: audio mixer hdac0: Widget cap: 0x00200100 hdac0: connections: 1 hdac0: | hdac0: + <- nid=30 [audio mixer] [DISABLED] hdac0: hdac0: nid: 32 hdac0: Name: audio mixer hdac0: Widget cap: 0x0020010b hdac0: STEREO hdac0: Association: -2 (0x00004003) hdac0: OSS: mix (mix) hdac0: Input amp: 0x80051f17 hdac0: mute=1 step=31 size=5 offset=23 hdac0: connections: 5 hdac0: | hdac0: + <- nid=20 [pin: Mic (Red Jack)] hdac0: + <- nid=21 [pin: Mic (Fixed)] hdac0: + [DISABLED] <- nid=22 [pin: CD (None)] [DISABLED] hdac0: + <- nid=26 [beep widget] hdac0: + <- nid=37 [audio selector] hdac0: hdac0: nid: 33 hdac0: Name: audio selector hdac0: Widget cap: 0x0030010d hdac0: STEREO hdac0: Association: -2 (0x00000000) hdac0: OSS: mix hdac0: Output amp: 0x80051f1f hdac0: mute=1 step=31 size=5 offset=31 hdac0: connections: 1 hdac0: | hdac0: + <- nid=32 [audio mixer] hdac0: hdac0: nid: 34 hdac0: Name: audio selector hdac0: Widget cap: 0x00300101 hdac0: STEREO hdac0: Association: 0 (0x00008000) hdac0: OSS: pcm hdac0: connections: 2 hdac0: | hdac0: + [DISABLED] <- nid=3 [audio output] [DISABLED] hdac0: + <- nid=4 [audio output] (selected) hdac0: hdac0: nid: 35 [DISABLED] hdac0: Name: audio selector hdac0: Widget cap: 0x00300101 hdac0: STEREO hdac0: connections: 2 hdac0: | hdac0: + <- nid=3 [audio output] [DISABLED] (selected) hdac0: + <- nid=4 [audio output] hdac0: hdac0: nid: 36 [DISABLED] hdac0: Name: audio mixer hdac0: Widget cap: 0x00200103 hdac0: STEREO hdac0: Input amp: 0x80000000 hdac0: mute=1 step=0 size=0 offset=0 hdac0: connections: 2 hdac0: | hdac0: + [DISABLED] <- nid=35 [audio selector] [DISABLED] hdac0: + [DISABLED] <- nid=33 [audio selector] hdac0: hdac0: nid: 37 hdac0: Name: audio selector hdac0: Widget cap: 0x0030010d hdac0: STEREO hdac0: Association: 1 (0x00000001) hdac0: OSS: line hdac0: Output amp: 0x00270300 hdac0: mute=0 step=3 size=39 offset=0 hdac0: connections: 1 hdac0: | hdac0: + <- nid=28 [pin: Mic (Red Jack)] hdac0: hdac0: nid: 38 [DISABLED] hdac0: Name: vendor widget hdac0: Widget cap: 0x00f00100 hdac0: connections: 3 hdac0: | hdac0: + <- nid=20 [pin: Mic (Red Jack)] (selected) hdac0: + <- nid=21 [pin: Mic (Fixed)] hdac0: + <- nid=28 [pin: Mic (Red Jack)] hdac0: hdac0: Processing modem FG cad=1 nid=2... hdac0: pcm0: at cad 0 nid 1 on hdac0 pcm0: +--------------------------------------+ pcm0: | DUMPING PCM Playback/Record Channels | pcm0: +--------------------------------------+ pcm0: pcm0: Playback: pcm0: pcm0: Stream cap: 0x00000001 pcm0: PCM pcm0: PCM cap: 0x000e07ff pcm0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz pcm0: DAC: 4 pcm0: pcm0: Record: pcm0: pcm0: Stream cap: 0x00000001 pcm0: PCM pcm0: PCM cap: 0x000e07ff pcm0: 16 20 24 bits, 8 11 16 22 32 44 48 88 96 176 192 KHz pcm0: ADC: 8 pcm0: pcm0: +-------------------------------+ pcm0: | DUMPING Playback/Record Paths | pcm0: +-------------------------------+ pcm0: pcm0: Playback: pcm0: pcm0: nid=17 [pin: Headphones (Green Jack)] pcm0: | pcm0: + <- nid=7 [audio mixer] [src: pcm, mix] pcm0: | pcm0: + <- nid=34 [audio selector] [src: pcm] pcm0: | pcm0: + <- nid=4 [audio output] [src: pcm] pcm0: + <- nid=33 [audio selector] [src: mix] pcm0: | pcm0: + <- nid=32 [audio mixer] [src: mix] pcm0: pcm0: nid=18 [pin: Speaker (Fixed)] pcm0: | pcm0: + <- nid=10 [audio mixer] [src: pcm, mix] pcm0: | pcm0: + <- nid=4 [audio output] [src: pcm] pcm0: + <- nid=33 [audio selector] [src: mix] pcm0: | pcm0: + <- nid=32 [audio mixer] [src: mix] pcm0: pcm0: Record: pcm0: pcm0: nid=8 [audio input] pcm0: | pcm0: + <- nid=12 [audio selector] [src: line, mic, mix, monitor] pcm0: | pcm0: + <- nid=20 [pin: Mic (Red Jack)] [src: mic] pcm0: + <- nid=21 [pin: Mic (Fixed)] [src: monitor] pcm0: + <- nid=32 [audio mixer] [src: mix] pcm0: + <- nid=37 [audio selector] [src: line] pcm0: | pcm0: + <- nid=28 [pin: Mic (Red Jack)] [src: line] pcm0: pcm0: Input Mix: pcm0: pcm0: nid=32 [audio mixer] pcm0: | pcm0: + <- nid=20 [pin: Mic (Red Jack)] [src: mic] pcm0: + <- nid=21 [pin: Mic (Fixed)] [src: monitor] pcm0: + <- nid=26 [beep widget] [src: speaker] pcm0: + <- nid=37 [audio selector] [src: line] pcm0: | pcm0: + <- nid=28 [pin: Mic (Red Jack)] [src: line] pcm0: pcm0: +-------------------------+ pcm0: | DUMPING Volume Controls | pcm0: +-------------------------+ pcm0: pcm0: Master Volume (OSS: vol) pcm0: | pcm0: +- ctl 2 (nid 4 out): -58/0dB (40 steps) pcm0: +- ctl 5 (nid 7 in 0): mute pcm0: +- ctl 6 (nid 7 in 1): mute pcm0: +- ctl 7 (nid 10 in 0): mute pcm0: +- ctl 8 (nid 10 in 1): mute pcm0: +- ctl 14 (nid 17 in ): mute pcm0: +- ctl 15 (nid 18 in ): mute pcm0: pcm0: PCM Volume (OSS: pcm) pcm0: | pcm0: +- ctl 2 (nid 4 out): -58/0dB (40 steps) pcm0: +- ctl 5 (nid 7 in 0): mute pcm0: +- ctl 7 (nid 10 in 0): mute pcm0: pcm0: Microphone Volume (OSS: mic) pcm0: | pcm0: +- ctl 17 (nid 20 out): 0/30dB (4 steps) pcm0: pcm0: Microphone2 Volume (OSS: monitor) pcm0: | pcm0: +- ctl 18 (nid 21 out): 0/30dB (4 steps) pcm0: pcm0: Line-in Volume (OSS: line) pcm0: | pcm0: +- ctl 32 (nid 37 out): 0/30dB (4 steps) pcm0: pcm0: Speaker/Beep Volume (OSS: speaker) pcm0: | pcm0: +- ctl 13 (nid 16 out): -45/0dB (16 steps) + mute pcm0: +- ctl 27 (nid 32 in 3): -34/12dB (32 steps) + mute pcm0: pcm0: Recording Level (OSS: rec) pcm0: | pcm0: +- ctl 11 (nid 12 out): -58/22dB (55 steps) + mute pcm0: pcm0: Input Mix Level (OSS: mix) pcm0: | pcm0: +- ctl 6 (nid 7 in 1): mute pcm0: +- ctl 8 (nid 10 in 1): mute pcm0: +- ctl 24 (nid 32 in 0): -34/12dB (32 steps) + mute pcm0: +- ctl 25 (nid 32 in 1): -34/12dB (32 steps) + mute pcm0: +- ctl 27 (nid 32 in 3): -34/12dB (32 steps) + mute pcm0: +- ctl 28 (nid 32 in 4): -34/12dB (32 steps) + mute pcm0: +- ctl 29 (nid 33 out): -46/0dB (32 steps) + mute pcm0: pcm0: Mixer "vol": pcm0: Mixer "pcm": pcm0: Mixer "speaker": pcm0: Mixer "line": pcm0: Mixer "mic": pcm0: Mixer "mix": pcm0: Mixer "rec": pcm0: Mixer "ogain": pcm0: Mixer "monitor": pcm0: clone manager: deadline=750ms flags=0x8000001e pcm0: sndbuf_setmap bb290000, 4000; 0xe69e9000 -> bb290000 pcm0: sndbuf_setmap bb2a0000, 4000; 0xe69f9000 -> bb2a0000 SMP: AP CPU #1 Launched! cpu1 AP: ID: 0x01000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000200ef therm: 0x00010200 err: 0x00010000 pcm: 0x00000400 ioapic0: routing intpin 9 (ISA IRQ 9) to lapic 1 vector 48 ioapic0: routing intpin 14 (ISA IRQ 14) to lapic 1 vector 49 ioapic0: routing intpin 16 (PCI IRQ 16) to lapic 1 vector 50 ioapic0: routing intpin 19 (PCI IRQ 19) to lapic 1 vector 51 ioapic0: routing intpin 21 (PCI IRQ 21) to lapic 1 vector 52 WARNING: WITNESS option enabled, expect reduced performance. ugen1.1: at usbus1 uhub0: on usbus1 ugen0.1: at usbus0 uhub1: on usbus0 ugen2.1: at usbus2 uhub2: on usbus2 ugen3.1: at usbus3 uhub3: on usbus3 ugen4.1: at usbus4 uhub4: on usbus4 ugen5.1: at usbus5 uhub5: on usbus5 battery0: battery initialization done, tried 1 times acpi_acad0: On Line acpi_acad0: acline initialization done, tried 1 times uhub0: 2 ports with 2 removable, self powered uhub1: 2 ports with 2 removable, self powered uhub3: 2 ports with 2 removable, self powered uhub4: 2 ports with 2 removable, self powered Root mount waiting for: usbus5 usbus2 uhub2: 4 ports with 4 removable, self powered uhub5: 4 ports with 4 removable, self powered Trying to mount root from ufs:/dev/ad0s1a ct_to_ts([2009-06-11 21:45:08]) = 1244756708.000000000 start_init: trying /sbin/init ugen0.2: at usbus0 lock order reversal: 1st 0xda0efdf0 bufwait (bufwait) @ /usr/src/sys/kern/vfs_bio.c:2558 2nd 0xc6586800 dirhash (dirhash) @ /usr/src/sys/ufs/ufs/ufs_dirhash.c:285 KDB: stack backtrace: db_trace_self_wrapper(c098d2d4,e8c5a770,c06b8675,c06a95bb,c0990151,...) at db_trace_self_wrapper+0x26 kdb_backtrace(c06a95bb,c0990151,c610fd58,c6113978,e8c5a7cc,...) at kdb_backtrace+0x29 _witness_debugger(c0990151,c6586800,c09af873,c6113978,c09af50c,...) at _witness_debugger+0x25 witness_checkorder(c6586800,9,c09af50c,11d,0,...) at witness_checkorder+0x839 _sx_xlock(c6586800,0,c09af50c,11d,da52b5d8,...) at _sx_xlock+0x87 ufsdirhash_acquire(c6668740,da52b5d8,e8c5a898,c0891f44,c6646488,...) at ufsdirhash_acquire+0x35 ufsdirhash_move(c6646488,da52b5d8,5d8,5c0,e8c5a888,...) at ufsdirhash_move+0xf ufs_direnter(c679c430,c67a3a78,e8c5a8e0,e8c5abd4,0,...) at ufs_direnter+0x5f4 ufs_makeinode(e8c5abd4,c0a0b7c0,e8c5aacc,e8c5aa34,c091a8ea,...) at ufs_makeinode+0x4af ufs_create(e8c5aacc,c6638a10,c0a23f00,c679c430,e8c5aae4,...) at ufs_create+0x30 VOP_CREATE_APV(c0a0b320,e8c5aacc,2,c6655000,e8c5aa88,...) at VOP_CREATE_APV+0xda vn_open_cred(e8c5aba8,e8c5ac5c,1a4,c6128a00,c665a888,...) at vn_open_cred+0x19e vn_open(e8c5aba8,e8c5ac5c,1a4,c665a888,28321000,...) at vn_open+0x33 kern_openat(c6655000,ffffff9c,28306278,0,602,...) at kern_openat+0x108 kern_open(c6655000,28306278,0,601,1b6,...) at kern_open+0x35 open(c6655000,e8c5acf8,c,c09913c9,c09e8f0c,...) at open+0x30 syscall(e8c5ad38) at syscall+0x2d3 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (5, FreeBSD ELF32, open), eip = 0x281d6413, esp = 0xbfbfebfc, ebp = 0xbfbfec98 --- From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 19:23:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FFF31065670; Thu, 11 Jun 2009 19:23:37 +0000 (UTC) (envelope-from zec@freebsd.org) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id 761998FC17; Thu, 11 Jun 2009 19:23:36 +0000 (UTC) (envelope-from zec@freebsd.org) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id CE7A69B646; Thu, 11 Jun 2009 21:23:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL autolearn=unavailable version=3.1.7 Received: from localhost (imunes.tel.fer.hr [161.53.19.8]) by xaqua.tel.fer.hr (Postfix) with ESMTP id 91C049B649; Thu, 11 Jun 2009 21:23:11 +0200 (CEST) From: Marko Zec To: Pawel Jakub Dawidek Date: Thu, 11 Jun 2009 21:23:01 +0200 User-Agent: KMail/1.9.10 References: <200906111650.n5BGonnn053446@svn.freebsd.org> <20090611190140.GE2642@garage.freebsd.pl> In-Reply-To: <20090611190140.GE2642@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906112123.02105.zec@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 19:23:37 -0000 On Thursday 11 June 2009 21:01:40 Pawel Jakub Dawidek wrote: > On Thu, Jun 11, 2009 at 04:50:49PM +0000, Marko Zec wrote: > > Author: zec > > Date: Thu Jun 11 16:50:49 2009 > > New Revision: 194012 > > URL: http://svn.freebsd.org/changeset/base/194012 > > > > Log: > > Introduce a mechanism for detecting calls from outbound path of the > > network stack when reentering the inbound path from netgraph, and > > force queueing of mbufs at the outbound netgraph node. > > > > The mechanism relies on two components. First, in netgraph nodes > > where outbound path of the network stack calls into netgraph, the > > current thread has to be appropriately marked using the new > > NG_OUTBOUND_THREAD_REF() macro before proceeding to call further > > into the netgraph topology, and unmarked using the > > NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. > > Second, netgraph nodes which can potentially reenter the network > > stack in the inbound path have to mark their inbound hooks using > > NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will then > > detect when there is a danger of a call graph looping back from > > outbound to inbound path via netgraph, and defer handing off the > > mbufs to the "inbound" node to a worker thread with a clean stack. > > > > In this first pass only the most obvious netgraph nodes have been > > updated to ensure no outbound to inbound calls can occur. Nodes > > such as ng_ipfw, ng_gif etc. should be further examined whether a > > potential for outbound to inbound call looping exists. > > > > This commit changes the layout of struct thread, but due to > > __FreeBSD_version number shortage a version bump has been omitted > > at this time, nevertheless kernel and modules have to be rebuilt. > > Are you sure Marko that you can't use sys/sys/osd.h instead of adding > yet another field to the thread structure? Netgraph is optional > component and optional components could take advantage of allocating > stuff they need dynamically. The OSD (Object-Specific Data) KPI is > designed for use by optional components - you can add your data to a > thread, you can get it when you want and OSD will call your callback > when thread dies, so you can clean up. > > Maybe you can't, but it's worth checking. Hmm how much locking overhead do osd_set() / osd_get() methods introduce? We have to bump the refcount on each entry to netgraph, and then check it potentially on each hop to next ng node, and finally drop the refcount when done with the function call into netgraph. Accessing td_ng_outbound directly via curthread is as cheap as it gets performancewise as it requires no locking whatsoever... Cheers, Marko > PS. Currently OSD works for threads and jails, but it is ready to be > extended to work with other object types, eg. vnodes, ifnets, etc. > Even if you can't use it in this particular case, keep it in mind, > as it might be useful for other vimage-related stuff. > > > Modified: head/sys/sys/proc.h > > ========================================================================= > >===== --- head/sys/sys/proc.h Thu Jun 11 16:48:59 2009 (r194011) > > +++ head/sys/sys/proc.h Thu Jun 11 16:50:49 2009 (r194012) > > @@ -235,6 +235,7 @@ struct thread { > > char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ > > struct file *td_fpop; /* (k) file referencing cdev under op */ > > int td_dbgflags; /* (c) Userland debugger flags */ > > + int td_ng_outbound; /* (k) Thread entered ng from above. */ > > struct osd td_osd; /* (k) Object specific data. */ > > #define td_endzero td_base_pri From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 19:46:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51287106578C; Thu, 11 Jun 2009 19:46:30 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id 068FC8FC24; Thu, 11 Jun 2009 19:46:29 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c122-106-216-167.belrs3.nsw.optusnet.com.au [122.106.216.167]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5BJkRRP002639 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Jun 2009 05:46:27 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id n5BJkQkv002948; Fri, 12 Jun 2009 05:46:26 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id n5BJkQSZ002947; Fri, 12 Jun 2009 05:46:26 +1000 (EST) (envelope-from peter) Date: Fri, 12 Jun 2009 05:46:26 +1000 From: Peter Jeremy To: Ariff Abdullah Message-ID: <20090611194626.GA1757@server.vk2pj.dyndns.org> References: <200906080439.n584dllO015989@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: <200906080439.n584dllO015989@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193683 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 19:46:30 -0000 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2009-Jun-08 04:39:47 +0000, Ariff Abdullah wrote: >Log: > Add notes on various SND_* options. =2E.. >+options SND_DEBUG >+options SND_DIAGNOSTIC >+options SND_FEEDER_MULTIFORMAT >+options SND_FEEDER_FULL_MULTIFORMAT >+options SND_FEEDER_RATE_HP >+options SND_PCM_64 >+options SND_OLDSTEREO AFAIK, it's traditional for the whitespace here to be so that a 1 character indent (the '+' above or a '#' in a local config file) does not change the option name alignment. --=20 Peter Jeremy --M9NhX3UHpAaciwkO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkoxXxIACgkQ/opHv/APuIcKDgCfeweiQo73h9w/L56ibnhV9AbU gFcAni4HXLgp9sYc5vjGgtW/xB+GF8rw =a12g -----END PGP SIGNATURE----- --M9NhX3UHpAaciwkO-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 20:27:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4F3B1065677 for ; Thu, 11 Jun 2009 20:27:13 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outO.internet-mail-service.net (outo.internet-mail-service.net [216.240.47.238]) by mx1.freebsd.org (Postfix) with ESMTP id B531A8FC26 for ; Thu, 11 Jun 2009 20:27:13 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id A4F00D2028; Thu, 11 Jun 2009 13:27:36 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id DCED92D6017; Thu, 11 Jun 2009 13:27:12 -0700 (PDT) Message-ID: <4A3168A0.2090308@elischer.org> Date: Thu, 11 Jun 2009 13:27:12 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Marko Zec References: <200906111650.n5BGonnn053446@svn.freebsd.org> <20090611190140.GE2642@garage.freebsd.pl> <200906112123.02105.zec@freebsd.org> In-Reply-To: <200906112123.02105.zec@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 20:27:14 -0000 Marko Zec wrote: > On Thursday 11 June 2009 21:01:40 Pawel Jakub Dawidek wrote: >> On Thu, Jun 11, 2009 at 04:50:49PM +0000, Marko Zec wrote: >>> Author: zec >>> Date: Thu Jun 11 16:50:49 2009 >>> New Revision: 194012 >>> URL: http://svn.freebsd.org/changeset/base/194012 >>> >>> Log: >>> Introduce a mechanism for detecting calls from outbound path of the >>> network stack when reentering the inbound path from netgraph, and >>> force queueing of mbufs at the outbound netgraph node. >>> >>> The mechanism relies on two components. First, in netgraph nodes >>> where outbound path of the network stack calls into netgraph, the >>> current thread has to be appropriately marked using the new >>> NG_OUTBOUND_THREAD_REF() macro before proceeding to call further >>> into the netgraph topology, and unmarked using the >>> NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. >>> Second, netgraph nodes which can potentially reenter the network >>> stack in the inbound path have to mark their inbound hooks using >>> NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will then >>> detect when there is a danger of a call graph looping back from >>> outbound to inbound path via netgraph, and defer handing off the >>> mbufs to the "inbound" node to a worker thread with a clean stack. >>> >>> In this first pass only the most obvious netgraph nodes have been >>> updated to ensure no outbound to inbound calls can occur. Nodes >>> such as ng_ipfw, ng_gif etc. should be further examined whether a >>> potential for outbound to inbound call looping exists. >>> >>> This commit changes the layout of struct thread, but due to >>> __FreeBSD_version number shortage a version bump has been omitted >>> at this time, nevertheless kernel and modules have to be rebuilt. >> Are you sure Marko that you can't use sys/sys/osd.h instead of adding >> yet another field to the thread structure? Netgraph is optional >> component and optional components could take advantage of allocating >> stuff they need dynamically. The OSD (Object-Specific Data) KPI is >> designed for use by optional components - you can add your data to a >> thread, you can get it when you want and OSD will call your callback >> when thread dies, so you can clean up. >> >> Maybe you can't, but it's worth checking. > > Hmm how much locking overhead do osd_set() / osd_get() methods introduce? We > have to bump the refcount on each entry to netgraph, and then check it > potentially on each hop to next ng node, and finally drop the refcount when > done with the function call into netgraph. Accessing td_ng_outbound directly > via curthread is as cheap as it gets performancewise as it requires no > locking whatsoever... I would add that I suspect that we may end up using it in other places as well outside of netgraph. > Cheers, > > Marko > > >> PS. Currently OSD works for threads and jails, but it is ready to be >> extended to work with other object types, eg. vnodes, ifnets, etc. >> Even if you can't use it in this particular case, keep it in mind, >> as it might be useful for other vimage-related stuff. >> >>> Modified: head/sys/sys/proc.h >>> ========================================================================= >>> ===== --- head/sys/sys/proc.h Thu Jun 11 16:48:59 2009 (r194011) >>> +++ head/sys/sys/proc.h Thu Jun 11 16:50:49 2009 (r194012) >>> @@ -235,6 +235,7 @@ struct thread { >>> char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ >>> struct file *td_fpop; /* (k) file referencing cdev under op */ >>> int td_dbgflags; /* (c) Userland debugger flags */ >>> + int td_ng_outbound; /* (k) Thread entered ng from above. */ >>> struct osd td_osd; /* (k) Object specific data. */ >>> #define td_endzero td_base_pri > From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 21:31:48 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 675771065670; Thu, 11 Jun 2009 21:31:48 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id 238B68FC13; Thu, 11 Jun 2009 21:31:47 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id n5BLVkFC082992; Thu, 11 Jun 2009 15:31:46 -0600 (MDT) Message-ID: <4A3177BD.2060709@FreeBSD.org> Date: Thu, 11 Jun 2009 15:31:41 -0600 From: Jamie Gritton User-Agent: Thunderbird 2.0.0.19 (X11/20090109) MIME-Version: 1.0 To: Marko Zec References: <200906111650.n5BGonnn053446@svn.freebsd.org> <20090611190140.GE2642@garage.freebsd.pl> <200906112123.02105.zec@freebsd.org> In-Reply-To: <200906112123.02105.zec@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9456/Thu Jun 11 11:43:13 2009 on gritton.org X-Virus-Status: Clean Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 21:31:48 -0000 Marko Zec wrote: > On Thursday 11 June 2009 21:01:40 Pawel Jakub Dawidek wrote: >> On Thu, Jun 11, 2009 at 04:50:49PM +0000, Marko Zec wrote: >>> Author: zec >>> Date: Thu Jun 11 16:50:49 2009 >>> New Revision: 194012 >>> URL: http://svn.freebsd.org/changeset/base/194012 >>> >>> Log: >>> Introduce a mechanism for detecting calls from outbound path of the >>> network stack when reentering the inbound path from netgraph, and >>> force queueing of mbufs at the outbound netgraph node. >>> >>> The mechanism relies on two components. First, in netgraph nodes >>> where outbound path of the network stack calls into netgraph, the >>> current thread has to be appropriately marked using the new >>> NG_OUTBOUND_THREAD_REF() macro before proceeding to call further >>> into the netgraph topology, and unmarked using the >>> NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. >>> Second, netgraph nodes which can potentially reenter the network >>> stack in the inbound path have to mark their inbound hooks using >>> NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will then >>> detect when there is a danger of a call graph looping back from >>> outbound to inbound path via netgraph, and defer handing off the >>> mbufs to the "inbound" node to a worker thread with a clean stack. >>> >>> In this first pass only the most obvious netgraph nodes have been >>> updated to ensure no outbound to inbound calls can occur. Nodes >>> such as ng_ipfw, ng_gif etc. should be further examined whether a >>> potential for outbound to inbound call looping exists. >>> >>> This commit changes the layout of struct thread, but due to >>> __FreeBSD_version number shortage a version bump has been omitted >>> at this time, nevertheless kernel and modules have to be rebuilt. >> Are you sure Marko that you can't use sys/sys/osd.h instead of adding >> yet another field to the thread structure? Netgraph is optional >> component and optional components could take advantage of allocating >> stuff they need dynamically. The OSD (Object-Specific Data) KPI is >> designed for use by optional components - you can add your data to a >> thread, you can get it when you want and OSD will call your callback >> when thread dies, so you can clean up. >> >> Maybe you can't, but it's worth checking. > > Hmm how much locking overhead do osd_set() / osd_get() methods introduce? We > have to bump the refcount on each entry to netgraph, and then check it > potentially on each hop to next ng node, and finally drop the refcount when > done with the function call into netgraph. Accessing td_ng_outbound directly > via curthread is as cheap as it gets performancewise as it requires no > locking whatsoever... Very little, especially for threads. They lock an rmlock for reading (even for osd_set), one that's essentially never locked for writing. The assumption is that you're operating on curthread (which is the case here) that doesn't need any other synchronization. The first time you set something on a thread it'll take a malloc; after that set and get are simple array lookups with the aforementioned rmlock. The only problem with OSD in its current state is it's possible for osd_set to fail because it uses malloc(M_NOWAIT). But I plan on fixing that at some point anyway. > Cheers, > > Marko > > >> PS. Currently OSD works for threads and jails, but it is ready to be >> extended to work with other object types, eg. vnodes, ifnets, etc. >> Even if you can't use it in this particular case, keep it in mind, >> as it might be useful for other vimage-related stuff. >> >>> Modified: head/sys/sys/proc.h >>> ========================================================================= >>> ===== --- head/sys/sys/proc.h Thu Jun 11 16:48:59 2009 (r194011) >>> +++ head/sys/sys/proc.h Thu Jun 11 16:50:49 2009 (r194012) >>> @@ -235,6 +235,7 @@ struct thread { >>> char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ >>> struct file *td_fpop; /* (k) file referencing cdev under op */ >>> int td_dbgflags; /* (c) Userland debugger flags */ >>> + int td_ng_outbound; /* (k) Thread entered ng from above. */ >>> struct osd td_osd; /* (k) Object specific data. */ >>> #define td_endzero td_base_pri > > From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 21:32:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFC031065675; Thu, 11 Jun 2009 21:32:26 +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 DDD468FC23; Thu, 11 Jun 2009 21:32:26 +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 n5BLWQre060607; Thu, 11 Jun 2009 21:32:26 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BLWQFl060606; Thu, 11 Jun 2009 21:32:26 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200906112132.n5BLWQFl060606@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 11 Jun 2009 21:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194039 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 21:32:27 -0000 Author: gnn Date: Thu Jun 11 21:32:26 2009 New Revision: 194039 URL: http://svn.freebsd.org/changeset/base/194039 Log: Re-add the send queue tunable for people who do not use buffering. Reviewed by: jhb MFC after: 3 days Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Thu Jun 11 19:07:15 2009 (r194038) +++ head/sys/dev/cxgb/cxgb_main.c Thu Jun 11 21:32:26 2009 (r194039) @@ -224,6 +224,15 @@ TUNABLE_INT("hw.cxgb.use_16k_clusters", SYSCTL_UINT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN, &cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue "); +/* + * Tune the size of the output queue. + */ +int cxgb_snd_queue_len = IFQ_MAXLEN; +TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len); +SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, + &cxgb_snd_queue_len, 0, "send queue size "); + + enum { MAX_TXQ_ENTRIES = 16384, MAX_CTRL_TXQ_ENTRIES = 1024, @@ -1025,7 +1034,7 @@ cxgb_port_attach(device_t dev) ifp->if_timer = 0; /* Disable ifnet watchdog */ ifp->if_watchdog = NULL; - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 22:24:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89E121065670; Thu, 11 Jun 2009 22:24:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76D488FC17; Thu, 11 Jun 2009 22:24:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BMO8VR061878; Thu, 11 Jun 2009 22:24:08 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BMO8rm061874; Thu, 11 Jun 2009 22:24:08 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906112224.n5BMO8rm061874@svn.freebsd.org> From: Kip Macy Date: Thu, 11 Jun 2009 22:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194043 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 22:24:09 -0000 Author: kmacy Date: Thu Jun 11 22:24:08 2009 New Revision: 194043 URL: http://svn.freebsd.org/changeset/base/194043 Log: pjd has requested that I keep the tunable as zfs_prefetch_disable to minimize gratuitous differences with Opensolaris' ZFS Sorry for the churn Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jun 11 22:00:54 2009 (r194042) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jun 11 22:24:08 2009 (r194043) @@ -158,7 +158,7 @@ static int arc_grow_retry = 60; */ static int arc_min_prefetch_lifespan; -extern int zfs_prefetch_enable; +extern int zfs_prefetch_disable; static int arc_dead; /* @@ -3552,21 +3552,21 @@ arc_init(void) mutex_init(&zfs_write_limit_lock, NULL, MUTEX_DEFAULT, NULL); #ifdef _KERNEL - if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_enable", &zfs_prefetch_enable)) + if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_disable", &zfs_prefetch_disable)) prefetch_tunable_set = 1; #ifdef __i386__ if (prefetch_tunable_set == 0) { printf("ZFS NOTICE: prefetch is disabled by default on i386" " - add enable to tunable to change.\n" ); - zfs_prefetch_enable=0; + zfs_prefetch_disable=1; } #else if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) && prefetch_tunable_set == 0) { printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set" "... disabling.\n"); - zfs_prefetch_enable=0; + zfs_prefetch_disable=1; } #endif /* Warn about ZFS memory and address space requirements. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Jun 11 22:00:54 2009 (r194042) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Jun 11 22:24:08 2009 (r194043) @@ -326,7 +326,7 @@ dmu_prefetch(objset_t *os, uint64_t obje uint64_t blkid; int nblks, i, err; - if (zfs_prefetch_enable == 0) + if (zfs_prefetch_disable) return; if (len == 0) { /* they're interested in the bonus buffer */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Thu Jun 11 22:00:54 2009 (r194042) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Thu Jun 11 22:24:08 2009 (r194043) @@ -37,7 +37,7 @@ * until we can get this working the way we want it to. */ -int zfs_prefetch_enable = 1; +int zfs_prefetch_disable = 0; /* max # of streams per zfetch */ uint32_t zfetch_max_streams = 8; @@ -49,8 +49,8 @@ uint32_t zfetch_block_cap = 256; uint64_t zfetch_array_rd_sz = 1024 * 1024; SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_enable, CTLFLAG_RDTUN, - &zfs_prefetch_enable, 0, "Enable prefetch for systems with less than 4GB"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN, + &zfs_prefetch_disable, 0, "Disable prefetch"); SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH"); TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RDTUN, @@ -598,7 +598,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset unsigned int blkshft; uint64_t blksz; - if (zfs_prefetch_enable == 0) + if (zfs_prefetch_disable) return; /* files that aren't ln2 blocksz are only one block -- nothing to do */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jun 11 22:00:54 2009 (r194042) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jun 11 22:24:08 2009 (r194043) @@ -457,7 +457,7 @@ int dmu_write_uio(objset_t *os, uint64_t int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, struct page *pp, dmu_tx_t *tx); -extern int zfs_prefetch_enable; +extern int zfs_prefetch_disable; /* * Asynchronously try to read in the data. From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 23:43:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from miki (localhost [IPv6:::1]) by hub.freebsd.org (Postfix) with SMTP id 88CA11065670; Thu, 11 Jun 2009 23:43:55 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Date: Fri, 12 Jun 2009 07:43:51 +0800 From: Ariff Abdullah To: Giorgos Keramidas Message-Id: <20090612074351.4e70cd35.ariff@FreeBSD.org> In-Reply-To: <878wjya8li.fsf@kobe.laptop> References: <200906071912.n57JC9GZ002423@svn.freebsd.org> <878wjya8li.fsf@kobe.laptop> Organization: FreeBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Fri__12_Jun_2009_07_43_51_+0800_+sxO=48bmwgEOimt" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193640 - in head/sys: conf dev/sound dev/sound/isa dev/sound/macio dev/sound/midi dev/sound/pci dev/sound/pci/hda dev/sound/pcm dev/sound/sbus dev/sound/usb modules/sound/sound sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 23:43:57 -0000 --Signature=_Fri__12_Jun_2009_07_43_51_+0800_+sxO=48bmwgEOimt Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 11 Jun 2009 22:11:53 +0300 Giorgos Keramidas wrote: > On Sun, 7 Jun 2009 19:12:09 +0000 (UTC), Ariff Abdullah > wrote: > > Author: ariff > > Date: Sun Jun 7 19:12:08 2009 > > New Revision: 193640 > > URL: http://svn.freebsd.org/changeset/base/193640 > > > > Log: > > Sound Mega-commit. Expect further cleanup until code freeze. > > > > For a slightly thorough explaination, please refer to > > [1] http://people.freebsd.org/~ariff/SOUND_4.TXT.html . > > > > Summary of changes includes: > > > > 1 Volume Per-Channel (vpc). Provides private / standalone > > volume control >=20 > Hi Ariff, >=20 > This seems to have broken sound on my Thinkpad X61s. I just build a > userland and kernel from /head at rev 193984 and I have no sound at > all, even though /dev/sndstat shows my sound card: >=20 > $ cat /dev/sndstat=20 > FreeBSD Audio Driver (newpcm: 32bit 2009060800/i386) > Installed devices: > pcm0: at cad 0 nid 1 on > hdac0 kld snd_hda [MPSAFE] (1p:1v/1r:1v channels duplex default) >=20 > > Kernel hints: > > - hint.pcm.%d.vpc (0 =3D disable vpc). >=20 > Setting hint.pcm.0.vpc=3D0 didn't seem to bring back sound: >=20 > > fgrep vpc /boot/loader.conf > hint.pcm.0.vpc=3D0 >=20 > I am trying to build a userland+kernel from svn rev 193639 to see if > I can get back sound, but attached is a verbose dmesg from a recent > kernel (rev 193984). >=20 Yes, please. > Any ideas why the pcm0 device would show up in sndstat and mixer(1) > but produce no sound at all? >=20 Everything looks normal to me. Try r193640 afterwards. Just the kernel should be enough. -- Ariff Abdullah FreeBSD ... Recording in stereo is obviously too advanced and confusing for us idiot ***** users :P ........ ... Going with the standard and orthodox is the death of intellect .............. --Signature=_Fri__12_Jun_2009_07_43_51_+0800_+sxO=48bmwgEOimt Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkoxlrcACgkQlr+deMUwTNqmuQCcDIaaubZFwsCxn9Xq12PveXMV TyEAniEdD3oSGuJa+G5S4lBPLjhgOEgK =25QT -----END PGP SIGNATURE----- --Signature=_Fri__12_Jun_2009_07_43_51_+0800_+sxO=48bmwgEOimt-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 00:07:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E0A0106566B; Fri, 12 Jun 2009 00:07:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BD558FC14; Fri, 12 Jun 2009 00:07:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5C07A9q063914; Fri, 12 Jun 2009 00:07:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5C07A5D063913; Fri, 12 Jun 2009 00:07:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906120007.n5C07A5D063913@svn.freebsd.org> From: Warner Losh Date: Fri, 12 Jun 2009 00:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194044 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 00:07:10 -0000 Author: imp Date: Fri Jun 12 00:07:09 2009 New Revision: 194044 URL: http://svn.freebsd.org/changeset/base/194044 Log: devclass_find_free_unit(xxx, 0) is identical to -1 for most applications (including this one). Switch to it since the former is a racy interface. Modified: head/sys/arm/xscale/ixp425/avila_ata.c Modified: head/sys/arm/xscale/ixp425/avila_ata.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_ata.c Thu Jun 11 22:24:08 2009 (r194043) +++ head/sys/arm/xscale/ixp425/avila_ata.c Fri Jun 12 00:07:09 2009 (r194044) @@ -248,7 +248,7 @@ ata_avila_attach(device_t dev) NULL, ata_avila_intr, sc, &sc->sc_ih); /* attach channel on this controller */ - device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 0)); + device_add_child(dev, "ata", -1); bus_generic_attach(dev); return 0; From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 00:52:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FAA4106564A; Fri, 12 Jun 2009 00:52:41 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.221.173]) by mx1.freebsd.org (Postfix) with ESMTP id C23998FC15; Fri, 12 Jun 2009 00:52:40 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qyk3 with SMTP id 3so2694386qyk.3 for ; Thu, 11 Jun 2009 17:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=rjk9fCnG94ezrqM/DfRzsMuaxw2AV0UA3v+PwdooyFg=; b=XzSgFB2wEEWF2pF+j4EU7/NTrj/rW1K8nV93gnOLdEnvtGSQqcOAMCmAtf9ixxXWO8 QKiQq+ZPhx8Ln4jr7bJGMr5JXPeMC+dvH1Qd0l2L3j6coOluWC7HX+DP1c8/ujbSKjyV I/sDnw+GWm8izfNrE9BIaprrv87lVs188LLAM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=KyNorEoTuF94WacQuvH/6Ypu0Bq2vnQt9fQlmJBsGiIMyWZdSFS8uLkPrBhGj7AbmZ eykgKHthI3Lugf5f/0NFXPNoDnDRaNUMcs85gtiYhBS1pYdvaH7QTd/c2l4zpK9t5LJi sjofmZMu0+/CXynoI8fwSwpAxMKYaG59M5lP4= Received: by 10.224.19.131 with SMTP id a3mr3827119qab.23.1244766485047; Thu, 11 Jun 2009 17:28:05 -0700 (PDT) Received: from kan.dnsalias.net (c-98-217-224-113.hsd1.ma.comcast.net [98.217.224.113]) by mx.google.com with ESMTPS id 7sm772541qwf.29.2009.06.11.17.28.03 (version=SSLv3 cipher=RC4-MD5); Thu, 11 Jun 2009 17:28:04 -0700 (PDT) Date: Thu, 11 Jun 2009 20:27:57 -0400 From: Alexander Kabaev To: Julian Elischer Message-ID: <20090611202757.7cb0dad5@kan.dnsalias.net> In-Reply-To: <4A3168A0.2090308@elischer.org> References: <200906111650.n5BGonnn053446@svn.freebsd.org> <20090611190140.GE2642@garage.freebsd.pl> <200906112123.02105.zec@freebsd.org> <4A3168A0.2090308@elischer.org> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.2; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/tZE2c3nejT_urZzkoxJV3Jj"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 00:52:41 -0000 --Sig_/tZE2c3nejT_urZzkoxJV3Jj Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 11 Jun 2009 13:27:12 -0700 Julian Elischer wrote: > Marko Zec wrote: > > On Thursday 11 June 2009 21:01:40 Pawel Jakub Dawidek wrote: > >> On Thu, Jun 11, 2009 at 04:50:49PM +0000, Marko Zec wrote: > >>> Author: zec > >>> Date: Thu Jun 11 16:50:49 2009 > >>> New Revision: 194012 > >>> URL: http://svn.freebsd.org/changeset/base/194012 > >>> > >>> Log: > >>> Introduce a mechanism for detecting calls from outbound path of > >>> the network stack when reentering the inbound path from netgraph, > >>> and force queueing of mbufs at the outbound netgraph node. > >>> > >>> The mechanism relies on two components. First, in netgraph > >>> nodes where outbound path of the network stack calls into > >>> netgraph, the current thread has to be appropriately marked using > >>> the new NG_OUTBOUND_THREAD_REF() macro before proceeding to call > >>> further into the netgraph topology, and unmarked using the > >>> NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. > >>> Second, netgraph nodes which can potentially reenter the network > >>> stack in the inbound path have to mark their inbound hooks using > >>> NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will > >>> then detect when there is a danger of a call graph looping back > >>> from outbound to inbound path via netgraph, and defer handing off > >>> the mbufs to the "inbound" node to a worker thread with a clean > >>> stack. > >>> > >>> In this first pass only the most obvious netgraph nodes have > >>> been updated to ensure no outbound to inbound calls can occur. > >>> Nodes such as ng_ipfw, ng_gif etc. should be further examined > >>> whether a potential for outbound to inbound call looping exists. > >>> > >>> This commit changes the layout of struct thread, but due to > >>> __FreeBSD_version number shortage a version bump has been > >>> omitted at this time, nevertheless kernel and modules have to be > >>> rebuilt. > >> Are you sure Marko that you can't use sys/sys/osd.h instead of > >> adding yet another field to the thread structure? Netgraph is > >> optional component and optional components could take advantage of > >> allocating stuff they need dynamically. The OSD (Object-Specific > >> Data) KPI is designed for use by optional components - you can add > >> your data to a thread, you can get it when you want and OSD will > >> call your callback when thread dies, so you can clean up. > >> > >> Maybe you can't, but it's worth checking. > >=20 > > Hmm how much locking overhead do osd_set() / osd_get() methods > > introduce? We have to bump the refcount on each entry to netgraph, > > and then check it potentially on each hop to next ng node, and > > finally drop the refcount when done with the function call into > > netgraph. Accessing td_ng_outbound directly via curthread is as > > cheap as it gets performancewise as it requires no locking > > whatsoever... >=20 > I would add that I suspect that we may end up using it in other > places as well outside of netgraph. >=20 When that happens then per-thread field can be revisited again. Blowing the side of major kernel structure for the sake of subsystem is unused by 90%+ percent of users is little too drastic IMHO. I do second Pawel's opinion that you should look at osd for the time being. After all it was invented for just this reason. --=20 Alexander Kabaev --Sig_/tZE2c3nejT_urZzkoxJV3Jj Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iD8DBQFKMaESQ6z1jMm+XZYRAmoaAJ0aN9TcVyUrA0YwIdca3HrZ7FLcjACgy/PQ qlhpfc1PpiFDR60KfrYlPSU= =qWGc -----END PGP SIGNATURE----- --Sig_/tZE2c3nejT_urZzkoxJV3Jj-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 02:56:57 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F8E8106566B; Fri, 12 Jun 2009 02:56:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8F08FC14; Fri, 12 Jun 2009 02:56:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5C2uraw002956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Jun 2009 12:56:54 +1000 Date: Fri, 12 Jun 2009 12:56:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200906111437.n5BEbJdC050303@svn.freebsd.org> Message-ID: <20090612123608.F22046@delplex.bde.org> References: <200906111437.n5BEbJdC050303@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r194003 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 02:56:58 -0000 On Thu, 11 Jun 2009, John Baldwin wrote: > Log: > Correct printf format type mismatches. > > Modified: > head/sys/netinet/tcp_usrreq.c This is backwards. As I explained in the mail that pointed out this bug, the bug is that the variables should have remained having an unsigned type. > Modified: head/sys/netinet/tcp_usrreq.c > ============================================================================== > --- head/sys/netinet/tcp_usrreq.c Thu Jun 11 14:36:13 2009 (r194002) > +++ head/sys/netinet/tcp_usrreq.c Thu Jun 11 14:37:18 2009 (r194003) > @@ -1823,7 +1823,7 @@ db_print_tcpcb(struct tcpcb *tp, const c > tp->snd_recover); > > db_print_indent(indent); > - db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", > + db_printf("t_maxopd: %u t_rcvtime: %d t_startime: %d\n", > tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); > ... The times are unsigned integers mod (UINT_MAX + 1) (except for these bugs). E.g., the time INT_MAX is 1 less than the time ((u_int)INT_MAX + 1). With the times obfuscated as being ints, (INT_MAX + 1) overflows and gives undefined behaviour, normally to the value INT_MIN with no trap on 2's complement machines. Then the difference (INT_MIN - INT_MAX) overflows and gives undefined behaviour, normally to the value 1 which is what is wanted. Printing the values in a bug-for-bug compatible format mainly exposes this misbehaviour to users. In the overflowing case that you just fixed, the user would see times near INT_MAX and INT_MIN and have to know that INT_MAX = 2147483647 and INT_MIN = -2147483647 is really one larger than INT_MAX to debug these times. (With the old broken u_long types, on 64-bit machines the user migh see the much less familiar number (uint64_t)INT_MIN = 2^64 - 2^31 = 18446744071562067968.) With correct u_int types, the user will see an apparent discontinuity at UINT_MAX = 4294967295 wrapping to 0, but that is easier to understand because 0 is much shorter than 2147... or 1844... The user might also be confused printing out `int ticks' in %d format, but then in ddb it is the user's fault for using the wrong format. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 03:13:03 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC6CB106566C; Fri, 12 Jun 2009 03:13:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id 71FC38FC13; Fri, 12 Jun 2009 03:13:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5C3CvYB026504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Jun 2009 13:12:58 +1000 Date: Fri, 12 Jun 2009 13:12:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200906111018.20703.jhb@freebsd.org> Message-ID: <20090612125702.M22046@delplex.bde.org> References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <20090611124334.A21109@delplex.bde.org> <200906111018.20703.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 03:13:03 -0000 On Thu, 11 Jun 2009, John Baldwin wrote: > On Wednesday 10 June 2009 11:53:16 pm Bruce Evans wrote: >> On Wed, 10 Jun 2009, John Baldwin wrote: >> >>> Log: >>> Change a few members of tcpcb that store cached copies of ticks to be ints >>> instead of unsigned longs. This fixes a few overflow edge cases on 64-bit >>> platforms. Specifically, if an idle connection receives a packet shortly >> >> I think the variables should still be unsigned (ints now). Otherwise there >> is at best benign undefined behaviour when the variables overflow at >> INT_MAX, while the code is apparently designed to work with unsigned >> values (it casts to int to look at differences between the unsigned values). > > I wanted to match 'ticks' and figured changing 'ticks' was a far larger > headache. By changing the signedness you get undefined behaviour for the other types too, and risk new and/or different sign extension bugs. >>> Modified: head/sys/netinet/tcp_input.c >>> ============================================================================== >>> --- head/sys/netinet/tcp_input.c Wed Jun 10 18:26:02 2009 (r193940) >>> +++ head/sys/netinet/tcp_input.c Wed Jun 10 18:27:15 2009 (r193941) >>> @@ -1778,7 +1778,7 @@ tcp_do_segment(struct mbuf *m, struct tc >>> TSTMP_LT(to.to_tsval, tp->ts_recent)) { >>> >>> /* Check to see if ts_recent is over 24 days old. */ >>> - if ((int)(ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) { >>> + if ((ticks - tp->ts_recent_age) > TCP_PAWS_IDLE) { >> >> The variables are now ints, and there is now also overflow in the >> subtraction. E.g., INT_MAX - INT_MIN now overflows. On 2's complement >> machines it normally overflows to -2, which is probably the wrong value >> (the large unsigned value 0xFFF...FEU is probably correct), but it is >> the same value as is given by casting the difference of unsigned values >> to int ((int)0xFFF...FEU = -2). This is because, when representing times >> mod UINT_MAX+1, all time differences up to UINT_MAX can be represented, >> but only if we keep track of which operand is older (here we probably do >> know that ts_recent_age is older); if we don't keep track then we normally >> assume that (unsigned) differences smaller than INT_MAX mean that the >> difference is nonnegative while differences larger than INT_MAX mean >> that the difference is negative. The signed interpreatation works well >> if we know that the nonnegative differences never exceed INT_MAX. > > I believe in these cases that 1) the differences should never exceed INT_MAX, > and 2) we do know which value should be older. Except for limit variables like t_badrxtwin that start larger than `ticks' and become smaller when the limit is reached. Presumably the limit is only reached in unusual cases, but we have to test to see if it is. We must test more often that every INT_MAX ticks to see the limit being reached, but that is not a problem. >>> Modified: head/sys/netinet/tcp_var.h >>> ============================================================================== >>> --- head/sys/netinet/tcp_var.h Wed Jun 10 18:26:02 2009 (r193940) >>> +++ head/sys/netinet/tcp_var.h Wed Jun 10 18:27:15 2009 (r193941) >>> @@ -139,8 +139,8 @@ struct tcpcb { >>> >>> u_int t_maxopd; /* mss plus options */ >>> >>> - u_long t_rcvtime; /* inactivity time */ >>> - u_long t_starttime; /* time connection was established */ >>> + int t_rcvtime; /* inactivity time */ >>> + int t_starttime; /* time connection was established */ >>> int t_rtttime; /* round trip time */ >>> tcp_seq t_rtseq; /* sequence number being timed */ >>> >>> @@ -167,7 +167,7 @@ struct tcpcb { >>> u_char rcv_scale; /* window scaling for recv window */ >>> u_char request_r_scale; /* pending window scaling */ >>> u_int32_t ts_recent; /* timestamp echo data */ >>> - u_long ts_recent_age; /* when last updated */ >>> + int ts_recent_age; /* when last updated */ >>> u_int32_t ts_offset; /* our timestamp offset */ >>> >>> tcp_seq last_ack_sent; >>> @@ -175,7 +175,7 @@ struct tcpcb { >>> u_long snd_cwnd_prev; /* cwnd prior to retransmit */ >>> u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ >>> tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ >>> - u_long t_badrxtwin; /* window for retransmit recovery */ >>> + int t_badrxtwin; /* window for retransmit recovery */ >>> u_char snd_limited; /* segments limited transmitted */ >>> /* SACK related state */ >>> int snd_numholes; /* number of holes seen by sender */ >>> >> >> Should all be changed to u_int? >> >> There still seem to be some very nice sign extension/overflow bugs. >> E.g., `ticks' is (bogusly) signed. After changing the above variables >> to int to be bug for bug compatible with `ticks', the semantics of >> expressions not directly touched in this commit is changed too. E.g., >> there is the expression `ticks < tp->t_badrxtwin'. Changing the signedness >> of the type of tp_t_badrxtwin stops promotion of `ticks' to unsigned in >> this expression. However, this expression seems to have been just broken >> before, and the change only moves the bug slightly (from times near where >> `ticks' wraps around at to to times near where `ticks' overflows at >> INT_MAX). To handle wraparound and avoid overflow, such expressions should >> be written as (int)(ticks - tp->t_badrxtwin) < 0 where the variables have >> unsigned type. This seems to have already been done for all the other >> variables changed in this commit, except the cast to int is missing in >> some cases. > > Yes, I noticed the t_badrxtwin breakage but wasn't sure how best to fix it > (or at least thought that it should be a separate followup since it was > already broken with wraparound). I considered making it work more like > the other variables such as t_rcvtime that merely store a cached value of > 'ticks' and then use 'ticks - foo' and compare it with the given interval. > This would entail renaming 't_badrxtwin' to 't_badrxttime' or some such. > That seems clearer to me than '(int)(ticks - t_badrxtwin) < 0'. `ticks < t_limitvar' is more optimal than `ticks - t_startvar < max', but harder to get right. Compilers even try to transform the latter to the former (e.g., for loop counters), but they cannot do this if overflow or wraparound is a possibility (except overflow gives undefined behaviour so compilers can do anything). After fixing the former to `(int)(ticks - t_limitvar) < 0' it has the same number of operations as the latter and would only be more efficient if 0 is easier to load and/or compare with than `max'. But casting to (int) seems clear to me -- it is idiomatic for recovering signed differences from circular counters. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 06:46:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2607106566B for ; Fri, 12 Jun 2009 06:46:24 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outI.internet-mail-service.net (outi.internet-mail-service.net [216.240.47.232]) by mx1.freebsd.org (Postfix) with ESMTP id B02AA8FC0A for ; Fri, 12 Jun 2009 06:46:24 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 19D35B8930; Thu, 11 Jun 2009 23:46:38 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 6CECC2D6019; Thu, 11 Jun 2009 23:46:23 -0700 (PDT) Message-ID: <4A31F9BE.6000405@elischer.org> Date: Thu, 11 Jun 2009 23:46:22 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Alexander Kabaev References: <200906111650.n5BGonnn053446@svn.freebsd.org> <20090611190140.GE2642@garage.freebsd.pl> <200906112123.02105.zec@freebsd.org> <4A3168A0.2090308@elischer.org> <20090611202757.7cb0dad5@kan.dnsalias.net> In-Reply-To: <20090611202757.7cb0dad5@kan.dnsalias.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 06:46:25 -0000 Alexander Kabaev wrote: > On Thu, 11 Jun 2009 13:27:12 -0700 > Julian Elischer wrote: > >> Marko Zec wrote: >>> On Thursday 11 June 2009 21:01:40 Pawel Jakub Dawidek wrote: >>>> On Thu, Jun 11, 2009 at 04:50:49PM +0000, Marko Zec wrote: >>>>> Author: zec >>>>> Date: Thu Jun 11 16:50:49 2009 >>>>> New Revision: 194012 >>>>> URL: http://svn.freebsd.org/changeset/base/194012 >>>>> >>>>> Log: >>>>> Introduce a mechanism for detecting calls from outbound path of >>>>> the network stack when reentering the inbound path from netgraph, >>>>> and force queueing of mbufs at the outbound netgraph node. >>>>> >>>>> The mechanism relies on two components. First, in netgraph >>>>> nodes where outbound path of the network stack calls into >>>>> netgraph, the current thread has to be appropriately marked using >>>>> the new NG_OUTBOUND_THREAD_REF() macro before proceeding to call >>>>> further into the netgraph topology, and unmarked using the >>>>> NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. >>>>> Second, netgraph nodes which can potentially reenter the network >>>>> stack in the inbound path have to mark their inbound hooks using >>>>> NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will >>>>> then detect when there is a danger of a call graph looping back >>>>> from outbound to inbound path via netgraph, and defer handing off >>>>> the mbufs to the "inbound" node to a worker thread with a clean >>>>> stack. >>>>> >>>>> In this first pass only the most obvious netgraph nodes have >>>>> been updated to ensure no outbound to inbound calls can occur. >>>>> Nodes such as ng_ipfw, ng_gif etc. should be further examined >>>>> whether a potential for outbound to inbound call looping exists. >>>>> >>>>> This commit changes the layout of struct thread, but due to >>>>> __FreeBSD_version number shortage a version bump has been >>>>> omitted at this time, nevertheless kernel and modules have to be >>>>> rebuilt. >>>> Are you sure Marko that you can't use sys/sys/osd.h instead of >>>> adding yet another field to the thread structure? Netgraph is >>>> optional component and optional components could take advantage of >>>> allocating stuff they need dynamically. The OSD (Object-Specific >>>> Data) KPI is designed for use by optional components - you can add >>>> your data to a thread, you can get it when you want and OSD will >>>> call your callback when thread dies, so you can clean up. >>>> >>>> Maybe you can't, but it's worth checking. >>> Hmm how much locking overhead do osd_set() / osd_get() methods >>> introduce? We have to bump the refcount on each entry to netgraph, >>> and then check it potentially on each hop to next ng node, and >>> finally drop the refcount when done with the function call into >>> netgraph. Accessing td_ng_outbound directly via curthread is as >>> cheap as it gets performancewise as it requires no locking >>> whatsoever... >> I would add that I suspect that we may end up using it in other >> places as well outside of netgraph. >> > > When that happens then per-thread field can be revisited again. Blowing > the side of major kernel structure for the sake of subsystem is > unused by 90%+ percent of users is little too drastic IMHO. > > I do second Pawel's opinion that you should look at osd for the time > being. After all it was invented for just this reason. And I beg to dissagree. Firstly this is not the first field to be put in these structures for a single module. Secondly, the overhead of doing it in the manner suggested would be quite noticeable I think, certainly a drain on what could be a fast-path for some packet processing. From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 07:07:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 593371065677 for ; Fri, 12 Jun 2009 07:07:42 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outW.internet-mail-service.net (outw.internet-mail-service.net [216.240.47.246]) by mx1.freebsd.org (Postfix) with ESMTP id 396068FC16 for ; Fri, 12 Jun 2009 07:07:42 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id F2C4ECD467; Fri, 12 Jun 2009 00:08:01 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 83CA62D6004; Fri, 12 Jun 2009 00:07:41 -0700 (PDT) Message-ID: <4A31FEBD.6020601@elischer.org> Date: Fri, 12 Jun 2009 00:07:41 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200906111650.n5BGonnn053446@svn.freebsd.org> <20090611190140.GE2642@garage.freebsd.pl> In-Reply-To: <20090611190140.GE2642@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 07:07:42 -0000 Pawel Jakub Dawidek wrote: > Are you sure Marko that you can't use sys/sys/osd.h instead of adding > yet another field to the thread structure? Netgraph is optional > component and optional components could take advantage of allocating > stuff they need dynamically. The OSD (Object-Specific Data) KPI is > designed for use by optional components - you can add your data to a > thread, you can get it when you want and OSD will call your callback > when thread dies, so you can clean up. > > Maybe you can't, but it's worth checking. > > PS. Currently OSD works for threads and jails, but it is ready to be > extended to work with other object types, eg. vnodes, ifnets, etc. > Even if you can't use it in this particular case, keep it in mind, > as it might be useful for other vimage-related stuff. > BTW Having a quick look around I don't see a man page for osd, and I'd never looked at it until today, nor even really heard of it. (except I saw jamie used it for something). if the include page is the main documentation then it need some comments. From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 07:39:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B60F2106566B; Fri, 12 Jun 2009 07:39:10 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A31978FC18; Fri, 12 Jun 2009 07:39:10 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5C7dA7f074024; Fri, 12 Jun 2009 07:39:10 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5C7dAIZ074023; Fri, 12 Jun 2009 07:39:10 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906120739.n5C7dAIZ074023@svn.freebsd.org> From: Ariff Abdullah Date: Fri, 12 Jun 2009 07:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194047 - head/sys/modules/sound/sound X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 07:39:11 -0000 Author: ariff Date: Fri Jun 12 07:39:10 2009 New Revision: 194047 URL: http://svn.freebsd.org/changeset/base/194047 Log: Last (hopefully) attempt to fix both parallel build and cyclic dependencies, in a simmilar fashion to kmod.mk. Discussed with: bde, bz Modified: head/sys/modules/sound/sound/Makefile Modified: head/sys/modules/sound/sound/Makefile ============================================================================== --- head/sys/modules/sound/sound/Makefile Fri Jun 12 07:34:34 2009 (r194046) +++ head/sys/modules/sound/sound/Makefile Fri Jun 12 07:39:10 2009 (r194047) @@ -19,19 +19,25 @@ SRCS+= ac97.c ac97_patch.c buffer.c chan SRCS+= mixer.c sndstat.c sound.c unit.c vchan.c SRCS+= midi.c mpu401.c sequencer.c -@/tools/sound/feeder_eq_mkfilter.awk: @ - -@/tools/sound/feeder_rate_mkfilter.awk: @ - -@/tools/sound/snd_fxdiv_gen.awk: @ - -feeder_eq_gen.h: @/tools/sound/feeder_eq_mkfilter.awk machine +.if !exists(@) +feeder_eq_gen.h: @ +.else +feeder_eq_gen.h: @/tools/sound/feeder_eq_mkfilter.awk +.endif ${AWK} -f @/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET} -feeder_rate_gen.h: @/tools/sound/feeder_rate_mkfilter.awk machine +.if !exists(@) +feeder_rate_gen.h: @ +.else +feeder_rate_gen.h: @/tools/sound/feeder_rate_mkfilter.awk +.endif ${AWK} -f @/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET} -snd_fxdiv_gen.h: @/tools/sound/snd_fxdiv_gen.awk machine +.if !exists(@) +snd_fxdiv_gen.h: @ +.else +snd_fxdiv_gen.h: @/tools/sound/snd_fxdiv_gen.awk +.endif ${AWK} -f @/tools/sound/snd_fxdiv_gen.awk -- > ${.TARGET} CLEANFILES+= feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 09:05:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 273ED106566C; Fri, 12 Jun 2009 09:05:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 147B58FC22; Fri, 12 Jun 2009 09:05:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5C95Nlx075807; Fri, 12 Jun 2009 09:05:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5C95NUp075806; Fri, 12 Jun 2009 09:05:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906120905.n5C95NUp075806@svn.freebsd.org> From: Andriy Gapon Date: Fri, 12 Jun 2009 09:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194049 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 09:05:24 -0000 Author: avg Date: Fri Jun 12 09:05:23 2009 New Revision: 194049 URL: http://svn.freebsd.org/changeset/base/194049 Log: KOBJMETHOD: throw the switch on kobj method signature checking It seems that current code should pass the check. This commit should not lead to any changes in compiled code. From now on a warning shall be produced if kobj method implementation function has a mismatching signature. Verified by: md5 Reviewed by: imp Approved by: jhb (mentor) Modified: head/sys/sys/kobj.h Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Fri Jun 12 07:48:35 2009 (r194048) +++ head/sys/sys/kobj.h Fri Jun 12 09:05:23 2009 (r194049) @@ -91,13 +91,11 @@ struct kobjop_desc { /* * Shorthand for constructing method tables. + * The ternary operator is (ab)used to provoke a warning when FUNC + * has a signature that is not compatible with kobj method signature. */ -#if 1 -#define KOBJMETHOD(NAME, FUNC) { &NAME##_desc, (kobjop_t) FUNC } -#else /* notyet */ #define KOBJMETHOD(NAME, FUNC) \ { &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) } -#endif /* * From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 09:20:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DD7F1065670; Fri, 12 Jun 2009 09:20:31 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2678FC0A; Fri, 12 Jun 2009 09:20:31 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5C9KVtp076213; Fri, 12 Jun 2009 09:20:31 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5C9KVIf076212; Fri, 12 Jun 2009 09:20:31 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906120920.n5C9KVIf076212@svn.freebsd.org> From: Marko Zec Date: Fri, 12 Jun 2009 09:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194051 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 09:20:32 -0000 Author: zec Date: Fri Jun 12 09:20:31 2009 New Revision: 194051 URL: http://svn.freebsd.org/changeset/base/194051 Log: Assign ng_eiface nodes a netgraph name on instantiation, in a way which is consistent with the current behavior of ng_iface, i.e. borrow the same naming code from ng_iface.c. Approved by: julian (mentor) Modified: head/sys/netgraph/ng_eiface.c Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Fri Jun 12 09:08:25 2009 (r194050) +++ head/sys/netgraph/ng_eiface.c Fri Jun 12 09:20:31 2009 (r194051) @@ -387,12 +387,10 @@ ng_eiface_constructor(node_p node) ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ifp->if_flags = (IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST); -#if 0 - /* Give this node name */ - bzero(ifname, sizeof(ifname)); - sprintf(ifname, "if%s", ifp->if_xname); - (void)ng_name_node(node, ifname); -#endif + /* Give this node the same name as the interface (if possible) */ + if (ng_name_node(node, ifp->if_xname) != 0) + log(LOG_WARNING, "%s: can't acquire netgraph name\n", + ifp->if_xname); /* Attach the interface */ ether_ifattach(ifp, eaddr); From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 09:31:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 591A71065672; Fri, 12 Jun 2009 09:31:14 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46CC18FC17; Fri, 12 Jun 2009 09:31:14 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5C9VE6X076449; Fri, 12 Jun 2009 09:31:14 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5C9VEmU076448; Fri, 12 Jun 2009 09:31:14 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200906120931.n5C9VEmU076448@svn.freebsd.org> From: Marko Zec Date: Fri, 12 Jun 2009 09:31: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: r194052 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 09:31:14 -0000 Author: zec Date: Fri Jun 12 09:31:14 2009 New Revision: 194052 URL: http://svn.freebsd.org/changeset/base/194052 Log: Remove unnecessary #ifdef lines and code. Approved by: julian (mentor) Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Fri Jun 12 09:20:31 2009 (r194051) +++ head/sys/netinet6/mld6.c Fri Jun 12 09:31:14 2009 (r194052) @@ -149,13 +149,8 @@ static int mld_v2_process_group_query(st static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); -#ifdef VIMAGE static vnet_attach_fn vnet_mld_iattach; static vnet_detach_fn vnet_mld_idetach; -#else -static int vnet_mld_iattach(const void *); -static int vnet_mld_idetach(const void *); -#endif /* VIMAGE */ /* * Normative references: RFC 2710, RFC 3590, RFC 3810. @@ -3296,9 +3291,7 @@ mld_modevent(module_t mod, int type, voi break; case MOD_UNLOAD: #ifndef VIMAGE_GLOBALS -#ifdef NOTYET vnet_mod_deregister(&vnet_mld_modinfo); -#endif #else vnet_mld_idetach(NULL); #endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 09:44:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9548A106564A; Fri, 12 Jun 2009 09:44:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 680EF8FC19; Fri, 12 Jun 2009 09:44:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id F1EF146B2C; Fri, 12 Jun 2009 05:44:12 -0400 (EDT) Date: Fri, 12 Jun 2009 10:44:12 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Kabaev In-Reply-To: <20090611202757.7cb0dad5@kan.dnsalias.net> Message-ID: References: <200906111650.n5BGonnn053446@svn.freebsd.org> <20090611190140.GE2642@garage.freebsd.pl> <200906112123.02105.zec@freebsd.org> <4A3168A0.2090308@elischer.org> <20090611202757.7cb0dad5@kan.dnsalias.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Marko Zec , Julian Elischer , svn-src-head@freebsd.org Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 09:44:14 -0000 On Thu, 11 Jun 2009, Alexander Kabaev wrote: >>>> Are you sure Marko that you can't use sys/sys/osd.h instead of adding yet >>>> another field to the thread structure? Netgraph is optional component and >>>> optional components could take advantage of allocating stuff they need >>>> dynamically. The OSD (Object-Specific Data) KPI is designed for use by >>>> optional components - you can add your data to a thread, you can get it >>>> when you want and OSD will call your callback when thread dies, so you >>>> can clean up. >>>> >>>> Maybe you can't, but it's worth checking. >>> >>> Hmm how much locking overhead do osd_set() / osd_get() methods introduce? >>> We have to bump the refcount on each entry to netgraph, and then check it >>> potentially on each hop to next ng node, and finally drop the refcount >>> when done with the function call into netgraph. Accessing td_ng_outbound >>> directly via curthread is as cheap as it gets performancewise as it >>> requires no locking whatsoever... >> >> I would add that I suspect that we may end up using it in other places as >> well outside of netgraph. > > When that happens then per-thread field can be revisited again. Blowing the > side of major kernel structure for the sake of subsystem is unused by 90%+ > percent of users is little too drastic IMHO. > > I do second Pawel's opinion that you should look at osd for the time being. > After all it was invented for just this reason. I guess I come down on the other side of this one -- the cost of an int in struct thread is minimal compared to many of the other overheads, and means that the cost of managing the input/output cycle protection is minimal for something that happens to all packets processed by a moderate number of useful netgraph nodes. Last I checked there was plenty of other garbage we could collect in struct thread/proc if we are worried about its size, and it was also organized fairly badly from an alignment perspective so there was lots of entirely wasted space in padding (perhaps someone has fixed this since I last looked?). Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 11:16:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0123E106566C; Fri, 12 Jun 2009 11:16:14 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E18ED8FC13; Fri, 12 Jun 2009 11:16:13 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CBGDH8080488; Fri, 12 Jun 2009 11:16:13 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CBGDiq080487; Fri, 12 Jun 2009 11:16:13 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906121116.n5CBGDiq080487@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 12 Jun 2009 11:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194055 - head/share/syscons/keymaps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 11:16:14 -0000 Author: edwin Date: Fri Jun 12 11:16:13 2009 New Revision: 194055 URL: http://svn.freebsd.org/changeset/base/194055 Log: French translations for keyboards keymaps descriptions French translations for keyboards keymaps descriptions with some corrections on existing translations in the /usr/share/syscons/keymaps/INDEX.keymaps PR: conf/71767 Submitted by: Henri Michelon MFC after: 1 week Modified: head/share/syscons/keymaps/INDEX.keymaps Modified: head/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- head/share/syscons/keymaps/INDEX.keymaps Fri Jun 12 10:56:09 2009 (r194054) +++ head/share/syscons/keymaps/INDEX.keymaps Fri Jun 12 11:16:13 2009 (r194055) @@ -43,10 +43,12 @@ FONT:hy:haik8-8x16.fnt # be.iso.kbd:en:Belgian ISO-8859-1 be.iso.kbd:de:Belgisch ISO-8859-1 +be.iso.kbd:fr:Belge ISO-8859-1 be.iso.kbd:pt,es:Belga ISO-8859-1 be.iso.acc.kbd:en:Belgian ISO-8859-1 (accent keys) be.iso.acc.kbd:de:Belgisch ISO-8859-1 (mit Akzenten) +be.iso.acc.kbd:fr:Belge ISO-8859-1 (avec accents) be.iso.acc.kbd:pt:Belga ISO-8859-1 (com acentos) be.iso.acc.kbd:es:Belga ISO-8859-1 (con acentos) @@ -55,34 +57,43 @@ bg.phonetic.ctrlcaps.kbd:bg:Bulgarian Ph br275.iso.kbd:en:Brazilian 275 ISO-8859-1 br275.iso.kbd:de:Brasilianisch 275 ISO-8859-1 +br275.iso.kbd:fr:Brésilien 275 ISO-8859-1 br275.iso.kbd:pt:Brasileiro 275 ISO-8859-1 br275.iso.kbd:es:Brasileño 275 ISO-8859-1 br275.iso.acc.kbd:en:Brazilian 275 ISO-8859-1 (accent keys) br275.iso.acc.kbd:de:Brasilianisch 275 ISO-8859-1 (mit Akzenten) +br275.iso.acc.kbd:fr:Brésilien 275 ISO-8859-1 (avec accents) br275.iso.acc.kbd:pt:Brasileiro 275 ISO-8859-1 (com acentos) br275.iso.acc.kbd:es:Brasileño 275 ISO-8859-1 (con acentos) br275.cp850.kbd:en:Brazilian 275 Codepage 850 br275.cp850.kbd:de:Brasilianisch 275 Codeseite 850 +br275.cp850.kbd:fr:Brésilien 275 Code page 850 br275.cp850.kbd:pt:Brasileiro 275 Codepage 850 br275.cp850.kbd:es:Brasileño 275 Codepage 850 by.cp1131.kbd:en:Belarusian Codepage 1131 +by.cp1131.kbd:fr:Biélorusse Code page 1131 by.cp1251.kbd:en:Belarusian Codepage 1251 +by.cp1251.kbd:fr:Biélorusse Code page 1251 by.iso5.kbd:en:Belarusian ISO-8859-5 +by.iso5.kbd:fr:Biélorusse ISO-8859-5 ce.iso2.kbd:en:Central European ISO-8859-2 ce.iso2.kbd:de:Zentral Europäisch ISO-8859-2 +ce.iso2.kbd:fr:Centre européen ISO-8859-2 ce.iso2.kbd:es:Centroeuropeo ISO-8859-2 colemak.iso15.acc.kbd:en:Colemak ergonomic alternative cs.latin2.qwertz.kbd:en:Czech ISO-8859-2 (QWERTZ, accent keys) +cs.latin2.qwertz.kbd:fr:Tchèque ISO-8859-2 (QWERTZ, avec accents) cs.latin2.qwertz.kbd:es:Checo ISO-8859-2 (QWERTZ, con acentos) cz.iso2.kbd:en:Czech ISO-8859-2 cz.iso2.kbd:de:Tschechisch ISO-8859-2 +cz.iso2.kbd:fr:Tchèque ISO-8859-2 cz.iso2.kbd:es:Checo ISO-8859-2 danish.iso.kbd:en:Danish ISO-8859-1 @@ -100,28 +111,35 @@ danish.cp865.kbd:pt:Dinamarquês Codepage danish.cp865.kbd:es:Danés Codepage 865 eee_nordic.kbd:en:Nordic layout on Asus eeePC +eee_nordic.kbd:fr:Norvégien phonétique sur Asus eeePC el.iso07.kbd:en:Greek ISO-8859-7 (104 keys) +el.iso07.kbd:fr:Grec ISO-8859-7 (104 touches) el.iso07.kbd:el:Åëëçíéêü ISO-8859-7 (104 ðëÞêôñùí) estonian.iso.kbd:en:Estonian ISO-8859-1 estonian.iso.kbd:de:Estnisch ISO-8859-1 +estonian.iso.kbd:fr:Estonien ISO-8859-1 estonian.iso.kbd:es:Estonio ISO-8859-1 estonian.iso15.kbd:en:Estonian ISO-8859-15 estonian.iso15.kbd:de:Estnisch ISO-8859-15 +estonian.iso15.kbd:fr:Estonien ISO-8859-15 estonian.iso15.kbd:es:Estonio ISO-8859-15 estonian.cp850.kbd:en:Estonian Codepage 850 estonian.cp850.kbd:de:Estnisch Codeseite 850 +estonian.cp850.kbd:fr:Estonien Code page 850 estonian.cp850.kbd:es:Estonio Codepage 850 finnish.iso.kbd:en:Finnish ISO-8859-1 finnish.iso.kbd:de:Finnisch ISO-8859-1 +finnish.iso.kbd:fr:Finlandais ISO-8859-1 finnish.iso.kbd:es:Finlandés ISO-8859-1 finnish.cp850.kbd:en:Finnish Codepage 850 finnish.cp850.kbd:de:Finnisch Codeseite 850 +finnish.cp850.kbd:fr:Finlandais Code page 850 finnish.cp850.kbd:es:Finlandés Codepage 850 fr.iso.kbd:en:French ISO-8859-1 @@ -133,7 +151,7 @@ fr.iso.kbd:uk:æÒÁÎÃÕÚØËÁ ISO-8859-1 fr.iso.acc.kbd:en:French ISO-8859-1 (accent keys) fr.iso.acc.kbd:de:Französisch ISO-8859-1 (mit Akzenten) -fr.iso.acc.kbd:fr:Français ISO-8859-1 (accent keys) +fr.iso.acc.kbd:fr:Français ISO-8859-1 (avec accents) fr.iso.acc.kbd:pt:Francês ISO-8859-1 (com acentos) fr.iso.acc.kbd:es:Francés ISO-8859-1 (con acentos) fr.iso.acc.kbd:uk:æÒÁÎÃÕÚØËÁ ISO-8859-1 (accent keys) @@ -160,6 +178,7 @@ fr.dvorak.acc.kbd:uk:French Dvorak-like fr_CA.iso.acc.kbd:en:French Canadian ISO-8859-1 (accent keys) fr_CA.iso.acc.kbd:de:Französisch Kanada ISO-8859-1 (mit Akzenten) +fr_CA.iso.acc.kbd:fr:Français Canadien ISO-8859-1 (avec accents) fr_CA.iso.acc.kbd:es:Francocanadiense ISO-8859-1 (con acentos) fr_CA.iso.acc.kbd:uk:æÒÁÎÃÕÚØËÏ-ËÁÎÁÄÓØËÁ ISO-8859-1 (accent keys) @@ -185,100 +204,124 @@ german.cp850.kbd:es:Alemán Codepage 850 german.cp850.kbd:uk:î¦ÍÅÃØËÁ CP-850 gr.elot.acc.kbd:en:Greek ISO-8859-7 ELOT +gr.elot.acc.kbd:fr:Grec ISO-8859-7 ELOT gr.elot.acc.kbd:el:Åëëçíéêü ISO-8859-7 ÅËÏÔ gr.us101.acc.kbd:en:Greek ISO-8859-7 (101 keys) +gr.us101.acc.kbd:fr:Grec ISO-8859-7 (101 touches) gr.us101.acc.kbd:el:Åëëçíéêü ISO-8859-7 (101 ðëÞêôñùí) iw.iso8.kbd:en:Hebrew ISO-8859-8 +iw.iso8.kbd:fr:Hébreu ISO-8859-8 iw.iso8.kbd:he:ISO-8859-8 úéøáò hr.iso.kbd:en:Croatian ISO-8859-2 hr.iso.kbd:de:Kroatisch ISO-8859-2 +hr.iso.kbd:fr:Croate ISO-8859-2 hr.iso.kbd:es:Croata ISO-8859-2 hu.iso2.101keys.kbd:en:Hungarian 101 ISO-8859-2 hu.iso2.101keys.kbd:de:Ungarisch 101 ISO-8859-2 +hu.iso2.101keys.kbd:fr:Hongrois 101 ISO-8859-2 hu.iso2.101keys.kbd:es:Húngaro 101 ISO-8859-2 hu.iso2.102keys.kbd:en:Hungarian 102 ISO-8859-2 hu.iso2.102keys.kbd:de:Ungarisch 102 ISO-8859-2 +hu.iso2.102keys.kbd:fr:Hongrois 102 ISO-8859-2 hu.iso2.102keys.kbd:es:Húngaro 102 ISO-8859-2 hy.armscii-8.kbd:hy:гۻñ»Ý ÑÝãÛáõݳÛÇÝ ¥Phonetic¤ ¹³ë³íáñáõÃÛáõÝ hy.armscii-8.kbd:ru:áÒÍÑÎÓËÁÑ ÆÏÎÅÔÉÞÅÓËÁÑ ÒÁÓËÌÁÄËÁ hy.armscii-8.kbd:en:Armenian phonetic layout +hy.armscii-8.kbd:fr:Arménien phonétique hy.armscii-8.kbd:de:Armenische phonetische Tastenbelegung icelandic.iso.kbd:en:Icelandic ISO-8859-1 icelandic.iso.kbd:de:Isländisch ISO-8859-1 +icelandic.iso.kbd:fr:Islandais ISO-8859-1 icelandic.iso.kbd:pt:Islandês ISO-8859-1 icelandic.iso.kbd:es:Islandés ISO-8859-1 icelandic.iso.acc.kbd:en:Icelandic ISO-8859-1 (accent keys) icelandic.iso.acc.kbd:de:Isländisch ISO-8859-1 (mit Akzenten) +icelandic.iso.acc.kbd:fr:Islandais ISO-8859-1 (avec accents) icelandic.iso.acc.kbd:pt:Islandês ISO-8859-1 (com acentos) icelandic.iso.acc.kbd:es:Islandés ISO-8859-1 (con acentos) it.iso.kbd:en:Italian ISO-8859-1 it.iso.kbd:de:Italienisch ISO-8859-1 +it.iso.kbd:fr:Italien ISO-8859-1 it.iso.kbd:pt,es:Italiano ISO-8859-1 it.iso.kbd:uk:¶ÔÁ̦ÊÓØËÁ ISO-8859-1 jp.106.kbd:en:Japanese 106 jp.106.kbd:de:Japanisch 106 +jp.106.kbd:fr:Japonais 106 jp.106.kbd:pt:Japonês 106 jp.106.kbd:es:Japonés 106 jp.106.kbd:uk:ñÐÏÎÓØËÁ 106 jp.106x.kbd:en:Japanese 106x jp.106x.kbd:de:Japanisch 106x +jp.106x.kbd:fr:Japonais 106x jp.106x.kbd:pt:Japonês 106x jp.106x.kbd:es:Japonés 106x jp.106x.kbd:uk:ñÐÏÎÓØËÁ 106x jp.pc98.kbd:en:Japanese PC-98x1 +jp.pc98.kbd:fr:Japonais PC-98x1 jp.pc98.iso.kbd:en:Japanese PC-98x1 (ISO) +jp.pc98.iso.kbd:fr:Japonais PC-98x1 (ISO) kk.pt154.kst.kbd:en:Kazakh PT154 codepage +kk.pt154.kst.kbd:fr:Kazakh PT154 code page kk.pt154.io.kbd:en:Kazakh PT154 codepage +kk.pt154.io.kbd:fr:Kazakh PT154 code page latinamerican.kbd:en:Latin American latinamerican.kbd:de:Latein Amerikanisch +latinamerican.kbd:fr:Amérique latine latinamerican.kbd:pt,es:América Latina latinamerican.iso.acc.kbd:en:Latin American (accent keys) latinamerican.iso.acc.kbd:de:Latein Amerikanisch (mit Akzenten) +latinamerican.iso.acc.kbd:fr:Amérique latine (avec accents) latinamerican.iso.acc.kbd:pt,es:América Latina (com acentos) lt.iso4.kbd:en:Lithuanian ISO-8859-4 +lt.iso4.kbd:fr:Lithuanien ISO-8859-4 lt.iso4.kbd:es:Lituano ISO-8859-4 norwegian.iso.kbd:en:Norwegian ISO-8859-1 norwegian.iso.kbd:no:Norsk ISO-8859-1 norwegian.iso.kbd:de:Norwegisch ISO-8859-1 +norwegian.iso.kbd:fr:Norvégien ISO-8859-1 norwegian.iso.kbd:pt:Norueguês ISO-8859-1 norwegian.iso.kbd:es:Noruego ISO-8859-1 norwegian.dvorak.kbd:en:Norwegian dvorak norwegian.dvorak.kbd:no:Norsk dvorak norwegian.dvorak.kbd:de:Norwegisch dvorak +norwegian.dvorak.kbd:fr:Norvégien dvorak norwegian.dvorak.kbd:pt:Norueguês dvorak norwegian.dvorak.kbd:es:Noruego Idvorak pl_PL.ISO8859-2.kbd:en:Polish ISO-8859-2 (programmer's) pl_PL.ISO8859-2.kbd:de:Polnisch ISO-8859-2 (für Programmierer) +pl_PL.ISO8859-2.kbd:fr:Polonais ISO-8859-2 (pour programmeurs) pl_PL.ISO8859-2.kbd:pl:Polska ISO-8859-2 (programisty) pl_PL.ISO8859-2.kbd:pt:Polonês ISO-8859-2 (para programadores) pl_PL.ISO8859-2.kbd:es:Polaco ISO-8859-2 (para programadores) pt.iso.kbd:en:Portuguese ISO-8859-1 pt.iso.kbd:de:Portugisisch ISO-8859-1 +pt.iso.kbd:fr:Portugais ISO-8859-1 pt.iso.kbd:pt:Português ISO-8859-1 pt.iso.kbd:es:Portugués ISO-8859-1 pt.iso.acc.kbd:en:Portuguese ISO-8859-1 (accent keys) pt.iso.acc.kbd:de:Portugisisch ISO-8859-1 (mit Akzenten) +pt.iso.acc.kbd:fr:Portugais ISO-8859-1 (avec accents) pt.iso.acc.kbd:pt:Português ISO-8859-1 (com acentos) pt.iso.acc.kbd:es:Portugués ISO-8859-1 (con acentos) @@ -291,6 +334,7 @@ ru.cp866.kbd:es:Ruso Codepage 866 (alter ru.cp866.kbd:uk:òÏÓ¦ÊÓØËÁ CP-866 (ÁÌØÔÅÒÎÁÔÉ×ÎÁ) ru.iso5.kbd:en:Russian ISO-8859-5 +ru.iso5.kbd:fr:Russe ISO-8859-5 ru.iso5.kbd:ru:òÕÓÓËÉÊ ISO-8859-5 ru.iso5.kbd:uk:òÏÓ¦ÊÓØËÉÊ ISO-8859-5 @@ -312,26 +356,31 @@ ru.koi8-r.shift.kbd:uk:òÏÓ¦ÊÓØËÁ koi8-r spanish.iso.kbd:en:Spanish ISO-8859-1 spanish.iso.kbd:de:Spanisch ISO-8859-1 +spanish.iso.kbd:fr:Espagnol ISO-8859-1 spanish.iso.kbd:pt:Espanhol ISO-8859-1 spanish.iso.kbd:es:Español ISO-8859-1 spanish.iso.acc.kbd:en:Spanish ISO-8859-1 (accent keys) spanish.iso.acc.kbd:de:Spanisch ISO-8859-1 (accent keys) +spanish.iso.acc.kbd:fr:Espagnol ISO-8859-1 (avec accents) spanish.iso.acc.kbd:pt:Espanhol ISO-8859-1 (com acentos) spanish.iso.acc.kbd:es:Español ISO-8859-1 (con acentos) spanish.iso15.acc.kbd:en:Spanish ISO-8859-15 (accent keys) spanish.iso15.acc.kbd:de:Spanisch ISO-8859-15 (accent keys) +spanish.iso15.acc.kbd:fr:Espagnol ISO-8859-15 (avec accents) spanish.iso15.acc.kbd:pt:Espanhol ISO-8859-15 (com acentos) spanish.iso15.acc.kbd:es:Español ISO-8859-15 (con acentos) si.iso.kbd:en:Slovenian ISO-8859-2 si.iso.kbd:de:Slovenisch ISO-8859-2 +si.iso.kbd:fr:Slovène ISO-8859-2 si.iso.kbd:pt:Eslovênio ISO-8859-2 si.iso.kbd:es:Esloveno ISO-8859-2 sk.iso2.kbd:en:Slovak ISO-8859-2 sk.iso2.kbd:de:Slovakisch ISO-8859-2 +sk.iso2.kbd:fr:Slovène ISO-8859-2 sk.iso2.kbd:es:Eslovaco ISO-8859-2 swedish.iso.kbd:en:Swedish ISO-8859-1 @@ -378,6 +427,7 @@ swissgerman.cp850.kbd:pt:Suiço-Alemão Co swissgerman.cp850.kbd:es:Germanosuizo Codepage 850 tr.iso9.q.kbd:en:Turkish ISO-8859-9 +tr.iso9.q.kbd:fr:Turc ISO-8859-9 tr.iso9.q.kbd:uk:ôÕÒÅÃØËÁ ISO-8859-9 uk.iso.kbd:en:United Kingdom ISO-8859-1 @@ -394,58 +444,61 @@ uk.cp850.kbd:es:Británico Codepage 850 us.iso.kbd:en:United States of America ISO-8859-1 us.iso.kbd:de:US-amerikanisch ISO-8859-1 -us.iso.kbd:fr:États Unis d'Amérique ISO-8859-1 +us.iso.kbd:fr:États Unis d'Amérique ISO-8859-1 us.iso.kbd:pt:Estados Unidos da América ISO-8859-1 us.iso.kbd:es:Estadounidense ISO-8859-1 us.iso.acc.kbd:en:United States of America ISO-8859-1 (accent keys) us.iso.acc.kbd:de:US-amerikanisch ISO-8859-1 (mit Akzenten) -us.iso.acc.kbd:fr:États Unis d'Amérique ISO-8859-1 (avec accents) +us.iso.acc.kbd:fr:États Unis d'Amérique ISO-8859-1 (avec accents) us.iso.acc.kbd:pt:Estados Unidos da América ISO-8859-1 (com acentos) us.iso.acc.kbd:es:Estadounidense ISO-8859-1 (con acentos) us.dvorak.kbd:en:United States of America dvorak us.dvorak.kbd:de:US-amerikanisch dvorak -us.dvorak.kbd:fr:États Unis d'Amérique dvorak +us.dvorak.kbd:fr:États Unis d'Amérique dvorak us.dvorak.kbd:pt:Estados Unidos da América dvorak us.dvorak.kbd:es:Estadounidense dvorak us.dvorakr.kbd:en:United States of America righthand dvorak us.dvorakr.kbd:de:US-amerikanisch dvorak rechte Hand -us.dvorakr.kbd:fr:États Unis d'Amérique dvorakr +us.dvorakr.kbd:fr:États Unis d'Amérique dvorakr us.dvorakr.kbd:pt:Estados Unidos da América dvorakr us.dvorakr.kbd:es:Estadounidense dvorak diestro us.dvorakl.kbd:en:United States of America lefthand dvorak us.dvorakl.kbd:de:US-amerikanisch dvorak linke Hand -us.dvorakl.kbd:fr:États Unis d'Amérique dvorakl +us.dvorakl.kbd:fr:États Unis d'Amérique dvorakl us.dvorakl.kbd:pt:Estados Unidos da América dvorakl us.dvorakl.kbd:es:Estadounidense dvorak zurdo us.dvorakx.kbd:en:United States of America dvorakx us.dvorakx.kbd:de:US-amerikanisch dvorakx -us.dvorakx.kbd:fr:États Unis d'Amérique dvorakx +us.dvorakx.kbd:fr:États Unis d'Amérique dvorakx us.dvorakx.kbd:pt:Estados Unidos da América dvorakx us.dvorakx.kbd:es:Estadounidense dvorakx us.emacs.kbd:en:United States of America Emacs optimized layout us.emacs.kbd:de:US-amerikanisch für Emacs optimiert -us.emacs.kbd:fr:États Unis d'Amérique emacs +us.emacs.kbd:fr:États Unis d'Amérique emacs us.emacs.kbd:pt:Estados Unidos da América emacs us.emacs.kbd:es:Estadounidense optimizado para Emacs us.unix.kbd:en:United States of America Traditional Unix Workstation us.unix.kbd:de:US-amerikanisch traditionelles Unix Layout -us.unix.kbd:fr:États Unis d'Amérique unix +us.unix.kbd:fr:États Unis d'Amérique unix us.unix.kbd:pt:Estados Unidos da América unix us.unix.kbd:es:Estadounidense Unix tradicional ua.iso5.kbd:en:Ukrainian ISO-8859-5 +ua.iso5.kbd:fr:Ukrainien ISO-8859-5 ua.iso5.kbd:ru:õËÒÁÉÎÓËÉÊ ISO-8859-5 ua.iso5.kbd:uk:õËÒÁ§ÎÓØËÁ ISO-8859-5 ua.koi8-u.kbd:en:Ukrainian koi8-u +ua.koi8-u.kbd:fr:Ukrainien koi8-u ua.koi8-u.kbd:uk:õËÒÁ§ÎÓØËÁ koi8-u ua.koi8-u.shift.alt.kbd:en:Ukrainian koi8-u with koi8-r (shift) +ua.koi8-u.shift.alt.kbd:fr:Ukrainien koi8-u avec koi8-r (shift) ua.koi8-u.shift.alt.kbd:uk:õËÒÁ§ÎÓØËÁ koi8-u Ú koi8-r (shift) From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 12:59:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6637106564A; Fri, 12 Jun 2009 12:59:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 774D78FC16; Fri, 12 Jun 2009 12:59:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2BA2546B1A; Fri, 12 Jun 2009 08:59:24 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E7FC28A06E; Fri, 12 Jun 2009 08:59:22 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Fri, 12 Jun 2009 08:49:06 -0400 User-Agent: KMail/1.9.7 References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <200906111018.20703.jhb@freebsd.org> <20090612125702.M22046@delplex.bde.org> In-Reply-To: <20090612125702.M22046@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906120849.07127.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 12 Jun 2009 08:59:23 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 12:59:25 -0000 On Thursday 11 June 2009 11:12:58 pm Bruce Evans wrote: > On Thu, 11 Jun 2009, John Baldwin wrote: > > > On Wednesday 10 June 2009 11:53:16 pm Bruce Evans wrote: > >> On Wed, 10 Jun 2009, John Baldwin wrote: > >> > >>> Log: > >>> Change a few members of tcpcb that store cached copies of ticks to be ints > >>> instead of unsigned longs. This fixes a few overflow edge cases on 64-bit > >>> platforms. Specifically, if an idle connection receives a packet shortly > >> > >> I think the variables should still be unsigned (ints now). Otherwise there > >> is at best benign undefined behaviour when the variables overflow at > >> INT_MAX, while the code is apparently designed to work with unsigned > >> values (it casts to int to look at differences between the unsigned values). > > > > I wanted to match 'ticks' and figured changing 'ticks' was a far larger > > headache. > > By changing the signedness you get undefined behaviour for the other types > too, and risk new and/or different sign extension bugs. FWIW, the variables were signed before they were changed to unsigned and are now back as signed again. It just seems really odd to have the types not match 'ticks' especially since many of the values are just cached copies of 'ticks'. > > Yes, I noticed the t_badrxtwin breakage but wasn't sure how best to fix it > > (or at least thought that it should be a separate followup since it was > > already broken with wraparound). I considered making it work more like > > the other variables such as t_rcvtime that merely store a cached value of > > 'ticks' and then use 'ticks - foo' and compare it with the given interval. > > This would entail renaming 't_badrxtwin' to 't_badrxttime' or some such. > > That seems clearer to me than '(int)(ticks - t_badrxtwin) < 0'. > > `ticks < t_limitvar' is more optimal than `ticks - t_startvar < max', but > harder to get right. Compilers even try to transform the latter to the > former (e.g., for loop counters), but they cannot do this if overflow > or wraparound is a possibility (except overflow gives undefined behaviour > so compilers can do anything). After fixing the former to > `(int)(ticks - t_limitvar) < 0' it has the same number of operations as > the latter and would only be more efficient if 0 is easier to load and/or > compare with than `max'. But casting to (int) seems clear to me -- it is > idiomatic for recovering signed differences from circular counters. Hmm, that is an idiom I am not familiar with I guess. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 14:18:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B57A6106566C; Fri, 12 Jun 2009 14:18:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2C4F8FC08; Fri, 12 Jun 2009 14:18:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CEIDuM084122; Fri, 12 Jun 2009 14:18:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CEIDGA084121; Fri, 12 Jun 2009 14:18:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906121418.n5CEIDGA084121@svn.freebsd.org> From: Rick Macklem Date: Fri, 12 Jun 2009 14:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194060 - head/usr.sbin/nfsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 14:18:14 -0000 Author: rmacklem Date: Fri Jun 12 14:18:13 2009 New Revision: 194060 URL: http://svn.freebsd.org/changeset/base/194060 Log: Update the content of the nfsv4.4 man page to reflect the final choice of variable names for rc.conf and option name for the experimental server. Also replace the inaccurate description of the nfsv4 root lines in /etc/exports, mostly with a reference to exports(5). Approved by: kib (mentor) Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Fri Jun 12 12:17:32 2009 (r194059) +++ head/usr.sbin/nfsd/nfsv4.4 Fri Jun 12 14:18:13 2009 (r194060) @@ -81,14 +81,18 @@ The .Tn NFSv4 protocol does not use a separate mount protocol and assumes that the server provides a single file system tree structure, rooted at the point -in the local file system tree specified by the +in the local file system tree specified by one or more .sp 1 .Bd -literal -offset indent -compact -V4: +V4: [-sec=secflavors] [host(s) or net] .Ed .sp 1 -line in -.Xr exports 5 . +line(s) in the +.Xr exports 5 +file. +(See +.Xr exports 5 +for details.) The .Xr nfsd 8 allows a limited subset of operations to be performed on non-exported subtrees @@ -131,23 +135,13 @@ On FreeBSD, the mapping daemon is called .Xr nfsuserd 8 and has a command line option that overrides the domain component of the machine's hostname. -This can be set in -.Xr rc.conf 5 -via the nfsv4_userd_flags variable. For use of .Nm , -either client or server, this daemon must be enabled by setting -.sp -.Bd -literal -offset indent -compact -nfsv4_enable="YES" -.Ed -.sp -in -.Xr rc.conf 5 . +either client or server, this daemon must be running. If this ``'' is not set correctly or the daemon is not running, ``ls -l'' will typically report a lot of ``nobody'' and ``nogroup'' ownerships. .Pp -Although numbers are no longer used in the +Although uid/gid numbers are no longer used in the .Nm protocol, they will still be in the RPC authentication fields when running using AUTH_SYS (sec=sys), which is the default. @@ -176,28 +170,42 @@ or start .Xr mountd 8 and .Xr nfsd 8 -with the ``-4'' option to force use of the experimental server. +with the ``-e'' option to force use of the experimental server. +The +.Xr nfsuserd 8 +daemon must also be running. This will occur if .sp .Bd -literal -offset indent -compact -nfsv4_enable="YES" +nfs_server_enable="YES" +nfsv4_server_enable="YES" +nfsuserd_enable="YES" .Ed .sp -is set in -.Xr rc.conf 5 , -as above. +are set in +.Xr rc.conf 5 . .Pp -You will also need to add a: +You will also need to add at least one ``V4:'' line to the +.Xr exports 5 +file and, before starting the server for the first time, create an empty .sp .Bd -literal -offset indent -compact -V4: +/var/db/nfs-stablerestart .Ed .sp -line to the -.Xr exports 5 -file, to tell the server where the +file. +The command +.sp +.Bd -literal -offset indent -compact +install -o root -g wheel -m 600 /dev/null /var/db/nfs-stablerestart +.Ed +.sp +executed as ``su'' should suffice. +This can only be done when the server is not running and there are no .Nm -tree is rooted. +file system mounts against the server. +If this file is lost during a crash, recovery from backups is +recommended. .Pp If the file systems you are exporting are only being accessed via .Nm @@ -247,19 +255,24 @@ command line. This will force use of the experimental client plus set ``tcp'' and .Nm . .Pp +The +.Xr nfsuserd 8 +must be running, as above. If the .Nm -server that is being mounted on supports delegations, you can set +server that is being mounted on supports delegations, you can start the +.Xr nfscbd 8 +daemon to handle client side callbacks. +This will occur if .sp .Bd -literal -offset indent -compact -nfsv4_callbackdaemon_enable="YES" +nfsuserd_enable="YES" +nfscbd_enable="YES" .Ed .sp -via -.Xr rc.conf 5 -so that the client side callback daemon -.Xr nfscbd 8 -is started upon boot. +are set in +.Xr rc.conf 5 . +.sp Without a functioning callback path, a server will never issue Delegations to a client. .sp @@ -267,14 +280,7 @@ By default, the callback address will be rtalloc() in the kernel and port# 7745. To override the default port#, a command line option for .Xr nfscbd 8 -can be set via the variable -.sp -.Bd -literal -offset indent -compact -nfsv4_callbackdaemon_flag -.Ed -.sp -using -.Xr rc.conf 5 . +can be used. .sp To get callbacks to work when behind a NAT gateway, a port for the callback service will need to be set up on the NAT gateway and then the address @@ -298,6 +304,14 @@ options NFSCL must be specified in the kernel's .Xr config 5 file. +.Pp +Options can be specified for the +.Xr nfsuserd 8 +and +.Xr nfscbd 8 +daemons at boot time via the ``nfsuserd_flags'' and ``nfscbd_flags'' +.Xr rc.conf 5 +variables. .Sh FILES .Bl -tag -width /var/db/nfs-stablerestart -compact .It Pa /var/db/nfs-stablerestart From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 14:27:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A66A106566C; Fri, 12 Jun 2009 14:27:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F6EF8FC16; Fri, 12 Jun 2009 14:27:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CERokl084331; Fri, 12 Jun 2009 14:27:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CERoMI084330; Fri, 12 Jun 2009 14:27:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906121427.n5CERoMI084330@svn.freebsd.org> From: Andriy Gapon Date: Fri, 12 Jun 2009 14:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194061 - head/contrib/gdb/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 14:27:50 -0000 Author: avg Date: Fri Jun 12 14:27:50 2009 New Revision: 194061 URL: http://svn.freebsd.org/changeset/base/194061 Log: gdb: make 'thread apply all bt' always work on all threads even if some appear to have (partially) corrupted stack traces. E.g. kernel crashdumps typically have stack weirdness at userland-kernel boundary. Obtained from: vendor/upstream (CVS rev 1.118 of stack.c) Reviewed by: emaste Approved by: jhb Modified: head/contrib/gdb/gdb/stack.c Modified: head/contrib/gdb/gdb/stack.c ============================================================================== --- head/contrib/gdb/gdb/stack.c Fri Jun 12 14:18:13 2009 (r194060) +++ head/contrib/gdb/gdb/stack.c Fri Jun 12 14:27:50 2009 (r194061) @@ -1230,6 +1230,22 @@ backtrace_command_1 (char *count_exp, in printf_filtered ("(More stack frames follow...)\n"); } +struct backtrace_command_args + { + char *count_exp; + int show_locals; + int from_tty; + }; + +/* Stub to call backtrace_command_1 by way of an error catcher. */ +static int +backtrace_command_stub (void *data) +{ + struct backtrace_command_args *args = (struct backtrace_command_args *)data; + backtrace_command_1 (args->count_exp, args->show_locals, args->from_tty); + return 0; +} + static void backtrace_command (char *arg, int from_tty) { @@ -1237,6 +1253,7 @@ backtrace_command (char *arg, int from_t char **argv = (char **) NULL; int argIndicatingFullTrace = (-1), totArgLen = 0, argc = 0; char *argPtr = arg; + struct backtrace_command_args btargs; if (arg != (char *) NULL) { @@ -1286,7 +1303,10 @@ backtrace_command (char *arg, int from_t } } - backtrace_command_1 (argPtr, (argIndicatingFullTrace >= 0), from_tty); + btargs.count_exp = argPtr; + btargs.show_locals = (argIndicatingFullTrace >= 0); + btargs.from_tty = from_tty; + catch_errors (backtrace_command_stub, (char *)&btargs, "", RETURN_MASK_ERROR); if (argIndicatingFullTrace >= 0 && totArgLen > 0) xfree (argPtr); @@ -1299,7 +1319,11 @@ static void backtrace_full_command (char static void backtrace_full_command (char *arg, int from_tty) { - backtrace_command_1 (arg, 1, from_tty); + struct backtrace_command_args btargs; + btargs.count_exp = arg; + btargs.show_locals = 1; + btargs.from_tty = from_tty; + catch_errors (backtrace_command_stub, (char *)&btargs, "", RETURN_MASK_ERROR); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 15:44:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6C4C106566C; Fri, 12 Jun 2009 15:44:36 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 075898FC19; Fri, 12 Jun 2009 15:44:36 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CFialm085774; Fri, 12 Jun 2009 15:44:36 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CFiZTa085763; Fri, 12 Jun 2009 15:44:35 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <200906121544.n5CFiZTa085763@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Fri, 12 Jun 2009 15:44: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: r194062 - in head/sys: conf net netinet netipsec sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 15:44:37 -0000 Author: vanhu Date: Fri Jun 12 15:44:35 2009 New Revision: 194062 URL: http://svn.freebsd.org/changeset/base/194062 Log: Added support for NAT-Traversal (RFC 3948) in IPsec stack. Thanks to (no special order) Emmanuel Dreyfus (manu@netbsd.org), Larry Baird (lab@gta.com), gnn, bz, and other FreeBSD devs, Julien Vanherzeele (julien.vanherzeele@netasq.com, for years of bug reporting), the PFSense team, and all people who used / tried the NAT-T patch for years and reported bugs, patches, etc... X-MFC: never Reviewed by: bz Approved by: gnn(mentor) Obtained from: NETASQ Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/net/pfkeyv2.h head/sys/netinet/in_proto.c head/sys/netinet/udp.h head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/key.c head/sys/netipsec/key.h head/sys/netipsec/keydb.h head/sys/sys/mbuf.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/conf/NOTES Fri Jun 12 15:44:35 2009 (r194062) @@ -534,6 +534,11 @@ options IPSEC #IP security (requires # using ipfw(8)'s 'ipsec' keyword, when this option is enabled. # #options IPSEC_FILTERTUNNEL #filter ipsec packets from a tunnel +# +# Set IPSEC_NAT_T to enable NAT-Traversal support. This enables +# optional UDP encapsulation of ESP packets. +# +options IPSEC_NAT_T #NAT-T support, UDP encap of ESP options IPX #IPX/SPX communications protocols Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/conf/options Fri Jun 12 15:44:35 2009 (r194062) @@ -401,6 +401,7 @@ IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h IPSEC opt_ipsec.h IPSEC_DEBUG opt_ipsec.h IPSEC_FILTERTUNNEL opt_ipsec.h +IPSEC_NAT_T opt_ipsec.h IPSTEALTH IPX KRPC Modified: head/sys/net/pfkeyv2.h ============================================================================== --- head/sys/net/pfkeyv2.h Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/net/pfkeyv2.h Fri Jun 12 15:44:35 2009 (r194062) @@ -255,6 +255,34 @@ struct sadb_x_ipsecrequest { */ }; +/* NAT-Traversal type, see RFC 3948 (and drafts). */ +/* sizeof(struct sadb_x_nat_t_type) == 8 */ +struct sadb_x_nat_t_type { + u_int16_t sadb_x_nat_t_type_len; + u_int16_t sadb_x_nat_t_type_exttype; + u_int8_t sadb_x_nat_t_type_type; + u_int8_t sadb_x_nat_t_type_reserved[3]; +}; + +/* NAT-Traversal source or destination port. */ +/* sizeof(struct sadb_x_nat_t_port) == 8 */ +struct sadb_x_nat_t_port { + u_int16_t sadb_x_nat_t_port_len; + u_int16_t sadb_x_nat_t_port_exttype; + u_int16_t sadb_x_nat_t_port_port; + u_int16_t sadb_x_nat_t_port_reserved; +}; + +/* ESP fragmentation size. */ +/* sizeof(struct sadb_x_nat_t_frag) == 8 */ +struct sadb_x_nat_t_frag { + u_int16_t sadb_x_nat_t_frag_len; + u_int16_t sadb_x_nat_t_frag_exttype; + u_int16_t sadb_x_nat_t_frag_fraglen; + u_int16_t sadb_x_nat_t_frag_reserved; +}; + + #define SADB_EXT_RESERVED 0 #define SADB_EXT_SA 1 #define SADB_EXT_LIFETIME_CURRENT 2 @@ -275,7 +303,14 @@ struct sadb_x_ipsecrequest { #define SADB_X_EXT_KMPRIVATE 17 #define SADB_X_EXT_POLICY 18 #define SADB_X_EXT_SA2 19 -#define SADB_EXT_MAX 19 +#define SADB_X_EXT_NAT_T_TYPE 20 +#define SADB_X_EXT_NAT_T_SPORT 21 +#define SADB_X_EXT_NAT_T_DPORT 22 +#define SADB_X_EXT_NAT_T_OA 23 /* Deprecated. */ +#define SADB_X_EXT_NAT_T_OAI 23 /* Peer's NAT_OA for src of SA. */ +#define SADB_X_EXT_NAT_T_OAR 24 /* Peer's NAT_OA for dst of SA. */ +#define SADB_X_EXT_NAT_T_FRAG 25 /* Manual MTU override. */ +#define SADB_EXT_MAX 25 #define SADB_SATYPE_UNSPEC 0 #define SADB_SATYPE_AH 2 Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/netinet/in_proto.c Fri Jun 12 15:44:35 2009 (r194062) @@ -124,7 +124,7 @@ struct protosw inetsw[] = { .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = udp_input, .pr_ctlinput = udp_ctlinput, - .pr_ctloutput = ip_ctloutput, + .pr_ctloutput = udp_ctloutput, .pr_init = udp_init, #ifdef VIMAGE .pr_destroy = udp_destroy, Modified: head/sys/netinet/udp.h ============================================================================== --- head/sys/netinet/udp.h Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/netinet/udp.h Fri Jun 12 15:44:35 2009 (r194062) @@ -45,4 +45,23 @@ struct udphdr { u_short uh_sum; /* udp checksum */ }; +/* + * User-settable options (used with setsockopt). + */ +#define UDP_ENCAP 0x01 + + +/* + * UDP Encapsulation of IPsec Packets options. + */ +/* Encapsulation types. */ +#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ +#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-02+ */ + +/* Default ESP in UDP encapsulation port. */ +#define UDP_ENCAP_ESPINUDP_PORT 500 + +/* Maximum UDP fragment size for ESP over UDP. */ +#define UDP_ENCAP_ESPINUDP_MAXFRAGLEN 552 + #endif Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/netinet/udp_usrreq.c Fri Jun 12 15:44:35 2009 (r194062) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #ifdef IPSEC #include +#include #endif #include @@ -151,6 +152,14 @@ SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_i static void udp_detach(struct socket *so); static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *); +#ifdef IPSEC +#ifdef IPSEC_NAT_T +#define UF_ESPINUDP_ALL (UF_ESPINUDP_NON_IKE|UF_ESPINUDP) +#ifdef INET +static struct mbuf *udp4_espdecap(struct inpcb *, struct mbuf *, int); +#endif +#endif /* IPSEC_NAT_T */ +#endif /* IPSEC */ static void udp_zone_change(void *tag) @@ -252,6 +261,13 @@ udp_append(struct inpcb *inp, struct ip #ifdef INET6 struct sockaddr_in6 udp_in6; #endif +#ifdef IPSEC +#ifdef IPSEC_NAT_T +#ifdef INET + struct udpcb *up; +#endif +#endif +#endif INP_RLOCK_ASSERT(inp); @@ -263,6 +279,17 @@ udp_append(struct inpcb *inp, struct ip V_ipsec4stat.in_polvio++; return; } +#ifdef IPSEC_NAT_T +#ifdef INET + up = intoudpcb(inp); + KASSERT(up != NULL, ("%s: udpcb NULL", __func__)); + if (up->u_flags & UF_ESPINUDP_ALL) { /* IPSec UDP encaps. */ + n = udp4_espdecap(inp, n, off); + if (n == NULL) /* Consumed. */ + return; + } +#endif /* INET */ +#endif /* IPSEC_NAT_T */ #endif /* IPSEC */ #ifdef MAC if (mac_inpcb_check_deliver(inp, n) != 0) { @@ -825,6 +852,99 @@ SYSCTL_PROC(_net_inet_udp, OID_AUTO, get CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, udp_getcred, "S,xucred", "Get the xucred of a UDP connection"); +int +udp_ctloutput(struct socket *so, struct sockopt *sopt) +{ + int error = 0, optval; + struct inpcb *inp; +#ifdef IPSEC_NAT_T + struct udpcb *up; +#endif + + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); + INP_WLOCK(inp); + if (sopt->sopt_level != IPPROTO_UDP) { +#ifdef INET6 + if (INP_CHECK_SOCKAF(so, AF_INET6)) { + INP_WUNLOCK(inp); + error = ip6_ctloutput(so, sopt); + } else { +#endif + INP_WUNLOCK(inp); + error = ip_ctloutput(so, sopt); +#ifdef INET6 + } +#endif + return (error); + } + + switch (sopt->sopt_dir) { + case SOPT_SET: + switch (sopt->sopt_name) { + case UDP_ENCAP: + INP_WUNLOCK(inp); + error = sooptcopyin(sopt, &optval, sizeof optval, + sizeof optval); + if (error) + break; + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); + INP_WLOCK(inp); +#ifdef IPSEC_NAT_T + up = intoudpcb(inp); + KASSERT(up != NULL, ("%s: up == NULL", __func__)); +#endif + switch (optval) { + case 0: + /* Clear all UDP encap. */ +#ifdef IPSEC_NAT_T + up->u_flags &= ~UF_ESPINUDP_ALL; +#endif + break; +#ifdef IPSEC_NAT_T + case UDP_ENCAP_ESPINUDP: + case UDP_ENCAP_ESPINUDP_NON_IKE: + up->u_flags &= ~UF_ESPINUDP_ALL; + if (optval == UDP_ENCAP_ESPINUDP) + up->u_flags |= UF_ESPINUDP; + else if (optval == UDP_ENCAP_ESPINUDP_NON_IKE) + up->u_flags |= UF_ESPINUDP_NON_IKE; + break; +#endif + default: + error = EINVAL; + break; + } + INP_WUNLOCK(inp); + break; + default: + INP_WUNLOCK(inp); + error = ENOPROTOOPT; + break; + } + break; + case SOPT_GET: + switch (sopt->sopt_name) { +#ifdef IPSEC_NAT_T + case UDP_ENCAP: + up = intoudpcb(inp); + KASSERT(up != NULL, ("%s: up == NULL", __func__)); + optval = up->u_flags & UF_ESPINUDP_ALL; + INP_WUNLOCK(inp); + error = sooptcopyout(sopt, &optval, sizeof optval); + break; +#endif + default: + INP_WUNLOCK(inp); + error = ENOPROTOOPT; + break; + } + break; + } + return (error); +} + static int udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td) @@ -1136,6 +1256,144 @@ release: return (error); } + +#if defined(IPSEC) && defined(IPSEC_NAT_T) +#ifdef INET +/* + * Potentially decap ESP in UDP frame. Check for an ESP header + * and optional marker; if present, strip the UDP header and + * push the result through IPSec. + * + * Returns mbuf to be processed (potentially re-allocated) or + * NULL if consumed and/or processed. + */ +static struct mbuf * +udp4_espdecap(struct inpcb *inp, struct mbuf *m, int off) +{ + INIT_VNET_IPSEC(curvnet); + size_t minlen, payload, skip, iphlen; + caddr_t data; + struct udpcb *up; + struct m_tag *tag; + struct udphdr *udphdr; + struct ip *ip; + + INP_RLOCK_ASSERT(inp); + + /* + * Pull up data so the longest case is contiguous: + * IP/UDP hdr + non ESP marker + ESP hdr. + */ + minlen = off + sizeof(uint64_t) + sizeof(struct esp); + if (minlen > m->m_pkthdr.len) + minlen = m->m_pkthdr.len; + if ((m = m_pullup(m, minlen)) == NULL) { + V_ipsec4stat.in_inval++; + return (NULL); /* Bypass caller processing. */ + } + data = mtod(m, caddr_t); /* Points to ip header. */ + payload = m->m_len - off; /* Size of payload. */ + + if (payload == 1 && data[off] == '\xff') + return (m); /* NB: keepalive packet, no decap. */ + + up = intoudpcb(inp); + KASSERT(up != NULL, ("%s: udpcb NULL", __func__)); + KASSERT((up->u_flags & UF_ESPINUDP_ALL) != 0, + ("u_flags 0x%x", up->u_flags)); + + /* + * Check that the payload is large enough to hold an + * ESP header and compute the amount of data to remove. + * + * NB: the caller has already done a pullup for us. + * XXX can we assume alignment and eliminate bcopys? + */ + if (up->u_flags & UF_ESPINUDP_NON_IKE) { + /* + * draft-ietf-ipsec-nat-t-ike-0[01].txt and + * draft-ietf-ipsec-udp-encaps-(00/)01.txt, ignoring + * possible AH mode non-IKE marker+non-ESP marker + * from draft-ietf-ipsec-udp-encaps-00.txt. + */ + uint64_t marker; + + if (payload <= sizeof(uint64_t) + sizeof(struct esp)) + return (m); /* NB: no decap. */ + bcopy(data + off, &marker, sizeof(uint64_t)); + if (marker != 0) /* Non-IKE marker. */ + return (m); /* NB: no decap. */ + skip = sizeof(uint64_t) + sizeof(struct udphdr); + } else { + uint32_t spi; + + if (payload <= sizeof(struct esp)) { + V_ipsec4stat.in_inval++; + m_freem(m); + return (NULL); /* Discard. */ + } + bcopy(data + off, &spi, sizeof(uint32_t)); + if (spi == 0) /* Non-ESP marker. */ + return (m); /* NB: no decap. */ + skip = sizeof(struct udphdr); + } + + /* + * Setup a PACKET_TAG_IPSEC_NAT_T_PORT tag to remember + * the UDP ports. This is required if we want to select + * the right SPD for multiple hosts behind same NAT. + * + * NB: ports are maintained in network byte order everywhere + * in the NAT-T code. + */ + tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS, + 2 * sizeof(uint16_t), M_NOWAIT); + if (tag == NULL) { + V_ipsec4stat.in_nomem++; + m_freem(m); + return (NULL); /* Discard. */ + } + iphlen = off - sizeof(struct udphdr); + udphdr = (struct udphdr *)(data + iphlen); + ((uint16_t *)(tag + 1))[0] = udphdr->uh_sport; + ((uint16_t *)(tag + 1))[1] = udphdr->uh_dport; + m_tag_prepend(m, tag); + + /* + * Remove the UDP header (and possibly the non ESP marker) + * IP header length is iphlen + * Before: + * <--- off ---> + * +----+------+-----+ + * | IP | UDP | ESP | + * +----+------+-----+ + * <-skip-> + * After: + * +----+-----+ + * | IP | ESP | + * +----+-----+ + * <-skip-> + */ + ovbcopy(data, data + skip, iphlen); + m_adj(m, skip); + + ip = mtod(m, struct ip *); + ip->ip_len -= skip; + ip->ip_p = IPPROTO_ESP; + + /* + * We cannot yet update the cksums so clear any + * h/w cksum flags as they are no longer valid. + */ + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) + m->m_pkthdr.csum_flags &= ~(CSUM_DATA_VALID|CSUM_PSEUDO_HDR); + + (void) ipsec4_common_input(m, iphlen, ip->ip_p); + return (NULL); /* NB: consumed, bypass processing. */ +} +#endif /* INET */ +#endif /* defined(IPSEC) && defined(IPSEC_NAT_T) */ + static void udp_abort(struct socket *so) { Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/netinet/udp_var.h Fri Jun 12 15:44:35 2009 (r194062) @@ -64,6 +64,12 @@ struct udpcb { #define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) #define sotoudpcb(so) (intoudpcb(sotoinpcb(so))) + /* IPsec: ESP in UDP tunneling: */ +#define UF_ESPINUDP_NON_IKE 0x00000001 /* w/ non-IKE marker .. */ + /* .. per draft-ietf-ipsec-nat-t-ike-0[01], + * and draft-ietf-ipsec-udp-encaps-(00/)01.txt */ +#define UF_ESPINUDP 0x00000002 /* w/ non-ESP marker. */ + struct udpstat { /* input statistics: */ u_long udps_ipackets; /* total input packets */ @@ -127,6 +133,7 @@ int udp_newudpcb(struct inpcb *); void udp_discardcb(struct udpcb *); void udp_ctlinput(int, struct sockaddr *, void *); +int udp_ctloutput(struct socket *, struct sockopt *); void udp_init(void); #ifdef VIMAGE void udp_destroy(void); Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/netipsec/ipsec_input.c Fri Jun 12 15:44:35 2009 (r194062) @@ -121,6 +121,9 @@ ipsec_common_input(struct mbuf *m, int s struct secasvar *sav; u_int32_t spi; int error; +#ifdef IPSEC_NAT_T + struct m_tag *tag; +#endif IPSEC_ISTAT(sproto, V_espstat.esps_input, V_ahstat.ahs_input, V_ipcompstat.ipcomps_input); @@ -175,6 +178,12 @@ ipsec_common_input(struct mbuf *m, int s m_copydata(m, offsetof(struct ip, ip_dst), sizeof(struct in_addr), (caddr_t) &dst_address.sin.sin_addr); +#ifdef IPSEC_NAT_T + /* Find the source port for NAT-T; see udp*_espdecap. */ + tag = m_tag_find(m, PACKET_TAG_IPSEC_NAT_T_PORTS, NULL); + if (tag != NULL) + dst_address.sin.sin_port = ((u_int16_t *)(tag + 1))[1]; +#endif /* IPSEC_NAT_T */ break; #endif /* INET */ #ifdef INET6 Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/netipsec/ipsec_output.c Fri Jun 12 15:44:35 2009 (r194062) @@ -84,6 +84,10 @@ #include +#ifdef IPSEC_NAT_T +#include +#endif + #ifdef DEV_ENC #include #endif @@ -180,6 +184,57 @@ ipsec_process_done(struct mbuf *m, struc ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); +#ifdef IPSEC_NAT_T + /* + * If NAT-T is enabled, now that all IPsec processing is done + * insert UDP encapsulation header after IP header. + */ + if (sav->natt_type) { +#ifdef _IP_VHL + const int hlen = IP_VHL_HL(ip->ip_vhl); +#else + const int hlen = (ip->ip_hl << 2); +#endif + int size, off; + struct mbuf *mi; + struct udphdr *udp; + + size = sizeof(struct udphdr); + if (sav->natt_type == UDP_ENCAP_ESPINUDP_NON_IKE) { + /* + * draft-ietf-ipsec-nat-t-ike-0[01].txt and + * draft-ietf-ipsec-udp-encaps-(00/)01.txt, + * ignoring possible AH mode + * non-IKE marker + non-ESP marker + * from draft-ietf-ipsec-udp-encaps-00.txt. + */ + size += sizeof(u_int64_t); + } + mi = m_makespace(m, hlen, size, &off); + if (mi == NULL) { + DPRINTF(("%s: m_makespace for udphdr failed\n", + __func__)); + error = ENOBUFS; + goto bad; + } + + udp = (struct udphdr *)(mtod(mi, caddr_t) + off); + if (sav->natt_type == UDP_ENCAP_ESPINUDP_NON_IKE) + udp->uh_sport = htons(UDP_ENCAP_ESPINUDP_PORT); + else + udp->uh_sport = + KEY_PORTFROMSADDR(&sav->sah->saidx.src); + udp->uh_dport = KEY_PORTFROMSADDR(&sav->sah->saidx.dst); + udp->uh_sum = 0; + udp->uh_ulen = htons(m->m_pkthdr.len - hlen); + ip->ip_len = m->m_pkthdr.len; + ip->ip_p = IPPROTO_UDP; + + if (sav->natt_type == UDP_ENCAP_ESPINUDP_NON_IKE) + *(u_int64_t *)(udp + 1) = 0; + } +#endif /* IPSEC_NAT_T */ + return ip_output(m, NULL, NULL, IP_RAWOUTPUT, NULL, NULL); #endif /* INET */ #ifdef INET6 Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Fri Jun 12 14:27:50 2009 (r194061) +++ head/sys/netipsec/key.c Fri Jun 12 15:44:35 2009 (r194062) @@ -221,6 +221,12 @@ static const int minsize[] = { 0, /* SADB_X_EXT_KMPRIVATE */ sizeof(struct sadb_x_policy), /* SADB_X_EXT_POLICY */ sizeof(struct sadb_x_sa2), /* SADB_X_SA2 */ + sizeof(struct sadb_x_nat_t_type),/* SADB_X_EXT_NAT_T_TYPE */ + sizeof(struct sadb_x_nat_t_port),/* SADB_X_EXT_NAT_T_SPORT */ + sizeof(struct sadb_x_nat_t_port),/* SADB_X_EXT_NAT_T_DPORT */ + sizeof(struct sadb_address), /* SADB_X_EXT_NAT_T_OAI */ + sizeof(struct sadb_address), /* SADB_X_EXT_NAT_T_OAR */ + sizeof(struct sadb_x_nat_t_frag),/* SADB_X_EXT_NAT_T_FRAG */ }; static const int maxsize[] = { sizeof(struct sadb_msg), /* SADB_EXT_RESERVED */ @@ -243,6 +249,12 @@ static const int maxsize[] = { 0, /* SADB_X_EXT_KMPRIVATE */ 0, /* SADB_X_EXT_POLICY */ sizeof(struct sadb_x_sa2), /* SADB_X_SA2 */ + sizeof(struct sadb_x_nat_t_type),/* SADB_X_EXT_NAT_T_TYPE */ + sizeof(struct sadb_x_nat_t_port),/* SADB_X_EXT_NAT_T_SPORT */ + sizeof(struct sadb_x_nat_t_port),/* SADB_X_EXT_NAT_T_DPORT */ + 0, /* SADB_X_EXT_NAT_T_OAI */ + 0, /* SADB_X_EXT_NAT_T_OAR */ + sizeof(struct sadb_x_nat_t_frag),/* SADB_X_EXT_NAT_T_FRAG */ }; #ifdef SYSCTL_DECL @@ -425,6 +437,13 @@ static struct mbuf *key_setsadbmsg __P(( static struct mbuf *key_setsadbsa __P((struct secasvar *)); static struct mbuf *key_setsadbaddr __P((u_int16_t, const struct sockaddr *, u_int8_t, u_int16_t)); +#ifdef IPSEC_NAT_T +static struct mbuf *key_setsadbxport(u_int16_t, u_int16_t); +static struct mbuf *key_setsadbxtype(u_int16_t); +#endif +static void key_porttosaddr(struct sockaddr *, u_int16_t); +#define KEY_PORTTOSADDR(saddr, port) \ + key_porttosaddr((struct sockaddr *)(saddr), (port)) static struct mbuf *key_setsadbxsa2 __P((u_int8_t, u_int32_t, u_int32_t)); static struct mbuf *key_setsadbxpolicy __P((u_int16_t, u_int8_t, u_int32_t)); @@ -1067,12 +1086,21 @@ key_allocsa( struct secasvar *sav; u_int stateidx, arraysize, state; const u_int *saorder_state_valid; + int chkport; IPSEC_ASSERT(dst != NULL, ("null dst address")); KEYDEBUG(KEYDEBUG_IPSEC_STAMP, printf("DP %s from %s:%u\n", __func__, where, tag)); +#ifdef IPSEC_NAT_T + chkport = (dst->sa.sa_family == AF_INET && + dst->sa.sa_len == sizeof(struct sockaddr_in) && + dst->sin.sin_port != 0); +#else + chkport = 0; +#endif + /* * searching SAD. * XXX: to be checked internal IP header somewhere. Also when @@ -1104,11 +1132,11 @@ key_allocsa( continue; #if 0 /* don't check src */ /* check src address */ - if (key_sockaddrcmp(&src->sa, &sav->sah->saidx.src.sa, 0) != 0) + if (key_sockaddrcmp(&src->sa, &sav->sah->saidx.src.sa, chkport) != 0) continue; #endif /* check dst address */ - if (key_sockaddrcmp(&dst->sa, &sav->sah->saidx.dst.sa, 0) != 0) + if (key_sockaddrcmp(&dst->sa, &sav->sah->saidx.dst.sa, chkport) != 0) continue; sa_addref(sav); goto done; @@ -1798,6 +1826,11 @@ key_spdadd(so, m, mhp) dst0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_DST]; xpl0 = (struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY]; + /* + * Note: do not parse SADB_X_EXT_NAT_T_* here: + * we are processing traffic endpoints. + */ + /* make secindex */ /* XXX boundary check against sa_len */ KEY_SETSECSPIDX(xpl0->sadb_x_policy_dir, @@ -1931,6 +1964,11 @@ key_spdadd(so, m, mhp) struct sadb_msg *newmsg; int off; + /* + * Note: do not send SADB_X_EXT_NAT_T_* here: + * we are sending traffic endpoints. + */ + /* create new sadb_msg to reply. */ if (lft) { n = key_gather_mbuf(m, mhp, 2, 5, SADB_EXT_RESERVED, @@ -2053,6 +2091,11 @@ key_spddelete(so, m, mhp) dst0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_DST]; xpl0 = (struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY]; + /* + * Note: do not parse SADB_X_EXT_NAT_T_* here: + * we are processing traffic endpoints. + */ + /* make secindex */ /* XXX boundary check against sa_len */ KEY_SETSECSPIDX(xpl0->sadb_x_policy_dir, @@ -2089,6 +2132,11 @@ key_spddelete(so, m, mhp) struct mbuf *n; struct sadb_msg *newmsg; + /* + * Note: do not send SADB_X_EXT_NAT_T_* here: + * we are sending traffic endpoints. + */ + /* create new sadb_msg to reply. */ n = key_gather_mbuf(m, mhp, 1, 4, SADB_EXT_RESERVED, SADB_X_EXT_POLICY, SADB_EXT_ADDRESS_SRC, SADB_EXT_ADDRESS_DST); @@ -2435,6 +2483,10 @@ key_setdumpsp(struct secpolicy *sp, u_in goto fail; result = m; + /* + * Note: do not send SADB_X_EXT_NAT_T_* here: + * we are sending traffic endpoints. + */ m = key_setsadbaddr(SADB_EXT_ADDRESS_SRC, &sp->spidx.src.sa, sp->spidx.prefs, sp->spidx.ul_proto); @@ -2581,6 +2633,11 @@ key_spdexpire(sp) lt->sadb_lifetime_usetime = sp->validtime; m_cat(result, m); + /* + * Note: do not send SADB_X_EXT_NAT_T_* here: + * we are sending traffic endpoints. + */ + /* set sadb_address for source */ m = key_setsadbaddr(SADB_EXT_ADDRESS_SRC, &sp->spidx.src.sa, @@ -3034,6 +3091,9 @@ key_setsaval(sav, m, mhp) sav->tdb_encalgxform = NULL; /* encoding algorithm */ sav->tdb_authalgxform = NULL; /* authentication algorithm */ sav->tdb_compalgxform = NULL; /* compression algorithm */ + /* Initialize even if NAT-T not compiled in: */ + sav->natt_type = 0; + sav->natt_esp_frag_len = 0; /* SA */ if (mhp->ext[SADB_EXT_SA] != NULL) { @@ -3343,6 +3403,12 @@ key_setdumpsa(struct secasvar *sav, u_in SADB_EXT_ADDRESS_DST, SADB_EXT_ADDRESS_PROXY, SADB_EXT_KEY_AUTH, SADB_EXT_KEY_ENCRYPT, SADB_EXT_IDENTITY_SRC, SADB_EXT_IDENTITY_DST, SADB_EXT_SENSITIVITY, +#ifdef IPSEC_NAT_T + SADB_X_EXT_NAT_T_TYPE, + SADB_X_EXT_NAT_T_SPORT, SADB_X_EXT_NAT_T_DPORT, + SADB_X_EXT_NAT_T_OAI, SADB_X_EXT_NAT_T_OAR, + SADB_X_EXT_NAT_T_FRAG, +#endif }; m = key_setsadbmsg(type, 0, satype, seq, pid, sav->refcnt); @@ -3427,6 +3493,36 @@ key_setdumpsa(struct secasvar *sav, u_in goto fail; break; +#ifdef IPSEC_NAT_T + case SADB_X_EXT_NAT_T_TYPE: + m = key_setsadbxtype(sav->natt_type); + if (!m) + goto fail; + break; + + case SADB_X_EXT_NAT_T_DPORT: + m = key_setsadbxport( + KEY_PORTFROMSADDR(&sav->sah->saidx.dst), + SADB_X_EXT_NAT_T_DPORT); + if (!m) + goto fail; + break; + + case SADB_X_EXT_NAT_T_SPORT: + m = key_setsadbxport( + KEY_PORTFROMSADDR(&sav->sah->saidx.src), + SADB_X_EXT_NAT_T_SPORT); + if (!m) + goto fail; + break; + + case SADB_X_EXT_NAT_T_OAI: + case SADB_X_EXT_NAT_T_OAR: + case SADB_X_EXT_NAT_T_FRAG: + /* We do not (yet) support those. */ + continue; +#endif + case SADB_EXT_ADDRESS_PROXY: case SADB_EXT_IDENTITY_SRC: case SADB_EXT_IDENTITY_DST: @@ -3621,6 +3717,116 @@ key_setsadbxsa2(u_int8_t mode, u_int32_t return m; } +#ifdef IPSEC_NAT_T +/* + * Set a type in sadb_x_nat_t_type. + */ +static struct mbuf * +key_setsadbxtype(u_int16_t type) +{ + struct mbuf *m; + size_t len; + struct sadb_x_nat_t_type *p; + + len = PFKEY_ALIGN8(sizeof(struct sadb_x_nat_t_type)); + + m = key_alloc_mbuf(len); + if (!m || m->m_next) { /*XXX*/ + if (m) + m_freem(m); + return (NULL); + } + + p = mtod(m, struct sadb_x_nat_t_type *); + + bzero(p, len); + p->sadb_x_nat_t_type_len = PFKEY_UNIT64(len); + p->sadb_x_nat_t_type_exttype = SADB_X_EXT_NAT_T_TYPE; + p->sadb_x_nat_t_type_type = type; + + return (m); +} +/* + * Set a port in sadb_x_nat_t_port. + * In contrast to default RFC 2367 behaviour, port is in network byte order. + */ +static struct mbuf * +key_setsadbxport(u_int16_t port, u_int16_t type) +{ + struct mbuf *m; + size_t len; + struct sadb_x_nat_t_port *p; + + len = PFKEY_ALIGN8(sizeof(struct sadb_x_nat_t_port)); + + m = key_alloc_mbuf(len); + if (!m || m->m_next) { /*XXX*/ + if (m) + m_freem(m); + return (NULL); + } + + p = mtod(m, struct sadb_x_nat_t_port *); + + bzero(p, len); + p->sadb_x_nat_t_port_len = PFKEY_UNIT64(len); + p->sadb_x_nat_t_port_exttype = type; + p->sadb_x_nat_t_port_port = port; + + return (m); +} + +/* + * Get port from sockaddr. Port is in network byte order. + */ +u_int16_t +key_portfromsaddr(struct sockaddr *sa) +{ + INIT_VNET_IPSEC(curvnet); + + switch (sa->sa_family) { +#ifdef INET + case AF_INET: + return ((struct sockaddr_in *)sa)->sin_port; +#endif +#ifdef INET6 + case AF_INET6: + return ((struct sockaddr_in6 *)sa)->sin6_port; +#endif + } + KEYDEBUG(KEYDEBUG_IPSEC_STAMP, + printf("DP %s unexpected address family %d\n", + __func__, sa->sa_family)); + return (0); +} +#endif /* IPSEC_NAT_T */ + +/* + * Set port in struct sockaddr. Port is in network byte order. + */ +static void +key_porttosaddr(struct sockaddr *sa, u_int16_t port) +{ + INIT_VNET_IPSEC(curvnet); + + switch (sa->sa_family) { +#ifdef INET + case AF_INET: + ((struct sockaddr_in *)sa)->sin_port = port; + break; +#endif +#ifdef INET6 + case AF_INET6: + ((struct sockaddr_in6 *)sa)->sin6_port = port; + break; +#endif + default: + ipseclog((LOG_DEBUG, "%s: unexpected address family %d.\n", + __func__, sa->sa_family)); + break; + } +} + /* * set data into sadb_x_policy */ @@ -3818,6 +4024,8 @@ key_cmpsaidx( const struct secasindex *saidx1, int flag) { + int chkport = 0; + /* sanity */ if (saidx0 == NULL && saidx1 == NULL) return 1; @@ -3855,10 +4063,25 @@ key_cmpsaidx( return 0; } - if (key_sockaddrcmp(&saidx0->src.sa, &saidx1->src.sa, 0) != 0) { +#ifdef IPSEC_NAT_T + /* + * If NAT-T is enabled, check ports for tunnel mode. + * Do not check ports if they are set to zero in the SPD. + * Also do not do it for transport mode, as there is no + * port information available in the SP. + */ + if (saidx1->mode == IPSEC_MODE_TUNNEL && + saidx1->src.sa.sa_family == AF_INET && + saidx1->dst.sa.sa_family == AF_INET && + ((const struct sockaddr_in *)(&saidx1->src))->sin_port && + ((const struct sockaddr_in *)(&saidx1->dst))->sin_port) + chkport = 1; +#endif /* IPSEC_NAT_T */ + + if (key_sockaddrcmp(&saidx0->src.sa, &saidx1->src.sa, chkport) != 0) { return 0; } - if (key_sockaddrcmp(&saidx0->dst.sa, &saidx1->dst.sa, 0) != 0) { + if (key_sockaddrcmp(&saidx0->dst.sa, &saidx1->dst.sa, chkport) != 0) { return 0; } } @@ -4492,7 +4715,10 @@ key_getspi(so, m, mhp) return key_senderror(so, m, EINVAL); } - /* make sure if port number is zero. */ + /* + * Make sure the port numbers are zero. + * In case of NAT-T we will update them later if needed. + */ switch (((struct sockaddr *)(src0 + 1))->sa_family) { case AF_INET: if (((struct sockaddr *)(src0 + 1))->sa_len != @@ -4529,6 +4755,43 @@ key_getspi(so, m, mhp) /* XXX boundary check against sa_len */ KEY_SETSECASIDX(proto, mode, reqid, src0 + 1, dst0 + 1, &saidx); +#ifdef IPSEC_NAT_T + /* + * Handle NAT-T info if present. + * We made sure the port numbers are zero above, so we do + * not have to worry in case we do not update them. + */ + if (mhp->ext[SADB_X_EXT_NAT_T_OAI] != NULL) + ipseclog((LOG_DEBUG, "%s: NAT-T OAi present\n", __func__)); + if (mhp->ext[SADB_X_EXT_NAT_T_OAR] != NULL) + ipseclog((LOG_DEBUG, "%s: NAT-T OAr present\n", __func__)); + + if (mhp->ext[SADB_X_EXT_NAT_T_TYPE] != NULL && + mhp->ext[SADB_X_EXT_NAT_T_SPORT] != NULL && + mhp->ext[SADB_X_EXT_NAT_T_DPORT] != NULL) { + struct sadb_x_nat_t_type *type; + struct sadb_x_nat_t_port *sport, *dport; + + if (mhp->extlen[SADB_X_EXT_NAT_T_TYPE] < sizeof(*type) || + mhp->extlen[SADB_X_EXT_NAT_T_SPORT] < sizeof(*sport) || + mhp->extlen[SADB_X_EXT_NAT_T_DPORT] < sizeof(*dport)) { + ipseclog((LOG_DEBUG, "%s: invalid nat-t message " + "passed.\n", __func__)); + return key_senderror(so, m, EINVAL); + } + + sport = (struct sadb_x_nat_t_port *) + mhp->ext[SADB_X_EXT_NAT_T_SPORT]; + dport = (struct sadb_x_nat_t_port *) + mhp->ext[SADB_X_EXT_NAT_T_DPORT]; + + if (sport) + KEY_PORTTOSADDR(&saidx.src, sport->sadb_x_nat_t_port_port); + if (dport) + KEY_PORTTOSADDR(&saidx.dst, dport->sadb_x_nat_t_port_port); + } +#endif + /* SPI allocation */ spi = key_do_getnewspi((struct sadb_spirange *)mhp->ext[SADB_EXT_SPIRANGE], &saidx); @@ -4726,6 +4989,11 @@ key_update(so, m, mhp) INIT_VNET_IPSEC(curvnet); struct sadb_sa *sa0; struct sadb_address *src0, *dst0; +#ifdef IPSEC_NAT_T + struct sadb_x_nat_t_type *type; + struct sadb_address *iaddr, *raddr; + struct sadb_x_nat_t_frag *frag; +#endif struct secasindex saidx; struct secashead *sah; struct secasvar *sav; @@ -4784,6 +5052,73 @@ key_update(so, m, mhp) /* XXX boundary check against sa_len */ KEY_SETSECASIDX(proto, mode, reqid, src0 + 1, dst0 + 1, &saidx); + /* + * Make sure the port numbers are zero. + * In case of NAT-T we will update them later if needed. + */ + KEY_PORTTOSADDR(&saidx.src, 0); + KEY_PORTTOSADDR(&saidx.dst, 0); + +#ifdef IPSEC_NAT_T + /* + * Handle NAT-T info if present. + */ + if (mhp->ext[SADB_X_EXT_NAT_T_TYPE] != NULL && + mhp->ext[SADB_X_EXT_NAT_T_SPORT] != NULL && + mhp->ext[SADB_X_EXT_NAT_T_DPORT] != NULL) { + struct sadb_x_nat_t_port *sport, *dport; + + if (mhp->extlen[SADB_X_EXT_NAT_T_TYPE] < sizeof(*type) || + mhp->extlen[SADB_X_EXT_NAT_T_SPORT] < sizeof(*sport) || + mhp->extlen[SADB_X_EXT_NAT_T_DPORT] < sizeof(*dport)) { + ipseclog((LOG_DEBUG, "%s: invalid message.\n", + __func__)); + return key_senderror(so, m, EINVAL); + } + + type = (struct sadb_x_nat_t_type *) + mhp->ext[SADB_X_EXT_NAT_T_TYPE]; + sport = (struct sadb_x_nat_t_port *) + mhp->ext[SADB_X_EXT_NAT_T_SPORT]; + dport = (struct sadb_x_nat_t_port *) + mhp->ext[SADB_X_EXT_NAT_T_DPORT]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 15:58:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 486D8106566B; Fri, 12 Jun 2009 15:58:56 +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 2DB468FC2D; Fri, 12 Jun 2009 15:58:56 +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 n5CFwuGZ086252; Fri, 12 Jun 2009 15:58:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CFwtFq086249; Fri, 12 Jun 2009 15:58:55 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906121558.n5CFwtFq086249@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Jun 2009 15:58: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: r194064 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 15:58:56 -0000 Author: thompsa Date: Fri Jun 12 15:58:55 2009 New Revision: 194064 URL: http://svn.freebsd.org/changeset/base/194064 Log: Minor device side improvement. Make sure a not complete state gets paired with a complete state in device side mode for the default control endpoint. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_handle_request.c head/sys/dev/usb/usb_if.m Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Fri Jun 12 15:53:56 2009 (r194063) +++ head/sys/dev/usb/usb_core.h Fri Jun 12 15:58:55 2009 (r194064) @@ -215,6 +215,11 @@ #define USB_ST_TRANSFERRED 1 #define USB_ST_ERROR 2 +/* USB handle request states */ +#define USB_HR_NOT_COMPLETE 0 +#define USB_HR_COMPLETE_OK 1 +#define USB_HR_COMPLETE_ERR 2 + /* * The following macro will return the current state of an USB * transfer like defined by the "USB_ST_XXX" enums. Modified: head/sys/dev/usb/usb_handle_request.c ============================================================================== --- head/sys/dev/usb/usb_handle_request.c Fri Jun 12 15:53:56 2009 (r194063) +++ head/sys/dev/usb/usb_handle_request.c Fri Jun 12 15:58:55 2009 (r194064) @@ -42,13 +42,6 @@ #include #include -/* enum */ - -enum { - ST_DATA, - ST_POST_STATUS, -}; - /* function prototypes */ static uint8_t usb2_handle_get_stall(struct usb_device *, uint8_t); @@ -88,16 +81,17 @@ usb2_handle_request_callback(struct usb_ usb2_needs_explore(xfer->xroot->bus, 0); break; } - /* - * If no control transfer is active, - * receive the next SETUP message: - */ goto tr_restart; } usb2_start_hardware(xfer); break; default: + /* check if a control transfer is active */ + if (xfer->flags_int.control_rem != 0xFFFF) { + /* handle the request */ + err = usb2_handle_request(xfer); + } if (xfer->error != USB_ERR_CANCELLED) { /* should not happen - try stalling */ goto tr_restart; @@ -107,6 +101,10 @@ usb2_handle_request_callback(struct usb_ return; tr_restart: + /* + * If a control transfer is active, stall it, and wait for the + * next control transfer. + */ xfer->frlengths[0] = sizeof(struct usb_device_request); xfer->nframes = 1; xfer->flags.manual_status = 1; @@ -215,7 +213,7 @@ tr_repeat: #endif error = USB_HANDLE_REQUEST(iface->subdev, &req, ppdata, plen, - off, (state == ST_POST_STATUS)); + off, state); } iface_parent = usb2_get_iface(udev, iface->parent_iface_index); @@ -235,7 +233,7 @@ tr_repeat: device_is_attached(iface_parent->subdev)) { error = USB_HANDLE_REQUEST(iface_parent->subdev, &req, ppdata, plen, off, - (state == ST_POST_STATUS)); + state); } if (error == 0) { /* negativly adjust pointer and length */ @@ -249,7 +247,7 @@ tr_repeat: iface_index++; /* iterate */ goto tr_repeat; } - if (state == ST_POST_STATUS) { + if (state != USB_HR_NOT_COMPLETE) { /* we are complete */ goto tr_valid; } @@ -407,7 +405,7 @@ usb2_handle_remote_wakeup(struct usb_xfe * * Internal state sequence: * - * ST_DATA -> ST_POST_STATUS + * USB_HR_NOT_COMPLETE -> USB_HR_COMPLETE_OK v USB_HR_COMPLETE_ERR * * Returns: * 0: Ready to start hardware @@ -439,21 +437,23 @@ usb2_handle_request(struct usb_xfer *xfe switch (USB_GET_STATE(xfer)) { case USB_ST_SETUP: - state = ST_DATA; + state = USB_HR_NOT_COMPLETE; if (!xfer->flags_int.control_act) { /* nothing to do */ goto tr_stalled; } break; - - default: /* USB_ST_TRANSFERRED */ + case USB_ST_TRANSFERRED: if (!xfer->flags_int.control_act) { - state = ST_POST_STATUS; + state = USB_HR_COMPLETE_OK; } else { - state = ST_DATA; + state = USB_HR_NOT_COMPLETE; } break; + default: + state = USB_HR_COMPLETE_ERR; + break; } /* reset frame stuff */ @@ -497,7 +497,7 @@ usb2_handle_request(struct usb_xfer *xfe switch (req.bmRequestType) { case UT_READ_DEVICE: - if (state != ST_DATA) { + if (state != USB_HR_NOT_COMPLETE) { break; } switch (req.bRequest) { @@ -627,7 +627,7 @@ tr_handle_get_status: goto tr_valid; tr_handle_set_address: - if (state == ST_DATA) { + if (state == USB_HR_NOT_COMPLETE) { if (wValue >= 0x80) { /* invalid value */ goto tr_stalled; @@ -635,14 +635,14 @@ tr_handle_set_address: /* we are configured ! */ goto tr_stalled; } - } else if (state == ST_POST_STATUS) { + } else if (state != USB_HR_NOT_COMPLETE) { udev->address = (wValue & 0x7F); goto tr_bad_context; } goto tr_valid; tr_handle_set_config: - if (state == ST_DATA) { + if (state == USB_HR_NOT_COMPLETE) { if (usb2_handle_set_config(xfer, req.wValue[0])) { goto tr_stalled; } @@ -650,7 +650,7 @@ tr_handle_set_config: goto tr_valid; tr_handle_clear_halt: - if (state == ST_DATA) { + if (state == USB_HR_NOT_COMPLETE) { if (usb2_handle_set_stall(xfer, req.wIndex[0], 0)) { goto tr_stalled; } @@ -658,7 +658,7 @@ tr_handle_clear_halt: goto tr_valid; tr_handle_clear_wakeup: - if (state == ST_DATA) { + if (state == USB_HR_NOT_COMPLETE) { if (usb2_handle_remote_wakeup(xfer, 0)) { goto tr_stalled; } @@ -666,7 +666,7 @@ tr_handle_clear_wakeup: goto tr_valid; tr_handle_set_halt: - if (state == ST_DATA) { + if (state == USB_HR_NOT_COMPLETE) { if (usb2_handle_set_stall(xfer, req.wIndex[0], 1)) { goto tr_stalled; } @@ -674,7 +674,7 @@ tr_handle_set_halt: goto tr_valid; tr_handle_set_wakeup: - if (state == ST_DATA) { + if (state == USB_HR_NOT_COMPLETE) { if (usb2_handle_remote_wakeup(xfer, 1)) { goto tr_stalled; } @@ -682,7 +682,7 @@ tr_handle_set_wakeup: goto tr_valid; tr_handle_get_ep_status: - if (state == ST_DATA) { + if (state == USB_HR_NOT_COMPLETE) { temp.wStatus[0] = usb2_handle_get_stall(udev, req.wIndex[0]); temp.wStatus[1] = 0; @@ -692,7 +692,7 @@ tr_handle_get_ep_status: goto tr_valid; tr_valid: - if (state == ST_POST_STATUS) { + if (state != USB_HR_NOT_COMPLETE) { goto tr_stalled; } /* subtract offset from length */ @@ -748,7 +748,7 @@ tr_valid: return (0); /* success */ tr_stalled: - DPRINTF("%s\n", (state == ST_POST_STATUS) ? + DPRINTF("%s\n", (state != USB_HR_NOT_COMPLETE) ? "complete" : "stalled"); return (USB_ERR_STALLED); Modified: head/sys/dev/usb/usb_if.m ============================================================================== --- head/sys/dev/usb/usb_if.m Fri Jun 12 15:53:56 2009 (r194063) +++ head/sys/dev/usb/usb_if.m Fri Jun 12 15:58:55 2009 (r194064) @@ -47,6 +47,5 @@ METHOD int handle_request { void **pptr; /* data pointer */ uint16_t *plen; /* maximum transfer length */ uint16_t offset; /* data offset */ - uint8_t is_complete; /* set if transfer is complete */ + uint8_t is_complete; /* set if transfer is complete, see USB_HR_XXX */ }; - From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 16:00:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C58241065688; Fri, 12 Jun 2009 16:00:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B341F8FC0A; Fri, 12 Jun 2009 16:00:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CG0Cgo086340; Fri, 12 Jun 2009 16:00:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CG0C2a086339; Fri, 12 Jun 2009 16:00:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906121600.n5CG0C2a086339@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Jun 2009 16:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194065 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 16:00:15 -0000 Author: thompsa Date: Fri Jun 12 16:00:12 2009 New Revision: 194065 URL: http://svn.freebsd.org/changeset/base/194065 Log: Free the correct memory pointer. Submitted by: Tim Borgeaud (via HPS) Modified: head/sys/dev/usb/usb_compat_linux.c Modified: head/sys/dev/usb/usb_compat_linux.c ============================================================================== --- head/sys/dev/usb/usb_compat_linux.c Fri Jun 12 15:58:55 2009 (r194064) +++ head/sys/dev/usb/usb_compat_linux.c Fri Jun 12 16:00:12 2009 (r194065) @@ -1143,7 +1143,7 @@ usb_linux_free_device(struct usb_device uhe++; } err = usb_setup_endpoint(dev, &dev->ep0, 0); - free(uhe, M_USBDEV); + free(dev->linux_endpoint_start, M_USBDEV); } /*------------------------------------------------------------------------* From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 16:03:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE079106566B; Fri, 12 Jun 2009 16:03:38 +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 9CD8C8FC1C; Fri, 12 Jun 2009 16:03:38 +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 n5CG3cu8086476; Fri, 12 Jun 2009 16:03:38 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CG3cBe086475; Fri, 12 Jun 2009 16:03:38 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906121603.n5CG3cBe086475@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Jun 2009 16:03: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: r194067 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 16:03:39 -0000 Author: thompsa Date: Fri Jun 12 16:03:38 2009 New Revision: 194067 URL: http://svn.freebsd.org/changeset/base/194067 Log: Check for a keyboard HID report in addition to the interface class so devices such as the Yubikey attach. Submitted by: Hans Petter Selasky Reported by: Jeremy Faulkner Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Fri Jun 12 16:00:42 2009 (r194066) +++ head/sys/dev/usb/input/ukbd.c Fri Jun 12 16:03:38 2009 (r194067) @@ -659,6 +659,9 @@ ukbd_probe(device_t dev) { keyboard_switch_t *sw = kbd_get_switch(UKBD_DRIVER_NAME); struct usb_attach_arg *uaa = device_get_ivars(dev); + void *d_ptr; + int error; + uint16_t d_len; DPRINTFN(11, "\n"); @@ -668,16 +671,35 @@ ukbd_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); } - /* check that the keyboard speaks the boot protocol: */ - if ((uaa->info.bInterfaceClass == UICLASS_HID) - && (uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) - && (uaa->info.bInterfaceProtocol == UPROTO_BOOT_KEYBOARD)) { + + if (uaa->info.bInterfaceClass != UICLASS_HID) + return (ENXIO); + + if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && + (uaa->info.bInterfaceProtocol == UPROTO_BOOT_KEYBOARD)) { if (usb2_test_quirk(uaa, UQ_KBD_IGNORE)) return (ENXIO); else return (0); } - return (ENXIO); + + error = usb2_req_get_hid_desc(uaa->device, NULL, + &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); + + if (error) + return (ENXIO); + + if (hid_is_collection(d_ptr, d_len, + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_KEYBOARD))) { + if (usb2_test_quirk(uaa, UQ_KBD_IGNORE)) + error = ENXIO; + else + error = 0; + } else + error = ENXIO; + + free(d_ptr, M_TEMP); + return (error); } static int From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 16:04:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21DAF106567B; Fri, 12 Jun 2009 16:04:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 108A98FC2C; Fri, 12 Jun 2009 16:04:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CG4WRK086532; Fri, 12 Jun 2009 16:04:32 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CG4WgB086531; Fri, 12 Jun 2009 16:04:32 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906121604.n5CG4WgB086531@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Jun 2009 16:04: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: r194068 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 16:04:34 -0000 Author: thompsa Date: Fri Jun 12 16:04:32 2009 New Revision: 194068 URL: http://svn.freebsd.org/changeset/base/194068 Log: Change ums_probe() so it does not need to fetch the usb_interface_descriptor. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/input/ums.c Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Fri Jun 12 16:03:38 2009 (r194067) +++ head/sys/dev/usb/input/ums.c Fri Jun 12 16:04:32 2009 (r194068) @@ -332,7 +332,6 @@ static int ums_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - struct usb_interface_descriptor *id; void *d_ptr; int error; uint16_t d_len; @@ -342,12 +341,13 @@ ums_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - id = usb2_get_interface_descriptor(uaa->iface); - - if ((id == NULL) || - (id->bInterfaceClass != UICLASS_HID)) + if (uaa->info.bInterfaceClass != UICLASS_HID) return (ENXIO); + if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && + (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) + return (0); + error = usb2_req_get_hid_desc(uaa->device, NULL, &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); @@ -357,9 +357,6 @@ ums_probe(device_t dev) if (hid_is_collection(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) error = 0; - else if ((id->bInterfaceSubClass == UISUBCLASS_BOOT) && - (id->bInterfaceProtocol == UIPROTO_MOUSE)) - error = 0; else error = ENXIO; From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 16:07:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC383106566C; Fri, 12 Jun 2009 16:07:06 +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 DA3708FC28; Fri, 12 Jun 2009 16:07:06 +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 n5CG76tk086626; Fri, 12 Jun 2009 16:07:06 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CG760v086620; Fri, 12 Jun 2009 16:07:06 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906121607.n5CG760v086620@svn.freebsd.org> From: Andrew Thompson Date: Fri, 12 Jun 2009 16:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194069 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 16:07:07 -0000 Author: thompsa Date: Fri Jun 12 16:07:06 2009 New Revision: 194069 URL: http://svn.freebsd.org/changeset/base/194069 Log: Cleanup claim/release interface code, which is specific to libusb v0.1. Remove claim and release interface support from libusb v2.0, because it is not useful. Submitted by: Hans Petter Selasky Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h head/lib/libusb/libusb20_compat01.c head/lib/libusb/libusb20_int.h head/lib/libusb/libusb20_ugen20.c Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Fri Jun 12 16:04:32 2009 (r194068) +++ head/lib/libusb/libusb.3 Fri Jun 12 16:07:06 2009 (r194069) @@ -117,8 +117,6 @@ USB access library (libusb -lusb) .Ft const char * .Fn libusb20_dev_get_desc "struct libusb20_device *pdev" .Ft int -.Fn libusb20_dev_claim_interface "struct libusb20_device *pdev" "uint8_t iface_index" -.Ft int .Fn libusb20_dev_close "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_detach_kernel_driver "struct libusb20_device *pdev" "uint8_t iface_index" @@ -135,8 +133,6 @@ USB access library (libusb -lusb) .Ft int .Fn libusb20_dev_process "struct libusb20_device *pdev" .Ft int -.Fn libusb20_dev_release_interface "struct libusb20_device *pdev" "uint8_t iface_index" -.Ft int .Fn libusb20_dev_request_sync "struct libusb20_device *pdev" "struct LIBUSB20_CONTROL_SETUP_DECODED *setup" "void *data" "uint16_t *pactlen" "uint32_t timeout" "uint8_t flags" .Ft int .Fn libusb20_dev_req_string_sync "struct libusb20_device *pdev" "uint8_t index" "uint16_t langid" "void *ptr" "uint16_t len" @@ -517,14 +513,6 @@ The format of the string is: "drivername . .Pp . -.Fn libusb20_dev_claim_interface -This function will try to claim the given USB interface given by -.Fa iface_index . -This function returns zero on success else a LIBUSB20_ERROR value is -returned. -. -.Pp -. .Fn libusb20_dev_close will close the given USB device. . @@ -601,14 +589,6 @@ detached. . .Pp . -.Fn libusb20_dev_release_interface -will try to release a claimed USB interface for the specified USB device. -. -This function returns zero on success else a LIBUSB20_ERROR value is -returned. -. -.Pp -. .Fn libusb20_dev_request_sync will perform a synchronous control request on the given USB device. Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Fri Jun 12 16:04:32 2009 (r194068) +++ head/lib/libusb/libusb20.c Fri Jun 12 16:07:06 2009 (r194069) @@ -65,8 +65,6 @@ dummy_callback(struct libusb20_transfer #define dummy_get_config_desc_full (void *)dummy_int #define dummy_get_config_index (void *)dummy_int #define dummy_set_config_index (void *)dummy_int -#define dummy_claim_interface (void *)dummy_int -#define dummy_release_interface (void *)dummy_int #define dummy_set_alt_index (void *)dummy_int #define dummy_reset_device (void *)dummy_int #define dummy_set_power_mode (void *)dummy_int @@ -451,24 +449,6 @@ libusb20_tr_start(struct libusb20_transf /* USB device operations */ int -libusb20_dev_claim_interface(struct libusb20_device *pdev, uint8_t ifaceIndex) -{ - int error; - - if (ifaceIndex >= 32) { - error = LIBUSB20_ERROR_INVALID_PARAM; - } else if (pdev->claimed_interfaces & (1 << ifaceIndex)) { - error = LIBUSB20_ERROR_NOT_FOUND; - } else { - error = pdev->methods->claim_interface(pdev, ifaceIndex); - } - if (!error) { - pdev->claimed_interfaces |= (1 << ifaceIndex); - } - return (error); -} - -int libusb20_dev_close(struct libusb20_device *pdev) { struct libusb20_transfer *xfer; @@ -494,7 +474,11 @@ libusb20_dev_close(struct libusb20_devic pdev->is_opened = 0; - pdev->claimed_interfaces = 0; + /* + * The following variable is only used by the libusb v0.1 + * compat layer: + */ + pdev->claimed_interface = 0; return (error); } @@ -580,24 +564,6 @@ libusb20_dev_open(struct libusb20_device } int -libusb20_dev_release_interface(struct libusb20_device *pdev, uint8_t ifaceIndex) -{ - int error; - - if (ifaceIndex >= 32) { - error = LIBUSB20_ERROR_INVALID_PARAM; - } else if (!(pdev->claimed_interfaces & (1 << ifaceIndex))) { - error = LIBUSB20_ERROR_NOT_FOUND; - } else { - error = pdev->methods->release_interface(pdev, ifaceIndex); - } - if (!error) { - pdev->claimed_interfaces &= ~(1 << ifaceIndex); - } - return (error); -} - -int libusb20_dev_reset(struct libusb20_device *pdev) { int error; Modified: head/lib/libusb/libusb20.h ============================================================================== --- head/lib/libusb/libusb20.h Fri Jun 12 16:04:32 2009 (r194068) +++ head/lib/libusb/libusb20.h Fri Jun 12 16:07:06 2009 (r194069) @@ -237,7 +237,6 @@ void *libusb20_tr_get_priv_sc1(struct const char *libusb20_dev_get_backend_name(struct libusb20_device *pdev); const char *libusb20_dev_get_desc(struct libusb20_device *pdev); -int libusb20_dev_claim_interface(struct libusb20_device *pdev, uint8_t iface_index); int libusb20_dev_close(struct libusb20_device *pdev); int libusb20_dev_detach_kernel_driver(struct libusb20_device *pdev, uint8_t iface_index); int libusb20_dev_set_config_index(struct libusb20_device *pdev, uint8_t configIndex); @@ -246,7 +245,6 @@ int libusb20_dev_get_fd(struct libusb20_ int libusb20_dev_kernel_driver_active(struct libusb20_device *pdev, uint8_t iface_index); int libusb20_dev_open(struct libusb20_device *pdev, uint16_t transfer_max); int libusb20_dev_process(struct libusb20_device *pdev); -int libusb20_dev_release_interface(struct libusb20_device *pdev, uint8_t iface_index); int libusb20_dev_request_sync(struct libusb20_device *pdev, struct LIBUSB20_CONTROL_SETUP_DECODED *setup, void *data, uint16_t *pactlen, uint32_t timeout, uint8_t flags); int libusb20_dev_req_string_sync(struct libusb20_device *pdev, uint8_t index, uint16_t langid, void *ptr, uint16_t len); int libusb20_dev_req_string_simple_sync(struct libusb20_device *pdev, uint8_t index, void *ptr, uint16_t len); Modified: head/lib/libusb/libusb20_compat01.c ============================================================================== --- head/lib/libusb/libusb20_compat01.c Fri Jun 12 16:04:32 2009 (r194068) +++ head/lib/libusb/libusb20_compat01.c Fri Jun 12 16:07:06 2009 (r194069) @@ -99,26 +99,6 @@ struct usb_parse_state { uint8_t preparse; }; -static uint8_t -usb_get_first_claimed_interface(usb_dev_handle * dev) -{ - struct libusb20_device *pdev = (void *)dev; - uint32_t x; - uint8_t y; - - x = pdev->claimed_interfaces; - - for (y = 0; y != 32; y++) { - if (x & (1 << y)) - break; - } - - if (y == 32) - y = 0xFF; /* dummy */ - - return (y); -} - static struct libusb20_transfer * usb_get_transfer_by_ep_no(usb_dev_handle * dev, uint8_t ep_no) { @@ -746,12 +726,9 @@ usb_set_configuration(usb_dev_handle * u int usb_claim_interface(usb_dev_handle * dev, int interface) { - int err; - - err = libusb20_dev_claim_interface((void *)dev, interface); + struct libusb20_device *pdev = (void *)dev; - if (err) - return (-1); + pdev->claimed_interface = interface; return (0); } @@ -759,23 +736,18 @@ usb_claim_interface(usb_dev_handle * dev int usb_release_interface(usb_dev_handle * dev, int interface) { - int err; - - err = libusb20_dev_release_interface((void *)dev, interface); - - if (err) - return (-1); - + /* do nothing */ return (0); } int usb_set_altinterface(usb_dev_handle * dev, int alternate) { + struct libusb20_device *pdev = (void *)dev; int err; uint8_t iface; - iface = usb_get_first_claimed_interface(dev); + iface = pdev->claimed_interface; err = libusb20_dev_set_alt_index((void *)dev, iface, alternate); Modified: head/lib/libusb/libusb20_int.h ============================================================================== --- head/lib/libusb/libusb20_int.h Fri Jun 12 16:04:32 2009 (r194068) +++ head/lib/libusb/libusb20_int.h Fri Jun 12 16:07:06 2009 (r194069) @@ -90,14 +90,12 @@ typedef int (libusb20_dummy_int_t)(void) typedef void (libusb20_dummy_void_t)(void); /* USB device specific */ -typedef int (libusb20_claim_interface_t)(struct libusb20_device *pdev, uint8_t iface_index); typedef int (libusb20_detach_kernel_driver_t)(struct libusb20_device *pdev, uint8_t iface_index); typedef int (libusb20_do_request_sync_t)(struct libusb20_device *pdev, struct LIBUSB20_CONTROL_SETUP_DECODED *setup, void *data, uint16_t *pactlen, uint32_t timeout, uint8_t flags); typedef int (libusb20_get_config_desc_full_t)(struct libusb20_device *pdev, uint8_t **ppbuf, uint16_t *plen, uint8_t index); typedef int (libusb20_get_config_index_t)(struct libusb20_device *pdev, uint8_t *pindex); typedef int (libusb20_kernel_driver_active_t)(struct libusb20_device *pdev, uint8_t iface_index); typedef int (libusb20_process_t)(struct libusb20_device *pdev); -typedef int (libusb20_release_interface_t)(struct libusb20_device *pdev, uint8_t iface_index); typedef int (libusb20_reset_device_t)(struct libusb20_device *pdev); typedef int (libusb20_set_power_mode_t)(struct libusb20_device *pdev, uint8_t power_mode); typedef int (libusb20_get_power_mode_t)(struct libusb20_device *pdev, uint8_t *power_mode); @@ -112,14 +110,12 @@ typedef void (libusb20_tr_submit_t)(stru typedef void (libusb20_tr_cancel_async_t)(struct libusb20_transfer *xfer); #define LIBUSB20_DEVICE(m,n) \ - m(n, claim_interface) \ m(n, detach_kernel_driver) \ m(n, do_request_sync) \ m(n, get_config_desc_full) \ m(n, get_config_index) \ m(n, kernel_driver_active) \ m(n, process) \ - m(n, release_interface) \ m(n, reset_device) \ m(n, set_power_mode) \ m(n, get_power_mode) \ @@ -198,8 +194,8 @@ struct libusb20_device { /* libUSB v0.1 compat data */ void *priv01Data; - /* claimed interfaces */ - uint32_t claimed_interfaces; + /* claimed interface */ + uint8_t claimed_interface; /* device file handle */ int file; Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Fri Jun 12 16:04:32 2009 (r194068) +++ head/lib/libusb/libusb20_ugen20.c Fri Jun 12 16:07:06 2009 (r194069) @@ -67,8 +67,6 @@ const struct libusb20_backend_methods li static libusb20_get_config_desc_full_t ugen20_get_config_desc_full; static libusb20_get_config_index_t ugen20_get_config_index; static libusb20_set_config_index_t ugen20_set_config_index; -static libusb20_claim_interface_t ugen20_claim_interface; -static libusb20_release_interface_t ugen20_release_interface; static libusb20_set_alt_index_t ugen20_set_alt_index; static libusb20_reset_device_t ugen20_reset_device; static libusb20_set_power_mode_t ugen20_set_power_mode; @@ -517,28 +515,6 @@ ugen20_set_config_index(struct libusb20_ } static int -ugen20_claim_interface(struct libusb20_device *pdev, uint8_t iface_index) -{ - int temp = iface_index; - - if (ioctl(pdev->file_ctrl, USB_CLAIM_INTERFACE, &temp)) { - return (LIBUSB20_ERROR_OTHER); - } - return (0); -} - -static int -ugen20_release_interface(struct libusb20_device *pdev, uint8_t iface_index) -{ - int temp = iface_index; - - if (ioctl(pdev->file_ctrl, USB_RELEASE_INTERFACE, &temp)) { - return (LIBUSB20_ERROR_OTHER); - } - return (0); -} - -static int ugen20_set_alt_index(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index) { From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 16:10:17 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2377B1065700; Fri, 12 Jun 2009 16:10:17 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id BF8B48FC27; Fri, 12 Jun 2009 16:10:16 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n5CGA9UQ026899; Fri, 12 Jun 2009 10:10:09 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A327DE1.9040806@samsco.org> Date: Fri, 12 Jun 2009 10:10:09 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Julian Elischer References: <200906111650.n5BGonnn053446@svn.freebsd.org> <20090611190140.GE2642@garage.freebsd.pl> <200906112123.02105.zec@freebsd.org> <4A3168A0.2090308@elischer.org> <20090611202757.7cb0dad5@kan.dnsalias.net> <4A31F9BE.6000405@elischer.org> In-Reply-To: <4A31F9BE.6000405@elischer.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, Marko Zec , svn-src-head@FreeBSD.org, Alexander Kabaev Subject: Re: svn commit: r194012 - in head: . sys/netgraph sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 16:10:17 -0000 Julian Elischer wrote: > Alexander Kabaev wrote: >> On Thu, 11 Jun 2009 13:27:12 -0700 >> Julian Elischer wrote: >> >>> Marko Zec wrote: >>>> On Thursday 11 June 2009 21:01:40 Pawel Jakub Dawidek wrote: >>>>> On Thu, Jun 11, 2009 at 04:50:49PM +0000, Marko Zec wrote: >>>>>> Author: zec >>>>>> Date: Thu Jun 11 16:50:49 2009 >>>>>> New Revision: 194012 >>>>>> URL: http://svn.freebsd.org/changeset/base/194012 >>>>>> >>>>>> Log: >>>>>> Introduce a mechanism for detecting calls from outbound path of >>>>>> the network stack when reentering the inbound path from netgraph, >>>>>> and force queueing of mbufs at the outbound netgraph node. >>>>>> >>>>>> The mechanism relies on two components. First, in netgraph >>>>>> nodes where outbound path of the network stack calls into >>>>>> netgraph, the current thread has to be appropriately marked using >>>>>> the new NG_OUTBOUND_THREAD_REF() macro before proceeding to call >>>>>> further into the netgraph topology, and unmarked using the >>>>>> NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. >>>>>> Second, netgraph nodes which can potentially reenter the network >>>>>> stack in the inbound path have to mark their inbound hooks using >>>>>> NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will >>>>>> then detect when there is a danger of a call graph looping back >>>>>> from outbound to inbound path via netgraph, and defer handing off >>>>>> the mbufs to the "inbound" node to a worker thread with a clean >>>>>> stack. >>>>>> >>>>>> In this first pass only the most obvious netgraph nodes have >>>>>> been updated to ensure no outbound to inbound calls can occur. >>>>>> Nodes such as ng_ipfw, ng_gif etc. should be further examined >>>>>> whether a potential for outbound to inbound call looping exists. >>>>>> >>>>>> This commit changes the layout of struct thread, but due to >>>>>> __FreeBSD_version number shortage a version bump has been >>>>>> omitted at this time, nevertheless kernel and modules have to be >>>>>> rebuilt. >>>>> Are you sure Marko that you can't use sys/sys/osd.h instead of >>>>> adding yet another field to the thread structure? Netgraph is >>>>> optional component and optional components could take advantage of >>>>> allocating stuff they need dynamically. The OSD (Object-Specific >>>>> Data) KPI is designed for use by optional components - you can add >>>>> your data to a thread, you can get it when you want and OSD will >>>>> call your callback when thread dies, so you can clean up. >>>>> >>>>> Maybe you can't, but it's worth checking. >>>> Hmm how much locking overhead do osd_set() / osd_get() methods >>>> introduce? We have to bump the refcount on each entry to netgraph, >>>> and then check it potentially on each hop to next ng node, and >>>> finally drop the refcount when done with the function call into >>>> netgraph. Accessing td_ng_outbound directly via curthread is as >>>> cheap as it gets performancewise as it requires no locking >>>> whatsoever... >>> I would add that I suspect that we may end up using it in other >>> places as well outside of netgraph. >>> >> >> When that happens then per-thread field can be revisited again. Blowing >> the side of major kernel structure for the sake of subsystem is >> unused by 90%+ percent of users is little too drastic IMHO. >> >> I do second Pawel's opinion that you should look at osd for the time >> being. After all it was invented for just this reason. > > And I beg to dissagree. > > Firstly this is not the first field to be put in these structures for a > single module. > > Secondly, the overhead of doing it in the manner suggested would > be quite noticeable I think, certainly a drain on what could be > a fast-path for some packet processing. > > You've already had the author of the osd code say that osd is designed to have little overhead. Maybe it's time to at least give it a try and make some measurements? Scott From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 16:37:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BDE7106564A; Fri, 12 Jun 2009 16:37:54 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF1AA8FC1E; Fri, 12 Jun 2009 16:37:53 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CGbrui087265; Fri, 12 Jun 2009 16:37:53 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CGbraW087264; Fri, 12 Jun 2009 16:37:53 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906121637.n5CGbraW087264@svn.freebsd.org> From: Ulf Lilleengen Date: Fri, 12 Jun 2009 16:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194070 - head/contrib/csup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 16:37:54 -0000 Author: lulf Date: Fri Jun 12 16:37:53 2009 New Revision: 194070 URL: http://svn.freebsd.org/changeset/base/194070 Log: - Remove semicolon that should not have been there. Submitted by: rdivacky MFC after: 1 week Modified: head/contrib/csup/rcsfile.c Modified: head/contrib/csup/rcsfile.c ============================================================================== --- head/contrib/csup/rcsfile.c Fri Jun 12 16:07:06 2009 (r194069) +++ head/contrib/csup/rcsfile.c Fri Jun 12 16:37:53 2009 (r194070) @@ -730,7 +730,7 @@ rcsfile_print(struct rcsfile *rf) lprintf(1, "Strict!\n"); if (rf->comment != NULL) lprintf(1, "comment: '%s'\n", rf->comment); - if (rf->expand != EXPAND_DEFAULT); + if (rf->expand != EXPAND_DEFAULT) lprintf(1, "expand: '%s'\n", keyword_encode_expand(rf->expand)); /* Print all deltas. */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 17:19:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EB171065690 for ; Fri, 12 Jun 2009 17:19:55 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outH.internet-mail-service.net (outh.internet-mail-service.net [216.240.47.231]) by mx1.freebsd.org (Postfix) with ESMTP id 73FDD8FC08 for ; Fri, 12 Jun 2009 17:19:55 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 5F804DAC91; Fri, 12 Jun 2009 10:19:55 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id E051E2D6010; Fri, 12 Jun 2009 10:19:54 -0700 (PDT) Message-ID: <4A328E3A.6000507@elischer.org> Date: Fri, 12 Jun 2009 10:19:54 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: VANHULLEBUS Yvan References: <200906121544.n5CFiZTa085763@svn.freebsd.org> In-Reply-To: <200906121544.n5CFiZTa085763@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194062 - in head/sys: conf net netinet netipsec sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 17:19:56 -0000 VANHULLEBUS Yvan wrote: > Author: vanhu > Date: Fri Jun 12 15:44:35 2009 > New Revision: 194062 > URL: http://svn.freebsd.org/changeset/base/194062 > > Log: > Added support for NAT-Traversal (RFC 3948) in IPsec stack. > > Thanks to (no special order) Emmanuel Dreyfus (manu@netbsd.org), Larry > Baird (lab@gta.com), gnn, bz, and other FreeBSD devs, Julien Vanherzeele > (julien.vanherzeele@netasq.com, for years of bug reporting), the PFSense > team, and all people who used / tried the NAT-T patch for years and > reported bugs, patches, etc... > YAY! this one proves that perseverance pays off in the end... From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 17:51:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1148C106566C; Fri, 12 Jun 2009 17:51:50 +0000 (UTC) (envelope-from sullrich@gmail.com) Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id 4111B8FC08; Fri, 12 Jun 2009 17:51:49 +0000 (UTC) (envelope-from sullrich@gmail.com) Received: by ewy8 with SMTP id 8so2648449ewy.43 for ; Fri, 12 Jun 2009 10:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=pvCKW6XoADqai+Jy2ovtz3DBk7WLXcSAHQgPL6yuD+g=; b=YWC8SijqdxTnH2WC0u1J3oqCHsIzBcuZoTAu0k1UTSZGyC2m3fYXivP48H0G1sUAMF 8Fd2mDbHxEF+iANUieHAgwO/mEFneyvrHObC9cIVMp6aUmsmn3E5KaOsKUVpgKsMmUtG YsDAEankU4X6iQ8Kxe+CI63JW2z5PcNJ6wZxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=hGJq2vBWUf9E7XRdermHBCoTe09974HXD0C1ubmX9r+8o04aQMTBint32djuP3TmOc xaw7ocDNHo3cBxAFCgJnODXnIW/FaEdwUsL8ELF/ylwTjS4APme/Qhnio8Wyl5Uk/QqZ 6ANDHn5P6ZfdUQUJ2JblsoP5Ry8OIumvn5VHo= MIME-Version: 1.0 Received: by 10.210.128.5 with SMTP id a5mr1072697ebd.85.1244827545108; Fri, 12 Jun 2009 10:25:45 -0700 (PDT) In-Reply-To: <4A328E3A.6000507@elischer.org> References: <200906121544.n5CFiZTa085763@svn.freebsd.org> <4A328E3A.6000507@elischer.org> From: Scott Ullrich Date: Fri, 12 Jun 2009 13:25:25 -0400 Message-ID: To: Julian Elischer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, VANHULLEBUS Yvan , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r194062 - in head/sys: conf net netinet netipsec sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 17:51:50 -0000 On Fri, Jun 12, 2009 at 1:19 PM, Julian Elischer wrote: > YAY! > > this one proves that perseverance pays off in the end... Absolutely. It is a good day indeed! Thanks everyone involved from the pfSense team! Scott From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 18:13:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B3610656A9; Fri, 12 Jun 2009 18:13:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5678FC1D; Fri, 12 Jun 2009 18:13:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CIDYid089111; Fri, 12 Jun 2009 18:13:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CIDY1c089109; Fri, 12 Jun 2009 18:13:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906121813.n5CIDY1c089109@svn.freebsd.org> From: John Baldwin Date: Fri, 12 Jun 2009 18:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194071 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 18:13:37 -0000 Author: jhb Date: Fri Jun 12 18:13:34 2009 New Revision: 194071 URL: http://svn.freebsd.org/changeset/base/194071 Log: - Note that these interfaces require for the structure definitions. - Note that these functions return NULL on failure. MFC after: 3 days Modified: head/lib/libutil/kinfo_getfile.3 head/lib/libutil/kinfo_getvmmap.3 Modified: head/lib/libutil/kinfo_getfile.3 ============================================================================== --- head/lib/libutil/kinfo_getfile.3 Fri Jun 12 16:37:53 2009 (r194070) +++ head/lib/libutil/kinfo_getfile.3 Fri Jun 12 18:13:34 2009 (r194071) @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_file * .Fn kinfo_getfile "pid_t pid" "int *cntp" @@ -58,7 +59,7 @@ mib. While the kernel returns a packed structure, this function expands the data into a fixed record format. .Sh RETURN VALUES -The +On success the .Fn kinfo_getfile function returns a pointer to an array of .Vt struct kinfo_file @@ -67,6 +68,10 @@ The array was obtained by an internal ca .Xr malloc 3 and must be freed by the caller with a call to .Xr free 3 . +On failure the +.Fn kinfo_getfile +function returns +.Dv NULL . .Sh SEE ALSO .Xr free 3 , .Xr kinfo_getvmmap 3 , Modified: head/lib/libutil/kinfo_getvmmap.3 ============================================================================== --- head/lib/libutil/kinfo_getvmmap.3 Fri Jun 12 16:37:53 2009 (r194070) +++ head/lib/libutil/kinfo_getvmmap.3 Fri Jun 12 18:13:34 2009 (r194071) @@ -35,6 +35,7 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h +.In sys/user.h .In libutil.h .Ft struct kinfo_vmentry * .Fn kinfo_getfile "pid_t pid" "int *cntp" @@ -58,7 +59,7 @@ mib. While the kernel returns a packed structure, this function expands the data into a fixed record format. .Sh RETURN VALUES -The +On success the .Fn kinfo_getvmmap function returns a pointer to an array of .Vt struct kinfo_vmentry @@ -67,6 +68,10 @@ The array was obtained by an internal ca .Xr malloc 3 and must be freed by the caller with a call to .Xr free 3 . +On failure the +.Fn kinfo_getvmmap +function returns +.Dv NULL . .Sh SEE ALSO .Xr free 3 , .Xr kinfo_getfile 3 , From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 20:00:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31E0B106564A; Fri, 12 Jun 2009 20:00:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB658FC1D; Fri, 12 Jun 2009 20:00:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CK0dpV091208; Fri, 12 Jun 2009 20:00:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CK0cwE091197; Fri, 12 Jun 2009 20:00:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200906122000.n5CK0cwE091197@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 12 Jun 2009 20:00: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: r194072 - in head/sys: arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion dev/uart dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 20:00:39 -0000 Author: marcel Date: Fri Jun 12 20:00:38 2009 New Revision: 194072 URL: http://svn.freebsd.org/changeset/base/194072 Log: Move the memory layout definitions and logic from mvreg.h to mvwin.h so that it isn't exposured unless needed. In particular this means that it's easier to tune the memory layout based on board details. While here, remove inclusion of from mvreg.h. This also contains exposure to SoC specifics in MI drivers, because NIRQ depends on the SoC. Added: head/sys/arm/mv/mvwin.h (contents, props changed) Modified: head/sys/arm/mv/common.c head/sys/arm/mv/discovery/db78xxx.c head/sys/arm/mv/discovery/discovery.c head/sys/arm/mv/kirkwood/db88f6xxx.c head/sys/arm/mv/kirkwood/kirkwood.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/orion/db88f5xxx.c head/sys/arm/mv/orion/orion.c head/sys/dev/uart/uart_cpu_mv.c head/sys/dev/usb/controller/ehci_mbus.c Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/arm/mv/common.c Fri Jun 12 20:00:38 2009 (r194072) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include static int win_eth_can_remap(int i); Modified: head/sys/arm/mv/discovery/db78xxx.c ============================================================================== --- head/sys/arm/mv/discovery/db78xxx.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/arm/mv/discovery/db78xxx.c Fri Jun 12 20:00:38 2009 (r194072) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* * Virtual address space layout: Modified: head/sys/arm/mv/discovery/discovery.c ============================================================================== --- head/sys/arm/mv/discovery/discovery.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/arm/mv/discovery/discovery.c Fri Jun 12 20:00:38 2009 (r194072) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define _MV_PCIE_MAX_PORT 8 Modified: head/sys/arm/mv/kirkwood/db88f6xxx.c ============================================================================== --- head/sys/arm/mv/kirkwood/db88f6xxx.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/arm/mv/kirkwood/db88f6xxx.c Fri Jun 12 20:00:38 2009 (r194072) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* * Virtual address space layout: Modified: head/sys/arm/mv/kirkwood/kirkwood.c ============================================================================== --- head/sys/arm/mv/kirkwood/kirkwood.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/arm/mv/kirkwood/kirkwood.c Fri Jun 12 20:00:38 2009 (r194072) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include struct obio_device obio_devices[] = { { "ic", MV_IC_BASE, MV_IC_SIZE, Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/arm/mv/mvreg.h Fri Jun 12 20:00:38 2009 (r194072) @@ -34,120 +34,6 @@ #ifndef _MVREG_H_ #define _MVREG_H_ -#include - -/* - * Physical addresses of integrated SoC peripherals - */ -#define MV_PHYS_BASE 0xF1000000 -#define MV_SIZE 0x100000 - -/* - * Decode windows addresses (physical) - */ -#define MV_PCIE_IO_PHYS_BASE (MV_PHYS_BASE + MV_SIZE) -#define MV_PCIE_IO_BASE MV_PCIE_IO_PHYS_BASE -#define MV_PCIE_IO_SIZE (1024 * 1024) -#define MV_PCI_IO_PHYS_BASE (MV_PCIE_IO_PHYS_BASE + MV_PCIE_IO_SIZE) -#define MV_PCI_IO_BASE MV_PCI_IO_PHYS_BASE -#define MV_PCI_IO_SIZE (1024 * 1024) - -#define MV_PCIE_MEM_PHYS_BASE (MV_PCI_IO_PHYS_BASE + MV_PCI_IO_SIZE) -#define MV_PCIE_MEM_BASE MV_PCIE_MEM_PHYS_BASE -#define MV_PCIE_MEM_SIZE (64 * 1024 * 1024) -#define MV_PCI_MEM_PHYS_BASE (MV_PCIE_MEM_PHYS_BASE + MV_PCIE_MEM_SIZE) -#define MV_PCI_MEM_BASE MV_PCI_MEM_PHYS_BASE -#define MV_PCI_MEM_SIZE (64 * 1024 * 1024) - -/* XXX DEV_BOOT, CSx are board specific, should be defined per platform */ - -/* 512KB NOR FLASH */ -#define MV_DEV_BOOT_PHYS_BASE (MV_PCI_MEM_PHYS_BASE + MV_PCI_MEM_SIZE) -#define MV_DEV_BOOT_SIZE (512 * 1024) -/* CS0: 7-seg LED */ -#define MV_DEV_CS0_PHYS_BASE 0xFA000000 -#define MV_DEV_CS0_SIZE (1024 * 1024) /* XXX u-boot has 2MB */ -/* CS1: 32MB NOR FLASH */ -#define MV_DEV_CS1_PHYS_BASE (MV_DEV_CS0_PHYS_BASE + MV_DEV_CS0_SIZE) -#define MV_DEV_CS1_SIZE (32 * 1024 * 1024) -/* CS2: 32MB NAND FLASH */ -#define MV_DEV_CS2_PHYS_BASE (MV_DEV_CS1_PHYS_BASE + MV_DEV_CS1_SIZE) -#define MV_DEV_CS2_SIZE 1024 /* XXX u-boot has 1MB */ - -#define MV_CESA_SRAM_PHYS_BASE 0xFD000000 -#define MV_CESA_SRAM_BASE MV_CESA_SRAM_PHYS_BASE /* VA == PA mapping */ -#define MV_CESA_SRAM_SIZE (1024 * 1024) - -/* XXX this is probably not robust against wraparounds... */ -#if ((MV_CESA_SRAM_PHYS_BASE + MV_CESA_SRAM_SIZE) > 0xFFFEFFFF) -#error Devices memory layout overlaps reset vectors range! -#endif - -/* - * Integrated SoC peripherals addresses - */ -#define MV_BASE MV_PHYS_BASE /* VA == PA mapping */ -#define MV_DDR_CADR_BASE (MV_BASE + 0x1500) -#define MV_MPP_BASE (MV_BASE + 0x10000) -#define MV_GPIO_BASE (MV_BASE + 0x10100) -#define MV_GPIO_SIZE 0x20 -#define MV_RTC_BASE (MV_BASE + 0x10300) -#define MV_RTC_SIZE 0x08 -#define MV_TWSI_BASE (MV_BASE + 0x11000) -#define MV_TWSI_SIZE 0x20 -#define MV_UART0_BASE (MV_BASE + 0x12000) -#define MV_UART1_BASE (MV_BASE + 0x12100) -#define MV_UART_SIZE 0x20 -#define MV_MBUS_BRIDGE_BASE (MV_BASE + 0x20000) -#define MV_INTREGS_BASE (MV_MBUS_BRIDGE_BASE + 0x80) -#define MV_CPU_CONTROL_BASE (MV_MBUS_BRIDGE_BASE + 0x100) -#define MV_IC_BASE (MV_MBUS_BRIDGE_BASE + 0x200) -#define MV_IC_SIZE 0x3C -#define MV_TIMERS_BASE (MV_MBUS_BRIDGE_BASE + 0x300) -#define MV_TIMERS_SIZE 0x30 -#define MV_PCI_BASE (MV_BASE + 0x30000) -#define MV_PCI_SIZE 0x2000 -#if defined (SOC_MV_KIRKWOOD) -#define MV_CESA_BASE (MV_BASE + 0x30000) /* CESA,PCI don't coexist */ -#elif defined (SOC_MV_ORION) || defined(SOC_MV_DISCOVERY) -#define MV_CESA_BASE (MV_BASE + 0x90000) -#endif -#define MV_CESA_SIZE 0x10000 -#define MV_PCIE_BASE (MV_BASE + 0x40000) -#define MV_PCIE_SIZE 0x2000 - -#define MV_PCIE00_BASE (MV_PCIE_BASE + 0x00000) -#define MV_PCIE01_BASE (MV_PCIE_BASE + 0x04000) -#define MV_PCIE02_BASE (MV_PCIE_BASE + 0x08000) -#define MV_PCIE03_BASE (MV_PCIE_BASE + 0x0C000) -#define MV_PCIE10_BASE (MV_PCIE_BASE + 0x40000) -#define MV_PCIE11_BASE (MV_PCIE_BASE + 0x44000) -#define MV_PCIE12_BASE (MV_PCIE_BASE + 0x48000) -#define MV_PCIE13_BASE (MV_PCIE_BASE + 0x4C000) - -#define MV_USB0_BASE (MV_BASE + 0x50000) -#define MV_USB1_BASE (MV_USB0_BASE + 0x1000) -#define MV_USB2_BASE (MV_USB0_BASE + 0x2000) -#define MV_USB_SIZE 0x1000 -#define MV_USB_HOST_OFST 0x0100 /* EHCI HC regs start at this offset within USB range */ -#define MV_USB_AWR_BASE (MV_USB0_BASE + 0x320) -#define MV_IDMA_BASE (MV_BASE + 0x60000) -#define MV_IDMA_SIZE 0x1000 -#define MV_XOR_BASE (MV_BASE + 0x60000) -#define MV_XOR_SIZE 0x1000 -#define MV_ETH0_BASE (MV_BASE + 0x72000) -#define MV_ETH1_BASE (MV_BASE + 0x76000) -#define MV_ETH_SIZE 0x2000 -#if defined(SOC_MV_ORION) || defined(SOC_MV_KIRKWOOD) -#define MV_SATAHC_BASE (MV_BASE + 0x80000) -#define MV_SATAHC_SIZE 0x6000 -#elif defined(SOC_MV_DISCOVERY) -#define MV_SATAHC_BASE (MV_BASE + 0xA0000) -#define MV_SATAHC_SIZE 0x6000 -#endif - -#define MV_DEV_CS0_BASE MV_DEV_CS0_PHYS_BASE - /* * Interrupt sources */ @@ -478,135 +364,4 @@ #define MV_DEV_MV78100_Z0 0x6381 #define MV_DEV_MV78100 0x7810 -/* - * Decode windows definitions and macros - */ -#define MV_WIN_CPU_CTRL(n) (0x10 * (n) + (((n) < 8) ? 0x000 : 0x880)) -#define MV_WIN_CPU_BASE(n) (0x10 * (n) + (((n) < 8) ? 0x004 : 0x884)) -#define MV_WIN_CPU_REMAP_LO(n) (0x10 * (n) + (((n) < 8) ? 0x008 : 0x888)) -#define MV_WIN_CPU_REMAP_HI(n) (0x10 * (n) + (((n) < 8) ? 0x00C : 0x88C)) -#if defined(SOC_MV_DISCOVERY) -#define MV_WIN_CPU_MAX 14 -#else -#define MV_WIN_CPU_MAX 8 -#endif - -#define MV_WIN_DDR_BASE(n) (0x8 * (n) + 0x0) -#define MV_WIN_DDR_SIZE(n) (0x8 * (n) + 0x4) -#define MV_WIN_DDR_MAX 4 - -#define MV_WIN_CESA_CTRL(n) (0x8 * (n) + 0xa04) -#define MV_WIN_CESA_BASE(n) (0x8 * (n) + 0xa00) -#define MV_WIN_CESA_MAX 4 - -#define MV_WIN_USB_CTRL(n, m) (0x10 * (n) + (m) * 0x1000 + 0x0) -#define MV_WIN_USB_BASE(n, m) (0x10 * (n) + (m) * 0x1000 + 0x4) -#define MV_WIN_USB_MAX 4 - -#define MV_WIN_ETH_BASE(n) (0x8 * (n) + 0x200) -#define MV_WIN_ETH_SIZE(n) (0x8 * (n) + 0x204) -#define MV_WIN_ETH_REMAP(n) (0x4 * (n) + 0x280) -#define MV_WIN_ETH_MAX 6 - -#define MV_WIN_IDMA_BASE(n) (0x8 * (n) + 0xa00) -#define MV_WIN_IDMA_SIZE(n) (0x8 * (n) + 0xa04) -#define MV_WIN_IDMA_REMAP(n) (0x4 * (n) + 0xa60) -#define MV_WIN_IDMA_CAP(n) (0x4 * (n) + 0xa70) -#define MV_WIN_IDMA_MAX 8 -#define MV_IDMA_CHAN_MAX 4 - -#define MV_WIN_XOR_BASE(n, m) (0x4 * (n) + 0xa50 + (m) * 0x100) -#define MV_WIN_XOR_SIZE(n, m) (0x4 * (n) + 0xa70 + (m) * 0x100) -#define MV_WIN_XOR_REMAP(n, m) (0x4 * (n) + 0xa90 + (m) * 0x100) -#define MV_WIN_XOR_CTRL(n, m) (0x4 * (n) + 0xa40 + (m) * 0x100) -#define MV_WIN_XOR_OVERR(n, m) (0x4 * (n) + 0xaa0 + (m) * 0x100) -#define MV_WIN_XOR_MAX 8 -#define MV_XOR_CHAN_MAX 2 -#define MV_XOR_NON_REMAP 4 - -#define MV_WIN_PCIE_CTRL(n) (0x10 * (((n) < 5) ? (n) : \ - (n) + 1) + 0x1820) -#define MV_WIN_PCIE_BASE(n) (0x10 * (((n) < 5) ? (n) : \ - (n) + 1) + 0x1824) -#define MV_WIN_PCIE_REMAP(n) (0x10 * (((n) < 5) ? (n) : \ - (n) + 1) + 0x182C) -#define MV_WIN_PCIE_MAX 6 - -#define MV_PCIE_BAR(n) (0x04 * (n) + 0x1804) -#define MV_PCIE_BAR_MAX 3 - -#define MV_WIN_SATA_CTRL(n) (0x10 * (n) + 0x30) -#define MV_WIN_SATA_BASE(n) (0x10 * (n) + 0x34) -#define MV_WIN_SATA_MAX 4 - -#define WIN_REG_IDX_RD(pre,reg,off,base) \ - static __inline uint32_t \ - pre ## _ ## reg ## _read(int i) \ - { \ - return (bus_space_read_4(obio_tag, base, off(i))); \ - } - -#define WIN_REG_IDX_RD2(pre,reg,off,base) \ - static __inline uint32_t \ - pre ## _ ## reg ## _read(int i, int j) \ - { \ - return (bus_space_read_4(obio_tag, base, off(i, j))); \ - } \ - -#define WIN_REG_BASE_IDX_RD(pre,reg,off) \ - static __inline uint32_t \ - pre ## _ ## reg ## _read(uint32_t base, int i) \ - { \ - return (bus_space_read_4(obio_tag, base, off(i))); \ - } - -#define WIN_REG_IDX_WR(pre,reg,off,base) \ - static __inline void \ - pre ## _ ## reg ## _write(int i, uint32_t val) \ - { \ - bus_space_write_4(obio_tag, base, off(i), val); \ - } - -#define WIN_REG_IDX_WR2(pre,reg,off,base) \ - static __inline void \ - pre ## _ ## reg ## _write(int i, int j, uint32_t val) \ - { \ - bus_space_write_4(obio_tag, base, off(i, j), val); \ - } - -#define WIN_REG_BASE_IDX_WR(pre,reg,off) \ - static __inline void \ - pre ## _ ## reg ## _write(uint32_t base, int i, uint32_t val) \ - { \ - bus_space_write_4(obio_tag, base, off(i), val); \ - } - -#define WIN_REG_RD(pre,reg,off,base) \ - static __inline uint32_t \ - pre ## _ ## reg ## _read(void) \ - { \ - return (bus_space_read_4(obio_tag, base, off)); \ - } - -#define WIN_REG_BASE_RD(pre,reg,off) \ - static __inline uint32_t \ - pre ## _ ## reg ## _read(uint32_t base) \ - { \ - return (bus_space_read_4(obio_tag, base, off)); \ - } - -#define WIN_REG_WR(pre,reg,off,base) \ - static __inline void \ - pre ## _ ## reg ## _write(uint32_t val) \ - { \ - bus_space_write_4(obio_tag, base, off, val); \ - } - -#define WIN_REG_BASE_WR(pre,reg,off) \ - static __inline void \ - pre ## _ ## reg ## _write(uint32_t base, uint32_t val) \ - { \ - bus_space_write_4(obio_tag, base, off, val); \ - } - #endif /* _MVREG_H_ */ Added: head/sys/arm/mv/mvwin.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/mvwin.h Fri Jun 12 20:00:38 2009 (r194072) @@ -0,0 +1,279 @@ +/*- + * Copyright (C) 2007-2008 MARVELL INTERNATIONAL LTD. + * All rights reserved. + * + * Developed by Semihalf. + * + * 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 MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MVWIN_H_ +#define _MVWIN_H_ + +/* + * Physical addresses of integrated SoC peripherals + */ +#define MV_PHYS_BASE 0xF1000000 +#define MV_SIZE 0x100000 + +/* + * Decode windows addresses (physical) + */ +#define MV_PCIE_IO_PHYS_BASE (MV_PHYS_BASE + MV_SIZE) +#define MV_PCIE_IO_BASE MV_PCIE_IO_PHYS_BASE +#define MV_PCIE_IO_SIZE (1024 * 1024) +#define MV_PCI_IO_PHYS_BASE (MV_PCIE_IO_PHYS_BASE + MV_PCIE_IO_SIZE) +#define MV_PCI_IO_BASE MV_PCI_IO_PHYS_BASE +#define MV_PCI_IO_SIZE (1024 * 1024) + +#define MV_PCIE_MEM_PHYS_BASE (MV_PCI_IO_PHYS_BASE + MV_PCI_IO_SIZE) +#define MV_PCIE_MEM_BASE MV_PCIE_MEM_PHYS_BASE +#define MV_PCIE_MEM_SIZE (64 * 1024 * 1024) +#define MV_PCI_MEM_PHYS_BASE (MV_PCIE_MEM_PHYS_BASE + MV_PCIE_MEM_SIZE) +#define MV_PCI_MEM_BASE MV_PCI_MEM_PHYS_BASE +#define MV_PCI_MEM_SIZE (64 * 1024 * 1024) + +/* XXX DEV_BOOT, CSx are board specific, should be defined per platform */ + +/* 512KB NOR FLASH */ +#define MV_DEV_BOOT_PHYS_BASE (MV_PCI_MEM_PHYS_BASE + MV_PCI_MEM_SIZE) +#define MV_DEV_BOOT_SIZE (512 * 1024) +/* CS0: 7-seg LED */ +#define MV_DEV_CS0_PHYS_BASE 0xFA000000 +#define MV_DEV_CS0_SIZE (1024 * 1024) /* XXX u-boot has 2MB */ +/* CS1: 32MB NOR FLASH */ +#define MV_DEV_CS1_PHYS_BASE (MV_DEV_CS0_PHYS_BASE + MV_DEV_CS0_SIZE) +#define MV_DEV_CS1_SIZE (32 * 1024 * 1024) +/* CS2: 32MB NAND FLASH */ +#define MV_DEV_CS2_PHYS_BASE (MV_DEV_CS1_PHYS_BASE + MV_DEV_CS1_SIZE) +#define MV_DEV_CS2_SIZE 1024 /* XXX u-boot has 1MB */ + +#define MV_CESA_SRAM_PHYS_BASE 0xFD000000 +#define MV_CESA_SRAM_BASE MV_CESA_SRAM_PHYS_BASE /* VA == PA mapping */ +#define MV_CESA_SRAM_SIZE (1024 * 1024) + +/* XXX this is probably not robust against wraparounds... */ +#if ((MV_CESA_SRAM_PHYS_BASE + MV_CESA_SRAM_SIZE) > 0xFFFEFFFF) +#error Devices memory layout overlaps reset vectors range! +#endif + +/* + * Integrated SoC peripherals addresses + */ +#define MV_BASE MV_PHYS_BASE /* VA == PA mapping */ +#define MV_DDR_CADR_BASE (MV_BASE + 0x1500) +#define MV_MPP_BASE (MV_BASE + 0x10000) +#define MV_GPIO_BASE (MV_BASE + 0x10100) +#define MV_GPIO_SIZE 0x20 +#define MV_RTC_BASE (MV_BASE + 0x10300) +#define MV_RTC_SIZE 0x08 +#define MV_TWSI_BASE (MV_BASE + 0x11000) +#define MV_TWSI_SIZE 0x20 +#define MV_UART0_BASE (MV_BASE + 0x12000) +#define MV_UART1_BASE (MV_BASE + 0x12100) +#define MV_UART_SIZE 0x20 +#define MV_MBUS_BRIDGE_BASE (MV_BASE + 0x20000) +#define MV_INTREGS_BASE (MV_MBUS_BRIDGE_BASE + 0x80) +#define MV_CPU_CONTROL_BASE (MV_MBUS_BRIDGE_BASE + 0x100) +#define MV_IC_BASE (MV_MBUS_BRIDGE_BASE + 0x200) +#define MV_IC_SIZE 0x3C +#define MV_TIMERS_BASE (MV_MBUS_BRIDGE_BASE + 0x300) +#define MV_TIMERS_SIZE 0x30 +#define MV_PCI_BASE (MV_BASE + 0x30000) +#define MV_PCI_SIZE 0x2000 +#if defined (SOC_MV_KIRKWOOD) +#define MV_CESA_BASE (MV_BASE + 0x30000) /* CESA,PCI don't coexist */ +#elif defined (SOC_MV_ORION) || defined(SOC_MV_DISCOVERY) +#define MV_CESA_BASE (MV_BASE + 0x90000) +#endif +#define MV_CESA_SIZE 0x10000 +#define MV_PCIE_BASE (MV_BASE + 0x40000) +#define MV_PCIE_SIZE 0x2000 + +#define MV_PCIE00_BASE (MV_PCIE_BASE + 0x00000) +#define MV_PCIE01_BASE (MV_PCIE_BASE + 0x04000) +#define MV_PCIE02_BASE (MV_PCIE_BASE + 0x08000) +#define MV_PCIE03_BASE (MV_PCIE_BASE + 0x0C000) +#define MV_PCIE10_BASE (MV_PCIE_BASE + 0x40000) +#define MV_PCIE11_BASE (MV_PCIE_BASE + 0x44000) +#define MV_PCIE12_BASE (MV_PCIE_BASE + 0x48000) +#define MV_PCIE13_BASE (MV_PCIE_BASE + 0x4C000) + +#define MV_USB0_BASE (MV_BASE + 0x50000) +#define MV_USB1_BASE (MV_USB0_BASE + 0x1000) +#define MV_USB2_BASE (MV_USB0_BASE + 0x2000) +#define MV_USB_SIZE 0x1000 +#define MV_USB_AWR_BASE (MV_USB0_BASE + 0x320) +#define MV_IDMA_BASE (MV_BASE + 0x60000) +#define MV_IDMA_SIZE 0x1000 +#define MV_XOR_BASE (MV_BASE + 0x60000) +#define MV_XOR_SIZE 0x1000 +#define MV_ETH0_BASE (MV_BASE + 0x72000) +#define MV_ETH1_BASE (MV_BASE + 0x76000) +#define MV_ETH_SIZE 0x2000 +#if defined(SOC_MV_ORION) || defined(SOC_MV_KIRKWOOD) +#define MV_SATAHC_BASE (MV_BASE + 0x80000) +#define MV_SATAHC_SIZE 0x6000 +#elif defined(SOC_MV_DISCOVERY) +#define MV_SATAHC_BASE (MV_BASE + 0xA0000) +#define MV_SATAHC_SIZE 0x6000 +#endif + +#define MV_DEV_CS0_BASE MV_DEV_CS0_PHYS_BASE + +/* + * Decode windows definitions and macros + */ +#define MV_WIN_CPU_CTRL(n) (0x10 * (n) + (((n) < 8) ? 0x000 : 0x880)) +#define MV_WIN_CPU_BASE(n) (0x10 * (n) + (((n) < 8) ? 0x004 : 0x884)) +#define MV_WIN_CPU_REMAP_LO(n) (0x10 * (n) + (((n) < 8) ? 0x008 : 0x888)) +#define MV_WIN_CPU_REMAP_HI(n) (0x10 * (n) + (((n) < 8) ? 0x00C : 0x88C)) +#if defined(SOC_MV_DISCOVERY) +#define MV_WIN_CPU_MAX 14 +#else +#define MV_WIN_CPU_MAX 8 +#endif + +#define MV_WIN_DDR_BASE(n) (0x8 * (n) + 0x0) +#define MV_WIN_DDR_SIZE(n) (0x8 * (n) + 0x4) +#define MV_WIN_DDR_MAX 4 + +#define MV_WIN_CESA_CTRL(n) (0x8 * (n) + 0xa04) +#define MV_WIN_CESA_BASE(n) (0x8 * (n) + 0xa00) +#define MV_WIN_CESA_MAX 4 + +#define MV_WIN_USB_CTRL(n, m) (0x10 * (n) + (m) * 0x1000 + 0x0) +#define MV_WIN_USB_BASE(n, m) (0x10 * (n) + (m) * 0x1000 + 0x4) +#define MV_WIN_USB_MAX 4 + +#define MV_WIN_ETH_BASE(n) (0x8 * (n) + 0x200) +#define MV_WIN_ETH_SIZE(n) (0x8 * (n) + 0x204) +#define MV_WIN_ETH_REMAP(n) (0x4 * (n) + 0x280) +#define MV_WIN_ETH_MAX 6 + +#define MV_WIN_IDMA_BASE(n) (0x8 * (n) + 0xa00) +#define MV_WIN_IDMA_SIZE(n) (0x8 * (n) + 0xa04) +#define MV_WIN_IDMA_REMAP(n) (0x4 * (n) + 0xa60) +#define MV_WIN_IDMA_CAP(n) (0x4 * (n) + 0xa70) +#define MV_WIN_IDMA_MAX 8 +#define MV_IDMA_CHAN_MAX 4 + +#define MV_WIN_XOR_BASE(n, m) (0x4 * (n) + 0xa50 + (m) * 0x100) +#define MV_WIN_XOR_SIZE(n, m) (0x4 * (n) + 0xa70 + (m) * 0x100) +#define MV_WIN_XOR_REMAP(n, m) (0x4 * (n) + 0xa90 + (m) * 0x100) +#define MV_WIN_XOR_CTRL(n, m) (0x4 * (n) + 0xa40 + (m) * 0x100) +#define MV_WIN_XOR_OVERR(n, m) (0x4 * (n) + 0xaa0 + (m) * 0x100) +#define MV_WIN_XOR_MAX 8 +#define MV_XOR_CHAN_MAX 2 +#define MV_XOR_NON_REMAP 4 + +#define MV_WIN_PCIE_CTRL(n) (0x10 * (((n) < 5) ? (n) : \ + (n) + 1) + 0x1820) +#define MV_WIN_PCIE_BASE(n) (0x10 * (((n) < 5) ? (n) : \ + (n) + 1) + 0x1824) +#define MV_WIN_PCIE_REMAP(n) (0x10 * (((n) < 5) ? (n) : \ + (n) + 1) + 0x182C) +#define MV_WIN_PCIE_MAX 6 + +#define MV_PCIE_BAR(n) (0x04 * (n) + 0x1804) +#define MV_PCIE_BAR_MAX 3 + +#define MV_WIN_SATA_CTRL(n) (0x10 * (n) + 0x30) +#define MV_WIN_SATA_BASE(n) (0x10 * (n) + 0x34) +#define MV_WIN_SATA_MAX 4 + +#define WIN_REG_IDX_RD(pre,reg,off,base) \ + static __inline uint32_t \ + pre ## _ ## reg ## _read(int i) \ + { \ + return (bus_space_read_4(obio_tag, base, off(i))); \ + } + +#define WIN_REG_IDX_RD2(pre,reg,off,base) \ + static __inline uint32_t \ + pre ## _ ## reg ## _read(int i, int j) \ + { \ + return (bus_space_read_4(obio_tag, base, off(i, j))); \ + } \ + +#define WIN_REG_BASE_IDX_RD(pre,reg,off) \ + static __inline uint32_t \ + pre ## _ ## reg ## _read(uint32_t base, int i) \ + { \ + return (bus_space_read_4(obio_tag, base, off(i))); \ + } + +#define WIN_REG_IDX_WR(pre,reg,off,base) \ + static __inline void \ + pre ## _ ## reg ## _write(int i, uint32_t val) \ + { \ + bus_space_write_4(obio_tag, base, off(i), val); \ + } + +#define WIN_REG_IDX_WR2(pre,reg,off,base) \ + static __inline void \ + pre ## _ ## reg ## _write(int i, int j, uint32_t val) \ + { \ + bus_space_write_4(obio_tag, base, off(i, j), val); \ + } + +#define WIN_REG_BASE_IDX_WR(pre,reg,off) \ + static __inline void \ + pre ## _ ## reg ## _write(uint32_t base, int i, uint32_t val) \ + { \ + bus_space_write_4(obio_tag, base, off(i), val); \ + } + +#define WIN_REG_RD(pre,reg,off,base) \ + static __inline uint32_t \ + pre ## _ ## reg ## _read(void) \ + { \ + return (bus_space_read_4(obio_tag, base, off)); \ + } + +#define WIN_REG_BASE_RD(pre,reg,off) \ + static __inline uint32_t \ + pre ## _ ## reg ## _read(uint32_t base) \ + { \ + return (bus_space_read_4(obio_tag, base, off)); \ + } + +#define WIN_REG_WR(pre,reg,off,base) \ + static __inline void \ + pre ## _ ## reg ## _write(uint32_t val) \ + { \ + bus_space_write_4(obio_tag, base, off, val); \ + } + +#define WIN_REG_BASE_WR(pre,reg,off) \ + static __inline void \ + pre ## _ ## reg ## _write(uint32_t base, uint32_t val) \ + { \ + bus_space_write_4(obio_tag, base, off, val); \ + } + +#endif /* _MVWIN_H_ */ Modified: head/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- head/sys/arm/mv/orion/db88f5xxx.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/arm/mv/orion/db88f5xxx.c Fri Jun 12 20:00:38 2009 (r194072) @@ -41,12 +41,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include /* * Virtual address space layout: Modified: head/sys/arm/mv/orion/orion.c ============================================================================== --- head/sys/arm/mv/orion/orion.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/arm/mv/orion/orion.c Fri Jun 12 20:00:38 2009 (r194072) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include extern const struct obio_pci_irq_map pci_irq_map[]; Modified: head/sys/dev/uart/uart_cpu_mv.c ============================================================================== --- head/sys/dev/uart/uart_cpu_mv.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/dev/uart/uart_cpu_mv.c Fri Jun 12 20:00:38 2009 (r194072) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; Modified: head/sys/dev/usb/controller/ehci_mbus.c ============================================================================== --- head/sys/dev/usb/controller/ehci_mbus.c Fri Jun 12 18:13:34 2009 (r194071) +++ head/sys/dev/usb/controller/ehci_mbus.c Fri Jun 12 20:00:38 2009 (r194072) @@ -67,6 +67,9 @@ static int err_intr(void *arg); static struct resource *irq_err; static void *ih_err; +/* EHCI HC regs start at this offset within USB range */ +#define MV_USB_HOST_OFST 0x0100 + #define USB_BRIDGE_INTR_CAUSE 0x210 #define USB_BRIDGE_INTR_MASK 0x214 @@ -152,7 +155,7 @@ ehci_mbus_attach(device_t self) } sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); bsh = rman_get_bushandle(sc->sc_io_res); - sc->sc_io_size = MV_USB_SIZE - MV_USB_HOST_OFST; + sc->sc_io_size = rman_get_size(sc->sc_io_res) - MV_USB_HOST_OFST; /* * Marvell EHCI host controller registers start at certain offset within From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 20:18:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D31A71065670; Fri, 12 Jun 2009 20:18:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1A0F8FC1B; Fri, 12 Jun 2009 20:18:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CKI8Tk091623; Fri, 12 Jun 2009 20:18:08 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CKI8kl091622; Fri, 12 Jun 2009 20:18:08 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906122018.n5CKI8kl091622@svn.freebsd.org> From: Rick Macklem Date: Fri, 12 Jun 2009 20:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194073 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 20:18:09 -0000 Author: rmacklem Date: Fri Jun 12 20:18:08 2009 New Revision: 194073 URL: http://svn.freebsd.org/changeset/base/194073 Log: Add a #include so that it builds when options KGSSAPI is specified in the kernel configuration. Approved by: kib (mentor) Modified: head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Fri Jun 12 20:00:38 2009 (r194072) +++ head/sys/nfsserver/nfs_srvkrpc.c Fri Jun 12 20:18:08 2009 (r194073) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 20:29:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EF401065670; Fri, 12 Jun 2009 20:29:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C59B8FC26; Fri, 12 Jun 2009 20:29:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CKTu2r091992; Fri, 12 Jun 2009 20:29:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CKTu2I091991; Fri, 12 Jun 2009 20:29:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906122029.n5CKTu2I091991@svn.freebsd.org> From: Ed Schouten Date: Fri, 12 Jun 2009 20:29: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: r194074 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 20:29:57 -0000 Author: ed Date: Fri Jun 12 20:29:55 2009 New Revision: 194074 URL: http://svn.freebsd.org/changeset/base/194074 Log: Prevent yet another staircase effect bug in the console device. Even though I thought I fixed the staircase issue (and I was no longer able to reproduce it), I got some reports of the issue still being there. It turns out the staircase effect still occurred when /dev/console was kept open while killing the getty on the same TTY (ttyv0). For some reason I can't figure out how the old TTY code dealt with that, so I assume the issue has always been there. I only exposed it more by merging consolectl with ttyv0, which means that the issue was present, even on systems without a serial console. I'm now marking the console device as being closed when closing the regular TTY device node. This means that when the getty shuts down, init(8) will open /dev/console, which means the termios attributes will always be reset in this case. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Jun 12 20:18:08 2009 (r194073) +++ head/sys/kern/tty.c Fri Jun 12 20:29:55 2009 (r194074) @@ -322,14 +322,14 @@ ttydev_close(struct cdev *dev, int fflag * console. */ MPASS((tp->t_flags & TF_OPENED) != TF_OPENED); - if (dev == dev_console) + if (dev == dev_console) { tp->t_flags &= ~TF_OPENED_CONS; - else - tp->t_flags &= ~(TF_OPENED_IN|TF_OPENED_OUT); - - if (tp->t_flags & TF_OPENED) { - tty_unlock(tp); - return (0); + if (tp->t_flags & TF_OPENED) { + tty_unlock(tp); + return (0); + } + } else { + tp->t_flags &= ~TF_OPENED; } /* From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 20:46:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39A75106566C; Fri, 12 Jun 2009 20:46:37 +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 1E62F8FC1F; Fri, 12 Jun 2009 20:46:37 +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 n5CKkbkw092448; Fri, 12 Jun 2009 20:46:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CKkawj092445; Fri, 12 Jun 2009 20:46:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906122046.n5CKkawj092445@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 12 Jun 2009 20:46: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: r194076 - in head/sys: net netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 20:46:37 -0000 Author: bz Date: Fri Jun 12 20:46:36 2009 New Revision: 194076 URL: http://svn.freebsd.org/changeset/base/194076 Log: Move the kernel option FLOWTABLE chacking from the header file to the actual implementation. Remove the accessor functions for the compiled out case, just returning "unavail" values. Remove the kernel conditional from the header file as it is no longer needed, only leaving the externs. Hide the improperly virtualized SYSCTL/TUNABLE for the flowtable size under the kernel option as well. Reviewed by: rwatson Modified: head/sys/net/flowtable.h head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c Modified: head/sys/net/flowtable.h ============================================================================== --- head/sys/net/flowtable.h Fri Jun 12 20:41:44 2009 (r194075) +++ head/sys/net/flowtable.h Fri Jun 12 20:46:36 2009 (r194076) @@ -41,7 +41,6 @@ struct flowtable; extern struct flowtable *ip_ft; extern struct flowtable *ip_forward_ft; -#ifdef FLOWTABLE struct flowtable *flowtable_alloc(int nentry, int flags); /* @@ -52,22 +51,6 @@ struct flowtable *flowtable_alloc(int ne int flowtable_lookup(struct flowtable *ft, struct mbuf *m, struct route *ro); -#else -static __inline struct flowtable * -flowtable_alloc(int nentry, int flags) -{ - - return (NULL); -} - -static __inline int -flowtable_lookup(struct flowtable *ft, struct mbuf *m, - struct route *ro) -{ - - return (ENOTSUP); -} -#endif #endif #endif Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Jun 12 20:41:44 2009 (r194075) +++ head/sys/netinet/ip_input.c Fri Jun 12 20:46:36 2009 (r194076) @@ -206,16 +206,19 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, m SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW, ipstealth, 0, "IP stealth mode, no TTL decrementation on forwarding"); #endif +#ifdef FLOWTABLE static int ip_output_flowtable_size = 2048; TUNABLE_INT("net.inet.ip.output_flowtable_size", &ip_output_flowtable_size); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, output_flowtable_size, CTLFLAG_RDTUN, ip_output_flowtable_size, 2048, "number of entries in the per-cpu output flow caches"); +struct flowtable *ip_ft; +#endif + #ifdef VIMAGE_GLOBALS int fw_one_pass; #endif -struct flowtable *ip_ft; static void ip_freef(struct ipqhead *, struct ipq *); @@ -374,7 +377,9 @@ ip_init(void) /* Initialize various other remaining things. */ IPQ_LOCK_INIT(); netisr_register(&ip_nh); +#ifdef FLOWTABLE ip_ft = flowtable_alloc(ip_output_flowtable_size, FL_PCPU); +#endif } void Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Jun 12 20:41:44 2009 (r194075) +++ head/sys/netinet/ip_output.c Fri Jun 12 20:46:36 2009 (r194076) @@ -155,6 +155,7 @@ ip_output(struct mbuf *m, struct mbuf *o ro = &iproute; bzero(ro, sizeof (*ro)); +#ifdef FLOWTABLE /* * The flow table returns route entries valid for up to 30 * seconds; we rely on the remainder of ip_output() taking no @@ -163,6 +164,7 @@ ip_output(struct mbuf *m, struct mbuf *o */ if (flowtable_lookup(ip_ft, m, ro) == 0) nortfree = 1; +#endif } if (opt) { From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 20:50:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F217106564A; Fri, 12 Jun 2009 20:50:28 +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 6D9478FC13; Fri, 12 Jun 2009 20:50:28 +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 n5CKoSuQ092568; Fri, 12 Jun 2009 20:50:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CKoS14092567; Fri, 12 Jun 2009 20:50:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906122050.n5CKoS14092567@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 12 Jun 2009 20:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194077 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 20:50:29 -0000 Author: bz Date: Fri Jun 12 20:50:28 2009 New Revision: 194077 URL: http://svn.freebsd.org/changeset/base/194077 Log: Garbage collect an extern for a non-existent variable. While here let the comment end in a '.' and mark the #endif of _KERNEL. Reviewed by: rwatson (as part of a larger patch) Modified: head/sys/net/flowtable.h Modified: head/sys/net/flowtable.h ============================================================================== --- head/sys/net/flowtable.h Fri Jun 12 20:46:36 2009 (r194076) +++ head/sys/net/flowtable.h Fri Jun 12 20:50:28 2009 (r194077) @@ -39,18 +39,16 @@ $FreeBSD$ struct flowtable; extern struct flowtable *ip_ft; -extern struct flowtable *ip_forward_ft; struct flowtable *flowtable_alloc(int nentry, int flags); /* * Given a flow table, look up the L3 and L2 information and - * return it in the route + * return it in the route. * */ int flowtable_lookup(struct flowtable *ft, struct mbuf *m, struct route *ro); -#endif - +#endif /* _KERNEL */ #endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 21:19:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BE83106566B; Fri, 12 Jun 2009 21:19:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A3FD8FC08; Fri, 12 Jun 2009 21:19:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CLJvvO093222; Fri, 12 Jun 2009 21:19:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CLJvDt093221; Fri, 12 Jun 2009 21:19:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906122119.n5CLJvDt093221@svn.freebsd.org> From: John Baldwin Date: Fri, 12 Jun 2009 21:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194078 - head/sys/fs/cd9660 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 21:19:57 -0000 Author: jhb Date: Fri Jun 12 21:19:57 2009 New Revision: 194078 URL: http://svn.freebsd.org/changeset/base/194078 Log: Update the inline version of vn_get_ino() for ".." lookups to match the recentish changes to vn_get_ino(). MFC after: 1 week Modified: head/sys/fs/cd9660/cd9660_lookup.c Modified: head/sys/fs/cd9660/cd9660_lookup.c ============================================================================== --- head/sys/fs/cd9660/cd9660_lookup.c Fri Jun 12 20:50:28 2009 (r194077) +++ head/sys/fs/cd9660/cd9660_lookup.c Fri Jun 12 21:19:57 2009 (r194078) @@ -374,15 +374,17 @@ found: */ mp = pdp->v_mount; ltype = VOP_ISLOCKED(pdp); - for (;;) { - error = vfs_busy(mp, MBF_NOWAIT); - if (error == 0) - break; + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { VOP_UNLOCK(pdp, 0); - pause("vn_vget", 1); + error = vfs_busy(mp, 0); vn_lock(pdp, ltype | LK_RETRY); - if (pdp->v_iflag & VI_DOOMED) + if (error) + return (ENOENT); + if (pdp->v_iflag & VI_DOOMED) { + vfs_unbusy(mp); return (ENOENT); + } } VOP_UNLOCK(pdp, 0); error = cd9660_vget_internal(vdp->v_mount, i_ino, From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 21:21:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA556106566B; Fri, 12 Jun 2009 21:21:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D91418FC08; Fri, 12 Jun 2009 21:21:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CLLHYw093294; Fri, 12 Jun 2009 21:21:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CLLHJd093293; Fri, 12 Jun 2009 21:21:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906122121.n5CLLHJd093293@svn.freebsd.org> From: Ed Schouten Date: Fri, 12 Jun 2009 21:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194079 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 21:21:18 -0000 Author: ed Date: Fri Jun 12 21:21:17 2009 New Revision: 194079 URL: http://svn.freebsd.org/changeset/base/194079 Log: Revert my previous change, because it reintroduces an old regression. Because our rc scripts also open the /etc/ttyv* nodes, it revokes the console, preventing startup messages from being displayed. I really have to think about this. Maybe we should just give the console its own TTY and let it build on top of other TTYs. I'm still not sure what to do with input handling there. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Jun 12 21:19:57 2009 (r194078) +++ head/sys/kern/tty.c Fri Jun 12 21:21:17 2009 (r194079) @@ -322,14 +322,14 @@ ttydev_close(struct cdev *dev, int fflag * console. */ MPASS((tp->t_flags & TF_OPENED) != TF_OPENED); - if (dev == dev_console) { + if (dev == dev_console) tp->t_flags &= ~TF_OPENED_CONS; - if (tp->t_flags & TF_OPENED) { - tty_unlock(tp); - return (0); - } - } else { - tp->t_flags &= ~TF_OPENED; + else + tp->t_flags &= ~(TF_OPENED_IN|TF_OPENED_OUT); + + if (tp->t_flags & TF_OPENED) { + tty_unlock(tp); + return (0); } /* From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 22:49:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20566106566B; Fri, 12 Jun 2009 22:49:36 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7D3C8FC14; Fri, 12 Jun 2009 22:49:35 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CMnZRN095303; Fri, 12 Jun 2009 22:49:35 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CMnZBm095301; Fri, 12 Jun 2009 22:49:35 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <200906122249.n5CMnZBm095301@svn.freebsd.org> From: Juli Mallett Date: Fri, 12 Jun 2009 22:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194082 - in head/sys/mips: malta mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 22:49:36 -0000 Author: jmallett Date: Fri Jun 12 22:49:35 2009 New Revision: 194082 URL: http://svn.freebsd.org/changeset/base/194082 Log: Fix MALTA build; some prototypes were wrong and blew up when kobj method signature checking was turned on. Modified: head/sys/mips/malta/gt_pci.c head/sys/mips/mips/mainbus.c Modified: head/sys/mips/malta/gt_pci.c ============================================================================== --- head/sys/mips/malta/gt_pci.c Fri Jun 12 22:48:10 2009 (r194081) +++ head/sys/mips/malta/gt_pci.c Fri Jun 12 22:49:35 2009 (r194082) @@ -370,7 +370,7 @@ gt_pci_conf_setup(struct gt_pci_softc *s } static uint32_t -gt_pci_read_config(device_t dev, int bus, int slot, int func, int reg, +gt_pci_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int bytes) { struct gt_pci_softc *sc = device_get_softc(dev); @@ -440,7 +440,7 @@ gt_pci_read_config(device_t dev, int bus } static void -gt_pci_write_config(device_t dev, int bus, int slot, int func, int reg, +gt_pci_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, uint32_t data, int bytes) { struct gt_pci_softc *sc = device_get_softc(dev); Modified: head/sys/mips/mips/mainbus.c ============================================================================== --- head/sys/mips/mips/mainbus.c Fri Jun 12 22:48:10 2009 (r194081) +++ head/sys/mips/mips/mainbus.c Fri Jun 12 22:49:35 2009 (r194082) @@ -76,7 +76,7 @@ static int mainbus_deactivate_resource(d static int mainbus_release_resource(device_t, device_t, int, int, struct resource *); static int mainbus_setup_intr(device_t, device_t, struct resource *, - int flags, int (*)(void *), void *, void **); + int flags, driver_filter_t, void (*)(void *), void *, void **); static int mainbus_teardown_intr(device_t, device_t, struct resource *, void *); @@ -319,7 +319,8 @@ mainbus_release_resource(device_t bus, d */ static int mainbus_setup_intr(device_t bus, device_t child, struct resource *irq, - int flags, int (*ihand)(void *), void *arg, void **cookiep) + int flags, driver_filter_t filter, void (*ihand)(void *), void *arg, + void **cookiep) { panic("can never mainbus_setup_intr"); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 22:53:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CDAE106566B; Fri, 12 Jun 2009 22:53:50 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 098A88FC0C; Fri, 12 Jun 2009 22:53:50 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CMrnUI095453; Fri, 12 Jun 2009 22:53:49 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CMrnJY095448; Fri, 12 Jun 2009 22:53:49 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906122253.n5CMrnJY095448@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 12 Jun 2009 22:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194084 - head/share/syscons/keymaps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 22:53:50 -0000 Author: edwin Date: Fri Jun 12 22:53:49 2009 New Revision: 194084 URL: http://svn.freebsd.org/changeset/base/194084 Log: Add various new keymaps: addition: danish syscons keymap with accents There are two danish keymap files shipping with FreeBSD: danish.iso.kbd and danish.cp865.kbd. None of these support accents by use of dead keys, which isn't crucial to Danes but often used. This is a new keymap, danish.iso.acc.kbd, that's based on danish.iso.kbd with the accent part taken from german.iso.acc.kbd. pl_PL.dvorak keymap for syscons. Polish dvorak keymap by Robert Sebastian Gerus (17:05 01-07-2006 CEST) . Based on pl_PL.ISO-8859-2 and us.dvorak keymaps. British English Dvorak keymap for syscons. Attached is a Dvorak keymap for British English, with a pound-sterling symbol on on Shift-3 and some other characters in different places to the US Dvorak keymap. I've based the layout on the X.org GB keymap, Dvorak variant. PR: conf/72978, kern/99692, conf/117257 Submitted by: Kim Norgaard , Robert Sebastian Gerus , "Benjamin A'Lee" MFC after: 1 week Added: head/share/syscons/keymaps/danish.iso.acc.kbd (contents, props changed) head/share/syscons/keymaps/pl_PL.dvorak.kbd (contents, props changed) head/share/syscons/keymaps/uk.dvorak.kbd (contents, props changed) Modified: head/share/syscons/keymaps/INDEX.keymaps head/share/syscons/keymaps/Makefile Modified: head/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- head/share/syscons/keymaps/INDEX.keymaps Fri Jun 12 22:52:19 2009 (r194083) +++ head/share/syscons/keymaps/INDEX.keymaps Fri Jun 12 22:53:49 2009 (r194084) @@ -103,6 +103,13 @@ danish.iso.kbd:fr:Danois ISO-8859-1 danish.iso.kbd:pt:Dinamarquês ISO-8859-1 danish.iso.kbd:es:Danés ISO-8859-1 +danish.iso.acc.kbd:en:Danish ISO-8859-1 (accent keys) +danish.iso.acc.kbd:da:Dansk ISO-8859-1 (accent taster) +danish.iso.acc.kbd:de:Dänisch ISO-8859-1 (mit Akzenten) +danish.iso.acc.kbd:fr:Danois ISO-8859-1 (avec accents) +danish.iso.acc.kbd:pt:Dinamarquês ISO-8859-1 (com acentos) +danish.iso.acc.kbd:es:Danés ISO-8859-1 (con acentos) + danish.cp865.kbd:en:Danish Codepage 865 danish.cp865.kbd:da:Dansk Code page 865 danish.cp865.kbd:de:Dänisch Codeseite 865 @@ -313,6 +320,13 @@ pl_PL.ISO8859-2.kbd:pl:Polska ISO-8859-2 pl_PL.ISO8859-2.kbd:pt:Polonês ISO-8859-2 (para programadores) pl_PL.ISO8859-2.kbd:es:Polaco ISO-8859-2 (para programadores) +pl_PL.dvorak.kbd:en:Polish Dvorak +pl_PL.dvorak.kbd:de:Polnisch Dvorak +pl_PL.dvorak.kbd:fr:Polonais Dvorak +pl_PL.dvorak.kbd:pl:Polska Dvorak +pl_PL.dvorak.kbd:pt:Polonês Dvorak +pl_PL.dvorak.kbd:es:Polaco Dvorak + pt.iso.kbd:en:Portuguese ISO-8859-1 pt.iso.kbd:de:Portugisisch ISO-8859-1 pt.iso.kbd:fr:Portugais ISO-8859-1 @@ -442,6 +456,12 @@ uk.cp850.kbd:fr:Royaume Uni Code page 85 uk.cp850.kbd:pt:Reino Unido Codepage 850 uk.cp850.kbd:es:Británico Codepage 850 +uk.dvorak.kbd:en:United Kingdom Dvorak +uk.dvorak.kbd:de:Vereinigtes K\xf6nigreich Dvorak +uk.dvorak.kbd:fr:Royaume Uni Dvorak +uk.dvorak.kbd:pt:Reino Unido Dvorak +uk.dvorak.kbd:es:Británico Dvorak + us.iso.kbd:en:United States of America ISO-8859-1 us.iso.kbd:de:US-amerikanisch ISO-8859-1 us.iso.kbd:fr:États Unis d'Amérique ISO-8859-1 Modified: head/share/syscons/keymaps/Makefile ============================================================================== --- head/share/syscons/keymaps/Makefile Fri Jun 12 22:52:19 2009 (r194083) +++ head/share/syscons/keymaps/Makefile Fri Jun 12 22:53:49 2009 (r194084) @@ -9,7 +9,8 @@ FILES= INDEX.keymaps \ colemak.iso15.acc.kbd \ cs.latin2.qwertz.kbd \ cz.iso2.kbd \ - danish.iso.kbd danish.cp865.kbd dutch.iso.acc.kbd \ + danish.iso.kbd danish.iso.acc.kbd danish.cp865.kbd \ + dutch.iso.acc.kbd \ el.iso07.kbd \ estonian.iso.kbd estonian.iso15.kbd estonian.cp850.kbd \ finnish.iso.kbd finnish.cp850.kbd \ @@ -29,7 +30,7 @@ FILES= INDEX.keymaps \ latinamerican.kbd latinamerican.iso.acc.kbd \ lt.iso4.kbd \ norwegian.iso.kbd norwegian.dvorak.kbd \ - pl_PL.ISO8859-2.kbd \ + pl_PL.ISO8859-2.kbd pl_PL.dvorak.kbd \ pt.iso.kbd pt.iso.acc.kbd \ ru.koi8-r.kbd ru.koi8-r.shift.kbd ru.koi8-r.win.kbd \ ru.cp866.kbd ru.iso5.kbd \ @@ -42,6 +43,7 @@ FILES= INDEX.keymaps \ tr.iso9.q.kbd \ ua.koi8-u.kbd ua.koi8-u.shift.alt.kbd ua.iso5.kbd \ uk.iso.kbd uk.iso-ctrl.kbd uk.cp850.kbd uk.cp850-ctrl.kbd \ + uk.dvorak.kbd \ us.iso.kbd us.dvorak.kbd us.dvorakx.kbd us.emacs.kbd us.pc-ctrl.kbd \ us.unix.kbd us.iso.acc.kbd Added: head/share/syscons/keymaps/danish.iso.acc.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/syscons/keymaps/danish.iso.acc.kbd Fri Jun 12 22:53:49 2009 (r194084) @@ -0,0 +1,164 @@ +# Copyright (c) 2004 +# Kim Norgaard , Denmark. +# 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 as +# the first lines of this file unmodified. +# 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 KIM NOORGAARD ``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 KIM NOORGAARD 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$ + +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop 161 185 nop nop O + 003 '2' '"' nul nul '@' 178 nul nul O + 004 '3' '#' nop nop 158 179 nop nop O + 005 '4' 164 nop nop '$' 164 nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '&' nop nop '6' '&' nop nop O + 008 '7' '/' nop nop '{' '/' nop nop O + 009 '8' '(' esc esc '[' '8' esc esc O + 010 '9' ')' gs gs ']' ')' gs gs O + 011 '0' '=' nop nop '}' '=' nop nop O + 012 '+' '?' nop nop '+' 191 nop nop O + 013 dacu dgra nop nop '|' '`' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 229 197 nop nop 134 143 nop nop C + 027 duml dcir rs rs dtil '^' rs rs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 223 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 230 198 nop nop 145 146 nop nop C + 040 248 216 nop nop 155 157 nop nop C + 041 189 167 nop nop 189 167 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 ''' '*' nop nop ''' '*' nop nop O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' ';' nop nop ',' ';' nop nop O + 052 '.' ':' nop nop '.' ':' nop nop O + 053 '-' '_' us us '-' '_' us us O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' fs fs '\' '>' fs fs O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + duml '"' ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + ( 'u' 251 ) ( 'U' 219 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 ) + ( 'o' 245 ) ( 'O' 213 ) + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + ( 'u' 249 ) ( 'U' 217 ) + dacu ''' ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 ) + drin 176 ( 'a' 229 ) ( 'A' 197 ) + dced 184 ( 'c' 231 ) ( 'C' 199 ) + dmac 000 + dbre 000 + ddot 000 + dsla 000 + dapo 000 + ddac 000 + dogo 000 + dcar 000 Added: head/share/syscons/keymaps/pl_PL.dvorak.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/syscons/keymaps/pl_PL.dvorak.kbd Fri Jun 12 22:53:49 2009 (r194084) @@ -0,0 +1,118 @@ +# $FreeBSD$ +# +# Polish dvorak keymap by Robert Sebastian Gerus (17:05 01-07-2006 CEST) +# (arachnist@gmail.com) +# Based on pl_PL.ISO-8859-2 and us.dvorak keymaps. +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul '2' '@' nul nul O + 004 '3' '#' nop nop '3' '#' nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '[' '{' esc esc '[' '{' esc esc O + 013 ']' '}' gs gs ']' '}' gs gs O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 ''' '"' nop nop ''' '"' nop nop O + 017 ',' '<' nop nop ',' '<' nop nop O + 018 '.' '>' nop nop '.' '>' nop nop O + 019 'p' 'P' dle dle 'p' 'P' dle dle C + 020 'y' 'Y' em em 'y' 'Y' em em C + 021 'f' 'F' ack ack 'f' 'F' ack ack C + 022 'g' 'G' bel bel 'g' 'G' bel bel C + 023 'c' 'C' etx etx 230 198 etx etx C + 024 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 025 'l' 'L' ff ff 179 163 ff ff C + 026 '/' '?' nop nop '/' '?' nop nop O + 027 '=' '+' nop nop '=' '+' nop nop O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 177 161 soh soh C + 031 'o' 'O' si si 243 211 si si C + 032 'e' 'E' enq enq 234 202 enq enq C + 033 'u' 'U' nak nak 'u' 'U' nak nak C + 034 'i' 'I' ht ht 'i' 'I' ht ht C + 035 'd' 'D' eot eot 'd' 'D' eot eot C + 036 'h' 'H' bs bs 'h' 'H' bs bs C + 037 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 038 'n' 'N' so so 241 209 so so C + 039 's' 'S' dc3 dc3 182 166 dc3 dc3 C + 040 '-' '_' us us '-' '_' us us O + 041 '`' '~' nop nop '`' '~' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 ';' ':' nop nop ';' ':' nop nop O + 045 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 046 'j' 'J' nl nl 'j' 'J' nl nl C + 047 'k' 'K' vt vt 'k' 'K' vt vt C + 048 'x' 'X' can can 'x' 'X' can can C + 049 'b' 'B' stx stx 'b' 'B' stx stx C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 'w' 'W' etb etb 'w' 'W' etb etb C + 052 'v' 'V' syn syn 188 172 syn syn C + 053 'z' 'Z' sub sub 191 175 sub sub C + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 nop nop nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr cr cr cr cr cr cr O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + Added: head/share/syscons/keymaps/uk.dvorak.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/syscons/keymaps/uk.dvorak.kbd Fri Jun 12 22:53:49 2009 (r194084) @@ -0,0 +1,121 @@ +# $FreeBSD$ +# +# A Dvorak keyboard for UK English +# +# Based on us.dvorak.kbd and uk.iso.kbd, and on the X.org GB layout, Dvorak +# variant. +# +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '"' nul nul '2' '"' nul nul O + 004 '3' 163 nop nop '3' 163 nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '[' '{' esc esc '[' '{' esc esc O + 013 ']' '}' gs gs ']' '}' gs gs O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 ''' '@' nop nop ''' '@' nop nop O + 017 ',' '<' nop nop ',' '<' nop nop O + 018 '.' '>' nop nop '.' '>' nop nop O + 019 'p' 'P' dle dle 'p' 'P' dle dle C + 020 'y' 'Y' em em 'y' 'Y' em em C + 021 'f' 'F' ack ack 'f' 'F' ack ack C + 022 'g' 'G' bel bel 'g' 'G' bel bel C + 023 'c' 'C' etx etx 'c' 'C' etx etx C + 024 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 025 'l' 'L' ff ff 'l' 'L' ff ff C + 026 '/' '?' nop nop '/' '?' nop nop O + 027 '=' '+' nop nop '=' '+' nop nop O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 'o' 'O' si si 'o' 'O' si si C + 032 'e' 'E' enq enq 'e' 'E' enq enq C + 033 'u' 'U' nak nak 'u' 'U' nak nak C + 034 'i' 'I' ht ht 'i' 'I' ht ht C + 035 'd' 'D' eot eot 'd' 'D' eot eot C + 036 'h' 'H' bs bs 'h' 'H' bs bs C + 037 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 038 'n' 'N' so so 'n' 'N' so so C + 039 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 040 '-' '_' us us '-' '_' us us O + 041 '`' '~' nop nop '`' 172 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '#' '~' fs fs '#' '~' fs fs O + 044 ';' ':' nop nop ';' ':' nop nop O + 045 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 046 'j' 'J' nl nl 'j' 'J' nl nl C + 047 'k' 'K' vt vt 'k' 'K' vt vt C + 048 'x' 'X' can can 'x' 'X' can can C + 049 'b' 'B' stx stx 'b' 'B' stx stx C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 'w' 'W' etb etb 'w' 'W' etb etb C + 052 'v' 'V' syn syn 'v' 'V' syn syn C + 053 'z' 'Z' sub sub 'z' 'Z' sub sub C + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '\' '|' fs fs '\' '|' fs fs O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 23:15:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79412106566B; Fri, 12 Jun 2009 23:15:36 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 677508FC0A; Fri, 12 Jun 2009 23:15:36 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CNFaqn095983; Fri, 12 Jun 2009 23:15:36 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CNFaCI095981; Fri, 12 Jun 2009 23:15:36 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906122315.n5CNFaCI095981@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 12 Jun 2009 23:15: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: r194085 - head/share/mklocale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 23:15:36 -0000 Author: edwin Date: Fri Jun 12 23:15:36 2009 New Revision: 194085 URL: http://svn.freebsd.org/changeset/base/194085 Log: Fix printing of some wide-characters by iswprint() on ja_JP.eucJP and ja_JP.SJIS locale The iswprint() function does not return non-zero if used for some wide-character that it code was 0x824f-0x8258 on ja_JP.SJIS and 0xa3b0-0xa3b9 on ja_JP.eucJP locale. But those are right Japanese wide-character code. PR: conf/124511 Submitted by: Michihiro NAKAJIMA MFC after: 1 week Modified: head/share/mklocale/ja_JP.SJIS.src head/share/mklocale/ja_JP.eucJP.src Modified: head/share/mklocale/ja_JP.SJIS.src ============================================================================== --- head/share/mklocale/ja_JP.SJIS.src Fri Jun 12 22:53:49 2009 (r194084) +++ head/share/mklocale/ja_JP.SJIS.src Fri Jun 12 23:15:36 2009 (r194085) @@ -80,7 +80,7 @@ PUNCT 0x819f-0x81ac 0x81b8-0x81bf 0x81c PUNCT 0x81f0-0x81f7 0x81fc /* 300 */ -/* ?DIGIT 0x824f-0x8258 */ +PRINT 0x824f-0x8258 */ /* ?XDIGIT 0x8260-0x8265 0x8281-0x8286 */ ALPHA 0x8260-0x8279 0x8281-0x829a UPPER 0x8260-0x8279 Modified: head/share/mklocale/ja_JP.eucJP.src ============================================================================== --- head/share/mklocale/ja_JP.eucJP.src Fri Jun 12 22:53:49 2009 (r194084) +++ head/share/mklocale/ja_JP.eucJP.src Fri Jun 12 23:15:36 2009 (r194085) @@ -54,7 +54,7 @@ SPECIAL 0xa2f2 - 0xa2f9 0xa2fe SWIDTH2 0xa2a1 - 0xa2ae 0xa2ba - 0xa2c1 0xa2ca - 0xa2d0 0xa2dc - 0xa2ea SWIDTH2 0xa2f2 - 0xa2f9 0xa2fe -/* ?DIGIT 0xa3b0 - 0xa3b9 */ +PRINT 0xa3b0 - 0xa3b9 UPPER 0xa3c1 - 0xa3da /* Romaji */ LOWER 0xa3e1 - 0xa3fa /* Romaji */ SWIDTH2 0xa3b0 - 0xa3b9 /* Zenkaku Digit */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 23:27:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72EAC106564A; Fri, 12 Jun 2009 23:27:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 610D58FC19; Fri, 12 Jun 2009 23:27:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CNRV7J096224; Fri, 12 Jun 2009 23:27:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CNRVTQ096223; Fri, 12 Jun 2009 23:27:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906122327.n5CNRVTQ096223@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 12 Jun 2009 23:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194086 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 23:27:31 -0000 Author: des Date: Fri Jun 12 23:27:31 2009 New Revision: 194086 URL: http://svn.freebsd.org/changeset/base/194086 Log: _nss_cache_cycle_prevention_function doesn't actually need to be a function, it just needs to have external linkage. MFC after: 1 week Modified: head/usr.sbin/nscd/nscd.c Modified: head/usr.sbin/nscd/nscd.c ============================================================================== --- head/usr.sbin/nscd/nscd.c Fri Jun 12 23:15:36 2009 (r194085) +++ head/usr.sbin/nscd/nscd.c Fri Jun 12 23:27:31 2009 (r194086) @@ -573,17 +573,17 @@ get_time_func(struct timeval *time) } /* - * The idea of _nss_cache_cycle_prevention_function is that nsdispatch will - * search for this symbol in the executable. This symbol is the attribute of - * the caching daemon. So, if it exists, nsdispatch won't try to connect to - * the caching daemon and will just ignore the 'cache' source in the - * nsswitch.conf. This method helps to avoid cycles and organize - * self-performing requests. + * The idea of _nss_cache_cycle_prevention_function is that nsdispatch + * will search for this symbol in the executable. This symbol is the + * attribute of the caching daemon. So, if it exists, nsdispatch won't try + * to connect to the caching daemon and will just ignore the 'cache' + * source in the nsswitch.conf. This method helps to avoid cycles and + * organize self-performing requests. + * + * (not actually a function; it used to be, but it doesn't make any + * difference, as long as it has external linkage) */ -void -_nss_cache_cycle_prevention_function(void) -{ -} +void *_nss_cache_cycle_prevention_function; int main(int argc, char *argv[]) From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 23:39:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73642106566C; Fri, 12 Jun 2009 23:39:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 603688FC0A; Fri, 12 Jun 2009 23:39:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CNd6qE096487; Fri, 12 Jun 2009 23:39:06 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CNd5AI096475; Fri, 12 Jun 2009 23:39:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906122339.n5CNd5AI096475@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 12 Jun 2009 23:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194087 - in head/usr.sbin/nscd: . agents X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 23:39:06 -0000 Author: des Date: Fri Jun 12 23:39:05 2009 New Revision: 194087 URL: http://svn.freebsd.org/changeset/base/194087 Log: Provide correct prototypes for functions with no arguments. MFC after: 1 week Modified: head/usr.sbin/nscd/agent.c head/usr.sbin/nscd/agent.h head/usr.sbin/nscd/agents/group.c head/usr.sbin/nscd/agents/group.h head/usr.sbin/nscd/agents/passwd.c head/usr.sbin/nscd/agents/passwd.h head/usr.sbin/nscd/agents/services.c head/usr.sbin/nscd/agents/services.h head/usr.sbin/nscd/cacheplcs.c head/usr.sbin/nscd/cacheplcs.h head/usr.sbin/nscd/debug.c head/usr.sbin/nscd/debug.h Modified: head/usr.sbin/nscd/agent.c ============================================================================== --- head/usr.sbin/nscd/agent.c Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/agent.c Fri Jun 12 23:39:05 2009 (r194087) @@ -55,7 +55,7 @@ agent_cmp_func(const void *a1, const voi } struct agent_table * -init_agent_table() +init_agent_table(void) { struct agent_table *retval; Modified: head/usr.sbin/nscd/agent.h ============================================================================== --- head/usr.sbin/nscd/agent.h Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/agent.h Fri Jun 12 23:39:05 2009 (r194087) @@ -53,7 +53,7 @@ struct common_agent { struct multipart_agent { struct agent parent; - void *(*mp_init_func)(); + void *(*mp_init_func)(void); int (*mp_lookup_func)(char **, size_t *, void *); void (*mp_destroy_func)(void *); }; @@ -63,7 +63,7 @@ struct agent_table { size_t agents_num; }; -extern struct agent_table *init_agent_table(); +extern struct agent_table *init_agent_table(void); extern void register_agent(struct agent_table *, struct agent *); extern struct agent *find_agent(struct agent_table *, const char *, enum agent_type); Modified: head/usr.sbin/nscd/agents/group.c ============================================================================== --- head/usr.sbin/nscd/agents/group.c Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/agents/group.c Fri Jun 12 23:39:05 2009 (r194087) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); static int group_marshal_func(struct group *, char *, size_t *); static int group_lookup_func(const char *, size_t, char **, size_t *); -static void *group_mp_init_func(); +static void *group_mp_init_func(void); static int group_mp_lookup_func(char **, size_t *, void *); static void group_mp_destroy_func(void *); @@ -184,7 +184,7 @@ group_lookup_func(const char *key, size_ } static void * -group_mp_init_func() +group_mp_init_func(void) { TRACE_IN(group_mp_init_func); setgrent(); @@ -219,7 +219,7 @@ group_mp_destroy_func(void *mdata) } struct agent * -init_group_agent() +init_group_agent(void) { struct common_agent *retval; @@ -238,7 +238,7 @@ init_group_agent() } struct agent * -init_group_mp_agent() +init_group_mp_agent(void) { struct multipart_agent *retval; Modified: head/usr.sbin/nscd/agents/group.h ============================================================================== --- head/usr.sbin/nscd/agents/group.h Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/agents/group.h Fri Jun 12 23:39:05 2009 (r194087) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_group_agent(); -extern struct agent *init_group_mp_agent(); +extern struct agent *init_group_agent(void); +extern struct agent *init_group_mp_agent(void); Modified: head/usr.sbin/nscd/agents/passwd.c ============================================================================== --- head/usr.sbin/nscd/agents/passwd.c Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/agents/passwd.c Fri Jun 12 23:39:05 2009 (r194087) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); static int passwd_marshal_func(struct passwd *, char *, size_t *); static int passwd_lookup_func(const char *, size_t, char **, size_t *); -static void *passwd_mp_init_func(); +static void *passwd_mp_init_func(void); static int passwd_mp_lookup_func(char **, size_t *, void *); static void passwd_mp_destroy_func(void *mdata); @@ -191,7 +191,7 @@ passwd_lookup_func(const char *key, size } static void * -passwd_mp_init_func() +passwd_mp_init_func(void) { TRACE_IN(passwd_mp_init_func); setpwent(); @@ -226,7 +226,7 @@ passwd_mp_destroy_func(void *mdata) } struct agent * -init_passwd_agent() +init_passwd_agent(void) { struct common_agent *retval; @@ -245,7 +245,7 @@ init_passwd_agent() } struct agent * -init_passwd_mp_agent() +init_passwd_mp_agent(void) { struct multipart_agent *retval; Modified: head/usr.sbin/nscd/agents/passwd.h ============================================================================== --- head/usr.sbin/nscd/agents/passwd.h Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/agents/passwd.h Fri Jun 12 23:39:05 2009 (r194087) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_passwd_agent(); -extern struct agent *init_passwd_mp_agent(); +extern struct agent *init_passwd_agent(void); +extern struct agent *init_passwd_mp_agent(void); Modified: head/usr.sbin/nscd/agents/services.c ============================================================================== --- head/usr.sbin/nscd/agents/services.c Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/agents/services.c Fri Jun 12 23:39:05 2009 (r194087) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); static int services_marshal_func(struct servent *, char *, size_t *); static int services_lookup_func(const char *, size_t, char **, size_t *); -static void *services_mp_init_func(); +static void *services_mp_init_func(void); static int services_mp_lookup_func(char **, size_t *, void *); static void services_mp_destroy_func(void *); @@ -205,7 +205,7 @@ services_lookup_func(const char *key, si } static void * -services_mp_init_func() +services_mp_init_func(void) { TRACE_IN(services_mp_init_func); setservent(0); @@ -240,7 +240,7 @@ services_mp_destroy_func(void *mdata) } struct agent * -init_services_agent() +init_services_agent(void) { struct common_agent *retval; TRACE_IN(init_services_agent); @@ -259,7 +259,7 @@ init_services_agent() } struct agent * -init_services_mp_agent() +init_services_mp_agent(void) { struct multipart_agent *retval; Modified: head/usr.sbin/nscd/agents/services.h ============================================================================== --- head/usr.sbin/nscd/agents/services.h Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/agents/services.h Fri Jun 12 23:39:05 2009 (r194087) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_services_agent(); -extern struct agent *init_services_mp_agent(); +extern struct agent *init_services_agent(void); +extern struct agent *init_services_mp_agent(void); Modified: head/usr.sbin/nscd/cacheplcs.c ============================================================================== --- head/usr.sbin/nscd/cacheplcs.c Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/cacheplcs.c Fri Jun 12 23:39:05 2009 (r194087) @@ -55,7 +55,7 @@ static void cache_lru_policy_update_item struct cache_policy_item_ *); static void cache_queue_policy_add_item(struct cache_policy_ *, struct cache_policy_item_ *); -static struct cache_policy_item_ * cache_queue_policy_create_item(); +static struct cache_policy_item_ * cache_queue_policy_create_item(void); static void cache_queue_policy_destroy_item(struct cache_policy_item_ *); static struct cache_policy_item_ *cache_queue_policy_get_first_item( struct cache_policy_ *); @@ -77,7 +77,7 @@ static struct cache_queue_policy_ *init_ * cache_queue_policy_ with cache_update_item function changed. */ static struct cache_policy_item_ * -cache_queue_policy_create_item() +cache_queue_policy_create_item(void) { struct cache_queue_policy_item_ *retval; @@ -248,7 +248,7 @@ cache_fifo_policy_update_item(struct cac } struct cache_policy_ * -init_cache_fifo_policy() +init_cache_fifo_policy(void) { struct cache_queue_policy_ *retval; @@ -293,7 +293,7 @@ cache_lru_policy_update_item(struct cach } struct cache_policy_ * -init_cache_lru_policy() +init_cache_lru_policy(void) { struct cache_queue_policy_ *retval; @@ -530,7 +530,7 @@ cache_lfu_policy_get_prev_item(struct ca * functions pointers */ struct cache_policy_ * -init_cache_lfu_policy() +init_cache_lfu_policy(void) { int i; struct cache_lfu_policy_ *retval; Modified: head/usr.sbin/nscd/cacheplcs.h ============================================================================== --- head/usr.sbin/nscd/cacheplcs.h Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/cacheplcs.h Fri Jun 12 23:39:05 2009 (r194087) @@ -59,7 +59,7 @@ struct cache_policy_item_ */ struct cache_policy_ { - struct cache_policy_item_* (*create_item_func)(); + struct cache_policy_item_* (*create_item_func)(void); void (*destroy_item_func)(struct cache_policy_item_ *); void (*add_item_func)(struct cache_policy_ *, @@ -123,15 +123,15 @@ typedef struct cache_queue_policy_ cache typedef struct cache_queue_policy_ cache_lru_policy_; /* fifo policy routines */ -extern struct cache_policy_ *init_cache_fifo_policy(); +extern struct cache_policy_ *init_cache_fifo_policy(void); extern void destroy_cache_fifo_policy(struct cache_policy_ *); /* lru policy routines */ -extern struct cache_policy_ *init_cache_lru_policy(); +extern struct cache_policy_ *init_cache_lru_policy(void); extern void destroy_cache_lru_policy(struct cache_policy_ *); /* lfu policy routines */ -extern struct cache_policy_ *init_cache_lfu_policy(); +extern struct cache_policy_ *init_cache_lfu_policy(void); extern void destroy_cache_lfu_policy(struct cache_policy_ *); #endif Modified: head/usr.sbin/nscd/debug.c ============================================================================== --- head/usr.sbin/nscd/debug.c Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/debug.c Fri Jun 12 23:39:05 2009 (r194087) @@ -135,14 +135,14 @@ __trace_out(const char *s, const char *f } void -__trace_on() +__trace_on(void) { trace_level = trace_level_bk; trace_level_bk = 0; } void -__trace_off() +__trace_off(void) { trace_level_bk = trace_level; trace_level = 1024; Modified: head/usr.sbin/nscd/debug.h ============================================================================== --- head/usr.sbin/nscd/debug.h Fri Jun 12 23:27:31 2009 (r194086) +++ head/usr.sbin/nscd/debug.h Fri Jun 12 23:39:05 2009 (r194087) @@ -61,7 +61,7 @@ extern void __trace_ptr(const char *, co extern void __trace_int(const char *, int, const char *, int); extern void __trace_str(const char *, const char *, const char *, int); extern void __trace_out(const char *, const char *, int); -extern void __trace_on(); -extern void __trace_off(); +extern void __trace_on(void); +extern void __trace_off(void); #endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 23:43:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B07261065678; Fri, 12 Jun 2009 23:43:19 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E65F8FC1C; Fri, 12 Jun 2009 23:43:19 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CNhJr5096592; Fri, 12 Jun 2009 23:43:19 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CNhJ9H096590; Fri, 12 Jun 2009 23:43:19 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906122343.n5CNhJ9H096590@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 12 Jun 2009 23:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194088 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 23:43:20 -0000 Author: edwin Date: Fri Jun 12 23:43:19 2009 New Revision: 194088 URL: http://svn.freebsd.org/changeset/base/194088 Log: Fix typo in cons25l7 definition in etc/termcap.small and share/termcap There is a minor typo in the cons25l7 (':' instead of '|') entry in src/etc/termcap.small that causes syscons to complain about bogus characters in /etc/termcap.db. PR: conf/132777 Submitted by: Nikos Ntarmos MFC after: 1 week Modified: head/etc/termcap.small head/share/termcap/termcap.src Modified: head/etc/termcap.small ============================================================================== --- head/etc/termcap.small Fri Jun 12 23:39:05 2009 (r194087) +++ head/etc/termcap.small Fri Jun 12 23:43:19 2009 (r194088) @@ -138,7 +138,7 @@ cons60l1|cons60-iso8859-1:\ cons60l1-m|cons60-iso8859-1-mono:\ :li#60:tc=cons25l1-m: # ISO 8859-7 FreeBSD console with ACS support -cons25l7:cons25-iso8859-7:\ +cons25l7|cons25-iso8859-7:\ :ac=f\260g\261{\360}\243+\253,\273i\247:\ :tc=cons25w: cons25l7-m|cons25-iso8859-7-mono:\ Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Fri Jun 12 23:39:05 2009 (r194087) +++ head/share/termcap/termcap.src Fri Jun 12 23:43:19 2009 (r194088) @@ -2390,7 +2390,7 @@ cons60l1|cons60-iso8859-1:\ cons60l1-m|cons60-iso8859-1-mono:\ :li#60:tc=cons25l1-m: # 132x25 ISO 8859-1 FreeBSD console -cons25l1-w|:cons25w-iso8859-1:\ +cons25l1-w|cons25w-iso8859-1:\ :co#132:tc=cons25l1: cons30l1-w|cons30w-iso8859-1:\ :co#132:tc=cons30l1: @@ -2401,7 +2401,7 @@ cons50l1-w|cons50w-iso8859-1:\ cons60l1-w|cons60w-iso8859-1:\ :co#132:tc=cons60l1: # ISO 8859-7 FreeBSD console with ACS support -cons25l7:cons25-iso8859-7:\ +cons25l7|cons25-iso8859-7:\ :ac=f\260g\261{\360}\243+\253,\273i\247:\ :tc=cons25w: cons25l7-m|cons25-iso8859-7-mono:\ From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:06:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A7E6106566C; Sat, 13 Jun 2009 00:06:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AC3A8FC14; Sat, 13 Jun 2009 00:06:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D06rKc097117; Sat, 13 Jun 2009 00:06:53 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D06qkb097104; Sat, 13 Jun 2009 00:06:52 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130006.n5D06qkb097104@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 00:06: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: r194089 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:06:53 -0000 Author: des Date: Sat Jun 13 00:06:52 2009 New Revision: 194089 URL: http://svn.freebsd.org/changeset/base/194089 Log: #include cleanup MFC after: 1 week Modified: head/usr.sbin/nscd/cachelib.h head/usr.sbin/nscd/cacheplcs.c head/usr.sbin/nscd/cacheplcs.h head/usr.sbin/nscd/config.c head/usr.sbin/nscd/config.h head/usr.sbin/nscd/hashtable.h head/usr.sbin/nscd/mp_rs_query.c head/usr.sbin/nscd/nscd.c head/usr.sbin/nscd/parser.c head/usr.sbin/nscd/protocol.h head/usr.sbin/nscd/query.c head/usr.sbin/nscd/query.h head/usr.sbin/nscd/singletons.c Modified: head/usr.sbin/nscd/cachelib.h ============================================================================== --- head/usr.sbin/nscd/cachelib.h Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/cachelib.h Sat Jun 13 00:06:52 2009 (r194089) @@ -29,9 +29,6 @@ #ifndef __NSCD_CACHELIB_H__ #define __NSCD_CACHELIB_H__ -#include -#include -#include #include "hashtable.h" #include "cacheplcs.h" Modified: head/usr.sbin/nscd/cacheplcs.c ============================================================================== --- head/usr.sbin/nscd/cacheplcs.c Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/cacheplcs.c Sat Jun 13 00:06:52 2009 (r194089) @@ -28,8 +28,12 @@ #include __FBSDID("$FreeBSD$"); +#include + #include +#include #include + #include "cacheplcs.h" #include "debug.h" Modified: head/usr.sbin/nscd/cacheplcs.h ============================================================================== --- head/usr.sbin/nscd/cacheplcs.h Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/cacheplcs.h Sat Jun 13 00:06:52 2009 (r194089) @@ -30,8 +30,6 @@ #define __NSCD_CACHEPLCS_H__ #include -#include -#include /* common policy definitions */ #define CACHELIB_MAX_FREQUENCY 100 Modified: head/usr.sbin/nscd/config.c ============================================================================== --- head/usr.sbin/nscd/config.c Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/config.c Sat Jun 13 00:06:52 2009 (r194089) @@ -28,11 +28,17 @@ #include __FBSDID("$FreeBSD$"); +#include +#include + #include #include +#include +#include #include #include #include + #include "config.h" #include "debug.h" #include "log.h" Modified: head/usr.sbin/nscd/config.h ============================================================================== --- head/usr.sbin/nscd/config.h Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/config.h Sat Jun 13 00:06:52 2009 (r194089) @@ -29,11 +29,6 @@ #ifndef __NSCD_CONFIG_H__ #define __NSCD_CONFIG_H__ -#include -#include -#include -#include -#include #include "cachelib.h" #define DEFAULT_QUERY_TIMEOUT 8 Modified: head/usr.sbin/nscd/hashtable.h ============================================================================== --- head/usr.sbin/nscd/hashtable.h Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/hashtable.h Sat Jun 13 00:06:52 2009 (r194089) @@ -29,7 +29,6 @@ #ifndef __CACHELIB_HASHTABLE_H__ #define __CACHELIB_HASHTABLE_H__ -#include #include #define HASHTABLE_INITIAL_ENTRIES_CAPACITY 8 Modified: head/usr.sbin/nscd/mp_rs_query.c ============================================================================== --- head/usr.sbin/nscd/mp_rs_query.c Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/mp_rs_query.c Sat Jun 13 00:06:52 2009 (r194089) @@ -28,15 +28,17 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include +#include +#include + #include #include +#include +#include #include #include -#include #include "cachelib.h" #include "config.h" Modified: head/usr.sbin/nscd/nscd.c ============================================================================== --- head/usr.sbin/nscd/nscd.c Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/nscd.c Sat Jun 13 00:06:52 2009 (r194089) @@ -28,12 +28,13 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include +#include #include -#include #include + #include #include #include Modified: head/usr.sbin/nscd/parser.c ============================================================================== --- head/usr.sbin/nscd/parser.c Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/parser.c Sat Jun 13 00:06:52 2009 (r194089) @@ -28,9 +28,13 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include +#include #include + #include "config.h" #include "debug.h" #include "log.h" Modified: head/usr.sbin/nscd/protocol.h ============================================================================== --- head/usr.sbin/nscd/protocol.h Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/protocol.h Sat Jun 13 00:06:52 2009 (r194089) @@ -29,8 +29,6 @@ #ifndef __NSCD_PROTOCOL_H__ #define __NSCD_PROTOCOL_H__ -#include - /* maximum buffer size to receive - larger buffers are not allowed */ #define MAX_BUFFER_SIZE (1 << 20) Modified: head/usr.sbin/nscd/query.c ============================================================================== --- head/usr.sbin/nscd/query.c Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/query.c Sat Jun 13 00:06:52 2009 (r194089) @@ -29,15 +29,18 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include + #include #include #include #include #include #include +#include + #include "config.h" #include "debug.h" #include "query.h" Modified: head/usr.sbin/nscd/query.h ============================================================================== --- head/usr.sbin/nscd/query.h Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/query.h Sat Jun 13 00:06:52 2009 (r194089) @@ -29,9 +29,6 @@ #ifndef __NSCD_QUERY_H__ #define __NSCD_QUERY_H__ -#include -#include -#include #include "cachelib.h" #include "config.h" #include "protocol.h" Modified: head/usr.sbin/nscd/singletons.c ============================================================================== --- head/usr.sbin/nscd/singletons.c Fri Jun 12 23:43:19 2009 (r194088) +++ head/usr.sbin/nscd/singletons.c Sat Jun 13 00:06:52 2009 (r194089) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "singletons.h" struct configuration *s_configuration = NULL; From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:12:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FE80106564A; Sat, 13 Jun 2009 00:12:03 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D0608FC14; Sat, 13 Jun 2009 00:12:03 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D0C3AD097257; Sat, 13 Jun 2009 00:12:03 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D0C31Y097253; Sat, 13 Jun 2009 00:12:03 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200906130012.n5D0C31Y097253@svn.freebsd.org> From: Jamie Gritton Date: Sat, 13 Jun 2009 00: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: r194090 - in head/sys: compat/linux compat/svr4 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:12:04 -0000 Author: jamie Date: Sat Jun 13 00:12:02 2009 New Revision: 194090 URL: http://svn.freebsd.org/changeset/base/194090 Log: Add counterparts to getcredhostname: getcreddomainname, getcredhostuuid, getcredhostid Suggested by: rmacklem Approved by: bz Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/svr4/svr4_stat.c head/sys/kern/kern_jail.c head/sys/sys/jail.h Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sat Jun 13 00:06:52 2009 (r194089) +++ head/sys/compat/linux/linux_misc.c Sat Jun 13 00:12:02 2009 (r194090) @@ -716,7 +716,6 @@ linux_newuname(struct thread *td, struct struct l_new_utsname utsname; char osname[LINUX_MAX_UTSNAME]; char osrelease[LINUX_MAX_UTSNAME]; - struct prison *pr; char *p; #ifdef DEBUG @@ -730,6 +729,7 @@ linux_newuname(struct thread *td, struct bzero(&utsname, sizeof(utsname)); strlcpy(utsname.sysname, osname, LINUX_MAX_UTSNAME); getcredhostname(td->td_ucred, utsname.nodename, LINUX_MAX_UTSNAME); + getcreddomainname(td->td_ucred, utsname.domainname, LINUX_MAX_UTSNAME); strlcpy(utsname.release, osrelease, LINUX_MAX_UTSNAME); strlcpy(utsname.version, version, LINUX_MAX_UTSNAME); for (p = utsname.version; *p != '\0'; ++p) @@ -739,11 +739,6 @@ linux_newuname(struct thread *td, struct } strlcpy(utsname.machine, linux_platform, LINUX_MAX_UTSNAME); - pr = td->td_ucred->cr_prison; - mtx_lock(&pr->pr_mtx); - strlcpy(utsname.domainname, pr->pr_domain, LINUX_MAX_UTSNAME); - mtx_unlock(&pr->pr_mtx); - return (copyout(&utsname, args->buf, sizeof(utsname))); } Modified: head/sys/compat/svr4/svr4_stat.c ============================================================================== --- head/sys/compat/svr4/svr4_stat.c Sat Jun 13 00:06:52 2009 (r194089) +++ head/sys/compat/svr4/svr4_stat.c Sat Jun 13 00:12:02 2009 (r194090) @@ -411,10 +411,10 @@ svr4_sys_systeminfo(td, uap) struct thread *td; struct svr4_sys_systeminfo_args *uap; { - struct prison *pr; char *str = NULL; int error = 0; register_t *retval = td->td_retval; + u_long hostid; size_t len = 0; char buf[MAXHOSTNAMELEN]; u_int rlen = uap->len; @@ -458,10 +458,8 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_HW_SERIAL: - pr = td->td_ucred->cr_prison; - mtx_lock(&pr->pr_mtx); - snprintf(buf, sizeof(buf), "%lu", pr->pr_hostid); - mtx_unlock(&pr->pr_mtx); + getcredhostid(td->td_ucred, &hostid); + snprintf(buf, sizeof(buf), "%lu", hostid); str = buf; break; @@ -470,10 +468,7 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_SRPC_DOMAIN: - pr = td->td_ucred->cr_prison; - mtx_lock(&pr->pr_mtx); - strlcpy(buf, pr->pr_domain, sizeof(buf)); - mtx_unlock(&pr->pr_mtx); + getcreddomainname(td->td_ucred, buf, sizeof(buf)); str = buf; break; Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sat Jun 13 00:06:52 2009 (r194089) +++ head/sys/kern/kern_jail.c Sat Jun 13 00:12:02 2009 (r194090) @@ -3207,19 +3207,50 @@ jailed(struct ucred *cred) } /* - * Return the correct hostname for the passed credential. + * Return the correct hostname (domainname, et al) for the passed credential. */ void getcredhostname(struct ucred *cred, char *buf, size_t size) { struct prison *pr; + /* + * A NULL credential can be used to shortcut to the physical + * system's hostname. + */ pr = (cred != NULL) ? cred->cr_prison : &prison0; mtx_lock(&pr->pr_mtx); strlcpy(buf, pr->pr_host, size); mtx_unlock(&pr->pr_mtx); } +void +getcreddomainname(struct ucred *cred, char *buf, size_t size) +{ + + mtx_lock(&cred->cr_prison->pr_mtx); + strlcpy(buf, cred->cr_prison->pr_domain, size); + mtx_unlock(&cred->cr_prison->pr_mtx); +} + +void +getcredhostuuid(struct ucred *cred, char *buf, size_t size) +{ + + mtx_lock(&cred->cr_prison->pr_mtx); + strlcpy(buf, cred->cr_prison->pr_uuid, size); + mtx_unlock(&cred->cr_prison->pr_mtx); +} + +void +getcredhostid(struct ucred *cred, unsigned long *hostid) +{ + + mtx_lock(&cred->cr_prison->pr_mtx); + *hostid = cred->cr_prison->pr_hostid; + mtx_unlock(&cred->cr_prison->pr_mtx); +} + /* * Determine whether the subject represented by cred can "see" * status of a mount point. Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sat Jun 13 00:06:52 2009 (r194089) +++ head/sys/sys/jail.h Sat Jun 13 00:12:02 2009 (r194090) @@ -304,7 +304,10 @@ struct mount; struct sockaddr; struct statfs; int jailed(struct ucred *cred); -void getcredhostname(struct ucred *cred, char *, size_t); +void getcredhostname(struct ucred *, char *, size_t); +void getcreddomainname(struct ucred *, char *, size_t); +void getcredhostuuid(struct ucred *, char *, size_t); +void getcredhostid(struct ucred *, unsigned long *); int prison_allow(struct ucred *, unsigned); int prison_check(struct ucred *cred1, struct ucred *cred2); int prison_canseemount(struct ucred *cred, struct mount *mp); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:13:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432121065702; Sat, 13 Jun 2009 00:13:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30F3F8FC18; Sat, 13 Jun 2009 00:13:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D0DjnR097319; Sat, 13 Jun 2009 00:13:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D0DjHh097317; Sat, 13 Jun 2009 00:13:45 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130013.n5D0DjHh097317@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 00:13: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: r194091 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:13:45 -0000 Author: des Date: Sat Jun 13 00:13:44 2009 New Revision: 194091 URL: http://svn.freebsd.org/changeset/base/194091 Log: Make the debugging macros expand to (void)0 instead of simply nothing when debugging is turned off. Rename debugging functions due to namespace violation. MFC after: 1 week Modified: head/usr.sbin/nscd/debug.c head/usr.sbin/nscd/debug.h Modified: head/usr.sbin/nscd/debug.c ============================================================================== --- head/usr.sbin/nscd/debug.c Sat Jun 13 00:12:02 2009 (r194090) +++ head/usr.sbin/nscd/debug.c Sat Jun 13 00:13:44 2009 (r194091) @@ -35,7 +35,7 @@ static int trace_level = 0; static int trace_level_bk = 0; void -__trace_in(const char *s, const char *f, int l) +nscd_trace_in(const char *s, const char *f, int l) { int i; if (trace_level < TRACE_WANTED) @@ -50,7 +50,7 @@ __trace_in(const char *s, const char *f, } void -__trace_point(const char *f, int l) +nscd_trace_point(const char *f, int l) { int i; @@ -64,7 +64,7 @@ __trace_point(const char *f, int l) } void -__trace_msg(const char *msg, const char *f, int l) +nscd_trace_msg(const char *msg, const char *f, int l) { int i; @@ -78,7 +78,7 @@ __trace_msg(const char *msg, const char } void -__trace_ptr(const char *desc, const void *p, const char *f, int l) +nscd_trace_ptr(const char *desc, const void *p, const char *f, int l) { int i; @@ -92,7 +92,7 @@ __trace_ptr(const char *desc, const void } void -__trace_int(const char *desc, int i, const char *f, int l) +nscd_trace_int(const char *desc, int i, const char *f, int l) { int j; @@ -106,7 +106,7 @@ __trace_int(const char *desc, int i, con } void -__trace_str(const char *desc, const char *s, const char *f, int l) +nscd_trace_str(const char *desc, const char *s, const char *f, int l) { int i; @@ -120,7 +120,7 @@ __trace_str(const char *desc, const char } void -__trace_out(const char *s, const char *f, int l) +nscd_trace_out(const char *s, const char *f, int l) { int i; @@ -135,14 +135,14 @@ __trace_out(const char *s, const char *f } void -__trace_on(void) +nscd_trace_on(void) { trace_level = trace_level_bk; trace_level_bk = 0; } void -__trace_off(void) +nscd_trace_off(void) { trace_level_bk = trace_level; trace_level = 1024; Modified: head/usr.sbin/nscd/debug.h ============================================================================== --- head/usr.sbin/nscd/debug.h Sat Jun 13 00:12:02 2009 (r194090) +++ head/usr.sbin/nscd/debug.h Sat Jun 13 00:13:44 2009 (r194091) @@ -33,35 +33,35 @@ /* #ifndef NDEBUG */ #if 0 -#define TRACE_IN(x) __trace_in(#x, __FILE__, __LINE__) -#define TRACE_POINT() __trace_point(__FILE__, __LINE__) -#define TRACE_MSG(x) __trace_msg(x, __FILE__, __LINE__) -#define TRACE_PTR(p) __trace_ptr(#p, p, __FILE__, __LINE__) -#define TRACE_INT(i) __trace_int(#i, i, __FILE__, __LINE__) -#define TRACE_STR(s) __trace_str(#s, s, __FILE__, __LINE__) -#define TRACE_OUT(x) __trace_out(#x, __FILE__, __LINE__) -#define TRACE_ON() __trace_on() -#define TRACE_OFF() __trace_off() +#define TRACE_IN(x) nscd_trace_in(#x, __FILE__, __LINE__) +#define TRACE_POINT() nscd_trace_point(__FILE__, __LINE__) +#define TRACE_MSG(x) nscd_trace_msg(x, __FILE__, __LINE__) +#define TRACE_PTR(p) nscd_trace_ptr(#p, p, __FILE__, __LINE__) +#define TRACE_INT(i) nscd_trace_int(#i, i, __FILE__, __LINE__) +#define TRACE_STR(s) nscd_trace_str(#s, s, __FILE__, __LINE__) +#define TRACE_OUT(x) nscd_trace_out(#x, __FILE__, __LINE__) +#define TRACE_ON() nscd_trace_on() +#define TRACE_OFF() nscd_trace_off() #else -#define TRACE_IN(x) -#define TRACE_POINT() -#define TRACE_MSG(x) -#define TRACE_PTR(p) -#define TRACE_INT(i) -#define TRACE_STR(s) -#define TRACE_OUT(x) -#define TRACE_ON() -#define TRACE_OFF() +#define TRACE_IN(x) (void)0 +#define TRACE_POINT() (void)0 +#define TRACE_MSG(x) (void)0 +#define TRACE_PTR(p) (void)0 +#define TRACE_INT(i) (void)0 +#define TRACE_STR(s) (void)0 +#define TRACE_OUT(x) (void)0 +#define TRACE_ON() (void)0 +#define TRACE_OFF() (void)0 #endif -extern void __trace_in(const char *, const char *, int); -extern void __trace_point(const char *, int); -extern void __trace_msg(const char *, const char *, int); -extern void __trace_ptr(const char *, const void *, const char *, int); -extern void __trace_int(const char *, int, const char *, int); -extern void __trace_str(const char *, const char *, const char *, int); -extern void __trace_out(const char *, const char *, int); -extern void __trace_on(void); -extern void __trace_off(void); +extern void nscd_trace_in(const char *, const char *, int); +extern void nscd_trace_point(const char *, int); +extern void nscd_trace_msg(const char *, const char *, int); +extern void nscd_trace_ptr(const char *, const void *, const char *, int); +extern void nscd_trace_int(const char *, int, const char *, int); +extern void nscd_trace_str(const char *, const char *, const char *, int); +extern void nscd_trace_out(const char *, const char *, int); +extern void nscd_trace_on(void); +extern void nscd_trace_off(void); #endif From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:27:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DABCB1065674; Sat, 13 Jun 2009 00:27:03 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C69FA8FC0A; Sat, 13 Jun 2009 00:27:03 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D0R37P097634; Sat, 13 Jun 2009 00:27:03 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D0R3CU097629; Sat, 13 Jun 2009 00:27:03 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200906130027.n5D0R3CU097629@svn.freebsd.org> From: Ivan Voras Date: Sat, 13 Jun 2009 00:27: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: r194092 - in head: sbin/geom/class/label sys/conf sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:27:04 -0000 Author: ivoras Date: Sat Jun 13 00:27:03 2009 New Revision: 194092 URL: http://svn.freebsd.org/changeset/base/194092 Log: Add support for labels derived from GPT metadata. Approved by: gnn (mentor) Reviewed by: pjd PR: 128398 Submitted by: Marius Nuennerich < marius at nuenneri.ch > Added: head/sys/geom/label/g_label_gpt.c (contents, props changed) Modified: head/sbin/geom/class/label/glabel.8 head/sys/conf/files head/sys/geom/label/g_label.c head/sys/geom/label/g_label.h Modified: head/sbin/geom/class/label/glabel.8 ============================================================================== --- head/sbin/geom/class/label/glabel.8 Sat Jun 13 00:13:44 2009 (r194091) +++ head/sbin/geom/class/label/glabel.8 Sat Jun 13 00:27:03 2009 (r194092) @@ -1,4 +1,5 @@ .\" Copyright (c) 2004-2005 Pawel Jakub Dawidek +.\" Copyright (c) 2008-2009 Ivan Voras .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 2, 2004 +.Dd June 13, 2009 .Dt GLABEL 8 .Os .Sh NAME @@ -119,7 +120,18 @@ NTFS (directory .Pa /dev/ntfs/ ) . .El .Pp -Non file-system labels are created in the directory +Support for partition metadata is implemented for: +.Pp +.Bl -bullet -offset indent -compact +.It +GPT labels (directory +.Pa /dev/gpt/ ) . +.It +GPT UUIDs (directory +.Pa /dev/gptid/ ) . +.El +.Pp +Generic labels are created in the directory .Pa /dev/label/ . .Pp The first argument to Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jun 13 00:13:44 2009 (r194091) +++ head/sys/conf/files Sat Jun 13 00:27:03 2009 (r194092) @@ -1852,6 +1852,7 @@ geom/label/g_label_msdosfs.c optional ge geom/label/g_label_ntfs.c optional geom_label geom/label/g_label_reiserfs.c optional geom_label geom/label/g_label_ufs.c optional geom_label +geom/label/g_label_gpt.c optional geom_label geom/linux_lvm/g_linux_lvm.c optional geom_linux_lvm geom/mirror/g_mirror.c optional geom_mirror geom/mirror/g_mirror_ctl.c optional geom_mirror Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Sat Jun 13 00:13:44 2009 (r194091) +++ head/sys/geom/label/g_label.c Sat Jun 13 00:27:03 2009 (r194092) @@ -84,6 +84,8 @@ const struct g_label_desc *g_labels[] = &g_label_ext2fs, &g_label_reiserfs, &g_label_ntfs, + &g_label_gpt, + &g_label_gpt_uuid, NULL }; Modified: head/sys/geom/label/g_label.h ============================================================================== --- head/sys/geom/label/g_label.h Sat Jun 13 00:13:44 2009 (r194091) +++ head/sys/geom/label/g_label.h Sat Jun 13 00:27:03 2009 (r194092) @@ -71,6 +71,8 @@ extern const struct g_label_desc g_label extern const struct g_label_desc g_label_ext2fs; extern const struct g_label_desc g_label_reiserfs; extern const struct g_label_desc g_label_ntfs; +extern const struct g_label_desc g_label_gpt; +extern const struct g_label_desc g_label_gpt_uuid; #endif /* _KERNEL */ struct g_label_metadata { Added: head/sys/geom/label/g_label_gpt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/label/g_label_gpt.c Sat Jun 13 00:27:03 2009 (r194092) @@ -0,0 +1,164 @@ +/*- + * Copyright (c) 2008 Marius Nuennerich + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PART_CLASS_NAME "PART" +#define SCHEME_NAME "GPT" + +#define G_LABEL_GPT_VOLUME_DIR "gpt" +#define G_LABEL_GPT_ID_DIR "gptid" + +/* also defined in geom/part/g_part_gpt.c */ +struct g_part_gpt_entry { + struct g_part_entry base; + struct gpt_ent ent; +}; + +/* shamelessly stolen from g_part_gpt.c */ +static void +sbuf_nprintf_utf16(struct sbuf *sb, uint16_t *str, size_t len) +{ + u_int bo; + uint32_t ch; + uint16_t c; + + bo = LITTLE_ENDIAN; /* GPT is little-endian */ + while (len > 0 && *str != 0) { + ch = (bo == BIG_ENDIAN) ? be16toh(*str) : le16toh(*str); + str++, len--; + if ((ch & 0xf800) == 0xd800) { + if (len > 0) { + c = (bo == BIG_ENDIAN) ? be16toh(*str) + : le16toh(*str); + str++, len--; + } else + c = 0xfffd; + if ((ch & 0x400) == 0 && (c & 0xfc00) == 0xdc00) { + ch = ((ch & 0x3ff) << 10) + (c & 0x3ff); + ch += 0x10000; + } else + ch = 0xfffd; + } else if (ch == 0xfffe) { /* BOM (U+FEFF) swapped. */ + bo = (bo == BIG_ENDIAN) ? LITTLE_ENDIAN : BIG_ENDIAN; + continue; + } else if (ch == 0xfeff) /* BOM (U+FEFF) unswapped. */ + continue; + + /* Write the Unicode character in UTF-8 */ + if (ch < 0x80) + sbuf_printf(sb, "%c", ch); + else if (ch < 0x800) + sbuf_printf(sb, "%c%c", 0xc0 | (ch >> 6), + 0x80 | (ch & 0x3f)); + else if (ch < 0x10000) + sbuf_printf(sb, "%c%c%c", 0xe0 | (ch >> 12), + 0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f)); + else if (ch < 0x200000) + sbuf_printf(sb, "%c%c%c%c", 0xf0 | (ch >> 18), + 0x80 | ((ch >> 12) & 0x3f), + 0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f)); + } +} + +static void +g_label_gpt_taste(struct g_consumer *cp, char *label, size_t size) +{ + struct g_provider *pp; + struct g_part_table *tp; + struct g_part_gpt_entry *part_gpt_entry; + struct sbuf *lbl; + + g_topology_assert_not(); + pp = cp->provider; + tp = (struct g_part_table *)pp->geom->softc; + label[0] = '\0'; + + /* We taste only partitions from GPART */ + if (strncmp(pp->geom->class->name, PART_CLASS_NAME, sizeof(PART_CLASS_NAME))) + return; + /* and only GPT */ + if (strncmp(tp->gpt_scheme->name, SCHEME_NAME, sizeof(SCHEME_NAME))) + return; + + part_gpt_entry = (struct g_part_gpt_entry *)pp->private; + + /* + * create sbuf with biggest possible size + * we need max. 4 bytes for every 2-byte utf16 char + */ + lbl = sbuf_new(NULL, NULL, sizeof(part_gpt_entry->ent.ent_name) << 1, SBUF_FIXEDLEN); + /* size ist the number of characters, not bytes */ + sbuf_nprintf_utf16(lbl, part_gpt_entry->ent.ent_name, sizeof(part_gpt_entry->ent.ent_name) >> 1); + sbuf_finish(lbl); + strlcpy(label, sbuf_data(lbl), size); + sbuf_delete(lbl); +} + +static void +g_label_gpt_uuid_taste(struct g_consumer *cp, char *label, size_t size) +{ + struct g_provider *pp; + struct g_part_table *tp; + struct g_part_gpt_entry *part_gpt_entry; + + g_topology_assert_not(); + pp = cp->provider; + tp = (struct g_part_table *)pp->geom->softc; + label[0] = '\0'; + + /* we taste only partitions from GPART */ + if (strncmp(pp->geom->class->name, PART_CLASS_NAME, sizeof(PART_CLASS_NAME))) + return; + /* and only GPT */ + if (strncmp(tp->gpt_scheme->name, SCHEME_NAME, sizeof(SCHEME_NAME))) + return; + + part_gpt_entry = (struct g_part_gpt_entry *)pp->private; + snprintf_uuid(label, size, &part_gpt_entry->ent.ent_uuid); +} + +const struct g_label_desc g_label_gpt = { + .ld_taste = g_label_gpt_taste, + .ld_dir = G_LABEL_GPT_VOLUME_DIR +}; + +const struct g_label_desc g_label_gpt_uuid = { + .ld_taste = g_label_gpt_uuid_taste, + .ld_dir = G_LABEL_GPT_ID_DIR +}; From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:43:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D39E11065670; Sat, 13 Jun 2009 00:43:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C123B8FC24; Sat, 13 Jun 2009 00:43:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D0hvhr098018; Sat, 13 Jun 2009 00:43:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D0hv4g098008; Sat, 13 Jun 2009 00:43:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130043.n5D0hv4g098008@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 00:43: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: r194093 - in head/usr.sbin/nscd: . agents X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:43:58 -0000 Author: des Date: Sat Jun 13 00:43:56 2009 New Revision: 194093 URL: http://svn.freebsd.org/changeset/base/194093 Log: Further #include cleanup. MFC after: 1 week Modified: head/usr.sbin/nscd/agent.c head/usr.sbin/nscd/agents/group.c head/usr.sbin/nscd/agents/passwd.c head/usr.sbin/nscd/agents/services.c head/usr.sbin/nscd/cachelib.c head/usr.sbin/nscd/debug.c head/usr.sbin/nscd/log.c head/usr.sbin/nscd/mp_ws_query.c head/usr.sbin/nscd/nscdcli.c head/usr.sbin/nscd/protocol.c Modified: head/usr.sbin/nscd/agent.c ============================================================================== --- head/usr.sbin/nscd/agent.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/agent.c Sat Jun 13 00:43:56 2009 (r194093) @@ -29,8 +29,9 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include + #include "agent.h" #include "debug.h" Modified: head/usr.sbin/nscd/agents/group.c ============================================================================== --- head/usr.sbin/nscd/agents/group.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/agents/group.c Sat Jun 13 00:43:56 2009 (r194093) @@ -29,12 +29,13 @@ __FBSDID("$FreeBSD$"); #include -#include + #include -#include #include -#include +#include #include +#include + #include "../debug.h" #include "passwd.h" Modified: head/usr.sbin/nscd/agents/passwd.c ============================================================================== --- head/usr.sbin/nscd/agents/passwd.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/agents/passwd.c Sat Jun 13 00:43:56 2009 (r194093) @@ -29,11 +29,13 @@ __FBSDID("$FreeBSD$"); #include + #include #include #include -#include #include +#include + #include "../debug.h" #include "passwd.h" Modified: head/usr.sbin/nscd/agents/services.c ============================================================================== --- head/usr.sbin/nscd/agents/services.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/agents/services.c Sat Jun 13 00:43:56 2009 (r194093) @@ -29,12 +29,13 @@ __FBSDID("$FreeBSD$"); #include -#include + #include -#include #include -#include +#include #include +#include + #include "../debug.h" #include "services.h" Modified: head/usr.sbin/nscd/cachelib.c ============================================================================== --- head/usr.sbin/nscd/cachelib.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/cachelib.c Sat Jun 13 00:43:56 2009 (r194093) @@ -29,9 +29,11 @@ __FBSDID("$FreeBSD$"); #include + #include #include #include + #include "cachelib.h" #include "debug.h" Modified: head/usr.sbin/nscd/debug.c ============================================================================== --- head/usr.sbin/nscd/debug.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/debug.c Sat Jun 13 00:43:56 2009 (r194093) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include + #include "debug.h" static int trace_level = 0; Modified: head/usr.sbin/nscd/log.c ============================================================================== --- head/usr.sbin/nscd/log.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/log.c Sat Jun 13 00:43:56 2009 (r194093) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include "log.h" void Modified: head/usr.sbin/nscd/mp_ws_query.c ============================================================================== --- head/usr.sbin/nscd/mp_ws_query.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/mp_ws_query.c Sat Jun 13 00:43:56 2009 (r194093) @@ -28,15 +28,16 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include +#include +#include + #include #include +#include #include #include -#include #include "cachelib.h" #include "config.h" Modified: head/usr.sbin/nscd/nscdcli.c ============================================================================== --- head/usr.sbin/nscd/nscdcli.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/nscdcli.c Sat Jun 13 00:43:56 2009 (r194093) @@ -29,10 +29,12 @@ __FBSDID("$FreeBSD$"); #include -#include + #include +#include #include #include + #include #include #include Modified: head/usr.sbin/nscd/protocol.c ============================================================================== --- head/usr.sbin/nscd/protocol.c Sat Jun 13 00:27:03 2009 (r194092) +++ head/usr.sbin/nscd/protocol.c Sat Jun 13 00:43:56 2009 (r194093) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include "debug.h" #include "log.h" #include "protocol.h" From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:46:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C5BF106564A; Sat, 13 Jun 2009 00:46:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B03E8FC1C; Sat, 13 Jun 2009 00:46:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D0k7vM098120; Sat, 13 Jun 2009 00:46:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D0k7on098119; Sat, 13 Jun 2009 00:46:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130046.n5D0k7on098119@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 00:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194094 - head/usr.sbin/nscd/agents X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:46:08 -0000 Author: des Date: Sat Jun 13 00:46:07 2009 New Revision: 194094 URL: http://svn.freebsd.org/changeset/base/194094 Log: #include the right header so we get prototypes for our own functions. MFC after: 1 week Modified: head/usr.sbin/nscd/agents/group.c Modified: head/usr.sbin/nscd/agents/group.c ============================================================================== --- head/usr.sbin/nscd/agents/group.c Sat Jun 13 00:43:56 2009 (r194093) +++ head/usr.sbin/nscd/agents/group.c Sat Jun 13 00:46:07 2009 (r194094) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include "../debug.h" -#include "passwd.h" +#include "group.h" static int group_marshal_func(struct group *, char *, size_t *); static int group_lookup_func(const char *, size_t, char **, size_t *); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:54:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB751065672; Sat, 13 Jun 2009 00:54:52 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 937178FC0A; Sat, 13 Jun 2009 00:54:52 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D0sq9r098292; Sat, 13 Jun 2009 00:54:52 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D0sqko098290; Sat, 13 Jun 2009 00:54:52 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130054.n5D0sqko098290@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 00:54: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: r194095 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:54:53 -0000 Author: des Date: Sat Jun 13 00:54:52 2009 New Revision: 194095 URL: http://svn.freebsd.org/changeset/base/194095 Log: Change hashtable_index_t to unsigned. Generate prototypes for our hash table. MFC after: 1 week Modified: head/usr.sbin/nscd/cachelib.c head/usr.sbin/nscd/hashtable.h Modified: head/usr.sbin/nscd/cachelib.c ============================================================================== --- head/usr.sbin/nscd/cachelib.c Sat Jun 13 00:46:07 2009 (r194094) +++ head/usr.sbin/nscd/cachelib.c Sat Jun 13 00:54:52 2009 (r194095) @@ -146,6 +146,7 @@ ht_item_hash_func(const void *p, size_t return retval; } +HASHTABLE_PROTOTYPE(cache_ht_, cache_ht_item_, struct cache_ht_item_data_); HASHTABLE_GENERATE(cache_ht_, cache_ht_item_, struct cache_ht_item_data_, data, ht_item_hash_func, ht_items_cmp_func); @@ -291,7 +292,7 @@ clear_cache_entry(struct cache_entry_ *e struct cache_policy_ *policy; struct cache_policy_item_ *item, *next_item; size_t entry_size; - int i; + unsigned int i; if (entry->params->entry_type == CET_COMMON) { common_entry = (struct cache_common_entry_ *)entry; @@ -396,7 +397,6 @@ flush_cache_policy(struct cache_common_e hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &entry->items, &ht_key); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&entry->items)); ht_item = HASHTABLE_GET_ENTRY(&(entry->items), hash); @@ -718,7 +718,6 @@ cache_read(struct cache_entry_ *entry, c hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &common_entry->items, &item_data); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&common_entry->items)); item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash); @@ -822,7 +821,6 @@ cache_write(struct cache_entry_ *entry, hash = HASHTABLE_CALCULATE_HASH(cache_ht_, &common_entry->items, &item_data); - assert(hash >= 0); assert(hash < HASHTABLE_ENTRIES_COUNT(&common_entry->items)); item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash); Modified: head/usr.sbin/nscd/hashtable.h ============================================================================== --- head/usr.sbin/nscd/hashtable.h Sat Jun 13 00:46:07 2009 (r194094) +++ head/usr.sbin/nscd/hashtable.h Sat Jun 13 00:54:52 2009 (r194095) @@ -32,7 +32,7 @@ #include #define HASHTABLE_INITIAL_ENTRIES_CAPACITY 8 -typedef int hashtable_index_t; +typedef unsigned int hashtable_index_t; /* * This file contains queue.h-like macro definitions for hash tables. From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:56:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 306AF1065672; Sat, 13 Jun 2009 00:56:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E0DC8FC14; Sat, 13 Jun 2009 00:56:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D0uIQh098387; Sat, 13 Jun 2009 00:56:18 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D0uHks098381; Sat, 13 Jun 2009 00:56:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130056.n5D0uHks098381@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 00:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194096 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:56:18 -0000 Author: des Date: Sat Jun 13 00:56:17 2009 New Revision: 194096 URL: http://svn.freebsd.org/changeset/base/194096 Log: Fix a large number of signed - unsigned comparison warnings. MFC after: 1 week Modified: head/usr.sbin/nscd/config.c head/usr.sbin/nscd/mp_rs_query.c head/usr.sbin/nscd/mp_ws_query.c head/usr.sbin/nscd/nscd.c head/usr.sbin/nscd/nscdcli.c head/usr.sbin/nscd/query.c Modified: head/usr.sbin/nscd/config.c ============================================================================== --- head/usr.sbin/nscd/config.c Sat Jun 13 00:54:52 2009 (r194095) +++ head/usr.sbin/nscd/config.c Sat Jun 13 00:56:17 2009 (r194096) @@ -569,7 +569,8 @@ fill_configuration_defaults(struct confi void destroy_configuration(struct configuration *config) { - int i; + unsigned int i; + TRACE_IN(destroy_configuration); assert(config != NULL); free(config->pidfile_path); Modified: head/usr.sbin/nscd/mp_rs_query.c ============================================================================== --- head/usr.sbin/nscd/mp_rs_query.c Sat Jun 13 00:54:52 2009 (r194095) +++ head/usr.sbin/nscd/mp_rs_query.c Sat Jun 13 00:56:17 2009 (r194096) @@ -140,7 +140,7 @@ on_mp_read_session_request_read2(struct result = qstate->read_func(qstate, c_mp_rs_request->entry, c_mp_rs_request->entry_length); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_read_session_request_read2", "read failed"); TRACE_OUT(on_mp_read_session_request_read2); @@ -463,7 +463,7 @@ on_mp_read_session_read_response_write1( if (read_response->error_code == 0) { result += qstate->write_func(qstate, &read_response->data_size, sizeof(size_t)); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { TRACE_OUT(on_mp_read_session_read_response_write1); LOG_ERR_3("on_mp_read_session_read_response_write1", "write failed"); @@ -473,7 +473,7 @@ on_mp_read_session_read_response_write1( qstate->kevent_watermark = read_response->data_size; qstate->process_func = on_mp_read_session_read_response_write2; } else { - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_read_session_read_response_write1", "write failed"); TRACE_OUT(on_mp_read_session_read_response_write1); @@ -499,7 +499,7 @@ on_mp_read_session_read_response_write2( &qstate->response); result = qstate->write_func(qstate, read_response->data, read_response->data_size); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_read_session_read_response_write2", "write failed"); TRACE_OUT(on_mp_read_session_read_response_write2); Modified: head/usr.sbin/nscd/mp_ws_query.c ============================================================================== --- head/usr.sbin/nscd/mp_ws_query.c Sat Jun 13 00:54:52 2009 (r194095) +++ head/usr.sbin/nscd/mp_ws_query.c Sat Jun 13 00:56:17 2009 (r194096) @@ -145,7 +145,7 @@ on_mp_write_session_request_read2(struct result = qstate->read_func(qstate, c_mp_ws_request->entry, c_mp_ws_request->entry_length); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_write_session_request_read2", "read failed"); TRACE_OUT(on_mp_write_session_request_read2); @@ -397,7 +397,7 @@ on_mp_write_session_write_request_read2( result = qstate->read_func(qstate, write_request->data, write_request->data_size); - if (result != qstate->kevent_watermark) { + if (result < 0 || (size_t)result != qstate->kevent_watermark) { LOG_ERR_3("on_mp_write_session_write_request_read2", "read failed"); TRACE_OUT(on_mp_write_session_write_request_read2); Modified: head/usr.sbin/nscd/nscd.c ============================================================================== --- head/usr.sbin/nscd/nscd.c Sat Jun 13 00:54:52 2009 (r194095) +++ head/usr.sbin/nscd/nscd.c Sat Jun 13 00:56:17 2009 (r194096) @@ -316,9 +316,9 @@ process_socket_event(struct kevent *even * operations. It also does the actual socket IO operations. */ if (((qstate->use_alternate_io == 0) && - (qstate->kevent_watermark <= event_data->data)) || + (qstate->kevent_watermark <= (size_t)event_data->data)) || ((qstate->use_alternate_io != 0) && - (qstate->io_buffer_watermark <= event_data->data))) { + (qstate->io_buffer_watermark <= (size_t)event_data->data))) { if (qstate->use_alternate_io != 0) { switch (qstate->io_buffer_filter) { case EVFILT_READ: @@ -500,7 +500,7 @@ processing_loop(cache the_cache, struct struct kevent *event_data; event_data = &eventlist[0]; - if (event_data->ident == env->sockfd) { + if ((int)event_data->ident == env->sockfd) { for (i = 0; i < event_data->data; ++i) accept_connection(event_data, env, config); Modified: head/usr.sbin/nscd/nscdcli.c ============================================================================== --- head/usr.sbin/nscd/nscdcli.c Sat Jun 13 00:54:52 2009 (r194095) +++ head/usr.sbin/nscd/nscdcli.c Sat Jun 13 00:56:17 2009 (r194096) @@ -72,9 +72,10 @@ safe_write(struct nscd_connection_ *conn nevents = kevent(connection->write_queue, NULL, 0, &eventlist, 1, &timeout); if ((nevents == 1) && (eventlist.filter == EVFILT_WRITE)) { - s_result = write(connection->sockfd, data + result, - eventlist.data < data_size - result ? - eventlist.data : data_size - result); + s_result = write(connection->sockfd, + (char *)data + result, + (size_t)eventlist.data < data_size - result ? + (size_t)eventlist.data : data_size - result); if (s_result == -1) return (-1); else @@ -108,9 +109,10 @@ safe_read(struct nscd_connection_ *conne nevents = kevent(connection->read_queue, NULL, 0, &eventlist, 1, &timeout); if ((nevents == 1) && (eventlist.filter == EVFILT_READ)) { - s_result = read(connection->sockfd, data + result, - eventlist.data <= data_size - result ? eventlist.data : - data_size - result); + s_result = read(connection->sockfd, + (char *)data + result, + (size_t)eventlist.data <= data_size - result ? + (size_t)eventlist.data : data_size - result); if (s_result == -1) return (-1); else Modified: head/usr.sbin/nscd/query.c ============================================================================== --- head/usr.sbin/nscd/query.c Sat Jun 13 00:54:52 2009 (r194095) +++ head/usr.sbin/nscd/query.c Sat Jun 13 00:56:17 2009 (r194096) @@ -379,7 +379,7 @@ on_write_request_read2(struct query_stat result += qstate->read_func(qstate, write_request->data, write_request->data_size); - if (result != qstate->kevent_watermark) { + if (result != (ssize_t)qstate->kevent_watermark) { TRACE_OUT(on_write_request_read2); return (-1); } @@ -643,7 +643,7 @@ on_read_request_read2(struct query_state read_request->cache_key + qstate->eid_str_length, read_request->cache_key_size); - if (result != qstate->kevent_watermark) { + if (result != (ssize_t)qstate->kevent_watermark) { TRACE_OUT(on_read_request_read2); return (-1); } @@ -839,7 +839,7 @@ on_read_response_write1(struct query_sta if (read_response->error_code == 0) { result += qstate->write_func(qstate, &read_response->data_size, sizeof(size_t)); - if (result != qstate->kevent_watermark) { + if (result != (ssize_t)qstate->kevent_watermark) { TRACE_OUT(on_read_response_write1); return (-1); } @@ -847,7 +847,7 @@ on_read_response_write1(struct query_sta qstate->kevent_watermark = read_response->data_size; qstate->process_func = on_read_response_write2; } else { - if (result != qstate->kevent_watermark) { + if (result != (ssize_t)qstate->kevent_watermark) { TRACE_OUT(on_read_response_write1); return (-1); } @@ -871,7 +871,7 @@ on_read_response_write2(struct query_sta if (read_response->data_size > 0) { result = qstate->write_func(qstate, read_response->data, read_response->data_size); - if (result != qstate->kevent_watermark) { + if (result != (ssize_t)qstate->kevent_watermark) { TRACE_OUT(on_read_response_write2); return (-1); } @@ -957,7 +957,7 @@ on_transform_request_read2(struct query_ result = qstate->read_func(qstate, transform_request->entry, transform_request->entry_length); - if (result != qstate->kevent_watermark) { + if (result != (ssize_t)qstate->kevent_watermark) { TRACE_OUT(on_transform_request_read2); return (-1); } @@ -1103,23 +1103,26 @@ check_query_eids(struct query_state *qst ssize_t query_io_buffer_read(struct query_state *qstate, void *buf, size_t nbytes) { + size_t remaining; ssize_t result; TRACE_IN(query_io_buffer_read); if ((qstate->io_buffer_size == 0) || (qstate->io_buffer == NULL)) return (-1); - if (nbytes < qstate->io_buffer + qstate->io_buffer_size - - qstate->io_buffer_p) + assert(qstate->io_buffer_p <= + qstate->io_buffer + qstate->io_buffer_size); + remaining = qstate->io_buffer + qstate->io_buffer_size - + qstate->io_buffer_p; + if (nbytes < remaining) result = nbytes; else - result = qstate->io_buffer + qstate->io_buffer_size - - qstate->io_buffer_p; + result = remaining; memcpy(buf, qstate->io_buffer_p, result); qstate->io_buffer_p += result; - if (qstate->io_buffer_p == qstate->io_buffer + qstate->io_buffer_size) { + if (remaining == 0) { free(qstate->io_buffer); qstate->io_buffer = NULL; @@ -1139,23 +1142,26 @@ ssize_t query_io_buffer_write(struct query_state *qstate, const void *buf, size_t nbytes) { + size_t remaining; ssize_t result; TRACE_IN(query_io_buffer_write); if ((qstate->io_buffer_size == 0) || (qstate->io_buffer == NULL)) return (-1); - if (nbytes < qstate->io_buffer + qstate->io_buffer_size - - qstate->io_buffer_p) + assert(qstate->io_buffer_p <= + qstate->io_buffer + qstate->io_buffer_size); + remaining = qstate->io_buffer + qstate->io_buffer_size - + qstate->io_buffer_p; + if (nbytes < remaining) result = nbytes; else - result = qstate->io_buffer + qstate->io_buffer_size - - qstate->io_buffer_p; + result = remaining; memcpy(qstate->io_buffer_p, buf, result); qstate->io_buffer_p += result; - if (qstate->io_buffer_p == qstate->io_buffer + qstate->io_buffer_size) { + if (remaining == 0) { qstate->use_alternate_io = 1; qstate->io_buffer_p = qstate->io_buffer; @@ -1182,7 +1188,7 @@ query_socket_read(struct query_state *qs } result = read(qstate->sockfd, buf, nbytes); - if ((result == -1) || (result < nbytes)) + if (result < 0 || (size_t)result < nbytes) qstate->socket_failed = 1; TRACE_OUT(query_socket_read); @@ -1204,7 +1210,7 @@ query_socket_write(struct query_state *q } result = write(qstate->sockfd, buf, nbytes); - if ((result == -1) || (result < nbytes)) + if (result < 0 || (size_t)result < nbytes) qstate->socket_failed = 1; TRACE_OUT(query_socket_write); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 00:57:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5585E1065673; Sat, 13 Jun 2009 00:57:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id CEC898FC0A; Sat, 13 Jun 2009 00:57:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5D0utU6030198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 13 Jun 2009 10:56:58 +1000 Date: Sat, 13 Jun 2009 10:56:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200906120849.07127.jhb@freebsd.org> Message-ID: <20090613094302.I22933@delplex.bde.org> References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <200906111018.20703.jhb@freebsd.org> <20090612125702.M22046@delplex.bde.org> <200906120849.07127.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 00:57:01 -0000 On Fri, 12 Jun 2009, John Baldwin wrote: > On Thursday 11 June 2009 11:12:58 pm Bruce Evans wrote: >> On Thu, 11 Jun 2009, John Baldwin wrote: >> >>> On Wednesday 10 June 2009 11:53:16 pm Bruce Evans wrote: >>>> On Wed, 10 Jun 2009, John Baldwin wrote: >>> >>> I wanted to match 'ticks' and figured changing 'ticks' was a far larger >>> headache. >> >> By changing the signedness you get undefined behaviour for the other types >> too, and risk new and/or different sign extension bugs. > > FWIW, the variables were signed before they were changed to unsigned and are now > back as signed again. It just seems really odd to have the types not match > 'ticks' especially since many of the values are just cached copies of 'ticks'. No, they were originally u_long and stayed that way until you changed them (except possibly for newer variables). The type of `ticks' is just wrong, and fixing that would take more work, but there is no reason to propagate this bug to new variables. The original version is: % Index: tcp_var.h % =================================================================== % RCS file: /home/ncvs/src/sys/netinet/tcp_var.h,v % retrieving revision 1.51 % retrieving revision 1.52 % diff -u -2 -r1.51 -r1.52 % --- tcp_var.h 28 Aug 1999 00:49:33 -0000 1.51 % +++ tcp_var.h 30 Aug 1999 21:17:07 -0000 1.52 % ... % @@ -99,10 +103,10 @@ % u_int t_maxopd; /* mss plus options */ % % - u_int t_idle; /* inactivity time */ This even had a reasonable type. % - u_long t_duration; /* connection duration */ Maybe copying this type is responsible for the sizing bug. % - int t_rtt; /* round trip time */ This was a short in FreeBSD-1 and presumably in Net/2. Since it is unrelated to `ticks' and doesn't need to exceed INT_MAX (or maybe even SHRT_MAX), a signed type is best for it. % + u_long t_rcvtime; /* inactivity time */ % + u_long t_starttime; /* time connection was established */ New variables. % + int t_rtttime; /* round trip time */ This was t_rtt in the above. This commit just regressed its name (to a more verbose one with a bogus extra "t" ("ttime" = "time time"). There is now also a t_bw_rtttime with the same bugs. Other rtt variables are still spelled correctly, but their types are all over the map: from Mar 30 sources: | icmp6.h:struct rttimer; | sctp_structs.h: uint32_t prev_rtt; | sctp_structs.h: uint8_t do_rtt; | sctp_uio.h: uint32_t spinfo_srtt; | sctp_uio.h: uint32_t rtt; | sctp_uio.h: uint32_t sctps_fastretransinrtt; /* number of multiple FR in a | tcp.h: u_int32_t tcpi_rtt; /* Smoothed RTT in usecs. */ | tcp.h: u_int32_t tcpi_rttvar; /* RTT variance in usecs. */ | tcp.h: u_int32_t __tcpi_rcv_rtt; | tcp_hostcache.h: u_long rmx_rtt; /* estimated round trip time */ | tcp_hostcache.h: u_long rmx_rttvar; /* estimated rtt variance */ | tcp_timer.h: * up in the srtt because the timestamp is often calculated at | tcp_var.h: u_long t_starttime; /* time connection was established */ | tcp_var.h: int t_rtttime; /* round trip time */ | tcp_var.h: int t_bw_rtttime; /* used for bandwidth calculation */ | tcp_var.h: int t_srtt; /* smoothed round-trip time */ | tcp_var.h: int t_rttvar; /* variance in round-trip time */ This was short in FreeeBSD-1. | tcp_var.h: u_int t_rttmin; /* minimum rtt allowed */ This was u_short in FreeeBSD-1. | tcp_var.h: u_int t_rttbest; /* best rtt we've seen */ | tcp_var.h: u_long t_rttupdated; /* number of times rtt sampled */ | tcp_var.h: int t_rttlow; /* smallest observerved RTT */ | tcp_var.h: u_long rmx_rtt; /* estimated round trip time */ | tcp_var.h: u_long rmx_rttvar; /* estimated rtt variance */ | tcp_var.h: u_long t_starttime; | tcp_var.h: * With these scales, srtt has 3 bits to the right of the binary point, | tcp_var.h: * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the | tcp_var.h:#define TCP_RTT_SCALE 32 /* multiplier for srtt; 3 bits frac. */ | tcp_var.h:#define TCP_RTT_SHIFT 5 /* shift for srtt; 3 bits frac. */ | tcp_var.h:#define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 2 bits */ | tcp_var.h:#define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 2 bits */ | tcp_var.h: * The initial retransmission should happen at rtt + 4 * rttvar. | tcp_var.h: * Because of the way we do the smoothing, srtt and rttvar | tcp_var.h: max((tp)->t_rttmin, (((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \ | tcp_var.h: + (tp)->t_rttvar) >> TCP_DELTA_SHIFT) | tcp_var.h: u_long tcps_segstimed; /* segs where we tried to get rtt */ | tcp_var.h: u_long tcps_rttupdated; /* times we succeeded */ | tcp_var.h: u_long tcps_cachedrtt; /* times cached RTT in route updated */ | tcp_var.h: u_long tcps_cachedrttvar; /* times cached rttvar updated */ | tcp_var.h: u_long tcps_usedrtt; /* times RTT initialized from route */ | tcp_var.h: u_long tcps_usedrttvar; /* times RTTVAR initialized from rt */ | tcp_var.h: { "rttdflt", CTLTYPE_INT }, \ | vinet.h: int _tcp_inflight_rttthresh; | vinet.h:#define V_tcp_inflight_rttthresh VNET_INET(tcp_inflight_rttthresh) Back to the old diff: % tcp_seq t_rtseq; /* sequence number being timed */ % % - int t_rxtcur; /* current retransmit value */ % + int t_rxtcur; /* current retransmit value (ticks) */ This was short in FreeBSD-1. short would probably have remained enough with HZ=100. Less probably with HZ=1000. % u_int t_maxseg; /* maximum segment size */ % int t_srtt; /* smoothed round-trip time */ % @@ -132,4 +136,8 @@ % tcp_cc cc_send; /* send connection count */ % tcp_cc cc_recv; /* receive connection count */ % +/* experimental */ % + u_long snd_cwnd_prev; /* cwnd prior to retransmit */ % + u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ % + u_long t_badrxtwin; /* window for retransmit recovery */ % }; Probably an error for these to be u_long. However, in old times people worried more about int being 16 bits and used long too much. Using fixed- width types would be worse. % % ... I checked more closely for uses of these variables and found: - most uses of t_rcvtime are of the form: if ((ticks - tp->t_rcvtime) >= tcp_keepidle + tcp_maxidle) This is safe with int variables modulo its undefined behaviour being benign. The expression "ticks - tp->t_rcvtime" is almost always parenthesized, as would be needed if it were cast, but this is especially bogus when it is compared with an unparenthesized expression as above. - t_starttime is also a struct member in struct tcptw. (struct tcptw has many related style bugs. Only 5 of its members have a name beginning with tw_; 5 have no apparent prefix at all, 1 has an apparent ts_ prefix that is not a prefix; t_recent has the same confusing prefix as t_starttime). - struct tcpcb has many bugs of the same type :-(. The recently changed ts_recent_age is one (ts_ only appears to be a prefix), and near it is the unprefixed request_r_scale... - Apart from the above style bugs, the ofuscated t_starttime in struct tcptw gives another instance of the bug that you just fixed. It still has type u_long (you didn't touch it), and is used in the problematic way: from tcp_timewait.c: % tw->t_starttime = tp->t_starttime; % ... % int % tcp_twrecycleable(struct tcptw *tw) % { % tcp_seq new_iss = tw->iss; % tcp_seq new_irs = tw->irs; % % INP_INFO_WLOCK_ASSERT(&tcbinfo); % new_iss += (ticks - tw->t_starttime) * (ISN_BYTES_PER_SECOND / hz); % new_irs += (ticks - tw->t_starttime) * (MS_ISN_BYTES_PER_SECOND / hz); This gives the usual problem when tw_starttime was set from `ticks' before `ticks' overflowed (ticks < INT_MAX), but `ticks' has now overflowed to be negative. % % if (SEQ_GT(new_iss, tw->snd_nxt) && SEQ_GT(new_irs, tw->rcv_nxt)) % return (1); % else % return (0); % } - there are 2 broken comparisons involving t_badrxtwin altogether: from tcp_input.c: % if (tp->t_rxtshift == 1 && % ticks < tp->t_badrxtwin) { % ... % if (tp->t_rxtshift == 1 && ticks < tp->t_badrxtwin) { Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 01:22:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61A641065680; Sat, 13 Jun 2009 01:22:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0A18FC19; Sat, 13 Jun 2009 01:22:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D1MveI098973; Sat, 13 Jun 2009 01:22:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D1Mu1O098966; Sat, 13 Jun 2009 01:22:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130122.n5D1Mu1O098966@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 01:22: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: r194097 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 01:22:57 -0000 Author: des Date: Sat Jun 13 01:22:56 2009 New Revision: 194097 URL: http://svn.freebsd.org/changeset/base/194097 Log: Explain to the compiler why the aliasing we're doing is OK. MFC after: 1 week Modified: head/usr.sbin/nscd/cachelib.c head/usr.sbin/nscd/cachelib.h head/usr.sbin/nscd/config.c head/usr.sbin/nscd/mp_rs_query.c head/usr.sbin/nscd/mp_ws_query.c head/usr.sbin/nscd/nscd.c head/usr.sbin/nscd/query.c Modified: head/usr.sbin/nscd/cachelib.c ============================================================================== --- head/usr.sbin/nscd/cachelib.c Sat Jun 13 00:56:17 2009 (r194096) +++ head/usr.sbin/nscd/cachelib.c Sat Jun 13 01:22:56 2009 (r194097) @@ -565,13 +565,13 @@ register_cache_entry(struct cache_ *the_ new_common_entry->params = (struct cache_entry_params *)&new_common_entry->common_params; - new_common_entry->common_params.entry_name = (char *)calloc(1, + new_common_entry->common_params.cep.entry_name = (char *)calloc(1, entry_name_size); - assert(new_common_entry->common_params.entry_name != NULL); - strlcpy(new_common_entry->common_params.entry_name, + assert(new_common_entry->common_params.cep.entry_name != NULL); + strlcpy(new_common_entry->common_params.cep.entry_name, params->entry_name, entry_name_size); new_common_entry->name = - new_common_entry->common_params.entry_name; + new_common_entry->common_params.cep.entry_name; HASHTABLE_INIT(&(new_common_entry->items), struct cache_ht_item_data_, data, @@ -619,12 +619,12 @@ register_cache_entry(struct cache_ *the_ new_mp_entry->params = (struct cache_entry_params *)&new_mp_entry->mp_params; - new_mp_entry->mp_params.entry_name = (char *)calloc(1, + new_mp_entry->mp_params.cep.entry_name = (char *)calloc(1, entry_name_size); - assert(new_mp_entry->mp_params.entry_name != NULL); - strlcpy(new_mp_entry->mp_params.entry_name, params->entry_name, + assert(new_mp_entry->mp_params.cep.entry_name != NULL); + strlcpy(new_mp_entry->mp_params.cep.entry_name, params->entry_name, entry_name_size); - new_mp_entry->name = new_mp_entry->mp_params.entry_name; + new_mp_entry->name = new_mp_entry->mp_params.cep.entry_name; TAILQ_INIT(&new_mp_entry->ws_head); TAILQ_INIT(&new_mp_entry->rs_head); Modified: head/usr.sbin/nscd/cachelib.h ============================================================================== --- head/usr.sbin/nscd/cachelib.h Sat Jun 13 00:56:17 2009 (r194096) +++ head/usr.sbin/nscd/cachelib.h Sat Jun 13 01:22:56 2009 (r194097) @@ -87,11 +87,8 @@ struct cache_entry_params /* params, used for most entries */ struct common_cache_entry_params { - /* inherited fields */ - enum cache_entry_t entry_type; + struct cache_entry_params cep; - /* unique fields */ - char *entry_name; size_t cache_entries_size; size_t max_elemsize; /* if 0 then no check is made */ @@ -105,9 +102,7 @@ struct common_cache_entry_params /* params, used for multipart entries */ struct mp_cache_entry_params { - /* inherited fields */ - enum cache_entry_t entry_type; - char *entry_name; + struct cache_entry_params cep; /* unique fields */ size_t max_elemsize; /* if 0 then no check is made */ Modified: head/usr.sbin/nscd/config.c ============================================================================== --- head/usr.sbin/nscd/config.c Sat Jun 13 00:56:17 2009 (r194096) +++ head/usr.sbin/nscd/config.c Sat Jun 13 01:22:56 2009 (r194097) @@ -176,14 +176,14 @@ create_configuration_entry(const char *n memcpy(&retval->mp_query_timeout, mp_timeout, sizeof(struct timeval)); - asprintf(&retval->positive_cache_params.entry_name, "%s+", name); - assert(retval->positive_cache_params.entry_name != NULL); + asprintf(&retval->positive_cache_params.cep.entry_name, "%s+", name); + assert(retval->positive_cache_params.cep.entry_name != NULL); - asprintf(&retval->negative_cache_params.entry_name, "%s-", name); - assert(retval->negative_cache_params.entry_name != NULL); + asprintf(&retval->negative_cache_params.cep.entry_name, "%s-", name); + assert(retval->negative_cache_params.cep.entry_name != NULL); - asprintf(&retval->mp_cache_params.entry_name, "%s*", name); - assert(retval->mp_cache_params.entry_name != NULL); + asprintf(&retval->mp_cache_params.cep.entry_name, "%s*", name); + assert(retval->mp_cache_params.cep.entry_name != NULL); TRACE_OUT(create_configuration_entry); return (retval); @@ -204,7 +204,7 @@ create_def_configuration_entry(const cha TRACE_IN(create_def_configuration_entry); memset(&positive_params, 0, sizeof(struct common_cache_entry_params)); - positive_params.entry_type = CET_COMMON; + positive_params.cep.entry_type = CET_COMMON; positive_params.cache_entries_size = DEFAULT_CACHE_HT_SIZE; positive_params.max_elemsize = DEFAULT_POSITIVE_ELEMENTS_SIZE; positive_params.satisf_elemsize = DEFAULT_POSITIVE_ELEMENTS_SIZE / 2; @@ -226,7 +226,7 @@ create_def_configuration_entry(const cha memset(&mp_params, 0, sizeof(struct mp_cache_entry_params)); - mp_params.entry_type = CET_MULTIPART; + mp_params.cep.entry_type = CET_MULTIPART; mp_params.max_elemsize = DEFAULT_MULTIPART_ELEMENTS_SIZE; mp_params.max_sessions = DEFAULT_MULITPART_SESSIONS_SIZE; mp_params.max_lifetime.tv_sec = DEFAULT_MULITPART_LIFETIME; @@ -248,9 +248,9 @@ destroy_configuration_entry(struct confi pthread_mutex_destroy(&entry->negative_cache_lock); pthread_mutex_destroy(&entry->mp_cache_lock); free(entry->name); - free(entry->positive_cache_params.entry_name); - free(entry->negative_cache_params.entry_name); - free(entry->mp_cache_params.entry_name); + free(entry->positive_cache_params.cep.entry_name); + free(entry->negative_cache_params.cep.entry_name); + free(entry->mp_cache_params.cep.entry_name); free(entry->mp_cache_entries); free(entry); TRACE_OUT(destroy_configuration_entry); Modified: head/usr.sbin/nscd/mp_rs_query.c ============================================================================== --- head/usr.sbin/nscd/mp_rs_query.c Sat Jun 13 00:56:17 2009 (r194096) +++ head/usr.sbin/nscd/mp_rs_query.c Sat Jun 13 01:22:56 2009 (r194097) @@ -198,7 +198,7 @@ on_mp_read_session_request_process(struc if (qstate->config_entry->perform_actual_lookups != 0) dec_cache_entry_name = strdup( - qstate->config_entry->mp_cache_params.entry_name); + qstate->config_entry->mp_cache_params.cep.entry_name); else { #ifdef NS_NSCD_EID_CHECKING if (check_query_eids(qstate) != 0) { @@ -208,7 +208,7 @@ on_mp_read_session_request_process(struc #endif asprintf(&dec_cache_entry_name, "%s%s", qstate->eid_str, - qstate->config_entry->mp_cache_params.entry_name); + qstate->config_entry->mp_cache_params.cep.entry_name); } assert(dec_cache_entry_name != NULL); Modified: head/usr.sbin/nscd/mp_ws_query.c ============================================================================== --- head/usr.sbin/nscd/mp_ws_query.c Sat Jun 13 00:56:17 2009 (r194096) +++ head/usr.sbin/nscd/mp_ws_query.c Sat Jun 13 01:22:56 2009 (r194097) @@ -216,7 +216,7 @@ on_mp_write_session_request_process(stru * cache entries - each with its own decorated name. */ asprintf(&dec_cache_entry_name, "%s%s", qstate->eid_str, - qstate->config_entry->mp_cache_params.entry_name); + qstate->config_entry->mp_cache_params.cep.entry_name); assert(dec_cache_entry_name != NULL); configuration_lock_rdlock(s_configuration); @@ -522,12 +522,12 @@ cache_entry register_new_mp_cache_entry( configuration_lock_entry(qstate->config_entry, CELT_MULTIPART); configuration_lock_wrlock(s_configuration); - en_bkp = qstate->config_entry->mp_cache_params.entry_name; - qstate->config_entry->mp_cache_params.entry_name = + en_bkp = qstate->config_entry->mp_cache_params.cep.entry_name; + qstate->config_entry->mp_cache_params.cep.entry_name = (char *)dec_cache_entry_name; register_cache_entry(s_cache, (struct cache_entry_params *) &qstate->config_entry->mp_cache_params); - qstate->config_entry->mp_cache_params.entry_name = en_bkp; + qstate->config_entry->mp_cache_params.cep.entry_name = en_bkp; configuration_unlock(s_configuration); configuration_lock_rdlock(s_configuration); Modified: head/usr.sbin/nscd/nscd.c ============================================================================== --- head/usr.sbin/nscd/nscd.c Sat Jun 13 00:56:17 2009 (r194096) +++ head/usr.sbin/nscd/nscd.c Sat Jun 13 01:22:56 2009 (r194097) @@ -123,14 +123,14 @@ init_cache_(struct configuration *config res = register_cache_entry(retval, (struct cache_entry_params *) &config_entry->positive_cache_params); config_entry->positive_cache_entry = find_cache_entry(retval, - config_entry->positive_cache_params.entry_name); + config_entry->positive_cache_params.cep.entry_name); assert(config_entry->positive_cache_entry != INVALID_CACHE_ENTRY); res = register_cache_entry(retval, (struct cache_entry_params *) &config_entry->negative_cache_params); config_entry->negative_cache_entry = find_cache_entry(retval, - config_entry->negative_cache_params.entry_name); + config_entry->negative_cache_params.cep.entry_name); assert(config_entry->negative_cache_entry != INVALID_CACHE_ENTRY); } Modified: head/usr.sbin/nscd/query.c ============================================================================== --- head/usr.sbin/nscd/query.c Sat Jun 13 00:56:17 2009 (r194096) +++ head/usr.sbin/nscd/query.c Sat Jun 13 01:22:56 2009 (r194097) @@ -437,7 +437,7 @@ on_write_request_process(struct query_st configuration_lock_rdlock(s_configuration); c_entry = find_cache_entry(s_cache, - qstate->config_entry->positive_cache_params.entry_name); + qstate->config_entry->positive_cache_params.cep.entry_name); configuration_unlock(s_configuration); if (c_entry != NULL) { configuration_lock_entry(qstate->config_entry, CELT_POSITIVE); @@ -518,7 +518,7 @@ on_negative_write_request_process(struct configuration_lock_rdlock(s_configuration); c_entry = find_cache_entry(s_cache, - qstate->config_entry->negative_cache_params.entry_name); + qstate->config_entry->negative_cache_params.cep.entry_name); configuration_unlock(s_configuration); if (c_entry != NULL) { configuration_lock_entry(qstate->config_entry, CELT_NEGATIVE); @@ -710,9 +710,9 @@ on_read_request_process(struct query_sta configuration_lock_rdlock(s_configuration); c_entry = find_cache_entry(s_cache, - qstate->config_entry->positive_cache_params.entry_name); + qstate->config_entry->positive_cache_params.cep.entry_name); neg_c_entry = find_cache_entry(s_cache, - qstate->config_entry->negative_cache_params.entry_name); + qstate->config_entry->negative_cache_params.cep.entry_name); configuration_unlock(s_configuration); if ((c_entry != NULL) && (neg_c_entry != NULL)) { configuration_lock_entry(qstate->config_entry, CELT_POSITIVE); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 01:23:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44898106564A; Sat, 13 Jun 2009 01:23:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 332D88FC17; Sat, 13 Jun 2009 01:23:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D1NYpr099023; Sat, 13 Jun 2009 01:23:34 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D1NYEC099022; Sat, 13 Jun 2009 01:23:34 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906130123.n5D1NYEC099022@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 01:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194098 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 01:23:36 -0000 Author: des Date: Sat Jun 13 01:23:34 2009 New Revision: 194098 URL: http://svn.freebsd.org/changeset/base/194098 Log: nscd builds cleanly at WARNS level 3. MFC after: 1 week Modified: head/usr.sbin/nscd/Makefile Modified: head/usr.sbin/nscd/Makefile ============================================================================== --- head/usr.sbin/nscd/Makefile Sat Jun 13 01:22:56 2009 (r194097) +++ head/usr.sbin/nscd/Makefile Sat Jun 13 01:23:34 2009 (r194098) @@ -3,8 +3,7 @@ PROG= nscd MAN= nscd.conf.5 nscd.8 -WARNS?= 2 -CFLAGS+=-fno-strict-aliasing +WARNS?= 3 SRCS= agent.c nscd.c nscdcli.c cachelib.c cacheplcs.c debug.c log.c \ config.c query.c mp_ws_query.c mp_rs_query.c singletons.c protocol.c \ parser.c From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 01:49:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52230106568A; Sat, 13 Jun 2009 01:49:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id C6CAB8FC1F; Sat, 13 Jun 2009 01:49:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5D1ngHr025694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 13 Jun 2009 11:49:44 +1000 Date: Sat, 13 Jun 2009 11:49:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200906121813.n5CIDY1c089109@svn.freebsd.org> Message-ID: <20090613113554.E22985@delplex.bde.org> References: <200906121813.n5CIDY1c089109@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194071 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 01:49:46 -0000 On Fri, 12 Jun 2009, John Baldwin wrote: > Log: > - Note that these interfaces require for the structure > definitions. This should be noted somewhere other than in the synopsis. Struct definitions may or may not be needed for using a function, but one place where they are certainly not needed is for calling a function (unless the API involves complete structs or the public header is missing a forward declaration). Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 04:56:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7413B106564A; Sat, 13 Jun 2009 04:56:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611668FC0A; Sat, 13 Jun 2009 04:56:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D4ukOY003383; Sat, 13 Jun 2009 04:56:46 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D4uj5w003374; Sat, 13 Jun 2009 04:56:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906130456.n5D4uj5w003374@svn.freebsd.org> From: Andrew Thompson Date: Sat, 13 Jun 2009 04:56: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: r194099 - in head/sys/dev/usb: . input serial storage wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 04:56:47 -0000 Author: thompsa Date: Sat Jun 13 04:56:45 2009 New Revision: 194099 URL: http://svn.freebsd.org/changeset/base/194099 Log: Make variables static where appropriate. Found by: cscout Modified: head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/wlan/if_urtw.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/input/ukbd.c Sat Jun 13 04:56:45 2009 (r194099) @@ -1562,7 +1562,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int #endif /* UKBD_EMULATE_ATSCANCODE */ -keyboard_switch_t ukbdsw = { +static keyboard_switch_t ukbdsw = { .probe = &ukbd__probe, .init = &ukbd_init, .term = &ukbd_term, Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/serial/uchcom.c Sat Jun 13 04:56:45 2009 (r194099) @@ -257,7 +257,7 @@ static const struct usb_config uchcom_co }, }; -struct ucom_callback uchcom_callback = { +static struct ucom_callback uchcom_callback = { .usb2_com_cfg_get_status = &uchcom_cfg_get_status, .usb2_com_cfg_set_dtr = &uchcom_cfg_set_dtr, .usb2_com_cfg_set_rts = &uchcom_cfg_set_rts, Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/serial/ufoma.c Sat Jun 13 04:56:45 2009 (r194099) @@ -1103,7 +1103,7 @@ ufoma_stop_write(struct ucom_softc *ucom } } -struct umcpc_modetostr_tab{ +static struct umcpc_modetostr_tab{ int mode; char *str; }umcpc_modetostr_tab[]={ Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/serial/uplcom.c Sat Jun 13 04:56:45 2009 (r194099) @@ -214,7 +214,7 @@ static const struct usb_config uplcom_co }, }; -struct ucom_callback uplcom_callback = { +static struct ucom_callback uplcom_callback = { .usb2_com_cfg_get_status = &uplcom_cfg_get_status, .usb2_com_cfg_set_dtr = &uplcom_cfg_set_dtr, .usb2_com_cfg_set_rts = &uplcom_cfg_set_rts, Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/serial/uslcom.c Sat Jun 13 04:56:45 2009 (r194099) @@ -143,7 +143,7 @@ static const struct usb_config uslcom_co }, }; -struct ucom_callback uslcom_callback = { +static struct ucom_callback uslcom_callback = { .usb2_com_cfg_open = &uslcom_open, .usb2_com_cfg_close = &uslcom_close, .usb2_com_cfg_get_status = &uslcom_get_status, Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/storage/umass.c Sat Jun 13 04:56:45 2009 (r194099) @@ -1074,7 +1074,7 @@ static void umass_dump_buffer(struct uma uint32_t); #endif -struct usb_config umass_bbb_config[UMASS_T_BBB_MAX] = { +static struct usb_config umass_bbb_config[UMASS_T_BBB_MAX] = { [UMASS_T_BBB_RESET1] = { .type = UE_CONTROL, @@ -1164,7 +1164,7 @@ struct usb_config umass_bbb_config[UMASS }, }; -struct usb_config umass_cbi_config[UMASS_T_CBI_MAX] = { +static struct usb_config umass_cbi_config[UMASS_T_CBI_MAX] = { [UMASS_T_CBI_RESET1] = { .type = UE_CONTROL, Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/storage/ustorage_fs.c Sat Jun 13 04:56:45 2009 (r194099) @@ -254,7 +254,7 @@ DRIVER_MODULE(ustorage_fs, uhub, ustorag MODULE_VERSION(ustorage_fs, 0); MODULE_DEPEND(ustorage_fs, usb, 1, 1, 1); -struct usb_config ustorage_fs_bbb_config[USTORAGE_FS_T_BBB_MAX] = { +static struct usb_config ustorage_fs_bbb_config[USTORAGE_FS_T_BBB_MAX] = { [USTORAGE_FS_T_BBB_COMMAND] = { .type = UE_BULK, Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/usb_dev.c Sat Jun 13 04:56:45 2009 (r194099) @@ -120,7 +120,7 @@ struct cdevsw usb2_devsw = { static struct cdev* usb2_dev = NULL; /* character device structure used for /dev/usb */ -struct cdevsw usb2_static_devsw = { +static struct cdevsw usb2_static_devsw = { .d_version = D_VERSION, .d_ioctl = usb2_static_ioctl, .d_name = "usb" Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sat Jun 13 01:23:34 2009 (r194098) +++ head/sys/dev/usb/wlan/if_urtw.c Sat Jun 13 04:56:45 2009 (r194099) @@ -93,7 +93,7 @@ enum { (void) sc; \ } while (0) #endif -int urtw_preamble_mode = URTW_PREAMBLE_MODE_LONG; +static int urtw_preamble_mode = URTW_PREAMBLE_MODE_LONG; SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW, &urtw_preamble_mode, 0, "set the preable mode (long or short)"); TUNABLE_INT("hw.usb.urtw.preamble_mode", &urtw_preamble_mode); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 06:39:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 777D3106564A; Sat, 13 Jun 2009 06:39:05 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1DA608FC0C; Sat, 13 Jun 2009 06:39:03 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA18376; Sat, 13 Jun 2009 09:39:02 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1] helo=edge.pp.kiev.ua) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1MFMtK-000MHO-0e; Sat, 13 Jun 2009 09:39:02 +0300 Message-ID: <4A334984.70205@freebsd.org> Date: Sat, 13 Jun 2009 09:39:00 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.21 (X11/20090406) MIME-Version: 1.0 To: Juli Mallett References: <200906122249.n5CMnZBm095301@svn.freebsd.org> In-Reply-To: <200906122249.n5CMnZBm095301@svn.freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194082 - in head/sys/mips: malta mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 06:39:05 -0000 on 13/06/2009 01:49 Juli Mallett said the following: > Author: jmallett > Date: Fri Jun 12 22:49:35 2009 > New Revision: 194082 > URL: http://svn.freebsd.org/changeset/base/194082 > > Log: > Fix MALTA build; some prototypes were wrong and blew up when kobj method > signature checking was turned on. So I totally missed mips arch when I did kobj stuff. Sorry about that and thanks for fixing! -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 08:57:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4AAE106566C; Sat, 13 Jun 2009 08:57:05 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C23588FC12; Sat, 13 Jun 2009 08:57:05 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D8v54G007962; Sat, 13 Jun 2009 08:57:05 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5D8v5mM007958; Sat, 13 Jun 2009 08:57:05 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200906130857.n5D8v5mM007958@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 13 Jun 2009 08:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194101 - in head/sys: dev/sec dev/tsec powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 08:57:06 -0000 Author: raj Date: Sat Jun 13 08:57:04 2009 New Revision: 194101 URL: http://svn.freebsd.org/changeset/base/194101 Log: Fix Book-E/MPC85XX build. Some prototypes were wrong and got revealed with the recent kobj signature checking. Modified: head/sys/dev/sec/sec.c head/sys/dev/tsec/if_tsec.c head/sys/dev/tsec/if_tsec.h head/sys/powerpc/booke/pmap.c Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Sat Jun 13 08:04:56 2009 (r194100) +++ head/sys/dev/sec/sec.c Sat Jun 13 08:57:04 2009 (r194101) @@ -58,7 +58,7 @@ static int sec_attach(device_t dev); static int sec_detach(device_t dev); static int sec_suspend(device_t dev); static int sec_resume(device_t dev); -static void sec_shutdown(device_t dev); +static int sec_shutdown(device_t dev); static void sec_primary_intr(void *arg); static void sec_secondary_intr(void *arg); static int sec_setup_intr(struct sec_softc *sc, struct resource **ires, @@ -500,9 +500,11 @@ sec_resume(device_t dev) return (0); } -static void +static int sec_shutdown(device_t dev) { + + return (0); } static int Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Sat Jun 13 08:04:56 2009 (r194100) +++ head/sys/dev/tsec/if_tsec.c Sat Jun 13 08:57:04 2009 (r194101) @@ -313,7 +313,7 @@ tsec_detach(struct tsec_softc *sc) return (0); } -void +int tsec_shutdown(device_t dev) { struct tsec_softc *sc; @@ -323,6 +323,7 @@ tsec_shutdown(device_t dev) TSEC_GLOBAL_LOCK(sc); tsec_stop(sc); TSEC_GLOBAL_UNLOCK(sc); + return (0); } int @@ -1582,7 +1583,7 @@ tsec_miibus_readreg(device_t dev, int ph return (TSEC_READ(sc, TSEC_REG_MIIMSTAT)); } -void +int tsec_miibus_writereg(device_t dev, int phy, int reg, int value) { struct tsec_softc *sc; @@ -1606,6 +1607,8 @@ tsec_miibus_writereg(device_t dev, int p if (timeout == 0) device_printf(dev, "Timeout while writing to PHY!\n"); + + return (0); } void Modified: head/sys/dev/tsec/if_tsec.h ============================================================================== --- head/sys/dev/tsec/if_tsec.h Sat Jun 13 08:04:56 2009 (r194100) +++ head/sys/dev/tsec/if_tsec.h Sat Jun 13 08:57:04 2009 (r194101) @@ -358,10 +358,10 @@ void tsec_receive_intr(void *arg); void tsec_transmit_intr(void *arg); int tsec_miibus_readreg(device_t dev, int phy, int reg); -void tsec_miibus_writereg(device_t dev, int phy, int reg, int value); +int tsec_miibus_writereg(device_t dev, int phy, int reg, int value); void tsec_miibus_statchg(device_t dev); int tsec_resume(device_t dev); /* XXX */ -void tsec_shutdown(device_t dev); +int tsec_shutdown(device_t dev); int tsec_suspend(device_t dev); /* XXX */ void tsec_get_hwaddr(struct tsec_softc *sc, uint8_t *addr); Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Jun 13 08:04:56 2009 (r194100) +++ head/sys/powerpc/booke/pmap.c Sat Jun 13 08:57:04 2009 (r194101) @@ -275,8 +275,8 @@ void pmap_bootstrap_ap(volatile uint32_t static void mmu_booke_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t); static void mmu_booke_clear_modify(mmu_t, vm_page_t); static void mmu_booke_clear_reference(mmu_t, vm_page_t); -static void mmu_booke_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, - vm_offset_t); +static void mmu_booke_copy(mmu_t, pmap_t, pmap_t, vm_offset_t, + vm_size_t, vm_offset_t); static void mmu_booke_copy_page(mmu_t, vm_page_t, vm_page_t); static void mmu_booke_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t); @@ -1890,8 +1890,8 @@ mmu_booke_deactivate(mmu_t mmu, struct t * This routine is only advisory and need not do anything. */ static void -mmu_booke_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, - vm_size_t len, vm_offset_t src_addr) +mmu_booke_copy(mmu_t mmu, pmap_t dst_pmap, pmap_t src_pmap, + vm_offset_t dst_addr, vm_size_t len, vm_offset_t src_addr) { } From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 11:18:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5323210656D2; Sat, 13 Jun 2009 11:18:48 +0000 (UTC) (envelope-from sanpei@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4164C8FC14; Sat, 13 Jun 2009 11:18:48 +0000 (UTC) (envelope-from sanpei@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DBImv6012352; Sat, 13 Jun 2009 11:18:48 GMT (envelope-from sanpei@svn.freebsd.org) Received: (from sanpei@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DBImKl012351; Sat, 13 Jun 2009 11:18:48 GMT (envelope-from sanpei@svn.freebsd.org) Message-Id: <200906131118.n5DBImKl012351@svn.freebsd.org> From: MIHIRA Sanpei Yoshiro Date: Sat, 13 Jun 2009 11:18: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: r194102 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 11:18:48 -0000 Author: sanpei Date: Sat Jun 13 11:18:47 2009 New Revision: 194102 URL: http://svn.freebsd.org/changeset/base/194102 Log: Correct entry of vendor ID 0x0d8c. It's C-Media, not ABC. Obtained from: NetBSD usbdevs rev.1.418 Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Jun 13 08:57:04 2009 (r194101) +++ head/sys/dev/usb/usbdevs Sat Jun 13 11:18:47 2009 (r194102) @@ -514,7 +514,7 @@ vendor TANGTOP 0x0d3d Tangtop vendor SMC3 0x0d5c Standard Microsystems vendor ADDON 0x0d7d Add-on Technology vendor ACDC 0x0d7e American Computer & Digital Components -vendor ABC 0x0d8c ABC +vendor CMEDIA 0x0d8c CMEDIA vendor CONCEPTRONIC 0x0d8e Conceptronic vendor SKANHEX 0x0d96 Skanhex Technology, Inc. vendor MSI 0x0db0 Micro Star International From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 12:23:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25E6F106566B; Sat, 13 Jun 2009 12:23:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1330E8FC18; Sat, 13 Jun 2009 12:23:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DCNVpE013490; Sat, 13 Jun 2009 12:23:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DCNV1X013489; Sat, 13 Jun 2009 12:23:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906131223.n5DCNV1X013489@svn.freebsd.org> From: Ed Schouten Date: Sat, 13 Jun 2009 12:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194103 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 12:23:32 -0000 Author: ed Date: Sat Jun 13 12:23:31 2009 New Revision: 194103 URL: http://svn.freebsd.org/changeset/base/194103 Log: Make the proof-of-concept UTF-8 support in Syscons less useless. Add a small Unicode-to-CP437 remapping table to at least demonstrate that the terminal emulator is perfectly capable of handling UTF-8. This will of course break if the user loads a different font map, but it at least allows people to give it a try. I can now see the box drawing in dialog(1) and the arrows in mutt(1) correctly. Modified: head/sys/dev/syscons/scterm-teken.c Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sat Jun 13 11:18:47 2009 (r194102) +++ head/sys/dev/syscons/scterm-teken.c Sat Jun 13 12:23:31 2009 (r194103) @@ -335,6 +335,121 @@ scteken_cursor(void *arg, const teken_po sc_move_cursor(scp, p->tp_col, p->tp_row); } +#ifdef TEKEN_UTF8 +struct unicp437 { + uint16_t unicode_base; + uint8_t cp437_base; + uint8_t length; +}; + +static const struct unicp437 cp437table[] = { + { 0x0020, 0x20, 0x5e }, { 0x00a1, 0xad, 0x00 }, + { 0x00a2, 0x9b, 0x00 }, { 0x00a3, 0x9c, 0x00 }, + { 0x00a5, 0x9d, 0x00 }, { 0x00a7, 0x15, 0x00 }, + { 0x00aa, 0xa6, 0x00 }, { 0x00ab, 0xae, 0x00 }, + { 0x00ac, 0xaa, 0x00 }, { 0x00b0, 0xf8, 0x00 }, + { 0x00b1, 0xf1, 0x00 }, { 0x00b2, 0xfd, 0x00 }, + { 0x00b5, 0xe6, 0x00 }, { 0x00b6, 0x14, 0x00 }, + { 0x00b7, 0xfa, 0x00 }, { 0x00ba, 0xa7, 0x00 }, + { 0x00bb, 0xaf, 0x00 }, { 0x00bc, 0xac, 0x00 }, + { 0x00bd, 0xab, 0x00 }, { 0x00bf, 0xa8, 0x00 }, + { 0x00c4, 0x8e, 0x01 }, { 0x00c6, 0x92, 0x00 }, + { 0x00c7, 0x80, 0x00 }, { 0x00c9, 0x90, 0x00 }, + { 0x00d1, 0xa5, 0x00 }, { 0x00d6, 0x99, 0x00 }, + { 0x00dc, 0x9a, 0x00 }, { 0x00df, 0xe1, 0x00 }, + { 0x00e0, 0x85, 0x00 }, { 0x00e1, 0xa0, 0x00 }, + { 0x00e2, 0x83, 0x00 }, { 0x00e4, 0x84, 0x00 }, + { 0x00e5, 0x86, 0x00 }, { 0x00e6, 0x91, 0x00 }, + { 0x00e7, 0x87, 0x00 }, { 0x00e8, 0x8a, 0x00 }, + { 0x00e9, 0x82, 0x00 }, { 0x00ea, 0x88, 0x01 }, + { 0x00ec, 0x8d, 0x00 }, { 0x00ed, 0xa1, 0x00 }, + { 0x00ee, 0x8c, 0x00 }, { 0x00ef, 0x8b, 0x00 }, + { 0x00f1, 0xa4, 0x00 }, { 0x00f2, 0x95, 0x00 }, + { 0x00f3, 0xa2, 0x00 }, { 0x00f4, 0x93, 0x00 }, + { 0x00f6, 0x94, 0x00 }, { 0x00f7, 0xf6, 0x00 }, + { 0x00f9, 0x97, 0x00 }, { 0x00fa, 0xa3, 0x00 }, + { 0x00fb, 0x96, 0x00 }, { 0x00fc, 0x81, 0x00 }, + { 0x00ff, 0x98, 0x00 }, { 0x0192, 0x9f, 0x00 }, + { 0x0393, 0xe2, 0x00 }, { 0x0398, 0xe9, 0x00 }, + { 0x03a3, 0xe4, 0x00 }, { 0x03a6, 0xe8, 0x00 }, + { 0x03a9, 0xea, 0x00 }, { 0x03b1, 0xe0, 0x00 }, + { 0x03b4, 0xeb, 0x00 }, { 0x03b5, 0xee, 0x00 }, + { 0x03c0, 0xe3, 0x00 }, { 0x03c3, 0xe5, 0x00 }, + { 0x03c4, 0xe7, 0x00 }, { 0x03c6, 0xed, 0x00 }, + { 0x203c, 0x13, 0x00 }, { 0x207f, 0xfc, 0x00 }, + { 0x20a7, 0x9e, 0x00 }, { 0x2190, 0x1b, 0x00 }, + { 0x2191, 0x18, 0x00 }, { 0x2192, 0x1a, 0x00 }, + { 0x2193, 0x19, 0x00 }, { 0x2194, 0x1d, 0x00 }, + { 0x2195, 0x12, 0x00 }, { 0x21a8, 0x17, 0x00 }, + { 0x2219, 0xf9, 0x00 }, { 0x221a, 0xfb, 0x00 }, + { 0x221e, 0xec, 0x00 }, { 0x221f, 0x1c, 0x00 }, + { 0x2229, 0xef, 0x00 }, { 0x2248, 0xf7, 0x00 }, + { 0x2261, 0xf0, 0x00 }, { 0x2264, 0xf3, 0x00 }, + { 0x2265, 0xf2, 0x00 }, { 0x2302, 0x7f, 0x00 }, + { 0x2310, 0xa9, 0x00 }, { 0x2320, 0xf4, 0x00 }, + { 0x2321, 0xf5, 0x00 }, { 0x2500, 0xc4, 0x00 }, + { 0x2502, 0xb3, 0x00 }, { 0x250c, 0xda, 0x00 }, + { 0x2510, 0xbf, 0x00 }, { 0x2514, 0xc0, 0x00 }, + { 0x2518, 0xd9, 0x00 }, { 0x251c, 0xc3, 0x00 }, + { 0x2524, 0xb4, 0x00 }, { 0x252c, 0xc2, 0x00 }, + { 0x2534, 0xc1, 0x00 }, { 0x253c, 0xc5, 0x00 }, + { 0x2550, 0xcd, 0x00 }, { 0x2551, 0xba, 0x00 }, + { 0x2552, 0xd5, 0x00 }, { 0x2553, 0xd6, 0x00 }, + { 0x2554, 0xc9, 0x00 }, { 0x2555, 0xb8, 0x00 }, + { 0x2556, 0xb7, 0x00 }, { 0x2557, 0xbb, 0x00 }, + { 0x2558, 0xd4, 0x00 }, { 0x2559, 0xd3, 0x00 }, + { 0x255a, 0xc8, 0x00 }, { 0x255b, 0xbe, 0x00 }, + { 0x255c, 0xbd, 0x00 }, { 0x255d, 0xbc, 0x00 }, + { 0x255e, 0xc6, 0x01 }, { 0x2560, 0xcc, 0x00 }, + { 0x2561, 0xb5, 0x00 }, { 0x2562, 0xb6, 0x00 }, + { 0x2563, 0xb9, 0x00 }, { 0x2564, 0xd1, 0x01 }, + { 0x2566, 0xcb, 0x00 }, { 0x2567, 0xcf, 0x00 }, + { 0x2568, 0xd0, 0x00 }, { 0x2569, 0xca, 0x00 }, + { 0x256a, 0xd8, 0x00 }, { 0x256b, 0xd7, 0x00 }, + { 0x256c, 0xce, 0x00 }, { 0x2580, 0xdf, 0x00 }, + { 0x2584, 0xdc, 0x00 }, { 0x2588, 0xdb, 0x00 }, + { 0x258c, 0xdd, 0x00 }, { 0x2590, 0xde, 0x00 }, + { 0x2591, 0xb0, 0x02 }, { 0x25a0, 0xfe, 0x00 }, + { 0x25ac, 0x16, 0x00 }, { 0x25b2, 0x1e, 0x00 }, + { 0x25ba, 0x10, 0x00 }, { 0x25bc, 0x1f, 0x00 }, + { 0x25c4, 0x11, 0x00 }, { 0x263a, 0x01, 0x01 }, + { 0x263c, 0x0f, 0x00 }, { 0x2660, 0x06, 0x00 }, + { 0x2663, 0x05, 0x00 }, { 0x2665, 0x03, 0x01 }, + { 0x266b, 0x0e, 0x00 }, +}; + +static void +scteken_get_cp437(teken_char_t *c, int *attr) +{ + int min, mid, max; + + min = 0; + max = (sizeof(cp437table) / sizeof(struct unicp437)) - 1; + + if (*c < cp437table[0].unicode_base || + *c > cp437table[max].unicode_base + cp437table[max].length) + goto bad; + + while (max >= min) { + mid = (min + max) / 2; + if (*c < cp437table[mid].unicode_base) { + max = mid - 1; + } else if (*c > cp437table[mid].unicode_base + + cp437table[mid].length) { + min = mid + 1; + } else { + *c -= cp437table[mid].unicode_base; + *c += cp437table[mid].cp437_base; + return; + } + } +bad: + /* Character not present in CP437. */ + *attr = (FG_RED|BG_BLACK) << 8; + *c = '?'; +} +#endif /* TEKEN_UTF8 */ + static void scteken_putchar(void *arg, const teken_pos_t *tp, teken_char_t c, const teken_attr_t *a) @@ -345,17 +460,11 @@ scteken_putchar(void *arg, const teken_p vm_offset_t p; int cursor, attr; + attr = scteken_attr(a) << 8; #ifdef TEKEN_UTF8 - if (c >= 0x80) { - /* XXX: Don't display UTF-8 yet. */ - attr = (FG_YELLOW|BG_RED) << 8; - ch = '?'; - } else + scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ - { - attr = scteken_attr(a) << 8; - ch = c; - } + ch = c; map = scp->sc->scr_map; @@ -381,17 +490,11 @@ scteken_fill(void *arg, const teken_rect unsigned int width; int attr, row; + attr = scteken_attr(a) << 8; #ifdef TEKEN_UTF8 - if (c >= 0x80) { - /* XXX: Don't display UTF-8 yet. */ - attr = (FG_YELLOW|BG_RED) << 8; - ch = '?'; - } else + scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ - { - attr = scteken_attr(a) << 8; - ch = c; - } + ch = c; map = scp->sc->scr_map; From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 13:07:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B112C1065674; Sat, 13 Jun 2009 13:07:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DE9E8FC17; Sat, 13 Jun 2009 13:07:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DD7v9j014450; Sat, 13 Jun 2009 13:07:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DD7vGZ014437; Sat, 13 Jun 2009 13:07:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906131307.n5DD7vGZ014437@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 13:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194104 - in head/usr.sbin/nscd: . agents X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 13:07:58 -0000 Author: des Date: Sat Jun 13 13:07:56 2009 New Revision: 194104 URL: http://svn.freebsd.org/changeset/base/194104 Log: Remove casts from {c,m,re}alloc() and simplify sizeof(). MFC after: 1 week Modified: head/usr.sbin/nscd/agent.c head/usr.sbin/nscd/agents/group.c head/usr.sbin/nscd/agents/passwd.c head/usr.sbin/nscd/agents/services.c head/usr.sbin/nscd/cachelib.c head/usr.sbin/nscd/cacheplcs.c head/usr.sbin/nscd/config.c head/usr.sbin/nscd/hashtable.h head/usr.sbin/nscd/mp_rs_query.c head/usr.sbin/nscd/mp_ws_query.c head/usr.sbin/nscd/nscd.c head/usr.sbin/nscd/nscdcli.c head/usr.sbin/nscd/query.c Modified: head/usr.sbin/nscd/agent.c ============================================================================== --- head/usr.sbin/nscd/agent.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/agent.c Sat Jun 13 13:07:56 2009 (r194104) @@ -61,7 +61,7 @@ init_agent_table(void) struct agent_table *retval; TRACE_IN(init_agent_table); - retval = (struct agent_table *)calloc(1, sizeof(struct agent_table)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); TRACE_OUT(init_agent_table); @@ -78,7 +78,7 @@ register_agent(struct agent_table *at, s assert(at != NULL); assert(a != NULL); new_agents_num = at->agents_num + 1; - new_agents = (struct agent **)malloc(sizeof(struct agent *) * + new_agents = malloc(sizeof(*new_agents) * new_agents_num); assert(new_agents != NULL); memcpy(new_agents, at->agents, at->agents_num * sizeof(struct agent *)); Modified: head/usr.sbin/nscd/agents/group.c ============================================================================== --- head/usr.sbin/nscd/agents/group.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/agents/group.c Sat Jun 13 13:07:56 2009 (r194104) @@ -141,7 +141,7 @@ group_lookup_func(const char *key, size_ switch (lookup_type) { case nss_lt_name: size = key_size - sizeof(enum nss_lookup_type) + 1; - name = (char *)calloc(1, size); + name = calloc(1, size); assert(name != NULL); memcpy(name, key + sizeof(enum nss_lookup_type), size - 1); break; @@ -175,7 +175,7 @@ group_lookup_func(const char *key, size_ if (result != NULL) { group_marshal_func(result, NULL, buffer_size); - *buffer = (char *)malloc(*buffer_size); + *buffer = malloc(*buffer_size); assert(*buffer != NULL); group_marshal_func(result, *buffer, buffer_size); } @@ -203,7 +203,7 @@ group_mp_lookup_func(char **buffer, size result = getgrent(); if (result != NULL) { group_marshal_func(result, NULL, buffer_size); - *buffer = (char *)malloc(*buffer_size); + *buffer = malloc(*buffer_size); assert(*buffer != NULL); group_marshal_func(result, *buffer, buffer_size); } @@ -225,7 +225,7 @@ init_group_agent(void) struct common_agent *retval; TRACE_IN(init_group_agent); - retval = (struct common_agent *)calloc(1, sizeof(struct common_agent)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->parent.name = strdup("group"); @@ -244,8 +244,8 @@ init_group_mp_agent(void) struct multipart_agent *retval; TRACE_IN(init_group_mp_agent); - retval = (struct multipart_agent *)calloc(1, - sizeof(struct multipart_agent)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); retval->parent.name = strdup("group"); Modified: head/usr.sbin/nscd/agents/passwd.c ============================================================================== --- head/usr.sbin/nscd/agents/passwd.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/agents/passwd.c Sat Jun 13 13:07:56 2009 (r194104) @@ -150,7 +150,7 @@ passwd_lookup_func(const char *key, size switch (lookup_type) { case nss_lt_name: size = key_size - sizeof(enum nss_lookup_type) + 1; - login = (char *)calloc(1, size); + login = calloc(1, size); assert(login != NULL); memcpy(login, key + sizeof(enum nss_lookup_type), size - 1); break; @@ -183,7 +183,7 @@ passwd_lookup_func(const char *key, size if (result != NULL) { passwd_marshal_func(result, NULL, buffer_size); - *buffer = (char *)malloc(*buffer_size); + *buffer = malloc(*buffer_size); assert(*buffer != NULL); passwd_marshal_func(result, *buffer, buffer_size); } @@ -211,7 +211,7 @@ passwd_mp_lookup_func(char **buffer, siz result = getpwent(); if (result != NULL) { passwd_marshal_func(result, NULL, buffer_size); - *buffer = (char *)malloc(*buffer_size); + *buffer = malloc(*buffer_size); assert(*buffer != NULL); passwd_marshal_func(result, *buffer, buffer_size); } @@ -233,7 +233,7 @@ init_passwd_agent(void) struct common_agent *retval; TRACE_IN(init_passwd_agent); - retval = (struct common_agent *)calloc(1, sizeof(struct common_agent)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->parent.name = strdup("passwd"); @@ -252,8 +252,8 @@ init_passwd_mp_agent(void) struct multipart_agent *retval; TRACE_IN(init_passwd_mp_agent); - retval = (struct multipart_agent *)calloc(1, - sizeof(struct multipart_agent)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); retval->parent.name = strdup("passwd"); Modified: head/usr.sbin/nscd/agents/services.c ============================================================================== --- head/usr.sbin/nscd/agents/services.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/agents/services.c Sat Jun 13 13:07:56 2009 (r194104) @@ -146,7 +146,7 @@ services_lookup_func(const char *key, si switch (lookup_type) { case nss_lt_name: size = key_size - sizeof(enum nss_lookup_type); - name = (char *)calloc(1, size + 1); + name = calloc(1, size + 1); assert(name != NULL); memcpy(name, key + sizeof(enum nss_lookup_type), size); @@ -169,7 +169,7 @@ services_lookup_func(const char *key, si size = key_size - sizeof(enum nss_lookup_type) - sizeof(int); if (size > 0) { - proto = (char *)calloc(1, size + 1); + proto = calloc(1, size + 1); assert(proto != NULL); memcpy(proto, key + sizeof(enum nss_lookup_type) + sizeof(int), size); @@ -196,7 +196,7 @@ services_lookup_func(const char *key, si if (result != NULL) { services_marshal_func(result, NULL, buffer_size); - *buffer = (char *)malloc(*buffer_size); + *buffer = malloc(*buffer_size); assert(*buffer != NULL); services_marshal_func(result, *buffer, buffer_size); } @@ -224,7 +224,7 @@ services_mp_lookup_func(char **buffer, s result = getservent(); if (result != NULL) { services_marshal_func(result, NULL, buffer_size); - *buffer = (char *)malloc(*buffer_size); + *buffer = malloc(*buffer_size); assert(*buffer != NULL); services_marshal_func(result, *buffer, buffer_size); } @@ -246,7 +246,7 @@ init_services_agent(void) struct common_agent *retval; TRACE_IN(init_services_agent); - retval = (struct common_agent *)calloc(1, sizeof(struct common_agent)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->parent.name = strdup("services"); @@ -265,8 +265,8 @@ init_services_mp_agent(void) struct multipart_agent *retval; TRACE_IN(init_services_mp_agent); - retval = (struct multipart_agent *)calloc(1, - sizeof(struct multipart_agent)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); retval->parent.name = strdup("services"); Modified: head/usr.sbin/nscd/cachelib.c ============================================================================== --- head/usr.sbin/nscd/cachelib.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/cachelib.c Sat Jun 13 13:07:56 2009 (r194104) @@ -481,14 +481,14 @@ init_cache(struct cache_params const *pa TRACE_IN(init_cache); assert(params != NULL); - retval = (struct cache_ *)calloc(1, sizeof(struct cache_)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); assert(params != NULL); memcpy(&retval->params, params, sizeof(struct cache_params)); - retval->entries = (struct cache_entry_ **)calloc(1, - sizeof(struct cache_entry_ *) * INITIAL_ENTRIES_CAPACITY); + retval->entries = calloc(1, + sizeof(*retval->entries) * INITIAL_ENTRIES_CAPACITY); assert(retval->entries != NULL); retval->entries_capacity = INITIAL_ENTRIES_CAPACITY; @@ -540,8 +540,8 @@ register_cache_entry(struct cache_ *the_ new_capacity = the_cache->entries_capacity + ENTRIES_CAPACITY_STEP; - new_entries = (struct cache_entry_ **)calloc(1, - sizeof(struct cache_entry_ *) * new_capacity); + new_entries = calloc(1, + sizeof(*new_entries) * new_capacity); assert(new_entries != NULL); memcpy(new_entries, the_cache->entries, @@ -556,8 +556,8 @@ register_cache_entry(struct cache_ *the_ switch (params->entry_type) { case CET_COMMON: - new_common_entry = (struct cache_common_entry_ *)calloc(1, - sizeof(struct cache_common_entry_)); + new_common_entry = calloc(1, + sizeof(*new_common_entry)); assert(new_common_entry != NULL); memcpy(&new_common_entry->common_params, params, @@ -565,7 +565,7 @@ register_cache_entry(struct cache_ *the_ new_common_entry->params = (struct cache_entry_params *)&new_common_entry->common_params; - new_common_entry->common_params.cep.entry_name = (char *)calloc(1, + new_common_entry->common_params.cep.entry_name = calloc(1, entry_name_size); assert(new_common_entry->common_params.cep.entry_name != NULL); strlcpy(new_common_entry->common_params.cep.entry_name, @@ -582,8 +582,8 @@ register_cache_entry(struct cache_ *the_ else policies_size = 2; - new_common_entry->policies = (struct cache_policy_ **)calloc(1, - sizeof(struct cache_policy_ *) * policies_size); + new_common_entry->policies = calloc(1, + sizeof(*new_common_entry->policies) * policies_size); assert(new_common_entry->policies != NULL); new_common_entry->policies_size = policies_size; @@ -610,8 +610,8 @@ register_cache_entry(struct cache_ *the_ (struct cache_entry_ *)new_common_entry; break; case CET_MULTIPART: - new_mp_entry = (struct cache_mp_entry_ *)calloc(1, - sizeof(struct cache_mp_entry_)); + new_mp_entry = calloc(1, + sizeof(*new_mp_entry)); assert(new_mp_entry != NULL); memcpy(&new_mp_entry->mp_params, params, @@ -619,7 +619,7 @@ register_cache_entry(struct cache_ *the_ new_mp_entry->params = (struct cache_entry_params *)&new_mp_entry->mp_params; - new_mp_entry->mp_params.cep.entry_name = (char *)calloc(1, + new_mp_entry->mp_params.cep.entry_name = calloc(1, entry_name_size); assert(new_mp_entry->mp_params.cep.entry_name != NULL); strlcpy(new_mp_entry->mp_params.cep.entry_name, params->entry_name, @@ -830,10 +830,10 @@ cache_write(struct cache_entry_ *entry, return (-1); } - item_data.key = (char *)malloc(key_size); + item_data.key = malloc(key_size); memcpy(item_data.key, key, key_size); - item_data.value = (char *)malloc(value_size); + item_data.value = malloc(value_size); assert(item_data.value != NULL); memcpy(item_data.value, value, value_size); @@ -912,8 +912,8 @@ open_cache_mp_write_session(struct cache return (NULL); } - retval = (struct cache_mp_write_session_ *)calloc(1, - sizeof(struct cache_mp_write_session_)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); TAILQ_INIT(&retval->items); @@ -947,11 +947,11 @@ cache_mp_write(struct cache_mp_write_ses return (-1); } - new_item = (struct cache_mp_data_item_ *)calloc(1, - sizeof(struct cache_mp_data_item_)); + new_item = calloc(1, + sizeof(*new_item)); assert(new_item != NULL); - new_item->value = (char *)malloc(data_size); + new_item->value = malloc(data_size); assert(new_item->value != NULL); memcpy(new_item->value, data, data_size); new_item->value_size = data_size; @@ -1050,8 +1050,8 @@ open_cache_mp_read_session(struct cache_ } } - retval = (struct cache_mp_read_session_ *)calloc(1, - sizeof(struct cache_mp_read_session_)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); retval->parent_entry = mp_entry; Modified: head/usr.sbin/nscd/cacheplcs.c ============================================================================== --- head/usr.sbin/nscd/cacheplcs.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/cacheplcs.c Sat Jun 13 13:07:56 2009 (r194104) @@ -86,8 +86,8 @@ cache_queue_policy_create_item(void) struct cache_queue_policy_item_ *retval; TRACE_IN(cache_queue_policy_create_item); - retval = (struct cache_queue_policy_item_ *)calloc(1, - sizeof(struct cache_queue_policy_item_)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); TRACE_OUT(cache_queue_policy_create_item); @@ -196,8 +196,8 @@ init_cache_queue_policy(void) struct cache_queue_policy_ *retval; TRACE_IN(init_cache_queue_policy); - retval = (struct cache_queue_policy_ *)calloc(1, - sizeof(struct cache_queue_policy_)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); retval->parent_data.create_item_func = cache_queue_policy_create_item; @@ -336,8 +336,8 @@ cache_lfu_policy_create_item(void) struct cache_lfu_policy_item_ *retval; TRACE_IN(cache_lfu_policy_create_item); - retval = (struct cache_lfu_policy_item_ *)calloc(1, - sizeof(struct cache_lfu_policy_item_)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); TRACE_OUT(cache_lfu_policy_create_item); @@ -540,8 +540,8 @@ init_cache_lfu_policy(void) struct cache_lfu_policy_ *retval; TRACE_IN(init_cache_lfu_policy); - retval = (struct cache_lfu_policy_ *)calloc(1, - sizeof(struct cache_lfu_policy_)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); retval->parent_data.create_item_func = cache_lfu_policy_create_item; Modified: head/usr.sbin/nscd/config.c ============================================================================== --- head/usr.sbin/nscd/config.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/config.c Sat Jun 13 13:07:56 2009 (r194104) @@ -125,8 +125,8 @@ create_configuration_entry(const char *n assert(negative_params != NULL); assert(mp_params != NULL); - retval = (struct configuration_entry *)calloc(1, - sizeof(struct configuration_entry)); + retval = calloc(1, + sizeof(*retval)); assert(retval != NULL); res = pthread_mutex_init(&retval->positive_cache_lock, NULL); @@ -167,7 +167,7 @@ create_configuration_entry(const char *n sizeof(struct mp_cache_entry_params)); size = strlen(name); - retval->name = (char *)calloc(1, size + 1); + retval->name = calloc(1, size + 1); assert(retval->name != NULL); memcpy(retval->name, name, size); @@ -272,8 +272,8 @@ add_configuration_entry(struct configura struct configuration_entry **new_entries; config->entries_capacity *= 2; - new_entries = (struct configuration_entry **)calloc(1, - sizeof(struct configuration_entry *) * + new_entries = calloc(1, + sizeof(*new_entries) * config->entries_capacity); assert(new_entries != NULL); memcpy(new_entries, config->entries, @@ -340,7 +340,7 @@ configuration_entry_add_mp_cache_entry(s TRACE_IN(configuration_entry_add_mp_cache_entry); ++config_entry->mp_cache_entries_size; - new_mp_entries = (cache_entry *)malloc(sizeof(cache_entry) * + new_mp_entries = malloc(sizeof(*new_mp_entries) * config_entry->mp_cache_entries_size); assert(new_mp_entries != NULL); new_mp_entries[0] = c_entry; @@ -516,12 +516,12 @@ init_configuration(void) struct configuration *retval; TRACE_IN(init_configuration); - retval = (struct configuration *)calloc(1, sizeof(struct configuration)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->entries_capacity = INITIAL_ENTRIES_CAPACITY; - retval->entries = (struct configuration_entry **)calloc(1, - sizeof(struct configuration_entry *) * + retval->entries = calloc(1, + sizeof(*retval->entries) * retval->entries_capacity); assert(retval->entries != NULL); @@ -543,12 +543,12 @@ fill_configuration_defaults(struct confi free(config->socket_path); len = strlen(DEFAULT_SOCKET_PATH); - config->socket_path = (char *)calloc(1, len + 1); + config->socket_path = calloc(1, len + 1); assert(config->socket_path != NULL); memcpy(config->socket_path, DEFAULT_SOCKET_PATH, len); len = strlen(DEFAULT_PIDFILE_PATH); - config->pidfile_path = (char *)calloc(1, len + 1); + config->pidfile_path = calloc(1, len + 1); assert(config->pidfile_path != NULL); memcpy(config->pidfile_path, DEFAULT_PIDFILE_PATH, len); Modified: head/usr.sbin/nscd/hashtable.h ============================================================================== --- head/usr.sbin/nscd/hashtable.h Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/hashtable.h Sat Jun 13 13:07:56 2009 (r194104) @@ -74,16 +74,16 @@ typedef unsigned int hashtable_index_t; #define HASHTABLE_INIT(table, type, field, _entries_size) \ do { \ hashtable_index_t var; \ - (table)->entries = (void *)calloc(1, \ + (table)->entries = calloc(1, \ sizeof(*(table)->entries) * (_entries_size)); \ (table)->entries_size = (_entries_size); \ for (var = 0; var < HASHTABLE_ENTRIES_COUNT(table); ++var) {\ (table)->entries[var].field.capacity = \ HASHTABLE_INITIAL_ENTRIES_CAPACITY; \ (table)->entries[var].field.size = 0; \ - (table)->entries[var].field.values = (type *)malloc(\ - sizeof(type) * \ - HASHTABLE_INITIAL_ENTRIES_CAPACITY); \ + (table)->entries[var].field.values = malloc( \ + sizeof(type) * \ + HASHTABLE_INITIAL_ENTRIES_CAPACITY); \ assert((table)->entries[var].field.values != NULL);\ } \ } while (0) @@ -128,12 +128,12 @@ typedef unsigned int hashtable_index_t; #define HASHTABLE_ENTRY_CAPACITY_INCREASE(entry, field, type) \ (entry)->field.capacity *= 2; \ - (entry)->field.values = (type *)realloc((entry)->field.values, \ + (entry)->field.values = realloc((entry)->field.values, \ (entry)->field.capacity * sizeof(type)); #define HASHTABLE_ENTRY_CAPACITY_DECREASE(entry, field, type) \ (entry)->field.capacity /= 2; \ - (entry)->field.values = (type *)realloc((entry)->field.values, \ + (entry)->field.values = realloc((entry)->field.values, \ (entry)->field.capacity * sizeof(type)); /* Modified: head/usr.sbin/nscd/mp_rs_query.c ============================================================================== --- head/usr.sbin/nscd/mp_rs_query.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/mp_rs_query.c Sat Jun 13 13:07:56 2009 (r194104) @@ -117,7 +117,7 @@ on_mp_read_session_request_read1(struct return (-1); } - c_mp_rs_request->entry = (char *)calloc(1, + c_mp_rs_request->entry = calloc(1, c_mp_rs_request->entry_length + 1); assert(c_mp_rs_request->entry != NULL); @@ -428,7 +428,7 @@ on_mp_read_session_read_request_process( &read_response->data_size); if (read_response->error_code == 0) { - read_response->data = (char *)malloc(read_response->data_size); + read_response->data = malloc(read_response->data_size); assert(read_response != NULL); read_response->error_code = cache_mp_read( (cache_mp_read_session)qstate->mdata, Modified: head/usr.sbin/nscd/mp_ws_query.c ============================================================================== --- head/usr.sbin/nscd/mp_ws_query.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/mp_ws_query.c Sat Jun 13 13:07:56 2009 (r194104) @@ -122,7 +122,7 @@ on_mp_write_session_request_read1(struct return (-1); } - c_mp_ws_request->entry = (char *)calloc(1, + c_mp_ws_request->entry = calloc(1, c_mp_ws_request->entry_length + 1); assert(c_mp_ws_request->entry != NULL); @@ -375,7 +375,7 @@ on_mp_write_session_write_request_read1( return (-1); } - write_request->data = (char *)calloc(1, write_request->data_size); + write_request->data = calloc(1, write_request->data_size); assert(write_request->data != NULL); qstate->kevent_watermark = write_request->data_size; Modified: head/usr.sbin/nscd/nscd.c ============================================================================== --- head/usr.sbin/nscd/nscd.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/nscd.c Sat Jun 13 13:07:56 2009 (r194104) @@ -164,7 +164,7 @@ init_runtime_env(struct configuration *c struct runtime_env *retval; TRACE_IN(init_runtime_env); - retval = (struct runtime_env *)calloc(1, sizeof(struct runtime_env)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->sockfd = socket(PF_LOCAL, SOCK_STREAM, 0); @@ -408,7 +408,7 @@ process_socket_event(struct kevent *even if (qstate->io_buffer != NULL) free(qstate->io_buffer); - qstate->io_buffer = (char *)calloc(1, + qstate->io_buffer = calloc(1, qstate->kevent_watermark); assert(qstate->io_buffer != NULL); @@ -828,11 +828,11 @@ main(int argc, char *argv[]) } if (s_configuration->threads_num > 1) { - threads = (pthread_t *)calloc(1, sizeof(pthread_t) * + threads = calloc(1, sizeof(*threads) * s_configuration->threads_num); for (i = 0; i < s_configuration->threads_num; ++i) { - thread_args = (struct processing_thread_args *)malloc( - sizeof(struct processing_thread_args)); + thread_args = malloc( + sizeof(*thread_args)); thread_args->the_cache = s_cache; thread_args->the_runtime_env = s_runtime_env; thread_args->the_configuration = s_configuration; Modified: head/usr.sbin/nscd/nscdcli.c ============================================================================== --- head/usr.sbin/nscd/nscdcli.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/nscdcli.c Sat Jun 13 13:07:56 2009 (r194104) @@ -205,7 +205,7 @@ open_nscd_connection__(struct nscd_conne } fcntl(client_socket, F_SETFL, O_NONBLOCK); - retval = calloc(1, sizeof(struct nscd_connection_)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->sockfd = client_socket; Modified: head/usr.sbin/nscd/query.c ============================================================================== --- head/usr.sbin/nscd/query.c Sat Jun 13 12:23:31 2009 (r194103) +++ head/usr.sbin/nscd/query.c Sat Jun 13 13:07:56 2009 (r194104) @@ -335,11 +335,11 @@ on_write_request_read1(struct query_stat return (-1); } - write_request->entry = (char *)calloc(1, + write_request->entry = calloc(1, write_request->entry_length + 1); assert(write_request->entry != NULL); - write_request->cache_key = (char *)calloc(1, + write_request->cache_key = calloc(1, write_request->cache_key_size + qstate->eid_str_length); assert(write_request->cache_key != NULL); @@ -347,7 +347,7 @@ on_write_request_read1(struct query_stat qstate->eid_str_length); if (write_request->data_size != 0) { - write_request->data = (char *)calloc(1, + write_request->data = calloc(1, write_request->data_size); assert(write_request->data != NULL); } @@ -608,11 +608,11 @@ on_read_request_read1(struct query_state return (-1); } - read_request->entry = (char *)calloc(1, + read_request->entry = calloc(1, read_request->entry_length + 1); assert(read_request->entry != NULL); - read_request->cache_key = (char *)calloc(1, + read_request->cache_key = calloc(1, read_request->cache_key_size + qstate->eid_str_length); assert(read_request->cache_key != NULL); @@ -723,8 +723,8 @@ on_read_request_process(struct query_sta &read_response->data_size); if (read_response->error_code == -2) { - read_response->data = (char *)malloc( - read_response->data_size); + read_response->data = malloc( + read_response->data_size); assert(read_response != NULL); read_response->error_code = cache_read(c_entry, read_request->cache_key, @@ -930,7 +930,7 @@ on_transform_request_read1(struct query_ return (-1); } - transform_request->entry = (char *)calloc(1, + transform_request->entry = calloc(1, transform_request->entry_length + 1); assert(transform_request->entry != NULL); @@ -1226,7 +1226,7 @@ init_query_state(int sockfd, size_t keve struct query_state *retval; TRACE_IN(init_query_state); - retval = (struct query_state *)calloc(1, sizeof(struct query_state)); + retval = calloc(1, sizeof(*retval)); assert(retval != NULL); retval->sockfd = sockfd; From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 13:09:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F39A71065679; Sat, 13 Jun 2009 13:09:20 +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 E18898FC18; Sat, 13 Jun 2009 13:09:20 +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 n5DD9KC4014549; Sat, 13 Jun 2009 13:09:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DD9K90014548; Sat, 13 Jun 2009 13:09:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906131309.n5DD9K90014548@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 13 Jun 2009 13:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194106 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 13:09:22 -0000 Author: bz Date: Sat Jun 13 13:09:20 2009 New Revision: 194106 URL: http://svn.freebsd.org/changeset/base/194106 Log: Remove the static from int hardlink_check_uid. There is an external use in the opensolaris code. I am not sure how this ever worked but I have seen two reports of: link_elf: symbol hardlink_check_uid undefined lately. Reported by: Scott Ullrich (sullrich gmail.com), pfsense Reported by: Mister Olli (mister.olli googlemail.com) Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sat Jun 13 13:09:19 2009 (r194105) +++ head/sys/kern/vfs_syscalls.c Sat Jun 13 13:09:20 2009 (r194106) @@ -1507,7 +1507,7 @@ linkat(struct thread *td, struct linkat_ UIO_USERSPACE, (flag & AT_SYMLINK_FOLLOW) ? FOLLOW : NOFOLLOW)); } -static int hardlink_check_uid = 0; +int hardlink_check_uid = 0; SYSCTL_INT(_security_bsd, OID_AUTO, hardlink_check_uid, CTLFLAG_RW, &hardlink_check_uid, 0, "Unprivileged processes cannot create hard links to files owned by other " From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 13:35:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB6871065674; Sat, 13 Jun 2009 13:35:18 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9AB78FC24; Sat, 13 Jun 2009 13:35:18 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DDZIXj015148; Sat, 13 Jun 2009 13:35:18 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DDZII5015147; Sat, 13 Jun 2009 13:35:18 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906131335.n5DDZII5015147@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 13 Jun 2009 13:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194107 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 13:35:19 -0000 Author: edwin Date: Sat Jun 13 13:35:18 2009 New Revision: 194107 URL: http://svn.freebsd.org/changeset/base/194107 Log: Sync termcap.small with main termcap; add xterm entry for libteken PR: conf/135530 Submitted by: Alex Kozlov MFC after: 1 week Modified: head/etc/termcap.small Modified: head/etc/termcap.small ============================================================================== --- head/etc/termcap.small Sat Jun 13 13:09:20 2009 (r194106) +++ head/etc/termcap.small Sat Jun 13 13:35:18 2009 (r194107) @@ -71,6 +71,17 @@ cons60|ansi80x60:\ :li#60:tc=cons25: cons60-m|ansi80x60-mono:\ :li#60:tc=cons25-m: +# Syscons console with 132 characters (VESA modes) +cons25-w|ansi132x25:\ + :co#132:tc=cons25: +cons30-w|ansi132x30:\ + :co#132:tc=cons30: +cons43-w|ansi132x43:\ + :co#132:tc=cons43: +cons50-w|ansil-w|ansi132x50:\ + :co#132:tc=cons50: +cons60-w|ansi132x60:\ + :co#132:tc=cons60: # KOI8-R/KOI8-U FreeBSD console with ACS support cons25r|cons25u|pc3r|ibmpc3r|cons25-koi8:\ :ac=q\200x\201m\204v\211j\205t\206n\212u\207l\202w\210k\203y\230z\231f\234~\225a\220h\2210\215:\ @@ -93,6 +104,28 @@ cons60r|cons60u|cons60-koi8:\ :li#60:tc=cons25r: cons60r-m|cons60u-m|cons60-koi8-mono:\ :li#60:tc=cons25r-m: +# Syscons console with 90 characters (VGA modes) +# KOI8-R/KOI8-U FreeBSD console with ACS support. +cons25r-v|cons25u-v|pc3r-v|ibmpc3r-vga|cons25-koi8-vga:\ + :co#90:tc=cons25r: +cons25r-mv|cons25u-mv|pc3r-mv|ibmpc3r-monovga|cons25-koi8-monovga:\ + :co#90:tc=cons25r-m: +cons30r-v|cons30u-v|cons30-koi8-vga:\ + :co#90:tc=cons30r: +cons30r-mv|cons30u-mv|cons30-koi8-monovga:\ + :co#90:tc=cons30r-m: +cons43r-v|cons43u-v|cons43-koi8-vga:\ + :co#90:tc=cons43r: +cons43r-mv|cons43u-mv|cons43-koi8-monovga:\ + :co#90:tc=cons43r-m: +cons50r-v|cons50u-v|cons50-koi8-vga:\ + :co#90:tc=cons50r: +cons50r-mv|cons50u-mv|cons50-koi8-monovga:\ + :co#90:tc=cons50r-m: +cons60r-v|cons60u-v|cons60-koi8-vga:\ + :co#90:tc=cons60r: +cons60r-mv|cons60u-mv|cons60-koi8-monovga:\ + :co#90:tc=cons60r-m: # ISO 8859-2 FreeBSD console with ACS support cons25l2|cons25-iso8859-2:\ :ac=f\260i\247:\ @@ -137,6 +170,17 @@ cons60l1|cons60-iso8859-1:\ :li#60:tc=cons25l1: cons60l1-m|cons60-iso8859-1-mono:\ :li#60:tc=cons25l1-m: +# 132x25 ISO 8859-1 FreeBSD console +cons25l1-w|:cons25w-iso8859-1:\ + :co#132:tc=cons25l1: +cons30l1-w|cons30w-iso8859-1:\ + :co#132:tc=cons30l1: +cons43l1-w|cons43w-iso8859-1:\ + :co#132:tc=cons43l1: +cons50l1-w|cons50w-iso8859-1:\ + :co#132:tc=cons50l1: +cons60l1-w|cons60w-iso8859-1:\ + :co#132:tc=cons60l1: # ISO 8859-7 FreeBSD console with ACS support cons25l7|cons25-iso8859-7:\ :ac=f\260g\261{\360}\243+\253,\273i\247:\ @@ -180,8 +224,6 @@ pc|ibmpc|ibm pc PC/IX:\ :li#24:co#80:am:bs:bw:eo:\ :cd=\E[J:ce=\E[K:cl=\Ec:cm=\E[%i%2;%2H:do=\E[B:ho=\E[;H:\ :nd=\E[C:up=\E[A:so=\E[7m:se=\E[0m:us=\E[4m:ue=\E[0m: -pc3mono|IBM PC 386BSD Console with monochrome monitor:\ - :so=\E[0;1r\E[m:tc=pc3: pc3|ibmpc3|IBM PC 386BSD Console:\ :Co#8:\ :DO=\E[%dB:\ @@ -194,10 +236,10 @@ pc3|ibmpc3|IBM PC 386BSD Console:\ :K5=\E[G:\ :LE=\E[%dD:\ :RI=\E[%dC:\ - :Sb=\E[1;%dx:\ - :Sf=\E[2;%dx:\ + :AB=\E[1;%dx:\ + :AF=\E[2;%dx:\ :UP=\E[%dA:\ - :ac=l\332m\300k\277j\331u\264t\303v\301w\302q\304x\263n\305`^Da\260f\370g\361~\371.^Y-^Xh\261I^U0\333y\363z\362:\ + :ac=l\332m\300k\277j\331u\264t\303v\301w\302q\304x\263n\305`^Da\260f\370g\361~\371.^Y-^Xh\261i^U0\333y\363z\362:\ :am:\ :bl=^G:\ :bs:\ @@ -248,3 +290,33 @@ pc3|ibmpc3|IBM PC 386BSD Console:\ :ti=\E[m:\ :up=\E[A:\ :ut: + +# $XFree86: xc/programs/xterm/termcap,v 3.28 2001/01/17 23:46:39 dawes Exp $ +# +xterm-xfree86|XFree86 xterm:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ + :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ + :k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\ + :@7=\EOF:@8=\EOM:kI=\E[2~:\ + :kh=\EOH:kP=\E[5~:kN=\E[6~:\ + :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:Km=\E[M:tc=xterm-basic: +# +# This chunk is used for building the VT220/Sun/PC keyboard variants. +xterm-basic|xterm common (XFree86):\ + :li#24:co#80:am:kn#12:km:mi:ms:xn:AX:bl=^G:\ + :is=\E[!p\E[?3;4l\E[4l\E>:rs=\E[!p\E[?3;4l\E[4l\E>:le=^H:\ + :AL=\E[%dL:DL=\E[%dM:DC=\E[%dP:al=\E[L:dc=\E[P:dl=\E[M:\ + :UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:\ + :ho=\E[H:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:\ + :im=\E[4h:ei=\E[4l:ks=\E[?1h\E=:ke=\E[?1l\E>:kD=\E[3~:kb=^H:\ + :sf=\n:sr=\EM:st=\EH:ct=\E[3g:sc=\E7:rc=\E8:\ + :eA=\E(B\E)0:as=\E(0:ae=\E(B:ml=\El:mu=\Em:up=\E[A:nd=\E[C:\ + :md=\E[1m:me=\E[m:mr=\E[7m:so=\E[7m:se=\E[27m:us=\E[4m:ue=\E[24m:\ + :ti=\E[?1049h:te=\E[?1049l:vi=\E[?25l:ve=\E[?25h:\ + :ut:Co#8:pa#64:op=\E[39;49m:AB=\E[4%dm:AF=\E[3%dm:\ +# +# This is the only entry which you should have to customize, since "xterm" +# is widely used for a variety of incompatible terminal emulations including +# color_xterm and rxvt. +xterm|xterm-color|X11 terminal emulator:\ + :ti@:te@:tc=xterm-xfree86: From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 13:54:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C4F11065738; Sat, 13 Jun 2009 13:54:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A24F8FC1A; Sat, 13 Jun 2009 13:54:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DDs4dS015583; Sat, 13 Jun 2009 13:54:04 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DDs4Za015582; Sat, 13 Jun 2009 13:54:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906131354.n5DDs4Za015582@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 13:54: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: r194109 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 13:54:05 -0000 Author: des Date: Sat Jun 13 13:54:03 2009 New Revision: 194109 URL: http://svn.freebsd.org/changeset/base/194109 Log: Wrap some macros that needed wrapping. MFC after: 1 week Modified: head/usr.sbin/nscd/hashtable.h Modified: head/usr.sbin/nscd/hashtable.h ============================================================================== --- head/usr.sbin/nscd/hashtable.h Sat Jun 13 13:49:12 2009 (r194108) +++ head/usr.sbin/nscd/hashtable.h Sat Jun 13 13:54:03 2009 (r194109) @@ -65,7 +65,8 @@ typedef unsigned int hashtable_index_t; size_t entries_size; \ } -#define HASHTABLE_ENTRIES_COUNT(table) ((table)->entries_size) +#define HASHTABLE_ENTRIES_COUNT(table) \ + ((table)->entries_size) /* * Unlike most of queue.h data types, hash tables can not be initialized @@ -99,7 +100,8 @@ typedef unsigned int hashtable_index_t; } \ } while (0) -#define HASHTABLE_GET_ENTRY(table, hash) (&((table)->entries[hash])) +#define HASHTABLE_GET_ENTRY(table, hash) \ + (&((table)->entries[hash])) /* * Traverses through all hash table entries @@ -127,14 +129,18 @@ typedef unsigned int hashtable_index_t; ((entry)->field.capacity) #define HASHTABLE_ENTRY_CAPACITY_INCREASE(entry, field, type) \ - (entry)->field.capacity *= 2; \ - (entry)->field.values = realloc((entry)->field.values, \ - (entry)->field.capacity * sizeof(type)); + do { \ + (entry)->field.capacity *= 2; \ + (entry)->field.values = realloc((entry)->field.values, \ + (entry)->field.capacity * sizeof(type)); \ + } while (0) #define HASHTABLE_ENTRY_CAPACITY_DECREASE(entry, field, type) \ - (entry)->field.capacity /= 2; \ - (entry)->field.values = realloc((entry)->field.values, \ - (entry)->field.capacity * sizeof(type)); + do { \ + (entry)->field.capacity /= 2; \ + (entry)->field.values = realloc((entry)->field.values, \ + (entry)->field.capacity * sizeof(type)); \ + } while (0) /* * Generates prototypes for the hash table functions From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 13:56:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BECDD1065688; Sat, 13 Jun 2009 13:56:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADBAA8FC16; Sat, 13 Jun 2009 13:56:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DDu69m015674; Sat, 13 Jun 2009 13:56:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DDu6bT015673; Sat, 13 Jun 2009 13:56:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906131356.n5DDu6bT015673@svn.freebsd.org> From: Ed Schouten Date: Sat, 13 Jun 2009 13:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194110 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 13:56:07 -0000 Author: ed Date: Sat Jun 13 13:56:06 2009 New Revision: 194110 URL: http://svn.freebsd.org/changeset/base/194110 Log: Simplify the inline assembler (and correct potential error) of pte_load_store(). Submitted by: Christoph Mallon Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Sat Jun 13 13:54:03 2009 (r194109) +++ head/sys/i386/include/pmap.h Sat Jun 13 13:56:06 2009 (r194110) @@ -362,15 +362,8 @@ pte_load(pt_entry_t *ptep) static __inline pt_entry_t pte_load_store(pt_entry_t *ptep, pt_entry_t pte) { - pt_entry_t r; - - __asm __volatile( - "xchgl %0,%1" - : "=m" (*ptep), - "=r" (r) - : "1" (pte), - "m" (*ptep)); - return (r); + __asm volatile("xchgl %0, %1" : "+m" (*ptep), "+r" (pte)); + return (pte); } #define pte_load_clear(pte) atomic_readandclear_int(pte) From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 14:00:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 329721065693; Sat, 13 Jun 2009 14:00:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 204698FC34; Sat, 13 Jun 2009 14:00:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DE0Bnn015823; Sat, 13 Jun 2009 14:00:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DE0BLu015822; Sat, 13 Jun 2009 14:00:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906131400.n5DE0BLu015822@svn.freebsd.org> From: Ed Schouten Date: Sat, 13 Jun 2009 14:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194111 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 14:00:12 -0000 Author: ed Date: Sat Jun 13 14:00:10 2009 New Revision: 194111 URL: http://svn.freebsd.org/changeset/base/194111 Log: Clobber "cc" instead of using volatile; remove obsolete register keyword. Submitted by: Christoph Mallon Modified: head/sys/i386/include/in_cksum.h Modified: head/sys/i386/include/in_cksum.h ============================================================================== --- head/sys/i386/include/in_cksum.h Sat Jun 13 13:56:06 2009 (r194110) +++ head/sys/i386/include/in_cksum.h Sat Jun 13 14:00:10 2009 (r194111) @@ -57,9 +57,9 @@ static __inline u_int in_cksum_hdr(const struct ip *ip) { - register u_int sum = 0; + u_int sum = 0; - __asm __volatile ( + __asm( "addl %1, %0\n" "adcl %2, %0\n" "adcl %3, %0\n" @@ -72,6 +72,7 @@ in_cksum_hdr(const struct ip *ip) "g" (((const u_int32_t *)ip)[2]), "g" (((const u_int32_t *)ip)[3]), "g" (((const u_int32_t *)ip)[4]) + : "cc" ); sum = (sum & 0xffff) + (sum >> 16); if (sum > 0xffff) @@ -91,12 +92,12 @@ in_cksum_update(struct ip *ip) static __inline u_short in_addword(u_short sum, u_short b) { - /* __volatile is necessary because the condition codes are used. */ - __asm __volatile ( + __asm( "addw %1, %0\n" "adcw $0, %0" : "+r" (sum) - : "r" (b) + : "g" (b) + : "cc" ); return (sum); } @@ -104,14 +105,14 @@ in_addword(u_short sum, u_short b) static __inline u_short in_pseudo(u_int sum, u_int b, u_int c) { - /* __volatile is necessary because the condition codes are used. */ - __asm __volatile ( + __asm( "addl %1, %0\n" "adcl %2, %0\n" "adcl $0, %0" : "+r" (sum) : "g" (b), "g" (c) + : "cc" ); sum = (sum & 0xffff) + (sum >> 16); if (sum > 0xffff) From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 14:12:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80DE81065672; Sat, 13 Jun 2009 14:12:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DF7F8FC13; Sat, 13 Jun 2009 14:12:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DECuI9016092; Sat, 13 Jun 2009 14:12:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DECtTx016077; Sat, 13 Jun 2009 14:12:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906131412.n5DECtTx016077@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 14:12: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: r194112 - in head/usr.sbin/nscd: . agents X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 14:12:58 -0000 Author: des Date: Sat Jun 13 14:12:55 2009 New Revision: 194112 URL: http://svn.freebsd.org/changeset/base/194112 Log: Remove "extern" from function prototypes, and fix some (but not all) style(9) violations. MFC after: 1 week Modified: head/usr.sbin/nscd/agent.h head/usr.sbin/nscd/agents/group.h head/usr.sbin/nscd/agents/passwd.h head/usr.sbin/nscd/agents/services.h head/usr.sbin/nscd/cachelib.h head/usr.sbin/nscd/cacheplcs.h head/usr.sbin/nscd/config.h head/usr.sbin/nscd/debug.h head/usr.sbin/nscd/log.h head/usr.sbin/nscd/mp_rs_query.h head/usr.sbin/nscd/mp_ws_query.h head/usr.sbin/nscd/nscdcli.h head/usr.sbin/nscd/parser.h head/usr.sbin/nscd/protocol.h head/usr.sbin/nscd/query.h Modified: head/usr.sbin/nscd/agent.h ============================================================================== --- head/usr.sbin/nscd/agent.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/agent.h Sat Jun 13 14:12:55 2009 (r194112) @@ -63,10 +63,9 @@ struct agent_table { size_t agents_num; }; -extern struct agent_table *init_agent_table(void); -extern void register_agent(struct agent_table *, struct agent *); -extern struct agent *find_agent(struct agent_table *, const char *, - enum agent_type); -extern void destroy_agent_table(struct agent_table *); +struct agent_table *init_agent_table(void); +void register_agent(struct agent_table *, struct agent *); +struct agent *find_agent(struct agent_table *, const char *, enum agent_type); +void destroy_agent_table(struct agent_table *); #endif Modified: head/usr.sbin/nscd/agents/group.h ============================================================================== --- head/usr.sbin/nscd/agents/group.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/agents/group.h Sat Jun 13 14:12:55 2009 (r194112) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_group_agent(void); -extern struct agent *init_group_mp_agent(void); +struct agent *init_group_agent(void); +struct agent *init_group_mp_agent(void); Modified: head/usr.sbin/nscd/agents/passwd.h ============================================================================== --- head/usr.sbin/nscd/agents/passwd.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/agents/passwd.h Sat Jun 13 14:12:55 2009 (r194112) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_passwd_agent(void); -extern struct agent *init_passwd_mp_agent(void); +struct agent *init_passwd_agent(void); +struct agent *init_passwd_mp_agent(void); Modified: head/usr.sbin/nscd/agents/services.h ============================================================================== --- head/usr.sbin/nscd/agents/services.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/agents/services.h Sat Jun 13 14:12:55 2009 (r194112) @@ -28,5 +28,5 @@ #include "../agent.h" -extern struct agent *init_services_agent(void); -extern struct agent *init_services_mp_agent(void); +struct agent *init_services_agent(void); +struct agent *init_services_mp_agent(void); Modified: head/usr.sbin/nscd/cachelib.h ============================================================================== --- head/usr.sbin/nscd/cachelib.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/cachelib.h Sat Jun 13 14:12:55 2009 (r194112) @@ -69,8 +69,7 @@ enum part_position_t { * by using one entry. * get_time_func is needed to have the clocks-independent counter */ -struct cache_params -{ +struct cache_params { void (*get_time_func)(struct timeval *); }; @@ -78,15 +77,13 @@ struct cache_params * base structure - normal_cache_entry_params and multipart_cache_entry_params * are "inherited" from it */ -struct cache_entry_params -{ +struct cache_entry_params { enum cache_entry_t entry_type; char *entry_name; }; /* params, used for most entries */ -struct common_cache_entry_params -{ +struct common_cache_entry_params { struct cache_entry_params cep; size_t cache_entries_size; @@ -100,8 +97,7 @@ struct common_cache_entry_params }; /* params, used for multipart entries */ -struct mp_cache_entry_params -{ +struct mp_cache_entry_params { struct cache_entry_params cep; /* unique fields */ @@ -111,8 +107,7 @@ struct mp_cache_entry_params struct timeval max_lifetime; /* maximum elements lifetime */ }; -struct cache_ht_item_data_ -{ +struct cache_ht_item_data_ { /* key is the bytes sequence only - not the null-terminated string */ char *key; size_t key_size; @@ -123,19 +118,16 @@ struct cache_ht_item_data_ struct cache_policy_item_ *fifo_policy_item; }; -struct cache_ht_item_ -{ +struct cache_ht_item_ { HASHTABLE_ENTRY_HEAD(ht_item_, struct cache_ht_item_data_) data; }; -struct cache_entry_ -{ +struct cache_entry_ { char *name; struct cache_entry_params *params; }; -struct cache_common_entry_ -{ +struct cache_common_entry_ { char *name; struct cache_entry_params *params; @@ -163,8 +155,7 @@ struct cache_mp_data_item_ { TAILQ_ENTRY(cache_mp_data_item_) entries; }; -struct cache_mp_write_session_ -{ +struct cache_mp_write_session_ { struct cache_mp_entry_ *parent_entry; /* @@ -177,16 +168,14 @@ struct cache_mp_write_session_ TAILQ_ENTRY(cache_mp_write_session_) entries; }; -struct cache_mp_read_session_ -{ +struct cache_mp_read_session_ { struct cache_mp_entry_ *parent_entry; struct cache_mp_data_item_ *current_item; TAILQ_ENTRY(cache_mp_read_session_) entries; }; -struct cache_mp_entry_ -{ +struct cache_mp_entry_ { char *name; struct cache_entry_params *params; @@ -217,8 +206,7 @@ struct cache_mp_entry_ void (*get_time_func)(struct timeval *); }; -struct cache_ -{ +struct cache_ { struct cache_params params; struct cache_entry_ **entries; @@ -243,31 +231,31 @@ typedef struct cache_mp_read_session_ *c */ /* cache initialization/destruction routines */ -extern cache init_cache(struct cache_params const *); -extern void destroy_cache(cache); +cache init_cache(struct cache_params const *); +void destroy_cache(cache); /* cache entries manipulation routines */ -extern int register_cache_entry(cache, struct cache_entry_params const *); -extern int unregister_cache_entry(cache, const char *); -extern cache_entry find_cache_entry(cache, const char *); +int register_cache_entry(cache, struct cache_entry_params const *); +int unregister_cache_entry(cache, const char *); +cache_entry find_cache_entry(cache, const char *); /* read/write operations used on common entries */ -extern int cache_read(cache_entry, const char *, size_t, char *, size_t *); -extern int cache_write(cache_entry, const char *, size_t, char const *, size_t); +int cache_read(cache_entry, const char *, size_t, char *, size_t *); +int cache_write(cache_entry, const char *, size_t, char const *, size_t); /* read/write operations used on multipart entries */ -extern cache_mp_write_session open_cache_mp_write_session(cache_entry); -extern int cache_mp_write(cache_mp_write_session, char *, size_t); -extern void abandon_cache_mp_write_session(cache_mp_write_session); -extern void close_cache_mp_write_session(cache_mp_write_session); - -extern cache_mp_read_session open_cache_mp_read_session(cache_entry); -extern int cache_mp_read(cache_mp_read_session, char *, size_t *); -extern void close_cache_mp_read_session(cache_mp_read_session); +cache_mp_write_session open_cache_mp_write_session(cache_entry); +int cache_mp_write(cache_mp_write_session, char *, size_t); +void abandon_cache_mp_write_session(cache_mp_write_session); +void close_cache_mp_write_session(cache_mp_write_session); + +cache_mp_read_session open_cache_mp_read_session(cache_entry); +int cache_mp_read(cache_mp_read_session, char *, size_t *); +void close_cache_mp_read_session(cache_mp_read_session); /* transformation routines */ -extern int transform_cache_entry(cache_entry, enum cache_transformation_t); -extern int transform_cache_entry_part(cache_entry, enum cache_transformation_t, +int transform_cache_entry(cache_entry, enum cache_transformation_t); +int transform_cache_entry_part(cache_entry, enum cache_transformation_t, const char *, size_t, enum part_position_t); #endif Modified: head/usr.sbin/nscd/cacheplcs.h ============================================================================== --- head/usr.sbin/nscd/cacheplcs.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/cacheplcs.h Sat Jun 13 14:12:55 2009 (r194112) @@ -39,8 +39,7 @@ * queue. connected_item pointers to the corresponding cache_policy_item_ in * another policy queue. */ -struct cache_policy_item_ -{ +struct cache_policy_item_ { char *key; size_t key_size; @@ -55,8 +54,7 @@ struct cache_policy_item_ * cache_policy_ represents an abstract policy queue. It can be customized by * setting appropriate function pointers */ -struct cache_policy_ -{ +struct cache_policy_ { struct cache_policy_item_* (*create_item_func)(void); void (*destroy_item_func)(struct cache_policy_item_ *); @@ -80,8 +78,7 @@ struct cache_policy_ /* * LFU cache policy item "inherited" from cache_policy_item_ structure */ -struct cache_lfu_policy_item_ -{ +struct cache_lfu_policy_item_ { struct cache_policy_item_ parent_data; int frequency; @@ -93,8 +90,7 @@ TAILQ_HEAD(cache_lfu_policy_group_, cach /* * LFU policy queue "inherited" from cache_policy_. */ -struct cache_lfu_policy_ -{ +struct cache_lfu_policy_ { struct cache_policy_ parent_data; struct cache_lfu_policy_group_ groups[CACHELIB_MAX_FREQUENCY]; }; @@ -102,8 +98,7 @@ struct cache_lfu_policy_ /* * LRU and FIFO policies item "inherited" from cache_policy_item_ */ -struct cache_queue_policy_item_ -{ +struct cache_queue_policy_item_ { struct cache_policy_item_ parent_data; TAILQ_ENTRY(cache_queue_policy_item_) entries; }; @@ -111,8 +106,7 @@ struct cache_queue_policy_item_ /* * LRU and FIFO policies "inherited" from cache_policy_ */ -struct cache_queue_policy_ -{ +struct cache_queue_policy_ { struct cache_policy_ parent_data; TAILQ_HEAD(cache_queue_policy_head_, cache_queue_policy_item_) head; }; @@ -121,15 +115,15 @@ typedef struct cache_queue_policy_ cache typedef struct cache_queue_policy_ cache_lru_policy_; /* fifo policy routines */ -extern struct cache_policy_ *init_cache_fifo_policy(void); -extern void destroy_cache_fifo_policy(struct cache_policy_ *); +struct cache_policy_ *init_cache_fifo_policy(void); +void destroy_cache_fifo_policy(struct cache_policy_ *); /* lru policy routines */ -extern struct cache_policy_ *init_cache_lru_policy(void); -extern void destroy_cache_lru_policy(struct cache_policy_ *); +struct cache_policy_ *init_cache_lru_policy(void); +void destroy_cache_lru_policy(struct cache_policy_ *); /* lfu policy routines */ -extern struct cache_policy_ *init_cache_lfu_policy(void); -extern void destroy_cache_lfu_policy(struct cache_policy_ *); +struct cache_policy_ *init_cache_lfu_policy(void); +void destroy_cache_lfu_policy(struct cache_policy_ *); #endif Modified: head/usr.sbin/nscd/config.h ============================================================================== --- head/usr.sbin/nscd/config.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/config.h Sat Jun 13 14:12:55 2009 (r194112) @@ -115,37 +115,34 @@ enum config_entry_lock_type { CELT_MULTIPART }; -extern struct configuration *init_configuration(void); -extern void destroy_configuration(struct configuration *); -extern void fill_configuration_defaults(struct configuration *); +struct configuration *init_configuration(void); +void destroy_configuration(struct configuration *); +void fill_configuration_defaults(struct configuration *); -extern int add_configuration_entry(struct configuration *, +int add_configuration_entry(struct configuration *, struct configuration_entry *); -extern struct configuration_entry *create_def_configuration_entry( +struct configuration_entry *create_def_configuration_entry(const char *); +void destroy_configuration_entry(struct configuration_entry *); +size_t configuration_get_entries_size(struct configuration *); +struct configuration_entry *configuration_get_entry(struct configuration *, + size_t); +struct configuration_entry *configuration_find_entry(struct configuration *, const char *); -extern void destroy_configuration_entry(struct configuration_entry *); -extern size_t configuration_get_entries_size(struct configuration *); -extern struct configuration_entry *configuration_get_entry( - struct configuration *, size_t); -extern struct configuration_entry *configuration_find_entry( - struct configuration *, const char *); -extern int configuration_entry_add_mp_cache_entry(struct configuration_entry *, +int configuration_entry_add_mp_cache_entry(struct configuration_entry *, cache_entry); -extern cache_entry configuration_entry_find_mp_cache_entry( - struct configuration_entry *, - const char *); -extern int configuration_entry_find_mp_cache_entries( - struct configuration_entry *, const char *, cache_entry **, - cache_entry **); - -extern void configuration_lock_rdlock(struct configuration *config); -extern void configuration_lock_wrlock(struct configuration *config); -extern void configuration_unlock(struct configuration *config); +cache_entry configuration_entry_find_mp_cache_entry( + struct configuration_entry *, const char *); +int configuration_entry_find_mp_cache_entries(struct configuration_entry *, + const char *, cache_entry **, cache_entry **); + +void configuration_lock_rdlock(struct configuration *config); +void configuration_lock_wrlock(struct configuration *config); +void configuration_unlock(struct configuration *config); -extern void configuration_lock_entry(struct configuration_entry *, +void configuration_lock_entry(struct configuration_entry *, enum config_entry_lock_type); -extern void configuration_unlock_entry(struct configuration_entry *, +void configuration_unlock_entry(struct configuration_entry *, enum config_entry_lock_type); #endif Modified: head/usr.sbin/nscd/debug.h ============================================================================== --- head/usr.sbin/nscd/debug.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/debug.h Sat Jun 13 14:12:55 2009 (r194112) @@ -54,14 +54,14 @@ #define TRACE_OFF() (void)0 #endif -extern void nscd_trace_in(const char *, const char *, int); -extern void nscd_trace_point(const char *, int); -extern void nscd_trace_msg(const char *, const char *, int); -extern void nscd_trace_ptr(const char *, const void *, const char *, int); -extern void nscd_trace_int(const char *, int, const char *, int); -extern void nscd_trace_str(const char *, const char *, const char *, int); -extern void nscd_trace_out(const char *, const char *, int); -extern void nscd_trace_on(void); -extern void nscd_trace_off(void); +void nscd_trace_in(const char *, const char *, int); +void nscd_trace_point(const char *, int); +void nscd_trace_msg(const char *, const char *, int); +void nscd_trace_ptr(const char *, const void *, const char *, int); +void nscd_trace_int(const char *, int, const char *, int); +void nscd_trace_str(const char *, const char *, const char *, int); +void nscd_trace_out(const char *, const char *, int); +void nscd_trace_on(void); +void nscd_trace_off(void); #endif Modified: head/usr.sbin/nscd/log.h ============================================================================== --- head/usr.sbin/nscd/log.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/log.h Sat Jun 13 14:12:55 2009 (r194112) @@ -37,7 +37,7 @@ #define LOG_ERR_2(sender, err, ...) __log_err(2, sender, err, ##__VA_ARGS__) #define LOG_ERR_3(sender, err, ...) __log_err(3, sender, err, ##__VA_ARGS__) -extern void __log_msg(int, const char *, const char *, ...); -extern void __log_err(int, const char *, const char *, ...); +void __log_msg(int, const char *, const char *, ...); +void __log_err(int, const char *, const char *, ...); #endif Modified: head/usr.sbin/nscd/mp_rs_query.h ============================================================================== --- head/usr.sbin/nscd/mp_rs_query.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/mp_rs_query.h Sat Jun 13 14:12:55 2009 (r194112) @@ -29,6 +29,6 @@ #ifndef __NSCD_MP_RS_QUERY_H__ #define __NSCD_MP_RS_QUERY_H__ -extern int on_mp_read_session_request_read1(struct query_state *); +int on_mp_read_session_request_read1(struct query_state *); #endif Modified: head/usr.sbin/nscd/mp_ws_query.h ============================================================================== --- head/usr.sbin/nscd/mp_ws_query.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/mp_ws_query.h Sat Jun 13 14:12:55 2009 (r194112) @@ -29,8 +29,7 @@ #ifndef __NSCD_MP_WS_QUERY_H__ #define __NSCD_MP_WS_QUERY_H__ -extern int on_mp_write_session_request_read1(struct query_state *); -extern cache_entry register_new_mp_cache_entry(struct query_state *, - const char *); +int on_mp_write_session_request_read1(struct query_state *); +cache_entry register_new_mp_cache_entry(struct query_state *, const char *); #endif Modified: head/usr.sbin/nscd/nscdcli.h ============================================================================== --- head/usr.sbin/nscd/nscdcli.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/nscdcli.h Sat Jun 13 14:12:55 2009 (r194112) @@ -30,28 +30,26 @@ #define __NSCD_NSCDCLI_H__ struct nscd_connection_params { - char *socket_path; - struct timeval timeout; + char *socket_path; + struct timeval timeout; }; struct nscd_connection_ { - int sockfd; + int sockfd; int read_queue; int write_queue; }; /* simple abstractions for not to write "struct" every time */ -typedef struct nscd_connection_ *nscd_connection; -typedef struct nscd_connection_ *nscd_mp_write_session; -typedef struct nscd_connection_ *nscd_mp_read_session; +typedef struct nscd_connection_ *nscd_connection; +typedef struct nscd_connection_ *nscd_mp_write_session; +typedef struct nscd_connection_ *nscd_mp_read_session; #define INVALID_NSCD_CONNECTION (NULL) /* initialization/destruction routines */ -extern nscd_connection open_nscd_connection__( - struct nscd_connection_params const *); -extern void close_nscd_connection__(nscd_connection); - -extern int nscd_transform__(nscd_connection, const char *, int); +nscd_connection open_nscd_connection__(struct nscd_connection_params const *); +void close_nscd_connection__(nscd_connection); +int nscd_transform__(nscd_connection, const char *, int); #endif Modified: head/usr.sbin/nscd/parser.h ============================================================================== --- head/usr.sbin/nscd/parser.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/parser.h Sat Jun 13 14:12:55 2009 (r194112) @@ -29,7 +29,7 @@ #ifndef __NSCD_PARSER_H__ #define __NSCD_PARSER_H__ -extern int parse_config_file(struct configuration *, +int parse_config_file(struct configuration *, const char *, char const **, int *); #endif Modified: head/usr.sbin/nscd/protocol.h ============================================================================== --- head/usr.sbin/nscd/protocol.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/protocol.h Sat Jun 13 14:12:55 2009 (r194112) @@ -37,8 +37,7 @@ #define BUFSIZE_INVALID(x) (!BUFSIZE_CORRECT(x)) /* structures below represent the data that are sent/received by the daemon */ -struct cache_write_request -{ +struct cache_write_request { char *entry; char *cache_key; char *data; @@ -48,13 +47,11 @@ struct cache_write_request size_t data_size; }; -struct cache_write_response -{ +struct cache_write_response { int error_code; }; -struct cache_read_request -{ +struct cache_read_request { char *entry; char *cache_key; @@ -62,8 +59,7 @@ struct cache_read_request size_t cache_key_size; }; -struct cache_read_response -{ +struct cache_read_response { char *data; // ignored if error_code is not 0 size_t data_size; // ignored if error_code is not 0 @@ -75,16 +71,14 @@ enum transformation_type { TT_ALL = 1 // transform all entries }; -struct cache_transform_request -{ +struct cache_transform_request { char *entry; // ignored if entry_length is 0 size_t entry_length; int transformation_type; }; -struct cache_transform_response -{ +struct cache_transform_response { int error_code; }; @@ -149,8 +143,7 @@ enum comm_element_t { * The comm_element is used as the holder of any known (defined above) data * type that is to be sent/received. */ -struct comm_element -{ +struct comm_element { union { struct cache_write_request c_write_request; struct cache_write_response c_write_response; @@ -167,97 +160,90 @@ struct comm_element struct cache_mp_read_session_request c_mp_rs_request; struct cache_mp_read_session_response c_mp_rs_response; struct cache_mp_read_session_read_response c_mp_rs_read_response; - }; + } /* anonymous */; enum comm_element_t type; }; -extern void init_comm_element(struct comm_element *, enum comm_element_t type); -extern void finalize_comm_element(struct comm_element *); +void init_comm_element(struct comm_element *, enum comm_element_t type); +void finalize_comm_element(struct comm_element *); /* * For each type of data, there is three functions (init/finalize/get), that * used with comm_element structure */ -extern void init_cache_write_request(struct cache_write_request *); -extern void finalize_cache_write_request(struct cache_write_request *); -extern struct cache_write_request *get_cache_write_request( - struct comm_element *); +void init_cache_write_request(struct cache_write_request *); +void finalize_cache_write_request(struct cache_write_request *); +struct cache_write_request *get_cache_write_request(struct comm_element *); -extern void init_cache_write_response(struct cache_write_response *); -extern void finalize_cache_write_response(struct cache_write_response *); -extern struct cache_write_response *get_cache_write_response( - struct comm_element *); +void init_cache_write_response(struct cache_write_response *); +void finalize_cache_write_response(struct cache_write_response *); +struct cache_write_response *get_cache_write_response(struct comm_element *); -extern void init_cache_read_request(struct cache_read_request *); -extern void finalize_cache_read_request(struct cache_read_request *); -extern struct cache_read_request *get_cache_read_request( - struct comm_element *); +void init_cache_read_request(struct cache_read_request *); +void finalize_cache_read_request(struct cache_read_request *); +struct cache_read_request *get_cache_read_request(struct comm_element *); -extern void init_cache_read_response(struct cache_read_response *); -extern void finalize_cache_read_response(struct cache_read_response *); -extern struct cache_read_response *get_cache_read_response( - struct comm_element *); +void init_cache_read_response(struct cache_read_response *); +void finalize_cache_read_response(struct cache_read_response *); +struct cache_read_response *get_cache_read_response(struct comm_element *); -extern void init_cache_transform_request(struct cache_transform_request *); -extern void finalize_cache_transform_request(struct cache_transform_request *); -extern struct cache_transform_request *get_cache_transform_request( +void init_cache_transform_request(struct cache_transform_request *); +void finalize_cache_transform_request(struct cache_transform_request *); +struct cache_transform_request *get_cache_transform_request( struct comm_element *); -extern void init_cache_transform_response(struct cache_transform_response *); -extern void finalize_cache_transform_response( - struct cache_transform_response *); -extern struct cache_transform_response *get_cache_transform_response( +void init_cache_transform_response(struct cache_transform_response *); +void finalize_cache_transform_response(struct cache_transform_response *); +struct cache_transform_response *get_cache_transform_response( struct comm_element *); -extern void init_cache_mp_write_session_request( +void init_cache_mp_write_session_request( struct cache_mp_write_session_request *); -extern void finalize_cache_mp_write_session_request( +void finalize_cache_mp_write_session_request( struct cache_mp_write_session_request *); -extern struct cache_mp_write_session_request * - get_cache_mp_write_session_request( - struct comm_element *); +struct cache_mp_write_session_request * + get_cache_mp_write_session_request(struct comm_element *); -extern void init_cache_mp_write_session_response( +void init_cache_mp_write_session_response( struct cache_mp_write_session_response *); -extern void finalize_cache_mp_write_session_response( +void finalize_cache_mp_write_session_response( struct cache_mp_write_session_response *); -extern struct cache_mp_write_session_response * +struct cache_mp_write_session_response * get_cache_mp_write_session_response(struct comm_element *); -extern void init_cache_mp_write_session_write_request( +void init_cache_mp_write_session_write_request( struct cache_mp_write_session_write_request *); -extern void finalize_cache_mp_write_session_write_request( +void finalize_cache_mp_write_session_write_request( struct cache_mp_write_session_write_request *); -extern struct cache_mp_write_session_write_request * +struct cache_mp_write_session_write_request * get_cache_mp_write_session_write_request(struct comm_element *); -extern void init_cache_mp_write_session_write_response( +void init_cache_mp_write_session_write_response( struct cache_mp_write_session_write_response *); -extern void finalize_cache_mp_write_session_write_response( +void finalize_cache_mp_write_session_write_response( struct cache_mp_write_session_write_response *); -extern struct cache_mp_write_session_write_response * +struct cache_mp_write_session_write_response * get_cache_mp_write_session_write_response(struct comm_element *); -extern void init_cache_mp_read_session_request( +void init_cache_mp_read_session_request( struct cache_mp_read_session_request *); -extern void finalize_cache_mp_read_session_request( +void finalize_cache_mp_read_session_request( struct cache_mp_read_session_request *); -extern struct cache_mp_read_session_request *get_cache_mp_read_session_request( +struct cache_mp_read_session_request *get_cache_mp_read_session_request( struct comm_element *); -extern void init_cache_mp_read_session_response( +void init_cache_mp_read_session_response( struct cache_mp_read_session_response *); -extern void finalize_cache_mp_read_session_response( +void finalize_cache_mp_read_session_response( struct cache_mp_read_session_response *); -extern struct cache_mp_read_session_response * - get_cache_mp_read_session_response( - struct comm_element *); +struct cache_mp_read_session_response * + get_cache_mp_read_session_response(struct comm_element *); -extern void init_cache_mp_read_session_read_response( +void init_cache_mp_read_session_read_response( struct cache_mp_read_session_read_response *); -extern void finalize_cache_mp_read_session_read_response( +void finalize_cache_mp_read_session_read_response( struct cache_mp_read_session_read_response *); -extern struct cache_mp_read_session_read_response * +struct cache_mp_read_session_read_response * get_cache_mp_read_session_read_response(struct comm_element *); #endif Modified: head/usr.sbin/nscd/query.h ============================================================================== --- head/usr.sbin/nscd/query.h Sat Jun 13 14:00:10 2009 (r194111) +++ head/usr.sbin/nscd/query.h Sat Jun 13 14:12:55 2009 (r194112) @@ -40,8 +40,7 @@ struct configuration_entry; typedef int (*query_process_func)(struct query_state *); typedef void (*query_destroy_func)(struct query_state *); typedef ssize_t (*query_read_func)(struct query_state *, void *, size_t); -typedef ssize_t (*query_write_func)(struct query_state *, const void *, - size_t); +typedef ssize_t (*query_write_func)(struct query_state *, const void *, size_t); /* * The query state structure contains the information to process all types of @@ -91,17 +90,15 @@ struct query_state { int use_alternate_io; }; -extern int check_query_eids(struct query_state *); +int check_query_eids(struct query_state *); -extern ssize_t query_io_buffer_read(struct query_state *, void *, size_t); -extern ssize_t query_io_buffer_write(struct query_state *, const void *, - size_t); - -extern ssize_t query_socket_read(struct query_state *, void *, size_t); -extern ssize_t query_socket_write(struct query_state *, const void *, - size_t); +ssize_t query_io_buffer_read(struct query_state *, void *, size_t); +ssize_t query_io_buffer_write(struct query_state *, const void *, size_t); -extern struct query_state *init_query_state(int, size_t, uid_t, gid_t); -extern void destroy_query_state(struct query_state *); +ssize_t query_socket_read(struct query_state *, void *, size_t); +ssize_t query_socket_write(struct query_state *, const void *, size_t); + +struct query_state *init_query_state(int, size_t, uid_t, gid_t); +void destroy_query_state(struct query_state *); #endif From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 14:30:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18B0E1065670; Sat, 13 Jun 2009 14:30:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 078B38FC14; Sat, 13 Jun 2009 14:30:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DEU8v6016558; Sat, 13 Jun 2009 14:30:08 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DEU8bV016557; Sat, 13 Jun 2009 14:30:08 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906131430.n5DEU8bV016557@svn.freebsd.org> From: Ed Schouten Date: Sat, 13 Jun 2009 14:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194115 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 14:30:09 -0000 Author: ed Date: Sat Jun 13 14:30:08 2009 New Revision: 194115 URL: http://svn.freebsd.org/changeset/base/194115 Log: Clobber "cc" instead of using volatile. Submitted by: Christoph Mallon Modified: head/sys/i386/include/cpufunc.h Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Sat Jun 13 14:25:51 2009 (r194114) +++ head/sys/i386/include/cpufunc.h Sat Jun 13 14:30:08 2009 (r194115) @@ -76,7 +76,7 @@ bsfl(u_int mask) { u_int result; - __asm __volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); + __asm("bsfl %1,%0" : "=r" (result) : "rm" (mask) : "cc"); return (result); } @@ -85,7 +85,7 @@ bsrl(u_int mask) { u_int result; - __asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); + __asm("bsrl %1,%0" : "=r" (result) : "rm" (mask) : "cc"); return (result); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 15:35:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47A2310656C0; Sat, 13 Jun 2009 15:35:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 359998FC1D; Sat, 13 Jun 2009 15:35:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DFZNc8017848; Sat, 13 Jun 2009 15:35:23 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DFZNnu017847; Sat, 13 Jun 2009 15:35:23 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200906131535.n5DFZNnu017847@svn.freebsd.org> From: Jamie Gritton Date: Sat, 13 Jun 2009 15:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194117 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 15:35:23 -0000 Author: jamie Date: Sat Jun 13 15:35:22 2009 New Revision: 194117 URL: http://svn.freebsd.org/changeset/base/194117 Log: Use getcredhostuuid instead of accessing the prison directly. Approved by: bz (mentor) Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sat Jun 13 15:00:29 2009 (r194116) +++ head/sys/fs/nfsclient/nfs_clstate.c Sat Jun 13 15:35:22 2009 (r194117) @@ -676,16 +676,12 @@ nfscl_getcl(vnode_t vp, struct ucred *cr struct nfsclclient *newclp = NULL; struct nfscllockowner *lp, *nlp; struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); - struct prison *pr; char uuid[HOSTUUIDLEN]; int igotlock = 0, error, trystalecnt, clidinusedelay, i; u_int16_t idlen = 0; if (cred != NULL) { - pr = cred->cr_prison; - mtx_lock(&pr->pr_mtx); - strlcpy(uuid, pr->pr_uuid, sizeof uuid); - mtx_unlock(&pr->pr_mtx); + getcredhostuuid(cred, uuid, sizeof uuid); idlen = strlen(uuid); if (idlen > 0) idlen += sizeof (u_int64_t); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 15:39:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C3E2106568E; Sat, 13 Jun 2009 15:39:13 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 566EA8FC29; Sat, 13 Jun 2009 15:39:13 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DFdDWP017946; Sat, 13 Jun 2009 15:39:13 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DFdC9T017931; Sat, 13 Jun 2009 15:39:12 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200906131539.n5DFdC9T017931@svn.freebsd.org> From: Jamie Gritton Date: Sat, 13 Jun 2009 15:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194118 - in head/sys: cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/fs/zfs dev/firewire dev/syscons/daemon fs/nfsclient kern netinet6 nfsclient nlm sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 15:39:14 -0000 Author: jamie Date: Sat Jun 13 15:39:12 2009 New Revision: 194118 URL: http://svn.freebsd.org/changeset/base/194118 Log: Rename the host-related prison fields to be the same as the host.* parameters they represent, and the variables they replaced, instead of abbreviated versions of them. Approved by: bz (mentor) Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c head/sys/dev/firewire/firewire.c head/sys/dev/syscons/daemon/daemon_saver.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/kern/kern_jail.c head/sys/kern/kern_mib.c head/sys/kern/kern_shutdown.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_ifattach.c head/sys/nfsclient/bootp_subr.c head/sys/nfsclient/nfs_vfsops.c head/sys/nlm/nlm_advlock.c head/sys/sys/jail.h Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris.c Sat Jun 13 15:39:12 2009 (r194118) @@ -83,7 +83,7 @@ opensolaris_modevent(module_t mod __unus switch (type) { case MOD_LOAD: - utsname.nodename = prison0.pr_host; + utsname.nodename = prison0.pr_hostname; break; case MOD_UNLOAD: Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Sat Jun 13 15:39:12 2009 (r194118) @@ -179,9 +179,9 @@ static char * spa_history_zone() { #ifdef _KERNEL - /* XXX: pr_host can be changed by default from within a jail! */ + /* XXX: pr_hostname can be changed by default from within a jail! */ if (jailed(curthread->td_ucred)) - return (curthread->td_ucred->cr_prison->pr_host); + return (curthread->td_ucred->cr_prison->pr_hostname); #endif return ("global"); } Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/dev/firewire/firewire.c Sat Jun 13 15:39:12 2009 (r194118) @@ -724,7 +724,7 @@ fw_reset_crom(struct firewire_comm *fc) crom_add_entry(root, CSRKEY_HW, __FreeBSD_version); #endif mtx_lock(&prison0.pr_mtx); - crom_add_simple_text(src, root, &buf->hw, prison0.pr_host); + crom_add_simple_text(src, root, &buf->hw, prison0.pr_hostname); mtx_unlock(&prison0.pr_mtx); } Modified: head/sys/dev/syscons/daemon/daemon_saver.c ============================================================================== --- head/sys/dev/syscons/daemon/daemon_saver.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/dev/syscons/daemon/daemon_saver.c Sat Jun 13 15:39:12 2009 (r194118) @@ -353,10 +353,10 @@ daemon_init(video_adapter_t *adp) { mtx_lock(&prison0.pr_mtx); - messagelen = strlen(prison0.pr_host) + 3 + strlen(ostype) + 1 + + messagelen = strlen(prison0.pr_hostname) + 3 + strlen(ostype) + 1 + strlen(osrelease); message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK); - sprintf(message, "%s - %s %s", prison0.pr_host, ostype, osrelease); + sprintf(message, "%s - %s %s", prison0.pr_hostname, ostype, osrelease); mtx_unlock(&prison0.pr_mtx); blanked = 0; switch (adp->va_mode) { Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sat Jun 13 15:39:12 2009 (r194118) @@ -478,7 +478,8 @@ ncl_mountroot(struct mount *mp) * mount the right /var based upon its preset value. */ mtx_lock(&prison0.pr_mtx); - strlcpy(prison0.pr_host, nd->my_hostnam, sizeof(prison0.pr_host)); + strlcpy(prison0.pr_hostname, nd->my_hostnam, + sizeof(prison0.pr_hostname)); mtx_unlock(&prison0.pr_mtx); inittodr(ntohl(nd->root_time)); return (0); Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/kern/kern_jail.c Sat Jun 13 15:39:12 2009 (r194118) @@ -80,7 +80,7 @@ struct prison prison0 = { .pr_uref = 1, .pr_path = "/", .pr_securelevel = -1, - .pr_uuid = "00000000-0000-0000-0000-000000000000", + .pr_hostuuid = "00000000-0000-0000-0000-000000000000", .pr_children = LIST_HEAD_INITIALIZER(&prison0.pr_children), .pr_flags = PR_HOST, .pr_allow = PR_ALLOW_ALL, @@ -1073,11 +1073,11 @@ kern_jail_set(struct thread *td, struct name = ""; if (host != NULL || domain != NULL || uuid != NULL || gothid) { if (host == NULL) - host = ppr->pr_host; + host = ppr->pr_hostname; if (domain == NULL) - domain = ppr->pr_domain; + domain = ppr->pr_domainname; if (uuid == NULL) - uuid = ppr->pr_uuid; + uuid = ppr->pr_hostuuid; if (!gothid) hid = ppr->pr_hostid; } @@ -1525,22 +1525,23 @@ kern_jail_set(struct thread *td, struct * it is always set with allprison_lock at least * shared, and is held exclusively here. */ - strlcpy(pr->pr_host, pr->pr_parent->pr_host, - sizeof(pr->pr_host)); - strlcpy(pr->pr_domain, pr->pr_parent->pr_domain, - sizeof(pr->pr_domain)); - strlcpy(pr->pr_uuid, pr->pr_parent->pr_uuid, - sizeof(pr->pr_uuid)); + strlcpy(pr->pr_hostname, pr->pr_parent->pr_hostname, + sizeof(pr->pr_hostname)); + strlcpy(pr->pr_domainname, pr->pr_parent->pr_domainname, + sizeof(pr->pr_domainname)); + strlcpy(pr->pr_hostuuid, pr->pr_parent->pr_hostuuid, + sizeof(pr->pr_hostuuid)); pr->pr_hostid = pr->pr_parent->pr_hostid; } } else if (host != NULL || domain != NULL || uuid != NULL || gothid) { /* Set this prison, and any descendants without PR_HOST. */ if (host != NULL) - strlcpy(pr->pr_host, host, sizeof(pr->pr_host)); + strlcpy(pr->pr_hostname, host, sizeof(pr->pr_hostname)); if (domain != NULL) - strlcpy(pr->pr_domain, domain, sizeof(pr->pr_domain)); + strlcpy(pr->pr_domainname, domain, + sizeof(pr->pr_domainname)); if (uuid != NULL) - strlcpy(pr->pr_uuid, uuid, sizeof(pr->pr_uuid)); + strlcpy(pr->pr_hostuuid, uuid, sizeof(pr->pr_hostuuid)); if (gothid) pr->pr_hostid = hid; FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) { @@ -1548,14 +1549,17 @@ kern_jail_set(struct thread *td, struct descend = 0; else { if (host != NULL) - strlcpy(tpr->pr_host, pr->pr_host, - sizeof(tpr->pr_host)); + strlcpy(tpr->pr_hostname, + pr->pr_hostname, + sizeof(tpr->pr_hostname)); if (domain != NULL) - strlcpy(tpr->pr_domain, pr->pr_domain, - sizeof(tpr->pr_domain)); + strlcpy(tpr->pr_domainname, + pr->pr_domainname, + sizeof(tpr->pr_domainname)); if (uuid != NULL) - strlcpy(tpr->pr_uuid, pr->pr_uuid, - sizeof(tpr->pr_uuid)); + strlcpy(tpr->pr_hostuuid, + pr->pr_hostuuid, + sizeof(tpr->pr_hostuuid)); if (gothid) tpr->pr_hostid = hid; } @@ -1873,13 +1877,13 @@ kern_jail_get(struct thread *td, struct sizeof(pr->pr_securelevel)); if (error != 0 && error != ENOENT) goto done_deref; - error = vfs_setopts(opts, "host.hostname", pr->pr_host); + error = vfs_setopts(opts, "host.hostname", pr->pr_hostname); if (error != 0 && error != ENOENT) goto done_deref; - error = vfs_setopts(opts, "host.domainname", pr->pr_domain); + error = vfs_setopts(opts, "host.domainname", pr->pr_domainname); if (error != 0 && error != ENOENT) goto done_deref; - error = vfs_setopts(opts, "host.hostuuid", pr->pr_uuid); + error = vfs_setopts(opts, "host.hostuuid", pr->pr_hostuuid); if (error != 0 && error != ENOENT) goto done_deref; #ifdef COMPAT_IA32 @@ -3220,7 +3224,7 @@ getcredhostname(struct ucred *cred, char */ pr = (cred != NULL) ? cred->cr_prison : &prison0; mtx_lock(&pr->pr_mtx); - strlcpy(buf, pr->pr_host, size); + strlcpy(buf, pr->pr_hostname, size); mtx_unlock(&pr->pr_mtx); } @@ -3229,7 +3233,7 @@ getcreddomainname(struct ucred *cred, ch { mtx_lock(&cred->cr_prison->pr_mtx); - strlcpy(buf, cred->cr_prison->pr_domain, size); + strlcpy(buf, cred->cr_prison->pr_domainname, size); mtx_unlock(&cred->cr_prison->pr_mtx); } @@ -3238,7 +3242,7 @@ getcredhostuuid(struct ucred *cred, char { mtx_lock(&cred->cr_prison->pr_mtx); - strlcpy(buf, cred->cr_prison->pr_uuid, size); + strlcpy(buf, cred->cr_prison->pr_hostuuid, size); mtx_unlock(&cred->cr_prison->pr_mtx); } @@ -3650,7 +3654,7 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) xp->pr_state = cpr->pr_uref > 0 ? PRISON_STATE_ALIVE : PRISON_STATE_DYING; strlcpy(xp->pr_path, prison_path(pr, cpr), sizeof(xp->pr_path)); - strlcpy(xp->pr_host, cpr->pr_host, sizeof(xp->pr_host)); + strlcpy(xp->pr_host, cpr->pr_hostname, sizeof(xp->pr_host)); strlcpy(xp->pr_name, prison_name(pr, cpr), sizeof(xp->pr_name)); #ifdef INET xp->pr_ip4s = cpr->pr_ip4s; @@ -3935,9 +3939,9 @@ db_show_prison(struct prison *pr) db_printf(" %s", pr_allow_names[fi]); db_printf("\n"); db_printf(" enforce_statfs = %d\n", pr->pr_enforce_statfs); - db_printf(" host.hostname = %s\n", pr->pr_host); - db_printf(" host.domainname = %s\n", pr->pr_domain); - db_printf(" host.hostuuid = %s\n", pr->pr_uuid); + db_printf(" host.hostname = %s\n", pr->pr_hostname); + db_printf(" host.domainname = %s\n", pr->pr_domainname); + db_printf(" host.hostuuid = %s\n", pr->pr_hostuuid); db_printf(" host.hostid = %lu\n", pr->pr_hostid); #ifdef INET db_printf(" ip4s = %d\n", pr->pr_ip4s); Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/kern/kern_mib.c Sat Jun 13 15:39:12 2009 (r194118) @@ -261,15 +261,15 @@ sysctl_hostname(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern, KERN_HOSTNAME, hostname, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, - (void *)(offsetof(struct prison, pr_host)), MAXHOSTNAMELEN, + (void *)(offsetof(struct prison, pr_hostname)), MAXHOSTNAMELEN, sysctl_hostname, "A", "Hostname"); SYSCTL_PROC(_kern, KERN_NISDOMAINNAME, domainname, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, - (void *)(offsetof(struct prison, pr_domain)), MAXHOSTNAMELEN, + (void *)(offsetof(struct prison, pr_domainname)), MAXHOSTNAMELEN, sysctl_hostname, "A", "Name of the current YP/NIS domain"); SYSCTL_PROC(_kern, KERN_HOSTUUID, hostuuid, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, - (void *)(offsetof(struct prison, pr_uuid)), HOSTUUIDLEN, + (void *)(offsetof(struct prison, pr_hostuuid)), HOSTUUIDLEN, sysctl_hostname, "A", "Host UUID"); static int regression_securelevel_nonmonotonic = 0; Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/kern/kern_shutdown.c Sat Jun 13 15:39:12 2009 (r194118) @@ -692,7 +692,7 @@ mkdumpheader(struct kerneldumpheader *kd kdh->dumplength = htod64(dumplen); kdh->dumptime = htod64(time_second); kdh->blocksize = htod32(blksz); - strncpy(kdh->hostname, prison0.pr_host, sizeof(kdh->hostname)); + strncpy(kdh->hostname, prison0.pr_hostname, sizeof(kdh->hostname)); strncpy(kdh->versionstring, version, sizeof(kdh->versionstring)); if (panicstr != NULL) strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/netinet6/icmp6.c Sat Jun 13 15:39:12 2009 (r194118) @@ -719,7 +719,7 @@ icmp6_input(struct mbuf **mp, int *offp, maxhlen = M_TRAILINGSPACE(n) - maxlen; pr = curthread->td_ucred->cr_prison; mtx_lock(&pr->pr_mtx); - hlen = strlen(pr->pr_host); + hlen = strlen(pr->pr_hostname); if (maxhlen > hlen) maxhlen = hlen; /* @@ -731,7 +731,8 @@ icmp6_input(struct mbuf **mp, int *offp, bcopy(icmp6, nicmp6, sizeof(struct icmp6_hdr)); p = (u_char *)(nicmp6 + 1); bzero(p, 4); - bcopy(pr->pr_host, p + 4, maxhlen); /* meaningless TTL */ + /* meaningless TTL */ + bcopy(pr->pr_hostname, p + 4, maxhlen); mtx_unlock(&pr->pr_mtx); noff = sizeof(struct ip6_hdr); n->m_pkthdr.len = n->m_len = sizeof(struct ip6_hdr) + @@ -1334,7 +1335,8 @@ ni6_input(struct mbuf *m, int off) */ pr = curthread->td_ucred->cr_prison; mtx_lock(&pr->pr_mtx); - n = ni6_nametodns(pr->pr_host, strlen(pr->pr_host), 0); + n = ni6_nametodns(pr->pr_hostname, + strlen(pr->pr_hostname), 0); mtx_unlock(&pr->pr_mtx); if (!n || n->m_next || n->m_len == 0) goto bad; @@ -1461,8 +1463,8 @@ ni6_input(struct mbuf *m, int off) */ pr = curthread->td_ucred->cr_prison; mtx_lock(&pr->pr_mtx); - n->m_next = - ni6_nametodns(pr->pr_host, strlen(pr->pr_host), oldfqdn); + n->m_next = ni6_nametodns(pr->pr_hostname, + strlen(pr->pr_hostname), oldfqdn); mtx_unlock(&pr->pr_mtx); if (n->m_next == NULL) goto bad; Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/netinet6/in6_ifattach.c Sat Jun 13 15:39:12 2009 (r194118) @@ -110,7 +110,7 @@ get_rand_ifid(struct ifnet *ifp, struct pr = curthread->td_ucred->cr_prison; mtx_lock(&pr->pr_mtx); - hostnamelen = strlen(pr->pr_host); + hostnamelen = strlen(pr->pr_hostname); #if 0 /* we need at least several letters as seed for ifid */ if (hostnamelen < 3) { @@ -122,7 +122,7 @@ get_rand_ifid(struct ifnet *ifp, struct /* generate 8 bytes of pseudo-random value. */ bzero(&ctxt, sizeof(ctxt)); MD5Init(&ctxt); - MD5Update(&ctxt, pr->pr_host, hostnamelen); + MD5Update(&ctxt, pr->pr_hostname, hostnamelen); mtx_unlock(&pr->pr_mtx); MD5Final(digest, &ctxt); @@ -637,7 +637,7 @@ in6_nigroup(struct ifnet *ifp, const cha if (!name && namelen == -1) { pr = curthread->td_ucred->cr_prison; mtx_lock(&pr->pr_mtx); - name = pr->pr_host; + name = pr->pr_hostname; namelen = strlen(name); } else pr = NULL; Modified: head/sys/nfsclient/bootp_subr.c ============================================================================== --- head/sys/nfsclient/bootp_subr.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/nfsclient/bootp_subr.c Sat Jun 13 15:39:12 2009 (r194118) @@ -1563,7 +1563,7 @@ bootpc_decode_reply(struct nfsv3_diskles } else { strcpy(nd->my_hostnam, p); mtx_lock(&prison0.pr_mtx); - strcpy(prison0.pr_host, p); + strcpy(prison0.pr_hostname, p); mtx_unlock(&prison0.pr_mtx); printf("hostname %s ", p); gctx->sethostname = ifctx; Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/nfsclient/nfs_vfsops.c Sat Jun 13 15:39:12 2009 (r194118) @@ -524,7 +524,8 @@ nfs_mountroot(struct mount *mp) * mount the right /var based upon its preset value. */ mtx_lock(&prison0.pr_mtx); - strlcpy(prison0.pr_host, nd->my_hostnam, sizeof (prison0.pr_host)); + strlcpy(prison0.pr_hostname, nd->my_hostnam, + sizeof (prison0.pr_hostname)); mtx_unlock(&prison0.pr_mtx); inittodr(ntohl(nd->root_time)); return (0); Modified: head/sys/nlm/nlm_advlock.c ============================================================================== --- head/sys/nlm/nlm_advlock.c Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/nlm/nlm_advlock.c Sat Jun 13 15:39:12 2009 (r194118) @@ -1226,7 +1226,7 @@ nlm_init_lock(struct flock *fl, int flag oh_len = strlen(oh_space); memset(lock, 0, sizeof(*lock)); - lock->caller_name = prison0.pr_host; + lock->caller_name = prison0.pr_hostname; lock->fh.n_len = fhlen; lock->fh.n_bytes = fh; lock->oh.n_len = oh_len; Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sat Jun 13 15:35:22 2009 (r194117) +++ head/sys/sys/jail.h Sat Jun 13 15:39:12 2009 (r194118) @@ -152,7 +152,7 @@ struct prison { char pr_path[MAXPATHLEN]; /* (c) chroot path */ struct cpuset *pr_cpuset; /* (p) cpuset */ struct vnode *pr_root; /* (c) vnode to rdir */ - char pr_host[MAXHOSTNAMELEN]; /* (p) jail hostname */ + char pr_hostname[MAXHOSTNAMELEN]; /* (p) jail hostname */ char pr_name[MAXHOSTNAMELEN]; /* (p) admin jail name */ struct prison *pr_parent; /* (c) containing jail */ int pr_securelevel; /* (p) securelevel */ @@ -168,8 +168,8 @@ struct prison { int pr_prisoncount; /* (a) number of child jails */ unsigned pr_allow; /* (p) PR_ALLOW_* flags */ int pr_enforce_statfs; /* (p) statfs permission */ - char pr_domain[MAXHOSTNAMELEN]; /* (p) jail domainname */ - char pr_uuid[HOSTUUIDLEN]; /* (p) jail hostuuid */ + char pr_domainname[MAXHOSTNAMELEN]; /* (p) jail domainname */ + char pr_hostuuid[HOSTUUIDLEN]; /* (p) jail hostuuid */ unsigned long pr_hostid; /* (p) jail hostid */ }; #endif /* _KERNEL || _WANT_PRISON */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 18:10:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 041E71065677; Sat, 13 Jun 2009 18:10:40 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id A20D98FC1E; Sat, 13 Jun 2009 18:10:34 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 55D062C2A81; Sat, 13 Jun 2009 13:10:34 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id UQXcct0mjPYr; Sat, 13 Jun 2009 13:10:26 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 81DDE2C2A7E; Sat, 13 Jun 2009 13:10:26 -0500 (CDT) Message-ID: <4A33EB91.2000605@cs.rice.edu> Date: Sat, 13 Jun 2009 13:10:25 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.21 (X11/20090404) MIME-Version: 1.0 To: Ed Schouten References: <200906131356.n5DDu6bT015673@svn.freebsd.org> In-Reply-To: <200906131356.n5DDu6bT015673@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194110 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 18:10:40 -0000 Ed Schouten wrote: > Author: ed > Date: Sat Jun 13 13:56:06 2009 > New Revision: 194110 > URL: http://svn.freebsd.org/changeset/base/194110 > > Log: > Simplify the inline assembler (and correct potential error) of pte_load_store(). > > Submitted by: Christoph Mallon > > Modified: > head/sys/i386/include/pmap.h > > Modified: head/sys/i386/include/pmap.h > ============================================================================== > --- head/sys/i386/include/pmap.h Sat Jun 13 13:54:03 2009 (r194109) > +++ head/sys/i386/include/pmap.h Sat Jun 13 13:56:06 2009 (r194110) > @@ -362,15 +362,8 @@ pte_load(pt_entry_t *ptep) > static __inline pt_entry_t > pte_load_store(pt_entry_t *ptep, pt_entry_t pte) > { > - pt_entry_t r; > - > - __asm __volatile( > - "xchgl %0,%1" > - : "=m" (*ptep), > - "=r" (r) > - : "1" (pte), > - "m" (*ptep)); > - return (r); > + __asm volatile("xchgl %0, %1" : "+m" (*ptep), "+r" (pte)); > + return (pte); > } > > #define pte_load_clear(pte) atomic_readandclear_int(pte) > I'm afraid that this change violates the rules, specifically, "+" cannot be combined with "m": File: gcc.info, Node: Extended Asm, Next: Constraints, Prev: Inline, Up: C Extensions 5.35 Assembler Instructions with C Expression Operands ====================================================== ... Extended asm supports input-output or read-write operands. Use the constraint character `+' to indicate such an operand and list it with the output operands. You should only use read-write operands when the constraints for the operand (or the operand in which only some of the bits are to be changed) allow a register. From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 18:35:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADA041065676; Sat, 13 Jun 2009 18:35:29 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6F08FC15; Sat, 13 Jun 2009 18:35:29 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DIZTmi021455; Sat, 13 Jun 2009 18:35:29 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DIZT0s021454; Sat, 13 Jun 2009 18:35:29 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906131835.n5DIZT0s021454@svn.freebsd.org> From: Alan Cox Date: Sat, 13 Jun 2009 18:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194123 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 18:35:30 -0000 Author: alc Date: Sat Jun 13 18:35:29 2009 New Revision: 194123 URL: http://svn.freebsd.org/changeset/base/194123 Log: Correct the method of waking the page daemon when the number of allocated pv entries surpasses the high water mark. The problem was that the page daemon would only be awakened the first time that the high water mark was surpassed. (The variable "pagedaemon_waken" is a non-working vestige of FreeBSD 4.x, in which it was external and reset by the page daemon whenever it ran. This reset allowed subsequent wakeups by the pv entry allocator.) Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Jun 13 17:09:31 2009 (r194122) +++ head/sys/powerpc/booke/pmap.c Sat Jun 13 18:35:29 2009 (r194123) @@ -156,8 +156,6 @@ static void mmu_booke_enter_locked(mmu_t unsigned int kptbl_min; /* Index of the first kernel ptbl. */ unsigned int kernel_ptbls; /* Number of KVA ptbls. */ -static int pagedaemon_waken; - /* * If user pmap is processed with mmu_booke_remove and the resident count * drops to 0, there are no more pages to remove, so we need not continue. @@ -712,11 +710,8 @@ pv_alloc(void) pv_entry_t pv; pv_entry_count++; - if ((pv_entry_count > pv_entry_high_water) && - (pagedaemon_waken == 0)) { - pagedaemon_waken = 1; - wakeup(&vm_pages_needed); - } + if (pv_entry_count > pv_entry_high_water) + pagedaemon_wakeup(); pv = uma_zalloc(pvzone, M_NOWAIT); return (pv); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 19:53:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E996A106566B for ; Sat, 13 Jun 2009 19:53:55 +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 50FC98FC16 for ; Sat, 13 Jun 2009 19:53:54 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 13 Jun 2009 19:27:13 -0000 Received: from p54A3FD19.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.253.25] by mail.gmx.net (mp060) with SMTP; 13 Jun 2009 21:27:13 +0200 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1/J67VoZOvJm6h8m8aVS5m/hqWfVTMK5y1nlSA3ce 1qSGg/JgegRhry Message-ID: <4A33FD90.2080106@gmx.de> Date: Sat, 13 Jun 2009 21:27:12 +0200 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.21 (X11/20090412) MIME-Version: 1.0 To: Alan Cox References: <200906131356.n5DDu6bT015673@svn.freebsd.org> <4A33EB91.2000605@cs.rice.edu> In-Reply-To: <4A33EB91.2000605@cs.rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.45 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r194110 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 19:53:56 -0000 Alan Cox schrieb: > Ed Schouten wrote: >> Author: ed >> Date: Sat Jun 13 13:56:06 2009 >> New Revision: 194110 >> URL: http://svn.freebsd.org/changeset/base/194110 >> >> Log: >> Simplify the inline assembler (and correct potential error) of >> pte_load_store(). >> Submitted by: Christoph Mallon >> >> Modified: >> head/sys/i386/include/pmap.h >> >> Modified: head/sys/i386/include/pmap.h >> ============================================================================== >> >> --- head/sys/i386/include/pmap.h Sat Jun 13 13:54:03 2009 (r194109) >> +++ head/sys/i386/include/pmap.h Sat Jun 13 13:56:06 2009 (r194110) >> @@ -362,15 +362,8 @@ pte_load(pt_entry_t *ptep) >> static __inline pt_entry_t >> pte_load_store(pt_entry_t *ptep, pt_entry_t pte) >> { >> - pt_entry_t r; >> - >> - __asm __volatile( >> - "xchgl %0,%1" >> - : "=m" (*ptep), >> - "=r" (r) >> - : "1" (pte), >> - "m" (*ptep)); >> - return (r); >> + __asm volatile("xchgl %0, %1" : "+m" (*ptep), "+r" (pte)); >> + return (pte); >> } >> >> #define pte_load_clear(pte) atomic_readandclear_int(pte) >> > I'm afraid that this change violates the rules, specifically, "+" cannot > be combined with "m": > > File: gcc.info, Node: Extended Asm, Next: Constraints, Prev: Inline, > Up: C Extensions > > 5.35 Assembler Instructions with C Expression Operands > ====================================================== > > ... Extended asm supports input-output or read-write > operands. Use the constraint character `+' to indicate such an operand > and list it with the output operands. You should only use read-write > operands when the constraints for the operand (or the operand in which > only some of the bits are to be changed) allow a register. It depends which part and version of the documentation you read. Take this slightly different version of the same passage: --- [...] Extended asm supports input-output or read-write operands. Use the constraint character + to indicate such an operand and list it with the output operands. When the constraints for the read-write operand (or the operand in which only some of the bits are to be changed) allows a register, you may, as an alternative, logically split its function into two separate operands, one input operand and one write-only output operand. The connection between them is expressed by constraints which say they need to be in the same location when the instruction executes. You can use the same C expression for both operands, or different expressions. For example, here we write the (fictitious) combine instruction with bar as its read-only source operand and foo as its read-write destination: asm ("combine %2,%0" : "=r" (foo) : "0" (foo), "g" (bar)); The constraint "0" for operand 1 says that it must occupy the same location as operand 0. A number in constraint is allowed only in an input operand and it must refer to an output operand. Only a number in the constraint can guarantee that one operand will be in the same place as another. The mere fact that foo is the value of both operands is not enough to guarantee that they will be in the same place in the generated assembler code. The following would not work reliably: asm ("combine %2,%0" : "=r" (foo) : "r" (foo), "g" (bar)); --- If you read this carefully, the conclusion is that the previous "=m" and "m" was invalid, because there was no direction connection between the two. Further, the explanation of '+' itself (5.36.3) does not mention anything about what you quoted from 5.35. Last, GCC itself uses +m in its backend instruction specifications: --- ;; Recall that xchg implicitly sets LOCK#, so adding it again wastes space. (define_insn "sync_lock_test_and_set" [(set (match_operand:IMODE 0 "register_operand" "=") (unspec_volatile:IMODE [(match_operand:IMODE 1 "memory_operand" "+m")] UNSPECV_XCHG)) (set (match_dup 1) (match_operand:IMODE 2 "register_operand" "0"))] "" "xchg{}\t{%1, %0|%0, %1}") --- The above implementation of the __sync_lock_test_and_set() builtin (section 5.45) performs the same operation as pte_load_store() and it uses the +m constraint for its memory operand. I rather trust the code itself than the documentation. Christoph From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 20:21:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4FE1106566B; Sat, 13 Jun 2009 20:21:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3D038FC08; Sat, 13 Jun 2009 20:21:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DKL8tv023275; Sat, 13 Jun 2009 20:21:08 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DKL8nw023274; Sat, 13 Jun 2009 20:21:08 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906132021.n5DKL8nw023274@svn.freebsd.org> From: Alan Cox Date: Sat, 13 Jun 2009 20:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194124 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 20:21:09 -0000 Author: alc Date: Sat Jun 13 20:21:08 2009 New Revision: 194124 URL: http://svn.freebsd.org/changeset/base/194124 Log: Eliminate unnecessary variables. Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Jun 13 18:35:29 2009 (r194123) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Jun 13 20:21:08 2009 (r194124) @@ -468,8 +468,7 @@ nocache: m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (m->valid != VM_PAGE_BITS_ALL) { - int behind, ahead; - if (vm_pager_has_page(tobj, idx, &behind, &ahead)) { + if (vm_pager_has_page(tobj, idx, NULL, NULL)) { error = vm_pager_get_pages(tobj, &m, 1, 0); if (error != 0) { printf("tmpfs get pages from pager error [read]\n"); @@ -583,8 +582,7 @@ nocache: tpg = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (tpg->valid != VM_PAGE_BITS_ALL) { - int behind, ahead; - if (vm_pager_has_page(tobj, idx, &behind, &ahead)) { + if (vm_pager_has_page(tobj, idx, NULL, NULL)) { error = vm_pager_get_pages(tobj, &tpg, 1, 0); if (error != 0) { printf("tmpfs get pages from pager error [write]\n"); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 20:58:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EA3A1065739; Sat, 13 Jun 2009 20:58:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BCE98FC23; Sat, 13 Jun 2009 20:58:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DKwDSd024028; Sat, 13 Jun 2009 20:58:13 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DKwDlg024027; Sat, 13 Jun 2009 20:58:13 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906132058.n5DKwDlg024027@svn.freebsd.org> From: Alan Cox Date: Sat, 13 Jun 2009 20:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194126 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 20:58:14 -0000 Author: alc Date: Sat Jun 13 20:58:12 2009 New Revision: 194126 URL: http://svn.freebsd.org/changeset/base/194126 Log: Eliminate an unnecessary clearing of a page's dirty bits in phys_pager_getpages(). Modified: head/sys/vm/phys_pager.c Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Sat Jun 13 20:54:17 2009 (r194125) +++ head/sys/vm/phys_pager.c Sat Jun 13 20:58:12 2009 (r194126) @@ -149,7 +149,8 @@ phys_pager_getpages(vm_object_t object, } KASSERT(m[i]->valid == VM_PAGE_BITS_ALL, ("phys_pager_getpages: partially valid page %p", m[i])); - m[i]->dirty = 0; + KASSERT(m[i]->dirty == 0, + ("phys_pager_getpages: dirty page %p", m[i])); /* The requested page must remain busy, the others not. */ if (reqpage != i) { m[i]->oflags &= ~VPO_BUSY; From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 21:10:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 311AF10656EB; Sat, 13 Jun 2009 21:10:42 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB338FC15; Sat, 13 Jun 2009 21:10:42 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DLAgHs024283; Sat, 13 Jun 2009 21:10:42 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DLAfpj024280; Sat, 13 Jun 2009 21:10:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906132110.n5DLAfpj024280@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 13 Jun 2009 21:10: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: r194127 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 21:10:44 -0000 Author: jilles Date: Sat Jun 13 21:10:41 2009 New Revision: 194127 URL: http://svn.freebsd.org/changeset/base/194127 Log: Don't skip forking for an external command if any traps are active. Example: sh -c '(trap "echo trapped" EXIT; sleep 3)' now correctly prints "trapped". With this check, it is no longer necessary to check for -T explicitly in that case. This is a useful bugfix by itself and also important because I plan to skip forking more often. PR: bin/113860 (part of) PR: bin/74404 (part of) Reviewed by: stefanf Approved by: ed (mentor) Modified: head/bin/sh/eval.c head/bin/sh/trap.c head/bin/sh/trap.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Jun 13 20:58:12 2009 (r194126) +++ head/bin/sh/eval.c Sat Jun 13 21:10:41 2009 (r194127) @@ -731,7 +731,7 @@ evalcommand(union node *cmd, int flags, /* Fork off a child process if necessary. */ if (cmd->ncmd.backgnd || (cmdentry.cmdtype == CMDNORMAL - && ((flags & EV_EXIT) == 0 || Tflag)) + && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 && (cmdentry.cmdtype != CMDBUILTIN || cmdentry.u.index == CDCMD Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sat Jun 13 20:58:12 2009 (r194126) +++ head/bin/sh/trap.c Sat Jun 13 21:10:41 2009 (r194127) @@ -222,6 +222,21 @@ clear_traps(void) /* + * Check if we have any traps enabled. + */ +int +have_traps(void) +{ + char *volatile *tp; + + for (tp = trap ; tp <= &trap[NSIG - 1] ; tp++) { + if (*tp && **tp) /* trap not NULL or SIG_IGN */ + return 1; + } + return 0; +} + +/* * Set the signal handler for the specified signal. The routine figures * out what it should be set to. */ Modified: head/bin/sh/trap.h ============================================================================== --- head/bin/sh/trap.h Sat Jun 13 20:58:12 2009 (r194126) +++ head/bin/sh/trap.h Sat Jun 13 21:10:41 2009 (r194127) @@ -39,6 +39,7 @@ extern volatile sig_atomic_t gotwinch; int trapcmd(int, char **); void clear_traps(void); +int have_traps(void); void setsignal(int); void ignoresig(int); void onsig(int); From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 21:17:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32502106566B; Sat, 13 Jun 2009 21:17:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20B788FC0A; Sat, 13 Jun 2009 21:17:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DLHkd2024521; Sat, 13 Jun 2009 21:17:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DLHj7B024516; Sat, 13 Jun 2009 21:17:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906132117.n5DLHj7B024516@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 13 Jun 2009 21:17: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: r194128 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 21:17:46 -0000 Author: jilles Date: Sat Jun 13 21:17:45 2009 New Revision: 194128 URL: http://svn.freebsd.org/changeset/base/194128 Log: Avoid leaving unnecessary waiting shells in many forms of sh -c COMMAND. This change only affects strings passed to -c, when the -s option is not used. The approach is to check if there may be additional data in the string after parsing each command. If there is none, use the EV_EXIT flag so that a fork may be omitted in specific cases. If there are empty lines after the command, the check will not see the end and forks will not be omitted. The same thing seems to happen in bash. Example: sh -c 'ps lT' No longer shows a shell process waiting for ps to finish. PR: bin/113860 Reviewed by: stefanf Approved by: ed (mentor) Modified: head/bin/sh/eval.c head/bin/sh/eval.h head/bin/sh/input.c head/bin/sh/input.h head/bin/sh/main.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Jun 13 21:10:41 2009 (r194127) +++ head/bin/sh/eval.c Sat Jun 13 21:17:45 2009 (r194128) @@ -74,11 +74,6 @@ __FBSDID("$FreeBSD$"); #endif -/* flags in argument to evaltree */ -#define EV_EXIT 01 /* exit after evaluating tree */ -#define EV_TESTED 02 /* exit status is checked; ignore -e flag */ -#define EV_BACKCMD 04 /* command executing within back quotes */ - MKINIT int evalskip; /* set if we are skipping commands */ STATIC int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ @@ -163,20 +158,28 @@ evalstring(char *s, int flags) { union node *n; struct stackmark smark; + int flags_exit; + flags_exit = flags & EV_EXIT; + flags &= ~EV_EXIT; setstackmark(&smark); setinputstring(s, 1); while ((n = parsecmd(0)) != NEOF) { - if (n != NULL) - evaltree(n, flags); + if (n != NULL) { + if (flags_exit && preadateof()) + evaltree(n, flags | EV_EXIT); + else + evaltree(n, flags); + } popstackmark(&smark); } popfile(); popstackmark(&smark); + if (flags_exit) + exitshell(exitstatus); } - /* * Evaluate a parse tree. The value is left in the global variable * exitstatus. Modified: head/bin/sh/eval.h ============================================================================== --- head/bin/sh/eval.h Sat Jun 13 21:10:41 2009 (r194127) +++ head/bin/sh/eval.h Sat Jun 13 21:17:45 2009 (r194128) @@ -45,6 +45,11 @@ struct backcmd { /* result of evalbackc struct job *jp; /* job structure for command */ }; +/* flags in argument to evaltree/evalstring */ +#define EV_EXIT 01 /* exit after evaluating tree */ +#define EV_TESTED 02 /* exit status is checked; ignore -e flag */ +#define EV_BACKCMD 04 /* command executing within back quotes */ + int evalcmd(int, char **); void evalstring(char *, int); union node; /* BLETCH for ansi C */ Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sat Jun 13 21:10:41 2009 (r194127) +++ head/bin/sh/input.c Sat Jun 13 21:17:45 2009 (r194128) @@ -321,6 +321,23 @@ check: } /* + * Returns if we are certain we are at EOF. Does not cause any more input + * to be read from the outside world. + */ + +int +preadateof(void) +{ + if (parsenleft > 0) + return 0; + if (parsefile->strpush) + return 0; + if (parsenleft == EOF_NLEFT || parsefile->buf == NULL) + return 1; + return 0; +} + +/* * Undo the last call to pgetc. Only one character may be pushed back. * PEOF may be pushed back. */ Modified: head/bin/sh/input.h ============================================================================== --- head/bin/sh/input.h Sat Jun 13 21:10:41 2009 (r194127) +++ head/bin/sh/input.h Sat Jun 13 21:17:45 2009 (r194128) @@ -48,6 +48,7 @@ extern int init_editline; /* 0 == not se char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); +int preadateof(void); void pungetc(void); void pushstring(char *, int, void *); void popstring(void); Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sat Jun 13 21:10:41 2009 (r194127) +++ head/bin/sh/main.c Sat Jun 13 21:17:45 2009 (r194128) @@ -178,7 +178,7 @@ state2: state3: state = 4; if (minusc) { - evalstring(minusc, 0); + evalstring(minusc, sflag ? 0 : EV_EXIT); } if (sflag || minusc == NULL) { state4: /* XXX ??? - why isn't this before the "if" statement */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 21:55:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB6B71065676; Sat, 13 Jun 2009 21:55:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D90B28FC1B; Sat, 13 Jun 2009 21:55:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DLt8VL025264; Sat, 13 Jun 2009 21:55:08 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DLt8FI025262; Sat, 13 Jun 2009 21:55:08 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906132155.n5DLt8FI025262@svn.freebsd.org> From: Kip Macy Date: Sat, 13 Jun 2009 21:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194130 - in head/sys/dev/xen: blkfront netfront X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 21:55:10 -0000 Author: kmacy Date: Sat Jun 13 21:55:08 2009 New Revision: 194130 URL: http://svn.freebsd.org/changeset/base/194130 Log: update backend_changed to reflect .m prototype Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sat Jun 13 21:45:31 2009 (r194129) +++ head/sys/dev/xen/blkfront/blkfront.c Sat Jun 13 21:55:08 2009 (r194130) @@ -500,7 +500,7 @@ setup_blkring(device_t dev, struct blkfr /** * Callback received when the backend's state changes. */ -static void +static int blkfront_backend_changed(device_t dev, XenbusState backend_state) { struct blkfront_info *info = device_get_softc(dev); @@ -542,6 +542,8 @@ blkfront_backend_changed(device_t dev, X bdput(bd); #endif } + + return (0); } /* Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Sat Jun 13 21:45:31 2009 (r194129) +++ head/sys/dev/xen/netfront/netfront.c Sat Jun 13 21:55:08 2009 (r194130) @@ -618,7 +618,7 @@ netfront_send_fake_arp(device_t dev, str /** * Callback received when the backend's state changes. */ -static void +static int netfront_backend_changed(device_t dev, XenbusState newstate) { struct netfront_info *sc = device_get_softc(dev); @@ -646,6 +646,7 @@ netfront_backend_changed(device_t dev, X xenbus_set_state(dev, XenbusStateClosed); break; } + return (0); } static void From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 23:16:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28286106566B; Sat, 13 Jun 2009 23:16:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15C008FC14; Sat, 13 Jun 2009 23:16:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DNGeEJ027164; Sat, 13 Jun 2009 23:16:40 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DNGekM027163; Sat, 13 Jun 2009 23:16:40 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906132316.n5DNGekM027163@svn.freebsd.org> From: Rick Macklem Date: Sat, 13 Jun 2009 23:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194133 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 23:16:41 -0000 Author: rmacklem Date: Sat Jun 13 23:16:40 2009 New Revision: 194133 URL: http://svn.freebsd.org/changeset/base/194133 Log: When a Solaris10 client does an NFS mount using krb5i or krb5p, the server would crash because the Solaris10 client would attempt to use Sun's NFSACL protocol, which FreeBSD doesn't support. When the server generated the error reply via svcerr_noprog(), it would cause a crash because it would try and wrap a NULL reply. According to RFC2203, no wrapping is required for error cases. This one line change avoids wrapping of NULL replies. Reviewed by: dfr Approved by: kib (mentor) Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Sat Jun 13 23:05:54 2009 (r194132) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Sat Jun 13 23:16:40 2009 (r194133) @@ -1442,7 +1442,7 @@ svc_rpc_gss_wrap(SVCAUTH *auth, struct m cc = (struct svc_rpc_gss_cookedcred *) auth->svc_ah_private; client = cc->cc_client; if (client->cl_state != CLIENT_ESTABLISHED - || cc->cc_service == rpc_gss_svc_none) { + || cc->cc_service == rpc_gss_svc_none || *mp == NULL) { return (TRUE); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 23:27:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF6D106566C; Sat, 13 Jun 2009 23:27:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183CE8FC08; Sat, 13 Jun 2009 23:27:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DNR4KO027384; Sat, 13 Jun 2009 23:27:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DNR4qR027382; Sat, 13 Jun 2009 23:27:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906132327.n5DNR4qR027382@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Jun 2009 23:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194134 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 23:27:05 -0000 Author: marius Date: Sat Jun 13 23:27:04 2009 New Revision: 194134 URL: http://svn.freebsd.org/changeset/base/194134 Log: - Also probe DP83865, which is an is an ultra low power version of the DP83861 and DP83891. - Reset the PHY during attach so it's in a known state. - Add a comment describing why we hardwire 10baseT support in the BMSR. - Always explicitly set IFM_HDX for half-duplex. [1] Obtained from: OpenBSD [1] MFC after: 2 weeks Modified: head/sys/dev/mii/miidevs head/sys/dev/mii/nsgphy.c Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Sat Jun 13 23:16:40 2009 (r194133) +++ head/sys/dev/mii/miidevs Sat Jun 13 23:27:04 2009 (r194134) @@ -204,6 +204,7 @@ model NATSEMI DP83815 0x0002 DP83815 10 model NATSEMI DP83847 0x0003 DP83847 10/100 media interface model NATSEMI DP83891 0x0005 DP83891 10/100/1000 media interface model NATSEMI DP83861 0x0006 DP83861 10/100/1000 media interface +model NATSEMI DP83865 0x0007 DP83865 10/100/1000 media interface /* Quality Semiconductor PHYs */ model QUALSEMI QS6612 0x0000 QS6612 10/100 media interface Modified: head/sys/dev/mii/nsgphy.c ============================================================================== --- head/sys/dev/mii/nsgphy.c Sat Jun 13 23:16:40 2009 (r194133) +++ head/sys/dev/mii/nsgphy.c Sat Jun 13 23:27:04 2009 (r194134) @@ -41,17 +41,19 @@ __FBSDID("$FreeBSD$"); /* - * Driver for the National Semiconductor DP83891 and DP83861 + * Driver for the National Semiconductor DP83861, DP83865 and DP83891 * 10/100/1000 PHYs. * Datasheet available at: http://www.national.com/ds/DP/DP83861.pdf + * and at: http://www.national.com/ds/DP/DP83865.pdf * - * The DP83891 is the older NatSemi gigE PHY which isn't being sold - * anymore. The DP83861 is its replacement, which is an 'enhanced' - * firmware driven component. The major difference between the - * two is that the 83891 can't generate interrupts, while the - * 83861 can. (I think it wasn't originally designed to do this, but - * it can now thanks to firmware updates.) The 83861 also allows - * access to its internal RAM via indirect register access. + * The DP83891 is the older NS GigE PHY which isn't being sold + * anymore. The DP83861 is its replacement, which is an 'enhanced' + * firmware driven component. The major difference between the + * two is that the DP83891 can't generate interrupts, while the + * 83861 can (probably it wasn't originally designed to do this, but + * it can now thanks to firmware updates). The DP83861 also allows + * access to its internal RAM via indirect register access. The + * DP83865 is an ultra low power version of the DP83861 and DP83891. */ #include @@ -99,6 +101,7 @@ static void nsgphy_status(struct mii_sof static const struct mii_phydesc nsgphys[] = { MII_PHY_DESC(NATSEMI, DP83861), + MII_PHY_DESC(NATSEMI, DP83865), MII_PHY_DESC(NATSEMI, DP83891), MII_PHY_END }; @@ -133,8 +136,14 @@ nsgphy_attach(device_t dev) mii->mii_instance++; + mii_phy_reset(sc); + + /* + * NB: the PHY has the 10baseT BMSR bits hard-wired to 0, + * even though it supports 10baseT. + */ sc->mii_capabilities = (PHY_READ(sc, MII_BMSR) | - (BMSR_10TFDX|BMSR_10THDX)) & ma->mii_capmask; + (BMSR_10TFDX | BMSR_10THDX)) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); @@ -238,7 +247,7 @@ nsgphy_status(struct mii_softc *sc) return; } - switch (physup & (PHY_SUP_SPEED1|PHY_SUP_SPEED0)) { + switch (physup & (PHY_SUP_SPEED1 | PHY_SUP_SPEED0)) { case PHY_SUP_SPEED1: mii->mii_media_active |= IFM_1000_T; gtsr = PHY_READ(sc, MII_100T2SR); @@ -257,9 +266,13 @@ nsgphy_status(struct mii_softc *sc) default: mii->mii_media_active |= IFM_NONE; mii->mii_media_status = 0; + return; } + if (physup & PHY_SUP_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 23:36:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 491DA1065675; Sat, 13 Jun 2009 23:36:56 +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 356518FC24; Sat, 13 Jun 2009 23:36:56 +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 n5DNas29027629; Sat, 13 Jun 2009 23:36:54 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DNasI3027624; Sat, 13 Jun 2009 23:36:54 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906132336.n5DNasI3027624@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Jun 2009 23:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194135 - in head/sys/dev/ath: . ath_hal ath_hal/ar5212 ath_hal/ar5416 ath_rate/sample X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 23:36:56 -0000 Author: sam Date: Sat Jun 13 23:36:54 2009 New Revision: 194135 URL: http://svn.freebsd.org/changeset/base/194135 Log: purge HAL_TXSTAT_ALTRATE; you can figure this out by checking ts_finaltsi and it cannot be used with MCS rate codes Modified: head/sys/dev/ath/ath_hal/ah_desc.h head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Sat Jun 13 23:27:04 2009 (r194134) +++ head/sys/dev/ath/ath_hal/ah_desc.h Sat Jun 13 23:36:54 2009 (r194135) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ah_desc.h,v 1.5 2008/11/10 04:08:00 sam Exp $ + * $FreeBSD$ */ #ifndef _DEV_ATH_DESC_H @@ -36,7 +36,6 @@ struct ath_tx_status { uint16_t ts_tstamp; /* h/w assigned timestamp */ uint8_t ts_status; /* frame status, 0 => xmit ok */ uint8_t ts_rate; /* h/w transmit rate index */ -#define HAL_TXSTAT_ALTRATE 0x80 /* alternate xmit rate used */ int8_t ts_rssi; /* tx ack RSSI */ uint8_t ts_shortretry; /* # short retries */ uint8_t ts_longretry; /* # long retries */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Sat Jun 13 23:27:04 2009 (r194134) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Sat Jun 13 23:36:54 2009 (r194135) @@ -869,16 +869,13 @@ ar5212ProcTxDesc(struct ath_hal *ah, ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate0); break; case 1: - ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate1) | - HAL_TXSTAT_ALTRATE; + ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate1); break; case 2: - ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate2) | - HAL_TXSTAT_ALTRATE; + ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate2); break; case 3: - ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate3) | - HAL_TXSTAT_ALTRATE; + ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate3); break; } ts->ts_rssi = MS(ads->ds_txstatus1, AR_AckSigStrength); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Jun 13 23:27:04 2009 (r194134) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Jun 13 23:36:54 2009 (r194135) @@ -519,16 +519,13 @@ ar5416ProcTxDesc(struct ath_hal *ah, ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate0); break; case 1: - ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate1) | - HAL_TXSTAT_ALTRATE; + ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate1); break; case 2: - ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate2) | - HAL_TXSTAT_ALTRATE; + ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate2); break; case 3: - ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate3) | - HAL_TXSTAT_ALTRATE; + ts->ts_rate = MS(ads->ds_ctl3, AR_XmitRate3); break; } Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat Jun 13 23:27:04 2009 (r194134) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat Jun 13 23:36:54 2009 (r194135) @@ -561,7 +561,7 @@ ath_rate_tx_complete(struct ath_softc *s const HAL_RATE_TABLE *rt = sc->sc_currates; int mrr; - final_rix = rt->rateCodeToIndex[ts->ts_rate &~ HAL_TXSTAT_ALTRATE]; + final_rix = rt->rateCodeToIndex[ts->ts_rate]; short_tries = ts->ts_shortretry; long_tries = ts->ts_longretry + 1; frame_size = ds0->ds_ctl0 & 0x0fff; /* low-order 12 bits of ds_ctl0 */ @@ -579,7 +579,7 @@ ath_rate_tx_complete(struct ath_softc *s return; } mrr = sc->sc_mrretry && !(ic->ic_flags & IEEE80211_F_USEPROT); - if (!mrr || !(ts->ts_rate & HAL_TXSTAT_ALTRATE)) { + if (!mrr || ts->ts_finaltsi == 0) { if (!IS_RATE_DEFINED(sn, final_rix)) { badrate(ifp, 0, ts->ts_rate, long_tries, ts->ts_status); return; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jun 13 23:27:04 2009 (r194134) +++ head/sys/dev/ath/if_ath.c Sat Jun 13 23:36:54 2009 (r194135) @@ -4918,7 +4918,7 @@ ath_tx_processq(struct ath_softc *sc, st u_int8_t txant = ts->ts_antenna; sc->sc_stats.ast_ant_tx[txant]++; sc->sc_ant_tx[txant]++; - if (ts->ts_rate & HAL_TXSTAT_ALTRATE) + if (ts->ts_finaltsi != 0) sc->sc_stats.ast_tx_altrate++; pri = M_WME_GETAC(bf->bf_m); if (pri >= WME_AC_VO) From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 23:43:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABDDA106564A; Sat, 13 Jun 2009 23:43:00 +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 98D9E8FC21; Sat, 13 Jun 2009 23:43:00 +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 n5DNh0eY027762; Sat, 13 Jun 2009 23:43:00 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DNh0es027760; Sat, 13 Jun 2009 23:43:00 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906132343.n5DNh0es027760@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Jun 2009 23:43: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: r194136 - in head: sbin/ifconfig sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 23:43:01 -0000 Author: sam Date: Sat Jun 13 23:43:00 2009 New Revision: 194136 URL: http://svn.freebsd.org/changeset/base/194136 Log: Rev IEEE80211_IOC_STA_INFO abi: ni_flags grew from 16 bits to 32 bits but isi_state did not follow; expand it to 32 bits and pad to maintain alignment. Note this is an incompatible change that requires rebuilding of user applications. Submitted by: rpaulo, cbzimmer, avatar Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211_ioctl.h Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Jun 13 23:36:54 2009 (r194135) +++ head/sbin/ifconfig/ifieee80211.c Sat Jun 13 23:43:00 2009 (r194136) @@ -104,19 +104,25 @@ /* XXX need these publicly defined or similar */ #ifndef IEEE80211_NODE_AUTH -#define IEEE80211_NODE_AUTH 0x0001 /* authorized for data */ -#define IEEE80211_NODE_QOS 0x0002 /* QoS enabled */ -#define IEEE80211_NODE_ERP 0x0004 /* ERP enabled */ -#define IEEE80211_NODE_PWR_MGT 0x0010 /* power save mode enabled */ -#define IEEE80211_NODE_HT 0x0040 /* HT enabled */ -#define IEEE80211_NODE_HTCOMPAT 0x0080 /* HT setup w/ vendor OUI's */ -#define IEEE80211_NODE_WPS 0x0100 /* WPS association */ -#define IEEE80211_NODE_TSN 0x0200 /* TSN association */ -#define IEEE80211_NODE_AMPDU_RX 0x0400 /* AMPDU rx enabled */ -#define IEEE80211_NODE_AMPDU_TX 0x0800 /* AMPDU tx enabled */ -#define IEEE80211_NODE_MIMO_PS 0x1000 /* MIMO power save enabled */ -#define IEEE80211_NODE_MIMO_RTS 0x2000 /* send RTS in MIMO PS */ -#define IEEE80211_NODE_RIFS 0x4000 /* RIFS enabled */ +#define IEEE80211_NODE_AUTH 0x000001 /* authorized for data */ +#define IEEE80211_NODE_QOS 0x000002 /* QoS enabled */ +#define IEEE80211_NODE_ERP 0x000004 /* ERP enabled */ +#define IEEE80211_NODE_PWR_MGT 0x000010 /* power save mode enabled */ +#define IEEE80211_NODE_AREF 0x000020 /* authentication ref held */ +#define IEEE80211_NODE_HT 0x000040 /* HT enabled */ +#define IEEE80211_NODE_HTCOMPAT 0x000080 /* HT setup w/ vendor OUI's */ +#define IEEE80211_NODE_WPS 0x000100 /* WPS association */ +#define IEEE80211_NODE_TSN 0x000200 /* TSN association */ +#define IEEE80211_NODE_AMPDU_RX 0x000400 /* AMPDU rx enabled */ +#define IEEE80211_NODE_AMPDU_TX 0x000800 /* AMPDU tx enabled */ +#define IEEE80211_NODE_MIMO_PS 0x001000 /* MIMO power save enabled */ +#define IEEE80211_NODE_MIMO_RTS 0x002000 /* send RTS in MIMO PS */ +#define IEEE80211_NODE_RIFS 0x004000 /* RIFS enabled */ +#define IEEE80211_NODE_SGI20 0x008000 /* Short GI in HT20 enabled */ +#define IEEE80211_NODE_SGI40 0x010000 /* Short GI in HT40 enabled */ +#define IEEE80211_NODE_ASSOCID 0x020000 /* xmit requires associd */ +#define IEEE80211_NODE_AMSDU_RX 0x040000 /* AMSDU rx enabled */ +#define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */ #endif #define MAXCHAN 1536 /* max 1.5K channels */ @@ -2302,6 +2308,16 @@ getflags(int flags) } if (flags & IEEE80211_NODE_RIFS) *cp++ = 'I'; + if (flags & IEEE80211_NODE_SGI40) { + *cp++ = 'S'; + if (flags & IEEE80211_NODE_SGI20) + *cp++ = '+'; + } else if (flags & IEEE80211_NODE_SGI20) + *cp++ = 's'; + if (flags & IEEE80211_NODE_AMSDU_TX) + *cp++ = 't'; + if (flags & IEEE80211_NODE_AMSDU_RX) + *cp++ = 'r'; *cp = '\0'; return flagstring; } @@ -3081,8 +3097,6 @@ static enum ieee80211_opmode get80211opm static int gettxseq(const struct ieee80211req_sta_info *si) { -#define IEEE80211_NODE_QOS 0x0002 /* QoS enabled */ - int i, txseq; if ((si->isi_state & IEEE80211_NODE_QOS) == 0) @@ -3093,14 +3107,11 @@ gettxseq(const struct ieee80211req_sta_i if (si->isi_txseqs[i] > txseq) txseq = si->isi_txseqs[i]; return txseq; -#undef IEEE80211_NODE_QOS } static int getrxseq(const struct ieee80211req_sta_info *si) { -#define IEEE80211_NODE_QOS 0x0002 /* QoS enabled */ - int i, rxseq; if ((si->isi_state & IEEE80211_NODE_QOS) == 0) @@ -3111,7 +3122,6 @@ getrxseq(const struct ieee80211req_sta_i if (si->isi_rxseqs[i] > rxseq) rxseq = si->isi_rxseqs[i]; return rxseq; -#undef IEEE80211_NODE_QOS } static void @@ -3141,7 +3151,7 @@ list_stations(int s) getchaninfo(s); - printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %4s\n" + printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-7s\n" , "ADDR" , "AID" , "CHAN" @@ -3160,7 +3170,7 @@ list_stations(int s) si = (const struct ieee80211req_sta_info *) cp; if (si->isi_len < sizeof(*si)) break; - printf("%s %4u %4d %3dM %3.1f %4d %6d %6d %-4.4s %-4.4s" + printf("%s %4u %4d %3dM %3.1f %4d %6d %6d %-4.4s %-7.7s" , ether_ntoa((const struct ether_addr*) si->isi_macaddr) , IEEE80211_AID(si->isi_associd) , ieee80211_mhz2ieee(si->isi_freq, si->isi_flags) Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Sat Jun 13 23:36:54 2009 (r194135) +++ head/sys/net80211/ieee80211_ioctl.h Sat Jun 13 23:43:00 2009 (r194136) @@ -362,7 +362,7 @@ struct ieee80211req_sta_info { uint16_t isi_ie_len; /* IE length */ uint16_t isi_freq; /* MHz */ uint32_t isi_flags; /* channel flags */ - uint16_t isi_state; /* state flags */ + uint32_t isi_state; /* state flags */ uint8_t isi_authmode; /* authentication algorithm */ int8_t isi_rssi; /* receive signal strength */ int8_t isi_noise; /* noise floor */ @@ -381,6 +381,7 @@ struct ieee80211req_sta_info { uint16_t isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */ uint16_t isi_inact; /* inactivity timer */ uint16_t isi_txmbps; /* current tx rate in .5 Mb/s */ + uint16_t isi_pad; uint32_t isi_jointime; /* time of assoc/join */ struct ieee80211_mimo_info isi_mimo; /* MIMO info for 11n sta's */ /* XXX frag state? */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 23:44:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D39331065672; Sat, 13 Jun 2009 23:44:56 +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 C1AE98FC12; Sat, 13 Jun 2009 23:44:56 +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 n5DNiuIL027844; Sat, 13 Jun 2009 23:44:56 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DNiu67027843; Sat, 13 Jun 2009 23:44:56 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906132344.n5DNiu67027843@svn.freebsd.org> From: Sam Leffler Date: Sat, 13 Jun 2009 23:44: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: r194137 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 23:44:57 -0000 Author: sam Date: Sat Jun 13 23:44:56 2009 New Revision: 194137 URL: http://svn.freebsd.org/changeset/base/194137 Log: note abi change for IEEE80211_IOC_STA_INFO Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jun 13 23:43:00 2009 (r194136) +++ head/UPDATING Sat Jun 13 23:44:56 2009 (r194137) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090613: + The layout of the structure returned by IEEE80211_IOC_STA_INFO + has changed. User applications that use this ioctl need to be + rebuilt. + 20090611: The layout of struct thread has changed. Kernel and modules need to be rebuilt.